From: support
Date: Wed, 6 Apr 2022 15:34:51 +0000 (+0000)
Subject: Built motion from commit 5ae82ce5.|2.6.7
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22angular-material.layout.css/%22?a=commitdiff_plain;h=f242ecb854a6947e0a7e56ef417cb887d09ab219;p=motion2.git
Built motion from commit 5ae82ce5.|2.6.7
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index cc2a70f..9637fd0 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-04-06T14:06:53.454Z",
+ "time": "2022-04-06T15:27:39.084Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index cb436eb..19176dc 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-04-06T14:06:53.454Z",
+ "time": "2022-04-06T15:27:39.084Z",
"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 5f85305..f5a511d 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 _0x7522=['action','STRING','contactManager','integration','motionbar','jscripty','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','sequelize','exports','getDataValue'];(function(_0x13e36a,_0x57de74){var _0x5c9f65=function(_0x9f33f3){while(--_0x9f33f3){_0x13e36a['push'](_0x13e36a['shift']());}};_0x5c9f65(++_0x57de74);}(_0x7522,0x12f));var _0x2752=function(_0x576dd3,_0x5a22fa){_0x576dd3=_0x576dd3-0x0;var _0x52a931=_0x7522[_0x576dd3];return _0x52a931;};'use strict';var Sequelize=require(_0x2752('0x0'));module[_0x2752('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x9c6fb1){return this[_0x2752('0x2')](_0x2752('0x3'));}},'action':{'type':Sequelize[_0x2752('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x2752('0x5'),_0x2752('0x6'),_0x2752('0x7'),_0x2752('0x8'),'urlForward',_0x2752('0x9'),'bot',_0x2752('0xa')]],'msg':_0x2752('0xb')}},'comment':_0x2752('0xb')},'data1':{'type':Sequelize[_0x2752('0x4')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x2752('0x4')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x2752('0x4')](0x1000),'comment':_0x2752('0xc')},'data4':{'type':Sequelize[_0x2752('0x4')](0x1000),'comments':_0x2752('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x2752('0xe')},'data6':{'type':Sequelize[_0x2752('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x2752('0xf')],'comments':_0x2752('0x10')}};
\ No newline at end of file
+var _0xa1f7=['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','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x158da6,_0x3cb06d){var _0x429c30=function(_0x2d5895){while(--_0x2d5895){_0x158da6['push'](_0x158da6['shift']());}};_0x429c30(++_0x3cb06d);}(_0xa1f7,0xda));var _0x7a1f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa1f7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7a1f('0x0'));module['exports']={'name':{'type':Sequelize[_0x7a1f('0x1')],'get':function(_0x3ab9f1){return this[_0x7a1f('0x2')]('action');}},'action':{'type':Sequelize[_0x7a1f('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x7a1f('0x4'),_0x7a1f('0x5'),_0x7a1f('0x6'),_0x7a1f('0x7'),_0x7a1f('0x8'),_0x7a1f('0x9'),_0x7a1f('0xa'),_0x7a1f('0xb')]],'msg':_0x7a1f('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x7a1f('0x3')](0x1000),'comment':_0x7a1f('0xd')},'data2':{'type':Sequelize[_0x7a1f('0x3')](0x1000),'comment':_0x7a1f('0xe')},'data3':{'type':Sequelize[_0x7a1f('0x3')](0x1000),'comment':_0x7a1f('0xf')},'data4':{'type':Sequelize[_0x7a1f('0x3')](0x1000),'comments':_0x7a1f('0x10')},'data5':{'type':Sequelize[_0x7a1f('0x3')](0x1000),'comments':_0x7a1f('0x11')},'data6':{'type':Sequelize[_0x7a1f('0x3')],'comments':_0x7a1f('0x12')},'data7':{'type':Sequelize[_0x7a1f('0x13')],'comments':_0x7a1f('0x14')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 49c7a21..86f0d2e 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 _0x1a7c=['then','destroy','sendStatus','error','stack','name','body','Action','find','params','catch','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update'];(function(_0x451c84,_0xc44ca){var _0x404605=function(_0x3c04c1){while(--_0x3c04c1){_0x451c84['push'](_0x451c84['shift']());}};_0x404605(++_0xc44ca);}(_0x1a7c,0x95));var _0xc1a7=function(_0x54b0f3,_0x1fe2f7){_0x54b0f3=_0x54b0f3-0x0;var _0x5ae957=_0x1a7c[_0x54b0f3];return _0x5ae957;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc1a7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc1a7('0x1'));var rp=require(_0xc1a7('0x2'));var moment=require('moment');var BPromise=require(_0xc1a7('0x3'));var Mustache=require(_0xc1a7('0x4'));var util=require('util');var path=require(_0xc1a7('0x5'));var sox=require(_0xc1a7('0x6'));var csv=require(_0xc1a7('0x7'));var ejs=require(_0xc1a7('0x8'));var fs=require('fs');var fs_extra=require(_0xc1a7('0x9'));var _=require('lodash');var squel=require(_0xc1a7('0xa'));var crypto=require(_0xc1a7('0xb'));var jsforce=require(_0xc1a7('0xc'));var deskjs=require(_0xc1a7('0xd'));var toCsv=require(_0xc1a7('0x7'));var querystring=require(_0xc1a7('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc1a7('0xf'));var qs=require(_0xc1a7('0x10'));var as=require(_0xc1a7('0x11'));var hardwareService=require(_0xc1a7('0x12'));var logger=require(_0xc1a7('0x13'))(_0xc1a7('0x14'));var utils=require(_0xc1a7('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc1a7('0x16'))['db'];function respondWithStatusCode(_0x5e5176,_0x4c2f07){_0x4c2f07=_0x4c2f07||0xcc;return function(_0x2a4818){if(_0x2a4818){return _0x5e5176['sendStatus'](_0x4c2f07);}return _0x5e5176[_0xc1a7('0x17')](_0x4c2f07)[_0xc1a7('0x18')]();};}function respondWithResult(_0xee03b1,_0x2b56a1){_0x2b56a1=_0x2b56a1||0xc8;return function(_0x3612ba){if(_0x3612ba){return _0xee03b1['status'](_0x2b56a1)['json'](_0x3612ba);}};}function respondWithFilteredResult(_0x522b6a,_0x36e0fe){return function(_0x4e19d1){if(_0x4e19d1){var _0x3ccec3=typeof _0x36e0fe[_0xc1a7('0x19')]===_0xc1a7('0x1a')&&typeof _0x36e0fe[_0xc1a7('0x1b')]===_0xc1a7('0x1a');var _0x3bbaf9=_0x4e19d1[_0xc1a7('0x1c')];var _0x4f403f=_0x3ccec3?0x0:_0x36e0fe[_0xc1a7('0x19')];var _0x52a463=_0x3ccec3?_0x4e19d1[_0xc1a7('0x1c')]:_0x36e0fe['offset']+_0x36e0fe[_0xc1a7('0x1b')];var _0x3105c8;if(_0x52a463>=_0x3bbaf9){_0x52a463=_0x3bbaf9;_0x3105c8=0xc8;}else{_0x3105c8=0xce;}_0x522b6a[_0xc1a7('0x17')](_0x3105c8);return _0x522b6a['set'](_0xc1a7('0x1d'),_0x4f403f+'-'+_0x52a463+'/'+_0x3bbaf9)[_0xc1a7('0x1e')](_0x4e19d1);}return null;};}function patchUpdates(_0x41fae9){return function(_0x3f5cf7){try{jsonpatch[_0xc1a7('0x1f')](_0x3f5cf7,_0x41fae9,!![]);}catch(_0x3abcb9){return BPromise[_0xc1a7('0x20')](_0x3abcb9);}return _0x3f5cf7[_0xc1a7('0x21')]();};}function saveUpdates(_0x274dcb,_0x438985){return function(_0x16aa44){if(_0x16aa44){return _0x16aa44[_0xc1a7('0x22')](_0x274dcb)[_0xc1a7('0x23')](function(_0x27d3fd){return _0x27d3fd;});}return null;};}function removeEntity(_0x135b5e,_0x21a254){return function(_0x9f1553){if(_0x9f1553){return _0x9f1553[_0xc1a7('0x24')]()[_0xc1a7('0x23')](function(){_0x135b5e[_0xc1a7('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9eeef6,_0x21fc6a){return function(_0x56eabd){if(!_0x56eabd){_0x9eeef6[_0xc1a7('0x25')](0x194);}return _0x56eabd;};}function handleError(_0x13ccce,_0x1650f0){_0x1650f0=_0x1650f0||0x1f4;return function(_0x2a3034){logger[_0xc1a7('0x26')](_0x2a3034[_0xc1a7('0x27')]);if(_0x2a3034[_0xc1a7('0x28')]){delete _0x2a3034[_0xc1a7('0x28')];}_0x13ccce[_0xc1a7('0x17')](_0x1650f0)['send'](_0x2a3034);};}exports[_0xc1a7('0x22')]=function(_0x303ab8,_0x74348d){if(_0x303ab8[_0xc1a7('0x29')]['id']){delete _0x303ab8[_0xc1a7('0x29')]['id'];}return db[_0xc1a7('0x2a')][_0xc1a7('0x2b')]({'where':{'id':_0x303ab8[_0xc1a7('0x2c')]['id']}})[_0xc1a7('0x23')](handleEntityNotFound(_0x74348d,null))[_0xc1a7('0x23')](saveUpdates(_0x303ab8[_0xc1a7('0x29')],null))['then'](respondWithResult(_0x74348d,null))[_0xc1a7('0x2d')](handleError(_0x74348d,null));};exports[_0xc1a7('0x24')]=function(_0x4bf991,_0x51dcb9){return db[_0xc1a7('0x2a')]['find']({'where':{'id':_0x4bf991[_0xc1a7('0x2c')]['id']}})[_0xc1a7('0x23')](handleEntityNotFound(_0x51dcb9,null))[_0xc1a7('0x23')](removeEntity(_0x51dcb9,null))[_0xc1a7('0x2d')](handleError(_0x51dcb9,null));};
\ No newline at end of file
+var _0xec73=['count','set','apply','save','destroy','then','name','send','update','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','offset','undefined','limit'];(function(_0x1e1cde,_0xb27095){var _0x2f5aa8=function(_0x26a804){while(--_0x26a804){_0x1e1cde['push'](_0x1e1cde['shift']());}};_0x2f5aa8(++_0xb27095);}(_0xec73,0x11f));var _0x3ec7=function(_0x1b2fad,_0x1e85ec){_0x1b2fad=_0x1b2fad-0x0;var _0x325176=_0xec73[_0x1b2fad];return _0x325176;};'use strict';var emlformat=require(_0x3ec7('0x0'));var rimraf=require(_0x3ec7('0x1'));var zipdir=require(_0x3ec7('0x2'));var jsonpatch=require(_0x3ec7('0x3'));var rp=require('request-promise');var moment=require(_0x3ec7('0x4'));var BPromise=require(_0x3ec7('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3ec7('0x6'));var csv=require(_0x3ec7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3ec7('0x8'));var _=require(_0x3ec7('0x9'));var squel=require(_0x3ec7('0xa'));var crypto=require(_0x3ec7('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3ec7('0x7'));var querystring=require(_0x3ec7('0xc'));var Papa=require(_0x3ec7('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3ec7('0xe'));var as=require(_0x3ec7('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3ec7('0x10'))(_0x3ec7('0x11'));var utils=require(_0x3ec7('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x3ec7('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f2c5b,_0x2f23ae){_0x2f23ae=_0x2f23ae||0xcc;return function(_0x9c173d){if(_0x9c173d){return _0x4f2c5b[_0x3ec7('0x14')](_0x2f23ae);}return _0x4f2c5b[_0x3ec7('0x15')](_0x2f23ae)['end']();};}function respondWithResult(_0x2d4895,_0x710943){_0x710943=_0x710943||0xc8;return function(_0x3fc3d8){if(_0x3fc3d8){return _0x2d4895['status'](_0x710943)['json'](_0x3fc3d8);}};}function respondWithFilteredResult(_0x1190c8,_0x6688ca){return function(_0x13f5e4){if(_0x13f5e4){var _0x1564e8=typeof _0x6688ca[_0x3ec7('0x16')]===_0x3ec7('0x17')&&typeof _0x6688ca[_0x3ec7('0x18')]===_0x3ec7('0x17');var _0x2ba19c=_0x13f5e4[_0x3ec7('0x19')];var _0x49433c=_0x1564e8?0x0:_0x6688ca[_0x3ec7('0x16')];var _0x20518a=_0x1564e8?_0x13f5e4[_0x3ec7('0x19')]:_0x6688ca[_0x3ec7('0x16')]+_0x6688ca[_0x3ec7('0x18')];var _0x3cea7e;if(_0x20518a>=_0x2ba19c){_0x20518a=_0x2ba19c;_0x3cea7e=0xc8;}else{_0x3cea7e=0xce;}_0x1190c8[_0x3ec7('0x15')](_0x3cea7e);return _0x1190c8[_0x3ec7('0x1a')]('Content-Range',_0x49433c+'-'+_0x20518a+'/'+_0x2ba19c)['json'](_0x13f5e4);}return null;};}function patchUpdates(_0x3a0319){return function(_0x4852f8){try{jsonpatch[_0x3ec7('0x1b')](_0x4852f8,_0x3a0319,!![]);}catch(_0x3cbcf1){return BPromise['reject'](_0x3cbcf1);}return _0x4852f8[_0x3ec7('0x1c')]();};}function saveUpdates(_0x3b11e9,_0x3597fd){return function(_0x24dcb5){if(_0x24dcb5){return _0x24dcb5['update'](_0x3b11e9)['then'](function(_0x862de8){return _0x862de8;});}return null;};}function removeEntity(_0x16ecb6,_0x31b103){return function(_0xeb658a){if(_0xeb658a){return _0xeb658a[_0x3ec7('0x1d')]()[_0x3ec7('0x1e')](function(){_0x16ecb6[_0x3ec7('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18d66a,_0x4738c3){return function(_0x338f52){if(!_0x338f52){_0x18d66a['sendStatus'](0x194);}return _0x338f52;};}function handleError(_0x35bf8e,_0x434322){_0x434322=_0x434322||0x1f4;return function(_0x163cb6){logger['error'](_0x163cb6['stack']);if(_0x163cb6[_0x3ec7('0x1f')]){delete _0x163cb6[_0x3ec7('0x1f')];}_0x35bf8e[_0x3ec7('0x15')](_0x434322)[_0x3ec7('0x20')](_0x163cb6);};}exports[_0x3ec7('0x21')]=function(_0x46745f,_0x2c19ff){if(_0x46745f[_0x3ec7('0x22')]['id']){delete _0x46745f['body']['id'];}return db[_0x3ec7('0x23')][_0x3ec7('0x24')]({'where':{'id':_0x46745f[_0x3ec7('0x25')]['id']}})[_0x3ec7('0x1e')](handleEntityNotFound(_0x2c19ff,null))['then'](saveUpdates(_0x46745f['body'],null))['then'](respondWithResult(_0x2c19ff,null))[_0x3ec7('0x26')](handleError(_0x2c19ff,null));};exports['destroy']=function(_0x5b6bb9,_0x3f38fd){return db[_0x3ec7('0x23')][_0x3ec7('0x24')]({'where':{'id':_0x5b6bb9[_0x3ec7('0x25')]['id']}})[_0x3ec7('0x1e')](handleEntityNotFound(_0x3f38fd,null))[_0x3ec7('0x1e')](removeEntity(_0x3f38fd,null))[_0x3ec7('0x26')](handleError(_0x3f38fd,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 3f4c53e..9379ee1 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 _0x8c3c=['./action.attributes','Action','tools_actions','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4db483,_0x5293a9){var _0x401534=function(_0x15d072){while(--_0x15d072){_0x4db483['push'](_0x4db483['shift']());}};_0x401534(++_0x5293a9);}(_0x8c3c,0x142));var _0xc8c3=function(_0x2fa132,_0x14ab75){_0x2fa132=_0x2fa132-0x0;var _0x411d53=_0x8c3c[_0x2fa132];return _0x411d53;};'use strict';var _=require(_0xc8c3('0x0'));var util=require(_0xc8c3('0x1'));var logger=require(_0xc8c3('0x2'))(_0xc8c3('0x3'));var moment=require('moment');var BPromise=require(_0xc8c3('0x4'));var rp=require(_0xc8c3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc8c3('0x6'));var config=require(_0xc8c3('0x7'));var attributes=require(_0xc8c3('0x8'));module['exports']=function(_0x8a8f82,_0x1a4adb){return _0x8a8f82['define'](_0xc8c3('0x9'),attributes,{'tableName':_0xc8c3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xff24=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./action.attributes','exports','define','Action','tools_actions'];(function(_0x3c7784,_0x19115b){var _0x332e8e=function(_0x32b782){while(--_0x32b782){_0x3c7784['push'](_0x3c7784['shift']());}};_0x332e8e(++_0x19115b);}(_0xff24,0x82));var _0x4ff2=function(_0x3a1452,_0x5ba3a4){_0x3a1452=_0x3a1452-0x0;var _0x2a8fc5=_0xff24[_0x3a1452];return _0x2a8fc5;};'use strict';var _=require(_0x4ff2('0x0'));var util=require('util');var logger=require(_0x4ff2('0x1'))(_0x4ff2('0x2'));var moment=require(_0x4ff2('0x3'));var BPromise=require(_0x4ff2('0x4'));var rp=require(_0x4ff2('0x5'));var fs=require('fs');var path=require(_0x4ff2('0x6'));var rimraf=require('rimraf');var config=require(_0x4ff2('0x7'));var attributes=require(_0x4ff2('0x8'));module[_0x4ff2('0x9')]=function(_0x5d7fcc,_0x36a23a){return _0x5d7fcc[_0x4ff2('0xa')](_0x4ff2('0xb'),attributes,{'tableName':_0x4ff2('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 0a2e931..3be11ae 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x5e1914,_0x1313a3){var _0x4fb013=function(_0x31be59){while(--_0x31be59){_0x5e1914['push'](_0x5e1914['shift']());}};_0x4fb013(++_0x1313a3);}(_0xe14b,0x93));var _0xbe14=function(_0x20b807,_0x35fa4a){_0x20b807=_0x20b807-0x0;var _0x147302=_0xe14b[_0x20b807];return _0x147302;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
+var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2817ca,_0x168a1a){_0x2817ca=_0x2817ca-0x0;var _0x343ee3=_0x1cb9[_0x2817ca];return _0x343ee3;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index e429b36..ef5f101 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 _0x9434=['isAuthenticated','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./action.controller'];(function(_0x53e137,_0x4cfdcd){var _0x39ae2e=function(_0x25a0ed){while(--_0x25a0ed){_0x53e137['push'](_0x53e137['shift']());}};_0x39ae2e(++_0x4cfdcd);}(_0x9434,0x71));var _0x4943=function(_0x430e88,_0x1eabcb){_0x430e88=_0x430e88-0x0;var _0x5616e0=_0x9434[_0x430e88];return _0x5616e0;};'use strict';var multer=require(_0x4943('0x0'));var util=require(_0x4943('0x1'));var path=require('path');var timeout=require(_0x4943('0x2'));var express=require(_0x4943('0x3'));var router=express[_0x4943('0x4')]();var fs_extra=require(_0x4943('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4943('0x6'));var config=require('../../config/environment');var controller=require(_0x4943('0x7'));router['put']('/:id',auth[_0x4943('0x8')](),controller[_0x4943('0x9')]);router[_0x4943('0xa')]('/:id',auth[_0x4943('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xa6b7=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated'];(function(_0x135365,_0x5ce7bf){var _0x3cdc77=function(_0x589ebe){while(--_0x589ebe){_0x135365['push'](_0x135365['shift']());}};_0x3cdc77(++_0x5ce7bf);}(_0xa6b7,0x184));var _0x7a6b=function(_0xabfec4,_0x35076e){_0xabfec4=_0xabfec4-0x0;var _0x7bafa2=_0xa6b7[_0xabfec4];return _0x7bafa2;};'use strict';var multer=require(_0x7a6b('0x0'));var util=require(_0x7a6b('0x1'));var path=require(_0x7a6b('0x2'));var timeout=require(_0x7a6b('0x3'));var express=require('express');var router=express[_0x7a6b('0x4')]();var fs_extra=require(_0x7a6b('0x5'));var auth=require(_0x7a6b('0x6'));var interaction=require(_0x7a6b('0x7'));var config=require('../../config/environment');var controller=require(_0x7a6b('0x8'));router[_0x7a6b('0x9')](_0x7a6b('0xa'),auth[_0x7a6b('0xb')](),controller[_0x7a6b('0xc')]);router[_0x7a6b('0xd')](_0x7a6b('0xa'),auth['isAuthenticated'](),controller[_0x7a6b('0xe')]);module[_0x7a6b('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 6aade28..c4a65c2 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 _0xb138=['TEXT','sequelize','exports','STRING'];(function(_0x4da133,_0x3f7748){var _0xf1969e=function(_0x46055e){while(--_0x46055e){_0x4da133['push'](_0x4da133['shift']());}};_0xf1969e(++_0x3f7748);}(_0xb138,0x1dd));var _0x8b13=function(_0x37f2d6,_0x2aa0ca){_0x37f2d6=_0x37f2d6-0x0;var _0x2b3d86=_0xb138[_0x37f2d6];return _0x2b3d86;};'use strict';var Sequelize=require(_0x8b13('0x0'));module[_0x8b13('0x1')]={'name':{'type':Sequelize[_0x8b13('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8b13('0x2')]},'parent':{'type':Sequelize[_0x8b13('0x2')]},'table':{'type':Sequelize[_0x8b13('0x2')]},'conditions':{'type':Sequelize[_0x8b13('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x46ed,0x168));var _0xd46e=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x46ed[_0x2c7618];return _0x5ce3f0;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 4ee8136..97fff75 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 _0x7cbd=['generate','csv','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','savename','COUNT(*)','SELECT','run','runReport','AVG(%s)','groupBy','Limited\x20Query:','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','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','dbH','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','format','replace','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','keyBy','MetricId','metric','output','web','%s-%s.%s','randomstring'];(function(_0x5b1aed,_0x322c17){var _0x26add8=function(_0x58a9d7){while(--_0x58a9d7){_0x5b1aed['push'](_0x5b1aed['shift']());}};_0x26add8(++_0x322c17);}(_0x7cbd,0xb9));var _0xd7cb=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x7cbd[_0x173d7e];return _0x2220d6;};'use strict';var emlformat=require(_0xd7cb('0x0'));var rimraf=require(_0xd7cb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd7cb('0x2'));var moment=require(_0xd7cb('0x3'));var BPromise=require(_0xd7cb('0x4'));var Mustache=require('mustache');var util=require(_0xd7cb('0x5'));var path=require(_0xd7cb('0x6'));var sox=require(_0xd7cb('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7cb('0x8'));var squel=require(_0xd7cb('0x9'));var crypto=require(_0xd7cb('0xa'));var jsforce=require(_0xd7cb('0xb'));var deskjs=require(_0xd7cb('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd7cb('0xd'));var Papa=require(_0xd7cb('0xe'));var Redis=require(_0xd7cb('0xf'));var authService=require(_0xd7cb('0x10'));var qs=require(_0xd7cb('0x11'));var as=require(_0xd7cb('0x12'));var hardwareService=require(_0xd7cb('0x13'));var logger=require(_0xd7cb('0x14'))(_0xd7cb('0x15'));var utils=require(_0xd7cb('0x16'));var config=require(_0xd7cb('0x17'));var licenseUtil=require(_0xd7cb('0x18'));var db=require(_0xd7cb('0x19'))['db'];var dbH=require(_0xd7cb('0x19'))[_0xd7cb('0x1a')];function respondWithStatusCode(_0x166969,_0x243187){_0x243187=_0x243187||0xcc;return function(_0x293af2){if(_0x293af2){return _0x166969[_0xd7cb('0x1b')](_0x243187);}return _0x166969['status'](_0x243187)[_0xd7cb('0x1c')]();};}function respondWithResult(_0x2d86c8,_0x506981){_0x506981=_0x506981||0xc8;return function(_0x308185){if(_0x308185){return _0x2d86c8[_0xd7cb('0x1d')](_0x506981)[_0xd7cb('0x1e')](_0x308185);}};}function respondWithFilteredResult(_0x54b738,_0x34f217){return function(_0x3186a6){if(_0x3186a6){var _0x57af5b=typeof _0x34f217[_0xd7cb('0x1f')]===_0xd7cb('0x20')&&typeof _0x34f217[_0xd7cb('0x21')]==='undefined';var _0x4a026e=_0x3186a6[_0xd7cb('0x22')];var _0x23b582=_0x57af5b?0x0:_0x34f217['offset'];var _0x356327=_0x57af5b?_0x3186a6[_0xd7cb('0x22')]:_0x34f217[_0xd7cb('0x1f')]+_0x34f217['limit'];var _0x55f7f6;if(_0x356327>=_0x4a026e){_0x356327=_0x4a026e;_0x55f7f6=0xc8;}else{_0x55f7f6=0xce;}_0x54b738[_0xd7cb('0x1d')](_0x55f7f6);return _0x54b738[_0xd7cb('0x23')](_0xd7cb('0x24'),_0x23b582+'-'+_0x356327+'/'+_0x4a026e)[_0xd7cb('0x1e')](_0x3186a6);}return null;};}function patchUpdates(_0x1cb0cb){return function(_0x31b994){try{jsonpatch[_0xd7cb('0x25')](_0x31b994,_0x1cb0cb,!![]);}catch(_0x2a4e9f){return BPromise['reject'](_0x2a4e9f);}return _0x31b994[_0xd7cb('0x26')]();};}function saveUpdates(_0x4ac38c,_0x340817){return function(_0x3f2edf){if(_0x3f2edf){return _0x3f2edf[_0xd7cb('0x27')](_0x4ac38c)[_0xd7cb('0x28')](function(_0x255025){return _0x255025;});}return null;};}function removeEntity(_0x5b5c74,_0x200e39){return function(_0xab80a2){if(_0xab80a2){return _0xab80a2[_0xd7cb('0x29')]()[_0xd7cb('0x28')](function(){var _0x536d2d=_0xab80a2[_0xd7cb('0x2a')]({'plain':!![]});var _0x59e491=_0xd7cb('0x2b');return db[_0xd7cb('0x2c')][_0xd7cb('0x29')]({'where':{'type':_0x59e491,'resourceId':_0x536d2d['id']}})[_0xd7cb('0x28')](function(){return _0xab80a2;});})[_0xd7cb('0x28')](function(){_0x5b5c74['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x589eba,_0x4a7ae2){return function(_0x18cf55){if(!_0x18cf55){_0x589eba['sendStatus'](0x194);}return _0x18cf55;};}function handleError(_0x21a6f3,_0x49cbad){_0x49cbad=_0x49cbad||0x1f4;return function(_0x105787){logger[_0xd7cb('0x2d')](_0x105787[_0xd7cb('0x2e')]);if(_0x105787[_0xd7cb('0x2f')]){delete _0x105787[_0xd7cb('0x2f')];}_0x21a6f3[_0xd7cb('0x1d')](_0x49cbad)[_0xd7cb('0x30')](_0x105787);};}exports[_0xd7cb('0x31')]=function(_0x568833,_0x2ad5ab){var _0x2c9251={},_0x9cf5ed={},_0x13e90b={'count':0x0,'rows':[]};var _0x32bff5=_['map'](db[_0xd7cb('0x32')][_0xd7cb('0x33')],function(_0x120413){return{'name':_0x120413[_0xd7cb('0x34')],'type':_0x120413[_0xd7cb('0x35')][_0xd7cb('0x36')]};});_0x9cf5ed[_0xd7cb('0x37')]=_[_0xd7cb('0x38')](_0x32bff5,'name');_0x9cf5ed[_0xd7cb('0x39')]=_[_0xd7cb('0x3a')](_0x568833[_0xd7cb('0x39')]);_0x9cf5ed[_0xd7cb('0x3b')]=_[_0xd7cb('0x3c')](_0x9cf5ed[_0xd7cb('0x37')],_0x9cf5ed['query']);_0x2c9251['attributes']=_[_0xd7cb('0x3c')](_0x9cf5ed['model'],qs[_0xd7cb('0x3d')](_0x568833[_0xd7cb('0x39')]['fields']));_0x2c9251['attributes']=_0x2c9251['attributes']['length']?_0x2c9251[_0xd7cb('0x3e')]:_0x9cf5ed['model'];if(!_0x568833[_0xd7cb('0x39')][_0xd7cb('0x3f')](_0xd7cb('0x40'))){_0x2c9251['limit']=qs[_0xd7cb('0x21')](_0x568833[_0xd7cb('0x39')][_0xd7cb('0x21')]);_0x2c9251[_0xd7cb('0x1f')]=qs[_0xd7cb('0x1f')](_0x568833[_0xd7cb('0x39')][_0xd7cb('0x1f')]);}_0x2c9251[_0xd7cb('0x41')]=qs['sort'](_0x568833[_0xd7cb('0x39')][_0xd7cb('0x42')]);_0x2c9251[_0xd7cb('0x43')]=qs[_0xd7cb('0x3b')](_[_0xd7cb('0x44')](_0x568833[_0xd7cb('0x39')],_0x9cf5ed[_0xd7cb('0x3b')]),_0x32bff5);if(_0x568833[_0xd7cb('0x39')]['filter']){_0x2c9251['where']=_[_0xd7cb('0x45')](_0x2c9251[_0xd7cb('0x43')],{'$or':_['map'](_0x32bff5,function(_0xd9adaa){if(_0xd9adaa[_0xd7cb('0x35')]!==_0xd7cb('0x46')){var _0x30d665={};_0x30d665[_0xd9adaa['name']]={'$like':'%'+_0x568833[_0xd7cb('0x39')]['filter']+'%'};return _0x30d665;}})});}_0x2c9251=_['merge']({},_0x2c9251,_0x568833[_0xd7cb('0x47')]);var _0x4d7e7e={'where':_0x2c9251[_0xd7cb('0x43')]};return db[_0xd7cb('0x32')][_0xd7cb('0x22')](_0x4d7e7e)['then'](function(_0x232575){_0x13e90b[_0xd7cb('0x22')]=_0x232575;if(_0x568833['query'][_0xd7cb('0x48')]){_0x2c9251[_0xd7cb('0x49')]=[{'all':!![]}];}return db[_0xd7cb('0x32')][_0xd7cb('0x4a')](_0x2c9251);})['then'](function(_0x2631ca){_0x13e90b[_0xd7cb('0x4b')]=_0x2631ca;return _0x13e90b;})[_0xd7cb('0x28')](respondWithFilteredResult(_0x2ad5ab,_0x2c9251))[_0xd7cb('0x4c')](handleError(_0x2ad5ab,null));};exports[_0xd7cb('0x4d')]=function(_0x2df494,_0x44718b){var _0x20250e={'raw':![],'where':{'id':_0x2df494[_0xd7cb('0x4e')]['id']}},_0x5bb271={};_0x5bb271[_0xd7cb('0x37')]=_['keys'](db[_0xd7cb('0x32')][_0xd7cb('0x33')]);_0x5bb271[_0xd7cb('0x39')]=_[_0xd7cb('0x3a')](_0x2df494[_0xd7cb('0x39')]);_0x5bb271['filters']=_[_0xd7cb('0x3c')](_0x5bb271[_0xd7cb('0x37')],_0x5bb271[_0xd7cb('0x39')]);_0x20250e[_0xd7cb('0x3e')]=_[_0xd7cb('0x3c')](_0x5bb271['model'],qs[_0xd7cb('0x3d')](_0x2df494[_0xd7cb('0x39')][_0xd7cb('0x3d')]));_0x20250e[_0xd7cb('0x3e')]=_0x20250e[_0xd7cb('0x3e')][_0xd7cb('0x4f')]?_0x20250e['attributes']:_0x5bb271[_0xd7cb('0x37')];if(_0x2df494[_0xd7cb('0x39')]['includeAll']){_0x20250e[_0xd7cb('0x49')]=[{'all':!![]}];}_0x20250e=_['merge']({},_0x20250e,_0x2df494['options']);return db[_0xd7cb('0x32')][_0xd7cb('0x50')](_0x20250e)[_0xd7cb('0x28')](handleEntityNotFound(_0x44718b,null))[_0xd7cb('0x28')](respondWithResult(_0x44718b,null))[_0xd7cb('0x4c')](handleError(_0x44718b,null));};exports[_0xd7cb('0x51')]=function(_0x50fbdd,_0x28e6ca){return db[_0xd7cb('0x32')][_0xd7cb('0x51')](_0x50fbdd[_0xd7cb('0x52')],{})[_0xd7cb('0x28')](function(_0x264f3d){var _0x56044c=_0x50fbdd[_0xd7cb('0x53')]['get']({'plain':!![]});if(!_0x56044c)throw new Error(_0xd7cb('0x54'));if(_0x56044c[_0xd7cb('0x55')]===_0xd7cb('0x53')){var _0x1375b9=_0x264f3d[_0xd7cb('0x2a')]({'plain':!![]});var _0x3df897=_0xd7cb('0x56');return db['UserProfileSection']['find']({'where':{'name':_0x3df897,'userProfileId':_0x56044c[_0xd7cb('0x57')]},'raw':!![]})[_0xd7cb('0x28')](function(_0x6f0d9f){if(_0x6f0d9f&&_0x6f0d9f[_0xd7cb('0x58')]===0x0){return db[_0xd7cb('0x2c')][_0xd7cb('0x51')]({'name':_0x1375b9[_0xd7cb('0x2f')],'resourceId':_0x1375b9['id'],'type':_0xd7cb('0x2b'),'sectionId':_0x6f0d9f['id']},{})[_0xd7cb('0x28')](function(){return _0x264f3d;});}else{return _0x264f3d;}})[_0xd7cb('0x4c')](function(_0x1ecfc2){logger[_0xd7cb('0x2d')](_0xd7cb('0x59'),_0x1ecfc2);throw _0x1ecfc2;});}return _0x264f3d;})[_0xd7cb('0x28')](respondWithResult(_0x28e6ca,0xc9))['catch'](handleError(_0x28e6ca,null));};exports[_0xd7cb('0x27')]=function(_0x161542,_0x4c1c98){if(_0x161542['body']['id']){delete _0x161542[_0xd7cb('0x52')]['id'];}return db[_0xd7cb('0x32')][_0xd7cb('0x50')]({'where':{'id':_0x161542['params']['id']}})[_0xd7cb('0x28')](handleEntityNotFound(_0x4c1c98,null))[_0xd7cb('0x28')](saveUpdates(_0x161542[_0xd7cb('0x52')],null))[_0xd7cb('0x28')](respondWithResult(_0x4c1c98,null))['catch'](handleError(_0x4c1c98,null));};exports['destroy']=function(_0x575953,_0x40873b){return db[_0xd7cb('0x32')][_0xd7cb('0x50')]({'where':{'id':_0x575953[_0xd7cb('0x4e')]['id']}})[_0xd7cb('0x28')](handleEntityNotFound(_0x40873b,null))[_0xd7cb('0x28')](removeEntity(_0x40873b,null))['catch'](handleError(_0x40873b,null));};exports[_0xd7cb('0x5a')]=function(_0x46d01d,_0xc5ef31){var _0x1720e3=0xa;var _0x539f4c=[_0xd7cb('0x5b'),_0xd7cb('0x5c'),'right_join',_0xd7cb('0x5d')];var _0x241b38={'SUM':'SUM(%s)','COUNT':_0xd7cb('0x5e'),'COUNT DISTINCT':_0xd7cb('0x5f'),'MAX':_0xd7cb('0x60'),'MIN':_0xd7cb('0x61'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd7cb('0x62'),'GROUP_CONCAT ASC':_0xd7cb('0x63'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3ffb79={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd7cb('0x64'),'HOUR':_0xd7cb('0x65'),'ROUND':_0xd7cb('0x66'),'UNIX_TIMESTAMP':_0xd7cb('0x67')};var _0xd91467=function(_0x29ee06){return!_[_0xd7cb('0x68')]([_0xd7cb('0x69'),_0xd7cb('0x6a'),_0xd7cb('0x6b'),_0xd7cb('0x6c')],_0x29ee06);};var _0x13d0a0=function(_0x56d03f){if(!_0x56d03f||!_0x56d03f['rules'][_0xd7cb('0x4f')]){return'';}for(var _0x4b2bf5='(',_0x52ffe6=0x0;_0x52ffe6<_0x56d03f['rules'][_0xd7cb('0x4f')];_0x52ffe6+=0x1){_0x52ffe6>0x0&&(_0x4b2bf5+='\x20'+_0x56d03f[_0xd7cb('0x6d')]+'\x20');_0x4b2bf5+=_0x56d03f[_0xd7cb('0x6e')][_0x52ffe6][_0xd7cb('0x6f')]?_0x13d0a0(_0x56d03f[_0xd7cb('0x6e')][_0x52ffe6]['group']):_0x56d03f[_0xd7cb('0x6e')][_0x52ffe6][_0xd7cb('0x70')]+'\x20'+_0x56d03f[_0xd7cb('0x6e')][_0x52ffe6][_0xd7cb('0x71')]+(_0xd91467(_0x56d03f[_0xd7cb('0x6e')][_0x52ffe6][_0xd7cb('0x71')])?'\x20'+_0x56d03f[_0xd7cb('0x6e')][_0x52ffe6][_0xd7cb('0x72')]:'');}return _0x4b2bf5+')';};var _0x231b50={'where':{'id':_0x46d01d[_0xd7cb('0x4e')]['id']}},_0x256302,_0x45a8c8,_0x3da9ba,_0x589685,_0x2ae544;_0x231b50=_[_0xd7cb('0x45')]({},_0x231b50,_0x46d01d[_0xd7cb('0x47')]);return db[_0xd7cb('0x32')][_0xd7cb('0x50')](_0x231b50)['then'](function(_0x27b4b2){if(_0x27b4b2){_0x256302=_0x27b4b2;return _0x27b4b2[_0xd7cb('0x73')]();}return null;})[_0xd7cb('0x28')](function(_0x12f9f1){if(_0x12f9f1){if(!_0x12f9f1[_0xd7cb('0x4f')]){throw new db[(_0xd7cb('0x74'))][(_0xd7cb('0x75'))](_0xd7cb('0x76'),0x193);}_0x45a8c8=_0x12f9f1;return db[_0xd7cb('0x77')][_0xd7cb('0x4a')]({'raw':!![]});}return null;})['then'](function(_0x10b602){if(_0x10b602){_0x3da9ba=_['keyBy'](_0x10b602,'id');var _0x30d36d;var _0x3b7c12=squel[_0xd7cb('0x78')]();_0x3b7c12[_0xd7cb('0x79')](_0x256302[_0xd7cb('0x7a')]);for(var _0x235dfa=0x0;_0x235dfa<_0x45a8c8['length'];_0x235dfa+=0x1){_0x30d36d=_0x45a8c8[_0x235dfa]['MetricId']?_0x3da9ba[_0x45a8c8[_0x235dfa]['MetricId']]['metric']:_0x45a8c8[_0x235dfa][_0xd7cb('0x70')];_0x30d36d=_0x45a8c8[_0x235dfa][_0xd7cb('0x7b')]?_['replace'](_0x241b38[_0x45a8c8[_0x235dfa][_0xd7cb('0x7b')]],'%s',_0x30d36d):_0x30d36d;_0x30d36d=_0x45a8c8[_0x235dfa][_0xd7cb('0x7c')]?_[_0xd7cb('0x7d')](_0x3ffb79[_0x45a8c8[_0x235dfa][_0xd7cb('0x7c')]],'%s',_0x30d36d):_0x30d36d;if(_0x45a8c8[_0x235dfa]['groupBy']){_0x3b7c12['group'](_0x30d36d);}_0x45a8c8[_0x235dfa][_0xd7cb('0x7e')]&&_0x3b7c12['order'](_0x30d36d,_0x45a8c8[_0x235dfa][_0xd7cb('0x7e')]===_0xd7cb('0x7f')?![]:!![]);_0x3b7c12[_0xd7cb('0x70')](_0x30d36d,_0x45a8c8[_0x235dfa][_0xd7cb('0x80')]||_0x30d36d);}if(_0x256302[_0xd7cb('0x81')]){_0x256302[_0xd7cb('0x81')]=JSON[_0xd7cb('0x82')](_0x256302[_0xd7cb('0x81')]);for(var _0x509d52=0x0;_0x509d52<_0x256302[_0xd7cb('0x81')]['length'];_0x509d52+=0x1){if(_0x256302['joins'][_0x509d52][_0xd7cb('0x35')]&&_['includes'](_0x539f4c,_0x256302[_0xd7cb('0x81')][_0x509d52]['type'])&&_0x256302[_0xd7cb('0x81')][_0x509d52][_0xd7cb('0x83')]&&_0x256302['joins'][_0x509d52][_0xd7cb('0x84')]&&_0x256302[_0xd7cb('0x81')][_0x509d52][_0xd7cb('0x85')]){_0x3b7c12[_0x256302[_0xd7cb('0x81')][_0x509d52][_0xd7cb('0x35')]](_0x256302[_0xd7cb('0x81')][_0x509d52][_0xd7cb('0x84')],null,util['format'](_0xd7cb('0x86'),_0x256302[_0xd7cb('0x7a')],_0x256302['joins'][_0x509d52][_0xd7cb('0x83')],_0x256302[_0xd7cb('0x81')][_0x509d52][_0xd7cb('0x84')],_0x256302['joins'][_0x509d52][_0xd7cb('0x85')]));}}}if(_0x256302[_0xd7cb('0x87')]){_0x256302[_0xd7cb('0x87')]=JSON[_0xd7cb('0x82')](_0x256302[_0xd7cb('0x87')]);_0x3b7c12[_0xd7cb('0x43')](_0x13d0a0(_0x256302[_0xd7cb('0x87')][_0xd7cb('0x6f')]));}_0x2ae544=_0x3b7c12[_0xd7cb('0x88')]();_0x3b7c12[_0xd7cb('0x21')](_0x1720e3);_0x3b7c12['offset'](0x0);logger[_0xd7cb('0x89')]('Limited\x20Query:',_0x3b7c12['toString']());return dbH[_0xd7cb('0x8a')][_0xd7cb('0x39')](_0x3b7c12[_0xd7cb('0x8b')](),{'type':dbH['sequelize'][_0xd7cb('0x8c')]['SELECT']});}})['then'](respondWithResult(_0xc5ef31,null))['catch'](handleError(_0xc5ef31,null));};function runReport(_0x51aea9,_0x17fc1f,_0xa3467f){var _0x23f0b7=_0x17fc1f[_0xd7cb('0x2f')];var _0x6aa708=0xa;var _0x18303f=[_0xd7cb('0x5b'),_0xd7cb('0x5c'),_0xd7cb('0x8d'),'cross_join'];var _0xe1fb36={'SUM':_0xd7cb('0x8e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd7cb('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd7cb('0x62'),'GROUP_CONCAT ASC':_0xd7cb('0x63'),'GROUP_CONCAT DESC':_0xd7cb('0x8f')};var _0xb28ed9={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xd7cb('0x65'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4b6c9b=function(_0x421701){return!_[_0xd7cb('0x68')](['IS\x20NULL',_0xd7cb('0x6a'),_0xd7cb('0x6b'),_0xd7cb('0x6c')],_0x421701);};var _0x79fe2e=function(_0x8f0933){if(!_0x8f0933||!_0x8f0933[_0xd7cb('0x6e')]['length']){return'';}for(var _0x29405d='(',_0x165bf1=0x0;_0x165bf1<_0x8f0933['rules'][_0xd7cb('0x4f')];_0x165bf1+=0x1){_0x165bf1>0x0&&(_0x29405d+='\x20'+_0x8f0933[_0xd7cb('0x6d')]+'\x20');_0x29405d+=_0x8f0933[_0xd7cb('0x6e')][_0x165bf1][_0xd7cb('0x6f')]?_0x79fe2e(_0x8f0933[_0xd7cb('0x6e')][_0x165bf1][_0xd7cb('0x6f')]):_0x8f0933[_0xd7cb('0x6e')][_0x165bf1][_0xd7cb('0x70')]+'\x20'+_0x8f0933['rules'][_0x165bf1][_0xd7cb('0x71')]+(_0x4b6c9b(_0x8f0933[_0xd7cb('0x6e')][_0x165bf1]['condition'])?'\x20'+_0x8f0933[_0xd7cb('0x6e')][_0x165bf1]['value']:'');}return _0x29405d+')';};var _0x1845af={'where':{'id':_0x51aea9['id']}},_0x14a00b,_0x2674a0,_0x524756,_0x368940,_0x9dd168;_0x1845af=_[_0xd7cb('0x45')]({},_0x1845af,_0xa3467f);return db['AnalyticCustomReport'][_0xd7cb('0x50')](_0x1845af)['then'](function(_0x17f6eb){if(_0x17f6eb){_0x14a00b=_0x17f6eb;return _0x17f6eb[_0xd7cb('0x73')]();}return null;})[_0xd7cb('0x28')](function(_0xe87b58){if(_0xe87b58){if(!_0xe87b58['length']){throw new db[(_0xd7cb('0x74'))][(_0xd7cb('0x75'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2674a0=_0xe87b58;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xd7cb('0x28')](function(_0x513893){if(_0x513893){_0x524756=_[_0xd7cb('0x90')](_0x513893,'id');var _0x1a7cbb;var _0x3a4ace=squel[_0xd7cb('0x78')]();_0x3a4ace[_0xd7cb('0x79')](_0x14a00b[_0xd7cb('0x7a')]);for(var _0x498654=0x0;_0x498654<_0x2674a0[_0xd7cb('0x4f')];_0x498654+=0x1){_0x1a7cbb=_0x2674a0[_0x498654][_0xd7cb('0x91')]?_0x524756[_0x2674a0[_0x498654]['MetricId']][_0xd7cb('0x92')]:_0x2674a0[_0x498654][_0xd7cb('0x70')];_0x1a7cbb=_0x2674a0[_0x498654]['function']?_[_0xd7cb('0x7d')](_0xe1fb36[_0x2674a0[_0x498654][_0xd7cb('0x7b')]],'%s',_0x1a7cbb):_0x1a7cbb;_0x1a7cbb=_0x2674a0[_0x498654]['format']?_[_0xd7cb('0x7d')](_0xb28ed9[_0x2674a0[_0x498654][_0xd7cb('0x7c')]],'%s',_0x1a7cbb):_0x1a7cbb;if(_0x2674a0[_0x498654]['groupBy']){_0x3a4ace['group'](_0x1a7cbb);}_0x2674a0[_0x498654][_0xd7cb('0x7e')]&&_0x3a4ace[_0xd7cb('0x41')](_0x1a7cbb,_0x2674a0[_0x498654][_0xd7cb('0x7e')]===_0xd7cb('0x7f')?![]:!![]);_0x3a4ace[_0xd7cb('0x70')](_0x1a7cbb,_0x2674a0[_0x498654][_0xd7cb('0x80')]||_0x1a7cbb);}if(_0x14a00b[_0xd7cb('0x81')]){_0x14a00b[_0xd7cb('0x81')]=JSON[_0xd7cb('0x82')](_0x14a00b[_0xd7cb('0x81')]);for(var _0x49b382=0x0;_0x49b382<_0x14a00b[_0xd7cb('0x81')][_0xd7cb('0x4f')];_0x49b382+=0x1){if(_0x14a00b[_0xd7cb('0x81')][_0x49b382][_0xd7cb('0x35')]&&_[_0xd7cb('0x68')](_0x18303f,_0x14a00b['joins'][_0x49b382][_0xd7cb('0x35')])&&_0x14a00b[_0xd7cb('0x81')][_0x49b382]['parentKey']&&_0x14a00b[_0xd7cb('0x81')][_0x49b382]['foreignTable']&&_0x14a00b[_0xd7cb('0x81')][_0x49b382][_0xd7cb('0x85')]){_0x3a4ace[_0x14a00b[_0xd7cb('0x81')][_0x49b382][_0xd7cb('0x35')]](_0x14a00b[_0xd7cb('0x81')][_0x49b382][_0xd7cb('0x84')],null,util['format'](_0xd7cb('0x86'),_0x14a00b[_0xd7cb('0x7a')],_0x14a00b[_0xd7cb('0x81')][_0x49b382][_0xd7cb('0x83')],_0x14a00b['joins'][_0x49b382]['foreignTable'],_0x14a00b['joins'][_0x49b382][_0xd7cb('0x85')]));}}}if(_0x14a00b[_0xd7cb('0x87')]){_0x14a00b[_0xd7cb('0x87')]=JSON[_0xd7cb('0x82')](_0x14a00b[_0xd7cb('0x87')]);_0x3a4ace[_0xd7cb('0x43')](_0x79fe2e(_0x14a00b[_0xd7cb('0x87')][_0xd7cb('0x6f')]));}_0x9dd168=_0x3a4ace[_0xd7cb('0x88')]();_0x3a4ace[_0xd7cb('0x21')](_0x6aa708);_0x3a4ace[_0xd7cb('0x1f')](0x0);return;}})[_0xd7cb('0x28')](function(){if(_0x17fc1f[_0xd7cb('0x93')]===_0xd7cb('0x94')){return null;}var _0x38a1ff=_[_0xd7cb('0x45')](_0x17fc1f,{'name':_0x17fc1f['fullPath']||_0x17fc1f[_0xd7cb('0x2f')]||_0x14a00b[_0xd7cb('0x2f')],'basename':_0x23f0b7,'savename':util[_0xd7cb('0x7c')](_0xd7cb('0x95'),_0x17fc1f[_0xd7cb('0x2f')]||_0x14a00b['name'],require(_0xd7cb('0x96'))[_0xd7cb('0x97')](0x4),_0x17fc1f[_0xd7cb('0x93')]||_0xd7cb('0x98')),'reportId':_0x14a00b['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xd7cb('0x51')](_0x38a1ff,{'raw':!![]});})[_0xd7cb('0x28')](function(_0x31f1cd){if(_0x14a00b[_0xd7cb('0x7a')]===_0xd7cb('0x99')){_0x9dd168['where'](_0x14a00b[_0xd7cb('0x7a')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x17fc1f['startDate'],_0x17fc1f[_0xd7cb('0x9a')]);}else{_0x9dd168[_0xd7cb('0x43')](_0x14a00b[_0xd7cb('0x7a')]+_0xd7cb('0x9b'),_0x17fc1f['startDate'],_0x17fc1f[_0xd7cb('0x9a')]);}if(_0x31f1cd){logger['info'](_0xd7cb('0x9c'),_0x9dd168[_0xd7cb('0x8b')]());require(_0xd7cb('0x9d'))[_0xd7cb('0x9e')](path[_0xd7cb('0x5b')](__dirname,_0xd7cb('0x9f'),_0x31f1cd[_0xd7cb('0x93')]),[_0x31f1cd['id'],_0x9dd168[_0xd7cb('0x8b')](),path[_0xd7cb('0x5b')](__dirname,'../../files/reports',_0x31f1cd[_0xd7cb('0xa0')]),_0x23f0b7]);return _0x31f1cd;}else{var _0x13bea6=squel['select']();_0x13bea6[_0xd7cb('0x79')]('('+_0x9dd168[_0xd7cb('0x8b')]()+')','countTable');_0x13bea6['field'](_0xd7cb('0xa1'),_0xd7cb('0x22'));_0x9dd168['limit'](_0x17fc1f[_0xd7cb('0x21')]||_0x6aa708);_0x9dd168[_0xd7cb('0x1f')](_0x17fc1f[_0xd7cb('0x1f')]||0x0);return dbH['sequelize'][_0xd7cb('0x39')](_0x13bea6['toString'](),{'type':dbH[_0xd7cb('0x8a')][_0xd7cb('0x8c')][_0xd7cb('0xa2')]})[_0xd7cb('0x28')](function(_0x464dd2){if(!_0x464dd2[_0xd7cb('0x4f')]){_0x368940=0x0;}else{_0x368940=_0x464dd2[0x0][_0xd7cb('0x22')]||0x0;}return dbH['sequelize'][_0xd7cb('0x39')](_0x9dd168[_0xd7cb('0x8b')](),{'type':dbH[_0xd7cb('0x8a')][_0xd7cb('0x8c')][_0xd7cb('0xa2')]});})[_0xd7cb('0x28')](function(_0x45f19e){return{'rows':_0x45f19e||[],'count':_0x368940};});}});}exports[_0xd7cb('0xa3')]=function(_0xb76cd0,_0x239193){return runReport(_0xb76cd0[_0xd7cb('0x4e')],_0xb76cd0['query'],_0xb76cd0[_0xd7cb('0x47')])[_0xd7cb('0x28')](respondWithResult(_0x239193,null))['catch'](handleError(_0x239193,null));};exports[_0xd7cb('0xa4')]=runReport;exports[_0xd7cb('0x39')]=function(_0x58a8fa,_0x4303ef){var _0x59e857=0xa;var _0x43c806=[_0xd7cb('0x5b'),_0xd7cb('0x5c'),_0xd7cb('0x8d'),_0xd7cb('0x5d')];var _0x348e34={'SUM':_0xd7cb('0x8e'),'COUNT':_0xd7cb('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xd7cb('0x61'),'AVG':_0xd7cb('0xa5'),'GROUP_CONCAT':_0xd7cb('0x62'),'GROUP_CONCAT ASC':_0xd7cb('0x63'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x11f4ea={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd7cb('0x64'),'HOUR':_0xd7cb('0x65'),'ROUND':_0xd7cb('0x66'),'UNIX_TIMESTAMP':_0xd7cb('0x67')};var _0x21ecc2=function(_0x3c4e6c){return!_[_0xd7cb('0x68')]([_0xd7cb('0x69'),_0xd7cb('0x6a'),_0xd7cb('0x6b'),_0xd7cb('0x6c')],_0x3c4e6c);};var _0x4d8313=function(_0x9cebba){if(!_0x9cebba||!_0x9cebba[_0xd7cb('0x6e')][_0xd7cb('0x4f')]){return'';}for(var _0x4e8919='(',_0x3debdb=0x0;_0x3debdb<_0x9cebba['rules'][_0xd7cb('0x4f')];_0x3debdb+=0x1){_0x3debdb>0x0&&(_0x4e8919+='\x20'+_0x9cebba['operator']+'\x20');_0x4e8919+=_0x9cebba[_0xd7cb('0x6e')][_0x3debdb][_0xd7cb('0x6f')]?_0x4d8313(_0x9cebba['rules'][_0x3debdb]['group']):_0x9cebba[_0xd7cb('0x6e')][_0x3debdb][_0xd7cb('0x70')]+'\x20'+_0x9cebba[_0xd7cb('0x6e')][_0x3debdb][_0xd7cb('0x71')]+(_0x21ecc2(_0x9cebba[_0xd7cb('0x6e')][_0x3debdb]['condition'])?'\x20'+_0x9cebba[_0xd7cb('0x6e')][_0x3debdb][_0xd7cb('0x72')]:'');}return _0x4e8919+')';};var _0x566c78={'where':{'id':_0x58a8fa['params']['id']}},_0x396004,_0x3a0145,_0x184d50,_0x350621,_0x2f9d72;_0x566c78=_[_0xd7cb('0x45')]({},_0x566c78,_0x58a8fa['options']);return db[_0xd7cb('0x32')][_0xd7cb('0x50')](_0x566c78)[_0xd7cb('0x28')](function(_0x525de9){if(_0x525de9){_0x396004=_0x525de9;return _0x525de9[_0xd7cb('0x73')]();}return null;})[_0xd7cb('0x28')](function(_0x5d8eed){if(_0x5d8eed){if(!_0x5d8eed[_0xd7cb('0x4f')]){throw new db[(_0xd7cb('0x74'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3a0145=_0x5d8eed;return db['AnalyticMetric'][_0xd7cb('0x4a')]({'raw':!![]});}return null;})['then'](function(_0x5ad13d){if(_0x5ad13d){_0x184d50=_[_0xd7cb('0x90')](_0x5ad13d,'id');var _0x2235cc;var _0x3a7ccc=squel[_0xd7cb('0x78')]();_0x3a7ccc[_0xd7cb('0x79')](_0x396004[_0xd7cb('0x7a')]);for(var _0x2a24be=0x0;_0x2a24be<_0x3a0145[_0xd7cb('0x4f')];_0x2a24be+=0x1){_0x2235cc=_0x3a0145[_0x2a24be][_0xd7cb('0x91')]?_0x184d50[_0x3a0145[_0x2a24be][_0xd7cb('0x91')]][_0xd7cb('0x92')]:_0x3a0145[_0x2a24be][_0xd7cb('0x70')];_0x2235cc=_0x3a0145[_0x2a24be][_0xd7cb('0x7b')]?_[_0xd7cb('0x7d')](_0x348e34[_0x3a0145[_0x2a24be][_0xd7cb('0x7b')]],'%s',_0x2235cc):_0x2235cc;_0x2235cc=_0x3a0145[_0x2a24be]['format']?_['replace'](_0x11f4ea[_0x3a0145[_0x2a24be][_0xd7cb('0x7c')]],'%s',_0x2235cc):_0x2235cc;if(_0x3a0145[_0x2a24be][_0xd7cb('0xa6')]){_0x3a7ccc[_0xd7cb('0x6f')](_0x2235cc);}_0x3a0145[_0x2a24be][_0xd7cb('0x7e')]&&_0x3a7ccc['order'](_0x2235cc,_0x3a0145[_0x2a24be]['orderBy']===_0xd7cb('0x7f')?![]:!![]);_0x3a7ccc[_0xd7cb('0x70')](_0x2235cc,_0x3a0145[_0x2a24be][_0xd7cb('0x80')]||_0x2235cc);}if(_0x396004[_0xd7cb('0x81')]){_0x396004[_0xd7cb('0x81')]=JSON[_0xd7cb('0x82')](_0x396004[_0xd7cb('0x81')]);for(var _0x3dd5e0=0x0;_0x3dd5e0<_0x396004[_0xd7cb('0x81')][_0xd7cb('0x4f')];_0x3dd5e0+=0x1){if(_0x396004[_0xd7cb('0x81')][_0x3dd5e0]['type']&&_[_0xd7cb('0x68')](_0x43c806,_0x396004[_0xd7cb('0x81')][_0x3dd5e0][_0xd7cb('0x35')])&&_0x396004['joins'][_0x3dd5e0]['parentKey']&&_0x396004[_0xd7cb('0x81')][_0x3dd5e0]['foreignTable']&&_0x396004[_0xd7cb('0x81')][_0x3dd5e0][_0xd7cb('0x85')]){_0x3a7ccc[_0x396004[_0xd7cb('0x81')][_0x3dd5e0][_0xd7cb('0x35')]](_0x396004[_0xd7cb('0x81')][_0x3dd5e0][_0xd7cb('0x84')],null,util[_0xd7cb('0x7c')](_0xd7cb('0x86'),_0x396004[_0xd7cb('0x7a')],_0x396004['joins'][_0x3dd5e0]['parentKey'],_0x396004[_0xd7cb('0x81')][_0x3dd5e0]['foreignTable'],_0x396004[_0xd7cb('0x81')][_0x3dd5e0][_0xd7cb('0x85')]));}}}if(_0x396004[_0xd7cb('0x87')]){_0x396004[_0xd7cb('0x87')]=JSON[_0xd7cb('0x82')](_0x396004['conditions']);_0x3a7ccc['where'](_0x4d8313(_0x396004[_0xd7cb('0x87')][_0xd7cb('0x6f')]));}_0x2f9d72=_0x3a7ccc[_0xd7cb('0x88')]();_0x3a7ccc[_0xd7cb('0x21')](_0x59e857);_0x3a7ccc['offset'](0x0);logger['debug'](_0xd7cb('0xa7'),_0x3a7ccc[_0xd7cb('0x8b')]());return dbH['sequelize']['query'](_0x3a7ccc[_0xd7cb('0x8b')](),{'type':dbH[_0xd7cb('0x8a')]['QueryTypes'][_0xd7cb('0xa2')]});}})[_0xd7cb('0x28')](function(){return{'sql':_0x2f9d72[_0xd7cb('0x8b')]()};})['then'](respondWithResult(_0x4303ef,null))[_0xd7cb('0x4c')](handleError(_0x4303ef,null));};
\ No newline at end of file
+var _0xabfc=['save','then','get','CustomReports','UserProfileResource','destroy','stack','name','index','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','length','field','condition','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','MetricId','function','replace','format','groupBy','group','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','value','AnalyticMetric','from','table','order','DESC','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','run','runReport','ValidationErrorItem','metric','%s.%s\x20=\x20%s.%s','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject'];(function(_0x186a10,_0x2c1d47){var _0x45c11d=function(_0xf460ea){while(--_0xf460ea){_0x186a10['push'](_0x186a10['shift']());}};_0x45c11d(++_0x2c1d47);}(_0xabfc,0x137));var _0xcabf=function(_0x4f4c2a,_0x5f5a28){_0x4f4c2a=_0x4f4c2a-0x0;var _0xd15be6=_0xabfc[_0x4f4c2a];return _0xd15be6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcabf('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcabf('0x1'));var moment=require(_0xcabf('0x2'));var BPromise=require(_0xcabf('0x3'));var Mustache=require(_0xcabf('0x4'));var util=require(_0xcabf('0x5'));var path=require(_0xcabf('0x6'));var sox=require(_0xcabf('0x7'));var csv=require('to-csv');var ejs=require(_0xcabf('0x8'));var fs=require('fs');var fs_extra=require(_0xcabf('0x9'));var _=require('lodash');var squel=require(_0xcabf('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcabf('0xb'));var toCsv=require('to-csv');var querystring=require(_0xcabf('0xc'));var Papa=require(_0xcabf('0xd'));var Redis=require(_0xcabf('0xe'));var authService=require(_0xcabf('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xcabf('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcabf('0x11'))(_0xcabf('0x12'));var utils=require(_0xcabf('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcabf('0x14'))['db'];var dbH=require(_0xcabf('0x14'))['dbH'];function respondWithStatusCode(_0x204535,_0x458ba2){_0x458ba2=_0x458ba2||0xcc;return function(_0x17ba45){if(_0x17ba45){return _0x204535[_0xcabf('0x15')](_0x458ba2);}return _0x204535[_0xcabf('0x16')](_0x458ba2)[_0xcabf('0x17')]();};}function respondWithResult(_0xb5aa46,_0x23feec){_0x23feec=_0x23feec||0xc8;return function(_0x17dbe2){if(_0x17dbe2){return _0xb5aa46[_0xcabf('0x16')](_0x23feec)[_0xcabf('0x18')](_0x17dbe2);}};}function respondWithFilteredResult(_0x21edf3,_0x4893a){return function(_0x4f9850){if(_0x4f9850){var _0x5d18c7=typeof _0x4893a[_0xcabf('0x19')]===_0xcabf('0x1a')&&typeof _0x4893a['limit']===_0xcabf('0x1a');var _0x299413=_0x4f9850[_0xcabf('0x1b')];var _0x3bd3a4=_0x5d18c7?0x0:_0x4893a['offset'];var _0x1992cc=_0x5d18c7?_0x4f9850[_0xcabf('0x1b')]:_0x4893a['offset']+_0x4893a[_0xcabf('0x1c')];var _0x35b4a2;if(_0x1992cc>=_0x299413){_0x1992cc=_0x299413;_0x35b4a2=0xc8;}else{_0x35b4a2=0xce;}_0x21edf3[_0xcabf('0x16')](_0x35b4a2);return _0x21edf3[_0xcabf('0x1d')](_0xcabf('0x1e'),_0x3bd3a4+'-'+_0x1992cc+'/'+_0x299413)['json'](_0x4f9850);}return null;};}function patchUpdates(_0xb929df){return function(_0x509d7e){try{jsonpatch[_0xcabf('0x1f')](_0x509d7e,_0xb929df,!![]);}catch(_0x3d575f){return BPromise[_0xcabf('0x20')](_0x3d575f);}return _0x509d7e[_0xcabf('0x21')]();};}function saveUpdates(_0x51b709,_0x2ca57c){return function(_0x395d99){if(_0x395d99){return _0x395d99['update'](_0x51b709)[_0xcabf('0x22')](function(_0x4ba4d4){return _0x4ba4d4;});}return null;};}function removeEntity(_0x21236e,_0x53f3a6){return function(_0x2963cb){if(_0x2963cb){return _0x2963cb['destroy']()[_0xcabf('0x22')](function(){var _0x5cd137=_0x2963cb[_0xcabf('0x23')]({'plain':!![]});var _0x249170=_0xcabf('0x24');return db[_0xcabf('0x25')][_0xcabf('0x26')]({'where':{'type':_0x249170,'resourceId':_0x5cd137['id']}})[_0xcabf('0x22')](function(){return _0x2963cb;});})[_0xcabf('0x22')](function(){_0x21236e[_0xcabf('0x16')](0xcc)[_0xcabf('0x17')]();});}};}function handleEntityNotFound(_0x48b210,_0x70a714){return function(_0x318cf8){if(!_0x318cf8){_0x48b210[_0xcabf('0x15')](0x194);}return _0x318cf8;};}function handleError(_0x5475f4,_0x5eed16){_0x5eed16=_0x5eed16||0x1f4;return function(_0x20be5c){logger['error'](_0x20be5c[_0xcabf('0x27')]);if(_0x20be5c[_0xcabf('0x28')]){delete _0x20be5c[_0xcabf('0x28')];}_0x5475f4['status'](_0x5eed16)['send'](_0x20be5c);};}exports[_0xcabf('0x29')]=function(_0x24952e,_0x3df62b){var _0xa72dbd={},_0x30a040={},_0x2f1795={'count':0x0,'rows':[]};var _0xbfac51=_['map'](db[_0xcabf('0x2a')][_0xcabf('0x2b')],function(_0x3a09d5){return{'name':_0x3a09d5[_0xcabf('0x2c')],'type':_0x3a09d5[_0xcabf('0x2d')][_0xcabf('0x2e')]};});_0x30a040[_0xcabf('0x2f')]=_[_0xcabf('0x30')](_0xbfac51,_0xcabf('0x28'));_0x30a040[_0xcabf('0x31')]=_['keys'](_0x24952e['query']);_0x30a040['filters']=_[_0xcabf('0x32')](_0x30a040[_0xcabf('0x2f')],_0x30a040[_0xcabf('0x31')]);_0xa72dbd[_0xcabf('0x33')]=_[_0xcabf('0x32')](_0x30a040[_0xcabf('0x2f')],qs['fields'](_0x24952e[_0xcabf('0x31')][_0xcabf('0x34')]));_0xa72dbd['attributes']=_0xa72dbd[_0xcabf('0x33')]['length']?_0xa72dbd[_0xcabf('0x33')]:_0x30a040[_0xcabf('0x2f')];if(!_0x24952e['query'][_0xcabf('0x35')](_0xcabf('0x36'))){_0xa72dbd[_0xcabf('0x1c')]=qs[_0xcabf('0x1c')](_0x24952e['query'][_0xcabf('0x1c')]);_0xa72dbd['offset']=qs[_0xcabf('0x19')](_0x24952e[_0xcabf('0x31')][_0xcabf('0x19')]);}_0xa72dbd['order']=qs[_0xcabf('0x37')](_0x24952e[_0xcabf('0x31')][_0xcabf('0x37')]);_0xa72dbd[_0xcabf('0x38')]=qs[_0xcabf('0x39')](_[_0xcabf('0x3a')](_0x24952e[_0xcabf('0x31')],_0x30a040['filters']),_0xbfac51);if(_0x24952e['query'][_0xcabf('0x3b')]){_0xa72dbd[_0xcabf('0x38')]=_[_0xcabf('0x3c')](_0xa72dbd['where'],{'$or':_[_0xcabf('0x30')](_0xbfac51,function(_0x499894){if(_0x499894[_0xcabf('0x2d')]!==_0xcabf('0x3d')){var _0x2ac5aa={};_0x2ac5aa[_0x499894['name']]={'$like':'%'+_0x24952e[_0xcabf('0x31')]['filter']+'%'};return _0x2ac5aa;}})});}_0xa72dbd=_['merge']({},_0xa72dbd,_0x24952e[_0xcabf('0x3e')]);var _0x216574={'where':_0xa72dbd[_0xcabf('0x38')]};return db[_0xcabf('0x2a')][_0xcabf('0x1b')](_0x216574)[_0xcabf('0x22')](function(_0x1c1e6d){_0x2f1795[_0xcabf('0x1b')]=_0x1c1e6d;if(_0x24952e['query']['includeAll']){_0xa72dbd[_0xcabf('0x3f')]=[{'all':!![]}];}return db[_0xcabf('0x2a')][_0xcabf('0x40')](_0xa72dbd);})['then'](function(_0xa252d1){_0x2f1795[_0xcabf('0x41')]=_0xa252d1;return _0x2f1795;})['then'](respondWithFilteredResult(_0x3df62b,_0xa72dbd))[_0xcabf('0x42')](handleError(_0x3df62b,null));};exports[_0xcabf('0x43')]=function(_0x22a096,_0x19b7fe){var _0x440014={'raw':![],'where':{'id':_0x22a096[_0xcabf('0x44')]['id']}},_0x1cc215={};_0x1cc215['model']=_[_0xcabf('0x45')](db[_0xcabf('0x2a')][_0xcabf('0x2b')]);_0x1cc215[_0xcabf('0x31')]=_['keys'](_0x22a096[_0xcabf('0x31')]);_0x1cc215[_0xcabf('0x39')]=_[_0xcabf('0x32')](_0x1cc215[_0xcabf('0x2f')],_0x1cc215[_0xcabf('0x31')]);_0x440014[_0xcabf('0x33')]=_['intersection'](_0x1cc215[_0xcabf('0x2f')],qs[_0xcabf('0x34')](_0x22a096['query'][_0xcabf('0x34')]));_0x440014[_0xcabf('0x33')]=_0x440014[_0xcabf('0x33')]['length']?_0x440014[_0xcabf('0x33')]:_0x1cc215[_0xcabf('0x2f')];if(_0x22a096[_0xcabf('0x31')][_0xcabf('0x46')]){_0x440014[_0xcabf('0x3f')]=[{'all':!![]}];}_0x440014=_[_0xcabf('0x3c')]({},_0x440014,_0x22a096['options']);return db[_0xcabf('0x2a')][_0xcabf('0x47')](_0x440014)['then'](handleEntityNotFound(_0x19b7fe,null))[_0xcabf('0x22')](respondWithResult(_0x19b7fe,null))[_0xcabf('0x42')](handleError(_0x19b7fe,null));};exports[_0xcabf('0x48')]=function(_0x26189c,_0x20cc97){return db[_0xcabf('0x2a')][_0xcabf('0x48')](_0x26189c[_0xcabf('0x49')],{})[_0xcabf('0x22')](function(_0x1cc411){var _0x295345=_0x26189c[_0xcabf('0x4a')][_0xcabf('0x23')]({'plain':!![]});if(!_0x295345)throw new Error(_0xcabf('0x4b'));if(_0x295345[_0xcabf('0x4c')]==='user'){var _0x400e5a=_0x1cc411[_0xcabf('0x23')]({'plain':!![]});var _0x16c3fb=_0xcabf('0x4d');return db[_0xcabf('0x4e')][_0xcabf('0x47')]({'where':{'name':_0x16c3fb,'userProfileId':_0x295345[_0xcabf('0x4f')]},'raw':!![]})['then'](function(_0x561937){if(_0x561937&&_0x561937[_0xcabf('0x50')]===0x0){return db[_0xcabf('0x25')]['create']({'name':_0x400e5a[_0xcabf('0x28')],'resourceId':_0x400e5a['id'],'type':_0xcabf('0x24'),'sectionId':_0x561937['id']},{})[_0xcabf('0x22')](function(){return _0x1cc411;});}else{return _0x1cc411;}})['catch'](function(_0x3bba7d){logger[_0xcabf('0x51')](_0xcabf('0x52'),_0x3bba7d);throw _0x3bba7d;});}return _0x1cc411;})[_0xcabf('0x22')](respondWithResult(_0x20cc97,0xc9))[_0xcabf('0x42')](handleError(_0x20cc97,null));};exports['update']=function(_0x4a0135,_0x54e2d9){if(_0x4a0135['body']['id']){delete _0x4a0135[_0xcabf('0x49')]['id'];}return db[_0xcabf('0x2a')][_0xcabf('0x47')]({'where':{'id':_0x4a0135[_0xcabf('0x44')]['id']}})[_0xcabf('0x22')](handleEntityNotFound(_0x54e2d9,null))[_0xcabf('0x22')](saveUpdates(_0x4a0135[_0xcabf('0x49')],null))['then'](respondWithResult(_0x54e2d9,null))[_0xcabf('0x42')](handleError(_0x54e2d9,null));};exports[_0xcabf('0x26')]=function(_0x215538,_0x2d5875){return db['AnalyticCustomReport'][_0xcabf('0x47')]({'where':{'id':_0x215538[_0xcabf('0x44')]['id']}})[_0xcabf('0x22')](handleEntityNotFound(_0x2d5875,null))[_0xcabf('0x22')](removeEntity(_0x2d5875,null))[_0xcabf('0x42')](handleError(_0x2d5875,null));};exports[_0xcabf('0x53')]=function(_0x3d4fb6,_0x1a1666){var _0x5d8a16=0xa;var _0x1d97c8=[_0xcabf('0x54'),_0xcabf('0x55'),_0xcabf('0x56'),_0xcabf('0x57')];var _0x5e7a8a={'SUM':_0xcabf('0x58'),'COUNT':_0xcabf('0x59'),'COUNT DISTINCT':_0xcabf('0x5a'),'MAX':_0xcabf('0x5b'),'MIN':_0xcabf('0x5c'),'AVG':_0xcabf('0x5d'),'GROUP_CONCAT':_0xcabf('0x5e'),'GROUP_CONCAT ASC':_0xcabf('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x37051c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xcabf('0x60'),'HOUR':_0xcabf('0x61'),'ROUND':_0xcabf('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x23759d=function(_0x43880d){return!_[_0xcabf('0x63')]([_0xcabf('0x64'),_0xcabf('0x65'),'IS\x20EMPTY',_0xcabf('0x66')],_0x43880d);};var _0x2cfce1=function(_0x1bfa8c){if(!_0x1bfa8c||!_0x1bfa8c[_0xcabf('0x67')][_0xcabf('0x68')]){return'';}for(var _0x3d6de0='(',_0x1eb7aa=0x0;_0x1eb7aa<_0x1bfa8c['rules'][_0xcabf('0x68')];_0x1eb7aa+=0x1){_0x1eb7aa>0x0&&(_0x3d6de0+='\x20'+_0x1bfa8c['operator']+'\x20');_0x3d6de0+=_0x1bfa8c[_0xcabf('0x67')][_0x1eb7aa]['group']?_0x2cfce1(_0x1bfa8c[_0xcabf('0x67')][_0x1eb7aa]['group']):_0x1bfa8c[_0xcabf('0x67')][_0x1eb7aa][_0xcabf('0x69')]+'\x20'+_0x1bfa8c[_0xcabf('0x67')][_0x1eb7aa][_0xcabf('0x6a')]+(_0x23759d(_0x1bfa8c[_0xcabf('0x67')][_0x1eb7aa][_0xcabf('0x6a')])?'\x20'+_0x1bfa8c[_0xcabf('0x67')][_0x1eb7aa]['value']:'');}return _0x3d6de0+')';};var _0x2373e6={'where':{'id':_0x3d4fb6['params']['id']}},_0x58c321,_0x6287ef,_0x47d9f3,_0x524604,_0x1fe5f9;_0x2373e6=_['merge']({},_0x2373e6,_0x3d4fb6[_0xcabf('0x3e')]);return db['AnalyticCustomReport'][_0xcabf('0x47')](_0x2373e6)[_0xcabf('0x22')](function(_0x50bd8a){if(_0x50bd8a){_0x58c321=_0x50bd8a;return _0x50bd8a[_0xcabf('0x6b')]();}return null;})['then'](function(_0x5e5005){if(_0x5e5005){if(!_0x5e5005[_0xcabf('0x68')]){throw new db[(_0xcabf('0x6c'))]['ValidationErrorItem'](_0xcabf('0x6d'),0x193);}_0x6287ef=_0x5e5005;return db['AnalyticMetric'][_0xcabf('0x40')]({'raw':!![]});}return null;})[_0xcabf('0x22')](function(_0x292b05){if(_0x292b05){_0x47d9f3=_[_0xcabf('0x6e')](_0x292b05,'id');var _0x24e29e;var _0x1bfe4c=squel[_0xcabf('0x6f')]();_0x1bfe4c['from'](_0x58c321['table']);for(var _0x5e0119=0x0;_0x5e0119<_0x6287ef[_0xcabf('0x68')];_0x5e0119+=0x1){_0x24e29e=_0x6287ef[_0x5e0119][_0xcabf('0x70')]?_0x47d9f3[_0x6287ef[_0x5e0119][_0xcabf('0x70')]]['metric']:_0x6287ef[_0x5e0119][_0xcabf('0x69')];_0x24e29e=_0x6287ef[_0x5e0119][_0xcabf('0x71')]?_[_0xcabf('0x72')](_0x5e7a8a[_0x6287ef[_0x5e0119][_0xcabf('0x71')]],'%s',_0x24e29e):_0x24e29e;_0x24e29e=_0x6287ef[_0x5e0119][_0xcabf('0x73')]?_[_0xcabf('0x72')](_0x37051c[_0x6287ef[_0x5e0119]['format']],'%s',_0x24e29e):_0x24e29e;if(_0x6287ef[_0x5e0119][_0xcabf('0x74')]){_0x1bfe4c[_0xcabf('0x75')](_0x24e29e);}_0x6287ef[_0x5e0119][_0xcabf('0x76')]&&_0x1bfe4c['order'](_0x24e29e,_0x6287ef[_0x5e0119][_0xcabf('0x76')]==='DESC'?![]:!![]);_0x1bfe4c[_0xcabf('0x69')](_0x24e29e,_0x6287ef[_0x5e0119][_0xcabf('0x77')]||_0x24e29e);}if(_0x58c321[_0xcabf('0x78')]){_0x58c321[_0xcabf('0x78')]=JSON[_0xcabf('0x79')](_0x58c321[_0xcabf('0x78')]);for(var _0x4aca70=0x0;_0x4aca70<_0x58c321[_0xcabf('0x78')][_0xcabf('0x68')];_0x4aca70+=0x1){if(_0x58c321[_0xcabf('0x78')][_0x4aca70]['type']&&_[_0xcabf('0x63')](_0x1d97c8,_0x58c321[_0xcabf('0x78')][_0x4aca70][_0xcabf('0x2d')])&&_0x58c321[_0xcabf('0x78')][_0x4aca70][_0xcabf('0x7a')]&&_0x58c321[_0xcabf('0x78')][_0x4aca70][_0xcabf('0x7b')]&&_0x58c321[_0xcabf('0x78')][_0x4aca70][_0xcabf('0x7c')]){_0x1bfe4c[_0x58c321[_0xcabf('0x78')][_0x4aca70]['type']](_0x58c321[_0xcabf('0x78')][_0x4aca70][_0xcabf('0x7b')],null,util[_0xcabf('0x73')]('%s.%s\x20=\x20%s.%s',_0x58c321['table'],_0x58c321['joins'][_0x4aca70][_0xcabf('0x7a')],_0x58c321[_0xcabf('0x78')][_0x4aca70][_0xcabf('0x7b')],_0x58c321[_0xcabf('0x78')][_0x4aca70][_0xcabf('0x7c')]));}}}if(_0x58c321[_0xcabf('0x7d')]){_0x58c321[_0xcabf('0x7d')]=JSON[_0xcabf('0x79')](_0x58c321[_0xcabf('0x7d')]);_0x1bfe4c[_0xcabf('0x38')](_0x2cfce1(_0x58c321[_0xcabf('0x7d')][_0xcabf('0x75')]));}_0x1fe5f9=_0x1bfe4c[_0xcabf('0x7e')]();_0x1bfe4c[_0xcabf('0x1c')](_0x5d8a16);_0x1bfe4c[_0xcabf('0x19')](0x0);logger[_0xcabf('0x7f')](_0xcabf('0x80'),_0x1bfe4c['toString']());return dbH[_0xcabf('0x81')]['query'](_0x1bfe4c[_0xcabf('0x82')](),{'type':dbH['sequelize']['QueryTypes'][_0xcabf('0x83')]});}})[_0xcabf('0x22')](respondWithResult(_0x1a1666,null))[_0xcabf('0x42')](handleError(_0x1a1666,null));};function runReport(_0x3442fc,_0x2e5f6b,_0x139398){var _0x2151b8=_0x2e5f6b[_0xcabf('0x28')];var _0x13069d=0xa;var _0x19837d=[_0xcabf('0x54'),_0xcabf('0x55'),_0xcabf('0x56'),_0xcabf('0x57')];var _0x392df1={'SUM':_0xcabf('0x58'),'COUNT':_0xcabf('0x59'),'COUNT DISTINCT':_0xcabf('0x5a'),'MAX':_0xcabf('0x5b'),'MIN':_0xcabf('0x5c'),'AVG':_0xcabf('0x5d'),'GROUP_CONCAT':_0xcabf('0x5e'),'GROUP_CONCAT ASC':_0xcabf('0x5f'),'GROUP_CONCAT DESC':_0xcabf('0x84')};var _0x40ee9a={'SEC_TO_TIME':_0xcabf('0x85'),'DATE':_0xcabf('0x60'),'HOUR':'HOUR(%s)','ROUND':_0xcabf('0x62'),'UNIX_TIMESTAMP':_0xcabf('0x86')};var _0x126d1e=function(_0x3c3d2b){return!_[_0xcabf('0x63')]([_0xcabf('0x64'),_0xcabf('0x65'),_0xcabf('0x87'),_0xcabf('0x66')],_0x3c3d2b);};var _0x5ae70b=function(_0x11c387){if(!_0x11c387||!_0x11c387['rules'][_0xcabf('0x68')]){return'';}for(var _0x4cfcac='(',_0x645ec7=0x0;_0x645ec7<_0x11c387[_0xcabf('0x67')]['length'];_0x645ec7+=0x1){_0x645ec7>0x0&&(_0x4cfcac+='\x20'+_0x11c387[_0xcabf('0x88')]+'\x20');_0x4cfcac+=_0x11c387[_0xcabf('0x67')][_0x645ec7][_0xcabf('0x75')]?_0x5ae70b(_0x11c387[_0xcabf('0x67')][_0x645ec7][_0xcabf('0x75')]):_0x11c387[_0xcabf('0x67')][_0x645ec7][_0xcabf('0x69')]+'\x20'+_0x11c387[_0xcabf('0x67')][_0x645ec7][_0xcabf('0x6a')]+(_0x126d1e(_0x11c387[_0xcabf('0x67')][_0x645ec7][_0xcabf('0x6a')])?'\x20'+_0x11c387['rules'][_0x645ec7][_0xcabf('0x89')]:'');}return _0x4cfcac+')';};var _0x47bc57={'where':{'id':_0x3442fc['id']}},_0x1b308d,_0xa5d7d6,_0xb59cad,_0x4ee2c6,_0x10fb2d;_0x47bc57=_[_0xcabf('0x3c')]({},_0x47bc57,_0x139398);return db[_0xcabf('0x2a')]['find'](_0x47bc57)[_0xcabf('0x22')](function(_0x3b285c){if(_0x3b285c){_0x1b308d=_0x3b285c;return _0x3b285c[_0xcabf('0x6b')]();}return null;})[_0xcabf('0x22')](function(_0x127ba0){if(_0x127ba0){if(!_0x127ba0[_0xcabf('0x68')]){throw new db[(_0xcabf('0x6c'))]['ValidationErrorItem'](_0xcabf('0x6d'),0x193);}_0xa5d7d6=_0x127ba0;return db[_0xcabf('0x8a')][_0xcabf('0x40')]({'raw':!![]});}return null;})[_0xcabf('0x22')](function(_0x3a0bae){if(_0x3a0bae){_0xb59cad=_['keyBy'](_0x3a0bae,'id');var _0x119e6f;var _0x2a5902=squel[_0xcabf('0x6f')]();_0x2a5902[_0xcabf('0x8b')](_0x1b308d[_0xcabf('0x8c')]);for(var _0x490fe8=0x0;_0x490fe8<_0xa5d7d6[_0xcabf('0x68')];_0x490fe8+=0x1){_0x119e6f=_0xa5d7d6[_0x490fe8]['MetricId']?_0xb59cad[_0xa5d7d6[_0x490fe8][_0xcabf('0x70')]]['metric']:_0xa5d7d6[_0x490fe8][_0xcabf('0x69')];_0x119e6f=_0xa5d7d6[_0x490fe8][_0xcabf('0x71')]?_[_0xcabf('0x72')](_0x392df1[_0xa5d7d6[_0x490fe8][_0xcabf('0x71')]],'%s',_0x119e6f):_0x119e6f;_0x119e6f=_0xa5d7d6[_0x490fe8]['format']?_[_0xcabf('0x72')](_0x40ee9a[_0xa5d7d6[_0x490fe8][_0xcabf('0x73')]],'%s',_0x119e6f):_0x119e6f;if(_0xa5d7d6[_0x490fe8][_0xcabf('0x74')]){_0x2a5902[_0xcabf('0x75')](_0x119e6f);}_0xa5d7d6[_0x490fe8][_0xcabf('0x76')]&&_0x2a5902[_0xcabf('0x8d')](_0x119e6f,_0xa5d7d6[_0x490fe8][_0xcabf('0x76')]===_0xcabf('0x8e')?![]:!![]);_0x2a5902['field'](_0x119e6f,_0xa5d7d6[_0x490fe8][_0xcabf('0x77')]||_0x119e6f);}if(_0x1b308d[_0xcabf('0x78')]){_0x1b308d[_0xcabf('0x78')]=JSON[_0xcabf('0x79')](_0x1b308d[_0xcabf('0x78')]);for(var _0x25bf93=0x0;_0x25bf93<_0x1b308d[_0xcabf('0x78')]['length'];_0x25bf93+=0x1){if(_0x1b308d[_0xcabf('0x78')][_0x25bf93]['type']&&_[_0xcabf('0x63')](_0x19837d,_0x1b308d[_0xcabf('0x78')][_0x25bf93][_0xcabf('0x2d')])&&_0x1b308d['joins'][_0x25bf93][_0xcabf('0x7a')]&&_0x1b308d[_0xcabf('0x78')][_0x25bf93][_0xcabf('0x7b')]&&_0x1b308d[_0xcabf('0x78')][_0x25bf93][_0xcabf('0x7c')]){_0x2a5902[_0x1b308d[_0xcabf('0x78')][_0x25bf93][_0xcabf('0x2d')]](_0x1b308d[_0xcabf('0x78')][_0x25bf93]['foreignTable'],null,util[_0xcabf('0x73')]('%s.%s\x20=\x20%s.%s',_0x1b308d['table'],_0x1b308d['joins'][_0x25bf93][_0xcabf('0x7a')],_0x1b308d[_0xcabf('0x78')][_0x25bf93]['foreignTable'],_0x1b308d[_0xcabf('0x78')][_0x25bf93][_0xcabf('0x7c')]));}}}if(_0x1b308d[_0xcabf('0x7d')]){_0x1b308d[_0xcabf('0x7d')]=JSON[_0xcabf('0x79')](_0x1b308d[_0xcabf('0x7d')]);_0x2a5902['where'](_0x5ae70b(_0x1b308d[_0xcabf('0x7d')][_0xcabf('0x75')]));}_0x10fb2d=_0x2a5902[_0xcabf('0x7e')]();_0x2a5902[_0xcabf('0x1c')](_0x13069d);_0x2a5902[_0xcabf('0x19')](0x0);return;}})[_0xcabf('0x22')](function(){if(_0x2e5f6b[_0xcabf('0x8f')]===_0xcabf('0x90')){return null;}var _0x5190cf=_['merge'](_0x2e5f6b,{'name':_0x2e5f6b[_0xcabf('0x91')]||_0x2e5f6b[_0xcabf('0x28')]||_0x1b308d[_0xcabf('0x28')],'basename':_0x2151b8,'savename':util[_0xcabf('0x73')](_0xcabf('0x92'),_0x2e5f6b['name']||_0x1b308d[_0xcabf('0x28')],require(_0xcabf('0x93'))[_0xcabf('0x94')](0x4),_0x2e5f6b[_0xcabf('0x8f')]||_0xcabf('0x95')),'reportId':_0x1b308d['id'],'reportType':_0xcabf('0x96')});return db[_0xcabf('0x97')][_0xcabf('0x48')](_0x5190cf,{'raw':!![]});})[_0xcabf('0x22')](function(_0x18a628){if(_0x1b308d[_0xcabf('0x8c')]===_0xcabf('0x98')){_0x10fb2d[_0xcabf('0x38')](_0x1b308d['table']+_0xcabf('0x99'),_0x2e5f6b[_0xcabf('0x9a')],_0x2e5f6b[_0xcabf('0x9b')]);}else{_0x10fb2d[_0xcabf('0x38')](_0x1b308d[_0xcabf('0x8c')]+_0xcabf('0x9c'),_0x2e5f6b[_0xcabf('0x9a')],_0x2e5f6b[_0xcabf('0x9b')]);}if(_0x18a628){logger[_0xcabf('0x9d')](_0xcabf('0x9e'),_0x10fb2d[_0xcabf('0x82')]());require(_0xcabf('0x9f'))[_0xcabf('0xa0')](path[_0xcabf('0x54')](__dirname,_0xcabf('0xa1'),_0x18a628['output']),[_0x18a628['id'],_0x10fb2d[_0xcabf('0x82')](),path[_0xcabf('0x54')](__dirname,_0xcabf('0xa2'),_0x18a628[_0xcabf('0xa3')]),_0x2151b8]);return _0x18a628;}else{var _0x10e180=squel[_0xcabf('0x6f')]();_0x10e180[_0xcabf('0x8b')]('('+_0x10fb2d['toString']()+')',_0xcabf('0xa4'));_0x10e180['field'](_0xcabf('0xa5'),'count');_0x10fb2d[_0xcabf('0x1c')](_0x2e5f6b[_0xcabf('0x1c')]||_0x13069d);_0x10fb2d[_0xcabf('0x19')](_0x2e5f6b[_0xcabf('0x19')]||0x0);return dbH[_0xcabf('0x81')]['query'](_0x10e180['toString'](),{'type':dbH[_0xcabf('0x81')][_0xcabf('0xa6')][_0xcabf('0x83')]})['then'](function(_0x24ebf9){if(!_0x24ebf9[_0xcabf('0x68')]){_0x4ee2c6=0x0;}else{_0x4ee2c6=_0x24ebf9[0x0][_0xcabf('0x1b')]||0x0;}return dbH[_0xcabf('0x81')][_0xcabf('0x31')](_0x10fb2d[_0xcabf('0x82')](),{'type':dbH['sequelize'][_0xcabf('0xa6')][_0xcabf('0x83')]});})[_0xcabf('0x22')](function(_0x31e874){return{'rows':_0x31e874||[],'count':_0x4ee2c6};});}});}exports[_0xcabf('0xa7')]=function(_0x1df9f0,_0x5b7783){return runReport(_0x1df9f0[_0xcabf('0x44')],_0x1df9f0['query'],_0x1df9f0['options'])[_0xcabf('0x22')](respondWithResult(_0x5b7783,null))[_0xcabf('0x42')](handleError(_0x5b7783,null));};exports[_0xcabf('0xa8')]=runReport;exports[_0xcabf('0x31')]=function(_0x56911c,_0x33fb5d){var _0x30e95b=0xa;var _0x42ac19=['join',_0xcabf('0x55'),_0xcabf('0x56'),'cross_join'];var _0x32ae69={'SUM':_0xcabf('0x58'),'COUNT':_0xcabf('0x59'),'COUNT DISTINCT':_0xcabf('0x5a'),'MAX':_0xcabf('0x5b'),'MIN':_0xcabf('0x5c'),'AVG':_0xcabf('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcabf('0x84')};var _0x49694c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xcabf('0x60'),'HOUR':_0xcabf('0x61'),'ROUND':_0xcabf('0x62'),'UNIX_TIMESTAMP':_0xcabf('0x86')};var _0x21b713=function(_0x2ad9de){return!_['includes']([_0xcabf('0x64'),_0xcabf('0x65'),_0xcabf('0x87'),_0xcabf('0x66')],_0x2ad9de);};var _0x1e8c51=function(_0x5ca84e){if(!_0x5ca84e||!_0x5ca84e[_0xcabf('0x67')][_0xcabf('0x68')]){return'';}for(var _0x5a4f36='(',_0x4f8524=0x0;_0x4f8524<_0x5ca84e[_0xcabf('0x67')]['length'];_0x4f8524+=0x1){_0x4f8524>0x0&&(_0x5a4f36+='\x20'+_0x5ca84e['operator']+'\x20');_0x5a4f36+=_0x5ca84e[_0xcabf('0x67')][_0x4f8524][_0xcabf('0x75')]?_0x1e8c51(_0x5ca84e[_0xcabf('0x67')][_0x4f8524][_0xcabf('0x75')]):_0x5ca84e[_0xcabf('0x67')][_0x4f8524][_0xcabf('0x69')]+'\x20'+_0x5ca84e[_0xcabf('0x67')][_0x4f8524]['condition']+(_0x21b713(_0x5ca84e[_0xcabf('0x67')][_0x4f8524][_0xcabf('0x6a')])?'\x20'+_0x5ca84e['rules'][_0x4f8524][_0xcabf('0x89')]:'');}return _0x5a4f36+')';};var _0x52beeb={'where':{'id':_0x56911c[_0xcabf('0x44')]['id']}},_0x279897,_0xccd11f,_0x152eac,_0x2dfee6,_0x314b3a;_0x52beeb=_[_0xcabf('0x3c')]({},_0x52beeb,_0x56911c[_0xcabf('0x3e')]);return db[_0xcabf('0x2a')][_0xcabf('0x47')](_0x52beeb)['then'](function(_0x538a6e){if(_0x538a6e){_0x279897=_0x538a6e;return _0x538a6e[_0xcabf('0x6b')]();}return null;})['then'](function(_0x2ba6e9){if(_0x2ba6e9){if(!_0x2ba6e9['length']){throw new db[(_0xcabf('0x6c'))][(_0xcabf('0xa9'))](_0xcabf('0x6d'),0x193);}_0xccd11f=_0x2ba6e9;return db[_0xcabf('0x8a')][_0xcabf('0x40')]({'raw':!![]});}return null;})[_0xcabf('0x22')](function(_0x5a2ec1){if(_0x5a2ec1){_0x152eac=_[_0xcabf('0x6e')](_0x5a2ec1,'id');var _0x3bc9e6;var _0x252f72=squel[_0xcabf('0x6f')]();_0x252f72[_0xcabf('0x8b')](_0x279897[_0xcabf('0x8c')]);for(var _0x2204ce=0x0;_0x2204ce<_0xccd11f[_0xcabf('0x68')];_0x2204ce+=0x1){_0x3bc9e6=_0xccd11f[_0x2204ce][_0xcabf('0x70')]?_0x152eac[_0xccd11f[_0x2204ce][_0xcabf('0x70')]][_0xcabf('0xaa')]:_0xccd11f[_0x2204ce]['field'];_0x3bc9e6=_0xccd11f[_0x2204ce]['function']?_[_0xcabf('0x72')](_0x32ae69[_0xccd11f[_0x2204ce]['function']],'%s',_0x3bc9e6):_0x3bc9e6;_0x3bc9e6=_0xccd11f[_0x2204ce]['format']?_['replace'](_0x49694c[_0xccd11f[_0x2204ce]['format']],'%s',_0x3bc9e6):_0x3bc9e6;if(_0xccd11f[_0x2204ce][_0xcabf('0x74')]){_0x252f72[_0xcabf('0x75')](_0x3bc9e6);}_0xccd11f[_0x2204ce][_0xcabf('0x76')]&&_0x252f72[_0xcabf('0x8d')](_0x3bc9e6,_0xccd11f[_0x2204ce]['orderBy']==='DESC'?![]:!![]);_0x252f72['field'](_0x3bc9e6,_0xccd11f[_0x2204ce][_0xcabf('0x77')]||_0x3bc9e6);}if(_0x279897[_0xcabf('0x78')]){_0x279897['joins']=JSON[_0xcabf('0x79')](_0x279897['joins']);for(var _0x42e298=0x0;_0x42e298<_0x279897['joins'][_0xcabf('0x68')];_0x42e298+=0x1){if(_0x279897['joins'][_0x42e298][_0xcabf('0x2d')]&&_[_0xcabf('0x63')](_0x42ac19,_0x279897[_0xcabf('0x78')][_0x42e298][_0xcabf('0x2d')])&&_0x279897['joins'][_0x42e298][_0xcabf('0x7a')]&&_0x279897[_0xcabf('0x78')][_0x42e298][_0xcabf('0x7b')]&&_0x279897[_0xcabf('0x78')][_0x42e298][_0xcabf('0x7c')]){_0x252f72[_0x279897[_0xcabf('0x78')][_0x42e298][_0xcabf('0x2d')]](_0x279897['joins'][_0x42e298][_0xcabf('0x7b')],null,util[_0xcabf('0x73')](_0xcabf('0xab'),_0x279897[_0xcabf('0x8c')],_0x279897[_0xcabf('0x78')][_0x42e298][_0xcabf('0x7a')],_0x279897[_0xcabf('0x78')][_0x42e298][_0xcabf('0x7b')],_0x279897[_0xcabf('0x78')][_0x42e298][_0xcabf('0x7c')]));}}}if(_0x279897['conditions']){_0x279897[_0xcabf('0x7d')]=JSON[_0xcabf('0x79')](_0x279897[_0xcabf('0x7d')]);_0x252f72[_0xcabf('0x38')](_0x1e8c51(_0x279897[_0xcabf('0x7d')]['group']));}_0x314b3a=_0x252f72['clone']();_0x252f72[_0xcabf('0x1c')](_0x30e95b);_0x252f72[_0xcabf('0x19')](0x0);logger[_0xcabf('0x7f')](_0xcabf('0x80'),_0x252f72[_0xcabf('0x82')]());return dbH[_0xcabf('0x81')]['query'](_0x252f72[_0xcabf('0x82')](),{'type':dbH[_0xcabf('0x81')]['QueryTypes']['SELECT']});}})[_0xcabf('0x22')](function(){return{'sql':_0x314b3a[_0xcabf('0x82')]()};})['then'](respondWithResult(_0x33fb5d,null))['catch'](handleError(_0x33fb5d,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index d9bd9d9..cdfeb80 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 _0x0071=['exports','define','AnalyticCustomReport','analytics_custom_reports','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x3041dc,_0x17d011){var _0x38fd56=function(_0x591601){while(--_0x591601){_0x3041dc['push'](_0x3041dc['shift']());}};_0x38fd56(++_0x17d011);}(_0x0071,0x117));var _0x1007=function(_0x26679e,_0x508e1c){_0x26679e=_0x26679e-0x0;var _0x18c847=_0x0071[_0x26679e];return _0x18c847;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1007('0x0'))(_0x1007('0x1'));var moment=require('moment');var BPromise=require(_0x1007('0x2'));var rp=require(_0x1007('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1007('0x4'));var config=require(_0x1007('0x5'));var attributes=require(_0x1007('0x6'));module[_0x1007('0x7')]=function(_0x191b7b,_0x567754){return _0x191b7b[_0x1007('0x8')](_0x1007('0x9'),attributes,{'tableName':_0x1007('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe7a1=['AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','bluebird','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define'];(function(_0x22b4c6,_0x18e2d8){var _0x917d72=function(_0xb62759){while(--_0xb62759){_0x22b4c6['push'](_0x22b4c6['shift']());}};_0x917d72(++_0x18e2d8);}(_0xe7a1,0x110));var _0x1e7a=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xe7a1[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0x1e7a('0x0'));var util=require('util');var logger=require(_0x1e7a('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1e7a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1e7a('0x3'));var config=require(_0x1e7a('0x4'));var attributes=require(_0x1e7a('0x5'));module[_0x1e7a('0x6')]=function(_0x2a37b9,_0x2c76ef){return _0x2a37b9[_0x1e7a('0x7')](_0x1e7a('0x8'),attributes,{'tableName':_0x1e7a('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 04fbac1..7ad4855 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 _0x7bc2=['jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x695b76,_0x551526){var _0x1dc21f=function(_0x5fdb1c){while(--_0x5fdb1c){_0x695b76['push'](_0x695b76['shift']());}};_0x1dc21f(++_0x551526);}(_0x7bc2,0xad));var _0x27bc=function(_0x135898,_0xccb464){_0x135898=_0x135898-0x0;var _0x27368e=_0x7bc2[_0x135898];return _0x27368e;};'use strict';var _=require(_0x27bc('0x0'));var util=require(_0x27bc('0x1'));var moment=require(_0x27bc('0x2'));var BPromise=require(_0x27bc('0x3'));var rs=require(_0x27bc('0x4'));var fs=require('fs');var Redis=require(_0x27bc('0x5'));var db=require(_0x27bc('0x6'))['db'];var utils=require(_0x27bc('0x7'));var logger=require(_0x27bc('0x8'))(_0x27bc('0x9'));var config=require(_0x27bc('0xa'));var jayson=require(_0x27bc('0xb'));var client=jayson['client'][_0x27bc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c1329,_0x1ddd7e,_0x42dd23){return new BPromise(function(_0x5c4190,_0x46b10c){return client[_0x27bc('0xd')](_0x4c1329,_0x42dd23)[_0x27bc('0xe')](function(_0x3ef077){logger[_0x27bc('0xf')](_0x27bc('0x10'),_0x1ddd7e,_0x27bc('0x11'));logger[_0x27bc('0x12')](_0x27bc('0x13'),_0x1ddd7e,'request\x20sent',JSON[_0x27bc('0x14')](_0x3ef077));if(_0x3ef077[_0x27bc('0x15')]){if(_0x3ef077['error']['code']===0x1f4){logger[_0x27bc('0x15')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1ddd7e,_0x3ef077[_0x27bc('0x15')][_0x27bc('0x16')]);return _0x46b10c(_0x3ef077[_0x27bc('0x15')][_0x27bc('0x16')]);}logger[_0x27bc('0x15')](_0x27bc('0x10'),_0x1ddd7e,_0x3ef077[_0x27bc('0x15')][_0x27bc('0x16')]);return _0x5c4190(_0x3ef077[_0x27bc('0x15')][_0x27bc('0x16')]);}else{logger['info'](_0x27bc('0x10'),_0x1ddd7e,'request\x20sent');_0x5c4190(_0x3ef077['result']['message']);}})['catch'](function(_0x2b52b1){logger[_0x27bc('0x15')](_0x27bc('0x10'),_0x1ddd7e,_0x2b52b1);_0x46b10c(_0x2b52b1);});});}
\ No newline at end of file
+var _0xf2e4=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','request\x20sent','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x598408,_0x5e6f74){var _0x560720=function(_0x56a96d){while(--_0x56a96d){_0x598408['push'](_0x598408['shift']());}};_0x560720(++_0x5e6f74);}(_0xf2e4,0x119));var _0x4f2e=function(_0x37f8cf,_0x4dbb0a){_0x37f8cf=_0x37f8cf-0x0;var _0x595b52=_0xf2e4[_0x37f8cf];return _0x595b52;};'use strict';var _=require(_0x4f2e('0x0'));var util=require(_0x4f2e('0x1'));var moment=require(_0x4f2e('0x2'));var BPromise=require(_0x4f2e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f2e('0x4'));var db=require(_0x4f2e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f2e('0x6'))(_0x4f2e('0x7'));var config=require(_0x4f2e('0x8'));var jayson=require(_0x4f2e('0x9'));var client=jayson[_0x4f2e('0xa')][_0x4f2e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x554696,_0xa08672,_0x55c7c2){return new BPromise(function(_0x51f264,_0x1693c5){return client[_0x4f2e('0xc')](_0x554696,_0x55c7c2)['then'](function(_0xe81e3f){logger[_0x4f2e('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0xa08672,'request\x20sent');logger[_0x4f2e('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0xa08672,'request\x20sent',JSON[_0x4f2e('0xf')](_0xe81e3f));if(_0xe81e3f[_0x4f2e('0x10')]){if(_0xe81e3f[_0x4f2e('0x10')][_0x4f2e('0x11')]===0x1f4){logger['error'](_0x4f2e('0x12'),_0xa08672,_0xe81e3f['error'][_0x4f2e('0x13')]);return _0x1693c5(_0xe81e3f[_0x4f2e('0x10')]['message']);}logger[_0x4f2e('0x10')](_0x4f2e('0x12'),_0xa08672,_0xe81e3f[_0x4f2e('0x10')][_0x4f2e('0x13')]);return _0x51f264(_0xe81e3f[_0x4f2e('0x10')][_0x4f2e('0x13')]);}else{logger[_0x4f2e('0xd')](_0x4f2e('0x12'),_0xa08672,_0x4f2e('0x14'));_0x51f264(_0xe81e3f['result'][_0x4f2e('0x13')]);}})[_0x4f2e('0x15')](function(_0x123330){logger[_0x4f2e('0x10')](_0x4f2e('0x12'),_0xa08672,_0x123330);_0x1693c5(_0x123330);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index ca19c10..13f61e6 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 _0x4e15=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0xbd09e4,_0x42e6ae){var _0x55e630=function(_0x9b1917){while(--_0x9b1917){_0xbd09e4['push'](_0xbd09e4['shift']());}};_0x55e630(++_0x42e6ae);}(_0x4e15,0x1c6));var _0x54e1=function(_0x354da0,_0x1ee027){_0x354da0=_0x354da0-0x0;var _0x3c9244=_0x4e15[_0x354da0];return _0x3c9244;};'use strict';var multer=require(_0x54e1('0x0'));var util=require(_0x54e1('0x1'));var path=require(_0x54e1('0x2'));var timeout=require(_0x54e1('0x3'));var express=require(_0x54e1('0x4'));var router=express[_0x54e1('0x5')]();var fs_extra=require(_0x54e1('0x6'));var auth=require(_0x54e1('0x7'));var interaction=require(_0x54e1('0x8'));var config=require(_0x54e1('0x9'));var controller=require(_0x54e1('0xa'));router[_0x54e1('0xb')]('/',auth[_0x54e1('0xc')](),controller[_0x54e1('0xd')]);router['get'](_0x54e1('0xe'),auth[_0x54e1('0xc')](),controller[_0x54e1('0xf')]);router[_0x54e1('0xb')](_0x54e1('0x10'),auth[_0x54e1('0xc')](),controller[_0x54e1('0x11')]);router['get'](_0x54e1('0x12'),auth[_0x54e1('0xc')](),controller['run']);router[_0x54e1('0xb')](_0x54e1('0x13'),auth[_0x54e1('0xc')](),controller[_0x54e1('0x14')]);router[_0x54e1('0x15')]('/',auth[_0x54e1('0xc')](),controller[_0x54e1('0x16')]);router[_0x54e1('0x17')](_0x54e1('0xe'),auth[_0x54e1('0xc')](),controller[_0x54e1('0x18')]);router[_0x54e1('0x19')](_0x54e1('0xe'),auth[_0x54e1('0xc')](),controller['destroy']);module[_0x54e1('0x1a')]=router;
\ No newline at end of file
+var _0x88be=['show','preview','/:id/run','run','/:id/query','query','post','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index'];(function(_0x15a60a,_0x2657a7){var _0x4193f9=function(_0x47e05d){while(--_0x47e05d){_0x15a60a['push'](_0x15a60a['shift']());}};_0x4193f9(++_0x2657a7);}(_0x88be,0xb4));var _0xe88b=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x88be[_0x2576d7];return _0x16a08c;};'use strict';var multer=require(_0xe88b('0x0'));var util=require(_0xe88b('0x1'));var path=require('path');var timeout=require(_0xe88b('0x2'));var express=require(_0xe88b('0x3'));var router=express[_0xe88b('0x4')]();var fs_extra=require(_0xe88b('0x5'));var auth=require(_0xe88b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe88b('0x7'));var controller=require(_0xe88b('0x8'));router[_0xe88b('0x9')]('/',auth[_0xe88b('0xa')](),controller[_0xe88b('0xb')]);router[_0xe88b('0x9')]('/:id',auth[_0xe88b('0xa')](),controller[_0xe88b('0xc')]);router['get']('/:id/preview',auth[_0xe88b('0xa')](),controller[_0xe88b('0xd')]);router[_0xe88b('0x9')](_0xe88b('0xe'),auth['isAuthenticated'](),controller[_0xe88b('0xf')]);router[_0xe88b('0x9')](_0xe88b('0x10'),auth[_0xe88b('0xa')](),controller[_0xe88b('0x11')]);router[_0xe88b('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe88b('0x13')](_0xe88b('0x14'),auth[_0xe88b('0xa')](),controller[_0xe88b('0x15')]);router[_0xe88b('0x16')](_0xe88b('0x14'),auth[_0xe88b('0xa')](),controller[_0xe88b('0x17')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 171b13e..98c0bcc 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 _0xb4c7=['STRING','TEXT','sequelize','exports'];(function(_0x52f159,_0x419d8a){var _0x156799=function(_0xf168e8){while(--_0xf168e8){_0x52f159['push'](_0x52f159['shift']());}};_0x156799(++_0x419d8a);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x4445a9,_0x4d7cc8){_0x4445a9=_0x4445a9-0x0;var _0x18d7f8=_0xb4c7[_0x4445a9];return _0x18d7f8;};'use strict';var Sequelize=require(_0x7b4c('0x0'));module[_0x7b4c('0x1')]={'name':{'type':Sequelize[_0x7b4c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7b4c('0x2')]},'parent':{'type':Sequelize[_0x7b4c('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7b4c('0x3')]},'joins':{'type':Sequelize[_0x7b4c('0x3')]}};
\ No newline at end of file
+var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x2caaaf,_0x34fdb4){var _0x489b29=function(_0x2aa146){while(--_0x2aa146){_0x2caaaf['push'](_0x2caaaf['shift']());}};_0x489b29(++_0x34fdb4);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x2240c1,_0x2657bd){_0x2240c1=_0x2240c1-0x0;var _0x1f0369=_0x3eea[_0x2240c1];return _0x1f0369;};'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
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 880a29a..53a0faa 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 _0x2ef3=['Sequelize','from','foreignKey','output','web','fullPath','generate','csv','cdr','startDate','endDate','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','operator','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x2ef3,0xba));var _0x32ef=function(_0x5d6f82,_0x1ec9b6){_0x5d6f82=_0x5d6f82-0x0;var _0x4f1af0=_0x2ef3[_0x5d6f82];return _0x4f1af0;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x32ef('0x18'))['dbH'];function respondWithStatusCode(_0x3e98df,_0x1ef1ae){_0x1ef1ae=_0x1ef1ae||0xcc;return function(_0x5c3eb9){if(_0x5c3eb9){return _0x3e98df['sendStatus'](_0x1ef1ae);}return _0x3e98df[_0x32ef('0x19')](_0x1ef1ae)['end']();};}function respondWithResult(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xc8;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x19')](_0x40a6e6)['json'](_0x93d492);}};}function respondWithFilteredResult(_0x55bf0b,_0x531e30){return function(_0x13db1a){if(_0x13db1a){var _0x3950e6=typeof _0x531e30[_0x32ef('0x1a')]==='undefined'&&typeof _0x531e30['limit']===_0x32ef('0x1b');var _0x1a9476=_0x13db1a[_0x32ef('0x1c')];var _0x57863c=_0x3950e6?0x0:_0x531e30[_0x32ef('0x1a')];var _0x33e230=_0x3950e6?_0x13db1a['count']:_0x531e30[_0x32ef('0x1a')]+_0x531e30[_0x32ef('0x1d')];var _0x26aff3;if(_0x33e230>=_0x1a9476){_0x33e230=_0x1a9476;_0x26aff3=0xc8;}else{_0x26aff3=0xce;}_0x55bf0b[_0x32ef('0x19')](_0x26aff3);return _0x55bf0b[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57863c+'-'+_0x33e230+'/'+_0x1a9476)['json'](_0x13db1a);}return null;};}function patchUpdates(_0x3c5b78){return function(_0x5cc3ef){try{jsonpatch[_0x32ef('0x20')](_0x5cc3ef,_0x3c5b78,!![]);}catch(_0x3a20ca){return BPromise['reject'](_0x3a20ca);}return _0x5cc3ef[_0x32ef('0x21')]();};}function saveUpdates(_0x97780,_0x5e8898){return function(_0x55f7f2){if(_0x55f7f2){return _0x55f7f2['update'](_0x97780)[_0x32ef('0x22')](function(_0xb30fab){return _0xb30fab;});}return null;};}function removeEntity(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x23')]()['then'](function(){var _0x51a412=_0x59585f[_0x32ef('0x24')]({'plain':!![]});var _0x14d4b3=_0x32ef('0x25');return db[_0x32ef('0x26')][_0x32ef('0x23')]({'where':{'type':_0x14d4b3,'resourceId':_0x51a412['id']}})[_0x32ef('0x22')](function(){return _0x59585f;});})[_0x32ef('0x22')](function(){_0x225feb[_0x32ef('0x19')](0xcc)[_0x32ef('0x27')]();});}};}function handleEntityNotFound(_0x2f52d7,_0x1335e2){return function(_0xba4b3f){if(!_0xba4b3f){_0x2f52d7['sendStatus'](0x194);}return _0xba4b3f;};}function handleError(_0xd65fde,_0x2f5d06){_0x2f5d06=_0x2f5d06||0x1f4;return function(_0x5a04cd){logger[_0x32ef('0x28')](_0x5a04cd[_0x32ef('0x29')]);if(_0x5a04cd[_0x32ef('0x2a')]){delete _0x5a04cd[_0x32ef('0x2a')];}_0xd65fde['status'](_0x2f5d06)[_0x32ef('0x2b')](_0x5a04cd);};}exports[_0x32ef('0x2c')]=function(_0x31dbc3,_0x2ac686){var _0x1b668a={},_0x1a6ed2={},_0x1a122d={'count':0x0,'rows':[]};var _0x575f3e=_[_0x32ef('0x2d')](db['AnalyticDefaultReport'][_0x32ef('0x2e')],function(_0x2b6c6a){return{'name':_0x2b6c6a['fieldName'],'type':_0x2b6c6a[_0x32ef('0x2f')][_0x32ef('0x30')]};});_0x1a6ed2[_0x32ef('0x31')]=_[_0x32ef('0x2d')](_0x575f3e,_0x32ef('0x2a'));_0x1a6ed2['query']=_['keys'](_0x31dbc3[_0x32ef('0x32')]);_0x1a6ed2['filters']=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],_0x1a6ed2[_0x32ef('0x32')]);_0x1b668a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],qs['fields'](_0x31dbc3['query']['fields']));_0x1b668a[_0x32ef('0x34')]=_0x1b668a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x1b668a['attributes']:_0x1a6ed2['model'];if(!_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x36')](_0x32ef('0x37'))){_0x1b668a['limit']=qs['limit'](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1d')]);_0x1b668a[_0x32ef('0x1a')]=qs[_0x32ef('0x1a')](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1a')]);}_0x1b668a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_0x31dbc3[_0x32ef('0x32')]['sort']);_0x1b668a[_0x32ef('0x3a')]=qs[_0x32ef('0x3b')](_[_0x32ef('0x3c')](_0x31dbc3['query'],_0x1a6ed2[_0x32ef('0x3b')]),_0x575f3e);if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x3d')]){_0x1b668a[_0x32ef('0x3a')]=_[_0x32ef('0x3e')](_0x1b668a[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x2d')](_0x575f3e,function(_0x1cebed){if(_0x1cebed[_0x32ef('0x2f')]!==_0x32ef('0x3f')){var _0xb4db74={};_0xb4db74[_0x1cebed[_0x32ef('0x2a')]]={'$like':'%'+_0x31dbc3['query'][_0x32ef('0x3d')]+'%'};return _0xb4db74;}})});}_0x1b668a=_[_0x32ef('0x3e')]({},_0x1b668a,_0x31dbc3[_0x32ef('0x40')]);var _0x1733e3={'where':_0x1b668a[_0x32ef('0x3a')]};return db[_0x32ef('0x41')][_0x32ef('0x1c')](_0x1733e3)['then'](function(_0x538758){_0x1a122d[_0x32ef('0x1c')]=_0x538758;if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x42')]){_0x1b668a[_0x32ef('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x32ef('0x44')](_0x1b668a);})[_0x32ef('0x22')](function(_0x5d2f06){_0x1a122d[_0x32ef('0x45')]=_0x5d2f06;return _0x1a122d;})['then'](respondWithFilteredResult(_0x2ac686,_0x1b668a))[_0x32ef('0x46')](handleError(_0x2ac686,null));};exports[_0x32ef('0x47')]=function(_0x37a497,_0x3be46d){var _0x2c2b62={'raw':!![],'where':{'id':_0x37a497[_0x32ef('0x48')]['id']}},_0x2310ae={};_0x2310ae[_0x32ef('0x31')]=_[_0x32ef('0x49')](db[_0x32ef('0x41')]['rawAttributes']);_0x2310ae[_0x32ef('0x32')]=_['keys'](_0x37a497[_0x32ef('0x32')]);_0x2310ae[_0x32ef('0x3b')]=_[_0x32ef('0x33')](_0x2310ae['model'],_0x2310ae[_0x32ef('0x32')]);_0x2c2b62[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x2310ae[_0x32ef('0x31')],qs[_0x32ef('0x4a')](_0x37a497[_0x32ef('0x32')][_0x32ef('0x4a')]));_0x2c2b62['attributes']=_0x2c2b62['attributes'][_0x32ef('0x35')]?_0x2c2b62[_0x32ef('0x34')]:_0x2310ae[_0x32ef('0x31')];if(_0x37a497[_0x32ef('0x32')][_0x32ef('0x42')]){_0x2c2b62[_0x32ef('0x43')]=[{'all':!![]}];}_0x2c2b62=_[_0x32ef('0x3e')]({},_0x2c2b62,_0x37a497[_0x32ef('0x40')]);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2c2b62)[_0x32ef('0x22')](handleEntityNotFound(_0x3be46d,null))[_0x32ef('0x22')](respondWithResult(_0x3be46d,null))[_0x32ef('0x46')](handleError(_0x3be46d,null));};exports['create']=function(_0x420f00,_0x12fbd7){return db[_0x32ef('0x41')][_0x32ef('0x4c')](_0x420f00[_0x32ef('0x4d')],{})[_0x32ef('0x22')](function(_0x278696){var _0x1acded=_0x420f00[_0x32ef('0x4e')][_0x32ef('0x24')]({'plain':!![]});if(!_0x1acded)throw new Error(_0x32ef('0x4f'));if(_0x1acded[_0x32ef('0x50')]===_0x32ef('0x4e')){var _0x326445=_0x278696[_0x32ef('0x24')]({'plain':!![]});var _0x3fb4d8=_0x32ef('0x51');return db[_0x32ef('0x52')]['find']({'where':{'name':_0x3fb4d8,'userProfileId':_0x1acded['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x259c32){if(_0x259c32&&_0x259c32[_0x32ef('0x53')]===0x0){return db[_0x32ef('0x26')][_0x32ef('0x4c')]({'name':_0x326445[_0x32ef('0x2a')],'resourceId':_0x326445['id'],'type':_0x32ef('0x25'),'sectionId':_0x259c32['id']},{})[_0x32ef('0x22')](function(){return _0x278696;});}else{return _0x278696;}})[_0x32ef('0x46')](function(_0x368bf1){logger[_0x32ef('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368bf1);throw _0x368bf1;});}return _0x278696;})[_0x32ef('0x22')](respondWithResult(_0x12fbd7,0xc9))[_0x32ef('0x46')](handleError(_0x12fbd7,null));};exports[_0x32ef('0x54')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x4d')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x3fe01f[_0x32ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x22')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x22')](respondWithResult(_0x38314a,null))[_0x32ef('0x46')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x206ad5[_0x32ef('0x48')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x22')](removeEntity(_0x59e5f9,null))[_0x32ef('0x46')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x55')]=function(_0x56260f,_0x56cc75){var _0xdfa103=0xa;var _0x52232a=['join',_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0x6aae59={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0xbd059e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ac877=function(_0x3c31d0){return!_[_0x32ef('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x3c31d0);};var _0x17f447=function(_0x5bb114){if(!_0x5bb114||!_0x5bb114['rules'][_0x32ef('0x35')]){return'';}for(var _0x208989='(',_0x10cb37=0x0;_0x10cb37<_0x5bb114['rules'][_0x32ef('0x35')];_0x10cb37+=0x1){_0x10cb37>0x0&&(_0x208989+='\x20'+_0x5bb114[_0x32ef('0x65')]+'\x20');_0x208989+=_0x5bb114[_0x32ef('0x66')][_0x10cb37]['group']?_0x17f447(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x67')]):_0x5bb114['rules'][_0x10cb37]['field']+'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')]+(_0x2ac877(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')])?'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x69')]:'');}return _0x208989+')';};var _0x4c89e8={'where':{'id':_0x56260f[_0x32ef('0x48')]['id']}},_0x285330,_0x63b65,_0x25b6d6,_0x36ed97,_0x21e930;_0x4c89e8=_[_0x32ef('0x3e')]({},_0x4c89e8,_0x56260f[_0x32ef('0x40')]);return db[_0x32ef('0x41')]['find'](_0x4c89e8)[_0x32ef('0x22')](function(_0x29ff58){if(_0x29ff58){_0x285330=_0x29ff58;return _0x29ff58[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0x79ae28){if(_0x79ae28){if(!_0x79ae28['length']){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x63b65=_0x79ae28;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x526fb1){if(_0x526fb1){_0x25b6d6=_[_0x32ef('0x6e')](_0x526fb1,'id');var _0x544045;var _0x216e2f=squel[_0x32ef('0x6f')]();_0x216e2f['from'](_0x285330['table']);for(var _0x2c9f7a=0x0;_0x2c9f7a<_0x63b65[_0x32ef('0x35')];_0x2c9f7a+=0x1){_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x70')]?_0x25b6d6[_0x63b65[_0x2c9f7a]['MetricId']]['metric']:_0x63b65[_0x2c9f7a][_0x32ef('0x71')];_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x6aae59[_0x63b65[_0x2c9f7a][_0x32ef('0x72')]],'%s',_0x544045):_0x544045;_0x544045=_0x63b65[_0x2c9f7a]['format']?_[_0x32ef('0x73')](_0xbd059e[_0x63b65[_0x2c9f7a][_0x32ef('0x74')]],'%s',_0x544045):_0x544045;if(_0x63b65[_0x2c9f7a][_0x32ef('0x75')]){_0x216e2f[_0x32ef('0x67')](_0x544045);}_0x63b65[_0x2c9f7a][_0x32ef('0x76')]&&_0x216e2f[_0x32ef('0x38')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x216e2f[_0x32ef('0x71')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x78')]||_0x544045);}if(_0x285330[_0x32ef('0x79')]){_0x285330[_0x32ef('0x79')]=JSON['parse'](_0x285330['joins']);for(var _0x3a9c97=0x0;_0x3a9c97<_0x285330[_0x32ef('0x79')]['length'];_0x3a9c97+=0x1){if(_0x285330[_0x32ef('0x79')][_0x3a9c97]['type']&&_[_0x32ef('0x63')](_0x52232a,_0x285330[_0x32ef('0x79')][_0x3a9c97][_0x32ef('0x2f')])&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7a')]&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')]&&_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']){_0x216e2f[_0x285330['joins'][_0x3a9c97][_0x32ef('0x2f')]](_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')],null,util['format'](_0x32ef('0x7c'),_0x285330[_0x32ef('0x7d')],_0x285330[_0x32ef('0x79')][_0x3a9c97]['parentKey'],_0x285330['joins'][_0x3a9c97]['foreignTable'],_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']));}}}if(_0x285330[_0x32ef('0x7e')]){_0x285330[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x285330[_0x32ef('0x7e')]);_0x216e2f[_0x32ef('0x3a')](_0x17f447(_0x285330[_0x32ef('0x7e')]['group']));}_0x21e930=_0x216e2f[_0x32ef('0x80')]();_0x216e2f['limit'](_0xdfa103);_0x216e2f['offset'](0x0);logger[_0x32ef('0x81')]('Limited\x20Query:',_0x216e2f[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')]['query'](_0x216e2f[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')][_0x32ef('0x84')][_0x32ef('0x85')]});}})[_0x32ef('0x22')](respondWithResult(_0x56cc75,null))[_0x32ef('0x46')](handleError(_0x56cc75,null));};function runReport(_0x4b5506,_0x51736f,_0x35b10d){var _0x5e0b55=_0x51736f[_0x32ef('0x2a')];var _0x266688=0xa;var _0x114d8e=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),'cross_join'];var _0x3232ca={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':_0x32ef('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x211fb1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0xfb4845=function(_0x21067e){return!_[_0x32ef('0x63')](['IS\x20NULL',_0x32ef('0x8b'),_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x21067e);};var _0x35653b=function(_0x5ea727){if(!_0x5ea727||!_0x5ea727[_0x32ef('0x66')]['length']){return'';}for(var _0x43f36e='(',_0x39300f=0x0;_0x39300f<_0x5ea727[_0x32ef('0x66')][_0x32ef('0x35')];_0x39300f+=0x1){_0x39300f>0x0&&(_0x43f36e+='\x20'+_0x5ea727['operator']+'\x20');_0x43f36e+=_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x67')]?_0x35653b(_0x5ea727[_0x32ef('0x66')][_0x39300f]['group']):_0x5ea727['rules'][_0x39300f]['field']+'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')]+(_0xfb4845(_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')])?'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f]['value']:'');}return _0x43f36e+')';};var _0x2678e3={'where':{'id':_0x4b5506['id']}},_0x5b3deb,_0x471de6,_0x7b0ea5,_0xc43e1,_0x4baa7a;_0x2678e3=_[_0x32ef('0x3e')]({},_0x2678e3,_0x35b10d);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2678e3)[_0x32ef('0x22')](function(_0x28bebb){if(_0x28bebb){_0x5b3deb=_0x28bebb;return _0x28bebb['getFields']();}return null;})[_0x32ef('0x22')](function(_0x484df0){if(_0x484df0){if(!_0x484df0[_0x32ef('0x35')]){throw new db[(_0x32ef('0x8c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x471de6=_0x484df0;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x3b9896){if(_0x3b9896){_0x7b0ea5=_['keyBy'](_0x3b9896,'id');var _0x356fd4;var _0x51ca6e=squel['select']();_0x51ca6e[_0x32ef('0x8d')](_0x5b3deb['table']);for(var _0x2237cf=0x0;_0x2237cf<_0x471de6[_0x32ef('0x35')];_0x2237cf+=0x1){_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x70')]?_0x7b0ea5[_0x471de6[_0x2237cf]['MetricId']]['metric']:_0x471de6[_0x2237cf][_0x32ef('0x71')];_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x3232ca[_0x471de6[_0x2237cf][_0x32ef('0x72')]],'%s',_0x356fd4):_0x356fd4;_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x211fb1[_0x471de6[_0x2237cf][_0x32ef('0x74')]],'%s',_0x356fd4):_0x356fd4;if(_0x471de6[_0x2237cf]['groupBy']){_0x51ca6e[_0x32ef('0x67')](_0x356fd4);}_0x471de6[_0x2237cf][_0x32ef('0x76')]&&_0x51ca6e[_0x32ef('0x38')](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x76')]==='DESC'?![]:!![]);_0x51ca6e['field'](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x78')]||_0x356fd4);}if(_0x5b3deb['joins']){_0x5b3deb[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x5b3deb['joins']);for(var _0x5c7594=0x0;_0x5c7594<_0x5b3deb['joins'][_0x32ef('0x35')];_0x5c7594+=0x1){if(_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x2f')]&&_[_0x32ef('0x63')](_0x114d8e,_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x2f')])&&_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x8e')]){_0x51ca6e[_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['type']](_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')],null,util[_0x32ef('0x74')](_0x32ef('0x7c'),_0x5b3deb[_0x32ef('0x7d')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7b')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['foreignKey']));}}}if(_0x5b3deb[_0x32ef('0x7e')]){_0x5b3deb['conditions']=JSON[_0x32ef('0x7f')](_0x5b3deb[_0x32ef('0x7e')]);_0x51ca6e[_0x32ef('0x3a')](_0x35653b(_0x5b3deb[_0x32ef('0x7e')][_0x32ef('0x67')]));}_0x4baa7a=_0x51ca6e['clone']();_0x51ca6e[_0x32ef('0x1d')](_0x266688);_0x51ca6e[_0x32ef('0x1a')](0x0);return;}})[_0x32ef('0x22')](function(){if(_0x51736f[_0x32ef('0x8f')]===_0x32ef('0x90')){return null;}var _0x1cfdd8=_[_0x32ef('0x3e')](_0x51736f,{'name':_0x51736f[_0x32ef('0x91')]||_0x51736f[_0x32ef('0x2a')]||_0x5b3deb['name'],'basename':_0x5e0b55,'savename':util['format']('%s-%s.%s',_0x51736f[_0x32ef('0x2a')]||_0x5b3deb[_0x32ef('0x2a')],require('randomstring')[_0x32ef('0x92')](0x4),_0x51736f['output']||_0x32ef('0x93')),'reportId':_0x5b3deb['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x32ef('0x4c')](_0x1cfdd8,{'raw':!![]});})[_0x32ef('0x22')](function(_0x118d2e){if(_0x5b3deb[_0x32ef('0x7d')]===_0x32ef('0x94')){_0x4baa7a['where'](_0x5b3deb[_0x32ef('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x51736f[_0x32ef('0x95')],_0x51736f['endDate']);}else{_0x4baa7a['where'](_0x5b3deb['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51736f['startDate'],_0x51736f[_0x32ef('0x96')]);}if(_0x118d2e){logger[_0x32ef('0x97')]('Run\x20Query:',_0x4baa7a[_0x32ef('0x82')]());require(_0x32ef('0x98'))[_0x32ef('0x99')](path[_0x32ef('0x86')](__dirname,_0x32ef('0x9a'),_0x118d2e[_0x32ef('0x8f')]),[_0x118d2e['id'],_0x4baa7a['toString'](),path[_0x32ef('0x86')](__dirname,'../../files/reports',_0x118d2e[_0x32ef('0x9b')]),_0x5e0b55]);return _0x118d2e;}else{var _0x1be713=squel['select']();_0x1be713[_0x32ef('0x8d')]('('+_0x4baa7a['toString']()+')',_0x32ef('0x9c'));_0x1be713[_0x32ef('0x71')](_0x32ef('0x9d'),_0x32ef('0x1c'));_0x4baa7a['limit'](_0x51736f[_0x32ef('0x1d')]||_0x266688);_0x4baa7a[_0x32ef('0x1a')](_0x51736f[_0x32ef('0x1a')]||0x0);return dbH[_0x32ef('0x83')]['query'](_0x1be713[_0x32ef('0x82')](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]})[_0x32ef('0x22')](function(_0x28ef17){if(!_0x28ef17[_0x32ef('0x35')]){_0xc43e1=0x0;}else{_0xc43e1=_0x28ef17[0x0][_0x32ef('0x1c')]||0x0;}return dbH['sequelize'][_0x32ef('0x32')](_0x4baa7a['toString'](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]});})[_0x32ef('0x22')](function(_0x3956e7){return{'rows':_0x3956e7||[],'count':_0xc43e1};});}});}exports['run']=function(_0x8d3b24,_0x642716){return runReport(_0x8d3b24[_0x32ef('0x48')],_0x8d3b24[_0x32ef('0x32')],_0x8d3b24['options'])['then'](respondWithResult(_0x642716,null))['catch'](handleError(_0x642716,null));};exports[_0x32ef('0x9e')]=runReport;exports[_0x32ef('0x32')]=function(_0x4454f3,_0xc92dcc){var _0x3d18b9=0xa;var _0x9233cb=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0xa76912={'SUM':'SUM(%s)','COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0x1526a1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0x2d4d2f=function(_0x292488){return!_[_0x32ef('0x63')]([_0x32ef('0x9f'),_0x32ef('0x8b'),_0x32ef('0x64'),_0x32ef('0xa0')],_0x292488);};var _0x50b674=function(_0x379d40){if(!_0x379d40||!_0x379d40[_0x32ef('0x66')][_0x32ef('0x35')]){return'';}for(var _0x4b7a4d='(',_0x16525b=0x0;_0x16525b<_0x379d40['rules'][_0x32ef('0x35')];_0x16525b+=0x1){_0x16525b>0x0&&(_0x4b7a4d+='\x20'+_0x379d40[_0x32ef('0x65')]+'\x20');_0x4b7a4d+=_0x379d40[_0x32ef('0x66')][_0x16525b]['group']?_0x50b674(_0x379d40[_0x32ef('0x66')][_0x16525b]['group']):_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x71')]+'\x20'+_0x379d40['rules'][_0x16525b][_0x32ef('0x68')]+(_0x2d4d2f(_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x68')])?'\x20'+_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x69')]:'');}return _0x4b7a4d+')';};var _0x264075={'where':{'id':_0x4454f3[_0x32ef('0x48')]['id']}},_0x3798d1,_0x4befa9,_0x493ae9,_0x143d39,_0x497948;_0x264075=_[_0x32ef('0x3e')]({},_0x264075,_0x4454f3['options']);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x264075)['then'](function(_0x1200c9){if(_0x1200c9){_0x3798d1=_0x1200c9;return _0x1200c9[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0xa5f787){if(_0xa5f787){if(!_0xa5f787[_0x32ef('0x35')]){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x4befa9=_0xa5f787;return db['AnalyticMetric'][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x55ad11){if(_0x55ad11){_0x493ae9=_[_0x32ef('0x6e')](_0x55ad11,'id');var _0x2971a8;var _0x522c22=squel[_0x32ef('0x6f')]();_0x522c22[_0x32ef('0x8d')](_0x3798d1['table']);for(var _0xb41a01=0x0;_0xb41a01<_0x4befa9[_0x32ef('0x35')];_0xb41a01+=0x1){_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x70')]?_0x493ae9[_0x4befa9[_0xb41a01][_0x32ef('0x70')]][_0x32ef('0xa1')]:_0x4befa9[_0xb41a01][_0x32ef('0x71')];_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x72')]?_['replace'](_0xa76912[_0x4befa9[_0xb41a01]['function']],'%s',_0x2971a8):_0x2971a8;_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x1526a1[_0x4befa9[_0xb41a01][_0x32ef('0x74')]],'%s',_0x2971a8):_0x2971a8;if(_0x4befa9[_0xb41a01]['groupBy']){_0x522c22[_0x32ef('0x67')](_0x2971a8);}_0x4befa9[_0xb41a01][_0x32ef('0x76')]&&_0x522c22['order'](_0x2971a8,_0x4befa9[_0xb41a01][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x522c22['field'](_0x2971a8,_0x4befa9[_0xb41a01]['alias']||_0x2971a8);}if(_0x3798d1[_0x32ef('0x79')]){_0x3798d1[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x3798d1['joins']);for(var _0x5f4eab=0x0;_0x5f4eab<_0x3798d1['joins'][_0x32ef('0x35')];_0x5f4eab+=0x1){if(_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')]&&_['includes'](_0x9233cb,_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')])&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['parentKey']&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')]&&_0x3798d1['joins'][_0x5f4eab]['foreignKey']){_0x522c22[_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['type']](_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3798d1[_0x32ef('0x7d')],_0x3798d1['joins'][_0x5f4eab][_0x32ef('0x7a')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x8e')]));}}}if(_0x3798d1[_0x32ef('0x7e')]){_0x3798d1[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x3798d1[_0x32ef('0x7e')]);_0x522c22[_0x32ef('0x3a')](_0x50b674(_0x3798d1['conditions']['group']));}_0x497948=_0x522c22[_0x32ef('0x80')]();_0x522c22[_0x32ef('0x1d')](_0x3d18b9);_0x522c22[_0x32ef('0x1a')](0x0);logger[_0x32ef('0x81')](_0x32ef('0xa2'),_0x522c22[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')][_0x32ef('0x32')](_0x522c22[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')]['QueryTypes'][_0x32ef('0x85')]});}})[_0x32ef('0x22')](function(){return{'sql':_0x497948[_0x32ef('0x82')]()};})[_0x32ef('0x22')](respondWithResult(_0xc92dcc,null))[_0x32ef('0x46')](handleError(_0xc92dcc,null));};
\ No newline at end of file
+var _0xc6ac=['keyBy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','DefaultReports','UserProfileResource','stack','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','name','query','keys','filters','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','intersection','length','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','SUM(%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\x20EMPTY','rules','operator','field','condition','value','Sequelize','AnalyticMetric','select','from','table','MetricId','replace','format','group','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','COUNT(%s)','COUNT(DISTINCT\x20%s)','IS\x20NOT\x20EMPTY','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','metric','function','groupBy','orderBy','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','getFields'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x28ca8a,_0xc92ce8){_0x28ca8a=_0x28ca8a-0x0;var _0x14b711=_0xc6ac[_0x28ca8a];return _0x14b711;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xcc6a('0x1b')];function respondWithStatusCode(_0x211444,_0x4300c0){_0x4300c0=_0x4300c0||0xcc;return function(_0x559a0a){if(_0x559a0a){return _0x211444['sendStatus'](_0x4300c0);}return _0x211444[_0xcc6a('0x1c')](_0x4300c0)[_0xcc6a('0x1d')]();};}function respondWithResult(_0x43710d,_0x348af7){_0x348af7=_0x348af7||0xc8;return function(_0x96f9de){if(_0x96f9de){return _0x43710d[_0xcc6a('0x1c')](_0x348af7)[_0xcc6a('0x1e')](_0x96f9de);}};}function respondWithFilteredResult(_0x403b18,_0x56ffb0){return function(_0x4e628f){if(_0x4e628f){var _0x4d021a=typeof _0x56ffb0[_0xcc6a('0x1f')]===_0xcc6a('0x20')&&typeof _0x56ffb0[_0xcc6a('0x21')]===_0xcc6a('0x20');var _0x33079c=_0x4e628f[_0xcc6a('0x22')];var _0x2d9585=_0x4d021a?0x0:_0x56ffb0[_0xcc6a('0x1f')];var _0x374e51=_0x4d021a?_0x4e628f[_0xcc6a('0x22')]:_0x56ffb0[_0xcc6a('0x1f')]+_0x56ffb0['limit'];var _0xfec60f;if(_0x374e51>=_0x33079c){_0x374e51=_0x33079c;_0xfec60f=0xc8;}else{_0xfec60f=0xce;}_0x403b18[_0xcc6a('0x1c')](_0xfec60f);return _0x403b18[_0xcc6a('0x23')](_0xcc6a('0x24'),_0x2d9585+'-'+_0x374e51+'/'+_0x33079c)[_0xcc6a('0x1e')](_0x4e628f);}return null;};}function patchUpdates(_0x30b8ed){return function(_0x36c80f){try{jsonpatch[_0xcc6a('0x25')](_0x36c80f,_0x30b8ed,!![]);}catch(_0x2254a8){return BPromise[_0xcc6a('0x26')](_0x2254a8);}return _0x36c80f[_0xcc6a('0x27')]();};}function saveUpdates(_0x845088,_0x51be9a){return function(_0x41c4c8){if(_0x41c4c8){return _0x41c4c8[_0xcc6a('0x28')](_0x845088)[_0xcc6a('0x29')](function(_0x581aae){return _0x581aae;});}return null;};}function removeEntity(_0x10016a,_0x294486){return function(_0x3a00e5){if(_0x3a00e5){return _0x3a00e5[_0xcc6a('0x2a')]()[_0xcc6a('0x29')](function(){var _0x5fc697=_0x3a00e5['get']({'plain':!![]});var _0x26def8=_0xcc6a('0x2b');return db[_0xcc6a('0x2c')]['destroy']({'where':{'type':_0x26def8,'resourceId':_0x5fc697['id']}})[_0xcc6a('0x29')](function(){return _0x3a00e5;});})[_0xcc6a('0x29')](function(){_0x10016a['status'](0xcc)[_0xcc6a('0x1d')]();});}};}function handleEntityNotFound(_0x8b1b2b,_0x3233d1){return function(_0x473f88){if(!_0x473f88){_0x8b1b2b['sendStatus'](0x194);}return _0x473f88;};}function handleError(_0x194aab,_0x3cf14c){_0x3cf14c=_0x3cf14c||0x1f4;return function(_0x2c6d88){logger['error'](_0x2c6d88[_0xcc6a('0x2d')]);if(_0x2c6d88['name']){delete _0x2c6d88['name'];}_0x194aab[_0xcc6a('0x1c')](_0x3cf14c)[_0xcc6a('0x2e')](_0x2c6d88);};}exports[_0xcc6a('0x2f')]=function(_0x11b481,_0x2b575d){var _0x131138={},_0x4e2de4={},_0x7b2b54={'count':0x0,'rows':[]};var _0x28e3c3=_[_0xcc6a('0x30')](db[_0xcc6a('0x31')][_0xcc6a('0x32')],function(_0x152ebd){return{'name':_0x152ebd[_0xcc6a('0x33')],'type':_0x152ebd[_0xcc6a('0x34')]['key']};});_0x4e2de4[_0xcc6a('0x35')]=_[_0xcc6a('0x30')](_0x28e3c3,_0xcc6a('0x36'));_0x4e2de4[_0xcc6a('0x37')]=_[_0xcc6a('0x38')](_0x11b481[_0xcc6a('0x37')]);_0x4e2de4[_0xcc6a('0x39')]=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],_0x4e2de4['query']);_0x131138['attributes']=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3a')]));_0x131138[_0xcc6a('0x3b')]=_0x131138['attributes']['length']?_0x131138[_0xcc6a('0x3b')]:_0x4e2de4[_0xcc6a('0x35')];if(!_0x11b481[_0xcc6a('0x37')]['hasOwnProperty'](_0xcc6a('0x3c'))){_0x131138[_0xcc6a('0x21')]=qs[_0xcc6a('0x21')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x21')]);_0x131138[_0xcc6a('0x1f')]=qs[_0xcc6a('0x1f')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x1f')]);}_0x131138[_0xcc6a('0x3d')]=qs[_0xcc6a('0x3e')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3e')]);_0x131138[_0xcc6a('0x3f')]=qs[_0xcc6a('0x39')](_[_0xcc6a('0x40')](_0x11b481[_0xcc6a('0x37')],_0x4e2de4[_0xcc6a('0x39')]),_0x28e3c3);if(_0x11b481['query']['filter']){_0x131138[_0xcc6a('0x3f')]=_[_0xcc6a('0x41')](_0x131138[_0xcc6a('0x3f')],{'$or':_[_0xcc6a('0x30')](_0x28e3c3,function(_0x1e628b){if(_0x1e628b[_0xcc6a('0x34')]!==_0xcc6a('0x42')){var _0x1199f1={};_0x1199f1[_0x1e628b['name']]={'$like':'%'+_0x11b481['query'][_0xcc6a('0x43')]+'%'};return _0x1199f1;}})});}_0x131138=_['merge']({},_0x131138,_0x11b481['options']);var _0x5cf1ba={'where':_0x131138[_0xcc6a('0x3f')]};return db[_0xcc6a('0x31')][_0xcc6a('0x22')](_0x5cf1ba)[_0xcc6a('0x29')](function(_0xe8056f){_0x7b2b54['count']=_0xe8056f;if(_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x44')]){_0x131138[_0xcc6a('0x45')]=[{'all':!![]}];}return db[_0xcc6a('0x31')][_0xcc6a('0x46')](_0x131138);})[_0xcc6a('0x29')](function(_0x54f862){_0x7b2b54[_0xcc6a('0x47')]=_0x54f862;return _0x7b2b54;})[_0xcc6a('0x29')](respondWithFilteredResult(_0x2b575d,_0x131138))[_0xcc6a('0x48')](handleError(_0x2b575d,null));};exports[_0xcc6a('0x49')]=function(_0x494904,_0x1fe723){var _0x4a9cea={'raw':!![],'where':{'id':_0x494904[_0xcc6a('0x4a')]['id']}},_0x351529={};_0x351529[_0xcc6a('0x35')]=_['keys'](db[_0xcc6a('0x31')][_0xcc6a('0x32')]);_0x351529[_0xcc6a('0x37')]=_['keys'](_0x494904['query']);_0x351529[_0xcc6a('0x39')]=_[_0xcc6a('0x4b')](_0x351529[_0xcc6a('0x35')],_0x351529[_0xcc6a('0x37')]);_0x4a9cea[_0xcc6a('0x3b')]=_['intersection'](_0x351529[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x494904['query'][_0xcc6a('0x3a')]));_0x4a9cea[_0xcc6a('0x3b')]=_0x4a9cea[_0xcc6a('0x3b')][_0xcc6a('0x4c')]?_0x4a9cea[_0xcc6a('0x3b')]:_0x351529[_0xcc6a('0x35')];if(_0x494904['query']['includeAll']){_0x4a9cea['include']=[{'all':!![]}];}_0x4a9cea=_[_0xcc6a('0x41')]({},_0x4a9cea,_0x494904[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4a9cea)['then'](handleEntityNotFound(_0x1fe723,null))[_0xcc6a('0x29')](respondWithResult(_0x1fe723,null))['catch'](handleError(_0x1fe723,null));};exports[_0xcc6a('0x4f')]=function(_0x4299ca,_0xcfc540){return db[_0xcc6a('0x31')][_0xcc6a('0x4f')](_0x4299ca[_0xcc6a('0x50')],{})['then'](function(_0x1a3b82){var _0x7288b2=_0x4299ca[_0xcc6a('0x51')][_0xcc6a('0x52')]({'plain':!![]});if(!_0x7288b2)throw new Error(_0xcc6a('0x53'));if(_0x7288b2[_0xcc6a('0x54')]===_0xcc6a('0x51')){var _0x392805=_0x1a3b82[_0xcc6a('0x52')]({'plain':!![]});var _0x30d0ef='Reports';return db[_0xcc6a('0x55')][_0xcc6a('0x4e')]({'where':{'name':_0x30d0ef,'userProfileId':_0x7288b2[_0xcc6a('0x56')]},'raw':!![]})[_0xcc6a('0x29')](function(_0x14f5e5){if(_0x14f5e5&&_0x14f5e5[_0xcc6a('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x392805[_0xcc6a('0x36')],'resourceId':_0x392805['id'],'type':'DefaultReports','sectionId':_0x14f5e5['id']},{})[_0xcc6a('0x29')](function(){return _0x1a3b82;});}else{return _0x1a3b82;}})[_0xcc6a('0x48')](function(_0x2b5782){logger[_0xcc6a('0x58')](_0xcc6a('0x59'),_0x2b5782);throw _0x2b5782;});}return _0x1a3b82;})[_0xcc6a('0x29')](respondWithResult(_0xcfc540,0xc9))[_0xcc6a('0x48')](handleError(_0xcfc540,null));};exports[_0xcc6a('0x28')]=function(_0x68b823,_0x27b074){if(_0x68b823[_0xcc6a('0x50')]['id']){delete _0x68b823['body']['id'];}return db[_0xcc6a('0x31')]['find']({'where':{'id':_0x68b823[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x27b074,null))[_0xcc6a('0x29')](saveUpdates(_0x68b823['body'],null))[_0xcc6a('0x29')](respondWithResult(_0x27b074,null))['catch'](handleError(_0x27b074,null));};exports[_0xcc6a('0x2a')]=function(_0x5db3b5,_0x3c0b1c){return db[_0xcc6a('0x31')][_0xcc6a('0x4e')]({'where':{'id':_0x5db3b5[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x3c0b1c,null))[_0xcc6a('0x29')](removeEntity(_0x3c0b1c,null))[_0xcc6a('0x48')](handleError(_0x3c0b1c,null));};exports[_0xcc6a('0x5a')]=function(_0x506311,_0x14d3ff){var _0x56d512=0xa;var _0x3a6b7e=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x586789={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x389e5f={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2cc561=function(_0x483aa4){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x483aa4);};var _0x46d93b=function(_0x4ed702){if(!_0x4ed702||!_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x20a16b='(',_0x19a578=0x0;_0x19a578<_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')];_0x19a578+=0x1){_0x19a578>0x0&&(_0x20a16b+='\x20'+_0x4ed702[_0xcc6a('0x6f')]+'\x20');_0x20a16b+=_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['group']?_0x46d93b(_0x4ed702['rules'][_0x19a578]['group']):_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x70')]+'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['condition']+(_0x2cc561(_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x71')])?'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x72')]:'');}return _0x20a16b+')';};var _0x5e1c69={'where':{'id':_0x506311['params']['id']}},_0x481d25,_0xaec5e8,_0x41527b,_0x4403d3,_0x386a74;_0x5e1c69=_[_0xcc6a('0x41')]({},_0x5e1c69,_0x506311[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x5e1c69)[_0xcc6a('0x29')](function(_0x55d129){if(_0x55d129){_0x481d25=_0x55d129;return _0x55d129['getFields']();}return null;})[_0xcc6a('0x29')](function(_0xd1a27b){if(_0xd1a27b){if(!_0xd1a27b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xaec5e8=_0xd1a27b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x421d0b){if(_0x421d0b){_0x41527b=_['keyBy'](_0x421d0b,'id');var _0x4a8863;var _0x58e6b4=squel[_0xcc6a('0x75')]();_0x58e6b4[_0xcc6a('0x76')](_0x481d25[_0xcc6a('0x77')]);for(var _0x729b2=0x0;_0x729b2<_0xaec5e8['length'];_0x729b2+=0x1){_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x78')]?_0x41527b[_0xaec5e8[_0x729b2][_0xcc6a('0x78')]]['metric']:_0xaec5e8[_0x729b2][_0xcc6a('0x70')];_0x4a8863=_0xaec5e8[_0x729b2]['function']?_[_0xcc6a('0x79')](_0x586789[_0xaec5e8[_0x729b2]['function']],'%s',_0x4a8863):_0x4a8863;_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x389e5f[_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]],'%s',_0x4a8863):_0x4a8863;if(_0xaec5e8[_0x729b2]['groupBy']){_0x58e6b4[_0xcc6a('0x7b')](_0x4a8863);}_0xaec5e8[_0x729b2]['orderBy']&&_0x58e6b4[_0xcc6a('0x3d')](_0x4a8863,_0xaec5e8[_0x729b2]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x58e6b4[_0xcc6a('0x70')](_0x4a8863,_0xaec5e8[_0x729b2][_0xcc6a('0x7d')]||_0x4a8863);}if(_0x481d25[_0xcc6a('0x7e')]){_0x481d25[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x481d25['joins']);for(var _0x18f5dc=0x0;_0x18f5dc<_0x481d25[_0xcc6a('0x7e')][_0xcc6a('0x4c')];_0x18f5dc+=0x1){if(_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]&&_['includes'](_0x3a6b7e,_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')])&&_0x481d25['joins'][_0x18f5dc]['parentKey']&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x80')]&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]){_0x58e6b4[_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]](_0x481d25['joins'][_0x18f5dc][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x481d25[_0xcc6a('0x77')],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x83')],_0x481d25['joins'][_0x18f5dc]['foreignTable'],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]));}}}if(_0x481d25[_0xcc6a('0x84')]){_0x481d25[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x481d25[_0xcc6a('0x84')]);_0x58e6b4[_0xcc6a('0x3f')](_0x46d93b(_0x481d25['conditions'][_0xcc6a('0x7b')]));}_0x386a74=_0x58e6b4[_0xcc6a('0x85')]();_0x58e6b4[_0xcc6a('0x21')](_0x56d512);_0x58e6b4[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x58e6b4['toString']());return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x58e6b4[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')][_0xcc6a('0x8b')]});}})[_0xcc6a('0x29')](respondWithResult(_0x14d3ff,null))[_0xcc6a('0x48')](handleError(_0x14d3ff,null));};function runReport(_0x2a25df,_0x1f1ff7,_0x565bcd){var _0x45c45f=_0x1f1ff7[_0xcc6a('0x36')];var _0x58cd56=0xa;var _0x1848dd=[_0xcc6a('0x8c'),_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x5abd5c={'SUM':_0xcc6a('0x5e'),'COUNT':_0xcc6a('0x8d'),'COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x5be65b={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2b5c15=function(_0x3207b2){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0xcc6a('0x8f')],_0x3207b2);};var _0x58fdb3=function(_0xb4b2b4){if(!_0xb4b2b4||!_0xb4b2b4[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x275e15='(',_0x53b419=0x0;_0x53b419<_0xb4b2b4[_0xcc6a('0x6e')]['length'];_0x53b419+=0x1){_0x53b419>0x0&&(_0x275e15+='\x20'+_0xb4b2b4[_0xcc6a('0x6f')]+'\x20');_0x275e15+=_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]?_0x58fdb3(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]):_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x70')]+'\x20'+_0xb4b2b4['rules'][_0x53b419][_0xcc6a('0x71')]+(_0x2b5c15(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x71')])?'\x20'+_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x72')]:'');}return _0x275e15+')';};var _0x4473ab={'where':{'id':_0x2a25df['id']}},_0x558e2f,_0x14a957,_0x350766,_0x589bff,_0x5661b5;_0x4473ab=_[_0xcc6a('0x41')]({},_0x4473ab,_0x565bcd);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4473ab)[_0xcc6a('0x29')](function(_0x2f0b79){if(_0x2f0b79){_0x558e2f=_0x2f0b79;return _0x2f0b79['getFields']();}return null;})[_0xcc6a('0x29')](function(_0x4a268b){if(_0x4a268b){if(!_0x4a268b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x14a957=_0x4a268b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x1f4c4e){if(_0x1f4c4e){_0x350766=_['keyBy'](_0x1f4c4e,'id');var _0x312431;var _0x2a850c=squel[_0xcc6a('0x75')]();_0x2a850c['from'](_0x558e2f[_0xcc6a('0x77')]);for(var _0xd5b9f3=0x0;_0xd5b9f3<_0x14a957[_0xcc6a('0x4c')];_0xd5b9f3+=0x1){_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]?_0x350766[_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x14a957[_0xd5b9f3][_0xcc6a('0x70')];_0x312431=_0x14a957[_0xd5b9f3]['function']?_[_0xcc6a('0x79')](_0x5abd5c[_0x14a957[_0xd5b9f3][_0xcc6a('0x93')]],'%s',_0x312431):_0x312431;_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x5be65b[_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]],'%s',_0x312431):_0x312431;if(_0x14a957[_0xd5b9f3][_0xcc6a('0x94')]){_0x2a850c[_0xcc6a('0x7b')](_0x312431);}_0x14a957[_0xd5b9f3][_0xcc6a('0x95')]&&_0x2a850c['order'](_0x312431,_0x14a957[_0xd5b9f3]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x2a850c['field'](_0x312431,_0x14a957[_0xd5b9f3][_0xcc6a('0x7d')]||_0x312431);}if(_0x558e2f[_0xcc6a('0x7e')]){_0x558e2f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x7e')]);for(var _0x1f7ee5=0x0;_0x1f7ee5<_0x558e2f[_0xcc6a('0x7e')]['length'];_0x1f7ee5+=0x1){if(_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type']&&_['includes'](_0x1848dd,_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type'])&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')]&&_0x558e2f['joins'][_0x1f7ee5]['foreignTable']&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['foreignKey']){_0x2a850c[_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x34')]](_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x558e2f['table'],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],_0x558e2f['joins'][_0x1f7ee5][_0xcc6a('0x81')]));}}}if(_0x558e2f[_0xcc6a('0x84')]){_0x558e2f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x84')]);_0x2a850c[_0xcc6a('0x3f')](_0x58fdb3(_0x558e2f[_0xcc6a('0x84')]['group']));}_0x5661b5=_0x2a850c[_0xcc6a('0x85')]();_0x2a850c[_0xcc6a('0x21')](_0x58cd56);_0x2a850c['offset'](0x0);return;}})[_0xcc6a('0x29')](function(){if(_0x1f1ff7[_0xcc6a('0x96')]===_0xcc6a('0x97')){return null;}var _0x2297ea=_[_0xcc6a('0x41')](_0x1f1ff7,{'name':_0x1f1ff7[_0xcc6a('0x98')]||_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],'basename':_0x45c45f,'savename':util[_0xcc6a('0x7a')](_0xcc6a('0x99'),_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],require(_0xcc6a('0x9a'))[_0xcc6a('0x9b')](0x4),_0x1f1ff7['output']||'csv'),'reportId':_0x558e2f['id'],'reportType':_0xcc6a('0x9c')});return db[_0xcc6a('0x9d')]['create'](_0x2297ea,{'raw':!![]});})[_0xcc6a('0x29')](function(_0x1e74a4){if(_0x558e2f[_0xcc6a('0x77')]==='cdr'){_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0x9e'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7['endDate']);}else{_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0xa0'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7[_0xcc6a('0xa1')]);}if(_0x1e74a4){logger[_0xcc6a('0xa2')](_0xcc6a('0xa3'),_0x5661b5[_0xcc6a('0x89')]());require('child_process')['fork'](path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa4'),_0x1e74a4[_0xcc6a('0x96')]),[_0x1e74a4['id'],_0x5661b5['toString'](),path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa5'),_0x1e74a4[_0xcc6a('0xa6')]),_0x45c45f]);return _0x1e74a4;}else{var _0x3b7b43=squel['select']();_0x3b7b43[_0xcc6a('0x76')]('('+_0x5661b5[_0xcc6a('0x89')]()+')',_0xcc6a('0xa7'));_0x3b7b43['field'](_0xcc6a('0xa8'),'count');_0x5661b5[_0xcc6a('0x21')](_0x1f1ff7[_0xcc6a('0x21')]||_0x58cd56);_0x5661b5['offset'](_0x1f1ff7[_0xcc6a('0x1f')]||0x0);return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x3b7b43[_0xcc6a('0x89')](),{'type':dbH[_0xcc6a('0x88')][_0xcc6a('0x8a')][_0xcc6a('0x8b')]})[_0xcc6a('0x29')](function(_0x25ba57){if(!_0x25ba57[_0xcc6a('0x4c')]){_0x589bff=0x0;}else{_0x589bff=_0x25ba57[0x0][_0xcc6a('0x22')]||0x0;}return dbH['sequelize']['query'](_0x5661b5[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});})['then'](function(_0x32ced0){return{'rows':_0x32ced0||[],'count':_0x589bff};});}});}exports[_0xcc6a('0xa9')]=function(_0xc638ae,_0x3367e8){return runReport(_0xc638ae['params'],_0xc638ae[_0xcc6a('0x37')],_0xc638ae['options'])['then'](respondWithResult(_0x3367e8,null))[_0xcc6a('0x48')](handleError(_0x3367e8,null));};exports[_0xcc6a('0xaa')]=runReport;exports[_0xcc6a('0x37')]=function(_0x38d805,_0x3f5f97){var _0x399eb6=0xa;var _0x2ae391=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x50b948={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x1d2ae0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x41d17b=function(_0x1827e6){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),'IS\x20NOT\x20NULL',_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x1827e6);};var _0xa70fa=function(_0x33ec76){if(!_0x33ec76||!_0x33ec76[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x30162c='(',_0x48746a=0x0;_0x48746a<_0x33ec76['rules'][_0xcc6a('0x4c')];_0x48746a+=0x1){_0x48746a>0x0&&(_0x30162c+='\x20'+_0x33ec76[_0xcc6a('0x6f')]+'\x20');_0x30162c+=_0x33ec76['rules'][_0x48746a][_0xcc6a('0x7b')]?_0xa70fa(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x7b')]):_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x70')]+'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['condition']+(_0x41d17b(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x71')])?'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['value']:'');}return _0x30162c+')';};var _0x54f0e4={'where':{'id':_0x38d805[_0xcc6a('0x4a')]['id']}},_0x559f4f,_0x545b15,_0x17a4e1,_0x5a7da7,_0x434c8b;_0x54f0e4=_['merge']({},_0x54f0e4,_0x38d805[_0xcc6a('0x4d')]);return db['AnalyticDefaultReport'][_0xcc6a('0x4e')](_0x54f0e4)[_0xcc6a('0x29')](function(_0xe9231f){if(_0xe9231f){_0x559f4f=_0xe9231f;return _0xe9231f[_0xcc6a('0xab')]();}return null;})[_0xcc6a('0x29')](function(_0x197961){if(_0x197961){if(!_0x197961[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x545b15=_0x197961;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x171a2a){if(_0x171a2a){_0x17a4e1=_[_0xcc6a('0xac')](_0x171a2a,'id');var _0x13860b;var _0x3b52f7=squel[_0xcc6a('0x75')]();_0x3b52f7[_0xcc6a('0x76')](_0x559f4f[_0xcc6a('0x77')]);for(var _0x319f4a=0x0;_0x319f4a<_0x545b15[_0xcc6a('0x4c')];_0x319f4a+=0x1){_0x13860b=_0x545b15[_0x319f4a]['MetricId']?_0x17a4e1[_0x545b15[_0x319f4a][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x545b15[_0x319f4a][_0xcc6a('0x70')];_0x13860b=_0x545b15[_0x319f4a]['function']?_[_0xcc6a('0x79')](_0x50b948[_0x545b15[_0x319f4a][_0xcc6a('0x93')]],'%s',_0x13860b):_0x13860b;_0x13860b=_0x545b15[_0x319f4a]['format']?_[_0xcc6a('0x79')](_0x1d2ae0[_0x545b15[_0x319f4a][_0xcc6a('0x7a')]],'%s',_0x13860b):_0x13860b;if(_0x545b15[_0x319f4a]['groupBy']){_0x3b52f7[_0xcc6a('0x7b')](_0x13860b);}_0x545b15[_0x319f4a][_0xcc6a('0x95')]&&_0x3b52f7[_0xcc6a('0x3d')](_0x13860b,_0x545b15[_0x319f4a][_0xcc6a('0x95')]===_0xcc6a('0x7c')?![]:!![]);_0x3b52f7[_0xcc6a('0x70')](_0x13860b,_0x545b15[_0x319f4a]['alias']||_0x13860b);}if(_0x559f4f['joins']){_0x559f4f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x559f4f['joins']);for(var _0x154885=0x0;_0x154885<_0x559f4f['joins'][_0xcc6a('0x4c')];_0x154885+=0x1){if(_0x559f4f['joins'][_0x154885][_0xcc6a('0x34')]&&_[_0xcc6a('0x6a')](_0x2ae391,_0x559f4f[_0xcc6a('0x7e')][_0x154885]['type'])&&_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')]&&_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignTable']&&_0x559f4f['joins'][_0x154885]['foreignKey']){_0x3b52f7[_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x34')]](_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x559f4f[_0xcc6a('0x77')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignKey']));}}}if(_0x559f4f[_0xcc6a('0x84')]){_0x559f4f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x559f4f['conditions']);_0x3b52f7[_0xcc6a('0x3f')](_0xa70fa(_0x559f4f[_0xcc6a('0x84')][_0xcc6a('0x7b')]));}_0x434c8b=_0x3b52f7['clone']();_0x3b52f7[_0xcc6a('0x21')](_0x399eb6);_0x3b52f7[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x3b52f7['toString']());return dbH[_0xcc6a('0x88')]['query'](_0x3b52f7['toString'](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});}})['then'](function(){return{'sql':_0x434c8b[_0xcc6a('0x89')]()};})[_0xcc6a('0x29')](respondWithResult(_0x3f5f97,null))[_0xcc6a('0x48')](handleError(_0x3f5f97,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index d6446dc..5853dd1 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 _0x028e=['bluebird','../../config/environment','./analyticDefaultReport.attributes','exports','analytics_default_reports','lodash','util','../../config/logger','api'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x028e,0x71));var _0xe028=function(_0x11f24d,_0x58f26a){_0x11f24d=_0x11f24d-0x0;var _0x1a86e6=_0x028e[_0x11f24d];return _0x1a86e6;};'use strict';var _=require(_0xe028('0x0'));var util=require(_0xe028('0x1'));var logger=require(_0xe028('0x2'))(_0xe028('0x3'));var moment=require('moment');var BPromise=require(_0xe028('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe028('0x5'));var attributes=require(_0xe028('0x6'));module[_0xe028('0x7')]=function(_0x34e511,_0x3bc0d6){return _0x34e511['define']('AnalyticDefaultReport',attributes,{'tableName':_0xe028('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3dc1=['../../config/logger','api','bluebird','path','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','util'];(function(_0xf86904,_0x229152){var _0x589de0=function(_0x1656d9){while(--_0x1656d9){_0xf86904['push'](_0xf86904['shift']());}};_0x589de0(++_0x229152);}(_0x3dc1,0xa4));var _0x13dc=function(_0x98bcc,_0x269ed3){_0x98bcc=_0x98bcc-0x0;var _0x2c32bd=_0x3dc1[_0x98bcc];return _0x2c32bd;};'use strict';var _=require('lodash');var util=require(_0x13dc('0x0'));var logger=require(_0x13dc('0x1'))(_0x13dc('0x2'));var moment=require('moment');var BPromise=require(_0x13dc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x13dc('0x4'));var rimraf=require(_0x13dc('0x5'));var config=require('../../config/environment');var attributes=require(_0x13dc('0x6'));module[_0x13dc('0x7')]=function(_0x1d0714,_0x170e2f){return _0x1d0714[_0x13dc('0x8')](_0x13dc('0x9'),attributes,{'tableName':_0x13dc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index adc83fa..529888f 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 _0xb711=['util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x7d152a,_0x2e9d56){var _0x35c0ae=function(_0x598bd4){while(--_0x598bd4){_0x7d152a['push'](_0x7d152a['shift']());}};_0x35c0ae(++_0x2e9d56);}(_0xb711,0x113));var _0x1b71=function(_0x2e0b2f,_0x25172b){_0x2e0b2f=_0x2e0b2f-0x0;var _0x5cf0fa=_0xb711[_0x2e0b2f];return _0x5cf0fa;};'use strict';var _=require(_0x1b71('0x0'));var util=require(_0x1b71('0x1'));var moment=require('moment');var BPromise=require(_0x1b71('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b71('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1b71('0x4'))(_0x1b71('0x5'));var config=require(_0x1b71('0x6'));var jayson=require(_0x1b71('0x7'));var client=jayson[_0x1b71('0x8')][_0x1b71('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x498ed5,_0x276dff,_0x301e89){return new BPromise(function(_0xa642e0,_0xece037){return client[_0x1b71('0xa')](_0x498ed5,_0x301e89)[_0x1b71('0xb')](function(_0x5b5ba7){logger['info'](_0x1b71('0xc'),_0x276dff,_0x1b71('0xd'));logger[_0x1b71('0xe')](_0x1b71('0xf'),_0x276dff,_0x1b71('0xd'),JSON[_0x1b71('0x10')](_0x5b5ba7));if(_0x5b5ba7[_0x1b71('0x11')]){if(_0x5b5ba7['error'][_0x1b71('0x12')]===0x1f4){logger[_0x1b71('0x11')](_0x1b71('0xc'),_0x276dff,_0x5b5ba7['error'][_0x1b71('0x13')]);return _0xece037(_0x5b5ba7[_0x1b71('0x11')][_0x1b71('0x13')]);}logger[_0x1b71('0x11')](_0x1b71('0xc'),_0x276dff,_0x5b5ba7[_0x1b71('0x11')][_0x1b71('0x13')]);return _0xa642e0(_0x5b5ba7[_0x1b71('0x11')][_0x1b71('0x13')]);}else{logger[_0x1b71('0x14')](_0x1b71('0xc'),_0x276dff,'request\x20sent');_0xa642e0(_0x5b5ba7[_0x1b71('0x15')][_0x1b71('0x13')]);}})[_0x1b71('0x16')](function(_0x409816){logger[_0x1b71('0x11')](_0x1b71('0xc'),_0x276dff,_0x409816);_0xece037(_0x409816);});});}
\ No newline at end of file
+var _0x39ee=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x3f39e5,_0x2bb924){var _0x65dc38=function(_0x1447d4){while(--_0x1447d4){_0x3f39e5['push'](_0x3f39e5['shift']());}};_0x65dc38(++_0x2bb924);}(_0x39ee,0x15d));var _0xe39e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x39ee[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe39e('0x0'));var util=require(_0xe39e('0x1'));var moment=require(_0xe39e('0x2'));var BPromise=require(_0xe39e('0x3'));var rs=require(_0xe39e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe39e('0x5'))['db'];var utils=require(_0xe39e('0x6'));var logger=require('../../config/logger')(_0xe39e('0x7'));var config=require(_0xe39e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe39e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb2964c,_0x3e549f,_0x4bdc6c){return new BPromise(function(_0x5abce7,_0x2ec224){return client[_0xe39e('0xa')](_0xb2964c,_0x4bdc6c)[_0xe39e('0xb')](function(_0x58cb80){logger[_0xe39e('0xc')](_0xe39e('0xd'),_0x3e549f,_0xe39e('0xe'));logger['debug'](_0xe39e('0xf'),_0x3e549f,_0xe39e('0xe'),JSON[_0xe39e('0x10')](_0x58cb80));if(_0x58cb80[_0xe39e('0x11')]){if(_0x58cb80[_0xe39e('0x11')][_0xe39e('0x12')]===0x1f4){logger['error'](_0xe39e('0xd'),_0x3e549f,_0x58cb80[_0xe39e('0x11')][_0xe39e('0x13')]);return _0x2ec224(_0x58cb80[_0xe39e('0x11')][_0xe39e('0x13')]);}logger[_0xe39e('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3e549f,_0x58cb80[_0xe39e('0x11')][_0xe39e('0x13')]);return _0x5abce7(_0x58cb80[_0xe39e('0x11')][_0xe39e('0x13')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x3e549f,_0xe39e('0xe'));_0x5abce7(_0x58cb80[_0xe39e('0x14')]['message']);}})[_0xe39e('0x15')](function(_0xff199c){logger[_0xe39e('0x11')](_0xe39e('0xd'),_0x3e549f,_0xff199c);_0x2ec224(_0xff199c);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index ca6b3c1..3bdc654 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 _0x19b7=['get','isAuthenticated','/:id/preview','/:id/run','run','/:id/query','query','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x19b7,0x157));var _0x719b=function(_0x47ca08,_0x3c48da){_0x47ca08=_0x47ca08-0x0;var _0x17636f=_0x19b7[_0x47ca08];return _0x17636f;};'use strict';var multer=require('multer');var util=require(_0x719b('0x0'));var path=require(_0x719b('0x1'));var timeout=require(_0x719b('0x2'));var express=require(_0x719b('0x3'));var router=express[_0x719b('0x4')]();var fs_extra=require(_0x719b('0x5'));var auth=require(_0x719b('0x6'));var interaction=require(_0x719b('0x7'));var config=require('../../config/environment');var controller=require(_0x719b('0x8'));router[_0x719b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x719b('0xa')](),controller['show']);router[_0x719b('0x9')](_0x719b('0xb'),auth[_0x719b('0xa')](),controller['preview']);router[_0x719b('0x9')](_0x719b('0xc'),auth[_0x719b('0xa')](),controller[_0x719b('0xd')]);router['get'](_0x719b('0xe'),auth[_0x719b('0xa')](),controller[_0x719b('0xf')]);router['post']('/',auth[_0x719b('0xa')](),controller[_0x719b('0x10')]);router['put'](_0x719b('0x11'),auth[_0x719b('0xa')](),controller[_0x719b('0x12')]);router[_0x719b('0x13')](_0x719b('0x11'),auth['isAuthenticated'](),controller[_0x719b('0x14')]);module[_0x719b('0x15')]=router;
\ No newline at end of file
+var _0x3d4b=['isAuthenticated','index','/:id','show','preview','/:id/run','/:id/query','query','post','create','put','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get'];(function(_0x54d7dc,_0x31b183){var _0xf4ef3b=function(_0x20a740){while(--_0x20a740){_0x54d7dc['push'](_0x54d7dc['shift']());}};_0xf4ef3b(++_0x31b183);}(_0x3d4b,0xf3));var _0xb3d4=function(_0x10e2e6,_0x17f93d){_0x10e2e6=_0x10e2e6-0x0;var _0x4931c6=_0x3d4b[_0x10e2e6];return _0x4931c6;};'use strict';var multer=require(_0xb3d4('0x0'));var util=require(_0xb3d4('0x1'));var path=require('path');var timeout=require(_0xb3d4('0x2'));var express=require(_0xb3d4('0x3'));var router=express[_0xb3d4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb3d4('0x5'));var interaction=require(_0xb3d4('0x6'));var config=require(_0xb3d4('0x7'));var controller=require(_0xb3d4('0x8'));router[_0xb3d4('0x9')]('/',auth[_0xb3d4('0xa')](),controller[_0xb3d4('0xb')]);router[_0xb3d4('0x9')](_0xb3d4('0xc'),auth[_0xb3d4('0xa')](),controller[_0xb3d4('0xd')]);router[_0xb3d4('0x9')]('/:id/preview',auth['isAuthenticated'](),controller[_0xb3d4('0xe')]);router[_0xb3d4('0x9')](_0xb3d4('0xf'),auth[_0xb3d4('0xa')](),controller['run']);router[_0xb3d4('0x9')](_0xb3d4('0x10'),auth[_0xb3d4('0xa')](),controller[_0xb3d4('0x11')]);router[_0xb3d4('0x12')]('/',auth[_0xb3d4('0xa')](),controller[_0xb3d4('0x13')]);router[_0xb3d4('0x14')](_0xb3d4('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xb3d4('0x15')](_0xb3d4('0xc'),auth[_0xb3d4('0xa')](),controller['destroy']);module[_0xb3d4('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index a70434e..e9739d8 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 _0x96ad=['moment','exports','STRING','ENUM','pdf','xlsx','csv','DATE','Loading','manual','scheduled','INTEGER'];(function(_0x27e025,_0x2264f3){var _0x563bde=function(_0x22cd55){while(--_0x22cd55){_0x27e025['push'](_0x27e025['shift']());}};_0x563bde(++_0x2264f3);}(_0x96ad,0xf0));var _0xd96a=function(_0x28a5ad,_0x520afa){_0x28a5ad=_0x28a5ad-0x0;var _0x176b8a=_0x96ad[_0x28a5ad];return _0x176b8a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd96a('0x0'));module[_0xd96a('0x1')]={'name':{'type':Sequelize[_0xd96a('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xd96a('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xd96a('0x3')]('csv',_0xd96a('0x4'),_0xd96a('0x5')),'allowNull':![],'defaultValue':_0xd96a('0x6')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xd96a('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0xd96a('0x8')},'type':{'type':Sequelize[_0xd96a('0x3')](_0xd96a('0x9'),_0xd96a('0xa')),'allowNull':![],'defaultValue':_0xd96a('0x9')},'reportId':{'type':Sequelize[_0xd96a('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xd96a('0x2')]}};
\ No newline at end of file
+var _0xa5d8=['INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','scheduled'];(function(_0x515283,_0x813dea){var _0x38f836=function(_0x40c8f4){while(--_0x40c8f4){_0x515283['push'](_0x515283['shift']());}};_0x38f836(++_0x813dea);}(_0xa5d8,0x1af));var _0x8a5d=function(_0x46c80e,_0x204394){_0x46c80e=_0x46c80e-0x0;var _0x36be59=_0xa5d8[_0x46c80e];return _0x36be59;};'use strict';var Sequelize=require(_0x8a5d('0x0'));var moment=require(_0x8a5d('0x1'));module[_0x8a5d('0x2')]={'name':{'type':Sequelize[_0x8a5d('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x8a5d('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x8a5d('0x4')](_0x8a5d('0x5'),_0x8a5d('0x6'),_0x8a5d('0x7')),'allowNull':![],'defaultValue':_0x8a5d('0x5')},'savename':{'type':Sequelize[_0x8a5d('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8a5d('0x8')]},'endDate':{'type':Sequelize[_0x8a5d('0x8')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x8a5d('0x9')},'type':{'type':Sequelize[_0x8a5d('0x4')]('manual',_0x8a5d('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x8a5d('0xb')](0xb)[_0x8a5d('0xc')]},'reportType':{'type':Sequelize[_0x8a5d('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 2572f5f..8459b8b 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 _0x4f68=['savename','output','existsSync','root','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','%s.%s','toLowerCase','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','error','name','index','map','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','AnalyticExtractedReport','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','params','download'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x4f68,0x11e));var _0x84f6=function(_0x240449,_0x512fd9){_0x240449=_0x240449-0x0;var _0x1ac45e=_0x4f68[_0x240449];return _0x1ac45e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x84f6('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x84f6('0x1'));var moment=require('moment');var BPromise=require(_0x84f6('0x2'));var Mustache=require(_0x84f6('0x3'));var util=require('util');var path=require(_0x84f6('0x4'));var sox=require(_0x84f6('0x5'));var csv=require(_0x84f6('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x84f6('0x7'));var _=require(_0x84f6('0x8'));var squel=require(_0x84f6('0x9'));var crypto=require(_0x84f6('0xa'));var jsforce=require(_0x84f6('0xb'));var deskjs=require(_0x84f6('0xc'));var toCsv=require(_0x84f6('0x6'));var querystring=require(_0x84f6('0xd'));var Papa=require(_0x84f6('0xe'));var Redis=require('ioredis');var authService=require(_0x84f6('0xf'));var qs=require(_0x84f6('0x10'));var as=require(_0x84f6('0x11'));var hardwareService=require(_0x84f6('0x12'));var logger=require(_0x84f6('0x13'))(_0x84f6('0x14'));var utils=require(_0x84f6('0x15'));var config=require(_0x84f6('0x16'));var licenseUtil=require(_0x84f6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b4d37,_0x418809){_0x418809=_0x418809||0xcc;return function(_0xbcaad7){if(_0xbcaad7){return _0x1b4d37[_0x84f6('0x18')](_0x418809);}return _0x1b4d37[_0x84f6('0x19')](_0x418809)[_0x84f6('0x1a')]();};}function respondWithResult(_0x39699d,_0x4a5733){_0x4a5733=_0x4a5733||0xc8;return function(_0x4b349c){if(_0x4b349c){return _0x39699d['status'](_0x4a5733)[_0x84f6('0x1b')](_0x4b349c);}};}function respondWithFilteredResult(_0x578c81,_0x54adbb){return function(_0x139374){if(_0x139374){var _0x288066=typeof _0x54adbb[_0x84f6('0x1c')]==='undefined'&&typeof _0x54adbb[_0x84f6('0x1d')]==='undefined';var _0x32115f=_0x139374['count'];var _0x15c6bb=_0x288066?0x0:_0x54adbb['offset'];var _0x3d1cec=_0x288066?_0x139374[_0x84f6('0x1e')]:_0x54adbb[_0x84f6('0x1c')]+_0x54adbb[_0x84f6('0x1d')];var _0x1fd074;if(_0x3d1cec>=_0x32115f){_0x3d1cec=_0x32115f;_0x1fd074=0xc8;}else{_0x1fd074=0xce;}_0x578c81[_0x84f6('0x19')](_0x1fd074);return _0x578c81[_0x84f6('0x1f')](_0x84f6('0x20'),_0x15c6bb+'-'+_0x3d1cec+'/'+_0x32115f)[_0x84f6('0x1b')](_0x139374);}return null;};}function patchUpdates(_0x37abb8){return function(_0x224b15){try{jsonpatch[_0x84f6('0x21')](_0x224b15,_0x37abb8,!![]);}catch(_0x18316e){return BPromise[_0x84f6('0x22')](_0x18316e);}return _0x224b15['save']();};}function saveUpdates(_0x176abe,_0x4c1f33){return function(_0x38b7eb){if(_0x38b7eb){return _0x38b7eb[_0x84f6('0x23')](_0x176abe)[_0x84f6('0x24')](function(_0x392bf3){return _0x392bf3;});}return null;};}function removeEntity(_0x24c011,_0x2d7733){return function(_0x3aff59){if(_0x3aff59){return _0x3aff59[_0x84f6('0x25')]()['then'](function(){var _0x57cd1a=_0x3aff59[_0x84f6('0x26')]({'plain':!![]});var _0x1f07c3='ExtractedReports';return db['UserProfileResource'][_0x84f6('0x25')]({'where':{'type':_0x1f07c3,'resourceId':_0x57cd1a['id']}})[_0x84f6('0x24')](function(){return _0x3aff59;});})[_0x84f6('0x24')](function(){_0x24c011['status'](0xcc)[_0x84f6('0x1a')]();});}};}function handleEntityNotFound(_0x3c7162,_0x43f65f){return function(_0x45d494){if(!_0x45d494){_0x3c7162[_0x84f6('0x18')](0x194);}return _0x45d494;};}function handleError(_0x4dfcbe,_0x31f460){_0x31f460=_0x31f460||0x1f4;return function(_0x5ce0b2){logger[_0x84f6('0x27')](_0x5ce0b2['stack']);if(_0x5ce0b2[_0x84f6('0x28')]){delete _0x5ce0b2[_0x84f6('0x28')];}_0x4dfcbe[_0x84f6('0x19')](_0x31f460)['send'](_0x5ce0b2);};}exports[_0x84f6('0x29')]=function(_0x2041a8,_0x52bc59){var _0x1e9c81={},_0x587386={},_0x229dd7={'count':0x0,'rows':[]};var _0x3ece71=_[_0x84f6('0x2a')](db['AnalyticExtractedReport']['rawAttributes'],function(_0x27ed1d){return{'name':_0x27ed1d[_0x84f6('0x2b')],'type':_0x27ed1d['type']['key']};});_0x587386[_0x84f6('0x2c')]=_[_0x84f6('0x2a')](_0x3ece71,_0x84f6('0x28'));_0x587386[_0x84f6('0x2d')]=_[_0x84f6('0x2e')](_0x2041a8[_0x84f6('0x2d')]);_0x587386[_0x84f6('0x2f')]=_[_0x84f6('0x30')](_0x587386[_0x84f6('0x2c')],_0x587386[_0x84f6('0x2d')]);_0x1e9c81[_0x84f6('0x31')]=_[_0x84f6('0x30')](_0x587386[_0x84f6('0x2c')],qs[_0x84f6('0x32')](_0x2041a8[_0x84f6('0x2d')]['fields']));_0x1e9c81[_0x84f6('0x31')]=_0x1e9c81['attributes'][_0x84f6('0x33')]?_0x1e9c81[_0x84f6('0x31')]:_0x587386['model'];if(!_0x2041a8[_0x84f6('0x2d')][_0x84f6('0x34')](_0x84f6('0x35'))){_0x1e9c81[_0x84f6('0x1d')]=qs[_0x84f6('0x1d')](_0x2041a8[_0x84f6('0x2d')]['limit']);_0x1e9c81['offset']=qs['offset'](_0x2041a8[_0x84f6('0x2d')]['offset']);}_0x1e9c81[_0x84f6('0x36')]=qs[_0x84f6('0x37')](_0x2041a8[_0x84f6('0x2d')][_0x84f6('0x37')]);_0x1e9c81[_0x84f6('0x38')]=qs['filters'](_[_0x84f6('0x39')](_0x2041a8[_0x84f6('0x2d')],_0x587386['filters']),_0x3ece71);if(_0x2041a8['query'][_0x84f6('0x3a')]){_0x1e9c81[_0x84f6('0x38')]=_['merge'](_0x1e9c81[_0x84f6('0x38')],{'$or':_[_0x84f6('0x2a')](_0x3ece71,function(_0x8e5d56){if(_0x8e5d56[_0x84f6('0x3b')]!==_0x84f6('0x3c')){var _0x1757c8={};_0x1757c8[_0x8e5d56[_0x84f6('0x28')]]={'$like':'%'+_0x2041a8[_0x84f6('0x2d')]['filter']+'%'};return _0x1757c8;}})});}_0x1e9c81=_[_0x84f6('0x3d')]({},_0x1e9c81,_0x2041a8['options']);var _0x267eb7={'where':_0x1e9c81['where']};return db[_0x84f6('0x3e')][_0x84f6('0x1e')](_0x267eb7)['then'](function(_0x2b964f){_0x229dd7['count']=_0x2b964f;if(_0x2041a8['query'][_0x84f6('0x3f')]){_0x1e9c81[_0x84f6('0x40')]=[{'all':!![]}];}return db[_0x84f6('0x3e')][_0x84f6('0x41')](_0x1e9c81);})[_0x84f6('0x24')](function(_0x168b73){_0x229dd7[_0x84f6('0x42')]=_0x168b73;return _0x229dd7;})[_0x84f6('0x24')](respondWithFilteredResult(_0x52bc59,_0x1e9c81))[_0x84f6('0x43')](handleError(_0x52bc59,null));};exports[_0x84f6('0x44')]=function(_0x27a695,_0x42e78a){var _0xed11a4={'raw':!![],'where':{'id':_0x27a695['params']['id']}},_0x5df5b6={};_0x5df5b6[_0x84f6('0x2c')]=_[_0x84f6('0x2e')](db['AnalyticExtractedReport'][_0x84f6('0x45')]);_0x5df5b6[_0x84f6('0x2d')]=_[_0x84f6('0x2e')](_0x27a695[_0x84f6('0x2d')]);_0x5df5b6['filters']=_['intersection'](_0x5df5b6[_0x84f6('0x2c')],_0x5df5b6['query']);_0xed11a4[_0x84f6('0x31')]=_[_0x84f6('0x30')](_0x5df5b6[_0x84f6('0x2c')],qs[_0x84f6('0x32')](_0x27a695[_0x84f6('0x2d')]['fields']));_0xed11a4[_0x84f6('0x31')]=_0xed11a4[_0x84f6('0x31')]['length']?_0xed11a4['attributes']:_0x5df5b6['model'];if(_0x27a695[_0x84f6('0x2d')][_0x84f6('0x3f')]){_0xed11a4[_0x84f6('0x40')]=[{'all':!![]}];}_0xed11a4=_[_0x84f6('0x3d')]({},_0xed11a4,_0x27a695['options']);return db[_0x84f6('0x3e')][_0x84f6('0x46')](_0xed11a4)[_0x84f6('0x24')](handleEntityNotFound(_0x42e78a,null))[_0x84f6('0x24')](respondWithResult(_0x42e78a,null))[_0x84f6('0x43')](handleError(_0x42e78a,null));};exports['create']=function(_0x4ae3a0,_0x239dc4){return db[_0x84f6('0x3e')][_0x84f6('0x47')](_0x4ae3a0[_0x84f6('0x48')],{})[_0x84f6('0x24')](function(_0x490e59){var _0x462074=_0x4ae3a0[_0x84f6('0x49')][_0x84f6('0x26')]({'plain':!![]});if(!_0x462074)throw new Error(_0x84f6('0x4a'));if(_0x462074[_0x84f6('0x4b')]===_0x84f6('0x49')){var _0x4016f1=_0x490e59['get']({'plain':!![]});var _0x3f0a2c='ExtractedReports';return db[_0x84f6('0x4c')][_0x84f6('0x46')]({'where':{'name':_0x3f0a2c,'userProfileId':_0x462074[_0x84f6('0x4d')]},'raw':!![]})[_0x84f6('0x24')](function(_0xdca0a8){if(_0xdca0a8&&_0xdca0a8[_0x84f6('0x4e')]===0x0){return db[_0x84f6('0x4f')][_0x84f6('0x47')]({'name':_0x4016f1[_0x84f6('0x28')],'resourceId':_0x4016f1['id'],'type':_0xdca0a8[_0x84f6('0x28')],'sectionId':_0xdca0a8['id']},{})[_0x84f6('0x24')](function(){return _0x490e59;});}else{return _0x490e59;}})['catch'](function(_0xb3b3a8){logger[_0x84f6('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb3b3a8);throw _0xb3b3a8;});}return _0x490e59;})[_0x84f6('0x24')](respondWithResult(_0x239dc4,0xc9))[_0x84f6('0x43')](handleError(_0x239dc4,null));};exports['update']=function(_0x592e7a,_0x30a83b){if(_0x592e7a['body']['id']){delete _0x592e7a[_0x84f6('0x48')]['id'];}return db[_0x84f6('0x3e')][_0x84f6('0x46')]({'where':{'id':_0x592e7a[_0x84f6('0x50')]['id']}})[_0x84f6('0x24')](handleEntityNotFound(_0x30a83b,null))[_0x84f6('0x24')](saveUpdates(_0x592e7a['body'],null))[_0x84f6('0x24')](respondWithResult(_0x30a83b,null))['catch'](handleError(_0x30a83b,null));};exports[_0x84f6('0x25')]=function(_0x1b189e,_0x5ec9c6){return db['AnalyticExtractedReport'][_0x84f6('0x46')]({'where':{'id':_0x1b189e['params']['id']}})[_0x84f6('0x24')](handleEntityNotFound(_0x5ec9c6,null))[_0x84f6('0x24')](removeEntity(_0x5ec9c6,null))['catch'](handleError(_0x5ec9c6,null));};exports[_0x84f6('0x51')]=function(_0x10b357,_0x1e1e61,_0xd81e42){return db[_0x84f6('0x3e')][_0x84f6('0x46')]({'where':{'id':_0x10b357[_0x84f6('0x50')]['id']},'attributes':[_0x84f6('0x28'),'basename',_0x84f6('0x52'),_0x84f6('0x53')],'raw':!![]})[_0x84f6('0x24')](handleEntityNotFound(_0x1e1e61,null))[_0x84f6('0x24')](function(_0x551a43){if(_0x551a43){if(!fs[_0x84f6('0x54')](path['join'](config[_0x84f6('0x55')],'server/files/reports',_0x551a43[_0x84f6('0x52')]))){throw new db[(_0x84f6('0x56'))]['ValidationError'](_0x84f6('0x57'));}if(_0x10b357[_0x84f6('0x2d')][_0x84f6('0x58')]){return _0x1e1e61[_0x84f6('0x18')](0xc8);}return _0x1e1e61[_0x84f6('0x51')](path['join'](config[_0x84f6('0x55')],_0x84f6('0x59'),_0x551a43[_0x84f6('0x52')]),util['format'](_0x84f6('0x5a'),_0x551a43['basename']||_0x551a43[_0x84f6('0x28')],_0x551a43['output'][_0x84f6('0x5b')]()));}})[_0x84f6('0x43')](handleError(_0x1e1e61,null));};
\ No newline at end of file
+var _0xab41=['Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','update','then','get','ExtractedReports','UserProfileResource','destroy','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError'];(function(_0x48a5ac,_0x1a9d81){var _0x1f0644=function(_0x26b220){while(--_0x26b220){_0x48a5ac['push'](_0x48a5ac['shift']());}};_0x1f0644(++_0x1a9d81);}(_0xab41,0x1df));var _0x1ab4=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xab41[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0x1ab4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1ab4('0x1'));var jsonpatch=require(_0x1ab4('0x2'));var rp=require('request-promise');var moment=require(_0x1ab4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1ab4('0x4'));var util=require(_0x1ab4('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x1ab4('0x6'));var ejs=require(_0x1ab4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1ab4('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1ab4('0x9'));var deskjs=require(_0x1ab4('0xa'));var toCsv=require(_0x1ab4('0x6'));var querystring=require(_0x1ab4('0xb'));var Papa=require(_0x1ab4('0xc'));var Redis=require(_0x1ab4('0xd'));var authService=require(_0x1ab4('0xe'));var qs=require(_0x1ab4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ab4('0x10'));var logger=require(_0x1ab4('0x11'))(_0x1ab4('0x12'));var utils=require(_0x1ab4('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x1ab4('0x14'));var db=require(_0x1ab4('0x15'))['db'];function respondWithStatusCode(_0x3b100e,_0x47dc5e){_0x47dc5e=_0x47dc5e||0xcc;return function(_0x453a43){if(_0x453a43){return _0x3b100e[_0x1ab4('0x16')](_0x47dc5e);}return _0x3b100e['status'](_0x47dc5e)[_0x1ab4('0x17')]();};}function respondWithResult(_0x12933b,_0x3af44c){_0x3af44c=_0x3af44c||0xc8;return function(_0x512aa6){if(_0x512aa6){return _0x12933b[_0x1ab4('0x18')](_0x3af44c)['json'](_0x512aa6);}};}function respondWithFilteredResult(_0x52fbae,_0x327966){return function(_0x241670){if(_0x241670){var _0x316f55=typeof _0x327966['offset']===_0x1ab4('0x19')&&typeof _0x327966[_0x1ab4('0x1a')]===_0x1ab4('0x19');var _0x2eabeb=_0x241670[_0x1ab4('0x1b')];var _0x598efb=_0x316f55?0x0:_0x327966[_0x1ab4('0x1c')];var _0x484ae1=_0x316f55?_0x241670[_0x1ab4('0x1b')]:_0x327966[_0x1ab4('0x1c')]+_0x327966[_0x1ab4('0x1a')];var _0x23e597;if(_0x484ae1>=_0x2eabeb){_0x484ae1=_0x2eabeb;_0x23e597=0xc8;}else{_0x23e597=0xce;}_0x52fbae[_0x1ab4('0x18')](_0x23e597);return _0x52fbae[_0x1ab4('0x1d')](_0x1ab4('0x1e'),_0x598efb+'-'+_0x484ae1+'/'+_0x2eabeb)[_0x1ab4('0x1f')](_0x241670);}return null;};}function patchUpdates(_0x341df7){return function(_0x4be880){try{jsonpatch[_0x1ab4('0x20')](_0x4be880,_0x341df7,!![]);}catch(_0x133ceb){return BPromise['reject'](_0x133ceb);}return _0x4be880['save']();};}function saveUpdates(_0xd23721,_0x11cfad){return function(_0x2be570){if(_0x2be570){return _0x2be570[_0x1ab4('0x21')](_0xd23721)[_0x1ab4('0x22')](function(_0x5d0f85){return _0x5d0f85;});}return null;};}function removeEntity(_0x4f9492,_0x1e13c4){return function(_0x2bc925){if(_0x2bc925){return _0x2bc925['destroy']()[_0x1ab4('0x22')](function(){var _0x39b76b=_0x2bc925[_0x1ab4('0x23')]({'plain':!![]});var _0x4b6252=_0x1ab4('0x24');return db[_0x1ab4('0x25')][_0x1ab4('0x26')]({'where':{'type':_0x4b6252,'resourceId':_0x39b76b['id']}})[_0x1ab4('0x22')](function(){return _0x2bc925;});})[_0x1ab4('0x22')](function(){_0x4f9492['status'](0xcc)[_0x1ab4('0x17')]();});}};}function handleEntityNotFound(_0x1669b7,_0x1d9b6b){return function(_0x3f947d){if(!_0x3f947d){_0x1669b7[_0x1ab4('0x16')](0x194);}return _0x3f947d;};}function handleError(_0x968e87,_0x2ce82e){_0x2ce82e=_0x2ce82e||0x1f4;return function(_0x1a8e7e){logger['error'](_0x1a8e7e['stack']);if(_0x1a8e7e[_0x1ab4('0x27')]){delete _0x1a8e7e[_0x1ab4('0x27')];}_0x968e87['status'](_0x2ce82e)[_0x1ab4('0x28')](_0x1a8e7e);};}exports[_0x1ab4('0x29')]=function(_0x312d33,_0x3ad687){var _0x4c589b={},_0x3f0394={},_0x53db4b={'count':0x0,'rows':[]};var _0x7299f1=_[_0x1ab4('0x2a')](db[_0x1ab4('0x2b')][_0x1ab4('0x2c')],function(_0x206957){return{'name':_0x206957[_0x1ab4('0x2d')],'type':_0x206957[_0x1ab4('0x2e')][_0x1ab4('0x2f')]};});_0x3f0394['model']=_[_0x1ab4('0x2a')](_0x7299f1,_0x1ab4('0x27'));_0x3f0394[_0x1ab4('0x30')]=_[_0x1ab4('0x31')](_0x312d33['query']);_0x3f0394['filters']=_[_0x1ab4('0x32')](_0x3f0394['model'],_0x3f0394['query']);_0x4c589b['attributes']=_[_0x1ab4('0x32')](_0x3f0394[_0x1ab4('0x33')],qs[_0x1ab4('0x34')](_0x312d33[_0x1ab4('0x30')][_0x1ab4('0x34')]));_0x4c589b[_0x1ab4('0x35')]=_0x4c589b[_0x1ab4('0x35')][_0x1ab4('0x36')]?_0x4c589b[_0x1ab4('0x35')]:_0x3f0394['model'];if(!_0x312d33[_0x1ab4('0x30')][_0x1ab4('0x37')](_0x1ab4('0x38'))){_0x4c589b[_0x1ab4('0x1a')]=qs[_0x1ab4('0x1a')](_0x312d33['query'][_0x1ab4('0x1a')]);_0x4c589b[_0x1ab4('0x1c')]=qs[_0x1ab4('0x1c')](_0x312d33['query'][_0x1ab4('0x1c')]);}_0x4c589b['order']=qs['sort'](_0x312d33[_0x1ab4('0x30')]['sort']);_0x4c589b[_0x1ab4('0x39')]=qs[_0x1ab4('0x3a')](_[_0x1ab4('0x3b')](_0x312d33['query'],_0x3f0394['filters']),_0x7299f1);if(_0x312d33['query'][_0x1ab4('0x3c')]){_0x4c589b[_0x1ab4('0x39')]=_[_0x1ab4('0x3d')](_0x4c589b[_0x1ab4('0x39')],{'$or':_[_0x1ab4('0x2a')](_0x7299f1,function(_0x3cbc71){if(_0x3cbc71[_0x1ab4('0x2e')]!==_0x1ab4('0x3e')){var _0x22d00f={};_0x22d00f[_0x3cbc71[_0x1ab4('0x27')]]={'$like':'%'+_0x312d33[_0x1ab4('0x30')][_0x1ab4('0x3c')]+'%'};return _0x22d00f;}})});}_0x4c589b=_[_0x1ab4('0x3d')]({},_0x4c589b,_0x312d33[_0x1ab4('0x3f')]);var _0x518f75={'where':_0x4c589b[_0x1ab4('0x39')]};return db[_0x1ab4('0x2b')][_0x1ab4('0x1b')](_0x518f75)[_0x1ab4('0x22')](function(_0x3f164a){_0x53db4b['count']=_0x3f164a;if(_0x312d33[_0x1ab4('0x30')]['includeAll']){_0x4c589b[_0x1ab4('0x40')]=[{'all':!![]}];}return db[_0x1ab4('0x2b')][_0x1ab4('0x41')](_0x4c589b);})[_0x1ab4('0x22')](function(_0x3c05b7){_0x53db4b[_0x1ab4('0x42')]=_0x3c05b7;return _0x53db4b;})[_0x1ab4('0x22')](respondWithFilteredResult(_0x3ad687,_0x4c589b))[_0x1ab4('0x43')](handleError(_0x3ad687,null));};exports[_0x1ab4('0x44')]=function(_0x4fe011,_0xbb2c37){var _0x388176={'raw':!![],'where':{'id':_0x4fe011[_0x1ab4('0x45')]['id']}},_0x611050={};_0x611050[_0x1ab4('0x33')]=_[_0x1ab4('0x31')](db[_0x1ab4('0x2b')][_0x1ab4('0x2c')]);_0x611050[_0x1ab4('0x30')]=_['keys'](_0x4fe011['query']);_0x611050[_0x1ab4('0x3a')]=_['intersection'](_0x611050['model'],_0x611050[_0x1ab4('0x30')]);_0x388176['attributes']=_['intersection'](_0x611050[_0x1ab4('0x33')],qs[_0x1ab4('0x34')](_0x4fe011['query'][_0x1ab4('0x34')]));_0x388176[_0x1ab4('0x35')]=_0x388176[_0x1ab4('0x35')][_0x1ab4('0x36')]?_0x388176[_0x1ab4('0x35')]:_0x611050['model'];if(_0x4fe011[_0x1ab4('0x30')][_0x1ab4('0x46')]){_0x388176['include']=[{'all':!![]}];}_0x388176=_[_0x1ab4('0x3d')]({},_0x388176,_0x4fe011[_0x1ab4('0x3f')]);return db[_0x1ab4('0x2b')]['find'](_0x388176)['then'](handleEntityNotFound(_0xbb2c37,null))['then'](respondWithResult(_0xbb2c37,null))[_0x1ab4('0x43')](handleError(_0xbb2c37,null));};exports['create']=function(_0xc7b4b5,_0x5f92d8){return db[_0x1ab4('0x2b')][_0x1ab4('0x47')](_0xc7b4b5[_0x1ab4('0x48')],{})[_0x1ab4('0x22')](function(_0x18e705){var _0xa94be5=_0xc7b4b5[_0x1ab4('0x49')][_0x1ab4('0x23')]({'plain':!![]});if(!_0xa94be5)throw new Error(_0x1ab4('0x4a'));if(_0xa94be5['role']===_0x1ab4('0x49')){var _0x5b6680=_0x18e705['get']({'plain':!![]});var _0x3f7c79=_0x1ab4('0x24');return db[_0x1ab4('0x4b')][_0x1ab4('0x4c')]({'where':{'name':_0x3f7c79,'userProfileId':_0xa94be5[_0x1ab4('0x4d')]},'raw':!![]})['then'](function(_0x38e384){if(_0x38e384&&_0x38e384[_0x1ab4('0x4e')]===0x0){return db[_0x1ab4('0x25')][_0x1ab4('0x47')]({'name':_0x5b6680[_0x1ab4('0x27')],'resourceId':_0x5b6680['id'],'type':_0x38e384[_0x1ab4('0x27')],'sectionId':_0x38e384['id']},{})['then'](function(){return _0x18e705;});}else{return _0x18e705;}})[_0x1ab4('0x43')](function(_0x1bb795){logger[_0x1ab4('0x4f')](_0x1ab4('0x50'),_0x1bb795);throw _0x1bb795;});}return _0x18e705;})[_0x1ab4('0x22')](respondWithResult(_0x5f92d8,0xc9))['catch'](handleError(_0x5f92d8,null));};exports['update']=function(_0x298bf3,_0x540777){if(_0x298bf3['body']['id']){delete _0x298bf3[_0x1ab4('0x48')]['id'];}return db['AnalyticExtractedReport'][_0x1ab4('0x4c')]({'where':{'id':_0x298bf3['params']['id']}})[_0x1ab4('0x22')](handleEntityNotFound(_0x540777,null))[_0x1ab4('0x22')](saveUpdates(_0x298bf3[_0x1ab4('0x48')],null))[_0x1ab4('0x22')](respondWithResult(_0x540777,null))['catch'](handleError(_0x540777,null));};exports['destroy']=function(_0x4caa74,_0x1eac21){return db['AnalyticExtractedReport'][_0x1ab4('0x4c')]({'where':{'id':_0x4caa74[_0x1ab4('0x45')]['id']}})['then'](handleEntityNotFound(_0x1eac21,null))['then'](removeEntity(_0x1eac21,null))['catch'](handleError(_0x1eac21,null));};exports[_0x1ab4('0x51')]=function(_0x9626f6,_0x15c204,_0x52a929){return db[_0x1ab4('0x2b')][_0x1ab4('0x4c')]({'where':{'id':_0x9626f6[_0x1ab4('0x45')]['id']},'attributes':['name',_0x1ab4('0x52'),_0x1ab4('0x53'),_0x1ab4('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x15c204,null))[_0x1ab4('0x22')](function(_0x5507fe){if(_0x5507fe){if(!fs[_0x1ab4('0x55')](path[_0x1ab4('0x56')](config[_0x1ab4('0x57')],_0x1ab4('0x58'),_0x5507fe['savename']))){throw new db[(_0x1ab4('0x59'))][(_0x1ab4('0x5a'))](_0x1ab4('0x5b'));}if(_0x9626f6[_0x1ab4('0x30')][_0x1ab4('0x5c')]){return _0x15c204[_0x1ab4('0x16')](0xc8);}return _0x15c204[_0x1ab4('0x51')](path[_0x1ab4('0x56')](config['root'],'server/files/reports',_0x5507fe[_0x1ab4('0x53')]),util['format'](_0x1ab4('0x5d'),_0x5507fe[_0x1ab4('0x52')]||_0x5507fe['name'],_0x5507fe[_0x1ab4('0x54')][_0x1ab4('0x5e')]()));}})['catch'](handleError(_0x15c204,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 0351209..58d0fb9 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 _0x0c6e=['path','../../config/environment','exports','AnalyticExtractedReport','analytics_extracted_reports','../../config/logger','bluebird'];(function(_0x78cdea,_0x4d7fdc){var _0x4bf7da=function(_0x138a32){while(--_0x138a32){_0x78cdea['push'](_0x78cdea['shift']());}};_0x4bf7da(++_0x4d7fdc);}(_0x0c6e,0x116));var _0xe0c6=function(_0xf6cba6,_0x1d5375){_0xf6cba6=_0xf6cba6-0x0;var _0x5315c8=_0x0c6e[_0xf6cba6];return _0x5315c8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe0c6('0x0'))('api');var moment=require('moment');var BPromise=require(_0xe0c6('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe0c6('0x2'));var rimraf=require('rimraf');var config=require(_0xe0c6('0x3'));var attributes=require('./analyticExtractedReport.attributes');module[_0xe0c6('0x4')]=function(_0x574c2b,_0x36dda1){return _0x574c2b['define'](_0xe0c6('0x5'),attributes,{'tableName':_0xe0c6('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcabd=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport'];(function(_0x9f1286,_0x4b66e0){var _0x40b2ac=function(_0x3512ae){while(--_0x3512ae){_0x9f1286['push'](_0x9f1286['shift']());}};_0x40b2ac(++_0x4b66e0);}(_0xcabd,0xb4));var _0xdcab=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xcabd[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0xdcab('0x0'));var util=require(_0xdcab('0x1'));var logger=require(_0xdcab('0x2'))('api');var moment=require(_0xdcab('0x3'));var BPromise=require(_0xdcab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdcab('0x5'));var rimraf=require(_0xdcab('0x6'));var config=require(_0xdcab('0x7'));var attributes=require(_0xdcab('0x8'));module[_0xdcab('0x9')]=function(_0x1fdf7c,_0x2c0bdb){return _0x1fdf7c[_0xdcab('0xa')](_0xdcab('0xb'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 27ad509..2ef048f 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 _0x889d=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x346f62,_0x5079bc){var _0x1783a8=function(_0x3dca5e){while(--_0x3dca5e){_0x346f62['push'](_0x346f62['shift']());}};_0x1783a8(++_0x5079bc);}(_0x889d,0x64));var _0xd889=function(_0x181a7b,_0x45b715){_0x181a7b=_0x181a7b-0x0;var _0x2344d4=_0x889d[_0x181a7b];return _0x2344d4;};'use strict';var _=require(_0xd889('0x0'));var util=require(_0xd889('0x1'));var moment=require(_0xd889('0x2'));var BPromise=require(_0xd889('0x3'));var rs=require(_0xd889('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd889('0x5'))['db'];var utils=require(_0xd889('0x6'));var logger=require('../../config/logger')(_0xd889('0x7'));var config=require(_0xd889('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd889('0x9')][_0xd889('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48d516,_0x296269,_0x5bb6f9){return new BPromise(function(_0x494685,_0x37391a){return client[_0xd889('0xb')](_0x48d516,_0x5bb6f9)[_0xd889('0xc')](function(_0x4671a0){logger['info'](_0xd889('0xd'),_0x296269,'request\x20sent');logger['debug'](_0xd889('0xe'),_0x296269,_0xd889('0xf'),JSON['stringify'](_0x4671a0));if(_0x4671a0[_0xd889('0x10')]){if(_0x4671a0[_0xd889('0x10')]['code']===0x1f4){logger[_0xd889('0x10')](_0xd889('0xd'),_0x296269,_0x4671a0['error'][_0xd889('0x11')]);return _0x37391a(_0x4671a0[_0xd889('0x10')][_0xd889('0x11')]);}logger['error'](_0xd889('0xd'),_0x296269,_0x4671a0['error'][_0xd889('0x11')]);return _0x494685(_0x4671a0[_0xd889('0x10')][_0xd889('0x11')]);}else{logger[_0xd889('0x12')](_0xd889('0xd'),_0x296269,'request\x20sent');_0x494685(_0x4671a0[_0xd889('0x13')][_0xd889('0x11')]);}})[_0xd889('0x14')](function(_0xb6a4de){logger[_0xd889('0x10')](_0xd889('0xd'),_0x296269,_0xb6a4de);_0x37391a(_0xb6a4de);});});}
\ No newline at end of file
+var _0x077e=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','message','AnalyticExtractedReport,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x58220a,_0x3545b5){var _0x30e125=function(_0x4aafd){while(--_0x4aafd){_0x58220a['push'](_0x58220a['shift']());}};_0x30e125(++_0x3545b5);}(_0x077e,0x1f4));var _0xe077=function(_0x5e2dd4,_0x2f2dc0){_0x5e2dd4=_0x5e2dd4-0x0;var _0x396f12=_0x077e[_0x5e2dd4];return _0x396f12;};'use strict';var _=require(_0xe077('0x0'));var util=require(_0xe077('0x1'));var moment=require(_0xe077('0x2'));var BPromise=require('bluebird');var rs=require(_0xe077('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe077('0x4'))['db'];var utils=require(_0xe077('0x5'));var logger=require(_0xe077('0x6'))(_0xe077('0x7'));var config=require(_0xe077('0x8'));var jayson=require(_0xe077('0x9'));var client=jayson[_0xe077('0xa')][_0xe077('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c9194,_0x427b23,_0x52e717){return new BPromise(function(_0x49306d,_0x387597){return client[_0xe077('0xc')](_0x1c9194,_0x52e717)[_0xe077('0xd')](function(_0x5ac7e8){logger[_0xe077('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x427b23,_0xe077('0xf'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x427b23,_0xe077('0xf'),JSON[_0xe077('0x10')](_0x5ac7e8));if(_0x5ac7e8[_0xe077('0x11')]){if(_0x5ac7e8[_0xe077('0x11')]['code']===0x1f4){logger[_0xe077('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x427b23,_0x5ac7e8[_0xe077('0x11')][_0xe077('0x12')]);return _0x387597(_0x5ac7e8[_0xe077('0x11')]['message']);}logger['error'](_0xe077('0x13'),_0x427b23,_0x5ac7e8[_0xe077('0x11')][_0xe077('0x12')]);return _0x49306d(_0x5ac7e8[_0xe077('0x11')][_0xe077('0x12')]);}else{logger[_0xe077('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x427b23,_0xe077('0xf'));_0x49306d(_0x5ac7e8[_0xe077('0x14')][_0xe077('0x12')]);}})[_0xe077('0x15')](function(_0x3e57e4){logger[_0xe077('0x11')](_0xe077('0x13'),_0x427b23,_0x3e57e4);_0x387597(_0x3e57e4);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index cab2f5a..aa49fd5 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 _0x1fbe=['../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','/:id/download','download','post','create','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1a89a1,_0x56d889){var _0x3d5b46=function(_0x56debf){while(--_0x56debf){_0x1a89a1['push'](_0x1a89a1['shift']());}};_0x3d5b46(++_0x56d889);}(_0x1fbe,0x14d));var _0xe1fb=function(_0x1044e5,_0x498e01){_0x1044e5=_0x1044e5-0x0;var _0x5ad0dd=_0x1fbe[_0x1044e5];return _0x5ad0dd;};'use strict';var multer=require(_0xe1fb('0x0'));var util=require('util');var path=require(_0xe1fb('0x1'));var timeout=require(_0xe1fb('0x2'));var express=require(_0xe1fb('0x3'));var router=express[_0xe1fb('0x4')]();var fs_extra=require(_0xe1fb('0x5'));var auth=require(_0xe1fb('0x6'));var interaction=require(_0xe1fb('0x7'));var config=require(_0xe1fb('0x8'));var controller=require(_0xe1fb('0x9'));router['get']('/',auth[_0xe1fb('0xa')](),controller[_0xe1fb('0xb')]);router[_0xe1fb('0xc')](_0xe1fb('0xd'),auth[_0xe1fb('0xa')](),controller['show']);router[_0xe1fb('0xc')](_0xe1fb('0xe'),auth['isAuthenticated'](),controller[_0xe1fb('0xf')]);router[_0xe1fb('0x10')]('/',auth['isAuthenticated'](),controller[_0xe1fb('0x11')]);router['put'](_0xe1fb('0xd'),auth[_0xe1fb('0xa')](),controller['update']);router[_0xe1fb('0x12')](_0xe1fb('0xd'),auth[_0xe1fb('0xa')](),controller['destroy']);module[_0xe1fb('0x13')]=router;
\ No newline at end of file
+var _0xc881=['delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','update'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0xc881,0x16b));var _0x1c88=function(_0x5744b2,_0x1d7aad){_0x5744b2=_0x5744b2-0x0;var _0x2f3a26=_0xc881[_0x5744b2];return _0x2f3a26;};'use strict';var multer=require(_0x1c88('0x0'));var util=require(_0x1c88('0x1'));var path=require(_0x1c88('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1c88('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1c88('0x4'));var config=require(_0x1c88('0x5'));var controller=require(_0x1c88('0x6'));router[_0x1c88('0x7')]('/',auth[_0x1c88('0x8')](),controller[_0x1c88('0x9')]);router['get'](_0x1c88('0xa'),auth[_0x1c88('0x8')](),controller['show']);router[_0x1c88('0x7')](_0x1c88('0xb'),auth[_0x1c88('0x8')](),controller[_0x1c88('0xc')]);router[_0x1c88('0xd')]('/',auth[_0x1c88('0x8')](),controller[_0x1c88('0xe')]);router[_0x1c88('0xf')](_0x1c88('0xa'),auth[_0x1c88('0x8')](),controller[_0x1c88('0x10')]);router[_0x1c88('0x11')]('/:id',auth[_0x1c88('0x8')](),controller[_0x1c88('0x12')]);module[_0x1c88('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 6bf683c..fe2424e 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 _0x956e=['BOOLEAN','exports','STRING'];(function(_0x2c4292,_0x39be32){var _0x50fff0=function(_0x178ee){while(--_0x178ee){_0x2c4292['push'](_0x2c4292['shift']());}};_0x50fff0(++_0x39be32);}(_0x956e,0x1e4));var _0xe956=function(_0x296923,_0x4adaed){_0x296923=_0x296923-0x0;var _0x29af70=_0x956e[_0x296923];return _0x29af70;};'use strict';var Sequelize=require('sequelize');module[_0xe956('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xe956('0x1')]},'format':{'type':Sequelize[_0xe956('0x1')]},'groupBy':{'type':Sequelize[_0xe956('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xe956('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xbc26=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x100208,_0x4fa4a2){var _0x2d83f4=function(_0x261665){while(--_0x261665){_0x100208['push'](_0x100208['shift']());}};_0x2d83f4(++_0x4fa4a2);}(_0xbc26,0x10a));var _0x6bc2=function(_0x40aa69,_0x30b4d8){_0x40aa69=_0x40aa69-0x0;var _0x129414=_0xbc26[_0x40aa69];return _0x129414;};'use strict';var Sequelize=require(_0x6bc2('0x0'));module[_0x6bc2('0x1')]={'field':{'type':Sequelize[_0x6bc2('0x2')]},'alias':{'type':Sequelize[_0x6bc2('0x3')]},'function':{'type':Sequelize[_0x6bc2('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x6bc2('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x6bc2('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index e7f3074..b89243c 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 _0x13fc=['findAll','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','then','destroy','error','stack','name','map','AnalyticFieldReport','type','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','keys','rawAttributes','find','create','body','bulkCreate','update','bulkDestroy','addFields','AnalyticCustomReport','sequelize','transaction','params','CustomReportId'];(function(_0x6bd32b,_0x2a6baa){var _0x2e3f04=function(_0x4733c1){while(--_0x4733c1){_0x6bd32b['push'](_0x6bd32b['shift']());}};_0x2e3f04(++_0x2a6baa);}(_0x13fc,0xe5));var _0xc13f=function(_0x32279c,_0x154cd7){_0x32279c=_0x32279c-0x0;var _0x3c377f=_0x13fc[_0x32279c];return _0x3c377f;};'use strict';var emlformat=require(_0xc13f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc13f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc13f('0x2'));var moment=require(_0xc13f('0x3'));var BPromise=require(_0xc13f('0x4'));var Mustache=require(_0xc13f('0x5'));var util=require(_0xc13f('0x6'));var path=require(_0xc13f('0x7'));var sox=require(_0xc13f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc13f('0x9'));var _=require('lodash');var squel=require(_0xc13f('0xa'));var crypto=require(_0xc13f('0xb'));var jsforce=require(_0xc13f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc13f('0xd'));var querystring=require(_0xc13f('0xe'));var Papa=require(_0xc13f('0xf'));var Redis=require(_0xc13f('0x10'));var authService=require(_0xc13f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc13f('0x12'))(_0xc13f('0x13'));var utils=require(_0xc13f('0x14'));var config=require(_0xc13f('0x15'));var licenseUtil=require(_0xc13f('0x16'));var db=require(_0xc13f('0x17'))['db'];function respondWithStatusCode(_0x36716e,_0x10fa99){_0x10fa99=_0x10fa99||0xcc;return function(_0x3a0f2b){if(_0x3a0f2b){return _0x36716e[_0xc13f('0x18')](_0x10fa99);}return _0x36716e[_0xc13f('0x19')](_0x10fa99)[_0xc13f('0x1a')]();};}function respondWithResult(_0x56dedd,_0x5d86b8){_0x5d86b8=_0x5d86b8||0xc8;return function(_0x42d76a){if(_0x42d76a){return _0x56dedd[_0xc13f('0x19')](_0x5d86b8)[_0xc13f('0x1b')](_0x42d76a);}};}function respondWithFilteredResult(_0x5386b6,_0x184848){return function(_0x10c367){if(_0x10c367){var _0x561259=typeof _0x184848[_0xc13f('0x1c')]===_0xc13f('0x1d')&&typeof _0x184848[_0xc13f('0x1e')]===_0xc13f('0x1d');var _0x417543=_0x10c367[_0xc13f('0x1f')];var _0x1b0fb1=_0x561259?0x0:_0x184848[_0xc13f('0x1c')];var _0x232db1=_0x561259?_0x10c367[_0xc13f('0x1f')]:_0x184848[_0xc13f('0x1c')]+_0x184848[_0xc13f('0x1e')];var _0x5c6e65;if(_0x232db1>=_0x417543){_0x232db1=_0x417543;_0x5c6e65=0xc8;}else{_0x5c6e65=0xce;}_0x5386b6['status'](_0x5c6e65);return _0x5386b6['set']('Content-Range',_0x1b0fb1+'-'+_0x232db1+'/'+_0x417543)[_0xc13f('0x1b')](_0x10c367);}return null;};}function patchUpdates(_0x1f5700){return function(_0xffbb22){try{jsonpatch[_0xc13f('0x20')](_0xffbb22,_0x1f5700,!![]);}catch(_0x36dbd5){return BPromise[_0xc13f('0x21')](_0x36dbd5);}return _0xffbb22[_0xc13f('0x22')]();};}function saveUpdates(_0x11423c,_0x3aeb7c){return function(_0x181dfa){if(_0x181dfa){return _0x181dfa['update'](_0x11423c)[_0xc13f('0x23')](function(_0x4ed553){return _0x4ed553;});}return null;};}function removeEntity(_0x2074a7,_0x102b5c){return function(_0x5dabb2){if(_0x5dabb2){return _0x5dabb2[_0xc13f('0x24')]()[_0xc13f('0x23')](function(){_0x2074a7[_0xc13f('0x19')](0xcc)[_0xc13f('0x1a')]();});}};}function handleEntityNotFound(_0x3236fb,_0x25d110){return function(_0x96f7e0){if(!_0x96f7e0){_0x3236fb[_0xc13f('0x18')](0x194);}return _0x96f7e0;};}function handleError(_0x88e83a,_0x3111b1){_0x3111b1=_0x3111b1||0x1f4;return function(_0x332226){logger[_0xc13f('0x25')](_0x332226[_0xc13f('0x26')]);if(_0x332226[_0xc13f('0x27')]){delete _0x332226[_0xc13f('0x27')];}_0x88e83a[_0xc13f('0x19')](_0x3111b1)['send'](_0x332226);};}exports['index']=function(_0x264b9c,_0x3538e7){var _0x51b272={},_0x17cb7d={},_0x27b2b1={'count':0x0,'rows':[]};var _0x37a66a=_[_0xc13f('0x28')](db[_0xc13f('0x29')]['rawAttributes'],function(_0x37f024){return{'name':_0x37f024['fieldName'],'type':_0x37f024[_0xc13f('0x2a')]['key']};});_0x17cb7d[_0xc13f('0x2b')]=_[_0xc13f('0x28')](_0x37a66a,_0xc13f('0x27'));_0x17cb7d[_0xc13f('0x2c')]=_['keys'](_0x264b9c[_0xc13f('0x2c')]);_0x17cb7d[_0xc13f('0x2d')]=_[_0xc13f('0x2e')](_0x17cb7d['model'],_0x17cb7d[_0xc13f('0x2c')]);_0x51b272[_0xc13f('0x2f')]=_[_0xc13f('0x2e')](_0x17cb7d[_0xc13f('0x2b')],qs['fields'](_0x264b9c[_0xc13f('0x2c')]['fields']));_0x51b272['attributes']=_0x51b272['attributes']['length']?_0x51b272[_0xc13f('0x2f')]:_0x17cb7d[_0xc13f('0x2b')];if(!_0x264b9c[_0xc13f('0x2c')][_0xc13f('0x30')](_0xc13f('0x31'))){_0x51b272[_0xc13f('0x1e')]=qs[_0xc13f('0x1e')](_0x264b9c[_0xc13f('0x2c')][_0xc13f('0x1e')]);_0x51b272[_0xc13f('0x1c')]=qs[_0xc13f('0x1c')](_0x264b9c[_0xc13f('0x2c')][_0xc13f('0x1c')]);}_0x51b272['order']=qs['sort'](_0x264b9c[_0xc13f('0x2c')]['sort']);_0x51b272[_0xc13f('0x32')]=qs['filters'](_[_0xc13f('0x33')](_0x264b9c['query'],_0x17cb7d['filters']),_0x37a66a);if(_0x264b9c[_0xc13f('0x2c')]['filter']){_0x51b272['where']=_[_0xc13f('0x34')](_0x51b272['where'],{'$or':_[_0xc13f('0x28')](_0x37a66a,function(_0x38db64){if(_0x38db64[_0xc13f('0x2a')]!==_0xc13f('0x35')){var _0x58c97e={};_0x58c97e[_0x38db64[_0xc13f('0x27')]]={'$like':'%'+_0x264b9c[_0xc13f('0x2c')][_0xc13f('0x36')]+'%'};return _0x58c97e;}})});}_0x51b272=_[_0xc13f('0x34')]({},_0x51b272,_0x264b9c[_0xc13f('0x37')]);var _0xa4fd9a={'where':_0x51b272[_0xc13f('0x32')]};return db[_0xc13f('0x29')][_0xc13f('0x1f')](_0xa4fd9a)[_0xc13f('0x23')](function(_0x4d25cf){_0x27b2b1[_0xc13f('0x1f')]=_0x4d25cf;if(_0x264b9c[_0xc13f('0x2c')][_0xc13f('0x38')]){_0x51b272[_0xc13f('0x39')]=[{'all':!![]}];}return db[_0xc13f('0x29')]['findAll'](_0x51b272);})['then'](function(_0x2dacdf){_0x27b2b1[_0xc13f('0x3a')]=_0x2dacdf;return _0x27b2b1;})[_0xc13f('0x23')](respondWithFilteredResult(_0x3538e7,_0x51b272))[_0xc13f('0x3b')](handleError(_0x3538e7,null));};exports[_0xc13f('0x3c')]=function(_0x16132f,_0x3413a6){var _0x17fa70={'raw':![],'where':{'id':_0x16132f['params']['id']}},_0x1d9e27={};_0x1d9e27[_0xc13f('0x2b')]=_[_0xc13f('0x3d')](db[_0xc13f('0x29')][_0xc13f('0x3e')]);_0x1d9e27[_0xc13f('0x2c')]=_['keys'](_0x16132f['query']);_0x1d9e27[_0xc13f('0x2d')]=_[_0xc13f('0x2e')](_0x1d9e27[_0xc13f('0x2b')],_0x1d9e27['query']);_0x17fa70[_0xc13f('0x2f')]=_['intersection'](_0x1d9e27['model'],qs['fields'](_0x16132f[_0xc13f('0x2c')]['fields']));_0x17fa70[_0xc13f('0x2f')]=_0x17fa70['attributes']['length']?_0x17fa70[_0xc13f('0x2f')]:_0x1d9e27[_0xc13f('0x2b')];if(_0x16132f[_0xc13f('0x2c')][_0xc13f('0x38')]){_0x17fa70['include']=[{'all':!![]}];}_0x17fa70=_[_0xc13f('0x34')]({},_0x17fa70,_0x16132f[_0xc13f('0x37')]);return db[_0xc13f('0x29')][_0xc13f('0x3f')](_0x17fa70)[_0xc13f('0x23')](handleEntityNotFound(_0x3413a6,null))[_0xc13f('0x23')](respondWithResult(_0x3413a6,null))[_0xc13f('0x3b')](handleError(_0x3413a6,null));};exports[_0xc13f('0x40')]=function(_0x350c51,_0x21316b){return db[_0xc13f('0x29')][_0xc13f('0x40')](_0x350c51[_0xc13f('0x41')],{})[_0xc13f('0x23')](respondWithResult(_0x21316b,0xc9))['catch'](handleError(_0x21316b,null));};exports[_0xc13f('0x42')]=function(_0x54d803,_0x6f8fbd){return db[_0xc13f('0x29')][_0xc13f('0x42')](_0x54d803[_0xc13f('0x41')],{'raw':![],'individualHooks':!![]})[_0xc13f('0x23')](respondWithResult(_0x6f8fbd,0xc9))[_0xc13f('0x3b')](handleError(_0x6f8fbd,null));};exports[_0xc13f('0x43')]=function(_0x1f6c16,_0x198755){if(_0x1f6c16[_0xc13f('0x41')]['id']){delete _0x1f6c16['body']['id'];}return db[_0xc13f('0x29')][_0xc13f('0x3f')]({'where':{'id':_0x1f6c16['params']['id']}})[_0xc13f('0x23')](handleEntityNotFound(_0x198755,null))[_0xc13f('0x23')](saveUpdates(_0x1f6c16[_0xc13f('0x41')],null))[_0xc13f('0x23')](respondWithResult(_0x198755,null))[_0xc13f('0x3b')](handleError(_0x198755,null));};exports['destroy']=function(_0x5c7753,_0xc97d31){return db[_0xc13f('0x29')][_0xc13f('0x3f')]({'where':{'id':_0x5c7753['params']['id']}})[_0xc13f('0x23')](handleEntityNotFound(_0xc97d31,null))['then'](removeEntity(_0xc97d31,null))[_0xc13f('0x3b')](handleError(_0xc97d31,null));};exports[_0xc13f('0x44')]=function(_0x57617f,_0x1eb048){return db[_0xc13f('0x29')][_0xc13f('0x24')]({'where':{'id':_0x57617f[_0xc13f('0x2c')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xc13f('0x23')](respondWithResult(_0x1eb048,0xcc))['catch'](handleError(_0x1eb048,null));};exports[_0xc13f('0x45')]=function(_0x4b1d5a,_0x5d7c7c,_0x26bd5){return db[_0xc13f('0x46')]['findOne']({'where':{'id':_0x4b1d5a['params']['id']}})[_0xc13f('0x23')](handleEntityNotFound(_0x5d7c7c,null))[_0xc13f('0x23')](function(_0x37d99d){if(_0x37d99d){return db[_0xc13f('0x47')][_0xc13f('0x48')](function(_0x34cc1a){return db[_0xc13f('0x29')]['destroy']({'where':{'CustomReportId':_0x4b1d5a[_0xc13f('0x49')]['id']},'transaction':_0x34cc1a})[_0xc13f('0x23')](function(_0x3eb453){var _0x1461c4=_[_0xc13f('0x28')](_0x4b1d5a[_0xc13f('0x41')],function(_0x595ae3){delete _0x595ae3['id'];_0x595ae3[_0xc13f('0x4a')]=_0x4b1d5a[_0xc13f('0x49')]['id'];return _0x595ae3;});return db[_0xc13f('0x29')][_0xc13f('0x42')](_0x1461c4,{'transaction':_0x34cc1a});});})[_0xc13f('0x23')](function(){return db[_0xc13f('0x29')][_0xc13f('0x4b')]({'where':{'CustomReportId':_0x4b1d5a[_0xc13f('0x49')]['id']}});});}})[_0xc13f('0x23')](respondWithResult(_0x5d7c7c,null))[_0xc13f('0x3b')](handleError(_0x5d7c7c,null));};
\ No newline at end of file
+var _0xa71f=['AnalyticFieldReport','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','catch','show','params','keys','include','create','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','error','stack','name','send'];(function(_0x4113a5,_0x483da9){var _0x3e50ee=function(_0x47c5e7){while(--_0x47c5e7){_0x4113a5['push'](_0x4113a5['shift']());}};_0x3e50ee(++_0x483da9);}(_0xa71f,0xd4));var _0xfa71=function(_0x556341,_0x5e232b){_0x556341=_0x556341-0x0;var _0x1f7251=_0xa71f[_0x556341];return _0x1f7251;};'use strict';var emlformat=require(_0xfa71('0x0'));var rimraf=require(_0xfa71('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfa71('0x2'));var rp=require(_0xfa71('0x3'));var moment=require(_0xfa71('0x4'));var BPromise=require(_0xfa71('0x5'));var Mustache=require(_0xfa71('0x6'));var util=require(_0xfa71('0x7'));var path=require(_0xfa71('0x8'));var sox=require(_0xfa71('0x9'));var csv=require('to-csv');var ejs=require(_0xfa71('0xa'));var fs=require('fs');var fs_extra=require(_0xfa71('0xb'));var _=require(_0xfa71('0xc'));var squel=require(_0xfa71('0xd'));var crypto=require(_0xfa71('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfa71('0xf'));var querystring=require(_0xfa71('0x10'));var Papa=require('papaparse');var Redis=require(_0xfa71('0x11'));var authService=require(_0xfa71('0x12'));var qs=require(_0xfa71('0x13'));var as=require(_0xfa71('0x14'));var hardwareService=require(_0xfa71('0x15'));var logger=require(_0xfa71('0x16'))(_0xfa71('0x17'));var utils=require(_0xfa71('0x18'));var config=require(_0xfa71('0x19'));var licenseUtil=require(_0xfa71('0x1a'));var db=require(_0xfa71('0x1b'))['db'];function respondWithStatusCode(_0x192c95,_0x45ee0d){_0x45ee0d=_0x45ee0d||0xcc;return function(_0x45e1f4){if(_0x45e1f4){return _0x192c95[_0xfa71('0x1c')](_0x45ee0d);}return _0x192c95[_0xfa71('0x1d')](_0x45ee0d)[_0xfa71('0x1e')]();};}function respondWithResult(_0x3930ab,_0x118bc1){_0x118bc1=_0x118bc1||0xc8;return function(_0x529fb4){if(_0x529fb4){return _0x3930ab[_0xfa71('0x1d')](_0x118bc1)[_0xfa71('0x1f')](_0x529fb4);}};}function respondWithFilteredResult(_0x14c782,_0x26c652){return function(_0xf9881d){if(_0xf9881d){var _0x2bf2d5=typeof _0x26c652[_0xfa71('0x20')]===_0xfa71('0x21')&&typeof _0x26c652[_0xfa71('0x22')]===_0xfa71('0x21');var _0x39bae1=_0xf9881d[_0xfa71('0x23')];var _0x2091b6=_0x2bf2d5?0x0:_0x26c652['offset'];var _0x1b2f95=_0x2bf2d5?_0xf9881d['count']:_0x26c652[_0xfa71('0x20')]+_0x26c652[_0xfa71('0x22')];var _0x5dea69;if(_0x1b2f95>=_0x39bae1){_0x1b2f95=_0x39bae1;_0x5dea69=0xc8;}else{_0x5dea69=0xce;}_0x14c782['status'](_0x5dea69);return _0x14c782[_0xfa71('0x24')](_0xfa71('0x25'),_0x2091b6+'-'+_0x1b2f95+'/'+_0x39bae1)[_0xfa71('0x1f')](_0xf9881d);}return null;};}function patchUpdates(_0x4c75d){return function(_0x383c70){try{jsonpatch[_0xfa71('0x26')](_0x383c70,_0x4c75d,!![]);}catch(_0x583b91){return BPromise['reject'](_0x583b91);}return _0x383c70['save']();};}function saveUpdates(_0x27aa74,_0x4a4067){return function(_0x29f2d1){if(_0x29f2d1){return _0x29f2d1[_0xfa71('0x27')](_0x27aa74)['then'](function(_0x3aa8fc){return _0x3aa8fc;});}return null;};}function removeEntity(_0x4f62df,_0x2c6545){return function(_0xeae367){if(_0xeae367){return _0xeae367[_0xfa71('0x28')]()[_0xfa71('0x29')](function(){_0x4f62df[_0xfa71('0x1d')](0xcc)[_0xfa71('0x1e')]();});}};}function handleEntityNotFound(_0x23904f,_0xb1be17){return function(_0x21e554){if(!_0x21e554){_0x23904f['sendStatus'](0x194);}return _0x21e554;};}function handleError(_0x4b7689,_0x11bf8b){_0x11bf8b=_0x11bf8b||0x1f4;return function(_0x59b374){logger[_0xfa71('0x2a')](_0x59b374[_0xfa71('0x2b')]);if(_0x59b374[_0xfa71('0x2c')]){delete _0x59b374[_0xfa71('0x2c')];}_0x4b7689[_0xfa71('0x1d')](_0x11bf8b)[_0xfa71('0x2d')](_0x59b374);};}exports['index']=function(_0x1772f1,_0xe0b9b8){var _0x2923bb={},_0x28c534={},_0x5d7be6={'count':0x0,'rows':[]};var _0x40721c=_['map'](db[_0xfa71('0x2e')][_0xfa71('0x2f')],function(_0x2c3999){return{'name':_0x2c3999[_0xfa71('0x30')],'type':_0x2c3999['type'][_0xfa71('0x31')]};});_0x28c534[_0xfa71('0x32')]=_['map'](_0x40721c,_0xfa71('0x2c'));_0x28c534[_0xfa71('0x33')]=_['keys'](_0x1772f1[_0xfa71('0x33')]);_0x28c534[_0xfa71('0x34')]=_['intersection'](_0x28c534[_0xfa71('0x32')],_0x28c534['query']);_0x2923bb[_0xfa71('0x35')]=_[_0xfa71('0x36')](_0x28c534[_0xfa71('0x32')],qs[_0xfa71('0x37')](_0x1772f1[_0xfa71('0x33')][_0xfa71('0x37')]));_0x2923bb[_0xfa71('0x35')]=_0x2923bb[_0xfa71('0x35')][_0xfa71('0x38')]?_0x2923bb['attributes']:_0x28c534[_0xfa71('0x32')];if(!_0x1772f1[_0xfa71('0x33')][_0xfa71('0x39')](_0xfa71('0x3a'))){_0x2923bb[_0xfa71('0x22')]=qs[_0xfa71('0x22')](_0x1772f1[_0xfa71('0x33')][_0xfa71('0x22')]);_0x2923bb['offset']=qs[_0xfa71('0x20')](_0x1772f1['query']['offset']);}_0x2923bb[_0xfa71('0x3b')]=qs[_0xfa71('0x3c')](_0x1772f1[_0xfa71('0x33')][_0xfa71('0x3c')]);_0x2923bb[_0xfa71('0x3d')]=qs[_0xfa71('0x34')](_[_0xfa71('0x3e')](_0x1772f1[_0xfa71('0x33')],_0x28c534[_0xfa71('0x34')]),_0x40721c);if(_0x1772f1[_0xfa71('0x33')][_0xfa71('0x3f')]){_0x2923bb[_0xfa71('0x3d')]=_[_0xfa71('0x40')](_0x2923bb[_0xfa71('0x3d')],{'$or':_['map'](_0x40721c,function(_0x41732e){if(_0x41732e[_0xfa71('0x41')]!=='VIRTUAL'){var _0x29e8dc={};_0x29e8dc[_0x41732e[_0xfa71('0x2c')]]={'$like':'%'+_0x1772f1[_0xfa71('0x33')]['filter']+'%'};return _0x29e8dc;}})});}_0x2923bb=_[_0xfa71('0x40')]({},_0x2923bb,_0x1772f1[_0xfa71('0x42')]);var _0xb4bce4={'where':_0x2923bb[_0xfa71('0x3d')]};return db['AnalyticFieldReport']['count'](_0xb4bce4)['then'](function(_0x240304){_0x5d7be6[_0xfa71('0x23')]=_0x240304;if(_0x1772f1['query'][_0xfa71('0x43')]){_0x2923bb['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xfa71('0x44')](_0x2923bb);})[_0xfa71('0x29')](function(_0x45364e){_0x5d7be6[_0xfa71('0x45')]=_0x45364e;return _0x5d7be6;})[_0xfa71('0x29')](respondWithFilteredResult(_0xe0b9b8,_0x2923bb))[_0xfa71('0x46')](handleError(_0xe0b9b8,null));};exports[_0xfa71('0x47')]=function(_0x17e563,_0x72876){var _0x86b755={'raw':![],'where':{'id':_0x17e563[_0xfa71('0x48')]['id']}},_0x4f6dd0={};_0x4f6dd0[_0xfa71('0x32')]=_['keys'](db[_0xfa71('0x2e')][_0xfa71('0x2f')]);_0x4f6dd0[_0xfa71('0x33')]=_[_0xfa71('0x49')](_0x17e563[_0xfa71('0x33')]);_0x4f6dd0['filters']=_['intersection'](_0x4f6dd0['model'],_0x4f6dd0['query']);_0x86b755[_0xfa71('0x35')]=_[_0xfa71('0x36')](_0x4f6dd0[_0xfa71('0x32')],qs[_0xfa71('0x37')](_0x17e563['query'][_0xfa71('0x37')]));_0x86b755[_0xfa71('0x35')]=_0x86b755[_0xfa71('0x35')][_0xfa71('0x38')]?_0x86b755[_0xfa71('0x35')]:_0x4f6dd0[_0xfa71('0x32')];if(_0x17e563['query'][_0xfa71('0x43')]){_0x86b755[_0xfa71('0x4a')]=[{'all':!![]}];}_0x86b755=_[_0xfa71('0x40')]({},_0x86b755,_0x17e563['options']);return db[_0xfa71('0x2e')]['find'](_0x86b755)[_0xfa71('0x29')](handleEntityNotFound(_0x72876,null))['then'](respondWithResult(_0x72876,null))[_0xfa71('0x46')](handleError(_0x72876,null));};exports[_0xfa71('0x4b')]=function(_0x1714e0,_0x4e9ef3){return db[_0xfa71('0x2e')][_0xfa71('0x4b')](_0x1714e0[_0xfa71('0x4c')],{})['then'](respondWithResult(_0x4e9ef3,0xc9))[_0xfa71('0x46')](handleError(_0x4e9ef3,null));};exports[_0xfa71('0x4d')]=function(_0x502499,_0x29e733){return db[_0xfa71('0x2e')]['bulkCreate'](_0x502499['body'],{'raw':![],'individualHooks':!![]})[_0xfa71('0x29')](respondWithResult(_0x29e733,0xc9))['catch'](handleError(_0x29e733,null));};exports['update']=function(_0x3fd22f,_0x1a9e94){if(_0x3fd22f[_0xfa71('0x4c')]['id']){delete _0x3fd22f['body']['id'];}return db['AnalyticFieldReport'][_0xfa71('0x4e')]({'where':{'id':_0x3fd22f[_0xfa71('0x48')]['id']}})[_0xfa71('0x29')](handleEntityNotFound(_0x1a9e94,null))[_0xfa71('0x29')](saveUpdates(_0x3fd22f[_0xfa71('0x4c')],null))[_0xfa71('0x29')](respondWithResult(_0x1a9e94,null))[_0xfa71('0x46')](handleError(_0x1a9e94,null));};exports[_0xfa71('0x28')]=function(_0x1ba32b,_0x30b6e6){return db[_0xfa71('0x2e')][_0xfa71('0x4e')]({'where':{'id':_0x1ba32b[_0xfa71('0x48')]['id']}})['then'](handleEntityNotFound(_0x30b6e6,null))[_0xfa71('0x29')](removeEntity(_0x30b6e6,null))[_0xfa71('0x46')](handleError(_0x30b6e6,null));};exports[_0xfa71('0x4f')]=function(_0x1c7af4,_0x1e6d4c){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x1c7af4[_0xfa71('0x33')][_0xfa71('0x50')]||[]},'raw':![],'individualHooks':!![]})[_0xfa71('0x29')](respondWithResult(_0x1e6d4c,0xcc))['catch'](handleError(_0x1e6d4c,null));};exports[_0xfa71('0x51')]=function(_0x3144b0,_0x40f68d,_0x3d0e72){return db[_0xfa71('0x52')][_0xfa71('0x53')]({'where':{'id':_0x3144b0['params']['id']}})[_0xfa71('0x29')](handleEntityNotFound(_0x40f68d,null))['then'](function(_0x47062b){if(_0x47062b){return db['sequelize'][_0xfa71('0x54')](function(_0x1361ef){return db[_0xfa71('0x2e')][_0xfa71('0x28')]({'where':{'CustomReportId':_0x3144b0[_0xfa71('0x48')]['id']},'transaction':_0x1361ef})[_0xfa71('0x29')](function(_0x1f4f0b){var _0x2a6077=_['map'](_0x3144b0['body'],function(_0x37c235){delete _0x37c235['id'];_0x37c235[_0xfa71('0x55')]=_0x3144b0['params']['id'];return _0x37c235;});return db[_0xfa71('0x2e')]['bulkCreate'](_0x2a6077,{'transaction':_0x1361ef});});})['then'](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x3144b0['params']['id']}});});}})[_0xfa71('0x29')](respondWithResult(_0x40f68d,null))[_0xfa71('0x46')](handleError(_0x40f68d,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index dccebdc..a90554e 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 _0x8301=['api','moment','bluebird','request-promise','path','rimraf','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger'];(function(_0x83d650,_0x527216){var _0x300857=function(_0x57adad){while(--_0x57adad){_0x83d650['push'](_0x83d650['shift']());}};_0x300857(++_0x527216);}(_0x8301,0x136));var _0x1830=function(_0xf4add4,_0x5b9cc1){_0xf4add4=_0xf4add4-0x0;var _0x1c42fb=_0x8301[_0xf4add4];return _0x1c42fb;};'use strict';var _=require(_0x1830('0x0'));var util=require('util');var logger=require(_0x1830('0x1'))(_0x1830('0x2'));var moment=require(_0x1830('0x3'));var BPromise=require(_0x1830('0x4'));var rp=require(_0x1830('0x5'));var fs=require('fs');var path=require(_0x1830('0x6'));var rimraf=require(_0x1830('0x7'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x1830('0x8')]=function(_0x15486d,_0x1823d3){return _0x15486d[_0x1830('0x9')](_0x1830('0xa'),attributes,{'tableName':_0x1830('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9284=['lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x2b9e39,_0xca0c84){var _0x239e79=function(_0x583f7d){while(--_0x583f7d){_0x2b9e39['push'](_0x2b9e39['shift']());}};_0x239e79(++_0xca0c84);}(_0x9284,0x1a4));var _0x4928=function(_0x17789d,_0x5d0c27){_0x17789d=_0x17789d-0x0;var _0x2c1d3a=_0x9284[_0x17789d];return _0x2c1d3a;};'use strict';var _=require(_0x4928('0x0'));var util=require('util');var logger=require(_0x4928('0x1'))(_0x4928('0x2'));var moment=require('moment');var BPromise=require(_0x4928('0x3'));var rp=require(_0x4928('0x4'));var fs=require('fs');var path=require(_0x4928('0x5'));var rimraf=require('rimraf');var config=require(_0x4928('0x6'));var attributes=require(_0x4928('0x7'));module[_0x4928('0x8')]=function(_0x400af1,_0x166e88){return _0x400af1[_0x4928('0x9')](_0x4928('0xa'),attributes,{'tableName':_0x4928('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 dde0408..715c98a 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 _0xbe42=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x10d373,_0x2a4e16){var _0x1cac4c=function(_0x505e08){while(--_0x505e08){_0x10d373['push'](_0x10d373['shift']());}};_0x1cac4c(++_0x2a4e16);}(_0xbe42,0x1ae));var _0x2be4=function(_0x838813,_0x448f0f){_0x838813=_0x838813-0x0;var _0x2bd32d=_0xbe42[_0x838813];return _0x2bd32d;};'use strict';var _=require(_0x2be4('0x0'));var util=require(_0x2be4('0x1'));var moment=require(_0x2be4('0x2'));var BPromise=require(_0x2be4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2be4('0x4'));var db=require(_0x2be4('0x5'))['db'];var utils=require(_0x2be4('0x6'));var logger=require('../../config/logger')(_0x2be4('0x7'));var config=require(_0x2be4('0x8'));var jayson=require(_0x2be4('0x9'));var client=jayson[_0x2be4('0xa')][_0x2be4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15f149,_0x2bf681,_0x2646e3){return new BPromise(function(_0x44c427,_0x43ef61){return client[_0x2be4('0xc')](_0x15f149,_0x2646e3)[_0x2be4('0xd')](function(_0x53acb6){logger[_0x2be4('0xe')](_0x2be4('0xf'),_0x2bf681,_0x2be4('0x10'));logger['debug'](_0x2be4('0x11'),_0x2bf681,'request\x20sent',JSON[_0x2be4('0x12')](_0x53acb6));if(_0x53acb6[_0x2be4('0x13')]){if(_0x53acb6[_0x2be4('0x13')][_0x2be4('0x14')]===0x1f4){logger[_0x2be4('0x13')](_0x2be4('0xf'),_0x2bf681,_0x53acb6[_0x2be4('0x13')][_0x2be4('0x15')]);return _0x43ef61(_0x53acb6[_0x2be4('0x13')][_0x2be4('0x15')]);}logger[_0x2be4('0x13')](_0x2be4('0xf'),_0x2bf681,_0x53acb6[_0x2be4('0x13')][_0x2be4('0x15')]);return _0x44c427(_0x53acb6[_0x2be4('0x13')]['message']);}else{logger[_0x2be4('0xe')](_0x2be4('0xf'),_0x2bf681,_0x2be4('0x10'));_0x44c427(_0x53acb6[_0x2be4('0x16')]['message']);}})['catch'](function(_0x2c8364){logger[_0x2be4('0x13')](_0x2be4('0xf'),_0x2bf681,_0x2c8364);_0x43ef61(_0x2c8364);});});}
\ No newline at end of file
+var _0xb81a=['then','info','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x5f519b,_0x5b606f){var _0x2461e2=function(_0x510241){while(--_0x510241){_0x5f519b['push'](_0x5f519b['shift']());}};_0x2461e2(++_0x5b606f);}(_0xb81a,0x16a));var _0xab81=function(_0x34a78f,_0x103dd1){_0x34a78f=_0x34a78f-0x0;var _0x4ea069=_0xb81a[_0x34a78f];return _0x4ea069;};'use strict';var _=require(_0xab81('0x0'));var util=require(_0xab81('0x1'));var moment=require(_0xab81('0x2'));var BPromise=require(_0xab81('0x3'));var rs=require(_0xab81('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab81('0x5'))['db'];var utils=require(_0xab81('0x6'));var logger=require(_0xab81('0x7'))(_0xab81('0x8'));var config=require('../../config/environment');var jayson=require(_0xab81('0x9'));var client=jayson[_0xab81('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ca5f2,_0x5542eb,_0x5ba916){return new BPromise(function(_0x10ee09,_0x54fdc1){return client[_0xab81('0xb')](_0x3ca5f2,_0x5ba916)[_0xab81('0xc')](function(_0x534178){logger[_0xab81('0xd')](_0xab81('0xe'),_0x5542eb,'request\x20sent');logger['debug'](_0xab81('0xf'),_0x5542eb,'request\x20sent',JSON['stringify'](_0x534178));if(_0x534178['error']){if(_0x534178[_0xab81('0x10')][_0xab81('0x11')]===0x1f4){logger[_0xab81('0x10')](_0xab81('0xe'),_0x5542eb,_0x534178[_0xab81('0x10')][_0xab81('0x12')]);return _0x54fdc1(_0x534178[_0xab81('0x10')]['message']);}logger[_0xab81('0x10')](_0xab81('0xe'),_0x5542eb,_0x534178['error'][_0xab81('0x12')]);return _0x10ee09(_0x534178[_0xab81('0x10')][_0xab81('0x12')]);}else{logger['info'](_0xab81('0xe'),_0x5542eb,_0xab81('0x13'));_0x10ee09(_0x534178[_0xab81('0x14')][_0xab81('0x12')]);}})[_0xab81('0x15')](function(_0x53b159){logger[_0xab81('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5542eb,_0x53b159);_0x54fdc1(_0x53b159);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index a49946a..ddcf74a 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(_0x2fbac2,_0x2b7376){var _0x52bc10=function(_0x4272e4){while(--_0x4272e4){_0x2fbac2['push'](_0x2fbac2['shift']());}};_0x52bc10(++_0x2b7376);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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(_0x3f8a34,_0x4571a0){var _0x34f031=function(_0x2ae3b8){while(--_0x2ae3b8){_0x3f8a34['push'](_0x3f8a34['shift']());}};_0x34f031(++_0x4571a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 9ff5ebe..58d2ece 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 _0xc5cf=['name','TEXT','sequelize','exports','STRING'];(function(_0x14f161,_0x2699b3){var _0x4a9a17=function(_0x2d2177){while(--_0x2d2177){_0x14f161['push'](_0x14f161['shift']());}};_0x4a9a17(++_0x2699b3);}(_0xc5cf,0x15b));var _0xfc5c=function(_0x4cfb5c,_0x5cdb52){_0x4cfb5c=_0x4cfb5c-0x0;var _0x45097c=_0xc5cf[_0x4cfb5c];return _0x45097c;};'use strict';var Sequelize=require(_0xfc5c('0x0'));module[_0xfc5c('0x1')]={'name':{'type':Sequelize[_0xfc5c('0x2')],'allowNull':![],'unique':_0xfc5c('0x3')},'table':{'type':Sequelize[_0xfc5c('0x2')]},'metric':{'type':Sequelize[_0xfc5c('0x4')]},'description':{'type':Sequelize[_0xfc5c('0x2')]}};
\ No newline at end of file
+var _0x2ca5=['exports','STRING','name','TEXT'];(function(_0x31295c,_0x2f2b82){var _0x2c150e=function(_0x957f1){while(--_0x957f1){_0x31295c['push'](_0x31295c['shift']());}};_0x2c150e(++_0x2f2b82);}(_0x2ca5,0x108));var _0x52ca=function(_0x45d56b,_0x3b99e4){_0x45d56b=_0x45d56b-0x0;var _0xd62e37=_0x2ca5[_0x45d56b];return _0xd62e37;};'use strict';var Sequelize=require('sequelize');module[_0x52ca('0x0')]={'name':{'type':Sequelize[_0x52ca('0x1')],'allowNull':![],'unique':_0x52ca('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x52ca('0x3')]},'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 7a86802..326d5df 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 _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x4356cc,_0x5f19b2){var _0x26863f=function(_0x36f4ff){while(--_0x36f4ff){_0x4356cc['push'](_0x4356cc['shift']());}};_0x26863f(++_0x5f19b2);}(_0x9a19,0x114));var _0x99a1=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9a19[_0x50a0c2];return _0x5ebadd;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));};
\ No newline at end of file
+var _0x8ef6=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','map','fieldName','key','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','AnalyticMetric','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x491c56,_0x3f8a3a){var _0x2a5f36=function(_0x1e0b94){while(--_0x1e0b94){_0x491c56['push'](_0x491c56['shift']());}};_0x2a5f36(++_0x3f8a3a);}(_0x8ef6,0xf2));var _0x68ef=function(_0x43be9d,_0x451fae){_0x43be9d=_0x43be9d-0x0;var _0x1ddb18=_0x8ef6[_0x43be9d];return _0x1ddb18;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];function respondWithStatusCode(_0x1e117a,_0x454ef4){_0x454ef4=_0x454ef4||0xcc;return function(_0x40f253){if(_0x40f253){return _0x1e117a[_0x68ef('0x1b')](_0x454ef4);}return _0x1e117a['status'](_0x454ef4)[_0x68ef('0x1c')]();};}function respondWithResult(_0xc50cce,_0x2657c5){_0x2657c5=_0x2657c5||0xc8;return function(_0x47fbb5){if(_0x47fbb5){return _0xc50cce[_0x68ef('0x1d')](_0x2657c5)[_0x68ef('0x1e')](_0x47fbb5);}};}function respondWithFilteredResult(_0x24682d,_0x5005ba){return function(_0x35493d){if(_0x35493d){var _0x37c4cc=typeof _0x5005ba[_0x68ef('0x1f')]===_0x68ef('0x20')&&typeof _0x5005ba['limit']===_0x68ef('0x20');var _0x54139e=_0x35493d['count'];var _0x2633c1=_0x37c4cc?0x0:_0x5005ba[_0x68ef('0x1f')];var _0x4ade0d=_0x37c4cc?_0x35493d['count']:_0x5005ba[_0x68ef('0x1f')]+_0x5005ba[_0x68ef('0x21')];var _0x318514;if(_0x4ade0d>=_0x54139e){_0x4ade0d=_0x54139e;_0x318514=0xc8;}else{_0x318514=0xce;}_0x24682d['status'](_0x318514);return _0x24682d[_0x68ef('0x22')](_0x68ef('0x23'),_0x2633c1+'-'+_0x4ade0d+'/'+_0x54139e)[_0x68ef('0x1e')](_0x35493d);}return null;};}function patchUpdates(_0x5b246b){return function(_0x3c46d4){try{jsonpatch[_0x68ef('0x24')](_0x3c46d4,_0x5b246b,!![]);}catch(_0x5af19f){return BPromise[_0x68ef('0x25')](_0x5af19f);}return _0x3c46d4[_0x68ef('0x26')]();};}function saveUpdates(_0x19aa3d,_0x5ddec7){return function(_0x59723c){if(_0x59723c){return _0x59723c['update'](_0x19aa3d)[_0x68ef('0x27')](function(_0x2023f2){return _0x2023f2;});}return null;};}function removeEntity(_0x312cc9,_0x2e6e39){return function(_0x438b4c){if(_0x438b4c){return _0x438b4c[_0x68ef('0x28')]()[_0x68ef('0x27')](function(){var _0x49374f=_0x438b4c[_0x68ef('0x29')]({'plain':!![]});var _0x13280b='Metrics';return db[_0x68ef('0x2a')]['destroy']({'where':{'type':_0x13280b,'resourceId':_0x49374f['id']}})['then'](function(){return _0x438b4c;});})['then'](function(){_0x312cc9[_0x68ef('0x1d')](0xcc)[_0x68ef('0x1c')]();});}};}function handleEntityNotFound(_0x123041,_0x29518e){return function(_0x52e67e){if(!_0x52e67e){_0x123041['sendStatus'](0x194);}return _0x52e67e;};}function handleError(_0x1cbe4f,_0x28907a){_0x28907a=_0x28907a||0x1f4;return function(_0x7bf96){logger[_0x68ef('0x2b')](_0x7bf96[_0x68ef('0x2c')]);if(_0x7bf96[_0x68ef('0x2d')]){delete _0x7bf96[_0x68ef('0x2d')];}_0x1cbe4f[_0x68ef('0x1d')](_0x28907a)['send'](_0x7bf96);};}exports[_0x68ef('0x2e')]=function(_0x4314bd,_0x132d9e){var _0x4c25aa={},_0x370a8f={},_0x523120={'count':0x0,'rows':[]};var _0x133788=_[_0x68ef('0x2f')](db['AnalyticMetric']['rawAttributes'],function(_0x159395){return{'name':_0x159395[_0x68ef('0x30')],'type':_0x159395['type'][_0x68ef('0x31')]};});_0x370a8f[_0x68ef('0x32')]=_[_0x68ef('0x2f')](_0x133788,_0x68ef('0x2d'));_0x370a8f['query']=_[_0x68ef('0x33')](_0x4314bd[_0x68ef('0x34')]);_0x370a8f['filters']=_[_0x68ef('0x35')](_0x370a8f['model'],_0x370a8f[_0x68ef('0x34')]);_0x4c25aa[_0x68ef('0x36')]=_['intersection'](_0x370a8f[_0x68ef('0x32')],qs['fields'](_0x4314bd[_0x68ef('0x34')]['fields']));_0x4c25aa[_0x68ef('0x36')]=_0x4c25aa[_0x68ef('0x36')][_0x68ef('0x37')]?_0x4c25aa['attributes']:_0x370a8f[_0x68ef('0x32')];if(!_0x4314bd['query'][_0x68ef('0x38')]('nolimit')){_0x4c25aa[_0x68ef('0x21')]=qs[_0x68ef('0x21')](_0x4314bd[_0x68ef('0x34')][_0x68ef('0x21')]);_0x4c25aa[_0x68ef('0x1f')]=qs[_0x68ef('0x1f')](_0x4314bd['query'][_0x68ef('0x1f')]);}_0x4c25aa[_0x68ef('0x39')]=qs[_0x68ef('0x3a')](_0x4314bd['query'][_0x68ef('0x3a')]);_0x4c25aa[_0x68ef('0x3b')]=qs[_0x68ef('0x3c')](_['pick'](_0x4314bd['query'],_0x370a8f[_0x68ef('0x3c')]),_0x133788);if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x3d')]){_0x4c25aa[_0x68ef('0x3b')]=_[_0x68ef('0x3e')](_0x4c25aa[_0x68ef('0x3b')],{'$or':_[_0x68ef('0x2f')](_0x133788,function(_0x5b1246){if(_0x5b1246[_0x68ef('0x3f')]!==_0x68ef('0x40')){var _0x2f6ee0={};_0x2f6ee0[_0x5b1246[_0x68ef('0x2d')]]={'$like':'%'+_0x4314bd['query'][_0x68ef('0x3d')]+'%'};return _0x2f6ee0;}})});}_0x4c25aa=_[_0x68ef('0x3e')]({},_0x4c25aa,_0x4314bd[_0x68ef('0x41')]);var _0x410c10={'where':_0x4c25aa[_0x68ef('0x3b')]};return db[_0x68ef('0x42')]['count'](_0x410c10)[_0x68ef('0x27')](function(_0x3f7699){_0x523120[_0x68ef('0x43')]=_0x3f7699;if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x44')]){_0x4c25aa[_0x68ef('0x45')]=[{'all':!![]}];}return db[_0x68ef('0x42')][_0x68ef('0x46')](_0x4c25aa);})[_0x68ef('0x27')](function(_0x531096){_0x523120[_0x68ef('0x47')]=_0x531096;return _0x523120;})[_0x68ef('0x27')](respondWithFilteredResult(_0x132d9e,_0x4c25aa))[_0x68ef('0x48')](handleError(_0x132d9e,null));};exports[_0x68ef('0x49')]=function(_0xdeacf2,_0x183377){var _0xcac58f={'raw':!![],'where':{'id':_0xdeacf2[_0x68ef('0x4a')]['id']}},_0x576767={};_0x576767['model']=_[_0x68ef('0x33')](db[_0x68ef('0x42')][_0x68ef('0x4b')]);_0x576767[_0x68ef('0x34')]=_['keys'](_0xdeacf2[_0x68ef('0x34')]);_0x576767['filters']=_[_0x68ef('0x35')](_0x576767['model'],_0x576767[_0x68ef('0x34')]);_0xcac58f[_0x68ef('0x36')]=_[_0x68ef('0x35')](_0x576767['model'],qs['fields'](_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x4c')]));_0xcac58f['attributes']=_0xcac58f['attributes']['length']?_0xcac58f[_0x68ef('0x36')]:_0x576767[_0x68ef('0x32')];if(_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x44')]){_0xcac58f[_0x68ef('0x45')]=[{'all':!![]}];}_0xcac58f=_['merge']({},_0xcac58f,_0xdeacf2['options']);return db[_0x68ef('0x42')][_0x68ef('0x4d')](_0xcac58f)[_0x68ef('0x27')](handleEntityNotFound(_0x183377,null))[_0x68ef('0x27')](respondWithResult(_0x183377,null))['catch'](handleError(_0x183377,null));};exports[_0x68ef('0x4e')]=function(_0x474e5a,_0x1c9b6f){return db[_0x68ef('0x42')]['create'](_0x474e5a['body'],{})[_0x68ef('0x27')](function(_0x3c3074){var _0x566e7c=_0x474e5a[_0x68ef('0x4f')][_0x68ef('0x29')]({'plain':!![]});if(!_0x566e7c)throw new Error(_0x68ef('0x50'));if(_0x566e7c[_0x68ef('0x51')]===_0x68ef('0x4f')){var _0x4f0f77=_0x3c3074[_0x68ef('0x29')]({'plain':!![]});var _0x3984ca=_0x68ef('0x52');return db['UserProfileSection'][_0x68ef('0x4d')]({'where':{'name':_0x3984ca,'userProfileId':_0x566e7c[_0x68ef('0x53')]},'raw':!![]})[_0x68ef('0x27')](function(_0x50ef1f){if(_0x50ef1f&&_0x50ef1f[_0x68ef('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4f0f77[_0x68ef('0x2d')],'resourceId':_0x4f0f77['id'],'type':_0x50ef1f['name'],'sectionId':_0x50ef1f['id']},{})[_0x68ef('0x27')](function(){return _0x3c3074;});}else{return _0x3c3074;}})[_0x68ef('0x48')](function(_0x53ebd){logger[_0x68ef('0x2b')](_0x68ef('0x55'),_0x53ebd);throw _0x53ebd;});}return _0x3c3074;})[_0x68ef('0x27')](respondWithResult(_0x1c9b6f,0xc9))[_0x68ef('0x48')](handleError(_0x1c9b6f,null));};exports[_0x68ef('0x56')]=function(_0x2b35f4,_0x247915){if(_0x2b35f4['body']['id']){delete _0x2b35f4['body']['id'];}return db[_0x68ef('0x42')][_0x68ef('0x4d')]({'where':{'id':_0x2b35f4[_0x68ef('0x4a')]['id']}})[_0x68ef('0x27')](handleEntityNotFound(_0x247915,null))[_0x68ef('0x27')](saveUpdates(_0x2b35f4[_0x68ef('0x57')],null))[_0x68ef('0x27')](respondWithResult(_0x247915,null))[_0x68ef('0x48')](handleError(_0x247915,null));};exports[_0x68ef('0x28')]=function(_0x4c2e9c,_0x5685bb){return db[_0x68ef('0x42')]['find']({'where':{'id':_0x4c2e9c[_0x68ef('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5685bb,null))[_0x68ef('0x27')](removeEntity(_0x5685bb,null))[_0x68ef('0x48')](handleError(_0x5685bb,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index ee493ae..eccfdd0 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 _0xb3d8=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x24dc59,_0x92ae8e){var _0x8d63ea=function(_0x1d72de){while(--_0x1d72de){_0x24dc59['push'](_0x24dc59['shift']());}};_0x8d63ea(++_0x92ae8e);}(_0xb3d8,0xdc));var _0x8b3d=function(_0x3730eb,_0x96ee91){_0x3730eb=_0x3730eb-0x0;var _0x5701be=_0xb3d8[_0x3730eb];return _0x5701be;};'use strict';var _=require('lodash');var util=require(_0x8b3d('0x0'));var logger=require(_0x8b3d('0x1'))(_0x8b3d('0x2'));var moment=require(_0x8b3d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b3d('0x4'));var rimraf=require(_0x8b3d('0x5'));var config=require(_0x8b3d('0x6'));var attributes=require(_0x8b3d('0x7'));module[_0x8b3d('0x8')]=function(_0x22d97b,_0x3b0f04){return _0x22d97b[_0x8b3d('0x9')](_0x8b3d('0xa'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3c6c=['rimraf','../../config/environment','exports','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x38987f,_0xc79720){var _0x4cb697=function(_0x1af5ae){while(--_0x1af5ae){_0x38987f['push'](_0x38987f['shift']());}};_0x4cb697(++_0xc79720);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x2acf48,_0x176934){_0x2acf48=_0x2acf48-0x0;var _0x4a5b1e=_0x3c6c[_0x2acf48];return _0x4a5b1e;};'use strict';var _=require(_0xc3c6('0x0'));var util=require('util');var logger=require(_0xc3c6('0x1'))(_0xc3c6('0x2'));var moment=require(_0xc3c6('0x3'));var BPromise=require(_0xc3c6('0x4'));var rp=require(_0xc3c6('0x5'));var fs=require('fs');var path=require(_0xc3c6('0x6'));var rimraf=require(_0xc3c6('0x7'));var config=require(_0xc3c6('0x8'));var attributes=require('./analyticMetric.attributes');module[_0xc3c6('0x9')]=function(_0x4a2ca1,_0xe7731e){return _0x4a2ca1['define']('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 0c308e1..20d63ed 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 _0xd07e=['AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd07e,0x14c));var _0xed07=function(_0x2fcbaa,_0x35eeb4){_0x2fcbaa=_0x2fcbaa-0x0;var _0x206a5a=_0xd07e[_0x2fcbaa];return _0x206a5a;};'use strict';var _=require('lodash');var util=require(_0xed07('0x0'));var moment=require(_0xed07('0x1'));var BPromise=require(_0xed07('0x2'));var rs=require(_0xed07('0x3'));var fs=require('fs');var Redis=require(_0xed07('0x4'));var db=require(_0xed07('0x5'))['db'];var utils=require(_0xed07('0x6'));var logger=require(_0xed07('0x7'))(_0xed07('0x8'));var config=require('../../config/environment');var jayson=require(_0xed07('0x9'));var client=jayson[_0xed07('0xa')][_0xed07('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2649db,_0x268ed7,_0x58cc48){return new BPromise(function(_0x1af133,_0x4fe486){return client[_0xed07('0xc')](_0x2649db,_0x58cc48)[_0xed07('0xd')](function(_0x14110d){logger[_0xed07('0xe')](_0xed07('0xf'),_0x268ed7,_0xed07('0x10'));logger[_0xed07('0x11')](_0xed07('0x12'),_0x268ed7,_0xed07('0x10'),JSON[_0xed07('0x13')](_0x14110d));if(_0x14110d[_0xed07('0x14')]){if(_0x14110d[_0xed07('0x14')][_0xed07('0x15')]===0x1f4){logger[_0xed07('0x14')](_0xed07('0xf'),_0x268ed7,_0x14110d[_0xed07('0x14')][_0xed07('0x16')]);return _0x4fe486(_0x14110d[_0xed07('0x14')][_0xed07('0x16')]);}logger[_0xed07('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x268ed7,_0x14110d['error'][_0xed07('0x16')]);return _0x1af133(_0x14110d[_0xed07('0x14')][_0xed07('0x16')]);}else{logger[_0xed07('0xe')](_0xed07('0xf'),_0x268ed7,_0xed07('0x10'));_0x1af133(_0x14110d[_0xed07('0x17')][_0xed07('0x16')]);}})[_0xed07('0x18')](function(_0x4f0e3e){logger['error'](_0xed07('0xf'),_0x268ed7,_0x4f0e3e);_0x4fe486(_0x4f0e3e);});});}
\ No newline at end of file
+var _0xf603=['http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x410787,_0x53f6d5){var _0xc635d8=function(_0x264cd9){while(--_0x264cd9){_0x410787['push'](_0x410787['shift']());}};_0xc635d8(++_0x53f6d5);}(_0xf603,0x1c3));var _0x3f60=function(_0x1b9207,_0x4ae729){_0x1b9207=_0x1b9207-0x0;var _0x54630b=_0xf603[_0x1b9207];return _0x54630b;};'use strict';var _=require(_0x3f60('0x0'));var util=require('util');var moment=require(_0x3f60('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f60('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f60('0x3'));var logger=require(_0x3f60('0x4'))(_0x3f60('0x5'));var config=require(_0x3f60('0x6'));var jayson=require(_0x3f60('0x7'));var client=jayson[_0x3f60('0x8')][_0x3f60('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2feec7,_0x3d0899,_0x2a7bf0){return new BPromise(function(_0x35352f,_0x2abd9e){return client[_0x3f60('0xa')](_0x2feec7,_0x2a7bf0)[_0x3f60('0xb')](function(_0x3331fd){logger[_0x3f60('0xc')](_0x3f60('0xd'),_0x3d0899,_0x3f60('0xe'));logger[_0x3f60('0xf')](_0x3f60('0x10'),_0x3d0899,_0x3f60('0xe'),JSON[_0x3f60('0x11')](_0x3331fd));if(_0x3331fd[_0x3f60('0x12')]){if(_0x3331fd[_0x3f60('0x12')][_0x3f60('0x13')]===0x1f4){logger[_0x3f60('0x12')](_0x3f60('0xd'),_0x3d0899,_0x3331fd[_0x3f60('0x12')][_0x3f60('0x14')]);return _0x2abd9e(_0x3331fd[_0x3f60('0x12')][_0x3f60('0x14')]);}logger['error'](_0x3f60('0xd'),_0x3d0899,_0x3331fd['error']['message']);return _0x35352f(_0x3331fd[_0x3f60('0x12')][_0x3f60('0x14')]);}else{logger[_0x3f60('0xc')](_0x3f60('0xd'),_0x3d0899,_0x3f60('0xe'));_0x35352f(_0x3331fd[_0x3f60('0x15')]['message']);}})[_0x3f60('0x16')](function(_0x37efde){logger[_0x3f60('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x3d0899,_0x37efde);_0x2abd9e(_0x37efde);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 07f92b0..f073527 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 _0x3ca4=['exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','create','update','delete','destroy'];(function(_0x506330,_0x10062e){var _0x3dd612=function(_0x1978b3){while(--_0x1978b3){_0x506330['push'](_0x506330['shift']());}};_0x3dd612(++_0x10062e);}(_0x3ca4,0x17d));var _0x43ca=function(_0x3d0e7e,_0x564590){_0x3d0e7e=_0x3d0e7e-0x0;var _0x4819aa=_0x3ca4[_0x3d0e7e];return _0x4819aa;};'use strict';var multer=require(_0x43ca('0x0'));var util=require(_0x43ca('0x1'));var path=require(_0x43ca('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x43ca('0x3')]();var fs_extra=require(_0x43ca('0x4'));var auth=require(_0x43ca('0x5'));var interaction=require(_0x43ca('0x6'));var config=require(_0x43ca('0x7'));var controller=require(_0x43ca('0x8'));router[_0x43ca('0x9')]('/',auth['isAuthenticated'](),controller[_0x43ca('0xa')]);router[_0x43ca('0x9')](_0x43ca('0xb'),auth[_0x43ca('0xc')](),controller[_0x43ca('0xd')]);router[_0x43ca('0xe')]('/',auth[_0x43ca('0xc')](),controller[_0x43ca('0xf')]);router['put']('/:id',auth[_0x43ca('0xc')](),controller[_0x43ca('0x10')]);router[_0x43ca('0x11')](_0x43ca('0xb'),auth['isAuthenticated'](),controller[_0x43ca('0x12')]);module[_0x43ca('0x13')]=router;
\ No newline at end of file
+var _0x6208=['put','delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x2ef265,_0x3c6a95){var _0x2299af=function(_0x3f18e2){while(--_0x3f18e2){_0x2ef265['push'](_0x2ef265['shift']());}};_0x2299af(++_0x3c6a95);}(_0x6208,0x17d));var _0x8620=function(_0x2d4065,_0x38dc95){_0x2d4065=_0x2d4065-0x0;var _0xef6016=_0x6208[_0x2d4065];return _0xef6016;};'use strict';var multer=require(_0x8620('0x0'));var util=require('util');var path=require(_0x8620('0x1'));var timeout=require(_0x8620('0x2'));var express=require('express');var router=express[_0x8620('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8620('0x4'));var interaction=require(_0x8620('0x5'));var config=require(_0x8620('0x6'));var controller=require(_0x8620('0x7'));router[_0x8620('0x8')]('/',auth[_0x8620('0x9')](),controller[_0x8620('0xa')]);router['get'](_0x8620('0xb'),auth[_0x8620('0x9')](),controller[_0x8620('0xc')]);router[_0x8620('0xd')]('/',auth[_0x8620('0x9')](),controller[_0x8620('0xe')]);router[_0x8620('0xf')](_0x8620('0xb'),auth[_0x8620('0x9')](),controller['update']);router[_0x8620('0x10')](_0x8620('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x8620('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index cf101d1..acad3cd 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 _0x7ca3=['exports','TEXT','sequelize'];(function(_0x4d46ee,_0xa971ad){var _0x3f9536=function(_0xe885c2){while(--_0xe885c2){_0x4d46ee['push'](_0x4d46ee['shift']());}};_0x3f9536(++_0xa971ad);}(_0x7ca3,0x17c));var _0x37ca=function(_0x29db71,_0x306de1){_0x29db71=_0x29db71-0x0;var _0x2c8a07=_0x7ca3[_0x29db71];return _0x2c8a07;};'use strict';var Sequelize=require(_0x37ca('0x0'));module[_0x37ca('0x1')]={'tree':{'type':Sequelize[_0x37ca('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x2a56=['exports','TEXT','sequelize'];(function(_0x5496ff,_0x104d17){var _0x36881c=function(_0x395a82){while(--_0x395a82){_0x5496ff['push'](_0x5496ff['shift']());}};_0x36881c(++_0x104d17);}(_0x2a56,0x1c7));var _0x62a5=function(_0x29b38c,_0x87560d){_0x29b38c=_0x29b38c-0x0;var _0x36bfd5=_0x2a56[_0x29b38c];return _0x36bfd5;};'use strict';var Sequelize=require(_0x62a5('0x0'));module[_0x62a5('0x1')]={'tree':{'type':Sequelize[_0x62a5('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 c048a64..de162c2 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 _0xc85f=['querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','AnalyticTreeReport','includeAll','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','desk.js'];(function(_0x32f8d7,_0x4da0bd){var _0x29ea63=function(_0x26c9d8){while(--_0x26c9d8){_0x32f8d7['push'](_0x32f8d7['shift']());}};_0x29ea63(++_0x4da0bd);}(_0xc85f,0x163));var _0xfc85=function(_0x3553b5,_0x27c233){_0x3553b5=_0x3553b5-0x0;var _0x47f68e=_0xc85f[_0x3553b5];return _0x47f68e;};'use strict';var emlformat=require(_0xfc85('0x0'));var rimraf=require(_0xfc85('0x1'));var zipdir=require(_0xfc85('0x2'));var jsonpatch=require(_0xfc85('0x3'));var rp=require(_0xfc85('0x4'));var moment=require(_0xfc85('0x5'));var BPromise=require(_0xfc85('0x6'));var Mustache=require(_0xfc85('0x7'));var util=require(_0xfc85('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xfc85('0x9'));var ejs=require(_0xfc85('0xa'));var fs=require('fs');var fs_extra=require(_0xfc85('0xb'));var _=require(_0xfc85('0xc'));var squel=require(_0xfc85('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfc85('0xe'));var toCsv=require(_0xfc85('0x9'));var querystring=require(_0xfc85('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfc85('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc85('0x11'));var logger=require(_0xfc85('0x12'))(_0xfc85('0x13'));var utils=require(_0xfc85('0x14'));var config=require(_0xfc85('0x15'));var licenseUtil=require(_0xfc85('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30b843,_0x3d90f6){_0x3d90f6=_0x3d90f6||0xcc;return function(_0x27f0eb){if(_0x27f0eb){return _0x30b843[_0xfc85('0x17')](_0x3d90f6);}return _0x30b843['status'](_0x3d90f6)[_0xfc85('0x18')]();};}function respondWithResult(_0x3d0906,_0x2503a6){_0x2503a6=_0x2503a6||0xc8;return function(_0x19dfde){if(_0x19dfde){return _0x3d0906['status'](_0x2503a6)[_0xfc85('0x19')](_0x19dfde);}};}function respondWithFilteredResult(_0x25db48,_0x504922){return function(_0x3068b6){if(_0x3068b6){var _0x3845b1=typeof _0x504922['offset']===_0xfc85('0x1a')&&typeof _0x504922[_0xfc85('0x1b')]===_0xfc85('0x1a');var _0x1f7d35=_0x3068b6[_0xfc85('0x1c')];var _0x4ad72b=_0x3845b1?0x0:_0x504922[_0xfc85('0x1d')];var _0x4b2a37=_0x3845b1?_0x3068b6[_0xfc85('0x1c')]:_0x504922[_0xfc85('0x1d')]+_0x504922[_0xfc85('0x1b')];var _0x13d158;if(_0x4b2a37>=_0x1f7d35){_0x4b2a37=_0x1f7d35;_0x13d158=0xc8;}else{_0x13d158=0xce;}_0x25db48[_0xfc85('0x1e')](_0x13d158);return _0x25db48[_0xfc85('0x1f')](_0xfc85('0x20'),_0x4ad72b+'-'+_0x4b2a37+'/'+_0x1f7d35)[_0xfc85('0x19')](_0x3068b6);}return null;};}function patchUpdates(_0x157c39){return function(_0x4e20c1){try{jsonpatch[_0xfc85('0x21')](_0x4e20c1,_0x157c39,!![]);}catch(_0x1e690a){return BPromise[_0xfc85('0x22')](_0x1e690a);}return _0x4e20c1[_0xfc85('0x23')]();};}function saveUpdates(_0x5f3586,_0x40cb71){return function(_0x5dd0b1){if(_0x5dd0b1){return _0x5dd0b1[_0xfc85('0x24')](_0x5f3586)[_0xfc85('0x25')](function(_0x56db18){return _0x56db18;});}return null;};}function removeEntity(_0x122111,_0x2eec52){return function(_0x5a030b){if(_0x5a030b){return _0x5a030b[_0xfc85('0x26')]()[_0xfc85('0x25')](function(){_0x122111[_0xfc85('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35bb69,_0x4aa3df){return function(_0x340633){if(!_0x340633){_0x35bb69[_0xfc85('0x17')](0x194);}return _0x340633;};}function handleError(_0x3f513c,_0x34187b){_0x34187b=_0x34187b||0x1f4;return function(_0x24adf3){logger[_0xfc85('0x27')](_0x24adf3[_0xfc85('0x28')]);if(_0x24adf3[_0xfc85('0x29')]){delete _0x24adf3['name'];}_0x3f513c[_0xfc85('0x1e')](_0x34187b)[_0xfc85('0x2a')](_0x24adf3);};}exports[_0xfc85('0x2b')]=function(_0x38a8bf,_0x1bb7e5){var _0x1fe253={},_0x438715={},_0x254778={'count':0x0,'rows':[]};var _0x202f66=_[_0xfc85('0x2c')](db['AnalyticTreeReport'][_0xfc85('0x2d')],function(_0x59eb35){return{'name':_0x59eb35[_0xfc85('0x2e')],'type':_0x59eb35[_0xfc85('0x2f')]['key']};});_0x438715[_0xfc85('0x30')]=_[_0xfc85('0x2c')](_0x202f66,_0xfc85('0x29'));_0x438715[_0xfc85('0x31')]=_[_0xfc85('0x32')](_0x38a8bf[_0xfc85('0x31')]);_0x438715[_0xfc85('0x33')]=_[_0xfc85('0x34')](_0x438715[_0xfc85('0x30')],_0x438715[_0xfc85('0x31')]);_0x1fe253['attributes']=_[_0xfc85('0x34')](_0x438715['model'],qs[_0xfc85('0x35')](_0x38a8bf[_0xfc85('0x31')]['fields']));_0x1fe253[_0xfc85('0x36')]=_0x1fe253['attributes'][_0xfc85('0x37')]?_0x1fe253[_0xfc85('0x36')]:_0x438715['model'];if(!_0x38a8bf[_0xfc85('0x31')][_0xfc85('0x38')](_0xfc85('0x39'))){_0x1fe253[_0xfc85('0x1b')]=qs['limit'](_0x38a8bf[_0xfc85('0x31')][_0xfc85('0x1b')]);_0x1fe253[_0xfc85('0x1d')]=qs[_0xfc85('0x1d')](_0x38a8bf['query']['offset']);}_0x1fe253[_0xfc85('0x3a')]=qs[_0xfc85('0x3b')](_0x38a8bf['query'][_0xfc85('0x3b')]);_0x1fe253[_0xfc85('0x3c')]=qs[_0xfc85('0x33')](_[_0xfc85('0x3d')](_0x38a8bf['query'],_0x438715['filters']),_0x202f66);if(_0x38a8bf[_0xfc85('0x31')][_0xfc85('0x3e')]){_0x1fe253[_0xfc85('0x3c')]=_[_0xfc85('0x3f')](_0x1fe253[_0xfc85('0x3c')],{'$or':_[_0xfc85('0x2c')](_0x202f66,function(_0x131636){if(_0x131636[_0xfc85('0x2f')]!=='VIRTUAL'){var _0x5bc62b={};_0x5bc62b[_0x131636[_0xfc85('0x29')]]={'$like':'%'+_0x38a8bf[_0xfc85('0x31')][_0xfc85('0x3e')]+'%'};return _0x5bc62b;}})});}_0x1fe253=_[_0xfc85('0x3f')]({},_0x1fe253,_0x38a8bf['options']);var _0xbb964b={'where':_0x1fe253[_0xfc85('0x3c')]};return db[_0xfc85('0x40')][_0xfc85('0x1c')](_0xbb964b)['then'](function(_0xbc5158){_0x254778[_0xfc85('0x1c')]=_0xbc5158;if(_0x38a8bf[_0xfc85('0x31')][_0xfc85('0x41')]){_0x1fe253['include']=[{'all':!![]}];}return db[_0xfc85('0x40')][_0xfc85('0x42')](_0x1fe253);})[_0xfc85('0x25')](function(_0x3a2863){_0x254778[_0xfc85('0x43')]=_0x3a2863;return _0x254778;})[_0xfc85('0x25')](respondWithFilteredResult(_0x1bb7e5,_0x1fe253))[_0xfc85('0x44')](handleError(_0x1bb7e5,null));};exports[_0xfc85('0x45')]=function(_0x1d533c,_0x1ffe51){var _0x5d764d={'raw':!![],'where':{'id':_0x1d533c[_0xfc85('0x46')]['id']}},_0x46f3cf={};_0x46f3cf[_0xfc85('0x30')]=_[_0xfc85('0x32')](db[_0xfc85('0x40')][_0xfc85('0x2d')]);_0x46f3cf[_0xfc85('0x31')]=_[_0xfc85('0x32')](_0x1d533c['query']);_0x46f3cf[_0xfc85('0x33')]=_[_0xfc85('0x34')](_0x46f3cf[_0xfc85('0x30')],_0x46f3cf[_0xfc85('0x31')]);_0x5d764d[_0xfc85('0x36')]=_[_0xfc85('0x34')](_0x46f3cf[_0xfc85('0x30')],qs['fields'](_0x1d533c[_0xfc85('0x31')][_0xfc85('0x35')]));_0x5d764d[_0xfc85('0x36')]=_0x5d764d[_0xfc85('0x36')][_0xfc85('0x37')]?_0x5d764d[_0xfc85('0x36')]:_0x46f3cf[_0xfc85('0x30')];if(_0x1d533c[_0xfc85('0x31')][_0xfc85('0x41')]){_0x5d764d['include']=[{'all':!![]}];}_0x5d764d=_[_0xfc85('0x3f')]({},_0x5d764d,_0x1d533c['options']);return db[_0xfc85('0x40')][_0xfc85('0x47')](_0x5d764d)[_0xfc85('0x25')](handleEntityNotFound(_0x1ffe51,null))['then'](respondWithResult(_0x1ffe51,null))[_0xfc85('0x44')](handleError(_0x1ffe51,null));};exports['create']=function(_0x32d674,_0x213019){return db[_0xfc85('0x40')][_0xfc85('0x48')](_0x32d674[_0xfc85('0x49')],{})[_0xfc85('0x25')](respondWithResult(_0x213019,0xc9))[_0xfc85('0x44')](handleError(_0x213019,null));};exports[_0xfc85('0x24')]=function(_0x1a3865,_0x54b6ac){if(_0x1a3865[_0xfc85('0x49')]['id']){delete _0x1a3865[_0xfc85('0x49')]['id'];}return db[_0xfc85('0x40')][_0xfc85('0x47')]({'where':{'id':_0x1a3865[_0xfc85('0x46')]['id']}})['then'](handleEntityNotFound(_0x54b6ac,null))['then'](saveUpdates(_0x1a3865[_0xfc85('0x49')],null))[_0xfc85('0x25')](respondWithResult(_0x54b6ac,null))[_0xfc85('0x44')](handleError(_0x54b6ac,null));};exports[_0xfc85('0x26')]=function(_0x344097,_0x88f8ed){return db[_0xfc85('0x40')]['find']({'where':{'id':_0x344097[_0xfc85('0x46')]['id']}})[_0xfc85('0x25')](handleEntityNotFound(_0x88f8ed,null))[_0xfc85('0x25')](removeEntity(_0x88f8ed,null))[_0xfc85('0x44')](handleError(_0x88f8ed,null));};
\ No newline at end of file
+var _0xf411=['type','VIRTUAL','options','includeAll','catch','show','params','keys','include','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','limit','where','filter','merge'];(function(_0x55d829,_0x43f06c){var _0x52163b=function(_0x493cd8){while(--_0x493cd8){_0x55d829['push'](_0x55d829['shift']());}};_0x52163b(++_0x43f06c);}(_0xf411,0x98));var _0x1f41=function(_0x2ee712,_0x5a2179){_0x2ee712=_0x2ee712-0x0;var _0x2e8783=_0xf411[_0x2ee712];return _0x2e8783;};'use strict';var emlformat=require(_0x1f41('0x0'));var rimraf=require(_0x1f41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1f41('0x2'));var rp=require(_0x1f41('0x3'));var moment=require(_0x1f41('0x4'));var BPromise=require(_0x1f41('0x5'));var Mustache=require(_0x1f41('0x6'));var util=require(_0x1f41('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x1f41('0x8'));var ejs=require(_0x1f41('0x9'));var fs=require('fs');var fs_extra=require(_0x1f41('0xa'));var _=require(_0x1f41('0xb'));var squel=require(_0x1f41('0xc'));var crypto=require('crypto');var jsforce=require(_0x1f41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1f41('0x8'));var querystring=require(_0x1f41('0xe'));var Papa=require(_0x1f41('0xf'));var Redis=require('ioredis');var authService=require(_0x1f41('0x10'));var qs=require(_0x1f41('0x11'));var as=require(_0x1f41('0x12'));var hardwareService=require(_0x1f41('0x13'));var logger=require(_0x1f41('0x14'))(_0x1f41('0x15'));var utils=require(_0x1f41('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1f41('0x17'))['db'];function respondWithStatusCode(_0x148b9a,_0x2ffc46){_0x2ffc46=_0x2ffc46||0xcc;return function(_0x11c3c5){if(_0x11c3c5){return _0x148b9a['sendStatus'](_0x2ffc46);}return _0x148b9a[_0x1f41('0x18')](_0x2ffc46)['end']();};}function respondWithResult(_0x2dac4c,_0x557ff8){_0x557ff8=_0x557ff8||0xc8;return function(_0x8de505){if(_0x8de505){return _0x2dac4c[_0x1f41('0x18')](_0x557ff8)[_0x1f41('0x19')](_0x8de505);}};}function respondWithFilteredResult(_0x507652,_0x541a3c){return function(_0x196acd){if(_0x196acd){var _0x9a7fbc=typeof _0x541a3c[_0x1f41('0x1a')]===_0x1f41('0x1b')&&typeof _0x541a3c['limit']===_0x1f41('0x1b');var _0x768646=_0x196acd[_0x1f41('0x1c')];var _0x3ea6ff=_0x9a7fbc?0x0:_0x541a3c[_0x1f41('0x1a')];var _0x5e8dfc=_0x9a7fbc?_0x196acd[_0x1f41('0x1c')]:_0x541a3c[_0x1f41('0x1a')]+_0x541a3c['limit'];var _0x1d44ef;if(_0x5e8dfc>=_0x768646){_0x5e8dfc=_0x768646;_0x1d44ef=0xc8;}else{_0x1d44ef=0xce;}_0x507652['status'](_0x1d44ef);return _0x507652[_0x1f41('0x1d')](_0x1f41('0x1e'),_0x3ea6ff+'-'+_0x5e8dfc+'/'+_0x768646)[_0x1f41('0x19')](_0x196acd);}return null;};}function patchUpdates(_0x3d8008){return function(_0x26e2fc){try{jsonpatch[_0x1f41('0x1f')](_0x26e2fc,_0x3d8008,!![]);}catch(_0x55f746){return BPromise['reject'](_0x55f746);}return _0x26e2fc[_0x1f41('0x20')]();};}function saveUpdates(_0x2c6624,_0x2abceb){return function(_0x26c159){if(_0x26c159){return _0x26c159[_0x1f41('0x21')](_0x2c6624)[_0x1f41('0x22')](function(_0x2641fa){return _0x2641fa;});}return null;};}function removeEntity(_0x59ea4d,_0x19977f){return function(_0x224fbd){if(_0x224fbd){return _0x224fbd[_0x1f41('0x23')]()[_0x1f41('0x22')](function(){_0x59ea4d[_0x1f41('0x18')](0xcc)[_0x1f41('0x24')]();});}};}function handleEntityNotFound(_0x168197,_0x3bce12){return function(_0x59269b){if(!_0x59269b){_0x168197[_0x1f41('0x25')](0x194);}return _0x59269b;};}function handleError(_0xf9a529,_0x5a5f38){_0x5a5f38=_0x5a5f38||0x1f4;return function(_0x23780){logger[_0x1f41('0x26')](_0x23780[_0x1f41('0x27')]);if(_0x23780[_0x1f41('0x28')]){delete _0x23780['name'];}_0xf9a529[_0x1f41('0x18')](_0x5a5f38)[_0x1f41('0x29')](_0x23780);};}exports['index']=function(_0x415d30,_0x2aab27){var _0x45e687={},_0x1f0c9c={},_0x2710ef={'count':0x0,'rows':[]};var _0x273e66=_[_0x1f41('0x2a')](db[_0x1f41('0x2b')][_0x1f41('0x2c')],function(_0x51a323){return{'name':_0x51a323[_0x1f41('0x2d')],'type':_0x51a323['type'][_0x1f41('0x2e')]};});_0x1f0c9c['model']=_[_0x1f41('0x2a')](_0x273e66,_0x1f41('0x28'));_0x1f0c9c[_0x1f41('0x2f')]=_['keys'](_0x415d30['query']);_0x1f0c9c[_0x1f41('0x30')]=_[_0x1f41('0x31')](_0x1f0c9c['model'],_0x1f0c9c[_0x1f41('0x2f')]);_0x45e687[_0x1f41('0x32')]=_['intersection'](_0x1f0c9c[_0x1f41('0x33')],qs[_0x1f41('0x34')](_0x415d30[_0x1f41('0x2f')][_0x1f41('0x34')]));_0x45e687[_0x1f41('0x32')]=_0x45e687[_0x1f41('0x32')]['length']?_0x45e687[_0x1f41('0x32')]:_0x1f0c9c[_0x1f41('0x33')];if(!_0x415d30[_0x1f41('0x2f')][_0x1f41('0x35')]('nolimit')){_0x45e687[_0x1f41('0x36')]=qs['limit'](_0x415d30[_0x1f41('0x2f')][_0x1f41('0x36')]);_0x45e687[_0x1f41('0x1a')]=qs[_0x1f41('0x1a')](_0x415d30[_0x1f41('0x2f')][_0x1f41('0x1a')]);}_0x45e687['order']=qs['sort'](_0x415d30[_0x1f41('0x2f')]['sort']);_0x45e687[_0x1f41('0x37')]=qs[_0x1f41('0x30')](_['pick'](_0x415d30[_0x1f41('0x2f')],_0x1f0c9c[_0x1f41('0x30')]),_0x273e66);if(_0x415d30[_0x1f41('0x2f')][_0x1f41('0x38')]){_0x45e687[_0x1f41('0x37')]=_[_0x1f41('0x39')](_0x45e687['where'],{'$or':_['map'](_0x273e66,function(_0x1050bc){if(_0x1050bc[_0x1f41('0x3a')]!==_0x1f41('0x3b')){var _0x71aa17={};_0x71aa17[_0x1050bc[_0x1f41('0x28')]]={'$like':'%'+_0x415d30[_0x1f41('0x2f')][_0x1f41('0x38')]+'%'};return _0x71aa17;}})});}_0x45e687=_[_0x1f41('0x39')]({},_0x45e687,_0x415d30[_0x1f41('0x3c')]);var _0x3d91ae={'where':_0x45e687[_0x1f41('0x37')]};return db[_0x1f41('0x2b')][_0x1f41('0x1c')](_0x3d91ae)[_0x1f41('0x22')](function(_0xef90c8){_0x2710ef['count']=_0xef90c8;if(_0x415d30[_0x1f41('0x2f')][_0x1f41('0x3d')]){_0x45e687['include']=[{'all':!![]}];}return db[_0x1f41('0x2b')]['findAll'](_0x45e687);})['then'](function(_0x1a3aba){_0x2710ef['rows']=_0x1a3aba;return _0x2710ef;})['then'](respondWithFilteredResult(_0x2aab27,_0x45e687))[_0x1f41('0x3e')](handleError(_0x2aab27,null));};exports[_0x1f41('0x3f')]=function(_0x5c4081,_0x1bedc6){var _0x3fab24={'raw':!![],'where':{'id':_0x5c4081[_0x1f41('0x40')]['id']}},_0x5f4fb5={};_0x5f4fb5['model']=_[_0x1f41('0x41')](db[_0x1f41('0x2b')][_0x1f41('0x2c')]);_0x5f4fb5[_0x1f41('0x2f')]=_[_0x1f41('0x41')](_0x5c4081[_0x1f41('0x2f')]);_0x5f4fb5[_0x1f41('0x30')]=_['intersection'](_0x5f4fb5['model'],_0x5f4fb5[_0x1f41('0x2f')]);_0x3fab24['attributes']=_[_0x1f41('0x31')](_0x5f4fb5['model'],qs['fields'](_0x5c4081[_0x1f41('0x2f')][_0x1f41('0x34')]));_0x3fab24['attributes']=_0x3fab24[_0x1f41('0x32')]['length']?_0x3fab24['attributes']:_0x5f4fb5[_0x1f41('0x33')];if(_0x5c4081[_0x1f41('0x2f')]['includeAll']){_0x3fab24[_0x1f41('0x42')]=[{'all':!![]}];}_0x3fab24=_[_0x1f41('0x39')]({},_0x3fab24,_0x5c4081[_0x1f41('0x3c')]);return db[_0x1f41('0x2b')]['find'](_0x3fab24)['then'](handleEntityNotFound(_0x1bedc6,null))[_0x1f41('0x22')](respondWithResult(_0x1bedc6,null))[_0x1f41('0x3e')](handleError(_0x1bedc6,null));};exports[_0x1f41('0x43')]=function(_0x4dd502,_0x37848f){return db[_0x1f41('0x2b')]['create'](_0x4dd502[_0x1f41('0x44')],{})['then'](respondWithResult(_0x37848f,0xc9))['catch'](handleError(_0x37848f,null));};exports[_0x1f41('0x21')]=function(_0x972597,_0x4764e6){if(_0x972597['body']['id']){delete _0x972597[_0x1f41('0x44')]['id'];}return db[_0x1f41('0x2b')][_0x1f41('0x45')]({'where':{'id':_0x972597[_0x1f41('0x40')]['id']}})[_0x1f41('0x22')](handleEntityNotFound(_0x4764e6,null))[_0x1f41('0x22')](saveUpdates(_0x972597['body'],null))['then'](respondWithResult(_0x4764e6,null))[_0x1f41('0x3e')](handleError(_0x4764e6,null));};exports['destroy']=function(_0x4d015a,_0x45eacb){return db[_0x1f41('0x2b')][_0x1f41('0x45')]({'where':{'id':_0x4d015a[_0x1f41('0x40')]['id']}})[_0x1f41('0x22')](handleEntityNotFound(_0x45eacb,null))['then'](removeEntity(_0x45eacb,null))['catch'](handleError(_0x45eacb,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 84612f5..a8421e0 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 _0x3f2b=['define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x266c69,_0xa8e09b){var _0x5f40b1=function(_0x462884){while(--_0x462884){_0x266c69['push'](_0x266c69['shift']());}};_0x5f40b1(++_0xa8e09b);}(_0x3f2b,0x9d));var _0xb3f2=function(_0x4a6949,_0x19f035){_0x4a6949=_0x4a6949-0x0;var _0x142277=_0x3f2b[_0x4a6949];return _0x142277;};'use strict';var _=require(_0xb3f2('0x0'));var util=require(_0xb3f2('0x1'));var logger=require(_0xb3f2('0x2'))(_0xb3f2('0x3'));var moment=require(_0xb3f2('0x4'));var BPromise=require(_0xb3f2('0x5'));var rp=require(_0xb3f2('0x6'));var fs=require('fs');var path=require(_0xb3f2('0x7'));var rimraf=require('rimraf');var config=require(_0xb3f2('0x8'));var attributes=require(_0xb3f2('0x9'));module[_0xb3f2('0xa')]=function(_0x58609b,_0x421be4){return _0x58609b[_0xb3f2('0xb')](_0xb3f2('0xc'),attributes,{'tableName':_0xb3f2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4eaf=['request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','bluebird'];(function(_0x4b9caa,_0x19a10d){var _0x19e42a=function(_0x4ddc69){while(--_0x4ddc69){_0x4b9caa['push'](_0x4b9caa['shift']());}};_0x19e42a(++_0x19a10d);}(_0x4eaf,0xce));var _0xf4ea=function(_0x3e0449,_0x12096d){_0x3e0449=_0x3e0449-0x0;var _0x26c9cc=_0x4eaf[_0x3e0449];return _0x26c9cc;};'use strict';var _=require(_0xf4ea('0x0'));var util=require('util');var logger=require(_0xf4ea('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf4ea('0x2'));var rp=require(_0xf4ea('0x3'));var fs=require('fs');var path=require(_0xf4ea('0x4'));var rimraf=require(_0xf4ea('0x5'));var config=require(_0xf4ea('0x6'));var attributes=require(_0xf4ea('0x7'));module[_0xf4ea('0x8')]=function(_0x48fc72,_0x1a928e){return _0x48fc72['define'](_0xf4ea('0x9'),attributes,{'tableName':_0xf4ea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 06a316c..e49a0fc 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x1bb832,_0x366797){_0x1bb832=_0x1bb832-0x0;var _0x38bc37=_0x7a54[_0x1bb832];return _0x38bc37;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x4f8fdd,_0x888dc4){_0x4f8fdd=_0x4f8fdd-0x0;var _0x1d058d=_0x7a54[_0x4f8fdd];return _0x1d058d;};'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 fda5717..b48d967 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 _0xa6b6=['../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','exports','multer','util','path','fs-extra','../../components/auth/service'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xa6b6,0x171));var _0x6a6b=function(_0x161587,_0x5c4528){_0x161587=_0x161587-0x0;var _0x293546=_0xa6b6[_0x161587];return _0x293546;};'use strict';var multer=require(_0x6a6b('0x0'));var util=require(_0x6a6b('0x1'));var path=require(_0x6a6b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6a6b('0x3'));var auth=require(_0x6a6b('0x4'));var interaction=require(_0x6a6b('0x5'));var config=require('../../config/environment');var controller=require(_0x6a6b('0x6'));router[_0x6a6b('0x7')]('/',auth[_0x6a6b('0x8')](),controller[_0x6a6b('0x9')]);router[_0x6a6b('0x7')](_0x6a6b('0xa'),auth[_0x6a6b('0x8')](),controller[_0x6a6b('0xb')]);router[_0x6a6b('0xc')]('/',auth[_0x6a6b('0x8')](),controller[_0x6a6b('0xd')]);router['put'](_0x6a6b('0xa'),auth['isAuthenticated'](),controller[_0x6a6b('0xe')]);router[_0x6a6b('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6a6b('0x10')]=router;
\ No newline at end of file
+var _0x195f=['exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post','create','put','destroy'];(function(_0xc8db6b,_0x320abd){var _0x12cb81=function(_0x417540){while(--_0x417540){_0xc8db6b['push'](_0xc8db6b['shift']());}};_0x12cb81(++_0x320abd);}(_0x195f,0xd1));var _0xf195=function(_0x47041d,_0x42153f){_0x47041d=_0x47041d-0x0;var _0x5022bd=_0x195f[_0x47041d];return _0x5022bd;};'use strict';var multer=require(_0xf195('0x0'));var util=require(_0xf195('0x1'));var path=require('path');var timeout=require(_0xf195('0x2'));var express=require('express');var router=express[_0xf195('0x3')]();var fs_extra=require(_0xf195('0x4'));var auth=require(_0xf195('0x5'));var interaction=require(_0xf195('0x6'));var config=require(_0xf195('0x7'));var controller=require('./analyticTreeReport.controller');router[_0xf195('0x8')]('/',auth[_0xf195('0x9')](),controller['index']);router[_0xf195('0x8')](_0xf195('0xa'),auth[_0xf195('0x9')](),controller['show']);router[_0xf195('0xb')]('/',auth[_0xf195('0x9')](),controller[_0xf195('0xc')]);router[_0xf195('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xf195('0xa'),auth[_0xf195('0x9')](),controller[_0xf195('0xe')]);module[_0xf195('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 41ad5e6..f431857 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 _0xecd5=['exports','STRING'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xecd5,0x110));var _0x5ecd=function(_0x32849f,_0x530722){_0x32849f=_0x32849f-0x0;var _0x2b34c7=_0xecd5[_0x32849f];return _0x2b34c7;};'use strict';var Sequelize=require('sequelize');module[_0x5ecd('0x0')]={'name':{'type':Sequelize[_0x5ecd('0x1')]},'basename':{'type':Sequelize[_0x5ecd('0x1')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8ff9=['exports','STRING','sequelize'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8ff9,0x188));var _0x98ff=function(_0x38b991,_0xa42a39){_0x38b991=_0x38b991-0x0;var _0x833c5e=_0x8ff9[_0x38b991];return _0x833c5e;};'use strict';var Sequelize=require(_0x98ff('0x0'));module[_0x98ff('0x1')]={'name':{'type':Sequelize[_0x98ff('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x98ff('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 32cbcd4..93811c3 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 _0x27bf=['status','end','json','offset','limit','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','Attachment','include','findAll','catch','params','includeAll','find','clone','rawAttributes','get','omit','createdAt','updatedAt','create','body','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x2dffb4,_0x4bbbf3){var _0x4174ec=function(_0x13ec24){while(--_0x13ec24){_0x2dffb4['push'](_0x2dffb4['shift']());}};_0x4174ec(++_0x4bbbf3);}(_0x27bf,0x14e));var _0xf27b=function(_0xbe46a1,_0x496093){_0xbe46a1=_0xbe46a1-0x0;var _0x399489=_0x27bf[_0xbe46a1];return _0x399489;};'use strict';var emlformat=require(_0xf27b('0x0'));var rimraf=require(_0xf27b('0x1'));var zipdir=require(_0xf27b('0x2'));var jsonpatch=require(_0xf27b('0x3'));var rp=require('request-promise');var moment=require(_0xf27b('0x4'));var BPromise=require(_0xf27b('0x5'));var Mustache=require(_0xf27b('0x6'));var util=require(_0xf27b('0x7'));var path=require(_0xf27b('0x8'));var sox=require(_0xf27b('0x9'));var csv=require(_0xf27b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf27b('0xb'));var squel=require(_0xf27b('0xc'));var crypto=require(_0xf27b('0xd'));var jsforce=require(_0xf27b('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf27b('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf27b('0x10'));var qs=require(_0xf27b('0x11'));var as=require(_0xf27b('0x12'));var hardwareService=require(_0xf27b('0x13'));var logger=require(_0xf27b('0x14'))(_0xf27b('0x15'));var utils=require(_0xf27b('0x16'));var config=require(_0xf27b('0x17'));var licenseUtil=require(_0xf27b('0x18'));var db=require(_0xf27b('0x19'))['db'];function respondWithStatusCode(_0x1cffb7,_0x224efc){_0x224efc=_0x224efc||0xcc;return function(_0x23403c){if(_0x23403c){return _0x1cffb7['sendStatus'](_0x224efc);}return _0x1cffb7[_0xf27b('0x1a')](_0x224efc)[_0xf27b('0x1b')]();};}function respondWithResult(_0x199d02,_0x327fc8){_0x327fc8=_0x327fc8||0xc8;return function(_0x21402b){if(_0x21402b){return _0x199d02[_0xf27b('0x1a')](_0x327fc8)[_0xf27b('0x1c')](_0x21402b);}};}function respondWithFilteredResult(_0x510fc2,_0x214d76){return function(_0x58dd31){if(_0x58dd31){var _0x19ee90=typeof _0x214d76[_0xf27b('0x1d')]==='undefined'&&typeof _0x214d76[_0xf27b('0x1e')]==='undefined';var _0x6a1766=_0x58dd31[_0xf27b('0x1f')];var _0x249e9b=_0x19ee90?0x0:_0x214d76['offset'];var _0x1e22be=_0x19ee90?_0x58dd31[_0xf27b('0x1f')]:_0x214d76['offset']+_0x214d76[_0xf27b('0x1e')];var _0x4175cd;if(_0x1e22be>=_0x6a1766){_0x1e22be=_0x6a1766;_0x4175cd=0xc8;}else{_0x4175cd=0xce;}_0x510fc2[_0xf27b('0x1a')](_0x4175cd);return _0x510fc2['set'](_0xf27b('0x20'),_0x249e9b+'-'+_0x1e22be+'/'+_0x6a1766)['json'](_0x58dd31);}return null;};}function patchUpdates(_0x5c9f70){return function(_0x2b2cf3){try{jsonpatch[_0xf27b('0x21')](_0x2b2cf3,_0x5c9f70,!![]);}catch(_0xe8eeb){return BPromise[_0xf27b('0x22')](_0xe8eeb);}return _0x2b2cf3['save']();};}function saveUpdates(_0x25af00,_0x431ba4){return function(_0x5edcc7){if(_0x5edcc7){return _0x5edcc7[_0xf27b('0x23')](_0x25af00)[_0xf27b('0x24')](function(_0x53ab3a){return _0x53ab3a;});}return null;};}function removeEntity(_0x30bdcd,_0x66e78e){return function(_0x2446dd){if(_0x2446dd){return _0x2446dd[_0xf27b('0x25')]()['then'](function(){_0x30bdcd[_0xf27b('0x1a')](0xcc)[_0xf27b('0x1b')]();});}};}function handleEntityNotFound(_0x31c1ae,_0x292358){return function(_0x311994){if(!_0x311994){_0x31c1ae[_0xf27b('0x26')](0x194);}return _0x311994;};}function handleError(_0x2e6355,_0x3291ca){_0x3291ca=_0x3291ca||0x1f4;return function(_0x4251bb){logger[_0xf27b('0x27')](_0x4251bb[_0xf27b('0x28')]);if(_0x4251bb[_0xf27b('0x29')]){delete _0x4251bb['name'];}_0x2e6355[_0xf27b('0x1a')](_0x3291ca)[_0xf27b('0x2a')](_0x4251bb);};}exports[_0xf27b('0x2b')]=function(_0x2a0f63,_0xd77301){var _0x40b1c4={},_0x58f3b9={},_0xfe1fc4={'count':0x0,'rows':[]};var _0x30cd3d=_[_0xf27b('0x2c')](db['Attachment']['rawAttributes'],function(_0x1cad44){return{'name':_0x1cad44[_0xf27b('0x2d')],'type':_0x1cad44[_0xf27b('0x2e')]['key']};});_0x58f3b9['model']=_[_0xf27b('0x2c')](_0x30cd3d,'name');_0x58f3b9[_0xf27b('0x2f')]=_[_0xf27b('0x30')](_0x2a0f63[_0xf27b('0x2f')]);_0x58f3b9[_0xf27b('0x31')]=_[_0xf27b('0x32')](_0x58f3b9[_0xf27b('0x33')],_0x58f3b9[_0xf27b('0x2f')]);_0x40b1c4[_0xf27b('0x34')]=_[_0xf27b('0x32')](_0x58f3b9['model'],qs[_0xf27b('0x35')](_0x2a0f63[_0xf27b('0x2f')]['fields']));_0x40b1c4[_0xf27b('0x34')]=_0x40b1c4[_0xf27b('0x34')][_0xf27b('0x36')]?_0x40b1c4[_0xf27b('0x34')]:_0x58f3b9[_0xf27b('0x33')];if(!_0x2a0f63[_0xf27b('0x2f')][_0xf27b('0x37')](_0xf27b('0x38'))){_0x40b1c4[_0xf27b('0x1e')]=qs[_0xf27b('0x1e')](_0x2a0f63['query'][_0xf27b('0x1e')]);_0x40b1c4[_0xf27b('0x1d')]=qs[_0xf27b('0x1d')](_0x2a0f63['query'][_0xf27b('0x1d')]);}_0x40b1c4['order']=qs[_0xf27b('0x39')](_0x2a0f63[_0xf27b('0x2f')][_0xf27b('0x39')]);_0x40b1c4[_0xf27b('0x3a')]=qs[_0xf27b('0x31')](_['pick'](_0x2a0f63[_0xf27b('0x2f')],_0x58f3b9['filters']),_0x30cd3d);if(_0x2a0f63[_0xf27b('0x2f')][_0xf27b('0x3b')]){_0x40b1c4[_0xf27b('0x3a')]=_['merge'](_0x40b1c4[_0xf27b('0x3a')],{'$or':_[_0xf27b('0x2c')](_0x30cd3d,function(_0x41058c){if(_0x41058c['type']!==_0xf27b('0x3c')){var _0xe51d9e={};_0xe51d9e[_0x41058c['name']]={'$like':'%'+_0x2a0f63[_0xf27b('0x2f')][_0xf27b('0x3b')]+'%'};return _0xe51d9e;}})});}_0x40b1c4=_[_0xf27b('0x3d')]({},_0x40b1c4,_0x2a0f63[_0xf27b('0x3e')]);var _0x4f3515={'where':_0x40b1c4[_0xf27b('0x3a')]};return db[_0xf27b('0x3f')]['count'](_0x4f3515)[_0xf27b('0x24')](function(_0x1b8bd2){_0xfe1fc4[_0xf27b('0x1f')]=_0x1b8bd2;if(_0x2a0f63[_0xf27b('0x2f')]['includeAll']){_0x40b1c4[_0xf27b('0x40')]=[{'all':!![]}];}return db['Attachment'][_0xf27b('0x41')](_0x40b1c4);})[_0xf27b('0x24')](function(_0x36ee8a){_0xfe1fc4['rows']=_0x36ee8a;return _0xfe1fc4;})[_0xf27b('0x24')](respondWithFilteredResult(_0xd77301,_0x40b1c4))[_0xf27b('0x42')](handleError(_0xd77301,null));};exports['show']=function(_0x5364f2,_0x59ca9c){var _0x46931e={'raw':!![],'where':{'id':_0x5364f2[_0xf27b('0x43')]['id']}},_0x343212={};_0x343212[_0xf27b('0x33')]=_[_0xf27b('0x30')](db[_0xf27b('0x3f')]['rawAttributes']);_0x343212[_0xf27b('0x2f')]=_['keys'](_0x5364f2[_0xf27b('0x2f')]);_0x343212[_0xf27b('0x31')]=_[_0xf27b('0x32')](_0x343212['model'],_0x343212[_0xf27b('0x2f')]);_0x46931e[_0xf27b('0x34')]=_[_0xf27b('0x32')](_0x343212['model'],qs['fields'](_0x5364f2[_0xf27b('0x2f')]['fields']));_0x46931e[_0xf27b('0x34')]=_0x46931e['attributes'][_0xf27b('0x36')]?_0x46931e[_0xf27b('0x34')]:_0x343212[_0xf27b('0x33')];if(_0x5364f2[_0xf27b('0x2f')][_0xf27b('0x44')]){_0x46931e[_0xf27b('0x40')]=[{'all':!![]}];}_0x46931e=_[_0xf27b('0x3d')]({},_0x46931e,_0x5364f2[_0xf27b('0x3e')]);return db[_0xf27b('0x3f')][_0xf27b('0x45')](_0x46931e)['then'](handleEntityNotFound(_0x59ca9c,null))[_0xf27b('0x24')](respondWithResult(_0x59ca9c,null))[_0xf27b('0x42')](handleError(_0x59ca9c,null));};exports[_0xf27b('0x46')]=function(_0x3951a2,_0x24912){var _0x5acff9={'where':{'id':_0x3951a2[_0xf27b('0x43')]['id']}},_0x203b6e={};_0x203b6e['model']=_[_0xf27b('0x30')](db[_0xf27b('0x3f')][_0xf27b('0x47')]);_0x5acff9[_0xf27b('0x34')]=_[_0xf27b('0x32')](_0x203b6e[_0xf27b('0x33')],qs[_0xf27b('0x35')](_0x3951a2[_0xf27b('0x2f')]['fields']));_0x5acff9[_0xf27b('0x34')]=_0x5acff9[_0xf27b('0x34')][_0xf27b('0x36')]?_0x5acff9['attributes']:_0x203b6e['model'];if(_0x3951a2[_0xf27b('0x2f')]['includeAll']){_0x5acff9[_0xf27b('0x40')]=[{'all':!![]}];}_0x5acff9=_[_0xf27b('0x3d')]({},_0x5acff9,_0x3951a2[_0xf27b('0x3e')]);return db['Attachment']['find'](_0x5acff9)[_0xf27b('0x24')](handleEntityNotFound(_0x24912,null))[_0xf27b('0x24')](function(_0x3de91d){if(_0x3de91d){var _0x267f1f=_0x3de91d[_0xf27b('0x48')]({'plain':!![]});_0x267f1f=qs[_0xf27b('0x49')](_0x267f1f,['id',_0xf27b('0x4a'),'updatedAt']);_0x3951a2['body']=_[_0xf27b('0x49')](_0x3951a2['body'],['id',_0xf27b('0x4a'),_0xf27b('0x4b')]);return db[_0xf27b('0x3f')][_0xf27b('0x4c')](_['merge'](_0x267f1f,_0x3951a2[_0xf27b('0x4d')]),{'include':_0x3951a2['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0xf27b('0x24')](respondWithResult(_0x24912,0xc9))[_0xf27b('0x42')](handleError(_0x24912,null));};exports[_0xf27b('0x23')]=function(_0x39b22e,_0x29e462){if(_0x39b22e[_0xf27b('0x4d')]['id']){delete _0x39b22e['body']['id'];}return db[_0xf27b('0x3f')][_0xf27b('0x45')]({'where':{'id':_0x39b22e['params']['id']}})['then'](handleEntityNotFound(_0x29e462,null))[_0xf27b('0x24')](saveUpdates(_0x39b22e['body'],null))[_0xf27b('0x24')](respondWithResult(_0x29e462,null))[_0xf27b('0x42')](handleError(_0x29e462,null));};exports['destroy']=function(_0x5c5267,_0x4a3f95){return db[_0xf27b('0x3f')][_0xf27b('0x45')]({'where':{'id':_0x5c5267[_0xf27b('0x43')]['id']}})[_0xf27b('0x24')](handleEntityNotFound(_0x4a3f95,null))[_0xf27b('0x24')](removeEntity(_0x4a3f95,null))['catch'](handleError(_0x4a3f95,null));};exports[_0xf27b('0x4c')]=function(_0x5cbe1e,_0xe25b4c,_0x51d88a){_0x5cbe1e['body'][_0xf27b('0x29')]=_0x5cbe1e[_0xf27b('0x4e')][_0xf27b('0x4f')];_0x5cbe1e['body'][_0xf27b('0x50')]=_0x5cbe1e[_0xf27b('0x4e')][_0xf27b('0x51')];_0x5cbe1e[_0xf27b('0x4d')][_0xf27b('0x2e')]=_0x5cbe1e[_0xf27b('0x4e')][_0xf27b('0x52')];return db['Attachment'][_0xf27b('0x4c')](_0x5cbe1e[_0xf27b('0x4d')])[_0xf27b('0x24')](respondWithResult(_0xe25b4c,0xc9))[_0xf27b('0x42')](handleError(_0xe25b4c,null));};exports['download']=function(_0x3cff39,_0x3fdf2c,_0x1e3abb){return db[_0xf27b('0x3f')][_0xf27b('0x53')]({'where':{'id':_0x3cff39['params']['id']},'raw':!![]})[_0xf27b('0x24')](handleEntityNotFound(_0x3fdf2c,null))[_0xf27b('0x24')](function(_0xc48d01){if(_0xc48d01){var _0x64731f=_0xc48d01[_0xf27b('0x54')]!==null;var _0xd8ddae=path['join'](config[_0xf27b('0x55')],_0xf27b('0x56'));if(_0x64731f){_0xd8ddae=path[_0xf27b('0x57')](_0xd8ddae,_0xf27b('0x58'));}var _0x36d8c5=path[_0xf27b('0x57')](_0xd8ddae,_0xc48d01[_0xf27b('0x50')]);return _0x3fdf2c[_0xf27b('0x59')](_0x36d8c5);}})['catch'](handleError(_0x3fdf2c,null));};
\ No newline at end of file
+var _0x5a36=['include','findAll','rows','catch','params','clone','find','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','end','error','name','send','index','map','Attachment','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll'];(function(_0x19d6a1,_0x3ad861){var _0x5c69f4=function(_0x49fa5e){while(--_0x49fa5e){_0x19d6a1['push'](_0x19d6a1['shift']());}};_0x5c69f4(++_0x3ad861);}(_0x5a36,0x190));var _0x65a3=function(_0x5cccde,_0x4c6505){_0x5cccde=_0x5cccde-0x0;var _0x40a5b1=_0x5a36[_0x5cccde];return _0x40a5b1;};'use strict';var emlformat=require(_0x65a3('0x0'));var rimraf=require(_0x65a3('0x1'));var zipdir=require(_0x65a3('0x2'));var jsonpatch=require(_0x65a3('0x3'));var rp=require(_0x65a3('0x4'));var moment=require(_0x65a3('0x5'));var BPromise=require(_0x65a3('0x6'));var Mustache=require('mustache');var util=require(_0x65a3('0x7'));var path=require(_0x65a3('0x8'));var sox=require(_0x65a3('0x9'));var csv=require('to-csv');var ejs=require(_0x65a3('0xa'));var fs=require('fs');var fs_extra=require(_0x65a3('0xb'));var _=require(_0x65a3('0xc'));var squel=require(_0x65a3('0xd'));var crypto=require(_0x65a3('0xe'));var jsforce=require(_0x65a3('0xf'));var deskjs=require(_0x65a3('0x10'));var toCsv=require(_0x65a3('0x11'));var querystring=require(_0x65a3('0x12'));var Papa=require('papaparse');var Redis=require(_0x65a3('0x13'));var authService=require(_0x65a3('0x14'));var qs=require(_0x65a3('0x15'));var as=require(_0x65a3('0x16'));var hardwareService=require(_0x65a3('0x17'));var logger=require('../../config/logger')(_0x65a3('0x18'));var utils=require(_0x65a3('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x65a3('0x1a'));var db=require(_0x65a3('0x1b'))['db'];function respondWithStatusCode(_0x37db5e,_0x29abcb){_0x29abcb=_0x29abcb||0xcc;return function(_0x42da5a){if(_0x42da5a){return _0x37db5e[_0x65a3('0x1c')](_0x29abcb);}return _0x37db5e[_0x65a3('0x1d')](_0x29abcb)['end']();};}function respondWithResult(_0x298810,_0x2c053c){_0x2c053c=_0x2c053c||0xc8;return function(_0x175018){if(_0x175018){return _0x298810[_0x65a3('0x1d')](_0x2c053c)[_0x65a3('0x1e')](_0x175018);}};}function respondWithFilteredResult(_0x5270e5,_0x14fed2){return function(_0x181248){if(_0x181248){var _0x1e6003=typeof _0x14fed2[_0x65a3('0x1f')]===_0x65a3('0x20')&&typeof _0x14fed2[_0x65a3('0x21')]===_0x65a3('0x20');var _0x134d48=_0x181248[_0x65a3('0x22')];var _0x19a5f5=_0x1e6003?0x0:_0x14fed2[_0x65a3('0x1f')];var _0xc2426b=_0x1e6003?_0x181248['count']:_0x14fed2['offset']+_0x14fed2['limit'];var _0x4f22c5;if(_0xc2426b>=_0x134d48){_0xc2426b=_0x134d48;_0x4f22c5=0xc8;}else{_0x4f22c5=0xce;}_0x5270e5[_0x65a3('0x1d')](_0x4f22c5);return _0x5270e5[_0x65a3('0x23')](_0x65a3('0x24'),_0x19a5f5+'-'+_0xc2426b+'/'+_0x134d48)['json'](_0x181248);}return null;};}function patchUpdates(_0x43aaff){return function(_0x3f13ae){try{jsonpatch[_0x65a3('0x25')](_0x3f13ae,_0x43aaff,!![]);}catch(_0x30033a){return BPromise[_0x65a3('0x26')](_0x30033a);}return _0x3f13ae['save']();};}function saveUpdates(_0x44bb27,_0x18e22f){return function(_0x4fba41){if(_0x4fba41){return _0x4fba41[_0x65a3('0x27')](_0x44bb27)['then'](function(_0x5ebb0d){return _0x5ebb0d;});}return null;};}function removeEntity(_0x1fb302,_0x514b9c){return function(_0x53a129){if(_0x53a129){return _0x53a129[_0x65a3('0x28')]()[_0x65a3('0x29')](function(){_0x1fb302['status'](0xcc)[_0x65a3('0x2a')]();});}};}function handleEntityNotFound(_0x27a1cd,_0x52e5a8){return function(_0x350cf5){if(!_0x350cf5){_0x27a1cd[_0x65a3('0x1c')](0x194);}return _0x350cf5;};}function handleError(_0x3ecd82,_0x1c888b){_0x1c888b=_0x1c888b||0x1f4;return function(_0x534c8f){logger[_0x65a3('0x2b')](_0x534c8f['stack']);if(_0x534c8f[_0x65a3('0x2c')]){delete _0x534c8f[_0x65a3('0x2c')];}_0x3ecd82[_0x65a3('0x1d')](_0x1c888b)[_0x65a3('0x2d')](_0x534c8f);};}exports[_0x65a3('0x2e')]=function(_0x4034df,_0x4e9333){var _0x304f15={},_0x392c4a={},_0x443b2f={'count':0x0,'rows':[]};var _0x1e0e72=_[_0x65a3('0x2f')](db[_0x65a3('0x30')][_0x65a3('0x31')],function(_0xa344c2){return{'name':_0xa344c2[_0x65a3('0x32')],'type':_0xa344c2[_0x65a3('0x33')]['key']};});_0x392c4a[_0x65a3('0x34')]=_[_0x65a3('0x2f')](_0x1e0e72,'name');_0x392c4a[_0x65a3('0x35')]=_[_0x65a3('0x36')](_0x4034df['query']);_0x392c4a[_0x65a3('0x37')]=_[_0x65a3('0x38')](_0x392c4a[_0x65a3('0x34')],_0x392c4a['query']);_0x304f15[_0x65a3('0x39')]=_['intersection'](_0x392c4a['model'],qs[_0x65a3('0x3a')](_0x4034df['query'][_0x65a3('0x3a')]));_0x304f15['attributes']=_0x304f15[_0x65a3('0x39')][_0x65a3('0x3b')]?_0x304f15[_0x65a3('0x39')]:_0x392c4a[_0x65a3('0x34')];if(!_0x4034df[_0x65a3('0x35')]['hasOwnProperty'](_0x65a3('0x3c'))){_0x304f15['limit']=qs[_0x65a3('0x21')](_0x4034df[_0x65a3('0x35')][_0x65a3('0x21')]);_0x304f15[_0x65a3('0x1f')]=qs[_0x65a3('0x1f')](_0x4034df['query'][_0x65a3('0x1f')]);}_0x304f15[_0x65a3('0x3d')]=qs[_0x65a3('0x3e')](_0x4034df[_0x65a3('0x35')][_0x65a3('0x3e')]);_0x304f15['where']=qs[_0x65a3('0x37')](_[_0x65a3('0x3f')](_0x4034df[_0x65a3('0x35')],_0x392c4a['filters']),_0x1e0e72);if(_0x4034df[_0x65a3('0x35')][_0x65a3('0x40')]){_0x304f15[_0x65a3('0x41')]=_[_0x65a3('0x42')](_0x304f15[_0x65a3('0x41')],{'$or':_['map'](_0x1e0e72,function(_0x367853){if(_0x367853[_0x65a3('0x33')]!==_0x65a3('0x43')){var _0x47f94d={};_0x47f94d[_0x367853[_0x65a3('0x2c')]]={'$like':'%'+_0x4034df[_0x65a3('0x35')][_0x65a3('0x40')]+'%'};return _0x47f94d;}})});}_0x304f15=_[_0x65a3('0x42')]({},_0x304f15,_0x4034df[_0x65a3('0x44')]);var _0x5a4e3c={'where':_0x304f15[_0x65a3('0x41')]};return db[_0x65a3('0x30')][_0x65a3('0x22')](_0x5a4e3c)[_0x65a3('0x29')](function(_0x4984a3){_0x443b2f[_0x65a3('0x22')]=_0x4984a3;if(_0x4034df['query'][_0x65a3('0x45')]){_0x304f15[_0x65a3('0x46')]=[{'all':!![]}];}return db[_0x65a3('0x30')][_0x65a3('0x47')](_0x304f15);})['then'](function(_0xd7fd45){_0x443b2f[_0x65a3('0x48')]=_0xd7fd45;return _0x443b2f;})[_0x65a3('0x29')](respondWithFilteredResult(_0x4e9333,_0x304f15))[_0x65a3('0x49')](handleError(_0x4e9333,null));};exports['show']=function(_0xc43a18,_0x1f581f){var _0x17ee29={'raw':!![],'where':{'id':_0xc43a18[_0x65a3('0x4a')]['id']}},_0x4b9848={};_0x4b9848[_0x65a3('0x34')]=_[_0x65a3('0x36')](db[_0x65a3('0x30')][_0x65a3('0x31')]);_0x4b9848[_0x65a3('0x35')]=_[_0x65a3('0x36')](_0xc43a18[_0x65a3('0x35')]);_0x4b9848['filters']=_['intersection'](_0x4b9848[_0x65a3('0x34')],_0x4b9848[_0x65a3('0x35')]);_0x17ee29['attributes']=_[_0x65a3('0x38')](_0x4b9848[_0x65a3('0x34')],qs[_0x65a3('0x3a')](_0xc43a18[_0x65a3('0x35')]['fields']));_0x17ee29[_0x65a3('0x39')]=_0x17ee29[_0x65a3('0x39')][_0x65a3('0x3b')]?_0x17ee29[_0x65a3('0x39')]:_0x4b9848[_0x65a3('0x34')];if(_0xc43a18[_0x65a3('0x35')][_0x65a3('0x45')]){_0x17ee29[_0x65a3('0x46')]=[{'all':!![]}];}_0x17ee29=_['merge']({},_0x17ee29,_0xc43a18['options']);return db[_0x65a3('0x30')]['find'](_0x17ee29)['then'](handleEntityNotFound(_0x1f581f,null))[_0x65a3('0x29')](respondWithResult(_0x1f581f,null))[_0x65a3('0x49')](handleError(_0x1f581f,null));};exports[_0x65a3('0x4b')]=function(_0x33df7c,_0x2c3519){var _0x516d12={'where':{'id':_0x33df7c['params']['id']}},_0x572ad7={};_0x572ad7[_0x65a3('0x34')]=_[_0x65a3('0x36')](db[_0x65a3('0x30')]['rawAttributes']);_0x516d12[_0x65a3('0x39')]=_['intersection'](_0x572ad7[_0x65a3('0x34')],qs[_0x65a3('0x3a')](_0x33df7c[_0x65a3('0x35')][_0x65a3('0x3a')]));_0x516d12[_0x65a3('0x39')]=_0x516d12[_0x65a3('0x39')][_0x65a3('0x3b')]?_0x516d12[_0x65a3('0x39')]:_0x572ad7[_0x65a3('0x34')];if(_0x33df7c['query']['includeAll']){_0x516d12[_0x65a3('0x46')]=[{'all':!![]}];}_0x516d12=_[_0x65a3('0x42')]({},_0x516d12,_0x33df7c[_0x65a3('0x44')]);return db[_0x65a3('0x30')][_0x65a3('0x4c')](_0x516d12)[_0x65a3('0x29')](handleEntityNotFound(_0x2c3519,null))[_0x65a3('0x29')](function(_0x2fba1e){if(_0x2fba1e){var _0x32683f=_0x2fba1e['get']({'plain':!![]});_0x32683f=qs[_0x65a3('0x4d')](_0x32683f,['id',_0x65a3('0x4e'),_0x65a3('0x4f')]);_0x33df7c[_0x65a3('0x50')]=_[_0x65a3('0x4d')](_0x33df7c[_0x65a3('0x50')],['id',_0x65a3('0x4e'),_0x65a3('0x4f')]);return db[_0x65a3('0x30')]['create'](_[_0x65a3('0x42')](_0x32683f,_0x33df7c[_0x65a3('0x50')]),{'include':_0x33df7c[_0x65a3('0x35')][_0x65a3('0x45')]?[{'all':!![]}]:undefined});}})[_0x65a3('0x29')](respondWithResult(_0x2c3519,0xc9))[_0x65a3('0x49')](handleError(_0x2c3519,null));};exports[_0x65a3('0x27')]=function(_0x155827,_0xde8879){if(_0x155827['body']['id']){delete _0x155827[_0x65a3('0x50')]['id'];}return db['Attachment'][_0x65a3('0x4c')]({'where':{'id':_0x155827[_0x65a3('0x4a')]['id']}})[_0x65a3('0x29')](handleEntityNotFound(_0xde8879,null))[_0x65a3('0x29')](saveUpdates(_0x155827[_0x65a3('0x50')],null))['then'](respondWithResult(_0xde8879,null))[_0x65a3('0x49')](handleError(_0xde8879,null));};exports['destroy']=function(_0x4f583d,_0x39983f){return db[_0x65a3('0x30')][_0x65a3('0x4c')]({'where':{'id':_0x4f583d[_0x65a3('0x4a')]['id']}})[_0x65a3('0x29')](handleEntityNotFound(_0x39983f,null))[_0x65a3('0x29')](removeEntity(_0x39983f,null))[_0x65a3('0x49')](handleError(_0x39983f,null));};exports[_0x65a3('0x51')]=function(_0x293cfd,_0x37304d,_0x22e6d1){_0x293cfd[_0x65a3('0x50')][_0x65a3('0x2c')]=_0x293cfd[_0x65a3('0x52')][_0x65a3('0x53')];_0x293cfd[_0x65a3('0x50')][_0x65a3('0x54')]=_0x293cfd['file'][_0x65a3('0x55')];_0x293cfd[_0x65a3('0x50')][_0x65a3('0x33')]=_0x293cfd[_0x65a3('0x52')][_0x65a3('0x56')];return db[_0x65a3('0x30')][_0x65a3('0x51')](_0x293cfd[_0x65a3('0x50')])[_0x65a3('0x29')](respondWithResult(_0x37304d,0xc9))[_0x65a3('0x49')](handleError(_0x37304d,null));};exports[_0x65a3('0x57')]=function(_0x504082,_0x881531,_0x5c8404){return db['Attachment'][_0x65a3('0x58')]({'where':{'id':_0x504082[_0x65a3('0x4a')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x881531,null))['then'](function(_0x4c6bb5){if(_0x4c6bb5){var _0x4d1781=_0x4c6bb5[_0x65a3('0x59')]!==null;var _0x3c1f56=path['join'](config[_0x65a3('0x5a')],_0x65a3('0x5b'));if(_0x4d1781){_0x3c1f56=path[_0x65a3('0x5c')](_0x3c1f56,_0x65a3('0x5d'));}var _0x23eb4e=path[_0x65a3('0x5c')](_0x3c1f56,_0x4c6bb5[_0x65a3('0x54')]);return _0x881531[_0x65a3('0x57')](_0x23eb4e);}})[_0x65a3('0x49')](handleError(_0x881531,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 0ec28c2..006ef89 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 _0x1806=['bluebird','path','rimraf','./attachment.attributes','exports','define','Attachment','attachments','../../config/logger','moment'];(function(_0x4536a5,_0x4cbae1){var _0x4ed53a=function(_0x194805){while(--_0x194805){_0x4536a5['push'](_0x4536a5['shift']());}};_0x4ed53a(++_0x4cbae1);}(_0x1806,0x9e));var _0x6180=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1806[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6180('0x0'))('api');var moment=require(_0x6180('0x1'));var BPromise=require(_0x6180('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6180('0x3'));var rimraf=require(_0x6180('0x4'));var config=require('../../config/environment');var attributes=require(_0x6180('0x5'));module[_0x6180('0x6')]=function(_0x2d63f4,_0x4eb429){return _0x2d63f4[_0x6180('0x7')](_0x6180('0x8'),attributes,{'tableName':_0x6180('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x32e8=['define','Attachment','attachments','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports'];(function(_0x1c2f29,_0x5a2668){var _0x258465=function(_0x30332f){while(--_0x30332f){_0x1c2f29['push'](_0x1c2f29['shift']());}};_0x258465(++_0x5a2668);}(_0x32e8,0xb9));var _0x832e=function(_0x555655,_0x2e5494){_0x555655=_0x555655-0x0;var _0x11bd8b=_0x32e8[_0x555655];return _0x11bd8b;};'use strict';var _=require(_0x832e('0x0'));var util=require(_0x832e('0x1'));var logger=require('../../config/logger')(_0x832e('0x2'));var moment=require(_0x832e('0x3'));var BPromise=require(_0x832e('0x4'));var rp=require(_0x832e('0x5'));var fs=require('fs');var path=require(_0x832e('0x6'));var rimraf=require(_0x832e('0x7'));var config=require(_0x832e('0x8'));var attributes=require(_0x832e('0x9'));module[_0x832e('0xa')]=function(_0x52d185,_0x1ddbd4){return _0x52d185[_0x832e('0xb')](_0x832e('0xc'),attributes,{'tableName':_0x832e('0xd'),'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 516f4ad..6e27d09 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 _0x9567=['../../config/utils','../../config/logger','../../config/environment','client','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateAttachment','create','options','stringify','lodash','util','moment','bluebird','randomstring'];(function(_0x4bbb84,_0x32d824){var _0x279ef5=function(_0x52f376){while(--_0x52f376){_0x4bbb84['push'](_0x4bbb84['shift']());}};_0x279ef5(++_0x32d824);}(_0x9567,0xdc));var _0x7956=function(_0x39cf69,_0x1ddc96){_0x39cf69=_0x39cf69-0x0;var _0x4c0fa6=_0x9567[_0x39cf69];return _0x4c0fa6;};'use strict';var _=require(_0x7956('0x0'));var util=require(_0x7956('0x1'));var moment=require(_0x7956('0x2'));var BPromise=require(_0x7956('0x3'));var rs=require(_0x7956('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7956('0x5'));var logger=require(_0x7956('0x6'))('rpc');var config=require(_0x7956('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7956('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1819b6,_0x31b50d,_0x48b2b3){return new BPromise(function(_0x3c213a,_0x50038a){return client[_0x7956('0x9')](_0x1819b6,_0x48b2b3)[_0x7956('0xa')](function(_0x53310c){logger[_0x7956('0xb')](_0x7956('0xc'),_0x31b50d,'request\x20sent');logger[_0x7956('0xd')](_0x7956('0xe'),_0x31b50d,_0x7956('0xf'),JSON['stringify'](_0x53310c));if(_0x53310c[_0x7956('0x10')]){if(_0x53310c[_0x7956('0x10')][_0x7956('0x11')]===0x1f4){logger[_0x7956('0x10')]('Attachment,\x20%s,\x20%s',_0x31b50d,_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);return _0x50038a(_0x53310c[_0x7956('0x10')]['message']);}logger[_0x7956('0x10')](_0x7956('0xc'),_0x31b50d,_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);return _0x3c213a(_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);}else{logger[_0x7956('0xb')](_0x7956('0xc'),_0x31b50d,_0x7956('0xf'));_0x3c213a(_0x53310c[_0x7956('0x13')][_0x7956('0x12')]);}})[_0x7956('0x14')](function(_0x18ae51){logger[_0x7956('0x10')](_0x7956('0xc'),_0x31b50d,_0x18ae51);_0x50038a(_0x18ae51);});});}exports[_0x7956('0x15')]=function(_0x5e6b90){var _0x5c3afb=this;return new Promise(function(_0x10b29c,_0x811122){return db['Attachment'][_0x7956('0x16')](_0x5e6b90['body'],{'raw':_0x5e6b90[_0x7956('0x17')]?_0x5e6b90[_0x7956('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x7956('0xa')](function(_0x2e31cd){logger[_0x7956('0xb')]('CreateAttachment',_0x5e6b90);logger[_0x7956('0xd')]('CreateAttachment',_0x5e6b90,JSON[_0x7956('0x18')](_0x2e31cd));_0x10b29c(_0x2e31cd);})['catch'](function(_0x427500){logger[_0x7956('0x10')](_0x7956('0x15'),_0x427500[_0x7956('0x12')],_0x5e6b90);_0x811122(_0x5c3afb['error'](0x1f4,_0x427500[_0x7956('0x12')]));});});};
\ No newline at end of file
+var _0x1be1=['Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateAttachment','body','options','raw','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Attachment,\x20%s,\x20%s','debug'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x1be1,0x192));var _0x11be=function(_0x417465,_0xd9f07e){_0x417465=_0x417465-0x0;var _0x2ef918=_0x1be1[_0x417465];return _0x2ef918;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x11be('0x0'));var BPromise=require(_0x11be('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11be('0x2'));var db=require(_0x11be('0x3'))['db'];var utils=require(_0x11be('0x4'));var logger=require(_0x11be('0x5'))('rpc');var config=require(_0x11be('0x6'));var jayson=require(_0x11be('0x7'));var client=jayson[_0x11be('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfe8c62,_0x497730,_0x18f661){return new BPromise(function(_0x11fc15,_0x246772){return client[_0x11be('0x9')](_0xfe8c62,_0x18f661)[_0x11be('0xa')](function(_0x5f3d04){logger[_0x11be('0xb')](_0x11be('0xc'),_0x497730,'request\x20sent');logger[_0x11be('0xd')](_0x11be('0xe'),_0x497730,_0x11be('0xf'),JSON[_0x11be('0x10')](_0x5f3d04));if(_0x5f3d04['error']){if(_0x5f3d04[_0x11be('0x11')][_0x11be('0x12')]===0x1f4){logger[_0x11be('0x11')]('Attachment,\x20%s,\x20%s',_0x497730,_0x5f3d04[_0x11be('0x11')][_0x11be('0x13')]);return _0x246772(_0x5f3d04['error'][_0x11be('0x13')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x497730,_0x5f3d04['error']['message']);return _0x11fc15(_0x5f3d04['error']['message']);}else{logger['info'](_0x11be('0xc'),_0x497730,'request\x20sent');_0x11fc15(_0x5f3d04[_0x11be('0x14')][_0x11be('0x13')]);}})[_0x11be('0x15')](function(_0x216b8c){logger['error'](_0x11be('0xc'),_0x497730,_0x216b8c);_0x246772(_0x216b8c);});});}exports[_0x11be('0x16')]=function(_0x56ab61){var _0x299f45=this;return new Promise(function(_0xc3263c,_0x23aa5f){return db['Attachment']['create'](_0x56ab61[_0x11be('0x17')],{'raw':_0x56ab61[_0x11be('0x18')]?_0x56ab61[_0x11be('0x18')][_0x11be('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x12a5bd){logger[_0x11be('0xb')](_0x11be('0x16'),_0x56ab61);logger[_0x11be('0xd')](_0x11be('0x16'),_0x56ab61,JSON[_0x11be('0x10')](_0x12a5bd));_0xc3263c(_0x12a5bd);})[_0x11be('0x15')](function(_0x17678d){logger[_0x11be('0x11')](_0x11be('0x16'),_0x17678d['message'],_0x56ab61);_0x23aa5f(_0x299f45[_0x11be('0x11')](0x1f4,_0x17678d[_0x11be('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index e172257..d1d6a88 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3fe968,_0x4737f0){var _0x5241b5=function(_0x5b34c7){while(--_0x5b34c7){_0x3fe968['push'](_0x3fe968['shift']());}};_0x5241b5(++_0x4737f0);}(_0x2032,0xd9));var _0x2203=function(_0x5bcece,_0x3c0214){_0x5bcece=_0x5bcece-0x0;var _0x1092a2=_0x2032[_0x5bcece];return _0x1092a2;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
+var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x0b0e,0x187));var _0xe0b0=function(_0x12dd11,_0x52b882){_0x12dd11=_0x12dd11-0x0;var _0x3a502b=_0x0b0e[_0x12dd11];return _0x3a502b;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 7758574..7d64d22 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 _0x8411=['blocked','blockedAt','online','user','agent','add','minutes','clearBlockUser','getLicense','catch','status','send','message','ad-login','json','User','Strategy','moment','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','disabled'];(function(_0x126a75,_0x30d0fc){var _0x5b3ab9=function(_0x42382c){while(--_0x42382c){_0x126a75['push'](_0x126a75['shift']());}};_0x5b3ab9(++_0x30d0fc);}(_0x8411,0x118));var _0x1841=function(_0x4cba83,_0x81e88f){_0x4cba83=_0x4cba83-0x0;var _0x4375e0=_0x8411[_0x4cba83];return _0x4375e0;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')[_0x1841('0x0')];var moment=require(_0x1841('0x1'));var ActiveDirectory=require('activedirectory2');var BPromise=require('bluebird');var util=require(_0x1841('0x2'));var db=require(_0x1841('0x3'))['db'];var authService=require(_0x1841('0x4'));var utils=require(_0x1841('0x5'));var config=require(_0x1841('0x6'));var logger=require('../../config/logger')(_0x1841('0x7'));function isActiveDirectoryConfigured(_0x54a581){var _0x4224eb=![];if(typeof _0x54a581[_0x1841('0x8')]!==_0x1841('0x9')){_0x4224eb=_0x54a581[_0x1841('0x8')][_0x1841('0xa')]&&_0x54a581[_0x1841('0x8')][_0x1841('0xb')]&&_0x54a581[_0x1841('0x8')][_0x1841('0xc')];}return _0x4224eb;}function adAuthenticate(_0x4218ae,_0x108644,_0x1ae8b8){return new BPromise(function(_0x1a3293,_0x19422d){try{var _0x2d7810=new ActiveDirectory(_0x4218ae);_0x2d7810[_0x1841('0xd')](_0x108644,_0x1ae8b8,function(_0x16570d,_0x293ca7){if(_0x16570d){logger[_0x1841('0xe')]('Error\x20authenticate\x20%s:\x20%s',_0x108644,util[_0x1841('0xf')](_0x16570d,{'showHidden':![],'depth':null}));_0x19422d(_0x1841('0x10'));}else if(!_0x293ca7){logger[_0x1841('0xe')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x108644);_0x19422d('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1a3293(_0x293ca7);}});}catch(_0x415393){_0x19422d(_0x415393);}});}function ActiveDirectoryAuthenticate(_0x443172,_0x4c9df4,_0x101dfd,_0x9dc9c8){var _0x3e7e22,_0x287c5e;if(!isActiveDirectoryConfigured(config)){logger[_0x1841('0xe')](_0x1841('0x11'),_0x4c9df4);return _0x9dc9c8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x1841('0x12')][_0x1841('0x13')]({'where':{'id':0x1},'attributes':[_0x1841('0x14'),_0x1841('0x15')],'raw':!![]})[_0x1841('0x16')](function(_0x16917f){_0x3e7e22=_0x16917f;if(!_0x3e7e22[_0x1841('0x14')]){logger[_0x1841('0xe')](_0x1841('0x17'),_0x4c9df4);throw new Error(_0x1841('0x10'));}return _0x443172[_0x1841('0x13')]({'attributes':['id',_0x1841('0x18'),_0x1841('0x19'),_0x1841('0x1a'),'role',_0x1841('0x1b'),_0x1841('0x1c'),_0x1841('0x1d'),_0x1841('0x1e')],'where':{'name':_0x4c9df4,'role':{'$or':['admin',_0x1841('0x1f'),_0x1841('0x20')]},'adSsoEnabled':!![]}});})[_0x1841('0x16')](function(_0x1ed975){if(!_0x1ed975||_0x1ed975&&_0x1ed975[_0x1841('0x18')]!==_0x4c9df4){throw new Error(_0x1841('0x10'));}_0x287c5e=_0x1ed975;var _0x28a0d2=_0x287c5e[_0x1841('0x18')]+'@'+config[_0x1841('0x8')][_0x1841('0xc')];return adAuthenticate(config[_0x1841('0x8')],_0x28a0d2,_0x101dfd);})[_0x1841('0x16')](function(_0x60ab64){if(_0x287c5e['disabled']){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x3e7e22[_0x1841('0x15')]>0x0){if(_0x287c5e['blocked']){if(moment(_0x287c5e[_0x1841('0x1d')])[_0x1841('0x21')](_0x3e7e22[_0x1841('0x15')],_0x1841('0x22'))>moment()){throw new Error(_0x1841('0x10'));}return utils[_0x1841('0x23')](_0x287c5e,0x0,![],null)[_0x1841('0x16')](function(){return utils[_0x1841('0x24')](_0x287c5e);})[_0x1841('0x16')](function(){return _0x9dc9c8(null,_0x287c5e);});}else{return utils[_0x1841('0x24')](_0x287c5e)['then'](function(){return _0x9dc9c8(null,_0x287c5e);});}}else{return utils['getLicense'](_0x287c5e)[_0x1841('0x16')](function(){return _0x9dc9c8(null,_0x287c5e);});}})[_0x1841('0x25')](function(_0x4eddde){return _0x9dc9c8(null,![],_0x4eddde);});}function handleError(_0x1f0985,_0x302824,_0x336e60){return _0x1f0985[_0x1841('0x26')](_0x302824||0x1f4)[_0x1841('0x27')]({'message':_0x336e60?_0x336e60[_0x1841('0x28')]||_0x336e60:''});}exports['login']=function(_0x2056cb,_0x3c952c,_0x34aaf2){passport[_0x1841('0xd')](_0x1841('0x29'),function(_0x10e12e,_0x5d3242,_0x371856){var _0x37cc52=_0x10e12e||_0x371856;if(_0x37cc52){return handleError(_0x3c952c,0x191,_0x37cc52);}if(!_0x5d3242){return handleError(_0x3c952c,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x296269={'payload':{'id':_0x5d3242['id'],'role':_0x5d3242['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x296269)[_0x1841('0x16')](function(_0x11d8ee){_0x3c952c[_0x1841('0x2a')]({'id':_0x5d3242['id'],'token':_0x11d8ee,'statusCall':'','isAlreadyLogged':_0x5d3242[_0x1841('0x1e')]});});}})(_0x2056cb,_0x3c952c,_0x34aaf2);};passport['use'](_0x1841('0x29'),new LocalStrategy({'usernameField':_0x1841('0x18'),'passwordField':_0x1841('0x19')},function(_0x59b4dd,_0x423a99,_0x1e3261){return ActiveDirectoryAuthenticate(db[_0x1841('0x2b')],_0x59b4dd,_0x423a99,_0x1e3261);}));
\ No newline at end of file
+var _0x580b=['agent','blockDuration','add','minutes','clearBlockUser','getLicense','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','online','use','password','User','passport','Strategy','activedirectory2','bluebird','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','undefined','activedirectory','baseDN','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','disabled','blocked','blockedAt','admin','user'];(function(_0x5517d1,_0x14be6f){var _0x18f2f1=function(_0x511994){while(--_0x511994){_0x5517d1['push'](_0x5517d1['shift']());}};_0x18f2f1(++_0x14be6f);}(_0x580b,0xf0));var _0xb580=function(_0x562d4c,_0x2812c2){_0x562d4c=_0x562d4c-0x0;var _0x276edd=_0x580b[_0x562d4c];return _0x276edd;};'use strict';var passport=require(_0xb580('0x0'));var LocalStrategy=require('passport-local')[_0xb580('0x1')];var moment=require('moment');var ActiveDirectory=require(_0xb580('0x2'));var BPromise=require(_0xb580('0x3'));var util=require('util');var db=require(_0xb580('0x4'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xb580('0x5'));var config=require(_0xb580('0x6'));var logger=require(_0xb580('0x7'))('api');function isActiveDirectoryConfigured(_0x7683b8){var _0x1cfbda=![];if(typeof _0x7683b8['activedirectory']!==_0xb580('0x8')){_0x1cfbda=_0x7683b8[_0xb580('0x9')][_0xb580('0xa')]&&_0x7683b8[_0xb580('0x9')][_0xb580('0xb')]&&_0x7683b8['activedirectory']['domain'];}return _0x1cfbda;}function adAuthenticate(_0x569f15,_0x5dec2b,_0x4b8acf){return new BPromise(function(_0x453772,_0x11f9b0){try{var _0x3636e2=new ActiveDirectory(_0x569f15);_0x3636e2[_0xb580('0xc')](_0x5dec2b,_0x4b8acf,function(_0x628222,_0x44534f){if(_0x628222){logger[_0xb580('0xd')](_0xb580('0xe'),_0x5dec2b,util['inspect'](_0x628222,{'showHidden':![],'depth':null}));_0x11f9b0(_0xb580('0xf'));}else if(!_0x44534f){logger[_0xb580('0xd')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x5dec2b);_0x11f9b0(_0xb580('0xf'));}else{_0x453772(_0x44534f);}});}catch(_0x30a791){_0x11f9b0(_0x30a791);}});}function ActiveDirectoryAuthenticate(_0x2c2a0b,_0x524c14,_0x1351af,_0x591e30){var _0x11a268,_0x2f50f3;if(!isActiveDirectoryConfigured(config)){logger[_0xb580('0xd')](_0xb580('0x10'),_0x524c14);return _0x591e30(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xb580('0x11')][_0xb580('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled','blockDuration'],'raw':!![]})[_0xb580('0x13')](function(_0x695b00){_0x11a268=_0x695b00;if(!_0x11a268[_0xb580('0x14')]){logger[_0xb580('0xd')](_0xb580('0x15'),_0x524c14);throw new Error(_0xb580('0xf'));}return _0x2c2a0b[_0xb580('0x12')]({'attributes':['id',_0xb580('0x16'),'password',_0xb580('0x17'),_0xb580('0x18'),_0xb580('0x19'),_0xb580('0x1a'),_0xb580('0x1b'),'online'],'where':{'name':_0x524c14,'role':{'$or':[_0xb580('0x1c'),_0xb580('0x1d'),_0xb580('0x1e')]},'adSsoEnabled':!![]}});})[_0xb580('0x13')](function(_0x2f5bba){if(!_0x2f5bba||_0x2f5bba&&_0x2f5bba[_0xb580('0x16')]!==_0x524c14){throw new Error(_0xb580('0xf'));}_0x2f50f3=_0x2f5bba;var _0x2b13fb=_0x2f50f3['name']+'@'+config[_0xb580('0x9')]['domain'];return adAuthenticate(config[_0xb580('0x9')],_0x2b13fb,_0x1351af);})['then'](function(_0xda310){if(_0x2f50f3[_0xb580('0x19')]){throw new Error(_0xb580('0xf'));}if(_0x11a268[_0xb580('0x1f')]>0x0){if(_0x2f50f3['blocked']){if(moment(_0x2f50f3['blockedAt'])[_0xb580('0x20')](_0x11a268[_0xb580('0x1f')],_0xb580('0x21'))>moment()){throw new Error(_0xb580('0xf'));}return utils[_0xb580('0x22')](_0x2f50f3,0x0,![],null)[_0xb580('0x13')](function(){return utils[_0xb580('0x23')](_0x2f50f3);})[_0xb580('0x13')](function(){return _0x591e30(null,_0x2f50f3);});}else{return utils[_0xb580('0x23')](_0x2f50f3)[_0xb580('0x13')](function(){return _0x591e30(null,_0x2f50f3);});}}else{return utils[_0xb580('0x23')](_0x2f50f3)[_0xb580('0x13')](function(){return _0x591e30(null,_0x2f50f3);});}})['catch'](function(_0x171dc0){return _0x591e30(null,![],_0x171dc0);});}function handleError(_0x1cf42e,_0x2dfedc,_0x5041c0){return _0x1cf42e[_0xb580('0x24')](_0x2dfedc||0x1f4)[_0xb580('0x25')]({'message':_0x5041c0?_0x5041c0['message']||_0x5041c0:''});}exports[_0xb580('0x26')]=function(_0x271175,_0x3ff049,_0x38ad63){passport[_0xb580('0xc')](_0xb580('0x27'),function(_0x288c1f,_0x545bc4,_0xfbabd9){var _0x21ca1d=_0x288c1f||_0xfbabd9;if(_0x21ca1d){return handleError(_0x3ff049,0x191,_0x21ca1d);}if(!_0x545bc4){return handleError(_0x3ff049,0x194,{'message':_0xb580('0x28')});}else{var _0x1b5746={'payload':{'id':_0x545bc4['id'],'role':_0x545bc4[_0xb580('0x18')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1b5746)[_0xb580('0x13')](function(_0x3a3e57){_0x3ff049['json']({'id':_0x545bc4['id'],'token':_0x3a3e57,'statusCall':'','isAlreadyLogged':_0x545bc4[_0xb580('0x29')]});});}})(_0x271175,_0x3ff049,_0x38ad63);};passport[_0xb580('0x2a')](_0xb580('0x27'),new LocalStrategy({'usernameField':_0xb580('0x16'),'passwordField':_0xb580('0x2b')},function(_0x2f7a19,_0x5c4fdf,_0x24d8b3){return ActiveDirectoryAuthenticate(db[_0xb580('0x2c')],_0x2f7a19,_0x5c4fdf,_0x24d8b3);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 42055ad..af2cd3f 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 _0xa08c=['login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x20f38a,_0x6dd961){var _0x2ccf9f=function(_0x586553){while(--_0x586553){_0x20f38a['push'](_0x20f38a['shift']());}};_0x2ccf9f(++_0x6dd961);}(_0xa08c,0x133));var _0xca08=function(_0x276c4f,_0x55eee3){_0x276c4f=_0x276c4f-0x0;var _0x551485=_0xa08c[_0x276c4f];return _0x551485;};'use strict';var express=require(_0xca08('0x0'));var router=express[_0xca08('0x1')]();var controller=require(_0xca08('0x2'));router['post']('/',controller[_0xca08('0x3')]);module[_0xca08('0x4')]=router;
\ No newline at end of file
+var _0xd175=['Router','./authActiveDirectory.controller','post','login','express'];(function(_0x1579be,_0x4f5834){var _0x4f4837=function(_0x286b0){while(--_0x286b0){_0x1579be['push'](_0x1579be['shift']());}};_0x4f4837(++_0x4f5834);}(_0xd175,0x1cb));var _0x5d17=function(_0x45dc19,_0x22271a){_0x45dc19=_0x45dc19-0x0;var _0x520888=_0xd175[_0x45dc19];return _0x520888;};'use strict';var express=require(_0x5d17('0x0'));var router=express[_0x5d17('0x1')]();var controller=require(_0x5d17('0x2'));router[_0x5d17('0x3')]('/',controller[_0x5d17('0x4')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index e41478d..e139df9 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(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x7a54,0x106));var _0x47a5=function(_0x4a763a,_0x4350e2){_0x4a763a=_0x4a763a-0x0;var _0xaf1e01=_0x7a54[_0x4a763a];return _0xaf1e01;};'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(_0x305779,_0x57891f){var _0x41c696=function(_0x53f33c){while(--_0x53f33c){_0x305779['push'](_0x305779['shift']());}};_0x41c696(++_0x57891f);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 0f09ae1..4b2fbaf 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 _0x9f13=['../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','login','exports','express','passport','Router','./authGoogle.controller'];(function(_0xe15270,_0x227d06){var _0x1e813b=function(_0x1d590d){while(--_0x1d590d){_0xe15270['push'](_0xe15270['shift']());}};_0x1e813b(++_0x227d06);}(_0x9f13,0x1f4));var _0x39f1=function(_0x40fa64,_0xb797a4){_0x40fa64=_0x40fa64-0x0;var _0x272ab0=_0x9f13[_0x40fa64];return _0x272ab0;};'use strict';var express=require(_0x39f1('0x0'));var passport=require(_0x39f1('0x1'));var router=express[_0x39f1('0x2')]();var controller=require(_0x39f1('0x3'));var userController=require(_0x39f1('0x4'));var authService=require(_0x39f1('0x5'));router[_0x39f1('0x6')]('/',controller['login']);router[_0x39f1('0x6')](_0x39f1('0x7'),controller[_0x39f1('0x8')],authService[_0x39f1('0x9')],userController[_0x39f1('0xa')],authService['setTokenCookie']);module[_0x39f1('0xb')]=router;
\ No newline at end of file
+var _0xb55e=['exports','express','passport','Router','./authGoogle.controller','get','login','/callback','setTokenCookie'];(function(_0x438f7c,_0x60ba0e){var _0x4c6e38=function(_0xdf6070){while(--_0xdf6070){_0x438f7c['push'](_0x438f7c['shift']());}};_0x4c6e38(++_0x60ba0e);}(_0xb55e,0x106));var _0xeb55=function(_0x58c9d2,_0xc9c90b){_0x58c9d2=_0x58c9d2-0x0;var _0x65481a=_0xb55e[_0x58c9d2];return _0x65481a;};'use strict';var express=require(_0xeb55('0x0'));var passport=require(_0xeb55('0x1'));var router=express[_0xeb55('0x2')]();var controller=require(_0xeb55('0x3'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0xeb55('0x4')]('/',controller[_0xeb55('0x5')]);router['get'](_0xeb55('0x6'),controller['callback'],authService['isMiddleware'],userController['login'],authService[_0xeb55('0x7')]);module[_0xeb55('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index c0293dc..ce71e02 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 _0x915c=['Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','name','password','role','disabled','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','blockDuration','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','user','request','SendMail','error','message','stringify','status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','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://','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token'];(function(_0x587dd0,_0x273922){var _0x56f153=function(_0x27fb33){while(--_0x27fb33){_0x587dd0['push'](_0x587dd0['shift']());}};_0x56f153(++_0x273922);}(_0x915c,0xb7));var _0xc915=function(_0x36b8f4,_0x15f119){_0x36b8f4=_0x36b8f4-0x0;var _0x287feb=_0x915c[_0x36b8f4];return _0x287feb;};'use strict';var util=require(_0xc915('0x0'));var passport=require(_0xc915('0x1'));var LocalStrategy=require(_0xc915('0x2'))[_0xc915('0x3')];var jayson=require(_0xc915('0x4'));var _=require(_0xc915('0x5'));var rs=require(_0xc915('0x6'));var moment=require(_0xc915('0x7'));var db=require(_0xc915('0x8'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xc915('0x9'));var client=jayson[_0xc915('0xa')][_0xc915('0xb')]({'port':0x232b});function localAuthenticate(_0x4510d3,_0x1da764,_0x74763d,_0x57c617){var _0x20a704,_0x58dafa;return db[_0xc915('0xc')][_0xc915('0xd')]({'where':{'id':0x1},'attributes':[_0xc915('0xe'),'blockDuration'],'raw':!![]})[_0xc915('0xf')](function(_0x315184){_0x20a704=_0x315184;return _0x4510d3['findOne']({'attributes':['id',_0xc915('0x10'),_0xc915('0x11'),'salt',_0xc915('0x12'),_0xc915('0x13'),'blocked',_0xc915('0x14'),_0xc915('0x15')],'where':{'name':_0x1da764,'role':{'$or':[_0xc915('0x16'),'user',_0xc915('0x17')]}}});})[_0xc915('0xf')](function(_0x47906f){if(!_0x47906f||_0x47906f&&_0x47906f[_0xc915('0x10')]!==_0x1da764){throw new Error(_0xc915('0x18'));}else{_0x58dafa=_0x47906f;return _0x58dafa;}})[_0xc915('0xf')](function(){_0x58dafa['authenticate'](_0x74763d,function(_0x90f29c,_0x20546d){var _0x15ddf3=_0x58dafa[_0xc915('0x15')]+0x1;if(_0x90f29c){return _0x57c617(_0x90f29c);}else if(!_0x20546d){if(_0x58dafa[_0xc915('0x13')]){return _0x57c617(null,![],{'message':_0xc915('0x18')});}else if(_0x20a704[_0xc915('0xe')]>0x0){if(_0x58dafa[_0xc915('0x19')]){if(_0x20a704['blockDuration']>0x0){if(moment(_0x58dafa['blockedAt'])[_0xc915('0x1a')](_0x20a704[_0xc915('0x1b')],'minutes')>moment()){return _0x57c617(null,![],{'message':_0xc915('0x18')});}else{return utils['clearBlockUser'](_0x58dafa,_0x15ddf3,![],null)[_0xc915('0xf')](function(){return _0x57c617(null,![],{'message':_0xc915('0x18')});});}}else{return _0x57c617(null,![],{'message':_0xc915('0x18')});}}else{if(_0x15ddf3>=_0x20a704[_0xc915('0xe')]){return utils[_0xc915('0x1c')](_0x58dafa,0x0,!![],moment())[_0xc915('0xf')](function(){return _0x57c617(null,![],{'message':_0xc915('0x18')});});}else{return utils['clearBlockUser'](_0x58dafa,_0x15ddf3,![],null)[_0xc915('0xf')](function(){return _0x57c617(null,![],{'message':_0xc915('0x18')});});}}}else{return _0x57c617(null,![],{'message':_0xc915('0x18')});}}else{if(_0x58dafa[_0xc915('0x13')]){return _0x57c617(null,![],{'message':_0xc915('0x18')});}else if(_0x20a704[_0xc915('0xe')]>0x0){if(_0x58dafa[_0xc915('0x19')]){if(_0x20a704[_0xc915('0x1b')]>0x0){if(moment(_0x58dafa[_0xc915('0x14')])[_0xc915('0x1a')](_0x20a704['blockDuration'],_0xc915('0x1d'))>moment()){return _0x57c617(null,![],{'message':_0xc915('0x18')});}else{return utils['clearBlockUser'](_0x58dafa,0x0,![],null)[_0xc915('0xf')](function(){return utils[_0xc915('0x1e')](_0x58dafa);})['then'](function(){return _0x57c617(null,_0x58dafa);});}}else{return _0x57c617(null,![],{'message':_0xc915('0x18')});}}else{return utils['clearBlockUser'](_0x58dafa,0x0,![],null)[_0xc915('0xf')](function(){return utils[_0xc915('0x1e')](_0x58dafa);})[_0xc915('0xf')](function(){return _0x57c617(null,_0x58dafa);})[_0xc915('0x1f')](function(_0x32fa29){return _0x57c617(null,![],_0x32fa29);});}}else{if(_0x58dafa['blocked']){return _0x57c617(null,![],{'message':_0xc915('0x18')});}else{return utils[_0xc915('0x1e')](_0x58dafa)[_0xc915('0xf')](function(){return _0x57c617(null,_0x58dafa);});}}}});})['catch'](function(_0xf26dcc){return _0x57c617(null,![],_0xf26dcc);});}function sendServiceMail(_0x1470f2){return db[_0xc915('0x20')][_0xc915('0x21')]({'where':{'service':!![]},'attributes':['id',_0xc915('0x10'),_0xc915('0x22')],'include':[{'model':db[_0xc915('0x23')],'as':_0xc915('0x24'),'include':[{'model':db[_0xc915('0x25')],'as':_0xc915('0x25')}]}]})['then'](function(_0x30eb4d){if(!_0x30eb4d){throw new Error(_0xc915('0x26'));}var _0x37fe04=_0x30eb4d[_0xc915('0x27')]();var _0x118511={'account':_0x37fe04,'message':_[_0xc915('0x28')]({'from':util[_0xc915('0x29')]('\x22%s\x22\x20<%s>',_0x30eb4d[_0xc915('0x10')],_0x30eb4d[_0xc915('0x22')]||_0x30eb4d[_0xc915('0x24')][_0xc915('0x2a')])},_0x1470f2)};return client[_0xc915('0x2b')](_0xc915('0x2c'),_0x118511);})[_0xc915('0xf')](function(_0x3d1008){if(_0x3d1008[_0xc915('0x2d')]){throw new Error(util[_0xc915('0x29')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x3d1008[_0xc915('0x2d')][_0xc915('0x2e')]||JSON[_0xc915('0x2f')](_0x3d1008['error'])));}return!![];});}function handleError(_0x20710a,_0x1ddd45,_0x5548ce){return _0x20710a[_0xc915('0x30')](_0x1ddd45||0x1f4)[_0xc915('0x31')]({'message':_0x5548ce?_0x5548ce['message']||_0x5548ce:''});}exports[_0xc915('0x32')]=function(_0x186cb8,_0xb4984a,_0x2b764b){passport[_0xc915('0x33')](_0xc915('0x34'),function(_0x82696c,_0x472a37,_0x5a82dc){var _0x53b8c9=_0x82696c||_0x5a82dc;if(_0x53b8c9){return handleError(_0xb4984a,0x191,_0x53b8c9);}if(!_0x472a37){return handleError(_0xb4984a,0x194,{'message':_0xc915('0x35')});}else{var _0x19f7df={'payload':{'id':_0x472a37['id'],'role':_0x472a37[_0xc915('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0xc915('0x36')](_0x19f7df)['then'](function(_0x4f4f79){_0xb4984a['json']({'id':_0x472a37['id'],'token':_0x4f4f79,'statusCall':'','isAlreadyLogged':_0x472a37['online']});});}})(_0x186cb8,_0xb4984a,_0x2b764b);};exports[_0xc915('0x37')]=function(_0x37afb5,_0x2cbc44){if(!_0x37afb5[_0xc915('0x38')][_0xc915('0x22')]){return handleError(_0x2cbc44,0x1f4,{'message':_0xc915('0x39')});}var _0x2b376f=rs[_0xc915('0x3a')]();_0x37afb5['body'][_0xc915('0x22')]=_0x37afb5['body'][_0xc915('0x22')][_0xc915('0x3b')]()[_0xc915('0x3c')]();var _0x30a7bf;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xc915('0xe'),'blockDuration'],'raw':!![]})['then'](function(_0x2fc044){_0x30a7bf=_0x2fc044;return db[_0xc915('0x3d')][_0xc915('0x21')]({'where':{'email':_0x37afb5[_0xc915('0x38')][_0xc915('0x22')]}});})[_0xc915('0xf')](function(_0x39b027){if(!_0x39b027){throw new Error(_0xc915('0x3e'));}if(_0x39b027[_0xc915('0x13')]){throw new Error(_0xc915('0x3f'));}if(_0x39b027['blocked']){if(moment(_0x39b027['blockedAt'])[_0xc915('0x1a')](_0x30a7bf[_0xc915('0x1b')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x39b027[_0xc915('0x19')]=![];_0x39b027['blockedAt']=null;}}_0x39b027[_0xc915('0x40')]=_0x2b376f;_0x39b027[_0xc915('0x41')]=Date[_0xc915('0x42')]()+0x36ee80;return _0x39b027[_0xc915('0x43')]();})[_0xc915('0xf')](function(){return sendServiceMail({'to':_0x37afb5['body'][_0xc915('0x22')],'subject':_0xc915('0x44'),'text':_0xc915('0x45')+_0xc915('0x46')+_0xc915('0x47')+_0x37afb5['headers'][_0xc915('0x48')]+'/reset/'+_0x2b376f+'\x0a\x0a'+_0xc915('0x49')});})[_0xc915('0xf')](function(){_0x2cbc44[_0xc915('0x30')](0xc8)[_0xc915('0x31')]({'message':_0xc915('0x4a')});})['catch'](function(_0x2c882e){return handleError(_0x2cbc44,0x1f4,_0x2c882e);});};exports[_0xc915('0x4b')]=function(_0x40878e,_0x4e6a21){return db[_0xc915('0x3d')][_0xc915('0x21')]({'where':{'resetPasswordToken':_0x40878e[_0xc915('0x4c')][_0xc915('0x4d')],'resetPasswordExpires':{'$gt':Date[_0xc915('0x42')]()}}})['then'](function(_0x462a1b){if(!_0x462a1b){throw new Error(_0xc915('0x4e'));}return db['Setting'][_0xc915('0xd')]({'attributes':['id','securePassword',_0xc915('0x4f'),_0xc915('0x50')]})[_0xc915('0xf')](function(_0x441a57){if(_0x441a57[_0xc915('0x51')])authService[_0xc915('0x52')](_0x40878e['body'][_0xc915('0x11')]);if(!_0x441a57[_0xc915('0x4f')]||!_0x462a1b[_0xc915('0x53')])return _0x462a1b;authService[_0xc915('0x54')](_0x40878e['body'][_0xc915('0x11')],_0x462a1b[_0xc915('0x53')],_0x441a57[_0xc915('0x50')]);return _0x462a1b;})[_0xc915('0xf')](function(){_0x462a1b[_0xc915('0x11')]=_0x40878e[_0xc915('0x38')][_0xc915('0x11')];_0x462a1b['resetPasswordToken']=null;_0x462a1b['resetPasswordExpires']=null;return _0x462a1b[_0xc915('0x43')]();});})[_0xc915('0xf')](function(){_0x4e6a21[_0xc915('0x30')](0xc8)['send']({'message':_0xc915('0x55')});})[_0xc915('0x1f')](function(_0x107f39){return handleError(_0x4e6a21,0x1f4,_0x107f39);});};passport[_0xc915('0x56')](_0xc915('0x34'),new LocalStrategy({'usernameField':_0xc915('0x10'),'passwordField':'password'},function(_0x399b1c,_0xbed1c,_0x5ee970){return localAuthenticate(db[_0xc915('0x3d')],_0x399b1c,_0xbed1c,_0x5ee970);}));
\ No newline at end of file
+var _0x9e31=['message','error','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','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','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','previousPasswords','passwordHistoryLimit','Password\x20reset!','use','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','name','password','role','disabled','blocked','blockedAt','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0x9e31,0x7c));var _0x19e3=function(_0x5e2603,_0x28b846){_0x5e2603=_0x5e2603-0x0;var _0x19bb24=_0x9e31[_0x5e2603];return _0x19bb24;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0x19e3('0x0'));var _=require(_0x19e3('0x1'));var rs=require(_0x19e3('0x2'));var moment=require(_0x19e3('0x3'));var db=require(_0x19e3('0x4'))['db'];var authService=require(_0x19e3('0x5'));var utils=require(_0x19e3('0x6'));var client=jayson[_0x19e3('0x7')][_0x19e3('0x8')]({'port':0x232b});function localAuthenticate(_0x478e14,_0x204f09,_0x20de12,_0x28ca80){var _0x73abdf,_0x4d867d;return db[_0x19e3('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0x19e3('0xa'),_0x19e3('0xb')],'raw':!![]})['then'](function(_0x4344cc){_0x73abdf=_0x4344cc;return _0x478e14['findOne']({'attributes':['id',_0x19e3('0xc'),_0x19e3('0xd'),'salt',_0x19e3('0xe'),_0x19e3('0xf'),_0x19e3('0x10'),_0x19e3('0x11'),'loginAttempts'],'where':{'name':_0x204f09,'role':{'$or':[_0x19e3('0x12'),_0x19e3('0x13'),_0x19e3('0x14')]}}});})[_0x19e3('0x15')](function(_0x29e082){if(!_0x29e082||_0x29e082&&_0x29e082[_0x19e3('0xc')]!==_0x204f09){throw new Error(_0x19e3('0x16'));}else{_0x4d867d=_0x29e082;return _0x4d867d;}})[_0x19e3('0x15')](function(){_0x4d867d['authenticate'](_0x20de12,function(_0x2349e2,_0x5ecb13){var _0x31bc6c=_0x4d867d[_0x19e3('0x17')]+0x1;if(_0x2349e2){return _0x28ca80(_0x2349e2);}else if(!_0x5ecb13){if(_0x4d867d[_0x19e3('0xf')]){return _0x28ca80(null,![],{'message':_0x19e3('0x16')});}else if(_0x73abdf[_0x19e3('0xa')]>0x0){if(_0x4d867d['blocked']){if(_0x73abdf['blockDuration']>0x0){if(moment(_0x4d867d[_0x19e3('0x11')])[_0x19e3('0x18')](_0x73abdf[_0x19e3('0xb')],_0x19e3('0x19'))>moment()){return _0x28ca80(null,![],{'message':_0x19e3('0x16')});}else{return utils[_0x19e3('0x1a')](_0x4d867d,_0x31bc6c,![],null)[_0x19e3('0x15')](function(){return _0x28ca80(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x28ca80(null,![],{'message':_0x19e3('0x16')});}}else{if(_0x31bc6c>=_0x73abdf['allowedLoginAttempts']){return utils[_0x19e3('0x1a')](_0x4d867d,0x0,!![],moment())[_0x19e3('0x15')](function(){return _0x28ca80(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x19e3('0x1a')](_0x4d867d,_0x31bc6c,![],null)['then'](function(){return _0x28ca80(null,![],{'message':_0x19e3('0x16')});});}}}else{return _0x28ca80(null,![],{'message':_0x19e3('0x16')});}}else{if(_0x4d867d[_0x19e3('0xf')]){return _0x28ca80(null,![],{'message':_0x19e3('0x16')});}else if(_0x73abdf['allowedLoginAttempts']>0x0){if(_0x4d867d[_0x19e3('0x10')]){if(_0x73abdf[_0x19e3('0xb')]>0x0){if(moment(_0x4d867d[_0x19e3('0x11')])[_0x19e3('0x18')](_0x73abdf['blockDuration'],_0x19e3('0x19'))>moment()){return _0x28ca80(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x19e3('0x1a')](_0x4d867d,0x0,![],null)[_0x19e3('0x15')](function(){return utils[_0x19e3('0x1b')](_0x4d867d);})[_0x19e3('0x15')](function(){return _0x28ca80(null,_0x4d867d);});}}else{return _0x28ca80(null,![],{'message':_0x19e3('0x16')});}}else{return utils[_0x19e3('0x1a')](_0x4d867d,0x0,![],null)[_0x19e3('0x15')](function(){return utils['getLicense'](_0x4d867d);})[_0x19e3('0x15')](function(){return _0x28ca80(null,_0x4d867d);})[_0x19e3('0x1c')](function(_0x44f66f){return _0x28ca80(null,![],_0x44f66f);});}}else{if(_0x4d867d['blocked']){return _0x28ca80(null,![],{'message':_0x19e3('0x16')});}else{return utils[_0x19e3('0x1b')](_0x4d867d)[_0x19e3('0x15')](function(){return _0x28ca80(null,_0x4d867d);});}}}});})['catch'](function(_0x10209b){return _0x28ca80(null,![],_0x10209b);});}function sendServiceMail(_0x408806){return db[_0x19e3('0x1d')][_0x19e3('0x1e')]({'where':{'service':!![]},'attributes':['id','name',_0x19e3('0x1f')],'include':[{'model':db['MailServerOut'],'as':_0x19e3('0x20'),'include':[{'model':db[_0x19e3('0x21')],'as':_0x19e3('0x21')}]}]})['then'](function(_0x4809dd){if(!_0x4809dd){throw new Error(_0x19e3('0x22'));}var _0x421d4e=_0x4809dd[_0x19e3('0x23')]();var _0x87015a={'account':_0x421d4e,'message':_[_0x19e3('0x24')]({'from':util[_0x19e3('0x25')](_0x19e3('0x26'),_0x4809dd[_0x19e3('0xc')],_0x4809dd[_0x19e3('0x1f')]||_0x4809dd[_0x19e3('0x20')]['user'])},_0x408806)};return client[_0x19e3('0x27')](_0x19e3('0x28'),_0x87015a);})[_0x19e3('0x15')](function(_0x38ebf0){if(_0x38ebf0['error']){throw new Error(util[_0x19e3('0x25')](_0x19e3('0x29'),_0x38ebf0['error'][_0x19e3('0x2a')]||JSON['stringify'](_0x38ebf0[_0x19e3('0x2b')])));}return!![];});}function handleError(_0x19b550,_0x3b84d3,_0x18e997){return _0x19b550[_0x19e3('0x2c')](_0x3b84d3||0x1f4)[_0x19e3('0x2d')]({'message':_0x18e997?_0x18e997['message']||_0x18e997:''});}exports[_0x19e3('0x2e')]=function(_0x26668e,_0x2f6246,_0xfaf850){passport['authenticate'](_0x19e3('0x2f'),function(_0xee1ed8,_0x32bb76,_0x56c668){var _0x28d195=_0xee1ed8||_0x56c668;if(_0x28d195){return handleError(_0x2f6246,0x191,_0x28d195);}if(!_0x32bb76){return handleError(_0x2f6246,0x194,{'message':_0x19e3('0x30')});}else{var _0x1d9891={'payload':{'id':_0x32bb76['id'],'role':_0x32bb76[_0x19e3('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x19e3('0x31')](_0x1d9891)[_0x19e3('0x15')](function(_0x22f92c){_0x2f6246[_0x19e3('0x32')]({'id':_0x32bb76['id'],'token':_0x22f92c,'statusCall':'','isAlreadyLogged':_0x32bb76[_0x19e3('0x33')]});});}})(_0x26668e,_0x2f6246,_0xfaf850);};exports['forgot']=function(_0x56f05f,_0x164225){if(!_0x56f05f[_0x19e3('0x34')][_0x19e3('0x1f')]){return handleError(_0x164225,0x1f4,{'message':_0x19e3('0x35')});}var _0x393372=rs[_0x19e3('0x36')]();_0x56f05f[_0x19e3('0x34')][_0x19e3('0x1f')]=_0x56f05f[_0x19e3('0x34')][_0x19e3('0x1f')][_0x19e3('0x37')]()[_0x19e3('0x38')]();var _0x3919b0;return db[_0x19e3('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0x19e3('0xa'),_0x19e3('0xb')],'raw':!![]})['then'](function(_0x48219b){_0x3919b0=_0x48219b;return db[_0x19e3('0x39')][_0x19e3('0x1e')]({'where':{'email':_0x56f05f['body'][_0x19e3('0x1f')]}});})[_0x19e3('0x15')](function(_0x204617){if(!_0x204617){throw new Error(_0x19e3('0x3a'));}if(_0x204617[_0x19e3('0xf')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x204617['blocked']){if(moment(_0x204617[_0x19e3('0x11')])[_0x19e3('0x18')](_0x3919b0[_0x19e3('0xb')],_0x19e3('0x19'))>moment()){throw new Error(_0x19e3('0x3b'));}else{_0x204617[_0x19e3('0x10')]=![];_0x204617[_0x19e3('0x11')]=null;}}_0x204617[_0x19e3('0x3c')]=_0x393372;_0x204617[_0x19e3('0x3d')]=Date[_0x19e3('0x3e')]()+0x36ee80;return _0x204617[_0x19e3('0x3f')]();})[_0x19e3('0x15')](function(){return sendServiceMail({'to':_0x56f05f[_0x19e3('0x34')]['email'],'subject':_0x19e3('0x40'),'text':_0x19e3('0x41')+_0x19e3('0x42')+_0x19e3('0x43')+_0x56f05f[_0x19e3('0x44')]['host']+_0x19e3('0x45')+_0x393372+'\x0a\x0a'+_0x19e3('0x46')});})[_0x19e3('0x15')](function(){_0x164225[_0x19e3('0x2c')](0xc8)[_0x19e3('0x2d')]({'message':_0x19e3('0x47')});})[_0x19e3('0x1c')](function(_0x536563){return handleError(_0x164225,0x1f4,_0x536563);});};exports[_0x19e3('0x48')]=function(_0x5c251a,_0x413c2a){return db['User'][_0x19e3('0x1e')]({'where':{'resetPasswordToken':_0x5c251a[_0x19e3('0x49')]['token'],'resetPasswordExpires':{'$gt':Date[_0x19e3('0x3e')]()}}})['then'](function(_0x1ae9a6){if(!_0x1ae9a6){throw new Error(_0x19e3('0x4a'));}return db[_0x19e3('0x9')]['findOne']({'attributes':['id','securePassword','enforcePasswordHistory','passwordHistoryLimit']})['then'](function(_0x5da8d5){if(_0x5da8d5[_0x19e3('0x4b')])authService[_0x19e3('0x4c')](_0x5c251a[_0x19e3('0x34')]['password']);if(!_0x5da8d5[_0x19e3('0x4d')]||!_0x1ae9a6['previousPasswords'])return _0x1ae9a6;authService[_0x19e3('0x4e')](_0x5c251a[_0x19e3('0x34')]['password'],_0x1ae9a6[_0x19e3('0x4f')],_0x5da8d5[_0x19e3('0x50')]);return _0x1ae9a6;})[_0x19e3('0x15')](function(){_0x1ae9a6[_0x19e3('0xd')]=_0x5c251a[_0x19e3('0x34')][_0x19e3('0xd')];_0x1ae9a6['resetPasswordToken']=null;_0x1ae9a6[_0x19e3('0x3d')]=null;return _0x1ae9a6['save']();});})[_0x19e3('0x15')](function(){_0x413c2a[_0x19e3('0x2c')](0xc8)['send']({'message':_0x19e3('0x51')});})[_0x19e3('0x1c')](function(_0x4c019b){return handleError(_0x413c2a,0x1f4,_0x4c019b);});};passport[_0x19e3('0x52')](_0x19e3('0x2f'),new LocalStrategy({'usernameField':_0x19e3('0xc'),'passwordField':_0x19e3('0xd')},function(_0x13e20b,_0x44c9f8,_0x5669ea){return localAuthenticate(db[_0x19e3('0x39')],_0x13e20b,_0x44c9f8,_0x5669ea);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 4707575..a461bd0 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 _0x22d3=['reset','exports','Router','./authLocal.controller','post','/forgot','forgot','/reset/:token'];(function(_0x5c3e11,_0x4dd35b){var _0x4e9064=function(_0x5ae0cf){while(--_0x5ae0cf){_0x5c3e11['push'](_0x5c3e11['shift']());}};_0x4e9064(++_0x4dd35b);}(_0x22d3,0x11a));var _0x322d=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0x22d3[_0x10004e];return _0x5af990;};'use strict';var express=require('express');var router=express[_0x322d('0x0')]();var controller=require(_0x322d('0x1'));router[_0x322d('0x2')]('/',controller['login']);router[_0x322d('0x2')](_0x322d('0x3'),controller[_0x322d('0x4')]);router[_0x322d('0x2')](_0x322d('0x5'),controller[_0x322d('0x6')]);module[_0x322d('0x7')]=router;
\ No newline at end of file
+var _0xffd5=['login','/forgot','post','/reset/:token','express','Router','./authLocal.controller'];(function(_0xe1c7d7,_0x102465){var _0x272c22=function(_0x56b75e){while(--_0x56b75e){_0xe1c7d7['push'](_0xe1c7d7['shift']());}};_0x272c22(++_0x102465);}(_0xffd5,0x107));var _0x5ffd=function(_0x3005d5,_0xf588c7){_0x3005d5=_0x3005d5-0x0;var _0x547c7e=_0xffd5[_0x3005d5];return _0x547c7e;};'use strict';var express=require(_0x5ffd('0x0'));var router=express[_0x5ffd('0x1')]();var controller=require(_0x5ffd('0x2'));router['post']('/',controller[_0x5ffd('0x3')]);router['post'](_0x5ffd('0x4'),controller['forgot']);router[_0x5ffd('0x5')](_0x5ffd('0x6'),controller['reset']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index e5fd2e0..6b1942b 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 _0xd105=['exports','STRING','BOOLEAN'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0xd105,0x144));var _0x5d10=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd105[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x5d10('0x0')]={'name':{'type':Sequelize[_0x5d10('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x5d10('0x1')]},'description':{'type':Sequelize[_0x5d10('0x1')]},'status':{'type':Sequelize[_0x5d10('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x6f90=['exports','INTEGER'];(function(_0x582a70,_0x488f81){var _0xac9f16=function(_0x3b320b){while(--_0x3b320b){_0x582a70['push'](_0x582a70['shift']());}};_0xac9f16(++_0x488f81);}(_0x6f90,0xc6));var _0x06f9=function(_0x2a96eb,_0x23105a){_0x2a96eb=_0x2a96eb-0x0;var _0x2e86f8=_0x6f90[_0x2a96eb];return _0x2e86f8;};'use strict';var Sequelize=require('sequelize');module[_0x06f9('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x06f9('0x1')],'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 329e48f..3e108df 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 _0xd1f2=['merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','Automation','length','find','create','update','body','params','addConditions','Condition','ids','omit','findOne','getConditions','Action','getActions','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','reject','save','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x39bd4a,_0x4e23f1){var _0x2354af=function(_0x703508){while(--_0x703508){_0x39bd4a['push'](_0x39bd4a['shift']());}};_0x2354af(++_0x4e23f1);}(_0xd1f2,0x1b9));var _0x2d1f=function(_0x18c101,_0x32cb6d){_0x18c101=_0x18c101-0x0;var _0x7305b4=_0xd1f2[_0x18c101];return _0x7305b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d1f('0x0'));var zipdir=require(_0x2d1f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2d1f('0x2'));var moment=require('moment');var BPromise=require(_0x2d1f('0x3'));var Mustache=require(_0x2d1f('0x4'));var util=require(_0x2d1f('0x5'));var path=require(_0x2d1f('0x6'));var sox=require(_0x2d1f('0x7'));var csv=require(_0x2d1f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2d1f('0x9'));var jsforce=require(_0x2d1f('0xa'));var deskjs=require(_0x2d1f('0xb'));var toCsv=require(_0x2d1f('0x8'));var querystring=require(_0x2d1f('0xc'));var Papa=require(_0x2d1f('0xd'));var Redis=require(_0x2d1f('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2d1f('0xf'));var hardwareService=require(_0x2d1f('0x10'));var logger=require(_0x2d1f('0x11'))(_0x2d1f('0x12'));var utils=require(_0x2d1f('0x13'));var config=require(_0x2d1f('0x14'));var licenseUtil=require(_0x2d1f('0x15'));var db=require(_0x2d1f('0x16'))['db'];function respondWithStatusCode(_0x153103,_0x2bfec1){_0x2bfec1=_0x2bfec1||0xcc;return function(_0x58940e){if(_0x58940e){return _0x153103[_0x2d1f('0x17')](_0x2bfec1);}return _0x153103[_0x2d1f('0x18')](_0x2bfec1)[_0x2d1f('0x19')]();};}function respondWithResult(_0x579306,_0x4b7df4){_0x4b7df4=_0x4b7df4||0xc8;return function(_0x33bf7a){if(_0x33bf7a){return _0x579306['status'](_0x4b7df4)[_0x2d1f('0x1a')](_0x33bf7a);}};}function respondWithFilteredResult(_0x2b2492,_0x127903){return function(_0x245b83){if(_0x245b83){var _0x181dcf=typeof _0x127903['offset']===_0x2d1f('0x1b')&&typeof _0x127903[_0x2d1f('0x1c')]===_0x2d1f('0x1b');var _0x2708f7=_0x245b83['count'];var _0x4f1f74=_0x181dcf?0x0:_0x127903[_0x2d1f('0x1d')];var _0x5972f1=_0x181dcf?_0x245b83[_0x2d1f('0x1e')]:_0x127903[_0x2d1f('0x1d')]+_0x127903[_0x2d1f('0x1c')];var _0x5c164b;if(_0x5972f1>=_0x2708f7){_0x5972f1=_0x2708f7;_0x5c164b=0xc8;}else{_0x5c164b=0xce;}_0x2b2492[_0x2d1f('0x18')](_0x5c164b);return _0x2b2492[_0x2d1f('0x1f')]('Content-Range',_0x4f1f74+'-'+_0x5972f1+'/'+_0x2708f7)[_0x2d1f('0x1a')](_0x245b83);}return null;};}function patchUpdates(_0x255781){return function(_0x347bcc){try{jsonpatch['apply'](_0x347bcc,_0x255781,!![]);}catch(_0x48fb01){return BPromise[_0x2d1f('0x20')](_0x48fb01);}return _0x347bcc[_0x2d1f('0x21')]();};}function saveUpdates(_0x4457c0,_0x2f3183){return function(_0x3d90ba){if(_0x3d90ba){return _0x3d90ba['update'](_0x4457c0)['then'](function(_0x25d132){return _0x25d132;});}return null;};}function removeEntity(_0x3e0be9,_0xbe00ae){return function(_0x489931){if(_0x489931){return _0x489931[_0x2d1f('0x22')]()['then'](function(){_0x3e0be9[_0x2d1f('0x18')](0xcc)[_0x2d1f('0x19')]();});}};}function handleEntityNotFound(_0x22bd8a,_0x158b84){return function(_0x425a7a){if(!_0x425a7a){_0x22bd8a['sendStatus'](0x194);}return _0x425a7a;};}function handleError(_0xc5f207,_0x56ab57){_0x56ab57=_0x56ab57||0x1f4;return function(_0x454768){logger[_0x2d1f('0x23')](_0x454768[_0x2d1f('0x24')]);if(_0x454768[_0x2d1f('0x25')]){delete _0x454768[_0x2d1f('0x25')];}_0xc5f207[_0x2d1f('0x18')](_0x56ab57)[_0x2d1f('0x26')](_0x454768);};}exports[_0x2d1f('0x27')]=function(_0x3b798b,_0x566ce1){var _0x1ee937={},_0x121f0e={},_0x10be9b={'count':0x0,'rows':[]};var _0x598d8a=_[_0x2d1f('0x28')](db['Automation'][_0x2d1f('0x29')],function(_0x485339){return{'name':_0x485339[_0x2d1f('0x2a')],'type':_0x485339['type']['key']};});_0x121f0e[_0x2d1f('0x2b')]=_[_0x2d1f('0x28')](_0x598d8a,'name');_0x121f0e[_0x2d1f('0x2c')]=_[_0x2d1f('0x2d')](_0x3b798b[_0x2d1f('0x2c')]);_0x121f0e[_0x2d1f('0x2e')]=_[_0x2d1f('0x2f')](_0x121f0e[_0x2d1f('0x2b')],_0x121f0e[_0x2d1f('0x2c')]);_0x1ee937['attributes']=_[_0x2d1f('0x2f')](_0x121f0e[_0x2d1f('0x2b')],qs[_0x2d1f('0x30')](_0x3b798b[_0x2d1f('0x2c')][_0x2d1f('0x30')]));_0x1ee937[_0x2d1f('0x31')]=_0x1ee937[_0x2d1f('0x31')]['length']?_0x1ee937['attributes']:_0x121f0e[_0x2d1f('0x2b')];if(!_0x3b798b['query'][_0x2d1f('0x32')](_0x2d1f('0x33'))){_0x1ee937['limit']=qs[_0x2d1f('0x1c')](_0x3b798b[_0x2d1f('0x2c')][_0x2d1f('0x1c')]);_0x1ee937[_0x2d1f('0x1d')]=qs[_0x2d1f('0x1d')](_0x3b798b['query'][_0x2d1f('0x1d')]);}_0x1ee937[_0x2d1f('0x34')]=qs[_0x2d1f('0x35')](_0x3b798b[_0x2d1f('0x2c')][_0x2d1f('0x35')]);_0x1ee937[_0x2d1f('0x36')]=qs['filters'](_[_0x2d1f('0x37')](_0x3b798b[_0x2d1f('0x2c')],_0x121f0e[_0x2d1f('0x2e')]),_0x598d8a);if(_0x3b798b['query'][_0x2d1f('0x38')]){_0x1ee937[_0x2d1f('0x36')]=_[_0x2d1f('0x39')](_0x1ee937['where'],{'$or':_['map'](_0x598d8a,function(_0x2aed86){if(_0x2aed86[_0x2d1f('0x3a')]!==_0x2d1f('0x3b')){var _0x232a9a={};_0x232a9a[_0x2aed86[_0x2d1f('0x25')]]={'$like':'%'+_0x3b798b[_0x2d1f('0x2c')]['filter']+'%'};return _0x232a9a;}})});}_0x1ee937=_[_0x2d1f('0x39')]({},_0x1ee937,_0x3b798b[_0x2d1f('0x3c')]);var _0x24ec2f={'where':_0x1ee937['where']};return db['Automation'][_0x2d1f('0x1e')](_0x24ec2f)[_0x2d1f('0x3d')](function(_0x31bfee){_0x10be9b[_0x2d1f('0x1e')]=_0x31bfee;if(_0x3b798b[_0x2d1f('0x2c')][_0x2d1f('0x3e')]){_0x1ee937[_0x2d1f('0x3f')]=[{'all':!![]}];}return db['Automation'][_0x2d1f('0x40')](_0x1ee937);})[_0x2d1f('0x3d')](function(_0x5853d6){_0x10be9b[_0x2d1f('0x41')]=_0x5853d6;return _0x10be9b;})[_0x2d1f('0x3d')](respondWithFilteredResult(_0x566ce1,_0x1ee937))[_0x2d1f('0x42')](handleError(_0x566ce1,null));};exports[_0x2d1f('0x43')]=function(_0x215d45,_0x44422a){var _0x3caad8={'raw':![],'where':{'id':_0x215d45['params']['id']}},_0x387075={};_0x387075[_0x2d1f('0x2b')]=_['keys'](db[_0x2d1f('0x44')][_0x2d1f('0x29')]);_0x387075[_0x2d1f('0x2c')]=_[_0x2d1f('0x2d')](_0x215d45[_0x2d1f('0x2c')]);_0x387075[_0x2d1f('0x2e')]=_['intersection'](_0x387075[_0x2d1f('0x2b')],_0x387075[_0x2d1f('0x2c')]);_0x3caad8[_0x2d1f('0x31')]=_[_0x2d1f('0x2f')](_0x387075[_0x2d1f('0x2b')],qs[_0x2d1f('0x30')](_0x215d45[_0x2d1f('0x2c')][_0x2d1f('0x30')]));_0x3caad8[_0x2d1f('0x31')]=_0x3caad8[_0x2d1f('0x31')][_0x2d1f('0x45')]?_0x3caad8[_0x2d1f('0x31')]:_0x387075[_0x2d1f('0x2b')];if(_0x215d45[_0x2d1f('0x2c')][_0x2d1f('0x3e')]){_0x3caad8[_0x2d1f('0x3f')]=[{'all':!![]}];}_0x3caad8=_[_0x2d1f('0x39')]({},_0x3caad8,_0x215d45[_0x2d1f('0x3c')]);return db[_0x2d1f('0x44')][_0x2d1f('0x46')](_0x3caad8)['then'](handleEntityNotFound(_0x44422a,null))[_0x2d1f('0x3d')](respondWithResult(_0x44422a,null))[_0x2d1f('0x42')](handleError(_0x44422a,null));};exports[_0x2d1f('0x47')]=function(_0x4d0536,_0x341d96){return db[_0x2d1f('0x44')][_0x2d1f('0x47')](_0x4d0536['body'],{})['then'](respondWithResult(_0x341d96,0xc9))[_0x2d1f('0x42')](handleError(_0x341d96,null));};exports[_0x2d1f('0x48')]=function(_0x535e98,_0x3fa093){if(_0x535e98[_0x2d1f('0x49')]['id']){delete _0x535e98['body']['id'];}return db[_0x2d1f('0x44')]['find']({'where':{'id':_0x535e98[_0x2d1f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3fa093,null))[_0x2d1f('0x3d')](saveUpdates(_0x535e98['body'],null))[_0x2d1f('0x3d')](respondWithResult(_0x3fa093,null))[_0x2d1f('0x42')](handleError(_0x3fa093,null));};exports['destroy']=function(_0x3165c4,_0x3194a2){return db[_0x2d1f('0x44')][_0x2d1f('0x46')]({'where':{'id':_0x3165c4[_0x2d1f('0x4a')]['id']}})[_0x2d1f('0x3d')](handleEntityNotFound(_0x3194a2,null))[_0x2d1f('0x3d')](removeEntity(_0x3194a2,null))[_0x2d1f('0x42')](handleError(_0x3194a2,null));};exports[_0x2d1f('0x4b')]=function(_0x406268,_0x2777f2,_0x299677){return db[_0x2d1f('0x4c')][_0x2d1f('0x46')]({'where':{'id':_0x406268[_0x2d1f('0x4a')]['id']}})[_0x2d1f('0x3d')](handleEntityNotFound(_0x2777f2,null))[_0x2d1f('0x3d')](function(_0x1878db){if(_0x1878db){return _0x1878db['addConditions'](_0x406268[_0x2d1f('0x49')][_0x2d1f('0x4d')],_[_0x2d1f('0x4e')](_0x406268[_0x2d1f('0x49')],[_0x2d1f('0x4d'),'id'])||{});}})[_0x2d1f('0x3d')](respondWithResult(_0x2777f2,null))[_0x2d1f('0x42')](handleError(_0x2777f2,null));};exports['getConditions']=function(_0x5ab22c,_0x5c27b7,_0x2f21a6){var _0x324c71={};var _0x5a2b96={};var _0x567396;var _0x235de5;return db[_0x2d1f('0x44')][_0x2d1f('0x4f')]({'where':{'id':_0x5ab22c['params']['id']}})['then'](handleEntityNotFound(_0x5c27b7,null))[_0x2d1f('0x3d')](function(_0x53ffbc){if(_0x53ffbc){_0x567396=_0x53ffbc;_0x5a2b96[_0x2d1f('0x2b')]=_[_0x2d1f('0x2d')](db[_0x2d1f('0x4c')][_0x2d1f('0x29')]);_0x5a2b96[_0x2d1f('0x2c')]=_[_0x2d1f('0x2d')](_0x5ab22c[_0x2d1f('0x2c')]);_0x5a2b96[_0x2d1f('0x2e')]=_['intersection'](_0x5a2b96['model'],_0x5a2b96['query']);_0x324c71[_0x2d1f('0x31')]=_['intersection'](_0x5a2b96[_0x2d1f('0x2b')],qs[_0x2d1f('0x30')](_0x5ab22c['query']['fields']));_0x324c71[_0x2d1f('0x31')]=_0x324c71['attributes'][_0x2d1f('0x45')]?_0x324c71[_0x2d1f('0x31')]:_0x5a2b96['model'];_0x324c71[_0x2d1f('0x34')]=qs[_0x2d1f('0x35')](_0x5ab22c[_0x2d1f('0x2c')][_0x2d1f('0x35')]);_0x324c71[_0x2d1f('0x36')]=qs['filters'](_[_0x2d1f('0x37')](_0x5ab22c[_0x2d1f('0x2c')],_0x5a2b96[_0x2d1f('0x2e')]));if(_0x5ab22c[_0x2d1f('0x2c')]['filter']){_0x324c71[_0x2d1f('0x36')]=_['merge'](_0x324c71[_0x2d1f('0x36')],{'$or':_['map'](_0x324c71[_0x2d1f('0x31')],function(_0x2a9f8d){var _0x355dbe={};_0x355dbe[_0x2a9f8d]={'$like':'%'+_0x5ab22c[_0x2d1f('0x2c')][_0x2d1f('0x38')]+'%'};return _0x355dbe;})});}_0x324c71=_['merge']({},_0x324c71,_0x5ab22c[_0x2d1f('0x3c')]);return _0x567396[_0x2d1f('0x50')](_0x324c71);}})['then'](function(_0x2cee56){if(_0x2cee56){_0x235de5=_0x2cee56[_0x2d1f('0x45')];if(!_0x5ab22c[_0x2d1f('0x2c')]['hasOwnProperty']('nolimit')){_0x324c71[_0x2d1f('0x1c')]=qs[_0x2d1f('0x1c')](_0x5ab22c['query'][_0x2d1f('0x1c')]);_0x324c71['offset']=qs['offset'](_0x5ab22c[_0x2d1f('0x2c')][_0x2d1f('0x1d')]);}return _0x567396[_0x2d1f('0x50')](_0x324c71);}})[_0x2d1f('0x3d')](function(_0x131a4c){if(_0x131a4c){return _0x131a4c?{'count':_0x235de5,'rows':_0x131a4c}:null;}})['then'](respondWithResult(_0x5c27b7,null))[_0x2d1f('0x42')](handleError(_0x5c27b7,null));};exports['addActions']=function(_0x2767ea,_0x2a6853,_0x247315){return db['Action'][_0x2d1f('0x46')]({'where':{'id':_0x2767ea['params']['id']}})['then'](handleEntityNotFound(_0x2a6853,null))['then'](function(_0x37b9bf){if(_0x37b9bf){return _0x37b9bf['addActions'](_0x2767ea['body'][_0x2d1f('0x4d')],_[_0x2d1f('0x4e')](_0x2767ea[_0x2d1f('0x49')],[_0x2d1f('0x4d'),'id'])||{});}})[_0x2d1f('0x3d')](respondWithResult(_0x2a6853,null))['catch'](handleError(_0x2a6853,null));};exports['getActions']=function(_0x1367a9,_0x27a508,_0x535950){var _0x48c5d9={};var _0x2323e6={};var _0x4a6966;var _0x28c242;return db['Automation']['findOne']({'where':{'id':_0x1367a9[_0x2d1f('0x4a')]['id']}})[_0x2d1f('0x3d')](handleEntityNotFound(_0x27a508,null))['then'](function(_0x3385f9){if(_0x3385f9){_0x4a6966=_0x3385f9;_0x2323e6[_0x2d1f('0x2b')]=_[_0x2d1f('0x2d')](db[_0x2d1f('0x51')]['rawAttributes']);_0x2323e6[_0x2d1f('0x2c')]=_[_0x2d1f('0x2d')](_0x1367a9[_0x2d1f('0x2c')]);_0x2323e6[_0x2d1f('0x2e')]=_['intersection'](_0x2323e6[_0x2d1f('0x2b')],_0x2323e6['query']);_0x48c5d9[_0x2d1f('0x31')]=_[_0x2d1f('0x2f')](_0x2323e6['model'],qs[_0x2d1f('0x30')](_0x1367a9[_0x2d1f('0x2c')][_0x2d1f('0x30')]));_0x48c5d9['attributes']=_0x48c5d9['attributes'][_0x2d1f('0x45')]?_0x48c5d9[_0x2d1f('0x31')]:_0x2323e6[_0x2d1f('0x2b')];_0x48c5d9['order']=qs[_0x2d1f('0x35')](_0x1367a9['query']['sort']);_0x48c5d9[_0x2d1f('0x36')]=qs[_0x2d1f('0x2e')](_[_0x2d1f('0x37')](_0x1367a9[_0x2d1f('0x2c')],_0x2323e6[_0x2d1f('0x2e')]));if(_0x1367a9['query'][_0x2d1f('0x38')]){_0x48c5d9[_0x2d1f('0x36')]=_[_0x2d1f('0x39')](_0x48c5d9[_0x2d1f('0x36')],{'$or':_[_0x2d1f('0x28')](_0x48c5d9['attributes'],function(_0x4ac1ee){var _0x82270c={};_0x82270c[_0x4ac1ee]={'$like':'%'+_0x1367a9[_0x2d1f('0x2c')][_0x2d1f('0x38')]+'%'};return _0x82270c;})});}_0x48c5d9=_[_0x2d1f('0x39')]({},_0x48c5d9,_0x1367a9['options']);return _0x4a6966[_0x2d1f('0x52')](_0x48c5d9);}})[_0x2d1f('0x3d')](function(_0x5d51ed){if(_0x5d51ed){_0x28c242=_0x5d51ed[_0x2d1f('0x45')];if(!_0x1367a9[_0x2d1f('0x2c')][_0x2d1f('0x32')](_0x2d1f('0x33'))){_0x48c5d9[_0x2d1f('0x1c')]=qs[_0x2d1f('0x1c')](_0x1367a9['query'][_0x2d1f('0x1c')]);_0x48c5d9[_0x2d1f('0x1d')]=qs[_0x2d1f('0x1d')](_0x1367a9[_0x2d1f('0x2c')][_0x2d1f('0x1d')]);}return _0x4a6966['getActions'](_0x48c5d9);}})[_0x2d1f('0x3d')](function(_0x52d24f){if(_0x52d24f){return _0x52d24f?{'count':_0x28c242,'rows':_0x52d24f}:null;}})['then'](respondWithResult(_0x27a508,null))[_0x2d1f('0x42')](handleError(_0x27a508,null));};
\ No newline at end of file
+var _0x8654=['destroy','end','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','filter','merge','include','rows','catch','params','find','body','addConditions','ids','Condition','options','getConditions','hasOwnProperty','addActions','Action','omit','getActions','findOne','pick','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x8654,0xcf));var _0x4865=function(_0x4def94,_0x53665e){_0x4def94=_0x4def94-0x0;var _0x4b68c7=_0x8654[_0x4def94];return _0x4b68c7;};'use strict';var emlformat=require(_0x4865('0x0'));var rimraf=require(_0x4865('0x1'));var zipdir=require(_0x4865('0x2'));var jsonpatch=require(_0x4865('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4865('0x4'));var Mustache=require(_0x4865('0x5'));var util=require(_0x4865('0x6'));var path=require(_0x4865('0x7'));var sox=require(_0x4865('0x8'));var csv=require(_0x4865('0x9'));var ejs=require(_0x4865('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4865('0xb'));var squel=require('squel');var crypto=require(_0x4865('0xc'));var jsforce=require(_0x4865('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4865('0x9'));var querystring=require(_0x4865('0xe'));var Papa=require(_0x4865('0xf'));var Redis=require(_0x4865('0x10'));var authService=require(_0x4865('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4865('0x12'));var hardwareService=require(_0x4865('0x13'));var logger=require(_0x4865('0x14'))(_0x4865('0x15'));var utils=require(_0x4865('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4865('0x17'))['db'];function respondWithStatusCode(_0x744fb9,_0x1070dd){_0x1070dd=_0x1070dd||0xcc;return function(_0x5b9bf3){if(_0x5b9bf3){return _0x744fb9[_0x4865('0x18')](_0x1070dd);}return _0x744fb9['status'](_0x1070dd)['end']();};}function respondWithResult(_0x21de99,_0x5b3814){_0x5b3814=_0x5b3814||0xc8;return function(_0x5b056f){if(_0x5b056f){return _0x21de99[_0x4865('0x19')](_0x5b3814)[_0x4865('0x1a')](_0x5b056f);}};}function respondWithFilteredResult(_0x5680f7,_0x47419b){return function(_0x232b43){if(_0x232b43){var _0x32bd31=typeof _0x47419b[_0x4865('0x1b')]===_0x4865('0x1c')&&typeof _0x47419b[_0x4865('0x1d')]===_0x4865('0x1c');var _0x4b5a8f=_0x232b43[_0x4865('0x1e')];var _0x583f74=_0x32bd31?0x0:_0x47419b['offset'];var _0x4dfc65=_0x32bd31?_0x232b43[_0x4865('0x1e')]:_0x47419b[_0x4865('0x1b')]+_0x47419b[_0x4865('0x1d')];var _0x25b0de;if(_0x4dfc65>=_0x4b5a8f){_0x4dfc65=_0x4b5a8f;_0x25b0de=0xc8;}else{_0x25b0de=0xce;}_0x5680f7[_0x4865('0x19')](_0x25b0de);return _0x5680f7[_0x4865('0x1f')]('Content-Range',_0x583f74+'-'+_0x4dfc65+'/'+_0x4b5a8f)[_0x4865('0x1a')](_0x232b43);}return null;};}function patchUpdates(_0x3835ec){return function(_0x2608d5){try{jsonpatch['apply'](_0x2608d5,_0x3835ec,!![]);}catch(_0x4ad6a5){return BPromise[_0x4865('0x20')](_0x4ad6a5);}return _0x2608d5[_0x4865('0x21')]();};}function saveUpdates(_0x33c9fd,_0x14680e){return function(_0x1ac1b2){if(_0x1ac1b2){return _0x1ac1b2[_0x4865('0x22')](_0x33c9fd)[_0x4865('0x23')](function(_0x1c67e1){return _0x1c67e1;});}return null;};}function removeEntity(_0x2d80bf,_0x82e04e){return function(_0x1c8543){if(_0x1c8543){return _0x1c8543[_0x4865('0x24')]()['then'](function(){_0x2d80bf[_0x4865('0x19')](0xcc)[_0x4865('0x25')]();});}};}function handleEntityNotFound(_0x2b97f5,_0x460f6c){return function(_0x3269d5){if(!_0x3269d5){_0x2b97f5[_0x4865('0x18')](0x194);}return _0x3269d5;};}function handleError(_0x8571eb,_0x2d65e1){_0x2d65e1=_0x2d65e1||0x1f4;return function(_0x162b9b){logger[_0x4865('0x26')](_0x162b9b[_0x4865('0x27')]);if(_0x162b9b[_0x4865('0x28')]){delete _0x162b9b['name'];}_0x8571eb[_0x4865('0x19')](_0x2d65e1)[_0x4865('0x29')](_0x162b9b);};}exports[_0x4865('0x2a')]=function(_0x525813,_0x35147c){var _0x4975ad={},_0x24741a={},_0x1a2f84={'count':0x0,'rows':[]};var _0x510fef=_[_0x4865('0x2b')](db[_0x4865('0x2c')][_0x4865('0x2d')],function(_0x2c0864){return{'name':_0x2c0864[_0x4865('0x2e')],'type':_0x2c0864[_0x4865('0x2f')][_0x4865('0x30')]};});_0x24741a['model']=_['map'](_0x510fef,_0x4865('0x28'));_0x24741a['query']=_[_0x4865('0x31')](_0x525813[_0x4865('0x32')]);_0x24741a[_0x4865('0x33')]=_[_0x4865('0x34')](_0x24741a[_0x4865('0x35')],_0x24741a[_0x4865('0x32')]);_0x4975ad['attributes']=_[_0x4865('0x34')](_0x24741a['model'],qs[_0x4865('0x36')](_0x525813[_0x4865('0x32')][_0x4865('0x36')]));_0x4975ad[_0x4865('0x37')]=_0x4975ad[_0x4865('0x37')][_0x4865('0x38')]?_0x4975ad[_0x4865('0x37')]:_0x24741a['model'];if(!_0x525813[_0x4865('0x32')]['hasOwnProperty'](_0x4865('0x39'))){_0x4975ad[_0x4865('0x1d')]=qs[_0x4865('0x1d')](_0x525813['query'][_0x4865('0x1d')]);_0x4975ad[_0x4865('0x1b')]=qs[_0x4865('0x1b')](_0x525813['query'][_0x4865('0x1b')]);}_0x4975ad[_0x4865('0x3a')]=qs[_0x4865('0x3b')](_0x525813[_0x4865('0x32')][_0x4865('0x3b')]);_0x4975ad[_0x4865('0x3c')]=qs['filters'](_['pick'](_0x525813[_0x4865('0x32')],_0x24741a[_0x4865('0x33')]),_0x510fef);if(_0x525813[_0x4865('0x32')][_0x4865('0x3d')]){_0x4975ad['where']=_[_0x4865('0x3e')](_0x4975ad[_0x4865('0x3c')],{'$or':_[_0x4865('0x2b')](_0x510fef,function(_0x1d1df3){if(_0x1d1df3[_0x4865('0x2f')]!=='VIRTUAL'){var _0x538f11={};_0x538f11[_0x1d1df3[_0x4865('0x28')]]={'$like':'%'+_0x525813[_0x4865('0x32')][_0x4865('0x3d')]+'%'};return _0x538f11;}})});}_0x4975ad=_[_0x4865('0x3e')]({},_0x4975ad,_0x525813['options']);var _0xe7560c={'where':_0x4975ad[_0x4865('0x3c')]};return db[_0x4865('0x2c')][_0x4865('0x1e')](_0xe7560c)[_0x4865('0x23')](function(_0x346fc9){_0x1a2f84[_0x4865('0x1e')]=_0x346fc9;if(_0x525813[_0x4865('0x32')]['includeAll']){_0x4975ad[_0x4865('0x3f')]=[{'all':!![]}];}return db[_0x4865('0x2c')]['findAll'](_0x4975ad);})['then'](function(_0x17b91b){_0x1a2f84[_0x4865('0x40')]=_0x17b91b;return _0x1a2f84;})['then'](respondWithFilteredResult(_0x35147c,_0x4975ad))[_0x4865('0x41')](handleError(_0x35147c,null));};exports['show']=function(_0x663d0f,_0xdafd52){var _0x12fe77={'raw':![],'where':{'id':_0x663d0f[_0x4865('0x42')]['id']}},_0x69ceb1={};_0x69ceb1[_0x4865('0x35')]=_[_0x4865('0x31')](db[_0x4865('0x2c')]['rawAttributes']);_0x69ceb1[_0x4865('0x32')]=_['keys'](_0x663d0f[_0x4865('0x32')]);_0x69ceb1[_0x4865('0x33')]=_[_0x4865('0x34')](_0x69ceb1[_0x4865('0x35')],_0x69ceb1['query']);_0x12fe77[_0x4865('0x37')]=_[_0x4865('0x34')](_0x69ceb1['model'],qs[_0x4865('0x36')](_0x663d0f['query'][_0x4865('0x36')]));_0x12fe77[_0x4865('0x37')]=_0x12fe77[_0x4865('0x37')][_0x4865('0x38')]?_0x12fe77[_0x4865('0x37')]:_0x69ceb1['model'];if(_0x663d0f[_0x4865('0x32')]['includeAll']){_0x12fe77[_0x4865('0x3f')]=[{'all':!![]}];}_0x12fe77=_[_0x4865('0x3e')]({},_0x12fe77,_0x663d0f['options']);return db[_0x4865('0x2c')][_0x4865('0x43')](_0x12fe77)[_0x4865('0x23')](handleEntityNotFound(_0xdafd52,null))[_0x4865('0x23')](respondWithResult(_0xdafd52,null))[_0x4865('0x41')](handleError(_0xdafd52,null));};exports['create']=function(_0x515eac,_0x470e29){return db['Automation']['create'](_0x515eac['body'],{})[_0x4865('0x23')](respondWithResult(_0x470e29,0xc9))[_0x4865('0x41')](handleError(_0x470e29,null));};exports['update']=function(_0x30ccb5,_0x2b1b31){if(_0x30ccb5[_0x4865('0x44')]['id']){delete _0x30ccb5[_0x4865('0x44')]['id'];}return db['Automation'][_0x4865('0x43')]({'where':{'id':_0x30ccb5[_0x4865('0x42')]['id']}})['then'](handleEntityNotFound(_0x2b1b31,null))[_0x4865('0x23')](saveUpdates(_0x30ccb5[_0x4865('0x44')],null))[_0x4865('0x23')](respondWithResult(_0x2b1b31,null))[_0x4865('0x41')](handleError(_0x2b1b31,null));};exports[_0x4865('0x24')]=function(_0x43d23a,_0x2e2efb){return db[_0x4865('0x2c')]['find']({'where':{'id':_0x43d23a[_0x4865('0x42')]['id']}})[_0x4865('0x23')](handleEntityNotFound(_0x2e2efb,null))['then'](removeEntity(_0x2e2efb,null))[_0x4865('0x41')](handleError(_0x2e2efb,null));};exports[_0x4865('0x45')]=function(_0x19436b,_0x1cf5ed,_0x536114){return db['Condition'][_0x4865('0x43')]({'where':{'id':_0x19436b[_0x4865('0x42')]['id']}})['then'](handleEntityNotFound(_0x1cf5ed,null))[_0x4865('0x23')](function(_0x23a6d9){if(_0x23a6d9){return _0x23a6d9[_0x4865('0x45')](_0x19436b[_0x4865('0x44')][_0x4865('0x46')],_['omit'](_0x19436b[_0x4865('0x44')],[_0x4865('0x46'),'id'])||{});}})[_0x4865('0x23')](respondWithResult(_0x1cf5ed,null))[_0x4865('0x41')](handleError(_0x1cf5ed,null));};exports['getConditions']=function(_0x1f88b1,_0x1d0f93,_0xead82d){var _0x521c23={};var _0x1c6285={};var _0x505eb4;var _0x2f29f9;return db[_0x4865('0x2c')]['findOne']({'where':{'id':_0x1f88b1[_0x4865('0x42')]['id']}})[_0x4865('0x23')](handleEntityNotFound(_0x1d0f93,null))[_0x4865('0x23')](function(_0x1bc33e){if(_0x1bc33e){_0x505eb4=_0x1bc33e;_0x1c6285['model']=_[_0x4865('0x31')](db[_0x4865('0x47')][_0x4865('0x2d')]);_0x1c6285[_0x4865('0x32')]=_['keys'](_0x1f88b1[_0x4865('0x32')]);_0x1c6285[_0x4865('0x33')]=_[_0x4865('0x34')](_0x1c6285[_0x4865('0x35')],_0x1c6285[_0x4865('0x32')]);_0x521c23[_0x4865('0x37')]=_[_0x4865('0x34')](_0x1c6285[_0x4865('0x35')],qs[_0x4865('0x36')](_0x1f88b1[_0x4865('0x32')]['fields']));_0x521c23[_0x4865('0x37')]=_0x521c23[_0x4865('0x37')]['length']?_0x521c23[_0x4865('0x37')]:_0x1c6285[_0x4865('0x35')];_0x521c23[_0x4865('0x3a')]=qs[_0x4865('0x3b')](_0x1f88b1[_0x4865('0x32')][_0x4865('0x3b')]);_0x521c23['where']=qs[_0x4865('0x33')](_['pick'](_0x1f88b1[_0x4865('0x32')],_0x1c6285[_0x4865('0x33')]));if(_0x1f88b1[_0x4865('0x32')][_0x4865('0x3d')]){_0x521c23[_0x4865('0x3c')]=_[_0x4865('0x3e')](_0x521c23['where'],{'$or':_[_0x4865('0x2b')](_0x521c23[_0x4865('0x37')],function(_0x80e740){var _0x1fd0b7={};_0x1fd0b7[_0x80e740]={'$like':'%'+_0x1f88b1[_0x4865('0x32')]['filter']+'%'};return _0x1fd0b7;})});}_0x521c23=_['merge']({},_0x521c23,_0x1f88b1[_0x4865('0x48')]);return _0x505eb4[_0x4865('0x49')](_0x521c23);}})['then'](function(_0x4fd0a3){if(_0x4fd0a3){_0x2f29f9=_0x4fd0a3['length'];if(!_0x1f88b1['query'][_0x4865('0x4a')]('nolimit')){_0x521c23[_0x4865('0x1d')]=qs[_0x4865('0x1d')](_0x1f88b1[_0x4865('0x32')][_0x4865('0x1d')]);_0x521c23[_0x4865('0x1b')]=qs['offset'](_0x1f88b1[_0x4865('0x32')][_0x4865('0x1b')]);}return _0x505eb4[_0x4865('0x49')](_0x521c23);}})[_0x4865('0x23')](function(_0x10b045){if(_0x10b045){return _0x10b045?{'count':_0x2f29f9,'rows':_0x10b045}:null;}})[_0x4865('0x23')](respondWithResult(_0x1d0f93,null))[_0x4865('0x41')](handleError(_0x1d0f93,null));};exports[_0x4865('0x4b')]=function(_0x4984bf,_0x585dd,_0x44275f){return db[_0x4865('0x4c')][_0x4865('0x43')]({'where':{'id':_0x4984bf['params']['id']}})['then'](handleEntityNotFound(_0x585dd,null))['then'](function(_0x4b99a9){if(_0x4b99a9){return _0x4b99a9['addActions'](_0x4984bf[_0x4865('0x44')]['ids'],_[_0x4865('0x4d')](_0x4984bf['body'],[_0x4865('0x46'),'id'])||{});}})[_0x4865('0x23')](respondWithResult(_0x585dd,null))['catch'](handleError(_0x585dd,null));};exports[_0x4865('0x4e')]=function(_0x50d78,_0x2830bb,_0x2b670c){var _0x26fac8={};var _0x20011f={};var _0x5f2b4a;var _0x2347bd;return db[_0x4865('0x2c')][_0x4865('0x4f')]({'where':{'id':_0x50d78[_0x4865('0x42')]['id']}})[_0x4865('0x23')](handleEntityNotFound(_0x2830bb,null))[_0x4865('0x23')](function(_0xdb514b){if(_0xdb514b){_0x5f2b4a=_0xdb514b;_0x20011f[_0x4865('0x35')]=_[_0x4865('0x31')](db[_0x4865('0x4c')][_0x4865('0x2d')]);_0x20011f['query']=_[_0x4865('0x31')](_0x50d78[_0x4865('0x32')]);_0x20011f[_0x4865('0x33')]=_[_0x4865('0x34')](_0x20011f['model'],_0x20011f[_0x4865('0x32')]);_0x26fac8['attributes']=_[_0x4865('0x34')](_0x20011f[_0x4865('0x35')],qs[_0x4865('0x36')](_0x50d78[_0x4865('0x32')][_0x4865('0x36')]));_0x26fac8[_0x4865('0x37')]=_0x26fac8['attributes'][_0x4865('0x38')]?_0x26fac8[_0x4865('0x37')]:_0x20011f['model'];_0x26fac8[_0x4865('0x3a')]=qs[_0x4865('0x3b')](_0x50d78[_0x4865('0x32')]['sort']);_0x26fac8[_0x4865('0x3c')]=qs[_0x4865('0x33')](_[_0x4865('0x50')](_0x50d78[_0x4865('0x32')],_0x20011f[_0x4865('0x33')]));if(_0x50d78[_0x4865('0x32')][_0x4865('0x3d')]){_0x26fac8[_0x4865('0x3c')]=_['merge'](_0x26fac8[_0x4865('0x3c')],{'$or':_['map'](_0x26fac8[_0x4865('0x37')],function(_0x4ecf86){var _0xf42094={};_0xf42094[_0x4ecf86]={'$like':'%'+_0x50d78[_0x4865('0x32')][_0x4865('0x3d')]+'%'};return _0xf42094;})});}_0x26fac8=_[_0x4865('0x3e')]({},_0x26fac8,_0x50d78[_0x4865('0x48')]);return _0x5f2b4a[_0x4865('0x4e')](_0x26fac8);}})[_0x4865('0x23')](function(_0x16fc7d){if(_0x16fc7d){_0x2347bd=_0x16fc7d[_0x4865('0x38')];if(!_0x50d78['query'][_0x4865('0x4a')](_0x4865('0x39'))){_0x26fac8[_0x4865('0x1d')]=qs[_0x4865('0x1d')](_0x50d78[_0x4865('0x32')][_0x4865('0x1d')]);_0x26fac8['offset']=qs[_0x4865('0x1b')](_0x50d78[_0x4865('0x32')][_0x4865('0x1b')]);}return _0x5f2b4a[_0x4865('0x4e')](_0x26fac8);}})['then'](function(_0x411d93){if(_0x411d93){return _0x411d93?{'count':_0x2347bd,'rows':_0x411d93}:null;}})[_0x4865('0x23')](respondWithResult(_0x2830bb,null))['catch'](handleError(_0x2830bb,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 612e3a3..9782bf6 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 _0xa45c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','util','api'];(function(_0x32ae4e,_0x1dd4b0){var _0x1084a7=function(_0x50c403){while(--_0x50c403){_0x32ae4e['push'](_0x32ae4e['shift']());}};_0x1084a7(++_0x1dd4b0);}(_0xa45c,0xb4));var _0xca45=function(_0x580955,_0x1ad93f){_0x580955=_0x580955-0x0;var _0x1c727f=_0xa45c[_0x580955];return _0x1c727f;};'use strict';var _=require('lodash');var util=require(_0xca45('0x0'));var logger=require('../../config/logger')(_0xca45('0x1'));var moment=require(_0xca45('0x2'));var BPromise=require(_0xca45('0x3'));var rp=require(_0xca45('0x4'));var fs=require('fs');var path=require(_0xca45('0x5'));var rimraf=require(_0xca45('0x6'));var config=require(_0xca45('0x7'));var attributes=require(_0xca45('0x8'));module[_0xca45('0x9')]=function(_0x435859,_0x45ca44){return _0x435859[_0xca45('0xa')](_0xca45('0xb'),attributes,{'tableName':_0xca45('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf4ab=['../../config/environment','./automation.attributes','exports','define','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x54a4b4,_0x596ffa){var _0x2dd6ba=function(_0x3cc84c){while(--_0x3cc84c){_0x54a4b4['push'](_0x54a4b4['shift']());}};_0x2dd6ba(++_0x596ffa);}(_0xf4ab,0x17f));var _0xbf4a=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xf4ab[_0x59c301];return _0x3866b9;};'use strict';var _=require(_0xbf4a('0x0'));var util=require(_0xbf4a('0x1'));var logger=require(_0xbf4a('0x2'))(_0xbf4a('0x3'));var moment=require(_0xbf4a('0x4'));var BPromise=require(_0xbf4a('0x5'));var rp=require(_0xbf4a('0x6'));var fs=require('fs');var path=require(_0xbf4a('0x7'));var rimraf=require(_0xbf4a('0x8'));var config=require(_0xbf4a('0x9'));var attributes=require(_0xbf4a('0xa'));module[_0xbf4a('0xb')]=function(_0x35fb88,_0x45778f){return _0x35fb88[_0xbf4a('0xc')]('Automation',attributes,{'tableName':_0xbf4a('0xd'),'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 2cac947..453117f 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 _0xb6da=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0xff3f4a,_0x50f3b4){var _0x13db8a=function(_0x41d3c6){while(--_0x41d3c6){_0xff3f4a['push'](_0xff3f4a['shift']());}};_0x13db8a(++_0x50f3b4);}(_0xb6da,0x8e));var _0xab6d=function(_0x58ddb5,_0x16e1f7){_0x58ddb5=_0x58ddb5-0x0;var _0xc2a5bf=_0xb6da[_0x58ddb5];return _0xc2a5bf;};'use strict';var _=require(_0xab6d('0x0'));var util=require('util');var moment=require(_0xab6d('0x1'));var BPromise=require(_0xab6d('0x2'));var rs=require(_0xab6d('0x3'));var fs=require('fs');var Redis=require(_0xab6d('0x4'));var db=require(_0xab6d('0x5'))['db'];var utils=require(_0xab6d('0x6'));var logger=require(_0xab6d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xab6d('0x8'));var client=jayson[_0xab6d('0x9')][_0xab6d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x130285,_0x359bef,_0x44d5fa){return new BPromise(function(_0x4ba0f7,_0x2e30f1){return client['request'](_0x130285,_0x44d5fa)[_0xab6d('0xb')](function(_0x590cfa){logger['info'](_0xab6d('0xc'),_0x359bef,_0xab6d('0xd'));logger['debug'](_0xab6d('0xe'),_0x359bef,'request\x20sent',JSON['stringify'](_0x590cfa));if(_0x590cfa[_0xab6d('0xf')]){if(_0x590cfa[_0xab6d('0xf')][_0xab6d('0x10')]===0x1f4){logger[_0xab6d('0xf')](_0xab6d('0xc'),_0x359bef,_0x590cfa[_0xab6d('0xf')][_0xab6d('0x11')]);return _0x2e30f1(_0x590cfa[_0xab6d('0xf')]['message']);}logger[_0xab6d('0xf')](_0xab6d('0xc'),_0x359bef,_0x590cfa[_0xab6d('0xf')][_0xab6d('0x11')]);return _0x4ba0f7(_0x590cfa[_0xab6d('0xf')][_0xab6d('0x11')]);}else{logger['info'](_0xab6d('0xc'),_0x359bef,_0xab6d('0xd'));_0x4ba0f7(_0x590cfa[_0xab6d('0x12')]['message']);}})[_0xab6d('0x13')](function(_0x3bd40a){logger[_0xab6d('0xf')](_0xab6d('0xc'),_0x359bef,_0x3bd40a);_0x2e30f1(_0x3bd40a);});});}
\ No newline at end of file
+var _0xc5df=['message','result','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x58dbe8,_0x3567dc){var _0x568dd1=function(_0x2c73c7){while(--_0x2c73c7){_0x58dbe8['push'](_0x58dbe8['shift']());}};_0x568dd1(++_0x3567dc);}(_0xc5df,0x80));var _0xfc5d=function(_0x25fe3e,_0x19b2a4){_0x25fe3e=_0x25fe3e-0x0;var _0xe9ba2a=_0xc5df[_0x25fe3e];return _0xe9ba2a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfc5d('0x0'));var BPromise=require(_0xfc5d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc5d('0x2'))['db'];var utils=require(_0xfc5d('0x3'));var logger=require(_0xfc5d('0x4'))(_0xfc5d('0x5'));var config=require(_0xfc5d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfc5d('0x7')][_0xfc5d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b8b10,_0x535aa7,_0x2a38ce){return new BPromise(function(_0x240ba0,_0x522712){return client[_0xfc5d('0x9')](_0x1b8b10,_0x2a38ce)[_0xfc5d('0xa')](function(_0x4f9a05){logger[_0xfc5d('0xb')](_0xfc5d('0xc'),_0x535aa7,'request\x20sent');logger[_0xfc5d('0xd')](_0xfc5d('0xe'),_0x535aa7,_0xfc5d('0xf'),JSON[_0xfc5d('0x10')](_0x4f9a05));if(_0x4f9a05['error']){if(_0x4f9a05[_0xfc5d('0x11')][_0xfc5d('0x12')]===0x1f4){logger[_0xfc5d('0x11')]('Automation,\x20%s,\x20%s',_0x535aa7,_0x4f9a05[_0xfc5d('0x11')][_0xfc5d('0x13')]);return _0x522712(_0x4f9a05['error'][_0xfc5d('0x13')]);}logger['error'](_0xfc5d('0xc'),_0x535aa7,_0x4f9a05['error'][_0xfc5d('0x13')]);return _0x240ba0(_0x4f9a05[_0xfc5d('0x11')][_0xfc5d('0x13')]);}else{logger[_0xfc5d('0xb')](_0xfc5d('0xc'),_0x535aa7,'request\x20sent');_0x240ba0(_0x4f9a05[_0xfc5d('0x14')][_0xfc5d('0x13')]);}})['catch'](function(_0x26f84a){logger['error'](_0xfc5d('0xc'),_0x535aa7,_0x26f84a);_0x522712(_0x26f84a);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 195ec19..edcf57e 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 _0xac5c=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','/:id/conditions','getConditions','getActions','post','create','addActions','put','destroy','exports','multer','util'];(function(_0x2b5ae7,_0x4cf577){var _0x43faff=function(_0x2c6eff){while(--_0x2c6eff){_0x2b5ae7['push'](_0x2b5ae7['shift']());}};_0x43faff(++_0x4cf577);}(_0xac5c,0x10f));var _0xcac5=function(_0x225ff0,_0x152ece){_0x225ff0=_0x225ff0-0x0;var _0x497f5d=_0xac5c[_0x225ff0];return _0x497f5d;};'use strict';var multer=require(_0xcac5('0x0'));var util=require(_0xcac5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcac5('0x2'));var router=express[_0xcac5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcac5('0x4'));var interaction=require(_0xcac5('0x5'));var config=require(_0xcac5('0x6'));var controller=require(_0xcac5('0x7'));router[_0xcac5('0x8')]('/',auth[_0xcac5('0x9')](),controller[_0xcac5('0xa')]);router['get'](_0xcac5('0xb'),auth[_0xcac5('0x9')](),controller['show']);router[_0xcac5('0x8')](_0xcac5('0xc'),auth[_0xcac5('0x9')](),controller[_0xcac5('0xd')]);router[_0xcac5('0x8')]('/:id/actions',auth[_0xcac5('0x9')](),controller[_0xcac5('0xe')]);router[_0xcac5('0xf')]('/',auth[_0xcac5('0x9')](),controller[_0xcac5('0x10')]);router['post'](_0xcac5('0xc'),auth[_0xcac5('0x9')](),controller['addConditions']);router[_0xcac5('0xf')]('/:id/actions',auth['isAuthenticated'](),controller[_0xcac5('0x11')]);router[_0xcac5('0x12')](_0xcac5('0xb'),auth[_0xcac5('0x9')](),controller['update']);router['delete'](_0xcac5('0xb'),auth['isAuthenticated'](),controller[_0xcac5('0x13')]);module[_0xcac5('0x14')]=router;
\ No newline at end of file
+var _0xcb18=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','index','isAuthenticated','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addConditions','addActions','/:id','update','delete','destroy','exports'];(function(_0x387061,_0x1117e0){var _0x12eb30=function(_0x3932e7){while(--_0x3932e7){_0x387061['push'](_0x387061['shift']());}};_0x12eb30(++_0x1117e0);}(_0xcb18,0x159));var _0x8cb1=function(_0x1e96bb,_0x181481){_0x1e96bb=_0x1e96bb-0x0;var _0x4e03da=_0xcb18[_0x1e96bb];return _0x4e03da;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8cb1('0x0'));var timeout=require('connect-timeout');var express=require(_0x8cb1('0x1'));var router=express['Router']();var fs_extra=require(_0x8cb1('0x2'));var auth=require(_0x8cb1('0x3'));var interaction=require(_0x8cb1('0x4'));var config=require(_0x8cb1('0x5'));var controller=require(_0x8cb1('0x6'));router[_0x8cb1('0x7')]('/',auth['isAuthenticated'](),controller[_0x8cb1('0x8')]);router[_0x8cb1('0x7')]('/:id',auth[_0x8cb1('0x9')](),controller['show']);router[_0x8cb1('0x7')](_0x8cb1('0xa'),auth['isAuthenticated'](),controller[_0x8cb1('0xb')]);router[_0x8cb1('0x7')](_0x8cb1('0xc'),auth[_0x8cb1('0x9')](),controller[_0x8cb1('0xd')]);router['post']('/',auth[_0x8cb1('0x9')](),controller[_0x8cb1('0xe')]);router[_0x8cb1('0xf')]('/:id/conditions',auth[_0x8cb1('0x9')](),controller[_0x8cb1('0x10')]);router[_0x8cb1('0xf')](_0x8cb1('0xc'),auth[_0x8cb1('0x9')](),controller[_0x8cb1('0x11')]);router['put'](_0x8cb1('0x12'),auth['isAuthenticated'](),controller[_0x8cb1('0x13')]);router[_0x8cb1('0x14')](_0x8cb1('0x12'),auth[_0x8cb1('0x9')](),controller[_0x8cb1('0x15')]);module[_0x8cb1('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index a6c4bac..de45cb3 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 _0xd75d=['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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)'];(function(_0x2a5dbd,_0x8f6f0d){var _0x167312=function(_0x2c5481){while(--_0x2c5481){_0x2a5dbd['push'](_0x2a5dbd['shift']());}};_0x167312(++_0x8f6f0d);}(_0xd75d,0x185));var _0xdd75=function(_0x18550b,_0x75f16a){_0x18550b=_0x18550b-0x0;var _0xa07369=_0xd75d[_0x18550b];return _0xa07369;};'use strict';var Sequelize=require(_0xdd75('0x0'));module[_0xdd75('0x1')]={'name':{'type':Sequelize[_0xdd75('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xdd75('0x3')](_0xdd75('0x4')),'allowNull':![],'defaultValue':_0xdd75('0x4')},'description':{'type':Sequelize[_0xdd75('0x2')]},'active':{'type':Sequelize[_0xdd75('0x5')],'defaultValue':0x0,'comment':_0xdd75('0x6')},'limitCalls':{'type':Sequelize[_0xdd75('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xdd75('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xdd75('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xdd75('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xdd75('0x7')](0x3)[_0xdd75('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd75('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdd75('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xdd75('0x7')](0x5)[_0xdd75('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdd75('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xdd75('0x7')](0x5)[_0xdd75('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xdd75('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xdd75('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xdd75('0x7')](0x5)[_0xdd75('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd75('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xdd75('0x7')](0x3)[_0xdd75('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xdd75('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xdd75('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xdd75('0x3')](_0xdd75('0xf'),'never','onlyIfOpen'),'defaultValue':_0xdd75('0xf')},'dialAMDActive':{'type':Sequelize[_0xdd75('0x5')],'defaultValue':0x0,'comment':_0xdd75('0x10')},'dialAMDInitialSilence':{'type':Sequelize[_0xdd75('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xdd75('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xdd75('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xdd75('0x7')](0x9)[_0xdd75('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xdd75('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xdd75('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdd75('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0xdd75('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xdd75('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xdd75('0x7')](0x9)[_0xdd75('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdd75('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xdd75('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xdd75('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xdd75('0x7')](0x9)[_0xdd75('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdd75('0x17')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0xdd75('0x18')),'defaultValue':_0xdd75('0x19')},'dialPrefix':{'type':Sequelize[_0xdd75('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xdd75('0x7')](0x3)[_0xdd75('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdd75('0x1a')},'dialCutDigit':{'type':Sequelize[_0xdd75('0x7')](0x3)[_0xdd75('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xdd75('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdd75('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdd75('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xdd75('0x7')](0x5)[_0xdd75('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd75('0x1b')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xdd75('0x7')](0x3)[_0xdd75('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd75('0x1c')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xdd75('0x7')](0x5)[_0xdd75('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd75('0x1d')},'dialMachineMaxRetry':{'type':Sequelize[_0xdd75('0x7')](0x3)[_0xdd75('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd75('0x1e')},'dialMachineRetryFrequency':{'type':Sequelize[_0xdd75('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xdd75('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xdd75('0x7')](0x5)[_0xdd75('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd75('0x1f')}};
\ No newline at end of file
+var _0x9f9d=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','ENUM','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','#AMD\x20Greeting'];(function(_0x2d7ec9,_0x52833e){var _0x199c90=function(_0x584caa){while(--_0x584caa){_0x2d7ec9['push'](_0x2d7ec9['shift']());}};_0x199c90(++_0x52833e);}(_0x9f9d,0x1c2));var _0xd9f9=function(_0x2282a8,_0x3cea15){_0x2282a8=_0x2282a8-0x0;var _0xa9acf2=_0x9f9d[_0x2282a8];return _0xa9acf2;};'use strict';var Sequelize=require(_0xd9f9('0x0'));module['exports']={'name':{'type':Sequelize[_0xd9f9('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd9f9('0x2')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xd9f9('0x1')]},'active':{'type':Sequelize[_0xd9f9('0x3')],'defaultValue':0x0,'comment':_0xd9f9('0x4')},'limitCalls':{'type':Sequelize[_0xd9f9('0x5')](0x4)[_0xd9f9('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd9f9('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd9f9('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd9f9('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xd9f9('0x5')](0x3)[_0xd9f9('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9f9('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd9f9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9f9('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd9f9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd9f9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9f9('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd9f9('0x5')](0x5)[_0xd9f9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9f9('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd9f9('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xd9f9('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd9f9('0x5')](0x5)[_0xd9f9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9f9('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd9f9('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xd9f9('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xd9f9('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xd9f9('0x2')](_0xd9f9('0xf'),_0xd9f9('0x10'),'onlyIfOpen'),'defaultValue':_0xd9f9('0xf')},'dialAMDActive':{'type':Sequelize[_0xd9f9('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xd9f9('0x5')](0x9)[_0xd9f9('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xd9f9('0x5')](0x9)[_0xd9f9('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd9f9('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd9f9('0x5')](0x9)[_0xd9f9('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd9f9('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd9f9('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd9f9('0x13')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xd9f9('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd9f9('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd9f9('0x5')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd9f9('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd9f9('0x5')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd9f9('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd9f9('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd9f9('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd9f9('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd9f9('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd9f9('0x2')]('DESC',_0xd9f9('0x19')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xd9f9('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd9f9('0x1a')},'dialCutDigit':{'type':Sequelize[_0xd9f9('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd9f9('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd9f9('0x5')](0x3)[_0xd9f9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9f9('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd9f9('0x5')](0x5)[_0xd9f9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9f9('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0xd9f9('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9f9('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0xd9f9('0x5')](0x5)[_0xd9f9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9f9('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd9f9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9f9('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd9f9('0x5')](0x5)[_0xd9f9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9f9('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xd9f9('0x5')](0x3)[_0xd9f9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xd9f9('0x5')](0x5)[_0xd9f9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd9f9('0x5')](0x3)[_0xd9f9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9f9('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd9f9('0x5')](0x5)[_0xd9f9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9f9('0x23')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 38d869f..2c06374 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 _0x959e=['fromQuery','scheduledAt','ContactId','ListId','select','field','phone','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','deletedAt\x20IS\x20NULL','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','count','offset','set','Content-Range','apply','save','update','IvrCampaigns','UserProfileResource','then','stack','name','send','index','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','destroy','getHoppers','findOne','CmHopper','nolimit','pick','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','into'];(function(_0x5d96ee,_0x523278){var _0x39092b=function(_0x4ae30b){while(--_0x4ae30b){_0x5d96ee['push'](_0x5d96ee['shift']());}};_0x39092b(++_0x523278);}(_0x959e,0x1e2));var _0xe959=function(_0xa60623,_0x2d4e4f){_0xa60623=_0xa60623-0x0;var _0x4a6487=_0x959e[_0xa60623];return _0x4a6487;};'use strict';var emlformat=require(_0xe959('0x0'));var rimraf=require(_0xe959('0x1'));var zipdir=require(_0xe959('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe959('0x3'));var moment=require(_0xe959('0x4'));var BPromise=require(_0xe959('0x5'));var Mustache=require(_0xe959('0x6'));var util=require(_0xe959('0x7'));var path=require(_0xe959('0x8'));var sox=require('sox');var csv=require(_0xe959('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe959('0xa'));var _=require(_0xe959('0xb'));var squel=require(_0xe959('0xc'));var crypto=require(_0xe959('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe959('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe959('0xe'));var authService=require(_0xe959('0xf'));var qs=require(_0xe959('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe959('0x11'));var logger=require(_0xe959('0x12'))(_0xe959('0x13'));var utils=require('../../config/utils');var config=require(_0xe959('0x14'));var licenseUtil=require(_0xe959('0x15'));var db=require(_0xe959('0x16'))['db'];function respondWithStatusCode(_0x3deca7,_0x1fa963){_0x1fa963=_0x1fa963||0xcc;return function(_0x5c7a12){if(_0x5c7a12){return _0x3deca7[_0xe959('0x17')](_0x1fa963);}return _0x3deca7['status'](_0x1fa963)[_0xe959('0x18')]();};}function respondWithResult(_0x5bd09e,_0x468f60){_0x468f60=_0x468f60||0xc8;return function(_0x2e68f7){if(_0x2e68f7){return _0x5bd09e[_0xe959('0x19')](_0x468f60)[_0xe959('0x1a')](_0x2e68f7);}};}function respondWithFilteredResult(_0x16a8da,_0x3bd45f){return function(_0x16835a){if(_0x16835a){var _0x48cc78=typeof _0x3bd45f['offset']==='undefined'&&typeof _0x3bd45f[_0xe959('0x1b')]==='undefined';var _0x26d496=_0x16835a[_0xe959('0x1c')];var _0x432c38=_0x48cc78?0x0:_0x3bd45f['offset'];var _0x326c4f=_0x48cc78?_0x16835a[_0xe959('0x1c')]:_0x3bd45f[_0xe959('0x1d')]+_0x3bd45f['limit'];var _0x7cd26d;if(_0x326c4f>=_0x26d496){_0x326c4f=_0x26d496;_0x7cd26d=0xc8;}else{_0x7cd26d=0xce;}_0x16a8da['status'](_0x7cd26d);return _0x16a8da[_0xe959('0x1e')](_0xe959('0x1f'),_0x432c38+'-'+_0x326c4f+'/'+_0x26d496)[_0xe959('0x1a')](_0x16835a);}return null;};}function patchUpdates(_0x40171c){return function(_0x4ad6ac){try{jsonpatch[_0xe959('0x20')](_0x4ad6ac,_0x40171c,!![]);}catch(_0x53cfcb){return BPromise['reject'](_0x53cfcb);}return _0x4ad6ac[_0xe959('0x21')]();};}function saveUpdates(_0x59ac7e,_0x5521e9){return function(_0x1bbf4f){if(_0x1bbf4f){return _0x1bbf4f[_0xe959('0x22')](_0x59ac7e)['then'](function(_0x34af4a){return _0x34af4a;});}return null;};}function removeEntity(_0x37f638,_0x5e2dda){return function(_0x4a0739){if(_0x4a0739){return _0x4a0739['destroy']()['then'](function(){var _0xbe0c93=_0x4a0739['get']({'plain':!![]});var _0x1a1cd9=_0xe959('0x23');return db[_0xe959('0x24')]['destroy']({'where':{'type':_0x1a1cd9,'resourceId':_0xbe0c93['id']}})[_0xe959('0x25')](function(){return _0x4a0739;});})[_0xe959('0x25')](function(){_0x37f638[_0xe959('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf5e0ed,_0x1cc676){return function(_0x2a39ad){if(!_0x2a39ad){_0xf5e0ed[_0xe959('0x17')](0x194);}return _0x2a39ad;};}function handleError(_0xbd3635,_0x14a521){_0x14a521=_0x14a521||0x1f4;return function(_0x562d76){logger['error'](_0x562d76[_0xe959('0x26')]);if(_0x562d76[_0xe959('0x27')]){delete _0x562d76[_0xe959('0x27')];}_0xbd3635['status'](_0x14a521)[_0xe959('0x28')](_0x562d76);};}exports[_0xe959('0x29')]=function(_0x6ba7a9,_0x147442){var _0x3eba7c={},_0x570cc1={},_0x55f000={'count':0x0,'rows':[]};var _0x2e1a73=_['map'](db[_0xe959('0x2a')][_0xe959('0x2b')],function(_0x1341c4){return{'name':_0x1341c4[_0xe959('0x2c')],'type':_0x1341c4[_0xe959('0x2d')][_0xe959('0x2e')]};});_0x570cc1[_0xe959('0x2f')]=_['map'](_0x2e1a73,'name');_0x570cc1[_0xe959('0x30')]=_[_0xe959('0x31')](_0x6ba7a9[_0xe959('0x30')]);_0x570cc1[_0xe959('0x32')]=_[_0xe959('0x33')](_0x570cc1[_0xe959('0x2f')],_0x570cc1[_0xe959('0x30')]);_0x3eba7c[_0xe959('0x34')]=_[_0xe959('0x33')](_0x570cc1['model'],qs[_0xe959('0x35')](_0x6ba7a9['query'][_0xe959('0x35')]));_0x3eba7c[_0xe959('0x34')]=_0x3eba7c['attributes'][_0xe959('0x36')]?_0x3eba7c[_0xe959('0x34')]:_0x570cc1[_0xe959('0x2f')];if(!_0x6ba7a9[_0xe959('0x30')][_0xe959('0x37')]('nolimit')){_0x3eba7c[_0xe959('0x1b')]=qs[_0xe959('0x1b')](_0x6ba7a9[_0xe959('0x30')]['limit']);_0x3eba7c['offset']=qs[_0xe959('0x1d')](_0x6ba7a9[_0xe959('0x30')][_0xe959('0x1d')]);}_0x3eba7c[_0xe959('0x38')]=qs[_0xe959('0x39')](_0x6ba7a9[_0xe959('0x30')][_0xe959('0x39')]);_0x3eba7c[_0xe959('0x3a')]=qs[_0xe959('0x32')](_['pick'](_0x6ba7a9[_0xe959('0x30')],_0x570cc1[_0xe959('0x32')]),_0x2e1a73);if(_0x6ba7a9[_0xe959('0x30')][_0xe959('0x3b')]){_0x3eba7c[_0xe959('0x3a')]=_[_0xe959('0x3c')](_0x3eba7c['where'],{'$or':_[_0xe959('0x3d')](_0x2e1a73,function(_0x4db9e5){if(_0x4db9e5[_0xe959('0x2d')]!==_0xe959('0x3e')){var _0x1af15b={};_0x1af15b[_0x4db9e5['name']]={'$like':'%'+_0x6ba7a9[_0xe959('0x30')][_0xe959('0x3b')]+'%'};return _0x1af15b;}})});}_0x3eba7c=_['merge']({},_0x3eba7c,_0x6ba7a9[_0xe959('0x3f')]);var _0x4e9310={'where':_0x3eba7c[_0xe959('0x3a')]};return db[_0xe959('0x2a')][_0xe959('0x1c')](_0x4e9310)['then'](function(_0x25ebe8){_0x55f000[_0xe959('0x1c')]=_0x25ebe8;if(_0x6ba7a9[_0xe959('0x30')][_0xe959('0x40')]){_0x3eba7c[_0xe959('0x41')]=[{'all':!![]}];}return db[_0xe959('0x2a')][_0xe959('0x42')](_0x3eba7c);})[_0xe959('0x25')](function(_0x813fe7){_0x55f000['rows']=_0x813fe7;return _0x55f000;})['then'](respondWithFilteredResult(_0x147442,_0x3eba7c))[_0xe959('0x43')](handleError(_0x147442,null));};exports[_0xe959('0x44')]=function(_0x475bdc,_0x20ea89){var _0x2ee38b={'raw':![],'where':{'id':_0x475bdc[_0xe959('0x45')]['id']}},_0x1d5cb6={};_0x1d5cb6[_0xe959('0x2f')]=_[_0xe959('0x31')](db[_0xe959('0x2a')][_0xe959('0x2b')]);_0x1d5cb6[_0xe959('0x30')]=_[_0xe959('0x31')](_0x475bdc['query']);_0x1d5cb6[_0xe959('0x32')]=_[_0xe959('0x33')](_0x1d5cb6[_0xe959('0x2f')],_0x1d5cb6[_0xe959('0x30')]);_0x2ee38b[_0xe959('0x34')]=_['intersection'](_0x1d5cb6['model'],qs['fields'](_0x475bdc[_0xe959('0x30')][_0xe959('0x35')]));_0x2ee38b[_0xe959('0x34')]=_0x2ee38b[_0xe959('0x34')][_0xe959('0x36')]?_0x2ee38b[_0xe959('0x34')]:_0x1d5cb6[_0xe959('0x2f')];if(_0x475bdc[_0xe959('0x30')][_0xe959('0x40')]){_0x2ee38b[_0xe959('0x41')]=[{'all':!![]}];}_0x2ee38b=_[_0xe959('0x3c')]({},_0x2ee38b,_0x475bdc['options']);return db[_0xe959('0x2a')]['find'](_0x2ee38b)['then'](handleEntityNotFound(_0x20ea89,null))[_0xe959('0x25')](respondWithResult(_0x20ea89,null))['catch'](handleError(_0x20ea89,null));};exports[_0xe959('0x46')]=function(_0x3ef0cc,_0x4bd6de){return db[_0xe959('0x2a')][_0xe959('0x46')](_0x3ef0cc[_0xe959('0x47')],{})[_0xe959('0x25')](function(_0x53a733){var _0x2b23af=_0x3ef0cc['user'][_0xe959('0x48')]({'plain':!![]});if(!_0x2b23af)throw new Error(_0xe959('0x49'));if(_0x2b23af['role']===_0xe959('0x4a')){var _0x3f5b8f=_0x53a733[_0xe959('0x48')]({'plain':!![]});var _0x1d08ed=_0xe959('0x23');return db[_0xe959('0x4b')][_0xe959('0x4c')]({'where':{'name':_0x1d08ed,'userProfileId':_0x2b23af[_0xe959('0x4d')]},'raw':!![]})[_0xe959('0x25')](function(_0x2d7d15){if(_0x2d7d15&&_0x2d7d15[_0xe959('0x4e')]===0x0){return db[_0xe959('0x24')]['create']({'name':_0x3f5b8f['name'],'resourceId':_0x3f5b8f['id'],'type':_0x2d7d15['name'],'sectionId':_0x2d7d15['id']},{})[_0xe959('0x25')](function(){return _0x53a733;});}else{return _0x53a733;}})[_0xe959('0x43')](function(_0x5dd705){logger[_0xe959('0x4f')](_0xe959('0x50'),_0x5dd705);throw _0x5dd705;});}return _0x53a733;})[_0xe959('0x25')](respondWithResult(_0x4bd6de,0xc9))['catch'](handleError(_0x4bd6de,null));};exports['clone']=function(_0x5e435b,_0x52ddcf){var _0x524181={'where':{'id':_0x5e435b[_0xe959('0x45')]['id']}},_0x4679d3={};_0x4679d3[_0xe959('0x2f')]=_[_0xe959('0x31')](db[_0xe959('0x2a')][_0xe959('0x2b')]);_0x524181[_0xe959('0x34')]=_[_0xe959('0x33')](_0x4679d3[_0xe959('0x2f')],qs[_0xe959('0x35')](_0x5e435b[_0xe959('0x30')][_0xe959('0x35')]));_0x524181[_0xe959('0x34')]=_0x524181['attributes']['length']?_0x524181[_0xe959('0x34')]:_0x4679d3[_0xe959('0x2f')];if(_0x5e435b[_0xe959('0x30')]['includeAll']){_0x524181['include']=[{'all':!![]}];}_0x524181=_[_0xe959('0x3c')]({},_0x524181,_0x5e435b[_0xe959('0x3f')]);return db[_0xe959('0x2a')][_0xe959('0x4c')](_0x524181)[_0xe959('0x25')](handleEntityNotFound(_0x52ddcf,null))[_0xe959('0x25')](function(_0x2a83c1){if(_0x2a83c1){var _0x57e046=_0x2a83c1[_0xe959('0x48')]({'plain':!![]});_0x57e046=qs[_0xe959('0x51')](_0x57e046,['id',_0xe959('0x52'),_0xe959('0x53')]);_0x5e435b[_0xe959('0x47')]=_[_0xe959('0x51')](_0x5e435b[_0xe959('0x47')],['id',_0xe959('0x52'),_0xe959('0x53')]);return db['Campaign'][_0xe959('0x46')](_['merge'](_0x57e046,_0x5e435b['body']),{'include':_0x5e435b[_0xe959('0x30')][_0xe959('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x2423c5){var _0x1829b8=_0x5e435b[_0xe959('0x4a')][_0xe959('0x48')]({'plain':!![]});if(!_0x1829b8)throw new Error(_0xe959('0x49'));if(_0x1829b8['role']==='user'){var _0x22b4c3=_0x2423c5[_0xe959('0x48')]({'plain':!![]});var _0x8ae9e7=_0xe959('0x23');return db[_0xe959('0x4b')]['find']({'where':{'name':_0x8ae9e7,'userProfileId':_0x1829b8[_0xe959('0x4d')]},'raw':!![]})[_0xe959('0x25')](function(_0x59d4eb){if(_0x59d4eb&&_0x59d4eb[_0xe959('0x4e')]===0x0){return db[_0xe959('0x24')]['create']({'name':_0x22b4c3[_0xe959('0x27')],'resourceId':_0x22b4c3['id'],'type':_0x59d4eb[_0xe959('0x27')],'sectionId':_0x59d4eb['id']},{})['then'](function(){return _0x2423c5;});}else{return _0x2423c5;}})[_0xe959('0x43')](function(_0x4de8cd){logger[_0xe959('0x4f')](_0xe959('0x50'),_0x4de8cd);throw _0x4de8cd;});}return _0x2423c5;});}})[_0xe959('0x25')](respondWithResult(_0x52ddcf,0xc9))['catch'](handleError(_0x52ddcf,null));};exports['update']=function(_0x535074,_0x222d97){if(_0x535074[_0xe959('0x47')]['id']){delete _0x535074['body']['id'];}return db[_0xe959('0x2a')][_0xe959('0x4c')]({'where':{'id':_0x535074[_0xe959('0x45')]['id']}})[_0xe959('0x25')](handleEntityNotFound(_0x222d97,null))[_0xe959('0x25')](saveUpdates(_0x535074[_0xe959('0x47')],null))[_0xe959('0x25')](respondWithResult(_0x222d97,null))[_0xe959('0x43')](handleError(_0x222d97,null));};exports[_0xe959('0x54')]=function(_0x3704d8,_0x5445c2){return db[_0xe959('0x2a')]['find']({'where':{'id':_0x3704d8['params']['id']}})[_0xe959('0x25')](handleEntityNotFound(_0x5445c2,null))['then'](removeEntity(_0x5445c2,null))[_0xe959('0x43')](handleError(_0x5445c2,null));};exports[_0xe959('0x55')]=function(_0x5acf08,_0x5ae0f3,_0x54d466){var _0x17459b={'raw':!![],'where':{}};var _0x1359be={};var _0x3dce85={'count':0x0,'rows':[]};return db['Campaign'][_0xe959('0x56')]({'where':{'id':_0x5acf08[_0xe959('0x45')]['id']}})['then'](handleEntityNotFound(_0x5ae0f3,null))[_0xe959('0x25')](function(_0x527d8f){if(_0x527d8f){_0x1359be[_0xe959('0x2f')]=_[_0xe959('0x31')](db[_0xe959('0x57')]['rawAttributes']);_0x1359be[_0xe959('0x30')]=_[_0xe959('0x31')](_0x5acf08[_0xe959('0x30')]);_0x1359be['filters']=_[_0xe959('0x33')](_0x1359be[_0xe959('0x2f')],_0x1359be[_0xe959('0x30')]);_0x17459b[_0xe959('0x34')]=_[_0xe959('0x33')](_0x1359be[_0xe959('0x2f')],qs['fields'](_0x5acf08[_0xe959('0x30')][_0xe959('0x35')]));_0x17459b[_0xe959('0x34')]=_0x17459b[_0xe959('0x34')]['length']?_0x17459b[_0xe959('0x34')]:_0x1359be['model'];if(!_0x5acf08[_0xe959('0x30')]['hasOwnProperty'](_0xe959('0x58'))){_0x17459b[_0xe959('0x1b')]=qs[_0xe959('0x1b')](_0x5acf08[_0xe959('0x30')][_0xe959('0x1b')]);_0x17459b[_0xe959('0x1d')]=qs[_0xe959('0x1d')](_0x5acf08[_0xe959('0x30')][_0xe959('0x1d')]);}_0x17459b[_0xe959('0x38')]=qs[_0xe959('0x39')](_0x5acf08[_0xe959('0x30')][_0xe959('0x39')]);_0x17459b[_0xe959('0x3a')]=qs['filters'](_[_0xe959('0x59')](_0x5acf08[_0xe959('0x30')],_0x1359be['filters']));_0x17459b[_0xe959('0x3a')][_0xe959('0x5a')]=_0x527d8f['id'];if(_0x5acf08['query']['filter']){_0x17459b['where']=_['merge'](_0x17459b[_0xe959('0x3a')],{'$or':_[_0xe959('0x3d')](_0x17459b[_0xe959('0x34')],function(_0x260098){var _0x1a9a81={};_0x1a9a81[_0x260098]={'$like':'%'+_0x5acf08[_0xe959('0x30')][_0xe959('0x3b')]+'%'};return _0x1a9a81;})});}_0x17459b=_[_0xe959('0x3c')]({},_0x17459b,_0x5acf08[_0xe959('0x3f')]);return db[_0xe959('0x57')][_0xe959('0x1c')]({'where':_0x17459b[_0xe959('0x3a')]})['then'](function(_0x7aef49){_0x3dce85['count']=_0x7aef49;if(_0x5acf08['query'][_0xe959('0x40')]){_0x17459b[_0xe959('0x41')]=[{'all':!![]}];}return db[_0xe959('0x57')][_0xe959('0x42')](_0x17459b);})[_0xe959('0x25')](function(_0x216295){_0x3dce85[_0xe959('0x5b')]=_0x216295;return _0x3dce85;});}})[_0xe959('0x25')](respondWithFilteredResult(_0x5ae0f3,_0x17459b))[_0xe959('0x43')](handleError(_0x5ae0f3,null));};exports[_0xe959('0x5c')]=function(_0x24d15e,_0x5afa59,_0x4e9e4d){var _0x57a83a={'raw':!![],'where':{}};var _0x201bfe={};var _0x274139={'count':0x0,'rows':[]};return db[_0xe959('0x2a')]['findOne']({'where':{'id':_0x24d15e['params']['id']}})[_0xe959('0x25')](handleEntityNotFound(_0x5afa59,null))[_0xe959('0x25')](function(_0x1dca35){if(_0x1dca35){_0x201bfe[_0xe959('0x2f')]=_[_0xe959('0x31')](db[_0xe959('0x5d')][_0xe959('0x2b')]);_0x201bfe[_0xe959('0x30')]=_[_0xe959('0x31')](_0x24d15e[_0xe959('0x30')]);_0x201bfe['filters']=_[_0xe959('0x33')](_0x201bfe[_0xe959('0x2f')],_0x201bfe['query']);_0x57a83a[_0xe959('0x34')]=_['intersection'](_0x201bfe[_0xe959('0x2f')],qs['fields'](_0x24d15e[_0xe959('0x30')]['fields']));_0x57a83a[_0xe959('0x34')]=_0x57a83a[_0xe959('0x34')][_0xe959('0x36')]?_0x57a83a[_0xe959('0x34')]:_0x201bfe['model'];if(!_0x24d15e['query']['hasOwnProperty'](_0xe959('0x58'))){_0x57a83a[_0xe959('0x1b')]=qs[_0xe959('0x1b')](_0x24d15e['query'][_0xe959('0x1b')]);_0x57a83a[_0xe959('0x1d')]=qs[_0xe959('0x1d')](_0x24d15e[_0xe959('0x30')][_0xe959('0x1d')]);}_0x57a83a[_0xe959('0x38')]=qs[_0xe959('0x39')](_0x24d15e['query'][_0xe959('0x39')]);_0x57a83a[_0xe959('0x3a')]=qs[_0xe959('0x32')](_[_0xe959('0x59')](_0x24d15e[_0xe959('0x30')],_0x201bfe[_0xe959('0x32')]));_0x57a83a[_0xe959('0x3a')][_0xe959('0x5a')]=_0x1dca35['id'];if(_0x24d15e['query']['filter']){_0x57a83a[_0xe959('0x3a')]=_[_0xe959('0x3c')](_0x57a83a['where'],{'$or':_['map'](_0x57a83a[_0xe959('0x34')],function(_0x1a59cd){var _0x325362={};_0x325362[_0x1a59cd]={'$like':'%'+_0x24d15e['query'][_0xe959('0x3b')]+'%'};return _0x325362;})});}_0x57a83a=_[_0xe959('0x3c')]({},_0x57a83a,_0x24d15e[_0xe959('0x3f')]);return db[_0xe959('0x5d')]['count']({'where':_0x57a83a[_0xe959('0x3a')]})[_0xe959('0x25')](function(_0x5ba992){_0x274139[_0xe959('0x1c')]=_0x5ba992;if(_0x24d15e[_0xe959('0x30')][_0xe959('0x40')]){_0x57a83a[_0xe959('0x41')]=[{'all':!![]}];}return db[_0xe959('0x5d')][_0xe959('0x42')](_0x57a83a);})[_0xe959('0x25')](function(_0x24337d){_0x274139[_0xe959('0x5b')]=_0x24337d;return _0x274139;});}})[_0xe959('0x25')](respondWithFilteredResult(_0x5afa59,_0x57a83a))['catch'](handleError(_0x5afa59,null));};exports[_0xe959('0x5e')]=function(_0x5a3d83,_0x2bc990,_0x38ff42){var _0x18d43a={'raw':!![],'where':{}};var _0x8285db={};var _0x2eb185={'count':0x0,'rows':[]};return db['Campaign'][_0xe959('0x56')]({'where':{'id':_0x5a3d83[_0xe959('0x45')]['id']}})['then'](handleEntityNotFound(_0x2bc990,null))['then'](function(_0x49e36e){if(_0x49e36e){_0x8285db[_0xe959('0x2f')]=_['keys'](db[_0xe959('0x5f')][_0xe959('0x2b')]);_0x8285db[_0xe959('0x30')]=_[_0xe959('0x31')](_0x5a3d83[_0xe959('0x30')]);_0x8285db[_0xe959('0x32')]=_['intersection'](_0x8285db['model'],_0x8285db[_0xe959('0x30')]);_0x18d43a['attributes']=_[_0xe959('0x33')](_0x8285db[_0xe959('0x2f')],qs['fields'](_0x5a3d83['query'][_0xe959('0x35')]));_0x18d43a[_0xe959('0x34')]=_0x18d43a[_0xe959('0x34')]['length']?_0x18d43a[_0xe959('0x34')]:_0x8285db[_0xe959('0x2f')];if(!_0x5a3d83[_0xe959('0x30')][_0xe959('0x37')](_0xe959('0x58'))){_0x18d43a['limit']=qs[_0xe959('0x1b')](_0x5a3d83[_0xe959('0x30')]['limit']);_0x18d43a['offset']=qs[_0xe959('0x1d')](_0x5a3d83[_0xe959('0x30')][_0xe959('0x1d')]);}_0x18d43a[_0xe959('0x38')]=qs[_0xe959('0x39')](_0x5a3d83[_0xe959('0x30')][_0xe959('0x39')]);_0x18d43a[_0xe959('0x3a')]=qs[_0xe959('0x32')](_['pick'](_0x5a3d83[_0xe959('0x30')],_0x8285db[_0xe959('0x32')]));_0x18d43a['where']['CampaignId']=_0x49e36e['id'];if(_0x5a3d83['query'][_0xe959('0x3b')]){_0x18d43a[_0xe959('0x3a')]=_[_0xe959('0x3c')](_0x18d43a['where'],{'$or':_['map'](_0x18d43a[_0xe959('0x34')],function(_0x4fe6de){var _0x3471f5={};_0x3471f5[_0x4fe6de]={'$like':'%'+_0x5a3d83[_0xe959('0x30')]['filter']+'%'};return _0x3471f5;})});}_0x18d43a=_[_0xe959('0x3c')]({},_0x18d43a,_0x5a3d83[_0xe959('0x3f')]);return db[_0xe959('0x5f')][_0xe959('0x1c')]({'where':_0x18d43a[_0xe959('0x3a')]})['then'](function(_0x590d93){_0x2eb185[_0xe959('0x1c')]=_0x590d93;if(_0x5a3d83[_0xe959('0x30')]['includeAll']){_0x18d43a[_0xe959('0x41')]=[{'all':!![]}];}return db[_0xe959('0x5f')][_0xe959('0x42')](_0x18d43a);})[_0xe959('0x25')](function(_0x18d23f){_0x2eb185[_0xe959('0x5b')]=_0x18d23f;return _0x2eb185;});}})[_0xe959('0x25')](respondWithFilteredResult(_0x2bc990,_0x18d43a))[_0xe959('0x43')](handleError(_0x2bc990,null));};exports[_0xe959('0x60')]=function(_0x1cdd45,_0x1b17a4,_0x3d78a1){var _0x2de441={'raw':!![],'where':{}};var _0x1a7e33={};var _0x3a1ab0={'count':0x0,'rows':[]};return db['Campaign'][_0xe959('0x56')]({'where':{'id':_0x1cdd45[_0xe959('0x45')]['id']}})[_0xe959('0x25')](handleEntityNotFound(_0x1b17a4,null))[_0xe959('0x25')](function(_0x2bb9d1){if(_0x2bb9d1){_0x1a7e33[_0xe959('0x2f')]=_['keys'](db[_0xe959('0x61')][_0xe959('0x2b')]);_0x1a7e33[_0xe959('0x30')]=_[_0xe959('0x31')](_0x1cdd45[_0xe959('0x30')]);_0x1a7e33[_0xe959('0x32')]=_['intersection'](_0x1a7e33[_0xe959('0x2f')],_0x1a7e33[_0xe959('0x30')]);_0x2de441[_0xe959('0x34')]=_[_0xe959('0x33')](_0x1a7e33['model'],qs[_0xe959('0x35')](_0x1cdd45['query'][_0xe959('0x35')]));_0x2de441['attributes']=_0x2de441[_0xe959('0x34')][_0xe959('0x36')]?_0x2de441['attributes']:_0x1a7e33['model'];if(!_0x1cdd45[_0xe959('0x30')]['hasOwnProperty']('nolimit')){_0x2de441[_0xe959('0x1b')]=qs[_0xe959('0x1b')](_0x1cdd45[_0xe959('0x30')][_0xe959('0x1b')]);_0x2de441[_0xe959('0x1d')]=qs[_0xe959('0x1d')](_0x1cdd45[_0xe959('0x30')][_0xe959('0x1d')]);}_0x2de441['order']=qs[_0xe959('0x39')](_0x1cdd45['query'][_0xe959('0x39')]);_0x2de441['where']=qs['filters'](_['pick'](_0x1cdd45['query'],_0x1a7e33[_0xe959('0x32')]));_0x2de441[_0xe959('0x3a')][_0xe959('0x5a')]=_0x2bb9d1['id'];if(_0x1cdd45[_0xe959('0x30')][_0xe959('0x3b')]){_0x2de441[_0xe959('0x3a')]=_[_0xe959('0x3c')](_0x2de441[_0xe959('0x3a')],{'$or':_['map'](_0x2de441[_0xe959('0x34')],function(_0x409f69){var _0x289491={};_0x289491[_0x409f69]={'$like':'%'+_0x1cdd45[_0xe959('0x30')]['filter']+'%'};return _0x289491;})});}_0x2de441=_['merge']({},_0x2de441,_0x1cdd45[_0xe959('0x3f')]);return db[_0xe959('0x61')][_0xe959('0x1c')]({'where':_0x2de441[_0xe959('0x3a')]})[_0xe959('0x25')](function(_0x3235f1){_0x3a1ab0[_0xe959('0x1c')]=_0x3235f1;if(_0x1cdd45[_0xe959('0x30')][_0xe959('0x40')]){_0x2de441[_0xe959('0x41')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xe959('0x42')](_0x2de441);})[_0xe959('0x25')](function(_0x4b681e){_0x3a1ab0[_0xe959('0x5b')]=_0x4b681e;return _0x3a1ab0;});}})['then'](respondWithFilteredResult(_0x1b17a4,_0x2de441))[_0xe959('0x43')](handleError(_0x1b17a4,null));};exports[_0xe959('0x62')]=function(_0x14cedd,_0x4bca24,_0x56c81c){var _0x468d12={};var _0x2d53cc={};var _0x2246b3;var _0x3419ad;return db[_0xe959('0x2a')][_0xe959('0x56')]({'where':{'id':_0x14cedd[_0xe959('0x45')]['id']}})[_0xe959('0x25')](handleEntityNotFound(_0x4bca24,null))[_0xe959('0x25')](function(_0x2be10d){if(_0x2be10d){_0x2246b3=_0x2be10d;_0x2d53cc['model']=_[_0xe959('0x31')](db['CmList'][_0xe959('0x2b')]);_0x2d53cc['query']=_[_0xe959('0x31')](_0x14cedd[_0xe959('0x30')]);_0x2d53cc['filters']=_[_0xe959('0x33')](_0x2d53cc[_0xe959('0x2f')],_0x2d53cc[_0xe959('0x30')]);_0x468d12[_0xe959('0x34')]=_[_0xe959('0x33')](_0x2d53cc[_0xe959('0x2f')],qs[_0xe959('0x35')](_0x14cedd['query']['fields']));_0x468d12[_0xe959('0x34')]=_0x468d12['attributes'][_0xe959('0x36')]?_0x468d12[_0xe959('0x34')]:_0x2d53cc[_0xe959('0x2f')];_0x468d12[_0xe959('0x38')]=qs['sort'](_0x14cedd['query']['sort']);_0x468d12[_0xe959('0x3a')]=qs[_0xe959('0x32')](_[_0xe959('0x59')](_0x14cedd[_0xe959('0x30')],_0x2d53cc[_0xe959('0x32')]));if(_0x14cedd['query'][_0xe959('0x3b')]){_0x468d12[_0xe959('0x3a')]=_['merge'](_0x468d12[_0xe959('0x3a')],{'$or':_['map'](_0x468d12[_0xe959('0x34')],function(_0x205094){var _0x53cc08={};_0x53cc08[_0x205094]={'$like':'%'+_0x14cedd[_0xe959('0x30')]['filter']+'%'};return _0x53cc08;})});}_0x468d12=_[_0xe959('0x3c')]({},_0x468d12,_0x14cedd[_0xe959('0x3f')]);return _0x2246b3[_0xe959('0x62')](_0x468d12);}})[_0xe959('0x25')](function(_0x9e4cc7){if(_0x9e4cc7){_0x3419ad=_0x9e4cc7[_0xe959('0x36')];if(!_0x14cedd['query']['hasOwnProperty'](_0xe959('0x58'))){_0x468d12[_0xe959('0x1b')]=qs[_0xe959('0x1b')](_0x14cedd[_0xe959('0x30')][_0xe959('0x1b')]);_0x468d12[_0xe959('0x1d')]=qs[_0xe959('0x1d')](_0x14cedd['query']['offset']);}return _0x2246b3[_0xe959('0x62')](_0x468d12);}})[_0xe959('0x25')](function(_0x13a7f1){if(_0x13a7f1){return _0x13a7f1?{'count':_0x3419ad,'rows':_0x13a7f1}:null;}})[_0xe959('0x25')](respondWithResult(_0x4bca24,null))[_0xe959('0x43')](handleError(_0x4bca24,null));};exports[_0xe959('0x63')]=function(_0x2d5152,_0x37b9cc,_0x54cefa){var _0x30ae03,_0x59a8e2;var _0xa15684=[];var _0x2cb28d=moment()[_0xe959('0x64')](_0xe959('0x65'));return db[_0xe959('0x2a')][_0xe959('0x4c')]({'where':{'id':_0x2d5152[_0xe959('0x45')]['id']}})[_0xe959('0x25')](handleEntityNotFound(_0x37b9cc,null))[_0xe959('0x25')](function(_0x48397d){if(_0x48397d){_0x59a8e2=_0x48397d;return _0x48397d[_0xe959('0x63')](_0x2d5152[_0xe959('0x47')][_0xe959('0x66')],_[_0xe959('0x51')](_0x2d5152[_0xe959('0x47')],['ids','id'])||{});}return null;})[_0xe959('0x67')](function(_0x2a9668){var _0x339650;var _0x2a8ad3;_0x30ae03=_0x2a9668||[];var _0x565296=[];if(_0x2a9668){for(var _0x1287f6=0x0;_0x1287f6<_0x2a9668[_0xe959('0x36')];_0x1287f6+=0x1){var _0x253a27=_0x2a9668[_0x1287f6]['get']({'plain':!![]});_0x59a8e2[_0xe959('0x68')]=_0x2d5152[_0xe959('0x47')][_0xe959('0x68')]?_0x2d5152['body'][_0xe959('0x68')]:_0x59a8e2[_0xe959('0x68')];switch(_0x59a8e2[_0xe959('0x68')]){case'always':_0x339650=squel['insert']()[_0xe959('0x69')]('cm_hopper')[_0xe959('0x6a')](['phone',_0xe959('0x6b'),_0xe959('0x6c'),_0xe959('0x6d'),_0xe959('0x5a'),_0xe959('0x52'),_0xe959('0x53')],squel[_0xe959('0x6e')]()[_0xe959('0x6f')](_0xe959('0x70'),_0xe959('0x70'))['field'](_0xe959('0x71'),_0xe959('0x6b'))[_0xe959('0x6f')]('id','ContactId')[_0xe959('0x6f')](_0x253a27[_0xe959('0x72')][_0xe959('0x73')](),_0xe959('0x6d'))[_0xe959('0x6f')](_0x2d5152[_0xe959('0x45')]['id']['toString'](),_0xe959('0x5a'))['field']('\x27'+_0x2cb28d+'\x27','createdAt')[_0xe959('0x6f')]('\x27'+_0x2cb28d+'\x27',_0xe959('0x53'))[_0xe959('0x74')](_0xe959('0x75'))[_0xe959('0x3a')]('deletedAt\x20IS\x20NULL')['where'](_0xe959('0x76'),_0x253a27[_0xe959('0x72')]['toString']())[_0xe959('0x3a')](_0xe959('0x77'))['where'](_0xe959('0x78'),squel[_0xe959('0x6e')]()[_0xe959('0x6f')](_0xe959('0x79'))[_0xe959('0x74')](_0xe959('0x7a'))[_0xe959('0x3a')](_0xe959('0x7b'),_0x2d5152['params']['id'][_0xe959('0x73')]()))[_0xe959('0x3a')](_0xe959('0x78'),squel[_0xe959('0x6e')]()['field'](_0xe959('0x7c'))['from'](_0xe959('0x7d'))['where'](_0xe959('0x7b'),_0x2d5152[_0xe959('0x45')]['id'][_0xe959('0x73')]())))['toString']();break;case _0xe959('0x7e'):_0x339650=squel[_0xe959('0x7f')]()[_0xe959('0x69')](_0xe959('0x7d'))['fromQuery'](['phone',_0xe959('0x6b'),_0xe959('0x6c'),'ListId','CampaignId',_0xe959('0x52'),_0xe959('0x53')],squel['select']()[_0xe959('0x6f')](_0xe959('0x70'),_0xe959('0x70'))[_0xe959('0x6f')](_0xe959('0x71'),'scheduledAt')['field']('id',_0xe959('0x6c'))[_0xe959('0x6f')](_0x253a27['CmListId'][_0xe959('0x73')](),_0xe959('0x6d'))[_0xe959('0x6f')](_0x2d5152[_0xe959('0x45')]['id'][_0xe959('0x73')](),_0xe959('0x5a'))[_0xe959('0x6f')]('\x27'+_0x2cb28d+'\x27','createdAt')['field']('\x27'+_0x2cb28d+'\x27',_0xe959('0x53'))[_0xe959('0x74')](_0xe959('0x75'))['where'](_0xe959('0x80'))['where'](_0xe959('0x76'),_0x253a27[_0xe959('0x72')][_0xe959('0x73')]())[_0xe959('0x3a')](_0xe959('0x77'))[_0xe959('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xe959('0x6f')](_0xe959('0x7c'))[_0xe959('0x74')](_0xe959('0x7d'))[_0xe959('0x3a')]('CampaignId\x20=\x20?',_0x2d5152[_0xe959('0x45')]['id'][_0xe959('0x73')]())))['toString']();break;default:_0x339650=squel['insert']()['into'](_0xe959('0x7d'))['fromQuery']([_0xe959('0x70'),'scheduledAt',_0xe959('0x6c'),_0xe959('0x6d'),_0xe959('0x5a'),'createdAt','updatedAt'],squel['select']()['field'](_0xe959('0x70'),_0xe959('0x70'))[_0xe959('0x6f')](_0xe959('0x71'),_0xe959('0x6b'))[_0xe959('0x6f')]('id','ContactId')[_0xe959('0x6f')](_0x253a27['CmListId'][_0xe959('0x73')](),'ListId')[_0xe959('0x6f')](_0x2d5152['params']['id'][_0xe959('0x73')](),_0xe959('0x5a'))[_0xe959('0x6f')]('\x27'+_0x2cb28d+'\x27',_0xe959('0x52'))[_0xe959('0x6f')]('\x27'+_0x2cb28d+'\x27',_0xe959('0x53'))[_0xe959('0x74')](_0xe959('0x75'))[_0xe959('0x3a')](_0xe959('0x80'))[_0xe959('0x3a')](_0xe959('0x76'),_0x253a27[_0xe959('0x72')][_0xe959('0x73')]())[_0xe959('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0xe959('0x73')]();}_0x2a8ad3=squel[_0xe959('0x7f')]()[_0xe959('0x69')]('cm_hopper_additional_phones')[_0xe959('0x6a')]([_0xe959('0x81'),_0xe959('0x6b'),_0xe959('0x70'),_0xe959('0x82'),_0xe959('0x52'),_0xe959('0x53')],squel[_0xe959('0x6e')]()['field'](_0xe959('0x83'),'id')[_0xe959('0x6f')]('NOW()',_0xe959('0x6b'))[_0xe959('0x6f')](_0xe959('0x84'),_0xe959('0x70'))['field'](_0xe959('0x85'),_0xe959('0x82'))[_0xe959('0x6f')]('\x27'+_0x2cb28d+'\x27',_0xe959('0x52'))[_0xe959('0x6f')]('\x27'+_0x2cb28d+'\x27',_0xe959('0x53'))[_0xe959('0x74')](_0xe959('0x86'),'ci')[_0xe959('0x87')]('cm_hopper','h',_0xe959('0x88'))[_0xe959('0x3a')](_0xe959('0x89'),_0x253a27['CmListId']['toString']())['where'](_0xe959('0x8a'),_0x2d5152[_0xe959('0x45')]['id'][_0xe959('0x73')]())[_0xe959('0x3a')]('h.createdAt\x20=\x20?',_0x2cb28d))[_0xe959('0x73')]();_0x565296['push'](db['sequelize'][_0xe959('0x30')](_0x339650));_0xa15684[_0xe959('0x8b')](db[_0xe959('0x8c')][_0xe959('0x30')](_0x2a8ad3));}return BPromise[_0xe959('0x8d')](_0x565296);}})['then'](function(){return BPromise[_0xe959('0x8d')](_0xa15684);})[_0xe959('0x25')](function(){return _0x30ae03;})[_0xe959('0x25')](respondWithResult(_0x37b9cc,null))[_0xe959('0x43')](handleError(_0x37b9cc,null));};exports[_0xe959('0x8e')]=function(_0x58610f,_0x4220fa,_0x5fd409){return db['Campaign'][_0xe959('0x4c')]({'where':{'id':_0x58610f[_0xe959('0x45')]['id']}})[_0xe959('0x25')](handleEntityNotFound(_0x4220fa,null))[_0xe959('0x25')](function(_0x113df5){if(_0x113df5){return _0x113df5[_0xe959('0x8e')](_0x58610f[_0xe959('0x30')][_0xe959('0x66')]);}})[_0xe959('0x25')](function(_0x300f25){if(_0x300f25){return db['CmHopper'][_0xe959('0x54')]({'where':{'ListId':_0x58610f[_0xe959('0x30')][_0xe959('0x66')],'CampaignId':_0x58610f[_0xe959('0x45')]['id']}})[_0xe959('0x25')](function(){return _0x300f25;});}})[_0xe959('0x25')](respondWithStatusCode(_0x4220fa,null))[_0xe959('0x43')](handleError(_0x4220fa,null));};exports[_0xe959('0x8f')]=function(_0x15cf08,_0x5b5ab5,_0x5ed44c){var _0x8f8873={};var _0x17deae={};var _0x34213f;var _0x11af9a;return db[_0xe959('0x2a')][_0xe959('0x56')]({'where':{'id':_0x15cf08['params']['id']}})[_0xe959('0x25')](handleEntityNotFound(_0x5b5ab5,null))[_0xe959('0x25')](function(_0x512181){if(_0x512181){_0x34213f=_0x512181;_0x17deae[_0xe959('0x2f')]=_[_0xe959('0x31')](db['CmList'][_0xe959('0x2b')]);_0x17deae['query']=_['keys'](_0x15cf08[_0xe959('0x30')]);_0x17deae[_0xe959('0x32')]=_[_0xe959('0x33')](_0x17deae[_0xe959('0x2f')],_0x17deae[_0xe959('0x30')]);_0x8f8873['attributes']=_['intersection'](_0x17deae[_0xe959('0x2f')],qs[_0xe959('0x35')](_0x15cf08[_0xe959('0x30')][_0xe959('0x35')]));_0x8f8873[_0xe959('0x34')]=_0x8f8873['attributes'][_0xe959('0x36')]?_0x8f8873['attributes']:_0x17deae[_0xe959('0x2f')];_0x8f8873['order']=qs['sort'](_0x15cf08[_0xe959('0x30')][_0xe959('0x39')]);_0x8f8873['where']=qs[_0xe959('0x32')](_[_0xe959('0x59')](_0x15cf08[_0xe959('0x30')],_0x17deae[_0xe959('0x32')]));if(_0x15cf08[_0xe959('0x30')][_0xe959('0x3b')]){_0x8f8873['where']=_['merge'](_0x8f8873[_0xe959('0x3a')],{'$or':_[_0xe959('0x3d')](_0x8f8873[_0xe959('0x34')],function(_0x3bc421){var _0x13016c={};_0x13016c[_0x3bc421]={'$like':'%'+_0x15cf08[_0xe959('0x30')][_0xe959('0x3b')]+'%'};return _0x13016c;})});}_0x8f8873=_[_0xe959('0x3c')]({},_0x8f8873,_0x15cf08['options']);return _0x34213f['getBlackLists'](_0x8f8873);}})['then'](function(_0x459cd4){if(_0x459cd4){_0x11af9a=_0x459cd4[_0xe959('0x36')];if(!_0x15cf08[_0xe959('0x30')][_0xe959('0x37')](_0xe959('0x58'))){_0x8f8873[_0xe959('0x1b')]=qs[_0xe959('0x1b')](_0x15cf08[_0xe959('0x30')][_0xe959('0x1b')]);_0x8f8873[_0xe959('0x1d')]=qs['offset'](_0x15cf08['query'][_0xe959('0x1d')]);}return _0x34213f[_0xe959('0x8f')](_0x8f8873);}})[_0xe959('0x25')](function(_0x2c51a5){if(_0x2c51a5){return _0x2c51a5?{'count':_0x11af9a,'rows':_0x2c51a5}:null;}})[_0xe959('0x25')](respondWithResult(_0x5b5ab5,null))[_0xe959('0x43')](handleError(_0x5b5ab5,null));};exports[_0xe959('0x90')]=function(_0x23b8a7,_0x56d876,_0x851245){var _0x15739d,_0x1ac93e;var _0x5d2adf=[];var _0x458028=moment()[_0xe959('0x64')](_0xe959('0x65'));return db[_0xe959('0x2a')][_0xe959('0x4c')]({'where':{'id':_0x23b8a7[_0xe959('0x45')]['id']}})[_0xe959('0x25')](handleEntityNotFound(_0x56d876,null))['then'](function(_0x5afc54){if(_0x5afc54){_0x1ac93e=_0x5afc54;return _0x5afc54[_0xe959('0x90')](_0x23b8a7['body'][_0xe959('0x66')],_['omit'](_0x23b8a7['body'],[_0xe959('0x66'),'id'])||{});}return null;})[_0xe959('0x67')](function(_0x37bd75){var _0x5d8179;var _0x54c716;_0x15739d=_0x37bd75||[];var _0x563353=[];if(_0x37bd75){for(var _0xdb4e84=0x0;_0xdb4e84<_0x37bd75[_0xe959('0x36')];_0xdb4e84+=0x1){var _0x8179cb=_0x37bd75[_0xdb4e84][_0xe959('0x48')]({'plain':!![]});_0x5d8179=squel[_0xe959('0x7f')]()[_0xe959('0x69')](_0xe959('0x91'))[_0xe959('0x6a')]([_0xe959('0x70'),_0xe959('0x6c'),'ListId',_0xe959('0x5a'),_0xe959('0x52'),_0xe959('0x53')],squel[_0xe959('0x6e')]()[_0xe959('0x6f')](_0xe959('0x70'),_0xe959('0x70'))[_0xe959('0x6f')]('id','ContactId')[_0xe959('0x6f')](_0x8179cb[_0xe959('0x72')][_0xe959('0x73')](),_0xe959('0x6d'))['field'](_0x23b8a7[_0xe959('0x45')]['id']['toString'](),_0xe959('0x5a'))['field'](_0xe959('0x71'),_0xe959('0x52'))[_0xe959('0x6f')](_0xe959('0x71'),_0xe959('0x53'))[_0xe959('0x74')](_0xe959('0x75'))[_0xe959('0x3a')](_0xe959('0x80'))[_0xe959('0x3a')](_0xe959('0x76'),_0x8179cb[_0xe959('0x72')][_0xe959('0x73')]())[_0xe959('0x3a')](_0xe959('0x77')))['toString']();_0x563353[_0xe959('0x8b')](db[_0xe959('0x8c')][_0xe959('0x30')](_0x5d8179));}return BPromise[_0xe959('0x8d')](_0x563353);}})['then'](function(){return _0x15739d;})['then'](respondWithResult(_0x56d876,null))['catch'](handleError(_0x56d876,null));};exports[_0xe959('0x92')]=function(_0x370ffc,_0x50bcea,_0x19a64a){return db['Campaign']['find']({'where':{'id':_0x370ffc['params']['id']}})[_0xe959('0x25')](handleEntityNotFound(_0x50bcea,null))['then'](function(_0xbbfb25){if(_0xbbfb25){return _0xbbfb25['removeBlackLists'](_0x370ffc[_0xe959('0x30')][_0xe959('0x66')]);}})['then'](function(_0x535b64){if(_0x535b64){return db[_0xe959('0x61')][_0xe959('0x54')]({'where':{'ListId':_0x370ffc[_0xe959('0x30')]['ids'],'CampaignId':_0x370ffc[_0xe959('0x45')]['id']}})[_0xe959('0x25')](function(){return _0x535b64;});}})['then'](respondWithStatusCode(_0x50bcea,null))[_0xe959('0x43')](handleError(_0x50bcea,null));};
\ No newline at end of file
+var _0xe511=['VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','UserProfileResource','create','catch','clone','updatedAt','body','omit','createdAt','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','nolimit','CmHopper','findOne','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','ids','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ListId','select','field','NOW()','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','ListId\x20=\x20?','cmHopperId','OrderBy','ci.item','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','destroy','getBlackLists','YYYY-MM-DD\x20HH:mm:ss','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','save','update','then','get','IvrCampaigns','error','name','send','map','Campaign','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','filters','pick','filter','where','merge'];(function(_0x1e896c,_0x3f9948){var _0xd149d9=function(_0x3281e5){while(--_0x3281e5){_0x1e896c['push'](_0x1e896c['shift']());}};_0xd149d9(++_0x3f9948);}(_0xe511,0x16f));var _0x1e51=function(_0x563582,_0x1c23c5){_0x563582=_0x563582-0x0;var _0x3b6a0f=_0xe511[_0x563582];return _0x3b6a0f;};'use strict';var emlformat=require(_0x1e51('0x0'));var rimraf=require(_0x1e51('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e51('0x2'));var rp=require('request-promise');var moment=require(_0x1e51('0x3'));var BPromise=require(_0x1e51('0x4'));var Mustache=require('mustache');var util=require(_0x1e51('0x5'));var path=require(_0x1e51('0x6'));var sox=require(_0x1e51('0x7'));var csv=require(_0x1e51('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e51('0x9'));var _=require(_0x1e51('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1e51('0xb'));var deskjs=require(_0x1e51('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1e51('0xd'));var Redis=require(_0x1e51('0xe'));var authService=require(_0x1e51('0xf'));var qs=require(_0x1e51('0x10'));var as=require(_0x1e51('0x11'));var hardwareService=require(_0x1e51('0x12'));var logger=require('../../config/logger')(_0x1e51('0x13'));var utils=require(_0x1e51('0x14'));var config=require(_0x1e51('0x15'));var licenseUtil=require(_0x1e51('0x16'));var db=require(_0x1e51('0x17'))['db'];function respondWithStatusCode(_0x3c5330,_0x5544eb){_0x5544eb=_0x5544eb||0xcc;return function(_0x408a77){if(_0x408a77){return _0x3c5330[_0x1e51('0x18')](_0x5544eb);}return _0x3c5330[_0x1e51('0x19')](_0x5544eb)[_0x1e51('0x1a')]();};}function respondWithResult(_0x21bcbd,_0x32945d){_0x32945d=_0x32945d||0xc8;return function(_0x441c70){if(_0x441c70){return _0x21bcbd[_0x1e51('0x19')](_0x32945d)[_0x1e51('0x1b')](_0x441c70);}};}function respondWithFilteredResult(_0xd76fba,_0x5a5c07){return function(_0x3b01b7){if(_0x3b01b7){var _0x24db4f=typeof _0x5a5c07[_0x1e51('0x1c')]==='undefined'&&typeof _0x5a5c07[_0x1e51('0x1d')]==='undefined';var _0x53d222=_0x3b01b7[_0x1e51('0x1e')];var _0x27dcad=_0x24db4f?0x0:_0x5a5c07[_0x1e51('0x1c')];var _0x4785a5=_0x24db4f?_0x3b01b7[_0x1e51('0x1e')]:_0x5a5c07[_0x1e51('0x1c')]+_0x5a5c07['limit'];var _0x39449b;if(_0x4785a5>=_0x53d222){_0x4785a5=_0x53d222;_0x39449b=0xc8;}else{_0x39449b=0xce;}_0xd76fba['status'](_0x39449b);return _0xd76fba[_0x1e51('0x1f')](_0x1e51('0x20'),_0x27dcad+'-'+_0x4785a5+'/'+_0x53d222)[_0x1e51('0x1b')](_0x3b01b7);}return null;};}function patchUpdates(_0x183a95){return function(_0x506f40){try{jsonpatch['apply'](_0x506f40,_0x183a95,!![]);}catch(_0x4e6a49){return BPromise['reject'](_0x4e6a49);}return _0x506f40[_0x1e51('0x21')]();};}function saveUpdates(_0x4f1f56,_0x3f7340){return function(_0x28aacb){if(_0x28aacb){return _0x28aacb[_0x1e51('0x22')](_0x4f1f56)[_0x1e51('0x23')](function(_0x23c85a){return _0x23c85a;});}return null;};}function removeEntity(_0xf9298,_0x270adf){return function(_0x461d3d){if(_0x461d3d){return _0x461d3d['destroy']()['then'](function(){var _0x43f5c5=_0x461d3d[_0x1e51('0x24')]({'plain':!![]});var _0x2e42b1=_0x1e51('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x2e42b1,'resourceId':_0x43f5c5['id']}})['then'](function(){return _0x461d3d;});})[_0x1e51('0x23')](function(){_0xf9298[_0x1e51('0x19')](0xcc)[_0x1e51('0x1a')]();});}};}function handleEntityNotFound(_0x5412bc,_0x1e7a96){return function(_0x49c507){if(!_0x49c507){_0x5412bc['sendStatus'](0x194);}return _0x49c507;};}function handleError(_0x3349f0,_0x5c5bbd){_0x5c5bbd=_0x5c5bbd||0x1f4;return function(_0x170ec6){logger[_0x1e51('0x26')](_0x170ec6['stack']);if(_0x170ec6[_0x1e51('0x27')]){delete _0x170ec6[_0x1e51('0x27')];}_0x3349f0[_0x1e51('0x19')](_0x5c5bbd)[_0x1e51('0x28')](_0x170ec6);};}exports['index']=function(_0x4cf046,_0x4f67d3){var _0x20eb9b={},_0x288b50={},_0x1ba84a={'count':0x0,'rows':[]};var _0x36dabe=_[_0x1e51('0x29')](db[_0x1e51('0x2a')][_0x1e51('0x2b')],function(_0x34701c){return{'name':_0x34701c[_0x1e51('0x2c')],'type':_0x34701c[_0x1e51('0x2d')][_0x1e51('0x2e')]};});_0x288b50['model']=_[_0x1e51('0x29')](_0x36dabe,_0x1e51('0x27'));_0x288b50[_0x1e51('0x2f')]=_[_0x1e51('0x30')](_0x4cf046[_0x1e51('0x2f')]);_0x288b50['filters']=_[_0x1e51('0x31')](_0x288b50['model'],_0x288b50[_0x1e51('0x2f')]);_0x20eb9b[_0x1e51('0x32')]=_[_0x1e51('0x31')](_0x288b50['model'],qs[_0x1e51('0x33')](_0x4cf046['query'][_0x1e51('0x33')]));_0x20eb9b['attributes']=_0x20eb9b['attributes'][_0x1e51('0x34')]?_0x20eb9b[_0x1e51('0x32')]:_0x288b50[_0x1e51('0x35')];if(!_0x4cf046['query'][_0x1e51('0x36')]('nolimit')){_0x20eb9b[_0x1e51('0x1d')]=qs[_0x1e51('0x1d')](_0x4cf046['query'][_0x1e51('0x1d')]);_0x20eb9b[_0x1e51('0x1c')]=qs[_0x1e51('0x1c')](_0x4cf046[_0x1e51('0x2f')][_0x1e51('0x1c')]);}_0x20eb9b[_0x1e51('0x37')]=qs['sort'](_0x4cf046['query'][_0x1e51('0x38')]);_0x20eb9b['where']=qs[_0x1e51('0x39')](_[_0x1e51('0x3a')](_0x4cf046[_0x1e51('0x2f')],_0x288b50[_0x1e51('0x39')]),_0x36dabe);if(_0x4cf046[_0x1e51('0x2f')][_0x1e51('0x3b')]){_0x20eb9b[_0x1e51('0x3c')]=_[_0x1e51('0x3d')](_0x20eb9b[_0x1e51('0x3c')],{'$or':_[_0x1e51('0x29')](_0x36dabe,function(_0x45d5fe){if(_0x45d5fe['type']!==_0x1e51('0x3e')){var _0x5818be={};_0x5818be[_0x45d5fe[_0x1e51('0x27')]]={'$like':'%'+_0x4cf046[_0x1e51('0x2f')][_0x1e51('0x3b')]+'%'};return _0x5818be;}})});}_0x20eb9b=_[_0x1e51('0x3d')]({},_0x20eb9b,_0x4cf046[_0x1e51('0x3f')]);var _0x2f8fd9={'where':_0x20eb9b[_0x1e51('0x3c')]};return db[_0x1e51('0x2a')][_0x1e51('0x1e')](_0x2f8fd9)[_0x1e51('0x23')](function(_0xc40fce){_0x1ba84a['count']=_0xc40fce;if(_0x4cf046['query'][_0x1e51('0x40')]){_0x20eb9b[_0x1e51('0x41')]=[{'all':!![]}];}return db[_0x1e51('0x2a')][_0x1e51('0x42')](_0x20eb9b);})[_0x1e51('0x23')](function(_0x1a9e0d){_0x1ba84a[_0x1e51('0x43')]=_0x1a9e0d;return _0x1ba84a;})[_0x1e51('0x23')](respondWithFilteredResult(_0x4f67d3,_0x20eb9b))['catch'](handleError(_0x4f67d3,null));};exports[_0x1e51('0x44')]=function(_0x30eba9,_0x1750b3){var _0x41ca21={'raw':![],'where':{'id':_0x30eba9[_0x1e51('0x45')]['id']}},_0xfd96a0={};_0xfd96a0[_0x1e51('0x35')]=_['keys'](db[_0x1e51('0x2a')][_0x1e51('0x2b')]);_0xfd96a0['query']=_[_0x1e51('0x30')](_0x30eba9[_0x1e51('0x2f')]);_0xfd96a0[_0x1e51('0x39')]=_['intersection'](_0xfd96a0[_0x1e51('0x35')],_0xfd96a0[_0x1e51('0x2f')]);_0x41ca21[_0x1e51('0x32')]=_[_0x1e51('0x31')](_0xfd96a0[_0x1e51('0x35')],qs[_0x1e51('0x33')](_0x30eba9[_0x1e51('0x2f')][_0x1e51('0x33')]));_0x41ca21[_0x1e51('0x32')]=_0x41ca21['attributes'][_0x1e51('0x34')]?_0x41ca21[_0x1e51('0x32')]:_0xfd96a0['model'];if(_0x30eba9[_0x1e51('0x2f')][_0x1e51('0x40')]){_0x41ca21[_0x1e51('0x41')]=[{'all':!![]}];}_0x41ca21=_['merge']({},_0x41ca21,_0x30eba9[_0x1e51('0x3f')]);return db[_0x1e51('0x2a')][_0x1e51('0x46')](_0x41ca21)['then'](handleEntityNotFound(_0x1750b3,null))[_0x1e51('0x23')](respondWithResult(_0x1750b3,null))['catch'](handleError(_0x1750b3,null));};exports['create']=function(_0x54688b,_0x169e6c){return db[_0x1e51('0x2a')]['create'](_0x54688b['body'],{})[_0x1e51('0x23')](function(_0x7ffc42){var _0x2a43dd=_0x54688b[_0x1e51('0x47')][_0x1e51('0x24')]({'plain':!![]});if(!_0x2a43dd)throw new Error(_0x1e51('0x48'));if(_0x2a43dd['role']===_0x1e51('0x47')){var _0x48a2d0=_0x7ffc42[_0x1e51('0x24')]({'plain':!![]});var _0x43589a='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x43589a,'userProfileId':_0x2a43dd[_0x1e51('0x49')]},'raw':!![]})[_0x1e51('0x23')](function(_0x31a37a){if(_0x31a37a&&_0x31a37a['autoAssociation']===0x0){return db[_0x1e51('0x4a')][_0x1e51('0x4b')]({'name':_0x48a2d0[_0x1e51('0x27')],'resourceId':_0x48a2d0['id'],'type':_0x31a37a[_0x1e51('0x27')],'sectionId':_0x31a37a['id']},{})[_0x1e51('0x23')](function(){return _0x7ffc42;});}else{return _0x7ffc42;}})[_0x1e51('0x4c')](function(_0x32fe1f){logger[_0x1e51('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32fe1f);throw _0x32fe1f;});}return _0x7ffc42;})[_0x1e51('0x23')](respondWithResult(_0x169e6c,0xc9))[_0x1e51('0x4c')](handleError(_0x169e6c,null));};exports[_0x1e51('0x4d')]=function(_0x213edb,_0x177b63){var _0x2a88db={'where':{'id':_0x213edb[_0x1e51('0x45')]['id']}},_0x5ba6c2={};_0x5ba6c2['model']=_['keys'](db['Campaign'][_0x1e51('0x2b')]);_0x2a88db[_0x1e51('0x32')]=_[_0x1e51('0x31')](_0x5ba6c2['model'],qs[_0x1e51('0x33')](_0x213edb[_0x1e51('0x2f')][_0x1e51('0x33')]));_0x2a88db['attributes']=_0x2a88db[_0x1e51('0x32')][_0x1e51('0x34')]?_0x2a88db[_0x1e51('0x32')]:_0x5ba6c2['model'];if(_0x213edb[_0x1e51('0x2f')][_0x1e51('0x40')]){_0x2a88db[_0x1e51('0x41')]=[{'all':!![]}];}_0x2a88db=_[_0x1e51('0x3d')]({},_0x2a88db,_0x213edb[_0x1e51('0x3f')]);return db[_0x1e51('0x2a')][_0x1e51('0x46')](_0x2a88db)[_0x1e51('0x23')](handleEntityNotFound(_0x177b63,null))['then'](function(_0xd21d08){if(_0xd21d08){var _0x2e78e7=_0xd21d08['get']({'plain':!![]});_0x2e78e7=qs['omit'](_0x2e78e7,['id','createdAt',_0x1e51('0x4e')]);_0x213edb[_0x1e51('0x4f')]=_[_0x1e51('0x50')](_0x213edb[_0x1e51('0x4f')],['id',_0x1e51('0x51'),_0x1e51('0x4e')]);return db[_0x1e51('0x2a')][_0x1e51('0x4b')](_[_0x1e51('0x3d')](_0x2e78e7,_0x213edb['body']),{'include':_0x213edb['query']['includeAll']?[{'all':!![]}]:undefined})[_0x1e51('0x23')](function(_0x4048a4){var _0x50c202=_0x213edb['user'][_0x1e51('0x24')]({'plain':!![]});if(!_0x50c202)throw new Error(_0x1e51('0x48'));if(_0x50c202['role']===_0x1e51('0x47')){var _0x1fc8a9=_0x4048a4[_0x1e51('0x24')]({'plain':!![]});var _0x3e4073=_0x1e51('0x25');return db[_0x1e51('0x52')][_0x1e51('0x46')]({'where':{'name':_0x3e4073,'userProfileId':_0x50c202[_0x1e51('0x49')]},'raw':!![]})[_0x1e51('0x23')](function(_0x32863f){if(_0x32863f&&_0x32863f['autoAssociation']===0x0){return db[_0x1e51('0x4a')][_0x1e51('0x4b')]({'name':_0x1fc8a9[_0x1e51('0x27')],'resourceId':_0x1fc8a9['id'],'type':_0x32863f[_0x1e51('0x27')],'sectionId':_0x32863f['id']},{})[_0x1e51('0x23')](function(){return _0x4048a4;});}else{return _0x4048a4;}})[_0x1e51('0x4c')](function(_0x47cc50){logger['error'](_0x1e51('0x53'),_0x47cc50);throw _0x47cc50;});}return _0x4048a4;});}})[_0x1e51('0x23')](respondWithResult(_0x177b63,0xc9))[_0x1e51('0x4c')](handleError(_0x177b63,null));};exports[_0x1e51('0x22')]=function(_0x52a439,_0x4bbe62){if(_0x52a439['body']['id']){delete _0x52a439[_0x1e51('0x4f')]['id'];}return db[_0x1e51('0x2a')][_0x1e51('0x46')]({'where':{'id':_0x52a439[_0x1e51('0x45')]['id']}})[_0x1e51('0x23')](handleEntityNotFound(_0x4bbe62,null))['then'](saveUpdates(_0x52a439[_0x1e51('0x4f')],null))[_0x1e51('0x23')](respondWithResult(_0x4bbe62,null))[_0x1e51('0x4c')](handleError(_0x4bbe62,null));};exports['destroy']=function(_0x2d0ff0,_0x77f0c1){return db[_0x1e51('0x2a')]['find']({'where':{'id':_0x2d0ff0[_0x1e51('0x45')]['id']}})[_0x1e51('0x23')](handleEntityNotFound(_0x77f0c1,null))['then'](removeEntity(_0x77f0c1,null))['catch'](handleError(_0x77f0c1,null));};exports[_0x1e51('0x54')]=function(_0x4d6d41,_0x4464bf,_0x4cd38b){var _0x17a9fd={'raw':!![],'where':{}};var _0xe1cfa0={};var _0x35f12e={'count':0x0,'rows':[]};return db[_0x1e51('0x2a')]['findOne']({'where':{'id':_0x4d6d41[_0x1e51('0x45')]['id']}})['then'](handleEntityNotFound(_0x4464bf,null))['then'](function(_0xa31c12){if(_0xa31c12){_0xe1cfa0[_0x1e51('0x35')]=_[_0x1e51('0x30')](db['CmHopper'][_0x1e51('0x2b')]);_0xe1cfa0[_0x1e51('0x2f')]=_[_0x1e51('0x30')](_0x4d6d41[_0x1e51('0x2f')]);_0xe1cfa0['filters']=_[_0x1e51('0x31')](_0xe1cfa0['model'],_0xe1cfa0['query']);_0x17a9fd[_0x1e51('0x32')]=_['intersection'](_0xe1cfa0[_0x1e51('0x35')],qs['fields'](_0x4d6d41[_0x1e51('0x2f')]['fields']));_0x17a9fd[_0x1e51('0x32')]=_0x17a9fd[_0x1e51('0x32')]['length']?_0x17a9fd[_0x1e51('0x32')]:_0xe1cfa0['model'];if(!_0x4d6d41[_0x1e51('0x2f')][_0x1e51('0x36')](_0x1e51('0x55'))){_0x17a9fd[_0x1e51('0x1d')]=qs[_0x1e51('0x1d')](_0x4d6d41[_0x1e51('0x2f')]['limit']);_0x17a9fd[_0x1e51('0x1c')]=qs['offset'](_0x4d6d41['query'][_0x1e51('0x1c')]);}_0x17a9fd[_0x1e51('0x37')]=qs[_0x1e51('0x38')](_0x4d6d41[_0x1e51('0x2f')][_0x1e51('0x38')]);_0x17a9fd[_0x1e51('0x3c')]=qs[_0x1e51('0x39')](_['pick'](_0x4d6d41[_0x1e51('0x2f')],_0xe1cfa0[_0x1e51('0x39')]));_0x17a9fd[_0x1e51('0x3c')]['CampaignId']=_0xa31c12['id'];if(_0x4d6d41['query'][_0x1e51('0x3b')]){_0x17a9fd[_0x1e51('0x3c')]=_['merge'](_0x17a9fd[_0x1e51('0x3c')],{'$or':_[_0x1e51('0x29')](_0x17a9fd['attributes'],function(_0x5eb939){var _0xe96651={};_0xe96651[_0x5eb939]={'$like':'%'+_0x4d6d41[_0x1e51('0x2f')][_0x1e51('0x3b')]+'%'};return _0xe96651;})});}_0x17a9fd=_[_0x1e51('0x3d')]({},_0x17a9fd,_0x4d6d41[_0x1e51('0x3f')]);return db[_0x1e51('0x56')][_0x1e51('0x1e')]({'where':_0x17a9fd['where']})['then'](function(_0x117a81){_0x35f12e[_0x1e51('0x1e')]=_0x117a81;if(_0x4d6d41['query'][_0x1e51('0x40')]){_0x17a9fd[_0x1e51('0x41')]=[{'all':!![]}];}return db['CmHopper'][_0x1e51('0x42')](_0x17a9fd);})['then'](function(_0x34b98f){_0x35f12e['rows']=_0x34b98f;return _0x35f12e;});}})['then'](respondWithFilteredResult(_0x4464bf,_0x17a9fd))['catch'](handleError(_0x4464bf,null));};exports['getHopperHistories']=function(_0x51ada3,_0x5a7201,_0x27d0ea){var _0x5aa741={'raw':!![],'where':{}};var _0xd05f32={};var _0x5682a6={'count':0x0,'rows':[]};return db[_0x1e51('0x2a')][_0x1e51('0x57')]({'where':{'id':_0x51ada3[_0x1e51('0x45')]['id']}})['then'](handleEntityNotFound(_0x5a7201,null))[_0x1e51('0x23')](function(_0x3ed4b1){if(_0x3ed4b1){_0xd05f32['model']=_[_0x1e51('0x30')](db['CmHopperHistory'][_0x1e51('0x2b')]);_0xd05f32['query']=_[_0x1e51('0x30')](_0x51ada3[_0x1e51('0x2f')]);_0xd05f32[_0x1e51('0x39')]=_[_0x1e51('0x31')](_0xd05f32[_0x1e51('0x35')],_0xd05f32[_0x1e51('0x2f')]);_0x5aa741['attributes']=_[_0x1e51('0x31')](_0xd05f32['model'],qs[_0x1e51('0x33')](_0x51ada3[_0x1e51('0x2f')][_0x1e51('0x33')]));_0x5aa741[_0x1e51('0x32')]=_0x5aa741['attributes']['length']?_0x5aa741['attributes']:_0xd05f32[_0x1e51('0x35')];if(!_0x51ada3[_0x1e51('0x2f')][_0x1e51('0x36')](_0x1e51('0x55'))){_0x5aa741['limit']=qs[_0x1e51('0x1d')](_0x51ada3['query'][_0x1e51('0x1d')]);_0x5aa741['offset']=qs['offset'](_0x51ada3[_0x1e51('0x2f')][_0x1e51('0x1c')]);}_0x5aa741['order']=qs[_0x1e51('0x38')](_0x51ada3['query'][_0x1e51('0x38')]);_0x5aa741['where']=qs[_0x1e51('0x39')](_[_0x1e51('0x3a')](_0x51ada3['query'],_0xd05f32[_0x1e51('0x39')]));_0x5aa741['where'][_0x1e51('0x58')]=_0x3ed4b1['id'];if(_0x51ada3[_0x1e51('0x2f')][_0x1e51('0x3b')]){_0x5aa741[_0x1e51('0x3c')]=_['merge'](_0x5aa741[_0x1e51('0x3c')],{'$or':_[_0x1e51('0x29')](_0x5aa741[_0x1e51('0x32')],function(_0x4ff0ff){var _0x4b62a4={};_0x4b62a4[_0x4ff0ff]={'$like':'%'+_0x51ada3[_0x1e51('0x2f')][_0x1e51('0x3b')]+'%'};return _0x4b62a4;})});}_0x5aa741=_[_0x1e51('0x3d')]({},_0x5aa741,_0x51ada3['options']);return db['CmHopperHistory']['count']({'where':_0x5aa741[_0x1e51('0x3c')]})[_0x1e51('0x23')](function(_0x31788a){_0x5682a6['count']=_0x31788a;if(_0x51ada3[_0x1e51('0x2f')][_0x1e51('0x40')]){_0x5aa741['include']=[{'all':!![]}];}return db[_0x1e51('0x59')][_0x1e51('0x42')](_0x5aa741);})[_0x1e51('0x23')](function(_0x4af474){_0x5682a6[_0x1e51('0x43')]=_0x4af474;return _0x5682a6;});}})['then'](respondWithFilteredResult(_0x5a7201,_0x5aa741))[_0x1e51('0x4c')](handleError(_0x5a7201,null));};exports[_0x1e51('0x5a')]=function(_0x3525dc,_0x471b01,_0xd71adc){var _0x37a7ef={'raw':!![],'where':{}};var _0x37f26c={};var _0xa3225a={'count':0x0,'rows':[]};return db[_0x1e51('0x2a')]['findOne']({'where':{'id':_0x3525dc[_0x1e51('0x45')]['id']}})['then'](handleEntityNotFound(_0x471b01,null))[_0x1e51('0x23')](function(_0x4c7eb9){if(_0x4c7eb9){_0x37f26c[_0x1e51('0x35')]=_[_0x1e51('0x30')](db[_0x1e51('0x5b')][_0x1e51('0x2b')]);_0x37f26c[_0x1e51('0x2f')]=_[_0x1e51('0x30')](_0x3525dc[_0x1e51('0x2f')]);_0x37f26c[_0x1e51('0x39')]=_[_0x1e51('0x31')](_0x37f26c['model'],_0x37f26c[_0x1e51('0x2f')]);_0x37a7ef[_0x1e51('0x32')]=_[_0x1e51('0x31')](_0x37f26c['model'],qs[_0x1e51('0x33')](_0x3525dc[_0x1e51('0x2f')][_0x1e51('0x33')]));_0x37a7ef['attributes']=_0x37a7ef[_0x1e51('0x32')][_0x1e51('0x34')]?_0x37a7ef[_0x1e51('0x32')]:_0x37f26c[_0x1e51('0x35')];if(!_0x3525dc[_0x1e51('0x2f')]['hasOwnProperty']('nolimit')){_0x37a7ef[_0x1e51('0x1d')]=qs['limit'](_0x3525dc['query'][_0x1e51('0x1d')]);_0x37a7ef[_0x1e51('0x1c')]=qs[_0x1e51('0x1c')](_0x3525dc[_0x1e51('0x2f')][_0x1e51('0x1c')]);}_0x37a7ef[_0x1e51('0x37')]=qs[_0x1e51('0x38')](_0x3525dc[_0x1e51('0x2f')][_0x1e51('0x38')]);_0x37a7ef['where']=qs[_0x1e51('0x39')](_[_0x1e51('0x3a')](_0x3525dc[_0x1e51('0x2f')],_0x37f26c['filters']));_0x37a7ef['where'][_0x1e51('0x58')]=_0x4c7eb9['id'];if(_0x3525dc[_0x1e51('0x2f')]['filter']){_0x37a7ef[_0x1e51('0x3c')]=_[_0x1e51('0x3d')](_0x37a7ef['where'],{'$or':_[_0x1e51('0x29')](_0x37a7ef[_0x1e51('0x32')],function(_0x4367ba){var _0x570c75={};_0x570c75[_0x4367ba]={'$like':'%'+_0x3525dc[_0x1e51('0x2f')][_0x1e51('0x3b')]+'%'};return _0x570c75;})});}_0x37a7ef=_[_0x1e51('0x3d')]({},_0x37a7ef,_0x3525dc[_0x1e51('0x3f')]);return db[_0x1e51('0x5b')][_0x1e51('0x1e')]({'where':_0x37a7ef[_0x1e51('0x3c')]})[_0x1e51('0x23')](function(_0x1a8903){_0xa3225a[_0x1e51('0x1e')]=_0x1a8903;if(_0x3525dc['query']['includeAll']){_0x37a7ef[_0x1e51('0x41')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x37a7ef);})['then'](function(_0x251595){_0xa3225a['rows']=_0x251595;return _0xa3225a;});}})[_0x1e51('0x23')](respondWithFilteredResult(_0x471b01,_0x37a7ef))['catch'](handleError(_0x471b01,null));};exports[_0x1e51('0x5c')]=function(_0xb79285,_0x4859cd,_0x14d40c){var _0x5c4fe6={'raw':!![],'where':{}};var _0x7ebccd={};var _0x3f0cb2={'count':0x0,'rows':[]};return db['Campaign'][_0x1e51('0x57')]({'where':{'id':_0xb79285[_0x1e51('0x45')]['id']}})['then'](handleEntityNotFound(_0x4859cd,null))['then'](function(_0x4e99dd){if(_0x4e99dd){_0x7ebccd[_0x1e51('0x35')]=_[_0x1e51('0x30')](db[_0x1e51('0x5d')]['rawAttributes']);_0x7ebccd['query']=_[_0x1e51('0x30')](_0xb79285[_0x1e51('0x2f')]);_0x7ebccd[_0x1e51('0x39')]=_['intersection'](_0x7ebccd[_0x1e51('0x35')],_0x7ebccd[_0x1e51('0x2f')]);_0x5c4fe6[_0x1e51('0x32')]=_[_0x1e51('0x31')](_0x7ebccd[_0x1e51('0x35')],qs[_0x1e51('0x33')](_0xb79285['query'][_0x1e51('0x33')]));_0x5c4fe6[_0x1e51('0x32')]=_0x5c4fe6[_0x1e51('0x32')]['length']?_0x5c4fe6['attributes']:_0x7ebccd[_0x1e51('0x35')];if(!_0xb79285['query']['hasOwnProperty']('nolimit')){_0x5c4fe6[_0x1e51('0x1d')]=qs[_0x1e51('0x1d')](_0xb79285[_0x1e51('0x2f')][_0x1e51('0x1d')]);_0x5c4fe6['offset']=qs['offset'](_0xb79285['query'][_0x1e51('0x1c')]);}_0x5c4fe6['order']=qs[_0x1e51('0x38')](_0xb79285[_0x1e51('0x2f')][_0x1e51('0x38')]);_0x5c4fe6[_0x1e51('0x3c')]=qs[_0x1e51('0x39')](_[_0x1e51('0x3a')](_0xb79285[_0x1e51('0x2f')],_0x7ebccd['filters']));_0x5c4fe6[_0x1e51('0x3c')][_0x1e51('0x58')]=_0x4e99dd['id'];if(_0xb79285[_0x1e51('0x2f')][_0x1e51('0x3b')]){_0x5c4fe6['where']=_[_0x1e51('0x3d')](_0x5c4fe6[_0x1e51('0x3c')],{'$or':_['map'](_0x5c4fe6[_0x1e51('0x32')],function(_0x2ab009){var _0x42ae53={};_0x42ae53[_0x2ab009]={'$like':'%'+_0xb79285[_0x1e51('0x2f')][_0x1e51('0x3b')]+'%'};return _0x42ae53;})});}_0x5c4fe6=_[_0x1e51('0x3d')]({},_0x5c4fe6,_0xb79285[_0x1e51('0x3f')]);return db[_0x1e51('0x5d')][_0x1e51('0x1e')]({'where':_0x5c4fe6[_0x1e51('0x3c')]})['then'](function(_0x210df0){_0x3f0cb2[_0x1e51('0x1e')]=_0x210df0;if(_0xb79285[_0x1e51('0x2f')][_0x1e51('0x40')]){_0x5c4fe6[_0x1e51('0x41')]=[{'all':!![]}];}return db[_0x1e51('0x5d')][_0x1e51('0x42')](_0x5c4fe6);})[_0x1e51('0x23')](function(_0x1e1c48){_0x3f0cb2[_0x1e51('0x43')]=_0x1e1c48;return _0x3f0cb2;});}})[_0x1e51('0x23')](respondWithFilteredResult(_0x4859cd,_0x5c4fe6))['catch'](handleError(_0x4859cd,null));};exports[_0x1e51('0x5e')]=function(_0x3fa83a,_0x4c0f22,_0x5ae595){var _0x4595d6={};var _0x3ac432={};var _0x9aa50a;var _0x8cf4bc;return db[_0x1e51('0x2a')][_0x1e51('0x57')]({'where':{'id':_0x3fa83a['params']['id']}})['then'](handleEntityNotFound(_0x4c0f22,null))[_0x1e51('0x23')](function(_0x324a68){if(_0x324a68){_0x9aa50a=_0x324a68;_0x3ac432['model']=_[_0x1e51('0x30')](db[_0x1e51('0x5f')][_0x1e51('0x2b')]);_0x3ac432['query']=_[_0x1e51('0x30')](_0x3fa83a[_0x1e51('0x2f')]);_0x3ac432[_0x1e51('0x39')]=_['intersection'](_0x3ac432[_0x1e51('0x35')],_0x3ac432[_0x1e51('0x2f')]);_0x4595d6[_0x1e51('0x32')]=_[_0x1e51('0x31')](_0x3ac432['model'],qs[_0x1e51('0x33')](_0x3fa83a[_0x1e51('0x2f')]['fields']));_0x4595d6[_0x1e51('0x32')]=_0x4595d6[_0x1e51('0x32')][_0x1e51('0x34')]?_0x4595d6[_0x1e51('0x32')]:_0x3ac432['model'];_0x4595d6[_0x1e51('0x37')]=qs[_0x1e51('0x38')](_0x3fa83a[_0x1e51('0x2f')][_0x1e51('0x38')]);_0x4595d6[_0x1e51('0x3c')]=qs['filters'](_[_0x1e51('0x3a')](_0x3fa83a[_0x1e51('0x2f')],_0x3ac432[_0x1e51('0x39')]));if(_0x3fa83a[_0x1e51('0x2f')]['filter']){_0x4595d6['where']=_[_0x1e51('0x3d')](_0x4595d6['where'],{'$or':_['map'](_0x4595d6[_0x1e51('0x32')],function(_0x2db20f){var _0x1425f4={};_0x1425f4[_0x2db20f]={'$like':'%'+_0x3fa83a[_0x1e51('0x2f')][_0x1e51('0x3b')]+'%'};return _0x1425f4;})});}_0x4595d6=_[_0x1e51('0x3d')]({},_0x4595d6,_0x3fa83a['options']);return _0x9aa50a[_0x1e51('0x5e')](_0x4595d6);}})[_0x1e51('0x23')](function(_0x5bfd77){if(_0x5bfd77){_0x8cf4bc=_0x5bfd77['length'];if(!_0x3fa83a['query']['hasOwnProperty'](_0x1e51('0x55'))){_0x4595d6[_0x1e51('0x1d')]=qs['limit'](_0x3fa83a[_0x1e51('0x2f')][_0x1e51('0x1d')]);_0x4595d6[_0x1e51('0x1c')]=qs[_0x1e51('0x1c')](_0x3fa83a[_0x1e51('0x2f')][_0x1e51('0x1c')]);}return _0x9aa50a[_0x1e51('0x5e')](_0x4595d6);}})[_0x1e51('0x23')](function(_0x236554){if(_0x236554){return _0x236554?{'count':_0x8cf4bc,'rows':_0x236554}:null;}})[_0x1e51('0x23')](respondWithResult(_0x4c0f22,null))[_0x1e51('0x4c')](handleError(_0x4c0f22,null));};exports['addLists']=function(_0x1d3b1d,_0x26eaa8,_0x41f919){var _0xafac74,_0x4ac5bd;var _0x4fbf59=[];var _0x358507=moment()[_0x1e51('0x60')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x1e51('0x2a')][_0x1e51('0x46')]({'where':{'id':_0x1d3b1d['params']['id']}})['then'](handleEntityNotFound(_0x26eaa8,null))[_0x1e51('0x23')](function(_0xc10372){if(_0xc10372){_0x4ac5bd=_0xc10372;return _0xc10372['addLists'](_0x1d3b1d[_0x1e51('0x4f')][_0x1e51('0x61')],_[_0x1e51('0x50')](_0x1d3b1d['body'],[_0x1e51('0x61'),'id'])||{});}return null;})['spread'](function(_0x5b6915){var _0x54ed06;var _0x46277a;_0xafac74=_0x5b6915||[];var _0x563d4b=[];if(_0x5b6915){for(var _0x5b959d=0x0;_0x5b959d<_0x5b6915[_0x1e51('0x34')];_0x5b959d+=0x1){var _0x30d666=_0x5b6915[_0x5b959d][_0x1e51('0x24')]({'plain':!![]});_0x4ac5bd[_0x1e51('0x62')]=_0x1d3b1d[_0x1e51('0x4f')][_0x1e51('0x62')]?_0x1d3b1d[_0x1e51('0x4f')][_0x1e51('0x62')]:_0x4ac5bd[_0x1e51('0x62')];switch(_0x4ac5bd[_0x1e51('0x62')]){case _0x1e51('0x63'):_0x54ed06=squel[_0x1e51('0x64')]()[_0x1e51('0x65')]('cm_hopper')[_0x1e51('0x66')]([_0x1e51('0x67'),_0x1e51('0x68'),'ContactId',_0x1e51('0x69'),_0x1e51('0x58'),'createdAt',_0x1e51('0x4e')],squel[_0x1e51('0x6a')]()[_0x1e51('0x6b')](_0x1e51('0x67'),_0x1e51('0x67'))[_0x1e51('0x6b')](_0x1e51('0x6c'),_0x1e51('0x68'))[_0x1e51('0x6b')]('id',_0x1e51('0x6d'))[_0x1e51('0x6b')](_0x30d666[_0x1e51('0x6e')][_0x1e51('0x6f')](),_0x1e51('0x69'))[_0x1e51('0x6b')](_0x1d3b1d[_0x1e51('0x45')]['id']['toString'](),_0x1e51('0x58'))[_0x1e51('0x6b')]('\x27'+_0x358507+'\x27',_0x1e51('0x51'))['field']('\x27'+_0x358507+'\x27','updatedAt')[_0x1e51('0x70')](_0x1e51('0x71'))[_0x1e51('0x3c')](_0x1e51('0x72'))[_0x1e51('0x3c')]('ListId\x20=\x20?',_0x30d666['CmListId'][_0x1e51('0x6f')]())[_0x1e51('0x3c')](_0x1e51('0x73'))[_0x1e51('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1e51('0x6a')]()[_0x1e51('0x6b')](_0x1e51('0x74'))[_0x1e51('0x70')](_0x1e51('0x75'))[_0x1e51('0x3c')](_0x1e51('0x76'),_0x1d3b1d[_0x1e51('0x45')]['id'][_0x1e51('0x6f')]()))['where'](_0x1e51('0x77'),squel[_0x1e51('0x6a')]()[_0x1e51('0x6b')](_0x1e51('0x78'))[_0x1e51('0x70')](_0x1e51('0x79'))[_0x1e51('0x3c')](_0x1e51('0x76'),_0x1d3b1d['params']['id'][_0x1e51('0x6f')]())))[_0x1e51('0x6f')]();break;case _0x1e51('0x7a'):_0x54ed06=squel[_0x1e51('0x64')]()[_0x1e51('0x65')](_0x1e51('0x79'))[_0x1e51('0x66')](['phone','scheduledAt',_0x1e51('0x6d'),'ListId',_0x1e51('0x58'),'createdAt',_0x1e51('0x4e')],squel[_0x1e51('0x6a')]()[_0x1e51('0x6b')](_0x1e51('0x67'),'phone')[_0x1e51('0x6b')]('NOW()',_0x1e51('0x68'))['field']('id',_0x1e51('0x6d'))['field'](_0x30d666[_0x1e51('0x6e')][_0x1e51('0x6f')](),_0x1e51('0x69'))[_0x1e51('0x6b')](_0x1d3b1d[_0x1e51('0x45')]['id']['toString'](),_0x1e51('0x58'))[_0x1e51('0x6b')]('\x27'+_0x358507+'\x27','createdAt')[_0x1e51('0x6b')]('\x27'+_0x358507+'\x27','updatedAt')[_0x1e51('0x70')](_0x1e51('0x71'))[_0x1e51('0x3c')](_0x1e51('0x72'))['where'](_0x1e51('0x7b'),_0x30d666[_0x1e51('0x6e')]['toString']())[_0x1e51('0x3c')](_0x1e51('0x73'))[_0x1e51('0x3c')](_0x1e51('0x77'),squel[_0x1e51('0x6a')]()[_0x1e51('0x6b')](_0x1e51('0x78'))[_0x1e51('0x70')](_0x1e51('0x79'))[_0x1e51('0x3c')](_0x1e51('0x76'),_0x1d3b1d[_0x1e51('0x45')]['id'][_0x1e51('0x6f')]())))[_0x1e51('0x6f')]();break;default:_0x54ed06=squel[_0x1e51('0x64')]()[_0x1e51('0x65')](_0x1e51('0x79'))[_0x1e51('0x66')]([_0x1e51('0x67'),_0x1e51('0x68'),_0x1e51('0x6d'),_0x1e51('0x69'),_0x1e51('0x58'),'createdAt',_0x1e51('0x4e')],squel['select']()[_0x1e51('0x6b')]('phone','phone')[_0x1e51('0x6b')]('NOW()',_0x1e51('0x68'))[_0x1e51('0x6b')]('id','ContactId')[_0x1e51('0x6b')](_0x30d666[_0x1e51('0x6e')][_0x1e51('0x6f')](),_0x1e51('0x69'))['field'](_0x1d3b1d[_0x1e51('0x45')]['id'][_0x1e51('0x6f')](),'CampaignId')['field']('\x27'+_0x358507+'\x27',_0x1e51('0x51'))[_0x1e51('0x6b')]('\x27'+_0x358507+'\x27',_0x1e51('0x4e'))[_0x1e51('0x70')](_0x1e51('0x71'))[_0x1e51('0x3c')](_0x1e51('0x72'))[_0x1e51('0x3c')](_0x1e51('0x7b'),_0x30d666[_0x1e51('0x6e')][_0x1e51('0x6f')]())[_0x1e51('0x3c')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x46277a=squel[_0x1e51('0x64')]()[_0x1e51('0x65')]('cm_hopper_additional_phones')['fromQuery']([_0x1e51('0x7c'),'scheduledAt',_0x1e51('0x67'),_0x1e51('0x7d'),_0x1e51('0x51'),_0x1e51('0x4e')],squel[_0x1e51('0x6a')]()['field']('h.id','id')[_0x1e51('0x6b')](_0x1e51('0x6c'),_0x1e51('0x68'))['field'](_0x1e51('0x7e'),_0x1e51('0x67'))[_0x1e51('0x6b')](_0x1e51('0x7f'),_0x1e51('0x7d'))['field']('\x27'+_0x358507+'\x27',_0x1e51('0x51'))[_0x1e51('0x6b')]('\x27'+_0x358507+'\x27',_0x1e51('0x4e'))['from']('cm_contact_has_items','ci')[_0x1e51('0x80')](_0x1e51('0x79'),'h',_0x1e51('0x81'))[_0x1e51('0x3c')]('h.ListId\x20=\x20?',_0x30d666[_0x1e51('0x6e')][_0x1e51('0x6f')]())[_0x1e51('0x3c')](_0x1e51('0x82'),_0x1d3b1d[_0x1e51('0x45')]['id'][_0x1e51('0x6f')]())[_0x1e51('0x3c')](_0x1e51('0x83'),_0x358507))[_0x1e51('0x6f')]();_0x563d4b[_0x1e51('0x84')](db[_0x1e51('0x85')][_0x1e51('0x2f')](_0x54ed06));_0x4fbf59[_0x1e51('0x84')](db[_0x1e51('0x85')]['query'](_0x46277a));}return BPromise[_0x1e51('0x86')](_0x563d4b);}})['then'](function(){return BPromise['all'](_0x4fbf59);})[_0x1e51('0x23')](function(){return _0xafac74;})[_0x1e51('0x23')](respondWithResult(_0x26eaa8,null))[_0x1e51('0x4c')](handleError(_0x26eaa8,null));};exports[_0x1e51('0x87')]=function(_0x29668d,_0x584ea6,_0xd3a3c6){return db[_0x1e51('0x2a')][_0x1e51('0x46')]({'where':{'id':_0x29668d[_0x1e51('0x45')]['id']}})[_0x1e51('0x23')](handleEntityNotFound(_0x584ea6,null))[_0x1e51('0x23')](function(_0x272bbd){if(_0x272bbd){return _0x272bbd[_0x1e51('0x87')](_0x29668d[_0x1e51('0x2f')]['ids']);}})['then'](function(_0x4f5c91){if(_0x4f5c91){return db['CmHopper'][_0x1e51('0x88')]({'where':{'ListId':_0x29668d[_0x1e51('0x2f')][_0x1e51('0x61')],'CampaignId':_0x29668d['params']['id']}})[_0x1e51('0x23')](function(){return _0x4f5c91;});}})[_0x1e51('0x23')](respondWithStatusCode(_0x584ea6,null))['catch'](handleError(_0x584ea6,null));};exports[_0x1e51('0x89')]=function(_0x2fb27e,_0x469630,_0x6e245b){var _0x40a50b={};var _0x403cdc={};var _0x991c72;var _0x5076d9;return db[_0x1e51('0x2a')][_0x1e51('0x57')]({'where':{'id':_0x2fb27e[_0x1e51('0x45')]['id']}})['then'](handleEntityNotFound(_0x469630,null))[_0x1e51('0x23')](function(_0x4e9221){if(_0x4e9221){_0x991c72=_0x4e9221;_0x403cdc[_0x1e51('0x35')]=_[_0x1e51('0x30')](db['CmList'][_0x1e51('0x2b')]);_0x403cdc[_0x1e51('0x2f')]=_['keys'](_0x2fb27e[_0x1e51('0x2f')]);_0x403cdc[_0x1e51('0x39')]=_[_0x1e51('0x31')](_0x403cdc[_0x1e51('0x35')],_0x403cdc[_0x1e51('0x2f')]);_0x40a50b[_0x1e51('0x32')]=_[_0x1e51('0x31')](_0x403cdc[_0x1e51('0x35')],qs[_0x1e51('0x33')](_0x2fb27e[_0x1e51('0x2f')]['fields']));_0x40a50b['attributes']=_0x40a50b[_0x1e51('0x32')][_0x1e51('0x34')]?_0x40a50b[_0x1e51('0x32')]:_0x403cdc[_0x1e51('0x35')];_0x40a50b[_0x1e51('0x37')]=qs['sort'](_0x2fb27e[_0x1e51('0x2f')][_0x1e51('0x38')]);_0x40a50b[_0x1e51('0x3c')]=qs['filters'](_['pick'](_0x2fb27e[_0x1e51('0x2f')],_0x403cdc[_0x1e51('0x39')]));if(_0x2fb27e[_0x1e51('0x2f')][_0x1e51('0x3b')]){_0x40a50b[_0x1e51('0x3c')]=_[_0x1e51('0x3d')](_0x40a50b[_0x1e51('0x3c')],{'$or':_[_0x1e51('0x29')](_0x40a50b[_0x1e51('0x32')],function(_0x36f888){var _0x4a9dc2={};_0x4a9dc2[_0x36f888]={'$like':'%'+_0x2fb27e['query'][_0x1e51('0x3b')]+'%'};return _0x4a9dc2;})});}_0x40a50b=_['merge']({},_0x40a50b,_0x2fb27e[_0x1e51('0x3f')]);return _0x991c72[_0x1e51('0x89')](_0x40a50b);}})[_0x1e51('0x23')](function(_0x34c7d5){if(_0x34c7d5){_0x5076d9=_0x34c7d5[_0x1e51('0x34')];if(!_0x2fb27e[_0x1e51('0x2f')][_0x1e51('0x36')](_0x1e51('0x55'))){_0x40a50b['limit']=qs[_0x1e51('0x1d')](_0x2fb27e[_0x1e51('0x2f')][_0x1e51('0x1d')]);_0x40a50b[_0x1e51('0x1c')]=qs[_0x1e51('0x1c')](_0x2fb27e[_0x1e51('0x2f')][_0x1e51('0x1c')]);}return _0x991c72[_0x1e51('0x89')](_0x40a50b);}})[_0x1e51('0x23')](function(_0x38b2ab){if(_0x38b2ab){return _0x38b2ab?{'count':_0x5076d9,'rows':_0x38b2ab}:null;}})[_0x1e51('0x23')](respondWithResult(_0x469630,null))[_0x1e51('0x4c')](handleError(_0x469630,null));};exports['addBlackLists']=function(_0x11a8b6,_0x7eab7a,_0x4002cf){var _0x2bcf63,_0x409830;var _0x169d6f=[];var _0x453835=moment()[_0x1e51('0x60')](_0x1e51('0x8a'));return db[_0x1e51('0x2a')][_0x1e51('0x46')]({'where':{'id':_0x11a8b6['params']['id']}})[_0x1e51('0x23')](handleEntityNotFound(_0x7eab7a,null))['then'](function(_0x4f9569){if(_0x4f9569){_0x409830=_0x4f9569;return _0x4f9569[_0x1e51('0x8b')](_0x11a8b6[_0x1e51('0x4f')][_0x1e51('0x61')],_[_0x1e51('0x50')](_0x11a8b6['body'],[_0x1e51('0x61'),'id'])||{});}return null;})[_0x1e51('0x8c')](function(_0x19157e){var _0x5ea4c8;var _0xe52966;_0x2bcf63=_0x19157e||[];var _0x532591=[];if(_0x19157e){for(var _0x487e5f=0x0;_0x487e5f<_0x19157e['length'];_0x487e5f+=0x1){var _0x211923=_0x19157e[_0x487e5f][_0x1e51('0x24')]({'plain':!![]});_0x5ea4c8=squel[_0x1e51('0x64')]()[_0x1e51('0x65')](_0x1e51('0x8d'))[_0x1e51('0x66')](['phone',_0x1e51('0x6d'),'ListId','CampaignId','createdAt','updatedAt'],squel[_0x1e51('0x6a')]()[_0x1e51('0x6b')]('phone','phone')[_0x1e51('0x6b')]('id',_0x1e51('0x6d'))['field'](_0x211923[_0x1e51('0x6e')][_0x1e51('0x6f')](),'ListId')[_0x1e51('0x6b')](_0x11a8b6[_0x1e51('0x45')]['id']['toString'](),'CampaignId')[_0x1e51('0x6b')](_0x1e51('0x6c'),_0x1e51('0x51'))[_0x1e51('0x6b')](_0x1e51('0x6c'),_0x1e51('0x4e'))['from'](_0x1e51('0x71'))[_0x1e51('0x3c')](_0x1e51('0x72'))[_0x1e51('0x3c')](_0x1e51('0x7b'),_0x211923[_0x1e51('0x6e')][_0x1e51('0x6f')]())[_0x1e51('0x3c')](_0x1e51('0x73')))[_0x1e51('0x6f')]();_0x532591[_0x1e51('0x84')](db[_0x1e51('0x85')][_0x1e51('0x2f')](_0x5ea4c8));}return BPromise[_0x1e51('0x86')](_0x532591);}})[_0x1e51('0x23')](function(){return _0x2bcf63;})[_0x1e51('0x23')](respondWithResult(_0x7eab7a,null))['catch'](handleError(_0x7eab7a,null));};exports[_0x1e51('0x8e')]=function(_0x5e8072,_0x52091b,_0x2b758){return db[_0x1e51('0x2a')][_0x1e51('0x46')]({'where':{'id':_0x5e8072[_0x1e51('0x45')]['id']}})[_0x1e51('0x23')](handleEntityNotFound(_0x52091b,null))['then'](function(_0x5c135a){if(_0x5c135a){return _0x5c135a[_0x1e51('0x8e')](_0x5e8072['query'][_0x1e51('0x61')]);}})[_0x1e51('0x23')](function(_0x3a70a0){if(_0x3a70a0){return db['CmHopperBlack'][_0x1e51('0x88')]({'where':{'ListId':_0x5e8072[_0x1e51('0x2f')][_0x1e51('0x61')],'CampaignId':_0x5e8072[_0x1e51('0x45')]['id']}})['then'](function(){return _0x3a70a0;});}})[_0x1e51('0x23')](respondWithStatusCode(_0x52091b,null))['catch'](handleError(_0x52091b,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index fc413f9..a565498 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x16446a,_0x5e9140){var _0x2c7051=function(_0x2e6a25){while(--_0x2e6a25){_0x16446a['push'](_0x16446a['shift']());}};_0x2c7051(++_0x5e9140);}(_0x7a54,0x106));var _0x47a5=function(_0x3f0407,_0x25a746){_0x3f0407=_0x3f0407-0x0;var _0x25863d=_0x7a54[_0x3f0407];return _0x25863d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x2703cf,_0x526b31){var _0x28f18a=function(_0x10e33b){while(--_0x10e33b){_0x2703cf['push'](_0x2703cf['shift']());}};_0x28f18a(++_0x526b31);}(_0x7a54,0x106));var _0x47a5=function(_0x1ed99a,_0x4d4005){_0x1ed99a=_0x1ed99a-0x0;var _0x15ba4e=_0x7a54[_0x1ed99a];return _0x15ba4e;};'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 76e18a9..ace6b93 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 _0x98e1=['client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','message','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','GetCampaign','stringify','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x3c414c,_0x399dbb){var _0x4f3062=function(_0x1b71cc){while(--_0x1b71cc){_0x3c414c['push'](_0x3c414c['shift']());}};_0x4f3062(++_0x399dbb);}(_0x98e1,0x160));var _0x198e=function(_0x26a692,_0xacd9b7){_0x26a692=_0x26a692-0x0;var _0x277f46=_0x98e1[_0x26a692];return _0x277f46;};'use strict';var _=require('lodash');var util=require(_0x198e('0x0'));var moment=require(_0x198e('0x1'));var BPromise=require(_0x198e('0x2'));var rs=require(_0x198e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x198e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x198e('0x5'));var config=require(_0x198e('0x6'));var jayson=require(_0x198e('0x7'));var client=jayson[_0x198e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x545114,_0x46ac1b,_0x4d45d6){return new BPromise(function(_0x3322c5,_0x5ba06f){return client[_0x198e('0x9')](_0x545114,_0x4d45d6)[_0x198e('0xa')](function(_0x1ea2bf){logger[_0x198e('0xb')](_0x198e('0xc'),_0x46ac1b,_0x198e('0xd'));logger[_0x198e('0xe')](_0x198e('0xf'),_0x46ac1b,_0x198e('0xd'),JSON['stringify'](_0x1ea2bf));if(_0x1ea2bf[_0x198e('0x10')]){if(_0x1ea2bf[_0x198e('0x10')]['code']===0x1f4){logger[_0x198e('0x10')]('Campaign,\x20%s,\x20%s',_0x46ac1b,_0x1ea2bf[_0x198e('0x10')]['message']);return _0x5ba06f(_0x1ea2bf['error']['message']);}logger['error'](_0x198e('0xc'),_0x46ac1b,_0x1ea2bf[_0x198e('0x10')][_0x198e('0x11')]);return _0x3322c5(_0x1ea2bf['error'][_0x198e('0x11')]);}else{logger[_0x198e('0xb')](_0x198e('0xc'),_0x46ac1b,'request\x20sent');_0x3322c5(_0x1ea2bf['result']['message']);}})['catch'](function(_0x57f15e){logger[_0x198e('0x10')]('Campaign,\x20%s,\x20%s',_0x46ac1b,_0x57f15e);_0x5ba06f(_0x57f15e);});});}exports['GetCampaign']=function(_0x440975){var _0x46c980=this;return new Promise(function(_0x2485ea,_0x4cbf50){return db[_0x198e('0x12')][_0x198e('0x13')]({'raw':_0x440975[_0x198e('0x14')]?_0x440975[_0x198e('0x14')][_0x198e('0x15')]===undefined?!![]:![]:!![],'where':_0x440975['options']?_0x440975[_0x198e('0x14')][_0x198e('0x16')]||null:null,'attributes':_0x440975['options']?_0x440975[_0x198e('0x14')][_0x198e('0x17')]||null:null,'limit':_0x440975[_0x198e('0x14')]?_0x440975[_0x198e('0x14')][_0x198e('0x18')]||null:null,'include':_0x440975[_0x198e('0x14')]?_0x440975['options'][_0x198e('0x19')]?_[_0x198e('0x1a')](_0x440975[_0x198e('0x14')][_0x198e('0x19')],function(_0x17d04d){return{'model':db[_0x17d04d[_0x198e('0x1b')]],'as':_0x17d04d['as'],'attributes':_0x17d04d[_0x198e('0x17')],'include':_0x17d04d['include']?_[_0x198e('0x1a')](_0x17d04d[_0x198e('0x19')],function(_0x1fceba){return{'model':db[_0x1fceba[_0x198e('0x1b')]],'as':_0x1fceba['as'],'attributes':_0x1fceba[_0x198e('0x17')],'include':_0x1fceba[_0x198e('0x19')]?_[_0x198e('0x1a')](_0x1fceba[_0x198e('0x19')],function(_0x66c071){return{'model':db[_0x66c071['model']],'as':_0x66c071['as'],'attributes':_0x66c071['attributes']};}):[]};}):[]};}):[]:[]})[_0x198e('0xa')](function(_0x1a249c){logger['info']('GetCampaign',_0x440975);logger[_0x198e('0xe')](_0x198e('0x1c'),_0x440975,JSON[_0x198e('0x1d')](_0x1a249c));_0x2485ea(_0x1a249c);})['catch'](function(_0x5e657e){logger[_0x198e('0x10')](_0x198e('0x1c'),_0x5e657e[_0x198e('0x11')],_0x440975);_0x4cbf50(_0x46c980[_0x198e('0x10')](0x1f4,_0x5e657e[_0x198e('0x11')]));});});};
\ No newline at end of file
+var _0xcffe=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCampaign','Campaign','options','raw','where','attributes','map','include','model'];(function(_0x57fa5c,_0x22d1e7){var _0x270ebe=function(_0xf97a43){while(--_0xf97a43){_0x57fa5c['push'](_0x57fa5c['shift']());}};_0x270ebe(++_0x22d1e7);}(_0xcffe,0x1a1));var _0xecff=function(_0x1e2372,_0x2ea876){_0x1e2372=_0x1e2372-0x0;var _0x4cd59b=_0xcffe[_0x1e2372];return _0x4cd59b;};'use strict';var _=require(_0xecff('0x0'));var util=require(_0xecff('0x1'));var moment=require(_0xecff('0x2'));var BPromise=require(_0xecff('0x3'));var rs=require(_0xecff('0x4'));var fs=require('fs');var Redis=require(_0xecff('0x5'));var db=require(_0xecff('0x6'))['db'];var utils=require(_0xecff('0x7'));var logger=require(_0xecff('0x8'))(_0xecff('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xecff('0xa')][_0xecff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e2fa9,_0x38a8f6,_0x50c98b){return new BPromise(function(_0x298c19,_0x1f7386){return client['request'](_0x2e2fa9,_0x50c98b)[_0xecff('0xc')](function(_0x3eefb9){logger[_0xecff('0xd')](_0xecff('0xe'),_0x38a8f6,_0xecff('0xf'));logger['debug'](_0xecff('0x10'),_0x38a8f6,_0xecff('0xf'),JSON[_0xecff('0x11')](_0x3eefb9));if(_0x3eefb9[_0xecff('0x12')]){if(_0x3eefb9[_0xecff('0x12')][_0xecff('0x13')]===0x1f4){logger[_0xecff('0x12')](_0xecff('0xe'),_0x38a8f6,_0x3eefb9[_0xecff('0x12')][_0xecff('0x14')]);return _0x1f7386(_0x3eefb9[_0xecff('0x12')][_0xecff('0x14')]);}logger[_0xecff('0x12')](_0xecff('0xe'),_0x38a8f6,_0x3eefb9['error']['message']);return _0x298c19(_0x3eefb9[_0xecff('0x12')][_0xecff('0x14')]);}else{logger['info'](_0xecff('0xe'),_0x38a8f6,_0xecff('0xf'));_0x298c19(_0x3eefb9[_0xecff('0x15')]['message']);}})['catch'](function(_0x24abef){logger[_0xecff('0x12')]('Campaign,\x20%s,\x20%s',_0x38a8f6,_0x24abef);_0x1f7386(_0x24abef);});});}exports[_0xecff('0x16')]=function(_0x3adc81){var _0x319ba5=this;return new Promise(function(_0x2393db,_0x2fc1f9){return db[_0xecff('0x17')]['findAll']({'raw':_0x3adc81[_0xecff('0x18')]?_0x3adc81[_0xecff('0x18')][_0xecff('0x19')]===undefined?!![]:![]:!![],'where':_0x3adc81[_0xecff('0x18')]?_0x3adc81['options'][_0xecff('0x1a')]||null:null,'attributes':_0x3adc81[_0xecff('0x18')]?_0x3adc81[_0xecff('0x18')][_0xecff('0x1b')]||null:null,'limit':_0x3adc81[_0xecff('0x18')]?_0x3adc81[_0xecff('0x18')]['limit']||null:null,'include':_0x3adc81[_0xecff('0x18')]?_0x3adc81['options']['include']?_[_0xecff('0x1c')](_0x3adc81['options'][_0xecff('0x1d')],function(_0x49c0cd){return{'model':db[_0x49c0cd[_0xecff('0x1e')]],'as':_0x49c0cd['as'],'attributes':_0x49c0cd['attributes'],'include':_0x49c0cd[_0xecff('0x1d')]?_[_0xecff('0x1c')](_0x49c0cd['include'],function(_0x9f173d){return{'model':db[_0x9f173d[_0xecff('0x1e')]],'as':_0x9f173d['as'],'attributes':_0x9f173d[_0xecff('0x1b')],'include':_0x9f173d[_0xecff('0x1d')]?_[_0xecff('0x1c')](_0x9f173d['include'],function(_0x4f987b){return{'model':db[_0x4f987b[_0xecff('0x1e')]],'as':_0x4f987b['as'],'attributes':_0x4f987b['attributes']};}):[]};}):[]};}):[]:[]})[_0xecff('0xc')](function(_0x3ef198){logger[_0xecff('0xd')](_0xecff('0x16'),_0x3adc81);logger['debug']('GetCampaign',_0x3adc81,JSON['stringify'](_0x3ef198));_0x2393db(_0x3ef198);})[_0xecff('0x1f')](function(_0xabe5da){logger[_0xecff('0x12')](_0xecff('0x16'),_0xabe5da['message'],_0x3adc81);_0x2fc1f9(_0x319ba5[_0xecff('0x12')](0x1f4,_0xabe5da[_0xecff('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 3972e6e..66a2f03 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 _0x0ca4=['put','update','delete','destroy','removeLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getLists','/:id/blacklists','getBlackLists','create','clone','post','/:id/lists','addLists','addBlackLists'];(function(_0x6237a0,_0x2b681b){var _0x37c8da=function(_0x47eba1){while(--_0x47eba1){_0x6237a0['push'](_0x6237a0['shift']());}};_0x37c8da(++_0x2b681b);}(_0x0ca4,0x15a));var _0x40ca=function(_0x16da80,_0x43672e){_0x16da80=_0x16da80-0x0;var _0x180dbf=_0x0ca4[_0x16da80];return _0x180dbf;};'use strict';var multer=require(_0x40ca('0x0'));var util=require('util');var path=require(_0x40ca('0x1'));var timeout=require(_0x40ca('0x2'));var express=require(_0x40ca('0x3'));var router=express[_0x40ca('0x4')]();var fs_extra=require(_0x40ca('0x5'));var auth=require(_0x40ca('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x40ca('0x7'));var controller=require(_0x40ca('0x8'));router[_0x40ca('0x9')]('/',auth[_0x40ca('0xa')](),controller[_0x40ca('0xb')]);router[_0x40ca('0x9')](_0x40ca('0xc'),auth[_0x40ca('0xa')](),controller[_0x40ca('0xd')]);router[_0x40ca('0x9')](_0x40ca('0xe'),auth['isAuthenticated'](),controller[_0x40ca('0xf')]);router[_0x40ca('0x9')]('/:id/hopper_histories',auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x40ca('0x9')](_0x40ca('0x10'),auth[_0x40ca('0xa')](),controller[_0x40ca('0x11')]);router[_0x40ca('0x9')](_0x40ca('0x12'),auth[_0x40ca('0xa')](),controller['getHopperBlacks']);router[_0x40ca('0x9')]('/:id/lists',auth['isAuthenticated'](),controller[_0x40ca('0x13')]);router[_0x40ca('0x9')](_0x40ca('0x14'),auth['isAuthenticated'](),controller[_0x40ca('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0x40ca('0x16')]);router['post']('/:id/clone',auth[_0x40ca('0xa')](),controller[_0x40ca('0x17')]);router[_0x40ca('0x18')](_0x40ca('0x19'),auth[_0x40ca('0xa')](),controller[_0x40ca('0x1a')]);router['post'](_0x40ca('0x14'),auth['isAuthenticated'](),controller[_0x40ca('0x1b')]);router[_0x40ca('0x1c')](_0x40ca('0xc'),auth[_0x40ca('0xa')](),controller[_0x40ca('0x1d')]);router[_0x40ca('0x1e')]('/:id',auth[_0x40ca('0xa')](),controller[_0x40ca('0x1f')]);router[_0x40ca('0x1e')](_0x40ca('0x19'),auth[_0x40ca('0xa')](),controller[_0x40ca('0x20')]);router[_0x40ca('0x1e')](_0x40ca('0x14'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x40ca('0x21')]=router;
\ No newline at end of file
+var _0xab09=['post','create','/:id/clone','clone','update','delete','/:id','destroy','removeLists','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','getHoppers','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists'];(function(_0x54c1db,_0x54ec32){var _0x1fa4c0=function(_0x2e1966){while(--_0x2e1966){_0x54c1db['push'](_0x54c1db['shift']());}};_0x1fa4c0(++_0x54ec32);}(_0xab09,0x6a));var _0x9ab0=function(_0x41010e,_0x25e9c5){_0x41010e=_0x41010e-0x0;var _0x59e342=_0xab09[_0x41010e];return _0x59e342;};'use strict';var multer=require('multer');var util=require(_0x9ab0('0x0'));var path=require(_0x9ab0('0x1'));var timeout=require(_0x9ab0('0x2'));var express=require(_0x9ab0('0x3'));var router=express[_0x9ab0('0x4')]();var fs_extra=require(_0x9ab0('0x5'));var auth=require(_0x9ab0('0x6'));var interaction=require(_0x9ab0('0x7'));var config=require(_0x9ab0('0x8'));var controller=require(_0x9ab0('0x9'));router[_0x9ab0('0xa')]('/',auth[_0x9ab0('0xb')](),controller[_0x9ab0('0xc')]);router[_0x9ab0('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x9ab0('0xa')]('/:id/hoppers',auth[_0x9ab0('0xb')](),controller[_0x9ab0('0xd')]);router[_0x9ab0('0xa')]('/:id/hopper_histories',auth[_0x9ab0('0xb')](),controller[_0x9ab0('0xe')]);router[_0x9ab0('0xa')](_0x9ab0('0xf'),auth[_0x9ab0('0xb')](),controller['getHopperFinals']);router[_0x9ab0('0xa')](_0x9ab0('0x10'),auth[_0x9ab0('0xb')](),controller[_0x9ab0('0x11')]);router[_0x9ab0('0xa')](_0x9ab0('0x12'),auth['isAuthenticated'](),controller[_0x9ab0('0x13')]);router[_0x9ab0('0xa')](_0x9ab0('0x14'),auth[_0x9ab0('0xb')](),controller[_0x9ab0('0x15')]);router[_0x9ab0('0x16')]('/',auth['isAuthenticated'](),controller[_0x9ab0('0x17')]);router['post'](_0x9ab0('0x18'),auth['isAuthenticated'](),controller[_0x9ab0('0x19')]);router[_0x9ab0('0x16')](_0x9ab0('0x12'),auth[_0x9ab0('0xb')](),controller['addLists']);router[_0x9ab0('0x16')](_0x9ab0('0x14'),auth[_0x9ab0('0xb')](),controller['addBlackLists']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9ab0('0x1a')]);router[_0x9ab0('0x1b')](_0x9ab0('0x1c'),auth['isAuthenticated'](),controller[_0x9ab0('0x1d')]);router[_0x9ab0('0x1b')](_0x9ab0('0x12'),auth[_0x9ab0('0xb')](),controller[_0x9ab0('0x1e')]);router[_0x9ab0('0x1b')](_0x9ab0('0x14'),auth[_0x9ab0('0xb')](),controller['removeBlackLists']);module[_0x9ab0('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index b53f60b..47a89d6 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 _0xd0d1=['sequelize','STRING','VIRTUAL','getDataValue'];(function(_0x1643cb,_0x8af3cc){var _0x2d1147=function(_0x556e53){while(--_0x556e53){_0x1643cb['push'](_0x1643cb['shift']());}};_0x2d1147(++_0x8af3cc);}(_0xd0d1,0x16c));var _0x1d0d=function(_0xaf7008,_0x5c3cf2){_0xaf7008=_0xaf7008-0x0;var _0x1196bc=_0xd0d1[_0xaf7008];return _0x1196bc;};'use strict';var Sequelize=require(_0x1d0d('0x0'));module['exports']={'key':{'type':Sequelize[_0x1d0d('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x1d0d('0x1')]},'name':{'type':Sequelize[_0x1d0d('0x2')],'get':function(){return this[_0x1d0d('0x3')]('key');}}};
\ No newline at end of file
+var _0x779b=['key','sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x40c402,_0x42ee7d){var _0x4e7680=function(_0x52b150){while(--_0x52b150){_0x40c402['push'](_0x40c402['shift']());}};_0x4e7680(++_0x42ee7d);}(_0x779b,0x1e4));var _0xb779=function(_0x1901f3,_0x49a7da){_0x1901f3=_0x1901f3-0x0;var _0x1d720d=_0x779b[_0x1901f3];return _0x1d720d;};'use strict';var Sequelize=require(_0xb779('0x0'));module[_0xb779('0x1')]={'key':{'type':Sequelize[_0xb779('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xb779('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xb779('0x2')]},'name':{'type':Sequelize[_0xb779('0x4')],'get':function(){return this[_0xb779('0x5')](_0xb779('0x6'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 1341021..f356006 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 _0x94ff=['stack','name','send','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','length','includeAll','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','update','destroy','then','CannedAnswers','UserProfileResource','end','error'];(function(_0x421376,_0x1b449d){var _0x396d60=function(_0x4c4876){while(--_0x4c4876){_0x421376['push'](_0x421376['shift']());}};_0x396d60(++_0x1b449d);}(_0x94ff,0x186));var _0xf94f=function(_0x15dc77,_0x54d8b8){_0x15dc77=_0x15dc77-0x0;var _0x5e592e=_0x94ff[_0x15dc77];return _0x5e592e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf94f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf94f('0x1'));var moment=require('moment');var BPromise=require(_0xf94f('0x2'));var Mustache=require(_0xf94f('0x3'));var util=require('util');var path=require(_0xf94f('0x4'));var sox=require(_0xf94f('0x5'));var csv=require('to-csv');var ejs=require(_0xf94f('0x6'));var fs=require('fs');var fs_extra=require(_0xf94f('0x7'));var _=require(_0xf94f('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf94f('0x9'));var toCsv=require('to-csv');var querystring=require(_0xf94f('0xa'));var Papa=require(_0xf94f('0xb'));var Redis=require(_0xf94f('0xc'));var authService=require(_0xf94f('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf94f('0xe'))(_0xf94f('0xf'));var utils=require('../../config/utils');var config=require(_0xf94f('0x10'));var licenseUtil=require(_0xf94f('0x11'));var db=require(_0xf94f('0x12'))['db'];function respondWithStatusCode(_0x4c6701,_0x25fc83){_0x25fc83=_0x25fc83||0xcc;return function(_0x16a04e){if(_0x16a04e){return _0x4c6701[_0xf94f('0x13')](_0x25fc83);}return _0x4c6701[_0xf94f('0x14')](_0x25fc83)['end']();};}function respondWithResult(_0x33127e,_0x147d9d){_0x147d9d=_0x147d9d||0xc8;return function(_0x3a8578){if(_0x3a8578){return _0x33127e['status'](_0x147d9d)[_0xf94f('0x15')](_0x3a8578);}};}function respondWithFilteredResult(_0x408815,_0x47070c){return function(_0x5a5d2a){if(_0x5a5d2a){var _0x22c5f5=typeof _0x47070c[_0xf94f('0x16')]===_0xf94f('0x17')&&typeof _0x47070c['limit']===_0xf94f('0x17');var _0x350b17=_0x5a5d2a[_0xf94f('0x18')];var _0x4a8c7b=_0x22c5f5?0x0:_0x47070c[_0xf94f('0x16')];var _0x1747c3=_0x22c5f5?_0x5a5d2a[_0xf94f('0x18')]:_0x47070c[_0xf94f('0x16')]+_0x47070c['limit'];var _0x13145f;if(_0x1747c3>=_0x350b17){_0x1747c3=_0x350b17;_0x13145f=0xc8;}else{_0x13145f=0xce;}_0x408815[_0xf94f('0x14')](_0x13145f);return _0x408815[_0xf94f('0x19')](_0xf94f('0x1a'),_0x4a8c7b+'-'+_0x1747c3+'/'+_0x350b17)[_0xf94f('0x15')](_0x5a5d2a);}return null;};}function patchUpdates(_0x5de797){return function(_0x3acd16){try{jsonpatch['apply'](_0x3acd16,_0x5de797,!![]);}catch(_0x2b65b4){return BPromise[_0xf94f('0x1b')](_0x2b65b4);}return _0x3acd16['save']();};}function saveUpdates(_0x5a6627,_0x3bd161){return function(_0x5e280f){if(_0x5e280f){return _0x5e280f[_0xf94f('0x1c')](_0x5a6627)['then'](function(_0x2f7b5a){return _0x2f7b5a;});}return null;};}function removeEntity(_0x35311b,_0x3c64bc){return function(_0x4f397c){if(_0x4f397c){return _0x4f397c[_0xf94f('0x1d')]()[_0xf94f('0x1e')](function(){var _0x2728de=_0x4f397c['get']({'plain':!![]});var _0x30dcf3=_0xf94f('0x1f');return db[_0xf94f('0x20')]['destroy']({'where':{'type':_0x30dcf3,'resourceId':_0x2728de['id']}})[_0xf94f('0x1e')](function(){return _0x4f397c;});})[_0xf94f('0x1e')](function(){_0x35311b[_0xf94f('0x14')](0xcc)[_0xf94f('0x21')]();});}};}function handleEntityNotFound(_0x17b420,_0x360e4c){return function(_0x4a6d28){if(!_0x4a6d28){_0x17b420[_0xf94f('0x13')](0x194);}return _0x4a6d28;};}function handleError(_0x31a09b,_0xa7f381){_0xa7f381=_0xa7f381||0x1f4;return function(_0xd5d97e){logger[_0xf94f('0x22')](_0xd5d97e[_0xf94f('0x23')]);if(_0xd5d97e[_0xf94f('0x24')]){delete _0xd5d97e[_0xf94f('0x24')];}_0x31a09b[_0xf94f('0x14')](_0xa7f381)[_0xf94f('0x25')](_0xd5d97e);};}exports['index']=function(_0x41dd6d,_0x12aa56){var _0x2e3846={},_0x1e7394={},_0x7b5bd0={'count':0x0,'rows':[]};var _0x176023=_[_0xf94f('0x26')](db[_0xf94f('0x27')][_0xf94f('0x28')],function(_0x375c17){return{'name':_0x375c17[_0xf94f('0x29')],'type':_0x375c17[_0xf94f('0x2a')][_0xf94f('0x2b')]};});_0x1e7394[_0xf94f('0x2c')]=_['map'](_0x176023,_0xf94f('0x24'));_0x1e7394[_0xf94f('0x2d')]=_[_0xf94f('0x2e')](_0x41dd6d['query']);_0x1e7394[_0xf94f('0x2f')]=_['intersection'](_0x1e7394[_0xf94f('0x2c')],_0x1e7394[_0xf94f('0x2d')]);_0x2e3846[_0xf94f('0x30')]=_[_0xf94f('0x31')](_0x1e7394['model'],qs[_0xf94f('0x32')](_0x41dd6d[_0xf94f('0x2d')][_0xf94f('0x32')]));_0x2e3846['attributes']=_0x2e3846[_0xf94f('0x30')]['length']?_0x2e3846[_0xf94f('0x30')]:_0x1e7394[_0xf94f('0x2c')];if(!_0x41dd6d['query'][_0xf94f('0x33')](_0xf94f('0x34'))){_0x2e3846[_0xf94f('0x35')]=qs['limit'](_0x41dd6d[_0xf94f('0x2d')][_0xf94f('0x35')]);_0x2e3846[_0xf94f('0x16')]=qs[_0xf94f('0x16')](_0x41dd6d[_0xf94f('0x2d')][_0xf94f('0x16')]);}_0x2e3846['order']=qs['sort'](_0x41dd6d[_0xf94f('0x2d')][_0xf94f('0x36')]);_0x2e3846[_0xf94f('0x37')]=qs['filters'](_[_0xf94f('0x38')](_0x41dd6d[_0xf94f('0x2d')],_0x1e7394[_0xf94f('0x2f')]),_0x176023);if(_0x41dd6d[_0xf94f('0x2d')][_0xf94f('0x39')]){_0x2e3846[_0xf94f('0x37')]=_[_0xf94f('0x3a')](_0x2e3846[_0xf94f('0x37')],{'$or':[{'key':{'$like':'%'+_0x41dd6d[_0xf94f('0x2d')][_0xf94f('0x39')]+'%'}},{'value':{'$like':'%'+_0x41dd6d[_0xf94f('0x2d')][_0xf94f('0x39')]+'%'}}]});}_0x2e3846=_[_0xf94f('0x3a')]({},_0x2e3846,_0x41dd6d[_0xf94f('0x3b')]);var _0x2f444e={'where':_0x2e3846[_0xf94f('0x37')]};return db['CannedAnswer'][_0xf94f('0x18')](_0x2f444e)[_0xf94f('0x1e')](function(_0x1d752f){_0x7b5bd0['count']=_0x1d752f;if(_0x41dd6d[_0xf94f('0x2d')]['includeAll']){_0x2e3846[_0xf94f('0x3c')]=[{'all':!![]}];}return db[_0xf94f('0x27')][_0xf94f('0x3d')](_0x2e3846);})[_0xf94f('0x1e')](function(_0x4adc99){_0x7b5bd0[_0xf94f('0x3e')]=_0x4adc99;return _0x7b5bd0;})[_0xf94f('0x1e')](respondWithFilteredResult(_0x12aa56,_0x2e3846))[_0xf94f('0x3f')](handleError(_0x12aa56,null));};exports[_0xf94f('0x40')]=function(_0x2b4045,_0x365bc7){var _0x1db51c={'raw':!![],'where':{'id':_0x2b4045[_0xf94f('0x41')]['id']}},_0x4356ac={};_0x4356ac[_0xf94f('0x2c')]=_[_0xf94f('0x2e')](db[_0xf94f('0x27')]['rawAttributes']);_0x4356ac['query']=_[_0xf94f('0x2e')](_0x2b4045[_0xf94f('0x2d')]);_0x4356ac[_0xf94f('0x2f')]=_[_0xf94f('0x31')](_0x4356ac[_0xf94f('0x2c')],_0x4356ac[_0xf94f('0x2d')]);_0x1db51c['attributes']=_[_0xf94f('0x31')](_0x4356ac[_0xf94f('0x2c')],qs[_0xf94f('0x32')](_0x2b4045[_0xf94f('0x2d')][_0xf94f('0x32')]));_0x1db51c[_0xf94f('0x30')]=_0x1db51c['attributes'][_0xf94f('0x42')]?_0x1db51c['attributes']:_0x4356ac['model'];if(_0x2b4045[_0xf94f('0x2d')][_0xf94f('0x43')]){_0x1db51c[_0xf94f('0x3c')]=[{'all':!![]}];}_0x1db51c=_[_0xf94f('0x3a')]({},_0x1db51c,_0x2b4045['options']);return db[_0xf94f('0x27')][_0xf94f('0x44')](_0x1db51c)['then'](handleEntityNotFound(_0x365bc7,null))[_0xf94f('0x1e')](respondWithResult(_0x365bc7,null))['catch'](handleError(_0x365bc7,null));};exports['update']=function(_0xad7f72,_0x1e9d21){if(_0xad7f72[_0xf94f('0x45')]['id']){delete _0xad7f72[_0xf94f('0x45')]['id'];}return db[_0xf94f('0x27')][_0xf94f('0x44')]({'where':{'id':_0xad7f72[_0xf94f('0x41')]['id']}})[_0xf94f('0x1e')](handleEntityNotFound(_0x1e9d21,null))[_0xf94f('0x1e')](saveUpdates(_0xad7f72[_0xf94f('0x45')],null))[_0xf94f('0x1e')](respondWithResult(_0x1e9d21,null))[_0xf94f('0x3f')](handleError(_0x1e9d21,null));};exports[_0xf94f('0x1d')]=function(_0x2c1b68,_0x573317){return db['CannedAnswer'][_0xf94f('0x44')]({'where':{'id':_0x2c1b68[_0xf94f('0x41')]['id']}})[_0xf94f('0x1e')](handleEntityNotFound(_0x573317,null))[_0xf94f('0x1e')](removeEntity(_0x573317,null))[_0xf94f('0x3f')](handleError(_0x573317,null));};exports[_0xf94f('0x46')]=function(_0x14dafe,_0x60a43){var _0x1bb64b={'key':_0x14dafe[_0xf94f('0x45')][_0xf94f('0x2b')]};if(_0x14dafe['body'][_0xf94f('0x47')]){_0x1bb64b[_0xf94f('0x47')]=_0x14dafe[_0xf94f('0x45')][_0xf94f('0x47')];}else if(_0x14dafe[_0xf94f('0x45')][_0xf94f('0x48')]){_0x1bb64b['SmsAccountId']=_0x14dafe[_0xf94f('0x45')][_0xf94f('0x48')];}else if(_0x14dafe[_0xf94f('0x45')][_0xf94f('0x49')]){_0x1bb64b['OpenchannelAccountId']=_0x14dafe['body'][_0xf94f('0x49')];}else if(_0x14dafe[_0xf94f('0x45')][_0xf94f('0x4a')]){_0x1bb64b[_0xf94f('0x4a')]=_0x14dafe[_0xf94f('0x45')]['ChatWebsiteId'];}return db[_0xf94f('0x27')]['find']({'where':_0x1bb64b})[_0xf94f('0x1e')](function(_0x39f303){if(_0x39f303){throw new db[(_0xf94f('0x4b'))][(_0xf94f('0x4c'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xf94f('0x27')][_0xf94f('0x46')](_0x14dafe[_0xf94f('0x45')]);})[_0xf94f('0x1e')](function(_0x3c7b19){var _0x203ef6=_0x14dafe[_0xf94f('0x4d')][_0xf94f('0x4e')]({'plain':!![]});if(!_0x203ef6)throw new Error(_0xf94f('0x4f'));if(_0x203ef6[_0xf94f('0x50')]===_0xf94f('0x4d')){var _0x4297d3=_0x3c7b19[_0xf94f('0x4e')]({'plain':!![]});return db[_0xf94f('0x51')]['find']({'where':{'name':_0xf94f('0x1f'),'userProfileId':_0x203ef6[_0xf94f('0x52')]},'raw':!![]})[_0xf94f('0x1e')](function(_0x1e7052){if(_0x1e7052&&_0x1e7052[_0xf94f('0x53')]===0x0){return db[_0xf94f('0x20')]['create']({'name':_0x4297d3[_0xf94f('0x24')],'resourceId':_0x4297d3['id'],'type':_0x1e7052[_0xf94f('0x24')],'sectionId':_0x1e7052['id']},{})[_0xf94f('0x1e')](function(){return _0x3c7b19;});}else{return _0x3c7b19;}})[_0xf94f('0x3f')](function(_0x1d39a2){logger['error'](_0xf94f('0x54'),_0x1d39a2);throw _0x1d39a2;});}return _0x3c7b19;})['then'](respondWithResult(_0x60a43,0xc9))['catch'](handleError(_0x60a43,null));};
\ No newline at end of file
+var _0xed76=['fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','include','catch','params','rawAttributes','includeAll','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','name','send','map','CannedAnswer','fieldName','type','model','query','keys','filters','intersection','attributes'];(function(_0x3152dc,_0x2a4311){var _0x5c5d91=function(_0x254e00){while(--_0x254e00){_0x3152dc['push'](_0x3152dc['shift']());}};_0x5c5d91(++_0x2a4311);}(_0xed76,0x1d0));var _0x6ed7=function(_0x407a30,_0x30acd6){_0x407a30=_0x407a30-0x0;var _0x2ceed1=_0xed76[_0x407a30];return _0x2ceed1;};'use strict';var emlformat=require(_0x6ed7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6ed7('0x1'));var jsonpatch=require(_0x6ed7('0x2'));var rp=require(_0x6ed7('0x3'));var moment=require('moment');var BPromise=require(_0x6ed7('0x4'));var Mustache=require(_0x6ed7('0x5'));var util=require(_0x6ed7('0x6'));var path=require(_0x6ed7('0x7'));var sox=require(_0x6ed7('0x8'));var csv=require(_0x6ed7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6ed7('0xa'));var _=require(_0x6ed7('0xb'));var squel=require('squel');var crypto=require(_0x6ed7('0xc'));var jsforce=require(_0x6ed7('0xd'));var deskjs=require(_0x6ed7('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6ed7('0xf'));var Papa=require(_0x6ed7('0x10'));var Redis=require(_0x6ed7('0x11'));var authService=require(_0x6ed7('0x12'));var qs=require(_0x6ed7('0x13'));var as=require(_0x6ed7('0x14'));var hardwareService=require(_0x6ed7('0x15'));var logger=require(_0x6ed7('0x16'))(_0x6ed7('0x17'));var utils=require(_0x6ed7('0x18'));var config=require(_0x6ed7('0x19'));var licenseUtil=require(_0x6ed7('0x1a'));var db=require(_0x6ed7('0x1b'))['db'];function respondWithStatusCode(_0x438216,_0x573c25){_0x573c25=_0x573c25||0xcc;return function(_0x26de76){if(_0x26de76){return _0x438216[_0x6ed7('0x1c')](_0x573c25);}return _0x438216[_0x6ed7('0x1d')](_0x573c25)[_0x6ed7('0x1e')]();};}function respondWithResult(_0x7e4558,_0x37e68b){_0x37e68b=_0x37e68b||0xc8;return function(_0x5e385c){if(_0x5e385c){return _0x7e4558[_0x6ed7('0x1d')](_0x37e68b)[_0x6ed7('0x1f')](_0x5e385c);}};}function respondWithFilteredResult(_0x3649a5,_0x80d721){return function(_0x2c5a1d){if(_0x2c5a1d){var _0x33babb=typeof _0x80d721[_0x6ed7('0x20')]===_0x6ed7('0x21')&&typeof _0x80d721[_0x6ed7('0x22')]===_0x6ed7('0x21');var _0x341ef1=_0x2c5a1d[_0x6ed7('0x23')];var _0x51966f=_0x33babb?0x0:_0x80d721['offset'];var _0x4b4b19=_0x33babb?_0x2c5a1d[_0x6ed7('0x23')]:_0x80d721[_0x6ed7('0x20')]+_0x80d721[_0x6ed7('0x22')];var _0x41dfde;if(_0x4b4b19>=_0x341ef1){_0x4b4b19=_0x341ef1;_0x41dfde=0xc8;}else{_0x41dfde=0xce;}_0x3649a5[_0x6ed7('0x1d')](_0x41dfde);return _0x3649a5[_0x6ed7('0x24')](_0x6ed7('0x25'),_0x51966f+'-'+_0x4b4b19+'/'+_0x341ef1)[_0x6ed7('0x1f')](_0x2c5a1d);}return null;};}function patchUpdates(_0x510ec3){return function(_0x5df341){try{jsonpatch[_0x6ed7('0x26')](_0x5df341,_0x510ec3,!![]);}catch(_0x36f421){return BPromise['reject'](_0x36f421);}return _0x5df341[_0x6ed7('0x27')]();};}function saveUpdates(_0x20623b,_0x214187){return function(_0x21ef5d){if(_0x21ef5d){return _0x21ef5d[_0x6ed7('0x28')](_0x20623b)[_0x6ed7('0x29')](function(_0x32d19b){return _0x32d19b;});}return null;};}function removeEntity(_0x3e5e00,_0x50e132){return function(_0x56cf33){if(_0x56cf33){return _0x56cf33[_0x6ed7('0x2a')]()[_0x6ed7('0x29')](function(){var _0x1de297=_0x56cf33[_0x6ed7('0x2b')]({'plain':!![]});var _0x4633e0=_0x6ed7('0x2c');return db[_0x6ed7('0x2d')][_0x6ed7('0x2a')]({'where':{'type':_0x4633e0,'resourceId':_0x1de297['id']}})[_0x6ed7('0x29')](function(){return _0x56cf33;});})[_0x6ed7('0x29')](function(){_0x3e5e00['status'](0xcc)[_0x6ed7('0x1e')]();});}};}function handleEntityNotFound(_0x475d3d,_0xae005){return function(_0x58c024){if(!_0x58c024){_0x475d3d[_0x6ed7('0x1c')](0x194);}return _0x58c024;};}function handleError(_0x4a014a,_0xda18ba){_0xda18ba=_0xda18ba||0x1f4;return function(_0x4f766f){logger['error'](_0x4f766f['stack']);if(_0x4f766f[_0x6ed7('0x2e')]){delete _0x4f766f['name'];}_0x4a014a['status'](_0xda18ba)[_0x6ed7('0x2f')](_0x4f766f);};}exports['index']=function(_0x1abece,_0x1e3dd8){var _0x3d2616={},_0x24c5fc={},_0x2f4380={'count':0x0,'rows':[]};var _0x43230b=_[_0x6ed7('0x30')](db[_0x6ed7('0x31')]['rawAttributes'],function(_0x210c9d){return{'name':_0x210c9d[_0x6ed7('0x32')],'type':_0x210c9d[_0x6ed7('0x33')]['key']};});_0x24c5fc[_0x6ed7('0x34')]=_['map'](_0x43230b,_0x6ed7('0x2e'));_0x24c5fc[_0x6ed7('0x35')]=_[_0x6ed7('0x36')](_0x1abece['query']);_0x24c5fc[_0x6ed7('0x37')]=_[_0x6ed7('0x38')](_0x24c5fc['model'],_0x24c5fc[_0x6ed7('0x35')]);_0x3d2616[_0x6ed7('0x39')]=_[_0x6ed7('0x38')](_0x24c5fc[_0x6ed7('0x34')],qs[_0x6ed7('0x3a')](_0x1abece[_0x6ed7('0x35')]['fields']));_0x3d2616[_0x6ed7('0x39')]=_0x3d2616['attributes'][_0x6ed7('0x3b')]?_0x3d2616[_0x6ed7('0x39')]:_0x24c5fc[_0x6ed7('0x34')];if(!_0x1abece['query'][_0x6ed7('0x3c')](_0x6ed7('0x3d'))){_0x3d2616[_0x6ed7('0x22')]=qs['limit'](_0x1abece[_0x6ed7('0x35')][_0x6ed7('0x22')]);_0x3d2616[_0x6ed7('0x20')]=qs[_0x6ed7('0x20')](_0x1abece['query'][_0x6ed7('0x20')]);}_0x3d2616[_0x6ed7('0x3e')]=qs[_0x6ed7('0x3f')](_0x1abece[_0x6ed7('0x35')][_0x6ed7('0x3f')]);_0x3d2616['where']=qs['filters'](_[_0x6ed7('0x40')](_0x1abece[_0x6ed7('0x35')],_0x24c5fc[_0x6ed7('0x37')]),_0x43230b);if(_0x1abece[_0x6ed7('0x35')][_0x6ed7('0x41')]){_0x3d2616['where']=_[_0x6ed7('0x42')](_0x3d2616[_0x6ed7('0x43')],{'$or':[{'key':{'$like':'%'+_0x1abece[_0x6ed7('0x35')][_0x6ed7('0x41')]+'%'}},{'value':{'$like':'%'+_0x1abece[_0x6ed7('0x35')][_0x6ed7('0x41')]+'%'}}]});}_0x3d2616=_[_0x6ed7('0x42')]({},_0x3d2616,_0x1abece[_0x6ed7('0x44')]);var _0x54fd42={'where':_0x3d2616[_0x6ed7('0x43')]};return db[_0x6ed7('0x31')][_0x6ed7('0x23')](_0x54fd42)[_0x6ed7('0x29')](function(_0x3c0af5){_0x2f4380[_0x6ed7('0x23')]=_0x3c0af5;if(_0x1abece[_0x6ed7('0x35')]['includeAll']){_0x3d2616[_0x6ed7('0x45')]=[{'all':!![]}];}return db[_0x6ed7('0x31')]['findAll'](_0x3d2616);})['then'](function(_0x3b7e79){_0x2f4380['rows']=_0x3b7e79;return _0x2f4380;})['then'](respondWithFilteredResult(_0x1e3dd8,_0x3d2616))[_0x6ed7('0x46')](handleError(_0x1e3dd8,null));};exports['show']=function(_0x5bf4ad,_0x2d8002){var _0x3520b0={'raw':!![],'where':{'id':_0x5bf4ad[_0x6ed7('0x47')]['id']}},_0x558323={};_0x558323[_0x6ed7('0x34')]=_[_0x6ed7('0x36')](db['CannedAnswer'][_0x6ed7('0x48')]);_0x558323[_0x6ed7('0x35')]=_[_0x6ed7('0x36')](_0x5bf4ad[_0x6ed7('0x35')]);_0x558323['filters']=_[_0x6ed7('0x38')](_0x558323['model'],_0x558323['query']);_0x3520b0[_0x6ed7('0x39')]=_[_0x6ed7('0x38')](_0x558323[_0x6ed7('0x34')],qs[_0x6ed7('0x3a')](_0x5bf4ad[_0x6ed7('0x35')][_0x6ed7('0x3a')]));_0x3520b0[_0x6ed7('0x39')]=_0x3520b0[_0x6ed7('0x39')][_0x6ed7('0x3b')]?_0x3520b0['attributes']:_0x558323['model'];if(_0x5bf4ad['query'][_0x6ed7('0x49')]){_0x3520b0[_0x6ed7('0x45')]=[{'all':!![]}];}_0x3520b0=_[_0x6ed7('0x42')]({},_0x3520b0,_0x5bf4ad[_0x6ed7('0x44')]);return db[_0x6ed7('0x31')]['find'](_0x3520b0)['then'](handleEntityNotFound(_0x2d8002,null))[_0x6ed7('0x29')](respondWithResult(_0x2d8002,null))['catch'](handleError(_0x2d8002,null));};exports['update']=function(_0x3caba9,_0x5920b4){if(_0x3caba9['body']['id']){delete _0x3caba9[_0x6ed7('0x4a')]['id'];}return db[_0x6ed7('0x31')]['find']({'where':{'id':_0x3caba9[_0x6ed7('0x47')]['id']}})[_0x6ed7('0x29')](handleEntityNotFound(_0x5920b4,null))[_0x6ed7('0x29')](saveUpdates(_0x3caba9[_0x6ed7('0x4a')],null))[_0x6ed7('0x29')](respondWithResult(_0x5920b4,null))[_0x6ed7('0x46')](handleError(_0x5920b4,null));};exports['destroy']=function(_0x970a0a,_0x51f4e8){return db[_0x6ed7('0x31')][_0x6ed7('0x4b')]({'where':{'id':_0x970a0a[_0x6ed7('0x47')]['id']}})[_0x6ed7('0x29')](handleEntityNotFound(_0x51f4e8,null))[_0x6ed7('0x29')](removeEntity(_0x51f4e8,null))[_0x6ed7('0x46')](handleError(_0x51f4e8,null));};exports[_0x6ed7('0x4c')]=function(_0x334b15,_0x202a14){var _0x7a5e5b={'key':_0x334b15['body']['key']};if(_0x334b15['body'][_0x6ed7('0x4d')]){_0x7a5e5b[_0x6ed7('0x4d')]=_0x334b15[_0x6ed7('0x4a')][_0x6ed7('0x4d')];}else if(_0x334b15[_0x6ed7('0x4a')][_0x6ed7('0x4e')]){_0x7a5e5b[_0x6ed7('0x4e')]=_0x334b15[_0x6ed7('0x4a')][_0x6ed7('0x4e')];}else if(_0x334b15[_0x6ed7('0x4a')][_0x6ed7('0x4f')]){_0x7a5e5b[_0x6ed7('0x4f')]=_0x334b15[_0x6ed7('0x4a')][_0x6ed7('0x4f')];}else if(_0x334b15['body']['ChatWebsiteId']){_0x7a5e5b['ChatWebsiteId']=_0x334b15[_0x6ed7('0x4a')][_0x6ed7('0x50')];}return db[_0x6ed7('0x31')][_0x6ed7('0x4b')]({'where':_0x7a5e5b})[_0x6ed7('0x29')](function(_0x1cd0ce){if(_0x1cd0ce){throw new db[(_0x6ed7('0x51'))]['ValidationError'](_0x6ed7('0x52'));}return db[_0x6ed7('0x31')]['create'](_0x334b15[_0x6ed7('0x4a')]);})[_0x6ed7('0x29')](function(_0x1375fc){var _0x560f1b=_0x334b15['user']['get']({'plain':!![]});if(!_0x560f1b)throw new Error(_0x6ed7('0x53'));if(_0x560f1b['role']===_0x6ed7('0x54')){var _0x31e3bc=_0x1375fc['get']({'plain':!![]});return db[_0x6ed7('0x55')][_0x6ed7('0x4b')]({'where':{'name':'CannedAnswers','userProfileId':_0x560f1b['userProfileId']},'raw':!![]})[_0x6ed7('0x29')](function(_0xbf2d46){if(_0xbf2d46&&_0xbf2d46['autoAssociation']===0x0){return db[_0x6ed7('0x2d')][_0x6ed7('0x4c')]({'name':_0x31e3bc['name'],'resourceId':_0x31e3bc['id'],'type':_0xbf2d46[_0x6ed7('0x2e')],'sectionId':_0xbf2d46['id']},{})[_0x6ed7('0x29')](function(){return _0x1375fc;});}else{return _0x1375fc;}})[_0x6ed7('0x46')](function(_0x5993aa){logger['error'](_0x6ed7('0x56'),_0x5993aa);throw _0x5993aa;});}return _0x1375fc;})['then'](respondWithResult(_0x202a14,0xc9))[_0x6ed7('0x46')](handleError(_0x202a14,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 2ebf64f..922bd82 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 _0x694d=['define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports'];(function(_0x1f4b18,_0x4e777c){var _0xde3957=function(_0x1dcbbc){while(--_0x1dcbbc){_0x1f4b18['push'](_0x1f4b18['shift']());}};_0xde3957(++_0x4e777c);}(_0x694d,0x16c));var _0xd694=function(_0x4565a6,_0x5ada44){_0x4565a6=_0x4565a6-0x0;var _0x2010f8=_0x694d[_0x4565a6];return _0x2010f8;};'use strict';var _=require(_0xd694('0x0'));var util=require(_0xd694('0x1'));var logger=require(_0xd694('0x2'))(_0xd694('0x3'));var moment=require('moment');var BPromise=require(_0xd694('0x4'));var rp=require(_0xd694('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd694('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0xd694('0x7')]=function(_0x3e04f6,_0x8130f){return _0x3e04f6[_0xd694('0x8')](_0xd694('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd694('0xa'),'collate':_0xd694('0xb')});};
\ No newline at end of file
+var _0xa786=['rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1f8e5d,_0x28d764){var _0x1627c9=function(_0x2dcd38){while(--_0x2dcd38){_0x1f8e5d['push'](_0x1f8e5d['shift']());}};_0x1627c9(++_0x28d764);}(_0xa786,0x1f1));var _0x6a78=function(_0x19d637,_0x94577c){_0x19d637=_0x19d637-0x0;var _0x33b625=_0xa786[_0x19d637];return _0x33b625;};'use strict';var _=require(_0x6a78('0x0'));var util=require(_0x6a78('0x1'));var logger=require(_0x6a78('0x2'))(_0x6a78('0x3'));var moment=require(_0x6a78('0x4'));var BPromise=require(_0x6a78('0x5'));var rp=require(_0x6a78('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a78('0x7'));var config=require(_0x6a78('0x8'));var attributes=require(_0x6a78('0x9'));module[_0x6a78('0xa')]=function(_0x5624df,_0x152b20){return _0x5624df[_0x6a78('0xb')](_0x6a78('0xc'),attributes,{'tableName':_0x6a78('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 2a25209..d20d1cb 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(_0x348e63,_0x567959){var _0x17680c=function(_0x9d67c2){while(--_0x9d67c2){_0x348e63['push'](_0x348e63['shift']());}};_0x17680c(++_0x567959);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x2b0547,_0x2251b6){var _0x3d13fd=function(_0x573072){while(--_0x573072){_0x2b0547['push'](_0x2b0547['shift']());}};_0x3d13fd(++_0x2251b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 9e6acdc..38f3a52 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 _0x9fe8=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports'];(function(_0x58cf07,_0x2e3858){var _0x42afe0=function(_0x3c71ff){while(--_0x3c71ff){_0x58cf07['push'](_0x58cf07['shift']());}};_0x42afe0(++_0x2e3858);}(_0x9fe8,0x19e));var _0x89fe=function(_0x130df6,_0x12ad73){_0x130df6=_0x130df6-0x0;var _0x82df5f=_0x9fe8[_0x130df6];return _0x82df5f;};'use strict';var multer=require(_0x89fe('0x0'));var util=require(_0x89fe('0x1'));var path=require(_0x89fe('0x2'));var timeout=require(_0x89fe('0x3'));var express=require('express');var router=express[_0x89fe('0x4')]();var fs_extra=require(_0x89fe('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x89fe('0x6'));var config=require(_0x89fe('0x7'));var controller=require('./cannedAnswer.controller');router[_0x89fe('0x8')]('/',auth[_0x89fe('0x9')](),controller[_0x89fe('0xa')]);router[_0x89fe('0x8')](_0x89fe('0xb'),auth['isAuthenticated'](),controller[_0x89fe('0xc')]);router['post']('/',auth[_0x89fe('0x9')](),controller[_0x89fe('0xd')]);router[_0x89fe('0xe')]('/:id',auth[_0x89fe('0x9')](),controller['update']);router[_0x89fe('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x89fe('0x10')]);module[_0x89fe('0x11')]=router;
\ No newline at end of file
+var _0x4816=['delete','/:id','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','get','show','post','put','update'];(function(_0x1b3564,_0x16c919){var _0x504069=function(_0x9322b6){while(--_0x9322b6){_0x1b3564['push'](_0x1b3564['shift']());}};_0x504069(++_0x16c919);}(_0x4816,0xa5));var _0x6481=function(_0x1580f7,_0xf2b31c){_0x1580f7=_0x1580f7-0x0;var _0x2a5b4f=_0x4816[_0x1580f7];return _0x2a5b4f;};'use strict';var multer=require(_0x6481('0x0'));var util=require('util');var path=require(_0x6481('0x1'));var timeout=require(_0x6481('0x2'));var express=require(_0x6481('0x3'));var router=express[_0x6481('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6481('0x5'));var interaction=require(_0x6481('0x6'));var config=require(_0x6481('0x7'));var controller=require(_0x6481('0x8'));router['get']('/',auth[_0x6481('0x9')](),controller['index']);router[_0x6481('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x6481('0xb')]);router[_0x6481('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6481('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x6481('0xe')]);router[_0x6481('0xf')](_0x6481('0x10'),auth[_0x6481('0x9')](),controller['destroy']);module[_0x6481('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 7051c48..d750cfd 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 _0x5081=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x101134,_0x1ed1d3){var _0xc47acc=function(_0x7ea469){while(--_0x7ea469){_0x101134['push'](_0x101134['shift']());}};_0xc47acc(++_0x1ed1d3);}(_0x5081,0x148));var _0x1508=function(_0x2a287a,_0x3cfd27){_0x2a287a=_0x2a287a-0x0;var _0x57f271=_0x5081[_0x2a287a];return _0x57f271;};'use strict';var Sequelize=require(_0x1508('0x0'));module[_0x1508('0x1')]={'calldate':{'type':Sequelize[_0x1508('0x2')],'allowNull':![],'defaultValue':_0x1508('0x3')},'clid':{'type':Sequelize[_0x1508('0x4')]},'src':{'type':Sequelize[_0x1508('0x4')]},'dst':{'type':Sequelize[_0x1508('0x4')]},'dcontext':{'type':Sequelize[_0x1508('0x4')]},'channel':{'type':Sequelize[_0x1508('0x4')]},'dstchannel':{'type':Sequelize[_0x1508('0x4')]},'lastapp':{'type':Sequelize[_0x1508('0x4')]},'lastdata':{'type':Sequelize[_0x1508('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x1508('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x1508('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x1508('0x4')]},'userfield':{'type':Sequelize[_0x1508('0x4')]},'uniqueid':{'type':Sequelize[_0x1508('0x4')]},'linkedid':{'type':Sequelize[_0x1508('0x4')]},'sequence':{'type':Sequelize[_0x1508('0x4')]},'peeraccount':{'type':Sequelize[_0x1508('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x7d13=['exports','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x6f996a,_0x14cf09){var _0x43a5af=function(_0x1c766f){while(--_0x1c766f){_0x6f996a['push'](_0x6f996a['shift']());}};_0x43a5af(++_0x14cf09);}(_0x7d13,0x6c));var _0x37d1=function(_0x3ee8b1,_0x375088){_0x3ee8b1=_0x3ee8b1-0x0;var _0x53aa77=_0x7d13[_0x3ee8b1];return _0x53aa77;};'use strict';var Sequelize=require('sequelize');module[_0x37d1('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x37d1('0x1')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x37d1('0x2')]},'dst':{'type':Sequelize[_0x37d1('0x2')]},'dcontext':{'type':Sequelize[_0x37d1('0x2')]},'channel':{'type':Sequelize[_0x37d1('0x2')]},'dstchannel':{'type':Sequelize[_0x37d1('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x37d1('0x2')]},'duration':{'type':Sequelize[_0x37d1('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x37d1('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x37d1('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x37d1('0x2')]},'userfield':{'type':Sequelize[_0x37d1('0x2')]},'uniqueid':{'type':Sequelize[_0x37d1('0x2')]},'linkedid':{'type':Sequelize[_0x37d1('0x2')]},'sequence':{'type':Sequelize[_0x37d1('0x2')]},'peeraccount':{'type':Sequelize[_0x37d1('0x2')]},'type':{'type':Sequelize[_0x37d1('0x2')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 07ed04a..221004b 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 _0xa990=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','json','save','update','then','error','stack','name','send','map','Cdr','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','findAll','catch','show','params','include','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware'];(function(_0x206f4b,_0x346117){var _0x20599c=function(_0x2f15b3){while(--_0x2f15b3){_0x206f4b['push'](_0x206f4b['shift']());}};_0x20599c(++_0x346117);}(_0xa990,0xc9));var _0x0a99=function(_0x3f1ca5,_0x4c9c36){_0x3f1ca5=_0x3f1ca5-0x0;var _0x193ab3=_0xa990[_0x3f1ca5];return _0x193ab3;};'use strict';var emlformat=require(_0x0a99('0x0'));var rimraf=require(_0x0a99('0x1'));var zipdir=require(_0x0a99('0x2'));var jsonpatch=require(_0x0a99('0x3'));var rp=require(_0x0a99('0x4'));var moment=require(_0x0a99('0x5'));var BPromise=require(_0x0a99('0x6'));var Mustache=require(_0x0a99('0x7'));var util=require('util');var path=require('path');var sox=require(_0x0a99('0x8'));var csv=require(_0x0a99('0x9'));var ejs=require(_0x0a99('0xa'));var fs=require('fs');var fs_extra=require(_0x0a99('0xb'));var _=require(_0x0a99('0xc'));var squel=require(_0x0a99('0xd'));var crypto=require(_0x0a99('0xe'));var jsforce=require(_0x0a99('0xf'));var deskjs=require(_0x0a99('0x10'));var toCsv=require(_0x0a99('0x9'));var querystring=require(_0x0a99('0x11'));var Papa=require('papaparse');var Redis=require(_0x0a99('0x12'));var authService=require(_0x0a99('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a99('0x14'));var logger=require(_0x0a99('0x15'))(_0x0a99('0x16'));var utils=require(_0x0a99('0x17'));var config=require(_0x0a99('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a99('0x19'))['db'];function respondWithStatusCode(_0x3aaaad,_0x57ab88){_0x57ab88=_0x57ab88||0xcc;return function(_0xb6a34d){if(_0xb6a34d){return _0x3aaaad[_0x0a99('0x1a')](_0x57ab88);}return _0x3aaaad[_0x0a99('0x1b')](_0x57ab88)[_0x0a99('0x1c')]();};}function respondWithResult(_0x346061,_0x23d018){_0x23d018=_0x23d018||0xc8;return function(_0x18c124){if(_0x18c124){return _0x346061[_0x0a99('0x1b')](_0x23d018)['json'](_0x18c124);}};}function respondWithFilteredResult(_0x5a17e1,_0x2c40db){return function(_0x3ac17e){if(_0x3ac17e){var _0xb7356c=typeof _0x2c40db['offset']===_0x0a99('0x1d')&&typeof _0x2c40db['limit']==='undefined';var _0x20104c=_0x3ac17e[_0x0a99('0x1e')];var _0x3de006=_0xb7356c?0x0:_0x2c40db[_0x0a99('0x1f')];var _0x572ce5=_0xb7356c?_0x3ac17e['count']:_0x2c40db[_0x0a99('0x1f')]+_0x2c40db[_0x0a99('0x20')];var _0xbe23f3;if(_0x572ce5>=_0x20104c){_0x572ce5=_0x20104c;_0xbe23f3=0xc8;}else{_0xbe23f3=0xce;}_0x5a17e1[_0x0a99('0x1b')](_0xbe23f3);return _0x5a17e1['set']('Content-Range',_0x3de006+'-'+_0x572ce5+'/'+_0x20104c)[_0x0a99('0x21')](_0x3ac17e);}return null;};}function patchUpdates(_0x4d0c78){return function(_0x1e8d30){try{jsonpatch['apply'](_0x1e8d30,_0x4d0c78,!![]);}catch(_0x191ee4){return BPromise['reject'](_0x191ee4);}return _0x1e8d30[_0x0a99('0x22')]();};}function saveUpdates(_0x356681,_0x3b1d60){return function(_0x1c1e5c){if(_0x1c1e5c){return _0x1c1e5c[_0x0a99('0x23')](_0x356681)[_0x0a99('0x24')](function(_0x19c870){return _0x19c870;});}return null;};}function removeEntity(_0x1d803c,_0x398dd2){return function(_0x5745ca){if(_0x5745ca){return _0x5745ca['destroy']()[_0x0a99('0x24')](function(){_0x1d803c[_0x0a99('0x1b')](0xcc)[_0x0a99('0x1c')]();});}};}function handleEntityNotFound(_0x518617,_0x5d917c){return function(_0x371b31){if(!_0x371b31){_0x518617[_0x0a99('0x1a')](0x194);}return _0x371b31;};}function handleError(_0x1b0e94,_0x40e765){_0x40e765=_0x40e765||0x1f4;return function(_0x10e70f){logger[_0x0a99('0x25')](_0x10e70f[_0x0a99('0x26')]);if(_0x10e70f[_0x0a99('0x27')]){delete _0x10e70f[_0x0a99('0x27')];}_0x1b0e94['status'](_0x40e765)[_0x0a99('0x28')](_0x10e70f);};}exports['index']=function(_0x47bc34,_0x4e597b){var _0x223bdb={},_0x379c7e={},_0x13d26a={'count':0x0,'rows':[]};var _0x26c0c0=_[_0x0a99('0x29')](db[_0x0a99('0x2a')][_0x0a99('0x2b')],function(_0x47da33){return{'name':_0x47da33[_0x0a99('0x2c')],'type':_0x47da33[_0x0a99('0x2d')][_0x0a99('0x2e')]};});_0x379c7e[_0x0a99('0x2f')]=_['map'](_0x26c0c0,'name');_0x379c7e['query']=_[_0x0a99('0x30')](_0x47bc34[_0x0a99('0x31')]);_0x379c7e[_0x0a99('0x32')]=_['intersection'](_0x379c7e[_0x0a99('0x2f')],_0x379c7e[_0x0a99('0x31')]);_0x223bdb[_0x0a99('0x33')]=_[_0x0a99('0x34')](_0x379c7e[_0x0a99('0x2f')],qs[_0x0a99('0x35')](_0x47bc34[_0x0a99('0x31')]['fields']));_0x223bdb[_0x0a99('0x33')]=_0x223bdb[_0x0a99('0x33')][_0x0a99('0x36')]?_0x223bdb[_0x0a99('0x33')]:_0x379c7e[_0x0a99('0x2f')];if(!_0x47bc34['query'][_0x0a99('0x37')]('nolimit')){_0x223bdb['limit']=qs['limit'](_0x47bc34['query'][_0x0a99('0x20')]);_0x223bdb['offset']=qs[_0x0a99('0x1f')](_0x47bc34[_0x0a99('0x31')][_0x0a99('0x1f')]);}_0x223bdb[_0x0a99('0x38')]=qs[_0x0a99('0x39')](_0x47bc34[_0x0a99('0x31')][_0x0a99('0x39')]);_0x223bdb[_0x0a99('0x3a')]=qs[_0x0a99('0x32')](_[_0x0a99('0x3b')](_0x47bc34[_0x0a99('0x31')],_0x379c7e[_0x0a99('0x32')]),_0x26c0c0);if(_0x47bc34[_0x0a99('0x31')]['filter']){_0x223bdb[_0x0a99('0x3a')]=_[_0x0a99('0x3c')](_0x223bdb['where'],{'$or':_[_0x0a99('0x29')](_0x26c0c0,function(_0x549bb9){if(_0x549bb9[_0x0a99('0x2d')]!=='VIRTUAL'){var _0x541178={};_0x541178[_0x549bb9[_0x0a99('0x27')]]={'$like':'%'+_0x47bc34[_0x0a99('0x31')][_0x0a99('0x3d')]+'%'};return _0x541178;}})});}_0x223bdb=_['merge']({},_0x223bdb,_0x47bc34[_0x0a99('0x3e')]);var _0x11e046={'where':_0x223bdb[_0x0a99('0x3a')]};return db['Cdr'][_0x0a99('0x1e')](_0x11e046)[_0x0a99('0x24')](function(_0x23e4b9){_0x13d26a[_0x0a99('0x1e')]=_0x23e4b9;if(_0x47bc34['query'][_0x0a99('0x3f')]){_0x223bdb['include']=[{'all':!![]}];}return db['Cdr'][_0x0a99('0x40')](_0x223bdb);})['then'](function(_0x185495){_0x13d26a['rows']=_0x185495;return _0x13d26a;})[_0x0a99('0x24')](respondWithFilteredResult(_0x4e597b,_0x223bdb))[_0x0a99('0x41')](handleError(_0x4e597b,null));};exports[_0x0a99('0x42')]=function(_0x29da8a,_0x57b999){var _0xcee64a={'raw':!![],'where':{'id':_0x29da8a[_0x0a99('0x43')]['id']}},_0x97158c={};_0x97158c[_0x0a99('0x2f')]=_['keys'](db['Cdr']['rawAttributes']);_0x97158c[_0x0a99('0x31')]=_['keys'](_0x29da8a[_0x0a99('0x31')]);_0x97158c['filters']=_['intersection'](_0x97158c['model'],_0x97158c['query']);_0xcee64a[_0x0a99('0x33')]=_['intersection'](_0x97158c[_0x0a99('0x2f')],qs[_0x0a99('0x35')](_0x29da8a['query'][_0x0a99('0x35')]));_0xcee64a[_0x0a99('0x33')]=_0xcee64a['attributes'][_0x0a99('0x36')]?_0xcee64a['attributes']:_0x97158c[_0x0a99('0x2f')];if(_0x29da8a[_0x0a99('0x31')]['includeAll']){_0xcee64a[_0x0a99('0x44')]=[{'all':!![]}];}_0xcee64a=_['merge']({},_0xcee64a,_0x29da8a['options']);return db[_0x0a99('0x2a')][_0x0a99('0x45')](_0xcee64a)[_0x0a99('0x24')](handleEntityNotFound(_0x57b999,null))[_0x0a99('0x24')](respondWithResult(_0x57b999,null))[_0x0a99('0x41')](handleError(_0x57b999,null));};exports['create']=function(_0x476207,_0x174298){return db[_0x0a99('0x2a')][_0x0a99('0x46')](_0x476207[_0x0a99('0x47')],{})[_0x0a99('0x24')](respondWithResult(_0x174298,0xc9))[_0x0a99('0x41')](handleError(_0x174298,null));};exports[_0x0a99('0x23')]=function(_0x1cd328,_0x1621d9){if(_0x1cd328['body']['id']){delete _0x1cd328['body']['id'];}return db[_0x0a99('0x2a')][_0x0a99('0x45')]({'where':{'id':_0x1cd328[_0x0a99('0x43')]['id']}})[_0x0a99('0x24')](handleEntityNotFound(_0x1621d9,null))[_0x0a99('0x24')](saveUpdates(_0x1cd328[_0x0a99('0x47')],null))['then'](respondWithResult(_0x1621d9,null))[_0x0a99('0x41')](handleError(_0x1621d9,null));};exports[_0x0a99('0x48')]=function(_0x55fee0,_0x11ed07){return db[_0x0a99('0x2a')]['find']({'where':{'id':_0x55fee0[_0x0a99('0x43')]['id']}})[_0x0a99('0x24')](handleEntityNotFound(_0x11ed07,null))[_0x0a99('0x24')](removeEntity(_0x11ed07,null))[_0x0a99('0x41')](handleError(_0x11ed07,null));};exports[_0x0a99('0x49')]=function(_0x2411ea,_0xbdfb18){return db['Cdr'][_0x0a99('0x49')]()[_0x0a99('0x24')](respondWithResult(_0xbdfb18,null))[_0x0a99('0x41')](handleError(_0xbdfb18,null));};
\ No newline at end of file
+var _0xf9d5=['lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','then','sendStatus','error','stack','name','index','map','Cdr','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs'];(function(_0x1156ce,_0x50f233){var _0x2b6d72=function(_0x36a033){while(--_0x36a033){_0x1156ce['push'](_0x1156ce['shift']());}};_0x2b6d72(++_0x50f233);}(_0xf9d5,0x122));var _0x5f9d=function(_0x3f80d3,_0x1df024){_0x3f80d3=_0x3f80d3-0x0;var _0x1d13b1=_0xf9d5[_0x3f80d3];return _0x1d13b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5f9d('0x0'));var zipdir=require(_0x5f9d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f9d('0x2'));var moment=require(_0x5f9d('0x3'));var BPromise=require(_0x5f9d('0x4'));var Mustache=require(_0x5f9d('0x5'));var util=require(_0x5f9d('0x6'));var path=require(_0x5f9d('0x7'));var sox=require(_0x5f9d('0x8'));var csv=require('to-csv');var ejs=require(_0x5f9d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f9d('0xa'));var squel=require(_0x5f9d('0xb'));var crypto=require('crypto');var jsforce=require(_0x5f9d('0xc'));var deskjs=require(_0x5f9d('0xd'));var toCsv=require(_0x5f9d('0xe'));var querystring=require(_0x5f9d('0xf'));var Papa=require(_0x5f9d('0x10'));var Redis=require(_0x5f9d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5f9d('0x12'));var as=require(_0x5f9d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5f9d('0x14'));var utils=require(_0x5f9d('0x15'));var config=require(_0x5f9d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f9d('0x17'))['db'];function respondWithStatusCode(_0x10f5b1,_0x257910){_0x257910=_0x257910||0xcc;return function(_0x23a39f){if(_0x23a39f){return _0x10f5b1['sendStatus'](_0x257910);}return _0x10f5b1[_0x5f9d('0x18')](_0x257910)[_0x5f9d('0x19')]();};}function respondWithResult(_0x234902,_0x5aacdc){_0x5aacdc=_0x5aacdc||0xc8;return function(_0x8e2381){if(_0x8e2381){return _0x234902[_0x5f9d('0x18')](_0x5aacdc)['json'](_0x8e2381);}};}function respondWithFilteredResult(_0x4fd1cb,_0x2f0154){return function(_0x334cea){if(_0x334cea){var _0x3d4a1c=typeof _0x2f0154[_0x5f9d('0x1a')]===_0x5f9d('0x1b')&&typeof _0x2f0154['limit']==='undefined';var _0x54bd00=_0x334cea[_0x5f9d('0x1c')];var _0x4fb9a5=_0x3d4a1c?0x0:_0x2f0154[_0x5f9d('0x1a')];var _0x48448e=_0x3d4a1c?_0x334cea[_0x5f9d('0x1c')]:_0x2f0154[_0x5f9d('0x1a')]+_0x2f0154[_0x5f9d('0x1d')];var _0x55a31c;if(_0x48448e>=_0x54bd00){_0x48448e=_0x54bd00;_0x55a31c=0xc8;}else{_0x55a31c=0xce;}_0x4fd1cb[_0x5f9d('0x18')](_0x55a31c);return _0x4fd1cb[_0x5f9d('0x1e')](_0x5f9d('0x1f'),_0x4fb9a5+'-'+_0x48448e+'/'+_0x54bd00)[_0x5f9d('0x20')](_0x334cea);}return null;};}function patchUpdates(_0x320182){return function(_0xa62826){try{jsonpatch[_0x5f9d('0x21')](_0xa62826,_0x320182,!![]);}catch(_0x2563d5){return BPromise[_0x5f9d('0x22')](_0x2563d5);}return _0xa62826['save']();};}function saveUpdates(_0x4a2eeb,_0x5465b1){return function(_0x1bc76b){if(_0x1bc76b){return _0x1bc76b['update'](_0x4a2eeb)[_0x5f9d('0x23')](function(_0x5a3472){return _0x5a3472;});}return null;};}function removeEntity(_0x9d86ce,_0x564886){return function(_0x4875c5){if(_0x4875c5){return _0x4875c5['destroy']()[_0x5f9d('0x23')](function(){_0x9d86ce[_0x5f9d('0x18')](0xcc)[_0x5f9d('0x19')]();});}};}function handleEntityNotFound(_0x234511,_0x542bbc){return function(_0x379d2d){if(!_0x379d2d){_0x234511[_0x5f9d('0x24')](0x194);}return _0x379d2d;};}function handleError(_0x190402,_0x74f212){_0x74f212=_0x74f212||0x1f4;return function(_0x2d097f){logger[_0x5f9d('0x25')](_0x2d097f[_0x5f9d('0x26')]);if(_0x2d097f[_0x5f9d('0x27')]){delete _0x2d097f[_0x5f9d('0x27')];}_0x190402[_0x5f9d('0x18')](_0x74f212)['send'](_0x2d097f);};}exports[_0x5f9d('0x28')]=function(_0x1b9054,_0x1496c0){var _0x13cc7c={},_0x10e542={},_0x24233e={'count':0x0,'rows':[]};var _0x38b10d=_[_0x5f9d('0x29')](db[_0x5f9d('0x2a')]['rawAttributes'],function(_0x4ed27d){return{'name':_0x4ed27d['fieldName'],'type':_0x4ed27d[_0x5f9d('0x2b')]['key']};});_0x10e542[_0x5f9d('0x2c')]=_['map'](_0x38b10d,_0x5f9d('0x27'));_0x10e542['query']=_[_0x5f9d('0x2d')](_0x1b9054[_0x5f9d('0x2e')]);_0x10e542[_0x5f9d('0x2f')]=_[_0x5f9d('0x30')](_0x10e542[_0x5f9d('0x2c')],_0x10e542['query']);_0x13cc7c[_0x5f9d('0x31')]=_['intersection'](_0x10e542[_0x5f9d('0x2c')],qs['fields'](_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x32')]));_0x13cc7c['attributes']=_0x13cc7c[_0x5f9d('0x31')][_0x5f9d('0x33')]?_0x13cc7c[_0x5f9d('0x31')]:_0x10e542['model'];if(!_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x34')](_0x5f9d('0x35'))){_0x13cc7c[_0x5f9d('0x1d')]=qs[_0x5f9d('0x1d')](_0x1b9054['query'][_0x5f9d('0x1d')]);_0x13cc7c[_0x5f9d('0x1a')]=qs[_0x5f9d('0x1a')](_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x1a')]);}_0x13cc7c[_0x5f9d('0x36')]=qs['sort'](_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x37')]);_0x13cc7c[_0x5f9d('0x38')]=qs['filters'](_['pick'](_0x1b9054[_0x5f9d('0x2e')],_0x10e542[_0x5f9d('0x2f')]),_0x38b10d);if(_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x39')]){_0x13cc7c[_0x5f9d('0x38')]=_['merge'](_0x13cc7c['where'],{'$or':_[_0x5f9d('0x29')](_0x38b10d,function(_0x3c5737){if(_0x3c5737['type']!==_0x5f9d('0x3a')){var _0x4e15be={};_0x4e15be[_0x3c5737[_0x5f9d('0x27')]]={'$like':'%'+_0x1b9054[_0x5f9d('0x2e')]['filter']+'%'};return _0x4e15be;}})});}_0x13cc7c=_[_0x5f9d('0x3b')]({},_0x13cc7c,_0x1b9054[_0x5f9d('0x3c')]);var _0x4d3288={'where':_0x13cc7c['where']};return db[_0x5f9d('0x2a')][_0x5f9d('0x1c')](_0x4d3288)[_0x5f9d('0x23')](function(_0x3c43f6){_0x24233e[_0x5f9d('0x1c')]=_0x3c43f6;if(_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x3d')]){_0x13cc7c[_0x5f9d('0x3e')]=[{'all':!![]}];}return db[_0x5f9d('0x2a')][_0x5f9d('0x3f')](_0x13cc7c);})[_0x5f9d('0x23')](function(_0x227ef6){_0x24233e[_0x5f9d('0x40')]=_0x227ef6;return _0x24233e;})[_0x5f9d('0x23')](respondWithFilteredResult(_0x1496c0,_0x13cc7c))[_0x5f9d('0x41')](handleError(_0x1496c0,null));};exports[_0x5f9d('0x42')]=function(_0x45ba15,_0x1590b5){var _0xf02211={'raw':!![],'where':{'id':_0x45ba15[_0x5f9d('0x43')]['id']}},_0x21b5d1={};_0x21b5d1[_0x5f9d('0x2c')]=_[_0x5f9d('0x2d')](db[_0x5f9d('0x2a')][_0x5f9d('0x44')]);_0x21b5d1[_0x5f9d('0x2e')]=_[_0x5f9d('0x2d')](_0x45ba15[_0x5f9d('0x2e')]);_0x21b5d1[_0x5f9d('0x2f')]=_[_0x5f9d('0x30')](_0x21b5d1['model'],_0x21b5d1[_0x5f9d('0x2e')]);_0xf02211['attributes']=_[_0x5f9d('0x30')](_0x21b5d1[_0x5f9d('0x2c')],qs[_0x5f9d('0x32')](_0x45ba15[_0x5f9d('0x2e')][_0x5f9d('0x32')]));_0xf02211[_0x5f9d('0x31')]=_0xf02211[_0x5f9d('0x31')]['length']?_0xf02211[_0x5f9d('0x31')]:_0x21b5d1[_0x5f9d('0x2c')];if(_0x45ba15[_0x5f9d('0x2e')]['includeAll']){_0xf02211[_0x5f9d('0x3e')]=[{'all':!![]}];}_0xf02211=_['merge']({},_0xf02211,_0x45ba15[_0x5f9d('0x3c')]);return db[_0x5f9d('0x2a')][_0x5f9d('0x45')](_0xf02211)['then'](handleEntityNotFound(_0x1590b5,null))['then'](respondWithResult(_0x1590b5,null))[_0x5f9d('0x41')](handleError(_0x1590b5,null));};exports[_0x5f9d('0x46')]=function(_0x4c9645,_0x2a43a3){return db['Cdr'][_0x5f9d('0x46')](_0x4c9645[_0x5f9d('0x47')],{})[_0x5f9d('0x23')](respondWithResult(_0x2a43a3,0xc9))[_0x5f9d('0x41')](handleError(_0x2a43a3,null));};exports[_0x5f9d('0x48')]=function(_0x16a9fa,_0x3aa63c){if(_0x16a9fa[_0x5f9d('0x47')]['id']){delete _0x16a9fa[_0x5f9d('0x47')]['id'];}return db[_0x5f9d('0x2a')]['find']({'where':{'id':_0x16a9fa[_0x5f9d('0x43')]['id']}})[_0x5f9d('0x23')](handleEntityNotFound(_0x3aa63c,null))['then'](saveUpdates(_0x16a9fa[_0x5f9d('0x47')],null))[_0x5f9d('0x23')](respondWithResult(_0x3aa63c,null))[_0x5f9d('0x41')](handleError(_0x3aa63c,null));};exports[_0x5f9d('0x49')]=function(_0xc9a152,_0x414868){return db[_0x5f9d('0x2a')][_0x5f9d('0x45')]({'where':{'id':_0xc9a152['params']['id']}})['then'](handleEntityNotFound(_0x414868,null))[_0x5f9d('0x23')](removeEntity(_0x414868,null))[_0x5f9d('0x41')](handleError(_0x414868,null));};exports[_0x5f9d('0x4a')]=function(_0x101616,_0x97aac2){return db[_0x5f9d('0x2a')][_0x5f9d('0x4a')]()[_0x5f9d('0x23')](respondWithResult(_0x97aac2,null))[_0x5f9d('0x41')](handleError(_0x97aac2,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 355e1aa..24ec8b6 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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x189599,_0xdd106a){var _0x152ed2=function(_0x330775){while(--_0x330775){_0x189599['push'](_0x189599['shift']());}};_0x152ed2(++_0xdd106a);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x4566b8,_0x40a546){var _0xf73e97=function(_0x5d12ab){while(--_0x5d12ab){_0x4566b8['push'](_0x4566b8['shift']());}};_0xf73e97(++_0x40a546);}(_0x7a54,0x106));var _0x47a5=function(_0x245580,_0x102345){_0x245580=_0x245580-0x0;var _0x17c79a=_0x7a54[_0x245580];return _0x17c79a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index d627620..41eb0eb 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 _0x97fc=['Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4042de,_0x31c003){var _0x408ce3=function(_0x37647a){while(--_0x37647a){_0x4042de['push'](_0x4042de['shift']());}};_0x408ce3(++_0x31c003);}(_0x97fc,0x193));var _0xc97f=function(_0x2ef83e,_0x3b64b4){_0x2ef83e=_0x2ef83e-0x0;var _0xdc5499=_0x97fc[_0x2ef83e];return _0xdc5499;};'use strict';var _=require(_0xc97f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc97f('0x1'));var rs=require(_0xc97f('0x2'));var fs=require('fs');var Redis=require(_0xc97f('0x3'));var db=require(_0xc97f('0x4'))['db'];var utils=require(_0xc97f('0x5'));var logger=require('../../config/logger')(_0xc97f('0x6'));var config=require('../../config/environment');var jayson=require(_0xc97f('0x7'));var client=jayson[_0xc97f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x475e52,_0x3a280b,_0x481735){return new BPromise(function(_0x3e4e65,_0x1f651e){return client[_0xc97f('0x9')](_0x475e52,_0x481735)[_0xc97f('0xa')](function(_0x5d51b6){logger[_0xc97f('0xb')](_0xc97f('0xc'),_0x3a280b,_0xc97f('0xd'));logger[_0xc97f('0xe')](_0xc97f('0xf'),_0x3a280b,_0xc97f('0xd'),JSON[_0xc97f('0x10')](_0x5d51b6));if(_0x5d51b6[_0xc97f('0x11')]){if(_0x5d51b6[_0xc97f('0x11')][_0xc97f('0x12')]===0x1f4){logger[_0xc97f('0x11')](_0xc97f('0xc'),_0x3a280b,_0x5d51b6[_0xc97f('0x11')][_0xc97f('0x13')]);return _0x1f651e(_0x5d51b6[_0xc97f('0x11')][_0xc97f('0x13')]);}logger['error'](_0xc97f('0xc'),_0x3a280b,_0x5d51b6[_0xc97f('0x11')][_0xc97f('0x13')]);return _0x3e4e65(_0x5d51b6[_0xc97f('0x11')][_0xc97f('0x13')]);}else{logger['info'](_0xc97f('0xc'),_0x3a280b,'request\x20sent');_0x3e4e65(_0x5d51b6[_0xc97f('0x14')]['message']);}})[_0xc97f('0x15')](function(_0x5b0763){logger[_0xc97f('0x11')]('Cdr,\x20%s,\x20%s',_0x3a280b,_0x5b0763);_0x1f651e(_0x5b0763);});});}
\ No newline at end of file
+var _0xcad4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x542bd0,_0x56b265){var _0xaced4=function(_0x5db5c2){while(--_0x5db5c2){_0x542bd0['push'](_0x542bd0['shift']());}};_0xaced4(++_0x56b265);}(_0xcad4,0x1e9));var _0x4cad=function(_0x4878ad,_0xf2e815){_0x4878ad=_0x4878ad-0x0;var _0x12272f=_0xcad4[_0x4878ad];return _0x12272f;};'use strict';var _=require(_0x4cad('0x0'));var util=require(_0x4cad('0x1'));var moment=require(_0x4cad('0x2'));var BPromise=require(_0x4cad('0x3'));var rs=require(_0x4cad('0x4'));var fs=require('fs');var Redis=require(_0x4cad('0x5'));var db=require(_0x4cad('0x6'))['db'];var utils=require(_0x4cad('0x7'));var logger=require(_0x4cad('0x8'))(_0x4cad('0x9'));var config=require(_0x4cad('0xa'));var jayson=require(_0x4cad('0xb'));var client=jayson[_0x4cad('0xc')][_0x4cad('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x45206a,_0x11d320,_0x21e409){return new BPromise(function(_0x31e992,_0x1b2b76){return client[_0x4cad('0xe')](_0x45206a,_0x21e409)['then'](function(_0x2afcea){logger['info'](_0x4cad('0xf'),_0x11d320,'request\x20sent');logger[_0x4cad('0x10')](_0x4cad('0x11'),_0x11d320,_0x4cad('0x12'),JSON[_0x4cad('0x13')](_0x2afcea));if(_0x2afcea['error']){if(_0x2afcea[_0x4cad('0x14')][_0x4cad('0x15')]===0x1f4){logger[_0x4cad('0x14')]('Cdr,\x20%s,\x20%s',_0x11d320,_0x2afcea['error'][_0x4cad('0x16')]);return _0x1b2b76(_0x2afcea['error'][_0x4cad('0x16')]);}logger['error'](_0x4cad('0xf'),_0x11d320,_0x2afcea[_0x4cad('0x14')][_0x4cad('0x16')]);return _0x31e992(_0x2afcea[_0x4cad('0x14')][_0x4cad('0x16')]);}else{logger[_0x4cad('0x17')](_0x4cad('0xf'),_0x11d320,_0x4cad('0x12'));_0x31e992(_0x2afcea[_0x4cad('0x18')][_0x4cad('0x16')]);}})[_0x4cad('0x19')](function(_0x4e9208){logger[_0x4cad('0x14')](_0x4cad('0xf'),_0x11d320,_0x4e9208);_0x1b2b76(_0x4e9208);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 4b0cd35..2dd6d6f 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(_0x555bbd,_0x196748){var _0x3184d7=function(_0x274943){while(--_0x274943){_0x555bbd['push'](_0x555bbd['shift']());}};_0x3184d7(++_0x196748);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x209e12,_0x2ce907){var _0x3f5b89=function(_0x39cc7f){while(--_0x39cc7f){_0x209e12['push'](_0x209e12['shift']());}};_0x3f5b89(++_0x2ce907);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 2ce5dcb..29a064b 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 _0xfee2=['INTEGER','STRING','TEXT'];(function(_0x4df17c,_0x2d2b61){var _0x4e79b5=function(_0x2134a5){while(--_0x2134a5){_0x4df17c['push'](_0x4df17c['shift']());}};_0x4e79b5(++_0x2d2b61);}(_0xfee2,0x1ec));var _0x2fee=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xfee2[_0x4b2436];return _0x4f5ab2;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x2fee('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x2fee('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2fee('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x2804=['exports','TEXT','STRING','*,*,*,*'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x2804,0xe0));var _0x4280=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x2804[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module[_0x4280('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x4280('0x1')]()},'description':{'type':Sequelize[_0x4280('0x2')]},'interval':{'type':Sequelize[_0x4280('0x2')],'defaultValue':_0x4280('0x3')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 74b8db8..63f7fa9 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 _0x82b0=['length','attributes','includeAll','merge','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','send','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields'];(function(_0x32e2d7,_0x17e17c){var _0x356379=function(_0x2e6e5d){while(--_0x2e6e5d){_0x32e2d7['push'](_0x32e2d7['shift']());}};_0x356379(++_0x17e17c);}(_0x82b0,0x81));var _0x082b=function(_0x7abd7,_0x1ca3f9){_0x7abd7=_0x7abd7-0x0;var _0x3a2577=_0x82b0[_0x7abd7];return _0x3a2577;};'use strict';var emlformat=require(_0x082b('0x0'));var rimraf=require(_0x082b('0x1'));var zipdir=require(_0x082b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x082b('0x3'));var moment=require(_0x082b('0x4'));var BPromise=require(_0x082b('0x5'));var Mustache=require(_0x082b('0x6'));var util=require('util');var path=require(_0x082b('0x7'));var sox=require(_0x082b('0x8'));var csv=require(_0x082b('0x9'));var ejs=require(_0x082b('0xa'));var fs=require('fs');var fs_extra=require(_0x082b('0xb'));var _=require('lodash');var squel=require(_0x082b('0xc'));var crypto=require(_0x082b('0xd'));var jsforce=require(_0x082b('0xe'));var deskjs=require(_0x082b('0xf'));var toCsv=require(_0x082b('0x9'));var querystring=require(_0x082b('0x10'));var Papa=require(_0x082b('0x11'));var Redis=require(_0x082b('0x12'));var authService=require(_0x082b('0x13'));var qs=require(_0x082b('0x14'));var as=require(_0x082b('0x15'));var hardwareService=require(_0x082b('0x16'));var logger=require(_0x082b('0x17'))(_0x082b('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x082b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54bffb,_0x1c1f9d){_0x1c1f9d=_0x1c1f9d||0xcc;return function(_0x324251){if(_0x324251){return _0x54bffb['sendStatus'](_0x1c1f9d);}return _0x54bffb[_0x082b('0x1a')](_0x1c1f9d)[_0x082b('0x1b')]();};}function respondWithResult(_0x27bc44,_0x1f0c32){_0x1f0c32=_0x1f0c32||0xc8;return function(_0x40e206){if(_0x40e206){return _0x27bc44['status'](_0x1f0c32)[_0x082b('0x1c')](_0x40e206);}};}function respondWithFilteredResult(_0x1dc46e,_0x49db08){return function(_0x2c4f86){if(_0x2c4f86){var _0x588d8a=typeof _0x49db08[_0x082b('0x1d')]===_0x082b('0x1e')&&typeof _0x49db08['limit']===_0x082b('0x1e');var _0x4785fb=_0x2c4f86[_0x082b('0x1f')];var _0x3aa0ed=_0x588d8a?0x0:_0x49db08['offset'];var _0x2772e9=_0x588d8a?_0x2c4f86[_0x082b('0x1f')]:_0x49db08[_0x082b('0x1d')]+_0x49db08[_0x082b('0x20')];var _0x1e8fa5;if(_0x2772e9>=_0x4785fb){_0x2772e9=_0x4785fb;_0x1e8fa5=0xc8;}else{_0x1e8fa5=0xce;}_0x1dc46e[_0x082b('0x1a')](_0x1e8fa5);return _0x1dc46e[_0x082b('0x21')](_0x082b('0x22'),_0x3aa0ed+'-'+_0x2772e9+'/'+_0x4785fb)['json'](_0x2c4f86);}return null;};}function patchUpdates(_0x9faf2){return function(_0x2fffc3){try{jsonpatch[_0x082b('0x23')](_0x2fffc3,_0x9faf2,!![]);}catch(_0x5aab0a){return BPromise[_0x082b('0x24')](_0x5aab0a);}return _0x2fffc3[_0x082b('0x25')]();};}function saveUpdates(_0x42c0ab,_0x56fbd2){return function(_0x47c0d9){if(_0x47c0d9){return _0x47c0d9[_0x082b('0x26')](_0x42c0ab)['then'](function(_0x5cb670){return _0x5cb670;});}return null;};}function removeEntity(_0x3ae657,_0xaa7eb){return function(_0x271340){if(_0x271340){return _0x271340[_0x082b('0x27')]()[_0x082b('0x28')](function(){_0x3ae657['status'](0xcc)[_0x082b('0x1b')]();});}};}function handleEntityNotFound(_0x1254fd,_0x40d737){return function(_0x1082bf){if(!_0x1082bf){_0x1254fd[_0x082b('0x29')](0x194);}return _0x1082bf;};}function handleError(_0x8c3c9,_0x1b6dfc){_0x1b6dfc=_0x1b6dfc||0x1f4;return function(_0x4e30e8){logger[_0x082b('0x2a')](_0x4e30e8['stack']);if(_0x4e30e8[_0x082b('0x2b')]){delete _0x4e30e8['name'];}_0x8c3c9[_0x082b('0x1a')](_0x1b6dfc)[_0x082b('0x2c')](_0x4e30e8);};}exports['show']=function(_0x2279d7,_0x4b172b){var _0x228a5a={'raw':!![],'where':{'id':_0x2279d7[_0x082b('0x2d')]['id']}},_0x55d059={};_0x55d059[_0x082b('0x2e')]=_[_0x082b('0x2f')](db[_0x082b('0x30')][_0x082b('0x31')]);_0x55d059[_0x082b('0x32')]=_[_0x082b('0x2f')](_0x2279d7[_0x082b('0x32')]);_0x55d059[_0x082b('0x33')]=_[_0x082b('0x34')](_0x55d059[_0x082b('0x2e')],_0x55d059[_0x082b('0x32')]);_0x228a5a['attributes']=_[_0x082b('0x34')](_0x55d059[_0x082b('0x2e')],qs[_0x082b('0x35')](_0x2279d7[_0x082b('0x32')][_0x082b('0x35')]));_0x228a5a['attributes']=_0x228a5a['attributes'][_0x082b('0x36')]?_0x228a5a[_0x082b('0x37')]:_0x55d059['model'];if(_0x2279d7[_0x082b('0x32')][_0x082b('0x38')]){_0x228a5a['include']=[{'all':!![]}];}_0x228a5a=_[_0x082b('0x39')]({},_0x228a5a,_0x2279d7['options']);return db[_0x082b('0x30')][_0x082b('0x3a')](_0x228a5a)['then'](handleEntityNotFound(_0x4b172b,null))[_0x082b('0x28')](respondWithResult(_0x4b172b,null))[_0x082b('0x3b')](handleError(_0x4b172b,null));};exports[_0x082b('0x26')]=function(_0x16880f,_0x171bd8){if(_0x16880f['body']['id']){delete _0x16880f[_0x082b('0x3c')]['id'];}return db['ChatApplication'][_0x082b('0x3a')]({'where':{'id':_0x16880f[_0x082b('0x2d')]['id']}})[_0x082b('0x28')](handleEntityNotFound(_0x171bd8,null))[_0x082b('0x28')](saveUpdates(_0x16880f[_0x082b('0x3c')],null))[_0x082b('0x28')](respondWithResult(_0x171bd8,null))[_0x082b('0x3b')](handleError(_0x171bd8,null));};exports[_0x082b('0x27')]=function(_0x56f15c,_0x1e4745){return db[_0x082b('0x30')]['find']({'where':{'id':_0x56f15c[_0x082b('0x2d')]['id']}})[_0x082b('0x28')](handleEntityNotFound(_0x1e4745,null))[_0x082b('0x28')](removeEntity(_0x1e4745,null))[_0x082b('0x3b')](handleError(_0x1e4745,null));};
\ No newline at end of file
+var _0xc2da=['includeAll','include','options','find','catch','body','params','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','name','send','show','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','model'];(function(_0x3d6d15,_0x32ac32){var _0x22e018=function(_0x291394){while(--_0x291394){_0x3d6d15['push'](_0x3d6d15['shift']());}};_0x22e018(++_0x32ac32);}(_0xc2da,0x124));var _0xac2d=function(_0x36176e,_0x3719b7){_0x36176e=_0x36176e-0x0;var _0xbe79bc=_0xc2da[_0x36176e];return _0xbe79bc;};'use strict';var emlformat=require(_0xac2d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xac2d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xac2d('0x2'));var moment=require('moment');var BPromise=require(_0xac2d('0x3'));var Mustache=require(_0xac2d('0x4'));var util=require(_0xac2d('0x5'));var path=require(_0xac2d('0x6'));var sox=require(_0xac2d('0x7'));var csv=require(_0xac2d('0x8'));var ejs=require(_0xac2d('0x9'));var fs=require('fs');var fs_extra=require(_0xac2d('0xa'));var _=require(_0xac2d('0xb'));var squel=require(_0xac2d('0xc'));var crypto=require(_0xac2d('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac2d('0x8'));var querystring=require('querystring');var Papa=require(_0xac2d('0xe'));var Redis=require(_0xac2d('0xf'));var authService=require(_0xac2d('0x10'));var qs=require(_0xac2d('0x11'));var as=require(_0xac2d('0x12'));var hardwareService=require(_0xac2d('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xac2d('0x14'));var config=require(_0xac2d('0x15'));var licenseUtil=require(_0xac2d('0x16'));var db=require(_0xac2d('0x17'))['db'];function respondWithStatusCode(_0x4b9e88,_0x21aa1b){_0x21aa1b=_0x21aa1b||0xcc;return function(_0x20fa0d){if(_0x20fa0d){return _0x4b9e88[_0xac2d('0x18')](_0x21aa1b);}return _0x4b9e88[_0xac2d('0x19')](_0x21aa1b)[_0xac2d('0x1a')]();};}function respondWithResult(_0x2bed84,_0x284984){_0x284984=_0x284984||0xc8;return function(_0x897641){if(_0x897641){return _0x2bed84[_0xac2d('0x19')](_0x284984)[_0xac2d('0x1b')](_0x897641);}};}function respondWithFilteredResult(_0x11a3aa,_0x33d014){return function(_0x74853a){if(_0x74853a){var _0x2d92b5=typeof _0x33d014[_0xac2d('0x1c')]==='undefined'&&typeof _0x33d014[_0xac2d('0x1d')]===_0xac2d('0x1e');var _0x50ac65=_0x74853a[_0xac2d('0x1f')];var _0xed956b=_0x2d92b5?0x0:_0x33d014[_0xac2d('0x1c')];var _0x4d34fa=_0x2d92b5?_0x74853a[_0xac2d('0x1f')]:_0x33d014['offset']+_0x33d014[_0xac2d('0x1d')];var _0x3651e6;if(_0x4d34fa>=_0x50ac65){_0x4d34fa=_0x50ac65;_0x3651e6=0xc8;}else{_0x3651e6=0xce;}_0x11a3aa['status'](_0x3651e6);return _0x11a3aa[_0xac2d('0x20')]('Content-Range',_0xed956b+'-'+_0x4d34fa+'/'+_0x50ac65)['json'](_0x74853a);}return null;};}function patchUpdates(_0x510e85){return function(_0x5eaaef){try{jsonpatch[_0xac2d('0x21')](_0x5eaaef,_0x510e85,!![]);}catch(_0x21c407){return BPromise[_0xac2d('0x22')](_0x21c407);}return _0x5eaaef[_0xac2d('0x23')]();};}function saveUpdates(_0x211d26,_0x391911){return function(_0x3454ea){if(_0x3454ea){return _0x3454ea[_0xac2d('0x24')](_0x211d26)[_0xac2d('0x25')](function(_0x3f1212){return _0x3f1212;});}return null;};}function removeEntity(_0xafa502,_0x226b6b){return function(_0x1df55b){if(_0x1df55b){return _0x1df55b[_0xac2d('0x26')]()[_0xac2d('0x25')](function(){_0xafa502[_0xac2d('0x19')](0xcc)[_0xac2d('0x1a')]();});}};}function handleEntityNotFound(_0x10da1d,_0x271e47){return function(_0x5f00a0){if(!_0x5f00a0){_0x10da1d[_0xac2d('0x18')](0x194);}return _0x5f00a0;};}function handleError(_0x38cad3,_0x337228){_0x337228=_0x337228||0x1f4;return function(_0x2323c8){logger['error'](_0x2323c8['stack']);if(_0x2323c8[_0xac2d('0x27')]){delete _0x2323c8[_0xac2d('0x27')];}_0x38cad3[_0xac2d('0x19')](_0x337228)[_0xac2d('0x28')](_0x2323c8);};}exports[_0xac2d('0x29')]=function(_0x2906ac,_0x104af8){var _0x42aa82={'raw':!![],'where':{'id':_0x2906ac['params']['id']}},_0x2ac875={};_0x2ac875['model']=_[_0xac2d('0x2a')](db[_0xac2d('0x2b')][_0xac2d('0x2c')]);_0x2ac875[_0xac2d('0x2d')]=_[_0xac2d('0x2a')](_0x2906ac['query']);_0x2ac875[_0xac2d('0x2e')]=_[_0xac2d('0x2f')](_0x2ac875['model'],_0x2ac875[_0xac2d('0x2d')]);_0x42aa82[_0xac2d('0x30')]=_[_0xac2d('0x2f')](_0x2ac875[_0xac2d('0x31')],qs['fields'](_0x2906ac[_0xac2d('0x2d')]['fields']));_0x42aa82[_0xac2d('0x30')]=_0x42aa82[_0xac2d('0x30')]['length']?_0x42aa82[_0xac2d('0x30')]:_0x2ac875[_0xac2d('0x31')];if(_0x2906ac[_0xac2d('0x2d')][_0xac2d('0x32')]){_0x42aa82[_0xac2d('0x33')]=[{'all':!![]}];}_0x42aa82=_['merge']({},_0x42aa82,_0x2906ac[_0xac2d('0x34')]);return db['ChatApplication'][_0xac2d('0x35')](_0x42aa82)['then'](handleEntityNotFound(_0x104af8,null))[_0xac2d('0x25')](respondWithResult(_0x104af8,null))[_0xac2d('0x36')](handleError(_0x104af8,null));};exports['update']=function(_0x5bd1e3,_0x3cf4d5){if(_0x5bd1e3[_0xac2d('0x37')]['id']){delete _0x5bd1e3[_0xac2d('0x37')]['id'];}return db[_0xac2d('0x2b')][_0xac2d('0x35')]({'where':{'id':_0x5bd1e3[_0xac2d('0x38')]['id']}})[_0xac2d('0x25')](handleEntityNotFound(_0x3cf4d5,null))['then'](saveUpdates(_0x5bd1e3[_0xac2d('0x37')],null))[_0xac2d('0x25')](respondWithResult(_0x3cf4d5,null))[_0xac2d('0x36')](handleError(_0x3cf4d5,null));};exports[_0xac2d('0x26')]=function(_0x2d90c2,_0x4eb307){return db[_0xac2d('0x2b')][_0xac2d('0x35')]({'where':{'id':_0x2d90c2[_0xac2d('0x38')]['id']}})[_0xac2d('0x25')](handleEntityNotFound(_0x4eb307,null))[_0xac2d('0x25')](removeEntity(_0x4eb307,null))[_0xac2d('0x36')](handleError(_0x4eb307,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index ed8fa29..19fc499 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 _0x20bc=['chat_applications','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','ChatApplication'];(function(_0x275cea,_0x3cc1eb){var _0x5691bd=function(_0x176fd1){while(--_0x176fd1){_0x275cea['push'](_0x275cea['shift']());}};_0x5691bd(++_0x3cc1eb);}(_0x20bc,0x1c5));var _0xc20b=function(_0x2e9b5b,_0x3e1332){_0x2e9b5b=_0x2e9b5b-0x0;var _0x734c46=_0x20bc[_0x2e9b5b];return _0x734c46;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc20b('0x0'))(_0xc20b('0x1'));var moment=require(_0xc20b('0x2'));var BPromise=require(_0xc20b('0x3'));var rp=require(_0xc20b('0x4'));var fs=require('fs');var path=require(_0xc20b('0x5'));var rimraf=require('rimraf');var config=require(_0xc20b('0x6'));var attributes=require('./chatApplication.attributes');module[_0xc20b('0x7')]=function(_0x18de6c,_0x5828da){return _0x18de6c['define'](_0xc20b('0x8'),attributes,{'tableName':_0xc20b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc20b('0xa')});};
\ No newline at end of file
+var _0x271d=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci'];(function(_0x143e19,_0x184769){var _0xa7b25d=function(_0x2a7711){while(--_0x2a7711){_0x143e19['push'](_0x143e19['shift']());}};_0xa7b25d(++_0x184769);}(_0x271d,0xc4));var _0xd271=function(_0x4b7e2a,_0x27893d){_0x4b7e2a=_0x4b7e2a-0x0;var _0x5d49a3=_0x271d[_0x4b7e2a];return _0x5d49a3;};'use strict';var _=require(_0xd271('0x0'));var util=require(_0xd271('0x1'));var logger=require('../../config/logger')(_0xd271('0x2'));var moment=require('moment');var BPromise=require(_0xd271('0x3'));var rp=require(_0xd271('0x4'));var fs=require('fs');var path=require(_0xd271('0x5'));var rimraf=require(_0xd271('0x6'));var config=require(_0xd271('0x7'));var attributes=require(_0xd271('0x8'));module[_0xd271('0x9')]=function(_0x3a1c19,_0xdcd18c){return _0x3a1c19[_0xd271('0xa')](_0xd271('0xb'),attributes,{'tableName':_0xd271('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd271('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 0886366..5d8ec6a 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 _0x56f4=['request\x20sent','stringify','error','code','message','catch','lodash','util','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','ChatApplication,\x20%s,\x20%s'];(function(_0x1b1b7b,_0xf3cb03){var _0x4d3852=function(_0x2d5494){while(--_0x2d5494){_0x1b1b7b['push'](_0x1b1b7b['shift']());}};_0x4d3852(++_0xf3cb03);}(_0x56f4,0x6f));var _0x456f=function(_0x119091,_0x118d6d){_0x119091=_0x119091-0x0;var _0x503f8c=_0x56f4[_0x119091];return _0x503f8c;};'use strict';var _=require(_0x456f('0x0'));var util=require(_0x456f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x456f('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x456f('0x3'))(_0x456f('0x4'));var config=require(_0x456f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x456f('0x6')][_0x456f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3fcec2,_0x206a99,_0x39b92e){return new BPromise(function(_0x118494,_0x2abb4c){return client['request'](_0x3fcec2,_0x39b92e)['then'](function(_0x423fa4){logger['info'](_0x456f('0x8'),_0x206a99,_0x456f('0x9'));logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x206a99,_0x456f('0x9'),JSON[_0x456f('0xa')](_0x423fa4));if(_0x423fa4[_0x456f('0xb')]){if(_0x423fa4['error'][_0x456f('0xc')]===0x1f4){logger['error'](_0x456f('0x8'),_0x206a99,_0x423fa4[_0x456f('0xb')][_0x456f('0xd')]);return _0x2abb4c(_0x423fa4['error'][_0x456f('0xd')]);}logger[_0x456f('0xb')](_0x456f('0x8'),_0x206a99,_0x423fa4[_0x456f('0xb')]['message']);return _0x118494(_0x423fa4['error'][_0x456f('0xd')]);}else{logger['info'](_0x456f('0x8'),_0x206a99,_0x456f('0x9'));_0x118494(_0x423fa4['result'][_0x456f('0xd')]);}})[_0x456f('0xe')](function(_0x320624){logger[_0x456f('0xb')](_0x456f('0x8'),_0x206a99,_0x320624);_0x2abb4c(_0x320624);});});}
\ No newline at end of file
+var _0x412c=['error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x22608c,_0x20fac7){var _0xf01d6d=function(_0x31ffbc){while(--_0x31ffbc){_0x22608c['push'](_0x22608c['shift']());}};_0xf01d6d(++_0x20fac7);}(_0x412c,0x155));var _0xc412=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x412c[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0xc412('0x0'));var util=require(_0xc412('0x1'));var moment=require(_0xc412('0x2'));var BPromise=require(_0xc412('0x3'));var rs=require(_0xc412('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc412('0x5'))(_0xc412('0x6'));var config=require(_0xc412('0x7'));var jayson=require(_0xc412('0x8'));var client=jayson[_0xc412('0x9')][_0xc412('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5699d9,_0x1f1249,_0x1841fc){return new BPromise(function(_0x347598,_0x32cf6a){return client['request'](_0x5699d9,_0x1841fc)['then'](function(_0x41071c){logger['info'](_0xc412('0xb'),_0x1f1249,_0xc412('0xc'));logger[_0xc412('0xd')](_0xc412('0xe'),_0x1f1249,_0xc412('0xc'),JSON[_0xc412('0xf')](_0x41071c));if(_0x41071c[_0xc412('0x10')]){if(_0x41071c[_0xc412('0x10')][_0xc412('0x11')]===0x1f4){logger[_0xc412('0x10')]('ChatApplication,\x20%s,\x20%s',_0x1f1249,_0x41071c['error']['message']);return _0x32cf6a(_0x41071c['error']['message']);}logger[_0xc412('0x10')](_0xc412('0xb'),_0x1f1249,_0x41071c[_0xc412('0x10')][_0xc412('0x12')]);return _0x347598(_0x41071c['error'][_0xc412('0x12')]);}else{logger[_0xc412('0x13')]('ChatApplication,\x20%s,\x20%s',_0x1f1249,_0xc412('0xc'));_0x347598(_0x41071c['result'][_0xc412('0x12')]);}})[_0xc412('0x14')](function(_0x577fed){logger[_0xc412('0x10')](_0xc412('0xb'),_0x1f1249,_0x577fed);_0x32cf6a(_0x577fed);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 736ccb0..a8acb3a 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 _0x1f31=['util','path','express','Router','fs-extra','../../components/interaction/service','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update','destroy'];(function(_0x2e4e9f,_0x85c591){var _0x4e84dd=function(_0x27a81d){while(--_0x27a81d){_0x2e4e9f['push'](_0x2e4e9f['shift']());}};_0x4e84dd(++_0x85c591);}(_0x1f31,0xa8));var _0x11f3=function(_0xbec8e6,_0x2841b5){_0xbec8e6=_0xbec8e6-0x0;var _0x4aa6f2=_0x1f31[_0xbec8e6];return _0x4aa6f2;};'use strict';var multer=require('multer');var util=require(_0x11f3('0x0'));var path=require(_0x11f3('0x1'));var timeout=require('connect-timeout');var express=require(_0x11f3('0x2'));var router=express[_0x11f3('0x3')]();var fs_extra=require(_0x11f3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x11f3('0x5'));var config=require('../../config/environment');var controller=require(_0x11f3('0x6'));router[_0x11f3('0x7')](_0x11f3('0x8'),auth['isAuthenticated'](),controller[_0x11f3('0x9')]);router[_0x11f3('0xa')]('/:id',auth[_0x11f3('0xb')](),controller[_0x11f3('0xc')]);router['delete'](_0x11f3('0x8'),auth[_0x11f3('0xb')](),controller[_0x11f3('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0x1dd3=['update','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','get','/:id','isAuthenticated','show'];(function(_0x370597,_0x39eaf2){var _0x3e5ca2=function(_0x1e1d7b){while(--_0x1e1d7b){_0x370597['push'](_0x370597['shift']());}};_0x3e5ca2(++_0x39eaf2);}(_0x1dd3,0x1be));var _0x31dd=function(_0x19103c,_0x4c6c0d){_0x19103c=_0x19103c-0x0;var _0x371d15=_0x1dd3[_0x19103c];return _0x371d15;};'use strict';var multer=require('multer');var util=require(_0x31dd('0x0'));var path=require(_0x31dd('0x1'));var timeout=require('connect-timeout');var express=require(_0x31dd('0x2'));var router=express['Router']();var fs_extra=require(_0x31dd('0x3'));var auth=require(_0x31dd('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0x31dd('0x5')](_0x31dd('0x6'),auth[_0x31dd('0x7')](),controller[_0x31dd('0x8')]);router['put'](_0x31dd('0x6'),auth[_0x31dd('0x7')](),controller[_0x31dd('0x9')]);router[_0x31dd('0xa')]('/:id',auth[_0x31dd('0x7')](),controller[_0x31dd('0xb')]);module[_0x31dd('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 51a0a39..551d07f 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 _0x6f08=['sequelize','exports','STRING','BOOLEAN'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x6f08,0x9c));var _0x86f0=function(_0x12b21a,_0x3f846e){_0x12b21a=_0x12b21a-0x0;var _0x235760=_0x6f08[_0x12b21a];return _0x235760;};'use strict';var Sequelize=require(_0x86f0('0x0'));module[_0x86f0('0x1')]={'name':{'type':Sequelize[_0x86f0('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x86f0('0x2')]},'write':{'type':Sequelize[_0x86f0('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x4e09=['BOOLEAN','exports','STRING'];(function(_0x13a35a,_0x325d54){var _0x316fac=function(_0x5aa93f){while(--_0x5aa93f){_0x13a35a['push'](_0x13a35a['shift']());}};_0x316fac(++_0x325d54);}(_0x4e09,0x166));var _0x94e0=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4e09[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require('sequelize');module[_0x94e0('0x0')]={'name':{'type':Sequelize[_0x94e0('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x94e0('0x1')]},'write':{'type':Sequelize[_0x94e0('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 135ecec..db6c6ce 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 _0xd2b2=['rows','show','params','rawAttributes','find','catch','create','body','destroy','describe','getUnread','toInteger','addMembers','ids','omit','getMembers','findOne','User','pick','filter','addMessage','ChatInternalMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','then','stack','name','index','map','ChatGroup','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd2b2,0x138));var _0x2d2b=function(_0x55eaf7,_0x2ddd6c){_0x55eaf7=_0x55eaf7-0x0;var _0x461760=_0xd2b2[_0x55eaf7];return _0x461760;};'use strict';var emlformat=require(_0x2d2b('0x0'));var rimraf=require(_0x2d2b('0x1'));var zipdir=require(_0x2d2b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2d2b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2d2b('0x4'));var util=require(_0x2d2b('0x5'));var path=require(_0x2d2b('0x6'));var sox=require(_0x2d2b('0x7'));var csv=require(_0x2d2b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2d2b('0x9'));var _=require(_0x2d2b('0xa'));var squel=require(_0x2d2b('0xb'));var crypto=require(_0x2d2b('0xc'));var jsforce=require(_0x2d2b('0xd'));var deskjs=require(_0x2d2b('0xe'));var toCsv=require(_0x2d2b('0x8'));var querystring=require(_0x2d2b('0xf'));var Papa=require(_0x2d2b('0x10'));var Redis=require('ioredis');var authService=require(_0x2d2b('0x11'));var qs=require(_0x2d2b('0x12'));var as=require(_0x2d2b('0x13'));var hardwareService=require(_0x2d2b('0x14'));var logger=require(_0x2d2b('0x15'))(_0x2d2b('0x16'));var utils=require(_0x2d2b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2d2b('0x18'));var db=require('../../mysqldb')['db'];config[_0x2d2b('0x19')]=_[_0x2d2b('0x1a')](config[_0x2d2b('0x19')],{'host':_0x2d2b('0x1b'),'port':0x18eb});var socket=require(_0x2d2b('0x1c'))(new Redis(config[_0x2d2b('0x19')]));require(_0x2d2b('0x1d'))['register'](socket);function respondWithStatusCode(_0x33c73c,_0x97e7cb){_0x97e7cb=_0x97e7cb||0xcc;return function(_0x26b2c3){if(_0x26b2c3){return _0x33c73c[_0x2d2b('0x1e')](_0x97e7cb);}return _0x33c73c[_0x2d2b('0x1f')](_0x97e7cb)[_0x2d2b('0x20')]();};}function respondWithResult(_0x7cb236,_0x20b419){_0x20b419=_0x20b419||0xc8;return function(_0x3e5736){if(_0x3e5736){return _0x7cb236['status'](_0x20b419)['json'](_0x3e5736);}};}function respondWithFilteredResult(_0x1c104b,_0x9c5be0){return function(_0x74c6ce){if(_0x74c6ce){var _0x2ea5c5=typeof _0x9c5be0[_0x2d2b('0x21')]===_0x2d2b('0x22')&&typeof _0x9c5be0[_0x2d2b('0x23')]===_0x2d2b('0x22');var _0x598198=_0x74c6ce[_0x2d2b('0x24')];var _0x17ccc4=_0x2ea5c5?0x0:_0x9c5be0['offset'];var _0x5be82c=_0x2ea5c5?_0x74c6ce[_0x2d2b('0x24')]:_0x9c5be0[_0x2d2b('0x21')]+_0x9c5be0['limit'];var _0x50cf85;if(_0x5be82c>=_0x598198){_0x5be82c=_0x598198;_0x50cf85=0xc8;}else{_0x50cf85=0xce;}_0x1c104b[_0x2d2b('0x1f')](_0x50cf85);return _0x1c104b[_0x2d2b('0x25')]('Content-Range',_0x17ccc4+'-'+_0x5be82c+'/'+_0x598198)['json'](_0x74c6ce);}return null;};}function patchUpdates(_0x445ee1){return function(_0x600be9){try{jsonpatch[_0x2d2b('0x26')](_0x600be9,_0x445ee1,!![]);}catch(_0x2fb5dc){return BPromise[_0x2d2b('0x27')](_0x2fb5dc);}return _0x600be9['save']();};}function saveUpdates(_0x54dd46,_0xea390f){return function(_0x48e376){if(_0x48e376){return _0x48e376['update'](_0x54dd46)[_0x2d2b('0x28')](function(_0x222dd7){return _0x222dd7;});}return null;};}function removeEntity(_0x2eb048,_0x5769ae){return function(_0x15de29){if(_0x15de29){return _0x15de29['destroy']()[_0x2d2b('0x28')](function(){_0x2eb048[_0x2d2b('0x1f')](0xcc)[_0x2d2b('0x20')]();});}};}function handleEntityNotFound(_0x43b375,_0xa2a23d){return function(_0xded75){if(!_0xded75){_0x43b375[_0x2d2b('0x1e')](0x194);}return _0xded75;};}function handleError(_0x51afc6,_0x2ab2a5){_0x2ab2a5=_0x2ab2a5||0x1f4;return function(_0x343241){logger['error'](_0x343241[_0x2d2b('0x29')]);if(_0x343241['name']){delete _0x343241[_0x2d2b('0x2a')];}_0x51afc6['status'](_0x2ab2a5)['send'](_0x343241);};}exports[_0x2d2b('0x2b')]=function(_0x59fbfc,_0x486cd7){var _0x28a1d6={},_0x4498d8={},_0x5bcf31={'count':0x0,'rows':[]};var _0x2d5e1d=_[_0x2d2b('0x2c')](db[_0x2d2b('0x2d')]['rawAttributes'],function(_0x13e51a){return{'name':_0x13e51a[_0x2d2b('0x2e')],'type':_0x13e51a[_0x2d2b('0x2f')][_0x2d2b('0x30')]};});_0x4498d8['model']=_[_0x2d2b('0x2c')](_0x2d5e1d,'name');_0x4498d8[_0x2d2b('0x31')]=_[_0x2d2b('0x32')](_0x59fbfc['query']);_0x4498d8['filters']=_['intersection'](_0x4498d8[_0x2d2b('0x33')],_0x4498d8['query']);_0x28a1d6[_0x2d2b('0x34')]=_[_0x2d2b('0x35')](_0x4498d8[_0x2d2b('0x33')],qs[_0x2d2b('0x36')](_0x59fbfc['query'][_0x2d2b('0x36')]));_0x28a1d6[_0x2d2b('0x34')]=_0x28a1d6[_0x2d2b('0x34')][_0x2d2b('0x37')]?_0x28a1d6[_0x2d2b('0x34')]:_0x4498d8[_0x2d2b('0x33')];if(!_0x59fbfc['query'][_0x2d2b('0x38')](_0x2d2b('0x39'))){_0x28a1d6[_0x2d2b('0x23')]=qs[_0x2d2b('0x23')](_0x59fbfc['query'][_0x2d2b('0x23')]);_0x28a1d6['offset']=qs[_0x2d2b('0x21')](_0x59fbfc[_0x2d2b('0x31')]['offset']);}_0x28a1d6[_0x2d2b('0x3a')]=qs[_0x2d2b('0x3b')](_0x59fbfc[_0x2d2b('0x31')]['sort']);_0x28a1d6['where']=qs[_0x2d2b('0x3c')](_['pick'](_0x59fbfc[_0x2d2b('0x31')],_0x4498d8[_0x2d2b('0x3c')]),_0x2d5e1d);if(_0x59fbfc['query']['filter']){_0x28a1d6[_0x2d2b('0x3d')]=_[_0x2d2b('0x3e')](_0x28a1d6[_0x2d2b('0x3d')],{'$or':_[_0x2d2b('0x2c')](_0x2d5e1d,function(_0x247ef7){if(_0x247ef7[_0x2d2b('0x2f')]!==_0x2d2b('0x3f')){var _0x56b181={};_0x56b181[_0x247ef7[_0x2d2b('0x2a')]]={'$like':'%'+_0x59fbfc[_0x2d2b('0x31')]['filter']+'%'};return _0x56b181;}})});}_0x28a1d6=_[_0x2d2b('0x3e')]({},_0x28a1d6,_0x59fbfc[_0x2d2b('0x40')]);var _0x356415={'where':_0x28a1d6[_0x2d2b('0x3d')]};return db[_0x2d2b('0x2d')][_0x2d2b('0x24')](_0x356415)[_0x2d2b('0x28')](function(_0x2fd60a){_0x5bcf31[_0x2d2b('0x24')]=_0x2fd60a;if(_0x59fbfc[_0x2d2b('0x31')][_0x2d2b('0x41')]){_0x28a1d6[_0x2d2b('0x42')]=[{'all':!![]}];}return db[_0x2d2b('0x2d')][_0x2d2b('0x43')](_0x28a1d6);})['then'](function(_0x3a0024){_0x5bcf31[_0x2d2b('0x44')]=_0x3a0024;return _0x5bcf31;})[_0x2d2b('0x28')](respondWithFilteredResult(_0x486cd7,_0x28a1d6))['catch'](handleError(_0x486cd7,null));};exports[_0x2d2b('0x45')]=function(_0x238ffa,_0x2b0d58){var _0x512de0={'raw':!![],'where':{'id':_0x238ffa[_0x2d2b('0x46')]['id']}},_0x12d43a={};_0x12d43a[_0x2d2b('0x33')]=_[_0x2d2b('0x32')](db['ChatGroup'][_0x2d2b('0x47')]);_0x12d43a['query']=_[_0x2d2b('0x32')](_0x238ffa[_0x2d2b('0x31')]);_0x12d43a[_0x2d2b('0x3c')]=_['intersection'](_0x12d43a[_0x2d2b('0x33')],_0x12d43a[_0x2d2b('0x31')]);_0x512de0['attributes']=_[_0x2d2b('0x35')](_0x12d43a[_0x2d2b('0x33')],qs[_0x2d2b('0x36')](_0x238ffa[_0x2d2b('0x31')][_0x2d2b('0x36')]));_0x512de0['attributes']=_0x512de0[_0x2d2b('0x34')]['length']?_0x512de0[_0x2d2b('0x34')]:_0x12d43a[_0x2d2b('0x33')];if(_0x238ffa[_0x2d2b('0x31')][_0x2d2b('0x41')]){_0x512de0['include']=[{'all':!![]}];}_0x512de0=_[_0x2d2b('0x3e')]({},_0x512de0,_0x238ffa[_0x2d2b('0x40')]);return db[_0x2d2b('0x2d')][_0x2d2b('0x48')](_0x512de0)['then'](handleEntityNotFound(_0x2b0d58,null))[_0x2d2b('0x28')](respondWithResult(_0x2b0d58,null))[_0x2d2b('0x49')](handleError(_0x2b0d58,null));};exports[_0x2d2b('0x4a')]=function(_0x5723ed,_0x2370e5){return db[_0x2d2b('0x2d')]['create'](_0x5723ed[_0x2d2b('0x4b')],{})[_0x2d2b('0x28')](respondWithResult(_0x2370e5,0xc9))[_0x2d2b('0x49')](handleError(_0x2370e5,null));};exports['update']=function(_0x23e8df,_0x5c5dd2){if(_0x23e8df[_0x2d2b('0x4b')]['id']){delete _0x23e8df['body']['id'];}return db[_0x2d2b('0x2d')][_0x2d2b('0x48')]({'where':{'id':_0x23e8df[_0x2d2b('0x46')]['id']}})[_0x2d2b('0x28')](handleEntityNotFound(_0x5c5dd2,null))[_0x2d2b('0x28')](saveUpdates(_0x23e8df['body'],null))[_0x2d2b('0x28')](respondWithResult(_0x5c5dd2,null))[_0x2d2b('0x49')](handleError(_0x5c5dd2,null));};exports[_0x2d2b('0x4c')]=function(_0x4dca25,_0x531b9e){return db[_0x2d2b('0x2d')][_0x2d2b('0x48')]({'where':{'id':_0x4dca25[_0x2d2b('0x46')]['id']}})[_0x2d2b('0x28')](handleEntityNotFound(_0x531b9e,null))[_0x2d2b('0x28')](removeEntity(_0x531b9e,null))['catch'](handleError(_0x531b9e,null));};exports[_0x2d2b('0x4d')]=function(_0x81bc2c,_0x2a05f4){return db[_0x2d2b('0x2d')][_0x2d2b('0x4d')]()[_0x2d2b('0x28')](respondWithResult(_0x2a05f4,null))[_0x2d2b('0x49')](handleError(_0x2a05f4,null));};exports[_0x2d2b('0x4e')]=function(_0x590121,_0x56332e,_0x527b88){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x590121[_0x2d2b('0x46')]['id'],'ToId':_0x590121['user']['id'],'read':![]}})[_0x2d2b('0x28')](function(_0x51bd7c){return{'id':_[_0x2d2b('0x4f')](_0x590121[_0x2d2b('0x46')]['id']),'count':_0x51bd7c};})[_0x2d2b('0x28')](respondWithResult(_0x56332e,null))[_0x2d2b('0x49')](handleError(_0x56332e,null));};exports[_0x2d2b('0x50')]=function(_0xca1805,_0xbb876a,_0x57fb7c){return db[_0x2d2b('0x2d')]['find']({'where':{'id':_0xca1805[_0x2d2b('0x46')]['id']}})[_0x2d2b('0x28')](handleEntityNotFound(_0xbb876a,null))[_0x2d2b('0x28')](function(_0xebb9c1){if(_0xebb9c1){return _0xebb9c1[_0x2d2b('0x50')](_0xca1805['body'][_0x2d2b('0x51')],_[_0x2d2b('0x52')](_0xca1805[_0x2d2b('0x4b')],['ids','id'])||{});}})[_0x2d2b('0x28')](respondWithResult(_0xbb876a,null))[_0x2d2b('0x49')](handleError(_0xbb876a,null));};exports[_0x2d2b('0x53')]=function(_0x5a08fc,_0x3e59f8,_0x1fcbf6){var _0x403792={};var _0x1a300d={};var _0x2f358c;var _0x50f92c;return db[_0x2d2b('0x2d')][_0x2d2b('0x54')]({'where':{'id':_0x5a08fc[_0x2d2b('0x46')]['id']}})['then'](handleEntityNotFound(_0x3e59f8,null))[_0x2d2b('0x28')](function(_0x315001){if(_0x315001){_0x2f358c=_0x315001;_0x1a300d[_0x2d2b('0x33')]=_[_0x2d2b('0x32')](db[_0x2d2b('0x55')][_0x2d2b('0x47')]);_0x1a300d[_0x2d2b('0x31')]=_[_0x2d2b('0x32')](_0x5a08fc['query']);_0x1a300d[_0x2d2b('0x3c')]=_['intersection'](_0x1a300d['model'],_0x1a300d[_0x2d2b('0x31')]);_0x403792['attributes']=_['intersection'](_0x1a300d[_0x2d2b('0x33')],qs[_0x2d2b('0x36')](_0x5a08fc[_0x2d2b('0x31')][_0x2d2b('0x36')]));_0x403792[_0x2d2b('0x34')]=_0x403792['attributes']['length']?_0x403792[_0x2d2b('0x34')]:_0x1a300d[_0x2d2b('0x33')];_0x403792[_0x2d2b('0x3a')]=qs[_0x2d2b('0x3b')](_0x5a08fc['query'][_0x2d2b('0x3b')]);_0x403792['where']=qs['filters'](_[_0x2d2b('0x56')](_0x5a08fc[_0x2d2b('0x31')],_0x1a300d['filters']));if(_0x5a08fc[_0x2d2b('0x31')][_0x2d2b('0x57')]){_0x403792['where']=_[_0x2d2b('0x3e')](_0x403792[_0x2d2b('0x3d')],{'$or':_[_0x2d2b('0x2c')](_0x403792['attributes'],function(_0x2f4c14){var _0x2ab14f={};_0x2ab14f[_0x2f4c14]={'$like':'%'+_0x5a08fc['query'][_0x2d2b('0x57')]+'%'};return _0x2ab14f;})});}_0x403792=_[_0x2d2b('0x3e')]({},_0x403792,_0x5a08fc['options']);return _0x2f358c[_0x2d2b('0x53')](_0x403792);}})['then'](function(_0x13d44c){if(_0x13d44c){_0x50f92c=_0x13d44c['length'];if(!_0x5a08fc[_0x2d2b('0x31')]['hasOwnProperty']('nolimit')){_0x403792[_0x2d2b('0x23')]=qs[_0x2d2b('0x23')](_0x5a08fc[_0x2d2b('0x31')][_0x2d2b('0x23')]);_0x403792[_0x2d2b('0x21')]=qs['offset'](_0x5a08fc[_0x2d2b('0x31')][_0x2d2b('0x21')]);}return _0x2f358c[_0x2d2b('0x53')](_0x403792);}})[_0x2d2b('0x28')](function(_0x9e1ff4){if(_0x9e1ff4){return _0x9e1ff4?{'count':_0x50f92c,'rows':_0x9e1ff4}:null;}})[_0x2d2b('0x28')](respondWithResult(_0x3e59f8,null))[_0x2d2b('0x49')](handleError(_0x3e59f8,null));};exports['removeMembers']=function(_0x1d4be9,_0x2a2183,_0x2dcb1a){return db[_0x2d2b('0x2d')][_0x2d2b('0x48')]({'where':{'id':_0x1d4be9['params']['id']}})[_0x2d2b('0x28')](handleEntityNotFound(_0x2a2183,null))['then'](function(_0x279cce){if(_0x279cce){return _0x279cce['removeMembers'](_0x1d4be9[_0x2d2b('0x31')][_0x2d2b('0x51')]);}})[_0x2d2b('0x28')](respondWithStatusCode(_0x2a2183,null))[_0x2d2b('0x49')](handleError(_0x2a2183,null));};exports[_0x2d2b('0x58')]=function(_0x2684eb,_0x3e215b,_0xbc86af){if(_0x2684eb[_0x2d2b('0x4b')]['id']){delete _0x2684eb['body']['id'];}return db[_0x2d2b('0x2d')][_0x2d2b('0x48')]({'where':{'id':_0x2684eb['params']['id']}})[_0x2d2b('0x28')](handleEntityNotFound(_0x3e215b,null))['then'](function(_0x37d63f){if(_0x37d63f){_0x2684eb['body']['ChatGroupId']=_0x37d63f['id'];return db[_0x2d2b('0x59')]['create'](_0x2684eb[_0x2d2b('0x4b')]);}})[_0x2d2b('0x28')](respondWithResult(_0x3e215b,null))[_0x2d2b('0x49')](handleError(_0x3e215b,null));};exports[_0x2d2b('0x5a')]=function(_0x263df0,_0x40bf4d,_0x1a74c3){var _0x16ff0f={};var _0xf08c2a={};var _0x4d09ee;var _0x201ce7;return db[_0x2d2b('0x2d')][_0x2d2b('0x54')]({'where':{'id':_0x263df0[_0x2d2b('0x46')]['id']}})[_0x2d2b('0x28')](handleEntityNotFound(_0x40bf4d,null))[_0x2d2b('0x28')](function(_0x3391b7){if(_0x3391b7){_0x4d09ee=_0x3391b7;_0xf08c2a['model']=_[_0x2d2b('0x32')](db[_0x2d2b('0x59')]['rawAttributes']);_0xf08c2a['query']=_[_0x2d2b('0x32')](_0x263df0[_0x2d2b('0x31')]);_0xf08c2a[_0x2d2b('0x3c')]=_['intersection'](_0xf08c2a[_0x2d2b('0x33')],_0xf08c2a[_0x2d2b('0x31')]);_0x16ff0f[_0x2d2b('0x34')]=_[_0x2d2b('0x35')](_0xf08c2a['model'],qs[_0x2d2b('0x36')](_0x263df0[_0x2d2b('0x31')][_0x2d2b('0x36')]));_0x16ff0f[_0x2d2b('0x34')]=_0x16ff0f[_0x2d2b('0x34')][_0x2d2b('0x37')]?_0x16ff0f[_0x2d2b('0x34')]:_0xf08c2a[_0x2d2b('0x33')];_0x16ff0f[_0x2d2b('0x3a')]=qs['sort'](_0x263df0[_0x2d2b('0x31')][_0x2d2b('0x3b')]);_0x16ff0f[_0x2d2b('0x3d')]=qs[_0x2d2b('0x3c')](_[_0x2d2b('0x56')](_0x263df0[_0x2d2b('0x31')],_0xf08c2a[_0x2d2b('0x3c')]));if(_0x263df0['query']['filter']){_0x16ff0f[_0x2d2b('0x3d')]=_[_0x2d2b('0x3e')](_0x16ff0f[_0x2d2b('0x3d')],{'$or':_[_0x2d2b('0x2c')](_0x16ff0f[_0x2d2b('0x34')],function(_0x1ce237){var _0x5778a7={};_0x5778a7[_0x1ce237]={'$like':'%'+_0x263df0[_0x2d2b('0x31')][_0x2d2b('0x57')]+'%'};return _0x5778a7;})});}if(_0x263df0[_0x2d2b('0x31')]['$gte']){var _0x3ad178=_0x263df0[_0x2d2b('0x31')][_0x2d2b('0x5b')][_0x2d2b('0x5c')](',');var _0x4adaf4={};_0x4adaf4[_0x3ad178[0x0]]={'$gte':moment(_0x3ad178[0x1])[_0x2d2b('0x5d')](_0x2d2b('0x5e'))};_0x16ff0f[_0x2d2b('0x3d')]=_['merge'](_0x16ff0f[_0x2d2b('0x3d')],_0x4adaf4);}_0x16ff0f=_[_0x2d2b('0x3e')]({},_0x16ff0f,_0x263df0[_0x2d2b('0x40')]);return _0x4d09ee[_0x2d2b('0x5a')](_0x16ff0f);}})[_0x2d2b('0x28')](function(_0x1beea8){if(_0x1beea8){_0x201ce7=_0x1beea8['length'];if(!_0x263df0[_0x2d2b('0x31')]['hasOwnProperty'](_0x2d2b('0x39'))){_0x16ff0f[_0x2d2b('0x23')]=qs[_0x2d2b('0x23')](_0x263df0[_0x2d2b('0x31')][_0x2d2b('0x23')]);_0x16ff0f['offset']=qs[_0x2d2b('0x21')](_0x263df0[_0x2d2b('0x31')][_0x2d2b('0x21')]);}return _0x4d09ee['getMessages'](_0x16ff0f);}})['then'](function(_0x745af6){if(_0x745af6){return _0x745af6?{'count':_0x201ce7,'rows':_0x745af6}:null;}})[_0x2d2b('0x28')](respondWithResult(_0x40bf4d,null))['catch'](handleError(_0x40bf4d,null));};
\ No newline at end of file
+var _0xca0a=['desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','reject','then','destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','query','keys','attributes','intersection','model','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','describe','getUnread','user','toInteger','addMembers','ids','findOne','User','getMembers','hasOwnProperty','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x16c301,_0x3c7c43){var _0x1a2c5a=function(_0xb8f3b9){while(--_0xb8f3b9){_0x16c301['push'](_0x16c301['shift']());}};_0x1a2c5a(++_0x3c7c43);}(_0xca0a,0xb8));var _0xaca0=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xca0a[_0x2f1762];return _0x8ab21;};'use strict';var emlformat=require(_0xaca0('0x0'));var rimraf=require(_0xaca0('0x1'));var zipdir=require(_0xaca0('0x2'));var jsonpatch=require(_0xaca0('0x3'));var rp=require(_0xaca0('0x4'));var moment=require('moment');var BPromise=require(_0xaca0('0x5'));var Mustache=require('mustache');var util=require(_0xaca0('0x6'));var path=require(_0xaca0('0x7'));var sox=require(_0xaca0('0x8'));var csv=require('to-csv');var ejs=require(_0xaca0('0x9'));var fs=require('fs');var fs_extra=require(_0xaca0('0xa'));var _=require(_0xaca0('0xb'));var squel=require('squel');var crypto=require(_0xaca0('0xc'));var jsforce=require(_0xaca0('0xd'));var deskjs=require(_0xaca0('0xe'));var toCsv=require(_0xaca0('0xf'));var querystring=require('querystring');var Papa=require(_0xaca0('0x10'));var Redis=require(_0xaca0('0x11'));var authService=require(_0xaca0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xaca0('0x13'));var hardwareService=require(_0xaca0('0x14'));var logger=require(_0xaca0('0x15'))(_0xaca0('0x16'));var utils=require(_0xaca0('0x17'));var config=require(_0xaca0('0x18'));var licenseUtil=require(_0xaca0('0x19'));var db=require(_0xaca0('0x1a'))['db'];config[_0xaca0('0x1b')]=_[_0xaca0('0x1c')](config['redis'],{'host':_0xaca0('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xaca0('0x1e'))[_0xaca0('0x1f')](socket);function respondWithStatusCode(_0x59fb58,_0x34eca9){_0x34eca9=_0x34eca9||0xcc;return function(_0x24a38c){if(_0x24a38c){return _0x59fb58[_0xaca0('0x20')](_0x34eca9);}return _0x59fb58[_0xaca0('0x21')](_0x34eca9)[_0xaca0('0x22')]();};}function respondWithResult(_0xe0a568,_0x3bd12f){_0x3bd12f=_0x3bd12f||0xc8;return function(_0x377ed9){if(_0x377ed9){return _0xe0a568[_0xaca0('0x21')](_0x3bd12f)[_0xaca0('0x23')](_0x377ed9);}};}function respondWithFilteredResult(_0x8735de,_0x3750e0){return function(_0x33f19a){if(_0x33f19a){var _0x4bde98=typeof _0x3750e0[_0xaca0('0x24')]==='undefined'&&typeof _0x3750e0[_0xaca0('0x25')]===_0xaca0('0x26');var _0xa2a4a3=_0x33f19a[_0xaca0('0x27')];var _0x31b7c5=_0x4bde98?0x0:_0x3750e0[_0xaca0('0x24')];var _0x29e9fd=_0x4bde98?_0x33f19a[_0xaca0('0x27')]:_0x3750e0[_0xaca0('0x24')]+_0x3750e0[_0xaca0('0x25')];var _0x3b6276;if(_0x29e9fd>=_0xa2a4a3){_0x29e9fd=_0xa2a4a3;_0x3b6276=0xc8;}else{_0x3b6276=0xce;}_0x8735de[_0xaca0('0x21')](_0x3b6276);return _0x8735de['set']('Content-Range',_0x31b7c5+'-'+_0x29e9fd+'/'+_0xa2a4a3)[_0xaca0('0x23')](_0x33f19a);}return null;};}function patchUpdates(_0x53c475){return function(_0x3190ec){try{jsonpatch['apply'](_0x3190ec,_0x53c475,!![]);}catch(_0x7caaa2){return BPromise[_0xaca0('0x28')](_0x7caaa2);}return _0x3190ec['save']();};}function saveUpdates(_0x4ade65,_0xd12241){return function(_0x256f6f){if(_0x256f6f){return _0x256f6f['update'](_0x4ade65)[_0xaca0('0x29')](function(_0x5ec0e7){return _0x5ec0e7;});}return null;};}function removeEntity(_0x311b48,_0x3abf00){return function(_0x4b35ba){if(_0x4b35ba){return _0x4b35ba[_0xaca0('0x2a')]()[_0xaca0('0x29')](function(){_0x311b48[_0xaca0('0x21')](0xcc)[_0xaca0('0x22')]();});}};}function handleEntityNotFound(_0x399202,_0x36c0ed){return function(_0x17b49b){if(!_0x17b49b){_0x399202['sendStatus'](0x194);}return _0x17b49b;};}function handleError(_0x5370c5,_0x450362){_0x450362=_0x450362||0x1f4;return function(_0x11d27b){logger[_0xaca0('0x2b')](_0x11d27b[_0xaca0('0x2c')]);if(_0x11d27b['name']){delete _0x11d27b[_0xaca0('0x2d')];}_0x5370c5[_0xaca0('0x21')](_0x450362)[_0xaca0('0x2e')](_0x11d27b);};}exports[_0xaca0('0x2f')]=function(_0x5b1ecc,_0x250432){var _0xf815e3={},_0x2f68cb={},_0x5d2183={'count':0x0,'rows':[]};var _0x1cdff3=_[_0xaca0('0x30')](db[_0xaca0('0x31')][_0xaca0('0x32')],function(_0x3e07c8){return{'name':_0x3e07c8[_0xaca0('0x33')],'type':_0x3e07c8[_0xaca0('0x34')][_0xaca0('0x35')]};});_0x2f68cb['model']=_[_0xaca0('0x30')](_0x1cdff3,_0xaca0('0x2d'));_0x2f68cb[_0xaca0('0x36')]=_[_0xaca0('0x37')](_0x5b1ecc[_0xaca0('0x36')]);_0x2f68cb['filters']=_['intersection'](_0x2f68cb['model'],_0x2f68cb[_0xaca0('0x36')]);_0xf815e3[_0xaca0('0x38')]=_[_0xaca0('0x39')](_0x2f68cb[_0xaca0('0x3a')],qs[_0xaca0('0x3b')](_0x5b1ecc['query'][_0xaca0('0x3b')]));_0xf815e3[_0xaca0('0x38')]=_0xf815e3[_0xaca0('0x38')][_0xaca0('0x3c')]?_0xf815e3['attributes']:_0x2f68cb[_0xaca0('0x3a')];if(!_0x5b1ecc['query']['hasOwnProperty'](_0xaca0('0x3d'))){_0xf815e3[_0xaca0('0x25')]=qs[_0xaca0('0x25')](_0x5b1ecc['query']['limit']);_0xf815e3[_0xaca0('0x24')]=qs[_0xaca0('0x24')](_0x5b1ecc[_0xaca0('0x36')][_0xaca0('0x24')]);}_0xf815e3[_0xaca0('0x3e')]=qs['sort'](_0x5b1ecc[_0xaca0('0x36')][_0xaca0('0x3f')]);_0xf815e3[_0xaca0('0x40')]=qs[_0xaca0('0x41')](_[_0xaca0('0x42')](_0x5b1ecc['query'],_0x2f68cb[_0xaca0('0x41')]),_0x1cdff3);if(_0x5b1ecc['query'][_0xaca0('0x43')]){_0xf815e3[_0xaca0('0x40')]=_[_0xaca0('0x44')](_0xf815e3[_0xaca0('0x40')],{'$or':_[_0xaca0('0x30')](_0x1cdff3,function(_0x14c79e){if(_0x14c79e[_0xaca0('0x34')]!==_0xaca0('0x45')){var _0x222a49={};_0x222a49[_0x14c79e['name']]={'$like':'%'+_0x5b1ecc['query']['filter']+'%'};return _0x222a49;}})});}_0xf815e3=_[_0xaca0('0x44')]({},_0xf815e3,_0x5b1ecc[_0xaca0('0x46')]);var _0x370872={'where':_0xf815e3['where']};return db[_0xaca0('0x31')]['count'](_0x370872)[_0xaca0('0x29')](function(_0x56db2b){_0x5d2183[_0xaca0('0x27')]=_0x56db2b;if(_0x5b1ecc['query']['includeAll']){_0xf815e3[_0xaca0('0x47')]=[{'all':!![]}];}return db[_0xaca0('0x31')][_0xaca0('0x48')](_0xf815e3);})[_0xaca0('0x29')](function(_0x392c38){_0x5d2183[_0xaca0('0x49')]=_0x392c38;return _0x5d2183;})[_0xaca0('0x29')](respondWithFilteredResult(_0x250432,_0xf815e3))['catch'](handleError(_0x250432,null));};exports[_0xaca0('0x4a')]=function(_0x4dd086,_0xa4b07){var _0x2a6bc6={'raw':!![],'where':{'id':_0x4dd086[_0xaca0('0x4b')]['id']}},_0x593fc5={};_0x593fc5[_0xaca0('0x3a')]=_['keys'](db[_0xaca0('0x31')][_0xaca0('0x32')]);_0x593fc5[_0xaca0('0x36')]=_[_0xaca0('0x37')](_0x4dd086[_0xaca0('0x36')]);_0x593fc5[_0xaca0('0x41')]=_[_0xaca0('0x39')](_0x593fc5[_0xaca0('0x3a')],_0x593fc5[_0xaca0('0x36')]);_0x2a6bc6['attributes']=_[_0xaca0('0x39')](_0x593fc5['model'],qs[_0xaca0('0x3b')](_0x4dd086['query']['fields']));_0x2a6bc6[_0xaca0('0x38')]=_0x2a6bc6[_0xaca0('0x38')][_0xaca0('0x3c')]?_0x2a6bc6[_0xaca0('0x38')]:_0x593fc5[_0xaca0('0x3a')];if(_0x4dd086['query'][_0xaca0('0x4c')]){_0x2a6bc6[_0xaca0('0x47')]=[{'all':!![]}];}_0x2a6bc6=_[_0xaca0('0x44')]({},_0x2a6bc6,_0x4dd086['options']);return db['ChatGroup'][_0xaca0('0x4d')](_0x2a6bc6)[_0xaca0('0x29')](handleEntityNotFound(_0xa4b07,null))['then'](respondWithResult(_0xa4b07,null))[_0xaca0('0x4e')](handleError(_0xa4b07,null));};exports[_0xaca0('0x4f')]=function(_0x2e3885,_0x16f012){return db[_0xaca0('0x31')][_0xaca0('0x4f')](_0x2e3885['body'],{})[_0xaca0('0x29')](respondWithResult(_0x16f012,0xc9))[_0xaca0('0x4e')](handleError(_0x16f012,null));};exports['update']=function(_0x5856aa,_0x57637){if(_0x5856aa[_0xaca0('0x50')]['id']){delete _0x5856aa[_0xaca0('0x50')]['id'];}return db[_0xaca0('0x31')][_0xaca0('0x4d')]({'where':{'id':_0x5856aa[_0xaca0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x57637,null))[_0xaca0('0x29')](saveUpdates(_0x5856aa[_0xaca0('0x50')],null))[_0xaca0('0x29')](respondWithResult(_0x57637,null))['catch'](handleError(_0x57637,null));};exports[_0xaca0('0x2a')]=function(_0x666f06,_0x191a69){return db['ChatGroup'][_0xaca0('0x4d')]({'where':{'id':_0x666f06['params']['id']}})['then'](handleEntityNotFound(_0x191a69,null))[_0xaca0('0x29')](removeEntity(_0x191a69,null))[_0xaca0('0x4e')](handleError(_0x191a69,null));};exports[_0xaca0('0x51')]=function(_0x1d4708,_0x5791f8){return db[_0xaca0('0x31')][_0xaca0('0x51')]()[_0xaca0('0x29')](respondWithResult(_0x5791f8,null))['catch'](handleError(_0x5791f8,null));};exports[_0xaca0('0x52')]=function(_0x1faa66,_0x8e3436,_0x23da9e){return db['ChatInternalMessage'][_0xaca0('0x27')]({'where':{'ChatGroupId':_0x1faa66['params']['id'],'ToId':_0x1faa66[_0xaca0('0x53')]['id'],'read':![]}})[_0xaca0('0x29')](function(_0x37a7b1){return{'id':_[_0xaca0('0x54')](_0x1faa66[_0xaca0('0x4b')]['id']),'count':_0x37a7b1};})[_0xaca0('0x29')](respondWithResult(_0x8e3436,null))['catch'](handleError(_0x8e3436,null));};exports[_0xaca0('0x55')]=function(_0x4955b2,_0x26ab99,_0x493e95){return db[_0xaca0('0x31')]['find']({'where':{'id':_0x4955b2[_0xaca0('0x4b')]['id']}})[_0xaca0('0x29')](handleEntityNotFound(_0x26ab99,null))['then'](function(_0x4a7d6f){if(_0x4a7d6f){return _0x4a7d6f['addMembers'](_0x4955b2[_0xaca0('0x50')][_0xaca0('0x56')],_['omit'](_0x4955b2[_0xaca0('0x50')],['ids','id'])||{});}})[_0xaca0('0x29')](respondWithResult(_0x26ab99,null))[_0xaca0('0x4e')](handleError(_0x26ab99,null));};exports['getMembers']=function(_0x41289c,_0x5ca491,_0x1d1180){var _0x41971e={};var _0x69269c={};var _0x40e6ad;var _0x2cfb04;return db['ChatGroup'][_0xaca0('0x57')]({'where':{'id':_0x41289c[_0xaca0('0x4b')]['id']}})[_0xaca0('0x29')](handleEntityNotFound(_0x5ca491,null))[_0xaca0('0x29')](function(_0x23727a){if(_0x23727a){_0x40e6ad=_0x23727a;_0x69269c[_0xaca0('0x3a')]=_[_0xaca0('0x37')](db[_0xaca0('0x58')][_0xaca0('0x32')]);_0x69269c[_0xaca0('0x36')]=_['keys'](_0x41289c[_0xaca0('0x36')]);_0x69269c[_0xaca0('0x41')]=_[_0xaca0('0x39')](_0x69269c[_0xaca0('0x3a')],_0x69269c['query']);_0x41971e['attributes']=_[_0xaca0('0x39')](_0x69269c['model'],qs[_0xaca0('0x3b')](_0x41289c['query']['fields']));_0x41971e['attributes']=_0x41971e[_0xaca0('0x38')][_0xaca0('0x3c')]?_0x41971e[_0xaca0('0x38')]:_0x69269c[_0xaca0('0x3a')];_0x41971e[_0xaca0('0x3e')]=qs[_0xaca0('0x3f')](_0x41289c['query'][_0xaca0('0x3f')]);_0x41971e[_0xaca0('0x40')]=qs[_0xaca0('0x41')](_[_0xaca0('0x42')](_0x41289c['query'],_0x69269c[_0xaca0('0x41')]));if(_0x41289c[_0xaca0('0x36')][_0xaca0('0x43')]){_0x41971e[_0xaca0('0x40')]=_[_0xaca0('0x44')](_0x41971e[_0xaca0('0x40')],{'$or':_[_0xaca0('0x30')](_0x41971e[_0xaca0('0x38')],function(_0x2a0ece){var _0x5d5d10={};_0x5d5d10[_0x2a0ece]={'$like':'%'+_0x41289c['query'][_0xaca0('0x43')]+'%'};return _0x5d5d10;})});}_0x41971e=_[_0xaca0('0x44')]({},_0x41971e,_0x41289c[_0xaca0('0x46')]);return _0x40e6ad[_0xaca0('0x59')](_0x41971e);}})[_0xaca0('0x29')](function(_0x52da5e){if(_0x52da5e){_0x2cfb04=_0x52da5e[_0xaca0('0x3c')];if(!_0x41289c[_0xaca0('0x36')][_0xaca0('0x5a')]('nolimit')){_0x41971e['limit']=qs[_0xaca0('0x25')](_0x41289c[_0xaca0('0x36')][_0xaca0('0x25')]);_0x41971e[_0xaca0('0x24')]=qs[_0xaca0('0x24')](_0x41289c[_0xaca0('0x36')][_0xaca0('0x24')]);}return _0x40e6ad[_0xaca0('0x59')](_0x41971e);}})[_0xaca0('0x29')](function(_0x586346){if(_0x586346){return _0x586346?{'count':_0x2cfb04,'rows':_0x586346}:null;}})['then'](respondWithResult(_0x5ca491,null))[_0xaca0('0x4e')](handleError(_0x5ca491,null));};exports['removeMembers']=function(_0x1480ed,_0x10272f,_0x295139){return db['ChatGroup'][_0xaca0('0x4d')]({'where':{'id':_0x1480ed['params']['id']}})[_0xaca0('0x29')](handleEntityNotFound(_0x10272f,null))[_0xaca0('0x29')](function(_0x393a44){if(_0x393a44){return _0x393a44[_0xaca0('0x5b')](_0x1480ed[_0xaca0('0x36')][_0xaca0('0x56')]);}})[_0xaca0('0x29')](respondWithStatusCode(_0x10272f,null))[_0xaca0('0x4e')](handleError(_0x10272f,null));};exports[_0xaca0('0x5c')]=function(_0x3b59b3,_0x19e9d5,_0x1679e7){if(_0x3b59b3[_0xaca0('0x50')]['id']){delete _0x3b59b3[_0xaca0('0x50')]['id'];}return db[_0xaca0('0x31')][_0xaca0('0x4d')]({'where':{'id':_0x3b59b3[_0xaca0('0x4b')]['id']}})[_0xaca0('0x29')](handleEntityNotFound(_0x19e9d5,null))[_0xaca0('0x29')](function(_0x5664b7){if(_0x5664b7){_0x3b59b3[_0xaca0('0x50')][_0xaca0('0x5d')]=_0x5664b7['id'];return db[_0xaca0('0x5e')][_0xaca0('0x4f')](_0x3b59b3[_0xaca0('0x50')]);}})[_0xaca0('0x29')](respondWithResult(_0x19e9d5,null))['catch'](handleError(_0x19e9d5,null));};exports[_0xaca0('0x5f')]=function(_0x42de55,_0x50cffb,_0x9365d5){var _0x354ece={};var _0x495a81={};var _0x3c96c9;var _0x59d26c;return db[_0xaca0('0x31')]['findOne']({'where':{'id':_0x42de55[_0xaca0('0x4b')]['id']}})[_0xaca0('0x29')](handleEntityNotFound(_0x50cffb,null))[_0xaca0('0x29')](function(_0x37c384){if(_0x37c384){_0x3c96c9=_0x37c384;_0x495a81[_0xaca0('0x3a')]=_['keys'](db[_0xaca0('0x5e')][_0xaca0('0x32')]);_0x495a81[_0xaca0('0x36')]=_['keys'](_0x42de55[_0xaca0('0x36')]);_0x495a81[_0xaca0('0x41')]=_[_0xaca0('0x39')](_0x495a81['model'],_0x495a81[_0xaca0('0x36')]);_0x354ece[_0xaca0('0x38')]=_[_0xaca0('0x39')](_0x495a81[_0xaca0('0x3a')],qs['fields'](_0x42de55[_0xaca0('0x36')]['fields']));_0x354ece[_0xaca0('0x38')]=_0x354ece[_0xaca0('0x38')][_0xaca0('0x3c')]?_0x354ece[_0xaca0('0x38')]:_0x495a81[_0xaca0('0x3a')];_0x354ece[_0xaca0('0x3e')]=qs[_0xaca0('0x3f')](_0x42de55[_0xaca0('0x36')][_0xaca0('0x3f')]);_0x354ece[_0xaca0('0x40')]=qs[_0xaca0('0x41')](_[_0xaca0('0x42')](_0x42de55['query'],_0x495a81[_0xaca0('0x41')]));if(_0x42de55[_0xaca0('0x36')][_0xaca0('0x43')]){_0x354ece[_0xaca0('0x40')]=_[_0xaca0('0x44')](_0x354ece[_0xaca0('0x40')],{'$or':_['map'](_0x354ece[_0xaca0('0x38')],function(_0x6a6bb1){var _0x4d18e3={};_0x4d18e3[_0x6a6bb1]={'$like':'%'+_0x42de55[_0xaca0('0x36')][_0xaca0('0x43')]+'%'};return _0x4d18e3;})});}if(_0x42de55[_0xaca0('0x36')][_0xaca0('0x60')]){var _0x4d8e11=_0x42de55[_0xaca0('0x36')]['$gte'][_0xaca0('0x61')](',');var _0x287f43={};_0x287f43[_0x4d8e11[0x0]]={'$gte':moment(_0x4d8e11[0x1])['format'](_0xaca0('0x62'))};_0x354ece['where']=_[_0xaca0('0x44')](_0x354ece['where'],_0x287f43);}_0x354ece=_[_0xaca0('0x44')]({},_0x354ece,_0x42de55[_0xaca0('0x46')]);return _0x3c96c9[_0xaca0('0x5f')](_0x354ece);}})[_0xaca0('0x29')](function(_0x178683){if(_0x178683){_0x59d26c=_0x178683[_0xaca0('0x3c')];if(!_0x42de55[_0xaca0('0x36')][_0xaca0('0x5a')](_0xaca0('0x3d'))){_0x354ece['limit']=qs[_0xaca0('0x25')](_0x42de55[_0xaca0('0x36')][_0xaca0('0x25')]);_0x354ece[_0xaca0('0x24')]=qs[_0xaca0('0x24')](_0x42de55[_0xaca0('0x36')][_0xaca0('0x24')]);}return _0x3c96c9['getMessages'](_0x354ece);}})[_0xaca0('0x29')](function(_0x1a73bc){if(_0x1a73bc){return _0x1a73bc?{'count':_0x59d26c,'rows':_0x1a73bc}:null;}})[_0xaca0('0x29')](respondWithResult(_0x50cffb,null))[_0xaca0('0x4e')](handleError(_0x50cffb,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 5c643bd..054717a 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 _0x7d8a=['ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x7d8a,0x1ca));var _0xa7d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d8a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xa7d8('0x0'));var ChatGroup=require(_0xa7d8('0x1'))['db'][_0xa7d8('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xa7d8('0x3')](0x0);var events={'afterCreate':_0xa7d8('0x4'),'afterUpdate':_0xa7d8('0x5'),'afterDestroy':_0xa7d8('0x6')};function emitEvent(_0x2b5af1){return function(_0x14a7d3,_0x199cdd,_0x1162e1){ChatGroupEvents[_0xa7d8('0x7')](_0x2b5af1+':'+_0x14a7d3['id'],_0x14a7d3);ChatGroupEvents[_0xa7d8('0x7')](_0x2b5af1,_0x14a7d3);_0x1162e1(null);};}for(var e in events){if(events[_0xa7d8('0x8')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xa7d8('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0xef0f=['events','ChatGroup','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xef0f,0x168));var _0xfef0=function(_0x5b4b18,_0x1003ab){_0x5b4b18=_0x5b4b18-0x0;var _0x326467=_0xef0f[_0x5b4b18];return _0x326467;};'use strict';var EventEmitter=require(_0xfef0('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xfef0('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xfef0('0x2')](0x0);var events={'afterCreate':_0xfef0('0x3'),'afterUpdate':'update','afterDestroy':_0xfef0('0x4')};function emitEvent(_0x11ab77){return function(_0x4618fb,_0x4e1af6,_0x2a6fcf){ChatGroupEvents[_0xfef0('0x5')](_0x11ab77+':'+_0x4618fb['id'],_0x4618fb);ChatGroupEvents[_0xfef0('0x5')](_0x11ab77,_0x4618fb);_0x2a6fcf(null);};}for(var e in events){if(events[_0xfef0('0x6')](e)){var event=events[e];ChatGroup[_0xfef0('0x7')](e,emitEvent(event));}}module[_0xfef0('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 5f6c219..2c16929 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 _0x8501=['../../config/logger','api','moment','../../config/environment','exports','ChatGroup','chat_groups','lodash','util'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x8501,0x11e));var _0x1850=function(_0x49ad79,_0x48ee93){_0x49ad79=_0x49ad79-0x0;var _0xa4e38a=_0x8501[_0x49ad79];return _0xa4e38a;};'use strict';var _=require(_0x1850('0x0'));var util=require(_0x1850('0x1'));var logger=require(_0x1850('0x2'))(_0x1850('0x3'));var moment=require(_0x1850('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1850('0x5'));var attributes=require('./chatGroup.attributes');module[_0x1850('0x6')]=function(_0x4ffcc9,_0x453fab){return _0x4ffcc9['define'](_0x1850('0x7'),attributes,{'tableName':_0x1850('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x277e=['api','moment','bluebird','request-promise','exports','define','chat_groups','lodash','util','../../config/logger'];(function(_0x20c0e7,_0x4e172a){var _0x405098=function(_0x45853d){while(--_0x45853d){_0x20c0e7['push'](_0x20c0e7['shift']());}};_0x405098(++_0x4e172a);}(_0x277e,0x18d));var _0xe277=function(_0x22de53,_0x489cfe){_0x22de53=_0x22de53-0x0;var _0x492b77=_0x277e[_0x22de53];return _0x492b77;};'use strict';var _=require(_0xe277('0x0'));var util=require(_0xe277('0x1'));var logger=require(_0xe277('0x2'))(_0xe277('0x3'));var moment=require(_0xe277('0x4'));var BPromise=require(_0xe277('0x5'));var rp=require(_0xe277('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0xe277('0x7')]=function(_0x2d4d52,_0x2fecda){return _0x2d4d52[_0xe277('0x8')]('ChatGroup',attributes,{'tableName':_0xe277('0x9'),'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 f601867..64835d9 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 _0x514e=['info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','request','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x442955,_0x410333){var _0x14f4b3=function(_0x3f0bc3){while(--_0x3f0bc3){_0x442955['push'](_0x442955['shift']());}};_0x14f4b3(++_0x410333);}(_0x514e,0x146));var _0xe514=function(_0x3d260d,_0x52c05d){_0x3d260d=_0x3d260d-0x0;var _0x152dc1=_0x514e[_0x3d260d];return _0x152dc1;};'use strict';var _=require(_0xe514('0x0'));var util=require(_0xe514('0x1'));var moment=require(_0xe514('0x2'));var BPromise=require(_0xe514('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe514('0x4'));var db=require(_0xe514('0x5'))['db'];var utils=require(_0xe514('0x6'));var logger=require(_0xe514('0x7'))(_0xe514('0x8'));var config=require(_0xe514('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe514('0xa')][_0xe514('0xb')]({'port':0x232a});config[_0xe514('0xc')]=_[_0xe514('0xd')](config[_0xe514('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xe514('0xe'))(new Redis(config[_0xe514('0xc')]));require(_0xe514('0xf'))['register'](socket);function respondWithRpcPromise(_0x343e58,_0x1109cd,_0xc51a5d){return new BPromise(function(_0x5f07c9,_0x3f370){return client[_0xe514('0x10')](_0x343e58,_0xc51a5d)['then'](function(_0x3a6350){logger['info'](_0xe514('0x11'),_0x1109cd,_0xe514('0x12'));logger[_0xe514('0x13')](_0xe514('0x14'),_0x1109cd,'request\x20sent',JSON[_0xe514('0x15')](_0x3a6350));if(_0x3a6350['error']){if(_0x3a6350[_0xe514('0x16')][_0xe514('0x17')]===0x1f4){logger['error'](_0xe514('0x11'),_0x1109cd,_0x3a6350['error'][_0xe514('0x18')]);return _0x3f370(_0x3a6350[_0xe514('0x16')][_0xe514('0x18')]);}logger[_0xe514('0x16')](_0xe514('0x11'),_0x1109cd,_0x3a6350[_0xe514('0x16')]['message']);return _0x5f07c9(_0x3a6350[_0xe514('0x16')][_0xe514('0x18')]);}else{logger[_0xe514('0x19')]('ChatGroup,\x20%s,\x20%s',_0x1109cd,_0xe514('0x12'));_0x5f07c9(_0x3a6350['result']['message']);}})[_0xe514('0x1a')](function(_0x46d7d1){logger[_0xe514('0x16')](_0xe514('0x11'),_0x1109cd,_0x46d7d1);_0x3f370(_0x46d7d1);});});}
\ No newline at end of file
+var _0x858e=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','lodash','bluebird'];(function(_0x41b29e,_0x34b288){var _0xacd517=function(_0x3318df){while(--_0x3318df){_0x41b29e['push'](_0x41b29e['shift']());}};_0xacd517(++_0x34b288);}(_0x858e,0x178));var _0xe858=function(_0x5cd51d,_0x20d4fa){_0x5cd51d=_0x5cd51d-0x0;var _0x444608=_0x858e[_0x5cd51d];return _0x444608;};'use strict';var _=require(_0xe858('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe858('0x1'));var rs=require(_0xe858('0x2'));var fs=require('fs');var Redis=require(_0xe858('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe858('0x4'));var logger=require(_0xe858('0x5'))(_0xe858('0x6'));var config=require(_0xe858('0x7'));var jayson=require(_0xe858('0x8'));var client=jayson['client'][_0xe858('0x9')]({'port':0x232a});config[_0xe858('0xa')]=_['defaults'](config[_0xe858('0xa')],{'host':_0xe858('0xb'),'port':0x18eb});var socket=require(_0xe858('0xc'))(new Redis(config[_0xe858('0xa')]));require(_0xe858('0xd'))[_0xe858('0xe')](socket);function respondWithRpcPromise(_0x571ad6,_0x3ed125,_0x2dea6c){return new BPromise(function(_0x3677de,_0x128479){return client[_0xe858('0xf')](_0x571ad6,_0x2dea6c)[_0xe858('0x10')](function(_0x3014af){logger['info'](_0xe858('0x11'),_0x3ed125,'request\x20sent');logger[_0xe858('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x3ed125,_0xe858('0x13'),JSON[_0xe858('0x14')](_0x3014af));if(_0x3014af[_0xe858('0x15')]){if(_0x3014af['error'][_0xe858('0x16')]===0x1f4){logger[_0xe858('0x15')](_0xe858('0x11'),_0x3ed125,_0x3014af[_0xe858('0x15')]['message']);return _0x128479(_0x3014af[_0xe858('0x15')][_0xe858('0x17')]);}logger[_0xe858('0x15')]('ChatGroup,\x20%s,\x20%s',_0x3ed125,_0x3014af[_0xe858('0x15')]['message']);return _0x3677de(_0x3014af[_0xe858('0x15')][_0xe858('0x17')]);}else{logger[_0xe858('0x18')](_0xe858('0x11'),_0x3ed125,_0xe858('0x13'));_0x3677de(_0x3014af[_0xe858('0x19')][_0xe858('0x17')]);}})[_0xe858('0x1a')](function(_0x313401){logger['error']('ChatGroup,\x20%s,\x20%s',_0x3ed125,_0x313401);_0x128479(_0x313401);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 0738ba6..60d4025 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 _0x8b6b=['update','removeListener','register','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x8b6b,0x6d));var _0xb8b6=function(_0xcb93bc,_0x5e45ca){_0xcb93bc=_0xcb93bc-0x0;var _0x214eb1=_0x8b6b[_0xcb93bc];return _0x214eb1;};'use strict';var ChatGroupEvents=require(_0xb8b6('0x0'));var events=[_0xb8b6('0x1'),_0xb8b6('0x2'),_0xb8b6('0x3')];function createListener(_0x3fd6e3,_0x4e4608){return function(_0x5d461d){_0x4e4608['emit'](_0x3fd6e3,_0x5d461d);};}function removeListener(_0x40cad3,_0x411479){return function(){ChatGroupEvents[_0xb8b6('0x4')](_0x40cad3,_0x411479);};}exports[_0xb8b6('0x5')]=function(_0x339b16){for(var _0x27549c=0x0,_0x1707ce=events[_0xb8b6('0x6')];_0x27549c<_0x1707ce;_0x27549c++){var _0x6ec1d9=events[_0x27549c];var _0x275723=createListener(_0xb8b6('0x7')+_0x6ec1d9,_0x339b16);ChatGroupEvents['on'](_0x6ec1d9,_0x275723);}};
\ No newline at end of file
+var _0x5260=['update','emit','removeListener','register','remove'];(function(_0x4e6fc7,_0x6b9a5d){var _0x3c2ef6=function(_0x3907ed){while(--_0x3907ed){_0x4e6fc7['push'](_0x4e6fc7['shift']());}};_0x3c2ef6(++_0x6b9a5d);}(_0x5260,0xbd));var _0x0526=function(_0x5c7eb7,_0x3fbe3b){_0x5c7eb7=_0x5c7eb7-0x0;var _0x2cbfa8=_0x5260[_0x5c7eb7];return _0x2cbfa8;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x0526('0x0'),_0x0526('0x1')];function createListener(_0x295ca9,_0x5e67e4){return function(_0x13914c){_0x5e67e4[_0x0526('0x2')](_0x295ca9,_0x13914c);};}function removeListener(_0x1b5f24,_0x9a652d){return function(){ChatGroupEvents[_0x0526('0x3')](_0x1b5f24,_0x9a652d);};}exports[_0x0526('0x4')]=function(_0xb55cec){for(var _0x1b13c8=0x0,_0x160294=events['length'];_0x1b13c8<_0x160294;_0x1b13c8++){var _0x4e1c16=events[_0x1b13c8];var _0x39aa15=createListener('chatGroup:'+_0x4e1c16,_0xb55cec);ChatGroupEvents['on'](_0x4e1c16,_0x39aa15);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 0ec952c..a49a59e 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 _0x9981=['removeMembers','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id/unread','getUnread','getMembers','post','create','/:id/members','/:id/messages','put','delete','/:id','destroy'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x9981,0x1bc));var _0x1998=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9981[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require('multer');var util=require(_0x1998('0x0'));var path=require(_0x1998('0x1'));var timeout=require('connect-timeout');var express=require(_0x1998('0x2'));var router=express[_0x1998('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1998('0x4'));var interaction=require(_0x1998('0x5'));var config=require(_0x1998('0x6'));var controller=require(_0x1998('0x7'));router['get']('/',auth[_0x1998('0x8')](),controller[_0x1998('0x9')]);router[_0x1998('0xa')](_0x1998('0xb'),auth[_0x1998('0x8')](),controller[_0x1998('0xc')]);router['get']('/:id',auth[_0x1998('0x8')](),controller['show']);router[_0x1998('0xa')](_0x1998('0xd'),auth[_0x1998('0x8')](),controller[_0x1998('0xe')]);router[_0x1998('0xa')]('/:id/members',auth['isAuthenticated'](),controller[_0x1998('0xf')]);router[_0x1998('0xa')]('/:id/messages',auth[_0x1998('0x8')](),controller['getMessages']);router[_0x1998('0x10')]('/',auth['isAuthenticated'](),controller[_0x1998('0x11')]);router['post'](_0x1998('0x12'),auth[_0x1998('0x8')](),controller['addMembers']);router[_0x1998('0x10')](_0x1998('0x13'),auth['isAuthenticated'](),controller['addMessage']);router[_0x1998('0x14')]('/:id',auth[_0x1998('0x8')](),controller['update']);router[_0x1998('0x15')](_0x1998('0x16'),auth['isAuthenticated'](),controller[_0x1998('0x17')]);router[_0x1998('0x15')](_0x1998('0x12'),auth[_0x1998('0x8')](),controller[_0x1998('0x18')]);module[_0x1998('0x19')]=router;
\ No newline at end of file
+var _0x620b=['/:id/unread','getUnread','/:id/members','getMessages','post','create','addMembers','put','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','/:id','show'];(function(_0x2a56ad,_0x2b94bf){var _0x425175=function(_0x342f20){while(--_0x342f20){_0x2a56ad['push'](_0x2a56ad['shift']());}};_0x425175(++_0x2b94bf);}(_0x620b,0x157));var _0xb620=function(_0x15c420,_0x3c6b3c){_0x15c420=_0x15c420-0x0;var _0x5592d1=_0x620b[_0x15c420];return _0x5592d1;};'use strict';var multer=require(_0xb620('0x0'));var util=require(_0xb620('0x1'));var path=require(_0xb620('0x2'));var timeout=require(_0xb620('0x3'));var express=require(_0xb620('0x4'));var router=express[_0xb620('0x5')]();var fs_extra=require(_0xb620('0x6'));var auth=require(_0xb620('0x7'));var interaction=require(_0xb620('0x8'));var config=require(_0xb620('0x9'));var controller=require(_0xb620('0xa'));router['get']('/',auth[_0xb620('0xb')](),controller[_0xb620('0xc')]);router[_0xb620('0xd')](_0xb620('0xe'),auth[_0xb620('0xb')](),controller['describe']);router[_0xb620('0xd')](_0xb620('0xf'),auth[_0xb620('0xb')](),controller[_0xb620('0x10')]);router[_0xb620('0xd')](_0xb620('0x11'),auth[_0xb620('0xb')](),controller[_0xb620('0x12')]);router[_0xb620('0xd')](_0xb620('0x13'),auth['isAuthenticated'](),controller['getMembers']);router[_0xb620('0xd')]('/:id/messages',auth[_0xb620('0xb')](),controller[_0xb620('0x14')]);router[_0xb620('0x15')]('/',auth[_0xb620('0xb')](),controller[_0xb620('0x16')]);router['post']('/:id/members',auth[_0xb620('0xb')](),controller[_0xb620('0x17')]);router[_0xb620('0x15')]('/:id/messages',auth[_0xb620('0xb')](),controller['addMessage']);router[_0xb620('0x18')](_0xb620('0xf'),auth[_0xb620('0xb')](),controller[_0xb620('0x19')]);router[_0xb620('0x1a')](_0xb620('0xf'),auth[_0xb620('0xb')](),controller[_0xb620('0x1b')]);router[_0xb620('0x1a')](_0xb620('0x13'),auth['isAuthenticated'](),controller[_0xb620('0x1c')]);module[_0xb620('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 6b67bf3..8a45b7c 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 _0x8e44=['BOOLEAN','star','thumb','TEXT','STRING','DATE','long','out','sequelize','exports'];(function(_0x1b1c3d,_0x1f36ce){var _0x4f2fe5=function(_0x35263e){while(--_0x35263e){_0x1b1c3d['push'](_0x1b1c3d['shift']());}};_0x4f2fe5(++_0x1f36ce);}(_0x8e44,0x1ac));var _0x48e4=function(_0x344dc4,_0x50eb33){_0x344dc4=_0x344dc4-0x0;var _0x3e722f=_0x8e44[_0x344dc4];return _0x3e722f;};'use strict';var Sequelize=require(_0x48e4('0x0'));module[_0x48e4('0x1')]={'closed':{'type':Sequelize[_0x48e4('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x48e4('0x3'),_0x48e4('0x4')),'defaultValue':_0x48e4('0x3')},'ratingMessage':{'type':Sequelize[_0x48e4('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x48e4('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x48e4('0x7')]},'disposition':{'type':Sequelize[_0x48e4('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x48e4('0x6')]},'browserName':{'type':Sequelize[_0x48e4('0x6')]},'browserVersion':{'type':Sequelize[_0x48e4('0x6')]},'osName':{'type':Sequelize[_0x48e4('0x6')]},'osVersion':{'type':Sequelize[_0x48e4('0x6')]},'deviceModel':{'type':Sequelize[_0x48e4('0x6')]},'deviceVendor':{'type':Sequelize[_0x48e4('0x6')]},'deviceType':{'type':Sequelize[_0x48e4('0x6')]},'referer':{'type':Sequelize[_0x48e4('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x48e4('0x5')](_0x48e4('0x8'))},'read1stAt':{'type':Sequelize[_0x48e4('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x48e4('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x48e4('0x6')]},'customerPort':{'type':Sequelize[_0x48e4('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x48e4('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xdf92=['ENUM','star','thumb','TEXT','STRING','DATE','long','BOOLEAN','sequelize','INTEGER'];(function(_0x48e1ec,_0x35f468){var _0x3b33eb=function(_0x507bf9){while(--_0x507bf9){_0x48e1ec['push'](_0x48e1ec['shift']());}};_0x3b33eb(++_0x35f468);}(_0xdf92,0x10c));var _0x2df9=function(_0x284142,_0x3b65a8){_0x284142=_0x284142-0x0;var _0x3e8e47=_0xdf92[_0x284142];return _0x3e8e47;};'use strict';var Sequelize=require(_0x2df9('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2df9('0x1')]},'ratingType':{'type':Sequelize[_0x2df9('0x2')](_0x2df9('0x3'),_0x2df9('0x4')),'defaultValue':_0x2df9('0x3')},'ratingMessage':{'type':Sequelize[_0x2df9('0x5')]},'pathTranscript':{'type':Sequelize[_0x2df9('0x5')]},'mailTranscript':{'type':Sequelize[_0x2df9('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2df9('0x7')]},'disposition':{'type':Sequelize[_0x2df9('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2df9('0x6')]},'note':{'type':Sequelize[_0x2df9('0x6')]},'browserName':{'type':Sequelize[_0x2df9('0x6')]},'browserVersion':{'type':Sequelize[_0x2df9('0x6')]},'osName':{'type':Sequelize[_0x2df9('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x2df9('0x6')]},'deviceVendor':{'type':Sequelize[_0x2df9('0x6')]},'deviceType':{'type':Sequelize[_0x2df9('0x6')]},'referer':{'type':Sequelize[_0x2df9('0x5')]},'customerIp':{'type':Sequelize[_0x2df9('0x6')]},'formData':{'type':Sequelize[_0x2df9('0x5')](_0x2df9('0x8'))},'read1stAt':{'type':Sequelize[_0x2df9('0x7')]},'lastMsgAt':{'type':Sequelize[_0x2df9('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2df9('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x2df9('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x2df9('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 942e4d7..3560e08 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 _0xf76c=['err','unlinkSync','rimraf','request-promise','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','debug','request\x20sent','error','code','message','ChatInteraction,\x20%s,\x20%s','result','catch','status','end','json','offset','undefined','count','set','Content-Range','stack','name','send','render','merge','agent','interaction','account','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','user','show','model','keys','filters','attributes','fields','includeAll','create','body','update','find','params','destroy','describe','ChatInteraction','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooApiKey','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','disposition','originalname','basename','file','mimetype','Attachment','attachmentDownload','closed','attachId','join','root','offline-chat/','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','Messages','User','length','UserId','%s%d','agentAlias','System','Visitor','ContactId','agentIdentifier','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','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','nolimit','limit','order','sort','where','pick','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','options','include','rows','ChatInteractionId','map','includeAgent','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','download','toString','server','files','tmp','attachments','transcript-%d-%s.zip','push','fullname','firstName','lastName','read','Account','Owner','get','mkdirSync','N.A.','osName','referer','customerIp','customerPort','tail','createReadStream','pipe','out','renderFile','views','.pdf','createPdfFromHTML'];(function(_0x47bf73,_0x5a4957){var _0x419b53=function(_0x24ed96){while(--_0x24ed96){_0x47bf73['push'](_0x47bf73['shift']());}};_0x419b53(++_0x5a4957);}(_0xf76c,0x1a6));var _0xcf76=function(_0x386b03,_0x5d0000){_0x386b03=_0x386b03-0x0;var _0xd3d524=_0xf76c[_0x386b03];return _0xd3d524;};'use strict';var rimraf=require(_0xcf76('0x0'));var zipdir=require('zip-dir');var rp=require(_0xcf76('0x1'));var moment=require('moment');var BPromise=require(_0xcf76('0x2'));var Mustache=require(_0xcf76('0x3'));var util=require(_0xcf76('0x4'));var path=require(_0xcf76('0x5'));var ejs=require(_0xcf76('0x6'));var fs=require('fs');var _=require(_0xcf76('0x7'));var Redis=require(_0xcf76('0x8'));var interaction=require(_0xcf76('0x9'));var qs=require(_0xcf76('0xa'));var pdf=require(_0xcf76('0xb'));var logger=require(_0xcf76('0xc'))(_0xcf76('0xd'));var config=require(_0xcf76('0xe'));var db=require(_0xcf76('0xf'))['db'];config[_0xcf76('0x10')]=_[_0xcf76('0x11')](config[_0xcf76('0x10')],{'host':_0xcf76('0x12'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcf76('0x10')]));require(_0xcf76('0x13'))[_0xcf76('0x14')](socket);var jayson=require(_0xcf76('0x15'));var client=jayson[_0xcf76('0x16')][_0xcf76('0x17')]({'port':0x232b});var client9004=jayson['client'][_0xcf76('0x17')]({'port':0x232c});function respondWithRpcPromise(_0xd53272,_0x43ac07,_0x36ac3e,_0x19bef8){return new BPromise(function(_0x1d244c,_0x2c699b){var _0x257966=_0x19bef8||client;return _0x257966[_0xcf76('0x18')](_0xd53272,_0x36ac3e)[_0xcf76('0x19')](function(_0x2db105){logger[_0xcf76('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x43ac07,'request\x20sent');logger[_0xcf76('0x1b')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x43ac07,_0xcf76('0x1c'),JSON['stringify'](_0x2db105));if(_0x2db105[_0xcf76('0x1d')]){if(_0x2db105['error'][_0xcf76('0x1e')]===0x1f4){logger[_0xcf76('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x43ac07,_0x2db105[_0xcf76('0x1d')][_0xcf76('0x1f')]);return _0x2c699b(_0x2db105[_0xcf76('0x1d')][_0xcf76('0x1f')]);}logger[_0xcf76('0x1d')](_0xcf76('0x20'),_0x43ac07,_0x2db105[_0xcf76('0x1d')][_0xcf76('0x1f')]);return _0x1d244c(_0x2db105[_0xcf76('0x1d')][_0xcf76('0x1f')]);}else{logger[_0xcf76('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x43ac07,_0xcf76('0x1c'));_0x1d244c(_0x2db105[_0xcf76('0x21')][_0xcf76('0x1f')]);}})[_0xcf76('0x22')](function(_0x106a82){logger[_0xcf76('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x43ac07,_0x106a82);_0x2c699b(_0x106a82);});});}function respondWithStatusCode(_0x5d65a8,_0x283513){_0x283513=_0x283513||0xcc;return function(_0x62e6f9){if(_0x62e6f9){return _0x5d65a8['sendStatus'](_0x283513);}return _0x5d65a8[_0xcf76('0x23')](_0x283513)[_0xcf76('0x24')]();};}function respondWithResult(_0x42ee71,_0x1c2b0c){_0x1c2b0c=_0x1c2b0c||0xc8;return function(_0x591ebb){if(_0x591ebb){return _0x42ee71['status'](_0x1c2b0c)[_0xcf76('0x25')](_0x591ebb);}};}function respondWithFilteredResult(_0x51dd39,_0x28bb36){return function(_0x17f6ce){if(_0x17f6ce){var _0x242ee6=typeof _0x28bb36[_0xcf76('0x26')]===_0xcf76('0x27')&&typeof _0x28bb36['limit']===_0xcf76('0x27');var _0x17e87b=_0x17f6ce['count'];var _0x219c91=_0x242ee6?0x0:_0x28bb36[_0xcf76('0x26')];var _0x4b087c=_0x242ee6?_0x17f6ce[_0xcf76('0x28')]:_0x28bb36['offset']+_0x28bb36['limit'];var _0x112e32;if(_0x4b087c>=_0x17e87b){_0x4b087c=_0x17e87b;_0x112e32=0xc8;}else{_0x112e32=0xce;}_0x51dd39['status'](_0x112e32);return _0x51dd39[_0xcf76('0x29')](_0xcf76('0x2a'),_0x219c91+'-'+_0x4b087c+'/'+_0x17e87b)[_0xcf76('0x25')](_0x17f6ce);}return null;};}function saveUpdates(_0x153936){return function(_0x43ce25){if(_0x43ce25){return _0x43ce25['update'](_0x153936)[_0xcf76('0x19')](function(_0x23ef9e){return _0x23ef9e;});}return null;};}function removeEntity(_0x1b5635){return function(_0x9f461c){if(_0x9f461c){return _0x9f461c['destroy']()[_0xcf76('0x19')](function(){_0x1b5635['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe3c876){return function(_0x25f278){if(!_0x25f278){_0xe3c876['sendStatus'](0x194);}return _0x25f278;};}function handleError(_0x5a4c58,_0x25f3af){_0x25f3af=_0x25f3af||0x1f4;return function(_0x5f2249){logger[_0xcf76('0x1d')](_0x5f2249[_0xcf76('0x2b')]);if(_0x5f2249[_0xcf76('0x2c')]){delete _0x5f2249[_0xcf76('0x2c')];}_0x5a4c58[_0xcf76('0x23')](_0x25f3af)[_0xcf76('0x2d')](_0x5f2249);};}function getMustacheRender(_0x4f3d29,_0x4931ff){return Mustache[_0xcf76('0x2e')](_0x4f3d29,_[_0xcf76('0x2f')](_0x4931ff['body'],{'contact':_0x4931ff['contact'],'message':_0x4931ff[_0xcf76('0x1f')],'agent':_0x4931ff[_0xcf76('0x30')],'interaction':_0x4931ff[_0xcf76('0x31')],'account':_0x4931ff[_0xcf76('0x32')]}))||'';}exports['index']=function(_0x44e971,_0x5ca8c1){var _0x48cc54={};var _0x33f0cb=_['map'](db['ChatInteraction'][_0xcf76('0x33')],function(_0x406e90){return{'name':_0x406e90[_0xcf76('0x34')],'type':_0x406e90[_0xcf76('0x35')][_0xcf76('0x36')]};});_0x48cc54=qs[_0xcf76('0x37')](_0x33f0cb,_0x44e971);return interaction[_0xcf76('0x38')](_0xcf76('0x39'),_0x44e971[_0xcf76('0x3a')],_0x44e971[_0xcf76('0x3b')],_0x48cc54,_0x33f0cb)[_0xcf76('0x19')](respondWithFilteredResult(_0x5ca8c1,_0x48cc54))[_0xcf76('0x22')](handleError(_0x5ca8c1,null));};exports[_0xcf76('0x3c')]=function(_0x56edaf,_0x14ab99){var _0x5452e7={'raw':![],'where':{'id':_0x56edaf['params']['id']}},_0x241926={};_0x241926[_0xcf76('0x3d')]=_[_0xcf76('0x3e')](db['ChatInteraction'][_0xcf76('0x33')]);_0x241926[_0xcf76('0x3a')]=_[_0xcf76('0x3e')](_0x56edaf[_0xcf76('0x3a')]);_0x241926[_0xcf76('0x3f')]=_['intersection'](_0x241926[_0xcf76('0x3d')],_0x241926[_0xcf76('0x3a')]);_0x5452e7[_0xcf76('0x40')]=_['intersection'](_0x241926['model'],qs[_0xcf76('0x41')](_0x56edaf[_0xcf76('0x3a')][_0xcf76('0x41')]));_0x5452e7[_0xcf76('0x40')]=_0x5452e7[_0xcf76('0x40')]['length']?_0x5452e7[_0xcf76('0x40')]:_0x241926[_0xcf76('0x3d')];if(_0x56edaf[_0xcf76('0x3a')][_0xcf76('0x42')]){_0x5452e7['include']=[{'all':!![]}];}_0x5452e7=_[_0xcf76('0x2f')]({},_0x5452e7,_0x56edaf['options']);return db['ChatInteraction']['find'](_0x5452e7)['then'](handleEntityNotFound(_0x14ab99,null))[_0xcf76('0x19')](respondWithResult(_0x14ab99,null))['catch'](handleError(_0x14ab99,null));};exports[_0xcf76('0x43')]=function(_0x5a3f01,_0x511c9c){return db['ChatInteraction'][_0xcf76('0x43')](_0x5a3f01[_0xcf76('0x44')],{})[_0xcf76('0x19')](respondWithResult(_0x511c9c,0xc9))[_0xcf76('0x22')](handleError(_0x511c9c,null));};exports[_0xcf76('0x45')]=function(_0x55faa4,_0x292e65){if(_0x55faa4[_0xcf76('0x44')]['id']){delete _0x55faa4[_0xcf76('0x44')]['id'];}return db['ChatInteraction'][_0xcf76('0x46')]({'where':{'id':_0x55faa4[_0xcf76('0x47')]['id']}})[_0xcf76('0x19')](handleEntityNotFound(_0x292e65,null))[_0xcf76('0x19')](saveUpdates(_0x55faa4[_0xcf76('0x44')],null))[_0xcf76('0x19')](respondWithResult(_0x292e65,null))[_0xcf76('0x22')](handleError(_0x292e65,null));};exports[_0xcf76('0x48')]=function(_0x47e990,_0x88dde9){return db['ChatInteraction'][_0xcf76('0x46')]({'where':{'id':_0x47e990['params']['id']}})[_0xcf76('0x19')](handleEntityNotFound(_0x88dde9,null))[_0xcf76('0x19')](removeEntity(_0x88dde9,null))[_0xcf76('0x22')](handleError(_0x88dde9,null));};exports[_0xcf76('0x49')]=function(_0x54eb6b,_0x5d8b95){return db[_0xcf76('0x4a')][_0xcf76('0x49')]()[_0xcf76('0x19')](respondWithResult(_0x5d8b95,null))[_0xcf76('0x22')](handleError(_0x5d8b95,null));};exports[_0xcf76('0x4b')]=function(_0x1be64b,_0x50ae6a){var _0x5b4857=_0x1be64b[_0xcf76('0x47')]['id'];var _0x45dec8;var _0x4817ca;var _0x392dfc;return db['ChatInteraction'][_0xcf76('0x4c')]({'where':{'id':_0x5b4857}})['then'](function(_0x2bb951){_0x45dec8=_0x2bb951;return db[_0xcf76('0x4d')][_0xcf76('0x4c')]({'where':{'id':_0x2bb951[_0xcf76('0x4e')]},'attributes':['id','vidaooApiKey',_0xcf76('0x4f'),_0xcf76('0x50'),'vidaooNote','vidaooMetadata'],'raw':!![]});})['then'](function(_0x5bf40e){if(_0x5bf40e&&_0x5bf40e[_0xcf76('0x51')]&&_0x5bf40e[_0xcf76('0x4f')]){_0x4817ca=_0x5bf40e;var _0x385515={'interaction':{'id':_0x5b4857},'agent':{'id':_0x1be64b['user']['id'],'name':_0x1be64b[_0xcf76('0x3b')]['name'],'fullname':_0x1be64b[_0xcf76('0x3b')]['fullname'],'email':_0x1be64b[_0xcf76('0x3b')][_0xcf76('0x52')]},'contact':_0x1be64b[_0xcf76('0x44')][_0xcf76('0x53')],'account':_0x1be64b['body'][_0xcf76('0x32')]};var _0x517bce={'rejectUnauthorized':![],'method':_0xcf76('0x54'),'url':_0xcf76('0x55'),'headers':{'X-APIKEY':_0x5bf40e[_0xcf76('0x51')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1be64b['user'][_0xcf76('0x52')]],'buttons':null,'topic':_0x4817ca[_0xcf76('0x50')],'note':_[_0xcf76('0x56')](_0x4817ca[_0xcf76('0x57')])?null:getMustacheRender(_0x4817ca[_0xcf76('0x57')],_0x385515),'metadata':null},'redirect':_0xcf76('0x58'),'json':!![]};try{if(!_[_0xcf76('0x56')](_0x4817ca[_0xcf76('0x59')])){var _0x55292a=getMustacheRender(_0x4817ca['vidaooMetadata'],_0x385515);var _0x1a67d0=JSON['parse'](_0x55292a);_0x517bce['body'][_0xcf76('0x5a')]=_0x1a67d0;}}catch(_0x192a49){throw new db['Sequelize'][(_0xcf76('0x5b'))](_0xcf76('0x5c'));}return rp(_0x517bce);}else{throw new db[(_0xcf76('0x5d'))]['ValidationError'](_0xcf76('0x5e'));}})[_0xcf76('0x19')](function(_0x25753c){_0x392dfc=_0x25753c;if(_0x392dfc['id']){var _0x21db63={'body':_0x392dfc[_0xcf76('0x5f')],'ChatWebsiteId':_0x4817ca['id'],'ChatInteractionId':_0x45dec8['id'],'direction':'out','UserId':_0x1be64b[_0xcf76('0x3b')]['id']};return db[_0xcf76('0x60')][_0xcf76('0x43')](_0x21db63,{});}else{throw new db[(_0xcf76('0x5d'))][(_0xcf76('0x5b'))](_0xcf76('0x61'));}})[_0xcf76('0x19')](function(){return _0x45dec8[_0xcf76('0x62')]({'vidaooSessionId':_0x392dfc['id']});})['then'](respondWithResult(_0x50ae6a,null))[_0xcf76('0x22')](handleError(_0x50ae6a,null));};exports['customUpdate']=function(_0x323221,_0x5a76dd){if(_0x323221[_0xcf76('0x44')]['id']){delete _0x323221[_0xcf76('0x44')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x323221[_0xcf76('0x47')]['id']},'include':[{'model':db[_0xcf76('0x63')],'as':_0xcf76('0x64')}]})['then'](handleEntityNotFound(_0x5a76dd,null))[_0xcf76('0x19')](saveUpdates(_0x323221[_0xcf76('0x44')],null))[_0xcf76('0x19')](respondWithResult(_0x5a76dd,null))[_0xcf76('0x22')](handleError(_0x5a76dd,null));};exports['abandon']=function(_0x3d3319,_0x4748e3){if(_0x3d3319[_0xcf76('0x44')]['id']){delete _0x3d3319[_0xcf76('0x44')]['id'];}return db[_0xcf76('0x4a')][_0xcf76('0x46')]({'where':{'id':_0x3d3319[_0xcf76('0x47')]['id']}})[_0xcf76('0x19')](function(_0x205416){if(!_0x205416){logger[_0xcf76('0x1d')](_0xcf76('0x65'),_0xcf76('0x66'),0x194,_0xcf76('0x67'));_0x4748e3[_0xcf76('0x68')](0x194);}else{if(_0x205416['UserId']){throw new db[(_0xcf76('0x5d'))][(_0xcf76('0x5b'))](_0xcf76('0x69'));}}return _0x205416;})[_0xcf76('0x19')](function(_0x4a3fe8){if(_0x4a3fe8){return _0x4a3fe8[_0xcf76('0x45')]({'closed':_0x3d3319[_0xcf76('0x44')]['closed'],'disposition':_0x3d3319['body'][_0xcf76('0x6a')]})['then'](function(_0x1dad94){return _0x1dad94;});}})[_0xcf76('0x19')](function(){return respondWithRpcPromise('AbandonInteraction',_0xcf76('0x66'),_0x3d3319['body'],client9004);})[_0xcf76('0x19')](respondWithResult(_0x4748e3,null))[_0xcf76('0x22')](handleError(_0x4748e3,null));};exports['attachmentUpload']=function(_0x3bd8a9,_0x193c12){_0x3bd8a9[_0xcf76('0x44')][_0xcf76('0x2c')]=_0x3bd8a9['file'][_0xcf76('0x6b')];_0x3bd8a9['body'][_0xcf76('0x6c')]=_0x3bd8a9[_0xcf76('0x6d')]['filename'];_0x3bd8a9[_0xcf76('0x44')][_0xcf76('0x35')]=_0x3bd8a9[_0xcf76('0x6d')][_0xcf76('0x6e')];return db[_0xcf76('0x6f')][_0xcf76('0x43')](_0x3bd8a9['body'])[_0xcf76('0x19')](respondWithResult(_0x193c12,0xc9))['catch'](handleError(_0x193c12,null));};exports[_0xcf76('0x70')]=function(_0x39a12c,_0x2373e7){return db['ChatInteraction'][_0xcf76('0x4c')]({'where':{'id':_0x39a12c['params']['id']},'raw':!![]})[_0xcf76('0x19')](handleEntityNotFound(_0x2373e7,null))[_0xcf76('0x19')](function(_0x517f35){if(_0x517f35){if(_0x517f35[_0xcf76('0x71')]){return _0x2373e7[_0xcf76('0x23')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0xcf76('0x6f')]['findOne']({'where':{'id':_0x39a12c[_0xcf76('0x3a')][_0xcf76('0x72')]},'raw':!![]})[_0xcf76('0x19')](handleEntityNotFound(_0x2373e7,null));}})[_0xcf76('0x19')](function(_0x38e7ab){if(_0x38e7ab){var _0x19d698=_0x38e7ab['ChatOfflineMessageId']!==null;var _0x2a3947=path[_0xcf76('0x73')](config[_0xcf76('0x74')],'server/files/attachments/');if(_0x19d698){_0x2a3947=path[_0xcf76('0x73')](_0x2a3947,_0xcf76('0x75'));}var _0x5dd019=path[_0xcf76('0x73')](_0x2a3947,_0x38e7ab[_0xcf76('0x6c')]);return _0x2373e7['download'](_0x5dd019);}})['catch'](handleError(_0x2373e7,null));};exports['close']=function(_0x2713bf,_0x3ff543){var _0x46bf36=null;var _0x2b20d0=null;var _0x5e3f84=null;if(_0x2713bf[_0xcf76('0x44')]['id']){delete _0x2713bf[_0xcf76('0x44')]['id'];}if(_0x2713bf[_0xcf76('0x44')][_0xcf76('0x76')]){_0x5e3f84=path[_0xcf76('0x73')](config['root'],_0xcf76('0x77'),util[_0xcf76('0x78')]('transcript-%s.txt',Date[_0xcf76('0x79')]()));_0x2713bf['body'][_0xcf76('0x7a')]=_0x5e3f84;}return db[_0xcf76('0x4a')]['find']({'where':{'id':_0x2713bf[_0xcf76('0x47')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xcf76('0x7b'),'include':[{'model':db['User'],'as':_0xcf76('0x7c')}]}]})[_0xcf76('0x19')](handleEntityNotFound(_0x3ff543,null))[_0xcf76('0x19')](saveUpdates(_0x2713bf['body'],null))[_0xcf76('0x19')](function(_0xdf40c4){if(_0xdf40c4){_0x46bf36=_0xdf40c4;return db['ChatWebsite'][_0xcf76('0x46')]({'where':{'id':_0x46bf36['ChatWebsiteId']}});}})['then'](function(_0x5e6352){if(_0x5e6352){_0x2b20d0=_0x5e6352;return db[_0xcf76('0x63')][_0xcf76('0x46')]({'where':{'id':_0x46bf36['ContactId']}});}})['then'](function(_0x57b3f7){if(_0x57b3f7){if(_0x5e3f84){var _0x47f60a=null;for(var _0x570b31=0x1;_0x570b31<_0x46bf36['Messages'][_0xcf76('0x7d')];++_0x570b31){_0x47f60a=_0x46bf36[_0xcf76('0x7b')][_0x570b31];var _0x45aa22=_0x47f60a[_0xcf76('0x7e')]?util[_0xcf76('0x78')](_0xcf76('0x7f'),_0x2b20d0[_0xcf76('0x80')],_0x47f60a[_0xcf76('0x7e')]):_0xcf76('0x81');var _0x176f25=_0x2713bf[_0xcf76('0x44')]['customer']||util[_0xcf76('0x78')]('%s%d',_0xcf76('0x82'),_0x47f60a[_0xcf76('0x83')]);switch(_0x2b20d0[_0xcf76('0x84')]){case _0xcf76('0x85'):_0x45aa22=_0x47f60a[_0xcf76('0x7e')]?util['format'](_0xcf76('0x7f'),_0x2b20d0['agentAlias'],_0x47f60a['UserId']):'System';break;case'agent_alias':_0x45aa22=_0x47f60a[_0xcf76('0x7e')]?_0x47f60a['User'][_0xcf76('0x86')]||_0x47f60a['User']['fullname']:_0xcf76('0x81');break;case _0xcf76('0x87'):_0x45aa22=_0x47f60a['UserId']?_0x47f60a['User']['fullname']:_0xcf76('0x81');break;default:_0x45aa22=_0x47f60a['UserId']?util[_0xcf76('0x78')](_0xcf76('0x7f'),_0x2b20d0['agentAlias'],_0x47f60a[_0xcf76('0x7e')]):_0xcf76('0x81');}var _0x28e923=util[_0xcf76('0x78')](_0xcf76('0x88'),moment(_0x47f60a[_0xcf76('0x89')])[_0xcf76('0x78')](_0xcf76('0x8a')),_0x47f60a[_0xcf76('0x8b')]==='in'?_0x176f25:_0x45aa22,_0x47f60a[_0xcf76('0x44')]);if(!_0x47f60a[_0xcf76('0x8c')]){fs[_0xcf76('0x8d')](_0x5e3f84,_0x28e923);}}return db[_0xcf76('0x8e')][_0xcf76('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0xcf76('0x8f')],'as':_0xcf76('0x90'),'raw':!![],'include':[{'model':db[_0xcf76('0x91')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xcf76('0x19')](function(_0x3b10fa){if(!_0x3b10fa||!_0x3b10fa[_0xcf76('0x90')]||!_0x2713bf[_0xcf76('0x44')])return _0x46bf36;var _0x3495be=_0x3b10fa['getSmtpOptions']();return respondWithRpcPromise(_0xcf76('0x92'),_0xcf76('0x93'),{'account':_0x3495be,'message':{'from':util[_0xcf76('0x78')](_0xcf76('0x94'),_0x3b10fa[_0xcf76('0x2c')],_0x3b10fa[_0xcf76('0x52')]||_0x3b10fa[_0xcf76('0x90')]['user']),'to':_0x2713bf[_0xcf76('0x44')][_0xcf76('0x76')],'subject':_0xcf76('0x95'),'text':util[_0xcf76('0x78')](_0xcf76('0x96'),_0x2713bf[_0xcf76('0x44')][_0xcf76('0x76')]),'attachments':[{'path':_0x5e3f84}]}})['then'](function(){return _0x46bf36;})[_0xcf76('0x22')](function(_0xc2e55f){logger[_0xcf76('0x1d')](_0xc2e55f);});})[_0xcf76('0x19')](respondWithStatusCode(_0x3ff543,0xc8))['catch'](handleError(_0x3ff543,null));};exports[_0xcf76('0x97')]=function(_0x1fb71c,_0x263f99){return db['ChatMessage']['find']({'where':{'id':_0x1fb71c[_0xcf76('0x47')]['id']}})['then'](handleEntityNotFound(_0x263f99,null))[_0xcf76('0x19')](function(_0x51fd5b){if(_0x51fd5b){return _0x51fd5b[_0xcf76('0x97')](_0x1fb71c['body'][_0xcf76('0x98')],_[_0xcf76('0x99')](_0x1fb71c[_0xcf76('0x44')],[_0xcf76('0x98'),'id'])||{});}})[_0xcf76('0x19')](respondWithResult(_0x263f99,null))[_0xcf76('0x22')](handleError(_0x263f99,null));};exports[_0xcf76('0x9a')]=function(_0x428358,_0x407ce3){var _0x4e120f={'raw':![],'where':{}};var _0x1ee457={};var _0x20ffb5={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xcf76('0x4c')]({'where':{'id':_0x428358[_0xcf76('0x47')]['id']}})[_0xcf76('0x19')](handleEntityNotFound(_0x407ce3,null))['then'](function(_0x42e635){if(_0x42e635){_0x1ee457[_0xcf76('0x3d')]=_[_0xcf76('0x3e')](db['ChatMessage'][_0xcf76('0x33')]);_0x1ee457[_0xcf76('0x3a')]=_['keys'](_0x428358['query']);_0x1ee457[_0xcf76('0x3f')]=_[_0xcf76('0x9b')](_0x1ee457[_0xcf76('0x3d')],_0x1ee457[_0xcf76('0x3a')]);_0x4e120f['attributes']=_[_0xcf76('0x9b')](_0x1ee457['model'],qs[_0xcf76('0x41')](_0x428358[_0xcf76('0x3a')][_0xcf76('0x41')]));_0x4e120f[_0xcf76('0x40')]=_0x4e120f['attributes'][_0xcf76('0x7d')]?_0x4e120f[_0xcf76('0x40')]:_0x1ee457[_0xcf76('0x3d')];if(!_0x428358[_0xcf76('0x3a')]['hasOwnProperty'](_0xcf76('0x9c'))){_0x4e120f['limit']=qs[_0xcf76('0x9d')](_0x428358['query'][_0xcf76('0x9d')]);_0x4e120f[_0xcf76('0x26')]=qs['offset'](_0x428358[_0xcf76('0x3a')]['offset']);}_0x4e120f[_0xcf76('0x9e')]=qs[_0xcf76('0x9f')](_0x428358[_0xcf76('0x3a')]['sort']);_0x4e120f[_0xcf76('0xa0')]=qs[_0xcf76('0x3f')](_[_0xcf76('0xa1')](_0x428358[_0xcf76('0x3a')],_0x1ee457[_0xcf76('0x3f')]));_0x4e120f['where']['ChatInteractionId']=_0x42e635['id'];if(_0x428358[_0xcf76('0x3a')][_0xcf76('0xa2')]){_0x4e120f[_0xcf76('0xa0')]=_[_0xcf76('0x2f')](_0x4e120f[_0xcf76('0xa0')],{'$or':_['map'](_0x4e120f[_0xcf76('0x40')],function(_0xc0d98a){var _0x385f23={};_0x385f23[_0xc0d98a]={'$like':'%'+_0x428358[_0xcf76('0x3a')]['filter']+'%'};return _0x385f23;})});}if(_0x428358[_0xcf76('0x3a')][_0xcf76('0xa3')]){var _0x5eae95=_0x428358['query'][_0xcf76('0xa3')]['split'](',');var _0x207a36={};_0x207a36[_0x5eae95[0x0]]={'$gte':moment(_0x5eae95[0x1])['format'](_0xcf76('0xa4'))};_0x4e120f[_0xcf76('0xa0')]=_[_0xcf76('0x2f')](_0x4e120f[_0xcf76('0xa0')],_0x207a36);}_0x4e120f=_['merge']({},_0x4e120f,_0x428358[_0xcf76('0xa5')]);return db['ChatMessage'][_0xcf76('0x28')]({'where':_0x4e120f['where']})['then'](function(_0x17d2dc){_0x20ffb5['count']=_0x17d2dc;if(_0x428358[_0xcf76('0x3a')][_0xcf76('0x42')]){_0x4e120f[_0xcf76('0xa6')]=[{'all':!![]}];}return db[_0xcf76('0x60')][_0xcf76('0x38')](_0x4e120f);})['then'](function(_0x362283){_0x20ffb5[_0xcf76('0xa7')]=_0x362283;return _0x20ffb5;});}})[_0xcf76('0x19')](respondWithFilteredResult(_0x407ce3,_0x4e120f))[_0xcf76('0x22')](handleError(_0x407ce3,null));};exports['getMyMessages']=function(_0x4bc359,_0x2a83ab){var _0x1b2705={'where':{}},_0x275e09={},_0x29a166={'count':0x0,'rows':[]};return db[_0xcf76('0x4a')][_0xcf76('0x4c')]({'where':{'id':_0x4bc359[_0xcf76('0x47')]['id']}})[_0xcf76('0x19')](handleEntityNotFound(_0x2a83ab,null))['then'](function(_0x4c1389){if(_0x4c1389){_0x275e09[_0xcf76('0x3d')]=_['keys'](db[_0xcf76('0x60')]['rawAttributes']);_0x275e09[_0xcf76('0x3a')]=_[_0xcf76('0x3e')](_0x4bc359[_0xcf76('0x3a')]);_0x275e09[_0xcf76('0x3f')]=_[_0xcf76('0x9b')](_0x275e09[_0xcf76('0x3d')],_0x275e09['query']);_0x1b2705[_0xcf76('0x40')]=_[_0xcf76('0x9b')](_0x275e09[_0xcf76('0x3d')],qs[_0xcf76('0x41')](_0x4bc359['query'][_0xcf76('0x41')]));_0x1b2705[_0xcf76('0x40')]=_0x1b2705[_0xcf76('0x40')][_0xcf76('0x7d')]?_0x1b2705[_0xcf76('0x40')]:_0x275e09[_0xcf76('0x3d')];if(!_0x4bc359[_0xcf76('0x3a')]['hasOwnProperty']('nolimit')){_0x1b2705[_0xcf76('0x9d')]=qs[_0xcf76('0x9d')](_0x4bc359[_0xcf76('0x3a')]['limit']);_0x1b2705[_0xcf76('0x26')]=qs[_0xcf76('0x26')](_0x4bc359[_0xcf76('0x3a')][_0xcf76('0x26')]);}_0x1b2705['order']=qs[_0xcf76('0x9f')](_0x4bc359[_0xcf76('0x3a')][_0xcf76('0x9f')]);_0x1b2705[_0xcf76('0xa0')]=qs[_0xcf76('0x3f')](_['pick'](_0x4bc359[_0xcf76('0x3a')],_0x275e09[_0xcf76('0x3f')]));_0x1b2705[_0xcf76('0xa0')][_0xcf76('0xa8')]=_0x4c1389['id'];if(_0x4bc359[_0xcf76('0x3a')][_0xcf76('0xa2')]){_0x1b2705[_0xcf76('0xa0')]=_[_0xcf76('0x2f')](_0x1b2705[_0xcf76('0xa0')],{'$or':_[_0xcf76('0xa9')](_0x1b2705['attributes'],function(_0x313aad){var _0x50ee9a={};_0x50ee9a[_0x313aad]={'$like':'%'+_0x4bc359['query'][_0xcf76('0xa2')]+'%'};return _0x50ee9a;})});}_0x1b2705[_0xcf76('0xa0')][_0xcf76('0x8c')]=![];if(_0x4bc359[_0xcf76('0x3a')]['id']){_0x1b2705[_0xcf76('0xa0')]['id']={'$gt':_0x4bc359[_0xcf76('0x3a')]['id']};}_0x1b2705=_[_0xcf76('0x2f')]({},_0x1b2705,_0x4bc359['options']);return db[_0xcf76('0x60')]['count']({'where':_0x1b2705[_0xcf76('0xa0')]})['then'](function(_0x4ba314){_0x29a166[_0xcf76('0x28')]=_0x4ba314;_0x1b2705[_0xcf76('0xa6')]=[];if(_0x4bc359['query'][_0xcf76('0xaa')]){_0x1b2705['include']['push']({'model':db[_0xcf76('0x7c')],'as':_0xcf76('0x7c'),'attributes':['id','fullname','alias']});}if(_0x4bc359['query'][_0xcf76('0x42')]){_0x1b2705['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x1b2705);})[_0xcf76('0x19')](function(_0x438b45){_0x29a166[_0xcf76('0xa7')]=_0x438b45;return _0x29a166;});}})[_0xcf76('0x19')](respondWithFilteredResult(_0x2a83ab,_0x1b2705))['catch'](handleError(_0x2a83ab,null));};exports[_0xcf76('0xab')]=function(_0x4d1106,_0x5ad5a0){return db[_0xcf76('0x4a')][_0xcf76('0x46')]({'where':{'id':_0x4d1106[_0xcf76('0x47')]['id']}})[_0xcf76('0x19')](handleEntityNotFound(_0x5ad5a0,null))[_0xcf76('0x19')](function(_0x46d34d){if(_0x46d34d){return _0x46d34d[_0xcf76('0xac')](_0x4d1106[_0xcf76('0x44')][_0xcf76('0x98')],_['omit'](_0x4d1106[_0xcf76('0x44')],[_0xcf76('0x98'),'id'])||{})[_0xcf76('0xad')](function(){return db[_0xcf76('0xae')]['findAll']({'attributes':['id',_0xcf76('0x2c'),_0xcf76('0xaf')],'where':{'id':_0x4d1106['body'][_0xcf76('0x98')]}});})[_0xcf76('0x19')](function(_0x34e943){socket[_0xcf76('0xb0')](_0xcf76('0xb1'),{'id':Number(_0x4d1106['params']['id']),'tags':_0x34e943||[]});return{'id':Number(_0x4d1106[_0xcf76('0x47')]['id']),'tags':_0x34e943||[]};});}})[_0xcf76('0x19')](respondWithResult(_0x5ad5a0,null))[_0xcf76('0x22')](handleError(_0x5ad5a0,null));};exports['removeTags']=function(_0x3ca927,_0x55deac){return db[_0xcf76('0x4a')][_0xcf76('0x46')]({'where':{'id':_0x3ca927['params']['id']}})[_0xcf76('0x19')](handleEntityNotFound(_0x55deac,null))['then'](function(_0x571564){if(_0x571564){return _0x571564[_0xcf76('0xb2')](_0x3ca927['query'][_0xcf76('0x98')]);}})[_0xcf76('0x19')](respondWithStatusCode(_0x55deac,null))['catch'](handleError(_0x55deac,null));};exports[_0xcf76('0xb3')]=function(_0x4416ee,_0x2089e8){var _0x4b6c51=moment()['unix']()[_0xcf76('0xb4')]();var _0x188a09=path[_0xcf76('0x73')](config[_0xcf76('0x74')],_0xcf76('0xb5'),_0xcf76('0xb6'),_0xcf76('0xb7'));var _0xb23641=path[_0xcf76('0x73')](config[_0xcf76('0x74')],'server',_0xcf76('0xb6'),_0xcf76('0xb8'));var _0x193321=path[_0xcf76('0x73')](_0x188a09,_0x4b6c51);var _0x397fd7=util[_0xcf76('0x78')](_0xcf76('0xb9'),_0x4416ee[_0xcf76('0x47')]['id'],_0x4b6c51);var _0x1c925c=path['join'](_0x188a09,_0x397fd7);var _0x40bb90=[];_0x40bb90[_0xcf76('0xba')]({'model':db[_0xcf76('0x7c')],'as':_0xcf76('0x7c'),'attributes':['id',_0xcf76('0xbb')],'raw':!![]});_0x40bb90[_0xcf76('0xba')]({'model':db[_0xcf76('0x63')],'as':_0xcf76('0x64'),'attributes':['id',_0xcf76('0xbc'),_0xcf76('0xbd')],'raw':!![]});if(_0x4416ee['query']['attachments']){_0x40bb90[_0xcf76('0xba')]({'model':db[_0xcf76('0x6f')],'as':'Attachment','raw':!![]});}var _0x3f2536=[{'model':db[_0xcf76('0x60')],'as':'Messages','attributes':['id',_0xcf76('0x44'),_0xcf76('0x89'),_0xcf76('0x8b'),_0xcf76('0x8c'),_0xcf76('0xbe')],'include':_0x40bb90}];_0x3f2536['push']({'model':db[_0xcf76('0x4d')],'as':_0xcf76('0xbf'),'attributes':['id','name']});_0x3f2536['push']({'model':db[_0xcf76('0x7c')],'as':_0xcf76('0xc0'),'attributes':['id',_0xcf76('0xbb')]});return db[_0xcf76('0x4a')][_0xcf76('0x46')]({'where':{'id':_0x4416ee[_0xcf76('0x47')]['id']},'include':_0x3f2536})[_0xcf76('0x19')](handleEntityNotFound(_0x2089e8,null))[_0xcf76('0x19')](function(_0x3e519b){if(_0x3e519b){var _0x13c394=_0x3e519b[_0xcf76('0xc1')]({'plain':!![]});fs[_0xcf76('0xc2')](_0x193321);var _0x25cf6d={'channel':'Chat','account':_0x13c394['Account'][_0xcf76('0x2c')],'agent':_0x13c394[_0xcf76('0xc0')]?_0x13c394[_0xcf76('0xc0')][_0xcf76('0xbb')]:_0xcf76('0xc3'),'createdAt':moment(_0x13c394[_0xcf76('0x89')])[_0xcf76('0x78')]('YYYY-MM-DD\x20HH:mm:ss')[_0xcf76('0xb4')](),'closedAt':_0x13c394[_0xcf76('0x71')]?moment(_0x13c394['closedAt'])[_0xcf76('0x78')](_0xcf76('0xa4'))[_0xcf76('0xb4')]():'','disposition':_0x13c394[_0xcf76('0x6a')],'chatInfo':{'browser':_0x13c394['browserName'],'os':_0x13c394[_0xcf76('0xc4')],'referer':_0x13c394[_0xcf76('0xc5')],'customerIp':_0x13c394[_0xcf76('0xc6')],'customerPort':_0x13c394[_0xcf76('0xc7')]?_0x13c394[_0xcf76('0xc7')]:_0xcf76('0xc3')},'messages':_(_0x13c394[_0xcf76('0x7b')])[_0xcf76('0xc8')]()['filter']({'secret':![]})[_0xcf76('0xa9')](function(_0x244984){if(_0x244984['Attachment']){var _0x446c2d=path[_0xcf76('0x73')](_0xb23641,_0x244984[_0xcf76('0x6f')][_0xcf76('0x6c')]);if(fs['existsSync'](_0x446c2d)){fs[_0xcf76('0xc9')](_0x446c2d)[_0xcf76('0xca')](fs['createWriteStream'](path[_0xcf76('0x73')](_0x193321,_0x244984['Attachment'][_0xcf76('0x6c')])));}}return{'date':moment(_0x244984[_0xcf76('0x89')])[_0xcf76('0x78')](_0xcf76('0xa4'))[_0xcf76('0xb4')](),'sender':_0x244984[_0xcf76('0x8b')]==='out'?_0x244984['User']?_0x244984[_0xcf76('0x7c')][_0xcf76('0xbb')]:'System':_0x244984[_0xcf76('0x64')][_0xcf76('0xbc')]+(_0x244984[_0xcf76('0x64')][_0xcf76('0xbd')]?'\x20'+_0x244984[_0xcf76('0x64')]['lastName']:''),'body':_0x244984[_0xcf76('0x6f')]?_0x244984[_0xcf76('0x6f')][_0xcf76('0x6c')]:_0x244984['body'],'direction':_0x244984[_0xcf76('0x8b')]===_0xcf76('0xcb')?'A':'C','secret':_0x244984[_0xcf76('0x8c')],'read':_0x244984[_0xcf76('0xbe')],'attachment':_0x244984[_0xcf76('0x6f')]};})['value']()};return ejs[_0xcf76('0xcc')](path['join'](config[_0xcf76('0x74')],_0xcf76('0xb5'),_0xcf76('0xcd'),'downloadInteraction.ejs'),{'interaction':_0x25cf6d})['then'](function(_0x7e08ff){var _0x3825a2=path[_0xcf76('0x73')](_0x193321,'transcript-'+_0x13c394['id']+'-'+_0x4b6c51+_0xcf76('0xce'));var _0x5876f3={'path':_0x3825a2,'channel':'Chat','interactionId':_0x13c394['id']};return pdf[_0xcf76('0xcf')](_0x7e08ff,_0x5876f3);})[_0xcf76('0x19')](function(){return new Promise(function(_0xda3d26,_0x161fe3){zipdir(_0x193321,{'saveTo':_0x1c925c},function(_0x5b1196,_0x2527fa){if(_0x5b1196)return _0x161fe3(_0x5b1196);return _0xda3d26(_0x2527fa);});})[_0xcf76('0x19')](function(){return new BPromise(function(_0x48bdb7,_0x3d5017){rimraf(_0x193321,function(_0x389774){if(_0x389774)_0x3d5017(_0x389774);return _0x48bdb7();});});})[_0xcf76('0x19')](function(){return _0x2089e8[_0xcf76('0xb3')](_0x1c925c,_0x397fd7,function(_0x33061d){if(_0x33061d){logger[_0xcf76('0x1d')](_0xcf76('0xd0'),_0x33061d);}else{fs[_0xcf76('0xd1')](_0x1c925c);}});});});}else{return _0x2089e8[_0xcf76('0x68')](0xc8);}})['catch'](handleError(_0x2089e8,null));};
\ No newline at end of file
+var _0x98d1=['message','info','result','catch','sendStatus','status','json','offset','limit','count','set','update','end','stack','name','render','merge','body','agent','index','map','ChatInteraction','rawAttributes','fieldName','chat','query','user','params','model','keys','intersection','fields','attributes','length','includeAll','include','options','find','create','destroy','describe','ChatWebsite','findOne','vidaooApiKey','vidaooTopic','vidaooMetadata','vidaooEscalation','fullname','email','contact','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','originalname','basename','filename','type','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','download','close','mailTranscript','server/files/chat/upload/','now','pathTranscript','Messages','User','ChatWebsiteId','ContactId','format','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','Mail\x20Transcript','addMessage','omit','ids','getMessages','filters','hasOwnProperty','nolimit','order','sort','where','ChatInteractionId','filter','$gte','split','rows','getMyMessages','pick','findAll','addTags','setTags','spread','color','chatInteractionTags:save','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','push','firstName','lastName','direction','read','Account','get','Chat','Owner','YYYY-MM-DD\x20HH:mm:ss','closedAt','toString','browserName','osName','referer','customerPort','N.A.','tail','existsSync','pipe','Contact','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x34149c,_0x2601d1){var _0x50dd97=function(_0x5848a8){while(--_0x5848a8){_0x34149c['push'](_0x34149c['shift']());}};_0x50dd97(++_0x2601d1);}(_0x98d1,0x17e));var _0x198d=function(_0xd304de,_0x4fb962){_0xd304de=_0xd304de-0x0;var _0x2f6f06=_0x98d1[_0xd304de];return _0x2f6f06;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x198d('0x0'));var rp=require(_0x198d('0x1'));var moment=require(_0x198d('0x2'));var BPromise=require(_0x198d('0x3'));var Mustache=require(_0x198d('0x4'));var util=require(_0x198d('0x5'));var path=require(_0x198d('0x6'));var ejs=require(_0x198d('0x7'));var fs=require('fs');var _=require(_0x198d('0x8'));var Redis=require(_0x198d('0x9'));var interaction=require(_0x198d('0xa'));var qs=require(_0x198d('0xb'));var pdf=require(_0x198d('0xc'));var logger=require(_0x198d('0xd'))(_0x198d('0xe'));var config=require('../../config/environment');var db=require(_0x198d('0xf'))['db'];config[_0x198d('0x10')]=_[_0x198d('0x11')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x198d('0x12'))(new Redis(config['redis']));require(_0x198d('0x13'))['register'](socket);var jayson=require(_0x198d('0x14'));var client=jayson[_0x198d('0x15')][_0x198d('0x16')]({'port':0x232b});var client9004=jayson[_0x198d('0x15')][_0x198d('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x2c42df,_0x2b1a44,_0x34979a,_0x6a104d){return new BPromise(function(_0x1594a0,_0x3e2931){var _0x308d93=_0x6a104d||client;return _0x308d93[_0x198d('0x17')](_0x2c42df,_0x34979a)[_0x198d('0x18')](function(_0x5912e8){logger['info'](_0x198d('0x19'),_0x2b1a44,'request\x20sent');logger[_0x198d('0x1a')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2b1a44,_0x198d('0x1b'),JSON[_0x198d('0x1c')](_0x5912e8));if(_0x5912e8['error']){if(_0x5912e8['error']['code']===0x1f4){logger['error'](_0x198d('0x19'),_0x2b1a44,_0x5912e8[_0x198d('0x1d')][_0x198d('0x1e')]);return _0x3e2931(_0x5912e8[_0x198d('0x1d')][_0x198d('0x1e')]);}logger[_0x198d('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x2b1a44,_0x5912e8[_0x198d('0x1d')][_0x198d('0x1e')]);return _0x1594a0(_0x5912e8['error']['message']);}else{logger[_0x198d('0x1f')](_0x198d('0x19'),_0x2b1a44,_0x198d('0x1b'));_0x1594a0(_0x5912e8[_0x198d('0x20')][_0x198d('0x1e')]);}})[_0x198d('0x21')](function(_0x519d05){logger[_0x198d('0x1d')](_0x198d('0x19'),_0x2b1a44,_0x519d05);_0x3e2931(_0x519d05);});});}function respondWithStatusCode(_0x2677e5,_0x5cbfe2){_0x5cbfe2=_0x5cbfe2||0xcc;return function(_0x41ff8a){if(_0x41ff8a){return _0x2677e5[_0x198d('0x22')](_0x5cbfe2);}return _0x2677e5[_0x198d('0x23')](_0x5cbfe2)['end']();};}function respondWithResult(_0x1f0bb4,_0x179101){_0x179101=_0x179101||0xc8;return function(_0xe7718c){if(_0xe7718c){return _0x1f0bb4['status'](_0x179101)[_0x198d('0x24')](_0xe7718c);}};}function respondWithFilteredResult(_0xdd1a55,_0xdecb09){return function(_0x57ae30){if(_0x57ae30){var _0x1ba39a=typeof _0xdecb09[_0x198d('0x25')]==='undefined'&&typeof _0xdecb09[_0x198d('0x26')]==='undefined';var _0x1e9f12=_0x57ae30[_0x198d('0x27')];var _0x4bfd7d=_0x1ba39a?0x0:_0xdecb09[_0x198d('0x25')];var _0x8359ed=_0x1ba39a?_0x57ae30[_0x198d('0x27')]:_0xdecb09[_0x198d('0x25')]+_0xdecb09[_0x198d('0x26')];var _0x25aeca;if(_0x8359ed>=_0x1e9f12){_0x8359ed=_0x1e9f12;_0x25aeca=0xc8;}else{_0x25aeca=0xce;}_0xdd1a55['status'](_0x25aeca);return _0xdd1a55[_0x198d('0x28')]('Content-Range',_0x4bfd7d+'-'+_0x8359ed+'/'+_0x1e9f12)['json'](_0x57ae30);}return null;};}function saveUpdates(_0x40a016){return function(_0x3f4b94){if(_0x3f4b94){return _0x3f4b94[_0x198d('0x29')](_0x40a016)[_0x198d('0x18')](function(_0x3dbe3e){return _0x3dbe3e;});}return null;};}function removeEntity(_0x5c2323){return function(_0x35a65c){if(_0x35a65c){return _0x35a65c['destroy']()[_0x198d('0x18')](function(){_0x5c2323['status'](0xcc)[_0x198d('0x2a')]();});}};}function handleEntityNotFound(_0x7487f0){return function(_0x413434){if(!_0x413434){_0x7487f0['sendStatus'](0x194);}return _0x413434;};}function handleError(_0x3c22f8,_0x6f1268){_0x6f1268=_0x6f1268||0x1f4;return function(_0x209033){logger[_0x198d('0x1d')](_0x209033[_0x198d('0x2b')]);if(_0x209033['name']){delete _0x209033[_0x198d('0x2c')];}_0x3c22f8['status'](_0x6f1268)['send'](_0x209033);};}function getMustacheRender(_0x2536f3,_0x3a82ea){return Mustache[_0x198d('0x2d')](_0x2536f3,_[_0x198d('0x2e')](_0x3a82ea[_0x198d('0x2f')],{'contact':_0x3a82ea['contact'],'message':_0x3a82ea[_0x198d('0x1e')],'agent':_0x3a82ea[_0x198d('0x30')],'interaction':_0x3a82ea['interaction'],'account':_0x3a82ea['account']}))||'';}exports[_0x198d('0x31')]=function(_0xe06925,_0xfef050){var _0x5b9607={};var _0x27e86f=_[_0x198d('0x32')](db[_0x198d('0x33')][_0x198d('0x34')],function(_0x24eb8b){return{'name':_0x24eb8b[_0x198d('0x35')],'type':_0x24eb8b['type']['key']};});_0x5b9607=qs['getOptions'](_0x27e86f,_0xe06925);return interaction['findAll'](_0x198d('0x36'),_0xe06925[_0x198d('0x37')],_0xe06925[_0x198d('0x38')],_0x5b9607,_0x27e86f)[_0x198d('0x18')](respondWithFilteredResult(_0xfef050,_0x5b9607))[_0x198d('0x21')](handleError(_0xfef050,null));};exports['show']=function(_0x18f3a9,_0x485b56){var _0x132fd8={'raw':![],'where':{'id':_0x18f3a9[_0x198d('0x39')]['id']}},_0x295c15={};_0x295c15[_0x198d('0x3a')]=_[_0x198d('0x3b')](db['ChatInteraction'][_0x198d('0x34')]);_0x295c15[_0x198d('0x37')]=_[_0x198d('0x3b')](_0x18f3a9['query']);_0x295c15['filters']=_[_0x198d('0x3c')](_0x295c15['model'],_0x295c15['query']);_0x132fd8['attributes']=_['intersection'](_0x295c15[_0x198d('0x3a')],qs[_0x198d('0x3d')](_0x18f3a9[_0x198d('0x37')][_0x198d('0x3d')]));_0x132fd8[_0x198d('0x3e')]=_0x132fd8[_0x198d('0x3e')][_0x198d('0x3f')]?_0x132fd8[_0x198d('0x3e')]:_0x295c15[_0x198d('0x3a')];if(_0x18f3a9[_0x198d('0x37')][_0x198d('0x40')]){_0x132fd8[_0x198d('0x41')]=[{'all':!![]}];}_0x132fd8=_[_0x198d('0x2e')]({},_0x132fd8,_0x18f3a9[_0x198d('0x42')]);return db[_0x198d('0x33')][_0x198d('0x43')](_0x132fd8)[_0x198d('0x18')](handleEntityNotFound(_0x485b56,null))[_0x198d('0x18')](respondWithResult(_0x485b56,null))['catch'](handleError(_0x485b56,null));};exports[_0x198d('0x44')]=function(_0x27bca8,_0xf99b6){return db['ChatInteraction'][_0x198d('0x44')](_0x27bca8[_0x198d('0x2f')],{})['then'](respondWithResult(_0xf99b6,0xc9))[_0x198d('0x21')](handleError(_0xf99b6,null));};exports[_0x198d('0x29')]=function(_0x4f8e69,_0x5b56fd){if(_0x4f8e69[_0x198d('0x2f')]['id']){delete _0x4f8e69['body']['id'];}return db['ChatInteraction'][_0x198d('0x43')]({'where':{'id':_0x4f8e69[_0x198d('0x39')]['id']}})['then'](handleEntityNotFound(_0x5b56fd,null))[_0x198d('0x18')](saveUpdates(_0x4f8e69['body'],null))[_0x198d('0x18')](respondWithResult(_0x5b56fd,null))[_0x198d('0x21')](handleError(_0x5b56fd,null));};exports[_0x198d('0x45')]=function(_0x19c4df,_0x5edbc4){return db[_0x198d('0x33')][_0x198d('0x43')]({'where':{'id':_0x19c4df[_0x198d('0x39')]['id']}})[_0x198d('0x18')](handleEntityNotFound(_0x5edbc4,null))[_0x198d('0x18')](removeEntity(_0x5edbc4,null))[_0x198d('0x21')](handleError(_0x5edbc4,null));};exports[_0x198d('0x46')]=function(_0x21c82c,_0x5b2cd6){return db[_0x198d('0x33')]['describe']()['then'](respondWithResult(_0x5b2cd6,null))[_0x198d('0x21')](handleError(_0x5b2cd6,null));};exports['createVidaooSession']=function(_0x427347,_0x33fe7f){var _0x48e9dc=_0x427347[_0x198d('0x39')]['id'];var _0x1d2a7a;var _0xfdc0ae;var _0x3ef57a;return db[_0x198d('0x33')]['findOne']({'where':{'id':_0x48e9dc}})[_0x198d('0x18')](function(_0x4bfce0){_0x1d2a7a=_0x4bfce0;return db[_0x198d('0x47')][_0x198d('0x48')]({'where':{'id':_0x4bfce0['ChatWebsiteId']},'attributes':['id',_0x198d('0x49'),'vidaooEscalation',_0x198d('0x4a'),'vidaooNote',_0x198d('0x4b')],'raw':!![]});})[_0x198d('0x18')](function(_0x59784f){if(_0x59784f&&_0x59784f['vidaooApiKey']&&_0x59784f[_0x198d('0x4c')]){_0xfdc0ae=_0x59784f;var _0x5b1ad5={'interaction':{'id':_0x48e9dc},'agent':{'id':_0x427347[_0x198d('0x38')]['id'],'name':_0x427347['user'][_0x198d('0x2c')],'fullname':_0x427347[_0x198d('0x38')][_0x198d('0x4d')],'email':_0x427347[_0x198d('0x38')][_0x198d('0x4e')]},'contact':_0x427347['body'][_0x198d('0x4f')],'account':_0x427347[_0x198d('0x2f')][_0x198d('0x50')]};var _0x81c310={'rejectUnauthorized':![],'method':_0x198d('0x51'),'url':_0x198d('0x52'),'headers':{'X-APIKEY':_0x59784f[_0x198d('0x49')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x427347[_0x198d('0x38')][_0x198d('0x4e')]],'buttons':null,'topic':_0xfdc0ae[_0x198d('0x4a')],'note':_[_0x198d('0x53')](_0xfdc0ae[_0x198d('0x54')])?null:getMustacheRender(_0xfdc0ae['vidaooNote'],_0x5b1ad5),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x198d('0x53')](_0xfdc0ae['vidaooMetadata'])){var _0x2be653=getMustacheRender(_0xfdc0ae['vidaooMetadata'],_0x5b1ad5);var _0x2b140d=JSON[_0x198d('0x55')](_0x2be653);_0x81c310['body'][_0x198d('0x56')]=_0x2b140d;}}catch(_0x5ac897){throw new db[(_0x198d('0x57'))]['ValidationError'](_0x198d('0x58'));}return rp(_0x81c310);}else{throw new db['Sequelize'][(_0x198d('0x59'))](_0x198d('0x5a'));}})[_0x198d('0x18')](function(_0x3c2c24){_0x3ef57a=_0x3c2c24;if(_0x3ef57a['id']){var _0x2aa6f5={'body':_0x3ef57a['join_url'],'ChatWebsiteId':_0xfdc0ae['id'],'ChatInteractionId':_0x1d2a7a['id'],'direction':_0x198d('0x5b'),'UserId':_0x427347[_0x198d('0x38')]['id']};return db[_0x198d('0x5c')][_0x198d('0x44')](_0x2aa6f5,{});}else{throw new db[(_0x198d('0x57'))][(_0x198d('0x59'))](_0x198d('0x5d'));}})[_0x198d('0x18')](function(){return _0x1d2a7a[_0x198d('0x5e')]({'vidaooSessionId':_0x3ef57a['id']});})[_0x198d('0x18')](respondWithResult(_0x33fe7f,null))['catch'](handleError(_0x33fe7f,null));};exports[_0x198d('0x5f')]=function(_0x5c7d3f,_0x271a90){if(_0x5c7d3f[_0x198d('0x2f')]['id']){delete _0x5c7d3f[_0x198d('0x2f')]['id'];}return db[_0x198d('0x33')][_0x198d('0x43')]({'where':{'id':_0x5c7d3f[_0x198d('0x39')]['id']},'include':[{'model':db[_0x198d('0x60')],'as':'Contact'}]})[_0x198d('0x18')](handleEntityNotFound(_0x271a90,null))[_0x198d('0x18')](saveUpdates(_0x5c7d3f[_0x198d('0x2f')],null))[_0x198d('0x18')](respondWithResult(_0x271a90,null))[_0x198d('0x21')](handleError(_0x271a90,null));};exports[_0x198d('0x61')]=function(_0x1f54ea,_0x120a1a){if(_0x1f54ea['body']['id']){delete _0x1f54ea[_0x198d('0x2f')]['id'];}return db[_0x198d('0x33')][_0x198d('0x43')]({'where':{'id':_0x1f54ea[_0x198d('0x39')]['id']}})[_0x198d('0x18')](function(_0x34fff4){if(!_0x34fff4){logger[_0x198d('0x1d')](_0x198d('0x62'),'abandon',0x194,_0x198d('0x63'));_0x120a1a[_0x198d('0x22')](0x194);}else{if(_0x34fff4[_0x198d('0x64')]){throw new db[(_0x198d('0x57'))]['ValidationError'](_0x198d('0x65'));}}return _0x34fff4;})['then'](function(_0x80f4f4){if(_0x80f4f4){return _0x80f4f4['update']({'closed':_0x1f54ea[_0x198d('0x2f')][_0x198d('0x66')],'disposition':_0x1f54ea[_0x198d('0x2f')][_0x198d('0x67')]})[_0x198d('0x18')](function(_0x556b26){return _0x556b26;});}})[_0x198d('0x18')](function(){return respondWithRpcPromise(_0x198d('0x68'),_0x198d('0x61'),_0x1f54ea[_0x198d('0x2f')],client9004);})[_0x198d('0x18')](respondWithResult(_0x120a1a,null))[_0x198d('0x21')](handleError(_0x120a1a,null));};exports['attachmentUpload']=function(_0x1b6542,_0x3e0808){_0x1b6542[_0x198d('0x2f')][_0x198d('0x2c')]=_0x1b6542[_0x198d('0x69')][_0x198d('0x6a')];_0x1b6542[_0x198d('0x2f')][_0x198d('0x6b')]=_0x1b6542['file'][_0x198d('0x6c')];_0x1b6542['body'][_0x198d('0x6d')]=_0x1b6542['file'][_0x198d('0x6e')];return db[_0x198d('0x6f')]['create'](_0x1b6542['body'])[_0x198d('0x18')](respondWithResult(_0x3e0808,0xc9))[_0x198d('0x21')](handleError(_0x3e0808,null));};exports[_0x198d('0x70')]=function(_0xc3e7ad,_0xab5513){return db[_0x198d('0x33')][_0x198d('0x48')]({'where':{'id':_0xc3e7ad[_0x198d('0x39')]['id']},'raw':!![]})[_0x198d('0x18')](handleEntityNotFound(_0xab5513,null))[_0x198d('0x18')](function(_0x5bae7b){if(_0x5bae7b){if(_0x5bae7b[_0x198d('0x66')]){return _0xab5513[_0x198d('0x23')](0x193)[_0x198d('0x24')]({'status':0x193,'message':_0x198d('0x71')});}return db[_0x198d('0x6f')][_0x198d('0x48')]({'where':{'id':_0xc3e7ad[_0x198d('0x37')]['attachId']},'raw':!![]})[_0x198d('0x18')](handleEntityNotFound(_0xab5513,null));}})[_0x198d('0x18')](function(_0x5e1504){if(_0x5e1504){var _0x4a4462=_0x5e1504[_0x198d('0x72')]!==null;var _0x209c46=path[_0x198d('0x73')](config[_0x198d('0x74')],'server/files/attachments/');if(_0x4a4462){_0x209c46=path[_0x198d('0x73')](_0x209c46,'offline-chat/');}var _0x44479c=path[_0x198d('0x73')](_0x209c46,_0x5e1504[_0x198d('0x6b')]);return _0xab5513[_0x198d('0x75')](_0x44479c);}})[_0x198d('0x21')](handleError(_0xab5513,null));};exports[_0x198d('0x76')]=function(_0x400bc2,_0x5f2435){var _0x166ae1=null;var _0x495fa0=null;var _0x5cb25a=null;if(_0x400bc2[_0x198d('0x2f')]['id']){delete _0x400bc2[_0x198d('0x2f')]['id'];}if(_0x400bc2[_0x198d('0x2f')][_0x198d('0x77')]){_0x5cb25a=path[_0x198d('0x73')](config[_0x198d('0x74')],_0x198d('0x78'),util['format']('transcript-%s.txt',Date[_0x198d('0x79')]()));_0x400bc2[_0x198d('0x2f')][_0x198d('0x7a')]=_0x5cb25a;}return db[_0x198d('0x33')][_0x198d('0x43')]({'where':{'id':_0x400bc2[_0x198d('0x39')]['id']},'include':[{'model':db[_0x198d('0x5c')],'as':_0x198d('0x7b'),'include':[{'model':db[_0x198d('0x7c')],'as':_0x198d('0x7c')}]}]})[_0x198d('0x18')](handleEntityNotFound(_0x5f2435,null))[_0x198d('0x18')](saveUpdates(_0x400bc2[_0x198d('0x2f')],null))[_0x198d('0x18')](function(_0x4abba4){if(_0x4abba4){_0x166ae1=_0x4abba4;return db[_0x198d('0x47')][_0x198d('0x43')]({'where':{'id':_0x166ae1[_0x198d('0x7d')]}});}})[_0x198d('0x18')](function(_0x5a037a){if(_0x5a037a){_0x495fa0=_0x5a037a;return db['CmContact']['find']({'where':{'id':_0x166ae1[_0x198d('0x7e')]}});}})[_0x198d('0x18')](function(_0x457bb3){if(_0x457bb3){if(_0x5cb25a){var _0x2c20d3=null;for(var _0x574418=0x1;_0x574418<_0x166ae1[_0x198d('0x7b')][_0x198d('0x3f')];++_0x574418){_0x2c20d3=_0x166ae1[_0x198d('0x7b')][_0x574418];var _0x1d37f0=_0x2c20d3[_0x198d('0x64')]?util[_0x198d('0x7f')](_0x198d('0x80'),_0x495fa0[_0x198d('0x81')],_0x2c20d3[_0x198d('0x64')]):_0x198d('0x82');var _0xa9d871=_0x400bc2[_0x198d('0x2f')][_0x198d('0x83')]||util[_0x198d('0x7f')](_0x198d('0x80'),_0x198d('0x84'),_0x2c20d3[_0x198d('0x7e')]);switch(_0x495fa0[_0x198d('0x85')]){case _0x198d('0x86'):_0x1d37f0=_0x2c20d3[_0x198d('0x64')]?util['format'](_0x198d('0x80'),_0x495fa0[_0x198d('0x81')],_0x2c20d3[_0x198d('0x64')]):'System';break;case _0x198d('0x87'):_0x1d37f0=_0x2c20d3[_0x198d('0x64')]?_0x2c20d3[_0x198d('0x7c')][_0x198d('0x88')]||_0x2c20d3[_0x198d('0x7c')][_0x198d('0x4d')]:_0x198d('0x82');break;case'agent_fullname':_0x1d37f0=_0x2c20d3[_0x198d('0x64')]?_0x2c20d3[_0x198d('0x7c')][_0x198d('0x4d')]:_0x198d('0x82');break;default:_0x1d37f0=_0x2c20d3['UserId']?util[_0x198d('0x7f')](_0x198d('0x80'),_0x495fa0[_0x198d('0x81')],_0x2c20d3[_0x198d('0x64')]):'System';}var _0x592ef3=util[_0x198d('0x7f')](_0x198d('0x89'),moment(_0x2c20d3[_0x198d('0x8a')])[_0x198d('0x7f')](_0x198d('0x8b')),_0x2c20d3['direction']==='in'?_0xa9d871:_0x1d37f0,_0x2c20d3[_0x198d('0x2f')]);if(!_0x2c20d3[_0x198d('0x8c')]){fs['appendFileSync'](_0x5cb25a,_0x592ef3);}}return db['MailAccount'][_0x198d('0x48')]({'where':{'service':!![]},'include':[{'model':db[_0x198d('0x8d')],'as':_0x198d('0x8e'),'raw':!![],'include':[{'model':db[_0x198d('0x8f')],'as':_0x198d('0x8f'),'raw':!![]}]}]});}}})[_0x198d('0x18')](function(_0x110c93){if(!_0x110c93||!_0x110c93[_0x198d('0x8e')]||!_0x400bc2[_0x198d('0x2f')])return _0x166ae1;var _0x3b8a87=_0x110c93[_0x198d('0x90')]();return respondWithRpcPromise(_0x198d('0x91'),_0x198d('0x92'),{'account':_0x3b8a87,'message':{'from':util[_0x198d('0x7f')]('\x22%s\x22\x20<%s>',_0x110c93[_0x198d('0x2c')],_0x110c93[_0x198d('0x4e')]||_0x110c93[_0x198d('0x8e')][_0x198d('0x38')]),'to':_0x400bc2[_0x198d('0x2f')][_0x198d('0x77')],'subject':_0x198d('0x93'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x400bc2[_0x198d('0x2f')][_0x198d('0x77')]),'attachments':[{'path':_0x5cb25a}]}})['then'](function(){return _0x166ae1;})[_0x198d('0x21')](function(_0x4a9a68){logger['error'](_0x4a9a68);});})[_0x198d('0x18')](respondWithStatusCode(_0x5f2435,0xc8))[_0x198d('0x21')](handleError(_0x5f2435,null));};exports[_0x198d('0x94')]=function(_0x10dfc6,_0x1d127a){return db[_0x198d('0x5c')]['find']({'where':{'id':_0x10dfc6[_0x198d('0x39')]['id']}})[_0x198d('0x18')](handleEntityNotFound(_0x1d127a,null))[_0x198d('0x18')](function(_0x46dfb4){if(_0x46dfb4){return _0x46dfb4[_0x198d('0x94')](_0x10dfc6[_0x198d('0x2f')]['ids'],_[_0x198d('0x95')](_0x10dfc6[_0x198d('0x2f')],[_0x198d('0x96'),'id'])||{});}})[_0x198d('0x18')](respondWithResult(_0x1d127a,null))[_0x198d('0x21')](handleError(_0x1d127a,null));};exports[_0x198d('0x97')]=function(_0x3d6d0a,_0x59e554){var _0x3dacf8={'raw':![],'where':{}};var _0x14745d={};var _0x39533e={'count':0x0,'rows':[]};return db[_0x198d('0x33')][_0x198d('0x48')]({'where':{'id':_0x3d6d0a[_0x198d('0x39')]['id']}})[_0x198d('0x18')](handleEntityNotFound(_0x59e554,null))[_0x198d('0x18')](function(_0x412eee){if(_0x412eee){_0x14745d[_0x198d('0x3a')]=_[_0x198d('0x3b')](db['ChatMessage'][_0x198d('0x34')]);_0x14745d[_0x198d('0x37')]=_['keys'](_0x3d6d0a[_0x198d('0x37')]);_0x14745d[_0x198d('0x98')]=_[_0x198d('0x3c')](_0x14745d[_0x198d('0x3a')],_0x14745d[_0x198d('0x37')]);_0x3dacf8['attributes']=_[_0x198d('0x3c')](_0x14745d['model'],qs[_0x198d('0x3d')](_0x3d6d0a[_0x198d('0x37')][_0x198d('0x3d')]));_0x3dacf8[_0x198d('0x3e')]=_0x3dacf8[_0x198d('0x3e')][_0x198d('0x3f')]?_0x3dacf8[_0x198d('0x3e')]:_0x14745d[_0x198d('0x3a')];if(!_0x3d6d0a['query'][_0x198d('0x99')](_0x198d('0x9a'))){_0x3dacf8[_0x198d('0x26')]=qs[_0x198d('0x26')](_0x3d6d0a[_0x198d('0x37')][_0x198d('0x26')]);_0x3dacf8[_0x198d('0x25')]=qs[_0x198d('0x25')](_0x3d6d0a[_0x198d('0x37')][_0x198d('0x25')]);}_0x3dacf8[_0x198d('0x9b')]=qs[_0x198d('0x9c')](_0x3d6d0a[_0x198d('0x37')][_0x198d('0x9c')]);_0x3dacf8['where']=qs[_0x198d('0x98')](_['pick'](_0x3d6d0a[_0x198d('0x37')],_0x14745d['filters']));_0x3dacf8[_0x198d('0x9d')][_0x198d('0x9e')]=_0x412eee['id'];if(_0x3d6d0a[_0x198d('0x37')][_0x198d('0x9f')]){_0x3dacf8[_0x198d('0x9d')]=_['merge'](_0x3dacf8[_0x198d('0x9d')],{'$or':_['map'](_0x3dacf8[_0x198d('0x3e')],function(_0x4bf194){var _0x360538={};_0x360538[_0x4bf194]={'$like':'%'+_0x3d6d0a[_0x198d('0x37')]['filter']+'%'};return _0x360538;})});}if(_0x3d6d0a[_0x198d('0x37')]['$gte']){var _0x2e75f6=_0x3d6d0a[_0x198d('0x37')][_0x198d('0xa0')][_0x198d('0xa1')](',');var _0x378d87={};_0x378d87[_0x2e75f6[0x0]]={'$gte':moment(_0x2e75f6[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3dacf8[_0x198d('0x9d')]=_[_0x198d('0x2e')](_0x3dacf8[_0x198d('0x9d')],_0x378d87);}_0x3dacf8=_[_0x198d('0x2e')]({},_0x3dacf8,_0x3d6d0a[_0x198d('0x42')]);return db[_0x198d('0x5c')][_0x198d('0x27')]({'where':_0x3dacf8['where']})[_0x198d('0x18')](function(_0xe2468d){_0x39533e['count']=_0xe2468d;if(_0x3d6d0a['query']['includeAll']){_0x3dacf8[_0x198d('0x41')]=[{'all':!![]}];}return db[_0x198d('0x5c')]['findAll'](_0x3dacf8);})[_0x198d('0x18')](function(_0xa6f0ca){_0x39533e[_0x198d('0xa2')]=_0xa6f0ca;return _0x39533e;});}})[_0x198d('0x18')](respondWithFilteredResult(_0x59e554,_0x3dacf8))['catch'](handleError(_0x59e554,null));};exports[_0x198d('0xa3')]=function(_0x13ced1,_0x4613bc){var _0x5bd0b5={'where':{}},_0x47d1db={},_0x656c0={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x198d('0x48')]({'where':{'id':_0x13ced1[_0x198d('0x39')]['id']}})['then'](handleEntityNotFound(_0x4613bc,null))['then'](function(_0x3ae2be){if(_0x3ae2be){_0x47d1db[_0x198d('0x3a')]=_[_0x198d('0x3b')](db[_0x198d('0x5c')][_0x198d('0x34')]);_0x47d1db[_0x198d('0x37')]=_[_0x198d('0x3b')](_0x13ced1[_0x198d('0x37')]);_0x47d1db[_0x198d('0x98')]=_['intersection'](_0x47d1db[_0x198d('0x3a')],_0x47d1db[_0x198d('0x37')]);_0x5bd0b5[_0x198d('0x3e')]=_['intersection'](_0x47d1db[_0x198d('0x3a')],qs[_0x198d('0x3d')](_0x13ced1[_0x198d('0x37')][_0x198d('0x3d')]));_0x5bd0b5[_0x198d('0x3e')]=_0x5bd0b5[_0x198d('0x3e')]['length']?_0x5bd0b5[_0x198d('0x3e')]:_0x47d1db[_0x198d('0x3a')];if(!_0x13ced1[_0x198d('0x37')][_0x198d('0x99')]('nolimit')){_0x5bd0b5['limit']=qs[_0x198d('0x26')](_0x13ced1[_0x198d('0x37')]['limit']);_0x5bd0b5[_0x198d('0x25')]=qs[_0x198d('0x25')](_0x13ced1[_0x198d('0x37')][_0x198d('0x25')]);}_0x5bd0b5[_0x198d('0x9b')]=qs[_0x198d('0x9c')](_0x13ced1[_0x198d('0x37')]['sort']);_0x5bd0b5['where']=qs[_0x198d('0x98')](_[_0x198d('0xa4')](_0x13ced1[_0x198d('0x37')],_0x47d1db[_0x198d('0x98')]));_0x5bd0b5['where'][_0x198d('0x9e')]=_0x3ae2be['id'];if(_0x13ced1[_0x198d('0x37')][_0x198d('0x9f')]){_0x5bd0b5[_0x198d('0x9d')]=_['merge'](_0x5bd0b5[_0x198d('0x9d')],{'$or':_[_0x198d('0x32')](_0x5bd0b5['attributes'],function(_0x26b400){var _0x52d28e={};_0x52d28e[_0x26b400]={'$like':'%'+_0x13ced1[_0x198d('0x37')][_0x198d('0x9f')]+'%'};return _0x52d28e;})});}_0x5bd0b5['where']['secret']=![];if(_0x13ced1[_0x198d('0x37')]['id']){_0x5bd0b5[_0x198d('0x9d')]['id']={'$gt':_0x13ced1[_0x198d('0x37')]['id']};}_0x5bd0b5=_[_0x198d('0x2e')]({},_0x5bd0b5,_0x13ced1['options']);return db[_0x198d('0x5c')][_0x198d('0x27')]({'where':_0x5bd0b5[_0x198d('0x9d')]})[_0x198d('0x18')](function(_0x4cdbf7){_0x656c0[_0x198d('0x27')]=_0x4cdbf7;_0x5bd0b5[_0x198d('0x41')]=[];if(_0x13ced1['query']['includeAgent']){_0x5bd0b5[_0x198d('0x41')]['push']({'model':db[_0x198d('0x7c')],'as':'User','attributes':['id',_0x198d('0x4d'),_0x198d('0x88')]});}if(_0x13ced1[_0x198d('0x37')][_0x198d('0x40')]){_0x5bd0b5[_0x198d('0x41')]=[{'all':!![]}];}return db[_0x198d('0x5c')][_0x198d('0xa5')](_0x5bd0b5);})['then'](function(_0x554b4f){_0x656c0['rows']=_0x554b4f;return _0x656c0;});}})['then'](respondWithFilteredResult(_0x4613bc,_0x5bd0b5))[_0x198d('0x21')](handleError(_0x4613bc,null));};exports[_0x198d('0xa6')]=function(_0x527958,_0x2d04a8){return db[_0x198d('0x33')][_0x198d('0x43')]({'where':{'id':_0x527958[_0x198d('0x39')]['id']}})[_0x198d('0x18')](handleEntityNotFound(_0x2d04a8,null))[_0x198d('0x18')](function(_0x1b8e2d){if(_0x1b8e2d){return _0x1b8e2d[_0x198d('0xa7')](_0x527958[_0x198d('0x2f')]['ids'],_[_0x198d('0x95')](_0x527958[_0x198d('0x2f')],[_0x198d('0x96'),'id'])||{})[_0x198d('0xa8')](function(){return db['Tag'][_0x198d('0xa5')]({'attributes':['id',_0x198d('0x2c'),_0x198d('0xa9')],'where':{'id':_0x527958[_0x198d('0x2f')][_0x198d('0x96')]}});})[_0x198d('0x18')](function(_0x341795){socket['emit'](_0x198d('0xaa'),{'id':Number(_0x527958[_0x198d('0x39')]['id']),'tags':_0x341795||[]});return{'id':Number(_0x527958[_0x198d('0x39')]['id']),'tags':_0x341795||[]};});}})[_0x198d('0x18')](respondWithResult(_0x2d04a8,null))[_0x198d('0x21')](handleError(_0x2d04a8,null));};exports[_0x198d('0xab')]=function(_0x573d03,_0x29500b){return db[_0x198d('0x33')][_0x198d('0x43')]({'where':{'id':_0x573d03[_0x198d('0x39')]['id']}})[_0x198d('0x18')](handleEntityNotFound(_0x29500b,null))['then'](function(_0x4e8a4e){if(_0x4e8a4e){return _0x4e8a4e['removeTags'](_0x573d03['query'][_0x198d('0x96')]);}})[_0x198d('0x18')](respondWithStatusCode(_0x29500b,null))[_0x198d('0x21')](handleError(_0x29500b,null));};exports[_0x198d('0x75')]=function(_0x42f0a5,_0x32e65d){var _0x34a02b=moment()['unix']()['toString']();var _0x5a944e=path[_0x198d('0x73')](config['root'],_0x198d('0xac'),_0x198d('0xad'),_0x198d('0xae'));var _0x4855f2=path[_0x198d('0x73')](config[_0x198d('0x74')],_0x198d('0xac'),_0x198d('0xad'),_0x198d('0xaf'));var _0x26b92f=path[_0x198d('0x73')](_0x5a944e,_0x34a02b);var _0x2e8bf9=util[_0x198d('0x7f')](_0x198d('0xb0'),_0x42f0a5['params']['id'],_0x34a02b);var _0x5c6f1b=path[_0x198d('0x73')](_0x5a944e,_0x2e8bf9);var _0xe61a3f=[];_0xe61a3f[_0x198d('0xb1')]({'model':db[_0x198d('0x7c')],'as':_0x198d('0x7c'),'attributes':['id',_0x198d('0x4d')],'raw':!![]});_0xe61a3f[_0x198d('0xb1')]({'model':db[_0x198d('0x60')],'as':'Contact','attributes':['id',_0x198d('0xb2'),_0x198d('0xb3')],'raw':!![]});if(_0x42f0a5[_0x198d('0x37')][_0x198d('0xaf')]){_0xe61a3f[_0x198d('0xb1')]({'model':db['Attachment'],'as':_0x198d('0x6f'),'raw':!![]});}var _0x40811d=[{'model':db[_0x198d('0x5c')],'as':_0x198d('0x7b'),'attributes':['id','body','createdAt',_0x198d('0xb4'),_0x198d('0x8c'),_0x198d('0xb5')],'include':_0xe61a3f}];_0x40811d[_0x198d('0xb1')]({'model':db[_0x198d('0x47')],'as':_0x198d('0xb6'),'attributes':['id','name']});_0x40811d[_0x198d('0xb1')]({'model':db[_0x198d('0x7c')],'as':'Owner','attributes':['id',_0x198d('0x4d')]});return db[_0x198d('0x33')][_0x198d('0x43')]({'where':{'id':_0x42f0a5[_0x198d('0x39')]['id']},'include':_0x40811d})[_0x198d('0x18')](handleEntityNotFound(_0x32e65d,null))[_0x198d('0x18')](function(_0x254348){if(_0x254348){var _0x1687cb=_0x254348[_0x198d('0xb7')]({'plain':!![]});fs['mkdirSync'](_0x26b92f);var _0x1fdc74={'channel':_0x198d('0xb8'),'account':_0x1687cb[_0x198d('0xb6')][_0x198d('0x2c')],'agent':_0x1687cb['Owner']?_0x1687cb[_0x198d('0xb9')][_0x198d('0x4d')]:'N.A.','createdAt':moment(_0x1687cb['createdAt'])[_0x198d('0x7f')](_0x198d('0xba'))['toString'](),'closedAt':_0x1687cb[_0x198d('0x66')]?moment(_0x1687cb[_0x198d('0xbb')])[_0x198d('0x7f')](_0x198d('0xba'))[_0x198d('0xbc')]():'','disposition':_0x1687cb[_0x198d('0x67')],'chatInfo':{'browser':_0x1687cb[_0x198d('0xbd')],'os':_0x1687cb[_0x198d('0xbe')],'referer':_0x1687cb[_0x198d('0xbf')],'customerIp':_0x1687cb['customerIp'],'customerPort':_0x1687cb[_0x198d('0xc0')]?_0x1687cb[_0x198d('0xc0')]:_0x198d('0xc1')},'messages':_(_0x1687cb[_0x198d('0x7b')])[_0x198d('0xc2')]()[_0x198d('0x9f')]({'secret':![]})['map'](function(_0x81526f){if(_0x81526f['Attachment']){var _0x5c3728=path['join'](_0x4855f2,_0x81526f[_0x198d('0x6f')][_0x198d('0x6b')]);if(fs[_0x198d('0xc3')](_0x5c3728)){fs['createReadStream'](_0x5c3728)[_0x198d('0xc4')](fs['createWriteStream'](path[_0x198d('0x73')](_0x26b92f,_0x81526f[_0x198d('0x6f')][_0x198d('0x6b')])));}}return{'date':moment(_0x81526f[_0x198d('0x8a')])[_0x198d('0x7f')](_0x198d('0xba'))[_0x198d('0xbc')](),'sender':_0x81526f[_0x198d('0xb4')]===_0x198d('0x5b')?_0x81526f['User']?_0x81526f[_0x198d('0x7c')][_0x198d('0x4d')]:'System':_0x81526f['Contact']['firstName']+(_0x81526f[_0x198d('0xc5')]['lastName']?'\x20'+_0x81526f[_0x198d('0xc5')]['lastName']:''),'body':_0x81526f[_0x198d('0x6f')]?_0x81526f[_0x198d('0x6f')][_0x198d('0x6b')]:_0x81526f[_0x198d('0x2f')],'direction':_0x81526f[_0x198d('0xb4')]===_0x198d('0x5b')?'A':'C','secret':_0x81526f[_0x198d('0x8c')],'read':_0x81526f['read'],'attachment':_0x81526f[_0x198d('0x6f')]};})[_0x198d('0xc6')]()};return ejs[_0x198d('0xc7')](path['join'](config[_0x198d('0x74')],_0x198d('0xac'),_0x198d('0xc8'),'downloadInteraction.ejs'),{'interaction':_0x1fdc74})['then'](function(_0x20a048){var _0xadbc0b=path[_0x198d('0x73')](_0x26b92f,_0x198d('0xc9')+_0x1687cb['id']+'-'+_0x34a02b+_0x198d('0xca'));var _0x262a47={'path':_0xadbc0b,'channel':_0x198d('0xb8'),'interactionId':_0x1687cb['id']};return pdf[_0x198d('0xcb')](_0x20a048,_0x262a47);})[_0x198d('0x18')](function(){return new Promise(function(_0x2f1a97,_0x4ab7cc){zipdir(_0x26b92f,{'saveTo':_0x5c6f1b},function(_0x2cd0ab,_0x1ff145){if(_0x2cd0ab)return _0x4ab7cc(_0x2cd0ab);return _0x2f1a97(_0x1ff145);});})['then'](function(){return new BPromise(function(_0x1d573b,_0x5de48f){rimraf(_0x26b92f,function(_0x24cbe8){if(_0x24cbe8)_0x5de48f(_0x24cbe8);return _0x1d573b();});});})[_0x198d('0x18')](function(){return _0x32e65d[_0x198d('0x75')](_0x5c6f1b,_0x2e8bf9,function(_0x15dec3){if(_0x15dec3){logger[_0x198d('0x1d')](_0x198d('0xcc'),_0x15dec3);}else{fs[_0x198d('0xcd')](_0x5c6f1b);}});});});}else{return _0x32e65d[_0x198d('0x22')](0xc8);}})['catch'](handleError(_0x32e65d,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index cd6dc97..fba575d 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 _0xe79b=['../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x16743a,_0x34d3ad){var _0x5bf565=function(_0x299268){while(--_0x299268){_0x16743a['push'](_0x16743a['shift']());}};_0x5bf565(++_0x34d3ad);}(_0xe79b,0x10a));var _0xbe79=function(_0x1a87b3,_0x45ba68){_0x1a87b3=_0x1a87b3-0x0;var _0x37e84d=_0xe79b[_0x1a87b3];return _0x37e84d;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xbe79('0x0'))['db'][_0xbe79('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0xbe79('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xbe79('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbe79('0x4'),'afterDestroy':_0xbe79('0x5')};function emitEvent(_0x115547){return function(_0x46e3c8,_0x22172b,_0x5c6d0c){_0x46e3c8[_0xbe79('0x6')]({'attributes':['id'],'raw':!![]})[_0xbe79('0x7')](function(_0x5777e7){_0x46e3c8[_0xbe79('0x8')](_0xbe79('0x9'),_0x5777e7[_0xbe79('0xa')](function(_0xa68265){return{'id':_0xa68265['id']};}));return ChatMessage[_0xbe79('0xb')]({'where':{'ChatInteractionId':_0x46e3c8['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1835e9){_0x46e3c8[_0xbe79('0x8')](_0xbe79('0xc'),_0x1835e9[_0xbe79('0xd')]);ChatInteractionEvents[_0xbe79('0xe')](_0x115547+':'+_0x46e3c8['id'],_0x46e3c8);ChatInteractionEvents[_0xbe79('0xe')](_0x115547,_0x46e3c8);_0x5c6d0c(null);})[_0xbe79('0xf')](_0x5c6d0c(null));};}for(var e in events){if(events[_0xbe79('0x10')](e)){var event=events[e];ChatInteraction[_0xbe79('0x11')](e,emitEvent(event));}}module[_0xbe79('0x12')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xb21e=['unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction','update','remove','getUsers','setDataValue','Users','map','findAll','then'];(function(_0x1bdc63,_0x24b3b0){var _0x4d15a5=function(_0x342013){while(--_0x342013){_0x1bdc63['push'](_0x1bdc63['shift']());}};_0x4d15a5(++_0x24b3b0);}(_0xb21e,0xd3));var _0xeb21=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xb21e[_0x4b7b62];return _0x2280df;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xeb21('0x0'))['db'][_0xeb21('0x1')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xeb21('0x2'),'afterDestroy':_0xeb21('0x3')};function emitEvent(_0x5c75b7){return function(_0x4af675,_0x551f23,_0x3caab0){_0x4af675[_0xeb21('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2f5795){_0x4af675[_0xeb21('0x5')](_0xeb21('0x6'),_0x2f5795[_0xeb21('0x7')](function(_0x36983f){return{'id':_0x36983f['id']};}));return ChatMessage[_0xeb21('0x8')]({'where':{'ChatInteractionId':_0x4af675['id'],'direction':'in','read':![]},'raw':!![]});})[_0xeb21('0x9')](function(_0x1b9be7){_0x4af675['setDataValue'](_0xeb21('0xa'),_0x1b9be7[_0xeb21('0xb')]);ChatInteractionEvents[_0xeb21('0xc')](_0x5c75b7+':'+_0x4af675['id'],_0x4af675);ChatInteractionEvents[_0xeb21('0xc')](_0x5c75b7,_0x4af675);_0x3caab0(null);})[_0xeb21('0xd')](_0x3caab0(null));};}for(var e in events){if(events[_0xeb21('0xe')](e)){var event=events[e];ChatInteraction[_0xeb21('0xf')](e,emitEvent(event));}}module[_0xeb21('0x10')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index a63dbe6..2a48293 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 _0x06ef=['define','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports'];(function(_0x528a6e,_0x15abad){var _0x2cf224=function(_0x2c4e14){while(--_0x2c4e14){_0x528a6e['push'](_0x528a6e['shift']());}};_0x2cf224(++_0x15abad);}(_0x06ef,0x1c9));var _0xf06e=function(_0x15d469,_0x533556){_0x15d469=_0x15d469-0x0;var _0x3dccfd=_0x06ef[_0x15d469];return _0x3dccfd;};'use strict';var _=require(_0xf06e('0x0'));var util=require(_0xf06e('0x1'));var logger=require(_0xf06e('0x2'))(_0xf06e('0x3'));var moment=require(_0xf06e('0x4'));var BPromise=require('bluebird');var rp=require(_0xf06e('0x5'));var fs=require('fs');var path=require(_0xf06e('0x6'));var rimraf=require(_0xf06e('0x7'));var config=require(_0xf06e('0x8'));var attributes=require(_0xf06e('0x9'));module[_0xf06e('0xa')]=function(_0x605c13,_0x275f9c){return _0x605c13[_0xf06e('0xb')](_0xf06e('0xc'),attributes,{'tableName':_0xf06e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x320266,_0x5873d4,_0x41ed9d){if(_0x320266[_0xf06e('0xe')](_0xf06e('0xf'))){_0x320266['closedAt']=moment()[_0xf06e('0x10')](_0xf06e('0x11'));}_0x41ed9d(null,_0x320266);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x893b=['api','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x42dbaa,_0x5e4227){var _0x1fd2ec=function(_0x56a8d7){while(--_0x56a8d7){_0x42dbaa['push'](_0x42dbaa['shift']());}};_0x1fd2ec(++_0x5e4227);}(_0x893b,0x76));var _0xb893=function(_0x2b55bb,_0x508372){_0x2b55bb=_0x2b55bb-0x0;var _0x1e3223=_0x893b[_0x2b55bb];return _0x1e3223;};'use strict';var _=require('lodash');var util=require(_0xb893('0x0'));var logger=require('../../config/logger')(_0xb893('0x1'));var moment=require('moment');var BPromise=require(_0xb893('0x2'));var rp=require(_0xb893('0x3'));var fs=require('fs');var path=require(_0xb893('0x4'));var rimraf=require('rimraf');var config=require(_0xb893('0x5'));var attributes=require(_0xb893('0x6'));module[_0xb893('0x7')]=function(_0x1a220d,_0x4ff286){return _0x1a220d['define'](_0xb893('0x8'),attributes,{'tableName':_0xb893('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x892e36,_0x73f59c,_0x48a13a){if(_0x892e36[_0xb893('0xa')](_0xb893('0xb'))){_0x892e36[_0xb893('0xc')]=moment()[_0xb893('0xd')](_0xb893('0xe'));}_0x48a13a(null,_0x892e36);}},'charset':_0xb893('0xf'),'collate':_0xb893('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index c21ba16..3f5975a 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 _0xa831=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','AddTags','lodash'];(function(_0xa4c85,_0x2b52a7){var _0x172c1f=function(_0x149473){while(--_0x149473){_0xa4c85['push'](_0xa4c85['shift']());}};_0x172c1f(++_0x2b52a7);}(_0xa831,0x18b));var _0x1a83=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0xa831[_0x39e84d];return _0x1991bc;};'use strict';var _=require(_0x1a83('0x0'));var util=require('util');var moment=require(_0x1a83('0x1'));var BPromise=require(_0x1a83('0x2'));var rs=require(_0x1a83('0x3'));var fs=require('fs');var Redis=require(_0x1a83('0x4'));var db=require(_0x1a83('0x5'))['db'];var utils=require(_0x1a83('0x6'));var logger=require(_0x1a83('0x7'))('rpc');var config=require(_0x1a83('0x8'));var jayson=require(_0x1a83('0x9'));var client=jayson[_0x1a83('0xa')]['http']({'port':0x232a});config['redis']=_[_0x1a83('0xb')](config[_0x1a83('0xc')],{'host':_0x1a83('0xd'),'port':0x18eb});var socket=require(_0x1a83('0xe'))(new Redis(config[_0x1a83('0xc')]));require(_0x1a83('0xf'))[_0x1a83('0x10')](socket);function respondWithRpcPromise(_0x3b7d34,_0xebb3f4,_0x47ecf7){return new BPromise(function(_0x20e5a8,_0x5ebfd0){return client['request'](_0x3b7d34,_0x47ecf7)[_0x1a83('0x11')](function(_0x5a5233){logger[_0x1a83('0x12')](_0x1a83('0x13'),_0xebb3f4,'request\x20sent');logger[_0x1a83('0x14')](_0x1a83('0x15'),_0xebb3f4,_0x1a83('0x16'),JSON['stringify'](_0x5a5233));if(_0x5a5233[_0x1a83('0x17')]){if(_0x5a5233[_0x1a83('0x17')][_0x1a83('0x18')]===0x1f4){logger['error'](_0x1a83('0x13'),_0xebb3f4,_0x5a5233[_0x1a83('0x17')][_0x1a83('0x19')]);return _0x5ebfd0(_0x5a5233[_0x1a83('0x17')]['message']);}logger[_0x1a83('0x17')](_0x1a83('0x13'),_0xebb3f4,_0x5a5233[_0x1a83('0x17')][_0x1a83('0x19')]);return _0x20e5a8(_0x5a5233['error']['message']);}else{logger[_0x1a83('0x12')](_0x1a83('0x13'),_0xebb3f4,'request\x20sent');_0x20e5a8(_0x5a5233[_0x1a83('0x1a')]['message']);}})[_0x1a83('0x1b')](function(_0x290e1f){logger['error'](_0x1a83('0x13'),_0xebb3f4,_0x290e1f);_0x5ebfd0(_0x290e1f);});});}exports[_0x1a83('0x1c')]=function(_0x4e41ea){var _0x29f29c=this;return new Promise(function(_0x432433,_0x3e7ca8){return db[_0x1a83('0x1d')][_0x1a83('0x1e')](_0x4e41ea[_0x1a83('0x1f')],{'raw':_0x4e41ea['options']?_0x4e41ea[_0x1a83('0x20')][_0x1a83('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e41ea[_0x1a83('0x20')]?_0x4e41ea['options'][_0x1a83('0x22')]||null:null,'attributes':_0x4e41ea[_0x1a83('0x20')]?_0x4e41ea['options'][_0x1a83('0x23')]||null:null,'limit':_0x4e41ea[_0x1a83('0x20')]?_0x4e41ea['options'][_0x1a83('0x24')]||null:null})[_0x1a83('0x11')](function(_0x12cd43){logger['info'](_0x1a83('0x1c'),_0x4e41ea);logger['debug'](_0x1a83('0x1c'),_0x4e41ea,JSON[_0x1a83('0x25')](_0x12cd43));_0x432433(_0x12cd43);})[_0x1a83('0x1b')](function(_0x2f5d94){logger[_0x1a83('0x17')](_0x1a83('0x1c'),_0x2f5d94[_0x1a83('0x19')],_0x4e41ea);_0x3e7ca8(_0x29f29c[_0x1a83('0x17')](0x1f4,_0x2f5d94[_0x1a83('0x19')]));});});};exports[_0x1a83('0x26')]=function(_0x67058c){return new Promise(function(_0x48234b,_0x22b80c){return db['ChatInteraction'][_0x1a83('0x27')]({'where':_0x67058c['options']?_0x67058c[_0x1a83('0x20')][_0x1a83('0x22')]||null:null})[_0x1a83('0x11')](function(_0x461275){if(_0x461275){return _0x461275[_0x1a83('0x28')](_0x67058c[_0x1a83('0x1f')][_0x1a83('0x29')],_[_0x1a83('0x2a')](_0x67058c[_0x1a83('0x1f')],[_0x1a83('0x29'),'id'])||{});}})['spread'](function(_0x2cbbea){logger['info'](_0x1a83('0x2b'),_0x67058c);logger['debug'](_0x1a83('0x2b'),_0x67058c,JSON[_0x1a83('0x25')](_0x2cbbea));_0x48234b(_0x2cbbea);})[_0x1a83('0x1b')](function(_0x1c0d8d){logger['error'](_0x1a83('0x2b'),_0x1c0d8d[_0x1a83('0x19')],_0x67058c);_0x22b80c(_this[_0x1a83('0x17')](0x1f4,_0x1c0d8d[_0x1a83('0x19')]));});});};
\ No newline at end of file
+var _0x5e8c=['then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ChatInteraction','body','options','where','limit','UpdateChatInteraction','stringify','find','addTags','omit','ids','spread','AddTags','debug','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register'];(function(_0x5f0738,_0x2f431a){var _0x35737f=function(_0x42129f){while(--_0x42129f){_0x5f0738['push'](_0x5f0738['shift']());}};_0x35737f(++_0x2f431a);}(_0x5e8c,0xe0));var _0xc5e8=function(_0xe032f8,_0x30c69e){_0xe032f8=_0xe032f8-0x0;var _0x412b79=_0x5e8c[_0xe032f8];return _0x412b79;};'use strict';var _=require(_0xc5e8('0x0'));var util=require(_0xc5e8('0x1'));var moment=require(_0xc5e8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5e8('0x3'));var db=require(_0xc5e8('0x4'))['db'];var utils=require(_0xc5e8('0x5'));var logger=require(_0xc5e8('0x6'))('rpc');var config=require(_0xc5e8('0x7'));var jayson=require(_0xc5e8('0x8'));var client=jayson[_0xc5e8('0x9')][_0xc5e8('0xa')]({'port':0x232a});config[_0xc5e8('0xb')]=_[_0xc5e8('0xc')](config[_0xc5e8('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xc5e8('0xd'))(new Redis(config[_0xc5e8('0xb')]));require(_0xc5e8('0xe'))[_0xc5e8('0xf')](socket);function respondWithRpcPromise(_0x432dc1,_0x334eaa,_0x2b0c03){return new BPromise(function(_0x27c2b7,_0x330983){return client['request'](_0x432dc1,_0x2b0c03)[_0xc5e8('0x10')](function(_0x560f91){logger[_0xc5e8('0x11')](_0xc5e8('0x12'),_0x334eaa,'request\x20sent');logger['debug'](_0xc5e8('0x13'),_0x334eaa,_0xc5e8('0x14'),JSON['stringify'](_0x560f91));if(_0x560f91[_0xc5e8('0x15')]){if(_0x560f91[_0xc5e8('0x15')][_0xc5e8('0x16')]===0x1f4){logger['error'](_0xc5e8('0x12'),_0x334eaa,_0x560f91['error'][_0xc5e8('0x17')]);return _0x330983(_0x560f91['error']['message']);}logger[_0xc5e8('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x334eaa,_0x560f91['error'][_0xc5e8('0x17')]);return _0x27c2b7(_0x560f91['error'][_0xc5e8('0x17')]);}else{logger[_0xc5e8('0x11')](_0xc5e8('0x12'),_0x334eaa,'request\x20sent');_0x27c2b7(_0x560f91[_0xc5e8('0x18')][_0xc5e8('0x17')]);}})[_0xc5e8('0x19')](function(_0x5b1f7c){logger[_0xc5e8('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x334eaa,_0x5b1f7c);_0x330983(_0x5b1f7c);});});}exports['UpdateChatInteraction']=function(_0x3cb3c6){var _0x5a6791=this;return new Promise(function(_0x48d7c1,_0x142e6a){return db[_0xc5e8('0x1a')]['update'](_0x3cb3c6[_0xc5e8('0x1b')],{'raw':_0x3cb3c6[_0xc5e8('0x1c')]?_0x3cb3c6[_0xc5e8('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cb3c6[_0xc5e8('0x1c')]?_0x3cb3c6[_0xc5e8('0x1c')][_0xc5e8('0x1d')]||null:null,'attributes':_0x3cb3c6['options']?_0x3cb3c6[_0xc5e8('0x1c')]['attributes']||null:null,'limit':_0x3cb3c6[_0xc5e8('0x1c')]?_0x3cb3c6[_0xc5e8('0x1c')][_0xc5e8('0x1e')]||null:null})[_0xc5e8('0x10')](function(_0x593c60){logger[_0xc5e8('0x11')](_0xc5e8('0x1f'),_0x3cb3c6);logger['debug']('UpdateChatInteraction',_0x3cb3c6,JSON[_0xc5e8('0x20')](_0x593c60));_0x48d7c1(_0x593c60);})[_0xc5e8('0x19')](function(_0x34907f){logger[_0xc5e8('0x15')]('UpdateChatInteraction',_0x34907f['message'],_0x3cb3c6);_0x142e6a(_0x5a6791[_0xc5e8('0x15')](0x1f4,_0x34907f['message']));});});};exports['AddTagsToChatInteraction']=function(_0x532013){return new Promise(function(_0x7801c3,_0x2d9af6){return db[_0xc5e8('0x1a')][_0xc5e8('0x21')]({'where':_0x532013['options']?_0x532013['options'][_0xc5e8('0x1d')]||null:null})['then'](function(_0xd1e0c7){if(_0xd1e0c7){return _0xd1e0c7[_0xc5e8('0x22')](_0x532013[_0xc5e8('0x1b')]['ids'],_[_0xc5e8('0x23')](_0x532013[_0xc5e8('0x1b')],[_0xc5e8('0x24'),'id'])||{});}})[_0xc5e8('0x25')](function(_0x5b1e8b){logger['info'](_0xc5e8('0x26'),_0x532013);logger[_0xc5e8('0x27')](_0xc5e8('0x26'),_0x532013,JSON[_0xc5e8('0x20')](_0x5b1e8b));_0x7801c3(_0x5b1e8b);})[_0xc5e8('0x19')](function(_0x2cb393){logger[_0xc5e8('0x15')](_0xc5e8('0x26'),_0x2cb393[_0xc5e8('0x17')],_0x532013);_0x2d9af6(_this[_0xc5e8('0x15')](0x1f4,_0x2cb393[_0xc5e8('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 2597eb8..4fe0af8 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 _0x4634=['removeListener','register','length','save','remove','update','emit'];(function(_0x205a12,_0x5d1d07){var _0x2ae9cc=function(_0x3b2e01){while(--_0x3b2e01){_0x205a12['push'](_0x205a12['shift']());}};_0x2ae9cc(++_0x5d1d07);}(_0x4634,0xe3));var _0x4463=function(_0x584981,_0x879ae2){_0x584981=_0x584981-0x0;var _0x5c9992=_0x4634[_0x584981];return _0x5c9992;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x4463('0x0'),_0x4463('0x1'),_0x4463('0x2')];function createListener(_0xed2d17,_0x2458b1){return function(_0x3252a4){_0x2458b1[_0x4463('0x3')](_0xed2d17,_0x3252a4);};}function removeListener(_0x4ad792,_0x18ff63){return function(){ChatInteractionEvents[_0x4463('0x4')](_0x4ad792,_0x18ff63);};}exports[_0x4463('0x5')]=function(_0x4b7dc3){for(var _0x449d81=0x0,_0x18f97a=events[_0x4463('0x6')];_0x449d81<_0x18f97a;_0x449d81++){var _0x22a9ae=events[_0x449d81];var _0x235705=createListener('chatInteraction:'+_0x22a9ae,_0x4b7dc3);ChatInteractionEvents['on'](_0x22a9ae,_0x235705);}};
\ No newline at end of file
+var _0x9acd=['save','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x441d10,_0x50971e){var _0x23680a=function(_0x3d6ba3){while(--_0x3d6ba3){_0x441d10['push'](_0x441d10['shift']());}};_0x23680a(++_0x50971e);}(_0x9acd,0x76));var _0xd9ac=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x9acd[_0xc6be3a];return _0x56a310;};'use strict';var ChatInteractionEvents=require(_0xd9ac('0x0'));var events=[_0xd9ac('0x1'),'remove','update'];function createListener(_0x1ddf3f,_0x5c9e84){return function(_0x566442){_0x5c9e84[_0xd9ac('0x2')](_0x1ddf3f,_0x566442);};}function removeListener(_0x1c0cd3,_0x4c9b08){return function(){ChatInteractionEvents[_0xd9ac('0x3')](_0x1c0cd3,_0x4c9b08);};}exports[_0xd9ac('0x4')]=function(_0x340104){for(var _0x3fec24=0x0,_0x295a7c=events[_0xd9ac('0x5')];_0x3fec24<_0x295a7c;_0x3fec24++){var _0x346a54=events[_0x3fec24];var _0x2f4d8b=createListener(_0xd9ac('0x6')+_0x346a54,_0x340104);ChatInteractionEvents['on'](_0x346a54,_0x2f4d8b);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 831bb25..1f0f78a 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 _0xfcc9=['delete','destroy','removeTags','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','originalname','single','file','attachmentUpload','addMessage','/:id/tags','addTags','put','tracked','chat','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close'];(function(_0x3246a6,_0x2a685a){var _0x1df64d=function(_0x4868ad){while(--_0x4868ad){_0x3246a6['push'](_0x3246a6['shift']());}};_0x1df64d(++_0x2a685a);}(_0xfcc9,0x161));var _0x9fcc=function(_0x2d126e,_0x1e8257){_0x2d126e=_0x2d126e-0x0;var _0xcb04d3=_0xfcc9[_0x2d126e];return _0xcb04d3;};'use strict';var multer=require(_0x9fcc('0x0'));var util=require(_0x9fcc('0x1'));var path=require(_0x9fcc('0x2'));var timeout=require(_0x9fcc('0x3'));var express=require('express');var router=express[_0x9fcc('0x4')]();var fs_extra=require(_0x9fcc('0x5'));var auth=require(_0x9fcc('0x6'));var interaction=require(_0x9fcc('0x7'));var config=require('../../config/environment');var controller=require(_0x9fcc('0x8'));router[_0x9fcc('0x9')]('/',auth[_0x9fcc('0xa')](),controller[_0x9fcc('0xb')]);router[_0x9fcc('0x9')](_0x9fcc('0xc'),auth[_0x9fcc('0xa')](),controller['describe']);router[_0x9fcc('0x9')](_0x9fcc('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x9fcc('0xe')]);router[_0x9fcc('0x9')](_0x9fcc('0xf'),auth[_0x9fcc('0x10')](),controller['attachmentDownload']);router[_0x9fcc('0x9')](_0x9fcc('0x11'),auth[_0x9fcc('0xa')](),controller[_0x9fcc('0x12')]);router[_0x9fcc('0x9')](_0x9fcc('0x13'),auth[_0x9fcc('0x10')](),controller[_0x9fcc('0x14')]);router[_0x9fcc('0x9')](_0x9fcc('0x15'),auth[_0x9fcc('0xa')](),controller[_0x9fcc('0x16')]);router['post']('/',auth[_0x9fcc('0xa')](),controller[_0x9fcc('0x17')]);router[_0x9fcc('0x18')](_0x9fcc('0x19'),auth['isAuthenticated'](),controller[_0x9fcc('0x1a')]);var upload=multer({'storage':multer[_0x9fcc('0x1b')]({'destination':function(_0x845f5a,_0x1f7191,_0x901c64){_0x901c64(null,path[_0x9fcc('0x1c')](config[_0x9fcc('0x1d')],_0x9fcc('0x1e')));},'filename':function(_0x9b9ddf,_0x41ffa1,_0x45bba5){_0x45bba5(null,util['format']('%s-%s',Date['now'](),_0x41ffa1[_0x9fcc('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x9fcc('0x20')](_0x9fcc('0x21')),controller[_0x9fcc('0x22')]);router['post'](_0x9fcc('0x11'),auth[_0x9fcc('0x10')](),controller[_0x9fcc('0x23')]);router[_0x9fcc('0x18')](_0x9fcc('0x24'),auth[_0x9fcc('0xa')](),interaction['tracked']('chat','chatinteraction:addtags'),controller[_0x9fcc('0x25')]);router[_0x9fcc('0x26')](_0x9fcc('0xd'),auth[_0x9fcc('0xa')](),interaction[_0x9fcc('0x27')](_0x9fcc('0x28'),'chatinteraction:update'),controller[_0x9fcc('0x29')]);router['put'](_0x9fcc('0x2a'),controller[_0x9fcc('0x2b')]);router['put'](_0x9fcc('0x2c'),auth['isChatInteractionAuthorized'](),controller[_0x9fcc('0x2d')]);router['put']('/:id/close',controller[_0x9fcc('0x2e')]);router[_0x9fcc('0x2f')]('/:id',auth[_0x9fcc('0xa')](),interaction[_0x9fcc('0x27')]('chat','chatinteraction:destroy'),controller[_0x9fcc('0x30')]);router[_0x9fcc('0x2f')](_0x9fcc('0x24'),auth[_0x9fcc('0xa')](),controller[_0x9fcc('0x31')]);module['exports']=router;
\ No newline at end of file
+var _0x6fc7=['/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','root','server/files/attachments/','now','originalname','single','file','attachmentUpload','addMessage','/:id/tags','chat','addTags','update','customUpdate','put','/:id/abandon','abandon','/:id/close','close','delete','tracked','chatinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe'];(function(_0x21ed88,_0x574daa){var _0x133e35=function(_0x407dc4){while(--_0x407dc4){_0x21ed88['push'](_0x21ed88['shift']());}};_0x133e35(++_0x574daa);}(_0x6fc7,0x8d));var _0x76fc=function(_0x451e42,_0x2d71ea){_0x451e42=_0x451e42-0x0;var _0x484342=_0x6fc7[_0x451e42];return _0x484342;};'use strict';var multer=require('multer');var util=require(_0x76fc('0x0'));var path=require(_0x76fc('0x1'));var timeout=require(_0x76fc('0x2'));var express=require('express');var router=express[_0x76fc('0x3')]();var fs_extra=require(_0x76fc('0x4'));var auth=require(_0x76fc('0x5'));var interaction=require(_0x76fc('0x6'));var config=require(_0x76fc('0x7'));var controller=require(_0x76fc('0x8'));router[_0x76fc('0x9')]('/',auth[_0x76fc('0xa')](),controller['index']);router[_0x76fc('0x9')](_0x76fc('0xb'),auth[_0x76fc('0xa')](),controller['describe']);router[_0x76fc('0x9')](_0x76fc('0xc'),auth['isChatInteractionAuthorized'](),controller[_0x76fc('0xd')]);router[_0x76fc('0x9')](_0x76fc('0xe'),auth[_0x76fc('0xf')](),controller[_0x76fc('0x10')]);router['get'](_0x76fc('0x11'),auth[_0x76fc('0xa')](),controller[_0x76fc('0x12')]);router[_0x76fc('0x9')](_0x76fc('0x13'),auth['isChatInteractionAuthorized'](),controller[_0x76fc('0x14')]);router[_0x76fc('0x9')](_0x76fc('0x15'),auth['isAuthenticated'](),controller[_0x76fc('0x16')]);router[_0x76fc('0x17')]('/',auth[_0x76fc('0xa')](),controller[_0x76fc('0x18')]);router[_0x76fc('0x17')](_0x76fc('0x19'),auth[_0x76fc('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x76fc('0x1a')]({'destination':function(_0x23f7e4,_0x421dfc,_0x35f4d3){_0x35f4d3(null,path['join'](config[_0x76fc('0x1b')],_0x76fc('0x1c')));},'filename':function(_0x333e25,_0x2b467e,_0x43f743){_0x43f743(null,util['format']('%s-%s',Date[_0x76fc('0x1d')](),_0x2b467e[_0x76fc('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x76fc('0x17')]('/:id/attachment_upload',upload[_0x76fc('0x1f')](_0x76fc('0x20')),controller[_0x76fc('0x21')]);router[_0x76fc('0x17')](_0x76fc('0x11'),auth[_0x76fc('0xf')](),controller[_0x76fc('0x22')]);router[_0x76fc('0x17')](_0x76fc('0x23'),auth[_0x76fc('0xa')](),interaction['tracked'](_0x76fc('0x24'),'chatinteraction:addtags'),controller[_0x76fc('0x25')]);router['put'](_0x76fc('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0x76fc('0x24'),'chatinteraction:update'),controller[_0x76fc('0x26')]);router['put']('/:id/custom_update',controller[_0x76fc('0x27')]);router[_0x76fc('0x28')](_0x76fc('0x29'),auth[_0x76fc('0xf')](),controller[_0x76fc('0x2a')]);router['put'](_0x76fc('0x2b'),controller[_0x76fc('0x2c')]);router[_0x76fc('0x2d')](_0x76fc('0xc'),auth[_0x76fc('0xa')](),interaction[_0x76fc('0x2e')](_0x76fc('0x24'),_0x76fc('0x2f')),controller[_0x76fc('0x30')]);router[_0x76fc('0x2d')]('/:id/tags',auth[_0x76fc('0xa')](),controller[_0x76fc('0x31')]);module[_0x76fc('0x32')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 250bc62..2ccfa07 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 _0xeb15=['TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x4369ef,_0x33cde3){var _0xf9dac4=function(_0x3f9af1){while(--_0x3f9af1){_0x4369ef['push'](_0x4369ef['shift']());}};_0xf9dac4(++_0x33cde3);}(_0xeb15,0x10d));var _0x5eb1=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0xeb15[_0x31b5a5];return _0x364cc9;};'use strict';var Sequelize=require(_0x5eb1('0x0'));module['exports']={'body':{'type':Sequelize[_0x5eb1('0x1')](_0x5eb1('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5eb1('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5eb1('0x4')]}};
\ No newline at end of file
+var _0x5453=['medium','BOOLEAN','INTEGER','exports','TEXT'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x5453,0x1a2));var _0x3545=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5453[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x3545('0x0')]={'body':{'type':Sequelize[_0x3545('0x1')](_0x3545('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3545('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x3545('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index d972fbb..237e934 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 _0xe363=['userProfileId','UserProfileResource','isEmpty','agent','resourceId','push','ToId','read','-createdAt','eml-format','rimraf','zip-dir','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','catch','options','create','body','params','describe','messages','createdAt','lastMessage','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','User','findAll','admin','user','fullname','userpic','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Agents'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe363,0x1bd));var _0x3e36=function(_0x25d87d,_0xad468c){_0x25d87d=_0x25d87d-0x0;var _0x54e42b=_0xe363[_0x25d87d];return _0x54e42b;};'use strict';var emlformat=require(_0x3e36('0x0'));var rimraf=require(_0x3e36('0x1'));var zipdir=require(_0x3e36('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3e36('0x3'));var util=require('util');var path=require(_0x3e36('0x4'));var sox=require('sox');var csv=require(_0x3e36('0x5'));var ejs=require(_0x3e36('0x6'));var fs=require('fs');var fs_extra=require(_0x3e36('0x7'));var _=require(_0x3e36('0x8'));var squel=require(_0x3e36('0x9'));var crypto=require(_0x3e36('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3e36('0xb'));var Papa=require(_0x3e36('0xc'));var Redis=require(_0x3e36('0xd'));var authService=require(_0x3e36('0xe'));var qs=require(_0x3e36('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e36('0x10'));var logger=require(_0x3e36('0x11'))(_0x3e36('0x12'));var utils=require(_0x3e36('0x13'));var config=require(_0x3e36('0x14'));var licenseUtil=require(_0x3e36('0x15'));var db=require(_0x3e36('0x16'))['db'];config[_0x3e36('0x17')]=_[_0x3e36('0x18')](config[_0x3e36('0x17')],{'host':_0x3e36('0x19'),'port':0x18eb});var socket=require(_0x3e36('0x1a'))(new Redis(config[_0x3e36('0x17')]));require('./chatInternalMessage.socket')[_0x3e36('0x1b')](socket);function respondWithStatusCode(_0x5c4afe,_0x5f8ae2){_0x5f8ae2=_0x5f8ae2||0xcc;return function(_0x2f5a4e){if(_0x2f5a4e){return _0x5c4afe['sendStatus'](_0x5f8ae2);}return _0x5c4afe[_0x3e36('0x1c')](_0x5f8ae2)[_0x3e36('0x1d')]();};}function respondWithResult(_0x41654f,_0xc6970){_0xc6970=_0xc6970||0xc8;return function(_0xcda193){if(_0xcda193){return _0x41654f['status'](_0xc6970)['json'](_0xcda193);}};}function respondWithFilteredResult(_0x16b9ee,_0x3a059f){return function(_0x49c422){if(_0x49c422){var _0x5bef23=typeof _0x3a059f[_0x3e36('0x1e')]===_0x3e36('0x1f')&&typeof _0x3a059f['limit']===_0x3e36('0x1f');var _0xedf502=_0x49c422[_0x3e36('0x20')];var _0x12f0d7=_0x5bef23?0x0:_0x3a059f[_0x3e36('0x1e')];var _0x11895c=_0x5bef23?_0x49c422['count']:_0x3a059f['offset']+_0x3a059f[_0x3e36('0x21')];var _0xa23342;if(_0x11895c>=_0xedf502){_0x11895c=_0xedf502;_0xa23342=0xc8;}else{_0xa23342=0xce;}_0x16b9ee[_0x3e36('0x1c')](_0xa23342);return _0x16b9ee['set'](_0x3e36('0x22'),_0x12f0d7+'-'+_0x11895c+'/'+_0xedf502)[_0x3e36('0x23')](_0x49c422);}return null;};}function patchUpdates(_0x43386e){return function(_0x180831){try{jsonpatch[_0x3e36('0x24')](_0x180831,_0x43386e,!![]);}catch(_0x296c33){return BPromise[_0x3e36('0x25')](_0x296c33);}return _0x180831[_0x3e36('0x26')]();};}function saveUpdates(_0x2b5e90,_0xe2cbf8){return function(_0x4ff7d6){if(_0x4ff7d6){return _0x4ff7d6[_0x3e36('0x27')](_0x2b5e90)[_0x3e36('0x28')](function(_0x3df290){return _0x3df290;});}return null;};}function removeEntity(_0x2474a7,_0x3a3b79){return function(_0x5a8b62){if(_0x5a8b62){return _0x5a8b62[_0x3e36('0x29')]()[_0x3e36('0x28')](function(){_0x2474a7[_0x3e36('0x1c')](0xcc)[_0x3e36('0x1d')]();});}};}function handleEntityNotFound(_0x250f6e,_0x500a85){return function(_0xe37eaf){if(!_0xe37eaf){_0x250f6e[_0x3e36('0x2a')](0x194);}return _0xe37eaf;};}function handleError(_0x12a802,_0x146852){_0x146852=_0x146852||0x1f4;return function(_0x4aa750){logger[_0x3e36('0x2b')](_0x4aa750[_0x3e36('0x2c')]);if(_0x4aa750[_0x3e36('0x2d')]){delete _0x4aa750[_0x3e36('0x2d')];}_0x12a802[_0x3e36('0x1c')](_0x146852)[_0x3e36('0x2e')](_0x4aa750);};}exports[_0x3e36('0x2f')]=function(_0x3733a9,_0x384a22){var _0x54826d={},_0x23c644={},_0x1ed197={'count':0x0,'rows':[]};var _0x1d18d5=_[_0x3e36('0x30')](db[_0x3e36('0x31')][_0x3e36('0x32')],function(_0x49963b){return{'name':_0x49963b[_0x3e36('0x33')],'type':_0x49963b[_0x3e36('0x34')]['key']};});_0x23c644[_0x3e36('0x35')]=_[_0x3e36('0x30')](_0x1d18d5,_0x3e36('0x2d'));_0x23c644[_0x3e36('0x36')]=_[_0x3e36('0x37')](_0x3733a9[_0x3e36('0x36')]);_0x23c644[_0x3e36('0x38')]=_['intersection'](_0x23c644[_0x3e36('0x35')],_0x23c644[_0x3e36('0x36')]);_0x54826d[_0x3e36('0x39')]=_[_0x3e36('0x3a')](_0x23c644[_0x3e36('0x35')],qs[_0x3e36('0x3b')](_0x3733a9[_0x3e36('0x36')][_0x3e36('0x3b')]));_0x54826d[_0x3e36('0x39')]=_0x54826d['attributes'][_0x3e36('0x3c')]?_0x54826d[_0x3e36('0x39')]:_0x23c644['model'];if(!_0x3733a9[_0x3e36('0x36')][_0x3e36('0x3d')](_0x3e36('0x3e'))){_0x54826d[_0x3e36('0x21')]=qs[_0x3e36('0x21')](_0x3733a9[_0x3e36('0x36')]['limit']);_0x54826d[_0x3e36('0x1e')]=qs[_0x3e36('0x1e')](_0x3733a9['query'][_0x3e36('0x1e')]);}_0x54826d[_0x3e36('0x3f')]=qs[_0x3e36('0x40')](_0x3733a9[_0x3e36('0x36')]['sort']);_0x54826d[_0x3e36('0x41')]=qs[_0x3e36('0x38')](_['pick'](_0x3733a9[_0x3e36('0x36')],_0x23c644[_0x3e36('0x38')]),_0x1d18d5);if(_0x3733a9[_0x3e36('0x36')][_0x3e36('0x42')]){_0x54826d[_0x3e36('0x41')]=_[_0x3e36('0x43')](_0x54826d['where'],{'$or':_['map'](_0x1d18d5,function(_0x4ae395){if(_0x4ae395[_0x3e36('0x34')]!==_0x3e36('0x44')){var _0x1432b5={};_0x1432b5[_0x4ae395[_0x3e36('0x2d')]]={'$like':'%'+_0x3733a9[_0x3e36('0x36')][_0x3e36('0x42')]+'%'};return _0x1432b5;}})});}_0x54826d=_['merge']({},_0x54826d,_0x3733a9['options']);var _0x227af1={'where':_0x54826d[_0x3e36('0x41')]};return db['ChatInternalMessage']['count'](_0x227af1)[_0x3e36('0x28')](function(_0x2119f4){_0x1ed197[_0x3e36('0x20')]=_0x2119f4;if(_0x3733a9[_0x3e36('0x36')]['includeAll']){_0x54826d[_0x3e36('0x45')]=[{'all':!![]}];}return db[_0x3e36('0x31')]['findAll'](_0x54826d);})[_0x3e36('0x28')](function(_0x91e414){_0x1ed197['rows']=_0x91e414;return _0x1ed197;})[_0x3e36('0x28')](respondWithFilteredResult(_0x384a22,_0x54826d))[_0x3e36('0x46')](handleError(_0x384a22,null));};exports['show']=function(_0x428231,_0x258310){var _0x2147ba={'raw':!![],'where':{'id':_0x428231['params']['id']}},_0x2152ca={};_0x2152ca[_0x3e36('0x35')]=_[_0x3e36('0x37')](db[_0x3e36('0x31')]['rawAttributes']);_0x2152ca['query']=_[_0x3e36('0x37')](_0x428231[_0x3e36('0x36')]);_0x2152ca[_0x3e36('0x38')]=_[_0x3e36('0x3a')](_0x2152ca['model'],_0x2152ca[_0x3e36('0x36')]);_0x2147ba[_0x3e36('0x39')]=_[_0x3e36('0x3a')](_0x2152ca['model'],qs['fields'](_0x428231[_0x3e36('0x36')]['fields']));_0x2147ba[_0x3e36('0x39')]=_0x2147ba['attributes']['length']?_0x2147ba[_0x3e36('0x39')]:_0x2152ca[_0x3e36('0x35')];if(_0x428231[_0x3e36('0x36')]['includeAll']){_0x2147ba['include']=[{'all':!![]}];}_0x2147ba=_[_0x3e36('0x43')]({},_0x2147ba,_0x428231[_0x3e36('0x47')]);return db[_0x3e36('0x31')]['find'](_0x2147ba)['then'](handleEntityNotFound(_0x258310,null))['then'](respondWithResult(_0x258310,null))[_0x3e36('0x46')](handleError(_0x258310,null));};exports['create']=function(_0x421076,_0x51f5f3){return db['ChatInternalMessage'][_0x3e36('0x48')](_0x421076[_0x3e36('0x49')],{})[_0x3e36('0x28')](respondWithResult(_0x51f5f3,0xc9))[_0x3e36('0x46')](handleError(_0x51f5f3,null));};exports[_0x3e36('0x27')]=function(_0x2f8846,_0x2352de){if(_0x2f8846[_0x3e36('0x49')]['id']){delete _0x2f8846[_0x3e36('0x49')]['id'];}return db[_0x3e36('0x31')]['find']({'where':{'id':_0x2f8846[_0x3e36('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2352de,null))[_0x3e36('0x28')](saveUpdates(_0x2f8846[_0x3e36('0x49')],null))[_0x3e36('0x28')](respondWithResult(_0x2352de,null))[_0x3e36('0x46')](handleError(_0x2352de,null));};exports[_0x3e36('0x29')]=function(_0x5667b9,_0x3b3e13){return db[_0x3e36('0x31')]['find']({'where':{'id':_0x5667b9[_0x3e36('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3b3e13,null))[_0x3e36('0x28')](removeEntity(_0x3b3e13,null))[_0x3e36('0x46')](handleError(_0x3b3e13,null));};exports[_0x3e36('0x4b')]=function(_0x338e9d,_0x5693aa){return db[_0x3e36('0x31')][_0x3e36('0x4b')]()[_0x3e36('0x28')](respondWithResult(_0x5693aa,null))[_0x3e36('0x46')](handleError(_0x5693aa,null));};function wrapUser(_0x3a5898){return function(_0x5cbcd3){var _0xa8a425=_0x3a5898['get']({'plain':!![]});_0xa8a425[_0x3e36('0x4c')]=[];if(_0x5cbcd3){_0xa8a425['lastMessageAt']=_0x5cbcd3[_0x3e36('0x4d')];_0xa8a425[_0x3e36('0x4e')]=_0x5cbcd3;}else{_0xa8a425[_0x3e36('0x4f')]=moment(0x0)['format'](_0x3e36('0x50'));_0xa8a425['lastMessage']={};}return _0xa8a425;};}exports['getUsers']=function(_0x5a6697,_0x4553cf,_0x5aefdb){var _0x2ad2a8=[];return db[_0x3e36('0x51')][_0x3e36('0x52')]({'where':{'role':['agent',_0x3e36('0x53'),_0x3e36('0x54')]},'attributes':['id',_0x3e36('0x55'),_0x3e36('0x2d'),'role',_0x3e36('0x56'),_0x3e36('0x57'),_0x3e36('0x58'),_0x3e36('0x59'),'allowmessenger',_0x3e36('0x5a')],'order':qs['sort'](_0x3e36('0x5b')),'include':[{'model':db[_0x3e36('0x5c')],'as':_0x3e36('0x5d'),'attributes':['id',_0x3e36('0x2d'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x41222d){if(_0x41222d){var _0x289e78=_0x5a6697[_0x3e36('0x54')][_0x3e36('0x5e')]({'plain':!![]});if(!_0x289e78)throw new Error(_0x3e36('0x5f'));if(_0x289e78[_0x3e36('0x60')]==='user'){return db[_0x3e36('0x61')][_0x3e36('0x62')]({'where':{'name':_0x3e36('0x63'),'userProfileId':_0x289e78[_0x3e36('0x64')]},'raw':!![]})[_0x3e36('0x28')](function(_0x2ea843){if(_0x2ea843){if(_0x2ea843['autoAssociation']===0x0){return db[_0x3e36('0x65')][_0x3e36('0x52')]({'where':{'sectionId':_0x2ea843['id']},'raw':!![]})['then'](function(_0x294c85){var _0x4108a9=[];if(_[_0x3e36('0x66')](_0x294c85)){_0x4108a9=_[_0x3e36('0x42')](_0x41222d,function(_0x49eeb4){if(_0x49eeb4[_0x3e36('0x60')]!==_0x3e36('0x67')){return _0x49eeb4;}});return _0x4108a9;}else{for(var _0x439ad3=0x0;_0x439ad3<_0x41222d['length'];_0x439ad3++){var _0x51b5e3=_0x41222d[_0x439ad3];if(_0x51b5e3['role']==='agent'){var _0x197287=_['find'](_0x294c85,function(_0x258036){return _0x258036[_0x3e36('0x68')]===_0x51b5e3['id'];});if(_0x197287)_0x4108a9[_0x3e36('0x69')](_0x51b5e3);}else{_0x4108a9[_0x3e36('0x69')](_0x51b5e3);}}return _0x4108a9;}});}else{return _0x41222d;}}else{var _0x5a54e1=_[_0x3e36('0x42')](_0x41222d,function(_0x3818a6){if(_0x3818a6[_0x3e36('0x60')]!==_0x3e36('0x67')){return _0x3818a6;}});return _0x5a54e1;}});}else{return _0x41222d;}}})[_0x3e36('0x28')](function(_0x1c4cfd){var _0x40d61c=[];if(_0x1c4cfd){_0x2ad2a8=_0x1c4cfd;for(var _0x309d64=0x0;_0x309d64<_0x1c4cfd[_0x3e36('0x3c')];_0x309d64+=0x1){_0x2ad2a8[_0x309d64][_0x3e36('0x4c')]=[];_0x40d61c['push'](db['ChatInternalMessage'][_0x3e36('0x62')]({'where':{'FromId':[_0x5a6697['user']['id'],_0x1c4cfd[_0x309d64]['id']],'ToId':[_0x5a6697[_0x3e36('0x54')]['id'],_0x1c4cfd[_0x309d64]['id']],'ChatGroupId':null},'attributes':['id',_0x3e36('0x4d'),'FromId',_0x3e36('0x6a'),_0x3e36('0x6b'),_0x3e36('0x49')],'order':qs[_0x3e36('0x40')](_0x3e36('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x3e36('0x28')](wrapUser(_0x1c4cfd[_0x309d64])));}return BPromise['all'](_0x40d61c);}return[];})[_0x3e36('0x28')](function(_0x3256ea){return{'rows':_0x3256ea,'count':_0x3256ea[_0x3e36('0x3c')]};})[_0x3e36('0x28')](respondWithResult(_0x4553cf,null))[_0x3e36('0x46')](handleError(_0x4553cf,null));};
\ No newline at end of file
+var _0x636a=['allowmessenger','-online','VoiceQueue','VoiceQueues','role','UserProfileSection','autoAssociation','UserProfileResource','findAll','isEmpty','length','resourceId','push','FromId','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','map','ChatInternalMessage','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','agent','admin','user','fullname','userpic','internal','online','lastLoginAt'];(function(_0x45738b,_0x1d7363){var _0x3a91c5=function(_0x1a54e7){while(--_0x1a54e7){_0x45738b['push'](_0x45738b['shift']());}};_0x3a91c5(++_0x1d7363);}(_0x636a,0x15b));var _0xa636=function(_0xf1f37e,_0x159a20){_0xf1f37e=_0xf1f37e-0x0;var _0x2e3a6d=_0x636a[_0xf1f37e];return _0x2e3a6d;};'use strict';var emlformat=require(_0xa636('0x0'));var rimraf=require(_0xa636('0x1'));var zipdir=require(_0xa636('0x2'));var jsonpatch=require(_0xa636('0x3'));var rp=require(_0xa636('0x4'));var moment=require(_0xa636('0x5'));var BPromise=require(_0xa636('0x6'));var Mustache=require(_0xa636('0x7'));var util=require(_0xa636('0x8'));var path=require(_0xa636('0x9'));var sox=require(_0xa636('0xa'));var csv=require(_0xa636('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa636('0xc'));var _=require('lodash');var squel=require(_0xa636('0xd'));var crypto=require(_0xa636('0xe'));var jsforce=require(_0xa636('0xf'));var deskjs=require(_0xa636('0x10'));var toCsv=require(_0xa636('0xb'));var querystring=require(_0xa636('0x11'));var Papa=require(_0xa636('0x12'));var Redis=require(_0xa636('0x13'));var authService=require(_0xa636('0x14'));var qs=require(_0xa636('0x15'));var as=require(_0xa636('0x16'));var hardwareService=require(_0xa636('0x17'));var logger=require(_0xa636('0x18'))(_0xa636('0x19'));var utils=require('../../config/utils');var config=require(_0xa636('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xa636('0x1b')]=_['defaults'](config[_0xa636('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xa636('0x1c'))(new Redis(config[_0xa636('0x1b')]));require(_0xa636('0x1d'))[_0xa636('0x1e')](socket);function respondWithStatusCode(_0x408377,_0x1643dc){_0x1643dc=_0x1643dc||0xcc;return function(_0x1f271b){if(_0x1f271b){return _0x408377[_0xa636('0x1f')](_0x1643dc);}return _0x408377[_0xa636('0x20')](_0x1643dc)['end']();};}function respondWithResult(_0x2a049a,_0x178d3d){_0x178d3d=_0x178d3d||0xc8;return function(_0x568433){if(_0x568433){return _0x2a049a[_0xa636('0x20')](_0x178d3d)[_0xa636('0x21')](_0x568433);}};}function respondWithFilteredResult(_0x5182e7,_0xe9c546){return function(_0x1b6cdc){if(_0x1b6cdc){var _0x1efa7f=typeof _0xe9c546[_0xa636('0x22')]===_0xa636('0x23')&&typeof _0xe9c546['limit']===_0xa636('0x23');var _0x2a7fcc=_0x1b6cdc[_0xa636('0x24')];var _0x8f0787=_0x1efa7f?0x0:_0xe9c546['offset'];var _0x2f398d=_0x1efa7f?_0x1b6cdc['count']:_0xe9c546[_0xa636('0x22')]+_0xe9c546[_0xa636('0x25')];var _0x3f0172;if(_0x2f398d>=_0x2a7fcc){_0x2f398d=_0x2a7fcc;_0x3f0172=0xc8;}else{_0x3f0172=0xce;}_0x5182e7[_0xa636('0x20')](_0x3f0172);return _0x5182e7['set'](_0xa636('0x26'),_0x8f0787+'-'+_0x2f398d+'/'+_0x2a7fcc)[_0xa636('0x21')](_0x1b6cdc);}return null;};}function patchUpdates(_0x4660b7){return function(_0x4150ba){try{jsonpatch[_0xa636('0x27')](_0x4150ba,_0x4660b7,!![]);}catch(_0x67b903){return BPromise[_0xa636('0x28')](_0x67b903);}return _0x4150ba['save']();};}function saveUpdates(_0x3d2294,_0x7c9884){return function(_0x41f97b){if(_0x41f97b){return _0x41f97b[_0xa636('0x29')](_0x3d2294)[_0xa636('0x2a')](function(_0xf9ecd5){return _0xf9ecd5;});}return null;};}function removeEntity(_0x4fd857,_0x5d0894){return function(_0x300112){if(_0x300112){return _0x300112[_0xa636('0x2b')]()[_0xa636('0x2a')](function(){_0x4fd857[_0xa636('0x20')](0xcc)[_0xa636('0x2c')]();});}};}function handleEntityNotFound(_0xfb7ec4,_0x5dab3d){return function(_0x5d0021){if(!_0x5d0021){_0xfb7ec4[_0xa636('0x1f')](0x194);}return _0x5d0021;};}function handleError(_0x101ef3,_0x5420c9){_0x5420c9=_0x5420c9||0x1f4;return function(_0x454530){logger['error'](_0x454530[_0xa636('0x2d')]);if(_0x454530[_0xa636('0x2e')]){delete _0x454530[_0xa636('0x2e')];}_0x101ef3[_0xa636('0x20')](_0x5420c9)[_0xa636('0x2f')](_0x454530);};}exports['index']=function(_0x2af7f0,_0x8c1510){var _0x4c85d5={},_0x265d1a={},_0x1ebda0={'count':0x0,'rows':[]};var _0x3a41c9=_[_0xa636('0x30')](db[_0xa636('0x31')]['rawAttributes'],function(_0x16aa13){return{'name':_0x16aa13[_0xa636('0x32')],'type':_0x16aa13[_0xa636('0x33')][_0xa636('0x34')]};});_0x265d1a[_0xa636('0x35')]=_['map'](_0x3a41c9,_0xa636('0x2e'));_0x265d1a[_0xa636('0x36')]=_['keys'](_0x2af7f0[_0xa636('0x36')]);_0x265d1a['filters']=_[_0xa636('0x37')](_0x265d1a[_0xa636('0x35')],_0x265d1a[_0xa636('0x36')]);_0x4c85d5[_0xa636('0x38')]=_[_0xa636('0x37')](_0x265d1a[_0xa636('0x35')],qs['fields'](_0x2af7f0[_0xa636('0x36')][_0xa636('0x39')]));_0x4c85d5['attributes']=_0x4c85d5[_0xa636('0x38')]['length']?_0x4c85d5[_0xa636('0x38')]:_0x265d1a[_0xa636('0x35')];if(!_0x2af7f0['query'][_0xa636('0x3a')]('nolimit')){_0x4c85d5[_0xa636('0x25')]=qs[_0xa636('0x25')](_0x2af7f0[_0xa636('0x36')]['limit']);_0x4c85d5[_0xa636('0x22')]=qs[_0xa636('0x22')](_0x2af7f0[_0xa636('0x36')][_0xa636('0x22')]);}_0x4c85d5['order']=qs[_0xa636('0x3b')](_0x2af7f0[_0xa636('0x36')][_0xa636('0x3b')]);_0x4c85d5[_0xa636('0x3c')]=qs[_0xa636('0x3d')](_[_0xa636('0x3e')](_0x2af7f0[_0xa636('0x36')],_0x265d1a[_0xa636('0x3d')]),_0x3a41c9);if(_0x2af7f0[_0xa636('0x36')][_0xa636('0x3f')]){_0x4c85d5['where']=_[_0xa636('0x40')](_0x4c85d5[_0xa636('0x3c')],{'$or':_[_0xa636('0x30')](_0x3a41c9,function(_0x2102e2){if(_0x2102e2[_0xa636('0x33')]!==_0xa636('0x41')){var _0x495bbd={};_0x495bbd[_0x2102e2[_0xa636('0x2e')]]={'$like':'%'+_0x2af7f0[_0xa636('0x36')][_0xa636('0x3f')]+'%'};return _0x495bbd;}})});}_0x4c85d5=_[_0xa636('0x40')]({},_0x4c85d5,_0x2af7f0[_0xa636('0x42')]);var _0x2fad65={'where':_0x4c85d5[_0xa636('0x3c')]};return db[_0xa636('0x31')]['count'](_0x2fad65)[_0xa636('0x2a')](function(_0x3b8d27){_0x1ebda0[_0xa636('0x24')]=_0x3b8d27;if(_0x2af7f0[_0xa636('0x36')][_0xa636('0x43')]){_0x4c85d5[_0xa636('0x44')]=[{'all':!![]}];}return db[_0xa636('0x31')]['findAll'](_0x4c85d5);})[_0xa636('0x2a')](function(_0x517c1d){_0x1ebda0[_0xa636('0x45')]=_0x517c1d;return _0x1ebda0;})[_0xa636('0x2a')](respondWithFilteredResult(_0x8c1510,_0x4c85d5))[_0xa636('0x46')](handleError(_0x8c1510,null));};exports[_0xa636('0x47')]=function(_0xaac959,_0x26b659){var _0x55f1a8={'raw':!![],'where':{'id':_0xaac959[_0xa636('0x48')]['id']}},_0x1ef7e0={};_0x1ef7e0[_0xa636('0x35')]=_['keys'](db[_0xa636('0x31')][_0xa636('0x49')]);_0x1ef7e0[_0xa636('0x36')]=_['keys'](_0xaac959[_0xa636('0x36')]);_0x1ef7e0[_0xa636('0x3d')]=_[_0xa636('0x37')](_0x1ef7e0['model'],_0x1ef7e0[_0xa636('0x36')]);_0x55f1a8[_0xa636('0x38')]=_[_0xa636('0x37')](_0x1ef7e0[_0xa636('0x35')],qs[_0xa636('0x39')](_0xaac959[_0xa636('0x36')]['fields']));_0x55f1a8[_0xa636('0x38')]=_0x55f1a8[_0xa636('0x38')]['length']?_0x55f1a8[_0xa636('0x38')]:_0x1ef7e0[_0xa636('0x35')];if(_0xaac959[_0xa636('0x36')][_0xa636('0x43')]){_0x55f1a8['include']=[{'all':!![]}];}_0x55f1a8=_[_0xa636('0x40')]({},_0x55f1a8,_0xaac959[_0xa636('0x42')]);return db['ChatInternalMessage'][_0xa636('0x4a')](_0x55f1a8)[_0xa636('0x2a')](handleEntityNotFound(_0x26b659,null))[_0xa636('0x2a')](respondWithResult(_0x26b659,null))['catch'](handleError(_0x26b659,null));};exports[_0xa636('0x4b')]=function(_0xf6c38b,_0x2db202){return db[_0xa636('0x31')][_0xa636('0x4b')](_0xf6c38b[_0xa636('0x4c')],{})[_0xa636('0x2a')](respondWithResult(_0x2db202,0xc9))[_0xa636('0x46')](handleError(_0x2db202,null));};exports[_0xa636('0x29')]=function(_0xa70622,_0x355fbd){if(_0xa70622[_0xa636('0x4c')]['id']){delete _0xa70622[_0xa636('0x4c')]['id'];}return db[_0xa636('0x31')][_0xa636('0x4a')]({'where':{'id':_0xa70622[_0xa636('0x48')]['id']}})['then'](handleEntityNotFound(_0x355fbd,null))[_0xa636('0x2a')](saveUpdates(_0xa70622[_0xa636('0x4c')],null))[_0xa636('0x2a')](respondWithResult(_0x355fbd,null))[_0xa636('0x46')](handleError(_0x355fbd,null));};exports[_0xa636('0x2b')]=function(_0x16f5c8,_0x17c5d0){return db[_0xa636('0x31')][_0xa636('0x4a')]({'where':{'id':_0x16f5c8['params']['id']}})['then'](handleEntityNotFound(_0x17c5d0,null))[_0xa636('0x2a')](removeEntity(_0x17c5d0,null))['catch'](handleError(_0x17c5d0,null));};exports[_0xa636('0x4d')]=function(_0x96a429,_0x282414){return db[_0xa636('0x31')][_0xa636('0x4d')]()[_0xa636('0x2a')](respondWithResult(_0x282414,null))[_0xa636('0x46')](handleError(_0x282414,null));};function wrapUser(_0x491fa0){return function(_0x25c3ef){var _0x598fd6=_0x491fa0[_0xa636('0x4e')]({'plain':!![]});_0x598fd6[_0xa636('0x4f')]=[];if(_0x25c3ef){_0x598fd6[_0xa636('0x50')]=_0x25c3ef[_0xa636('0x51')];_0x598fd6[_0xa636('0x52')]=_0x25c3ef;}else{_0x598fd6[_0xa636('0x50')]=moment(0x0)[_0xa636('0x53')](_0xa636('0x54'));_0x598fd6[_0xa636('0x52')]={};}return _0x598fd6;};}exports['getUsers']=function(_0x1f88b1,_0x33012b,_0x541f12){var _0x2b1177=[];return db['User']['findAll']({'where':{'role':[_0xa636('0x55'),_0xa636('0x56'),_0xa636('0x57')]},'attributes':['id',_0xa636('0x58'),_0xa636('0x2e'),'role',_0xa636('0x59'),_0xa636('0x5a'),_0xa636('0x5b'),_0xa636('0x5c'),_0xa636('0x5d'),'showWebBar'],'order':qs[_0xa636('0x3b')](_0xa636('0x5e')),'include':[{'model':db[_0xa636('0x5f')],'as':_0xa636('0x60'),'attributes':['id','name',_0xa636('0x33')],'through':{'attributes':[]}}]})[_0xa636('0x2a')](function(_0xacac1a){if(_0xacac1a){var _0x3a0577=_0x1f88b1[_0xa636('0x57')][_0xa636('0x4e')]({'plain':!![]});if(!_0x3a0577)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a0577[_0xa636('0x61')]===_0xa636('0x57')){return db[_0xa636('0x62')][_0xa636('0x4a')]({'where':{'name':'Agents','userProfileId':_0x3a0577['userProfileId']},'raw':!![]})[_0xa636('0x2a')](function(_0x711f73){if(_0x711f73){if(_0x711f73[_0xa636('0x63')]===0x0){return db[_0xa636('0x64')][_0xa636('0x65')]({'where':{'sectionId':_0x711f73['id']},'raw':!![]})[_0xa636('0x2a')](function(_0x55fb0b){var _0x2a9bec=[];if(_[_0xa636('0x66')](_0x55fb0b)){_0x2a9bec=_['filter'](_0xacac1a,function(_0x3d5a71){if(_0x3d5a71[_0xa636('0x61')]!==_0xa636('0x55')){return _0x3d5a71;}});return _0x2a9bec;}else{for(var _0x38fa75=0x0;_0x38fa75<_0xacac1a[_0xa636('0x67')];_0x38fa75++){var _0xb83328=_0xacac1a[_0x38fa75];if(_0xb83328['role']===_0xa636('0x55')){var _0x4e851d=_['find'](_0x55fb0b,function(_0x1232d1){return _0x1232d1[_0xa636('0x68')]===_0xb83328['id'];});if(_0x4e851d)_0x2a9bec[_0xa636('0x69')](_0xb83328);}else{_0x2a9bec[_0xa636('0x69')](_0xb83328);}}return _0x2a9bec;}});}else{return _0xacac1a;}}else{var _0x22cffc=_[_0xa636('0x3f')](_0xacac1a,function(_0x28b730){if(_0x28b730['role']!=='agent'){return _0x28b730;}});return _0x22cffc;}});}else{return _0xacac1a;}}})['then'](function(_0xb9d50d){var _0x10ebce=[];if(_0xb9d50d){_0x2b1177=_0xb9d50d;for(var _0xd4a4d0=0x0;_0xd4a4d0<_0xb9d50d[_0xa636('0x67')];_0xd4a4d0+=0x1){_0x2b1177[_0xd4a4d0]['messages']=[];_0x10ebce[_0xa636('0x69')](db[_0xa636('0x31')][_0xa636('0x4a')]({'where':{'FromId':[_0x1f88b1[_0xa636('0x57')]['id'],_0xb9d50d[_0xd4a4d0]['id']],'ToId':[_0x1f88b1[_0xa636('0x57')]['id'],_0xb9d50d[_0xd4a4d0]['id']],'ChatGroupId':null},'attributes':['id',_0xa636('0x51'),_0xa636('0x6a'),_0xa636('0x6b'),_0xa636('0x6c'),_0xa636('0x4c')],'order':qs[_0xa636('0x3b')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa636('0x2a')](wrapUser(_0xb9d50d[_0xd4a4d0])));}return BPromise[_0xa636('0x6d')](_0x10ebce);}return[];})[_0xa636('0x2a')](function(_0x3ec371){return{'rows':_0x3ec371,'count':_0x3ec371['length']};})[_0xa636('0x2a')](respondWithResult(_0x33012b,null))['catch'](handleError(_0x33012b,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index b9103f2..a630031 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 _0x4200=['hasOwnProperty','hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit'];(function(_0x152449,_0x49f41d){var _0x5b58b2=function(_0x226c30){while(--_0x226c30){_0x152449['push'](_0x152449['shift']());}};_0x5b58b2(++_0x49f41d);}(_0x4200,0x188));var _0x0420=function(_0x225536,_0x315c28){_0x225536=_0x225536-0x0;var _0x4c39e5=_0x4200[_0x225536];return _0x4c39e5;};'use strict';var EventEmitter=require(_0x0420('0x0'));var ChatInternalMessage=require(_0x0420('0x1'))['db'][_0x0420('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0420('0x3')](0x0);var events={'afterCreate':_0x0420('0x4'),'afterUpdate':_0x0420('0x5'),'afterDestroy':_0x0420('0x6')};function emitEvent(_0x3ab500){return function(_0x370bf7,_0x58c1d4,_0x3142a3){ChatInternalMessageEvents[_0x0420('0x7')](_0x3ab500+':'+_0x370bf7['id'],_0x370bf7);ChatInternalMessageEvents[_0x0420('0x7')](_0x3ab500,_0x370bf7);_0x3142a3(null);};}for(var e in events){if(events[_0x0420('0x8')](e)){var event=events[e];ChatInternalMessage[_0x0420('0x9')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x8e65=['update','remove','emit','hasOwnProperty','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x24e473,_0x3fdd50){var _0x3a3b78=function(_0x5d1f54){while(--_0x5d1f54){_0x24e473['push'](_0x24e473['shift']());}};_0x3a3b78(++_0x3fdd50);}(_0x8e65,0x1ac));var _0x58e6=function(_0x3df4aa,_0x1d5dcf){_0x3df4aa=_0x3df4aa-0x0;var _0x30ca47=_0x8e65[_0x3df4aa];return _0x30ca47;};'use strict';var EventEmitter=require(_0x58e6('0x0'));var ChatInternalMessage=require(_0x58e6('0x1'))['db'][_0x58e6('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x58e6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x58e6('0x4'),'afterDestroy':_0x58e6('0x5')};function emitEvent(_0x3efd67){return function(_0x2f73be,_0x6475f2,_0x536be3){ChatInternalMessageEvents[_0x58e6('0x6')](_0x3efd67+':'+_0x2f73be['id'],_0x2f73be);ChatInternalMessageEvents[_0x58e6('0x6')](_0x3efd67,_0x2f73be);_0x536be3(null);};}for(var e in events){if(events[_0x58e6('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 460ca13..b030528 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 _0x7903=['exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x8afdd0,_0x548ad1){var _0x3de7ac=function(_0x2dc2c4){while(--_0x2dc2c4){_0x8afdd0['push'](_0x8afdd0['shift']());}};_0x3de7ac(++_0x548ad1);}(_0x7903,0x148));var _0x3790=function(_0x3fbfc4,_0x244e54){_0x3fbfc4=_0x3fbfc4-0x0;var _0x469cb9=_0x7903[_0x3fbfc4];return _0x469cb9;};'use strict';var _=require(_0x3790('0x0'));var util=require(_0x3790('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3790('0x2'));var BPromise=require(_0x3790('0x3'));var rp=require(_0x3790('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3790('0x5'));var config=require(_0x3790('0x6'));var attributes=require(_0x3790('0x7'));module[_0x3790('0x8')]=function(_0xd129fb,_0x253ae9){return _0xd129fb[_0x3790('0x9')](_0x3790('0xa'),attributes,{'tableName':_0x3790('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3790('0xc'),'collate':_0x3790('0xd')});};
\ No newline at end of file
+var _0xf1a2=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x576119,_0x282fbe){var _0x540253=function(_0x24b26a){while(--_0x24b26a){_0x576119['push'](_0x576119['shift']());}};_0x540253(++_0x282fbe);}(_0xf1a2,0xc2));var _0x2f1a=function(_0x605fb9,_0x45062c){_0x605fb9=_0x605fb9-0x0;var _0x21040e=_0xf1a2[_0x605fb9];return _0x21040e;};'use strict';var _=require(_0x2f1a('0x0'));var util=require(_0x2f1a('0x1'));var logger=require('../../config/logger')(_0x2f1a('0x2'));var moment=require(_0x2f1a('0x3'));var BPromise=require(_0x2f1a('0x4'));var rp=require(_0x2f1a('0x5'));var fs=require('fs');var path=require(_0x2f1a('0x6'));var rimraf=require(_0x2f1a('0x7'));var config=require(_0x2f1a('0x8'));var attributes=require(_0x2f1a('0x9'));module[_0x2f1a('0xa')]=function(_0x148018,_0x3970cb){return _0x148018['define'](_0x2f1a('0xb'),attributes,{'tableName':_0x2f1a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2f1a('0xd'),'collate':_0x2f1a('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 728018a..1f91730 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 _0xd5bf=['register','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter'];(function(_0x25689f,_0x37a6fb){var _0x364094=function(_0x29b5d8){while(--_0x29b5d8){_0x25689f['push'](_0x25689f['shift']());}};_0x364094(++_0x37a6fb);}(_0xd5bf,0x66));var _0xfd5b=function(_0x5b338a,_0x254f6f){_0x5b338a=_0x5b338a-0x0;var _0x5b23f8=_0xd5bf[_0x5b338a];return _0x5b23f8;};'use strict';var _=require(_0xfd5b('0x0'));var util=require(_0xfd5b('0x1'));var moment=require(_0xfd5b('0x2'));var BPromise=require(_0xfd5b('0x3'));var rs=require(_0xfd5b('0x4'));var fs=require('fs');var Redis=require(_0xfd5b('0x5'));var db=require(_0xfd5b('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfd5b('0x7'));var config=require(_0xfd5b('0x8'));var jayson=require(_0xfd5b('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xfd5b('0xa')]=_[_0xfd5b('0xb')](config[_0xfd5b('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xfd5b('0xc'))(new Redis(config[_0xfd5b('0xa')]));require('./chatInternalMessage.socket')[_0xfd5b('0xd')](socket);function respondWithRpcPromise(_0x40b49b,_0x5eefe8,_0x20222a){return new BPromise(function(_0x56e7e7,_0x29ee53){return client['request'](_0x40b49b,_0x20222a)[_0xfd5b('0xe')](function(_0x4b3da7){logger[_0xfd5b('0xf')](_0xfd5b('0x10'),_0x5eefe8,'request\x20sent');logger['debug'](_0xfd5b('0x11'),_0x5eefe8,_0xfd5b('0x12'),JSON['stringify'](_0x4b3da7));if(_0x4b3da7[_0xfd5b('0x13')]){if(_0x4b3da7[_0xfd5b('0x13')][_0xfd5b('0x14')]===0x1f4){logger[_0xfd5b('0x13')](_0xfd5b('0x10'),_0x5eefe8,_0x4b3da7[_0xfd5b('0x13')][_0xfd5b('0x15')]);return _0x29ee53(_0x4b3da7[_0xfd5b('0x13')][_0xfd5b('0x15')]);}logger[_0xfd5b('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x5eefe8,_0x4b3da7[_0xfd5b('0x13')][_0xfd5b('0x15')]);return _0x56e7e7(_0x4b3da7[_0xfd5b('0x13')][_0xfd5b('0x15')]);}else{logger['info'](_0xfd5b('0x10'),_0x5eefe8,'request\x20sent');_0x56e7e7(_0x4b3da7['result'][_0xfd5b('0x15')]);}})[_0xfd5b('0x16')](function(_0x4bd45e){logger[_0xfd5b('0x13')](_0xfd5b('0x10'),_0x5eefe8,_0x4bd45e);_0x29ee53(_0x4bd45e);});});}
\ No newline at end of file
+var _0x407c=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch'];(function(_0x542da8,_0x509c26){var _0x533d7e=function(_0x2a3d04){while(--_0x2a3d04){_0x542da8['push'](_0x542da8['shift']());}};_0x533d7e(++_0x509c26);}(_0x407c,0x68));var _0xc407=function(_0x342940,_0x5cbb91){_0x342940=_0x342940-0x0;var _0x5d5fe8=_0x407c[_0x342940];return _0x5d5fe8;};'use strict';var _=require(_0xc407('0x0'));var util=require('util');var moment=require(_0xc407('0x1'));var BPromise=require(_0xc407('0x2'));var rs=require(_0xc407('0x3'));var fs=require('fs');var Redis=require(_0xc407('0x4'));var db=require(_0xc407('0x5'))['db'];var utils=require(_0xc407('0x6'));var logger=require('../../config/logger')(_0xc407('0x7'));var config=require(_0xc407('0x8'));var jayson=require(_0xc407('0x9'));var client=jayson['client'][_0xc407('0xa')]({'port':0x232a});config['redis']=_[_0xc407('0xb')](config[_0xc407('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc407('0xd'))(new Redis(config[_0xc407('0xc')]));require(_0xc407('0xe'))[_0xc407('0xf')](socket);function respondWithRpcPromise(_0x370cc4,_0x7acab5,_0x2bcfa7){return new BPromise(function(_0x1abaf9,_0x1e0245){return client[_0xc407('0x10')](_0x370cc4,_0x2bcfa7)['then'](function(_0x1d94be){logger[_0xc407('0x11')](_0xc407('0x12'),_0x7acab5,'request\x20sent');logger[_0xc407('0x13')](_0xc407('0x14'),_0x7acab5,'request\x20sent',JSON['stringify'](_0x1d94be));if(_0x1d94be['error']){if(_0x1d94be[_0xc407('0x15')]['code']===0x1f4){logger[_0xc407('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x7acab5,_0x1d94be[_0xc407('0x15')]['message']);return _0x1e0245(_0x1d94be[_0xc407('0x15')][_0xc407('0x16')]);}logger[_0xc407('0x15')](_0xc407('0x12'),_0x7acab5,_0x1d94be[_0xc407('0x15')][_0xc407('0x16')]);return _0x1abaf9(_0x1d94be['error'][_0xc407('0x16')]);}else{logger['info'](_0xc407('0x12'),_0x7acab5,_0xc407('0x17'));_0x1abaf9(_0x1d94be[_0xc407('0x18')][_0xc407('0x16')]);}})[_0xc407('0x19')](function(_0x55b4d1){logger['error'](_0xc407('0x12'),_0x7acab5,_0x55b4d1);_0x1e0245(_0x55b4d1);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 5b356d4..fac6260 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 _0x0fee=['chatInternalMessage:','emit','removeListener','register','length'];(function(_0x2067e3,_0x19bcb2){var _0x180c44=function(_0x53751f){while(--_0x53751f){_0x2067e3['push'](_0x2067e3['shift']());}};_0x180c44(++_0x19bcb2);}(_0x0fee,0x1af));var _0xe0fe=function(_0x3646b4,_0x16af8f){_0x3646b4=_0x3646b4-0x0;var _0x16184a=_0x0fee[_0x3646b4];return _0x16184a;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save','remove','update'];function createListener(_0x53cbba,_0x4ac8fc){return function(_0x12d326){_0x4ac8fc[_0xe0fe('0x0')](_0x53cbba,_0x12d326);};}function removeListener(_0x10401f,_0x24db67){return function(){ChatInternalMessageEvents[_0xe0fe('0x1')](_0x10401f,_0x24db67);};}exports[_0xe0fe('0x2')]=function(_0x6850ec){for(var _0x3ce791=0x0,_0x483415=events[_0xe0fe('0x3')];_0x3ce791<_0x483415;_0x3ce791++){var _0x3e83f0=events[_0x3ce791];var _0x157361=createListener(_0xe0fe('0x4')+_0x3e83f0,_0x6850ec);ChatInternalMessageEvents['on'](_0x3e83f0,_0x157361);}};
\ No newline at end of file
+var _0x47cc=['length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','removeListener','register'];(function(_0x3a0dad,_0x4bbf9e){var _0x380070=function(_0x533fe3){while(--_0x533fe3){_0x3a0dad['push'](_0x3a0dad['shift']());}};_0x380070(++_0x4bbf9e);}(_0x47cc,0x132));var _0xc47c=function(_0x15a269,_0x142a09){_0x15a269=_0x15a269-0x0;var _0x2befa6=_0x47cc[_0x15a269];return _0x2befa6;};'use strict';var ChatInternalMessageEvents=require(_0xc47c('0x0'));var events=[_0xc47c('0x1'),_0xc47c('0x2'),_0xc47c('0x3')];function createListener(_0x4b0792,_0x4de7eb){return function(_0x2a04dc){_0x4de7eb['emit'](_0x4b0792,_0x2a04dc);};}function removeListener(_0x526327,_0x5dd443){return function(){ChatInternalMessageEvents[_0xc47c('0x4')](_0x526327,_0x5dd443);};}exports[_0xc47c('0x5')]=function(_0x3a9139){for(var _0x2d118b=0x0,_0x5232d4=events[_0xc47c('0x6')];_0x2d118b<_0x5232d4;_0x2d118b++){var _0x2e5441=events[_0x2d118b];var _0x1ab432=createListener(_0xc47c('0x7')+_0x2e5441,_0x3a9139);ChatInternalMessageEvents['on'](_0x2e5441,_0x1ab432);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index f16abec..483ef83 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 _0x733e=['isAuthenticated','/describe','describe','/users','getUsers','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get'];(function(_0x5305e6,_0x12781f){var _0x30c6f2=function(_0x423fe7){while(--_0x423fe7){_0x5305e6['push'](_0x5305e6['shift']());}};_0x30c6f2(++_0x12781f);}(_0x733e,0x115));var _0xe733=function(_0xe501ff,_0x955b7e){_0xe501ff=_0xe501ff-0x0;var _0x17135d=_0x733e[_0xe501ff];return _0x17135d;};'use strict';var multer=require(_0xe733('0x0'));var util=require(_0xe733('0x1'));var path=require(_0xe733('0x2'));var timeout=require(_0xe733('0x3'));var express=require('express');var router=express[_0xe733('0x4')]();var fs_extra=require(_0xe733('0x5'));var auth=require(_0xe733('0x6'));var interaction=require(_0xe733('0x7'));var config=require(_0xe733('0x8'));var controller=require(_0xe733('0x9'));router[_0xe733('0xa')]('/',auth[_0xe733('0xb')](),controller['index']);router[_0xe733('0xa')](_0xe733('0xc'),auth[_0xe733('0xb')](),controller[_0xe733('0xd')]);router['get'](_0xe733('0xe'),auth['isAuthenticated'](),controller[_0xe733('0xf')]);router['get'](_0xe733('0x10'),auth[_0xe733('0xb')](),controller[_0xe733('0x11')]);router[_0xe733('0x12')]('/',auth[_0xe733('0xb')](),controller[_0xe733('0x13')]);router['put']('/:id',controller[_0xe733('0x14')]);router[_0xe733('0x15')](_0xe733('0x10'),auth[_0xe733('0xb')](),controller[_0xe733('0x16')]);module[_0xe733('0x17')]=router;
\ No newline at end of file
+var _0x73ed=['multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/users','getUsers','/:id','show','post','create','put','delete','exports'];(function(_0x3f3f40,_0x4c71f4){var _0x403b7a=function(_0x509014){while(--_0x509014){_0x3f3f40['push'](_0x3f3f40['shift']());}};_0x403b7a(++_0x4c71f4);}(_0x73ed,0x1a4));var _0xd73e=function(_0x2f57fe,_0x329ba4){_0x2f57fe=_0x2f57fe-0x0;var _0x297fc8=_0x73ed[_0x2f57fe];return _0x297fc8;};'use strict';var multer=require(_0xd73e('0x0'));var util=require(_0xd73e('0x1'));var path=require('path');var timeout=require(_0xd73e('0x2'));var express=require(_0xd73e('0x3'));var router=express[_0xd73e('0x4')]();var fs_extra=require(_0xd73e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd73e('0x6'));var config=require('../../config/environment');var controller=require(_0xd73e('0x7'));router[_0xd73e('0x8')]('/',auth[_0xd73e('0x9')](),controller[_0xd73e('0xa')]);router[_0xd73e('0x8')]('/describe',auth[_0xd73e('0x9')](),controller['describe']);router['get'](_0xd73e('0xb'),auth[_0xd73e('0x9')](),controller[_0xd73e('0xc')]);router[_0xd73e('0x8')](_0xd73e('0xd'),auth[_0xd73e('0x9')](),controller[_0xd73e('0xe')]);router[_0xd73e('0xf')]('/',auth['isAuthenticated'](),controller[_0xd73e('0x10')]);router[_0xd73e('0x11')]('/:id',controller['update']);router[_0xd73e('0x12')](_0xd73e('0xd'),auth[_0xd73e('0x9')](),controller['destroy']);module[_0xd73e('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 1a18916..ffa66c6 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 _0x1bd1=['BOOLEAN','DATE','STRING','sequelize','exports','TEXT'];(function(_0x2ef476,_0x19dc5a){var _0x4c11b0=function(_0x5989dc){while(--_0x5989dc){_0x2ef476['push'](_0x2ef476['shift']());}};_0x4c11b0(++_0x19dc5a);}(_0x1bd1,0x123));var _0x11bd=function(_0x10cb1e,_0x1974aa){_0x10cb1e=_0x10cb1e-0x0;var _0x51bbc9=_0x1bd1[_0x10cb1e];return _0x51bbc9;};'use strict';var Sequelize=require(_0x11bd('0x0'));module[_0x11bd('0x1')]={'body':{'type':Sequelize[_0x11bd('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x11bd('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x11bd('0x4')]},'providerName':{'type':Sequelize[_0x11bd('0x5')]},'providerResponse':{'type':Sequelize[_0x11bd('0x2')]}};
\ No newline at end of file
+var _0x337f=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x337f,0x11c));var _0xf337=function(_0x393a82,_0x49f72a){_0x393a82=_0x393a82-0x0;var _0x2d9d99=_0x337f[_0x393a82];return _0x2d9d99;};'use strict';var Sequelize=require(_0xf337('0x0'));module[_0xf337('0x1')]={'body':{'type':Sequelize[_0xf337('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf337('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xf337('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf337('0x4')]('in','out'),'defaultValue':_0xf337('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf337('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xf337('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 20744e7..35ee221 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 _0xca52=['end','status','offset','undefined','limit','count','Content-Range','json','save','update','sendStatus','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','destroy','describe','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','chat-interactions','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT','fullname','email','interface','formData','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','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','defaults','redis','localhost','jayson/promise','request','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0xca52,0xdb));var _0x2ca5=function(_0x2ec1a2,_0x2213e8){_0x2ec1a2=_0x2ec1a2-0x0;var _0x5ee2d5=_0xca52[_0x2ec1a2];return _0x5ee2d5;};'use strict';var emlformat=require(_0x2ca5('0x0'));var rimraf=require(_0x2ca5('0x1'));var zipdir=require(_0x2ca5('0x2'));var jsonpatch=require(_0x2ca5('0x3'));var rp=require(_0x2ca5('0x4'));var moment=require(_0x2ca5('0x5'));var BPromise=require(_0x2ca5('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2ca5('0x7'));var sox=require(_0x2ca5('0x8'));var csv=require(_0x2ca5('0x9'));var ejs=require(_0x2ca5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2ca5('0xb'));var squel=require(_0x2ca5('0xc'));var crypto=require(_0x2ca5('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2ca5('0x9'));var querystring=require(_0x2ca5('0xe'));var Papa=require('papaparse');var Redis=require(_0x2ca5('0xf'));var authService=require(_0x2ca5('0x10'));var qs=require(_0x2ca5('0x11'));var as=require(_0x2ca5('0x12'));var hardwareService=require(_0x2ca5('0x13'));var logger=require(_0x2ca5('0x14'))(_0x2ca5('0x15'));var utils=require(_0x2ca5('0x16'));var config=require(_0x2ca5('0x17'));var licenseUtil=require(_0x2ca5('0x18'));var db=require(_0x2ca5('0x19'))['db'];config['redis']=_[_0x2ca5('0x1a')](config[_0x2ca5('0x1b')],{'host':_0x2ca5('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')['register'](socket);var jayson=require(_0x2ca5('0x1d'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x38fe3a,_0xede778,_0xb3d1dd,_0x3c86b7){return new BPromise(function(_0x19e33e,_0x4e2e4c){var _0x14e172=_0x3c86b7||client;return _0x14e172[_0x2ca5('0x1e')](_0x38fe3a,_0xb3d1dd)[_0x2ca5('0x1f')](function(_0x5ac534){logger[_0x2ca5('0x20')](_0x2ca5('0x21'),_0xede778,'request\x20sent');logger['debug'](_0x2ca5('0x22'),_0xede778,'request\x20sent',JSON[_0x2ca5('0x23')](_0x5ac534));if(_0x5ac534[_0x2ca5('0x24')]){if(_0x5ac534[_0x2ca5('0x24')]['code']===0x1f4){logger[_0x2ca5('0x24')](_0x2ca5('0x21'),_0xede778,_0x5ac534[_0x2ca5('0x24')][_0x2ca5('0x25')]);return _0x4e2e4c(_0x5ac534[_0x2ca5('0x24')][_0x2ca5('0x25')]);}logger['error'](_0x2ca5('0x21'),_0xede778,_0x5ac534[_0x2ca5('0x24')][_0x2ca5('0x25')]);return _0x19e33e(_0x5ac534[_0x2ca5('0x24')][_0x2ca5('0x25')]);}else{logger[_0x2ca5('0x20')](_0x2ca5('0x21'),_0xede778,_0x2ca5('0x26'));_0x19e33e(_0x5ac534[_0x2ca5('0x27')][_0x2ca5('0x25')]);}})[_0x2ca5('0x28')](function(_0x3be809){logger['error'](_0x2ca5('0x21'),_0xede778,_0x3be809);_0x4e2e4c(_0x3be809);});});}function respondWithStatusCode(_0x2a9296,_0x53dfc1){_0x53dfc1=_0x53dfc1||0xcc;return function(_0x292567){if(_0x292567){return _0x2a9296['sendStatus'](_0x53dfc1);}return _0x2a9296['status'](_0x53dfc1)[_0x2ca5('0x29')]();};}function respondWithResult(_0x333f89,_0x12ae7f){_0x12ae7f=_0x12ae7f||0xc8;return function(_0xf0119){if(_0xf0119){return _0x333f89[_0x2ca5('0x2a')](_0x12ae7f)['json'](_0xf0119);}};}function respondWithFilteredResult(_0x12f410,_0xc3920){return function(_0x336ab2){if(_0x336ab2){var _0x41fb84=typeof _0xc3920[_0x2ca5('0x2b')]===_0x2ca5('0x2c')&&typeof _0xc3920[_0x2ca5('0x2d')]===_0x2ca5('0x2c');var _0x484d3c=_0x336ab2[_0x2ca5('0x2e')];var _0x592964=_0x41fb84?0x0:_0xc3920[_0x2ca5('0x2b')];var _0x2d450c=_0x41fb84?_0x336ab2[_0x2ca5('0x2e')]:_0xc3920[_0x2ca5('0x2b')]+_0xc3920[_0x2ca5('0x2d')];var _0x5f1e6b;if(_0x2d450c>=_0x484d3c){_0x2d450c=_0x484d3c;_0x5f1e6b=0xc8;}else{_0x5f1e6b=0xce;}_0x12f410[_0x2ca5('0x2a')](_0x5f1e6b);return _0x12f410['set'](_0x2ca5('0x2f'),_0x592964+'-'+_0x2d450c+'/'+_0x484d3c)[_0x2ca5('0x30')](_0x336ab2);}return null;};}function patchUpdates(_0x119f94){return function(_0x576915){try{jsonpatch['apply'](_0x576915,_0x119f94,!![]);}catch(_0x5b8106){return BPromise['reject'](_0x5b8106);}return _0x576915[_0x2ca5('0x31')]();};}function saveUpdates(_0xea4d9c,_0x929899){return function(_0x519981){if(_0x519981){return _0x519981[_0x2ca5('0x32')](_0xea4d9c)['then'](function(_0x59a941){return _0x59a941;});}return null;};}function removeEntity(_0xdef9a2,_0xc7b308){return function(_0x26e7db){if(_0x26e7db){return _0x26e7db['destroy']()[_0x2ca5('0x1f')](function(){_0xdef9a2['status'](0xcc)[_0x2ca5('0x29')]();});}};}function handleEntityNotFound(_0x39efda,_0x1d831b){return function(_0x23b13d){if(!_0x23b13d){_0x39efda[_0x2ca5('0x33')](0x194);}return _0x23b13d;};}function handleError(_0x2df45e,_0x58fe8f){_0x58fe8f=_0x58fe8f||0x1f4;return function(_0x2ce0a7){logger[_0x2ca5('0x24')](_0x2ce0a7[_0x2ca5('0x34')]);if(_0x2ce0a7[_0x2ca5('0x35')]){delete _0x2ce0a7['name'];}_0x2df45e[_0x2ca5('0x2a')](_0x58fe8f)[_0x2ca5('0x36')](_0x2ce0a7);};}exports[_0x2ca5('0x37')]=function(_0x124a8a,_0x56e541){var _0x239c75={},_0x5d00d1={},_0x44c868={'count':0x0,'rows':[]};var _0x2314f0=_[_0x2ca5('0x38')](db[_0x2ca5('0x39')][_0x2ca5('0x3a')],function(_0x19c28b){return{'name':_0x19c28b[_0x2ca5('0x3b')],'type':_0x19c28b['type'][_0x2ca5('0x3c')]};});_0x5d00d1[_0x2ca5('0x3d')]=_[_0x2ca5('0x38')](_0x2314f0,'name');_0x5d00d1['query']=_[_0x2ca5('0x3e')](_0x124a8a[_0x2ca5('0x3f')]);_0x5d00d1[_0x2ca5('0x40')]=_[_0x2ca5('0x41')](_0x5d00d1[_0x2ca5('0x3d')],_0x5d00d1['query']);_0x239c75[_0x2ca5('0x42')]=_[_0x2ca5('0x41')](_0x5d00d1['model'],qs[_0x2ca5('0x43')](_0x124a8a[_0x2ca5('0x3f')][_0x2ca5('0x43')]));_0x239c75[_0x2ca5('0x42')]=_0x239c75['attributes']['length']?_0x239c75[_0x2ca5('0x42')]:_0x5d00d1[_0x2ca5('0x3d')];if(!_0x124a8a[_0x2ca5('0x3f')][_0x2ca5('0x44')](_0x2ca5('0x45'))){_0x239c75[_0x2ca5('0x2d')]=qs[_0x2ca5('0x2d')](_0x124a8a[_0x2ca5('0x3f')][_0x2ca5('0x2d')]);_0x239c75['offset']=qs[_0x2ca5('0x2b')](_0x124a8a['query'][_0x2ca5('0x2b')]);}_0x239c75['order']=qs[_0x2ca5('0x46')](_0x124a8a['query'][_0x2ca5('0x46')]);_0x239c75['where']=qs[_0x2ca5('0x40')](_['pick'](_0x124a8a[_0x2ca5('0x3f')],_0x5d00d1[_0x2ca5('0x40')]),_0x2314f0);if(_0x124a8a[_0x2ca5('0x3f')][_0x2ca5('0x47')]){_0x239c75[_0x2ca5('0x48')]=_['merge'](_0x239c75[_0x2ca5('0x48')],{'$or':_['map'](_0x2314f0,function(_0x566483){if(_0x566483['type']!==_0x2ca5('0x49')){var _0x4201fb={};_0x4201fb[_0x566483[_0x2ca5('0x35')]]={'$like':'%'+_0x124a8a[_0x2ca5('0x3f')][_0x2ca5('0x47')]+'%'};return _0x4201fb;}})});}_0x239c75=_[_0x2ca5('0x4a')]({},_0x239c75,_0x124a8a[_0x2ca5('0x4b')]);var _0x174a2f={'where':_0x239c75[_0x2ca5('0x48')]};return db[_0x2ca5('0x39')][_0x2ca5('0x2e')](_0x174a2f)[_0x2ca5('0x1f')](function(_0x42c081){_0x44c868[_0x2ca5('0x2e')]=_0x42c081;if(_0x124a8a[_0x2ca5('0x3f')][_0x2ca5('0x4c')]){_0x239c75[_0x2ca5('0x4d')]=[{'all':!![]}];}return db[_0x2ca5('0x39')][_0x2ca5('0x4e')](_0x239c75);})[_0x2ca5('0x1f')](function(_0x43e057){_0x44c868[_0x2ca5('0x4f')]=_0x43e057;return _0x44c868;})['then'](respondWithFilteredResult(_0x56e541,_0x239c75))[_0x2ca5('0x28')](handleError(_0x56e541,null));};exports[_0x2ca5('0x50')]=function(_0x177513,_0x440438){var _0x47dbfb={'raw':!![],'where':{'id':_0x177513[_0x2ca5('0x51')]['id']}},_0x2c9305={};_0x2c9305['model']=_[_0x2ca5('0x3e')](db['ChatMessage'][_0x2ca5('0x3a')]);_0x2c9305[_0x2ca5('0x3f')]=_['keys'](_0x177513[_0x2ca5('0x3f')]);_0x2c9305[_0x2ca5('0x40')]=_[_0x2ca5('0x41')](_0x2c9305[_0x2ca5('0x3d')],_0x2c9305['query']);_0x47dbfb[_0x2ca5('0x42')]=_[_0x2ca5('0x41')](_0x2c9305[_0x2ca5('0x3d')],qs['fields'](_0x177513['query']['fields']));_0x47dbfb[_0x2ca5('0x42')]=_0x47dbfb['attributes']['length']?_0x47dbfb[_0x2ca5('0x42')]:_0x2c9305[_0x2ca5('0x3d')];if(_0x177513['query'][_0x2ca5('0x4c')]){_0x47dbfb[_0x2ca5('0x4d')]=[{'all':!![]}];}_0x47dbfb=_[_0x2ca5('0x4a')]({},_0x47dbfb,_0x177513[_0x2ca5('0x4b')]);return db['ChatMessage'][_0x2ca5('0x52')](_0x47dbfb)['then'](handleEntityNotFound(_0x440438,null))[_0x2ca5('0x1f')](respondWithResult(_0x440438,null))['catch'](handleError(_0x440438,null));};exports['create']=function(_0x17a9e2,_0x4c2510){return db['ChatMessage'][_0x2ca5('0x53')](_0x17a9e2[_0x2ca5('0x54')],{})['then'](respondWithResult(_0x4c2510,0xc9))[_0x2ca5('0x28')](handleError(_0x4c2510,null));};exports[_0x2ca5('0x32')]=function(_0x3f9fce,_0x5b6df2){if(_0x3f9fce['body']['id']){delete _0x3f9fce[_0x2ca5('0x54')]['id'];}return db['ChatMessage'][_0x2ca5('0x52')]({'where':{'id':_0x3f9fce[_0x2ca5('0x51')]['id']}})['then'](handleEntityNotFound(_0x5b6df2,null))[_0x2ca5('0x1f')](saveUpdates(_0x3f9fce['body'],null))[_0x2ca5('0x1f')](respondWithResult(_0x5b6df2,null))[_0x2ca5('0x28')](handleError(_0x5b6df2,null));};exports[_0x2ca5('0x55')]=function(_0x334166,_0x1fd6da){return db[_0x2ca5('0x39')]['find']({'where':{'id':_0x334166[_0x2ca5('0x51')]['id']}})[_0x2ca5('0x1f')](handleEntityNotFound(_0x1fd6da,null))[_0x2ca5('0x1f')](removeEntity(_0x1fd6da,null))[_0x2ca5('0x28')](handleError(_0x1fd6da,null));};exports[_0x2ca5('0x56')]=function(_0x2cdcef,_0xd7c5ab){return db[_0x2ca5('0x39')][_0x2ca5('0x56')]()[_0x2ca5('0x1f')](respondWithResult(_0xd7c5ab,null))['catch'](handleError(_0xd7c5ab,null));};var interaction_log=require(_0x2ca5('0x14'))('chat-interactions');exports['accept']=function(_0x48ae13,_0x243d1d,_0xfb8589){var _0x4c58d7={'agent':{},'channel':_0x2ca5('0x57')};if(_0x48ae13[_0x2ca5('0x54')]['id']){delete _0x48ae13['body']['id'];}_0x48ae13[_0x2ca5('0x54')][_0x2ca5('0x58')]=!![];_0x48ae13[_0x2ca5('0x54')][_0x2ca5('0x59')]=moment()[_0x2ca5('0x5a')](_0x2ca5('0x5b'));_0x48ae13[_0x2ca5('0x54')][_0x2ca5('0x5c')]=_0x48ae13['body']['UserId']||_0x48ae13[_0x2ca5('0x5d')]['id'];_0x4c58d7[_0x2ca5('0x5e')]['id']=_0x48ae13['body']['UserId'];return db[_0x2ca5('0x39')][_0x2ca5('0x52')]({'where':{'id':_0x48ae13[_0x2ca5('0x51')]['id'],'UserId':null}})[_0x2ca5('0x1f')](handleEntityNotFound(_0x243d1d,null))['then'](saveUpdates(_0x48ae13[_0x2ca5('0x54')],null))[_0x2ca5('0x1f')](function(_0x4634c5){if(_0x4634c5){_0x4c58d7['message']=_0x4634c5[_0x2ca5('0x5f')]({'plain':!![]});return db[_0x2ca5('0x60')][_0x2ca5('0x52')]({'where':{'id':_0x4634c5[_0x2ca5('0x61')]}});}return null;})[_0x2ca5('0x1f')](handleEntityNotFound(_0x243d1d,null))[_0x2ca5('0x1f')](function(_0x2ae0fa){if(_0x2ae0fa){return _0x2ae0fa[_0x2ca5('0x32')]({'UserId':_0x48ae13[_0x2ca5('0x54')][_0x2ca5('0x5c')],'read1stAt':_[_0x2ca5('0x62')](_0x2ae0fa['read1stAt'])?moment()[_0x2ca5('0x5a')](_0x2ca5('0x5b')):undefined});}return null;})['then'](function(_0x1dc608){if(_0x1dc608){_0x4c58d7[_0x2ca5('0x63')]=_0x1dc608[_0x2ca5('0x5f')]({'plain':!![]});interaction_log[_0x2ca5('0x20')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x48ae13[_0x2ca5('0x5d')]['id'],_0x48ae13[_0x2ca5('0x5d')][_0x2ca5('0x35')],_0x48ae13[_0x2ca5('0x5d')][_0x2ca5('0x64')],_0x4c58d7[_0x2ca5('0x63')]['id'],_0x48ae13[_0x2ca5('0x54')]?JSON['stringify'](_0x48ae13[_0x2ca5('0x54')]):_0x2ca5('0x65'));return respondWithRpcPromise(_0x2ca5('0x66'),_0x2ca5('0x67'),_0x4c58d7);}return null;})[_0x2ca5('0x1f')](function(_0x49d7ed){var _0xa9847c=_0x2ca5('0x68')+_0x49d7ed[_0x2ca5('0x25')][_0x2ca5('0x69')];return db[_0x2ca5('0x6a')][_0x2ca5('0x3f')](_0xa9847c,{'type':db[_0x2ca5('0x6b')][_0x2ca5('0x6c')]['SELECT'],'raw':!![]})[_0x2ca5('0x1f')](function(_0x261ae3){return _0x261ae3;});})[_0x2ca5('0x1f')](function(_0x4f6c77){if(_0x4f6c77){_0x4c58d7[_0x2ca5('0x25')][_0x2ca5('0x6d')]=_0x4f6c77[0x0];if(!_0x48ae13[_0x2ca5('0x54')][_0x2ca5('0x5c')])return;return db[_0x2ca5('0x6e')]['find']({'where':{'id':_0x48ae13[_0x2ca5('0x54')][_0x2ca5('0x5c')],'role':_0x2ca5('0x5e')},'attributes':['id',_0x2ca5('0x35'),'fullname','email',_0x2ca5('0x6f')],'raw':!![]});}return null;})['then'](function(_0x1e57d5){if(!_0x1e57d5)return null;_0x4c58d7[_0x2ca5('0x25')][_0x2ca5('0x5e')]=_0x1e57d5;return _0x4c58d7;})[_0x2ca5('0x1f')](function(_0x13f122){if(_0x13f122){if(_0x48ae13[_0x2ca5('0x54')][_0x2ca5('0x70')]){_0x4c58d7[_0x2ca5('0x25')]['interface']=util[_0x2ca5('0x5a')](_0x2ca5('0x71'),_0x48ae13['user'][_0x2ca5('0x35')]);_0x4c58d7[_0x2ca5('0x25')][_0x2ca5('0x72')]=_0x4c58d7[_0x2ca5('0x72')];_0x4c58d7[_0x2ca5('0x25')][_0x2ca5('0x73')]=_0x4c58d7[_0x2ca5('0x72')];_0x4c58d7['message'][_0x2ca5('0x74')]=_0x2ca5('0x75');return respondWithRpcPromise(_0x2ca5('0x76'),_0x2ca5('0x76'),{'event':_0x2ca5('0x77'),'message':_[_0x2ca5('0x4a')](_0x4c58d7[_0x2ca5('0x25')],JSON[_0x2ca5('0x78')](_0x4c58d7[_0x2ca5('0x63')]['formData']))},client9002)['then'](function(){return _0x4c58d7;});}return _0x4c58d7;}return null;})[_0x2ca5('0x1f')](respondWithResult(_0x243d1d,null))[_0x2ca5('0x28')](handleError(_0x243d1d,null));};var interaction_log=require(_0x2ca5('0x14'))(_0x2ca5('0x79'));exports[_0x2ca5('0x7a')]=function(_0x4c6e49,_0x104ead,_0x5ad1be){var _0x5a12f2={'agent':{},'channel':_0x2ca5('0x57')};if(_0x4c6e49['body']['id']){delete _0x4c6e49[_0x2ca5('0x54')]['id'];}_0x4c6e49['body'][_0x2ca5('0x5c')]=_0x4c6e49[_0x2ca5('0x54')][_0x2ca5('0x5c')]||_0x4c6e49['user']['id'];_0x5a12f2[_0x2ca5('0x5e')]['id']=_0x4c6e49[_0x2ca5('0x54')][_0x2ca5('0x5c')];return db[_0x2ca5('0x39')][_0x2ca5('0x52')]({'where':{'id':_0x4c6e49[_0x2ca5('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x104ead,null))[_0x2ca5('0x1f')](function(_0x5af326){if(_0x5af326){_0x5a12f2[_0x2ca5('0x25')]=_0x5af326[_0x2ca5('0x5f')]({'plain':!![]});return db[_0x2ca5('0x60')][_0x2ca5('0x52')]({'where':{'id':_0x5af326[_0x2ca5('0x61')]}});}return null;})[_0x2ca5('0x1f')](handleEntityNotFound(_0x104ead,null))[_0x2ca5('0x1f')](function(_0x18738b){if(_0x18738b){_0x5a12f2[_0x2ca5('0x63')]=_0x18738b[_0x2ca5('0x5f')]({'plain':!![]});interaction_log[_0x2ca5('0x20')](_0x2ca5('0x7b'),_0x4c6e49[_0x2ca5('0x5d')]['id'],_0x4c6e49[_0x2ca5('0x5d')][_0x2ca5('0x35')],_0x4c6e49['user'][_0x2ca5('0x64')],_0x5a12f2[_0x2ca5('0x63')]['id'],_0x4c6e49[_0x2ca5('0x54')]?JSON[_0x2ca5('0x23')](_0x4c6e49['body']):_0x2ca5('0x65'));return respondWithRpcPromise('RejectMessage',_0x2ca5('0x7c'),_0x5a12f2);}return null;})['then'](function(_0x3075aa){var _0x21190d=_0x2ca5('0x68')+_0x3075aa['message'][_0x2ca5('0x69')];return db[_0x2ca5('0x6a')][_0x2ca5('0x3f')](_0x21190d,{'type':db[_0x2ca5('0x6b')][_0x2ca5('0x6c')][_0x2ca5('0x7d')],'raw':!![]})['then'](function(_0x257614){return _0x257614;});})[_0x2ca5('0x1f')](function(_0x4b6a0f){if(_0x4b6a0f){_0x5a12f2[_0x2ca5('0x25')][_0x2ca5('0x6d')]=_0x4b6a0f[0x0];if(!_0x4c6e49[_0x2ca5('0x54')][_0x2ca5('0x5c')])return;return db[_0x2ca5('0x6e')][_0x2ca5('0x52')]({'where':{'id':_0x4c6e49['body']['UserId'],'role':'agent'},'attributes':['id',_0x2ca5('0x35'),_0x2ca5('0x7e'),_0x2ca5('0x7f'),_0x2ca5('0x6f')],'raw':!![]});}return null;})[_0x2ca5('0x1f')](function(_0x42f2a6){if(!_0x42f2a6)return null;_0x5a12f2[_0x2ca5('0x25')][_0x2ca5('0x5e')]=_0x42f2a6;return _0x5a12f2;})[_0x2ca5('0x1f')](function(_0x28d618){if(_0x28d618){_0x28d618[_0x2ca5('0x25')][_0x2ca5('0x80')]=util[_0x2ca5('0x5a')](_0x2ca5('0x71'),_0x4c6e49[_0x2ca5('0x5d')][_0x2ca5('0x35')]);_0x28d618[_0x2ca5('0x25')]['channel']=_0x5a12f2[_0x2ca5('0x72')];_0x28d618[_0x2ca5('0x25')]['motionChannel']=_0x5a12f2[_0x2ca5('0x72')];_0x28d618['message'][_0x2ca5('0x74')]='reject';respondWithRpcPromise(_0x2ca5('0x76'),'EventManager',{'event':'rejectmessage','message':_[_0x2ca5('0x4a')](_0x5a12f2['message'],JSON['parse'](_0x5a12f2[_0x2ca5('0x63')][_0x2ca5('0x81')]))},client9002);return _0x5a12f2;}return null;})[_0x2ca5('0x1f')](respondWithResult(_0x104ead,null))['catch'](handleError(_0x104ead,null));};
\ No newline at end of file
+var _0x1ae4=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','end','name','send','index','map','ChatMessage','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','findAll','rows','show','keys','includeAll','include','find','create','body','params','describe','chat-interactions','readAt','UserId','user','agent','get','ChatInteractionId','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','channel','accept','EventManager','parse','formData','chat','ChatInteraction','null','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','fullname','SIP/%s','motionChannel','zip-dir','fast-json-patch','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv'];(function(_0xef5a26,_0x338881){var _0x42e1f3=function(_0x333ea8){while(--_0x333ea8){_0xef5a26['push'](_0xef5a26['shift']());}};_0x42e1f3(++_0x338881);}(_0x1ae4,0xf2));var _0x41ae=function(_0x4e2967,_0x55201b){_0x4e2967=_0x4e2967-0x0;var _0x39d360=_0x1ae4[_0x4e2967];return _0x39d360;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x41ae('0x0'));var jsonpatch=require(_0x41ae('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x41ae('0x2'));var util=require(_0x41ae('0x3'));var path=require(_0x41ae('0x4'));var sox=require(_0x41ae('0x5'));var csv=require('to-csv');var ejs=require(_0x41ae('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x41ae('0x7'));var squel=require(_0x41ae('0x8'));var crypto=require(_0x41ae('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x41ae('0xa'));var toCsv=require(_0x41ae('0xb'));var querystring=require(_0x41ae('0xc'));var Papa=require(_0x41ae('0xd'));var Redis=require('ioredis');var authService=require(_0x41ae('0xe'));var qs=require(_0x41ae('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x41ae('0x10'))(_0x41ae('0x11'));var utils=require(_0x41ae('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x41ae('0x13'));var db=require(_0x41ae('0x14'))['db'];config[_0x41ae('0x15')]=_[_0x41ae('0x16')](config[_0x41ae('0x15')],{'host':_0x41ae('0x17'),'port':0x18eb});var socket=require(_0x41ae('0x18'))(new Redis(config[_0x41ae('0x15')]));require(_0x41ae('0x19'))['register'](socket);var jayson=require(_0x41ae('0x1a'));var client=jayson[_0x41ae('0x1b')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1eba43,_0x35216d,_0x22c9a4,_0x31eb85){return new BPromise(function(_0xbf22ca,_0x2a5596){var _0x3be9dd=_0x31eb85||client;return _0x3be9dd[_0x41ae('0x1c')](_0x1eba43,_0x22c9a4)[_0x41ae('0x1d')](function(_0x5c8011){logger[_0x41ae('0x1e')](_0x41ae('0x1f'),_0x35216d,_0x41ae('0x20'));logger[_0x41ae('0x21')](_0x41ae('0x22'),_0x35216d,_0x41ae('0x20'),JSON[_0x41ae('0x23')](_0x5c8011));if(_0x5c8011['error']){if(_0x5c8011[_0x41ae('0x24')][_0x41ae('0x25')]===0x1f4){logger[_0x41ae('0x24')](_0x41ae('0x1f'),_0x35216d,_0x5c8011[_0x41ae('0x24')][_0x41ae('0x26')]);return _0x2a5596(_0x5c8011[_0x41ae('0x24')][_0x41ae('0x26')]);}logger[_0x41ae('0x24')]('ChatMessage,\x20%s,\x20%s',_0x35216d,_0x5c8011[_0x41ae('0x24')][_0x41ae('0x26')]);return _0xbf22ca(_0x5c8011[_0x41ae('0x24')][_0x41ae('0x26')]);}else{logger[_0x41ae('0x1e')](_0x41ae('0x1f'),_0x35216d,_0x41ae('0x20'));_0xbf22ca(_0x5c8011[_0x41ae('0x27')]['message']);}})[_0x41ae('0x28')](function(_0xf58ff3){logger[_0x41ae('0x24')](_0x41ae('0x1f'),_0x35216d,_0xf58ff3);_0x2a5596(_0xf58ff3);});});}function respondWithStatusCode(_0x5f26a2,_0x1f585d){_0x1f585d=_0x1f585d||0xcc;return function(_0x59c22a){if(_0x59c22a){return _0x5f26a2[_0x41ae('0x29')](_0x1f585d);}return _0x5f26a2[_0x41ae('0x2a')](_0x1f585d)['end']();};}function respondWithResult(_0x3e83e7,_0xb8f169){_0xb8f169=_0xb8f169||0xc8;return function(_0x4aab85){if(_0x4aab85){return _0x3e83e7[_0x41ae('0x2a')](_0xb8f169)['json'](_0x4aab85);}};}function respondWithFilteredResult(_0x438218,_0x31aeac){return function(_0x2f83c5){if(_0x2f83c5){var _0x5b7ded=typeof _0x31aeac['offset']===_0x41ae('0x2b')&&typeof _0x31aeac[_0x41ae('0x2c')]===_0x41ae('0x2b');var _0x48373a=_0x2f83c5[_0x41ae('0x2d')];var _0x3049a9=_0x5b7ded?0x0:_0x31aeac[_0x41ae('0x2e')];var _0x4a312b=_0x5b7ded?_0x2f83c5[_0x41ae('0x2d')]:_0x31aeac['offset']+_0x31aeac['limit'];var _0x10e2d9;if(_0x4a312b>=_0x48373a){_0x4a312b=_0x48373a;_0x10e2d9=0xc8;}else{_0x10e2d9=0xce;}_0x438218[_0x41ae('0x2a')](_0x10e2d9);return _0x438218[_0x41ae('0x2f')](_0x41ae('0x30'),_0x3049a9+'-'+_0x4a312b+'/'+_0x48373a)[_0x41ae('0x31')](_0x2f83c5);}return null;};}function patchUpdates(_0x406a00){return function(_0xe3109){try{jsonpatch[_0x41ae('0x32')](_0xe3109,_0x406a00,!![]);}catch(_0x4111e6){return BPromise[_0x41ae('0x33')](_0x4111e6);}return _0xe3109[_0x41ae('0x34')]();};}function saveUpdates(_0x2c2215,_0x3284fd){return function(_0x13db8e){if(_0x13db8e){return _0x13db8e[_0x41ae('0x35')](_0x2c2215)[_0x41ae('0x1d')](function(_0x394ca7){return _0x394ca7;});}return null;};}function removeEntity(_0x2e173a,_0x163407){return function(_0x56a28b){if(_0x56a28b){return _0x56a28b[_0x41ae('0x36')]()[_0x41ae('0x1d')](function(){_0x2e173a[_0x41ae('0x2a')](0xcc)[_0x41ae('0x37')]();});}};}function handleEntityNotFound(_0x2c6ac3,_0x3d53e5){return function(_0xc7edfc){if(!_0xc7edfc){_0x2c6ac3[_0x41ae('0x29')](0x194);}return _0xc7edfc;};}function handleError(_0x16ee14,_0x55b764){_0x55b764=_0x55b764||0x1f4;return function(_0x10ae30){logger[_0x41ae('0x24')](_0x10ae30['stack']);if(_0x10ae30[_0x41ae('0x38')]){delete _0x10ae30['name'];}_0x16ee14[_0x41ae('0x2a')](_0x55b764)[_0x41ae('0x39')](_0x10ae30);};}exports[_0x41ae('0x3a')]=function(_0x171696,_0x21bc7c){var _0x2ee975={},_0xe5a277={},_0x465c47={'count':0x0,'rows':[]};var _0x13aaf4=_[_0x41ae('0x3b')](db[_0x41ae('0x3c')]['rawAttributes'],function(_0x20c840){return{'name':_0x20c840[_0x41ae('0x3d')],'type':_0x20c840[_0x41ae('0x3e')][_0x41ae('0x3f')]};});_0xe5a277['model']=_[_0x41ae('0x3b')](_0x13aaf4,_0x41ae('0x38'));_0xe5a277['query']=_['keys'](_0x171696[_0x41ae('0x40')]);_0xe5a277[_0x41ae('0x41')]=_[_0x41ae('0x42')](_0xe5a277['model'],_0xe5a277[_0x41ae('0x40')]);_0x2ee975[_0x41ae('0x43')]=_[_0x41ae('0x42')](_0xe5a277[_0x41ae('0x44')],qs[_0x41ae('0x45')](_0x171696[_0x41ae('0x40')][_0x41ae('0x45')]));_0x2ee975['attributes']=_0x2ee975[_0x41ae('0x43')][_0x41ae('0x46')]?_0x2ee975[_0x41ae('0x43')]:_0xe5a277[_0x41ae('0x44')];if(!_0x171696['query']['hasOwnProperty'](_0x41ae('0x47'))){_0x2ee975[_0x41ae('0x2c')]=qs['limit'](_0x171696[_0x41ae('0x40')]['limit']);_0x2ee975[_0x41ae('0x2e')]=qs[_0x41ae('0x2e')](_0x171696[_0x41ae('0x40')]['offset']);}_0x2ee975['order']=qs['sort'](_0x171696[_0x41ae('0x40')][_0x41ae('0x48')]);_0x2ee975[_0x41ae('0x49')]=qs['filters'](_['pick'](_0x171696[_0x41ae('0x40')],_0xe5a277[_0x41ae('0x41')]),_0x13aaf4);if(_0x171696['query'][_0x41ae('0x4a')]){_0x2ee975[_0x41ae('0x49')]=_[_0x41ae('0x4b')](_0x2ee975[_0x41ae('0x49')],{'$or':_['map'](_0x13aaf4,function(_0x4e7c47){if(_0x4e7c47[_0x41ae('0x3e')]!==_0x41ae('0x4c')){var _0x215527={};_0x215527[_0x4e7c47[_0x41ae('0x38')]]={'$like':'%'+_0x171696[_0x41ae('0x40')]['filter']+'%'};return _0x215527;}})});}_0x2ee975=_[_0x41ae('0x4b')]({},_0x2ee975,_0x171696[_0x41ae('0x4d')]);var _0x243334={'where':_0x2ee975[_0x41ae('0x49')]};return db[_0x41ae('0x3c')][_0x41ae('0x2d')](_0x243334)[_0x41ae('0x1d')](function(_0xf38094){_0x465c47[_0x41ae('0x2d')]=_0xf38094;if(_0x171696[_0x41ae('0x40')]['includeAll']){_0x2ee975['include']=[{'all':!![]}];}return db[_0x41ae('0x3c')][_0x41ae('0x4e')](_0x2ee975);})['then'](function(_0x37faa9){_0x465c47[_0x41ae('0x4f')]=_0x37faa9;return _0x465c47;})[_0x41ae('0x1d')](respondWithFilteredResult(_0x21bc7c,_0x2ee975))['catch'](handleError(_0x21bc7c,null));};exports[_0x41ae('0x50')]=function(_0x1034dd,_0x12a31e){var _0x302593={'raw':!![],'where':{'id':_0x1034dd['params']['id']}},_0x16b1ac={};_0x16b1ac[_0x41ae('0x44')]=_[_0x41ae('0x51')](db['ChatMessage']['rawAttributes']);_0x16b1ac[_0x41ae('0x40')]=_[_0x41ae('0x51')](_0x1034dd[_0x41ae('0x40')]);_0x16b1ac[_0x41ae('0x41')]=_[_0x41ae('0x42')](_0x16b1ac[_0x41ae('0x44')],_0x16b1ac['query']);_0x302593[_0x41ae('0x43')]=_['intersection'](_0x16b1ac['model'],qs[_0x41ae('0x45')](_0x1034dd['query']['fields']));_0x302593[_0x41ae('0x43')]=_0x302593['attributes']['length']?_0x302593[_0x41ae('0x43')]:_0x16b1ac[_0x41ae('0x44')];if(_0x1034dd[_0x41ae('0x40')][_0x41ae('0x52')]){_0x302593[_0x41ae('0x53')]=[{'all':!![]}];}_0x302593=_[_0x41ae('0x4b')]({},_0x302593,_0x1034dd[_0x41ae('0x4d')]);return db['ChatMessage'][_0x41ae('0x54')](_0x302593)[_0x41ae('0x1d')](handleEntityNotFound(_0x12a31e,null))[_0x41ae('0x1d')](respondWithResult(_0x12a31e,null))[_0x41ae('0x28')](handleError(_0x12a31e,null));};exports[_0x41ae('0x55')]=function(_0x20a597,_0x4e0970){return db[_0x41ae('0x3c')][_0x41ae('0x55')](_0x20a597['body'],{})[_0x41ae('0x1d')](respondWithResult(_0x4e0970,0xc9))['catch'](handleError(_0x4e0970,null));};exports['update']=function(_0x1bf312,_0x2310fe){if(_0x1bf312[_0x41ae('0x56')]['id']){delete _0x1bf312[_0x41ae('0x56')]['id'];}return db[_0x41ae('0x3c')]['find']({'where':{'id':_0x1bf312[_0x41ae('0x57')]['id']}})[_0x41ae('0x1d')](handleEntityNotFound(_0x2310fe,null))['then'](saveUpdates(_0x1bf312[_0x41ae('0x56')],null))[_0x41ae('0x1d')](respondWithResult(_0x2310fe,null))['catch'](handleError(_0x2310fe,null));};exports[_0x41ae('0x36')]=function(_0x1fbbff,_0x38723b){return db['ChatMessage'][_0x41ae('0x54')]({'where':{'id':_0x1fbbff[_0x41ae('0x57')]['id']}})[_0x41ae('0x1d')](handleEntityNotFound(_0x38723b,null))[_0x41ae('0x1d')](removeEntity(_0x38723b,null))[_0x41ae('0x28')](handleError(_0x38723b,null));};exports[_0x41ae('0x58')]=function(_0x34dfc8,_0x7894){return db[_0x41ae('0x3c')]['describe']()['then'](respondWithResult(_0x7894,null))['catch'](handleError(_0x7894,null));};var interaction_log=require(_0x41ae('0x10'))(_0x41ae('0x59'));exports['accept']=function(_0x18a872,_0x202f45,_0x4374d2){var _0x389e28={'agent':{},'channel':'chat'};if(_0x18a872[_0x41ae('0x56')]['id']){delete _0x18a872[_0x41ae('0x56')]['id'];}_0x18a872[_0x41ae('0x56')]['read']=!![];_0x18a872[_0x41ae('0x56')][_0x41ae('0x5a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x18a872[_0x41ae('0x56')][_0x41ae('0x5b')]=_0x18a872[_0x41ae('0x56')][_0x41ae('0x5b')]||_0x18a872[_0x41ae('0x5c')]['id'];_0x389e28[_0x41ae('0x5d')]['id']=_0x18a872[_0x41ae('0x56')][_0x41ae('0x5b')];return db[_0x41ae('0x3c')][_0x41ae('0x54')]({'where':{'id':_0x18a872[_0x41ae('0x57')]['id'],'UserId':null}})[_0x41ae('0x1d')](handleEntityNotFound(_0x202f45,null))['then'](saveUpdates(_0x18a872['body'],null))['then'](function(_0x5d3893){if(_0x5d3893){_0x389e28[_0x41ae('0x26')]=_0x5d3893[_0x41ae('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x41ae('0x54')]({'where':{'id':_0x5d3893[_0x41ae('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x202f45,null))[_0x41ae('0x1d')](function(_0x326dd0){if(_0x326dd0){return _0x326dd0['update']({'UserId':_0x18a872[_0x41ae('0x56')][_0x41ae('0x5b')],'read1stAt':_['isNil'](_0x326dd0[_0x41ae('0x60')])?moment()[_0x41ae('0x61')](_0x41ae('0x62')):undefined});}return null;})[_0x41ae('0x1d')](function(_0x4a1a22){if(_0x4a1a22){_0x389e28[_0x41ae('0x63')]=_0x4a1a22['get']({'plain':!![]});interaction_log[_0x41ae('0x1e')](_0x41ae('0x64'),_0x18a872[_0x41ae('0x5c')]['id'],_0x18a872['user'][_0x41ae('0x38')],_0x18a872[_0x41ae('0x5c')][_0x41ae('0x65')],_0x389e28['interaction']['id'],_0x18a872[_0x41ae('0x56')]?JSON[_0x41ae('0x23')](_0x18a872[_0x41ae('0x56')]):'null');return respondWithRpcPromise('AcceptMessage',_0x41ae('0x66'),_0x389e28);}return null;})[_0x41ae('0x1d')](function(_0xa03fe0){var _0x1ff61a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xa03fe0[_0x41ae('0x26')][_0x41ae('0x67')];return db[_0x41ae('0x68')][_0x41ae('0x40')](_0x1ff61a,{'type':db['Sequelize'][_0x41ae('0x69')][_0x41ae('0x6a')],'raw':!![]})[_0x41ae('0x1d')](function(_0x248a5a){return _0x248a5a;});})['then'](function(_0x5556fa){if(_0x5556fa){_0x389e28[_0x41ae('0x26')][_0x41ae('0x6b')]=_0x5556fa[0x0];if(!_0x18a872['body'][_0x41ae('0x5b')])return;return db[_0x41ae('0x6c')]['find']({'where':{'id':_0x18a872['body']['UserId'],'role':_0x41ae('0x5d')},'attributes':['id',_0x41ae('0x38'),'fullname',_0x41ae('0x6d'),_0x41ae('0x6e')],'raw':!![]});}return null;})[_0x41ae('0x1d')](function(_0x110820){if(!_0x110820)return null;_0x389e28[_0x41ae('0x26')][_0x41ae('0x5d')]=_0x110820;return _0x389e28;})['then'](function(_0x40f96c){if(_0x40f96c){if(_0x18a872[_0x41ae('0x56')][_0x41ae('0x6f')]){_0x389e28['message'][_0x41ae('0x70')]=util[_0x41ae('0x61')]('SIP/%s',_0x18a872[_0x41ae('0x5c')][_0x41ae('0x38')]);_0x389e28[_0x41ae('0x26')][_0x41ae('0x71')]=_0x389e28[_0x41ae('0x71')];_0x389e28[_0x41ae('0x26')]['motionChannel']=_0x389e28[_0x41ae('0x71')];_0x389e28[_0x41ae('0x26')]['event']=_0x41ae('0x72');return respondWithRpcPromise(_0x41ae('0x73'),'EventManager',{'event':'acceptmessage','message':_[_0x41ae('0x4b')](_0x389e28[_0x41ae('0x26')],JSON[_0x41ae('0x74')](_0x389e28['interaction'][_0x41ae('0x75')]))},client9002)[_0x41ae('0x1d')](function(){return _0x389e28;});}return _0x389e28;}return null;})[_0x41ae('0x1d')](respondWithResult(_0x202f45,null))[_0x41ae('0x28')](handleError(_0x202f45,null));};var interaction_log=require(_0x41ae('0x10'))(_0x41ae('0x59'));exports[_0x41ae('0x33')]=function(_0x2f9089,_0x203d85,_0x9a045c){var _0x3cbda1={'agent':{},'channel':_0x41ae('0x76')};if(_0x2f9089[_0x41ae('0x56')]['id']){delete _0x2f9089[_0x41ae('0x56')]['id'];}_0x2f9089['body'][_0x41ae('0x5b')]=_0x2f9089[_0x41ae('0x56')][_0x41ae('0x5b')]||_0x2f9089[_0x41ae('0x5c')]['id'];_0x3cbda1[_0x41ae('0x5d')]['id']=_0x2f9089[_0x41ae('0x56')][_0x41ae('0x5b')];return db['ChatMessage'][_0x41ae('0x54')]({'where':{'id':_0x2f9089[_0x41ae('0x57')]['id'],'UserId':null}})[_0x41ae('0x1d')](handleEntityNotFound(_0x203d85,null))[_0x41ae('0x1d')](function(_0x5e37f2){if(_0x5e37f2){_0x3cbda1[_0x41ae('0x26')]=_0x5e37f2[_0x41ae('0x5e')]({'plain':!![]});return db[_0x41ae('0x77')][_0x41ae('0x54')]({'where':{'id':_0x5e37f2['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x203d85,null))[_0x41ae('0x1d')](function(_0x3ea78e){if(_0x3ea78e){_0x3cbda1[_0x41ae('0x63')]=_0x3ea78e[_0x41ae('0x5e')]({'plain':!![]});interaction_log[_0x41ae('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2f9089[_0x41ae('0x5c')]['id'],_0x2f9089['user'][_0x41ae('0x38')],_0x2f9089['user'][_0x41ae('0x65')],_0x3cbda1[_0x41ae('0x63')]['id'],_0x2f9089[_0x41ae('0x56')]?JSON[_0x41ae('0x23')](_0x2f9089[_0x41ae('0x56')]):_0x41ae('0x78'));return respondWithRpcPromise('RejectMessage',_0x41ae('0x79'),_0x3cbda1);}return null;})['then'](function(_0xb76f6){var _0x315e2a=_0x41ae('0x7a')+_0xb76f6[_0x41ae('0x26')]['ContactId'];return db[_0x41ae('0x68')][_0x41ae('0x40')](_0x315e2a,{'type':db[_0x41ae('0x7b')][_0x41ae('0x69')][_0x41ae('0x6a')],'raw':!![]})[_0x41ae('0x1d')](function(_0x49d415){return _0x49d415;});})[_0x41ae('0x1d')](function(_0x11c3c0){if(_0x11c3c0){_0x3cbda1[_0x41ae('0x26')][_0x41ae('0x6b')]=_0x11c3c0[0x0];if(!_0x2f9089[_0x41ae('0x56')]['UserId'])return;return db['User'][_0x41ae('0x54')]({'where':{'id':_0x2f9089['body'][_0x41ae('0x5b')],'role':_0x41ae('0x5d')},'attributes':['id',_0x41ae('0x38'),_0x41ae('0x7c'),_0x41ae('0x6d'),'internal'],'raw':!![]});}return null;})[_0x41ae('0x1d')](function(_0x117480){if(!_0x117480)return null;_0x3cbda1[_0x41ae('0x26')][_0x41ae('0x5d')]=_0x117480;return _0x3cbda1;})[_0x41ae('0x1d')](function(_0x5994be){if(_0x5994be){_0x5994be[_0x41ae('0x26')]['interface']=util['format'](_0x41ae('0x7d'),_0x2f9089[_0x41ae('0x5c')][_0x41ae('0x38')]);_0x5994be['message'][_0x41ae('0x71')]=_0x3cbda1[_0x41ae('0x71')];_0x5994be['message'][_0x41ae('0x7e')]=_0x3cbda1[_0x41ae('0x71')];_0x5994be[_0x41ae('0x26')]['event']=_0x41ae('0x33');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_['merge'](_0x3cbda1[_0x41ae('0x26')],JSON[_0x41ae('0x74')](_0x3cbda1[_0x41ae('0x63')][_0x41ae('0x75')]))},client9002);return _0x3cbda1;}return null;})['then'](respondWithResult(_0x203d85,null))[_0x41ae('0x28')](handleError(_0x203d85,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 5b135c3..dbd612f 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 _0xce5a=['hook','exports','../../mysqldb','ChatMessage','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0xb113d7,_0x2fc306){var _0xd5a08d=function(_0x873634){while(--_0x873634){_0xb113d7['push'](_0xb113d7['shift']());}};_0xd5a08d(++_0x2fc306);}(_0xce5a,0xfe));var _0xace5=function(_0x5951e8,_0x42b9a7){_0x5951e8=_0x5951e8-0x0;var _0x20a1f5=_0xce5a[_0x5951e8];return _0x20a1f5;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xace5('0x0'))['db'][_0xace5('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xace5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xace5('0x3'),'afterDestroy':_0xace5('0x4')};function emitEvent(_0x5f19f0){return function(_0x1b43ac,_0x463116,_0x53a469){ChatMessageEvents[_0xace5('0x5')](_0x5f19f0+':'+_0x1b43ac['id'],_0x1b43ac);ChatMessageEvents[_0xace5('0x5')](_0x5f19f0,_0x1b43ac);_0x53a469(null);};}for(var e in events){if(events[_0xace5('0x6')](e)){var event=events[e];ChatMessage[_0xace5('0x7')](e,emitEvent(event));}}module[_0xace5('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0x4afb=['../../mysqldb','ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x4afb,0x103));var _0xb4af=function(_0xe91559,_0x5ead1f){_0xe91559=_0xe91559-0x0;var _0x3bb7bc=_0x4afb[_0xe91559];return _0x3bb7bc;};'use strict';var EventEmitter=require(_0xb4af('0x0'));var ChatMessage=require(_0xb4af('0x1'))['db'][_0xb4af('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb4af('0x3')](0x0);var events={'afterCreate':_0xb4af('0x4'),'afterUpdate':_0xb4af('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1f5df1){return function(_0x142ffd,_0x4a8c6e,_0x1a2087){ChatMessageEvents[_0xb4af('0x6')](_0x1f5df1+':'+_0x142ffd['id'],_0x142ffd);ChatMessageEvents[_0xb4af('0x6')](_0x1f5df1,_0x142ffd);_0x1a2087(null);};}for(var e in events){if(events[_0xb4af('0x7')](e)){var event=events[e];ChatMessage[_0xb4af('0x8')](e,emitEvent(event));}}module[_0xb4af('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 dc3ccc6..f67c4ff 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 _0xdec1=['ChatInteractionId','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne'];(function(_0x26073a,_0x4652df){var _0x2ab2ad=function(_0x4a378e){while(--_0x4a378e){_0x26073a['push'](_0x26073a['shift']());}};_0x2ab2ad(++_0x4652df);}(_0xdec1,0x11d));var _0x1dec=function(_0x2c2784,_0x36faed){_0x2c2784=_0x2c2784-0x0;var _0x1a8b32=_0xdec1[_0x2c2784];return _0x1a8b32;};'use strict';var _=require(_0x1dec('0x0'));var util=require('util');var logger=require(_0x1dec('0x1'))(_0x1dec('0x2'));var moment=require(_0x1dec('0x3'));var BPromise=require(_0x1dec('0x4'));var rp=require(_0x1dec('0x5'));var fs=require('fs');var path=require(_0x1dec('0x6'));var rimraf=require(_0x1dec('0x7'));var config=require(_0x1dec('0x8'));var attributes=require(_0x1dec('0x9'));module[_0x1dec('0xa')]=function(_0x8f8be1,_0x108f91){return _0x8f8be1[_0x1dec('0xb')](_0x1dec('0xc'),attributes,{'tableName':_0x1dec('0xd'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x1dec('0xe')],'type':_0x1dec('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x49420c,_0x2eca5c,_0x12f4ef){var _0x3aa428=_0x8f8be1[_0x1dec('0x10')];var _0x4c1222=_0x49420c[_0x1dec('0x11')]({'plain':!![]});if(_0x4c1222[_0x1dec('0x12')][_0x1dec('0x13')]()==='in'||_0x4c1222[_0x1dec('0x12')][_0x1dec('0x13')]()==='out'&&!_0x4c1222[_0x1dec('0x14')]&&!_[_0x1dec('0x15')](_0x4c1222[_0x1dec('0x16')])){_0x3aa428[_0x1dec('0x17')][_0x1dec('0x18')]({'where':{'id':_0x4c1222[_0x1dec('0x19')]}})['then'](function(_0x3c1fa5){if(_0x3c1fa5){_0x3c1fa5['update']({'lastMsgAt':_0x4c1222[_0x1dec('0x1a')],'lastMsgDirection':_0x4c1222[_0x1dec('0x12')][_0x1dec('0x13')]()});}})[_0x1dec('0x1b')](function(_0x22656d){console[_0x1dec('0x1c')](_0x22656d);});}_0x12f4ef();}},'charset':_0x1dec('0x1d'),'collate':_0x1dec('0x1e')});};
\ No newline at end of file
+var _0x211a=['body','FULLTEXT','get','direction','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','update','createdAt','toLowerCase','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','chat_messages','fti_chat_messages'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x211a,0x64));var _0xa211=function(_0x39277f,_0x460842){_0x39277f=_0x39277f-0x0;var _0xfcf21e=_0x211a[_0x39277f];return _0xfcf21e;};'use strict';var _=require(_0xa211('0x0'));var util=require(_0xa211('0x1'));var logger=require(_0xa211('0x2'))('api');var moment=require(_0xa211('0x3'));var BPromise=require('bluebird');var rp=require(_0xa211('0x4'));var fs=require('fs');var path=require(_0xa211('0x5'));var rimraf=require(_0xa211('0x6'));var config=require(_0xa211('0x7'));var attributes=require(_0xa211('0x8'));module['exports']=function(_0x515097,_0x39913a){return _0x515097[_0xa211('0x9')]('ChatMessage',attributes,{'tableName':_0xa211('0xa'),'paranoid':![],'indexes':[{'name':_0xa211('0xb'),'fields':[_0xa211('0xc')],'type':_0xa211('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5cb5b7,_0x34e093,_0x26b5c6){var _0x3d043b=_0x515097['models'];var _0x2c09fd=_0x5cb5b7[_0xa211('0xe')]({'plain':!![]});if(_0x2c09fd[_0xa211('0xf')]['toLowerCase']()==='in'||_0x2c09fd['direction']['toLowerCase']()===_0xa211('0x10')&&!_0x2c09fd[_0xa211('0x11')]&&!_[_0xa211('0x12')](_0x2c09fd[_0xa211('0x13')])){_0x3d043b[_0xa211('0x14')]['findOne']({'where':{'id':_0x2c09fd[_0xa211('0x15')]}})['then'](function(_0x1d1af6){if(_0x1d1af6){_0x1d1af6[_0xa211('0x16')]({'lastMsgAt':_0x2c09fd[_0xa211('0x17')],'lastMsgDirection':_0x2c09fd[_0xa211('0xf')][_0xa211('0x18')]()});}})[_0xa211('0x19')](function(_0x22c8b9){console[_0xa211('0x1a')](_0x22c8b9);});}_0x26b5c6();}},'charset':'utf8mb4','collate':_0xa211('0x1b')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index ce2e30d..6d6dced 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 _0x26e4=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateChatMessage','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x57c067,_0x147938){var _0x1fb541=function(_0x34fa73){while(--_0x34fa73){_0x57c067['push'](_0x57c067['shift']());}};_0x1fb541(++_0x147938);}(_0x26e4,0xe1));var _0x426e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x26e4[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x426e('0x0'));var util=require('util');var moment=require(_0x426e('0x1'));var BPromise=require(_0x426e('0x2'));var rs=require(_0x426e('0x3'));var fs=require('fs');var Redis=require(_0x426e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x426e('0x5'));var logger=require(_0x426e('0x6'))(_0x426e('0x7'));var config=require(_0x426e('0x8'));var jayson=require(_0x426e('0x9'));var client=jayson[_0x426e('0xa')][_0x426e('0xb')]({'port':0x232a});config[_0x426e('0xc')]=_[_0x426e('0xd')](config[_0x426e('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x426e('0xe'))[_0x426e('0xf')](socket);function respondWithRpcPromise(_0xa1bffd,_0x218bed,_0x4fc6c7){return new BPromise(function(_0xde24ff,_0x37350c){return client[_0x426e('0x10')](_0xa1bffd,_0x4fc6c7)[_0x426e('0x11')](function(_0x458af8){logger['info'](_0x426e('0x12'),_0x218bed,_0x426e('0x13'));logger[_0x426e('0x14')](_0x426e('0x15'),_0x218bed,_0x426e('0x13'),JSON['stringify'](_0x458af8));if(_0x458af8[_0x426e('0x16')]){if(_0x458af8['error'][_0x426e('0x17')]===0x1f4){logger[_0x426e('0x16')]('ChatMessage,\x20%s,\x20%s',_0x218bed,_0x458af8[_0x426e('0x16')][_0x426e('0x18')]);return _0x37350c(_0x458af8['error']['message']);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x218bed,_0x458af8[_0x426e('0x16')][_0x426e('0x18')]);return _0xde24ff(_0x458af8[_0x426e('0x16')][_0x426e('0x18')]);}else{logger[_0x426e('0x19')](_0x426e('0x12'),_0x218bed,_0x426e('0x13'));_0xde24ff(_0x458af8[_0x426e('0x1a')][_0x426e('0x18')]);}})[_0x426e('0x1b')](function(_0x39322d){logger[_0x426e('0x16')](_0x426e('0x12'),_0x218bed,_0x39322d);_0x37350c(_0x39322d);});});}exports[_0x426e('0x1c')]=function(_0x486701){var _0x119cb8=this;return new Promise(function(_0x11a096,_0x23b031){return db['ChatMessage'][_0x426e('0x1d')](_0x486701[_0x426e('0x1e')],{'raw':_0x486701[_0x426e('0x1f')]?_0x486701[_0x426e('0x1f')][_0x426e('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x51cff4){logger[_0x426e('0x19')]('CreateChatMessage',_0x486701);logger['debug'](_0x426e('0x1c'),_0x486701,JSON['stringify'](_0x51cff4));_0x11a096(_0x51cff4);})[_0x426e('0x1b')](function(_0x218024){logger[_0x426e('0x16')](_0x426e('0x1c'),_0x218024[_0x426e('0x18')],_0x486701);_0x23b031(_0x119cb8[_0x426e('0x16')](0x1f4,_0x218024[_0x426e('0x18')]));});});};
\ No newline at end of file
+var _0x544f=['debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','body','options','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent'];(function(_0xbfa7ab,_0x95acc9){var _0x5d4e5c=function(_0xa25730){while(--_0xa25730){_0xbfa7ab['push'](_0xbfa7ab['shift']());}};_0x5d4e5c(++_0x95acc9);}(_0x544f,0x104));var _0xf544=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x544f[_0x2b9b7f];return _0x4ed19a;};'use strict';var _=require('lodash');var util=require(_0xf544('0x0'));var moment=require('moment');var BPromise=require(_0xf544('0x1'));var rs=require(_0xf544('0x2'));var fs=require('fs');var Redis=require(_0xf544('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf544('0x4'));var logger=require(_0xf544('0x5'))(_0xf544('0x6'));var config=require('../../config/environment');var jayson=require(_0xf544('0x7'));var client=jayson[_0xf544('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xf544('0x9')],{'host':_0xf544('0xa'),'port':0x18eb});var socket=require(_0xf544('0xb'))(new Redis(config['redis']));require(_0xf544('0xc'))[_0xf544('0xd')](socket);function respondWithRpcPromise(_0x281ebe,_0x2c59f0,_0x1b3881){return new BPromise(function(_0x18c671,_0x31e29a){return client[_0xf544('0xe')](_0x281ebe,_0x1b3881)[_0xf544('0xf')](function(_0x283476){logger[_0xf544('0x10')](_0xf544('0x11'),_0x2c59f0,_0xf544('0x12'));logger[_0xf544('0x13')](_0xf544('0x14'),_0x2c59f0,_0xf544('0x12'),JSON[_0xf544('0x15')](_0x283476));if(_0x283476[_0xf544('0x16')]){if(_0x283476[_0xf544('0x16')][_0xf544('0x17')]===0x1f4){logger[_0xf544('0x16')]('ChatMessage,\x20%s,\x20%s',_0x2c59f0,_0x283476['error'][_0xf544('0x18')]);return _0x31e29a(_0x283476['error']['message']);}logger[_0xf544('0x16')](_0xf544('0x11'),_0x2c59f0,_0x283476['error'][_0xf544('0x18')]);return _0x18c671(_0x283476[_0xf544('0x16')][_0xf544('0x18')]);}else{logger[_0xf544('0x10')](_0xf544('0x11'),_0x2c59f0,_0xf544('0x12'));_0x18c671(_0x283476[_0xf544('0x19')][_0xf544('0x18')]);}})[_0xf544('0x1a')](function(_0x30b605){logger[_0xf544('0x16')]('ChatMessage,\x20%s,\x20%s',_0x2c59f0,_0x30b605);_0x31e29a(_0x30b605);});});}exports[_0xf544('0x1b')]=function(_0x57cfb7){var _0x5493c3=this;return new Promise(function(_0x29bc70,_0x4cd4c9){return db[_0xf544('0x1c')]['create'](_0x57cfb7[_0xf544('0x1d')],{'raw':_0x57cfb7['options']?_0x57cfb7[_0xf544('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xf544('0xf')](function(_0x1f4235){logger[_0xf544('0x10')](_0xf544('0x1b'),_0x57cfb7);logger['debug'](_0xf544('0x1b'),_0x57cfb7,JSON[_0xf544('0x15')](_0x1f4235));_0x29bc70(_0x1f4235);})[_0xf544('0x1a')](function(_0x54faee){logger['error'](_0xf544('0x1b'),_0x54faee[_0xf544('0x18')],_0x57cfb7);_0x4cd4c9(_0x5493c3['error'](0x1f4,_0x54faee[_0xf544('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index ee852c2..70ee429 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 _0x7da7=['save','remove','register','chatMessage:','./chatMessage.events'];(function(_0x78dc83,_0x3c0e2f){var _0x6532ee=function(_0x247a8f){while(--_0x247a8f){_0x78dc83['push'](_0x78dc83['shift']());}};_0x6532ee(++_0x3c0e2f);}(_0x7da7,0x10d));var _0x77da=function(_0x3a21c0,_0x348451){_0x3a21c0=_0x3a21c0-0x0;var _0x411e84=_0x7da7[_0x3a21c0];return _0x411e84;};'use strict';var ChatMessageEvents=require(_0x77da('0x0'));var events=[_0x77da('0x1'),_0x77da('0x2'),'update'];function createListener(_0x59892b,_0x37667b){return function(_0xaaefb1){_0x37667b['emit'](_0x59892b,_0xaaefb1);};}function removeListener(_0x3a9fa6,_0x37b3d9){return function(){ChatMessageEvents['removeListener'](_0x3a9fa6,_0x37b3d9);};}exports[_0x77da('0x3')]=function(_0xc54a12){for(var _0x47da81=0x0,_0x30afe0=events['length'];_0x47da81<_0x30afe0;_0x47da81++){var _0x1191de=events[_0x47da81];var _0x13992e=createListener(_0x77da('0x4')+_0x1191de,_0xc54a12);ChatMessageEvents['on'](_0x1191de,_0x13992e);}};
\ No newline at end of file
+var _0xf2cf=['save','remove','update','emit','removeListener','length','chatMessage:'];(function(_0x3041c6,_0x4dee4e){var _0x268ad8=function(_0x44ddee){while(--_0x44ddee){_0x3041c6['push'](_0x3041c6['shift']());}};_0x268ad8(++_0x4dee4e);}(_0xf2cf,0xf5));var _0xff2c=function(_0x534084,_0x4ea0f6){_0x534084=_0x534084-0x0;var _0x333cbf=_0xf2cf[_0x534084];return _0x333cbf;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xff2c('0x0'),_0xff2c('0x1'),_0xff2c('0x2')];function createListener(_0x5ef2da,_0x8c6724){return function(_0x3d98a5){_0x8c6724[_0xff2c('0x3')](_0x5ef2da,_0x3d98a5);};}function removeListener(_0x2ff0e4,_0x189ac6){return function(){ChatMessageEvents[_0xff2c('0x4')](_0x2ff0e4,_0x189ac6);};}exports['register']=function(_0x8f0f4){for(var _0x68b356=0x0,_0x57ba3d=events[_0xff2c('0x5')];_0x68b356<_0x57ba3d;_0x68b356++){var _0x223a86=events[_0x68b356];var _0x105f4d=createListener(_0xff2c('0x6')+_0x223a86,_0x8f0f4);ChatMessageEvents['on'](_0x223a86,_0x105f4d);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 372c111..f812377 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 _0x958d=['accept','/:id/reject','reject','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','describe','/:id','post','tracked','chat','create','put','update','/:id/accept'];(function(_0x14114a,_0x143008){var _0x212e1f=function(_0x15b714){while(--_0x15b714){_0x14114a['push'](_0x14114a['shift']());}};_0x212e1f(++_0x143008);}(_0x958d,0xb3));var _0xd958=function(_0xe4da3a,_0x701be1){_0xe4da3a=_0xe4da3a-0x0;var _0x53de02=_0x958d[_0xe4da3a];return _0x53de02;};'use strict';var multer=require(_0xd958('0x0'));var util=require(_0xd958('0x1'));var path=require(_0xd958('0x2'));var timeout=require('connect-timeout');var express=require(_0xd958('0x3'));var router=express[_0xd958('0x4')]();var fs_extra=require(_0xd958('0x5'));var auth=require(_0xd958('0x6'));var interaction=require(_0xd958('0x7'));var config=require('../../config/environment');var controller=require(_0xd958('0x8'));router[_0xd958('0x9')]('/',auth[_0xd958('0xa')](),controller[_0xd958('0xb')]);router[_0xd958('0x9')]('/describe',auth[_0xd958('0xa')](),controller[_0xd958('0xc')]);router['get'](_0xd958('0xd'),auth[_0xd958('0xa')](),controller['show']);router[_0xd958('0xe')]('/',auth[_0xd958('0xa')](),interaction[_0xd958('0xf')](_0xd958('0x10'),'chatmessage:create'),controller[_0xd958('0x11')]);router[_0xd958('0x12')]('/:id',controller[_0xd958('0x13')]);router['put'](_0xd958('0x14'),auth[_0xd958('0xa')](),controller[_0xd958('0x15')]);router[_0xd958('0x12')](_0xd958('0x16'),auth[_0xd958('0xa')](),controller[_0xd958('0x17')]);router[_0xd958('0x18')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x4b7b=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','/:id','destroy','util','path','connect-timeout'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x4b7b,0xc8));var _0xb4b7=function(_0x586f76,_0x4f534c){_0x586f76=_0x586f76-0x0;var _0x298810=_0x4b7b[_0x586f76];return _0x298810;};'use strict';var multer=require('multer');var util=require(_0xb4b7('0x0'));var path=require(_0xb4b7('0x1'));var timeout=require(_0xb4b7('0x2'));var express=require(_0xb4b7('0x3'));var router=express[_0xb4b7('0x4')]();var fs_extra=require(_0xb4b7('0x5'));var auth=require(_0xb4b7('0x6'));var interaction=require(_0xb4b7('0x7'));var config=require(_0xb4b7('0x8'));var controller=require(_0xb4b7('0x9'));router[_0xb4b7('0xa')]('/',auth[_0xb4b7('0xb')](),controller[_0xb4b7('0xc')]);router[_0xb4b7('0xa')](_0xb4b7('0xd'),auth[_0xb4b7('0xb')](),controller[_0xb4b7('0xe')]);router['get']('/:id',auth[_0xb4b7('0xb')](),controller[_0xb4b7('0xf')]);router[_0xb4b7('0x10')]('/',auth[_0xb4b7('0xb')](),interaction[_0xb4b7('0x11')](_0xb4b7('0x12'),_0xb4b7('0x13')),controller[_0xb4b7('0x14')]);router[_0xb4b7('0x15')]('/:id',controller[_0xb4b7('0x16')]);router[_0xb4b7('0x15')](_0xb4b7('0x17'),auth[_0xb4b7('0xb')](),controller['accept']);router[_0xb4b7('0x15')](_0xb4b7('0x18'),auth[_0xb4b7('0xb')](),controller[_0xb4b7('0x19')]);router[_0xb4b7('0x1a')](_0xb4b7('0x1b'),auth[_0xb4b7('0xb')](),controller[_0xb4b7('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index eddf552..25720e1 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 _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x47378a,_0x20bc70){var _0x120fdb=function(_0x2885ec){while(--_0x2885ec){_0x47378a['push'](_0x47378a['shift']());}};_0x120fdb(++_0x20bc70);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2f368d,_0x419bc2){_0x2f368d=_0x2f368d-0x0;var _0x14860b=_0x5f2f[_0x2f368d];return _0x14860b;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x5f66=['medium','TEXT','exports'];(function(_0x116ffd,_0x3b1b3b){var _0x3850a8=function(_0x2db10f){while(--_0x2db10f){_0x116ffd['push'](_0x116ffd['shift']());}};_0x3850a8(++_0x3b1b3b);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index cd8641f..630ad83 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x540824,_0x3b1ae6){var _0x17134b=function(_0x2fec92){while(--_0x2fec92){_0x540824['push'](_0x540824['shift']());}};_0x17134b(++_0x3b1ae6);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x7a54,0x106));var _0x47a5=function(_0x17a0ec,_0x28edb8){_0x17a0ec=_0x17a0ec-0x0;var _0x30137d=_0x7a54[_0x17a0ec];return _0x30137d;};'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 b2d7d26..621d153 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 _0x02b6=['hook','exports','events','ChatOfflineMessage','setMaxListeners','save','emit'];(function(_0x3194b5,_0x495239){var _0x50f2dc=function(_0x13abed){while(--_0x13abed){_0x3194b5['push'](_0x3194b5['shift']());}};_0x50f2dc(++_0x495239);}(_0x02b6,0xfe));var _0x602b=function(_0x3a5715,_0x3d13e6){_0x3a5715=_0x3a5715-0x0;var _0x3460a9=_0x02b6[_0x3a5715];return _0x3460a9;};'use strict';var EventEmitter=require(_0x602b('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x602b('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x602b('0x2')](0x0);var events={'afterCreate':_0x602b('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x8291f){return function(_0x31f4a4,_0x33cc82,_0x2eec97){ChatOfflineMessageEvents['emit'](_0x8291f+':'+_0x31f4a4['id'],_0x31f4a4);ChatOfflineMessageEvents[_0x602b('0x4')](_0x8291f,_0x31f4a4);_0x2eec97(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x602b('0x5')](e,emitEvent(event));}}module[_0x602b('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xa490=['hook','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x8d0828,_0x1e830b){var _0x402fc4=function(_0x48e474){while(--_0x48e474){_0x8d0828['push'](_0x8d0828['shift']());}};_0x402fc4(++_0x1e830b);}(_0xa490,0x14e));var _0x0a49=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa490[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x0a49('0x0'));var ChatOfflineMessage=require(_0x0a49('0x1'))['db'][_0x0a49('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x0a49('0x3')](0x0);var events={'afterCreate':_0x0a49('0x4'),'afterUpdate':'update','afterDestroy':_0x0a49('0x5')};function emitEvent(_0x39bccc){return function(_0x12660d,_0x5a58f0,_0x414d45){ChatOfflineMessageEvents[_0x0a49('0x6')](_0x39bccc+':'+_0x12660d['id'],_0x12660d);ChatOfflineMessageEvents[_0x0a49('0x6')](_0x39bccc,_0x12660d);_0x414d45(null);};}for(var e in events){if(events[_0x0a49('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x0a49('0x8')](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 6b0d17b..7985e27 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 _0xc998=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xc998,0xe4));var _0x8c99=function(_0x28acd6,_0x1ea44b){_0x28acd6=_0x28acd6-0x0;var _0x49e00d=_0xc998[_0x28acd6];return _0x49e00d;};'use strict';var attributes=require(_0x8c99('0x0'));module[_0x8c99('0x1')]=function(_0x4d9209){return _0x4d9209[_0x8c99('0x2')](_0x8c99('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8c99('0x4'),'collate':_0x8c99('0x5')});};
\ No newline at end of file
+var _0xb6f8=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb6f8,0xcd));var _0x8b6f=function(_0x4dfd70,_0x35e8d2){_0x4dfd70=_0x4dfd70-0x0;var _0x48d818=_0xb6f8[_0x4dfd70];return _0x48d818;};'use strict';var attributes=require(_0x8b6f('0x0'));module[_0x8b6f('0x1')]=function(_0x1fc116){return _0x1fc116[_0x8b6f('0x2')](_0x8b6f('0x3'),attributes,{'tableName':_0x8b6f('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8b6f('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index af7d13b..0ce9bfc 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 _0x9aed=['message','result','catch','moment','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x50ef26,_0x10e500){var _0x34c395=function(_0x53b312){while(--_0x53b312){_0x50ef26['push'](_0x50ef26['shift']());}};_0x34c395(++_0x10e500);}(_0x9aed,0x9c));var _0xd9ae=function(_0x43a464,_0xeea76d){_0x43a464=_0x43a464-0x0;var _0x38d98a=_0x9aed[_0x43a464];return _0x38d98a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd9ae('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9ae('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd9ae('0x2'))(_0xd9ae('0x3'));var config=require(_0xd9ae('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xd9ae('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39c9e7,_0x344903,_0xa638c9){return new BPromise(function(_0x2ec7a4,_0x243e6c){return client['request'](_0x39c9e7,_0xa638c9)[_0xd9ae('0x6')](function(_0x290eb3){logger[_0xd9ae('0x7')](_0xd9ae('0x8'),_0x344903,_0xd9ae('0x9'));logger['debug'](_0xd9ae('0xa'),_0x344903,_0xd9ae('0x9'),JSON[_0xd9ae('0xb')](_0x290eb3));if(_0x290eb3[_0xd9ae('0xc')]){if(_0x290eb3['error'][_0xd9ae('0xd')]===0x1f4){logger[_0xd9ae('0xc')](_0xd9ae('0x8'),_0x344903,_0x290eb3['error'][_0xd9ae('0xe')]);return _0x243e6c(_0x290eb3[_0xd9ae('0xc')][_0xd9ae('0xe')]);}logger['error'](_0xd9ae('0x8'),_0x344903,_0x290eb3['error'][_0xd9ae('0xe')]);return _0x2ec7a4(_0x290eb3[_0xd9ae('0xc')]['message']);}else{logger[_0xd9ae('0x7')]('ChatOfflineMessage,\x20%s,\x20%s',_0x344903,_0xd9ae('0x9'));_0x2ec7a4(_0x290eb3[_0xd9ae('0xf')][_0xd9ae('0xe')]);}})[_0xd9ae('0x10')](function(_0x46450e){logger[_0xd9ae('0xc')](_0xd9ae('0x8'),_0x344903,_0x46450e);_0x243e6c(_0x46450e);});});}
\ No newline at end of file
+var _0xe5e7=['message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x3f3c46,_0x33e972){var _0x7d1132=function(_0x2c7b56){while(--_0x2c7b56){_0x3f3c46['push'](_0x3f3c46['shift']());}};_0x7d1132(++_0x33e972);}(_0xe5e7,0x10d));var _0x7e5e=function(_0x154746,_0x58b3e8){_0x154746=_0x154746-0x0;var _0x1b9722=_0xe5e7[_0x154746];return _0x1b9722;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7e5e('0x0'));var BPromise=require(_0x7e5e('0x1'));var rs=require(_0x7e5e('0x2'));var fs=require('fs');var Redis=require(_0x7e5e('0x3'));var db=require(_0x7e5e('0x4'))['db'];var utils=require(_0x7e5e('0x5'));var logger=require(_0x7e5e('0x6'))(_0x7e5e('0x7'));var config=require(_0x7e5e('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7e5e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x555fae,_0x33ca4a,_0x3c72af){return new BPromise(function(_0x16823b,_0x2b9a0f){return client[_0x7e5e('0xa')](_0x555fae,_0x3c72af)['then'](function(_0x568bc6){logger[_0x7e5e('0xb')](_0x7e5e('0xc'),_0x33ca4a,_0x7e5e('0xd'));logger['debug'](_0x7e5e('0xe'),_0x33ca4a,_0x7e5e('0xd'),JSON['stringify'](_0x568bc6));if(_0x568bc6['error']){if(_0x568bc6['error']['code']===0x1f4){logger[_0x7e5e('0xf')](_0x7e5e('0xc'),_0x33ca4a,_0x568bc6[_0x7e5e('0xf')][_0x7e5e('0x10')]);return _0x2b9a0f(_0x568bc6[_0x7e5e('0xf')][_0x7e5e('0x10')]);}logger[_0x7e5e('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x33ca4a,_0x568bc6[_0x7e5e('0xf')][_0x7e5e('0x10')]);return _0x16823b(_0x568bc6['error']['message']);}else{logger[_0x7e5e('0xb')](_0x7e5e('0xc'),_0x33ca4a,_0x7e5e('0xd'));_0x16823b(_0x568bc6[_0x7e5e('0x11')]['message']);}})[_0x7e5e('0x12')](function(_0x1f26b6){logger[_0x7e5e('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x33ca4a,_0x1f26b6);_0x2b9a0f(_0x1f26b6);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index b8cc221..c30c8ca 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 _0xc665=['path','express','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x2ca83c,_0x45190a){var _0xe0648f=function(_0x4f8247){while(--_0x4f8247){_0x2ca83c['push'](_0x2ca83c['shift']());}};_0xe0648f(++_0x45190a);}(_0xc665,0x19e));var _0x5c66=function(_0x4c4cbf,_0x1e6e6){_0x4c4cbf=_0x4c4cbf-0x0;var _0xa65774=_0xc665[_0x4c4cbf];return _0xa65774;};'use strict';var multer=require(_0x5c66('0x0'));var util=require(_0x5c66('0x1'));var path=require(_0x5c66('0x2'));var timeout=require('connect-timeout');var express=require(_0x5c66('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(_0x5c66('0x4'));var controller=require(_0x5c66('0x5'));router[_0x5c66('0x6')]('/',auth[_0x5c66('0x7')](),controller[_0x5c66('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x5c66('0x7')](),controller[_0x5c66('0x9')]);router['post']('/',auth[_0x5c66('0x7')](),controller[_0x5c66('0xa')]);router[_0x5c66('0xb')](_0x5c66('0xc'),auth[_0x5c66('0x7')](),controller[_0x5c66('0xd')]);router[_0x5c66('0xe')](_0x5c66('0xc'),auth[_0x5c66('0x7')](),controller[_0x5c66('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x4b2a=['../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','describe','show','create','put','update','delete','/:id','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3e35e8,_0x17fd7e){var _0xbb61e7=function(_0x3d03fb){while(--_0x3d03fb){_0x3e35e8['push'](_0x3e35e8['shift']());}};_0xbb61e7(++_0x17fd7e);}(_0x4b2a,0x7d));var _0xa4b2=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4b2a[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xa4b2('0x0'));var util=require(_0xa4b2('0x1'));var path=require(_0xa4b2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa4b2('0x3')]();var fs_extra=require(_0xa4b2('0x4'));var auth=require(_0xa4b2('0x5'));var interaction=require(_0xa4b2('0x6'));var config=require(_0xa4b2('0x7'));var controller=require(_0xa4b2('0x8'));router[_0xa4b2('0x9')]('/',auth['isAuthenticated'](),controller[_0xa4b2('0xa')]);router[_0xa4b2('0x9')](_0xa4b2('0xb'),auth[_0xa4b2('0xc')](),controller[_0xa4b2('0xd')]);router[_0xa4b2('0x9')]('/:id',auth[_0xa4b2('0xc')](),controller[_0xa4b2('0xe')]);router['post']('/',auth[_0xa4b2('0xc')](),controller[_0xa4b2('0xf')]);router[_0xa4b2('0x10')]('/:id',auth[_0xa4b2('0xc')](),controller[_0xa4b2('0x11')]);router[_0xa4b2('0x12')](_0xa4b2('0x13'),auth[_0xa4b2('0xc')](),controller[_0xa4b2('0x14')]);module[_0xa4b2('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 38eb5ed..7106bcb 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 _0x760b=['sequelize','exports','ENUM','timeout','mouseOver','STRING'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x760b,0x14a));var _0xb760=function(_0x470cae,_0x82f4a2){_0x470cae=_0x470cae-0x0;var _0x11e17e=_0x760b[_0x470cae];return _0x11e17e;};'use strict';var Sequelize=require(_0xb760('0x0'));module[_0xb760('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb760('0x2')]('mouseOver',_0xb760('0x3')),'defaultValue':_0xb760('0x4')},'selector':{'type':Sequelize[_0xb760('0x5')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x547c=['mouseOver','timeout','STRING','INTEGER','ENUM'];(function(_0x499968,_0x4540c7){var _0x559f0b=function(_0x391904){while(--_0x391904){_0x499968['push'](_0x499968['shift']());}};_0x559f0b(++_0x4540c7);}(_0x547c,0xa4));var _0xc547=function(_0x2f6136,_0x274ed2){_0x2f6136=_0x2f6136-0x0;var _0x5ac67b=_0x547c[_0x2f6136];return _0x5ac67b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xc547('0x0')](_0xc547('0x1'),_0xc547('0x2')),'defaultValue':_0xc547('0x1')},'selector':{'type':Sequelize[_0xc547('0x3')]},'timeout':{'type':Sequelize[_0xc547('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 8b3d28a..a98967e 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 _0x9417=['sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','show','model','keys','ChatProactiveAction','query','filters','intersection','attributes','fields','length','includeAll','include','merge','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x5cd042,_0xba348){var _0x10490b=function(_0xce382f){while(--_0xce382f){_0x5cd042['push'](_0x5cd042['shift']());}};_0x10490b(++_0xba348);}(_0x9417,0xb4));var _0x7941=function(_0x9fb081,_0x48f480){_0x9fb081=_0x9fb081-0x0;var _0x43f8b0=_0x9417[_0x9fb081];return _0x43f8b0;};'use strict';var emlformat=require(_0x7941('0x0'));var rimraf=require(_0x7941('0x1'));var zipdir=require(_0x7941('0x2'));var jsonpatch=require(_0x7941('0x3'));var rp=require('request-promise');var moment=require(_0x7941('0x4'));var BPromise=require(_0x7941('0x5'));var Mustache=require(_0x7941('0x6'));var util=require(_0x7941('0x7'));var path=require(_0x7941('0x8'));var sox=require(_0x7941('0x9'));var csv=require(_0x7941('0xa'));var ejs=require(_0x7941('0xb'));var fs=require('fs');var fs_extra=require(_0x7941('0xc'));var _=require(_0x7941('0xd'));var squel=require('squel');var crypto=require(_0x7941('0xe'));var jsforce=require(_0x7941('0xf'));var deskjs=require(_0x7941('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7941('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7941('0x12'));var qs=require(_0x7941('0x13'));var as=require(_0x7941('0x14'));var hardwareService=require(_0x7941('0x15'));var logger=require(_0x7941('0x16'))(_0x7941('0x17'));var utils=require(_0x7941('0x18'));var config=require(_0x7941('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x7941('0x1a'))['db'];function respondWithStatusCode(_0x51aab8,_0x12b674){_0x12b674=_0x12b674||0xcc;return function(_0x46a86a){if(_0x46a86a){return _0x51aab8['sendStatus'](_0x12b674);}return _0x51aab8['status'](_0x12b674)[_0x7941('0x1b')]();};}function respondWithResult(_0x59f371,_0x18936d){_0x18936d=_0x18936d||0xc8;return function(_0x45c08f){if(_0x45c08f){return _0x59f371[_0x7941('0x1c')](_0x18936d)[_0x7941('0x1d')](_0x45c08f);}};}function respondWithFilteredResult(_0x1da410,_0x41b098){return function(_0x55320b){if(_0x55320b){var _0x11623c=typeof _0x41b098[_0x7941('0x1e')]===_0x7941('0x1f')&&typeof _0x41b098[_0x7941('0x20')]===_0x7941('0x1f');var _0x256f45=_0x55320b[_0x7941('0x21')];var _0x573b44=_0x11623c?0x0:_0x41b098[_0x7941('0x1e')];var _0x533559=_0x11623c?_0x55320b['count']:_0x41b098[_0x7941('0x1e')]+_0x41b098['limit'];var _0x17442f;if(_0x533559>=_0x256f45){_0x533559=_0x256f45;_0x17442f=0xc8;}else{_0x17442f=0xce;}_0x1da410[_0x7941('0x1c')](_0x17442f);return _0x1da410[_0x7941('0x22')]('Content-Range',_0x573b44+'-'+_0x533559+'/'+_0x256f45)['json'](_0x55320b);}return null;};}function patchUpdates(_0x645e4c){return function(_0x4d3b28){try{jsonpatch[_0x7941('0x23')](_0x4d3b28,_0x645e4c,!![]);}catch(_0x57809b){return BPromise[_0x7941('0x24')](_0x57809b);}return _0x4d3b28[_0x7941('0x25')]();};}function saveUpdates(_0x42ff1f,_0x45ae78){return function(_0x3c2ae5){if(_0x3c2ae5){return _0x3c2ae5[_0x7941('0x26')](_0x42ff1f)[_0x7941('0x27')](function(_0x5287e0){return _0x5287e0;});}return null;};}function removeEntity(_0x20dd64,_0x531f20){return function(_0x36ff77){if(_0x36ff77){return _0x36ff77[_0x7941('0x28')]()[_0x7941('0x27')](function(){_0x20dd64[_0x7941('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55f679,_0x1e61e0){return function(_0x5ad836){if(!_0x5ad836){_0x55f679['sendStatus'](0x194);}return _0x5ad836;};}function handleError(_0x5f09c1,_0x43caf0){_0x43caf0=_0x43caf0||0x1f4;return function(_0x1b59e2){logger[_0x7941('0x29')](_0x1b59e2[_0x7941('0x2a')]);if(_0x1b59e2[_0x7941('0x2b')]){delete _0x1b59e2['name'];}_0x5f09c1[_0x7941('0x1c')](_0x43caf0)[_0x7941('0x2c')](_0x1b59e2);};}exports[_0x7941('0x2d')]=function(_0x240052,_0x23f617){var _0x24cc75={'raw':!![],'where':{'id':_0x240052['params']['id']}},_0xd2b022={};_0xd2b022[_0x7941('0x2e')]=_[_0x7941('0x2f')](db[_0x7941('0x30')]['rawAttributes']);_0xd2b022[_0x7941('0x31')]=_['keys'](_0x240052[_0x7941('0x31')]);_0xd2b022[_0x7941('0x32')]=_[_0x7941('0x33')](_0xd2b022['model'],_0xd2b022[_0x7941('0x31')]);_0x24cc75[_0x7941('0x34')]=_['intersection'](_0xd2b022[_0x7941('0x2e')],qs[_0x7941('0x35')](_0x240052['query'][_0x7941('0x35')]));_0x24cc75[_0x7941('0x34')]=_0x24cc75['attributes'][_0x7941('0x36')]?_0x24cc75[_0x7941('0x34')]:_0xd2b022[_0x7941('0x2e')];if(_0x240052[_0x7941('0x31')][_0x7941('0x37')]){_0x24cc75[_0x7941('0x38')]=[{'all':!![]}];}_0x24cc75=_[_0x7941('0x39')]({},_0x24cc75,_0x240052['options']);return db[_0x7941('0x30')][_0x7941('0x3a')](_0x24cc75)['then'](handleEntityNotFound(_0x23f617,null))[_0x7941('0x27')](respondWithResult(_0x23f617,null))[_0x7941('0x3b')](handleError(_0x23f617,null));};exports[_0x7941('0x3c')]=function(_0x1d03d7,_0x1173b8){return db[_0x7941('0x30')]['create'](_0x1d03d7[_0x7941('0x3d')],{})[_0x7941('0x27')](respondWithResult(_0x1173b8,0xc9))[_0x7941('0x3b')](handleError(_0x1173b8,null));};exports[_0x7941('0x26')]=function(_0x469317,_0x1ff304){if(_0x469317[_0x7941('0x3d')]['id']){delete _0x469317['body']['id'];}return db[_0x7941('0x30')][_0x7941('0x3a')]({'where':{'id':_0x469317['params']['id']}})['then'](handleEntityNotFound(_0x1ff304,null))[_0x7941('0x27')](saveUpdates(_0x469317[_0x7941('0x3d')],null))[_0x7941('0x27')](respondWithResult(_0x1ff304,null))[_0x7941('0x3b')](handleError(_0x1ff304,null));};exports[_0x7941('0x28')]=function(_0x2a59f6,_0x234554){return db[_0x7941('0x30')]['find']({'where':{'id':_0x2a59f6[_0x7941('0x3e')]['id']}})['then'](handleEntityNotFound(_0x234554,null))[_0x7941('0x27')](removeEntity(_0x234554,null))[_0x7941('0x3b')](handleError(_0x234554,null));};
\ No newline at end of file
+var _0x8098=['end','error','stack','name','send','params','keys','rawAttributes','query','intersection','model','attributes','fields','length','merge','ChatProactiveAction','catch','create','body','update','find','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','then'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x8098,0x1ba));var _0x8809=function(_0x346178,_0xc7c30b){_0x346178=_0x346178-0x0;var _0x201712=_0x8098[_0x346178];return _0x201712;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8809('0x0'));var jsonpatch=require(_0x8809('0x1'));var rp=require(_0x8809('0x2'));var moment=require(_0x8809('0x3'));var BPromise=require(_0x8809('0x4'));var Mustache=require('mustache');var util=require(_0x8809('0x5'));var path=require(_0x8809('0x6'));var sox=require(_0x8809('0x7'));var csv=require(_0x8809('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8809('0x9'));var _=require(_0x8809('0xa'));var squel=require('squel');var crypto=require(_0x8809('0xb'));var jsforce=require(_0x8809('0xc'));var deskjs=require(_0x8809('0xd'));var toCsv=require(_0x8809('0x8'));var querystring=require(_0x8809('0xe'));var Papa=require(_0x8809('0xf'));var Redis=require(_0x8809('0x10'));var authService=require(_0x8809('0x11'));var qs=require(_0x8809('0x12'));var as=require(_0x8809('0x13'));var hardwareService=require(_0x8809('0x14'));var logger=require(_0x8809('0x15'))(_0x8809('0x16'));var utils=require(_0x8809('0x17'));var config=require(_0x8809('0x18'));var licenseUtil=require(_0x8809('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x388b99,_0x455989){_0x455989=_0x455989||0xcc;return function(_0x4d3b4c){if(_0x4d3b4c){return _0x388b99[_0x8809('0x1a')](_0x455989);}return _0x388b99[_0x8809('0x1b')](_0x455989)['end']();};}function respondWithResult(_0x5d87df,_0x316f2c){_0x316f2c=_0x316f2c||0xc8;return function(_0x2e4279){if(_0x2e4279){return _0x5d87df[_0x8809('0x1b')](_0x316f2c)[_0x8809('0x1c')](_0x2e4279);}};}function respondWithFilteredResult(_0x131716,_0x3d4d7e){return function(_0x105bec){if(_0x105bec){var _0x5624b5=typeof _0x3d4d7e[_0x8809('0x1d')]===_0x8809('0x1e')&&typeof _0x3d4d7e['limit']===_0x8809('0x1e');var _0x369d58=_0x105bec['count'];var _0x3b0562=_0x5624b5?0x0:_0x3d4d7e[_0x8809('0x1d')];var _0x7ec1a6=_0x5624b5?_0x105bec[_0x8809('0x1f')]:_0x3d4d7e[_0x8809('0x1d')]+_0x3d4d7e['limit'];var _0x4826e2;if(_0x7ec1a6>=_0x369d58){_0x7ec1a6=_0x369d58;_0x4826e2=0xc8;}else{_0x4826e2=0xce;}_0x131716[_0x8809('0x1b')](_0x4826e2);return _0x131716[_0x8809('0x20')](_0x8809('0x21'),_0x3b0562+'-'+_0x7ec1a6+'/'+_0x369d58)[_0x8809('0x1c')](_0x105bec);}return null;};}function patchUpdates(_0x2ff4a1){return function(_0x91de1e){try{jsonpatch[_0x8809('0x22')](_0x91de1e,_0x2ff4a1,!![]);}catch(_0x404be9){return BPromise[_0x8809('0x23')](_0x404be9);}return _0x91de1e[_0x8809('0x24')]();};}function saveUpdates(_0x16893a,_0x1440aa){return function(_0x26b43e){if(_0x26b43e){return _0x26b43e['update'](_0x16893a)['then'](function(_0x34d2df){return _0x34d2df;});}return null;};}function removeEntity(_0x5984c6,_0x521840){return function(_0x54ddd8){if(_0x54ddd8){return _0x54ddd8['destroy']()[_0x8809('0x25')](function(){_0x5984c6[_0x8809('0x1b')](0xcc)[_0x8809('0x26')]();});}};}function handleEntityNotFound(_0x2bbf26,_0x2947f7){return function(_0x3d21fd){if(!_0x3d21fd){_0x2bbf26[_0x8809('0x1a')](0x194);}return _0x3d21fd;};}function handleError(_0x14f545,_0x125776){_0x125776=_0x125776||0x1f4;return function(_0x6e5dc8){logger[_0x8809('0x27')](_0x6e5dc8[_0x8809('0x28')]);if(_0x6e5dc8['name']){delete _0x6e5dc8[_0x8809('0x29')];}_0x14f545[_0x8809('0x1b')](_0x125776)[_0x8809('0x2a')](_0x6e5dc8);};}exports['show']=function(_0x13d74b,_0x443741){var _0xbba52b={'raw':!![],'where':{'id':_0x13d74b[_0x8809('0x2b')]['id']}},_0x296187={};_0x296187['model']=_[_0x8809('0x2c')](db['ChatProactiveAction'][_0x8809('0x2d')]);_0x296187[_0x8809('0x2e')]=_['keys'](_0x13d74b[_0x8809('0x2e')]);_0x296187['filters']=_[_0x8809('0x2f')](_0x296187[_0x8809('0x30')],_0x296187[_0x8809('0x2e')]);_0xbba52b[_0x8809('0x31')]=_[_0x8809('0x2f')](_0x296187[_0x8809('0x30')],qs['fields'](_0x13d74b['query'][_0x8809('0x32')]));_0xbba52b[_0x8809('0x31')]=_0xbba52b[_0x8809('0x31')][_0x8809('0x33')]?_0xbba52b[_0x8809('0x31')]:_0x296187['model'];if(_0x13d74b[_0x8809('0x2e')]['includeAll']){_0xbba52b['include']=[{'all':!![]}];}_0xbba52b=_[_0x8809('0x34')]({},_0xbba52b,_0x13d74b['options']);return db[_0x8809('0x35')]['find'](_0xbba52b)[_0x8809('0x25')](handleEntityNotFound(_0x443741,null))[_0x8809('0x25')](respondWithResult(_0x443741,null))[_0x8809('0x36')](handleError(_0x443741,null));};exports[_0x8809('0x37')]=function(_0x27565c,_0x29c522){return db['ChatProactiveAction'][_0x8809('0x37')](_0x27565c[_0x8809('0x38')],{})['then'](respondWithResult(_0x29c522,0xc9))[_0x8809('0x36')](handleError(_0x29c522,null));};exports[_0x8809('0x39')]=function(_0x4a09a,_0x2f584f){if(_0x4a09a[_0x8809('0x38')]['id']){delete _0x4a09a[_0x8809('0x38')]['id'];}return db['ChatProactiveAction'][_0x8809('0x3a')]({'where':{'id':_0x4a09a[_0x8809('0x2b')]['id']}})[_0x8809('0x25')](handleEntityNotFound(_0x2f584f,null))[_0x8809('0x25')](saveUpdates(_0x4a09a[_0x8809('0x38')],null))[_0x8809('0x25')](respondWithResult(_0x2f584f,null))[_0x8809('0x36')](handleError(_0x2f584f,null));};exports[_0x8809('0x3b')]=function(_0x4e73ff,_0x13b530){return db[_0x8809('0x35')][_0x8809('0x3a')]({'where':{'id':_0x4e73ff[_0x8809('0x2b')]['id']}})['then'](handleEntityNotFound(_0x13b530,null))[_0x8809('0x25')](removeEntity(_0x13b530,null))[_0x8809('0x36')](handleError(_0x13b530,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 0a5feba..fa0b040 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 _0xe272=['rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x25c659,_0x553ea8){var _0x14fee9=function(_0x17403c){while(--_0x17403c){_0x25c659['push'](_0x25c659['shift']());}};_0x14fee9(++_0x553ea8);}(_0xe272,0x1e7));var _0x2e27=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xe272[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x2e27('0x0'));var util=require(_0x2e27('0x1'));var logger=require(_0x2e27('0x2'))(_0x2e27('0x3'));var moment=require(_0x2e27('0x4'));var BPromise=require(_0x2e27('0x5'));var rp=require(_0x2e27('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e27('0x7'));var config=require(_0x2e27('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0x2e27('0x9')]=function(_0x4a66dc,_0x307412){return _0x4a66dc[_0x2e27('0xa')](_0x2e27('0xb'),attributes,{'tableName':_0x2e27('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8bc0=['ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','define'];(function(_0x3ad459,_0x2fb428){var _0x11d0d3=function(_0xb0c9f0){while(--_0xb0c9f0){_0x3ad459['push'](_0x3ad459['shift']());}};_0x11d0d3(++_0x2fb428);}(_0x8bc0,0x12d));var _0x08bc=function(_0x508c0e,_0x511e38){_0x508c0e=_0x508c0e-0x0;var _0x5532a2=_0x8bc0[_0x508c0e];return _0x5532a2;};'use strict';var _=require(_0x08bc('0x0'));var util=require(_0x08bc('0x1'));var logger=require(_0x08bc('0x2'))(_0x08bc('0x3'));var moment=require('moment');var BPromise=require(_0x08bc('0x4'));var rp=require(_0x08bc('0x5'));var fs=require('fs');var path=require(_0x08bc('0x6'));var rimraf=require(_0x08bc('0x7'));var config=require(_0x08bc('0x8'));var attributes=require(_0x08bc('0x9'));module['exports']=function(_0x3b9298,_0x1a9cab){return _0x3b9298[_0x08bc('0xa')](_0x08bc('0xb'),attributes,{'tableName':_0x08bc('0xc'),'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 3adb5c1..a94e270 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 _0x682e=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x2742db,_0x58e00c){var _0x18659e=function(_0x5bd3ac){while(--_0x5bd3ac){_0x2742db['push'](_0x2742db['shift']());}};_0x18659e(++_0x58e00c);}(_0x682e,0x119));var _0xe682=function(_0xfb2f7d,_0x58d8fa){_0xfb2f7d=_0xfb2f7d-0x0;var _0x164866=_0x682e[_0xfb2f7d];return _0x164866;};'use strict';var _=require(_0xe682('0x0'));var util=require('util');var moment=require(_0xe682('0x1'));var BPromise=require(_0xe682('0x2'));var rs=require(_0xe682('0x3'));var fs=require('fs');var Redis=require(_0xe682('0x4'));var db=require(_0xe682('0x5'))['db'];var utils=require(_0xe682('0x6'));var logger=require(_0xe682('0x7'))(_0xe682('0x8'));var config=require(_0xe682('0x9'));var jayson=require(_0xe682('0xa'));var client=jayson[_0xe682('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x82fa21,_0x1d766a,_0x214393){return new BPromise(function(_0x283937,_0x5d9cd5){return client[_0xe682('0xc')](_0x82fa21,_0x214393)[_0xe682('0xd')](function(_0xc6d5fe){logger[_0xe682('0xe')](_0xe682('0xf'),_0x1d766a,_0xe682('0x10'));logger['debug'](_0xe682('0x11'),_0x1d766a,_0xe682('0x10'),JSON['stringify'](_0xc6d5fe));if(_0xc6d5fe[_0xe682('0x12')]){if(_0xc6d5fe[_0xe682('0x12')][_0xe682('0x13')]===0x1f4){logger[_0xe682('0x12')](_0xe682('0xf'),_0x1d766a,_0xc6d5fe[_0xe682('0x12')][_0xe682('0x14')]);return _0x5d9cd5(_0xc6d5fe['error'][_0xe682('0x14')]);}logger[_0xe682('0x12')](_0xe682('0xf'),_0x1d766a,_0xc6d5fe[_0xe682('0x12')][_0xe682('0x14')]);return _0x283937(_0xc6d5fe[_0xe682('0x12')][_0xe682('0x14')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x1d766a,_0xe682('0x10'));_0x283937(_0xc6d5fe[_0xe682('0x15')][_0xe682('0x14')]);}})['catch'](function(_0x11b0aa){logger[_0xe682('0x12')](_0xe682('0xf'),_0x1d766a,_0x11b0aa);_0x5d9cd5(_0x11b0aa);});});}
\ No newline at end of file
+var _0xeee6=['jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xeee6,0x1af));var _0x6eee=function(_0x4487d8,_0x3627d7){_0x4487d8=_0x4487d8-0x0;var _0x5646bd=_0xeee6[_0x4487d8];return _0x5646bd;};'use strict';var _=require('lodash');var util=require(_0x6eee('0x0'));var moment=require(_0x6eee('0x1'));var BPromise=require('bluebird');var rs=require(_0x6eee('0x2'));var fs=require('fs');var Redis=require(_0x6eee('0x3'));var db=require(_0x6eee('0x4'))['db'];var utils=require(_0x6eee('0x5'));var logger=require(_0x6eee('0x6'))(_0x6eee('0x7'));var config=require(_0x6eee('0x8'));var jayson=require(_0x6eee('0x9'));var client=jayson[_0x6eee('0xa')][_0x6eee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x281ed8,_0x3cdc2f,_0x137c2e){return new BPromise(function(_0x4ff82b,_0x437f35){return client['request'](_0x281ed8,_0x137c2e)[_0x6eee('0xc')](function(_0x512465){logger[_0x6eee('0xd')](_0x6eee('0xe'),_0x3cdc2f,_0x6eee('0xf'));logger['debug'](_0x6eee('0x10'),_0x3cdc2f,_0x6eee('0xf'),JSON[_0x6eee('0x11')](_0x512465));if(_0x512465[_0x6eee('0x12')]){if(_0x512465[_0x6eee('0x12')][_0x6eee('0x13')]===0x1f4){logger[_0x6eee('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x3cdc2f,_0x512465[_0x6eee('0x12')][_0x6eee('0x14')]);return _0x437f35(_0x512465[_0x6eee('0x12')][_0x6eee('0x14')]);}logger['error'](_0x6eee('0xe'),_0x3cdc2f,_0x512465['error'][_0x6eee('0x14')]);return _0x4ff82b(_0x512465[_0x6eee('0x12')][_0x6eee('0x14')]);}else{logger[_0x6eee('0xd')](_0x6eee('0xe'),_0x3cdc2f,_0x6eee('0xf'));_0x4ff82b(_0x512465['result']['message']);}})[_0x6eee('0x15')](function(_0x52b986){logger[_0x6eee('0x12')](_0x6eee('0xe'),_0x3cdc2f,_0x52b986);_0x437f35(_0x52b986);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index bb35a23..a367b6f 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 _0xd8fb=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','isAuthenticated','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x2fd7d9,_0x585704){var _0xd3d662=function(_0x1dc7eb){while(--_0x1dc7eb){_0x2fd7d9['push'](_0x2fd7d9['shift']());}};_0xd3d662(++_0x585704);}(_0xd8fb,0x99));var _0xbd8f=function(_0x46f334,_0x2c63fa){_0x46f334=_0x46f334-0x0;var _0x3db125=_0xd8fb[_0x46f334];return _0x3db125;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/:id',auth[_0xbd8f('0x8')](),controller['show']);router[_0xbd8f('0x9')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0xc')]);router[_0xbd8f('0xd')](_0xbd8f('0xe'),auth['isAuthenticated'](),controller[_0xbd8f('0xf')]);module[_0xbd8f('0x10')]=router;
\ No newline at end of file
+var _0x6aa7=['/:id','show','post','isAuthenticated','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xa8fb3f,_0x4dd5e3){var _0x556f1f=function(_0x3b530d){while(--_0x3b530d){_0xa8fb3f['push'](_0xa8fb3f['shift']());}};_0x556f1f(++_0x4dd5e3);}(_0x6aa7,0x178));var _0x76aa=function(_0x1c9704,_0x4605aa){_0x1c9704=_0x1c9704-0x0;var _0x4c98d8=_0x6aa7[_0x1c9704];return _0x4c98d8;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0x76aa('0x8'),auth['isAuthenticated'](),controller[_0x76aa('0x9')]);router[_0x76aa('0xa')]('/',auth[_0x76aa('0xb')](),controller['create']);router[_0x76aa('0xc')](_0x76aa('0x8'),auth[_0x76aa('0xb')](),controller['update']);router[_0x76aa('0xd')](_0x76aa('0x8'),auth[_0x76aa('0xb')](),controller[_0x76aa('0xe')]);module[_0x76aa('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index e639046..8b3160d 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 _0x6023=['STRING','INTEGER','ENUM','beepall','roundrobin','sequelize','exports','name'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x6023,0x105));var _0x3602=function(_0x30f160,_0x185cea){_0x30f160=_0x30f160-0x0;var _0x87795=_0x6023[_0x30f160];return _0x87795;};'use strict';var Sequelize=require(_0x3602('0x0'));module[_0x3602('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3602('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3602('0x3')]},'timeout':{'type':Sequelize[_0x3602('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3602('0x5')]('rrmemory',_0x3602('0x6'),_0x3602('0x7'))}};
\ No newline at end of file
+var _0xcd4c=['roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0x50f3fd,_0x14930d){var _0x2da233=function(_0x14a594){while(--_0x14a594){_0x50f3fd['push'](_0x50f3fd['shift']());}};_0x2da233(++_0x14930d);}(_0xcd4c,0x141));var _0xccd4=function(_0x20e1f7,_0x59a3ba){_0x20e1f7=_0x20e1f7-0x0;var _0x54f752=_0xcd4c[_0x20e1f7];return _0x54f752;};'use strict';var Sequelize=require(_0xccd4('0x0'));module[_0xccd4('0x1')]={'name':{'type':Sequelize[_0xccd4('0x2')],'unique':_0xccd4('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xccd4('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xccd4('0x4')](_0xccd4('0x5'),_0xccd4('0x6'),_0xccd4('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 45675cd..87234f1 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 _0xb0a5=['fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','order','ChatQueueId','findAll','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','findOne','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','all','union','removeAgents','addAgents','spread','userChatQueue:remove','getAgents','fast-json-patch','request-promise','bluebird','path','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','sendStatus','status','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','get','ChatQueues','UserProfileResource','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes'];(function(_0x1296f0,_0x4331c3){var _0x4b2a0f=function(_0x316f53){while(--_0x316f53){_0x1296f0['push'](_0x1296f0['shift']());}};_0x4b2a0f(++_0x4331c3);}(_0xb0a5,0x1e3));var _0x5b0a=function(_0x5d160,_0xa4838e){_0x5d160=_0x5d160-0x0;var _0x1d180d=_0xb0a5[_0x5d160];return _0x1d180d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5b0a('0x0'));var rp=require(_0x5b0a('0x1'));var moment=require('moment');var BPromise=require(_0x5b0a('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5b0a('0x3'));var sox=require('sox');var csv=require(_0x5b0a('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b0a('0x5'));var _=require('lodash');var squel=require(_0x5b0a('0x6'));var crypto=require('crypto');var jsforce=require(_0x5b0a('0x7'));var deskjs=require(_0x5b0a('0x8'));var toCsv=require(_0x5b0a('0x4'));var querystring=require(_0x5b0a('0x9'));var Papa=require(_0x5b0a('0xa'));var Redis=require(_0x5b0a('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x5b0a('0xc'));var as=require(_0x5b0a('0xd'));var hardwareService=require(_0x5b0a('0xe'));var logger=require('../../config/logger')('api');var utils=require(_0x5b0a('0xf'));var config=require(_0x5b0a('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b0a('0x11'))['db'];config[_0x5b0a('0x12')]=_[_0x5b0a('0x13')](config[_0x5b0a('0x12')],{'host':_0x5b0a('0x14'),'port':0x18eb});var socket=require(_0x5b0a('0x15'))(new Redis(config['redis']));require(_0x5b0a('0x16'))['register'](socket);var jayson=require(_0x5b0a('0x17'));var client=jayson[_0x5b0a('0x18')][_0x5b0a('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x212794,_0x47557e,_0x5dee57,_0x1630ac){return new BPromise(function(_0x37ebdf,_0x43f620){var _0x43253b=_0x1630ac||client;return _0x43253b[_0x5b0a('0x1a')](_0x212794,_0x5dee57)['then'](function(_0x4aa8af){logger['info'](_0x5b0a('0x1b'),_0x47557e,_0x5b0a('0x1c'));logger[_0x5b0a('0x1d')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x47557e,_0x5b0a('0x1c'),JSON[_0x5b0a('0x1e')](_0x4aa8af));if(_0x4aa8af[_0x5b0a('0x1f')]){if(_0x4aa8af[_0x5b0a('0x1f')]['code']===0x1f4){logger[_0x5b0a('0x1f')]('ChatQueue,\x20%s,\x20%s',_0x47557e,_0x4aa8af[_0x5b0a('0x1f')]['message']);return _0x43f620(_0x4aa8af['error'][_0x5b0a('0x20')]);}logger[_0x5b0a('0x1f')](_0x5b0a('0x1b'),_0x47557e,_0x4aa8af['error'][_0x5b0a('0x20')]);return _0x37ebdf(_0x4aa8af['error'][_0x5b0a('0x20')]);}else{logger[_0x5b0a('0x21')](_0x5b0a('0x1b'),_0x47557e,_0x5b0a('0x1c'));_0x37ebdf(_0x4aa8af[_0x5b0a('0x22')][_0x5b0a('0x20')]);}})['catch'](function(_0x595113){logger[_0x5b0a('0x1f')](_0x5b0a('0x1b'),_0x47557e,_0x595113);_0x43f620(_0x595113);});});}function respondWithStatusCode(_0x2a3c5d,_0x4701e9){_0x4701e9=_0x4701e9||0xcc;return function(_0xacb9aa){if(_0xacb9aa){return _0x2a3c5d[_0x5b0a('0x23')](_0x4701e9);}return _0x2a3c5d[_0x5b0a('0x24')](_0x4701e9)['end']();};}function respondWithResult(_0x3dc282,_0x5e4a9e){_0x5e4a9e=_0x5e4a9e||0xc8;return function(_0x46d685){if(_0x46d685){return _0x3dc282[_0x5b0a('0x24')](_0x5e4a9e)[_0x5b0a('0x25')](_0x46d685);}};}function respondWithFilteredResult(_0x586861,_0x418ad1){return function(_0x2bc069){if(_0x2bc069){var _0x466d0d=typeof _0x418ad1[_0x5b0a('0x26')]===_0x5b0a('0x27')&&typeof _0x418ad1['limit']===_0x5b0a('0x27');var _0xb07541=_0x2bc069[_0x5b0a('0x28')];var _0x5e995c=_0x466d0d?0x0:_0x418ad1[_0x5b0a('0x26')];var _0x1b422e=_0x466d0d?_0x2bc069[_0x5b0a('0x28')]:_0x418ad1['offset']+_0x418ad1[_0x5b0a('0x29')];var _0x40b380;if(_0x1b422e>=_0xb07541){_0x1b422e=_0xb07541;_0x40b380=0xc8;}else{_0x40b380=0xce;}_0x586861[_0x5b0a('0x24')](_0x40b380);return _0x586861['set'](_0x5b0a('0x2a'),_0x5e995c+'-'+_0x1b422e+'/'+_0xb07541)[_0x5b0a('0x25')](_0x2bc069);}return null;};}function patchUpdates(_0x2e9916){return function(_0x21d964){try{jsonpatch['apply'](_0x21d964,_0x2e9916,!![]);}catch(_0xead213){return BPromise[_0x5b0a('0x2b')](_0xead213);}return _0x21d964[_0x5b0a('0x2c')]();};}function saveUpdates(_0x1df966,_0x18d91e){return function(_0x21d0f8){if(_0x21d0f8){return _0x21d0f8[_0x5b0a('0x2d')](_0x1df966)[_0x5b0a('0x2e')](function(_0x523635){return _0x523635;});}return null;};}function removeEntity(_0x56f0bf,_0x513930){return function(_0x2e2189){if(_0x2e2189){return _0x2e2189[_0x5b0a('0x2f')]()[_0x5b0a('0x2e')](function(){var _0x5099b7=_0x2e2189[_0x5b0a('0x30')]({'plain':!![]});var _0x421af2=_0x5b0a('0x31');return db[_0x5b0a('0x32')][_0x5b0a('0x2f')]({'where':{'type':_0x421af2,'resourceId':_0x5099b7['id']}})[_0x5b0a('0x2e')](function(){return _0x2e2189;});})[_0x5b0a('0x2e')](function(){_0x56f0bf[_0x5b0a('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5acb63,_0xa4d8c0){return function(_0x15191a){if(!_0x15191a){_0x5acb63[_0x5b0a('0x23')](0x194);}return _0x15191a;};}function handleError(_0x38d47e,_0xcef7ea){_0xcef7ea=_0xcef7ea||0x1f4;return function(_0x2f01b1){logger[_0x5b0a('0x1f')](_0x2f01b1['stack']);if(_0x2f01b1[_0x5b0a('0x33')]){delete _0x2f01b1[_0x5b0a('0x33')];}_0x38d47e[_0x5b0a('0x24')](_0xcef7ea)[_0x5b0a('0x34')](_0x2f01b1);};}exports[_0x5b0a('0x35')]=function(_0x41f746,_0x1ce2cd){var _0x7927c4={},_0x3b0fc5={},_0x266b94={'count':0x0,'rows':[]};var _0x3efc54=_[_0x5b0a('0x36')](db[_0x5b0a('0x37')][_0x5b0a('0x38')],function(_0x3a7cdc){return{'name':_0x3a7cdc[_0x5b0a('0x39')],'type':_0x3a7cdc[_0x5b0a('0x3a')]['key']};});_0x3b0fc5[_0x5b0a('0x3b')]=_[_0x5b0a('0x36')](_0x3efc54,'name');_0x3b0fc5[_0x5b0a('0x3c')]=_[_0x5b0a('0x3d')](_0x41f746[_0x5b0a('0x3c')]);_0x3b0fc5[_0x5b0a('0x3e')]=_[_0x5b0a('0x3f')](_0x3b0fc5['model'],_0x3b0fc5[_0x5b0a('0x3c')]);_0x7927c4[_0x5b0a('0x40')]=_[_0x5b0a('0x3f')](_0x3b0fc5[_0x5b0a('0x3b')],qs[_0x5b0a('0x41')](_0x41f746[_0x5b0a('0x3c')][_0x5b0a('0x41')]));_0x7927c4[_0x5b0a('0x40')]=_0x7927c4[_0x5b0a('0x40')][_0x5b0a('0x42')]?_0x7927c4[_0x5b0a('0x40')]:_0x3b0fc5[_0x5b0a('0x3b')];if(!_0x41f746[_0x5b0a('0x3c')][_0x5b0a('0x43')](_0x5b0a('0x44'))){_0x7927c4['limit']=qs[_0x5b0a('0x29')](_0x41f746[_0x5b0a('0x3c')][_0x5b0a('0x29')]);_0x7927c4['offset']=qs[_0x5b0a('0x26')](_0x41f746['query']['offset']);}_0x7927c4['order']=qs[_0x5b0a('0x45')](_0x41f746[_0x5b0a('0x3c')]['sort']);_0x7927c4[_0x5b0a('0x46')]=qs[_0x5b0a('0x3e')](_[_0x5b0a('0x47')](_0x41f746['query'],_0x3b0fc5[_0x5b0a('0x3e')]),_0x3efc54);if(_0x41f746[_0x5b0a('0x3c')]['filter']){_0x7927c4[_0x5b0a('0x46')]=_[_0x5b0a('0x48')](_0x7927c4[_0x5b0a('0x46')],{'$or':_[_0x5b0a('0x36')](_0x3efc54,function(_0x1b2edc){if(_0x1b2edc[_0x5b0a('0x3a')]!==_0x5b0a('0x49')){var _0x27d83a={};_0x27d83a[_0x1b2edc[_0x5b0a('0x33')]]={'$like':'%'+_0x41f746['query'][_0x5b0a('0x4a')]+'%'};return _0x27d83a;}})});}_0x7927c4=_[_0x5b0a('0x48')]({},_0x7927c4,_0x41f746[_0x5b0a('0x4b')]);var _0x2f3696={'where':_0x7927c4['where']};return db['ChatQueue'][_0x5b0a('0x28')](_0x2f3696)[_0x5b0a('0x2e')](function(_0x27f47f){_0x266b94['count']=_0x27f47f;if(_0x41f746[_0x5b0a('0x3c')][_0x5b0a('0x4c')]){_0x7927c4[_0x5b0a('0x4d')]=[{'all':!![]}];}return db[_0x5b0a('0x37')]['findAll'](_0x7927c4);})[_0x5b0a('0x2e')](function(_0x37fb99){_0x266b94[_0x5b0a('0x4e')]=_0x37fb99;return _0x266b94;})[_0x5b0a('0x2e')](respondWithFilteredResult(_0x1ce2cd,_0x7927c4))[_0x5b0a('0x4f')](handleError(_0x1ce2cd,null));};exports[_0x5b0a('0x50')]=function(_0x8f23cf,_0x562c0f){var _0x292ab9={'raw':!![],'where':{'id':_0x8f23cf[_0x5b0a('0x51')]['id']}},_0x3e688d={};_0x3e688d[_0x5b0a('0x3b')]=_[_0x5b0a('0x3d')](db[_0x5b0a('0x37')]['rawAttributes']);_0x3e688d[_0x5b0a('0x3c')]=_[_0x5b0a('0x3d')](_0x8f23cf[_0x5b0a('0x3c')]);_0x3e688d[_0x5b0a('0x3e')]=_[_0x5b0a('0x3f')](_0x3e688d[_0x5b0a('0x3b')],_0x3e688d[_0x5b0a('0x3c')]);_0x292ab9[_0x5b0a('0x40')]=_['intersection'](_0x3e688d[_0x5b0a('0x3b')],qs['fields'](_0x8f23cf[_0x5b0a('0x3c')]['fields']));_0x292ab9['attributes']=_0x292ab9[_0x5b0a('0x40')][_0x5b0a('0x42')]?_0x292ab9[_0x5b0a('0x40')]:_0x3e688d[_0x5b0a('0x3b')];if(_0x8f23cf[_0x5b0a('0x3c')][_0x5b0a('0x4c')]){_0x292ab9[_0x5b0a('0x4d')]=[{'all':!![]}];}_0x292ab9=_[_0x5b0a('0x48')]({},_0x292ab9,_0x8f23cf[_0x5b0a('0x4b')]);return db['ChatQueue'][_0x5b0a('0x52')](_0x292ab9)[_0x5b0a('0x2e')](handleEntityNotFound(_0x562c0f,null))[_0x5b0a('0x2e')](respondWithResult(_0x562c0f,null))[_0x5b0a('0x4f')](handleError(_0x562c0f,null));};exports[_0x5b0a('0x53')]=function(_0x1a247c,_0x289954){return db['ChatQueue']['create'](_0x1a247c[_0x5b0a('0x54')],{})[_0x5b0a('0x2e')](function(_0x598da2){var _0x40b3ba=_0x1a247c[_0x5b0a('0x55')][_0x5b0a('0x30')]({'plain':!![]});if(!_0x40b3ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40b3ba[_0x5b0a('0x56')]===_0x5b0a('0x55')){var _0x45bd49=_0x598da2[_0x5b0a('0x30')]({'plain':!![]});var _0x1df356=_0x5b0a('0x31');return db['UserProfileSection']['find']({'where':{'name':_0x1df356,'userProfileId':_0x40b3ba[_0x5b0a('0x57')]},'raw':!![]})[_0x5b0a('0x2e')](function(_0x2bdc20){if(_0x2bdc20&&_0x2bdc20['autoAssociation']===0x0){return db['UserProfileResource'][_0x5b0a('0x53')]({'name':_0x45bd49['name'],'resourceId':_0x45bd49['id'],'type':_0x2bdc20[_0x5b0a('0x33')],'sectionId':_0x2bdc20['id']},{})['then'](function(){return _0x598da2;});}else{return _0x598da2;}})['catch'](function(_0x10d297){logger['error'](_0x5b0a('0x58'),_0x10d297);throw _0x10d297;});}return _0x598da2;})[_0x5b0a('0x2e')](respondWithResult(_0x289954,0xc9))[_0x5b0a('0x4f')](handleError(_0x289954,null));};exports[_0x5b0a('0x2d')]=function(_0x4490c7,_0xf4cd05){if(_0x4490c7[_0x5b0a('0x54')]['id']){delete _0x4490c7[_0x5b0a('0x54')]['id'];}return db['ChatQueue'][_0x5b0a('0x52')]({'where':{'id':_0x4490c7['params']['id']}})[_0x5b0a('0x2e')](handleEntityNotFound(_0xf4cd05,null))[_0x5b0a('0x2e')](saveUpdates(_0x4490c7[_0x5b0a('0x54')],null))['then'](respondWithResult(_0xf4cd05,null))[_0x5b0a('0x4f')](handleError(_0xf4cd05,null));};exports[_0x5b0a('0x2f')]=function(_0x5b2210,_0x4704f4){return db[_0x5b0a('0x37')]['find']({'where':{'id':_0x5b2210[_0x5b0a('0x51')]['id']}})['then'](handleEntityNotFound(_0x4704f4,null))['then'](removeEntity(_0x4704f4,null))[_0x5b0a('0x4f')](handleError(_0x4704f4,null));};exports[_0x5b0a('0x59')]=function(_0x3fa50a,_0x4e7346){return db[_0x5b0a('0x37')]['describe']()[_0x5b0a('0x2e')](respondWithResult(_0x4e7346,null))[_0x5b0a('0x4f')](handleError(_0x4e7346,null));};exports[_0x5b0a('0x5a')]=function(_0x56a4c7,_0x39c6ed,_0x21a5e6){var _0x258b0e={'raw':!![],'where':{}},_0x1df42f={},_0x349556;return db[_0x5b0a('0x37')]['findOne']({'where':{'id':_0x56a4c7[_0x5b0a('0x51')]['id']}})['then'](handleEntityNotFound(_0x39c6ed,null))[_0x5b0a('0x2e')](function(_0x2e89d2){if(_0x2e89d2){_0x349556=_0x2e89d2[_0x5b0a('0x30')]({'plain':!![]});_0x1df42f[_0x5b0a('0x3b')]=_[_0x5b0a('0x3d')](db[_0x5b0a('0x5b')][_0x5b0a('0x38')]);_0x1df42f['query']=_[_0x5b0a('0x3d')](_0x56a4c7[_0x5b0a('0x3c')]);_0x1df42f[_0x5b0a('0x3e')]=_[_0x5b0a('0x3f')](_0x1df42f[_0x5b0a('0x3b')],_0x1df42f[_0x5b0a('0x3c')]);_0x258b0e[_0x5b0a('0x40')]=_[_0x5b0a('0x3f')](_0x1df42f[_0x5b0a('0x3b')],qs[_0x5b0a('0x41')](_0x56a4c7[_0x5b0a('0x3c')][_0x5b0a('0x41')]));_0x258b0e[_0x5b0a('0x40')]=_0x258b0e[_0x5b0a('0x40')][_0x5b0a('0x42')]?_0x258b0e[_0x5b0a('0x40')]:_0x1df42f[_0x5b0a('0x3b')];if(!_0x56a4c7[_0x5b0a('0x3c')][_0x5b0a('0x43')]('nolimit')){_0x258b0e['limit']=qs[_0x5b0a('0x29')](_0x56a4c7[_0x5b0a('0x3c')]['limit']);_0x258b0e[_0x5b0a('0x26')]=qs[_0x5b0a('0x26')](_0x56a4c7[_0x5b0a('0x3c')][_0x5b0a('0x26')]);}_0x258b0e[_0x5b0a('0x5c')]=qs[_0x5b0a('0x45')](_0x56a4c7[_0x5b0a('0x3c')]['sort']);_0x258b0e[_0x5b0a('0x46')]=qs['filters'](_[_0x5b0a('0x47')](_0x56a4c7['query'],_0x1df42f[_0x5b0a('0x3e')]));_0x258b0e[_0x5b0a('0x46')][_0x5b0a('0x5d')]=_0x2e89d2['id'];if(_0x56a4c7['query'][_0x5b0a('0x4a')]){_0x258b0e['where']=_[_0x5b0a('0x48')](_0x258b0e['where'],{'$or':_[_0x5b0a('0x36')](_0x258b0e[_0x5b0a('0x40')],function(_0x2db562){var _0x41db0d={};_0x41db0d[_0x2db562]={'$like':'%'+_0x56a4c7[_0x5b0a('0x3c')][_0x5b0a('0x4a')]+'%'};return _0x41db0d;})});}_0x258b0e=_[_0x5b0a('0x48')]({},_0x258b0e,_0x56a4c7[_0x5b0a('0x4b')]);return db[_0x5b0a('0x5b')][_0x5b0a('0x5e')](_0x258b0e);}})['then'](function(_0x4e064c){if(_0x4e064c){return db[_0x5b0a('0x5f')][_0x5b0a('0x60')]({'where':{'id':_[_0x5b0a('0x36')](_0x4e064c,'UserId'),'role':_0x5b0a('0x61')},'attributes':['id',_0x5b0a('0x33'),_0x5b0a('0x62'),_0x5b0a('0x63'),_0x5b0a('0x64')]});}})[_0x5b0a('0x2e')](function(_0x5b9dc1){if(_0x5b9dc1){return{'count':_0x5b9dc1[_0x5b0a('0x28')],'rows':_['map'](_0x5b9dc1[_0x5b0a('0x4e')],function(_0x1a3f4a){return{'membername':_0x1a3f4a[_0x5b0a('0x33')],'UserId':_0x1a3f4a['id'],'queue_name':_0x349556[_0x5b0a('0x33')],'ChatQueueId':_0x349556['id'],'interface':util['format'](_0x5b0a('0x65'),_0x5b0a('0x66'),_0x1a3f4a['name']),'penalty':0x0,'paused':_0x1a3f4a['chatPause'],'createdAt':_0x1a3f4a[_0x5b0a('0x64')],'updatedAt':_0x1a3f4a[_0x5b0a('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5b0a('0x2e')](respondWithFilteredResult(_0x39c6ed,_0x258b0e))[_0x5b0a('0x4f')](handleError(_0x39c6ed,null));};exports['getTeams']=function(_0x2ec51b,_0x2d572f,_0x2288fe){var _0x2f525d={};var _0x86293={};var _0x5d92fb;var _0x25fb9e;return db['ChatQueue'][_0x5b0a('0x67')]({'where':{'id':_0x2ec51b['params']['id']}})[_0x5b0a('0x2e')](handleEntityNotFound(_0x2d572f,null))['then'](function(_0x2d65c5){if(_0x2d65c5){_0x5d92fb=_0x2d65c5;_0x86293[_0x5b0a('0x3b')]=_[_0x5b0a('0x3d')](db['Team'][_0x5b0a('0x38')]);_0x86293['query']=_[_0x5b0a('0x3d')](_0x2ec51b['query']);_0x86293['filters']=_['intersection'](_0x86293[_0x5b0a('0x3b')],_0x86293['query']);_0x2f525d['attributes']=_[_0x5b0a('0x3f')](_0x86293[_0x5b0a('0x3b')],qs[_0x5b0a('0x41')](_0x2ec51b[_0x5b0a('0x3c')][_0x5b0a('0x41')]));_0x2f525d['attributes']=_0x2f525d[_0x5b0a('0x40')]['length']?_0x2f525d[_0x5b0a('0x40')]:_0x86293[_0x5b0a('0x3b')];_0x2f525d[_0x5b0a('0x5c')]=qs[_0x5b0a('0x45')](_0x2ec51b['query'][_0x5b0a('0x45')]);_0x2f525d[_0x5b0a('0x46')]=qs[_0x5b0a('0x3e')](_['pick'](_0x2ec51b[_0x5b0a('0x3c')],_0x86293[_0x5b0a('0x3e')]));if(_0x2ec51b[_0x5b0a('0x3c')][_0x5b0a('0x4a')]){_0x2f525d['where']=_[_0x5b0a('0x48')](_0x2f525d['where'],{'$or':_[_0x5b0a('0x36')](_0x2f525d[_0x5b0a('0x40')],function(_0x3d70b5){var _0x2d0f38={};_0x2d0f38[_0x3d70b5]={'$like':'%'+_0x2ec51b[_0x5b0a('0x3c')][_0x5b0a('0x4a')]+'%'};return _0x2d0f38;})});}_0x2f525d=_[_0x5b0a('0x48')]({},_0x2f525d,_0x2ec51b['options']);return _0x5d92fb[_0x5b0a('0x68')](_0x2f525d);}})[_0x5b0a('0x2e')](function(_0x3a20d2){if(_0x3a20d2){_0x25fb9e=_0x3a20d2[_0x5b0a('0x42')];if(!_0x2ec51b[_0x5b0a('0x3c')]['hasOwnProperty']('nolimit')){_0x2f525d[_0x5b0a('0x29')]=qs[_0x5b0a('0x29')](_0x2ec51b[_0x5b0a('0x3c')]['limit']);_0x2f525d[_0x5b0a('0x26')]=qs[_0x5b0a('0x26')](_0x2ec51b['query'][_0x5b0a('0x26')]);}return _0x5d92fb[_0x5b0a('0x68')](_0x2f525d);}})['then'](function(_0x1b3acd){if(_0x1b3acd){return _0x1b3acd?{'count':_0x25fb9e,'rows':_0x1b3acd}:null;}})['then'](respondWithResult(_0x2d572f,null))[_0x5b0a('0x4f')](handleError(_0x2d572f,null));};exports[_0x5b0a('0x69')]=function(_0x2c5b4c,_0xf7472a,_0x257924){var _0x56da7e=_0x2c5b4c[_0x5b0a('0x54')][_0x5b0a('0x6a')];return db[_0x5b0a('0x6b')][_0x5b0a('0x5e')]({'where':{'id':_0x56da7e},'attributes':['id'],'include':[{'model':db[_0x5b0a('0x5f')],'as':_0x5b0a('0x6c'),'attributes':['id',_0x5b0a('0x33'),_0x5b0a('0x6d'),_0x5b0a('0x6e'),_0x5b0a('0x6f')],'raw':!![]}]})[_0x5b0a('0x2e')](function(_0x45f724){if(_0x45f724){var _0x206265=_[_0x5b0a('0x70')](_0x45f724,function(_0xb9b775){var _0x294495=_0xb9b775['get']({'plain':!![]});return _0x294495[_0x5b0a('0x6c')];});return db[_0x5b0a('0x37')][_0x5b0a('0x52')]({'where':{'id':_0x2c5b4c[_0x5b0a('0x51')]['id']}})[_0x5b0a('0x2e')](function(_0x4500f3){return db[_0x5b0a('0x71')][_0x5b0a('0x72')](function(_0x1e2b1b){return _0x4500f3[_0x5b0a('0x69')](_0x56da7e,{'transaction':_0x1e2b1b})['then'](function(){return BPromise['each'](_0x206265,function(_0x312e89){return db[_0x5b0a('0x5b')][_0x5b0a('0x73')]({'where':{'UserId':_0x312e89['id'],'ChatQueueId':_0x2c5b4c[_0x5b0a('0x51')]['id']},'transaction':_0x1e2b1b});});})['then'](function(){_0x206265[_0x5b0a('0x74')](function(_0x44ad98){socket[_0x5b0a('0x75')](_0x5b0a('0x76'),{'UserId':_0x44ad98['id'],'ChatQueueId':_0x4500f3['id']});});});});});}})['then'](respondWithStatusCode(_0xf7472a,null))[_0x5b0a('0x4f')](handleError(_0xf7472a,null));};exports[_0x5b0a('0x77')]=function(_0x13aaca,_0x59a310,_0x22435c){return db[_0x5b0a('0x6b')][_0x5b0a('0x5e')]({'where':{'id':_0x13aaca[_0x5b0a('0x3c')]['ids']},'attributes':['id'],'include':[{'model':db[_0x5b0a('0x5f')],'as':_0x5b0a('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x5b0a('0x2e')](handleEntityNotFound(_0x59a310,null))[_0x5b0a('0x2e')](function(_0x326195){var _0x37a1c4=_[_0x5b0a('0x36')](_0x326195,'id');var _0x3c6db8=[];var _0x170179=[];var _0x453e06=squel[_0x5b0a('0x78')]();_0x453e06[_0x5b0a('0x79')](_0x5b0a('0x7a'))['from']('team_has_chat_queues','tq')['join'](_0x5b0a('0x7b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x5b0a('0x46')](_0x5b0a('0x7c'),_0x13aaca[_0x5b0a('0x51')]['id']);for(var _0x2cb6f7=0x0;_0x2cb6f7<_0x326195['length'];_0x2cb6f7+=0x1){let _0x1356b9=_0x326195[_0x2cb6f7];for(var _0x3860ad=0x0;_0x3860ad<_0x1356b9['Agents']['length'];_0x3860ad+=0x1){let _0x217d39=_0x1356b9[_0x5b0a('0x6c')][_0x3860ad];var _0x25cb35=_0x453e06[_0x5b0a('0x7d')]();_0x25cb35[_0x5b0a('0x46')](_0x5b0a('0x7e'),_0x217d39['id']);_0x170179[_0x5b0a('0x7f')](db[_0x5b0a('0x71')][_0x5b0a('0x3c')](_0x25cb35['toString'](),{'type':db[_0x5b0a('0x71')][_0x5b0a('0x80')]['SELECT']})['then'](function(_0x30b298){if(_0x30b298[_0x5b0a('0x42')]===0x1){return _0x217d39['id'];}else{var _0x52c551=_[_0x5b0a('0x81')](_['map'](_0x30b298,'TeamId'),function(_0x40021c){return _['includes'](_0x37a1c4,_0x40021c);});if(_0x52c551){return _0x217d39['id'];}}}));}}return BPromise[_0x5b0a('0x82')](_0x170179)['then'](function(_0x14c1df){_0x3c6db8=_(_0x3c6db8)[_0x5b0a('0x83')](_0x14c1df)['compact']()['value']();return db[_0x5b0a('0x37')][_0x5b0a('0x52')]({'where':{'id':_0x13aaca[_0x5b0a('0x51')]['id']}})[_0x5b0a('0x2e')](function(_0x1118f4){return db[_0x5b0a('0x71')][_0x5b0a('0x72')](function(_0x807b5a){return _0x1118f4[_0x5b0a('0x77')](_0x13aaca[_0x5b0a('0x3c')][_0x5b0a('0x6a')],{'transaction':_0x807b5a})[_0x5b0a('0x2e')](function(){if(!_['isEmpty'](_0x3c6db8)){return _0x1118f4[_0x5b0a('0x84')](_0x3c6db8,{'transaction':_0x807b5a});}})['then'](function(){_0x3c6db8['forEach'](function(_0x2179e0){socket['emit']('userChatQueue:remove',{'UserId':_0x2179e0,'ChatQueueId':_0x1118f4['id']});});});});});});})[_0x5b0a('0x2e')](respondWithStatusCode(_0x59a310,null))[_0x5b0a('0x4f')](handleError(_0x59a310,null));};exports['addAgents']=function(_0x43724a,_0x4fe728,_0x445fa0){return db[_0x5b0a('0x37')][_0x5b0a('0x52')]({'where':{'id':_0x43724a[_0x5b0a('0x51')]['id']}})[_0x5b0a('0x2e')](handleEntityNotFound(_0x4fe728,null))[_0x5b0a('0x2e')](function(_0x27f004){if(_0x27f004){return _0x27f004[_0x5b0a('0x85')](_0x43724a[_0x5b0a('0x54')]['ids'],_['omit'](_0x43724a[_0x5b0a('0x54')],['ids','id'])||{})[_0x5b0a('0x86')](function(_0x5462a4){for(var _0x51c988=0x0;_0x51c988<_0x43724a[_0x5b0a('0x54')][_0x5b0a('0x6a')][_0x5b0a('0x42')];_0x51c988+=0x1){socket[_0x5b0a('0x75')](_0x5b0a('0x76'),{'UserId':Number(_0x43724a[_0x5b0a('0x54')][_0x5b0a('0x6a')][_0x51c988]),'ChatQueueId':Number(_0x43724a[_0x5b0a('0x51')]['id'])});}return _0x5462a4;});}})[_0x5b0a('0x2e')](respondWithResult(_0x4fe728,null))[_0x5b0a('0x4f')](handleError(_0x4fe728,null));};exports[_0x5b0a('0x84')]=function(_0x28d001,_0x362aaa,_0x47f0c9){return db[_0x5b0a('0x37')][_0x5b0a('0x52')]({'where':{'id':_0x28d001[_0x5b0a('0x51')]['id']}})['then'](handleEntityNotFound(_0x362aaa,null))['then'](function(_0x44fec1){if(_0x44fec1){return _0x44fec1['removeAgents'](_0x28d001[_0x5b0a('0x3c')][_0x5b0a('0x6a')])[_0x5b0a('0x2e')](function(){if(_['isArray'](_0x28d001[_0x5b0a('0x3c')][_0x5b0a('0x6a')])){for(var _0x3047c0=0x0;_0x3047c0<_0x28d001['query'][_0x5b0a('0x6a')]['length'];_0x3047c0+=0x1){socket[_0x5b0a('0x75')](_0x5b0a('0x87'),{'UserId':Number(_0x28d001['query'][_0x5b0a('0x6a')][_0x3047c0]),'ChatQueueId':Number(_0x28d001[_0x5b0a('0x51')]['id'])});}}else{socket[_0x5b0a('0x75')](_0x5b0a('0x87'),{'UserId':Number(_0x28d001[_0x5b0a('0x3c')]['ids']),'ChatQueueId':Number(_0x28d001[_0x5b0a('0x51')]['id'])});}});}})['then'](respondWithStatusCode(_0x362aaa,null))[_0x5b0a('0x4f')](handleError(_0x362aaa,null));};exports[_0x5b0a('0x88')]=function(_0x1bacc5,_0x12e36f,_0x65ddf4){var _0x3d7247={};var _0x134a6f={};var _0x5da1dd;var _0x27f3b1;return db['ChatQueue'][_0x5b0a('0x67')]({'where':{'id':_0x1bacc5[_0x5b0a('0x51')]['id']}})['then'](handleEntityNotFound(_0x12e36f,null))['then'](function(_0x4caf7b){if(_0x4caf7b){_0x5da1dd=_0x4caf7b;_0x134a6f[_0x5b0a('0x3b')]=_[_0x5b0a('0x3d')](db[_0x5b0a('0x5f')][_0x5b0a('0x38')]);_0x134a6f[_0x5b0a('0x3c')]=_[_0x5b0a('0x3d')](_0x1bacc5[_0x5b0a('0x3c')]);_0x134a6f['filters']=_[_0x5b0a('0x3f')](_0x134a6f[_0x5b0a('0x3b')],_0x134a6f[_0x5b0a('0x3c')]);_0x3d7247[_0x5b0a('0x40')]=_[_0x5b0a('0x3f')](_0x134a6f[_0x5b0a('0x3b')],qs['fields'](_0x1bacc5[_0x5b0a('0x3c')][_0x5b0a('0x41')]));_0x3d7247[_0x5b0a('0x40')]=_0x3d7247['attributes'][_0x5b0a('0x42')]?_0x3d7247[_0x5b0a('0x40')]:_0x134a6f[_0x5b0a('0x3b')];_0x3d7247['order']=qs[_0x5b0a('0x45')](_0x1bacc5['query'][_0x5b0a('0x45')]);_0x3d7247[_0x5b0a('0x46')]=qs[_0x5b0a('0x3e')](_[_0x5b0a('0x47')](_0x1bacc5[_0x5b0a('0x3c')],_0x134a6f[_0x5b0a('0x3e')]));if(_0x1bacc5['query']['filter']){_0x3d7247[_0x5b0a('0x46')]=_['merge'](_0x3d7247['where'],{'$or':_[_0x5b0a('0x36')](_0x3d7247[_0x5b0a('0x40')],function(_0x17360f){var _0x3fdfa5={};_0x3fdfa5[_0x17360f]={'$like':'%'+_0x1bacc5[_0x5b0a('0x3c')][_0x5b0a('0x4a')]+'%'};return _0x3fdfa5;})});}_0x3d7247=_[_0x5b0a('0x48')]({},_0x3d7247,_0x1bacc5[_0x5b0a('0x4b')]);return _0x5da1dd['getAgents'](_0x3d7247);}})[_0x5b0a('0x2e')](function(_0x49251a){if(_0x49251a){_0x27f3b1=_0x49251a['length'];if(!_0x1bacc5[_0x5b0a('0x3c')][_0x5b0a('0x43')](_0x5b0a('0x44'))){_0x3d7247['limit']=qs[_0x5b0a('0x29')](_0x1bacc5[_0x5b0a('0x3c')]['limit']);_0x3d7247['offset']=qs[_0x5b0a('0x26')](_0x1bacc5['query']['offset']);}return _0x5da1dd[_0x5b0a('0x88')](_0x3d7247);}})[_0x5b0a('0x2e')](function(_0x5603b6){if(_0x5603b6){return _0x5603b6?{'count':_0x27f3b1,'rows':_0x5603b6}:null;}})[_0x5b0a('0x2e')](respondWithResult(_0x12e36f,null))['catch'](handleError(_0x12e36f,null));};
\ No newline at end of file
+var _0xc9f3=['UserChatQueue','hasOwnProperty','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','ids','Agents','voicePause','flatMap','sequelize','transaction','addTeams','each','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','userChatQueue:save','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','sendStatus','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','destroy','get','ChatQueues','UserProfileResource','end','stack','name','send','index','ChatQueue','rawAttributes','fieldName','type','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','getMembers','findOne'];(function(_0x39ff33,_0x5eb1fc){var _0x3dc71e=function(_0x5ef5f6){while(--_0x5ef5f6){_0x39ff33['push'](_0x39ff33['shift']());}};_0x3dc71e(++_0x5eb1fc);}(_0xc9f3,0x158));var _0x3c9f=function(_0x8c87c0,_0x240ba0){_0x8c87c0=_0x8c87c0-0x0;var _0xef647=_0xc9f3[_0x8c87c0];return _0xef647;};'use strict';var emlformat=require(_0x3c9f('0x0'));var rimraf=require(_0x3c9f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3c9f('0x2'));var rp=require(_0x3c9f('0x3'));var moment=require('moment');var BPromise=require(_0x3c9f('0x4'));var Mustache=require(_0x3c9f('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3c9f('0x6'));var csv=require(_0x3c9f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3c9f('0x8'));var _=require(_0x3c9f('0x9'));var squel=require(_0x3c9f('0xa'));var crypto=require(_0x3c9f('0xb'));var jsforce=require(_0x3c9f('0xc'));var deskjs=require(_0x3c9f('0xd'));var toCsv=require(_0x3c9f('0x7'));var querystring=require('querystring');var Papa=require(_0x3c9f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3c9f('0xf'));var hardwareService=require(_0x3c9f('0x10'));var logger=require(_0x3c9f('0x11'))(_0x3c9f('0x12'));var utils=require(_0x3c9f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3c9f('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x3c9f('0x15')],{'host':_0x3c9f('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3c9f('0x15')]));require(_0x3c9f('0x17'))[_0x3c9f('0x18')](socket);var jayson=require(_0x3c9f('0x19'));var client=jayson[_0x3c9f('0x1a')][_0x3c9f('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x23eb5c,_0x39f6b6,_0x2c94e2,_0x2ef845){return new BPromise(function(_0x28f1cc,_0x17e0c8){var _0x3596ba=_0x2ef845||client;return _0x3596ba[_0x3c9f('0x1c')](_0x23eb5c,_0x2c94e2)[_0x3c9f('0x1d')](function(_0x44de3c){logger['info'](_0x3c9f('0x1e'),_0x39f6b6,_0x3c9f('0x1f'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x39f6b6,_0x3c9f('0x1f'),JSON['stringify'](_0x44de3c));if(_0x44de3c[_0x3c9f('0x20')]){if(_0x44de3c[_0x3c9f('0x20')][_0x3c9f('0x21')]===0x1f4){logger[_0x3c9f('0x20')](_0x3c9f('0x1e'),_0x39f6b6,_0x44de3c['error']['message']);return _0x17e0c8(_0x44de3c['error']['message']);}logger[_0x3c9f('0x20')]('ChatQueue,\x20%s,\x20%s',_0x39f6b6,_0x44de3c[_0x3c9f('0x20')][_0x3c9f('0x22')]);return _0x28f1cc(_0x44de3c[_0x3c9f('0x20')][_0x3c9f('0x22')]);}else{logger[_0x3c9f('0x23')](_0x3c9f('0x1e'),_0x39f6b6,_0x3c9f('0x1f'));_0x28f1cc(_0x44de3c[_0x3c9f('0x24')][_0x3c9f('0x22')]);}})[_0x3c9f('0x25')](function(_0x17f1b8){logger[_0x3c9f('0x20')](_0x3c9f('0x1e'),_0x39f6b6,_0x17f1b8);_0x17e0c8(_0x17f1b8);});});}function respondWithStatusCode(_0x18b556,_0x246420){_0x246420=_0x246420||0xcc;return function(_0x2a0982){if(_0x2a0982){return _0x18b556[_0x3c9f('0x26')](_0x246420);}return _0x18b556[_0x3c9f('0x27')](_0x246420)['end']();};}function respondWithResult(_0x3d6aba,_0x3ce0c9){_0x3ce0c9=_0x3ce0c9||0xc8;return function(_0x4b856e){if(_0x4b856e){return _0x3d6aba[_0x3c9f('0x27')](_0x3ce0c9)[_0x3c9f('0x28')](_0x4b856e);}};}function respondWithFilteredResult(_0x4a855e,_0x108f22){return function(_0x12ba6c){if(_0x12ba6c){var _0x47bf76=typeof _0x108f22['offset']===_0x3c9f('0x29')&&typeof _0x108f22[_0x3c9f('0x2a')]==='undefined';var _0x5352c1=_0x12ba6c[_0x3c9f('0x2b')];var _0x1ce147=_0x47bf76?0x0:_0x108f22[_0x3c9f('0x2c')];var _0x4b8902=_0x47bf76?_0x12ba6c['count']:_0x108f22[_0x3c9f('0x2c')]+_0x108f22[_0x3c9f('0x2a')];var _0x321465;if(_0x4b8902>=_0x5352c1){_0x4b8902=_0x5352c1;_0x321465=0xc8;}else{_0x321465=0xce;}_0x4a855e['status'](_0x321465);return _0x4a855e['set'](_0x3c9f('0x2d'),_0x1ce147+'-'+_0x4b8902+'/'+_0x5352c1)[_0x3c9f('0x28')](_0x12ba6c);}return null;};}function patchUpdates(_0x42b1be){return function(_0xfa5621){try{jsonpatch['apply'](_0xfa5621,_0x42b1be,!![]);}catch(_0x494d9b){return BPromise[_0x3c9f('0x2e')](_0x494d9b);}return _0xfa5621[_0x3c9f('0x2f')]();};}function saveUpdates(_0x88e9d8,_0x1837e7){return function(_0x59f93f){if(_0x59f93f){return _0x59f93f[_0x3c9f('0x30')](_0x88e9d8)[_0x3c9f('0x1d')](function(_0x36cbcc){return _0x36cbcc;});}return null;};}function removeEntity(_0x27b72c,_0x223cad){return function(_0x442d03){if(_0x442d03){return _0x442d03[_0x3c9f('0x31')]()[_0x3c9f('0x1d')](function(){var _0x386f2d=_0x442d03[_0x3c9f('0x32')]({'plain':!![]});var _0x5e67ef=_0x3c9f('0x33');return db[_0x3c9f('0x34')]['destroy']({'where':{'type':_0x5e67ef,'resourceId':_0x386f2d['id']}})[_0x3c9f('0x1d')](function(){return _0x442d03;});})[_0x3c9f('0x1d')](function(){_0x27b72c[_0x3c9f('0x27')](0xcc)[_0x3c9f('0x35')]();});}};}function handleEntityNotFound(_0x5c870b,_0x481b0c){return function(_0x53a27a){if(!_0x53a27a){_0x5c870b[_0x3c9f('0x26')](0x194);}return _0x53a27a;};}function handleError(_0x407d70,_0x1160d0){_0x1160d0=_0x1160d0||0x1f4;return function(_0x405401){logger[_0x3c9f('0x20')](_0x405401[_0x3c9f('0x36')]);if(_0x405401[_0x3c9f('0x37')]){delete _0x405401['name'];}_0x407d70[_0x3c9f('0x27')](_0x1160d0)[_0x3c9f('0x38')](_0x405401);};}exports[_0x3c9f('0x39')]=function(_0x31d1ff,_0xae639f){var _0x103759={},_0x215caa={},_0x5c0fc1={'count':0x0,'rows':[]};var _0x3c7bb5=_['map'](db[_0x3c9f('0x3a')][_0x3c9f('0x3b')],function(_0x1b033e){return{'name':_0x1b033e[_0x3c9f('0x3c')],'type':_0x1b033e[_0x3c9f('0x3d')]['key']};});_0x215caa['model']=_[_0x3c9f('0x3e')](_0x3c7bb5,'name');_0x215caa[_0x3c9f('0x3f')]=_['keys'](_0x31d1ff[_0x3c9f('0x3f')]);_0x215caa[_0x3c9f('0x40')]=_[_0x3c9f('0x41')](_0x215caa['model'],_0x215caa[_0x3c9f('0x3f')]);_0x103759['attributes']=_['intersection'](_0x215caa[_0x3c9f('0x42')],qs['fields'](_0x31d1ff['query'][_0x3c9f('0x43')]));_0x103759[_0x3c9f('0x44')]=_0x103759['attributes'][_0x3c9f('0x45')]?_0x103759[_0x3c9f('0x44')]:_0x215caa[_0x3c9f('0x42')];if(!_0x31d1ff[_0x3c9f('0x3f')]['hasOwnProperty'](_0x3c9f('0x46'))){_0x103759[_0x3c9f('0x2a')]=qs[_0x3c9f('0x2a')](_0x31d1ff[_0x3c9f('0x3f')]['limit']);_0x103759[_0x3c9f('0x2c')]=qs[_0x3c9f('0x2c')](_0x31d1ff['query'][_0x3c9f('0x2c')]);}_0x103759[_0x3c9f('0x47')]=qs[_0x3c9f('0x48')](_0x31d1ff[_0x3c9f('0x3f')][_0x3c9f('0x48')]);_0x103759[_0x3c9f('0x49')]=qs[_0x3c9f('0x40')](_[_0x3c9f('0x4a')](_0x31d1ff[_0x3c9f('0x3f')],_0x215caa[_0x3c9f('0x40')]),_0x3c7bb5);if(_0x31d1ff['query']['filter']){_0x103759[_0x3c9f('0x49')]=_[_0x3c9f('0x4b')](_0x103759[_0x3c9f('0x49')],{'$or':_['map'](_0x3c7bb5,function(_0x4b3c8e){if(_0x4b3c8e[_0x3c9f('0x3d')]!==_0x3c9f('0x4c')){var _0x391aaf={};_0x391aaf[_0x4b3c8e[_0x3c9f('0x37')]]={'$like':'%'+_0x31d1ff['query'][_0x3c9f('0x4d')]+'%'};return _0x391aaf;}})});}_0x103759=_[_0x3c9f('0x4b')]({},_0x103759,_0x31d1ff[_0x3c9f('0x4e')]);var _0x9ef9bb={'where':_0x103759[_0x3c9f('0x49')]};return db[_0x3c9f('0x3a')][_0x3c9f('0x2b')](_0x9ef9bb)[_0x3c9f('0x1d')](function(_0x597b56){_0x5c0fc1[_0x3c9f('0x2b')]=_0x597b56;if(_0x31d1ff[_0x3c9f('0x3f')][_0x3c9f('0x4f')]){_0x103759[_0x3c9f('0x50')]=[{'all':!![]}];}return db[_0x3c9f('0x3a')][_0x3c9f('0x51')](_0x103759);})['then'](function(_0x1f2091){_0x5c0fc1['rows']=_0x1f2091;return _0x5c0fc1;})[_0x3c9f('0x1d')](respondWithFilteredResult(_0xae639f,_0x103759))[_0x3c9f('0x25')](handleError(_0xae639f,null));};exports[_0x3c9f('0x52')]=function(_0x1efc68,_0x1eb8e2){var _0xf8c421={'raw':!![],'where':{'id':_0x1efc68[_0x3c9f('0x53')]['id']}},_0x37a96f={};_0x37a96f[_0x3c9f('0x42')]=_[_0x3c9f('0x54')](db['ChatQueue']['rawAttributes']);_0x37a96f[_0x3c9f('0x3f')]=_[_0x3c9f('0x54')](_0x1efc68[_0x3c9f('0x3f')]);_0x37a96f[_0x3c9f('0x40')]=_[_0x3c9f('0x41')](_0x37a96f[_0x3c9f('0x42')],_0x37a96f[_0x3c9f('0x3f')]);_0xf8c421[_0x3c9f('0x44')]=_[_0x3c9f('0x41')](_0x37a96f[_0x3c9f('0x42')],qs[_0x3c9f('0x43')](_0x1efc68['query']['fields']));_0xf8c421[_0x3c9f('0x44')]=_0xf8c421['attributes'][_0x3c9f('0x45')]?_0xf8c421[_0x3c9f('0x44')]:_0x37a96f['model'];if(_0x1efc68['query'][_0x3c9f('0x4f')]){_0xf8c421[_0x3c9f('0x50')]=[{'all':!![]}];}_0xf8c421=_[_0x3c9f('0x4b')]({},_0xf8c421,_0x1efc68[_0x3c9f('0x4e')]);return db[_0x3c9f('0x3a')][_0x3c9f('0x55')](_0xf8c421)[_0x3c9f('0x1d')](handleEntityNotFound(_0x1eb8e2,null))[_0x3c9f('0x1d')](respondWithResult(_0x1eb8e2,null))['catch'](handleError(_0x1eb8e2,null));};exports[_0x3c9f('0x56')]=function(_0x41918,_0x219c26){return db[_0x3c9f('0x3a')][_0x3c9f('0x56')](_0x41918[_0x3c9f('0x57')],{})[_0x3c9f('0x1d')](function(_0x4c8ddc){var _0x41adae=_0x41918[_0x3c9f('0x58')][_0x3c9f('0x32')]({'plain':!![]});if(!_0x41adae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41adae['role']===_0x3c9f('0x58')){var _0x5c2604=_0x4c8ddc[_0x3c9f('0x32')]({'plain':!![]});var _0x590977=_0x3c9f('0x33');return db[_0x3c9f('0x59')]['find']({'where':{'name':_0x590977,'userProfileId':_0x41adae[_0x3c9f('0x5a')]},'raw':!![]})[_0x3c9f('0x1d')](function(_0x68eb0c){if(_0x68eb0c&&_0x68eb0c[_0x3c9f('0x5b')]===0x0){return db[_0x3c9f('0x34')][_0x3c9f('0x56')]({'name':_0x5c2604['name'],'resourceId':_0x5c2604['id'],'type':_0x68eb0c[_0x3c9f('0x37')],'sectionId':_0x68eb0c['id']},{})['then'](function(){return _0x4c8ddc;});}else{return _0x4c8ddc;}})[_0x3c9f('0x25')](function(_0x1b3038){logger[_0x3c9f('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b3038);throw _0x1b3038;});}return _0x4c8ddc;})[_0x3c9f('0x1d')](respondWithResult(_0x219c26,0xc9))[_0x3c9f('0x25')](handleError(_0x219c26,null));};exports[_0x3c9f('0x30')]=function(_0x50f09e,_0x201345){if(_0x50f09e[_0x3c9f('0x57')]['id']){delete _0x50f09e['body']['id'];}return db[_0x3c9f('0x3a')][_0x3c9f('0x55')]({'where':{'id':_0x50f09e[_0x3c9f('0x53')]['id']}})[_0x3c9f('0x1d')](handleEntityNotFound(_0x201345,null))['then'](saveUpdates(_0x50f09e['body'],null))[_0x3c9f('0x1d')](respondWithResult(_0x201345,null))[_0x3c9f('0x25')](handleError(_0x201345,null));};exports[_0x3c9f('0x31')]=function(_0x4588e4,_0x39dfe1){return db[_0x3c9f('0x3a')][_0x3c9f('0x55')]({'where':{'id':_0x4588e4['params']['id']}})[_0x3c9f('0x1d')](handleEntityNotFound(_0x39dfe1,null))[_0x3c9f('0x1d')](removeEntity(_0x39dfe1,null))[_0x3c9f('0x25')](handleError(_0x39dfe1,null));};exports['describe']=function(_0x47225b,_0x21f79c){return db[_0x3c9f('0x3a')]['describe']()[_0x3c9f('0x1d')](respondWithResult(_0x21f79c,null))['catch'](handleError(_0x21f79c,null));};exports[_0x3c9f('0x5c')]=function(_0x5ef576,_0x3960aa,_0x329509){var _0x582c38={'raw':!![],'where':{}},_0x28a87f={},_0x21827e;return db[_0x3c9f('0x3a')][_0x3c9f('0x5d')]({'where':{'id':_0x5ef576[_0x3c9f('0x53')]['id']}})[_0x3c9f('0x1d')](handleEntityNotFound(_0x3960aa,null))['then'](function(_0x4b5ff0){if(_0x4b5ff0){_0x21827e=_0x4b5ff0['get']({'plain':!![]});_0x28a87f[_0x3c9f('0x42')]=_[_0x3c9f('0x54')](db[_0x3c9f('0x5e')][_0x3c9f('0x3b')]);_0x28a87f[_0x3c9f('0x3f')]=_[_0x3c9f('0x54')](_0x5ef576[_0x3c9f('0x3f')]);_0x28a87f['filters']=_[_0x3c9f('0x41')](_0x28a87f[_0x3c9f('0x42')],_0x28a87f[_0x3c9f('0x3f')]);_0x582c38[_0x3c9f('0x44')]=_[_0x3c9f('0x41')](_0x28a87f[_0x3c9f('0x42')],qs[_0x3c9f('0x43')](_0x5ef576['query'][_0x3c9f('0x43')]));_0x582c38['attributes']=_0x582c38[_0x3c9f('0x44')][_0x3c9f('0x45')]?_0x582c38[_0x3c9f('0x44')]:_0x28a87f[_0x3c9f('0x42')];if(!_0x5ef576[_0x3c9f('0x3f')][_0x3c9f('0x5f')]('nolimit')){_0x582c38[_0x3c9f('0x2a')]=qs[_0x3c9f('0x2a')](_0x5ef576[_0x3c9f('0x3f')]['limit']);_0x582c38[_0x3c9f('0x2c')]=qs[_0x3c9f('0x2c')](_0x5ef576[_0x3c9f('0x3f')][_0x3c9f('0x2c')]);}_0x582c38[_0x3c9f('0x47')]=qs[_0x3c9f('0x48')](_0x5ef576[_0x3c9f('0x3f')][_0x3c9f('0x48')]);_0x582c38['where']=qs[_0x3c9f('0x40')](_[_0x3c9f('0x4a')](_0x5ef576['query'],_0x28a87f[_0x3c9f('0x40')]));_0x582c38[_0x3c9f('0x49')][_0x3c9f('0x60')]=_0x4b5ff0['id'];if(_0x5ef576[_0x3c9f('0x3f')][_0x3c9f('0x4d')]){_0x582c38[_0x3c9f('0x49')]=_['merge'](_0x582c38[_0x3c9f('0x49')],{'$or':_['map'](_0x582c38[_0x3c9f('0x44')],function(_0x3a6dd7){var _0x3cf780={};_0x3cf780[_0x3a6dd7]={'$like':'%'+_0x5ef576[_0x3c9f('0x3f')]['filter']+'%'};return _0x3cf780;})});}_0x582c38=_[_0x3c9f('0x4b')]({},_0x582c38,_0x5ef576[_0x3c9f('0x4e')]);return db[_0x3c9f('0x5e')][_0x3c9f('0x51')](_0x582c38);}})[_0x3c9f('0x1d')](function(_0xfdd54c){if(_0xfdd54c){return db[_0x3c9f('0x61')][_0x3c9f('0x62')]({'where':{'id':_[_0x3c9f('0x3e')](_0xfdd54c,_0x3c9f('0x63')),'role':_0x3c9f('0x64')},'attributes':['id','name',_0x3c9f('0x65'),_0x3c9f('0x66'),_0x3c9f('0x67')]});}})[_0x3c9f('0x1d')](function(_0x577942){if(_0x577942){return{'count':_0x577942[_0x3c9f('0x2b')],'rows':_[_0x3c9f('0x3e')](_0x577942['rows'],function(_0x2903cd){return{'membername':_0x2903cd[_0x3c9f('0x37')],'UserId':_0x2903cd['id'],'queue_name':_0x21827e['name'],'ChatQueueId':_0x21827e['id'],'interface':util[_0x3c9f('0x68')](_0x3c9f('0x69'),_0x3c9f('0x6a'),_0x2903cd[_0x3c9f('0x37')]),'penalty':0x0,'paused':_0x2903cd['chatPause'],'createdAt':_0x2903cd[_0x3c9f('0x67')],'updatedAt':_0x2903cd['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x3c9f('0x1d')](respondWithFilteredResult(_0x3960aa,_0x582c38))[_0x3c9f('0x25')](handleError(_0x3960aa,null));};exports['getTeams']=function(_0x2124ed,_0x5dce3a,_0x44e233){var _0x341e0a={};var _0xe9cb96={};var _0x1451c6;var _0x30840b;return db[_0x3c9f('0x3a')]['findOne']({'where':{'id':_0x2124ed['params']['id']}})[_0x3c9f('0x1d')](handleEntityNotFound(_0x5dce3a,null))[_0x3c9f('0x1d')](function(_0x149259){if(_0x149259){_0x1451c6=_0x149259;_0xe9cb96[_0x3c9f('0x42')]=_[_0x3c9f('0x54')](db[_0x3c9f('0x6b')]['rawAttributes']);_0xe9cb96['query']=_['keys'](_0x2124ed[_0x3c9f('0x3f')]);_0xe9cb96[_0x3c9f('0x40')]=_['intersection'](_0xe9cb96[_0x3c9f('0x42')],_0xe9cb96[_0x3c9f('0x3f')]);_0x341e0a[_0x3c9f('0x44')]=_['intersection'](_0xe9cb96['model'],qs[_0x3c9f('0x43')](_0x2124ed[_0x3c9f('0x3f')]['fields']));_0x341e0a[_0x3c9f('0x44')]=_0x341e0a[_0x3c9f('0x44')][_0x3c9f('0x45')]?_0x341e0a[_0x3c9f('0x44')]:_0xe9cb96[_0x3c9f('0x42')];_0x341e0a[_0x3c9f('0x47')]=qs[_0x3c9f('0x48')](_0x2124ed['query']['sort']);_0x341e0a[_0x3c9f('0x49')]=qs[_0x3c9f('0x40')](_[_0x3c9f('0x4a')](_0x2124ed[_0x3c9f('0x3f')],_0xe9cb96['filters']));if(_0x2124ed['query'][_0x3c9f('0x4d')]){_0x341e0a['where']=_['merge'](_0x341e0a[_0x3c9f('0x49')],{'$or':_[_0x3c9f('0x3e')](_0x341e0a[_0x3c9f('0x44')],function(_0x16372d){var _0xe22b4={};_0xe22b4[_0x16372d]={'$like':'%'+_0x2124ed[_0x3c9f('0x3f')][_0x3c9f('0x4d')]+'%'};return _0xe22b4;})});}_0x341e0a=_[_0x3c9f('0x4b')]({},_0x341e0a,_0x2124ed[_0x3c9f('0x4e')]);return _0x1451c6[_0x3c9f('0x6c')](_0x341e0a);}})[_0x3c9f('0x1d')](function(_0x31333e){if(_0x31333e){_0x30840b=_0x31333e[_0x3c9f('0x45')];if(!_0x2124ed['query'][_0x3c9f('0x5f')]('nolimit')){_0x341e0a[_0x3c9f('0x2a')]=qs['limit'](_0x2124ed['query'][_0x3c9f('0x2a')]);_0x341e0a[_0x3c9f('0x2c')]=qs['offset'](_0x2124ed[_0x3c9f('0x3f')][_0x3c9f('0x2c')]);}return _0x1451c6['getTeams'](_0x341e0a);}})[_0x3c9f('0x1d')](function(_0x1fa163){if(_0x1fa163){return _0x1fa163?{'count':_0x30840b,'rows':_0x1fa163}:null;}})[_0x3c9f('0x1d')](respondWithResult(_0x5dce3a,null))[_0x3c9f('0x25')](handleError(_0x5dce3a,null));};exports['addTeams']=function(_0x467d41,_0x4d1a1c,_0x4c3f66){var _0x3389f4=_0x467d41[_0x3c9f('0x57')][_0x3c9f('0x6d')];return db[_0x3c9f('0x6b')][_0x3c9f('0x51')]({'where':{'id':_0x3389f4},'attributes':['id'],'include':[{'model':db[_0x3c9f('0x61')],'as':_0x3c9f('0x6e'),'attributes':['id',_0x3c9f('0x37'),'online',_0x3c9f('0x6f'),'interface'],'raw':!![]}]})[_0x3c9f('0x1d')](function(_0x13a1b9){if(_0x13a1b9){var _0x5d5371=_[_0x3c9f('0x70')](_0x13a1b9,function(_0x2c2d7e){var _0x5d756b=_0x2c2d7e[_0x3c9f('0x32')]({'plain':!![]});return _0x5d756b[_0x3c9f('0x6e')];});return db[_0x3c9f('0x3a')][_0x3c9f('0x55')]({'where':{'id':_0x467d41[_0x3c9f('0x53')]['id']}})[_0x3c9f('0x1d')](function(_0x47b96e){return db[_0x3c9f('0x71')][_0x3c9f('0x72')](function(_0x3a2d53){return _0x47b96e[_0x3c9f('0x73')](_0x3389f4,{'transaction':_0x3a2d53})[_0x3c9f('0x1d')](function(){return BPromise[_0x3c9f('0x74')](_0x5d5371,function(_0x16fb75){return db[_0x3c9f('0x5e')]['findOrCreate']({'where':{'UserId':_0x16fb75['id'],'ChatQueueId':_0x467d41['params']['id']},'transaction':_0x3a2d53});});})[_0x3c9f('0x1d')](function(){_0x5d5371[_0x3c9f('0x75')](function(_0xebbd4d){socket[_0x3c9f('0x76')]('userChatQueue:save',{'UserId':_0xebbd4d['id'],'ChatQueueId':_0x47b96e['id']});});});});});}})['then'](respondWithStatusCode(_0x4d1a1c,null))[_0x3c9f('0x25')](handleError(_0x4d1a1c,null));};exports[_0x3c9f('0x77')]=function(_0x567388,_0x4bd5ae,_0x5f42aa){return db['Team'][_0x3c9f('0x51')]({'where':{'id':_0x567388[_0x3c9f('0x3f')][_0x3c9f('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x3c9f('0x61')],'as':_0x3c9f('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x3c9f('0x1d')](handleEntityNotFound(_0x4bd5ae,null))['then'](function(_0x7ab62b){var _0x226fed=_[_0x3c9f('0x3e')](_0x7ab62b,'id');var _0x3611f7=[];var _0x14c8dd=[];var _0x298673=squel[_0x3c9f('0x78')]();_0x298673[_0x3c9f('0x79')](_0x3c9f('0x7a'))[_0x3c9f('0x7b')](_0x3c9f('0x7c'),'tq')[_0x3c9f('0x7d')](_0x3c9f('0x7e'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3c9f('0x49')](_0x3c9f('0x7f'),_0x567388[_0x3c9f('0x53')]['id']);for(var _0x2ddb3d=0x0;_0x2ddb3d<_0x7ab62b[_0x3c9f('0x45')];_0x2ddb3d+=0x1){let _0x1b739a=_0x7ab62b[_0x2ddb3d];for(var _0x12a73a=0x0;_0x12a73a<_0x1b739a[_0x3c9f('0x6e')][_0x3c9f('0x45')];_0x12a73a+=0x1){let _0x8c0d90=_0x1b739a['Agents'][_0x12a73a];var _0x49a10d=_0x298673[_0x3c9f('0x80')]();_0x49a10d[_0x3c9f('0x49')]('ut.UserId\x20=\x20?',_0x8c0d90['id']);_0x14c8dd[_0x3c9f('0x81')](db[_0x3c9f('0x71')][_0x3c9f('0x3f')](_0x49a10d[_0x3c9f('0x82')](),{'type':db[_0x3c9f('0x71')][_0x3c9f('0x83')][_0x3c9f('0x84')]})['then'](function(_0x32ff6e){if(_0x32ff6e[_0x3c9f('0x45')]===0x1){return _0x8c0d90['id'];}else{var _0x3535de=_['every'](_['map'](_0x32ff6e,_0x3c9f('0x85')),function(_0x575c8e){return _[_0x3c9f('0x86')](_0x226fed,_0x575c8e);});if(_0x3535de){return _0x8c0d90['id'];}}}));}}return BPromise[_0x3c9f('0x87')](_0x14c8dd)[_0x3c9f('0x1d')](function(_0x30bb93){_0x3611f7=_(_0x3611f7)[_0x3c9f('0x88')](_0x30bb93)[_0x3c9f('0x89')]()[_0x3c9f('0x8a')]();return db[_0x3c9f('0x3a')][_0x3c9f('0x55')]({'where':{'id':_0x567388[_0x3c9f('0x53')]['id']}})[_0x3c9f('0x1d')](function(_0x448451){return db[_0x3c9f('0x71')]['transaction'](function(_0x29b059){return _0x448451[_0x3c9f('0x77')](_0x567388[_0x3c9f('0x3f')][_0x3c9f('0x6d')],{'transaction':_0x29b059})[_0x3c9f('0x1d')](function(){if(!_[_0x3c9f('0x8b')](_0x3611f7)){return _0x448451[_0x3c9f('0x8c')](_0x3611f7,{'transaction':_0x29b059});}})['then'](function(){_0x3611f7['forEach'](function(_0x567c62){socket['emit'](_0x3c9f('0x8d'),{'UserId':_0x567c62,'ChatQueueId':_0x448451['id']});});});});});});})['then'](respondWithStatusCode(_0x4bd5ae,null))[_0x3c9f('0x25')](handleError(_0x4bd5ae,null));};exports[_0x3c9f('0x8e')]=function(_0x394448,_0x3e23a2,_0x57bd0b){return db[_0x3c9f('0x3a')][_0x3c9f('0x55')]({'where':{'id':_0x394448['params']['id']}})[_0x3c9f('0x1d')](handleEntityNotFound(_0x3e23a2,null))[_0x3c9f('0x1d')](function(_0x50944a){if(_0x50944a){return _0x50944a[_0x3c9f('0x8e')](_0x394448['body'][_0x3c9f('0x6d')],_['omit'](_0x394448[_0x3c9f('0x57')],['ids','id'])||{})['spread'](function(_0x5e6780){for(var _0x57453a=0x0;_0x57453a<_0x394448[_0x3c9f('0x57')][_0x3c9f('0x6d')][_0x3c9f('0x45')];_0x57453a+=0x1){socket[_0x3c9f('0x76')](_0x3c9f('0x8f'),{'UserId':Number(_0x394448[_0x3c9f('0x57')][_0x3c9f('0x6d')][_0x57453a]),'ChatQueueId':Number(_0x394448[_0x3c9f('0x53')]['id'])});}return _0x5e6780;});}})['then'](respondWithResult(_0x3e23a2,null))[_0x3c9f('0x25')](handleError(_0x3e23a2,null));};exports[_0x3c9f('0x8c')]=function(_0x13702d,_0x36265f,_0x38ed89){return db[_0x3c9f('0x3a')][_0x3c9f('0x55')]({'where':{'id':_0x13702d['params']['id']}})[_0x3c9f('0x1d')](handleEntityNotFound(_0x36265f,null))[_0x3c9f('0x1d')](function(_0x1135e9){if(_0x1135e9){return _0x1135e9[_0x3c9f('0x8c')](_0x13702d[_0x3c9f('0x3f')][_0x3c9f('0x6d')])[_0x3c9f('0x1d')](function(){if(_[_0x3c9f('0x90')](_0x13702d['query'][_0x3c9f('0x6d')])){for(var _0xec3480=0x0;_0xec3480<_0x13702d[_0x3c9f('0x3f')]['ids'][_0x3c9f('0x45')];_0xec3480+=0x1){socket[_0x3c9f('0x76')](_0x3c9f('0x8d'),{'UserId':Number(_0x13702d['query'][_0x3c9f('0x6d')][_0xec3480]),'ChatQueueId':Number(_0x13702d[_0x3c9f('0x53')]['id'])});}}else{socket[_0x3c9f('0x76')]('userChatQueue:remove',{'UserId':Number(_0x13702d[_0x3c9f('0x3f')]['ids']),'ChatQueueId':Number(_0x13702d[_0x3c9f('0x53')]['id'])});}});}})[_0x3c9f('0x1d')](respondWithStatusCode(_0x36265f,null))[_0x3c9f('0x25')](handleError(_0x36265f,null));};exports[_0x3c9f('0x91')]=function(_0x4bb12e,_0x312197,_0x1c01ec){var _0x54a22e={};var _0x216a8b={};var _0x333447;var _0x3a934c;return db['ChatQueue'][_0x3c9f('0x5d')]({'where':{'id':_0x4bb12e[_0x3c9f('0x53')]['id']}})[_0x3c9f('0x1d')](handleEntityNotFound(_0x312197,null))[_0x3c9f('0x1d')](function(_0x542390){if(_0x542390){_0x333447=_0x542390;_0x216a8b[_0x3c9f('0x42')]=_[_0x3c9f('0x54')](db['User'][_0x3c9f('0x3b')]);_0x216a8b[_0x3c9f('0x3f')]=_[_0x3c9f('0x54')](_0x4bb12e[_0x3c9f('0x3f')]);_0x216a8b[_0x3c9f('0x40')]=_['intersection'](_0x216a8b['model'],_0x216a8b[_0x3c9f('0x3f')]);_0x54a22e[_0x3c9f('0x44')]=_['intersection'](_0x216a8b[_0x3c9f('0x42')],qs[_0x3c9f('0x43')](_0x4bb12e['query'][_0x3c9f('0x43')]));_0x54a22e[_0x3c9f('0x44')]=_0x54a22e[_0x3c9f('0x44')][_0x3c9f('0x45')]?_0x54a22e[_0x3c9f('0x44')]:_0x216a8b[_0x3c9f('0x42')];_0x54a22e[_0x3c9f('0x47')]=qs[_0x3c9f('0x48')](_0x4bb12e[_0x3c9f('0x3f')][_0x3c9f('0x48')]);_0x54a22e[_0x3c9f('0x49')]=qs[_0x3c9f('0x40')](_[_0x3c9f('0x4a')](_0x4bb12e[_0x3c9f('0x3f')],_0x216a8b[_0x3c9f('0x40')]));if(_0x4bb12e[_0x3c9f('0x3f')][_0x3c9f('0x4d')]){_0x54a22e[_0x3c9f('0x49')]=_['merge'](_0x54a22e[_0x3c9f('0x49')],{'$or':_[_0x3c9f('0x3e')](_0x54a22e['attributes'],function(_0xfa853b){var _0x20df35={};_0x20df35[_0xfa853b]={'$like':'%'+_0x4bb12e[_0x3c9f('0x3f')][_0x3c9f('0x4d')]+'%'};return _0x20df35;})});}_0x54a22e=_['merge']({},_0x54a22e,_0x4bb12e[_0x3c9f('0x4e')]);return _0x333447[_0x3c9f('0x91')](_0x54a22e);}})[_0x3c9f('0x1d')](function(_0x4e3e20){if(_0x4e3e20){_0x3a934c=_0x4e3e20['length'];if(!_0x4bb12e[_0x3c9f('0x3f')][_0x3c9f('0x5f')]('nolimit')){_0x54a22e[_0x3c9f('0x2a')]=qs[_0x3c9f('0x2a')](_0x4bb12e[_0x3c9f('0x3f')][_0x3c9f('0x2a')]);_0x54a22e[_0x3c9f('0x2c')]=qs['offset'](_0x4bb12e[_0x3c9f('0x3f')]['offset']);}return _0x333447[_0x3c9f('0x91')](_0x54a22e);}})[_0x3c9f('0x1d')](function(_0x4b7475){if(_0x4b7475){return _0x4b7475?{'count':_0x3a934c,'rows':_0x4b7475}:null;}})[_0x3c9f('0x1d')](respondWithResult(_0x312197,null))[_0x3c9f('0x25')](handleError(_0x312197,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 309cfc3..a11b009 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 _0x8734=['update','emit','events','ChatQueue','setMaxListeners','save'];(function(_0x2a7ed0,_0x23e60f){var _0x56c2cb=function(_0x429885){while(--_0x429885){_0x2a7ed0['push'](_0x2a7ed0['shift']());}};_0x56c2cb(++_0x23e60f);}(_0x8734,0x134));var _0x4873=function(_0xd6df5e,_0x4a4e46){_0xd6df5e=_0xd6df5e-0x0;var _0x155b12=_0x8734[_0xd6df5e];return _0x155b12;};'use strict';var EventEmitter=require(_0x4873('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x4873('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4873('0x2')](0x0);var events={'afterCreate':_0x4873('0x3'),'afterUpdate':_0x4873('0x4'),'afterDestroy':'remove'};function emitEvent(_0x35bd54){return function(_0x5bcb32,_0x1ae455,_0x2528ff){ChatQueueEvents['emit'](_0x35bd54+':'+_0x5bcb32['id'],_0x5bcb32);ChatQueueEvents[_0x4873('0x5')](_0x35bd54,_0x5bcb32);_0x2528ff(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x5395=['events','ChatQueue','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3ce0f3,_0x3974c7){var _0x23e65e=function(_0x2238b4){while(--_0x2238b4){_0x3ce0f3['push'](_0x3ce0f3['shift']());}};_0x23e65e(++_0x3974c7);}(_0x5395,0x150));var _0x5539=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x5395[_0x46e363];return _0x3fb059;};'use strict';var EventEmitter=require(_0x5539('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x5539('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5539('0x2'),'afterDestroy':_0x5539('0x3')};function emitEvent(_0x2d24c7){return function(_0x4cd571,_0x2b6f8b,_0x453ad5){ChatQueueEvents[_0x5539('0x4')](_0x2d24c7+':'+_0x4cd571['id'],_0x4cd571);ChatQueueEvents[_0x5539('0x4')](_0x2d24c7,_0x4cd571);_0x453ad5(null);};}for(var e in events){if(events[_0x5539('0x5')](e)){var event=events[e];ChatQueue[_0x5539('0x6')](e,emitEvent(event));}}module[_0x5539('0x7')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index a03d4e1..3af8996 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 _0x70a0=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','util','../../config/logger','api'];(function(_0x5cc231,_0x40002f){var _0x1f48c2=function(_0x32a83f){while(--_0x32a83f){_0x5cc231['push'](_0x5cc231['shift']());}};_0x1f48c2(++_0x40002f);}(_0x70a0,0x1d6));var _0x070a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x70a0[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x070a('0x0'));var logger=require(_0x070a('0x1'))(_0x070a('0x2'));var moment=require(_0x070a('0x3'));var BPromise=require(_0x070a('0x4'));var rp=require(_0x070a('0x5'));var fs=require('fs');var path=require(_0x070a('0x6'));var rimraf=require(_0x070a('0x7'));var config=require(_0x070a('0x8'));var attributes=require(_0x070a('0x9'));module[_0x070a('0xa')]=function(_0x1ebed0,_0x112fe0){return _0x1ebed0['define']('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x35ba=['ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x4d3475,_0x1cea7d){var _0xb8eab=function(_0x2fc76c){while(--_0x2fc76c){_0x4d3475['push'](_0x4d3475['shift']());}};_0xb8eab(++_0x1cea7d);}(_0x35ba,0x1c9));var _0xa35b=function(_0x3126b6,_0x450061){_0x3126b6=_0x3126b6-0x0;var _0x116531=_0x35ba[_0x3126b6];return _0x116531;};'use strict';var _=require(_0xa35b('0x0'));var util=require(_0xa35b('0x1'));var logger=require(_0xa35b('0x2'))(_0xa35b('0x3'));var moment=require(_0xa35b('0x4'));var BPromise=require('bluebird');var rp=require(_0xa35b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa35b('0x6'));var config=require(_0xa35b('0x7'));var attributes=require(_0xa35b('0x8'));module[_0xa35b('0x9')]=function(_0x16584e,_0x3ce36b){return _0x16584e[_0xa35b('0xa')](_0xa35b('0xb'),attributes,{'tableName':_0xa35b('0xc'),'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 3225ae9..1d6d548 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 _0x0664=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatQueue.socket','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit','include','map','model','ShowChatQueue','find','then','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x252699,_0x134b4e){var _0x56d0c6=function(_0x5551a8){while(--_0x5551a8){_0x252699['push'](_0x252699['shift']());}};_0x56d0c6(++_0x134b4e);}(_0x0664,0x93));var _0x4066=function(_0x3790c1,_0x596e3a){_0x3790c1=_0x3790c1-0x0;var _0x334c6d=_0x0664[_0x3790c1];return _0x334c6d;};'use strict';var _=require('lodash');var util=require(_0x4066('0x0'));var moment=require('moment');var BPromise=require(_0x4066('0x1'));var rs=require(_0x4066('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4066('0x3'))['db'];var utils=require(_0x4066('0x4'));var logger=require(_0x4066('0x5'))(_0x4066('0x6'));var config=require(_0x4066('0x7'));var jayson=require(_0x4066('0x8'));var client=jayson[_0x4066('0x9')][_0x4066('0xa')]({'port':0x232a});config[_0x4066('0xb')]=_[_0x4066('0xc')](config['redis'],{'host':_0x4066('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4066('0xb')]));require(_0x4066('0xe'))['register'](socket);function respondWithRpcPromise(_0x5f3d44,_0x1da4d8,_0x3ea971){return new BPromise(function(_0x16a1f7,_0x41ad8b){return client['request'](_0x5f3d44,_0x3ea971)['then'](function(_0x52d31c){logger['info'](_0x4066('0xf'),_0x1da4d8,_0x4066('0x10'));logger[_0x4066('0x11')](_0x4066('0x12'),_0x1da4d8,_0x4066('0x10'),JSON[_0x4066('0x13')](_0x52d31c));if(_0x52d31c[_0x4066('0x14')]){if(_0x52d31c[_0x4066('0x14')]['code']===0x1f4){logger[_0x4066('0x14')](_0x4066('0xf'),_0x1da4d8,_0x52d31c['error'][_0x4066('0x15')]);return _0x41ad8b(_0x52d31c['error'][_0x4066('0x15')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x1da4d8,_0x52d31c[_0x4066('0x14')][_0x4066('0x15')]);return _0x16a1f7(_0x52d31c[_0x4066('0x14')][_0x4066('0x15')]);}else{logger[_0x4066('0x16')](_0x4066('0xf'),_0x1da4d8,_0x4066('0x10'));_0x16a1f7(_0x52d31c[_0x4066('0x17')][_0x4066('0x15')]);}})[_0x4066('0x18')](function(_0x511cfa){logger['error'](_0x4066('0xf'),_0x1da4d8,_0x511cfa);_0x41ad8b(_0x511cfa);});});}exports[_0x4066('0x19')]=function(_0x5b02a4){var _0x414e6c=this;return new Promise(function(_0x215d68,_0x382950){return db[_0x4066('0x1a')][_0x4066('0x1b')]({'raw':_0x5b02a4[_0x4066('0x1c')]?_0x5b02a4['options']['raw']===undefined?!![]:![]:!![],'where':_0x5b02a4['options']?_0x5b02a4['options'][_0x4066('0x1d')]||null:null,'attributes':_0x5b02a4[_0x4066('0x1c')]?_0x5b02a4[_0x4066('0x1c')][_0x4066('0x1e')]||null:null,'limit':_0x5b02a4[_0x4066('0x1c')]?_0x5b02a4['options'][_0x4066('0x1f')]||null:null,'include':_0x5b02a4[_0x4066('0x1c')]?_0x5b02a4[_0x4066('0x1c')][_0x4066('0x20')]?_[_0x4066('0x21')](_0x5b02a4['options']['include'],function(_0x2984ef){return{'model':db[_0x2984ef[_0x4066('0x22')]],'as':_0x2984ef['as'],'attributes':_0x2984ef[_0x4066('0x1e')],'include':_0x2984ef[_0x4066('0x20')]?_[_0x4066('0x21')](_0x2984ef[_0x4066('0x20')],function(_0x1f9e34){return{'model':db[_0x1f9e34[_0x4066('0x22')]],'as':_0x1f9e34['as'],'attributes':_0x1f9e34[_0x4066('0x1e')],'include':_0x1f9e34[_0x4066('0x20')]?_[_0x4066('0x21')](_0x1f9e34[_0x4066('0x20')],function(_0x540a9){return{'model':db[_0x540a9[_0x4066('0x22')]],'as':_0x540a9['as'],'attributes':_0x540a9[_0x4066('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x80e095){logger['info']('GetChatQueue',_0x5b02a4);logger['debug'](_0x4066('0x19'),_0x5b02a4,JSON['stringify'](_0x80e095));_0x215d68(_0x80e095);})[_0x4066('0x18')](function(_0x2a39e7){logger[_0x4066('0x14')]('GetChatQueue',_0x2a39e7[_0x4066('0x15')],_0x5b02a4);_0x382950(_0x414e6c['error'](0x1f4,_0x2a39e7[_0x4066('0x15')]));});});};exports[_0x4066('0x23')]=function(_0x5eaaca){var _0x4924cf=this;return new Promise(function(_0x3363e8,_0x10dbde){return db['ChatQueue'][_0x4066('0x24')]({'raw':_0x5eaaca[_0x4066('0x1c')]?_0x5eaaca[_0x4066('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5eaaca[_0x4066('0x1c')]?_0x5eaaca['options'][_0x4066('0x1d')]||null:null,'attributes':_0x5eaaca[_0x4066('0x1c')]?_0x5eaaca[_0x4066('0x1c')][_0x4066('0x1e')]||null:null,'include':_0x5eaaca[_0x4066('0x1c')]?_0x5eaaca[_0x4066('0x1c')][_0x4066('0x20')]?_[_0x4066('0x21')](_0x5eaaca[_0x4066('0x1c')][_0x4066('0x20')],function(_0x219010){return{'model':db[_0x219010[_0x4066('0x22')]],'as':_0x219010['as'],'attributes':_0x219010['attributes'],'include':_0x219010[_0x4066('0x20')]?_[_0x4066('0x21')](_0x219010['include'],function(_0x1e1134){return{'model':db[_0x1e1134[_0x4066('0x22')]],'as':_0x1e1134['as'],'attributes':_0x1e1134['attributes'],'include':_0x1e1134[_0x4066('0x20')]?_[_0x4066('0x21')](_0x1e1134[_0x4066('0x20')],function(_0x470fa6){return{'model':db[_0x470fa6[_0x4066('0x22')]],'as':_0x470fa6['as'],'attributes':_0x470fa6[_0x4066('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4066('0x25')](function(_0x178ca2){logger[_0x4066('0x16')]('ShowChatQueue',_0x5eaaca);logger[_0x4066('0x11')](_0x4066('0x23'),_0x5eaaca,JSON['stringify'](_0x178ca2));_0x3363e8(_0x178ca2);})[_0x4066('0x18')](function(_0x3c0e01){logger[_0x4066('0x14')]('ShowChatQueue',_0x3c0e01[_0x4066('0x15')],_0x5eaaca);_0x10dbde(_0x4924cf[_0x4066('0x14')](0x1f4,_0x3c0e01[_0x4066('0x15')]));});});};
\ No newline at end of file
+var _0xa149=['model','then','stringify','ShowChatQueue','find','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','request\x20sent','debug','error','ChatQueue,\x20%s,\x20%s','message','info','result','GetChatQueue','findAll','options','raw','where','attributes','include','map'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xa149,0x18c));var _0x9a14=function(_0x5da35a,_0x1e2cdf){_0x5da35a=_0x5da35a-0x0;var _0x4ec963=_0xa149[_0x5da35a];return _0x4ec963;};'use strict';var _=require(_0x9a14('0x0'));var util=require(_0x9a14('0x1'));var moment=require(_0x9a14('0x2'));var BPromise=require(_0x9a14('0x3'));var rs=require(_0x9a14('0x4'));var fs=require('fs');var Redis=require(_0x9a14('0x5'));var db=require(_0x9a14('0x6'))['db'];var utils=require(_0x9a14('0x7'));var logger=require(_0x9a14('0x8'))('rpc');var config=require(_0x9a14('0x9'));var jayson=require(_0x9a14('0xa'));var client=jayson['client'][_0x9a14('0xb')]({'port':0x232a});config[_0x9a14('0xc')]=_[_0x9a14('0xd')](config[_0x9a14('0xc')],{'host':_0x9a14('0xe'),'port':0x18eb});var socket=require(_0x9a14('0xf'))(new Redis(config['redis']));require(_0x9a14('0x10'))['register'](socket);function respondWithRpcPromise(_0x3d0481,_0x25afa7,_0x36c9ed){return new BPromise(function(_0x33bb89,_0x4155e5){return client[_0x9a14('0x11')](_0x3d0481,_0x36c9ed)['then'](function(_0x5d4ed8){logger['info']('ChatQueue,\x20%s,\x20%s',_0x25afa7,_0x9a14('0x12'));logger[_0x9a14('0x13')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x25afa7,_0x9a14('0x12'),JSON['stringify'](_0x5d4ed8));if(_0x5d4ed8[_0x9a14('0x14')]){if(_0x5d4ed8['error']['code']===0x1f4){logger[_0x9a14('0x14')](_0x9a14('0x15'),_0x25afa7,_0x5d4ed8[_0x9a14('0x14')][_0x9a14('0x16')]);return _0x4155e5(_0x5d4ed8['error'][_0x9a14('0x16')]);}logger[_0x9a14('0x14')](_0x9a14('0x15'),_0x25afa7,_0x5d4ed8[_0x9a14('0x14')][_0x9a14('0x16')]);return _0x33bb89(_0x5d4ed8[_0x9a14('0x14')][_0x9a14('0x16')]);}else{logger[_0x9a14('0x17')](_0x9a14('0x15'),_0x25afa7,_0x9a14('0x12'));_0x33bb89(_0x5d4ed8[_0x9a14('0x18')]['message']);}})['catch'](function(_0x589822){logger[_0x9a14('0x14')]('ChatQueue,\x20%s,\x20%s',_0x25afa7,_0x589822);_0x4155e5(_0x589822);});});}exports[_0x9a14('0x19')]=function(_0x40ac4c){var _0x4e0c5f=this;return new Promise(function(_0x5bb00c,_0x53e151){return db['ChatQueue'][_0x9a14('0x1a')]({'raw':_0x40ac4c[_0x9a14('0x1b')]?_0x40ac4c[_0x9a14('0x1b')][_0x9a14('0x1c')]===undefined?!![]:![]:!![],'where':_0x40ac4c[_0x9a14('0x1b')]?_0x40ac4c[_0x9a14('0x1b')][_0x9a14('0x1d')]||null:null,'attributes':_0x40ac4c['options']?_0x40ac4c['options'][_0x9a14('0x1e')]||null:null,'limit':_0x40ac4c[_0x9a14('0x1b')]?_0x40ac4c[_0x9a14('0x1b')]['limit']||null:null,'include':_0x40ac4c[_0x9a14('0x1b')]?_0x40ac4c[_0x9a14('0x1b')][_0x9a14('0x1f')]?_[_0x9a14('0x20')](_0x40ac4c[_0x9a14('0x1b')][_0x9a14('0x1f')],function(_0x1ba34f){return{'model':db[_0x1ba34f[_0x9a14('0x21')]],'as':_0x1ba34f['as'],'attributes':_0x1ba34f['attributes'],'include':_0x1ba34f['include']?_[_0x9a14('0x20')](_0x1ba34f[_0x9a14('0x1f')],function(_0x3e20b5){return{'model':db[_0x3e20b5['model']],'as':_0x3e20b5['as'],'attributes':_0x3e20b5['attributes'],'include':_0x3e20b5[_0x9a14('0x1f')]?_[_0x9a14('0x20')](_0x3e20b5[_0x9a14('0x1f')],function(_0x44a589){return{'model':db[_0x44a589[_0x9a14('0x21')]],'as':_0x44a589['as'],'attributes':_0x44a589['attributes']};}):[]};}):[]};}):[]:[]})[_0x9a14('0x22')](function(_0x4e171b){logger['info'](_0x9a14('0x19'),_0x40ac4c);logger[_0x9a14('0x13')]('GetChatQueue',_0x40ac4c,JSON[_0x9a14('0x23')](_0x4e171b));_0x5bb00c(_0x4e171b);})['catch'](function(_0x3930af){logger[_0x9a14('0x14')](_0x9a14('0x19'),_0x3930af[_0x9a14('0x16')],_0x40ac4c);_0x53e151(_0x4e0c5f[_0x9a14('0x14')](0x1f4,_0x3930af[_0x9a14('0x16')]));});});};exports[_0x9a14('0x24')]=function(_0x1d7a59){var _0x303758=this;return new Promise(function(_0x51dc13,_0x485251){return db['ChatQueue'][_0x9a14('0x25')]({'raw':_0x1d7a59[_0x9a14('0x1b')]?_0x1d7a59[_0x9a14('0x1b')][_0x9a14('0x1c')]===undefined?!![]:![]:!![],'where':_0x1d7a59[_0x9a14('0x1b')]?_0x1d7a59[_0x9a14('0x1b')][_0x9a14('0x1d')]||null:null,'attributes':_0x1d7a59['options']?_0x1d7a59[_0x9a14('0x1b')][_0x9a14('0x1e')]||null:null,'include':_0x1d7a59[_0x9a14('0x1b')]?_0x1d7a59[_0x9a14('0x1b')][_0x9a14('0x1f')]?_['map'](_0x1d7a59[_0x9a14('0x1b')][_0x9a14('0x1f')],function(_0x4eb8a0){return{'model':db[_0x4eb8a0[_0x9a14('0x21')]],'as':_0x4eb8a0['as'],'attributes':_0x4eb8a0['attributes'],'include':_0x4eb8a0[_0x9a14('0x1f')]?_[_0x9a14('0x20')](_0x4eb8a0[_0x9a14('0x1f')],function(_0x2901c1){return{'model':db[_0x2901c1[_0x9a14('0x21')]],'as':_0x2901c1['as'],'attributes':_0x2901c1[_0x9a14('0x1e')],'include':_0x2901c1[_0x9a14('0x1f')]?_[_0x9a14('0x20')](_0x2901c1[_0x9a14('0x1f')],function(_0x527c5c){return{'model':db[_0x527c5c['model']],'as':_0x527c5c['as'],'attributes':_0x527c5c[_0x9a14('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9a14('0x22')](function(_0x4c611a){logger[_0x9a14('0x17')](_0x9a14('0x24'),_0x1d7a59);logger['debug'](_0x9a14('0x24'),_0x1d7a59,JSON['stringify'](_0x4c611a));_0x51dc13(_0x4c611a);})[_0x9a14('0x26')](function(_0x1b3ff6){logger['error'](_0x9a14('0x24'),_0x1b3ff6[_0x9a14('0x16')],_0x1d7a59);_0x485251(_0x303758[_0x9a14('0x14')](0x1f4,_0x1b3ff6[_0x9a14('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 0ae441c..29e7396 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 _0x7bae=['remove','update','emit','removeListener','register','length','chatQueue:'];(function(_0x3765ff,_0x16916e){var _0x333f28=function(_0x208816){while(--_0x208816){_0x3765ff['push'](_0x3765ff['shift']());}};_0x333f28(++_0x16916e);}(_0x7bae,0x13b));var _0xe7ba=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x7bae[_0xa8883];return _0x479426;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xe7ba('0x0'),_0xe7ba('0x1')];function createListener(_0x503803,_0x3963c7){return function(_0x4f2e91){_0x3963c7[_0xe7ba('0x2')](_0x503803,_0x4f2e91);};}function removeListener(_0x10908b,_0x166acb){return function(){ChatQueueEvents[_0xe7ba('0x3')](_0x10908b,_0x166acb);};}exports[_0xe7ba('0x4')]=function(_0xfd3a22){for(var _0x2d31df=0x0,_0x3c5e59=events[_0xe7ba('0x5')];_0x2d31df<_0x3c5e59;_0x2d31df++){var _0x34fb18=events[_0x2d31df];var _0x160565=createListener(_0xe7ba('0x6')+_0x34fb18,_0xfd3a22);ChatQueueEvents['on'](_0x34fb18,_0x160565);}};
\ No newline at end of file
+var _0xd0bb=['chatQueue:','./chatQueue.events','save','remove','emit','register','length'];(function(_0x17b239,_0x50aa45){var _0x57eee2=function(_0x155fd4){while(--_0x155fd4){_0x17b239['push'](_0x17b239['shift']());}};_0x57eee2(++_0x50aa45);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0xb4411,_0x5d04ac){_0xb4411=_0xb4411-0x0;var _0x481db4=_0xd0bb[_0xb4411];return _0x481db4;};'use strict';var ChatQueueEvents=require(_0xbd0b('0x0'));var events=[_0xbd0b('0x1'),_0xbd0b('0x2'),'update'];function createListener(_0x68ea36,_0x4ab08f){return function(_0x39b03a){_0x4ab08f[_0xbd0b('0x3')](_0x68ea36,_0x39b03a);};}function removeListener(_0x53e6ce,_0x432acf){return function(){ChatQueueEvents['removeListener'](_0x53e6ce,_0x432acf);};}exports[_0xbd0b('0x4')]=function(_0x1b2499){for(var _0x158b5c=0x0,_0x37c205=events[_0xbd0b('0x5')];_0x158b5c<_0x37c205;_0x158b5c++){var _0x5eb975=events[_0x158b5c];var _0x2a4075=createListener(_0xbd0b('0x6')+_0x5eb975,_0x1b2499);ChatQueueEvents['on'](_0x5eb975,_0x2a4075);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 41e8611..82371d9 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(_0xdb627f,_0x364a0c){var _0x2233a8=function(_0xfac23e){while(--_0xfac23e){_0xdb627f['push'](_0xdb627f['shift']());}};_0x2233a8(++_0x364a0c);}(_0x55ca,0x126));var _0xa55c=function(_0x465533,_0x56ab66){_0x465533=_0x465533-0x0;var _0x49489b=_0x55ca[_0x465533];return _0x49489b;};'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(_0x1b9f3b,_0x416c12){var _0x5c73b9=function(_0x591ea4){while(--_0x591ea4){_0x1b9f3b['push'](_0x1b9f3b['shift']());}};_0x5c73b9(++_0x416c12);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 890e57f..d0fd80b 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 _0xb6be=['STRING','DATE','moment','sequelize'];(function(_0x562785,_0x9bb9c4){var _0x303a17=function(_0x225660){while(--_0x225660){_0x562785['push'](_0x562785['shift']());}};_0x303a17(++_0x9bb9c4);}(_0xb6be,0x132));var _0xeb6b=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xb6be[_0x1ae5ab];return _0x1ce001;};'use strict';var moment=require(_0xeb6b('0x0'));var Sequelize=require(_0xeb6b('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xeb6b('0x2')]},'joinAt':{'type':Sequelize[_0xeb6b('0x3')]},'leaveAt':{'type':Sequelize[_0xeb6b('0x3')]},'acceptAt':{'type':Sequelize[_0xeb6b('0x3')]},'exitAt':{'type':Sequelize[_0xeb6b('0x3')]},'reason':{'type':Sequelize[_0xeb6b('0x2')]}};
\ No newline at end of file
+var _0x94b9=['DATE','moment','exports','STRING'];(function(_0x25d18c,_0xab06b9){var _0x471e3e=function(_0xaf7502){while(--_0xaf7502){_0x25d18c['push'](_0x25d18c['shift']());}};_0x471e3e(++_0xab06b9);}(_0x94b9,0x1ad));var _0x994b=function(_0x20cdc3,_0x4055a7){_0x20cdc3=_0x20cdc3-0x0;var _0x47d456=_0x94b9[_0x20cdc3];return _0x47d456;};'use strict';var moment=require(_0x994b('0x0'));var Sequelize=require('sequelize');module[_0x994b('0x1')]={'uniqueid':{'type':Sequelize[_0x994b('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x994b('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x994b('0x3')]},'acceptAt':{'type':Sequelize[_0x994b('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x994b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 38e699d..8302824 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 _0x6f44=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','map','ChatQueueReport','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','VIRTUAL','where','count','includeAll','include','rows','catch','params','keys','rawAttributes','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x34ea04,_0x165a66){var _0x2b6576=function(_0x23de38){while(--_0x23de38){_0x34ea04['push'](_0x34ea04['shift']());}};_0x2b6576(++_0x165a66);}(_0x6f44,0x1ea));var _0x46f4=function(_0x176095,_0x5ccb73){_0x176095=_0x176095-0x0;var _0x2f80a4=_0x6f44[_0x176095];return _0x2f80a4;};'use strict';var emlformat=require(_0x46f4('0x0'));var rimraf=require(_0x46f4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46f4('0x2'));var rp=require(_0x46f4('0x3'));var moment=require(_0x46f4('0x4'));var BPromise=require(_0x46f4('0x5'));var Mustache=require(_0x46f4('0x6'));var util=require(_0x46f4('0x7'));var path=require(_0x46f4('0x8'));var sox=require(_0x46f4('0x9'));var csv=require(_0x46f4('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x46f4('0xb'));var _=require(_0x46f4('0xc'));var squel=require(_0x46f4('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x46f4('0xe'));var toCsv=require(_0x46f4('0xa'));var querystring=require('querystring');var Papa=require(_0x46f4('0xf'));var Redis=require('ioredis');var authService=require(_0x46f4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x46f4('0x11'));var hardwareService=require(_0x46f4('0x12'));var logger=require(_0x46f4('0x13'))(_0x46f4('0x14'));var utils=require(_0x46f4('0x15'));var config=require(_0x46f4('0x16'));var licenseUtil=require(_0x46f4('0x17'));var db=require(_0x46f4('0x18'))['db'];function respondWithStatusCode(_0x21d4a6,_0x1f4748){_0x1f4748=_0x1f4748||0xcc;return function(_0x1dd233){if(_0x1dd233){return _0x21d4a6[_0x46f4('0x19')](_0x1f4748);}return _0x21d4a6['status'](_0x1f4748)[_0x46f4('0x1a')]();};}function respondWithResult(_0x33f73c,_0x52db86){_0x52db86=_0x52db86||0xc8;return function(_0x44a55b){if(_0x44a55b){return _0x33f73c[_0x46f4('0x1b')](_0x52db86)[_0x46f4('0x1c')](_0x44a55b);}};}function respondWithFilteredResult(_0x4dd2fb,_0x3dc516){return function(_0x4e0661){if(_0x4e0661){var _0x4e84ce=typeof _0x3dc516[_0x46f4('0x1d')]===_0x46f4('0x1e')&&typeof _0x3dc516[_0x46f4('0x1f')]==='undefined';var _0x5c191a=_0x4e0661['count'];var _0x5d3471=_0x4e84ce?0x0:_0x3dc516[_0x46f4('0x1d')];var _0x433297=_0x4e84ce?_0x4e0661['count']:_0x3dc516[_0x46f4('0x1d')]+_0x3dc516[_0x46f4('0x1f')];var _0x2232d6;if(_0x433297>=_0x5c191a){_0x433297=_0x5c191a;_0x2232d6=0xc8;}else{_0x2232d6=0xce;}_0x4dd2fb[_0x46f4('0x1b')](_0x2232d6);return _0x4dd2fb['set'](_0x46f4('0x20'),_0x5d3471+'-'+_0x433297+'/'+_0x5c191a)[_0x46f4('0x1c')](_0x4e0661);}return null;};}function patchUpdates(_0x1627db){return function(_0x6476f0){try{jsonpatch[_0x46f4('0x21')](_0x6476f0,_0x1627db,!![]);}catch(_0xdb9f25){return BPromise['reject'](_0xdb9f25);}return _0x6476f0[_0x46f4('0x22')]();};}function saveUpdates(_0x2b88d3,_0x39760b){return function(_0x4ba21a){if(_0x4ba21a){return _0x4ba21a[_0x46f4('0x23')](_0x2b88d3)[_0x46f4('0x24')](function(_0x185ec2){return _0x185ec2;});}return null;};}function removeEntity(_0x47528b,_0x36092e){return function(_0x41be5e){if(_0x41be5e){return _0x41be5e[_0x46f4('0x25')]()[_0x46f4('0x24')](function(){_0x47528b[_0x46f4('0x1b')](0xcc)[_0x46f4('0x1a')]();});}};}function handleEntityNotFound(_0x2ad553,_0x16cd7f){return function(_0x197e55){if(!_0x197e55){_0x2ad553['sendStatus'](0x194);}return _0x197e55;};}function handleError(_0x46e96d,_0x30d4fc){_0x30d4fc=_0x30d4fc||0x1f4;return function(_0xb23194){logger[_0x46f4('0x26')](_0xb23194[_0x46f4('0x27')]);if(_0xb23194[_0x46f4('0x28')]){delete _0xb23194['name'];}_0x46e96d[_0x46f4('0x1b')](_0x30d4fc)['send'](_0xb23194);};}exports['index']=function(_0x53ac21,_0x2cf22c){var _0x57ff78={},_0x1fb343={},_0x183f0c={'count':0x0,'rows':[]};var _0x3c8c91=_[_0x46f4('0x29')](db[_0x46f4('0x2a')]['rawAttributes'],function(_0x1d512b){return{'name':_0x1d512b[_0x46f4('0x2b')],'type':_0x1d512b[_0x46f4('0x2c')]['key']};});_0x1fb343[_0x46f4('0x2d')]=_[_0x46f4('0x29')](_0x3c8c91,_0x46f4('0x28'));_0x1fb343['query']=_['keys'](_0x53ac21[_0x46f4('0x2e')]);_0x1fb343[_0x46f4('0x2f')]=_[_0x46f4('0x30')](_0x1fb343['model'],_0x1fb343[_0x46f4('0x2e')]);_0x57ff78[_0x46f4('0x31')]=_['intersection'](_0x1fb343[_0x46f4('0x2d')],qs['fields'](_0x53ac21[_0x46f4('0x2e')][_0x46f4('0x32')]));_0x57ff78[_0x46f4('0x31')]=_0x57ff78[_0x46f4('0x31')][_0x46f4('0x33')]?_0x57ff78['attributes']:_0x1fb343[_0x46f4('0x2d')];if(!_0x53ac21[_0x46f4('0x2e')]['hasOwnProperty'](_0x46f4('0x34'))){_0x57ff78[_0x46f4('0x1f')]=qs[_0x46f4('0x1f')](_0x53ac21[_0x46f4('0x2e')]['limit']);_0x57ff78[_0x46f4('0x1d')]=qs['offset'](_0x53ac21[_0x46f4('0x2e')][_0x46f4('0x1d')]);}_0x57ff78[_0x46f4('0x35')]=qs[_0x46f4('0x36')](_0x53ac21['query'][_0x46f4('0x36')]);_0x57ff78['where']=qs['filters'](_[_0x46f4('0x37')](_0x53ac21['query'],_0x1fb343['filters']),_0x3c8c91);if(_0x53ac21[_0x46f4('0x2e')][_0x46f4('0x38')]){_0x57ff78['where']=_[_0x46f4('0x39')](_0x57ff78['where'],{'$or':_[_0x46f4('0x29')](_0x3c8c91,function(_0x190c1a){if(_0x190c1a[_0x46f4('0x2c')]!==_0x46f4('0x3a')){var _0x5c6662={};_0x5c6662[_0x190c1a[_0x46f4('0x28')]]={'$like':'%'+_0x53ac21[_0x46f4('0x2e')][_0x46f4('0x38')]+'%'};return _0x5c6662;}})});}_0x57ff78=_['merge']({},_0x57ff78,_0x53ac21['options']);var _0x4a44a6={'where':_0x57ff78[_0x46f4('0x3b')]};return db[_0x46f4('0x2a')][_0x46f4('0x3c')](_0x4a44a6)[_0x46f4('0x24')](function(_0x57bfd2){_0x183f0c[_0x46f4('0x3c')]=_0x57bfd2;if(_0x53ac21[_0x46f4('0x2e')][_0x46f4('0x3d')]){_0x57ff78[_0x46f4('0x3e')]=[{'all':!![]}];}return db[_0x46f4('0x2a')]['findAll'](_0x57ff78);})[_0x46f4('0x24')](function(_0x306400){_0x183f0c[_0x46f4('0x3f')]=_0x306400;return _0x183f0c;})[_0x46f4('0x24')](respondWithFilteredResult(_0x2cf22c,_0x57ff78))[_0x46f4('0x40')](handleError(_0x2cf22c,null));};exports['show']=function(_0x549af3,_0x4e11cb){var _0x21ce83={'raw':!![],'where':{'id':_0x549af3[_0x46f4('0x41')]['id']}},_0x1c0513={};_0x1c0513['model']=_[_0x46f4('0x42')](db[_0x46f4('0x2a')][_0x46f4('0x43')]);_0x1c0513[_0x46f4('0x2e')]=_[_0x46f4('0x42')](_0x549af3[_0x46f4('0x2e')]);_0x1c0513[_0x46f4('0x2f')]=_[_0x46f4('0x30')](_0x1c0513[_0x46f4('0x2d')],_0x1c0513[_0x46f4('0x2e')]);_0x21ce83[_0x46f4('0x31')]=_[_0x46f4('0x30')](_0x1c0513[_0x46f4('0x2d')],qs['fields'](_0x549af3[_0x46f4('0x2e')][_0x46f4('0x32')]));_0x21ce83[_0x46f4('0x31')]=_0x21ce83[_0x46f4('0x31')][_0x46f4('0x33')]?_0x21ce83[_0x46f4('0x31')]:_0x1c0513['model'];if(_0x549af3['query']['includeAll']){_0x21ce83[_0x46f4('0x3e')]=[{'all':!![]}];}_0x21ce83=_[_0x46f4('0x39')]({},_0x21ce83,_0x549af3[_0x46f4('0x44')]);return db[_0x46f4('0x2a')][_0x46f4('0x45')](_0x21ce83)[_0x46f4('0x24')](handleEntityNotFound(_0x4e11cb,null))[_0x46f4('0x24')](respondWithResult(_0x4e11cb,null))[_0x46f4('0x40')](handleError(_0x4e11cb,null));};exports[_0x46f4('0x46')]=function(_0xf73c15,_0x21319d){return db[_0x46f4('0x2a')]['create'](_0xf73c15[_0x46f4('0x47')],{})[_0x46f4('0x24')](respondWithResult(_0x21319d,0xc9))[_0x46f4('0x40')](handleError(_0x21319d,null));};exports['update']=function(_0x5a6d1f,_0x1fedc8){if(_0x5a6d1f[_0x46f4('0x47')]['id']){delete _0x5a6d1f[_0x46f4('0x47')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x5a6d1f[_0x46f4('0x41')]['id']}})[_0x46f4('0x24')](handleEntityNotFound(_0x1fedc8,null))[_0x46f4('0x24')](saveUpdates(_0x5a6d1f[_0x46f4('0x47')],null))[_0x46f4('0x24')](respondWithResult(_0x1fedc8,null))[_0x46f4('0x40')](handleError(_0x1fedc8,null));};exports['destroy']=function(_0x18f0e0,_0x2bbb25){return db[_0x46f4('0x2a')]['find']({'where':{'id':_0x18f0e0[_0x46f4('0x41')]['id']}})[_0x46f4('0x24')](handleEntityNotFound(_0x2bbb25,null))[_0x46f4('0x24')](removeEntity(_0x2bbb25,null))[_0x46f4('0x40')](handleError(_0x2bbb25,null));};exports['describe']=function(_0x26f39a,_0x478dd7){return db[_0x46f4('0x2a')][_0x46f4('0x48')]()[_0x46f4('0x24')](respondWithResult(_0x478dd7,null))['catch'](handleError(_0x478dd7,null));};
\ No newline at end of file
+var _0xfc9b=['undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x2ade6c,_0x2d42f2){var _0x2cb372=function(_0x477d8a){while(--_0x477d8a){_0x2ade6c['push'](_0x2ade6c['shift']());}};_0x2cb372(++_0x2d42f2);}(_0xfc9b,0x74));var _0xbfc9=function(_0x34e160,_0x387076){_0x34e160=_0x34e160-0x0;var _0x2eb767=_0xfc9b[_0x34e160];return _0x2eb767;};'use strict';var emlformat=require(_0xbfc9('0x0'));var rimraf=require(_0xbfc9('0x1'));var zipdir=require(_0xbfc9('0x2'));var jsonpatch=require(_0xbfc9('0x3'));var rp=require(_0xbfc9('0x4'));var moment=require(_0xbfc9('0x5'));var BPromise=require(_0xbfc9('0x6'));var Mustache=require('mustache');var util=require(_0xbfc9('0x7'));var path=require('path');var sox=require(_0xbfc9('0x8'));var csv=require(_0xbfc9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbfc9('0xa'));var _=require(_0xbfc9('0xb'));var squel=require(_0xbfc9('0xc'));var crypto=require(_0xbfc9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbfc9('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbfc9('0xf'));var Papa=require('papaparse');var Redis=require(_0xbfc9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbfc9('0x11'));var as=require(_0xbfc9('0x12'));var hardwareService=require(_0xbfc9('0x13'));var logger=require(_0xbfc9('0x14'))(_0xbfc9('0x15'));var utils=require(_0xbfc9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbfc9('0x17'));var db=require(_0xbfc9('0x18'))['db'];function respondWithStatusCode(_0x57f46c,_0x364b14){_0x364b14=_0x364b14||0xcc;return function(_0x51783e){if(_0x51783e){return _0x57f46c[_0xbfc9('0x19')](_0x364b14);}return _0x57f46c[_0xbfc9('0x1a')](_0x364b14)[_0xbfc9('0x1b')]();};}function respondWithResult(_0x2a5c78,_0x59b8b8){_0x59b8b8=_0x59b8b8||0xc8;return function(_0x3fbad7){if(_0x3fbad7){return _0x2a5c78[_0xbfc9('0x1a')](_0x59b8b8)[_0xbfc9('0x1c')](_0x3fbad7);}};}function respondWithFilteredResult(_0x30c34e,_0x44d984){return function(_0x16a0fc){if(_0x16a0fc){var _0x2bc807=typeof _0x44d984[_0xbfc9('0x1d')]===_0xbfc9('0x1e')&&typeof _0x44d984[_0xbfc9('0x1f')]===_0xbfc9('0x1e');var _0x1b6218=_0x16a0fc[_0xbfc9('0x20')];var _0x21e216=_0x2bc807?0x0:_0x44d984[_0xbfc9('0x1d')];var _0x345e7a=_0x2bc807?_0x16a0fc[_0xbfc9('0x20')]:_0x44d984[_0xbfc9('0x1d')]+_0x44d984[_0xbfc9('0x1f')];var _0x130eba;if(_0x345e7a>=_0x1b6218){_0x345e7a=_0x1b6218;_0x130eba=0xc8;}else{_0x130eba=0xce;}_0x30c34e[_0xbfc9('0x1a')](_0x130eba);return _0x30c34e[_0xbfc9('0x21')]('Content-Range',_0x21e216+'-'+_0x345e7a+'/'+_0x1b6218)[_0xbfc9('0x1c')](_0x16a0fc);}return null;};}function patchUpdates(_0x1217f4){return function(_0x237897){try{jsonpatch[_0xbfc9('0x22')](_0x237897,_0x1217f4,!![]);}catch(_0x2df6b9){return BPromise[_0xbfc9('0x23')](_0x2df6b9);}return _0x237897[_0xbfc9('0x24')]();};}function saveUpdates(_0x3f1603,_0x2e6e5b){return function(_0x3f6c00){if(_0x3f6c00){return _0x3f6c00[_0xbfc9('0x25')](_0x3f1603)[_0xbfc9('0x26')](function(_0x39bc58){return _0x39bc58;});}return null;};}function removeEntity(_0x7012e0,_0x5a3420){return function(_0x1f365f){if(_0x1f365f){return _0x1f365f[_0xbfc9('0x27')]()[_0xbfc9('0x26')](function(){_0x7012e0[_0xbfc9('0x1a')](0xcc)[_0xbfc9('0x1b')]();});}};}function handleEntityNotFound(_0x4ab0ec,_0x4498ed){return function(_0xa64699){if(!_0xa64699){_0x4ab0ec[_0xbfc9('0x19')](0x194);}return _0xa64699;};}function handleError(_0x278d07,_0x1fb58c){_0x1fb58c=_0x1fb58c||0x1f4;return function(_0xfa504){logger[_0xbfc9('0x28')](_0xfa504[_0xbfc9('0x29')]);if(_0xfa504[_0xbfc9('0x2a')]){delete _0xfa504['name'];}_0x278d07['status'](_0x1fb58c)['send'](_0xfa504);};}exports[_0xbfc9('0x2b')]=function(_0x4dd2da,_0x58401b){var _0x123261={},_0x2aa754={},_0xfa1abc={'count':0x0,'rows':[]};var _0x14e1ac=_[_0xbfc9('0x2c')](db[_0xbfc9('0x2d')][_0xbfc9('0x2e')],function(_0x224645){return{'name':_0x224645[_0xbfc9('0x2f')],'type':_0x224645['type'][_0xbfc9('0x30')]};});_0x2aa754[_0xbfc9('0x31')]=_[_0xbfc9('0x2c')](_0x14e1ac,'name');_0x2aa754[_0xbfc9('0x32')]=_[_0xbfc9('0x33')](_0x4dd2da[_0xbfc9('0x32')]);_0x2aa754[_0xbfc9('0x34')]=_[_0xbfc9('0x35')](_0x2aa754[_0xbfc9('0x31')],_0x2aa754[_0xbfc9('0x32')]);_0x123261[_0xbfc9('0x36')]=_[_0xbfc9('0x35')](_0x2aa754[_0xbfc9('0x31')],qs['fields'](_0x4dd2da['query'][_0xbfc9('0x37')]));_0x123261[_0xbfc9('0x36')]=_0x123261[_0xbfc9('0x36')][_0xbfc9('0x38')]?_0x123261[_0xbfc9('0x36')]:_0x2aa754[_0xbfc9('0x31')];if(!_0x4dd2da['query'][_0xbfc9('0x39')]('nolimit')){_0x123261['limit']=qs[_0xbfc9('0x1f')](_0x4dd2da['query'][_0xbfc9('0x1f')]);_0x123261[_0xbfc9('0x1d')]=qs[_0xbfc9('0x1d')](_0x4dd2da['query'][_0xbfc9('0x1d')]);}_0x123261['order']=qs['sort'](_0x4dd2da[_0xbfc9('0x32')][_0xbfc9('0x3a')]);_0x123261['where']=qs[_0xbfc9('0x34')](_['pick'](_0x4dd2da['query'],_0x2aa754[_0xbfc9('0x34')]),_0x14e1ac);if(_0x4dd2da[_0xbfc9('0x32')][_0xbfc9('0x3b')]){_0x123261[_0xbfc9('0x3c')]=_[_0xbfc9('0x3d')](_0x123261[_0xbfc9('0x3c')],{'$or':_[_0xbfc9('0x2c')](_0x14e1ac,function(_0x32d787){if(_0x32d787['type']!==_0xbfc9('0x3e')){var _0x3756d9={};_0x3756d9[_0x32d787['name']]={'$like':'%'+_0x4dd2da['query'][_0xbfc9('0x3b')]+'%'};return _0x3756d9;}})});}_0x123261=_[_0xbfc9('0x3d')]({},_0x123261,_0x4dd2da['options']);var _0xbecdeb={'where':_0x123261[_0xbfc9('0x3c')]};return db[_0xbfc9('0x2d')][_0xbfc9('0x20')](_0xbecdeb)[_0xbfc9('0x26')](function(_0x3d473c){_0xfa1abc[_0xbfc9('0x20')]=_0x3d473c;if(_0x4dd2da[_0xbfc9('0x32')][_0xbfc9('0x3f')]){_0x123261[_0xbfc9('0x40')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xbfc9('0x41')](_0x123261);})['then'](function(_0x5c8479){_0xfa1abc[_0xbfc9('0x42')]=_0x5c8479;return _0xfa1abc;})[_0xbfc9('0x26')](respondWithFilteredResult(_0x58401b,_0x123261))['catch'](handleError(_0x58401b,null));};exports[_0xbfc9('0x43')]=function(_0x19a1c0,_0x557795){var _0x18b75d={'raw':!![],'where':{'id':_0x19a1c0[_0xbfc9('0x44')]['id']}},_0x36a0cc={};_0x36a0cc['model']=_['keys'](db[_0xbfc9('0x2d')][_0xbfc9('0x2e')]);_0x36a0cc['query']=_['keys'](_0x19a1c0['query']);_0x36a0cc['filters']=_[_0xbfc9('0x35')](_0x36a0cc[_0xbfc9('0x31')],_0x36a0cc['query']);_0x18b75d[_0xbfc9('0x36')]=_[_0xbfc9('0x35')](_0x36a0cc['model'],qs['fields'](_0x19a1c0['query'][_0xbfc9('0x37')]));_0x18b75d[_0xbfc9('0x36')]=_0x18b75d[_0xbfc9('0x36')][_0xbfc9('0x38')]?_0x18b75d[_0xbfc9('0x36')]:_0x36a0cc[_0xbfc9('0x31')];if(_0x19a1c0[_0xbfc9('0x32')][_0xbfc9('0x3f')]){_0x18b75d[_0xbfc9('0x40')]=[{'all':!![]}];}_0x18b75d=_[_0xbfc9('0x3d')]({},_0x18b75d,_0x19a1c0['options']);return db[_0xbfc9('0x2d')]['find'](_0x18b75d)[_0xbfc9('0x26')](handleEntityNotFound(_0x557795,null))[_0xbfc9('0x26')](respondWithResult(_0x557795,null))[_0xbfc9('0x45')](handleError(_0x557795,null));};exports['create']=function(_0x5e971d,_0x201281){return db[_0xbfc9('0x2d')][_0xbfc9('0x46')](_0x5e971d['body'],{})[_0xbfc9('0x26')](respondWithResult(_0x201281,0xc9))[_0xbfc9('0x45')](handleError(_0x201281,null));};exports['update']=function(_0x192d07,_0x307e72){if(_0x192d07['body']['id']){delete _0x192d07[_0xbfc9('0x47')]['id'];}return db[_0xbfc9('0x2d')]['find']({'where':{'id':_0x192d07[_0xbfc9('0x44')]['id']}})[_0xbfc9('0x26')](handleEntityNotFound(_0x307e72,null))['then'](saveUpdates(_0x192d07[_0xbfc9('0x47')],null))[_0xbfc9('0x26')](respondWithResult(_0x307e72,null))['catch'](handleError(_0x307e72,null));};exports['destroy']=function(_0x340520,_0x33a8d7){return db[_0xbfc9('0x2d')]['find']({'where':{'id':_0x340520[_0xbfc9('0x44')]['id']}})[_0xbfc9('0x26')](handleEntityNotFound(_0x33a8d7,null))[_0xbfc9('0x26')](removeEntity(_0x33a8d7,null))['catch'](handleError(_0x33a8d7,null));};exports[_0xbfc9('0x48')]=function(_0x3abd7d,_0x4f8ca9){return db[_0xbfc9('0x2d')][_0xbfc9('0x48')]()[_0xbfc9('0x26')](respondWithResult(_0x4f8ca9,null))[_0xbfc9('0x45')](handleError(_0x4f8ca9,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index ed0b803..f286551 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x497809,_0x451ba0){var _0x865565=function(_0x5428c1){while(--_0x5428c1){_0x497809['push'](_0x497809['shift']());}};_0x865565(++_0x451ba0);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xb7e7[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x4037cd,_0x1be60b){var _0x4dec28=function(_0x899142){while(--_0x899142){_0x4037cd['push'](_0x4037cd['shift']());}};_0x4dec28(++_0x1be60b);}(_0x757a,0xde));var _0xa757=function(_0x345ac6,_0x240795){_0x345ac6=_0x345ac6-0x0;var _0x585cd9=_0x757a[_0x345ac6];return _0x585cd9;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 6d2f27f..4fe73f1 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 _0x2408=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','CreateChatQueueReport','ChatQueueReport','options','UpdateChatQueueReport','update','raw','where','limit','then','lodash','util'];(function(_0x238d75,_0x7681cc){var _0x1244b7=function(_0x169db4){while(--_0x169db4){_0x238d75['push'](_0x238d75['shift']());}};_0x1244b7(++_0x7681cc);}(_0x2408,0x172));var _0x8240=function(_0x12dc5d,_0x262f06){_0x12dc5d=_0x12dc5d-0x0;var _0x3dc618=_0x2408[_0x12dc5d];return _0x3dc618;};'use strict';var _=require(_0x8240('0x0'));var util=require(_0x8240('0x1'));var moment=require('moment');var BPromise=require(_0x8240('0x2'));var rs=require(_0x8240('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8240('0x4'))['db'];var utils=require(_0x8240('0x5'));var logger=require('../../config/logger')(_0x8240('0x6'));var config=require(_0x8240('0x7'));var jayson=require(_0x8240('0x8'));var client=jayson[_0x8240('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d7377,_0x475136,_0x48831b){return new BPromise(function(_0x6922b2,_0x2cc931){return client[_0x8240('0xa')](_0x1d7377,_0x48831b)['then'](function(_0x232acc){logger['info'](_0x8240('0xb'),_0x475136,'request\x20sent');logger[_0x8240('0xc')](_0x8240('0xd'),_0x475136,'request\x20sent',JSON[_0x8240('0xe')](_0x232acc));if(_0x232acc[_0x8240('0xf')]){if(_0x232acc[_0x8240('0xf')][_0x8240('0x10')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x475136,_0x232acc[_0x8240('0xf')][_0x8240('0x11')]);return _0x2cc931(_0x232acc[_0x8240('0xf')][_0x8240('0x11')]);}logger[_0x8240('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x475136,_0x232acc[_0x8240('0xf')][_0x8240('0x11')]);return _0x6922b2(_0x232acc[_0x8240('0xf')][_0x8240('0x11')]);}else{logger[_0x8240('0x12')](_0x8240('0xb'),_0x475136,_0x8240('0x13'));_0x6922b2(_0x232acc[_0x8240('0x14')]['message']);}})[_0x8240('0x15')](function(_0x178683){logger[_0x8240('0xf')](_0x8240('0xb'),_0x475136,_0x178683);_0x2cc931(_0x178683);});});}exports[_0x8240('0x16')]=function(_0x19dde1){var _0xfa76f5=this;return new Promise(function(_0xda231c,_0x1162fa){return db[_0x8240('0x17')]['create'](_0x19dde1['body'],{'raw':_0x19dde1[_0x8240('0x18')]?_0x19dde1[_0x8240('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4c3910){logger[_0x8240('0x12')](_0x8240('0x16'),_0x19dde1);logger[_0x8240('0xc')]('CreateChatQueueReport',_0x19dde1,JSON[_0x8240('0xe')](_0x4c3910));_0xda231c(_0x4c3910);})['catch'](function(_0x2c27a9){logger[_0x8240('0xf')](_0x8240('0x16'),_0x2c27a9[_0x8240('0x11')],_0x19dde1);_0x1162fa(_0xfa76f5[_0x8240('0xf')](0x1f4,_0x2c27a9[_0x8240('0x11')]));});});};exports[_0x8240('0x19')]=function(_0x56ce24){var _0x4737e1=this;return new Promise(function(_0x541e44,_0x3c1f06){return db['ChatQueueReport'][_0x8240('0x1a')](_0x56ce24['body'],{'raw':_0x56ce24['options']?_0x56ce24['options'][_0x8240('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56ce24[_0x8240('0x18')]?_0x56ce24[_0x8240('0x18')][_0x8240('0x1c')]||null:null,'attributes':_0x56ce24[_0x8240('0x18')]?_0x56ce24[_0x8240('0x18')]['attributes']||null:null,'limit':_0x56ce24[_0x8240('0x18')]?_0x56ce24[_0x8240('0x18')][_0x8240('0x1d')]||null:null})[_0x8240('0x1e')](function(_0x1efefc){logger[_0x8240('0x12')](_0x8240('0x19'),_0x56ce24);logger['debug'](_0x8240('0x19'),_0x56ce24,JSON[_0x8240('0xe')](_0x1efefc));_0x541e44(_0x1efefc);})[_0x8240('0x15')](function(_0x3106c5){logger['error'](_0x8240('0x19'),_0x3106c5[_0x8240('0x11')],_0x56ce24);_0x3c1f06(_0x4737e1['error'](0x1f4,_0x3106c5[_0x8240('0x11')]));});});};
\ No newline at end of file
+var _0x6bcf=['code','message','result','CreateChatQueueReport','ChatQueueReport','options','raw','UpdateChatQueueReport','update','body','attributes','limit','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x43ffad,_0x6800b3){var _0x3c2a91=function(_0x406dac){while(--_0x406dac){_0x43ffad['push'](_0x43ffad['shift']());}};_0x3c2a91(++_0x6800b3);}(_0x6bcf,0x181));var _0xf6bc=function(_0x3cc8c0,_0x57150a){_0x3cc8c0=_0x3cc8c0-0x0;var _0x497477=_0x6bcf[_0x3cc8c0];return _0x497477;};'use strict';var _=require(_0xf6bc('0x0'));var util=require('util');var moment=require(_0xf6bc('0x1'));var BPromise=require(_0xf6bc('0x2'));var rs=require(_0xf6bc('0x3'));var fs=require('fs');var Redis=require(_0xf6bc('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf6bc('0x5'))(_0xf6bc('0x6'));var config=require(_0xf6bc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf6bc('0x8')][_0xf6bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c3f2f,_0x484663,_0x21a9e1){return new BPromise(function(_0x3dee61,_0xb51752){return client['request'](_0x3c3f2f,_0x21a9e1)[_0xf6bc('0xa')](function(_0x414700){logger[_0xf6bc('0xb')](_0xf6bc('0xc'),_0x484663,_0xf6bc('0xd'));logger[_0xf6bc('0xe')](_0xf6bc('0xf'),_0x484663,_0xf6bc('0xd'),JSON[_0xf6bc('0x10')](_0x414700));if(_0x414700[_0xf6bc('0x11')]){if(_0x414700[_0xf6bc('0x11')][_0xf6bc('0x12')]===0x1f4){logger[_0xf6bc('0x11')](_0xf6bc('0xc'),_0x484663,_0x414700['error'][_0xf6bc('0x13')]);return _0xb51752(_0x414700['error'][_0xf6bc('0x13')]);}logger[_0xf6bc('0x11')](_0xf6bc('0xc'),_0x484663,_0x414700['error'][_0xf6bc('0x13')]);return _0x3dee61(_0x414700[_0xf6bc('0x11')][_0xf6bc('0x13')]);}else{logger['info'](_0xf6bc('0xc'),_0x484663,_0xf6bc('0xd'));_0x3dee61(_0x414700[_0xf6bc('0x14')][_0xf6bc('0x13')]);}})['catch'](function(_0x84a679){logger['error'](_0xf6bc('0xc'),_0x484663,_0x84a679);_0xb51752(_0x84a679);});});}exports[_0xf6bc('0x15')]=function(_0x5e2e7e){var _0x340f59=this;return new Promise(function(_0xebf22,_0x2b52a6){return db[_0xf6bc('0x16')]['create'](_0x5e2e7e['body'],{'raw':_0x5e2e7e[_0xf6bc('0x17')]?_0x5e2e7e['options'][_0xf6bc('0x18')]===undefined?!![]:![]:!![]})[_0xf6bc('0xa')](function(_0x5e0a40){logger['info'](_0xf6bc('0x15'),_0x5e2e7e);logger['debug'](_0xf6bc('0x15'),_0x5e2e7e,JSON[_0xf6bc('0x10')](_0x5e0a40));_0xebf22(_0x5e0a40);})['catch'](function(_0x41fa25){logger[_0xf6bc('0x11')](_0xf6bc('0x15'),_0x41fa25[_0xf6bc('0x13')],_0x5e2e7e);_0x2b52a6(_0x340f59[_0xf6bc('0x11')](0x1f4,_0x41fa25['message']));});});};exports[_0xf6bc('0x19')]=function(_0x5db815){var _0x332668=this;return new Promise(function(_0x251094,_0x44a42e){return db[_0xf6bc('0x16')][_0xf6bc('0x1a')](_0x5db815[_0xf6bc('0x1b')],{'raw':_0x5db815[_0xf6bc('0x17')]?_0x5db815[_0xf6bc('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5db815[_0xf6bc('0x17')]?_0x5db815['options']['where']||null:null,'attributes':_0x5db815[_0xf6bc('0x17')]?_0x5db815[_0xf6bc('0x17')][_0xf6bc('0x1c')]||null:null,'limit':_0x5db815[_0xf6bc('0x17')]?_0x5db815[_0xf6bc('0x17')][_0xf6bc('0x1d')]||null:null})['then'](function(_0x4b8e6d){logger[_0xf6bc('0xb')](_0xf6bc('0x19'),_0x5db815);logger[_0xf6bc('0xe')](_0xf6bc('0x19'),_0x5db815,JSON[_0xf6bc('0x10')](_0x4b8e6d));_0x251094(_0x4b8e6d);})[_0xf6bc('0x1e')](function(_0x3267c0){logger[_0xf6bc('0x11')](_0xf6bc('0x19'),_0x3267c0[_0xf6bc('0x13')],_0x5db815);_0x44a42e(_0x332668[_0xf6bc('0x11')](0x1f4,_0x3267c0[_0xf6bc('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 0be6e40..5cc12be 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 _0x10eb=['get','isAuthenticated','/describe','/:id','show','post','create','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./chatQueueReport.controller'];(function(_0x24b283,_0x510549){var _0x23d8a1=function(_0xc309f){while(--_0xc309f){_0x24b283['push'](_0x24b283['shift']());}};_0x23d8a1(++_0x510549);}(_0x10eb,0x106));var _0xb10e=function(_0x296e52,_0x428515){_0x296e52=_0x296e52-0x0;var _0x286070=_0x10eb[_0x296e52];return _0x286070;};'use strict';var multer=require(_0xb10e('0x0'));var util=require(_0xb10e('0x1'));var path=require(_0xb10e('0x2'));var timeout=require(_0xb10e('0x3'));var express=require('express');var router=express[_0xb10e('0x4')]();var fs_extra=require(_0xb10e('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb10e('0x6'));var controller=require(_0xb10e('0x7'));router[_0xb10e('0x8')]('/',auth[_0xb10e('0x9')](),controller['index']);router['get'](_0xb10e('0xa'),auth[_0xb10e('0x9')](),controller['describe']);router['get'](_0xb10e('0xb'),auth[_0xb10e('0x9')](),controller[_0xb10e('0xc')]);router[_0xb10e('0xd')]('/',auth[_0xb10e('0x9')](),controller[_0xb10e('0xe')]);router['put'](_0xb10e('0xb'),auth[_0xb10e('0x9')](),controller[_0xb10e('0xf')]);router[_0xb10e('0x10')](_0xb10e('0xb'),auth[_0xb10e('0x9')](),controller['destroy']);module[_0xb10e('0x11')]=router;
\ No newline at end of file
+var _0xe087=['update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe087,0x1cf));var _0x7e08=function(_0x3781fe,_0x39211a){_0x3781fe=_0x3781fe-0x0;var _0x109f3e=_0xe087[_0x3781fe];return _0x109f3e;};'use strict';var multer=require(_0x7e08('0x0'));var util=require(_0x7e08('0x1'));var path=require(_0x7e08('0x2'));var timeout=require('connect-timeout');var express=require(_0x7e08('0x3'));var router=express[_0x7e08('0x4')]();var fs_extra=require(_0x7e08('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7e08('0x6'));var config=require(_0x7e08('0x7'));var controller=require('./chatQueueReport.controller');router[_0x7e08('0x8')]('/',auth[_0x7e08('0x9')](),controller[_0x7e08('0xa')]);router[_0x7e08('0x8')](_0x7e08('0xb'),auth[_0x7e08('0x9')](),controller[_0x7e08('0xc')]);router[_0x7e08('0x8')](_0x7e08('0xd'),auth[_0x7e08('0x9')](),controller[_0x7e08('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7e08('0xf')]);router[_0x7e08('0x10')](_0x7e08('0xd'),auth[_0x7e08('0x9')](),controller[_0x7e08('0x11')]);router[_0x7e08('0x12')]('/:id',auth[_0x7e08('0x9')](),controller['destroy']);module[_0x7e08('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 8f8129f..0dbdd3a 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x418815,_0x524351){var _0x3ab866=function(_0x2078e8){while(--_0x2078e8){_0x418815['push'](_0x418815['shift']());}};_0x3ab866(++_0x524351);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x541a67,_0x50728d){_0x541a67=_0x541a67-0x0;var _0x45da2a=_0xcb91[_0x541a67];return _0x45da2a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
+var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x4fdaa5,_0x212ef3){var _0x48e67f=function(_0x524ef4){while(--_0x524ef4){_0x4fdaa5['push'](_0x4fdaa5['shift']());}};_0x48e67f(++_0x212ef3);}(_0xaa88,0x137));var _0x8aa8=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xaa88[_0x9df060];return _0x338dfe;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 6f4a70d..44bedc1 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 _0x4faa=['mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','then','destroy','error','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','params','catch','describe','eml-format','rimraf','moment'];(function(_0x3b5067,_0x402005){var _0x43a3b0=function(_0x4278c6){while(--_0x4278c6){_0x3b5067['push'](_0x3b5067['shift']());}};_0x43a3b0(++_0x402005);}(_0x4faa,0x8f));var _0xa4fa=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x4faa[_0x311c35];return _0x5cc50c;};'use strict';var emlformat=require(_0xa4fa('0x0'));var rimraf=require(_0xa4fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa4fa('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa4fa('0x3'));var util=require(_0xa4fa('0x4'));var path=require(_0xa4fa('0x5'));var sox=require('sox');var csv=require(_0xa4fa('0x6'));var ejs=require(_0xa4fa('0x7'));var fs=require('fs');var fs_extra=require(_0xa4fa('0x8'));var _=require(_0xa4fa('0x9'));var squel=require(_0xa4fa('0xa'));var crypto=require(_0xa4fa('0xb'));var jsforce=require(_0xa4fa('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa4fa('0x6'));var querystring=require(_0xa4fa('0xd'));var Papa=require(_0xa4fa('0xe'));var Redis=require('ioredis');var authService=require(_0xa4fa('0xf'));var qs=require(_0xa4fa('0x10'));var as=require(_0xa4fa('0x11'));var hardwareService=require(_0xa4fa('0x12'));var logger=require(_0xa4fa('0x13'))(_0xa4fa('0x14'));var utils=require(_0xa4fa('0x15'));var config=require(_0xa4fa('0x16'));var licenseUtil=require(_0xa4fa('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a9bfd,_0x431690){_0x431690=_0x431690||0xcc;return function(_0x3e8020){if(_0x3e8020){return _0x1a9bfd[_0xa4fa('0x18')](_0x431690);}return _0x1a9bfd[_0xa4fa('0x19')](_0x431690)[_0xa4fa('0x1a')]();};}function respondWithResult(_0x2cf4b5,_0x37b346){_0x37b346=_0x37b346||0xc8;return function(_0xf4b493){if(_0xf4b493){return _0x2cf4b5[_0xa4fa('0x19')](_0x37b346)[_0xa4fa('0x1b')](_0xf4b493);}};}function respondWithFilteredResult(_0x1f1871,_0x31fcce){return function(_0xa1c46d){if(_0xa1c46d){var _0x413a62=typeof _0x31fcce[_0xa4fa('0x1c')]===_0xa4fa('0x1d')&&typeof _0x31fcce[_0xa4fa('0x1e')]==='undefined';var _0xf75196=_0xa1c46d[_0xa4fa('0x1f')];var _0xb9b90d=_0x413a62?0x0:_0x31fcce[_0xa4fa('0x1c')];var _0x2bfd0c=_0x413a62?_0xa1c46d[_0xa4fa('0x1f')]:_0x31fcce[_0xa4fa('0x1c')]+_0x31fcce['limit'];var _0x456448;if(_0x2bfd0c>=_0xf75196){_0x2bfd0c=_0xf75196;_0x456448=0xc8;}else{_0x456448=0xce;}_0x1f1871[_0xa4fa('0x19')](_0x456448);return _0x1f1871['set']('Content-Range',_0xb9b90d+'-'+_0x2bfd0c+'/'+_0xf75196)[_0xa4fa('0x1b')](_0xa1c46d);}return null;};}function patchUpdates(_0x2de93c){return function(_0x114431){try{jsonpatch[_0xa4fa('0x20')](_0x114431,_0x2de93c,!![]);}catch(_0x4c3978){return BPromise['reject'](_0x4c3978);}return _0x114431['save']();};}function saveUpdates(_0x478ae2,_0x948f85){return function(_0x91fb2e){if(_0x91fb2e){return _0x91fb2e['update'](_0x478ae2)[_0xa4fa('0x21')](function(_0x337ae6){return _0x337ae6;});}return null;};}function removeEntity(_0x113524,_0x42c676){return function(_0x36af3f){if(_0x36af3f){return _0x36af3f[_0xa4fa('0x22')]()[_0xa4fa('0x21')](function(){_0x113524[_0xa4fa('0x19')](0xcc)[_0xa4fa('0x1a')]();});}};}function handleEntityNotFound(_0x52e14c,_0x4e430e){return function(_0x528a3c){if(!_0x528a3c){_0x52e14c[_0xa4fa('0x18')](0x194);}return _0x528a3c;};}function handleError(_0x18dd3f,_0x302d80){_0x302d80=_0x302d80||0x1f4;return function(_0x182b10){logger[_0xa4fa('0x23')](_0x182b10[_0xa4fa('0x24')]);if(_0x182b10[_0xa4fa('0x25')]){delete _0x182b10[_0xa4fa('0x25')];}_0x18dd3f['status'](_0x302d80)[_0xa4fa('0x26')](_0x182b10);};}exports['index']=function(_0x2a96d2,_0xd28914){var _0x3f9974={},_0x110011={},_0xf987a6={'count':0x0,'rows':[]};var _0x3c2953=_[_0xa4fa('0x27')](db[_0xa4fa('0x28')][_0xa4fa('0x29')],function(_0x3be477){return{'name':_0x3be477[_0xa4fa('0x2a')],'type':_0x3be477['type'][_0xa4fa('0x2b')]};});_0x110011[_0xa4fa('0x2c')]=_['map'](_0x3c2953,'name');_0x110011['query']=_[_0xa4fa('0x2d')](_0x2a96d2[_0xa4fa('0x2e')]);_0x110011['filters']=_[_0xa4fa('0x2f')](_0x110011[_0xa4fa('0x2c')],_0x110011[_0xa4fa('0x2e')]);_0x3f9974[_0xa4fa('0x30')]=_[_0xa4fa('0x2f')](_0x110011[_0xa4fa('0x2c')],qs['fields'](_0x2a96d2[_0xa4fa('0x2e')]['fields']));_0x3f9974[_0xa4fa('0x30')]=_0x3f9974['attributes'][_0xa4fa('0x31')]?_0x3f9974[_0xa4fa('0x30')]:_0x110011[_0xa4fa('0x2c')];if(!_0x2a96d2[_0xa4fa('0x2e')][_0xa4fa('0x32')](_0xa4fa('0x33'))){_0x3f9974[_0xa4fa('0x1e')]=qs[_0xa4fa('0x1e')](_0x2a96d2[_0xa4fa('0x2e')]['limit']);_0x3f9974[_0xa4fa('0x1c')]=qs[_0xa4fa('0x1c')](_0x2a96d2[_0xa4fa('0x2e')][_0xa4fa('0x1c')]);}_0x3f9974[_0xa4fa('0x34')]=qs[_0xa4fa('0x35')](_0x2a96d2[_0xa4fa('0x2e')][_0xa4fa('0x35')]);_0x3f9974['where']=qs[_0xa4fa('0x36')](_[_0xa4fa('0x37')](_0x2a96d2[_0xa4fa('0x2e')],_0x110011[_0xa4fa('0x36')]),_0x3c2953);if(_0x2a96d2['query'][_0xa4fa('0x38')]){_0x3f9974[_0xa4fa('0x39')]=_[_0xa4fa('0x3a')](_0x3f9974[_0xa4fa('0x39')],{'$or':_[_0xa4fa('0x27')](_0x3c2953,function(_0x478450){if(_0x478450[_0xa4fa('0x3b')]!==_0xa4fa('0x3c')){var _0x353f0c={};_0x353f0c[_0x478450[_0xa4fa('0x25')]]={'$like':'%'+_0x2a96d2[_0xa4fa('0x2e')][_0xa4fa('0x38')]+'%'};return _0x353f0c;}})});}_0x3f9974=_['merge']({},_0x3f9974,_0x2a96d2[_0xa4fa('0x3d')]);var _0x50ee29={'where':_0x3f9974[_0xa4fa('0x39')]};return db[_0xa4fa('0x28')][_0xa4fa('0x1f')](_0x50ee29)[_0xa4fa('0x21')](function(_0x27f5f1){_0xf987a6[_0xa4fa('0x1f')]=_0x27f5f1;if(_0x2a96d2[_0xa4fa('0x2e')][_0xa4fa('0x3e')]){_0x3f9974[_0xa4fa('0x3f')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xa4fa('0x40')](_0x3f9974);})[_0xa4fa('0x21')](function(_0x2473b5){_0xf987a6[_0xa4fa('0x41')]=_0x2473b5;return _0xf987a6;})[_0xa4fa('0x21')](respondWithFilteredResult(_0xd28914,_0x3f9974))['catch'](handleError(_0xd28914,null));};exports[_0xa4fa('0x42')]=function(_0x103d88,_0x285e88){var _0x370198={'raw':!![],'where':{'id':_0x103d88['params']['id']}},_0x5aa283={};_0x5aa283[_0xa4fa('0x2c')]=_[_0xa4fa('0x2d')](db['ChatTransferReport'][_0xa4fa('0x29')]);_0x5aa283[_0xa4fa('0x2e')]=_[_0xa4fa('0x2d')](_0x103d88[_0xa4fa('0x2e')]);_0x5aa283[_0xa4fa('0x36')]=_['intersection'](_0x5aa283[_0xa4fa('0x2c')],_0x5aa283[_0xa4fa('0x2e')]);_0x370198[_0xa4fa('0x30')]=_[_0xa4fa('0x2f')](_0x5aa283['model'],qs['fields'](_0x103d88[_0xa4fa('0x2e')]['fields']));_0x370198[_0xa4fa('0x30')]=_0x370198['attributes'][_0xa4fa('0x31')]?_0x370198['attributes']:_0x5aa283['model'];if(_0x103d88[_0xa4fa('0x2e')][_0xa4fa('0x3e')]){_0x370198['include']=[{'all':!![]}];}_0x370198=_[_0xa4fa('0x3a')]({},_0x370198,_0x103d88[_0xa4fa('0x3d')]);return db['ChatTransferReport'][_0xa4fa('0x43')](_0x370198)['then'](handleEntityNotFound(_0x285e88,null))['then'](respondWithResult(_0x285e88,null))['catch'](handleError(_0x285e88,null));};exports[_0xa4fa('0x44')]=function(_0x4ce7a4,_0x393e7f){return db[_0xa4fa('0x28')]['create'](_0x4ce7a4[_0xa4fa('0x45')],{})['then'](respondWithResult(_0x393e7f,0xc9))['catch'](handleError(_0x393e7f,null));};exports['update']=function(_0x49b382,_0x533c8a){if(_0x49b382['body']['id']){delete _0x49b382['body']['id'];}return db[_0xa4fa('0x28')]['find']({'where':{'id':_0x49b382[_0xa4fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x533c8a,null))[_0xa4fa('0x21')](saveUpdates(_0x49b382[_0xa4fa('0x45')],null))[_0xa4fa('0x21')](respondWithResult(_0x533c8a,null))[_0xa4fa('0x47')](handleError(_0x533c8a,null));};exports[_0xa4fa('0x22')]=function(_0x581366,_0x4535f0){return db[_0xa4fa('0x28')]['find']({'where':{'id':_0x581366['params']['id']}})['then'](handleEntityNotFound(_0x4535f0,null))[_0xa4fa('0x21')](removeEntity(_0x4535f0,null))[_0xa4fa('0x47')](handleError(_0x4535f0,null));};exports[_0xa4fa('0x48')]=function(_0x54463f,_0x233928){return db['ChatTransferReport'][_0xa4fa('0x48')]()[_0xa4fa('0x21')](respondWithResult(_0x233928,null))[_0xa4fa('0x47')](handleError(_0x233928,null));};
\ No newline at end of file
+var _0xd0e2=['body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','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','../../mysqldb','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','ChatTransferReport','rawAttributes','type','key','model','keys','filters','attributes','intersection','fields','query','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','length','includeAll','create'];(function(_0x37d03f,_0x3859d1){var _0x566781=function(_0x546437){while(--_0x546437){_0x37d03f['push'](_0x37d03f['shift']());}};_0x566781(++_0x3859d1);}(_0xd0e2,0xed));var _0x2d0e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd0e2[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d0e('0x0'));var zipdir=require(_0x2d0e('0x1'));var jsonpatch=require(_0x2d0e('0x2'));var rp=require(_0x2d0e('0x3'));var moment=require('moment');var BPromise=require(_0x2d0e('0x4'));var Mustache=require(_0x2d0e('0x5'));var util=require(_0x2d0e('0x6'));var path=require(_0x2d0e('0x7'));var sox=require(_0x2d0e('0x8'));var csv=require(_0x2d0e('0x9'));var ejs=require(_0x2d0e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2d0e('0xb'));var squel=require(_0x2d0e('0xc'));var crypto=require(_0x2d0e('0xd'));var jsforce=require(_0x2d0e('0xe'));var deskjs=require(_0x2d0e('0xf'));var toCsv=require(_0x2d0e('0x9'));var querystring=require(_0x2d0e('0x10'));var Papa=require(_0x2d0e('0x11'));var Redis=require(_0x2d0e('0x12'));var authService=require(_0x2d0e('0x13'));var qs=require(_0x2d0e('0x14'));var as=require(_0x2d0e('0x15'));var hardwareService=require(_0x2d0e('0x16'));var logger=require(_0x2d0e('0x17'))(_0x2d0e('0x18'));var utils=require(_0x2d0e('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2d0e('0x1a'))['db'];function respondWithStatusCode(_0x41b2a8,_0x37a637){_0x37a637=_0x37a637||0xcc;return function(_0x575f5b){if(_0x575f5b){return _0x41b2a8['sendStatus'](_0x37a637);}return _0x41b2a8[_0x2d0e('0x1b')](_0x37a637)[_0x2d0e('0x1c')]();};}function respondWithResult(_0x4dfe78,_0x24093a){_0x24093a=_0x24093a||0xc8;return function(_0x83265){if(_0x83265){return _0x4dfe78['status'](_0x24093a)['json'](_0x83265);}};}function respondWithFilteredResult(_0x451c49,_0x59f113){return function(_0x13a5e4){if(_0x13a5e4){var _0x35fdae=typeof _0x59f113['offset']===_0x2d0e('0x1d')&&typeof _0x59f113[_0x2d0e('0x1e')]===_0x2d0e('0x1d');var _0x3e46f1=_0x13a5e4[_0x2d0e('0x1f')];var _0x55e810=_0x35fdae?0x0:_0x59f113[_0x2d0e('0x20')];var _0x5ce2f3=_0x35fdae?_0x13a5e4[_0x2d0e('0x1f')]:_0x59f113[_0x2d0e('0x20')]+_0x59f113[_0x2d0e('0x1e')];var _0x54c572;if(_0x5ce2f3>=_0x3e46f1){_0x5ce2f3=_0x3e46f1;_0x54c572=0xc8;}else{_0x54c572=0xce;}_0x451c49[_0x2d0e('0x1b')](_0x54c572);return _0x451c49['set'](_0x2d0e('0x21'),_0x55e810+'-'+_0x5ce2f3+'/'+_0x3e46f1)[_0x2d0e('0x22')](_0x13a5e4);}return null;};}function patchUpdates(_0xd6f6e8){return function(_0x3003b5){try{jsonpatch[_0x2d0e('0x23')](_0x3003b5,_0xd6f6e8,!![]);}catch(_0x3f8277){return BPromise[_0x2d0e('0x24')](_0x3f8277);}return _0x3003b5[_0x2d0e('0x25')]();};}function saveUpdates(_0x33c2c0,_0x3da617){return function(_0x516472){if(_0x516472){return _0x516472[_0x2d0e('0x26')](_0x33c2c0)[_0x2d0e('0x27')](function(_0x250fea){return _0x250fea;});}return null;};}function removeEntity(_0x18ff50,_0x3ccd11){return function(_0x12c1c1){if(_0x12c1c1){return _0x12c1c1[_0x2d0e('0x28')]()['then'](function(){_0x18ff50['status'](0xcc)[_0x2d0e('0x1c')]();});}};}function handleEntityNotFound(_0x2f930c,_0x4f6c0e){return function(_0x5cbf80){if(!_0x5cbf80){_0x2f930c[_0x2d0e('0x29')](0x194);}return _0x5cbf80;};}function handleError(_0x926fcb,_0x4bceeb){_0x4bceeb=_0x4bceeb||0x1f4;return function(_0xcaed90){logger[_0x2d0e('0x2a')](_0xcaed90[_0x2d0e('0x2b')]);if(_0xcaed90['name']){delete _0xcaed90[_0x2d0e('0x2c')];}_0x926fcb[_0x2d0e('0x1b')](_0x4bceeb)['send'](_0xcaed90);};}exports[_0x2d0e('0x2d')]=function(_0x594bcf,_0x25d27b){var _0x607231={},_0x457bbb={},_0x34039c={'count':0x0,'rows':[]};var _0x290841=_[_0x2d0e('0x2e')](db[_0x2d0e('0x2f')][_0x2d0e('0x30')],function(_0x3ee5bd){return{'name':_0x3ee5bd['fieldName'],'type':_0x3ee5bd[_0x2d0e('0x31')][_0x2d0e('0x32')]};});_0x457bbb[_0x2d0e('0x33')]=_[_0x2d0e('0x2e')](_0x290841,_0x2d0e('0x2c'));_0x457bbb['query']=_[_0x2d0e('0x34')](_0x594bcf['query']);_0x457bbb[_0x2d0e('0x35')]=_['intersection'](_0x457bbb[_0x2d0e('0x33')],_0x457bbb['query']);_0x607231[_0x2d0e('0x36')]=_[_0x2d0e('0x37')](_0x457bbb[_0x2d0e('0x33')],qs[_0x2d0e('0x38')](_0x594bcf[_0x2d0e('0x39')]['fields']));_0x607231[_0x2d0e('0x36')]=_0x607231[_0x2d0e('0x36')]['length']?_0x607231[_0x2d0e('0x36')]:_0x457bbb[_0x2d0e('0x33')];if(!_0x594bcf['query'][_0x2d0e('0x3a')]('nolimit')){_0x607231[_0x2d0e('0x1e')]=qs[_0x2d0e('0x1e')](_0x594bcf[_0x2d0e('0x39')][_0x2d0e('0x1e')]);_0x607231['offset']=qs[_0x2d0e('0x20')](_0x594bcf[_0x2d0e('0x39')][_0x2d0e('0x20')]);}_0x607231[_0x2d0e('0x3b')]=qs[_0x2d0e('0x3c')](_0x594bcf[_0x2d0e('0x39')][_0x2d0e('0x3c')]);_0x607231[_0x2d0e('0x3d')]=qs['filters'](_[_0x2d0e('0x3e')](_0x594bcf[_0x2d0e('0x39')],_0x457bbb['filters']),_0x290841);if(_0x594bcf[_0x2d0e('0x39')][_0x2d0e('0x3f')]){_0x607231[_0x2d0e('0x3d')]=_[_0x2d0e('0x40')](_0x607231[_0x2d0e('0x3d')],{'$or':_[_0x2d0e('0x2e')](_0x290841,function(_0x1e0adf){if(_0x1e0adf[_0x2d0e('0x31')]!=='VIRTUAL'){var _0x14077d={};_0x14077d[_0x1e0adf['name']]={'$like':'%'+_0x594bcf[_0x2d0e('0x39')]['filter']+'%'};return _0x14077d;}})});}_0x607231=_[_0x2d0e('0x40')]({},_0x607231,_0x594bcf[_0x2d0e('0x41')]);var _0x57e8ce={'where':_0x607231[_0x2d0e('0x3d')]};return db[_0x2d0e('0x2f')][_0x2d0e('0x1f')](_0x57e8ce)['then'](function(_0x39f5f9){_0x34039c['count']=_0x39f5f9;if(_0x594bcf[_0x2d0e('0x39')]['includeAll']){_0x607231[_0x2d0e('0x42')]=[{'all':!![]}];}return db[_0x2d0e('0x2f')][_0x2d0e('0x43')](_0x607231);})[_0x2d0e('0x27')](function(_0x385a0c){_0x34039c[_0x2d0e('0x44')]=_0x385a0c;return _0x34039c;})['then'](respondWithFilteredResult(_0x25d27b,_0x607231))[_0x2d0e('0x45')](handleError(_0x25d27b,null));};exports[_0x2d0e('0x46')]=function(_0x3352e8,_0x2a52a5){var _0x2b7585={'raw':!![],'where':{'id':_0x3352e8[_0x2d0e('0x47')]['id']}},_0x3e2aeb={};_0x3e2aeb[_0x2d0e('0x33')]=_[_0x2d0e('0x34')](db[_0x2d0e('0x2f')][_0x2d0e('0x30')]);_0x3e2aeb[_0x2d0e('0x39')]=_[_0x2d0e('0x34')](_0x3352e8[_0x2d0e('0x39')]);_0x3e2aeb[_0x2d0e('0x35')]=_[_0x2d0e('0x37')](_0x3e2aeb[_0x2d0e('0x33')],_0x3e2aeb[_0x2d0e('0x39')]);_0x2b7585['attributes']=_['intersection'](_0x3e2aeb[_0x2d0e('0x33')],qs[_0x2d0e('0x38')](_0x3352e8[_0x2d0e('0x39')][_0x2d0e('0x38')]));_0x2b7585['attributes']=_0x2b7585[_0x2d0e('0x36')][_0x2d0e('0x48')]?_0x2b7585[_0x2d0e('0x36')]:_0x3e2aeb['model'];if(_0x3352e8[_0x2d0e('0x39')][_0x2d0e('0x49')]){_0x2b7585[_0x2d0e('0x42')]=[{'all':!![]}];}_0x2b7585=_[_0x2d0e('0x40')]({},_0x2b7585,_0x3352e8[_0x2d0e('0x41')]);return db[_0x2d0e('0x2f')]['find'](_0x2b7585)[_0x2d0e('0x27')](handleEntityNotFound(_0x2a52a5,null))[_0x2d0e('0x27')](respondWithResult(_0x2a52a5,null))[_0x2d0e('0x45')](handleError(_0x2a52a5,null));};exports['create']=function(_0x570f2e,_0xfa28d4){return db[_0x2d0e('0x2f')][_0x2d0e('0x4a')](_0x570f2e['body'],{})['then'](respondWithResult(_0xfa28d4,0xc9))[_0x2d0e('0x45')](handleError(_0xfa28d4,null));};exports[_0x2d0e('0x26')]=function(_0x2f7ecf,_0x7a870e){if(_0x2f7ecf[_0x2d0e('0x4b')]['id']){delete _0x2f7ecf[_0x2d0e('0x4b')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x2f7ecf[_0x2d0e('0x47')]['id']}})[_0x2d0e('0x27')](handleEntityNotFound(_0x7a870e,null))['then'](saveUpdates(_0x2f7ecf[_0x2d0e('0x4b')],null))['then'](respondWithResult(_0x7a870e,null))[_0x2d0e('0x45')](handleError(_0x7a870e,null));};exports[_0x2d0e('0x28')]=function(_0x1f7b9e,_0x45d2bd){return db[_0x2d0e('0x2f')][_0x2d0e('0x4c')]({'where':{'id':_0x1f7b9e[_0x2d0e('0x47')]['id']}})[_0x2d0e('0x27')](handleEntityNotFound(_0x45d2bd,null))[_0x2d0e('0x27')](removeEntity(_0x45d2bd,null))[_0x2d0e('0x45')](handleError(_0x45d2bd,null));};exports[_0x2d0e('0x4d')]=function(_0x5d6efa,_0x3e481c){return db[_0x2d0e('0x2f')][_0x2d0e('0x4d')]()[_0x2d0e('0x27')](respondWithResult(_0x3e481c,null))[_0x2d0e('0x45')](handleError(_0x3e481c,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 309b547..75eddad 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 _0x9db8=['lodash','util','../../config/logger','moment','request-promise','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid'];(function(_0x512a50,_0x3057c2){var _0x57c236=function(_0x59338c){while(--_0x59338c){_0x512a50['push'](_0x512a50['shift']());}};_0x57c236(++_0x3057c2);}(_0x9db8,0x14a));var _0x89db=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x9db8[_0x4dc7b9];return _0x3ab114;};'use strict';var _=require(_0x89db('0x0'));var util=require(_0x89db('0x1'));var logger=require(_0x89db('0x2'))('api');var moment=require(_0x89db('0x3'));var BPromise=require('bluebird');var rp=require(_0x89db('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x89db('0x5'));var attributes=require(_0x89db('0x6'));module[_0x89db('0x7')]=function(_0x3e5a70,_0x2ae77e){return _0x3e5a70[_0x89db('0x8')](_0x89db('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x89db('0xa'),'fields':[_0x89db('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x470b=['report_chat_transfer','uniqueid','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatTransferReport'];(function(_0x32bc66,_0x2166ca){var _0xf18755=function(_0x5b7493){while(--_0x5b7493){_0x32bc66['push'](_0x32bc66['shift']());}};_0xf18755(++_0x2166ca);}(_0x470b,0x91));var _0xb470=function(_0x2f5b90,_0x4a6f40){_0x2f5b90=_0x2f5b90-0x0;var _0x53e3d4=_0x470b[_0x2f5b90];return _0x53e3d4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb470('0x0'));var moment=require(_0xb470('0x1'));var BPromise=require(_0xb470('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb470('0x3'));var rimraf=require(_0xb470('0x4'));var config=require(_0xb470('0x5'));var attributes=require('./chatTransferReport.attributes');module[_0xb470('0x6')]=function(_0x220a76,_0x1f616a){return _0x220a76[_0xb470('0x7')](_0xb470('0x8'),attributes,{'tableName':_0xb470('0x9'),'paranoid':![],'indexes':[{'name':_0xb470('0xa'),'fields':[_0xb470('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 d2774cb..c1c3012 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 _0x737f=['randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','info','ChatTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','lodash','util','moment'];(function(_0xd72e20,_0x1b7c31){var _0xe99992=function(_0x33f902){while(--_0x33f902){_0xd72e20['push'](_0xd72e20['shift']());}};_0xe99992(++_0x1b7c31);}(_0x737f,0x1d8));var _0xf737=function(_0x14a36e,_0x43c479){_0x14a36e=_0x14a36e-0x0;var _0x958c2c=_0x737f[_0x14a36e];return _0x958c2c;};'use strict';var _=require(_0xf737('0x0'));var util=require(_0xf737('0x1'));var moment=require(_0xf737('0x2'));var BPromise=require('bluebird');var rs=require(_0xf737('0x3'));var fs=require('fs');var Redis=require(_0xf737('0x4'));var db=require(_0xf737('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf737('0x6'));var config=require(_0xf737('0x7'));var jayson=require(_0xf737('0x8'));var client=jayson['client'][_0xf737('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x331837,_0x289eaa,_0x493942){return new BPromise(function(_0xc9e977,_0x5bdb46){return client['request'](_0x331837,_0x493942)[_0xf737('0xa')](function(_0x2f2e29){logger[_0xf737('0xb')](_0xf737('0xc'),_0x289eaa,'request\x20sent');logger[_0xf737('0xd')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x289eaa,_0xf737('0xe'),JSON[_0xf737('0xf')](_0x2f2e29));if(_0x2f2e29['error']){if(_0x2f2e29['error']['code']===0x1f4){logger[_0xf737('0x10')](_0xf737('0xc'),_0x289eaa,_0x2f2e29[_0xf737('0x10')][_0xf737('0x11')]);return _0x5bdb46(_0x2f2e29[_0xf737('0x10')][_0xf737('0x11')]);}logger[_0xf737('0x10')](_0xf737('0xc'),_0x289eaa,_0x2f2e29['error'][_0xf737('0x11')]);return _0xc9e977(_0x2f2e29[_0xf737('0x10')][_0xf737('0x11')]);}else{logger[_0xf737('0xb')](_0xf737('0xc'),_0x289eaa,_0xf737('0xe'));_0xc9e977(_0x2f2e29['result']['message']);}})[_0xf737('0x12')](function(_0x2be4bd){logger[_0xf737('0x10')](_0xf737('0xc'),_0x289eaa,_0x2be4bd);_0x5bdb46(_0x2be4bd);});});}
\ No newline at end of file
+var _0x9a7e=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util'];(function(_0x23a079,_0xb8c9aa){var _0x53f2a5=function(_0x1b3dc5){while(--_0x1b3dc5){_0x23a079['push'](_0x23a079['shift']());}};_0x53f2a5(++_0xb8c9aa);}(_0x9a7e,0xda));var _0xe9a7=function(_0x4994cc,_0x1c5245){_0x4994cc=_0x4994cc-0x0;var _0x4d99cf=_0x9a7e[_0x4994cc];return _0x4d99cf;};'use strict';var _=require(_0xe9a7('0x0'));var util=require(_0xe9a7('0x1'));var moment=require('moment');var BPromise=require(_0xe9a7('0x2'));var rs=require(_0xe9a7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe9a7('0x4'))['db'];var utils=require(_0xe9a7('0x5'));var logger=require(_0xe9a7('0x6'))(_0xe9a7('0x7'));var config=require(_0xe9a7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe9a7('0x9')][_0xe9a7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48a279,_0xfd9ef3,_0x34d353){return new BPromise(function(_0xcf000b,_0x2e0709){return client[_0xe9a7('0xb')](_0x48a279,_0x34d353)[_0xe9a7('0xc')](function(_0x52452e){logger['info'](_0xe9a7('0xd'),_0xfd9ef3,'request\x20sent');logger['debug'](_0xe9a7('0xe'),_0xfd9ef3,_0xe9a7('0xf'),JSON[_0xe9a7('0x10')](_0x52452e));if(_0x52452e[_0xe9a7('0x11')]){if(_0x52452e[_0xe9a7('0x11')][_0xe9a7('0x12')]===0x1f4){logger[_0xe9a7('0x11')](_0xe9a7('0xd'),_0xfd9ef3,_0x52452e[_0xe9a7('0x11')][_0xe9a7('0x13')]);return _0x2e0709(_0x52452e[_0xe9a7('0x11')][_0xe9a7('0x13')]);}logger['error'](_0xe9a7('0xd'),_0xfd9ef3,_0x52452e[_0xe9a7('0x11')]['message']);return _0xcf000b(_0x52452e[_0xe9a7('0x11')][_0xe9a7('0x13')]);}else{logger[_0xe9a7('0x14')](_0xe9a7('0xd'),_0xfd9ef3,'request\x20sent');_0xcf000b(_0x52452e['result'][_0xe9a7('0x13')]);}})[_0xe9a7('0x15')](function(_0x40590f){logger[_0xe9a7('0x11')](_0xe9a7('0xd'),_0xfd9ef3,_0x40590f);_0x2e0709(_0x40590f);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index ea13ccf..121e52d 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 _0x83d4=['destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','delete'];(function(_0x3ba537,_0x56b969){var _0x585c1a=function(_0x1dd30b){while(--_0x1dd30b){_0x3ba537['push'](_0x3ba537['shift']());}};_0x585c1a(++_0x56b969);}(_0x83d4,0x178));var _0x483d=function(_0x149cb4,_0x400116){_0x149cb4=_0x149cb4-0x0;var _0x3c7207=_0x83d4[_0x149cb4];return _0x3c7207;};'use strict';var multer=require(_0x483d('0x0'));var util=require(_0x483d('0x1'));var path=require(_0x483d('0x2'));var timeout=require(_0x483d('0x3'));var express=require(_0x483d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x483d('0x5'));var interaction=require(_0x483d('0x6'));var config=require(_0x483d('0x7'));var controller=require(_0x483d('0x8'));router[_0x483d('0x9')]('/',auth[_0x483d('0xa')](),controller[_0x483d('0xb')]);router['get'](_0x483d('0xc'),auth[_0x483d('0xa')](),controller['describe']);router[_0x483d('0x9')]('/:id',auth[_0x483d('0xa')](),controller[_0x483d('0xd')]);router[_0x483d('0xe')]('/',auth[_0x483d('0xa')](),controller[_0x483d('0xf')]);router[_0x483d('0x10')](_0x483d('0x11'),auth[_0x483d('0xa')](),controller[_0x483d('0x12')]);router[_0x483d('0x13')](_0x483d('0x11'),auth[_0x483d('0xa')](),controller[_0x483d('0x14')]);module[_0x483d('0x15')]=router;
\ No newline at end of file
+var _0x1f3e=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','util','connect-timeout'];(function(_0x43a1ef,_0x480444){var _0x46c412=function(_0x3661f8){while(--_0x3661f8){_0x43a1ef['push'](_0x43a1ef['shift']());}};_0x46c412(++_0x480444);}(_0x1f3e,0x1a2));var _0xe1f3=function(_0x347c8b,_0x5c4781){_0x347c8b=_0x347c8b-0x0;var _0x596949=_0x1f3e[_0x347c8b];return _0x596949;};'use strict';var multer=require('multer');var util=require(_0xe1f3('0x0'));var path=require('path');var timeout=require(_0xe1f3('0x1'));var express=require(_0xe1f3('0x2'));var router=express[_0xe1f3('0x3')]();var fs_extra=require(_0xe1f3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe1f3('0x5'));var config=require(_0xe1f3('0x6'));var controller=require(_0xe1f3('0x7'));router[_0xe1f3('0x8')]('/',auth[_0xe1f3('0x9')](),controller[_0xe1f3('0xa')]);router[_0xe1f3('0x8')](_0xe1f3('0xb'),auth[_0xe1f3('0x9')](),controller[_0xe1f3('0xc')]);router[_0xe1f3('0x8')](_0xe1f3('0xd'),auth['isAuthenticated'](),controller[_0xe1f3('0xe')]);router[_0xe1f3('0xf')]('/',auth['isAuthenticated'](),controller[_0xe1f3('0x10')]);router[_0xe1f3('0x11')]('/:id',auth[_0xe1f3('0x9')](),controller[_0xe1f3('0x12')]);router['delete'](_0xe1f3('0xd'),auth[_0xe1f3('0x9')](),controller[_0xe1f3('0x13')]);module[_0xe1f3('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index f529284..9d4c43b 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 _0xf109=['#011F6A','#ffffff','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','INTEGER','stringify','input','name','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','Agent'];(function(_0x4d6dba,_0x2769b9){var _0x5680ff=function(_0x5dc8b5){while(--_0x5dc8b5){_0x4d6dba['push'](_0x4d6dba['shift']());}};_0x5680ff(++_0x2769b9);}(_0xf109,0xce));var _0x9f10=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xf109[_0x82129b];return _0x2ae5dc;};'use strict';var Sequelize=require(_0x9f10('0x0'));var rs=require(_0x9f10('0x1'));module[_0x9f10('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x9f10('0x3')]},'mapKey':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x4')},'mapKeyOffline':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x4')},'key':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x5')},'customerAlias':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':_0x9f10('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9f10('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':_0x9f10('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':_0x9f10('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x9f10('0x3')]},'animation':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x9f10('0x9')]('rounded','squared'),'defaultValue':_0x9f10('0xa')},'header_online':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0xc')},'offline_chat_button':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0xe')},'download_transcript':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x12')},'noteTitle':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x13')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x16')},'ratingType':{'type':Sequelize[_0x9f10('0x9')](_0x9f10('0x17'),_0x9f10('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x9f10('0x19')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x9f10('0x1a')]({'items':[{'type':_0x9f10('0x1b'),'variable':null,'config':{'placeholder':_0x9f10('0x1c'),'type':'text','required':!![]},'props':{'title':_0x9f10('0x1c'),'helpText':''}},{'type':_0x9f10('0x1b'),'props':{'title':_0x9f10('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x9f10('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x9f10('0x1d')](_0x9f10('0x1e'))?JSON['parse'](this[_0x9f10('0x1d')](_0x9f10('0x1e'))):{};},'set':function(_0x11cae7){return this[_0x9f10('0x1f')]('onlineForm',JSON['stringify'](_0x11cae7));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x9f10('0x1a')]({'items':[{'type':'input','props':{'title':_0x9f10('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x9f10('0x4'),'type':_0x9f10('0x4')},'variable':null},{'type':_0x9f10('0x20'),'config':{'placeholder':_0x9f10('0x21')},'props':{'title':'Comments','helpText':_0x9f10('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x9f10('0x1d')](_0x9f10('0x23'))?JSON[_0x9f10('0x24')](this[_0x9f10('0x1d')](_0x9f10('0x23'))):{};},'set':function(_0x581b1d){return this[_0x9f10('0x1f')](_0x9f10('0x23'),JSON[_0x9f10('0x1a')](_0x581b1d));}},'token':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x25')},'waitingMessage':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x26')},'offlineMessageBody':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x15')},'sendUnmanaged':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9f10('0x29')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9f10('0x3')]},'notificationTemplate':{'type':Sequelize[_0x9f10('0x29')],'defaultValue':function(){return _0x9f10('0x2a');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x2c')},'verticalAlignment':{'type':Sequelize[_0x9f10('0x19')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x2d')},'messagesAlignment':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x2e')},'defaultTitle':{'type':Sequelize[_0x9f10('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x9f10('0x19')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9f10('0x19')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9f10('0x19')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x9f10('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![],'comment':_0x9f10('0x31'),'set':function(_0x433e70){if(!_0x433e70)this[_0x9f10('0x1f')](_0x9f10('0x32'),null);this[_0x9f10('0x1f')](_0x9f10('0x33'),_0x433e70);}},'vidaooEscalation':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x9f10('0x3')]},'vidaooTopic':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':_0x9f10('0x34')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xe706=['Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','TEXT','stringify','name','text','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','getDataValue','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x4be327,_0x180e84){var _0x43b2c8=function(_0x4d1d91){while(--_0x4d1d91){_0x4be327['push'](_0x4be327['shift']());}};_0x43b2c8(++_0x180e84);}(_0xe706,0xa3));var _0x6e70=function(_0x1be9ce,_0x27443d){_0x1be9ce=_0x1be9ce-0x0;var _0x164439=_0xe706[_0x1be9ce];return _0x164439;};'use strict';var Sequelize=require(_0x6e70('0x0'));var rs=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'unique':_0x6e70('0x4')},'description':{'type':Sequelize[_0x6e70('0x3')]},'mapKey':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x5')},'mapKeyOffline':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x5')},'key':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x6')},'customerAlias':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6e70('0x3')]},'animation':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6e70('0xb')](_0x6e70('0xc'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xd')},'start_chat_button':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xe')},'offline_chat_button':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xf')},'header_offline':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x10')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x11')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x13')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x14')},'noteTitle':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x16')},'closingMessageButton':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x17')},'conditionAgreement':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x18')},'ratingType':{'type':Sequelize[_0x6e70('0xb')](_0x6e70('0x19'),_0x6e70('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':function(){return JSON[_0x6e70('0x1c')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x6e70('0x1d'),'type':_0x6e70('0x1e'),'required':!![]},'props':{'title':_0x6e70('0x1d'),'helpText':''}},{'type':'input','props':{'title':_0x6e70('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x6e70('0x1f'))?JSON[_0x6e70('0x20')](this['getDataValue'](_0x6e70('0x1f'))):{};},'set':function(_0x1196ed){return this['setDataValue'](_0x6e70('0x1f'),JSON[_0x6e70('0x1c')](_0x1196ed));}},'offlineForm':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x6e70('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x6e70('0x5'),'type':_0x6e70('0x5')},'variable':null},{'type':_0x6e70('0x21'),'config':{'placeholder':_0x6e70('0x22')},'props':{'title':'Comments','helpText':_0x6e70('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x6e70('0x24')](_0x6e70('0x25'))?JSON[_0x6e70('0x20')](this[_0x6e70('0x24')](_0x6e70('0x25'))):{};},'set':function(_0x3f78d2){return this[_0x6e70('0x26')](_0x6e70('0x25'),JSON[_0x6e70('0x1c')](_0x3f78d2));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x6e70('0x27')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6e70('0x3')]},'forwardOffline':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6e70('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x28')},'waitingMessage':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x29')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x2a')},'enableUnmanagedNote':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2b')},'skipUnmanaged':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x17')},'sendUnmanaged':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':function(){return _0x6e70('0x2c');}},'notificationSound':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2d')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6e70('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2e')},'verticalAlignment':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2f')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x6e70('0x1b')]},'showCustomerAvatar':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x30'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6e70('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x31')},'systemAvatar':{'type':Sequelize[_0x6e70('0x1b')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6e70('0x9')],'comment':_0x6e70('0x32')},'mandatoryDisposition':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2c0bd1){if(!_0x2c0bd1)this[_0x6e70('0x26')](_0x6e70('0x33'),null);this[_0x6e70('0x26')](_0x6e70('0x34'),_0x2c0bd1);}},'vidaooEscalation':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x6e70('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x6e70('0x35');}},'vidaooMetadata':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6e70('0x1b')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 3eee0af..8c1930a 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 _0x22ea=['includes','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','orderBy','priority','asc','defaults','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','version','format','%s\x20%s','browser','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','offline','files','send','mapKeyOffline','MailAccount','findOrCreate','readFileSync','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','getSmtpOptions','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','NotifyMailAccount','notifyMail','server','addInteraction','Contact','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','labelText','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','READ_COMMITTED','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','fs-extra','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','catch','sendStatus','status','json','undefined','limit','count','offset','set','update','destroy','get','end','stack','name','map','ChatWebsite','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','Pause','mandatoryDispositionPause','keys','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','sort','options','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','custom','isNil','existsSync','join','server/files/images/logos/','getAvatar','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey'];(function(_0x2ccc71,_0x1c458a){var _0x20fa15=function(_0x320e61){while(--_0x320e61){_0x2ccc71['push'](_0x2ccc71['shift']());}};_0x20fa15(++_0x1c458a);}(_0x22ea,0x98));var _0xa22e=function(_0x5706c9,_0x536d73){_0x5706c9=_0x5706c9-0x0;var _0x46a585=_0x22ea[_0x5706c9];return _0x46a585;};'use strict';var BPromise=require(_0xa22e('0x0'));var Mustache=require(_0xa22e('0x1'));var util=require(_0xa22e('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa22e('0x3'));var _=require('lodash');var querystring=require('querystring');var Redis=require('ioredis');var qs=require(_0xa22e('0x4'));var logger=require(_0xa22e('0x5'))(_0xa22e('0x6'));var config=require(_0xa22e('0x7'));var db=require(_0xa22e('0x8'))['db'];config[_0xa22e('0x9')]=_['defaults'](config[_0xa22e('0x9')],{'host':_0xa22e('0xa'),'port':0x18eb});var socket=require(_0xa22e('0xb'))(new Redis(config[_0xa22e('0x9')]));require(_0xa22e('0xc'))['register'](socket);var htmlToText=require(_0xa22e('0xd'));var jayson=require(_0xa22e('0xe'));var client=jayson[_0xa22e('0xf')][_0xa22e('0x10')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson['client'][_0xa22e('0x10')]({'port':0x232b});var client9001=jayson[_0xa22e('0xf')][_0xa22e('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x592c72,_0x5051e3,_0x1c3306,_0x214476){return new BPromise(function(_0x4b7db6,_0x439b0b){var _0x38bbfa=_0x214476||client;return _0x38bbfa[_0xa22e('0x11')](_0x592c72,_0x1c3306)[_0xa22e('0x12')](function(_0xcf2dac){logger[_0xa22e('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x5051e3,'request\x20sent');logger[_0xa22e('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5051e3,_0xa22e('0x15'),JSON[_0xa22e('0x16')](_0xcf2dac));if(_0xcf2dac['error']){if(_0xcf2dac[_0xa22e('0x17')][_0xa22e('0x18')]===0x1f4){logger[_0xa22e('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x5051e3,_0xcf2dac[_0xa22e('0x17')][_0xa22e('0x19')]);return _0x439b0b(_0xcf2dac[_0xa22e('0x17')][_0xa22e('0x19')]);}logger[_0xa22e('0x17')](_0xa22e('0x1a'),_0x5051e3,_0xcf2dac['error'][_0xa22e('0x19')]);return _0x4b7db6(_0xcf2dac[_0xa22e('0x17')][_0xa22e('0x19')]);}else{logger[_0xa22e('0x13')](_0xa22e('0x1a'),_0x5051e3,_0xa22e('0x15'));_0x4b7db6(_0xcf2dac['result'][_0xa22e('0x19')]);}})[_0xa22e('0x1b')](function(_0x1f11b0){logger[_0xa22e('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x5051e3,_0x1f11b0);_0x439b0b(_0x1f11b0);});});}function respondWithStatusCode(_0x592ab1,_0x2eec4e){_0x2eec4e=_0x2eec4e||0xcc;return function(_0x475d0f){if(_0x475d0f){return _0x592ab1[_0xa22e('0x1c')](_0x2eec4e);}return _0x592ab1[_0xa22e('0x1d')](_0x2eec4e)['end']();};}function respondWithResult(_0x278292,_0x1b12c2){_0x1b12c2=_0x1b12c2||0xc8;return function(_0x21ee85){if(_0x21ee85){return _0x278292[_0xa22e('0x1d')](_0x1b12c2)[_0xa22e('0x1e')](_0x21ee85);}};}function respondWithFilteredResult(_0x227d6c,_0x133038){return function(_0x3cb97e){if(_0x3cb97e){var _0x145299=typeof _0x133038['offset']===_0xa22e('0x1f')&&typeof _0x133038[_0xa22e('0x20')]===_0xa22e('0x1f');var _0x47522b=_0x3cb97e[_0xa22e('0x21')];var _0x13d055=_0x145299?0x0:_0x133038[_0xa22e('0x22')];var _0x1387f3=_0x145299?_0x3cb97e[_0xa22e('0x21')]:_0x133038[_0xa22e('0x22')]+_0x133038[_0xa22e('0x20')];var _0x5abb32;if(_0x1387f3>=_0x47522b){_0x1387f3=_0x47522b;_0x5abb32=0xc8;}else{_0x5abb32=0xce;}_0x227d6c[_0xa22e('0x1d')](_0x5abb32);return _0x227d6c[_0xa22e('0x23')]('Content-Range',_0x13d055+'-'+_0x1387f3+'/'+_0x47522b)[_0xa22e('0x1e')](_0x3cb97e);}return null;};}function saveUpdates(_0x2a045c){return function(_0x21e539){if(_0x21e539){return _0x21e539[_0xa22e('0x24')](_0x2a045c)['then'](function(_0x337f09){return _0x337f09;});}return null;};}function removeEntity(_0x421e9c){return function(_0x140e08){if(_0x140e08){return _0x140e08[_0xa22e('0x25')]()[_0xa22e('0x12')](function(){var _0x3f5c89=_0x140e08[_0xa22e('0x26')]({'plain':!![]});var _0x2de1f8='ChatWebsites';return db['UserProfileResource'][_0xa22e('0x25')]({'where':{'type':_0x2de1f8,'resourceId':_0x3f5c89['id']}})[_0xa22e('0x12')](function(){return _0x140e08;});})[_0xa22e('0x12')](function(){_0x421e9c['status'](0xcc)[_0xa22e('0x27')]();});}};}function handleEntityNotFound(_0x52b9dd){return function(_0x565569){if(!_0x565569){_0x52b9dd[_0xa22e('0x1c')](0x194);}return _0x565569;};}function handleError(_0x15434c,_0x2683af){_0x2683af=_0x2683af||0x1f4;return function(_0x2127c4){logger[_0xa22e('0x17')](_0x2127c4[_0xa22e('0x28')]);if(_0x2127c4[_0xa22e('0x29')]){delete _0x2127c4[_0xa22e('0x29')];}_0x15434c[_0xa22e('0x1d')](_0x2683af)['send'](_0x2127c4);};}exports['index']=function(_0x4eca7c,_0x1c79a5){var _0x4a0cdd={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2fc728={},_0x5435b4={'count':0x0,'rows':[]};var _0x29fb3f=_[_0xa22e('0x2a')](db[_0xa22e('0x2b')]['rawAttributes'],function(_0x2c18a6){return{'name':_0x2c18a6['fieldName'],'type':_0x2c18a6[_0xa22e('0x2c')][_0xa22e('0x2d')]};});_0x2fc728['model']=_['map'](_0x29fb3f,_0xa22e('0x29'));_0x2fc728[_0xa22e('0x2e')]=_['keys'](_0x4eca7c[_0xa22e('0x2e')]);_0x2fc728['filters']=_[_0xa22e('0x2f')](_0x2fc728['model'],_0x2fc728[_0xa22e('0x2e')]);_0x4a0cdd['attributes']=_[_0xa22e('0x2f')](_0x2fc728[_0xa22e('0x30')],qs['fields'](_0x4eca7c['query'][_0xa22e('0x31')]));_0x4a0cdd[_0xa22e('0x32')]=_0x4a0cdd[_0xa22e('0x32')][_0xa22e('0x33')]?_0x4a0cdd[_0xa22e('0x32')]:_0x2fc728[_0xa22e('0x30')];if(!_0x4eca7c[_0xa22e('0x2e')][_0xa22e('0x34')](_0xa22e('0x35'))){_0x4a0cdd[_0xa22e('0x20')]=qs[_0xa22e('0x20')](_0x4eca7c[_0xa22e('0x2e')][_0xa22e('0x20')]);_0x4a0cdd[_0xa22e('0x22')]=qs['offset'](_0x4eca7c['query']['offset']);}_0x4a0cdd[_0xa22e('0x36')]=qs['sort'](_0x4eca7c[_0xa22e('0x2e')]['sort']);_0x4a0cdd[_0xa22e('0x37')]=qs[_0xa22e('0x38')](_[_0xa22e('0x39')](_0x4eca7c[_0xa22e('0x2e')],_0x2fc728['filters']),_0x29fb3f);if(_0x4eca7c[_0xa22e('0x2e')][_0xa22e('0x3a')]){_0x4a0cdd[_0xa22e('0x37')]=_[_0xa22e('0x3b')](_0x4a0cdd[_0xa22e('0x37')],{'$or':_[_0xa22e('0x2a')](_0x29fb3f,function(_0x3aeec8){if(_0x3aeec8[_0xa22e('0x2c')]!==_0xa22e('0x3c')){var _0x56955e={};_0x56955e[_0x3aeec8['name']]={'$like':'%'+_0x4eca7c[_0xa22e('0x2e')][_0xa22e('0x3a')]+'%'};return _0x56955e;}})});}_0x4a0cdd=_['merge']({},_0x4a0cdd,_0x4eca7c['options']);var _0x3e5943={'where':_0x4a0cdd[_0xa22e('0x37')]};return db['ChatWebsite'][_0xa22e('0x21')](_0x3e5943)[_0xa22e('0x12')](function(_0x96d2a9){_0x5435b4[_0xa22e('0x21')]=_0x96d2a9;if(_0x4eca7c[_0xa22e('0x2e')][_0xa22e('0x3d')]){_0x4a0cdd[_0xa22e('0x3e')]=[{'all':!![]}];}return db['ChatWebsite'][_0xa22e('0x3f')](_0x4a0cdd);})['then'](function(_0x332ab4){_0x5435b4['rows']=_0x332ab4;return _0x5435b4;})[_0xa22e('0x12')](respondWithFilteredResult(_0x1c79a5,_0x4a0cdd))[_0xa22e('0x1b')](handleError(_0x1c79a5,null));};exports['show']=function(_0x46a9cf,_0x50e76a){var _0x451519={'raw':![],'where':{'id':_0x46a9cf['params']['id']},'include':[{'model':db[_0xa22e('0x40')],'as':_0xa22e('0x41')}]},_0x5e05ee={};_0x5e05ee[_0xa22e('0x30')]=_[_0xa22e('0x42')](db[_0xa22e('0x2b')][_0xa22e('0x43')]);_0x5e05ee['query']=_['keys'](_0x46a9cf[_0xa22e('0x2e')]);_0x5e05ee[_0xa22e('0x38')]=_['intersection'](_0x5e05ee['model'],_0x5e05ee[_0xa22e('0x2e')]);_0x451519['attributes']=_[_0xa22e('0x2f')](_0x5e05ee[_0xa22e('0x30')],qs[_0xa22e('0x31')](_0x46a9cf[_0xa22e('0x2e')][_0xa22e('0x31')]));_0x451519[_0xa22e('0x32')]=_0x451519[_0xa22e('0x32')][_0xa22e('0x33')]?_0x451519[_0xa22e('0x32')]:_0x5e05ee['model'];if(_0x46a9cf[_0xa22e('0x2e')]['includeAll']){_0x451519[_0xa22e('0x3e')]=[{'all':!![]}];}_0x451519=_[_0xa22e('0x3b')]({},_0x451519,_0x46a9cf['options']);return db[_0xa22e('0x2b')][_0xa22e('0x44')](_0x451519)[_0xa22e('0x12')](handleEntityNotFound(_0x50e76a,null))[_0xa22e('0x12')](respondWithResult(_0x50e76a,null))[_0xa22e('0x1b')](handleError(_0x50e76a,null));};exports[_0xa22e('0x45')]=function(_0x1f0b41,_0x5916a7){return db[_0xa22e('0x2b')][_0xa22e('0x45')](_0x1f0b41[_0xa22e('0x46')],{})[_0xa22e('0x12')](function(_0x39be68){var _0xc980c4=_0x1f0b41['user']['get']({'plain':!![]});if(!_0xc980c4)throw new Error(_0xa22e('0x47'));if(_0xc980c4[_0xa22e('0x48')]==='user'){var _0x1fa320=_0x39be68[_0xa22e('0x26')]({'plain':!![]});var _0x52568b=_0xa22e('0x49');return db[_0xa22e('0x4a')][_0xa22e('0x44')]({'where':{'name':_0x52568b,'userProfileId':_0xc980c4[_0xa22e('0x4b')]},'raw':!![]})['then'](function(_0x7101c8){if(_0x7101c8&&_0x7101c8[_0xa22e('0x4c')]===0x0){return db[_0xa22e('0x4d')][_0xa22e('0x45')]({'name':_0x1fa320[_0xa22e('0x29')],'resourceId':_0x1fa320['id'],'type':_0x7101c8[_0xa22e('0x29')],'sectionId':_0x7101c8['id']},{})[_0xa22e('0x12')](function(){return _0x39be68;});}else{return _0x39be68;}})[_0xa22e('0x1b')](function(_0x4d467e){logger[_0xa22e('0x17')](_0xa22e('0x4e'),_0x4d467e);throw _0x4d467e;});}return _0x39be68;})[_0xa22e('0x12')](respondWithResult(_0x5916a7,0xc9))[_0xa22e('0x1b')](handleError(_0x5916a7,null));};exports[_0xa22e('0x24')]=function(_0x2d5255,_0x26d9fa){if(_0x2d5255[_0xa22e('0x46')]['id']){delete _0x2d5255[_0xa22e('0x46')]['id'];}return db[_0xa22e('0x2b')]['find']({'where':{'id':_0x2d5255[_0xa22e('0x4f')]['id']},'include':[{'model':db[_0xa22e('0x40')],'as':_0xa22e('0x41')}]})['then'](handleEntityNotFound(_0x26d9fa,null))[_0xa22e('0x12')](saveUpdates(_0x2d5255['body'],null))[_0xa22e('0x12')](respondWithResult(_0x26d9fa,null))['catch'](handleError(_0x26d9fa,null));};exports[_0xa22e('0x25')]=function(_0x4255a6,_0xaebe7e){return db[_0xa22e('0x2b')][_0xa22e('0x44')]({'where':{'id':_0x4255a6[_0xa22e('0x4f')]['id']}})['then'](handleEntityNotFound(_0xaebe7e,null))['then'](removeEntity(_0xaebe7e,null))['catch'](handleError(_0xaebe7e,null));};exports[_0xa22e('0x50')]=function(_0x38e41a,_0x1aacf4){return db[_0xa22e('0x2b')][_0xa22e('0x50')]()[_0xa22e('0x12')](respondWithResult(_0x1aacf4,null))['catch'](handleError(_0x1aacf4,null));};exports[_0xa22e('0x51')]=function(_0x131ff0,_0x3f5a0e){if(_0x131ff0[_0xa22e('0x46')]['id']){delete _0x131ff0[_0xa22e('0x46')]['id'];}return db[_0xa22e('0x2b')][_0xa22e('0x44')]({'where':{'id':_0x131ff0['params']['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x3f5a0e,null))[_0xa22e('0x12')](function(_0x59ec6a){if(_0x59ec6a){_0x131ff0['body'][_0xa22e('0x52')]=_0x59ec6a['id'];return db[_0xa22e('0x53')][_0xa22e('0x45')](_0x131ff0[_0xa22e('0x46')]);}})[_0xa22e('0x12')](respondWithResult(_0x3f5a0e,null))['catch'](handleError(_0x3f5a0e,null));};exports[_0xa22e('0x54')]=function(_0x1df760,_0x38ea33){var _0xa4777b={'raw':![],'where':{}};var _0x5d3273={};var _0x4ec2d3={'count':0x0,'rows':[]};return db[_0xa22e('0x2b')][_0xa22e('0x55')]({'where':{'id':_0x1df760['params']['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x38ea33,null))['then'](function(_0x42643c){if(_0x42643c){_0x5d3273['model']=_['keys'](db[_0xa22e('0x53')][_0xa22e('0x43')]);_0x5d3273[_0xa22e('0x2e')]=_[_0xa22e('0x42')](_0x1df760[_0xa22e('0x2e')]);_0x5d3273[_0xa22e('0x38')]=_[_0xa22e('0x2f')](_0x5d3273[_0xa22e('0x30')],_0x5d3273[_0xa22e('0x2e')]);_0xa4777b['attributes']=_[_0xa22e('0x2f')](_0x5d3273[_0xa22e('0x30')],qs[_0xa22e('0x31')](_0x1df760['query'][_0xa22e('0x31')]));_0xa4777b[_0xa22e('0x32')]=_0xa4777b['attributes'][_0xa22e('0x33')]?_0xa4777b['attributes']:_0x5d3273['model'];if(!_0x1df760[_0xa22e('0x2e')][_0xa22e('0x34')](_0xa22e('0x35'))){_0xa4777b[_0xa22e('0x20')]=qs['limit'](_0x1df760[_0xa22e('0x2e')][_0xa22e('0x20')]);_0xa4777b['offset']=qs['offset'](_0x1df760[_0xa22e('0x2e')][_0xa22e('0x22')]);}_0xa4777b[_0xa22e('0x36')]=qs[_0xa22e('0x56')](_0x1df760[_0xa22e('0x2e')]['sort']);_0xa4777b[_0xa22e('0x37')]=qs[_0xa22e('0x38')](_[_0xa22e('0x39')](_0x1df760['query'],_0x5d3273[_0xa22e('0x38')]));_0xa4777b[_0xa22e('0x37')][_0xa22e('0x52')]=_0x42643c['id'];if(_0x1df760[_0xa22e('0x2e')][_0xa22e('0x3a')]){_0xa4777b['where']=_[_0xa22e('0x3b')](_0xa4777b[_0xa22e('0x37')],{'$or':_['map'](_0xa4777b[_0xa22e('0x32')],function(_0x443823){var _0x51ddf2={};_0x51ddf2[_0x443823]={'$like':'%'+_0x1df760[_0xa22e('0x2e')][_0xa22e('0x3a')]+'%'};return _0x51ddf2;})});}_0xa4777b=_[_0xa22e('0x3b')]({},_0xa4777b,_0x1df760[_0xa22e('0x57')]);return db[_0xa22e('0x53')]['count']({'where':_0xa4777b['where']})[_0xa22e('0x12')](function(_0x4ee193){_0x4ec2d3[_0xa22e('0x21')]=_0x4ee193;if(_0x1df760[_0xa22e('0x2e')][_0xa22e('0x3d')]){_0xa4777b[_0xa22e('0x3e')]=[{'all':!![]}];}return db[_0xa22e('0x53')][_0xa22e('0x3f')](_0xa4777b);})[_0xa22e('0x12')](function(_0x5c3947){_0x4ec2d3[_0xa22e('0x58')]=_0x5c3947;return _0x4ec2d3;});}})[_0xa22e('0x12')](respondWithFilteredResult(_0x38ea33,_0xa4777b))[_0xa22e('0x1b')](handleError(_0x38ea33,null));};exports[_0xa22e('0x59')]=function(_0x378fdc,_0x5c5240){return db[_0xa22e('0x2b')]['find']({'where':{'id':_0x378fdc[_0xa22e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5c5240,null))['then'](function(_0x5bf6ae){if(_0x5bf6ae){return _0x5bf6ae[_0xa22e('0x59')](_0x378fdc[_0xa22e('0x2e')][_0xa22e('0x5a')]);}})[_0xa22e('0x12')](respondWithStatusCode(_0x5c5240,null))[_0xa22e('0x1b')](handleError(_0x5c5240,null));};exports[_0xa22e('0x5b')]=function(_0x2be1c1,_0x404b67){if(_0x2be1c1[_0xa22e('0x46')]['id']){delete _0x2be1c1[_0xa22e('0x46')]['id'];}return db[_0xa22e('0x2b')][_0xa22e('0x44')]({'where':{'id':_0x2be1c1[_0xa22e('0x4f')]['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x404b67,null))[_0xa22e('0x12')](function(_0x37b2b9){if(_0x37b2b9){_0x2be1c1[_0xa22e('0x46')]['ChatWebsiteId']=_0x37b2b9['id'];return db[_0xa22e('0x5c')][_0xa22e('0x45')](_0x2be1c1[_0xa22e('0x46')]);}})['then'](respondWithResult(_0x404b67,null))[_0xa22e('0x1b')](handleError(_0x404b67,null));};exports[_0xa22e('0x5d')]=function(_0x226b3a,_0x302855){var _0x3d1ac9={'raw':![],'where':{}};var _0x468549={};var _0x458bf6={'count':0x0,'rows':[]};return db[_0xa22e('0x2b')][_0xa22e('0x55')]({'where':{'id':_0x226b3a[_0xa22e('0x4f')]['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x302855,null))[_0xa22e('0x12')](function(_0x1fb819){if(_0x1fb819){_0x468549['model']=_[_0xa22e('0x42')](db[_0xa22e('0x5c')][_0xa22e('0x43')]);_0x468549[_0xa22e('0x2e')]=_['keys'](_0x226b3a['query']);_0x468549[_0xa22e('0x38')]=_[_0xa22e('0x2f')](_0x468549['model'],_0x468549['query']);_0x3d1ac9[_0xa22e('0x32')]=_[_0xa22e('0x2f')](_0x468549[_0xa22e('0x30')],qs[_0xa22e('0x31')](_0x226b3a[_0xa22e('0x2e')][_0xa22e('0x31')]));_0x3d1ac9['attributes']=_0x3d1ac9[_0xa22e('0x32')]['length']?_0x3d1ac9[_0xa22e('0x32')]:_0x468549[_0xa22e('0x30')];if(!_0x226b3a[_0xa22e('0x2e')][_0xa22e('0x34')]('nolimit')){_0x3d1ac9['limit']=qs[_0xa22e('0x20')](_0x226b3a['query'][_0xa22e('0x20')]);_0x3d1ac9[_0xa22e('0x22')]=qs[_0xa22e('0x22')](_0x226b3a[_0xa22e('0x2e')]['offset']);}_0x3d1ac9[_0xa22e('0x36')]=qs[_0xa22e('0x56')](_0x226b3a['query'][_0xa22e('0x56')]);_0x3d1ac9[_0xa22e('0x37')]=qs['filters'](_[_0xa22e('0x39')](_0x226b3a[_0xa22e('0x2e')],_0x468549[_0xa22e('0x38')]));_0x3d1ac9[_0xa22e('0x37')][_0xa22e('0x52')]=_0x1fb819['id'];if(_0x226b3a[_0xa22e('0x2e')][_0xa22e('0x3a')]){_0x3d1ac9['where']=_[_0xa22e('0x3b')](_0x3d1ac9[_0xa22e('0x37')],{'$or':_[_0xa22e('0x2a')](_0x3d1ac9[_0xa22e('0x32')],function(_0xb52c3a){var _0x260b08={};_0x260b08[_0xb52c3a]={'$like':'%'+_0x226b3a['query'][_0xa22e('0x3a')]+'%'};return _0x260b08;})});}_0x3d1ac9=_[_0xa22e('0x3b')]({},_0x3d1ac9,_0x226b3a[_0xa22e('0x57')]);return db[_0xa22e('0x5c')][_0xa22e('0x21')]({'where':_0x3d1ac9[_0xa22e('0x37')]})[_0xa22e('0x12')](function(_0x127945){_0x458bf6[_0xa22e('0x21')]=_0x127945;if(_0x226b3a[_0xa22e('0x2e')][_0xa22e('0x3d')]){_0x3d1ac9[_0xa22e('0x3e')]=[{'all':!![]}];}return db[_0xa22e('0x5c')][_0xa22e('0x3f')](_0x3d1ac9);})[_0xa22e('0x12')](function(_0x4afd01){_0x458bf6[_0xa22e('0x58')]=_0x4afd01;return _0x458bf6;});}})[_0xa22e('0x12')](respondWithFilteredResult(_0x302855,_0x3d1ac9))[_0xa22e('0x1b')](handleError(_0x302855,null));};exports[_0xa22e('0x5e')]=function(_0x2f385e,_0x8efd0){return db['ChatWebsite']['find']({'where':{'id':_0x2f385e[_0xa22e('0x4f')]['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x8efd0,null))[_0xa22e('0x12')](function(_0x57e8ad){if(_0x57e8ad){return _0x57e8ad[_0xa22e('0x5e')](_0x2f385e[_0xa22e('0x2e')]['ids']);}})[_0xa22e('0x12')](respondWithStatusCode(_0x8efd0,null))[_0xa22e('0x1b')](handleError(_0x8efd0,null));};exports[_0xa22e('0x5f')]=function(_0x153031,_0x58281c){_0x153031[_0xa22e('0x46')]['sitepic']=_0x153031[_0xa22e('0x60')][_0xa22e('0x61')];return db[_0xa22e('0x2b')]['find']({'where':{'id':_0x153031['params']['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x58281c,null))[_0xa22e('0x12')](saveUpdates(_0x153031['body'],null))[_0xa22e('0x12')](respondWithResult(_0x58281c,null))[_0xa22e('0x1b')](handleError(_0x58281c,null));};exports[_0xa22e('0x62')]=function(_0x531aef,_0x177d05){_0x531aef[_0xa22e('0x46')][_0xa22e('0x63')]=_0x531aef[_0xa22e('0x60')][_0xa22e('0x61')];return db['ChatWebsite']['find']({'where':{'id':_0x531aef['params']['id']}})['then'](handleEntityNotFound(_0x177d05,null))[_0xa22e('0x12')](saveUpdates(_0x531aef['body'],null))[_0xa22e('0x12')](respondWithResult(_0x177d05,null))[_0xa22e('0x1b')](handleError(_0x177d05,null));};exports[_0xa22e('0x64')]=function(_0x1c6894,_0x52014e){_0x1c6894[_0xa22e('0x46')][_0xa22e('0x65')]=_0x1c6894[_0xa22e('0x60')][_0xa22e('0x61')];return db[_0xa22e('0x2b')][_0xa22e('0x44')]({'where':{'id':_0x1c6894[_0xa22e('0x4f')]['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x52014e,null))[_0xa22e('0x12')](saveUpdates(_0x1c6894['body'],null))['then'](respondWithResult(_0x52014e,null))[_0xa22e('0x1b')](handleError(_0x52014e,null));};exports[_0xa22e('0x66')]=function(_0x401683,_0x48ab17){_0x401683[_0xa22e('0x46')][_0xa22e('0x67')]=_0x401683[_0xa22e('0x60')][_0xa22e('0x61')];return db[_0xa22e('0x2b')][_0xa22e('0x44')]({'where':{'id':_0x401683[_0xa22e('0x4f')]['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x48ab17,null))[_0xa22e('0x12')](saveUpdates(_0x401683[_0xa22e('0x46')],null))[_0xa22e('0x12')](respondWithResult(_0x48ab17,null))[_0xa22e('0x1b')](handleError(_0x48ab17,null));};exports['getLogo']=function(_0x5e4500,_0x45cbb2){var _0x46196c=path['join'](config[_0xa22e('0x68')],_0xa22e('0x69'));var _0x1c66b2={'where':{'id':_0x5e4500[_0xa22e('0x4f')]['id']},'attributes':['id',_0xa22e('0x6a')],'raw':!![]};var _0x1b2581=![];return require(_0xa22e('0x6b'))['getLicense']()[_0xa22e('0x12')](function(_0xf800e1){if(_0xf800e1){_0x1b2581=_0xf800e1[_0xa22e('0x6c')];}})[_0xa22e('0x12')](function(){return db[_0xa22e('0x2b')][_0xa22e('0x44')](_0x1c66b2);})['then'](handleEntityNotFound(_0x45cbb2,null))['then'](function(_0x127947){if(_0x127947){if(!_[_0xa22e('0x6d')](_0x127947[_0xa22e('0x6a')])){if(fs[_0xa22e('0x6e')](path['join'](config[_0xa22e('0x68')],'server/files/images/logos/',_0x127947[_0xa22e('0x6a')]))&&_0x1b2581){_0x46196c=path[_0xa22e('0x6f')](config[_0xa22e('0x68')],_0xa22e('0x70'),_0x127947[_0xa22e('0x6a')]);}}return _0x45cbb2['download'](_0x46196c);}})[_0xa22e('0x1b')](handleError(_0x45cbb2,null));};exports[_0xa22e('0x71')]=function(_0x4fd2c6,_0x4b265d){var _0x1536a9=path[_0xa22e('0x6f')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x4d0a11={'where':{'id':_0x4fd2c6[_0xa22e('0x4f')]['id']},'attributes':['id',_0xa22e('0x63')],'raw':!![]};return db[_0xa22e('0x2b')][_0xa22e('0x44')](_0x4d0a11)[_0xa22e('0x12')](handleEntityNotFound(_0x4b265d,null))[_0xa22e('0x12')](function(_0x320837){if(_0x320837){if(!_['isNil'](_0x320837[_0xa22e('0x63')])){if(fs[_0xa22e('0x6e')](path[_0xa22e('0x6f')](config[_0xa22e('0x68')],_0xa22e('0x72'),_0x320837[_0xa22e('0x63')]))){_0x1536a9=path[_0xa22e('0x6f')](config[_0xa22e('0x68')],_0xa22e('0x72'),_0x320837[_0xa22e('0x63')]);}}return _0x4b265d[_0xa22e('0x73')](_0x1536a9);}})[_0xa22e('0x1b')](handleError(_0x4b265d,null));};exports[_0xa22e('0x74')]=function(_0x47f554,_0x5f0b97){var _0x2da203=path[_0xa22e('0x6f')](config['root'],_0xa22e('0x75'));var _0x5e27d5={'where':{'id':_0x47f554[_0xa22e('0x4f')]['id']},'attributes':['id',_0xa22e('0x65'),_0xa22e('0x76')],'raw':!![]};return db[_0xa22e('0x2b')][_0xa22e('0x44')](_0x5e27d5)[_0xa22e('0x12')](handleEntityNotFound(_0x5f0b97,null))[_0xa22e('0x12')](function(_0x17d742){if(_0x17d742){if(!_['isNil'](_0x17d742[_0xa22e('0x65')])){if(fs[_0xa22e('0x6e')](path[_0xa22e('0x6f')](config[_0xa22e('0x68')],_0xa22e('0x72'),_0x17d742[_0xa22e('0x65')]))&&_0x17d742[_0xa22e('0x76')]){_0x2da203=path[_0xa22e('0x6f')](config[_0xa22e('0x68')],_0xa22e('0x72'),_0x17d742[_0xa22e('0x65')]);}}return _0x5f0b97['download'](_0x2da203);}})[_0xa22e('0x1b')](handleError(_0x5f0b97,null));};exports[_0xa22e('0x77')]=function(_0x36f1cc,_0x537fc9){var _0x568ea4=path[_0xa22e('0x6f')](config[_0xa22e('0x68')],_0xa22e('0x78'));var _0x4724cd={'where':{'id':_0x36f1cc[_0xa22e('0x4f')]['id']},'attributes':['id',_0xa22e('0x67')],'raw':!![]};return db['ChatWebsite'][_0xa22e('0x44')](_0x4724cd)['then'](handleEntityNotFound(_0x537fc9,null))['then'](function(_0x42b25e){if(_0x42b25e){if(!_[_0xa22e('0x6d')](_0x42b25e['systemAvatar'])){if(fs[_0xa22e('0x6e')](path[_0xa22e('0x6f')](config[_0xa22e('0x68')],_0xa22e('0x72'),_0x42b25e[_0xa22e('0x67')]))){_0x568ea4=path[_0xa22e('0x6f')](config['root'],_0xa22e('0x72'),_0x42b25e[_0xa22e('0x67')]);}}return _0x537fc9[_0xa22e('0x73')](_0x568ea4);}})[_0xa22e('0x1b')](handleError(_0x537fc9,null));};exports[_0xa22e('0x79')]=function(_0x1b36db,_0x506c63){var _0x153117=require(_0xa22e('0x7a'));var _0x3ed0fa=new _0x153117();var _0x3b6a33=_0x3ed0fa[_0xa22e('0x7b')](_0x1b36db['headers'][_0xa22e('0x7c')])[_0xa22e('0x7d')]();var _0xf65ff0={'body':_0x1b36db[_0xa22e('0x46')],'channel':'chat'};var _0x34debb=[];var _0x11c05a=[];var _0x125634={};var _0x1f0fe4=![];return db[_0xa22e('0x7e')]['describe']()[_0xa22e('0x12')](function(_0x49c55c){if(!_0x49c55c){throw new db[(_0xa22e('0x7f'))][(_0xa22e('0x80'))](_0xa22e('0x81'));}_0x34debb=_[_0xa22e('0x82')](_[_0xa22e('0x42')](_0x49c55c),[_0xa22e('0x83'),_0xa22e('0x84')]);_0x11c05a=_[_0xa22e('0x82')](_['keys'](_0x49c55c),[_0xa22e('0x83'),_0xa22e('0x84'),_0xa22e('0x85'),_0xa22e('0x86')]);if(_0x1b36db[_0xa22e('0x46')]['id']){delete _0x1b36db[_0xa22e('0x46')]['id'];}if(_['isNil'](_0x1b36db[_0xa22e('0x46')][_0xa22e('0x87')])){throw new db[(_0xa22e('0x7f'))][(_0xa22e('0x80'))](_0xa22e('0x88'));}if(_[_0xa22e('0x6d')](_0x1b36db['body'][_0xa22e('0x46')])||_0x1b36db[_0xa22e('0x46')][_0xa22e('0x46')]===''){throw new db[(_0xa22e('0x7f'))][(_0xa22e('0x80'))](_0xa22e('0x89'));}if(_[_0xa22e('0x6d')](_0x1b36db[_0xa22e('0x46')][_0xa22e('0x8a')])){throw new db[(_0xa22e('0x7f'))][(_0xa22e('0x80'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x11c05a);}if(!_[_0xa22e('0x8b')](_0x11c05a,_0x1b36db['body'][_0xa22e('0x8a')])){throw new db[(_0xa22e('0x7f'))][(_0xa22e('0x80'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x11c05a);}_0x125634[_0x1b36db[_0xa22e('0x46')][_0xa22e('0x8a')]]=_0x1b36db[_0xa22e('0x46')][_0xa22e('0x87')];})['then'](function(){return db[_0xa22e('0x2b')]['find']({'where':{'id':_0x1b36db[_0xa22e('0x4f')]['id']},'include':[{'model':db[_0xa22e('0x8c')],'as':_0xa22e('0x8d'),'include':[{'model':db[_0xa22e('0x7e')],'as':_0xa22e('0x8e'),'where':_0x125634,'limit':0x1,'order':[[_0xa22e('0x84'),_0xa22e('0x8f')]]}]},{'model':db[_0xa22e('0x90')],'as':_0xa22e('0x91')}]});})[_0xa22e('0x12')](handleEntityNotFound(_0x506c63,null))['then'](function(_0x105aa5){if(_0x105aa5&&_0x105aa5[_0xa22e('0x8d')]){_0xf65ff0[_0xa22e('0x92')]=_0x105aa5;_0xf65ff0[_0xa22e('0x93')]=_0x105aa5[_0xa22e('0x91')];_0xf65ff0['list']=_0x105aa5['List'];_0xf65ff0[_0xa22e('0x93')]=_[_0xa22e('0x94')](_0xf65ff0[_0xa22e('0x93')],[_0xa22e('0x95')],[_0xa22e('0x96')]);if(_0xf65ff0[_0xa22e('0x92')][_0xa22e('0x91')]){delete _0xf65ff0[_0xa22e('0x92')][_0xa22e('0x91')];}if(_0xf65ff0[_0xa22e('0x92')]['List']&&_0xf65ff0[_0xa22e('0x92')][_0xa22e('0x8d')][_0xa22e('0x8e')][_0xa22e('0x33')]){return _0xf65ff0[_0xa22e('0x92')][_0xa22e('0x8d')][_0xa22e('0x8e')][0x0];}var _0x44005d=_[_0xa22e('0x97')](_0x1b36db[_0xa22e('0x46')],{'firstName':_0x1b36db[_0xa22e('0x46')][_0xa22e('0x87')],'ListId':_0x105aa5[_0xa22e('0x86')]});_0x44005d[_0x1b36db[_0xa22e('0x46')][_0xa22e('0x8a')]]=_0x1b36db[_0xa22e('0x46')]['from'];return db['CmContact'][_0xa22e('0x45')](_0x44005d,{'fields':_0x34debb,'raw':!![]});}})[_0xa22e('0x12')](handleEntityNotFound(_0x506c63,null))[_0xa22e('0x12')](function(_0x567651){_0xf65ff0[_0xa22e('0x98')]=_0x567651;var _0x24fed9=_0x1b36db[_0xa22e('0x46')][_0xa22e('0x99')];if(_0x1b36db[_0xa22e('0x9a')][_0xa22e('0x9b')]){_0x24fed9=_0x1b36db[_0xa22e('0x9a')][_0xa22e('0x9b')];}else if(_0x1b36db['headers'][_0xa22e('0x9c')]){_0x24fed9=_[_0xa22e('0x9d')](_0x1b36db['headers'][_0xa22e('0x9c')][_0xa22e('0x9e')](','));}if(_0x567651){var _0x23654e={'ContactId':_0x567651['id'],'ChatWebsiteId':_0x1b36db[_0xa22e('0x4f')]['id'],'from':(_0x567651[_0xa22e('0x9f')]||'')+'\x20'+(_0x567651[_0xa22e('0xa0')]||''),'customerIp':_0x24fed9,'customerPort':_0x1b36db[_0xa22e('0x9a')][_0xa22e('0xa1')]?_0x1b36db['headers'][_0xa22e('0xa1')]:null,'referer':_0x1b36db[_0xa22e('0x46')][_0xa22e('0xa2')],'browserName':_0x3b6a33['browser'][_0xa22e('0x29')]&&_0x3b6a33['browser'][_0xa22e('0xa3')]?util[_0xa22e('0xa4')](_0xa22e('0xa5'),_0x3b6a33[_0xa22e('0xa6')][_0xa22e('0x29')],_0x3b6a33[_0xa22e('0xa6')][_0xa22e('0xa3')]):_0xa22e('0xa7'),'browserVersion':_0x3b6a33[_0xa22e('0xa6')][_0xa22e('0xa3')]||_0xa22e('0xa7'),'osName':util['format'](_0xa22e('0xa5'),_0x3b6a33['os'][_0xa22e('0x29')],_0x3b6a33['os']['version']),'osVersion':_0x3b6a33['os'][_0xa22e('0xa3')],'deviceModel':_0x3b6a33[_0xa22e('0xa8')][_0xa22e('0x30')]&&_0x3b6a33[_0xa22e('0xa8')][_0xa22e('0xa9')]?util['format'](_0xa22e('0xaa'),_0x3b6a33[_0xa22e('0xa8')][_0xa22e('0x30')],_0x3b6a33['device'][_0xa22e('0xa9')],_0x3b6a33['device'][_0xa22e('0x2c')]):null,'deviceVendor':_0x3b6a33[_0xa22e('0xa8')][_0xa22e('0xa9')],'deviceType':_0x3b6a33['device']['type'],'formData':JSON['stringify'](_0x1b36db[_0xa22e('0x46')])};var _0x1be673={'ChatWebsiteId':_0x1b36db['params']['id'],'closed':![]};if(_0x1b36db[_0xa22e('0x46')][_0xa22e('0xab')]){_0x1be673[_0xa22e('0xab')]=_0x1b36db[_0xa22e('0x46')]['threadId'];return db[_0xa22e('0xac')][_0xa22e('0x44')]({'where':_0x1be673})[_0xa22e('0x12')](function(_0x3cfcd7){if(_0x3cfcd7){return[_0x3cfcd7,![]];}_0x23654e[_0xa22e('0xab')]=_0x1b36db[_0xa22e('0x46')][_0xa22e('0xab')];_0x23654e[_0xa22e('0xad')]=_0x1b36db[_0xa22e('0x46')][_0xa22e('0xad')];return db[_0xa22e('0xac')]['create'](_0x23654e)[_0xa22e('0x12')](function(_0x192926){return[_0x192926,!![]];});});}_0x1be673[_0xa22e('0xae')]=_0x567651['id'];if(_0x1b36db['body']['interaction']&&_0x1b36db[_0xa22e('0x46')][_0xa22e('0xaf')]['id']){_0x1be673['id']=_0x1b36db['body']['interaction']['id'];return db[_0xa22e('0xac')][_0xa22e('0x44')]({'where':_0x1be673})[_0xa22e('0x12')](function(_0x3385b4){if(_0x3385b4){return[_0x3385b4,![]];}return db['ChatInteraction'][_0xa22e('0x45')](_0x23654e)[_0xa22e('0x12')](function(_0x3d1bc9){return[_0x3d1bc9,!![]];});});}return db[_0xa22e('0xac')][_0xa22e('0x45')](_0x23654e)[_0xa22e('0x12')](function(_0x453a46){return[_0x453a46,!![]];});}})[_0xa22e('0xb0')](function(_0x188a18,_0x29551a){if(_0x188a18){_0x1f0fe4=_0x29551a;if(!_0x29551a){var _0x3ce2ee={'from':(_0xf65ff0['contact'][_0xa22e('0x9f')]||'')+'\x20'+(_0xf65ff0['contact'][_0xa22e('0xa0')]||'')};if(_0x1b36db[_0xa22e('0x46')][_0xa22e('0xab')]&&_0x1b36db[_0xa22e('0x46')][_0xa22e('0xb1')]&&_0x1b36db['body'][_0xa22e('0xab')]!=_0x1b36db['body'][_0xa22e('0xb1')]){_0x3ce2ee['threadId']=_0x1b36db[_0xa22e('0x46')][_0xa22e('0xb1')];}return _0x188a18[_0xa22e('0x24')](_0x3ce2ee);}else{return _0x188a18;}}})['then'](function(_0x41b291){_0xf65ff0[_0xa22e('0xaf')]=_0x41b291[_0xa22e('0x26')]({'plain':!![]});_0xf65ff0[_0xa22e('0xaf')]['created']=_0x1f0fe4;if(_0xf65ff0[_0xa22e('0xaf')]['created']){if(_0xf65ff0[_0xa22e('0x92')]['autoclose']){_0xf65ff0[_0xa22e('0x93')][_0xa22e('0xb2')]({'id':0x0,'priority':_0xf65ff0['applications']['length']+0x1,'app':_0xa22e('0xb3'),'appdata':_0xa22e('0xb4'),'interval':_0xa22e('0xb5')});}}return db[_0xa22e('0xb6')][_0xa22e('0x45')]({'body':_0x1b36db[_0xa22e('0x46')][_0xa22e('0x46')],'ChatWebsiteId':_0x1b36db[_0xa22e('0x4f')]['id'],'ChatInteractionId':_0x41b291['id'],'direction':'in','ContactId':_0xf65ff0[_0xa22e('0x98')]['id'],'AttachmentId':_0x1b36db[_0xa22e('0x46')][_0xa22e('0xb7')]});})[_0xa22e('0x12')](function(_0x494b77){_0xf65ff0[_0xa22e('0x19')]=_0x494b77;if(_0xf65ff0[_0xa22e('0xaf')][_0xa22e('0xb8')]){return db[_0xa22e('0xb9')]['find']({'attributes':['id',_0xa22e('0x29')],'where':{'id':_0xf65ff0[_0xa22e('0xaf')][_0xa22e('0xb8')]}})[_0xa22e('0x12')](function(_0xc14603){if(_0xc14603){_0xf65ff0[_0xa22e('0x93')][_0xa22e('0xba')]({'id':0x0,'priority':0x0,'app':_0xa22e('0xbb'),'appdata':_0xc14603['name']+','+(_0xf65ff0[_0xa22e('0x92')][_0xa22e('0xbc')]||0xa),'interval':_0xa22e('0xb5')});_0xf65ff0[_0xa22e('0xbd')]=!![];}return respondWithRpcPromise('Start',_0xa22e('0xbe'),_0xf65ff0);});}return respondWithRpcPromise(_0xa22e('0xbf'),'startRouting',_0xf65ff0);})[_0xa22e('0x12')](function(_0x5e1011){respondWithRpcPromise(_0xa22e('0xc0'),'EventManager',{'event':_0xa22e('0x79'),'message':_0x5e1011},client9002);return _0x5e1011;})['then'](respondWithResult(_0x506c63,null))[_0xa22e('0x1b')](handleError(_0x506c63,null));};exports[_0xa22e('0xc1')]=function(_0x48c572,_0x1cd053){var _0x57c47a,_0x354e15,_0x4077ab;var _0x3f46e0=[];var _0x4d4831={};var _0x2605db=_0x48c572[_0xa22e('0xc2')]||[];var _0x1063c9=[];var _0x41874d;return db['CmContact'][_0xa22e('0x50')]()['then'](function(_0x4e2b39){if(!_0x4e2b39){throw new db[(_0xa22e('0x7f'))][(_0xa22e('0x80'))]('no\x20available\x20attributes');}_0x3f46e0=_['difference'](_[_0xa22e('0x42')](_0x4e2b39),[_0xa22e('0x83'),_0xa22e('0x84'),'CompanyId',_0xa22e('0x86')]);if(_0x48c572[_0xa22e('0x46')]['id']){delete _0x48c572['body']['id'];}if(_['isNil'](_0x48c572[_0xa22e('0x46')][_0xa22e('0x87')])){throw _0x1cd053[_0xa22e('0x1d')](0x1f4)[_0xa22e('0xc3')](new db['Sequelize']['ValidationError'](_0xa22e('0x88')));}if(_[_0xa22e('0x6d')](_0x48c572[_0xa22e('0x46')][_0xa22e('0x46')])||_0x48c572[_0xa22e('0x46')][_0xa22e('0x46')]===''){throw _0x1cd053['status'](0x1f4)[_0xa22e('0xc3')](new db[(_0xa22e('0x7f'))][(_0xa22e('0x80'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xa22e('0x6d')](_0x48c572[_0xa22e('0x46')][_0xa22e('0xc4')])){throw _0x1cd053[_0xa22e('0x1d')](0x1f4)[_0xa22e('0xc3')](new db[(_0xa22e('0x7f'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3f46e0));}if(!_[_0xa22e('0x8b')](_0x3f46e0,_0x48c572['body'][_0xa22e('0xc4')])){throw _0x1cd053[_0xa22e('0x1d')](0x1f4)[_0xa22e('0xc3')](new db[(_0xa22e('0x7f'))][(_0xa22e('0x80'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3f46e0));}_0x4d4831[_0x48c572[_0xa22e('0x46')][_0xa22e('0xc4')]]=_0x48c572['body'][_0xa22e('0x87')];})[_0xa22e('0x12')](function(){return db['ChatWebsite'][_0xa22e('0x44')]({'where':{'id':_0x48c572['params']['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0xa22e('0xc5')],'as':'MailAccount'}]});})[_0xa22e('0x12')](handleEntityNotFound(_0x1cd053,null))[_0xa22e('0x12')](function(_0x168550){if(_0x168550&&_0x168550[_0xa22e('0x8d')]){_0x354e15=_0x168550;var _0xeb9dcc=_[_0xa22e('0x97')](_0x48c572[_0xa22e('0x46')],{'firstName':_0x48c572[_0xa22e('0x46')][_0xa22e('0x87')],'phone':_0x48c572[_0xa22e('0x46')][_0xa22e('0x87')],'ListId':_0x168550[_0xa22e('0x86')]});_0xeb9dcc[_0x48c572[_0xa22e('0x46')][_0xa22e('0xc4')]]=_0x48c572['body'][_0xa22e('0x87')];return db[_0xa22e('0x7e')][_0xa22e('0xc6')]({'where':_0x4d4831,'defaults':_0xeb9dcc});}})['spread'](function(_0x499d3e){if(_0x499d3e){_0x4077ab=_0x499d3e;var _0x3f6e5a=fs[_0xa22e('0xc7')](path[_0xa22e('0x6f')](config[_0xa22e('0x68')],'server/files/templates/chatOfflineMessage.ejs'),_0xa22e('0xc8'));var _0x53fc94=ejs['render'](_0x3f6e5a,{'body':_[_0xa22e('0xc9')](_0x48c572['body'][_0xa22e('0x46')]),'bodyTitle':_0x354e15[_0xa22e('0xca')]});return db[_0xa22e('0xcb')]['create']({'body':_0x53fc94,'plainBody':htmlToText[_0xa22e('0xcc')](_0x53fc94),'ContactId':_0x499d3e['id'],'ChatWebsiteId':_0x354e15['id']});}})[_0xa22e('0x12')](function(_0x4e795c){_0x41874d=_0x4e795c;if(_0x2605db[_0xa22e('0x33')]){var _0x5a0283=_0x2605db[_0xa22e('0x2a')](function(_0x4e4497){return{'name':_0x4e4497[_0xa22e('0xcd')],'basename':_0x4e4497[_0xa22e('0x61')],'type':_0x4e4497[_0xa22e('0xce')],'ChatOfflineMessageId':_0x4e795c['id']};});_0x1063c9=_0x5a0283[_0xa22e('0x2a')](_0x1f8029=>{var _0x15e90c={'filename':_0x1f8029['name'],'path':path['join'](config[_0xa22e('0x68')],'server',_0xa22e('0xc2'),_0xa22e('0xcf'),_0xa22e('0xd0'),_0x1f8029[_0xa22e('0xd1')])};return _0x15e90c;});if(!_0x354e15[_0xa22e('0xd2')]){return db[_0xa22e('0xd3')][_0xa22e('0xd4')](function(_0x220bb0){return db[_0xa22e('0xd5')][_0xa22e('0xd6')](_0x5a0283,{'transaction':_0x220bb0});});}}})[_0xa22e('0x12')](function(){if(_0x41874d){_0x57c47a=_0x41874d;return db[_0xa22e('0xc5')][_0xa22e('0x55')]({'where':{'service':!![]},'include':[{'model':db[_0xa22e('0xd7')],'as':_0xa22e('0xd8'),'raw':!![],'include':[{'model':db[_0xa22e('0xd9')],'as':_0xa22e('0xd9'),'raw':!![]}]}]});}})[_0xa22e('0x12')](function(_0x30cac4){if(_0x30cac4&&_0x30cac4[_0xa22e('0xd8')]&&_0x354e15['forwardOffline']&&_0x354e15['forwardOfflineAddress']){var _0xdd7780=_0x30cac4[_0xa22e('0xda')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0xdd7780,'message':{'from':util[_0xa22e('0xa4')](_0xa22e('0xdb'),_0x30cac4[_0xa22e('0x29')],_0x30cac4[_0xa22e('0xdc')]||_0x30cac4[_0xa22e('0xd8')]['user']),'to':_0x354e15[_0xa22e('0xdd')],'subject':_0x354e15[_0xa22e('0xde')],'html':_0x57c47a[_0xa22e('0x46')],'attachments':_0x1063c9}},client9003)[_0xa22e('0x12')](function(){return _0x57c47a;})[_0xa22e('0x1b')](function(_0x166cd1){logger[_0xa22e('0x17')](_0x166cd1);});}})[_0xa22e('0x12')](function(){if(_0x354e15&&_0x354e15['openNewInteraction']&&_0x354e15[_0xa22e('0xdf')]){var _0x5c634b=[];if(_0x2605db[_0xa22e('0x33')]){_0x5c634b=_0x2605db[_0xa22e('0x2a')](function(_0x19fa9b){return{'name':_0x19fa9b[_0xa22e('0xcd')],'basename':_0x19fa9b[_0xa22e('0x61')],'type':_0x19fa9b['mimetype'],'ChatOfflineMessageId':_0x41874d['id']};});}var _0x323066;if(!_[_0xa22e('0x6d')](_0x354e15[_0xa22e('0xe0')])){var _0x459e52=_[_0xa22e('0x2a')](_0x48c572['body'],function(_0x34524b){return _0x34524b;});var _0x4f520b=_[_0xa22e('0xe1')](_0x459e52)[0x0];var _0x3e1cf7=_['mapValues'](_0x4f520b,function(_0x56f001){return _0x56f001;});_0x323066=_0x3e1cf7[0x1][_0x354e15['subjectOffline']];}var _0x3f487f={'from':_0x4077ab[_0xa22e('0xdc')],'firstName':_0x4077ab[_0xa22e('0x9f')],'lastName':_0x4077ab['lastName'],'mapKey':'email','message':{'from':_0x4077ab['email'],'to':_0x354e15[_0xa22e('0xc5')][_0xa22e('0xdc')],'cc':'','subject':_[_0xa22e('0x6d')](_0x323066)?_0x354e15[_0xa22e('0xde')]:_0x323066,'messageId':'','sentAt':new Date(),'attach':_0x5c634b[_0xa22e('0x33')],'attachments':_0x5c634b,'originChannel':'Chat','ChatWebsiteId':_0x354e15['id'],'ChatOfflineMessageId':_0x57c47a['id'],'originTo':_0x354e15['MailAccount'][_0xa22e('0xdc')]},'body':_0x57c47a[_0xa22e('0x46')]};var _0x2a7935={'account':{'id':_0x354e15['MailAccountId']},'body':_0x3f487f,'log':_0xa22e('0xe2')};return respondWithRpcPromise(_0xa22e('0xe2'),_0xa22e('0xe3'),_0x2a7935,client9001)[_0xa22e('0x12')](function(){return _0x57c47a;})['catch'](function(_0x5c02d){logger[_0xa22e('0x17')](_0x5c02d);});}return;})[_0xa22e('0x12')](function(){if(_0x57c47a){return _0x57c47a;}})[_0xa22e('0x12')](respondWithResult(_0x1cd053,null))[_0xa22e('0x1b')](function(_0x5c4c66){logger['error']('catch',_0x5c4c66);for(var _0x1a2592 of _0x2605db){var _0x173284=path[_0xa22e('0x6f')](config['root'],_0xa22e('0xe4'),'files','attachments','offline-chat',_0x1a2592[_0xa22e('0x61')]);fs_extra['remove'](_0x173284)[_0xa22e('0x1b')](function(_0x131d90){logger[_0xa22e('0x17')]('Could\x20not\x20remove\x20attachment\x20file',_0x173284,_0x131d90);});}});};exports[_0xa22e('0xe5')]=function(_0x205ffc,_0x26a3ca){return db[_0xa22e('0xac')][_0xa22e('0x44')]({'where':{'id':_0x205ffc[_0xa22e('0x4f')]['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x26a3ca,null))[_0xa22e('0x12')](function(_0x3d63b5){if(_0x3d63b5){return _0x3d63b5['addInteraction'](_0x205ffc[_0xa22e('0x46')]['ids'],_['omit'](_0x205ffc[_0xa22e('0x46')],[_0xa22e('0x5a'),'id'])||{});}})[_0xa22e('0x12')](respondWithResult(_0x26a3ca,null))[_0xa22e('0x1b')](handleError(_0x26a3ca,null));};exports['getInteractions']=function(_0x1a68f5,_0x36423b){var _0x251308={'raw':![],'where':{}};var _0x32ad72={};var _0x31df37={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xa22e('0x55')]({'where':{'id':_0x1a68f5['params']['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x36423b,null))[_0xa22e('0x12')](function(_0x2e8274){if(_0x2e8274){_0x32ad72[_0xa22e('0x30')]=_[_0xa22e('0x42')](db[_0xa22e('0xac')][_0xa22e('0x43')]);_0x32ad72[_0xa22e('0x2e')]=_[_0xa22e('0x42')](_0x1a68f5['query']);_0x32ad72[_0xa22e('0x38')]=_[_0xa22e('0x2f')](_0x32ad72[_0xa22e('0x30')],_0x32ad72[_0xa22e('0x2e')]);_0x251308[_0xa22e('0x32')]=_[_0xa22e('0x2f')](_0x32ad72[_0xa22e('0x30')],qs[_0xa22e('0x31')](_0x1a68f5[_0xa22e('0x2e')][_0xa22e('0x31')]));_0x251308[_0xa22e('0x32')]=_0x251308[_0xa22e('0x32')][_0xa22e('0x33')]?_0x251308['attributes']:_0x32ad72[_0xa22e('0x30')];if(!_0x1a68f5[_0xa22e('0x2e')][_0xa22e('0x34')](_0xa22e('0x35'))){_0x251308[_0xa22e('0x20')]=qs[_0xa22e('0x20')](_0x1a68f5[_0xa22e('0x2e')][_0xa22e('0x20')]);_0x251308[_0xa22e('0x22')]=qs['offset'](_0x1a68f5[_0xa22e('0x2e')][_0xa22e('0x22')]);}_0x251308['order']=qs[_0xa22e('0x56')](_0x1a68f5[_0xa22e('0x2e')]['sort']);_0x251308[_0xa22e('0x37')]=qs[_0xa22e('0x38')](_['pick'](_0x1a68f5[_0xa22e('0x2e')],_0x32ad72[_0xa22e('0x38')]));_0x251308[_0xa22e('0x37')][_0xa22e('0x52')]=_0x2e8274['id'];if(_0x1a68f5['query'][_0xa22e('0x3a')]){_0x251308[_0xa22e('0x37')]=_[_0xa22e('0x3b')](_0x251308['where'],{'$or':_[_0xa22e('0x2a')](_0x251308['attributes'],function(_0x3bd1b7){var _0x2b93c2={};_0x2b93c2[_0x3bd1b7]={'$like':'%'+_0x1a68f5['query'][_0xa22e('0x3a')]+'%'};return _0x2b93c2;})});}_0x251308=_[_0xa22e('0x3b')]({},_0x251308,_0x1a68f5['options']);return db['ChatInteraction'][_0xa22e('0x21')]({'where':_0x251308[_0xa22e('0x37')]})['then'](function(_0x2186c6){_0x31df37[_0xa22e('0x21')]=_0x2186c6;if(_0x1a68f5[_0xa22e('0x2e')]['includeAll']){_0x251308['include']=[{'model':db[_0xa22e('0x7e')],'as':_0xa22e('0xe6'),'required':![]},{'model':db[_0xa22e('0xb9')],'as':'Owner','attributes':['name','fullname','internal'],'required':![]},{'model':db[_0xa22e('0xe7')],'as':_0xa22e('0xe8'),'attributes':['id',_0xa22e('0x29'),_0xa22e('0xe9')],'where':_0x1a68f5['query']['tag']?{'id':_0x1a68f5[_0xa22e('0x2e')]['tag']}:undefined,'required':_0x1a68f5[_0xa22e('0x2e')][_0xa22e('0xea')]?!![]:![]}];}return db['ChatInteraction'][_0xa22e('0x3f')](_0x251308);})['then'](function(_0xf0c383){_0x31df37[_0xa22e('0x58')]=_0xf0c383;return _0x31df37;});}})[_0xa22e('0x12')](respondWithFilteredResult(_0x36423b,_0x251308))[_0xa22e('0x1b')](handleError(_0x36423b,null));};function iftimePromise(_0x48f40e,_0x4b9b3c){return respondWithRpcPromise(_0xa22e('0xeb'),_0xa22e('0xec'),{'command':_0x4b9b3c[_0xa22e('0xed')]?util['format'](_0xa22e('0xee'),_0x48f40e[_0xa22e('0xef')],_0x4b9b3c[_0xa22e('0xed')]):util[_0xa22e('0xa4')]('iftime\x20%s',_0x48f40e['interval'])},client9002)[_0xa22e('0x12')](function(_0x1c8e5b){var _0x71e596=_0x1c8e5b&&_0x1c8e5b[_0xa22e('0xf0')](_0xa22e('0xf1'))>=0x0?!![]:![];logger[_0xa22e('0x13')](_0xa22e('0xf2'),_0x4b9b3c['id'],_0x48f40e['id'],_0x48f40e['interval'],_0x71e596?_0xa22e('0xf3'):'OFFLINE',_0x4b9b3c['timezone']?_0x4b9b3c[_0xa22e('0xed')]:_0xa22e('0xf4'));return _0x71e596;})[_0xa22e('0x1b')](function(_0x2e802a){logger[_0xa22e('0x17')](_0xa22e('0xf2'),_0x4b9b3c['id'],_0x48f40e['id'],_0x48f40e['interval'],util[_0xa22e('0xf5')](_0x2e802a,{'showHidden':![],'depth':null}),_0x4b9b3c[_0xa22e('0xed')]?_0x4b9b3c[_0xa22e('0xed')]:'No\x20timezone');return![];});}exports[_0xa22e('0xec')]=function(_0x2839e9,_0x4204f3){var _0x4fc5fe=0x0;var _0x19294e=0x0;var _0x1bcb4a=![];var _0x46bce4;var _0x2e3cbf;return db[_0xa22e('0x2b')][_0xa22e('0x44')]({'where':{'id':_0x2839e9[_0xa22e('0x4f')]['id']},'include':[{'model':db[_0xa22e('0xf6')],'as':'Interval','include':[{'model':db[_0xa22e('0xf6')],'as':_0xa22e('0xf7'),'attributes':['id',_0xa22e('0xef')],'raw':!![]}]}]})[_0xa22e('0x12')](handleEntityNotFound(_0x4204f3,null))[_0xa22e('0x12')](function(_0xabac88){if(_0xabac88){_0x46bce4=_0xabac88;return _0xabac88[_0xa22e('0xf8')]({'raw':!![]});}})[_0xa22e('0x12')](function(_0x19c45c){if(_0x46bce4){if(_0x19c45c){_0x2e3cbf=_0x19c45c;}}return require(_0xa22e('0x6b'))['getLicense']();})[_0xa22e('0x12')](function(_0x5400a1){if(_0x5400a1){_0x19294e=_0x5400a1[_0xa22e('0xf9')];_0x1bcb4a=_0x5400a1[_0xa22e('0x6c')];}})[_0xa22e('0x12')](function(){return db[_0xa22e('0xac')][_0xa22e('0x21')]({'where':{'closed':![]}});})['then'](function(_0x12a587){_0x4fc5fe=_0x12a587;if(_0x19294e&&_0x12a587>_0x19294e){return db[_0xa22e('0xfa')][_0xa22e('0x55')]({'where':{'id':0x1}})[_0xa22e('0x12')](function(_0x68b5e9){if(_0x68b5e9){_0x68b5e9[_0xa22e('0xfb')]('chatLicenseExceeded');}});}})[_0xa22e('0x12')](function(){if(_0x46bce4[_0xa22e('0xf6')]&&_0x46bce4[_0xa22e('0xf6')]['Intervals']){var _0x58c750=[];for(var _0x136a2f=0x0;_0x136a2f<_0x46bce4[_0xa22e('0xf6')][_0xa22e('0xf7')][_0xa22e('0x33')];_0x136a2f++){var _0x460da0=_0x46bce4[_0xa22e('0xf6')][_0xa22e('0xf7')][_0x136a2f][_0xa22e('0x26')]({'plain':!![]});_0x58c750[_0xa22e('0xb2')](iftimePromise(_0x460da0,_0x46bce4));}return BPromise[_0xa22e('0xfc')](_0x58c750)[_0xa22e('0x12')](function(_0x549295){return _[_0xa22e('0xfd')](_0x549295);});}else{return!![];}})[_0xa22e('0x12')](function(_0x31679d){var _0x252ba8=fs[_0xa22e('0xc7')](path['join'](config[_0xa22e('0x68')],_0xa22e('0xfe')),_0xa22e('0xc8'));var _0x4e8099={'remote':_0x46bce4[_0xa22e('0xff')],'query':querystring['stringify'](_[_0xa22e('0x3b')](_0x46bce4[_0xa22e('0x26')]({'plain':!![]}),{'customerIp':_0x2839e9[_0xa22e('0x9a')][_0xa22e('0x9c')]||_0x2839e9[_0xa22e('0x9a')][_0xa22e('0x100')]||_0x2839e9[_0xa22e('0x101')][_0xa22e('0x102')]||_0x2839e9['ip'],'referer':_0x2839e9['headers'][_0xa22e('0xa2')],'openedInteractions':_0x4fc5fe,'maxInteractions':_0x19294e,'virtual':_0x1bcb4a[_0xa22e('0xf9')],'online':_0x31679d,'custom':_0x1bcb4a}))[_0xa22e('0x103')](/'/g,'\x5c\x27')};_0x4204f3[_0xa22e('0xc3')](ejs['render'](Mustache[_0xa22e('0x104')](_0x252ba8,_0x4e8099),{'proactiveActions':_0x2e3cbf,'alignment':_0x46bce4[_0xa22e('0x105')],'verticalAlignment':_0x46bce4['verticalAlignment'],'div_color':_0x46bce4['color'],'labelText':_0x46bce4[_0xa22e('0x106')],'text_color':_0x46bce4[_0xa22e('0x107')],'text_button_color':_0x46bce4[_0xa22e('0x108')],'button_color':_0x46bce4[_0xa22e('0x109')],'background_color':_0x46bce4['backgroundColor'],'hideWhenOffline':_0x46bce4[_0xa22e('0x10a')],'interval':_0x46bce4[_0xa22e('0x10b')]}));})[_0xa22e('0x1b')](handleError(_0x4204f3,null));};exports[_0xa22e('0x10c')]=function(_0x47500b,_0x30bd85){var _0x11106d=_0x47500b[_0xa22e('0x4f')]['id'];var _0x596448=_0x47500b['body'];var _0x3ce862=0xc8;var _0x24434f=null;return db['sequelize'][_0xa22e('0xd4')]({'isolationLevel':db[_0xa22e('0xd3')]['Transaction']['ISOLATION_LEVELS'][_0xa22e('0x10d')]},function(_0x30cf32){return db['ChatWebsite'][_0xa22e('0x55')]({'where':{'id':_0x11106d},'transaction':_0x30cf32})['then'](function(_0x2f9056){if(_0x2f9056){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x11106d},'transaction':_0x30cf32})[_0xa22e('0x12')](function(){var _0x384329=_[_0xa22e('0x2a')](_0x596448,function(_0x17c08d){_0x17c08d[_0xa22e('0x52')]=_0x11106d;return _0x17c08d;});return db[_0xa22e('0x90')][_0xa22e('0xd6')](_0x384329,{'transaction':_0x30cf32});});}else{_0x3ce862=0x194;_0x24434f=[];}});})['then'](function(){if(_0x3ce862!==0x194){return db[_0xa22e('0x90')][_0xa22e('0x10e')]({'where':{'ChatWebsiteId':_0x11106d},'order':_0xa22e('0x95')})[_0xa22e('0x12')](function(_0x439bde){_0x24434f=_0x439bde;});}})[_0xa22e('0x1b')](function(_0x4a836e){_0x3ce862=0x1f4;logger['error'](_0x4a836e[_0xa22e('0x28')]);if(_0x4a836e[_0xa22e('0x29')]){delete _0x4a836e['name'];}_0x24434f=_0x4a836e;})['finally'](function(){if(_0x24434f===null){_0x30bd85[_0xa22e('0x1c')](_0x3ce862);}else{if(_0x3ce862===0x1f4){_0x30bd85[_0xa22e('0x1d')](_0x3ce862)['send'](_0x24434f);}else{_0x30bd85[_0xa22e('0x1d')](_0x3ce862)['json'](_0x24434f);}}});};exports[_0xa22e('0x10f')]=function(_0x467feb,_0x5bef63){var _0x2f2b5e={};var _0x1c7e18={};var _0x177ca8;var _0x2ad8a9;return db['ChatWebsite']['findOne']({'where':{'id':_0x467feb['params']['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x5bef63,null))[_0xa22e('0x12')](function(_0x28e515){if(_0x28e515){_0x177ca8=_0x28e515;_0x1c7e18[_0xa22e('0x30')]=_['keys'](db['ChatApplication'][_0xa22e('0x43')]);_0x1c7e18[_0xa22e('0x2e')]=_['keys'](_0x467feb[_0xa22e('0x2e')]);_0x1c7e18['filters']=_[_0xa22e('0x2f')](_0x1c7e18[_0xa22e('0x30')],_0x1c7e18[_0xa22e('0x2e')]);_0x2f2b5e['attributes']=_[_0xa22e('0x2f')](_0x1c7e18['model'],qs[_0xa22e('0x31')](_0x467feb[_0xa22e('0x2e')]['fields']));_0x2f2b5e['attributes']=_0x2f2b5e[_0xa22e('0x32')]['length']?_0x2f2b5e[_0xa22e('0x32')]:_0x1c7e18['model'];_0x2f2b5e['order']=qs[_0xa22e('0x56')](_0x467feb[_0xa22e('0x2e')][_0xa22e('0x56')]);_0x2f2b5e['where']=qs[_0xa22e('0x38')](_[_0xa22e('0x39')](_0x467feb[_0xa22e('0x2e')],_0x1c7e18[_0xa22e('0x38')]));if(_0x467feb[_0xa22e('0x2e')][_0xa22e('0x3a')]){_0x2f2b5e[_0xa22e('0x37')]=_[_0xa22e('0x3b')](_0x2f2b5e[_0xa22e('0x37')],{'$or':_[_0xa22e('0x2a')](_0x2f2b5e[_0xa22e('0x32')],function(_0x1d2b5c){var _0x50f148={};_0x50f148[_0x1d2b5c]={'$like':'%'+_0x467feb['query']['filter']+'%'};return _0x50f148;})});}_0x2f2b5e=_[_0xa22e('0x3b')]({},_0x2f2b5e,_0x467feb[_0xa22e('0x57')]);return _0x177ca8[_0xa22e('0x10f')](_0x2f2b5e);}})[_0xa22e('0x12')](function(_0x4a785c){if(_0x4a785c){_0x2ad8a9=_0x4a785c[_0xa22e('0x33')];if(!_0x467feb[_0xa22e('0x2e')][_0xa22e('0x34')](_0xa22e('0x35'))){_0x2f2b5e[_0xa22e('0x20')]=qs[_0xa22e('0x20')](_0x467feb['query']['limit']);_0x2f2b5e[_0xa22e('0x22')]=qs[_0xa22e('0x22')](_0x467feb['query'][_0xa22e('0x22')]);}return _0x177ca8['getApplications'](_0x2f2b5e);}})[_0xa22e('0x12')](function(_0x30ecaa){if(_0x30ecaa){return _0x30ecaa?{'count':_0x2ad8a9,'rows':_0x30ecaa}:null;}})[_0xa22e('0x12')](respondWithResult(_0x5bef63,null))[_0xa22e('0x1b')](handleError(_0x5bef63,null));};exports[_0xa22e('0x110')]=function(_0xe13136,_0x1b14e0){return db[_0xa22e('0x111')][_0xa22e('0x44')]({'where':{'id':_0xe13136[_0xa22e('0x4f')]['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x1b14e0,null))['then'](function(_0x5d2387){if(_0x5d2387){return _0x5d2387['addProactiveActions'](_0xe13136[_0xa22e('0x46')]['ids'],_[_0xa22e('0x112')](_0xe13136[_0xa22e('0x46')],['ids','id'])||{});}})[_0xa22e('0x12')](respondWithResult(_0x1b14e0,null))[_0xa22e('0x1b')](handleError(_0x1b14e0,null));};exports[_0xa22e('0xf8')]=function(_0x1e88a4,_0x29605b){var _0x403f70={};var _0x32b2f9={};var _0x3974f0;var _0x4c1148;return db[_0xa22e('0x2b')]['findOne']({'where':{'id':_0x1e88a4[_0xa22e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x29605b,null))[_0xa22e('0x12')](function(_0x5c6ab0){if(_0x5c6ab0){_0x3974f0=_0x5c6ab0;_0x32b2f9['model']=_[_0xa22e('0x42')](db[_0xa22e('0x113')]['rawAttributes']);_0x32b2f9[_0xa22e('0x2e')]=_[_0xa22e('0x42')](_0x1e88a4['query']);_0x32b2f9[_0xa22e('0x38')]=_[_0xa22e('0x2f')](_0x32b2f9[_0xa22e('0x30')],_0x32b2f9[_0xa22e('0x2e')]);_0x403f70[_0xa22e('0x32')]=_[_0xa22e('0x2f')](_0x32b2f9['model'],qs[_0xa22e('0x31')](_0x1e88a4[_0xa22e('0x2e')][_0xa22e('0x31')]));_0x403f70[_0xa22e('0x32')]=_0x403f70['attributes'][_0xa22e('0x33')]?_0x403f70[_0xa22e('0x32')]:_0x32b2f9['model'];_0x403f70[_0xa22e('0x36')]=qs['sort'](_0x1e88a4['query'][_0xa22e('0x56')]);_0x403f70[_0xa22e('0x37')]=qs[_0xa22e('0x38')](_[_0xa22e('0x39')](_0x1e88a4[_0xa22e('0x2e')],_0x32b2f9[_0xa22e('0x38')]));if(_0x1e88a4['query']['filter']){_0x403f70[_0xa22e('0x37')]=_[_0xa22e('0x3b')](_0x403f70['where'],{'$or':_[_0xa22e('0x2a')](_0x403f70[_0xa22e('0x32')],function(_0x362187){var _0x2d1ee3={};_0x2d1ee3[_0x362187]={'$like':'%'+_0x1e88a4[_0xa22e('0x2e')][_0xa22e('0x3a')]+'%'};return _0x2d1ee3;})});}_0x403f70=_[_0xa22e('0x3b')]({},_0x403f70,_0x1e88a4[_0xa22e('0x57')]);return _0x3974f0['getProactiveActions'](_0x403f70);}})[_0xa22e('0x12')](function(_0x579d31){if(_0x579d31){_0x4c1148=_0x579d31[_0xa22e('0x33')];if(!_0x1e88a4['query'][_0xa22e('0x34')](_0xa22e('0x35'))){_0x403f70[_0xa22e('0x20')]=qs[_0xa22e('0x20')](_0x1e88a4[_0xa22e('0x2e')][_0xa22e('0x20')]);_0x403f70[_0xa22e('0x22')]=qs[_0xa22e('0x22')](_0x1e88a4[_0xa22e('0x2e')][_0xa22e('0x22')]);}return _0x3974f0[_0xa22e('0xf8')](_0x403f70);}})[_0xa22e('0x12')](function(_0x1e2329){if(_0x1e2329){return _0x1e2329?{'count':_0x4c1148,'rows':_0x1e2329}:null;}})['then'](respondWithResult(_0x29605b,null))['catch'](handleError(_0x29605b,null));};exports[_0xa22e('0x114')]=function(_0x57a5c3,_0x538b94){var _0xf13519=_0x57a5c3['query'][_0xa22e('0x115')]===_0xa22e('0x116')?'offlineForm':_0xa22e('0x117');return db['ChatWebsite'][_0xa22e('0x44')]({'attributes':['id',_0xf13519],'where':{'id':_0x57a5c3[_0xa22e('0x4f')]['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x538b94,null))[_0xa22e('0x12')](function(_0x49683c){if(_0x49683c){var _0x39b930=_0x49683c[_0xf13519];var _0x15f9bd=_0x39b930&&_0x39b930[_0xa22e('0x118')]?_0x39b930[_0xa22e('0x118')]:[];_0x538b94['send']({'fromKey':_['isNil'](_0x39b930[_0xa22e('0x119')])?undefined:_0x39b930[_0xa22e('0x119')],'count':_0x15f9bd[_0xa22e('0x33')],'rows':_0x15f9bd});}})[_0xa22e('0x1b')](handleError(_0x538b94,null));};exports[_0xa22e('0x11a')]=function(_0x394b15,_0x26f89c){var _0x35c69e={'raw':![],'where':{}};var _0x5b59ae={};var _0x3afe03={'count':0x0,'rows':[]};return db[_0xa22e('0x2b')][_0xa22e('0x55')]({'where':{'id':_0x394b15[_0xa22e('0x4f')]['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x26f89c,null))['then'](function(_0x5dbb11){if(_0x5dbb11){_0x5b59ae['model']=_[_0xa22e('0x42')](db['ChatOfflineMessage'][_0xa22e('0x43')]);_0x5b59ae['query']=_['keys'](_0x394b15[_0xa22e('0x2e')]);_0x5b59ae[_0xa22e('0x38')]=_['intersection'](_0x5b59ae[_0xa22e('0x30')],_0x5b59ae['query']);_0x35c69e[_0xa22e('0x32')]=_[_0xa22e('0x2f')](_0x5b59ae[_0xa22e('0x30')],qs[_0xa22e('0x31')](_0x394b15[_0xa22e('0x2e')][_0xa22e('0x31')]));_0x35c69e[_0xa22e('0x32')]=_0x35c69e[_0xa22e('0x32')]['length']?_0x35c69e['attributes']:_0x5b59ae[_0xa22e('0x30')];if(!_0x394b15['query'][_0xa22e('0x34')](_0xa22e('0x35'))){_0x35c69e[_0xa22e('0x20')]=qs[_0xa22e('0x20')](_0x394b15[_0xa22e('0x2e')][_0xa22e('0x20')]);_0x35c69e[_0xa22e('0x22')]=qs['offset'](_0x394b15[_0xa22e('0x2e')][_0xa22e('0x22')]);}_0x35c69e['order']=qs['sort'](_0x394b15[_0xa22e('0x2e')][_0xa22e('0x56')]);_0x35c69e[_0xa22e('0x37')]=qs[_0xa22e('0x38')](_[_0xa22e('0x39')](_0x394b15[_0xa22e('0x2e')],_0x5b59ae[_0xa22e('0x38')]));_0x35c69e['where']['ChatWebsiteId']=_0x5dbb11['id'];if(_0x394b15['query'][_0xa22e('0x3a')]){_0x35c69e[_0xa22e('0x37')]=_[_0xa22e('0x3b')](_0x35c69e[_0xa22e('0x37')],{'$or':_[_0xa22e('0x2a')](_0x35c69e[_0xa22e('0x32')],function(_0x461ff5){var _0x1784c7={};_0x1784c7[_0x461ff5]={'$like':'%'+_0x394b15[_0xa22e('0x2e')][_0xa22e('0x3a')]+'%'};return _0x1784c7;})});}_0x35c69e=_[_0xa22e('0x3b')]({},_0x35c69e,_0x394b15[_0xa22e('0x57')]);return db[_0xa22e('0xcb')]['count']({'where':_0x35c69e['where']})[_0xa22e('0x12')](function(_0x256a94){_0x3afe03[_0xa22e('0x21')]=_0x256a94;if(_0x394b15[_0xa22e('0x2e')][_0xa22e('0x3d')]){_0x35c69e['include']=[{'all':!![]}];}else{_0x35c69e[_0xa22e('0x3e')]=[{'model':db[_0xa22e('0x7e')],'as':_0xa22e('0xe6'),'required':![]},{'model':db[_0xa22e('0xd5')],'as':_0xa22e('0x11b'),'required':![]}];}return db[_0xa22e('0xcb')][_0xa22e('0x3f')](_0x35c69e);})[_0xa22e('0x12')](function(_0x81b77){_0x3afe03[_0xa22e('0x58')]=_0x81b77;return _0x3afe03;});}})['then'](respondWithFilteredResult(_0x26f89c,_0x35c69e))['catch'](handleError(_0x26f89c,null));};exports[_0xa22e('0x11c')]=function(_0x4f4b91,_0x545f1f){return db[_0xa22e('0x2b')][_0xa22e('0x44')]({'where':{'id':_0x4f4b91[_0xa22e('0x4f')]['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x545f1f,null))[_0xa22e('0x12')](function(_0x1b74a3){if(_0x1b74a3){return _0x1b74a3['addAgents'](_0x4f4b91[_0xa22e('0x46')][_0xa22e('0x5a')],_[_0xa22e('0x112')](_0x4f4b91['body'],[_0xa22e('0x5a'),'id'])||{})[_0xa22e('0xb0')](function(_0x46d0aa){for(var _0x186c23=0x0;_0x186c23<_0x4f4b91[_0xa22e('0x46')][_0xa22e('0x5a')]['length'];_0x186c23+=0x1){socket[_0xa22e('0x11d')](_0xa22e('0x11e'),{'UserId':Number(_0x4f4b91['body'][_0xa22e('0x5a')][_0x186c23]),'ChatWebsiteId':Number(_0x4f4b91[_0xa22e('0x4f')]['id'])});}return _0x46d0aa;});}})[_0xa22e('0x12')](respondWithResult(_0x545f1f,null))['catch'](handleError(_0x545f1f,null));};exports[_0xa22e('0x11f')]=function(_0x51662f,_0x315595){return db['ChatWebsite'][_0xa22e('0x44')]({'where':{'id':_0x51662f[_0xa22e('0x4f')]['id']}})[_0xa22e('0x12')](handleEntityNotFound(_0x315595,null))[_0xa22e('0x12')](function(_0x336f20){if(_0x336f20){return _0x336f20[_0xa22e('0x11f')](_0x51662f[_0xa22e('0x2e')][_0xa22e('0x5a')])['then'](function(){if(_[_0xa22e('0x120')](_0x51662f[_0xa22e('0x2e')]['ids'])){for(var _0x34f947=0x0;_0x34f947<_0x51662f[_0xa22e('0x2e')]['ids'][_0xa22e('0x33')];_0x34f947+=0x1){socket['emit'](_0xa22e('0x121'),{'UserId':Number(_0x51662f[_0xa22e('0x2e')][_0xa22e('0x5a')][_0x34f947]),'ChatWebsiteId':Number(_0x51662f['params']['id'])});}}else{socket[_0xa22e('0x11d')](_0xa22e('0x121'),{'UserId':Number(_0x51662f[_0xa22e('0x2e')][_0xa22e('0x5a')]),'ChatWebsiteId':Number(_0x51662f[_0xa22e('0x4f')]['id'])});}});}})['then'](respondWithStatusCode(_0x315595,null))[_0xa22e('0x1b')](handleError(_0x315595,null));};exports[_0xa22e('0x122')]=function(_0x5761e9,_0xd7e1c3){var _0x2f75a4={};var _0xf87a8c={};var _0x3794fd;var _0x3e9787;return db[_0xa22e('0x2b')][_0xa22e('0x55')]({'where':{'id':_0x5761e9[_0xa22e('0x4f')]['id']}})['then'](handleEntityNotFound(_0xd7e1c3,null))['then'](function(_0x13654){if(_0x13654){_0x3794fd=_0x13654;_0xf87a8c[_0xa22e('0x30')]=_[_0xa22e('0x42')](db[_0xa22e('0xb9')][_0xa22e('0x43')]);_0xf87a8c[_0xa22e('0x2e')]=_[_0xa22e('0x42')](_0x5761e9['query']);_0xf87a8c['filters']=_[_0xa22e('0x2f')](_0xf87a8c['model'],_0xf87a8c[_0xa22e('0x2e')]);_0x2f75a4[_0xa22e('0x32')]=_[_0xa22e('0x2f')](_0xf87a8c[_0xa22e('0x30')],qs['fields'](_0x5761e9[_0xa22e('0x2e')][_0xa22e('0x31')]));_0x2f75a4[_0xa22e('0x32')]=_0x2f75a4[_0xa22e('0x32')]['length']?_0x2f75a4[_0xa22e('0x32')]:_0xf87a8c[_0xa22e('0x30')];_0x2f75a4[_0xa22e('0x36')]=qs['sort'](_0x5761e9[_0xa22e('0x2e')]['sort']);_0x2f75a4[_0xa22e('0x37')]=qs[_0xa22e('0x38')](_[_0xa22e('0x39')](_0x5761e9[_0xa22e('0x2e')],_0xf87a8c['filters']));if(_0x5761e9[_0xa22e('0x2e')][_0xa22e('0x3a')]){_0x2f75a4[_0xa22e('0x37')]=_[_0xa22e('0x3b')](_0x2f75a4[_0xa22e('0x37')],{'$or':_[_0xa22e('0x2a')](_0x2f75a4['attributes'],function(_0x5c9d21){var _0x91f83c={};_0x91f83c[_0x5c9d21]={'$like':'%'+_0x5761e9[_0xa22e('0x2e')][_0xa22e('0x3a')]+'%'};return _0x91f83c;})});}_0x2f75a4=_[_0xa22e('0x3b')]({},_0x2f75a4,_0x5761e9['options']);return _0x3794fd[_0xa22e('0x122')](_0x2f75a4);}})[_0xa22e('0x12')](function(_0x577574){if(_0x577574){_0x3e9787=_0x577574[_0xa22e('0x33')];if(!_0x5761e9[_0xa22e('0x2e')][_0xa22e('0x34')](_0xa22e('0x35'))){_0x2f75a4[_0xa22e('0x20')]=qs[_0xa22e('0x20')](_0x5761e9[_0xa22e('0x2e')][_0xa22e('0x20')]);_0x2f75a4[_0xa22e('0x22')]=qs[_0xa22e('0x22')](_0x5761e9[_0xa22e('0x2e')][_0xa22e('0x22')]);}return _0x3794fd[_0xa22e('0x122')](_0x2f75a4);}})[_0xa22e('0x12')](function(_0x502c03){if(_0x502c03){return _0x502c03?{'count':_0x3e9787,'rows':_0x502c03}:null;}})['then'](respondWithResult(_0xd7e1c3,null))[_0xa22e('0x1b')](handleError(_0xd7e1c3,null));};
\ No newline at end of file
+var _0xcad0=['Chat','NotifyMailAccount','notifyMail','files','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','tag','Command','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','getSnippet','Interval','getProactiveActions','getLicense','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','connection','remoteAddress','virtual','render','alignment','verticalAlignment','labelText','textColor','textButtonColor','IntervalId','sequelize','Transaction','ISOLATION_LEVELS','findAndCountAll','priority','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachment','addAgents','emit','userChatWebsite:save','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','fs-extra','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','json','offset','undefined','limit','count','set','get','ChatWebsites','UserProfileResource','destroy','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','ChatWebsite','includeAll','include','findAll','rows','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','../../config/license/util','custom','isNil','server/files/images/logos/','download','getAvatar','root','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','createdAt','updatedAt','CompanyId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','List','account','Applications','applications','orderBy','ListId','contact','customerIp','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','interaction','spread','messageId','created','autoclose','push','close','*,*,*,*','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','difference','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','attachments','offline-chat','openNewInteraction','transaction','bulkCreate','MailServerOut','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','email','Smtp','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','lastName','offlineMessageSubject'];(function(_0x355d94,_0x534a11){var _0x530338=function(_0x30bd00){while(--_0x30bd00){_0x355d94['push'](_0x355d94['shift']());}};_0x530338(++_0x534a11);}(_0xcad0,0x168));var _0x0cad=function(_0x36909d,_0x2795f1){_0x36909d=_0x36909d-0x0;var _0x1fd29d=_0xcad0[_0x36909d];return _0x1fd29d;};'use strict';var BPromise=require(_0x0cad('0x0'));var Mustache=require(_0x0cad('0x1'));var util=require(_0x0cad('0x2'));var path=require(_0x0cad('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0cad('0x4'));var _=require('lodash');var querystring=require('querystring');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x0cad('0x5'))(_0x0cad('0x6'));var config=require(_0x0cad('0x7'));var db=require(_0x0cad('0x8'))['db'];config[_0x0cad('0x9')]=_[_0x0cad('0xa')](config[_0x0cad('0x9')],{'host':_0x0cad('0xb'),'port':0x18eb});var socket=require(_0x0cad('0xc'))(new Redis(config['redis']));require(_0x0cad('0xd'))[_0x0cad('0xe')](socket);var htmlToText=require(_0x0cad('0xf'));var jayson=require('jayson/promise');var client=jayson[_0x0cad('0x10')][_0x0cad('0x11')]({'port':0x232c});var client9002=jayson['client'][_0x0cad('0x11')]({'port':0x232a});var client9003=jayson[_0x0cad('0x10')]['http']({'port':0x232b});var client9001=jayson[_0x0cad('0x10')]['http']({'port':0x2329});function respondWithRpcPromise(_0x5ed3c4,_0x182fef,_0x245d53,_0x84ccb2){return new BPromise(function(_0x3d499d,_0x1ea2e2){var _0x281549=_0x84ccb2||client;return _0x281549[_0x0cad('0x12')](_0x5ed3c4,_0x245d53)[_0x0cad('0x13')](function(_0x574be4){logger[_0x0cad('0x14')](_0x0cad('0x15'),_0x182fef,_0x0cad('0x16'));logger[_0x0cad('0x17')](_0x0cad('0x18'),_0x182fef,_0x0cad('0x16'),JSON[_0x0cad('0x19')](_0x574be4));if(_0x574be4[_0x0cad('0x1a')]){if(_0x574be4[_0x0cad('0x1a')][_0x0cad('0x1b')]===0x1f4){logger[_0x0cad('0x1a')](_0x0cad('0x15'),_0x182fef,_0x574be4[_0x0cad('0x1a')]['message']);return _0x1ea2e2(_0x574be4[_0x0cad('0x1a')][_0x0cad('0x1c')]);}logger[_0x0cad('0x1a')](_0x0cad('0x15'),_0x182fef,_0x574be4[_0x0cad('0x1a')][_0x0cad('0x1c')]);return _0x3d499d(_0x574be4[_0x0cad('0x1a')][_0x0cad('0x1c')]);}else{logger[_0x0cad('0x14')](_0x0cad('0x15'),_0x182fef,'request\x20sent');_0x3d499d(_0x574be4[_0x0cad('0x1d')][_0x0cad('0x1c')]);}})[_0x0cad('0x1e')](function(_0x345349){logger['error'](_0x0cad('0x15'),_0x182fef,_0x345349);_0x1ea2e2(_0x345349);});});}function respondWithStatusCode(_0x2ee3f1,_0x1383d8){_0x1383d8=_0x1383d8||0xcc;return function(_0x1687ac){if(_0x1687ac){return _0x2ee3f1['sendStatus'](_0x1383d8);}return _0x2ee3f1['status'](_0x1383d8)[_0x0cad('0x1f')]();};}function respondWithResult(_0x289546,_0x34e421){_0x34e421=_0x34e421||0xc8;return function(_0x1eb8c6){if(_0x1eb8c6){return _0x289546[_0x0cad('0x20')](_0x34e421)[_0x0cad('0x21')](_0x1eb8c6);}};}function respondWithFilteredResult(_0x5a32c8,_0x1ab6a6){return function(_0x1ab3ba){if(_0x1ab3ba){var _0xa86d0=typeof _0x1ab6a6[_0x0cad('0x22')]===_0x0cad('0x23')&&typeof _0x1ab6a6[_0x0cad('0x24')]===_0x0cad('0x23');var _0x6e089d=_0x1ab3ba[_0x0cad('0x25')];var _0x5a2996=_0xa86d0?0x0:_0x1ab6a6[_0x0cad('0x22')];var _0x5eaeb1=_0xa86d0?_0x1ab3ba['count']:_0x1ab6a6['offset']+_0x1ab6a6[_0x0cad('0x24')];var _0x1de71e;if(_0x5eaeb1>=_0x6e089d){_0x5eaeb1=_0x6e089d;_0x1de71e=0xc8;}else{_0x1de71e=0xce;}_0x5a32c8[_0x0cad('0x20')](_0x1de71e);return _0x5a32c8[_0x0cad('0x26')]('Content-Range',_0x5a2996+'-'+_0x5eaeb1+'/'+_0x6e089d)[_0x0cad('0x21')](_0x1ab3ba);}return null;};}function saveUpdates(_0x347c32){return function(_0x3f23c7){if(_0x3f23c7){return _0x3f23c7['update'](_0x347c32)[_0x0cad('0x13')](function(_0x276bec){return _0x276bec;});}return null;};}function removeEntity(_0x4fb425){return function(_0x36ac01){if(_0x36ac01){return _0x36ac01['destroy']()['then'](function(){var _0x3a3b0f=_0x36ac01[_0x0cad('0x27')]({'plain':!![]});var _0x1c978f=_0x0cad('0x28');return db[_0x0cad('0x29')][_0x0cad('0x2a')]({'where':{'type':_0x1c978f,'resourceId':_0x3a3b0f['id']}})[_0x0cad('0x13')](function(){return _0x36ac01;});})[_0x0cad('0x13')](function(){_0x4fb425['status'](0xcc)[_0x0cad('0x1f')]();});}};}function handleEntityNotFound(_0xefcc89){return function(_0x5eb2f4){if(!_0x5eb2f4){_0xefcc89[_0x0cad('0x2b')](0x194);}return _0x5eb2f4;};}function handleError(_0x55cbde,_0x2ccf28){_0x2ccf28=_0x2ccf28||0x1f4;return function(_0x22899f){logger[_0x0cad('0x1a')](_0x22899f[_0x0cad('0x2c')]);if(_0x22899f[_0x0cad('0x2d')]){delete _0x22899f['name'];}_0x55cbde[_0x0cad('0x20')](_0x2ccf28)[_0x0cad('0x2e')](_0x22899f);};}exports[_0x0cad('0x2f')]=function(_0xcd6b7f,_0x43c4a9){var _0x463a3f={'include':[{'model':db[_0x0cad('0x30')],'as':_0x0cad('0x31')}]},_0x3b13c8={},_0x7e7a75={'count':0x0,'rows':[]};var _0x478170=_[_0x0cad('0x32')](db['ChatWebsite'][_0x0cad('0x33')],function(_0x4a1a9d){return{'name':_0x4a1a9d['fieldName'],'type':_0x4a1a9d[_0x0cad('0x34')]['key']};});_0x3b13c8[_0x0cad('0x35')]=_[_0x0cad('0x32')](_0x478170,_0x0cad('0x2d'));_0x3b13c8[_0x0cad('0x36')]=_[_0x0cad('0x37')](_0xcd6b7f[_0x0cad('0x36')]);_0x3b13c8[_0x0cad('0x38')]=_['intersection'](_0x3b13c8[_0x0cad('0x35')],_0x3b13c8[_0x0cad('0x36')]);_0x463a3f[_0x0cad('0x39')]=_[_0x0cad('0x3a')](_0x3b13c8[_0x0cad('0x35')],qs[_0x0cad('0x3b')](_0xcd6b7f[_0x0cad('0x36')][_0x0cad('0x3b')]));_0x463a3f[_0x0cad('0x39')]=_0x463a3f[_0x0cad('0x39')][_0x0cad('0x3c')]?_0x463a3f[_0x0cad('0x39')]:_0x3b13c8[_0x0cad('0x35')];if(!_0xcd6b7f[_0x0cad('0x36')][_0x0cad('0x3d')](_0x0cad('0x3e'))){_0x463a3f[_0x0cad('0x24')]=qs['limit'](_0xcd6b7f[_0x0cad('0x36')][_0x0cad('0x24')]);_0x463a3f['offset']=qs[_0x0cad('0x22')](_0xcd6b7f['query'][_0x0cad('0x22')]);}_0x463a3f[_0x0cad('0x3f')]=qs[_0x0cad('0x40')](_0xcd6b7f[_0x0cad('0x36')][_0x0cad('0x40')]);_0x463a3f['where']=qs[_0x0cad('0x38')](_[_0x0cad('0x41')](_0xcd6b7f[_0x0cad('0x36')],_0x3b13c8[_0x0cad('0x38')]),_0x478170);if(_0xcd6b7f['query'][_0x0cad('0x42')]){_0x463a3f[_0x0cad('0x43')]=_[_0x0cad('0x44')](_0x463a3f[_0x0cad('0x43')],{'$or':_[_0x0cad('0x32')](_0x478170,function(_0x535765){if(_0x535765[_0x0cad('0x34')]!=='VIRTUAL'){var _0x3f2082={};_0x3f2082[_0x535765[_0x0cad('0x2d')]]={'$like':'%'+_0xcd6b7f[_0x0cad('0x36')][_0x0cad('0x42')]+'%'};return _0x3f2082;}})});}_0x463a3f=_[_0x0cad('0x44')]({},_0x463a3f,_0xcd6b7f[_0x0cad('0x45')]);var _0x338345={'where':_0x463a3f[_0x0cad('0x43')]};return db[_0x0cad('0x46')][_0x0cad('0x25')](_0x338345)[_0x0cad('0x13')](function(_0xbd44bb){_0x7e7a75[_0x0cad('0x25')]=_0xbd44bb;if(_0xcd6b7f[_0x0cad('0x36')][_0x0cad('0x47')]){_0x463a3f[_0x0cad('0x48')]=[{'all':!![]}];}return db[_0x0cad('0x46')][_0x0cad('0x49')](_0x463a3f);})['then'](function(_0x32aaa3){_0x7e7a75[_0x0cad('0x4a')]=_0x32aaa3;return _0x7e7a75;})[_0x0cad('0x13')](respondWithFilteredResult(_0x43c4a9,_0x463a3f))[_0x0cad('0x1e')](handleError(_0x43c4a9,null));};exports['show']=function(_0x540e33,_0x3788d2){var _0x140dd1={'raw':![],'where':{'id':_0x540e33[_0x0cad('0x4b')]['id']},'include':[{'model':db['Pause'],'as':_0x0cad('0x31')}]},_0x41dd03={};_0x41dd03[_0x0cad('0x35')]=_[_0x0cad('0x37')](db[_0x0cad('0x46')]['rawAttributes']);_0x41dd03['query']=_[_0x0cad('0x37')](_0x540e33[_0x0cad('0x36')]);_0x41dd03[_0x0cad('0x38')]=_[_0x0cad('0x3a')](_0x41dd03[_0x0cad('0x35')],_0x41dd03[_0x0cad('0x36')]);_0x140dd1[_0x0cad('0x39')]=_[_0x0cad('0x3a')](_0x41dd03[_0x0cad('0x35')],qs['fields'](_0x540e33[_0x0cad('0x36')][_0x0cad('0x3b')]));_0x140dd1[_0x0cad('0x39')]=_0x140dd1[_0x0cad('0x39')]['length']?_0x140dd1[_0x0cad('0x39')]:_0x41dd03[_0x0cad('0x35')];if(_0x540e33[_0x0cad('0x36')][_0x0cad('0x47')]){_0x140dd1[_0x0cad('0x48')]=[{'all':!![]}];}_0x140dd1=_[_0x0cad('0x44')]({},_0x140dd1,_0x540e33[_0x0cad('0x45')]);return db[_0x0cad('0x46')]['find'](_0x140dd1)[_0x0cad('0x13')](handleEntityNotFound(_0x3788d2,null))[_0x0cad('0x13')](respondWithResult(_0x3788d2,null))[_0x0cad('0x1e')](handleError(_0x3788d2,null));};exports[_0x0cad('0x4c')]=function(_0x4e21ef,_0x14e0ec){return db[_0x0cad('0x46')][_0x0cad('0x4c')](_0x4e21ef[_0x0cad('0x4d')],{})[_0x0cad('0x13')](function(_0x5eab62){var _0x5149b5=_0x4e21ef[_0x0cad('0x4e')][_0x0cad('0x27')]({'plain':!![]});if(!_0x5149b5)throw new Error(_0x0cad('0x4f'));if(_0x5149b5[_0x0cad('0x50')]===_0x0cad('0x4e')){var _0x151cf6=_0x5eab62[_0x0cad('0x27')]({'plain':!![]});var _0x20f700='ChatWebsites';return db[_0x0cad('0x51')][_0x0cad('0x52')]({'where':{'name':_0x20f700,'userProfileId':_0x5149b5[_0x0cad('0x53')]},'raw':!![]})[_0x0cad('0x13')](function(_0x1e800b){if(_0x1e800b&&_0x1e800b[_0x0cad('0x54')]===0x0){return db[_0x0cad('0x29')][_0x0cad('0x4c')]({'name':_0x151cf6[_0x0cad('0x2d')],'resourceId':_0x151cf6['id'],'type':_0x1e800b[_0x0cad('0x2d')],'sectionId':_0x1e800b['id']},{})[_0x0cad('0x13')](function(){return _0x5eab62;});}else{return _0x5eab62;}})[_0x0cad('0x1e')](function(_0x51d462){logger[_0x0cad('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x51d462);throw _0x51d462;});}return _0x5eab62;})[_0x0cad('0x13')](respondWithResult(_0x14e0ec,0xc9))[_0x0cad('0x1e')](handleError(_0x14e0ec,null));};exports['update']=function(_0x56cb03,_0xfbe0b9){if(_0x56cb03[_0x0cad('0x4d')]['id']){delete _0x56cb03[_0x0cad('0x4d')]['id'];}return db[_0x0cad('0x46')][_0x0cad('0x52')]({'where':{'id':_0x56cb03[_0x0cad('0x4b')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x0cad('0x13')](handleEntityNotFound(_0xfbe0b9,null))[_0x0cad('0x13')](saveUpdates(_0x56cb03[_0x0cad('0x4d')],null))[_0x0cad('0x13')](respondWithResult(_0xfbe0b9,null))['catch'](handleError(_0xfbe0b9,null));};exports[_0x0cad('0x2a')]=function(_0x49d2de,_0x16e96b){return db[_0x0cad('0x46')][_0x0cad('0x52')]({'where':{'id':_0x49d2de[_0x0cad('0x4b')]['id']}})[_0x0cad('0x13')](handleEntityNotFound(_0x16e96b,null))[_0x0cad('0x13')](removeEntity(_0x16e96b,null))[_0x0cad('0x1e')](handleError(_0x16e96b,null));};exports[_0x0cad('0x55')]=function(_0x198fb7,_0x4d55a3){return db['ChatWebsite'][_0x0cad('0x55')]()[_0x0cad('0x13')](respondWithResult(_0x4d55a3,null))[_0x0cad('0x1e')](handleError(_0x4d55a3,null));};exports[_0x0cad('0x56')]=function(_0x264950,_0x2deb57){if(_0x264950[_0x0cad('0x4d')]['id']){delete _0x264950[_0x0cad('0x4d')]['id'];}return db[_0x0cad('0x46')][_0x0cad('0x52')]({'where':{'id':_0x264950[_0x0cad('0x4b')]['id']}})[_0x0cad('0x13')](handleEntityNotFound(_0x2deb57,null))[_0x0cad('0x13')](function(_0x3dc0d8){if(_0x3dc0d8){_0x264950[_0x0cad('0x4d')][_0x0cad('0x57')]=_0x3dc0d8['id'];return db[_0x0cad('0x58')][_0x0cad('0x4c')](_0x264950[_0x0cad('0x4d')]);}})[_0x0cad('0x13')](respondWithResult(_0x2deb57,null))[_0x0cad('0x1e')](handleError(_0x2deb57,null));};exports[_0x0cad('0x59')]=function(_0x241a34,_0x390553){var _0x4f71af={'raw':![],'where':{}};var _0x56e434={};var _0x5ca327={'count':0x0,'rows':[]};return db[_0x0cad('0x46')][_0x0cad('0x5a')]({'where':{'id':_0x241a34[_0x0cad('0x4b')]['id']}})[_0x0cad('0x13')](handleEntityNotFound(_0x390553,null))[_0x0cad('0x13')](function(_0x598867){if(_0x598867){_0x56e434[_0x0cad('0x35')]=_[_0x0cad('0x37')](db[_0x0cad('0x58')]['rawAttributes']);_0x56e434[_0x0cad('0x36')]=_[_0x0cad('0x37')](_0x241a34[_0x0cad('0x36')]);_0x56e434['filters']=_['intersection'](_0x56e434[_0x0cad('0x35')],_0x56e434[_0x0cad('0x36')]);_0x4f71af['attributes']=_[_0x0cad('0x3a')](_0x56e434[_0x0cad('0x35')],qs[_0x0cad('0x3b')](_0x241a34[_0x0cad('0x36')][_0x0cad('0x3b')]));_0x4f71af[_0x0cad('0x39')]=_0x4f71af[_0x0cad('0x39')][_0x0cad('0x3c')]?_0x4f71af[_0x0cad('0x39')]:_0x56e434['model'];if(!_0x241a34[_0x0cad('0x36')][_0x0cad('0x3d')](_0x0cad('0x3e'))){_0x4f71af[_0x0cad('0x24')]=qs[_0x0cad('0x24')](_0x241a34['query'][_0x0cad('0x24')]);_0x4f71af[_0x0cad('0x22')]=qs[_0x0cad('0x22')](_0x241a34['query']['offset']);}_0x4f71af[_0x0cad('0x3f')]=qs[_0x0cad('0x40')](_0x241a34[_0x0cad('0x36')][_0x0cad('0x40')]);_0x4f71af[_0x0cad('0x43')]=qs[_0x0cad('0x38')](_[_0x0cad('0x41')](_0x241a34[_0x0cad('0x36')],_0x56e434[_0x0cad('0x38')]));_0x4f71af['where'][_0x0cad('0x57')]=_0x598867['id'];if(_0x241a34[_0x0cad('0x36')][_0x0cad('0x42')]){_0x4f71af[_0x0cad('0x43')]=_[_0x0cad('0x44')](_0x4f71af[_0x0cad('0x43')],{'$or':_[_0x0cad('0x32')](_0x4f71af[_0x0cad('0x39')],function(_0x5bbbe0){var _0x2fb5c8={};_0x2fb5c8[_0x5bbbe0]={'$like':'%'+_0x241a34[_0x0cad('0x36')][_0x0cad('0x42')]+'%'};return _0x2fb5c8;})});}_0x4f71af=_['merge']({},_0x4f71af,_0x241a34[_0x0cad('0x45')]);return db[_0x0cad('0x58')][_0x0cad('0x25')]({'where':_0x4f71af['where']})[_0x0cad('0x13')](function(_0x3cd1ef){_0x5ca327[_0x0cad('0x25')]=_0x3cd1ef;if(_0x241a34[_0x0cad('0x36')][_0x0cad('0x47')]){_0x4f71af[_0x0cad('0x48')]=[{'all':!![]}];}return db[_0x0cad('0x58')][_0x0cad('0x49')](_0x4f71af);})['then'](function(_0x2f2470){_0x5ca327[_0x0cad('0x4a')]=_0x2f2470;return _0x5ca327;});}})[_0x0cad('0x13')](respondWithFilteredResult(_0x390553,_0x4f71af))['catch'](handleError(_0x390553,null));};exports[_0x0cad('0x5b')]=function(_0x397e4f,_0xc8f8ad){return db[_0x0cad('0x46')]['find']({'where':{'id':_0x397e4f['params']['id']}})[_0x0cad('0x13')](handleEntityNotFound(_0xc8f8ad,null))[_0x0cad('0x13')](function(_0x707b69){if(_0x707b69){return _0x707b69[_0x0cad('0x5b')](_0x397e4f[_0x0cad('0x36')]['ids']);}})['then'](respondWithStatusCode(_0xc8f8ad,null))['catch'](handleError(_0xc8f8ad,null));};exports['addAnswer']=function(_0x39c28f,_0x1d4f23){if(_0x39c28f[_0x0cad('0x4d')]['id']){delete _0x39c28f[_0x0cad('0x4d')]['id'];}return db[_0x0cad('0x46')][_0x0cad('0x52')]({'where':{'id':_0x39c28f[_0x0cad('0x4b')]['id']}})[_0x0cad('0x13')](handleEntityNotFound(_0x1d4f23,null))[_0x0cad('0x13')](function(_0x598af6){if(_0x598af6){_0x39c28f[_0x0cad('0x4d')][_0x0cad('0x57')]=_0x598af6['id'];return db[_0x0cad('0x5c')]['create'](_0x39c28f[_0x0cad('0x4d')]);}})[_0x0cad('0x13')](respondWithResult(_0x1d4f23,null))[_0x0cad('0x1e')](handleError(_0x1d4f23,null));};exports[_0x0cad('0x5d')]=function(_0x41c8e3,_0x1e4cc0){var _0x437571={'raw':![],'where':{}};var _0x46b705={};var _0x44401d={'count':0x0,'rows':[]};return db[_0x0cad('0x46')]['findOne']({'where':{'id':_0x41c8e3['params']['id']}})[_0x0cad('0x13')](handleEntityNotFound(_0x1e4cc0,null))[_0x0cad('0x13')](function(_0x4a06ca){if(_0x4a06ca){_0x46b705[_0x0cad('0x35')]=_[_0x0cad('0x37')](db[_0x0cad('0x5c')]['rawAttributes']);_0x46b705[_0x0cad('0x36')]=_['keys'](_0x41c8e3[_0x0cad('0x36')]);_0x46b705[_0x0cad('0x38')]=_[_0x0cad('0x3a')](_0x46b705[_0x0cad('0x35')],_0x46b705[_0x0cad('0x36')]);_0x437571[_0x0cad('0x39')]=_['intersection'](_0x46b705['model'],qs['fields'](_0x41c8e3[_0x0cad('0x36')][_0x0cad('0x3b')]));_0x437571['attributes']=_0x437571[_0x0cad('0x39')][_0x0cad('0x3c')]?_0x437571[_0x0cad('0x39')]:_0x46b705[_0x0cad('0x35')];if(!_0x41c8e3[_0x0cad('0x36')][_0x0cad('0x3d')](_0x0cad('0x3e'))){_0x437571[_0x0cad('0x24')]=qs['limit'](_0x41c8e3['query'][_0x0cad('0x24')]);_0x437571[_0x0cad('0x22')]=qs[_0x0cad('0x22')](_0x41c8e3[_0x0cad('0x36')][_0x0cad('0x22')]);}_0x437571[_0x0cad('0x3f')]=qs[_0x0cad('0x40')](_0x41c8e3[_0x0cad('0x36')][_0x0cad('0x40')]);_0x437571[_0x0cad('0x43')]=qs[_0x0cad('0x38')](_[_0x0cad('0x41')](_0x41c8e3[_0x0cad('0x36')],_0x46b705[_0x0cad('0x38')]));_0x437571[_0x0cad('0x43')][_0x0cad('0x57')]=_0x4a06ca['id'];if(_0x41c8e3[_0x0cad('0x36')]['filter']){_0x437571[_0x0cad('0x43')]=_[_0x0cad('0x44')](_0x437571[_0x0cad('0x43')],{'$or':_[_0x0cad('0x32')](_0x437571[_0x0cad('0x39')],function(_0x28f9ca){var _0x128815={};_0x128815[_0x28f9ca]={'$like':'%'+_0x41c8e3[_0x0cad('0x36')][_0x0cad('0x42')]+'%'};return _0x128815;})});}_0x437571=_['merge']({},_0x437571,_0x41c8e3[_0x0cad('0x45')]);return db['CannedAnswer']['count']({'where':_0x437571['where']})[_0x0cad('0x13')](function(_0x24790d){_0x44401d[_0x0cad('0x25')]=_0x24790d;if(_0x41c8e3[_0x0cad('0x36')][_0x0cad('0x47')]){_0x437571[_0x0cad('0x48')]=[{'all':!![]}];}return db[_0x0cad('0x5c')][_0x0cad('0x49')](_0x437571);})[_0x0cad('0x13')](function(_0x291b92){_0x44401d[_0x0cad('0x4a')]=_0x291b92;return _0x44401d;});}})[_0x0cad('0x13')](respondWithFilteredResult(_0x1e4cc0,_0x437571))[_0x0cad('0x1e')](handleError(_0x1e4cc0,null));};exports[_0x0cad('0x5e')]=function(_0x4cd210,_0x37bc7d){return db[_0x0cad('0x46')][_0x0cad('0x52')]({'where':{'id':_0x4cd210['params']['id']}})[_0x0cad('0x13')](handleEntityNotFound(_0x37bc7d,null))[_0x0cad('0x13')](function(_0x1a393f){if(_0x1a393f){return _0x1a393f['removeAnswers'](_0x4cd210[_0x0cad('0x36')][_0x0cad('0x5f')]);}})[_0x0cad('0x13')](respondWithStatusCode(_0x37bc7d,null))[_0x0cad('0x1e')](handleError(_0x37bc7d,null));};exports['addLogo']=function(_0x446f84,_0x4d87ce){_0x446f84[_0x0cad('0x4d')][_0x0cad('0x60')]=_0x446f84[_0x0cad('0x61')][_0x0cad('0x62')];return db[_0x0cad('0x46')][_0x0cad('0x52')]({'where':{'id':_0x446f84[_0x0cad('0x4b')]['id']}})[_0x0cad('0x13')](handleEntityNotFound(_0x4d87ce,null))[_0x0cad('0x13')](saveUpdates(_0x446f84[_0x0cad('0x4d')],null))[_0x0cad('0x13')](respondWithResult(_0x4d87ce,null))[_0x0cad('0x1e')](handleError(_0x4d87ce,null));};exports['addAvatar']=function(_0x159428,_0x51b772){_0x159428['body'][_0x0cad('0x63')]=_0x159428[_0x0cad('0x61')][_0x0cad('0x62')];return db[_0x0cad('0x46')][_0x0cad('0x52')]({'where':{'id':_0x159428['params']['id']}})[_0x0cad('0x13')](handleEntityNotFound(_0x51b772,null))['then'](saveUpdates(_0x159428[_0x0cad('0x4d')],null))[_0x0cad('0x13')](respondWithResult(_0x51b772,null))['catch'](handleError(_0x51b772,null));};exports[_0x0cad('0x64')]=function(_0x4dbbf0,_0x1115dd){_0x4dbbf0['body'][_0x0cad('0x65')]=_0x4dbbf0['file'][_0x0cad('0x62')];return db['ChatWebsite'][_0x0cad('0x52')]({'where':{'id':_0x4dbbf0[_0x0cad('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1115dd,null))[_0x0cad('0x13')](saveUpdates(_0x4dbbf0['body'],null))[_0x0cad('0x13')](respondWithResult(_0x1115dd,null))[_0x0cad('0x1e')](handleError(_0x1115dd,null));};exports[_0x0cad('0x66')]=function(_0xd16af6,_0x434c99){_0xd16af6[_0x0cad('0x4d')][_0x0cad('0x67')]=_0xd16af6['file'][_0x0cad('0x62')];return db[_0x0cad('0x46')][_0x0cad('0x52')]({'where':{'id':_0xd16af6[_0x0cad('0x4b')]['id']}})['then'](handleEntityNotFound(_0x434c99,null))[_0x0cad('0x13')](saveUpdates(_0xd16af6[_0x0cad('0x4d')],null))[_0x0cad('0x13')](respondWithResult(_0x434c99,null))[_0x0cad('0x1e')](handleError(_0x434c99,null));};exports[_0x0cad('0x68')]=function(_0x210fd9,_0x4a86b0){var _0x2913b1=path[_0x0cad('0x69')](config['root'],'server/files/images/logos/default_logo.svg');var _0x203f91={'where':{'id':_0x210fd9[_0x0cad('0x4b')]['id']},'attributes':['id',_0x0cad('0x60')],'raw':!![]};var _0x48a2c6=![];return require(_0x0cad('0x6a'))['getLicense']()[_0x0cad('0x13')](function(_0x10d072){if(_0x10d072){_0x48a2c6=_0x10d072[_0x0cad('0x6b')];}})[_0x0cad('0x13')](function(){return db[_0x0cad('0x46')]['find'](_0x203f91);})[_0x0cad('0x13')](handleEntityNotFound(_0x4a86b0,null))[_0x0cad('0x13')](function(_0x6e4b92){if(_0x6e4b92){if(!_[_0x0cad('0x6c')](_0x6e4b92[_0x0cad('0x60')])){if(fs['existsSync'](path[_0x0cad('0x69')](config['root'],_0x0cad('0x6d'),_0x6e4b92[_0x0cad('0x60')]))&&_0x48a2c6){_0x2913b1=path['join'](config['root'],_0x0cad('0x6d'),_0x6e4b92[_0x0cad('0x60')]);}}return _0x4a86b0[_0x0cad('0x6e')](_0x2913b1);}})['catch'](handleError(_0x4a86b0,null));};exports[_0x0cad('0x6f')]=function(_0x35091d,_0x4df3f2){var _0x55248d=path['join'](config[_0x0cad('0x70')],_0x0cad('0x71'));var _0x5adb68={'where':{'id':_0x35091d[_0x0cad('0x4b')]['id']},'attributes':['id',_0x0cad('0x63')],'raw':!![]};return db['ChatWebsite'][_0x0cad('0x52')](_0x5adb68)[_0x0cad('0x13')](handleEntityNotFound(_0x4df3f2,null))[_0x0cad('0x13')](function(_0xcc40c){if(_0xcc40c){if(!_[_0x0cad('0x6c')](_0xcc40c[_0x0cad('0x63')])){if(fs[_0x0cad('0x72')](path[_0x0cad('0x69')](config[_0x0cad('0x70')],_0x0cad('0x73'),_0xcc40c[_0x0cad('0x63')]))){_0x55248d=path['join'](config[_0x0cad('0x70')],_0x0cad('0x73'),_0xcc40c[_0x0cad('0x63')]);}}return _0x4df3f2[_0x0cad('0x6e')](_0x55248d);}})['catch'](handleError(_0x4df3f2,null));};exports[_0x0cad('0x74')]=function(_0x4e150b,_0x2e2d73){var _0x35712d=path[_0x0cad('0x69')](config[_0x0cad('0x70')],_0x0cad('0x75'));var _0x58a80a={'where':{'id':_0x4e150b['params']['id']},'attributes':['id',_0x0cad('0x65'),'showCustomerAvatar'],'raw':!![]};return db[_0x0cad('0x46')][_0x0cad('0x52')](_0x58a80a)[_0x0cad('0x13')](handleEntityNotFound(_0x2e2d73,null))[_0x0cad('0x13')](function(_0x16145d){if(_0x16145d){if(!_[_0x0cad('0x6c')](_0x16145d['customerAvatar'])){if(fs['existsSync'](path[_0x0cad('0x69')](config[_0x0cad('0x70')],_0x0cad('0x73'),_0x16145d[_0x0cad('0x65')]))&&_0x16145d[_0x0cad('0x76')]){_0x35712d=path[_0x0cad('0x69')](config[_0x0cad('0x70')],_0x0cad('0x73'),_0x16145d[_0x0cad('0x65')]);}}return _0x2e2d73['download'](_0x35712d);}})[_0x0cad('0x1e')](handleError(_0x2e2d73,null));};exports[_0x0cad('0x77')]=function(_0x1f31a6,_0x58f518){var _0x18a26f=path['join'](config['root'],_0x0cad('0x78'));var _0xba7351={'where':{'id':_0x1f31a6['params']['id']},'attributes':['id',_0x0cad('0x67')],'raw':!![]};return db[_0x0cad('0x46')][_0x0cad('0x52')](_0xba7351)[_0x0cad('0x13')](handleEntityNotFound(_0x58f518,null))['then'](function(_0x3f4271){if(_0x3f4271){if(!_[_0x0cad('0x6c')](_0x3f4271['systemAvatar'])){if(fs[_0x0cad('0x72')](path[_0x0cad('0x69')](config['root'],'server/files/images/avatars/',_0x3f4271[_0x0cad('0x67')]))){_0x18a26f=path[_0x0cad('0x69')](config[_0x0cad('0x70')],_0x0cad('0x73'),_0x3f4271[_0x0cad('0x67')]);}}return _0x58f518[_0x0cad('0x6e')](_0x18a26f);}})[_0x0cad('0x1e')](handleError(_0x58f518,null));};exports[_0x0cad('0x79')]=function(_0x41b54a,_0x3a2df2){var _0x149aac=require(_0x0cad('0x7a'));var _0x5f0a7c=new _0x149aac();var _0x3bf079=_0x5f0a7c[_0x0cad('0x7b')](_0x41b54a[_0x0cad('0x7c')][_0x0cad('0x7d')])['getResult']();var _0x3029e7={'body':_0x41b54a[_0x0cad('0x4d')],'channel':_0x0cad('0x7e')};var _0x58070f=[];var _0x29ceda=[];var _0x5d619f={};var _0x2726c4=![];return db[_0x0cad('0x7f')]['describe']()['then'](function(_0x1b1181){if(!_0x1b1181){throw new db[(_0x0cad('0x80'))]['ValidationError']('no\x20available\x20attributes');}_0x58070f=_['difference'](_['keys'](_0x1b1181),[_0x0cad('0x81'),_0x0cad('0x82')]);_0x29ceda=_['difference'](_[_0x0cad('0x37')](_0x1b1181),[_0x0cad('0x81'),'updatedAt',_0x0cad('0x83'),'ListId']);if(_0x41b54a[_0x0cad('0x4d')]['id']){delete _0x41b54a['body']['id'];}if(_['isNil'](_0x41b54a[_0x0cad('0x4d')][_0x0cad('0x84')])){throw new db[(_0x0cad('0x80'))][(_0x0cad('0x85'))](_0x0cad('0x86'));}if(_[_0x0cad('0x6c')](_0x41b54a[_0x0cad('0x4d')][_0x0cad('0x4d')])||_0x41b54a['body']['body']===''){throw new db['Sequelize'][(_0x0cad('0x85'))](_0x0cad('0x87'));}if(_[_0x0cad('0x6c')](_0x41b54a['body'][_0x0cad('0x88')])){throw new db[(_0x0cad('0x80'))][(_0x0cad('0x85'))](_0x0cad('0x89')+_0x29ceda);}if(!_[_0x0cad('0x8a')](_0x29ceda,_0x41b54a[_0x0cad('0x4d')][_0x0cad('0x88')])){throw new db['Sequelize'][(_0x0cad('0x85'))](_0x0cad('0x8b')+_0x29ceda);}_0x5d619f[_0x41b54a['body'][_0x0cad('0x88')]]=_0x41b54a[_0x0cad('0x4d')][_0x0cad('0x84')];})[_0x0cad('0x13')](function(){return db['ChatWebsite'][_0x0cad('0x52')]({'where':{'id':_0x41b54a[_0x0cad('0x4b')]['id']},'include':[{'model':db[_0x0cad('0x8c')],'as':'List','include':[{'model':db[_0x0cad('0x7f')],'as':_0x0cad('0x8d'),'where':_0x5d619f,'limit':0x1,'order':[[_0x0cad('0x82'),_0x0cad('0x8e')]]}]},{'model':db[_0x0cad('0x8f')],'as':'Applications'}]});})[_0x0cad('0x13')](handleEntityNotFound(_0x3a2df2,null))[_0x0cad('0x13')](function(_0x44410d){if(_0x44410d&&_0x44410d[_0x0cad('0x90')]){_0x3029e7[_0x0cad('0x91')]=_0x44410d;_0x3029e7['applications']=_0x44410d[_0x0cad('0x92')];_0x3029e7['list']=_0x44410d[_0x0cad('0x90')];_0x3029e7[_0x0cad('0x93')]=_[_0x0cad('0x94')](_0x3029e7[_0x0cad('0x93')],['priority'],['asc']);if(_0x3029e7['account']['Applications']){delete _0x3029e7['account'][_0x0cad('0x92')];}if(_0x3029e7[_0x0cad('0x91')]['List']&&_0x3029e7['account'][_0x0cad('0x90')][_0x0cad('0x8d')][_0x0cad('0x3c')]){return _0x3029e7['account'][_0x0cad('0x90')]['Contacts'][0x0];}var _0x1cd958=_['defaults'](_0x41b54a[_0x0cad('0x4d')],{'firstName':_0x41b54a[_0x0cad('0x4d')][_0x0cad('0x84')],'ListId':_0x44410d[_0x0cad('0x95')]});_0x1cd958[_0x41b54a[_0x0cad('0x4d')][_0x0cad('0x88')]]=_0x41b54a[_0x0cad('0x4d')][_0x0cad('0x84')];return db[_0x0cad('0x7f')][_0x0cad('0x4c')](_0x1cd958,{'fields':_0x58070f,'raw':!![]});}})[_0x0cad('0x13')](handleEntityNotFound(_0x3a2df2,null))['then'](function(_0x178522){_0x3029e7[_0x0cad('0x96')]=_0x178522;var _0x3b45be=_0x41b54a[_0x0cad('0x4d')][_0x0cad('0x97')];if(_0x41b54a[_0x0cad('0x7c')][_0x0cad('0x98')]){_0x3b45be=_0x41b54a[_0x0cad('0x7c')][_0x0cad('0x98')];}else if(_0x41b54a[_0x0cad('0x7c')][_0x0cad('0x99')]){_0x3b45be=_[_0x0cad('0x9a')](_0x41b54a[_0x0cad('0x7c')][_0x0cad('0x99')][_0x0cad('0x9b')](','));}if(_0x178522){var _0x52f1c0={'ContactId':_0x178522['id'],'ChatWebsiteId':_0x41b54a['params']['id'],'from':(_0x178522[_0x0cad('0x9c')]||'')+'\x20'+(_0x178522['lastName']||''),'customerIp':_0x3b45be,'customerPort':_0x41b54a['headers'][_0x0cad('0x9d')]?_0x41b54a['headers'][_0x0cad('0x9d')]:null,'referer':_0x41b54a[_0x0cad('0x4d')][_0x0cad('0x9e')],'browserName':_0x3bf079['browser']['name']&&_0x3bf079[_0x0cad('0x9f')][_0x0cad('0xa0')]?util[_0x0cad('0xa1')](_0x0cad('0xa2'),_0x3bf079[_0x0cad('0x9f')][_0x0cad('0x2d')],_0x3bf079[_0x0cad('0x9f')][_0x0cad('0xa0')]):_0x0cad('0xa3'),'browserVersion':_0x3bf079[_0x0cad('0x9f')][_0x0cad('0xa0')]||'unknown','osName':util[_0x0cad('0xa1')](_0x0cad('0xa2'),_0x3bf079['os']['name'],_0x3bf079['os'][_0x0cad('0xa0')]),'osVersion':_0x3bf079['os'][_0x0cad('0xa0')],'deviceModel':_0x3bf079[_0x0cad('0xa4')]['model']&&_0x3bf079[_0x0cad('0xa4')][_0x0cad('0xa5')]?util[_0x0cad('0xa1')](_0x0cad('0xa6'),_0x3bf079[_0x0cad('0xa4')]['model'],_0x3bf079['device'][_0x0cad('0xa5')],_0x3bf079[_0x0cad('0xa4')]['type']):null,'deviceVendor':_0x3bf079[_0x0cad('0xa4')][_0x0cad('0xa5')],'deviceType':_0x3bf079['device'][_0x0cad('0x34')],'formData':JSON[_0x0cad('0x19')](_0x41b54a['body'])};var _0x3c3894={'ChatWebsiteId':_0x41b54a[_0x0cad('0x4b')]['id'],'closed':![]};if(_0x41b54a['body']['threadId']){_0x3c3894[_0x0cad('0xa7')]=_0x41b54a[_0x0cad('0x4d')]['threadId'];return db[_0x0cad('0xa8')][_0x0cad('0x52')]({'where':_0x3c3894})[_0x0cad('0x13')](function(_0x53454d){if(_0x53454d){return[_0x53454d,![]];}_0x52f1c0['threadId']=_0x41b54a[_0x0cad('0x4d')][_0x0cad('0xa7')];_0x52f1c0['externalUrl']=_0x41b54a[_0x0cad('0x4d')]['externalUrl'];return db[_0x0cad('0xa8')][_0x0cad('0x4c')](_0x52f1c0)[_0x0cad('0x13')](function(_0x108614){return[_0x108614,!![]];});});}_0x3c3894['ContactId']=_0x178522['id'];if(_0x41b54a[_0x0cad('0x4d')][_0x0cad('0xa9')]&&_0x41b54a['body'][_0x0cad('0xa9')]['id']){_0x3c3894['id']=_0x41b54a[_0x0cad('0x4d')][_0x0cad('0xa9')]['id'];return db[_0x0cad('0xa8')][_0x0cad('0x52')]({'where':_0x3c3894})['then'](function(_0x198a68){if(_0x198a68){return[_0x198a68,![]];}return db[_0x0cad('0xa8')]['create'](_0x52f1c0)[_0x0cad('0x13')](function(_0x3d66b5){return[_0x3d66b5,!![]];});});}return db[_0x0cad('0xa8')][_0x0cad('0x4c')](_0x52f1c0)[_0x0cad('0x13')](function(_0x51a707){return[_0x51a707,!![]];});}})[_0x0cad('0xaa')](function(_0x2f2b2d,_0xcb0b04){if(_0x2f2b2d){_0x2726c4=_0xcb0b04;if(!_0xcb0b04){var _0x4fb183={'from':(_0x3029e7[_0x0cad('0x96')][_0x0cad('0x9c')]||'')+'\x20'+(_0x3029e7['contact']['lastName']||'')};if(_0x41b54a['body'][_0x0cad('0xa7')]&&_0x41b54a[_0x0cad('0x4d')]['messageId']&&_0x41b54a[_0x0cad('0x4d')]['threadId']!=_0x41b54a[_0x0cad('0x4d')]['messageId']){_0x4fb183['threadId']=_0x41b54a[_0x0cad('0x4d')][_0x0cad('0xab')];}return _0x2f2b2d['update'](_0x4fb183);}else{return _0x2f2b2d;}}})[_0x0cad('0x13')](function(_0x6ab081){_0x3029e7[_0x0cad('0xa9')]=_0x6ab081['get']({'plain':!![]});_0x3029e7[_0x0cad('0xa9')][_0x0cad('0xac')]=_0x2726c4;if(_0x3029e7[_0x0cad('0xa9')][_0x0cad('0xac')]){if(_0x3029e7[_0x0cad('0x91')][_0x0cad('0xad')]){_0x3029e7[_0x0cad('0x93')][_0x0cad('0xae')]({'id':0x0,'priority':_0x3029e7[_0x0cad('0x93')][_0x0cad('0x3c')]+0x1,'app':_0x0cad('0xaf'),'appdata':'unmanaged','interval':_0x0cad('0xb0')});}}return db['ChatMessage'][_0x0cad('0x4c')]({'body':_0x41b54a[_0x0cad('0x4d')]['body'],'ChatWebsiteId':_0x41b54a[_0x0cad('0x4b')]['id'],'ChatInteractionId':_0x6ab081['id'],'direction':'in','ContactId':_0x3029e7[_0x0cad('0x96')]['id'],'AttachmentId':_0x41b54a[_0x0cad('0x4d')][_0x0cad('0xb1')]});})[_0x0cad('0x13')](function(_0xe0bc58){_0x3029e7[_0x0cad('0x1c')]=_0xe0bc58;if(_0x3029e7['interaction'][_0x0cad('0xb2')]){return db[_0x0cad('0xb3')]['find']({'attributes':['id','name'],'where':{'id':_0x3029e7[_0x0cad('0xa9')][_0x0cad('0xb2')]}})[_0x0cad('0x13')](function(_0x4b5488){if(_0x4b5488){_0x3029e7['applications'][_0x0cad('0xb4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4b5488['name']+','+(_0x3029e7[_0x0cad('0x91')][_0x0cad('0xb5')]||0xa),'interval':_0x0cad('0xb0')});_0x3029e7['forcedOwnership']=!![];}return respondWithRpcPromise(_0x0cad('0xb6'),_0x0cad('0xb7'),_0x3029e7);});}return respondWithRpcPromise('Start',_0x0cad('0xb7'),_0x3029e7);})[_0x0cad('0x13')](function(_0x5272ea){respondWithRpcPromise(_0x0cad('0xb8'),_0x0cad('0xb8'),{'event':'notify','message':_0x5272ea},client9002);return _0x5272ea;})['then'](respondWithResult(_0x3a2df2,null))[_0x0cad('0x1e')](handleError(_0x3a2df2,null));};exports[_0x0cad('0xb9')]=function(_0x3aca67,_0x2980a7){var _0x7bd5f2,_0x579989,_0x1511ec;var _0x67e894=[];var _0x26b668={};var _0x30e050=_0x3aca67['files']||[];var _0x595fe8=[];var _0x5b1bb3;return db[_0x0cad('0x7f')][_0x0cad('0x55')]()['then'](function(_0x545854){if(!_0x545854){throw new db[(_0x0cad('0x80'))][(_0x0cad('0x85'))]('no\x20available\x20attributes');}_0x67e894=_[_0x0cad('0xba')](_[_0x0cad('0x37')](_0x545854),[_0x0cad('0x81'),_0x0cad('0x82'),_0x0cad('0x83'),_0x0cad('0x95')]);if(_0x3aca67[_0x0cad('0x4d')]['id']){delete _0x3aca67['body']['id'];}if(_['isNil'](_0x3aca67[_0x0cad('0x4d')]['from'])){throw _0x2980a7[_0x0cad('0x20')](0x1f4)['send'](new db['Sequelize'][(_0x0cad('0x85'))](_0x0cad('0x86')));}if(_[_0x0cad('0x6c')](_0x3aca67[_0x0cad('0x4d')][_0x0cad('0x4d')])||_0x3aca67[_0x0cad('0x4d')][_0x0cad('0x4d')]===''){throw _0x2980a7['status'](0x1f4)['send'](new db[(_0x0cad('0x80'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x0cad('0x6c')](_0x3aca67[_0x0cad('0x4d')][_0x0cad('0xbb')])){throw _0x2980a7[_0x0cad('0x20')](0x1f4)[_0x0cad('0x2e')](new db['Sequelize'][(_0x0cad('0x85'))](_0x0cad('0xbc')+_0x67e894));}if(!_[_0x0cad('0x8a')](_0x67e894,_0x3aca67[_0x0cad('0x4d')]['mapKeyOffline'])){throw _0x2980a7[_0x0cad('0x20')](0x1f4)['send'](new db[(_0x0cad('0x80'))][(_0x0cad('0x85'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x67e894));}_0x26b668[_0x3aca67[_0x0cad('0x4d')][_0x0cad('0xbb')]]=_0x3aca67[_0x0cad('0x4d')]['from'];})[_0x0cad('0x13')](function(){return db['ChatWebsite'][_0x0cad('0x52')]({'where':{'id':_0x3aca67[_0x0cad('0x4b')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0x0cad('0xbd')],'as':_0x0cad('0xbd')}]});})['then'](handleEntityNotFound(_0x2980a7,null))[_0x0cad('0x13')](function(_0x3aeaff){if(_0x3aeaff&&_0x3aeaff[_0x0cad('0x90')]){_0x579989=_0x3aeaff;var _0x3a53b2=_[_0x0cad('0xa')](_0x3aca67[_0x0cad('0x4d')],{'firstName':_0x3aca67[_0x0cad('0x4d')][_0x0cad('0x84')],'phone':_0x3aca67[_0x0cad('0x4d')][_0x0cad('0x84')],'ListId':_0x3aeaff[_0x0cad('0x95')]});_0x3a53b2[_0x3aca67[_0x0cad('0x4d')]['mapKeyOffline']]=_0x3aca67['body'][_0x0cad('0x84')];return db['CmContact'][_0x0cad('0xbe')]({'where':_0x26b668,'defaults':_0x3a53b2});}})[_0x0cad('0xaa')](function(_0x361754){if(_0x361754){_0x1511ec=_0x361754;var _0x2446a2=fs[_0x0cad('0xbf')](path[_0x0cad('0x69')](config['root'],_0x0cad('0xc0')),_0x0cad('0xc1'));var _0x271321=ejs['render'](_0x2446a2,{'body':_[_0x0cad('0xc2')](_0x3aca67['body'][_0x0cad('0x4d')]),'bodyTitle':_0x579989[_0x0cad('0xc3')]});return db[_0x0cad('0xc4')][_0x0cad('0x4c')]({'body':_0x271321,'plainBody':htmlToText[_0x0cad('0xc5')](_0x271321),'ContactId':_0x361754['id'],'ChatWebsiteId':_0x579989['id']});}})[_0x0cad('0x13')](function(_0x1964dc){_0x5b1bb3=_0x1964dc;if(_0x30e050[_0x0cad('0x3c')]){var _0xabb682=_0x30e050['map'](function(_0x235a1e){return{'name':_0x235a1e[_0x0cad('0xc6')],'basename':_0x235a1e[_0x0cad('0x62')],'type':_0x235a1e['mimetype'],'ChatOfflineMessageId':_0x1964dc['id']};});_0x595fe8=_0xabb682[_0x0cad('0x32')](_0x595079=>{var _0x546917={'filename':_0x595079[_0x0cad('0x2d')],'path':path[_0x0cad('0x69')](config['root'],'server','files',_0x0cad('0xc7'),_0x0cad('0xc8'),_0x595079['basename'])};return _0x546917;});if(!_0x579989[_0x0cad('0xc9')]){return db['sequelize'][_0x0cad('0xca')](function(_0x5dc2c2){return db['Attachment'][_0x0cad('0xcb')](_0xabb682,{'transaction':_0x5dc2c2});});}}})[_0x0cad('0x13')](function(){if(_0x5b1bb3){_0x7bd5f2=_0x5b1bb3;return db[_0x0cad('0xbd')][_0x0cad('0x5a')]({'where':{'service':!![]},'include':[{'model':db[_0x0cad('0xcc')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x0cad('0xcd'),'raw':!![]}]}]});}})[_0x0cad('0x13')](function(_0x983ee4){if(_0x983ee4&&_0x983ee4['Smtp']&&_0x579989[_0x0cad('0xce')]&&_0x579989[_0x0cad('0xcf')]){var _0x25bc76=_0x983ee4[_0x0cad('0xd0')]();return respondWithRpcPromise(_0x0cad('0xd1'),_0x0cad('0xd2'),{'account':_0x25bc76,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x983ee4[_0x0cad('0x2d')],_0x983ee4[_0x0cad('0xd3')]||_0x983ee4[_0x0cad('0xd4')][_0x0cad('0x4e')]),'to':_0x579989[_0x0cad('0xcf')],'subject':_0x579989['offlineMessageSubject'],'html':_0x7bd5f2[_0x0cad('0x4d')],'attachments':_0x595fe8}},client9003)['then'](function(){return _0x7bd5f2;})['catch'](function(_0x58825a){logger['error'](_0x58825a);});}})[_0x0cad('0x13')](function(){if(_0x579989&&_0x579989[_0x0cad('0xc9')]&&_0x579989[_0x0cad('0xd5')]){var _0x486aba=[];if(_0x30e050[_0x0cad('0x3c')]){_0x486aba=_0x30e050[_0x0cad('0x32')](function(_0x15eafa){return{'name':_0x15eafa['originalname'],'basename':_0x15eafa['filename'],'type':_0x15eafa[_0x0cad('0xd6')],'ChatOfflineMessageId':_0x5b1bb3['id']};});}var _0x507371;if(!_['isNil'](_0x579989[_0x0cad('0xd7')])){var _0x287ad1=_[_0x0cad('0x32')](_0x3aca67[_0x0cad('0x4d')],function(_0x15c106){return _0x15c106;});var _0x20543b=_[_0x0cad('0xd8')](_0x287ad1)[0x0];var _0x1de185=_[_0x0cad('0xd9')](_0x20543b,function(_0x47cb5d){return _0x47cb5d;});_0x507371=_0x1de185[0x1][_0x579989[_0x0cad('0xd7')]];}var _0x208d36={'from':_0x1511ec[_0x0cad('0xd3')],'firstName':_0x1511ec[_0x0cad('0x9c')],'lastName':_0x1511ec[_0x0cad('0xda')],'mapKey':_0x0cad('0xd3'),'message':{'from':_0x1511ec[_0x0cad('0xd3')],'to':_0x579989[_0x0cad('0xbd')][_0x0cad('0xd3')],'cc':'','subject':_['isNil'](_0x507371)?_0x579989[_0x0cad('0xdb')]:_0x507371,'messageId':'','sentAt':new Date(),'attach':_0x486aba[_0x0cad('0x3c')],'attachments':_0x486aba,'originChannel':_0x0cad('0xdc'),'ChatWebsiteId':_0x579989['id'],'ChatOfflineMessageId':_0x7bd5f2['id'],'originTo':_0x579989['MailAccount'][_0x0cad('0xd3')]},'body':_0x7bd5f2[_0x0cad('0x4d')]};var _0x4fb4e9={'account':{'id':_0x579989['MailAccountId']},'body':_0x208d36,'log':_0x0cad('0xdd')};return respondWithRpcPromise('NotifyMailAccount',_0x0cad('0xde'),_0x4fb4e9,client9001)[_0x0cad('0x13')](function(){return _0x7bd5f2;})[_0x0cad('0x1e')](function(_0xbf65fa){logger[_0x0cad('0x1a')](_0xbf65fa);});}return;})['then'](function(){if(_0x7bd5f2){return _0x7bd5f2;}})['then'](respondWithResult(_0x2980a7,null))[_0x0cad('0x1e')](function(_0x58ab84){logger[_0x0cad('0x1a')]('catch',_0x58ab84);for(var _0x5622cd of _0x30e050){var _0x10bfe4=path[_0x0cad('0x69')](config['root'],'server',_0x0cad('0xdf'),_0x0cad('0xc7'),_0x0cad('0xc8'),_0x5622cd[_0x0cad('0x62')]);fs_extra[_0x0cad('0xe0')](_0x10bfe4)[_0x0cad('0x1e')](function(_0x446d92){logger[_0x0cad('0x1a')](_0x0cad('0xe1'),_0x10bfe4,_0x446d92);});}});};exports[_0x0cad('0xe2')]=function(_0x35879d,_0x53b45b){return db[_0x0cad('0xa8')]['find']({'where':{'id':_0x35879d[_0x0cad('0x4b')]['id']}})[_0x0cad('0x13')](handleEntityNotFound(_0x53b45b,null))[_0x0cad('0x13')](function(_0x8b4cf8){if(_0x8b4cf8){return _0x8b4cf8[_0x0cad('0xe2')](_0x35879d[_0x0cad('0x4d')]['ids'],_[_0x0cad('0xe3')](_0x35879d[_0x0cad('0x4d')],[_0x0cad('0x5f'),'id'])||{});}})['then'](respondWithResult(_0x53b45b,null))['catch'](handleError(_0x53b45b,null));};exports[_0x0cad('0xe4')]=function(_0x1c35f9,_0xe7a4e8){var _0x4de2cf={'raw':![],'where':{}};var _0x594b11={};var _0x1f1ca1={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0cad('0x5a')]({'where':{'id':_0x1c35f9[_0x0cad('0x4b')]['id']}})['then'](handleEntityNotFound(_0xe7a4e8,null))[_0x0cad('0x13')](function(_0x30ea62){if(_0x30ea62){_0x594b11['model']=_[_0x0cad('0x37')](db[_0x0cad('0xa8')][_0x0cad('0x33')]);_0x594b11[_0x0cad('0x36')]=_['keys'](_0x1c35f9[_0x0cad('0x36')]);_0x594b11[_0x0cad('0x38')]=_['intersection'](_0x594b11[_0x0cad('0x35')],_0x594b11[_0x0cad('0x36')]);_0x4de2cf[_0x0cad('0x39')]=_[_0x0cad('0x3a')](_0x594b11[_0x0cad('0x35')],qs[_0x0cad('0x3b')](_0x1c35f9[_0x0cad('0x36')]['fields']));_0x4de2cf[_0x0cad('0x39')]=_0x4de2cf[_0x0cad('0x39')][_0x0cad('0x3c')]?_0x4de2cf['attributes']:_0x594b11[_0x0cad('0x35')];if(!_0x1c35f9['query']['hasOwnProperty'](_0x0cad('0x3e'))){_0x4de2cf[_0x0cad('0x24')]=qs[_0x0cad('0x24')](_0x1c35f9[_0x0cad('0x36')][_0x0cad('0x24')]);_0x4de2cf[_0x0cad('0x22')]=qs['offset'](_0x1c35f9['query'][_0x0cad('0x22')]);}_0x4de2cf[_0x0cad('0x3f')]=qs[_0x0cad('0x40')](_0x1c35f9[_0x0cad('0x36')][_0x0cad('0x40')]);_0x4de2cf[_0x0cad('0x43')]=qs['filters'](_[_0x0cad('0x41')](_0x1c35f9['query'],_0x594b11[_0x0cad('0x38')]));_0x4de2cf['where'][_0x0cad('0x57')]=_0x30ea62['id'];if(_0x1c35f9[_0x0cad('0x36')]['filter']){_0x4de2cf[_0x0cad('0x43')]=_[_0x0cad('0x44')](_0x4de2cf[_0x0cad('0x43')],{'$or':_[_0x0cad('0x32')](_0x4de2cf[_0x0cad('0x39')],function(_0x5e1e35){var _0x114d70={};_0x114d70[_0x5e1e35]={'$like':'%'+_0x1c35f9[_0x0cad('0x36')]['filter']+'%'};return _0x114d70;})});}_0x4de2cf=_[_0x0cad('0x44')]({},_0x4de2cf,_0x1c35f9['options']);return db[_0x0cad('0xa8')][_0x0cad('0x25')]({'where':_0x4de2cf[_0x0cad('0x43')]})[_0x0cad('0x13')](function(_0x47ab35){_0x1f1ca1[_0x0cad('0x25')]=_0x47ab35;if(_0x1c35f9[_0x0cad('0x36')][_0x0cad('0x47')]){_0x4de2cf[_0x0cad('0x48')]=[{'model':db[_0x0cad('0x7f')],'as':_0x0cad('0xe5'),'required':![]},{'model':db[_0x0cad('0xb3')],'as':_0x0cad('0xe6'),'attributes':[_0x0cad('0x2d'),_0x0cad('0xe7'),_0x0cad('0xe8')],'required':![]},{'model':db['Tag'],'as':_0x0cad('0xe9'),'attributes':['id',_0x0cad('0x2d'),'color'],'where':_0x1c35f9['query'][_0x0cad('0xea')]?{'id':_0x1c35f9[_0x0cad('0x36')]['tag']}:undefined,'required':_0x1c35f9['query'][_0x0cad('0xea')]?!![]:![]}];}return db[_0x0cad('0xa8')]['findAll'](_0x4de2cf);})[_0x0cad('0x13')](function(_0xb72009){_0x1f1ca1[_0x0cad('0x4a')]=_0xb72009;return _0x1f1ca1;});}})['then'](respondWithFilteredResult(_0xe7a4e8,_0x4de2cf))['catch'](handleError(_0xe7a4e8,null));};function iftimePromise(_0x2b613e,_0x46a965){return respondWithRpcPromise(_0x0cad('0xeb'),'getSnippet',{'command':_0x46a965[_0x0cad('0xec')]?util[_0x0cad('0xa1')](_0x0cad('0xed'),_0x2b613e[_0x0cad('0xee')],_0x46a965[_0x0cad('0xec')]):util[_0x0cad('0xa1')]('iftime\x20%s',_0x2b613e[_0x0cad('0xee')])},client9002)['then'](function(_0x4e3e28){var _0x214c1f=_0x4e3e28&&_0x4e3e28[_0x0cad('0xef')](_0x0cad('0xf0'))>=0x0?!![]:![];logger[_0x0cad('0x14')](_0x0cad('0xf1'),_0x46a965['id'],_0x2b613e['id'],_0x2b613e['interval'],_0x214c1f?_0x0cad('0xf2'):_0x0cad('0xf3'),_0x46a965[_0x0cad('0xec')]?_0x46a965[_0x0cad('0xec')]:_0x0cad('0xf4'));return _0x214c1f;})[_0x0cad('0x1e')](function(_0x7ff830){logger[_0x0cad('0x1a')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x46a965['id'],_0x2b613e['id'],_0x2b613e[_0x0cad('0xee')],util['inspect'](_0x7ff830,{'showHidden':![],'depth':null}),_0x46a965[_0x0cad('0xec')]?_0x46a965['timezone']:_0x0cad('0xf4'));return![];});}exports[_0x0cad('0xf5')]=function(_0x25555d,_0x35c0b7){var _0x145f25=0x0;var _0x520ddb=0x0;var _0x454702=![];var _0x28a456;var _0x19bf7d;return db[_0x0cad('0x46')][_0x0cad('0x52')]({'where':{'id':_0x25555d[_0x0cad('0x4b')]['id']},'include':[{'model':db[_0x0cad('0xf6')],'as':_0x0cad('0xf6'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x0cad('0xee')],'raw':!![]}]}]})[_0x0cad('0x13')](handleEntityNotFound(_0x35c0b7,null))[_0x0cad('0x13')](function(_0x26d535){if(_0x26d535){_0x28a456=_0x26d535;return _0x26d535[_0x0cad('0xf7')]({'raw':!![]});}})[_0x0cad('0x13')](function(_0x3948d7){if(_0x28a456){if(_0x3948d7){_0x19bf7d=_0x3948d7;}}return require(_0x0cad('0x6a'))[_0x0cad('0xf8')]();})['then'](function(_0x4af5e4){if(_0x4af5e4){_0x520ddb=_0x4af5e4['virtual'];_0x454702=_0x4af5e4[_0x0cad('0x6b')];}})[_0x0cad('0x13')](function(){return db[_0x0cad('0xa8')]['count']({'where':{'closed':![]}});})[_0x0cad('0x13')](function(_0x570428){_0x145f25=_0x570428;if(_0x520ddb&&_0x570428>_0x520ddb){return db[_0x0cad('0xf9')][_0x0cad('0x5a')]({'where':{'id':0x1}})['then'](function(_0x169bf8){if(_0x169bf8){_0x169bf8[_0x0cad('0xfa')](_0x0cad('0xfb'));}});}})[_0x0cad('0x13')](function(){if(_0x28a456[_0x0cad('0xf6')]&&_0x28a456['Interval']['Intervals']){var _0x41041e=[];for(var _0x14f9a2=0x0;_0x14f9a2<_0x28a456[_0x0cad('0xf6')][_0x0cad('0xfc')][_0x0cad('0x3c')];_0x14f9a2++){var _0x2b12f2=_0x28a456[_0x0cad('0xf6')][_0x0cad('0xfc')][_0x14f9a2]['get']({'plain':!![]});_0x41041e[_0x0cad('0xae')](iftimePromise(_0x2b12f2,_0x28a456));}return BPromise[_0x0cad('0xfd')](_0x41041e)['then'](function(_0x2a3264){return _[_0x0cad('0xfe')](_0x2a3264);});}else{return!![];}})[_0x0cad('0x13')](function(_0x1fd19b){var _0xefc4a1=fs[_0x0cad('0xbf')](path['join'](config[_0x0cad('0x70')],_0x0cad('0xff')),_0x0cad('0xc1'));var _0x1e2bb0={'remote':_0x28a456[_0x0cad('0x100')],'query':querystring[_0x0cad('0x19')](_[_0x0cad('0x44')](_0x28a456[_0x0cad('0x27')]({'plain':!![]}),{'customerIp':_0x25555d[_0x0cad('0x7c')][_0x0cad('0x99')]||_0x25555d[_0x0cad('0x7c')]['x-real-ip']||_0x25555d[_0x0cad('0x101')][_0x0cad('0x102')]||_0x25555d['ip'],'referer':_0x25555d[_0x0cad('0x7c')]['referer'],'openedInteractions':_0x145f25,'maxInteractions':_0x520ddb,'virtual':_0x454702[_0x0cad('0x103')],'online':_0x1fd19b,'custom':_0x454702}))['replace'](/'/g,'\x5c\x27')};_0x35c0b7[_0x0cad('0x2e')](ejs[_0x0cad('0x104')](Mustache[_0x0cad('0x104')](_0xefc4a1,_0x1e2bb0),{'proactiveActions':_0x19bf7d,'alignment':_0x28a456[_0x0cad('0x105')],'verticalAlignment':_0x28a456[_0x0cad('0x106')],'div_color':_0x28a456['color'],'labelText':_0x28a456[_0x0cad('0x107')],'text_color':_0x28a456[_0x0cad('0x108')],'text_button_color':_0x28a456[_0x0cad('0x109')],'button_color':_0x28a456['color_button'],'background_color':_0x28a456['backgroundColor'],'hideWhenOffline':_0x28a456['hideWhenOffline'],'interval':_0x28a456[_0x0cad('0x10a')]}));})[_0x0cad('0x1e')](handleError(_0x35c0b7,null));};exports['addApplications']=function(_0x2011ca,_0x15d91c){var _0x20f65a=_0x2011ca[_0x0cad('0x4b')]['id'];var _0x3bef9a=_0x2011ca[_0x0cad('0x4d')];var _0x4a1fb2=0xc8;var _0x5f57ed=null;return db[_0x0cad('0x10b')][_0x0cad('0xca')]({'isolationLevel':db[_0x0cad('0x10b')][_0x0cad('0x10c')][_0x0cad('0x10d')]['READ_COMMITTED']},function(_0x1552e6){return db[_0x0cad('0x46')][_0x0cad('0x5a')]({'where':{'id':_0x20f65a},'transaction':_0x1552e6})['then'](function(_0x1c7a08){if(_0x1c7a08){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x20f65a},'transaction':_0x1552e6})[_0x0cad('0x13')](function(){var _0x4f0eab=_[_0x0cad('0x32')](_0x3bef9a,function(_0x23962a){_0x23962a[_0x0cad('0x57')]=_0x20f65a;return _0x23962a;});return db['ChatApplication']['bulkCreate'](_0x4f0eab,{'transaction':_0x1552e6});});}else{_0x4a1fb2=0x194;_0x5f57ed=[];}});})['then'](function(){if(_0x4a1fb2!==0x194){return db[_0x0cad('0x8f')][_0x0cad('0x10e')]({'where':{'ChatWebsiteId':_0x20f65a},'order':_0x0cad('0x10f')})[_0x0cad('0x13')](function(_0x5e2660){_0x5f57ed=_0x5e2660;});}})[_0x0cad('0x1e')](function(_0x2911ec){_0x4a1fb2=0x1f4;logger[_0x0cad('0x1a')](_0x2911ec['stack']);if(_0x2911ec[_0x0cad('0x2d')]){delete _0x2911ec['name'];}_0x5f57ed=_0x2911ec;})[_0x0cad('0x110')](function(){if(_0x5f57ed===null){_0x15d91c['sendStatus'](_0x4a1fb2);}else{if(_0x4a1fb2===0x1f4){_0x15d91c[_0x0cad('0x20')](_0x4a1fb2)[_0x0cad('0x2e')](_0x5f57ed);}else{_0x15d91c[_0x0cad('0x20')](_0x4a1fb2)['json'](_0x5f57ed);}}});};exports['getApplications']=function(_0x8c328f,_0x482298){var _0x432299={};var _0x59400c={};var _0x3a982b;var _0x19a9e8;return db[_0x0cad('0x46')][_0x0cad('0x5a')]({'where':{'id':_0x8c328f[_0x0cad('0x4b')]['id']}})[_0x0cad('0x13')](handleEntityNotFound(_0x482298,null))['then'](function(_0x377c41){if(_0x377c41){_0x3a982b=_0x377c41;_0x59400c[_0x0cad('0x35')]=_[_0x0cad('0x37')](db[_0x0cad('0x8f')][_0x0cad('0x33')]);_0x59400c[_0x0cad('0x36')]=_[_0x0cad('0x37')](_0x8c328f[_0x0cad('0x36')]);_0x59400c[_0x0cad('0x38')]=_['intersection'](_0x59400c[_0x0cad('0x35')],_0x59400c[_0x0cad('0x36')]);_0x432299['attributes']=_[_0x0cad('0x3a')](_0x59400c[_0x0cad('0x35')],qs[_0x0cad('0x3b')](_0x8c328f['query'][_0x0cad('0x3b')]));_0x432299[_0x0cad('0x39')]=_0x432299[_0x0cad('0x39')][_0x0cad('0x3c')]?_0x432299['attributes']:_0x59400c[_0x0cad('0x35')];_0x432299[_0x0cad('0x3f')]=qs[_0x0cad('0x40')](_0x8c328f[_0x0cad('0x36')]['sort']);_0x432299[_0x0cad('0x43')]=qs[_0x0cad('0x38')](_[_0x0cad('0x41')](_0x8c328f[_0x0cad('0x36')],_0x59400c[_0x0cad('0x38')]));if(_0x8c328f['query'][_0x0cad('0x42')]){_0x432299[_0x0cad('0x43')]=_[_0x0cad('0x44')](_0x432299[_0x0cad('0x43')],{'$or':_[_0x0cad('0x32')](_0x432299[_0x0cad('0x39')],function(_0x5d0f76){var _0x3e4277={};_0x3e4277[_0x5d0f76]={'$like':'%'+_0x8c328f[_0x0cad('0x36')][_0x0cad('0x42')]+'%'};return _0x3e4277;})});}_0x432299=_[_0x0cad('0x44')]({},_0x432299,_0x8c328f[_0x0cad('0x45')]);return _0x3a982b[_0x0cad('0x111')](_0x432299);}})['then'](function(_0x122ab0){if(_0x122ab0){_0x19a9e8=_0x122ab0[_0x0cad('0x3c')];if(!_0x8c328f[_0x0cad('0x36')]['hasOwnProperty'](_0x0cad('0x3e'))){_0x432299[_0x0cad('0x24')]=qs[_0x0cad('0x24')](_0x8c328f[_0x0cad('0x36')]['limit']);_0x432299[_0x0cad('0x22')]=qs[_0x0cad('0x22')](_0x8c328f[_0x0cad('0x36')][_0x0cad('0x22')]);}return _0x3a982b['getApplications'](_0x432299);}})[_0x0cad('0x13')](function(_0x5b2aca){if(_0x5b2aca){return _0x5b2aca?{'count':_0x19a9e8,'rows':_0x5b2aca}:null;}})[_0x0cad('0x13')](respondWithResult(_0x482298,null))[_0x0cad('0x1e')](handleError(_0x482298,null));};exports[_0x0cad('0x112')]=function(_0x444c95,_0x11d893){return db['chatProactiveAction'][_0x0cad('0x52')]({'where':{'id':_0x444c95[_0x0cad('0x4b')]['id']}})[_0x0cad('0x13')](handleEntityNotFound(_0x11d893,null))[_0x0cad('0x13')](function(_0xbe7310){if(_0xbe7310){return _0xbe7310[_0x0cad('0x112')](_0x444c95[_0x0cad('0x4d')][_0x0cad('0x5f')],_[_0x0cad('0xe3')](_0x444c95[_0x0cad('0x4d')],[_0x0cad('0x5f'),'id'])||{});}})[_0x0cad('0x13')](respondWithResult(_0x11d893,null))['catch'](handleError(_0x11d893,null));};exports[_0x0cad('0xf7')]=function(_0x50fa5f,_0x13f28c){var _0x2d5534={};var _0x3b55e1={};var _0x536a0d;var _0x752be6;return db[_0x0cad('0x46')]['findOne']({'where':{'id':_0x50fa5f[_0x0cad('0x4b')]['id']}})[_0x0cad('0x13')](handleEntityNotFound(_0x13f28c,null))['then'](function(_0x4f5ec0){if(_0x4f5ec0){_0x536a0d=_0x4f5ec0;_0x3b55e1['model']=_[_0x0cad('0x37')](db[_0x0cad('0x113')]['rawAttributes']);_0x3b55e1[_0x0cad('0x36')]=_['keys'](_0x50fa5f[_0x0cad('0x36')]);_0x3b55e1[_0x0cad('0x38')]=_[_0x0cad('0x3a')](_0x3b55e1[_0x0cad('0x35')],_0x3b55e1[_0x0cad('0x36')]);_0x2d5534['attributes']=_[_0x0cad('0x3a')](_0x3b55e1[_0x0cad('0x35')],qs[_0x0cad('0x3b')](_0x50fa5f[_0x0cad('0x36')][_0x0cad('0x3b')]));_0x2d5534[_0x0cad('0x39')]=_0x2d5534[_0x0cad('0x39')][_0x0cad('0x3c')]?_0x2d5534[_0x0cad('0x39')]:_0x3b55e1[_0x0cad('0x35')];_0x2d5534[_0x0cad('0x3f')]=qs[_0x0cad('0x40')](_0x50fa5f[_0x0cad('0x36')][_0x0cad('0x40')]);_0x2d5534[_0x0cad('0x43')]=qs[_0x0cad('0x38')](_[_0x0cad('0x41')](_0x50fa5f[_0x0cad('0x36')],_0x3b55e1['filters']));if(_0x50fa5f[_0x0cad('0x36')]['filter']){_0x2d5534[_0x0cad('0x43')]=_[_0x0cad('0x44')](_0x2d5534[_0x0cad('0x43')],{'$or':_['map'](_0x2d5534[_0x0cad('0x39')],function(_0x5dbfc8){var _0x3c4bd8={};_0x3c4bd8[_0x5dbfc8]={'$like':'%'+_0x50fa5f[_0x0cad('0x36')]['filter']+'%'};return _0x3c4bd8;})});}_0x2d5534=_['merge']({},_0x2d5534,_0x50fa5f['options']);return _0x536a0d[_0x0cad('0xf7')](_0x2d5534);}})['then'](function(_0x192caf){if(_0x192caf){_0x752be6=_0x192caf['length'];if(!_0x50fa5f[_0x0cad('0x36')][_0x0cad('0x3d')](_0x0cad('0x3e'))){_0x2d5534[_0x0cad('0x24')]=qs[_0x0cad('0x24')](_0x50fa5f[_0x0cad('0x36')][_0x0cad('0x24')]);_0x2d5534[_0x0cad('0x22')]=qs[_0x0cad('0x22')](_0x50fa5f[_0x0cad('0x36')]['offset']);}return _0x536a0d[_0x0cad('0xf7')](_0x2d5534);}})['then'](function(_0x2cf68b){if(_0x2cf68b){return _0x2cf68b?{'count':_0x752be6,'rows':_0x2cf68b}:null;}})[_0x0cad('0x13')](respondWithResult(_0x13f28c,null))[_0x0cad('0x1e')](handleError(_0x13f28c,null));};exports[_0x0cad('0x114')]=function(_0x51abf7,_0x5a80f9){var _0x561d9d=_0x51abf7[_0x0cad('0x36')][_0x0cad('0x115')]===_0x0cad('0x116')?_0x0cad('0x117'):'onlineForm';return db[_0x0cad('0x46')][_0x0cad('0x52')]({'attributes':['id',_0x561d9d],'where':{'id':_0x51abf7[_0x0cad('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5a80f9,null))[_0x0cad('0x13')](function(_0x1dde7d){if(_0x1dde7d){var _0x439fa7=_0x1dde7d[_0x561d9d];var _0x5c5f60=_0x439fa7&&_0x439fa7[_0x0cad('0x118')]?_0x439fa7['items']:[];_0x5a80f9[_0x0cad('0x2e')]({'fromKey':_[_0x0cad('0x6c')](_0x439fa7[_0x0cad('0x119')])?undefined:_0x439fa7[_0x0cad('0x119')],'count':_0x5c5f60[_0x0cad('0x3c')],'rows':_0x5c5f60});}})[_0x0cad('0x1e')](handleError(_0x5a80f9,null));};exports[_0x0cad('0x11a')]=function(_0x15b725,_0x232ac1){var _0x3eddc1={'raw':![],'where':{}};var _0x58c91d={};var _0x5de085={'count':0x0,'rows':[]};return db[_0x0cad('0x46')][_0x0cad('0x5a')]({'where':{'id':_0x15b725[_0x0cad('0x4b')]['id']}})['then'](handleEntityNotFound(_0x232ac1,null))[_0x0cad('0x13')](function(_0x177524){if(_0x177524){_0x58c91d[_0x0cad('0x35')]=_[_0x0cad('0x37')](db['ChatOfflineMessage'][_0x0cad('0x33')]);_0x58c91d[_0x0cad('0x36')]=_[_0x0cad('0x37')](_0x15b725[_0x0cad('0x36')]);_0x58c91d[_0x0cad('0x38')]=_[_0x0cad('0x3a')](_0x58c91d[_0x0cad('0x35')],_0x58c91d[_0x0cad('0x36')]);_0x3eddc1[_0x0cad('0x39')]=_[_0x0cad('0x3a')](_0x58c91d['model'],qs[_0x0cad('0x3b')](_0x15b725[_0x0cad('0x36')][_0x0cad('0x3b')]));_0x3eddc1[_0x0cad('0x39')]=_0x3eddc1[_0x0cad('0x39')][_0x0cad('0x3c')]?_0x3eddc1['attributes']:_0x58c91d[_0x0cad('0x35')];if(!_0x15b725[_0x0cad('0x36')]['hasOwnProperty'](_0x0cad('0x3e'))){_0x3eddc1[_0x0cad('0x24')]=qs['limit'](_0x15b725[_0x0cad('0x36')]['limit']);_0x3eddc1['offset']=qs[_0x0cad('0x22')](_0x15b725[_0x0cad('0x36')][_0x0cad('0x22')]);}_0x3eddc1[_0x0cad('0x3f')]=qs[_0x0cad('0x40')](_0x15b725[_0x0cad('0x36')][_0x0cad('0x40')]);_0x3eddc1[_0x0cad('0x43')]=qs['filters'](_[_0x0cad('0x41')](_0x15b725[_0x0cad('0x36')],_0x58c91d[_0x0cad('0x38')]));_0x3eddc1[_0x0cad('0x43')]['ChatWebsiteId']=_0x177524['id'];if(_0x15b725[_0x0cad('0x36')][_0x0cad('0x42')]){_0x3eddc1['where']=_[_0x0cad('0x44')](_0x3eddc1[_0x0cad('0x43')],{'$or':_[_0x0cad('0x32')](_0x3eddc1['attributes'],function(_0x3fa7a4){var _0x43b803={};_0x43b803[_0x3fa7a4]={'$like':'%'+_0x15b725[_0x0cad('0x36')][_0x0cad('0x42')]+'%'};return _0x43b803;})});}_0x3eddc1=_[_0x0cad('0x44')]({},_0x3eddc1,_0x15b725[_0x0cad('0x45')]);return db['ChatOfflineMessage'][_0x0cad('0x25')]({'where':_0x3eddc1['where']})['then'](function(_0x47a9c9){_0x5de085[_0x0cad('0x25')]=_0x47a9c9;if(_0x15b725['query'][_0x0cad('0x47')]){_0x3eddc1[_0x0cad('0x48')]=[{'all':!![]}];}else{_0x3eddc1[_0x0cad('0x48')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x0cad('0x11b')],'as':'Attachments','required':![]}];}return db[_0x0cad('0xc4')][_0x0cad('0x49')](_0x3eddc1);})['then'](function(_0x5060b7){_0x5de085[_0x0cad('0x4a')]=_0x5060b7;return _0x5de085;});}})[_0x0cad('0x13')](respondWithFilteredResult(_0x232ac1,_0x3eddc1))['catch'](handleError(_0x232ac1,null));};exports[_0x0cad('0x11c')]=function(_0x4ffdb3,_0x2fa11b){return db['ChatWebsite']['find']({'where':{'id':_0x4ffdb3['params']['id']}})['then'](handleEntityNotFound(_0x2fa11b,null))[_0x0cad('0x13')](function(_0x3244f6){if(_0x3244f6){return _0x3244f6['addAgents'](_0x4ffdb3['body'][_0x0cad('0x5f')],_[_0x0cad('0xe3')](_0x4ffdb3[_0x0cad('0x4d')],[_0x0cad('0x5f'),'id'])||{})[_0x0cad('0xaa')](function(_0x42e604){for(var _0xa32aab=0x0;_0xa32aab<_0x4ffdb3[_0x0cad('0x4d')][_0x0cad('0x5f')][_0x0cad('0x3c')];_0xa32aab+=0x1){socket[_0x0cad('0x11d')](_0x0cad('0x11e'),{'UserId':Number(_0x4ffdb3[_0x0cad('0x4d')]['ids'][_0xa32aab]),'ChatWebsiteId':Number(_0x4ffdb3[_0x0cad('0x4b')]['id'])});}return _0x42e604;});}})[_0x0cad('0x13')](respondWithResult(_0x2fa11b,null))[_0x0cad('0x1e')](handleError(_0x2fa11b,null));};exports['removeAgents']=function(_0x4dca9c,_0x17f43f){return db[_0x0cad('0x46')][_0x0cad('0x52')]({'where':{'id':_0x4dca9c[_0x0cad('0x4b')]['id']}})[_0x0cad('0x13')](handleEntityNotFound(_0x17f43f,null))[_0x0cad('0x13')](function(_0x174a48){if(_0x174a48){return _0x174a48['removeAgents'](_0x4dca9c[_0x0cad('0x36')][_0x0cad('0x5f')])['then'](function(){if(_[_0x0cad('0x11f')](_0x4dca9c[_0x0cad('0x36')][_0x0cad('0x5f')])){for(var _0xd018cf=0x0;_0xd018cf<_0x4dca9c['query'][_0x0cad('0x5f')]['length'];_0xd018cf+=0x1){socket[_0x0cad('0x11d')]('userChatWebsite:remove',{'UserId':Number(_0x4dca9c[_0x0cad('0x36')][_0x0cad('0x5f')][_0xd018cf]),'ChatWebsiteId':Number(_0x4dca9c[_0x0cad('0x4b')]['id'])});}}else{socket[_0x0cad('0x11d')](_0x0cad('0x120'),{'UserId':Number(_0x4dca9c[_0x0cad('0x36')][_0x0cad('0x5f')]),'ChatWebsiteId':Number(_0x4dca9c[_0x0cad('0x4b')]['id'])});}});}})[_0x0cad('0x13')](respondWithStatusCode(_0x17f43f,null))['catch'](handleError(_0x17f43f,null));};exports[_0x0cad('0x121')]=function(_0xf5840a,_0x4daf46){var _0x1c9dcb={};var _0x3074ad={};var _0x339615;var _0x4a2797;return db['ChatWebsite'][_0x0cad('0x5a')]({'where':{'id':_0xf5840a[_0x0cad('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4daf46,null))[_0x0cad('0x13')](function(_0xcf042b){if(_0xcf042b){_0x339615=_0xcf042b;_0x3074ad[_0x0cad('0x35')]=_[_0x0cad('0x37')](db[_0x0cad('0xb3')][_0x0cad('0x33')]);_0x3074ad[_0x0cad('0x36')]=_[_0x0cad('0x37')](_0xf5840a[_0x0cad('0x36')]);_0x3074ad[_0x0cad('0x38')]=_[_0x0cad('0x3a')](_0x3074ad[_0x0cad('0x35')],_0x3074ad[_0x0cad('0x36')]);_0x1c9dcb[_0x0cad('0x39')]=_[_0x0cad('0x3a')](_0x3074ad['model'],qs[_0x0cad('0x3b')](_0xf5840a[_0x0cad('0x36')][_0x0cad('0x3b')]));_0x1c9dcb[_0x0cad('0x39')]=_0x1c9dcb[_0x0cad('0x39')]['length']?_0x1c9dcb['attributes']:_0x3074ad[_0x0cad('0x35')];_0x1c9dcb[_0x0cad('0x3f')]=qs['sort'](_0xf5840a[_0x0cad('0x36')][_0x0cad('0x40')]);_0x1c9dcb[_0x0cad('0x43')]=qs[_0x0cad('0x38')](_['pick'](_0xf5840a[_0x0cad('0x36')],_0x3074ad[_0x0cad('0x38')]));if(_0xf5840a['query'][_0x0cad('0x42')]){_0x1c9dcb[_0x0cad('0x43')]=_[_0x0cad('0x44')](_0x1c9dcb[_0x0cad('0x43')],{'$or':_[_0x0cad('0x32')](_0x1c9dcb[_0x0cad('0x39')],function(_0x416994){var _0x31408e={};_0x31408e[_0x416994]={'$like':'%'+_0xf5840a['query'][_0x0cad('0x42')]+'%'};return _0x31408e;})});}_0x1c9dcb=_['merge']({},_0x1c9dcb,_0xf5840a['options']);return _0x339615[_0x0cad('0x121')](_0x1c9dcb);}})[_0x0cad('0x13')](function(_0x2992c3){if(_0x2992c3){_0x4a2797=_0x2992c3[_0x0cad('0x3c')];if(!_0xf5840a[_0x0cad('0x36')][_0x0cad('0x3d')]('nolimit')){_0x1c9dcb[_0x0cad('0x24')]=qs[_0x0cad('0x24')](_0xf5840a[_0x0cad('0x36')][_0x0cad('0x24')]);_0x1c9dcb[_0x0cad('0x22')]=qs['offset'](_0xf5840a[_0x0cad('0x36')][_0x0cad('0x22')]);}return _0x339615[_0x0cad('0x121')](_0x1c9dcb);}})['then'](function(_0x464355){if(_0x464355){return _0x464355?{'count':_0x4a2797,'rows':_0x464355}:null;}})[_0x0cad('0x13')](respondWithResult(_0x4daf46,null))[_0x0cad('0x1e')](handleError(_0x4daf46,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 4f5fb9d..d0b4d6c 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 _0xcee8=['hasOwnProperty','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','emit'];(function(_0x381dbb,_0x4a1419){var _0x301378=function(_0xd1993c){while(--_0xd1993c){_0x381dbb['push'](_0x381dbb['shift']());}};_0x301378(++_0x4a1419);}(_0xcee8,0xb1));var _0x8cee=function(_0x2f1f74,_0x4a884e){_0x2f1f74=_0x2f1f74-0x0;var _0x1170fc=_0xcee8[_0x2f1f74];return _0x1170fc;};'use strict';var EventEmitter=require(_0x8cee('0x0'));var ChatWebsite=require(_0x8cee('0x1'))['db'][_0x8cee('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x8cee('0x3')](0x0);var events={'afterCreate':_0x8cee('0x4'),'afterUpdate':_0x8cee('0x5'),'afterDestroy':'remove'};function emitEvent(_0x127360){return function(_0x4e4143,_0xffd42d,_0x1ec415){ChatWebsiteEvents['emit'](_0x127360+':'+_0x4e4143['id'],_0x4e4143);ChatWebsiteEvents[_0x8cee('0x6')](_0x127360,_0x4e4143);_0x1ec415(null);};}for(var e in events){if(events[_0x8cee('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0xf021=['emit','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','remove'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xf021,0x18f));var _0x1f02=function(_0x224ad0,_0x2482bd){_0x224ad0=_0x224ad0-0x0;var _0x2e04fc=_0xf021[_0x224ad0];return _0x2e04fc;};'use strict';var EventEmitter=require(_0x1f02('0x0'));var ChatWebsite=require(_0x1f02('0x1'))['db'][_0x1f02('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1f02('0x3')](0x0);var events={'afterCreate':_0x1f02('0x4'),'afterUpdate':'update','afterDestroy':_0x1f02('0x5')};function emitEvent(_0x54cd44){return function(_0x2e8594,_0x3164f0,_0x51eff6){ChatWebsiteEvents['emit'](_0x54cd44+':'+_0x2e8594['id'],_0x2e8594);ChatWebsiteEvents[_0x1f02('0x6')](_0x54cd44,_0x2e8594);_0x51eff6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x1f02('0x7')](e,emitEvent(event));}}module[_0x1f02('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 54b84ef..b5ffe36 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 _0xa8de=['chat_websites','util','../../config/logger','moment','bluebird','request-promise','rimraf','./chatWebsite.attributes','exports','ChatWebsite'];(function(_0x20fc79,_0x35186d){var _0x39a80e=function(_0x3c756a){while(--_0x3c756a){_0x20fc79['push'](_0x20fc79['shift']());}};_0x39a80e(++_0x35186d);}(_0xa8de,0x187));var _0xea8d=function(_0x2c4be0,_0x41af29){_0x2c4be0=_0x2c4be0-0x0;var _0xf2a3dc=_0xa8de[_0x2c4be0];return _0xf2a3dc;};'use strict';var _=require('lodash');var util=require(_0xea8d('0x0'));var logger=require(_0xea8d('0x1'))('api');var moment=require(_0xea8d('0x2'));var BPromise=require(_0xea8d('0x3'));var rp=require(_0xea8d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xea8d('0x5'));var config=require('../../config/environment');var attributes=require(_0xea8d('0x6'));module[_0xea8d('0x7')]=function(_0x540548,_0x49f1d4){return _0x540548['define'](_0xea8d('0x8'),attributes,{'tableName':_0xea8d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf665=['lodash','util','../../config/logger','api','moment','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites'];(function(_0x5affbd,_0x594b38){var _0x5093a8=function(_0xe8b562){while(--_0xe8b562){_0x5affbd['push'](_0x5affbd['shift']());}};_0x5093a8(++_0x594b38);}(_0xf665,0x84));var _0x5f66=function(_0x47bb19,_0x17a096){_0x47bb19=_0x47bb19-0x0;var _0x4ef57a=_0xf665[_0x47bb19];return _0x4ef57a;};'use strict';var _=require(_0x5f66('0x0'));var util=require(_0x5f66('0x1'));var logger=require(_0x5f66('0x2'))(_0x5f66('0x3'));var moment=require(_0x5f66('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5f66('0x5'));var config=require('../../config/environment');var attributes=require(_0x5f66('0x6'));module[_0x5f66('0x7')]=function(_0x5dcbc6,_0x2e3605){return _0x5dcbc6[_0x5f66('0x8')](_0x5f66('0x9'),attributes,{'tableName':_0x5f66('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 95e0b6f..9c9f493 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 _0xef27=['../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','util','bluebird','randomstring','../../mysqldb'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xef27,0x17c));var _0x7ef2=function(_0x908522,_0x37d960){_0x908522=_0x908522-0x0;var _0x50c7a8=_0xef27[_0x908522];return _0x50c7a8;};'use strict';var _=require('lodash');var util=require(_0x7ef2('0x0'));var moment=require('moment');var BPromise=require(_0x7ef2('0x1'));var rs=require(_0x7ef2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7ef2('0x3'))['db'];var utils=require(_0x7ef2('0x4'));var logger=require(_0x7ef2('0x5'))(_0x7ef2('0x6'));var config=require(_0x7ef2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7ef2('0x8')]['http']({'port':0x232a});config[_0x7ef2('0x9')]=_['defaults'](config[_0x7ef2('0x9')],{'host':_0x7ef2('0xa'),'port':0x18eb});var socket=require(_0x7ef2('0xb'))(new Redis(config[_0x7ef2('0x9')]));require(_0x7ef2('0xc'))[_0x7ef2('0xd')](socket);function respondWithRpcPromise(_0x2ec3ec,_0x146eb9,_0x3d8261){return new BPromise(function(_0xc69d6c,_0xc2ff54){return client[_0x7ef2('0xe')](_0x2ec3ec,_0x3d8261)[_0x7ef2('0xf')](function(_0x44bbee){logger[_0x7ef2('0x10')](_0x7ef2('0x11'),_0x146eb9,'request\x20sent');logger[_0x7ef2('0x12')](_0x7ef2('0x13'),_0x146eb9,_0x7ef2('0x14'),JSON['stringify'](_0x44bbee));if(_0x44bbee[_0x7ef2('0x15')]){if(_0x44bbee[_0x7ef2('0x15')][_0x7ef2('0x16')]===0x1f4){logger['error'](_0x7ef2('0x11'),_0x146eb9,_0x44bbee['error'][_0x7ef2('0x17')]);return _0xc2ff54(_0x44bbee['error']['message']);}logger[_0x7ef2('0x15')](_0x7ef2('0x11'),_0x146eb9,_0x44bbee[_0x7ef2('0x15')]['message']);return _0xc69d6c(_0x44bbee[_0x7ef2('0x15')][_0x7ef2('0x17')]);}else{logger[_0x7ef2('0x10')](_0x7ef2('0x11'),_0x146eb9,_0x7ef2('0x14'));_0xc69d6c(_0x44bbee['result'][_0x7ef2('0x17')]);}})['catch'](function(_0x34392b){logger[_0x7ef2('0x15')](_0x7ef2('0x11'),_0x146eb9,_0x34392b);_0xc2ff54(_0x34392b);});});}
\ No newline at end of file
+var _0x97ea=['localhost','./chatWebsite.socket','register','then','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x28831e,_0x57062b){var _0x57c7a0=function(_0x34c775){while(--_0x34c775){_0x28831e['push'](_0x28831e['shift']());}};_0x57c7a0(++_0x57062b);}(_0x97ea,0x1f3));var _0xa97e=function(_0x1c6289,_0x389a28){_0x1c6289=_0x1c6289-0x0;var _0x28ab7a=_0x97ea[_0x1c6289];return _0x28ab7a;};'use strict';var _=require(_0xa97e('0x0'));var util=require(_0xa97e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa97e('0x2'));var fs=require('fs');var Redis=require(_0xa97e('0x3'));var db=require(_0xa97e('0x4'))['db'];var utils=require(_0xa97e('0x5'));var logger=require(_0xa97e('0x6'))(_0xa97e('0x7'));var config=require(_0xa97e('0x8'));var jayson=require(_0xa97e('0x9'));var client=jayson[_0xa97e('0xa')][_0xa97e('0xb')]({'port':0x232a});config[_0xa97e('0xc')]=_[_0xa97e('0xd')](config[_0xa97e('0xc')],{'host':_0xa97e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa97e('0xc')]));require(_0xa97e('0xf'))[_0xa97e('0x10')](socket);function respondWithRpcPromise(_0x484536,_0x595d7f,_0x59e7c7){return new BPromise(function(_0x56e226,_0x39c379){return client['request'](_0x484536,_0x59e7c7)[_0xa97e('0x11')](function(_0x4dd3a2){logger['info'](_0xa97e('0x12'),_0x595d7f,'request\x20sent');logger[_0xa97e('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x595d7f,_0xa97e('0x14'),JSON[_0xa97e('0x15')](_0x4dd3a2));if(_0x4dd3a2[_0xa97e('0x16')]){if(_0x4dd3a2['error']['code']===0x1f4){logger[_0xa97e('0x16')](_0xa97e('0x12'),_0x595d7f,_0x4dd3a2[_0xa97e('0x16')][_0xa97e('0x17')]);return _0x39c379(_0x4dd3a2['error'][_0xa97e('0x17')]);}logger[_0xa97e('0x16')](_0xa97e('0x12'),_0x595d7f,_0x4dd3a2[_0xa97e('0x16')][_0xa97e('0x17')]);return _0x56e226(_0x4dd3a2['error']['message']);}else{logger[_0xa97e('0x18')](_0xa97e('0x12'),_0x595d7f,_0xa97e('0x14'));_0x56e226(_0x4dd3a2[_0xa97e('0x19')][_0xa97e('0x17')]);}})[_0xa97e('0x1a')](function(_0x3a8a60){logger[_0xa97e('0x16')](_0xa97e('0x12'),_0x595d7f,_0x3a8a60);_0x39c379(_0x3a8a60);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index b9b43f9..4cce358 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 _0x0154=['removeListener','register','chatWebsite:','save','remove','update','emit'];(function(_0x594e11,_0x28f652){var _0x5418ad=function(_0x5dcfa7){while(--_0x5dcfa7){_0x594e11['push'](_0x594e11['shift']());}};_0x5418ad(++_0x28f652);}(_0x0154,0x73));var _0x4015=function(_0x35ba14,_0x31f105){_0x35ba14=_0x35ba14-0x0;var _0x102ca7=_0x0154[_0x35ba14];return _0x102ca7;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x4015('0x0'),_0x4015('0x1'),_0x4015('0x2')];function createListener(_0x53dc12,_0x5e97c6){return function(_0xcd8249){_0x5e97c6[_0x4015('0x3')](_0x53dc12,_0xcd8249);};}function removeListener(_0x5e8e7d,_0xf18edf){return function(){ChatWebsiteEvents[_0x4015('0x4')](_0x5e8e7d,_0xf18edf);};}exports[_0x4015('0x5')]=function(_0x50120f){for(var _0x1ec2ea=0x0,_0x59d2ea=events['length'];_0x1ec2ea<_0x59d2ea;_0x1ec2ea++){var _0x5d3bcc=events[_0x1ec2ea];var _0x1e326e=createListener(_0x4015('0x6')+_0x5d3bcc,_0x50120f);ChatWebsiteEvents['on'](_0x5d3bcc,_0x1e326e);}};
\ No newline at end of file
+var _0xf937=['length','chatWebsite:','./chatWebsite.events','save','remove','register'];(function(_0x26a686,_0x4f51d2){var _0x2bf65d=function(_0x20addc){while(--_0x20addc){_0x26a686['push'](_0x26a686['shift']());}};_0x2bf65d(++_0x4f51d2);}(_0xf937,0xda));var _0x7f93=function(_0x146a97,_0x2d8483){_0x146a97=_0x146a97-0x0;var _0x259d5c=_0xf937[_0x146a97];return _0x259d5c;};'use strict';var ChatWebsiteEvents=require(_0x7f93('0x0'));var events=[_0x7f93('0x1'),_0x7f93('0x2'),'update'];function createListener(_0x36648c,_0x42490d){return function(_0x1a41e9){_0x42490d['emit'](_0x36648c,_0x1a41e9);};}function removeListener(_0x3ec9bc,_0xd373a4){return function(){ChatWebsiteEvents['removeListener'](_0x3ec9bc,_0xd373a4);};}exports[_0x7f93('0x3')]=function(_0x2f06d2){for(var _0x23b4f2=0x0,_0x4d0b79=events[_0x7f93('0x4')];_0x23b4f2<_0x4d0b79;_0x23b4f2++){var _0x33bebb=events[_0x23b4f2];var _0x27516f=createListener(_0x7f93('0x5')+_0x33bebb,_0x2f06d2);ChatWebsiteEvents['on'](_0x33bebb,_0x27516f);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index af59b37..9bac966 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 _0x633f=['destroy','/:id/dispositions','removeDispositions','removeAgents','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','getSnippet','/:id/proactive_actions','getProactiveActions','/:id/offline_messages','getOfflineMessages','/:id/users','create','post','addDisposition','addAnswer','join','format','%s-%s','now','originalname','single','addLogo','diskStorage','server/files/images/avatars/','/:id/avatar','file','addAvatar','addCustomerAvatar','/:id/notify','notify','root','server/files','offline-chat','ensureDir','replace','any','offline','/:id/interactions','/:id/applications','addApplications','addProactiveActions','addAgents','put','update','delete'];(function(_0x485de1,_0x5df409){var _0x53647e=function(_0x4f4f2d){while(--_0x4f4f2d){_0x485de1['push'](_0x485de1['shift']());}};_0x53647e(++_0x5df409);}(_0x633f,0x8d));var _0xf633=function(_0x3aa6c9,_0x498f87){_0x3aa6c9=_0x3aa6c9-0x0;var _0x4e48a7=_0x633f[_0x3aa6c9];return _0x4e48a7;};'use strict';var multer=require(_0xf633('0x0'));var util=require(_0xf633('0x1'));var path=require(_0xf633('0x2'));var timeout=require('connect-timeout');var express=require(_0xf633('0x3'));var router=express['Router']();var fs_extra=require(_0xf633('0x4'));var auth=require(_0xf633('0x5'));var interaction=require(_0xf633('0x6'));var config=require(_0xf633('0x7'));var controller=require(_0xf633('0x8'));router[_0xf633('0x9')]('/',auth[_0xf633('0xa')](),controller[_0xf633('0xb')]);router[_0xf633('0x9')]('/describe',auth[_0xf633('0xa')](),controller[_0xf633('0xc')]);router[_0xf633('0x9')](_0xf633('0xd'),auth[_0xf633('0xa')](),controller['show']);router[_0xf633('0x9')]('/:id/dispositions',auth[_0xf633('0xa')](),controller['getDispositions']);router[_0xf633('0x9')]('/:id/canned_answers',auth[_0xf633('0xa')](),controller[_0xf633('0xe')]);router['get'](_0xf633('0xf'),controller[_0xf633('0x10')]);router['get']('/:id/avatar',controller[_0xf633('0x11')]);router['get'](_0xf633('0x12'),controller[_0xf633('0x13')]);router[_0xf633('0x9')](_0xf633('0x14'),controller[_0xf633('0x15')]);router[_0xf633('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xf633('0x16')]);router['get']('/:id/snippet',controller[_0xf633('0x17')]);router['get']('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0xf633('0x9')](_0xf633('0x18'),auth[_0xf633('0xa')](),controller[_0xf633('0x19')]);router['get']('/:id/fields',controller['getFields']);router[_0xf633('0x9')](_0xf633('0x1a'),auth[_0xf633('0xa')](),controller[_0xf633('0x1b')]);router['get'](_0xf633('0x1c'),auth[_0xf633('0xa')](),controller['getAgents']);router['post']('/',auth[_0xf633('0xa')](),controller[_0xf633('0x1d')]);router[_0xf633('0x1e')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf633('0x1f')]);router[_0xf633('0x1e')]('/:id/canned_answers',auth[_0xf633('0xa')](),controller[_0xf633('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x127948,_0x81c529,_0x4fd86d){_0x4fd86d(null,path[_0xf633('0x21')](config['root'],'server/files/images/logos/'));},'filename':function(_0x1d0a36,_0x1a3e4d,_0x190c51){_0x190c51(null,util[_0xf633('0x22')](_0xf633('0x23'),Date[_0xf633('0x24')](),_0x1a3e4d[_0xf633('0x25')]));}})});router[_0xf633('0x1e')]('/:id/logo',upload[_0xf633('0x26')]('file'),controller[_0xf633('0x27')]);var upload=multer({'storage':multer[_0xf633('0x28')]({'destination':function(_0x8db2b2,_0x37487d,_0x1e824b){_0x1e824b(null,path['join'](config['root'],_0xf633('0x29')));},'filename':function(_0x4eb597,_0x11cd60,_0x46e7b4){_0x46e7b4(null,util['format'](_0xf633('0x23'),Date[_0xf633('0x24')](),_0x11cd60[_0xf633('0x25')]));}})});router['post'](_0xf633('0x2a'),upload[_0xf633('0x26')](_0xf633('0x2b')),controller[_0xf633('0x2c')]);var upload=multer({'storage':multer[_0xf633('0x28')]({'destination':function(_0x4886bb,_0x9a89d0,_0x40fa7c){_0x40fa7c(null,path[_0xf633('0x21')](config['root'],_0xf633('0x29')));},'filename':function(_0x207696,_0x37a37d,_0x5c2eff){_0x5c2eff(null,util[_0xf633('0x22')](_0xf633('0x23'),Date[_0xf633('0x24')](),_0x37a37d[_0xf633('0x25')]));}})});router[_0xf633('0x1e')](_0xf633('0x12'),upload[_0xf633('0x26')](_0xf633('0x2b')),controller[_0xf633('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x395754,_0x386b41,_0x52bbcc){_0x52bbcc(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x593f30,_0xb65ebd,_0x568182){_0x568182(null,util[_0xf633('0x22')](_0xf633('0x23'),Date[_0xf633('0x24')](),_0xb65ebd['originalname']));}})});router[_0xf633('0x1e')](_0xf633('0x14'),upload['single'](_0xf633('0x2b')),controller['addSystemAvatar']);router[_0xf633('0x1e')](_0xf633('0x2e'),controller[_0xf633('0x2f')]);const offlineUploadMulter=multer({'storage':multer[_0xf633('0x28')]({'destination':function(_0x514b42,_0x33caec,_0x41a471){const _0x597b5c=path[_0xf633('0x21')](config[_0xf633('0x30')],_0xf633('0x31'),'attachments',_0xf633('0x32'));fs_extra[_0xf633('0x33')](_0x597b5c,function(){_0x41a471(null,_0x597b5c);});},'filename':function(_0x10e589,_0x3632f9,_0x157d2c){const _0x5a0c8b=_0x3632f9[_0xf633('0x25')][_0xf633('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x12341b=path['extname'](_0x5a0c8b);const _0x29e94d=Date[_0xf633('0x24')]()+'-'+_0x5a0c8b[_0xf633('0x34')](_0x12341b,'')+_0x12341b;_0x157d2c(null,_0x29e94d);}})});router['post']('/:id/offline',offlineUploadMulter[_0xf633('0x35')](),controller[_0xf633('0x36')]);router[_0xf633('0x1e')](_0xf633('0x37'),auth[_0xf633('0xa')](),controller['addInteraction']);router[_0xf633('0x1e')](_0xf633('0x38'),auth['isAuthenticated'](),controller[_0xf633('0x39')]);router[_0xf633('0x1e')](_0xf633('0x18'),auth[_0xf633('0xa')](),controller[_0xf633('0x3a')]);router[_0xf633('0x1e')](_0xf633('0x1c'),auth[_0xf633('0xa')](),controller[_0xf633('0x3b')]);router[_0xf633('0x3c')](_0xf633('0xd'),auth['isAuthenticated'](),controller[_0xf633('0x3d')]);router[_0xf633('0x3e')](_0xf633('0xd'),auth[_0xf633('0xa')](),controller[_0xf633('0x3f')]);router[_0xf633('0x3e')](_0xf633('0x40'),auth[_0xf633('0xa')](),controller[_0xf633('0x41')]);router[_0xf633('0x3e')]('/:id/canned_answers',auth[_0xf633('0xa')](),controller['removeAnswers']);router[_0xf633('0x3e')](_0xf633('0x1c'),auth[_0xf633('0xa')](),controller[_0xf633('0x42')]);module[_0xf633('0x43')]=router;
\ No newline at end of file
+var _0x5b05=['%s-%s','/:id/logo','single','file','root','now','originalname','/:id/avatar','addAvatar','server/files/images/avatars/','addSystemAvatar','server/files','attachments','ensureDir','replace','extname','/:id/offline','addInteraction','addApplications','addProactiveActions','put','/:id','delete','destroy','removeAnswers','removeAgents','exports','multer','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','/:id/fields','getOfflineMessages','/:id/users','getAgents','post','addAnswer','diskStorage','join','server/files/images/logos/','format'];(function(_0x3e73f5,_0x5a53f3){var _0x8bd161=function(_0x3da42c){while(--_0x3da42c){_0x3e73f5['push'](_0x3e73f5['shift']());}};_0x8bd161(++_0x5a53f3);}(_0x5b05,0x11b));var _0x55b0=function(_0x1b1b3b,_0x20988f){_0x1b1b3b=_0x1b1b3b-0x0;var _0x195d16=_0x5b05[_0x1b1b3b];return _0x195d16;};'use strict';var multer=require(_0x55b0('0x0'));var util=require('util');var path=require(_0x55b0('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x55b0('0x2'));var interaction=require(_0x55b0('0x3'));var config=require(_0x55b0('0x4'));var controller=require(_0x55b0('0x5'));router[_0x55b0('0x6')]('/',auth[_0x55b0('0x7')](),controller[_0x55b0('0x8')]);router[_0x55b0('0x6')](_0x55b0('0x9'),auth[_0x55b0('0x7')](),controller[_0x55b0('0xa')]);router[_0x55b0('0x6')]('/:id',auth[_0x55b0('0x7')](),controller[_0x55b0('0xb')]);router[_0x55b0('0x6')](_0x55b0('0xc'),auth[_0x55b0('0x7')](),controller[_0x55b0('0xd')]);router[_0x55b0('0x6')](_0x55b0('0xe'),auth[_0x55b0('0x7')](),controller[_0x55b0('0xf')]);router['get']('/:id/logo',controller[_0x55b0('0x10')]);router[_0x55b0('0x6')]('/:id/avatar',controller[_0x55b0('0x11')]);router[_0x55b0('0x6')](_0x55b0('0x12'),controller['getCustomerAvatar']);router[_0x55b0('0x6')](_0x55b0('0x13'),controller[_0x55b0('0x14')]);router[_0x55b0('0x6')](_0x55b0('0x15'),auth[_0x55b0('0x7')](),controller[_0x55b0('0x16')]);router[_0x55b0('0x6')](_0x55b0('0x17'),controller[_0x55b0('0x18')]);router[_0x55b0('0x6')](_0x55b0('0x19'),auth[_0x55b0('0x7')](),controller['getApplications']);router[_0x55b0('0x6')](_0x55b0('0x1a'),auth[_0x55b0('0x7')](),controller['getProactiveActions']);router[_0x55b0('0x6')](_0x55b0('0x1b'),controller['getFields']);router[_0x55b0('0x6')]('/:id/offline_messages',auth[_0x55b0('0x7')](),controller[_0x55b0('0x1c')]);router[_0x55b0('0x6')](_0x55b0('0x1d'),auth[_0x55b0('0x7')](),controller[_0x55b0('0x1e')]);router[_0x55b0('0x1f')]('/',auth[_0x55b0('0x7')](),controller['create']);router[_0x55b0('0x1f')](_0x55b0('0xc'),auth[_0x55b0('0x7')](),controller['addDisposition']);router[_0x55b0('0x1f')](_0x55b0('0xe'),auth[_0x55b0('0x7')](),controller[_0x55b0('0x20')]);var upload=multer({'storage':multer[_0x55b0('0x21')]({'destination':function(_0x1753b2,_0x4afa5d,_0x54d755){_0x54d755(null,path[_0x55b0('0x22')](config['root'],_0x55b0('0x23')));},'filename':function(_0x37b1b0,_0x32d641,_0x16b89d){_0x16b89d(null,util[_0x55b0('0x24')](_0x55b0('0x25'),Date['now'](),_0x32d641['originalname']));}})});router[_0x55b0('0x1f')](_0x55b0('0x26'),upload[_0x55b0('0x27')](_0x55b0('0x28')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5b271c,_0x4840e0,_0x88f3b8){_0x88f3b8(null,path['join'](config[_0x55b0('0x29')],'server/files/images/avatars/'));},'filename':function(_0x5ea240,_0x286bbf,_0x1d18f1){_0x1d18f1(null,util[_0x55b0('0x24')](_0x55b0('0x25'),Date[_0x55b0('0x2a')](),_0x286bbf[_0x55b0('0x2b')]));}})});router[_0x55b0('0x1f')](_0x55b0('0x2c'),upload[_0x55b0('0x27')](_0x55b0('0x28')),controller[_0x55b0('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1ac523,_0x239d37,_0x2a7325){_0x2a7325(null,path[_0x55b0('0x22')](config[_0x55b0('0x29')],_0x55b0('0x2e')));},'filename':function(_0x3f74b2,_0x497602,_0x4d8ae1){_0x4d8ae1(null,util['format'](_0x55b0('0x25'),Date[_0x55b0('0x2a')](),_0x497602[_0x55b0('0x2b')]));}})});router[_0x55b0('0x1f')](_0x55b0('0x12'),upload[_0x55b0('0x27')](_0x55b0('0x28')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x15bf4e,_0x1368ad,_0x2ae5f9){_0x2ae5f9(null,path[_0x55b0('0x22')](config[_0x55b0('0x29')],'server/files/images/avatars/'));},'filename':function(_0xb86071,_0x10f28d,_0x491ba2){_0x491ba2(null,util[_0x55b0('0x24')]('%s-%s',Date[_0x55b0('0x2a')](),_0x10f28d[_0x55b0('0x2b')]));}})});router[_0x55b0('0x1f')](_0x55b0('0x13'),upload[_0x55b0('0x27')](_0x55b0('0x28')),controller[_0x55b0('0x2f')]);router[_0x55b0('0x1f')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x55b0('0x21')]({'destination':function(_0x1987aa,_0x20d806,_0x3111e0){const _0x430399=path[_0x55b0('0x22')](config[_0x55b0('0x29')],_0x55b0('0x30'),_0x55b0('0x31'),'offline-chat');fs_extra[_0x55b0('0x32')](_0x430399,function(){_0x3111e0(null,_0x430399);});},'filename':function(_0xe95cfc,_0x47ec80,_0x123773){const _0x329400=_0x47ec80[_0x55b0('0x2b')][_0x55b0('0x33')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x211d51=path[_0x55b0('0x34')](_0x329400);const _0x1dc59e=Date[_0x55b0('0x2a')]()+'-'+_0x329400['replace'](_0x211d51,'')+_0x211d51;_0x123773(null,_0x1dc59e);}})});router[_0x55b0('0x1f')](_0x55b0('0x35'),offlineUploadMulter['any'](),controller['offline']);router[_0x55b0('0x1f')](_0x55b0('0x15'),auth[_0x55b0('0x7')](),controller[_0x55b0('0x36')]);router[_0x55b0('0x1f')](_0x55b0('0x19'),auth['isAuthenticated'](),controller[_0x55b0('0x37')]);router['post'](_0x55b0('0x1a'),auth[_0x55b0('0x7')](),controller[_0x55b0('0x38')]);router['post'](_0x55b0('0x1d'),auth[_0x55b0('0x7')](),controller['addAgents']);router[_0x55b0('0x39')](_0x55b0('0x3a'),auth['isAuthenticated'](),controller['update']);router[_0x55b0('0x3b')]('/:id',auth['isAuthenticated'](),controller[_0x55b0('0x3c')]);router['delete'](_0x55b0('0xc'),auth[_0x55b0('0x7')](),controller['removeDispositions']);router['delete'](_0x55b0('0xe'),auth[_0x55b0('0x7')](),controller[_0x55b0('0x3d')]);router[_0x55b0('0x3b')](_0x55b0('0x1d'),auth[_0x55b0('0x7')](),controller[_0x55b0('0x3e')]);module[_0x55b0('0x3f')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index dee79b5..ea44076 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 _0x3c93=['production','app','get','Client-Side\x20logger\x20not\x20found!','/client-logs','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','env'];(function(_0x4f454d,_0x23628e){var _0x3b260=function(_0x19d6f6){while(--_0x19d6f6){_0x4f454d['push'](_0x4f454d['shift']());}};_0x3b260(++_0x23628e);}(_0x3c93,0x1c3));var _0x33c9=function(_0x2e58fe,_0x1bb5c3){_0x2e58fe=_0x2e58fe-0x0;var _0x2f297e=_0x3c93[_0x2e58fe];return _0x2f297e;};var beaverLogger=require(_0x33c9('0x0'));var express=require(_0x33c9('0x1'));var auth=require(_0x33c9('0x2'));var config=require(_0x33c9('0x3'));var router=express['Router']();var isProduction=config[_0x33c9('0x4')]===_0x33c9('0x5')||![];function clientSideLogs(_0x5bc320,_0x5e6b1b,_0x1ac6de){var _0x1d0944=_0x5bc320[_0x33c9('0x6')][_0x33c9('0x7')]('client-side-logger');if(!_0x1d0944){throw new Error(_0x33c9('0x8'));}return beaverLogger['expressEndpoint']({'uri':_0x33c9('0x9'),'logger':_0x1d0944,'enableCors':!isProduction})(_0x5bc320,_0x5e6b1b,_0x1ac6de);}router['use'](auth[_0x33c9('0xa')](),clientSideLogs);module[_0x33c9('0xb')]=router;
\ No newline at end of file
+var _0x7a6b=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','../components/auth/service','../config/environment','Router','app'];(function(_0x27cb81,_0x756485){var _0x4f4893=function(_0x5702a4){while(--_0x5702a4){_0x27cb81['push'](_0x27cb81['shift']());}};_0x4f4893(++_0x756485);}(_0x7a6b,0x182));var _0xb7a6=function(_0x30804b,_0x2fe8ef){_0x30804b=_0x30804b-0x0;var _0x325cc0=_0x7a6b[_0x30804b];return _0x325cc0;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require(_0xb7a6('0x0'));var config=require(_0xb7a6('0x1'));var router=express[_0xb7a6('0x2')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x25695c,_0x69a002,_0x5dc809){var _0x159853=_0x25695c[_0xb7a6('0x3')]['get']('client-side-logger');if(!_0x159853){throw new Error(_0xb7a6('0x4'));}return beaverLogger[_0xb7a6('0x5')]({'uri':_0xb7a6('0x6'),'logger':_0x159853,'enableCors':!isProduction})(_0x25695c,_0x69a002,_0x5dc809);}router[_0xb7a6('0x7')](auth[_0xb7a6('0x8')](),clientSideLogs);module[_0xb7a6('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 21bea80..dd807cb 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 _0x38fc=['TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri'];(function(_0x1f8f66,_0x5dc25a){var _0x3b992d=function(_0x25dadb){while(--_0x25dadb){_0x1f8f66['push'](_0x1f8f66['shift']());}};_0x3b992d(++_0x5dc25a);}(_0x38fc,0xb7));var _0xc38f=function(_0x27e43d,_0x3841bf){_0x27e43d=_0x27e43d-0x0;var _0xaa45f2=_0x38fc[_0x27e43d];return _0xaa45f2;};'use strict';var Sequelize=require(_0xc38f('0x0'));module[_0xc38f('0x1')]={'name':{'type':Sequelize[_0xc38f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xc38f('0x3'),_0xc38f('0x4'),_0xc38f('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xc38f('0x6')](_0xc38f('0x7'),'Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':_0xc38f('0x8')},'data2':{'type':Sequelize[_0xc38f('0x2')],'comment':_0xc38f('0x9')},'data3':{'type':Sequelize['STRING'],'comment':_0xc38f('0xa')},'data4':{'type':Sequelize[_0xc38f('0x2')],'comment':_0xc38f('0xb')},'data5':{'type':Sequelize[_0xc38f('0xc')],'comment':_0xc38f('0xd')},'data6':{'type':Sequelize[_0xc38f('0xc')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xc38f('0xc')],'comment':_0xc38f('0xe')}};
\ No newline at end of file
+var _0x3d29=['MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','ENUM','Google','MicrosoftAzure','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT'];(function(_0x47a802,_0x424bf1){var _0xb3badc=function(_0x5f44d3){while(--_0x5f44d3){_0x47a802['push'](_0x47a802['shift']());}};_0xb3badc(++_0x424bf1);}(_0x3d29,0xda));var _0x93d2=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x3d29[_0x38537f];return _0x141e23;};'use strict';var Sequelize=require('sequelize');module[_0x93d2('0x0')]={'name':{'type':Sequelize[_0x93d2('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x93d2('0x2')]('AmazonAWS',_0x93d2('0x3'),_0x93d2('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x93d2('0x2')]('Outlook365','Dynamics365')},'data1':{'type':Sequelize[_0x93d2('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x93d2('0x1')],'comment':_0x93d2('0x5')},'data3':{'type':Sequelize['STRING'],'comment':_0x93d2('0x6')},'data4':{'type':Sequelize['STRING'],'comment':_0x93d2('0x7')},'data5':{'type':Sequelize['TEXT'],'comment':_0x93d2('0x8')},'data6':{'type':Sequelize[_0x93d2('0x9')],'comment':_0x93d2('0xa')},'data7':{'type':Sequelize[_0x93d2('0x9')],'comment':_0x93d2('0xb')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index dd4ba99..f44b0ec 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 _0x25c3=['parse','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','microsoftAuthorization:success','emit','microsoftAuthorization:error','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','socket.io-emitter','redis','status','end','json','offset','undefined','limit','count','set','update','then','sendStatus','error','name','send','index','CloudProvider','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','order','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll','rows','MicrosoftAzure','data3','catch','show','params','keys','length','includeAll','options','service','decryptString','create','body','Name\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter'];(function(_0x292456,_0x9a9d5){var _0x2e4bfe=function(_0x3a4584){while(--_0x3a4584){_0x292456['push'](_0x292456['shift']());}};_0x2e4bfe(++_0x9a9d5);}(_0x25c3,0xd0));var _0x325c=function(_0x445908,_0x106a15){_0x445908=_0x445908-0x0;var _0x37da57=_0x25c3[_0x445908];return _0x37da57;};'use strict';var _=require(_0x325c('0x0'));var Redis=require(_0x325c('0x1'));var qs=require(_0x325c('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x325c('0x3'));var logger=require(_0x325c('0x4'))(_0x325c('0x5'));var db=require(_0x325c('0x6'))['db'];var oauth=require(_0x325c('0x7'));config['redis']=_[_0x325c('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x325c('0x9'))(new Redis(config[_0x325c('0xa')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x3d0af6,_0x20fe50){_0x20fe50=_0x20fe50||0xcc;return function(_0xe4b9a5){if(_0xe4b9a5){return _0x3d0af6['sendStatus'](_0x20fe50);}return _0x3d0af6[_0x325c('0xb')](_0x20fe50)[_0x325c('0xc')]();};}function respondWithResult(_0x316aac,_0xee9709){_0xee9709=_0xee9709||0xc8;return function(_0x10a55d){if(_0x10a55d){return _0x316aac[_0x325c('0xb')](_0xee9709)[_0x325c('0xd')](_0x10a55d);}};}function respondWithFilteredResult(_0x5e1d44,_0x39b41e){return function(_0x874b7c){if(_0x874b7c){var _0x3959f9=typeof _0x39b41e[_0x325c('0xe')]===_0x325c('0xf')&&typeof _0x39b41e[_0x325c('0x10')]===_0x325c('0xf');var _0x22ab65=_0x874b7c[_0x325c('0x11')];var _0x2da61a=_0x3959f9?0x0:_0x39b41e[_0x325c('0xe')];var _0x2f3b80=_0x3959f9?_0x874b7c[_0x325c('0x11')]:_0x39b41e[_0x325c('0xe')]+_0x39b41e[_0x325c('0x10')];var _0x212291;if(_0x2f3b80>=_0x22ab65){_0x2f3b80=_0x22ab65;_0x212291=0xc8;}else{_0x212291=0xce;}_0x5e1d44[_0x325c('0xb')](_0x212291);return _0x5e1d44[_0x325c('0x12')]('Content-Range',_0x2da61a+'-'+_0x2f3b80+'/'+_0x22ab65)[_0x325c('0xd')](_0x874b7c);}return null;};}function saveUpdates(_0x47b12f){return function(_0x4be8ec){if(_0x4be8ec){return _0x4be8ec[_0x325c('0x13')](_0x47b12f)[_0x325c('0x14')](function(_0x54d2d4){return _0x54d2d4;});}return null;};}function removeEntity(_0xda5727){return function(_0x4b07d3){if(_0x4b07d3){return _0x4b07d3['destroy']()[_0x325c('0x14')](function(){_0xda5727[_0x325c('0xb')](0xcc)[_0x325c('0xc')]();});}};}function handleEntityNotFound(_0x372155){return function(_0xb1f22f){if(!_0xb1f22f){_0x372155[_0x325c('0x15')](0x194);}return _0xb1f22f;};}function handleError(_0x3de9fa,_0x5dfbde){_0x5dfbde=_0x5dfbde||0x1f4;return function(_0x396e7c){logger[_0x325c('0x16')](_0x396e7c['stack']);if(_0x396e7c[_0x325c('0x17')]){delete _0x396e7c[_0x325c('0x17')];}_0x3de9fa[_0x325c('0xb')](_0x5dfbde)[_0x325c('0x18')](_0x396e7c);};}function maskClientSecret(_0x3c458f){return _['padEnd'](_0x3c458f['slice'](0x0,0x3),0x14,'*');}exports[_0x325c('0x19')]=function(_0x326d69,_0x5a741b){var _0x3d28a5={},_0x184841={},_0x599936={'count':0x0,'rows':[]};var _0x5777eb=_['map'](db[_0x325c('0x1a')][_0x325c('0x1b')],function(_0x40485c){return{'name':_0x40485c[_0x325c('0x1c')],'type':_0x40485c['type'][_0x325c('0x1d')]};});_0x184841[_0x325c('0x1e')]=_[_0x325c('0x1f')](_0x5777eb,_0x325c('0x17'));_0x184841[_0x325c('0x20')]=_['keys'](_0x326d69[_0x325c('0x20')]);_0x184841[_0x325c('0x21')]=_[_0x325c('0x22')](_0x184841[_0x325c('0x1e')],_0x184841['query']);_0x3d28a5['attributes']=_[_0x325c('0x22')](_0x184841[_0x325c('0x1e')],qs[_0x325c('0x23')](_0x326d69[_0x325c('0x20')]['fields']));_0x3d28a5['attributes']=_0x3d28a5['attributes']['length']?_0x3d28a5[_0x325c('0x24')]:_0x184841[_0x325c('0x1e')];if(!_0x326d69[_0x325c('0x20')]['hasOwnProperty']('nolimit')){_0x3d28a5[_0x325c('0x10')]=qs['limit'](_0x326d69['query']['limit']);_0x3d28a5[_0x325c('0xe')]=qs[_0x325c('0xe')](_0x326d69[_0x325c('0x20')][_0x325c('0xe')]);}_0x3d28a5[_0x325c('0x25')]=qs[_0x325c('0x26')](_0x326d69[_0x325c('0x20')]['sort']);_0x3d28a5[_0x325c('0x27')]=qs[_0x325c('0x21')](_[_0x325c('0x28')](_0x326d69['query'],_0x184841['filters']),_0x5777eb);if(_0x326d69[_0x325c('0x20')][_0x325c('0x29')]){_0x3d28a5[_0x325c('0x27')]=_[_0x325c('0x2a')](_0x3d28a5['where'],{'$or':_[_0x325c('0x1f')](_0x5777eb,function(_0x1449b8){if(_0x1449b8[_0x325c('0x2b')]!==_0x325c('0x2c')){var _0x4313ff={};_0x4313ff[_0x1449b8[_0x325c('0x17')]]={'$like':'%'+_0x326d69['query'][_0x325c('0x29')]+'%'};return _0x4313ff;}})});}_0x3d28a5=_[_0x325c('0x2a')]({},_0x3d28a5,_0x326d69['options']);var _0x676cfe={'where':_0x3d28a5[_0x325c('0x27')]};return db[_0x325c('0x1a')][_0x325c('0x11')](_0x676cfe)[_0x325c('0x14')](function(_0x4c4c1c){_0x599936[_0x325c('0x11')]=_0x4c4c1c;if(_0x326d69['query']['includeAll']){_0x3d28a5[_0x325c('0x2d')]=[{'all':!![]}];}return db[_0x325c('0x1a')][_0x325c('0x2e')](_0x3d28a5);})['then'](function(_0x2b6c3a){_0x599936[_0x325c('0x2f')]=_['map'](_0x2b6c3a,function(_0x3b259e){if(_0x3b259e['service']===_0x325c('0x30')){var _0x1cb6f0=encryptor['decryptString'](_0x3b259e[_0x325c('0x31')]);_0x3b259e[_0x325c('0x31')]=maskClientSecret(_0x1cb6f0);}return _0x3b259e;});return _0x599936;})[_0x325c('0x14')](respondWithFilteredResult(_0x5a741b,_0x3d28a5))[_0x325c('0x32')](handleError(_0x5a741b,null));};exports[_0x325c('0x33')]=function(_0x15fe82,_0x561080){var _0x48f9c3={'raw':!![],'where':{'id':_0x15fe82[_0x325c('0x34')]['id']}},_0x45b72b={};_0x45b72b[_0x325c('0x1e')]=_['keys'](db[_0x325c('0x1a')][_0x325c('0x1b')]);_0x45b72b[_0x325c('0x20')]=_[_0x325c('0x35')](_0x15fe82[_0x325c('0x20')]);_0x45b72b['filters']=_[_0x325c('0x22')](_0x45b72b[_0x325c('0x1e')],_0x45b72b[_0x325c('0x20')]);_0x48f9c3['attributes']=_[_0x325c('0x22')](_0x45b72b[_0x325c('0x1e')],qs[_0x325c('0x23')](_0x15fe82[_0x325c('0x20')][_0x325c('0x23')]));_0x48f9c3[_0x325c('0x24')]=_0x48f9c3[_0x325c('0x24')][_0x325c('0x36')]?_0x48f9c3[_0x325c('0x24')]:_0x45b72b[_0x325c('0x1e')];if(_0x15fe82[_0x325c('0x20')][_0x325c('0x37')]){_0x48f9c3[_0x325c('0x2d')]=[{'all':!![]}];}_0x48f9c3=_[_0x325c('0x2a')]({},_0x48f9c3,_0x15fe82[_0x325c('0x38')]);return db[_0x325c('0x1a')]['find'](_0x48f9c3)['then'](handleEntityNotFound(_0x561080,null))[_0x325c('0x14')](function(_0xa4f6b5){if(_0xa4f6b5[_0x325c('0x39')]===_0x325c('0x30')){var _0x5def82=encryptor[_0x325c('0x3a')](_0xa4f6b5[_0x325c('0x31')]);_0xa4f6b5[_0x325c('0x31')]=maskClientSecret(_0x5def82);}return _0xa4f6b5;})[_0x325c('0x14')](respondWithResult(_0x561080,null))[_0x325c('0x32')](handleError(_0x561080,null));};exports[_0x325c('0x3b')]=function(_0x2f4d7e,_0x5b9a09){if(!_0x2f4d7e[_0x325c('0x3c')][_0x325c('0x17')])throw new Error(_0x325c('0x3d'));if(!_0x2f4d7e['body'][_0x325c('0x39')])throw new Error('Service\x20parameter\x20not\x20specified');var _0xde6da0=db[_0x325c('0x1a')][_0x325c('0x1b')][_0x325c('0x39')][_0x325c('0x3e')];if(!_0xde6da0[_0x325c('0x3f')](_0x2f4d7e['body'][_0x325c('0x39')]))throw new Error(_0x325c('0x40')+_0xde6da0[_0x325c('0x41')](',\x20'));if(_0x2f4d7e[_0x325c('0x3c')][_0x325c('0x39')]===_0x325c('0x30')&&_0x2f4d7e[_0x325c('0x3c')]['data3']){_0x2f4d7e[_0x325c('0x3c')][_0x325c('0x31')]=encryptor[_0x325c('0x42')](_0x2f4d7e['body'][_0x325c('0x31')]);}return db[_0x325c('0x1a')]['create'](_0x2f4d7e[_0x325c('0x3c')],{})[_0x325c('0x14')](respondWithResult(_0x5b9a09,0xc9))['catch'](handleError(_0x5b9a09,null));};exports[_0x325c('0x13')]=function(_0x347958,_0x1a1489){if(_0x347958[_0x325c('0x3c')]['id']){delete _0x347958[_0x325c('0x3c')]['id'];}return db['CloudProvider'][_0x325c('0x43')]({'where':{'id':_0x347958[_0x325c('0x34')]['id']}})['then'](handleEntityNotFound(_0x1a1489,null))[_0x325c('0x14')](function(_0x2f9ead){if(_0x2f9ead[_0x325c('0x39')]===_0x325c('0x30')&&_0x347958[_0x325c('0x3c')][_0x325c('0x31')]){_0x347958[_0x325c('0x3c')][_0x325c('0x31')]=encryptor[_0x325c('0x42')](_0x347958['body'][_0x325c('0x31')]);}return _0x2f9ead;})[_0x325c('0x14')](saveUpdates(_0x347958['body'],null))[_0x325c('0x14')](respondWithResult(_0x1a1489,null))[_0x325c('0x32')](handleError(_0x1a1489,null));};exports['destroy']=function(_0x3cc348,_0x714bbd){return db['CloudProvider'][_0x325c('0x43')]({'where':{'id':_0x3cc348['params']['id']}})[_0x325c('0x14')](handleEntityNotFound(_0x714bbd,null))[_0x325c('0x14')](removeEntity(_0x714bbd,null))[_0x325c('0x32')](handleError(_0x714bbd,null));};exports['oauth2MicrosoftAuthorize']=function(_0x44ce46,_0x472666){return db['CloudProvider'][_0x325c('0x44')]({'where':{'id':_0x44ce46[_0x325c('0x34')]['id']},'raw':!![]})['then'](function(_0x183d75){if(!_0x183d75)return _0x472666['sendStatus'](0x194);return{'url':oauth[_0x325c('0x45')](_0x183d75,_0x44ce46[_0x325c('0x46')]['id'])};})[_0x325c('0x14')](respondWithResult(_0x472666,null))[_0x325c('0x32')](handleError(_0x472666,null));};exports[_0x325c('0x47')]=function(_0x46f619,_0xa4933c){var _0x518396=_0x46f619['body'];var _0x519c27;var _0x3b5fa7;if(_0x518396[_0x325c('0x16')])throw _0x518396;redis['get'](_0x518396[_0x325c('0x48')])[_0x325c('0x14')](function(_0x1289c1){if(!_0x1289c1)throw new Error(_0x325c('0x49'));_0x519c27=JSON[_0x325c('0x4a')](_0x1289c1);var _0x5e31ff=Buffer['from'](_0x518396[_0x325c('0x48')],_0x325c('0x4b'))[_0x325c('0x4c')](_0x325c('0x4d'));_0x3b5fa7=JSON[_0x325c('0x4a')](_0x5e31ff);if(!oauth[_0x325c('0x4e')](_0x518396[_0x325c('0x4f')],_0x519c27[_0x325c('0x50')]))throw new Error(_0x325c('0x51'));redis[_0x325c('0x52')](_0x518396[_0x325c('0x48')]);return oauth[_0x325c('0x53')](_0x518396[_0x325c('0x54')],_0x519c27);})[_0x325c('0x14')](function(_0x266a25){_0x519c27[_0x325c('0x55')]=_0x266a25[_0x325c('0x56')];_0x519c27[_0x325c('0x57')]=_0x266a25[_0x325c('0x58')];return db[_0x325c('0x1a')][_0x325c('0x13')]({'data5':_0x519c27[_0x325c('0x55')],'data6':_0x519c27[_0x325c('0x57')]},{'where':{'id':_0x519c27['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x519c27);socket['emit'](_0x325c('0x59'),{'id':_0x3b5fa7['id']});return;})[_0x325c('0x14')](respondWithStatusCode(_0xa4933c,null))[_0x325c('0x32')](function(_0x1b5de5){if(_0x3b5fa7){socket[_0x325c('0x5a')](_0x325c('0x5b'),{'id':_0x3b5fa7['id']});}if(!_0x519c27){logger[_0x325c('0x16')]('Invalid\x20authentication\x20state\x20parameter',_0x1b5de5);return _0xa4933c[_0x325c('0xb')](0x1f4)[_0x325c('0x18')](_0x1b5de5['message']);}logger['error'](_0x325c('0x5c'),_0x519c27['id'],JSON[_0x325c('0x5d')](_0x1b5de5));});};
\ No newline at end of file
+var _0x224f=['intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','MicrosoftAzure','decryptString','data3','catch','show','params','options','find','service','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','get','state','Invalid\x20state\x20parameter','from','base64','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/logger','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','sendStatus','status','end','json','offset','undefined','limit','count','set','destroy','then','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','query','keys','filters'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x224f,0x1da));var _0xf224=function(_0x4cee4b,_0x1dfff3){_0x4cee4b=_0x4cee4b-0x0;var _0x4d891d=_0x224f[_0x4cee4b];return _0x4d891d;};'use strict';var _=require('lodash');var Redis=require(_0xf224('0x0'));var qs=require(_0xf224('0x1'));var encryptor=require(_0xf224('0x2'));var config=require('../../config/environment');var logger=require(_0xf224('0x3'))('api');var db=require(_0xf224('0x4'))['db'];var oauth=require(_0xf224('0x5'));config['redis']=_[_0xf224('0x6')](config[_0xf224('0x7')],{'host':_0xf224('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf224('0x7')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x26f1ed,_0x4383e){_0x4383e=_0x4383e||0xcc;return function(_0x50f9a2){if(_0x50f9a2){return _0x26f1ed[_0xf224('0x9')](_0x4383e);}return _0x26f1ed[_0xf224('0xa')](_0x4383e)[_0xf224('0xb')]();};}function respondWithResult(_0x26184b,_0x1eea4a){_0x1eea4a=_0x1eea4a||0xc8;return function(_0x334bdd){if(_0x334bdd){return _0x26184b[_0xf224('0xa')](_0x1eea4a)[_0xf224('0xc')](_0x334bdd);}};}function respondWithFilteredResult(_0x4f9c0c,_0xaa57ee){return function(_0x3a1a44){if(_0x3a1a44){var _0xb7fb8=typeof _0xaa57ee[_0xf224('0xd')]===_0xf224('0xe')&&typeof _0xaa57ee[_0xf224('0xf')]===_0xf224('0xe');var _0x11a59c=_0x3a1a44[_0xf224('0x10')];var _0x45d9c7=_0xb7fb8?0x0:_0xaa57ee[_0xf224('0xd')];var _0x351be9=_0xb7fb8?_0x3a1a44[_0xf224('0x10')]:_0xaa57ee[_0xf224('0xd')]+_0xaa57ee[_0xf224('0xf')];var _0x1a291a;if(_0x351be9>=_0x11a59c){_0x351be9=_0x11a59c;_0x1a291a=0xc8;}else{_0x1a291a=0xce;}_0x4f9c0c[_0xf224('0xa')](_0x1a291a);return _0x4f9c0c[_0xf224('0x11')]('Content-Range',_0x45d9c7+'-'+_0x351be9+'/'+_0x11a59c)[_0xf224('0xc')](_0x3a1a44);}return null;};}function saveUpdates(_0x1a1ccc){return function(_0xd0189b){if(_0xd0189b){return _0xd0189b['update'](_0x1a1ccc)['then'](function(_0x954cca){return _0x954cca;});}return null;};}function removeEntity(_0x114eb4){return function(_0x19313c){if(_0x19313c){return _0x19313c[_0xf224('0x12')]()[_0xf224('0x13')](function(){_0x114eb4[_0xf224('0xa')](0xcc)[_0xf224('0xb')]();});}};}function handleEntityNotFound(_0xb16786){return function(_0x4bda23){if(!_0x4bda23){_0xb16786[_0xf224('0x9')](0x194);}return _0x4bda23;};}function handleError(_0x18bf29,_0x472844){_0x472844=_0x472844||0x1f4;return function(_0x27c0e9){logger[_0xf224('0x14')](_0x27c0e9[_0xf224('0x15')]);if(_0x27c0e9[_0xf224('0x16')]){delete _0x27c0e9[_0xf224('0x16')];}_0x18bf29[_0xf224('0xa')](_0x472844)[_0xf224('0x17')](_0x27c0e9);};}function maskClientSecret(_0x4ff754){return _[_0xf224('0x18')](_0x4ff754[_0xf224('0x19')](0x0,0x3),0x14,'*');}exports[_0xf224('0x1a')]=function(_0x256176,_0xebb29a){var _0x18148d={},_0xf234da={},_0xe69582={'count':0x0,'rows':[]};var _0xe1b0ca=_[_0xf224('0x1b')](db[_0xf224('0x1c')][_0xf224('0x1d')],function(_0x364f31){return{'name':_0x364f31[_0xf224('0x1e')],'type':_0x364f31[_0xf224('0x1f')][_0xf224('0x20')]};});_0xf234da['model']=_[_0xf224('0x1b')](_0xe1b0ca,'name');_0xf234da[_0xf224('0x21')]=_[_0xf224('0x22')](_0x256176[_0xf224('0x21')]);_0xf234da[_0xf224('0x23')]=_[_0xf224('0x24')](_0xf234da[_0xf224('0x25')],_0xf234da['query']);_0x18148d['attributes']=_['intersection'](_0xf234da[_0xf224('0x25')],qs[_0xf224('0x26')](_0x256176[_0xf224('0x21')][_0xf224('0x26')]));_0x18148d[_0xf224('0x27')]=_0x18148d['attributes'][_0xf224('0x28')]?_0x18148d[_0xf224('0x27')]:_0xf234da['model'];if(!_0x256176[_0xf224('0x21')][_0xf224('0x29')](_0xf224('0x2a'))){_0x18148d[_0xf224('0xf')]=qs[_0xf224('0xf')](_0x256176[_0xf224('0x21')][_0xf224('0xf')]);_0x18148d[_0xf224('0xd')]=qs[_0xf224('0xd')](_0x256176[_0xf224('0x21')][_0xf224('0xd')]);}_0x18148d[_0xf224('0x2b')]=qs['sort'](_0x256176['query'][_0xf224('0x2c')]);_0x18148d[_0xf224('0x2d')]=qs[_0xf224('0x23')](_[_0xf224('0x2e')](_0x256176[_0xf224('0x21')],_0xf234da[_0xf224('0x23')]),_0xe1b0ca);if(_0x256176[_0xf224('0x21')][_0xf224('0x2f')]){_0x18148d['where']=_[_0xf224('0x30')](_0x18148d['where'],{'$or':_[_0xf224('0x1b')](_0xe1b0ca,function(_0xa9bd86){if(_0xa9bd86[_0xf224('0x1f')]!==_0xf224('0x31')){var _0x37e242={};_0x37e242[_0xa9bd86[_0xf224('0x16')]]={'$like':'%'+_0x256176[_0xf224('0x21')]['filter']+'%'};return _0x37e242;}})});}_0x18148d=_['merge']({},_0x18148d,_0x256176['options']);var _0x288e93={'where':_0x18148d[_0xf224('0x2d')]};return db[_0xf224('0x1c')][_0xf224('0x10')](_0x288e93)['then'](function(_0x1f82d4){_0xe69582[_0xf224('0x10')]=_0x1f82d4;if(_0x256176['query'][_0xf224('0x32')]){_0x18148d[_0xf224('0x33')]=[{'all':!![]}];}return db[_0xf224('0x1c')][_0xf224('0x34')](_0x18148d);})[_0xf224('0x13')](function(_0x4951d2){_0xe69582[_0xf224('0x35')]=_[_0xf224('0x1b')](_0x4951d2,function(_0x47a14a){if(_0x47a14a['service']===_0xf224('0x36')){var _0x5080cf=encryptor[_0xf224('0x37')](_0x47a14a[_0xf224('0x38')]);_0x47a14a[_0xf224('0x38')]=maskClientSecret(_0x5080cf);}return _0x47a14a;});return _0xe69582;})[_0xf224('0x13')](respondWithFilteredResult(_0xebb29a,_0x18148d))[_0xf224('0x39')](handleError(_0xebb29a,null));};exports[_0xf224('0x3a')]=function(_0x1f6506,_0x333f41){var _0x4a5808={'raw':!![],'where':{'id':_0x1f6506[_0xf224('0x3b')]['id']}},_0x3a5920={};_0x3a5920['model']=_[_0xf224('0x22')](db[_0xf224('0x1c')][_0xf224('0x1d')]);_0x3a5920[_0xf224('0x21')]=_[_0xf224('0x22')](_0x1f6506['query']);_0x3a5920[_0xf224('0x23')]=_[_0xf224('0x24')](_0x3a5920[_0xf224('0x25')],_0x3a5920[_0xf224('0x21')]);_0x4a5808[_0xf224('0x27')]=_[_0xf224('0x24')](_0x3a5920[_0xf224('0x25')],qs[_0xf224('0x26')](_0x1f6506['query']['fields']));_0x4a5808[_0xf224('0x27')]=_0x4a5808['attributes'][_0xf224('0x28')]?_0x4a5808['attributes']:_0x3a5920[_0xf224('0x25')];if(_0x1f6506[_0xf224('0x21')][_0xf224('0x32')]){_0x4a5808['include']=[{'all':!![]}];}_0x4a5808=_[_0xf224('0x30')]({},_0x4a5808,_0x1f6506[_0xf224('0x3c')]);return db[_0xf224('0x1c')][_0xf224('0x3d')](_0x4a5808)[_0xf224('0x13')](handleEntityNotFound(_0x333f41,null))[_0xf224('0x13')](function(_0xa01960){if(_0xa01960[_0xf224('0x3e')]===_0xf224('0x36')){var _0x32e995=encryptor[_0xf224('0x37')](_0xa01960['data3']);_0xa01960[_0xf224('0x38')]=maskClientSecret(_0x32e995);}return _0xa01960;})[_0xf224('0x13')](respondWithResult(_0x333f41,null))['catch'](handleError(_0x333f41,null));};exports[_0xf224('0x3f')]=function(_0x103692,_0x38d7d5){if(!_0x103692[_0xf224('0x40')][_0xf224('0x16')])throw new Error(_0xf224('0x41'));if(!_0x103692['body']['service'])throw new Error(_0xf224('0x42'));var _0x72f5bb=db[_0xf224('0x1c')]['rawAttributes'][_0xf224('0x3e')][_0xf224('0x43')];if(!_0x72f5bb[_0xf224('0x44')](_0x103692[_0xf224('0x40')][_0xf224('0x3e')]))throw new Error(_0xf224('0x45')+_0x72f5bb[_0xf224('0x46')](',\x20'));if(_0x103692['body']['service']===_0xf224('0x36')&&_0x103692['body'][_0xf224('0x38')]){_0x103692[_0xf224('0x40')][_0xf224('0x38')]=encryptor[_0xf224('0x47')](_0x103692[_0xf224('0x40')][_0xf224('0x38')]);}return db['CloudProvider']['create'](_0x103692[_0xf224('0x40')],{})[_0xf224('0x13')](respondWithResult(_0x38d7d5,0xc9))[_0xf224('0x39')](handleError(_0x38d7d5,null));};exports[_0xf224('0x48')]=function(_0x13d9f3,_0x407a73){if(_0x13d9f3['body']['id']){delete _0x13d9f3['body']['id'];}return db[_0xf224('0x1c')][_0xf224('0x3d')]({'where':{'id':_0x13d9f3[_0xf224('0x3b')]['id']}})[_0xf224('0x13')](handleEntityNotFound(_0x407a73,null))[_0xf224('0x13')](function(_0x389ba6){if(_0x389ba6[_0xf224('0x3e')]==='MicrosoftAzure'&&_0x13d9f3['body'][_0xf224('0x38')]){_0x13d9f3[_0xf224('0x40')][_0xf224('0x38')]=encryptor[_0xf224('0x47')](_0x13d9f3[_0xf224('0x40')][_0xf224('0x38')]);}return _0x389ba6;})[_0xf224('0x13')](saveUpdates(_0x13d9f3[_0xf224('0x40')],null))['then'](respondWithResult(_0x407a73,null))['catch'](handleError(_0x407a73,null));};exports[_0xf224('0x12')]=function(_0x24469a,_0x46b314){return db['CloudProvider'][_0xf224('0x3d')]({'where':{'id':_0x24469a[_0xf224('0x3b')]['id']}})[_0xf224('0x13')](handleEntityNotFound(_0x46b314,null))[_0xf224('0x13')](removeEntity(_0x46b314,null))[_0xf224('0x39')](handleError(_0x46b314,null));};exports[_0xf224('0x49')]=function(_0x169de8,_0x23d2b1){return db[_0xf224('0x1c')][_0xf224('0x4a')]({'where':{'id':_0x169de8[_0xf224('0x3b')]['id']},'raw':!![]})[_0xf224('0x13')](function(_0x36ef83){if(!_0x36ef83)return _0x23d2b1[_0xf224('0x9')](0x194);return{'url':oauth[_0xf224('0x4b')](_0x36ef83,_0x169de8[_0xf224('0x4c')]['id'])};})[_0xf224('0x13')](respondWithResult(_0x23d2b1,null))[_0xf224('0x39')](handleError(_0x23d2b1,null));};exports['oauth2MicrosoftCallback']=function(_0x22a89f,_0x425bea){var _0x302611=_0x22a89f[_0xf224('0x40')];var _0xb9ca27;var _0xcfb4f4;if(_0x302611[_0xf224('0x14')])throw _0x302611;redis[_0xf224('0x4d')](_0x302611[_0xf224('0x4e')])[_0xf224('0x13')](function(_0x5ee013){if(!_0x5ee013)throw new Error(_0xf224('0x4f'));_0xb9ca27=JSON['parse'](_0x5ee013);var _0x21767d=Buffer[_0xf224('0x50')](_0x302611[_0xf224('0x4e')],_0xf224('0x51'))[_0xf224('0x52')](_0xf224('0x53'));_0xcfb4f4=JSON[_0xf224('0x54')](_0x21767d);if(!oauth[_0xf224('0x55')](_0x302611[_0xf224('0x56')],_0xb9ca27[_0xf224('0x57')]))throw new Error(_0xf224('0x58'));redis[_0xf224('0x59')](_0x302611['state']);return oauth[_0xf224('0x5a')](_0x302611[_0xf224('0x5b')],_0xb9ca27);})[_0xf224('0x13')](function(_0x665637){_0xb9ca27[_0xf224('0x5c')]=_0x665637[_0xf224('0x5d')];_0xb9ca27['data6']=_0x665637[_0xf224('0x5e')];return db[_0xf224('0x1c')][_0xf224('0x48')]({'data5':_0xb9ca27[_0xf224('0x5c')],'data6':_0xb9ca27['data6']},{'where':{'id':_0xb9ca27['id']}});})[_0xf224('0x13')](function(){oauth[_0xf224('0x5f')](_0xb9ca27);socket[_0xf224('0x60')](_0xf224('0x61'),{'id':_0xcfb4f4['id']});return;})[_0xf224('0x13')](respondWithStatusCode(_0x425bea,null))[_0xf224('0x39')](function(_0x58a1e3){if(_0xcfb4f4){socket[_0xf224('0x60')](_0xf224('0x62'),{'id':_0xcfb4f4['id']});}if(!_0xb9ca27){logger[_0xf224('0x14')](_0xf224('0x63'),_0x58a1e3);return _0x425bea[_0xf224('0xa')](0x1f4)[_0xf224('0x17')](_0x58a1e3[_0xf224('0x64')]);}logger[_0xf224('0x14')](_0xf224('0x65'),_0xb9ca27['id'],JSON['stringify'](_0x58a1e3));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 1e26266..ea852af 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 _0x096a=['../../config/environment','./cloudProvider.attributes','exports','cloud_providers','lodash','../../config/logger','api','bluebird','path','rimraf'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x096a,0x1b2));var _0xa096=function(_0x51235c,_0x310731){_0x51235c=_0x51235c-0x0;var _0x43d852=_0x096a[_0x51235c];return _0x43d852;};'use strict';var _=require(_0xa096('0x0'));var util=require('util');var logger=require(_0xa096('0x1'))(_0xa096('0x2'));var moment=require('moment');var BPromise=require(_0xa096('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa096('0x4'));var rimraf=require(_0xa096('0x5'));var config=require(_0xa096('0x6'));var attributes=require(_0xa096('0x7'));module[_0xa096('0x8')]=function(_0x14f3c1,_0x5a9350){return _0x14f3c1['define']('CloudProvider',attributes,{'tableName':_0xa096('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcddc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','lodash','util','../../config/logger','api'];(function(_0x50aecd,_0x3afbf1){var _0x21321d=function(_0x12b40c){while(--_0x12b40c){_0x50aecd['push'](_0x50aecd['shift']());}};_0x21321d(++_0x3afbf1);}(_0xcddc,0x130));var _0xccdd=function(_0x6b910b,_0x38ce8f){_0x6b910b=_0x6b910b-0x0;var _0x3408a7=_0xcddc[_0x6b910b];return _0x3408a7;};'use strict';var _=require(_0xccdd('0x0'));var util=require(_0xccdd('0x1'));var logger=require(_0xccdd('0x2'))(_0xccdd('0x3'));var moment=require(_0xccdd('0x4'));var BPromise=require(_0xccdd('0x5'));var rp=require(_0xccdd('0x6'));var fs=require('fs');var path=require(_0xccdd('0x7'));var rimraf=require(_0xccdd('0x8'));var config=require(_0xccdd('0x9'));var attributes=require(_0xccdd('0xa'));module['exports']=function(_0x1ff323,_0x5e5daa){return _0x1ff323['define']('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index e00e158..0fc07d9 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 _0xb222=['util','../../config/logger','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','offline_access','/authorize','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','id_token','from','stringify','toString','base64','hex','client_id','response_type','redirect_uri','data4','response_mode','form_post','scope','nonce','prompt','login','key','value','oauth2/','data1','set','decode','payload','iss','issuer','aud','audience','isAfter','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','data5','access_token','update','catch','error','authorization_code','intervals','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise'];(function(_0x9f27ef,_0xf53771){var _0x5ed282=function(_0x1fb91a){while(--_0x1fb91a){_0x9f27ef['push'](_0x9f27ef['shift']());}};_0x5ed282(++_0xf53771);}(_0xb222,0xe4));var _0x2b22=function(_0x1707af,_0x17ab07){_0x1707af=_0x1707af-0x0;var _0x44b17c=_0xb222[_0x1707af];return _0x44b17c;};'use strict';var _=require(_0x2b22('0x0'));var crypto=require(_0x2b22('0x1'));var jwt=require(_0x2b22('0x2'));var moment=require(_0x2b22('0x3'));var Redis=require(_0x2b22('0x4'));var rp=require(_0x2b22('0x5'));var util=require(_0x2b22('0x6'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x2b22('0x7'))('api');var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x2b22('0x8'))['db'];config[_0x2b22('0x9')]=_[_0x2b22('0xa')](config[_0x2b22('0x9')],{'host':_0x2b22('0xb'),'port':0x18eb});var redis=new Redis(config[_0x2b22('0x9')]);var MICROSOFT_AUTH_URL=_0x2b22('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x2b22('0xd'),_0x2b22('0xe'),_0x2b22('0xf'),'offline_access',_0x2b22('0x10'),'https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x2b22('0xd'),_0x2b22('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x2b22('0x12');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2d878d){var _0x4d5bcc=_[_0x2b22('0x13')](AZURE_AUTH_SCOPES[_0x2d878d[_0x2b22('0x14')]]);if(_0x2d878d[_0x2b22('0x14')]===_0x2b22('0x15'))_0x4d5bcc[_0x2b22('0x16')](_0x2d878d[_0x2b22('0x17')]+_0x2b22('0x18'));return _0x4d5bcc[_0x2b22('0x19')]('\x20');}function getAccessTokenScope(_0x12b246){if(_0x12b246[_0x2b22('0x14')]===_0x2b22('0x1a'))return _0x2b22('0x10');if(_0x12b246['type']===_0x2b22('0x15'))return _0x12b246[_0x2b22('0x17')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x2dad0e,_0x4cb62e){var _0x2cc364=MICROSOFT_AUTH_URL[_0x2b22('0x1b')](_0x2b22('0x1c'),_0x2dad0e[_0x2b22('0x1d')]);var _0x517fe3=['code',_0x2b22('0x1e')];var _0x1f85ba=Buffer[_0x2b22('0x1f')](JSON[_0x2b22('0x20')]({'id':_0x4cb62e}))[_0x2b22('0x21')](_0x2b22('0x22'));var _0x2e9040=crypto['randomBytes'](0x10)[_0x2b22('0x21')](_0x2b22('0x23'));var _0x4c5c4d=getAuthorizationScopes(_0x2dad0e);var _0x306f49=[{'key':_0x2b22('0x24'),'value':_0x2dad0e['data1']},{'key':_0x2b22('0x25'),'value':encodeURIComponent(_0x517fe3[_0x2b22('0x19')]('\x20'))},{'key':_0x2b22('0x26'),'value':_0x2dad0e[_0x2b22('0x27')]},{'key':_0x2b22('0x28'),'value':_0x2b22('0x29')},{'key':_0x2b22('0x2a'),'value':encodeURIComponent(_0x4c5c4d)},{'key':'state','value':_0x1f85ba},{'key':_0x2b22('0x2b'),'value':_0x2e9040},{'key':_0x2b22('0x2c'),'value':_0x2b22('0x2d')}];var _0x53d5c9=_0x2cc364+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x2b22('0x13')](_0x306f49,function(_0x4e07ec){return _0x4e07ec[_0x2b22('0x2e')]+'='+_0x4e07ec[_0x2b22('0x2f')];})[_0x2b22('0x19')]('&');_0x2dad0e['oauth2Claims']={'issuer':_0x2cc364['replace'](_0x2b22('0x30'),''),'audience':_0x2dad0e[_0x2b22('0x31')],'state':_0x1f85ba,'nonce':_0x2e9040};redis[_0x2b22('0x32')](_0x1f85ba,JSON[_0x2b22('0x20')](_0x2dad0e));return _0x53d5c9;}function isValidIdToken(_0x38f73e,_0x499db2){try{var _0x47a939=jwt[_0x2b22('0x33')](_0x38f73e,{'complete':!![]});var _0x19dc22=_0x47a939[_0x2b22('0x34')];if(_0x19dc22[_0x2b22('0x35')]!==_0x499db2[_0x2b22('0x36')])return![];if(_0x19dc22[_0x2b22('0x37')]!==_0x499db2[_0x2b22('0x38')])return![];if(_0x19dc22[_0x2b22('0x2b')]!==_0x499db2['nonce'])return![];if(moment()[_0x2b22('0x39')](moment['unix'](_0x19dc22[_0x2b22('0x3a')])))return![];return!![];}catch(_0x533d3a){throw _0x533d3a;}}function refreshOauth2MicrosoftAccessToken(_0xf08860){return Promise[_0x2b22('0x3b')]()[_0x2b22('0x3c')](function(){if(_0xf08860[_0x2b22('0x3d')])return _0xf08860;return db[_0x2b22('0x3e')][_0x2b22('0x3f')]({'where':{'id':_0xf08860['id']},'raw':!![]});})[_0x2b22('0x3c')](function(_0x12ab20){var _0xf45e62={'grant_type':_0x2b22('0x40'),'refresh_token':_0x12ab20[_0x2b22('0x41')],'scope':getAccessTokenScope(_0x12ab20),'redirect_uri':_0x12ab20[_0x2b22('0x27')],'client_id':_0x12ab20['data1'],'client_secret':encryptor[_0x2b22('0x42')](_0x12ab20[_0x2b22('0x3d')])};var _0x1b41f5={'method':_0x2b22('0x43'),'uri':MICROSOFT_AUTH_URL[_0x2b22('0x1b')](_0x2b22('0x1c'),_0x12ab20['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xf45e62,'json':!![]};return rp(_0x1b41f5);})[_0x2b22('0x3c')](function(_0x33efa6){_0xf08860[_0x2b22('0x44')]=_0x33efa6[_0x2b22('0x45')];_0xf08860[_0x2b22('0x41')]=_0x33efa6[_0x2b22('0x40')];return db[_0x2b22('0x3e')][_0x2b22('0x46')]({'data5':_0xf08860[_0x2b22('0x44')],'data6':_0xf08860[_0x2b22('0x41')]},{'where':{'id':_0xf08860['id']}});})['then'](function(){return _0xf08860;})[_0x2b22('0x47')](function(_0x20a85a){logger[_0x2b22('0x48')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0xf08860['id'],_0x20a85a);});}function getOauth2MicrosoftAccessToken(_0x1e2162,_0x3a8af5){var _0x227e0b={'grant_type':_0x2b22('0x49'),'code':_0x1e2162,'scope':getAccessTokenScope(_0x3a8af5),'redirect_uri':_0x3a8af5['data4'],'client_id':_0x3a8af5[_0x2b22('0x31')],'client_secret':encryptor[_0x2b22('0x42')](_0x3a8af5[_0x2b22('0x3d')])};var _0x2b04a1={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x2b22('0x1b')](_0x2b22('0x1c'),_0x3a8af5['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x227e0b,'json':!![]};return rp(_0x2b04a1);}function startRefreshInterval(_0x15f24d){var _0x4e6e2d=schedule[_0x2b22('0x4a')];if(_0x4e6e2d[_0x15f24d['id']])clearInterval(_0x4e6e2d[_0x15f24d['id']]);_0x4e6e2d[_0x15f24d['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x15f24d['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x2b22('0x4a')]=_0x4e6e2d;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x2b22('0x3c')](function(_0x179feb){var _0x569ae2=_0x179feb[_0x2b22('0x13')](function(_0x3fa54c){return refreshOauth2MicrosoftAccessToken(_0x3fa54c)['then'](function(_0x12bbf5){startRefreshInterval(_0x12bbf5);});});return Promise[_0x2b22('0x4b')](_0x569ae2);})[_0x2b22('0x47')](function(_0x145c96){var _0x2bedde=_0x145c96?util['inspect'](_0x145c96,{'showHidden':![],'depth':null}):'';logger[_0x2b22('0x48')](_0x2b22('0x4c'),_0x2bedde);});}module[_0x2b22('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xdf68=['unix','exp','resolve','data3','CloudProvider','findOne','then','refresh_token','data6','decryptString','data5','access_token','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','POST','intervals','bind','findAll','all','catch','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../mysqldb','redis','defaults','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','/token','map','type','Dynamics365','push','/.default','join','Outlook365','{TENANT_ID}','data2','code','id_token','stringify','base64','randomBytes','toString','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','prompt','login','key','value','replace','oauth2/','set','decode','iss','aud','audience','nonce','isAfter'];(function(_0x464ee2,_0x3d1a7f){var _0x2b4454=function(_0x35587b){while(--_0x35587b){_0x464ee2['push'](_0x464ee2['shift']());}};_0x2b4454(++_0x3d1a7f);}(_0xdf68,0x198));var _0x8df6=function(_0x87239,_0x38c793){_0x87239=_0x87239-0x0;var _0x53af1e=_0xdf68[_0x87239];return _0x53af1e;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0x8df6('0x0'));var moment=require(_0x8df6('0x1'));var Redis=require(_0x8df6('0x2'));var rp=require(_0x8df6('0x3'));var util=require(_0x8df6('0x4'));var encryptor=require(_0x8df6('0x5'));var config=require(_0x8df6('0x6'));var logger=require('../../config/logger')('api');var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x8df6('0x7'))['db'];config[_0x8df6('0x8')]=_[_0x8df6('0x9')](config[_0x8df6('0x8')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x8df6('0x8')]);var MICROSOFT_AUTH_URL=_0x8df6('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0x8df6('0xb'),_0x8df6('0xc'),'email',_0x8df6('0xd'),_0x8df6('0xe'),_0x8df6('0xf'),_0x8df6('0x10')],'Dynamics365':[_0x8df6('0xb'),_0x8df6('0xd')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x8df6('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5857a2){var _0x8a2de0=_[_0x8df6('0x12')](AZURE_AUTH_SCOPES[_0x5857a2[_0x8df6('0x13')]]);if(_0x5857a2[_0x8df6('0x13')]===_0x8df6('0x14'))_0x8a2de0[_0x8df6('0x15')](_0x5857a2['data7']+_0x8df6('0x16'));return _0x8a2de0[_0x8df6('0x17')]('\x20');}function getAccessTokenScope(_0x532df2){if(_0x532df2['type']===_0x8df6('0x18'))return _0x8df6('0xe');if(_0x532df2[_0x8df6('0x13')]==='Dynamics365')return _0x532df2['data7']+_0x8df6('0x16');}function generateMicrosoftAuthorizationUrl(_0x494aa1,_0xb37cb9){var _0x345372=MICROSOFT_AUTH_URL['replace'](_0x8df6('0x19'),_0x494aa1[_0x8df6('0x1a')]);var _0x2cf03a=[_0x8df6('0x1b'),_0x8df6('0x1c')];var _0x5af783=Buffer['from'](JSON[_0x8df6('0x1d')]({'id':_0xb37cb9}))['toString'](_0x8df6('0x1e'));var _0x2b653c=crypto[_0x8df6('0x1f')](0x10)[_0x8df6('0x20')](_0x8df6('0x21'));var _0x5b456c=getAuthorizationScopes(_0x494aa1);var _0x2c9aac=[{'key':_0x8df6('0x22'),'value':_0x494aa1[_0x8df6('0x23')]},{'key':_0x8df6('0x24'),'value':encodeURIComponent(_0x2cf03a[_0x8df6('0x17')]('\x20'))},{'key':_0x8df6('0x25'),'value':_0x494aa1[_0x8df6('0x26')]},{'key':_0x8df6('0x27'),'value':_0x8df6('0x28')},{'key':'scope','value':encodeURIComponent(_0x5b456c)},{'key':'state','value':_0x5af783},{'key':'nonce','value':_0x2b653c},{'key':_0x8df6('0x29'),'value':_0x8df6('0x2a')}];var _0x5a034e=_0x345372+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x8df6('0x12')](_0x2c9aac,function(_0x248df6){return _0x248df6[_0x8df6('0x2b')]+'='+_0x248df6[_0x8df6('0x2c')];})['join']('&');_0x494aa1['oauth2Claims']={'issuer':_0x345372[_0x8df6('0x2d')](_0x8df6('0x2e'),''),'audience':_0x494aa1[_0x8df6('0x23')],'state':_0x5af783,'nonce':_0x2b653c};redis[_0x8df6('0x2f')](_0x5af783,JSON['stringify'](_0x494aa1));return _0x5a034e;}function isValidIdToken(_0x16760e,_0x5a24a2){try{var _0x2a409c=jwt[_0x8df6('0x30')](_0x16760e,{'complete':!![]});var _0x1b230f=_0x2a409c['payload'];if(_0x1b230f[_0x8df6('0x31')]!==_0x5a24a2['issuer'])return![];if(_0x1b230f[_0x8df6('0x32')]!==_0x5a24a2[_0x8df6('0x33')])return![];if(_0x1b230f[_0x8df6('0x34')]!==_0x5a24a2[_0x8df6('0x34')])return![];if(moment()[_0x8df6('0x35')](moment[_0x8df6('0x36')](_0x1b230f[_0x8df6('0x37')])))return![];return!![];}catch(_0x6f434f){throw _0x6f434f;}}function refreshOauth2MicrosoftAccessToken(_0x225120){return Promise[_0x8df6('0x38')]()['then'](function(){if(_0x225120[_0x8df6('0x39')])return _0x225120;return db[_0x8df6('0x3a')][_0x8df6('0x3b')]({'where':{'id':_0x225120['id']},'raw':!![]});})[_0x8df6('0x3c')](function(_0x38e95f){var _0x13c818={'grant_type':_0x8df6('0x3d'),'refresh_token':_0x38e95f[_0x8df6('0x3e')],'scope':getAccessTokenScope(_0x38e95f),'redirect_uri':_0x38e95f['data4'],'client_id':_0x38e95f[_0x8df6('0x23')],'client_secret':encryptor[_0x8df6('0x3f')](_0x38e95f[_0x8df6('0x39')])};var _0x436590={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x8df6('0x2d')](_0x8df6('0x19'),_0x38e95f[_0x8df6('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x13c818,'json':!![]};return rp(_0x436590);})['then'](function(_0x2ccd9a){_0x225120[_0x8df6('0x40')]=_0x2ccd9a[_0x8df6('0x41')];_0x225120[_0x8df6('0x3e')]=_0x2ccd9a['refresh_token'];return db[_0x8df6('0x3a')][_0x8df6('0x42')]({'data5':_0x225120[_0x8df6('0x40')],'data6':_0x225120[_0x8df6('0x3e')]},{'where':{'id':_0x225120['id']}});})['then'](function(){return _0x225120;})['catch'](function(_0x4c76a1){logger[_0x8df6('0x43')](_0x8df6('0x44'),_0x225120['id'],_0x4c76a1);});}function getOauth2MicrosoftAccessToken(_0x49e9de,_0xed910d){var _0x9561cc={'grant_type':'authorization_code','code':_0x49e9de,'scope':getAccessTokenScope(_0xed910d),'redirect_uri':_0xed910d['data4'],'client_id':_0xed910d['data1'],'client_secret':encryptor[_0x8df6('0x3f')](_0xed910d[_0x8df6('0x39')])};var _0x4d9be9={'method':_0x8df6('0x45'),'uri':MICROSOFT_AUTH_URL['replace'](_0x8df6('0x19'),_0xed910d['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x9561cc,'json':!![]};return rp(_0x4d9be9);}function startRefreshInterval(_0x5b3dde){var _0x5aa48b=schedule[_0x8df6('0x46')];if(_0x5aa48b[_0x5b3dde['id']])clearInterval(_0x5aa48b[_0x5b3dde['id']]);_0x5aa48b[_0x5b3dde['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x8df6('0x47')](this,{'id':_0x5b3dde['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x8df6('0x46')]=_0x5aa48b;}function startAllRefreshIntervals(){return db[_0x8df6('0x3a')][_0x8df6('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x8df6('0x3c')](function(_0x42b9b5){var _0x1a4163=_0x42b9b5['map'](function(_0x498cf6){return refreshOauth2MicrosoftAccessToken(_0x498cf6)[_0x8df6('0x3c')](function(_0x6e3664){startRefreshInterval(_0x6e3664);});});return Promise[_0x8df6('0x49')](_0x1a4163);})[_0x8df6('0x4a')](function(_0x5ac586){var _0x5d1001=_0x5ac586?util['inspect'](_0x5ac586,{'showHidden':![],'depth':null}):'';logger[_0x8df6('0x43')](_0x8df6('0x4b'),_0x5d1001);});}module[_0x8df6('0x4c')]={'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 2351bdc..9016e41 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 _0xb4f4=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x78d8b4,_0x1c9824){var _0x49b14a=function(_0x3f5d35){while(--_0x3f5d35){_0x78d8b4['push'](_0x78d8b4['shift']());}};_0x49b14a(++_0x1c9824);}(_0xb4f4,0xda));var _0x4b4f=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0xb4f4[_0x3740fe];return _0x55492b;};'use strict';var _=require(_0x4b4f('0x0'));var util=require(_0x4b4f('0x1'));var moment=require('moment');var BPromise=require(_0x4b4f('0x2'));var rs=require(_0x4b4f('0x3'));var fs=require('fs');var Redis=require(_0x4b4f('0x4'));var db=require(_0x4b4f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b4f('0x6'))(_0x4b4f('0x7'));var config=require(_0x4b4f('0x8'));var jayson=require(_0x4b4f('0x9'));var client=jayson[_0x4b4f('0xa')][_0x4b4f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x405321,_0x58c1e5,_0x5ba9b0){return new BPromise(function(_0x108b4e,_0x2c647f){return client[_0x4b4f('0xc')](_0x405321,_0x5ba9b0)[_0x4b4f('0xd')](function(_0x25e0c9){logger['info'](_0x4b4f('0xe'),_0x58c1e5,_0x4b4f('0xf'));logger[_0x4b4f('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x58c1e5,_0x4b4f('0xf'),JSON[_0x4b4f('0x11')](_0x25e0c9));if(_0x25e0c9['error']){if(_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x13')]===0x1f4){logger[_0x4b4f('0x12')](_0x4b4f('0xe'),_0x58c1e5,_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x14')]);return _0x2c647f(_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x14')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x58c1e5,_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x14')]);return _0x108b4e(_0x25e0c9['error'][_0x4b4f('0x14')]);}else{logger[_0x4b4f('0x15')](_0x4b4f('0xe'),_0x58c1e5,'request\x20sent');_0x108b4e(_0x25e0c9[_0x4b4f('0x16')][_0x4b4f('0x14')]);}})[_0x4b4f('0x17')](function(_0x57d09a){logger[_0x4b4f('0x12')](_0x4b4f('0xe'),_0x58c1e5,_0x57d09a);_0x2c647f(_0x57d09a);});});}
\ No newline at end of file
+var _0xccef=['stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s'];(function(_0x58ccd6,_0x37a2f4){var _0x368e39=function(_0x56866b){while(--_0x56866b){_0x58ccd6['push'](_0x58ccd6['shift']());}};_0x368e39(++_0x37a2f4);}(_0xccef,0x1d4));var _0xfcce=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xccef[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0xfcce('0x0'));var moment=require('moment');var BPromise=require(_0xfcce('0x1'));var rs=require(_0xfcce('0x2'));var fs=require('fs');var Redis=require(_0xfcce('0x3'));var db=require(_0xfcce('0x4'))['db'];var utils=require(_0xfcce('0x5'));var logger=require(_0xfcce('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfcce('0x7'));var client=jayson['client'][_0xfcce('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd71971,_0x12d091,_0x4598c1){return new BPromise(function(_0x117bc3,_0x380c2c){return client[_0xfcce('0x9')](_0xd71971,_0x4598c1)['then'](function(_0x382ea5){logger[_0xfcce('0xa')](_0xfcce('0xb'),_0x12d091,_0xfcce('0xc'));logger[_0xfcce('0xd')](_0xfcce('0xe'),_0x12d091,_0xfcce('0xc'),JSON[_0xfcce('0xf')](_0x382ea5));if(_0x382ea5[_0xfcce('0x10')]){if(_0x382ea5[_0xfcce('0x10')][_0xfcce('0x11')]===0x1f4){logger['error'](_0xfcce('0xb'),_0x12d091,_0x382ea5[_0xfcce('0x10')][_0xfcce('0x12')]);return _0x380c2c(_0x382ea5[_0xfcce('0x10')]['message']);}logger[_0xfcce('0x10')](_0xfcce('0xb'),_0x12d091,_0x382ea5['error']['message']);return _0x117bc3(_0x382ea5[_0xfcce('0x10')][_0xfcce('0x12')]);}else{logger[_0xfcce('0xa')](_0xfcce('0xb'),_0x12d091,_0xfcce('0xc'));_0x117bc3(_0x382ea5[_0xfcce('0x13')][_0xfcce('0x12')]);}})[_0xfcce('0x14')](function(_0x2d7611){logger[_0xfcce('0x10')](_0xfcce('0xb'),_0x12d091,_0x2d7611);_0x380c2c(_0x2d7611);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 8bd1d85..3ae5329 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 _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x2534cf,_0x545be6){var _0x221461=function(_0x379e83){while(--_0x379e83){_0x2534cf['push'](_0x2534cf['shift']());}};_0x221461(++_0x545be6);}(_0x1261,0x144));var _0x1126=function(_0x2effa6,_0x1440d7){_0x2effa6=_0x2effa6-0x0;var _0x226598=_0x1261[_0x2effa6];return _0x226598;};'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
+var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x3e91a9,_0x53c466){var _0x25c9ad=function(_0x69ee2d){while(--_0x69ee2d){_0x3e91a9['push'](_0x3e91a9['shift']());}};_0x25c9ad(++_0x53c466);}(_0x1261,0x144));var _0x1126=function(_0x3af6d3,_0xd6ff2e){_0x3af6d3=_0x3af6d3-0x0;var _0xf0c5a8=_0x1261[_0x3af6d3];return _0xf0c5a8;};'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 e111d6a..72df926 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 _0x7a30=['sequelize','exports','STRING','name'];(function(_0xb03c1c,_0x2f98ed){var _0x507e93=function(_0xbb4f3f){while(--_0xbb4f3f){_0xb03c1c['push'](_0xb03c1c['shift']());}};_0x507e93(++_0x2f98ed);}(_0x7a30,0x8c));var _0x07a3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7a30[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x07a3('0x0'));module[_0x07a3('0x1')]={'name':{'type':Sequelize[_0x07a3('0x2')],'unique':_0x07a3('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x07a3('0x2')]},'companyId':{'type':Sequelize[_0x07a3('0x2')]},'website':{'type':Sequelize[_0x07a3('0x2')]},'phone':{'type':Sequelize[_0x07a3('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x07a3('0x2')]},'street':{'type':Sequelize[_0x07a3('0x2')]},'postalCode':{'type':Sequelize[_0x07a3('0x2')]},'city':{'type':Sequelize[_0x07a3('0x2')]},'country':{'type':Sequelize[_0x07a3('0x2')]},'email':{'type':Sequelize[_0x07a3('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x07a3('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x07a3('0x2')]},'sCity':{'type':Sequelize[_0x07a3('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x07a3('0x2')]}};
\ No newline at end of file
+var _0x672d=['STRING','sequelize','exports','name'];(function(_0x3bf9fe,_0x5ed880){var _0x39bfc4=function(_0xf6515f){while(--_0xf6515f){_0x3bf9fe['push'](_0x3bf9fe['shift']());}};_0x39bfc4(++_0x5ed880);}(_0x672d,0x121));var _0xd672=function(_0x4c69f4,_0x684e63){_0x4c69f4=_0x4c69f4-0x0;var _0x3636c9=_0x672d[_0x4c69f4];return _0x3636c9;};'use strict';var Sequelize=require(_0xd672('0x0'));module[_0xd672('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd672('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd672('0x3')]},'companyId':{'type':Sequelize[_0xd672('0x3')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xd672('0x3')]},'fax':{'type':Sequelize[_0xd672('0x3')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xd672('0x3')]},'postalCode':{'type':Sequelize[_0xd672('0x3')]},'city':{'type':Sequelize[_0xd672('0x3')]},'country':{'type':Sequelize[_0xd672('0x3')]},'email':{'type':Sequelize[_0xd672('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xd672('0x3')]},'sPostalCode':{'type':Sequelize[_0xd672('0x3')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xd672('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 2b5b190..ee309df 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 _0xa79c=['Companies','destroy','error','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','addContacts','CmContact','ids','omit','getContacts','findOne','rawAttributes','length','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','then','get'];(function(_0x236487,_0x39046f){var _0x1c64cc=function(_0x5e1bfb){while(--_0x5e1bfb){_0x236487['push'](_0x236487['shift']());}};_0x1c64cc(++_0x39046f);}(_0xa79c,0xd8));var _0xca79=function(_0x332a8a,_0x47c675){_0x332a8a=_0x332a8a-0x0;var _0x5c287a=_0xa79c[_0x332a8a];return _0x5c287a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca79('0x0'));var zipdir=require(_0xca79('0x1'));var jsonpatch=require(_0xca79('0x2'));var rp=require(_0xca79('0x3'));var moment=require(_0xca79('0x4'));var BPromise=require(_0xca79('0x5'));var Mustache=require(_0xca79('0x6'));var util=require('util');var path=require(_0xca79('0x7'));var sox=require('sox');var csv=require(_0xca79('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca79('0x9'));var _=require(_0xca79('0xa'));var squel=require(_0xca79('0xb'));var crypto=require(_0xca79('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xca79('0x8'));var querystring=require(_0xca79('0xd'));var Papa=require(_0xca79('0xe'));var Redis=require('ioredis');var authService=require(_0xca79('0xf'));var qs=require(_0xca79('0x10'));var as=require(_0xca79('0x11'));var hardwareService=require(_0xca79('0x12'));var logger=require(_0xca79('0x13'))(_0xca79('0x14'));var utils=require(_0xca79('0x15'));var config=require(_0xca79('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xca79('0x17'))['db'];function respondWithStatusCode(_0x568a1f,_0x25dd8e){_0x25dd8e=_0x25dd8e||0xcc;return function(_0x4e5913){if(_0x4e5913){return _0x568a1f[_0xca79('0x18')](_0x25dd8e);}return _0x568a1f[_0xca79('0x19')](_0x25dd8e)[_0xca79('0x1a')]();};}function respondWithResult(_0x35986e,_0xc61781){_0xc61781=_0xc61781||0xc8;return function(_0x122cfe){if(_0x122cfe){return _0x35986e['status'](_0xc61781)[_0xca79('0x1b')](_0x122cfe);}};}function respondWithFilteredResult(_0x548739,_0x19cb88){return function(_0x1db4ca){if(_0x1db4ca){var _0x2bea05=typeof _0x19cb88[_0xca79('0x1c')]==='undefined'&&typeof _0x19cb88[_0xca79('0x1d')]===_0xca79('0x1e');var _0x1642a5=_0x1db4ca['count'];var _0x90dade=_0x2bea05?0x0:_0x19cb88[_0xca79('0x1c')];var _0x292f67=_0x2bea05?_0x1db4ca[_0xca79('0x1f')]:_0x19cb88[_0xca79('0x1c')]+_0x19cb88[_0xca79('0x1d')];var _0x4b199d;if(_0x292f67>=_0x1642a5){_0x292f67=_0x1642a5;_0x4b199d=0xc8;}else{_0x4b199d=0xce;}_0x548739[_0xca79('0x19')](_0x4b199d);return _0x548739[_0xca79('0x20')]('Content-Range',_0x90dade+'-'+_0x292f67+'/'+_0x1642a5)[_0xca79('0x1b')](_0x1db4ca);}return null;};}function patchUpdates(_0x3b4597){return function(_0x43f928){try{jsonpatch[_0xca79('0x21')](_0x43f928,_0x3b4597,!![]);}catch(_0x3cf25b){return BPromise['reject'](_0x3cf25b);}return _0x43f928['save']();};}function saveUpdates(_0x59c6d2,_0x4338d1){return function(_0x4e0c39){if(_0x4e0c39){return _0x4e0c39['update'](_0x59c6d2)['then'](function(_0x3c5658){return _0x3c5658;});}return null;};}function removeEntity(_0x2c6ca4,_0x8e25e3){return function(_0x13aad6){if(_0x13aad6){return _0x13aad6['destroy']()[_0xca79('0x22')](function(){var _0x5d2233=_0x13aad6[_0xca79('0x23')]({'plain':!![]});var _0x2bf4e0=_0xca79('0x24');return db['UserProfileResource'][_0xca79('0x25')]({'where':{'type':_0x2bf4e0,'resourceId':_0x5d2233['id']}})[_0xca79('0x22')](function(){return _0x13aad6;});})[_0xca79('0x22')](function(){_0x2c6ca4[_0xca79('0x19')](0xcc)[_0xca79('0x1a')]();});}};}function handleEntityNotFound(_0x5d304b,_0x4cd7ce){return function(_0x1856f1){if(!_0x1856f1){_0x5d304b['sendStatus'](0x194);}return _0x1856f1;};}function handleError(_0x3600fd,_0x2f2811){_0x2f2811=_0x2f2811||0x1f4;return function(_0x3919d1){logger[_0xca79('0x26')](_0x3919d1['stack']);if(_0x3919d1[_0xca79('0x27')]){delete _0x3919d1[_0xca79('0x27')];}_0x3600fd[_0xca79('0x19')](_0x2f2811)[_0xca79('0x28')](_0x3919d1);};}exports[_0xca79('0x29')]=function(_0x3b834f,_0x1e48be){var _0x1584bb={},_0x3b31bc={},_0x2d355f={'count':0x0,'rows':[]};return db[_0xca79('0x2a')][_0xca79('0x2b')]()[_0xca79('0x22')](function(_0x389670){_0x3b31bc[_0xca79('0x2c')]=_[_0xca79('0x2d')](_0x389670);_0x3b31bc[_0xca79('0x2e')]=_[_0xca79('0x2d')](_0x3b834f[_0xca79('0x2e')]);_0x3b31bc[_0xca79('0x2f')]=_[_0xca79('0x30')](_0x3b31bc[_0xca79('0x2c')],_0x3b31bc['query']);_0x1584bb[_0xca79('0x31')]=_[_0xca79('0x30')](_0x3b31bc[_0xca79('0x2c')],qs[_0xca79('0x32')](_0x3b834f[_0xca79('0x2e')][_0xca79('0x32')]));_0x1584bb[_0xca79('0x31')]=_0x1584bb[_0xca79('0x31')]['length']?_0x1584bb[_0xca79('0x31')]:_0x3b31bc[_0xca79('0x2c')];if(!_0x3b834f[_0xca79('0x2e')][_0xca79('0x33')](_0xca79('0x34'))){_0x1584bb[_0xca79('0x1d')]=qs[_0xca79('0x1d')](_0x3b834f[_0xca79('0x2e')][_0xca79('0x1d')]);_0x1584bb[_0xca79('0x1c')]=qs['offset'](_0x3b834f[_0xca79('0x2e')][_0xca79('0x1c')]);}_0x1584bb[_0xca79('0x35')]=qs[_0xca79('0x36')](_0x3b834f[_0xca79('0x2e')][_0xca79('0x36')]);_0x1584bb[_0xca79('0x37')]=qs[_0xca79('0x2f')](_[_0xca79('0x38')](_0x3b834f[_0xca79('0x2e')],_0x3b31bc['filters']),_0x389670);if(_0x3b834f[_0xca79('0x2e')][_0xca79('0x39')]){_0x1584bb[_0xca79('0x37')]=_[_0xca79('0x3a')](_0x1584bb[_0xca79('0x37')],{'$or':_[_0xca79('0x3b')](_0x1584bb[_0xca79('0x31')],function(_0x4a5655){var _0x53f883={};_0x53f883[_0x4a5655]={'$like':'%'+_0x3b834f['query']['filter']+'%'};return _0x53f883;})});}_0x1584bb=_['merge']({},_0x1584bb,_0x3b834f[_0xca79('0x3c')]);var _0x332e87={'where':_0x1584bb[_0xca79('0x37')]};return db[_0xca79('0x2a')][_0xca79('0x1f')](_0x332e87)[_0xca79('0x22')](function(_0x425327){_0x2d355f['count']=_0x425327;if(_0x3b834f[_0xca79('0x2e')][_0xca79('0x3d')]){_0x1584bb[_0xca79('0x3e')]=[{'all':!![]}];}return db[_0xca79('0x2a')]['findAll'](_0x1584bb);})[_0xca79('0x22')](function(_0x16fb5f){_0x2d355f[_0xca79('0x3f')]=_0x16fb5f;return _0x2d355f;})['then'](respondWithFilteredResult(_0x1e48be,_0x1584bb))['catch'](handleError(_0x1e48be,null));})['catch'](handleError(_0x1e48be,null));};exports[_0xca79('0x40')]=function(_0x69d714,_0x186d66){var _0x1e908d={'raw':![],'where':{'id':_0x69d714[_0xca79('0x41')]['id']}},_0x527f1d={};_0x527f1d[_0xca79('0x2c')]=_[_0xca79('0x2d')](db[_0xca79('0x2a')]['rawAttributes']);_0x527f1d[_0xca79('0x2e')]=_[_0xca79('0x2d')](_0x69d714[_0xca79('0x2e')]);_0x527f1d['filters']=_['intersection'](_0x527f1d[_0xca79('0x2c')],_0x527f1d['query']);_0x1e908d[_0xca79('0x31')]=_['intersection'](_0x527f1d[_0xca79('0x2c')],qs[_0xca79('0x32')](_0x69d714['query'][_0xca79('0x32')]));_0x1e908d[_0xca79('0x31')]=_0x1e908d[_0xca79('0x31')]['length']?_0x1e908d[_0xca79('0x31')]:_0x527f1d[_0xca79('0x2c')];if(_0x69d714[_0xca79('0x2e')][_0xca79('0x3d')]){_0x1e908d[_0xca79('0x3e')]=[{'all':!![]}];}_0x1e908d=_['merge']({},_0x1e908d,_0x69d714[_0xca79('0x3c')]);return db[_0xca79('0x2a')][_0xca79('0x42')](_0x1e908d)['then'](handleEntityNotFound(_0x186d66,null))[_0xca79('0x22')](respondWithResult(_0x186d66,null))[_0xca79('0x43')](handleError(_0x186d66,null));};exports[_0xca79('0x44')]=function(_0x19719e,_0x24449d){return db[_0xca79('0x2a')][_0xca79('0x44')](_0x19719e[_0xca79('0x45')],{})['then'](function(_0x5bd3f5){var _0x4c6d23=_0x19719e[_0xca79('0x46')]['get']({'plain':!![]});if(!_0x4c6d23)throw new Error(_0xca79('0x47'));if(_0x4c6d23[_0xca79('0x48')]===_0xca79('0x46')){var _0x38d884=_0x5bd3f5['get']({'plain':!![]});var _0x41ffc9='Companies';return db[_0xca79('0x49')][_0xca79('0x42')]({'where':{'name':_0x41ffc9,'userProfileId':_0x4c6d23[_0xca79('0x4a')]},'raw':!![]})['then'](function(_0x58799){if(_0x58799&&_0x58799[_0xca79('0x4b')]===0x0){return db['UserProfileResource'][_0xca79('0x44')]({'name':_0x38d884[_0xca79('0x27')],'resourceId':_0x38d884['id'],'type':_0x58799['name'],'sectionId':_0x58799['id']},{})['then'](function(){return _0x5bd3f5;});}else{return _0x5bd3f5;}})[_0xca79('0x43')](function(_0x205b10){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x205b10);throw _0x205b10;});}return _0x5bd3f5;})[_0xca79('0x22')](respondWithResult(_0x24449d,0xc9))['catch'](handleError(_0x24449d,null));};exports['update']=function(_0x3cdd36,_0x1dfa18){if(_0x3cdd36['body']['id']){delete _0x3cdd36[_0xca79('0x45')]['id'];}return db[_0xca79('0x2a')]['find']({'where':{'id':_0x3cdd36[_0xca79('0x41')]['id']}})[_0xca79('0x22')](handleEntityNotFound(_0x1dfa18,null))[_0xca79('0x22')](saveUpdates(_0x3cdd36[_0xca79('0x45')],null))[_0xca79('0x22')](respondWithResult(_0x1dfa18,null))['catch'](handleError(_0x1dfa18,null));};exports[_0xca79('0x25')]=function(_0x48a741,_0x86358b){return db['CmCompany']['find']({'where':{'id':_0x48a741[_0xca79('0x41')]['id']}})['then'](handleEntityNotFound(_0x86358b,null))[_0xca79('0x22')](removeEntity(_0x86358b,null))[_0xca79('0x43')](handleError(_0x86358b,null));};exports[_0xca79('0x2b')]=function(_0x2f8bbb,_0x4e3cf0){return db[_0xca79('0x2a')][_0xca79('0x2b')]()['then'](respondWithResult(_0x4e3cf0,null))[_0xca79('0x43')](handleError(_0x4e3cf0,null));};exports[_0xca79('0x4c')]=function(_0x5bda30,_0x412866,_0xb2142){return db[_0xca79('0x4d')][_0xca79('0x42')]({'where':{'id':_0x5bda30[_0xca79('0x41')]['id']}})[_0xca79('0x22')](handleEntityNotFound(_0x412866,null))[_0xca79('0x22')](function(_0x3eecce){if(_0x3eecce){return _0x3eecce['addContacts'](_0x5bda30[_0xca79('0x45')][_0xca79('0x4e')],_[_0xca79('0x4f')](_0x5bda30[_0xca79('0x45')],[_0xca79('0x4e'),'id'])||{});}})[_0xca79('0x22')](respondWithResult(_0x412866,null))[_0xca79('0x43')](handleError(_0x412866,null));};exports[_0xca79('0x50')]=function(_0x3b6f67,_0x2381b6,_0xf9a53){var _0x5de678={};var _0x4d1178={};var _0x135ac3;var _0x1a0e5d;return db[_0xca79('0x2a')][_0xca79('0x51')]({'where':{'id':_0x3b6f67[_0xca79('0x41')]['id']}})['then'](handleEntityNotFound(_0x2381b6,null))['then'](function(_0x6ddce6){if(_0x6ddce6){_0x135ac3=_0x6ddce6;_0x4d1178[_0xca79('0x2c')]=_[_0xca79('0x2d')](db['CmContact'][_0xca79('0x52')]);_0x4d1178[_0xca79('0x2e')]=_[_0xca79('0x2d')](_0x3b6f67['query']);_0x4d1178[_0xca79('0x2f')]=_['intersection'](_0x4d1178[_0xca79('0x2c')],_0x4d1178['query']);_0x5de678[_0xca79('0x31')]=_[_0xca79('0x30')](_0x4d1178[_0xca79('0x2c')],qs[_0xca79('0x32')](_0x3b6f67[_0xca79('0x2e')][_0xca79('0x32')]));_0x5de678[_0xca79('0x31')]=_0x5de678[_0xca79('0x31')]['length']?_0x5de678[_0xca79('0x31')]:_0x4d1178[_0xca79('0x2c')];_0x5de678[_0xca79('0x35')]=qs[_0xca79('0x36')](_0x3b6f67[_0xca79('0x2e')][_0xca79('0x36')]);_0x5de678[_0xca79('0x37')]=qs[_0xca79('0x2f')](_[_0xca79('0x38')](_0x3b6f67[_0xca79('0x2e')],_0x4d1178[_0xca79('0x2f')]));if(_0x3b6f67[_0xca79('0x2e')]['filter']){_0x5de678[_0xca79('0x37')]=_[_0xca79('0x3a')](_0x5de678[_0xca79('0x37')],{'$or':_[_0xca79('0x3b')](_0x5de678[_0xca79('0x31')],function(_0x581864){var _0x1189db={};_0x1189db[_0x581864]={'$like':'%'+_0x3b6f67[_0xca79('0x2e')]['filter']+'%'};return _0x1189db;})});}_0x5de678=_['merge']({},_0x5de678,_0x3b6f67['options']);return _0x135ac3['getContacts'](_0x5de678);}})[_0xca79('0x22')](function(_0x401ea0){if(_0x401ea0){_0x1a0e5d=_0x401ea0[_0xca79('0x53')];if(!_0x3b6f67['query']['hasOwnProperty'](_0xca79('0x34'))){_0x5de678[_0xca79('0x1d')]=qs['limit'](_0x3b6f67[_0xca79('0x2e')][_0xca79('0x1d')]);_0x5de678['offset']=qs[_0xca79('0x1c')](_0x3b6f67['query'][_0xca79('0x1c')]);}return _0x135ac3[_0xca79('0x50')](_0x5de678);}})[_0xca79('0x22')](function(_0x1d7a98){if(_0x1d7a98){return _0x1d7a98?{'count':_0x1a0e5d,'rows':_0x1d7a98}:null;}})['then'](respondWithResult(_0x2381b6,null))[_0xca79('0x43')](handleError(_0x2381b6,null));};
\ No newline at end of file
+var _0x6802=['name','send','index','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','include','findAll','rows','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addContacts','CmContact','omit','getContacts','findOne','rawAttributes','map','nolimit','eml-format','rimraf','zip-dir','request-promise','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','get','UserProfileResource','end','error','stack'];(function(_0x25d875,_0x45de83){var _0x4010b1=function(_0x4b8d09){while(--_0x4b8d09){_0x25d875['push'](_0x25d875['shift']());}};_0x4010b1(++_0x45de83);}(_0x6802,0x17a));var _0x2680=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x6802[_0x422905];return _0x33dc6c;};'use strict';var emlformat=require(_0x2680('0x0'));var rimraf=require(_0x2680('0x1'));var zipdir=require(_0x2680('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2680('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2680('0x4'));var util=require('util');var path=require('path');var sox=require(_0x2680('0x5'));var csv=require('to-csv');var ejs=require(_0x2680('0x6'));var fs=require('fs');var fs_extra=require(_0x2680('0x7'));var _=require('lodash');var squel=require(_0x2680('0x8'));var crypto=require(_0x2680('0x9'));var jsforce=require(_0x2680('0xa'));var deskjs=require(_0x2680('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2680('0xc'));var Papa=require(_0x2680('0xd'));var Redis=require(_0x2680('0xe'));var authService=require(_0x2680('0xf'));var qs=require(_0x2680('0x10'));var as=require(_0x2680('0x11'));var hardwareService=require(_0x2680('0x12'));var logger=require(_0x2680('0x13'))(_0x2680('0x14'));var utils=require(_0x2680('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2680('0x16'))['db'];function respondWithStatusCode(_0x524ba9,_0x4694b5){_0x4694b5=_0x4694b5||0xcc;return function(_0x574aae){if(_0x574aae){return _0x524ba9[_0x2680('0x17')](_0x4694b5);}return _0x524ba9[_0x2680('0x18')](_0x4694b5)['end']();};}function respondWithResult(_0xc94b63,_0x1b0a04){_0x1b0a04=_0x1b0a04||0xc8;return function(_0x226739){if(_0x226739){return _0xc94b63[_0x2680('0x18')](_0x1b0a04)['json'](_0x226739);}};}function respondWithFilteredResult(_0x589e59,_0x328f30){return function(_0x1f4f82){if(_0x1f4f82){var _0x2e11e1=typeof _0x328f30['offset']===_0x2680('0x19')&&typeof _0x328f30[_0x2680('0x1a')]===_0x2680('0x19');var _0x1116d8=_0x1f4f82[_0x2680('0x1b')];var _0x3804a8=_0x2e11e1?0x0:_0x328f30[_0x2680('0x1c')];var _0x384250=_0x2e11e1?_0x1f4f82[_0x2680('0x1b')]:_0x328f30[_0x2680('0x1c')]+_0x328f30['limit'];var _0x3db20c;if(_0x384250>=_0x1116d8){_0x384250=_0x1116d8;_0x3db20c=0xc8;}else{_0x3db20c=0xce;}_0x589e59[_0x2680('0x18')](_0x3db20c);return _0x589e59[_0x2680('0x1d')](_0x2680('0x1e'),_0x3804a8+'-'+_0x384250+'/'+_0x1116d8)[_0x2680('0x1f')](_0x1f4f82);}return null;};}function patchUpdates(_0x4302dd){return function(_0x6e714d){try{jsonpatch[_0x2680('0x20')](_0x6e714d,_0x4302dd,!![]);}catch(_0x35be6e){return BPromise[_0x2680('0x21')](_0x35be6e);}return _0x6e714d[_0x2680('0x22')]();};}function saveUpdates(_0x3015af,_0x191770){return function(_0x281f9a){if(_0x281f9a){return _0x281f9a['update'](_0x3015af)[_0x2680('0x23')](function(_0x229a45){return _0x229a45;});}return null;};}function removeEntity(_0x2ddc6b,_0x437857){return function(_0x3bd787){if(_0x3bd787){return _0x3bd787[_0x2680('0x24')]()[_0x2680('0x23')](function(){var _0x98e2c2=_0x3bd787[_0x2680('0x25')]({'plain':!![]});var _0x2f1ede='Companies';return db[_0x2680('0x26')][_0x2680('0x24')]({'where':{'type':_0x2f1ede,'resourceId':_0x98e2c2['id']}})[_0x2680('0x23')](function(){return _0x3bd787;});})[_0x2680('0x23')](function(){_0x2ddc6b[_0x2680('0x18')](0xcc)[_0x2680('0x27')]();});}};}function handleEntityNotFound(_0xea567c,_0x381f2c){return function(_0x18f523){if(!_0x18f523){_0xea567c[_0x2680('0x17')](0x194);}return _0x18f523;};}function handleError(_0x5e2b89,_0x3bdf36){_0x3bdf36=_0x3bdf36||0x1f4;return function(_0x12330f){logger[_0x2680('0x28')](_0x12330f[_0x2680('0x29')]);if(_0x12330f['name']){delete _0x12330f[_0x2680('0x2a')];}_0x5e2b89['status'](_0x3bdf36)[_0x2680('0x2b')](_0x12330f);};}exports[_0x2680('0x2c')]=function(_0x5d7f81,_0x2e61ea){var _0x560f19={},_0x1d9f7e={},_0x3add76={'count':0x0,'rows':[]};return db[_0x2680('0x2d')]['describe']()['then'](function(_0x10d593){_0x1d9f7e[_0x2680('0x2e')]=_[_0x2680('0x2f')](_0x10d593);_0x1d9f7e[_0x2680('0x30')]=_[_0x2680('0x2f')](_0x5d7f81['query']);_0x1d9f7e[_0x2680('0x31')]=_[_0x2680('0x32')](_0x1d9f7e['model'],_0x1d9f7e[_0x2680('0x30')]);_0x560f19[_0x2680('0x33')]=_[_0x2680('0x32')](_0x1d9f7e[_0x2680('0x2e')],qs[_0x2680('0x34')](_0x5d7f81[_0x2680('0x30')]['fields']));_0x560f19[_0x2680('0x33')]=_0x560f19['attributes'][_0x2680('0x35')]?_0x560f19['attributes']:_0x1d9f7e[_0x2680('0x2e')];if(!_0x5d7f81[_0x2680('0x30')][_0x2680('0x36')]('nolimit')){_0x560f19[_0x2680('0x1a')]=qs[_0x2680('0x1a')](_0x5d7f81[_0x2680('0x30')][_0x2680('0x1a')]);_0x560f19[_0x2680('0x1c')]=qs[_0x2680('0x1c')](_0x5d7f81[_0x2680('0x30')][_0x2680('0x1c')]);}_0x560f19[_0x2680('0x37')]=qs[_0x2680('0x38')](_0x5d7f81[_0x2680('0x30')][_0x2680('0x38')]);_0x560f19[_0x2680('0x39')]=qs['filters'](_['pick'](_0x5d7f81[_0x2680('0x30')],_0x1d9f7e[_0x2680('0x31')]),_0x10d593);if(_0x5d7f81[_0x2680('0x30')][_0x2680('0x3a')]){_0x560f19[_0x2680('0x39')]=_[_0x2680('0x3b')](_0x560f19[_0x2680('0x39')],{'$or':_['map'](_0x560f19[_0x2680('0x33')],function(_0x3ac48f){var _0x11390b={};_0x11390b[_0x3ac48f]={'$like':'%'+_0x5d7f81[_0x2680('0x30')][_0x2680('0x3a')]+'%'};return _0x11390b;})});}_0x560f19=_[_0x2680('0x3b')]({},_0x560f19,_0x5d7f81[_0x2680('0x3c')]);var _0x397f40={'where':_0x560f19[_0x2680('0x39')]};return db[_0x2680('0x2d')][_0x2680('0x1b')](_0x397f40)[_0x2680('0x23')](function(_0x2189ac){_0x3add76['count']=_0x2189ac;if(_0x5d7f81[_0x2680('0x30')]['includeAll']){_0x560f19[_0x2680('0x3d')]=[{'all':!![]}];}return db[_0x2680('0x2d')][_0x2680('0x3e')](_0x560f19);})['then'](function(_0x4c4d00){_0x3add76[_0x2680('0x3f')]=_0x4c4d00;return _0x3add76;})[_0x2680('0x23')](respondWithFilteredResult(_0x2e61ea,_0x560f19))['catch'](handleError(_0x2e61ea,null));})['catch'](handleError(_0x2e61ea,null));};exports['show']=function(_0x3761a2,_0x24659a){var _0x5060aa={'raw':![],'where':{'id':_0x3761a2['params']['id']}},_0x46003d={};_0x46003d[_0x2680('0x2e')]=_[_0x2680('0x2f')](db[_0x2680('0x2d')]['rawAttributes']);_0x46003d[_0x2680('0x30')]=_['keys'](_0x3761a2['query']);_0x46003d[_0x2680('0x31')]=_['intersection'](_0x46003d['model'],_0x46003d[_0x2680('0x30')]);_0x5060aa[_0x2680('0x33')]=_[_0x2680('0x32')](_0x46003d[_0x2680('0x2e')],qs[_0x2680('0x34')](_0x3761a2[_0x2680('0x30')][_0x2680('0x34')]));_0x5060aa[_0x2680('0x33')]=_0x5060aa[_0x2680('0x33')][_0x2680('0x35')]?_0x5060aa[_0x2680('0x33')]:_0x46003d[_0x2680('0x2e')];if(_0x3761a2[_0x2680('0x30')][_0x2680('0x40')]){_0x5060aa[_0x2680('0x3d')]=[{'all':!![]}];}_0x5060aa=_['merge']({},_0x5060aa,_0x3761a2['options']);return db[_0x2680('0x2d')][_0x2680('0x41')](_0x5060aa)[_0x2680('0x23')](handleEntityNotFound(_0x24659a,null))['then'](respondWithResult(_0x24659a,null))['catch'](handleError(_0x24659a,null));};exports['create']=function(_0x36a202,_0x2e6ab0){return db['CmCompany'][_0x2680('0x42')](_0x36a202[_0x2680('0x43')],{})[_0x2680('0x23')](function(_0x98762e){var _0x3bf8f2=_0x36a202['user'][_0x2680('0x25')]({'plain':!![]});if(!_0x3bf8f2)throw new Error(_0x2680('0x44'));if(_0x3bf8f2[_0x2680('0x45')]==='user'){var _0x4d3e6d=_0x98762e[_0x2680('0x25')]({'plain':!![]});var _0x4131a1=_0x2680('0x46');return db['UserProfileSection'][_0x2680('0x41')]({'where':{'name':_0x4131a1,'userProfileId':_0x3bf8f2[_0x2680('0x47')]},'raw':!![]})[_0x2680('0x23')](function(_0xb31383){if(_0xb31383&&_0xb31383['autoAssociation']===0x0){return db[_0x2680('0x26')]['create']({'name':_0x4d3e6d[_0x2680('0x2a')],'resourceId':_0x4d3e6d['id'],'type':_0xb31383['name'],'sectionId':_0xb31383['id']},{})[_0x2680('0x23')](function(){return _0x98762e;});}else{return _0x98762e;}})[_0x2680('0x48')](function(_0x292285){logger[_0x2680('0x28')](_0x2680('0x49'),_0x292285);throw _0x292285;});}return _0x98762e;})['then'](respondWithResult(_0x2e6ab0,0xc9))[_0x2680('0x48')](handleError(_0x2e6ab0,null));};exports['update']=function(_0x11c373,_0x22075d){if(_0x11c373['body']['id']){delete _0x11c373[_0x2680('0x43')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x11c373[_0x2680('0x4a')]['id']}})[_0x2680('0x23')](handleEntityNotFound(_0x22075d,null))['then'](saveUpdates(_0x11c373[_0x2680('0x43')],null))[_0x2680('0x23')](respondWithResult(_0x22075d,null))[_0x2680('0x48')](handleError(_0x22075d,null));};exports['destroy']=function(_0x3ffb97,_0x34c6df){return db[_0x2680('0x2d')]['find']({'where':{'id':_0x3ffb97[_0x2680('0x4a')]['id']}})[_0x2680('0x23')](handleEntityNotFound(_0x34c6df,null))[_0x2680('0x23')](removeEntity(_0x34c6df,null))['catch'](handleError(_0x34c6df,null));};exports['describe']=function(_0x4c0215,_0x15a27d){return db[_0x2680('0x2d')][_0x2680('0x4b')]()[_0x2680('0x23')](respondWithResult(_0x15a27d,null))[_0x2680('0x48')](handleError(_0x15a27d,null));};exports[_0x2680('0x4c')]=function(_0x3f5312,_0xe1aa6,_0x2f549f){return db[_0x2680('0x4d')][_0x2680('0x41')]({'where':{'id':_0x3f5312[_0x2680('0x4a')]['id']}})[_0x2680('0x23')](handleEntityNotFound(_0xe1aa6,null))['then'](function(_0x5d4586){if(_0x5d4586){return _0x5d4586[_0x2680('0x4c')](_0x3f5312['body']['ids'],_[_0x2680('0x4e')](_0x3f5312['body'],['ids','id'])||{});}})['then'](respondWithResult(_0xe1aa6,null))[_0x2680('0x48')](handleError(_0xe1aa6,null));};exports[_0x2680('0x4f')]=function(_0x1d20b9,_0x3dcf29,_0x40570f){var _0x5cfd7e={};var _0x426a28={};var _0x23013a;var _0x35b594;return db[_0x2680('0x2d')][_0x2680('0x50')]({'where':{'id':_0x1d20b9['params']['id']}})[_0x2680('0x23')](handleEntityNotFound(_0x3dcf29,null))[_0x2680('0x23')](function(_0x59de7d){if(_0x59de7d){_0x23013a=_0x59de7d;_0x426a28[_0x2680('0x2e')]=_[_0x2680('0x2f')](db[_0x2680('0x4d')][_0x2680('0x51')]);_0x426a28[_0x2680('0x30')]=_[_0x2680('0x2f')](_0x1d20b9[_0x2680('0x30')]);_0x426a28[_0x2680('0x31')]=_[_0x2680('0x32')](_0x426a28[_0x2680('0x2e')],_0x426a28[_0x2680('0x30')]);_0x5cfd7e[_0x2680('0x33')]=_[_0x2680('0x32')](_0x426a28[_0x2680('0x2e')],qs[_0x2680('0x34')](_0x1d20b9[_0x2680('0x30')][_0x2680('0x34')]));_0x5cfd7e[_0x2680('0x33')]=_0x5cfd7e[_0x2680('0x33')][_0x2680('0x35')]?_0x5cfd7e['attributes']:_0x426a28[_0x2680('0x2e')];_0x5cfd7e[_0x2680('0x37')]=qs[_0x2680('0x38')](_0x1d20b9[_0x2680('0x30')]['sort']);_0x5cfd7e[_0x2680('0x39')]=qs[_0x2680('0x31')](_['pick'](_0x1d20b9[_0x2680('0x30')],_0x426a28[_0x2680('0x31')]));if(_0x1d20b9[_0x2680('0x30')]['filter']){_0x5cfd7e['where']=_[_0x2680('0x3b')](_0x5cfd7e['where'],{'$or':_[_0x2680('0x52')](_0x5cfd7e[_0x2680('0x33')],function(_0x3c8fa1){var _0x3ccb64={};_0x3ccb64[_0x3c8fa1]={'$like':'%'+_0x1d20b9[_0x2680('0x30')][_0x2680('0x3a')]+'%'};return _0x3ccb64;})});}_0x5cfd7e=_['merge']({},_0x5cfd7e,_0x1d20b9[_0x2680('0x3c')]);return _0x23013a['getContacts'](_0x5cfd7e);}})[_0x2680('0x23')](function(_0x3f079a){if(_0x3f079a){_0x35b594=_0x3f079a['length'];if(!_0x1d20b9[_0x2680('0x30')][_0x2680('0x36')](_0x2680('0x53'))){_0x5cfd7e[_0x2680('0x1a')]=qs[_0x2680('0x1a')](_0x1d20b9['query']['limit']);_0x5cfd7e[_0x2680('0x1c')]=qs[_0x2680('0x1c')](_0x1d20b9[_0x2680('0x30')][_0x2680('0x1c')]);}return _0x23013a[_0x2680('0x4f')](_0x5cfd7e);}})[_0x2680('0x23')](function(_0x5c2e2c){if(_0x5c2e2c){return _0x5c2e2c?{'count':_0x35b594,'rows':_0x5c2e2c}:null;}})[_0x2680('0x23')](respondWithResult(_0x3dcf29,null))[_0x2680('0x48')](handleError(_0x3dcf29,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index c839952..3d45111 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 _0xea98=['util','api','moment','path','../../config/environment','define','CmCompany','cm_companies'];(function(_0xf9fcc9,_0x46350e){var _0x396114=function(_0x3418fe){while(--_0x3418fe){_0xf9fcc9['push'](_0xf9fcc9['shift']());}};_0x396114(++_0x46350e);}(_0xea98,0x180));var _0x8ea9=function(_0x25e4c7,_0x3986c5){_0x25e4c7=_0x25e4c7-0x0;var _0x333f1e=_0xea98[_0x25e4c7];return _0x333f1e;};'use strict';var _=require('lodash');var util=require(_0x8ea9('0x0'));var logger=require('../../config/logger')(_0x8ea9('0x1'));var moment=require(_0x8ea9('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ea9('0x3'));var rimraf=require('rimraf');var config=require(_0x8ea9('0x4'));var attributes=require('./cmCompany.attributes');module['exports']=function(_0x422cf5,_0x1ce77e){return _0x422cf5[_0x8ea9('0x5')](_0x8ea9('0x6'),attributes,{'tableName':_0x8ea9('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfb7d=['cm_companies','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany'];(function(_0x412faa,_0x6d5ea8){var _0x204402=function(_0x1ddbe0){while(--_0x1ddbe0){_0x412faa['push'](_0x412faa['shift']());}};_0x204402(++_0x6d5ea8);}(_0xfb7d,0xc5));var _0xdfb7=function(_0x886664,_0x4d7b96){_0x886664=_0x886664-0x0;var _0x273401=_0xfb7d[_0x886664];return _0x273401;};'use strict';var _=require(_0xdfb7('0x0'));var util=require(_0xdfb7('0x1'));var logger=require(_0xdfb7('0x2'))('api');var moment=require(_0xdfb7('0x3'));var BPromise=require(_0xdfb7('0x4'));var rp=require(_0xdfb7('0x5'));var fs=require('fs');var path=require(_0xdfb7('0x6'));var rimraf=require(_0xdfb7('0x7'));var config=require(_0xdfb7('0x8'));var attributes=require(_0xdfb7('0x9'));module[_0xdfb7('0xa')]=function(_0x16da99,_0x57308a){return _0x16da99[_0xdfb7('0xb')](_0xdfb7('0xc'),attributes,{'tableName':_0xdfb7('0xd'),'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 1c29845..113d764 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 _0xa29a=['request\x20sent','error','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x54f3e8,_0x3ed493){var _0x267b37=function(_0x58247e){while(--_0x58247e){_0x54f3e8['push'](_0x54f3e8['shift']());}};_0x267b37(++_0x3ed493);}(_0xa29a,0xd5));var _0xaa29=function(_0x2d98ac,_0x4e6161){_0x2d98ac=_0x2d98ac-0x0;var _0x444708=_0xa29a[_0x2d98ac];return _0x444708;};'use strict';var _=require(_0xaa29('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaa29('0x1'));var rs=require(_0xaa29('0x2'));var fs=require('fs');var Redis=require(_0xaa29('0x3'));var db=require(_0xaa29('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa29('0x5'))('rpc');var config=require(_0xaa29('0x6'));var jayson=require(_0xaa29('0x7'));var client=jayson[_0xaa29('0x8')][_0xaa29('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35f2fb,_0x1283d1,_0x39c0c3){return new BPromise(function(_0x108a38,_0x12d7c0){return client[_0xaa29('0xa')](_0x35f2fb,_0x39c0c3)[_0xaa29('0xb')](function(_0x52df12){logger[_0xaa29('0xc')](_0xaa29('0xd'),_0x1283d1,'request\x20sent');logger['debug'](_0xaa29('0xe'),_0x1283d1,_0xaa29('0xf'),JSON['stringify'](_0x52df12));if(_0x52df12[_0xaa29('0x10')]){if(_0x52df12[_0xaa29('0x10')]['code']===0x1f4){logger[_0xaa29('0x10')](_0xaa29('0xd'),_0x1283d1,_0x52df12[_0xaa29('0x10')][_0xaa29('0x11')]);return _0x12d7c0(_0x52df12[_0xaa29('0x10')][_0xaa29('0x11')]);}logger[_0xaa29('0x10')](_0xaa29('0xd'),_0x1283d1,_0x52df12[_0xaa29('0x10')][_0xaa29('0x11')]);return _0x108a38(_0x52df12[_0xaa29('0x10')][_0xaa29('0x11')]);}else{logger[_0xaa29('0xc')]('CmCompany,\x20%s,\x20%s',_0x1283d1,_0xaa29('0xf'));_0x108a38(_0x52df12['result'][_0xaa29('0x11')]);}})[_0xaa29('0x12')](function(_0x406a86){logger[_0xaa29('0x10')](_0xaa29('0xd'),_0x1283d1,_0x406a86);_0x12d7c0(_0x406a86);});});}
\ No newline at end of file
+var _0xc6fb=['CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xc6fb,0x83));var _0xbc6f=function(_0x1c8cc6,_0x411e5c){_0x1c8cc6=_0x1c8cc6-0x0;var _0x522936=_0xc6fb[_0x1c8cc6];return _0x522936;};'use strict';var _=require(_0xbc6f('0x0'));var util=require(_0xbc6f('0x1'));var moment=require(_0xbc6f('0x2'));var BPromise=require(_0xbc6f('0x3'));var rs=require(_0xbc6f('0x4'));var fs=require('fs');var Redis=require(_0xbc6f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbc6f('0x6'));var logger=require(_0xbc6f('0x7'))('rpc');var config=require(_0xbc6f('0x8'));var jayson=require(_0xbc6f('0x9'));var client=jayson[_0xbc6f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x466a69,_0x442fb1,_0x4d0afa){return new BPromise(function(_0x565f2d,_0x284cbb){return client[_0xbc6f('0xb')](_0x466a69,_0x4d0afa)[_0xbc6f('0xc')](function(_0x3fe04e){logger[_0xbc6f('0xd')](_0xbc6f('0xe'),_0x442fb1,_0xbc6f('0xf'));logger['debug'](_0xbc6f('0x10'),_0x442fb1,_0xbc6f('0xf'),JSON[_0xbc6f('0x11')](_0x3fe04e));if(_0x3fe04e[_0xbc6f('0x12')]){if(_0x3fe04e[_0xbc6f('0x12')][_0xbc6f('0x13')]===0x1f4){logger[_0xbc6f('0x12')](_0xbc6f('0xe'),_0x442fb1,_0x3fe04e[_0xbc6f('0x12')]['message']);return _0x284cbb(_0x3fe04e['error'][_0xbc6f('0x14')]);}logger[_0xbc6f('0x12')]('CmCompany,\x20%s,\x20%s',_0x442fb1,_0x3fe04e[_0xbc6f('0x12')]['message']);return _0x565f2d(_0x3fe04e[_0xbc6f('0x12')]['message']);}else{logger[_0xbc6f('0xd')](_0xbc6f('0xe'),_0x442fb1,_0xbc6f('0xf'));_0x565f2d(_0x3fe04e['result'][_0xbc6f('0x14')]);}})['catch'](function(_0x45dbc6){logger[_0xbc6f('0x12')](_0xbc6f('0xe'),_0x442fb1,_0x45dbc6);_0x284cbb(_0x45dbc6);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 6fcfd1a..72053ec 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 _0x83d0=['/:id/contacts','getContacts','create','addContacts','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','/:id','show'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x83d0,0x76));var _0x083d=function(_0x2d497f,_0x2f5113){_0x2d497f=_0x2d497f-0x0;var _0x58eb02=_0x83d0[_0x2d497f];return _0x58eb02;};'use strict';var multer=require(_0x083d('0x0'));var util=require(_0x083d('0x1'));var path=require(_0x083d('0x2'));var timeout=require(_0x083d('0x3'));var express=require('express');var router=express[_0x083d('0x4')]();var fs_extra=require(_0x083d('0x5'));var auth=require(_0x083d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x083d('0x7'));var controller=require(_0x083d('0x8'));router[_0x083d('0x9')]('/',auth[_0x083d('0xa')](),controller['index']);router[_0x083d('0x9')](_0x083d('0xb'),auth[_0x083d('0xa')](),controller['describe']);router[_0x083d('0x9')](_0x083d('0xc'),auth[_0x083d('0xa')](),controller[_0x083d('0xd')]);router[_0x083d('0x9')](_0x083d('0xe'),auth['isAuthenticated'](),controller[_0x083d('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x083d('0x10')]);router['post']('/:id/contacts',auth['isAuthenticated'](),controller[_0x083d('0x11')]);router[_0x083d('0x12')]('/:id',auth[_0x083d('0xa')](),controller[_0x083d('0x13')]);router['delete'](_0x083d('0xc'),auth[_0x083d('0xa')](),controller[_0x083d('0x14')]);module[_0x083d('0x15')]=router;
\ No newline at end of file
+var _0x698e=['get','describe','/:id','isAuthenticated','show','/:id/contacts','getContacts','post','create','put','update','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','index'];(function(_0x479509,_0x1daf8a){var _0x382da8=function(_0x39d77c){while(--_0x39d77c){_0x479509['push'](_0x479509['shift']());}};_0x382da8(++_0x1daf8a);}(_0x698e,0x14f));var _0xe698=function(_0x453310,_0x4dcff6){_0x453310=_0x453310-0x0;var _0x337eb4=_0x698e[_0x453310];return _0x337eb4;};'use strict';var multer=require('multer');var util=require(_0xe698('0x0'));var path=require('path');var timeout=require(_0xe698('0x1'));var express=require(_0xe698('0x2'));var router=express['Router']();var fs_extra=require(_0xe698('0x3'));var auth=require(_0xe698('0x4'));var interaction=require(_0xe698('0x5'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe698('0x6')]);router[_0xe698('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xe698('0x8')]);router[_0xe698('0x7')](_0xe698('0x9'),auth[_0xe698('0xa')](),controller[_0xe698('0xb')]);router[_0xe698('0x7')](_0xe698('0xc'),auth[_0xe698('0xa')](),controller[_0xe698('0xd')]);router[_0xe698('0xe')]('/',auth[_0xe698('0xa')](),controller[_0xe698('0xf')]);router[_0xe698('0xe')](_0xe698('0xc'),auth[_0xe698('0xa')](),controller['addContacts']);router[_0xe698('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xe698('0x11')]);router['delete'](_0xe698('0x9'),auth[_0xe698('0xa')](),controller['destroy']);module[_0xe698('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 2979506..567d6c3 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 _0x66ef=['exports','STRING','TEXT','UNSIGNED','DATE','NOW','INTEGER','sequelize'];(function(_0x45eee2,_0x4d8c9e){var _0x4eb329=function(_0x3d99a5){while(--_0x3d99a5){_0x45eee2['push'](_0x45eee2['shift']());}};_0x4eb329(++_0x4d8c9e);}(_0x66ef,0x147));var _0xf66e=function(_0x20dc38,_0x371fbf){_0x20dc38=_0x20dc38-0x0;var _0x42a113=_0x66ef[_0x20dc38];return _0x42a113;};'use strict';var _=require('lodash');var Sequelize=require(_0xf66e('0x0'));module[_0xf66e('0x1')]={'firstName':{'type':Sequelize[_0xf66e('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xf66e('0x2')]},'street':{'type':Sequelize[_0xf66e('0x2')]},'postalCode':{'type':Sequelize[_0xf66e('0x2')]},'city':{'type':Sequelize[_0xf66e('0x2')]},'country':{'type':Sequelize[_0xf66e('0x2')]},'dateOfBirth':{'type':Sequelize[_0xf66e('0x2')]},'description':{'type':Sequelize[_0xf66e('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xf66e('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf66e('0x2')]},'url':{'type':Sequelize[_0xf66e('0x2')]},'facebook':{'type':Sequelize[_0xf66e('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xf66e('0x2')]},'skype':{'type':Sequelize[_0xf66e('0x2')]},'teams':{'type':Sequelize[_0xf66e('0x2')]},'viber':{'type':Sequelize[_0xf66e('0x2')]},'line':{'type':Sequelize[_0xf66e('0x2')]},'wechat':{'type':Sequelize[_0xf66e('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xf66e('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xf66e('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf66e('0x5')],'defaultValue':Sequelize[_0xf66e('0x6')]},'dialTimezone':{'type':Sequelize[_0xf66e('0x2')]},'utcOffset':{'type':Sequelize[_0xf66e('0x7')]}};
\ No newline at end of file
+var _0x5802=['STRING','INTEGER','UNSIGNED','DATE','lodash','sequelize','exports'];(function(_0x30899c,_0x4a08a9){var _0x1aa246=function(_0x177694){while(--_0x177694){_0x30899c['push'](_0x30899c['shift']());}};_0x1aa246(++_0x4a08a9);}(_0x5802,0x12a));var _0x2580=function(_0x5ad67c,_0x144860){_0x5ad67c=_0x5ad67c-0x0;var _0xccce2e=_0x5802[_0x5ad67c];return _0xccce2e;};'use strict';var _=require(_0x2580('0x0'));var Sequelize=require(_0x2580('0x1'));module[_0x2580('0x2')]={'firstName':{'type':Sequelize[_0x2580('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x2580('0x3')]},'postalCode':{'type':Sequelize[_0x2580('0x3')]},'city':{'type':Sequelize[_0x2580('0x3')]},'country':{'type':Sequelize[_0x2580('0x3')]},'dateOfBirth':{'type':Sequelize[_0x2580('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x2580('0x3')]},'mobile':{'type':Sequelize[_0x2580('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x2580('0x3')]},'url':{'type':Sequelize[_0x2580('0x3')]},'facebook':{'type':Sequelize[_0x2580('0x3')]},'fb_data':{'type':Sequelize[_0x2580('0x3')]},'twitter':{'type':Sequelize[_0x2580('0x3')]},'skype':{'type':Sequelize[_0x2580('0x3')]},'teams':{'type':Sequelize[_0x2580('0x3')]},'viber':{'type':Sequelize[_0x2580('0x3')]},'line':{'type':Sequelize[_0x2580('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x2580('0x3')]},'UserId':{'type':Sequelize[_0x2580('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x2580('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x2580('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x2580('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'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 732abb1..8bc233d 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(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','base64','lodash','moment','path','util'];(function(_0x13fdc7,_0x4ca0d4){var _0x2f690d=function(_0x14f6b0){while(--_0x14f6b0){_0x13fdc7['push'](_0x13fdc7['shift']());}};_0x2f690d(++_0x4ca0d4);}(_0xb27b,0x169));var _0xbb27=function(_0x25a152,_0x5795f9){_0x25a152=_0x25a152-0x0;var _0x26f30b=_0xb27b[_0x25a152];return _0x26f30b;};'use strict';var _=require(_0xbb27('0x0'));var moment=require(_0xbb27('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0xbb27('0x2'));var util=require(_0xbb27('0x3'));var tnef=require(_0xbb27('0x4'));var logger=require(_0xbb27('0x5'))('email');var config=require(_0xbb27('0x6'));function getAddress(_0x4d4cc4){var _0x3607fb=_[_0xbb27('0x7')](_0x4d4cc4['value']);return _0x3607fb&&_0x3607fb[_0xbb27('0x8')]?_0x3607fb[_0xbb27('0x8')]:_0xbb27('0x9')+random[_0xbb27('0xa')](0x6)+_0xbb27('0xb');}function getFirstName(_0x510c41){var _0x300c5e=_[_0xbb27('0x7')](_0x510c41[_0xbb27('0xc')]);if(_0x300c5e&&_0x300c5e[_0xbb27('0xd')]){if(_0x300c5e[_0xbb27('0xd')]==_0x300c5e['address']){return _0x300c5e[_0xbb27('0xd')][_0xbb27('0xe')](0x0,_0x300c5e[_0xbb27('0xd')][_0xbb27('0xf')]('@'));}var _0x3517d1=_0x300c5e[_0xbb27('0xd')][_0xbb27('0x10')](/\s+/);return _0x3517d1[_0xbb27('0x11')]>0x1?_0x3517d1[_0xbb27('0x12')](0x0,-0x1)[_0xbb27('0x13')]('\x20'):_0x300c5e['name'];}return'Anonymous';}function getLastName(_0x4f313b){var _0x1cddf5=_[_0xbb27('0x7')](_0x4f313b['value']);if(_0x1cddf5&&_0x1cddf5['name']){var _0x38f463=_0x1cddf5[_0xbb27('0xd')][_0xbb27('0x10')](/\s+/);return _0x38f463['length']>0x1?_0x38f463[_0xbb27('0x14')]():'';}return'';}function getMails(_0xf5d98f,_0x301860){var _0x411544='';for(var _0x2ead03=0x0;_0x2ead03<_0x301860[_0xbb27('0xc')]['length'];_0x2ead03+=0x1){if(_0x301860[_0xbb27('0xc')][_0x2ead03][_0xbb27('0x8')]!==_0xf5d98f){if(!_[_0xbb27('0x15')](_0x411544)){_0x411544+=',';}_0x411544+=_0x301860[_0xbb27('0xc')][_0x2ead03][_0xbb27('0xd')]||_0x301860['value'][_0x2ead03][_0xbb27('0x8')]||'';_0x411544+='\x20<';_0x411544+=_0x301860[_0xbb27('0xc')][_0x2ead03][_0xbb27('0x8')]?_0x301860[_0xbb27('0xc')][_0x2ead03][_0xbb27('0x8')]:'anonymous'+random[_0xbb27('0xa')](0x6)+_0xbb27('0xb');_0x411544+='>';}}return _0x411544;}function parseEmail(_0x34a58b,_0x6d8137,_0x94bbbf){if(_0x6d8137[_0xbb27('0x16')]){var _0x7677de=/