From: support
Date: Wed, 9 Nov 2022 11:47:33 +0000 (+0000)
Subject: Built motion from commit bbec7235.|2.6.20
X-Git-Url: http://repos.xcallymotion.com/base/%22./banner.jpg//%27?a=commitdiff_plain;h=5cda470f32f8fcbb66a6655133c8acc73629ef3b;p=motion2.git
Built motion from commit bbec7235.|2.6.20
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index da8fcde..7709d32 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-10-27T14:26:31.596Z",
+ "time": "2022-11-09T11:37:31.069Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 9490509..c66a9c1 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-10-27T14:26:31.596Z",
+ "time": "2022-11-09T11:37:31.069Z",
"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 641b96a..1067d3d 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 _0xbd1d=['urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xbd1d,0x193));var _0xdbd1=function(_0x4a2ba2,_0x5901b9){_0x4a2ba2=_0x4a2ba2-0x0;var _0x1d09fd=_0xbd1d[_0x4a2ba2];return _0x1d09fd;};'use strict';var Sequelize=require(_0xdbd1('0x0'));module['exports']={'name':{'type':Sequelize[_0xdbd1('0x1')],'get':function(_0x327b10){return this[_0xdbd1('0x2')](_0xdbd1('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xdbd1('0x4'),_0xdbd1('0x5'),_0xdbd1('0x6'),_0xdbd1('0x7'),_0xdbd1('0x8'),_0xdbd1('0x9'),_0xdbd1('0xa')]],'msg':_0xdbd1('0xb')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xdbd1('0xc')](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[_0xdbd1('0xc')](0x1000),'comment':_0xdbd1('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xdbd1('0xe')},'data4':{'type':Sequelize[_0xdbd1('0xc')](0x1000),'comments':_0xdbd1('0xf')},'data5':{'type':Sequelize[_0xdbd1('0xc')](0x1000),'comments':_0xdbd1('0x10')},'data6':{'type':Sequelize[_0xdbd1('0xc')],'comments':_0xdbd1('0x11')},'data7':{'type':Sequelize[_0xdbd1('0x12')],'comments':_0xdbd1('0x13')}};
\ No newline at end of file
+var _0x6ced=['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]','VIRTUAL','STRING','integration','motionbar','urlForward','browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'];(function(_0x592c91,_0x488431){var _0x557acd=function(_0x28cc4e){while(--_0x28cc4e){_0x592c91['push'](_0x592c91['shift']());}};_0x557acd(++_0x488431);}(_0x6ced,0x116));var _0xd6ce=function(_0x2bf341,_0x4d20a6){_0x2bf341=_0x2bf341-0x0;var _0x394e22=_0x6ced[_0x2bf341];return _0x394e22;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd6ce('0x0')],'get':function(_0x22577c){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0xd6ce('0x1')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xd6ce('0x2'),_0xd6ce('0x3'),'jscripty',_0xd6ce('0x4'),_0xd6ce('0x5'),'bot','script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xd6ce('0x6')},'data1':{'type':Sequelize[_0xd6ce('0x1')](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[_0xd6ce('0x1')](0x1000),'comment':_0xd6ce('0x7')},'data3':{'type':Sequelize[_0xd6ce('0x1')](0x1000),'comment':_0xd6ce('0x8')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xd6ce('0x9')},'data5':{'type':Sequelize[_0xd6ce('0x1')](0x1000),'comments':_0xd6ce('0xa')},'data6':{'type':Sequelize[_0xd6ce('0x1')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xd6ce('0xb')],'comments':_0xd6ce('0xc')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 1bc101b..ea90125 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 _0x626c=['mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','Action','params','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x626c,0x1bc));var _0xc626=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x626c[_0x550d12];return _0x12103d;};'use strict';var emlformat=require(_0xc626('0x0'));var rimraf=require(_0xc626('0x1'));var zipdir=require(_0xc626('0x2'));var jsonpatch=require(_0xc626('0x3'));var rp=require('request-promise');var moment=require(_0xc626('0x4'));var BPromise=require(_0xc626('0x5'));var Mustache=require(_0xc626('0x6'));var util=require(_0xc626('0x7'));var path=require(_0xc626('0x8'));var sox=require(_0xc626('0x9'));var csv=require(_0xc626('0xa'));var ejs=require(_0xc626('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc626('0xc'));var crypto=require(_0xc626('0xd'));var jsforce=require(_0xc626('0xe'));var deskjs=require(_0xc626('0xf'));var toCsv=require(_0xc626('0xa'));var querystring=require(_0xc626('0x10'));var Papa=require(_0xc626('0x11'));var Redis=require(_0xc626('0x12'));var authService=require(_0xc626('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc626('0x14'));var logger=require(_0xc626('0x15'))(_0xc626('0x16'));var utils=require(_0xc626('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc626('0x18'));var db=require(_0xc626('0x19'))['db'];function respondWithStatusCode(_0x25db9c,_0x32bcf6){_0x32bcf6=_0x32bcf6||0xcc;return function(_0x311d47){if(_0x311d47){return _0x25db9c[_0xc626('0x1a')](_0x32bcf6);}return _0x25db9c['status'](_0x32bcf6)[_0xc626('0x1b')]();};}function respondWithResult(_0x52548f,_0x2b53c3){_0x2b53c3=_0x2b53c3||0xc8;return function(_0x111d28){if(_0x111d28){return _0x52548f['status'](_0x2b53c3)[_0xc626('0x1c')](_0x111d28);}};}function respondWithFilteredResult(_0xccc2bd,_0x3c617c){return function(_0x1f3e7a){if(_0x1f3e7a){var _0xc2cdcf=typeof _0x3c617c[_0xc626('0x1d')]===_0xc626('0x1e')&&typeof _0x3c617c[_0xc626('0x1f')]==='undefined';var _0x31e835=_0x1f3e7a[_0xc626('0x20')];var _0x4b4546=_0xc2cdcf?0x0:_0x3c617c['offset'];var _0x25baa9=_0xc2cdcf?_0x1f3e7a[_0xc626('0x20')]:_0x3c617c[_0xc626('0x1d')]+_0x3c617c[_0xc626('0x1f')];var _0x743b4;if(_0x25baa9>=_0x31e835){_0x25baa9=_0x31e835;_0x743b4=0xc8;}else{_0x743b4=0xce;}_0xccc2bd[_0xc626('0x21')](_0x743b4);return _0xccc2bd['set'](_0xc626('0x22'),_0x4b4546+'-'+_0x25baa9+'/'+_0x31e835)['json'](_0x1f3e7a);}return null;};}function patchUpdates(_0x3a6997){return function(_0x4043e9){try{jsonpatch[_0xc626('0x23')](_0x4043e9,_0x3a6997,!![]);}catch(_0x1c6cf4){return BPromise[_0xc626('0x24')](_0x1c6cf4);}return _0x4043e9[_0xc626('0x25')]();};}function saveUpdates(_0xe940fa,_0xf32b14){return function(_0x19540f){if(_0x19540f){return _0x19540f[_0xc626('0x26')](_0xe940fa)[_0xc626('0x27')](function(_0x221330){return _0x221330;});}return null;};}function removeEntity(_0x4c864b,_0x9f6d06){return function(_0x170ad8){if(_0x170ad8){return _0x170ad8[_0xc626('0x28')]()[_0xc626('0x27')](function(){_0x4c864b[_0xc626('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a8b7f,_0x2244b0){return function(_0x4e4ea3){if(!_0x4e4ea3){_0x3a8b7f['sendStatus'](0x194);}return _0x4e4ea3;};}function handleError(_0x2cea5c,_0xec891e){_0xec891e=_0xec891e||0x1f4;return function(_0x145e49){logger[_0xc626('0x29')](_0x145e49[_0xc626('0x2a')]);if(_0x145e49[_0xc626('0x2b')]){delete _0x145e49[_0xc626('0x2b')];}_0x2cea5c[_0xc626('0x21')](_0xec891e)[_0xc626('0x2c')](_0x145e49);};}exports[_0xc626('0x26')]=function(_0x20521c,_0x1be5b8){if(_0x20521c['body']['id']){delete _0x20521c[_0xc626('0x2d')]['id'];}return db[_0xc626('0x2e')]['find']({'where':{'id':_0x20521c[_0xc626('0x2f')]['id']}})['then'](handleEntityNotFound(_0x1be5b8,null))[_0xc626('0x27')](saveUpdates(_0x20521c[_0xc626('0x2d')],null))[_0xc626('0x27')](respondWithResult(_0x1be5b8,null))[_0xc626('0x30')](handleError(_0x1be5b8,null));};exports['destroy']=function(_0x2845f8,_0x56c935){return db[_0xc626('0x2e')][_0xc626('0x31')]({'where':{'id':_0x2845f8[_0xc626('0x2f')]['id']}})[_0xc626('0x27')](handleEntityNotFound(_0x56c935,null))[_0xc626('0x27')](removeEntity(_0x56c935,null))[_0xc626('0x30')](handleError(_0x56c935,null));};
\ No newline at end of file
+var _0x59f3=['eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','limit','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','body','Action','find','params','catch'];(function(_0x18c8dc,_0x510c11){var _0x5b1272=function(_0xd359a3){while(--_0xd359a3){_0x18c8dc['push'](_0x18c8dc['shift']());}};_0x5b1272(++_0x510c11);}(_0x59f3,0x18c));var _0x359f=function(_0x2e0443,_0x7e5974){_0x2e0443=_0x2e0443-0x0;var _0x52d450=_0x59f3[_0x2e0443];return _0x52d450;};'use strict';var emlformat=require(_0x359f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x359f('0x1'));var rp=require(_0x359f('0x2'));var moment=require(_0x359f('0x3'));var BPromise=require(_0x359f('0x4'));var Mustache=require('mustache');var util=require(_0x359f('0x5'));var path=require(_0x359f('0x6'));var sox=require(_0x359f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x359f('0x8'));var _=require(_0x359f('0x9'));var squel=require(_0x359f('0xa'));var crypto=require(_0x359f('0xb'));var jsforce=require(_0x359f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x359f('0xd'));var querystring=require(_0x359f('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x359f('0xf'));var qs=require(_0x359f('0x10'));var as=require(_0x359f('0x11'));var hardwareService=require(_0x359f('0x12'));var logger=require(_0x359f('0x13'))('api');var utils=require(_0x359f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x359f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x169d35,_0x443188){_0x443188=_0x443188||0xcc;return function(_0x5c235a){if(_0x5c235a){return _0x169d35[_0x359f('0x16')](_0x443188);}return _0x169d35['status'](_0x443188)[_0x359f('0x17')]();};}function respondWithResult(_0x25677c,_0x5458ba){_0x5458ba=_0x5458ba||0xc8;return function(_0x208bdd){if(_0x208bdd){return _0x25677c[_0x359f('0x18')](_0x5458ba)['json'](_0x208bdd);}};}function respondWithFilteredResult(_0x674650,_0x1393f1){return function(_0x59a4b5){if(_0x59a4b5){var _0x493c9b=typeof _0x1393f1[_0x359f('0x19')]===_0x359f('0x1a')&&typeof _0x1393f1[_0x359f('0x1b')]===_0x359f('0x1a');var _0x2f4993=_0x59a4b5['count'];var _0x2030e3=_0x493c9b?0x0:_0x1393f1['offset'];var _0x591f82=_0x493c9b?_0x59a4b5['count']:_0x1393f1[_0x359f('0x19')]+_0x1393f1[_0x359f('0x1b')];var _0x5a255b;if(_0x591f82>=_0x2f4993){_0x591f82=_0x2f4993;_0x5a255b=0xc8;}else{_0x5a255b=0xce;}_0x674650['status'](_0x5a255b);return _0x674650[_0x359f('0x1c')](_0x359f('0x1d'),_0x2030e3+'-'+_0x591f82+'/'+_0x2f4993)[_0x359f('0x1e')](_0x59a4b5);}return null;};}function patchUpdates(_0x2bee27){return function(_0x409594){try{jsonpatch['apply'](_0x409594,_0x2bee27,!![]);}catch(_0x1e40f3){return BPromise[_0x359f('0x1f')](_0x1e40f3);}return _0x409594[_0x359f('0x20')]();};}function saveUpdates(_0x2da026,_0x1f17f1){return function(_0x3f1fb1){if(_0x3f1fb1){return _0x3f1fb1[_0x359f('0x21')](_0x2da026)[_0x359f('0x22')](function(_0x10f53a){return _0x10f53a;});}return null;};}function removeEntity(_0x1887fa,_0x2f7554){return function(_0x42491b){if(_0x42491b){return _0x42491b[_0x359f('0x23')]()[_0x359f('0x22')](function(){_0x1887fa[_0x359f('0x18')](0xcc)[_0x359f('0x17')]();});}};}function handleEntityNotFound(_0x45b684,_0x2e7cea){return function(_0x40b7c6){if(!_0x40b7c6){_0x45b684[_0x359f('0x16')](0x194);}return _0x40b7c6;};}function handleError(_0xfb5787,_0x52d7b1){_0x52d7b1=_0x52d7b1||0x1f4;return function(_0x210283){logger['error'](_0x210283[_0x359f('0x24')]);if(_0x210283[_0x359f('0x25')]){delete _0x210283[_0x359f('0x25')];}_0xfb5787[_0x359f('0x18')](_0x52d7b1)[_0x359f('0x26')](_0x210283);};}exports[_0x359f('0x21')]=function(_0x34a77f,_0x3b1734){if(_0x34a77f[_0x359f('0x27')]['id']){delete _0x34a77f[_0x359f('0x27')]['id'];}return db[_0x359f('0x28')][_0x359f('0x29')]({'where':{'id':_0x34a77f[_0x359f('0x2a')]['id']}})[_0x359f('0x22')](handleEntityNotFound(_0x3b1734,null))[_0x359f('0x22')](saveUpdates(_0x34a77f[_0x359f('0x27')],null))[_0x359f('0x22')](respondWithResult(_0x3b1734,null))[_0x359f('0x2b')](handleError(_0x3b1734,null));};exports[_0x359f('0x23')]=function(_0x57c428,_0x31381a){return db['Action'][_0x359f('0x29')]({'where':{'id':_0x57c428[_0x359f('0x2a')]['id']}})[_0x359f('0x22')](handleEntityNotFound(_0x31381a,null))[_0x359f('0x22')](removeEntity(_0x31381a,null))[_0x359f('0x2b')](handleError(_0x31381a,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 5ed425d..3a21f8e 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 _0x0227=['exports','define','Action','tools_actions','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3c2e6c,_0x3c88da){var _0x5bf29e=function(_0x381948){while(--_0x381948){_0x3c2e6c['push'](_0x3c2e6c['shift']());}};_0x5bf29e(++_0x3c88da);}(_0x0227,0xe8));var _0x7022=function(_0x43f494,_0x5d5e9f){_0x43f494=_0x43f494-0x0;var _0x2ce562=_0x0227[_0x43f494];return _0x2ce562;};'use strict';var _=require('lodash');var util=require(_0x7022('0x0'));var logger=require(_0x7022('0x1'))(_0x7022('0x2'));var moment=require(_0x7022('0x3'));var BPromise=require(_0x7022('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7022('0x5'));var rimraf=require(_0x7022('0x6'));var config=require(_0x7022('0x7'));var attributes=require('./action.attributes');module[_0x7022('0x8')]=function(_0x4f26e2,_0x1a5800){return _0x4f26e2[_0x7022('0x9')](_0x7022('0xa'),attributes,{'tableName':_0x7022('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a27=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./action.attributes','exports'];(function(_0x55a4fc,_0x35564d){var _0x15dfe8=function(_0xd50bae){while(--_0xd50bae){_0x55a4fc['push'](_0x55a4fc['shift']());}};_0x15dfe8(++_0x35564d);}(_0x7a27,0x172));var _0x77a2=function(_0xe1f27b,_0x4b5b1b){_0xe1f27b=_0xe1f27b-0x0;var _0x420910=_0x7a27[_0xe1f27b];return _0x420910;};'use strict';var _=require(_0x77a2('0x0'));var util=require(_0x77a2('0x1'));var logger=require(_0x77a2('0x2'))(_0x77a2('0x3'));var moment=require('moment');var BPromise=require(_0x77a2('0x4'));var rp=require(_0x77a2('0x5'));var fs=require('fs');var path=require(_0x77a2('0x6'));var rimraf=require(_0x77a2('0x7'));var config=require('../../config/environment');var attributes=require(_0x77a2('0x8'));module[_0x77a2('0x9')]=function(_0x3a39cd,_0xeb95aa){return _0x3a39cd['define']('Action',attributes,{'tableName':'tools_actions','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 71f7f84..2b9fd77 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0xcfc5fa,_0x57e383){var _0x11926a=function(_0x263281){while(--_0x263281){_0xcfc5fa['push'](_0xcfc5fa['shift']());}};_0x11926a(++_0x57e383);}(_0x1261,0x144));var _0x1126=function(_0x2aa83a,_0x4b5c0b){_0x2aa83a=_0x2aa83a-0x0;var _0x36a653=_0x1261[_0x2aa83a];return _0x36a653;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x53ec,0x192));var _0xc53e=function(_0x654102,_0x4fa2f9){_0x654102=_0x654102-0x0;var _0x3cc306=_0x53ec[_0x654102];return _0x3cc306;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index b1614c6..121e787 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 _0xbb3f=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','/:id','destroy','exports','multer','path','connect-timeout'];(function(_0x1515c9,_0x3db945){var _0x3e9c59=function(_0x56ef9f){while(--_0x56ef9f){_0x1515c9['push'](_0x1515c9['shift']());}};_0x3e9c59(++_0x3db945);}(_0xbb3f,0xcf));var _0xfbb3=function(_0x2b1d7e,_0x32f2ff){_0x2b1d7e=_0x2b1d7e-0x0;var _0xecbf53=_0xbb3f[_0x2b1d7e];return _0xecbf53;};'use strict';var multer=require(_0xfbb3('0x0'));var util=require('util');var path=require(_0xfbb3('0x1'));var timeout=require(_0xfbb3('0x2'));var express=require('express');var router=express[_0xfbb3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfbb3('0x4'));var interaction=require(_0xfbb3('0x5'));var config=require(_0xfbb3('0x6'));var controller=require(_0xfbb3('0x7'));router[_0xfbb3('0x8')]('/:id',auth[_0xfbb3('0x9')](),controller[_0xfbb3('0xa')]);router['delete'](_0xfbb3('0xb'),auth[_0xfbb3('0x9')](),controller[_0xfbb3('0xc')]);module[_0xfbb3('0xd')]=router;
\ No newline at end of file
+var _0x8f57=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','put','/:id','isAuthenticated','update','destroy'];(function(_0x1b3e87,_0xd3706c){var _0x4a89e3=function(_0x1ded84){while(--_0x1ded84){_0x1b3e87['push'](_0x1b3e87['shift']());}};_0x4a89e3(++_0xd3706c);}(_0x8f57,0x16c));var _0x78f5=function(_0x89ee68,_0x18ca4d){_0x89ee68=_0x89ee68-0x0;var _0x1dfd3b=_0x8f57[_0x89ee68];return _0x1dfd3b;};'use strict';var multer=require(_0x78f5('0x0'));var util=require(_0x78f5('0x1'));var path=require('path');var timeout=require(_0x78f5('0x2'));var express=require(_0x78f5('0x3'));var router=express[_0x78f5('0x4')]();var fs_extra=require(_0x78f5('0x5'));var auth=require(_0x78f5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x78f5('0x7'));var controller=require('./action.controller');router[_0x78f5('0x8')](_0x78f5('0x9'),auth[_0x78f5('0xa')](),controller[_0x78f5('0xb')]);router['delete'](_0x78f5('0x9'),auth['isAuthenticated'](),controller[_0x78f5('0xc')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 08c457d..10e9f6f 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 _0x53ec=['STRING','TEXT','sequelize','exports'];(function(_0x58c984,_0x4a4dcf){var _0x9b3b5e=function(_0x59870b){while(--_0x59870b){_0x58c984['push'](_0x58c984['shift']());}};_0x9b3b5e(++_0x4a4dcf);}(_0x53ec,0x192));var _0xc53e=function(_0x3c414c,_0x399dbb){_0x3c414c=_0x3c414c-0x0;var _0x4f3062=_0x53ec[_0x3c414c];return _0x4f3062;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'name':{'type':Sequelize[_0xc53e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc53e('0x2')]},'parent':{'type':Sequelize[_0xc53e('0x2')]},'table':{'type':Sequelize[_0xc53e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xc53e('0x3')]}};
\ No newline at end of file
+var _0xc4aa=['STRING','sequelize','exports'];(function(_0x10453a,_0x4a24d8){var _0x58e278=function(_0xa56ad1){while(--_0xa56ad1){_0x10453a['push'](_0x10453a['shift']());}};_0x58e278(++_0x4a24d8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xc4aa[_0xaa1b3e];return _0x454d7d;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xac4a('0x2')]},'parent':{'type':Sequelize[_0xac4a('0x2')]},'table':{'type':Sequelize[_0xac4a('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index d037e5b..ed02ffa 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 _0x3351=['map','AnalyticCustomReport','rawAttributes','type','model','query','keys','filters','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','merge','includeAll','findAll','rows','catch','params','intersection','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','function','format','replace','groupBy','orderBy','order','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','IS\x20NOT\x20NULL','condition','ValidationErrorItem','metric','output','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','select','COUNT(*)','runReport','operator','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','get','CustomReports','UserProfileResource','destroy','error','stack','name','send','index'];(function(_0xfce7,_0x4c3103){var _0x4ab9fd=function(_0x2ad559){while(--_0x2ad559){_0xfce7['push'](_0xfce7['shift']());}};_0x4ab9fd(++_0x4c3103);}(_0x3351,0x116));var _0x1335=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x3351[_0x92c450];return _0x2a9599;};'use strict';var emlformat=require(_0x1335('0x0'));var rimraf=require(_0x1335('0x1'));var zipdir=require(_0x1335('0x2'));var jsonpatch=require(_0x1335('0x3'));var rp=require(_0x1335('0x4'));var moment=require(_0x1335('0x5'));var BPromise=require(_0x1335('0x6'));var Mustache=require('mustache');var util=require(_0x1335('0x7'));var path=require(_0x1335('0x8'));var sox=require(_0x1335('0x9'));var csv=require('to-csv');var ejs=require(_0x1335('0xa'));var fs=require('fs');var fs_extra=require(_0x1335('0xb'));var _=require('lodash');var squel=require(_0x1335('0xc'));var crypto=require('crypto');var jsforce=require(_0x1335('0xd'));var deskjs=require(_0x1335('0xe'));var toCsv=require(_0x1335('0xf'));var querystring=require('querystring');var Papa=require(_0x1335('0x10'));var Redis=require('ioredis');var authService=require(_0x1335('0x11'));var qs=require(_0x1335('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1335('0x13'))(_0x1335('0x14'));var utils=require('../../config/utils');var config=require(_0x1335('0x15'));var licenseUtil=require(_0x1335('0x16'));var db=require(_0x1335('0x17'))['db'];var dbH=require(_0x1335('0x17'))[_0x1335('0x18')];function respondWithStatusCode(_0xaae222,_0x1aaf6c){_0x1aaf6c=_0x1aaf6c||0xcc;return function(_0x46c204){if(_0x46c204){return _0xaae222['sendStatus'](_0x1aaf6c);}return _0xaae222[_0x1335('0x19')](_0x1aaf6c)[_0x1335('0x1a')]();};}function respondWithResult(_0x35ea1b,_0x454eb1){_0x454eb1=_0x454eb1||0xc8;return function(_0x18df8d){if(_0x18df8d){return _0x35ea1b[_0x1335('0x19')](_0x454eb1)['json'](_0x18df8d);}};}function respondWithFilteredResult(_0x249c9f,_0xf00a55){return function(_0x4dd6f4){if(_0x4dd6f4){var _0x2e36e3=typeof _0xf00a55[_0x1335('0x1b')]==='undefined'&&typeof _0xf00a55[_0x1335('0x1c')]===_0x1335('0x1d');var _0x1bd554=_0x4dd6f4[_0x1335('0x1e')];var _0x3c918a=_0x2e36e3?0x0:_0xf00a55['offset'];var _0x40916c=_0x2e36e3?_0x4dd6f4[_0x1335('0x1e')]:_0xf00a55['offset']+_0xf00a55['limit'];var _0x40fdb6;if(_0x40916c>=_0x1bd554){_0x40916c=_0x1bd554;_0x40fdb6=0xc8;}else{_0x40fdb6=0xce;}_0x249c9f[_0x1335('0x19')](_0x40fdb6);return _0x249c9f[_0x1335('0x1f')](_0x1335('0x20'),_0x3c918a+'-'+_0x40916c+'/'+_0x1bd554)['json'](_0x4dd6f4);}return null;};}function patchUpdates(_0x4e1fd2){return function(_0x56231a){try{jsonpatch[_0x1335('0x21')](_0x56231a,_0x4e1fd2,!![]);}catch(_0x50a5b9){return BPromise[_0x1335('0x22')](_0x50a5b9);}return _0x56231a[_0x1335('0x23')]();};}function saveUpdates(_0x456277,_0x51f61d){return function(_0x3763b9){if(_0x3763b9){return _0x3763b9['update'](_0x456277)['then'](function(_0x36c7cf){return _0x36c7cf;});}return null;};}function removeEntity(_0x28abcc,_0x5601a2){return function(_0x480403){if(_0x480403){return _0x480403['destroy']()[_0x1335('0x24')](function(){var _0x46b96a=_0x480403[_0x1335('0x25')]({'plain':!![]});var _0x230da6=_0x1335('0x26');return db[_0x1335('0x27')][_0x1335('0x28')]({'where':{'type':_0x230da6,'resourceId':_0x46b96a['id']}})[_0x1335('0x24')](function(){return _0x480403;});})['then'](function(){_0x28abcc[_0x1335('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x435894,_0x5d8dc1){return function(_0x4903b7){if(!_0x4903b7){_0x435894['sendStatus'](0x194);}return _0x4903b7;};}function handleError(_0x1a151a,_0x3c4404){_0x3c4404=_0x3c4404||0x1f4;return function(_0x59bde5){logger[_0x1335('0x29')](_0x59bde5[_0x1335('0x2a')]);if(_0x59bde5[_0x1335('0x2b')]){delete _0x59bde5[_0x1335('0x2b')];}_0x1a151a[_0x1335('0x19')](_0x3c4404)[_0x1335('0x2c')](_0x59bde5);};}exports[_0x1335('0x2d')]=function(_0x33bf59,_0x52c04a){var _0x3cbac1={},_0x3e4503={},_0x4216f0={'count':0x0,'rows':[]};var _0xfb3dbf=_[_0x1335('0x2e')](db[_0x1335('0x2f')][_0x1335('0x30')],function(_0x5e5fc2){return{'name':_0x5e5fc2['fieldName'],'type':_0x5e5fc2[_0x1335('0x31')]['key']};});_0x3e4503[_0x1335('0x32')]=_[_0x1335('0x2e')](_0xfb3dbf,_0x1335('0x2b'));_0x3e4503[_0x1335('0x33')]=_[_0x1335('0x34')](_0x33bf59[_0x1335('0x33')]);_0x3e4503[_0x1335('0x35')]=_['intersection'](_0x3e4503[_0x1335('0x32')],_0x3e4503['query']);_0x3cbac1['attributes']=_['intersection'](_0x3e4503[_0x1335('0x32')],qs[_0x1335('0x36')](_0x33bf59[_0x1335('0x33')][_0x1335('0x36')]));_0x3cbac1[_0x1335('0x37')]=_0x3cbac1[_0x1335('0x37')][_0x1335('0x38')]?_0x3cbac1[_0x1335('0x37')]:_0x3e4503[_0x1335('0x32')];if(!_0x33bf59[_0x1335('0x33')][_0x1335('0x39')]('nolimit')){_0x3cbac1['limit']=qs[_0x1335('0x1c')](_0x33bf59[_0x1335('0x33')][_0x1335('0x1c')]);_0x3cbac1['offset']=qs['offset'](_0x33bf59['query']['offset']);}_0x3cbac1['order']=qs['sort'](_0x33bf59[_0x1335('0x33')][_0x1335('0x3a')]);_0x3cbac1['where']=qs[_0x1335('0x35')](_[_0x1335('0x3b')](_0x33bf59[_0x1335('0x33')],_0x3e4503[_0x1335('0x35')]),_0xfb3dbf);if(_0x33bf59[_0x1335('0x33')][_0x1335('0x3c')]){_0x3cbac1[_0x1335('0x3d')]=_[_0x1335('0x3e')](_0x3cbac1[_0x1335('0x3d')],{'$or':_[_0x1335('0x2e')](_0xfb3dbf,function(_0x297eb7){if(_0x297eb7[_0x1335('0x31')]!=='VIRTUAL'){var _0x168bc8={};_0x168bc8[_0x297eb7[_0x1335('0x2b')]]={'$like':'%'+_0x33bf59['query'][_0x1335('0x3c')]+'%'};return _0x168bc8;}})});}_0x3cbac1=_[_0x1335('0x3e')]({},_0x3cbac1,_0x33bf59['options']);var _0x2dc795={'where':_0x3cbac1[_0x1335('0x3d')]};return db[_0x1335('0x2f')][_0x1335('0x1e')](_0x2dc795)[_0x1335('0x24')](function(_0x4ef51c){_0x4216f0[_0x1335('0x1e')]=_0x4ef51c;if(_0x33bf59['query'][_0x1335('0x3f')]){_0x3cbac1['include']=[{'all':!![]}];}return db[_0x1335('0x2f')][_0x1335('0x40')](_0x3cbac1);})[_0x1335('0x24')](function(_0x1bce1d){_0x4216f0[_0x1335('0x41')]=_0x1bce1d;return _0x4216f0;})[_0x1335('0x24')](respondWithFilteredResult(_0x52c04a,_0x3cbac1))[_0x1335('0x42')](handleError(_0x52c04a,null));};exports['show']=function(_0x91f7b5,_0x5ec4fd){var _0x19dbf9={'raw':![],'where':{'id':_0x91f7b5[_0x1335('0x43')]['id']}},_0x39b303={};_0x39b303[_0x1335('0x32')]=_[_0x1335('0x34')](db[_0x1335('0x2f')][_0x1335('0x30')]);_0x39b303[_0x1335('0x33')]=_['keys'](_0x91f7b5[_0x1335('0x33')]);_0x39b303[_0x1335('0x35')]=_[_0x1335('0x44')](_0x39b303[_0x1335('0x32')],_0x39b303[_0x1335('0x33')]);_0x19dbf9[_0x1335('0x37')]=_['intersection'](_0x39b303[_0x1335('0x32')],qs['fields'](_0x91f7b5[_0x1335('0x33')]['fields']));_0x19dbf9['attributes']=_0x19dbf9['attributes']['length']?_0x19dbf9['attributes']:_0x39b303[_0x1335('0x32')];if(_0x91f7b5['query'][_0x1335('0x3f')]){_0x19dbf9[_0x1335('0x45')]=[{'all':!![]}];}_0x19dbf9=_[_0x1335('0x3e')]({},_0x19dbf9,_0x91f7b5[_0x1335('0x46')]);return db[_0x1335('0x2f')][_0x1335('0x47')](_0x19dbf9)[_0x1335('0x24')](handleEntityNotFound(_0x5ec4fd,null))[_0x1335('0x24')](respondWithResult(_0x5ec4fd,null))[_0x1335('0x42')](handleError(_0x5ec4fd,null));};exports[_0x1335('0x48')]=function(_0x38b0aa,_0x3e1814){return db[_0x1335('0x2f')][_0x1335('0x48')](_0x38b0aa[_0x1335('0x49')],{})[_0x1335('0x24')](function(_0x1d1568){var _0x4a56d9=_0x38b0aa['user'][_0x1335('0x25')]({'plain':!![]});if(!_0x4a56d9)throw new Error(_0x1335('0x4a'));if(_0x4a56d9[_0x1335('0x4b')]===_0x1335('0x4c')){var _0x441821=_0x1d1568[_0x1335('0x25')]({'plain':!![]});var _0x92706=_0x1335('0x4d');return db['UserProfileSection'][_0x1335('0x47')]({'where':{'name':_0x92706,'userProfileId':_0x4a56d9[_0x1335('0x4e')]},'raw':!![]})[_0x1335('0x24')](function(_0x2bdeef){if(_0x2bdeef&&_0x2bdeef['autoAssociation']===0x0){return db[_0x1335('0x27')][_0x1335('0x48')]({'name':_0x441821[_0x1335('0x2b')],'resourceId':_0x441821['id'],'type':_0x1335('0x26'),'sectionId':_0x2bdeef['id']},{})[_0x1335('0x24')](function(){return _0x1d1568;});}else{return _0x1d1568;}})[_0x1335('0x42')](function(_0x3c6552){logger[_0x1335('0x29')](_0x1335('0x4f'),_0x3c6552);throw _0x3c6552;});}return _0x1d1568;})['then'](respondWithResult(_0x3e1814,0xc9))[_0x1335('0x42')](handleError(_0x3e1814,null));};exports['update']=function(_0x5c35f3,_0x390bf6){if(_0x5c35f3[_0x1335('0x49')]['id']){delete _0x5c35f3[_0x1335('0x49')]['id'];}return db[_0x1335('0x2f')][_0x1335('0x47')]({'where':{'id':_0x5c35f3[_0x1335('0x43')]['id']}})['then'](handleEntityNotFound(_0x390bf6,null))[_0x1335('0x24')](saveUpdates(_0x5c35f3[_0x1335('0x49')],null))[_0x1335('0x24')](respondWithResult(_0x390bf6,null))['catch'](handleError(_0x390bf6,null));};exports[_0x1335('0x28')]=function(_0x172d3b,_0x28ef33){return db[_0x1335('0x2f')][_0x1335('0x47')]({'where':{'id':_0x172d3b[_0x1335('0x43')]['id']}})[_0x1335('0x24')](handleEntityNotFound(_0x28ef33,null))[_0x1335('0x24')](removeEntity(_0x28ef33,null))[_0x1335('0x42')](handleError(_0x28ef33,null));};exports[_0x1335('0x50')]=function(_0x4115fa,_0x336282){var _0xd988b7=0xa;var _0x3cc5ae=[_0x1335('0x51'),_0x1335('0x52'),_0x1335('0x53'),'cross_join'];var _0x126c66={'SUM':_0x1335('0x54'),'COUNT':_0x1335('0x55'),'COUNT DISTINCT':_0x1335('0x56'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x1335('0x57'),'GROUP_CONCAT':_0x1335('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1485f1={'SEC_TO_TIME':_0x1335('0x59'),'DATE':_0x1335('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x1335('0x5b'),'UNIX_TIMESTAMP':_0x1335('0x5c')};var _0x3c94db=function(_0x92c882){return!_[_0x1335('0x5d')]([_0x1335('0x5e'),'IS\x20NOT\x20NULL',_0x1335('0x5f'),_0x1335('0x60')],_0x92c882);};var _0x1ea6ca=function(_0x346a90){if(!_0x346a90||!_0x346a90[_0x1335('0x61')][_0x1335('0x38')]){return'';}for(var _0x3e2a50='(',_0x33b8d0=0x0;_0x33b8d0<_0x346a90[_0x1335('0x61')][_0x1335('0x38')];_0x33b8d0+=0x1){_0x33b8d0>0x0&&(_0x3e2a50+='\x20'+_0x346a90['operator']+'\x20');_0x3e2a50+=_0x346a90[_0x1335('0x61')][_0x33b8d0][_0x1335('0x62')]?_0x1ea6ca(_0x346a90['rules'][_0x33b8d0][_0x1335('0x62')]):_0x346a90['rules'][_0x33b8d0][_0x1335('0x63')]+'\x20'+_0x346a90['rules'][_0x33b8d0]['condition']+(_0x3c94db(_0x346a90[_0x1335('0x61')][_0x33b8d0]['condition'])?'\x20'+_0x346a90[_0x1335('0x61')][_0x33b8d0][_0x1335('0x64')]:'');}return _0x3e2a50+')';};var _0x1369da={'where':{'id':_0x4115fa[_0x1335('0x43')]['id']}},_0x218b40,_0x3cf97f,_0x1e9958,_0x4956c7,_0x401e41;_0x1369da=_[_0x1335('0x3e')]({},_0x1369da,_0x4115fa[_0x1335('0x46')]);return db[_0x1335('0x2f')]['find'](_0x1369da)[_0x1335('0x24')](function(_0x2bbad3){if(_0x2bbad3){_0x218b40=_0x2bbad3;return _0x2bbad3[_0x1335('0x65')]();}return null;})['then'](function(_0x3f8cd9){if(_0x3f8cd9){if(!_0x3f8cd9['length']){throw new db[(_0x1335('0x66'))]['ValidationErrorItem'](_0x1335('0x67'),0x193);}_0x3cf97f=_0x3f8cd9;return db[_0x1335('0x68')][_0x1335('0x40')]({'raw':!![]});}return null;})[_0x1335('0x24')](function(_0x119ba8){if(_0x119ba8){_0x1e9958=_[_0x1335('0x69')](_0x119ba8,'id');var _0x55c408;var _0x478a4b=squel['select']();_0x478a4b[_0x1335('0x6a')](_0x218b40[_0x1335('0x6b')]);for(var _0x1d222a=0x0;_0x1d222a<_0x3cf97f[_0x1335('0x38')];_0x1d222a+=0x1){_0x55c408=_0x3cf97f[_0x1d222a][_0x1335('0x6c')]?_0x1e9958[_0x3cf97f[_0x1d222a][_0x1335('0x6c')]]['metric']:_0x3cf97f[_0x1d222a]['field'];_0x55c408=_0x3cf97f[_0x1d222a]['function']?_['replace'](_0x126c66[_0x3cf97f[_0x1d222a][_0x1335('0x6d')]],'%s',_0x55c408):_0x55c408;_0x55c408=_0x3cf97f[_0x1d222a][_0x1335('0x6e')]?_[_0x1335('0x6f')](_0x1485f1[_0x3cf97f[_0x1d222a][_0x1335('0x6e')]],'%s',_0x55c408):_0x55c408;if(_0x3cf97f[_0x1d222a][_0x1335('0x70')]){_0x478a4b['group'](_0x55c408);}_0x3cf97f[_0x1d222a][_0x1335('0x71')]&&_0x478a4b[_0x1335('0x72')](_0x55c408,_0x3cf97f[_0x1d222a]['orderBy']===_0x1335('0x73')?![]:!![]);_0x478a4b['field'](_0x55c408,_0x3cf97f[_0x1d222a][_0x1335('0x74')]||_0x55c408);}if(_0x218b40[_0x1335('0x75')]){_0x218b40[_0x1335('0x75')]=JSON['parse'](_0x218b40[_0x1335('0x75')]);for(var _0x223f64=0x0;_0x223f64<_0x218b40['joins'][_0x1335('0x38')];_0x223f64+=0x1){if(_0x218b40['joins'][_0x223f64][_0x1335('0x31')]&&_['includes'](_0x3cc5ae,_0x218b40[_0x1335('0x75')][_0x223f64][_0x1335('0x31')])&&_0x218b40[_0x1335('0x75')][_0x223f64][_0x1335('0x76')]&&_0x218b40[_0x1335('0x75')][_0x223f64][_0x1335('0x77')]&&_0x218b40[_0x1335('0x75')][_0x223f64]['foreignKey']){_0x478a4b[_0x218b40[_0x1335('0x75')][_0x223f64][_0x1335('0x31')]](_0x218b40[_0x1335('0x75')][_0x223f64][_0x1335('0x77')],null,util[_0x1335('0x6e')](_0x1335('0x78'),_0x218b40['table'],_0x218b40[_0x1335('0x75')][_0x223f64][_0x1335('0x76')],_0x218b40[_0x1335('0x75')][_0x223f64][_0x1335('0x77')],_0x218b40[_0x1335('0x75')][_0x223f64][_0x1335('0x79')]));}}}if(_0x218b40[_0x1335('0x7a')]){_0x218b40[_0x1335('0x7a')]=JSON[_0x1335('0x7b')](_0x218b40[_0x1335('0x7a')]);_0x478a4b[_0x1335('0x3d')](_0x1ea6ca(_0x218b40[_0x1335('0x7a')][_0x1335('0x62')]));}_0x401e41=_0x478a4b[_0x1335('0x7c')]();_0x478a4b[_0x1335('0x1c')](_0xd988b7);_0x478a4b['offset'](0x0);logger[_0x1335('0x7d')](_0x1335('0x7e'),_0x478a4b[_0x1335('0x7f')]());return dbH[_0x1335('0x80')][_0x1335('0x33')](_0x478a4b['toString'](),{'type':dbH[_0x1335('0x80')][_0x1335('0x81')][_0x1335('0x82')]});}})['then'](respondWithResult(_0x336282,null))['catch'](handleError(_0x336282,null));};function runReport(_0xb700f0,_0x3d62b,_0x1d8d76){var _0x25f403=_0x3d62b['name'];var _0x1d1f2e=0xa;var _0x5cb218=['join',_0x1335('0x52'),_0x1335('0x53'),_0x1335('0x83')];var _0x454c1f={'SUM':_0x1335('0x54'),'COUNT':_0x1335('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1335('0x84'),'MIN':_0x1335('0x85'),'AVG':_0x1335('0x57'),'GROUP_CONCAT':_0x1335('0x58'),'GROUP_CONCAT ASC':_0x1335('0x86'),'GROUP_CONCAT DESC':_0x1335('0x87')};var _0x42fc8b={'SEC_TO_TIME':_0x1335('0x59'),'DATE':_0x1335('0x5a'),'HOUR':_0x1335('0x88'),'ROUND':_0x1335('0x5b'),'UNIX_TIMESTAMP':_0x1335('0x5c')};var _0x3eb1bb=function(_0x2a9769){return!_[_0x1335('0x5d')]([_0x1335('0x5e'),_0x1335('0x89'),_0x1335('0x5f'),_0x1335('0x60')],_0x2a9769);};var _0x5e8e74=function(_0x3aedbf){if(!_0x3aedbf||!_0x3aedbf['rules'][_0x1335('0x38')]){return'';}for(var _0x2dc872='(',_0x193c2c=0x0;_0x193c2c<_0x3aedbf[_0x1335('0x61')][_0x1335('0x38')];_0x193c2c+=0x1){_0x193c2c>0x0&&(_0x2dc872+='\x20'+_0x3aedbf['operator']+'\x20');_0x2dc872+=_0x3aedbf['rules'][_0x193c2c][_0x1335('0x62')]?_0x5e8e74(_0x3aedbf[_0x1335('0x61')][_0x193c2c][_0x1335('0x62')]):_0x3aedbf[_0x1335('0x61')][_0x193c2c][_0x1335('0x63')]+'\x20'+_0x3aedbf['rules'][_0x193c2c][_0x1335('0x8a')]+(_0x3eb1bb(_0x3aedbf[_0x1335('0x61')][_0x193c2c][_0x1335('0x8a')])?'\x20'+_0x3aedbf['rules'][_0x193c2c][_0x1335('0x64')]:'');}return _0x2dc872+')';};var _0x3336c2={'where':{'id':_0xb700f0['id']}},_0x58c04c,_0x58448f,_0x40a45e,_0x6bb417,_0x5678cc;_0x3336c2=_['merge']({},_0x3336c2,_0x1d8d76);return db['AnalyticCustomReport'][_0x1335('0x47')](_0x3336c2)[_0x1335('0x24')](function(_0x3f2feb){if(_0x3f2feb){_0x58c04c=_0x3f2feb;return _0x3f2feb[_0x1335('0x65')]();}return null;})[_0x1335('0x24')](function(_0x860e05){if(_0x860e05){if(!_0x860e05['length']){throw new db[(_0x1335('0x66'))][(_0x1335('0x8b'))](_0x1335('0x67'),0x193);}_0x58448f=_0x860e05;return db[_0x1335('0x68')][_0x1335('0x40')]({'raw':!![]});}return null;})[_0x1335('0x24')](function(_0x36d118){if(_0x36d118){_0x40a45e=_[_0x1335('0x69')](_0x36d118,'id');var _0x5ecf33;var _0x462e07=squel['select']();_0x462e07[_0x1335('0x6a')](_0x58c04c[_0x1335('0x6b')]);for(var _0x3f5890=0x0;_0x3f5890<_0x58448f[_0x1335('0x38')];_0x3f5890+=0x1){_0x5ecf33=_0x58448f[_0x3f5890][_0x1335('0x6c')]?_0x40a45e[_0x58448f[_0x3f5890][_0x1335('0x6c')]][_0x1335('0x8c')]:_0x58448f[_0x3f5890]['field'];_0x5ecf33=_0x58448f[_0x3f5890]['function']?_['replace'](_0x454c1f[_0x58448f[_0x3f5890][_0x1335('0x6d')]],'%s',_0x5ecf33):_0x5ecf33;_0x5ecf33=_0x58448f[_0x3f5890]['format']?_[_0x1335('0x6f')](_0x42fc8b[_0x58448f[_0x3f5890]['format']],'%s',_0x5ecf33):_0x5ecf33;if(_0x58448f[_0x3f5890][_0x1335('0x70')]){_0x462e07['group'](_0x5ecf33);}_0x58448f[_0x3f5890][_0x1335('0x71')]&&_0x462e07[_0x1335('0x72')](_0x5ecf33,_0x58448f[_0x3f5890]['orderBy']==='DESC'?![]:!![]);_0x462e07['field'](_0x5ecf33,_0x58448f[_0x3f5890][_0x1335('0x74')]||_0x5ecf33);}if(_0x58c04c[_0x1335('0x75')]){_0x58c04c[_0x1335('0x75')]=JSON[_0x1335('0x7b')](_0x58c04c[_0x1335('0x75')]);for(var _0x27c222=0x0;_0x27c222<_0x58c04c[_0x1335('0x75')][_0x1335('0x38')];_0x27c222+=0x1){if(_0x58c04c[_0x1335('0x75')][_0x27c222][_0x1335('0x31')]&&_[_0x1335('0x5d')](_0x5cb218,_0x58c04c[_0x1335('0x75')][_0x27c222]['type'])&&_0x58c04c[_0x1335('0x75')][_0x27c222]['parentKey']&&_0x58c04c['joins'][_0x27c222]['foreignTable']&&_0x58c04c[_0x1335('0x75')][_0x27c222][_0x1335('0x79')]){_0x462e07[_0x58c04c[_0x1335('0x75')][_0x27c222][_0x1335('0x31')]](_0x58c04c[_0x1335('0x75')][_0x27c222][_0x1335('0x77')],null,util[_0x1335('0x6e')](_0x1335('0x78'),_0x58c04c['table'],_0x58c04c[_0x1335('0x75')][_0x27c222][_0x1335('0x76')],_0x58c04c['joins'][_0x27c222][_0x1335('0x77')],_0x58c04c['joins'][_0x27c222][_0x1335('0x79')]));}}}if(_0x58c04c['conditions']){_0x58c04c[_0x1335('0x7a')]=JSON['parse'](_0x58c04c[_0x1335('0x7a')]);_0x462e07[_0x1335('0x3d')](_0x5e8e74(_0x58c04c['conditions'][_0x1335('0x62')]));}_0x5678cc=_0x462e07['clone']();_0x462e07[_0x1335('0x1c')](_0x1d1f2e);_0x462e07[_0x1335('0x1b')](0x0);return;}})[_0x1335('0x24')](function(){if(_0x3d62b[_0x1335('0x8d')]==='web'){return null;}var _0xcce0bf=_[_0x1335('0x3e')](_0x3d62b,{'name':_0x3d62b[_0x1335('0x8e')]||_0x3d62b[_0x1335('0x2b')]||_0x58c04c[_0x1335('0x2b')],'basename':_0x25f403,'savename':util[_0x1335('0x6e')](_0x1335('0x8f'),_0x3d62b[_0x1335('0x2b')]||_0x58c04c[_0x1335('0x2b')],require('randomstring')[_0x1335('0x90')](0x4),_0x3d62b[_0x1335('0x8d')]||_0x1335('0x91')),'reportId':_0x58c04c['id'],'reportType':_0x1335('0x92')});return db[_0x1335('0x93')][_0x1335('0x48')](_0xcce0bf,{'raw':!![]});})[_0x1335('0x24')](function(_0x506bcb){if(_0x58c04c[_0x1335('0x6b')]===_0x1335('0x94')){_0x5678cc['where'](_0x58c04c['table']+_0x1335('0x95'),_0x3d62b[_0x1335('0x96')],_0x3d62b[_0x1335('0x97')]);}else{_0x5678cc['where'](_0x58c04c[_0x1335('0x6b')]+_0x1335('0x98'),_0x3d62b['startDate'],_0x3d62b[_0x1335('0x97')]);}if(_0x506bcb){logger[_0x1335('0x99')](_0x1335('0x9a'),_0x5678cc['toString']());require(_0x1335('0x9b'))[_0x1335('0x9c')](path[_0x1335('0x51')](__dirname,'../../components/export/',_0x506bcb[_0x1335('0x8d')]),[_0x506bcb['id'],_0x5678cc['toString'](),path[_0x1335('0x51')](__dirname,_0x1335('0x9d'),_0x506bcb['savename']),_0x25f403]);return _0x506bcb;}else{var _0x4c24aa=squel[_0x1335('0x9e')]();_0x4c24aa[_0x1335('0x6a')]('('+_0x5678cc[_0x1335('0x7f')]()+')','countTable');_0x4c24aa[_0x1335('0x63')](_0x1335('0x9f'),_0x1335('0x1e'));_0x5678cc['limit'](_0x3d62b[_0x1335('0x1c')]||_0x1d1f2e);_0x5678cc['offset'](_0x3d62b[_0x1335('0x1b')]||0x0);return dbH['sequelize'][_0x1335('0x33')](_0x4c24aa[_0x1335('0x7f')](),{'type':dbH[_0x1335('0x80')][_0x1335('0x81')][_0x1335('0x82')]})[_0x1335('0x24')](function(_0x5de130){if(!_0x5de130[_0x1335('0x38')]){_0x6bb417=0x0;}else{_0x6bb417=_0x5de130[0x0][_0x1335('0x1e')]||0x0;}return dbH['sequelize'][_0x1335('0x33')](_0x5678cc[_0x1335('0x7f')](),{'type':dbH[_0x1335('0x80')][_0x1335('0x81')][_0x1335('0x82')]});})[_0x1335('0x24')](function(_0x5df216){return{'rows':_0x5df216||[],'count':_0x6bb417};});}});}exports['run']=function(_0x2356b9,_0x4721b5){return runReport(_0x2356b9[_0x1335('0x43')],_0x2356b9[_0x1335('0x33')],_0x2356b9['options'])[_0x1335('0x24')](respondWithResult(_0x4721b5,null))['catch'](handleError(_0x4721b5,null));};exports[_0x1335('0xa0')]=runReport;exports[_0x1335('0x33')]=function(_0x7e5d1b,_0x1b5297){var _0x275a2f=0xa;var _0x20e165=[_0x1335('0x51'),_0x1335('0x52'),_0x1335('0x53'),'cross_join'];var _0x469041={'SUM':_0x1335('0x54'),'COUNT':_0x1335('0x55'),'COUNT DISTINCT':_0x1335('0x56'),'MAX':_0x1335('0x84'),'MIN':'MIN(%s)','AVG':_0x1335('0x57'),'GROUP_CONCAT':_0x1335('0x58'),'GROUP_CONCAT ASC':_0x1335('0x86'),'GROUP_CONCAT DESC':_0x1335('0x87')};var _0x1fa217={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x1335('0x5a'),'HOUR':_0x1335('0x88'),'ROUND':_0x1335('0x5b'),'UNIX_TIMESTAMP':_0x1335('0x5c')};var _0x43a369=function(_0xb6d261){return!_[_0x1335('0x5d')]([_0x1335('0x5e'),_0x1335('0x89'),'IS\x20EMPTY',_0x1335('0x60')],_0xb6d261);};var _0x555c47=function(_0x3772e7){if(!_0x3772e7||!_0x3772e7[_0x1335('0x61')][_0x1335('0x38')]){return'';}for(var _0x1b258b='(',_0x4e0fbd=0x0;_0x4e0fbd<_0x3772e7[_0x1335('0x61')][_0x1335('0x38')];_0x4e0fbd+=0x1){_0x4e0fbd>0x0&&(_0x1b258b+='\x20'+_0x3772e7[_0x1335('0xa1')]+'\x20');_0x1b258b+=_0x3772e7[_0x1335('0x61')][_0x4e0fbd][_0x1335('0x62')]?_0x555c47(_0x3772e7['rules'][_0x4e0fbd][_0x1335('0x62')]):_0x3772e7[_0x1335('0x61')][_0x4e0fbd][_0x1335('0x63')]+'\x20'+_0x3772e7[_0x1335('0x61')][_0x4e0fbd][_0x1335('0x8a')]+(_0x43a369(_0x3772e7[_0x1335('0x61')][_0x4e0fbd]['condition'])?'\x20'+_0x3772e7[_0x1335('0x61')][_0x4e0fbd][_0x1335('0x64')]:'');}return _0x1b258b+')';};var _0x129e3c={'where':{'id':_0x7e5d1b['params']['id']}},_0x3efad5,_0x40fba0,_0x22d3fe,_0x11ed82,_0x22fe38;_0x129e3c=_[_0x1335('0x3e')]({},_0x129e3c,_0x7e5d1b[_0x1335('0x46')]);return db[_0x1335('0x2f')][_0x1335('0x47')](_0x129e3c)['then'](function(_0x1e34d3){if(_0x1e34d3){_0x3efad5=_0x1e34d3;return _0x1e34d3[_0x1335('0x65')]();}return null;})[_0x1335('0x24')](function(_0x192e3b){if(_0x192e3b){if(!_0x192e3b[_0x1335('0x38')]){throw new db[(_0x1335('0x66'))][(_0x1335('0x8b'))](_0x1335('0x67'),0x193);}_0x40fba0=_0x192e3b;return db[_0x1335('0x68')]['findAll']({'raw':!![]});}return null;})[_0x1335('0x24')](function(_0x5248c7){if(_0x5248c7){_0x22d3fe=_['keyBy'](_0x5248c7,'id');var _0x3b1817;var _0x2b785a=squel[_0x1335('0x9e')]();_0x2b785a[_0x1335('0x6a')](_0x3efad5[_0x1335('0x6b')]);for(var _0x5e37b9=0x0;_0x5e37b9<_0x40fba0[_0x1335('0x38')];_0x5e37b9+=0x1){_0x3b1817=_0x40fba0[_0x5e37b9][_0x1335('0x6c')]?_0x22d3fe[_0x40fba0[_0x5e37b9][_0x1335('0x6c')]]['metric']:_0x40fba0[_0x5e37b9][_0x1335('0x63')];_0x3b1817=_0x40fba0[_0x5e37b9][_0x1335('0x6d')]?_['replace'](_0x469041[_0x40fba0[_0x5e37b9][_0x1335('0x6d')]],'%s',_0x3b1817):_0x3b1817;_0x3b1817=_0x40fba0[_0x5e37b9][_0x1335('0x6e')]?_['replace'](_0x1fa217[_0x40fba0[_0x5e37b9][_0x1335('0x6e')]],'%s',_0x3b1817):_0x3b1817;if(_0x40fba0[_0x5e37b9]['groupBy']){_0x2b785a[_0x1335('0x62')](_0x3b1817);}_0x40fba0[_0x5e37b9][_0x1335('0x71')]&&_0x2b785a[_0x1335('0x72')](_0x3b1817,_0x40fba0[_0x5e37b9][_0x1335('0x71')]==='DESC'?![]:!![]);_0x2b785a[_0x1335('0x63')](_0x3b1817,_0x40fba0[_0x5e37b9][_0x1335('0x74')]||_0x3b1817);}if(_0x3efad5[_0x1335('0x75')]){_0x3efad5['joins']=JSON[_0x1335('0x7b')](_0x3efad5[_0x1335('0x75')]);for(var _0x407f43=0x0;_0x407f43<_0x3efad5[_0x1335('0x75')][_0x1335('0x38')];_0x407f43+=0x1){if(_0x3efad5[_0x1335('0x75')][_0x407f43]['type']&&_[_0x1335('0x5d')](_0x20e165,_0x3efad5[_0x1335('0x75')][_0x407f43]['type'])&&_0x3efad5[_0x1335('0x75')][_0x407f43]['parentKey']&&_0x3efad5['joins'][_0x407f43][_0x1335('0x77')]&&_0x3efad5[_0x1335('0x75')][_0x407f43][_0x1335('0x79')]){_0x2b785a[_0x3efad5[_0x1335('0x75')][_0x407f43][_0x1335('0x31')]](_0x3efad5['joins'][_0x407f43][_0x1335('0x77')],null,util[_0x1335('0x6e')](_0x1335('0x78'),_0x3efad5[_0x1335('0x6b')],_0x3efad5[_0x1335('0x75')][_0x407f43][_0x1335('0x76')],_0x3efad5[_0x1335('0x75')][_0x407f43][_0x1335('0x77')],_0x3efad5[_0x1335('0x75')][_0x407f43][_0x1335('0x79')]));}}}if(_0x3efad5['conditions']){_0x3efad5[_0x1335('0x7a')]=JSON['parse'](_0x3efad5[_0x1335('0x7a')]);_0x2b785a['where'](_0x555c47(_0x3efad5[_0x1335('0x7a')][_0x1335('0x62')]));}_0x22fe38=_0x2b785a[_0x1335('0x7c')]();_0x2b785a[_0x1335('0x1c')](_0x275a2f);_0x2b785a['offset'](0x0);logger['debug'](_0x1335('0x7e'),_0x2b785a['toString']());return dbH[_0x1335('0x80')][_0x1335('0x33')](_0x2b785a[_0x1335('0x7f')](),{'type':dbH[_0x1335('0x80')][_0x1335('0x81')][_0x1335('0x82')]});}})[_0x1335('0x24')](function(){return{'sql':_0x22fe38[_0x1335('0x7f')]()};})[_0x1335('0x24')](respondWithResult(_0x1b5297,null))[_0x1335('0x42')](handleError(_0x1b5297,null));};
\ No newline at end of file
+var _0xa573=['parentKey','%s.%s\x20=\x20%s.%s','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','CustomReports','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','AnalyticCustomReport','includeAll','include','rows','show','params','keys','options','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','error','body','destroy','join','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','function','format','replace','groupBy','orderBy','order','DESC','alias','joins','parse','includes','foreignKey','table','foreignTable','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','HOUR(%s)','IS\x20NOT\x20EMPTY','metric'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xa573,0xc2));var _0x3a57=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa573[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3a57('0x0'));var rimraf=require(_0x3a57('0x1'));var zipdir=require(_0x3a57('0x2'));var jsonpatch=require(_0x3a57('0x3'));var rp=require('request-promise');var moment=require(_0x3a57('0x4'));var BPromise=require(_0x3a57('0x5'));var Mustache=require(_0x3a57('0x6'));var util=require(_0x3a57('0x7'));var path=require(_0x3a57('0x8'));var sox=require('sox');var csv=require(_0x3a57('0x9'));var ejs=require(_0x3a57('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a57('0xb'));var squel=require(_0x3a57('0xc'));var crypto=require(_0x3a57('0xd'));var jsforce=require(_0x3a57('0xe'));var deskjs=require(_0x3a57('0xf'));var toCsv=require(_0x3a57('0x9'));var querystring=require(_0x3a57('0x10'));var Papa=require(_0x3a57('0x11'));var Redis=require(_0x3a57('0x12'));var authService=require(_0x3a57('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3a57('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3a57('0x15'));var utils=require(_0x3a57('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3a57('0x17'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x3a57('0x18')];function respondWithStatusCode(_0xeaa402,_0xb1da14){_0xb1da14=_0xb1da14||0xcc;return function(_0x43d4b1){if(_0x43d4b1){return _0xeaa402[_0x3a57('0x19')](_0xb1da14);}return _0xeaa402[_0x3a57('0x1a')](_0xb1da14)[_0x3a57('0x1b')]();};}function respondWithResult(_0x4393d8,_0x508513){_0x508513=_0x508513||0xc8;return function(_0x3691a8){if(_0x3691a8){return _0x4393d8[_0x3a57('0x1a')](_0x508513)[_0x3a57('0x1c')](_0x3691a8);}};}function respondWithFilteredResult(_0x417cb6,_0x2676b6){return function(_0x1fa8c1){if(_0x1fa8c1){var _0x392a5b=typeof _0x2676b6[_0x3a57('0x1d')]==='undefined'&&typeof _0x2676b6[_0x3a57('0x1e')]===_0x3a57('0x1f');var _0x21e5b0=_0x1fa8c1[_0x3a57('0x20')];var _0x2a9b74=_0x392a5b?0x0:_0x2676b6['offset'];var _0x3c316d=_0x392a5b?_0x1fa8c1[_0x3a57('0x20')]:_0x2676b6[_0x3a57('0x1d')]+_0x2676b6['limit'];var _0x2513ef;if(_0x3c316d>=_0x21e5b0){_0x3c316d=_0x21e5b0;_0x2513ef=0xc8;}else{_0x2513ef=0xce;}_0x417cb6['status'](_0x2513ef);return _0x417cb6[_0x3a57('0x21')](_0x3a57('0x22'),_0x2a9b74+'-'+_0x3c316d+'/'+_0x21e5b0)['json'](_0x1fa8c1);}return null;};}function patchUpdates(_0xd95a35){return function(_0x594b62){try{jsonpatch['apply'](_0x594b62,_0xd95a35,!![]);}catch(_0x594a4c){return BPromise[_0x3a57('0x23')](_0x594a4c);}return _0x594b62[_0x3a57('0x24')]();};}function saveUpdates(_0x1d4ef6,_0x1a1589){return function(_0x511b2f){if(_0x511b2f){return _0x511b2f[_0x3a57('0x25')](_0x1d4ef6)[_0x3a57('0x26')](function(_0xa52d29){return _0xa52d29;});}return null;};}function removeEntity(_0x1903e0,_0x2065ea){return function(_0x4fa3be){if(_0x4fa3be){return _0x4fa3be['destroy']()[_0x3a57('0x26')](function(){var _0xe59683=_0x4fa3be[_0x3a57('0x27')]({'plain':!![]});var _0x2f2f7f=_0x3a57('0x28');return db[_0x3a57('0x29')]['destroy']({'where':{'type':_0x2f2f7f,'resourceId':_0xe59683['id']}})[_0x3a57('0x26')](function(){return _0x4fa3be;});})[_0x3a57('0x26')](function(){_0x1903e0[_0x3a57('0x1a')](0xcc)[_0x3a57('0x1b')]();});}};}function handleEntityNotFound(_0x9a8a15,_0x46ac53){return function(_0x1254e4){if(!_0x1254e4){_0x9a8a15[_0x3a57('0x19')](0x194);}return _0x1254e4;};}function handleError(_0x82c7af,_0x3407d4){_0x3407d4=_0x3407d4||0x1f4;return function(_0x10526e){logger['error'](_0x10526e[_0x3a57('0x2a')]);if(_0x10526e[_0x3a57('0x2b')]){delete _0x10526e['name'];}_0x82c7af[_0x3a57('0x1a')](_0x3407d4)[_0x3a57('0x2c')](_0x10526e);};}exports['index']=function(_0x272b4f,_0x5d9c5e){var _0x4bcf82={},_0x1f7d2c={},_0xf442f9={'count':0x0,'rows':[]};var _0x383959=_[_0x3a57('0x2d')](db['AnalyticCustomReport'][_0x3a57('0x2e')],function(_0x414d76){return{'name':_0x414d76[_0x3a57('0x2f')],'type':_0x414d76[_0x3a57('0x30')]['key']};});_0x1f7d2c[_0x3a57('0x31')]=_[_0x3a57('0x2d')](_0x383959,_0x3a57('0x2b'));_0x1f7d2c[_0x3a57('0x32')]=_['keys'](_0x272b4f[_0x3a57('0x32')]);_0x1f7d2c[_0x3a57('0x33')]=_[_0x3a57('0x34')](_0x1f7d2c['model'],_0x1f7d2c[_0x3a57('0x32')]);_0x4bcf82[_0x3a57('0x35')]=_['intersection'](_0x1f7d2c[_0x3a57('0x31')],qs['fields'](_0x272b4f[_0x3a57('0x32')][_0x3a57('0x36')]));_0x4bcf82[_0x3a57('0x35')]=_0x4bcf82[_0x3a57('0x35')][_0x3a57('0x37')]?_0x4bcf82['attributes']:_0x1f7d2c[_0x3a57('0x31')];if(!_0x272b4f[_0x3a57('0x32')][_0x3a57('0x38')](_0x3a57('0x39'))){_0x4bcf82['limit']=qs[_0x3a57('0x1e')](_0x272b4f['query']['limit']);_0x4bcf82[_0x3a57('0x1d')]=qs[_0x3a57('0x1d')](_0x272b4f[_0x3a57('0x32')][_0x3a57('0x1d')]);}_0x4bcf82['order']=qs[_0x3a57('0x3a')](_0x272b4f[_0x3a57('0x32')][_0x3a57('0x3a')]);_0x4bcf82[_0x3a57('0x3b')]=qs[_0x3a57('0x33')](_[_0x3a57('0x3c')](_0x272b4f['query'],_0x1f7d2c[_0x3a57('0x33')]),_0x383959);if(_0x272b4f['query'][_0x3a57('0x3d')]){_0x4bcf82[_0x3a57('0x3b')]=_[_0x3a57('0x3e')](_0x4bcf82[_0x3a57('0x3b')],{'$or':_['map'](_0x383959,function(_0x184094){if(_0x184094['type']!==_0x3a57('0x3f')){var _0x1e6074={};_0x1e6074[_0x184094[_0x3a57('0x2b')]]={'$like':'%'+_0x272b4f[_0x3a57('0x32')][_0x3a57('0x3d')]+'%'};return _0x1e6074;}})});}_0x4bcf82=_['merge']({},_0x4bcf82,_0x272b4f['options']);var _0x4d9cba={'where':_0x4bcf82['where']};return db[_0x3a57('0x40')][_0x3a57('0x20')](_0x4d9cba)[_0x3a57('0x26')](function(_0x5a3dcd){_0xf442f9[_0x3a57('0x20')]=_0x5a3dcd;if(_0x272b4f['query'][_0x3a57('0x41')]){_0x4bcf82[_0x3a57('0x42')]=[{'all':!![]}];}return db[_0x3a57('0x40')]['findAll'](_0x4bcf82);})[_0x3a57('0x26')](function(_0xfd64a9){_0xf442f9[_0x3a57('0x43')]=_0xfd64a9;return _0xf442f9;})[_0x3a57('0x26')](respondWithFilteredResult(_0x5d9c5e,_0x4bcf82))['catch'](handleError(_0x5d9c5e,null));};exports[_0x3a57('0x44')]=function(_0x1ccc88,_0x2d1c09){var _0x45602f={'raw':![],'where':{'id':_0x1ccc88[_0x3a57('0x45')]['id']}},_0x237a2e={};_0x237a2e[_0x3a57('0x31')]=_[_0x3a57('0x46')](db[_0x3a57('0x40')][_0x3a57('0x2e')]);_0x237a2e[_0x3a57('0x32')]=_['keys'](_0x1ccc88['query']);_0x237a2e[_0x3a57('0x33')]=_['intersection'](_0x237a2e[_0x3a57('0x31')],_0x237a2e[_0x3a57('0x32')]);_0x45602f[_0x3a57('0x35')]=_['intersection'](_0x237a2e[_0x3a57('0x31')],qs[_0x3a57('0x36')](_0x1ccc88[_0x3a57('0x32')]['fields']));_0x45602f['attributes']=_0x45602f[_0x3a57('0x35')]['length']?_0x45602f['attributes']:_0x237a2e[_0x3a57('0x31')];if(_0x1ccc88[_0x3a57('0x32')][_0x3a57('0x41')]){_0x45602f[_0x3a57('0x42')]=[{'all':!![]}];}_0x45602f=_[_0x3a57('0x3e')]({},_0x45602f,_0x1ccc88[_0x3a57('0x47')]);return db['AnalyticCustomReport']['find'](_0x45602f)[_0x3a57('0x26')](handleEntityNotFound(_0x2d1c09,null))[_0x3a57('0x26')](respondWithResult(_0x2d1c09,null))[_0x3a57('0x48')](handleError(_0x2d1c09,null));};exports[_0x3a57('0x49')]=function(_0x1f0f81,_0x18db47){return db[_0x3a57('0x40')][_0x3a57('0x49')](_0x1f0f81['body'],{})[_0x3a57('0x26')](function(_0x5a6d16){var _0x2cadbf=_0x1f0f81[_0x3a57('0x4a')][_0x3a57('0x27')]({'plain':!![]});if(!_0x2cadbf)throw new Error(_0x3a57('0x4b'));if(_0x2cadbf[_0x3a57('0x4c')]===_0x3a57('0x4a')){var _0x41cffb=_0x5a6d16[_0x3a57('0x27')]({'plain':!![]});var _0x289b0b='Reports';return db[_0x3a57('0x4d')][_0x3a57('0x4e')]({'where':{'name':_0x289b0b,'userProfileId':_0x2cadbf['userProfileId']},'raw':!![]})[_0x3a57('0x26')](function(_0x4fdeff){if(_0x4fdeff&&_0x4fdeff[_0x3a57('0x4f')]===0x0){return db['UserProfileResource'][_0x3a57('0x49')]({'name':_0x41cffb[_0x3a57('0x2b')],'resourceId':_0x41cffb['id'],'type':_0x3a57('0x28'),'sectionId':_0x4fdeff['id']},{})[_0x3a57('0x26')](function(){return _0x5a6d16;});}else{return _0x5a6d16;}})[_0x3a57('0x48')](function(_0x824c28){logger[_0x3a57('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x824c28);throw _0x824c28;});}return _0x5a6d16;})[_0x3a57('0x26')](respondWithResult(_0x18db47,0xc9))['catch'](handleError(_0x18db47,null));};exports['update']=function(_0x564e85,_0x19b375){if(_0x564e85['body']['id']){delete _0x564e85[_0x3a57('0x51')]['id'];}return db['AnalyticCustomReport'][_0x3a57('0x4e')]({'where':{'id':_0x564e85[_0x3a57('0x45')]['id']}})['then'](handleEntityNotFound(_0x19b375,null))[_0x3a57('0x26')](saveUpdates(_0x564e85[_0x3a57('0x51')],null))[_0x3a57('0x26')](respondWithResult(_0x19b375,null))[_0x3a57('0x48')](handleError(_0x19b375,null));};exports[_0x3a57('0x52')]=function(_0x44f250,_0x1fe3b8){return db[_0x3a57('0x40')]['find']({'where':{'id':_0x44f250[_0x3a57('0x45')]['id']}})[_0x3a57('0x26')](handleEntityNotFound(_0x1fe3b8,null))[_0x3a57('0x26')](removeEntity(_0x1fe3b8,null))[_0x3a57('0x48')](handleError(_0x1fe3b8,null));};exports['preview']=function(_0x3ec915,_0x28bdf3){var _0x3e8bbf=0xa;var _0x231693=[_0x3a57('0x53'),_0x3a57('0x54'),_0x3a57('0x55'),_0x3a57('0x56')];var _0x12d95c={'SUM':_0x3a57('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3a57('0x58'),'MIN':_0x3a57('0x59'),'AVG':_0x3a57('0x5a'),'GROUP_CONCAT':_0x3a57('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x3a57('0x5c')};var _0x3b6b34={'SEC_TO_TIME':_0x3a57('0x5d'),'DATE':_0x3a57('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0x3a57('0x5f'),'UNIX_TIMESTAMP':_0x3a57('0x60')};var _0xabaac2=function(_0x486345){return!_['includes']([_0x3a57('0x61'),'IS\x20NOT\x20NULL',_0x3a57('0x62'),'IS\x20NOT\x20EMPTY'],_0x486345);};var _0x40308e=function(_0x456388){if(!_0x456388||!_0x456388[_0x3a57('0x63')][_0x3a57('0x37')]){return'';}for(var _0x615769='(',_0x45e805=0x0;_0x45e805<_0x456388[_0x3a57('0x63')][_0x3a57('0x37')];_0x45e805+=0x1){_0x45e805>0x0&&(_0x615769+='\x20'+_0x456388[_0x3a57('0x64')]+'\x20');_0x615769+=_0x456388[_0x3a57('0x63')][_0x45e805][_0x3a57('0x65')]?_0x40308e(_0x456388['rules'][_0x45e805][_0x3a57('0x65')]):_0x456388[_0x3a57('0x63')][_0x45e805][_0x3a57('0x66')]+'\x20'+_0x456388['rules'][_0x45e805][_0x3a57('0x67')]+(_0xabaac2(_0x456388[_0x3a57('0x63')][_0x45e805]['condition'])?'\x20'+_0x456388[_0x3a57('0x63')][_0x45e805][_0x3a57('0x68')]:'');}return _0x615769+')';};var _0x260c66={'where':{'id':_0x3ec915[_0x3a57('0x45')]['id']}},_0x4f9b98,_0x135559,_0x4a2ce0,_0x2e470b,_0x217bd6;_0x260c66=_[_0x3a57('0x3e')]({},_0x260c66,_0x3ec915[_0x3a57('0x47')]);return db['AnalyticCustomReport']['find'](_0x260c66)[_0x3a57('0x26')](function(_0x122ff2){if(_0x122ff2){_0x4f9b98=_0x122ff2;return _0x122ff2[_0x3a57('0x69')]();}return null;})[_0x3a57('0x26')](function(_0x53a3bb){if(_0x53a3bb){if(!_0x53a3bb[_0x3a57('0x37')]){throw new db[(_0x3a57('0x6a'))][(_0x3a57('0x6b'))](_0x3a57('0x6c'),0x193);}_0x135559=_0x53a3bb;return db[_0x3a57('0x6d')][_0x3a57('0x6e')]({'raw':!![]});}return null;})[_0x3a57('0x26')](function(_0x2434f4){if(_0x2434f4){_0x4a2ce0=_[_0x3a57('0x6f')](_0x2434f4,'id');var _0xd2c2bd;var _0x11d46c=squel[_0x3a57('0x70')]();_0x11d46c[_0x3a57('0x71')](_0x4f9b98['table']);for(var _0x4db123=0x0;_0x4db123<_0x135559[_0x3a57('0x37')];_0x4db123+=0x1){_0xd2c2bd=_0x135559[_0x4db123][_0x3a57('0x72')]?_0x4a2ce0[_0x135559[_0x4db123][_0x3a57('0x72')]]['metric']:_0x135559[_0x4db123][_0x3a57('0x66')];_0xd2c2bd=_0x135559[_0x4db123][_0x3a57('0x73')]?_['replace'](_0x12d95c[_0x135559[_0x4db123][_0x3a57('0x73')]],'%s',_0xd2c2bd):_0xd2c2bd;_0xd2c2bd=_0x135559[_0x4db123][_0x3a57('0x74')]?_[_0x3a57('0x75')](_0x3b6b34[_0x135559[_0x4db123][_0x3a57('0x74')]],'%s',_0xd2c2bd):_0xd2c2bd;if(_0x135559[_0x4db123][_0x3a57('0x76')]){_0x11d46c['group'](_0xd2c2bd);}_0x135559[_0x4db123][_0x3a57('0x77')]&&_0x11d46c[_0x3a57('0x78')](_0xd2c2bd,_0x135559[_0x4db123][_0x3a57('0x77')]===_0x3a57('0x79')?![]:!![]);_0x11d46c['field'](_0xd2c2bd,_0x135559[_0x4db123][_0x3a57('0x7a')]||_0xd2c2bd);}if(_0x4f9b98[_0x3a57('0x7b')]){_0x4f9b98[_0x3a57('0x7b')]=JSON[_0x3a57('0x7c')](_0x4f9b98[_0x3a57('0x7b')]);for(var _0x5581d9=0x0;_0x5581d9<_0x4f9b98[_0x3a57('0x7b')][_0x3a57('0x37')];_0x5581d9+=0x1){if(_0x4f9b98[_0x3a57('0x7b')][_0x5581d9]['type']&&_[_0x3a57('0x7d')](_0x231693,_0x4f9b98[_0x3a57('0x7b')][_0x5581d9][_0x3a57('0x30')])&&_0x4f9b98[_0x3a57('0x7b')][_0x5581d9]['parentKey']&&_0x4f9b98['joins'][_0x5581d9]['foreignTable']&&_0x4f9b98[_0x3a57('0x7b')][_0x5581d9][_0x3a57('0x7e')]){_0x11d46c[_0x4f9b98[_0x3a57('0x7b')][_0x5581d9][_0x3a57('0x30')]](_0x4f9b98[_0x3a57('0x7b')][_0x5581d9]['foreignTable'],null,util[_0x3a57('0x74')]('%s.%s\x20=\x20%s.%s',_0x4f9b98[_0x3a57('0x7f')],_0x4f9b98[_0x3a57('0x7b')][_0x5581d9]['parentKey'],_0x4f9b98[_0x3a57('0x7b')][_0x5581d9][_0x3a57('0x80')],_0x4f9b98['joins'][_0x5581d9][_0x3a57('0x7e')]));}}}if(_0x4f9b98[_0x3a57('0x81')]){_0x4f9b98[_0x3a57('0x81')]=JSON[_0x3a57('0x7c')](_0x4f9b98['conditions']);_0x11d46c['where'](_0x40308e(_0x4f9b98[_0x3a57('0x81')][_0x3a57('0x65')]));}_0x217bd6=_0x11d46c['clone']();_0x11d46c['limit'](_0x3e8bbf);_0x11d46c['offset'](0x0);logger[_0x3a57('0x82')](_0x3a57('0x83'),_0x11d46c[_0x3a57('0x84')]());return dbH[_0x3a57('0x85')][_0x3a57('0x32')](_0x11d46c[_0x3a57('0x84')](),{'type':dbH[_0x3a57('0x85')][_0x3a57('0x86')][_0x3a57('0x87')]});}})[_0x3a57('0x26')](respondWithResult(_0x28bdf3,null))[_0x3a57('0x48')](handleError(_0x28bdf3,null));};function runReport(_0x3ff690,_0x449f92,_0x157395){var _0x18b9fe=_0x449f92['name'];var _0x40f970=0xa;var _0x3d2246=['join',_0x3a57('0x54'),_0x3a57('0x55'),_0x3a57('0x56')];var _0xfd7d10={'SUM':_0x3a57('0x57'),'COUNT':_0x3a57('0x88'),'COUNT DISTINCT':_0x3a57('0x89'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x3a57('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x3a57('0x8a'),'GROUP_CONCAT DESC':_0x3a57('0x5c')};var _0x41ac32={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x3a57('0x5e'),'HOUR':_0x3a57('0x8b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4b74f6=function(_0x17ac25){return!_['includes']([_0x3a57('0x61'),'IS\x20NOT\x20NULL',_0x3a57('0x62'),_0x3a57('0x8c')],_0x17ac25);};var _0x4e6e95=function(_0x335f8c){if(!_0x335f8c||!_0x335f8c[_0x3a57('0x63')]['length']){return'';}for(var _0x1ccff0='(',_0x28f3b0=0x0;_0x28f3b0<_0x335f8c[_0x3a57('0x63')]['length'];_0x28f3b0+=0x1){_0x28f3b0>0x0&&(_0x1ccff0+='\x20'+_0x335f8c[_0x3a57('0x64')]+'\x20');_0x1ccff0+=_0x335f8c[_0x3a57('0x63')][_0x28f3b0][_0x3a57('0x65')]?_0x4e6e95(_0x335f8c[_0x3a57('0x63')][_0x28f3b0][_0x3a57('0x65')]):_0x335f8c[_0x3a57('0x63')][_0x28f3b0][_0x3a57('0x66')]+'\x20'+_0x335f8c['rules'][_0x28f3b0][_0x3a57('0x67')]+(_0x4b74f6(_0x335f8c[_0x3a57('0x63')][_0x28f3b0]['condition'])?'\x20'+_0x335f8c[_0x3a57('0x63')][_0x28f3b0][_0x3a57('0x68')]:'');}return _0x1ccff0+')';};var _0x33e574={'where':{'id':_0x3ff690['id']}},_0x23a623,_0x3aafeb,_0x2b0816,_0x6c2bf2,_0x3bf411;_0x33e574=_[_0x3a57('0x3e')]({},_0x33e574,_0x157395);return db[_0x3a57('0x40')]['find'](_0x33e574)['then'](function(_0x485eee){if(_0x485eee){_0x23a623=_0x485eee;return _0x485eee['getFields']();}return null;})[_0x3a57('0x26')](function(_0x259591){if(_0x259591){if(!_0x259591[_0x3a57('0x37')]){throw new db[(_0x3a57('0x6a'))][(_0x3a57('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3aafeb=_0x259591;return db[_0x3a57('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x3a57('0x26')](function(_0x4264a3){if(_0x4264a3){_0x2b0816=_[_0x3a57('0x6f')](_0x4264a3,'id');var _0x45726d;var _0x13960e=squel['select']();_0x13960e[_0x3a57('0x71')](_0x23a623[_0x3a57('0x7f')]);for(var _0x32390a=0x0;_0x32390a<_0x3aafeb[_0x3a57('0x37')];_0x32390a+=0x1){_0x45726d=_0x3aafeb[_0x32390a][_0x3a57('0x72')]?_0x2b0816[_0x3aafeb[_0x32390a][_0x3a57('0x72')]][_0x3a57('0x8d')]:_0x3aafeb[_0x32390a][_0x3a57('0x66')];_0x45726d=_0x3aafeb[_0x32390a][_0x3a57('0x73')]?_[_0x3a57('0x75')](_0xfd7d10[_0x3aafeb[_0x32390a][_0x3a57('0x73')]],'%s',_0x45726d):_0x45726d;_0x45726d=_0x3aafeb[_0x32390a][_0x3a57('0x74')]?_['replace'](_0x41ac32[_0x3aafeb[_0x32390a][_0x3a57('0x74')]],'%s',_0x45726d):_0x45726d;if(_0x3aafeb[_0x32390a][_0x3a57('0x76')]){_0x13960e[_0x3a57('0x65')](_0x45726d);}_0x3aafeb[_0x32390a][_0x3a57('0x77')]&&_0x13960e['order'](_0x45726d,_0x3aafeb[_0x32390a][_0x3a57('0x77')]===_0x3a57('0x79')?![]:!![]);_0x13960e[_0x3a57('0x66')](_0x45726d,_0x3aafeb[_0x32390a][_0x3a57('0x7a')]||_0x45726d);}if(_0x23a623[_0x3a57('0x7b')]){_0x23a623['joins']=JSON[_0x3a57('0x7c')](_0x23a623[_0x3a57('0x7b')]);for(var _0x10ccc1=0x0;_0x10ccc1<_0x23a623[_0x3a57('0x7b')][_0x3a57('0x37')];_0x10ccc1+=0x1){if(_0x23a623[_0x3a57('0x7b')][_0x10ccc1][_0x3a57('0x30')]&&_[_0x3a57('0x7d')](_0x3d2246,_0x23a623[_0x3a57('0x7b')][_0x10ccc1][_0x3a57('0x30')])&&_0x23a623[_0x3a57('0x7b')][_0x10ccc1][_0x3a57('0x8e')]&&_0x23a623[_0x3a57('0x7b')][_0x10ccc1][_0x3a57('0x80')]&&_0x23a623[_0x3a57('0x7b')][_0x10ccc1][_0x3a57('0x7e')]){_0x13960e[_0x23a623[_0x3a57('0x7b')][_0x10ccc1]['type']](_0x23a623['joins'][_0x10ccc1]['foreignTable'],null,util[_0x3a57('0x74')](_0x3a57('0x8f'),_0x23a623[_0x3a57('0x7f')],_0x23a623[_0x3a57('0x7b')][_0x10ccc1][_0x3a57('0x8e')],_0x23a623[_0x3a57('0x7b')][_0x10ccc1]['foreignTable'],_0x23a623[_0x3a57('0x7b')][_0x10ccc1]['foreignKey']));}}}if(_0x23a623['conditions']){_0x23a623[_0x3a57('0x81')]=JSON['parse'](_0x23a623[_0x3a57('0x81')]);_0x13960e[_0x3a57('0x3b')](_0x4e6e95(_0x23a623['conditions']['group']));}_0x3bf411=_0x13960e[_0x3a57('0x90')]();_0x13960e[_0x3a57('0x1e')](_0x40f970);_0x13960e[_0x3a57('0x1d')](0x0);return;}})['then'](function(){if(_0x449f92[_0x3a57('0x91')]===_0x3a57('0x92')){return null;}var _0x1953b9=_['merge'](_0x449f92,{'name':_0x449f92[_0x3a57('0x93')]||_0x449f92['name']||_0x23a623[_0x3a57('0x2b')],'basename':_0x18b9fe,'savename':util[_0x3a57('0x74')](_0x3a57('0x94'),_0x449f92[_0x3a57('0x2b')]||_0x23a623['name'],require(_0x3a57('0x95'))[_0x3a57('0x96')](0x4),_0x449f92[_0x3a57('0x91')]||_0x3a57('0x97')),'reportId':_0x23a623['id'],'reportType':_0x3a57('0x98')});return db[_0x3a57('0x99')][_0x3a57('0x49')](_0x1953b9,{'raw':!![]});})[_0x3a57('0x26')](function(_0x3919e2){if(_0x23a623[_0x3a57('0x7f')]===_0x3a57('0x9a')){_0x3bf411['where'](_0x23a623[_0x3a57('0x7f')]+_0x3a57('0x9b'),_0x449f92[_0x3a57('0x9c')],_0x449f92[_0x3a57('0x9d')]);}else{_0x3bf411[_0x3a57('0x3b')](_0x23a623['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x449f92[_0x3a57('0x9c')],_0x449f92[_0x3a57('0x9d')]);}if(_0x3919e2){logger['info'](_0x3a57('0x9e'),_0x3bf411[_0x3a57('0x84')]());require('child_process')[_0x3a57('0x9f')](path[_0x3a57('0x53')](__dirname,_0x3a57('0xa0'),_0x3919e2['output']),[_0x3919e2['id'],_0x3bf411[_0x3a57('0x84')](),path[_0x3a57('0x53')](__dirname,_0x3a57('0xa1'),_0x3919e2[_0x3a57('0xa2')]),_0x18b9fe]);return _0x3919e2;}else{var _0x13a9a5=squel['select']();_0x13a9a5['from']('('+_0x3bf411[_0x3a57('0x84')]()+')',_0x3a57('0xa3'));_0x13a9a5[_0x3a57('0x66')](_0x3a57('0xa4'),_0x3a57('0x20'));_0x3bf411[_0x3a57('0x1e')](_0x449f92[_0x3a57('0x1e')]||_0x40f970);_0x3bf411[_0x3a57('0x1d')](_0x449f92['offset']||0x0);return dbH[_0x3a57('0x85')]['query'](_0x13a9a5['toString'](),{'type':dbH[_0x3a57('0x85')][_0x3a57('0x86')][_0x3a57('0x87')]})[_0x3a57('0x26')](function(_0x57502e){if(!_0x57502e[_0x3a57('0x37')]){_0x6c2bf2=0x0;}else{_0x6c2bf2=_0x57502e[0x0][_0x3a57('0x20')]||0x0;}return dbH[_0x3a57('0x85')][_0x3a57('0x32')](_0x3bf411[_0x3a57('0x84')](),{'type':dbH[_0x3a57('0x85')][_0x3a57('0x86')][_0x3a57('0x87')]});})['then'](function(_0x5c740b){return{'rows':_0x5c740b||[],'count':_0x6c2bf2};});}});}exports[_0x3a57('0xa5')]=function(_0x696ec2,_0x40c87f){return runReport(_0x696ec2[_0x3a57('0x45')],_0x696ec2['query'],_0x696ec2[_0x3a57('0x47')])[_0x3a57('0x26')](respondWithResult(_0x40c87f,null))[_0x3a57('0x48')](handleError(_0x40c87f,null));};exports[_0x3a57('0xa6')]=runReport;exports['query']=function(_0x2e2208,_0x46ee2e){var _0x109b18=0xa;var _0x686061=[_0x3a57('0x53'),_0x3a57('0x54'),_0x3a57('0x55'),_0x3a57('0x56')];var _0x11a0a5={'SUM':'SUM(%s)','COUNT':_0x3a57('0x88'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3a57('0x58'),'MIN':_0x3a57('0x59'),'AVG':_0x3a57('0x5a'),'GROUP_CONCAT':_0x3a57('0x5b'),'GROUP_CONCAT ASC':_0x3a57('0x8a'),'GROUP_CONCAT DESC':_0x3a57('0x5c')};var _0x305885={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x3a57('0x5e'),'HOUR':_0x3a57('0x8b'),'ROUND':_0x3a57('0x5f'),'UNIX_TIMESTAMP':_0x3a57('0x60')};var _0x21face=function(_0x288a58){return!_['includes'](['IS\x20NULL',_0x3a57('0xa7'),_0x3a57('0x62'),'IS\x20NOT\x20EMPTY'],_0x288a58);};var _0x2eb14f=function(_0x290407){if(!_0x290407||!_0x290407['rules']['length']){return'';}for(var _0x1d4129='(',_0x1d43e5=0x0;_0x1d43e5<_0x290407[_0x3a57('0x63')][_0x3a57('0x37')];_0x1d43e5+=0x1){_0x1d43e5>0x0&&(_0x1d4129+='\x20'+_0x290407[_0x3a57('0x64')]+'\x20');_0x1d4129+=_0x290407[_0x3a57('0x63')][_0x1d43e5][_0x3a57('0x65')]?_0x2eb14f(_0x290407[_0x3a57('0x63')][_0x1d43e5]['group']):_0x290407[_0x3a57('0x63')][_0x1d43e5][_0x3a57('0x66')]+'\x20'+_0x290407[_0x3a57('0x63')][_0x1d43e5]['condition']+(_0x21face(_0x290407[_0x3a57('0x63')][_0x1d43e5][_0x3a57('0x67')])?'\x20'+_0x290407[_0x3a57('0x63')][_0x1d43e5][_0x3a57('0x68')]:'');}return _0x1d4129+')';};var _0x21da4a={'where':{'id':_0x2e2208['params']['id']}},_0xf9c9a9,_0x36b89d,_0x5291ca,_0x2b8f3d,_0x56c175;_0x21da4a=_[_0x3a57('0x3e')]({},_0x21da4a,_0x2e2208['options']);return db[_0x3a57('0x40')][_0x3a57('0x4e')](_0x21da4a)['then'](function(_0x276077){if(_0x276077){_0xf9c9a9=_0x276077;return _0x276077[_0x3a57('0x69')]();}return null;})[_0x3a57('0x26')](function(_0x148709){if(_0x148709){if(!_0x148709['length']){throw new db[(_0x3a57('0x6a'))][(_0x3a57('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x36b89d=_0x148709;return db[_0x3a57('0x6d')][_0x3a57('0x6e')]({'raw':!![]});}return null;})['then'](function(_0xa88412){if(_0xa88412){_0x5291ca=_[_0x3a57('0x6f')](_0xa88412,'id');var _0x1a7608;var _0x119869=squel[_0x3a57('0x70')]();_0x119869[_0x3a57('0x71')](_0xf9c9a9[_0x3a57('0x7f')]);for(var _0x36ea0b=0x0;_0x36ea0b<_0x36b89d[_0x3a57('0x37')];_0x36ea0b+=0x1){_0x1a7608=_0x36b89d[_0x36ea0b][_0x3a57('0x72')]?_0x5291ca[_0x36b89d[_0x36ea0b]['MetricId']][_0x3a57('0x8d')]:_0x36b89d[_0x36ea0b][_0x3a57('0x66')];_0x1a7608=_0x36b89d[_0x36ea0b][_0x3a57('0x73')]?_[_0x3a57('0x75')](_0x11a0a5[_0x36b89d[_0x36ea0b][_0x3a57('0x73')]],'%s',_0x1a7608):_0x1a7608;_0x1a7608=_0x36b89d[_0x36ea0b][_0x3a57('0x74')]?_[_0x3a57('0x75')](_0x305885[_0x36b89d[_0x36ea0b][_0x3a57('0x74')]],'%s',_0x1a7608):_0x1a7608;if(_0x36b89d[_0x36ea0b][_0x3a57('0x76')]){_0x119869[_0x3a57('0x65')](_0x1a7608);}_0x36b89d[_0x36ea0b][_0x3a57('0x77')]&&_0x119869[_0x3a57('0x78')](_0x1a7608,_0x36b89d[_0x36ea0b][_0x3a57('0x77')]===_0x3a57('0x79')?![]:!![]);_0x119869[_0x3a57('0x66')](_0x1a7608,_0x36b89d[_0x36ea0b][_0x3a57('0x7a')]||_0x1a7608);}if(_0xf9c9a9['joins']){_0xf9c9a9[_0x3a57('0x7b')]=JSON['parse'](_0xf9c9a9['joins']);for(var _0x58a66c=0x0;_0x58a66c<_0xf9c9a9[_0x3a57('0x7b')][_0x3a57('0x37')];_0x58a66c+=0x1){if(_0xf9c9a9[_0x3a57('0x7b')][_0x58a66c][_0x3a57('0x30')]&&_[_0x3a57('0x7d')](_0x686061,_0xf9c9a9['joins'][_0x58a66c]['type'])&&_0xf9c9a9['joins'][_0x58a66c][_0x3a57('0x8e')]&&_0xf9c9a9[_0x3a57('0x7b')][_0x58a66c]['foreignTable']&&_0xf9c9a9[_0x3a57('0x7b')][_0x58a66c][_0x3a57('0x7e')]){_0x119869[_0xf9c9a9[_0x3a57('0x7b')][_0x58a66c][_0x3a57('0x30')]](_0xf9c9a9[_0x3a57('0x7b')][_0x58a66c][_0x3a57('0x80')],null,util[_0x3a57('0x74')]('%s.%s\x20=\x20%s.%s',_0xf9c9a9[_0x3a57('0x7f')],_0xf9c9a9[_0x3a57('0x7b')][_0x58a66c][_0x3a57('0x8e')],_0xf9c9a9[_0x3a57('0x7b')][_0x58a66c][_0x3a57('0x80')],_0xf9c9a9[_0x3a57('0x7b')][_0x58a66c][_0x3a57('0x7e')]));}}}if(_0xf9c9a9[_0x3a57('0x81')]){_0xf9c9a9[_0x3a57('0x81')]=JSON[_0x3a57('0x7c')](_0xf9c9a9[_0x3a57('0x81')]);_0x119869['where'](_0x2eb14f(_0xf9c9a9[_0x3a57('0x81')]['group']));}_0x56c175=_0x119869[_0x3a57('0x90')]();_0x119869['limit'](_0x109b18);_0x119869[_0x3a57('0x1d')](0x0);logger[_0x3a57('0x82')](_0x3a57('0x83'),_0x119869[_0x3a57('0x84')]());return dbH['sequelize']['query'](_0x119869[_0x3a57('0x84')](),{'type':dbH[_0x3a57('0x85')]['QueryTypes'][_0x3a57('0x87')]});}})[_0x3a57('0x26')](function(){return{'sql':_0x56c175['toString']()};})['then'](respondWithResult(_0x46ee2e,null))[_0x3a57('0x48')](handleError(_0x46ee2e,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 41f0d5c..5b3a406 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 _0x51d4=['../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','api','bluebird','rimraf'];(function(_0x5c6ceb,_0x4ed099){var _0x28821b=function(_0x391add){while(--_0x391add){_0x5c6ceb['push'](_0x5c6ceb['shift']());}};_0x28821b(++_0x4ed099);}(_0x51d4,0x13b));var _0x451d=function(_0x3d658e,_0x513bec){_0x3d658e=_0x3d658e-0x0;var _0x38c2e7=_0x51d4[_0x3d658e];return _0x38c2e7;};'use strict';var _=require(_0x451d('0x0'));var util=require(_0x451d('0x1'));var logger=require('../../config/logger')(_0x451d('0x2'));var moment=require('moment');var BPromise=require(_0x451d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x451d('0x4'));var config=require(_0x451d('0x5'));var attributes=require(_0x451d('0x6'));module[_0x451d('0x7')]=function(_0x60e192,_0x24c0fe){return _0x60e192['define'](_0x451d('0x8'),attributes,{'tableName':_0x451d('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa5ef=['./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports','lodash','moment','path','rimraf','../../config/environment'];(function(_0x4e4b82,_0xf4df54){var _0x2c874e=function(_0x4a41d8){while(--_0x4a41d8){_0x4e4b82['push'](_0x4e4b82['shift']());}};_0x2c874e(++_0xf4df54);}(_0xa5ef,0xeb));var _0xfa5e=function(_0x41c842,_0x3865f6){_0x41c842=_0x41c842-0x0;var _0x15ee6b=_0xa5ef[_0x41c842];return _0x15ee6b;};'use strict';var _=require(_0xfa5e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xfa5e('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa5e('0x2'));var rimraf=require(_0xfa5e('0x3'));var config=require(_0xfa5e('0x4'));var attributes=require(_0xfa5e('0x5'));module['exports']=function(_0x3c96e7,_0x369260){return _0x3c96e7['define'](_0xfa5e('0x6'),attributes,{'tableName':_0xfa5e('0x7'),'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 bc60ce8..6ab3129 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 _0x4590=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent'];(function(_0x474bb8,_0x1873e9){var _0x1507db=function(_0x58ba7c){while(--_0x58ba7c){_0x474bb8['push'](_0x474bb8['shift']());}};_0x1507db(++_0x1873e9);}(_0x4590,0x159));var _0x0459=function(_0x2e1cc4,_0x5e93f6){_0x2e1cc4=_0x2e1cc4-0x0;var _0x50be05=_0x4590[_0x2e1cc4];return _0x50be05;};'use strict';var _=require(_0x0459('0x0'));var util=require(_0x0459('0x1'));var moment=require(_0x0459('0x2'));var BPromise=require(_0x0459('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0459('0x4'));var db=require(_0x0459('0x5'))['db'];var utils=require(_0x0459('0x6'));var logger=require(_0x0459('0x7'))(_0x0459('0x8'));var config=require(_0x0459('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0459('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27128d,_0x5ac42c,_0x11f51c){return new BPromise(function(_0x149623,_0xed1a41){return client[_0x0459('0xb')](_0x27128d,_0x11f51c)['then'](function(_0x36bdd1){logger[_0x0459('0xc')](_0x0459('0xd'),_0x5ac42c,_0x0459('0xe'));logger['debug'](_0x0459('0xf'),_0x5ac42c,'request\x20sent',JSON[_0x0459('0x10')](_0x36bdd1));if(_0x36bdd1[_0x0459('0x11')]){if(_0x36bdd1['error']['code']===0x1f4){logger[_0x0459('0x11')](_0x0459('0xd'),_0x5ac42c,_0x36bdd1['error'][_0x0459('0x12')]);return _0xed1a41(_0x36bdd1['error'][_0x0459('0x12')]);}logger[_0x0459('0x11')](_0x0459('0xd'),_0x5ac42c,_0x36bdd1[_0x0459('0x11')]['message']);return _0x149623(_0x36bdd1[_0x0459('0x11')][_0x0459('0x12')]);}else{logger[_0x0459('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5ac42c,_0x0459('0xe'));_0x149623(_0x36bdd1[_0x0459('0x13')][_0x0459('0x12')]);}})['catch'](function(_0x2d77fa){logger[_0x0459('0x11')](_0x0459('0xd'),_0x5ac42c,_0x2d77fa);_0xed1a41(_0x2d77fa);});});}
\ No newline at end of file
+var _0x34b5=['rpc','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x5ad771,_0x34186f){var _0x5b5dce=function(_0x5ad0fb){while(--_0x5ad0fb){_0x5ad771['push'](_0x5ad771['shift']());}};_0x5b5dce(++_0x34186f);}(_0x34b5,0xe8));var _0x534b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x34b5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x534b('0x0'));var util=require(_0x534b('0x1'));var moment=require(_0x534b('0x2'));var BPromise=require(_0x534b('0x3'));var rs=require(_0x534b('0x4'));var fs=require('fs');var Redis=require(_0x534b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x534b('0x6'));var logger=require(_0x534b('0x7'))(_0x534b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x534b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d8866,_0x5666cb,_0x1538a7){return new BPromise(function(_0xb4df6b,_0x4a620d){return client[_0x534b('0xa')](_0x3d8866,_0x1538a7)['then'](function(_0x3f8025){logger[_0x534b('0xb')](_0x534b('0xc'),_0x5666cb,'request\x20sent');logger['debug'](_0x534b('0xd'),_0x5666cb,_0x534b('0xe'),JSON[_0x534b('0xf')](_0x3f8025));if(_0x3f8025[_0x534b('0x10')]){if(_0x3f8025[_0x534b('0x10')][_0x534b('0x11')]===0x1f4){logger[_0x534b('0x10')](_0x534b('0xc'),_0x5666cb,_0x3f8025['error'][_0x534b('0x12')]);return _0x4a620d(_0x3f8025[_0x534b('0x10')][_0x534b('0x12')]);}logger['error'](_0x534b('0xc'),_0x5666cb,_0x3f8025[_0x534b('0x10')][_0x534b('0x12')]);return _0xb4df6b(_0x3f8025[_0x534b('0x10')][_0x534b('0x12')]);}else{logger[_0x534b('0xb')](_0x534b('0xc'),_0x5666cb,'request\x20sent');_0xb4df6b(_0x3f8025[_0x534b('0x13')]['message']);}})['catch'](function(_0x4b3b78){logger[_0x534b('0x10')](_0x534b('0xc'),_0x5666cb,_0x4b3b78);_0x4a620d(_0x4b3b78);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 9e78d3e..e05f32b 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 _0x101b=['/:id/preview','preview','/:id/run','get','/:id/query','create','put','update','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','/:id'];(function(_0x40fd89,_0x53973a){var _0x5e6192=function(_0x553e54){while(--_0x553e54){_0x40fd89['push'](_0x40fd89['shift']());}};_0x5e6192(++_0x53973a);}(_0x101b,0x183));var _0xb101=function(_0x5350cc,_0x46aeeb){_0x5350cc=_0x5350cc-0x0;var _0x2f0a16=_0x101b[_0x5350cc];return _0x2f0a16;};'use strict';var multer=require(_0xb101('0x0'));var util=require(_0xb101('0x1'));var path=require(_0xb101('0x2'));var timeout=require(_0xb101('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb101('0x4'));var auth=require(_0xb101('0x5'));var interaction=require(_0xb101('0x6'));var config=require(_0xb101('0x7'));var controller=require(_0xb101('0x8'));router['get']('/',auth[_0xb101('0x9')](),controller[_0xb101('0xa')]);router['get'](_0xb101('0xb'),auth[_0xb101('0x9')](),controller['show']);router['get'](_0xb101('0xc'),auth['isAuthenticated'](),controller[_0xb101('0xd')]);router['get'](_0xb101('0xe'),auth[_0xb101('0x9')](),controller['run']);router[_0xb101('0xf')](_0xb101('0x10'),auth[_0xb101('0x9')](),controller['query']);router['post']('/',auth[_0xb101('0x9')](),controller[_0xb101('0x11')]);router[_0xb101('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xb101('0x13')]);router['delete'](_0xb101('0xb'),auth['isAuthenticated'](),controller[_0xb101('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x9eac=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','query','post','create','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4f3463,_0x5a1ee7){var _0x5f0e49=function(_0x41419f){while(--_0x41419f){_0x4f3463['push'](_0x4f3463['shift']());}};_0x5f0e49(++_0x5a1ee7);}(_0x9eac,0x152));var _0xc9ea=function(_0x2becba,_0x4ea656){_0x2becba=_0x2becba-0x0;var _0x90b5dd=_0x9eac[_0x2becba];return _0x90b5dd;};'use strict';var multer=require('multer');var util=require(_0xc9ea('0x0'));var path=require(_0xc9ea('0x1'));var timeout=require(_0xc9ea('0x2'));var express=require(_0xc9ea('0x3'));var router=express[_0xc9ea('0x4')]();var fs_extra=require(_0xc9ea('0x5'));var auth=require(_0xc9ea('0x6'));var interaction=require(_0xc9ea('0x7'));var config=require(_0xc9ea('0x8'));var controller=require('./analyticCustomReport.controller');router[_0xc9ea('0x9')]('/',auth[_0xc9ea('0xa')](),controller['index']);router[_0xc9ea('0x9')](_0xc9ea('0xb'),auth[_0xc9ea('0xa')](),controller[_0xc9ea('0xc')]);router[_0xc9ea('0x9')](_0xc9ea('0xd'),auth[_0xc9ea('0xa')](),controller[_0xc9ea('0xe')]);router[_0xc9ea('0x9')](_0xc9ea('0xf'),auth[_0xc9ea('0xa')](),controller[_0xc9ea('0x10')]);router[_0xc9ea('0x9')]('/:id/query',auth['isAuthenticated'](),controller[_0xc9ea('0x11')]);router[_0xc9ea('0x12')]('/',auth['isAuthenticated'](),controller[_0xc9ea('0x13')]);router['put'](_0xc9ea('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xc9ea('0x14')](_0xc9ea('0xb'),auth[_0xc9ea('0xa')](),controller[_0xc9ea('0x15')]);module[_0xc9ea('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index a381cbd..a902109 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 _0x7c09=['exports','STRING','TEXT'];(function(_0x20edb2,_0x127ca7){var _0x24e94a=function(_0x52163a){while(--_0x52163a){_0x20edb2['push'](_0x20edb2['shift']());}};_0x24e94a(++_0x127ca7);}(_0x7c09,0x102));var _0x97c0=function(_0x4196b4,_0x236af2){_0x4196b4=_0x4196b4-0x0;var _0x420b40=_0x7c09[_0x4196b4];return _0x420b40;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x97c0('0x1')]},'table':{'type':Sequelize[_0x97c0('0x1')]},'conditions':{'type':Sequelize[_0x97c0('0x2')]},'joins':{'type':Sequelize[_0x97c0('0x2')]}};
\ No newline at end of file
+var _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x111d40,_0x14ce0c){var _0x261ce8=function(_0x3cced1){while(--_0x3cced1){_0x111d40['push'](_0x111d40['shift']());}};_0x261ce8(++_0x14ce0c);}(_0xac9d,0x14d));var _0xdac9=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xac9d[_0x4a747d];return _0x3a5b5c;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index e607e72..55420af 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 _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(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x15b659,_0x3d8086){_0x15b659=_0x15b659-0x0;var _0x2b37bc=_0xc6ac[_0x15b659];return _0x2b37bc;};'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
+var _0x7a54=['options','AnalyticDefaultReport','includeAll','include','show','keys','attributes','create','body','user','role','get','Reports','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','field','function','replace','format','orderBy','DESC','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','toString','sequelize','QueryTypes','SELECT','join','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','groupBy','alias','output','web','fullPath','%s-%s.%s','generate','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','getFields','clone','Limited\x20Query:','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','then','destroy','DefaultReports','error','stack','name','index','map','fieldName','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge'];(function(_0xe5e3fb,_0x2fa636){var _0xdc5834=function(_0x5960b7){while(--_0x5960b7){_0xe5e3fb['push'](_0xe5e3fb['shift']());}};_0xdc5834(++_0x2fa636);}(_0x7a54,0x106));var _0x47a5=function(_0x5f3079,_0x5f5f2a){_0x5f3079=_0x5f3079-0x0;var _0x125893=_0x7a54[_0x5f3079];return _0x125893;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];var dbH=require(_0x47a5('0x15'))[_0x47a5('0x16')];function respondWithStatusCode(_0x5beb89,_0x44bd3e){_0x44bd3e=_0x44bd3e||0xcc;return function(_0x221b54){if(_0x221b54){return _0x5beb89[_0x47a5('0x17')](_0x44bd3e);}return _0x5beb89[_0x47a5('0x18')](_0x44bd3e)[_0x47a5('0x19')]();};}function respondWithResult(_0x620ee9,_0x3c6c46){_0x3c6c46=_0x3c6c46||0xc8;return function(_0x190faa){if(_0x190faa){return _0x620ee9['status'](_0x3c6c46)[_0x47a5('0x1a')](_0x190faa);}};}function respondWithFilteredResult(_0x11faf5,_0x3b001e){return function(_0x2a2cbb){if(_0x2a2cbb){var _0x1ef44c=typeof _0x3b001e['offset']==='undefined'&&typeof _0x3b001e[_0x47a5('0x1b')]==='undefined';var _0x5247fd=_0x2a2cbb[_0x47a5('0x1c')];var _0xaf70a6=_0x1ef44c?0x0:_0x3b001e[_0x47a5('0x1d')];var _0x1ef371=_0x1ef44c?_0x2a2cbb[_0x47a5('0x1c')]:_0x3b001e[_0x47a5('0x1d')]+_0x3b001e[_0x47a5('0x1b')];var _0xe3c618;if(_0x1ef371>=_0x5247fd){_0x1ef371=_0x5247fd;_0xe3c618=0xc8;}else{_0xe3c618=0xce;}_0x11faf5[_0x47a5('0x18')](_0xe3c618);return _0x11faf5['set'](_0x47a5('0x1e'),_0xaf70a6+'-'+_0x1ef371+'/'+_0x5247fd)[_0x47a5('0x1a')](_0x2a2cbb);}return null;};}function patchUpdates(_0x47cf3c){return function(_0x2b0360){try{jsonpatch[_0x47a5('0x1f')](_0x2b0360,_0x47cf3c,!![]);}catch(_0x36874d){return BPromise['reject'](_0x36874d);}return _0x2b0360[_0x47a5('0x20')]();};}function saveUpdates(_0x2f142b,_0x23db32){return function(_0x7a9f9e){if(_0x7a9f9e){return _0x7a9f9e['update'](_0x2f142b)[_0x47a5('0x21')](function(_0x385687){return _0x385687;});}return null;};}function removeEntity(_0x513981,_0x28747d){return function(_0xc4cd63){if(_0xc4cd63){return _0xc4cd63[_0x47a5('0x22')]()[_0x47a5('0x21')](function(){var _0x3abd6a=_0xc4cd63['get']({'plain':!![]});var _0x53078a=_0x47a5('0x23');return db['UserProfileResource'][_0x47a5('0x22')]({'where':{'type':_0x53078a,'resourceId':_0x3abd6a['id']}})['then'](function(){return _0xc4cd63;});})[_0x47a5('0x21')](function(){_0x513981[_0x47a5('0x18')](0xcc)[_0x47a5('0x19')]();});}};}function handleEntityNotFound(_0x1dac65,_0x21f296){return function(_0x3ba0b7){if(!_0x3ba0b7){_0x1dac65[_0x47a5('0x17')](0x194);}return _0x3ba0b7;};}function handleError(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0x1f4;return function(_0x361bfa){logger[_0x47a5('0x24')](_0x361bfa[_0x47a5('0x25')]);if(_0x361bfa[_0x47a5('0x26')]){delete _0x361bfa['name'];}_0x136b14[_0x47a5('0x18')](_0x16631f)['send'](_0x361bfa);};}exports[_0x47a5('0x27')]=function(_0x9ac908,_0x16901f){var _0x4d6b57={},_0x256650={},_0x625952={'count':0x0,'rows':[]};var _0x39b50b=_[_0x47a5('0x28')](db['AnalyticDefaultReport']['rawAttributes'],function(_0x6f9a12){return{'name':_0x6f9a12[_0x47a5('0x29')],'type':_0x6f9a12['type']['key']};});_0x256650[_0x47a5('0x2a')]=_[_0x47a5('0x28')](_0x39b50b,'name');_0x256650[_0x47a5('0x2b')]=_['keys'](_0x9ac908[_0x47a5('0x2b')]);_0x256650[_0x47a5('0x2c')]=_['intersection'](_0x256650['model'],_0x256650[_0x47a5('0x2b')]);_0x4d6b57['attributes']=_[_0x47a5('0x2d')](_0x256650[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x9ac908['query'][_0x47a5('0x2e')]));_0x4d6b57['attributes']=_0x4d6b57['attributes'][_0x47a5('0x2f')]?_0x4d6b57['attributes']:_0x256650[_0x47a5('0x2a')];if(!_0x9ac908['query'][_0x47a5('0x30')](_0x47a5('0x31'))){_0x4d6b57[_0x47a5('0x1b')]=qs[_0x47a5('0x1b')](_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x1b')]);_0x4d6b57[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x9ac908[_0x47a5('0x2b')]['offset']);}_0x4d6b57[_0x47a5('0x32')]=qs[_0x47a5('0x33')](_0x9ac908['query'][_0x47a5('0x33')]);_0x4d6b57[_0x47a5('0x34')]=qs[_0x47a5('0x2c')](_['pick'](_0x9ac908[_0x47a5('0x2b')],_0x256650[_0x47a5('0x2c')]),_0x39b50b);if(_0x9ac908['query'][_0x47a5('0x35')]){_0x4d6b57[_0x47a5('0x34')]=_['merge'](_0x4d6b57['where'],{'$or':_['map'](_0x39b50b,function(_0x12d9f2){if(_0x12d9f2['type']!==_0x47a5('0x36')){var _0x1f9631={};_0x1f9631[_0x12d9f2[_0x47a5('0x26')]]={'$like':'%'+_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x1f9631;}})});}_0x4d6b57=_[_0x47a5('0x37')]({},_0x4d6b57,_0x9ac908[_0x47a5('0x38')]);var _0x1f3d01={'where':_0x4d6b57[_0x47a5('0x34')]};return db[_0x47a5('0x39')][_0x47a5('0x1c')](_0x1f3d01)[_0x47a5('0x21')](function(_0x23d6d8){_0x625952['count']=_0x23d6d8;if(_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x3a')]){_0x4d6b57[_0x47a5('0x3b')]=[{'all':!![]}];}return db[_0x47a5('0x39')]['findAll'](_0x4d6b57);})[_0x47a5('0x21')](function(_0x528ef3){_0x625952['rows']=_0x528ef3;return _0x625952;})['then'](respondWithFilteredResult(_0x16901f,_0x4d6b57))['catch'](handleError(_0x16901f,null));};exports[_0x47a5('0x3c')]=function(_0x5ec4e5,_0x2bb502){var _0x3a740b={'raw':!![],'where':{'id':_0x5ec4e5['params']['id']}},_0x448610={};_0x448610[_0x47a5('0x2a')]=_[_0x47a5('0x3d')](db['AnalyticDefaultReport']['rawAttributes']);_0x448610[_0x47a5('0x2b')]=_['keys'](_0x5ec4e5[_0x47a5('0x2b')]);_0x448610[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],_0x448610[_0x47a5('0x2b')]);_0x3a740b[_0x47a5('0x3e')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x5ec4e5[_0x47a5('0x2b')][_0x47a5('0x2e')]));_0x3a740b[_0x47a5('0x3e')]=_0x3a740b[_0x47a5('0x3e')][_0x47a5('0x2f')]?_0x3a740b[_0x47a5('0x3e')]:_0x448610[_0x47a5('0x2a')];if(_0x5ec4e5['query'][_0x47a5('0x3a')]){_0x3a740b[_0x47a5('0x3b')]=[{'all':!![]}];}_0x3a740b=_['merge']({},_0x3a740b,_0x5ec4e5['options']);return db[_0x47a5('0x39')]['find'](_0x3a740b)[_0x47a5('0x21')](handleEntityNotFound(_0x2bb502,null))[_0x47a5('0x21')](respondWithResult(_0x2bb502,null))['catch'](handleError(_0x2bb502,null));};exports['create']=function(_0x3d85cc,_0x52d409){return db[_0x47a5('0x39')][_0x47a5('0x3f')](_0x3d85cc[_0x47a5('0x40')],{})[_0x47a5('0x21')](function(_0x44fe8a){var _0x26acd2=_0x3d85cc[_0x47a5('0x41')]['get']({'plain':!![]});if(!_0x26acd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26acd2[_0x47a5('0x42')]===_0x47a5('0x41')){var _0x1163e3=_0x44fe8a[_0x47a5('0x43')]({'plain':!![]});var _0x2c7020=_0x47a5('0x44');return db[_0x47a5('0x45')]['find']({'where':{'name':_0x2c7020,'userProfileId':_0x26acd2[_0x47a5('0x46')]},'raw':!![]})[_0x47a5('0x21')](function(_0x5f6a){if(_0x5f6a&&_0x5f6a['autoAssociation']===0x0){return db[_0x47a5('0x47')]['create']({'name':_0x1163e3[_0x47a5('0x26')],'resourceId':_0x1163e3['id'],'type':_0x47a5('0x23'),'sectionId':_0x5f6a['id']},{})[_0x47a5('0x21')](function(){return _0x44fe8a;});}else{return _0x44fe8a;}})[_0x47a5('0x48')](function(_0x588551){logger[_0x47a5('0x24')](_0x47a5('0x49'),_0x588551);throw _0x588551;});}return _0x44fe8a;})[_0x47a5('0x21')](respondWithResult(_0x52d409,0xc9))[_0x47a5('0x48')](handleError(_0x52d409,null));};exports[_0x47a5('0x4a')]=function(_0x6a53b3,_0x24e9f4){if(_0x6a53b3['body']['id']){delete _0x6a53b3[_0x47a5('0x40')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x6a53b3[_0x47a5('0x4c')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x24e9f4,null))[_0x47a5('0x21')](saveUpdates(_0x6a53b3['body'],null))[_0x47a5('0x21')](respondWithResult(_0x24e9f4,null))[_0x47a5('0x48')](handleError(_0x24e9f4,null));};exports[_0x47a5('0x22')]=function(_0x53871e,_0x4c5ed){return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x53871e['params']['id']}})['then'](handleEntityNotFound(_0x4c5ed,null))[_0x47a5('0x21')](removeEntity(_0x4c5ed,null))[_0x47a5('0x48')](handleError(_0x4c5ed,null));};exports['preview']=function(_0x4cf792,_0x6d6b2b){var _0x4d6a82=0xa;var _0x16bb8a=['join','left_join',_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x53eedf={'SUM':_0x47a5('0x4f'),'COUNT':_0x47a5('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x199621={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':'HOUR(%s)','ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x485e3c=function(_0x470da6){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),_0x47a5('0x5a'),'IS\x20EMPTY',_0x47a5('0x5b')],_0x470da6);};var _0x5d1550=function(_0x5cbe97){if(!_0x5cbe97||!_0x5cbe97['rules']['length']){return'';}for(var _0x212d92='(',_0x6cd4ea=0x0;_0x6cd4ea<_0x5cbe97[_0x47a5('0x5c')]['length'];_0x6cd4ea+=0x1){_0x6cd4ea>0x0&&(_0x212d92+='\x20'+_0x5cbe97['operator']+'\x20');_0x212d92+=_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]?_0x5d1550(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]):_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['field']+'\x20'+_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['condition']+(_0x485e3c(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5e')])?'\x20'+_0x5cbe97['rules'][_0x6cd4ea][_0x47a5('0x5f')]:'');}return _0x212d92+')';};var _0x345104={'where':{'id':_0x4cf792[_0x47a5('0x4c')]['id']}},_0x132854,_0x3e8274,_0x2d6494,_0x215634,_0x35cca8;_0x345104=_['merge']({},_0x345104,_0x4cf792[_0x47a5('0x38')]);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x345104)[_0x47a5('0x21')](function(_0x396cb0){if(_0x396cb0){_0x132854=_0x396cb0;return _0x396cb0['getFields']();}return null;})[_0x47a5('0x21')](function(_0xdfcecc){if(_0xdfcecc){if(!_0xdfcecc[_0x47a5('0x2f')]){throw new db[(_0x47a5('0x60'))][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x3e8274=_0xdfcecc;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x44cb90){if(_0x44cb90){_0x2d6494=_[_0x47a5('0x65')](_0x44cb90,'id');var _0x44fda9;var _0x3c0006=squel[_0x47a5('0x66')]();_0x3c0006[_0x47a5('0x67')](_0x132854['table']);for(var _0x42dd7d=0x0;_0x42dd7d<_0x3e8274[_0x47a5('0x2f')];_0x42dd7d+=0x1){_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x68')]?_0x2d6494[_0x3e8274[_0x42dd7d]['MetricId']][_0x47a5('0x69')]:_0x3e8274[_0x42dd7d][_0x47a5('0x6a')];_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6b')]?_[_0x47a5('0x6c')](_0x53eedf[_0x3e8274[_0x42dd7d]['function']],'%s',_0x44fda9):_0x44fda9;_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]?_['replace'](_0x199621[_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]],'%s',_0x44fda9):_0x44fda9;if(_0x3e8274[_0x42dd7d]['groupBy']){_0x3c0006[_0x47a5('0x5d')](_0x44fda9);}_0x3e8274[_0x42dd7d]['orderBy']&&_0x3c0006[_0x47a5('0x32')](_0x44fda9,_0x3e8274[_0x42dd7d][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x3c0006['field'](_0x44fda9,_0x3e8274[_0x42dd7d]['alias']||_0x44fda9);}if(_0x132854['joins']){_0x132854[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x70')]);for(var _0x117510=0x0;_0x117510<_0x132854['joins'][_0x47a5('0x2f')];_0x117510+=0x1){if(_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')]&&_[_0x47a5('0x58')](_0x16bb8a,_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')])&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]){_0x3c0006[_0x132854['joins'][_0x117510][_0x47a5('0x72')]](_0x132854['joins'][_0x117510][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x132854[_0x47a5('0x77')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]));}}}if(_0x132854[_0x47a5('0x78')]){_0x132854[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x78')]);_0x3c0006[_0x47a5('0x34')](_0x5d1550(_0x132854['conditions']['group']));}_0x35cca8=_0x3c0006['clone']();_0x3c0006['limit'](_0x4d6a82);_0x3c0006[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')]('Limited\x20Query:',_0x3c0006[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x3c0006[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](respondWithResult(_0x6d6b2b,null))[_0x47a5('0x48')](handleError(_0x6d6b2b,null));};function runReport(_0x1ffe3c,_0x24a6c1,_0x5e5f16){var _0x18fa31=_0x24a6c1[_0x47a5('0x26')];var _0x420671=0xa;var _0x4f35ff=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),'cross_join'];var _0x19dc8c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x592322={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':'DATE(%s)','HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0xb16bdd=function(_0x53ea2b){return!_[_0x47a5('0x58')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0x53ea2b);};var _0x5b91f7=function(_0x1926bd){if(!_0x1926bd||!_0x1926bd[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x4c25ec='(',_0x280372=0x0;_0x280372<_0x1926bd['rules'][_0x47a5('0x2f')];_0x280372+=0x1){_0x280372>0x0&&(_0x4c25ec+='\x20'+_0x1926bd[_0x47a5('0x85')]+'\x20');_0x4c25ec+=_0x1926bd[_0x47a5('0x5c')][_0x280372]['group']?_0x5b91f7(_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5d')]):_0x1926bd[_0x47a5('0x5c')][_0x280372]['field']+'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition']+(_0xb16bdd(_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition'])?'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5f')]:'');}return _0x4c25ec+')';};var _0x20a742={'where':{'id':_0x1ffe3c['id']}},_0x211fbf,_0x51738b,_0x42fcce,_0x2ae130,_0x23c393;_0x20a742=_[_0x47a5('0x37')]({},_0x20a742,_0x5e5f16);return db[_0x47a5('0x39')]['find'](_0x20a742)['then'](function(_0x569550){if(_0x569550){_0x211fbf=_0x569550;return _0x569550['getFields']();}return null;})[_0x47a5('0x21')](function(_0xa8809a){if(_0xa8809a){if(!_0xa8809a[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x51738b=_0xa8809a;return db['AnalyticMetric'][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x19acfa){if(_0x19acfa){_0x42fcce=_[_0x47a5('0x65')](_0x19acfa,'id');var _0x58dacd;var _0x4b5353=squel[_0x47a5('0x66')]();_0x4b5353[_0x47a5('0x67')](_0x211fbf['table']);for(var _0x27d422=0x0;_0x27d422<_0x51738b[_0x47a5('0x2f')];_0x27d422+=0x1){_0x58dacd=_0x51738b[_0x27d422]['MetricId']?_0x42fcce[_0x51738b[_0x27d422][_0x47a5('0x68')]][_0x47a5('0x69')]:_0x51738b[_0x27d422][_0x47a5('0x6a')];_0x58dacd=_0x51738b[_0x27d422]['function']?_[_0x47a5('0x6c')](_0x19dc8c[_0x51738b[_0x27d422]['function']],'%s',_0x58dacd):_0x58dacd;_0x58dacd=_0x51738b[_0x27d422][_0x47a5('0x6d')]?_['replace'](_0x592322[_0x51738b[_0x27d422][_0x47a5('0x6d')]],'%s',_0x58dacd):_0x58dacd;if(_0x51738b[_0x27d422][_0x47a5('0x86')]){_0x4b5353['group'](_0x58dacd);}_0x51738b[_0x27d422][_0x47a5('0x6e')]&&_0x4b5353['order'](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x4b5353[_0x47a5('0x6a')](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x87')]||_0x58dacd);}if(_0x211fbf['joins']){_0x211fbf[_0x47a5('0x70')]=JSON['parse'](_0x211fbf['joins']);for(var _0x2bb2df=0x0;_0x2bb2df<_0x211fbf[_0x47a5('0x70')][_0x47a5('0x2f')];_0x2bb2df+=0x1){if(_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]&&_['includes'](_0x4f35ff,_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')])&&_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x73')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x74')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]){_0x4b5353[_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]](_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x211fbf[_0x47a5('0x77')],_0x211fbf[_0x47a5('0x70')][_0x2bb2df]['parentKey'],_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]));}}}if(_0x211fbf[_0x47a5('0x78')]){_0x211fbf[_0x47a5('0x78')]=JSON['parse'](_0x211fbf['conditions']);_0x4b5353[_0x47a5('0x34')](_0x5b91f7(_0x211fbf[_0x47a5('0x78')]['group']));}_0x23c393=_0x4b5353['clone']();_0x4b5353[_0x47a5('0x1b')](_0x420671);_0x4b5353[_0x47a5('0x1d')](0x0);return;}})['then'](function(){if(_0x24a6c1[_0x47a5('0x88')]===_0x47a5('0x89')){return null;}var _0x4c9e6a=_[_0x47a5('0x37')](_0x24a6c1,{'name':_0x24a6c1[_0x47a5('0x8a')]||_0x24a6c1[_0x47a5('0x26')]||_0x211fbf[_0x47a5('0x26')],'basename':_0x18fa31,'savename':util[_0x47a5('0x6d')](_0x47a5('0x8b'),_0x24a6c1['name']||_0x211fbf['name'],require('randomstring')[_0x47a5('0x8c')](0x4),_0x24a6c1[_0x47a5('0x88')]||'csv'),'reportId':_0x211fbf['id'],'reportType':_0x47a5('0x8d')});return db[_0x47a5('0x8e')][_0x47a5('0x3f')](_0x4c9e6a,{'raw':!![]});})[_0x47a5('0x21')](function(_0xcdbfd7){if(_0x211fbf['table']===_0x47a5('0x8f')){_0x23c393['where'](_0x211fbf['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x24a6c1[_0x47a5('0x90')],_0x24a6c1['endDate']);}else{_0x23c393[_0x47a5('0x34')](_0x211fbf[_0x47a5('0x77')]+_0x47a5('0x91'),_0x24a6c1['startDate'],_0x24a6c1[_0x47a5('0x92')]);}if(_0xcdbfd7){logger[_0x47a5('0x93')](_0x47a5('0x94'),_0x23c393[_0x47a5('0x7a')]());require(_0x47a5('0x95'))['fork'](path[_0x47a5('0x7e')](__dirname,_0x47a5('0x96'),_0xcdbfd7['output']),[_0xcdbfd7['id'],_0x23c393[_0x47a5('0x7a')](),path[_0x47a5('0x7e')](__dirname,_0x47a5('0x97'),_0xcdbfd7[_0x47a5('0x98')]),_0x18fa31]);return _0xcdbfd7;}else{var _0x3c117a=squel[_0x47a5('0x66')]();_0x3c117a['from']('('+_0x23c393[_0x47a5('0x7a')]()+')',_0x47a5('0x99'));_0x3c117a['field'](_0x47a5('0x9a'),_0x47a5('0x1c'));_0x23c393[_0x47a5('0x1b')](_0x24a6c1[_0x47a5('0x1b')]||_0x420671);_0x23c393['offset'](_0x24a6c1['offset']||0x0);return dbH['sequelize']['query'](_0x3c117a[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]})[_0x47a5('0x21')](function(_0x6bc37b){if(!_0x6bc37b[_0x47a5('0x2f')]){_0x2ae130=0x0;}else{_0x2ae130=_0x6bc37b[0x0][_0x47a5('0x1c')]||0x0;}return dbH['sequelize'][_0x47a5('0x2b')](_0x23c393[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')]['SELECT']});})['then'](function(_0x3770ae){return{'rows':_0x3770ae||[],'count':_0x2ae130};});}});}exports['run']=function(_0x4cb8e4,_0x1b6a5c){return runReport(_0x4cb8e4[_0x47a5('0x4c')],_0x4cb8e4['query'],_0x4cb8e4[_0x47a5('0x38')])[_0x47a5('0x21')](respondWithResult(_0x1b6a5c,null))[_0x47a5('0x48')](handleError(_0x1b6a5c,null));};exports['runReport']=runReport;exports[_0x47a5('0x2b')]=function(_0xee23c7,_0x48a491){var _0x1172fd=0xa;var _0x280b7b=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x482c87={'SUM':_0x47a5('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':_0x47a5('0x9b')};var _0x151540={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0x1b3e82=function(_0xa2045c){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),'IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0xa2045c);};var _0x591bde=function(_0x55d955){if(!_0x55d955||!_0x55d955[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x2ccf21='(',_0x2ff467=0x0;_0x2ff467<_0x55d955['rules'][_0x47a5('0x2f')];_0x2ff467+=0x1){_0x2ff467>0x0&&(_0x2ccf21+='\x20'+_0x55d955[_0x47a5('0x85')]+'\x20');_0x2ccf21+=_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]?_0x591bde(_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]):_0x55d955[_0x47a5('0x5c')][_0x2ff467]['field']+'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')]+(_0x1b3e82(_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')])?'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5f')]:'');}return _0x2ccf21+')';};var _0x8b4354={'where':{'id':_0xee23c7[_0x47a5('0x4c')]['id']}},_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b;_0x8b4354=_['merge']({},_0x8b4354,_0xee23c7['options']);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x8b4354)[_0x47a5('0x21')](function(_0xfccf9c){if(_0xfccf9c){_0x134c1a=_0xfccf9c;return _0xfccf9c[_0x47a5('0x9c')]();}return null;})[_0x47a5('0x21')](function(_0x1c0323){if(_0x1c0323){if(!_0x1c0323[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bc7ae=_0x1c0323;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})['then'](function(_0x48d4cf){if(_0x48d4cf){_0x49cb8c=_[_0x47a5('0x65')](_0x48d4cf,'id');var _0x41d2da;var _0x530387=squel[_0x47a5('0x66')]();_0x530387[_0x47a5('0x67')](_0x134c1a[_0x47a5('0x77')]);for(var _0x44567e=0x0;_0x44567e<_0x2bc7ae['length'];_0x44567e+=0x1){_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x68')]?_0x49cb8c[_0x2bc7ae[_0x44567e]['MetricId']]['metric']:_0x2bc7ae[_0x44567e]['field'];_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]?_['replace'](_0x482c87[_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]],'%s',_0x41d2da):_0x41d2da;_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]?_[_0x47a5('0x6c')](_0x151540[_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]],'%s',_0x41d2da):_0x41d2da;if(_0x2bc7ae[_0x44567e][_0x47a5('0x86')]){_0x530387[_0x47a5('0x5d')](_0x41d2da);}_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]&&_0x530387[_0x47a5('0x32')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x530387[_0x47a5('0x6a')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x87')]||_0x41d2da);}if(_0x134c1a[_0x47a5('0x70')]){_0x134c1a[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x134c1a['joins']);for(var _0xdd95c8=0x0;_0xdd95c8<_0x134c1a[_0x47a5('0x70')][_0x47a5('0x2f')];_0xdd95c8+=0x1){if(_0x134c1a[_0x47a5('0x70')][_0xdd95c8]['type']&&_[_0x47a5('0x58')](_0x280b7b,_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x72')])&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x73')]&&_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x74')]&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]){_0x530387[_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x72')]](_0x134c1a['joins'][_0xdd95c8]['foreignTable'],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x134c1a[_0x47a5('0x77')],_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x73')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x74')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]));}}}if(_0x134c1a[_0x47a5('0x78')]){_0x134c1a[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x134c1a['conditions']);_0x530387['where'](_0x591bde(_0x134c1a[_0x47a5('0x78')][_0x47a5('0x5d')]));}_0x11f07b=_0x530387[_0x47a5('0x9d')]();_0x530387[_0x47a5('0x1b')](_0x1172fd);_0x530387[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')](_0x47a5('0x9e'),_0x530387[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')]['query'](_0x530387['toString'](),{'type':dbH[_0x47a5('0x7b')]['QueryTypes'][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](function(){return{'sql':_0x11f07b[_0x47a5('0x7a')]()};})['then'](respondWithResult(_0x48a491,null))[_0x47a5('0x48')](handleError(_0x48a491,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index f290308..2734bba 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 _0x904a=['../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment','bluebird','path'];(function(_0x540feb,_0x54cb50){var _0x25dfee=function(_0x52356b){while(--_0x52356b){_0x540feb['push'](_0x540feb['shift']());}};_0x25dfee(++_0x54cb50);}(_0x904a,0x1e6));var _0xa904=function(_0x4ca3ca,_0x2092b2){_0x4ca3ca=_0x4ca3ca-0x0;var _0x5c94ac=_0x904a[_0x4ca3ca];return _0x5c94ac;};'use strict';var _=require(_0xa904('0x0'));var util=require(_0xa904('0x1'));var logger=require('../../config/logger')(_0xa904('0x2'));var moment=require(_0xa904('0x3'));var BPromise=require(_0xa904('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa904('0x5'));var rimraf=require('rimraf');var config=require(_0xa904('0x6'));var attributes=require(_0xa904('0x7'));module[_0xa904('0x8')]=function(_0x4d9c44,_0x3dc517){return _0x4d9c44[_0xa904('0x9')](_0xa904('0xa'),attributes,{'tableName':_0xa904('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5dd2=['rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','path'];(function(_0x1e7ed4,_0x2a6e68){var _0x563f46=function(_0xaa8c37){while(--_0xaa8c37){_0x1e7ed4['push'](_0x1e7ed4['shift']());}};_0x563f46(++_0x2a6e68);}(_0x5dd2,0x13e));var _0x25dd=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x5dd2[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0x25dd('0x0'));var util=require(_0x25dd('0x1'));var logger=require(_0x25dd('0x2'))(_0x25dd('0x3'));var moment=require(_0x25dd('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x25dd('0x5'));var rimraf=require(_0x25dd('0x6'));var config=require('../../config/environment');var attributes=require(_0x25dd('0x7'));module[_0x25dd('0x8')]=function(_0x174dd1,_0xa3f094){return _0x174dd1[_0x25dd('0x9')](_0x25dd('0xa'),attributes,{'tableName':_0x25dd('0xb'),'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 4453af6..f540c49 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 _0x2607=['AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2607,0x13d));var _0x7260=function(_0x30c2ae,_0x4c98a2){_0x30c2ae=_0x30c2ae-0x0;var _0x1ee1cc=_0x2607[_0x30c2ae];return _0x1ee1cc;};'use strict';var _=require(_0x7260('0x0'));var util=require(_0x7260('0x1'));var moment=require(_0x7260('0x2'));var BPromise=require(_0x7260('0x3'));var rs=require(_0x7260('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7260('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7260('0x6'))(_0x7260('0x7'));var config=require(_0x7260('0x8'));var jayson=require(_0x7260('0x9'));var client=jayson[_0x7260('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x116627,_0x1927c6,_0x1135aa){return new BPromise(function(_0x502cf6,_0x5888cf){return client['request'](_0x116627,_0x1135aa)[_0x7260('0xb')](function(_0xa4338d){logger[_0x7260('0xc')](_0x7260('0xd'),_0x1927c6,_0x7260('0xe'));logger[_0x7260('0xf')](_0x7260('0x10'),_0x1927c6,_0x7260('0xe'),JSON['stringify'](_0xa4338d));if(_0xa4338d['error']){if(_0xa4338d[_0x7260('0x11')][_0x7260('0x12')]===0x1f4){logger[_0x7260('0x11')](_0x7260('0xd'),_0x1927c6,_0xa4338d['error'][_0x7260('0x13')]);return _0x5888cf(_0xa4338d[_0x7260('0x11')][_0x7260('0x13')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x1927c6,_0xa4338d[_0x7260('0x11')][_0x7260('0x13')]);return _0x502cf6(_0xa4338d[_0x7260('0x11')][_0x7260('0x13')]);}else{logger[_0x7260('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1927c6,_0x7260('0xe'));_0x502cf6(_0xa4338d[_0x7260('0x14')][_0x7260('0x13')]);}})[_0x7260('0x15')](function(_0x26a36b){logger[_0x7260('0x11')](_0x7260('0xd'),_0x1927c6,_0x26a36b);_0x5888cf(_0x26a36b);});});}
\ No newline at end of file
+var _0x2dd8=['../../config/utils','../../config/logger','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x48fa5d,_0x86f7a4){var _0x25c1e1=function(_0x13ae3b){while(--_0x13ae3b){_0x48fa5d['push'](_0x48fa5d['shift']());}};_0x25c1e1(++_0x86f7a4);}(_0x2dd8,0x163));var _0x82dd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2dd8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x82dd('0x0'));var util=require(_0x82dd('0x1'));var moment=require('moment');var BPromise=require(_0x82dd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x82dd('0x3'));var db=require(_0x82dd('0x4'))['db'];var utils=require(_0x82dd('0x5'));var logger=require(_0x82dd('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x82dd('0x7')][_0x82dd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb78095,_0x53898b,_0x202399){return new BPromise(function(_0x1131ec,_0xe0f43a){return client[_0x82dd('0x9')](_0xb78095,_0x202399)[_0x82dd('0xa')](function(_0x4d514e){logger[_0x82dd('0xb')](_0x82dd('0xc'),_0x53898b,_0x82dd('0xd'));logger[_0x82dd('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x53898b,_0x82dd('0xd'),JSON[_0x82dd('0xf')](_0x4d514e));if(_0x4d514e[_0x82dd('0x10')]){if(_0x4d514e[_0x82dd('0x10')][_0x82dd('0x11')]===0x1f4){logger[_0x82dd('0x10')](_0x82dd('0xc'),_0x53898b,_0x4d514e['error'][_0x82dd('0x12')]);return _0xe0f43a(_0x4d514e[_0x82dd('0x10')][_0x82dd('0x12')]);}logger[_0x82dd('0x10')](_0x82dd('0xc'),_0x53898b,_0x4d514e[_0x82dd('0x10')][_0x82dd('0x12')]);return _0x1131ec(_0x4d514e['error']['message']);}else{logger[_0x82dd('0xb')](_0x82dd('0xc'),_0x53898b,'request\x20sent');_0x1131ec(_0x4d514e['result']['message']);}})[_0x82dd('0x13')](function(_0x1ef3ba){logger['error'](_0x82dd('0xc'),_0x53898b,_0x1ef3ba);_0xe0f43a(_0x1ef3ba);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 9c2d299..3b4f754 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 _0x50de=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','put','update','destroy','exports','multer','util','path','Router','fs-extra'];(function(_0x356e0c,_0x546362){var _0x93d464=function(_0x4ebeae){while(--_0x4ebeae){_0x356e0c['push'](_0x356e0c['shift']());}};_0x93d464(++_0x546362);}(_0x50de,0x12f));var _0xe50d=function(_0x2d5934,_0x1acc4f){_0x2d5934=_0x2d5934-0x0;var _0x5807c8=_0x50de[_0x2d5934];return _0x5807c8;};'use strict';var multer=require(_0xe50d('0x0'));var util=require(_0xe50d('0x1'));var path=require(_0xe50d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe50d('0x3')]();var fs_extra=require(_0xe50d('0x4'));var auth=require(_0xe50d('0x5'));var interaction=require(_0xe50d('0x6'));var config=require(_0xe50d('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0xe50d('0x8')]('/',auth[_0xe50d('0x9')](),controller[_0xe50d('0xa')]);router[_0xe50d('0x8')](_0xe50d('0xb'),auth[_0xe50d('0x9')](),controller[_0xe50d('0xc')]);router[_0xe50d('0x8')](_0xe50d('0xd'),auth[_0xe50d('0x9')](),controller[_0xe50d('0xe')]);router['get'](_0xe50d('0xf'),auth[_0xe50d('0x9')](),controller['run']);router[_0xe50d('0x8')](_0xe50d('0x10'),auth[_0xe50d('0x9')](),controller[_0xe50d('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe50d('0x12')](_0xe50d('0xb'),auth[_0xe50d('0x9')](),controller[_0xe50d('0x13')]);router['delete'](_0xe50d('0xb'),auth[_0xe50d('0x9')](),controller[_0xe50d('0x14')]);module[_0xe50d('0x15')]=router;
\ No newline at end of file
+var _0x07ca=['query','post','create','put','/:id','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','index','isAuthenticated','show','/:id/preview','run','/:id/query'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0x07ca,0xd7));var _0xa07c=function(_0x5a125c,_0x155fa2){_0x5a125c=_0x5a125c-0x0;var _0x4c70af=_0x07ca[_0x5a125c];return _0x4c70af;};'use strict';var multer=require('multer');var util=require(_0xa07c('0x0'));var path=require(_0xa07c('0x1'));var timeout=require(_0xa07c('0x2'));var express=require(_0xa07c('0x3'));var router=express['Router']();var fs_extra=require(_0xa07c('0x4'));var auth=require(_0xa07c('0x5'));var interaction=require(_0xa07c('0x6'));var config=require('../../config/environment');var controller=require(_0xa07c('0x7'));router[_0xa07c('0x8')]('/',auth['isAuthenticated'](),controller[_0xa07c('0x9')]);router[_0xa07c('0x8')]('/:id',auth[_0xa07c('0xa')](),controller[_0xa07c('0xb')]);router[_0xa07c('0x8')](_0xa07c('0xc'),auth[_0xa07c('0xa')](),controller['preview']);router[_0xa07c('0x8')]('/:id/run',auth[_0xa07c('0xa')](),controller[_0xa07c('0xd')]);router[_0xa07c('0x8')](_0xa07c('0xe'),auth[_0xa07c('0xa')](),controller[_0xa07c('0xf')]);router[_0xa07c('0x10')]('/',auth['isAuthenticated'](),controller[_0xa07c('0x11')]);router[_0xa07c('0x12')](_0xa07c('0x13'),auth['isAuthenticated'](),controller[_0xa07c('0x14')]);router['delete'](_0xa07c('0x13'),auth[_0xa07c('0xa')](),controller[_0xa07c('0x15')]);module[_0xa07c('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 d42ee24..92d4ed3 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 _0x0a56=['scheduled','sequelize','STRING','ENUM','csv','xlsx','DATE','Loading','manual'];(function(_0x40352,_0x15f089){var _0xa20e40=function(_0x4cef24){while(--_0x4cef24){_0x40352['push'](_0x40352['shift']());}};_0xa20e40(++_0x15f089);}(_0x0a56,0x1de));var _0x60a5=function(_0x5e50b5,_0x264ccd){_0x5e50b5=_0x5e50b5-0x0;var _0x57c7f3=_0x0a56[_0x5e50b5];return _0x57c7f3;};'use strict';var Sequelize=require(_0x60a5('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x60a5('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x60a5('0x2')](_0x60a5('0x3'),'pdf',_0x60a5('0x4')),'allowNull':![],'defaultValue':_0x60a5('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x60a5('0x5')]},'endDate':{'type':Sequelize[_0x60a5('0x5')]},'status':{'type':Sequelize[_0x60a5('0x1')],'defaultValue':_0x60a5('0x6')},'type':{'type':Sequelize[_0x60a5('0x2')](_0x60a5('0x7'),_0x60a5('0x8')),'allowNull':![],'defaultValue':_0x60a5('0x7')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x40a1=['sequelize','moment','exports','STRING','ENUM','csv','DATE','Loading','manual','INTEGER'];(function(_0x1f0e0a,_0x4c2b9a){var _0xe9c80b=function(_0x432e6f){while(--_0x432e6f){_0x1f0e0a['push'](_0x1f0e0a['shift']());}};_0xe9c80b(++_0x4c2b9a);}(_0x40a1,0x10e));var _0x140a=function(_0x49b981,_0x46dea1){_0x49b981=_0x49b981-0x0;var _0x211893=_0x40a1[_0x49b981];return _0x211893;};'use strict';var Sequelize=require(_0x140a('0x0'));var moment=require(_0x140a('0x1'));module[_0x140a('0x2')]={'name':{'type':Sequelize[_0x140a('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x140a('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x140a('0x4')](_0x140a('0x5'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0x140a('0x5')},'savename':{'type':Sequelize[_0x140a('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x140a('0x6')]},'endDate':{'type':Sequelize[_0x140a('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x140a('0x7')},'type':{'type':Sequelize[_0x140a('0x4')](_0x140a('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0x140a('0x8')},'reportId':{'type':Sequelize[_0x140a('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x140a('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 6e01360..54d26fe 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 _0x440c=['root','%s.%s','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','get','ExtractedReports','UserProfileResource','then','error','name','send','map','AnalyticExtractedReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','include','rows','catch','show','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','output','existsSync','join','server/files/reports'];(function(_0x221379,_0x18c5a4){var _0x56cb6c=function(_0x2ee9b5){while(--_0x2ee9b5){_0x221379['push'](_0x221379['shift']());}};_0x56cb6c(++_0x18c5a4);}(_0x440c,0x15e));var _0xc440=function(_0x24296c,_0x1bcdef){_0x24296c=_0x24296c-0x0;var _0x22f7da=_0x440c[_0x24296c];return _0x22f7da;};'use strict';var emlformat=require(_0xc440('0x0'));var rimraf=require(_0xc440('0x1'));var zipdir=require(_0xc440('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc440('0x3'));var moment=require(_0xc440('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc440('0x5'));var path=require(_0xc440('0x6'));var sox=require('sox');var csv=require(_0xc440('0x7'));var ejs=require(_0xc440('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc440('0x9'));var squel=require(_0xc440('0xa'));var crypto=require('crypto');var jsforce=require(_0xc440('0xb'));var deskjs=require(_0xc440('0xc'));var toCsv=require(_0xc440('0x7'));var querystring=require(_0xc440('0xd'));var Papa=require(_0xc440('0xe'));var Redis=require(_0xc440('0xf'));var authService=require(_0xc440('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc440('0x11'));var hardwareService=require(_0xc440('0x12'));var logger=require(_0xc440('0x13'))('api');var utils=require(_0xc440('0x14'));var config=require(_0xc440('0x15'));var licenseUtil=require(_0xc440('0x16'));var db=require(_0xc440('0x17'))['db'];function respondWithStatusCode(_0x33e656,_0x2d8bca){_0x2d8bca=_0x2d8bca||0xcc;return function(_0x26a868){if(_0x26a868){return _0x33e656[_0xc440('0x18')](_0x2d8bca);}return _0x33e656['status'](_0x2d8bca)[_0xc440('0x19')]();};}function respondWithResult(_0x114f08,_0x4c14f1){_0x4c14f1=_0x4c14f1||0xc8;return function(_0x5da834){if(_0x5da834){return _0x114f08[_0xc440('0x1a')](_0x4c14f1)['json'](_0x5da834);}};}function respondWithFilteredResult(_0x5236eb,_0x37baaf){return function(_0x51a8a5){if(_0x51a8a5){var _0x159db1=typeof _0x37baaf[_0xc440('0x1b')]===_0xc440('0x1c')&&typeof _0x37baaf[_0xc440('0x1d')]===_0xc440('0x1c');var _0x2b5700=_0x51a8a5['count'];var _0x179c8a=_0x159db1?0x0:_0x37baaf[_0xc440('0x1b')];var _0x5c3f80=_0x159db1?_0x51a8a5[_0xc440('0x1e')]:_0x37baaf[_0xc440('0x1b')]+_0x37baaf[_0xc440('0x1d')];var _0x84bda0;if(_0x5c3f80>=_0x2b5700){_0x5c3f80=_0x2b5700;_0x84bda0=0xc8;}else{_0x84bda0=0xce;}_0x5236eb[_0xc440('0x1a')](_0x84bda0);return _0x5236eb[_0xc440('0x1f')](_0xc440('0x20'),_0x179c8a+'-'+_0x5c3f80+'/'+_0x2b5700)[_0xc440('0x21')](_0x51a8a5);}return null;};}function patchUpdates(_0xb1b9ee){return function(_0x2f1267){try{jsonpatch['apply'](_0x2f1267,_0xb1b9ee,!![]);}catch(_0x157727){return BPromise['reject'](_0x157727);}return _0x2f1267['save']();};}function saveUpdates(_0x31e025,_0x868afc){return function(_0x256a0d){if(_0x256a0d){return _0x256a0d[_0xc440('0x22')](_0x31e025)['then'](function(_0x2b4f3b){return _0x2b4f3b;});}return null;};}function removeEntity(_0x26d2a9,_0x1aa227){return function(_0x702eb){if(_0x702eb){return _0x702eb[_0xc440('0x23')]()['then'](function(){var _0x52a6d5=_0x702eb[_0xc440('0x24')]({'plain':!![]});var _0x2464c9=_0xc440('0x25');return db[_0xc440('0x26')][_0xc440('0x23')]({'where':{'type':_0x2464c9,'resourceId':_0x52a6d5['id']}})['then'](function(){return _0x702eb;});})[_0xc440('0x27')](function(){_0x26d2a9['status'](0xcc)[_0xc440('0x19')]();});}};}function handleEntityNotFound(_0x3848aa,_0x172c1c){return function(_0x3521ae){if(!_0x3521ae){_0x3848aa['sendStatus'](0x194);}return _0x3521ae;};}function handleError(_0x5410b9,_0x12b0f8){_0x12b0f8=_0x12b0f8||0x1f4;return function(_0x47a0ae){logger[_0xc440('0x28')](_0x47a0ae['stack']);if(_0x47a0ae['name']){delete _0x47a0ae[_0xc440('0x29')];}_0x5410b9[_0xc440('0x1a')](_0x12b0f8)[_0xc440('0x2a')](_0x47a0ae);};}exports['index']=function(_0x43273b,_0x2245f3){var _0x505e5c={},_0x1369eb={},_0x1d9cb9={'count':0x0,'rows':[]};var _0x514099=_[_0xc440('0x2b')](db[_0xc440('0x2c')]['rawAttributes'],function(_0x570524){return{'name':_0x570524[_0xc440('0x2d')],'type':_0x570524[_0xc440('0x2e')][_0xc440('0x2f')]};});_0x1369eb['model']=_['map'](_0x514099,_0xc440('0x29'));_0x1369eb[_0xc440('0x30')]=_[_0xc440('0x31')](_0x43273b[_0xc440('0x30')]);_0x1369eb[_0xc440('0x32')]=_[_0xc440('0x33')](_0x1369eb[_0xc440('0x34')],_0x1369eb[_0xc440('0x30')]);_0x505e5c[_0xc440('0x35')]=_[_0xc440('0x33')](_0x1369eb[_0xc440('0x34')],qs['fields'](_0x43273b[_0xc440('0x30')][_0xc440('0x36')]));_0x505e5c[_0xc440('0x35')]=_0x505e5c[_0xc440('0x35')][_0xc440('0x37')]?_0x505e5c['attributes']:_0x1369eb[_0xc440('0x34')];if(!_0x43273b[_0xc440('0x30')][_0xc440('0x38')](_0xc440('0x39'))){_0x505e5c[_0xc440('0x1d')]=qs[_0xc440('0x1d')](_0x43273b[_0xc440('0x30')][_0xc440('0x1d')]);_0x505e5c[_0xc440('0x1b')]=qs['offset'](_0x43273b[_0xc440('0x30')][_0xc440('0x1b')]);}_0x505e5c[_0xc440('0x3a')]=qs['sort'](_0x43273b['query'][_0xc440('0x3b')]);_0x505e5c[_0xc440('0x3c')]=qs[_0xc440('0x32')](_[_0xc440('0x3d')](_0x43273b[_0xc440('0x30')],_0x1369eb[_0xc440('0x32')]),_0x514099);if(_0x43273b[_0xc440('0x30')]['filter']){_0x505e5c[_0xc440('0x3c')]=_[_0xc440('0x3e')](_0x505e5c[_0xc440('0x3c')],{'$or':_['map'](_0x514099,function(_0x2dcddc){if(_0x2dcddc[_0xc440('0x2e')]!=='VIRTUAL'){var _0x340370={};_0x340370[_0x2dcddc[_0xc440('0x29')]]={'$like':'%'+_0x43273b[_0xc440('0x30')][_0xc440('0x3f')]+'%'};return _0x340370;}})});}_0x505e5c=_[_0xc440('0x3e')]({},_0x505e5c,_0x43273b[_0xc440('0x40')]);var _0x38bcc5={'where':_0x505e5c[_0xc440('0x3c')]};return db[_0xc440('0x2c')][_0xc440('0x1e')](_0x38bcc5)['then'](function(_0x4e4013){_0x1d9cb9['count']=_0x4e4013;if(_0x43273b['query']['includeAll']){_0x505e5c[_0xc440('0x41')]=[{'all':!![]}];}return db[_0xc440('0x2c')]['findAll'](_0x505e5c);})[_0xc440('0x27')](function(_0x2cb59d){_0x1d9cb9[_0xc440('0x42')]=_0x2cb59d;return _0x1d9cb9;})[_0xc440('0x27')](respondWithFilteredResult(_0x2245f3,_0x505e5c))[_0xc440('0x43')](handleError(_0x2245f3,null));};exports[_0xc440('0x44')]=function(_0x4f394f,_0x4f7068){var _0x3d2803={'raw':!![],'where':{'id':_0x4f394f['params']['id']}},_0x2c6b2a={};_0x2c6b2a[_0xc440('0x34')]=_['keys'](db[_0xc440('0x2c')]['rawAttributes']);_0x2c6b2a[_0xc440('0x30')]=_[_0xc440('0x31')](_0x4f394f['query']);_0x2c6b2a[_0xc440('0x32')]=_[_0xc440('0x33')](_0x2c6b2a['model'],_0x2c6b2a[_0xc440('0x30')]);_0x3d2803['attributes']=_['intersection'](_0x2c6b2a[_0xc440('0x34')],qs[_0xc440('0x36')](_0x4f394f[_0xc440('0x30')][_0xc440('0x36')]));_0x3d2803[_0xc440('0x35')]=_0x3d2803[_0xc440('0x35')][_0xc440('0x37')]?_0x3d2803[_0xc440('0x35')]:_0x2c6b2a['model'];if(_0x4f394f['query']['includeAll']){_0x3d2803[_0xc440('0x41')]=[{'all':!![]}];}_0x3d2803=_[_0xc440('0x3e')]({},_0x3d2803,_0x4f394f[_0xc440('0x40')]);return db['AnalyticExtractedReport'][_0xc440('0x45')](_0x3d2803)[_0xc440('0x27')](handleEntityNotFound(_0x4f7068,null))['then'](respondWithResult(_0x4f7068,null))['catch'](handleError(_0x4f7068,null));};exports['create']=function(_0x229a19,_0x4b0e74){return db[_0xc440('0x2c')][_0xc440('0x46')](_0x229a19[_0xc440('0x47')],{})['then'](function(_0x3560f3){var _0x12a69c=_0x229a19[_0xc440('0x48')][_0xc440('0x24')]({'plain':!![]});if(!_0x12a69c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12a69c[_0xc440('0x49')]===_0xc440('0x48')){var _0x346ac2=_0x3560f3[_0xc440('0x24')]({'plain':!![]});var _0x24b6bd='ExtractedReports';return db['UserProfileSection']['find']({'where':{'name':_0x24b6bd,'userProfileId':_0x12a69c[_0xc440('0x4a')]},'raw':!![]})[_0xc440('0x27')](function(_0x3048df){if(_0x3048df&&_0x3048df[_0xc440('0x4b')]===0x0){return db['UserProfileResource'][_0xc440('0x46')]({'name':_0x346ac2[_0xc440('0x29')],'resourceId':_0x346ac2['id'],'type':_0x3048df['name'],'sectionId':_0x3048df['id']},{})[_0xc440('0x27')](function(){return _0x3560f3;});}else{return _0x3560f3;}})[_0xc440('0x43')](function(_0x45c6b0){logger[_0xc440('0x28')](_0xc440('0x4c'),_0x45c6b0);throw _0x45c6b0;});}return _0x3560f3;})['then'](respondWithResult(_0x4b0e74,0xc9))[_0xc440('0x43')](handleError(_0x4b0e74,null));};exports[_0xc440('0x22')]=function(_0x380e7e,_0x2c4999){if(_0x380e7e[_0xc440('0x47')]['id']){delete _0x380e7e['body']['id'];}return db['AnalyticExtractedReport'][_0xc440('0x45')]({'where':{'id':_0x380e7e[_0xc440('0x4d')]['id']}})[_0xc440('0x27')](handleEntityNotFound(_0x2c4999,null))[_0xc440('0x27')](saveUpdates(_0x380e7e['body'],null))[_0xc440('0x27')](respondWithResult(_0x2c4999,null))[_0xc440('0x43')](handleError(_0x2c4999,null));};exports[_0xc440('0x23')]=function(_0x2b231f,_0xb2fc0f){return db[_0xc440('0x2c')][_0xc440('0x45')]({'where':{'id':_0x2b231f[_0xc440('0x4d')]['id']}})[_0xc440('0x27')](handleEntityNotFound(_0xb2fc0f,null))['then'](removeEntity(_0xb2fc0f,null))[_0xc440('0x43')](handleError(_0xb2fc0f,null));};exports[_0xc440('0x4e')]=function(_0x12b610,_0x2c0593,_0xabcdb9){return db[_0xc440('0x2c')][_0xc440('0x45')]({'where':{'id':_0x12b610[_0xc440('0x4d')]['id']},'attributes':[_0xc440('0x29'),_0xc440('0x4f'),_0xc440('0x50'),_0xc440('0x51')],'raw':!![]})[_0xc440('0x27')](handleEntityNotFound(_0x2c0593,null))[_0xc440('0x27')](function(_0x537c69){if(_0x537c69){if(!fs[_0xc440('0x52')](path[_0xc440('0x53')](config['root'],_0xc440('0x54'),_0x537c69['savename']))){throw new db['Sequelize']['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x12b610[_0xc440('0x30')]['exists']){return _0x2c0593['sendStatus'](0xc8);}return _0x2c0593[_0xc440('0x4e')](path[_0xc440('0x53')](config[_0xc440('0x55')],'server/files/reports',_0x537c69[_0xc440('0x50')]),util['format'](_0xc440('0x56'),_0x537c69[_0xc440('0x4f')]||_0x537c69[_0xc440('0x29')],_0x537c69[_0xc440('0x51')]['toLowerCase']()));}})['catch'](handleError(_0x2c0593,null));};
\ No newline at end of file
+var _0xc6d8=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','existsSync','join','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','basename','output','toLowerCase','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','length','AnalyticExtractedReport','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ExtractedReports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xc6d8,0x144));var _0x8c6d=function(_0x54bb5e,_0xc9513a){_0x54bb5e=_0x54bb5e-0x0;var _0x2cfe75=_0xc6d8[_0x54bb5e];return _0x2cfe75;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8c6d('0x0'));var jsonpatch=require(_0x8c6d('0x1'));var rp=require('request-promise');var moment=require(_0x8c6d('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x8c6d('0x3'));var util=require(_0x8c6d('0x4'));var path=require(_0x8c6d('0x5'));var sox=require(_0x8c6d('0x6'));var csv=require(_0x8c6d('0x7'));var ejs=require(_0x8c6d('0x8'));var fs=require('fs');var fs_extra=require(_0x8c6d('0x9'));var _=require(_0x8c6d('0xa'));var squel=require(_0x8c6d('0xb'));var crypto=require(_0x8c6d('0xc'));var jsforce=require(_0x8c6d('0xd'));var deskjs=require(_0x8c6d('0xe'));var toCsv=require(_0x8c6d('0x7'));var querystring=require(_0x8c6d('0xf'));var Papa=require(_0x8c6d('0x10'));var Redis=require('ioredis');var authService=require(_0x8c6d('0x11'));var qs=require(_0x8c6d('0x12'));var as=require(_0x8c6d('0x13'));var hardwareService=require(_0x8c6d('0x14'));var logger=require(_0x8c6d('0x15'))(_0x8c6d('0x16'));var utils=require(_0x8c6d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8c6d('0x18'));var db=require(_0x8c6d('0x19'))['db'];function respondWithStatusCode(_0xf3555b,_0x3a37e8){_0x3a37e8=_0x3a37e8||0xcc;return function(_0x2168f4){if(_0x2168f4){return _0xf3555b[_0x8c6d('0x1a')](_0x3a37e8);}return _0xf3555b[_0x8c6d('0x1b')](_0x3a37e8)[_0x8c6d('0x1c')]();};}function respondWithResult(_0x6316f3,_0x22bbb2){_0x22bbb2=_0x22bbb2||0xc8;return function(_0x26fbb0){if(_0x26fbb0){return _0x6316f3[_0x8c6d('0x1b')](_0x22bbb2)[_0x8c6d('0x1d')](_0x26fbb0);}};}function respondWithFilteredResult(_0x4c6006,_0x5ad638){return function(_0x527f90){if(_0x527f90){var _0x233a9a=typeof _0x5ad638[_0x8c6d('0x1e')]===_0x8c6d('0x1f')&&typeof _0x5ad638[_0x8c6d('0x20')]===_0x8c6d('0x1f');var _0x5ccabc=_0x527f90[_0x8c6d('0x21')];var _0x1cf92f=_0x233a9a?0x0:_0x5ad638['offset'];var _0x35f921=_0x233a9a?_0x527f90[_0x8c6d('0x21')]:_0x5ad638[_0x8c6d('0x1e')]+_0x5ad638[_0x8c6d('0x20')];var _0x1f89a4;if(_0x35f921>=_0x5ccabc){_0x35f921=_0x5ccabc;_0x1f89a4=0xc8;}else{_0x1f89a4=0xce;}_0x4c6006['status'](_0x1f89a4);return _0x4c6006['set']('Content-Range',_0x1cf92f+'-'+_0x35f921+'/'+_0x5ccabc)[_0x8c6d('0x1d')](_0x527f90);}return null;};}function patchUpdates(_0x4ffbae){return function(_0x1b80cd){try{jsonpatch[_0x8c6d('0x22')](_0x1b80cd,_0x4ffbae,!![]);}catch(_0x186623){return BPromise[_0x8c6d('0x23')](_0x186623);}return _0x1b80cd[_0x8c6d('0x24')]();};}function saveUpdates(_0x50af7a,_0x5d6b4a){return function(_0x126060){if(_0x126060){return _0x126060[_0x8c6d('0x25')](_0x50af7a)['then'](function(_0x54ceb6){return _0x54ceb6;});}return null;};}function removeEntity(_0x3a2ff8,_0x426f21){return function(_0x4ec873){if(_0x4ec873){return _0x4ec873[_0x8c6d('0x26')]()[_0x8c6d('0x27')](function(){var _0x11b4e2=_0x4ec873[_0x8c6d('0x28')]({'plain':!![]});var _0xf2799c='ExtractedReports';return db[_0x8c6d('0x29')][_0x8c6d('0x26')]({'where':{'type':_0xf2799c,'resourceId':_0x11b4e2['id']}})[_0x8c6d('0x27')](function(){return _0x4ec873;});})[_0x8c6d('0x27')](function(){_0x3a2ff8[_0x8c6d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9e9f1f,_0x1f1319){return function(_0x52bb86){if(!_0x52bb86){_0x9e9f1f['sendStatus'](0x194);}return _0x52bb86;};}function handleError(_0x1df2d9,_0x4ab7fa){_0x4ab7fa=_0x4ab7fa||0x1f4;return function(_0x3f70e0){logger[_0x8c6d('0x2a')](_0x3f70e0[_0x8c6d('0x2b')]);if(_0x3f70e0[_0x8c6d('0x2c')]){delete _0x3f70e0[_0x8c6d('0x2c')];}_0x1df2d9[_0x8c6d('0x1b')](_0x4ab7fa)[_0x8c6d('0x2d')](_0x3f70e0);};}exports[_0x8c6d('0x2e')]=function(_0x181b5c,_0x459860){var _0x896728={},_0x4b894e={},_0x257c12={'count':0x0,'rows':[]};var _0x33ef71=_[_0x8c6d('0x2f')](db['AnalyticExtractedReport'][_0x8c6d('0x30')],function(_0x2c6959){return{'name':_0x2c6959[_0x8c6d('0x31')],'type':_0x2c6959[_0x8c6d('0x32')][_0x8c6d('0x33')]};});_0x4b894e[_0x8c6d('0x34')]=_['map'](_0x33ef71,_0x8c6d('0x2c'));_0x4b894e['query']=_['keys'](_0x181b5c[_0x8c6d('0x35')]);_0x4b894e['filters']=_[_0x8c6d('0x36')](_0x4b894e[_0x8c6d('0x34')],_0x4b894e[_0x8c6d('0x35')]);_0x896728[_0x8c6d('0x37')]=_[_0x8c6d('0x36')](_0x4b894e[_0x8c6d('0x34')],qs[_0x8c6d('0x38')](_0x181b5c[_0x8c6d('0x35')]['fields']));_0x896728[_0x8c6d('0x37')]=_0x896728['attributes']['length']?_0x896728[_0x8c6d('0x37')]:_0x4b894e[_0x8c6d('0x34')];if(!_0x181b5c[_0x8c6d('0x35')][_0x8c6d('0x39')](_0x8c6d('0x3a'))){_0x896728[_0x8c6d('0x20')]=qs[_0x8c6d('0x20')](_0x181b5c[_0x8c6d('0x35')][_0x8c6d('0x20')]);_0x896728[_0x8c6d('0x1e')]=qs['offset'](_0x181b5c[_0x8c6d('0x35')][_0x8c6d('0x1e')]);}_0x896728[_0x8c6d('0x3b')]=qs[_0x8c6d('0x3c')](_0x181b5c['query'][_0x8c6d('0x3c')]);_0x896728[_0x8c6d('0x3d')]=qs[_0x8c6d('0x3e')](_[_0x8c6d('0x3f')](_0x181b5c[_0x8c6d('0x35')],_0x4b894e[_0x8c6d('0x3e')]),_0x33ef71);if(_0x181b5c['query'][_0x8c6d('0x40')]){_0x896728[_0x8c6d('0x3d')]=_[_0x8c6d('0x41')](_0x896728[_0x8c6d('0x3d')],{'$or':_[_0x8c6d('0x2f')](_0x33ef71,function(_0x46eff2){if(_0x46eff2[_0x8c6d('0x32')]!==_0x8c6d('0x42')){var _0x49002c={};_0x49002c[_0x46eff2[_0x8c6d('0x2c')]]={'$like':'%'+_0x181b5c[_0x8c6d('0x35')][_0x8c6d('0x40')]+'%'};return _0x49002c;}})});}_0x896728=_[_0x8c6d('0x41')]({},_0x896728,_0x181b5c[_0x8c6d('0x43')]);var _0x713486={'where':_0x896728[_0x8c6d('0x3d')]};return db['AnalyticExtractedReport'][_0x8c6d('0x21')](_0x713486)[_0x8c6d('0x27')](function(_0x42f024){_0x257c12[_0x8c6d('0x21')]=_0x42f024;if(_0x181b5c['query'][_0x8c6d('0x44')]){_0x896728[_0x8c6d('0x45')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x8c6d('0x46')](_0x896728);})[_0x8c6d('0x27')](function(_0x26b707){_0x257c12['rows']=_0x26b707;return _0x257c12;})[_0x8c6d('0x27')](respondWithFilteredResult(_0x459860,_0x896728))[_0x8c6d('0x47')](handleError(_0x459860,null));};exports[_0x8c6d('0x48')]=function(_0x59585f,_0x3e0910){var _0x5a648b={'raw':!![],'where':{'id':_0x59585f[_0x8c6d('0x49')]['id']}},_0xa905d4={};_0xa905d4[_0x8c6d('0x34')]=_[_0x8c6d('0x4a')](db['AnalyticExtractedReport'][_0x8c6d('0x30')]);_0xa905d4['query']=_['keys'](_0x59585f[_0x8c6d('0x35')]);_0xa905d4[_0x8c6d('0x3e')]=_[_0x8c6d('0x36')](_0xa905d4['model'],_0xa905d4[_0x8c6d('0x35')]);_0x5a648b[_0x8c6d('0x37')]=_['intersection'](_0xa905d4[_0x8c6d('0x34')],qs['fields'](_0x59585f[_0x8c6d('0x35')][_0x8c6d('0x38')]));_0x5a648b[_0x8c6d('0x37')]=_0x5a648b[_0x8c6d('0x37')][_0x8c6d('0x4b')]?_0x5a648b[_0x8c6d('0x37')]:_0xa905d4[_0x8c6d('0x34')];if(_0x59585f['query']['includeAll']){_0x5a648b['include']=[{'all':!![]}];}_0x5a648b=_[_0x8c6d('0x41')]({},_0x5a648b,_0x59585f[_0x8c6d('0x43')]);return db[_0x8c6d('0x4c')][_0x8c6d('0x4d')](_0x5a648b)[_0x8c6d('0x27')](handleEntityNotFound(_0x3e0910,null))[_0x8c6d('0x27')](respondWithResult(_0x3e0910,null))[_0x8c6d('0x47')](handleError(_0x3e0910,null));};exports[_0x8c6d('0x4e')]=function(_0x17b91a,_0x56d8c4){return db[_0x8c6d('0x4c')]['create'](_0x17b91a[_0x8c6d('0x4f')],{})[_0x8c6d('0x27')](function(_0x30d16d){var _0x1352a1=_0x17b91a['user'][_0x8c6d('0x28')]({'plain':!![]});if(!_0x1352a1)throw new Error(_0x8c6d('0x50'));if(_0x1352a1[_0x8c6d('0x51')]===_0x8c6d('0x52')){var _0x23233d=_0x30d16d['get']({'plain':!![]});var _0x306976=_0x8c6d('0x53');return db[_0x8c6d('0x54')][_0x8c6d('0x4d')]({'where':{'name':_0x306976,'userProfileId':_0x1352a1[_0x8c6d('0x55')]},'raw':!![]})[_0x8c6d('0x27')](function(_0x57cc4e){if(_0x57cc4e&&_0x57cc4e[_0x8c6d('0x56')]===0x0){return db[_0x8c6d('0x29')][_0x8c6d('0x4e')]({'name':_0x23233d[_0x8c6d('0x2c')],'resourceId':_0x23233d['id'],'type':_0x57cc4e['name'],'sectionId':_0x57cc4e['id']},{})[_0x8c6d('0x27')](function(){return _0x30d16d;});}else{return _0x30d16d;}})['catch'](function(_0x2b5679){logger[_0x8c6d('0x2a')](_0x8c6d('0x57'),_0x2b5679);throw _0x2b5679;});}return _0x30d16d;})[_0x8c6d('0x27')](respondWithResult(_0x56d8c4,0xc9))[_0x8c6d('0x47')](handleError(_0x56d8c4,null));};exports[_0x8c6d('0x25')]=function(_0x246dd1,_0x5efa7e){if(_0x246dd1['body']['id']){delete _0x246dd1[_0x8c6d('0x4f')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x246dd1[_0x8c6d('0x49')]['id']}})['then'](handleEntityNotFound(_0x5efa7e,null))[_0x8c6d('0x27')](saveUpdates(_0x246dd1['body'],null))['then'](respondWithResult(_0x5efa7e,null))[_0x8c6d('0x47')](handleError(_0x5efa7e,null));};exports[_0x8c6d('0x26')]=function(_0x3a8c9b,_0x45b39f){return db[_0x8c6d('0x4c')]['find']({'where':{'id':_0x3a8c9b[_0x8c6d('0x49')]['id']}})[_0x8c6d('0x27')](handleEntityNotFound(_0x45b39f,null))['then'](removeEntity(_0x45b39f,null))['catch'](handleError(_0x45b39f,null));};exports[_0x8c6d('0x58')]=function(_0x1278f2,_0x280f3d,_0x3532b4){return db[_0x8c6d('0x4c')]['find']({'where':{'id':_0x1278f2[_0x8c6d('0x49')]['id']},'attributes':[_0x8c6d('0x2c'),'basename','savename','output'],'raw':!![]})[_0x8c6d('0x27')](handleEntityNotFound(_0x280f3d,null))[_0x8c6d('0x27')](function(_0x535cd2){if(_0x535cd2){if(!fs[_0x8c6d('0x59')](path[_0x8c6d('0x5a')](config['root'],_0x8c6d('0x5b'),_0x535cd2[_0x8c6d('0x5c')]))){throw new db[(_0x8c6d('0x5d'))][(_0x8c6d('0x5e'))](_0x8c6d('0x5f'));}if(_0x1278f2['query'][_0x8c6d('0x60')]){return _0x280f3d[_0x8c6d('0x1a')](0xc8);}return _0x280f3d[_0x8c6d('0x58')](path[_0x8c6d('0x5a')](config['root'],_0x8c6d('0x5b'),_0x535cd2['savename']),util[_0x8c6d('0x61')](_0x8c6d('0x62'),_0x535cd2[_0x8c6d('0x63')]||_0x535cd2[_0x8c6d('0x2c')],_0x535cd2[_0x8c6d('0x64')][_0x8c6d('0x65')]()));}})[_0x8c6d('0x47')](handleError(_0x280f3d,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 6529405..5fdc007 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 _0x736b=['api','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger'];(function(_0x3bb859,_0x589816){var _0x3bf534=function(_0xa586c){while(--_0xa586c){_0x3bb859['push'](_0x3bb859['shift']());}};_0x3bf534(++_0x589816);}(_0x736b,0x77));var _0xb736=function(_0x3c7968,_0x969c7){_0x3c7968=_0x3c7968-0x0;var _0x45cceb=_0x736b[_0x3c7968];return _0x45cceb;};'use strict';var _=require('lodash');var util=require(_0xb736('0x0'));var logger=require(_0xb736('0x1'))(_0xb736('0x2'));var moment=require('moment');var BPromise=require(_0xb736('0x3'));var rp=require(_0xb736('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb736('0x5'));var config=require(_0xb736('0x6'));var attributes=require(_0xb736('0x7'));module['exports']=function(_0x6d4e03,_0x104602){return _0x6d4e03[_0xb736('0x8')](_0xb736('0x9'),attributes,{'tableName':_0xb736('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeda8=['../../config/logger','api','moment','bluebird','path','../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','util'];(function(_0x9db5d3,_0x4eea5e){var _0x477a81=function(_0x28e774){while(--_0x28e774){_0x9db5d3['push'](_0x9db5d3['shift']());}};_0x477a81(++_0x4eea5e);}(_0xeda8,0xee));var _0x8eda=function(_0x510690,_0x2b1772){_0x510690=_0x510690-0x0;var _0x3a431e=_0xeda8[_0x510690];return _0x3a431e;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require(_0x8eda('0x2'))(_0x8eda('0x3'));var moment=require(_0x8eda('0x4'));var BPromise=require(_0x8eda('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require('rimraf');var config=require(_0x8eda('0x7'));var attributes=require(_0x8eda('0x8'));module[_0x8eda('0x9')]=function(_0x2e16cc,_0x48df73){return _0x2e16cc[_0x8eda('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0x8eda('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 6f5615f..2521487 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 _0xafba=['catch','lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','client','then','request\x20sent','stringify','error','AnalyticExtractedReport,\x20%s,\x20%s','message','result'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xafba,0x91));var _0xaafb=function(_0xa405e1,_0x395137){_0xa405e1=_0xa405e1-0x0;var _0x2e28a1=_0xafba[_0xa405e1];return _0x2e28a1;};'use strict';var _=require(_0xaafb('0x0'));var util=require(_0xaafb('0x1'));var moment=require(_0xaafb('0x2'));var BPromise=require(_0xaafb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaafb('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xaafb('0x5'));var config=require(_0xaafb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xaafb('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f106a,_0x53455d,_0x507cb3){return new BPromise(function(_0x2db8c4,_0x343de8){return client['request'](_0x4f106a,_0x507cb3)[_0xaafb('0x8')](function(_0x8150bf){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x53455d,'request\x20sent');logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x53455d,_0xaafb('0x9'),JSON[_0xaafb('0xa')](_0x8150bf));if(_0x8150bf['error']){if(_0x8150bf[_0xaafb('0xb')]['code']===0x1f4){logger[_0xaafb('0xb')](_0xaafb('0xc'),_0x53455d,_0x8150bf['error'][_0xaafb('0xd')]);return _0x343de8(_0x8150bf[_0xaafb('0xb')]['message']);}logger[_0xaafb('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x53455d,_0x8150bf['error'][_0xaafb('0xd')]);return _0x2db8c4(_0x8150bf['error'][_0xaafb('0xd')]);}else{logger['info'](_0xaafb('0xc'),_0x53455d,_0xaafb('0x9'));_0x2db8c4(_0x8150bf[_0xaafb('0xe')][_0xaafb('0xd')]);}})[_0xaafb('0xf')](function(_0x164ec4){logger[_0xaafb('0xb')](_0xaafb('0xc'),_0x53455d,_0x164ec4);_0x343de8(_0x164ec4);});});}
\ No newline at end of file
+var _0x058b=['debug','stringify','error','message','info','result','catch','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent'];(function(_0x41eccf,_0x6ab0ad){var _0x3bb165=function(_0x217cc7){while(--_0x217cc7){_0x41eccf['push'](_0x41eccf['shift']());}};_0x3bb165(++_0x6ab0ad);}(_0x058b,0x15b));var _0xb058=function(_0x1895b7,_0x21fbc7){_0x1895b7=_0x1895b7-0x0;var _0x1aecdc=_0x058b[_0x1895b7];return _0x1aecdc;};'use strict';var _=require('lodash');var util=require(_0xb058('0x0'));var moment=require(_0xb058('0x1'));var BPromise=require(_0xb058('0x2'));var rs=require(_0xb058('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb058('0x4'));var logger=require('../../config/logger')(_0xb058('0x5'));var config=require(_0xb058('0x6'));var jayson=require(_0xb058('0x7'));var client=jayson[_0xb058('0x8')][_0xb058('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x754e33,_0x159bb1,_0x26565a){return new BPromise(function(_0x2c82e1,_0x7ea6a0){return client[_0xb058('0xa')](_0x754e33,_0x26565a)['then'](function(_0x34ede3){logger['info'](_0xb058('0xb'),_0x159bb1,_0xb058('0xc'));logger[_0xb058('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x159bb1,_0xb058('0xc'),JSON[_0xb058('0xe')](_0x34ede3));if(_0x34ede3[_0xb058('0xf')]){if(_0x34ede3[_0xb058('0xf')]['code']===0x1f4){logger['error'](_0xb058('0xb'),_0x159bb1,_0x34ede3['error']['message']);return _0x7ea6a0(_0x34ede3['error']['message']);}logger[_0xb058('0xf')](_0xb058('0xb'),_0x159bb1,_0x34ede3[_0xb058('0xf')][_0xb058('0x10')]);return _0x2c82e1(_0x34ede3[_0xb058('0xf')]['message']);}else{logger[_0xb058('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x159bb1,_0xb058('0xc'));_0x2c82e1(_0x34ede3[_0xb058('0x12')][_0xb058('0x10')]);}})[_0xb058('0x13')](function(_0x1ea42e){logger[_0xb058('0xf')](_0xb058('0xb'),_0x159bb1,_0x1ea42e);_0x7ea6a0(_0x1ea42e);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index e4592c7..aec7981 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 _0xefe7=['../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','delete','destroy','util','path','fs-extra','../../components/interaction/service'];(function(_0x182fff,_0x568aee){var _0x1b4171=function(_0x212d46){while(--_0x212d46){_0x182fff['push'](_0x182fff['shift']());}};_0x1b4171(++_0x568aee);}(_0xefe7,0x1a5));var _0x7efe=function(_0x49ec58,_0x59a955){_0x49ec58=_0x49ec58-0x0;var _0x3547f2=_0xefe7[_0x49ec58];return _0x3547f2;};'use strict';var multer=require('multer');var util=require(_0x7efe('0x0'));var path=require(_0x7efe('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x7efe('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x7efe('0x3'));var config=require(_0x7efe('0x4'));var controller=require(_0x7efe('0x5'));router[_0x7efe('0x6')]('/',auth[_0x7efe('0x7')](),controller[_0x7efe('0x8')]);router[_0x7efe('0x6')](_0x7efe('0x9'),auth[_0x7efe('0x7')](),controller['show']);router[_0x7efe('0x6')](_0x7efe('0xa'),auth[_0x7efe('0x7')](),controller[_0x7efe('0xb')]);router[_0x7efe('0xc')]('/',auth[_0x7efe('0x7')](),controller[_0x7efe('0xd')]);router[_0x7efe('0xe')](_0x7efe('0x9'),auth[_0x7efe('0x7')](),controller['update']);router[_0x7efe('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x7efe('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x6a30=['express','Router','fs-extra','../../components/auth/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','delete','exports','multer','util','path'];(function(_0x395e0b,_0x3f93fc){var _0x26b110=function(_0x1e90d8){while(--_0x1e90d8){_0x395e0b['push'](_0x395e0b['shift']());}};_0x26b110(++_0x3f93fc);}(_0x6a30,0x1e0));var _0x06a3=function(_0x4687aa,_0x52ce79){_0x4687aa=_0x4687aa-0x0;var _0x129611=_0x6a30[_0x4687aa];return _0x129611;};'use strict';var multer=require(_0x06a3('0x0'));var util=require(_0x06a3('0x1'));var path=require(_0x06a3('0x2'));var timeout=require('connect-timeout');var express=require(_0x06a3('0x3'));var router=express[_0x06a3('0x4')]();var fs_extra=require(_0x06a3('0x5'));var auth=require(_0x06a3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x06a3('0x7'));router[_0x06a3('0x8')]('/',auth[_0x06a3('0x9')](),controller[_0x06a3('0xa')]);router[_0x06a3('0x8')](_0x06a3('0xb'),auth[_0x06a3('0x9')](),controller[_0x06a3('0xc')]);router['get'](_0x06a3('0xd'),auth[_0x06a3('0x9')](),controller[_0x06a3('0xe')]);router[_0x06a3('0xf')]('/',auth[_0x06a3('0x9')](),controller[_0x06a3('0x10')]);router[_0x06a3('0x11')]('/:id',auth[_0x06a3('0x9')](),controller[_0x06a3('0x12')]);router[_0x06a3('0x13')](_0x06a3('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x06a3('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 500ae2c..e2d9515 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 _0x0654=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x3b6eb9,_0x409248){var _0x2d48a4=function(_0x5c5fb8){while(--_0x5c5fb8){_0x3b6eb9['push'](_0x3b6eb9['shift']());}};_0x2d48a4(++_0x409248);}(_0x0654,0x112));var _0x4065=function(_0x3f0d91,_0x4085a9){_0x3f0d91=_0x3f0d91-0x0;var _0x347609=_0x0654[_0x3f0d91];return _0x347609;};'use strict';var Sequelize=require(_0x4065('0x0'));module['exports']={'field':{'type':Sequelize[_0x4065('0x1')]},'alias':{'type':Sequelize[_0x4065('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x4065('0x2')]},'groupBy':{'type':Sequelize[_0x4065('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x4065('0x2')]},'custom':{'type':Sequelize[_0x4065('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x2e8f=['TEXT','STRING','BOOLEAN','sequelize'];(function(_0xea9e1c,_0x577088){var _0x3bdb61=function(_0x35e3c1){while(--_0x35e3c1){_0xea9e1c['push'](_0xea9e1c['shift']());}};_0x3bdb61(++_0x577088);}(_0x2e8f,0x1d3));var _0xf2e8=function(_0x30cd7e,_0x4db10a){_0x30cd7e=_0x30cd7e-0x0;var _0x462a02=_0x2e8f[_0x30cd7e];return _0x462a02;};'use strict';var Sequelize=require(_0xf2e8('0x0'));module['exports']={'field':{'type':Sequelize[_0xf2e8('0x1')]},'alias':{'type':Sequelize[_0xf2e8('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xf2e8('0x2')]},'groupBy':{'type':Sequelize[_0xf2e8('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xf2e8('0x2')]},'custom':{'type':Sequelize[_0xf2e8('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 8a3bc8d..4603bc5 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 _0x4b3b=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','offset','count','limit','set','Content-Range','apply','update','then','end','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','fieldName','type','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','rawAttributes','keys','length','find','catch','create','bulkCreate','body','destroy','bulkDestroy','AnalyticCustomReport','transaction','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x4b5d99,_0x44ecdf){var _0x47d02a=function(_0x5a76ee){while(--_0x5a76ee){_0x4b5d99['push'](_0x4b5d99['shift']());}};_0x47d02a(++_0x44ecdf);}(_0x4b3b,0x9e));var _0xb4b3=function(_0x14af86,_0x132945){_0x14af86=_0x14af86-0x0;var _0x3e7433=_0x4b3b[_0x14af86];return _0x3e7433;};'use strict';var emlformat=require(_0xb4b3('0x0'));var rimraf=require(_0xb4b3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb4b3('0x2'));var rp=require(_0xb4b3('0x3'));var moment=require(_0xb4b3('0x4'));var BPromise=require(_0xb4b3('0x5'));var Mustache=require(_0xb4b3('0x6'));var util=require(_0xb4b3('0x7'));var path=require(_0xb4b3('0x8'));var sox=require(_0xb4b3('0x9'));var csv=require(_0xb4b3('0xa'));var ejs=require(_0xb4b3('0xb'));var fs=require('fs');var fs_extra=require(_0xb4b3('0xc'));var _=require(_0xb4b3('0xd'));var squel=require(_0xb4b3('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb4b3('0xf'));var toCsv=require(_0xb4b3('0xa'));var querystring=require(_0xb4b3('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb4b3('0x11'));var as=require(_0xb4b3('0x12'));var hardwareService=require(_0xb4b3('0x13'));var logger=require(_0xb4b3('0x14'))(_0xb4b3('0x15'));var utils=require(_0xb4b3('0x16'));var config=require(_0xb4b3('0x17'));var licenseUtil=require(_0xb4b3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x547572,_0x57424a){_0x57424a=_0x57424a||0xcc;return function(_0x292004){if(_0x292004){return _0x547572['sendStatus'](_0x57424a);}return _0x547572[_0xb4b3('0x19')](_0x57424a)['end']();};}function respondWithResult(_0x3bc160,_0x4f88e3){_0x4f88e3=_0x4f88e3||0xc8;return function(_0x2ae9f7){if(_0x2ae9f7){return _0x3bc160[_0xb4b3('0x19')](_0x4f88e3)[_0xb4b3('0x1a')](_0x2ae9f7);}};}function respondWithFilteredResult(_0x21f8ff,_0x286fa4){return function(_0x394b87){if(_0x394b87){var _0xbe961a=typeof _0x286fa4['offset']===_0xb4b3('0x1b')&&typeof _0x286fa4['limit']===_0xb4b3('0x1b');var _0x313bd7=_0x394b87['count'];var _0xbd9945=_0xbe961a?0x0:_0x286fa4[_0xb4b3('0x1c')];var _0x26f6cc=_0xbe961a?_0x394b87[_0xb4b3('0x1d')]:_0x286fa4[_0xb4b3('0x1c')]+_0x286fa4[_0xb4b3('0x1e')];var _0x4c9e8e;if(_0x26f6cc>=_0x313bd7){_0x26f6cc=_0x313bd7;_0x4c9e8e=0xc8;}else{_0x4c9e8e=0xce;}_0x21f8ff[_0xb4b3('0x19')](_0x4c9e8e);return _0x21f8ff[_0xb4b3('0x1f')](_0xb4b3('0x20'),_0xbd9945+'-'+_0x26f6cc+'/'+_0x313bd7)[_0xb4b3('0x1a')](_0x394b87);}return null;};}function patchUpdates(_0x55a6c1){return function(_0x985351){try{jsonpatch[_0xb4b3('0x21')](_0x985351,_0x55a6c1,!![]);}catch(_0x3e1107){return BPromise['reject'](_0x3e1107);}return _0x985351['save']();};}function saveUpdates(_0x57ab56,_0x56f4f4){return function(_0x4166bb){if(_0x4166bb){return _0x4166bb[_0xb4b3('0x22')](_0x57ab56)[_0xb4b3('0x23')](function(_0x372c6b){return _0x372c6b;});}return null;};}function removeEntity(_0x56fad5,_0x18ee92){return function(_0xe51afe){if(_0xe51afe){return _0xe51afe['destroy']()[_0xb4b3('0x23')](function(){_0x56fad5[_0xb4b3('0x19')](0xcc)[_0xb4b3('0x24')]();});}};}function handleEntityNotFound(_0x36b63a,_0x310eff){return function(_0x57d4ba){if(!_0x57d4ba){_0x36b63a[_0xb4b3('0x25')](0x194);}return _0x57d4ba;};}function handleError(_0x4abf89,_0x3347ed){_0x3347ed=_0x3347ed||0x1f4;return function(_0x5e68e1){logger[_0xb4b3('0x26')](_0x5e68e1[_0xb4b3('0x27')]);if(_0x5e68e1[_0xb4b3('0x28')]){delete _0x5e68e1[_0xb4b3('0x28')];}_0x4abf89['status'](_0x3347ed)[_0xb4b3('0x29')](_0x5e68e1);};}exports[_0xb4b3('0x2a')]=function(_0x24cc17,_0x27baa4){var _0x47a3d7={},_0xd5db1f={},_0x2e2b98={'count':0x0,'rows':[]};var _0x1d1c71=_[_0xb4b3('0x2b')](db[_0xb4b3('0x2c')]['rawAttributes'],function(_0x424434){return{'name':_0x424434[_0xb4b3('0x2d')],'type':_0x424434[_0xb4b3('0x2e')][_0xb4b3('0x2f')]};});_0xd5db1f[_0xb4b3('0x30')]=_[_0xb4b3('0x2b')](_0x1d1c71,'name');_0xd5db1f[_0xb4b3('0x31')]=_['keys'](_0x24cc17[_0xb4b3('0x31')]);_0xd5db1f['filters']=_['intersection'](_0xd5db1f['model'],_0xd5db1f[_0xb4b3('0x31')]);_0x47a3d7[_0xb4b3('0x32')]=_[_0xb4b3('0x33')](_0xd5db1f['model'],qs[_0xb4b3('0x34')](_0x24cc17[_0xb4b3('0x31')][_0xb4b3('0x34')]));_0x47a3d7[_0xb4b3('0x32')]=_0x47a3d7[_0xb4b3('0x32')]['length']?_0x47a3d7[_0xb4b3('0x32')]:_0xd5db1f[_0xb4b3('0x30')];if(!_0x24cc17[_0xb4b3('0x31')][_0xb4b3('0x35')](_0xb4b3('0x36'))){_0x47a3d7[_0xb4b3('0x1e')]=qs['limit'](_0x24cc17[_0xb4b3('0x31')][_0xb4b3('0x1e')]);_0x47a3d7[_0xb4b3('0x1c')]=qs[_0xb4b3('0x1c')](_0x24cc17[_0xb4b3('0x31')][_0xb4b3('0x1c')]);}_0x47a3d7[_0xb4b3('0x37')]=qs[_0xb4b3('0x38')](_0x24cc17[_0xb4b3('0x31')]['sort']);_0x47a3d7[_0xb4b3('0x39')]=qs[_0xb4b3('0x3a')](_[_0xb4b3('0x3b')](_0x24cc17[_0xb4b3('0x31')],_0xd5db1f[_0xb4b3('0x3a')]),_0x1d1c71);if(_0x24cc17[_0xb4b3('0x31')][_0xb4b3('0x3c')]){_0x47a3d7[_0xb4b3('0x39')]=_['merge'](_0x47a3d7[_0xb4b3('0x39')],{'$or':_['map'](_0x1d1c71,function(_0x3382a1){if(_0x3382a1['type']!==_0xb4b3('0x3d')){var _0xfe4982={};_0xfe4982[_0x3382a1[_0xb4b3('0x28')]]={'$like':'%'+_0x24cc17[_0xb4b3('0x31')][_0xb4b3('0x3c')]+'%'};return _0xfe4982;}})});}_0x47a3d7=_[_0xb4b3('0x3e')]({},_0x47a3d7,_0x24cc17[_0xb4b3('0x3f')]);var _0x1f2f36={'where':_0x47a3d7['where']};return db['AnalyticFieldReport'][_0xb4b3('0x1d')](_0x1f2f36)[_0xb4b3('0x23')](function(_0x5c5fb5){_0x2e2b98[_0xb4b3('0x1d')]=_0x5c5fb5;if(_0x24cc17['query'][_0xb4b3('0x40')]){_0x47a3d7[_0xb4b3('0x41')]=[{'all':!![]}];}return db[_0xb4b3('0x2c')][_0xb4b3('0x42')](_0x47a3d7);})[_0xb4b3('0x23')](function(_0x58ef38){_0x2e2b98['rows']=_0x58ef38;return _0x2e2b98;})['then'](respondWithFilteredResult(_0x27baa4,_0x47a3d7))['catch'](handleError(_0x27baa4,null));};exports[_0xb4b3('0x43')]=function(_0xe4312f,_0x566414){var _0x57d4d7={'raw':![],'where':{'id':_0xe4312f[_0xb4b3('0x44')]['id']}},_0x46ac6c={};_0x46ac6c[_0xb4b3('0x30')]=_['keys'](db[_0xb4b3('0x2c')][_0xb4b3('0x45')]);_0x46ac6c[_0xb4b3('0x31')]=_[_0xb4b3('0x46')](_0xe4312f[_0xb4b3('0x31')]);_0x46ac6c[_0xb4b3('0x3a')]=_[_0xb4b3('0x33')](_0x46ac6c[_0xb4b3('0x30')],_0x46ac6c[_0xb4b3('0x31')]);_0x57d4d7[_0xb4b3('0x32')]=_[_0xb4b3('0x33')](_0x46ac6c[_0xb4b3('0x30')],qs[_0xb4b3('0x34')](_0xe4312f[_0xb4b3('0x31')][_0xb4b3('0x34')]));_0x57d4d7[_0xb4b3('0x32')]=_0x57d4d7[_0xb4b3('0x32')][_0xb4b3('0x47')]?_0x57d4d7[_0xb4b3('0x32')]:_0x46ac6c[_0xb4b3('0x30')];if(_0xe4312f['query'][_0xb4b3('0x40')]){_0x57d4d7[_0xb4b3('0x41')]=[{'all':!![]}];}_0x57d4d7=_[_0xb4b3('0x3e')]({},_0x57d4d7,_0xe4312f['options']);return db[_0xb4b3('0x2c')][_0xb4b3('0x48')](_0x57d4d7)[_0xb4b3('0x23')](handleEntityNotFound(_0x566414,null))[_0xb4b3('0x23')](respondWithResult(_0x566414,null))[_0xb4b3('0x49')](handleError(_0x566414,null));};exports[_0xb4b3('0x4a')]=function(_0x7b71c5,_0x3bb709){return db[_0xb4b3('0x2c')]['create'](_0x7b71c5['body'],{})[_0xb4b3('0x23')](respondWithResult(_0x3bb709,0xc9))[_0xb4b3('0x49')](handleError(_0x3bb709,null));};exports[_0xb4b3('0x4b')]=function(_0x1ffdf7,_0x860cfe){return db[_0xb4b3('0x2c')][_0xb4b3('0x4b')](_0x1ffdf7[_0xb4b3('0x4c')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x860cfe,0xc9))[_0xb4b3('0x49')](handleError(_0x860cfe,null));};exports[_0xb4b3('0x22')]=function(_0x4790c9,_0x5aac59){if(_0x4790c9[_0xb4b3('0x4c')]['id']){delete _0x4790c9[_0xb4b3('0x4c')]['id'];}return db['AnalyticFieldReport'][_0xb4b3('0x48')]({'where':{'id':_0x4790c9[_0xb4b3('0x44')]['id']}})[_0xb4b3('0x23')](handleEntityNotFound(_0x5aac59,null))[_0xb4b3('0x23')](saveUpdates(_0x4790c9[_0xb4b3('0x4c')],null))[_0xb4b3('0x23')](respondWithResult(_0x5aac59,null))[_0xb4b3('0x49')](handleError(_0x5aac59,null));};exports[_0xb4b3('0x4d')]=function(_0x227a8e,_0x4bc5f5){return db['AnalyticFieldReport'][_0xb4b3('0x48')]({'where':{'id':_0x227a8e[_0xb4b3('0x44')]['id']}})[_0xb4b3('0x23')](handleEntityNotFound(_0x4bc5f5,null))['then'](removeEntity(_0x4bc5f5,null))[_0xb4b3('0x49')](handleError(_0x4bc5f5,null));};exports[_0xb4b3('0x4e')]=function(_0x43157a,_0x313ef0){return db[_0xb4b3('0x2c')][_0xb4b3('0x4d')]({'where':{'id':_0x43157a[_0xb4b3('0x31')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xb4b3('0x23')](respondWithResult(_0x313ef0,0xcc))[_0xb4b3('0x49')](handleError(_0x313ef0,null));};exports['addFields']=function(_0x17a388,_0x6a22cb,_0x2513c4){return db[_0xb4b3('0x4f')]['findOne']({'where':{'id':_0x17a388['params']['id']}})[_0xb4b3('0x23')](handleEntityNotFound(_0x6a22cb,null))[_0xb4b3('0x23')](function(_0x3c04fc){if(_0x3c04fc){return db['sequelize'][_0xb4b3('0x50')](function(_0x48b245){return db['AnalyticFieldReport'][_0xb4b3('0x4d')]({'where':{'CustomReportId':_0x17a388['params']['id']},'transaction':_0x48b245})[_0xb4b3('0x23')](function(_0x2931b2){var _0x425532=_[_0xb4b3('0x2b')](_0x17a388[_0xb4b3('0x4c')],function(_0x2e1a78){delete _0x2e1a78['id'];_0x2e1a78['CustomReportId']=_0x17a388[_0xb4b3('0x44')]['id'];return _0x2e1a78;});return db[_0xb4b3('0x2c')][_0xb4b3('0x4b')](_0x425532,{'transaction':_0x48b245});});})[_0xb4b3('0x23')](function(){return db[_0xb4b3('0x2c')]['findAll']({'where':{'CustomReportId':_0x17a388['params']['id']}});});}})[_0xb4b3('0x23')](respondWithResult(_0x6a22cb,null))[_0xb4b3('0x49')](handleError(_0x6a22cb,null));};
\ No newline at end of file
+var _0xb27a=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticFieldReport','include','rows','catch','show','params','intersection','includeAll','find','create','body','bulkCreate','ids','addFields','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length'];(function(_0x1288db,_0x211057){var _0x1df750=function(_0x2caccc){while(--_0x2caccc){_0x1288db['push'](_0x1288db['shift']());}};_0x1df750(++_0x211057);}(_0xb27a,0x15d));var _0xab27=function(_0xdbd4f7,_0x4e3bdd){_0xdbd4f7=_0xdbd4f7-0x0;var _0x5c3f9d=_0xb27a[_0xdbd4f7];return _0x5c3f9d;};'use strict';var emlformat=require(_0xab27('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xab27('0x1'));var rp=require(_0xab27('0x2'));var moment=require(_0xab27('0x3'));var BPromise=require(_0xab27('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xab27('0x5'));var sox=require('sox');var csv=require(_0xab27('0x6'));var ejs=require(_0xab27('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xab27('0x8'));var crypto=require(_0xab27('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xab27('0xa'));var toCsv=require(_0xab27('0x6'));var querystring=require('querystring');var Papa=require(_0xab27('0xb'));var Redis=require(_0xab27('0xc'));var authService=require(_0xab27('0xd'));var qs=require(_0xab27('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab27('0xf'));var logger=require(_0xab27('0x10'))(_0xab27('0x11'));var utils=require('../../config/utils');var config=require(_0xab27('0x12'));var licenseUtil=require(_0xab27('0x13'));var db=require(_0xab27('0x14'))['db'];function respondWithStatusCode(_0x38fe92,_0x328b35){_0x328b35=_0x328b35||0xcc;return function(_0x5bdd7a){if(_0x5bdd7a){return _0x38fe92[_0xab27('0x15')](_0x328b35);}return _0x38fe92[_0xab27('0x16')](_0x328b35)[_0xab27('0x17')]();};}function respondWithResult(_0x4cc759,_0x34bc1c){_0x34bc1c=_0x34bc1c||0xc8;return function(_0xea6b5a){if(_0xea6b5a){return _0x4cc759['status'](_0x34bc1c)[_0xab27('0x18')](_0xea6b5a);}};}function respondWithFilteredResult(_0x129f22,_0x4105da){return function(_0x4b2d5f){if(_0x4b2d5f){var _0x3bab27=typeof _0x4105da[_0xab27('0x19')]==='undefined'&&typeof _0x4105da[_0xab27('0x1a')]===_0xab27('0x1b');var _0x299e97=_0x4b2d5f[_0xab27('0x1c')];var _0xb2a05a=_0x3bab27?0x0:_0x4105da[_0xab27('0x19')];var _0x4ecb6b=_0x3bab27?_0x4b2d5f[_0xab27('0x1c')]:_0x4105da[_0xab27('0x19')]+_0x4105da[_0xab27('0x1a')];var _0x112d30;if(_0x4ecb6b>=_0x299e97){_0x4ecb6b=_0x299e97;_0x112d30=0xc8;}else{_0x112d30=0xce;}_0x129f22[_0xab27('0x16')](_0x112d30);return _0x129f22[_0xab27('0x1d')](_0xab27('0x1e'),_0xb2a05a+'-'+_0x4ecb6b+'/'+_0x299e97)['json'](_0x4b2d5f);}return null;};}function patchUpdates(_0x17f648){return function(_0x14f0ca){try{jsonpatch[_0xab27('0x1f')](_0x14f0ca,_0x17f648,!![]);}catch(_0x588f90){return BPromise[_0xab27('0x20')](_0x588f90);}return _0x14f0ca[_0xab27('0x21')]();};}function saveUpdates(_0xc35d41,_0xd6b8ff){return function(_0x57a8c2){if(_0x57a8c2){return _0x57a8c2[_0xab27('0x22')](_0xc35d41)[_0xab27('0x23')](function(_0xe3720e){return _0xe3720e;});}return null;};}function removeEntity(_0x3ad723,_0x4822dc){return function(_0x5756e9){if(_0x5756e9){return _0x5756e9[_0xab27('0x24')]()[_0xab27('0x23')](function(){_0x3ad723[_0xab27('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e03c9,_0x26ef77){return function(_0x39681a){if(!_0x39681a){_0x1e03c9[_0xab27('0x15')](0x194);}return _0x39681a;};}function handleError(_0x383aef,_0x3a591a){_0x3a591a=_0x3a591a||0x1f4;return function(_0x524b9e){logger[_0xab27('0x25')](_0x524b9e[_0xab27('0x26')]);if(_0x524b9e[_0xab27('0x27')]){delete _0x524b9e[_0xab27('0x27')];}_0x383aef['status'](_0x3a591a)[_0xab27('0x28')](_0x524b9e);};}exports['index']=function(_0x160ff0,_0x5b257e){var _0x3ba5be={},_0x45c6bf={},_0x1c9898={'count':0x0,'rows':[]};var _0x31c96a=_[_0xab27('0x29')](db['AnalyticFieldReport'][_0xab27('0x2a')],function(_0x57ef62){return{'name':_0x57ef62[_0xab27('0x2b')],'type':_0x57ef62['type']['key']};});_0x45c6bf[_0xab27('0x2c')]=_[_0xab27('0x29')](_0x31c96a,_0xab27('0x27'));_0x45c6bf[_0xab27('0x2d')]=_[_0xab27('0x2e')](_0x160ff0['query']);_0x45c6bf[_0xab27('0x2f')]=_['intersection'](_0x45c6bf[_0xab27('0x2c')],_0x45c6bf[_0xab27('0x2d')]);_0x3ba5be[_0xab27('0x30')]=_['intersection'](_0x45c6bf[_0xab27('0x2c')],qs[_0xab27('0x31')](_0x160ff0[_0xab27('0x2d')]['fields']));_0x3ba5be[_0xab27('0x30')]=_0x3ba5be['attributes'][_0xab27('0x32')]?_0x3ba5be[_0xab27('0x30')]:_0x45c6bf[_0xab27('0x2c')];if(!_0x160ff0[_0xab27('0x2d')][_0xab27('0x33')](_0xab27('0x34'))){_0x3ba5be[_0xab27('0x1a')]=qs['limit'](_0x160ff0[_0xab27('0x2d')][_0xab27('0x1a')]);_0x3ba5be['offset']=qs['offset'](_0x160ff0[_0xab27('0x2d')][_0xab27('0x19')]);}_0x3ba5be[_0xab27('0x35')]=qs['sort'](_0x160ff0[_0xab27('0x2d')][_0xab27('0x36')]);_0x3ba5be[_0xab27('0x37')]=qs['filters'](_[_0xab27('0x38')](_0x160ff0[_0xab27('0x2d')],_0x45c6bf[_0xab27('0x2f')]),_0x31c96a);if(_0x160ff0['query'][_0xab27('0x39')]){_0x3ba5be[_0xab27('0x37')]=_[_0xab27('0x3a')](_0x3ba5be[_0xab27('0x37')],{'$or':_['map'](_0x31c96a,function(_0x59a18a){if(_0x59a18a['type']!==_0xab27('0x3b')){var _0x19ef19={};_0x19ef19[_0x59a18a['name']]={'$like':'%'+_0x160ff0['query'][_0xab27('0x39')]+'%'};return _0x19ef19;}})});}_0x3ba5be=_['merge']({},_0x3ba5be,_0x160ff0[_0xab27('0x3c')]);var _0x2b4c1e={'where':_0x3ba5be['where']};return db[_0xab27('0x3d')][_0xab27('0x1c')](_0x2b4c1e)[_0xab27('0x23')](function(_0x359557){_0x1c9898[_0xab27('0x1c')]=_0x359557;if(_0x160ff0[_0xab27('0x2d')]['includeAll']){_0x3ba5be[_0xab27('0x3e')]=[{'all':!![]}];}return db[_0xab27('0x3d')]['findAll'](_0x3ba5be);})[_0xab27('0x23')](function(_0x3b4581){_0x1c9898[_0xab27('0x3f')]=_0x3b4581;return _0x1c9898;})[_0xab27('0x23')](respondWithFilteredResult(_0x5b257e,_0x3ba5be))[_0xab27('0x40')](handleError(_0x5b257e,null));};exports[_0xab27('0x41')]=function(_0xb400be,_0x1b875c){var _0x375fc7={'raw':![],'where':{'id':_0xb400be[_0xab27('0x42')]['id']}},_0x567f8a={};_0x567f8a[_0xab27('0x2c')]=_[_0xab27('0x2e')](db['AnalyticFieldReport']['rawAttributes']);_0x567f8a[_0xab27('0x2d')]=_['keys'](_0xb400be['query']);_0x567f8a['filters']=_[_0xab27('0x43')](_0x567f8a[_0xab27('0x2c')],_0x567f8a[_0xab27('0x2d')]);_0x375fc7[_0xab27('0x30')]=_['intersection'](_0x567f8a[_0xab27('0x2c')],qs['fields'](_0xb400be[_0xab27('0x2d')][_0xab27('0x31')]));_0x375fc7[_0xab27('0x30')]=_0x375fc7[_0xab27('0x30')]['length']?_0x375fc7[_0xab27('0x30')]:_0x567f8a['model'];if(_0xb400be[_0xab27('0x2d')][_0xab27('0x44')]){_0x375fc7[_0xab27('0x3e')]=[{'all':!![]}];}_0x375fc7=_[_0xab27('0x3a')]({},_0x375fc7,_0xb400be[_0xab27('0x3c')]);return db[_0xab27('0x3d')][_0xab27('0x45')](_0x375fc7)[_0xab27('0x23')](handleEntityNotFound(_0x1b875c,null))[_0xab27('0x23')](respondWithResult(_0x1b875c,null))[_0xab27('0x40')](handleError(_0x1b875c,null));};exports[_0xab27('0x46')]=function(_0x20e968,_0x16aa4e){return db[_0xab27('0x3d')][_0xab27('0x46')](_0x20e968[_0xab27('0x47')],{})['then'](respondWithResult(_0x16aa4e,0xc9))[_0xab27('0x40')](handleError(_0x16aa4e,null));};exports[_0xab27('0x48')]=function(_0x327490,_0x3b0800){return db[_0xab27('0x3d')][_0xab27('0x48')](_0x327490[_0xab27('0x47')],{'raw':![],'individualHooks':!![]})[_0xab27('0x23')](respondWithResult(_0x3b0800,0xc9))[_0xab27('0x40')](handleError(_0x3b0800,null));};exports[_0xab27('0x22')]=function(_0x58ad8a,_0x5e9d02){if(_0x58ad8a[_0xab27('0x47')]['id']){delete _0x58ad8a[_0xab27('0x47')]['id'];}return db[_0xab27('0x3d')]['find']({'where':{'id':_0x58ad8a[_0xab27('0x42')]['id']}})['then'](handleEntityNotFound(_0x5e9d02,null))[_0xab27('0x23')](saveUpdates(_0x58ad8a[_0xab27('0x47')],null))['then'](respondWithResult(_0x5e9d02,null))[_0xab27('0x40')](handleError(_0x5e9d02,null));};exports[_0xab27('0x24')]=function(_0x360038,_0x8bd080){return db[_0xab27('0x3d')][_0xab27('0x45')]({'where':{'id':_0x360038[_0xab27('0x42')]['id']}})[_0xab27('0x23')](handleEntityNotFound(_0x8bd080,null))['then'](removeEntity(_0x8bd080,null))[_0xab27('0x40')](handleError(_0x8bd080,null));};exports['bulkDestroy']=function(_0x1c72e9,_0x14ba0a){return db[_0xab27('0x3d')][_0xab27('0x24')]({'where':{'id':_0x1c72e9['query'][_0xab27('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0xab27('0x23')](respondWithResult(_0x14ba0a,0xcc))[_0xab27('0x40')](handleError(_0x14ba0a,null));};exports[_0xab27('0x4a')]=function(_0x3c82a0,_0x471fd7,_0x45a873){return db['AnalyticCustomReport'][_0xab27('0x4b')]({'where':{'id':_0x3c82a0[_0xab27('0x42')]['id']}})['then'](handleEntityNotFound(_0x471fd7,null))[_0xab27('0x23')](function(_0x215070){if(_0x215070){return db[_0xab27('0x4c')][_0xab27('0x4d')](function(_0x274454){return db[_0xab27('0x3d')][_0xab27('0x24')]({'where':{'CustomReportId':_0x3c82a0[_0xab27('0x42')]['id']},'transaction':_0x274454})[_0xab27('0x23')](function(_0x4ac641){var _0x33ead2=_['map'](_0x3c82a0[_0xab27('0x47')],function(_0x42726b){delete _0x42726b['id'];_0x42726b[_0xab27('0x4e')]=_0x3c82a0['params']['id'];return _0x42726b;});return db[_0xab27('0x3d')][_0xab27('0x48')](_0x33ead2,{'transaction':_0x274454});});})[_0xab27('0x23')](function(){return db[_0xab27('0x3d')][_0xab27('0x4f')]({'where':{'CustomReportId':_0x3c82a0[_0xab27('0x42')]['id']}});});}})[_0xab27('0x23')](respondWithResult(_0x471fd7,null))['catch'](handleError(_0x471fd7,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 1908249..08bc382 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 _0x8021=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields'];(function(_0x5253d7,_0x2ea8f8){var _0x1dd6c9=function(_0x5a6448){while(--_0x5a6448){_0x5253d7['push'](_0x5253d7['shift']());}};_0x1dd6c9(++_0x2ea8f8);}(_0x8021,0x1bc));var _0x1802=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x8021[_0xfa634c];return _0x73e478;};'use strict';var _=require(_0x1802('0x0'));var util=require(_0x1802('0x1'));var logger=require(_0x1802('0x2'))(_0x1802('0x3'));var moment=require(_0x1802('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1802('0x5'));var rimraf=require(_0x1802('0x6'));var config=require(_0x1802('0x7'));var attributes=require(_0x1802('0x8'));module[_0x1802('0x9')]=function(_0x4be4ef,_0xc0bea4){return _0x4be4ef[_0x1802('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0x1802('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xde1e=['lodash','util','api','bluebird','path','../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport','analytics_report_fields'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xde1e,0xd8));var _0xede1=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xde1e[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xede1('0x0'));var util=require(_0xede1('0x1'));var logger=require('../../config/logger')(_0xede1('0x2'));var moment=require('moment');var BPromise=require(_0xede1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xede1('0x4'));var rimraf=require('rimraf');var config=require(_0xede1('0x5'));var attributes=require(_0xede1('0x6'));module['exports']=function(_0x2611ce,_0x15da99){return _0x2611ce['define'](_0xede1('0x7'),attributes,{'tableName':_0xede1('0x8'),'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 16e5506..3611f69 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 _0xefb1=['code','AnalyticFieldReport,\x20%s,\x20%s','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1913ee,_0x42ad2e){var _0x144c22=function(_0x27f5ac){while(--_0x27f5ac){_0x1913ee['push'](_0x1913ee['shift']());}};_0x144c22(++_0x42ad2e);}(_0xefb1,0xe0));var _0x1efb=function(_0x4969ce,_0x1cf3ee){_0x4969ce=_0x4969ce-0x0;var _0x24d478=_0xefb1[_0x4969ce];return _0x24d478;};'use strict';var _=require('lodash');var util=require(_0x1efb('0x0'));var moment=require(_0x1efb('0x1'));var BPromise=require('bluebird');var rs=require(_0x1efb('0x2'));var fs=require('fs');var Redis=require(_0x1efb('0x3'));var db=require(_0x1efb('0x4'))['db'];var utils=require(_0x1efb('0x5'));var logger=require(_0x1efb('0x6'))(_0x1efb('0x7'));var config=require('../../config/environment');var jayson=require(_0x1efb('0x8'));var client=jayson[_0x1efb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31d82a,_0x1a6e48,_0x3e305d){return new BPromise(function(_0x5ab77b,_0x18aa90){return client[_0x1efb('0xa')](_0x31d82a,_0x3e305d)[_0x1efb('0xb')](function(_0x1c27e0){logger[_0x1efb('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1a6e48,_0x1efb('0xd'));logger[_0x1efb('0xe')](_0x1efb('0xf'),_0x1a6e48,_0x1efb('0xd'),JSON[_0x1efb('0x10')](_0x1c27e0));if(_0x1c27e0[_0x1efb('0x11')]){if(_0x1c27e0[_0x1efb('0x11')][_0x1efb('0x12')]===0x1f4){logger[_0x1efb('0x11')](_0x1efb('0x13'),_0x1a6e48,_0x1c27e0[_0x1efb('0x11')][_0x1efb('0x14')]);return _0x18aa90(_0x1c27e0[_0x1efb('0x11')][_0x1efb('0x14')]);}logger[_0x1efb('0x11')](_0x1efb('0x13'),_0x1a6e48,_0x1c27e0[_0x1efb('0x11')]['message']);return _0x5ab77b(_0x1c27e0[_0x1efb('0x11')][_0x1efb('0x14')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x1a6e48,'request\x20sent');_0x5ab77b(_0x1c27e0['result'][_0x1efb('0x14')]);}})[_0x1efb('0x15')](function(_0x4aac88){logger[_0x1efb('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1a6e48,_0x4aac88);_0x18aa90(_0x4aac88);});});}
\ No newline at end of file
+var _0x2ddd=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x33317b,_0x1394d0){var _0x5b607c=function(_0x3b2ec3){while(--_0x3b2ec3){_0x33317b['push'](_0x33317b['shift']());}};_0x5b607c(++_0x1394d0);}(_0x2ddd,0x197));var _0xd2dd=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0x2ddd[_0x4e93a9];return _0x43013c;};'use strict';var _=require(_0xd2dd('0x0'));var util=require(_0xd2dd('0x1'));var moment=require(_0xd2dd('0x2'));var BPromise=require(_0xd2dd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd2dd('0x4'));var db=require(_0xd2dd('0x5'))['db'];var utils=require(_0xd2dd('0x6'));var logger=require(_0xd2dd('0x7'))(_0xd2dd('0x8'));var config=require(_0xd2dd('0x9'));var jayson=require(_0xd2dd('0xa'));var client=jayson[_0xd2dd('0xb')][_0xd2dd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5bdacb,_0x20f76c,_0x1c6dbb){return new BPromise(function(_0x1c190f,_0x33f8a3){return client[_0xd2dd('0xd')](_0x5bdacb,_0x1c6dbb)['then'](function(_0xeaaca9){logger['info'](_0xd2dd('0xe'),_0x20f76c,_0xd2dd('0xf'));logger['debug'](_0xd2dd('0x10'),_0x20f76c,_0xd2dd('0xf'),JSON[_0xd2dd('0x11')](_0xeaaca9));if(_0xeaaca9[_0xd2dd('0x12')]){if(_0xeaaca9[_0xd2dd('0x12')][_0xd2dd('0x13')]===0x1f4){logger['error'](_0xd2dd('0xe'),_0x20f76c,_0xeaaca9[_0xd2dd('0x12')]['message']);return _0x33f8a3(_0xeaaca9['error'][_0xd2dd('0x14')]);}logger[_0xd2dd('0x12')](_0xd2dd('0xe'),_0x20f76c,_0xeaaca9[_0xd2dd('0x12')][_0xd2dd('0x14')]);return _0x1c190f(_0xeaaca9[_0xd2dd('0x12')][_0xd2dd('0x14')]);}else{logger[_0xd2dd('0x15')](_0xd2dd('0xe'),_0x20f76c,_0xd2dd('0xf'));_0x1c190f(_0xeaaca9[_0xd2dd('0x16')]['message']);}})[_0xd2dd('0x17')](function(_0x37be5f){logger[_0xd2dd('0x12')](_0xd2dd('0xe'),_0x20f76c,_0x37be5f);_0x33f8a3(_0x37be5f);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index bb842e8..720a632 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(_0x384016,_0x484d32){var _0x5f3433=function(_0x52c6a5){while(--_0x52c6a5){_0x384016['push'](_0x384016['shift']());}};_0x5f3433(++_0x484d32);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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(_0xa7719a,_0x291173){var _0x347ac6=function(_0x3e2e5e){while(--_0x3e2e5e){_0xa7719a['push'](_0xa7719a['shift']());}};_0x347ac6(++_0x291173);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 c8347af..b67bb1f 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 _0x8c38=['TEXT','sequelize','exports','name','STRING'];(function(_0x502664,_0x1b58c5){var _0x1ee5f9=function(_0x7b9d48){while(--_0x7b9d48){_0x502664['push'](_0x502664['shift']());}};_0x1ee5f9(++_0x1b58c5);}(_0x8c38,0x83));var _0x88c3=function(_0x5943d3,_0xb4cbee){_0x5943d3=_0x5943d3-0x0;var _0x3a4c08=_0x8c38[_0x5943d3];return _0x3a4c08;};'use strict';var Sequelize=require(_0x88c3('0x0'));module[_0x88c3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x88c3('0x2')},'table':{'type':Sequelize[_0x88c3('0x3')]},'metric':{'type':Sequelize[_0x88c3('0x4')]},'description':{'type':Sequelize[_0x88c3('0x3')]}};
\ No newline at end of file
+var _0xd48a=['name','TEXT','sequelize','STRING'];(function(_0xff073f,_0x1f1934){var _0x3cb13e=function(_0x5d41f2){while(--_0x5d41f2){_0xff073f['push'](_0xff073f['shift']());}};_0x3cb13e(++_0x1f1934);}(_0xd48a,0x96));var _0xad48=function(_0x1f5af8,_0x277b26){_0x1f5af8=_0x1f5af8-0x0;var _0x9398b6=_0xd48a[_0x1f5af8];return _0x9398b6;};'use strict';var Sequelize=require(_0xad48('0x0'));module['exports']={'name':{'type':Sequelize[_0xad48('0x1')],'allowNull':![],'unique':_0xad48('0x2')},'table':{'type':Sequelize[_0xad48('0x1')]},'metric':{'type':Sequelize[_0xad48('0x3')]},'description':{'type':Sequelize[_0xad48('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index f31af93..893cfd5 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 _0x4b84=['status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','stack','name','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x2401e6,_0x2248d7){var _0xf06a43=function(_0x477bd8){while(--_0x477bd8){_0x2401e6['push'](_0x2401e6['shift']());}};_0xf06a43(++_0x2248d7);}(_0x4b84,0x1cc));var _0x44b8=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0x4b84[_0xb833b1];return _0x1ab87a;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){var _0x41a922=_0x51a34a[_0x44b8('0x22')]({'plain':!![]});var _0x25a0c1=_0x44b8('0x23');return db[_0x44b8('0x24')]['destroy']({'where':{'type':_0x25a0c1,'resourceId':_0x41a922['id']}})[_0x44b8('0x20')](function(){return _0x51a34a;});})['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x549a26,_0x17ac44){return function(_0x470f49){if(!_0x470f49){_0x549a26[_0x44b8('0x25')](0x194);}return _0x470f49;};}function handleError(_0x59c1bf,_0xb22107){_0xb22107=_0xb22107||0x1f4;return function(_0x242342){logger['error'](_0x242342[_0x44b8('0x26')]);if(_0x242342['name']){delete _0x242342[_0x44b8('0x27')];}_0x59c1bf['status'](_0xb22107)['send'](_0x242342);};}exports['index']=function(_0x387293,_0x29b18d){var _0x44ce5a={},_0x1bd1be={},_0x38cd17={'count':0x0,'rows':[]};var _0xc3f667=_[_0x44b8('0x28')](db[_0x44b8('0x29')][_0x44b8('0x2a')],function(_0x28f918){return{'name':_0x28f918[_0x44b8('0x2b')],'type':_0x28f918[_0x44b8('0x2c')][_0x44b8('0x2d')]};});_0x1bd1be['model']=_[_0x44b8('0x28')](_0xc3f667,'name');_0x1bd1be[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x387293[_0x44b8('0x2e')]);_0x1bd1be[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x1bd1be['model'],_0x1bd1be[_0x44b8('0x2e')]);_0x44ce5a[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x1bd1be[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x387293['query'][_0x44b8('0x34')]));_0x44ce5a[_0x44b8('0x32')]=_0x44ce5a[_0x44b8('0x32')][_0x44b8('0x35')]?_0x44ce5a[_0x44b8('0x32')]:_0x1bd1be[_0x44b8('0x33')];if(!_0x387293[_0x44b8('0x2e')][_0x44b8('0x36')](_0x44b8('0x37'))){_0x44ce5a[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x17')]);_0x44ce5a[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x19')]);}_0x44ce5a[_0x44b8('0x38')]=qs[_0x44b8('0x39')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x39')]);_0x44ce5a[_0x44b8('0x3a')]=qs['filters'](_[_0x44b8('0x3b')](_0x387293[_0x44b8('0x2e')],_0x1bd1be['filters']),_0xc3f667);if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]){_0x44ce5a[_0x44b8('0x3a')]=_[_0x44b8('0x3d')](_0x44ce5a['where'],{'$or':_[_0x44b8('0x28')](_0xc3f667,function(_0x11e4e3){if(_0x11e4e3[_0x44b8('0x2c')]!==_0x44b8('0x3e')){var _0x9cb2a={};_0x9cb2a[_0x11e4e3[_0x44b8('0x27')]]={'$like':'%'+_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]+'%'};return _0x9cb2a;}})});}_0x44ce5a=_[_0x44b8('0x3d')]({},_0x44ce5a,_0x387293[_0x44b8('0x3f')]);var _0x1c9983={'where':_0x44ce5a[_0x44b8('0x3a')]};return db[_0x44b8('0x29')][_0x44b8('0x18')](_0x1c9983)[_0x44b8('0x20')](function(_0x29b43f){_0x38cd17['count']=_0x29b43f;if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x44ce5a[_0x44b8('0x41')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x44b8('0x42')](_0x44ce5a);})[_0x44b8('0x20')](function(_0x229cc9){_0x38cd17['rows']=_0x229cc9;return _0x38cd17;})[_0x44b8('0x20')](respondWithFilteredResult(_0x29b18d,_0x44ce5a))[_0x44b8('0x43')](handleError(_0x29b18d,null));};exports[_0x44b8('0x44')]=function(_0x334f86,_0xfd590a){var _0x499a3e={'raw':!![],'where':{'id':_0x334f86[_0x44b8('0x45')]['id']}},_0x5ae5f9={};_0x5ae5f9[_0x44b8('0x33')]=_[_0x44b8('0x2f')](db[_0x44b8('0x29')][_0x44b8('0x2a')]);_0x5ae5f9[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x334f86[_0x44b8('0x2e')]);_0x5ae5f9[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],_0x5ae5f9[_0x44b8('0x2e')]);_0x499a3e[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x334f86[_0x44b8('0x2e')][_0x44b8('0x34')]));_0x499a3e[_0x44b8('0x32')]=_0x499a3e['attributes']['length']?_0x499a3e[_0x44b8('0x32')]:_0x5ae5f9[_0x44b8('0x33')];if(_0x334f86[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x499a3e[_0x44b8('0x41')]=[{'all':!![]}];}_0x499a3e=_[_0x44b8('0x3d')]({},_0x499a3e,_0x334f86[_0x44b8('0x3f')]);return db['AnalyticMetric'][_0x44b8('0x46')](_0x499a3e)['then'](handleEntityNotFound(_0xfd590a,null))[_0x44b8('0x20')](respondWithResult(_0xfd590a,null))[_0x44b8('0x43')](handleError(_0xfd590a,null));};exports[_0x44b8('0x47')]=function(_0x9207bf,_0x103d57){return db[_0x44b8('0x29')]['create'](_0x9207bf[_0x44b8('0x48')],{})[_0x44b8('0x20')](function(_0x10602c){var _0x25d266=_0x9207bf['user'][_0x44b8('0x22')]({'plain':!![]});if(!_0x25d266)throw new Error(_0x44b8('0x49'));if(_0x25d266[_0x44b8('0x4a')]===_0x44b8('0x4b')){var _0x44ec23=_0x10602c[_0x44b8('0x22')]({'plain':!![]});var _0x500bad=_0x44b8('0x23');return db[_0x44b8('0x4c')][_0x44b8('0x46')]({'where':{'name':_0x500bad,'userProfileId':_0x25d266[_0x44b8('0x4d')]},'raw':!![]})[_0x44b8('0x20')](function(_0x57d0e2){if(_0x57d0e2&&_0x57d0e2['autoAssociation']===0x0){return db[_0x44b8('0x24')]['create']({'name':_0x44ec23[_0x44b8('0x27')],'resourceId':_0x44ec23['id'],'type':_0x57d0e2['name'],'sectionId':_0x57d0e2['id']},{})[_0x44b8('0x20')](function(){return _0x10602c;});}else{return _0x10602c;}})[_0x44b8('0x43')](function(_0x1a29f6){logger[_0x44b8('0x4e')](_0x44b8('0x4f'),_0x1a29f6);throw _0x1a29f6;});}return _0x10602c;})[_0x44b8('0x20')](respondWithResult(_0x103d57,0xc9))[_0x44b8('0x43')](handleError(_0x103d57,null));};exports['update']=function(_0x3ad278,_0x37b2c2){if(_0x3ad278[_0x44b8('0x48')]['id']){delete _0x3ad278['body']['id'];}return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x3ad278[_0x44b8('0x45')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x37b2c2,null))['then'](saveUpdates(_0x3ad278[_0x44b8('0x48')],null))[_0x44b8('0x20')](respondWithResult(_0x37b2c2,null))['catch'](handleError(_0x37b2c2,null));};exports[_0x44b8('0x21')]=function(_0x19f22b,_0x35136e){return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x19f22b['params']['id']}})['then'](handleEntityNotFound(_0x35136e,null))[_0x44b8('0x20')](removeEntity(_0x35136e,null))[_0x44b8('0x43')](handleError(_0x35136e,null));};
\ No newline at end of file
+var _0xa41a=['attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Metrics','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','error','stack','name','send','map','AnalyticMetric','type','key','model','query','keys','intersection','fields'];(function(_0x399d54,_0x58ee80){var _0x11e764=function(_0x2c50ef){while(--_0x2c50ef){_0x399d54['push'](_0x399d54['shift']());}};_0x11e764(++_0x58ee80);}(_0xa41a,0x6b));var _0xaa41=function(_0x1c3905,_0x96f071){_0x1c3905=_0x1c3905-0x0;var _0x5e7217=_0xa41a[_0x1c3905];return _0x5e7217;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xcc;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0x19')](_0x518b5b);}return _0x1d0a54[_0xaa41('0x1a')](_0x518b5b)[_0xaa41('0x1b')]();};}function respondWithResult(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0xc8;return function(_0x1e9d7f){if(_0x1e9d7f){return _0x6f9ade[_0xaa41('0x1a')](_0x4eaf81)[_0xaa41('0x1c')](_0x1e9d7f);}};}function respondWithFilteredResult(_0x1ef7d9,_0x2a6988){return function(_0x2005ae){if(_0x2005ae){var _0x1e1e02=typeof _0x2a6988['offset']===_0xaa41('0x1d')&&typeof _0x2a6988[_0xaa41('0x1e')]===_0xaa41('0x1d');var _0x391b01=_0x2005ae[_0xaa41('0x1f')];var _0xd20ddf=_0x1e1e02?0x0:_0x2a6988[_0xaa41('0x20')];var _0x46e6d3=_0x1e1e02?_0x2005ae[_0xaa41('0x1f')]:_0x2a6988['offset']+_0x2a6988['limit'];var _0x1f502a;if(_0x46e6d3>=_0x391b01){_0x46e6d3=_0x391b01;_0x1f502a=0xc8;}else{_0x1f502a=0xce;}_0x1ef7d9[_0xaa41('0x1a')](_0x1f502a);return _0x1ef7d9[_0xaa41('0x21')]('Content-Range',_0xd20ddf+'-'+_0x46e6d3+'/'+_0x391b01)[_0xaa41('0x1c')](_0x2005ae);}return null;};}function patchUpdates(_0x1f692b){return function(_0x4e768e){try{jsonpatch['apply'](_0x4e768e,_0x1f692b,!![]);}catch(_0x1b1910){return BPromise['reject'](_0x1b1910);}return _0x4e768e[_0xaa41('0x22')]();};}function saveUpdates(_0x209c83,_0x3e2175){return function(_0x1f27f3){if(_0x1f27f3){return _0x1f27f3[_0xaa41('0x23')](_0x209c83)['then'](function(_0x43c430){return _0x43c430;});}return null;};}function removeEntity(_0x43a85c,_0x448a21){return function(_0x21f596){if(_0x21f596){return _0x21f596[_0xaa41('0x24')]()[_0xaa41('0x25')](function(){var _0x5c3074=_0x21f596['get']({'plain':!![]});var _0x16aec5='Metrics';return db['UserProfileResource'][_0xaa41('0x24')]({'where':{'type':_0x16aec5,'resourceId':_0x5c3074['id']}})['then'](function(){return _0x21f596;});})['then'](function(){_0x43a85c[_0xaa41('0x1a')](0xcc)[_0xaa41('0x1b')]();});}};}function handleEntityNotFound(_0x392214,_0x632fd2){return function(_0x3f5272){if(!_0x3f5272){_0x392214[_0xaa41('0x19')](0x194);}return _0x3f5272;};}function handleError(_0x57ef96,_0x30a174){_0x30a174=_0x30a174||0x1f4;return function(_0x1f0275){logger[_0xaa41('0x26')](_0x1f0275[_0xaa41('0x27')]);if(_0x1f0275[_0xaa41('0x28')]){delete _0x1f0275[_0xaa41('0x28')];}_0x57ef96[_0xaa41('0x1a')](_0x30a174)[_0xaa41('0x29')](_0x1f0275);};}exports['index']=function(_0x377add,_0x48b48b){var _0x5dad80={},_0x714537={},_0x1176bd={'count':0x0,'rows':[]};var _0x534a85=_[_0xaa41('0x2a')](db[_0xaa41('0x2b')]['rawAttributes'],function(_0x5022fb){return{'name':_0x5022fb['fieldName'],'type':_0x5022fb[_0xaa41('0x2c')][_0xaa41('0x2d')]};});_0x714537[_0xaa41('0x2e')]=_[_0xaa41('0x2a')](_0x534a85,'name');_0x714537[_0xaa41('0x2f')]=_[_0xaa41('0x30')](_0x377add[_0xaa41('0x2f')]);_0x714537['filters']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],_0x714537[_0xaa41('0x2f')]);_0x5dad80['attributes']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],qs['fields'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x5dad80[_0xaa41('0x33')]=_0x5dad80['attributes'][_0xaa41('0x34')]?_0x5dad80['attributes']:_0x714537[_0xaa41('0x2e')];if(!_0x377add[_0xaa41('0x2f')][_0xaa41('0x35')]('nolimit')){_0x5dad80['limit']=qs['limit'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x1e')]);_0x5dad80[_0xaa41('0x20')]=qs[_0xaa41('0x20')](_0x377add['query']['offset']);}_0x5dad80[_0xaa41('0x36')]=qs[_0xaa41('0x37')](_0x377add[_0xaa41('0x2f')][_0xaa41('0x37')]);_0x5dad80[_0xaa41('0x38')]=qs[_0xaa41('0x39')](_[_0xaa41('0x3a')](_0x377add['query'],_0x714537[_0xaa41('0x39')]),_0x534a85);if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]){_0x5dad80[_0xaa41('0x38')]=_['merge'](_0x5dad80['where'],{'$or':_[_0xaa41('0x2a')](_0x534a85,function(_0x275fa3){if(_0x275fa3['type']!==_0xaa41('0x3c')){var _0x563687={};_0x563687[_0x275fa3[_0xaa41('0x28')]]={'$like':'%'+_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]+'%'};return _0x563687;}})});}_0x5dad80=_[_0xaa41('0x3d')]({},_0x5dad80,_0x377add[_0xaa41('0x3e')]);var _0x12ba1a={'where':_0x5dad80[_0xaa41('0x38')]};return db[_0xaa41('0x2b')]['count'](_0x12ba1a)[_0xaa41('0x25')](function(_0x2abf39){_0x1176bd[_0xaa41('0x1f')]=_0x2abf39;if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x5dad80[_0xaa41('0x40')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5dad80);})[_0xaa41('0x25')](function(_0x4f9086){_0x1176bd[_0xaa41('0x41')]=_0x4f9086;return _0x1176bd;})[_0xaa41('0x25')](respondWithFilteredResult(_0x48b48b,_0x5dad80))[_0xaa41('0x42')](handleError(_0x48b48b,null));};exports[_0xaa41('0x43')]=function(_0x2aac10,_0x10bf09){var _0x2db8d6={'raw':!![],'where':{'id':_0x2aac10[_0xaa41('0x44')]['id']}},_0x5ee74c={};_0x5ee74c['model']=_['keys'](db[_0xaa41('0x2b')]['rawAttributes']);_0x5ee74c['query']=_['keys'](_0x2aac10[_0xaa41('0x2f')]);_0x5ee74c['filters']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],_0x5ee74c['query']);_0x2db8d6['attributes']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],qs[_0xaa41('0x32')](_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x2db8d6[_0xaa41('0x33')]=_0x2db8d6[_0xaa41('0x33')][_0xaa41('0x34')]?_0x2db8d6[_0xaa41('0x33')]:_0x5ee74c['model'];if(_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x2db8d6[_0xaa41('0x40')]=[{'all':!![]}];}_0x2db8d6=_[_0xaa41('0x3d')]({},_0x2db8d6,_0x2aac10[_0xaa41('0x3e')]);return db[_0xaa41('0x2b')]['find'](_0x2db8d6)[_0xaa41('0x25')](handleEntityNotFound(_0x10bf09,null))[_0xaa41('0x25')](respondWithResult(_0x10bf09,null))[_0xaa41('0x42')](handleError(_0x10bf09,null));};exports[_0xaa41('0x45')]=function(_0x57d1f6,_0x23bc61){return db['AnalyticMetric']['create'](_0x57d1f6[_0xaa41('0x46')],{})[_0xaa41('0x25')](function(_0x3e16ef){var _0x4ca114=_0x57d1f6[_0xaa41('0x47')][_0xaa41('0x48')]({'plain':!![]});if(!_0x4ca114)throw new Error(_0xaa41('0x49'));if(_0x4ca114['role']===_0xaa41('0x47')){var _0x3c4f24=_0x3e16ef[_0xaa41('0x48')]({'plain':!![]});var _0x1378f9=_0xaa41('0x4a');return db[_0xaa41('0x4b')][_0xaa41('0x4c')]({'where':{'name':_0x1378f9,'userProfileId':_0x4ca114[_0xaa41('0x4d')]},'raw':!![]})['then'](function(_0x9f0a81){if(_0x9f0a81&&_0x9f0a81['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa41('0x45')]({'name':_0x3c4f24[_0xaa41('0x28')],'resourceId':_0x3c4f24['id'],'type':_0x9f0a81[_0xaa41('0x28')],'sectionId':_0x9f0a81['id']},{})[_0xaa41('0x25')](function(){return _0x3e16ef;});}else{return _0x3e16ef;}})[_0xaa41('0x42')](function(_0x288db3){logger[_0xaa41('0x26')](_0xaa41('0x4e'),_0x288db3);throw _0x288db3;});}return _0x3e16ef;})['then'](respondWithResult(_0x23bc61,0xc9))[_0xaa41('0x42')](handleError(_0x23bc61,null));};exports[_0xaa41('0x23')]=function(_0x1d518f,_0x4f9e92){if(_0x1d518f[_0xaa41('0x46')]['id']){delete _0x1d518f[_0xaa41('0x46')]['id'];}return db['AnalyticMetric'][_0xaa41('0x4c')]({'where':{'id':_0x1d518f[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x4f9e92,null))['then'](saveUpdates(_0x1d518f[_0xaa41('0x46')],null))[_0xaa41('0x25')](respondWithResult(_0x4f9e92,null))['catch'](handleError(_0x4f9e92,null));};exports['destroy']=function(_0x3745ed,_0x3cd14f){return db[_0xaa41('0x2b')]['find']({'where':{'id':_0x3745ed[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x3cd14f,null))[_0xaa41('0x25')](removeEntity(_0x3cd14f,null))[_0xaa41('0x42')](handleError(_0x3cd14f,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index dfddd18..12b3212 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 _0x723e=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics'];(function(_0x4f32de,_0x5bd4a){var _0x149821=function(_0x205885){while(--_0x205885){_0x4f32de['push'](_0x4f32de['shift']());}};_0x149821(++_0x5bd4a);}(_0x723e,0x179));var _0xe723=function(_0x3e6729,_0x16d4af){_0x3e6729=_0x3e6729-0x0;var _0x535bcd=_0x723e[_0x3e6729];return _0x535bcd;};'use strict';var _=require('lodash');var util=require(_0xe723('0x0'));var logger=require(_0xe723('0x1'))(_0xe723('0x2'));var moment=require(_0xe723('0x3'));var BPromise=require(_0xe723('0x4'));var rp=require(_0xe723('0x5'));var fs=require('fs');var path=require(_0xe723('0x6'));var rimraf=require(_0xe723('0x7'));var config=require(_0xe723('0x8'));var attributes=require(_0xe723('0x9'));module['exports']=function(_0x32d689,_0x20c13b){return _0x32d689[_0xe723('0xa')](_0xe723('0xb'),attributes,{'tableName':_0xe723('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x96aa=['request-promise','path','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','util','api','moment','bluebird'];(function(_0x2559ad,_0x56e4ac){var _0x1c2bbd=function(_0x26d9b6){while(--_0x26d9b6){_0x2559ad['push'](_0x2559ad['shift']());}};_0x1c2bbd(++_0x56e4ac);}(_0x96aa,0x67));var _0xa96a=function(_0x582484,_0xf698b6){_0x582484=_0x582484-0x0;var _0x490338=_0x96aa[_0x582484];return _0x490338;};'use strict';var _=require(_0xa96a('0x0'));var util=require(_0xa96a('0x1'));var logger=require('../../config/logger')(_0xa96a('0x2'));var moment=require(_0xa96a('0x3'));var BPromise=require(_0xa96a('0x4'));var rp=require(_0xa96a('0x5'));var fs=require('fs');var path=require(_0xa96a('0x6'));var rimraf=require('rimraf');var config=require(_0xa96a('0x7'));var attributes=require(_0xa96a('0x8'));module['exports']=function(_0x464684,_0x2e9a41){return _0x464684[_0xa96a('0x9')](_0xa96a('0xa'),attributes,{'tableName':_0xa96a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 80ca62b..2f44cf8 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 _0x242f=['AnalyticMetric,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x3aa17f,_0xfbe06d){var _0x205e5d=function(_0x154522){while(--_0x154522){_0x3aa17f['push'](_0x3aa17f['shift']());}};_0x205e5d(++_0xfbe06d);}(_0x242f,0x7e));var _0xf242=function(_0x2c21fa,_0x5f0a10){_0x2c21fa=_0x2c21fa-0x0;var _0x5aafc6=_0x242f[_0x2c21fa];return _0x5aafc6;};'use strict';var _=require(_0xf242('0x0'));var util=require(_0xf242('0x1'));var moment=require(_0xf242('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf242('0x3'));var db=require(_0xf242('0x4'))['db'];var utils=require(_0xf242('0x5'));var logger=require(_0xf242('0x6'))(_0xf242('0x7'));var config=require(_0xf242('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf242('0x9')][_0xf242('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x838f7f,_0x11ecea,_0x418967){return new BPromise(function(_0x4848a5,_0x11d344){return client[_0xf242('0xb')](_0x838f7f,_0x418967)[_0xf242('0xc')](function(_0x68d59f){logger[_0xf242('0xd')](_0xf242('0xe'),_0x11ecea,_0xf242('0xf'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x11ecea,_0xf242('0xf'),JSON['stringify'](_0x68d59f));if(_0x68d59f['error']){if(_0x68d59f[_0xf242('0x10')][_0xf242('0x11')]===0x1f4){logger[_0xf242('0x10')](_0xf242('0xe'),_0x11ecea,_0x68d59f[_0xf242('0x10')][_0xf242('0x12')]);return _0x11d344(_0x68d59f[_0xf242('0x10')][_0xf242('0x12')]);}logger[_0xf242('0x10')](_0xf242('0xe'),_0x11ecea,_0x68d59f[_0xf242('0x10')][_0xf242('0x12')]);return _0x4848a5(_0x68d59f['error'][_0xf242('0x12')]);}else{logger[_0xf242('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x11ecea,_0xf242('0xf'));_0x4848a5(_0x68d59f[_0xf242('0x13')][_0xf242('0x12')]);}})['catch'](function(_0x4d9bd3){logger[_0xf242('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x11ecea,_0x4d9bd3);_0x11d344(_0x4d9bd3);});});}
\ No newline at end of file
+var _0x5330=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s'];(function(_0x3227c1,_0x4318c5){var _0x31fd48=function(_0x5c5850){while(--_0x5c5850){_0x3227c1['push'](_0x3227c1['shift']());}};_0x31fd48(++_0x4318c5);}(_0x5330,0xe4));var _0x0533=function(_0x3215fc,_0x1821c2){_0x3215fc=_0x3215fc-0x0;var _0x21d34b=_0x5330[_0x3215fc];return _0x21d34b;};'use strict';var _=require(_0x0533('0x0'));var util=require('util');var moment=require(_0x0533('0x1'));var BPromise=require(_0x0533('0x2'));var rs=require(_0x0533('0x3'));var fs=require('fs');var Redis=require(_0x0533('0x4'));var db=require(_0x0533('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0533('0x6'))(_0x0533('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0533('0x8')][_0x0533('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ae90b,_0x1de94a,_0x21b029){return new BPromise(function(_0x20ba43,_0x1e7428){return client[_0x0533('0xa')](_0x1ae90b,_0x21b029)[_0x0533('0xb')](function(_0x1b38f7){logger[_0x0533('0xc')](_0x0533('0xd'),_0x1de94a,_0x0533('0xe'));logger[_0x0533('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x1de94a,'request\x20sent',JSON[_0x0533('0x10')](_0x1b38f7));if(_0x1b38f7[_0x0533('0x11')]){if(_0x1b38f7[_0x0533('0x11')][_0x0533('0x12')]===0x1f4){logger[_0x0533('0x11')](_0x0533('0xd'),_0x1de94a,_0x1b38f7[_0x0533('0x11')][_0x0533('0x13')]);return _0x1e7428(_0x1b38f7['error'][_0x0533('0x13')]);}logger[_0x0533('0x11')](_0x0533('0xd'),_0x1de94a,_0x1b38f7[_0x0533('0x11')][_0x0533('0x13')]);return _0x20ba43(_0x1b38f7[_0x0533('0x11')][_0x0533('0x13')]);}else{logger['info'](_0x0533('0xd'),_0x1de94a,_0x0533('0xe'));_0x20ba43(_0x1b38f7[_0x0533('0x14')][_0x0533('0x13')]);}})[_0x0533('0x15')](function(_0x4169b5){logger[_0x0533('0x11')](_0x0533('0xd'),_0x1de94a,_0x4169b5);_0x1e7428(_0x4169b5);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index a67a301..73779d6 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 _0x4317=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','index','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x4317,0x7c));var _0x7431=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4317[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x7431('0x0'));var path=require(_0x7431('0x1'));var timeout=require(_0x7431('0x2'));var express=require('express');var router=express[_0x7431('0x3')]();var fs_extra=require(_0x7431('0x4'));var auth=require(_0x7431('0x5'));var interaction=require(_0x7431('0x6'));var config=require(_0x7431('0x7'));var controller=require(_0x7431('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7431('0x9')]);router[_0x7431('0xa')](_0x7431('0xb'),auth[_0x7431('0xc')](),controller[_0x7431('0xd')]);router[_0x7431('0xe')]('/',auth[_0x7431('0xc')](),controller[_0x7431('0xf')]);router[_0x7431('0x10')](_0x7431('0xb'),auth[_0x7431('0xc')](),controller[_0x7431('0x11')]);router[_0x7431('0x12')](_0x7431('0xb'),auth[_0x7431('0xc')](),controller[_0x7431('0x13')]);module[_0x7431('0x14')]=router;
\ No newline at end of file
+var _0x6596=['isAuthenticated','index','/:id','post','create','put','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0xfc5024,_0x41b609){var _0x5317ef=function(_0x58dccf){while(--_0x58dccf){_0xfc5024['push'](_0xfc5024['shift']());}};_0x5317ef(++_0x41b609);}(_0x6596,0x1d3));var _0x6659=function(_0x2df2bb,_0x4768b9){_0x2df2bb=_0x2df2bb-0x0;var _0x1afd80=_0x6596[_0x2df2bb];return _0x1afd80;};'use strict';var multer=require(_0x6659('0x0'));var util=require(_0x6659('0x1'));var path=require('path');var timeout=require(_0x6659('0x2'));var express=require(_0x6659('0x3'));var router=express[_0x6659('0x4')]();var fs_extra=require(_0x6659('0x5'));var auth=require(_0x6659('0x6'));var interaction=require(_0x6659('0x7'));var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0x6659('0x8')]('/',auth[_0x6659('0x9')](),controller[_0x6659('0xa')]);router[_0x6659('0x8')](_0x6659('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x6659('0xc')]('/',auth[_0x6659('0x9')](),controller[_0x6659('0xd')]);router[_0x6659('0xe')](_0x6659('0xb'),auth[_0x6659('0x9')](),controller['update']);router[_0x6659('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x6659('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 1fcbf04..fbf6eea 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 _0x25f0=['exports'];(function(_0x3ec412,_0x195122){var _0x29479c=function(_0x3e7517){while(--_0x3e7517){_0x3ec412['push'](_0x3ec412['shift']());}};_0x29479c(++_0x195122);}(_0x25f0,0xf0));var _0x025f=function(_0x24dd47,_0x314303){_0x24dd47=_0x24dd47-0x0;var _0x4ef431=_0x25f0[_0x24dd47];return _0x4ef431;};'use strict';var Sequelize=require('sequelize');module[_0x025f('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0xa433=['TEXT','sequelize','exports'];(function(_0x4d296b,_0x46af29){var _0x67ce0c=function(_0x13239c){while(--_0x13239c){_0x4d296b['push'](_0x4d296b['shift']());}};_0x67ce0c(++_0x46af29);}(_0xa433,0x1b1));var _0x3a43=function(_0x49efd6,_0x4273a7){_0x49efd6=_0x49efd6-0x0;var _0x34a576=_0xa433[_0x49efd6];return _0x34a576;};'use strict';var Sequelize=require(_0x3a43('0x0'));module[_0x3a43('0x1')]={'tree':{'type':Sequelize[_0x3a43('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 a733325..76fa58e 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 _0xe83e=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','undefined','limit','count','offset','status','set','Content-Range','json','apply','save','update','then','destroy','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','merge','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x332741,_0x2ab38c){var _0x4a803a=function(_0x2c596f){while(--_0x2c596f){_0x332741['push'](_0x332741['shift']());}};_0x4a803a(++_0x2ab38c);}(_0xe83e,0x19a));var _0xee83=function(_0x2da568,_0x5e62e6){_0x2da568=_0x2da568-0x0;var _0x7125e0=_0xe83e[_0x2da568];return _0x7125e0;};'use strict';var emlformat=require(_0xee83('0x0'));var rimraf=require(_0xee83('0x1'));var zipdir=require(_0xee83('0x2'));var jsonpatch=require(_0xee83('0x3'));var rp=require(_0xee83('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xee83('0x5'));var csv=require(_0xee83('0x6'));var ejs=require(_0xee83('0x7'));var fs=require('fs');var fs_extra=require(_0xee83('0x8'));var _=require(_0xee83('0x9'));var squel=require(_0xee83('0xa'));var crypto=require(_0xee83('0xb'));var jsforce=require(_0xee83('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xee83('0x6'));var querystring=require(_0xee83('0xd'));var Papa=require(_0xee83('0xe'));var Redis=require(_0xee83('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xee83('0x10'));var as=require(_0xee83('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee83('0x12'))('api');var utils=require(_0xee83('0x13'));var config=require(_0xee83('0x14'));var licenseUtil=require(_0xee83('0x15'));var db=require(_0xee83('0x16'))['db'];function respondWithStatusCode(_0xc9e8d0,_0x40ace5){_0x40ace5=_0x40ace5||0xcc;return function(_0x1c420f){if(_0x1c420f){return _0xc9e8d0[_0xee83('0x17')](_0x40ace5);}return _0xc9e8d0['status'](_0x40ace5)['end']();};}function respondWithResult(_0x54c5c6,_0x3c6478){_0x3c6478=_0x3c6478||0xc8;return function(_0x3dd199){if(_0x3dd199){return _0x54c5c6['status'](_0x3c6478)['json'](_0x3dd199);}};}function respondWithFilteredResult(_0x240fb7,_0xd265e3){return function(_0x4bd344){if(_0x4bd344){var _0x2b5b21=typeof _0xd265e3['offset']===_0xee83('0x18')&&typeof _0xd265e3[_0xee83('0x19')]===_0xee83('0x18');var _0x4651db=_0x4bd344[_0xee83('0x1a')];var _0xfa6ddb=_0x2b5b21?0x0:_0xd265e3[_0xee83('0x1b')];var _0x52c103=_0x2b5b21?_0x4bd344['count']:_0xd265e3[_0xee83('0x1b')]+_0xd265e3[_0xee83('0x19')];var _0x3d6dd4;if(_0x52c103>=_0x4651db){_0x52c103=_0x4651db;_0x3d6dd4=0xc8;}else{_0x3d6dd4=0xce;}_0x240fb7[_0xee83('0x1c')](_0x3d6dd4);return _0x240fb7[_0xee83('0x1d')](_0xee83('0x1e'),_0xfa6ddb+'-'+_0x52c103+'/'+_0x4651db)[_0xee83('0x1f')](_0x4bd344);}return null;};}function patchUpdates(_0x47aa8a){return function(_0x42928e){try{jsonpatch[_0xee83('0x20')](_0x42928e,_0x47aa8a,!![]);}catch(_0x53b5ac){return BPromise['reject'](_0x53b5ac);}return _0x42928e[_0xee83('0x21')]();};}function saveUpdates(_0xc652a9,_0x287620){return function(_0x22b590){if(_0x22b590){return _0x22b590[_0xee83('0x22')](_0xc652a9)[_0xee83('0x23')](function(_0x243d7d){return _0x243d7d;});}return null;};}function removeEntity(_0x4ca350,_0x4c4298){return function(_0x30f846){if(_0x30f846){return _0x30f846[_0xee83('0x24')]()[_0xee83('0x23')](function(){_0x4ca350[_0xee83('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d8471,_0x8c02b5){return function(_0x376c2e){if(!_0x376c2e){_0x3d8471[_0xee83('0x17')](0x194);}return _0x376c2e;};}function handleError(_0x5c2399,_0x365bc8){_0x365bc8=_0x365bc8||0x1f4;return function(_0x166f3b){logger['error'](_0x166f3b[_0xee83('0x25')]);if(_0x166f3b[_0xee83('0x26')]){delete _0x166f3b['name'];}_0x5c2399[_0xee83('0x1c')](_0x365bc8)[_0xee83('0x27')](_0x166f3b);};}exports[_0xee83('0x28')]=function(_0x78cb3b,_0x542c60){var _0x5288f6={},_0x1bf9bc={},_0xd05898={'count':0x0,'rows':[]};var _0x51df24=_[_0xee83('0x29')](db[_0xee83('0x2a')]['rawAttributes'],function(_0x585e95){return{'name':_0x585e95[_0xee83('0x2b')],'type':_0x585e95[_0xee83('0x2c')]['key']};});_0x1bf9bc[_0xee83('0x2d')]=_['map'](_0x51df24,'name');_0x1bf9bc['query']=_[_0xee83('0x2e')](_0x78cb3b[_0xee83('0x2f')]);_0x1bf9bc['filters']=_[_0xee83('0x30')](_0x1bf9bc[_0xee83('0x2d')],_0x1bf9bc[_0xee83('0x2f')]);_0x5288f6['attributes']=_[_0xee83('0x30')](_0x1bf9bc[_0xee83('0x2d')],qs[_0xee83('0x31')](_0x78cb3b[_0xee83('0x2f')][_0xee83('0x31')]));_0x5288f6['attributes']=_0x5288f6[_0xee83('0x32')][_0xee83('0x33')]?_0x5288f6['attributes']:_0x1bf9bc['model'];if(!_0x78cb3b[_0xee83('0x2f')]['hasOwnProperty'](_0xee83('0x34'))){_0x5288f6[_0xee83('0x19')]=qs[_0xee83('0x19')](_0x78cb3b[_0xee83('0x2f')][_0xee83('0x19')]);_0x5288f6[_0xee83('0x1b')]=qs[_0xee83('0x1b')](_0x78cb3b['query'][_0xee83('0x1b')]);}_0x5288f6[_0xee83('0x35')]=qs[_0xee83('0x36')](_0x78cb3b['query'][_0xee83('0x36')]);_0x5288f6['where']=qs[_0xee83('0x37')](_[_0xee83('0x38')](_0x78cb3b['query'],_0x1bf9bc[_0xee83('0x37')]),_0x51df24);if(_0x78cb3b[_0xee83('0x2f')][_0xee83('0x39')]){_0x5288f6[_0xee83('0x3a')]=_['merge'](_0x5288f6[_0xee83('0x3a')],{'$or':_[_0xee83('0x29')](_0x51df24,function(_0x4c8ff8){if(_0x4c8ff8[_0xee83('0x2c')]!==_0xee83('0x3b')){var _0x1221d6={};_0x1221d6[_0x4c8ff8['name']]={'$like':'%'+_0x78cb3b[_0xee83('0x2f')]['filter']+'%'};return _0x1221d6;}})});}_0x5288f6=_['merge']({},_0x5288f6,_0x78cb3b[_0xee83('0x3c')]);var _0x38398a={'where':_0x5288f6[_0xee83('0x3a')]};return db[_0xee83('0x2a')][_0xee83('0x1a')](_0x38398a)[_0xee83('0x23')](function(_0x53bc36){_0xd05898[_0xee83('0x1a')]=_0x53bc36;if(_0x78cb3b[_0xee83('0x2f')][_0xee83('0x3d')]){_0x5288f6[_0xee83('0x3e')]=[{'all':!![]}];}return db[_0xee83('0x2a')][_0xee83('0x3f')](_0x5288f6);})[_0xee83('0x23')](function(_0x4d0be0){_0xd05898['rows']=_0x4d0be0;return _0xd05898;})[_0xee83('0x23')](respondWithFilteredResult(_0x542c60,_0x5288f6))['catch'](handleError(_0x542c60,null));};exports[_0xee83('0x40')]=function(_0x3782ce,_0x19e9ce){var _0xa157ff={'raw':!![],'where':{'id':_0x3782ce[_0xee83('0x41')]['id']}},_0x54548a={};_0x54548a[_0xee83('0x2d')]=_[_0xee83('0x2e')](db[_0xee83('0x2a')][_0xee83('0x42')]);_0x54548a[_0xee83('0x2f')]=_[_0xee83('0x2e')](_0x3782ce[_0xee83('0x2f')]);_0x54548a['filters']=_['intersection'](_0x54548a[_0xee83('0x2d')],_0x54548a[_0xee83('0x2f')]);_0xa157ff[_0xee83('0x32')]=_['intersection'](_0x54548a[_0xee83('0x2d')],qs['fields'](_0x3782ce[_0xee83('0x2f')][_0xee83('0x31')]));_0xa157ff['attributes']=_0xa157ff[_0xee83('0x32')][_0xee83('0x33')]?_0xa157ff['attributes']:_0x54548a[_0xee83('0x2d')];if(_0x3782ce['query'][_0xee83('0x3d')]){_0xa157ff[_0xee83('0x3e')]=[{'all':!![]}];}_0xa157ff=_[_0xee83('0x43')]({},_0xa157ff,_0x3782ce[_0xee83('0x3c')]);return db[_0xee83('0x2a')][_0xee83('0x44')](_0xa157ff)['then'](handleEntityNotFound(_0x19e9ce,null))[_0xee83('0x23')](respondWithResult(_0x19e9ce,null))[_0xee83('0x45')](handleError(_0x19e9ce,null));};exports['create']=function(_0x4a10c9,_0x4d9f2b){return db[_0xee83('0x2a')]['create'](_0x4a10c9[_0xee83('0x46')],{})[_0xee83('0x23')](respondWithResult(_0x4d9f2b,0xc9))[_0xee83('0x45')](handleError(_0x4d9f2b,null));};exports['update']=function(_0x58e17f,_0x36ef8e){if(_0x58e17f[_0xee83('0x46')]['id']){delete _0x58e17f[_0xee83('0x46')]['id'];}return db['AnalyticTreeReport'][_0xee83('0x44')]({'where':{'id':_0x58e17f[_0xee83('0x41')]['id']}})[_0xee83('0x23')](handleEntityNotFound(_0x36ef8e,null))[_0xee83('0x23')](saveUpdates(_0x58e17f[_0xee83('0x46')],null))[_0xee83('0x23')](respondWithResult(_0x36ef8e,null))[_0xee83('0x45')](handleError(_0x36ef8e,null));};exports['destroy']=function(_0x4bcbed,_0x54733f){return db[_0xee83('0x2a')][_0xee83('0x44')]({'where':{'id':_0x4bcbed['params']['id']}})[_0xee83('0x23')](handleEntityNotFound(_0x54733f,null))[_0xee83('0x23')](removeEntity(_0x54733f,null))[_0xee83('0x45')](handleError(_0x54733f,null));};
\ No newline at end of file
+var _0xf10c=['sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','sort','where','pick','merge','VIRTUAL','filter','options','AnalyticTreeReport','includeAll','include','findAll','rows','catch','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x383e64,_0x2c3425){var _0x12725d=function(_0x186a04){while(--_0x186a04){_0x383e64['push'](_0x383e64['shift']());}};_0x12725d(++_0x2c3425);}(_0xf10c,0x1f4));var _0xcf10=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf10c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xcf10('0x0'));var rimraf=require(_0xcf10('0x1'));var zipdir=require(_0xcf10('0x2'));var jsonpatch=require(_0xcf10('0x3'));var rp=require('request-promise');var moment=require(_0xcf10('0x4'));var BPromise=require(_0xcf10('0x5'));var Mustache=require('mustache');var util=require(_0xcf10('0x6'));var path=require('path');var sox=require(_0xcf10('0x7'));var csv=require(_0xcf10('0x8'));var ejs=require(_0xcf10('0x9'));var fs=require('fs');var fs_extra=require(_0xcf10('0xa'));var _=require(_0xcf10('0xb'));var squel=require('squel');var crypto=require(_0xcf10('0xc'));var jsforce=require(_0xcf10('0xd'));var deskjs=require(_0xcf10('0xe'));var toCsv=require('to-csv');var querystring=require(_0xcf10('0xf'));var Papa=require(_0xcf10('0x10'));var Redis=require(_0xcf10('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcf10('0x12'));var as=require(_0xcf10('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcf10('0x14'));var utils=require(_0xcf10('0x15'));var config=require(_0xcf10('0x16'));var licenseUtil=require(_0xcf10('0x17'));var db=require(_0xcf10('0x18'))['db'];function respondWithStatusCode(_0x3a4f5b,_0x1a73a1){_0x1a73a1=_0x1a73a1||0xcc;return function(_0xf4906d){if(_0xf4906d){return _0x3a4f5b[_0xcf10('0x19')](_0x1a73a1);}return _0x3a4f5b[_0xcf10('0x1a')](_0x1a73a1)[_0xcf10('0x1b')]();};}function respondWithResult(_0xfb8ee6,_0x1fcf37){_0x1fcf37=_0x1fcf37||0xc8;return function(_0x4c569d){if(_0x4c569d){return _0xfb8ee6['status'](_0x1fcf37)[_0xcf10('0x1c')](_0x4c569d);}};}function respondWithFilteredResult(_0x204166,_0x52fe8b){return function(_0x4f421d){if(_0x4f421d){var _0x51c4f5=typeof _0x52fe8b['offset']===_0xcf10('0x1d')&&typeof _0x52fe8b[_0xcf10('0x1e')]===_0xcf10('0x1d');var _0x26929a=_0x4f421d[_0xcf10('0x1f')];var _0x1fd76b=_0x51c4f5?0x0:_0x52fe8b[_0xcf10('0x20')];var _0x27ea53=_0x51c4f5?_0x4f421d[_0xcf10('0x1f')]:_0x52fe8b['offset']+_0x52fe8b[_0xcf10('0x1e')];var _0x3b041b;if(_0x27ea53>=_0x26929a){_0x27ea53=_0x26929a;_0x3b041b=0xc8;}else{_0x3b041b=0xce;}_0x204166['status'](_0x3b041b);return _0x204166[_0xcf10('0x21')](_0xcf10('0x22'),_0x1fd76b+'-'+_0x27ea53+'/'+_0x26929a)['json'](_0x4f421d);}return null;};}function patchUpdates(_0x442daa){return function(_0x1aa9e1){try{jsonpatch[_0xcf10('0x23')](_0x1aa9e1,_0x442daa,!![]);}catch(_0x2e90ad){return BPromise[_0xcf10('0x24')](_0x2e90ad);}return _0x1aa9e1[_0xcf10('0x25')]();};}function saveUpdates(_0xf2b27e,_0x4c4756){return function(_0x229956){if(_0x229956){return _0x229956[_0xcf10('0x26')](_0xf2b27e)['then'](function(_0x1c9c24){return _0x1c9c24;});}return null;};}function removeEntity(_0x16cd14,_0x1ea74c){return function(_0x1bafd4){if(_0x1bafd4){return _0x1bafd4[_0xcf10('0x27')]()[_0xcf10('0x28')](function(){_0x16cd14['status'](0xcc)[_0xcf10('0x1b')]();});}};}function handleEntityNotFound(_0x5de3ef,_0x32a371){return function(_0x2e1ac8){if(!_0x2e1ac8){_0x5de3ef['sendStatus'](0x194);}return _0x2e1ac8;};}function handleError(_0x58e5d0,_0x2a0774){_0x2a0774=_0x2a0774||0x1f4;return function(_0x3fba00){logger[_0xcf10('0x29')](_0x3fba00[_0xcf10('0x2a')]);if(_0x3fba00[_0xcf10('0x2b')]){delete _0x3fba00['name'];}_0x58e5d0[_0xcf10('0x1a')](_0x2a0774)[_0xcf10('0x2c')](_0x3fba00);};}exports['index']=function(_0x80da3a,_0x27f1da){var _0x2d74ac={},_0x201c35={},_0x404074={'count':0x0,'rows':[]};var _0xa95e88=_[_0xcf10('0x2d')](db['AnalyticTreeReport'][_0xcf10('0x2e')],function(_0x7a967b){return{'name':_0x7a967b[_0xcf10('0x2f')],'type':_0x7a967b[_0xcf10('0x30')][_0xcf10('0x31')]};});_0x201c35[_0xcf10('0x32')]=_[_0xcf10('0x2d')](_0xa95e88,_0xcf10('0x2b'));_0x201c35[_0xcf10('0x33')]=_[_0xcf10('0x34')](_0x80da3a[_0xcf10('0x33')]);_0x201c35[_0xcf10('0x35')]=_[_0xcf10('0x36')](_0x201c35['model'],_0x201c35[_0xcf10('0x33')]);_0x2d74ac['attributes']=_[_0xcf10('0x36')](_0x201c35[_0xcf10('0x32')],qs[_0xcf10('0x37')](_0x80da3a[_0xcf10('0x33')][_0xcf10('0x37')]));_0x2d74ac[_0xcf10('0x38')]=_0x2d74ac[_0xcf10('0x38')][_0xcf10('0x39')]?_0x2d74ac[_0xcf10('0x38')]:_0x201c35['model'];if(!_0x80da3a['query']['hasOwnProperty']('nolimit')){_0x2d74ac[_0xcf10('0x1e')]=qs['limit'](_0x80da3a[_0xcf10('0x33')][_0xcf10('0x1e')]);_0x2d74ac[_0xcf10('0x20')]=qs[_0xcf10('0x20')](_0x80da3a[_0xcf10('0x33')][_0xcf10('0x20')]);}_0x2d74ac['order']=qs[_0xcf10('0x3a')](_0x80da3a[_0xcf10('0x33')]['sort']);_0x2d74ac[_0xcf10('0x3b')]=qs[_0xcf10('0x35')](_[_0xcf10('0x3c')](_0x80da3a[_0xcf10('0x33')],_0x201c35[_0xcf10('0x35')]),_0xa95e88);if(_0x80da3a['query']['filter']){_0x2d74ac[_0xcf10('0x3b')]=_[_0xcf10('0x3d')](_0x2d74ac['where'],{'$or':_['map'](_0xa95e88,function(_0x2a4bb7){if(_0x2a4bb7[_0xcf10('0x30')]!==_0xcf10('0x3e')){var _0x520db1={};_0x520db1[_0x2a4bb7['name']]={'$like':'%'+_0x80da3a['query'][_0xcf10('0x3f')]+'%'};return _0x520db1;}})});}_0x2d74ac=_[_0xcf10('0x3d')]({},_0x2d74ac,_0x80da3a[_0xcf10('0x40')]);var _0x54182b={'where':_0x2d74ac[_0xcf10('0x3b')]};return db[_0xcf10('0x41')][_0xcf10('0x1f')](_0x54182b)[_0xcf10('0x28')](function(_0x4895e1){_0x404074[_0xcf10('0x1f')]=_0x4895e1;if(_0x80da3a['query'][_0xcf10('0x42')]){_0x2d74ac[_0xcf10('0x43')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xcf10('0x44')](_0x2d74ac);})['then'](function(_0x3826f6){_0x404074[_0xcf10('0x45')]=_0x3826f6;return _0x404074;})[_0xcf10('0x28')](respondWithFilteredResult(_0x27f1da,_0x2d74ac))[_0xcf10('0x46')](handleError(_0x27f1da,null));};exports['show']=function(_0xfaad93,_0x3f27be){var _0x122aa6={'raw':!![],'where':{'id':_0xfaad93[_0xcf10('0x47')]['id']}},_0x435f6b={};_0x435f6b['model']=_[_0xcf10('0x34')](db[_0xcf10('0x41')][_0xcf10('0x2e')]);_0x435f6b['query']=_[_0xcf10('0x34')](_0xfaad93[_0xcf10('0x33')]);_0x435f6b['filters']=_['intersection'](_0x435f6b[_0xcf10('0x32')],_0x435f6b[_0xcf10('0x33')]);_0x122aa6['attributes']=_[_0xcf10('0x36')](_0x435f6b[_0xcf10('0x32')],qs[_0xcf10('0x37')](_0xfaad93['query'][_0xcf10('0x37')]));_0x122aa6['attributes']=_0x122aa6[_0xcf10('0x38')]['length']?_0x122aa6['attributes']:_0x435f6b[_0xcf10('0x32')];if(_0xfaad93['query'][_0xcf10('0x42')]){_0x122aa6[_0xcf10('0x43')]=[{'all':!![]}];}_0x122aa6=_[_0xcf10('0x3d')]({},_0x122aa6,_0xfaad93[_0xcf10('0x40')]);return db['AnalyticTreeReport']['find'](_0x122aa6)[_0xcf10('0x28')](handleEntityNotFound(_0x3f27be,null))[_0xcf10('0x28')](respondWithResult(_0x3f27be,null))[_0xcf10('0x46')](handleError(_0x3f27be,null));};exports[_0xcf10('0x48')]=function(_0x267065,_0x3c434c){return db[_0xcf10('0x41')]['create'](_0x267065['body'],{})[_0xcf10('0x28')](respondWithResult(_0x3c434c,0xc9))[_0xcf10('0x46')](handleError(_0x3c434c,null));};exports['update']=function(_0x18558f,_0x352166){if(_0x18558f[_0xcf10('0x49')]['id']){delete _0x18558f[_0xcf10('0x49')]['id'];}return db[_0xcf10('0x41')][_0xcf10('0x4a')]({'where':{'id':_0x18558f[_0xcf10('0x47')]['id']}})['then'](handleEntityNotFound(_0x352166,null))[_0xcf10('0x28')](saveUpdates(_0x18558f[_0xcf10('0x49')],null))[_0xcf10('0x28')](respondWithResult(_0x352166,null))[_0xcf10('0x46')](handleError(_0x352166,null));};exports[_0xcf10('0x27')]=function(_0x4603ad,_0x45d788){return db[_0xcf10('0x41')][_0xcf10('0x4a')]({'where':{'id':_0x4603ad[_0xcf10('0x47')]['id']}})['then'](handleEntityNotFound(_0x45d788,null))[_0xcf10('0x28')](removeEntity(_0x45d788,null))['catch'](handleError(_0x45d788,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 749bfaa..bb53205 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 _0x1858=['define','analytics_report_trees','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x1e5f85,_0x46ccf2){var _0x3a9ea6=function(_0x1310c0){while(--_0x1310c0){_0x1e5f85['push'](_0x1e5f85['shift']());}};_0x3a9ea6(++_0x46ccf2);}(_0x1858,0x122));var _0x8185=function(_0x19f1e4,_0x1e62de){_0x19f1e4=_0x19f1e4-0x0;var _0x219ebc=_0x1858[_0x19f1e4];return _0x219ebc;};'use strict';var _=require(_0x8185('0x0'));var util=require(_0x8185('0x1'));var logger=require(_0x8185('0x2'))('api');var moment=require(_0x8185('0x3'));var BPromise=require('bluebird');var rp=require(_0x8185('0x4'));var fs=require('fs');var path=require(_0x8185('0x5'));var rimraf=require(_0x8185('0x6'));var config=require(_0x8185('0x7'));var attributes=require(_0x8185('0x8'));module[_0x8185('0x9')]=function(_0x22b4c7,_0x2c50e1){return _0x22b4c7[_0x8185('0xa')]('AnalyticTreeReport',attributes,{'tableName':_0x8185('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x456a=['request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','util','../../config/logger','api','moment','bluebird'];(function(_0x41a37a,_0x1d68cc){var _0x1cd56a=function(_0x4e395a){while(--_0x4e395a){_0x41a37a['push'](_0x41a37a['shift']());}};_0x1cd56a(++_0x1d68cc);}(_0x456a,0x15a));var _0xa456=function(_0x37811e,_0x236854){_0x37811e=_0x37811e-0x0;var _0x533db5=_0x456a[_0x37811e];return _0x533db5;};'use strict';var _=require('lodash');var util=require(_0xa456('0x0'));var logger=require(_0xa456('0x1'))(_0xa456('0x2'));var moment=require(_0xa456('0x3'));var BPromise=require(_0xa456('0x4'));var rp=require(_0xa456('0x5'));var fs=require('fs');var path=require(_0xa456('0x6'));var rimraf=require(_0xa456('0x7'));var config=require(_0xa456('0x8'));var attributes=require(_0xa456('0x9'));module[_0xa456('0xa')]=function(_0x59dce9,_0x534fb1){return _0x59dce9[_0xa456('0xb')]('AnalyticTreeReport',attributes,{'tableName':_0xa456('0xc'),'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 e765e4c..c1059e8 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(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x3f5f67,_0x2831f0){_0x3f5f67=_0x3f5f67-0x0;var _0x54e376=_0x7a54[_0x3f5f67];return _0x54e376;};'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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x43bf7d,_0x23ba22){var _0x3abfbe=function(_0x502c7e){while(--_0x502c7e){_0x43bf7d['push'](_0x43bf7d['shift']());}};_0x3abfbe(++_0x23ba22);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc4aa[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index e0c7b43..2a1d585 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 _0xd501=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','get','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1bf7a6,_0x3db8a2){var _0x47b453=function(_0x46cb61){while(--_0x46cb61){_0x1bf7a6['push'](_0x1bf7a6['shift']());}};_0x47b453(++_0x3db8a2);}(_0xd501,0x1df));var _0x1d50=function(_0xf27234,_0x4c8d80){_0xf27234=_0xf27234-0x0;var _0x528122=_0xd501[_0xf27234];return _0x528122;};'use strict';var multer=require(_0x1d50('0x0'));var util=require(_0x1d50('0x1'));var path=require(_0x1d50('0x2'));var timeout=require(_0x1d50('0x3'));var express=require(_0x1d50('0x4'));var router=express[_0x1d50('0x5')]();var fs_extra=require(_0x1d50('0x6'));var auth=require(_0x1d50('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1d50('0x8'));var controller=require(_0x1d50('0x9'));router['get']('/',auth[_0x1d50('0xa')](),controller['index']);router[_0x1d50('0xb')]('/:id',auth[_0x1d50('0xa')](),controller[_0x1d50('0xc')]);router[_0x1d50('0xd')]('/',auth[_0x1d50('0xa')](),controller[_0x1d50('0xe')]);router[_0x1d50('0xf')](_0x1d50('0x10'),auth[_0x1d50('0xa')](),controller[_0x1d50('0x11')]);router[_0x1d50('0x12')](_0x1d50('0x10'),auth[_0x1d50('0xa')](),controller[_0x1d50('0x13')]);module[_0x1d50('0x14')]=router;
\ No newline at end of file
+var _0x770e=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','show','post','create','put','delete','exports'];(function(_0x4e112c,_0x27a1){var _0x16042e=function(_0x6a4b22){while(--_0x6a4b22){_0x4e112c['push'](_0x4e112c['shift']());}};_0x16042e(++_0x27a1);}(_0x770e,0x120));var _0xe770=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x770e[_0x18cd5b];return _0x5eaa52;};'use strict';var multer=require(_0xe770('0x0'));var util=require(_0xe770('0x1'));var path=require(_0xe770('0x2'));var timeout=require('connect-timeout');var express=require(_0xe770('0x3'));var router=express[_0xe770('0x4')]();var fs_extra=require(_0xe770('0x5'));var auth=require(_0xe770('0x6'));var interaction=require(_0xe770('0x7'));var config=require(_0xe770('0x8'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe770('0x9')]);router['get'](_0xe770('0xa'),auth[_0xe770('0xb')](),controller[_0xe770('0xc')]);router[_0xe770('0xd')]('/',auth[_0xe770('0xb')](),controller[_0xe770('0xe')]);router[_0xe770('0xf')](_0xe770('0xa'),auth[_0xe770('0xb')](),controller['update']);router[_0xe770('0x10')](_0xe770('0xa'),auth[_0xe770('0xb')](),controller['destroy']);module[_0xe770('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 023a620..bf98503 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 _0x3f49=['exports','STRING','sequelize'];(function(_0x4848a3,_0x384354){var _0x75ba9a=function(_0x3c5256){while(--_0x3c5256){_0x4848a3['push'](_0x4848a3['shift']());}};_0x75ba9a(++_0x384354);}(_0x3f49,0x11f));var _0x93f4=function(_0x46610f,_0x22d6f1){_0x46610f=_0x46610f-0x0;var _0x5be0f9=_0x3f49[_0x46610f];return _0x5be0f9;};'use strict';var Sequelize=require(_0x93f4('0x0'));module[_0x93f4('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x93f4('0x2')]},'type':{'type':Sequelize[_0x93f4('0x2')]}};
\ No newline at end of file
+var _0x55ca=['sequelize','exports'];(function(_0x29e3ca,_0x3369bd){var _0x36645b=function(_0x566414){while(--_0x566414){_0x29e3ca['push'](_0x29e3ca['shift']());}};_0x36645b(++_0x3369bd);}(_0x55ca,0x126));var _0xa55c=function(_0x26371f,_0x3529d6){_0x26371f=_0x26371f-0x0;var _0x7bf77f=_0x55ca[_0x26371f];return _0x7bf77f;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 1e9f6ad..b6e7193 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 _0x8d33=['name','send','index','map','Attachment','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','length','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','download','ChatOfflineMessageId','server/files/attachments/','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','set','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0x57b236,_0x30614e){var _0x4feb29=function(_0x26d3e6){while(--_0x26d3e6){_0x57b236['push'](_0x57b236['shift']());}};_0x4feb29(++_0x30614e);}(_0x8d33,0x1a0));var _0x38d3=function(_0x3354d7,_0x5166f3){_0x3354d7=_0x3354d7-0x0;var _0x489c70=_0x8d33[_0x3354d7];return _0x489c70;};'use strict';var emlformat=require(_0x38d3('0x0'));var rimraf=require(_0x38d3('0x1'));var zipdir=require(_0x38d3('0x2'));var jsonpatch=require(_0x38d3('0x3'));var rp=require(_0x38d3('0x4'));var moment=require(_0x38d3('0x5'));var BPromise=require(_0x38d3('0x6'));var Mustache=require(_0x38d3('0x7'));var util=require(_0x38d3('0x8'));var path=require(_0x38d3('0x9'));var sox=require(_0x38d3('0xa'));var csv=require(_0x38d3('0xb'));var ejs=require(_0x38d3('0xc'));var fs=require('fs');var fs_extra=require(_0x38d3('0xd'));var _=require(_0x38d3('0xe'));var squel=require('squel');var crypto=require(_0x38d3('0xf'));var jsforce=require(_0x38d3('0x10'));var deskjs=require(_0x38d3('0x11'));var toCsv=require('to-csv');var querystring=require(_0x38d3('0x12'));var Papa=require(_0x38d3('0x13'));var Redis=require(_0x38d3('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x38d3('0x15'));var hardwareService=require(_0x38d3('0x16'));var logger=require(_0x38d3('0x17'))('api');var utils=require(_0x38d3('0x18'));var config=require(_0x38d3('0x19'));var licenseUtil=require(_0x38d3('0x1a'));var db=require(_0x38d3('0x1b'))['db'];function respondWithStatusCode(_0x2ab31f,_0x213736){_0x213736=_0x213736||0xcc;return function(_0x5173e2){if(_0x5173e2){return _0x2ab31f[_0x38d3('0x1c')](_0x213736);}return _0x2ab31f[_0x38d3('0x1d')](_0x213736)[_0x38d3('0x1e')]();};}function respondWithResult(_0x507e62,_0x14e4d3){_0x14e4d3=_0x14e4d3||0xc8;return function(_0x335954){if(_0x335954){return _0x507e62['status'](_0x14e4d3)[_0x38d3('0x1f')](_0x335954);}};}function respondWithFilteredResult(_0xf444fd,_0xc4dfa8){return function(_0x3902de){if(_0x3902de){var _0x52408d=typeof _0xc4dfa8['offset']==='undefined'&&typeof _0xc4dfa8[_0x38d3('0x20')]===_0x38d3('0x21');var _0x1955aa=_0x3902de['count'];var _0x4c31f4=_0x52408d?0x0:_0xc4dfa8[_0x38d3('0x22')];var _0x152b6e=_0x52408d?_0x3902de['count']:_0xc4dfa8[_0x38d3('0x22')]+_0xc4dfa8[_0x38d3('0x20')];var _0x39e608;if(_0x152b6e>=_0x1955aa){_0x152b6e=_0x1955aa;_0x39e608=0xc8;}else{_0x39e608=0xce;}_0xf444fd['status'](_0x39e608);return _0xf444fd[_0x38d3('0x23')](_0x38d3('0x24'),_0x4c31f4+'-'+_0x152b6e+'/'+_0x1955aa)[_0x38d3('0x1f')](_0x3902de);}return null;};}function patchUpdates(_0x32d74c){return function(_0xf72e67){try{jsonpatch[_0x38d3('0x25')](_0xf72e67,_0x32d74c,!![]);}catch(_0x1c2267){return BPromise[_0x38d3('0x26')](_0x1c2267);}return _0xf72e67[_0x38d3('0x27')]();};}function saveUpdates(_0x28a479,_0x30135c){return function(_0x1e9d54){if(_0x1e9d54){return _0x1e9d54[_0x38d3('0x28')](_0x28a479)[_0x38d3('0x29')](function(_0x40254d){return _0x40254d;});}return null;};}function removeEntity(_0x200f4a,_0x3ee75f){return function(_0x21722b){if(_0x21722b){return _0x21722b[_0x38d3('0x2a')]()['then'](function(){_0x200f4a[_0x38d3('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44c352,_0x398aea){return function(_0x547b56){if(!_0x547b56){_0x44c352[_0x38d3('0x1c')](0x194);}return _0x547b56;};}function handleError(_0x21890c,_0x2d5d02){_0x2d5d02=_0x2d5d02||0x1f4;return function(_0x2dd571){logger[_0x38d3('0x2b')](_0x2dd571['stack']);if(_0x2dd571['name']){delete _0x2dd571[_0x38d3('0x2c')];}_0x21890c['status'](_0x2d5d02)[_0x38d3('0x2d')](_0x2dd571);};}exports[_0x38d3('0x2e')]=function(_0x119281,_0x5d8e63){var _0x394f33={},_0xa716df={},_0x152888={'count':0x0,'rows':[]};var _0x1042d5=_[_0x38d3('0x2f')](db[_0x38d3('0x30')][_0x38d3('0x31')],function(_0xb07851){return{'name':_0xb07851[_0x38d3('0x32')],'type':_0xb07851[_0x38d3('0x33')]['key']};});_0xa716df['model']=_['map'](_0x1042d5,_0x38d3('0x2c'));_0xa716df[_0x38d3('0x34')]=_['keys'](_0x119281[_0x38d3('0x34')]);_0xa716df[_0x38d3('0x35')]=_[_0x38d3('0x36')](_0xa716df[_0x38d3('0x37')],_0xa716df['query']);_0x394f33[_0x38d3('0x38')]=_[_0x38d3('0x36')](_0xa716df['model'],qs[_0x38d3('0x39')](_0x119281['query'][_0x38d3('0x39')]));_0x394f33[_0x38d3('0x38')]=_0x394f33[_0x38d3('0x38')]['length']?_0x394f33[_0x38d3('0x38')]:_0xa716df['model'];if(!_0x119281[_0x38d3('0x34')]['hasOwnProperty'](_0x38d3('0x3a'))){_0x394f33['limit']=qs[_0x38d3('0x20')](_0x119281[_0x38d3('0x34')][_0x38d3('0x20')]);_0x394f33['offset']=qs[_0x38d3('0x22')](_0x119281['query']['offset']);}_0x394f33[_0x38d3('0x3b')]=qs[_0x38d3('0x3c')](_0x119281[_0x38d3('0x34')][_0x38d3('0x3c')]);_0x394f33[_0x38d3('0x3d')]=qs['filters'](_[_0x38d3('0x3e')](_0x119281[_0x38d3('0x34')],_0xa716df['filters']),_0x1042d5);if(_0x119281[_0x38d3('0x34')][_0x38d3('0x3f')]){_0x394f33[_0x38d3('0x3d')]=_[_0x38d3('0x40')](_0x394f33['where'],{'$or':_[_0x38d3('0x2f')](_0x1042d5,function(_0x1256fa){if(_0x1256fa['type']!==_0x38d3('0x41')){var _0x197e52={};_0x197e52[_0x1256fa[_0x38d3('0x2c')]]={'$like':'%'+_0x119281[_0x38d3('0x34')][_0x38d3('0x3f')]+'%'};return _0x197e52;}})});}_0x394f33=_['merge']({},_0x394f33,_0x119281[_0x38d3('0x42')]);var _0x3d122f={'where':_0x394f33[_0x38d3('0x3d')]};return db['Attachment']['count'](_0x3d122f)[_0x38d3('0x29')](function(_0x592b63){_0x152888['count']=_0x592b63;if(_0x119281[_0x38d3('0x34')][_0x38d3('0x43')]){_0x394f33['include']=[{'all':!![]}];}return db[_0x38d3('0x30')][_0x38d3('0x44')](_0x394f33);})['then'](function(_0x10f0f4){_0x152888[_0x38d3('0x45')]=_0x10f0f4;return _0x152888;})[_0x38d3('0x29')](respondWithFilteredResult(_0x5d8e63,_0x394f33))[_0x38d3('0x46')](handleError(_0x5d8e63,null));};exports[_0x38d3('0x47')]=function(_0x1d0d39,_0x5ba956){var _0x573563={'raw':!![],'where':{'id':_0x1d0d39[_0x38d3('0x48')]['id']}},_0x401bc4={};_0x401bc4[_0x38d3('0x37')]=_[_0x38d3('0x49')](db[_0x38d3('0x30')][_0x38d3('0x31')]);_0x401bc4[_0x38d3('0x34')]=_['keys'](_0x1d0d39[_0x38d3('0x34')]);_0x401bc4['filters']=_[_0x38d3('0x36')](_0x401bc4[_0x38d3('0x37')],_0x401bc4['query']);_0x573563[_0x38d3('0x38')]=_[_0x38d3('0x36')](_0x401bc4[_0x38d3('0x37')],qs['fields'](_0x1d0d39[_0x38d3('0x34')][_0x38d3('0x39')]));_0x573563['attributes']=_0x573563['attributes']['length']?_0x573563[_0x38d3('0x38')]:_0x401bc4[_0x38d3('0x37')];if(_0x1d0d39[_0x38d3('0x34')][_0x38d3('0x43')]){_0x573563[_0x38d3('0x4a')]=[{'all':!![]}];}_0x573563=_['merge']({},_0x573563,_0x1d0d39[_0x38d3('0x42')]);return db[_0x38d3('0x30')][_0x38d3('0x4b')](_0x573563)[_0x38d3('0x29')](handleEntityNotFound(_0x5ba956,null))['then'](respondWithResult(_0x5ba956,null))[_0x38d3('0x46')](handleError(_0x5ba956,null));};exports['clone']=function(_0x24a7e1,_0x16d6bd){var _0x3e335a={'where':{'id':_0x24a7e1[_0x38d3('0x48')]['id']}},_0x163392={};_0x163392['model']=_[_0x38d3('0x49')](db['Attachment']['rawAttributes']);_0x3e335a[_0x38d3('0x38')]=_['intersection'](_0x163392[_0x38d3('0x37')],qs[_0x38d3('0x39')](_0x24a7e1[_0x38d3('0x34')][_0x38d3('0x39')]));_0x3e335a['attributes']=_0x3e335a[_0x38d3('0x38')][_0x38d3('0x4c')]?_0x3e335a[_0x38d3('0x38')]:_0x163392[_0x38d3('0x37')];if(_0x24a7e1[_0x38d3('0x34')][_0x38d3('0x43')]){_0x3e335a['include']=[{'all':!![]}];}_0x3e335a=_[_0x38d3('0x40')]({},_0x3e335a,_0x24a7e1[_0x38d3('0x42')]);return db[_0x38d3('0x30')][_0x38d3('0x4b')](_0x3e335a)[_0x38d3('0x29')](handleEntityNotFound(_0x16d6bd,null))[_0x38d3('0x29')](function(_0x40c993){if(_0x40c993){var _0x2e4c00=_0x40c993[_0x38d3('0x4d')]({'plain':!![]});_0x2e4c00=qs[_0x38d3('0x4e')](_0x2e4c00,['id',_0x38d3('0x4f'),_0x38d3('0x50')]);_0x24a7e1[_0x38d3('0x51')]=_['omit'](_0x24a7e1[_0x38d3('0x51')],['id',_0x38d3('0x4f'),_0x38d3('0x50')]);return db[_0x38d3('0x30')][_0x38d3('0x52')](_['merge'](_0x2e4c00,_0x24a7e1[_0x38d3('0x51')]),{'include':_0x24a7e1['query'][_0x38d3('0x43')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x16d6bd,0xc9))[_0x38d3('0x46')](handleError(_0x16d6bd,null));};exports[_0x38d3('0x28')]=function(_0x21dff5,_0x4abba8){if(_0x21dff5[_0x38d3('0x51')]['id']){delete _0x21dff5[_0x38d3('0x51')]['id'];}return db[_0x38d3('0x30')]['find']({'where':{'id':_0x21dff5['params']['id']}})[_0x38d3('0x29')](handleEntityNotFound(_0x4abba8,null))[_0x38d3('0x29')](saveUpdates(_0x21dff5[_0x38d3('0x51')],null))[_0x38d3('0x29')](respondWithResult(_0x4abba8,null))[_0x38d3('0x46')](handleError(_0x4abba8,null));};exports[_0x38d3('0x2a')]=function(_0xc7bfec,_0x28a3d6){return db[_0x38d3('0x30')][_0x38d3('0x4b')]({'where':{'id':_0xc7bfec[_0x38d3('0x48')]['id']}})['then'](handleEntityNotFound(_0x28a3d6,null))['then'](removeEntity(_0x28a3d6,null))['catch'](handleError(_0x28a3d6,null));};exports[_0x38d3('0x52')]=function(_0x83af43,_0x221f22,_0x1d027d){_0x83af43[_0x38d3('0x51')][_0x38d3('0x2c')]=_0x83af43[_0x38d3('0x53')][_0x38d3('0x54')];_0x83af43[_0x38d3('0x51')][_0x38d3('0x55')]=_0x83af43['file'][_0x38d3('0x56')];_0x83af43['body'][_0x38d3('0x33')]=_0x83af43[_0x38d3('0x53')][_0x38d3('0x57')];return db[_0x38d3('0x30')][_0x38d3('0x52')](_0x83af43[_0x38d3('0x51')])['then'](respondWithResult(_0x221f22,0xc9))[_0x38d3('0x46')](handleError(_0x221f22,null));};exports[_0x38d3('0x58')]=function(_0x294503,_0x3aae95,_0x4ba447){return db[_0x38d3('0x30')]['findOne']({'where':{'id':_0x294503[_0x38d3('0x48')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3aae95,null))[_0x38d3('0x29')](function(_0x312f63){if(_0x312f63){var _0x473d1f=_0x312f63[_0x38d3('0x59')]!==null;var _0x2270d5=path['join'](config['root'],_0x38d3('0x5a'));if(_0x473d1f){_0x2270d5=path[_0x38d3('0x5b')](_0x2270d5,'offline-chat/');}var _0x530023=path[_0x38d3('0x5b')](_0x2270d5,_0x312f63[_0x38d3('0x55')]);return _0x3aae95[_0x38d3('0x58')](_0x530023);}})[_0x38d3('0x46')](handleError(_0x3aae95,null));};
\ No newline at end of file
+var _0x7440=['where','merge','options','Attachment','findAll','rows','catch','show','params','rawAttributes','fields','includeAll','include','find','clone','get','createdAt','body','omit','updatedAt','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','sendStatus','error','name','send','index','map','fieldName','type','model','keys','filters','intersection','query','attributes','length','nolimit','order','pick','filter'];(function(_0x4629ee,_0x5802d8){var _0x47fb5b=function(_0xf899cd){while(--_0xf899cd){_0x4629ee['push'](_0x4629ee['shift']());}};_0x47fb5b(++_0x5802d8);}(_0x7440,0x132));var _0x0744=function(_0x3fd293,_0x1810ac){_0x3fd293=_0x3fd293-0x0;var _0x15ddca=_0x7440[_0x3fd293];return _0x15ddca;};'use strict';var emlformat=require(_0x0744('0x0'));var rimraf=require(_0x0744('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0744('0x2'));var rp=require(_0x0744('0x3'));var moment=require('moment');var BPromise=require(_0x0744('0x4'));var Mustache=require(_0x0744('0x5'));var util=require(_0x0744('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0744('0x7'));var _=require(_0x0744('0x8'));var squel=require(_0x0744('0x9'));var crypto=require(_0x0744('0xa'));var jsforce=require(_0x0744('0xb'));var deskjs=require(_0x0744('0xc'));var toCsv=require(_0x0744('0xd'));var querystring=require(_0x0744('0xe'));var Papa=require(_0x0744('0xf'));var Redis=require(_0x0744('0x10'));var authService=require(_0x0744('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0744('0x12'));var hardwareService=require(_0x0744('0x13'));var logger=require(_0x0744('0x14'))(_0x0744('0x15'));var utils=require(_0x0744('0x16'));var config=require(_0x0744('0x17'));var licenseUtil=require(_0x0744('0x18'));var db=require(_0x0744('0x19'))['db'];function respondWithStatusCode(_0x3575d0,_0x679399){_0x679399=_0x679399||0xcc;return function(_0x255a35){if(_0x255a35){return _0x3575d0['sendStatus'](_0x679399);}return _0x3575d0[_0x0744('0x1a')](_0x679399)[_0x0744('0x1b')]();};}function respondWithResult(_0x1dcfa1,_0x5eb5a9){_0x5eb5a9=_0x5eb5a9||0xc8;return function(_0x258e45){if(_0x258e45){return _0x1dcfa1[_0x0744('0x1a')](_0x5eb5a9)[_0x0744('0x1c')](_0x258e45);}};}function respondWithFilteredResult(_0xbde0b0,_0x840a91){return function(_0x3b2c40){if(_0x3b2c40){var _0x442f64=typeof _0x840a91[_0x0744('0x1d')]===_0x0744('0x1e')&&typeof _0x840a91[_0x0744('0x1f')]===_0x0744('0x1e');var _0x175002=_0x3b2c40[_0x0744('0x20')];var _0x3626ec=_0x442f64?0x0:_0x840a91[_0x0744('0x1d')];var _0x26f0b9=_0x442f64?_0x3b2c40['count']:_0x840a91[_0x0744('0x1d')]+_0x840a91['limit'];var _0xa05fd7;if(_0x26f0b9>=_0x175002){_0x26f0b9=_0x175002;_0xa05fd7=0xc8;}else{_0xa05fd7=0xce;}_0xbde0b0[_0x0744('0x1a')](_0xa05fd7);return _0xbde0b0[_0x0744('0x21')]('Content-Range',_0x3626ec+'-'+_0x26f0b9+'/'+_0x175002)[_0x0744('0x1c')](_0x3b2c40);}return null;};}function patchUpdates(_0x34b49b){return function(_0x40a83e){try{jsonpatch['apply'](_0x40a83e,_0x34b49b,!![]);}catch(_0x203646){return BPromise[_0x0744('0x22')](_0x203646);}return _0x40a83e[_0x0744('0x23')]();};}function saveUpdates(_0x10f6e4,_0xeda4a1){return function(_0x2774db){if(_0x2774db){return _0x2774db[_0x0744('0x24')](_0x10f6e4)['then'](function(_0x512402){return _0x512402;});}return null;};}function removeEntity(_0x1d3a61,_0x55189c){return function(_0x221250){if(_0x221250){return _0x221250[_0x0744('0x25')]()[_0x0744('0x26')](function(){_0x1d3a61[_0x0744('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10b0ba,_0x3b4d89){return function(_0x5e88c8){if(!_0x5e88c8){_0x10b0ba[_0x0744('0x27')](0x194);}return _0x5e88c8;};}function handleError(_0x4b1897,_0x31159e){_0x31159e=_0x31159e||0x1f4;return function(_0x49ff0e){logger[_0x0744('0x28')](_0x49ff0e['stack']);if(_0x49ff0e[_0x0744('0x29')]){delete _0x49ff0e[_0x0744('0x29')];}_0x4b1897[_0x0744('0x1a')](_0x31159e)[_0x0744('0x2a')](_0x49ff0e);};}exports[_0x0744('0x2b')]=function(_0x55e50f,_0x2babc7){var _0x1378a5={},_0x29310d={},_0x149b1d={'count':0x0,'rows':[]};var _0x162a98=_[_0x0744('0x2c')](db['Attachment']['rawAttributes'],function(_0x280483){return{'name':_0x280483[_0x0744('0x2d')],'type':_0x280483[_0x0744('0x2e')]['key']};});_0x29310d[_0x0744('0x2f')]=_[_0x0744('0x2c')](_0x162a98,_0x0744('0x29'));_0x29310d['query']=_[_0x0744('0x30')](_0x55e50f['query']);_0x29310d[_0x0744('0x31')]=_[_0x0744('0x32')](_0x29310d[_0x0744('0x2f')],_0x29310d[_0x0744('0x33')]);_0x1378a5[_0x0744('0x34')]=_['intersection'](_0x29310d['model'],qs['fields'](_0x55e50f['query']['fields']));_0x1378a5[_0x0744('0x34')]=_0x1378a5['attributes'][_0x0744('0x35')]?_0x1378a5[_0x0744('0x34')]:_0x29310d[_0x0744('0x2f')];if(!_0x55e50f[_0x0744('0x33')]['hasOwnProperty'](_0x0744('0x36'))){_0x1378a5[_0x0744('0x1f')]=qs[_0x0744('0x1f')](_0x55e50f[_0x0744('0x33')][_0x0744('0x1f')]);_0x1378a5['offset']=qs['offset'](_0x55e50f[_0x0744('0x33')][_0x0744('0x1d')]);}_0x1378a5[_0x0744('0x37')]=qs['sort'](_0x55e50f[_0x0744('0x33')]['sort']);_0x1378a5['where']=qs[_0x0744('0x31')](_[_0x0744('0x38')](_0x55e50f['query'],_0x29310d[_0x0744('0x31')]),_0x162a98);if(_0x55e50f[_0x0744('0x33')][_0x0744('0x39')]){_0x1378a5[_0x0744('0x3a')]=_[_0x0744('0x3b')](_0x1378a5[_0x0744('0x3a')],{'$or':_[_0x0744('0x2c')](_0x162a98,function(_0x2ee214){if(_0x2ee214[_0x0744('0x2e')]!=='VIRTUAL'){var _0x544dd4={};_0x544dd4[_0x2ee214[_0x0744('0x29')]]={'$like':'%'+_0x55e50f[_0x0744('0x33')][_0x0744('0x39')]+'%'};return _0x544dd4;}})});}_0x1378a5=_[_0x0744('0x3b')]({},_0x1378a5,_0x55e50f[_0x0744('0x3c')]);var _0x2a56fe={'where':_0x1378a5[_0x0744('0x3a')]};return db[_0x0744('0x3d')]['count'](_0x2a56fe)['then'](function(_0x5b09b8){_0x149b1d[_0x0744('0x20')]=_0x5b09b8;if(_0x55e50f[_0x0744('0x33')]['includeAll']){_0x1378a5['include']=[{'all':!![]}];}return db[_0x0744('0x3d')][_0x0744('0x3e')](_0x1378a5);})[_0x0744('0x26')](function(_0x282668){_0x149b1d[_0x0744('0x3f')]=_0x282668;return _0x149b1d;})['then'](respondWithFilteredResult(_0x2babc7,_0x1378a5))[_0x0744('0x40')](handleError(_0x2babc7,null));};exports[_0x0744('0x41')]=function(_0x1696ad,_0x3d51f1){var _0x5bf23b={'raw':!![],'where':{'id':_0x1696ad[_0x0744('0x42')]['id']}},_0x14d1d6={};_0x14d1d6[_0x0744('0x2f')]=_[_0x0744('0x30')](db[_0x0744('0x3d')][_0x0744('0x43')]);_0x14d1d6['query']=_['keys'](_0x1696ad['query']);_0x14d1d6[_0x0744('0x31')]=_[_0x0744('0x32')](_0x14d1d6[_0x0744('0x2f')],_0x14d1d6[_0x0744('0x33')]);_0x5bf23b[_0x0744('0x34')]=_[_0x0744('0x32')](_0x14d1d6[_0x0744('0x2f')],qs[_0x0744('0x44')](_0x1696ad[_0x0744('0x33')]['fields']));_0x5bf23b[_0x0744('0x34')]=_0x5bf23b[_0x0744('0x34')][_0x0744('0x35')]?_0x5bf23b[_0x0744('0x34')]:_0x14d1d6[_0x0744('0x2f')];if(_0x1696ad[_0x0744('0x33')][_0x0744('0x45')]){_0x5bf23b[_0x0744('0x46')]=[{'all':!![]}];}_0x5bf23b=_[_0x0744('0x3b')]({},_0x5bf23b,_0x1696ad['options']);return db[_0x0744('0x3d')][_0x0744('0x47')](_0x5bf23b)[_0x0744('0x26')](handleEntityNotFound(_0x3d51f1,null))[_0x0744('0x26')](respondWithResult(_0x3d51f1,null))[_0x0744('0x40')](handleError(_0x3d51f1,null));};exports[_0x0744('0x48')]=function(_0x5a54d9,_0x496613){var _0x5a53da={'where':{'id':_0x5a54d9[_0x0744('0x42')]['id']}},_0x235c50={};_0x235c50[_0x0744('0x2f')]=_[_0x0744('0x30')](db[_0x0744('0x3d')][_0x0744('0x43')]);_0x5a53da[_0x0744('0x34')]=_[_0x0744('0x32')](_0x235c50[_0x0744('0x2f')],qs[_0x0744('0x44')](_0x5a54d9[_0x0744('0x33')][_0x0744('0x44')]));_0x5a53da[_0x0744('0x34')]=_0x5a53da['attributes'][_0x0744('0x35')]?_0x5a53da['attributes']:_0x235c50['model'];if(_0x5a54d9[_0x0744('0x33')][_0x0744('0x45')]){_0x5a53da[_0x0744('0x46')]=[{'all':!![]}];}_0x5a53da=_[_0x0744('0x3b')]({},_0x5a53da,_0x5a54d9[_0x0744('0x3c')]);return db[_0x0744('0x3d')][_0x0744('0x47')](_0x5a53da)[_0x0744('0x26')](handleEntityNotFound(_0x496613,null))[_0x0744('0x26')](function(_0x2c014f){if(_0x2c014f){var _0x4e37dd=_0x2c014f[_0x0744('0x49')]({'plain':!![]});_0x4e37dd=qs['omit'](_0x4e37dd,['id',_0x0744('0x4a'),'updatedAt']);_0x5a54d9[_0x0744('0x4b')]=_[_0x0744('0x4c')](_0x5a54d9[_0x0744('0x4b')],['id','createdAt',_0x0744('0x4d')]);return db[_0x0744('0x3d')][_0x0744('0x4e')](_['merge'](_0x4e37dd,_0x5a54d9[_0x0744('0x4b')]),{'include':_0x5a54d9[_0x0744('0x33')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x0744('0x26')](respondWithResult(_0x496613,0xc9))[_0x0744('0x40')](handleError(_0x496613,null));};exports[_0x0744('0x24')]=function(_0x45c22b,_0x56861a){if(_0x45c22b[_0x0744('0x4b')]['id']){delete _0x45c22b[_0x0744('0x4b')]['id'];}return db[_0x0744('0x3d')]['find']({'where':{'id':_0x45c22b[_0x0744('0x42')]['id']}})[_0x0744('0x26')](handleEntityNotFound(_0x56861a,null))[_0x0744('0x26')](saveUpdates(_0x45c22b[_0x0744('0x4b')],null))[_0x0744('0x26')](respondWithResult(_0x56861a,null))['catch'](handleError(_0x56861a,null));};exports['destroy']=function(_0x1f8dcc,_0x28e62a){return db[_0x0744('0x3d')][_0x0744('0x47')]({'where':{'id':_0x1f8dcc[_0x0744('0x42')]['id']}})[_0x0744('0x26')](handleEntityNotFound(_0x28e62a,null))[_0x0744('0x26')](removeEntity(_0x28e62a,null))[_0x0744('0x40')](handleError(_0x28e62a,null));};exports['create']=function(_0xe1e25d,_0x4f7f98,_0xfeb542){_0xe1e25d[_0x0744('0x4b')][_0x0744('0x29')]=_0xe1e25d[_0x0744('0x4f')][_0x0744('0x50')];_0xe1e25d[_0x0744('0x4b')][_0x0744('0x51')]=_0xe1e25d[_0x0744('0x4f')][_0x0744('0x52')];_0xe1e25d[_0x0744('0x4b')][_0x0744('0x2e')]=_0xe1e25d[_0x0744('0x4f')][_0x0744('0x53')];return db[_0x0744('0x3d')][_0x0744('0x4e')](_0xe1e25d[_0x0744('0x4b')])['then'](respondWithResult(_0x4f7f98,0xc9))[_0x0744('0x40')](handleError(_0x4f7f98,null));};exports[_0x0744('0x54')]=function(_0x30c2e8,_0x35e8fc,_0x2aaf6a){return db[_0x0744('0x3d')][_0x0744('0x55')]({'where':{'id':_0x30c2e8['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x35e8fc,null))[_0x0744('0x26')](function(_0x178ea9){if(_0x178ea9){var _0x1eb1c1=_0x178ea9[_0x0744('0x56')]!==null;var _0x1239b2=path[_0x0744('0x57')](config[_0x0744('0x58')],_0x0744('0x59'));if(_0x1eb1c1){_0x1239b2=path[_0x0744('0x57')](_0x1239b2,_0x0744('0x5a'));}var _0x3894eb=path['join'](_0x1239b2,_0x178ea9['basename']);return _0x35e8fc[_0x0744('0x54')](_0x3894eb);}})[_0x0744('0x40')](handleError(_0x35e8fc,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 0d47f17..3083c48 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 _0x2e85=['rimraf','../../config/environment','exports','define','util','../../config/logger','api','moment','bluebird','path'];(function(_0x2b63ea,_0x182b86){var _0x838701=function(_0x22d6d6){while(--_0x22d6d6){_0x2b63ea['push'](_0x2b63ea['shift']());}};_0x838701(++_0x182b86);}(_0x2e85,0x144));var _0x52e8=function(_0x1aef08,_0x521afc){_0x1aef08=_0x1aef08-0x0;var _0x105a2c=_0x2e85[_0x1aef08];return _0x105a2c;};'use strict';var _=require('lodash');var util=require(_0x52e8('0x0'));var logger=require(_0x52e8('0x1'))(_0x52e8('0x2'));var moment=require(_0x52e8('0x3'));var BPromise=require(_0x52e8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x52e8('0x5'));var rimraf=require(_0x52e8('0x6'));var config=require(_0x52e8('0x7'));var attributes=require('./attachment.attributes');module[_0x52e8('0x8')]=function(_0x444d91,_0x5720fe){return _0x444d91[_0x52e8('0x9')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc665=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./attachment.attributes','define','attachments'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xc665,0x84));var _0x5c66=function(_0x4b12a4,_0x4a2df0){_0x4b12a4=_0x4b12a4-0x0;var _0x22ee43=_0xc665[_0x4b12a4];return _0x22ee43;};'use strict';var _=require(_0x5c66('0x0'));var util=require(_0x5c66('0x1'));var logger=require(_0x5c66('0x2'))(_0x5c66('0x3'));var moment=require(_0x5c66('0x4'));var BPromise=require(_0x5c66('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5c66('0x6'));var rimraf=require('rimraf');var config=require(_0x5c66('0x7'));var attributes=require(_0x5c66('0x8'));module['exports']=function(_0x361d2d,_0x3c6c60){return _0x361d2d[_0x5c66('0x9')]('Attachment',attributes,{'tableName':_0x5c66('0xa'),'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 58eb301..4e70eea 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 _0xa75b=['client','http','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','Attachment','create','options','CreateAttachment','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa75b,0x170));var _0xba75=function(_0x46d6b7,_0x117a8d){_0x46d6b7=_0x46d6b7-0x0;var _0x44f492=_0xa75b[_0x46d6b7];return _0x44f492;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xba75('0x1'));var rs=require(_0xba75('0x2'));var fs=require('fs');var Redis=require(_0xba75('0x3'));var db=require(_0xba75('0x4'))['db'];var utils=require(_0xba75('0x5'));var logger=require(_0xba75('0x6'))(_0xba75('0x7'));var config=require(_0xba75('0x8'));var jayson=require(_0xba75('0x9'));var client=jayson[_0xba75('0xa')][_0xba75('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x238a33,_0x3ccab5,_0x5c79e3){return new BPromise(function(_0x4b842d,_0x731cae){return client['request'](_0x238a33,_0x5c79e3)['then'](function(_0x218dbd){logger['info'](_0xba75('0xc'),_0x3ccab5,_0xba75('0xd'));logger[_0xba75('0xe')](_0xba75('0xf'),_0x3ccab5,_0xba75('0xd'),JSON[_0xba75('0x10')](_0x218dbd));if(_0x218dbd[_0xba75('0x11')]){if(_0x218dbd[_0xba75('0x11')][_0xba75('0x12')]===0x1f4){logger[_0xba75('0x11')](_0xba75('0xc'),_0x3ccab5,_0x218dbd[_0xba75('0x11')]['message']);return _0x731cae(_0x218dbd['error'][_0xba75('0x13')]);}logger['error'](_0xba75('0xc'),_0x3ccab5,_0x218dbd[_0xba75('0x11')][_0xba75('0x13')]);return _0x4b842d(_0x218dbd[_0xba75('0x11')]['message']);}else{logger[_0xba75('0x14')](_0xba75('0xc'),_0x3ccab5,_0xba75('0xd'));_0x4b842d(_0x218dbd[_0xba75('0x15')][_0xba75('0x13')]);}})['catch'](function(_0x350a9d){logger[_0xba75('0x11')](_0xba75('0xc'),_0x3ccab5,_0x350a9d);_0x731cae(_0x350a9d);});});}exports['CreateAttachment']=function(_0x2822af){var _0xd8850f=this;return new Promise(function(_0xc4bf17,_0x132750){return db[_0xba75('0x16')][_0xba75('0x17')](_0x2822af['body'],{'raw':_0x2822af[_0xba75('0x18')]?_0x2822af[_0xba75('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x35ffd2){logger[_0xba75('0x14')]('CreateAttachment',_0x2822af);logger['debug'](_0xba75('0x19'),_0x2822af,JSON['stringify'](_0x35ffd2));_0xc4bf17(_0x35ffd2);})[_0xba75('0x1a')](function(_0x2ece41){logger[_0xba75('0x11')]('CreateAttachment',_0x2ece41[_0xba75('0x13')],_0x2822af);_0x132750(_0xd8850f[_0xba75('0x11')](0x1f4,_0x2ece41[_0xba75('0x13')]));});});};
\ No newline at end of file
+var _0xe644=['code','message','catch','CreateAttachment','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5a7da7,_0x4f132a){var _0x14459e=function(_0x4daa47){while(--_0x4daa47){_0x5a7da7['push'](_0x5a7da7['shift']());}};_0x14459e(++_0x4f132a);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e64('0x0'));var util=require(_0x4e64('0x1'));var moment=require(_0x4e64('0x2'));var BPromise=require(_0x4e64('0x3'));var rs=require(_0x4e64('0x4'));var fs=require('fs');var Redis=require(_0x4e64('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e64('0x6'));var logger=require(_0x4e64('0x7'))(_0x4e64('0x8'));var config=require(_0x4e64('0x9'));var jayson=require(_0x4e64('0xa'));var client=jayson[_0x4e64('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x66faf,_0x12c40d,_0x5cce6e){return new BPromise(function(_0x4d5aa6,_0x8573c1){return client['request'](_0x66faf,_0x5cce6e)['then'](function(_0x2ebcfe){logger[_0x4e64('0xc')](_0x4e64('0xd'),_0x12c40d,_0x4e64('0xe'));logger[_0x4e64('0xf')](_0x4e64('0x10'),_0x12c40d,'request\x20sent',JSON[_0x4e64('0x11')](_0x2ebcfe));if(_0x2ebcfe[_0x4e64('0x12')]){if(_0x2ebcfe['error'][_0x4e64('0x13')]===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x12c40d,_0x2ebcfe[_0x4e64('0x12')]['message']);return _0x8573c1(_0x2ebcfe[_0x4e64('0x12')][_0x4e64('0x14')]);}logger[_0x4e64('0x12')](_0x4e64('0xd'),_0x12c40d,_0x2ebcfe[_0x4e64('0x12')][_0x4e64('0x14')]);return _0x4d5aa6(_0x2ebcfe[_0x4e64('0x12')]['message']);}else{logger[_0x4e64('0xc')](_0x4e64('0xd'),_0x12c40d,_0x4e64('0xe'));_0x4d5aa6(_0x2ebcfe['result'][_0x4e64('0x14')]);}})[_0x4e64('0x15')](function(_0x452f34){logger[_0x4e64('0x12')](_0x4e64('0xd'),_0x12c40d,_0x452f34);_0x8573c1(_0x452f34);});});}exports[_0x4e64('0x16')]=function(_0x135ffb){var _0x3961c5=this;return new Promise(function(_0x1be196,_0x2df16a){return db['Attachment'][_0x4e64('0x17')](_0x135ffb[_0x4e64('0x18')],{'raw':_0x135ffb['options']?_0x135ffb[_0x4e64('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x18a1d3){logger[_0x4e64('0xc')](_0x4e64('0x16'),_0x135ffb);logger['debug'](_0x4e64('0x16'),_0x135ffb,JSON['stringify'](_0x18a1d3));_0x1be196(_0x18a1d3);})[_0x4e64('0x15')](function(_0x336c53){logger[_0x4e64('0x12')]('CreateAttachment',_0x336c53[_0x4e64('0x14')],_0x135ffb);_0x2df16a(_0x3961c5[_0x4e64('0x12')](0x1f4,_0x336c53[_0x4e64('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 4ac2ab2..58009fe 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(_0xa7144f,_0x53ba7a){var _0x417dfe=function(_0x1b6e19){while(--_0x1b6e19){_0xa7144f['push'](_0xa7144f['shift']());}};_0x417dfe(++_0x53ba7a);}(_0x2032,0xd9));var _0x2203=function(_0x5dbb14,_0xfa4e72){_0x5dbb14=_0x5dbb14-0x0;var _0x1e181e=_0x2032[_0x5dbb14];return _0x1e181e;};'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 _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x3ccdf8,_0x584ceb){var _0x243dab=function(_0x1a90d1){while(--_0x1a90d1){_0x3ccdf8['push'](_0x3ccdf8['shift']());}};_0x243dab(++_0x584ceb);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 3aab988..80d7324 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 _0xda51=['login','authenticate','ad-login','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','url','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','name','password','salt','disabled','online','admin','user','domain','blocked','blockedAt','add','clearBlockUser','getLicense','catch','status','send','message'];(function(_0x1fd3f8,_0x8bdd8a){var _0x3d5169=function(_0x582938){while(--_0x582938){_0x1fd3f8['push'](_0x1fd3f8['shift']());}};_0x3d5169(++_0x8bdd8a);}(_0xda51,0x1db));var _0x1da5=function(_0x25e109,_0x6ab24c){_0x25e109=_0x25e109-0x0;var _0xc0f7d6=_0xda51[_0x25e109];return _0xc0f7d6;};'use strict';var passport=require(_0x1da5('0x0'));var LocalStrategy=require(_0x1da5('0x1'))[_0x1da5('0x2')];var moment=require(_0x1da5('0x3'));var ActiveDirectory=require(_0x1da5('0x4'));var BPromise=require(_0x1da5('0x5'));var util=require(_0x1da5('0x6'));var db=require(_0x1da5('0x7'))['db'];var authService=require(_0x1da5('0x8'));var utils=require(_0x1da5('0x9'));var config=require(_0x1da5('0xa'));var logger=require(_0x1da5('0xb'))(_0x1da5('0xc'));function isActiveDirectoryConfigured(_0x35eceb){var _0x415ada=![];if(typeof _0x35eceb[_0x1da5('0xd')]!=='undefined'){_0x415ada=_0x35eceb[_0x1da5('0xd')]['baseDN']&&_0x35eceb[_0x1da5('0xd')][_0x1da5('0xe')]&&_0x35eceb[_0x1da5('0xd')]['domain'];}return _0x415ada;}function adAuthenticate(_0x3abc63,_0x4c8f31,_0x123cfb){return new BPromise(function(_0x39e915,_0x40019a){try{var _0x488999=new ActiveDirectory(_0x3abc63);_0x488999['authenticate'](_0x4c8f31,_0x123cfb,function(_0x32cec0,_0x123819){if(_0x32cec0){logger[_0x1da5('0xf')](_0x1da5('0x10'),_0x4c8f31,util['inspect'](_0x32cec0,{'showHidden':![],'depth':null}));_0x40019a(_0x1da5('0x11'));}else if(!_0x123819){logger['error'](_0x1da5('0x12'),_0x4c8f31);_0x40019a(_0x1da5('0x11'));}else{_0x39e915(_0x123819);}});}catch(_0x41772e){_0x40019a(_0x41772e);}});}function ActiveDirectoryAuthenticate(_0x5ca1a3,_0x395e91,_0x57d9bb,_0x458a9b){var _0x2d4c34,_0x111e62;if(!isActiveDirectoryConfigured(config)){logger[_0x1da5('0xf')](_0x1da5('0x13'),_0x395e91);return _0x458a9b(null,![],{'message':_0x1da5('0x11')});}return db[_0x1da5('0x14')][_0x1da5('0x15')]({'where':{'id':0x1},'attributes':[_0x1da5('0x16'),_0x1da5('0x17')],'raw':!![]})[_0x1da5('0x18')](function(_0x123e72){_0x2d4c34=_0x123e72;if(!_0x2d4c34[_0x1da5('0x16')]){logger[_0x1da5('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x395e91);throw new Error(_0x1da5('0x11'));}return _0x5ca1a3[_0x1da5('0x15')]({'attributes':['id',_0x1da5('0x19'),_0x1da5('0x1a'),_0x1da5('0x1b'),'role',_0x1da5('0x1c'),'blocked','blockedAt',_0x1da5('0x1d')],'where':{'name':_0x395e91,'role':{'$or':[_0x1da5('0x1e'),_0x1da5('0x1f'),'agent']},'adSsoEnabled':!![]}});})[_0x1da5('0x18')](function(_0x7e90de){if(!_0x7e90de||_0x7e90de&&_0x7e90de[_0x1da5('0x19')]!==_0x395e91){throw new Error(_0x1da5('0x11'));}_0x111e62=_0x7e90de;var _0x2f5679=_0x111e62[_0x1da5('0x19')]+'@'+config[_0x1da5('0xd')][_0x1da5('0x20')];return adAuthenticate(config['activedirectory'],_0x2f5679,_0x57d9bb);})[_0x1da5('0x18')](function(_0x358619){if(_0x111e62[_0x1da5('0x1c')]){throw new Error(_0x1da5('0x11'));}if(_0x2d4c34[_0x1da5('0x17')]>0x0){if(_0x111e62[_0x1da5('0x21')]){if(moment(_0x111e62[_0x1da5('0x22')])[_0x1da5('0x23')](_0x2d4c34[_0x1da5('0x17')],'minutes')>moment()){throw new Error(_0x1da5('0x11'));}return utils[_0x1da5('0x24')](_0x111e62,0x0,![],null)[_0x1da5('0x18')](function(){return utils['getLicense'](_0x111e62);})[_0x1da5('0x18')](function(){return _0x458a9b(null,_0x111e62);});}else{return utils[_0x1da5('0x25')](_0x111e62)['then'](function(){return _0x458a9b(null,_0x111e62);});}}else{return utils[_0x1da5('0x25')](_0x111e62)[_0x1da5('0x18')](function(){return _0x458a9b(null,_0x111e62);});}})[_0x1da5('0x26')](function(_0x1f22c3){return _0x458a9b(null,![],_0x1f22c3);});}function handleError(_0x3e00d1,_0x43f59c,_0x5901b8){return _0x3e00d1[_0x1da5('0x27')](_0x43f59c||0x1f4)[_0x1da5('0x28')]({'message':_0x5901b8?_0x5901b8[_0x1da5('0x29')]||_0x5901b8:''});}exports[_0x1da5('0x2a')]=function(_0x538396,_0x3e5ce1,_0x417ee4){passport[_0x1da5('0x2b')](_0x1da5('0x2c'),function(_0x5e66e5,_0x41c82b,_0x5af5c7){var _0x34b9c0=_0x5e66e5||_0x5af5c7;if(_0x34b9c0){return handleError(_0x3e5ce1,0x191,_0x34b9c0);}if(!_0x41c82b){return handleError(_0x3e5ce1,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x567375={'payload':{'id':_0x41c82b['id'],'role':_0x41c82b['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x567375)[_0x1da5('0x18')](function(_0x1684cc){_0x3e5ce1['json']({'id':_0x41c82b['id'],'token':_0x1684cc,'statusCall':'','isAlreadyLogged':_0x41c82b[_0x1da5('0x1d')]});});}})(_0x538396,_0x3e5ce1,_0x417ee4);};passport[_0x1da5('0x2d')](_0x1da5('0x2c'),new LocalStrategy({'usernameField':_0x1da5('0x19'),'passwordField':_0x1da5('0x1a')},function(_0x145210,_0x124101,_0x488e46){return ActiveDirectoryAuthenticate(db[_0x1da5('0x2e')],_0x145210,_0x124101,_0x488e46);}));
\ No newline at end of file
+var _0xdac5=['findOne','password','salt','role','disabled','blockedAt','online','user','name','domain','blocked','add','minutes','clearBlockUser','getLicense','catch','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','passport','passport-local','Strategy','moment','activedirectory2','bluebird','../../config/utils','../../config/environment','../../config/logger','activedirectory','undefined','baseDN','url','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled'];(function(_0x38c644,_0x3e695d){var _0x33f443=function(_0x3c8208){while(--_0x3c8208){_0x38c644['push'](_0x38c644['shift']());}};_0x33f443(++_0x3e695d);}(_0xdac5,0x159));var _0x5dac=function(_0x28419f,_0x4c48a7){_0x28419f=_0x28419f-0x0;var _0xafa7f=_0xdac5[_0x28419f];return _0xafa7f;};'use strict';var passport=require(_0x5dac('0x0'));var LocalStrategy=require(_0x5dac('0x1'))[_0x5dac('0x2')];var moment=require(_0x5dac('0x3'));var ActiveDirectory=require(_0x5dac('0x4'));var BPromise=require(_0x5dac('0x5'));var util=require('util');var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x5dac('0x6'));var config=require(_0x5dac('0x7'));var logger=require(_0x5dac('0x8'))('api');function isActiveDirectoryConfigured(_0x4b30da){var _0x4ca638=![];if(typeof _0x4b30da[_0x5dac('0x9')]!==_0x5dac('0xa')){_0x4ca638=_0x4b30da[_0x5dac('0x9')][_0x5dac('0xb')]&&_0x4b30da[_0x5dac('0x9')][_0x5dac('0xc')]&&_0x4b30da[_0x5dac('0x9')]['domain'];}return _0x4ca638;}function adAuthenticate(_0x4db839,_0x3a8d29,_0x297458){return new BPromise(function(_0x5e1be4,_0x4e8c77){try{var _0x23cf2e=new ActiveDirectory(_0x4db839);_0x23cf2e['authenticate'](_0x3a8d29,_0x297458,function(_0x5dd2e8,_0x17fa6e){if(_0x5dd2e8){logger[_0x5dac('0xd')](_0x5dac('0xe'),_0x3a8d29,util[_0x5dac('0xf')](_0x5dd2e8,{'showHidden':![],'depth':null}));_0x4e8c77('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x17fa6e){logger[_0x5dac('0xd')](_0x5dac('0x10'),_0x3a8d29);_0x4e8c77('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x5e1be4(_0x17fa6e);}});}catch(_0x46dbea){_0x4e8c77(_0x46dbea);}});}function ActiveDirectoryAuthenticate(_0x1ba8fd,_0x2e4396,_0x4182ef,_0x1ddbf3){var _0x29542c,_0x59d1d8;if(!isActiveDirectoryConfigured(config)){logger[_0x5dac('0xd')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x2e4396);return _0x1ddbf3(null,![],{'message':_0x5dac('0x11')});}return db[_0x5dac('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0x5dac('0x13'),_0x5dac('0x14')],'raw':!![]})[_0x5dac('0x15')](function(_0x291c33){_0x29542c=_0x291c33;if(!_0x29542c[_0x5dac('0x13')]){logger[_0x5dac('0xd')](_0x5dac('0x16'),_0x2e4396);throw new Error(_0x5dac('0x11'));}return _0x1ba8fd[_0x5dac('0x17')]({'attributes':['id','name',_0x5dac('0x18'),_0x5dac('0x19'),_0x5dac('0x1a'),_0x5dac('0x1b'),'blocked',_0x5dac('0x1c'),_0x5dac('0x1d')],'where':{'name':_0x2e4396,'role':{'$or':['admin',_0x5dac('0x1e'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x553af4){if(!_0x553af4||_0x553af4&&_0x553af4[_0x5dac('0x1f')]!==_0x2e4396){throw new Error(_0x5dac('0x11'));}_0x59d1d8=_0x553af4;var _0x2e1604=_0x59d1d8[_0x5dac('0x1f')]+'@'+config[_0x5dac('0x9')][_0x5dac('0x20')];return adAuthenticate(config['activedirectory'],_0x2e1604,_0x4182ef);})[_0x5dac('0x15')](function(_0x36177f){if(_0x59d1d8[_0x5dac('0x1b')]){throw new Error(_0x5dac('0x11'));}if(_0x29542c[_0x5dac('0x14')]>0x0){if(_0x59d1d8[_0x5dac('0x21')]){if(moment(_0x59d1d8[_0x5dac('0x1c')])[_0x5dac('0x22')](_0x29542c['blockDuration'],_0x5dac('0x23'))>moment()){throw new Error(_0x5dac('0x11'));}return utils[_0x5dac('0x24')](_0x59d1d8,0x0,![],null)[_0x5dac('0x15')](function(){return utils[_0x5dac('0x25')](_0x59d1d8);})[_0x5dac('0x15')](function(){return _0x1ddbf3(null,_0x59d1d8);});}else{return utils[_0x5dac('0x25')](_0x59d1d8)[_0x5dac('0x15')](function(){return _0x1ddbf3(null,_0x59d1d8);});}}else{return utils[_0x5dac('0x25')](_0x59d1d8)[_0x5dac('0x15')](function(){return _0x1ddbf3(null,_0x59d1d8);});}})[_0x5dac('0x26')](function(_0xd24521){return _0x1ddbf3(null,![],_0xd24521);});}function handleError(_0xacd19,_0x1b4e44,_0x1b0f9b){return _0xacd19[_0x5dac('0x27')](_0x1b4e44||0x1f4)['send']({'message':_0x1b0f9b?_0x1b0f9b[_0x5dac('0x28')]||_0x1b0f9b:''});}exports[_0x5dac('0x29')]=function(_0xb35ac7,_0x4f7317,_0x649ebe){passport['authenticate'](_0x5dac('0x2a'),function(_0x1d00af,_0x9bdf00,_0x355bef){var _0x39aa84=_0x1d00af||_0x355bef;if(_0x39aa84){return handleError(_0x4f7317,0x191,_0x39aa84);}if(!_0x9bdf00){return handleError(_0x4f7317,0x194,{'message':_0x5dac('0x2b')});}else{var _0x465906={'payload':{'id':_0x9bdf00['id'],'role':_0x9bdf00[_0x5dac('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x5dac('0x2c')](_0x465906)[_0x5dac('0x15')](function(_0xf1f7d4){_0x4f7317['json']({'id':_0x9bdf00['id'],'token':_0xf1f7d4,'statusCall':'','isAlreadyLogged':_0x9bdf00[_0x5dac('0x1d')]});});}})(_0xb35ac7,_0x4f7317,_0x649ebe);};passport[_0x5dac('0x2d')](_0x5dac('0x2a'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x49e07b,_0x5c2f9d,_0x5adb80){return ActiveDirectoryAuthenticate(db['User'],_0x49e07b,_0x5c2f9d,_0x5adb80);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index fe13be6..c2e7cfd 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 _0x663c=['post','exports','express','Router'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x663c,0x196));var _0xc663=function(_0x1e01ca,_0x14dc80){_0x1e01ca=_0x1e01ca-0x0;var _0x318e7f=_0x663c[_0x1e01ca];return _0x318e7f;};'use strict';var express=require(_0xc663('0x0'));var router=express[_0xc663('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0xc663('0x2')]('/',controller['login']);module[_0xc663('0x3')]=router;
\ No newline at end of file
+var _0xaca4=['exports','express','Router','./authActiveDirectory.controller','post','login'];(function(_0x4a3c92,_0x323bfc){var _0x47a918=function(_0x4b74a6){while(--_0x4b74a6){_0x4a3c92['push'](_0x4a3c92['shift']());}};_0x47a918(++_0x323bfc);}(_0xaca4,0xd9));var _0x4aca=function(_0x4c5202,_0x35c30f){_0x4c5202=_0x4c5202-0x0;var _0x38dd6b=_0xaca4[_0x4c5202];return _0x38dd6b;};'use strict';var express=require(_0x4aca('0x0'));var router=express[_0x4aca('0x1')]();var controller=require(_0x4aca('0x2'));router[_0x4aca('0x3')]('/',controller[_0x4aca('0x4')]);module[_0x4aca('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index c984ffc..a068811 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(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x7a54,0x106));var _0x47a5=function(_0x2554fb,_0x5b724a){_0x2554fb=_0x2554fb-0x0;var _0x1ffb55=_0x7a54[_0x2554fb];return _0x1ffb55;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x7a54,0x106));var _0x47a5=function(_0x2f4080,_0x34c89e){_0x2f4080=_0x2f4080-0x0;var _0x115391=_0x7a54[_0x2f4080];return _0x115391;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 583db8a..e69154f 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 _0x5e93=['../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5e93,0x174));var _0x35e9=function(_0x2b7c86,_0x3d3ab4){_0x2b7c86=_0x2b7c86-0x0;var _0x5d7cd3=_0x5e93[_0x2b7c86];return _0x5d7cd3;};'use strict';var express=require(_0x35e9('0x0'));var passport=require(_0x35e9('0x1'));var router=express[_0x35e9('0x2')]();var controller=require(_0x35e9('0x3'));var userController=require(_0x35e9('0x4'));var authService=require(_0x35e9('0x5'));router[_0x35e9('0x6')]('/',controller[_0x35e9('0x7')]);router[_0x35e9('0x6')](_0x35e9('0x8'),controller[_0x35e9('0x9')],authService[_0x35e9('0xa')],userController['login'],authService[_0x35e9('0xb')]);module[_0x35e9('0xc')]=router;
\ No newline at end of file
+var _0x47ac=['../../components/auth/service','get','login','exports','express','passport','Router','../user/user.controller.js'];(function(_0x2073f8,_0x34a29d){var _0x11c069=function(_0x1c49ab){while(--_0x1c49ab){_0x2073f8['push'](_0x2073f8['shift']());}};_0x11c069(++_0x34a29d);}(_0x47ac,0x14c));var _0xc47a=function(_0x2241db,_0x3c3572){_0x2241db=_0x2241db-0x0;var _0x36e3bd=_0x47ac[_0x2241db];return _0x36e3bd;};'use strict';var express=require(_0xc47a('0x0'));var passport=require(_0xc47a('0x1'));var router=express[_0xc47a('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xc47a('0x3'));var authService=require(_0xc47a('0x4'));router[_0xc47a('0x5')]('/',controller[_0xc47a('0x6')]);router['get']('/callback',controller['callback'],authService['isMiddleware'],userController[_0xc47a('0x6')],authService['setTokenCookie']);module[_0xc47a('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index f2b9f08..8e03942 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 _0xdd8c=['MailAccount','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','authenticate','local-login','json','forgot','Email\x20parameter\x20is\x20missing','generate','body','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','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','https://','headers','host','status','Reset\x20Email\x20sent!','reset','find','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','save','use','User','util','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../config/utils','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','getLicense','catch'];(function(_0x4cc13,_0x40f7a6){var _0x801be7=function(_0x103cda){while(--_0x103cda){_0x4cc13['push'](_0x4cc13['shift']());}};_0x801be7(++_0x40f7a6);}(_0xdd8c,0x7c));var _0xcdd8=function(_0x322dce,_0x2c374c){_0x322dce=_0x322dce-0x0;var _0x128e19=_0xdd8c[_0x322dce];return _0x128e19;};'use strict';var util=require(_0xcdd8('0x0'));var passport=require('passport');var LocalStrategy=require(_0xcdd8('0x1'))[_0xcdd8('0x2')];var jayson=require(_0xcdd8('0x3'));var _=require(_0xcdd8('0x4'));var rs=require('randomstring');var moment=require(_0xcdd8('0x5'));var db=require(_0xcdd8('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xcdd8('0x7'));var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x42daa6,_0xfefd03,_0x2c60bf,_0x556cad){var _0x540430,_0x40bfaf;return db[_0xcdd8('0x8')][_0xcdd8('0x9')]({'where':{'id':0x1},'attributes':[_0xcdd8('0xa'),_0xcdd8('0xb')],'raw':!![]})[_0xcdd8('0xc')](function(_0x386c9f){_0x540430=_0x386c9f;return _0x42daa6[_0xcdd8('0x9')]({'attributes':['id',_0xcdd8('0xd'),_0xcdd8('0xe'),_0xcdd8('0xf'),_0xcdd8('0x10'),_0xcdd8('0x11'),'blocked',_0xcdd8('0x12'),_0xcdd8('0x13')],'where':{'name':_0xfefd03,'role':{'$or':[_0xcdd8('0x14'),_0xcdd8('0x15'),_0xcdd8('0x16')]}}});})[_0xcdd8('0xc')](function(_0x4cac91){if(!_0x4cac91||_0x4cac91&&_0x4cac91['name']!==_0xfefd03){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x40bfaf=_0x4cac91;return _0x40bfaf;}})['then'](function(){_0x40bfaf['authenticate'](_0x2c60bf,function(_0x52de36,_0x3daf13){var _0x345042=_0x40bfaf[_0xcdd8('0x13')]+0x1;if(_0x52de36){return _0x556cad(_0x52de36);}else if(!_0x3daf13){if(_0x40bfaf[_0xcdd8('0x11')]){return _0x556cad(null,![],{'message':_0xcdd8('0x17')});}else if(_0x540430[_0xcdd8('0xa')]>0x0){if(_0x40bfaf[_0xcdd8('0x18')]){if(_0x540430['blockDuration']>0x0){if(moment(_0x40bfaf[_0xcdd8('0x12')])[_0xcdd8('0x19')](_0x540430['blockDuration'],_0xcdd8('0x1a'))>moment()){return _0x556cad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xcdd8('0x1b')](_0x40bfaf,_0x345042,![],null)[_0xcdd8('0xc')](function(){return _0x556cad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x556cad(null,![],{'message':_0xcdd8('0x17')});}}else{if(_0x345042>=_0x540430[_0xcdd8('0xa')]){return utils[_0xcdd8('0x1b')](_0x40bfaf,0x0,!![],moment())[_0xcdd8('0xc')](function(){return _0x556cad(null,![],{'message':_0xcdd8('0x17')});});}else{return utils[_0xcdd8('0x1b')](_0x40bfaf,_0x345042,![],null)[_0xcdd8('0xc')](function(){return _0x556cad(null,![],{'message':_0xcdd8('0x17')});});}}}else{return _0x556cad(null,![],{'message':_0xcdd8('0x17')});}}else{if(_0x40bfaf['disabled']){return _0x556cad(null,![],{'message':_0xcdd8('0x17')});}else if(_0x540430[_0xcdd8('0xa')]>0x0){if(_0x40bfaf['blocked']){if(_0x540430['blockDuration']>0x0){if(moment(_0x40bfaf[_0xcdd8('0x12')])[_0xcdd8('0x19')](_0x540430[_0xcdd8('0xb')],_0xcdd8('0x1a'))>moment()){return _0x556cad(null,![],{'message':_0xcdd8('0x17')});}else{return utils[_0xcdd8('0x1b')](_0x40bfaf,0x0,![],null)['then'](function(){return utils[_0xcdd8('0x1c')](_0x40bfaf);})[_0xcdd8('0xc')](function(){return _0x556cad(null,_0x40bfaf);});}}else{return _0x556cad(null,![],{'message':_0xcdd8('0x17')});}}else{return utils[_0xcdd8('0x1b')](_0x40bfaf,0x0,![],null)['then'](function(){return utils[_0xcdd8('0x1c')](_0x40bfaf);})['then'](function(){return _0x556cad(null,_0x40bfaf);})[_0xcdd8('0x1d')](function(_0x132600){return _0x556cad(null,![],_0x132600);});}}else{if(_0x40bfaf[_0xcdd8('0x18')]){return _0x556cad(null,![],{'message':_0xcdd8('0x17')});}else{return utils[_0xcdd8('0x1c')](_0x40bfaf)['then'](function(){return _0x556cad(null,_0x40bfaf);});}}}});})[_0xcdd8('0x1d')](function(_0x1e6f57){return _0x556cad(null,![],_0x1e6f57);});}function sendServiceMail(_0x3c628d){return db[_0xcdd8('0x1e')]['find']({'where':{'service':!![]},'attributes':['id',_0xcdd8('0xd'),_0xcdd8('0x1f')],'include':[{'model':db[_0xcdd8('0x20')],'as':_0xcdd8('0x21'),'include':[{'model':db[_0xcdd8('0x22')],'as':_0xcdd8('0x22')}]}]})[_0xcdd8('0xc')](function(_0x307bd2){if(!_0x307bd2){throw new Error(_0xcdd8('0x23'));}var _0x5aa256=_0x307bd2[_0xcdd8('0x24')]();var _0x188e8f={'account':_0x5aa256,'message':_['merge']({'from':util[_0xcdd8('0x25')]('\x22%s\x22\x20<%s>',_0x307bd2[_0xcdd8('0xd')],_0x307bd2[_0xcdd8('0x1f')]||_0x307bd2[_0xcdd8('0x21')][_0xcdd8('0x15')])},_0x3c628d)};return client[_0xcdd8('0x26')]('SendMail',_0x188e8f);})[_0xcdd8('0xc')](function(_0x2a63c0){if(_0x2a63c0[_0xcdd8('0x27')]){throw new Error(util['format'](_0xcdd8('0x28'),_0x2a63c0['error'][_0xcdd8('0x29')]||JSON[_0xcdd8('0x2a')](_0x2a63c0['error'])));}return!![];});}function handleError(_0x2c5350,_0x10543a,_0x1cab32){return _0x2c5350['status'](_0x10543a||0x1f4)[_0xcdd8('0x2b')]({'message':_0x1cab32?_0x1cab32[_0xcdd8('0x29')]||_0x1cab32:''});}exports[_0xcdd8('0x2c')]=function(_0x17dd7c,_0x3e0fb4,_0x593d3e){passport[_0xcdd8('0x2d')](_0xcdd8('0x2e'),function(_0x2fa6f8,_0x159af7,_0x1165d3){var _0x10bbbf=_0x2fa6f8||_0x1165d3;if(_0x10bbbf){return handleError(_0x3e0fb4,0x191,_0x10bbbf);}if(!_0x159af7){return handleError(_0x3e0fb4,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2cabb3={'payload':{'id':_0x159af7['id'],'role':_0x159af7['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2cabb3)['then'](function(_0x268e42){_0x3e0fb4[_0xcdd8('0x2f')]({'id':_0x159af7['id'],'token':_0x268e42,'statusCall':'','isAlreadyLogged':_0x159af7['online']});});}})(_0x17dd7c,_0x3e0fb4,_0x593d3e);};exports[_0xcdd8('0x30')]=function(_0x107203,_0x489aae){if(!_0x107203['body'][_0xcdd8('0x1f')]){return handleError(_0x489aae,0x1f4,{'message':_0xcdd8('0x31')});}var _0x57b0b0=rs[_0xcdd8('0x32')]();_0x107203[_0xcdd8('0x33')][_0xcdd8('0x1f')]=_0x107203['body'][_0xcdd8('0x1f')]['trim']()['toLowerCase']();var _0x363612;return db[_0xcdd8('0x8')][_0xcdd8('0x9')]({'where':{'id':0x1},'attributes':[_0xcdd8('0xa'),_0xcdd8('0xb')],'raw':!![]})[_0xcdd8('0xc')](function(_0x700487){_0x363612=_0x700487;return db['User']['find']({'where':{'email':_0x107203['body'][_0xcdd8('0x1f')]}});})[_0xcdd8('0xc')](function(_0x4c01fc){if(!_0x4c01fc){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x4c01fc[_0xcdd8('0x11')]){throw new Error(_0xcdd8('0x34'));}if(_0x4c01fc['blocked']){if(moment(_0x4c01fc[_0xcdd8('0x12')])[_0xcdd8('0x19')](_0x363612[_0xcdd8('0xb')],'minutes')>moment()){throw new Error(_0xcdd8('0x35'));}else{_0x4c01fc[_0xcdd8('0x18')]=![];_0x4c01fc[_0xcdd8('0x12')]=null;}}_0x4c01fc[_0xcdd8('0x36')]=_0x57b0b0;_0x4c01fc[_0xcdd8('0x37')]=Date['now']()+0x36ee80;return _0x4c01fc['save']();})[_0xcdd8('0xc')](function(){return sendServiceMail({'to':_0x107203[_0xcdd8('0x33')][_0xcdd8('0x1f')],'subject':_0xcdd8('0x38'),'text':_0xcdd8('0x39')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xcdd8('0x3a')+_0x107203[_0xcdd8('0x3b')][_0xcdd8('0x3c')]+'/reset/'+_0x57b0b0+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xcdd8('0xc')](function(){_0x489aae[_0xcdd8('0x3d')](0xc8)['send']({'message':_0xcdd8('0x3e')});})[_0xcdd8('0x1d')](function(_0x38f469){return handleError(_0x489aae,0x1f4,_0x38f469);});};exports[_0xcdd8('0x3f')]=function(_0x50f1a0,_0x22d7f0){return db['User'][_0xcdd8('0x40')]({'where':{'resetPasswordToken':_0x50f1a0[_0xcdd8('0x41')][_0xcdd8('0x42')],'resetPasswordExpires':{'$gt':Date[_0xcdd8('0x43')]()}}})[_0xcdd8('0xc')](function(_0x462473){if(!_0x462473){throw new Error(_0xcdd8('0x44'));}return db[_0xcdd8('0x8')][_0xcdd8('0x9')]({'attributes':['id',_0xcdd8('0x45'),_0xcdd8('0x46'),_0xcdd8('0x47')]})[_0xcdd8('0xc')](function(_0x4f4e07){if(_0x4f4e07['securePassword'])authService['validatePasswordPattern'](_0x50f1a0['body']['password']);if(!_0x4f4e07[_0xcdd8('0x46')]||!_0x462473[_0xcdd8('0x48')])return _0x462473;authService[_0xcdd8('0x49')](_0x50f1a0[_0xcdd8('0x33')][_0xcdd8('0xe')],_0x462473[_0xcdd8('0x48')],_0x4f4e07[_0xcdd8('0x47')]);return _0x462473;})['then'](function(){_0x462473[_0xcdd8('0xe')]=_0x50f1a0[_0xcdd8('0x33')][_0xcdd8('0xe')];_0x462473['resetPasswordToken']=null;_0x462473[_0xcdd8('0x37')]=null;return _0x462473[_0xcdd8('0x4a')]();});})[_0xcdd8('0xc')](function(){_0x22d7f0[_0xcdd8('0x3d')](0xc8)[_0xcdd8('0x2b')]({'message':'Password\x20reset!'});})['catch'](function(_0x4a6f8f){return handleError(_0x22d7f0,0x1f4,_0x4a6f8f);});};passport[_0xcdd8('0x4b')]('local-login',new LocalStrategy({'usernameField':_0xcdd8('0xd'),'passwordField':_0xcdd8('0xe')},function(_0x4f7810,_0x2233de,_0x5c33e2){return localAuthenticate(db[_0xcdd8('0x4c')],_0x4f7810,_0x2233de,_0x5c33e2);}));
\ No newline at end of file
+var _0xc48a=['\x22%s\x22\x20<%s>','SendMail','error','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','body','generate','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','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','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','validatePasswordPattern','previousPasswords','passwordHistoryLimit','Password\x20reset!','use','passport','passport-local','Strategy','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','name','password','salt','disabled','blockedAt','loginAttempts','user','agent','authenticate','blocked','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format'];(function(_0x309770,_0x32bd73){var _0x30c86b=function(_0x1adcf2){while(--_0x1adcf2){_0x309770['push'](_0x309770['shift']());}};_0x30c86b(++_0x32bd73);}(_0xc48a,0x74));var _0xac48=function(_0x7a7d01,_0x34253c){_0x7a7d01=_0x7a7d01-0x0;var _0x312c6c=_0xc48a[_0x7a7d01];return _0x312c6c;};'use strict';var util=require('util');var passport=require(_0xac48('0x0'));var LocalStrategy=require(_0xac48('0x1'))[_0xac48('0x2')];var jayson=require('jayson/promise');var _=require(_0xac48('0x3'));var rs=require('randomstring');var moment=require(_0xac48('0x4'));var db=require(_0xac48('0x5'))['db'];var authService=require(_0xac48('0x6'));var utils=require(_0xac48('0x7'));var client=jayson['client'][_0xac48('0x8')]({'port':0x232b});function localAuthenticate(_0x1b057a,_0x269c1c,_0x1f25ec,_0x403ed3){var _0x2fa728,_0x738b44;return db[_0xac48('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0xac48('0xa'),_0xac48('0xb')],'raw':!![]})[_0xac48('0xc')](function(_0x437ba3){_0x2fa728=_0x437ba3;return _0x1b057a[_0xac48('0xd')]({'attributes':['id',_0xac48('0xe'),_0xac48('0xf'),_0xac48('0x10'),'role',_0xac48('0x11'),'blocked',_0xac48('0x12'),_0xac48('0x13')],'where':{'name':_0x269c1c,'role':{'$or':['admin',_0xac48('0x14'),_0xac48('0x15')]}}});})[_0xac48('0xc')](function(_0x2bb0f3){if(!_0x2bb0f3||_0x2bb0f3&&_0x2bb0f3['name']!==_0x269c1c){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x738b44=_0x2bb0f3;return _0x738b44;}})['then'](function(){_0x738b44[_0xac48('0x16')](_0x1f25ec,function(_0x163979,_0x3ce77b){var _0x43a1fc=_0x738b44[_0xac48('0x13')]+0x1;if(_0x163979){return _0x403ed3(_0x163979);}else if(!_0x3ce77b){if(_0x738b44[_0xac48('0x11')]){return _0x403ed3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2fa728[_0xac48('0xa')]>0x0){if(_0x738b44[_0xac48('0x17')]){if(_0x2fa728[_0xac48('0xb')]>0x0){if(moment(_0x738b44['blockedAt'])[_0xac48('0x18')](_0x2fa728[_0xac48('0xb')],_0xac48('0x19'))>moment()){return _0x403ed3(null,![],{'message':_0xac48('0x1a')});}else{return utils['clearBlockUser'](_0x738b44,_0x43a1fc,![],null)[_0xac48('0xc')](function(){return _0x403ed3(null,![],{'message':_0xac48('0x1a')});});}}else{return _0x403ed3(null,![],{'message':_0xac48('0x1a')});}}else{if(_0x43a1fc>=_0x2fa728['allowedLoginAttempts']){return utils[_0xac48('0x1b')](_0x738b44,0x0,!![],moment())[_0xac48('0xc')](function(){return _0x403ed3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xac48('0x1b')](_0x738b44,_0x43a1fc,![],null)[_0xac48('0xc')](function(){return _0x403ed3(null,![],{'message':_0xac48('0x1a')});});}}}else{return _0x403ed3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x738b44['disabled']){return _0x403ed3(null,![],{'message':_0xac48('0x1a')});}else if(_0x2fa728['allowedLoginAttempts']>0x0){if(_0x738b44[_0xac48('0x17')]){if(_0x2fa728[_0xac48('0xb')]>0x0){if(moment(_0x738b44[_0xac48('0x12')])[_0xac48('0x18')](_0x2fa728[_0xac48('0xb')],_0xac48('0x19'))>moment()){return _0x403ed3(null,![],{'message':_0xac48('0x1a')});}else{return utils['clearBlockUser'](_0x738b44,0x0,![],null)['then'](function(){return utils[_0xac48('0x1c')](_0x738b44);})[_0xac48('0xc')](function(){return _0x403ed3(null,_0x738b44);});}}else{return _0x403ed3(null,![],{'message':_0xac48('0x1a')});}}else{return utils[_0xac48('0x1b')](_0x738b44,0x0,![],null)[_0xac48('0xc')](function(){return utils[_0xac48('0x1c')](_0x738b44);})[_0xac48('0xc')](function(){return _0x403ed3(null,_0x738b44);})['catch'](function(_0x2a0fb5){return _0x403ed3(null,![],_0x2a0fb5);});}}else{if(_0x738b44['blocked']){return _0x403ed3(null,![],{'message':_0xac48('0x1a')});}else{return utils[_0xac48('0x1c')](_0x738b44)[_0xac48('0xc')](function(){return _0x403ed3(null,_0x738b44);});}}}});})[_0xac48('0x1d')](function(_0x4218f6){return _0x403ed3(null,![],_0x4218f6);});}function sendServiceMail(_0x2c238a){return db['MailAccount'][_0xac48('0x1e')]({'where':{'service':!![]},'attributes':['id','name',_0xac48('0x1f')],'include':[{'model':db[_0xac48('0x20')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0xac48('0x21')}]}]})[_0xac48('0xc')](function(_0xb0b3f2){if(!_0xb0b3f2){throw new Error(_0xac48('0x22'));}var _0xb93397=_0xb0b3f2[_0xac48('0x23')]();var _0x2cdeb0={'account':_0xb93397,'message':_[_0xac48('0x24')]({'from':util[_0xac48('0x25')](_0xac48('0x26'),_0xb0b3f2['name'],_0xb0b3f2['email']||_0xb0b3f2['Smtp']['user'])},_0x2c238a)};return client['request'](_0xac48('0x27'),_0x2cdeb0);})[_0xac48('0xc')](function(_0x334dcf){if(_0x334dcf[_0xac48('0x28')]){throw new Error(util[_0xac48('0x25')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x334dcf['error'][_0xac48('0x29')]||JSON[_0xac48('0x2a')](_0x334dcf[_0xac48('0x28')])));}return!![];});}function handleError(_0x595555,_0x5c42c0,_0x4a3c2b){return _0x595555[_0xac48('0x2b')](_0x5c42c0||0x1f4)[_0xac48('0x2c')]({'message':_0x4a3c2b?_0x4a3c2b[_0xac48('0x29')]||_0x4a3c2b:''});}exports[_0xac48('0x2d')]=function(_0x1e6dd9,_0x328460,_0x2b040c){passport[_0xac48('0x16')](_0xac48('0x2e'),function(_0xa3731e,_0x148c61,_0x27f291){var _0x391084=_0xa3731e||_0x27f291;if(_0x391084){return handleError(_0x328460,0x191,_0x391084);}if(!_0x148c61){return handleError(_0x328460,0x194,{'message':_0xac48('0x2f')});}else{var _0xface0={'payload':{'id':_0x148c61['id'],'role':_0x148c61[_0xac48('0x30')]},'options':{'expiresIn':0x15180}};return authService[_0xac48('0x31')](_0xface0)[_0xac48('0xc')](function(_0x8f429a){_0x328460[_0xac48('0x32')]({'id':_0x148c61['id'],'token':_0x8f429a,'statusCall':'','isAlreadyLogged':_0x148c61[_0xac48('0x33')]});});}})(_0x1e6dd9,_0x328460,_0x2b040c);};exports['forgot']=function(_0x2e52fe,_0xd48eb7){if(!_0x2e52fe[_0xac48('0x34')]['email']){return handleError(_0xd48eb7,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x127343=rs[_0xac48('0x35')]();_0x2e52fe['body'][_0xac48('0x1f')]=_0x2e52fe[_0xac48('0x34')]['email'][_0xac48('0x36')]()[_0xac48('0x37')]();var _0x1cf5a0;return db[_0xac48('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0xac48('0xa'),_0xac48('0xb')],'raw':!![]})[_0xac48('0xc')](function(_0x49d203){_0x1cf5a0=_0x49d203;return db[_0xac48('0x38')][_0xac48('0x1e')]({'where':{'email':_0x2e52fe[_0xac48('0x34')][_0xac48('0x1f')]}});})['then'](function(_0x5a66f1){if(!_0x5a66f1){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x5a66f1['disabled']){throw new Error(_0xac48('0x39'));}if(_0x5a66f1[_0xac48('0x17')]){if(moment(_0x5a66f1[_0xac48('0x12')])['add'](_0x1cf5a0[_0xac48('0xb')],_0xac48('0x19'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x5a66f1[_0xac48('0x17')]=![];_0x5a66f1[_0xac48('0x12')]=null;}}_0x5a66f1[_0xac48('0x3a')]=_0x127343;_0x5a66f1[_0xac48('0x3b')]=Date['now']()+0x36ee80;return _0x5a66f1[_0xac48('0x3c')]();})[_0xac48('0xc')](function(){return sendServiceMail({'to':_0x2e52fe[_0xac48('0x34')]['email'],'subject':_0xac48('0x3d'),'text':_0xac48('0x3e')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xac48('0x3f')+_0x2e52fe[_0xac48('0x40')]['host']+'/reset/'+_0x127343+'\x0a\x0a'+_0xac48('0x41')});})[_0xac48('0xc')](function(){_0xd48eb7['status'](0xc8)[_0xac48('0x2c')]({'message':_0xac48('0x42')});})[_0xac48('0x1d')](function(_0x418d5c){return handleError(_0xd48eb7,0x1f4,_0x418d5c);});};exports[_0xac48('0x43')]=function(_0x289c27,_0x7a87a9){return db['User'][_0xac48('0x1e')]({'where':{'resetPasswordToken':_0x289c27['params'][_0xac48('0x44')],'resetPasswordExpires':{'$gt':Date[_0xac48('0x45')]()}}})[_0xac48('0xc')](function(_0x18f776){if(!_0x18f776){throw new Error(_0xac48('0x46'));}return db['Setting'][_0xac48('0xd')]({'attributes':['id','securePassword',_0xac48('0x47'),'passwordHistoryLimit']})['then'](function(_0x22cf09){if(_0x22cf09['securePassword'])authService[_0xac48('0x48')](_0x289c27[_0xac48('0x34')][_0xac48('0xf')]);if(!_0x22cf09[_0xac48('0x47')]||!_0x18f776[_0xac48('0x49')])return _0x18f776;authService['validatePasswordHistory'](_0x289c27['body']['password'],_0x18f776[_0xac48('0x49')],_0x22cf09[_0xac48('0x4a')]);return _0x18f776;})[_0xac48('0xc')](function(){_0x18f776[_0xac48('0xf')]=_0x289c27[_0xac48('0x34')][_0xac48('0xf')];_0x18f776[_0xac48('0x3a')]=null;_0x18f776[_0xac48('0x3b')]=null;return _0x18f776[_0xac48('0x3c')]();});})[_0xac48('0xc')](function(){_0x7a87a9[_0xac48('0x2b')](0xc8)[_0xac48('0x2c')]({'message':_0xac48('0x4b')});})[_0xac48('0x1d')](function(_0x454165){return handleError(_0x7a87a9,0x1f4,_0x454165);});};passport[_0xac48('0x4c')](_0xac48('0x2e'),new LocalStrategy({'usernameField':_0xac48('0xe'),'passwordField':'password'},function(_0x57626b,_0x1fd6b8,_0x34e7d7){return localAuthenticate(db[_0xac48('0x38')],_0x57626b,_0x1fd6b8,_0x34e7d7);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index e583f0a..402bc00 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 _0x2fed=['post','login','/forgot','/reset/:token','reset','exports','express','./authLocal.controller'];(function(_0x16065c,_0x4c193f){var _0x160c85=function(_0x389bc5){while(--_0x389bc5){_0x16065c['push'](_0x16065c['shift']());}};_0x160c85(++_0x4c193f);}(_0x2fed,0x7e));var _0xd2fe=function(_0x5bdc41,_0x4edf28){_0x5bdc41=_0x5bdc41-0x0;var _0x21b11e=_0x2fed[_0x5bdc41];return _0x21b11e;};'use strict';var express=require(_0xd2fe('0x0'));var router=express['Router']();var controller=require(_0xd2fe('0x1'));router[_0xd2fe('0x2')]('/',controller[_0xd2fe('0x3')]);router['post'](_0xd2fe('0x4'),controller['forgot']);router['post'](_0xd2fe('0x5'),controller[_0xd2fe('0x6')]);module[_0xd2fe('0x7')]=router;
\ No newline at end of file
+var _0x507b=['exports','Router','login','post','/forgot','forgot','/reset/:token','reset'];(function(_0x32b30c,_0x2d5ec8){var _0xcfc212=function(_0x42e668){while(--_0x42e668){_0x32b30c['push'](_0x32b30c['shift']());}};_0xcfc212(++_0x2d5ec8);}(_0x507b,0x1e1));var _0xb507=function(_0x58b812,_0x5ae1de){_0x58b812=_0x58b812-0x0;var _0x1f3712=_0x507b[_0x58b812];return _0x1f3712;};'use strict';var express=require('express');var router=express[_0xb507('0x0')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0xb507('0x1')]);router[_0xb507('0x2')](_0xb507('0x3'),controller[_0xb507('0x4')]);router[_0xb507('0x2')](_0xb507('0x5'),controller[_0xb507('0x6')]);module[_0xb507('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index bbd2904..e7e5d03 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 _0xf67f=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x12fbd3,_0x3912af){var _0x2a1f2e=function(_0x2790db){while(--_0x2790db){_0x12fbd3['push'](_0x12fbd3['shift']());}};_0x2a1f2e(++_0x3912af);}(_0xf67f,0x12a));var _0xff67=function(_0x591781,_0x8e0ed2){_0x591781=_0x591781-0x0;var _0x315bd9=_0xf67f[_0x591781];return _0x315bd9;};'use strict';var Sequelize=require(_0xff67('0x0'));module[_0xff67('0x1')]={'name':{'type':Sequelize[_0xff67('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xff67('0x2')]},'description':{'type':Sequelize[_0xff67('0x2')]},'status':{'type':Sequelize[_0xff67('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xff67('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x014b=['sequelize','STRING','INTEGER'];(function(_0x254abd,_0x1ab7f0){var _0x31bf1b=function(_0x447fd8){while(--_0x447fd8){_0x254abd['push'](_0x254abd['shift']());}};_0x31bf1b(++_0x1ab7f0);}(_0x014b,0x1bc));var _0xb014=function(_0x112198,_0x52c556){_0x112198=_0x112198-0x0;var _0x21b4b3=_0x014b[_0x112198];return _0x21b4b3;};'use strict';var Sequelize=require(_0xb014('0x0'));module['exports']={'name':{'type':Sequelize[_0xb014('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb014('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb014('0x2')],'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 e53603a..413548c 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 _0xc0e6=['Automation','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','Condition','addConditions','ids','getConditions','pick','addActions','Action','omit','getActions','findOne','order','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x4d32e9,_0x390d44){var _0x2d9ece=function(_0xabbd89){while(--_0xabbd89){_0x4d32e9['push'](_0x4d32e9['shift']());}};_0x2d9ece(++_0x390d44);}(_0xc0e6,0x7e));var _0x6c0e=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xc0e6[_0x4ae6ef];return _0x3cbb4e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c0e('0x0'));var zipdir=require(_0x6c0e('0x1'));var jsonpatch=require(_0x6c0e('0x2'));var rp=require(_0x6c0e('0x3'));var moment=require(_0x6c0e('0x4'));var BPromise=require(_0x6c0e('0x5'));var Mustache=require(_0x6c0e('0x6'));var util=require('util');var path=require(_0x6c0e('0x7'));var sox=require(_0x6c0e('0x8'));var csv=require(_0x6c0e('0x9'));var ejs=require(_0x6c0e('0xa'));var fs=require('fs');var fs_extra=require(_0x6c0e('0xb'));var _=require(_0x6c0e('0xc'));var squel=require(_0x6c0e('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6c0e('0xe'));var toCsv=require(_0x6c0e('0x9'));var querystring=require(_0x6c0e('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6c0e('0x10'));var qs=require(_0x6c0e('0x11'));var as=require(_0x6c0e('0x12'));var hardwareService=require(_0x6c0e('0x13'));var logger=require('../../config/logger')(_0x6c0e('0x14'));var utils=require('../../config/utils');var config=require(_0x6c0e('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e95ae,_0x5c79db){_0x5c79db=_0x5c79db||0xcc;return function(_0x1e8fb3){if(_0x1e8fb3){return _0x5e95ae[_0x6c0e('0x16')](_0x5c79db);}return _0x5e95ae['status'](_0x5c79db)[_0x6c0e('0x17')]();};}function respondWithResult(_0x1d5312,_0x4a9ad8){_0x4a9ad8=_0x4a9ad8||0xc8;return function(_0x3d5081){if(_0x3d5081){return _0x1d5312[_0x6c0e('0x18')](_0x4a9ad8)[_0x6c0e('0x19')](_0x3d5081);}};}function respondWithFilteredResult(_0x43bb26,_0x4567e2){return function(_0x2a740b){if(_0x2a740b){var _0x281621=typeof _0x4567e2[_0x6c0e('0x1a')]===_0x6c0e('0x1b')&&typeof _0x4567e2[_0x6c0e('0x1c')]===_0x6c0e('0x1b');var _0x972f3c=_0x2a740b['count'];var _0x28743b=_0x281621?0x0:_0x4567e2[_0x6c0e('0x1a')];var _0x32d8e7=_0x281621?_0x2a740b[_0x6c0e('0x1d')]:_0x4567e2[_0x6c0e('0x1a')]+_0x4567e2[_0x6c0e('0x1c')];var _0x277e2e;if(_0x32d8e7>=_0x972f3c){_0x32d8e7=_0x972f3c;_0x277e2e=0xc8;}else{_0x277e2e=0xce;}_0x43bb26[_0x6c0e('0x18')](_0x277e2e);return _0x43bb26[_0x6c0e('0x1e')](_0x6c0e('0x1f'),_0x28743b+'-'+_0x32d8e7+'/'+_0x972f3c)[_0x6c0e('0x19')](_0x2a740b);}return null;};}function patchUpdates(_0x23c307){return function(_0x389705){try{jsonpatch[_0x6c0e('0x20')](_0x389705,_0x23c307,!![]);}catch(_0x3ff3ba){return BPromise[_0x6c0e('0x21')](_0x3ff3ba);}return _0x389705[_0x6c0e('0x22')]();};}function saveUpdates(_0x4fb7b8,_0x5bbcf7){return function(_0x2f8e84){if(_0x2f8e84){return _0x2f8e84[_0x6c0e('0x23')](_0x4fb7b8)[_0x6c0e('0x24')](function(_0x7c6d0c){return _0x7c6d0c;});}return null;};}function removeEntity(_0x783771,_0x47e6f1){return function(_0x427951){if(_0x427951){return _0x427951[_0x6c0e('0x25')]()[_0x6c0e('0x24')](function(){_0x783771['status'](0xcc)[_0x6c0e('0x17')]();});}};}function handleEntityNotFound(_0x481284,_0x51ba92){return function(_0x1f502d){if(!_0x1f502d){_0x481284[_0x6c0e('0x16')](0x194);}return _0x1f502d;};}function handleError(_0x4c79ac,_0x2d718d){_0x2d718d=_0x2d718d||0x1f4;return function(_0x23c285){logger[_0x6c0e('0x26')](_0x23c285[_0x6c0e('0x27')]);if(_0x23c285[_0x6c0e('0x28')]){delete _0x23c285[_0x6c0e('0x28')];}_0x4c79ac[_0x6c0e('0x18')](_0x2d718d)[_0x6c0e('0x29')](_0x23c285);};}exports[_0x6c0e('0x2a')]=function(_0x37e7ae,_0x4bd1d7){var _0x9cbc32={},_0x18df2d={},_0x47810f={'count':0x0,'rows':[]};var _0x8b1eeb=_[_0x6c0e('0x2b')](db[_0x6c0e('0x2c')]['rawAttributes'],function(_0x5f43e0){return{'name':_0x5f43e0['fieldName'],'type':_0x5f43e0['type'][_0x6c0e('0x2d')]};});_0x18df2d[_0x6c0e('0x2e')]=_[_0x6c0e('0x2b')](_0x8b1eeb,_0x6c0e('0x28'));_0x18df2d[_0x6c0e('0x2f')]=_[_0x6c0e('0x30')](_0x37e7ae[_0x6c0e('0x2f')]);_0x18df2d['filters']=_[_0x6c0e('0x31')](_0x18df2d[_0x6c0e('0x2e')],_0x18df2d['query']);_0x9cbc32['attributes']=_[_0x6c0e('0x31')](_0x18df2d[_0x6c0e('0x2e')],qs[_0x6c0e('0x32')](_0x37e7ae[_0x6c0e('0x2f')][_0x6c0e('0x32')]));_0x9cbc32['attributes']=_0x9cbc32['attributes']['length']?_0x9cbc32[_0x6c0e('0x33')]:_0x18df2d[_0x6c0e('0x2e')];if(!_0x37e7ae['query'][_0x6c0e('0x34')](_0x6c0e('0x35'))){_0x9cbc32[_0x6c0e('0x1c')]=qs['limit'](_0x37e7ae[_0x6c0e('0x2f')]['limit']);_0x9cbc32['offset']=qs['offset'](_0x37e7ae['query'][_0x6c0e('0x1a')]);}_0x9cbc32['order']=qs[_0x6c0e('0x36')](_0x37e7ae['query'][_0x6c0e('0x36')]);_0x9cbc32[_0x6c0e('0x37')]=qs[_0x6c0e('0x38')](_['pick'](_0x37e7ae[_0x6c0e('0x2f')],_0x18df2d['filters']),_0x8b1eeb);if(_0x37e7ae[_0x6c0e('0x2f')][_0x6c0e('0x39')]){_0x9cbc32[_0x6c0e('0x37')]=_[_0x6c0e('0x3a')](_0x9cbc32[_0x6c0e('0x37')],{'$or':_['map'](_0x8b1eeb,function(_0x30177d){if(_0x30177d[_0x6c0e('0x3b')]!==_0x6c0e('0x3c')){var _0x3b5765={};_0x3b5765[_0x30177d[_0x6c0e('0x28')]]={'$like':'%'+_0x37e7ae['query'][_0x6c0e('0x39')]+'%'};return _0x3b5765;}})});}_0x9cbc32=_[_0x6c0e('0x3a')]({},_0x9cbc32,_0x37e7ae[_0x6c0e('0x3d')]);var _0x215b1a={'where':_0x9cbc32[_0x6c0e('0x37')]};return db[_0x6c0e('0x2c')]['count'](_0x215b1a)[_0x6c0e('0x24')](function(_0x5ab8b7){_0x47810f[_0x6c0e('0x1d')]=_0x5ab8b7;if(_0x37e7ae[_0x6c0e('0x2f')][_0x6c0e('0x3e')]){_0x9cbc32[_0x6c0e('0x3f')]=[{'all':!![]}];}return db['Automation'][_0x6c0e('0x40')](_0x9cbc32);})[_0x6c0e('0x24')](function(_0xa1e420){_0x47810f[_0x6c0e('0x41')]=_0xa1e420;return _0x47810f;})[_0x6c0e('0x24')](respondWithFilteredResult(_0x4bd1d7,_0x9cbc32))[_0x6c0e('0x42')](handleError(_0x4bd1d7,null));};exports[_0x6c0e('0x43')]=function(_0x19ebca,_0x264731){var _0x1811f2={'raw':![],'where':{'id':_0x19ebca[_0x6c0e('0x44')]['id']}},_0x5e4c14={};_0x5e4c14[_0x6c0e('0x2e')]=_[_0x6c0e('0x30')](db['Automation'][_0x6c0e('0x45')]);_0x5e4c14[_0x6c0e('0x2f')]=_['keys'](_0x19ebca[_0x6c0e('0x2f')]);_0x5e4c14[_0x6c0e('0x38')]=_[_0x6c0e('0x31')](_0x5e4c14[_0x6c0e('0x2e')],_0x5e4c14[_0x6c0e('0x2f')]);_0x1811f2[_0x6c0e('0x33')]=_['intersection'](_0x5e4c14['model'],qs[_0x6c0e('0x32')](_0x19ebca[_0x6c0e('0x2f')]['fields']));_0x1811f2['attributes']=_0x1811f2['attributes'][_0x6c0e('0x46')]?_0x1811f2[_0x6c0e('0x33')]:_0x5e4c14[_0x6c0e('0x2e')];if(_0x19ebca[_0x6c0e('0x2f')][_0x6c0e('0x3e')]){_0x1811f2[_0x6c0e('0x3f')]=[{'all':!![]}];}_0x1811f2=_[_0x6c0e('0x3a')]({},_0x1811f2,_0x19ebca['options']);return db[_0x6c0e('0x2c')][_0x6c0e('0x47')](_0x1811f2)[_0x6c0e('0x24')](handleEntityNotFound(_0x264731,null))[_0x6c0e('0x24')](respondWithResult(_0x264731,null))['catch'](handleError(_0x264731,null));};exports[_0x6c0e('0x48')]=function(_0x34c512,_0x51013f){return db[_0x6c0e('0x2c')]['create'](_0x34c512[_0x6c0e('0x49')],{})[_0x6c0e('0x24')](respondWithResult(_0x51013f,0xc9))[_0x6c0e('0x42')](handleError(_0x51013f,null));};exports[_0x6c0e('0x23')]=function(_0x19aa83,_0xd75110){if(_0x19aa83[_0x6c0e('0x49')]['id']){delete _0x19aa83[_0x6c0e('0x49')]['id'];}return db[_0x6c0e('0x2c')][_0x6c0e('0x47')]({'where':{'id':_0x19aa83['params']['id']}})[_0x6c0e('0x24')](handleEntityNotFound(_0xd75110,null))['then'](saveUpdates(_0x19aa83['body'],null))[_0x6c0e('0x24')](respondWithResult(_0xd75110,null))[_0x6c0e('0x42')](handleError(_0xd75110,null));};exports[_0x6c0e('0x25')]=function(_0xd49817,_0x4b9e95){return db['Automation'][_0x6c0e('0x47')]({'where':{'id':_0xd49817['params']['id']}})[_0x6c0e('0x24')](handleEntityNotFound(_0x4b9e95,null))[_0x6c0e('0x24')](removeEntity(_0x4b9e95,null))[_0x6c0e('0x42')](handleError(_0x4b9e95,null));};exports['addConditions']=function(_0x533716,_0x2f5ba2,_0x420e5e){return db[_0x6c0e('0x4a')][_0x6c0e('0x47')]({'where':{'id':_0x533716[_0x6c0e('0x44')]['id']}})['then'](handleEntityNotFound(_0x2f5ba2,null))[_0x6c0e('0x24')](function(_0x47fd49){if(_0x47fd49){return _0x47fd49[_0x6c0e('0x4b')](_0x533716[_0x6c0e('0x49')][_0x6c0e('0x4c')],_['omit'](_0x533716['body'],['ids','id'])||{});}})[_0x6c0e('0x24')](respondWithResult(_0x2f5ba2,null))[_0x6c0e('0x42')](handleError(_0x2f5ba2,null));};exports[_0x6c0e('0x4d')]=function(_0x3adec7,_0x43c54b,_0x26b2bc){var _0x10322e={};var _0x18234e={};var _0x54a51b;var _0x2298ab;return db[_0x6c0e('0x2c')]['findOne']({'where':{'id':_0x3adec7[_0x6c0e('0x44')]['id']}})['then'](handleEntityNotFound(_0x43c54b,null))[_0x6c0e('0x24')](function(_0x72fd59){if(_0x72fd59){_0x54a51b=_0x72fd59;_0x18234e['model']=_[_0x6c0e('0x30')](db[_0x6c0e('0x4a')][_0x6c0e('0x45')]);_0x18234e[_0x6c0e('0x2f')]=_[_0x6c0e('0x30')](_0x3adec7[_0x6c0e('0x2f')]);_0x18234e[_0x6c0e('0x38')]=_[_0x6c0e('0x31')](_0x18234e[_0x6c0e('0x2e')],_0x18234e['query']);_0x10322e['attributes']=_[_0x6c0e('0x31')](_0x18234e[_0x6c0e('0x2e')],qs[_0x6c0e('0x32')](_0x3adec7[_0x6c0e('0x2f')]['fields']));_0x10322e['attributes']=_0x10322e[_0x6c0e('0x33')][_0x6c0e('0x46')]?_0x10322e['attributes']:_0x18234e[_0x6c0e('0x2e')];_0x10322e['order']=qs[_0x6c0e('0x36')](_0x3adec7[_0x6c0e('0x2f')][_0x6c0e('0x36')]);_0x10322e['where']=qs[_0x6c0e('0x38')](_[_0x6c0e('0x4e')](_0x3adec7[_0x6c0e('0x2f')],_0x18234e['filters']));if(_0x3adec7[_0x6c0e('0x2f')][_0x6c0e('0x39')]){_0x10322e[_0x6c0e('0x37')]=_['merge'](_0x10322e[_0x6c0e('0x37')],{'$or':_[_0x6c0e('0x2b')](_0x10322e[_0x6c0e('0x33')],function(_0x168c08){var _0xfdb304={};_0xfdb304[_0x168c08]={'$like':'%'+_0x3adec7[_0x6c0e('0x2f')][_0x6c0e('0x39')]+'%'};return _0xfdb304;})});}_0x10322e=_['merge']({},_0x10322e,_0x3adec7[_0x6c0e('0x3d')]);return _0x54a51b['getConditions'](_0x10322e);}})[_0x6c0e('0x24')](function(_0x15c8fe){if(_0x15c8fe){_0x2298ab=_0x15c8fe[_0x6c0e('0x46')];if(!_0x3adec7[_0x6c0e('0x2f')]['hasOwnProperty']('nolimit')){_0x10322e['limit']=qs[_0x6c0e('0x1c')](_0x3adec7[_0x6c0e('0x2f')][_0x6c0e('0x1c')]);_0x10322e[_0x6c0e('0x1a')]=qs['offset'](_0x3adec7[_0x6c0e('0x2f')][_0x6c0e('0x1a')]);}return _0x54a51b[_0x6c0e('0x4d')](_0x10322e);}})[_0x6c0e('0x24')](function(_0xbb3e27){if(_0xbb3e27){return _0xbb3e27?{'count':_0x2298ab,'rows':_0xbb3e27}:null;}})[_0x6c0e('0x24')](respondWithResult(_0x43c54b,null))[_0x6c0e('0x42')](handleError(_0x43c54b,null));};exports[_0x6c0e('0x4f')]=function(_0x20c0a6,_0x100b7d,_0x4df92a){return db[_0x6c0e('0x50')][_0x6c0e('0x47')]({'where':{'id':_0x20c0a6[_0x6c0e('0x44')]['id']}})['then'](handleEntityNotFound(_0x100b7d,null))[_0x6c0e('0x24')](function(_0xea7683){if(_0xea7683){return _0xea7683[_0x6c0e('0x4f')](_0x20c0a6['body'][_0x6c0e('0x4c')],_[_0x6c0e('0x51')](_0x20c0a6[_0x6c0e('0x49')],['ids','id'])||{});}})[_0x6c0e('0x24')](respondWithResult(_0x100b7d,null))[_0x6c0e('0x42')](handleError(_0x100b7d,null));};exports[_0x6c0e('0x52')]=function(_0x509f19,_0xd608f8,_0x5ae1f6){var _0x339f5a={};var _0x3387c8={};var _0x54506b;var _0x1eb110;return db[_0x6c0e('0x2c')][_0x6c0e('0x53')]({'where':{'id':_0x509f19['params']['id']}})[_0x6c0e('0x24')](handleEntityNotFound(_0xd608f8,null))[_0x6c0e('0x24')](function(_0x3bd870){if(_0x3bd870){_0x54506b=_0x3bd870;_0x3387c8[_0x6c0e('0x2e')]=_[_0x6c0e('0x30')](db[_0x6c0e('0x50')][_0x6c0e('0x45')]);_0x3387c8[_0x6c0e('0x2f')]=_[_0x6c0e('0x30')](_0x509f19[_0x6c0e('0x2f')]);_0x3387c8[_0x6c0e('0x38')]=_[_0x6c0e('0x31')](_0x3387c8[_0x6c0e('0x2e')],_0x3387c8['query']);_0x339f5a[_0x6c0e('0x33')]=_[_0x6c0e('0x31')](_0x3387c8['model'],qs['fields'](_0x509f19[_0x6c0e('0x2f')][_0x6c0e('0x32')]));_0x339f5a['attributes']=_0x339f5a[_0x6c0e('0x33')][_0x6c0e('0x46')]?_0x339f5a['attributes']:_0x3387c8[_0x6c0e('0x2e')];_0x339f5a[_0x6c0e('0x54')]=qs[_0x6c0e('0x36')](_0x509f19[_0x6c0e('0x2f')][_0x6c0e('0x36')]);_0x339f5a[_0x6c0e('0x37')]=qs[_0x6c0e('0x38')](_[_0x6c0e('0x4e')](_0x509f19['query'],_0x3387c8[_0x6c0e('0x38')]));if(_0x509f19[_0x6c0e('0x2f')][_0x6c0e('0x39')]){_0x339f5a[_0x6c0e('0x37')]=_[_0x6c0e('0x3a')](_0x339f5a[_0x6c0e('0x37')],{'$or':_['map'](_0x339f5a[_0x6c0e('0x33')],function(_0x341a3d){var _0x44aa2e={};_0x44aa2e[_0x341a3d]={'$like':'%'+_0x509f19['query']['filter']+'%'};return _0x44aa2e;})});}_0x339f5a=_[_0x6c0e('0x3a')]({},_0x339f5a,_0x509f19[_0x6c0e('0x3d')]);return _0x54506b['getActions'](_0x339f5a);}})[_0x6c0e('0x24')](function(_0x1bbe65){if(_0x1bbe65){_0x1eb110=_0x1bbe65[_0x6c0e('0x46')];if(!_0x509f19[_0x6c0e('0x2f')][_0x6c0e('0x34')]('nolimit')){_0x339f5a[_0x6c0e('0x1c')]=qs[_0x6c0e('0x1c')](_0x509f19[_0x6c0e('0x2f')]['limit']);_0x339f5a['offset']=qs[_0x6c0e('0x1a')](_0x509f19[_0x6c0e('0x2f')][_0x6c0e('0x1a')]);}return _0x54506b[_0x6c0e('0x52')](_0x339f5a);}})[_0x6c0e('0x24')](function(_0x5975bb){if(_0x5975bb){return _0x5975bb?{'count':_0x1eb110,'rows':_0x5975bb}:null;}})[_0x6c0e('0x24')](respondWithResult(_0xd608f8,null))[_0x6c0e('0x42')](handleError(_0xd608f8,null));};
\ No newline at end of file
+var _0x12f2=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','Automation','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','include','rows','catch','params','rawAttributes','includeAll','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','order','pick','addActions','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2bb82d,_0x42c7f8){var _0x5e0b92=function(_0x19f44b){while(--_0x19f44b){_0x2bb82d['push'](_0x2bb82d['shift']());}};_0x5e0b92(++_0x42c7f8);}(_0x12f2,0x1d9));var _0x212f=function(_0x3d6445,_0x5cf50c){_0x3d6445=_0x3d6445-0x0;var _0xc0b055=_0x12f2[_0x3d6445];return _0xc0b055;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x212f('0x0'));var zipdir=require(_0x212f('0x1'));var jsonpatch=require(_0x212f('0x2'));var rp=require(_0x212f('0x3'));var moment=require(_0x212f('0x4'));var BPromise=require(_0x212f('0x5'));var Mustache=require(_0x212f('0x6'));var util=require(_0x212f('0x7'));var path=require('path');var sox=require(_0x212f('0x8'));var csv=require(_0x212f('0x9'));var ejs=require(_0x212f('0xa'));var fs=require('fs');var fs_extra=require(_0x212f('0xb'));var _=require('lodash');var squel=require(_0x212f('0xc'));var crypto=require('crypto');var jsforce=require(_0x212f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x212f('0x9'));var querystring=require(_0x212f('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x212f('0xf'));var qs=require(_0x212f('0x10'));var as=require(_0x212f('0x11'));var hardwareService=require(_0x212f('0x12'));var logger=require('../../config/logger')(_0x212f('0x13'));var utils=require(_0x212f('0x14'));var config=require(_0x212f('0x15'));var licenseUtil=require(_0x212f('0x16'));var db=require(_0x212f('0x17'))['db'];function respondWithStatusCode(_0x30b87a,_0xdefc76){_0xdefc76=_0xdefc76||0xcc;return function(_0x3f4e7c){if(_0x3f4e7c){return _0x30b87a[_0x212f('0x18')](_0xdefc76);}return _0x30b87a[_0x212f('0x19')](_0xdefc76)[_0x212f('0x1a')]();};}function respondWithResult(_0x351e91,_0x4b2927){_0x4b2927=_0x4b2927||0xc8;return function(_0x6a42e6){if(_0x6a42e6){return _0x351e91[_0x212f('0x19')](_0x4b2927)['json'](_0x6a42e6);}};}function respondWithFilteredResult(_0x4971c4,_0x3cd68e){return function(_0x4cee11){if(_0x4cee11){var _0x109c21=typeof _0x3cd68e['offset']===_0x212f('0x1b')&&typeof _0x3cd68e[_0x212f('0x1c')]===_0x212f('0x1b');var _0x18055d=_0x4cee11['count'];var _0x554166=_0x109c21?0x0:_0x3cd68e[_0x212f('0x1d')];var _0x3c9490=_0x109c21?_0x4cee11[_0x212f('0x1e')]:_0x3cd68e['offset']+_0x3cd68e['limit'];var _0x1c3ab6;if(_0x3c9490>=_0x18055d){_0x3c9490=_0x18055d;_0x1c3ab6=0xc8;}else{_0x1c3ab6=0xce;}_0x4971c4[_0x212f('0x19')](_0x1c3ab6);return _0x4971c4['set'](_0x212f('0x1f'),_0x554166+'-'+_0x3c9490+'/'+_0x18055d)['json'](_0x4cee11);}return null;};}function patchUpdates(_0x3e4b66){return function(_0x158cf4){try{jsonpatch[_0x212f('0x20')](_0x158cf4,_0x3e4b66,!![]);}catch(_0x2318dc){return BPromise[_0x212f('0x21')](_0x2318dc);}return _0x158cf4[_0x212f('0x22')]();};}function saveUpdates(_0x18d5d8,_0x45a8d2){return function(_0x2ee3e2){if(_0x2ee3e2){return _0x2ee3e2[_0x212f('0x23')](_0x18d5d8)[_0x212f('0x24')](function(_0x6e121c){return _0x6e121c;});}return null;};}function removeEntity(_0x23f914,_0x4307ce){return function(_0x5509df){if(_0x5509df){return _0x5509df[_0x212f('0x25')]()[_0x212f('0x24')](function(){_0x23f914[_0x212f('0x19')](0xcc)[_0x212f('0x1a')]();});}};}function handleEntityNotFound(_0x406c87,_0x2b861e){return function(_0x458890){if(!_0x458890){_0x406c87['sendStatus'](0x194);}return _0x458890;};}function handleError(_0x5096af,_0x364784){_0x364784=_0x364784||0x1f4;return function(_0x55c329){logger['error'](_0x55c329[_0x212f('0x26')]);if(_0x55c329[_0x212f('0x27')]){delete _0x55c329['name'];}_0x5096af['status'](_0x364784)['send'](_0x55c329);};}exports[_0x212f('0x28')]=function(_0x222afe,_0x39435c){var _0x4e7424={},_0x576692={},_0x504c44={'count':0x0,'rows':[]};var _0x46e6bd=_[_0x212f('0x29')](db[_0x212f('0x2a')]['rawAttributes'],function(_0x593eca){return{'name':_0x593eca[_0x212f('0x2b')],'type':_0x593eca[_0x212f('0x2c')][_0x212f('0x2d')]};});_0x576692[_0x212f('0x2e')]=_[_0x212f('0x29')](_0x46e6bd,'name');_0x576692[_0x212f('0x2f')]=_[_0x212f('0x30')](_0x222afe['query']);_0x576692['filters']=_[_0x212f('0x31')](_0x576692[_0x212f('0x2e')],_0x576692[_0x212f('0x2f')]);_0x4e7424[_0x212f('0x32')]=_['intersection'](_0x576692[_0x212f('0x2e')],qs[_0x212f('0x33')](_0x222afe[_0x212f('0x2f')][_0x212f('0x33')]));_0x4e7424['attributes']=_0x4e7424[_0x212f('0x32')][_0x212f('0x34')]?_0x4e7424[_0x212f('0x32')]:_0x576692[_0x212f('0x2e')];if(!_0x222afe[_0x212f('0x2f')][_0x212f('0x35')](_0x212f('0x36'))){_0x4e7424[_0x212f('0x1c')]=qs[_0x212f('0x1c')](_0x222afe[_0x212f('0x2f')][_0x212f('0x1c')]);_0x4e7424[_0x212f('0x1d')]=qs[_0x212f('0x1d')](_0x222afe['query'][_0x212f('0x1d')]);}_0x4e7424['order']=qs[_0x212f('0x37')](_0x222afe[_0x212f('0x2f')]['sort']);_0x4e7424[_0x212f('0x38')]=qs[_0x212f('0x39')](_['pick'](_0x222afe['query'],_0x576692[_0x212f('0x39')]),_0x46e6bd);if(_0x222afe['query'][_0x212f('0x3a')]){_0x4e7424['where']=_[_0x212f('0x3b')](_0x4e7424[_0x212f('0x38')],{'$or':_[_0x212f('0x29')](_0x46e6bd,function(_0x3ae2e1){if(_0x3ae2e1[_0x212f('0x2c')]!==_0x212f('0x3c')){var _0x13308e={};_0x13308e[_0x3ae2e1[_0x212f('0x27')]]={'$like':'%'+_0x222afe[_0x212f('0x2f')][_0x212f('0x3a')]+'%'};return _0x13308e;}})});}_0x4e7424=_['merge']({},_0x4e7424,_0x222afe[_0x212f('0x3d')]);var _0x42c9df={'where':_0x4e7424[_0x212f('0x38')]};return db[_0x212f('0x2a')][_0x212f('0x1e')](_0x42c9df)['then'](function(_0x3a880d){_0x504c44[_0x212f('0x1e')]=_0x3a880d;if(_0x222afe['query']['includeAll']){_0x4e7424[_0x212f('0x3e')]=[{'all':!![]}];}return db[_0x212f('0x2a')]['findAll'](_0x4e7424);})['then'](function(_0x4b9605){_0x504c44[_0x212f('0x3f')]=_0x4b9605;return _0x504c44;})['then'](respondWithFilteredResult(_0x39435c,_0x4e7424))[_0x212f('0x40')](handleError(_0x39435c,null));};exports['show']=function(_0x3a1847,_0x116348){var _0xefdd3e={'raw':![],'where':{'id':_0x3a1847[_0x212f('0x41')]['id']}},_0xa4d9ee={};_0xa4d9ee['model']=_['keys'](db[_0x212f('0x2a')][_0x212f('0x42')]);_0xa4d9ee['query']=_[_0x212f('0x30')](_0x3a1847[_0x212f('0x2f')]);_0xa4d9ee['filters']=_[_0x212f('0x31')](_0xa4d9ee[_0x212f('0x2e')],_0xa4d9ee['query']);_0xefdd3e[_0x212f('0x32')]=_[_0x212f('0x31')](_0xa4d9ee[_0x212f('0x2e')],qs[_0x212f('0x33')](_0x3a1847[_0x212f('0x2f')][_0x212f('0x33')]));_0xefdd3e[_0x212f('0x32')]=_0xefdd3e['attributes']['length']?_0xefdd3e[_0x212f('0x32')]:_0xa4d9ee[_0x212f('0x2e')];if(_0x3a1847[_0x212f('0x2f')][_0x212f('0x43')]){_0xefdd3e[_0x212f('0x3e')]=[{'all':!![]}];}_0xefdd3e=_[_0x212f('0x3b')]({},_0xefdd3e,_0x3a1847['options']);return db[_0x212f('0x2a')][_0x212f('0x44')](_0xefdd3e)['then'](handleEntityNotFound(_0x116348,null))[_0x212f('0x24')](respondWithResult(_0x116348,null))[_0x212f('0x40')](handleError(_0x116348,null));};exports[_0x212f('0x45')]=function(_0x3af176,_0x3af307){return db[_0x212f('0x2a')][_0x212f('0x45')](_0x3af176['body'],{})[_0x212f('0x24')](respondWithResult(_0x3af307,0xc9))['catch'](handleError(_0x3af307,null));};exports['update']=function(_0x5dc8c1,_0x4bc226){if(_0x5dc8c1[_0x212f('0x46')]['id']){delete _0x5dc8c1[_0x212f('0x46')]['id'];}return db['Automation'][_0x212f('0x44')]({'where':{'id':_0x5dc8c1[_0x212f('0x41')]['id']}})[_0x212f('0x24')](handleEntityNotFound(_0x4bc226,null))['then'](saveUpdates(_0x5dc8c1[_0x212f('0x46')],null))[_0x212f('0x24')](respondWithResult(_0x4bc226,null))[_0x212f('0x40')](handleError(_0x4bc226,null));};exports[_0x212f('0x25')]=function(_0x3b783b,_0x1c14e7){return db['Automation'][_0x212f('0x44')]({'where':{'id':_0x3b783b['params']['id']}})['then'](handleEntityNotFound(_0x1c14e7,null))[_0x212f('0x24')](removeEntity(_0x1c14e7,null))[_0x212f('0x40')](handleError(_0x1c14e7,null));};exports[_0x212f('0x47')]=function(_0x590dcd,_0x4ff867,_0x5b5721){return db[_0x212f('0x48')]['find']({'where':{'id':_0x590dcd['params']['id']}})['then'](handleEntityNotFound(_0x4ff867,null))[_0x212f('0x24')](function(_0x136e47){if(_0x136e47){return _0x136e47[_0x212f('0x47')](_0x590dcd['body'][_0x212f('0x49')],_[_0x212f('0x4a')](_0x590dcd[_0x212f('0x46')],[_0x212f('0x49'),'id'])||{});}})[_0x212f('0x24')](respondWithResult(_0x4ff867,null))[_0x212f('0x40')](handleError(_0x4ff867,null));};exports[_0x212f('0x4b')]=function(_0x1a953c,_0x558131,_0x3f5aa5){var _0x5288b3={};var _0x1da500={};var _0x54ed0f;var _0x1fc494;return db[_0x212f('0x2a')][_0x212f('0x4c')]({'where':{'id':_0x1a953c[_0x212f('0x41')]['id']}})[_0x212f('0x24')](handleEntityNotFound(_0x558131,null))[_0x212f('0x24')](function(_0x46015e){if(_0x46015e){_0x54ed0f=_0x46015e;_0x1da500[_0x212f('0x2e')]=_[_0x212f('0x30')](db[_0x212f('0x48')]['rawAttributes']);_0x1da500[_0x212f('0x2f')]=_[_0x212f('0x30')](_0x1a953c[_0x212f('0x2f')]);_0x1da500[_0x212f('0x39')]=_[_0x212f('0x31')](_0x1da500[_0x212f('0x2e')],_0x1da500[_0x212f('0x2f')]);_0x5288b3['attributes']=_[_0x212f('0x31')](_0x1da500[_0x212f('0x2e')],qs['fields'](_0x1a953c[_0x212f('0x2f')][_0x212f('0x33')]));_0x5288b3['attributes']=_0x5288b3[_0x212f('0x32')]['length']?_0x5288b3['attributes']:_0x1da500['model'];_0x5288b3[_0x212f('0x4d')]=qs[_0x212f('0x37')](_0x1a953c['query']['sort']);_0x5288b3[_0x212f('0x38')]=qs[_0x212f('0x39')](_[_0x212f('0x4e')](_0x1a953c[_0x212f('0x2f')],_0x1da500[_0x212f('0x39')]));if(_0x1a953c['query'][_0x212f('0x3a')]){_0x5288b3[_0x212f('0x38')]=_[_0x212f('0x3b')](_0x5288b3[_0x212f('0x38')],{'$or':_[_0x212f('0x29')](_0x5288b3[_0x212f('0x32')],function(_0xf4a5c8){var _0x44fdbb={};_0x44fdbb[_0xf4a5c8]={'$like':'%'+_0x1a953c[_0x212f('0x2f')][_0x212f('0x3a')]+'%'};return _0x44fdbb;})});}_0x5288b3=_[_0x212f('0x3b')]({},_0x5288b3,_0x1a953c[_0x212f('0x3d')]);return _0x54ed0f['getConditions'](_0x5288b3);}})['then'](function(_0x27b711){if(_0x27b711){_0x1fc494=_0x27b711[_0x212f('0x34')];if(!_0x1a953c[_0x212f('0x2f')]['hasOwnProperty'](_0x212f('0x36'))){_0x5288b3['limit']=qs[_0x212f('0x1c')](_0x1a953c['query'][_0x212f('0x1c')]);_0x5288b3[_0x212f('0x1d')]=qs[_0x212f('0x1d')](_0x1a953c[_0x212f('0x2f')][_0x212f('0x1d')]);}return _0x54ed0f[_0x212f('0x4b')](_0x5288b3);}})[_0x212f('0x24')](function(_0x50eb17){if(_0x50eb17){return _0x50eb17?{'count':_0x1fc494,'rows':_0x50eb17}:null;}})[_0x212f('0x24')](respondWithResult(_0x558131,null))[_0x212f('0x40')](handleError(_0x558131,null));};exports[_0x212f('0x4f')]=function(_0x24676a,_0x5ee4bc,_0x4244fe){return db[_0x212f('0x50')][_0x212f('0x44')]({'where':{'id':_0x24676a[_0x212f('0x41')]['id']}})[_0x212f('0x24')](handleEntityNotFound(_0x5ee4bc,null))['then'](function(_0x4e22c5){if(_0x4e22c5){return _0x4e22c5['addActions'](_0x24676a[_0x212f('0x46')][_0x212f('0x49')],_[_0x212f('0x4a')](_0x24676a[_0x212f('0x46')],[_0x212f('0x49'),'id'])||{});}})[_0x212f('0x24')](respondWithResult(_0x5ee4bc,null))[_0x212f('0x40')](handleError(_0x5ee4bc,null));};exports[_0x212f('0x51')]=function(_0x2198e1,_0x499c9b,_0x4f602d){var _0x4a73f4={};var _0x30e5d4={};var _0x4a8dd8;var _0xd81b92;return db[_0x212f('0x2a')]['findOne']({'where':{'id':_0x2198e1['params']['id']}})['then'](handleEntityNotFound(_0x499c9b,null))[_0x212f('0x24')](function(_0x520371){if(_0x520371){_0x4a8dd8=_0x520371;_0x30e5d4[_0x212f('0x2e')]=_['keys'](db['Action']['rawAttributes']);_0x30e5d4[_0x212f('0x2f')]=_[_0x212f('0x30')](_0x2198e1[_0x212f('0x2f')]);_0x30e5d4[_0x212f('0x39')]=_[_0x212f('0x31')](_0x30e5d4[_0x212f('0x2e')],_0x30e5d4[_0x212f('0x2f')]);_0x4a73f4[_0x212f('0x32')]=_[_0x212f('0x31')](_0x30e5d4['model'],qs[_0x212f('0x33')](_0x2198e1[_0x212f('0x2f')][_0x212f('0x33')]));_0x4a73f4['attributes']=_0x4a73f4[_0x212f('0x32')]['length']?_0x4a73f4[_0x212f('0x32')]:_0x30e5d4['model'];_0x4a73f4[_0x212f('0x4d')]=qs[_0x212f('0x37')](_0x2198e1['query'][_0x212f('0x37')]);_0x4a73f4['where']=qs[_0x212f('0x39')](_['pick'](_0x2198e1[_0x212f('0x2f')],_0x30e5d4[_0x212f('0x39')]));if(_0x2198e1['query'][_0x212f('0x3a')]){_0x4a73f4['where']=_[_0x212f('0x3b')](_0x4a73f4[_0x212f('0x38')],{'$or':_[_0x212f('0x29')](_0x4a73f4[_0x212f('0x32')],function(_0x14131c){var _0xf8cb89={};_0xf8cb89[_0x14131c]={'$like':'%'+_0x2198e1['query'][_0x212f('0x3a')]+'%'};return _0xf8cb89;})});}_0x4a73f4=_[_0x212f('0x3b')]({},_0x4a73f4,_0x2198e1[_0x212f('0x3d')]);return _0x4a8dd8[_0x212f('0x51')](_0x4a73f4);}})[_0x212f('0x24')](function(_0x1ef78a){if(_0x1ef78a){_0xd81b92=_0x1ef78a[_0x212f('0x34')];if(!_0x2198e1[_0x212f('0x2f')][_0x212f('0x35')](_0x212f('0x36'))){_0x4a73f4['limit']=qs[_0x212f('0x1c')](_0x2198e1[_0x212f('0x2f')]['limit']);_0x4a73f4[_0x212f('0x1d')]=qs[_0x212f('0x1d')](_0x2198e1['query'][_0x212f('0x1d')]);}return _0x4a8dd8[_0x212f('0x51')](_0x4a73f4);}})[_0x212f('0x24')](function(_0xcb85c1){if(_0xcb85c1){return _0xcb85c1?{'count':_0xd81b92,'rows':_0xcb85c1}:null;}})[_0x212f('0x24')](respondWithResult(_0x499c9b,null))['catch'](handleError(_0x499c9b,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 07e32bf..5674483 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 _0xb7b6=['path','rimraf','./automation.attributes','exports','define','Automation','tools_automations','api','moment','bluebird'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xb7b6,0x89));var _0x6b7b=function(_0x2f4385,_0x1505d0){_0x2f4385=_0x2f4385-0x0;var _0x1f4fbe=_0xb7b6[_0x2f4385];return _0x1f4fbe;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x6b7b('0x0'));var moment=require(_0x6b7b('0x1'));var BPromise=require(_0x6b7b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b7b('0x3'));var rimraf=require(_0x6b7b('0x4'));var config=require('../../config/environment');var attributes=require(_0x6b7b('0x5'));module[_0x6b7b('0x6')]=function(_0xb58fca,_0x5d9933){return _0xb58fca[_0x6b7b('0x7')](_0x6b7b('0x8'),attributes,{'tableName':_0x6b7b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6375=['request-promise','rimraf','../../config/environment','exports','Automation','tools_automations','util','../../config/logger'];(function(_0xf22003,_0x4daaad){var _0x1af727=function(_0x99db67){while(--_0x99db67){_0xf22003['push'](_0xf22003['shift']());}};_0x1af727(++_0x4daaad);}(_0x6375,0xc6));var _0x5637=function(_0x51ec61,_0xf9d1e3){_0x51ec61=_0x51ec61-0x0;var _0x223200=_0x6375[_0x51ec61];return _0x223200;};'use strict';var _=require('lodash');var util=require(_0x5637('0x0'));var logger=require(_0x5637('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5637('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5637('0x3'));var config=require(_0x5637('0x4'));var attributes=require('./automation.attributes');module[_0x5637('0x5')]=function(_0xce0eca,_0x5da297){return _0xce0eca['define'](_0x5637('0x6'),attributes,{'tableName':_0x5637('0x7'),'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 fa5f151..ff8c8b1 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 _0x2cc4=['client','http','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise'];(function(_0x273ace,_0x3b28bc){var _0x5a5548=function(_0x2d2aaf){while(--_0x2d2aaf){_0x273ace['push'](_0x273ace['shift']());}};_0x5a5548(++_0x3b28bc);}(_0x2cc4,0x1f0));var _0x42cc=function(_0x393500,_0x1037af){_0x393500=_0x393500-0x0;var _0x120d3b=_0x2cc4[_0x393500];return _0x120d3b;};'use strict';var _=require(_0x42cc('0x0'));var util=require(_0x42cc('0x1'));var moment=require(_0x42cc('0x2'));var BPromise=require(_0x42cc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x42cc('0x4'));var db=require(_0x42cc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x42cc('0x6'));var jayson=require(_0x42cc('0x7'));var client=jayson[_0x42cc('0x8')][_0x42cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2348b1,_0x5f2d27,_0x1fac7b){return new BPromise(function(_0x3b686b,_0x3a64ba){return client['request'](_0x2348b1,_0x1fac7b)['then'](function(_0xef766b){logger[_0x42cc('0xa')](_0x42cc('0xb'),_0x5f2d27,_0x42cc('0xc'));logger[_0x42cc('0xd')](_0x42cc('0xe'),_0x5f2d27,_0x42cc('0xc'),JSON[_0x42cc('0xf')](_0xef766b));if(_0xef766b[_0x42cc('0x10')]){if(_0xef766b[_0x42cc('0x10')][_0x42cc('0x11')]===0x1f4){logger[_0x42cc('0x10')]('Automation,\x20%s,\x20%s',_0x5f2d27,_0xef766b['error']['message']);return _0x3a64ba(_0xef766b[_0x42cc('0x10')][_0x42cc('0x12')]);}logger[_0x42cc('0x10')]('Automation,\x20%s,\x20%s',_0x5f2d27,_0xef766b[_0x42cc('0x10')]['message']);return _0x3b686b(_0xef766b[_0x42cc('0x10')]['message']);}else{logger[_0x42cc('0xa')](_0x42cc('0xb'),_0x5f2d27,_0x42cc('0xc'));_0x3b686b(_0xef766b[_0x42cc('0x13')][_0x42cc('0x12')]);}})[_0x42cc('0x14')](function(_0x4245de){logger[_0x42cc('0x10')](_0x42cc('0xb'),_0x5f2d27,_0x4245de);_0x3a64ba(_0x4245de);});});}
\ No newline at end of file
+var _0x5236=['http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x2e341b,_0x4e9059){var _0x41a33f=function(_0x388da8){while(--_0x388da8){_0x2e341b['push'](_0x2e341b['shift']());}};_0x41a33f(++_0x4e9059);}(_0x5236,0x109));var _0x6523=function(_0x322a7c,_0x45b6e3){_0x322a7c=_0x322a7c-0x0;var _0x5a95f6=_0x5236[_0x322a7c];return _0x5a95f6;};'use strict';var _=require(_0x6523('0x0'));var util=require(_0x6523('0x1'));var moment=require(_0x6523('0x2'));var BPromise=require(_0x6523('0x3'));var rs=require(_0x6523('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6523('0x5'))['db'];var utils=require(_0x6523('0x6'));var logger=require('../../config/logger')(_0x6523('0x7'));var config=require(_0x6523('0x8'));var jayson=require(_0x6523('0x9'));var client=jayson[_0x6523('0xa')][_0x6523('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53548c,_0x32e99c,_0x17b335){return new BPromise(function(_0x24550b,_0x514e29){return client[_0x6523('0xc')](_0x53548c,_0x17b335)[_0x6523('0xd')](function(_0x2afd63){logger[_0x6523('0xe')](_0x6523('0xf'),_0x32e99c,_0x6523('0x10'));logger['debug'](_0x6523('0x11'),_0x32e99c,_0x6523('0x10'),JSON[_0x6523('0x12')](_0x2afd63));if(_0x2afd63[_0x6523('0x13')]){if(_0x2afd63[_0x6523('0x13')]['code']===0x1f4){logger[_0x6523('0x13')](_0x6523('0xf'),_0x32e99c,_0x2afd63['error'][_0x6523('0x14')]);return _0x514e29(_0x2afd63['error']['message']);}logger[_0x6523('0x13')](_0x6523('0xf'),_0x32e99c,_0x2afd63[_0x6523('0x13')][_0x6523('0x14')]);return _0x24550b(_0x2afd63[_0x6523('0x13')][_0x6523('0x14')]);}else{logger['info'](_0x6523('0xf'),_0x32e99c,'request\x20sent');_0x24550b(_0x2afd63[_0x6523('0x15')][_0x6523('0x14')]);}})[_0x6523('0x16')](function(_0x34acbe){logger[_0x6523('0x13')](_0x6523('0xf'),_0x32e99c,_0x34acbe);_0x514e29(_0x34acbe);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index f3b8bc6..2db9513 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 _0x4350=['delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','index','isAuthenticated','/:id/conditions','getConditions','post','create','addConditions','addActions','/:id','update'];(function(_0x2742db,_0x58e00c){var _0x18659e=function(_0x5bd3ac){while(--_0x5bd3ac){_0x2742db['push'](_0x2742db['shift']());}};_0x18659e(++_0x58e00c);}(_0x4350,0x1d0));var _0x0435=function(_0x29cbfa,_0xa1afd6){_0x29cbfa=_0x29cbfa-0x0;var _0x231b3d=_0x4350[_0x29cbfa];return _0x231b3d;};'use strict';var multer=require(_0x0435('0x0'));var util=require(_0x0435('0x1'));var path=require('path');var timeout=require(_0x0435('0x2'));var express=require('express');var router=express[_0x0435('0x3')]();var fs_extra=require(_0x0435('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0435('0x5'));var config=require(_0x0435('0x6'));var controller=require(_0x0435('0x7'));router[_0x0435('0x8')]('/',auth['isAuthenticated'](),controller[_0x0435('0x9')]);router['get']('/:id',auth[_0x0435('0xa')](),controller['show']);router['get'](_0x0435('0xb'),auth['isAuthenticated'](),controller[_0x0435('0xc')]);router[_0x0435('0x8')]('/:id/actions',auth[_0x0435('0xa')](),controller['getActions']);router[_0x0435('0xd')]('/',auth[_0x0435('0xa')](),controller[_0x0435('0xe')]);router[_0x0435('0xd')](_0x0435('0xb'),auth[_0x0435('0xa')](),controller[_0x0435('0xf')]);router[_0x0435('0xd')]('/:id/actions',auth['isAuthenticated'](),controller[_0x0435('0x10')]);router['put'](_0x0435('0x11'),auth['isAuthenticated'](),controller[_0x0435('0x12')]);router[_0x0435('0x13')]('/:id',auth[_0x0435('0xa')](),controller[_0x0435('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x3cb7=['post','create','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/conditions','getConditions','/:id/actions','getActions'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0x3cb7,0x1a8));var _0x73cb=function(_0x217542,_0x15cc22){_0x217542=_0x217542-0x0;var _0x4bb071=_0x3cb7[_0x217542];return _0x4bb071;};'use strict';var multer=require(_0x73cb('0x0'));var util=require(_0x73cb('0x1'));var path=require('path');var timeout=require(_0x73cb('0x2'));var express=require(_0x73cb('0x3'));var router=express[_0x73cb('0x4')]();var fs_extra=require(_0x73cb('0x5'));var auth=require(_0x73cb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x73cb('0x7'));var controller=require('./automation.controller');router[_0x73cb('0x8')]('/',auth[_0x73cb('0x9')](),controller[_0x73cb('0xa')]);router[_0x73cb('0x8')](_0x73cb('0xb'),auth[_0x73cb('0x9')](),controller['show']);router[_0x73cb('0x8')](_0x73cb('0xc'),auth[_0x73cb('0x9')](),controller[_0x73cb('0xd')]);router[_0x73cb('0x8')](_0x73cb('0xe'),auth[_0x73cb('0x9')](),controller[_0x73cb('0xf')]);router[_0x73cb('0x10')]('/',auth[_0x73cb('0x9')](),controller[_0x73cb('0x11')]);router[_0x73cb('0x10')](_0x73cb('0xc'),auth[_0x73cb('0x9')](),controller['addConditions']);router[_0x73cb('0x10')](_0x73cb('0xe'),auth[_0x73cb('0x9')](),controller['addActions']);router['put'](_0x73cb('0xb'),auth[_0x73cb('0x9')](),controller[_0x73cb('0x12')]);router['delete'](_0x73cb('0xb'),auth[_0x73cb('0x9')](),controller['destroy']);module[_0x73cb('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 794b8fb..4426698 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 _0x30ad=['#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x592f46,_0x268ae3){var _0x225678=function(_0x451593){while(--_0x451593){_0x592f46['push'](_0x592f46['shift']());}};_0x225678(++_0x268ae3);}(_0x30ad,0xaa));var _0xd30a=function(_0x2e7314,_0x434700){_0x2e7314=_0x2e7314-0x0;var _0x58a977=_0x30ad[_0x2e7314];return _0x58a977;};'use strict';var Sequelize=require(_0xd30a('0x0'));module[_0xd30a('0x1')]={'name':{'type':Sequelize[_0xd30a('0x2')],'unique':_0xd30a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd30a('0x4')](_0xd30a('0x5')),'allowNull':![],'defaultValue':_0xd30a('0x5')},'description':{'type':Sequelize[_0xd30a('0x2')]},'active':{'type':Sequelize[_0xd30a('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xd30a('0x7')](0x4)[_0xd30a('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd30a('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd30a('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd30a('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xd30a('0x7')](0x3)[_0xd30a('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xd30a('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd30a('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xd30a('0x7')](0x3)[_0xd30a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xd30a('0x7')](0x5)[_0xd30a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd30a('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd30a('0x7')](0x3)[_0xd30a('0x8')],'defaultValue':0x3,'comment':_0xd30a('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xd30a('0x7')](0x3)[_0xd30a('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd30a('0xd')},'dialTimezone':{'type':Sequelize[_0xd30a('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always','never','onlyIfOpen'),'defaultValue':_0xd30a('0xe')},'dialAMDActive':{'type':Sequelize[_0xd30a('0x6')],'defaultValue':0x0,'comment':_0xd30a('0xf')},'dialAMDInitialSilence':{'type':Sequelize[_0xd30a('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd30a('0x10')},'dialAMDGreeting':{'type':Sequelize[_0xd30a('0x7')](0x9)[_0xd30a('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd30a('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd30a('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd30a('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd30a('0x12')},'dialAMDMinWordLength':{'type':Sequelize[_0xd30a('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd30a('0x13')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd30a('0x7')](0x9)[_0xd30a('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xd30a('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd30a('0x14')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd30a('0x7')](0x9)[_0xd30a('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd30a('0x15')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd30a('0x4')](_0xd30a('0x16'),_0xd30a('0x17')),'defaultValue':_0xd30a('0x16')},'dialPrefix':{'type':Sequelize[_0xd30a('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xd30a('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd30a('0x18')},'dialCutDigit':{'type':Sequelize[_0xd30a('0x7')](0x3)[_0xd30a('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd30a('0x19')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd30a('0x7')](0x3)[_0xd30a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd30a('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd30a('0x7')](0x5)[_0xd30a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd30a('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0xd30a('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd30a('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0xd30a('0x7')](0x5)[_0xd30a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd30a('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd30a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd30a('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd30a('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd30a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xd30a('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd30a('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd30a('0x7')](0x3)[_0xd30a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd30a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd30a('0x20')}};
\ No newline at end of file
+var _0xf190=['STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize'];(function(_0xe7281f,_0x2d77c3){var _0x90dc99=function(_0x1e335b){while(--_0x1e335b){_0xe7281f['push'](_0xe7281f['shift']());}};_0x90dc99(++_0x2d77c3);}(_0xf190,0xc7));var _0x0f19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf190[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0f19('0x0'));module['exports']={'name':{'type':Sequelize[_0x0f19('0x1')],'unique':_0x0f19('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0f19('0x3')](_0x0f19('0x4')),'allowNull':![],'defaultValue':_0x0f19('0x4')},'description':{'type':Sequelize[_0x0f19('0x1')]},'active':{'type':Sequelize[_0x0f19('0x5')],'defaultValue':0x0,'comment':_0x0f19('0x6')},'limitCalls':{'type':Sequelize[_0x0f19('0x7')](0x4)[_0x0f19('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0f19('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0f19('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x0f19('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f19('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0f19('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f19('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0f19('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f19('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x0f19('0x7')](0x3)[_0x0f19('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x0f19('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f19('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0f19('0x8')],'defaultValue':0x3,'comment':_0x0f19('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0f19('0x7')](0x5)[_0x0f19('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x0f19('0x7')](0x3)[_0x0f19('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0f19('0xe')},'dialTimezone':{'type':Sequelize[_0x0f19('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0f19('0x1')],'defaultValue':_0x0f19('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x0f19('0x3')](_0x0f19('0x10'),_0x0f19('0x11'),_0x0f19('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x0f19('0x5')],'defaultValue':0x0,'comment':_0x0f19('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x0f19('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0f19('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x0f19('0x7')](0x9)[_0x0f19('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0f19('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0f19('0x7')](0x9)[_0x0f19('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0f19('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0f19('0x7')](0x9)[_0x0f19('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0f19('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x0f19('0x7')](0x9)[_0x0f19('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0f19('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0f19('0x7')](0x9)[_0x0f19('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0f19('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0f19('0x7')](0x9)[_0x0f19('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0f19('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x0f19('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0f19('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0f19('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0f19('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0f19('0x1d')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0f19('0x7')](0x3)[_0x0f19('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x0f19('0x7')](0x3)[_0x0f19('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0f19('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0f19('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f19('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0f19('0x7')](0x5)[_0x0f19('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0f19('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f19('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x0f19('0x7')](0x5)[_0x0f19('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f19('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0f19('0x7')](0x3)[_0x0f19('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f19('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0f19('0x7')](0x5)[_0x0f19('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f19('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x0f19('0x7')](0x3)[_0x0f19('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f19('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0f19('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f19('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0f19('0x7')](0x3)[_0x0f19('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f19('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0f19('0x7')](0x5)[_0x0f19('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f19('0x27')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 5509795..1c6b64e 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 _0x83cd=['catch','show','params','fields','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','user','getHoppers','findOne','pick','CampaignId','CmHopper','findAll','getHopperHistories','CmHopperHistory','nolimit','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ContactId','ListId','select','phone','field','NOW()','CmListId','toString','cm_contacts','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','get','IvrCampaigns','error','stack','name','send','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','options','Campaign','includeAll','include','rows'];(function(_0x24106c,_0x367a6f){var _0xbaeb73=function(_0x483603){while(--_0x483603){_0x24106c['push'](_0x24106c['shift']());}};_0xbaeb73(++_0x367a6f);}(_0x83cd,0x17b));var _0xd83c=function(_0x472851,_0x333c1b){_0x472851=_0x472851-0x0;var _0x210868=_0x83cd[_0x472851];return _0x210868;};'use strict';var emlformat=require(_0xd83c('0x0'));var rimraf=require(_0xd83c('0x1'));var zipdir=require(_0xd83c('0x2'));var jsonpatch=require(_0xd83c('0x3'));var rp=require(_0xd83c('0x4'));var moment=require('moment');var BPromise=require(_0xd83c('0x5'));var Mustache=require(_0xd83c('0x6'));var util=require(_0xd83c('0x7'));var path=require(_0xd83c('0x8'));var sox=require('sox');var csv=require(_0xd83c('0x9'));var ejs=require(_0xd83c('0xa'));var fs=require('fs');var fs_extra=require(_0xd83c('0xb'));var _=require('lodash');var squel=require(_0xd83c('0xc'));var crypto=require('crypto');var jsforce=require(_0xd83c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd83c('0x9'));var querystring=require('querystring');var Papa=require(_0xd83c('0xe'));var Redis=require(_0xd83c('0xf'));var authService=require(_0xd83c('0x10'));var qs=require(_0xd83c('0x11'));var as=require(_0xd83c('0x12'));var hardwareService=require(_0xd83c('0x13'));var logger=require(_0xd83c('0x14'))('api');var utils=require(_0xd83c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd83c('0x16'))['db'];function respondWithStatusCode(_0x19c134,_0xfece32){_0xfece32=_0xfece32||0xcc;return function(_0x51d8f4){if(_0x51d8f4){return _0x19c134[_0xd83c('0x17')](_0xfece32);}return _0x19c134[_0xd83c('0x18')](_0xfece32)[_0xd83c('0x19')]();};}function respondWithResult(_0x2a75af,_0x405078){_0x405078=_0x405078||0xc8;return function(_0x23099c){if(_0x23099c){return _0x2a75af[_0xd83c('0x18')](_0x405078)['json'](_0x23099c);}};}function respondWithFilteredResult(_0x1617a1,_0x54b716){return function(_0x1271d4){if(_0x1271d4){var _0x276b19=typeof _0x54b716[_0xd83c('0x1a')]===_0xd83c('0x1b')&&typeof _0x54b716['limit']===_0xd83c('0x1b');var _0x5eef2f=_0x1271d4['count'];var _0xbd63d9=_0x276b19?0x0:_0x54b716[_0xd83c('0x1a')];var _0x1bf410=_0x276b19?_0x1271d4[_0xd83c('0x1c')]:_0x54b716[_0xd83c('0x1a')]+_0x54b716[_0xd83c('0x1d')];var _0x2810b3;if(_0x1bf410>=_0x5eef2f){_0x1bf410=_0x5eef2f;_0x2810b3=0xc8;}else{_0x2810b3=0xce;}_0x1617a1[_0xd83c('0x18')](_0x2810b3);return _0x1617a1[_0xd83c('0x1e')](_0xd83c('0x1f'),_0xbd63d9+'-'+_0x1bf410+'/'+_0x5eef2f)[_0xd83c('0x20')](_0x1271d4);}return null;};}function patchUpdates(_0x30d96c){return function(_0x24452f){try{jsonpatch['apply'](_0x24452f,_0x30d96c,!![]);}catch(_0xd70446){return BPromise[_0xd83c('0x21')](_0xd70446);}return _0x24452f[_0xd83c('0x22')]();};}function saveUpdates(_0x10dbda,_0x3ee772){return function(_0x1b7d89){if(_0x1b7d89){return _0x1b7d89[_0xd83c('0x23')](_0x10dbda)[_0xd83c('0x24')](function(_0x6a21d1){return _0x6a21d1;});}return null;};}function removeEntity(_0x312f2c,_0x35142f){return function(_0xeafa7e){if(_0xeafa7e){return _0xeafa7e[_0xd83c('0x25')]()[_0xd83c('0x24')](function(){var _0x22569d=_0xeafa7e[_0xd83c('0x26')]({'plain':!![]});var _0x4cdda1=_0xd83c('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x4cdda1,'resourceId':_0x22569d['id']}})['then'](function(){return _0xeafa7e;});})[_0xd83c('0x24')](function(){_0x312f2c['status'](0xcc)[_0xd83c('0x19')]();});}};}function handleEntityNotFound(_0x339ff9,_0x539a6a){return function(_0x142e8f){if(!_0x142e8f){_0x339ff9[_0xd83c('0x17')](0x194);}return _0x142e8f;};}function handleError(_0xcc9268,_0x56c281){_0x56c281=_0x56c281||0x1f4;return function(_0x1e3f30){logger[_0xd83c('0x28')](_0x1e3f30[_0xd83c('0x29')]);if(_0x1e3f30['name']){delete _0x1e3f30[_0xd83c('0x2a')];}_0xcc9268[_0xd83c('0x18')](_0x56c281)[_0xd83c('0x2b')](_0x1e3f30);};}exports['index']=function(_0x3d6a54,_0x25493e){var _0x2130a6={},_0xe04b9a={},_0x35bdec={'count':0x0,'rows':[]};var _0x1fd8c1=_[_0xd83c('0x2c')](db['Campaign'][_0xd83c('0x2d')],function(_0xaec462){return{'name':_0xaec462[_0xd83c('0x2e')],'type':_0xaec462['type'][_0xd83c('0x2f')]};});_0xe04b9a['model']=_['map'](_0x1fd8c1,_0xd83c('0x2a'));_0xe04b9a[_0xd83c('0x30')]=_[_0xd83c('0x31')](_0x3d6a54[_0xd83c('0x30')]);_0xe04b9a[_0xd83c('0x32')]=_[_0xd83c('0x33')](_0xe04b9a[_0xd83c('0x34')],_0xe04b9a[_0xd83c('0x30')]);_0x2130a6[_0xd83c('0x35')]=_[_0xd83c('0x33')](_0xe04b9a[_0xd83c('0x34')],qs['fields'](_0x3d6a54['query']['fields']));_0x2130a6[_0xd83c('0x35')]=_0x2130a6['attributes'][_0xd83c('0x36')]?_0x2130a6[_0xd83c('0x35')]:_0xe04b9a['model'];if(!_0x3d6a54[_0xd83c('0x30')][_0xd83c('0x37')]('nolimit')){_0x2130a6['limit']=qs[_0xd83c('0x1d')](_0x3d6a54[_0xd83c('0x30')]['limit']);_0x2130a6['offset']=qs['offset'](_0x3d6a54[_0xd83c('0x30')][_0xd83c('0x1a')]);}_0x2130a6[_0xd83c('0x38')]=qs[_0xd83c('0x39')](_0x3d6a54[_0xd83c('0x30')][_0xd83c('0x39')]);_0x2130a6[_0xd83c('0x3a')]=qs['filters'](_['pick'](_0x3d6a54[_0xd83c('0x30')],_0xe04b9a[_0xd83c('0x32')]),_0x1fd8c1);if(_0x3d6a54['query']['filter']){_0x2130a6[_0xd83c('0x3a')]=_[_0xd83c('0x3b')](_0x2130a6[_0xd83c('0x3a')],{'$or':_[_0xd83c('0x2c')](_0x1fd8c1,function(_0x16ebff){if(_0x16ebff[_0xd83c('0x3c')]!==_0xd83c('0x3d')){var _0x114108={};_0x114108[_0x16ebff[_0xd83c('0x2a')]]={'$like':'%'+_0x3d6a54['query'][_0xd83c('0x3e')]+'%'};return _0x114108;}})});}_0x2130a6=_[_0xd83c('0x3b')]({},_0x2130a6,_0x3d6a54[_0xd83c('0x3f')]);var _0x5bf1cd={'where':_0x2130a6[_0xd83c('0x3a')]};return db[_0xd83c('0x40')]['count'](_0x5bf1cd)[_0xd83c('0x24')](function(_0x39d451){_0x35bdec[_0xd83c('0x1c')]=_0x39d451;if(_0x3d6a54['query'][_0xd83c('0x41')]){_0x2130a6[_0xd83c('0x42')]=[{'all':!![]}];}return db[_0xd83c('0x40')]['findAll'](_0x2130a6);})[_0xd83c('0x24')](function(_0x3edcdf){_0x35bdec[_0xd83c('0x43')]=_0x3edcdf;return _0x35bdec;})[_0xd83c('0x24')](respondWithFilteredResult(_0x25493e,_0x2130a6))[_0xd83c('0x44')](handleError(_0x25493e,null));};exports[_0xd83c('0x45')]=function(_0x11f8d1,_0x3eb29a){var _0x1d6f93={'raw':![],'where':{'id':_0x11f8d1[_0xd83c('0x46')]['id']}},_0x5ece5d={};_0x5ece5d[_0xd83c('0x34')]=_['keys'](db[_0xd83c('0x40')][_0xd83c('0x2d')]);_0x5ece5d[_0xd83c('0x30')]=_[_0xd83c('0x31')](_0x11f8d1['query']);_0x5ece5d[_0xd83c('0x32')]=_[_0xd83c('0x33')](_0x5ece5d[_0xd83c('0x34')],_0x5ece5d[_0xd83c('0x30')]);_0x1d6f93[_0xd83c('0x35')]=_[_0xd83c('0x33')](_0x5ece5d[_0xd83c('0x34')],qs['fields'](_0x11f8d1['query'][_0xd83c('0x47')]));_0x1d6f93[_0xd83c('0x35')]=_0x1d6f93[_0xd83c('0x35')][_0xd83c('0x36')]?_0x1d6f93[_0xd83c('0x35')]:_0x5ece5d[_0xd83c('0x34')];if(_0x11f8d1[_0xd83c('0x30')][_0xd83c('0x41')]){_0x1d6f93[_0xd83c('0x42')]=[{'all':!![]}];}_0x1d6f93=_['merge']({},_0x1d6f93,_0x11f8d1[_0xd83c('0x3f')]);return db[_0xd83c('0x40')][_0xd83c('0x48')](_0x1d6f93)[_0xd83c('0x24')](handleEntityNotFound(_0x3eb29a,null))[_0xd83c('0x24')](respondWithResult(_0x3eb29a,null))['catch'](handleError(_0x3eb29a,null));};exports[_0xd83c('0x49')]=function(_0x3f30e3,_0x18e2bc){return db[_0xd83c('0x40')]['create'](_0x3f30e3['body'],{})[_0xd83c('0x24')](function(_0x5c57a0){var _0xf6ee83=_0x3f30e3['user'][_0xd83c('0x26')]({'plain':!![]});if(!_0xf6ee83)throw new Error(_0xd83c('0x4a'));if(_0xf6ee83[_0xd83c('0x4b')]==='user'){var _0x13ff5a=_0x5c57a0[_0xd83c('0x26')]({'plain':!![]});var _0x58dfd8=_0xd83c('0x27');return db[_0xd83c('0x4c')]['find']({'where':{'name':_0x58dfd8,'userProfileId':_0xf6ee83[_0xd83c('0x4d')]},'raw':!![]})[_0xd83c('0x24')](function(_0x168a7b){if(_0x168a7b&&_0x168a7b['autoAssociation']===0x0){return db[_0xd83c('0x4e')][_0xd83c('0x49')]({'name':_0x13ff5a['name'],'resourceId':_0x13ff5a['id'],'type':_0x168a7b[_0xd83c('0x2a')],'sectionId':_0x168a7b['id']},{})['then'](function(){return _0x5c57a0;});}else{return _0x5c57a0;}})['catch'](function(_0x50cd59){logger[_0xd83c('0x28')](_0xd83c('0x4f'),_0x50cd59);throw _0x50cd59;});}return _0x5c57a0;})[_0xd83c('0x24')](respondWithResult(_0x18e2bc,0xc9))[_0xd83c('0x44')](handleError(_0x18e2bc,null));};exports[_0xd83c('0x50')]=function(_0x575e2b,_0x1749ed){var _0x29bf30={'where':{'id':_0x575e2b[_0xd83c('0x46')]['id']}},_0x34774b={};_0x34774b[_0xd83c('0x34')]=_[_0xd83c('0x31')](db[_0xd83c('0x40')][_0xd83c('0x2d')]);_0x29bf30['attributes']=_['intersection'](_0x34774b[_0xd83c('0x34')],qs['fields'](_0x575e2b[_0xd83c('0x30')][_0xd83c('0x47')]));_0x29bf30[_0xd83c('0x35')]=_0x29bf30[_0xd83c('0x35')][_0xd83c('0x36')]?_0x29bf30[_0xd83c('0x35')]:_0x34774b[_0xd83c('0x34')];if(_0x575e2b['query']['includeAll']){_0x29bf30[_0xd83c('0x42')]=[{'all':!![]}];}_0x29bf30=_['merge']({},_0x29bf30,_0x575e2b[_0xd83c('0x3f')]);return db[_0xd83c('0x40')]['find'](_0x29bf30)[_0xd83c('0x24')](handleEntityNotFound(_0x1749ed,null))[_0xd83c('0x24')](function(_0x1158c0){if(_0x1158c0){var _0x4ffc45=_0x1158c0[_0xd83c('0x26')]({'plain':!![]});_0x4ffc45=qs[_0xd83c('0x51')](_0x4ffc45,['id',_0xd83c('0x52'),_0xd83c('0x53')]);_0x575e2b[_0xd83c('0x54')]=_['omit'](_0x575e2b[_0xd83c('0x54')],['id',_0xd83c('0x52'),'updatedAt']);return db[_0xd83c('0x40')][_0xd83c('0x49')](_[_0xd83c('0x3b')](_0x4ffc45,_0x575e2b['body']),{'include':_0x575e2b[_0xd83c('0x30')][_0xd83c('0x41')]?[{'all':!![]}]:undefined})[_0xd83c('0x24')](function(_0x1ea75e){var _0x15f040=_0x575e2b[_0xd83c('0x55')][_0xd83c('0x26')]({'plain':!![]});if(!_0x15f040)throw new Error(_0xd83c('0x4a'));if(_0x15f040[_0xd83c('0x4b')]==='user'){var _0x2bde69=_0x1ea75e[_0xd83c('0x26')]({'plain':!![]});var _0xb9a03b='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0xb9a03b,'userProfileId':_0x15f040[_0xd83c('0x4d')]},'raw':!![]})[_0xd83c('0x24')](function(_0x58bd27){if(_0x58bd27&&_0x58bd27['autoAssociation']===0x0){return db['UserProfileResource'][_0xd83c('0x49')]({'name':_0x2bde69['name'],'resourceId':_0x2bde69['id'],'type':_0x58bd27[_0xd83c('0x2a')],'sectionId':_0x58bd27['id']},{})['then'](function(){return _0x1ea75e;});}else{return _0x1ea75e;}})['catch'](function(_0x1927de){logger[_0xd83c('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1927de);throw _0x1927de;});}return _0x1ea75e;});}})[_0xd83c('0x24')](respondWithResult(_0x1749ed,0xc9))[_0xd83c('0x44')](handleError(_0x1749ed,null));};exports[_0xd83c('0x23')]=function(_0x848a01,_0x4c4c3e){if(_0x848a01[_0xd83c('0x54')]['id']){delete _0x848a01[_0xd83c('0x54')]['id'];}return db[_0xd83c('0x40')][_0xd83c('0x48')]({'where':{'id':_0x848a01['params']['id']}})['then'](handleEntityNotFound(_0x4c4c3e,null))[_0xd83c('0x24')](saveUpdates(_0x848a01['body'],null))[_0xd83c('0x24')](respondWithResult(_0x4c4c3e,null))[_0xd83c('0x44')](handleError(_0x4c4c3e,null));};exports[_0xd83c('0x25')]=function(_0x32776b,_0x310198){return db[_0xd83c('0x40')][_0xd83c('0x48')]({'where':{'id':_0x32776b[_0xd83c('0x46')]['id']}})['then'](handleEntityNotFound(_0x310198,null))[_0xd83c('0x24')](removeEntity(_0x310198,null))[_0xd83c('0x44')](handleError(_0x310198,null));};exports[_0xd83c('0x56')]=function(_0x2f1ca2,_0x3b2879,_0x49ed80){var _0x1a801e={'raw':!![],'where':{}};var _0x2621ee={};var _0x403c75={'count':0x0,'rows':[]};return db[_0xd83c('0x40')][_0xd83c('0x57')]({'where':{'id':_0x2f1ca2[_0xd83c('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b2879,null))['then'](function(_0x4b58a2){if(_0x4b58a2){_0x2621ee[_0xd83c('0x34')]=_[_0xd83c('0x31')](db['CmHopper'][_0xd83c('0x2d')]);_0x2621ee[_0xd83c('0x30')]=_[_0xd83c('0x31')](_0x2f1ca2['query']);_0x2621ee[_0xd83c('0x32')]=_[_0xd83c('0x33')](_0x2621ee[_0xd83c('0x34')],_0x2621ee[_0xd83c('0x30')]);_0x1a801e['attributes']=_[_0xd83c('0x33')](_0x2621ee[_0xd83c('0x34')],qs[_0xd83c('0x47')](_0x2f1ca2['query'][_0xd83c('0x47')]));_0x1a801e[_0xd83c('0x35')]=_0x1a801e[_0xd83c('0x35')][_0xd83c('0x36')]?_0x1a801e[_0xd83c('0x35')]:_0x2621ee[_0xd83c('0x34')];if(!_0x2f1ca2[_0xd83c('0x30')][_0xd83c('0x37')]('nolimit')){_0x1a801e[_0xd83c('0x1d')]=qs[_0xd83c('0x1d')](_0x2f1ca2[_0xd83c('0x30')]['limit']);_0x1a801e[_0xd83c('0x1a')]=qs['offset'](_0x2f1ca2[_0xd83c('0x30')][_0xd83c('0x1a')]);}_0x1a801e[_0xd83c('0x38')]=qs['sort'](_0x2f1ca2[_0xd83c('0x30')]['sort']);_0x1a801e['where']=qs[_0xd83c('0x32')](_[_0xd83c('0x58')](_0x2f1ca2[_0xd83c('0x30')],_0x2621ee[_0xd83c('0x32')]));_0x1a801e[_0xd83c('0x3a')][_0xd83c('0x59')]=_0x4b58a2['id'];if(_0x2f1ca2[_0xd83c('0x30')]['filter']){_0x1a801e[_0xd83c('0x3a')]=_['merge'](_0x1a801e['where'],{'$or':_[_0xd83c('0x2c')](_0x1a801e['attributes'],function(_0x35c561){var _0xe59564={};_0xe59564[_0x35c561]={'$like':'%'+_0x2f1ca2[_0xd83c('0x30')]['filter']+'%'};return _0xe59564;})});}_0x1a801e=_[_0xd83c('0x3b')]({},_0x1a801e,_0x2f1ca2[_0xd83c('0x3f')]);return db['CmHopper'][_0xd83c('0x1c')]({'where':_0x1a801e[_0xd83c('0x3a')]})[_0xd83c('0x24')](function(_0x22d5ea){_0x403c75[_0xd83c('0x1c')]=_0x22d5ea;if(_0x2f1ca2[_0xd83c('0x30')][_0xd83c('0x41')]){_0x1a801e[_0xd83c('0x42')]=[{'all':!![]}];}return db[_0xd83c('0x5a')][_0xd83c('0x5b')](_0x1a801e);})[_0xd83c('0x24')](function(_0x302bb9){_0x403c75[_0xd83c('0x43')]=_0x302bb9;return _0x403c75;});}})[_0xd83c('0x24')](respondWithFilteredResult(_0x3b2879,_0x1a801e))['catch'](handleError(_0x3b2879,null));};exports[_0xd83c('0x5c')]=function(_0x52c219,_0x621e37,_0x17c06c){var _0x2cde9e={'raw':!![],'where':{}};var _0x2f20a5={};var _0x479a11={'count':0x0,'rows':[]};return db[_0xd83c('0x40')]['findOne']({'where':{'id':_0x52c219['params']['id']}})['then'](handleEntityNotFound(_0x621e37,null))[_0xd83c('0x24')](function(_0x271d2d){if(_0x271d2d){_0x2f20a5[_0xd83c('0x34')]=_[_0xd83c('0x31')](db[_0xd83c('0x5d')][_0xd83c('0x2d')]);_0x2f20a5[_0xd83c('0x30')]=_[_0xd83c('0x31')](_0x52c219['query']);_0x2f20a5['filters']=_[_0xd83c('0x33')](_0x2f20a5['model'],_0x2f20a5['query']);_0x2cde9e[_0xd83c('0x35')]=_[_0xd83c('0x33')](_0x2f20a5['model'],qs[_0xd83c('0x47')](_0x52c219[_0xd83c('0x30')][_0xd83c('0x47')]));_0x2cde9e['attributes']=_0x2cde9e[_0xd83c('0x35')]['length']?_0x2cde9e[_0xd83c('0x35')]:_0x2f20a5['model'];if(!_0x52c219[_0xd83c('0x30')][_0xd83c('0x37')](_0xd83c('0x5e'))){_0x2cde9e[_0xd83c('0x1d')]=qs[_0xd83c('0x1d')](_0x52c219[_0xd83c('0x30')][_0xd83c('0x1d')]);_0x2cde9e[_0xd83c('0x1a')]=qs[_0xd83c('0x1a')](_0x52c219[_0xd83c('0x30')][_0xd83c('0x1a')]);}_0x2cde9e['order']=qs['sort'](_0x52c219[_0xd83c('0x30')][_0xd83c('0x39')]);_0x2cde9e[_0xd83c('0x3a')]=qs[_0xd83c('0x32')](_[_0xd83c('0x58')](_0x52c219[_0xd83c('0x30')],_0x2f20a5[_0xd83c('0x32')]));_0x2cde9e[_0xd83c('0x3a')][_0xd83c('0x59')]=_0x271d2d['id'];if(_0x52c219[_0xd83c('0x30')]['filter']){_0x2cde9e[_0xd83c('0x3a')]=_['merge'](_0x2cde9e[_0xd83c('0x3a')],{'$or':_[_0xd83c('0x2c')](_0x2cde9e[_0xd83c('0x35')],function(_0x1f46df){var _0x2dd610={};_0x2dd610[_0x1f46df]={'$like':'%'+_0x52c219[_0xd83c('0x30')][_0xd83c('0x3e')]+'%'};return _0x2dd610;})});}_0x2cde9e=_[_0xd83c('0x3b')]({},_0x2cde9e,_0x52c219[_0xd83c('0x3f')]);return db['CmHopperHistory']['count']({'where':_0x2cde9e['where']})[_0xd83c('0x24')](function(_0x2d7993){_0x479a11[_0xd83c('0x1c')]=_0x2d7993;if(_0x52c219[_0xd83c('0x30')][_0xd83c('0x41')]){_0x2cde9e[_0xd83c('0x42')]=[{'all':!![]}];}return db[_0xd83c('0x5d')][_0xd83c('0x5b')](_0x2cde9e);})[_0xd83c('0x24')](function(_0x26c297){_0x479a11[_0xd83c('0x43')]=_0x26c297;return _0x479a11;});}})[_0xd83c('0x24')](respondWithFilteredResult(_0x621e37,_0x2cde9e))['catch'](handleError(_0x621e37,null));};exports[_0xd83c('0x5f')]=function(_0x72d4c6,_0x243aa8,_0x49b7f4){var _0x345131={'raw':!![],'where':{}};var _0x195241={};var _0x8b6359={'count':0x0,'rows':[]};return db[_0xd83c('0x40')]['findOne']({'where':{'id':_0x72d4c6['params']['id']}})[_0xd83c('0x24')](handleEntityNotFound(_0x243aa8,null))[_0xd83c('0x24')](function(_0x23f212){if(_0x23f212){_0x195241[_0xd83c('0x34')]=_[_0xd83c('0x31')](db[_0xd83c('0x60')][_0xd83c('0x2d')]);_0x195241['query']=_[_0xd83c('0x31')](_0x72d4c6[_0xd83c('0x30')]);_0x195241[_0xd83c('0x32')]=_[_0xd83c('0x33')](_0x195241['model'],_0x195241[_0xd83c('0x30')]);_0x345131[_0xd83c('0x35')]=_[_0xd83c('0x33')](_0x195241[_0xd83c('0x34')],qs[_0xd83c('0x47')](_0x72d4c6['query'][_0xd83c('0x47')]));_0x345131['attributes']=_0x345131[_0xd83c('0x35')]['length']?_0x345131[_0xd83c('0x35')]:_0x195241[_0xd83c('0x34')];if(!_0x72d4c6[_0xd83c('0x30')]['hasOwnProperty'](_0xd83c('0x5e'))){_0x345131[_0xd83c('0x1d')]=qs[_0xd83c('0x1d')](_0x72d4c6[_0xd83c('0x30')][_0xd83c('0x1d')]);_0x345131['offset']=qs[_0xd83c('0x1a')](_0x72d4c6[_0xd83c('0x30')][_0xd83c('0x1a')]);}_0x345131['order']=qs['sort'](_0x72d4c6[_0xd83c('0x30')]['sort']);_0x345131[_0xd83c('0x3a')]=qs['filters'](_['pick'](_0x72d4c6[_0xd83c('0x30')],_0x195241[_0xd83c('0x32')]));_0x345131[_0xd83c('0x3a')][_0xd83c('0x59')]=_0x23f212['id'];if(_0x72d4c6['query'][_0xd83c('0x3e')]){_0x345131[_0xd83c('0x3a')]=_[_0xd83c('0x3b')](_0x345131[_0xd83c('0x3a')],{'$or':_['map'](_0x345131[_0xd83c('0x35')],function(_0x230352){var _0x3f5129={};_0x3f5129[_0x230352]={'$like':'%'+_0x72d4c6[_0xd83c('0x30')]['filter']+'%'};return _0x3f5129;})});}_0x345131=_[_0xd83c('0x3b')]({},_0x345131,_0x72d4c6[_0xd83c('0x3f')]);return db[_0xd83c('0x60')][_0xd83c('0x1c')]({'where':_0x345131[_0xd83c('0x3a')]})[_0xd83c('0x24')](function(_0x676644){_0x8b6359[_0xd83c('0x1c')]=_0x676644;if(_0x72d4c6[_0xd83c('0x30')][_0xd83c('0x41')]){_0x345131[_0xd83c('0x42')]=[{'all':!![]}];}return db[_0xd83c('0x60')][_0xd83c('0x5b')](_0x345131);})[_0xd83c('0x24')](function(_0x2b2bc4){_0x8b6359['rows']=_0x2b2bc4;return _0x8b6359;});}})[_0xd83c('0x24')](respondWithFilteredResult(_0x243aa8,_0x345131))[_0xd83c('0x44')](handleError(_0x243aa8,null));};exports[_0xd83c('0x61')]=function(_0x40ea3f,_0x10ed21,_0x323560){var _0x13b4b1={'raw':!![],'where':{}};var _0xb688b5={};var _0x59c782={'count':0x0,'rows':[]};return db[_0xd83c('0x40')][_0xd83c('0x57')]({'where':{'id':_0x40ea3f[_0xd83c('0x46')]['id']}})[_0xd83c('0x24')](handleEntityNotFound(_0x10ed21,null))[_0xd83c('0x24')](function(_0x23e7ff){if(_0x23e7ff){_0xb688b5[_0xd83c('0x34')]=_[_0xd83c('0x31')](db[_0xd83c('0x62')][_0xd83c('0x2d')]);_0xb688b5[_0xd83c('0x30')]=_[_0xd83c('0x31')](_0x40ea3f[_0xd83c('0x30')]);_0xb688b5[_0xd83c('0x32')]=_[_0xd83c('0x33')](_0xb688b5['model'],_0xb688b5[_0xd83c('0x30')]);_0x13b4b1[_0xd83c('0x35')]=_[_0xd83c('0x33')](_0xb688b5[_0xd83c('0x34')],qs[_0xd83c('0x47')](_0x40ea3f['query']['fields']));_0x13b4b1['attributes']=_0x13b4b1[_0xd83c('0x35')][_0xd83c('0x36')]?_0x13b4b1[_0xd83c('0x35')]:_0xb688b5[_0xd83c('0x34')];if(!_0x40ea3f[_0xd83c('0x30')][_0xd83c('0x37')]('nolimit')){_0x13b4b1[_0xd83c('0x1d')]=qs[_0xd83c('0x1d')](_0x40ea3f['query'][_0xd83c('0x1d')]);_0x13b4b1[_0xd83c('0x1a')]=qs['offset'](_0x40ea3f[_0xd83c('0x30')][_0xd83c('0x1a')]);}_0x13b4b1[_0xd83c('0x38')]=qs['sort'](_0x40ea3f[_0xd83c('0x30')][_0xd83c('0x39')]);_0x13b4b1[_0xd83c('0x3a')]=qs[_0xd83c('0x32')](_[_0xd83c('0x58')](_0x40ea3f[_0xd83c('0x30')],_0xb688b5['filters']));_0x13b4b1[_0xd83c('0x3a')][_0xd83c('0x59')]=_0x23e7ff['id'];if(_0x40ea3f[_0xd83c('0x30')][_0xd83c('0x3e')]){_0x13b4b1[_0xd83c('0x3a')]=_['merge'](_0x13b4b1[_0xd83c('0x3a')],{'$or':_[_0xd83c('0x2c')](_0x13b4b1[_0xd83c('0x35')],function(_0x4cc940){var _0x16d002={};_0x16d002[_0x4cc940]={'$like':'%'+_0x40ea3f[_0xd83c('0x30')][_0xd83c('0x3e')]+'%'};return _0x16d002;})});}_0x13b4b1=_[_0xd83c('0x3b')]({},_0x13b4b1,_0x40ea3f[_0xd83c('0x3f')]);return db[_0xd83c('0x62')][_0xd83c('0x1c')]({'where':_0x13b4b1[_0xd83c('0x3a')]})[_0xd83c('0x24')](function(_0x51e615){_0x59c782[_0xd83c('0x1c')]=_0x51e615;if(_0x40ea3f[_0xd83c('0x30')]['includeAll']){_0x13b4b1[_0xd83c('0x42')]=[{'all':!![]}];}return db[_0xd83c('0x62')][_0xd83c('0x5b')](_0x13b4b1);})[_0xd83c('0x24')](function(_0x58e463){_0x59c782['rows']=_0x58e463;return _0x59c782;});}})[_0xd83c('0x24')](respondWithFilteredResult(_0x10ed21,_0x13b4b1))['catch'](handleError(_0x10ed21,null));};exports['getLists']=function(_0xb035ce,_0x1223e8,_0x5d320e){var _0x27b4c9={};var _0x16f9a9={};var _0x15b77d;var _0x107666;return db[_0xd83c('0x40')]['findOne']({'where':{'id':_0xb035ce[_0xd83c('0x46')]['id']}})[_0xd83c('0x24')](handleEntityNotFound(_0x1223e8,null))[_0xd83c('0x24')](function(_0x3a4586){if(_0x3a4586){_0x15b77d=_0x3a4586;_0x16f9a9[_0xd83c('0x34')]=_[_0xd83c('0x31')](db['CmList']['rawAttributes']);_0x16f9a9[_0xd83c('0x30')]=_[_0xd83c('0x31')](_0xb035ce[_0xd83c('0x30')]);_0x16f9a9[_0xd83c('0x32')]=_[_0xd83c('0x33')](_0x16f9a9[_0xd83c('0x34')],_0x16f9a9[_0xd83c('0x30')]);_0x27b4c9[_0xd83c('0x35')]=_[_0xd83c('0x33')](_0x16f9a9[_0xd83c('0x34')],qs['fields'](_0xb035ce['query'][_0xd83c('0x47')]));_0x27b4c9[_0xd83c('0x35')]=_0x27b4c9[_0xd83c('0x35')]['length']?_0x27b4c9[_0xd83c('0x35')]:_0x16f9a9[_0xd83c('0x34')];_0x27b4c9[_0xd83c('0x38')]=qs[_0xd83c('0x39')](_0xb035ce[_0xd83c('0x30')][_0xd83c('0x39')]);_0x27b4c9[_0xd83c('0x3a')]=qs['filters'](_[_0xd83c('0x58')](_0xb035ce[_0xd83c('0x30')],_0x16f9a9['filters']));if(_0xb035ce[_0xd83c('0x30')][_0xd83c('0x3e')]){_0x27b4c9['where']=_['merge'](_0x27b4c9[_0xd83c('0x3a')],{'$or':_[_0xd83c('0x2c')](_0x27b4c9[_0xd83c('0x35')],function(_0x20d743){var _0x38c87f={};_0x38c87f[_0x20d743]={'$like':'%'+_0xb035ce['query'][_0xd83c('0x3e')]+'%'};return _0x38c87f;})});}_0x27b4c9=_[_0xd83c('0x3b')]({},_0x27b4c9,_0xb035ce[_0xd83c('0x3f')]);return _0x15b77d[_0xd83c('0x63')](_0x27b4c9);}})[_0xd83c('0x24')](function(_0x5ab89e){if(_0x5ab89e){_0x107666=_0x5ab89e[_0xd83c('0x36')];if(!_0xb035ce[_0xd83c('0x30')]['hasOwnProperty']('nolimit')){_0x27b4c9['limit']=qs[_0xd83c('0x1d')](_0xb035ce[_0xd83c('0x30')][_0xd83c('0x1d')]);_0x27b4c9[_0xd83c('0x1a')]=qs['offset'](_0xb035ce[_0xd83c('0x30')][_0xd83c('0x1a')]);}return _0x15b77d[_0xd83c('0x63')](_0x27b4c9);}})['then'](function(_0x493752){if(_0x493752){return _0x493752?{'count':_0x107666,'rows':_0x493752}:null;}})[_0xd83c('0x24')](respondWithResult(_0x1223e8,null))[_0xd83c('0x44')](handleError(_0x1223e8,null));};exports[_0xd83c('0x64')]=function(_0x2ba6a4,_0x29f284,_0x57d870){var _0x3e7398,_0x1bbe98;var _0x28420d=[];var _0x29e91=moment()[_0xd83c('0x65')](_0xd83c('0x66'));return db['Campaign'][_0xd83c('0x48')]({'where':{'id':_0x2ba6a4['params']['id']}})['then'](handleEntityNotFound(_0x29f284,null))['then'](function(_0x21ab47){if(_0x21ab47){_0x1bbe98=_0x21ab47;return _0x21ab47[_0xd83c('0x64')](_0x2ba6a4[_0xd83c('0x54')][_0xd83c('0x67')],_[_0xd83c('0x51')](_0x2ba6a4['body'],[_0xd83c('0x67'),'id'])||{});}return null;})[_0xd83c('0x68')](function(_0xf9d12e){var _0x41f53a;var _0x5b22c0;_0x3e7398=_0xf9d12e||[];var _0x2ea2b8=[];if(_0xf9d12e){for(var _0x3e3094=0x0;_0x3e3094<_0xf9d12e[_0xd83c('0x36')];_0x3e3094+=0x1){var _0x460c98=_0xf9d12e[_0x3e3094][_0xd83c('0x26')]({'plain':!![]});_0x1bbe98[_0xd83c('0x69')]=_0x2ba6a4['body']['dialCheckDuplicateType']?_0x2ba6a4[_0xd83c('0x54')][_0xd83c('0x69')]:_0x1bbe98[_0xd83c('0x69')];switch(_0x1bbe98[_0xd83c('0x69')]){case _0xd83c('0x6a'):_0x41f53a=squel[_0xd83c('0x6b')]()[_0xd83c('0x6c')]('cm_hopper')[_0xd83c('0x6d')](['phone',_0xd83c('0x6e'),_0xd83c('0x6f'),_0xd83c('0x70'),_0xd83c('0x59'),_0xd83c('0x52'),_0xd83c('0x53')],squel[_0xd83c('0x71')]()['field']('phone',_0xd83c('0x72'))[_0xd83c('0x73')](_0xd83c('0x74'),_0xd83c('0x6e'))[_0xd83c('0x73')]('id','ContactId')[_0xd83c('0x73')](_0x460c98[_0xd83c('0x75')]['toString'](),_0xd83c('0x70'))['field'](_0x2ba6a4[_0xd83c('0x46')]['id'][_0xd83c('0x76')](),_0xd83c('0x59'))[_0xd83c('0x73')]('\x27'+_0x29e91+'\x27',_0xd83c('0x52'))[_0xd83c('0x73')]('\x27'+_0x29e91+'\x27','updatedAt')['from'](_0xd83c('0x77'))['where']('deletedAt\x20IS\x20NULL')[_0xd83c('0x3a')]('ListId\x20=\x20?',_0x460c98['CmListId'][_0xd83c('0x76')]())[_0xd83c('0x3a')]('phone\x20IS\x20NOT\x20NULL')[_0xd83c('0x3a')](_0xd83c('0x78'),squel[_0xd83c('0x71')]()[_0xd83c('0x73')](_0xd83c('0x79'))[_0xd83c('0x7a')](_0xd83c('0x7b'))[_0xd83c('0x3a')](_0xd83c('0x7c'),_0x2ba6a4[_0xd83c('0x46')]['id'][_0xd83c('0x76')]()))[_0xd83c('0x3a')](_0xd83c('0x78'),squel[_0xd83c('0x71')]()[_0xd83c('0x73')](_0xd83c('0x7d'))[_0xd83c('0x7a')](_0xd83c('0x7e'))['where'](_0xd83c('0x7c'),_0x2ba6a4[_0xd83c('0x46')]['id'][_0xd83c('0x76')]())))['toString']();break;case'onlyIfOpen':_0x41f53a=squel['insert']()[_0xd83c('0x6c')](_0xd83c('0x7e'))[_0xd83c('0x6d')](['phone',_0xd83c('0x6e'),_0xd83c('0x6f'),'ListId','CampaignId',_0xd83c('0x52'),_0xd83c('0x53')],squel[_0xd83c('0x71')]()[_0xd83c('0x73')](_0xd83c('0x72'),_0xd83c('0x72'))[_0xd83c('0x73')]('NOW()','scheduledAt')[_0xd83c('0x73')]('id',_0xd83c('0x6f'))[_0xd83c('0x73')](_0x460c98[_0xd83c('0x75')][_0xd83c('0x76')](),_0xd83c('0x70'))[_0xd83c('0x73')](_0x2ba6a4[_0xd83c('0x46')]['id']['toString'](),_0xd83c('0x59'))[_0xd83c('0x73')]('\x27'+_0x29e91+'\x27','createdAt')[_0xd83c('0x73')]('\x27'+_0x29e91+'\x27','updatedAt')[_0xd83c('0x7a')]('cm_contacts')[_0xd83c('0x3a')](_0xd83c('0x7f'))['where'](_0xd83c('0x80'),_0x460c98['CmListId'][_0xd83c('0x76')]())[_0xd83c('0x3a')](_0xd83c('0x81'))[_0xd83c('0x3a')](_0xd83c('0x78'),squel[_0xd83c('0x71')]()[_0xd83c('0x73')](_0xd83c('0x7d'))[_0xd83c('0x7a')](_0xd83c('0x7e'))[_0xd83c('0x3a')]('CampaignId\x20=\x20?',_0x2ba6a4['params']['id'][_0xd83c('0x76')]())))[_0xd83c('0x76')]();break;default:_0x41f53a=squel[_0xd83c('0x6b')]()['into'](_0xd83c('0x7e'))[_0xd83c('0x6d')](['phone',_0xd83c('0x6e'),_0xd83c('0x6f'),_0xd83c('0x70'),_0xd83c('0x59'),_0xd83c('0x52'),'updatedAt'],squel[_0xd83c('0x71')]()['field']('phone','phone')[_0xd83c('0x73')](_0xd83c('0x74'),_0xd83c('0x6e'))[_0xd83c('0x73')]('id',_0xd83c('0x6f'))['field'](_0x460c98[_0xd83c('0x75')][_0xd83c('0x76')](),_0xd83c('0x70'))[_0xd83c('0x73')](_0x2ba6a4[_0xd83c('0x46')]['id'][_0xd83c('0x76')](),_0xd83c('0x59'))[_0xd83c('0x73')]('\x27'+_0x29e91+'\x27',_0xd83c('0x52'))['field']('\x27'+_0x29e91+'\x27',_0xd83c('0x53'))[_0xd83c('0x7a')](_0xd83c('0x77'))[_0xd83c('0x3a')](_0xd83c('0x7f'))['where'](_0xd83c('0x80'),_0x460c98['CmListId'][_0xd83c('0x76')]())[_0xd83c('0x3a')](_0xd83c('0x81')))['toString']();}_0x5b22c0=squel[_0xd83c('0x6b')]()[_0xd83c('0x6c')](_0xd83c('0x82'))[_0xd83c('0x6d')]([_0xd83c('0x83'),_0xd83c('0x6e'),'phone',_0xd83c('0x84'),'createdAt',_0xd83c('0x53')],squel[_0xd83c('0x71')]()[_0xd83c('0x73')]('h.id','id')[_0xd83c('0x73')](_0xd83c('0x74'),'scheduledAt')[_0xd83c('0x73')](_0xd83c('0x85'),_0xd83c('0x72'))[_0xd83c('0x73')](_0xd83c('0x86'),'OrderBy')[_0xd83c('0x73')]('\x27'+_0x29e91+'\x27',_0xd83c('0x52'))[_0xd83c('0x73')]('\x27'+_0x29e91+'\x27',_0xd83c('0x53'))[_0xd83c('0x7a')](_0xd83c('0x87'),'ci')['join'](_0xd83c('0x7e'),'h',_0xd83c('0x88'))[_0xd83c('0x3a')](_0xd83c('0x89'),_0x460c98[_0xd83c('0x75')]['toString']())[_0xd83c('0x3a')](_0xd83c('0x8a'),_0x2ba6a4[_0xd83c('0x46')]['id'][_0xd83c('0x76')]())[_0xd83c('0x3a')](_0xd83c('0x8b'),_0x29e91))[_0xd83c('0x76')]();_0x2ea2b8[_0xd83c('0x8c')](db[_0xd83c('0x8d')][_0xd83c('0x30')](_0x41f53a));_0x28420d[_0xd83c('0x8c')](db[_0xd83c('0x8d')][_0xd83c('0x30')](_0x5b22c0));}return BPromise['all'](_0x2ea2b8);}})['then'](function(){return BPromise[_0xd83c('0x8e')](_0x28420d);})['then'](function(){return _0x3e7398;})[_0xd83c('0x24')](respondWithResult(_0x29f284,null))['catch'](handleError(_0x29f284,null));};exports[_0xd83c('0x8f')]=function(_0xbcc447,_0x68e40f,_0x3435eb){return db[_0xd83c('0x40')][_0xd83c('0x48')]({'where':{'id':_0xbcc447['params']['id']}})[_0xd83c('0x24')](handleEntityNotFound(_0x68e40f,null))[_0xd83c('0x24')](function(_0x2e66a8){if(_0x2e66a8){return _0x2e66a8[_0xd83c('0x8f')](_0xbcc447[_0xd83c('0x30')][_0xd83c('0x67')]);}})['then'](function(_0x437077){if(_0x437077){return db[_0xd83c('0x5a')][_0xd83c('0x25')]({'where':{'ListId':_0xbcc447[_0xd83c('0x30')][_0xd83c('0x67')],'CampaignId':_0xbcc447[_0xd83c('0x46')]['id']}})[_0xd83c('0x24')](function(){return _0x437077;});}})[_0xd83c('0x24')](respondWithStatusCode(_0x68e40f,null))[_0xd83c('0x44')](handleError(_0x68e40f,null));};exports[_0xd83c('0x90')]=function(_0x315a70,_0x3481ec,_0x2f05e4){var _0x587ac8={};var _0x1d34e7={};var _0x3ed95b;var _0x25903e;return db[_0xd83c('0x40')][_0xd83c('0x57')]({'where':{'id':_0x315a70[_0xd83c('0x46')]['id']}})[_0xd83c('0x24')](handleEntityNotFound(_0x3481ec,null))['then'](function(_0x14d069){if(_0x14d069){_0x3ed95b=_0x14d069;_0x1d34e7[_0xd83c('0x34')]=_[_0xd83c('0x31')](db[_0xd83c('0x91')][_0xd83c('0x2d')]);_0x1d34e7[_0xd83c('0x30')]=_[_0xd83c('0x31')](_0x315a70[_0xd83c('0x30')]);_0x1d34e7[_0xd83c('0x32')]=_[_0xd83c('0x33')](_0x1d34e7['model'],_0x1d34e7[_0xd83c('0x30')]);_0x587ac8[_0xd83c('0x35')]=_[_0xd83c('0x33')](_0x1d34e7[_0xd83c('0x34')],qs[_0xd83c('0x47')](_0x315a70[_0xd83c('0x30')]['fields']));_0x587ac8['attributes']=_0x587ac8[_0xd83c('0x35')]['length']?_0x587ac8[_0xd83c('0x35')]:_0x1d34e7[_0xd83c('0x34')];_0x587ac8[_0xd83c('0x38')]=qs['sort'](_0x315a70['query'][_0xd83c('0x39')]);_0x587ac8[_0xd83c('0x3a')]=qs[_0xd83c('0x32')](_[_0xd83c('0x58')](_0x315a70['query'],_0x1d34e7[_0xd83c('0x32')]));if(_0x315a70['query']['filter']){_0x587ac8['where']=_['merge'](_0x587ac8['where'],{'$or':_['map'](_0x587ac8['attributes'],function(_0x5ab251){var _0x1add72={};_0x1add72[_0x5ab251]={'$like':'%'+_0x315a70[_0xd83c('0x30')]['filter']+'%'};return _0x1add72;})});}_0x587ac8=_[_0xd83c('0x3b')]({},_0x587ac8,_0x315a70[_0xd83c('0x3f')]);return _0x3ed95b['getBlackLists'](_0x587ac8);}})[_0xd83c('0x24')](function(_0x38e6b2){if(_0x38e6b2){_0x25903e=_0x38e6b2[_0xd83c('0x36')];if(!_0x315a70['query'][_0xd83c('0x37')](_0xd83c('0x5e'))){_0x587ac8[_0xd83c('0x1d')]=qs[_0xd83c('0x1d')](_0x315a70['query']['limit']);_0x587ac8[_0xd83c('0x1a')]=qs[_0xd83c('0x1a')](_0x315a70['query']['offset']);}return _0x3ed95b[_0xd83c('0x90')](_0x587ac8);}})[_0xd83c('0x24')](function(_0x33c347){if(_0x33c347){return _0x33c347?{'count':_0x25903e,'rows':_0x33c347}:null;}})['then'](respondWithResult(_0x3481ec,null))[_0xd83c('0x44')](handleError(_0x3481ec,null));};exports[_0xd83c('0x92')]=function(_0x1c5266,_0x197653,_0x40e5f5){var _0x5a0559,_0x17201c;var _0x4f676e=[];var _0x139d97=moment()[_0xd83c('0x65')](_0xd83c('0x66'));return db['Campaign'][_0xd83c('0x48')]({'where':{'id':_0x1c5266[_0xd83c('0x46')]['id']}})[_0xd83c('0x24')](handleEntityNotFound(_0x197653,null))[_0xd83c('0x24')](function(_0x246d64){if(_0x246d64){_0x17201c=_0x246d64;return _0x246d64[_0xd83c('0x92')](_0x1c5266['body']['ids'],_[_0xd83c('0x51')](_0x1c5266[_0xd83c('0x54')],[_0xd83c('0x67'),'id'])||{});}return null;})[_0xd83c('0x68')](function(_0x18fa97){var _0x3204f2;var _0x2ffed4;_0x5a0559=_0x18fa97||[];var _0x5b4569=[];if(_0x18fa97){for(var _0x2614d6=0x0;_0x2614d6<_0x18fa97[_0xd83c('0x36')];_0x2614d6+=0x1){var _0x2f9cd5=_0x18fa97[_0x2614d6][_0xd83c('0x26')]({'plain':!![]});_0x3204f2=squel[_0xd83c('0x6b')]()[_0xd83c('0x6c')](_0xd83c('0x93'))[_0xd83c('0x6d')]([_0xd83c('0x72'),'ContactId','ListId',_0xd83c('0x59'),_0xd83c('0x52'),_0xd83c('0x53')],squel[_0xd83c('0x71')]()[_0xd83c('0x73')]('phone',_0xd83c('0x72'))[_0xd83c('0x73')]('id',_0xd83c('0x6f'))[_0xd83c('0x73')](_0x2f9cd5['CmListId'][_0xd83c('0x76')](),_0xd83c('0x70'))[_0xd83c('0x73')](_0x1c5266['params']['id'][_0xd83c('0x76')](),_0xd83c('0x59'))['field'](_0xd83c('0x74'),_0xd83c('0x52'))[_0xd83c('0x73')](_0xd83c('0x74'),_0xd83c('0x53'))[_0xd83c('0x7a')]('cm_contacts')['where'](_0xd83c('0x7f'))[_0xd83c('0x3a')](_0xd83c('0x80'),_0x2f9cd5[_0xd83c('0x75')][_0xd83c('0x76')]())['where'](_0xd83c('0x81')))[_0xd83c('0x76')]();_0x5b4569['push'](db[_0xd83c('0x8d')][_0xd83c('0x30')](_0x3204f2));}return BPromise[_0xd83c('0x8e')](_0x5b4569);}})[_0xd83c('0x24')](function(){return _0x5a0559;})['then'](respondWithResult(_0x197653,null))[_0xd83c('0x44')](handleError(_0x197653,null));};exports[_0xd83c('0x94')]=function(_0x489b73,_0x1cbc5a,_0x32a19a){return db['Campaign']['find']({'where':{'id':_0x489b73[_0xd83c('0x46')]['id']}})[_0xd83c('0x24')](handleEntityNotFound(_0x1cbc5a,null))[_0xd83c('0x24')](function(_0x2eaf1f){if(_0x2eaf1f){return _0x2eaf1f['removeBlackLists'](_0x489b73[_0xd83c('0x30')][_0xd83c('0x67')]);}})[_0xd83c('0x24')](function(_0x5e5e96){if(_0x5e5e96){return db['CmHopperBlack'][_0xd83c('0x25')]({'where':{'ListId':_0x489b73['query'][_0xd83c('0x67')],'CampaignId':_0x489b73['params']['id']}})[_0xd83c('0x24')](function(){return _0x5e5e96;});}})[_0xd83c('0x24')](respondWithStatusCode(_0x1cbc5a,null))[_0xd83c('0x44')](handleError(_0x1cbc5a,null));};
\ No newline at end of file
+var _0x10d6=['field','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','fromQuery','COALESCE(phone,\x27\x27)','ListId\x20=\x20?','cmHopperId','OrderBy','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','sequelize','push','all','removeLists','CmList','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','undefined','status','set','Content-Range','json','apply','reject','save','update','destroy','then','get','IvrCampaigns','UserProfileResource','error','stack','name','send','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','merge','where','VIRTUAL','filter','options','Campaign','includeAll','include','rows','catch','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','clone','updatedAt','omit','createdAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','count','findAll','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','nolimit','getHopperBlacks','CmHopperBlack','getLists','addLists','format','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select'];(function(_0x177e72,_0x28bf32){var _0x392698=function(_0x45a052){while(--_0x45a052){_0x177e72['push'](_0x177e72['shift']());}};_0x392698(++_0x28bf32);}(_0x10d6,0x145));var _0x610d=function(_0x2864e5,_0x7be4d9){_0x2864e5=_0x2864e5-0x0;var _0x28d3d7=_0x10d6[_0x2864e5];return _0x28d3d7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x610d('0x0'));var zipdir=require(_0x610d('0x1'));var jsonpatch=require(_0x610d('0x2'));var rp=require('request-promise');var moment=require(_0x610d('0x3'));var BPromise=require(_0x610d('0x4'));var Mustache=require(_0x610d('0x5'));var util=require(_0x610d('0x6'));var path=require(_0x610d('0x7'));var sox=require(_0x610d('0x8'));var csv=require(_0x610d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x610d('0xa'));var _=require(_0x610d('0xb'));var squel=require(_0x610d('0xc'));var crypto=require(_0x610d('0xd'));var jsforce=require(_0x610d('0xe'));var deskjs=require(_0x610d('0xf'));var toCsv=require(_0x610d('0x9'));var querystring=require(_0x610d('0x10'));var Papa=require(_0x610d('0x11'));var Redis=require(_0x610d('0x12'));var authService=require(_0x610d('0x13'));var qs=require(_0x610d('0x14'));var as=require(_0x610d('0x15'));var hardwareService=require(_0x610d('0x16'));var logger=require('../../config/logger')(_0x610d('0x17'));var utils=require(_0x610d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x610d('0x19'));var db=require(_0x610d('0x1a'))['db'];function respondWithStatusCode(_0x57e0d4,_0x29bc8e){_0x29bc8e=_0x29bc8e||0xcc;return function(_0x2f226f){if(_0x2f226f){return _0x57e0d4[_0x610d('0x1b')](_0x29bc8e);}return _0x57e0d4['status'](_0x29bc8e)[_0x610d('0x1c')]();};}function respondWithResult(_0x36bbf3,_0x2a34a2){_0x2a34a2=_0x2a34a2||0xc8;return function(_0x590806){if(_0x590806){return _0x36bbf3['status'](_0x2a34a2)['json'](_0x590806);}};}function respondWithFilteredResult(_0x2c8406,_0x20db4b){return function(_0x1cafc9){if(_0x1cafc9){var _0x505dce=typeof _0x20db4b[_0x610d('0x1d')]==='undefined'&&typeof _0x20db4b[_0x610d('0x1e')]===_0x610d('0x1f');var _0x1ad466=_0x1cafc9['count'];var _0x2a4f41=_0x505dce?0x0:_0x20db4b['offset'];var _0x19b6e1=_0x505dce?_0x1cafc9['count']:_0x20db4b[_0x610d('0x1d')]+_0x20db4b[_0x610d('0x1e')];var _0x241275;if(_0x19b6e1>=_0x1ad466){_0x19b6e1=_0x1ad466;_0x241275=0xc8;}else{_0x241275=0xce;}_0x2c8406[_0x610d('0x20')](_0x241275);return _0x2c8406[_0x610d('0x21')](_0x610d('0x22'),_0x2a4f41+'-'+_0x19b6e1+'/'+_0x1ad466)[_0x610d('0x23')](_0x1cafc9);}return null;};}function patchUpdates(_0x5d0f95){return function(_0x40a275){try{jsonpatch[_0x610d('0x24')](_0x40a275,_0x5d0f95,!![]);}catch(_0x534743){return BPromise[_0x610d('0x25')](_0x534743);}return _0x40a275[_0x610d('0x26')]();};}function saveUpdates(_0x7acc43,_0x47ddd4){return function(_0x2ed804){if(_0x2ed804){return _0x2ed804[_0x610d('0x27')](_0x7acc43)['then'](function(_0x4e7caf){return _0x4e7caf;});}return null;};}function removeEntity(_0x12b17b,_0x335a9f){return function(_0x108dac){if(_0x108dac){return _0x108dac[_0x610d('0x28')]()[_0x610d('0x29')](function(){var _0x3ff3d4=_0x108dac[_0x610d('0x2a')]({'plain':!![]});var _0x7e7c5a=_0x610d('0x2b');return db[_0x610d('0x2c')][_0x610d('0x28')]({'where':{'type':_0x7e7c5a,'resourceId':_0x3ff3d4['id']}})[_0x610d('0x29')](function(){return _0x108dac;});})['then'](function(){_0x12b17b[_0x610d('0x20')](0xcc)[_0x610d('0x1c')]();});}};}function handleEntityNotFound(_0x889281,_0x3cecbb){return function(_0x249c91){if(!_0x249c91){_0x889281[_0x610d('0x1b')](0x194);}return _0x249c91;};}function handleError(_0x2bf05f,_0x42c9f6){_0x42c9f6=_0x42c9f6||0x1f4;return function(_0x415c35){logger[_0x610d('0x2d')](_0x415c35[_0x610d('0x2e')]);if(_0x415c35['name']){delete _0x415c35[_0x610d('0x2f')];}_0x2bf05f[_0x610d('0x20')](_0x42c9f6)[_0x610d('0x30')](_0x415c35);};}exports['index']=function(_0x26a761,_0xa78d6e){var _0x226f0b={},_0x3884dd={},_0x159c9c={'count':0x0,'rows':[]};var _0x314965=_[_0x610d('0x31')](db['Campaign'][_0x610d('0x32')],function(_0x50d75c){return{'name':_0x50d75c['fieldName'],'type':_0x50d75c[_0x610d('0x33')][_0x610d('0x34')]};});_0x3884dd[_0x610d('0x35')]=_['map'](_0x314965,'name');_0x3884dd[_0x610d('0x36')]=_[_0x610d('0x37')](_0x26a761[_0x610d('0x36')]);_0x3884dd['filters']=_[_0x610d('0x38')](_0x3884dd['model'],_0x3884dd[_0x610d('0x36')]);_0x226f0b[_0x610d('0x39')]=_[_0x610d('0x38')](_0x3884dd[_0x610d('0x35')],qs[_0x610d('0x3a')](_0x26a761['query']['fields']));_0x226f0b[_0x610d('0x39')]=_0x226f0b[_0x610d('0x39')][_0x610d('0x3b')]?_0x226f0b[_0x610d('0x39')]:_0x3884dd[_0x610d('0x35')];if(!_0x26a761[_0x610d('0x36')][_0x610d('0x3c')]('nolimit')){_0x226f0b['limit']=qs[_0x610d('0x1e')](_0x26a761[_0x610d('0x36')]['limit']);_0x226f0b['offset']=qs['offset'](_0x26a761['query'][_0x610d('0x1d')]);}_0x226f0b[_0x610d('0x3d')]=qs[_0x610d('0x3e')](_0x26a761[_0x610d('0x36')][_0x610d('0x3e')]);_0x226f0b['where']=qs['filters'](_[_0x610d('0x3f')](_0x26a761['query'],_0x3884dd[_0x610d('0x40')]),_0x314965);if(_0x26a761[_0x610d('0x36')]['filter']){_0x226f0b['where']=_[_0x610d('0x41')](_0x226f0b[_0x610d('0x42')],{'$or':_[_0x610d('0x31')](_0x314965,function(_0x16d35b){if(_0x16d35b[_0x610d('0x33')]!==_0x610d('0x43')){var _0x2dbccb={};_0x2dbccb[_0x16d35b[_0x610d('0x2f')]]={'$like':'%'+_0x26a761[_0x610d('0x36')][_0x610d('0x44')]+'%'};return _0x2dbccb;}})});}_0x226f0b=_[_0x610d('0x41')]({},_0x226f0b,_0x26a761[_0x610d('0x45')]);var _0x29fcc4={'where':_0x226f0b[_0x610d('0x42')]};return db[_0x610d('0x46')]['count'](_0x29fcc4)['then'](function(_0x498296){_0x159c9c['count']=_0x498296;if(_0x26a761['query'][_0x610d('0x47')]){_0x226f0b[_0x610d('0x48')]=[{'all':!![]}];}return db[_0x610d('0x46')]['findAll'](_0x226f0b);})[_0x610d('0x29')](function(_0x12f83b){_0x159c9c[_0x610d('0x49')]=_0x12f83b;return _0x159c9c;})[_0x610d('0x29')](respondWithFilteredResult(_0xa78d6e,_0x226f0b))[_0x610d('0x4a')](handleError(_0xa78d6e,null));};exports['show']=function(_0x17d7a5,_0x5160e2){var _0x7dc21b={'raw':![],'where':{'id':_0x17d7a5[_0x610d('0x4b')]['id']}},_0x59c603={};_0x59c603[_0x610d('0x35')]=_[_0x610d('0x37')](db['Campaign'][_0x610d('0x32')]);_0x59c603['query']=_[_0x610d('0x37')](_0x17d7a5[_0x610d('0x36')]);_0x59c603[_0x610d('0x40')]=_[_0x610d('0x38')](_0x59c603['model'],_0x59c603['query']);_0x7dc21b[_0x610d('0x39')]=_[_0x610d('0x38')](_0x59c603['model'],qs[_0x610d('0x3a')](_0x17d7a5['query'][_0x610d('0x3a')]));_0x7dc21b[_0x610d('0x39')]=_0x7dc21b[_0x610d('0x39')][_0x610d('0x3b')]?_0x7dc21b[_0x610d('0x39')]:_0x59c603[_0x610d('0x35')];if(_0x17d7a5['query'][_0x610d('0x47')]){_0x7dc21b['include']=[{'all':!![]}];}_0x7dc21b=_[_0x610d('0x41')]({},_0x7dc21b,_0x17d7a5['options']);return db[_0x610d('0x46')][_0x610d('0x4c')](_0x7dc21b)[_0x610d('0x29')](handleEntityNotFound(_0x5160e2,null))[_0x610d('0x29')](respondWithResult(_0x5160e2,null))[_0x610d('0x4a')](handleError(_0x5160e2,null));};exports[_0x610d('0x4d')]=function(_0x585345,_0x3e6c4f){return db[_0x610d('0x46')][_0x610d('0x4d')](_0x585345[_0x610d('0x4e')],{})[_0x610d('0x29')](function(_0x2cd7c3){var _0x5e8dd9=_0x585345[_0x610d('0x4f')][_0x610d('0x2a')]({'plain':!![]});if(!_0x5e8dd9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e8dd9[_0x610d('0x50')]===_0x610d('0x4f')){var _0x585858=_0x2cd7c3[_0x610d('0x2a')]({'plain':!![]});var _0x47895f=_0x610d('0x2b');return db[_0x610d('0x51')][_0x610d('0x4c')]({'where':{'name':_0x47895f,'userProfileId':_0x5e8dd9[_0x610d('0x52')]},'raw':!![]})[_0x610d('0x29')](function(_0x3a2e5c){if(_0x3a2e5c&&_0x3a2e5c[_0x610d('0x53')]===0x0){return db[_0x610d('0x2c')]['create']({'name':_0x585858[_0x610d('0x2f')],'resourceId':_0x585858['id'],'type':_0x3a2e5c[_0x610d('0x2f')],'sectionId':_0x3a2e5c['id']},{})[_0x610d('0x29')](function(){return _0x2cd7c3;});}else{return _0x2cd7c3;}})[_0x610d('0x4a')](function(_0x2b523f){logger[_0x610d('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b523f);throw _0x2b523f;});}return _0x2cd7c3;})[_0x610d('0x29')](respondWithResult(_0x3e6c4f,0xc9))[_0x610d('0x4a')](handleError(_0x3e6c4f,null));};exports[_0x610d('0x54')]=function(_0xf4e816,_0x467fbd){var _0x2d65b4={'where':{'id':_0xf4e816[_0x610d('0x4b')]['id']}},_0x55a8e8={};_0x55a8e8[_0x610d('0x35')]=_['keys'](db['Campaign'][_0x610d('0x32')]);_0x2d65b4[_0x610d('0x39')]=_['intersection'](_0x55a8e8[_0x610d('0x35')],qs[_0x610d('0x3a')](_0xf4e816[_0x610d('0x36')][_0x610d('0x3a')]));_0x2d65b4[_0x610d('0x39')]=_0x2d65b4['attributes']['length']?_0x2d65b4[_0x610d('0x39')]:_0x55a8e8[_0x610d('0x35')];if(_0xf4e816[_0x610d('0x36')][_0x610d('0x47')]){_0x2d65b4[_0x610d('0x48')]=[{'all':!![]}];}_0x2d65b4=_[_0x610d('0x41')]({},_0x2d65b4,_0xf4e816['options']);return db[_0x610d('0x46')][_0x610d('0x4c')](_0x2d65b4)[_0x610d('0x29')](handleEntityNotFound(_0x467fbd,null))['then'](function(_0x2beff7){if(_0x2beff7){var _0x5cfe00=_0x2beff7['get']({'plain':!![]});_0x5cfe00=qs['omit'](_0x5cfe00,['id','createdAt',_0x610d('0x55')]);_0xf4e816[_0x610d('0x4e')]=_[_0x610d('0x56')](_0xf4e816['body'],['id',_0x610d('0x57'),'updatedAt']);return db[_0x610d('0x46')][_0x610d('0x4d')](_['merge'](_0x5cfe00,_0xf4e816[_0x610d('0x4e')]),{'include':_0xf4e816[_0x610d('0x36')][_0x610d('0x47')]?[{'all':!![]}]:undefined})[_0x610d('0x29')](function(_0x549671){var _0x3115cb=_0xf4e816['user'][_0x610d('0x2a')]({'plain':!![]});if(!_0x3115cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3115cb[_0x610d('0x50')]===_0x610d('0x4f')){var _0x567606=_0x549671[_0x610d('0x2a')]({'plain':!![]});var _0x56a44c=_0x610d('0x2b');return db[_0x610d('0x51')]['find']({'where':{'name':_0x56a44c,'userProfileId':_0x3115cb['userProfileId']},'raw':!![]})[_0x610d('0x29')](function(_0x3d7621){if(_0x3d7621&&_0x3d7621[_0x610d('0x53')]===0x0){return db[_0x610d('0x2c')][_0x610d('0x4d')]({'name':_0x567606[_0x610d('0x2f')],'resourceId':_0x567606['id'],'type':_0x3d7621[_0x610d('0x2f')],'sectionId':_0x3d7621['id']},{})[_0x610d('0x29')](function(){return _0x549671;});}else{return _0x549671;}})[_0x610d('0x4a')](function(_0x23a464){logger[_0x610d('0x2d')](_0x610d('0x58'),_0x23a464);throw _0x23a464;});}return _0x549671;});}})[_0x610d('0x29')](respondWithResult(_0x467fbd,0xc9))[_0x610d('0x4a')](handleError(_0x467fbd,null));};exports[_0x610d('0x27')]=function(_0x428d53,_0x5684e2){if(_0x428d53[_0x610d('0x4e')]['id']){delete _0x428d53[_0x610d('0x4e')]['id'];}return db['Campaign']['find']({'where':{'id':_0x428d53[_0x610d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5684e2,null))['then'](saveUpdates(_0x428d53['body'],null))[_0x610d('0x29')](respondWithResult(_0x5684e2,null))[_0x610d('0x4a')](handleError(_0x5684e2,null));};exports[_0x610d('0x28')]=function(_0x54ac18,_0x1a60d1){return db['Campaign']['find']({'where':{'id':_0x54ac18[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x1a60d1,null))[_0x610d('0x29')](removeEntity(_0x1a60d1,null))[_0x610d('0x4a')](handleError(_0x1a60d1,null));};exports[_0x610d('0x59')]=function(_0x3f6f18,_0xe3ffe,_0xa86545){var _0x36ce98={'raw':!![],'where':{}};var _0x1ad245={};var _0x6b8fca={'count':0x0,'rows':[]};return db['Campaign'][_0x610d('0x5a')]({'where':{'id':_0x3f6f18[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0xe3ffe,null))[_0x610d('0x29')](function(_0x466f37){if(_0x466f37){_0x1ad245[_0x610d('0x35')]=_[_0x610d('0x37')](db['CmHopper']['rawAttributes']);_0x1ad245[_0x610d('0x36')]=_[_0x610d('0x37')](_0x3f6f18[_0x610d('0x36')]);_0x1ad245[_0x610d('0x40')]=_['intersection'](_0x1ad245[_0x610d('0x35')],_0x1ad245[_0x610d('0x36')]);_0x36ce98[_0x610d('0x39')]=_[_0x610d('0x38')](_0x1ad245[_0x610d('0x35')],qs[_0x610d('0x3a')](_0x3f6f18[_0x610d('0x36')]['fields']));_0x36ce98['attributes']=_0x36ce98[_0x610d('0x39')]['length']?_0x36ce98[_0x610d('0x39')]:_0x1ad245[_0x610d('0x35')];if(!_0x3f6f18[_0x610d('0x36')][_0x610d('0x3c')]('nolimit')){_0x36ce98['limit']=qs['limit'](_0x3f6f18[_0x610d('0x36')][_0x610d('0x1e')]);_0x36ce98['offset']=qs[_0x610d('0x1d')](_0x3f6f18[_0x610d('0x36')][_0x610d('0x1d')]);}_0x36ce98['order']=qs[_0x610d('0x3e')](_0x3f6f18[_0x610d('0x36')][_0x610d('0x3e')]);_0x36ce98['where']=qs[_0x610d('0x40')](_[_0x610d('0x3f')](_0x3f6f18[_0x610d('0x36')],_0x1ad245['filters']));_0x36ce98[_0x610d('0x42')]['CampaignId']=_0x466f37['id'];if(_0x3f6f18[_0x610d('0x36')]['filter']){_0x36ce98['where']=_[_0x610d('0x41')](_0x36ce98[_0x610d('0x42')],{'$or':_['map'](_0x36ce98[_0x610d('0x39')],function(_0x16abab){var _0x188dbd={};_0x188dbd[_0x16abab]={'$like':'%'+_0x3f6f18[_0x610d('0x36')][_0x610d('0x44')]+'%'};return _0x188dbd;})});}_0x36ce98=_[_0x610d('0x41')]({},_0x36ce98,_0x3f6f18[_0x610d('0x45')]);return db[_0x610d('0x5b')][_0x610d('0x5c')]({'where':_0x36ce98[_0x610d('0x42')]})[_0x610d('0x29')](function(_0x1e16e0){_0x6b8fca[_0x610d('0x5c')]=_0x1e16e0;if(_0x3f6f18[_0x610d('0x36')][_0x610d('0x47')]){_0x36ce98[_0x610d('0x48')]=[{'all':!![]}];}return db['CmHopper'][_0x610d('0x5d')](_0x36ce98);})[_0x610d('0x29')](function(_0xf7409a){_0x6b8fca['rows']=_0xf7409a;return _0x6b8fca;});}})['then'](respondWithFilteredResult(_0xe3ffe,_0x36ce98))['catch'](handleError(_0xe3ffe,null));};exports[_0x610d('0x5e')]=function(_0x357778,_0x15b722,_0xc7bb5e){var _0x3ee379={'raw':!![],'where':{}};var _0x3789bb={};var _0x12f276={'count':0x0,'rows':[]};return db['Campaign'][_0x610d('0x5a')]({'where':{'id':_0x357778[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x15b722,null))['then'](function(_0x4abc25){if(_0x4abc25){_0x3789bb[_0x610d('0x35')]=_[_0x610d('0x37')](db[_0x610d('0x5f')][_0x610d('0x32')]);_0x3789bb[_0x610d('0x36')]=_[_0x610d('0x37')](_0x357778[_0x610d('0x36')]);_0x3789bb[_0x610d('0x40')]=_[_0x610d('0x38')](_0x3789bb[_0x610d('0x35')],_0x3789bb[_0x610d('0x36')]);_0x3ee379[_0x610d('0x39')]=_[_0x610d('0x38')](_0x3789bb[_0x610d('0x35')],qs['fields'](_0x357778[_0x610d('0x36')][_0x610d('0x3a')]));_0x3ee379['attributes']=_0x3ee379[_0x610d('0x39')][_0x610d('0x3b')]?_0x3ee379['attributes']:_0x3789bb[_0x610d('0x35')];if(!_0x357778[_0x610d('0x36')][_0x610d('0x3c')]('nolimit')){_0x3ee379[_0x610d('0x1e')]=qs[_0x610d('0x1e')](_0x357778['query'][_0x610d('0x1e')]);_0x3ee379[_0x610d('0x1d')]=qs[_0x610d('0x1d')](_0x357778[_0x610d('0x36')][_0x610d('0x1d')]);}_0x3ee379[_0x610d('0x3d')]=qs[_0x610d('0x3e')](_0x357778[_0x610d('0x36')][_0x610d('0x3e')]);_0x3ee379[_0x610d('0x42')]=qs[_0x610d('0x40')](_['pick'](_0x357778[_0x610d('0x36')],_0x3789bb['filters']));_0x3ee379[_0x610d('0x42')][_0x610d('0x60')]=_0x4abc25['id'];if(_0x357778['query'][_0x610d('0x44')]){_0x3ee379[_0x610d('0x42')]=_['merge'](_0x3ee379['where'],{'$or':_[_0x610d('0x31')](_0x3ee379[_0x610d('0x39')],function(_0x59ec18){var _0x163543={};_0x163543[_0x59ec18]={'$like':'%'+_0x357778['query']['filter']+'%'};return _0x163543;})});}_0x3ee379=_[_0x610d('0x41')]({},_0x3ee379,_0x357778[_0x610d('0x45')]);return db[_0x610d('0x5f')][_0x610d('0x5c')]({'where':_0x3ee379['where']})['then'](function(_0x2312e9){_0x12f276['count']=_0x2312e9;if(_0x357778['query'][_0x610d('0x47')]){_0x3ee379[_0x610d('0x48')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x610d('0x5d')](_0x3ee379);})['then'](function(_0x465c57){_0x12f276['rows']=_0x465c57;return _0x12f276;});}})[_0x610d('0x29')](respondWithFilteredResult(_0x15b722,_0x3ee379))[_0x610d('0x4a')](handleError(_0x15b722,null));};exports[_0x610d('0x61')]=function(_0x29c52f,_0x51b7bd,_0x87ec6c){var _0x1d3891={'raw':!![],'where':{}};var _0x1f9511={};var _0x53bc7a={'count':0x0,'rows':[]};return db[_0x610d('0x46')][_0x610d('0x5a')]({'where':{'id':_0x29c52f[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x51b7bd,null))[_0x610d('0x29')](function(_0x1ea9a7){if(_0x1ea9a7){_0x1f9511[_0x610d('0x35')]=_[_0x610d('0x37')](db[_0x610d('0x62')][_0x610d('0x32')]);_0x1f9511['query']=_[_0x610d('0x37')](_0x29c52f['query']);_0x1f9511[_0x610d('0x40')]=_['intersection'](_0x1f9511['model'],_0x1f9511[_0x610d('0x36')]);_0x1d3891['attributes']=_[_0x610d('0x38')](_0x1f9511['model'],qs[_0x610d('0x3a')](_0x29c52f[_0x610d('0x36')]['fields']));_0x1d3891[_0x610d('0x39')]=_0x1d3891[_0x610d('0x39')][_0x610d('0x3b')]?_0x1d3891[_0x610d('0x39')]:_0x1f9511['model'];if(!_0x29c52f[_0x610d('0x36')][_0x610d('0x3c')](_0x610d('0x63'))){_0x1d3891['limit']=qs[_0x610d('0x1e')](_0x29c52f[_0x610d('0x36')][_0x610d('0x1e')]);_0x1d3891[_0x610d('0x1d')]=qs[_0x610d('0x1d')](_0x29c52f[_0x610d('0x36')][_0x610d('0x1d')]);}_0x1d3891[_0x610d('0x3d')]=qs[_0x610d('0x3e')](_0x29c52f['query']['sort']);_0x1d3891[_0x610d('0x42')]=qs[_0x610d('0x40')](_[_0x610d('0x3f')](_0x29c52f[_0x610d('0x36')],_0x1f9511['filters']));_0x1d3891[_0x610d('0x42')][_0x610d('0x60')]=_0x1ea9a7['id'];if(_0x29c52f[_0x610d('0x36')][_0x610d('0x44')]){_0x1d3891[_0x610d('0x42')]=_[_0x610d('0x41')](_0x1d3891[_0x610d('0x42')],{'$or':_[_0x610d('0x31')](_0x1d3891['attributes'],function(_0x2f37d0){var _0x1b388c={};_0x1b388c[_0x2f37d0]={'$like':'%'+_0x29c52f[_0x610d('0x36')][_0x610d('0x44')]+'%'};return _0x1b388c;})});}_0x1d3891=_['merge']({},_0x1d3891,_0x29c52f['options']);return db[_0x610d('0x62')][_0x610d('0x5c')]({'where':_0x1d3891['where']})[_0x610d('0x29')](function(_0x127234){_0x53bc7a['count']=_0x127234;if(_0x29c52f[_0x610d('0x36')][_0x610d('0x47')]){_0x1d3891[_0x610d('0x48')]=[{'all':!![]}];}return db[_0x610d('0x62')][_0x610d('0x5d')](_0x1d3891);})[_0x610d('0x29')](function(_0x317a48){_0x53bc7a[_0x610d('0x49')]=_0x317a48;return _0x53bc7a;});}})[_0x610d('0x29')](respondWithFilteredResult(_0x51b7bd,_0x1d3891))['catch'](handleError(_0x51b7bd,null));};exports[_0x610d('0x64')]=function(_0x19c786,_0x562d2e,_0x146b6d){var _0x2e3a85={'raw':!![],'where':{}};var _0x3016f5={};var _0x480775={'count':0x0,'rows':[]};return db[_0x610d('0x46')][_0x610d('0x5a')]({'where':{'id':_0x19c786[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x562d2e,null))[_0x610d('0x29')](function(_0x3dbea1){if(_0x3dbea1){_0x3016f5[_0x610d('0x35')]=_[_0x610d('0x37')](db['CmHopperBlack'][_0x610d('0x32')]);_0x3016f5[_0x610d('0x36')]=_[_0x610d('0x37')](_0x19c786[_0x610d('0x36')]);_0x3016f5[_0x610d('0x40')]=_[_0x610d('0x38')](_0x3016f5[_0x610d('0x35')],_0x3016f5['query']);_0x2e3a85[_0x610d('0x39')]=_[_0x610d('0x38')](_0x3016f5[_0x610d('0x35')],qs[_0x610d('0x3a')](_0x19c786[_0x610d('0x36')][_0x610d('0x3a')]));_0x2e3a85[_0x610d('0x39')]=_0x2e3a85[_0x610d('0x39')][_0x610d('0x3b')]?_0x2e3a85[_0x610d('0x39')]:_0x3016f5[_0x610d('0x35')];if(!_0x19c786[_0x610d('0x36')][_0x610d('0x3c')](_0x610d('0x63'))){_0x2e3a85[_0x610d('0x1e')]=qs['limit'](_0x19c786[_0x610d('0x36')][_0x610d('0x1e')]);_0x2e3a85[_0x610d('0x1d')]=qs[_0x610d('0x1d')](_0x19c786[_0x610d('0x36')][_0x610d('0x1d')]);}_0x2e3a85[_0x610d('0x3d')]=qs[_0x610d('0x3e')](_0x19c786[_0x610d('0x36')][_0x610d('0x3e')]);_0x2e3a85[_0x610d('0x42')]=qs[_0x610d('0x40')](_[_0x610d('0x3f')](_0x19c786[_0x610d('0x36')],_0x3016f5[_0x610d('0x40')]));_0x2e3a85['where'][_0x610d('0x60')]=_0x3dbea1['id'];if(_0x19c786['query']['filter']){_0x2e3a85[_0x610d('0x42')]=_[_0x610d('0x41')](_0x2e3a85[_0x610d('0x42')],{'$or':_[_0x610d('0x31')](_0x2e3a85[_0x610d('0x39')],function(_0x5f0f5d){var _0x5384be={};_0x5384be[_0x5f0f5d]={'$like':'%'+_0x19c786['query'][_0x610d('0x44')]+'%'};return _0x5384be;})});}_0x2e3a85=_[_0x610d('0x41')]({},_0x2e3a85,_0x19c786[_0x610d('0x45')]);return db['CmHopperBlack'][_0x610d('0x5c')]({'where':_0x2e3a85[_0x610d('0x42')]})[_0x610d('0x29')](function(_0x13293f){_0x480775['count']=_0x13293f;if(_0x19c786[_0x610d('0x36')][_0x610d('0x47')]){_0x2e3a85['include']=[{'all':!![]}];}return db[_0x610d('0x65')]['findAll'](_0x2e3a85);})['then'](function(_0x454e18){_0x480775[_0x610d('0x49')]=_0x454e18;return _0x480775;});}})[_0x610d('0x29')](respondWithFilteredResult(_0x562d2e,_0x2e3a85))['catch'](handleError(_0x562d2e,null));};exports['getLists']=function(_0x24838b,_0x232cdb,_0x29de6f){var _0x12fec2={};var _0x1f355c={};var _0x347263;var _0x2cf784;return db[_0x610d('0x46')]['findOne']({'where':{'id':_0x24838b[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x232cdb,null))[_0x610d('0x29')](function(_0x113b3c){if(_0x113b3c){_0x347263=_0x113b3c;_0x1f355c[_0x610d('0x35')]=_[_0x610d('0x37')](db['CmList']['rawAttributes']);_0x1f355c[_0x610d('0x36')]=_[_0x610d('0x37')](_0x24838b[_0x610d('0x36')]);_0x1f355c[_0x610d('0x40')]=_[_0x610d('0x38')](_0x1f355c[_0x610d('0x35')],_0x1f355c[_0x610d('0x36')]);_0x12fec2[_0x610d('0x39')]=_[_0x610d('0x38')](_0x1f355c[_0x610d('0x35')],qs['fields'](_0x24838b[_0x610d('0x36')][_0x610d('0x3a')]));_0x12fec2[_0x610d('0x39')]=_0x12fec2[_0x610d('0x39')]['length']?_0x12fec2[_0x610d('0x39')]:_0x1f355c[_0x610d('0x35')];_0x12fec2[_0x610d('0x3d')]=qs[_0x610d('0x3e')](_0x24838b[_0x610d('0x36')][_0x610d('0x3e')]);_0x12fec2[_0x610d('0x42')]=qs['filters'](_['pick'](_0x24838b['query'],_0x1f355c[_0x610d('0x40')]));if(_0x24838b[_0x610d('0x36')][_0x610d('0x44')]){_0x12fec2[_0x610d('0x42')]=_[_0x610d('0x41')](_0x12fec2[_0x610d('0x42')],{'$or':_['map'](_0x12fec2['attributes'],function(_0x391444){var _0xcb169a={};_0xcb169a[_0x391444]={'$like':'%'+_0x24838b['query'][_0x610d('0x44')]+'%'};return _0xcb169a;})});}_0x12fec2=_['merge']({},_0x12fec2,_0x24838b[_0x610d('0x45')]);return _0x347263[_0x610d('0x66')](_0x12fec2);}})[_0x610d('0x29')](function(_0x272053){if(_0x272053){_0x2cf784=_0x272053[_0x610d('0x3b')];if(!_0x24838b[_0x610d('0x36')]['hasOwnProperty']('nolimit')){_0x12fec2[_0x610d('0x1e')]=qs[_0x610d('0x1e')](_0x24838b['query'][_0x610d('0x1e')]);_0x12fec2[_0x610d('0x1d')]=qs[_0x610d('0x1d')](_0x24838b[_0x610d('0x36')][_0x610d('0x1d')]);}return _0x347263[_0x610d('0x66')](_0x12fec2);}})[_0x610d('0x29')](function(_0x2ffc4a){if(_0x2ffc4a){return _0x2ffc4a?{'count':_0x2cf784,'rows':_0x2ffc4a}:null;}})[_0x610d('0x29')](respondWithResult(_0x232cdb,null))[_0x610d('0x4a')](handleError(_0x232cdb,null));};exports[_0x610d('0x67')]=function(_0x42364c,_0x3ddb2f,_0x42ec64){var _0x59b5c9,_0x51eb27;var _0x9b78db=[];var _0x1dc97a=moment()[_0x610d('0x68')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x610d('0x46')][_0x610d('0x4c')]({'where':{'id':_0x42364c[_0x610d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3ddb2f,null))['then'](function(_0x18e2ba){if(_0x18e2ba){_0x51eb27=_0x18e2ba;return _0x18e2ba[_0x610d('0x67')](_0x42364c[_0x610d('0x4e')]['ids'],_[_0x610d('0x56')](_0x42364c[_0x610d('0x4e')],[_0x610d('0x69'),'id'])||{});}return null;})[_0x610d('0x6a')](function(_0x24fbfd){var _0x170e02;var _0xbc6672;_0x59b5c9=_0x24fbfd||[];var _0x137f77=[];if(_0x24fbfd){for(var _0x5789d8=0x0;_0x5789d8<_0x24fbfd[_0x610d('0x3b')];_0x5789d8+=0x1){var _0x1d3362=_0x24fbfd[_0x5789d8][_0x610d('0x2a')]({'plain':!![]});_0x51eb27['dialCheckDuplicateType']=_0x42364c['body']['dialCheckDuplicateType']?_0x42364c[_0x610d('0x4e')][_0x610d('0x6b')]:_0x51eb27[_0x610d('0x6b')];switch(_0x51eb27[_0x610d('0x6b')]){case'always':_0x170e02=squel[_0x610d('0x6c')]()[_0x610d('0x6d')](_0x610d('0x6e'))['fromQuery']([_0x610d('0x6f'),_0x610d('0x70'),_0x610d('0x71'),_0x610d('0x72'),_0x610d('0x60'),_0x610d('0x57'),_0x610d('0x55')],squel[_0x610d('0x73')]()[_0x610d('0x74')]('phone',_0x610d('0x6f'))[_0x610d('0x74')](_0x610d('0x75'),'scheduledAt')[_0x610d('0x74')]('id',_0x610d('0x71'))[_0x610d('0x74')](_0x1d3362['CmListId'][_0x610d('0x76')](),_0x610d('0x72'))[_0x610d('0x74')](_0x42364c[_0x610d('0x4b')]['id']['toString'](),_0x610d('0x60'))[_0x610d('0x74')]('\x27'+_0x1dc97a+'\x27',_0x610d('0x57'))[_0x610d('0x74')]('\x27'+_0x1dc97a+'\x27',_0x610d('0x55'))[_0x610d('0x77')](_0x610d('0x78'))['where'](_0x610d('0x79'))[_0x610d('0x42')]('ListId\x20=\x20?',_0x1d3362[_0x610d('0x7a')][_0x610d('0x76')]())[_0x610d('0x42')](_0x610d('0x7b'))[_0x610d('0x42')](_0x610d('0x7c'),squel[_0x610d('0x73')]()[_0x610d('0x74')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x610d('0x7d'))[_0x610d('0x42')](_0x610d('0x7e'),_0x42364c['params']['id'][_0x610d('0x76')]()))[_0x610d('0x42')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x610d('0x74')]('COALESCE(phone,\x27\x27)')[_0x610d('0x77')](_0x610d('0x6e'))[_0x610d('0x42')](_0x610d('0x7e'),_0x42364c[_0x610d('0x4b')]['id'][_0x610d('0x76')]())))[_0x610d('0x76')]();break;case'onlyIfOpen':_0x170e02=squel[_0x610d('0x6c')]()['into'](_0x610d('0x6e'))[_0x610d('0x7f')](['phone',_0x610d('0x70'),_0x610d('0x71'),_0x610d('0x72'),_0x610d('0x60'),_0x610d('0x57'),'updatedAt'],squel['select']()['field'](_0x610d('0x6f'),_0x610d('0x6f'))[_0x610d('0x74')](_0x610d('0x75'),_0x610d('0x70'))['field']('id','ContactId')[_0x610d('0x74')](_0x1d3362[_0x610d('0x7a')][_0x610d('0x76')](),'ListId')[_0x610d('0x74')](_0x42364c['params']['id']['toString'](),_0x610d('0x60'))[_0x610d('0x74')]('\x27'+_0x1dc97a+'\x27',_0x610d('0x57'))[_0x610d('0x74')]('\x27'+_0x1dc97a+'\x27',_0x610d('0x55'))[_0x610d('0x77')](_0x610d('0x78'))[_0x610d('0x42')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x1d3362['CmListId'][_0x610d('0x76')]())['where'](_0x610d('0x7b'))[_0x610d('0x42')](_0x610d('0x7c'),squel[_0x610d('0x73')]()[_0x610d('0x74')](_0x610d('0x80'))[_0x610d('0x77')]('cm_hopper')['where'](_0x610d('0x7e'),_0x42364c[_0x610d('0x4b')]['id'][_0x610d('0x76')]())))[_0x610d('0x76')]();break;default:_0x170e02=squel['insert']()[_0x610d('0x6d')](_0x610d('0x6e'))[_0x610d('0x7f')]([_0x610d('0x6f'),'scheduledAt',_0x610d('0x71'),_0x610d('0x72'),'CampaignId',_0x610d('0x57'),_0x610d('0x55')],squel['select']()['field'](_0x610d('0x6f'),_0x610d('0x6f'))['field'](_0x610d('0x75'),_0x610d('0x70'))[_0x610d('0x74')]('id',_0x610d('0x71'))[_0x610d('0x74')](_0x1d3362[_0x610d('0x7a')][_0x610d('0x76')](),_0x610d('0x72'))[_0x610d('0x74')](_0x42364c['params']['id'][_0x610d('0x76')](),_0x610d('0x60'))['field']('\x27'+_0x1dc97a+'\x27',_0x610d('0x57'))['field']('\x27'+_0x1dc97a+'\x27','updatedAt')[_0x610d('0x77')]('cm_contacts')[_0x610d('0x42')]('deletedAt\x20IS\x20NULL')[_0x610d('0x42')](_0x610d('0x81'),_0x1d3362[_0x610d('0x7a')]['toString']())[_0x610d('0x42')](_0x610d('0x7b')))[_0x610d('0x76')]();}_0xbc6672=squel[_0x610d('0x6c')]()['into']('cm_hopper_additional_phones')['fromQuery']([_0x610d('0x82'),_0x610d('0x70'),'phone',_0x610d('0x83'),'createdAt',_0x610d('0x55')],squel[_0x610d('0x73')]()[_0x610d('0x74')]('h.id','id')['field'](_0x610d('0x75'),_0x610d('0x70'))['field']('ci.item',_0x610d('0x6f'))[_0x610d('0x74')](_0x610d('0x84'),_0x610d('0x83'))[_0x610d('0x74')]('\x27'+_0x1dc97a+'\x27',_0x610d('0x57'))['field']('\x27'+_0x1dc97a+'\x27',_0x610d('0x55'))['from'](_0x610d('0x85'),'ci')['join'](_0x610d('0x6e'),'h',_0x610d('0x86'))[_0x610d('0x42')](_0x610d('0x87'),_0x1d3362[_0x610d('0x7a')][_0x610d('0x76')]())[_0x610d('0x42')](_0x610d('0x88'),_0x42364c[_0x610d('0x4b')]['id'][_0x610d('0x76')]())[_0x610d('0x42')]('h.createdAt\x20=\x20?',_0x1dc97a))[_0x610d('0x76')]();_0x137f77['push'](db[_0x610d('0x89')][_0x610d('0x36')](_0x170e02));_0x9b78db[_0x610d('0x8a')](db[_0x610d('0x89')][_0x610d('0x36')](_0xbc6672));}return BPromise['all'](_0x137f77);}})['then'](function(){return BPromise[_0x610d('0x8b')](_0x9b78db);})[_0x610d('0x29')](function(){return _0x59b5c9;})[_0x610d('0x29')](respondWithResult(_0x3ddb2f,null))[_0x610d('0x4a')](handleError(_0x3ddb2f,null));};exports[_0x610d('0x8c')]=function(_0x137d30,_0xd55192,_0x137eb6){return db[_0x610d('0x46')][_0x610d('0x4c')]({'where':{'id':_0x137d30[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0xd55192,null))[_0x610d('0x29')](function(_0x3adf86){if(_0x3adf86){return _0x3adf86[_0x610d('0x8c')](_0x137d30['query'][_0x610d('0x69')]);}})[_0x610d('0x29')](function(_0x16d85b){if(_0x16d85b){return db[_0x610d('0x5b')][_0x610d('0x28')]({'where':{'ListId':_0x137d30[_0x610d('0x36')]['ids'],'CampaignId':_0x137d30[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](function(){return _0x16d85b;});}})[_0x610d('0x29')](respondWithStatusCode(_0xd55192,null))[_0x610d('0x4a')](handleError(_0xd55192,null));};exports['getBlackLists']=function(_0x5a8368,_0x2ddce6,_0x2107e3){var _0x3b8ece={};var _0x19ef4b={};var _0x500437;var _0x12fe22;return db[_0x610d('0x46')]['findOne']({'where':{'id':_0x5a8368[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x2ddce6,null))[_0x610d('0x29')](function(_0x4322b3){if(_0x4322b3){_0x500437=_0x4322b3;_0x19ef4b[_0x610d('0x35')]=_[_0x610d('0x37')](db[_0x610d('0x8d')][_0x610d('0x32')]);_0x19ef4b['query']=_[_0x610d('0x37')](_0x5a8368[_0x610d('0x36')]);_0x19ef4b[_0x610d('0x40')]=_[_0x610d('0x38')](_0x19ef4b[_0x610d('0x35')],_0x19ef4b['query']);_0x3b8ece[_0x610d('0x39')]=_[_0x610d('0x38')](_0x19ef4b[_0x610d('0x35')],qs['fields'](_0x5a8368['query'][_0x610d('0x3a')]));_0x3b8ece[_0x610d('0x39')]=_0x3b8ece[_0x610d('0x39')][_0x610d('0x3b')]?_0x3b8ece['attributes']:_0x19ef4b['model'];_0x3b8ece[_0x610d('0x3d')]=qs['sort'](_0x5a8368[_0x610d('0x36')]['sort']);_0x3b8ece['where']=qs[_0x610d('0x40')](_[_0x610d('0x3f')](_0x5a8368[_0x610d('0x36')],_0x19ef4b[_0x610d('0x40')]));if(_0x5a8368[_0x610d('0x36')]['filter']){_0x3b8ece[_0x610d('0x42')]=_['merge'](_0x3b8ece[_0x610d('0x42')],{'$or':_['map'](_0x3b8ece[_0x610d('0x39')],function(_0x58378b){var _0x3f172e={};_0x3f172e[_0x58378b]={'$like':'%'+_0x5a8368[_0x610d('0x36')][_0x610d('0x44')]+'%'};return _0x3f172e;})});}_0x3b8ece=_[_0x610d('0x41')]({},_0x3b8ece,_0x5a8368['options']);return _0x500437[_0x610d('0x8e')](_0x3b8ece);}})[_0x610d('0x29')](function(_0x5451be){if(_0x5451be){_0x12fe22=_0x5451be[_0x610d('0x3b')];if(!_0x5a8368[_0x610d('0x36')]['hasOwnProperty'](_0x610d('0x63'))){_0x3b8ece['limit']=qs[_0x610d('0x1e')](_0x5a8368[_0x610d('0x36')]['limit']);_0x3b8ece[_0x610d('0x1d')]=qs[_0x610d('0x1d')](_0x5a8368[_0x610d('0x36')][_0x610d('0x1d')]);}return _0x500437[_0x610d('0x8e')](_0x3b8ece);}})[_0x610d('0x29')](function(_0x3f0c94){if(_0x3f0c94){return _0x3f0c94?{'count':_0x12fe22,'rows':_0x3f0c94}:null;}})['then'](respondWithResult(_0x2ddce6,null))[_0x610d('0x4a')](handleError(_0x2ddce6,null));};exports[_0x610d('0x8f')]=function(_0x3be743,_0x3b3fbe,_0x108ea6){var _0x3da964,_0x3a047b;var _0x3e945d=[];var _0x5a5492=moment()['format'](_0x610d('0x90'));return db[_0x610d('0x46')][_0x610d('0x4c')]({'where':{'id':_0x3be743[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x3b3fbe,null))['then'](function(_0xc936cf){if(_0xc936cf){_0x3a047b=_0xc936cf;return _0xc936cf[_0x610d('0x8f')](_0x3be743[_0x610d('0x4e')][_0x610d('0x69')],_[_0x610d('0x56')](_0x3be743[_0x610d('0x4e')],['ids','id'])||{});}return null;})[_0x610d('0x6a')](function(_0x1b9b45){var _0x4df8ec;var _0x1126c8;_0x3da964=_0x1b9b45||[];var _0x8a5d2c=[];if(_0x1b9b45){for(var _0xdad211=0x0;_0xdad211<_0x1b9b45[_0x610d('0x3b')];_0xdad211+=0x1){var _0x42627d=_0x1b9b45[_0xdad211][_0x610d('0x2a')]({'plain':!![]});_0x4df8ec=squel['insert']()[_0x610d('0x6d')](_0x610d('0x91'))[_0x610d('0x7f')]([_0x610d('0x6f'),_0x610d('0x71'),'ListId',_0x610d('0x60'),_0x610d('0x57'),_0x610d('0x55')],squel[_0x610d('0x73')]()['field']('phone',_0x610d('0x6f'))[_0x610d('0x74')]('id',_0x610d('0x71'))[_0x610d('0x74')](_0x42627d['CmListId'][_0x610d('0x76')](),_0x610d('0x72'))[_0x610d('0x74')](_0x3be743[_0x610d('0x4b')]['id']['toString'](),_0x610d('0x60'))[_0x610d('0x74')](_0x610d('0x75'),_0x610d('0x57'))[_0x610d('0x74')](_0x610d('0x75'),_0x610d('0x55'))['from'](_0x610d('0x78'))['where'](_0x610d('0x79'))[_0x610d('0x42')](_0x610d('0x81'),_0x42627d[_0x610d('0x7a')]['toString']())[_0x610d('0x42')](_0x610d('0x7b')))[_0x610d('0x76')]();_0x8a5d2c['push'](db[_0x610d('0x89')]['query'](_0x4df8ec));}return BPromise[_0x610d('0x8b')](_0x8a5d2c);}})[_0x610d('0x29')](function(){return _0x3da964;})[_0x610d('0x29')](respondWithResult(_0x3b3fbe,null))[_0x610d('0x4a')](handleError(_0x3b3fbe,null));};exports[_0x610d('0x92')]=function(_0x563656,_0x46983b,_0x4c21fa){return db['Campaign'][_0x610d('0x4c')]({'where':{'id':_0x563656['params']['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x46983b,null))[_0x610d('0x29')](function(_0x41857a){if(_0x41857a){return _0x41857a[_0x610d('0x92')](_0x563656[_0x610d('0x36')][_0x610d('0x69')]);}})[_0x610d('0x29')](function(_0x56bd57){if(_0x56bd57){return db['CmHopperBlack'][_0x610d('0x28')]({'where':{'ListId':_0x563656[_0x610d('0x36')][_0x610d('0x69')],'CampaignId':_0x563656[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](function(){return _0x56bd57;});}})[_0x610d('0x29')](respondWithStatusCode(_0x46983b,null))['catch'](handleError(_0x46983b,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 40cb9df..d6903b0 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(_0x38d9cb,_0x30654d){var _0x15102a=function(_0x13db6b){while(--_0x13db6b){_0x38d9cb['push'](_0x38d9cb['shift']());}};_0x15102a(++_0x30654d);}(_0x7a54,0x106));var _0x47a5=function(_0x3cbaed,_0x118959){_0x3cbaed=_0x3cbaed-0x0;var _0x46ae24=_0x7a54[_0x3cbaed];return _0x46ae24;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 5a10437..074fc71 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 _0x6931=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0xf7db51,_0x362b44){var _0x442ae3=function(_0x2d011e){while(--_0x2d011e){_0xf7db51['push'](_0xf7db51['shift']());}};_0x442ae3(++_0x362b44);}(_0x6931,0xa5));var _0x1693=function(_0x2e5392,_0x61af7e){_0x2e5392=_0x2e5392-0x0;var _0x4dda58=_0x6931[_0x2e5392];return _0x4dda58;};'use strict';var _=require(_0x1693('0x0'));var util=require(_0x1693('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1693('0x2'));var fs=require('fs');var Redis=require(_0x1693('0x3'));var db=require(_0x1693('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1693('0x5'))(_0x1693('0x6'));var config=require(_0x1693('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1693('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3594e0,_0x45aa35,_0x328cfc){return new BPromise(function(_0x2ab0a0,_0x31bff8){return client[_0x1693('0x9')](_0x3594e0,_0x328cfc)[_0x1693('0xa')](function(_0x391134){logger[_0x1693('0xb')](_0x1693('0xc'),_0x45aa35,_0x1693('0xd'));logger[_0x1693('0xe')](_0x1693('0xf'),_0x45aa35,_0x1693('0xd'),JSON[_0x1693('0x10')](_0x391134));if(_0x391134[_0x1693('0x11')]){if(_0x391134['error'][_0x1693('0x12')]===0x1f4){logger['error'](_0x1693('0xc'),_0x45aa35,_0x391134[_0x1693('0x11')]['message']);return _0x31bff8(_0x391134[_0x1693('0x11')][_0x1693('0x13')]);}logger[_0x1693('0x11')]('Campaign,\x20%s,\x20%s',_0x45aa35,_0x391134[_0x1693('0x11')][_0x1693('0x13')]);return _0x2ab0a0(_0x391134[_0x1693('0x11')][_0x1693('0x13')]);}else{logger[_0x1693('0xb')](_0x1693('0xc'),_0x45aa35,_0x1693('0xd'));_0x2ab0a0(_0x391134[_0x1693('0x14')][_0x1693('0x13')]);}})[_0x1693('0x15')](function(_0x59cbff){logger[_0x1693('0x11')]('Campaign,\x20%s,\x20%s',_0x45aa35,_0x59cbff);_0x31bff8(_0x59cbff);});});}exports[_0x1693('0x16')]=function(_0x20906b){var _0x2ffa86=this;return new Promise(function(_0x410c3b,_0x3f5287){return db[_0x1693('0x17')][_0x1693('0x18')]({'raw':_0x20906b[_0x1693('0x19')]?_0x20906b[_0x1693('0x19')][_0x1693('0x1a')]===undefined?!![]:![]:!![],'where':_0x20906b[_0x1693('0x19')]?_0x20906b[_0x1693('0x19')][_0x1693('0x1b')]||null:null,'attributes':_0x20906b[_0x1693('0x19')]?_0x20906b[_0x1693('0x19')][_0x1693('0x1c')]||null:null,'limit':_0x20906b['options']?_0x20906b[_0x1693('0x19')][_0x1693('0x1d')]||null:null,'include':_0x20906b['options']?_0x20906b[_0x1693('0x19')][_0x1693('0x1e')]?_[_0x1693('0x1f')](_0x20906b[_0x1693('0x19')][_0x1693('0x1e')],function(_0x588ebe){return{'model':db[_0x588ebe[_0x1693('0x20')]],'as':_0x588ebe['as'],'attributes':_0x588ebe[_0x1693('0x1c')],'include':_0x588ebe[_0x1693('0x1e')]?_['map'](_0x588ebe[_0x1693('0x1e')],function(_0x28a1cc){return{'model':db[_0x28a1cc['model']],'as':_0x28a1cc['as'],'attributes':_0x28a1cc[_0x1693('0x1c')],'include':_0x28a1cc[_0x1693('0x1e')]?_['map'](_0x28a1cc['include'],function(_0x5655dd){return{'model':db[_0x5655dd[_0x1693('0x20')]],'as':_0x5655dd['as'],'attributes':_0x5655dd['attributes']};}):[]};}):[]};}):[]:[]})[_0x1693('0xa')](function(_0x3ee757){logger[_0x1693('0xb')](_0x1693('0x16'),_0x20906b);logger['debug'](_0x1693('0x16'),_0x20906b,JSON[_0x1693('0x10')](_0x3ee757));_0x410c3b(_0x3ee757);})['catch'](function(_0x37bce9){logger[_0x1693('0x11')](_0x1693('0x16'),_0x37bce9['message'],_0x20906b);_0x3f5287(_0x2ffa86[_0x1693('0x11')](0x1f4,_0x37bce9[_0x1693('0x13')]));});});};
\ No newline at end of file
+var _0x7daf=['limit','map','include','model','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','code','error','message','GetCampaign','Campaign','findAll','options','raw','where','attributes'];(function(_0x16e106,_0x19cb2e){var _0x598706=function(_0x13b2ac){while(--_0x13b2ac){_0x16e106['push'](_0x16e106['shift']());}};_0x598706(++_0x19cb2e);}(_0x7daf,0xaa));var _0xf7da=function(_0x1c6d4f,_0x37e880){_0x1c6d4f=_0x1c6d4f-0x0;var _0x2598af=_0x7daf[_0x1c6d4f];return _0x2598af;};'use strict';var _=require('lodash');var util=require(_0xf7da('0x0'));var moment=require('moment');var BPromise=require(_0xf7da('0x1'));var rs=require(_0xf7da('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7da('0x3'))['db'];var utils=require(_0xf7da('0x4'));var logger=require(_0xf7da('0x5'))(_0xf7da('0x6'));var config=require(_0xf7da('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf7da('0x8')][_0xf7da('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b35ec,_0x110cad,_0x2c70ad){return new BPromise(function(_0x468ca3,_0x53d71f){return client[_0xf7da('0xa')](_0x1b35ec,_0x2c70ad)[_0xf7da('0xb')](function(_0x326ff5){logger[_0xf7da('0xc')](_0xf7da('0xd'),_0x110cad,_0xf7da('0xe'));logger[_0xf7da('0xf')](_0xf7da('0x10'),_0x110cad,_0xf7da('0xe'),JSON[_0xf7da('0x11')](_0x326ff5));if(_0x326ff5['error']){if(_0x326ff5['error'][_0xf7da('0x12')]===0x1f4){logger[_0xf7da('0x13')](_0xf7da('0xd'),_0x110cad,_0x326ff5[_0xf7da('0x13')][_0xf7da('0x14')]);return _0x53d71f(_0x326ff5[_0xf7da('0x13')]['message']);}logger[_0xf7da('0x13')](_0xf7da('0xd'),_0x110cad,_0x326ff5['error'][_0xf7da('0x14')]);return _0x468ca3(_0x326ff5[_0xf7da('0x13')][_0xf7da('0x14')]);}else{logger[_0xf7da('0xc')](_0xf7da('0xd'),_0x110cad,_0xf7da('0xe'));_0x468ca3(_0x326ff5['result']['message']);}})['catch'](function(_0x39d9c0){logger[_0xf7da('0x13')](_0xf7da('0xd'),_0x110cad,_0x39d9c0);_0x53d71f(_0x39d9c0);});});}exports[_0xf7da('0x15')]=function(_0x336fca){var _0x1f3d53=this;return new Promise(function(_0xb75a2c,_0x13cd4a){return db[_0xf7da('0x16')][_0xf7da('0x17')]({'raw':_0x336fca[_0xf7da('0x18')]?_0x336fca[_0xf7da('0x18')][_0xf7da('0x19')]===undefined?!![]:![]:!![],'where':_0x336fca[_0xf7da('0x18')]?_0x336fca['options'][_0xf7da('0x1a')]||null:null,'attributes':_0x336fca[_0xf7da('0x18')]?_0x336fca[_0xf7da('0x18')][_0xf7da('0x1b')]||null:null,'limit':_0x336fca[_0xf7da('0x18')]?_0x336fca[_0xf7da('0x18')][_0xf7da('0x1c')]||null:null,'include':_0x336fca[_0xf7da('0x18')]?_0x336fca[_0xf7da('0x18')]['include']?_[_0xf7da('0x1d')](_0x336fca[_0xf7da('0x18')][_0xf7da('0x1e')],function(_0x4b627e){return{'model':db[_0x4b627e[_0xf7da('0x1f')]],'as':_0x4b627e['as'],'attributes':_0x4b627e[_0xf7da('0x1b')],'include':_0x4b627e[_0xf7da('0x1e')]?_[_0xf7da('0x1d')](_0x4b627e[_0xf7da('0x1e')],function(_0x9d2da){return{'model':db[_0x9d2da['model']],'as':_0x9d2da['as'],'attributes':_0x9d2da[_0xf7da('0x1b')],'include':_0x9d2da[_0xf7da('0x1e')]?_[_0xf7da('0x1d')](_0x9d2da['include'],function(_0x13ace4){return{'model':db[_0x13ace4[_0xf7da('0x1f')]],'as':_0x13ace4['as'],'attributes':_0x13ace4[_0xf7da('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf7da('0xb')](function(_0x13dc9f){logger['info'](_0xf7da('0x15'),_0x336fca);logger['debug'](_0xf7da('0x15'),_0x336fca,JSON[_0xf7da('0x11')](_0x13dc9f));_0xb75a2c(_0x13dc9f);})[_0xf7da('0x20')](function(_0x23a27e){logger['error'](_0xf7da('0x15'),_0x23a27e[_0xf7da('0x14')],_0x336fca);_0x13cd4a(_0x1f3d53[_0xf7da('0x13')](0x1f4,_0x23a27e[_0xf7da('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 73c6460..991ca4e 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 _0xccbe=['getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','put','/:id','update','delete','destroy','removeBlackLists','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xccbe,0xa4));var _0xeccb=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xccbe[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xeccb('0x0'));var timeout=require(_0xeccb('0x1'));var express=require('express');var router=express[_0xeccb('0x2')]();var fs_extra=require(_0xeccb('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xeccb('0x4'));var config=require(_0xeccb('0x5'));var controller=require('./campaign.controller');router[_0xeccb('0x6')]('/',auth[_0xeccb('0x7')](),controller[_0xeccb('0x8')]);router['get']('/:id',auth[_0xeccb('0x7')](),controller['show']);router[_0xeccb('0x6')]('/:id/hoppers',auth[_0xeccb('0x7')](),controller[_0xeccb('0x9')]);router[_0xeccb('0x6')](_0xeccb('0xa'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xeccb('0x6')](_0xeccb('0xb'),auth[_0xeccb('0x7')](),controller[_0xeccb('0xc')]);router[_0xeccb('0x6')](_0xeccb('0xd'),auth[_0xeccb('0x7')](),controller[_0xeccb('0xe')]);router[_0xeccb('0x6')](_0xeccb('0xf'),auth[_0xeccb('0x7')](),controller[_0xeccb('0x10')]);router[_0xeccb('0x6')](_0xeccb('0x11'),auth[_0xeccb('0x7')](),controller[_0xeccb('0x12')]);router[_0xeccb('0x13')]('/',auth[_0xeccb('0x7')](),controller['create']);router['post'](_0xeccb('0x14'),auth['isAuthenticated'](),controller[_0xeccb('0x15')]);router[_0xeccb('0x13')](_0xeccb('0xf'),auth['isAuthenticated'](),controller[_0xeccb('0x16')]);router[_0xeccb('0x13')](_0xeccb('0x11'),auth[_0xeccb('0x7')](),controller['addBlackLists']);router[_0xeccb('0x17')](_0xeccb('0x18'),auth[_0xeccb('0x7')](),controller[_0xeccb('0x19')]);router[_0xeccb('0x1a')](_0xeccb('0x18'),auth[_0xeccb('0x7')](),controller[_0xeccb('0x1b')]);router['delete'](_0xeccb('0xf'),auth[_0xeccb('0x7')](),controller['removeLists']);router['delete'](_0xeccb('0x11'),auth[_0xeccb('0x7')](),controller[_0xeccb('0x1c')]);module[_0xeccb('0x1d')]=router;
\ No newline at end of file
+var _0xb745=['getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','post','/:id/clone','clone','addLists','addBlackLists','put','/:id','delete','destroy','removeLists','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','show','/:id/hoppers'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb745,0xe0));var _0x5b74=function(_0x139154,_0x1548cf){_0x139154=_0x139154-0x0;var _0x5c2447=_0xb745[_0x139154];return _0x5c2447;};'use strict';var multer=require(_0x5b74('0x0'));var util=require(_0x5b74('0x1'));var path=require(_0x5b74('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5b74('0x3')]();var fs_extra=require(_0x5b74('0x4'));var auth=require(_0x5b74('0x5'));var interaction=require(_0x5b74('0x6'));var config=require(_0x5b74('0x7'));var controller=require(_0x5b74('0x8'));router['get']('/',auth[_0x5b74('0x9')](),controller[_0x5b74('0xa')]);router[_0x5b74('0xb')]('/:id',auth[_0x5b74('0x9')](),controller[_0x5b74('0xc')]);router['get'](_0x5b74('0xd'),auth[_0x5b74('0x9')](),controller[_0x5b74('0xe')]);router['get'](_0x5b74('0xf'),auth[_0x5b74('0x9')](),controller[_0x5b74('0x10')]);router[_0x5b74('0xb')](_0x5b74('0x11'),auth[_0x5b74('0x9')](),controller[_0x5b74('0x12')]);router[_0x5b74('0xb')](_0x5b74('0x13'),auth[_0x5b74('0x9')](),controller[_0x5b74('0x14')]);router[_0x5b74('0xb')](_0x5b74('0x15'),auth['isAuthenticated'](),controller['getLists']);router[_0x5b74('0xb')](_0x5b74('0x16'),auth[_0x5b74('0x9')](),controller['getBlackLists']);router[_0x5b74('0x17')]('/',auth[_0x5b74('0x9')](),controller['create']);router[_0x5b74('0x17')](_0x5b74('0x18'),auth[_0x5b74('0x9')](),controller[_0x5b74('0x19')]);router[_0x5b74('0x17')](_0x5b74('0x15'),auth[_0x5b74('0x9')](),controller[_0x5b74('0x1a')]);router[_0x5b74('0x17')](_0x5b74('0x16'),auth[_0x5b74('0x9')](),controller[_0x5b74('0x1b')]);router[_0x5b74('0x1c')](_0x5b74('0x1d'),auth[_0x5b74('0x9')](),controller['update']);router[_0x5b74('0x1e')](_0x5b74('0x1d'),auth['isAuthenticated'](),controller[_0x5b74('0x1f')]);router[_0x5b74('0x1e')](_0x5b74('0x15'),auth['isAuthenticated'](),controller[_0x5b74('0x20')]);router[_0x5b74('0x1e')]('/:id/blacklists',auth[_0x5b74('0x9')](),controller['removeBlackLists']);module[_0x5b74('0x21')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index fc50909..3c458ac 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 _0x4259=['VIRTUAL','getDataValue','key','STRING','TEXT','medium'];(function(_0xcfc44,_0x179bc1){var _0x307a25=function(_0x2b64de){while(--_0x2b64de){_0xcfc44['push'](_0xcfc44['shift']());}};_0x307a25(++_0x179bc1);}(_0x4259,0x19b));var _0x9425=function(_0x23e567,_0x317c3b){_0x23e567=_0x23e567-0x0;var _0x1fceaf=_0x4259[_0x23e567];return _0x1fceaf;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x9425('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0x9425('0x1')],'length':_0x9425('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x9425('0x0')]},'name':{'type':Sequelize[_0x9425('0x3')],'get':function(){return this[_0x9425('0x4')](_0x9425('0x5'));}}};
\ No newline at end of file
+var _0x7cf2=['TEXT','VIRTUAL','key','sequelize','exports','STRING'];(function(_0x3f2abd,_0x23b3a9){var _0x3d8338=function(_0x26d053){while(--_0x26d053){_0x3f2abd['push'](_0x3f2abd['shift']());}};_0x3d8338(++_0x23b3a9);}(_0x7cf2,0x93));var _0x27cf=function(_0x46306f,_0x5aef14){_0x46306f=_0x46306f-0x0;var _0x16a27f=_0x7cf2[_0x46306f];return _0x16a27f;};'use strict';var Sequelize=require(_0x27cf('0x0'));module[_0x27cf('0x1')]={'key':{'type':Sequelize[_0x27cf('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x27cf('0x3')],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x27cf('0x2')]},'name':{'type':Sequelize[_0x27cf('0x4')],'get':function(){return this['getDataValue'](_0x27cf('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 5a8c10c..4dea71c 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 _0x81f4=['UserProfileResource','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','CannedAnswers','sendStatus','stack','name','send','map','CannedAnswer','fieldName','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','params','options','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation'];(function(_0x5a8112,_0x465890){var _0x47d887=function(_0x21be3a){while(--_0x21be3a){_0x5a8112['push'](_0x5a8112['shift']());}};_0x47d887(++_0x465890);}(_0x81f4,0xb6));var _0x481f=function(_0x1680f2,_0x13f7b9){_0x1680f2=_0x1680f2-0x0;var _0x19d047=_0x81f4[_0x1680f2];return _0x19d047;};'use strict';var emlformat=require(_0x481f('0x0'));var rimraf=require(_0x481f('0x1'));var zipdir=require(_0x481f('0x2'));var jsonpatch=require(_0x481f('0x3'));var rp=require(_0x481f('0x4'));var moment=require(_0x481f('0x5'));var BPromise=require(_0x481f('0x6'));var Mustache=require(_0x481f('0x7'));var util=require(_0x481f('0x8'));var path=require(_0x481f('0x9'));var sox=require(_0x481f('0xa'));var csv=require(_0x481f('0xb'));var ejs=require(_0x481f('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x481f('0xd'));var crypto=require(_0x481f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x481f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x481f('0x10'));var Papa=require(_0x481f('0x11'));var Redis=require('ioredis');var authService=require(_0x481f('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x481f('0x13'));var logger=require('../../config/logger')(_0x481f('0x14'));var utils=require('../../config/utils');var config=require(_0x481f('0x15'));var licenseUtil=require(_0x481f('0x16'));var db=require(_0x481f('0x17'))['db'];function respondWithStatusCode(_0x131a80,_0x191d9f){_0x191d9f=_0x191d9f||0xcc;return function(_0x17510){if(_0x17510){return _0x131a80['sendStatus'](_0x191d9f);}return _0x131a80[_0x481f('0x18')](_0x191d9f)[_0x481f('0x19')]();};}function respondWithResult(_0xe9cb43,_0x56b77e){_0x56b77e=_0x56b77e||0xc8;return function(_0x54b308){if(_0x54b308){return _0xe9cb43['status'](_0x56b77e)[_0x481f('0x1a')](_0x54b308);}};}function respondWithFilteredResult(_0x36b2be,_0x2da707){return function(_0x5b27e2){if(_0x5b27e2){var _0x191c1e=typeof _0x2da707['offset']===_0x481f('0x1b')&&typeof _0x2da707['limit']===_0x481f('0x1b');var _0x3a6488=_0x5b27e2[_0x481f('0x1c')];var _0x1d89e3=_0x191c1e?0x0:_0x2da707['offset'];var _0x346ad6=_0x191c1e?_0x5b27e2['count']:_0x2da707[_0x481f('0x1d')]+_0x2da707[_0x481f('0x1e')];var _0x10ee2e;if(_0x346ad6>=_0x3a6488){_0x346ad6=_0x3a6488;_0x10ee2e=0xc8;}else{_0x10ee2e=0xce;}_0x36b2be[_0x481f('0x18')](_0x10ee2e);return _0x36b2be[_0x481f('0x1f')](_0x481f('0x20'),_0x1d89e3+'-'+_0x346ad6+'/'+_0x3a6488)['json'](_0x5b27e2);}return null;};}function patchUpdates(_0x13b429){return function(_0x4dd473){try{jsonpatch['apply'](_0x4dd473,_0x13b429,!![]);}catch(_0x5ec1c8){return BPromise[_0x481f('0x21')](_0x5ec1c8);}return _0x4dd473[_0x481f('0x22')]();};}function saveUpdates(_0x2359b0,_0x2e200b){return function(_0x527f9a){if(_0x527f9a){return _0x527f9a[_0x481f('0x23')](_0x2359b0)['then'](function(_0x91bd55){return _0x91bd55;});}return null;};}function removeEntity(_0x2e5ba8,_0x1e2d45){return function(_0x3fd3d3){if(_0x3fd3d3){return _0x3fd3d3[_0x481f('0x24')]()[_0x481f('0x25')](function(){var _0x1b68d2=_0x3fd3d3['get']({'plain':!![]});var _0x16fa31=_0x481f('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x16fa31,'resourceId':_0x1b68d2['id']}})[_0x481f('0x25')](function(){return _0x3fd3d3;});})[_0x481f('0x25')](function(){_0x2e5ba8[_0x481f('0x18')](0xcc)[_0x481f('0x19')]();});}};}function handleEntityNotFound(_0x5534aa,_0x216e7a){return function(_0x2e08a1){if(!_0x2e08a1){_0x5534aa[_0x481f('0x27')](0x194);}return _0x2e08a1;};}function handleError(_0x56f086,_0x5775ae){_0x5775ae=_0x5775ae||0x1f4;return function(_0x8537d2){logger['error'](_0x8537d2[_0x481f('0x28')]);if(_0x8537d2[_0x481f('0x29')]){delete _0x8537d2[_0x481f('0x29')];}_0x56f086[_0x481f('0x18')](_0x5775ae)[_0x481f('0x2a')](_0x8537d2);};}exports['index']=function(_0xb4de99,_0x573918){var _0x3ed034={},_0x5bd2b1={},_0x2fa5ce={'count':0x0,'rows':[]};var _0x5c031b=_[_0x481f('0x2b')](db[_0x481f('0x2c')]['rawAttributes'],function(_0x39ab70){return{'name':_0x39ab70[_0x481f('0x2d')],'type':_0x39ab70['type'][_0x481f('0x2e')]};});_0x5bd2b1['model']=_[_0x481f('0x2b')](_0x5c031b,_0x481f('0x29'));_0x5bd2b1[_0x481f('0x2f')]=_[_0x481f('0x30')](_0xb4de99[_0x481f('0x2f')]);_0x5bd2b1[_0x481f('0x31')]=_[_0x481f('0x32')](_0x5bd2b1['model'],_0x5bd2b1[_0x481f('0x2f')]);_0x3ed034[_0x481f('0x33')]=_['intersection'](_0x5bd2b1['model'],qs[_0x481f('0x34')](_0xb4de99[_0x481f('0x2f')][_0x481f('0x34')]));_0x3ed034[_0x481f('0x33')]=_0x3ed034[_0x481f('0x33')][_0x481f('0x35')]?_0x3ed034['attributes']:_0x5bd2b1[_0x481f('0x36')];if(!_0xb4de99[_0x481f('0x2f')][_0x481f('0x37')](_0x481f('0x38'))){_0x3ed034[_0x481f('0x1e')]=qs[_0x481f('0x1e')](_0xb4de99[_0x481f('0x2f')][_0x481f('0x1e')]);_0x3ed034['offset']=qs[_0x481f('0x1d')](_0xb4de99[_0x481f('0x2f')][_0x481f('0x1d')]);}_0x3ed034[_0x481f('0x39')]=qs[_0x481f('0x3a')](_0xb4de99[_0x481f('0x2f')][_0x481f('0x3a')]);_0x3ed034[_0x481f('0x3b')]=qs[_0x481f('0x31')](_[_0x481f('0x3c')](_0xb4de99['query'],_0x5bd2b1[_0x481f('0x31')]),_0x5c031b);if(_0xb4de99[_0x481f('0x2f')]['filter']){_0x3ed034[_0x481f('0x3b')]=_[_0x481f('0x3d')](_0x3ed034['where'],{'$or':[{'key':{'$like':'%'+_0xb4de99[_0x481f('0x2f')][_0x481f('0x3e')]+'%'}},{'value':{'$like':'%'+_0xb4de99['query'][_0x481f('0x3e')]+'%'}}]});}_0x3ed034=_['merge']({},_0x3ed034,_0xb4de99['options']);var _0x34d8ab={'where':_0x3ed034['where']};return db['CannedAnswer'][_0x481f('0x1c')](_0x34d8ab)['then'](function(_0x48949b){_0x2fa5ce['count']=_0x48949b;if(_0xb4de99['query'][_0x481f('0x3f')]){_0x3ed034[_0x481f('0x40')]=[{'all':!![]}];}return db['CannedAnswer'][_0x481f('0x41')](_0x3ed034);})[_0x481f('0x25')](function(_0x5019ba){_0x2fa5ce[_0x481f('0x42')]=_0x5019ba;return _0x2fa5ce;})['then'](respondWithFilteredResult(_0x573918,_0x3ed034))[_0x481f('0x43')](handleError(_0x573918,null));};exports['show']=function(_0xe1a390,_0x501fe1){var _0x58cc40={'raw':!![],'where':{'id':_0xe1a390[_0x481f('0x44')]['id']}},_0x159cbb={};_0x159cbb['model']=_[_0x481f('0x30')](db[_0x481f('0x2c')]['rawAttributes']);_0x159cbb[_0x481f('0x2f')]=_['keys'](_0xe1a390['query']);_0x159cbb[_0x481f('0x31')]=_[_0x481f('0x32')](_0x159cbb[_0x481f('0x36')],_0x159cbb['query']);_0x58cc40['attributes']=_[_0x481f('0x32')](_0x159cbb['model'],qs[_0x481f('0x34')](_0xe1a390[_0x481f('0x2f')][_0x481f('0x34')]));_0x58cc40[_0x481f('0x33')]=_0x58cc40[_0x481f('0x33')]['length']?_0x58cc40['attributes']:_0x159cbb['model'];if(_0xe1a390[_0x481f('0x2f')][_0x481f('0x3f')]){_0x58cc40['include']=[{'all':!![]}];}_0x58cc40=_[_0x481f('0x3d')]({},_0x58cc40,_0xe1a390[_0x481f('0x45')]);return db[_0x481f('0x2c')][_0x481f('0x46')](_0x58cc40)[_0x481f('0x25')](handleEntityNotFound(_0x501fe1,null))[_0x481f('0x25')](respondWithResult(_0x501fe1,null))[_0x481f('0x43')](handleError(_0x501fe1,null));};exports[_0x481f('0x23')]=function(_0x1f574e,_0x2303a8){if(_0x1f574e[_0x481f('0x47')]['id']){delete _0x1f574e['body']['id'];}return db[_0x481f('0x2c')][_0x481f('0x46')]({'where':{'id':_0x1f574e[_0x481f('0x44')]['id']}})['then'](handleEntityNotFound(_0x2303a8,null))[_0x481f('0x25')](saveUpdates(_0x1f574e[_0x481f('0x47')],null))[_0x481f('0x25')](respondWithResult(_0x2303a8,null))[_0x481f('0x43')](handleError(_0x2303a8,null));};exports[_0x481f('0x24')]=function(_0x529e7a,_0xfaa214){return db[_0x481f('0x2c')][_0x481f('0x46')]({'where':{'id':_0x529e7a[_0x481f('0x44')]['id']}})[_0x481f('0x25')](handleEntityNotFound(_0xfaa214,null))[_0x481f('0x25')](removeEntity(_0xfaa214,null))[_0x481f('0x43')](handleError(_0xfaa214,null));};exports['create']=function(_0x56cf3e,_0x1a3714){var _0x530497={'key':_0x56cf3e[_0x481f('0x47')][_0x481f('0x2e')]};if(_0x56cf3e['body'][_0x481f('0x48')]){_0x530497[_0x481f('0x48')]=_0x56cf3e[_0x481f('0x47')][_0x481f('0x48')];}else if(_0x56cf3e[_0x481f('0x47')][_0x481f('0x49')]){_0x530497[_0x481f('0x49')]=_0x56cf3e[_0x481f('0x47')][_0x481f('0x49')];}else if(_0x56cf3e[_0x481f('0x47')][_0x481f('0x4a')]){_0x530497[_0x481f('0x4a')]=_0x56cf3e[_0x481f('0x47')]['OpenchannelAccountId'];}else if(_0x56cf3e[_0x481f('0x47')][_0x481f('0x4b')]){_0x530497['ChatWebsiteId']=_0x56cf3e[_0x481f('0x47')][_0x481f('0x4b')];}return db[_0x481f('0x2c')][_0x481f('0x46')]({'where':_0x530497})['then'](function(_0x5f5011){if(_0x5f5011){throw new db[(_0x481f('0x4c'))][(_0x481f('0x4d'))](_0x481f('0x4e'));}return db[_0x481f('0x2c')]['create'](_0x56cf3e[_0x481f('0x47')]);})[_0x481f('0x25')](function(_0x2bc95e){var _0x51dca1=_0x56cf3e[_0x481f('0x4f')]['get']({'plain':!![]});if(!_0x51dca1)throw new Error(_0x481f('0x50'));if(_0x51dca1['role']===_0x481f('0x4f')){var _0x5ac879=_0x2bc95e[_0x481f('0x51')]({'plain':!![]});return db[_0x481f('0x52')][_0x481f('0x46')]({'where':{'name':'CannedAnswers','userProfileId':_0x51dca1[_0x481f('0x53')]},'raw':!![]})[_0x481f('0x25')](function(_0x17a3e0){if(_0x17a3e0&&_0x17a3e0[_0x481f('0x54')]===0x0){return db[_0x481f('0x55')][_0x481f('0x56')]({'name':_0x5ac879[_0x481f('0x29')],'resourceId':_0x5ac879['id'],'type':_0x17a3e0[_0x481f('0x29')],'sectionId':_0x17a3e0['id']},{})['then'](function(){return _0x2bc95e;});}else{return _0x2bc95e;}})['catch'](function(_0x3e7a03){logger[_0x481f('0x57')](_0x481f('0x58'),_0x3e7a03);throw _0x3e7a03;});}return _0x2bc95e;})['then'](respondWithResult(_0x1a3714,0xc9))[_0x481f('0x43')](handleError(_0x1a3714,null));};
\ No newline at end of file
+var _0xd807=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','then','get','CannedAnswers','UserProfileResource','error','name','send','map','CannedAnswer','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','intersection','length','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','eml-format','rimraf','zip-dir','request-promise'];(function(_0x5c562d,_0x34b2c9){var _0x2d3352=function(_0x5f3f04){while(--_0x5f3f04){_0x5c562d['push'](_0x5c562d['shift']());}};_0x2d3352(++_0x34b2c9);}(_0xd807,0x1a0));var _0x7d80=function(_0x1c4582,_0x4017f6){_0x1c4582=_0x1c4582-0x0;var _0x3bfdde=_0xd807[_0x1c4582];return _0x3bfdde;};'use strict';var emlformat=require(_0x7d80('0x0'));var rimraf=require(_0x7d80('0x1'));var zipdir=require(_0x7d80('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7d80('0x3'));var moment=require('moment');var BPromise=require(_0x7d80('0x4'));var Mustache=require(_0x7d80('0x5'));var util=require(_0x7d80('0x6'));var path=require(_0x7d80('0x7'));var sox=require(_0x7d80('0x8'));var csv=require(_0x7d80('0x9'));var ejs=require(_0x7d80('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d80('0xb'));var squel=require(_0x7d80('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7d80('0x9'));var querystring=require(_0x7d80('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7d80('0xe'));var qs=require(_0x7d80('0xf'));var as=require(_0x7d80('0x10'));var hardwareService=require(_0x7d80('0x11'));var logger=require(_0x7d80('0x12'))(_0x7d80('0x13'));var utils=require(_0x7d80('0x14'));var config=require(_0x7d80('0x15'));var licenseUtil=require(_0x7d80('0x16'));var db=require(_0x7d80('0x17'))['db'];function respondWithStatusCode(_0x1c9163,_0x15bcd4){_0x15bcd4=_0x15bcd4||0xcc;return function(_0x4dde7c){if(_0x4dde7c){return _0x1c9163[_0x7d80('0x18')](_0x15bcd4);}return _0x1c9163[_0x7d80('0x19')](_0x15bcd4)[_0x7d80('0x1a')]();};}function respondWithResult(_0x28cd54,_0x1486aa){_0x1486aa=_0x1486aa||0xc8;return function(_0x1b865f){if(_0x1b865f){return _0x28cd54['status'](_0x1486aa)[_0x7d80('0x1b')](_0x1b865f);}};}function respondWithFilteredResult(_0x582b9a,_0x31acae){return function(_0x42463d){if(_0x42463d){var _0x37e708=typeof _0x31acae[_0x7d80('0x1c')]===_0x7d80('0x1d')&&typeof _0x31acae['limit']===_0x7d80('0x1d');var _0x344980=_0x42463d[_0x7d80('0x1e')];var _0x1730c5=_0x37e708?0x0:_0x31acae['offset'];var _0x2117ff=_0x37e708?_0x42463d[_0x7d80('0x1e')]:_0x31acae['offset']+_0x31acae[_0x7d80('0x1f')];var _0x16523b;if(_0x2117ff>=_0x344980){_0x2117ff=_0x344980;_0x16523b=0xc8;}else{_0x16523b=0xce;}_0x582b9a[_0x7d80('0x19')](_0x16523b);return _0x582b9a[_0x7d80('0x20')](_0x7d80('0x21'),_0x1730c5+'-'+_0x2117ff+'/'+_0x344980)[_0x7d80('0x1b')](_0x42463d);}return null;};}function patchUpdates(_0x3bff4b){return function(_0x20a5a2){try{jsonpatch[_0x7d80('0x22')](_0x20a5a2,_0x3bff4b,!![]);}catch(_0x1609cd){return BPromise[_0x7d80('0x23')](_0x1609cd);}return _0x20a5a2['save']();};}function saveUpdates(_0xff7252,_0x57e580){return function(_0x3b7430){if(_0x3b7430){return _0x3b7430[_0x7d80('0x24')](_0xff7252)['then'](function(_0x137905){return _0x137905;});}return null;};}function removeEntity(_0x5afcec,_0x1bfee0){return function(_0x5a23bf){if(_0x5a23bf){return _0x5a23bf[_0x7d80('0x25')]()[_0x7d80('0x26')](function(){var _0x173875=_0x5a23bf[_0x7d80('0x27')]({'plain':!![]});var _0x2deeaa=_0x7d80('0x28');return db[_0x7d80('0x29')][_0x7d80('0x25')]({'where':{'type':_0x2deeaa,'resourceId':_0x173875['id']}})['then'](function(){return _0x5a23bf;});})[_0x7d80('0x26')](function(){_0x5afcec[_0x7d80('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24c716,_0x21e182){return function(_0x558da5){if(!_0x558da5){_0x24c716['sendStatus'](0x194);}return _0x558da5;};}function handleError(_0xe71da2,_0x380b53){_0x380b53=_0x380b53||0x1f4;return function(_0x57a7b0){logger[_0x7d80('0x2a')](_0x57a7b0['stack']);if(_0x57a7b0[_0x7d80('0x2b')]){delete _0x57a7b0[_0x7d80('0x2b')];}_0xe71da2['status'](_0x380b53)[_0x7d80('0x2c')](_0x57a7b0);};}exports['index']=function(_0x4a6971,_0x41341c){var _0x4346f0={},_0xa3ca0f={},_0x27bdce={'count':0x0,'rows':[]};var _0x5f1b2d=_[_0x7d80('0x2d')](db[_0x7d80('0x2e')]['rawAttributes'],function(_0x2ef52e){return{'name':_0x2ef52e[_0x7d80('0x2f')],'type':_0x2ef52e[_0x7d80('0x30')][_0x7d80('0x31')]};});_0xa3ca0f[_0x7d80('0x32')]=_[_0x7d80('0x2d')](_0x5f1b2d,_0x7d80('0x2b'));_0xa3ca0f[_0x7d80('0x33')]=_[_0x7d80('0x34')](_0x4a6971[_0x7d80('0x33')]);_0xa3ca0f[_0x7d80('0x35')]=_['intersection'](_0xa3ca0f[_0x7d80('0x32')],_0xa3ca0f[_0x7d80('0x33')]);_0x4346f0[_0x7d80('0x36')]=_['intersection'](_0xa3ca0f[_0x7d80('0x32')],qs[_0x7d80('0x37')](_0x4a6971[_0x7d80('0x33')][_0x7d80('0x37')]));_0x4346f0['attributes']=_0x4346f0[_0x7d80('0x36')]['length']?_0x4346f0[_0x7d80('0x36')]:_0xa3ca0f['model'];if(!_0x4a6971[_0x7d80('0x33')][_0x7d80('0x38')](_0x7d80('0x39'))){_0x4346f0['limit']=qs[_0x7d80('0x1f')](_0x4a6971['query'][_0x7d80('0x1f')]);_0x4346f0[_0x7d80('0x1c')]=qs[_0x7d80('0x1c')](_0x4a6971['query']['offset']);}_0x4346f0['order']=qs[_0x7d80('0x3a')](_0x4a6971[_0x7d80('0x33')]['sort']);_0x4346f0[_0x7d80('0x3b')]=qs['filters'](_[_0x7d80('0x3c')](_0x4a6971[_0x7d80('0x33')],_0xa3ca0f[_0x7d80('0x35')]),_0x5f1b2d);if(_0x4a6971[_0x7d80('0x33')][_0x7d80('0x3d')]){_0x4346f0[_0x7d80('0x3b')]=_[_0x7d80('0x3e')](_0x4346f0[_0x7d80('0x3b')],{'$or':[{'key':{'$like':'%'+_0x4a6971[_0x7d80('0x33')][_0x7d80('0x3d')]+'%'}},{'value':{'$like':'%'+_0x4a6971['query'][_0x7d80('0x3d')]+'%'}}]});}_0x4346f0=_[_0x7d80('0x3e')]({},_0x4346f0,_0x4a6971[_0x7d80('0x3f')]);var _0x54bb91={'where':_0x4346f0[_0x7d80('0x3b')]};return db['CannedAnswer'][_0x7d80('0x1e')](_0x54bb91)['then'](function(_0x53ccdf){_0x27bdce[_0x7d80('0x1e')]=_0x53ccdf;if(_0x4a6971[_0x7d80('0x33')][_0x7d80('0x40')]){_0x4346f0[_0x7d80('0x41')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x4346f0);})[_0x7d80('0x26')](function(_0x1af101){_0x27bdce['rows']=_0x1af101;return _0x27bdce;})[_0x7d80('0x26')](respondWithFilteredResult(_0x41341c,_0x4346f0))[_0x7d80('0x42')](handleError(_0x41341c,null));};exports[_0x7d80('0x43')]=function(_0x94b2f6,_0x24cebd){var _0x427600={'raw':!![],'where':{'id':_0x94b2f6[_0x7d80('0x44')]['id']}},_0x45c209={};_0x45c209[_0x7d80('0x32')]=_[_0x7d80('0x34')](db[_0x7d80('0x2e')]['rawAttributes']);_0x45c209['query']=_[_0x7d80('0x34')](_0x94b2f6['query']);_0x45c209[_0x7d80('0x35')]=_[_0x7d80('0x45')](_0x45c209[_0x7d80('0x32')],_0x45c209[_0x7d80('0x33')]);_0x427600[_0x7d80('0x36')]=_[_0x7d80('0x45')](_0x45c209['model'],qs['fields'](_0x94b2f6[_0x7d80('0x33')][_0x7d80('0x37')]));_0x427600['attributes']=_0x427600[_0x7d80('0x36')][_0x7d80('0x46')]?_0x427600[_0x7d80('0x36')]:_0x45c209['model'];if(_0x94b2f6['query']['includeAll']){_0x427600[_0x7d80('0x41')]=[{'all':!![]}];}_0x427600=_[_0x7d80('0x3e')]({},_0x427600,_0x94b2f6[_0x7d80('0x3f')]);return db[_0x7d80('0x2e')]['find'](_0x427600)[_0x7d80('0x26')](handleEntityNotFound(_0x24cebd,null))['then'](respondWithResult(_0x24cebd,null))[_0x7d80('0x42')](handleError(_0x24cebd,null));};exports[_0x7d80('0x24')]=function(_0x58a569,_0x2bd940){if(_0x58a569[_0x7d80('0x47')]['id']){delete _0x58a569[_0x7d80('0x47')]['id'];}return db[_0x7d80('0x2e')][_0x7d80('0x48')]({'where':{'id':_0x58a569['params']['id']}})[_0x7d80('0x26')](handleEntityNotFound(_0x2bd940,null))[_0x7d80('0x26')](saveUpdates(_0x58a569['body'],null))[_0x7d80('0x26')](respondWithResult(_0x2bd940,null))[_0x7d80('0x42')](handleError(_0x2bd940,null));};exports[_0x7d80('0x25')]=function(_0x415b38,_0x10dbe3){return db[_0x7d80('0x2e')]['find']({'where':{'id':_0x415b38[_0x7d80('0x44')]['id']}})[_0x7d80('0x26')](handleEntityNotFound(_0x10dbe3,null))['then'](removeEntity(_0x10dbe3,null))[_0x7d80('0x42')](handleError(_0x10dbe3,null));};exports[_0x7d80('0x49')]=function(_0x32bf97,_0xf7510){var _0x313c04={'key':_0x32bf97[_0x7d80('0x47')][_0x7d80('0x31')]};if(_0x32bf97[_0x7d80('0x47')][_0x7d80('0x4a')]){_0x313c04[_0x7d80('0x4a')]=_0x32bf97[_0x7d80('0x47')][_0x7d80('0x4a')];}else if(_0x32bf97[_0x7d80('0x47')]['SmsAccountId']){_0x313c04[_0x7d80('0x4b')]=_0x32bf97[_0x7d80('0x47')][_0x7d80('0x4b')];}else if(_0x32bf97['body'][_0x7d80('0x4c')]){_0x313c04[_0x7d80('0x4c')]=_0x32bf97[_0x7d80('0x47')]['OpenchannelAccountId'];}else if(_0x32bf97[_0x7d80('0x47')]['ChatWebsiteId']){_0x313c04[_0x7d80('0x4d')]=_0x32bf97[_0x7d80('0x47')][_0x7d80('0x4d')];}return db['CannedAnswer'][_0x7d80('0x48')]({'where':_0x313c04})[_0x7d80('0x26')](function(_0x2c8ae1){if(_0x2c8ae1){throw new db[(_0x7d80('0x4e'))][(_0x7d80('0x4f'))](_0x7d80('0x50'));}return db[_0x7d80('0x2e')][_0x7d80('0x49')](_0x32bf97['body']);})['then'](function(_0x5d3690){var _0x1aabe5=_0x32bf97[_0x7d80('0x51')][_0x7d80('0x27')]({'plain':!![]});if(!_0x1aabe5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1aabe5[_0x7d80('0x52')]===_0x7d80('0x51')){var _0x2aa054=_0x5d3690[_0x7d80('0x27')]({'plain':!![]});return db[_0x7d80('0x53')][_0x7d80('0x48')]({'where':{'name':_0x7d80('0x28'),'userProfileId':_0x1aabe5['userProfileId']},'raw':!![]})[_0x7d80('0x26')](function(_0x18eb22){if(_0x18eb22&&_0x18eb22['autoAssociation']===0x0){return db[_0x7d80('0x29')]['create']({'name':_0x2aa054[_0x7d80('0x2b')],'resourceId':_0x2aa054['id'],'type':_0x18eb22['name'],'sectionId':_0x18eb22['id']},{})['then'](function(){return _0x5d3690;});}else{return _0x5d3690;}})[_0x7d80('0x42')](function(_0x45c119){logger[_0x7d80('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45c119);throw _0x45c119;});}return _0x5d3690;})[_0x7d80('0x26')](respondWithResult(_0xf7510,0xc9))[_0x7d80('0x42')](handleError(_0xf7510,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 4a8519a..23feb9c 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 _0xaaf8=['moment','bluebird','request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','define','utf8mb4','util','api'];(function(_0x222f42,_0x21fa16){var _0x34c41d=function(_0x41ac2a){while(--_0x41ac2a){_0x222f42['push'](_0x222f42['shift']());}};_0x34c41d(++_0x21fa16);}(_0xaaf8,0x1ab));var _0x8aaf=function(_0x15f0e2,_0x22e3ee){_0x15f0e2=_0x15f0e2-0x0;var _0x21cc0c=_0xaaf8[_0x15f0e2];return _0x21cc0c;};'use strict';var _=require('lodash');var util=require(_0x8aaf('0x0'));var logger=require('../../config/logger')(_0x8aaf('0x1'));var moment=require(_0x8aaf('0x2'));var BPromise=require(_0x8aaf('0x3'));var rp=require(_0x8aaf('0x4'));var fs=require('fs');var path=require(_0x8aaf('0x5'));var rimraf=require('rimraf');var config=require(_0x8aaf('0x6'));var attributes=require(_0x8aaf('0x7'));module[_0x8aaf('0x8')]=function(_0x4d0a49,_0xc3fdc7){return _0x4d0a49[_0x8aaf('0x9')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8aaf('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x41e3=['bluebird','../../config/environment','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x49542d,_0x54ffb8){var _0x3a65d6=function(_0x48506f){while(--_0x48506f){_0x49542d['push'](_0x49542d['shift']());}};_0x3a65d6(++_0x54ffb8);}(_0x41e3,0x146));var _0x341e=function(_0x7290bf,_0x10acee){_0x7290bf=_0x7290bf-0x0;var _0x1027b6=_0x41e3[_0x7290bf];return _0x1027b6;};'use strict';var _=require(_0x341e('0x0'));var util=require(_0x341e('0x1'));var logger=require(_0x341e('0x2'))(_0x341e('0x3'));var moment=require('moment');var BPromise=require(_0x341e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x341e('0x5'));var attributes=require('./cannedAnswer.attributes');module[_0x341e('0x6')]=function(_0x50154b,_0x2b07ae){return _0x50154b[_0x341e('0x7')](_0x341e('0x8'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x341e('0x9'),'collate':_0x341e('0xa')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index fd9f43d..f40e3ec 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(_0x42676d,_0x14924a){var _0x920e=function(_0x1528d0){while(--_0x1528d0){_0x42676d['push'](_0x42676d['shift']());}};_0x920e(++_0x14924a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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(_0x29cbc6,_0x4661a2){var _0x19b727=function(_0x5609c4){while(--_0x5609c4){_0x29cbc6['push'](_0x29cbc6['shift']());}};_0x19b727(++_0x4661a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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 eae0b5f..bfe02f9 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 _0xdb7e=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb7e,0xb5));var _0xedb7=function(_0x9e049f,_0x4bfa95){_0x9e049f=_0x9e049f-0x0;var _0x2700b2=_0xdb7e[_0x9e049f];return _0x2700b2;};'use strict';var multer=require(_0xedb7('0x0'));var util=require(_0xedb7('0x1'));var path=require(_0xedb7('0x2'));var timeout=require(_0xedb7('0x3'));var express=require(_0xedb7('0x4'));var router=express['Router']();var fs_extra=require(_0xedb7('0x5'));var auth=require(_0xedb7('0x6'));var interaction=require(_0xedb7('0x7'));var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xedb7('0x8')](),controller[_0xedb7('0x9')]);router[_0xedb7('0xa')](_0xedb7('0xb'),auth['isAuthenticated'](),controller[_0xedb7('0xc')]);router[_0xedb7('0xd')]('/',auth['isAuthenticated'](),controller[_0xedb7('0xe')]);router[_0xedb7('0xf')]('/:id',auth[_0xedb7('0x8')](),controller[_0xedb7('0x10')]);router[_0xedb7('0x11')](_0xedb7('0xb'),auth['isAuthenticated'](),controller[_0xedb7('0x12')]);module[_0xedb7('0x13')]=router;
\ No newline at end of file
+var _0x68aa=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','fs-extra'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x68aa,0x1e1));var _0xa68a=function(_0x31ea0e,_0x115eee){_0x31ea0e=_0x31ea0e-0x0;var _0x215d56=_0x68aa[_0x31ea0e];return _0x215d56;};'use strict';var multer=require(_0xa68a('0x0'));var util=require('util');var path=require(_0xa68a('0x1'));var timeout=require(_0xa68a('0x2'));var express=require(_0xa68a('0x3'));var router=express['Router']();var fs_extra=require(_0xa68a('0x4'));var auth=require(_0xa68a('0x5'));var interaction=require(_0xa68a('0x6'));var config=require(_0xa68a('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xa68a('0x8')](),controller[_0xa68a('0x9')]);router[_0xa68a('0xa')]('/:id',auth[_0xa68a('0x8')](),controller[_0xa68a('0xb')]);router[_0xa68a('0xc')]('/',auth[_0xa68a('0x8')](),controller[_0xa68a('0xd')]);router[_0xa68a('0xe')]('/:id',auth[_0xa68a('0x8')](),controller[_0xa68a('0xf')]);router[_0xa68a('0x10')]('/:id',auth[_0xa68a('0x8')](),controller[_0xa68a('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index b4415a0..ec475fa 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 _0xb226=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0xb226,0x11c));var _0x6b22=function(_0x1d790b,_0x218767){_0x1d790b=_0x1d790b-0x0;var _0x4880e5=_0xb226[_0x1d790b];return _0x4880e5;};'use strict';var Sequelize=require(_0x6b22('0x0'));module[_0x6b22('0x1')]={'calldate':{'type':Sequelize[_0x6b22('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x6b22('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x6b22('0x3')]},'dcontext':{'type':Sequelize[_0x6b22('0x3')]},'channel':{'type':Sequelize[_0x6b22('0x3')]},'dstchannel':{'type':Sequelize[_0x6b22('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x6b22('0x3')]},'duration':{'type':Sequelize[_0x6b22('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x6b22('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6b22('0x3')]},'amaflags':{'type':Sequelize[_0x6b22('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x6b22('0x3')]},'userfield':{'type':Sequelize[_0x6b22('0x3')]},'uniqueid':{'type':Sequelize[_0x6b22('0x3')]},'linkedid':{'type':Sequelize[_0x6b22('0x3')]},'sequence':{'type':Sequelize[_0x6b22('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6b22('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xfb3f=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x4d7808,_0x702235){var _0x2f4977=function(_0x3c5e8c){while(--_0x3c5e8c){_0x4d7808['push'](_0x4d7808['shift']());}};_0x2f4977(++_0x702235);}(_0xfb3f,0xd9));var _0xffb3=function(_0x4541e4,_0x328d04){_0x4541e4=_0x4541e4-0x0;var _0x3d6418=_0xfb3f[_0x4541e4];return _0x3d6418;};'use strict';var Sequelize=require(_0xffb3('0x0'));module[_0xffb3('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xffb3('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xffb3('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xffb3('0x3')]},'dstchannel':{'type':Sequelize[_0xffb3('0x3')]},'lastapp':{'type':Sequelize[_0xffb3('0x3')]},'lastdata':{'type':Sequelize[_0xffb3('0x3')]},'duration':{'type':Sequelize[_0xffb3('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xffb3('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xffb3('0x3')]},'amaflags':{'type':Sequelize[_0xffb3('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xffb3('0x3')]},'uniqueid':{'type':Sequelize[_0xffb3('0x3')]},'linkedid':{'type':Sequelize[_0xffb3('0x3')]},'sequence':{'type':Sequelize[_0xffb3('0x3')]},'peeraccount':{'type':Sequelize[_0xffb3('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xffb3('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index d207570..ba6c4fd 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 _0xb458=['reject','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','Cdr','includeAll','rows','catch','show','include','find','create','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x422f6f,_0x1ffe7c){var _0x5564f6=function(_0x4488a6){while(--_0x4488a6){_0x422f6f['push'](_0x422f6f['shift']());}};_0x5564f6(++_0x1ffe7c);}(_0xb458,0x103));var _0x8b45=function(_0x31600c,_0x16295b){_0x31600c=_0x31600c-0x0;var _0x295cc1=_0xb458[_0x31600c];return _0x295cc1;};'use strict';var emlformat=require(_0x8b45('0x0'));var rimraf=require(_0x8b45('0x1'));var zipdir=require(_0x8b45('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8b45('0x3'));var BPromise=require(_0x8b45('0x4'));var Mustache=require(_0x8b45('0x5'));var util=require(_0x8b45('0x6'));var path=require('path');var sox=require(_0x8b45('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b45('0x8'));var _=require(_0x8b45('0x9'));var squel=require(_0x8b45('0xa'));var crypto=require(_0x8b45('0xb'));var jsforce=require(_0x8b45('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8b45('0xd'));var querystring=require(_0x8b45('0xe'));var Papa=require(_0x8b45('0xf'));var Redis=require(_0x8b45('0x10'));var authService=require(_0x8b45('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8b45('0x12'));var hardwareService=require(_0x8b45('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8b45('0x14'));var db=require(_0x8b45('0x15'))['db'];function respondWithStatusCode(_0x37c220,_0x52c4db){_0x52c4db=_0x52c4db||0xcc;return function(_0x30d38c){if(_0x30d38c){return _0x37c220[_0x8b45('0x16')](_0x52c4db);}return _0x37c220[_0x8b45('0x17')](_0x52c4db)[_0x8b45('0x18')]();};}function respondWithResult(_0x32babc,_0x2ad2ae){_0x2ad2ae=_0x2ad2ae||0xc8;return function(_0x5f0b20){if(_0x5f0b20){return _0x32babc['status'](_0x2ad2ae)[_0x8b45('0x19')](_0x5f0b20);}};}function respondWithFilteredResult(_0x23f1dd,_0x445170){return function(_0x39c1d1){if(_0x39c1d1){var _0x4781d7=typeof _0x445170[_0x8b45('0x1a')]===_0x8b45('0x1b')&&typeof _0x445170[_0x8b45('0x1c')]===_0x8b45('0x1b');var _0x391d1e=_0x39c1d1[_0x8b45('0x1d')];var _0x21d5b2=_0x4781d7?0x0:_0x445170[_0x8b45('0x1a')];var _0x43ffb7=_0x4781d7?_0x39c1d1[_0x8b45('0x1d')]:_0x445170[_0x8b45('0x1a')]+_0x445170[_0x8b45('0x1c')];var _0x309e23;if(_0x43ffb7>=_0x391d1e){_0x43ffb7=_0x391d1e;_0x309e23=0xc8;}else{_0x309e23=0xce;}_0x23f1dd['status'](_0x309e23);return _0x23f1dd[_0x8b45('0x1e')](_0x8b45('0x1f'),_0x21d5b2+'-'+_0x43ffb7+'/'+_0x391d1e)[_0x8b45('0x19')](_0x39c1d1);}return null;};}function patchUpdates(_0x46e21a){return function(_0x3e1438){try{jsonpatch[_0x8b45('0x20')](_0x3e1438,_0x46e21a,!![]);}catch(_0x2f4f1c){return BPromise[_0x8b45('0x21')](_0x2f4f1c);}return _0x3e1438['save']();};}function saveUpdates(_0x52f93f,_0x41154a){return function(_0x580e17){if(_0x580e17){return _0x580e17[_0x8b45('0x22')](_0x52f93f)[_0x8b45('0x23')](function(_0x30f405){return _0x30f405;});}return null;};}function removeEntity(_0x45e2db,_0x165570){return function(_0x2b8526){if(_0x2b8526){return _0x2b8526[_0x8b45('0x24')]()['then'](function(){_0x45e2db['status'](0xcc)[_0x8b45('0x18')]();});}};}function handleEntityNotFound(_0x2c2c06,_0x500044){return function(_0x5723a2){if(!_0x5723a2){_0x2c2c06[_0x8b45('0x16')](0x194);}return _0x5723a2;};}function handleError(_0x32f6f0,_0x2ca2d9){_0x2ca2d9=_0x2ca2d9||0x1f4;return function(_0x2f37bc){logger['error'](_0x2f37bc[_0x8b45('0x25')]);if(_0x2f37bc[_0x8b45('0x26')]){delete _0x2f37bc[_0x8b45('0x26')];}_0x32f6f0[_0x8b45('0x17')](_0x2ca2d9)[_0x8b45('0x27')](_0x2f37bc);};}exports[_0x8b45('0x28')]=function(_0x461017,_0x234f62){var _0x1733a7={},_0xf21bd1={},_0x339c73={'count':0x0,'rows':[]};var _0x1ba2d4=_[_0x8b45('0x29')](db['Cdr'][_0x8b45('0x2a')],function(_0x36db96){return{'name':_0x36db96[_0x8b45('0x2b')],'type':_0x36db96[_0x8b45('0x2c')][_0x8b45('0x2d')]};});_0xf21bd1[_0x8b45('0x2e')]=_[_0x8b45('0x29')](_0x1ba2d4,_0x8b45('0x26'));_0xf21bd1['query']=_[_0x8b45('0x2f')](_0x461017[_0x8b45('0x30')]);_0xf21bd1[_0x8b45('0x31')]=_[_0x8b45('0x32')](_0xf21bd1[_0x8b45('0x2e')],_0xf21bd1['query']);_0x1733a7[_0x8b45('0x33')]=_['intersection'](_0xf21bd1['model'],qs[_0x8b45('0x34')](_0x461017[_0x8b45('0x30')][_0x8b45('0x34')]));_0x1733a7[_0x8b45('0x33')]=_0x1733a7[_0x8b45('0x33')][_0x8b45('0x35')]?_0x1733a7['attributes']:_0xf21bd1[_0x8b45('0x2e')];if(!_0x461017[_0x8b45('0x30')][_0x8b45('0x36')](_0x8b45('0x37'))){_0x1733a7['limit']=qs[_0x8b45('0x1c')](_0x461017[_0x8b45('0x30')][_0x8b45('0x1c')]);_0x1733a7['offset']=qs[_0x8b45('0x1a')](_0x461017[_0x8b45('0x30')][_0x8b45('0x1a')]);}_0x1733a7['order']=qs[_0x8b45('0x38')](_0x461017[_0x8b45('0x30')][_0x8b45('0x38')]);_0x1733a7[_0x8b45('0x39')]=qs['filters'](_[_0x8b45('0x3a')](_0x461017[_0x8b45('0x30')],_0xf21bd1[_0x8b45('0x31')]),_0x1ba2d4);if(_0x461017[_0x8b45('0x30')][_0x8b45('0x3b')]){_0x1733a7[_0x8b45('0x39')]=_['merge'](_0x1733a7['where'],{'$or':_[_0x8b45('0x29')](_0x1ba2d4,function(_0x179f3b){if(_0x179f3b[_0x8b45('0x2c')]!==_0x8b45('0x3c')){var _0x23eb2e={};_0x23eb2e[_0x179f3b['name']]={'$like':'%'+_0x461017[_0x8b45('0x30')]['filter']+'%'};return _0x23eb2e;}})});}_0x1733a7=_[_0x8b45('0x3d')]({},_0x1733a7,_0x461017[_0x8b45('0x3e')]);var _0x5fae26={'where':_0x1733a7[_0x8b45('0x39')]};return db[_0x8b45('0x3f')][_0x8b45('0x1d')](_0x5fae26)[_0x8b45('0x23')](function(_0x1e9d50){_0x339c73[_0x8b45('0x1d')]=_0x1e9d50;if(_0x461017[_0x8b45('0x30')][_0x8b45('0x40')]){_0x1733a7['include']=[{'all':!![]}];}return db[_0x8b45('0x3f')]['findAll'](_0x1733a7);})[_0x8b45('0x23')](function(_0x4eda71){_0x339c73[_0x8b45('0x41')]=_0x4eda71;return _0x339c73;})[_0x8b45('0x23')](respondWithFilteredResult(_0x234f62,_0x1733a7))[_0x8b45('0x42')](handleError(_0x234f62,null));};exports[_0x8b45('0x43')]=function(_0x454cbc,_0x2770bc){var _0x58e663={'raw':!![],'where':{'id':_0x454cbc['params']['id']}},_0x6fbca4={};_0x6fbca4['model']=_[_0x8b45('0x2f')](db[_0x8b45('0x3f')][_0x8b45('0x2a')]);_0x6fbca4['query']=_[_0x8b45('0x2f')](_0x454cbc['query']);_0x6fbca4[_0x8b45('0x31')]=_[_0x8b45('0x32')](_0x6fbca4[_0x8b45('0x2e')],_0x6fbca4[_0x8b45('0x30')]);_0x58e663[_0x8b45('0x33')]=_[_0x8b45('0x32')](_0x6fbca4['model'],qs[_0x8b45('0x34')](_0x454cbc[_0x8b45('0x30')][_0x8b45('0x34')]));_0x58e663[_0x8b45('0x33')]=_0x58e663[_0x8b45('0x33')][_0x8b45('0x35')]?_0x58e663[_0x8b45('0x33')]:_0x6fbca4[_0x8b45('0x2e')];if(_0x454cbc[_0x8b45('0x30')][_0x8b45('0x40')]){_0x58e663[_0x8b45('0x44')]=[{'all':!![]}];}_0x58e663=_[_0x8b45('0x3d')]({},_0x58e663,_0x454cbc[_0x8b45('0x3e')]);return db[_0x8b45('0x3f')][_0x8b45('0x45')](_0x58e663)[_0x8b45('0x23')](handleEntityNotFound(_0x2770bc,null))['then'](respondWithResult(_0x2770bc,null))['catch'](handleError(_0x2770bc,null));};exports['create']=function(_0x308b0d,_0x214e28){return db[_0x8b45('0x3f')][_0x8b45('0x46')](_0x308b0d[_0x8b45('0x47')],{})[_0x8b45('0x23')](respondWithResult(_0x214e28,0xc9))[_0x8b45('0x42')](handleError(_0x214e28,null));};exports[_0x8b45('0x22')]=function(_0x5e2a03,_0x102d01){if(_0x5e2a03['body']['id']){delete _0x5e2a03[_0x8b45('0x47')]['id'];}return db[_0x8b45('0x3f')][_0x8b45('0x45')]({'where':{'id':_0x5e2a03[_0x8b45('0x48')]['id']}})['then'](handleEntityNotFound(_0x102d01,null))[_0x8b45('0x23')](saveUpdates(_0x5e2a03[_0x8b45('0x47')],null))['then'](respondWithResult(_0x102d01,null))[_0x8b45('0x42')](handleError(_0x102d01,null));};exports[_0x8b45('0x24')]=function(_0x52970c,_0xceb596){return db[_0x8b45('0x3f')][_0x8b45('0x45')]({'where':{'id':_0x52970c[_0x8b45('0x48')]['id']}})[_0x8b45('0x23')](handleEntityNotFound(_0xceb596,null))[_0x8b45('0x23')](removeEntity(_0xceb596,null))['catch'](handleError(_0xceb596,null));};exports['describe']=function(_0x3f7a16,_0x2a2e59){return db[_0x8b45('0x3f')]['describe']()[_0x8b45('0x23')](respondWithResult(_0x2a2e59,null))[_0x8b45('0x42')](handleError(_0x2a2e59,null));};
\ No newline at end of file
+var _0x6b8f=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','apply','reject','save','update','destroy','then','end','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','query','filters','intersection','model'];(function(_0x2f37e0,_0x393ef9){var _0x43ccce=function(_0x318b51){while(--_0x318b51){_0x2f37e0['push'](_0x2f37e0['shift']());}};_0x43ccce(++_0x393ef9);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x240878,_0x2069d2){_0x240878=_0x240878-0x0;var _0x3dce47=_0x6b8f[_0x240878];return _0x3dce47;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6b8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf6b8('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf6b8('0x2'));var Mustache=require(_0xf6b8('0x3'));var util=require('util');var path=require(_0xf6b8('0x4'));var sox=require(_0xf6b8('0x5'));var csv=require(_0xf6b8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6b8('0x7'));var _=require(_0xf6b8('0x8'));var squel=require(_0xf6b8('0x9'));var crypto=require(_0xf6b8('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf6b8('0x6'));var querystring=require('querystring');var Papa=require(_0xf6b8('0xb'));var Redis=require(_0xf6b8('0xc'));var authService=require(_0xf6b8('0xd'));var qs=require(_0xf6b8('0xe'));var as=require(_0xf6b8('0xf'));var hardwareService=require(_0xf6b8('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf6b8('0x11'));var licenseUtil=require(_0xf6b8('0x12'));var db=require(_0xf6b8('0x13'))['db'];function respondWithStatusCode(_0x1d96b9,_0x5a6118){_0x5a6118=_0x5a6118||0xcc;return function(_0x4e5235){if(_0x4e5235){return _0x1d96b9[_0xf6b8('0x14')](_0x5a6118);}return _0x1d96b9[_0xf6b8('0x15')](_0x5a6118)['end']();};}function respondWithResult(_0xfcecc9,_0x2db10c){_0x2db10c=_0x2db10c||0xc8;return function(_0x454d8a){if(_0x454d8a){return _0xfcecc9['status'](_0x2db10c)[_0xf6b8('0x16')](_0x454d8a);}};}function respondWithFilteredResult(_0x53d744,_0x410345){return function(_0x1ee041){if(_0x1ee041){var _0x2e1748=typeof _0x410345[_0xf6b8('0x17')]===_0xf6b8('0x18')&&typeof _0x410345['limit']==='undefined';var _0x3bb9ae=_0x1ee041['count'];var _0x3cf63c=_0x2e1748?0x0:_0x410345[_0xf6b8('0x17')];var _0x4a93a8=_0x2e1748?_0x1ee041['count']:_0x410345[_0xf6b8('0x17')]+_0x410345[_0xf6b8('0x19')];var _0x3081db;if(_0x4a93a8>=_0x3bb9ae){_0x4a93a8=_0x3bb9ae;_0x3081db=0xc8;}else{_0x3081db=0xce;}_0x53d744[_0xf6b8('0x15')](_0x3081db);return _0x53d744['set']('Content-Range',_0x3cf63c+'-'+_0x4a93a8+'/'+_0x3bb9ae)['json'](_0x1ee041);}return null;};}function patchUpdates(_0x3298a4){return function(_0x2a8195){try{jsonpatch[_0xf6b8('0x1a')](_0x2a8195,_0x3298a4,!![]);}catch(_0x56b48a){return BPromise[_0xf6b8('0x1b')](_0x56b48a);}return _0x2a8195[_0xf6b8('0x1c')]();};}function saveUpdates(_0x3d2c57,_0x9c660c){return function(_0x5dd616){if(_0x5dd616){return _0x5dd616[_0xf6b8('0x1d')](_0x3d2c57)['then'](function(_0x22c52d){return _0x22c52d;});}return null;};}function removeEntity(_0x2b5bd3,_0x13a451){return function(_0x4127c9){if(_0x4127c9){return _0x4127c9[_0xf6b8('0x1e')]()[_0xf6b8('0x1f')](function(){_0x2b5bd3['status'](0xcc)[_0xf6b8('0x20')]();});}};}function handleEntityNotFound(_0x1ebfea,_0x4815f7){return function(_0x205d6c){if(!_0x205d6c){_0x1ebfea[_0xf6b8('0x14')](0x194);}return _0x205d6c;};}function handleError(_0x324057,_0xd5ebb5){_0xd5ebb5=_0xd5ebb5||0x1f4;return function(_0x3365b8){logger['error'](_0x3365b8['stack']);if(_0x3365b8[_0xf6b8('0x21')]){delete _0x3365b8[_0xf6b8('0x21')];}_0x324057['status'](_0xd5ebb5)[_0xf6b8('0x22')](_0x3365b8);};}exports[_0xf6b8('0x23')]=function(_0x888319,_0x5a7f55){var _0x458935={},_0xc958f4={},_0x511896={'count':0x0,'rows':[]};var _0x309f04=_[_0xf6b8('0x24')](db[_0xf6b8('0x25')][_0xf6b8('0x26')],function(_0x51ffcf){return{'name':_0x51ffcf[_0xf6b8('0x27')],'type':_0x51ffcf[_0xf6b8('0x28')][_0xf6b8('0x29')]};});_0xc958f4['model']=_[_0xf6b8('0x24')](_0x309f04,_0xf6b8('0x21'));_0xc958f4[_0xf6b8('0x2a')]=_['keys'](_0x888319[_0xf6b8('0x2a')]);_0xc958f4[_0xf6b8('0x2b')]=_[_0xf6b8('0x2c')](_0xc958f4[_0xf6b8('0x2d')],_0xc958f4['query']);_0x458935[_0xf6b8('0x2e')]=_[_0xf6b8('0x2c')](_0xc958f4[_0xf6b8('0x2d')],qs['fields'](_0x888319['query'][_0xf6b8('0x2f')]));_0x458935[_0xf6b8('0x2e')]=_0x458935[_0xf6b8('0x2e')][_0xf6b8('0x30')]?_0x458935[_0xf6b8('0x2e')]:_0xc958f4[_0xf6b8('0x2d')];if(!_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x31')](_0xf6b8('0x32'))){_0x458935[_0xf6b8('0x19')]=qs[_0xf6b8('0x19')](_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x19')]);_0x458935[_0xf6b8('0x17')]=qs[_0xf6b8('0x17')](_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x17')]);}_0x458935[_0xf6b8('0x33')]=qs['sort'](_0x888319['query'][_0xf6b8('0x34')]);_0x458935[_0xf6b8('0x35')]=qs[_0xf6b8('0x2b')](_[_0xf6b8('0x36')](_0x888319[_0xf6b8('0x2a')],_0xc958f4[_0xf6b8('0x2b')]),_0x309f04);if(_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x37')]){_0x458935[_0xf6b8('0x35')]=_[_0xf6b8('0x38')](_0x458935[_0xf6b8('0x35')],{'$or':_[_0xf6b8('0x24')](_0x309f04,function(_0x4a8c49){if(_0x4a8c49[_0xf6b8('0x28')]!==_0xf6b8('0x39')){var _0x5d26ad={};_0x5d26ad[_0x4a8c49[_0xf6b8('0x21')]]={'$like':'%'+_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x37')]+'%'};return _0x5d26ad;}})});}_0x458935=_[_0xf6b8('0x38')]({},_0x458935,_0x888319[_0xf6b8('0x3a')]);var _0x87a4ee={'where':_0x458935[_0xf6b8('0x35')]};return db[_0xf6b8('0x25')][_0xf6b8('0x3b')](_0x87a4ee)[_0xf6b8('0x1f')](function(_0x15a63b){_0x511896[_0xf6b8('0x3b')]=_0x15a63b;if(_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x3c')]){_0x458935['include']=[{'all':!![]}];}return db['Cdr']['findAll'](_0x458935);})[_0xf6b8('0x1f')](function(_0x2c68f5){_0x511896[_0xf6b8('0x3d')]=_0x2c68f5;return _0x511896;})[_0xf6b8('0x1f')](respondWithFilteredResult(_0x5a7f55,_0x458935))[_0xf6b8('0x3e')](handleError(_0x5a7f55,null));};exports[_0xf6b8('0x3f')]=function(_0x1390dc,_0x48f4cb){var _0x1f5e72={'raw':!![],'where':{'id':_0x1390dc[_0xf6b8('0x40')]['id']}},_0x5086d9={};_0x5086d9[_0xf6b8('0x2d')]=_[_0xf6b8('0x41')](db[_0xf6b8('0x25')][_0xf6b8('0x26')]);_0x5086d9['query']=_[_0xf6b8('0x41')](_0x1390dc[_0xf6b8('0x2a')]);_0x5086d9[_0xf6b8('0x2b')]=_[_0xf6b8('0x2c')](_0x5086d9[_0xf6b8('0x2d')],_0x5086d9['query']);_0x1f5e72[_0xf6b8('0x2e')]=_[_0xf6b8('0x2c')](_0x5086d9[_0xf6b8('0x2d')],qs['fields'](_0x1390dc['query'][_0xf6b8('0x2f')]));_0x1f5e72[_0xf6b8('0x2e')]=_0x1f5e72[_0xf6b8('0x2e')][_0xf6b8('0x30')]?_0x1f5e72['attributes']:_0x5086d9['model'];if(_0x1390dc['query'][_0xf6b8('0x3c')]){_0x1f5e72['include']=[{'all':!![]}];}_0x1f5e72=_[_0xf6b8('0x38')]({},_0x1f5e72,_0x1390dc[_0xf6b8('0x3a')]);return db[_0xf6b8('0x25')][_0xf6b8('0x42')](_0x1f5e72)[_0xf6b8('0x1f')](handleEntityNotFound(_0x48f4cb,null))[_0xf6b8('0x1f')](respondWithResult(_0x48f4cb,null))[_0xf6b8('0x3e')](handleError(_0x48f4cb,null));};exports[_0xf6b8('0x43')]=function(_0x394a34,_0x597511){return db[_0xf6b8('0x25')]['create'](_0x394a34[_0xf6b8('0x44')],{})[_0xf6b8('0x1f')](respondWithResult(_0x597511,0xc9))[_0xf6b8('0x3e')](handleError(_0x597511,null));};exports[_0xf6b8('0x1d')]=function(_0x1abf17,_0x291845){if(_0x1abf17[_0xf6b8('0x44')]['id']){delete _0x1abf17['body']['id'];}return db[_0xf6b8('0x25')][_0xf6b8('0x42')]({'where':{'id':_0x1abf17[_0xf6b8('0x40')]['id']}})[_0xf6b8('0x1f')](handleEntityNotFound(_0x291845,null))['then'](saveUpdates(_0x1abf17[_0xf6b8('0x44')],null))[_0xf6b8('0x1f')](respondWithResult(_0x291845,null))['catch'](handleError(_0x291845,null));};exports[_0xf6b8('0x1e')]=function(_0x143164,_0x392582){return db[_0xf6b8('0x25')][_0xf6b8('0x42')]({'where':{'id':_0x143164['params']['id']}})[_0xf6b8('0x1f')](handleEntityNotFound(_0x392582,null))[_0xf6b8('0x1f')](removeEntity(_0x392582,null))['catch'](handleError(_0x392582,null));};exports['describe']=function(_0x55c392,_0x22c1eb){return db[_0xf6b8('0x25')][_0xf6b8('0x45')]()[_0xf6b8('0x1f')](respondWithResult(_0x22c1eb,null))['catch'](handleError(_0x22c1eb,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 81a6ba9..a6a4df2 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x488723,_0x1bba3b){var _0x517a0c=function(_0x186eae){while(--_0x186eae){_0x488723['push'](_0x488723['shift']());}};_0x517a0c(++_0x1bba3b);}(_0x7a54,0x106));var _0x47a5=function(_0x4acff3,_0x5bc3e9){_0x4acff3=_0x4acff3-0x0;var _0x21f9b1=_0x7a54[_0x4acff3];return _0x21f9b1;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x42a3c3,_0x5b5a81){var _0x18101c=function(_0x4c7312){while(--_0x4c7312){_0x42a3c3['push'](_0x42a3c3['shift']());}};_0x18101c(++_0x5b5a81);}(_0x7a54,0x106));var _0x47a5=function(_0x24eb62,_0x33e2d4){_0x24eb62=_0x24eb62-0x0;var _0x392d2f=_0x7a54[_0x24eb62];return _0x392d2f;};'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 a11a185..c25058e 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 _0x093e=['../../config/environment','client','http','request','then','info','Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x093e,0x149));var _0xe093=function(_0x13ec46,_0x44efb1){_0x13ec46=_0x13ec46-0x0;var _0x17ab99=_0x093e[_0x13ec46];return _0x17ab99;};'use strict';var _=require(_0xe093('0x0'));var util=require(_0xe093('0x1'));var moment=require(_0xe093('0x2'));var BPromise=require(_0xe093('0x3'));var rs=require(_0xe093('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe093('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe093('0x6'))('rpc');var config=require(_0xe093('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe093('0x8')][_0xe093('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x358381,_0x239097,_0x21cfc3){return new BPromise(function(_0x2c59f3,_0x2f0ea9){return client[_0xe093('0xa')](_0x358381,_0x21cfc3)[_0xe093('0xb')](function(_0x45e7bb){logger[_0xe093('0xc')](_0xe093('0xd'),_0x239097,'request\x20sent');logger['debug'](_0xe093('0xe'),_0x239097,'request\x20sent',JSON[_0xe093('0xf')](_0x45e7bb));if(_0x45e7bb[_0xe093('0x10')]){if(_0x45e7bb[_0xe093('0x10')][_0xe093('0x11')]===0x1f4){logger[_0xe093('0x10')](_0xe093('0xd'),_0x239097,_0x45e7bb[_0xe093('0x10')][_0xe093('0x12')]);return _0x2f0ea9(_0x45e7bb[_0xe093('0x10')][_0xe093('0x12')]);}logger['error'](_0xe093('0xd'),_0x239097,_0x45e7bb[_0xe093('0x10')][_0xe093('0x12')]);return _0x2c59f3(_0x45e7bb[_0xe093('0x10')][_0xe093('0x12')]);}else{logger[_0xe093('0xc')](_0xe093('0xd'),_0x239097,_0xe093('0x13'));_0x2c59f3(_0x45e7bb['result'][_0xe093('0x12')]);}})[_0xe093('0x14')](function(_0x3b943c){logger[_0xe093('0x10')]('Cdr,\x20%s,\x20%s',_0x239097,_0x3b943c);_0x2f0ea9(_0x3b943c);});});}
\ No newline at end of file
+var _0x30ea=['result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x6799a,_0x55da52){var _0x1bae93=function(_0x2168f3){while(--_0x2168f3){_0x6799a['push'](_0x6799a['shift']());}};_0x1bae93(++_0x55da52);}(_0x30ea,0xe9));var _0xa30e=function(_0x98eab9,_0x1f2132){_0x98eab9=_0x98eab9-0x0;var _0x238daa=_0x30ea[_0x98eab9];return _0x238daa;};'use strict';var _=require(_0xa30e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa30e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa30e('0x2'));var db=require(_0xa30e('0x3'))['db'];var utils=require(_0xa30e('0x4'));var logger=require(_0xa30e('0x5'))('rpc');var config=require(_0xa30e('0x6'));var jayson=require(_0xa30e('0x7'));var client=jayson[_0xa30e('0x8')][_0xa30e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x58b5ad,_0x6b0b6f,_0x3b2be2){return new BPromise(function(_0x10e36e,_0x3e40d3){return client[_0xa30e('0xa')](_0x58b5ad,_0x3b2be2)[_0xa30e('0xb')](function(_0x349c38){logger['info'](_0xa30e('0xc'),_0x6b0b6f,_0xa30e('0xd'));logger[_0xa30e('0xe')](_0xa30e('0xf'),_0x6b0b6f,_0xa30e('0xd'),JSON['stringify'](_0x349c38));if(_0x349c38[_0xa30e('0x10')]){if(_0x349c38[_0xa30e('0x10')]['code']===0x1f4){logger['error'](_0xa30e('0xc'),_0x6b0b6f,_0x349c38[_0xa30e('0x10')][_0xa30e('0x11')]);return _0x3e40d3(_0x349c38[_0xa30e('0x10')][_0xa30e('0x11')]);}logger[_0xa30e('0x10')]('Cdr,\x20%s,\x20%s',_0x6b0b6f,_0x349c38[_0xa30e('0x10')][_0xa30e('0x11')]);return _0x10e36e(_0x349c38[_0xa30e('0x10')][_0xa30e('0x11')]);}else{logger[_0xa30e('0x12')](_0xa30e('0xc'),_0x6b0b6f,_0xa30e('0xd'));_0x10e36e(_0x349c38[_0xa30e('0x13')][_0xa30e('0x11')]);}})[_0xa30e('0x14')](function(_0x4fe9e3){logger[_0xa30e('0x10')]('Cdr,\x20%s,\x20%s',_0x6b0b6f,_0x4fe9e3);_0x3e40d3(_0x4fe9e3);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 82601da..ae4b745 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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2c1859,_0x1a3db0){var _0x3663aa=function(_0x3bd0d1){while(--_0x3bd0d1){_0x2c1859['push'](_0x2c1859['shift']());}};_0x3663aa(++_0x1a3db0);}(_0xb10b,0x12a));var _0xbb10=function(_0x98ac1f,_0x2effb0){_0x98ac1f=_0x98ac1f-0x0;var _0x1579d1=_0xb10b[_0x98ac1f];return _0x1579d1;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 757ca82..a3e7fce 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 _0x4f9e=['STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x332026,_0x16c26f){var _0x34064d=function(_0x5e57ef){while(--_0x5e57ef){_0x332026['push'](_0x332026['shift']());}};_0x34064d(++_0x16c26f);}(_0x4f9e,0x99));var _0xe4f9=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x4f9e[_0x278e3c];return _0x3e2d9b;};'use strict';var Sequelize=require(_0xe4f9('0x0'));module[_0xe4f9('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xe4f9('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe4f9('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xe4f9('0x4')}};
\ No newline at end of file
+var _0x24e1=['*,*,*,*','sequelize','STRING','noop','TEXT'];(function(_0x51ffd6,_0xc0533a){var _0x9c28=function(_0x5325bf){while(--_0x5325bf){_0x51ffd6['push'](_0x51ffd6['shift']());}};_0x9c28(++_0xc0533a);}(_0x24e1,0xd8));var _0x124e=function(_0x3be7fb,_0x3f4f3f){_0x3be7fb=_0x3be7fb-0x0;var _0x2f6f14=_0x24e1[_0x3be7fb];return _0x2f6f14;};'use strict';var Sequelize=require(_0x124e('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x124e('0x1')],'allowNull':![],'defaultValue':_0x124e('0x2')},'appdata':{'type':Sequelize[_0x124e('0x3')]()},'description':{'type':Sequelize[_0x124e('0x1')]},'interval':{'type':Sequelize[_0x124e('0x1')],'defaultValue':_0x124e('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 66b19df..6839b47 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 _0xc7ea=['request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','name','send','show','params','model','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','fast-json-patch'];(function(_0x55e5cb,_0x3d0213){var _0x4a8ea1=function(_0xab0a29){while(--_0xab0a29){_0x55e5cb['push'](_0x55e5cb['shift']());}};_0x4a8ea1(++_0x3d0213);}(_0xc7ea,0x171));var _0xac7e=function(_0x562cc9,_0x1cb01e){_0x562cc9=_0x562cc9-0x0;var _0x5ddbf8=_0xc7ea[_0x562cc9];return _0x5ddbf8;};'use strict';var emlformat=require(_0xac7e('0x0'));var rimraf=require(_0xac7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xac7e('0x2'));var rp=require(_0xac7e('0x3'));var moment=require(_0xac7e('0x4'));var BPromise=require(_0xac7e('0x5'));var Mustache=require('mustache');var util=require(_0xac7e('0x6'));var path=require(_0xac7e('0x7'));var sox=require(_0xac7e('0x8'));var csv=require(_0xac7e('0x9'));var ejs=require(_0xac7e('0xa'));var fs=require('fs');var fs_extra=require(_0xac7e('0xb'));var _=require(_0xac7e('0xc'));var squel=require(_0xac7e('0xd'));var crypto=require(_0xac7e('0xe'));var jsforce=require(_0xac7e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xac7e('0x9'));var querystring=require(_0xac7e('0x10'));var Papa=require(_0xac7e('0x11'));var Redis=require(_0xac7e('0x12'));var authService=require(_0xac7e('0x13'));var qs=require(_0xac7e('0x14'));var as=require(_0xac7e('0x15'));var hardwareService=require(_0xac7e('0x16'));var logger=require(_0xac7e('0x17'))(_0xac7e('0x18'));var utils=require(_0xac7e('0x19'));var config=require(_0xac7e('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xac7e('0x1b'))['db'];function respondWithStatusCode(_0x13e126,_0x5d4537){_0x5d4537=_0x5d4537||0xcc;return function(_0x617cf9){if(_0x617cf9){return _0x13e126[_0xac7e('0x1c')](_0x5d4537);}return _0x13e126[_0xac7e('0x1d')](_0x5d4537)[_0xac7e('0x1e')]();};}function respondWithResult(_0x31a8e7,_0x52be09){_0x52be09=_0x52be09||0xc8;return function(_0x3486ac){if(_0x3486ac){return _0x31a8e7[_0xac7e('0x1d')](_0x52be09)[_0xac7e('0x1f')](_0x3486ac);}};}function respondWithFilteredResult(_0x41c055,_0x333436){return function(_0x232ce5){if(_0x232ce5){var _0x7ee114=typeof _0x333436[_0xac7e('0x20')]==='undefined'&&typeof _0x333436[_0xac7e('0x21')]===_0xac7e('0x22');var _0x95f21c=_0x232ce5[_0xac7e('0x23')];var _0x242889=_0x7ee114?0x0:_0x333436['offset'];var _0x2be7d7=_0x7ee114?_0x232ce5['count']:_0x333436[_0xac7e('0x20')]+_0x333436['limit'];var _0xa048e9;if(_0x2be7d7>=_0x95f21c){_0x2be7d7=_0x95f21c;_0xa048e9=0xc8;}else{_0xa048e9=0xce;}_0x41c055[_0xac7e('0x1d')](_0xa048e9);return _0x41c055[_0xac7e('0x24')](_0xac7e('0x25'),_0x242889+'-'+_0x2be7d7+'/'+_0x95f21c)[_0xac7e('0x1f')](_0x232ce5);}return null;};}function patchUpdates(_0x2ad784){return function(_0x4d23f9){try{jsonpatch[_0xac7e('0x26')](_0x4d23f9,_0x2ad784,!![]);}catch(_0x3c177d){return BPromise['reject'](_0x3c177d);}return _0x4d23f9[_0xac7e('0x27')]();};}function saveUpdates(_0x2ebc78,_0x2c3b6e){return function(_0x3ce3cc){if(_0x3ce3cc){return _0x3ce3cc[_0xac7e('0x28')](_0x2ebc78)[_0xac7e('0x29')](function(_0x45f7b6){return _0x45f7b6;});}return null;};}function removeEntity(_0x57abe8,_0x2b5f43){return function(_0x32ef52){if(_0x32ef52){return _0x32ef52[_0xac7e('0x2a')]()['then'](function(){_0x57abe8['status'](0xcc)[_0xac7e('0x1e')]();});}};}function handleEntityNotFound(_0x1ae3b4,_0x4620da){return function(_0x50b1e5){if(!_0x50b1e5){_0x1ae3b4[_0xac7e('0x1c')](0x194);}return _0x50b1e5;};}function handleError(_0x1de558,_0x2cafcb){_0x2cafcb=_0x2cafcb||0x1f4;return function(_0x3e0f1a){logger['error'](_0x3e0f1a['stack']);if(_0x3e0f1a[_0xac7e('0x2b')]){delete _0x3e0f1a['name'];}_0x1de558['status'](_0x2cafcb)[_0xac7e('0x2c')](_0x3e0f1a);};}exports[_0xac7e('0x2d')]=function(_0x3ecfc1,_0x4864d1){var _0x224259={'raw':!![],'where':{'id':_0x3ecfc1[_0xac7e('0x2e')]['id']}},_0x376247={};_0x376247[_0xac7e('0x2f')]=_['keys'](db[_0xac7e('0x30')][_0xac7e('0x31')]);_0x376247[_0xac7e('0x32')]=_['keys'](_0x3ecfc1[_0xac7e('0x32')]);_0x376247[_0xac7e('0x33')]=_[_0xac7e('0x34')](_0x376247[_0xac7e('0x2f')],_0x376247['query']);_0x224259[_0xac7e('0x35')]=_['intersection'](_0x376247[_0xac7e('0x2f')],qs[_0xac7e('0x36')](_0x3ecfc1[_0xac7e('0x32')]['fields']));_0x224259[_0xac7e('0x35')]=_0x224259[_0xac7e('0x35')]['length']?_0x224259['attributes']:_0x376247[_0xac7e('0x2f')];if(_0x3ecfc1[_0xac7e('0x32')][_0xac7e('0x37')]){_0x224259[_0xac7e('0x38')]=[{'all':!![]}];}_0x224259=_[_0xac7e('0x39')]({},_0x224259,_0x3ecfc1[_0xac7e('0x3a')]);return db[_0xac7e('0x30')][_0xac7e('0x3b')](_0x224259)[_0xac7e('0x29')](handleEntityNotFound(_0x4864d1,null))['then'](respondWithResult(_0x4864d1,null))[_0xac7e('0x3c')](handleError(_0x4864d1,null));};exports[_0xac7e('0x28')]=function(_0x1e3cc4,_0x38d61e){if(_0x1e3cc4[_0xac7e('0x3d')]['id']){delete _0x1e3cc4[_0xac7e('0x3d')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x1e3cc4[_0xac7e('0x2e')]['id']}})[_0xac7e('0x29')](handleEntityNotFound(_0x38d61e,null))[_0xac7e('0x29')](saveUpdates(_0x1e3cc4[_0xac7e('0x3d')],null))[_0xac7e('0x29')](respondWithResult(_0x38d61e,null))[_0xac7e('0x3c')](handleError(_0x38d61e,null));};exports[_0xac7e('0x2a')]=function(_0x2160cd,_0xacc6b9){return db['ChatApplication'][_0xac7e('0x3b')]({'where':{'id':_0x2160cd[_0xac7e('0x2e')]['id']}})['then'](handleEntityNotFound(_0xacc6b9,null))[_0xac7e('0x29')](removeEntity(_0xacc6b9,null))[_0xac7e('0x3c')](handleError(_0xacc6b9,null));};
\ No newline at end of file
+var _0xf69b=['apply','reject','update','then','destroy','sendStatus','error','stack','name','show','params','model','ChatApplication','rawAttributes','intersection','attributes','fields','length','query','includeAll','include','merge','options','find','catch','body','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range'];(function(_0x52ff2e,_0x392a70){var _0x903697=function(_0xa67638){while(--_0xa67638){_0x52ff2e['push'](_0x52ff2e['shift']());}};_0x903697(++_0x392a70);}(_0xf69b,0xc8));var _0xbf69=function(_0x44bb25,_0x11524d){_0x44bb25=_0x44bb25-0x0;var _0x55a226=_0xf69b[_0x44bb25];return _0x55a226;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf69('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf69('0x1'));var rp=require('request-promise');var moment=require(_0xbf69('0x2'));var BPromise=require(_0xbf69('0x3'));var Mustache=require(_0xbf69('0x4'));var util=require('util');var path=require(_0xbf69('0x5'));var sox=require('sox');var csv=require(_0xbf69('0x6'));var ejs=require(_0xbf69('0x7'));var fs=require('fs');var fs_extra=require(_0xbf69('0x8'));var _=require(_0xbf69('0x9'));var squel=require(_0xbf69('0xa'));var crypto=require(_0xbf69('0xb'));var jsforce=require(_0xbf69('0xc'));var deskjs=require(_0xbf69('0xd'));var toCsv=require(_0xbf69('0x6'));var querystring=require(_0xbf69('0xe'));var Papa=require('papaparse');var Redis=require(_0xbf69('0xf'));var authService=require(_0xbf69('0x10'));var qs=require(_0xbf69('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf69('0x12'));var logger=require(_0xbf69('0x13'))(_0xbf69('0x14'));var utils=require(_0xbf69('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xbf69('0x16'));var db=require(_0xbf69('0x17'))['db'];function respondWithStatusCode(_0x2edf93,_0x980232){_0x980232=_0x980232||0xcc;return function(_0x294fdb){if(_0x294fdb){return _0x2edf93['sendStatus'](_0x980232);}return _0x2edf93['status'](_0x980232)[_0xbf69('0x18')]();};}function respondWithResult(_0x514f81,_0x4d858a){_0x4d858a=_0x4d858a||0xc8;return function(_0x4bd76d){if(_0x4bd76d){return _0x514f81[_0xbf69('0x19')](_0x4d858a)[_0xbf69('0x1a')](_0x4bd76d);}};}function respondWithFilteredResult(_0x87c8a9,_0x4a44a5){return function(_0x1b7412){if(_0x1b7412){var _0x301fe7=typeof _0x4a44a5[_0xbf69('0x1b')]===_0xbf69('0x1c')&&typeof _0x4a44a5[_0xbf69('0x1d')]===_0xbf69('0x1c');var _0x342883=_0x1b7412[_0xbf69('0x1e')];var _0x307fbb=_0x301fe7?0x0:_0x4a44a5[_0xbf69('0x1b')];var _0x41e749=_0x301fe7?_0x1b7412[_0xbf69('0x1e')]:_0x4a44a5[_0xbf69('0x1b')]+_0x4a44a5[_0xbf69('0x1d')];var _0x191972;if(_0x41e749>=_0x342883){_0x41e749=_0x342883;_0x191972=0xc8;}else{_0x191972=0xce;}_0x87c8a9[_0xbf69('0x19')](_0x191972);return _0x87c8a9['set'](_0xbf69('0x1f'),_0x307fbb+'-'+_0x41e749+'/'+_0x342883)[_0xbf69('0x1a')](_0x1b7412);}return null;};}function patchUpdates(_0x331a3c){return function(_0x4998b7){try{jsonpatch[_0xbf69('0x20')](_0x4998b7,_0x331a3c,!![]);}catch(_0x3fcfd9){return BPromise[_0xbf69('0x21')](_0x3fcfd9);}return _0x4998b7['save']();};}function saveUpdates(_0x4cb86f,_0xc75cf){return function(_0x1e5cf1){if(_0x1e5cf1){return _0x1e5cf1[_0xbf69('0x22')](_0x4cb86f)[_0xbf69('0x23')](function(_0x3e0f36){return _0x3e0f36;});}return null;};}function removeEntity(_0x5de824,_0x14b4b0){return function(_0x49edb3){if(_0x49edb3){return _0x49edb3[_0xbf69('0x24')]()['then'](function(){_0x5de824[_0xbf69('0x19')](0xcc)[_0xbf69('0x18')]();});}};}function handleEntityNotFound(_0x10b9c0,_0x276a00){return function(_0x23bef3){if(!_0x23bef3){_0x10b9c0[_0xbf69('0x25')](0x194);}return _0x23bef3;};}function handleError(_0x1ff38b,_0xfb7055){_0xfb7055=_0xfb7055||0x1f4;return function(_0x7ad809){logger[_0xbf69('0x26')](_0x7ad809[_0xbf69('0x27')]);if(_0x7ad809[_0xbf69('0x28')]){delete _0x7ad809[_0xbf69('0x28')];}_0x1ff38b[_0xbf69('0x19')](_0xfb7055)['send'](_0x7ad809);};}exports[_0xbf69('0x29')]=function(_0x3c8f0a,_0x36c8e5){var _0x320585={'raw':!![],'where':{'id':_0x3c8f0a[_0xbf69('0x2a')]['id']}},_0x1711f7={};_0x1711f7[_0xbf69('0x2b')]=_['keys'](db[_0xbf69('0x2c')][_0xbf69('0x2d')]);_0x1711f7['query']=_['keys'](_0x3c8f0a['query']);_0x1711f7['filters']=_[_0xbf69('0x2e')](_0x1711f7[_0xbf69('0x2b')],_0x1711f7['query']);_0x320585[_0xbf69('0x2f')]=_[_0xbf69('0x2e')](_0x1711f7[_0xbf69('0x2b')],qs['fields'](_0x3c8f0a['query'][_0xbf69('0x30')]));_0x320585[_0xbf69('0x2f')]=_0x320585[_0xbf69('0x2f')][_0xbf69('0x31')]?_0x320585['attributes']:_0x1711f7[_0xbf69('0x2b')];if(_0x3c8f0a[_0xbf69('0x32')][_0xbf69('0x33')]){_0x320585[_0xbf69('0x34')]=[{'all':!![]}];}_0x320585=_[_0xbf69('0x35')]({},_0x320585,_0x3c8f0a[_0xbf69('0x36')]);return db[_0xbf69('0x2c')][_0xbf69('0x37')](_0x320585)['then'](handleEntityNotFound(_0x36c8e5,null))[_0xbf69('0x23')](respondWithResult(_0x36c8e5,null))[_0xbf69('0x38')](handleError(_0x36c8e5,null));};exports[_0xbf69('0x22')]=function(_0x5c41d7,_0x17ed4d){if(_0x5c41d7['body']['id']){delete _0x5c41d7['body']['id'];}return db[_0xbf69('0x2c')][_0xbf69('0x37')]({'where':{'id':_0x5c41d7['params']['id']}})['then'](handleEntityNotFound(_0x17ed4d,null))[_0xbf69('0x23')](saveUpdates(_0x5c41d7[_0xbf69('0x39')],null))[_0xbf69('0x23')](respondWithResult(_0x17ed4d,null))['catch'](handleError(_0x17ed4d,null));};exports[_0xbf69('0x24')]=function(_0x5908ed,_0x179971){return db['ChatApplication'][_0xbf69('0x37')]({'where':{'id':_0x5908ed['params']['id']}})['then'](handleEntityNotFound(_0x179971,null))[_0xbf69('0x23')](removeEntity(_0x179971,null))[_0xbf69('0x38')](handleError(_0x179971,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 042c636..88d5b73 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 _0x42cf=['moment','request-promise','rimraf','../../config/environment','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x42cf,0x11f));var _0xf42c=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x42cf[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0xf42c('0x0'));var util=require(_0xf42c('0x1'));var logger=require('../../config/logger')(_0xf42c('0x2'));var moment=require(_0xf42c('0x3'));var BPromise=require('bluebird');var rp=require(_0xf42c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf42c('0x5'));var config=require(_0xf42c('0x6'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x1cb366,_0x51292c){return _0x1cb366[_0xf42c('0x7')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf42c('0x8'),'collate':_0xf42c('0x9')});};
\ No newline at end of file
+var _0x0775=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications'];(function(_0x31e9b3,_0x39bc9b){var _0x3e7890=function(_0x4ec306){while(--_0x4ec306){_0x31e9b3['push'](_0x31e9b3['shift']());}};_0x3e7890(++_0x39bc9b);}(_0x0775,0x92));var _0x5077=function(_0x14a69f,_0x159b4e){_0x14a69f=_0x14a69f-0x0;var _0x4d542c=_0x0775[_0x14a69f];return _0x4d542c;};'use strict';var _=require(_0x5077('0x0'));var util=require(_0x5077('0x1'));var logger=require(_0x5077('0x2'))(_0x5077('0x3'));var moment=require(_0x5077('0x4'));var BPromise=require(_0x5077('0x5'));var rp=require(_0x5077('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5077('0x7'));var config=require(_0x5077('0x8'));var attributes=require(_0x5077('0x9'));module[_0x5077('0xa')]=function(_0xa0b89a,_0xecb868){return _0xa0b89a[_0x5077('0xb')](_0x5077('0xc'),attributes,{'tableName':_0x5077('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5077('0xe'),'collate':_0x5077('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index ae91ace..13ba2ab 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 _0xb8b6=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util'];(function(_0x6e420a,_0x2b93e2){var _0x115b00=function(_0x13e07a){while(--_0x13e07a){_0x6e420a['push'](_0x6e420a['shift']());}};_0x115b00(++_0x2b93e2);}(_0xb8b6,0x107));var _0x6b8b=function(_0x71d4a,_0x275eb3){_0x71d4a=_0x71d4a-0x0;var _0x1bff75=_0xb8b6[_0x71d4a];return _0x1bff75;};'use strict';var _=require('lodash');var util=require(_0x6b8b('0x0'));var moment=require(_0x6b8b('0x1'));var BPromise=require(_0x6b8b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b8b('0x3'));var db=require(_0x6b8b('0x4'))['db'];var utils=require(_0x6b8b('0x5'));var logger=require('../../config/logger')(_0x6b8b('0x6'));var config=require(_0x6b8b('0x7'));var jayson=require(_0x6b8b('0x8'));var client=jayson[_0x6b8b('0x9')][_0x6b8b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x342902,_0x1e9725,_0x4d2ab4){return new BPromise(function(_0x483e12,_0x2fcc5e){return client[_0x6b8b('0xb')](_0x342902,_0x4d2ab4)['then'](function(_0x5b890c){logger[_0x6b8b('0xc')](_0x6b8b('0xd'),_0x1e9725,_0x6b8b('0xe'));logger[_0x6b8b('0xf')](_0x6b8b('0x10'),_0x1e9725,'request\x20sent',JSON[_0x6b8b('0x11')](_0x5b890c));if(_0x5b890c[_0x6b8b('0x12')]){if(_0x5b890c[_0x6b8b('0x12')][_0x6b8b('0x13')]===0x1f4){logger[_0x6b8b('0x12')]('ChatApplication,\x20%s,\x20%s',_0x1e9725,_0x5b890c[_0x6b8b('0x12')]['message']);return _0x2fcc5e(_0x5b890c[_0x6b8b('0x12')][_0x6b8b('0x14')]);}logger[_0x6b8b('0x12')](_0x6b8b('0xd'),_0x1e9725,_0x5b890c['error'][_0x6b8b('0x14')]);return _0x483e12(_0x5b890c[_0x6b8b('0x12')]['message']);}else{logger[_0x6b8b('0xc')]('ChatApplication,\x20%s,\x20%s',_0x1e9725,'request\x20sent');_0x483e12(_0x5b890c[_0x6b8b('0x15')][_0x6b8b('0x14')]);}})['catch'](function(_0x5c9662){logger[_0x6b8b('0x12')](_0x6b8b('0xd'),_0x1e9725,_0x5c9662);_0x2fcc5e(_0x5c9662);});});}
\ No newline at end of file
+var _0x2d83=['jayson/promise','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x334627,_0x116072){var _0x53fddf=function(_0x1c3698){while(--_0x1c3698){_0x334627['push'](_0x334627['shift']());}};_0x53fddf(++_0x116072);}(_0x2d83,0x1f1));var _0x32d8=function(_0x5d9f13,_0x38cc73){_0x5d9f13=_0x5d9f13-0x0;var _0x3745d3=_0x2d83[_0x5d9f13];return _0x3745d3;};'use strict';var _=require(_0x32d8('0x0'));var util=require(_0x32d8('0x1'));var moment=require(_0x32d8('0x2'));var BPromise=require(_0x32d8('0x3'));var rs=require(_0x32d8('0x4'));var fs=require('fs');var Redis=require(_0x32d8('0x5'));var db=require(_0x32d8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x32d8('0x7'))(_0x32d8('0x8'));var config=require('../../config/environment');var jayson=require(_0x32d8('0x9'));var client=jayson['client'][_0x32d8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe94500,_0x3e28f8,_0x4e7e2c){return new BPromise(function(_0x768f22,_0x1c6d63){return client[_0x32d8('0xb')](_0xe94500,_0x4e7e2c)[_0x32d8('0xc')](function(_0xdd730b){logger['info'](_0x32d8('0xd'),_0x3e28f8,_0x32d8('0xe'));logger['debug'](_0x32d8('0xf'),_0x3e28f8,_0x32d8('0xe'),JSON[_0x32d8('0x10')](_0xdd730b));if(_0xdd730b[_0x32d8('0x11')]){if(_0xdd730b['error']['code']===0x1f4){logger[_0x32d8('0x11')]('ChatApplication,\x20%s,\x20%s',_0x3e28f8,_0xdd730b['error'][_0x32d8('0x12')]);return _0x1c6d63(_0xdd730b['error'][_0x32d8('0x12')]);}logger['error'](_0x32d8('0xd'),_0x3e28f8,_0xdd730b[_0x32d8('0x11')][_0x32d8('0x12')]);return _0x768f22(_0xdd730b[_0x32d8('0x11')][_0x32d8('0x12')]);}else{logger[_0x32d8('0x13')](_0x32d8('0xd'),_0x3e28f8,'request\x20sent');_0x768f22(_0xdd730b[_0x32d8('0x14')]['message']);}})[_0x32d8('0x15')](function(_0x579098){logger[_0x32d8('0x11')](_0x32d8('0xd'),_0x3e28f8,_0x579098);_0x1c6d63(_0x579098);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 6cc1a2e..de1e5c5 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 _0x200b=['Router','fs-extra','../../components/interaction/service','get','isAuthenticated','show','put','update','/:id','destroy','exports','multer','util','connect-timeout','express'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x200b,0x173));var _0xb200=function(_0x4e28db,_0x4ab3b5){_0x4e28db=_0x4e28db-0x0;var _0x5b4e65=_0x200b[_0x4e28db];return _0x5b4e65;};'use strict';var multer=require(_0xb200('0x0'));var util=require(_0xb200('0x1'));var path=require('path');var timeout=require(_0xb200('0x2'));var express=require(_0xb200('0x3'));var router=express[_0xb200('0x4')]();var fs_extra=require(_0xb200('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb200('0x6'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0xb200('0x7')]('/:id',auth[_0xb200('0x8')](),controller[_0xb200('0x9')]);router[_0xb200('0xa')]('/:id',auth[_0xb200('0x8')](),controller[_0xb200('0xb')]);router['delete'](_0xb200('0xc'),auth['isAuthenticated'](),controller[_0xb200('0xd')]);module[_0xb200('0xe')]=router;
\ No newline at end of file
+var _0x9dbe=['update','delete','destroy','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','put'];(function(_0x34d346,_0x4c6502){var _0x122d76=function(_0x22a5fd){while(--_0x22a5fd){_0x34d346['push'](_0x34d346['shift']());}};_0x122d76(++_0x4c6502);}(_0x9dbe,0x1b0));var _0xe9db=function(_0x4a0ebf,_0x55ba40){_0x4a0ebf=_0x4a0ebf-0x0;var _0x181f1e=_0x9dbe[_0x4a0ebf];return _0x181f1e;};'use strict';var multer=require('multer');var util=require(_0xe9db('0x0'));var path=require('path');var timeout=require(_0xe9db('0x1'));var express=require('express');var router=express[_0xe9db('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe9db('0x3'));var interaction=require(_0xe9db('0x4'));var config=require(_0xe9db('0x5'));var controller=require('./chatApplication.controller');router[_0xe9db('0x6')](_0xe9db('0x7'),auth[_0xe9db('0x8')](),controller['show']);router[_0xe9db('0x9')](_0xe9db('0x7'),auth['isAuthenticated'](),controller[_0xe9db('0xa')]);router[_0xe9db('0xb')](_0xe9db('0x7'),auth[_0xe9db('0x8')](),controller[_0xe9db('0xc')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index c9f272b..4c8d482 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 _0x7b84=['exports','STRING','sequelize'];(function(_0x4e9274,_0x49576e){var _0x8b474c=function(_0x204cca){while(--_0x204cca){_0x4e9274['push'](_0x4e9274['shift']());}};_0x8b474c(++_0x49576e);}(_0x7b84,0x167));var _0x47b8=function(_0x4e3a9c,_0x421cf8){_0x4e3a9c=_0x4e3a9c-0x0;var _0x116527=_0x7b84[_0x4e3a9c];return _0x116527;};'use strict';var Sequelize=require(_0x47b8('0x0'));module[_0x47b8('0x1')]={'name':{'type':Sequelize[_0x47b8('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xf39c=['STRING','sequelize','exports'];(function(_0x7db8aa,_0x4e5012){var _0x4e79af=function(_0x3a8070){while(--_0x3a8070){_0x7db8aa['push'](_0x7db8aa['shift']());}};_0x4e79af(++_0x4e5012);}(_0xf39c,0x16c));var _0xcf39=function(_0x2702b3,_0x4292f4){_0x2702b3=_0x2702b3-0x0;var _0x3c4731=_0xf39c[_0x2702b3];return _0x3c4731;};'use strict';var Sequelize=require(_0xcf39('0x0'));module[_0xcf39('0x1')]={'name':{'type':Sequelize[_0xcf39('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xcf39('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 2197c9f..52b70fc 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 _0x1c06=['findOne','ChatInternalMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','find','create','body','describe','getUnread','user','addMembers','ids','omit','getMembers','User','removeMembers','ChatGroupId','getMessages'];(function(_0x3c4a5d,_0x28c1c8){var _0x31b36a=function(_0x3a3634){while(--_0x3a3634){_0x3c4a5d['push'](_0x3c4a5d['shift']());}};_0x31b36a(++_0x28c1c8);}(_0x1c06,0xce));var _0x61c0=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x1c06[_0x4baae2];return _0x1a2285;};'use strict';var emlformat=require(_0x61c0('0x0'));var rimraf=require(_0x61c0('0x1'));var zipdir=require(_0x61c0('0x2'));var jsonpatch=require(_0x61c0('0x3'));var rp=require(_0x61c0('0x4'));var moment=require(_0x61c0('0x5'));var BPromise=require(_0x61c0('0x6'));var Mustache=require(_0x61c0('0x7'));var util=require(_0x61c0('0x8'));var path=require(_0x61c0('0x9'));var sox=require('sox');var csv=require(_0x61c0('0xa'));var ejs=require(_0x61c0('0xb'));var fs=require('fs');var fs_extra=require(_0x61c0('0xc'));var _=require(_0x61c0('0xd'));var squel=require(_0x61c0('0xe'));var crypto=require(_0x61c0('0xf'));var jsforce=require(_0x61c0('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x61c0('0xa'));var querystring=require(_0x61c0('0x11'));var Papa=require(_0x61c0('0x12'));var Redis=require(_0x61c0('0x13'));var authService=require(_0x61c0('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x61c0('0x15'));var hardwareService=require(_0x61c0('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x61c0('0x17'));var config=require(_0x61c0('0x18'));var licenseUtil=require(_0x61c0('0x19'));var db=require(_0x61c0('0x1a'))['db'];config['redis']=_[_0x61c0('0x1b')](config[_0x61c0('0x1c')],{'host':_0x61c0('0x1d'),'port':0x18eb});var socket=require(_0x61c0('0x1e'))(new Redis(config[_0x61c0('0x1c')]));require(_0x61c0('0x1f'))[_0x61c0('0x20')](socket);function respondWithStatusCode(_0x4216b2,_0x49bba2){_0x49bba2=_0x49bba2||0xcc;return function(_0x3c10d0){if(_0x3c10d0){return _0x4216b2[_0x61c0('0x21')](_0x49bba2);}return _0x4216b2['status'](_0x49bba2)[_0x61c0('0x22')]();};}function respondWithResult(_0x233fc0,_0x192644){_0x192644=_0x192644||0xc8;return function(_0x226724){if(_0x226724){return _0x233fc0[_0x61c0('0x23')](_0x192644)[_0x61c0('0x24')](_0x226724);}};}function respondWithFilteredResult(_0x175096,_0x3d6552){return function(_0x12f2e6){if(_0x12f2e6){var _0x522b89=typeof _0x3d6552['offset']===_0x61c0('0x25')&&typeof _0x3d6552[_0x61c0('0x26')]===_0x61c0('0x25');var _0x601b54=_0x12f2e6[_0x61c0('0x27')];var _0x1fd0cc=_0x522b89?0x0:_0x3d6552[_0x61c0('0x28')];var _0x3eff17=_0x522b89?_0x12f2e6['count']:_0x3d6552[_0x61c0('0x28')]+_0x3d6552[_0x61c0('0x26')];var _0x3bd6b3;if(_0x3eff17>=_0x601b54){_0x3eff17=_0x601b54;_0x3bd6b3=0xc8;}else{_0x3bd6b3=0xce;}_0x175096[_0x61c0('0x23')](_0x3bd6b3);return _0x175096['set'](_0x61c0('0x29'),_0x1fd0cc+'-'+_0x3eff17+'/'+_0x601b54)[_0x61c0('0x24')](_0x12f2e6);}return null;};}function patchUpdates(_0xbba82a){return function(_0x49bdc6){try{jsonpatch[_0x61c0('0x2a')](_0x49bdc6,_0xbba82a,!![]);}catch(_0x2ca004){return BPromise['reject'](_0x2ca004);}return _0x49bdc6[_0x61c0('0x2b')]();};}function saveUpdates(_0x3fb75f,_0x146fcc){return function(_0x39b50a){if(_0x39b50a){return _0x39b50a[_0x61c0('0x2c')](_0x3fb75f)[_0x61c0('0x2d')](function(_0x202f8d){return _0x202f8d;});}return null;};}function removeEntity(_0xd8e1b4,_0x5a9299){return function(_0x156b63){if(_0x156b63){return _0x156b63[_0x61c0('0x2e')]()[_0x61c0('0x2d')](function(){_0xd8e1b4['status'](0xcc)[_0x61c0('0x22')]();});}};}function handleEntityNotFound(_0x3d2fcc,_0x1cd854){return function(_0x3c4440){if(!_0x3c4440){_0x3d2fcc[_0x61c0('0x21')](0x194);}return _0x3c4440;};}function handleError(_0xc84e1e,_0x5e13f7){_0x5e13f7=_0x5e13f7||0x1f4;return function(_0x21ad56){logger['error'](_0x21ad56[_0x61c0('0x2f')]);if(_0x21ad56[_0x61c0('0x30')]){delete _0x21ad56[_0x61c0('0x30')];}_0xc84e1e[_0x61c0('0x23')](_0x5e13f7)[_0x61c0('0x31')](_0x21ad56);};}exports[_0x61c0('0x32')]=function(_0x5074a9,_0x364895){var _0x43d99c={},_0x720837={},_0x19567a={'count':0x0,'rows':[]};var _0x11b908=_[_0x61c0('0x33')](db[_0x61c0('0x34')][_0x61c0('0x35')],function(_0xf3d1e2){return{'name':_0xf3d1e2[_0x61c0('0x36')],'type':_0xf3d1e2['type'][_0x61c0('0x37')]};});_0x720837[_0x61c0('0x38')]=_[_0x61c0('0x33')](_0x11b908,_0x61c0('0x30'));_0x720837[_0x61c0('0x39')]=_[_0x61c0('0x3a')](_0x5074a9['query']);_0x720837[_0x61c0('0x3b')]=_[_0x61c0('0x3c')](_0x720837[_0x61c0('0x38')],_0x720837[_0x61c0('0x39')]);_0x43d99c[_0x61c0('0x3d')]=_[_0x61c0('0x3c')](_0x720837['model'],qs[_0x61c0('0x3e')](_0x5074a9[_0x61c0('0x39')][_0x61c0('0x3e')]));_0x43d99c[_0x61c0('0x3d')]=_0x43d99c[_0x61c0('0x3d')][_0x61c0('0x3f')]?_0x43d99c[_0x61c0('0x3d')]:_0x720837[_0x61c0('0x38')];if(!_0x5074a9['query'][_0x61c0('0x40')](_0x61c0('0x41'))){_0x43d99c[_0x61c0('0x26')]=qs[_0x61c0('0x26')](_0x5074a9['query']['limit']);_0x43d99c[_0x61c0('0x28')]=qs[_0x61c0('0x28')](_0x5074a9[_0x61c0('0x39')][_0x61c0('0x28')]);}_0x43d99c[_0x61c0('0x42')]=qs[_0x61c0('0x43')](_0x5074a9[_0x61c0('0x39')][_0x61c0('0x43')]);_0x43d99c[_0x61c0('0x44')]=qs[_0x61c0('0x3b')](_[_0x61c0('0x45')](_0x5074a9[_0x61c0('0x39')],_0x720837[_0x61c0('0x3b')]),_0x11b908);if(_0x5074a9[_0x61c0('0x39')]['filter']){_0x43d99c[_0x61c0('0x44')]=_[_0x61c0('0x46')](_0x43d99c[_0x61c0('0x44')],{'$or':_[_0x61c0('0x33')](_0x11b908,function(_0x4a9948){if(_0x4a9948[_0x61c0('0x47')]!==_0x61c0('0x48')){var _0x2b4f49={};_0x2b4f49[_0x4a9948[_0x61c0('0x30')]]={'$like':'%'+_0x5074a9[_0x61c0('0x39')][_0x61c0('0x49')]+'%'};return _0x2b4f49;}})});}_0x43d99c=_['merge']({},_0x43d99c,_0x5074a9[_0x61c0('0x4a')]);var _0xd259cf={'where':_0x43d99c['where']};return db[_0x61c0('0x34')][_0x61c0('0x27')](_0xd259cf)[_0x61c0('0x2d')](function(_0x2a4f06){_0x19567a['count']=_0x2a4f06;if(_0x5074a9[_0x61c0('0x39')][_0x61c0('0x4b')]){_0x43d99c[_0x61c0('0x4c')]=[{'all':!![]}];}return db[_0x61c0('0x34')][_0x61c0('0x4d')](_0x43d99c);})['then'](function(_0xd24916){_0x19567a['rows']=_0xd24916;return _0x19567a;})[_0x61c0('0x2d')](respondWithFilteredResult(_0x364895,_0x43d99c))[_0x61c0('0x4e')](handleError(_0x364895,null));};exports['show']=function(_0x5b2258,_0x29de52){var _0x3fe551={'raw':!![],'where':{'id':_0x5b2258[_0x61c0('0x4f')]['id']}},_0x1c400b={};_0x1c400b[_0x61c0('0x38')]=_[_0x61c0('0x3a')](db['ChatGroup'][_0x61c0('0x35')]);_0x1c400b['query']=_[_0x61c0('0x3a')](_0x5b2258[_0x61c0('0x39')]);_0x1c400b[_0x61c0('0x3b')]=_[_0x61c0('0x3c')](_0x1c400b['model'],_0x1c400b['query']);_0x3fe551['attributes']=_[_0x61c0('0x3c')](_0x1c400b['model'],qs['fields'](_0x5b2258[_0x61c0('0x39')]['fields']));_0x3fe551[_0x61c0('0x3d')]=_0x3fe551[_0x61c0('0x3d')][_0x61c0('0x3f')]?_0x3fe551[_0x61c0('0x3d')]:_0x1c400b[_0x61c0('0x38')];if(_0x5b2258[_0x61c0('0x39')][_0x61c0('0x4b')]){_0x3fe551[_0x61c0('0x4c')]=[{'all':!![]}];}_0x3fe551=_['merge']({},_0x3fe551,_0x5b2258[_0x61c0('0x4a')]);return db[_0x61c0('0x34')][_0x61c0('0x50')](_0x3fe551)['then'](handleEntityNotFound(_0x29de52,null))[_0x61c0('0x2d')](respondWithResult(_0x29de52,null))[_0x61c0('0x4e')](handleError(_0x29de52,null));};exports[_0x61c0('0x51')]=function(_0x1478ef,_0x2293ba){return db['ChatGroup'][_0x61c0('0x51')](_0x1478ef[_0x61c0('0x52')],{})[_0x61c0('0x2d')](respondWithResult(_0x2293ba,0xc9))['catch'](handleError(_0x2293ba,null));};exports[_0x61c0('0x2c')]=function(_0x305ea7,_0x43da02){if(_0x305ea7['body']['id']){delete _0x305ea7[_0x61c0('0x52')]['id'];}return db[_0x61c0('0x34')]['find']({'where':{'id':_0x305ea7[_0x61c0('0x4f')]['id']}})[_0x61c0('0x2d')](handleEntityNotFound(_0x43da02,null))['then'](saveUpdates(_0x305ea7['body'],null))[_0x61c0('0x2d')](respondWithResult(_0x43da02,null))[_0x61c0('0x4e')](handleError(_0x43da02,null));};exports[_0x61c0('0x2e')]=function(_0x5501e8,_0x16e9b8){return db['ChatGroup']['find']({'where':{'id':_0x5501e8['params']['id']}})[_0x61c0('0x2d')](handleEntityNotFound(_0x16e9b8,null))['then'](removeEntity(_0x16e9b8,null))[_0x61c0('0x4e')](handleError(_0x16e9b8,null));};exports['describe']=function(_0x4d1b3a,_0x25e33a){return db[_0x61c0('0x34')][_0x61c0('0x53')]()[_0x61c0('0x2d')](respondWithResult(_0x25e33a,null))[_0x61c0('0x4e')](handleError(_0x25e33a,null));};exports[_0x61c0('0x54')]=function(_0x573427,_0x5942b6,_0xdc2127){return db['ChatInternalMessage'][_0x61c0('0x27')]({'where':{'ChatGroupId':_0x573427['params']['id'],'ToId':_0x573427[_0x61c0('0x55')]['id'],'read':![]}})[_0x61c0('0x2d')](function(_0x2c525f){return{'id':_['toInteger'](_0x573427['params']['id']),'count':_0x2c525f};})['then'](respondWithResult(_0x5942b6,null))[_0x61c0('0x4e')](handleError(_0x5942b6,null));};exports[_0x61c0('0x56')]=function(_0x130304,_0x39af02,_0x2e03b8){return db[_0x61c0('0x34')]['find']({'where':{'id':_0x130304['params']['id']}})['then'](handleEntityNotFound(_0x39af02,null))[_0x61c0('0x2d')](function(_0x2f5b60){if(_0x2f5b60){return _0x2f5b60['addMembers'](_0x130304['body'][_0x61c0('0x57')],_[_0x61c0('0x58')](_0x130304[_0x61c0('0x52')],[_0x61c0('0x57'),'id'])||{});}})[_0x61c0('0x2d')](respondWithResult(_0x39af02,null))[_0x61c0('0x4e')](handleError(_0x39af02,null));};exports[_0x61c0('0x59')]=function(_0x38e0e0,_0x1f1f95,_0x3b11f1){var _0x2751af={};var _0x3bf721={};var _0x57c682;var _0x37dc7b;return db[_0x61c0('0x34')]['findOne']({'where':{'id':_0x38e0e0['params']['id']}})[_0x61c0('0x2d')](handleEntityNotFound(_0x1f1f95,null))[_0x61c0('0x2d')](function(_0x917804){if(_0x917804){_0x57c682=_0x917804;_0x3bf721[_0x61c0('0x38')]=_[_0x61c0('0x3a')](db[_0x61c0('0x5a')][_0x61c0('0x35')]);_0x3bf721[_0x61c0('0x39')]=_[_0x61c0('0x3a')](_0x38e0e0[_0x61c0('0x39')]);_0x3bf721['filters']=_['intersection'](_0x3bf721[_0x61c0('0x38')],_0x3bf721[_0x61c0('0x39')]);_0x2751af['attributes']=_[_0x61c0('0x3c')](_0x3bf721[_0x61c0('0x38')],qs[_0x61c0('0x3e')](_0x38e0e0['query'][_0x61c0('0x3e')]));_0x2751af[_0x61c0('0x3d')]=_0x2751af[_0x61c0('0x3d')]['length']?_0x2751af[_0x61c0('0x3d')]:_0x3bf721[_0x61c0('0x38')];_0x2751af['order']=qs['sort'](_0x38e0e0['query']['sort']);_0x2751af[_0x61c0('0x44')]=qs[_0x61c0('0x3b')](_[_0x61c0('0x45')](_0x38e0e0[_0x61c0('0x39')],_0x3bf721[_0x61c0('0x3b')]));if(_0x38e0e0[_0x61c0('0x39')]['filter']){_0x2751af['where']=_[_0x61c0('0x46')](_0x2751af[_0x61c0('0x44')],{'$or':_['map'](_0x2751af[_0x61c0('0x3d')],function(_0x3cd882){var _0x59b396={};_0x59b396[_0x3cd882]={'$like':'%'+_0x38e0e0[_0x61c0('0x39')]['filter']+'%'};return _0x59b396;})});}_0x2751af=_[_0x61c0('0x46')]({},_0x2751af,_0x38e0e0[_0x61c0('0x4a')]);return _0x57c682[_0x61c0('0x59')](_0x2751af);}})[_0x61c0('0x2d')](function(_0x44d0a5){if(_0x44d0a5){_0x37dc7b=_0x44d0a5[_0x61c0('0x3f')];if(!_0x38e0e0[_0x61c0('0x39')]['hasOwnProperty'](_0x61c0('0x41'))){_0x2751af[_0x61c0('0x26')]=qs[_0x61c0('0x26')](_0x38e0e0['query']['limit']);_0x2751af[_0x61c0('0x28')]=qs[_0x61c0('0x28')](_0x38e0e0[_0x61c0('0x39')][_0x61c0('0x28')]);}return _0x57c682[_0x61c0('0x59')](_0x2751af);}})[_0x61c0('0x2d')](function(_0x3303cd){if(_0x3303cd){return _0x3303cd?{'count':_0x37dc7b,'rows':_0x3303cd}:null;}})[_0x61c0('0x2d')](respondWithResult(_0x1f1f95,null))[_0x61c0('0x4e')](handleError(_0x1f1f95,null));};exports[_0x61c0('0x5b')]=function(_0x4ae8ca,_0x16d6b4,_0x280cba){return db[_0x61c0('0x34')][_0x61c0('0x50')]({'where':{'id':_0x4ae8ca[_0x61c0('0x4f')]['id']}})[_0x61c0('0x2d')](handleEntityNotFound(_0x16d6b4,null))['then'](function(_0x1a52af){if(_0x1a52af){return _0x1a52af[_0x61c0('0x5b')](_0x4ae8ca[_0x61c0('0x39')][_0x61c0('0x57')]);}})[_0x61c0('0x2d')](respondWithStatusCode(_0x16d6b4,null))[_0x61c0('0x4e')](handleError(_0x16d6b4,null));};exports['addMessage']=function(_0x2a6673,_0x557260,_0x1463c0){if(_0x2a6673[_0x61c0('0x52')]['id']){delete _0x2a6673[_0x61c0('0x52')]['id'];}return db[_0x61c0('0x34')][_0x61c0('0x50')]({'where':{'id':_0x2a6673[_0x61c0('0x4f')]['id']}})[_0x61c0('0x2d')](handleEntityNotFound(_0x557260,null))['then'](function(_0x41517d){if(_0x41517d){_0x2a6673[_0x61c0('0x52')][_0x61c0('0x5c')]=_0x41517d['id'];return db['ChatInternalMessage'][_0x61c0('0x51')](_0x2a6673[_0x61c0('0x52')]);}})['then'](respondWithResult(_0x557260,null))[_0x61c0('0x4e')](handleError(_0x557260,null));};exports[_0x61c0('0x5d')]=function(_0x3326bc,_0x1e855b,_0x4984b7){var _0x1e1bc3={};var _0x76e7bd={};var _0x5be670;var _0x54584d;return db[_0x61c0('0x34')][_0x61c0('0x5e')]({'where':{'id':_0x3326bc['params']['id']}})[_0x61c0('0x2d')](handleEntityNotFound(_0x1e855b,null))[_0x61c0('0x2d')](function(_0x18eec2){if(_0x18eec2){_0x5be670=_0x18eec2;_0x76e7bd[_0x61c0('0x38')]=_[_0x61c0('0x3a')](db[_0x61c0('0x5f')]['rawAttributes']);_0x76e7bd[_0x61c0('0x39')]=_['keys'](_0x3326bc[_0x61c0('0x39')]);_0x76e7bd['filters']=_[_0x61c0('0x3c')](_0x76e7bd[_0x61c0('0x38')],_0x76e7bd[_0x61c0('0x39')]);_0x1e1bc3[_0x61c0('0x3d')]=_[_0x61c0('0x3c')](_0x76e7bd['model'],qs['fields'](_0x3326bc['query'][_0x61c0('0x3e')]));_0x1e1bc3[_0x61c0('0x3d')]=_0x1e1bc3[_0x61c0('0x3d')]['length']?_0x1e1bc3[_0x61c0('0x3d')]:_0x76e7bd['model'];_0x1e1bc3[_0x61c0('0x42')]=qs[_0x61c0('0x43')](_0x3326bc[_0x61c0('0x39')]['sort']);_0x1e1bc3[_0x61c0('0x44')]=qs[_0x61c0('0x3b')](_['pick'](_0x3326bc['query'],_0x76e7bd[_0x61c0('0x3b')]));if(_0x3326bc[_0x61c0('0x39')]['filter']){_0x1e1bc3[_0x61c0('0x44')]=_['merge'](_0x1e1bc3[_0x61c0('0x44')],{'$or':_[_0x61c0('0x33')](_0x1e1bc3['attributes'],function(_0x27dfff){var _0x21256e={};_0x21256e[_0x27dfff]={'$like':'%'+_0x3326bc['query'][_0x61c0('0x49')]+'%'};return _0x21256e;})});}if(_0x3326bc[_0x61c0('0x39')]['$gte']){var _0x3f3dea=_0x3326bc[_0x61c0('0x39')][_0x61c0('0x60')][_0x61c0('0x61')](',');var _0x168363={};_0x168363[_0x3f3dea[0x0]]={'$gte':moment(_0x3f3dea[0x1])[_0x61c0('0x62')](_0x61c0('0x63'))};_0x1e1bc3[_0x61c0('0x44')]=_[_0x61c0('0x46')](_0x1e1bc3['where'],_0x168363);}_0x1e1bc3=_[_0x61c0('0x46')]({},_0x1e1bc3,_0x3326bc[_0x61c0('0x4a')]);return _0x5be670[_0x61c0('0x5d')](_0x1e1bc3);}})['then'](function(_0x3d5791){if(_0x3d5791){_0x54584d=_0x3d5791[_0x61c0('0x3f')];if(!_0x3326bc['query'][_0x61c0('0x40')](_0x61c0('0x41'))){_0x1e1bc3[_0x61c0('0x26')]=qs['limit'](_0x3326bc[_0x61c0('0x39')][_0x61c0('0x26')]);_0x1e1bc3['offset']=qs[_0x61c0('0x28')](_0x3326bc[_0x61c0('0x39')][_0x61c0('0x28')]);}return _0x5be670[_0x61c0('0x5d')](_0x1e1bc3);}})[_0x61c0('0x2d')](function(_0x1f8508){if(_0x1f8508){return _0x1f8508?{'count':_0x54584d,'rows':_0x1f8508}:null;}})[_0x61c0('0x2d')](respondWithResult(_0x1e855b,null))[_0x61c0('0x4e')](handleError(_0x1e855b,null));};
\ No newline at end of file
+var _0x37e8=['destroy','then','error','stack','name','status','send','index','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','options','ChatGroup','include','findAll','rows','catch','params','length','includeAll','create','body','update','find','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','findOne','User','filter','removeMembers','addMessage','ChatGroupId','rawAttributes','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','defaults','redis','./chatGroup.socket','register','sendStatus','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save'];(function(_0x5ce173,_0x34e8d3){var _0x2b7c7b=function(_0x1cd99f){while(--_0x1cd99f){_0x5ce173['push'](_0x5ce173['shift']());}};_0x2b7c7b(++_0x34e8d3);}(_0x37e8,0x101));var _0x837e=function(_0x482ced,_0x240f3f){_0x482ced=_0x482ced-0x0;var _0x85a839=_0x37e8[_0x482ced];return _0x85a839;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x837e('0x0'));var zipdir=require(_0x837e('0x1'));var jsonpatch=require(_0x837e('0x2'));var rp=require(_0x837e('0x3'));var moment=require(_0x837e('0x4'));var BPromise=require(_0x837e('0x5'));var Mustache=require(_0x837e('0x6'));var util=require(_0x837e('0x7'));var path=require(_0x837e('0x8'));var sox=require(_0x837e('0x9'));var csv=require(_0x837e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x837e('0xb'));var _=require('lodash');var squel=require(_0x837e('0xc'));var crypto=require(_0x837e('0xd'));var jsforce=require(_0x837e('0xe'));var deskjs=require(_0x837e('0xf'));var toCsv=require(_0x837e('0xa'));var querystring=require('querystring');var Papa=require(_0x837e('0x10'));var Redis=require(_0x837e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x837e('0x12'));var as=require(_0x837e('0x13'));var hardwareService=require(_0x837e('0x14'));var logger=require(_0x837e('0x15'))('api');var utils=require(_0x837e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x837e('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x837e('0x18')](config[_0x837e('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x837e('0x19')]));require(_0x837e('0x1a'))[_0x837e('0x1b')](socket);function respondWithStatusCode(_0xe9a354,_0x3a8d5f){_0x3a8d5f=_0x3a8d5f||0xcc;return function(_0x345c4f){if(_0x345c4f){return _0xe9a354[_0x837e('0x1c')](_0x3a8d5f);}return _0xe9a354['status'](_0x3a8d5f)[_0x837e('0x1d')]();};}function respondWithResult(_0xb515e7,_0x3d69ce){_0x3d69ce=_0x3d69ce||0xc8;return function(_0x197131){if(_0x197131){return _0xb515e7['status'](_0x3d69ce)['json'](_0x197131);}};}function respondWithFilteredResult(_0xff022f,_0x52098a){return function(_0x301e61){if(_0x301e61){var _0x5e4b36=typeof _0x52098a[_0x837e('0x1e')]==='undefined'&&typeof _0x52098a[_0x837e('0x1f')]===_0x837e('0x20');var _0x1c6575=_0x301e61[_0x837e('0x21')];var _0x21fe66=_0x5e4b36?0x0:_0x52098a['offset'];var _0x5909d5=_0x5e4b36?_0x301e61['count']:_0x52098a['offset']+_0x52098a[_0x837e('0x1f')];var _0x537bc2;if(_0x5909d5>=_0x1c6575){_0x5909d5=_0x1c6575;_0x537bc2=0xc8;}else{_0x537bc2=0xce;}_0xff022f['status'](_0x537bc2);return _0xff022f[_0x837e('0x22')](_0x837e('0x23'),_0x21fe66+'-'+_0x5909d5+'/'+_0x1c6575)[_0x837e('0x24')](_0x301e61);}return null;};}function patchUpdates(_0x4d8d2d){return function(_0xe1b1d3){try{jsonpatch[_0x837e('0x25')](_0xe1b1d3,_0x4d8d2d,!![]);}catch(_0x159e7a){return BPromise[_0x837e('0x26')](_0x159e7a);}return _0xe1b1d3[_0x837e('0x27')]();};}function saveUpdates(_0x256a52,_0x4baca5){return function(_0x12683f){if(_0x12683f){return _0x12683f['update'](_0x256a52)['then'](function(_0x363782){return _0x363782;});}return null;};}function removeEntity(_0x728496,_0x361539){return function(_0xd096b4){if(_0xd096b4){return _0xd096b4[_0x837e('0x28')]()[_0x837e('0x29')](function(){_0x728496['status'](0xcc)[_0x837e('0x1d')]();});}};}function handleEntityNotFound(_0x66ba9f,_0x284e7d){return function(_0x302ffc){if(!_0x302ffc){_0x66ba9f['sendStatus'](0x194);}return _0x302ffc;};}function handleError(_0x1a65da,_0x298ff2){_0x298ff2=_0x298ff2||0x1f4;return function(_0x17036e){logger[_0x837e('0x2a')](_0x17036e[_0x837e('0x2b')]);if(_0x17036e[_0x837e('0x2c')]){delete _0x17036e[_0x837e('0x2c')];}_0x1a65da[_0x837e('0x2d')](_0x298ff2)[_0x837e('0x2e')](_0x17036e);};}exports[_0x837e('0x2f')]=function(_0x3262d9,_0x5ce46c){var _0x7cfee3={},_0x47e440={},_0x5b3d6b={'count':0x0,'rows':[]};var _0x438f75=_['map'](db['ChatGroup']['rawAttributes'],function(_0x5140ab){return{'name':_0x5140ab[_0x837e('0x30')],'type':_0x5140ab[_0x837e('0x31')][_0x837e('0x32')]};});_0x47e440[_0x837e('0x33')]=_['map'](_0x438f75,_0x837e('0x2c'));_0x47e440[_0x837e('0x34')]=_[_0x837e('0x35')](_0x3262d9[_0x837e('0x34')]);_0x47e440[_0x837e('0x36')]=_['intersection'](_0x47e440[_0x837e('0x33')],_0x47e440[_0x837e('0x34')]);_0x7cfee3['attributes']=_[_0x837e('0x37')](_0x47e440['model'],qs[_0x837e('0x38')](_0x3262d9[_0x837e('0x34')][_0x837e('0x38')]));_0x7cfee3[_0x837e('0x39')]=_0x7cfee3['attributes']['length']?_0x7cfee3[_0x837e('0x39')]:_0x47e440['model'];if(!_0x3262d9[_0x837e('0x34')][_0x837e('0x3a')](_0x837e('0x3b'))){_0x7cfee3[_0x837e('0x1f')]=qs['limit'](_0x3262d9[_0x837e('0x34')][_0x837e('0x1f')]);_0x7cfee3[_0x837e('0x1e')]=qs[_0x837e('0x1e')](_0x3262d9[_0x837e('0x34')]['offset']);}_0x7cfee3[_0x837e('0x3c')]=qs[_0x837e('0x3d')](_0x3262d9['query'][_0x837e('0x3d')]);_0x7cfee3['where']=qs['filters'](_[_0x837e('0x3e')](_0x3262d9[_0x837e('0x34')],_0x47e440[_0x837e('0x36')]),_0x438f75);if(_0x3262d9[_0x837e('0x34')]['filter']){_0x7cfee3['where']=_[_0x837e('0x3f')](_0x7cfee3[_0x837e('0x40')],{'$or':_['map'](_0x438f75,function(_0x303d27){if(_0x303d27[_0x837e('0x31')]!==_0x837e('0x41')){var _0x5476c9={};_0x5476c9[_0x303d27[_0x837e('0x2c')]]={'$like':'%'+_0x3262d9[_0x837e('0x34')]['filter']+'%'};return _0x5476c9;}})});}_0x7cfee3=_['merge']({},_0x7cfee3,_0x3262d9[_0x837e('0x42')]);var _0x2e5efc={'where':_0x7cfee3[_0x837e('0x40')]};return db[_0x837e('0x43')][_0x837e('0x21')](_0x2e5efc)[_0x837e('0x29')](function(_0x476cdd){_0x5b3d6b[_0x837e('0x21')]=_0x476cdd;if(_0x3262d9[_0x837e('0x34')]['includeAll']){_0x7cfee3[_0x837e('0x44')]=[{'all':!![]}];}return db[_0x837e('0x43')][_0x837e('0x45')](_0x7cfee3);})[_0x837e('0x29')](function(_0x236f4e){_0x5b3d6b[_0x837e('0x46')]=_0x236f4e;return _0x5b3d6b;})[_0x837e('0x29')](respondWithFilteredResult(_0x5ce46c,_0x7cfee3))[_0x837e('0x47')](handleError(_0x5ce46c,null));};exports['show']=function(_0x37c52b,_0x187180){var _0x598cd4={'raw':!![],'where':{'id':_0x37c52b[_0x837e('0x48')]['id']}},_0x9b48a={};_0x9b48a['model']=_['keys'](db[_0x837e('0x43')]['rawAttributes']);_0x9b48a[_0x837e('0x34')]=_[_0x837e('0x35')](_0x37c52b['query']);_0x9b48a[_0x837e('0x36')]=_['intersection'](_0x9b48a[_0x837e('0x33')],_0x9b48a[_0x837e('0x34')]);_0x598cd4['attributes']=_['intersection'](_0x9b48a['model'],qs['fields'](_0x37c52b[_0x837e('0x34')][_0x837e('0x38')]));_0x598cd4[_0x837e('0x39')]=_0x598cd4[_0x837e('0x39')][_0x837e('0x49')]?_0x598cd4[_0x837e('0x39')]:_0x9b48a[_0x837e('0x33')];if(_0x37c52b['query'][_0x837e('0x4a')]){_0x598cd4[_0x837e('0x44')]=[{'all':!![]}];}_0x598cd4=_['merge']({},_0x598cd4,_0x37c52b['options']);return db[_0x837e('0x43')]['find'](_0x598cd4)[_0x837e('0x29')](handleEntityNotFound(_0x187180,null))['then'](respondWithResult(_0x187180,null))[_0x837e('0x47')](handleError(_0x187180,null));};exports[_0x837e('0x4b')]=function(_0x463093,_0x4e3b99){return db[_0x837e('0x43')][_0x837e('0x4b')](_0x463093[_0x837e('0x4c')],{})[_0x837e('0x29')](respondWithResult(_0x4e3b99,0xc9))['catch'](handleError(_0x4e3b99,null));};exports[_0x837e('0x4d')]=function(_0x14b214,_0x18b4b6){if(_0x14b214[_0x837e('0x4c')]['id']){delete _0x14b214[_0x837e('0x4c')]['id'];}return db['ChatGroup'][_0x837e('0x4e')]({'where':{'id':_0x14b214[_0x837e('0x48')]['id']}})[_0x837e('0x29')](handleEntityNotFound(_0x18b4b6,null))[_0x837e('0x29')](saveUpdates(_0x14b214[_0x837e('0x4c')],null))[_0x837e('0x29')](respondWithResult(_0x18b4b6,null))['catch'](handleError(_0x18b4b6,null));};exports['destroy']=function(_0x3bda8f,_0x55bc31){return db[_0x837e('0x43')][_0x837e('0x4e')]({'where':{'id':_0x3bda8f[_0x837e('0x48')]['id']}})[_0x837e('0x29')](handleEntityNotFound(_0x55bc31,null))['then'](removeEntity(_0x55bc31,null))[_0x837e('0x47')](handleError(_0x55bc31,null));};exports[_0x837e('0x4f')]=function(_0x1c40e1,_0xfd98ed){return db['ChatGroup'][_0x837e('0x4f')]()[_0x837e('0x29')](respondWithResult(_0xfd98ed,null))['catch'](handleError(_0xfd98ed,null));};exports[_0x837e('0x50')]=function(_0x3cb954,_0x24d68f,_0xeaba93){return db[_0x837e('0x51')][_0x837e('0x21')]({'where':{'ChatGroupId':_0x3cb954[_0x837e('0x48')]['id'],'ToId':_0x3cb954['user']['id'],'read':![]}})['then'](function(_0x503f24){return{'id':_[_0x837e('0x52')](_0x3cb954['params']['id']),'count':_0x503f24};})[_0x837e('0x29')](respondWithResult(_0x24d68f,null))[_0x837e('0x47')](handleError(_0x24d68f,null));};exports[_0x837e('0x53')]=function(_0x44932d,_0x4bfa26,_0x58cfe6){return db[_0x837e('0x43')][_0x837e('0x4e')]({'where':{'id':_0x44932d[_0x837e('0x48')]['id']}})[_0x837e('0x29')](handleEntityNotFound(_0x4bfa26,null))[_0x837e('0x29')](function(_0x502d7a){if(_0x502d7a){return _0x502d7a['addMembers'](_0x44932d[_0x837e('0x4c')][_0x837e('0x54')],_[_0x837e('0x55')](_0x44932d[_0x837e('0x4c')],['ids','id'])||{});}})[_0x837e('0x29')](respondWithResult(_0x4bfa26,null))[_0x837e('0x47')](handleError(_0x4bfa26,null));};exports[_0x837e('0x56')]=function(_0x426cd4,_0x1c4c24,_0x23f25a){var _0x14c2af={};var _0x420cd={};var _0x3ac249;var _0x2cb0aa;return db[_0x837e('0x43')][_0x837e('0x57')]({'where':{'id':_0x426cd4['params']['id']}})[_0x837e('0x29')](handleEntityNotFound(_0x1c4c24,null))['then'](function(_0x3c5d02){if(_0x3c5d02){_0x3ac249=_0x3c5d02;_0x420cd[_0x837e('0x33')]=_[_0x837e('0x35')](db[_0x837e('0x58')]['rawAttributes']);_0x420cd['query']=_[_0x837e('0x35')](_0x426cd4['query']);_0x420cd[_0x837e('0x36')]=_[_0x837e('0x37')](_0x420cd[_0x837e('0x33')],_0x420cd[_0x837e('0x34')]);_0x14c2af[_0x837e('0x39')]=_[_0x837e('0x37')](_0x420cd[_0x837e('0x33')],qs[_0x837e('0x38')](_0x426cd4[_0x837e('0x34')][_0x837e('0x38')]));_0x14c2af[_0x837e('0x39')]=_0x14c2af[_0x837e('0x39')][_0x837e('0x49')]?_0x14c2af[_0x837e('0x39')]:_0x420cd[_0x837e('0x33')];_0x14c2af['order']=qs[_0x837e('0x3d')](_0x426cd4[_0x837e('0x34')]['sort']);_0x14c2af[_0x837e('0x40')]=qs[_0x837e('0x36')](_['pick'](_0x426cd4[_0x837e('0x34')],_0x420cd[_0x837e('0x36')]));if(_0x426cd4['query']['filter']){_0x14c2af[_0x837e('0x40')]=_[_0x837e('0x3f')](_0x14c2af['where'],{'$or':_['map'](_0x14c2af['attributes'],function(_0x480224){var _0x3e8310={};_0x3e8310[_0x480224]={'$like':'%'+_0x426cd4[_0x837e('0x34')][_0x837e('0x59')]+'%'};return _0x3e8310;})});}_0x14c2af=_['merge']({},_0x14c2af,_0x426cd4[_0x837e('0x42')]);return _0x3ac249['getMembers'](_0x14c2af);}})[_0x837e('0x29')](function(_0xa9272d){if(_0xa9272d){_0x2cb0aa=_0xa9272d[_0x837e('0x49')];if(!_0x426cd4[_0x837e('0x34')][_0x837e('0x3a')]('nolimit')){_0x14c2af['limit']=qs[_0x837e('0x1f')](_0x426cd4[_0x837e('0x34')]['limit']);_0x14c2af['offset']=qs['offset'](_0x426cd4['query'][_0x837e('0x1e')]);}return _0x3ac249['getMembers'](_0x14c2af);}})[_0x837e('0x29')](function(_0x2d0088){if(_0x2d0088){return _0x2d0088?{'count':_0x2cb0aa,'rows':_0x2d0088}:null;}})['then'](respondWithResult(_0x1c4c24,null))[_0x837e('0x47')](handleError(_0x1c4c24,null));};exports[_0x837e('0x5a')]=function(_0x1b9707,_0x36ddba,_0x332a2c){return db[_0x837e('0x43')][_0x837e('0x4e')]({'where':{'id':_0x1b9707[_0x837e('0x48')]['id']}})[_0x837e('0x29')](handleEntityNotFound(_0x36ddba,null))[_0x837e('0x29')](function(_0x118123){if(_0x118123){return _0x118123['removeMembers'](_0x1b9707['query'][_0x837e('0x54')]);}})[_0x837e('0x29')](respondWithStatusCode(_0x36ddba,null))[_0x837e('0x47')](handleError(_0x36ddba,null));};exports[_0x837e('0x5b')]=function(_0x4c1acd,_0x156689,_0x23fc24){if(_0x4c1acd[_0x837e('0x4c')]['id']){delete _0x4c1acd[_0x837e('0x4c')]['id'];}return db['ChatGroup'][_0x837e('0x4e')]({'where':{'id':_0x4c1acd[_0x837e('0x48')]['id']}})[_0x837e('0x29')](handleEntityNotFound(_0x156689,null))[_0x837e('0x29')](function(_0x20f269){if(_0x20f269){_0x4c1acd[_0x837e('0x4c')][_0x837e('0x5c')]=_0x20f269['id'];return db[_0x837e('0x51')]['create'](_0x4c1acd['body']);}})[_0x837e('0x29')](respondWithResult(_0x156689,null))['catch'](handleError(_0x156689,null));};exports['getMessages']=function(_0x543767,_0x4bd7f3,_0x3bd83f){var _0x19b175={};var _0x260ddc={};var _0x4a5f64;var _0x2062c6;return db[_0x837e('0x43')]['findOne']({'where':{'id':_0x543767[_0x837e('0x48')]['id']}})[_0x837e('0x29')](handleEntityNotFound(_0x4bd7f3,null))[_0x837e('0x29')](function(_0x5e8d32){if(_0x5e8d32){_0x4a5f64=_0x5e8d32;_0x260ddc[_0x837e('0x33')]=_[_0x837e('0x35')](db[_0x837e('0x51')][_0x837e('0x5d')]);_0x260ddc[_0x837e('0x34')]=_['keys'](_0x543767[_0x837e('0x34')]);_0x260ddc['filters']=_[_0x837e('0x37')](_0x260ddc[_0x837e('0x33')],_0x260ddc[_0x837e('0x34')]);_0x19b175[_0x837e('0x39')]=_[_0x837e('0x37')](_0x260ddc[_0x837e('0x33')],qs[_0x837e('0x38')](_0x543767['query'][_0x837e('0x38')]));_0x19b175[_0x837e('0x39')]=_0x19b175['attributes']['length']?_0x19b175[_0x837e('0x39')]:_0x260ddc[_0x837e('0x33')];_0x19b175[_0x837e('0x3c')]=qs[_0x837e('0x3d')](_0x543767[_0x837e('0x34')]['sort']);_0x19b175[_0x837e('0x40')]=qs[_0x837e('0x36')](_[_0x837e('0x3e')](_0x543767['query'],_0x260ddc[_0x837e('0x36')]));if(_0x543767[_0x837e('0x34')][_0x837e('0x59')]){_0x19b175[_0x837e('0x40')]=_[_0x837e('0x3f')](_0x19b175[_0x837e('0x40')],{'$or':_['map'](_0x19b175['attributes'],function(_0x34409c){var _0x142fd1={};_0x142fd1[_0x34409c]={'$like':'%'+_0x543767[_0x837e('0x34')][_0x837e('0x59')]+'%'};return _0x142fd1;})});}if(_0x543767['query'][_0x837e('0x5e')]){var _0x1d149d=_0x543767['query'][_0x837e('0x5e')][_0x837e('0x5f')](',');var _0x418f0c={};_0x418f0c[_0x1d149d[0x0]]={'$gte':moment(_0x1d149d[0x1])[_0x837e('0x60')](_0x837e('0x61'))};_0x19b175[_0x837e('0x40')]=_[_0x837e('0x3f')](_0x19b175[_0x837e('0x40')],_0x418f0c);}_0x19b175=_['merge']({},_0x19b175,_0x543767[_0x837e('0x42')]);return _0x4a5f64[_0x837e('0x62')](_0x19b175);}})[_0x837e('0x29')](function(_0x5d5cee){if(_0x5d5cee){_0x2062c6=_0x5d5cee[_0x837e('0x49')];if(!_0x543767[_0x837e('0x34')][_0x837e('0x3a')](_0x837e('0x3b'))){_0x19b175[_0x837e('0x1f')]=qs['limit'](_0x543767['query'][_0x837e('0x1f')]);_0x19b175[_0x837e('0x1e')]=qs['offset'](_0x543767[_0x837e('0x34')][_0x837e('0x1e')]);}return _0x4a5f64[_0x837e('0x62')](_0x19b175);}})[_0x837e('0x29')](function(_0x50178a){if(_0x50178a){return _0x50178a?{'count':_0x2062c6,'rows':_0x50178a}:null;}})[_0x837e('0x29')](respondWithResult(_0x4bd7f3,null))[_0x837e('0x47')](handleError(_0x4bd7f3,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index bceb7ea..3efdb50 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 _0x70e3=['setMaxListeners','update','remove','emit','hook','events','../../mysqldb','ChatGroup'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x70e3,0x9d));var _0x370e=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0x70e3[_0x5c4f6b];return _0x104c4e;};'use strict';var EventEmitter=require(_0x370e('0x0'));var ChatGroup=require(_0x370e('0x1'))['db'][_0x370e('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x370e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x370e('0x4'),'afterDestroy':_0x370e('0x5')};function emitEvent(_0x3ae8ba){return function(_0x5e8764,_0x3649c7,_0x4166dd){ChatGroupEvents[_0x370e('0x6')](_0x3ae8ba+':'+_0x5e8764['id'],_0x5e8764);ChatGroupEvents[_0x370e('0x6')](_0x3ae8ba,_0x5e8764);_0x4166dd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x370e('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x36d3=['exports','events','../../mysqldb','ChatGroup','update','remove','emit','hasOwnProperty','hook'];(function(_0xb7b878,_0x5c3b92){var _0x3c84b9=function(_0x21d5a2){while(--_0x21d5a2){_0xb7b878['push'](_0xb7b878['shift']());}};_0x3c84b9(++_0x5c3b92);}(_0x36d3,0xb5));var _0x336d=function(_0x545cfd,_0x180db8){_0x545cfd=_0x545cfd-0x0;var _0xa19618=_0x36d3[_0x545cfd];return _0xa19618;};'use strict';var EventEmitter=require(_0x336d('0x0'));var ChatGroup=require(_0x336d('0x1'))['db'][_0x336d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x336d('0x3'),'afterDestroy':_0x336d('0x4')};function emitEvent(_0x23233b){return function(_0x25a5de,_0x352fc0,_0x24cf91){ChatGroupEvents[_0x336d('0x5')](_0x23233b+':'+_0x25a5de['id'],_0x25a5de);ChatGroupEvents[_0x336d('0x5')](_0x23233b,_0x25a5de);_0x24cf91(null);};}for(var e in events){if(events[_0x336d('0x6')](e)){var event=events[e];ChatGroup[_0x336d('0x7')](e,emitEvent(event));}}module[_0x336d('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 4b727fa..d8e2807 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 _0x660f=['path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','../../config/logger','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x660f,0x1ac));var _0xf660=function(_0x34e639,_0x23ae3f){_0x34e639=_0x34e639-0x0;var _0x52823e=_0x660f[_0x34e639];return _0x52823e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf660('0x0'))('api');var moment=require(_0xf660('0x1'));var BPromise=require(_0xf660('0x2'));var rp=require(_0xf660('0x3'));var fs=require('fs');var path=require(_0xf660('0x4'));var rimraf=require(_0xf660('0x5'));var config=require(_0xf660('0x6'));var attributes=require(_0xf660('0x7'));module[_0xf660('0x8')]=function(_0x110f22,_0x1e0daa){return _0x110f22[_0xf660('0x9')](_0xf660('0xa'),attributes,{'tableName':_0xf660('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2146=['./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x2146,0xbb));var _0x6214=function(_0x4b544e,_0x1b40c7){_0x4b544e=_0x4b544e-0x0;var _0x119683=_0x2146[_0x4b544e];return _0x119683;};'use strict';var _=require(_0x6214('0x0'));var util=require(_0x6214('0x1'));var logger=require(_0x6214('0x2'))(_0x6214('0x3'));var moment=require(_0x6214('0x4'));var BPromise=require(_0x6214('0x5'));var rp=require(_0x6214('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6214('0x7'));var config=require('../../config/environment');var attributes=require(_0x6214('0x8'));module[_0x6214('0x9')]=function(_0x485e18,_0x486a9d){return _0x485e18[_0x6214('0xa')](_0x6214('0xb'),attributes,{'tableName':_0x6214('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 9f451d2..24330c9 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 _0xef72=['register','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','result','catch','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x3aa48e,_0x22eb8d){var _0x26f857=function(_0x59c01d){while(--_0x59c01d){_0x3aa48e['push'](_0x3aa48e['shift']());}};_0x26f857(++_0x22eb8d);}(_0xef72,0xf8));var _0x2ef7=function(_0x13e724,_0x296739){_0x13e724=_0x13e724-0x0;var _0x334a44=_0xef72[_0x13e724];return _0x334a44;};'use strict';var _=require(_0x2ef7('0x0'));var util=require(_0x2ef7('0x1'));var moment=require(_0x2ef7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ef7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ef7('0x4'))(_0x2ef7('0x5'));var config=require(_0x2ef7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2ef7('0x7')]['http']({'port':0x232a});config[_0x2ef7('0x8')]=_[_0x2ef7('0x9')](config[_0x2ef7('0x8')],{'host':_0x2ef7('0xa'),'port':0x18eb});var socket=require(_0x2ef7('0xb'))(new Redis(config[_0x2ef7('0x8')]));require('./chatGroup.socket')[_0x2ef7('0xc')](socket);function respondWithRpcPromise(_0x5e1adf,_0x574115,_0x448770){return new BPromise(function(_0x5f54f2,_0x54e43b){return client[_0x2ef7('0xd')](_0x5e1adf,_0x448770)[_0x2ef7('0xe')](function(_0xb1cc9){logger[_0x2ef7('0xf')]('ChatGroup,\x20%s,\x20%s',_0x574115,'request\x20sent');logger[_0x2ef7('0x10')](_0x2ef7('0x11'),_0x574115,_0x2ef7('0x12'),JSON[_0x2ef7('0x13')](_0xb1cc9));if(_0xb1cc9['error']){if(_0xb1cc9[_0x2ef7('0x14')][_0x2ef7('0x15')]===0x1f4){logger[_0x2ef7('0x14')]('ChatGroup,\x20%s,\x20%s',_0x574115,_0xb1cc9[_0x2ef7('0x14')][_0x2ef7('0x16')]);return _0x54e43b(_0xb1cc9[_0x2ef7('0x14')][_0x2ef7('0x16')]);}logger['error'](_0x2ef7('0x17'),_0x574115,_0xb1cc9[_0x2ef7('0x14')][_0x2ef7('0x16')]);return _0x5f54f2(_0xb1cc9[_0x2ef7('0x14')][_0x2ef7('0x16')]);}else{logger['info'](_0x2ef7('0x17'),_0x574115,'request\x20sent');_0x5f54f2(_0xb1cc9[_0x2ef7('0x18')][_0x2ef7('0x16')]);}})[_0x2ef7('0x19')](function(_0x290e13){logger[_0x2ef7('0x14')](_0x2ef7('0x17'),_0x574115,_0x290e13);_0x54e43b(_0x290e13);});});}
\ No newline at end of file
+var _0xe233=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','bluebird','../../mysqldb'];(function(_0x440341,_0x1ca54d){var _0x399e1c=function(_0x201acc){while(--_0x201acc){_0x440341['push'](_0x440341['shift']());}};_0x399e1c(++_0x1ca54d);}(_0xe233,0x15b));var _0x3e23=function(_0xb4411,_0x5d04ac){_0xb4411=_0xb4411-0x0;var _0x481db4=_0xe233[_0xb4411];return _0x481db4;};'use strict';var _=require(_0x3e23('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3e23('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e23('0x2'))['db'];var utils=require(_0x3e23('0x3'));var logger=require(_0x3e23('0x4'))(_0x3e23('0x5'));var config=require(_0x3e23('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3e23('0x7')][_0x3e23('0x8')]({'port':0x232a});config[_0x3e23('0x9')]=_[_0x3e23('0xa')](config[_0x3e23('0x9')],{'host':_0x3e23('0xb'),'port':0x18eb});var socket=require(_0x3e23('0xc'))(new Redis(config[_0x3e23('0x9')]));require(_0x3e23('0xd'))[_0x3e23('0xe')](socket);function respondWithRpcPromise(_0x20f5d2,_0x39cb79,_0x1f9e56){return new BPromise(function(_0x492b77,_0x556b9e){return client[_0x3e23('0xf')](_0x20f5d2,_0x1f9e56)[_0x3e23('0x10')](function(_0x449d78){logger[_0x3e23('0x11')](_0x3e23('0x12'),_0x39cb79,'request\x20sent');logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x39cb79,_0x3e23('0x13'),JSON[_0x3e23('0x14')](_0x449d78));if(_0x449d78[_0x3e23('0x15')]){if(_0x449d78[_0x3e23('0x15')][_0x3e23('0x16')]===0x1f4){logger[_0x3e23('0x15')]('ChatGroup,\x20%s,\x20%s',_0x39cb79,_0x449d78['error']['message']);return _0x556b9e(_0x449d78['error'][_0x3e23('0x17')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x39cb79,_0x449d78[_0x3e23('0x15')][_0x3e23('0x17')]);return _0x492b77(_0x449d78[_0x3e23('0x15')]['message']);}else{logger[_0x3e23('0x11')]('ChatGroup,\x20%s,\x20%s',_0x39cb79,'request\x20sent');_0x492b77(_0x449d78['result'][_0x3e23('0x17')]);}})[_0x3e23('0x18')](function(_0x1b4da7){logger[_0x3e23('0x15')](_0x3e23('0x12'),_0x39cb79,_0x1b4da7);_0x556b9e(_0x1b4da7);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index fca5b29..75ef1ab 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 _0xc7c4=['./chatGroup.events','save','remove','emit','removeListener','register','chatGroup:'];(function(_0xfff28b,_0x204443){var _0x13c9f0=function(_0x4d9f58){while(--_0x4d9f58){_0xfff28b['push'](_0xfff28b['shift']());}};_0x13c9f0(++_0x204443);}(_0xc7c4,0x165));var _0x4c7c=function(_0x85df03,_0x451d08){_0x85df03=_0x85df03-0x0;var _0x3d5ea3=_0xc7c4[_0x85df03];return _0x3d5ea3;};'use strict';var ChatGroupEvents=require(_0x4c7c('0x0'));var events=[_0x4c7c('0x1'),_0x4c7c('0x2'),'update'];function createListener(_0x9409fb,_0x2eba69){return function(_0x46650d){_0x2eba69[_0x4c7c('0x3')](_0x9409fb,_0x46650d);};}function removeListener(_0x18536a,_0x280630){return function(){ChatGroupEvents[_0x4c7c('0x4')](_0x18536a,_0x280630);};}exports[_0x4c7c('0x5')]=function(_0xbbbd14){for(var _0x5e7296=0x0,_0x58eb7d=events['length'];_0x5e7296<_0x58eb7d;_0x5e7296++){var _0x5f1733=events[_0x5e7296];var _0x2e5404=createListener(_0x4c7c('0x6')+_0x5f1733,_0xbbbd14);ChatGroupEvents['on'](_0x5f1733,_0x2e5404);}};
\ No newline at end of file
+var _0xa86b=['emit','removeListener','chatGroup:','save','remove','update'];(function(_0x4a9a1c,_0x25e250){var _0x10fe5f=function(_0x2a22cd){while(--_0x2a22cd){_0x4a9a1c['push'](_0x4a9a1c['shift']());}};_0x10fe5f(++_0x25e250);}(_0xa86b,0x75));var _0xba86=function(_0x51615c,_0x1ab65b){_0x51615c=_0x51615c-0x0;var _0x365de5=_0xa86b[_0x51615c];return _0x365de5;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xba86('0x0'),_0xba86('0x1'),_0xba86('0x2')];function createListener(_0x228f1e,_0xe50b49){return function(_0x175a50){_0xe50b49[_0xba86('0x3')](_0x228f1e,_0x175a50);};}function removeListener(_0x40fcb7,_0x296dab){return function(){ChatGroupEvents[_0xba86('0x4')](_0x40fcb7,_0x296dab);};}exports['register']=function(_0xaf4f08){for(var _0x3f5051=0x0,_0x444879=events['length'];_0x3f5051<_0x444879;_0x3f5051++){var _0x6ab239=events[_0x3f5051];var _0x58855a=createListener(_0xba86('0x5')+_0x6ab239,_0xaf4f08);ChatGroupEvents['on'](_0x6ab239,_0x58855a);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 17e25e4..1ac2c84 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 _0xa460=['index','get','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','update','delete','destroy','removeMembers','multer','util','path','connect-timeout','express','Router','../../components/auth/service','isAuthenticated'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa460,0xbc));var _0x0a46=function(_0x40de6f,_0x3d5f9c){_0x40de6f=_0x40de6f-0x0;var _0x44a887=_0xa460[_0x40de6f];return _0x44a887;};'use strict';var multer=require(_0x0a46('0x0'));var util=require(_0x0a46('0x1'));var path=require(_0x0a46('0x2'));var timeout=require(_0x0a46('0x3'));var express=require(_0x0a46('0x4'));var router=express[_0x0a46('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0a46('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatGroup.controller');router['get']('/',auth[_0x0a46('0x7')](),controller[_0x0a46('0x8')]);router[_0x0a46('0x9')](_0x0a46('0xa'),auth[_0x0a46('0x7')](),controller[_0x0a46('0xb')]);router[_0x0a46('0x9')](_0x0a46('0xc'),auth[_0x0a46('0x7')](),controller[_0x0a46('0xd')]);router['get'](_0x0a46('0xe'),auth[_0x0a46('0x7')](),controller[_0x0a46('0xf')]);router[_0x0a46('0x9')](_0x0a46('0x10'),auth['isAuthenticated'](),controller[_0x0a46('0x11')]);router[_0x0a46('0x9')](_0x0a46('0x12'),auth['isAuthenticated'](),controller[_0x0a46('0x13')]);router[_0x0a46('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a46('0x14')](_0x0a46('0x10'),auth[_0x0a46('0x7')](),controller[_0x0a46('0x15')]);router['post'](_0x0a46('0x12'),auth[_0x0a46('0x7')](),controller[_0x0a46('0x16')]);router[_0x0a46('0x17')](_0x0a46('0xc'),auth['isAuthenticated'](),controller[_0x0a46('0x18')]);router[_0x0a46('0x19')](_0x0a46('0xc'),auth[_0x0a46('0x7')](),controller[_0x0a46('0x1a')]);router['delete'](_0x0a46('0x10'),auth['isAuthenticated'](),controller[_0x0a46('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0x33ff=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','/describe','isAuthenticated','/:id','/:id/unread','getUnread','getMembers','getMessages','post','create','/:id/members','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','multer','util'];(function(_0x1989e2,_0x5a3b47){var _0x218d38=function(_0x572af8){while(--_0x572af8){_0x1989e2['push'](_0x1989e2['shift']());}};_0x218d38(++_0x5a3b47);}(_0x33ff,0x12a));var _0xf33f=function(_0x37d4ac,_0x4e47d6){_0x37d4ac=_0x37d4ac-0x0;var _0x5e727a=_0x33ff[_0x37d4ac];return _0x5e727a;};'use strict';var multer=require(_0xf33f('0x0'));var util=require(_0xf33f('0x1'));var path=require('path');var timeout=require(_0xf33f('0x2'));var express=require(_0xf33f('0x3'));var router=express[_0xf33f('0x4')]();var fs_extra=require(_0xf33f('0x5'));var auth=require(_0xf33f('0x6'));var interaction=require(_0xf33f('0x7'));var config=require(_0xf33f('0x8'));var controller=require(_0xf33f('0x9'));router[_0xf33f('0xa')]('/',auth['isAuthenticated'](),controller[_0xf33f('0xb')]);router['get'](_0xf33f('0xc'),auth[_0xf33f('0xd')](),controller['describe']);router[_0xf33f('0xa')](_0xf33f('0xe'),auth[_0xf33f('0xd')](),controller['show']);router[_0xf33f('0xa')](_0xf33f('0xf'),auth['isAuthenticated'](),controller[_0xf33f('0x10')]);router[_0xf33f('0xa')]('/:id/members',auth[_0xf33f('0xd')](),controller[_0xf33f('0x11')]);router['get']('/:id/messages',auth[_0xf33f('0xd')](),controller[_0xf33f('0x12')]);router[_0xf33f('0x13')]('/',auth[_0xf33f('0xd')](),controller[_0xf33f('0x14')]);router[_0xf33f('0x13')](_0xf33f('0x15'),auth[_0xf33f('0xd')](),controller[_0xf33f('0x16')]);router[_0xf33f('0x13')]('/:id/messages',auth[_0xf33f('0xd')](),controller[_0xf33f('0x17')]);router[_0xf33f('0x18')](_0xf33f('0xe'),auth[_0xf33f('0xd')](),controller[_0xf33f('0x19')]);router[_0xf33f('0x1a')]('/:id',auth[_0xf33f('0xd')](),controller[_0xf33f('0x1b')]);router[_0xf33f('0x1a')](_0xf33f('0x15'),auth[_0xf33f('0xd')](),controller[_0xf33f('0x1c')]);module[_0xf33f('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 57cb771..e48d3f6 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 _0xcf4a=['STRING','long','DATE','out','BOOLEAN','sequelize','exports','INTEGER','ENUM','thumb','TEXT'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xcf4a,0xec));var _0xacf4=function(_0x18b367,_0x349a8e){_0x18b367=_0x18b367-0x0;var _0xaa88a8=_0xcf4a[_0x18b367];return _0xaa88a8;};'use strict';var Sequelize=require(_0xacf4('0x0'));module[_0xacf4('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xacf4('0x2')]},'ratingType':{'type':Sequelize[_0xacf4('0x3')]('star',_0xacf4('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xacf4('0x5')]},'pathTranscript':{'type':Sequelize[_0xacf4('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xacf4('0x6')]},'secondDisposition':{'type':Sequelize[_0xacf4('0x6')]},'thirdDisposition':{'type':Sequelize[_0xacf4('0x6')]},'note':{'type':Sequelize[_0xacf4('0x6')]},'browserName':{'type':Sequelize[_0xacf4('0x6')]},'browserVersion':{'type':Sequelize[_0xacf4('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xacf4('0x6')]},'deviceModel':{'type':Sequelize[_0xacf4('0x6')]},'deviceVendor':{'type':Sequelize[_0xacf4('0x6')]},'deviceType':{'type':Sequelize[_0xacf4('0x6')]},'referer':{'type':Sequelize[_0xacf4('0x5')]},'customerIp':{'type':Sequelize[_0xacf4('0x6')]},'formData':{'type':Sequelize[_0xacf4('0x5')](_0xacf4('0x7'))},'read1stAt':{'type':Sequelize[_0xacf4('0x8')]},'lastMsgAt':{'type':Sequelize[_0xacf4('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xacf4('0x3')]('in',_0xacf4('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xacf4('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xacf4('0xa')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x647d=['BOOLEAN','INTEGER','ENUM','star','TEXT','STRING','DATE','out','sequelize','exports'];(function(_0x45d9fa,_0xb02522){var _0x1fb6d8=function(_0x2e2569){while(--_0x2e2569){_0x45d9fa['push'](_0x45d9fa['shift']());}};_0x1fb6d8(++_0xb02522);}(_0x647d,0xb2));var _0xd647=function(_0x47ff3a,_0x280a82){_0x47ff3a=_0x47ff3a-0x0;var _0x4ab5df=_0x647d[_0x47ff3a];return _0x4ab5df;};'use strict';var Sequelize=require(_0xd647('0x0'));module[_0xd647('0x1')]={'closed':{'type':Sequelize[_0xd647('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xd647('0x3')]},'ratingType':{'type':Sequelize[_0xd647('0x4')](_0xd647('0x5'),'thumb'),'defaultValue':_0xd647('0x5')},'ratingMessage':{'type':Sequelize[_0xd647('0x6')]},'pathTranscript':{'type':Sequelize[_0xd647('0x6')]},'mailTranscript':{'type':Sequelize[_0xd647('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xd647('0x8')]},'disposition':{'type':Sequelize[_0xd647('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd647('0x7')]},'browserName':{'type':Sequelize[_0xd647('0x7')]},'browserVersion':{'type':Sequelize[_0xd647('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xd647('0x7')]},'deviceModel':{'type':Sequelize[_0xd647('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xd647('0x7')]},'referer':{'type':Sequelize[_0xd647('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xd647('0x6')]('long')},'read1stAt':{'type':Sequelize[_0xd647('0x8')]},'lastMsgAt':{'type':Sequelize[_0xd647('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xd647('0x4')]('in',_0xd647('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd647('0x7')]},'customerPort':{'type':Sequelize[_0xd647('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xd647('0x6')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xd647('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 2b89236..87bc6fd 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 _0xf378=['debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','end','status','json','offset','limit','count','set','destroy','sendStatus','stack','name','render','merge','interaction','account','index','ChatInteraction','fieldName','getOptions','findAll','chat','user','show','params','model','keys','rawAttributes','filters','intersection','query','fields','attributes','length','includeAll','include','options','find','create','update','body','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','fullname','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','follow','isNull','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','closed','attachmentUpload','file','originalname','filename','Attachment','attachmentDownload','attachId','root','offline-chat/','join','basename','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','Messages','User','CmContact','ContactId','format','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','hasOwnProperty','order','sort','where','pick','ChatInteractionId','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','nolimit','includeAgent','push','addTags','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','read','Account','get','mkdirSync','Chat','Owner','createdAt','disposition','browserName','osName','referer','customerIp','customerPort','N.A.','existsSync','createReadStream','pipe','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf378,0x18e));var _0x8f37=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xf378[_0x1d1779];return _0x2377e9;};'use strict';var rimraf=require(_0x8f37('0x0'));var zipdir=require(_0x8f37('0x1'));var rp=require(_0x8f37('0x2'));var moment=require('moment');var BPromise=require(_0x8f37('0x3'));var Mustache=require(_0x8f37('0x4'));var util=require(_0x8f37('0x5'));var path=require(_0x8f37('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8f37('0x7'));var Redis=require('ioredis');var interaction=require(_0x8f37('0x8'));var qs=require(_0x8f37('0x9'));var pdf=require(_0x8f37('0xa'));var logger=require(_0x8f37('0xb'))(_0x8f37('0xc'));var config=require(_0x8f37('0xd'));var db=require(_0x8f37('0xe'))['db'];config['redis']=_[_0x8f37('0xf')](config['redis'],{'host':_0x8f37('0x10'),'port':0x18eb});var socket=require(_0x8f37('0x11'))(new Redis(config[_0x8f37('0x12')]));require(_0x8f37('0x13'))[_0x8f37('0x14')](socket);var jayson=require(_0x8f37('0x15'));var client=jayson[_0x8f37('0x16')][_0x8f37('0x17')]({'port':0x232b});var client9004=jayson[_0x8f37('0x16')]['http']({'port':0x232c});function respondWithRpcPromise(_0x18621b,_0x181d76,_0x57dfb5,_0x373fde){return new BPromise(function(_0x357ed7,_0x16746d){var _0xe7faaa=_0x373fde||client;return _0xe7faaa[_0x8f37('0x18')](_0x18621b,_0x57dfb5)[_0x8f37('0x19')](function(_0x485644){logger['info'](_0x8f37('0x1a'),_0x181d76,_0x8f37('0x1b'));logger[_0x8f37('0x1c')](_0x8f37('0x1d'),_0x181d76,'request\x20sent',JSON[_0x8f37('0x1e')](_0x485644));if(_0x485644[_0x8f37('0x1f')]){if(_0x485644[_0x8f37('0x1f')][_0x8f37('0x20')]===0x1f4){logger[_0x8f37('0x1f')](_0x8f37('0x1a'),_0x181d76,_0x485644[_0x8f37('0x1f')][_0x8f37('0x21')]);return _0x16746d(_0x485644[_0x8f37('0x1f')][_0x8f37('0x21')]);}logger[_0x8f37('0x1f')](_0x8f37('0x1a'),_0x181d76,_0x485644['error'][_0x8f37('0x21')]);return _0x357ed7(_0x485644[_0x8f37('0x1f')][_0x8f37('0x21')]);}else{logger[_0x8f37('0x22')](_0x8f37('0x1a'),_0x181d76,'request\x20sent');_0x357ed7(_0x485644[_0x8f37('0x23')]['message']);}})[_0x8f37('0x24')](function(_0x4ca8e9){logger[_0x8f37('0x1f')]('ChatInteraction,\x20%s,\x20%s',_0x181d76,_0x4ca8e9);_0x16746d(_0x4ca8e9);});});}function respondWithStatusCode(_0x36017b,_0x6c4025){_0x6c4025=_0x6c4025||0xcc;return function(_0x3cb24e){if(_0x3cb24e){return _0x36017b['sendStatus'](_0x6c4025);}return _0x36017b['status'](_0x6c4025)[_0x8f37('0x25')]();};}function respondWithResult(_0xf8475e,_0xaf1ff4){_0xaf1ff4=_0xaf1ff4||0xc8;return function(_0x20cc37){if(_0x20cc37){return _0xf8475e[_0x8f37('0x26')](_0xaf1ff4)[_0x8f37('0x27')](_0x20cc37);}};}function respondWithFilteredResult(_0x517bc4,_0x1f436c){return function(_0xc5ca7a){if(_0xc5ca7a){var _0x528383=typeof _0x1f436c[_0x8f37('0x28')]==='undefined'&&typeof _0x1f436c[_0x8f37('0x29')]==='undefined';var _0x15ab23=_0xc5ca7a[_0x8f37('0x2a')];var _0x34881a=_0x528383?0x0:_0x1f436c[_0x8f37('0x28')];var _0x132573=_0x528383?_0xc5ca7a['count']:_0x1f436c[_0x8f37('0x28')]+_0x1f436c[_0x8f37('0x29')];var _0x192c94;if(_0x132573>=_0x15ab23){_0x132573=_0x15ab23;_0x192c94=0xc8;}else{_0x192c94=0xce;}_0x517bc4[_0x8f37('0x26')](_0x192c94);return _0x517bc4[_0x8f37('0x2b')]('Content-Range',_0x34881a+'-'+_0x132573+'/'+_0x15ab23)['json'](_0xc5ca7a);}return null;};}function saveUpdates(_0x147ada){return function(_0xe98fd7){if(_0xe98fd7){return _0xe98fd7['update'](_0x147ada)[_0x8f37('0x19')](function(_0x52852b){return _0x52852b;});}return null;};}function removeEntity(_0x2fb30a){return function(_0xbde708){if(_0xbde708){return _0xbde708[_0x8f37('0x2c')]()[_0x8f37('0x19')](function(){_0x2fb30a[_0x8f37('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0xff8a68){return function(_0x38087e){if(!_0x38087e){_0xff8a68[_0x8f37('0x2d')](0x194);}return _0x38087e;};}function handleError(_0x26b5eb,_0x373faf){_0x373faf=_0x373faf||0x1f4;return function(_0x4614c0){logger[_0x8f37('0x1f')](_0x4614c0[_0x8f37('0x2e')]);if(_0x4614c0[_0x8f37('0x2f')]){delete _0x4614c0[_0x8f37('0x2f')];}_0x26b5eb['status'](_0x373faf)['send'](_0x4614c0);};}function getMustacheRender(_0x44abab,_0x36c9b0){return Mustache[_0x8f37('0x30')](_0x44abab,_[_0x8f37('0x31')](_0x36c9b0['body'],{'contact':_0x36c9b0['contact'],'message':_0x36c9b0[_0x8f37('0x21')],'agent':_0x36c9b0['agent'],'interaction':_0x36c9b0[_0x8f37('0x32')],'account':_0x36c9b0[_0x8f37('0x33')]}))||'';}exports[_0x8f37('0x34')]=function(_0x1d5e13,_0x4da227){var _0x1cd378={};var _0x7c0249=_['map'](db[_0x8f37('0x35')]['rawAttributes'],function(_0x22fd6f){return{'name':_0x22fd6f[_0x8f37('0x36')],'type':_0x22fd6f['type']['key']};});_0x1cd378=qs[_0x8f37('0x37')](_0x7c0249,_0x1d5e13);return interaction[_0x8f37('0x38')](_0x8f37('0x39'),_0x1d5e13['query'],_0x1d5e13[_0x8f37('0x3a')],_0x1cd378,_0x7c0249)[_0x8f37('0x19')](respondWithFilteredResult(_0x4da227,_0x1cd378))[_0x8f37('0x24')](handleError(_0x4da227,null));};exports[_0x8f37('0x3b')]=function(_0x230351,_0x3968bf){var _0x1549ec={'raw':![],'where':{'id':_0x230351[_0x8f37('0x3c')]['id']}},_0x3830c4={};_0x3830c4[_0x8f37('0x3d')]=_[_0x8f37('0x3e')](db[_0x8f37('0x35')][_0x8f37('0x3f')]);_0x3830c4['query']=_[_0x8f37('0x3e')](_0x230351['query']);_0x3830c4[_0x8f37('0x40')]=_[_0x8f37('0x41')](_0x3830c4[_0x8f37('0x3d')],_0x3830c4[_0x8f37('0x42')]);_0x1549ec['attributes']=_['intersection'](_0x3830c4[_0x8f37('0x3d')],qs[_0x8f37('0x43')](_0x230351[_0x8f37('0x42')][_0x8f37('0x43')]));_0x1549ec[_0x8f37('0x44')]=_0x1549ec[_0x8f37('0x44')][_0x8f37('0x45')]?_0x1549ec[_0x8f37('0x44')]:_0x3830c4['model'];if(_0x230351['query'][_0x8f37('0x46')]){_0x1549ec[_0x8f37('0x47')]=[{'all':!![]}];}_0x1549ec=_['merge']({},_0x1549ec,_0x230351[_0x8f37('0x48')]);return db[_0x8f37('0x35')][_0x8f37('0x49')](_0x1549ec)['then'](handleEntityNotFound(_0x3968bf,null))[_0x8f37('0x19')](respondWithResult(_0x3968bf,null))[_0x8f37('0x24')](handleError(_0x3968bf,null));};exports[_0x8f37('0x4a')]=function(_0x401c5f,_0x14e43f){return db[_0x8f37('0x35')][_0x8f37('0x4a')](_0x401c5f['body'],{})[_0x8f37('0x19')](respondWithResult(_0x14e43f,0xc9))[_0x8f37('0x24')](handleError(_0x14e43f,null));};exports[_0x8f37('0x4b')]=function(_0x410dd4,_0xbccb24){if(_0x410dd4[_0x8f37('0x4c')]['id']){delete _0x410dd4['body']['id'];}return db[_0x8f37('0x35')][_0x8f37('0x49')]({'where':{'id':_0x410dd4[_0x8f37('0x3c')]['id']}})[_0x8f37('0x19')](handleEntityNotFound(_0xbccb24,null))[_0x8f37('0x19')](saveUpdates(_0x410dd4[_0x8f37('0x4c')],null))['then'](respondWithResult(_0xbccb24,null))[_0x8f37('0x24')](handleError(_0xbccb24,null));};exports[_0x8f37('0x2c')]=function(_0x1a5d68,_0xbeec17){return db[_0x8f37('0x35')][_0x8f37('0x49')]({'where':{'id':_0x1a5d68[_0x8f37('0x3c')]['id']}})[_0x8f37('0x19')](handleEntityNotFound(_0xbeec17,null))[_0x8f37('0x19')](removeEntity(_0xbeec17,null))[_0x8f37('0x24')](handleError(_0xbeec17,null));};exports['describe']=function(_0x654d8e,_0x82b688){return db['ChatInteraction'][_0x8f37('0x4d')]()[_0x8f37('0x19')](respondWithResult(_0x82b688,null))[_0x8f37('0x24')](handleError(_0x82b688,null));};exports[_0x8f37('0x4e')]=function(_0x2cd9ea,_0x533ef2){var _0x474331=_0x2cd9ea[_0x8f37('0x3c')]['id'];var _0x39e9e4;var _0x1921df;var _0x673b7d;return db[_0x8f37('0x35')][_0x8f37('0x4f')]({'where':{'id':_0x474331}})['then'](function(_0x2856ff){_0x39e9e4=_0x2856ff;return db[_0x8f37('0x50')][_0x8f37('0x4f')]({'where':{'id':_0x2856ff[_0x8f37('0x51')]},'attributes':['id',_0x8f37('0x52'),_0x8f37('0x53'),_0x8f37('0x54'),_0x8f37('0x55'),'vidaooMetadata'],'raw':!![]});})[_0x8f37('0x19')](function(_0xb14342){if(_0xb14342&&_0xb14342['vidaooApiKey']&&_0xb14342[_0x8f37('0x53')]){_0x1921df=_0xb14342;var _0x1797b2={'interaction':{'id':_0x474331},'agent':{'id':_0x2cd9ea[_0x8f37('0x3a')]['id'],'name':_0x2cd9ea[_0x8f37('0x3a')][_0x8f37('0x2f')],'fullname':_0x2cd9ea['user'][_0x8f37('0x56')],'email':_0x2cd9ea[_0x8f37('0x3a')]['email']},'contact':_0x2cd9ea[_0x8f37('0x4c')][_0x8f37('0x57')],'account':_0x2cd9ea[_0x8f37('0x4c')]['account']};var _0x7cad03={'rejectUnauthorized':![],'method':_0x8f37('0x58'),'url':_0x8f37('0x59'),'headers':{'X-APIKEY':_0xb14342['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2cd9ea[_0x8f37('0x3a')][_0x8f37('0x5a')]],'buttons':null,'topic':_0x1921df['vidaooTopic'],'note':_['isNull'](_0x1921df[_0x8f37('0x55')])?null:getMustacheRender(_0x1921df[_0x8f37('0x55')],_0x1797b2),'metadata':null},'redirect':_0x8f37('0x5b'),'json':!![]};try{if(!_[_0x8f37('0x5c')](_0x1921df[_0x8f37('0x5d')])){var _0x5eb841=getMustacheRender(_0x1921df['vidaooMetadata'],_0x1797b2);var _0x1043a5=JSON[_0x8f37('0x5e')](_0x5eb841);_0x7cad03['body'][_0x8f37('0x5f')]=_0x1043a5;}}catch(_0xf26cd2){throw new db[(_0x8f37('0x60'))][(_0x8f37('0x61'))](_0x8f37('0x62'));}return rp(_0x7cad03);}else{throw new db['Sequelize'][(_0x8f37('0x61'))](_0x8f37('0x63'));}})[_0x8f37('0x19')](function(_0xe7b740){_0x673b7d=_0xe7b740;if(_0x673b7d['id']){var _0x475f2f={'body':_0x673b7d['join_url'],'ChatWebsiteId':_0x1921df['id'],'ChatInteractionId':_0x39e9e4['id'],'direction':_0x8f37('0x64'),'UserId':_0x2cd9ea[_0x8f37('0x3a')]['id']};return db[_0x8f37('0x65')][_0x8f37('0x4a')](_0x475f2f,{});}else{throw new db['Sequelize']['ValidationError'](_0x8f37('0x66'));}})['then'](function(){return _0x39e9e4['updateAttributes']({'vidaooSessionId':_0x673b7d['id']});})[_0x8f37('0x19')](respondWithResult(_0x533ef2,null))[_0x8f37('0x24')](handleError(_0x533ef2,null));};exports[_0x8f37('0x67')]=function(_0x434e26,_0x1eaef8){if(_0x434e26[_0x8f37('0x4c')]['id']){delete _0x434e26[_0x8f37('0x4c')]['id'];}return db[_0x8f37('0x35')]['find']({'where':{'id':_0x434e26[_0x8f37('0x3c')]['id']},'include':[{'model':db['CmContact'],'as':_0x8f37('0x68')}]})[_0x8f37('0x19')](handleEntityNotFound(_0x1eaef8,null))['then'](saveUpdates(_0x434e26[_0x8f37('0x4c')],null))[_0x8f37('0x19')](respondWithResult(_0x1eaef8,null))[_0x8f37('0x24')](handleError(_0x1eaef8,null));};exports[_0x8f37('0x69')]=function(_0x34a77f,_0x4bd5c6){if(_0x34a77f[_0x8f37('0x4c')]['id']){delete _0x34a77f[_0x8f37('0x4c')]['id'];}return db[_0x8f37('0x35')][_0x8f37('0x49')]({'where':{'id':_0x34a77f[_0x8f37('0x3c')]['id']}})[_0x8f37('0x19')](function(_0x493039){if(!_0x493039){logger['error'](_0x8f37('0x6a'),_0x8f37('0x69'),0x194,'entity\x20not\x20found');_0x4bd5c6[_0x8f37('0x2d')](0x194);}else{if(_0x493039[_0x8f37('0x6b')]){throw new db[(_0x8f37('0x60'))][(_0x8f37('0x61'))](_0x8f37('0x6c'));}}return _0x493039;})[_0x8f37('0x19')](function(_0x57d41e){if(_0x57d41e){return _0x57d41e[_0x8f37('0x4b')]({'closed':_0x34a77f[_0x8f37('0x4c')][_0x8f37('0x6d')],'disposition':_0x34a77f['body']['disposition']})[_0x8f37('0x19')](function(_0x4f75da){return _0x4f75da;});}})[_0x8f37('0x19')](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0x34a77f[_0x8f37('0x4c')],client9004);})[_0x8f37('0x19')](respondWithResult(_0x4bd5c6,null))[_0x8f37('0x24')](handleError(_0x4bd5c6,null));};exports[_0x8f37('0x6e')]=function(_0x12f335,_0x1d360f){_0x12f335[_0x8f37('0x4c')][_0x8f37('0x2f')]=_0x12f335[_0x8f37('0x6f')][_0x8f37('0x70')];_0x12f335['body']['basename']=_0x12f335[_0x8f37('0x6f')][_0x8f37('0x71')];_0x12f335['body']['type']=_0x12f335[_0x8f37('0x6f')]['mimetype'];return db[_0x8f37('0x72')][_0x8f37('0x4a')](_0x12f335[_0x8f37('0x4c')])[_0x8f37('0x19')](respondWithResult(_0x1d360f,0xc9))[_0x8f37('0x24')](handleError(_0x1d360f,null));};exports[_0x8f37('0x73')]=function(_0x5e4dbc,_0x430ac9){return db['ChatInteraction']['findOne']({'where':{'id':_0x5e4dbc['params']['id']},'raw':!![]})[_0x8f37('0x19')](handleEntityNotFound(_0x430ac9,null))[_0x8f37('0x19')](function(_0x4e3a0e){if(_0x4e3a0e){if(_0x4e3a0e[_0x8f37('0x6d')]){return _0x430ac9[_0x8f37('0x26')](0x193)[_0x8f37('0x27')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment']['findOne']({'where':{'id':_0x5e4dbc[_0x8f37('0x42')][_0x8f37('0x74')]},'raw':!![]})['then'](handleEntityNotFound(_0x430ac9,null));}})[_0x8f37('0x19')](function(_0x1b11d6){if(_0x1b11d6){var _0x5c65db=_0x1b11d6['ChatOfflineMessageId']!==null;var _0x193f82=path['join'](config[_0x8f37('0x75')],'server/files/attachments/');if(_0x5c65db){_0x193f82=path['join'](_0x193f82,_0x8f37('0x76'));}var _0xdb5263=path[_0x8f37('0x77')](_0x193f82,_0x1b11d6[_0x8f37('0x78')]);return _0x430ac9[_0x8f37('0x79')](_0xdb5263);}})[_0x8f37('0x24')](handleError(_0x430ac9,null));};exports[_0x8f37('0x7a')]=function(_0x290056,_0x55c272){var _0x34b2be=null;var _0x19a697=null;var _0x280a59=null;if(_0x290056[_0x8f37('0x4c')]['id']){delete _0x290056[_0x8f37('0x4c')]['id'];}if(_0x290056[_0x8f37('0x4c')][_0x8f37('0x7b')]){_0x280a59=path[_0x8f37('0x77')](config[_0x8f37('0x75')],_0x8f37('0x7c'),util['format'](_0x8f37('0x7d'),Date[_0x8f37('0x7e')]()));_0x290056[_0x8f37('0x4c')][_0x8f37('0x7f')]=_0x280a59;}return db[_0x8f37('0x35')][_0x8f37('0x49')]({'where':{'id':_0x290056[_0x8f37('0x3c')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x8f37('0x80'),'include':[{'model':db[_0x8f37('0x81')],'as':_0x8f37('0x81')}]}]})[_0x8f37('0x19')](handleEntityNotFound(_0x55c272,null))[_0x8f37('0x19')](saveUpdates(_0x290056[_0x8f37('0x4c')],null))[_0x8f37('0x19')](function(_0x458b96){if(_0x458b96){_0x34b2be=_0x458b96;return db['ChatWebsite']['find']({'where':{'id':_0x34b2be['ChatWebsiteId']}});}})[_0x8f37('0x19')](function(_0x1461b9){if(_0x1461b9){_0x19a697=_0x1461b9;return db[_0x8f37('0x82')]['find']({'where':{'id':_0x34b2be[_0x8f37('0x83')]}});}})[_0x8f37('0x19')](function(_0x24460b){if(_0x24460b){if(_0x280a59){var _0x20b824=null;for(var _0xf799f=0x1;_0xf799f<_0x34b2be[_0x8f37('0x80')]['length'];++_0xf799f){_0x20b824=_0x34b2be[_0x8f37('0x80')][_0xf799f];var _0x35373a=_0x20b824['UserId']?util[_0x8f37('0x84')]('%s%d',_0x19a697[_0x8f37('0x85')],_0x20b824[_0x8f37('0x6b')]):_0x8f37('0x86');var _0x4ac5c6=_0x290056[_0x8f37('0x4c')][_0x8f37('0x87')]||util['format'](_0x8f37('0x88'),_0x8f37('0x89'),_0x20b824[_0x8f37('0x83')]);switch(_0x19a697[_0x8f37('0x8a')]){case _0x8f37('0x8b'):_0x35373a=_0x20b824[_0x8f37('0x6b')]?util[_0x8f37('0x84')](_0x8f37('0x88'),_0x19a697[_0x8f37('0x85')],_0x20b824[_0x8f37('0x6b')]):_0x8f37('0x86');break;case _0x8f37('0x8c'):_0x35373a=_0x20b824['UserId']?_0x20b824[_0x8f37('0x81')][_0x8f37('0x8d')]||_0x20b824[_0x8f37('0x81')][_0x8f37('0x56')]:_0x8f37('0x86');break;case _0x8f37('0x8e'):_0x35373a=_0x20b824[_0x8f37('0x6b')]?_0x20b824[_0x8f37('0x81')][_0x8f37('0x56')]:'System';break;default:_0x35373a=_0x20b824[_0x8f37('0x6b')]?util[_0x8f37('0x84')]('%s%d',_0x19a697[_0x8f37('0x85')],_0x20b824[_0x8f37('0x6b')]):_0x8f37('0x86');}var _0x5ce2ec=util[_0x8f37('0x84')](_0x8f37('0x8f'),moment(_0x20b824['createdAt'])[_0x8f37('0x84')]('MM/DD/YYYY\x20HH:mm:ss'),_0x20b824[_0x8f37('0x90')]==='in'?_0x4ac5c6:_0x35373a,_0x20b824['body']);if(!_0x20b824[_0x8f37('0x91')]){fs[_0x8f37('0x92')](_0x280a59,_0x5ce2ec);}}return db[_0x8f37('0x93')][_0x8f37('0x4f')]({'where':{'service':!![]},'include':[{'model':db[_0x8f37('0x94')],'as':_0x8f37('0x95'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x8f37('0x96'),'raw':!![]}]}]});}}})['then'](function(_0x43f16f){if(!_0x43f16f||!_0x43f16f[_0x8f37('0x95')]||!_0x290056[_0x8f37('0x4c')])return _0x34b2be;var _0x414cff=_0x43f16f['getSmtpOptions']();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x414cff,'message':{'from':util['format'](_0x8f37('0x97'),_0x43f16f[_0x8f37('0x2f')],_0x43f16f[_0x8f37('0x5a')]||_0x43f16f['Smtp'][_0x8f37('0x3a')]),'to':_0x290056[_0x8f37('0x4c')][_0x8f37('0x7b')],'subject':_0x8f37('0x98'),'text':util[_0x8f37('0x84')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x290056[_0x8f37('0x4c')]['mailTranscript']),'attachments':[{'path':_0x280a59}]}})['then'](function(){return _0x34b2be;})[_0x8f37('0x24')](function(_0x56bade){logger[_0x8f37('0x1f')](_0x56bade);});})[_0x8f37('0x19')](respondWithStatusCode(_0x55c272,0xc8))[_0x8f37('0x24')](handleError(_0x55c272,null));};exports[_0x8f37('0x99')]=function(_0x1b0343,_0x15b4fc){return db[_0x8f37('0x65')][_0x8f37('0x49')]({'where':{'id':_0x1b0343[_0x8f37('0x3c')]['id']}})[_0x8f37('0x19')](handleEntityNotFound(_0x15b4fc,null))[_0x8f37('0x19')](function(_0x3f0510){if(_0x3f0510){return _0x3f0510['addMessage'](_0x1b0343[_0x8f37('0x4c')][_0x8f37('0x9a')],_[_0x8f37('0x9b')](_0x1b0343[_0x8f37('0x4c')],[_0x8f37('0x9a'),'id'])||{});}})[_0x8f37('0x19')](respondWithResult(_0x15b4fc,null))[_0x8f37('0x24')](handleError(_0x15b4fc,null));};exports[_0x8f37('0x9c')]=function(_0x4431b2,_0x14f091){var _0x1809f5={'raw':![],'where':{}};var _0x38d0f3={};var _0x14ff6c={'count':0x0,'rows':[]};return db[_0x8f37('0x35')][_0x8f37('0x4f')]({'where':{'id':_0x4431b2['params']['id']}})[_0x8f37('0x19')](handleEntityNotFound(_0x14f091,null))[_0x8f37('0x19')](function(_0x4909f3){if(_0x4909f3){_0x38d0f3[_0x8f37('0x3d')]=_[_0x8f37('0x3e')](db[_0x8f37('0x65')]['rawAttributes']);_0x38d0f3['query']=_[_0x8f37('0x3e')](_0x4431b2[_0x8f37('0x42')]);_0x38d0f3[_0x8f37('0x40')]=_[_0x8f37('0x41')](_0x38d0f3[_0x8f37('0x3d')],_0x38d0f3['query']);_0x1809f5[_0x8f37('0x44')]=_[_0x8f37('0x41')](_0x38d0f3[_0x8f37('0x3d')],qs['fields'](_0x4431b2[_0x8f37('0x42')]['fields']));_0x1809f5[_0x8f37('0x44')]=_0x1809f5[_0x8f37('0x44')]['length']?_0x1809f5[_0x8f37('0x44')]:_0x38d0f3[_0x8f37('0x3d')];if(!_0x4431b2['query'][_0x8f37('0x9d')]('nolimit')){_0x1809f5[_0x8f37('0x29')]=qs[_0x8f37('0x29')](_0x4431b2[_0x8f37('0x42')][_0x8f37('0x29')]);_0x1809f5[_0x8f37('0x28')]=qs[_0x8f37('0x28')](_0x4431b2['query'][_0x8f37('0x28')]);}_0x1809f5[_0x8f37('0x9e')]=qs['sort'](_0x4431b2[_0x8f37('0x42')][_0x8f37('0x9f')]);_0x1809f5[_0x8f37('0xa0')]=qs['filters'](_[_0x8f37('0xa1')](_0x4431b2[_0x8f37('0x42')],_0x38d0f3[_0x8f37('0x40')]));_0x1809f5[_0x8f37('0xa0')][_0x8f37('0xa2')]=_0x4909f3['id'];if(_0x4431b2[_0x8f37('0x42')][_0x8f37('0xa3')]){_0x1809f5[_0x8f37('0xa0')]=_[_0x8f37('0x31')](_0x1809f5[_0x8f37('0xa0')],{'$or':_[_0x8f37('0xa4')](_0x1809f5[_0x8f37('0x44')],function(_0x2c108f){var _0x3cd7d0={};_0x3cd7d0[_0x2c108f]={'$like':'%'+_0x4431b2[_0x8f37('0x42')][_0x8f37('0xa3')]+'%'};return _0x3cd7d0;})});}if(_0x4431b2[_0x8f37('0x42')][_0x8f37('0xa5')]){var _0xc3e13f=_0x4431b2['query'][_0x8f37('0xa5')][_0x8f37('0xa6')](',');var _0x40bf79={};_0x40bf79[_0xc3e13f[0x0]]={'$gte':moment(_0xc3e13f[0x1])[_0x8f37('0x84')](_0x8f37('0xa7'))};_0x1809f5[_0x8f37('0xa0')]=_[_0x8f37('0x31')](_0x1809f5[_0x8f37('0xa0')],_0x40bf79);}_0x1809f5=_[_0x8f37('0x31')]({},_0x1809f5,_0x4431b2[_0x8f37('0x48')]);return db['ChatMessage'][_0x8f37('0x2a')]({'where':_0x1809f5['where']})[_0x8f37('0x19')](function(_0x3d1455){_0x14ff6c[_0x8f37('0x2a')]=_0x3d1455;if(_0x4431b2[_0x8f37('0x42')][_0x8f37('0x46')]){_0x1809f5['include']=[{'all':!![]}];}return db[_0x8f37('0x65')][_0x8f37('0x38')](_0x1809f5);})[_0x8f37('0x19')](function(_0x5d6f2f){_0x14ff6c['rows']=_0x5d6f2f;return _0x14ff6c;});}})['then'](respondWithFilteredResult(_0x14f091,_0x1809f5))[_0x8f37('0x24')](handleError(_0x14f091,null));};exports[_0x8f37('0xa8')]=function(_0x3c9552,_0xe98a86){var _0x4a459d={'where':{}},_0x33c8d6={},_0x5ebb6e={'count':0x0,'rows':[]};return db[_0x8f37('0x35')][_0x8f37('0x4f')]({'where':{'id':_0x3c9552[_0x8f37('0x3c')]['id']}})['then'](handleEntityNotFound(_0xe98a86,null))[_0x8f37('0x19')](function(_0x1a005d){if(_0x1a005d){_0x33c8d6[_0x8f37('0x3d')]=_['keys'](db[_0x8f37('0x65')]['rawAttributes']);_0x33c8d6[_0x8f37('0x42')]=_[_0x8f37('0x3e')](_0x3c9552[_0x8f37('0x42')]);_0x33c8d6['filters']=_[_0x8f37('0x41')](_0x33c8d6[_0x8f37('0x3d')],_0x33c8d6[_0x8f37('0x42')]);_0x4a459d[_0x8f37('0x44')]=_[_0x8f37('0x41')](_0x33c8d6['model'],qs[_0x8f37('0x43')](_0x3c9552[_0x8f37('0x42')][_0x8f37('0x43')]));_0x4a459d[_0x8f37('0x44')]=_0x4a459d[_0x8f37('0x44')][_0x8f37('0x45')]?_0x4a459d[_0x8f37('0x44')]:_0x33c8d6[_0x8f37('0x3d')];if(!_0x3c9552[_0x8f37('0x42')]['hasOwnProperty'](_0x8f37('0xa9'))){_0x4a459d[_0x8f37('0x29')]=qs[_0x8f37('0x29')](_0x3c9552[_0x8f37('0x42')]['limit']);_0x4a459d[_0x8f37('0x28')]=qs[_0x8f37('0x28')](_0x3c9552[_0x8f37('0x42')][_0x8f37('0x28')]);}_0x4a459d[_0x8f37('0x9e')]=qs[_0x8f37('0x9f')](_0x3c9552[_0x8f37('0x42')][_0x8f37('0x9f')]);_0x4a459d[_0x8f37('0xa0')]=qs['filters'](_['pick'](_0x3c9552[_0x8f37('0x42')],_0x33c8d6['filters']));_0x4a459d[_0x8f37('0xa0')][_0x8f37('0xa2')]=_0x1a005d['id'];if(_0x3c9552['query'][_0x8f37('0xa3')]){_0x4a459d[_0x8f37('0xa0')]=_[_0x8f37('0x31')](_0x4a459d['where'],{'$or':_[_0x8f37('0xa4')](_0x4a459d[_0x8f37('0x44')],function(_0x26292e){var _0x1cec20={};_0x1cec20[_0x26292e]={'$like':'%'+_0x3c9552[_0x8f37('0x42')][_0x8f37('0xa3')]+'%'};return _0x1cec20;})});}_0x4a459d[_0x8f37('0xa0')][_0x8f37('0x91')]=![];if(_0x3c9552[_0x8f37('0x42')]['id']){_0x4a459d['where']['id']={'$gt':_0x3c9552['query']['id']};}_0x4a459d=_[_0x8f37('0x31')]({},_0x4a459d,_0x3c9552['options']);return db[_0x8f37('0x65')][_0x8f37('0x2a')]({'where':_0x4a459d[_0x8f37('0xa0')]})[_0x8f37('0x19')](function(_0x33cac2){_0x5ebb6e[_0x8f37('0x2a')]=_0x33cac2;_0x4a459d[_0x8f37('0x47')]=[];if(_0x3c9552[_0x8f37('0x42')][_0x8f37('0xaa')]){_0x4a459d['include'][_0x8f37('0xab')]({'model':db[_0x8f37('0x81')],'as':'User','attributes':['id',_0x8f37('0x56'),'alias']});}if(_0x3c9552['query'][_0x8f37('0x46')]){_0x4a459d[_0x8f37('0x47')]=[{'all':!![]}];}return db[_0x8f37('0x65')][_0x8f37('0x38')](_0x4a459d);})[_0x8f37('0x19')](function(_0x597edf){_0x5ebb6e['rows']=_0x597edf;return _0x5ebb6e;});}})[_0x8f37('0x19')](respondWithFilteredResult(_0xe98a86,_0x4a459d))[_0x8f37('0x24')](handleError(_0xe98a86,null));};exports[_0x8f37('0xac')]=function(_0x486ade,_0x32ad3b){return db['ChatInteraction'][_0x8f37('0x49')]({'where':{'id':_0x486ade[_0x8f37('0x3c')]['id']}})[_0x8f37('0x19')](handleEntityNotFound(_0x32ad3b,null))[_0x8f37('0x19')](function(_0x72fc5e){if(_0x72fc5e){return _0x72fc5e[_0x8f37('0xad')](_0x486ade['body'][_0x8f37('0x9a')],_['omit'](_0x486ade[_0x8f37('0x4c')],['ids','id'])||{})[_0x8f37('0xae')](function(){return db[_0x8f37('0xaf')]['findAll']({'attributes':['id',_0x8f37('0x2f'),'color'],'where':{'id':_0x486ade['body'][_0x8f37('0x9a')]}});})[_0x8f37('0x19')](function(_0x4d7bc2){socket[_0x8f37('0xb0')](_0x8f37('0xb1'),{'id':Number(_0x486ade[_0x8f37('0x3c')]['id']),'tags':_0x4d7bc2||[]});return{'id':Number(_0x486ade['params']['id']),'tags':_0x4d7bc2||[]};});}})[_0x8f37('0x19')](respondWithResult(_0x32ad3b,null))[_0x8f37('0x24')](handleError(_0x32ad3b,null));};exports[_0x8f37('0xb2')]=function(_0x3cbe49,_0x31ee87){return db[_0x8f37('0x35')][_0x8f37('0x49')]({'where':{'id':_0x3cbe49[_0x8f37('0x3c')]['id']}})['then'](handleEntityNotFound(_0x31ee87,null))[_0x8f37('0x19')](function(_0x46553b){if(_0x46553b){return _0x46553b[_0x8f37('0xb2')](_0x3cbe49[_0x8f37('0x42')][_0x8f37('0x9a')]);}})[_0x8f37('0x19')](respondWithStatusCode(_0x31ee87,null))[_0x8f37('0x24')](handleError(_0x31ee87,null));};exports[_0x8f37('0x79')]=function(_0x18755e,_0x9ca19b){var _0x37e8be=moment()[_0x8f37('0xb3')]()[_0x8f37('0xb4')]();var _0x53a9f1=path[_0x8f37('0x77')](config[_0x8f37('0x75')],_0x8f37('0xb5'),_0x8f37('0xb6'),_0x8f37('0xb7'));var _0xbe2b04=path[_0x8f37('0x77')](config[_0x8f37('0x75')],_0x8f37('0xb5'),'files',_0x8f37('0xb8'));var _0x46f1ac=path[_0x8f37('0x77')](_0x53a9f1,_0x37e8be);var _0x234344=util[_0x8f37('0x84')](_0x8f37('0xb9'),_0x18755e[_0x8f37('0x3c')]['id'],_0x37e8be);var _0x5618a5=path[_0x8f37('0x77')](_0x53a9f1,_0x234344);var _0x4cc480=[];_0x4cc480[_0x8f37('0xab')]({'model':db[_0x8f37('0x81')],'as':_0x8f37('0x81'),'attributes':['id',_0x8f37('0x56')],'raw':!![]});_0x4cc480[_0x8f37('0xab')]({'model':db[_0x8f37('0x82')],'as':_0x8f37('0x68'),'attributes':['id',_0x8f37('0xba'),'lastName'],'raw':!![]});if(_0x18755e['query'][_0x8f37('0xb8')]){_0x4cc480[_0x8f37('0xab')]({'model':db['Attachment'],'as':_0x8f37('0x72'),'raw':!![]});}var _0x30a794=[{'model':db[_0x8f37('0x65')],'as':_0x8f37('0x80'),'attributes':['id','body','createdAt',_0x8f37('0x90'),'secret',_0x8f37('0xbb')],'include':_0x4cc480}];_0x30a794[_0x8f37('0xab')]({'model':db[_0x8f37('0x50')],'as':_0x8f37('0xbc'),'attributes':['id','name']});_0x30a794[_0x8f37('0xab')]({'model':db[_0x8f37('0x81')],'as':'Owner','attributes':['id',_0x8f37('0x56')]});return db['ChatInteraction']['find']({'where':{'id':_0x18755e['params']['id']},'include':_0x30a794})[_0x8f37('0x19')](handleEntityNotFound(_0x9ca19b,null))[_0x8f37('0x19')](function(_0x11c9bd){if(_0x11c9bd){var _0x1cf4e3=_0x11c9bd[_0x8f37('0xbd')]({'plain':!![]});fs[_0x8f37('0xbe')](_0x46f1ac);var _0x55c5b8={'channel':_0x8f37('0xbf'),'account':_0x1cf4e3[_0x8f37('0xbc')]['name'],'agent':_0x1cf4e3[_0x8f37('0xc0')]?_0x1cf4e3[_0x8f37('0xc0')]['fullname']:'N.A.','createdAt':moment(_0x1cf4e3[_0x8f37('0xc1')])[_0x8f37('0x84')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8f37('0xb4')](),'closedAt':_0x1cf4e3[_0x8f37('0x6d')]?moment(_0x1cf4e3['closedAt'])[_0x8f37('0x84')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8f37('0xb4')]():'','disposition':_0x1cf4e3[_0x8f37('0xc2')],'chatInfo':{'browser':_0x1cf4e3[_0x8f37('0xc3')],'os':_0x1cf4e3[_0x8f37('0xc4')],'referer':_0x1cf4e3[_0x8f37('0xc5')],'customerIp':_0x1cf4e3[_0x8f37('0xc6')],'customerPort':_0x1cf4e3[_0x8f37('0xc7')]?_0x1cf4e3['customerPort']:_0x8f37('0xc8')},'messages':_(_0x1cf4e3[_0x8f37('0x80')])['tail']()[_0x8f37('0xa3')]({'secret':![]})[_0x8f37('0xa4')](function(_0x48bb0f){if(_0x48bb0f[_0x8f37('0x72')]){var _0x4f46c1=path['join'](_0xbe2b04,_0x48bb0f[_0x8f37('0x72')]['basename']);if(fs[_0x8f37('0xc9')](_0x4f46c1)){fs[_0x8f37('0xca')](_0x4f46c1)[_0x8f37('0xcb')](fs['createWriteStream'](path['join'](_0x46f1ac,_0x48bb0f['Attachment'][_0x8f37('0x78')])));}}return{'date':moment(_0x48bb0f[_0x8f37('0xc1')])[_0x8f37('0x84')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x48bb0f[_0x8f37('0x90')]===_0x8f37('0x64')?_0x48bb0f['User']?_0x48bb0f[_0x8f37('0x81')][_0x8f37('0x56')]:'System':_0x48bb0f[_0x8f37('0x68')][_0x8f37('0xba')]+(_0x48bb0f['Contact'][_0x8f37('0xcc')]?'\x20'+_0x48bb0f[_0x8f37('0x68')][_0x8f37('0xcc')]:''),'body':_0x48bb0f[_0x8f37('0x72')]?_0x48bb0f['Attachment'][_0x8f37('0x78')]:_0x48bb0f[_0x8f37('0x4c')],'direction':_0x48bb0f['direction']===_0x8f37('0x64')?'A':'C','secret':_0x48bb0f['secret'],'read':_0x48bb0f[_0x8f37('0xbb')],'attachment':_0x48bb0f[_0x8f37('0x72')]};})['value']()};return ejs[_0x8f37('0xcd')](path[_0x8f37('0x77')](config['root'],'server',_0x8f37('0xce'),_0x8f37('0xcf')),{'interaction':_0x55c5b8})['then'](function(_0x347d63){var _0x2fbc35=path[_0x8f37('0x77')](_0x46f1ac,_0x8f37('0xd0')+_0x1cf4e3['id']+'-'+_0x37e8be+_0x8f37('0xd1'));var _0x5bc7fc={'path':_0x2fbc35,'channel':'Chat','interactionId':_0x1cf4e3['id']};return pdf[_0x8f37('0xd2')](_0x347d63,_0x5bc7fc);})[_0x8f37('0x19')](function(){return new Promise(function(_0x580174,_0x5caa23){zipdir(_0x46f1ac,{'saveTo':_0x5618a5},function(_0x106840,_0x2259cc){if(_0x106840)return _0x5caa23(_0x106840);return _0x580174(_0x2259cc);});})[_0x8f37('0x19')](function(){return new BPromise(function(_0x4d40a5,_0x27b231){rimraf(_0x46f1ac,function(_0x55ab6d){if(_0x55ab6d)_0x27b231(_0x55ab6d);return _0x4d40a5();});});})['then'](function(){return _0x9ca19b[_0x8f37('0x79')](_0x5618a5,_0x234344,function(_0x568cba){if(_0x568cba){logger[_0x8f37('0x1f')](_0x8f37('0xd3'),_0x568cba);}else{fs[_0x8f37('0xd4')](_0x5618a5);}});});});}else{return _0x9ca19b[_0x8f37('0x2d')](0xc8);}})[_0x8f37('0x24')](handleError(_0x9ca19b,null));};
\ No newline at end of file
+var _0x0cf2=['error','message','result','catch','status','limit','undefined','offset','count','Content-Range','json','update','end','stack','name','render','agent','interaction','index','map','rawAttributes','fieldName','type','findAll','chat','user','show','model','keys','query','filters','intersection','attributes','fields','include','merge','ChatInteraction','create','body','find','params','describe','findOne','ChatWebsite','vidaooApiKey','vidaooTopic','vidaooNote','vidaooEscalation','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','sendStatus','Interaction\x20already\x20assigned','closed','abandon','attachmentUpload','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','User','ContactId','length','UserId','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','System','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','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','hasOwnProperty','nolimit','order','sort','where','pick','filter','split','options','includeAll','rows','getMyMessages','ChatInteractionId','secret','includeAgent','setTags','spread','Tag','color','removeTags','download','unix','toString','server','files','tmp','attachments','push','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','browserName','osName','referer','customerIp','customerPort','N.A.','tail','createReadStream','pipe','createWriteStream','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x9ab959,_0x32f2e2){var _0x37fbe3=function(_0x1d9c28){while(--_0x1d9c28){_0x9ab959['push'](_0x9ab959['shift']());}};_0x37fbe3(++_0x32f2e2);}(_0x0cf2,0xb6));var _0x20cf=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x0cf2[_0xe66cf2];return _0x2d84e7;};'use strict';var rimraf=require(_0x20cf('0x0'));var zipdir=require(_0x20cf('0x1'));var rp=require('request-promise');var moment=require(_0x20cf('0x2'));var BPromise=require(_0x20cf('0x3'));var Mustache=require(_0x20cf('0x4'));var util=require(_0x20cf('0x5'));var path=require(_0x20cf('0x6'));var ejs=require(_0x20cf('0x7'));var fs=require('fs');var _=require(_0x20cf('0x8'));var Redis=require(_0x20cf('0x9'));var interaction=require(_0x20cf('0xa'));var qs=require('../../components/parsers/qs');var pdf=require(_0x20cf('0xb'));var logger=require(_0x20cf('0xc'))('api');var config=require(_0x20cf('0xd'));var db=require(_0x20cf('0xe'))['db'];config[_0x20cf('0xf')]=_['defaults'](config[_0x20cf('0xf')],{'host':_0x20cf('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x20cf('0xf')]));require('./chatInteraction.socket')[_0x20cf('0x11')](socket);var jayson=require(_0x20cf('0x12'));var client=jayson['client'][_0x20cf('0x13')]({'port':0x232b});var client9004=jayson[_0x20cf('0x14')][_0x20cf('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x24fa7c,_0x239dc7,_0x3cadae,_0x470cb1){return new BPromise(function(_0x5b0e95,_0x3f9ab1){var _0x2e8fdf=_0x470cb1||client;return _0x2e8fdf[_0x20cf('0x15')](_0x24fa7c,_0x3cadae)[_0x20cf('0x16')](function(_0xc8be91){logger[_0x20cf('0x17')](_0x20cf('0x18'),_0x239dc7,_0x20cf('0x19'));logger[_0x20cf('0x1a')](_0x20cf('0x1b'),_0x239dc7,_0x20cf('0x19'),JSON[_0x20cf('0x1c')](_0xc8be91));if(_0xc8be91[_0x20cf('0x1d')]){if(_0xc8be91[_0x20cf('0x1d')]['code']===0x1f4){logger[_0x20cf('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x239dc7,_0xc8be91[_0x20cf('0x1d')]['message']);return _0x3f9ab1(_0xc8be91[_0x20cf('0x1d')][_0x20cf('0x1e')]);}logger[_0x20cf('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x239dc7,_0xc8be91[_0x20cf('0x1d')]['message']);return _0x5b0e95(_0xc8be91[_0x20cf('0x1d')][_0x20cf('0x1e')]);}else{logger['info'](_0x20cf('0x18'),_0x239dc7,_0x20cf('0x19'));_0x5b0e95(_0xc8be91[_0x20cf('0x1f')][_0x20cf('0x1e')]);}})[_0x20cf('0x20')](function(_0x4aa17c){logger[_0x20cf('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x239dc7,_0x4aa17c);_0x3f9ab1(_0x4aa17c);});});}function respondWithStatusCode(_0x1ef71b,_0x13e0d1){_0x13e0d1=_0x13e0d1||0xcc;return function(_0x4ffc1a){if(_0x4ffc1a){return _0x1ef71b['sendStatus'](_0x13e0d1);}return _0x1ef71b[_0x20cf('0x21')](_0x13e0d1)['end']();};}function respondWithResult(_0x11924f,_0x4a3464){_0x4a3464=_0x4a3464||0xc8;return function(_0x2403af){if(_0x2403af){return _0x11924f[_0x20cf('0x21')](_0x4a3464)['json'](_0x2403af);}};}function respondWithFilteredResult(_0x2db25f,_0x1ecf73){return function(_0x4dccd6){if(_0x4dccd6){var _0x530ae3=typeof _0x1ecf73['offset']==='undefined'&&typeof _0x1ecf73[_0x20cf('0x22')]===_0x20cf('0x23');var _0x29c97a=_0x4dccd6['count'];var _0x1dce3d=_0x530ae3?0x0:_0x1ecf73[_0x20cf('0x24')];var _0x28d9a5=_0x530ae3?_0x4dccd6[_0x20cf('0x25')]:_0x1ecf73[_0x20cf('0x24')]+_0x1ecf73[_0x20cf('0x22')];var _0x193d2e;if(_0x28d9a5>=_0x29c97a){_0x28d9a5=_0x29c97a;_0x193d2e=0xc8;}else{_0x193d2e=0xce;}_0x2db25f['status'](_0x193d2e);return _0x2db25f['set'](_0x20cf('0x26'),_0x1dce3d+'-'+_0x28d9a5+'/'+_0x29c97a)[_0x20cf('0x27')](_0x4dccd6);}return null;};}function saveUpdates(_0x5c0f7c){return function(_0x4b846b){if(_0x4b846b){return _0x4b846b[_0x20cf('0x28')](_0x5c0f7c)[_0x20cf('0x16')](function(_0x4aa609){return _0x4aa609;});}return null;};}function removeEntity(_0x45294f){return function(_0x6f1d90){if(_0x6f1d90){return _0x6f1d90['destroy']()[_0x20cf('0x16')](function(){_0x45294f[_0x20cf('0x21')](0xcc)[_0x20cf('0x29')]();});}};}function handleEntityNotFound(_0x9ea48e){return function(_0x4fba82){if(!_0x4fba82){_0x9ea48e['sendStatus'](0x194);}return _0x4fba82;};}function handleError(_0xff9c20,_0x1a63ba){_0x1a63ba=_0x1a63ba||0x1f4;return function(_0x4de5e3){logger[_0x20cf('0x1d')](_0x4de5e3[_0x20cf('0x2a')]);if(_0x4de5e3[_0x20cf('0x2b')]){delete _0x4de5e3[_0x20cf('0x2b')];}_0xff9c20[_0x20cf('0x21')](_0x1a63ba)['send'](_0x4de5e3);};}function getMustacheRender(_0x246caf,_0x1bdbfd){return Mustache[_0x20cf('0x2c')](_0x246caf,_['merge'](_0x1bdbfd['body'],{'contact':_0x1bdbfd['contact'],'message':_0x1bdbfd[_0x20cf('0x1e')],'agent':_0x1bdbfd[_0x20cf('0x2d')],'interaction':_0x1bdbfd[_0x20cf('0x2e')],'account':_0x1bdbfd['account']}))||'';}exports[_0x20cf('0x2f')]=function(_0x431958,_0x22b950){var _0x24659f={};var _0x42281a=_[_0x20cf('0x30')](db['ChatInteraction'][_0x20cf('0x31')],function(_0x33837a){return{'name':_0x33837a[_0x20cf('0x32')],'type':_0x33837a[_0x20cf('0x33')]['key']};});_0x24659f=qs['getOptions'](_0x42281a,_0x431958);return interaction[_0x20cf('0x34')](_0x20cf('0x35'),_0x431958['query'],_0x431958[_0x20cf('0x36')],_0x24659f,_0x42281a)['then'](respondWithFilteredResult(_0x22b950,_0x24659f))[_0x20cf('0x20')](handleError(_0x22b950,null));};exports[_0x20cf('0x37')]=function(_0x1415b5,_0x295c0c){var _0x7c3d6={'raw':![],'where':{'id':_0x1415b5['params']['id']}},_0x41e45a={};_0x41e45a[_0x20cf('0x38')]=_[_0x20cf('0x39')](db['ChatInteraction'][_0x20cf('0x31')]);_0x41e45a['query']=_[_0x20cf('0x39')](_0x1415b5[_0x20cf('0x3a')]);_0x41e45a[_0x20cf('0x3b')]=_[_0x20cf('0x3c')](_0x41e45a[_0x20cf('0x38')],_0x41e45a['query']);_0x7c3d6[_0x20cf('0x3d')]=_[_0x20cf('0x3c')](_0x41e45a[_0x20cf('0x38')],qs[_0x20cf('0x3e')](_0x1415b5[_0x20cf('0x3a')]['fields']));_0x7c3d6[_0x20cf('0x3d')]=_0x7c3d6[_0x20cf('0x3d')]['length']?_0x7c3d6['attributes']:_0x41e45a['model'];if(_0x1415b5['query']['includeAll']){_0x7c3d6[_0x20cf('0x3f')]=[{'all':!![]}];}_0x7c3d6=_[_0x20cf('0x40')]({},_0x7c3d6,_0x1415b5['options']);return db[_0x20cf('0x41')]['find'](_0x7c3d6)[_0x20cf('0x16')](handleEntityNotFound(_0x295c0c,null))[_0x20cf('0x16')](respondWithResult(_0x295c0c,null))[_0x20cf('0x20')](handleError(_0x295c0c,null));};exports[_0x20cf('0x42')]=function(_0x30d548,_0x4dee71){return db[_0x20cf('0x41')][_0x20cf('0x42')](_0x30d548['body'],{})[_0x20cf('0x16')](respondWithResult(_0x4dee71,0xc9))[_0x20cf('0x20')](handleError(_0x4dee71,null));};exports[_0x20cf('0x28')]=function(_0x457f89,_0x5415cd){if(_0x457f89[_0x20cf('0x43')]['id']){delete _0x457f89[_0x20cf('0x43')]['id'];}return db[_0x20cf('0x41')][_0x20cf('0x44')]({'where':{'id':_0x457f89[_0x20cf('0x45')]['id']}})[_0x20cf('0x16')](handleEntityNotFound(_0x5415cd,null))['then'](saveUpdates(_0x457f89[_0x20cf('0x43')],null))[_0x20cf('0x16')](respondWithResult(_0x5415cd,null))['catch'](handleError(_0x5415cd,null));};exports['destroy']=function(_0x2b93df,_0x5049eb){return db[_0x20cf('0x41')]['find']({'where':{'id':_0x2b93df[_0x20cf('0x45')]['id']}})[_0x20cf('0x16')](handleEntityNotFound(_0x5049eb,null))[_0x20cf('0x16')](removeEntity(_0x5049eb,null))[_0x20cf('0x20')](handleError(_0x5049eb,null));};exports[_0x20cf('0x46')]=function(_0x55ae9d,_0x5585b4){return db['ChatInteraction'][_0x20cf('0x46')]()[_0x20cf('0x16')](respondWithResult(_0x5585b4,null))[_0x20cf('0x20')](handleError(_0x5585b4,null));};exports['createVidaooSession']=function(_0x2eb2d2,_0xed1182){var _0x1d2b62=_0x2eb2d2[_0x20cf('0x45')]['id'];var _0x26ca36;var _0x3ba8ab;var _0x3852e9;return db[_0x20cf('0x41')][_0x20cf('0x47')]({'where':{'id':_0x1d2b62}})['then'](function(_0x5e892d){_0x26ca36=_0x5e892d;return db[_0x20cf('0x48')][_0x20cf('0x47')]({'where':{'id':_0x5e892d['ChatWebsiteId']},'attributes':['id',_0x20cf('0x49'),'vidaooEscalation',_0x20cf('0x4a'),_0x20cf('0x4b'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x34be9c){if(_0x34be9c&&_0x34be9c[_0x20cf('0x49')]&&_0x34be9c[_0x20cf('0x4c')]){_0x3ba8ab=_0x34be9c;var _0x37e0fa={'interaction':{'id':_0x1d2b62},'agent':{'id':_0x2eb2d2['user']['id'],'name':_0x2eb2d2['user']['name'],'fullname':_0x2eb2d2[_0x20cf('0x36')][_0x20cf('0x4d')],'email':_0x2eb2d2['user'][_0x20cf('0x4e')]},'contact':_0x2eb2d2[_0x20cf('0x43')]['contact'],'account':_0x2eb2d2[_0x20cf('0x43')][_0x20cf('0x4f')]};var _0x47485d={'rejectUnauthorized':![],'method':_0x20cf('0x50'),'url':_0x20cf('0x51'),'headers':{'X-APIKEY':_0x34be9c[_0x20cf('0x49')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2eb2d2[_0x20cf('0x36')]['email']],'buttons':null,'topic':_0x3ba8ab['vidaooTopic'],'note':_[_0x20cf('0x52')](_0x3ba8ab['vidaooNote'])?null:getMustacheRender(_0x3ba8ab['vidaooNote'],_0x37e0fa),'metadata':null},'redirect':_0x20cf('0x53'),'json':!![]};try{if(!_[_0x20cf('0x52')](_0x3ba8ab[_0x20cf('0x54')])){var _0x15b8b2=getMustacheRender(_0x3ba8ab[_0x20cf('0x54')],_0x37e0fa);var _0x354979=JSON[_0x20cf('0x55')](_0x15b8b2);_0x47485d['body']['metadata']=_0x354979;}}catch(_0x219097){throw new db[(_0x20cf('0x56'))][(_0x20cf('0x57'))](_0x20cf('0x58'));}return rp(_0x47485d);}else{throw new db[(_0x20cf('0x56'))][(_0x20cf('0x57'))](_0x20cf('0x59'));}})[_0x20cf('0x16')](function(_0xc8dd97){_0x3852e9=_0xc8dd97;if(_0x3852e9['id']){var _0x17bb89={'body':_0x3852e9[_0x20cf('0x5a')],'ChatWebsiteId':_0x3ba8ab['id'],'ChatInteractionId':_0x26ca36['id'],'direction':_0x20cf('0x5b'),'UserId':_0x2eb2d2[_0x20cf('0x36')]['id']};return db[_0x20cf('0x5c')]['create'](_0x17bb89,{});}else{throw new db[(_0x20cf('0x56'))][(_0x20cf('0x57'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x20cf('0x16')](function(){return _0x26ca36[_0x20cf('0x5d')]({'vidaooSessionId':_0x3852e9['id']});})[_0x20cf('0x16')](respondWithResult(_0xed1182,null))[_0x20cf('0x20')](handleError(_0xed1182,null));};exports[_0x20cf('0x5e')]=function(_0x482411,_0x41d56f){if(_0x482411[_0x20cf('0x43')]['id']){delete _0x482411[_0x20cf('0x43')]['id'];}return db['ChatInteraction'][_0x20cf('0x44')]({'where':{'id':_0x482411['params']['id']},'include':[{'model':db[_0x20cf('0x5f')],'as':_0x20cf('0x60')}]})[_0x20cf('0x16')](handleEntityNotFound(_0x41d56f,null))[_0x20cf('0x16')](saveUpdates(_0x482411[_0x20cf('0x43')],null))[_0x20cf('0x16')](respondWithResult(_0x41d56f,null))['catch'](handleError(_0x41d56f,null));};exports['abandon']=function(_0x4810b2,_0x5be4b3){if(_0x4810b2[_0x20cf('0x43')]['id']){delete _0x4810b2[_0x20cf('0x43')]['id'];}return db[_0x20cf('0x41')][_0x20cf('0x44')]({'where':{'id':_0x4810b2['params']['id']}})[_0x20cf('0x16')](function(_0x1f0be4){if(!_0x1f0be4){logger[_0x20cf('0x1d')](_0x20cf('0x61'),'abandon',0x194,'entity\x20not\x20found');_0x5be4b3[_0x20cf('0x62')](0x194);}else{if(_0x1f0be4['UserId']){throw new db[(_0x20cf('0x56'))][(_0x20cf('0x57'))](_0x20cf('0x63'));}}return _0x1f0be4;})[_0x20cf('0x16')](function(_0x11e8c3){if(_0x11e8c3){return _0x11e8c3[_0x20cf('0x28')]({'closed':_0x4810b2[_0x20cf('0x43')][_0x20cf('0x64')],'disposition':_0x4810b2['body']['disposition']})['then'](function(_0x4ffebd){return _0x4ffebd;});}})[_0x20cf('0x16')](function(){return respondWithRpcPromise('AbandonInteraction',_0x20cf('0x65'),_0x4810b2[_0x20cf('0x43')],client9004);})[_0x20cf('0x16')](respondWithResult(_0x5be4b3,null))['catch'](handleError(_0x5be4b3,null));};exports[_0x20cf('0x66')]=function(_0x300e55,_0x9066d1){_0x300e55[_0x20cf('0x43')][_0x20cf('0x2b')]=_0x300e55[_0x20cf('0x67')]['originalname'];_0x300e55[_0x20cf('0x43')][_0x20cf('0x68')]=_0x300e55[_0x20cf('0x67')][_0x20cf('0x69')];_0x300e55[_0x20cf('0x43')][_0x20cf('0x33')]=_0x300e55['file'][_0x20cf('0x6a')];return db[_0x20cf('0x6b')][_0x20cf('0x42')](_0x300e55[_0x20cf('0x43')])[_0x20cf('0x16')](respondWithResult(_0x9066d1,0xc9))[_0x20cf('0x20')](handleError(_0x9066d1,null));};exports[_0x20cf('0x6c')]=function(_0x2b288a,_0x4fa955){return db[_0x20cf('0x41')]['findOne']({'where':{'id':_0x2b288a[_0x20cf('0x45')]['id']},'raw':!![]})[_0x20cf('0x16')](handleEntityNotFound(_0x4fa955,null))[_0x20cf('0x16')](function(_0x38fc00){if(_0x38fc00){if(_0x38fc00[_0x20cf('0x64')]){return _0x4fa955[_0x20cf('0x21')](0x193)[_0x20cf('0x27')]({'status':0x193,'message':_0x20cf('0x6d')});}return db['Attachment'][_0x20cf('0x47')]({'where':{'id':_0x2b288a[_0x20cf('0x3a')][_0x20cf('0x6e')]},'raw':!![]})['then'](handleEntityNotFound(_0x4fa955,null));}})[_0x20cf('0x16')](function(_0x1b1340){if(_0x1b1340){var _0x162b1e=_0x1b1340[_0x20cf('0x6f')]!==null;var _0xd51fd1=path[_0x20cf('0x70')](config[_0x20cf('0x71')],_0x20cf('0x72'));if(_0x162b1e){_0xd51fd1=path[_0x20cf('0x70')](_0xd51fd1,_0x20cf('0x73'));}var _0x1d4dc4=path[_0x20cf('0x70')](_0xd51fd1,_0x1b1340[_0x20cf('0x68')]);return _0x4fa955['download'](_0x1d4dc4);}})[_0x20cf('0x20')](handleError(_0x4fa955,null));};exports[_0x20cf('0x74')]=function(_0x4dba17,_0x7500a4){var _0x5d1dbe=null;var _0x4e21d5=null;var _0xb4627f=null;if(_0x4dba17['body']['id']){delete _0x4dba17[_0x20cf('0x43')]['id'];}if(_0x4dba17[_0x20cf('0x43')][_0x20cf('0x75')]){_0xb4627f=path[_0x20cf('0x70')](config[_0x20cf('0x71')],_0x20cf('0x76'),util[_0x20cf('0x77')](_0x20cf('0x78'),Date[_0x20cf('0x79')]()));_0x4dba17[_0x20cf('0x43')]['pathTranscript']=_0xb4627f;}return db['ChatInteraction'][_0x20cf('0x44')]({'where':{'id':_0x4dba17[_0x20cf('0x45')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x20cf('0x7a'),'include':[{'model':db[_0x20cf('0x7b')],'as':_0x20cf('0x7b')}]}]})[_0x20cf('0x16')](handleEntityNotFound(_0x7500a4,null))['then'](saveUpdates(_0x4dba17['body'],null))[_0x20cf('0x16')](function(_0x4fff12){if(_0x4fff12){_0x5d1dbe=_0x4fff12;return db[_0x20cf('0x48')]['find']({'where':{'id':_0x5d1dbe['ChatWebsiteId']}});}})[_0x20cf('0x16')](function(_0x599676){if(_0x599676){_0x4e21d5=_0x599676;return db[_0x20cf('0x5f')]['find']({'where':{'id':_0x5d1dbe[_0x20cf('0x7c')]}});}})[_0x20cf('0x16')](function(_0x32fbfa){if(_0x32fbfa){if(_0xb4627f){var _0xb12b95=null;for(var _0x164991=0x1;_0x164991<_0x5d1dbe[_0x20cf('0x7a')][_0x20cf('0x7d')];++_0x164991){_0xb12b95=_0x5d1dbe['Messages'][_0x164991];var _0x5ec54e=_0xb12b95[_0x20cf('0x7e')]?util[_0x20cf('0x77')](_0x20cf('0x7f'),_0x4e21d5[_0x20cf('0x80')],_0xb12b95['UserId']):'System';var _0x130d32=_0x4dba17['body'][_0x20cf('0x81')]||util[_0x20cf('0x77')](_0x20cf('0x7f'),_0x20cf('0x82'),_0xb12b95[_0x20cf('0x7c')]);switch(_0x4e21d5[_0x20cf('0x83')]){case _0x20cf('0x84'):_0x5ec54e=_0xb12b95['UserId']?util[_0x20cf('0x77')](_0x20cf('0x7f'),_0x4e21d5['agentAlias'],_0xb12b95[_0x20cf('0x7e')]):'System';break;case _0x20cf('0x85'):_0x5ec54e=_0xb12b95[_0x20cf('0x7e')]?_0xb12b95[_0x20cf('0x7b')][_0x20cf('0x86')]||_0xb12b95[_0x20cf('0x7b')]['fullname']:_0x20cf('0x87');break;case _0x20cf('0x88'):_0x5ec54e=_0xb12b95[_0x20cf('0x7e')]?_0xb12b95[_0x20cf('0x7b')][_0x20cf('0x4d')]:_0x20cf('0x87');break;default:_0x5ec54e=_0xb12b95[_0x20cf('0x7e')]?util['format'](_0x20cf('0x7f'),_0x4e21d5[_0x20cf('0x80')],_0xb12b95[_0x20cf('0x7e')]):_0x20cf('0x87');}var _0x4211f3=util['format'](_0x20cf('0x89'),moment(_0xb12b95[_0x20cf('0x8a')])[_0x20cf('0x77')](_0x20cf('0x8b')),_0xb12b95[_0x20cf('0x8c')]==='in'?_0x130d32:_0x5ec54e,_0xb12b95[_0x20cf('0x43')]);if(!_0xb12b95['secret']){fs[_0x20cf('0x8d')](_0xb4627f,_0x4211f3);}}return db[_0x20cf('0x8e')][_0x20cf('0x47')]({'where':{'service':!![]},'include':[{'model':db[_0x20cf('0x8f')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x20cf('0x90')],'as':_0x20cf('0x90'),'raw':!![]}]}]});}}})[_0x20cf('0x16')](function(_0x5ecb2f){if(!_0x5ecb2f||!_0x5ecb2f[_0x20cf('0x91')]||!_0x4dba17['body'])return _0x5d1dbe;var _0x30c1d7=_0x5ecb2f['getSmtpOptions']();return respondWithRpcPromise(_0x20cf('0x92'),_0x20cf('0x93'),{'account':_0x30c1d7,'message':{'from':util['format'](_0x20cf('0x94'),_0x5ecb2f[_0x20cf('0x2b')],_0x5ecb2f[_0x20cf('0x4e')]||_0x5ecb2f['Smtp'][_0x20cf('0x36')]),'to':_0x4dba17[_0x20cf('0x43')][_0x20cf('0x75')],'subject':_0x20cf('0x95'),'text':util[_0x20cf('0x77')](_0x20cf('0x96'),_0x4dba17['body'][_0x20cf('0x75')]),'attachments':[{'path':_0xb4627f}]}})[_0x20cf('0x16')](function(){return _0x5d1dbe;})[_0x20cf('0x20')](function(_0xd0d5fe){logger[_0x20cf('0x1d')](_0xd0d5fe);});})[_0x20cf('0x16')](respondWithStatusCode(_0x7500a4,0xc8))[_0x20cf('0x20')](handleError(_0x7500a4,null));};exports[_0x20cf('0x97')]=function(_0x5d8fff,_0x2c7a9a){return db[_0x20cf('0x5c')]['find']({'where':{'id':_0x5d8fff[_0x20cf('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c7a9a,null))[_0x20cf('0x16')](function(_0x39a238){if(_0x39a238){return _0x39a238['addMessage'](_0x5d8fff[_0x20cf('0x43')][_0x20cf('0x98')],_[_0x20cf('0x99')](_0x5d8fff['body'],[_0x20cf('0x98'),'id'])||{});}})['then'](respondWithResult(_0x2c7a9a,null))[_0x20cf('0x20')](handleError(_0x2c7a9a,null));};exports['getMessages']=function(_0x4e0156,_0x4cb327){var _0x4dcd65={'raw':![],'where':{}};var _0xfddb04={};var _0x586a10={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x20cf('0x47')]({'where':{'id':_0x4e0156[_0x20cf('0x45')]['id']}})[_0x20cf('0x16')](handleEntityNotFound(_0x4cb327,null))['then'](function(_0x477aa0){if(_0x477aa0){_0xfddb04[_0x20cf('0x38')]=_[_0x20cf('0x39')](db['ChatMessage'][_0x20cf('0x31')]);_0xfddb04[_0x20cf('0x3a')]=_[_0x20cf('0x39')](_0x4e0156[_0x20cf('0x3a')]);_0xfddb04['filters']=_[_0x20cf('0x3c')](_0xfddb04[_0x20cf('0x38')],_0xfddb04[_0x20cf('0x3a')]);_0x4dcd65[_0x20cf('0x3d')]=_[_0x20cf('0x3c')](_0xfddb04[_0x20cf('0x38')],qs['fields'](_0x4e0156[_0x20cf('0x3a')]['fields']));_0x4dcd65[_0x20cf('0x3d')]=_0x4dcd65['attributes']['length']?_0x4dcd65[_0x20cf('0x3d')]:_0xfddb04['model'];if(!_0x4e0156[_0x20cf('0x3a')][_0x20cf('0x9a')](_0x20cf('0x9b'))){_0x4dcd65[_0x20cf('0x22')]=qs[_0x20cf('0x22')](_0x4e0156[_0x20cf('0x3a')]['limit']);_0x4dcd65[_0x20cf('0x24')]=qs[_0x20cf('0x24')](_0x4e0156[_0x20cf('0x3a')][_0x20cf('0x24')]);}_0x4dcd65[_0x20cf('0x9c')]=qs[_0x20cf('0x9d')](_0x4e0156['query']['sort']);_0x4dcd65[_0x20cf('0x9e')]=qs[_0x20cf('0x3b')](_[_0x20cf('0x9f')](_0x4e0156[_0x20cf('0x3a')],_0xfddb04[_0x20cf('0x3b')]));_0x4dcd65[_0x20cf('0x9e')]['ChatInteractionId']=_0x477aa0['id'];if(_0x4e0156['query']['filter']){_0x4dcd65['where']=_[_0x20cf('0x40')](_0x4dcd65['where'],{'$or':_[_0x20cf('0x30')](_0x4dcd65[_0x20cf('0x3d')],function(_0x2a8380){var _0x2b28e3={};_0x2b28e3[_0x2a8380]={'$like':'%'+_0x4e0156[_0x20cf('0x3a')][_0x20cf('0xa0')]+'%'};return _0x2b28e3;})});}if(_0x4e0156[_0x20cf('0x3a')]['$gte']){var _0x233da3=_0x4e0156['query']['$gte'][_0x20cf('0xa1')](',');var _0x5d4d9e={};_0x5d4d9e[_0x233da3[0x0]]={'$gte':moment(_0x233da3[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4dcd65[_0x20cf('0x9e')]=_['merge'](_0x4dcd65[_0x20cf('0x9e')],_0x5d4d9e);}_0x4dcd65=_[_0x20cf('0x40')]({},_0x4dcd65,_0x4e0156[_0x20cf('0xa2')]);return db['ChatMessage'][_0x20cf('0x25')]({'where':_0x4dcd65[_0x20cf('0x9e')]})[_0x20cf('0x16')](function(_0x238f91){_0x586a10[_0x20cf('0x25')]=_0x238f91;if(_0x4e0156['query'][_0x20cf('0xa3')]){_0x4dcd65[_0x20cf('0x3f')]=[{'all':!![]}];}return db[_0x20cf('0x5c')][_0x20cf('0x34')](_0x4dcd65);})['then'](function(_0x42489f){_0x586a10[_0x20cf('0xa4')]=_0x42489f;return _0x586a10;});}})[_0x20cf('0x16')](respondWithFilteredResult(_0x4cb327,_0x4dcd65))[_0x20cf('0x20')](handleError(_0x4cb327,null));};exports[_0x20cf('0xa5')]=function(_0xd6c2e4,_0x286239){var _0x1152ba={'where':{}},_0x245bd1={},_0x54b0d4={'count':0x0,'rows':[]};return db[_0x20cf('0x41')][_0x20cf('0x47')]({'where':{'id':_0xd6c2e4[_0x20cf('0x45')]['id']}})[_0x20cf('0x16')](handleEntityNotFound(_0x286239,null))['then'](function(_0x4457c9){if(_0x4457c9){_0x245bd1[_0x20cf('0x38')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x245bd1['query']=_[_0x20cf('0x39')](_0xd6c2e4[_0x20cf('0x3a')]);_0x245bd1[_0x20cf('0x3b')]=_['intersection'](_0x245bd1['model'],_0x245bd1[_0x20cf('0x3a')]);_0x1152ba[_0x20cf('0x3d')]=_[_0x20cf('0x3c')](_0x245bd1[_0x20cf('0x38')],qs[_0x20cf('0x3e')](_0xd6c2e4[_0x20cf('0x3a')][_0x20cf('0x3e')]));_0x1152ba[_0x20cf('0x3d')]=_0x1152ba[_0x20cf('0x3d')]['length']?_0x1152ba[_0x20cf('0x3d')]:_0x245bd1[_0x20cf('0x38')];if(!_0xd6c2e4['query']['hasOwnProperty']('nolimit')){_0x1152ba[_0x20cf('0x22')]=qs[_0x20cf('0x22')](_0xd6c2e4['query'][_0x20cf('0x22')]);_0x1152ba['offset']=qs[_0x20cf('0x24')](_0xd6c2e4[_0x20cf('0x3a')][_0x20cf('0x24')]);}_0x1152ba[_0x20cf('0x9c')]=qs[_0x20cf('0x9d')](_0xd6c2e4[_0x20cf('0x3a')][_0x20cf('0x9d')]);_0x1152ba[_0x20cf('0x9e')]=qs[_0x20cf('0x3b')](_[_0x20cf('0x9f')](_0xd6c2e4[_0x20cf('0x3a')],_0x245bd1[_0x20cf('0x3b')]));_0x1152ba[_0x20cf('0x9e')][_0x20cf('0xa6')]=_0x4457c9['id'];if(_0xd6c2e4[_0x20cf('0x3a')]['filter']){_0x1152ba['where']=_[_0x20cf('0x40')](_0x1152ba[_0x20cf('0x9e')],{'$or':_[_0x20cf('0x30')](_0x1152ba[_0x20cf('0x3d')],function(_0x5293ad){var _0x17713a={};_0x17713a[_0x5293ad]={'$like':'%'+_0xd6c2e4[_0x20cf('0x3a')]['filter']+'%'};return _0x17713a;})});}_0x1152ba[_0x20cf('0x9e')][_0x20cf('0xa7')]=![];if(_0xd6c2e4[_0x20cf('0x3a')]['id']){_0x1152ba['where']['id']={'$gt':_0xd6c2e4[_0x20cf('0x3a')]['id']};}_0x1152ba=_[_0x20cf('0x40')]({},_0x1152ba,_0xd6c2e4[_0x20cf('0xa2')]);return db['ChatMessage'][_0x20cf('0x25')]({'where':_0x1152ba[_0x20cf('0x9e')]})[_0x20cf('0x16')](function(_0x21a650){_0x54b0d4[_0x20cf('0x25')]=_0x21a650;_0x1152ba[_0x20cf('0x3f')]=[];if(_0xd6c2e4[_0x20cf('0x3a')][_0x20cf('0xa8')]){_0x1152ba[_0x20cf('0x3f')]['push']({'model':db[_0x20cf('0x7b')],'as':'User','attributes':['id',_0x20cf('0x4d'),'alias']});}if(_0xd6c2e4[_0x20cf('0x3a')][_0x20cf('0xa3')]){_0x1152ba[_0x20cf('0x3f')]=[{'all':!![]}];}return db['ChatMessage'][_0x20cf('0x34')](_0x1152ba);})[_0x20cf('0x16')](function(_0x1067f0){_0x54b0d4[_0x20cf('0xa4')]=_0x1067f0;return _0x54b0d4;});}})[_0x20cf('0x16')](respondWithFilteredResult(_0x286239,_0x1152ba))[_0x20cf('0x20')](handleError(_0x286239,null));};exports['addTags']=function(_0x3ca75c,_0x3bcafe){return db[_0x20cf('0x41')][_0x20cf('0x44')]({'where':{'id':_0x3ca75c[_0x20cf('0x45')]['id']}})[_0x20cf('0x16')](handleEntityNotFound(_0x3bcafe,null))[_0x20cf('0x16')](function(_0x12cc21){if(_0x12cc21){return _0x12cc21[_0x20cf('0xa9')](_0x3ca75c[_0x20cf('0x43')][_0x20cf('0x98')],_[_0x20cf('0x99')](_0x3ca75c[_0x20cf('0x43')],[_0x20cf('0x98'),'id'])||{})[_0x20cf('0xaa')](function(){return db[_0x20cf('0xab')][_0x20cf('0x34')]({'attributes':['id','name',_0x20cf('0xac')],'where':{'id':_0x3ca75c[_0x20cf('0x43')][_0x20cf('0x98')]}});})[_0x20cf('0x16')](function(_0x133450){socket['emit']('chatInteractionTags:save',{'id':Number(_0x3ca75c[_0x20cf('0x45')]['id']),'tags':_0x133450||[]});return{'id':Number(_0x3ca75c[_0x20cf('0x45')]['id']),'tags':_0x133450||[]};});}})[_0x20cf('0x16')](respondWithResult(_0x3bcafe,null))[_0x20cf('0x20')](handleError(_0x3bcafe,null));};exports[_0x20cf('0xad')]=function(_0x3391da,_0x2efccc){return db[_0x20cf('0x41')][_0x20cf('0x44')]({'where':{'id':_0x3391da[_0x20cf('0x45')]['id']}})[_0x20cf('0x16')](handleEntityNotFound(_0x2efccc,null))['then'](function(_0x3eda38){if(_0x3eda38){return _0x3eda38[_0x20cf('0xad')](_0x3391da[_0x20cf('0x3a')][_0x20cf('0x98')]);}})[_0x20cf('0x16')](respondWithStatusCode(_0x2efccc,null))['catch'](handleError(_0x2efccc,null));};exports[_0x20cf('0xae')]=function(_0x25be1c,_0x982e98){var _0x1354d6=moment()[_0x20cf('0xaf')]()[_0x20cf('0xb0')]();var _0x3728d4=path[_0x20cf('0x70')](config[_0x20cf('0x71')],_0x20cf('0xb1'),_0x20cf('0xb2'),_0x20cf('0xb3'));var _0x3239be=path[_0x20cf('0x70')](config['root'],_0x20cf('0xb1'),'files',_0x20cf('0xb4'));var _0x307ad6=path['join'](_0x3728d4,_0x1354d6);var _0x2cbdec=util[_0x20cf('0x77')]('transcript-%d-%s.zip',_0x25be1c[_0x20cf('0x45')]['id'],_0x1354d6);var _0x55bfa7=path['join'](_0x3728d4,_0x2cbdec);var _0x50a219=[];_0x50a219[_0x20cf('0xb5')]({'model':db[_0x20cf('0x7b')],'as':_0x20cf('0x7b'),'attributes':['id','fullname'],'raw':!![]});_0x50a219[_0x20cf('0xb5')]({'model':db[_0x20cf('0x5f')],'as':_0x20cf('0x60'),'attributes':['id',_0x20cf('0xb6'),_0x20cf('0xb7')],'raw':!![]});if(_0x25be1c[_0x20cf('0x3a')][_0x20cf('0xb4')]){_0x50a219[_0x20cf('0xb5')]({'model':db[_0x20cf('0x6b')],'as':'Attachment','raw':!![]});}var _0x5077ad=[{'model':db['ChatMessage'],'as':_0x20cf('0x7a'),'attributes':['id','body','createdAt',_0x20cf('0x8c'),_0x20cf('0xa7'),_0x20cf('0xb8')],'include':_0x50a219}];_0x5077ad[_0x20cf('0xb5')]({'model':db[_0x20cf('0x48')],'as':_0x20cf('0xb9'),'attributes':['id','name']});_0x5077ad['push']({'model':db[_0x20cf('0x7b')],'as':_0x20cf('0xba'),'attributes':['id',_0x20cf('0x4d')]});return db[_0x20cf('0x41')][_0x20cf('0x44')]({'where':{'id':_0x25be1c[_0x20cf('0x45')]['id']},'include':_0x5077ad})[_0x20cf('0x16')](handleEntityNotFound(_0x982e98,null))[_0x20cf('0x16')](function(_0x674fc6){if(_0x674fc6){var _0x1cbd99=_0x674fc6[_0x20cf('0xbb')]({'plain':!![]});fs[_0x20cf('0xbc')](_0x307ad6);var _0x304aad={'channel':_0x20cf('0xbd'),'account':_0x1cbd99[_0x20cf('0xb9')][_0x20cf('0x2b')],'agent':_0x1cbd99[_0x20cf('0xba')]?_0x1cbd99[_0x20cf('0xba')]['fullname']:'N.A.','createdAt':moment(_0x1cbd99[_0x20cf('0x8a')])[_0x20cf('0x77')](_0x20cf('0xbe'))['toString'](),'closedAt':_0x1cbd99[_0x20cf('0x64')]?moment(_0x1cbd99[_0x20cf('0xbf')])[_0x20cf('0x77')](_0x20cf('0xbe'))[_0x20cf('0xb0')]():'','disposition':_0x1cbd99[_0x20cf('0xc0')],'chatInfo':{'browser':_0x1cbd99[_0x20cf('0xc1')],'os':_0x1cbd99[_0x20cf('0xc2')],'referer':_0x1cbd99[_0x20cf('0xc3')],'customerIp':_0x1cbd99[_0x20cf('0xc4')],'customerPort':_0x1cbd99['customerPort']?_0x1cbd99[_0x20cf('0xc5')]:_0x20cf('0xc6')},'messages':_(_0x1cbd99[_0x20cf('0x7a')])[_0x20cf('0xc7')]()[_0x20cf('0xa0')]({'secret':![]})[_0x20cf('0x30')](function(_0x5808ee){if(_0x5808ee['Attachment']){var _0x57a530=path['join'](_0x3239be,_0x5808ee[_0x20cf('0x6b')][_0x20cf('0x68')]);if(fs['existsSync'](_0x57a530)){fs[_0x20cf('0xc8')](_0x57a530)[_0x20cf('0xc9')](fs[_0x20cf('0xca')](path[_0x20cf('0x70')](_0x307ad6,_0x5808ee[_0x20cf('0x6b')][_0x20cf('0x68')])));}}return{'date':moment(_0x5808ee[_0x20cf('0x8a')])[_0x20cf('0x77')](_0x20cf('0xbe'))[_0x20cf('0xb0')](),'sender':_0x5808ee[_0x20cf('0x8c')]===_0x20cf('0x5b')?_0x5808ee[_0x20cf('0x7b')]?_0x5808ee[_0x20cf('0x7b')][_0x20cf('0x4d')]:_0x20cf('0x87'):_0x5808ee['Contact'][_0x20cf('0xb6')]+(_0x5808ee['Contact'][_0x20cf('0xb7')]?'\x20'+_0x5808ee['Contact'][_0x20cf('0xb7')]:''),'body':_0x5808ee['Attachment']?_0x5808ee[_0x20cf('0x6b')]['basename']:_0x5808ee[_0x20cf('0x43')],'direction':_0x5808ee[_0x20cf('0x8c')]===_0x20cf('0x5b')?'A':'C','secret':_0x5808ee[_0x20cf('0xa7')],'read':_0x5808ee[_0x20cf('0xb8')],'attachment':_0x5808ee[_0x20cf('0x6b')]};})[_0x20cf('0xcb')]()};return ejs[_0x20cf('0xcc')](path['join'](config[_0x20cf('0x71')],_0x20cf('0xb1'),_0x20cf('0xcd'),_0x20cf('0xce')),{'interaction':_0x304aad})[_0x20cf('0x16')](function(_0x1ae814){var _0x1b6895=path[_0x20cf('0x70')](_0x307ad6,_0x20cf('0xcf')+_0x1cbd99['id']+'-'+_0x1354d6+_0x20cf('0xd0'));var _0x31c131={'path':_0x1b6895,'channel':_0x20cf('0xbd'),'interactionId':_0x1cbd99['id']};return pdf[_0x20cf('0xd1')](_0x1ae814,_0x31c131);})[_0x20cf('0x16')](function(){return new Promise(function(_0x35ec08,_0x10f25a){zipdir(_0x307ad6,{'saveTo':_0x55bfa7},function(_0x1215a4,_0xbac6b4){if(_0x1215a4)return _0x10f25a(_0x1215a4);return _0x35ec08(_0xbac6b4);});})[_0x20cf('0x16')](function(){return new BPromise(function(_0x321a4d,_0x6ce3a5){rimraf(_0x307ad6,function(_0x13a219){if(_0x13a219)_0x6ce3a5(_0x13a219);return _0x321a4d();});});})[_0x20cf('0x16')](function(){return _0x982e98['download'](_0x55bfa7,_0x2cbdec,function(_0x348633){if(_0x348633){logger[_0x20cf('0x1d')](_0x20cf('0xd2'),_0x348633);}else{fs['unlinkSync'](_0x55bfa7);}});});});}else{return _0x982e98[_0x20cf('0x62')](0xc8);}})[_0x20cf('0x20')](handleError(_0x982e98,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 7df649a..46ea181 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 _0xe8a7=['ChatInteraction','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','exports','events','../../mysqldb'];(function(_0xbc2974,_0xec3342){var _0x3a5b4f=function(_0x5ec5b5){while(--_0x5ec5b5){_0xbc2974['push'](_0xbc2974['shift']());}};_0x3a5b4f(++_0xec3342);}(_0xe8a7,0x1b8));var _0x7e8a=function(_0x290578,_0x2d4981){_0x290578=_0x290578-0x0;var _0x387494=_0xe8a7[_0x290578];return _0x387494;};'use strict';var EventEmitter=require(_0x7e8a('0x0'));var ChatInteraction=require(_0x7e8a('0x1'))['db'][_0x7e8a('0x2')];var ChatMessage=require(_0x7e8a('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x7e8a('0x3')](0x0);var events={'afterCreate':_0x7e8a('0x4'),'afterUpdate':_0x7e8a('0x5'),'afterDestroy':_0x7e8a('0x6')};function emitEvent(_0x576f4c){return function(_0x59436b,_0x256912,_0x2f554c){_0x59436b['getUsers']({'attributes':['id'],'raw':!![]})[_0x7e8a('0x7')](function(_0x4e87e1){_0x59436b[_0x7e8a('0x8')](_0x7e8a('0x9'),_0x4e87e1[_0x7e8a('0xa')](function(_0x22fb3f){return{'id':_0x22fb3f['id']};}));return ChatMessage[_0x7e8a('0xb')]({'where':{'ChatInteractionId':_0x59436b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7e8a('0x7')](function(_0x29700){_0x59436b[_0x7e8a('0x8')](_0x7e8a('0xc'),_0x29700[_0x7e8a('0xd')]);ChatInteractionEvents['emit'](_0x576f4c+':'+_0x59436b['id'],_0x59436b);ChatInteractionEvents[_0x7e8a('0xe')](_0x576f4c,_0x59436b);_0x2f554c(null);})[_0x7e8a('0xf')](_0x2f554c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x7e8a('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x20c3=['setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then'];(function(_0x54b69f,_0x240de6){var _0x5d7826=function(_0x356161){while(--_0x356161){_0x54b69f['push'](_0x54b69f['shift']());}};_0x5d7826(++_0x240de6);}(_0x20c3,0x127));var _0x320c=function(_0x26e9d3,_0x4cb793){_0x26e9d3=_0x26e9d3-0x0;var _0x17739b=_0x20c3[_0x26e9d3];return _0x17739b;};'use strict';var EventEmitter=require(_0x320c('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x320c('0x1')];var ChatMessage=require(_0x320c('0x2'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x320c('0x3')](0x0);var events={'afterCreate':_0x320c('0x4'),'afterUpdate':_0x320c('0x5'),'afterDestroy':_0x320c('0x6')};function emitEvent(_0x5d4f97){return function(_0x418e04,_0x584b54,_0x1a984b){_0x418e04[_0x320c('0x7')]({'attributes':['id'],'raw':!![]})[_0x320c('0x8')](function(_0x4d3f1c){_0x418e04[_0x320c('0x9')](_0x320c('0xa'),_0x4d3f1c[_0x320c('0xb')](function(_0xad7c3f){return{'id':_0xad7c3f['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x418e04['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x25dd69){_0x418e04['setDataValue'](_0x320c('0xc'),_0x25dd69[_0x320c('0xd')]);ChatInteractionEvents[_0x320c('0xe')](_0x5d4f97+':'+_0x418e04['id'],_0x418e04);ChatInteractionEvents[_0x320c('0xe')](_0x5d4f97,_0x418e04);_0x1a984b(null);})[_0x320c('0xf')](_0x1a984b(null));};}for(var e in events){if(events[_0x320c('0x10')](e)){var event=events[e];ChatInteraction[_0x320c('0x11')](e,emitEvent(event));}}module[_0x320c('0x12')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 81b0f32..4a59a95 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 _0x908d=['../../config/logger','moment','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0x908d,0x10f));var _0xd908=function(_0x8c12db,_0x591626){_0x8c12db=_0x8c12db-0x0;var _0x1290a7=_0x908d[_0x8c12db];return _0x1290a7;};'use strict';var _=require('lodash');var util=require(_0xd908('0x0'));var logger=require(_0xd908('0x1'))('api');var moment=require(_0xd908('0x2'));var BPromise=require('bluebird');var rp=require(_0xd908('0x3'));var fs=require('fs');var path=require(_0xd908('0x4'));var rimraf=require('rimraf');var config=require(_0xd908('0x5'));var attributes=require(_0xd908('0x6'));module[_0xd908('0x7')]=function(_0x35ebb8,_0x5a68a1){return _0x35ebb8[_0xd908('0x8')](_0xd908('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d2055,_0xba6c50,_0x4454e2){if(_0x2d2055[_0xd908('0xa')](_0xd908('0xb'))){_0x2d2055[_0xd908('0xc')]=moment()[_0xd908('0xd')](_0xd908('0xe'));}_0x4454e2(null,_0x2d2055);}},'charset':_0xd908('0xf'),'collate':_0xd908('0x10')});};
\ No newline at end of file
+var _0xe773=['./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3bee13,_0x29cae3){var _0x82c3cc=function(_0x41297c){while(--_0x41297c){_0x3bee13['push'](_0x3bee13['shift']());}};_0x82c3cc(++_0x29cae3);}(_0xe773,0xc4));var _0x3e77=function(_0x437ef0,_0x5e58f9){_0x437ef0=_0x437ef0-0x0;var _0x16056b=_0xe773[_0x437ef0];return _0x16056b;};'use strict';var _=require(_0x3e77('0x0'));var util=require(_0x3e77('0x1'));var logger=require(_0x3e77('0x2'))('api');var moment=require(_0x3e77('0x3'));var BPromise=require(_0x3e77('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e77('0x5'));var rimraf=require(_0x3e77('0x6'));var config=require(_0x3e77('0x7'));var attributes=require(_0x3e77('0x8'));module[_0x3e77('0x9')]=function(_0x1281f7,_0x35f2da){return _0x1281f7['define'](_0x3e77('0xa'),attributes,{'tableName':_0x3e77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3a01a2,_0x9c4746,_0x53dea4){if(_0x3a01a2['changed']('closed')){_0x3a01a2[_0x3e77('0xc')]=moment()[_0x3e77('0xd')](_0x3e77('0xe'));}_0x53dea4(null,_0x3a01a2);}},'charset':_0x3e77('0xf'),'collate':_0x3e77('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index d075ff0..c2c8272 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 _0x32b4=['options','raw','where','attributes','limit','ChatInteraction','find','addTags','ids','spread','debug','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','update','body'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x32b4,0x164));var _0x432b=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x32b4[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x432b('0x0'));var util=require(_0x432b('0x1'));var moment=require(_0x432b('0x2'));var BPromise=require(_0x432b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x432b('0x4'))['db'];var utils=require(_0x432b('0x5'));var logger=require('../../config/logger')(_0x432b('0x6'));var config=require(_0x432b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x432b('0x8')][_0x432b('0x9')]({'port':0x232a});config[_0x432b('0xa')]=_[_0x432b('0xb')](config[_0x432b('0xa')],{'host':_0x432b('0xc'),'port':0x18eb});var socket=require(_0x432b('0xd'))(new Redis(config[_0x432b('0xa')]));require(_0x432b('0xe'))[_0x432b('0xf')](socket);function respondWithRpcPromise(_0x174737,_0x4cd957,_0x283f5f){return new BPromise(function(_0x3c9925,_0x3a734a){return client[_0x432b('0x10')](_0x174737,_0x283f5f)[_0x432b('0x11')](function(_0x45c250){logger[_0x432b('0x12')](_0x432b('0x13'),_0x4cd957,_0x432b('0x14'));logger['debug'](_0x432b('0x15'),_0x4cd957,_0x432b('0x14'),JSON[_0x432b('0x16')](_0x45c250));if(_0x45c250[_0x432b('0x17')]){if(_0x45c250[_0x432b('0x17')][_0x432b('0x18')]===0x1f4){logger[_0x432b('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x4cd957,_0x45c250[_0x432b('0x17')]['message']);return _0x3a734a(_0x45c250[_0x432b('0x17')][_0x432b('0x19')]);}logger[_0x432b('0x17')](_0x432b('0x13'),_0x4cd957,_0x45c250[_0x432b('0x17')][_0x432b('0x19')]);return _0x3c9925(_0x45c250['error'][_0x432b('0x19')]);}else{logger[_0x432b('0x12')](_0x432b('0x13'),_0x4cd957,'request\x20sent');_0x3c9925(_0x45c250[_0x432b('0x1a')][_0x432b('0x19')]);}})[_0x432b('0x1b')](function(_0x38ea99){logger[_0x432b('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x4cd957,_0x38ea99);_0x3a734a(_0x38ea99);});});}exports[_0x432b('0x1c')]=function(_0x19fcdb){var _0x2ddb70=this;return new Promise(function(_0x568034,_0x37752c){return db['ChatInteraction'][_0x432b('0x1d')](_0x19fcdb[_0x432b('0x1e')],{'raw':_0x19fcdb[_0x432b('0x1f')]?_0x19fcdb[_0x432b('0x1f')][_0x432b('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19fcdb[_0x432b('0x1f')]?_0x19fcdb[_0x432b('0x1f')][_0x432b('0x21')]||null:null,'attributes':_0x19fcdb[_0x432b('0x1f')]?_0x19fcdb[_0x432b('0x1f')][_0x432b('0x22')]||null:null,'limit':_0x19fcdb[_0x432b('0x1f')]?_0x19fcdb[_0x432b('0x1f')][_0x432b('0x23')]||null:null})['then'](function(_0x345a92){logger[_0x432b('0x12')](_0x432b('0x1c'),_0x19fcdb);logger['debug']('UpdateChatInteraction',_0x19fcdb,JSON[_0x432b('0x16')](_0x345a92));_0x568034(_0x345a92);})['catch'](function(_0x11463a){logger[_0x432b('0x17')](_0x432b('0x1c'),_0x11463a[_0x432b('0x19')],_0x19fcdb);_0x37752c(_0x2ddb70['error'](0x1f4,_0x11463a[_0x432b('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x1e5cb1){return new Promise(function(_0x3d5124,_0x23d9f6){return db[_0x432b('0x24')][_0x432b('0x25')]({'where':_0x1e5cb1[_0x432b('0x1f')]?_0x1e5cb1[_0x432b('0x1f')][_0x432b('0x21')]||null:null})['then'](function(_0x3cacb9){if(_0x3cacb9){return _0x3cacb9[_0x432b('0x26')](_0x1e5cb1[_0x432b('0x1e')][_0x432b('0x27')],_['omit'](_0x1e5cb1[_0x432b('0x1e')],[_0x432b('0x27'),'id'])||{});}})[_0x432b('0x28')](function(_0x40be6e){logger[_0x432b('0x12')]('AddTags',_0x1e5cb1);logger[_0x432b('0x29')](_0x432b('0x2a'),_0x1e5cb1,JSON['stringify'](_0x40be6e));_0x3d5124(_0x40be6e);})['catch'](function(_0xb5cbde){logger[_0x432b('0x17')](_0x432b('0x2a'),_0xb5cbde['message'],_0x1e5cb1);_0x23d9f6(_this[_0x432b('0x17')](0x1f4,_0xb5cbde['message']));});});};
\ No newline at end of file
+var _0x084c=['code','message','result','catch','UpdateChatInteraction','ChatInteraction','options','raw','where','attributes','limit','debug','find','addTags','body','ids','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x23beb0,_0x216a71){var _0x308011=function(_0x2980fe){while(--_0x2980fe){_0x23beb0['push'](_0x23beb0['shift']());}};_0x308011(++_0x216a71);}(_0x084c,0xdf));var _0xc084=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x084c[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require(_0xc084('0x0'));var util=require(_0xc084('0x1'));var moment=require(_0xc084('0x2'));var BPromise=require(_0xc084('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc084('0x4'))['db'];var utils=require(_0xc084('0x5'));var logger=require('../../config/logger')(_0xc084('0x6'));var config=require(_0xc084('0x7'));var jayson=require(_0xc084('0x8'));var client=jayson[_0xc084('0x9')][_0xc084('0xa')]({'port':0x232a});config['redis']=_[_0xc084('0xb')](config[_0xc084('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc084('0xd'))(new Redis(config['redis']));require(_0xc084('0xe'))[_0xc084('0xf')](socket);function respondWithRpcPromise(_0x4fe46d,_0x2f631f,_0x4c10cd){return new BPromise(function(_0xfa07ef,_0x10b968){return client[_0xc084('0x10')](_0x4fe46d,_0x4c10cd)[_0xc084('0x11')](function(_0xa01bc2){logger[_0xc084('0x12')](_0xc084('0x13'),_0x2f631f,_0xc084('0x14'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2f631f,'request\x20sent',JSON[_0xc084('0x15')](_0xa01bc2));if(_0xa01bc2[_0xc084('0x16')]){if(_0xa01bc2[_0xc084('0x16')][_0xc084('0x17')]===0x1f4){logger[_0xc084('0x16')](_0xc084('0x13'),_0x2f631f,_0xa01bc2['error'][_0xc084('0x18')]);return _0x10b968(_0xa01bc2[_0xc084('0x16')]['message']);}logger[_0xc084('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x2f631f,_0xa01bc2[_0xc084('0x16')][_0xc084('0x18')]);return _0xfa07ef(_0xa01bc2[_0xc084('0x16')][_0xc084('0x18')]);}else{logger[_0xc084('0x12')](_0xc084('0x13'),_0x2f631f,_0xc084('0x14'));_0xfa07ef(_0xa01bc2[_0xc084('0x19')][_0xc084('0x18')]);}})[_0xc084('0x1a')](function(_0x345b0c){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2f631f,_0x345b0c);_0x10b968(_0x345b0c);});});}exports[_0xc084('0x1b')]=function(_0x1bd5e6){var _0x13e37d=this;return new Promise(function(_0x2fcef8,_0x204212){return db[_0xc084('0x1c')]['update'](_0x1bd5e6['body'],{'raw':_0x1bd5e6['options']?_0x1bd5e6[_0xc084('0x1d')][_0xc084('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bd5e6['options']?_0x1bd5e6[_0xc084('0x1d')][_0xc084('0x1f')]||null:null,'attributes':_0x1bd5e6[_0xc084('0x1d')]?_0x1bd5e6['options'][_0xc084('0x20')]||null:null,'limit':_0x1bd5e6['options']?_0x1bd5e6[_0xc084('0x1d')][_0xc084('0x21')]||null:null})[_0xc084('0x11')](function(_0x230a72){logger[_0xc084('0x12')]('UpdateChatInteraction',_0x1bd5e6);logger[_0xc084('0x22')](_0xc084('0x1b'),_0x1bd5e6,JSON['stringify'](_0x230a72));_0x2fcef8(_0x230a72);})[_0xc084('0x1a')](function(_0x3fefcf){logger[_0xc084('0x16')](_0xc084('0x1b'),_0x3fefcf[_0xc084('0x18')],_0x1bd5e6);_0x204212(_0x13e37d[_0xc084('0x16')](0x1f4,_0x3fefcf[_0xc084('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x5423b6){return new Promise(function(_0x6fc01d,_0x1c2b63){return db[_0xc084('0x1c')][_0xc084('0x23')]({'where':_0x5423b6[_0xc084('0x1d')]?_0x5423b6[_0xc084('0x1d')]['where']||null:null})['then'](function(_0x17f061){if(_0x17f061){return _0x17f061[_0xc084('0x24')](_0x5423b6[_0xc084('0x25')]['ids'],_['omit'](_0x5423b6[_0xc084('0x25')],[_0xc084('0x26'),'id'])||{});}})[_0xc084('0x27')](function(_0x34c21d){logger[_0xc084('0x12')](_0xc084('0x28'),_0x5423b6);logger['debug'](_0xc084('0x28'),_0x5423b6,JSON['stringify'](_0x34c21d));_0x6fc01d(_0x34c21d);})['catch'](function(_0x264cfe){logger[_0xc084('0x16')](_0xc084('0x28'),_0x264cfe['message'],_0x5423b6);_0x1c2b63(_this[_0xc084('0x16')](0x1f4,_0x264cfe['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 6e238aa..03a809f 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 _0x2131=['update','removeListener','length','chatInteraction:','./chatInteraction.events','save'];(function(_0xc0d9bc,_0x2bd6be){var _0x32ff73=function(_0x28c592){while(--_0x28c592){_0xc0d9bc['push'](_0xc0d9bc['shift']());}};_0x32ff73(++_0x2bd6be);}(_0x2131,0xee));var _0x1213=function(_0x2e72c7,_0x3cefda){_0x2e72c7=_0x2e72c7-0x0;var _0x12f876=_0x2131[_0x2e72c7];return _0x12f876;};'use strict';var ChatInteractionEvents=require(_0x1213('0x0'));var events=[_0x1213('0x1'),'remove',_0x1213('0x2')];function createListener(_0x2dab26,_0x2fc8f5){return function(_0x437c93){_0x2fc8f5['emit'](_0x2dab26,_0x437c93);};}function removeListener(_0xbb5d2,_0x5db678){return function(){ChatInteractionEvents[_0x1213('0x3')](_0xbb5d2,_0x5db678);};}exports['register']=function(_0x4fbbc2){for(var _0x1dc8d3=0x0,_0x1672e2=events[_0x1213('0x4')];_0x1dc8d3<_0x1672e2;_0x1dc8d3++){var _0x4949af=events[_0x1dc8d3];var _0x253e45=createListener(_0x1213('0x5')+_0x4949af,_0x4fbbc2);ChatInteractionEvents['on'](_0x4949af,_0x253e45);}};
\ No newline at end of file
+var _0xe893=['emit','removeListener','register','length','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe893,0xbe));var _0x3e89=function(_0x3221ae,_0x10dd4c){_0x3221ae=_0x3221ae-0x0;var _0x314b92=_0xe893[_0x3221ae];return _0x314b92;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x3e89('0x0'),_0x3e89('0x1'),'update'];function createListener(_0x2b462b,_0x2b3753){return function(_0x2aab48){_0x2b3753[_0x3e89('0x2')](_0x2b462b,_0x2aab48);};}function removeListener(_0x2e4719,_0x55e262){return function(){ChatInteractionEvents[_0x3e89('0x3')](_0x2e4719,_0x55e262);};}exports[_0x3e89('0x4')]=function(_0x2eb068){for(var _0x4a2a6f=0x0,_0x16d340=events[_0x3e89('0x5')];_0x4a2a6f<_0x16d340;_0x4a2a6f++){var _0x344d91=events[_0x4a2a6f];var _0x429b8e=createListener('chatInteraction:'+_0x344d91,_0x2eb068);ChatInteractionEvents['on'](_0x344d91,_0x429b8e);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 600468a..b9292ca 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 _0xcae2=['replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/my_messages','getMyMessages','/:id/download','download','post','createVidaooSession','diskStorage','root','server/files/attachments/','format','now','originalname'];(function(_0x16531b,_0x584ced){var _0x19d85=function(_0x6073a6){while(--_0x6073a6){_0x16531b['push'](_0x16531b['shift']());}};_0x19d85(++_0x584ced);}(_0xcae2,0x1ea));var _0x2cae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcae2[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x2cae('0x0'));var util=require(_0x2cae('0x1'));var path=require(_0x2cae('0x2'));var timeout=require(_0x2cae('0x3'));var express=require(_0x2cae('0x4'));var router=express[_0x2cae('0x5')]();var fs_extra=require(_0x2cae('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2cae('0x7'));var config=require(_0x2cae('0x8'));var controller=require('./chatInteraction.controller');router[_0x2cae('0x9')]('/',auth[_0x2cae('0xa')](),controller[_0x2cae('0xb')]);router[_0x2cae('0x9')]('/describe',auth[_0x2cae('0xa')](),controller[_0x2cae('0xc')]);router[_0x2cae('0x9')](_0x2cae('0xd'),auth[_0x2cae('0xe')](),controller[_0x2cae('0xf')]);router[_0x2cae('0x9')](_0x2cae('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x2cae('0x11')]);router['get']('/:id/messages',auth[_0x2cae('0xa')](),controller['getMessages']);router[_0x2cae('0x9')](_0x2cae('0x12'),auth[_0x2cae('0xe')](),controller[_0x2cae('0x13')]);router[_0x2cae('0x9')](_0x2cae('0x14'),auth[_0x2cae('0xa')](),controller[_0x2cae('0x15')]);router[_0x2cae('0x16')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2cae('0x16')]('/:id/vidaoo',auth[_0x2cae('0xa')](),controller[_0x2cae('0x17')]);var upload=multer({'storage':multer[_0x2cae('0x18')]({'destination':function(_0x427b21,_0x1afd37,_0x37fc56){_0x37fc56(null,path['join'](config[_0x2cae('0x19')],_0x2cae('0x1a')));},'filename':function(_0x389f35,_0x447e3d,_0x45ba03){_0x45ba03(null,util[_0x2cae('0x1b')]('%s-%s',Date[_0x2cae('0x1c')](),_0x447e3d[_0x2cae('0x1d')][_0x2cae('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2cae('0x16')](_0x2cae('0x1f'),upload[_0x2cae('0x20')](_0x2cae('0x21')),controller[_0x2cae('0x22')]);router['post']('/:id/messages',auth[_0x2cae('0xe')](),controller[_0x2cae('0x23')]);router[_0x2cae('0x16')](_0x2cae('0x24'),auth['isAuthenticated'](),interaction[_0x2cae('0x25')]('chat',_0x2cae('0x26')),controller['addTags']);router[_0x2cae('0x27')]('/:id',auth['isAuthenticated'](),interaction[_0x2cae('0x25')](_0x2cae('0x28'),_0x2cae('0x29')),controller[_0x2cae('0x2a')]);router[_0x2cae('0x27')](_0x2cae('0x2b'),controller[_0x2cae('0x2c')]);router[_0x2cae('0x27')](_0x2cae('0x2d'),auth[_0x2cae('0xe')](),controller[_0x2cae('0x2e')]);router['put']('/:id/close',controller[_0x2cae('0x2f')]);router['delete'](_0x2cae('0xd'),auth[_0x2cae('0xa')](),interaction[_0x2cae('0x25')](_0x2cae('0x28'),'chatinteraction:destroy'),controller[_0x2cae('0x30')]);router[_0x2cae('0x31')](_0x2cae('0x24'),auth[_0x2cae('0xa')](),controller[_0x2cae('0x32')]);module[_0x2cae('0x33')]=router;
\ No newline at end of file
+var _0x189a=['removeTags','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','index','get','/describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','isAuthenticated','getMessages','getMyMessages','post','create','createVidaooSession','root','server/files/attachments/','%s-%s','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/close','delete','chatinteraction:destroy'];(function(_0x31d03c,_0x158cef){var _0x420e61=function(_0x1ddac1){while(--_0x1ddac1){_0x31d03c['push'](_0x31d03c['shift']());}};_0x420e61(++_0x158cef);}(_0x189a,0x1e1));var _0xa189=function(_0x575e5f,_0x5bd284){_0x575e5f=_0x575e5f-0x0;var _0xbe8e8b=_0x189a[_0x575e5f];return _0xbe8e8b;};'use strict';var multer=require(_0xa189('0x0'));var util=require(_0xa189('0x1'));var path=require('path');var timeout=require(_0xa189('0x2'));var express=require(_0xa189('0x3'));var router=express[_0xa189('0x4')]();var fs_extra=require(_0xa189('0x5'));var auth=require(_0xa189('0x6'));var interaction=require(_0xa189('0x7'));var config=require(_0xa189('0x8'));var controller=require(_0xa189('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xa189('0xa')]);router[_0xa189('0xb')](_0xa189('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xa189('0xb')](_0xa189('0xd'),auth[_0xa189('0xe')](),controller['show']);router[_0xa189('0xb')](_0xa189('0xf'),auth[_0xa189('0xe')](),controller[_0xa189('0x10')]);router[_0xa189('0xb')](_0xa189('0x11'),auth[_0xa189('0x12')](),controller[_0xa189('0x13')]);router[_0xa189('0xb')]('/:id/my_messages',auth[_0xa189('0xe')](),controller[_0xa189('0x14')]);router[_0xa189('0xb')]('/:id/download',auth[_0xa189('0x12')](),controller['download']);router[_0xa189('0x15')]('/',auth[_0xa189('0x12')](),controller[_0xa189('0x16')]);router[_0xa189('0x15')]('/:id/vidaoo',auth[_0xa189('0x12')](),controller[_0xa189('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x369efa,_0x239d13,_0x293cea){_0x293cea(null,path['join'](config[_0xa189('0x18')],_0xa189('0x19')));},'filename':function(_0x1131dd,_0x12eca7,_0x56a929){_0x56a929(null,util['format'](_0xa189('0x1a'),Date['now'](),_0x12eca7[_0xa189('0x1b')][_0xa189('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa189('0x15')](_0xa189('0x1d'),upload[_0xa189('0x1e')](_0xa189('0x1f')),controller[_0xa189('0x20')]);router[_0xa189('0x15')]('/:id/messages',auth[_0xa189('0xe')](),controller[_0xa189('0x21')]);router[_0xa189('0x15')](_0xa189('0x22'),auth['isAuthenticated'](),interaction[_0xa189('0x23')]('chat',_0xa189('0x24')),controller[_0xa189('0x25')]);router[_0xa189('0x26')]('/:id',auth[_0xa189('0x12')](),interaction[_0xa189('0x23')](_0xa189('0x27'),_0xa189('0x28')),controller[_0xa189('0x29')]);router['put'](_0xa189('0x2a'),controller[_0xa189('0x2b')]);router[_0xa189('0x26')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0xa189('0x26')](_0xa189('0x2c'),controller['close']);router[_0xa189('0x2d')](_0xa189('0xd'),auth[_0xa189('0x12')](),interaction[_0xa189('0x23')](_0xa189('0x27'),_0xa189('0x2e')),controller['destroy']);router[_0xa189('0x2d')](_0xa189('0x22'),auth[_0xa189('0x12')](),controller[_0xa189('0x2f')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 6f7c58d..a1e32e6 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 _0xad56=['exports','TEXT','medium','INTEGER','sequelize'];(function(_0x3a6c22,_0x25539e){var _0x61930a=function(_0x69ae65){while(--_0x69ae65){_0x3a6c22['push'](_0x3a6c22['shift']());}};_0x61930a(++_0x25539e);}(_0xad56,0x199));var _0x6ad5=function(_0x30b58,_0x48df3b){_0x30b58=_0x30b58-0x0;var _0x9d210d=_0xad56[_0x30b58];return _0x9d210d;};'use strict';var Sequelize=require(_0x6ad5('0x0'));module[_0x6ad5('0x1')]={'body':{'type':Sequelize[_0x6ad5('0x2')](_0x6ad5('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x6ad5('0x4')]}};
\ No newline at end of file
+var _0xcc4e=['INTEGER','sequelize','BOOLEAN'];(function(_0x3d8c3f,_0x1c568f){var _0x1b2fd1=function(_0x5dc7b5){while(--_0x5dc7b5){_0x3d8c3f['push'](_0x3d8c3f['shift']());}};_0x1b2fd1(++_0x1c568f);}(_0xcc4e,0x91));var _0xecc4=function(_0x6358c7,_0xb14e68){_0x6358c7=_0x6358c7-0x0;var _0x3d2af0=_0xcc4e[_0x6358c7];return _0x3d2af0;};'use strict';var Sequelize=require(_0xecc4('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xecc4('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xecc4('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 5044bee..2f6ffd6 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 _0xb627=['error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','then','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','user','fullname','online','lastLoginAt','allowmessenger','showWebBar','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','role','resourceId','push','createdAt','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','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','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy'];(function(_0x268000,_0xd65943){var _0x3bdfe1=function(_0x3af23a){while(--_0x3af23a){_0x268000['push'](_0x268000['shift']());}};_0x3bdfe1(++_0xd65943);}(_0xb627,0x194));var _0x7b62=function(_0x1322fb,_0x3e07c2){_0x1322fb=_0x1322fb-0x0;var _0x5d1690=_0xb627[_0x1322fb];return _0x5d1690;};'use strict';var emlformat=require(_0x7b62('0x0'));var rimraf=require(_0x7b62('0x1'));var zipdir=require(_0x7b62('0x2'));var jsonpatch=require(_0x7b62('0x3'));var rp=require(_0x7b62('0x4'));var moment=require('moment');var BPromise=require(_0x7b62('0x5'));var Mustache=require(_0x7b62('0x6'));var util=require('util');var path=require(_0x7b62('0x7'));var sox=require(_0x7b62('0x8'));var csv=require(_0x7b62('0x9'));var ejs=require(_0x7b62('0xa'));var fs=require('fs');var fs_extra=require(_0x7b62('0xb'));var _=require(_0x7b62('0xc'));var squel=require(_0x7b62('0xd'));var crypto=require(_0x7b62('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7b62('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7b62('0x10'));var Papa=require(_0x7b62('0x11'));var Redis=require(_0x7b62('0x12'));var authService=require(_0x7b62('0x13'));var qs=require(_0x7b62('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b62('0x15'));var logger=require(_0x7b62('0x16'))(_0x7b62('0x17'));var utils=require(_0x7b62('0x18'));var config=require(_0x7b62('0x19'));var licenseUtil=require(_0x7b62('0x1a'));var db=require(_0x7b62('0x1b'))['db'];config[_0x7b62('0x1c')]=_[_0x7b62('0x1d')](config['redis'],{'host':_0x7b62('0x1e'),'port':0x18eb});var socket=require(_0x7b62('0x1f'))(new Redis(config[_0x7b62('0x1c')]));require(_0x7b62('0x20'))[_0x7b62('0x21')](socket);function respondWithStatusCode(_0x1fb9ee,_0x35dcf8){_0x35dcf8=_0x35dcf8||0xcc;return function(_0x3ddb0e){if(_0x3ddb0e){return _0x1fb9ee[_0x7b62('0x22')](_0x35dcf8);}return _0x1fb9ee['status'](_0x35dcf8)[_0x7b62('0x23')]();};}function respondWithResult(_0x12f4ab,_0x211e7f){_0x211e7f=_0x211e7f||0xc8;return function(_0x3f9517){if(_0x3f9517){return _0x12f4ab[_0x7b62('0x24')](_0x211e7f)[_0x7b62('0x25')](_0x3f9517);}};}function respondWithFilteredResult(_0x13df6e,_0x1e2964){return function(_0x198763){if(_0x198763){var _0x128127=typeof _0x1e2964[_0x7b62('0x26')]===_0x7b62('0x27')&&typeof _0x1e2964[_0x7b62('0x28')]===_0x7b62('0x27');var _0xeb2b3b=_0x198763[_0x7b62('0x29')];var _0x31fced=_0x128127?0x0:_0x1e2964[_0x7b62('0x26')];var _0x532da3=_0x128127?_0x198763[_0x7b62('0x29')]:_0x1e2964[_0x7b62('0x26')]+_0x1e2964['limit'];var _0x3e03af;if(_0x532da3>=_0xeb2b3b){_0x532da3=_0xeb2b3b;_0x3e03af=0xc8;}else{_0x3e03af=0xce;}_0x13df6e[_0x7b62('0x24')](_0x3e03af);return _0x13df6e[_0x7b62('0x2a')](_0x7b62('0x2b'),_0x31fced+'-'+_0x532da3+'/'+_0xeb2b3b)['json'](_0x198763);}return null;};}function patchUpdates(_0x3d4ef9){return function(_0xe54625){try{jsonpatch[_0x7b62('0x2c')](_0xe54625,_0x3d4ef9,!![]);}catch(_0x39f9bb){return BPromise['reject'](_0x39f9bb);}return _0xe54625[_0x7b62('0x2d')]();};}function saveUpdates(_0x216a2e,_0x2c88af){return function(_0x1eb73e){if(_0x1eb73e){return _0x1eb73e[_0x7b62('0x2e')](_0x216a2e)['then'](function(_0x1b29a6){return _0x1b29a6;});}return null;};}function removeEntity(_0x1f1794,_0x2f1c06){return function(_0xb238ee){if(_0xb238ee){return _0xb238ee[_0x7b62('0x2f')]()['then'](function(){_0x1f1794[_0x7b62('0x24')](0xcc)[_0x7b62('0x23')]();});}};}function handleEntityNotFound(_0x4edad0,_0xd415ec){return function(_0xffcdb8){if(!_0xffcdb8){_0x4edad0['sendStatus'](0x194);}return _0xffcdb8;};}function handleError(_0x10b341,_0x5483f4){_0x5483f4=_0x5483f4||0x1f4;return function(_0xca6a83){logger[_0x7b62('0x30')](_0xca6a83[_0x7b62('0x31')]);if(_0xca6a83[_0x7b62('0x32')]){delete _0xca6a83[_0x7b62('0x32')];}_0x10b341[_0x7b62('0x24')](_0x5483f4)[_0x7b62('0x33')](_0xca6a83);};}exports[_0x7b62('0x34')]=function(_0x2d87ac,_0x1c8a67){var _0x5e3583={},_0x330ce9={},_0x1e0676={'count':0x0,'rows':[]};var _0x4a2dda=_[_0x7b62('0x35')](db[_0x7b62('0x36')][_0x7b62('0x37')],function(_0x47f6f5){return{'name':_0x47f6f5[_0x7b62('0x38')],'type':_0x47f6f5[_0x7b62('0x39')]['key']};});_0x330ce9[_0x7b62('0x3a')]=_[_0x7b62('0x35')](_0x4a2dda,_0x7b62('0x32'));_0x330ce9[_0x7b62('0x3b')]=_[_0x7b62('0x3c')](_0x2d87ac[_0x7b62('0x3b')]);_0x330ce9[_0x7b62('0x3d')]=_[_0x7b62('0x3e')](_0x330ce9[_0x7b62('0x3a')],_0x330ce9[_0x7b62('0x3b')]);_0x5e3583[_0x7b62('0x3f')]=_['intersection'](_0x330ce9['model'],qs[_0x7b62('0x40')](_0x2d87ac[_0x7b62('0x3b')]['fields']));_0x5e3583[_0x7b62('0x3f')]=_0x5e3583[_0x7b62('0x3f')][_0x7b62('0x41')]?_0x5e3583[_0x7b62('0x3f')]:_0x330ce9[_0x7b62('0x3a')];if(!_0x2d87ac[_0x7b62('0x3b')]['hasOwnProperty'](_0x7b62('0x42'))){_0x5e3583[_0x7b62('0x28')]=qs[_0x7b62('0x28')](_0x2d87ac[_0x7b62('0x3b')][_0x7b62('0x28')]);_0x5e3583[_0x7b62('0x26')]=qs['offset'](_0x2d87ac['query']['offset']);}_0x5e3583['order']=qs['sort'](_0x2d87ac[_0x7b62('0x3b')][_0x7b62('0x43')]);_0x5e3583[_0x7b62('0x44')]=qs[_0x7b62('0x3d')](_[_0x7b62('0x45')](_0x2d87ac[_0x7b62('0x3b')],_0x330ce9['filters']),_0x4a2dda);if(_0x2d87ac[_0x7b62('0x3b')]['filter']){_0x5e3583[_0x7b62('0x44')]=_[_0x7b62('0x46')](_0x5e3583['where'],{'$or':_[_0x7b62('0x35')](_0x4a2dda,function(_0x5863b9){if(_0x5863b9[_0x7b62('0x39')]!==_0x7b62('0x47')){var _0x288f3a={};_0x288f3a[_0x5863b9['name']]={'$like':'%'+_0x2d87ac[_0x7b62('0x3b')][_0x7b62('0x48')]+'%'};return _0x288f3a;}})});}_0x5e3583=_[_0x7b62('0x46')]({},_0x5e3583,_0x2d87ac['options']);var _0x88ced1={'where':_0x5e3583['where']};return db[_0x7b62('0x36')]['count'](_0x88ced1)[_0x7b62('0x49')](function(_0x3387f0){_0x1e0676['count']=_0x3387f0;if(_0x2d87ac[_0x7b62('0x3b')][_0x7b62('0x4a')]){_0x5e3583['include']=[{'all':!![]}];}return db[_0x7b62('0x36')][_0x7b62('0x4b')](_0x5e3583);})[_0x7b62('0x49')](function(_0x19108f){_0x1e0676[_0x7b62('0x4c')]=_0x19108f;return _0x1e0676;})[_0x7b62('0x49')](respondWithFilteredResult(_0x1c8a67,_0x5e3583))[_0x7b62('0x4d')](handleError(_0x1c8a67,null));};exports[_0x7b62('0x4e')]=function(_0x4672f3,_0x217671){var _0x5011f5={'raw':!![],'where':{'id':_0x4672f3[_0x7b62('0x4f')]['id']}},_0x222886={};_0x222886[_0x7b62('0x3a')]=_[_0x7b62('0x3c')](db[_0x7b62('0x36')][_0x7b62('0x37')]);_0x222886[_0x7b62('0x3b')]=_['keys'](_0x4672f3['query']);_0x222886[_0x7b62('0x3d')]=_[_0x7b62('0x3e')](_0x222886[_0x7b62('0x3a')],_0x222886['query']);_0x5011f5[_0x7b62('0x3f')]=_[_0x7b62('0x3e')](_0x222886['model'],qs[_0x7b62('0x40')](_0x4672f3['query']['fields']));_0x5011f5[_0x7b62('0x3f')]=_0x5011f5[_0x7b62('0x3f')]['length']?_0x5011f5[_0x7b62('0x3f')]:_0x222886[_0x7b62('0x3a')];if(_0x4672f3[_0x7b62('0x3b')][_0x7b62('0x4a')]){_0x5011f5[_0x7b62('0x50')]=[{'all':!![]}];}_0x5011f5=_[_0x7b62('0x46')]({},_0x5011f5,_0x4672f3['options']);return db[_0x7b62('0x36')][_0x7b62('0x51')](_0x5011f5)[_0x7b62('0x49')](handleEntityNotFound(_0x217671,null))[_0x7b62('0x49')](respondWithResult(_0x217671,null))[_0x7b62('0x4d')](handleError(_0x217671,null));};exports[_0x7b62('0x52')]=function(_0x41931e,_0x53312a){return db[_0x7b62('0x36')]['create'](_0x41931e['body'],{})[_0x7b62('0x49')](respondWithResult(_0x53312a,0xc9))['catch'](handleError(_0x53312a,null));};exports[_0x7b62('0x2e')]=function(_0xcf74a3,_0x23c72d){if(_0xcf74a3[_0x7b62('0x53')]['id']){delete _0xcf74a3[_0x7b62('0x53')]['id'];}return db[_0x7b62('0x36')][_0x7b62('0x51')]({'where':{'id':_0xcf74a3[_0x7b62('0x4f')]['id']}})[_0x7b62('0x49')](handleEntityNotFound(_0x23c72d,null))[_0x7b62('0x49')](saveUpdates(_0xcf74a3[_0x7b62('0x53')],null))[_0x7b62('0x49')](respondWithResult(_0x23c72d,null))['catch'](handleError(_0x23c72d,null));};exports[_0x7b62('0x2f')]=function(_0x4fc2b6,_0x3bbb41){return db[_0x7b62('0x36')][_0x7b62('0x51')]({'where':{'id':_0x4fc2b6[_0x7b62('0x4f')]['id']}})[_0x7b62('0x49')](handleEntityNotFound(_0x3bbb41,null))[_0x7b62('0x49')](removeEntity(_0x3bbb41,null))['catch'](handleError(_0x3bbb41,null));};exports[_0x7b62('0x54')]=function(_0x586429,_0x526c46){return db[_0x7b62('0x36')][_0x7b62('0x54')]()[_0x7b62('0x49')](respondWithResult(_0x526c46,null))[_0x7b62('0x4d')](handleError(_0x526c46,null));};function wrapUser(_0x2e2b08){return function(_0x5912d0){var _0x324b38=_0x2e2b08[_0x7b62('0x55')]({'plain':!![]});_0x324b38[_0x7b62('0x56')]=[];if(_0x5912d0){_0x324b38[_0x7b62('0x57')]=_0x5912d0['createdAt'];_0x324b38[_0x7b62('0x58')]=_0x5912d0;}else{_0x324b38['lastMessageAt']=moment(0x0)[_0x7b62('0x59')](_0x7b62('0x5a'));_0x324b38[_0x7b62('0x58')]={};}return _0x324b38;};}exports['getUsers']=function(_0x2763a3,_0x3d9918,_0x1a0507){var _0x31ca77=[];return db[_0x7b62('0x5b')][_0x7b62('0x4b')]({'where':{'role':[_0x7b62('0x5c'),_0x7b62('0x5d'),_0x7b62('0x5e')]},'attributes':['id',_0x7b62('0x5f'),'name','role','userpic','internal',_0x7b62('0x60'),_0x7b62('0x61'),_0x7b62('0x62'),_0x7b62('0x63')],'order':qs['sort']('-online'),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x7b62('0x49')](function(_0x1dc985){if(_0x1dc985){var _0x5f170f=_0x2763a3[_0x7b62('0x5e')][_0x7b62('0x55')]({'plain':!![]});if(!_0x5f170f)throw new Error(_0x7b62('0x64'));if(_0x5f170f['role']===_0x7b62('0x5e')){return db[_0x7b62('0x65')][_0x7b62('0x51')]({'where':{'name':'Agents','userProfileId':_0x5f170f[_0x7b62('0x66')]},'raw':!![]})['then'](function(_0x53020b){if(_0x53020b){if(_0x53020b[_0x7b62('0x67')]===0x0){return db[_0x7b62('0x68')][_0x7b62('0x4b')]({'where':{'sectionId':_0x53020b['id']},'raw':!![]})[_0x7b62('0x49')](function(_0x24dbae){var _0x58290b=[];if(_[_0x7b62('0x69')](_0x24dbae)){_0x58290b=_[_0x7b62('0x48')](_0x1dc985,function(_0x2b7a68){if(_0x2b7a68[_0x7b62('0x6a')]!==_0x7b62('0x5c')){return _0x2b7a68;}});return _0x58290b;}else{for(var _0x2670e4=0x0;_0x2670e4<_0x1dc985[_0x7b62('0x41')];_0x2670e4++){var _0x36f9c7=_0x1dc985[_0x2670e4];if(_0x36f9c7[_0x7b62('0x6a')]===_0x7b62('0x5c')){var _0x8bceee=_['find'](_0x24dbae,function(_0x3685bb){return _0x3685bb[_0x7b62('0x6b')]===_0x36f9c7['id'];});if(_0x8bceee)_0x58290b[_0x7b62('0x6c')](_0x36f9c7);}else{_0x58290b[_0x7b62('0x6c')](_0x36f9c7);}}return _0x58290b;}});}else{return _0x1dc985;}}else{var _0xecb8ae=_[_0x7b62('0x48')](_0x1dc985,function(_0x480878){if(_0x480878[_0x7b62('0x6a')]!==_0x7b62('0x5c')){return _0x480878;}});return _0xecb8ae;}});}else{return _0x1dc985;}}})[_0x7b62('0x49')](function(_0x45d7b9){var _0x581d61=[];if(_0x45d7b9){_0x31ca77=_0x45d7b9;for(var _0x37ec1f=0x0;_0x37ec1f<_0x45d7b9[_0x7b62('0x41')];_0x37ec1f+=0x1){_0x31ca77[_0x37ec1f][_0x7b62('0x56')]=[];_0x581d61[_0x7b62('0x6c')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x2763a3[_0x7b62('0x5e')]['id'],_0x45d7b9[_0x37ec1f]['id']],'ToId':[_0x2763a3[_0x7b62('0x5e')]['id'],_0x45d7b9[_0x37ec1f]['id']],'ChatGroupId':null},'attributes':['id',_0x7b62('0x6d'),'FromId',_0x7b62('0x6e'),_0x7b62('0x6f'),_0x7b62('0x53')],'order':qs[_0x7b62('0x43')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7b62('0x49')](wrapUser(_0x45d7b9[_0x37ec1f])));}return BPromise[_0x7b62('0x70')](_0x581d61);}return[];})[_0x7b62('0x49')](function(_0x5d7af5){return{'rows':_0x5d7af5,'count':_0x5d7af5[_0x7b62('0x41')]};})['then'](respondWithResult(_0x3d9918,null))[_0x7b62('0x4d')](handleError(_0x3d9918,null));};
\ No newline at end of file
+var _0x6117=['query','filters','model','attributes','intersection','fields','hasOwnProperty','order','where','pick','filter','merge','map','VIRTUAL','ChatInternalMessage','include','findAll','rows','catch','show','keys','length','includeAll','options','find','create','body','params','describe','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueues','get','Agents','autoAssociation','UserProfileResource','isEmpty','push','FromId','read','sort','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','crypto','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','end','error','name','send','rawAttributes','type','key'];(function(_0x1c902b,_0x40189c){var _0x4e3196=function(_0x5bfe87){while(--_0x5bfe87){_0x1c902b['push'](_0x1c902b['shift']());}};_0x4e3196(++_0x40189c);}(_0x6117,0x10a));var _0x7611=function(_0x2ec7e6,_0x1a216f){_0x2ec7e6=_0x2ec7e6-0x0;var _0x21740a=_0x6117[_0x2ec7e6];return _0x21740a;};'use strict';var emlformat=require(_0x7611('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7611('0x1'));var jsonpatch=require(_0x7611('0x2'));var rp=require(_0x7611('0x3'));var moment=require(_0x7611('0x4'));var BPromise=require(_0x7611('0x5'));var Mustache=require(_0x7611('0x6'));var util=require('util');var path=require(_0x7611('0x7'));var sox=require(_0x7611('0x8'));var csv=require(_0x7611('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7611('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7611('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7611('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7611('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7611('0xe'));var hardwareService=require(_0x7611('0xf'));var logger=require(_0x7611('0x10'))(_0x7611('0x11'));var utils=require(_0x7611('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7611('0x13'));var db=require(_0x7611('0x14'))['db'];config[_0x7611('0x15')]=_[_0x7611('0x16')](config[_0x7611('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x7611('0x17'))(new Redis(config['redis']));require(_0x7611('0x18'))[_0x7611('0x19')](socket);function respondWithStatusCode(_0x4d9463,_0x370681){_0x370681=_0x370681||0xcc;return function(_0x5e5152){if(_0x5e5152){return _0x4d9463[_0x7611('0x1a')](_0x370681);}return _0x4d9463['status'](_0x370681)['end']();};}function respondWithResult(_0x5f504b,_0x416c61){_0x416c61=_0x416c61||0xc8;return function(_0x4ccec0){if(_0x4ccec0){return _0x5f504b[_0x7611('0x1b')](_0x416c61)[_0x7611('0x1c')](_0x4ccec0);}};}function respondWithFilteredResult(_0x441d44,_0x3b733e){return function(_0x289061){if(_0x289061){var _0x1bcb73=typeof _0x3b733e[_0x7611('0x1d')]===_0x7611('0x1e')&&typeof _0x3b733e[_0x7611('0x1f')]==='undefined';var _0x588824=_0x289061[_0x7611('0x20')];var _0x168965=_0x1bcb73?0x0:_0x3b733e['offset'];var _0x17715f=_0x1bcb73?_0x289061[_0x7611('0x20')]:_0x3b733e['offset']+_0x3b733e[_0x7611('0x1f')];var _0x1e789e;if(_0x17715f>=_0x588824){_0x17715f=_0x588824;_0x1e789e=0xc8;}else{_0x1e789e=0xce;}_0x441d44['status'](_0x1e789e);return _0x441d44[_0x7611('0x21')]('Content-Range',_0x168965+'-'+_0x17715f+'/'+_0x588824)[_0x7611('0x1c')](_0x289061);}return null;};}function patchUpdates(_0x32dbf0){return function(_0x4cffaf){try{jsonpatch[_0x7611('0x22')](_0x4cffaf,_0x32dbf0,!![]);}catch(_0x57ae4d){return BPromise['reject'](_0x57ae4d);}return _0x4cffaf[_0x7611('0x23')]();};}function saveUpdates(_0x4bf551,_0x33db4a){return function(_0x3a2005){if(_0x3a2005){return _0x3a2005[_0x7611('0x24')](_0x4bf551)['then'](function(_0x23d058){return _0x23d058;});}return null;};}function removeEntity(_0x47fe22,_0x2c15e7){return function(_0x449810){if(_0x449810){return _0x449810[_0x7611('0x25')]()[_0x7611('0x26')](function(){_0x47fe22[_0x7611('0x1b')](0xcc)[_0x7611('0x27')]();});}};}function handleEntityNotFound(_0x4637c2,_0x410864){return function(_0x188b04){if(!_0x188b04){_0x4637c2[_0x7611('0x1a')](0x194);}return _0x188b04;};}function handleError(_0x2f7766,_0x24a01a){_0x24a01a=_0x24a01a||0x1f4;return function(_0x37b6a9){logger[_0x7611('0x28')](_0x37b6a9['stack']);if(_0x37b6a9['name']){delete _0x37b6a9[_0x7611('0x29')];}_0x2f7766[_0x7611('0x1b')](_0x24a01a)[_0x7611('0x2a')](_0x37b6a9);};}exports['index']=function(_0x8b62df,_0x36b8cb){var _0x4408ec={},_0x44c474={},_0x1bec4f={'count':0x0,'rows':[]};var _0x4b2796=_['map'](db['ChatInternalMessage'][_0x7611('0x2b')],function(_0x16b4a9){return{'name':_0x16b4a9['fieldName'],'type':_0x16b4a9[_0x7611('0x2c')][_0x7611('0x2d')]};});_0x44c474['model']=_['map'](_0x4b2796,_0x7611('0x29'));_0x44c474[_0x7611('0x2e')]=_['keys'](_0x8b62df[_0x7611('0x2e')]);_0x44c474[_0x7611('0x2f')]=_['intersection'](_0x44c474[_0x7611('0x30')],_0x44c474[_0x7611('0x2e')]);_0x4408ec[_0x7611('0x31')]=_[_0x7611('0x32')](_0x44c474[_0x7611('0x30')],qs[_0x7611('0x33')](_0x8b62df[_0x7611('0x2e')][_0x7611('0x33')]));_0x4408ec[_0x7611('0x31')]=_0x4408ec['attributes']['length']?_0x4408ec[_0x7611('0x31')]:_0x44c474[_0x7611('0x30')];if(!_0x8b62df[_0x7611('0x2e')][_0x7611('0x34')]('nolimit')){_0x4408ec[_0x7611('0x1f')]=qs[_0x7611('0x1f')](_0x8b62df[_0x7611('0x2e')][_0x7611('0x1f')]);_0x4408ec[_0x7611('0x1d')]=qs[_0x7611('0x1d')](_0x8b62df[_0x7611('0x2e')][_0x7611('0x1d')]);}_0x4408ec[_0x7611('0x35')]=qs['sort'](_0x8b62df[_0x7611('0x2e')]['sort']);_0x4408ec[_0x7611('0x36')]=qs['filters'](_[_0x7611('0x37')](_0x8b62df['query'],_0x44c474['filters']),_0x4b2796);if(_0x8b62df[_0x7611('0x2e')][_0x7611('0x38')]){_0x4408ec[_0x7611('0x36')]=_[_0x7611('0x39')](_0x4408ec[_0x7611('0x36')],{'$or':_[_0x7611('0x3a')](_0x4b2796,function(_0x25aff5){if(_0x25aff5[_0x7611('0x2c')]!==_0x7611('0x3b')){var _0x14219d={};_0x14219d[_0x25aff5[_0x7611('0x29')]]={'$like':'%'+_0x8b62df[_0x7611('0x2e')]['filter']+'%'};return _0x14219d;}})});}_0x4408ec=_[_0x7611('0x39')]({},_0x4408ec,_0x8b62df['options']);var _0xfe129f={'where':_0x4408ec[_0x7611('0x36')]};return db[_0x7611('0x3c')][_0x7611('0x20')](_0xfe129f)[_0x7611('0x26')](function(_0x5123e2){_0x1bec4f[_0x7611('0x20')]=_0x5123e2;if(_0x8b62df['query']['includeAll']){_0x4408ec[_0x7611('0x3d')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x7611('0x3e')](_0x4408ec);})['then'](function(_0x314a43){_0x1bec4f[_0x7611('0x3f')]=_0x314a43;return _0x1bec4f;})[_0x7611('0x26')](respondWithFilteredResult(_0x36b8cb,_0x4408ec))[_0x7611('0x40')](handleError(_0x36b8cb,null));};exports[_0x7611('0x41')]=function(_0x9abd9,_0x509dc0){var _0x367fe3={'raw':!![],'where':{'id':_0x9abd9['params']['id']}},_0x332d2e={};_0x332d2e[_0x7611('0x30')]=_[_0x7611('0x42')](db[_0x7611('0x3c')]['rawAttributes']);_0x332d2e['query']=_[_0x7611('0x42')](_0x9abd9['query']);_0x332d2e['filters']=_[_0x7611('0x32')](_0x332d2e['model'],_0x332d2e[_0x7611('0x2e')]);_0x367fe3[_0x7611('0x31')]=_[_0x7611('0x32')](_0x332d2e['model'],qs[_0x7611('0x33')](_0x9abd9[_0x7611('0x2e')][_0x7611('0x33')]));_0x367fe3['attributes']=_0x367fe3[_0x7611('0x31')][_0x7611('0x43')]?_0x367fe3[_0x7611('0x31')]:_0x332d2e[_0x7611('0x30')];if(_0x9abd9[_0x7611('0x2e')][_0x7611('0x44')]){_0x367fe3[_0x7611('0x3d')]=[{'all':!![]}];}_0x367fe3=_[_0x7611('0x39')]({},_0x367fe3,_0x9abd9[_0x7611('0x45')]);return db['ChatInternalMessage'][_0x7611('0x46')](_0x367fe3)[_0x7611('0x26')](handleEntityNotFound(_0x509dc0,null))[_0x7611('0x26')](respondWithResult(_0x509dc0,null))[_0x7611('0x40')](handleError(_0x509dc0,null));};exports[_0x7611('0x47')]=function(_0x237fd4,_0x1e0a73){return db[_0x7611('0x3c')][_0x7611('0x47')](_0x237fd4[_0x7611('0x48')],{})[_0x7611('0x26')](respondWithResult(_0x1e0a73,0xc9))[_0x7611('0x40')](handleError(_0x1e0a73,null));};exports[_0x7611('0x24')]=function(_0x52491d,_0x2e4024){if(_0x52491d[_0x7611('0x48')]['id']){delete _0x52491d[_0x7611('0x48')]['id'];}return db['ChatInternalMessage'][_0x7611('0x46')]({'where':{'id':_0x52491d[_0x7611('0x49')]['id']}})['then'](handleEntityNotFound(_0x2e4024,null))[_0x7611('0x26')](saveUpdates(_0x52491d[_0x7611('0x48')],null))[_0x7611('0x26')](respondWithResult(_0x2e4024,null))[_0x7611('0x40')](handleError(_0x2e4024,null));};exports['destroy']=function(_0x56d8f5,_0x4bc2be){return db[_0x7611('0x3c')]['find']({'where':{'id':_0x56d8f5[_0x7611('0x49')]['id']}})[_0x7611('0x26')](handleEntityNotFound(_0x4bc2be,null))[_0x7611('0x26')](removeEntity(_0x4bc2be,null))[_0x7611('0x40')](handleError(_0x4bc2be,null));};exports[_0x7611('0x4a')]=function(_0x5367c4,_0x4f6841){return db[_0x7611('0x3c')]['describe']()[_0x7611('0x26')](respondWithResult(_0x4f6841,null))[_0x7611('0x40')](handleError(_0x4f6841,null));};function wrapUser(_0x16b997){return function(_0x1358f6){var _0x52927e=_0x16b997['get']({'plain':!![]});_0x52927e[_0x7611('0x4b')]=[];if(_0x1358f6){_0x52927e[_0x7611('0x4c')]=_0x1358f6[_0x7611('0x4d')];_0x52927e['lastMessage']=_0x1358f6;}else{_0x52927e[_0x7611('0x4c')]=moment(0x0)[_0x7611('0x4e')](_0x7611('0x4f'));_0x52927e['lastMessage']={};}return _0x52927e;};}exports[_0x7611('0x50')]=function(_0x4b1bca,_0x116624,_0x2a526e){var _0x2d7411=[];return db[_0x7611('0x51')]['findAll']({'where':{'role':[_0x7611('0x52'),_0x7611('0x53'),_0x7611('0x54')]},'attributes':['id',_0x7611('0x55'),_0x7611('0x29'),_0x7611('0x56'),_0x7611('0x57'),'internal',_0x7611('0x58'),_0x7611('0x59'),_0x7611('0x5a'),_0x7611('0x5b')],'order':qs['sort']('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x7611('0x5c'),'attributes':['id',_0x7611('0x29'),'type'],'through':{'attributes':[]}}]})[_0x7611('0x26')](function(_0x3e5ae3){if(_0x3e5ae3){var _0x3d679c=_0x4b1bca['user'][_0x7611('0x5d')]({'plain':!![]});if(!_0x3d679c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d679c[_0x7611('0x56')]==='user'){return db['UserProfileSection'][_0x7611('0x46')]({'where':{'name':_0x7611('0x5e'),'userProfileId':_0x3d679c['userProfileId']},'raw':!![]})['then'](function(_0xef0865){if(_0xef0865){if(_0xef0865[_0x7611('0x5f')]===0x0){return db[_0x7611('0x60')]['findAll']({'where':{'sectionId':_0xef0865['id']},'raw':!![]})[_0x7611('0x26')](function(_0x3fccb0){var _0x25684a=[];if(_[_0x7611('0x61')](_0x3fccb0)){_0x25684a=_[_0x7611('0x38')](_0x3e5ae3,function(_0x31c943){if(_0x31c943['role']!=='agent'){return _0x31c943;}});return _0x25684a;}else{for(var _0x51ee06=0x0;_0x51ee06<_0x3e5ae3['length'];_0x51ee06++){var _0x43ae58=_0x3e5ae3[_0x51ee06];if(_0x43ae58[_0x7611('0x56')]===_0x7611('0x52')){var _0x1c6c67=_[_0x7611('0x46')](_0x3fccb0,function(_0x498929){return _0x498929['resourceId']===_0x43ae58['id'];});if(_0x1c6c67)_0x25684a[_0x7611('0x62')](_0x43ae58);}else{_0x25684a['push'](_0x43ae58);}}return _0x25684a;}});}else{return _0x3e5ae3;}}else{var _0x2b457c=_[_0x7611('0x38')](_0x3e5ae3,function(_0x140123){if(_0x140123['role']!==_0x7611('0x52')){return _0x140123;}});return _0x2b457c;}});}else{return _0x3e5ae3;}}})['then'](function(_0x9abad4){var _0x109b97=[];if(_0x9abad4){_0x2d7411=_0x9abad4;for(var _0x507c0d=0x0;_0x507c0d<_0x9abad4[_0x7611('0x43')];_0x507c0d+=0x1){_0x2d7411[_0x507c0d][_0x7611('0x4b')]=[];_0x109b97[_0x7611('0x62')](db['ChatInternalMessage'][_0x7611('0x46')]({'where':{'FromId':[_0x4b1bca[_0x7611('0x54')]['id'],_0x9abad4[_0x507c0d]['id']],'ToId':[_0x4b1bca[_0x7611('0x54')]['id'],_0x9abad4[_0x507c0d]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x7611('0x63'),'ToId',_0x7611('0x64'),'body'],'order':qs[_0x7611('0x65')](_0x7611('0x66')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7611('0x26')](wrapUser(_0x9abad4[_0x507c0d])));}return BPromise[_0x7611('0x67')](_0x109b97);}return[];})[_0x7611('0x26')](function(_0x515a2e){return{'rows':_0x515a2e,'count':_0x515a2e[_0x7611('0x43')]};})[_0x7611('0x26')](respondWithResult(_0x116624,null))[_0x7611('0x40')](handleError(_0x116624,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index af19207..caf86fa 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 _0x0362=['update','remove','emit','hook','exports','events','ChatInternalMessage','save'];(function(_0x11c3a3,_0x5b6b7c){var _0xa19d6a=function(_0x5ddd0f){while(--_0x5ddd0f){_0x11c3a3['push'](_0x11c3a3['shift']());}};_0xa19d6a(++_0x5b6b7c);}(_0x0362,0x15d));var _0x2036=function(_0x5e20ba,_0x2adb5d){_0x5e20ba=_0x5e20ba-0x0;var _0x29b623=_0x0362[_0x5e20ba];return _0x29b623;};'use strict';var EventEmitter=require(_0x2036('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x2036('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2036('0x2'),'afterUpdate':_0x2036('0x3'),'afterDestroy':_0x2036('0x4')};function emitEvent(_0x5ad87b){return function(_0x2dcda5,_0x107482,_0x41db72){ChatInternalMessageEvents[_0x2036('0x5')](_0x5ad87b+':'+_0x2dcda5['id'],_0x2dcda5);ChatInternalMessageEvents[_0x2036('0x5')](_0x5ad87b,_0x2dcda5);_0x41db72(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x2036('0x6')](e,emitEvent(event));}}module[_0x2036('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xbc6f=['../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','exports','events'];(function(_0x45e14c,_0x9dabd){var _0x3f364f=function(_0x59312d){while(--_0x59312d){_0x45e14c['push'](_0x45e14c['shift']());}};_0x3f364f(++_0x9dabd);}(_0xbc6f,0xf7));var _0xfbc6=function(_0x3a3d20,_0x244316){_0x3a3d20=_0x3a3d20-0x0;var _0x33bc94=_0xbc6f[_0x3a3d20];return _0x33bc94;};'use strict';var EventEmitter=require(_0xfbc6('0x0'));var ChatInternalMessage=require(_0xfbc6('0x1'))['db'][_0xfbc6('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xfbc6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfbc6('0x4'),'afterDestroy':_0xfbc6('0x5')};function emitEvent(_0x119b4c){return function(_0x3822ec,_0x2f51ef,_0x5047a6){ChatInternalMessageEvents[_0xfbc6('0x6')](_0x119b4c+':'+_0x3822ec['id'],_0x3822ec);ChatInternalMessageEvents[_0xfbc6('0x6')](_0x119b4c,_0x3822ec);_0x5047a6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xfbc6('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 10835b2..b1f00d1 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 _0xdf1e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x27f614,_0x2b0fdc){var _0x533fe0=function(_0x2f42f5){while(--_0x2f42f5){_0x27f614['push'](_0x27f614['shift']());}};_0x533fe0(++_0x2b0fdc);}(_0xdf1e,0x15e));var _0xedf1=function(_0x35826c,_0x57bdf7){_0x35826c=_0x35826c-0x0;var _0x2d844f=_0xdf1e[_0x35826c];return _0x2d844f;};'use strict';var _=require('lodash');var util=require(_0xedf1('0x0'));var logger=require('../../config/logger')(_0xedf1('0x1'));var moment=require(_0xedf1('0x2'));var BPromise=require(_0xedf1('0x3'));var rp=require(_0xedf1('0x4'));var fs=require('fs');var path=require(_0xedf1('0x5'));var rimraf=require(_0xedf1('0x6'));var config=require(_0xedf1('0x7'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x11fa72,_0x1ec6b8){return _0x11fa72[_0xedf1('0x8')](_0xedf1('0x9'),attributes,{'tableName':_0xedf1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xedf1('0xb'),'collate':_0xedf1('0xc')});};
\ No newline at end of file
+var _0xd6ec=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x284862,_0x2a060f){var _0x3f9522=function(_0x59e24c){while(--_0x59e24c){_0x284862['push'](_0x284862['shift']());}};_0x3f9522(++_0x2a060f);}(_0xd6ec,0x1ec));var _0xcd6e=function(_0x36753c,_0x4320e7){_0x36753c=_0x36753c-0x0;var _0x12d55b=_0xd6ec[_0x36753c];return _0x12d55b;};'use strict';var _=require(_0xcd6e('0x0'));var util=require(_0xcd6e('0x1'));var logger=require(_0xcd6e('0x2'))(_0xcd6e('0x3'));var moment=require(_0xcd6e('0x4'));var BPromise=require(_0xcd6e('0x5'));var rp=require(_0xcd6e('0x6'));var fs=require('fs');var path=require(_0xcd6e('0x7'));var rimraf=require(_0xcd6e('0x8'));var config=require(_0xcd6e('0x9'));var attributes=require(_0xcd6e('0xa'));module[_0xcd6e('0xb')]=function(_0x13ced7,_0x115d84){return _0x13ced7[_0xcd6e('0xc')](_0xcd6e('0xd'),attributes,{'tableName':_0xcd6e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xcd6e('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 2cdd7fe..ac748de 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 _0x620b=['defaults','./chatInternalMessage.socket','request','info','request\x20sent','debug','error','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x620b,0x1c3));var _0xb620=function(_0x5e6678,_0x3f0c45){_0x5e6678=_0x5e6678-0x0;var _0x5c1dc5=_0x620b[_0x5e6678];return _0x5c1dc5;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb620('0x0'));var rs=require(_0xb620('0x1'));var fs=require('fs');var Redis=require(_0xb620('0x2'));var db=require(_0xb620('0x3'))['db'];var utils=require(_0xb620('0x4'));var logger=require(_0xb620('0x5'))(_0xb620('0x6'));var config=require(_0xb620('0x7'));var jayson=require(_0xb620('0x8'));var client=jayson['client'][_0xb620('0x9')]({'port':0x232a});config[_0xb620('0xa')]=_[_0xb620('0xb')](config[_0xb620('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb620('0xa')]));require(_0xb620('0xc'))['register'](socket);function respondWithRpcPromise(_0x186a11,_0x18c4fd,_0x1fd63d){return new BPromise(function(_0x3f2911,_0x34e508){return client[_0xb620('0xd')](_0x186a11,_0x1fd63d)['then'](function(_0x2de2d1){logger[_0xb620('0xe')]('ChatInternalMessage,\x20%s,\x20%s',_0x18c4fd,_0xb620('0xf'));logger[_0xb620('0x10')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x18c4fd,'request\x20sent',JSON['stringify'](_0x2de2d1));if(_0x2de2d1[_0xb620('0x11')]){if(_0x2de2d1['error']['code']===0x1f4){logger[_0xb620('0x11')](_0xb620('0x12'),_0x18c4fd,_0x2de2d1[_0xb620('0x11')]['message']);return _0x34e508(_0x2de2d1[_0xb620('0x11')]['message']);}logger[_0xb620('0x11')](_0xb620('0x12'),_0x18c4fd,_0x2de2d1[_0xb620('0x11')][_0xb620('0x13')]);return _0x3f2911(_0x2de2d1[_0xb620('0x11')][_0xb620('0x13')]);}else{logger['info'](_0xb620('0x12'),_0x18c4fd,_0xb620('0xf'));_0x3f2911(_0x2de2d1[_0xb620('0x14')][_0xb620('0x13')]);}})[_0xb620('0x15')](function(_0x448bb8){logger[_0xb620('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x18c4fd,_0x448bb8);_0x34e508(_0x448bb8);});});}
\ No newline at end of file
+var _0x907a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x907a,0xe9));var _0xa907=function(_0x42d529,_0x4a9bde){_0x42d529=_0x42d529-0x0;var _0x502bdc=_0x907a[_0x42d529];return _0x502bdc;};'use strict';var _=require('lodash');var util=require(_0xa907('0x0'));var moment=require(_0xa907('0x1'));var BPromise=require(_0xa907('0x2'));var rs=require(_0xa907('0x3'));var fs=require('fs');var Redis=require(_0xa907('0x4'));var db=require(_0xa907('0x5'))['db'];var utils=require(_0xa907('0x6'));var logger=require(_0xa907('0x7'))(_0xa907('0x8'));var config=require(_0xa907('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa907('0xa')]['http']({'port':0x232a});config['redis']=_[_0xa907('0xb')](config[_0xa907('0xc')],{'host':_0xa907('0xd'),'port':0x18eb});var socket=require(_0xa907('0xe'))(new Redis(config[_0xa907('0xc')]));require('./chatInternalMessage.socket')[_0xa907('0xf')](socket);function respondWithRpcPromise(_0x4008a7,_0x57cbc6,_0x512ddd){return new BPromise(function(_0x31efea,_0x2b625c){return client[_0xa907('0x10')](_0x4008a7,_0x512ddd)['then'](function(_0x517f3a){logger[_0xa907('0x11')](_0xa907('0x12'),_0x57cbc6,_0xa907('0x13'));logger[_0xa907('0x14')](_0xa907('0x15'),_0x57cbc6,_0xa907('0x13'),JSON[_0xa907('0x16')](_0x517f3a));if(_0x517f3a['error']){if(_0x517f3a[_0xa907('0x17')][_0xa907('0x18')]===0x1f4){logger[_0xa907('0x17')](_0xa907('0x12'),_0x57cbc6,_0x517f3a['error'][_0xa907('0x19')]);return _0x2b625c(_0x517f3a[_0xa907('0x17')][_0xa907('0x19')]);}logger['error'](_0xa907('0x12'),_0x57cbc6,_0x517f3a[_0xa907('0x17')][_0xa907('0x19')]);return _0x31efea(_0x517f3a[_0xa907('0x17')][_0xa907('0x19')]);}else{logger[_0xa907('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x57cbc6,_0xa907('0x13'));_0x31efea(_0x517f3a['result'][_0xa907('0x19')]);}})['catch'](function(_0x1ab640){logger[_0xa907('0x17')](_0xa907('0x12'),_0x57cbc6,_0x1ab640);_0x2b625c(_0x1ab640);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index aca73d7..e0e96f4 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 _0xf5c4=['chatInternalMessage:','./chatInternalMessage.events','remove','update','emit','removeListener','register','length'];(function(_0x5eaf1f,_0xac547c){var _0x24e765=function(_0x412b0f){while(--_0x412b0f){_0x5eaf1f['push'](_0x5eaf1f['shift']());}};_0x24e765(++_0xac547c);}(_0xf5c4,0xa1));var _0x4f5c=function(_0x4d1ecf,_0x374814){_0x4d1ecf=_0x4d1ecf-0x0;var _0x19c055=_0xf5c4[_0x4d1ecf];return _0x19c055;};'use strict';var ChatInternalMessageEvents=require(_0x4f5c('0x0'));var events=['save',_0x4f5c('0x1'),_0x4f5c('0x2')];function createListener(_0xec8856,_0x720e6d){return function(_0x48ba2d){_0x720e6d[_0x4f5c('0x3')](_0xec8856,_0x48ba2d);};}function removeListener(_0x1ce3b0,_0x424cbb){return function(){ChatInternalMessageEvents[_0x4f5c('0x4')](_0x1ce3b0,_0x424cbb);};}exports[_0x4f5c('0x5')]=function(_0x370033){for(var _0x4bb052=0x0,_0x1e2806=events[_0x4f5c('0x6')];_0x4bb052<_0x1e2806;_0x4bb052++){var _0x1e964f=events[_0x4bb052];var _0x4be69b=createListener(_0x4f5c('0x7')+_0x1e964f,_0x370033);ChatInternalMessageEvents['on'](_0x1e964f,_0x4be69b);}};
\ No newline at end of file
+var _0x3fc7=['length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener'];(function(_0x50e938,_0x23924f){var _0x271134=function(_0x3b05f1){while(--_0x3b05f1){_0x50e938['push'](_0x50e938['shift']());}};_0x271134(++_0x23924f);}(_0x3fc7,0x1e2));var _0x73fc=function(_0x567bcb,_0x4978c1){_0x567bcb=_0x567bcb-0x0;var _0x4eebc2=_0x3fc7[_0x567bcb];return _0x4eebc2;};'use strict';var ChatInternalMessageEvents=require(_0x73fc('0x0'));var events=[_0x73fc('0x1'),_0x73fc('0x2'),_0x73fc('0x3')];function createListener(_0x2ba433,_0x5940f6){return function(_0x507782){_0x5940f6[_0x73fc('0x4')](_0x2ba433,_0x507782);};}function removeListener(_0x2e35d2,_0x185c0e){return function(){ChatInternalMessageEvents[_0x73fc('0x5')](_0x2e35d2,_0x185c0e);};}exports['register']=function(_0x354b1){for(var _0xba88ae=0x0,_0x4c9e12=events[_0x73fc('0x6')];_0xba88ae<_0x4c9e12;_0xba88ae++){var _0x18b986=events[_0xba88ae];var _0x1abcab=createListener(_0x73fc('0x7')+_0x18b986,_0x354b1);ChatInternalMessageEvents['on'](_0x18b986,_0x1abcab);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index fffba65..98be9a6 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 _0x5057=['Router','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users','getUsers','show','post','put','/:id','update','delete','exports','util','path','connect-timeout','express'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x5057,0x1ca));var _0x7505=function(_0xb08374,_0x141ef3){_0xb08374=_0xb08374-0x0;var _0x428d38=_0x5057[_0xb08374];return _0x428d38;};'use strict';var multer=require('multer');var util=require(_0x7505('0x0'));var path=require(_0x7505('0x1'));var timeout=require(_0x7505('0x2'));var express=require(_0x7505('0x3'));var router=express[_0x7505('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7505('0x5'));var config=require(_0x7505('0x6'));var controller=require(_0x7505('0x7'));router[_0x7505('0x8')]('/',auth[_0x7505('0x9')](),controller[_0x7505('0xa')]);router[_0x7505('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x7505('0xb')]);router['get'](_0x7505('0xc'),auth[_0x7505('0x9')](),controller[_0x7505('0xd')]);router[_0x7505('0x8')]('/:id',auth[_0x7505('0x9')](),controller[_0x7505('0xe')]);router[_0x7505('0xf')]('/',auth[_0x7505('0x9')](),controller['create']);router[_0x7505('0x10')](_0x7505('0x11'),controller[_0x7505('0x12')]);router[_0x7505('0x13')]('/:id',auth[_0x7505('0x9')](),controller['destroy']);module[_0x7505('0x14')]=router;
\ No newline at end of file
+var _0x61cb=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','isAuthenticated','describe','/users','getUsers','/:id','show','post','update','delete','destroy','exports','path'];(function(_0x3aa728,_0x5036d5){var _0x20e389=function(_0x50c57d){while(--_0x50c57d){_0x3aa728['push'](_0x3aa728['shift']());}};_0x20e389(++_0x5036d5);}(_0x61cb,0x1b7));var _0xb61c=function(_0x4800bf,_0x3f6aa0){_0x4800bf=_0x4800bf-0x0;var _0x4dc339=_0x61cb[_0x4800bf];return _0x4dc339;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb61c('0x0'));var timeout=require(_0xb61c('0x1'));var express=require(_0xb61c('0x2'));var router=express[_0xb61c('0x3')]();var fs_extra=require(_0xb61c('0x4'));var auth=require(_0xb61c('0x5'));var interaction=require(_0xb61c('0x6'));var config=require(_0xb61c('0x7'));var controller=require(_0xb61c('0x8'));router[_0xb61c('0x9')]('/',auth['isAuthenticated'](),controller[_0xb61c('0xa')]);router['get']('/describe',auth[_0xb61c('0xb')](),controller[_0xb61c('0xc')]);router['get'](_0xb61c('0xd'),auth[_0xb61c('0xb')](),controller[_0xb61c('0xe')]);router['get'](_0xb61c('0xf'),auth[_0xb61c('0xb')](),controller[_0xb61c('0x10')]);router[_0xb61c('0x11')]('/',auth[_0xb61c('0xb')](),controller['create']);router['put'](_0xb61c('0xf'),controller[_0xb61c('0x12')]);router[_0xb61c('0x13')]('/:id',auth[_0xb61c('0xb')](),controller[_0xb61c('0x14')]);module[_0xb61c('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index a45a3d6..31790a8 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 _0xee4f=['BOOLEAN','out','DATE','sequelize','medium'];(function(_0x2cb4a0,_0x221e34){var _0x19bd31=function(_0x5c973b){while(--_0x5c973b){_0x2cb4a0['push'](_0x2cb4a0['shift']());}};_0x19bd31(++_0x221e34);}(_0xee4f,0xad));var _0xfee4=function(_0x329a93,_0x2321ef){_0x329a93=_0x329a93-0x0;var _0x5b9b61=_0xee4f[_0x329a93];return _0x5b9b61;};'use strict';var Sequelize=require(_0xfee4('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xfee4('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xfee4('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xfee4('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xfee4('0x3')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xfee4('0x4')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xa149=['BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT','medium'];(function(_0x2d4eb8,_0x57d1e9){var _0x11f386=function(_0x47da21){while(--_0x47da21){_0x2d4eb8['push'](_0x2d4eb8['shift']());}};_0x11f386(++_0x57d1e9);}(_0xa149,0x18c));var _0x9a14=function(_0x1a6c0f,_0x284fd9){_0x1a6c0f=_0x1a6c0f-0x0;var _0x24b595=_0xa149[_0x1a6c0f];return _0x24b595;};'use strict';var Sequelize=require(_0x9a14('0x0'));module[_0x9a14('0x1')]={'body':{'type':Sequelize[_0x9a14('0x2')](_0x9a14('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9a14('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x9a14('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9a14('0x5')]('in',_0x9a14('0x6')),'defaultValue':_0x9a14('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x9a14('0x7')]},'providerResponse':{'type':Sequelize[_0x9a14('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 60259b9..ab3d501 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 _0xa318=['options','includeAll','include','findAll','rows','show','params','keys','find','create','body','destroy','describe','../../config/logger','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','role','RejectMessage','rejectMessage','Sequelize','motionChannel','eml-format','rimraf','zip-dir','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./chatMessage.socket','client','http','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x52a23d,_0xd93644){var _0x4f360b=function(_0x1c60c0){while(--_0x1c60c0){_0x52a23d['push'](_0x52a23d['shift']());}};_0x4f360b(++_0xd93644);}(_0xa318,0x13e));var _0x8a31=function(_0x27a9cd,_0x40311d){_0x27a9cd=_0x27a9cd-0x0;var _0xd8be27=_0xa318[_0x27a9cd];return _0xd8be27;};'use strict';var emlformat=require(_0x8a31('0x0'));var rimraf=require(_0x8a31('0x1'));var zipdir=require(_0x8a31('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8a31('0x3'));var Mustache=require(_0x8a31('0x4'));var util=require(_0x8a31('0x5'));var path=require('path');var sox=require(_0x8a31('0x6'));var csv=require('to-csv');var ejs=require(_0x8a31('0x7'));var fs=require('fs');var fs_extra=require(_0x8a31('0x8'));var _=require('lodash');var squel=require(_0x8a31('0x9'));var crypto=require('crypto');var jsforce=require(_0x8a31('0xa'));var deskjs=require(_0x8a31('0xb'));var toCsv=require(_0x8a31('0xc'));var querystring=require(_0x8a31('0xd'));var Papa=require(_0x8a31('0xe'));var Redis=require(_0x8a31('0xf'));var authService=require(_0x8a31('0x10'));var qs=require(_0x8a31('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a31('0x12'));var logger=require('../../config/logger')(_0x8a31('0x13'));var utils=require(_0x8a31('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8a31('0x15'));var db=require('../../mysqldb')['db'];config[_0x8a31('0x16')]=_[_0x8a31('0x17')](config['redis'],{'host':_0x8a31('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8a31('0x16')]));require(_0x8a31('0x19'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x8a31('0x1a')][_0x8a31('0x1b')]({'port':0x232c});var client9002=jayson[_0x8a31('0x1a')][_0x8a31('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x3f9398,_0x970c2f,_0xc423ee,_0x1f0508){return new BPromise(function(_0x1b941d,_0x49ec24){var _0x5b9b9e=_0x1f0508||client;return _0x5b9b9e['request'](_0x3f9398,_0xc423ee)['then'](function(_0xc40602){logger['info'](_0x8a31('0x1c'),_0x970c2f,_0x8a31('0x1d'));logger[_0x8a31('0x1e')](_0x8a31('0x1f'),_0x970c2f,_0x8a31('0x1d'),JSON['stringify'](_0xc40602));if(_0xc40602[_0x8a31('0x20')]){if(_0xc40602[_0x8a31('0x20')]['code']===0x1f4){logger['error'](_0x8a31('0x1c'),_0x970c2f,_0xc40602[_0x8a31('0x20')][_0x8a31('0x21')]);return _0x49ec24(_0xc40602[_0x8a31('0x20')][_0x8a31('0x21')]);}logger[_0x8a31('0x20')](_0x8a31('0x1c'),_0x970c2f,_0xc40602[_0x8a31('0x20')][_0x8a31('0x21')]);return _0x1b941d(_0xc40602['error'][_0x8a31('0x21')]);}else{logger[_0x8a31('0x22')]('ChatMessage,\x20%s,\x20%s',_0x970c2f,_0x8a31('0x1d'));_0x1b941d(_0xc40602[_0x8a31('0x23')][_0x8a31('0x21')]);}})[_0x8a31('0x24')](function(_0x1da35b){logger['error'](_0x8a31('0x1c'),_0x970c2f,_0x1da35b);_0x49ec24(_0x1da35b);});});}function respondWithStatusCode(_0xce4f0a,_0x94e6f1){_0x94e6f1=_0x94e6f1||0xcc;return function(_0x395005){if(_0x395005){return _0xce4f0a['sendStatus'](_0x94e6f1);}return _0xce4f0a[_0x8a31('0x25')](_0x94e6f1)['end']();};}function respondWithResult(_0xd847d3,_0x3b7128){_0x3b7128=_0x3b7128||0xc8;return function(_0xfc6943){if(_0xfc6943){return _0xd847d3[_0x8a31('0x25')](_0x3b7128)[_0x8a31('0x26')](_0xfc6943);}};}function respondWithFilteredResult(_0x4baab1,_0x2280ca){return function(_0x4db5d2){if(_0x4db5d2){var _0xc1e63=typeof _0x2280ca[_0x8a31('0x27')]===_0x8a31('0x28')&&typeof _0x2280ca[_0x8a31('0x29')]===_0x8a31('0x28');var _0x339ed2=_0x4db5d2[_0x8a31('0x2a')];var _0x5e4c49=_0xc1e63?0x0:_0x2280ca['offset'];var _0x44db32=_0xc1e63?_0x4db5d2[_0x8a31('0x2a')]:_0x2280ca[_0x8a31('0x27')]+_0x2280ca[_0x8a31('0x29')];var _0x15dd0a;if(_0x44db32>=_0x339ed2){_0x44db32=_0x339ed2;_0x15dd0a=0xc8;}else{_0x15dd0a=0xce;}_0x4baab1[_0x8a31('0x25')](_0x15dd0a);return _0x4baab1[_0x8a31('0x2b')](_0x8a31('0x2c'),_0x5e4c49+'-'+_0x44db32+'/'+_0x339ed2)[_0x8a31('0x26')](_0x4db5d2);}return null;};}function patchUpdates(_0x209695){return function(_0x3e12db){try{jsonpatch[_0x8a31('0x2d')](_0x3e12db,_0x209695,!![]);}catch(_0x4385f8){return BPromise[_0x8a31('0x2e')](_0x4385f8);}return _0x3e12db[_0x8a31('0x2f')]();};}function saveUpdates(_0x3b56df,_0x3d2b7f){return function(_0x4f894f){if(_0x4f894f){return _0x4f894f[_0x8a31('0x30')](_0x3b56df)[_0x8a31('0x31')](function(_0x3142b9){return _0x3142b9;});}return null;};}function removeEntity(_0x6df394,_0x11c8ab){return function(_0xfba038){if(_0xfba038){return _0xfba038['destroy']()['then'](function(){_0x6df394[_0x8a31('0x25')](0xcc)[_0x8a31('0x32')]();});}};}function handleEntityNotFound(_0x32b424,_0x30bf2a){return function(_0x3e7261){if(!_0x3e7261){_0x32b424['sendStatus'](0x194);}return _0x3e7261;};}function handleError(_0x4cf542,_0x159813){_0x159813=_0x159813||0x1f4;return function(_0x3452a2){logger[_0x8a31('0x20')](_0x3452a2[_0x8a31('0x33')]);if(_0x3452a2[_0x8a31('0x34')]){delete _0x3452a2[_0x8a31('0x34')];}_0x4cf542['status'](_0x159813)['send'](_0x3452a2);};}exports[_0x8a31('0x35')]=function(_0x476c65,_0x2e3c64){var _0x181ad7={},_0x5b4014={},_0x18a220={'count':0x0,'rows':[]};var _0x37c227=_[_0x8a31('0x36')](db[_0x8a31('0x37')][_0x8a31('0x38')],function(_0x117bca){return{'name':_0x117bca[_0x8a31('0x39')],'type':_0x117bca[_0x8a31('0x3a')][_0x8a31('0x3b')]};});_0x5b4014['model']=_[_0x8a31('0x36')](_0x37c227,_0x8a31('0x34'));_0x5b4014[_0x8a31('0x3c')]=_['keys'](_0x476c65[_0x8a31('0x3c')]);_0x5b4014[_0x8a31('0x3d')]=_[_0x8a31('0x3e')](_0x5b4014['model'],_0x5b4014[_0x8a31('0x3c')]);_0x181ad7[_0x8a31('0x3f')]=_['intersection'](_0x5b4014[_0x8a31('0x40')],qs[_0x8a31('0x41')](_0x476c65[_0x8a31('0x3c')]['fields']));_0x181ad7[_0x8a31('0x3f')]=_0x181ad7[_0x8a31('0x3f')][_0x8a31('0x42')]?_0x181ad7[_0x8a31('0x3f')]:_0x5b4014[_0x8a31('0x40')];if(!_0x476c65[_0x8a31('0x3c')][_0x8a31('0x43')](_0x8a31('0x44'))){_0x181ad7[_0x8a31('0x29')]=qs[_0x8a31('0x29')](_0x476c65[_0x8a31('0x3c')][_0x8a31('0x29')]);_0x181ad7[_0x8a31('0x27')]=qs[_0x8a31('0x27')](_0x476c65[_0x8a31('0x3c')][_0x8a31('0x27')]);}_0x181ad7['order']=qs[_0x8a31('0x45')](_0x476c65[_0x8a31('0x3c')][_0x8a31('0x45')]);_0x181ad7[_0x8a31('0x46')]=qs[_0x8a31('0x3d')](_[_0x8a31('0x47')](_0x476c65[_0x8a31('0x3c')],_0x5b4014[_0x8a31('0x3d')]),_0x37c227);if(_0x476c65[_0x8a31('0x3c')][_0x8a31('0x48')]){_0x181ad7[_0x8a31('0x46')]=_[_0x8a31('0x49')](_0x181ad7[_0x8a31('0x46')],{'$or':_[_0x8a31('0x36')](_0x37c227,function(_0x3f5bc4){if(_0x3f5bc4['type']!==_0x8a31('0x4a')){var _0x5b1fd9={};_0x5b1fd9[_0x3f5bc4['name']]={'$like':'%'+_0x476c65[_0x8a31('0x3c')][_0x8a31('0x48')]+'%'};return _0x5b1fd9;}})});}_0x181ad7=_['merge']({},_0x181ad7,_0x476c65[_0x8a31('0x4b')]);var _0x3483e3={'where':_0x181ad7['where']};return db[_0x8a31('0x37')][_0x8a31('0x2a')](_0x3483e3)[_0x8a31('0x31')](function(_0x55f49a){_0x18a220['count']=_0x55f49a;if(_0x476c65[_0x8a31('0x3c')][_0x8a31('0x4c')]){_0x181ad7[_0x8a31('0x4d')]=[{'all':!![]}];}return db[_0x8a31('0x37')][_0x8a31('0x4e')](_0x181ad7);})[_0x8a31('0x31')](function(_0x3bb22c){_0x18a220[_0x8a31('0x4f')]=_0x3bb22c;return _0x18a220;})[_0x8a31('0x31')](respondWithFilteredResult(_0x2e3c64,_0x181ad7))[_0x8a31('0x24')](handleError(_0x2e3c64,null));};exports[_0x8a31('0x50')]=function(_0x497512,_0x106f81){var _0x352bc9={'raw':!![],'where':{'id':_0x497512[_0x8a31('0x51')]['id']}},_0x588c36={};_0x588c36[_0x8a31('0x40')]=_[_0x8a31('0x52')](db[_0x8a31('0x37')][_0x8a31('0x38')]);_0x588c36[_0x8a31('0x3c')]=_[_0x8a31('0x52')](_0x497512[_0x8a31('0x3c')]);_0x588c36[_0x8a31('0x3d')]=_[_0x8a31('0x3e')](_0x588c36[_0x8a31('0x40')],_0x588c36[_0x8a31('0x3c')]);_0x352bc9['attributes']=_[_0x8a31('0x3e')](_0x588c36[_0x8a31('0x40')],qs[_0x8a31('0x41')](_0x497512['query'][_0x8a31('0x41')]));_0x352bc9[_0x8a31('0x3f')]=_0x352bc9[_0x8a31('0x3f')][_0x8a31('0x42')]?_0x352bc9['attributes']:_0x588c36[_0x8a31('0x40')];if(_0x497512[_0x8a31('0x3c')][_0x8a31('0x4c')]){_0x352bc9[_0x8a31('0x4d')]=[{'all':!![]}];}_0x352bc9=_['merge']({},_0x352bc9,_0x497512[_0x8a31('0x4b')]);return db[_0x8a31('0x37')][_0x8a31('0x53')](_0x352bc9)[_0x8a31('0x31')](handleEntityNotFound(_0x106f81,null))[_0x8a31('0x31')](respondWithResult(_0x106f81,null))[_0x8a31('0x24')](handleError(_0x106f81,null));};exports['create']=function(_0x49384d,_0x5f2cd7){return db[_0x8a31('0x37')][_0x8a31('0x54')](_0x49384d['body'],{})[_0x8a31('0x31')](respondWithResult(_0x5f2cd7,0xc9))[_0x8a31('0x24')](handleError(_0x5f2cd7,null));};exports[_0x8a31('0x30')]=function(_0x525d62,_0x220704){if(_0x525d62[_0x8a31('0x55')]['id']){delete _0x525d62[_0x8a31('0x55')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x525d62[_0x8a31('0x51')]['id']}})['then'](handleEntityNotFound(_0x220704,null))[_0x8a31('0x31')](saveUpdates(_0x525d62[_0x8a31('0x55')],null))[_0x8a31('0x31')](respondWithResult(_0x220704,null))[_0x8a31('0x24')](handleError(_0x220704,null));};exports[_0x8a31('0x56')]=function(_0x5255cd,_0x3d3615){return db[_0x8a31('0x37')][_0x8a31('0x53')]({'where':{'id':_0x5255cd[_0x8a31('0x51')]['id']}})[_0x8a31('0x31')](handleEntityNotFound(_0x3d3615,null))[_0x8a31('0x31')](removeEntity(_0x3d3615,null))[_0x8a31('0x24')](handleError(_0x3d3615,null));};exports[_0x8a31('0x57')]=function(_0x1be34b,_0x55ce9d){return db[_0x8a31('0x37')][_0x8a31('0x57')]()['then'](respondWithResult(_0x55ce9d,null))[_0x8a31('0x24')](handleError(_0x55ce9d,null));};var interaction_log=require(_0x8a31('0x58'))(_0x8a31('0x59'));exports[_0x8a31('0x5a')]=function(_0x392d26,_0x8813ab,_0xfbd8c5){var _0x2a3ac1={'agent':{},'channel':_0x8a31('0x5b')};if(_0x392d26[_0x8a31('0x55')]['id']){delete _0x392d26[_0x8a31('0x55')]['id'];}_0x392d26[_0x8a31('0x55')][_0x8a31('0x5c')]=!![];_0x392d26[_0x8a31('0x55')]['readAt']=moment()[_0x8a31('0x5d')](_0x8a31('0x5e'));_0x392d26['body'][_0x8a31('0x5f')]=_0x392d26[_0x8a31('0x55')][_0x8a31('0x5f')]||_0x392d26[_0x8a31('0x60')]['id'];_0x2a3ac1[_0x8a31('0x61')]['id']=_0x392d26[_0x8a31('0x55')][_0x8a31('0x5f')];return db[_0x8a31('0x37')][_0x8a31('0x53')]({'where':{'id':_0x392d26['params']['id'],'UserId':null}})[_0x8a31('0x31')](handleEntityNotFound(_0x8813ab,null))[_0x8a31('0x31')](saveUpdates(_0x392d26['body'],null))[_0x8a31('0x31')](function(_0x3a65f6){if(_0x3a65f6){_0x2a3ac1[_0x8a31('0x21')]=_0x3a65f6[_0x8a31('0x62')]({'plain':!![]});return db[_0x8a31('0x63')]['find']({'where':{'id':_0x3a65f6[_0x8a31('0x64')]}});}return null;})[_0x8a31('0x31')](handleEntityNotFound(_0x8813ab,null))['then'](function(_0x5bd9f8){if(_0x5bd9f8){return _0x5bd9f8[_0x8a31('0x30')]({'UserId':_0x392d26[_0x8a31('0x55')][_0x8a31('0x5f')],'read1stAt':_[_0x8a31('0x65')](_0x5bd9f8[_0x8a31('0x66')])?moment()['format'](_0x8a31('0x5e')):undefined});}return null;})[_0x8a31('0x31')](function(_0xfb6d05){if(_0xfb6d05){_0x2a3ac1[_0x8a31('0x67')]=_0xfb6d05['get']({'plain':!![]});interaction_log['info'](_0x8a31('0x68'),_0x392d26[_0x8a31('0x60')]['id'],_0x392d26['user'][_0x8a31('0x34')],_0x392d26[_0x8a31('0x60')]['role'],_0x2a3ac1[_0x8a31('0x67')]['id'],_0x392d26[_0x8a31('0x55')]?JSON[_0x8a31('0x69')](_0x392d26[_0x8a31('0x55')]):_0x8a31('0x6a'));return respondWithRpcPromise(_0x8a31('0x6b'),_0x8a31('0x6c'),_0x2a3ac1);}return null;})[_0x8a31('0x31')](function(_0x9bd1f2){var _0x11f0fe=_0x8a31('0x6d')+_0x9bd1f2[_0x8a31('0x21')][_0x8a31('0x6e')];return db[_0x8a31('0x6f')][_0x8a31('0x3c')](_0x11f0fe,{'type':db['Sequelize'][_0x8a31('0x70')][_0x8a31('0x71')],'raw':!![]})[_0x8a31('0x31')](function(_0x52d7bd){return _0x52d7bd;});})[_0x8a31('0x31')](function(_0x596275){if(_0x596275){_0x2a3ac1[_0x8a31('0x21')][_0x8a31('0x72')]=_0x596275[0x0];if(!_0x392d26[_0x8a31('0x55')][_0x8a31('0x5f')])return;return db[_0x8a31('0x73')]['find']({'where':{'id':_0x392d26['body'][_0x8a31('0x5f')],'role':_0x8a31('0x61')},'attributes':['id',_0x8a31('0x34'),'fullname',_0x8a31('0x74'),_0x8a31('0x75')],'raw':!![]});}return null;})[_0x8a31('0x31')](function(_0xac1f9b){if(!_0xac1f9b)return null;_0x2a3ac1[_0x8a31('0x21')][_0x8a31('0x61')]=_0xac1f9b;return _0x2a3ac1;})[_0x8a31('0x31')](function(_0x49598d){if(_0x49598d){if(_0x392d26[_0x8a31('0x55')][_0x8a31('0x76')]){_0x2a3ac1[_0x8a31('0x21')][_0x8a31('0x77')]=util[_0x8a31('0x5d')](_0x8a31('0x78'),_0x392d26[_0x8a31('0x60')][_0x8a31('0x34')]);_0x2a3ac1[_0x8a31('0x21')][_0x8a31('0x79')]=_0x2a3ac1['channel'];_0x2a3ac1[_0x8a31('0x21')]['motionChannel']=_0x2a3ac1[_0x8a31('0x79')];_0x2a3ac1[_0x8a31('0x21')][_0x8a31('0x7a')]=_0x8a31('0x5a');return respondWithRpcPromise(_0x8a31('0x7b'),'EventManager',{'event':_0x8a31('0x7c'),'message':_[_0x8a31('0x49')](_0x2a3ac1[_0x8a31('0x21')],JSON[_0x8a31('0x7d')](_0x2a3ac1['interaction']['formData']))},client9002)[_0x8a31('0x31')](function(){return _0x2a3ac1;});}return _0x2a3ac1;}return null;})[_0x8a31('0x31')](respondWithResult(_0x8813ab,null))[_0x8a31('0x24')](handleError(_0x8813ab,null));};var interaction_log=require(_0x8a31('0x58'))(_0x8a31('0x59'));exports[_0x8a31('0x2e')]=function(_0x1c1027,_0x593409,_0x340cd3){var _0x3ca6a7={'agent':{},'channel':_0x8a31('0x5b')};if(_0x1c1027['body']['id']){delete _0x1c1027[_0x8a31('0x55')]['id'];}_0x1c1027['body'][_0x8a31('0x5f')]=_0x1c1027[_0x8a31('0x55')][_0x8a31('0x5f')]||_0x1c1027['user']['id'];_0x3ca6a7[_0x8a31('0x61')]['id']=_0x1c1027['body']['UserId'];return db[_0x8a31('0x37')][_0x8a31('0x53')]({'where':{'id':_0x1c1027[_0x8a31('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x593409,null))[_0x8a31('0x31')](function(_0x1de5bc){if(_0x1de5bc){_0x3ca6a7[_0x8a31('0x21')]=_0x1de5bc[_0x8a31('0x62')]({'plain':!![]});return db[_0x8a31('0x63')][_0x8a31('0x53')]({'where':{'id':_0x1de5bc[_0x8a31('0x64')]}});}return null;})[_0x8a31('0x31')](handleEntityNotFound(_0x593409,null))['then'](function(_0x7abb79){if(_0x7abb79){_0x3ca6a7[_0x8a31('0x67')]=_0x7abb79[_0x8a31('0x62')]({'plain':!![]});interaction_log[_0x8a31('0x22')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1c1027[_0x8a31('0x60')]['id'],_0x1c1027['user'][_0x8a31('0x34')],_0x1c1027['user'][_0x8a31('0x7e')],_0x3ca6a7['interaction']['id'],_0x1c1027['body']?JSON[_0x8a31('0x69')](_0x1c1027['body']):_0x8a31('0x6a'));return respondWithRpcPromise(_0x8a31('0x7f'),_0x8a31('0x80'),_0x3ca6a7);}return null;})['then'](function(_0x9c952c){var _0x597aea=_0x8a31('0x6d')+_0x9c952c['message'][_0x8a31('0x6e')];return db['sequelize']['query'](_0x597aea,{'type':db[_0x8a31('0x81')][_0x8a31('0x70')][_0x8a31('0x71')],'raw':!![]})[_0x8a31('0x31')](function(_0xd07d75){return _0xd07d75;});})['then'](function(_0x453666){if(_0x453666){_0x3ca6a7[_0x8a31('0x21')][_0x8a31('0x72')]=_0x453666[0x0];if(!_0x1c1027[_0x8a31('0x55')][_0x8a31('0x5f')])return;return db[_0x8a31('0x73')][_0x8a31('0x53')]({'where':{'id':_0x1c1027[_0x8a31('0x55')][_0x8a31('0x5f')],'role':_0x8a31('0x61')},'attributes':['id',_0x8a31('0x34'),'fullname','email',_0x8a31('0x75')],'raw':!![]});}return null;})[_0x8a31('0x31')](function(_0x47ba3a){if(!_0x47ba3a)return null;_0x3ca6a7['message']['agent']=_0x47ba3a;return _0x3ca6a7;})[_0x8a31('0x31')](function(_0x5f9402){if(_0x5f9402){_0x5f9402[_0x8a31('0x21')][_0x8a31('0x77')]=util[_0x8a31('0x5d')](_0x8a31('0x78'),_0x1c1027[_0x8a31('0x60')][_0x8a31('0x34')]);_0x5f9402['message']['channel']=_0x3ca6a7[_0x8a31('0x79')];_0x5f9402[_0x8a31('0x21')][_0x8a31('0x82')]=_0x3ca6a7['channel'];_0x5f9402[_0x8a31('0x21')]['event']=_0x8a31('0x2e');respondWithRpcPromise(_0x8a31('0x7b'),_0x8a31('0x7b'),{'event':'rejectmessage','message':_[_0x8a31('0x49')](_0x3ca6a7[_0x8a31('0x21')],JSON[_0x8a31('0x7d')](_0x3ca6a7[_0x8a31('0x67')]['formData']))},client9002);return _0x3ca6a7;}return null;})[_0x8a31('0x31')](respondWithResult(_0x593409,null))[_0x8a31('0x24')](handleError(_0x593409,null));};
\ No newline at end of file
+var _0x4be2=['stack','name','send','index','map','rawAttributes','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','options','ChatMessage','includeAll','include','findAll','rows','show','params','keys','length','merge','find','create','body','describe','chat-interactions','accept','readAt','user','agent','ChatInteraction','ChatInteractionId','UserId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','email','internal','manual','format','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','chat','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','contact','interface','rejectmessage','parse','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','redis','./chatMessage.socket','register','jayson/promise','client','request','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','end','limit','undefined','count','offset','Content-Range','json','reject','save','update','then','destroy'];(function(_0x616fb8,_0x177e11){var _0x739e20=function(_0xfe27e9){while(--_0xfe27e9){_0x616fb8['push'](_0x616fb8['shift']());}};_0x739e20(++_0x177e11);}(_0x4be2,0xcb));var _0x24be=function(_0x99ba67,_0x10eae9){_0x99ba67=_0x99ba67-0x0;var _0x5c4f7d=_0x4be2[_0x99ba67];return _0x5c4f7d;};'use strict';var emlformat=require(_0x24be('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x24be('0x1'));var jsonpatch=require(_0x24be('0x2'));var rp=require(_0x24be('0x3'));var moment=require('moment');var BPromise=require(_0x24be('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x24be('0x5'));var sox=require(_0x24be('0x6'));var csv=require(_0x24be('0x7'));var ejs=require(_0x24be('0x8'));var fs=require('fs');var fs_extra=require(_0x24be('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x24be('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x24be('0x7'));var querystring=require(_0x24be('0xb'));var Papa=require('papaparse');var Redis=require(_0x24be('0xc'));var authService=require(_0x24be('0xd'));var qs=require(_0x24be('0xe'));var as=require(_0x24be('0xf'));var hardwareService=require(_0x24be('0x10'));var logger=require(_0x24be('0x11'))('api');var utils=require(_0x24be('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x24be('0x13')]=_['defaults'](config[_0x24be('0x13')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x24be('0x13')]));require(_0x24be('0x14'))[_0x24be('0x15')](socket);var jayson=require(_0x24be('0x16'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x24be('0x17')]['http']({'port':0x232a});function respondWithRpcPromise(_0x76e93e,_0x29754b,_0x46200a,_0x5e8bd1){return new BPromise(function(_0x44ad4b,_0x539221){var _0x566a3f=_0x5e8bd1||client;return _0x566a3f[_0x24be('0x18')](_0x76e93e,_0x46200a)['then'](function(_0x1f1a16){logger[_0x24be('0x19')](_0x24be('0x1a'),_0x29754b,'request\x20sent');logger['debug'](_0x24be('0x1b'),_0x29754b,_0x24be('0x1c'),JSON[_0x24be('0x1d')](_0x1f1a16));if(_0x1f1a16['error']){if(_0x1f1a16[_0x24be('0x1e')]['code']===0x1f4){logger[_0x24be('0x1e')](_0x24be('0x1a'),_0x29754b,_0x1f1a16[_0x24be('0x1e')][_0x24be('0x1f')]);return _0x539221(_0x1f1a16[_0x24be('0x1e')][_0x24be('0x1f')]);}logger[_0x24be('0x1e')](_0x24be('0x1a'),_0x29754b,_0x1f1a16[_0x24be('0x1e')]['message']);return _0x44ad4b(_0x1f1a16[_0x24be('0x1e')][_0x24be('0x1f')]);}else{logger['info'](_0x24be('0x1a'),_0x29754b,'request\x20sent');_0x44ad4b(_0x1f1a16[_0x24be('0x20')][_0x24be('0x1f')]);}})[_0x24be('0x21')](function(_0x1c293e){logger[_0x24be('0x1e')](_0x24be('0x1a'),_0x29754b,_0x1c293e);_0x539221(_0x1c293e);});});}function respondWithStatusCode(_0x2a6cfc,_0x15e2d3){_0x15e2d3=_0x15e2d3||0xcc;return function(_0x2f68c7){if(_0x2f68c7){return _0x2a6cfc['sendStatus'](_0x15e2d3);}return _0x2a6cfc[_0x24be('0x22')](_0x15e2d3)[_0x24be('0x23')]();};}function respondWithResult(_0x13c47d,_0x363036){_0x363036=_0x363036||0xc8;return function(_0x145850){if(_0x145850){return _0x13c47d[_0x24be('0x22')](_0x363036)['json'](_0x145850);}};}function respondWithFilteredResult(_0x3c3cf3,_0x3e339b){return function(_0x1e4848){if(_0x1e4848){var _0x37cf58=typeof _0x3e339b['offset']==='undefined'&&typeof _0x3e339b[_0x24be('0x24')]===_0x24be('0x25');var _0x5a07c0=_0x1e4848[_0x24be('0x26')];var _0x4578ca=_0x37cf58?0x0:_0x3e339b[_0x24be('0x27')];var _0x527343=_0x37cf58?_0x1e4848['count']:_0x3e339b['offset']+_0x3e339b['limit'];var _0x2f197c;if(_0x527343>=_0x5a07c0){_0x527343=_0x5a07c0;_0x2f197c=0xc8;}else{_0x2f197c=0xce;}_0x3c3cf3[_0x24be('0x22')](_0x2f197c);return _0x3c3cf3['set'](_0x24be('0x28'),_0x4578ca+'-'+_0x527343+'/'+_0x5a07c0)[_0x24be('0x29')](_0x1e4848);}return null;};}function patchUpdates(_0x2667d4){return function(_0x3bb674){try{jsonpatch['apply'](_0x3bb674,_0x2667d4,!![]);}catch(_0xb2fc1){return BPromise[_0x24be('0x2a')](_0xb2fc1);}return _0x3bb674[_0x24be('0x2b')]();};}function saveUpdates(_0x44bca9,_0x243519){return function(_0xf8f7a){if(_0xf8f7a){return _0xf8f7a[_0x24be('0x2c')](_0x44bca9)[_0x24be('0x2d')](function(_0x1fd5e1){return _0x1fd5e1;});}return null;};}function removeEntity(_0x55c025,_0x85a07){return function(_0x2d50fa){if(_0x2d50fa){return _0x2d50fa[_0x24be('0x2e')]()[_0x24be('0x2d')](function(){_0x55c025['status'](0xcc)[_0x24be('0x23')]();});}};}function handleEntityNotFound(_0x280a57,_0x1f6eb4){return function(_0x4f265b){if(!_0x4f265b){_0x280a57['sendStatus'](0x194);}return _0x4f265b;};}function handleError(_0x18d2a9,_0x19f7e6){_0x19f7e6=_0x19f7e6||0x1f4;return function(_0x4d49d5){logger[_0x24be('0x1e')](_0x4d49d5[_0x24be('0x2f')]);if(_0x4d49d5[_0x24be('0x30')]){delete _0x4d49d5[_0x24be('0x30')];}_0x18d2a9[_0x24be('0x22')](_0x19f7e6)[_0x24be('0x31')](_0x4d49d5);};}exports[_0x24be('0x32')]=function(_0x6b53ab,_0xe9b722){var _0x267018={},_0x5c968e={},_0x5202a0={'count':0x0,'rows':[]};var _0x9d2c7e=_[_0x24be('0x33')](db['ChatMessage'][_0x24be('0x34')],function(_0xdff40a){return{'name':_0xdff40a['fieldName'],'type':_0xdff40a['type'][_0x24be('0x35')]};});_0x5c968e[_0x24be('0x36')]=_[_0x24be('0x33')](_0x9d2c7e,_0x24be('0x30'));_0x5c968e[_0x24be('0x37')]=_['keys'](_0x6b53ab[_0x24be('0x37')]);_0x5c968e[_0x24be('0x38')]=_['intersection'](_0x5c968e[_0x24be('0x36')],_0x5c968e[_0x24be('0x37')]);_0x267018[_0x24be('0x39')]=_[_0x24be('0x3a')](_0x5c968e[_0x24be('0x36')],qs[_0x24be('0x3b')](_0x6b53ab[_0x24be('0x37')][_0x24be('0x3b')]));_0x267018['attributes']=_0x267018[_0x24be('0x39')]['length']?_0x267018[_0x24be('0x39')]:_0x5c968e[_0x24be('0x36')];if(!_0x6b53ab['query'][_0x24be('0x3c')](_0x24be('0x3d'))){_0x267018['limit']=qs[_0x24be('0x24')](_0x6b53ab['query'][_0x24be('0x24')]);_0x267018[_0x24be('0x27')]=qs[_0x24be('0x27')](_0x6b53ab['query'][_0x24be('0x27')]);}_0x267018['order']=qs['sort'](_0x6b53ab['query'][_0x24be('0x3e')]);_0x267018[_0x24be('0x3f')]=qs[_0x24be('0x38')](_[_0x24be('0x40')](_0x6b53ab['query'],_0x5c968e[_0x24be('0x38')]),_0x9d2c7e);if(_0x6b53ab[_0x24be('0x37')][_0x24be('0x41')]){_0x267018[_0x24be('0x3f')]=_['merge'](_0x267018[_0x24be('0x3f')],{'$or':_[_0x24be('0x33')](_0x9d2c7e,function(_0x5f110c){if(_0x5f110c[_0x24be('0x42')]!==_0x24be('0x43')){var _0x47a104={};_0x47a104[_0x5f110c[_0x24be('0x30')]]={'$like':'%'+_0x6b53ab[_0x24be('0x37')][_0x24be('0x41')]+'%'};return _0x47a104;}})});}_0x267018=_['merge']({},_0x267018,_0x6b53ab[_0x24be('0x44')]);var _0x5c2243={'where':_0x267018[_0x24be('0x3f')]};return db[_0x24be('0x45')]['count'](_0x5c2243)['then'](function(_0x1f6fc5){_0x5202a0[_0x24be('0x26')]=_0x1f6fc5;if(_0x6b53ab[_0x24be('0x37')][_0x24be('0x46')]){_0x267018[_0x24be('0x47')]=[{'all':!![]}];}return db[_0x24be('0x45')][_0x24be('0x48')](_0x267018);})[_0x24be('0x2d')](function(_0x2e075b){_0x5202a0[_0x24be('0x49')]=_0x2e075b;return _0x5202a0;})[_0x24be('0x2d')](respondWithFilteredResult(_0xe9b722,_0x267018))[_0x24be('0x21')](handleError(_0xe9b722,null));};exports[_0x24be('0x4a')]=function(_0x48afa4,_0x54a00c){var _0x4df4ca={'raw':!![],'where':{'id':_0x48afa4[_0x24be('0x4b')]['id']}},_0x14e672={};_0x14e672[_0x24be('0x36')]=_[_0x24be('0x4c')](db[_0x24be('0x45')][_0x24be('0x34')]);_0x14e672[_0x24be('0x37')]=_[_0x24be('0x4c')](_0x48afa4['query']);_0x14e672['filters']=_[_0x24be('0x3a')](_0x14e672[_0x24be('0x36')],_0x14e672['query']);_0x4df4ca['attributes']=_[_0x24be('0x3a')](_0x14e672[_0x24be('0x36')],qs['fields'](_0x48afa4['query']['fields']));_0x4df4ca[_0x24be('0x39')]=_0x4df4ca[_0x24be('0x39')][_0x24be('0x4d')]?_0x4df4ca['attributes']:_0x14e672[_0x24be('0x36')];if(_0x48afa4[_0x24be('0x37')][_0x24be('0x46')]){_0x4df4ca[_0x24be('0x47')]=[{'all':!![]}];}_0x4df4ca=_[_0x24be('0x4e')]({},_0x4df4ca,_0x48afa4[_0x24be('0x44')]);return db[_0x24be('0x45')][_0x24be('0x4f')](_0x4df4ca)[_0x24be('0x2d')](handleEntityNotFound(_0x54a00c,null))[_0x24be('0x2d')](respondWithResult(_0x54a00c,null))[_0x24be('0x21')](handleError(_0x54a00c,null));};exports[_0x24be('0x50')]=function(_0x560ba1,_0x40839d){return db[_0x24be('0x45')]['create'](_0x560ba1[_0x24be('0x51')],{})['then'](respondWithResult(_0x40839d,0xc9))[_0x24be('0x21')](handleError(_0x40839d,null));};exports[_0x24be('0x2c')]=function(_0x35793d,_0x5249aa){if(_0x35793d[_0x24be('0x51')]['id']){delete _0x35793d['body']['id'];}return db[_0x24be('0x45')][_0x24be('0x4f')]({'where':{'id':_0x35793d[_0x24be('0x4b')]['id']}})[_0x24be('0x2d')](handleEntityNotFound(_0x5249aa,null))[_0x24be('0x2d')](saveUpdates(_0x35793d[_0x24be('0x51')],null))[_0x24be('0x2d')](respondWithResult(_0x5249aa,null))[_0x24be('0x21')](handleError(_0x5249aa,null));};exports[_0x24be('0x2e')]=function(_0x585a9b,_0x505024){return db[_0x24be('0x45')][_0x24be('0x4f')]({'where':{'id':_0x585a9b[_0x24be('0x4b')]['id']}})['then'](handleEntityNotFound(_0x505024,null))[_0x24be('0x2d')](removeEntity(_0x505024,null))[_0x24be('0x21')](handleError(_0x505024,null));};exports[_0x24be('0x52')]=function(_0x51b446,_0x56cd22){return db[_0x24be('0x45')][_0x24be('0x52')]()['then'](respondWithResult(_0x56cd22,null))[_0x24be('0x21')](handleError(_0x56cd22,null));};var interaction_log=require(_0x24be('0x11'))(_0x24be('0x53'));exports[_0x24be('0x54')]=function(_0x1946ca,_0x4303a5,_0x49d50b){var _0x2a88df={'agent':{},'channel':'chat'};if(_0x1946ca['body']['id']){delete _0x1946ca[_0x24be('0x51')]['id'];}_0x1946ca[_0x24be('0x51')]['read']=!![];_0x1946ca[_0x24be('0x51')][_0x24be('0x55')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1946ca[_0x24be('0x51')]['UserId']=_0x1946ca[_0x24be('0x51')]['UserId']||_0x1946ca[_0x24be('0x56')]['id'];_0x2a88df[_0x24be('0x57')]['id']=_0x1946ca[_0x24be('0x51')]['UserId'];return db[_0x24be('0x45')][_0x24be('0x4f')]({'where':{'id':_0x1946ca['params']['id'],'UserId':null}})[_0x24be('0x2d')](handleEntityNotFound(_0x4303a5,null))[_0x24be('0x2d')](saveUpdates(_0x1946ca[_0x24be('0x51')],null))[_0x24be('0x2d')](function(_0x4cd8e7){if(_0x4cd8e7){_0x2a88df[_0x24be('0x1f')]=_0x4cd8e7['get']({'plain':!![]});return db[_0x24be('0x58')][_0x24be('0x4f')]({'where':{'id':_0x4cd8e7[_0x24be('0x59')]}});}return null;})['then'](handleEntityNotFound(_0x4303a5,null))[_0x24be('0x2d')](function(_0x2ae3a3){if(_0x2ae3a3){return _0x2ae3a3['update']({'UserId':_0x1946ca[_0x24be('0x51')][_0x24be('0x5a')],'read1stAt':_[_0x24be('0x5b')](_0x2ae3a3[_0x24be('0x5c')])?moment()['format'](_0x24be('0x5d')):undefined});}return null;})[_0x24be('0x2d')](function(_0x495e6b){if(_0x495e6b){_0x2a88df[_0x24be('0x5e')]=_0x495e6b['get']({'plain':!![]});interaction_log[_0x24be('0x19')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1946ca['user']['id'],_0x1946ca['user'][_0x24be('0x30')],_0x1946ca[_0x24be('0x56')][_0x24be('0x5f')],_0x2a88df[_0x24be('0x5e')]['id'],_0x1946ca['body']?JSON['stringify'](_0x1946ca['body']):_0x24be('0x60'));return respondWithRpcPromise(_0x24be('0x61'),_0x24be('0x62'),_0x2a88df);}return null;})[_0x24be('0x2d')](function(_0x2c49dc){var _0x42dd28=_0x24be('0x63')+_0x2c49dc[_0x24be('0x1f')][_0x24be('0x64')];return db[_0x24be('0x65')][_0x24be('0x37')](_0x42dd28,{'type':db[_0x24be('0x66')][_0x24be('0x67')][_0x24be('0x68')],'raw':!![]})['then'](function(_0x4eeaea){return _0x4eeaea;});})[_0x24be('0x2d')](function(_0x3b1db0){if(_0x3b1db0){_0x2a88df[_0x24be('0x1f')]['contact']=_0x3b1db0[0x0];if(!_0x1946ca['body']['UserId'])return;return db[_0x24be('0x69')][_0x24be('0x4f')]({'where':{'id':_0x1946ca[_0x24be('0x51')][_0x24be('0x5a')],'role':'agent'},'attributes':['id',_0x24be('0x30'),'fullname',_0x24be('0x6a'),_0x24be('0x6b')],'raw':!![]});}return null;})['then'](function(_0x1534a9){if(!_0x1534a9)return null;_0x2a88df['message'][_0x24be('0x57')]=_0x1534a9;return _0x2a88df;})['then'](function(_0x1a9fb5){if(_0x1a9fb5){if(_0x1946ca[_0x24be('0x51')][_0x24be('0x6c')]){_0x2a88df['message']['interface']=util[_0x24be('0x6d')](_0x24be('0x6e'),_0x1946ca[_0x24be('0x56')]['name']);_0x2a88df[_0x24be('0x1f')][_0x24be('0x6f')]=_0x2a88df[_0x24be('0x6f')];_0x2a88df['message'][_0x24be('0x70')]=_0x2a88df['channel'];_0x2a88df[_0x24be('0x1f')][_0x24be('0x71')]='accept';return respondWithRpcPromise('EventManager',_0x24be('0x72'),{'event':_0x24be('0x73'),'message':_[_0x24be('0x4e')](_0x2a88df[_0x24be('0x1f')],JSON['parse'](_0x2a88df[_0x24be('0x5e')][_0x24be('0x74')]))},client9002)[_0x24be('0x2d')](function(){return _0x2a88df;});}return _0x2a88df;}return null;})[_0x24be('0x2d')](respondWithResult(_0x4303a5,null))[_0x24be('0x21')](handleError(_0x4303a5,null));};var interaction_log=require('../../config/logger')(_0x24be('0x53'));exports[_0x24be('0x2a')]=function(_0x43c557,_0x695c17,_0x192bfc){var _0x18705d={'agent':{},'channel':_0x24be('0x75')};if(_0x43c557[_0x24be('0x51')]['id']){delete _0x43c557[_0x24be('0x51')]['id'];}_0x43c557[_0x24be('0x51')][_0x24be('0x5a')]=_0x43c557[_0x24be('0x51')][_0x24be('0x5a')]||_0x43c557[_0x24be('0x56')]['id'];_0x18705d['agent']['id']=_0x43c557[_0x24be('0x51')][_0x24be('0x5a')];return db['ChatMessage'][_0x24be('0x4f')]({'where':{'id':_0x43c557['params']['id'],'UserId':null}})[_0x24be('0x2d')](handleEntityNotFound(_0x695c17,null))[_0x24be('0x2d')](function(_0x310cfa){if(_0x310cfa){_0x18705d[_0x24be('0x1f')]=_0x310cfa[_0x24be('0x76')]({'plain':!![]});return db[_0x24be('0x58')][_0x24be('0x4f')]({'where':{'id':_0x310cfa[_0x24be('0x59')]}});}return null;})[_0x24be('0x2d')](handleEntityNotFound(_0x695c17,null))[_0x24be('0x2d')](function(_0x22098a){if(_0x22098a){_0x18705d[_0x24be('0x5e')]=_0x22098a['get']({'plain':!![]});interaction_log[_0x24be('0x19')](_0x24be('0x77'),_0x43c557['user']['id'],_0x43c557[_0x24be('0x56')][_0x24be('0x30')],_0x43c557[_0x24be('0x56')][_0x24be('0x5f')],_0x18705d['interaction']['id'],_0x43c557['body']?JSON[_0x24be('0x1d')](_0x43c557['body']):_0x24be('0x60'));return respondWithRpcPromise(_0x24be('0x78'),'rejectMessage',_0x18705d);}return null;})['then'](function(_0x555129){var _0x13f288='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x555129[_0x24be('0x1f')][_0x24be('0x64')];return db[_0x24be('0x65')][_0x24be('0x37')](_0x13f288,{'type':db[_0x24be('0x66')][_0x24be('0x67')][_0x24be('0x68')],'raw':!![]})[_0x24be('0x2d')](function(_0x353ace){return _0x353ace;});})[_0x24be('0x2d')](function(_0x3541e7){if(_0x3541e7){_0x18705d[_0x24be('0x1f')][_0x24be('0x79')]=_0x3541e7[0x0];if(!_0x43c557['body'][_0x24be('0x5a')])return;return db[_0x24be('0x69')][_0x24be('0x4f')]({'where':{'id':_0x43c557[_0x24be('0x51')][_0x24be('0x5a')],'role':_0x24be('0x57')},'attributes':['id','name','fullname',_0x24be('0x6a'),_0x24be('0x6b')],'raw':!![]});}return null;})['then'](function(_0x521e86){if(!_0x521e86)return null;_0x18705d['message'][_0x24be('0x57')]=_0x521e86;return _0x18705d;})['then'](function(_0x3f0ba1){if(_0x3f0ba1){_0x3f0ba1[_0x24be('0x1f')][_0x24be('0x7a')]=util[_0x24be('0x6d')]('SIP/%s',_0x43c557['user']['name']);_0x3f0ba1[_0x24be('0x1f')][_0x24be('0x6f')]=_0x18705d['channel'];_0x3f0ba1[_0x24be('0x1f')][_0x24be('0x70')]=_0x18705d[_0x24be('0x6f')];_0x3f0ba1['message'][_0x24be('0x71')]='reject';respondWithRpcPromise(_0x24be('0x72'),_0x24be('0x72'),{'event':_0x24be('0x7b'),'message':_[_0x24be('0x4e')](_0x18705d[_0x24be('0x1f')],JSON[_0x24be('0x7c')](_0x18705d[_0x24be('0x5e')]['formData']))},client9002);return _0x18705d;}return null;})[_0x24be('0x2d')](respondWithResult(_0x695c17,null))['catch'](handleError(_0x695c17,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 9c431ad..ea5e6fb 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 _0x6ea3=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x24c5df,_0x36adbc){var _0x374082=function(_0x332441){while(--_0x332441){_0x24c5df['push'](_0x24c5df['shift']());}};_0x374082(++_0x36adbc);}(_0x6ea3,0x1c9));var _0x36ea=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x6ea3[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x36ea('0x0'));var ChatMessage=require(_0x36ea('0x1'))['db'][_0x36ea('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x36ea('0x3')](0x0);var events={'afterCreate':_0x36ea('0x4'),'afterUpdate':_0x36ea('0x5'),'afterDestroy':_0x36ea('0x6')};function emitEvent(_0x2b9ccb){return function(_0x734803,_0x2cb540,_0x4d154e){ChatMessageEvents[_0x36ea('0x7')](_0x2b9ccb+':'+_0x734803['id'],_0x734803);ChatMessageEvents[_0x36ea('0x7')](_0x2b9ccb,_0x734803);_0x4d154e(null);};}for(var e in events){if(events[_0x36ea('0x8')](e)){var event=events[e];ChatMessage[_0x36ea('0x9')](e,emitEvent(event));}}module[_0x36ea('0xa')]=ChatMessageEvents;
\ No newline at end of file
+var _0x5587=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x54f2a6,_0x1b5b42){var _0x7d84c1=function(_0x9b1ebc){while(--_0x9b1ebc){_0x54f2a6['push'](_0x54f2a6['shift']());}};_0x7d84c1(++_0x1b5b42);}(_0x5587,0x77));var _0x7558=function(_0x55c746,_0x1485c0){_0x55c746=_0x55c746-0x0;var _0x847901=_0x5587[_0x55c746];return _0x847901;};'use strict';var EventEmitter=require(_0x7558('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7558('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7558('0x2'),'afterDestroy':_0x7558('0x3')};function emitEvent(_0x29678d){return function(_0x1cffd2,_0xb1ee0,_0x16bf49){ChatMessageEvents[_0x7558('0x4')](_0x29678d+':'+_0x1cffd2['id'],_0x1cffd2);ChatMessageEvents['emit'](_0x29678d,_0x1cffd2);_0x16bf49(null);};}for(var e in events){if(events[_0x7558('0x5')](e)){var event=events[e];ChatMessage[_0x7558('0x6')](e,emitEvent(event));}}module[_0x7558('0x7')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 970628b..0d59da3 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 _0x17da=['request-promise','path','../../config/environment','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x10b95c,_0x134f5a){var _0x53fbf8=function(_0x5cc266){while(--_0x5cc266){_0x10b95c['push'](_0x10b95c['shift']());}};_0x53fbf8(++_0x134f5a);}(_0x17da,0x167));var _0xa17d=function(_0x8d3fdb,_0x35f605){_0x8d3fdb=_0x8d3fdb-0x0;var _0x42d81a=_0x17da[_0x8d3fdb];return _0x42d81a;};'use strict';var _=require(_0xa17d('0x0'));var util=require('util');var logger=require(_0xa17d('0x1'))(_0xa17d('0x2'));var moment=require(_0xa17d('0x3'));var BPromise=require(_0xa17d('0x4'));var rp=require(_0xa17d('0x5'));var fs=require('fs');var path=require(_0xa17d('0x6'));var rimraf=require('rimraf');var config=require(_0xa17d('0x7'));var attributes=require('./chatMessage.attributes');module[_0xa17d('0x8')]=function(_0x25ce5b,_0x34d2da){return _0x25ce5b['define'](_0xa17d('0x9'),attributes,{'tableName':_0xa17d('0xa'),'paranoid':![],'indexes':[{'name':_0xa17d('0xb'),'fields':[_0xa17d('0xc')],'type':_0xa17d('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x326298,_0x4b130f,_0x9c1c55){var _0x57584d=_0x25ce5b[_0xa17d('0xe')];var _0x5d5bc8=_0x326298['get']({'plain':!![]});if(_0x5d5bc8[_0xa17d('0xf')][_0xa17d('0x10')]()==='in'||_0x5d5bc8['direction']['toLowerCase']()===_0xa17d('0x11')&&!_0x5d5bc8[_0xa17d('0x12')]&&!_['isNil'](_0x5d5bc8[_0xa17d('0x13')])){_0x57584d[_0xa17d('0x14')][_0xa17d('0x15')]({'where':{'id':_0x5d5bc8[_0xa17d('0x16')]}})[_0xa17d('0x17')](function(_0x5d68b4){if(_0x5d68b4){_0x5d68b4[_0xa17d('0x18')]({'lastMsgAt':_0x5d5bc8[_0xa17d('0x19')],'lastMsgDirection':_0x5d5bc8[_0xa17d('0xf')][_0xa17d('0x10')]()});}})['catch'](function(_0x567530){console['error'](_0x567530);});}_0x9c1c55();}},'charset':_0xa17d('0x1a'),'collate':_0xa17d('0x1b')});};
\ No newline at end of file
+var _0x1b4e=['out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase'];(function(_0x3ebfe1,_0x3dfa31){var _0xe262c3=function(_0x20a9eb){while(--_0x20a9eb){_0x3ebfe1['push'](_0x3ebfe1['shift']());}};_0xe262c3(++_0x3dfa31);}(_0x1b4e,0x1ad));var _0xe1b4=function(_0x59e7fe,_0x226bec){_0x59e7fe=_0x59e7fe-0x0;var _0x23aed0=_0x1b4e[_0x59e7fe];return _0x23aed0;};'use strict';var _=require(_0xe1b4('0x0'));var util=require(_0xe1b4('0x1'));var logger=require(_0xe1b4('0x2'))(_0xe1b4('0x3'));var moment=require(_0xe1b4('0x4'));var BPromise=require('bluebird');var rp=require(_0xe1b4('0x5'));var fs=require('fs');var path=require(_0xe1b4('0x6'));var rimraf=require(_0xe1b4('0x7'));var config=require(_0xe1b4('0x8'));var attributes=require(_0xe1b4('0x9'));module[_0xe1b4('0xa')]=function(_0x46bafd,_0x2449be){return _0x46bafd['define'](_0xe1b4('0xb'),attributes,{'tableName':_0xe1b4('0xc'),'paranoid':![],'indexes':[{'name':_0xe1b4('0xd'),'fields':['body'],'type':_0xe1b4('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5917a8,_0x37154f,_0x4f6e41){var _0x4ca172=_0x46bafd[_0xe1b4('0xf')];var _0x42e616=_0x5917a8[_0xe1b4('0x10')]({'plain':!![]});if(_0x42e616[_0xe1b4('0x11')][_0xe1b4('0x12')]()==='in'||_0x42e616[_0xe1b4('0x11')][_0xe1b4('0x12')]()===_0xe1b4('0x13')&&!_0x42e616[_0xe1b4('0x14')]&&!_[_0xe1b4('0x15')](_0x42e616[_0xe1b4('0x16')])){_0x4ca172[_0xe1b4('0x17')][_0xe1b4('0x18')]({'where':{'id':_0x42e616[_0xe1b4('0x19')]}})[_0xe1b4('0x1a')](function(_0x4079df){if(_0x4079df){_0x4079df[_0xe1b4('0x1b')]({'lastMsgAt':_0x42e616[_0xe1b4('0x1c')],'lastMsgDirection':_0x42e616[_0xe1b4('0x11')][_0xe1b4('0x12')]()});}})[_0xe1b4('0x1d')](function(_0x605ed3){console['error'](_0x605ed3);});}_0x4f6e41();}},'charset':_0xe1b4('0x1e'),'collate':_0xe1b4('0x1f')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 895bc72..b729711 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 _0x7937=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','error','ChatMessage,\x20%s,\x20%s','message','catch','CreateChatMessage','ChatMessage','create','body','options','raw','stringify','lodash','util','moment'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x7937,0x81));var _0x7793=function(_0x30853f,_0x4aa320){_0x30853f=_0x30853f-0x0;var _0x3c416d=_0x7937[_0x30853f];return _0x3c416d;};'use strict';var _=require(_0x7793('0x0'));var util=require(_0x7793('0x1'));var moment=require(_0x7793('0x2'));var BPromise=require(_0x7793('0x3'));var rs=require(_0x7793('0x4'));var fs=require('fs');var Redis=require(_0x7793('0x5'));var db=require(_0x7793('0x6'))['db'];var utils=require(_0x7793('0x7'));var logger=require(_0x7793('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7793('0x9'));var client=jayson[_0x7793('0xa')][_0x7793('0xb')]({'port':0x232a});config[_0x7793('0xc')]=_[_0x7793('0xd')](config[_0x7793('0xc')],{'host':_0x7793('0xe'),'port':0x18eb});var socket=require(_0x7793('0xf'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x7793('0x10')](socket);function respondWithRpcPromise(_0x5e236d,_0x2801bd,_0x5451f7){return new BPromise(function(_0x4f74ea,_0x2bddf2){return client[_0x7793('0x11')](_0x5e236d,_0x5451f7)[_0x7793('0x12')](function(_0x2dc2d8){logger[_0x7793('0x13')]('ChatMessage,\x20%s,\x20%s',_0x2801bd,_0x7793('0x14'));logger[_0x7793('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2801bd,'request\x20sent',JSON['stringify'](_0x2dc2d8));if(_0x2dc2d8['error']){if(_0x2dc2d8[_0x7793('0x16')]['code']===0x1f4){logger[_0x7793('0x16')](_0x7793('0x17'),_0x2801bd,_0x2dc2d8[_0x7793('0x16')]['message']);return _0x2bddf2(_0x2dc2d8[_0x7793('0x16')][_0x7793('0x18')]);}logger[_0x7793('0x16')](_0x7793('0x17'),_0x2801bd,_0x2dc2d8[_0x7793('0x16')]['message']);return _0x4f74ea(_0x2dc2d8[_0x7793('0x16')]['message']);}else{logger[_0x7793('0x13')](_0x7793('0x17'),_0x2801bd,_0x7793('0x14'));_0x4f74ea(_0x2dc2d8['result'][_0x7793('0x18')]);}})[_0x7793('0x19')](function(_0xbd5808){logger[_0x7793('0x16')](_0x7793('0x17'),_0x2801bd,_0xbd5808);_0x2bddf2(_0xbd5808);});});}exports[_0x7793('0x1a')]=function(_0x4ad07a){var _0x179f67=this;return new Promise(function(_0x115410,_0x1a856f){return db[_0x7793('0x1b')][_0x7793('0x1c')](_0x4ad07a[_0x7793('0x1d')],{'raw':_0x4ad07a[_0x7793('0x1e')]?_0x4ad07a[_0x7793('0x1e')][_0x7793('0x1f')]===undefined?!![]:![]:!![]})[_0x7793('0x12')](function(_0x2b4781){logger['info'](_0x7793('0x1a'),_0x4ad07a);logger[_0x7793('0x15')]('CreateChatMessage',_0x4ad07a,JSON[_0x7793('0x20')](_0x2b4781));_0x115410(_0x2b4781);})[_0x7793('0x19')](function(_0x45b3f7){logger['error']('CreateChatMessage',_0x45b3f7['message'],_0x4ad07a);_0x1a856f(_0x179f67[_0x7793('0x16')](0x1f4,_0x45b3f7['message']));});});};
\ No newline at end of file
+var _0xc52c=['body','options','raw','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','register','then','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatMessage,\x20%s,\x20%s','message','CreateChatMessage','create'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0xc52c,0x144));var _0xcc52=function(_0x5e848d,_0x1dbd20){_0x5e848d=_0x5e848d-0x0;var _0x3785e5=_0xc52c[_0x5e848d];return _0x3785e5;};'use strict';var _=require(_0xcc52('0x0'));var util=require(_0xcc52('0x1'));var moment=require(_0xcc52('0x2'));var BPromise=require(_0xcc52('0x3'));var rs=require(_0xcc52('0x4'));var fs=require('fs');var Redis=require(_0xcc52('0x5'));var db=require(_0xcc52('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcc52('0x7'));var config=require(_0xcc52('0x8'));var jayson=require(_0xcc52('0x9'));var client=jayson['client'][_0xcc52('0xa')]({'port':0x232a});config[_0xcc52('0xb')]=_[_0xcc52('0xc')](config[_0xcc52('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')[_0xcc52('0xd')](socket);function respondWithRpcPromise(_0x463999,_0x139154,_0xc44204){return new BPromise(function(_0x38bf62,_0x4242b7){return client['request'](_0x463999,_0xc44204)[_0xcc52('0xe')](function(_0x1af4dd){logger['info']('ChatMessage,\x20%s,\x20%s',_0x139154,'request\x20sent');logger[_0xcc52('0xf')](_0xcc52('0x10'),_0x139154,_0xcc52('0x11'),JSON[_0xcc52('0x12')](_0x1af4dd));if(_0x1af4dd[_0xcc52('0x13')]){if(_0x1af4dd['error']['code']===0x1f4){logger[_0xcc52('0x13')](_0xcc52('0x14'),_0x139154,_0x1af4dd[_0xcc52('0x13')][_0xcc52('0x15')]);return _0x4242b7(_0x1af4dd[_0xcc52('0x13')]['message']);}logger[_0xcc52('0x13')](_0xcc52('0x14'),_0x139154,_0x1af4dd['error'][_0xcc52('0x15')]);return _0x38bf62(_0x1af4dd[_0xcc52('0x13')]['message']);}else{logger['info'](_0xcc52('0x14'),_0x139154,_0xcc52('0x11'));_0x38bf62(_0x1af4dd['result'][_0xcc52('0x15')]);}})['catch'](function(_0x4015ed){logger[_0xcc52('0x13')](_0xcc52('0x14'),_0x139154,_0x4015ed);_0x4242b7(_0x4015ed);});});}exports[_0xcc52('0x16')]=function(_0x1072c6){var _0x40ea65=this;return new Promise(function(_0x1c3206,_0x2805e5){return db['ChatMessage'][_0xcc52('0x17')](_0x1072c6[_0xcc52('0x18')],{'raw':_0x1072c6[_0xcc52('0x19')]?_0x1072c6[_0xcc52('0x19')][_0xcc52('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x30c328){logger[_0xcc52('0x1b')](_0xcc52('0x16'),_0x1072c6);logger[_0xcc52('0xf')]('CreateChatMessage',_0x1072c6,JSON[_0xcc52('0x12')](_0x30c328));_0x1c3206(_0x30c328);})[_0xcc52('0x1c')](function(_0x425d76){logger['error']('CreateChatMessage',_0x425d76[_0xcc52('0x15')],_0x1072c6);_0x2805e5(_0x40ea65[_0xcc52('0x13')](0x1f4,_0x425d76[_0xcc52('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 0e1fea7..223743a 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 _0x3435=['length','chatMessage:','./chatMessage.events','save','remove','update','emit','register'];(function(_0x2896e3,_0x23ed8e){var _0x5e551f=function(_0x2a28f4){while(--_0x2a28f4){_0x2896e3['push'](_0x2896e3['shift']());}};_0x5e551f(++_0x23ed8e);}(_0x3435,0xfa));var _0x5343=function(_0x35af23,_0x9190f6){_0x35af23=_0x35af23-0x0;var _0x340506=_0x3435[_0x35af23];return _0x340506;};'use strict';var ChatMessageEvents=require(_0x5343('0x0'));var events=[_0x5343('0x1'),_0x5343('0x2'),_0x5343('0x3')];function createListener(_0x14c416,_0x2a91fe){return function(_0x597aa9){_0x2a91fe[_0x5343('0x4')](_0x14c416,_0x597aa9);};}function removeListener(_0x3ae07e,_0x578a24){return function(){ChatMessageEvents['removeListener'](_0x3ae07e,_0x578a24);};}exports[_0x5343('0x5')]=function(_0x28f0f3){for(var _0x4d26b5=0x0,_0x544b29=events[_0x5343('0x6')];_0x4d26b5<_0x544b29;_0x4d26b5++){var _0x1e1911=events[_0x4d26b5];var _0x9ea9b6=createListener(_0x5343('0x7')+_0x1e1911,_0x28f0f3);ChatMessageEvents['on'](_0x1e1911,_0x9ea9b6);}};
\ No newline at end of file
+var _0x42b0=['register','length','./chatMessage.events','save','update','removeListener'];(function(_0x254dcb,_0x515b3f){var _0x4be1d9=function(_0x4a517c){while(--_0x4a517c){_0x254dcb['push'](_0x254dcb['shift']());}};_0x4be1d9(++_0x515b3f);}(_0x42b0,0xbc));var _0x042b=function(_0x591781,_0x8e0ed2){_0x591781=_0x591781-0x0;var _0x315bd9=_0x42b0[_0x591781];return _0x315bd9;};'use strict';var ChatMessageEvents=require(_0x042b('0x0'));var events=[_0x042b('0x1'),'remove',_0x042b('0x2')];function createListener(_0x4bf494,_0x1d7aa3){return function(_0x5a7e27){_0x1d7aa3['emit'](_0x4bf494,_0x5a7e27);};}function removeListener(_0x401a0c,_0xd73d53){return function(){ChatMessageEvents[_0x042b('0x3')](_0x401a0c,_0xd73d53);};}exports[_0x042b('0x4')]=function(_0x135bc1){for(var _0x5d194a=0x0,_0x51c41c=events[_0x042b('0x5')];_0x5d194a<_0x51c41c;_0x5d194a++){var _0x1ec28f=events[_0x5d194a];var _0x49ab70=createListener('chatMessage:'+_0x1ec28f,_0x135bc1);ChatMessageEvents['on'](_0x1ec28f,_0x49ab70);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index cb45009..88c993e 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 _0x2ce9=['chatmessage:create','create','/:id','/:id/accept','accept','put','/:id/reject','reject','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','tracked'];(function(_0x189e73,_0x452b70){var _0x21d62c=function(_0x5d4089){while(--_0x5d4089){_0x189e73['push'](_0x189e73['shift']());}};_0x21d62c(++_0x452b70);}(_0x2ce9,0x76));var _0x92ce=function(_0x2b5b44,_0x17189c){_0x2b5b44=_0x2b5b44-0x0;var _0x32cb66=_0x2ce9[_0x2b5b44];return _0x32cb66;};'use strict';var multer=require('multer');var util=require(_0x92ce('0x0'));var path=require(_0x92ce('0x1'));var timeout=require(_0x92ce('0x2'));var express=require(_0x92ce('0x3'));var router=express['Router']();var fs_extra=require(_0x92ce('0x4'));var auth=require(_0x92ce('0x5'));var interaction=require(_0x92ce('0x6'));var config=require(_0x92ce('0x7'));var controller=require(_0x92ce('0x8'));router[_0x92ce('0x9')]('/',auth[_0x92ce('0xa')](),controller[_0x92ce('0xb')]);router['get'](_0x92ce('0xc'),auth[_0x92ce('0xa')](),controller[_0x92ce('0xd')]);router[_0x92ce('0x9')]('/:id',auth[_0x92ce('0xa')](),controller[_0x92ce('0xe')]);router[_0x92ce('0xf')]('/',auth[_0x92ce('0xa')](),interaction[_0x92ce('0x10')]('chat',_0x92ce('0x11')),controller[_0x92ce('0x12')]);router['put'](_0x92ce('0x13'),controller['update']);router['put'](_0x92ce('0x14'),auth[_0x92ce('0xa')](),controller[_0x92ce('0x15')]);router[_0x92ce('0x16')](_0x92ce('0x17'),auth[_0x92ce('0xa')](),controller[_0x92ce('0x18')]);router['delete'](_0x92ce('0x13'),auth['isAuthenticated'](),controller[_0x92ce('0x19')]);module[_0x92ce('0x1a')]=router;
\ No newline at end of file
+var _0xf347=['/describe','describe','/:id','isAuthenticated','show','post','tracked','chat','chatmessage:create','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0xc5cb1a,_0x1f590e){var _0x253df7=function(_0x3f1543){while(--_0x3f1543){_0xc5cb1a['push'](_0xc5cb1a['shift']());}};_0x253df7(++_0x1f590e);}(_0xf347,0x1b5));var _0x7f34=function(_0x5bc2a2,_0xec487e){_0x5bc2a2=_0x5bc2a2-0x0;var _0xe9294e=_0xf347[_0x5bc2a2];return _0xe9294e;};'use strict';var multer=require(_0x7f34('0x0'));var util=require(_0x7f34('0x1'));var path=require(_0x7f34('0x2'));var timeout=require(_0x7f34('0x3'));var express=require('express');var router=express[_0x7f34('0x4')]();var fs_extra=require(_0x7f34('0x5'));var auth=require(_0x7f34('0x6'));var interaction=require(_0x7f34('0x7'));var config=require(_0x7f34('0x8'));var controller=require('./chatMessage.controller');router[_0x7f34('0x9')]('/',auth['isAuthenticated'](),controller[_0x7f34('0xa')]);router[_0x7f34('0x9')](_0x7f34('0xb'),auth['isAuthenticated'](),controller[_0x7f34('0xc')]);router[_0x7f34('0x9')](_0x7f34('0xd'),auth[_0x7f34('0xe')](),controller[_0x7f34('0xf')]);router[_0x7f34('0x10')]('/',auth[_0x7f34('0xe')](),interaction[_0x7f34('0x11')](_0x7f34('0x12'),_0x7f34('0x13')),controller['create']);router['put']('/:id',controller[_0x7f34('0x14')]);router[_0x7f34('0x15')](_0x7f34('0x16'),auth[_0x7f34('0xe')](),controller[_0x7f34('0x17')]);router[_0x7f34('0x15')](_0x7f34('0x18'),auth[_0x7f34('0xe')](),controller[_0x7f34('0x19')]);router[_0x7f34('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x7f34('0x1b')]);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 aa5dba6..bac3849 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['medium','sequelize','TEXT'];(function(_0x463bc8,_0x135367){var _0x441a37=function(_0xbb4c5a){while(--_0xbb4c5a){_0x463bc8['push'](_0x463bc8['shift']());}};_0x441a37(++_0x135367);}(_0xb10b,0x12a));var _0xbb10=function(_0x768458,_0x3d0933){_0x768458=_0x768458-0x0;var _0x31385c=_0xb10b[_0x768458];return _0x31385c;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0x5f66=['medium','TEXT','exports'];(function(_0x1e6f5c,_0x40cf58){var _0x29c2b8=function(_0x4cba9f){while(--_0x4cba9f){_0x1e6f5c['push'](_0x1e6f5c['shift']());}};_0x29c2b8(++_0x40cf58);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'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 3c580bd..a9dfde9 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(_0x38e863,_0x4d104f){var _0x59693c=function(_0xf1e9e2){while(--_0xf1e9e2){_0x38e863['push'](_0x38e863['shift']());}};_0x59693c(++_0x4d104f);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x7a54,0x106));var _0x47a5=function(_0x5481b1,_0x4e1ff5){_0x5481b1=_0x5481b1-0x0;var _0x2b43a7=_0x7a54[_0x5481b1];return _0x2b43a7;};'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 8b0bc8e..1a36f3d 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 _0x31b9=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x440ad4,_0x3c4f8f){var _0x16ce8c=function(_0x4fab87){while(--_0x4fab87){_0x440ad4['push'](_0x440ad4['shift']());}};_0x16ce8c(++_0x3c4f8f);}(_0x31b9,0x151));var _0x931b=function(_0x2190d6,_0x12d5a2){_0x2190d6=_0x2190d6-0x0;var _0x31514b=_0x31b9[_0x2190d6];return _0x31514b;};'use strict';var EventEmitter=require(_0x931b('0x0'));var ChatOfflineMessage=require(_0x931b('0x1'))['db'][_0x931b('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x931b('0x3')](0x0);var events={'afterCreate':_0x931b('0x4'),'afterUpdate':_0x931b('0x5'),'afterDestroy':_0x931b('0x6')};function emitEvent(_0x450c01){return function(_0x566a05,_0x4861ce,_0x20bd00){ChatOfflineMessageEvents[_0x931b('0x7')](_0x450c01+':'+_0x566a05['id'],_0x566a05);ChatOfflineMessageEvents[_0x931b('0x7')](_0x450c01,_0x566a05);_0x20bd00(null);};}for(var e in events){if(events[_0x931b('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x931b('0x9')](e,emitEvent(event));}}module[_0x931b('0xa')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xe8f9=['ChatOfflineMessage','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x5cd473,_0x267cdb){var _0x1ed98c=function(_0x555522){while(--_0x555522){_0x5cd473['push'](_0x5cd473['shift']());}};_0x1ed98c(++_0x267cdb);}(_0xe8f9,0x103));var _0x9e8f=function(_0x5955e1,_0x452f50){_0x5955e1=_0x5955e1-0x0;var _0x2ec7d1=_0xe8f9[_0x5955e1];return _0x2ec7d1;};'use strict';var EventEmitter=require(_0x9e8f('0x0'));var ChatOfflineMessage=require(_0x9e8f('0x1'))['db'][_0x9e8f('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9e8f('0x3'),'afterUpdate':_0x9e8f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x33c493){return function(_0x5768dc,_0x4fa050,_0x5d20fe){ChatOfflineMessageEvents[_0x9e8f('0x5')](_0x33c493+':'+_0x5768dc['id'],_0x5768dc);ChatOfflineMessageEvents[_0x9e8f('0x5')](_0x33c493,_0x5768dc);_0x5d20fe(null);};}for(var e in events){if(events[_0x9e8f('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x9e8f('0x7')](e,emitEvent(event));}}module[_0x9e8f('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 0724b17..3da8c76 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 _0x31ea=['chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','define','ChatOfflineMessage'];(function(_0x4d9403,_0x33c5f0){var _0x5eef11=function(_0x50bb5c){while(--_0x50bb5c){_0x4d9403['push'](_0x4d9403['shift']());}};_0x5eef11(++_0x33c5f0);}(_0x31ea,0xb1));var _0xa31e=function(_0x330da3,_0x485558){_0x330da3=_0x330da3-0x0;var _0x2d2863=_0x31ea[_0x330da3];return _0x2d2863;};'use strict';var attributes=require(_0xa31e('0x0'));module['exports']=function(_0x287b20){return _0x287b20[_0xa31e('0x1')](_0xa31e('0x2'),attributes,{'tableName':_0xa31e('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa31e('0x4'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x55d0=['exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x43c2dd,_0xc6bcc9){var _0x432de4=function(_0x379e1a){while(--_0x379e1a){_0x43c2dd['push'](_0x43c2dd['shift']());}};_0x432de4(++_0xc6bcc9);}(_0x55d0,0xfb));var _0x055d=function(_0x11d684,_0x4d4123){_0x11d684=_0x11d684-0x0;var _0x78a301=_0x55d0[_0x11d684];return _0x78a301;};'use strict';var attributes=require(_0x055d('0x0'));module[_0x055d('0x1')]=function(_0x1083b9){return _0x1083b9['define'](_0x055d('0x2'),attributes,{'tableName':_0x055d('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x055d('0x4'),'collate':_0x055d('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index ffeaede..c802005 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 _0xb016=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x306d94,_0x46ed19){var _0x3e0a16=function(_0x4ea686){while(--_0x4ea686){_0x306d94['push'](_0x306d94['shift']());}};_0x3e0a16(++_0x46ed19);}(_0xb016,0x129));var _0x6b01=function(_0x410c11,_0x279873){_0x410c11=_0x410c11-0x0;var _0x3957a7=_0xb016[_0x410c11];return _0x3957a7;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var moment=require(_0x6b01('0x2'));var BPromise=require(_0x6b01('0x3'));var rs=require(_0x6b01('0x4'));var fs=require('fs');var Redis=require(_0x6b01('0x5'));var db=require(_0x6b01('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6b01('0x7'))(_0x6b01('0x8'));var config=require(_0x6b01('0x9'));var jayson=require(_0x6b01('0xa'));var client=jayson[_0x6b01('0xb')][_0x6b01('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4069a6,_0x596508,_0x398a77){return new BPromise(function(_0x37875c,_0x5115b0){return client[_0x6b01('0xd')](_0x4069a6,_0x398a77)[_0x6b01('0xe')](function(_0x53db4f){logger['info'](_0x6b01('0xf'),_0x596508,_0x6b01('0x10'));logger['debug'](_0x6b01('0x11'),_0x596508,_0x6b01('0x10'),JSON[_0x6b01('0x12')](_0x53db4f));if(_0x53db4f[_0x6b01('0x13')]){if(_0x53db4f[_0x6b01('0x13')][_0x6b01('0x14')]===0x1f4){logger[_0x6b01('0x13')](_0x6b01('0xf'),_0x596508,_0x53db4f[_0x6b01('0x13')]['message']);return _0x5115b0(_0x53db4f['error'][_0x6b01('0x15')]);}logger[_0x6b01('0x13')](_0x6b01('0xf'),_0x596508,_0x53db4f[_0x6b01('0x13')][_0x6b01('0x15')]);return _0x37875c(_0x53db4f[_0x6b01('0x13')][_0x6b01('0x15')]);}else{logger['info'](_0x6b01('0xf'),_0x596508,_0x6b01('0x10'));_0x37875c(_0x53db4f[_0x6b01('0x16')][_0x6b01('0x15')]);}})['catch'](function(_0x33f51b){logger[_0x6b01('0x13')](_0x6b01('0xf'),_0x596508,_0x33f51b);_0x5115b0(_0x33f51b);});});}
\ No newline at end of file
+var _0x87e6=['stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x67f67d,_0x2a0d8a){var _0x2c1653=function(_0x28a2fe){while(--_0x28a2fe){_0x67f67d['push'](_0x67f67d['shift']());}};_0x2c1653(++_0x2a0d8a);}(_0x87e6,0x1a3));var _0x687e=function(_0xc191df,_0x4a58a2){_0xc191df=_0xc191df-0x0;var _0x383022=_0x87e6[_0xc191df];return _0x383022;};'use strict';var _=require(_0x687e('0x0'));var util=require(_0x687e('0x1'));var moment=require(_0x687e('0x2'));var BPromise=require(_0x687e('0x3'));var rs=require(_0x687e('0x4'));var fs=require('fs');var Redis=require(_0x687e('0x5'));var db=require(_0x687e('0x6'))['db'];var utils=require(_0x687e('0x7'));var logger=require(_0x687e('0x8'))(_0x687e('0x9'));var config=require('../../config/environment');var jayson=require(_0x687e('0xa'));var client=jayson[_0x687e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d5eec,_0xf19ed2,_0x2b50f0){return new BPromise(function(_0x2f074a,_0x7cf8cb){return client[_0x687e('0xc')](_0x4d5eec,_0x2b50f0)[_0x687e('0xd')](function(_0x61b4c3){logger[_0x687e('0xe')](_0x687e('0xf'),_0xf19ed2,_0x687e('0x10'));logger['debug'](_0x687e('0x11'),_0xf19ed2,_0x687e('0x10'),JSON[_0x687e('0x12')](_0x61b4c3));if(_0x61b4c3[_0x687e('0x13')]){if(_0x61b4c3['error'][_0x687e('0x14')]===0x1f4){logger[_0x687e('0x13')](_0x687e('0xf'),_0xf19ed2,_0x61b4c3[_0x687e('0x13')][_0x687e('0x15')]);return _0x7cf8cb(_0x61b4c3[_0x687e('0x13')]['message']);}logger['error'](_0x687e('0xf'),_0xf19ed2,_0x61b4c3['error']['message']);return _0x2f074a(_0x61b4c3[_0x687e('0x13')][_0x687e('0x15')]);}else{logger[_0x687e('0xe')](_0x687e('0xf'),_0xf19ed2,_0x687e('0x10'));_0x2f074a(_0x61b4c3['result'][_0x687e('0x15')]);}})[_0x687e('0x16')](function(_0x445942){logger[_0x687e('0x13')](_0x687e('0xf'),_0xf19ed2,_0x445942);_0x7cf8cb(_0x445942);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 1a7ee8a..edbb0d3 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 _0xcee9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','destroy','multer','util','Router','fs-extra'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xcee9,0x183));var _0x9cee=function(_0x2cc1d5,_0x3446f5){_0x2cc1d5=_0x2cc1d5-0x0;var _0x2be77f=_0xcee9[_0x2cc1d5];return _0x2be77f;};'use strict';var multer=require(_0x9cee('0x0'));var util=require(_0x9cee('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9cee('0x2')]();var fs_extra=require(_0x9cee('0x3'));var auth=require(_0x9cee('0x4'));var interaction=require(_0x9cee('0x5'));var config=require(_0x9cee('0x6'));var controller=require(_0x9cee('0x7'));router[_0x9cee('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9cee('0x8')](_0x9cee('0x9'),auth[_0x9cee('0xa')](),controller['describe']);router[_0x9cee('0x8')](_0x9cee('0xb'),auth['isAuthenticated'](),controller[_0x9cee('0xc')]);router[_0x9cee('0xd')]('/',auth[_0x9cee('0xa')](),controller[_0x9cee('0xe')]);router[_0x9cee('0xf')](_0x9cee('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x9cee('0xb'),auth[_0x9cee('0xa')](),controller[_0x9cee('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x665d=['isAuthenticated','index','/describe','describe','/:id','create','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get'];(function(_0x305766,_0x4ed775){var _0x1d6353=function(_0x414f3c){while(--_0x414f3c){_0x305766['push'](_0x305766['shift']());}};_0x1d6353(++_0x4ed775);}(_0x665d,0xe4));var _0xd665=function(_0x1a1d9b,_0x5ea65a){_0x1a1d9b=_0x1a1d9b-0x0;var _0x1d7a59=_0x665d[_0x1a1d9b];return _0x1d7a59;};'use strict';var multer=require(_0xd665('0x0'));var util=require(_0xd665('0x1'));var path=require(_0xd665('0x2'));var timeout=require(_0xd665('0x3'));var express=require(_0xd665('0x4'));var router=express[_0xd665('0x5')]();var fs_extra=require(_0xd665('0x6'));var auth=require(_0xd665('0x7'));var interaction=require(_0xd665('0x8'));var config=require(_0xd665('0x9'));var controller=require(_0xd665('0xa'));router[_0xd665('0xb')]('/',auth[_0xd665('0xc')](),controller[_0xd665('0xd')]);router[_0xd665('0xb')](_0xd665('0xe'),auth[_0xd665('0xc')](),controller[_0xd665('0xf')]);router[_0xd665('0xb')](_0xd665('0x10'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xd665('0xc')](),controller[_0xd665('0x11')]);router['put'](_0xd665('0x10'),auth[_0xd665('0xc')](),controller['update']);router[_0xd665('0x12')](_0xd665('0x10'),auth[_0xd665('0xc')](),controller['destroy']);module[_0xd665('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 66b9135..0434691 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 _0x07b5=['ENUM','mouseOver','timeout','INTEGER','sequelize','exports','STRING'];(function(_0x4e27ed,_0x49b6cf){var _0x177582=function(_0x415eaf){while(--_0x415eaf){_0x4e27ed['push'](_0x4e27ed['shift']());}};_0x177582(++_0x49b6cf);}(_0x07b5,0x170));var _0x507b=function(_0xe2c95e,_0x3e6545){_0xe2c95e=_0xe2c95e-0x0;var _0x42ce6f=_0x07b5[_0xe2c95e];return _0x42ce6f;};'use strict';var Sequelize=require(_0x507b('0x0'));module[_0x507b('0x1')]={'name':{'type':Sequelize[_0x507b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x507b('0x3')](_0x507b('0x4'),_0x507b('0x5')),'defaultValue':_0x507b('0x4')},'selector':{'type':Sequelize[_0x507b('0x2')]},'timeout':{'type':Sequelize[_0x507b('0x6')]}};
\ No newline at end of file
+var _0x5ad6=['mouseOver','STRING','INTEGER','exports','timeout'];(function(_0x5abcb4,_0x4d9c06){var _0x428f91=function(_0x31a3af){while(--_0x31a3af){_0x5abcb4['push'](_0x5abcb4['shift']());}};_0x428f91(++_0x4d9c06);}(_0x5ad6,0x71));var _0x65ad=function(_0x36f284,_0x24cbd1){_0x36f284=_0x36f284-0x0;var _0x4ea099=_0x5ad6[_0x36f284];return _0x4ea099;};'use strict';var Sequelize=require('sequelize');module[_0x65ad('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0x65ad('0x1')),'defaultValue':_0x65ad('0x2')},'selector':{'type':Sequelize[_0x65ad('0x3')]},'timeout':{'type':Sequelize[_0x65ad('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 90b74f0..d967324 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 _0x7d9f=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','update','then','error','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','fields','attributes','length','includeAll','include','merge','find','catch','create','body'];(function(_0x5d0a3f,_0x147089){var _0x57add7=function(_0x2d8c15){while(--_0x2d8c15){_0x5d0a3f['push'](_0x5d0a3f['shift']());}};_0x57add7(++_0x147089);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x3cc8cb,_0x31f8fe){_0x3cc8cb=_0x3cc8cb-0x0;var _0x427615=_0x7d9f[_0x3cc8cb];return _0x427615;};'use strict';var emlformat=require(_0xf7d9('0x0'));var rimraf=require(_0xf7d9('0x1'));var zipdir=require(_0xf7d9('0x2'));var jsonpatch=require(_0xf7d9('0x3'));var rp=require(_0xf7d9('0x4'));var moment=require('moment');var BPromise=require(_0xf7d9('0x5'));var Mustache=require(_0xf7d9('0x6'));var util=require(_0xf7d9('0x7'));var path=require(_0xf7d9('0x8'));var sox=require(_0xf7d9('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf7d9('0xa'));var _=require(_0xf7d9('0xb'));var squel=require('squel');var crypto=require(_0xf7d9('0xc'));var jsforce=require(_0xf7d9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf7d9('0xe'));var querystring=require('querystring');var Papa=require(_0xf7d9('0xf'));var Redis=require(_0xf7d9('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf7d9('0x11'));var hardwareService=require(_0xf7d9('0x12'));var logger=require(_0xf7d9('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf7d9('0x14'));var licenseUtil=require(_0xf7d9('0x15'));var db=require(_0xf7d9('0x16'))['db'];function respondWithStatusCode(_0x35e156,_0x594dfe){_0x594dfe=_0x594dfe||0xcc;return function(_0x16e680){if(_0x16e680){return _0x35e156[_0xf7d9('0x17')](_0x594dfe);}return _0x35e156[_0xf7d9('0x18')](_0x594dfe)[_0xf7d9('0x19')]();};}function respondWithResult(_0x49f766,_0x189c82){_0x189c82=_0x189c82||0xc8;return function(_0x359843){if(_0x359843){return _0x49f766[_0xf7d9('0x18')](_0x189c82)[_0xf7d9('0x1a')](_0x359843);}};}function respondWithFilteredResult(_0x5d3029,_0x405ed4){return function(_0x22ed4a){if(_0x22ed4a){var _0x341e27=typeof _0x405ed4['offset']==='undefined'&&typeof _0x405ed4[_0xf7d9('0x1b')]===_0xf7d9('0x1c');var _0xe29103=_0x22ed4a['count'];var _0x44ebd3=_0x341e27?0x0:_0x405ed4[_0xf7d9('0x1d')];var _0x5eb7c9=_0x341e27?_0x22ed4a[_0xf7d9('0x1e')]:_0x405ed4['offset']+_0x405ed4[_0xf7d9('0x1b')];var _0x1bbc77;if(_0x5eb7c9>=_0xe29103){_0x5eb7c9=_0xe29103;_0x1bbc77=0xc8;}else{_0x1bbc77=0xce;}_0x5d3029['status'](_0x1bbc77);return _0x5d3029[_0xf7d9('0x1f')](_0xf7d9('0x20'),_0x44ebd3+'-'+_0x5eb7c9+'/'+_0xe29103)[_0xf7d9('0x1a')](_0x22ed4a);}return null;};}function patchUpdates(_0x316d54){return function(_0x165160){try{jsonpatch[_0xf7d9('0x21')](_0x165160,_0x316d54,!![]);}catch(_0xd04b9d){return BPromise[_0xf7d9('0x22')](_0xd04b9d);}return _0x165160['save']();};}function saveUpdates(_0x5e96df,_0x36b974){return function(_0x4cfe93){if(_0x4cfe93){return _0x4cfe93[_0xf7d9('0x23')](_0x5e96df)[_0xf7d9('0x24')](function(_0x574b12){return _0x574b12;});}return null;};}function removeEntity(_0x8d8e48,_0x27ba8c){return function(_0x514ffa){if(_0x514ffa){return _0x514ffa['destroy']()[_0xf7d9('0x24')](function(){_0x8d8e48[_0xf7d9('0x18')](0xcc)[_0xf7d9('0x19')]();});}};}function handleEntityNotFound(_0x595556,_0x3c0b91){return function(_0x496ab7){if(!_0x496ab7){_0x595556[_0xf7d9('0x17')](0x194);}return _0x496ab7;};}function handleError(_0x3b3ea5,_0x144ae2){_0x144ae2=_0x144ae2||0x1f4;return function(_0x5b1ea5){logger[_0xf7d9('0x25')](_0x5b1ea5[_0xf7d9('0x26')]);if(_0x5b1ea5[_0xf7d9('0x27')]){delete _0x5b1ea5[_0xf7d9('0x27')];}_0x3b3ea5[_0xf7d9('0x18')](_0x144ae2)['send'](_0x5b1ea5);};}exports[_0xf7d9('0x28')]=function(_0x3847ff,_0x2b5f17){var _0x2c04c3={'raw':!![],'where':{'id':_0x3847ff[_0xf7d9('0x29')]['id']}},_0x508b00={};_0x508b00[_0xf7d9('0x2a')]=_[_0xf7d9('0x2b')](db[_0xf7d9('0x2c')][_0xf7d9('0x2d')]);_0x508b00[_0xf7d9('0x2e')]=_['keys'](_0x3847ff['query']);_0x508b00['filters']=_[_0xf7d9('0x2f')](_0x508b00['model'],_0x508b00[_0xf7d9('0x2e')]);_0x2c04c3['attributes']=_[_0xf7d9('0x2f')](_0x508b00['model'],qs['fields'](_0x3847ff['query'][_0xf7d9('0x30')]));_0x2c04c3['attributes']=_0x2c04c3[_0xf7d9('0x31')][_0xf7d9('0x32')]?_0x2c04c3[_0xf7d9('0x31')]:_0x508b00[_0xf7d9('0x2a')];if(_0x3847ff[_0xf7d9('0x2e')][_0xf7d9('0x33')]){_0x2c04c3[_0xf7d9('0x34')]=[{'all':!![]}];}_0x2c04c3=_[_0xf7d9('0x35')]({},_0x2c04c3,_0x3847ff['options']);return db[_0xf7d9('0x2c')][_0xf7d9('0x36')](_0x2c04c3)['then'](handleEntityNotFound(_0x2b5f17,null))['then'](respondWithResult(_0x2b5f17,null))[_0xf7d9('0x37')](handleError(_0x2b5f17,null));};exports[_0xf7d9('0x38')]=function(_0x4110ce,_0x5301a8){return db[_0xf7d9('0x2c')][_0xf7d9('0x38')](_0x4110ce[_0xf7d9('0x39')],{})[_0xf7d9('0x24')](respondWithResult(_0x5301a8,0xc9))[_0xf7d9('0x37')](handleError(_0x5301a8,null));};exports[_0xf7d9('0x23')]=function(_0x427963,_0x1280fa){if(_0x427963[_0xf7d9('0x39')]['id']){delete _0x427963[_0xf7d9('0x39')]['id'];}return db[_0xf7d9('0x2c')]['find']({'where':{'id':_0x427963[_0xf7d9('0x29')]['id']}})['then'](handleEntityNotFound(_0x1280fa,null))[_0xf7d9('0x24')](saveUpdates(_0x427963[_0xf7d9('0x39')],null))[_0xf7d9('0x24')](respondWithResult(_0x1280fa,null))[_0xf7d9('0x37')](handleError(_0x1280fa,null));};exports['destroy']=function(_0x55b49d,_0x2173e2){return db['ChatProactiveAction'][_0xf7d9('0x36')]({'where':{'id':_0x55b49d[_0xf7d9('0x29')]['id']}})[_0xf7d9('0x24')](handleEntityNotFound(_0x2173e2,null))[_0xf7d9('0x24')](removeEntity(_0x2173e2,null))['catch'](handleError(_0x2173e2,null));};
\ No newline at end of file
+var _0xac31=['filters','intersection','attributes','fields','length','include','merge','options','then','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query'];(function(_0x3c3e72,_0x3e1858){var _0x48a7e5=function(_0x3d1c72){while(--_0x3d1c72){_0x3c3e72['push'](_0x3c3e72['shift']());}};_0x48a7e5(++_0x3e1858);}(_0xac31,0xca));var _0x1ac3=function(_0x484a13,_0x49bbb4){_0x484a13=_0x484a13-0x0;var _0x5ad030=_0xac31[_0x484a13];return _0x5ad030;};'use strict';var emlformat=require(_0x1ac3('0x0'));var rimraf=require(_0x1ac3('0x1'));var zipdir=require(_0x1ac3('0x2'));var jsonpatch=require(_0x1ac3('0x3'));var rp=require(_0x1ac3('0x4'));var moment=require(_0x1ac3('0x5'));var BPromise=require(_0x1ac3('0x6'));var Mustache=require('mustache');var util=require(_0x1ac3('0x7'));var path=require(_0x1ac3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1ac3('0x9'));var fs=require('fs');var fs_extra=require(_0x1ac3('0xa'));var _=require(_0x1ac3('0xb'));var squel=require(_0x1ac3('0xc'));var crypto=require(_0x1ac3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1ac3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1ac3('0xf'));var Papa=require(_0x1ac3('0x10'));var Redis=require(_0x1ac3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1ac3('0x12'));var as=require(_0x1ac3('0x13'));var hardwareService=require(_0x1ac3('0x14'));var logger=require(_0x1ac3('0x15'))(_0x1ac3('0x16'));var utils=require(_0x1ac3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1ac3('0x18'));var db=require(_0x1ac3('0x19'))['db'];function respondWithStatusCode(_0x2eeabf,_0x2338b9){_0x2338b9=_0x2338b9||0xcc;return function(_0x50d3b6){if(_0x50d3b6){return _0x2eeabf[_0x1ac3('0x1a')](_0x2338b9);}return _0x2eeabf[_0x1ac3('0x1b')](_0x2338b9)[_0x1ac3('0x1c')]();};}function respondWithResult(_0x2def9f,_0x53cc35){_0x53cc35=_0x53cc35||0xc8;return function(_0x24bb5e){if(_0x24bb5e){return _0x2def9f[_0x1ac3('0x1b')](_0x53cc35)['json'](_0x24bb5e);}};}function respondWithFilteredResult(_0x29a7b3,_0x1f9641){return function(_0x38b52a){if(_0x38b52a){var _0x51f1e4=typeof _0x1f9641[_0x1ac3('0x1d')]===_0x1ac3('0x1e')&&typeof _0x1f9641[_0x1ac3('0x1f')]==='undefined';var _0x195683=_0x38b52a['count'];var _0x291616=_0x51f1e4?0x0:_0x1f9641[_0x1ac3('0x1d')];var _0x20091d=_0x51f1e4?_0x38b52a[_0x1ac3('0x20')]:_0x1f9641[_0x1ac3('0x1d')]+_0x1f9641['limit'];var _0x136e73;if(_0x20091d>=_0x195683){_0x20091d=_0x195683;_0x136e73=0xc8;}else{_0x136e73=0xce;}_0x29a7b3[_0x1ac3('0x1b')](_0x136e73);return _0x29a7b3[_0x1ac3('0x21')](_0x1ac3('0x22'),_0x291616+'-'+_0x20091d+'/'+_0x195683)['json'](_0x38b52a);}return null;};}function patchUpdates(_0x48d18a){return function(_0x2879d8){try{jsonpatch[_0x1ac3('0x23')](_0x2879d8,_0x48d18a,!![]);}catch(_0x14070b){return BPromise[_0x1ac3('0x24')](_0x14070b);}return _0x2879d8[_0x1ac3('0x25')]();};}function saveUpdates(_0x319988,_0x23b767){return function(_0x10912a){if(_0x10912a){return _0x10912a[_0x1ac3('0x26')](_0x319988)['then'](function(_0x1e277f){return _0x1e277f;});}return null;};}function removeEntity(_0x231b7f,_0x4b19f2){return function(_0x2b5182){if(_0x2b5182){return _0x2b5182[_0x1ac3('0x27')]()['then'](function(){_0x231b7f[_0x1ac3('0x1b')](0xcc)[_0x1ac3('0x1c')]();});}};}function handleEntityNotFound(_0x145486,_0x2dfdb7){return function(_0x10db3d){if(!_0x10db3d){_0x145486['sendStatus'](0x194);}return _0x10db3d;};}function handleError(_0x5a2ab2,_0x503a64){_0x503a64=_0x503a64||0x1f4;return function(_0x528807){logger['error'](_0x528807[_0x1ac3('0x28')]);if(_0x528807['name']){delete _0x528807[_0x1ac3('0x29')];}_0x5a2ab2[_0x1ac3('0x1b')](_0x503a64)[_0x1ac3('0x2a')](_0x528807);};}exports[_0x1ac3('0x2b')]=function(_0x4b3d3c,_0x61441d){var _0x541da0={'raw':!![],'where':{'id':_0x4b3d3c[_0x1ac3('0x2c')]['id']}},_0x2ddd73={};_0x2ddd73[_0x1ac3('0x2d')]=_[_0x1ac3('0x2e')](db[_0x1ac3('0x2f')][_0x1ac3('0x30')]);_0x2ddd73[_0x1ac3('0x31')]=_['keys'](_0x4b3d3c[_0x1ac3('0x31')]);_0x2ddd73[_0x1ac3('0x32')]=_[_0x1ac3('0x33')](_0x2ddd73[_0x1ac3('0x2d')],_0x2ddd73['query']);_0x541da0[_0x1ac3('0x34')]=_[_0x1ac3('0x33')](_0x2ddd73[_0x1ac3('0x2d')],qs[_0x1ac3('0x35')](_0x4b3d3c[_0x1ac3('0x31')]['fields']));_0x541da0[_0x1ac3('0x34')]=_0x541da0[_0x1ac3('0x34')][_0x1ac3('0x36')]?_0x541da0[_0x1ac3('0x34')]:_0x2ddd73[_0x1ac3('0x2d')];if(_0x4b3d3c[_0x1ac3('0x31')]['includeAll']){_0x541da0[_0x1ac3('0x37')]=[{'all':!![]}];}_0x541da0=_[_0x1ac3('0x38')]({},_0x541da0,_0x4b3d3c[_0x1ac3('0x39')]);return db[_0x1ac3('0x2f')]['find'](_0x541da0)[_0x1ac3('0x3a')](handleEntityNotFound(_0x61441d,null))[_0x1ac3('0x3a')](respondWithResult(_0x61441d,null))[_0x1ac3('0x3b')](handleError(_0x61441d,null));};exports[_0x1ac3('0x3c')]=function(_0x31a932,_0x170bb8){return db[_0x1ac3('0x2f')][_0x1ac3('0x3c')](_0x31a932[_0x1ac3('0x3d')],{})['then'](respondWithResult(_0x170bb8,0xc9))[_0x1ac3('0x3b')](handleError(_0x170bb8,null));};exports[_0x1ac3('0x26')]=function(_0x4e4a20,_0xc6b21f){if(_0x4e4a20[_0x1ac3('0x3d')]['id']){delete _0x4e4a20[_0x1ac3('0x3d')]['id'];}return db[_0x1ac3('0x2f')][_0x1ac3('0x3e')]({'where':{'id':_0x4e4a20[_0x1ac3('0x2c')]['id']}})[_0x1ac3('0x3a')](handleEntityNotFound(_0xc6b21f,null))[_0x1ac3('0x3a')](saveUpdates(_0x4e4a20['body'],null))[_0x1ac3('0x3a')](respondWithResult(_0xc6b21f,null))['catch'](handleError(_0xc6b21f,null));};exports[_0x1ac3('0x27')]=function(_0x7bba2a,_0x2d449e){return db[_0x1ac3('0x2f')][_0x1ac3('0x3e')]({'where':{'id':_0x7bba2a[_0x1ac3('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2d449e,null))[_0x1ac3('0x3a')](removeEntity(_0x2d449e,null))[_0x1ac3('0x3b')](handleError(_0x2d449e,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index ce384e3..b862974 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 _0x603e=['rimraf','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dee92,_0x55e1eb){var _0x44d36e=function(_0x34de1a){while(--_0x34de1a){_0x3dee92['push'](_0x3dee92['shift']());}};_0x44d36e(++_0x55e1eb);}(_0x603e,0x130));var _0xe603=function(_0x20714a,_0x7de591){_0x20714a=_0x20714a-0x0;var _0x15e877=_0x603e[_0x20714a];return _0x15e877;};'use strict';var _=require(_0xe603('0x0'));var util=require(_0xe603('0x1'));var logger=require(_0xe603('0x2'))(_0xe603('0x3'));var moment=require(_0xe603('0x4'));var BPromise=require(_0xe603('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe603('0x6'));var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module[_0xe603('0x7')]=function(_0x49b951,_0x381a83){return _0x49b951['define'](_0xe603('0x8'),attributes,{'tableName':_0xe603('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6e26=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x6e26,0x107));var _0x66e2=function(_0x40089f,_0x51b8ef){_0x40089f=_0x40089f-0x0;var _0x2a6b80=_0x6e26[_0x40089f];return _0x2a6b80;};'use strict';var _=require(_0x66e2('0x0'));var util=require(_0x66e2('0x1'));var logger=require(_0x66e2('0x2'))(_0x66e2('0x3'));var moment=require(_0x66e2('0x4'));var BPromise=require('bluebird');var rp=require(_0x66e2('0x5'));var fs=require('fs');var path=require(_0x66e2('0x6'));var rimraf=require('rimraf');var config=require(_0x66e2('0x7'));var attributes=require(_0x66e2('0x8'));module['exports']=function(_0x599c96,_0x1e1524){return _0x599c96[_0x66e2('0x9')](_0x66e2('0xa'),attributes,{'tableName':_0x66e2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 16ebc79..0b572de 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 _0xecab=['jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xecab,0x77));var _0xbeca=function(_0x1aa1aa,_0x33b9e8){_0x1aa1aa=_0x1aa1aa-0x0;var _0xd4b78d=_0xecab[_0x1aa1aa];return _0xd4b78d;};'use strict';var _=require(_0xbeca('0x0'));var util=require('util');var moment=require(_0xbeca('0x1'));var BPromise=require(_0xbeca('0x2'));var rs=require(_0xbeca('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbeca('0x4'));var logger=require(_0xbeca('0x5'))(_0xbeca('0x6'));var config=require('../../config/environment');var jayson=require(_0xbeca('0x7'));var client=jayson[_0xbeca('0x8')][_0xbeca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e8771,_0x45e188,_0x204c05){return new BPromise(function(_0x313b71,_0x4f82df){return client[_0xbeca('0xa')](_0x4e8771,_0x204c05)[_0xbeca('0xb')](function(_0x19d9f3){logger['info'](_0xbeca('0xc'),_0x45e188,_0xbeca('0xd'));logger['debug'](_0xbeca('0xe'),_0x45e188,_0xbeca('0xd'),JSON['stringify'](_0x19d9f3));if(_0x19d9f3[_0xbeca('0xf')]){if(_0x19d9f3[_0xbeca('0xf')][_0xbeca('0x10')]===0x1f4){logger[_0xbeca('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x45e188,_0x19d9f3[_0xbeca('0xf')]['message']);return _0x4f82df(_0x19d9f3[_0xbeca('0xf')][_0xbeca('0x11')]);}logger['error'](_0xbeca('0xc'),_0x45e188,_0x19d9f3[_0xbeca('0xf')]['message']);return _0x313b71(_0x19d9f3[_0xbeca('0xf')][_0xbeca('0x11')]);}else{logger[_0xbeca('0x12')](_0xbeca('0xc'),_0x45e188,_0xbeca('0xd'));_0x313b71(_0x19d9f3[_0xbeca('0x13')][_0xbeca('0x11')]);}})[_0xbeca('0x14')](function(_0x187f95){logger[_0xbeca('0xf')](_0xbeca('0xc'),_0x45e188,_0x187f95);_0x4f82df(_0x187f95);});});}
\ No newline at end of file
+var _0x65a8=['client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment'];(function(_0x8bc1c6,_0x37bbc5){var _0xc63cfb=function(_0x3e868a){while(--_0x3e868a){_0x8bc1c6['push'](_0x8bc1c6['shift']());}};_0xc63cfb(++_0x37bbc5);}(_0x65a8,0x19c));var _0x865a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x65a8[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x865a('0x0'));var util=require(_0x865a('0x1'));var moment=require(_0x865a('0x2'));var BPromise=require(_0x865a('0x3'));var rs=require(_0x865a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x865a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x865a('0x6'));var config=require(_0x865a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x865a('0x8')][_0x865a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ae3f4,_0x3cca80,_0x3c3151){return new BPromise(function(_0x40edbe,_0x1e21fe){return client[_0x865a('0xa')](_0x5ae3f4,_0x3c3151)[_0x865a('0xb')](function(_0x4f98c5){logger[_0x865a('0xc')](_0x865a('0xd'),_0x3cca80,'request\x20sent');logger[_0x865a('0xe')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x3cca80,_0x865a('0xf'),JSON['stringify'](_0x4f98c5));if(_0x4f98c5[_0x865a('0x10')]){if(_0x4f98c5[_0x865a('0x10')][_0x865a('0x11')]===0x1f4){logger[_0x865a('0x10')](_0x865a('0xd'),_0x3cca80,_0x4f98c5[_0x865a('0x10')][_0x865a('0x12')]);return _0x1e21fe(_0x4f98c5[_0x865a('0x10')][_0x865a('0x12')]);}logger[_0x865a('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x3cca80,_0x4f98c5['error'][_0x865a('0x12')]);return _0x40edbe(_0x4f98c5[_0x865a('0x10')]['message']);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x3cca80,_0x865a('0xf'));_0x40edbe(_0x4f98c5[_0x865a('0x13')][_0x865a('0x12')]);}})[_0x865a('0x14')](function(_0x183e60){logger[_0x865a('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x3cca80,_0x183e60);_0x1e21fe(_0x183e60);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 1a3ab02..c0ece2c 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 _0xb138=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','destroy','exports','multer','util','path'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xb138,0x1dd));var _0x8b13=function(_0x162810,_0x4dd5aa){_0x162810=_0x162810-0x0;var _0x503762=_0xb138[_0x162810];return _0x503762;};'use strict';var multer=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var timeout=require(_0x8b13('0x3'));var express=require(_0x8b13('0x4'));var router=express[_0x8b13('0x5')]();var fs_extra=require(_0x8b13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var controller=require(_0x8b13('0x9'));router['get'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['show']);router[_0x8b13('0xc')]('/',auth[_0x8b13('0xb')](),controller[_0x8b13('0xd')]);router['put'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['update']);router['delete'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller[_0x8b13('0xe')]);module[_0x8b13('0xf')]=router;
\ No newline at end of file
+var _0xb138=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','destroy','exports','multer','util','path'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xb138,0x1dd));var _0x8b13=function(_0x484b61,_0x55f992){_0x484b61=_0x484b61-0x0;var _0x44a4d4=_0xb138[_0x484b61];return _0x44a4d4;};'use strict';var multer=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var timeout=require(_0x8b13('0x3'));var express=require(_0x8b13('0x4'));var router=express[_0x8b13('0x5')]();var fs_extra=require(_0x8b13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var controller=require(_0x8b13('0x9'));router['get'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['show']);router[_0x8b13('0xc')]('/',auth[_0x8b13('0xb')](),controller[_0x8b13('0xd')]);router['put'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['update']);router['delete'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller[_0x8b13('0xe')]);module[_0x8b13('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 544bcf5..890810b 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 _0xc02d=['exports','STRING','roundrobin'];(function(_0x322515,_0x4e6c82){var _0x55e219=function(_0x4c9cbc){while(--_0x4c9cbc){_0x322515['push'](_0x322515['shift']());}};_0x55e219(++_0x4e6c82);}(_0xc02d,0x7e));var _0xdc02=function(_0x17b0ab,_0x24651d){_0x17b0ab=_0x17b0ab-0x0;var _0x5b8268=_0xc02d[_0x17b0ab];return _0x5b8268;};'use strict';var Sequelize=require('sequelize');module[_0xdc02('0x0')]={'name':{'type':Sequelize[_0xdc02('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdc02('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0xdc02('0x2'))}};
\ No newline at end of file
+var _0x79e7=['ENUM','rrmemory','STRING','INTEGER'];(function(_0x373169,_0x554e5f){var _0x4468e2=function(_0x983ca8){while(--_0x983ca8){_0x373169['push'](_0x373169['shift']());}};_0x4468e2(++_0x554e5f);}(_0x79e7,0x72));var _0x779e=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x79e7[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x779e('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x779e('0x0')]},'timeout':{'type':Sequelize[_0x779e('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x779e('0x2')](_0x779e('0x3'),'beepall','roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index dd47346..8f7b948 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 _0xcbf9=['ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','sequelize','QueryTypes','SELECT','TeamId','includes','all','compact','userChatQueue:remove','addAgents','omit','removeAgents','getAgents','nolimit','util','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','send','index','ChatQueue','fieldName','key','where','include','findAll','catch','model','keys','query','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserChatQueue','rawAttributes','filters','hasOwnProperty','order','sort','pick','ChatQueueId','filter','map','User','findAndCountAll','UserId','agent','chatPause','updatedAt','rows','format','SIP','getTeams','Team','ids','Agents','online','flatMap','transaction','addTeams','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId'];(function(_0xbb6fb5,_0x4db9fb){var _0x2f9501=function(_0x4a9b92){while(--_0x4a9b92){_0xbb6fb5['push'](_0xbb6fb5['shift']());}};_0x2f9501(++_0x4db9fb);}(_0xcbf9,0x16d));var _0x9cbf=function(_0x4e255e,_0x1681c5){_0x4e255e=_0x4e255e-0x0;var _0x88c0aa=_0xcbf9[_0x4e255e];return _0x88c0aa;};'use strict';var BPromise=require('bluebird');var util=require(_0x9cbf('0x0'));var _=require('lodash');var squel=require('squel');var Redis=require(_0x9cbf('0x1'));var qs=require(_0x9cbf('0x2'));var logger=require('../../config/logger')(_0x9cbf('0x3'));var config=require(_0x9cbf('0x4'));var db=require(_0x9cbf('0x5'))['db'];config[_0x9cbf('0x6')]=_['defaults'](config['redis'],{'host':_0x9cbf('0x7'),'port':0x18eb});var socket=require(_0x9cbf('0x8'))(new Redis(config[_0x9cbf('0x6')]));require(_0x9cbf('0x9'))['register'](socket);function respondWithStatusCode(_0x1322ab,_0x115d02){_0x115d02=_0x115d02||0xcc;return function(_0x4cf4df){if(_0x4cf4df){return _0x1322ab[_0x9cbf('0xa')](_0x115d02);}return _0x1322ab[_0x9cbf('0xb')](_0x115d02)[_0x9cbf('0xc')]();};}function respondWithResult(_0x406029,_0x4ddc7c){_0x4ddc7c=_0x4ddc7c||0xc8;return function(_0x2f6a1b){if(_0x2f6a1b){return _0x406029['status'](_0x4ddc7c)[_0x9cbf('0xd')](_0x2f6a1b);}};}function respondWithFilteredResult(_0x5b3bca,_0x4788ae){return function(_0x392ec3){if(_0x392ec3){var _0x5994a1=typeof _0x4788ae[_0x9cbf('0xe')]===_0x9cbf('0xf')&&typeof _0x4788ae[_0x9cbf('0x10')]==='undefined';var _0x262b66=_0x392ec3[_0x9cbf('0x11')];var _0x1d5c60=_0x5994a1?0x0:_0x4788ae['offset'];var _0xa0f05b=_0x5994a1?_0x392ec3[_0x9cbf('0x11')]:_0x4788ae[_0x9cbf('0xe')]+_0x4788ae[_0x9cbf('0x10')];var _0x5ac2fd;if(_0xa0f05b>=_0x262b66){_0xa0f05b=_0x262b66;_0x5ac2fd=0xc8;}else{_0x5ac2fd=0xce;}_0x5b3bca[_0x9cbf('0xb')](_0x5ac2fd);return _0x5b3bca[_0x9cbf('0x12')](_0x9cbf('0x13'),_0x1d5c60+'-'+_0xa0f05b+'/'+_0x262b66)[_0x9cbf('0xd')](_0x392ec3);}return null;};}function saveUpdates(_0xde2291){return function(_0x250863){if(_0x250863){return _0x250863[_0x9cbf('0x14')](_0xde2291)[_0x9cbf('0x15')](function(_0x2fde8b){return _0x2fde8b;});}return null;};}function removeEntity(_0x3f72a4){return function(_0x1e048b){if(_0x1e048b){return _0x1e048b[_0x9cbf('0x16')]()[_0x9cbf('0x15')](function(){var _0x4e5b58=_0x1e048b[_0x9cbf('0x17')]({'plain':!![]});var _0x5166c7=_0x9cbf('0x18');return db[_0x9cbf('0x19')][_0x9cbf('0x16')]({'where':{'type':_0x5166c7,'resourceId':_0x4e5b58['id']}})[_0x9cbf('0x15')](function(){return _0x1e048b;});})[_0x9cbf('0x15')](function(){_0x3f72a4[_0x9cbf('0xb')](0xcc)[_0x9cbf('0xc')]();});}};}function handleEntityNotFound(_0x2fef7f){return function(_0xbb2b6a){if(!_0xbb2b6a){_0x2fef7f[_0x9cbf('0xa')](0x194);}return _0xbb2b6a;};}function handleError(_0x5edc1e,_0x4ce092){_0x4ce092=_0x4ce092||0x1f4;return function(_0x1eda82){logger[_0x9cbf('0x1a')](_0x1eda82[_0x9cbf('0x1b')]);if(_0x1eda82['name']){delete _0x1eda82[_0x9cbf('0x1c')];}_0x5edc1e[_0x9cbf('0xb')](_0x4ce092)[_0x9cbf('0x1d')](_0x1eda82);};}exports[_0x9cbf('0x1e')]=function(_0x3ae0db,_0x25aca3){var _0x3eca65={};var _0x226d68={'count':0x0,'rows':[]};var _0xb84c58=_['map'](db[_0x9cbf('0x1f')]['rawAttributes'],function(_0x3d5a2b){return{'name':_0x3d5a2b[_0x9cbf('0x20')],'type':_0x3d5a2b['type'][_0x9cbf('0x21')]};});_0x3eca65=qs['getOptions'](_0xb84c58,_0x3ae0db);var _0x8e70e0={'where':_0x3eca65[_0x9cbf('0x22')]};return db[_0x9cbf('0x1f')]['count'](_0x8e70e0)[_0x9cbf('0x15')](function(_0x2109f5){_0x226d68[_0x9cbf('0x11')]=_0x2109f5;_0x3eca65[_0x9cbf('0x23')]=qs[_0x9cbf('0x23')](_0x3ae0db['query']);return db[_0x9cbf('0x1f')][_0x9cbf('0x24')](_0x3eca65);})['then'](function(_0x5b091c){_0x226d68['rows']=_0x5b091c;return _0x226d68;})[_0x9cbf('0x15')](respondWithFilteredResult(_0x25aca3,_0x3eca65))[_0x9cbf('0x25')](handleError(_0x25aca3,null));};exports['show']=function(_0x4f09b8,_0x38ff99){var _0x827300={'raw':!![],'where':{'id':_0x4f09b8['params']['id']}},_0x2b6374={};_0x2b6374[_0x9cbf('0x26')]=_[_0x9cbf('0x27')](db[_0x9cbf('0x1f')]['rawAttributes']);_0x2b6374[_0x9cbf('0x28')]=_[_0x9cbf('0x27')](_0x4f09b8[_0x9cbf('0x28')]);_0x2b6374['filters']=_[_0x9cbf('0x29')](_0x2b6374['model'],_0x2b6374[_0x9cbf('0x28')]);_0x827300[_0x9cbf('0x2a')]=_[_0x9cbf('0x29')](_0x2b6374['model'],qs[_0x9cbf('0x2b')](_0x4f09b8[_0x9cbf('0x28')]['fields']));_0x827300[_0x9cbf('0x2a')]=_0x827300[_0x9cbf('0x2a')][_0x9cbf('0x2c')]?_0x827300['attributes']:_0x2b6374['model'];if(_0x4f09b8[_0x9cbf('0x28')][_0x9cbf('0x2d')]){_0x827300[_0x9cbf('0x23')]=[{'all':!![]}];}_0x827300=_[_0x9cbf('0x2e')]({},_0x827300,_0x4f09b8[_0x9cbf('0x2f')]);return db[_0x9cbf('0x1f')][_0x9cbf('0x30')](_0x827300)[_0x9cbf('0x15')](handleEntityNotFound(_0x38ff99,null))[_0x9cbf('0x15')](respondWithResult(_0x38ff99,null))[_0x9cbf('0x25')](handleError(_0x38ff99,null));};exports[_0x9cbf('0x31')]=function(_0xb3d678,_0x462f2e){return db[_0x9cbf('0x1f')]['create'](_0xb3d678[_0x9cbf('0x32')],{})[_0x9cbf('0x15')](function(_0x2dcfe2){var _0x62b69b=_0xb3d678[_0x9cbf('0x33')]['get']({'plain':!![]});if(!_0x62b69b)throw new Error(_0x9cbf('0x34'));if(_0x62b69b[_0x9cbf('0x35')]===_0x9cbf('0x33')){var _0x4c9762=_0x2dcfe2[_0x9cbf('0x17')]({'plain':!![]});var _0x3e4753=_0x9cbf('0x18');return db[_0x9cbf('0x36')][_0x9cbf('0x30')]({'where':{'name':_0x3e4753,'userProfileId':_0x62b69b[_0x9cbf('0x37')]},'raw':!![]})[_0x9cbf('0x15')](function(_0x489601){if(_0x489601&&_0x489601['autoAssociation']===0x0){return db[_0x9cbf('0x19')][_0x9cbf('0x31')]({'name':_0x4c9762[_0x9cbf('0x1c')],'resourceId':_0x4c9762['id'],'type':_0x489601['name'],'sectionId':_0x489601['id']},{})[_0x9cbf('0x15')](function(){return _0x2dcfe2;});}else{return _0x2dcfe2;}})[_0x9cbf('0x25')](function(_0x2b47f4){logger[_0x9cbf('0x1a')](_0x9cbf('0x38'),_0x2b47f4);throw _0x2b47f4;});}return _0x2dcfe2;})[_0x9cbf('0x15')](respondWithResult(_0x462f2e,0xc9))[_0x9cbf('0x25')](handleError(_0x462f2e,null));};exports[_0x9cbf('0x14')]=function(_0xe6f035,_0x5dcb39){if(_0xe6f035[_0x9cbf('0x32')]['id']){delete _0xe6f035[_0x9cbf('0x32')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0xe6f035[_0x9cbf('0x39')]['id']}})[_0x9cbf('0x15')](handleEntityNotFound(_0x5dcb39,null))[_0x9cbf('0x15')](saveUpdates(_0xe6f035[_0x9cbf('0x32')],null))[_0x9cbf('0x15')](respondWithResult(_0x5dcb39,null))[_0x9cbf('0x25')](handleError(_0x5dcb39,null));};exports[_0x9cbf('0x16')]=function(_0x131ca0,_0x51053d){return db[_0x9cbf('0x1f')][_0x9cbf('0x30')]({'where':{'id':_0x131ca0['params']['id']}})[_0x9cbf('0x15')](handleEntityNotFound(_0x51053d,null))['then'](removeEntity(_0x51053d,null))[_0x9cbf('0x25')](handleError(_0x51053d,null));};exports[_0x9cbf('0x3a')]=function(_0xc17e7,_0x6920e5){return db[_0x9cbf('0x1f')][_0x9cbf('0x3a')]()[_0x9cbf('0x15')](respondWithResult(_0x6920e5,null))[_0x9cbf('0x25')](handleError(_0x6920e5,null));};exports[_0x9cbf('0x3b')]=function(_0x412fc2,_0x14cdac){var _0x4efd7e={'raw':!![],'where':{}},_0x1219e4={},_0x4db280;return db[_0x9cbf('0x1f')][_0x9cbf('0x3c')]({'where':{'id':_0x412fc2[_0x9cbf('0x39')]['id']}})['then'](handleEntityNotFound(_0x14cdac,null))[_0x9cbf('0x15')](function(_0x53a304){if(_0x53a304){_0x4db280=_0x53a304[_0x9cbf('0x17')]({'plain':!![]});_0x1219e4[_0x9cbf('0x26')]=_[_0x9cbf('0x27')](db[_0x9cbf('0x3d')][_0x9cbf('0x3e')]);_0x1219e4[_0x9cbf('0x28')]=_[_0x9cbf('0x27')](_0x412fc2['query']);_0x1219e4[_0x9cbf('0x3f')]=_['intersection'](_0x1219e4[_0x9cbf('0x26')],_0x1219e4['query']);_0x4efd7e['attributes']=_[_0x9cbf('0x29')](_0x1219e4[_0x9cbf('0x26')],qs[_0x9cbf('0x2b')](_0x412fc2[_0x9cbf('0x28')][_0x9cbf('0x2b')]));_0x4efd7e[_0x9cbf('0x2a')]=_0x4efd7e[_0x9cbf('0x2a')][_0x9cbf('0x2c')]?_0x4efd7e[_0x9cbf('0x2a')]:_0x1219e4[_0x9cbf('0x26')];if(!_0x412fc2['query'][_0x9cbf('0x40')]('nolimit')){_0x4efd7e[_0x9cbf('0x10')]=qs[_0x9cbf('0x10')](_0x412fc2[_0x9cbf('0x28')][_0x9cbf('0x10')]);_0x4efd7e[_0x9cbf('0xe')]=qs[_0x9cbf('0xe')](_0x412fc2[_0x9cbf('0x28')][_0x9cbf('0xe')]);}_0x4efd7e[_0x9cbf('0x41')]=qs['sort'](_0x412fc2['query'][_0x9cbf('0x42')]);_0x4efd7e['where']=qs[_0x9cbf('0x3f')](_[_0x9cbf('0x43')](_0x412fc2[_0x9cbf('0x28')],_0x1219e4['filters']));_0x4efd7e['where'][_0x9cbf('0x44')]=_0x53a304['id'];if(_0x412fc2['query'][_0x9cbf('0x45')]){_0x4efd7e['where']=_[_0x9cbf('0x2e')](_0x4efd7e[_0x9cbf('0x22')],{'$or':_[_0x9cbf('0x46')](_0x4efd7e[_0x9cbf('0x2a')],function(_0x353fab){var _0x24a7b5={};_0x24a7b5[_0x353fab]={'$like':'%'+_0x412fc2[_0x9cbf('0x28')][_0x9cbf('0x45')]+'%'};return _0x24a7b5;})});}_0x4efd7e=_[_0x9cbf('0x2e')]({},_0x4efd7e,_0x412fc2[_0x9cbf('0x2f')]);return db['UserChatQueue'][_0x9cbf('0x24')](_0x4efd7e);}})[_0x9cbf('0x15')](function(_0x2d6357){if(_0x2d6357){return db[_0x9cbf('0x47')][_0x9cbf('0x48')]({'where':{'id':_[_0x9cbf('0x46')](_0x2d6357,_0x9cbf('0x49')),'role':_0x9cbf('0x4a')},'attributes':['id',_0x9cbf('0x1c'),_0x9cbf('0x4b'),_0x9cbf('0x4c'),'createdAt']});}})[_0x9cbf('0x15')](function(_0x3de927){if(_0x3de927){return{'count':_0x3de927[_0x9cbf('0x11')],'rows':_['map'](_0x3de927[_0x9cbf('0x4d')],function(_0x23e51b){return{'membername':_0x23e51b['name'],'UserId':_0x23e51b['id'],'queue_name':_0x4db280[_0x9cbf('0x1c')],'ChatQueueId':_0x4db280['id'],'interface':util[_0x9cbf('0x4e')]('%s/%s',_0x9cbf('0x4f'),_0x23e51b[_0x9cbf('0x1c')]),'penalty':0x0,'paused':_0x23e51b[_0x9cbf('0x4b')],'createdAt':_0x23e51b['createdAt'],'updatedAt':_0x23e51b['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x9cbf('0x15')](respondWithFilteredResult(_0x14cdac,_0x4efd7e))[_0x9cbf('0x25')](handleError(_0x14cdac,null));};exports[_0x9cbf('0x50')]=function(_0x799f90,_0x220786){var _0x59ee9d={};var _0x2315df={};var _0x38fe22;var _0x1b7a4c;return db[_0x9cbf('0x1f')]['findOne']({'where':{'id':_0x799f90[_0x9cbf('0x39')]['id']}})['then'](handleEntityNotFound(_0x220786,null))['then'](function(_0x456480){if(_0x456480){_0x38fe22=_0x456480;_0x2315df[_0x9cbf('0x26')]=_[_0x9cbf('0x27')](db[_0x9cbf('0x51')][_0x9cbf('0x3e')]);_0x2315df[_0x9cbf('0x28')]=_[_0x9cbf('0x27')](_0x799f90[_0x9cbf('0x28')]);_0x2315df['filters']=_['intersection'](_0x2315df[_0x9cbf('0x26')],_0x2315df['query']);_0x59ee9d[_0x9cbf('0x2a')]=_['intersection'](_0x2315df[_0x9cbf('0x26')],qs[_0x9cbf('0x2b')](_0x799f90[_0x9cbf('0x28')][_0x9cbf('0x2b')]));_0x59ee9d[_0x9cbf('0x2a')]=_0x59ee9d['attributes'][_0x9cbf('0x2c')]?_0x59ee9d[_0x9cbf('0x2a')]:_0x2315df['model'];_0x59ee9d[_0x9cbf('0x41')]=qs['sort'](_0x799f90[_0x9cbf('0x28')]['sort']);_0x59ee9d[_0x9cbf('0x22')]=qs[_0x9cbf('0x3f')](_[_0x9cbf('0x43')](_0x799f90[_0x9cbf('0x28')],_0x2315df[_0x9cbf('0x3f')]));if(_0x799f90['query']['filter']){_0x59ee9d[_0x9cbf('0x22')]=_[_0x9cbf('0x2e')](_0x59ee9d['where'],{'$or':_[_0x9cbf('0x46')](_0x59ee9d[_0x9cbf('0x2a')],function(_0x17c1a1){var _0x3991be={};_0x3991be[_0x17c1a1]={'$like':'%'+_0x799f90[_0x9cbf('0x28')][_0x9cbf('0x45')]+'%'};return _0x3991be;})});}_0x59ee9d=_[_0x9cbf('0x2e')]({},_0x59ee9d,_0x799f90[_0x9cbf('0x2f')]);return _0x38fe22['getTeams'](_0x59ee9d);}})[_0x9cbf('0x15')](function(_0x4873d8){if(_0x4873d8){_0x1b7a4c=_0x4873d8[_0x9cbf('0x2c')];if(!_0x799f90[_0x9cbf('0x28')][_0x9cbf('0x40')]('nolimit')){_0x59ee9d['limit']=qs[_0x9cbf('0x10')](_0x799f90['query'][_0x9cbf('0x10')]);_0x59ee9d[_0x9cbf('0xe')]=qs[_0x9cbf('0xe')](_0x799f90[_0x9cbf('0x28')][_0x9cbf('0xe')]);}return _0x38fe22[_0x9cbf('0x50')](_0x59ee9d);}})['then'](function(_0x16478f){if(_0x16478f){return _0x16478f?{'count':_0x1b7a4c,'rows':_0x16478f}:null;}})[_0x9cbf('0x15')](respondWithResult(_0x220786,null))[_0x9cbf('0x25')](handleError(_0x220786,null));};exports['addTeams']=function(_0xe4bdb0,_0x4a92cd){var _0x3c1133=_0xe4bdb0[_0x9cbf('0x32')][_0x9cbf('0x52')];return db[_0x9cbf('0x51')]['findAll']({'where':{'id':_0x3c1133},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9cbf('0x53'),'attributes':['id',_0x9cbf('0x1c'),_0x9cbf('0x54'),'voicePause','interface'],'raw':!![]}]})[_0x9cbf('0x15')](function(_0x17fd79){if(_0x17fd79){var _0x45eedb=_[_0x9cbf('0x55')](_0x17fd79,function(_0x2f816e){var _0xba6dac=_0x2f816e[_0x9cbf('0x17')]({'plain':!![]});return _0xba6dac['Agents'];});return db[_0x9cbf('0x1f')][_0x9cbf('0x30')]({'where':{'id':_0xe4bdb0['params']['id']}})[_0x9cbf('0x15')](function(_0x3fe225){return db['sequelize'][_0x9cbf('0x56')](function(_0x219b53){return _0x3fe225[_0x9cbf('0x57')](_0x3c1133,{'transaction':_0x219b53})['then'](function(){return BPromise['each'](_0x45eedb,function(_0x3dcca1){return db[_0x9cbf('0x3d')][_0x9cbf('0x58')]({'where':{'UserId':_0x3dcca1['id'],'ChatQueueId':_0xe4bdb0[_0x9cbf('0x39')]['id']},'transaction':_0x219b53});});})['then'](function(){_0x45eedb[_0x9cbf('0x59')](function(_0xb91c89){socket[_0x9cbf('0x5a')](_0x9cbf('0x5b'),{'UserId':_0xb91c89['id'],'ChatQueueId':_0x3fe225['id']});});});});});}})['then'](respondWithStatusCode(_0x4a92cd,null))[_0x9cbf('0x25')](handleError(_0x4a92cd,null));};exports[_0x9cbf('0x5c')]=function(_0x7b418d,_0x338ff7){return db[_0x9cbf('0x51')][_0x9cbf('0x24')]({'where':{'id':_0x7b418d[_0x9cbf('0x28')][_0x9cbf('0x52')]},'attributes':['id'],'include':[{'model':db[_0x9cbf('0x47')],'as':_0x9cbf('0x53'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x338ff7,null))[_0x9cbf('0x15')](function(_0x5eb2e3){var _0x5cb1a6=_[_0x9cbf('0x46')](_0x5eb2e3,'id');var _0x14e80a=[];var _0x55e16b=[];var _0x320698=squel[_0x9cbf('0x5d')]();_0x320698[_0x9cbf('0x5e')]('tq.TeamId')[_0x9cbf('0x5f')](_0x9cbf('0x60'),'tq')['join'](_0x9cbf('0x61'),'ut',_0x9cbf('0x62'))[_0x9cbf('0x22')](_0x9cbf('0x63'),_0x7b418d['params']['id']);for(var _0x483a94=0x0;_0x483a94<_0x5eb2e3[_0x9cbf('0x2c')];_0x483a94+=0x1){let _0xbd3521=_0x5eb2e3[_0x483a94];for(var _0x353158=0x0;_0x353158<_0xbd3521[_0x9cbf('0x53')][_0x9cbf('0x2c')];_0x353158+=0x1){let _0x303bef=_0xbd3521[_0x9cbf('0x53')][_0x353158];var _0xc37ced=_0x320698[_0x9cbf('0x64')]();_0xc37ced['where'](_0x9cbf('0x65'),_0x303bef['id']);_0x55e16b['push'](db['sequelize'][_0x9cbf('0x28')](_0xc37ced[_0x9cbf('0x66')](),{'type':db[_0x9cbf('0x67')][_0x9cbf('0x68')][_0x9cbf('0x69')]})[_0x9cbf('0x15')](function(_0x369f3b){if(_0x369f3b[_0x9cbf('0x2c')]===0x1){return _0x303bef['id'];}else{var _0x32247d=_['every'](_[_0x9cbf('0x46')](_0x369f3b,_0x9cbf('0x6a')),function(_0x116c1c){return _[_0x9cbf('0x6b')](_0x5cb1a6,_0x116c1c);});if(_0x32247d){return _0x303bef['id'];}}}));}}return BPromise[_0x9cbf('0x6c')](_0x55e16b)[_0x9cbf('0x15')](function(_0x2aaa73){_0x14e80a=_(_0x14e80a)['union'](_0x2aaa73)[_0x9cbf('0x6d')]()['value']();return db[_0x9cbf('0x1f')][_0x9cbf('0x30')]({'where':{'id':_0x7b418d[_0x9cbf('0x39')]['id']}})[_0x9cbf('0x15')](function(_0xed2417){return db['sequelize'][_0x9cbf('0x56')](function(_0x48f6d0){return _0xed2417[_0x9cbf('0x5c')](_0x7b418d[_0x9cbf('0x28')][_0x9cbf('0x52')],{'transaction':_0x48f6d0})['then'](function(){if(!_['isEmpty'](_0x14e80a)){return _0xed2417['removeAgents'](_0x14e80a,{'transaction':_0x48f6d0});}})[_0x9cbf('0x15')](function(){_0x14e80a[_0x9cbf('0x59')](function(_0x48213d){socket[_0x9cbf('0x5a')](_0x9cbf('0x6e'),{'UserId':_0x48213d,'ChatQueueId':_0xed2417['id']});});});});});});})[_0x9cbf('0x15')](respondWithStatusCode(_0x338ff7,null))['catch'](handleError(_0x338ff7,null));};exports[_0x9cbf('0x6f')]=function(_0x43b34d,_0x610cb3){return db[_0x9cbf('0x1f')][_0x9cbf('0x30')]({'where':{'id':_0x43b34d['params']['id']}})[_0x9cbf('0x15')](handleEntityNotFound(_0x610cb3,null))[_0x9cbf('0x15')](function(_0x219e6c){if(_0x219e6c){return _0x219e6c[_0x9cbf('0x6f')](_0x43b34d[_0x9cbf('0x32')][_0x9cbf('0x52')],_[_0x9cbf('0x70')](_0x43b34d['body'],[_0x9cbf('0x52'),'id'])||{})['spread'](function(_0x5d0bdf){for(var _0x4954bb=0x0;_0x4954bb<_0x43b34d['body'][_0x9cbf('0x52')][_0x9cbf('0x2c')];_0x4954bb+=0x1){socket[_0x9cbf('0x5a')](_0x9cbf('0x5b'),{'UserId':Number(_0x43b34d[_0x9cbf('0x32')][_0x9cbf('0x52')][_0x4954bb]),'ChatQueueId':Number(_0x43b34d['params']['id'])});}return _0x5d0bdf;});}})[_0x9cbf('0x15')](respondWithResult(_0x610cb3,null))[_0x9cbf('0x25')](handleError(_0x610cb3,null));};exports[_0x9cbf('0x71')]=function(_0x3f50c6,_0x35d221){return db[_0x9cbf('0x1f')][_0x9cbf('0x30')]({'where':{'id':_0x3f50c6['params']['id']}})[_0x9cbf('0x15')](handleEntityNotFound(_0x35d221,null))[_0x9cbf('0x15')](function(_0x3e6c68){if(_0x3e6c68){return _0x3e6c68[_0x9cbf('0x71')](_0x3f50c6[_0x9cbf('0x28')]['ids'])[_0x9cbf('0x15')](function(){if(_['isArray'](_0x3f50c6['query'][_0x9cbf('0x52')])){for(var _0x513420=0x0;_0x513420<_0x3f50c6[_0x9cbf('0x28')][_0x9cbf('0x52')][_0x9cbf('0x2c')];_0x513420+=0x1){socket[_0x9cbf('0x5a')](_0x9cbf('0x6e'),{'UserId':Number(_0x3f50c6[_0x9cbf('0x28')][_0x9cbf('0x52')][_0x513420]),'ChatQueueId':Number(_0x3f50c6[_0x9cbf('0x39')]['id'])});}}else{socket['emit'](_0x9cbf('0x6e'),{'UserId':Number(_0x3f50c6[_0x9cbf('0x28')]['ids']),'ChatQueueId':Number(_0x3f50c6[_0x9cbf('0x39')]['id'])});}});}})[_0x9cbf('0x15')](respondWithStatusCode(_0x35d221,null))[_0x9cbf('0x25')](handleError(_0x35d221,null));};exports[_0x9cbf('0x72')]=function(_0x12f5fb,_0x323ea0){var _0x43dd6a={};var _0x1707b5={};var _0x20d734;var _0x13fccc;return db[_0x9cbf('0x1f')][_0x9cbf('0x3c')]({'where':{'id':_0x12f5fb[_0x9cbf('0x39')]['id']}})['then'](handleEntityNotFound(_0x323ea0,null))[_0x9cbf('0x15')](function(_0x1d3e2f){if(_0x1d3e2f){_0x20d734=_0x1d3e2f;_0x1707b5[_0x9cbf('0x26')]=_[_0x9cbf('0x27')](db[_0x9cbf('0x47')]['rawAttributes']);_0x1707b5[_0x9cbf('0x28')]=_[_0x9cbf('0x27')](_0x12f5fb[_0x9cbf('0x28')]);_0x1707b5[_0x9cbf('0x3f')]=_['intersection'](_0x1707b5[_0x9cbf('0x26')],_0x1707b5['query']);_0x43dd6a[_0x9cbf('0x2a')]=_[_0x9cbf('0x29')](_0x1707b5[_0x9cbf('0x26')],qs[_0x9cbf('0x2b')](_0x12f5fb[_0x9cbf('0x28')][_0x9cbf('0x2b')]));_0x43dd6a[_0x9cbf('0x2a')]=_0x43dd6a['attributes'][_0x9cbf('0x2c')]?_0x43dd6a[_0x9cbf('0x2a')]:_0x1707b5[_0x9cbf('0x26')];_0x43dd6a[_0x9cbf('0x41')]=qs['sort'](_0x12f5fb[_0x9cbf('0x28')][_0x9cbf('0x42')]);_0x43dd6a[_0x9cbf('0x22')]=qs['filters'](_[_0x9cbf('0x43')](_0x12f5fb[_0x9cbf('0x28')],_0x1707b5['filters']));if(_0x12f5fb[_0x9cbf('0x28')][_0x9cbf('0x45')]){_0x43dd6a['where']=_[_0x9cbf('0x2e')](_0x43dd6a[_0x9cbf('0x22')],{'$or':_[_0x9cbf('0x46')](_0x43dd6a[_0x9cbf('0x2a')],function(_0x955f43){var _0x5990e6={};_0x5990e6[_0x955f43]={'$like':'%'+_0x12f5fb[_0x9cbf('0x28')][_0x9cbf('0x45')]+'%'};return _0x5990e6;})});}_0x43dd6a=_[_0x9cbf('0x2e')]({},_0x43dd6a,_0x12f5fb[_0x9cbf('0x2f')]);return _0x20d734['getAgents'](_0x43dd6a);}})['then'](function(_0x241327){if(_0x241327){_0x13fccc=_0x241327[_0x9cbf('0x2c')];if(!_0x12f5fb[_0x9cbf('0x28')][_0x9cbf('0x40')](_0x9cbf('0x73'))){_0x43dd6a[_0x9cbf('0x10')]=qs[_0x9cbf('0x10')](_0x12f5fb[_0x9cbf('0x28')][_0x9cbf('0x10')]);_0x43dd6a['offset']=qs[_0x9cbf('0xe')](_0x12f5fb[_0x9cbf('0x28')][_0x9cbf('0xe')]);}return _0x20d734[_0x9cbf('0x72')](_0x43dd6a);}})['then'](function(_0x21e4d7){if(_0x21e4d7){return _0x21e4d7?{'count':_0x13fccc,'rows':_0x21e4d7}:null;}})[_0x9cbf('0x15')](respondWithResult(_0x323ea0,null))[_0x9cbf('0x25')](handleError(_0x323ea0,null));};
\ No newline at end of file
+var _0xf370=['ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','emit','isArray','getAgents','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','send','fieldName','key','getOptions','where','ChatQueue','include','query','findAll','rows','show','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','order','sort','pick','filter','options','User','findAndCountAll','map','UserId','updatedAt','format','%s/%s','SIP','createdAt','Team','getTeams','nolimit','ids','online','interface','flatMap','Agents','transaction','addTeams','each','findOrCreate','userChatQueue:save','removeTeams','select','tq.TeamId','team_has_chat_queues','join','user_has_teams'];(function(_0x251e3b,_0x46afaf){var _0x469080=function(_0x3962af){while(--_0x3962af){_0x251e3b['push'](_0x251e3b['shift']());}};_0x469080(++_0x46afaf);}(_0xf370,0x18d));var _0x0f37=function(_0x36a5f3,_0xf4d305){_0x36a5f3=_0x36a5f3-0x0;var _0x41d37f=_0xf370[_0x36a5f3];return _0x41d37f;};'use strict';var BPromise=require(_0x0f37('0x0'));var util=require(_0x0f37('0x1'));var _=require('lodash');var squel=require(_0x0f37('0x2'));var Redis=require(_0x0f37('0x3'));var qs=require(_0x0f37('0x4'));var logger=require(_0x0f37('0x5'))(_0x0f37('0x6'));var config=require('../../config/environment');var db=require(_0x0f37('0x7'))['db'];config[_0x0f37('0x8')]=_['defaults'](config[_0x0f37('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x0f37('0x9'))(new Redis(config[_0x0f37('0x8')]));require('./chatQueue.socket')[_0x0f37('0xa')](socket);function respondWithStatusCode(_0x52ba05,_0x6389e8){_0x6389e8=_0x6389e8||0xcc;return function(_0x2c8a38){if(_0x2c8a38){return _0x52ba05[_0x0f37('0xb')](_0x6389e8);}return _0x52ba05[_0x0f37('0xc')](_0x6389e8)['end']();};}function respondWithResult(_0x5a8dfe,_0x3d9604){_0x3d9604=_0x3d9604||0xc8;return function(_0x52b75e){if(_0x52b75e){return _0x5a8dfe[_0x0f37('0xc')](_0x3d9604)[_0x0f37('0xd')](_0x52b75e);}};}function respondWithFilteredResult(_0x1cdad2,_0x46a714){return function(_0x260b27){if(_0x260b27){var _0x424c1d=typeof _0x46a714[_0x0f37('0xe')]===_0x0f37('0xf')&&typeof _0x46a714[_0x0f37('0x10')]==='undefined';var _0x4fd3cd=_0x260b27[_0x0f37('0x11')];var _0x16b411=_0x424c1d?0x0:_0x46a714[_0x0f37('0xe')];var _0xd8b06f=_0x424c1d?_0x260b27[_0x0f37('0x11')]:_0x46a714[_0x0f37('0xe')]+_0x46a714['limit'];var _0x478201;if(_0xd8b06f>=_0x4fd3cd){_0xd8b06f=_0x4fd3cd;_0x478201=0xc8;}else{_0x478201=0xce;}_0x1cdad2['status'](_0x478201);return _0x1cdad2[_0x0f37('0x12')](_0x0f37('0x13'),_0x16b411+'-'+_0xd8b06f+'/'+_0x4fd3cd)[_0x0f37('0xd')](_0x260b27);}return null;};}function saveUpdates(_0x21941f){return function(_0x1f8cd7){if(_0x1f8cd7){return _0x1f8cd7[_0x0f37('0x14')](_0x21941f)[_0x0f37('0x15')](function(_0x523c2b){return _0x523c2b;});}return null;};}function removeEntity(_0x23028f){return function(_0x5e1822){if(_0x5e1822){return _0x5e1822[_0x0f37('0x16')]()['then'](function(){var _0x447d25=_0x5e1822[_0x0f37('0x17')]({'plain':!![]});var _0x311161=_0x0f37('0x18');return db[_0x0f37('0x19')][_0x0f37('0x16')]({'where':{'type':_0x311161,'resourceId':_0x447d25['id']}})[_0x0f37('0x15')](function(){return _0x5e1822;});})[_0x0f37('0x15')](function(){_0x23028f[_0x0f37('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1858d1){return function(_0x168020){if(!_0x168020){_0x1858d1['sendStatus'](0x194);}return _0x168020;};}function handleError(_0x3f042b,_0x2f3083){_0x2f3083=_0x2f3083||0x1f4;return function(_0x47cfaf){logger[_0x0f37('0x1a')](_0x47cfaf[_0x0f37('0x1b')]);if(_0x47cfaf['name']){delete _0x47cfaf[_0x0f37('0x1c')];}_0x3f042b[_0x0f37('0xc')](_0x2f3083)[_0x0f37('0x1d')](_0x47cfaf);};}exports['index']=function(_0x580016,_0x24133e){var _0x595650={};var _0x1c403e={'count':0x0,'rows':[]};var _0x2e0e30=_['map'](db['ChatQueue']['rawAttributes'],function(_0x363658){return{'name':_0x363658[_0x0f37('0x1e')],'type':_0x363658['type'][_0x0f37('0x1f')]};});_0x595650=qs[_0x0f37('0x20')](_0x2e0e30,_0x580016);var _0x373173={'where':_0x595650[_0x0f37('0x21')]};return db[_0x0f37('0x22')][_0x0f37('0x11')](_0x373173)['then'](function(_0x3a17b3){_0x1c403e[_0x0f37('0x11')]=_0x3a17b3;_0x595650[_0x0f37('0x23')]=qs['include'](_0x580016[_0x0f37('0x24')]);return db[_0x0f37('0x22')][_0x0f37('0x25')](_0x595650);})[_0x0f37('0x15')](function(_0x5a2e26){_0x1c403e[_0x0f37('0x26')]=_0x5a2e26;return _0x1c403e;})[_0x0f37('0x15')](respondWithFilteredResult(_0x24133e,_0x595650))['catch'](handleError(_0x24133e,null));};exports[_0x0f37('0x27')]=function(_0x4a9120,_0x3f0b7e){var _0x3de8fa={'raw':!![],'where':{'id':_0x4a9120[_0x0f37('0x28')]['id']}},_0x7c36e0={};_0x7c36e0[_0x0f37('0x29')]=_[_0x0f37('0x2a')](db[_0x0f37('0x22')][_0x0f37('0x2b')]);_0x7c36e0[_0x0f37('0x24')]=_[_0x0f37('0x2a')](_0x4a9120[_0x0f37('0x24')]);_0x7c36e0[_0x0f37('0x2c')]=_[_0x0f37('0x2d')](_0x7c36e0['model'],_0x7c36e0[_0x0f37('0x24')]);_0x3de8fa[_0x0f37('0x2e')]=_['intersection'](_0x7c36e0[_0x0f37('0x29')],qs[_0x0f37('0x2f')](_0x4a9120[_0x0f37('0x24')]['fields']));_0x3de8fa[_0x0f37('0x2e')]=_0x3de8fa['attributes'][_0x0f37('0x30')]?_0x3de8fa['attributes']:_0x7c36e0[_0x0f37('0x29')];if(_0x4a9120[_0x0f37('0x24')][_0x0f37('0x31')]){_0x3de8fa[_0x0f37('0x23')]=[{'all':!![]}];}_0x3de8fa=_[_0x0f37('0x32')]({},_0x3de8fa,_0x4a9120['options']);return db[_0x0f37('0x22')][_0x0f37('0x33')](_0x3de8fa)['then'](handleEntityNotFound(_0x3f0b7e,null))[_0x0f37('0x15')](respondWithResult(_0x3f0b7e,null))[_0x0f37('0x34')](handleError(_0x3f0b7e,null));};exports[_0x0f37('0x35')]=function(_0x27878c,_0x4b0cd2){return db[_0x0f37('0x22')]['create'](_0x27878c[_0x0f37('0x36')],{})[_0x0f37('0x15')](function(_0xcfca76){var _0x57db14=_0x27878c[_0x0f37('0x37')]['get']({'plain':!![]});if(!_0x57db14)throw new Error(_0x0f37('0x38'));if(_0x57db14[_0x0f37('0x39')]===_0x0f37('0x37')){var _0x131f9b=_0xcfca76['get']({'plain':!![]});var _0x1d89b5=_0x0f37('0x18');return db[_0x0f37('0x3a')][_0x0f37('0x33')]({'where':{'name':_0x1d89b5,'userProfileId':_0x57db14[_0x0f37('0x3b')]},'raw':!![]})['then'](function(_0x675ca1){if(_0x675ca1&&_0x675ca1['autoAssociation']===0x0){return db[_0x0f37('0x19')][_0x0f37('0x35')]({'name':_0x131f9b['name'],'resourceId':_0x131f9b['id'],'type':_0x675ca1[_0x0f37('0x1c')],'sectionId':_0x675ca1['id']},{})[_0x0f37('0x15')](function(){return _0xcfca76;});}else{return _0xcfca76;}})[_0x0f37('0x34')](function(_0x4a3e17){logger[_0x0f37('0x1a')](_0x0f37('0x3c'),_0x4a3e17);throw _0x4a3e17;});}return _0xcfca76;})['then'](respondWithResult(_0x4b0cd2,0xc9))['catch'](handleError(_0x4b0cd2,null));};exports[_0x0f37('0x14')]=function(_0x481245,_0xf776e2){if(_0x481245['body']['id']){delete _0x481245[_0x0f37('0x36')]['id'];}return db[_0x0f37('0x22')][_0x0f37('0x33')]({'where':{'id':_0x481245['params']['id']}})[_0x0f37('0x15')](handleEntityNotFound(_0xf776e2,null))[_0x0f37('0x15')](saveUpdates(_0x481245['body'],null))[_0x0f37('0x15')](respondWithResult(_0xf776e2,null))[_0x0f37('0x34')](handleError(_0xf776e2,null));};exports[_0x0f37('0x16')]=function(_0x4d4ab5,_0xe120fd){return db[_0x0f37('0x22')][_0x0f37('0x33')]({'where':{'id':_0x4d4ab5[_0x0f37('0x28')]['id']}})[_0x0f37('0x15')](handleEntityNotFound(_0xe120fd,null))[_0x0f37('0x15')](removeEntity(_0xe120fd,null))[_0x0f37('0x34')](handleError(_0xe120fd,null));};exports[_0x0f37('0x3d')]=function(_0x133fcd,_0x519d04){return db[_0x0f37('0x22')][_0x0f37('0x3d')]()[_0x0f37('0x15')](respondWithResult(_0x519d04,null))[_0x0f37('0x34')](handleError(_0x519d04,null));};exports[_0x0f37('0x3e')]=function(_0x10d7d9,_0x54d08e){var _0x19afc0={'raw':!![],'where':{}},_0x2a2327={},_0x287c9b;return db[_0x0f37('0x22')][_0x0f37('0x3f')]({'where':{'id':_0x10d7d9[_0x0f37('0x28')]['id']}})[_0x0f37('0x15')](handleEntityNotFound(_0x54d08e,null))[_0x0f37('0x15')](function(_0x284609){if(_0x284609){_0x287c9b=_0x284609['get']({'plain':!![]});_0x2a2327['model']=_[_0x0f37('0x2a')](db[_0x0f37('0x40')][_0x0f37('0x2b')]);_0x2a2327[_0x0f37('0x24')]=_[_0x0f37('0x2a')](_0x10d7d9[_0x0f37('0x24')]);_0x2a2327['filters']=_[_0x0f37('0x2d')](_0x2a2327[_0x0f37('0x29')],_0x2a2327[_0x0f37('0x24')]);_0x19afc0[_0x0f37('0x2e')]=_['intersection'](_0x2a2327[_0x0f37('0x29')],qs[_0x0f37('0x2f')](_0x10d7d9['query'][_0x0f37('0x2f')]));_0x19afc0[_0x0f37('0x2e')]=_0x19afc0[_0x0f37('0x2e')]['length']?_0x19afc0[_0x0f37('0x2e')]:_0x2a2327[_0x0f37('0x29')];if(!_0x10d7d9[_0x0f37('0x24')][_0x0f37('0x41')]('nolimit')){_0x19afc0[_0x0f37('0x10')]=qs[_0x0f37('0x10')](_0x10d7d9[_0x0f37('0x24')][_0x0f37('0x10')]);_0x19afc0[_0x0f37('0xe')]=qs['offset'](_0x10d7d9[_0x0f37('0x24')]['offset']);}_0x19afc0[_0x0f37('0x42')]=qs[_0x0f37('0x43')](_0x10d7d9[_0x0f37('0x24')]['sort']);_0x19afc0['where']=qs['filters'](_[_0x0f37('0x44')](_0x10d7d9[_0x0f37('0x24')],_0x2a2327[_0x0f37('0x2c')]));_0x19afc0['where']['ChatQueueId']=_0x284609['id'];if(_0x10d7d9['query'][_0x0f37('0x45')]){_0x19afc0['where']=_['merge'](_0x19afc0[_0x0f37('0x21')],{'$or':_['map'](_0x19afc0['attributes'],function(_0xa18e81){var _0x55dd36={};_0x55dd36[_0xa18e81]={'$like':'%'+_0x10d7d9['query'][_0x0f37('0x45')]+'%'};return _0x55dd36;})});}_0x19afc0=_[_0x0f37('0x32')]({},_0x19afc0,_0x10d7d9[_0x0f37('0x46')]);return db[_0x0f37('0x40')][_0x0f37('0x25')](_0x19afc0);}})['then'](function(_0x42ca50){if(_0x42ca50){return db[_0x0f37('0x47')][_0x0f37('0x48')]({'where':{'id':_[_0x0f37('0x49')](_0x42ca50,_0x0f37('0x4a')),'role':'agent'},'attributes':['id',_0x0f37('0x1c'),'chatPause',_0x0f37('0x4b'),'createdAt']});}})[_0x0f37('0x15')](function(_0x2a3dbf){if(_0x2a3dbf){return{'count':_0x2a3dbf['count'],'rows':_[_0x0f37('0x49')](_0x2a3dbf[_0x0f37('0x26')],function(_0x182229){return{'membername':_0x182229[_0x0f37('0x1c')],'UserId':_0x182229['id'],'queue_name':_0x287c9b['name'],'ChatQueueId':_0x287c9b['id'],'interface':util[_0x0f37('0x4c')](_0x0f37('0x4d'),_0x0f37('0x4e'),_0x182229[_0x0f37('0x1c')]),'penalty':0x0,'paused':_0x182229['chatPause'],'createdAt':_0x182229[_0x0f37('0x4f')],'updatedAt':_0x182229['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x0f37('0x15')](respondWithFilteredResult(_0x54d08e,_0x19afc0))['catch'](handleError(_0x54d08e,null));};exports['getTeams']=function(_0x5ffaac,_0x4f2a9d){var _0x4e172a={};var _0x221c93={};var _0x3f4a4c;var _0x446830;return db[_0x0f37('0x22')][_0x0f37('0x3f')]({'where':{'id':_0x5ffaac['params']['id']}})['then'](handleEntityNotFound(_0x4f2a9d,null))[_0x0f37('0x15')](function(_0x167610){if(_0x167610){_0x3f4a4c=_0x167610;_0x221c93[_0x0f37('0x29')]=_[_0x0f37('0x2a')](db[_0x0f37('0x50')][_0x0f37('0x2b')]);_0x221c93[_0x0f37('0x24')]=_[_0x0f37('0x2a')](_0x5ffaac['query']);_0x221c93[_0x0f37('0x2c')]=_[_0x0f37('0x2d')](_0x221c93[_0x0f37('0x29')],_0x221c93['query']);_0x4e172a[_0x0f37('0x2e')]=_[_0x0f37('0x2d')](_0x221c93[_0x0f37('0x29')],qs['fields'](_0x5ffaac['query']['fields']));_0x4e172a[_0x0f37('0x2e')]=_0x4e172a[_0x0f37('0x2e')][_0x0f37('0x30')]?_0x4e172a[_0x0f37('0x2e')]:_0x221c93[_0x0f37('0x29')];_0x4e172a['order']=qs['sort'](_0x5ffaac[_0x0f37('0x24')][_0x0f37('0x43')]);_0x4e172a['where']=qs['filters'](_['pick'](_0x5ffaac[_0x0f37('0x24')],_0x221c93[_0x0f37('0x2c')]));if(_0x5ffaac['query']['filter']){_0x4e172a['where']=_['merge'](_0x4e172a[_0x0f37('0x21')],{'$or':_[_0x0f37('0x49')](_0x4e172a[_0x0f37('0x2e')],function(_0x51ee42){var _0x4da2dd={};_0x4da2dd[_0x51ee42]={'$like':'%'+_0x5ffaac[_0x0f37('0x24')][_0x0f37('0x45')]+'%'};return _0x4da2dd;})});}_0x4e172a=_['merge']({},_0x4e172a,_0x5ffaac[_0x0f37('0x46')]);return _0x3f4a4c[_0x0f37('0x51')](_0x4e172a);}})[_0x0f37('0x15')](function(_0x15e697){if(_0x15e697){_0x446830=_0x15e697[_0x0f37('0x30')];if(!_0x5ffaac[_0x0f37('0x24')][_0x0f37('0x41')](_0x0f37('0x52'))){_0x4e172a['limit']=qs[_0x0f37('0x10')](_0x5ffaac[_0x0f37('0x24')][_0x0f37('0x10')]);_0x4e172a[_0x0f37('0xe')]=qs[_0x0f37('0xe')](_0x5ffaac[_0x0f37('0x24')][_0x0f37('0xe')]);}return _0x3f4a4c[_0x0f37('0x51')](_0x4e172a);}})[_0x0f37('0x15')](function(_0x429442){if(_0x429442){return _0x429442?{'count':_0x446830,'rows':_0x429442}:null;}})[_0x0f37('0x15')](respondWithResult(_0x4f2a9d,null))[_0x0f37('0x34')](handleError(_0x4f2a9d,null));};exports['addTeams']=function(_0x2f8f26,_0x292feb){var _0x361f3e=_0x2f8f26['body'][_0x0f37('0x53')];return db[_0x0f37('0x50')][_0x0f37('0x25')]({'where':{'id':_0x361f3e},'attributes':['id'],'include':[{'model':db[_0x0f37('0x47')],'as':'Agents','attributes':['id','name',_0x0f37('0x54'),'voicePause',_0x0f37('0x55')],'raw':!![]}]})[_0x0f37('0x15')](function(_0x4fef36){if(_0x4fef36){var _0x132bcd=_[_0x0f37('0x56')](_0x4fef36,function(_0x38ecb5){var _0x8f4498=_0x38ecb5[_0x0f37('0x17')]({'plain':!![]});return _0x8f4498[_0x0f37('0x57')];});return db[_0x0f37('0x22')]['find']({'where':{'id':_0x2f8f26[_0x0f37('0x28')]['id']}})[_0x0f37('0x15')](function(_0x136968){return db['sequelize'][_0x0f37('0x58')](function(_0x523834){return _0x136968[_0x0f37('0x59')](_0x361f3e,{'transaction':_0x523834})[_0x0f37('0x15')](function(){return BPromise[_0x0f37('0x5a')](_0x132bcd,function(_0x5678bf){return db[_0x0f37('0x40')][_0x0f37('0x5b')]({'where':{'UserId':_0x5678bf['id'],'ChatQueueId':_0x2f8f26[_0x0f37('0x28')]['id']},'transaction':_0x523834});});})[_0x0f37('0x15')](function(){_0x132bcd['forEach'](function(_0xa4427a){socket['emit'](_0x0f37('0x5c'),{'UserId':_0xa4427a['id'],'ChatQueueId':_0x136968['id']});});});});});}})['then'](respondWithStatusCode(_0x292feb,null))[_0x0f37('0x34')](handleError(_0x292feb,null));};exports[_0x0f37('0x5d')]=function(_0x34eff2,_0x54310e){return db[_0x0f37('0x50')][_0x0f37('0x25')]({'where':{'id':_0x34eff2[_0x0f37('0x24')][_0x0f37('0x53')]},'attributes':['id'],'include':[{'model':db[_0x0f37('0x47')],'as':_0x0f37('0x57'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x54310e,null))[_0x0f37('0x15')](function(_0x5f1c72){var _0xe67e3d=_[_0x0f37('0x49')](_0x5f1c72,'id');var _0x41de54=[];var _0x1cf0c1=[];var _0x14f95c=squel[_0x0f37('0x5e')]();_0x14f95c['field'](_0x0f37('0x5f'))['from'](_0x0f37('0x60'),'tq')[_0x0f37('0x61')](_0x0f37('0x62'),'ut',_0x0f37('0x63'))[_0x0f37('0x21')](_0x0f37('0x64'),_0x34eff2[_0x0f37('0x28')]['id']);for(var _0x2a4415=0x0;_0x2a4415<_0x5f1c72['length'];_0x2a4415+=0x1){let _0x4738d3=_0x5f1c72[_0x2a4415];for(var _0x130014=0x0;_0x130014<_0x4738d3[_0x0f37('0x57')][_0x0f37('0x30')];_0x130014+=0x1){let _0xa0a19a=_0x4738d3[_0x0f37('0x57')][_0x130014];var _0x2ce41a=_0x14f95c[_0x0f37('0x65')]();_0x2ce41a['where'](_0x0f37('0x66'),_0xa0a19a['id']);_0x1cf0c1[_0x0f37('0x67')](db[_0x0f37('0x68')][_0x0f37('0x24')](_0x2ce41a[_0x0f37('0x69')](),{'type':db['sequelize'][_0x0f37('0x6a')][_0x0f37('0x6b')]})[_0x0f37('0x15')](function(_0x2e8947){if(_0x2e8947[_0x0f37('0x30')]===0x1){return _0xa0a19a['id'];}else{var _0x5d9d1b=_[_0x0f37('0x6c')](_['map'](_0x2e8947,_0x0f37('0x6d')),function(_0x46f4a4){return _['includes'](_0xe67e3d,_0x46f4a4);});if(_0x5d9d1b){return _0xa0a19a['id'];}}}));}}return BPromise[_0x0f37('0x6e')](_0x1cf0c1)[_0x0f37('0x15')](function(_0x5d85a8){_0x41de54=_(_0x41de54)[_0x0f37('0x6f')](_0x5d85a8)[_0x0f37('0x70')]()[_0x0f37('0x71')]();return db[_0x0f37('0x22')]['find']({'where':{'id':_0x34eff2[_0x0f37('0x28')]['id']}})[_0x0f37('0x15')](function(_0x613223){return db[_0x0f37('0x68')]['transaction'](function(_0x39408d){return _0x613223[_0x0f37('0x5d')](_0x34eff2[_0x0f37('0x24')][_0x0f37('0x53')],{'transaction':_0x39408d})[_0x0f37('0x15')](function(){if(!_[_0x0f37('0x72')](_0x41de54)){return _0x613223[_0x0f37('0x73')](_0x41de54,{'transaction':_0x39408d});}})[_0x0f37('0x15')](function(){_0x41de54[_0x0f37('0x74')](function(_0x1dddcd){socket['emit'](_0x0f37('0x75'),{'UserId':_0x1dddcd,'ChatQueueId':_0x613223['id']});});});});});});})[_0x0f37('0x15')](respondWithStatusCode(_0x54310e,null))[_0x0f37('0x34')](handleError(_0x54310e,null));};exports[_0x0f37('0x76')]=function(_0x194480,_0x259af7){return db[_0x0f37('0x22')]['find']({'where':{'id':_0x194480[_0x0f37('0x28')]['id']}})[_0x0f37('0x15')](handleEntityNotFound(_0x259af7,null))[_0x0f37('0x15')](function(_0x5f2a9e){if(_0x5f2a9e){return _0x5f2a9e[_0x0f37('0x76')](_0x194480[_0x0f37('0x36')][_0x0f37('0x53')],_[_0x0f37('0x77')](_0x194480[_0x0f37('0x36')],['ids','id'])||{})[_0x0f37('0x78')](function(_0x913e17){for(var _0x3faa2e=0x0;_0x3faa2e<_0x194480['body'][_0x0f37('0x53')][_0x0f37('0x30')];_0x3faa2e+=0x1){socket[_0x0f37('0x79')](_0x0f37('0x5c'),{'UserId':Number(_0x194480['body'][_0x0f37('0x53')][_0x3faa2e]),'ChatQueueId':Number(_0x194480[_0x0f37('0x28')]['id'])});}return _0x913e17;});}})[_0x0f37('0x15')](respondWithResult(_0x259af7,null))[_0x0f37('0x34')](handleError(_0x259af7,null));};exports['removeAgents']=function(_0x354c0b,_0x407ae0){return db['ChatQueue']['find']({'where':{'id':_0x354c0b[_0x0f37('0x28')]['id']}})['then'](handleEntityNotFound(_0x407ae0,null))[_0x0f37('0x15')](function(_0x583da1){if(_0x583da1){return _0x583da1[_0x0f37('0x73')](_0x354c0b[_0x0f37('0x24')][_0x0f37('0x53')])[_0x0f37('0x15')](function(){if(_[_0x0f37('0x7a')](_0x354c0b['query'][_0x0f37('0x53')])){for(var _0x2ea581=0x0;_0x2ea581<_0x354c0b[_0x0f37('0x24')]['ids'][_0x0f37('0x30')];_0x2ea581+=0x1){socket['emit'](_0x0f37('0x75'),{'UserId':Number(_0x354c0b[_0x0f37('0x24')][_0x0f37('0x53')][_0x2ea581]),'ChatQueueId':Number(_0x354c0b[_0x0f37('0x28')]['id'])});}}else{socket['emit'](_0x0f37('0x75'),{'UserId':Number(_0x354c0b[_0x0f37('0x24')]['ids']),'ChatQueueId':Number(_0x354c0b[_0x0f37('0x28')]['id'])});}});}})[_0x0f37('0x15')](respondWithStatusCode(_0x407ae0,null))[_0x0f37('0x34')](handleError(_0x407ae0,null));};exports['getAgents']=function(_0x1b26d7,_0xcd5ed4){var _0x10c505={};var _0x1b1160={};var _0x498e19;var _0x18bcf8;return db['ChatQueue'][_0x0f37('0x3f')]({'where':{'id':_0x1b26d7[_0x0f37('0x28')]['id']}})[_0x0f37('0x15')](handleEntityNotFound(_0xcd5ed4,null))[_0x0f37('0x15')](function(_0x55284c){if(_0x55284c){_0x498e19=_0x55284c;_0x1b1160[_0x0f37('0x29')]=_['keys'](db[_0x0f37('0x47')][_0x0f37('0x2b')]);_0x1b1160['query']=_[_0x0f37('0x2a')](_0x1b26d7[_0x0f37('0x24')]);_0x1b1160['filters']=_[_0x0f37('0x2d')](_0x1b1160[_0x0f37('0x29')],_0x1b1160['query']);_0x10c505['attributes']=_['intersection'](_0x1b1160[_0x0f37('0x29')],qs[_0x0f37('0x2f')](_0x1b26d7['query'][_0x0f37('0x2f')]));_0x10c505[_0x0f37('0x2e')]=_0x10c505['attributes']['length']?_0x10c505[_0x0f37('0x2e')]:_0x1b1160[_0x0f37('0x29')];_0x10c505[_0x0f37('0x42')]=qs[_0x0f37('0x43')](_0x1b26d7[_0x0f37('0x24')]['sort']);_0x10c505[_0x0f37('0x21')]=qs[_0x0f37('0x2c')](_['pick'](_0x1b26d7[_0x0f37('0x24')],_0x1b1160['filters']));if(_0x1b26d7[_0x0f37('0x24')][_0x0f37('0x45')]){_0x10c505[_0x0f37('0x21')]=_[_0x0f37('0x32')](_0x10c505[_0x0f37('0x21')],{'$or':_[_0x0f37('0x49')](_0x10c505[_0x0f37('0x2e')],function(_0x13e3c1){var _0xf76d00={};_0xf76d00[_0x13e3c1]={'$like':'%'+_0x1b26d7[_0x0f37('0x24')]['filter']+'%'};return _0xf76d00;})});}_0x10c505=_[_0x0f37('0x32')]({},_0x10c505,_0x1b26d7[_0x0f37('0x46')]);return _0x498e19['getAgents'](_0x10c505);}})[_0x0f37('0x15')](function(_0x5b3640){if(_0x5b3640){_0x18bcf8=_0x5b3640[_0x0f37('0x30')];if(!_0x1b26d7['query'][_0x0f37('0x41')](_0x0f37('0x52'))){_0x10c505[_0x0f37('0x10')]=qs[_0x0f37('0x10')](_0x1b26d7['query'][_0x0f37('0x10')]);_0x10c505[_0x0f37('0xe')]=qs['offset'](_0x1b26d7[_0x0f37('0x24')][_0x0f37('0xe')]);}return _0x498e19[_0x0f37('0x7b')](_0x10c505);}})['then'](function(_0x9b75ae){if(_0x9b75ae){return _0x9b75ae?{'count':_0x18bcf8,'rows':_0x9b75ae}:null;}})['then'](respondWithResult(_0xcd5ed4,null))[_0x0f37('0x34')](handleError(_0xcd5ed4,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index cff7bf5..32b27d0 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 _0xfd2f=['exports','events','../../mysqldb','ChatQueue','save','remove','hook'];(function(_0x565fc6,_0x4ad48f){var _0x2fa55a=function(_0x41bdd9){while(--_0x41bdd9){_0x565fc6['push'](_0x565fc6['shift']());}};_0x2fa55a(++_0x4ad48f);}(_0xfd2f,0x14a));var _0xffd2=function(_0x35df33,_0x513c52){_0x35df33=_0x35df33-0x0;var _0x5077fd=_0xfd2f[_0x35df33];return _0x5077fd;};'use strict';var EventEmitter=require(_0xffd2('0x0'));var ChatQueue=require(_0xffd2('0x1'))['db'][_0xffd2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xffd2('0x3'),'afterUpdate':'update','afterDestroy':_0xffd2('0x4')};function emitEvent(_0x407d4b){return function(_0x492c33,_0x983987,_0x22c424){ChatQueueEvents['emit'](_0x407d4b+':'+_0x492c33['id'],_0x492c33);ChatQueueEvents['emit'](_0x407d4b,_0x492c33);_0x22c424(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xffd2('0x5')](e,emitEvent(event));}}module[_0xffd2('0x6')]=ChatQueueEvents;
\ No newline at end of file
+var _0x7bfa=['hasOwnProperty','hook','exports','events','setMaxListeners','save','remove','emit'];(function(_0x5756f8,_0x22b6d5){var _0x3bb749=function(_0x332204){while(--_0x332204){_0x5756f8['push'](_0x5756f8['shift']());}};_0x3bb749(++_0x22b6d5);}(_0x7bfa,0x173));var _0xa7bf=function(_0x4c0155,_0x5b20db){_0x4c0155=_0x4c0155-0x0;var _0x1276db=_0x7bfa[_0x4c0155];return _0x1276db;};'use strict';var EventEmitter=require(_0xa7bf('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xa7bf('0x1')](0x0);var events={'afterCreate':_0xa7bf('0x2'),'afterUpdate':'update','afterDestroy':_0xa7bf('0x3')};function emitEvent(_0x21f0bd){return function(_0x39223a,_0x10fbf0,_0x2debe9){ChatQueueEvents[_0xa7bf('0x4')](_0x21f0bd+':'+_0x39223a['id'],_0x39223a);ChatQueueEvents[_0xa7bf('0x4')](_0x21f0bd,_0x39223a);_0x2debe9(null);};}for(var e in events){if(events[_0xa7bf('0x5')](e)){var event=events[e];ChatQueue[_0xa7bf('0x6')](e,emitEvent(event));}}module[_0xa7bf('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 ddd3f89..a236132 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 _0x981a=['moment','bluebird','request-promise','path','./chatQueue.attributes','define','ChatQueue','lodash','api'];(function(_0x10b44f,_0x12b994){var _0x3b0325=function(_0x3f33c7){while(--_0x3f33c7){_0x10b44f['push'](_0x10b44f['shift']());}};_0x3b0325(++_0x12b994);}(_0x981a,0x1db));var _0xa981=function(_0x11406e,_0x681277){_0x11406e=_0x11406e-0x0;var _0x3ee71c=_0x981a[_0x11406e];return _0x3ee71c;};'use strict';var _=require(_0xa981('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa981('0x1'));var moment=require(_0xa981('0x2'));var BPromise=require(_0xa981('0x3'));var rp=require(_0xa981('0x4'));var fs=require('fs');var path=require(_0xa981('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa981('0x6'));module['exports']=function(_0xf15e6,_0xfccc60){return _0xf15e6[_0xa981('0x7')](_0xa981('0x8'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x664f=['../../config/logger','moment','bluebird','request-promise','path','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util'];(function(_0x7986a2,_0x2967e0){var _0x23c61a=function(_0x52c17d){while(--_0x52c17d){_0x7986a2['push'](_0x7986a2['shift']());}};_0x23c61a(++_0x2967e0);}(_0x664f,0x14e));var _0xf664=function(_0x9ffdd8,_0x414bbd){_0x9ffdd8=_0x9ffdd8-0x0;var _0x222710=_0x664f[_0x9ffdd8];return _0x222710;};'use strict';var _=require(_0xf664('0x0'));var util=require(_0xf664('0x1'));var logger=require(_0xf664('0x2'))('api');var moment=require(_0xf664('0x3'));var BPromise=require(_0xf664('0x4'));var rp=require(_0xf664('0x5'));var fs=require('fs');var path=require(_0xf664('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf664('0x7'));module[_0xf664('0x8')]=function(_0x5e9af2,_0x5a8737){return _0x5e9af2[_0xf664('0x9')](_0xf664('0xa'),attributes,{'tableName':_0xf664('0xb'),'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 9ba575e..3a6b36b 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 _0x6b20=['message','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','include','model','map','then','ShowChatQueue','where','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x6b20,0xd1));var _0x06b2=function(_0xe396bc,_0x477b9d){_0xe396bc=_0xe396bc-0x0;var _0x31f195=_0x6b20[_0xe396bc];return _0x31f195;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var moment=require('moment');var BPromise=require(_0x06b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06b2('0x3'));var db=require(_0x06b2('0x4'))['db'];var utils=require(_0x06b2('0x5'));var logger=require('../../config/logger')(_0x06b2('0x6'));var config=require(_0x06b2('0x7'));var jayson=require(_0x06b2('0x8'));var client=jayson[_0x06b2('0x9')][_0x06b2('0xa')]({'port':0x232a});config[_0x06b2('0xb')]=_[_0x06b2('0xc')](config['redis'],{'host':_0x06b2('0xd'),'port':0x18eb});var socket=require(_0x06b2('0xe'))(new Redis(config[_0x06b2('0xb')]));require('./chatQueue.socket')[_0x06b2('0xf')](socket);function respondWithRpcPromise(_0x57f854,_0x2cc28f,_0x4da705){return new BPromise(function(_0x552cd8,_0x301519){return client[_0x06b2('0x10')](_0x57f854,_0x4da705)['then'](function(_0x182f8f){logger[_0x06b2('0x11')](_0x06b2('0x12'),_0x2cc28f,_0x06b2('0x13'));logger[_0x06b2('0x14')](_0x06b2('0x15'),_0x2cc28f,_0x06b2('0x13'),JSON[_0x06b2('0x16')](_0x182f8f));if(_0x182f8f[_0x06b2('0x17')]){if(_0x182f8f[_0x06b2('0x17')][_0x06b2('0x18')]===0x1f4){logger[_0x06b2('0x17')](_0x06b2('0x12'),_0x2cc28f,_0x182f8f['error'][_0x06b2('0x19')]);return _0x301519(_0x182f8f[_0x06b2('0x17')][_0x06b2('0x19')]);}logger[_0x06b2('0x17')](_0x06b2('0x12'),_0x2cc28f,_0x182f8f[_0x06b2('0x17')]['message']);return _0x552cd8(_0x182f8f[_0x06b2('0x17')][_0x06b2('0x19')]);}else{logger['info'](_0x06b2('0x12'),_0x2cc28f,'request\x20sent');_0x552cd8(_0x182f8f['result'][_0x06b2('0x19')]);}})[_0x06b2('0x1a')](function(_0x27852e){logger[_0x06b2('0x17')]('ChatQueue,\x20%s,\x20%s',_0x2cc28f,_0x27852e);_0x301519(_0x27852e);});});}exports[_0x06b2('0x1b')]=function(_0x39b309){var _0x18f55b=this;return new Promise(function(_0x465325,_0xe28985){return db[_0x06b2('0x1c')][_0x06b2('0x1d')]({'raw':_0x39b309['options']?_0x39b309[_0x06b2('0x1e')][_0x06b2('0x1f')]===undefined?!![]:![]:!![],'where':_0x39b309[_0x06b2('0x1e')]?_0x39b309[_0x06b2('0x1e')]['where']||null:null,'attributes':_0x39b309['options']?_0x39b309[_0x06b2('0x1e')][_0x06b2('0x20')]||null:null,'limit':_0x39b309['options']?_0x39b309[_0x06b2('0x1e')]['limit']||null:null,'include':_0x39b309[_0x06b2('0x1e')]?_0x39b309[_0x06b2('0x1e')][_0x06b2('0x21')]?_['map'](_0x39b309[_0x06b2('0x1e')][_0x06b2('0x21')],function(_0xc65820){return{'model':db[_0xc65820[_0x06b2('0x22')]],'as':_0xc65820['as'],'attributes':_0xc65820[_0x06b2('0x20')],'include':_0xc65820['include']?_[_0x06b2('0x23')](_0xc65820[_0x06b2('0x21')],function(_0x40a73f){return{'model':db[_0x40a73f[_0x06b2('0x22')]],'as':_0x40a73f['as'],'attributes':_0x40a73f[_0x06b2('0x20')],'include':_0x40a73f[_0x06b2('0x21')]?_['map'](_0x40a73f[_0x06b2('0x21')],function(_0x2a3228){return{'model':db[_0x2a3228[_0x06b2('0x22')]],'as':_0x2a3228['as'],'attributes':_0x2a3228[_0x06b2('0x20')]};}):[]};}):[]};}):[]:[]})[_0x06b2('0x24')](function(_0x1bfaa9){logger[_0x06b2('0x11')]('GetChatQueue',_0x39b309);logger[_0x06b2('0x14')](_0x06b2('0x1b'),_0x39b309,JSON[_0x06b2('0x16')](_0x1bfaa9));_0x465325(_0x1bfaa9);})[_0x06b2('0x1a')](function(_0x1cc725){logger[_0x06b2('0x17')](_0x06b2('0x1b'),_0x1cc725[_0x06b2('0x19')],_0x39b309);_0xe28985(_0x18f55b['error'](0x1f4,_0x1cc725[_0x06b2('0x19')]));});});};exports[_0x06b2('0x25')]=function(_0x259e3d){var _0x438c16=this;return new Promise(function(_0x7a7cd7,_0x422393){return db[_0x06b2('0x1c')]['find']({'raw':_0x259e3d['options']?_0x259e3d[_0x06b2('0x1e')][_0x06b2('0x1f')]===undefined?!![]:![]:!![],'where':_0x259e3d[_0x06b2('0x1e')]?_0x259e3d['options'][_0x06b2('0x26')]||null:null,'attributes':_0x259e3d[_0x06b2('0x1e')]?_0x259e3d[_0x06b2('0x1e')][_0x06b2('0x20')]||null:null,'include':_0x259e3d[_0x06b2('0x1e')]?_0x259e3d[_0x06b2('0x1e')]['include']?_[_0x06b2('0x23')](_0x259e3d[_0x06b2('0x1e')][_0x06b2('0x21')],function(_0x4b9b83){return{'model':db[_0x4b9b83[_0x06b2('0x22')]],'as':_0x4b9b83['as'],'attributes':_0x4b9b83[_0x06b2('0x20')],'include':_0x4b9b83['include']?_[_0x06b2('0x23')](_0x4b9b83[_0x06b2('0x21')],function(_0x8d3648){return{'model':db[_0x8d3648[_0x06b2('0x22')]],'as':_0x8d3648['as'],'attributes':_0x8d3648[_0x06b2('0x20')],'include':_0x8d3648[_0x06b2('0x21')]?_[_0x06b2('0x23')](_0x8d3648[_0x06b2('0x21')],function(_0x22e77a){return{'model':db[_0x22e77a[_0x06b2('0x22')]],'as':_0x22e77a['as'],'attributes':_0x22e77a[_0x06b2('0x20')]};}):[]};}):[]};}):[]:[]})[_0x06b2('0x24')](function(_0x5ec05d){logger[_0x06b2('0x11')]('ShowChatQueue',_0x259e3d);logger['debug'](_0x06b2('0x25'),_0x259e3d,JSON['stringify'](_0x5ec05d));_0x7a7cd7(_0x5ec05d);})[_0x06b2('0x1a')](function(_0x5313a5){logger[_0x06b2('0x17')](_0x06b2('0x25'),_0x5313a5[_0x06b2('0x19')],_0x259e3d);_0x422393(_0x438c16[_0x06b2('0x17')](0x1f4,_0x5313a5[_0x06b2('0x19')]));});});};
\ No newline at end of file
+var _0x40a3=['options','where','limit','include','map','model','attributes','GetChatQueue','ShowChatQueue','find','then','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','ChatQueue','findAll','raw'];(function(_0x19dde2,_0xded705){var _0x224424=function(_0x224260){while(--_0x224260){_0x19dde2['push'](_0x19dde2['shift']());}};_0x224424(++_0xded705);}(_0x40a3,0x153));var _0x340a=function(_0x3259e2,_0x153d84){_0x3259e2=_0x3259e2-0x0;var _0x127b72=_0x40a3[_0x3259e2];return _0x127b72;};'use strict';var _=require(_0x340a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x340a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x340a('0x2'))['db'];var utils=require(_0x340a('0x3'));var logger=require(_0x340a('0x4'))(_0x340a('0x5'));var config=require(_0x340a('0x6'));var jayson=require(_0x340a('0x7'));var client=jayson[_0x340a('0x8')]['http']({'port':0x232a});config[_0x340a('0x9')]=_[_0x340a('0xa')](config['redis'],{'host':_0x340a('0xb'),'port':0x18eb});var socket=require(_0x340a('0xc'))(new Redis(config[_0x340a('0x9')]));require(_0x340a('0xd'))[_0x340a('0xe')](socket);function respondWithRpcPromise(_0x4895a3,_0x36ea9b,_0x135421){return new BPromise(function(_0x7eb940,_0x5a92bb){return client[_0x340a('0xf')](_0x4895a3,_0x135421)['then'](function(_0x2e0b3d){logger[_0x340a('0x10')]('ChatQueue,\x20%s,\x20%s',_0x36ea9b,_0x340a('0x11'));logger[_0x340a('0x12')](_0x340a('0x13'),_0x36ea9b,_0x340a('0x11'),JSON[_0x340a('0x14')](_0x2e0b3d));if(_0x2e0b3d[_0x340a('0x15')]){if(_0x2e0b3d[_0x340a('0x15')][_0x340a('0x16')]===0x1f4){logger[_0x340a('0x15')](_0x340a('0x17'),_0x36ea9b,_0x2e0b3d[_0x340a('0x15')][_0x340a('0x18')]);return _0x5a92bb(_0x2e0b3d[_0x340a('0x15')][_0x340a('0x18')]);}logger[_0x340a('0x15')]('ChatQueue,\x20%s,\x20%s',_0x36ea9b,_0x2e0b3d[_0x340a('0x15')]['message']);return _0x7eb940(_0x2e0b3d['error'][_0x340a('0x18')]);}else{logger[_0x340a('0x10')](_0x340a('0x17'),_0x36ea9b,_0x340a('0x11'));_0x7eb940(_0x2e0b3d[_0x340a('0x19')][_0x340a('0x18')]);}})[_0x340a('0x1a')](function(_0x16c923){logger[_0x340a('0x15')](_0x340a('0x17'),_0x36ea9b,_0x16c923);_0x5a92bb(_0x16c923);});});}exports['GetChatQueue']=function(_0x15489e){var _0x53bdf7=this;return new Promise(function(_0x393551,_0x30f383){return db[_0x340a('0x1b')][_0x340a('0x1c')]({'raw':_0x15489e['options']?_0x15489e['options'][_0x340a('0x1d')]===undefined?!![]:![]:!![],'where':_0x15489e[_0x340a('0x1e')]?_0x15489e['options'][_0x340a('0x1f')]||null:null,'attributes':_0x15489e[_0x340a('0x1e')]?_0x15489e[_0x340a('0x1e')]['attributes']||null:null,'limit':_0x15489e['options']?_0x15489e[_0x340a('0x1e')][_0x340a('0x20')]||null:null,'include':_0x15489e['options']?_0x15489e[_0x340a('0x1e')][_0x340a('0x21')]?_[_0x340a('0x22')](_0x15489e[_0x340a('0x1e')][_0x340a('0x21')],function(_0x2d0be0){return{'model':db[_0x2d0be0[_0x340a('0x23')]],'as':_0x2d0be0['as'],'attributes':_0x2d0be0[_0x340a('0x24')],'include':_0x2d0be0[_0x340a('0x21')]?_['map'](_0x2d0be0[_0x340a('0x21')],function(_0x4c59ff){return{'model':db[_0x4c59ff[_0x340a('0x23')]],'as':_0x4c59ff['as'],'attributes':_0x4c59ff[_0x340a('0x24')],'include':_0x4c59ff['include']?_['map'](_0x4c59ff['include'],function(_0x151a15){return{'model':db[_0x151a15[_0x340a('0x23')]],'as':_0x151a15['as'],'attributes':_0x151a15[_0x340a('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29c4c0){logger[_0x340a('0x10')]('GetChatQueue',_0x15489e);logger[_0x340a('0x12')](_0x340a('0x25'),_0x15489e,JSON[_0x340a('0x14')](_0x29c4c0));_0x393551(_0x29c4c0);})[_0x340a('0x1a')](function(_0x3ad80f){logger[_0x340a('0x15')]('GetChatQueue',_0x3ad80f[_0x340a('0x18')],_0x15489e);_0x30f383(_0x53bdf7[_0x340a('0x15')](0x1f4,_0x3ad80f[_0x340a('0x18')]));});});};exports[_0x340a('0x26')]=function(_0x4248c3){var _0x3bb7b5=this;return new Promise(function(_0x35d569,_0x140189){return db[_0x340a('0x1b')][_0x340a('0x27')]({'raw':_0x4248c3['options']?_0x4248c3[_0x340a('0x1e')][_0x340a('0x1d')]===undefined?!![]:![]:!![],'where':_0x4248c3[_0x340a('0x1e')]?_0x4248c3[_0x340a('0x1e')]['where']||null:null,'attributes':_0x4248c3[_0x340a('0x1e')]?_0x4248c3['options'][_0x340a('0x24')]||null:null,'include':_0x4248c3['options']?_0x4248c3[_0x340a('0x1e')]['include']?_['map'](_0x4248c3[_0x340a('0x1e')]['include'],function(_0x25a550){return{'model':db[_0x25a550[_0x340a('0x23')]],'as':_0x25a550['as'],'attributes':_0x25a550[_0x340a('0x24')],'include':_0x25a550[_0x340a('0x21')]?_['map'](_0x25a550['include'],function(_0x51ebb7){return{'model':db[_0x51ebb7[_0x340a('0x23')]],'as':_0x51ebb7['as'],'attributes':_0x51ebb7[_0x340a('0x24')],'include':_0x51ebb7['include']?_['map'](_0x51ebb7[_0x340a('0x21')],function(_0x45d63f){return{'model':db[_0x45d63f['model']],'as':_0x45d63f['as'],'attributes':_0x45d63f[_0x340a('0x24')]};}):[]};}):[]};}):[]:[]})[_0x340a('0x28')](function(_0x10daa3){logger[_0x340a('0x10')](_0x340a('0x26'),_0x4248c3);logger[_0x340a('0x12')](_0x340a('0x26'),_0x4248c3,JSON[_0x340a('0x14')](_0x10daa3));_0x35d569(_0x10daa3);})[_0x340a('0x1a')](function(_0x8f0903){logger[_0x340a('0x15')](_0x340a('0x26'),_0x8f0903[_0x340a('0x18')],_0x4248c3);_0x140189(_0x3bb7b5['error'](0x1f4,_0x8f0903[_0x340a('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index b1a9d96..ad33252 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 _0x6f0d=['update','emit','removeListener','length','save','remove'];(function(_0x5828d0,_0x2c3e93){var _0x239b02=function(_0x702fe4){while(--_0x702fe4){_0x5828d0['push'](_0x5828d0['shift']());}};_0x239b02(++_0x2c3e93);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x19f7a5,_0x4b7eb3){_0x19f7a5=_0x19f7a5-0x0;var _0x172e23=_0x6f0d[_0x19f7a5];return _0x172e23;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xd6f0('0x0'),_0xd6f0('0x1'),_0xd6f0('0x2')];function createListener(_0x107a8c,_0x573473){return function(_0x275230){_0x573473[_0xd6f0('0x3')](_0x107a8c,_0x275230);};}function removeListener(_0x2f78fb,_0x25344b){return function(){ChatQueueEvents[_0xd6f0('0x4')](_0x2f78fb,_0x25344b);};}exports['register']=function(_0x2d2ce6){for(var _0x4a8b0c=0x0,_0xe21ac4=events[_0xd6f0('0x5')];_0x4a8b0c<_0xe21ac4;_0x4a8b0c++){var _0x8b89a9=events[_0x4a8b0c];var _0x1a48a0=createListener('chatQueue:'+_0x8b89a9,_0x2d2ce6);ChatQueueEvents['on'](_0x8b89a9,_0x1a48a0);}};
\ No newline at end of file
+var _0xbec5=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','save','update'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xbec5,0xe5));var _0x5bec=function(_0x29632e,_0x5ecba4){_0x29632e=_0x29632e-0x0;var _0x426e04=_0xbec5[_0x29632e];return _0x426e04;};'use strict';var ChatQueueEvents=require(_0x5bec('0x0'));var events=[_0x5bec('0x1'),'remove',_0x5bec('0x2')];function createListener(_0x38c81a,_0x276b9e){return function(_0x3859a1){_0x276b9e[_0x5bec('0x3')](_0x38c81a,_0x3859a1);};}function removeListener(_0x4ee982,_0x1f8933){return function(){ChatQueueEvents[_0x5bec('0x4')](_0x4ee982,_0x1f8933);};}exports[_0x5bec('0x5')]=function(_0x4aaac6){for(var _0x3ed67a=0x0,_0x28a427=events[_0x5bec('0x6')];_0x3ed67a<_0x28a427;_0x3ed67a++){var _0x406e65=events[_0x3ed67a];var _0x43d96e=createListener(_0x5bec('0x7')+_0x406e65,_0x4aaac6);ChatQueueEvents['on'](_0x406e65,_0x43d96e);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index d8195f8..b3b0f6f 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3e74,0x175));var _0x43e7=function(_0x380682,_0x5f5bb8){_0x380682=_0x380682-0x0;var _0x1800c2=_0x3e74[_0x380682];return _0x1800c2;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
+var _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(_0x2c3919,_0x46d781){var _0x11f383=function(_0x17611c){while(--_0x17611c){_0x2c3919['push'](_0x2c3919['shift']());}};_0x11f383(++_0x46d781);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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 7e4af23..75a1381 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 _0x1cf4=['STRING','DATE','moment'];(function(_0xc56144,_0x5d23ef){var _0x1252de=function(_0x2373c0){while(--_0x2373c0){_0xc56144['push'](_0xc56144['shift']());}};_0x1252de(++_0x5d23ef);}(_0x1cf4,0xbf));var _0x41cf=function(_0x3b3767,_0x22856b){_0x3b3767=_0x3b3767-0x0;var _0x2b3863=_0x1cf4[_0x3b3767];return _0x2b3863;};'use strict';var moment=require(_0x41cf('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x41cf('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x41cf('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x41cf('0x2')]},'acceptAt':{'type':Sequelize[_0x41cf('0x2')]},'exitAt':{'type':Sequelize[_0x41cf('0x2')]},'reason':{'type':Sequelize[_0x41cf('0x1')]}};
\ No newline at end of file
+var _0x687d=['DATE','moment','sequelize','exports','STRING'];(function(_0x2e0bd8,_0x11e41d){var _0x5cb4b5=function(_0x416739){while(--_0x416739){_0x2e0bd8['push'](_0x2e0bd8['shift']());}};_0x5cb4b5(++_0x11e41d);}(_0x687d,0x187));var _0xd687=function(_0x426b48,_0x595c31){_0x426b48=_0x426b48-0x0;var _0x31004d=_0x687d[_0x426b48];return _0x31004d;};'use strict';var moment=require(_0xd687('0x0'));var Sequelize=require(_0xd687('0x1'));module[_0xd687('0x2')]={'uniqueid':{'type':Sequelize[_0xd687('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd687('0x4')]},'acceptAt':{'type':Sequelize[_0xd687('0x4')]},'exitAt':{'type':Sequelize[_0xd687('0x4')]},'reason':{'type':Sequelize[_0xd687('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 372651a..f5437c2 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 _0x6c14=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','keys','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1a1bf9,_0x30ded7){var _0x55e193=function(_0xbe5ee5){while(--_0xbe5ee5){_0x1a1bf9['push'](_0x1a1bf9['shift']());}};_0x55e193(++_0x30ded7);}(_0x6c14,0xd1));var _0x46c1=function(_0x263257,_0x30d269){_0x263257=_0x263257-0x0;var _0x32516d=_0x6c14[_0x263257];return _0x32516d;};'use strict';var emlformat=require(_0x46c1('0x0'));var rimraf=require(_0x46c1('0x1'));var zipdir=require(_0x46c1('0x2'));var jsonpatch=require(_0x46c1('0x3'));var rp=require(_0x46c1('0x4'));var moment=require('moment');var BPromise=require(_0x46c1('0x5'));var Mustache=require(_0x46c1('0x6'));var util=require(_0x46c1('0x7'));var path=require('path');var sox=require(_0x46c1('0x8'));var csv=require(_0x46c1('0x9'));var ejs=require(_0x46c1('0xa'));var fs=require('fs');var fs_extra=require(_0x46c1('0xb'));var _=require(_0x46c1('0xc'));var squel=require(_0x46c1('0xd'));var crypto=require(_0x46c1('0xe'));var jsforce=require(_0x46c1('0xf'));var deskjs=require(_0x46c1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x46c1('0x11'));var Papa=require(_0x46c1('0x12'));var Redis=require(_0x46c1('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x46c1('0x14'));var as=require(_0x46c1('0x15'));var hardwareService=require(_0x46c1('0x16'));var logger=require('../../config/logger')(_0x46c1('0x17'));var utils=require(_0x46c1('0x18'));var config=require(_0x46c1('0x19'));var licenseUtil=require(_0x46c1('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c8a7c,_0x24626f){_0x24626f=_0x24626f||0xcc;return function(_0x52af54){if(_0x52af54){return _0x2c8a7c['sendStatus'](_0x24626f);}return _0x2c8a7c[_0x46c1('0x1b')](_0x24626f)[_0x46c1('0x1c')]();};}function respondWithResult(_0xa10462,_0x228380){_0x228380=_0x228380||0xc8;return function(_0x12437d){if(_0x12437d){return _0xa10462['status'](_0x228380)[_0x46c1('0x1d')](_0x12437d);}};}function respondWithFilteredResult(_0x3033a6,_0x221905){return function(_0x414a3f){if(_0x414a3f){var _0x3ce709=typeof _0x221905['offset']==='undefined'&&typeof _0x221905[_0x46c1('0x1e')]===_0x46c1('0x1f');var _0xad4a1b=_0x414a3f[_0x46c1('0x20')];var _0x466899=_0x3ce709?0x0:_0x221905[_0x46c1('0x21')];var _0x2ec920=_0x3ce709?_0x414a3f['count']:_0x221905[_0x46c1('0x21')]+_0x221905[_0x46c1('0x1e')];var _0x537a9d;if(_0x2ec920>=_0xad4a1b){_0x2ec920=_0xad4a1b;_0x537a9d=0xc8;}else{_0x537a9d=0xce;}_0x3033a6['status'](_0x537a9d);return _0x3033a6[_0x46c1('0x22')]('Content-Range',_0x466899+'-'+_0x2ec920+'/'+_0xad4a1b)['json'](_0x414a3f);}return null;};}function patchUpdates(_0x301c0c){return function(_0xfc1f36){try{jsonpatch[_0x46c1('0x23')](_0xfc1f36,_0x301c0c,!![]);}catch(_0x261c6d){return BPromise[_0x46c1('0x24')](_0x261c6d);}return _0xfc1f36[_0x46c1('0x25')]();};}function saveUpdates(_0x3768e9,_0x21e02d){return function(_0x3db7b1){if(_0x3db7b1){return _0x3db7b1[_0x46c1('0x26')](_0x3768e9)[_0x46c1('0x27')](function(_0x217c2c){return _0x217c2c;});}return null;};}function removeEntity(_0x12ce45,_0x712eb8){return function(_0x37fa8c){if(_0x37fa8c){return _0x37fa8c[_0x46c1('0x28')]()[_0x46c1('0x27')](function(){_0x12ce45[_0x46c1('0x1b')](0xcc)[_0x46c1('0x1c')]();});}};}function handleEntityNotFound(_0x361c66,_0x4209e6){return function(_0x2924b8){if(!_0x2924b8){_0x361c66[_0x46c1('0x29')](0x194);}return _0x2924b8;};}function handleError(_0x552932,_0x4aacea){_0x4aacea=_0x4aacea||0x1f4;return function(_0xa8b66e){logger[_0x46c1('0x2a')](_0xa8b66e['stack']);if(_0xa8b66e[_0x46c1('0x2b')]){delete _0xa8b66e[_0x46c1('0x2b')];}_0x552932[_0x46c1('0x1b')](_0x4aacea)[_0x46c1('0x2c')](_0xa8b66e);};}exports[_0x46c1('0x2d')]=function(_0x3fdaea,_0x4d646d){var _0x114048={},_0x4475f7={},_0x32f553={'count':0x0,'rows':[]};var _0x187ecf=_[_0x46c1('0x2e')](db[_0x46c1('0x2f')][_0x46c1('0x30')],function(_0x55b4e6){return{'name':_0x55b4e6[_0x46c1('0x31')],'type':_0x55b4e6['type'][_0x46c1('0x32')]};});_0x4475f7[_0x46c1('0x33')]=_[_0x46c1('0x2e')](_0x187ecf,_0x46c1('0x2b'));_0x4475f7['query']=_['keys'](_0x3fdaea[_0x46c1('0x34')]);_0x4475f7[_0x46c1('0x35')]=_['intersection'](_0x4475f7[_0x46c1('0x33')],_0x4475f7[_0x46c1('0x34')]);_0x114048[_0x46c1('0x36')]=_[_0x46c1('0x37')](_0x4475f7['model'],qs[_0x46c1('0x38')](_0x3fdaea[_0x46c1('0x34')]['fields']));_0x114048[_0x46c1('0x36')]=_0x114048['attributes'][_0x46c1('0x39')]?_0x114048[_0x46c1('0x36')]:_0x4475f7[_0x46c1('0x33')];if(!_0x3fdaea[_0x46c1('0x34')][_0x46c1('0x3a')](_0x46c1('0x3b'))){_0x114048['limit']=qs['limit'](_0x3fdaea[_0x46c1('0x34')]['limit']);_0x114048[_0x46c1('0x21')]=qs['offset'](_0x3fdaea['query'][_0x46c1('0x21')]);}_0x114048[_0x46c1('0x3c')]=qs[_0x46c1('0x3d')](_0x3fdaea['query'][_0x46c1('0x3d')]);_0x114048[_0x46c1('0x3e')]=qs[_0x46c1('0x35')](_['pick'](_0x3fdaea[_0x46c1('0x34')],_0x4475f7[_0x46c1('0x35')]),_0x187ecf);if(_0x3fdaea[_0x46c1('0x34')][_0x46c1('0x3f')]){_0x114048[_0x46c1('0x3e')]=_[_0x46c1('0x40')](_0x114048[_0x46c1('0x3e')],{'$or':_[_0x46c1('0x2e')](_0x187ecf,function(_0x114ed3){if(_0x114ed3['type']!==_0x46c1('0x41')){var _0x3db8f1={};_0x3db8f1[_0x114ed3[_0x46c1('0x2b')]]={'$like':'%'+_0x3fdaea[_0x46c1('0x34')][_0x46c1('0x3f')]+'%'};return _0x3db8f1;}})});}_0x114048=_[_0x46c1('0x40')]({},_0x114048,_0x3fdaea['options']);var _0x102f12={'where':_0x114048['where']};return db[_0x46c1('0x2f')][_0x46c1('0x20')](_0x102f12)[_0x46c1('0x27')](function(_0x4c237b){_0x32f553[_0x46c1('0x20')]=_0x4c237b;if(_0x3fdaea['query'][_0x46c1('0x42')]){_0x114048[_0x46c1('0x43')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x114048);})[_0x46c1('0x27')](function(_0x520f5d){_0x32f553[_0x46c1('0x44')]=_0x520f5d;return _0x32f553;})[_0x46c1('0x27')](respondWithFilteredResult(_0x4d646d,_0x114048))[_0x46c1('0x45')](handleError(_0x4d646d,null));};exports['show']=function(_0x1228d8,_0x4571ed){var _0x5bc21c={'raw':!![],'where':{'id':_0x1228d8[_0x46c1('0x46')]['id']}},_0x171db5={};_0x171db5['model']=_['keys'](db[_0x46c1('0x2f')]['rawAttributes']);_0x171db5[_0x46c1('0x34')]=_[_0x46c1('0x47')](_0x1228d8[_0x46c1('0x34')]);_0x171db5[_0x46c1('0x35')]=_['intersection'](_0x171db5['model'],_0x171db5[_0x46c1('0x34')]);_0x5bc21c[_0x46c1('0x36')]=_[_0x46c1('0x37')](_0x171db5[_0x46c1('0x33')],qs['fields'](_0x1228d8[_0x46c1('0x34')]['fields']));_0x5bc21c['attributes']=_0x5bc21c[_0x46c1('0x36')][_0x46c1('0x39')]?_0x5bc21c['attributes']:_0x171db5[_0x46c1('0x33')];if(_0x1228d8[_0x46c1('0x34')][_0x46c1('0x42')]){_0x5bc21c[_0x46c1('0x43')]=[{'all':!![]}];}_0x5bc21c=_[_0x46c1('0x40')]({},_0x5bc21c,_0x1228d8[_0x46c1('0x48')]);return db['ChatQueueReport'][_0x46c1('0x49')](_0x5bc21c)[_0x46c1('0x27')](handleEntityNotFound(_0x4571ed,null))[_0x46c1('0x27')](respondWithResult(_0x4571ed,null))[_0x46c1('0x45')](handleError(_0x4571ed,null));};exports['create']=function(_0x362157,_0x3e3d7e){return db['ChatQueueReport'][_0x46c1('0x4a')](_0x362157[_0x46c1('0x4b')],{})['then'](respondWithResult(_0x3e3d7e,0xc9))['catch'](handleError(_0x3e3d7e,null));};exports[_0x46c1('0x26')]=function(_0x40aae9,_0x1911e7){if(_0x40aae9['body']['id']){delete _0x40aae9[_0x46c1('0x4b')]['id'];}return db[_0x46c1('0x2f')][_0x46c1('0x49')]({'where':{'id':_0x40aae9['params']['id']}})[_0x46c1('0x27')](handleEntityNotFound(_0x1911e7,null))[_0x46c1('0x27')](saveUpdates(_0x40aae9[_0x46c1('0x4b')],null))[_0x46c1('0x27')](respondWithResult(_0x1911e7,null))[_0x46c1('0x45')](handleError(_0x1911e7,null));};exports[_0x46c1('0x28')]=function(_0x39de88,_0x3194e6){return db[_0x46c1('0x2f')][_0x46c1('0x49')]({'where':{'id':_0x39de88[_0x46c1('0x46')]['id']}})[_0x46c1('0x27')](handleEntityNotFound(_0x3194e6,null))[_0x46c1('0x27')](removeEntity(_0x3194e6,null))[_0x46c1('0x45')](handleError(_0x3194e6,null));};exports[_0x46c1('0x4c')]=function(_0x359425,_0x2a53cb){return db['ChatQueueReport'][_0x46c1('0x4c')]()[_0x46c1('0x27')](respondWithResult(_0x2a53cb,null))[_0x46c1('0x45')](handleError(_0x2a53cb,null));};
\ No newline at end of file
+var _0x7409=['then','destroy','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','ChatQueueReport','includeAll','include','findAll','rows','catch','merge','options','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','update'];(function(_0x39d35c,_0x338b41){var _0x35d0ed=function(_0x41c62e){while(--_0x41c62e){_0x39d35c['push'](_0x39d35c['shift']());}};_0x35d0ed(++_0x338b41);}(_0x7409,0x6e));var _0x9740=function(_0x5938c8,_0x4a9ca){_0x5938c8=_0x5938c8-0x0;var _0x4353f7=_0x7409[_0x5938c8];return _0x4353f7;};'use strict';var emlformat=require(_0x9740('0x0'));var rimraf=require(_0x9740('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9740('0x2'));var rp=require(_0x9740('0x3'));var moment=require(_0x9740('0x4'));var BPromise=require(_0x9740('0x5'));var Mustache=require(_0x9740('0x6'));var util=require(_0x9740('0x7'));var path=require(_0x9740('0x8'));var sox=require(_0x9740('0x9'));var csv=require(_0x9740('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9740('0xb'));var _=require(_0x9740('0xc'));var squel=require(_0x9740('0xd'));var crypto=require('crypto');var jsforce=require(_0x9740('0xe'));var deskjs=require(_0x9740('0xf'));var toCsv=require(_0x9740('0xa'));var querystring=require('querystring');var Papa=require(_0x9740('0x10'));var Redis=require('ioredis');var authService=require(_0x9740('0x11'));var qs=require(_0x9740('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9740('0x13'));var utils=require(_0x9740('0x14'));var config=require(_0x9740('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5263b3,_0x5a6773){_0x5a6773=_0x5a6773||0xcc;return function(_0x4adaae){if(_0x4adaae){return _0x5263b3['sendStatus'](_0x5a6773);}return _0x5263b3['status'](_0x5a6773)[_0x9740('0x16')]();};}function respondWithResult(_0x4d50ad,_0x495051){_0x495051=_0x495051||0xc8;return function(_0x12f130){if(_0x12f130){return _0x4d50ad['status'](_0x495051)[_0x9740('0x17')](_0x12f130);}};}function respondWithFilteredResult(_0x1d4aa8,_0x3c20ec){return function(_0x217a52){if(_0x217a52){var _0x480af9=typeof _0x3c20ec[_0x9740('0x18')]==='undefined'&&typeof _0x3c20ec[_0x9740('0x19')]===_0x9740('0x1a');var _0x8bf9df=_0x217a52[_0x9740('0x1b')];var _0x22843a=_0x480af9?0x0:_0x3c20ec[_0x9740('0x18')];var _0xd5d590=_0x480af9?_0x217a52[_0x9740('0x1b')]:_0x3c20ec[_0x9740('0x18')]+_0x3c20ec['limit'];var _0x28e655;if(_0xd5d590>=_0x8bf9df){_0xd5d590=_0x8bf9df;_0x28e655=0xc8;}else{_0x28e655=0xce;}_0x1d4aa8[_0x9740('0x1c')](_0x28e655);return _0x1d4aa8[_0x9740('0x1d')](_0x9740('0x1e'),_0x22843a+'-'+_0xd5d590+'/'+_0x8bf9df)[_0x9740('0x17')](_0x217a52);}return null;};}function patchUpdates(_0xdf62fc){return function(_0x3a785c){try{jsonpatch[_0x9740('0x1f')](_0x3a785c,_0xdf62fc,!![]);}catch(_0x56766c){return BPromise[_0x9740('0x20')](_0x56766c);}return _0x3a785c['save']();};}function saveUpdates(_0x1f8a78,_0x46d768){return function(_0x1af88e){if(_0x1af88e){return _0x1af88e[_0x9740('0x21')](_0x1f8a78)[_0x9740('0x22')](function(_0x34af43){return _0x34af43;});}return null;};}function removeEntity(_0x4e4627,_0x2550f2){return function(_0x192ab9){if(_0x192ab9){return _0x192ab9[_0x9740('0x23')]()[_0x9740('0x22')](function(){_0x4e4627[_0x9740('0x1c')](0xcc)[_0x9740('0x16')]();});}};}function handleEntityNotFound(_0x15aa2f,_0x278510){return function(_0x11ee90){if(!_0x11ee90){_0x15aa2f['sendStatus'](0x194);}return _0x11ee90;};}function handleError(_0xfb0753,_0x577323){_0x577323=_0x577323||0x1f4;return function(_0x4e5074){logger['error'](_0x4e5074['stack']);if(_0x4e5074[_0x9740('0x24')]){delete _0x4e5074[_0x9740('0x24')];}_0xfb0753[_0x9740('0x1c')](_0x577323)['send'](_0x4e5074);};}exports[_0x9740('0x25')]=function(_0x353630,_0x311e1b){var _0x4483a3={},_0x4cdccd={},_0x3bfa1f={'count':0x0,'rows':[]};var _0x3c826d=_[_0x9740('0x26')](db['ChatQueueReport'][_0x9740('0x27')],function(_0x3f6800){return{'name':_0x3f6800[_0x9740('0x28')],'type':_0x3f6800[_0x9740('0x29')][_0x9740('0x2a')]};});_0x4cdccd[_0x9740('0x2b')]=_[_0x9740('0x26')](_0x3c826d,_0x9740('0x24'));_0x4cdccd[_0x9740('0x2c')]=_[_0x9740('0x2d')](_0x353630['query']);_0x4cdccd[_0x9740('0x2e')]=_[_0x9740('0x2f')](_0x4cdccd[_0x9740('0x2b')],_0x4cdccd[_0x9740('0x2c')]);_0x4483a3[_0x9740('0x30')]=_[_0x9740('0x2f')](_0x4cdccd['model'],qs[_0x9740('0x31')](_0x353630['query']['fields']));_0x4483a3[_0x9740('0x30')]=_0x4483a3[_0x9740('0x30')][_0x9740('0x32')]?_0x4483a3[_0x9740('0x30')]:_0x4cdccd[_0x9740('0x2b')];if(!_0x353630['query'][_0x9740('0x33')](_0x9740('0x34'))){_0x4483a3[_0x9740('0x19')]=qs[_0x9740('0x19')](_0x353630[_0x9740('0x2c')][_0x9740('0x19')]);_0x4483a3[_0x9740('0x18')]=qs[_0x9740('0x18')](_0x353630[_0x9740('0x2c')][_0x9740('0x18')]);}_0x4483a3[_0x9740('0x35')]=qs[_0x9740('0x36')](_0x353630[_0x9740('0x2c')][_0x9740('0x36')]);_0x4483a3[_0x9740('0x37')]=qs[_0x9740('0x2e')](_[_0x9740('0x38')](_0x353630[_0x9740('0x2c')],_0x4cdccd[_0x9740('0x2e')]),_0x3c826d);if(_0x353630[_0x9740('0x2c')][_0x9740('0x39')]){_0x4483a3[_0x9740('0x37')]=_['merge'](_0x4483a3[_0x9740('0x37')],{'$or':_['map'](_0x3c826d,function(_0x221ff5){if(_0x221ff5[_0x9740('0x29')]!==_0x9740('0x3a')){var _0x3612a1={};_0x3612a1[_0x221ff5[_0x9740('0x24')]]={'$like':'%'+_0x353630[_0x9740('0x2c')][_0x9740('0x39')]+'%'};return _0x3612a1;}})});}_0x4483a3=_['merge']({},_0x4483a3,_0x353630['options']);var _0x54018a={'where':_0x4483a3[_0x9740('0x37')]};return db[_0x9740('0x3b')][_0x9740('0x1b')](_0x54018a)[_0x9740('0x22')](function(_0x38b1d9){_0x3bfa1f['count']=_0x38b1d9;if(_0x353630[_0x9740('0x2c')][_0x9740('0x3c')]){_0x4483a3[_0x9740('0x3d')]=[{'all':!![]}];}return db[_0x9740('0x3b')][_0x9740('0x3e')](_0x4483a3);})[_0x9740('0x22')](function(_0x4c5860){_0x3bfa1f[_0x9740('0x3f')]=_0x4c5860;return _0x3bfa1f;})[_0x9740('0x22')](respondWithFilteredResult(_0x311e1b,_0x4483a3))[_0x9740('0x40')](handleError(_0x311e1b,null));};exports['show']=function(_0x536b61,_0x62bf4e){var _0x199cd3={'raw':!![],'where':{'id':_0x536b61['params']['id']}},_0xcd85b3={};_0xcd85b3[_0x9740('0x2b')]=_[_0x9740('0x2d')](db[_0x9740('0x3b')]['rawAttributes']);_0xcd85b3[_0x9740('0x2c')]=_[_0x9740('0x2d')](_0x536b61[_0x9740('0x2c')]);_0xcd85b3[_0x9740('0x2e')]=_[_0x9740('0x2f')](_0xcd85b3['model'],_0xcd85b3[_0x9740('0x2c')]);_0x199cd3[_0x9740('0x30')]=_[_0x9740('0x2f')](_0xcd85b3['model'],qs[_0x9740('0x31')](_0x536b61[_0x9740('0x2c')]['fields']));_0x199cd3[_0x9740('0x30')]=_0x199cd3[_0x9740('0x30')][_0x9740('0x32')]?_0x199cd3[_0x9740('0x30')]:_0xcd85b3['model'];if(_0x536b61[_0x9740('0x2c')][_0x9740('0x3c')]){_0x199cd3[_0x9740('0x3d')]=[{'all':!![]}];}_0x199cd3=_[_0x9740('0x41')]({},_0x199cd3,_0x536b61[_0x9740('0x42')]);return db[_0x9740('0x3b')]['find'](_0x199cd3)[_0x9740('0x22')](handleEntityNotFound(_0x62bf4e,null))[_0x9740('0x22')](respondWithResult(_0x62bf4e,null))[_0x9740('0x40')](handleError(_0x62bf4e,null));};exports[_0x9740('0x43')]=function(_0x53e84b,_0x16d114){return db[_0x9740('0x3b')]['create'](_0x53e84b[_0x9740('0x44')],{})[_0x9740('0x22')](respondWithResult(_0x16d114,0xc9))[_0x9740('0x40')](handleError(_0x16d114,null));};exports['update']=function(_0xac3ed,_0x45df52){if(_0xac3ed[_0x9740('0x44')]['id']){delete _0xac3ed[_0x9740('0x44')]['id'];}return db[_0x9740('0x3b')][_0x9740('0x45')]({'where':{'id':_0xac3ed['params']['id']}})[_0x9740('0x22')](handleEntityNotFound(_0x45df52,null))[_0x9740('0x22')](saveUpdates(_0xac3ed[_0x9740('0x44')],null))[_0x9740('0x22')](respondWithResult(_0x45df52,null))['catch'](handleError(_0x45df52,null));};exports[_0x9740('0x23')]=function(_0x33e4e2,_0x41f7cb){return db['ChatQueueReport']['find']({'where':{'id':_0x33e4e2[_0x9740('0x46')]['id']}})[_0x9740('0x22')](handleEntityNotFound(_0x41f7cb,null))[_0x9740('0x22')](removeEntity(_0x41f7cb,null))['catch'](handleError(_0x41f7cb,null));};exports[_0x9740('0x47')]=function(_0x4f4c0f,_0x209d76){return db[_0x9740('0x3b')][_0x9740('0x47')]()[_0x9740('0x22')](respondWithResult(_0x209d76,null))[_0x9740('0x40')](handleError(_0x209d76,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index dd49790..13c8f8c 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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x2384bb,_0x12f81b){var _0x3f2bac=function(_0x337ece){while(--_0x337ece){_0x2384bb['push'](_0x2384bb['shift']());}};_0x3f2bac(++_0x12f81b);}(_0xb10b,0x12a));var _0xbb10=function(_0x1045ef,_0xfea295){_0x1045ef=_0x1045ef-0x0;var _0x3e99f2=_0xb10b[_0x1045ef];return _0x3e99f2;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x268979,_0x1fce42){var _0x5df270=function(_0x10b61e){while(--_0x10b61e){_0x268979['push'](_0x268979['shift']());}};_0x5df270(++_0x1fce42);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index aeb7f5f..4f56cc8 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 _0xdba6=['CreateChatQueueReport','ChatQueueReport','create','body','options','raw','stringify','UpdateChatQueueReport','update','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','ChatQueueReport,\x20%s,\x20%s','message','result','catch'];(function(_0x637194,_0x430b89){var _0x330895=function(_0x2e0c24){while(--_0x2e0c24){_0x637194['push'](_0x637194['shift']());}};_0x330895(++_0x430b89);}(_0xdba6,0x169));var _0x6dba=function(_0x12c27a,_0x501e9a){_0x12c27a=_0x12c27a-0x0;var _0x2d5d1c=_0xdba6[_0x12c27a];return _0x2d5d1c;};'use strict';var _=require(_0x6dba('0x0'));var util=require(_0x6dba('0x1'));var moment=require(_0x6dba('0x2'));var BPromise=require(_0x6dba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6dba('0x4'));var db=require(_0x6dba('0x5'))['db'];var utils=require(_0x6dba('0x6'));var logger=require(_0x6dba('0x7'))(_0x6dba('0x8'));var config=require('../../config/environment');var jayson=require(_0x6dba('0x9'));var client=jayson[_0x6dba('0xa')][_0x6dba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2bfeb0,_0x975b58,_0x4bfecb){return new BPromise(function(_0x9c0e99,_0x198453){return client[_0x6dba('0xc')](_0x2bfeb0,_0x4bfecb)[_0x6dba('0xd')](function(_0x18cfb3){logger[_0x6dba('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x975b58,_0x6dba('0xf'));logger[_0x6dba('0x10')](_0x6dba('0x11'),_0x975b58,_0x6dba('0xf'),JSON['stringify'](_0x18cfb3));if(_0x18cfb3['error']){if(_0x18cfb3[_0x6dba('0x12')]['code']===0x1f4){logger[_0x6dba('0x12')](_0x6dba('0x13'),_0x975b58,_0x18cfb3[_0x6dba('0x12')][_0x6dba('0x14')]);return _0x198453(_0x18cfb3[_0x6dba('0x12')]['message']);}logger[_0x6dba('0x12')](_0x6dba('0x13'),_0x975b58,_0x18cfb3[_0x6dba('0x12')][_0x6dba('0x14')]);return _0x9c0e99(_0x18cfb3[_0x6dba('0x12')][_0x6dba('0x14')]);}else{logger[_0x6dba('0xe')](_0x6dba('0x13'),_0x975b58,_0x6dba('0xf'));_0x9c0e99(_0x18cfb3[_0x6dba('0x15')][_0x6dba('0x14')]);}})[_0x6dba('0x16')](function(_0x28d9a6){logger[_0x6dba('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x975b58,_0x28d9a6);_0x198453(_0x28d9a6);});});}exports[_0x6dba('0x17')]=function(_0x6a4787){var _0x40d0a2=this;return new Promise(function(_0x1da25c,_0x3e06a3){return db[_0x6dba('0x18')][_0x6dba('0x19')](_0x6a4787[_0x6dba('0x1a')],{'raw':_0x6a4787[_0x6dba('0x1b')]?_0x6a4787['options'][_0x6dba('0x1c')]===undefined?!![]:![]:!![]})[_0x6dba('0xd')](function(_0x278f39){logger[_0x6dba('0xe')](_0x6dba('0x17'),_0x6a4787);logger[_0x6dba('0x10')](_0x6dba('0x17'),_0x6a4787,JSON[_0x6dba('0x1d')](_0x278f39));_0x1da25c(_0x278f39);})[_0x6dba('0x16')](function(_0x1cb8cb){logger[_0x6dba('0x12')](_0x6dba('0x17'),_0x1cb8cb[_0x6dba('0x14')],_0x6a4787);_0x3e06a3(_0x40d0a2[_0x6dba('0x12')](0x1f4,_0x1cb8cb[_0x6dba('0x14')]));});});};exports[_0x6dba('0x1e')]=function(_0x247d46){var _0x1ae37c=this;return new Promise(function(_0x105a78,_0x10fabc){return db[_0x6dba('0x18')][_0x6dba('0x1f')](_0x247d46[_0x6dba('0x1a')],{'raw':_0x247d46['options']?_0x247d46['options'][_0x6dba('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x247d46[_0x6dba('0x1b')]?_0x247d46[_0x6dba('0x1b')]['where']||null:null,'attributes':_0x247d46[_0x6dba('0x1b')]?_0x247d46['options']['attributes']||null:null,'limit':_0x247d46[_0x6dba('0x1b')]?_0x247d46[_0x6dba('0x1b')]['limit']||null:null})[_0x6dba('0xd')](function(_0x2e803f){logger[_0x6dba('0xe')](_0x6dba('0x1e'),_0x247d46);logger[_0x6dba('0x10')](_0x6dba('0x1e'),_0x247d46,JSON[_0x6dba('0x1d')](_0x2e803f));_0x105a78(_0x2e803f);})[_0x6dba('0x16')](function(_0xb9339f){logger[_0x6dba('0x12')](_0x6dba('0x1e'),_0xb9339f[_0x6dba('0x14')],_0x247d46);_0x10fabc(_0x1ae37c[_0x6dba('0x12')](0x1f4,_0xb9339f[_0x6dba('0x14')]));});});};
\ No newline at end of file
+var _0x6691=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ChatQueueReport','create','body','options','CreateChatQueueReport','UpdateChatQueueReport','update','raw'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x6691,0x134));var _0x1669=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x6691[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x1669('0x0'));var util=require(_0x1669('0x1'));var moment=require(_0x1669('0x2'));var BPromise=require(_0x1669('0x3'));var rs=require(_0x1669('0x4'));var fs=require('fs');var Redis=require(_0x1669('0x5'));var db=require(_0x1669('0x6'))['db'];var utils=require(_0x1669('0x7'));var logger=require('../../config/logger')(_0x1669('0x8'));var config=require(_0x1669('0x9'));var jayson=require(_0x1669('0xa'));var client=jayson[_0x1669('0xb')][_0x1669('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1810e5,_0x1e3038,_0x40a41b){return new BPromise(function(_0x5c8145,_0x28a69e){return client[_0x1669('0xd')](_0x1810e5,_0x40a41b)[_0x1669('0xe')](function(_0x4be0c7){logger[_0x1669('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x1e3038,'request\x20sent');logger['debug'](_0x1669('0x10'),_0x1e3038,_0x1669('0x11'),JSON[_0x1669('0x12')](_0x4be0c7));if(_0x4be0c7[_0x1669('0x13')]){if(_0x4be0c7[_0x1669('0x13')][_0x1669('0x14')]===0x1f4){logger[_0x1669('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x1e3038,_0x4be0c7[_0x1669('0x13')]['message']);return _0x28a69e(_0x4be0c7[_0x1669('0x13')][_0x1669('0x15')]);}logger[_0x1669('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x1e3038,_0x4be0c7['error'][_0x1669('0x15')]);return _0x5c8145(_0x4be0c7[_0x1669('0x13')][_0x1669('0x15')]);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x1e3038,'request\x20sent');_0x5c8145(_0x4be0c7[_0x1669('0x16')][_0x1669('0x15')]);}})[_0x1669('0x17')](function(_0x1038bb){logger[_0x1669('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x1e3038,_0x1038bb);_0x28a69e(_0x1038bb);});});}exports['CreateChatQueueReport']=function(_0x18434){var _0x3c6533=this;return new Promise(function(_0x335c4c,_0x4837b8){return db[_0x1669('0x18')][_0x1669('0x19')](_0x18434[_0x1669('0x1a')],{'raw':_0x18434[_0x1669('0x1b')]?_0x18434[_0x1669('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x1669('0xe')](function(_0x14a90c){logger[_0x1669('0xf')](_0x1669('0x1c'),_0x18434);logger['debug'](_0x1669('0x1c'),_0x18434,JSON[_0x1669('0x12')](_0x14a90c));_0x335c4c(_0x14a90c);})[_0x1669('0x17')](function(_0x217da3){logger[_0x1669('0x13')](_0x1669('0x1c'),_0x217da3[_0x1669('0x15')],_0x18434);_0x4837b8(_0x3c6533['error'](0x1f4,_0x217da3[_0x1669('0x15')]));});});};exports[_0x1669('0x1d')]=function(_0x5328f7){var _0x482186=this;return new Promise(function(_0xedd4a3,_0x63e3eb){return db['ChatQueueReport'][_0x1669('0x1e')](_0x5328f7['body'],{'raw':_0x5328f7[_0x1669('0x1b')]?_0x5328f7['options'][_0x1669('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5328f7[_0x1669('0x1b')]?_0x5328f7[_0x1669('0x1b')]['where']||null:null,'attributes':_0x5328f7[_0x1669('0x1b')]?_0x5328f7[_0x1669('0x1b')][_0x1669('0x20')]||null:null,'limit':_0x5328f7[_0x1669('0x1b')]?_0x5328f7[_0x1669('0x1b')][_0x1669('0x21')]||null:null})[_0x1669('0xe')](function(_0x5eb952){logger[_0x1669('0xf')](_0x1669('0x1d'),_0x5328f7);logger['debug'](_0x1669('0x1d'),_0x5328f7,JSON['stringify'](_0x5eb952));_0xedd4a3(_0x5eb952);})['catch'](function(_0x195cc3){logger[_0x1669('0x13')](_0x1669('0x1d'),_0x195cc3['message'],_0x5328f7);_0x63e3eb(_0x482186[_0x1669('0x13')](0x1f4,_0x195cc3[_0x1669('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 4f889f1..cbeaa17 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 _0x9881=['./chatQueueReport.controller','get','isAuthenticated','/describe','/:id','show','put','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9881,0xf4));var _0x1988=function(_0x3877f5,_0xeaac42){_0x3877f5=_0x3877f5-0x0;var _0x249e7f=_0x9881[_0x3877f5];return _0x249e7f;};'use strict';var multer=require(_0x1988('0x0'));var util=require('util');var path=require(_0x1988('0x1'));var timeout=require(_0x1988('0x2'));var express=require(_0x1988('0x3'));var router=express['Router']();var fs_extra=require(_0x1988('0x4'));var auth=require(_0x1988('0x5'));var interaction=require(_0x1988('0x6'));var config=require(_0x1988('0x7'));var controller=require(_0x1988('0x8'));router[_0x1988('0x9')]('/',auth[_0x1988('0xa')](),controller['index']);router[_0x1988('0x9')](_0x1988('0xb'),auth[_0x1988('0xa')](),controller['describe']);router[_0x1988('0x9')](_0x1988('0xc'),auth['isAuthenticated'](),controller[_0x1988('0xd')]);router['post']('/',auth[_0x1988('0xa')](),controller['create']);router[_0x1988('0xe')]('/:id',auth[_0x1988('0xa')](),controller[_0x1988('0xf')]);router['delete'](_0x1988('0xc'),auth[_0x1988('0xa')](),controller[_0x1988('0x10')]);module[_0x1988('0x11')]=router;
\ No newline at end of file
+var _0x67c7=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','update','delete','multer','util','path','connect-timeout'];(function(_0x90cba6,_0x3c97d3){var _0x500b97=function(_0x2b6263){while(--_0x2b6263){_0x90cba6['push'](_0x90cba6['shift']());}};_0x500b97(++_0x3c97d3);}(_0x67c7,0x128));var _0x767c=function(_0x585199,_0x10d223){_0x585199=_0x585199-0x0;var _0x4f5eaf=_0x67c7[_0x585199];return _0x4f5eaf;};'use strict';var multer=require(_0x767c('0x0'));var util=require(_0x767c('0x1'));var path=require(_0x767c('0x2'));var timeout=require(_0x767c('0x3'));var express=require(_0x767c('0x4'));var router=express[_0x767c('0x5')]();var fs_extra=require(_0x767c('0x6'));var auth=require(_0x767c('0x7'));var interaction=require(_0x767c('0x8'));var config=require(_0x767c('0x9'));var controller=require(_0x767c('0xa'));router[_0x767c('0xb')]('/',auth[_0x767c('0xc')](),controller[_0x767c('0xd')]);router[_0x767c('0xb')](_0x767c('0xe'),auth['isAuthenticated'](),controller[_0x767c('0xf')]);router['get'](_0x767c('0x10'),auth[_0x767c('0xc')](),controller[_0x767c('0x11')]);router['post']('/',auth[_0x767c('0xc')](),controller['create']);router['put'](_0x767c('0x10'),auth['isAuthenticated'](),controller[_0x767c('0x12')]);router[_0x767c('0x13')](_0x767c('0x10'),auth[_0x767c('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 47a0fb7..a074e6d 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x1f5887,_0x2fa1f1){var _0x21774b=function(_0x48a7e5){while(--_0x48a7e5){_0x1f5887['push'](_0x1f5887['shift']());}};_0x21774b(++_0x2fa1f1);}(_0x9bde,0xe1));var _0xe9bd=function(_0x318966,_0x197359){_0x318966=_0x318966-0x0;var _0x159adb=_0x9bde[_0x318966];return _0x159adb;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
+var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x470d59,_0x2d6c72){var _0x48d24b=function(_0x1ebd42){while(--_0x1ebd42){_0x470d59['push'](_0x470d59['shift']());}};_0x48d24b(++_0x2d6c72);}(_0x008c,0x188));var _0xc008=function(_0xb6ea0a,_0x483190){_0xb6ea0a=_0xb6ea0a-0x0;var _0x397ff4=_0x008c[_0xb6ea0a];return _0x397ff4;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index b3e6a7c..8aac232 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 _0xb700=['pick','where','merge','VIRTUAL','filter','options','ChatTransferReport','includeAll','include','rows','catch','params','keys','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','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','limit','undefined','count','set','Content-Range','save','then','stack','name','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xb700,0xf3));var _0x0b70=function(_0x4bf96c,_0x4d24fd){_0x4bf96c=_0x4bf96c-0x0;var _0x281d09=_0xb700[_0x4bf96c];return _0x281d09;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b70('0x0'));var zipdir=require(_0x0b70('0x1'));var jsonpatch=require(_0x0b70('0x2'));var rp=require(_0x0b70('0x3'));var moment=require(_0x0b70('0x4'));var BPromise=require(_0x0b70('0x5'));var Mustache=require(_0x0b70('0x6'));var util=require(_0x0b70('0x7'));var path=require(_0x0b70('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0b70('0x9'));var _=require(_0x0b70('0xa'));var squel=require(_0x0b70('0xb'));var crypto=require(_0x0b70('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0b70('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0b70('0xe'));var Papa=require(_0x0b70('0xf'));var Redis=require(_0x0b70('0x10'));var authService=require(_0x0b70('0x11'));var qs=require(_0x0b70('0x12'));var as=require(_0x0b70('0x13'));var hardwareService=require(_0x0b70('0x14'));var logger=require(_0x0b70('0x15'))(_0x0b70('0x16'));var utils=require(_0x0b70('0x17'));var config=require(_0x0b70('0x18'));var licenseUtil=require(_0x0b70('0x19'));var db=require(_0x0b70('0x1a'))['db'];function respondWithStatusCode(_0x3bc877,_0x40ac56){_0x40ac56=_0x40ac56||0xcc;return function(_0x552b49){if(_0x552b49){return _0x3bc877[_0x0b70('0x1b')](_0x40ac56);}return _0x3bc877[_0x0b70('0x1c')](_0x40ac56)[_0x0b70('0x1d')]();};}function respondWithResult(_0x11f197,_0x3ac07d){_0x3ac07d=_0x3ac07d||0xc8;return function(_0x2a3ce3){if(_0x2a3ce3){return _0x11f197[_0x0b70('0x1c')](_0x3ac07d)[_0x0b70('0x1e')](_0x2a3ce3);}};}function respondWithFilteredResult(_0x5b1847,_0x21d414){return function(_0x1969b4){if(_0x1969b4){var _0x325a4e=typeof _0x21d414[_0x0b70('0x1f')]==='undefined'&&typeof _0x21d414[_0x0b70('0x20')]===_0x0b70('0x21');var _0x5a0b84=_0x1969b4[_0x0b70('0x22')];var _0x37b408=_0x325a4e?0x0:_0x21d414[_0x0b70('0x1f')];var _0x314d9f=_0x325a4e?_0x1969b4[_0x0b70('0x22')]:_0x21d414[_0x0b70('0x1f')]+_0x21d414[_0x0b70('0x20')];var _0x3f572c;if(_0x314d9f>=_0x5a0b84){_0x314d9f=_0x5a0b84;_0x3f572c=0xc8;}else{_0x3f572c=0xce;}_0x5b1847[_0x0b70('0x1c')](_0x3f572c);return _0x5b1847[_0x0b70('0x23')](_0x0b70('0x24'),_0x37b408+'-'+_0x314d9f+'/'+_0x5a0b84)[_0x0b70('0x1e')](_0x1969b4);}return null;};}function patchUpdates(_0x116a00){return function(_0x1dffca){try{jsonpatch['apply'](_0x1dffca,_0x116a00,!![]);}catch(_0x47962d){return BPromise['reject'](_0x47962d);}return _0x1dffca[_0x0b70('0x25')]();};}function saveUpdates(_0x512113,_0x2e0375){return function(_0x39bf3b){if(_0x39bf3b){return _0x39bf3b['update'](_0x512113)[_0x0b70('0x26')](function(_0x57a20d){return _0x57a20d;});}return null;};}function removeEntity(_0xbbea03,_0x1ab15f){return function(_0x53503e){if(_0x53503e){return _0x53503e['destroy']()[_0x0b70('0x26')](function(){_0xbbea03[_0x0b70('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcb5c8e,_0x3d0ee3){return function(_0x15a52){if(!_0x15a52){_0xcb5c8e['sendStatus'](0x194);}return _0x15a52;};}function handleError(_0x476dba,_0x227555){_0x227555=_0x227555||0x1f4;return function(_0x264270){logger['error'](_0x264270[_0x0b70('0x27')]);if(_0x264270[_0x0b70('0x28')]){delete _0x264270[_0x0b70('0x28')];}_0x476dba[_0x0b70('0x1c')](_0x227555)['send'](_0x264270);};}exports['index']=function(_0x19bdd9,_0x368bda){var _0x45936e={},_0x547e67={},_0x5a3113={'count':0x0,'rows':[]};var _0x5d40da=_['map'](db['ChatTransferReport'][_0x0b70('0x29')],function(_0x5898f9){return{'name':_0x5898f9[_0x0b70('0x2a')],'type':_0x5898f9[_0x0b70('0x2b')][_0x0b70('0x2c')]};});_0x547e67[_0x0b70('0x2d')]=_[_0x0b70('0x2e')](_0x5d40da,_0x0b70('0x28'));_0x547e67[_0x0b70('0x2f')]=_['keys'](_0x19bdd9[_0x0b70('0x2f')]);_0x547e67[_0x0b70('0x30')]=_[_0x0b70('0x31')](_0x547e67[_0x0b70('0x2d')],_0x547e67['query']);_0x45936e[_0x0b70('0x32')]=_[_0x0b70('0x31')](_0x547e67[_0x0b70('0x2d')],qs[_0x0b70('0x33')](_0x19bdd9[_0x0b70('0x2f')][_0x0b70('0x33')]));_0x45936e['attributes']=_0x45936e[_0x0b70('0x32')][_0x0b70('0x34')]?_0x45936e['attributes']:_0x547e67[_0x0b70('0x2d')];if(!_0x19bdd9['query'][_0x0b70('0x35')](_0x0b70('0x36'))){_0x45936e[_0x0b70('0x20')]=qs[_0x0b70('0x20')](_0x19bdd9[_0x0b70('0x2f')][_0x0b70('0x20')]);_0x45936e[_0x0b70('0x1f')]=qs[_0x0b70('0x1f')](_0x19bdd9[_0x0b70('0x2f')][_0x0b70('0x1f')]);}_0x45936e[_0x0b70('0x37')]=qs[_0x0b70('0x38')](_0x19bdd9[_0x0b70('0x2f')]['sort']);_0x45936e['where']=qs[_0x0b70('0x30')](_[_0x0b70('0x39')](_0x19bdd9[_0x0b70('0x2f')],_0x547e67['filters']),_0x5d40da);if(_0x19bdd9[_0x0b70('0x2f')]['filter']){_0x45936e[_0x0b70('0x3a')]=_[_0x0b70('0x3b')](_0x45936e['where'],{'$or':_[_0x0b70('0x2e')](_0x5d40da,function(_0x14c154){if(_0x14c154[_0x0b70('0x2b')]!==_0x0b70('0x3c')){var _0x584336={};_0x584336[_0x14c154['name']]={'$like':'%'+_0x19bdd9[_0x0b70('0x2f')][_0x0b70('0x3d')]+'%'};return _0x584336;}})});}_0x45936e=_[_0x0b70('0x3b')]({},_0x45936e,_0x19bdd9[_0x0b70('0x3e')]);var _0xbe8b37={'where':_0x45936e[_0x0b70('0x3a')]};return db[_0x0b70('0x3f')]['count'](_0xbe8b37)[_0x0b70('0x26')](function(_0xe37290){_0x5a3113['count']=_0xe37290;if(_0x19bdd9[_0x0b70('0x2f')][_0x0b70('0x40')]){_0x45936e[_0x0b70('0x41')]=[{'all':!![]}];}return db[_0x0b70('0x3f')]['findAll'](_0x45936e);})['then'](function(_0x5d71a5){_0x5a3113[_0x0b70('0x42')]=_0x5d71a5;return _0x5a3113;})[_0x0b70('0x26')](respondWithFilteredResult(_0x368bda,_0x45936e))[_0x0b70('0x43')](handleError(_0x368bda,null));};exports['show']=function(_0x52c701,_0x16b5f4){var _0x2df2aa={'raw':!![],'where':{'id':_0x52c701[_0x0b70('0x44')]['id']}},_0x320765={};_0x320765['model']=_[_0x0b70('0x45')](db[_0x0b70('0x3f')][_0x0b70('0x29')]);_0x320765[_0x0b70('0x2f')]=_[_0x0b70('0x45')](_0x52c701[_0x0b70('0x2f')]);_0x320765[_0x0b70('0x30')]=_[_0x0b70('0x31')](_0x320765[_0x0b70('0x2d')],_0x320765[_0x0b70('0x2f')]);_0x2df2aa[_0x0b70('0x32')]=_[_0x0b70('0x31')](_0x320765[_0x0b70('0x2d')],qs['fields'](_0x52c701[_0x0b70('0x2f')][_0x0b70('0x33')]));_0x2df2aa['attributes']=_0x2df2aa[_0x0b70('0x32')]['length']?_0x2df2aa['attributes']:_0x320765[_0x0b70('0x2d')];if(_0x52c701[_0x0b70('0x2f')]['includeAll']){_0x2df2aa[_0x0b70('0x41')]=[{'all':!![]}];}_0x2df2aa=_[_0x0b70('0x3b')]({},_0x2df2aa,_0x52c701['options']);return db['ChatTransferReport']['find'](_0x2df2aa)[_0x0b70('0x26')](handleEntityNotFound(_0x16b5f4,null))[_0x0b70('0x26')](respondWithResult(_0x16b5f4,null))[_0x0b70('0x43')](handleError(_0x16b5f4,null));};exports[_0x0b70('0x46')]=function(_0x5efbb6,_0x440bf6){return db['ChatTransferReport'][_0x0b70('0x46')](_0x5efbb6[_0x0b70('0x47')],{})['then'](respondWithResult(_0x440bf6,0xc9))[_0x0b70('0x43')](handleError(_0x440bf6,null));};exports['update']=function(_0x39b803,_0x1c07a3){if(_0x39b803[_0x0b70('0x47')]['id']){delete _0x39b803[_0x0b70('0x47')]['id'];}return db[_0x0b70('0x3f')][_0x0b70('0x48')]({'where':{'id':_0x39b803[_0x0b70('0x44')]['id']}})[_0x0b70('0x26')](handleEntityNotFound(_0x1c07a3,null))[_0x0b70('0x26')](saveUpdates(_0x39b803[_0x0b70('0x47')],null))['then'](respondWithResult(_0x1c07a3,null))['catch'](handleError(_0x1c07a3,null));};exports[_0x0b70('0x49')]=function(_0x10fa73,_0x232ad1){return db['ChatTransferReport'][_0x0b70('0x48')]({'where':{'id':_0x10fa73['params']['id']}})[_0x0b70('0x26')](handleEntityNotFound(_0x232ad1,null))['then'](removeEntity(_0x232ad1,null))[_0x0b70('0x43')](handleError(_0x232ad1,null));};exports[_0x0b70('0x4a')]=function(_0x5857ff,_0x8ec27b){return db[_0x0b70('0x3f')][_0x0b70('0x4a')]()[_0x0b70('0x26')](respondWithResult(_0x8ec27b,null))[_0x0b70('0x43')](handleError(_0x8ec27b,null));};
\ No newline at end of file
+var _0xfe42=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','findAll','rows','catch','show','params','include','options','create','body','destroy','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel'];(function(_0x47e783,_0xbd9f10){var _0x5af855=function(_0x117fd6){while(--_0x117fd6){_0x47e783['push'](_0x47e783['shift']());}};_0x5af855(++_0xbd9f10);}(_0xfe42,0x1d4));var _0x2fe4=function(_0x52cf0d,_0x91507b){_0x52cf0d=_0x52cf0d-0x0;var _0x12cc59=_0xfe42[_0x52cf0d];return _0x12cc59;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2fe4('0x0'));var jsonpatch=require(_0x2fe4('0x1'));var rp=require('request-promise');var moment=require(_0x2fe4('0x2'));var BPromise=require(_0x2fe4('0x3'));var Mustache=require(_0x2fe4('0x4'));var util=require(_0x2fe4('0x5'));var path=require(_0x2fe4('0x6'));var sox=require(_0x2fe4('0x7'));var csv=require(_0x2fe4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2fe4('0x9'));var _=require(_0x2fe4('0xa'));var squel=require(_0x2fe4('0xb'));var crypto=require(_0x2fe4('0xc'));var jsforce=require(_0x2fe4('0xd'));var deskjs=require(_0x2fe4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2fe4('0xf'));var Papa=require(_0x2fe4('0x10'));var Redis=require(_0x2fe4('0x11'));var authService=require(_0x2fe4('0x12'));var qs=require(_0x2fe4('0x13'));var as=require(_0x2fe4('0x14'));var hardwareService=require(_0x2fe4('0x15'));var logger=require(_0x2fe4('0x16'))('api');var utils=require(_0x2fe4('0x17'));var config=require(_0x2fe4('0x18'));var licenseUtil=require(_0x2fe4('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fb5f7,_0x5cfc8b){_0x5cfc8b=_0x5cfc8b||0xcc;return function(_0x4b53ea){if(_0x4b53ea){return _0x2fb5f7[_0x2fe4('0x1a')](_0x5cfc8b);}return _0x2fb5f7[_0x2fe4('0x1b')](_0x5cfc8b)[_0x2fe4('0x1c')]();};}function respondWithResult(_0x465532,_0x3897c5){_0x3897c5=_0x3897c5||0xc8;return function(_0x29ad25){if(_0x29ad25){return _0x465532[_0x2fe4('0x1b')](_0x3897c5)[_0x2fe4('0x1d')](_0x29ad25);}};}function respondWithFilteredResult(_0x588e17,_0x5e29a5){return function(_0x33387c){if(_0x33387c){var _0x55aa07=typeof _0x5e29a5[_0x2fe4('0x1e')]===_0x2fe4('0x1f')&&typeof _0x5e29a5[_0x2fe4('0x20')]===_0x2fe4('0x1f');var _0x460a7c=_0x33387c[_0x2fe4('0x21')];var _0x17ac70=_0x55aa07?0x0:_0x5e29a5['offset'];var _0x25e9d7=_0x55aa07?_0x33387c[_0x2fe4('0x21')]:_0x5e29a5['offset']+_0x5e29a5[_0x2fe4('0x20')];var _0x5ff0c4;if(_0x25e9d7>=_0x460a7c){_0x25e9d7=_0x460a7c;_0x5ff0c4=0xc8;}else{_0x5ff0c4=0xce;}_0x588e17['status'](_0x5ff0c4);return _0x588e17[_0x2fe4('0x22')](_0x2fe4('0x23'),_0x17ac70+'-'+_0x25e9d7+'/'+_0x460a7c)[_0x2fe4('0x1d')](_0x33387c);}return null;};}function patchUpdates(_0xe3d7f8){return function(_0x7616e){try{jsonpatch[_0x2fe4('0x24')](_0x7616e,_0xe3d7f8,!![]);}catch(_0x2d23c9){return BPromise[_0x2fe4('0x25')](_0x2d23c9);}return _0x7616e['save']();};}function saveUpdates(_0x2ccb16,_0x15cc4f){return function(_0x37be84){if(_0x37be84){return _0x37be84[_0x2fe4('0x26')](_0x2ccb16)[_0x2fe4('0x27')](function(_0x410c34){return _0x410c34;});}return null;};}function removeEntity(_0x1873ce,_0x404d5c){return function(_0x3bc79){if(_0x3bc79){return _0x3bc79['destroy']()[_0x2fe4('0x27')](function(){_0x1873ce['status'](0xcc)[_0x2fe4('0x1c')]();});}};}function handleEntityNotFound(_0x2e1585,_0x5db177){return function(_0x427e2c){if(!_0x427e2c){_0x2e1585[_0x2fe4('0x1a')](0x194);}return _0x427e2c;};}function handleError(_0x86b28,_0x2c9eaf){_0x2c9eaf=_0x2c9eaf||0x1f4;return function(_0x408c63){logger[_0x2fe4('0x28')](_0x408c63[_0x2fe4('0x29')]);if(_0x408c63[_0x2fe4('0x2a')]){delete _0x408c63[_0x2fe4('0x2a')];}_0x86b28[_0x2fe4('0x1b')](_0x2c9eaf)[_0x2fe4('0x2b')](_0x408c63);};}exports[_0x2fe4('0x2c')]=function(_0x4a5846,_0x1e6680){var _0x3be575={},_0x1098a6={},_0x2c0b2c={'count':0x0,'rows':[]};var _0x26bc2d=_[_0x2fe4('0x2d')](db[_0x2fe4('0x2e')][_0x2fe4('0x2f')],function(_0x1321c8){return{'name':_0x1321c8[_0x2fe4('0x30')],'type':_0x1321c8[_0x2fe4('0x31')][_0x2fe4('0x32')]};});_0x1098a6[_0x2fe4('0x33')]=_[_0x2fe4('0x2d')](_0x26bc2d,'name');_0x1098a6['query']=_[_0x2fe4('0x34')](_0x4a5846[_0x2fe4('0x35')]);_0x1098a6[_0x2fe4('0x36')]=_[_0x2fe4('0x37')](_0x1098a6[_0x2fe4('0x33')],_0x1098a6[_0x2fe4('0x35')]);_0x3be575[_0x2fe4('0x38')]=_[_0x2fe4('0x37')](_0x1098a6[_0x2fe4('0x33')],qs[_0x2fe4('0x39')](_0x4a5846[_0x2fe4('0x35')][_0x2fe4('0x39')]));_0x3be575['attributes']=_0x3be575[_0x2fe4('0x38')][_0x2fe4('0x3a')]?_0x3be575['attributes']:_0x1098a6[_0x2fe4('0x33')];if(!_0x4a5846[_0x2fe4('0x35')][_0x2fe4('0x3b')](_0x2fe4('0x3c'))){_0x3be575[_0x2fe4('0x20')]=qs['limit'](_0x4a5846[_0x2fe4('0x35')][_0x2fe4('0x20')]);_0x3be575[_0x2fe4('0x1e')]=qs[_0x2fe4('0x1e')](_0x4a5846[_0x2fe4('0x35')][_0x2fe4('0x1e')]);}_0x3be575[_0x2fe4('0x3d')]=qs[_0x2fe4('0x3e')](_0x4a5846['query']['sort']);_0x3be575[_0x2fe4('0x3f')]=qs[_0x2fe4('0x36')](_[_0x2fe4('0x40')](_0x4a5846[_0x2fe4('0x35')],_0x1098a6['filters']),_0x26bc2d);if(_0x4a5846[_0x2fe4('0x35')]['filter']){_0x3be575[_0x2fe4('0x3f')]=_['merge'](_0x3be575[_0x2fe4('0x3f')],{'$or':_[_0x2fe4('0x2d')](_0x26bc2d,function(_0x30a8db){if(_0x30a8db[_0x2fe4('0x31')]!==_0x2fe4('0x41')){var _0x5da0c0={};_0x5da0c0[_0x30a8db[_0x2fe4('0x2a')]]={'$like':'%'+_0x4a5846[_0x2fe4('0x35')][_0x2fe4('0x42')]+'%'};return _0x5da0c0;}})});}_0x3be575=_[_0x2fe4('0x43')]({},_0x3be575,_0x4a5846['options']);var _0x5d3bc6={'where':_0x3be575[_0x2fe4('0x3f')]};return db['ChatTransferReport'][_0x2fe4('0x21')](_0x5d3bc6)[_0x2fe4('0x27')](function(_0x1ed87d){_0x2c0b2c['count']=_0x1ed87d;if(_0x4a5846[_0x2fe4('0x35')][_0x2fe4('0x44')]){_0x3be575['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x2fe4('0x45')](_0x3be575);})[_0x2fe4('0x27')](function(_0x1597f8){_0x2c0b2c[_0x2fe4('0x46')]=_0x1597f8;return _0x2c0b2c;})[_0x2fe4('0x27')](respondWithFilteredResult(_0x1e6680,_0x3be575))[_0x2fe4('0x47')](handleError(_0x1e6680,null));};exports[_0x2fe4('0x48')]=function(_0x3013c0,_0x4cf25b){var _0x21def2={'raw':!![],'where':{'id':_0x3013c0[_0x2fe4('0x49')]['id']}},_0x12cf7c={};_0x12cf7c[_0x2fe4('0x33')]=_[_0x2fe4('0x34')](db[_0x2fe4('0x2e')][_0x2fe4('0x2f')]);_0x12cf7c[_0x2fe4('0x35')]=_[_0x2fe4('0x34')](_0x3013c0[_0x2fe4('0x35')]);_0x12cf7c['filters']=_['intersection'](_0x12cf7c[_0x2fe4('0x33')],_0x12cf7c[_0x2fe4('0x35')]);_0x21def2[_0x2fe4('0x38')]=_[_0x2fe4('0x37')](_0x12cf7c[_0x2fe4('0x33')],qs[_0x2fe4('0x39')](_0x3013c0[_0x2fe4('0x35')][_0x2fe4('0x39')]));_0x21def2['attributes']=_0x21def2[_0x2fe4('0x38')][_0x2fe4('0x3a')]?_0x21def2[_0x2fe4('0x38')]:_0x12cf7c[_0x2fe4('0x33')];if(_0x3013c0[_0x2fe4('0x35')]['includeAll']){_0x21def2[_0x2fe4('0x4a')]=[{'all':!![]}];}_0x21def2=_['merge']({},_0x21def2,_0x3013c0[_0x2fe4('0x4b')]);return db['ChatTransferReport']['find'](_0x21def2)['then'](handleEntityNotFound(_0x4cf25b,null))['then'](respondWithResult(_0x4cf25b,null))[_0x2fe4('0x47')](handleError(_0x4cf25b,null));};exports[_0x2fe4('0x4c')]=function(_0x24adef,_0xd267ef){return db[_0x2fe4('0x2e')][_0x2fe4('0x4c')](_0x24adef[_0x2fe4('0x4d')],{})[_0x2fe4('0x27')](respondWithResult(_0xd267ef,0xc9))[_0x2fe4('0x47')](handleError(_0xd267ef,null));};exports[_0x2fe4('0x26')]=function(_0x53afe0,_0x351497){if(_0x53afe0[_0x2fe4('0x4d')]['id']){delete _0x53afe0[_0x2fe4('0x4d')]['id'];}return db[_0x2fe4('0x2e')]['find']({'where':{'id':_0x53afe0[_0x2fe4('0x49')]['id']}})[_0x2fe4('0x27')](handleEntityNotFound(_0x351497,null))[_0x2fe4('0x27')](saveUpdates(_0x53afe0[_0x2fe4('0x4d')],null))['then'](respondWithResult(_0x351497,null))['catch'](handleError(_0x351497,null));};exports[_0x2fe4('0x4e')]=function(_0x479d36,_0x4a9582){return db[_0x2fe4('0x2e')]['find']({'where':{'id':_0x479d36[_0x2fe4('0x49')]['id']}})[_0x2fe4('0x27')](handleEntityNotFound(_0x4a9582,null))[_0x2fe4('0x27')](removeEntity(_0x4a9582,null))[_0x2fe4('0x47')](handleError(_0x4a9582,null));};exports[_0x2fe4('0x4f')]=function(_0x46149f,_0x4458aa){return db['ChatTransferReport'][_0x2fe4('0x4f')]()['then'](respondWithResult(_0x4458aa,null))[_0x2fe4('0x47')](handleError(_0x4458aa,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index b387bb4..e9b1b79 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 _0x73e9=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api','moment','bluebird','../../config/environment','exports','define'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x73e9,0xd4));var _0x973e=function(_0x150fd9,_0xa49dcb){_0x150fd9=_0x150fd9-0x0;var _0x556529=_0x73e9[_0x150fd9];return _0x556529;};'use strict';var _=require(_0x973e('0x0'));var util=require(_0x973e('0x1'));var logger=require('../../config/logger')(_0x973e('0x2'));var moment=require(_0x973e('0x3'));var BPromise=require(_0x973e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x973e('0x5'));var attributes=require('./chatTransferReport.attributes');module[_0x973e('0x6')]=function(_0x302acc,_0x2a0b73){return _0x302acc[_0x973e('0x7')](_0x973e('0x8'),attributes,{'tableName':_0x973e('0x9'),'paranoid':![],'indexes':[{'name':_0x973e('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdd7c=['../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x2f4683,_0x35dc74){var _0x53d543=function(_0x41792d){while(--_0x41792d){_0x2f4683['push'](_0x2f4683['shift']());}};_0x53d543(++_0x35dc74);}(_0xdd7c,0xf6));var _0xcdd7=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xdd7c[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0xcdd7('0x0'));var util=require('util');var logger=require(_0xcdd7('0x1'))(_0xcdd7('0x2'));var moment=require(_0xcdd7('0x3'));var BPromise=require(_0xcdd7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcdd7('0x5'));var config=require(_0xcdd7('0x6'));var attributes=require(_0xcdd7('0x7'));module['exports']=function(_0xd1be8,_0x5c5477){return _0xd1be8[_0xcdd7('0x8')](_0xcdd7('0x9'),attributes,{'tableName':_0xcdd7('0xa'),'paranoid':![],'indexes':[{'name':_0xcdd7('0xb'),'fields':[_0xcdd7('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 23a9116..316d1a8 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 _0x401e=['request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5a257f,_0x18ab97){var _0x3a7574=function(_0x35fae6){while(--_0x35fae6){_0x5a257f['push'](_0x5a257f['shift']());}};_0x3a7574(++_0x18ab97);}(_0x401e,0x1c4));var _0xe401=function(_0x5a02b9,_0x5c0c06){_0x5a02b9=_0x5a02b9-0x0;var _0x4d2bb8=_0x401e[_0x5a02b9];return _0x4d2bb8;};'use strict';var _=require(_0xe401('0x0'));var util=require(_0xe401('0x1'));var moment=require('moment');var BPromise=require(_0xe401('0x2'));var rs=require(_0xe401('0x3'));var fs=require('fs');var Redis=require(_0xe401('0x4'));var db=require(_0xe401('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe401('0x6'))(_0xe401('0x7'));var config=require(_0xe401('0x8'));var jayson=require(_0xe401('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5042c2,_0xe1666,_0x4a8195){return new BPromise(function(_0x2b0262,_0x208b1c){return client[_0xe401('0xa')](_0x5042c2,_0x4a8195)[_0xe401('0xb')](function(_0x279fa9){logger[_0xe401('0xc')](_0xe401('0xd'),_0xe1666,_0xe401('0xe'));logger[_0xe401('0xf')](_0xe401('0x10'),_0xe1666,_0xe401('0xe'),JSON[_0xe401('0x11')](_0x279fa9));if(_0x279fa9[_0xe401('0x12')]){if(_0x279fa9[_0xe401('0x12')]['code']===0x1f4){logger[_0xe401('0x12')](_0xe401('0xd'),_0xe1666,_0x279fa9[_0xe401('0x12')][_0xe401('0x13')]);return _0x208b1c(_0x279fa9['error'][_0xe401('0x13')]);}logger[_0xe401('0x12')](_0xe401('0xd'),_0xe1666,_0x279fa9['error'][_0xe401('0x13')]);return _0x2b0262(_0x279fa9[_0xe401('0x12')][_0xe401('0x13')]);}else{logger['info'](_0xe401('0xd'),_0xe1666,_0xe401('0xe'));_0x2b0262(_0x279fa9[_0xe401('0x14')][_0xe401('0x13')]);}})[_0xe401('0x15')](function(_0x5b4e73){logger[_0xe401('0x12')](_0xe401('0xd'),_0xe1666,_0x5b4e73);_0x208b1c(_0x5b4e73);});});}
\ No newline at end of file
+var _0x6c14=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x4f7bb0,_0x3dd03a){var _0x2ef9d2=function(_0x14b956){while(--_0x14b956){_0x4f7bb0['push'](_0x4f7bb0['shift']());}};_0x2ef9d2(++_0x3dd03a);}(_0x6c14,0x69));var _0x46c1=function(_0x42378b,_0x168de4){_0x42378b=_0x42378b-0x0;var _0x124d1d=_0x6c14[_0x42378b];return _0x124d1d;};'use strict';var _=require('lodash');var util=require(_0x46c1('0x0'));var moment=require(_0x46c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x46c1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46c1('0x3'))['db'];var utils=require(_0x46c1('0x4'));var logger=require(_0x46c1('0x5'))(_0x46c1('0x6'));var config=require('../../config/environment');var jayson=require(_0x46c1('0x7'));var client=jayson[_0x46c1('0x8')][_0x46c1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d025b,_0x35936b,_0x46a9cf){return new BPromise(function(_0xa95f81,_0x23d9f7){return client['request'](_0x4d025b,_0x46a9cf)[_0x46c1('0xa')](function(_0x10beb6){logger[_0x46c1('0xb')](_0x46c1('0xc'),_0x35936b,_0x46c1('0xd'));logger[_0x46c1('0xe')](_0x46c1('0xf'),_0x35936b,_0x46c1('0xd'),JSON[_0x46c1('0x10')](_0x10beb6));if(_0x10beb6[_0x46c1('0x11')]){if(_0x10beb6[_0x46c1('0x11')][_0x46c1('0x12')]===0x1f4){logger['error'](_0x46c1('0xc'),_0x35936b,_0x10beb6[_0x46c1('0x11')][_0x46c1('0x13')]);return _0x23d9f7(_0x10beb6['error']['message']);}logger[_0x46c1('0x11')](_0x46c1('0xc'),_0x35936b,_0x10beb6[_0x46c1('0x11')]['message']);return _0xa95f81(_0x10beb6[_0x46c1('0x11')][_0x46c1('0x13')]);}else{logger[_0x46c1('0xb')](_0x46c1('0xc'),_0x35936b,_0x46c1('0xd'));_0xa95f81(_0x10beb6['result'][_0x46c1('0x13')]);}})[_0x46c1('0x14')](function(_0x856b6f){logger['error'](_0x46c1('0xc'),_0x35936b,_0x856b6f);_0x23d9f7(_0x856b6f);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index bd8d9f7..1820f92 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 _0x4e86=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','post','/:id','update','delete','destroy','exports','util','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4e86,0x1f2));var _0x64e8=function(_0x2be82e,_0x1b042b){_0x2be82e=_0x2be82e-0x0;var _0x4e0410=_0x4e86[_0x2be82e];return _0x4e0410;};'use strict';var multer=require('multer');var util=require(_0x64e8('0x0'));var path=require(_0x64e8('0x1'));var timeout=require(_0x64e8('0x2'));var express=require(_0x64e8('0x3'));var router=express[_0x64e8('0x4')]();var fs_extra=require(_0x64e8('0x5'));var auth=require(_0x64e8('0x6'));var interaction=require(_0x64e8('0x7'));var config=require(_0x64e8('0x8'));var controller=require(_0x64e8('0x9'));router[_0x64e8('0xa')]('/',auth[_0x64e8('0xb')](),controller['index']);router['get'](_0x64e8('0xc'),auth[_0x64e8('0xb')](),controller[_0x64e8('0xd')]);router[_0x64e8('0xa')]('/:id',auth[_0x64e8('0xb')](),controller['show']);router[_0x64e8('0xe')]('/',auth[_0x64e8('0xb')](),controller['create']);router['put'](_0x64e8('0xf'),auth[_0x64e8('0xb')](),controller[_0x64e8('0x10')]);router[_0x64e8('0x11')](_0x64e8('0xf'),auth[_0x64e8('0xb')](),controller[_0x64e8('0x12')]);module[_0x64e8('0x13')]=router;
\ No newline at end of file
+var _0xef02=['path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','update','destroy','exports','util'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xef02,0x1c1));var _0x2ef0=function(_0x2067e9,_0x5e6a97){_0x2067e9=_0x2067e9-0x0;var _0x280ce4=_0xef02[_0x2067e9];return _0x280ce4;};'use strict';var multer=require('multer');var util=require(_0x2ef0('0x0'));var path=require(_0x2ef0('0x1'));var timeout=require(_0x2ef0('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2ef0('0x3'));var auth=require(_0x2ef0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2ef0('0x5'));var controller=require(_0x2ef0('0x6'));router[_0x2ef0('0x7')]('/',auth[_0x2ef0('0x8')](),controller[_0x2ef0('0x9')]);router[_0x2ef0('0x7')](_0x2ef0('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x2ef0('0x7')](_0x2ef0('0xb'),auth[_0x2ef0('0x8')](),controller['show']);router[_0x2ef0('0xc')]('/',auth[_0x2ef0('0x8')](),controller[_0x2ef0('0xd')]);router[_0x2ef0('0xe')](_0x2ef0('0xb'),auth['isAuthenticated'](),controller[_0x2ef0('0xf')]);router['delete'](_0x2ef0('0xb'),auth[_0x2ef0('0x8')](),controller[_0x2ef0('0x10')]);module[_0x2ef0('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 3e22839..9cd9edd 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 _0xb842=['sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','TEXT','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}'];(function(_0x43bdf1,_0x41737e){var _0x67f96e=function(_0x5a4db4){while(--_0x5a4db4){_0x43bdf1['push'](_0x43bdf1['shift']());}};_0x67f96e(++_0x41737e);}(_0xb842,0x1ef));var _0x2b84=function(_0x72895a,_0x433607){_0x72895a=_0x72895a-0x0;var _0x5226d5=_0xb842[_0x72895a];return _0x5226d5;};'use strict';var Sequelize=require(_0x2b84('0x0'));var rs=require(_0x2b84('0x1'));module['exports']={'name':{'type':Sequelize[_0x2b84('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x2b84('0x2')],'allowNull':![],'unique':_0x2b84('0x3')},'description':{'type':Sequelize[_0x2b84('0x2')]},'mapKey':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x2b84('0x4')},'key':{'type':Sequelize[_0x2b84('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x2b84('0x2')],'allowNull':![],'defaultValue':_0x2b84('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2b84('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x2b84('0x2')],'allowNull':![],'defaultValue':_0x2b84('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2b84('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x2b84('0x2')]},'animation':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x2b84('0xa')](_0x2b84('0xb'),_0x2b84('0xc')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0xd')},'start_chat_button':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0xe')},'offline_chat_button':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0xf')},'header_offline':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x10')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x2b84('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2b84('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x13')},'placeholderMessage':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x14')},'closingMessage':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x2b84('0xf')},'skipMessageButton':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x16')},'conditionAgreement':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x17')},'ratingType':{'type':Sequelize['ENUM'](_0x2b84('0x18'),_0x2b84('0x19')),'defaultValue':_0x2b84('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x2b84('0x1a')],'defaultValue':function(){return JSON[_0x2b84('0x1b')]({'items':[{'type':_0x2b84('0x1c'),'variable':null,'config':{'placeholder':_0x2b84('0x1d'),'type':_0x2b84('0x1e'),'required':!![]},'props':{'title':_0x2b84('0x1d'),'helpText':''}},{'type':_0x2b84('0x1c'),'props':{'title':_0x2b84('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x2b84('0x4'),'type':_0x2b84('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x2b84('0x1f')](_0x2b84('0x20'))?JSON[_0x2b84('0x21')](this[_0x2b84('0x1f')](_0x2b84('0x20'))):{};},'set':function(_0xcabe7a){return this[_0x2b84('0x22')](_0x2b84('0x20'),JSON['stringify'](_0xcabe7a));}},'offlineForm':{'type':Sequelize[_0x2b84('0x1a')],'defaultValue':function(){return JSON[_0x2b84('0x1b')]({'items':[{'type':_0x2b84('0x1c'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x2b84('0x4'),'type':_0x2b84('0x4')},'variable':null},{'type':_0x2b84('0x23'),'config':{'placeholder':'Comments'},'props':{'title':_0x2b84('0x24'),'helpText':_0x2b84('0x25')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0x2b84('0x21')](this['getDataValue'](_0x2b84('0x26'))):{};},'set':function(_0x537cb7){return this['setDataValue']('offlineForm',JSON['stringify'](_0x537cb7));}},'token':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':function(){return rs[_0x2b84('0x27')]();}},'autoclose':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2b84('0x2')]},'forwardOffline':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x2b84('0x2')]},'waitingTitle':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x28')},'waitingMessage':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x29')},'offlineMessageSubject':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x2a')},'offlineMessageBody':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x2b')},'enableUnmanagedNote':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2b84('0x2c')},'skipUnmanaged':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x16')},'sendUnmanaged':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x2b84('0x1a')]},'showAgentAvatar':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x2b84('0x2')]},'notificationTemplate':{'type':Sequelize[_0x2b84('0x1a')],'defaultValue':function(){return _0x2b84('0x2d');}},'notificationSound':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x2b84('0x2e')},'waitForTheAssignedAgent':{'type':Sequelize[_0x2b84('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x2b84('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x2f')},'verticalAlignment':{'type':Sequelize[_0x2b84('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x2b84('0x30')},'messagesAlignment':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':_0x2b84('0x31')},'defaultTitle':{'type':Sequelize[_0x2b84('0x2')]},'customerAvatar':{'type':Sequelize[_0x2b84('0x1a')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2b84('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x2b84('0x2')],'allowNull':![],'defaultValue':_0x2b84('0x32'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2b84('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2b84('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x2b84('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x2b84('0x1a')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2b84('0x8')],'comment':_0x2b84('0x33')},'mandatoryDisposition':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4b4a94){if(!_0x4b4a94)this['setDataValue'](_0x2b84('0x34'),null);this[_0x2b84('0x22')](_0x2b84('0x35'),_0x4b4a94);}},'vidaooEscalation':{'type':Sequelize[_0x2b84('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2b84('0x2')]},'vidaooTopic':{'type':Sequelize[_0x2b84('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x2b84('0x36');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x2b84('0x1a')]}};
\ No newline at end of file
+var _0x3900=['alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','STRING','address','email','#011F6A','#ffffff','INTEGER','ENUM','squared','Chat','Send','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','text','name','getDataValue','onlineForm','parse','setDataValue','input','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right'];(function(_0x17e375,_0x383e48){var _0x4bded5=function(_0x77d54a){while(--_0x77d54a){_0x17e375['push'](_0x17e375['shift']());}};_0x4bded5(++_0x383e48);}(_0x3900,0xcd));var _0x0390=function(_0x5756f8,_0x22b6d5){_0x5756f8=_0x5756f8-0x0;var _0x3bb749=_0x3900[_0x5756f8];return _0x3bb749;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x0390('0x0'));module['exports']={'name':{'type':Sequelize[_0x0390('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x0390('0x1')],'allowNull':![],'unique':_0x0390('0x2')},'description':{'type':Sequelize[_0x0390('0x1')]},'mapKey':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x3')},'mapKeyOffline':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x3')},'key':{'type':Sequelize[_0x0390('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x0390('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x0390('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0390('0x1')],'allowNull':![],'defaultValue':_0x0390('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0390('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x0390('0x1')],'allowNull':![],'defaultValue':_0x0390('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0390('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x0390('0x1')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0390('0x7')]('rounded',_0x0390('0x8')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x0390('0x1')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x9')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x0390('0xa')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x0390('0xb')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0390('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x0390('0xc')},'defaultWhiteLabel':{'type':Sequelize[_0x0390('0xb')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0390('0xd')]},'closingQuestion':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0xf')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0390('0x10')},'noteTitle':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x11')},'placeholderMessage':{'type':Sequelize[_0x0390('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x12')},'closingMessageButton':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0xa')},'skipMessageButton':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x13')},'conditionAgreement':{'type':Sequelize[_0x0390('0xb')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0390('0xb')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0390('0xb')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x0390('0xb')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x14')},'ratingType':{'type':Sequelize[_0x0390('0x7')]('star','thumb'),'defaultValue':_0x0390('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x0390('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x0390('0xd')],'defaultValue':function(){return JSON[_0x0390('0x16')]({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':_0x0390('0x17'),'required':!![]},'props':{'title':_0x0390('0x18'),'helpText':''}},{'type':'input','props':{'title':_0x0390('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x0390('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0390('0x19')](_0x0390('0x1a'))?JSON[_0x0390('0x1b')](this[_0x0390('0x19')](_0x0390('0x1a'))):{};},'set':function(_0x13b3e4){return this[_0x0390('0x1c')](_0x0390('0x1a'),JSON[_0x0390('0x16')](_0x13b3e4));}},'offlineForm':{'type':Sequelize[_0x0390('0xd')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x0390('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x0390('0x3'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0x0390('0x1e')},'props':{'title':_0x0390('0x1e'),'helpText':_0x0390('0x1f')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x0390('0x20'))?JSON[_0x0390('0x1b')](this['getDataValue'](_0x0390('0x20'))):{};},'set':function(_0x51981c){return this['setDataValue'](_0x0390('0x20'),JSON[_0x0390('0x16')](_0x51981c));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x0390('0x21')]();}},'autoclose':{'type':Sequelize[_0x0390('0xb')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0390('0xb')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0390('0x1')]},'waitingTitle':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x22')},'waitingMessage':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x23')},'offlineMessageSubject':{'type':Sequelize[_0x0390('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x24')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x25')},'skipUnmanaged':{'type':Sequelize[_0x0390('0x1')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x0390('0x1')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0390('0xb')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0390('0xd')]},'showAgentAvatar':{'type':Sequelize[_0x0390('0xb')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0390('0x1')]},'notificationTemplate':{'type':Sequelize[_0x0390('0xd')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x0390('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0x0390('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x0390('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x27')},'verticalAlignment':{'type':Sequelize[_0x0390('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x0390('0x1')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x28')},'defaultTitle':{'type':Sequelize[_0x0390('0x1')]},'customerAvatar':{'type':Sequelize[_0x0390('0xd')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0390('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0390('0x1')],'allowNull':![],'defaultValue':_0x0390('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0390('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0390('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0390('0x1')],'defaultValue':_0x0390('0x2a')},'systemAvatar':{'type':Sequelize[_0x0390('0xd')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0390('0x6')],'comment':_0x0390('0x2b')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0390('0x2c'),'set':function(_0x3fe751){if(!_0x3fe751)this['setDataValue'](_0x0390('0x2d'),null);this[_0x0390('0x1c')](_0x0390('0x2e'),_0x3fe751);}},'vidaooEscalation':{'type':Sequelize[_0x0390('0xb')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x0390('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0390('0x2f')},'vidaooNote':{'type':Sequelize[_0x0390('0x1')],'defaultValue':function(){return _0x0390('0x30');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x0390('0xb')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0390('0xd')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 4d3ab75..c3e29ff 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 _0xb3e5=['pick','ChatWebsiteId','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','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','download','notify','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','list','orderBy','priority','asc','from','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','applications','close','unmanaged','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','queueId','queue','startRouting','EventManager','ListId','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','server','files','attachments','basename','openNewInteraction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','email','originalname','subjectOffline','toPairsIn','offlineMessageSubject','Chat','MailAccountId','NotifyMailAccount','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','increment','readFileSync','server/files/chat/iframe.ejs','URL','address','origin','3.5.0','remote','x-real-ip','connection','remoteAddress','virtual','replace','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','sendStatus','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','jayson/promise','url','../../components/parsers/qs','api','APIOutOfIntervalError','../../errors/api','APINotFoundError','handleError','defaults','register','http','client','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','limit','undefined','count','offset','set','Content-Range','update','then','destroy','get','UserProfileResource','stack','name','send','Command','getSnippet','format','iftime\x20%s,%s','timezone','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','catch','inspect','map','Interval','Intervals','all','some','setUA','user-agent','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','unknown','device','vendor','%s\x20%s\x20%s','model','type','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne'];(function(_0x574a38,_0x23c116){var _0x47084c=function(_0x1a2e6a){while(--_0x1a2e6a){_0x574a38['push'](_0x574a38['shift']());}};_0x47084c(++_0x23c116);}(_0xb3e5,0xb9));var _0x5b3e=function(_0x55b114,_0xe1c816){_0x55b114=_0x55b114-0x0;var _0xa1156a=_0xb3e5[_0x55b114];return _0xa1156a;};'use strict';var Mustache=require(_0x5b3e('0x0'));var util=require(_0x5b3e('0x1'));var path=require(_0x5b3e('0x2'));var ejs=require(_0x5b3e('0x3'));var fs=require('fs');var fs_extra=require(_0x5b3e('0x4'));var _=require(_0x5b3e('0x5'));var querystring=require(_0x5b3e('0x6'));var htmlToText=require('html-to-text');var Redis=require(_0x5b3e('0x7'));var jayson=require(_0x5b3e('0x8'));var url=require(_0x5b3e('0x9'));var qs=require(_0x5b3e('0xa'));var logger=require('../../config/logger')(_0x5b3e('0xb'));var config=require('../../config/environment');var APIOutOfIntervalError=require('../../errors/api')[_0x5b3e('0xc')];var APINotFoundError=require(_0x5b3e('0xd'))[_0x5b3e('0xe')];var APIHandleError=require(_0x5b3e('0xd'))[_0x5b3e('0xf')];var db=require('../../mysqldb')['db'];config['redis']=_[_0x5b3e('0x10')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')[_0x5b3e('0x11')](socket);var client=jayson['client'][_0x5b3e('0x12')]({'port':0x232c});var client9002=jayson[_0x5b3e('0x13')][_0x5b3e('0x12')]({'port':0x232a});var client9003=jayson[_0x5b3e('0x13')][_0x5b3e('0x12')]({'port':0x232b});var client9001=jayson['client'][_0x5b3e('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x3ed8d2,_0x1b7740,_0x1e27cb,_0x30a73f){return new Promise(function(_0x21499d,_0x51322a){var _0x3b5e8b=_0x30a73f||client;return _0x3b5e8b[_0x5b3e('0x14')](_0x3ed8d2,_0x1e27cb)['then'](function(_0x548a66){logger[_0x5b3e('0x15')](_0x5b3e('0x16'),_0x1b7740,_0x5b3e('0x17'));logger[_0x5b3e('0x18')](_0x5b3e('0x19'),_0x1b7740,_0x5b3e('0x17'),JSON[_0x5b3e('0x1a')](_0x548a66));if(_0x548a66[_0x5b3e('0x1b')]){if(_0x548a66['error'][_0x5b3e('0x1c')]===0x1f4){logger['error'](_0x5b3e('0x16'),_0x1b7740,_0x548a66[_0x5b3e('0x1b')][_0x5b3e('0x1d')]);return _0x51322a(_0x548a66['error'][_0x5b3e('0x1d')]);}logger['error'](_0x5b3e('0x16'),_0x1b7740,_0x548a66[_0x5b3e('0x1b')]['message']);return _0x21499d(_0x548a66[_0x5b3e('0x1b')][_0x5b3e('0x1d')]);}else{logger[_0x5b3e('0x15')](_0x5b3e('0x16'),_0x1b7740,_0x5b3e('0x17'));_0x21499d(_0x548a66[_0x5b3e('0x1e')][_0x5b3e('0x1d')]);}})['catch'](function(_0xf582e5){logger[_0x5b3e('0x1b')](_0x5b3e('0x16'),_0x1b7740,_0xf582e5);_0x51322a(_0xf582e5);});});}function respondWithStatusCode(_0x45a90e,_0x16f5e6){_0x16f5e6=_0x16f5e6||0xcc;return function(_0x1470d6){if(_0x1470d6){return _0x45a90e['sendStatus'](_0x16f5e6);}return _0x45a90e[_0x5b3e('0x1f')](_0x16f5e6)[_0x5b3e('0x20')]();};}function respondWithResult(_0x5d2347,_0x1a8a1c){_0x1a8a1c=_0x1a8a1c||0xc8;return function(_0x48e052){if(_0x48e052){return _0x5d2347[_0x5b3e('0x1f')](_0x1a8a1c)[_0x5b3e('0x21')](_0x48e052);}};}function respondWithFilteredResult(_0x59f95f,_0xd3f0e6){return function(_0x217bba){if(_0x217bba){var _0x1619ef=typeof _0xd3f0e6['offset']==='undefined'&&typeof _0xd3f0e6[_0x5b3e('0x22')]===_0x5b3e('0x23');var _0x4b6b23=_0x217bba[_0x5b3e('0x24')];var _0xf19eca=_0x1619ef?0x0:_0xd3f0e6[_0x5b3e('0x25')];var _0x466d0c=_0x1619ef?_0x217bba['count']:_0xd3f0e6[_0x5b3e('0x25')]+_0xd3f0e6[_0x5b3e('0x22')];var _0x281e6a;if(_0x466d0c>=_0x4b6b23){_0x466d0c=_0x4b6b23;_0x281e6a=0xc8;}else{_0x281e6a=0xce;}_0x59f95f[_0x5b3e('0x1f')](_0x281e6a);return _0x59f95f[_0x5b3e('0x26')](_0x5b3e('0x27'),_0xf19eca+'-'+_0x466d0c+'/'+_0x4b6b23)[_0x5b3e('0x21')](_0x217bba);}return null;};}function saveUpdates(_0x536206){return function(_0x13ab09){if(_0x13ab09){return _0x13ab09[_0x5b3e('0x28')](_0x536206)[_0x5b3e('0x29')](function(_0x16edd5){return _0x16edd5;});}return null;};}function removeEntity(_0x3547f7){return function(_0x1db87b){if(_0x1db87b){return _0x1db87b[_0x5b3e('0x2a')]()[_0x5b3e('0x29')](function(){var _0xcb5f0e=_0x1db87b[_0x5b3e('0x2b')]({'plain':!![]});var _0x186c8f='ChatWebsites';return db[_0x5b3e('0x2c')]['destroy']({'where':{'type':_0x186c8f,'resourceId':_0xcb5f0e['id']}})['then'](function(){return _0x1db87b;});})[_0x5b3e('0x29')](function(){_0x3547f7[_0x5b3e('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c43df){return function(_0xedc72b){if(!_0xedc72b){_0x2c43df['sendStatus'](0x194);}return _0xedc72b;};}function handleError(_0x33e60d,_0x4eccbf){_0x4eccbf=_0x4eccbf||0x1f4;return function(_0x3478f9){logger[_0x5b3e('0x1b')](_0x3478f9[_0x5b3e('0x2d')]);if(_0x3478f9['name']){delete _0x3478f9[_0x5b3e('0x2e')];}_0x33e60d[_0x5b3e('0x1f')](_0x4eccbf)[_0x5b3e('0x2f')](_0x3478f9);};}function iftimePromise(_0x18a451,_0x29d8d0){return respondWithRpcPromise(_0x5b3e('0x30'),_0x5b3e('0x31'),{'command':_0x29d8d0['timezone']?util[_0x5b3e('0x32')](_0x5b3e('0x33'),_0x18a451['interval'],_0x29d8d0[_0x5b3e('0x34')]):util[_0x5b3e('0x32')](_0x5b3e('0x35'),_0x18a451[_0x5b3e('0x36')])},client9002)[_0x5b3e('0x29')](function(_0x528afb){var _0x5603e5=_0x528afb&&_0x528afb[_0x5b3e('0x37')](_0x5b3e('0x38'))>=0x0?!![]:![];logger['info'](_0x5b3e('0x39'),_0x29d8d0['id'],_0x18a451['id'],_0x18a451[_0x5b3e('0x36')],_0x5603e5?'ONLINE':_0x5b3e('0x3a'),_0x29d8d0[_0x5b3e('0x34')]?_0x29d8d0[_0x5b3e('0x34')]:_0x5b3e('0x3b'));return _0x5603e5;})[_0x5b3e('0x3c')](function(_0x46c73f){logger[_0x5b3e('0x1b')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x29d8d0['id'],_0x18a451['id'],_0x18a451[_0x5b3e('0x36')],util[_0x5b3e('0x3d')](_0x46c73f,{'showHidden':![],'depth':null}),_0x29d8d0[_0x5b3e('0x34')]?_0x29d8d0[_0x5b3e('0x34')]:_0x5b3e('0x3b'));return![];});}function checkWebsiteIntervals(_0x1373cb){var _0xb0ac69=_[_0x5b3e('0x3e')](_0x1373cb[_0x5b3e('0x3f')][_0x5b3e('0x40')],function(_0x5dc88e){var _0x546a9e=_0x5dc88e[_0x5b3e('0x2b')]({'plain':!![]});return iftimePromise(_0x546a9e,_0x1373cb);});return Promise[_0x5b3e('0x41')](_0xb0ac69)[_0x5b3e('0x29')](function(_0xad3af9){return _[_0x5b3e('0x42')](_0xad3af9);});}function createInteractionObject(_0xdc6508,_0x3a2178,_0x40b74f,_0x3c57d7){var _0xdbeee7=require('user-agent-parser');var _0x43dc0b=new _0xdbeee7();var _0x12ffd3=_0x43dc0b[_0x5b3e('0x43')](_0x40b74f[_0x5b3e('0x44')])['getResult']();var _0x2fb6be=_0x3a2178['customerIp'];if(_0x40b74f['cf-connecting-ip']){_0x2fb6be=_0x40b74f['cf-connecting-ip'];}else if(_0x40b74f[_0x5b3e('0x45')]){_0x2fb6be=_['first'](_0x40b74f['x-forwarded-for'][_0x5b3e('0x46')](','));}return{'ContactId':_0x3c57d7['id'],'ChatWebsiteId':_0xdc6508,'from':(_0x3c57d7[_0x5b3e('0x47')]||'')+'\x20'+(_0x3c57d7[_0x5b3e('0x48')]||''),'customerIp':_0x2fb6be,'customerPort':_0x40b74f[_0x5b3e('0x49')]?_0x40b74f[_0x5b3e('0x49')]:null,'referer':_0x3a2178[_0x5b3e('0x4a')],'browserName':_0x12ffd3[_0x5b3e('0x4b')][_0x5b3e('0x2e')]&&_0x12ffd3[_0x5b3e('0x4b')][_0x5b3e('0x4c')]?util[_0x5b3e('0x32')]('%s\x20%s',_0x12ffd3['browser'][_0x5b3e('0x2e')],_0x12ffd3['browser'][_0x5b3e('0x4c')]):_0x5b3e('0x4d'),'browserVersion':_0x12ffd3[_0x5b3e('0x4b')][_0x5b3e('0x4c')]||_0x5b3e('0x4d'),'osName':util['format']('%s\x20%s',_0x12ffd3['os'][_0x5b3e('0x2e')],_0x12ffd3['os']['version']),'osVersion':_0x12ffd3['os'][_0x5b3e('0x4c')],'deviceModel':_0x12ffd3[_0x5b3e('0x4e')]['model']&&_0x12ffd3[_0x5b3e('0x4e')][_0x5b3e('0x4f')]?util['format'](_0x5b3e('0x50'),_0x12ffd3[_0x5b3e('0x4e')][_0x5b3e('0x51')],_0x12ffd3['device'][_0x5b3e('0x4f')],_0x12ffd3[_0x5b3e('0x4e')]['type']):null,'deviceVendor':_0x12ffd3[_0x5b3e('0x4e')]['vendor'],'deviceType':_0x12ffd3[_0x5b3e('0x4e')][_0x5b3e('0x52')],'formData':JSON['stringify'](_0x3a2178)};}exports[_0x5b3e('0x53')]=function(_0x3a0d6c,_0x4146d4){var _0x166cda={'include':[{'model':db[_0x5b3e('0x54')],'as':_0x5b3e('0x55')}]},_0x3d4275={},_0x4835ef={'count':0x0,'rows':[]};var _0x5a6f45=_['map'](db[_0x5b3e('0x56')][_0x5b3e('0x57')],function(_0x50f97e){return{'name':_0x50f97e[_0x5b3e('0x58')],'type':_0x50f97e[_0x5b3e('0x52')]['key']};});_0x3d4275[_0x5b3e('0x51')]=_[_0x5b3e('0x3e')](_0x5a6f45,'name');_0x3d4275[_0x5b3e('0x59')]=_[_0x5b3e('0x5a')](_0x3a0d6c[_0x5b3e('0x59')]);_0x3d4275[_0x5b3e('0x5b')]=_[_0x5b3e('0x5c')](_0x3d4275[_0x5b3e('0x51')],_0x3d4275[_0x5b3e('0x59')]);_0x166cda['attributes']=_['intersection'](_0x3d4275['model'],qs['fields'](_0x3a0d6c[_0x5b3e('0x59')][_0x5b3e('0x5d')]));_0x166cda[_0x5b3e('0x5e')]=_0x166cda[_0x5b3e('0x5e')][_0x5b3e('0x5f')]?_0x166cda[_0x5b3e('0x5e')]:_0x3d4275[_0x5b3e('0x51')];if(!_0x3a0d6c[_0x5b3e('0x59')][_0x5b3e('0x60')](_0x5b3e('0x61'))){_0x166cda[_0x5b3e('0x22')]=qs[_0x5b3e('0x22')](_0x3a0d6c[_0x5b3e('0x59')][_0x5b3e('0x22')]);_0x166cda['offset']=qs['offset'](_0x3a0d6c[_0x5b3e('0x59')][_0x5b3e('0x25')]);}_0x166cda[_0x5b3e('0x62')]=qs['sort'](_0x3a0d6c['query'][_0x5b3e('0x63')]);_0x166cda[_0x5b3e('0x64')]=qs[_0x5b3e('0x5b')](_['pick'](_0x3a0d6c[_0x5b3e('0x59')],_0x3d4275[_0x5b3e('0x5b')]),_0x5a6f45);if(_0x3a0d6c[_0x5b3e('0x59')]['filter']){_0x166cda[_0x5b3e('0x64')]=_[_0x5b3e('0x65')](_0x166cda['where'],{'$or':_[_0x5b3e('0x3e')](_0x5a6f45,function(_0x1a20d4){if(_0x1a20d4[_0x5b3e('0x52')]!==_0x5b3e('0x66')){var _0x1a83b1={};_0x1a83b1[_0x1a20d4[_0x5b3e('0x2e')]]={'$like':'%'+_0x3a0d6c[_0x5b3e('0x59')][_0x5b3e('0x67')]+'%'};return _0x1a83b1;}})});}_0x166cda=_[_0x5b3e('0x65')]({},_0x166cda,_0x3a0d6c[_0x5b3e('0x68')]);var _0x376a00={'where':_0x166cda[_0x5b3e('0x64')]};return db[_0x5b3e('0x56')][_0x5b3e('0x24')](_0x376a00)[_0x5b3e('0x29')](function(_0x237765){_0x4835ef[_0x5b3e('0x24')]=_0x237765;if(_0x3a0d6c['query'][_0x5b3e('0x69')]){_0x166cda['include']=[{'all':!![]}];}return db[_0x5b3e('0x56')][_0x5b3e('0x6a')](_0x166cda);})[_0x5b3e('0x29')](function(_0x33fb47){_0x4835ef[_0x5b3e('0x6b')]=_0x33fb47;return _0x4835ef;})['then'](respondWithFilteredResult(_0x4146d4,_0x166cda))[_0x5b3e('0x3c')](handleError(_0x4146d4,null));};exports[_0x5b3e('0x6c')]=function(_0x1774b3,_0x223eb3){var _0x39a95f={'raw':![],'where':{'id':_0x1774b3[_0x5b3e('0x6d')]['id']},'include':[{'model':db['Pause'],'as':_0x5b3e('0x55')}]},_0x5e873f={};_0x5e873f[_0x5b3e('0x51')]=_[_0x5b3e('0x5a')](db[_0x5b3e('0x56')][_0x5b3e('0x57')]);_0x5e873f[_0x5b3e('0x59')]=_[_0x5b3e('0x5a')](_0x1774b3[_0x5b3e('0x59')]);_0x5e873f[_0x5b3e('0x5b')]=_['intersection'](_0x5e873f[_0x5b3e('0x51')],_0x5e873f[_0x5b3e('0x59')]);_0x39a95f['attributes']=_[_0x5b3e('0x5c')](_0x5e873f['model'],qs[_0x5b3e('0x5d')](_0x1774b3[_0x5b3e('0x59')][_0x5b3e('0x5d')]));_0x39a95f[_0x5b3e('0x5e')]=_0x39a95f[_0x5b3e('0x5e')][_0x5b3e('0x5f')]?_0x39a95f['attributes']:_0x5e873f[_0x5b3e('0x51')];if(_0x1774b3['query'][_0x5b3e('0x69')]){_0x39a95f['include']=[{'all':!![]}];}_0x39a95f=_[_0x5b3e('0x65')]({},_0x39a95f,_0x1774b3[_0x5b3e('0x68')]);return db[_0x5b3e('0x56')][_0x5b3e('0x6e')](_0x39a95f)[_0x5b3e('0x29')](handleEntityNotFound(_0x223eb3,null))[_0x5b3e('0x29')](respondWithResult(_0x223eb3,null))['catch'](handleError(_0x223eb3,null));};exports[_0x5b3e('0x6f')]=function(_0x12de91,_0x518e61){return db['ChatWebsite']['create'](_0x12de91[_0x5b3e('0x70')],{})[_0x5b3e('0x29')](function(_0x42b073){var _0x59b77c=_0x12de91[_0x5b3e('0x71')][_0x5b3e('0x2b')]({'plain':!![]});if(!_0x59b77c)throw new Error(_0x5b3e('0x72'));if(_0x59b77c[_0x5b3e('0x73')]===_0x5b3e('0x71')){var _0x17b229=_0x42b073[_0x5b3e('0x2b')]({'plain':!![]});var _0x448cbd=_0x5b3e('0x74');return db[_0x5b3e('0x75')][_0x5b3e('0x6e')]({'where':{'name':_0x448cbd,'userProfileId':_0x59b77c['userProfileId']},'raw':!![]})[_0x5b3e('0x29')](function(_0x384d03){if(_0x384d03&&_0x384d03['autoAssociation']===0x0){return db[_0x5b3e('0x2c')][_0x5b3e('0x6f')]({'name':_0x17b229[_0x5b3e('0x2e')],'resourceId':_0x17b229['id'],'type':_0x384d03['name'],'sectionId':_0x384d03['id']},{})['then'](function(){return _0x42b073;});}else{return _0x42b073;}})[_0x5b3e('0x3c')](function(_0x342bf7){logger[_0x5b3e('0x1b')](_0x5b3e('0x76'),_0x342bf7);throw _0x342bf7;});}return _0x42b073;})['then'](respondWithResult(_0x518e61,0xc9))[_0x5b3e('0x3c')](handleError(_0x518e61,null));};exports[_0x5b3e('0x28')]=function(_0x4c05b3,_0x24d2e9){if(_0x4c05b3['body']['id']){delete _0x4c05b3['body']['id'];}return db[_0x5b3e('0x56')][_0x5b3e('0x6e')]({'where':{'id':_0x4c05b3[_0x5b3e('0x6d')]['id']},'include':[{'model':db['Pause'],'as':_0x5b3e('0x55')}]})[_0x5b3e('0x29')](handleEntityNotFound(_0x24d2e9,null))[_0x5b3e('0x29')](saveUpdates(_0x4c05b3[_0x5b3e('0x70')],null))['then'](respondWithResult(_0x24d2e9,null))[_0x5b3e('0x3c')](handleError(_0x24d2e9,null));};exports[_0x5b3e('0x2a')]=function(_0x170efe,_0x1c6e31){return db[_0x5b3e('0x56')]['find']({'where':{'id':_0x170efe['params']['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x1c6e31,null))['then'](removeEntity(_0x1c6e31,null))[_0x5b3e('0x3c')](handleError(_0x1c6e31,null));};exports['describe']=function(_0x19cb12,_0x3281d5){return db[_0x5b3e('0x56')][_0x5b3e('0x77')]()[_0x5b3e('0x29')](respondWithResult(_0x3281d5,null))[_0x5b3e('0x3c')](handleError(_0x3281d5,null));};exports[_0x5b3e('0x78')]=function(_0x58e12c,_0x38b830){if(_0x58e12c[_0x5b3e('0x70')]['id']){delete _0x58e12c[_0x5b3e('0x70')]['id'];}return db[_0x5b3e('0x56')][_0x5b3e('0x6e')]({'where':{'id':_0x58e12c['params']['id']}})['then'](handleEntityNotFound(_0x38b830,null))[_0x5b3e('0x29')](function(_0x3d66a5){if(_0x3d66a5){_0x58e12c[_0x5b3e('0x70')]['ChatWebsiteId']=_0x3d66a5['id'];return db[_0x5b3e('0x79')][_0x5b3e('0x6f')](_0x58e12c[_0x5b3e('0x70')]);}})[_0x5b3e('0x29')](respondWithResult(_0x38b830,null))[_0x5b3e('0x3c')](handleError(_0x38b830,null));};exports[_0x5b3e('0x7a')]=function(_0x59ce5f,_0x58628b){var _0x562b55={'raw':![],'where':{}};var _0x2445a2={};var _0x28361f={'count':0x0,'rows':[]};return db[_0x5b3e('0x56')][_0x5b3e('0x7b')]({'where':{'id':_0x59ce5f[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x58628b,null))[_0x5b3e('0x29')](function(_0x2dc087){if(_0x2dc087){_0x2445a2[_0x5b3e('0x51')]=_[_0x5b3e('0x5a')](db['Disposition']['rawAttributes']);_0x2445a2['query']=_[_0x5b3e('0x5a')](_0x59ce5f['query']);_0x2445a2[_0x5b3e('0x5b')]=_['intersection'](_0x2445a2[_0x5b3e('0x51')],_0x2445a2[_0x5b3e('0x59')]);_0x562b55[_0x5b3e('0x5e')]=_[_0x5b3e('0x5c')](_0x2445a2[_0x5b3e('0x51')],qs[_0x5b3e('0x5d')](_0x59ce5f[_0x5b3e('0x59')][_0x5b3e('0x5d')]));_0x562b55[_0x5b3e('0x5e')]=_0x562b55[_0x5b3e('0x5e')]['length']?_0x562b55[_0x5b3e('0x5e')]:_0x2445a2[_0x5b3e('0x51')];if(!_0x59ce5f[_0x5b3e('0x59')][_0x5b3e('0x60')](_0x5b3e('0x61'))){_0x562b55[_0x5b3e('0x22')]=qs[_0x5b3e('0x22')](_0x59ce5f[_0x5b3e('0x59')][_0x5b3e('0x22')]);_0x562b55['offset']=qs[_0x5b3e('0x25')](_0x59ce5f['query'][_0x5b3e('0x25')]);}_0x562b55[_0x5b3e('0x62')]=qs['sort'](_0x59ce5f[_0x5b3e('0x59')][_0x5b3e('0x63')]);_0x562b55[_0x5b3e('0x64')]=qs[_0x5b3e('0x5b')](_[_0x5b3e('0x7c')](_0x59ce5f[_0x5b3e('0x59')],_0x2445a2['filters']));_0x562b55['where'][_0x5b3e('0x7d')]=_0x2dc087['id'];if(_0x59ce5f[_0x5b3e('0x59')][_0x5b3e('0x67')]){_0x562b55[_0x5b3e('0x64')]=_[_0x5b3e('0x65')](_0x562b55['where'],{'$or':_[_0x5b3e('0x3e')](_0x562b55[_0x5b3e('0x5e')],function(_0x26ca16){var _0x5a899f={};_0x5a899f[_0x26ca16]={'$like':'%'+_0x59ce5f['query'][_0x5b3e('0x67')]+'%'};return _0x5a899f;})});}_0x562b55=_[_0x5b3e('0x65')]({},_0x562b55,_0x59ce5f[_0x5b3e('0x68')]);return db[_0x5b3e('0x79')][_0x5b3e('0x24')]({'where':_0x562b55[_0x5b3e('0x64')]})[_0x5b3e('0x29')](function(_0x1e7425){_0x28361f[_0x5b3e('0x24')]=_0x1e7425;if(_0x59ce5f[_0x5b3e('0x59')][_0x5b3e('0x69')]){_0x562b55[_0x5b3e('0x7e')]=[{'all':!![]}];}return db[_0x5b3e('0x79')][_0x5b3e('0x6a')](_0x562b55);})[_0x5b3e('0x29')](function(_0x31d55a){_0x28361f[_0x5b3e('0x6b')]=_0x31d55a;return _0x28361f;});}})['then'](respondWithFilteredResult(_0x58628b,_0x562b55))[_0x5b3e('0x3c')](handleError(_0x58628b,null));};exports[_0x5b3e('0x7f')]=function(_0x3a181f,_0x3eff05){return db[_0x5b3e('0x56')][_0x5b3e('0x6e')]({'where':{'id':_0x3a181f[_0x5b3e('0x6d')]['id']}})['then'](handleEntityNotFound(_0x3eff05,null))['then'](function(_0x289ed2){if(_0x289ed2){return _0x289ed2[_0x5b3e('0x7f')](_0x3a181f[_0x5b3e('0x59')][_0x5b3e('0x80')]);}})['then'](respondWithStatusCode(_0x3eff05,null))[_0x5b3e('0x3c')](handleError(_0x3eff05,null));};exports[_0x5b3e('0x81')]=function(_0x2b47e7,_0x388873){if(_0x2b47e7[_0x5b3e('0x70')]['id']){delete _0x2b47e7[_0x5b3e('0x70')]['id'];}return db[_0x5b3e('0x56')][_0x5b3e('0x6e')]({'where':{'id':_0x2b47e7[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x388873,null))[_0x5b3e('0x29')](function(_0x3b3358){if(_0x3b3358){_0x2b47e7['body'][_0x5b3e('0x7d')]=_0x3b3358['id'];return db[_0x5b3e('0x82')][_0x5b3e('0x6f')](_0x2b47e7[_0x5b3e('0x70')]);}})['then'](respondWithResult(_0x388873,null))['catch'](handleError(_0x388873,null));};exports[_0x5b3e('0x83')]=function(_0x4af0c0,_0x57ff44){var _0x532bf4={'raw':![],'where':{}};var _0x4d25f4={};var _0x37fc92={'count':0x0,'rows':[]};return db[_0x5b3e('0x56')][_0x5b3e('0x7b')]({'where':{'id':_0x4af0c0[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x57ff44,null))[_0x5b3e('0x29')](function(_0x3d7172){if(_0x3d7172){_0x4d25f4[_0x5b3e('0x51')]=_[_0x5b3e('0x5a')](db[_0x5b3e('0x82')][_0x5b3e('0x57')]);_0x4d25f4[_0x5b3e('0x59')]=_[_0x5b3e('0x5a')](_0x4af0c0[_0x5b3e('0x59')]);_0x4d25f4['filters']=_[_0x5b3e('0x5c')](_0x4d25f4[_0x5b3e('0x51')],_0x4d25f4[_0x5b3e('0x59')]);_0x532bf4[_0x5b3e('0x5e')]=_[_0x5b3e('0x5c')](_0x4d25f4[_0x5b3e('0x51')],qs[_0x5b3e('0x5d')](_0x4af0c0['query'][_0x5b3e('0x5d')]));_0x532bf4[_0x5b3e('0x5e')]=_0x532bf4[_0x5b3e('0x5e')][_0x5b3e('0x5f')]?_0x532bf4[_0x5b3e('0x5e')]:_0x4d25f4['model'];if(!_0x4af0c0[_0x5b3e('0x59')][_0x5b3e('0x60')](_0x5b3e('0x61'))){_0x532bf4['limit']=qs['limit'](_0x4af0c0[_0x5b3e('0x59')][_0x5b3e('0x22')]);_0x532bf4[_0x5b3e('0x25')]=qs[_0x5b3e('0x25')](_0x4af0c0[_0x5b3e('0x59')]['offset']);}_0x532bf4['order']=qs['sort'](_0x4af0c0['query'][_0x5b3e('0x63')]);_0x532bf4['where']=qs['filters'](_['pick'](_0x4af0c0[_0x5b3e('0x59')],_0x4d25f4[_0x5b3e('0x5b')]));_0x532bf4[_0x5b3e('0x64')][_0x5b3e('0x7d')]=_0x3d7172['id'];if(_0x4af0c0[_0x5b3e('0x59')][_0x5b3e('0x67')]){_0x532bf4[_0x5b3e('0x64')]=_[_0x5b3e('0x65')](_0x532bf4[_0x5b3e('0x64')],{'$or':_[_0x5b3e('0x3e')](_0x532bf4[_0x5b3e('0x5e')],function(_0x4297b){var _0xe5bc84={};_0xe5bc84[_0x4297b]={'$like':'%'+_0x4af0c0['query'][_0x5b3e('0x67')]+'%'};return _0xe5bc84;})});}_0x532bf4=_[_0x5b3e('0x65')]({},_0x532bf4,_0x4af0c0[_0x5b3e('0x68')]);return db[_0x5b3e('0x82')][_0x5b3e('0x24')]({'where':_0x532bf4[_0x5b3e('0x64')]})[_0x5b3e('0x29')](function(_0x5a1801){_0x37fc92['count']=_0x5a1801;if(_0x4af0c0[_0x5b3e('0x59')]['includeAll']){_0x532bf4['include']=[{'all':!![]}];}return db[_0x5b3e('0x82')][_0x5b3e('0x6a')](_0x532bf4);})[_0x5b3e('0x29')](function(_0x2dfe4e){_0x37fc92[_0x5b3e('0x6b')]=_0x2dfe4e;return _0x37fc92;});}})[_0x5b3e('0x29')](respondWithFilteredResult(_0x57ff44,_0x532bf4))[_0x5b3e('0x3c')](handleError(_0x57ff44,null));};exports[_0x5b3e('0x84')]=function(_0x41780a,_0x2a24a5){return db['ChatWebsite'][_0x5b3e('0x6e')]({'where':{'id':_0x41780a[_0x5b3e('0x6d')]['id']}})['then'](handleEntityNotFound(_0x2a24a5,null))[_0x5b3e('0x29')](function(_0x5d31c7){if(_0x5d31c7){return _0x5d31c7['removeAnswers'](_0x41780a[_0x5b3e('0x59')][_0x5b3e('0x80')]);}})[_0x5b3e('0x29')](respondWithStatusCode(_0x2a24a5,null))[_0x5b3e('0x3c')](handleError(_0x2a24a5,null));};exports[_0x5b3e('0x85')]=function(_0x2c06f5,_0x31226b){_0x2c06f5[_0x5b3e('0x70')][_0x5b3e('0x86')]=_0x2c06f5[_0x5b3e('0x87')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x2c06f5['params']['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x31226b,null))[_0x5b3e('0x29')](saveUpdates(_0x2c06f5[_0x5b3e('0x70')],null))[_0x5b3e('0x29')](respondWithResult(_0x31226b,null))[_0x5b3e('0x3c')](handleError(_0x31226b,null));};exports[_0x5b3e('0x88')]=function(_0x1131b9,_0x318afe){_0x1131b9[_0x5b3e('0x70')][_0x5b3e('0x89')]=_0x1131b9['file'][_0x5b3e('0x8a')];return db[_0x5b3e('0x56')][_0x5b3e('0x6e')]({'where':{'id':_0x1131b9[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x318afe,null))[_0x5b3e('0x29')](saveUpdates(_0x1131b9[_0x5b3e('0x70')],null))[_0x5b3e('0x29')](respondWithResult(_0x318afe,null))[_0x5b3e('0x3c')](handleError(_0x318afe,null));};exports[_0x5b3e('0x8b')]=function(_0x2a70d1,_0x7c6909){_0x2a70d1[_0x5b3e('0x70')][_0x5b3e('0x8c')]=_0x2a70d1[_0x5b3e('0x87')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x2a70d1[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x7c6909,null))[_0x5b3e('0x29')](saveUpdates(_0x2a70d1[_0x5b3e('0x70')],null))[_0x5b3e('0x29')](respondWithResult(_0x7c6909,null))[_0x5b3e('0x3c')](handleError(_0x7c6909,null));};exports[_0x5b3e('0x8d')]=function(_0x133082,_0x5cf169){_0x133082[_0x5b3e('0x70')][_0x5b3e('0x8e')]=_0x133082[_0x5b3e('0x87')][_0x5b3e('0x8a')];return db['ChatWebsite']['find']({'where':{'id':_0x133082[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x5cf169,null))['then'](saveUpdates(_0x133082['body'],null))[_0x5b3e('0x29')](respondWithResult(_0x5cf169,null))[_0x5b3e('0x3c')](handleError(_0x5cf169,null));};exports[_0x5b3e('0x8f')]=function(_0x1124bc,_0x45a1ee){var _0x2cb167=path[_0x5b3e('0x90')](config[_0x5b3e('0x91')],_0x5b3e('0x92'));var _0x4a7d45={'where':{'id':_0x1124bc['params']['id']},'attributes':['id',_0x5b3e('0x86')],'raw':!![]};var _0x7150e6=![];return require(_0x5b3e('0x93'))[_0x5b3e('0x94')]()[_0x5b3e('0x29')](function(_0x2cdd09){if(_0x2cdd09){_0x7150e6=_0x2cdd09[_0x5b3e('0x95')];}})['then'](function(){return db[_0x5b3e('0x56')]['find'](_0x4a7d45);})['then'](handleEntityNotFound(_0x45a1ee,null))[_0x5b3e('0x29')](function(_0x36857c){if(_0x36857c){if(!_[_0x5b3e('0x96')](_0x36857c[_0x5b3e('0x86')])){if(fs['existsSync'](path[_0x5b3e('0x90')](config[_0x5b3e('0x91')],_0x5b3e('0x97'),_0x36857c[_0x5b3e('0x86')]))&&_0x7150e6){_0x2cb167=path[_0x5b3e('0x90')](config[_0x5b3e('0x91')],_0x5b3e('0x97'),_0x36857c[_0x5b3e('0x86')]);}}return _0x45a1ee['download'](_0x2cb167);}})[_0x5b3e('0x3c')](handleError(_0x45a1ee,null));};exports['getAvatar']=function(_0xae81fa,_0x4ca45d){var _0x5b3b12=path[_0x5b3e('0x90')](config['root'],_0x5b3e('0x98'));var _0x1910b9={'where':{'id':_0xae81fa[_0x5b3e('0x6d')]['id']},'attributes':['id',_0x5b3e('0x89')],'raw':!![]};return db['ChatWebsite'][_0x5b3e('0x6e')](_0x1910b9)[_0x5b3e('0x29')](handleEntityNotFound(_0x4ca45d,null))[_0x5b3e('0x29')](function(_0x1b3ee4){if(_0x1b3ee4){if(!_[_0x5b3e('0x96')](_0x1b3ee4[_0x5b3e('0x89')])){if(fs[_0x5b3e('0x99')](path[_0x5b3e('0x90')](config['root'],_0x5b3e('0x9a'),_0x1b3ee4[_0x5b3e('0x89')]))){_0x5b3b12=path[_0x5b3e('0x90')](config['root'],_0x5b3e('0x9a'),_0x1b3ee4[_0x5b3e('0x89')]);}}return _0x4ca45d['download'](_0x5b3b12);}})[_0x5b3e('0x3c')](handleError(_0x4ca45d,null));};exports[_0x5b3e('0x9b')]=function(_0x534090,_0x15f0f0){var _0x16b60=path['join'](config[_0x5b3e('0x91')],_0x5b3e('0x9c'));var _0x9b4ab0={'where':{'id':_0x534090[_0x5b3e('0x6d')]['id']},'attributes':['id',_0x5b3e('0x8c'),_0x5b3e('0x9d')],'raw':!![]};return db[_0x5b3e('0x56')][_0x5b3e('0x6e')](_0x9b4ab0)['then'](handleEntityNotFound(_0x15f0f0,null))[_0x5b3e('0x29')](function(_0xc9c204){if(_0xc9c204){if(!_[_0x5b3e('0x96')](_0xc9c204['customerAvatar'])){if(fs[_0x5b3e('0x99')](path[_0x5b3e('0x90')](config[_0x5b3e('0x91')],'server/files/images/avatars/',_0xc9c204['customerAvatar']))&&_0xc9c204[_0x5b3e('0x9d')]){_0x16b60=path['join'](config['root'],_0x5b3e('0x9a'),_0xc9c204[_0x5b3e('0x8c')]);}}return _0x15f0f0['download'](_0x16b60);}})[_0x5b3e('0x3c')](handleError(_0x15f0f0,null));};exports[_0x5b3e('0x9e')]=function(_0x24cf08,_0x5a3acd){var _0x19e30d=path['join'](config[_0x5b3e('0x91')],_0x5b3e('0x9f'));var _0x33fb94={'where':{'id':_0x24cf08[_0x5b3e('0x6d')]['id']},'attributes':['id',_0x5b3e('0x8e')],'raw':!![]};return db[_0x5b3e('0x56')][_0x5b3e('0x6e')](_0x33fb94)[_0x5b3e('0x29')](handleEntityNotFound(_0x5a3acd,null))['then'](function(_0x180107){if(_0x180107){if(!_[_0x5b3e('0x96')](_0x180107[_0x5b3e('0x8e')])){if(fs[_0x5b3e('0x99')](path[_0x5b3e('0x90')](config[_0x5b3e('0x91')],_0x5b3e('0x9a'),_0x180107[_0x5b3e('0x8e')]))){_0x19e30d=path['join'](config[_0x5b3e('0x91')],'server/files/images/avatars/',_0x180107[_0x5b3e('0x8e')]);}}return _0x5a3acd[_0x5b3e('0xa0')](_0x19e30d);}})[_0x5b3e('0x3c')](handleError(_0x5a3acd,null));};exports[_0x5b3e('0xa1')]=function(_0x247153,_0x56c88d){var _0x4360ec={'body':_0x247153[_0x5b3e('0x70')],'channel':_0x5b3e('0xa2')};var _0xe31ed7=[];var _0x2579dd=[];var _0x31b962={};var _0x2a6f44=![];return db[_0x5b3e('0xa3')][_0x5b3e('0x77')]()[_0x5b3e('0x29')](function(_0x5ea5a6){if(!_0x5ea5a6){throw new db[(_0x5b3e('0xa4'))][(_0x5b3e('0xa5'))](_0x5b3e('0xa6'));}_0xe31ed7=_[_0x5b3e('0xa7')](_[_0x5b3e('0x5a')](_0x5ea5a6),[_0x5b3e('0xa8'),_0x5b3e('0xa9')]);_0x2579dd=_[_0x5b3e('0xa7')](_[_0x5b3e('0x5a')](_0x5ea5a6),[_0x5b3e('0xa8'),'updatedAt','CompanyId','ListId']);if(_0x247153[_0x5b3e('0x70')]['id']){delete _0x247153[_0x5b3e('0x70')]['id'];}if(_[_0x5b3e('0x96')](_0x247153[_0x5b3e('0x70')]['from'])){throw new db[(_0x5b3e('0xa4'))]['ValidationError'](_0x5b3e('0xaa'));}if(_[_0x5b3e('0x96')](_0x247153[_0x5b3e('0x70')]['body'])||_0x247153[_0x5b3e('0x70')][_0x5b3e('0x70')]===''){throw new db[(_0x5b3e('0xa4'))]['ValidationError'](_0x5b3e('0xab'));}if(_[_0x5b3e('0x96')](_0x247153[_0x5b3e('0x70')][_0x5b3e('0xac')])){throw new db[(_0x5b3e('0xa4'))][(_0x5b3e('0xa5'))](_0x5b3e('0xad')+_0x2579dd);}if(!_[_0x5b3e('0xae')](_0x2579dd,_0x247153['body'][_0x5b3e('0xac')])){throw new db['Sequelize']['ValidationError'](_0x5b3e('0xaf')+_0x2579dd);}_0x31b962[_0x247153[_0x5b3e('0x70')]['mapKey']]=_0x247153[_0x5b3e('0x70')]['from'];})[_0x5b3e('0x29')](function(){return db[_0x5b3e('0x56')][_0x5b3e('0x6e')]({'where':{'id':_0x247153['params']['id']},'include':[{'model':db[_0x5b3e('0xb0')],'as':_0x5b3e('0xb1'),'include':[{'model':db[_0x5b3e('0xa3')],'as':_0x5b3e('0xb2'),'where':_0x31b962,'limit':0x1,'order':[[_0x5b3e('0xa9'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x5b3e('0xb3')},{'model':db[_0x5b3e('0x3f')],'as':'Interval','include':[{'model':db[_0x5b3e('0x3f')],'as':_0x5b3e('0x40'),'attributes':['id',_0x5b3e('0x36')],'raw':!![]}]}]});})[_0x5b3e('0x29')](function(_0x2b762c){if(!_0x2b762c)throw new APINotFoundError(util[_0x5b3e('0x32')](_0x5b3e('0xb4'),_0x247153['params']['id']));if(!_0x2b762c[_0x5b3e('0x3f')]||!_0x2b762c[_0x5b3e('0x3f')]['Intervals'])return[_0x2b762c,!![]];return[_0x2b762c,checkWebsiteIntervals(_0x2b762c)];})['spread'](function(_0x5f57eb,_0x508b2f){if(!_0x508b2f)throw new APIOutOfIntervalError();if(!_0x5f57eb[_0x5b3e('0xb1')])return;_0x4360ec[_0x5b3e('0xb5')]=_0x5f57eb;_0x4360ec[_0x5b3e('0xb6')]=_0x5f57eb['List'];_0x4360ec['applications']=_[_0x5b3e('0xb7')](_0x5f57eb[_0x5b3e('0xb3')],[_0x5b3e('0xb8')],[_0x5b3e('0xb9')]);if(_0x4360ec[_0x5b3e('0xb5')][_0x5b3e('0xb3')]){delete _0x4360ec[_0x5b3e('0xb5')][_0x5b3e('0xb3')];}if(_0x4360ec['account']['List']&&_0x4360ec[_0x5b3e('0xb5')][_0x5b3e('0xb1')][_0x5b3e('0xb2')][_0x5b3e('0x5f')]){return _0x4360ec[_0x5b3e('0xb5')][_0x5b3e('0xb1')][_0x5b3e('0xb2')][0x0];}var _0x2a681b=_[_0x5b3e('0x10')](_0x247153[_0x5b3e('0x70')],{'firstName':_0x247153[_0x5b3e('0x70')][_0x5b3e('0xba')],'ListId':_0x5f57eb['ListId']});_0x2a681b[_0x247153['body'][_0x5b3e('0xac')]]=_0x247153[_0x5b3e('0x70')]['from'];return db[_0x5b3e('0xa3')][_0x5b3e('0x6f')](_0x2a681b,{'fields':_0xe31ed7,'raw':!![]});})['then'](function(_0x32906b){_0x4360ec[_0x5b3e('0xbb')]=_0x32906b;var _0x2b6cfb=createInteractionObject(_0x247153['params']['id'],_0x247153[_0x5b3e('0x70')],_0x247153[_0x5b3e('0xbc')],_0x32906b);var _0x349c76={'ChatWebsiteId':_0x247153[_0x5b3e('0x6d')]['id'],'closed':![]};if(_0x247153[_0x5b3e('0x70')]['threadId']){_0x349c76[_0x5b3e('0xbd')]=_0x247153['body']['threadId'];return db[_0x5b3e('0xbe')][_0x5b3e('0x6e')]({'where':_0x349c76})[_0x5b3e('0x29')](function(_0x207f1b){if(_0x207f1b){_0x2a6f44=!![];return _0x207f1b;}_0x2b6cfb[_0x5b3e('0xbd')]=_0x247153[_0x5b3e('0x70')][_0x5b3e('0xbd')];_0x2b6cfb[_0x5b3e('0xbf')]=_0x247153[_0x5b3e('0x70')][_0x5b3e('0xbf')];return db['ChatInteraction']['create'](_0x2b6cfb);});}_0x349c76[_0x5b3e('0xc0')]=_0x32906b['id'];if(_0x247153[_0x5b3e('0x70')]['interaction']&&_0x247153[_0x5b3e('0x70')][_0x5b3e('0xc1')]['id']){_0x349c76['id']=_0x247153['body'][_0x5b3e('0xc1')]['id'];return db[_0x5b3e('0xbe')][_0x5b3e('0x6e')]({'where':_0x349c76})[_0x5b3e('0x29')](function(_0x1b49d1){if(_0x1b49d1){_0x2a6f44=!![];return _0x1b49d1;}return db[_0x5b3e('0xbe')]['create'](_0x2b6cfb);});}return db[_0x5b3e('0xbe')][_0x5b3e('0x6f')](_0x2b6cfb);})[_0x5b3e('0x29')](function(_0x2fc748){if(!_0x2a6f44)return _0x2fc748;var _0x2c26c3={'from':(_0x4360ec[_0x5b3e('0xbb')][_0x5b3e('0x47')]||'')+'\x20'+(_0x4360ec['contact'][_0x5b3e('0x48')]||'')};if(_0x247153[_0x5b3e('0x70')][_0x5b3e('0xbd')]&&_0x247153['body'][_0x5b3e('0xc2')]&&_0x247153[_0x5b3e('0x70')][_0x5b3e('0xbd')]!=_0x247153[_0x5b3e('0x70')][_0x5b3e('0xc2')]){_0x2c26c3[_0x5b3e('0xbd')]=_0x247153[_0x5b3e('0x70')][_0x5b3e('0xc2')];}return _0x2fc748['update'](_0x2c26c3);})['then'](function(_0x580e52){_0x4360ec[_0x5b3e('0xc1')]=_0x580e52[_0x5b3e('0x2b')]({'plain':!![]});_0x4360ec[_0x5b3e('0xc1')][_0x5b3e('0xc3')]=!_0x2a6f44;if(_0x4360ec[_0x5b3e('0xc1')][_0x5b3e('0xc3')]){if(_0x4360ec['account'][_0x5b3e('0xc4')]){_0x4360ec['applications'][_0x5b3e('0xc5')]({'id':0x0,'priority':_0x4360ec[_0x5b3e('0xc6')]['length']+0x1,'app':_0x5b3e('0xc7'),'appdata':_0x5b3e('0xc8'),'interval':'*,*,*,*'});}}return db['ChatMessage']['create']({'body':_0x247153['body']['body'],'ChatWebsiteId':_0x247153[_0x5b3e('0x6d')]['id'],'ChatInteractionId':_0x580e52['id'],'direction':'in','ContactId':_0x4360ec['contact']['id'],'AttachmentId':_0x247153[_0x5b3e('0x70')][_0x5b3e('0xc9')]});})[_0x5b3e('0x29')](function(_0x37cc79){_0x4360ec[_0x5b3e('0x1d')]=_0x37cc79;if(!_0x4360ec[_0x5b3e('0xc1')][_0x5b3e('0xca')]){return;}return db[_0x5b3e('0xcb')]['find']({'attributes':['id',_0x5b3e('0x2e')],'where':{'id':_0x4360ec[_0x5b3e('0xc1')][_0x5b3e('0xca')]}});})[_0x5b3e('0x29')](function(_0x4f2039){if(_0x4f2039){_0x4360ec[_0x5b3e('0xc6')][_0x5b3e('0xcc')]({'id':0x0,'priority':0x0,'app':_0x5b3e('0xcd'),'appdata':_0x4f2039[_0x5b3e('0x2e')]+','+(_0x4360ec[_0x5b3e('0xb5')][_0x5b3e('0xce')]||0xa),'interval':_0x5b3e('0xcf')});_0x4360ec[_0x5b3e('0xd0')]=!![];}if(!_0x4360ec[_0x5b3e('0xc1')][_0x5b3e('0xd1')]){return;}return db['ChatQueue'][_0x5b3e('0x6e')]({'attributes':['id',_0x5b3e('0x2e')],'where':{'id':_0x4360ec[_0x5b3e('0xc1')][_0x5b3e('0xd1')]}});})[_0x5b3e('0x29')](function(_0x18c380){if(_0x18c380){_0x4360ec['applications']['unshift']({'id':0x0,'priority':0x1,'app':_0x5b3e('0xd2'),'appdata':_0x18c380['name']+','+(_0x4360ec[_0x5b3e('0xb5')]['waitForTheAssignedQueue']||0x12c),'interval':_0x5b3e('0xcf')});}return respondWithRpcPromise('Start',_0x5b3e('0xd3'),_0x4360ec);})[_0x5b3e('0x29')](function(_0x4257be){respondWithRpcPromise(_0x5b3e('0xd4'),_0x5b3e('0xd4'),{'event':_0x5b3e('0xa1'),'message':_0x4257be},client9002);return _0x4257be;})[_0x5b3e('0x29')](respondWithResult(_0x56c88d,null))[_0x5b3e('0x3c')](APIHandleError(_0x56c88d));};exports['offline']=function(_0x42c76a,_0x9fa59f){var _0x1b0ab7,_0x4edad0,_0xfb7a2d;var _0x132f05=[];var _0x41fa9f={};var _0x137d33=_0x42c76a['files']||[];var _0x29f594=[];var _0x2d9d67;return db[_0x5b3e('0xa3')][_0x5b3e('0x77')]()[_0x5b3e('0x29')](function(_0x2066ff){if(!_0x2066ff){throw new db[(_0x5b3e('0xa4'))]['ValidationError']('no\x20available\x20attributes');}_0x132f05=_['difference'](_['keys'](_0x2066ff),[_0x5b3e('0xa8'),_0x5b3e('0xa9'),'CompanyId',_0x5b3e('0xd5')]);if(_0x42c76a[_0x5b3e('0x70')]['id']){delete _0x42c76a[_0x5b3e('0x70')]['id'];}if(_[_0x5b3e('0x96')](_0x42c76a[_0x5b3e('0x70')]['from'])){throw _0x9fa59f[_0x5b3e('0x1f')](0x1f4)['send'](new db[(_0x5b3e('0xa4'))][(_0x5b3e('0xa5'))](_0x5b3e('0xaa')));}if(_[_0x5b3e('0x96')](_0x42c76a[_0x5b3e('0x70')]['body'])||_0x42c76a[_0x5b3e('0x70')][_0x5b3e('0x70')]===''){throw _0x9fa59f[_0x5b3e('0x1f')](0x1f4)[_0x5b3e('0x2f')](new db[(_0x5b3e('0xa4'))][(_0x5b3e('0xa5'))](_0x5b3e('0xab')));}if(_[_0x5b3e('0x96')](_0x42c76a[_0x5b3e('0x70')][_0x5b3e('0xd6')])){throw _0x9fa59f[_0x5b3e('0x1f')](0x1f4)['send'](new db[(_0x5b3e('0xa4'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x132f05));}if(!_['includes'](_0x132f05,_0x42c76a[_0x5b3e('0x70')]['mapKeyOffline'])){throw _0x9fa59f[_0x5b3e('0x1f')](0x1f4)[_0x5b3e('0x2f')](new db[(_0x5b3e('0xa4'))][(_0x5b3e('0xa5'))](_0x5b3e('0xd7')+_0x132f05));}_0x41fa9f[_0x42c76a[_0x5b3e('0x70')][_0x5b3e('0xd6')]]=_0x42c76a['body'][_0x5b3e('0xba')];})[_0x5b3e('0x29')](function(){return db['ChatWebsite'][_0x5b3e('0x6e')]({'where':{'id':_0x42c76a['params']['id']},'include':[{'model':db[_0x5b3e('0xb0')],'as':_0x5b3e('0xb1')},{'model':db[_0x5b3e('0xd8')],'as':_0x5b3e('0xd8')}]});})[_0x5b3e('0x29')](handleEntityNotFound(_0x9fa59f,null))[_0x5b3e('0x29')](function(_0x40dfef){if(_0x40dfef&&_0x40dfef[_0x5b3e('0xb1')]){_0x4edad0=_0x40dfef;var _0x1473d3=_[_0x5b3e('0x10')](_0x42c76a[_0x5b3e('0x70')],{'firstName':_0x42c76a[_0x5b3e('0x70')][_0x5b3e('0xba')],'phone':_0x42c76a[_0x5b3e('0x70')]['from'],'ListId':_0x40dfef['ListId']});_0x1473d3[_0x42c76a[_0x5b3e('0x70')][_0x5b3e('0xd6')]]=_0x42c76a[_0x5b3e('0x70')][_0x5b3e('0xba')];return db[_0x5b3e('0xa3')][_0x5b3e('0xd9')]({'where':_0x41fa9f,'defaults':_0x1473d3});}})[_0x5b3e('0xda')](function(_0x4a8097){if(_0x4a8097){_0xfb7a2d=_0x4a8097;var _0x550631=fs['readFileSync'](path[_0x5b3e('0x90')](config['root'],_0x5b3e('0xdb')),_0x5b3e('0xdc'));var _0x2e071b=ejs[_0x5b3e('0xdd')](_0x550631,{'body':_[_0x5b3e('0xde')](_0x42c76a[_0x5b3e('0x70')][_0x5b3e('0x70')]),'bodyTitle':_0x4edad0[_0x5b3e('0xdf')]});return db[_0x5b3e('0xe0')][_0x5b3e('0x6f')]({'body':_0x2e071b,'plainBody':htmlToText['fromString'](_0x2e071b),'ContactId':_0x4a8097['id'],'ChatWebsiteId':_0x4edad0['id']});}})[_0x5b3e('0x29')](function(_0x3e9ac4){_0x2d9d67=_0x3e9ac4;if(_0x137d33[_0x5b3e('0x5f')]){var _0x735b76=_0x137d33[_0x5b3e('0x3e')](function(_0x194818){return{'name':_0x194818['originalname'],'basename':_0x194818['filename'],'type':_0x194818[_0x5b3e('0xe1')],'ChatOfflineMessageId':_0x3e9ac4['id']};});_0x29f594=_0x735b76[_0x5b3e('0x3e')](_0x2dacd0=>{var _0x58830d={'filename':_0x2dacd0['name'],'path':path['join'](config[_0x5b3e('0x91')],_0x5b3e('0xe2'),_0x5b3e('0xe3'),_0x5b3e('0xe4'),'offline-chat',_0x2dacd0[_0x5b3e('0xe5')])};return _0x58830d;});if(!_0x4edad0[_0x5b3e('0xe6')]){return db['sequelize']['transaction'](function(_0x2ebdd2){return db[_0x5b3e('0xe7')][_0x5b3e('0xe8')](_0x735b76,{'transaction':_0x2ebdd2});});}}})[_0x5b3e('0x29')](function(){if(_0x2d9d67){_0x1b0ab7=_0x2d9d67;return db[_0x5b3e('0xd8')][_0x5b3e('0x7b')]({'where':{'service':!![]},'include':[{'model':db[_0x5b3e('0xe9')],'as':_0x5b3e('0xea'),'raw':!![],'include':[{'model':db[_0x5b3e('0xeb')],'as':_0x5b3e('0xeb'),'raw':!![]}]}]});}})[_0x5b3e('0x29')](function(_0x5b11ef){if(_0x5b11ef&&_0x5b11ef[_0x5b3e('0xea')]&&_0x4edad0[_0x5b3e('0xec')]&&_0x4edad0[_0x5b3e('0xed')]){var _0xeeb9de=_0x5b11ef['getSmtpOptions']();return respondWithRpcPromise(_0x5b3e('0xee'),_0x5b3e('0xef'),{'account':_0xeeb9de,'message':{'from':util[_0x5b3e('0x32')]('\x22%s\x22\x20<%s>',_0x5b11ef['name'],_0x5b11ef[_0x5b3e('0xf0')]||_0x5b11ef[_0x5b3e('0xea')][_0x5b3e('0x71')]),'to':_0x4edad0[_0x5b3e('0xed')],'subject':_0x4edad0['offlineMessageSubject'],'html':_0x1b0ab7[_0x5b3e('0x70')],'attachments':_0x29f594}},client9003)[_0x5b3e('0x29')](function(){return _0x1b0ab7;})[_0x5b3e('0x3c')](function(_0x57cde6){logger[_0x5b3e('0x1b')](_0x57cde6);});}})[_0x5b3e('0x29')](function(){if(_0x4edad0&&_0x4edad0['openNewInteraction']&&_0x4edad0['MailAccountId']){var _0x456e2e=[];if(_0x137d33[_0x5b3e('0x5f')]){_0x456e2e=_0x137d33[_0x5b3e('0x3e')](function(_0x4a9475){return{'name':_0x4a9475[_0x5b3e('0xf1')],'basename':_0x4a9475[_0x5b3e('0x8a')],'type':_0x4a9475[_0x5b3e('0xe1')],'ChatOfflineMessageId':_0x2d9d67['id']};});}var _0x28f3de;if(!_['isNil'](_0x4edad0[_0x5b3e('0xf2')])){var _0x2fa034=_[_0x5b3e('0x3e')](_0x42c76a[_0x5b3e('0x70')],function(_0xe49cec){return _0xe49cec;});var _0x30c1c4=_[_0x5b3e('0xf3')](_0x2fa034)[0x0];var _0xf2de24=_['mapValues'](_0x30c1c4,function(_0x173b3f){return _0x173b3f;});_0x28f3de=_0xf2de24[0x1][_0x4edad0[_0x5b3e('0xf2')]];}var _0xeaf7bb={'from':_0xfb7a2d[_0x5b3e('0xf0')],'firstName':_0xfb7a2d['firstName'],'lastName':_0xfb7a2d[_0x5b3e('0x48')],'mapKey':'email','message':{'from':_0xfb7a2d[_0x5b3e('0xf0')],'to':_0x4edad0[_0x5b3e('0xd8')][_0x5b3e('0xf0')],'cc':'','subject':_[_0x5b3e('0x96')](_0x28f3de)?_0x4edad0[_0x5b3e('0xf4')]:_0x28f3de,'messageId':'','sentAt':new Date(),'attach':_0x456e2e[_0x5b3e('0x5f')],'attachments':_0x456e2e,'originChannel':_0x5b3e('0xf5'),'ChatWebsiteId':_0x4edad0['id'],'ChatOfflineMessageId':_0x1b0ab7['id'],'originTo':_0x4edad0[_0x5b3e('0xd8')][_0x5b3e('0xf0')]},'body':_0x1b0ab7[_0x5b3e('0x70')]};var _0x2dd1da={'account':{'id':_0x4edad0[_0x5b3e('0xf6')]},'body':_0xeaf7bb,'log':_0x5b3e('0xf7')};return respondWithRpcPromise(_0x5b3e('0xf7'),'notifyMail',_0x2dd1da,client9001)['then'](function(){return _0x1b0ab7;})[_0x5b3e('0x3c')](function(_0x516701){logger[_0x5b3e('0x1b')](_0x516701);});}return;})[_0x5b3e('0x29')](function(){if(_0x1b0ab7){return _0x1b0ab7;}})[_0x5b3e('0x29')](respondWithResult(_0x9fa59f,null))[_0x5b3e('0x3c')](function(){for(var _0x2b1143 of _0x137d33){var _0x41784a=path['join'](config[_0x5b3e('0x91')],_0x5b3e('0xe2'),'files',_0x5b3e('0xe4'),_0x5b3e('0xf8'),_0x2b1143[_0x5b3e('0x8a')]);fs_extra[_0x5b3e('0xf9')](_0x41784a)[_0x5b3e('0x3c')](function(_0x11156e){logger[_0x5b3e('0x1b')](_0x5b3e('0xfa'),_0x41784a,_0x11156e);});}});};exports[_0x5b3e('0xfb')]=function(_0x295ff9,_0x473f71){return db['ChatInteraction']['find']({'where':{'id':_0x295ff9[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x473f71,null))['then'](function(_0x57d6d7){if(_0x57d6d7){return _0x57d6d7[_0x5b3e('0xfb')](_0x295ff9[_0x5b3e('0x70')][_0x5b3e('0x80')],_[_0x5b3e('0xfc')](_0x295ff9['body'],[_0x5b3e('0x80'),'id'])||{});}})[_0x5b3e('0x29')](respondWithResult(_0x473f71,null))[_0x5b3e('0x3c')](handleError(_0x473f71,null));};exports[_0x5b3e('0xfd')]=function(_0x35ed63,_0xbd755){var _0x3b0c2c={'raw':![],'where':{}};var _0x31920f={};var _0x4e34b8={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5b3e('0x7b')]({'where':{'id':_0x35ed63['params']['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0xbd755,null))['then'](function(_0x1c5a42){if(_0x1c5a42){_0x31920f['model']=_[_0x5b3e('0x5a')](db[_0x5b3e('0xbe')][_0x5b3e('0x57')]);_0x31920f[_0x5b3e('0x59')]=_['keys'](_0x35ed63[_0x5b3e('0x59')]);_0x31920f[_0x5b3e('0x5b')]=_[_0x5b3e('0x5c')](_0x31920f[_0x5b3e('0x51')],_0x31920f[_0x5b3e('0x59')]);_0x3b0c2c['attributes']=_['intersection'](_0x31920f[_0x5b3e('0x51')],qs[_0x5b3e('0x5d')](_0x35ed63[_0x5b3e('0x59')][_0x5b3e('0x5d')]));_0x3b0c2c[_0x5b3e('0x5e')]=_0x3b0c2c['attributes'][_0x5b3e('0x5f')]?_0x3b0c2c[_0x5b3e('0x5e')]:_0x31920f[_0x5b3e('0x51')];if(!_0x35ed63['query'][_0x5b3e('0x60')]('nolimit')){_0x3b0c2c['limit']=qs[_0x5b3e('0x22')](_0x35ed63[_0x5b3e('0x59')]['limit']);_0x3b0c2c[_0x5b3e('0x25')]=qs[_0x5b3e('0x25')](_0x35ed63[_0x5b3e('0x59')][_0x5b3e('0x25')]);}_0x3b0c2c['order']=qs[_0x5b3e('0x63')](_0x35ed63[_0x5b3e('0x59')][_0x5b3e('0x63')]);_0x3b0c2c[_0x5b3e('0x64')]=qs['filters'](_[_0x5b3e('0x7c')](_0x35ed63[_0x5b3e('0x59')],_0x31920f[_0x5b3e('0x5b')]));_0x3b0c2c[_0x5b3e('0x64')][_0x5b3e('0x7d')]=_0x1c5a42['id'];if(_0x35ed63['query'][_0x5b3e('0x67')]){_0x3b0c2c[_0x5b3e('0x64')]=_['merge'](_0x3b0c2c[_0x5b3e('0x64')],{'$or':_[_0x5b3e('0x3e')](_0x3b0c2c['attributes'],function(_0x37f536){var _0x248fee={};_0x248fee[_0x37f536]={'$like':'%'+_0x35ed63[_0x5b3e('0x59')][_0x5b3e('0x67')]+'%'};return _0x248fee;})});}_0x3b0c2c=_[_0x5b3e('0x65')]({},_0x3b0c2c,_0x35ed63[_0x5b3e('0x68')]);return db[_0x5b3e('0xbe')][_0x5b3e('0x24')]({'where':_0x3b0c2c[_0x5b3e('0x64')]})[_0x5b3e('0x29')](function(_0x435636){_0x4e34b8[_0x5b3e('0x24')]=_0x435636;if(_0x35ed63[_0x5b3e('0x59')]['includeAll']){_0x3b0c2c[_0x5b3e('0x7e')]=[{'model':db[_0x5b3e('0xa3')],'as':_0x5b3e('0xfe'),'required':![]},{'model':db[_0x5b3e('0xcb')],'as':_0x5b3e('0xff'),'attributes':[_0x5b3e('0x2e'),_0x5b3e('0x100'),_0x5b3e('0x101')],'required':![]},{'model':db[_0x5b3e('0x102')],'as':_0x5b3e('0x103'),'attributes':['id','name',_0x5b3e('0x104')],'where':_0x35ed63[_0x5b3e('0x59')][_0x5b3e('0x105')]?{'id':_0x35ed63['query'][_0x5b3e('0x105')]}:undefined,'required':_0x35ed63[_0x5b3e('0x59')][_0x5b3e('0x105')]?!![]:![]}];}return db[_0x5b3e('0xbe')][_0x5b3e('0x6a')](_0x3b0c2c);})[_0x5b3e('0x29')](function(_0x3fe59e){_0x4e34b8['rows']=_0x3fe59e;return _0x4e34b8;});}})[_0x5b3e('0x29')](respondWithFilteredResult(_0xbd755,_0x3b0c2c))[_0x5b3e('0x3c')](handleError(_0xbd755,null));};exports['getSnippet']=function(_0x341143,_0x2493a6){var _0x5852c6=0x0;var _0x5ecfff=0x0;var _0x3c9291=![];var _0x3f16e4;var _0x5b51c0;return db['ChatWebsite'][_0x5b3e('0x6e')]({'where':{'id':_0x341143[_0x5b3e('0x6d')]['id']},'include':[{'model':db[_0x5b3e('0x3f')],'as':_0x5b3e('0x3f'),'include':[{'model':db[_0x5b3e('0x3f')],'as':_0x5b3e('0x40'),'attributes':['id','interval']}]}]})['then'](handleEntityNotFound(_0x2493a6,null))[_0x5b3e('0x29')](function(_0x24eb3d){if(_0x24eb3d){_0x3f16e4=_0x24eb3d;return _0x24eb3d['getProactiveActions']({'raw':!![]});}})[_0x5b3e('0x29')](function(_0x2627a5){if(_0x3f16e4){if(_0x2627a5){_0x5b51c0=_0x2627a5;}}return require('../../config/license/util')[_0x5b3e('0x94')]();})[_0x5b3e('0x29')](function(_0x50c01b){if(_0x50c01b){_0x5ecfff=_0x50c01b['virtual'];_0x3c9291=_0x50c01b[_0x5b3e('0x95')];}})[_0x5b3e('0x29')](function(){return db[_0x5b3e('0xbe')][_0x5b3e('0x24')]({'where':{'closed':![]}});})[_0x5b3e('0x29')](function(_0x3c1346){_0x5852c6=_0x3c1346;if(_0x5ecfff&&_0x3c1346>_0x5ecfff){return db['License'][_0x5b3e('0x7b')]({'where':{'id':0x1}})[_0x5b3e('0x29')](function(_0x58984e){if(_0x58984e){_0x58984e[_0x5b3e('0x106')]('chatLicenseExceeded');}});}})[_0x5b3e('0x29')](function(){if(!_0x3f16e4[_0x5b3e('0x3f')]||!_0x3f16e4['Interval'][_0x5b3e('0x40')])return!![];return checkWebsiteIntervals(_0x3f16e4);})['then'](function(_0x3605e3){var _0x399f88=fs[_0x5b3e('0x107')](path[_0x5b3e('0x90')](config['root'],_0x5b3e('0x108')),'utf8');var _0x277a58=new url[(_0x5b3e('0x109'))](_0x3f16e4[_0x5b3e('0x10a')])[_0x5b3e('0x10b')];var _0x20c67e=_0x5b3e('0x10c');var _0xd01fa2=![];var _0x4ac110={'chatVersion':_0x20c67e,'chatWebsiteAddressOrigin':_0x277a58,'remote':_0x3f16e4[_0x5b3e('0x10d')],'query':querystring[_0x5b3e('0x1a')](_[_0x5b3e('0x65')](_0x3f16e4[_0x5b3e('0x2b')]({'plain':!![]}),{'customerIp':_0x341143[_0x5b3e('0xbc')][_0x5b3e('0x45')]||_0x341143['headers'][_0x5b3e('0x10e')]||_0x341143[_0x5b3e('0x10f')][_0x5b3e('0x110')]||_0x341143['ip'],'referer':_0x341143[_0x5b3e('0xbc')][_0x5b3e('0x4a')],'openedInteractions':_0x5852c6,'maxInteractions':_0x5ecfff,'virtual':_0x3c9291[_0x5b3e('0x111')],'online':_0x3605e3,'custom':_0x3c9291}))[_0x5b3e('0x112')](/'/g,'\x5c\x27')};_0x2493a6[_0x5b3e('0x2f')](ejs[_0x5b3e('0xdd')](Mustache[_0x5b3e('0xdd')](_0x399f88,_0x4ac110),{'proactiveActions':_0x5b51c0,'alignment':_0x3f16e4['alignment'],'verticalAlignment':_0x3f16e4[_0x5b3e('0x113')],'div_color':_0x3f16e4[_0x5b3e('0x104')],'labelText':_0x3f16e4[_0x5b3e('0x114')],'text_color':_0x3f16e4[_0x5b3e('0x115')],'text_button_color':_0x3f16e4[_0x5b3e('0x116')],'button_color':_0x3f16e4[_0x5b3e('0x117')],'background_color':_0x3f16e4[_0x5b3e('0x118')],'hideWhenOffline':_0x3f16e4[_0x5b3e('0x119')],'intervalId':_0x3f16e4[_0x5b3e('0x11a')],'isDevelopment':_0xd01fa2,'chatVersion':_0x20c67e}));})['catch'](handleError(_0x2493a6,null));};exports[_0x5b3e('0x11b')]=function(_0x3bc5f0,_0x422b45){var _0x21a894=_0x3bc5f0[_0x5b3e('0x6d')]['id'];var _0x13f02f=_0x3bc5f0[_0x5b3e('0x70')];var _0x2ea515=0xc8;var _0x3f34d2=null;return db[_0x5b3e('0x11c')][_0x5b3e('0x11d')]({'isolationLevel':db['sequelize'][_0x5b3e('0x11e')][_0x5b3e('0x11f')][_0x5b3e('0x120')]},function(_0x4f24a4){return db[_0x5b3e('0x56')][_0x5b3e('0x7b')]({'where':{'id':_0x21a894},'transaction':_0x4f24a4})[_0x5b3e('0x29')](function(_0x5c62a0){if(_0x5c62a0){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x21a894},'transaction':_0x4f24a4})[_0x5b3e('0x29')](function(){var _0x1397d3=_[_0x5b3e('0x3e')](_0x13f02f,function(_0x383a8a){_0x383a8a['ChatWebsiteId']=_0x21a894;return _0x383a8a;});return db[_0x5b3e('0x121')][_0x5b3e('0xe8')](_0x1397d3,{'transaction':_0x4f24a4});});}else{_0x2ea515=0x194;_0x3f34d2=[];}});})[_0x5b3e('0x29')](function(){if(_0x2ea515!==0x194){return db[_0x5b3e('0x121')][_0x5b3e('0x122')]({'where':{'ChatWebsiteId':_0x21a894},'order':_0x5b3e('0xb8')})[_0x5b3e('0x29')](function(_0x445ab0){_0x3f34d2=_0x445ab0;});}})[_0x5b3e('0x3c')](function(_0x5ef5fb){_0x2ea515=0x1f4;logger[_0x5b3e('0x1b')](_0x5ef5fb[_0x5b3e('0x2d')]);if(_0x5ef5fb['name']){delete _0x5ef5fb[_0x5b3e('0x2e')];}_0x3f34d2=_0x5ef5fb;})['finally'](function(){if(_0x3f34d2===null){_0x422b45[_0x5b3e('0x123')](_0x2ea515);}else{if(_0x2ea515===0x1f4){_0x422b45[_0x5b3e('0x1f')](_0x2ea515)['send'](_0x3f34d2);}else{_0x422b45[_0x5b3e('0x1f')](_0x2ea515)[_0x5b3e('0x21')](_0x3f34d2);}}});};exports['getApplications']=function(_0x149328,_0x3437a0){var _0x5743db={};var _0x58809e={};var _0x30b850;var _0x48cef3;return db[_0x5b3e('0x56')][_0x5b3e('0x7b')]({'where':{'id':_0x149328[_0x5b3e('0x6d')]['id']}})['then'](handleEntityNotFound(_0x3437a0,null))[_0x5b3e('0x29')](function(_0x366796){if(_0x366796){_0x30b850=_0x366796;_0x58809e[_0x5b3e('0x51')]=_[_0x5b3e('0x5a')](db[_0x5b3e('0x121')][_0x5b3e('0x57')]);_0x58809e[_0x5b3e('0x59')]=_['keys'](_0x149328[_0x5b3e('0x59')]);_0x58809e[_0x5b3e('0x5b')]=_[_0x5b3e('0x5c')](_0x58809e['model'],_0x58809e['query']);_0x5743db[_0x5b3e('0x5e')]=_[_0x5b3e('0x5c')](_0x58809e['model'],qs['fields'](_0x149328[_0x5b3e('0x59')][_0x5b3e('0x5d')]));_0x5743db['attributes']=_0x5743db['attributes'][_0x5b3e('0x5f')]?_0x5743db[_0x5b3e('0x5e')]:_0x58809e[_0x5b3e('0x51')];_0x5743db[_0x5b3e('0x62')]=qs[_0x5b3e('0x63')](_0x149328[_0x5b3e('0x59')]['sort']);_0x5743db[_0x5b3e('0x64')]=qs[_0x5b3e('0x5b')](_[_0x5b3e('0x7c')](_0x149328['query'],_0x58809e[_0x5b3e('0x5b')]));if(_0x149328['query'][_0x5b3e('0x67')]){_0x5743db[_0x5b3e('0x64')]=_[_0x5b3e('0x65')](_0x5743db['where'],{'$or':_[_0x5b3e('0x3e')](_0x5743db[_0x5b3e('0x5e')],function(_0x4af0f3){var _0x1fe447={};_0x1fe447[_0x4af0f3]={'$like':'%'+_0x149328[_0x5b3e('0x59')][_0x5b3e('0x67')]+'%'};return _0x1fe447;})});}_0x5743db=_[_0x5b3e('0x65')]({},_0x5743db,_0x149328[_0x5b3e('0x68')]);return _0x30b850[_0x5b3e('0x124')](_0x5743db);}})[_0x5b3e('0x29')](function(_0x16c194){if(_0x16c194){_0x48cef3=_0x16c194[_0x5b3e('0x5f')];if(!_0x149328['query'][_0x5b3e('0x60')](_0x5b3e('0x61'))){_0x5743db[_0x5b3e('0x22')]=qs[_0x5b3e('0x22')](_0x149328[_0x5b3e('0x59')][_0x5b3e('0x22')]);_0x5743db[_0x5b3e('0x25')]=qs[_0x5b3e('0x25')](_0x149328[_0x5b3e('0x59')][_0x5b3e('0x25')]);}return _0x30b850[_0x5b3e('0x124')](_0x5743db);}})['then'](function(_0x2c3bf2){if(_0x2c3bf2){return _0x2c3bf2?{'count':_0x48cef3,'rows':_0x2c3bf2}:null;}})[_0x5b3e('0x29')](respondWithResult(_0x3437a0,null))[_0x5b3e('0x3c')](handleError(_0x3437a0,null));};exports[_0x5b3e('0x125')]=function(_0x2cb895,_0x2fc63b){return db[_0x5b3e('0x126')][_0x5b3e('0x6e')]({'where':{'id':_0x2cb895[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x2fc63b,null))[_0x5b3e('0x29')](function(_0x4ed019){if(_0x4ed019){return _0x4ed019[_0x5b3e('0x125')](_0x2cb895['body'][_0x5b3e('0x80')],_[_0x5b3e('0xfc')](_0x2cb895[_0x5b3e('0x70')],[_0x5b3e('0x80'),'id'])||{});}})[_0x5b3e('0x29')](respondWithResult(_0x2fc63b,null))[_0x5b3e('0x3c')](handleError(_0x2fc63b,null));};exports[_0x5b3e('0x127')]=function(_0x37db5e,_0x1be671){var _0x5e62d9={};var _0x597506={};var _0x4852c4;var _0x10335a;return db[_0x5b3e('0x56')][_0x5b3e('0x7b')]({'where':{'id':_0x37db5e[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x1be671,null))[_0x5b3e('0x29')](function(_0x2d125d){if(_0x2d125d){_0x4852c4=_0x2d125d;_0x597506[_0x5b3e('0x51')]=_['keys'](db['ChatProactiveAction']['rawAttributes']);_0x597506[_0x5b3e('0x59')]=_['keys'](_0x37db5e[_0x5b3e('0x59')]);_0x597506['filters']=_[_0x5b3e('0x5c')](_0x597506[_0x5b3e('0x51')],_0x597506[_0x5b3e('0x59')]);_0x5e62d9[_0x5b3e('0x5e')]=_[_0x5b3e('0x5c')](_0x597506['model'],qs[_0x5b3e('0x5d')](_0x37db5e[_0x5b3e('0x59')][_0x5b3e('0x5d')]));_0x5e62d9[_0x5b3e('0x5e')]=_0x5e62d9['attributes'][_0x5b3e('0x5f')]?_0x5e62d9[_0x5b3e('0x5e')]:_0x597506[_0x5b3e('0x51')];_0x5e62d9[_0x5b3e('0x62')]=qs[_0x5b3e('0x63')](_0x37db5e['query'][_0x5b3e('0x63')]);_0x5e62d9[_0x5b3e('0x64')]=qs['filters'](_[_0x5b3e('0x7c')](_0x37db5e[_0x5b3e('0x59')],_0x597506['filters']));if(_0x37db5e[_0x5b3e('0x59')][_0x5b3e('0x67')]){_0x5e62d9['where']=_['merge'](_0x5e62d9[_0x5b3e('0x64')],{'$or':_[_0x5b3e('0x3e')](_0x5e62d9['attributes'],function(_0x46148a){var _0x1b3952={};_0x1b3952[_0x46148a]={'$like':'%'+_0x37db5e[_0x5b3e('0x59')][_0x5b3e('0x67')]+'%'};return _0x1b3952;})});}_0x5e62d9=_['merge']({},_0x5e62d9,_0x37db5e[_0x5b3e('0x68')]);return _0x4852c4[_0x5b3e('0x127')](_0x5e62d9);}})[_0x5b3e('0x29')](function(_0x209eed){if(_0x209eed){_0x10335a=_0x209eed[_0x5b3e('0x5f')];if(!_0x37db5e[_0x5b3e('0x59')]['hasOwnProperty']('nolimit')){_0x5e62d9[_0x5b3e('0x22')]=qs[_0x5b3e('0x22')](_0x37db5e[_0x5b3e('0x59')][_0x5b3e('0x22')]);_0x5e62d9['offset']=qs[_0x5b3e('0x25')](_0x37db5e[_0x5b3e('0x59')]['offset']);}return _0x4852c4['getProactiveActions'](_0x5e62d9);}})[_0x5b3e('0x29')](function(_0x33b6be){if(_0x33b6be){return _0x33b6be?{'count':_0x10335a,'rows':_0x33b6be}:null;}})[_0x5b3e('0x29')](respondWithResult(_0x1be671,null))[_0x5b3e('0x3c')](handleError(_0x1be671,null));};exports[_0x5b3e('0x128')]=function(_0x1696ec,_0x2b7b74){var _0x2b4064=_0x1696ec[_0x5b3e('0x59')]['online']===_0x5b3e('0x129')?_0x5b3e('0x12a'):_0x5b3e('0x12b');return db[_0x5b3e('0x56')][_0x5b3e('0x6e')]({'attributes':['id',_0x2b4064],'where':{'id':_0x1696ec[_0x5b3e('0x6d')]['id']}})['then'](handleEntityNotFound(_0x2b7b74,null))['then'](function(_0x5e32eb){if(_0x5e32eb){var _0x295a80=_0x5e32eb[_0x2b4064];var _0x1cb4d9=_0x295a80&&_0x295a80[_0x5b3e('0x12c')]?_0x295a80['items']:[];_0x2b7b74[_0x5b3e('0x2f')]({'fromKey':_['isNil'](_0x295a80[_0x5b3e('0x12d')])?undefined:_0x295a80['fromKey'],'count':_0x1cb4d9['length'],'rows':_0x1cb4d9});}})['catch'](handleError(_0x2b7b74,null));};exports[_0x5b3e('0x12e')]=function(_0x3d4f10,_0x16331d){var _0x3f6d37={'raw':![],'where':{}};var _0x549711={};var _0x1e8f47={'count':0x0,'rows':[]};return db[_0x5b3e('0x56')][_0x5b3e('0x7b')]({'where':{'id':_0x3d4f10[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x16331d,null))[_0x5b3e('0x29')](function(_0x869738){if(_0x869738){_0x549711['model']=_[_0x5b3e('0x5a')](db[_0x5b3e('0xe0')][_0x5b3e('0x57')]);_0x549711[_0x5b3e('0x59')]=_[_0x5b3e('0x5a')](_0x3d4f10[_0x5b3e('0x59')]);_0x549711['filters']=_[_0x5b3e('0x5c')](_0x549711[_0x5b3e('0x51')],_0x549711[_0x5b3e('0x59')]);_0x3f6d37[_0x5b3e('0x5e')]=_[_0x5b3e('0x5c')](_0x549711[_0x5b3e('0x51')],qs['fields'](_0x3d4f10[_0x5b3e('0x59')][_0x5b3e('0x5d')]));_0x3f6d37[_0x5b3e('0x5e')]=_0x3f6d37[_0x5b3e('0x5e')][_0x5b3e('0x5f')]?_0x3f6d37['attributes']:_0x549711[_0x5b3e('0x51')];if(!_0x3d4f10[_0x5b3e('0x59')]['hasOwnProperty'](_0x5b3e('0x61'))){_0x3f6d37['limit']=qs['limit'](_0x3d4f10[_0x5b3e('0x59')][_0x5b3e('0x22')]);_0x3f6d37[_0x5b3e('0x25')]=qs[_0x5b3e('0x25')](_0x3d4f10[_0x5b3e('0x59')]['offset']);}_0x3f6d37[_0x5b3e('0x62')]=qs[_0x5b3e('0x63')](_0x3d4f10[_0x5b3e('0x59')]['sort']);_0x3f6d37[_0x5b3e('0x64')]=qs[_0x5b3e('0x5b')](_[_0x5b3e('0x7c')](_0x3d4f10[_0x5b3e('0x59')],_0x549711[_0x5b3e('0x5b')]));_0x3f6d37['where']['ChatWebsiteId']=_0x869738['id'];if(_0x3d4f10[_0x5b3e('0x59')]['filter']){_0x3f6d37['where']=_[_0x5b3e('0x65')](_0x3f6d37[_0x5b3e('0x64')],{'$or':_[_0x5b3e('0x3e')](_0x3f6d37[_0x5b3e('0x5e')],function(_0x30b7e5){var _0x57acee={};_0x57acee[_0x30b7e5]={'$like':'%'+_0x3d4f10[_0x5b3e('0x59')][_0x5b3e('0x67')]+'%'};return _0x57acee;})});}_0x3f6d37=_[_0x5b3e('0x65')]({},_0x3f6d37,_0x3d4f10[_0x5b3e('0x68')]);return db['ChatOfflineMessage']['count']({'where':_0x3f6d37[_0x5b3e('0x64')]})['then'](function(_0x4d561c){_0x1e8f47['count']=_0x4d561c;if(_0x3d4f10[_0x5b3e('0x59')][_0x5b3e('0x69')]){_0x3f6d37[_0x5b3e('0x7e')]=[{'all':!![]}];}else{_0x3f6d37['include']=[{'model':db[_0x5b3e('0xa3')],'as':'Contact','required':![]},{'model':db[_0x5b3e('0xe7')],'as':_0x5b3e('0x12f'),'required':![]}];}return db[_0x5b3e('0xe0')][_0x5b3e('0x6a')](_0x3f6d37);})[_0x5b3e('0x29')](function(_0x4a074f){_0x1e8f47[_0x5b3e('0x6b')]=_0x4a074f;return _0x1e8f47;});}})[_0x5b3e('0x29')](respondWithFilteredResult(_0x16331d,_0x3f6d37))['catch'](handleError(_0x16331d,null));};exports[_0x5b3e('0x130')]=function(_0x1137d7,_0x1097b3){return db[_0x5b3e('0x56')][_0x5b3e('0x6e')]({'where':{'id':_0x1137d7['params']['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x1097b3,null))[_0x5b3e('0x29')](function(_0x19556b){if(_0x19556b){return _0x19556b[_0x5b3e('0x130')](_0x1137d7[_0x5b3e('0x70')]['ids'],_['omit'](_0x1137d7[_0x5b3e('0x70')],['ids','id'])||{})[_0x5b3e('0xda')](function(_0x233fd0){for(var _0x1bb28d=0x0;_0x1bb28d<_0x1137d7[_0x5b3e('0x70')]['ids'][_0x5b3e('0x5f')];_0x1bb28d+=0x1){socket[_0x5b3e('0x131')]('userChatWebsite:save',{'UserId':Number(_0x1137d7['body']['ids'][_0x1bb28d]),'ChatWebsiteId':Number(_0x1137d7['params']['id'])});}return _0x233fd0;});}})['then'](respondWithResult(_0x1097b3,null))[_0x5b3e('0x3c')](handleError(_0x1097b3,null));};exports[_0x5b3e('0x132')]=function(_0x103d7e,_0x529a80){return db[_0x5b3e('0x56')][_0x5b3e('0x6e')]({'where':{'id':_0x103d7e[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x529a80,null))[_0x5b3e('0x29')](function(_0x5aee89){if(_0x5aee89){return _0x5aee89['removeAgents'](_0x103d7e[_0x5b3e('0x59')][_0x5b3e('0x80')])['then'](function(){if(_['isArray'](_0x103d7e['query'][_0x5b3e('0x80')])){for(var _0x3a3c29=0x0;_0x3a3c29<_0x103d7e[_0x5b3e('0x59')][_0x5b3e('0x80')][_0x5b3e('0x5f')];_0x3a3c29+=0x1){socket[_0x5b3e('0x131')]('userChatWebsite:remove',{'UserId':Number(_0x103d7e[_0x5b3e('0x59')][_0x5b3e('0x80')][_0x3a3c29]),'ChatWebsiteId':Number(_0x103d7e[_0x5b3e('0x6d')]['id'])});}}else{socket[_0x5b3e('0x131')](_0x5b3e('0x133'),{'UserId':Number(_0x103d7e[_0x5b3e('0x59')][_0x5b3e('0x80')]),'ChatWebsiteId':Number(_0x103d7e['params']['id'])});}});}})['then'](respondWithStatusCode(_0x529a80,null))[_0x5b3e('0x3c')](handleError(_0x529a80,null));};exports[_0x5b3e('0x134')]=function(_0x47806c,_0x4bfe9f){var _0x3fd6bb={};var _0x5d871d={};var _0x4a9512;var _0x3e4138;return db['ChatWebsite'][_0x5b3e('0x7b')]({'where':{'id':_0x47806c[_0x5b3e('0x6d')]['id']}})[_0x5b3e('0x29')](handleEntityNotFound(_0x4bfe9f,null))['then'](function(_0x5d2db6){if(_0x5d2db6){_0x4a9512=_0x5d2db6;_0x5d871d[_0x5b3e('0x51')]=_[_0x5b3e('0x5a')](db['User'][_0x5b3e('0x57')]);_0x5d871d[_0x5b3e('0x59')]=_['keys'](_0x47806c[_0x5b3e('0x59')]);_0x5d871d['filters']=_[_0x5b3e('0x5c')](_0x5d871d['model'],_0x5d871d[_0x5b3e('0x59')]);_0x3fd6bb[_0x5b3e('0x5e')]=_['intersection'](_0x5d871d[_0x5b3e('0x51')],qs[_0x5b3e('0x5d')](_0x47806c[_0x5b3e('0x59')][_0x5b3e('0x5d')]));_0x3fd6bb['attributes']=_0x3fd6bb[_0x5b3e('0x5e')]['length']?_0x3fd6bb[_0x5b3e('0x5e')]:_0x5d871d[_0x5b3e('0x51')];_0x3fd6bb['order']=qs[_0x5b3e('0x63')](_0x47806c[_0x5b3e('0x59')]['sort']);_0x3fd6bb[_0x5b3e('0x64')]=qs[_0x5b3e('0x5b')](_[_0x5b3e('0x7c')](_0x47806c[_0x5b3e('0x59')],_0x5d871d[_0x5b3e('0x5b')]));if(_0x47806c[_0x5b3e('0x59')]['filter']){_0x3fd6bb['where']=_[_0x5b3e('0x65')](_0x3fd6bb[_0x5b3e('0x64')],{'$or':_[_0x5b3e('0x3e')](_0x3fd6bb[_0x5b3e('0x5e')],function(_0x2cdc91){var _0x265b73={};_0x265b73[_0x2cdc91]={'$like':'%'+_0x47806c['query']['filter']+'%'};return _0x265b73;})});}_0x3fd6bb=_[_0x5b3e('0x65')]({},_0x3fd6bb,_0x47806c[_0x5b3e('0x68')]);return _0x4a9512[_0x5b3e('0x134')](_0x3fd6bb);}})['then'](function(_0x31d591){if(_0x31d591){_0x3e4138=_0x31d591[_0x5b3e('0x5f')];if(!_0x47806c[_0x5b3e('0x59')][_0x5b3e('0x60')](_0x5b3e('0x61'))){_0x3fd6bb[_0x5b3e('0x22')]=qs[_0x5b3e('0x22')](_0x47806c[_0x5b3e('0x59')]['limit']);_0x3fd6bb[_0x5b3e('0x25')]=qs[_0x5b3e('0x25')](_0x47806c['query'][_0x5b3e('0x25')]);}return _0x4a9512[_0x5b3e('0x134')](_0x3fd6bb);}})[_0x5b3e('0x29')](function(_0x21c53c){if(_0x21c53c){return _0x21c53c?{'count':_0x3e4138,'rows':_0x21c53c}:null;}})[_0x5b3e('0x29')](respondWithResult(_0x4bfe9f,null))[_0x5b3e('0x3c')](handleError(_0x4bfe9f,null));};
\ No newline at end of file
+var _0xbe34=['x-real-port','browser','version','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','model','type','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','pick','include','removeDispositions','addAnswer','getAnswers','findOne','CannedAnswer','hasOwnProperty','removeAnswers','ids','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Applications','Interval','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','list','applications','priority','asc','account','Contacts','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','queue','Start','startRouting','EventManager','offline','createdAt','ListId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','files','attachments','offline-chat','basename','openNewInteraction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','User','fullname','internal','Tag','color','tag','getProactiveActions','../../config/license/util','virtual','custom','License','chatLicenseExceeded','server/files/chat/iframe.ejs','address','origin','remoteAddress','referer','replace','verticalAlignment','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','omit','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','mustache','util','fs-extra','lodash','querystring','html-to-text','url','../../components/parsers/qs','api','APIOutOfIntervalError','../../errors/api','APINotFoundError','handleError','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','Command','getSnippet','timezone','format','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','catch','inspect','No\x20timezone','map','some','user-agent-parser','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName'];(function(_0x3efc77,_0x1fa6ad){var _0x146c7e=function(_0x3f59ea){while(--_0x3f59ea){_0x3efc77['push'](_0x3efc77['shift']());}};_0x146c7e(++_0x1fa6ad);}(_0xbe34,0xe8));var _0x4be3=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xbe34[_0x42cae2];return _0x5f256f;};'use strict';var Mustache=require(_0x4be3('0x0'));var util=require(_0x4be3('0x1'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4be3('0x2'));var _=require(_0x4be3('0x3'));var querystring=require(_0x4be3('0x4'));var htmlToText=require(_0x4be3('0x5'));var Redis=require('ioredis');var jayson=require('jayson/promise');var url=require(_0x4be3('0x6'));var qs=require(_0x4be3('0x7'));var logger=require('../../config/logger')(_0x4be3('0x8'));var config=require('../../config/environment');var APIOutOfIntervalError=require('../../errors/api')[_0x4be3('0x9')];var APINotFoundError=require(_0x4be3('0xa'))[_0x4be3('0xb')];var APIHandleError=require(_0x4be3('0xa'))[_0x4be3('0xc')];var db=require('../../mysqldb')['db'];config[_0x4be3('0xd')]=_[_0x4be3('0xe')](config['redis'],{'host':_0x4be3('0xf'),'port':0x18eb});var socket=require(_0x4be3('0x10'))(new Redis(config['redis']));require(_0x4be3('0x11'))[_0x4be3('0x12')](socket);var client=jayson[_0x4be3('0x13')][_0x4be3('0x14')]({'port':0x232c});var client9002=jayson['client'][_0x4be3('0x14')]({'port':0x232a});var client9003=jayson['client'][_0x4be3('0x14')]({'port':0x232b});var client9001=jayson['client'][_0x4be3('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x2a931f,_0x37133d,_0x49edcd,_0x208872){return new Promise(function(_0x115f54,_0x2be2ed){var _0x4c0336=_0x208872||client;return _0x4c0336[_0x4be3('0x15')](_0x2a931f,_0x49edcd)[_0x4be3('0x16')](function(_0x23b76b){logger['info'](_0x4be3('0x17'),_0x37133d,_0x4be3('0x18'));logger[_0x4be3('0x19')](_0x4be3('0x1a'),_0x37133d,_0x4be3('0x18'),JSON[_0x4be3('0x1b')](_0x23b76b));if(_0x23b76b['error']){if(_0x23b76b[_0x4be3('0x1c')][_0x4be3('0x1d')]===0x1f4){logger[_0x4be3('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x37133d,_0x23b76b[_0x4be3('0x1c')]['message']);return _0x2be2ed(_0x23b76b[_0x4be3('0x1c')][_0x4be3('0x1e')]);}logger[_0x4be3('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x37133d,_0x23b76b[_0x4be3('0x1c')][_0x4be3('0x1e')]);return _0x115f54(_0x23b76b[_0x4be3('0x1c')][_0x4be3('0x1e')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x37133d,_0x4be3('0x18'));_0x115f54(_0x23b76b[_0x4be3('0x1f')][_0x4be3('0x1e')]);}})['catch'](function(_0x37661f){logger[_0x4be3('0x1c')](_0x4be3('0x17'),_0x37133d,_0x37661f);_0x2be2ed(_0x37661f);});});}function respondWithStatusCode(_0x3bf7cb,_0x317ceb){_0x317ceb=_0x317ceb||0xcc;return function(_0x307334){if(_0x307334){return _0x3bf7cb[_0x4be3('0x20')](_0x317ceb);}return _0x3bf7cb['status'](_0x317ceb)[_0x4be3('0x21')]();};}function respondWithResult(_0x46326f,_0x4c45fa){_0x4c45fa=_0x4c45fa||0xc8;return function(_0x529f38){if(_0x529f38){return _0x46326f[_0x4be3('0x22')](_0x4c45fa)[_0x4be3('0x23')](_0x529f38);}};}function respondWithFilteredResult(_0xa811dc,_0x263664){return function(_0x3c22aa){if(_0x3c22aa){var _0x27081e=typeof _0x263664['offset']===_0x4be3('0x24')&&typeof _0x263664[_0x4be3('0x25')]==='undefined';var _0x432681=_0x3c22aa[_0x4be3('0x26')];var _0x3f0889=_0x27081e?0x0:_0x263664[_0x4be3('0x27')];var _0x35e1d7=_0x27081e?_0x3c22aa['count']:_0x263664['offset']+_0x263664[_0x4be3('0x25')];var _0x37f4aa;if(_0x35e1d7>=_0x432681){_0x35e1d7=_0x432681;_0x37f4aa=0xc8;}else{_0x37f4aa=0xce;}_0xa811dc[_0x4be3('0x22')](_0x37f4aa);return _0xa811dc[_0x4be3('0x28')](_0x4be3('0x29'),_0x3f0889+'-'+_0x35e1d7+'/'+_0x432681)[_0x4be3('0x23')](_0x3c22aa);}return null;};}function saveUpdates(_0x1a262b){return function(_0x1f80f0){if(_0x1f80f0){return _0x1f80f0[_0x4be3('0x2a')](_0x1a262b)[_0x4be3('0x16')](function(_0x4bf10b){return _0x4bf10b;});}return null;};}function removeEntity(_0x1324a9){return function(_0x17b886){if(_0x17b886){return _0x17b886[_0x4be3('0x2b')]()[_0x4be3('0x16')](function(){var _0x13cd13=_0x17b886[_0x4be3('0x2c')]({'plain':!![]});var _0x307593=_0x4be3('0x2d');return db[_0x4be3('0x2e')][_0x4be3('0x2b')]({'where':{'type':_0x307593,'resourceId':_0x13cd13['id']}})[_0x4be3('0x16')](function(){return _0x17b886;});})[_0x4be3('0x16')](function(){_0x1324a9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x546a06){return function(_0x119641){if(!_0x119641){_0x546a06[_0x4be3('0x20')](0x194);}return _0x119641;};}function handleError(_0x3f19a6,_0x2f0b07){_0x2f0b07=_0x2f0b07||0x1f4;return function(_0x3af0bb){logger['error'](_0x3af0bb[_0x4be3('0x2f')]);if(_0x3af0bb['name']){delete _0x3af0bb[_0x4be3('0x30')];}_0x3f19a6[_0x4be3('0x22')](_0x2f0b07)[_0x4be3('0x31')](_0x3af0bb);};}function iftimePromise(_0x48c267,_0x460be3){return respondWithRpcPromise(_0x4be3('0x32'),_0x4be3('0x33'),{'command':_0x460be3[_0x4be3('0x34')]?util[_0x4be3('0x35')](_0x4be3('0x36'),_0x48c267[_0x4be3('0x37')],_0x460be3[_0x4be3('0x34')]):util[_0x4be3('0x35')](_0x4be3('0x38'),_0x48c267['interval'])},client9002)['then'](function(_0x46a61f){var _0xbf7160=_0x46a61f&&_0x46a61f[_0x4be3('0x39')](_0x4be3('0x3a'))>=0x0?!![]:![];logger['info'](_0x4be3('0x3b'),_0x460be3['id'],_0x48c267['id'],_0x48c267[_0x4be3('0x37')],_0xbf7160?_0x4be3('0x3c'):_0x4be3('0x3d'),_0x460be3[_0x4be3('0x34')]?_0x460be3['timezone']:'No\x20timezone');return _0xbf7160;})[_0x4be3('0x3e')](function(_0x34c4fb){logger[_0x4be3('0x1c')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x460be3['id'],_0x48c267['id'],_0x48c267[_0x4be3('0x37')],util[_0x4be3('0x3f')](_0x34c4fb,{'showHidden':![],'depth':null}),_0x460be3[_0x4be3('0x34')]?_0x460be3[_0x4be3('0x34')]:_0x4be3('0x40'));return![];});}function checkWebsiteIntervals(_0xb257ba){var _0x21b93c=_[_0x4be3('0x41')](_0xb257ba['Interval']['Intervals'],function(_0x5de0ae){var _0x87f3ea=_0x5de0ae[_0x4be3('0x2c')]({'plain':!![]});return iftimePromise(_0x87f3ea,_0xb257ba);});return Promise['all'](_0x21b93c)['then'](function(_0x4746ba){return _[_0x4be3('0x42')](_0x4746ba);});}function createInteractionObject(_0x10d66e,_0x51820d,_0x43d94a,_0x55fd23){var _0x33613d=require(_0x4be3('0x43'));var _0x3a6ab1=new _0x33613d();var _0x3143ae=_0x3a6ab1['setUA'](_0x43d94a[_0x4be3('0x44')])[_0x4be3('0x45')]();var _0x30ca0b=_0x51820d[_0x4be3('0x46')];if(_0x43d94a[_0x4be3('0x47')]){_0x30ca0b=_0x43d94a[_0x4be3('0x47')];}else if(_0x43d94a[_0x4be3('0x48')]){_0x30ca0b=_[_0x4be3('0x49')](_0x43d94a[_0x4be3('0x48')][_0x4be3('0x4a')](','));}return{'ContactId':_0x55fd23['id'],'ChatWebsiteId':_0x10d66e,'from':(_0x55fd23[_0x4be3('0x4b')]||'')+'\x20'+(_0x55fd23[_0x4be3('0x4c')]||''),'customerIp':_0x30ca0b,'customerPort':_0x43d94a[_0x4be3('0x4d')]?_0x43d94a[_0x4be3('0x4d')]:null,'referer':_0x51820d['referer'],'browserName':_0x3143ae['browser'][_0x4be3('0x30')]&&_0x3143ae[_0x4be3('0x4e')][_0x4be3('0x4f')]?util[_0x4be3('0x35')](_0x4be3('0x50'),_0x3143ae[_0x4be3('0x4e')]['name'],_0x3143ae[_0x4be3('0x4e')][_0x4be3('0x4f')]):_0x4be3('0x51'),'browserVersion':_0x3143ae['browser']['version']||'unknown','osName':util[_0x4be3('0x35')](_0x4be3('0x50'),_0x3143ae['os'][_0x4be3('0x30')],_0x3143ae['os'][_0x4be3('0x4f')]),'osVersion':_0x3143ae['os'][_0x4be3('0x4f')],'deviceModel':_0x3143ae[_0x4be3('0x52')]['model']&&_0x3143ae[_0x4be3('0x52')][_0x4be3('0x53')]?util[_0x4be3('0x35')](_0x4be3('0x54'),_0x3143ae[_0x4be3('0x52')][_0x4be3('0x55')],_0x3143ae[_0x4be3('0x52')]['vendor'],_0x3143ae[_0x4be3('0x52')][_0x4be3('0x56')]):null,'deviceVendor':_0x3143ae['device']['vendor'],'deviceType':_0x3143ae[_0x4be3('0x52')][_0x4be3('0x56')],'formData':JSON[_0x4be3('0x1b')](_0x51820d)};}exports[_0x4be3('0x57')]=function(_0x12db5e,_0x4a378c){var _0x337d65={'include':[{'model':db[_0x4be3('0x58')],'as':_0x4be3('0x59')}]},_0x548fa2={},_0x4b0472={'count':0x0,'rows':[]};var _0x4d0fea=_[_0x4be3('0x41')](db[_0x4be3('0x5a')][_0x4be3('0x5b')],function(_0x3855eb){return{'name':_0x3855eb[_0x4be3('0x5c')],'type':_0x3855eb[_0x4be3('0x56')][_0x4be3('0x5d')]};});_0x548fa2[_0x4be3('0x55')]=_['map'](_0x4d0fea,'name');_0x548fa2[_0x4be3('0x5e')]=_[_0x4be3('0x5f')](_0x12db5e[_0x4be3('0x5e')]);_0x548fa2[_0x4be3('0x60')]=_[_0x4be3('0x61')](_0x548fa2[_0x4be3('0x55')],_0x548fa2[_0x4be3('0x5e')]);_0x337d65['attributes']=_[_0x4be3('0x61')](_0x548fa2[_0x4be3('0x55')],qs['fields'](_0x12db5e['query'][_0x4be3('0x62')]));_0x337d65[_0x4be3('0x63')]=_0x337d65['attributes'][_0x4be3('0x64')]?_0x337d65[_0x4be3('0x63')]:_0x548fa2[_0x4be3('0x55')];if(!_0x12db5e[_0x4be3('0x5e')]['hasOwnProperty'](_0x4be3('0x65'))){_0x337d65['limit']=qs[_0x4be3('0x25')](_0x12db5e[_0x4be3('0x5e')]['limit']);_0x337d65[_0x4be3('0x27')]=qs['offset'](_0x12db5e[_0x4be3('0x5e')][_0x4be3('0x27')]);}_0x337d65[_0x4be3('0x66')]=qs[_0x4be3('0x67')](_0x12db5e[_0x4be3('0x5e')][_0x4be3('0x67')]);_0x337d65[_0x4be3('0x68')]=qs['filters'](_['pick'](_0x12db5e[_0x4be3('0x5e')],_0x548fa2[_0x4be3('0x60')]),_0x4d0fea);if(_0x12db5e[_0x4be3('0x5e')][_0x4be3('0x69')]){_0x337d65[_0x4be3('0x68')]=_[_0x4be3('0x6a')](_0x337d65[_0x4be3('0x68')],{'$or':_['map'](_0x4d0fea,function(_0x2625f6){if(_0x2625f6['type']!=='VIRTUAL'){var _0x3d6d40={};_0x3d6d40[_0x2625f6[_0x4be3('0x30')]]={'$like':'%'+_0x12db5e['query'][_0x4be3('0x69')]+'%'};return _0x3d6d40;}})});}_0x337d65=_[_0x4be3('0x6a')]({},_0x337d65,_0x12db5e[_0x4be3('0x6b')]);var _0x5c8014={'where':_0x337d65[_0x4be3('0x68')]};return db[_0x4be3('0x5a')]['count'](_0x5c8014)[_0x4be3('0x16')](function(_0x587645){_0x4b0472[_0x4be3('0x26')]=_0x587645;if(_0x12db5e[_0x4be3('0x5e')][_0x4be3('0x6c')]){_0x337d65['include']=[{'all':!![]}];}return db['ChatWebsite'][_0x4be3('0x6d')](_0x337d65);})['then'](function(_0x550ab1){_0x4b0472[_0x4be3('0x6e')]=_0x550ab1;return _0x4b0472;})[_0x4be3('0x16')](respondWithFilteredResult(_0x4a378c,_0x337d65))[_0x4be3('0x3e')](handleError(_0x4a378c,null));};exports[_0x4be3('0x6f')]=function(_0x35d68a,_0x5937a1){var _0x526e99={'raw':![],'where':{'id':_0x35d68a[_0x4be3('0x70')]['id']},'include':[{'model':db[_0x4be3('0x58')],'as':_0x4be3('0x59')}]},_0x49340b={};_0x49340b[_0x4be3('0x55')]=_[_0x4be3('0x5f')](db[_0x4be3('0x5a')]['rawAttributes']);_0x49340b[_0x4be3('0x5e')]=_['keys'](_0x35d68a['query']);_0x49340b[_0x4be3('0x60')]=_[_0x4be3('0x61')](_0x49340b[_0x4be3('0x55')],_0x49340b[_0x4be3('0x5e')]);_0x526e99[_0x4be3('0x63')]=_[_0x4be3('0x61')](_0x49340b[_0x4be3('0x55')],qs[_0x4be3('0x62')](_0x35d68a[_0x4be3('0x5e')][_0x4be3('0x62')]));_0x526e99[_0x4be3('0x63')]=_0x526e99[_0x4be3('0x63')]['length']?_0x526e99[_0x4be3('0x63')]:_0x49340b[_0x4be3('0x55')];if(_0x35d68a[_0x4be3('0x5e')][_0x4be3('0x6c')]){_0x526e99['include']=[{'all':!![]}];}_0x526e99=_[_0x4be3('0x6a')]({},_0x526e99,_0x35d68a[_0x4be3('0x6b')]);return db[_0x4be3('0x5a')][_0x4be3('0x71')](_0x526e99)[_0x4be3('0x16')](handleEntityNotFound(_0x5937a1,null))[_0x4be3('0x16')](respondWithResult(_0x5937a1,null))['catch'](handleError(_0x5937a1,null));};exports['create']=function(_0x22b807,_0x239b2b){return db[_0x4be3('0x5a')][_0x4be3('0x72')](_0x22b807[_0x4be3('0x73')],{})['then'](function(_0xbe48c8){var _0x4aa89c=_0x22b807[_0x4be3('0x74')]['get']({'plain':!![]});if(!_0x4aa89c)throw new Error(_0x4be3('0x75'));if(_0x4aa89c[_0x4be3('0x76')]==='user'){var _0x1b2417=_0xbe48c8[_0x4be3('0x2c')]({'plain':!![]});var _0x1dd571=_0x4be3('0x2d');return db[_0x4be3('0x77')]['find']({'where':{'name':_0x1dd571,'userProfileId':_0x4aa89c[_0x4be3('0x78')]},'raw':!![]})[_0x4be3('0x16')](function(_0x1fb47f){if(_0x1fb47f&&_0x1fb47f[_0x4be3('0x79')]===0x0){return db[_0x4be3('0x2e')][_0x4be3('0x72')]({'name':_0x1b2417[_0x4be3('0x30')],'resourceId':_0x1b2417['id'],'type':_0x1fb47f[_0x4be3('0x30')],'sectionId':_0x1fb47f['id']},{})[_0x4be3('0x16')](function(){return _0xbe48c8;});}else{return _0xbe48c8;}})['catch'](function(_0x2e610b){logger[_0x4be3('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e610b);throw _0x2e610b;});}return _0xbe48c8;})[_0x4be3('0x16')](respondWithResult(_0x239b2b,0xc9))[_0x4be3('0x3e')](handleError(_0x239b2b,null));};exports[_0x4be3('0x2a')]=function(_0x366152,_0x40bbbd){if(_0x366152[_0x4be3('0x73')]['id']){delete _0x366152['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x366152[_0x4be3('0x70')]['id']},'include':[{'model':db['Pause'],'as':_0x4be3('0x59')}]})['then'](handleEntityNotFound(_0x40bbbd,null))[_0x4be3('0x16')](saveUpdates(_0x366152['body'],null))[_0x4be3('0x16')](respondWithResult(_0x40bbbd,null))[_0x4be3('0x3e')](handleError(_0x40bbbd,null));};exports[_0x4be3('0x2b')]=function(_0x56044b,_0x3bb95d){return db['ChatWebsite'][_0x4be3('0x71')]({'where':{'id':_0x56044b[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x3bb95d,null))[_0x4be3('0x16')](removeEntity(_0x3bb95d,null))[_0x4be3('0x3e')](handleError(_0x3bb95d,null));};exports[_0x4be3('0x7a')]=function(_0x10e0a6,_0x43e1b7){return db['ChatWebsite']['describe']()[_0x4be3('0x16')](respondWithResult(_0x43e1b7,null))[_0x4be3('0x3e')](handleError(_0x43e1b7,null));};exports[_0x4be3('0x7b')]=function(_0x516089,_0x2c03c9){if(_0x516089[_0x4be3('0x73')]['id']){delete _0x516089[_0x4be3('0x73')]['id'];}return db[_0x4be3('0x5a')][_0x4be3('0x71')]({'where':{'id':_0x516089[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x2c03c9,null))[_0x4be3('0x16')](function(_0x635339){if(_0x635339){_0x516089[_0x4be3('0x73')][_0x4be3('0x7c')]=_0x635339['id'];return db[_0x4be3('0x7d')][_0x4be3('0x72')](_0x516089['body']);}})[_0x4be3('0x16')](respondWithResult(_0x2c03c9,null))[_0x4be3('0x3e')](handleError(_0x2c03c9,null));};exports[_0x4be3('0x7e')]=function(_0x48d0fb,_0x3961e4){var _0x59ecda={'raw':![],'where':{}};var _0x7458d7={};var _0x12cb83={'count':0x0,'rows':[]};return db[_0x4be3('0x5a')]['findOne']({'where':{'id':_0x48d0fb['params']['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x3961e4,null))[_0x4be3('0x16')](function(_0x6aab57){if(_0x6aab57){_0x7458d7[_0x4be3('0x55')]=_[_0x4be3('0x5f')](db[_0x4be3('0x7d')][_0x4be3('0x5b')]);_0x7458d7['query']=_['keys'](_0x48d0fb['query']);_0x7458d7[_0x4be3('0x60')]=_['intersection'](_0x7458d7['model'],_0x7458d7[_0x4be3('0x5e')]);_0x59ecda[_0x4be3('0x63')]=_[_0x4be3('0x61')](_0x7458d7[_0x4be3('0x55')],qs[_0x4be3('0x62')](_0x48d0fb['query']['fields']));_0x59ecda['attributes']=_0x59ecda[_0x4be3('0x63')][_0x4be3('0x64')]?_0x59ecda[_0x4be3('0x63')]:_0x7458d7['model'];if(!_0x48d0fb[_0x4be3('0x5e')]['hasOwnProperty'](_0x4be3('0x65'))){_0x59ecda[_0x4be3('0x25')]=qs[_0x4be3('0x25')](_0x48d0fb[_0x4be3('0x5e')][_0x4be3('0x25')]);_0x59ecda[_0x4be3('0x27')]=qs[_0x4be3('0x27')](_0x48d0fb[_0x4be3('0x5e')][_0x4be3('0x27')]);}_0x59ecda[_0x4be3('0x66')]=qs[_0x4be3('0x67')](_0x48d0fb[_0x4be3('0x5e')][_0x4be3('0x67')]);_0x59ecda[_0x4be3('0x68')]=qs[_0x4be3('0x60')](_[_0x4be3('0x7f')](_0x48d0fb[_0x4be3('0x5e')],_0x7458d7[_0x4be3('0x60')]));_0x59ecda[_0x4be3('0x68')][_0x4be3('0x7c')]=_0x6aab57['id'];if(_0x48d0fb[_0x4be3('0x5e')]['filter']){_0x59ecda[_0x4be3('0x68')]=_[_0x4be3('0x6a')](_0x59ecda[_0x4be3('0x68')],{'$or':_[_0x4be3('0x41')](_0x59ecda[_0x4be3('0x63')],function(_0x4fdef7){var _0x45bcbe={};_0x45bcbe[_0x4fdef7]={'$like':'%'+_0x48d0fb[_0x4be3('0x5e')][_0x4be3('0x69')]+'%'};return _0x45bcbe;})});}_0x59ecda=_['merge']({},_0x59ecda,_0x48d0fb['options']);return db['Disposition'][_0x4be3('0x26')]({'where':_0x59ecda['where']})[_0x4be3('0x16')](function(_0x1be523){_0x12cb83[_0x4be3('0x26')]=_0x1be523;if(_0x48d0fb[_0x4be3('0x5e')]['includeAll']){_0x59ecda[_0x4be3('0x80')]=[{'all':!![]}];}return db[_0x4be3('0x7d')][_0x4be3('0x6d')](_0x59ecda);})[_0x4be3('0x16')](function(_0x170db0){_0x12cb83[_0x4be3('0x6e')]=_0x170db0;return _0x12cb83;});}})[_0x4be3('0x16')](respondWithFilteredResult(_0x3961e4,_0x59ecda))['catch'](handleError(_0x3961e4,null));};exports[_0x4be3('0x81')]=function(_0xfccad4,_0x5c8bf1){return db['ChatWebsite'][_0x4be3('0x71')]({'where':{'id':_0xfccad4[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x5c8bf1,null))[_0x4be3('0x16')](function(_0x4c88af){if(_0x4c88af){return _0x4c88af[_0x4be3('0x81')](_0xfccad4['query']['ids']);}})[_0x4be3('0x16')](respondWithStatusCode(_0x5c8bf1,null))[_0x4be3('0x3e')](handleError(_0x5c8bf1,null));};exports[_0x4be3('0x82')]=function(_0x2ad927,_0x5bfa89){if(_0x2ad927[_0x4be3('0x73')]['id']){delete _0x2ad927[_0x4be3('0x73')]['id'];}return db['ChatWebsite'][_0x4be3('0x71')]({'where':{'id':_0x2ad927['params']['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x5bfa89,null))['then'](function(_0x47e961){if(_0x47e961){_0x2ad927[_0x4be3('0x73')][_0x4be3('0x7c')]=_0x47e961['id'];return db['CannedAnswer']['create'](_0x2ad927[_0x4be3('0x73')]);}})[_0x4be3('0x16')](respondWithResult(_0x5bfa89,null))[_0x4be3('0x3e')](handleError(_0x5bfa89,null));};exports[_0x4be3('0x83')]=function(_0x664c77,_0xd8222a){var _0x264978={'raw':![],'where':{}};var _0x461086={};var _0x103769={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4be3('0x84')]({'where':{'id':_0x664c77[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0xd8222a,null))[_0x4be3('0x16')](function(_0x193d39){if(_0x193d39){_0x461086['model']=_[_0x4be3('0x5f')](db[_0x4be3('0x85')][_0x4be3('0x5b')]);_0x461086[_0x4be3('0x5e')]=_[_0x4be3('0x5f')](_0x664c77['query']);_0x461086['filters']=_['intersection'](_0x461086['model'],_0x461086[_0x4be3('0x5e')]);_0x264978[_0x4be3('0x63')]=_[_0x4be3('0x61')](_0x461086[_0x4be3('0x55')],qs[_0x4be3('0x62')](_0x664c77[_0x4be3('0x5e')][_0x4be3('0x62')]));_0x264978[_0x4be3('0x63')]=_0x264978[_0x4be3('0x63')][_0x4be3('0x64')]?_0x264978[_0x4be3('0x63')]:_0x461086[_0x4be3('0x55')];if(!_0x664c77[_0x4be3('0x5e')][_0x4be3('0x86')](_0x4be3('0x65'))){_0x264978[_0x4be3('0x25')]=qs['limit'](_0x664c77['query'][_0x4be3('0x25')]);_0x264978[_0x4be3('0x27')]=qs[_0x4be3('0x27')](_0x664c77['query'][_0x4be3('0x27')]);}_0x264978[_0x4be3('0x66')]=qs[_0x4be3('0x67')](_0x664c77[_0x4be3('0x5e')]['sort']);_0x264978[_0x4be3('0x68')]=qs[_0x4be3('0x60')](_[_0x4be3('0x7f')](_0x664c77[_0x4be3('0x5e')],_0x461086[_0x4be3('0x60')]));_0x264978[_0x4be3('0x68')][_0x4be3('0x7c')]=_0x193d39['id'];if(_0x664c77[_0x4be3('0x5e')][_0x4be3('0x69')]){_0x264978[_0x4be3('0x68')]=_['merge'](_0x264978[_0x4be3('0x68')],{'$or':_[_0x4be3('0x41')](_0x264978[_0x4be3('0x63')],function(_0x550f09){var _0x41cf00={};_0x41cf00[_0x550f09]={'$like':'%'+_0x664c77[_0x4be3('0x5e')][_0x4be3('0x69')]+'%'};return _0x41cf00;})});}_0x264978=_['merge']({},_0x264978,_0x664c77['options']);return db['CannedAnswer'][_0x4be3('0x26')]({'where':_0x264978[_0x4be3('0x68')]})[_0x4be3('0x16')](function(_0x18ee1a){_0x103769[_0x4be3('0x26')]=_0x18ee1a;if(_0x664c77['query'][_0x4be3('0x6c')]){_0x264978['include']=[{'all':!![]}];}return db[_0x4be3('0x85')][_0x4be3('0x6d')](_0x264978);})[_0x4be3('0x16')](function(_0x1a99c3){_0x103769[_0x4be3('0x6e')]=_0x1a99c3;return _0x103769;});}})[_0x4be3('0x16')](respondWithFilteredResult(_0xd8222a,_0x264978))[_0x4be3('0x3e')](handleError(_0xd8222a,null));};exports[_0x4be3('0x87')]=function(_0x32133f,_0x329912){return db[_0x4be3('0x5a')][_0x4be3('0x71')]({'where':{'id':_0x32133f[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x329912,null))['then'](function(_0x5d17c9){if(_0x5d17c9){return _0x5d17c9[_0x4be3('0x87')](_0x32133f[_0x4be3('0x5e')][_0x4be3('0x88')]);}})['then'](respondWithStatusCode(_0x329912,null))[_0x4be3('0x3e')](handleError(_0x329912,null));};exports[_0x4be3('0x89')]=function(_0x345389,_0xa9b34f){_0x345389[_0x4be3('0x73')][_0x4be3('0x8a')]=_0x345389[_0x4be3('0x8b')][_0x4be3('0x8c')];return db['ChatWebsite']['find']({'where':{'id':_0x345389[_0x4be3('0x70')]['id']}})['then'](handleEntityNotFound(_0xa9b34f,null))[_0x4be3('0x16')](saveUpdates(_0x345389[_0x4be3('0x73')],null))[_0x4be3('0x16')](respondWithResult(_0xa9b34f,null))['catch'](handleError(_0xa9b34f,null));};exports['addAvatar']=function(_0x362877,_0x46f83e){_0x362877['body'][_0x4be3('0x8d')]=_0x362877[_0x4be3('0x8b')][_0x4be3('0x8c')];return db[_0x4be3('0x5a')][_0x4be3('0x71')]({'where':{'id':_0x362877[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x46f83e,null))[_0x4be3('0x16')](saveUpdates(_0x362877[_0x4be3('0x73')],null))['then'](respondWithResult(_0x46f83e,null))[_0x4be3('0x3e')](handleError(_0x46f83e,null));};exports[_0x4be3('0x8e')]=function(_0x4e30ad,_0x10497b){_0x4e30ad[_0x4be3('0x73')][_0x4be3('0x8f')]=_0x4e30ad['file'][_0x4be3('0x8c')];return db[_0x4be3('0x5a')][_0x4be3('0x71')]({'where':{'id':_0x4e30ad[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x10497b,null))[_0x4be3('0x16')](saveUpdates(_0x4e30ad['body'],null))[_0x4be3('0x16')](respondWithResult(_0x10497b,null))[_0x4be3('0x3e')](handleError(_0x10497b,null));};exports[_0x4be3('0x90')]=function(_0x348ef6,_0x1dc671){_0x348ef6[_0x4be3('0x73')][_0x4be3('0x91')]=_0x348ef6['file'][_0x4be3('0x8c')];return db[_0x4be3('0x5a')][_0x4be3('0x71')]({'where':{'id':_0x348ef6[_0x4be3('0x70')]['id']}})['then'](handleEntityNotFound(_0x1dc671,null))[_0x4be3('0x16')](saveUpdates(_0x348ef6['body'],null))[_0x4be3('0x16')](respondWithResult(_0x1dc671,null))[_0x4be3('0x3e')](handleError(_0x1dc671,null));};exports[_0x4be3('0x92')]=function(_0x5b60f1,_0x17ded7){var _0x1b3b5f=path[_0x4be3('0x93')](config[_0x4be3('0x94')],_0x4be3('0x95'));var _0x5ced18={'where':{'id':_0x5b60f1[_0x4be3('0x70')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x463199=![];return require('../../config/license/util')[_0x4be3('0x96')]()[_0x4be3('0x16')](function(_0x417413){if(_0x417413){_0x463199=_0x417413['custom'];}})[_0x4be3('0x16')](function(){return db[_0x4be3('0x5a')][_0x4be3('0x71')](_0x5ced18);})['then'](handleEntityNotFound(_0x17ded7,null))[_0x4be3('0x16')](function(_0x58a2c4){if(_0x58a2c4){if(!_[_0x4be3('0x97')](_0x58a2c4[_0x4be3('0x8a')])){if(fs['existsSync'](path[_0x4be3('0x93')](config[_0x4be3('0x94')],'server/files/images/logos/',_0x58a2c4['sitepic']))&&_0x463199){_0x1b3b5f=path['join'](config[_0x4be3('0x94')],_0x4be3('0x98'),_0x58a2c4[_0x4be3('0x8a')]);}}return _0x17ded7[_0x4be3('0x99')](_0x1b3b5f);}})['catch'](handleError(_0x17ded7,null));};exports[_0x4be3('0x9a')]=function(_0x58a7a9,_0x1df715){var _0x31cd69=path[_0x4be3('0x93')](config[_0x4be3('0x94')],_0x4be3('0x9b'));var _0x303b11={'where':{'id':_0x58a7a9[_0x4be3('0x70')]['id']},'attributes':['id',_0x4be3('0x8d')],'raw':!![]};return db[_0x4be3('0x5a')][_0x4be3('0x71')](_0x303b11)['then'](handleEntityNotFound(_0x1df715,null))[_0x4be3('0x16')](function(_0x52e712){if(_0x52e712){if(!_[_0x4be3('0x97')](_0x52e712[_0x4be3('0x8d')])){if(fs[_0x4be3('0x9c')](path[_0x4be3('0x93')](config[_0x4be3('0x94')],'server/files/images/avatars/',_0x52e712[_0x4be3('0x8d')]))){_0x31cd69=path[_0x4be3('0x93')](config[_0x4be3('0x94')],_0x4be3('0x9d'),_0x52e712[_0x4be3('0x8d')]);}}return _0x1df715[_0x4be3('0x99')](_0x31cd69);}})[_0x4be3('0x3e')](handleError(_0x1df715,null));};exports[_0x4be3('0x9e')]=function(_0x257f59,_0x9d8d5e){var _0x5c3283=path['join'](config[_0x4be3('0x94')],'server/files/images/avatars/customer_avatar.png');var _0x3dec62={'where':{'id':_0x257f59['params']['id']},'attributes':['id',_0x4be3('0x8f'),_0x4be3('0x9f')],'raw':!![]};return db[_0x4be3('0x5a')][_0x4be3('0x71')](_0x3dec62)[_0x4be3('0x16')](handleEntityNotFound(_0x9d8d5e,null))[_0x4be3('0x16')](function(_0x384d28){if(_0x384d28){if(!_[_0x4be3('0x97')](_0x384d28[_0x4be3('0x8f')])){if(fs['existsSync'](path['join'](config[_0x4be3('0x94')],_0x4be3('0x9d'),_0x384d28[_0x4be3('0x8f')]))&&_0x384d28[_0x4be3('0x9f')]){_0x5c3283=path[_0x4be3('0x93')](config[_0x4be3('0x94')],_0x4be3('0x9d'),_0x384d28[_0x4be3('0x8f')]);}}return _0x9d8d5e[_0x4be3('0x99')](_0x5c3283);}})[_0x4be3('0x3e')](handleError(_0x9d8d5e,null));};exports[_0x4be3('0xa0')]=function(_0x181a81,_0x492929){var _0x28c7d4=path[_0x4be3('0x93')](config[_0x4be3('0x94')],_0x4be3('0xa1'));var _0x351289={'where':{'id':_0x181a81['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x4be3('0x5a')][_0x4be3('0x71')](_0x351289)[_0x4be3('0x16')](handleEntityNotFound(_0x492929,null))[_0x4be3('0x16')](function(_0x35d4ba){if(_0x35d4ba){if(!_['isNil'](_0x35d4ba[_0x4be3('0x91')])){if(fs[_0x4be3('0x9c')](path['join'](config[_0x4be3('0x94')],_0x4be3('0x9d'),_0x35d4ba[_0x4be3('0x91')]))){_0x28c7d4=path[_0x4be3('0x93')](config['root'],_0x4be3('0x9d'),_0x35d4ba['systemAvatar']);}}return _0x492929['download'](_0x28c7d4);}})[_0x4be3('0x3e')](handleError(_0x492929,null));};exports[_0x4be3('0xa2')]=function(_0x3b0143,_0x3d3fbd){var _0x4a3b63={'body':_0x3b0143[_0x4be3('0x73')],'channel':_0x4be3('0xa3')};var _0xb0fd84=[];var _0x2b200f=[];var _0x2bd13f={};var _0x596377=![];return db[_0x4be3('0xa4')][_0x4be3('0x7a')]()['then'](function(_0x1d2564){if(!_0x1d2564){throw new db[(_0x4be3('0xa5'))][(_0x4be3('0xa6'))](_0x4be3('0xa7'));}_0xb0fd84=_[_0x4be3('0xa8')](_['keys'](_0x1d2564),['createdAt',_0x4be3('0xa9')]);_0x2b200f=_[_0x4be3('0xa8')](_['keys'](_0x1d2564),['createdAt',_0x4be3('0xa9'),_0x4be3('0xaa'),'ListId']);if(_0x3b0143[_0x4be3('0x73')]['id']){delete _0x3b0143[_0x4be3('0x73')]['id'];}if(_['isNil'](_0x3b0143['body']['from'])){throw new db['Sequelize'][(_0x4be3('0xa6'))](_0x4be3('0xab'));}if(_['isNil'](_0x3b0143[_0x4be3('0x73')]['body'])||_0x3b0143['body'][_0x4be3('0x73')]===''){throw new db[(_0x4be3('0xa5'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4be3('0x97')](_0x3b0143[_0x4be3('0x73')][_0x4be3('0xac')])){throw new db[(_0x4be3('0xa5'))]['ValidationError'](_0x4be3('0xad')+_0x2b200f);}if(!_[_0x4be3('0xae')](_0x2b200f,_0x3b0143[_0x4be3('0x73')][_0x4be3('0xac')])){throw new db[(_0x4be3('0xa5'))][(_0x4be3('0xa6'))](_0x4be3('0xaf')+_0x2b200f);}_0x2bd13f[_0x3b0143[_0x4be3('0x73')][_0x4be3('0xac')]]=_0x3b0143[_0x4be3('0x73')][_0x4be3('0xb0')];})[_0x4be3('0x16')](function(){return db[_0x4be3('0x5a')][_0x4be3('0x71')]({'where':{'id':_0x3b0143['params']['id']},'include':[{'model':db[_0x4be3('0xb1')],'as':_0x4be3('0xb2'),'include':[{'model':db[_0x4be3('0xa4')],'as':'Contacts','where':_0x2bd13f,'limit':0x1,'order':[[_0x4be3('0xa9'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x4be3('0xb3')},{'model':db[_0x4be3('0xb4')],'as':_0x4be3('0xb4'),'include':[{'model':db[_0x4be3('0xb4')],'as':_0x4be3('0xb5'),'attributes':['id',_0x4be3('0x37')],'raw':!![]}]}]});})[_0x4be3('0x16')](function(_0x335877){if(!_0x335877)throw new APINotFoundError(util[_0x4be3('0x35')](_0x4be3('0xb6'),_0x3b0143[_0x4be3('0x70')]['id']));if(!_0x335877[_0x4be3('0xb4')]||!_0x335877[_0x4be3('0xb4')][_0x4be3('0xb5')])return[_0x335877,!![]];return[_0x335877,checkWebsiteIntervals(_0x335877)];})[_0x4be3('0xb7')](function(_0x3b5bd0,_0x2d9684){if(!_0x2d9684)throw new APIOutOfIntervalError();if(!_0x3b5bd0['List'])return;_0x4a3b63['account']=_0x3b5bd0;_0x4a3b63[_0x4be3('0xb8')]=_0x3b5bd0[_0x4be3('0xb2')];_0x4a3b63[_0x4be3('0xb9')]=_['orderBy'](_0x3b5bd0['Applications'],[_0x4be3('0xba')],[_0x4be3('0xbb')]);if(_0x4a3b63[_0x4be3('0xbc')][_0x4be3('0xb3')]){delete _0x4a3b63[_0x4be3('0xbc')][_0x4be3('0xb3')];}if(_0x4a3b63[_0x4be3('0xbc')]['List']&&_0x4a3b63[_0x4be3('0xbc')][_0x4be3('0xb2')][_0x4be3('0xbd')][_0x4be3('0x64')]){return _0x4a3b63[_0x4be3('0xbc')][_0x4be3('0xb2')][_0x4be3('0xbd')][0x0];}var _0x393919=_[_0x4be3('0xe')](_0x3b0143['body'],{'firstName':_0x3b0143['body'][_0x4be3('0xb0')],'ListId':_0x3b5bd0['ListId']});_0x393919[_0x3b0143[_0x4be3('0x73')][_0x4be3('0xac')]]=_0x3b0143[_0x4be3('0x73')][_0x4be3('0xb0')];return db['CmContact']['create'](_0x393919,{'fields':_0xb0fd84,'raw':!![]});})[_0x4be3('0x16')](function(_0x1f3a56){_0x4a3b63[_0x4be3('0xbe')]=_0x1f3a56;var _0x3d48b5=createInteractionObject(_0x3b0143[_0x4be3('0x70')]['id'],_0x3b0143[_0x4be3('0x73')],_0x3b0143[_0x4be3('0xbf')],_0x1f3a56);var _0x12ca44={'ChatWebsiteId':_0x3b0143['params']['id'],'closed':![]};if(_0x3b0143[_0x4be3('0x73')][_0x4be3('0xc0')]){_0x12ca44[_0x4be3('0xc0')]=_0x3b0143['body'][_0x4be3('0xc0')];return db[_0x4be3('0xc1')]['find']({'where':_0x12ca44})[_0x4be3('0x16')](function(_0x3d9179){if(_0x3d9179){_0x596377=!![];return _0x3d9179;}_0x3d48b5[_0x4be3('0xc0')]=_0x3b0143['body'][_0x4be3('0xc0')];_0x3d48b5[_0x4be3('0xc2')]=_0x3b0143[_0x4be3('0x73')]['externalUrl'];return db[_0x4be3('0xc1')]['create'](_0x3d48b5);});}_0x12ca44[_0x4be3('0xc3')]=_0x1f3a56['id'];if(_0x3b0143[_0x4be3('0x73')][_0x4be3('0xc4')]&&_0x3b0143[_0x4be3('0x73')][_0x4be3('0xc4')]['id']){_0x12ca44['id']=_0x3b0143[_0x4be3('0x73')]['interaction']['id'];return db[_0x4be3('0xc1')][_0x4be3('0x71')]({'where':_0x12ca44})[_0x4be3('0x16')](function(_0x159f76){if(_0x159f76){_0x596377=!![];return _0x159f76;}return db['ChatInteraction'][_0x4be3('0x72')](_0x3d48b5);});}return db[_0x4be3('0xc1')][_0x4be3('0x72')](_0x3d48b5);})[_0x4be3('0x16')](function(_0xae85be){if(!_0x596377)return _0xae85be;var _0x58f6cc={'from':(_0x4a3b63[_0x4be3('0xbe')]['firstName']||'')+'\x20'+(_0x4a3b63['contact'][_0x4be3('0x4c')]||'')};if(_0x3b0143[_0x4be3('0x73')]['threadId']&&_0x3b0143[_0x4be3('0x73')]['messageId']&&_0x3b0143[_0x4be3('0x73')]['threadId']!=_0x3b0143[_0x4be3('0x73')]['messageId']){_0x58f6cc[_0x4be3('0xc0')]=_0x3b0143['body'][_0x4be3('0xc5')];}return _0xae85be[_0x4be3('0x2a')](_0x58f6cc);})[_0x4be3('0x16')](function(_0x3fc4e9){_0x4a3b63['interaction']=_0x3fc4e9[_0x4be3('0x2c')]({'plain':!![]});_0x4a3b63[_0x4be3('0xc4')][_0x4be3('0xc6')]=!_0x596377;if(_0x4a3b63[_0x4be3('0xc4')]['created']){if(_0x4a3b63[_0x4be3('0xbc')]['autoclose']){_0x4a3b63['applications'][_0x4be3('0xc7')]({'id':0x0,'priority':_0x4a3b63[_0x4be3('0xb9')][_0x4be3('0x64')]+0x1,'app':_0x4be3('0xc8'),'appdata':_0x4be3('0xc9'),'interval':_0x4be3('0xca')});}}return db[_0x4be3('0xcb')][_0x4be3('0x72')]({'body':_0x3b0143[_0x4be3('0x73')][_0x4be3('0x73')],'ChatWebsiteId':_0x3b0143['params']['id'],'ChatInteractionId':_0x3fc4e9['id'],'direction':'in','ContactId':_0x4a3b63[_0x4be3('0xbe')]['id'],'AttachmentId':_0x3b0143['body']['AttachmentId']});})[_0x4be3('0x16')](function(_0xc9d527){_0x4a3b63['message']=_0xc9d527;if(!_0x4a3b63[_0x4be3('0xc4')][_0x4be3('0xcc')]){return;}return db['User'][_0x4be3('0x71')]({'attributes':['id',_0x4be3('0x30')],'where':{'id':_0x4a3b63[_0x4be3('0xc4')][_0x4be3('0xcc')]}});})[_0x4be3('0x16')](function(_0x3869f2){if(_0x3869f2){_0x4a3b63[_0x4be3('0xb9')][_0x4be3('0xcd')]({'id':0x0,'priority':0x0,'app':_0x4be3('0xce'),'appdata':_0x3869f2[_0x4be3('0x30')]+','+(_0x4a3b63[_0x4be3('0xbc')][_0x4be3('0xcf')]||0xa),'interval':_0x4be3('0xca')});_0x4a3b63[_0x4be3('0xd0')]=!![];}if(!_0x4a3b63[_0x4be3('0xc4')][_0x4be3('0xd1')]){return;}return db['ChatQueue']['find']({'attributes':['id','name'],'where':{'id':_0x4a3b63[_0x4be3('0xc4')][_0x4be3('0xd1')]}});})['then'](function(_0xcbeab6){if(_0xcbeab6){_0x4a3b63[_0x4be3('0xb9')][_0x4be3('0xcd')]({'id':0x0,'priority':0x1,'app':_0x4be3('0xd2'),'appdata':_0xcbeab6[_0x4be3('0x30')]+','+(_0x4a3b63[_0x4be3('0xbc')]['waitForTheAssignedQueue']||0x12c),'interval':_0x4be3('0xca')});}return respondWithRpcPromise(_0x4be3('0xd3'),_0x4be3('0xd4'),_0x4a3b63);})[_0x4be3('0x16')](function(_0x2f9b37){respondWithRpcPromise('EventManager',_0x4be3('0xd5'),{'event':'notify','message':_0x2f9b37},client9002);return _0x2f9b37;})['then'](respondWithResult(_0x3d3fbd,null))[_0x4be3('0x3e')](APIHandleError(_0x3d3fbd));};exports[_0x4be3('0xd6')]=function(_0x37224d,_0x111596){var _0x67ea32,_0xfafbba,_0x45f594;var _0xe44b00=[];var _0x36681d={};var _0xa93fe3=_0x37224d['files']||[];var _0x3842ab=[];var _0xe9aa4d;return db[_0x4be3('0xa4')]['describe']()['then'](function(_0xce7d20){if(!_0xce7d20){throw new db[(_0x4be3('0xa5'))][(_0x4be3('0xa6'))]('no\x20available\x20attributes');}_0xe44b00=_[_0x4be3('0xa8')](_[_0x4be3('0x5f')](_0xce7d20),[_0x4be3('0xd7'),_0x4be3('0xa9'),_0x4be3('0xaa'),_0x4be3('0xd8')]);if(_0x37224d['body']['id']){delete _0x37224d[_0x4be3('0x73')]['id'];}if(_[_0x4be3('0x97')](_0x37224d[_0x4be3('0x73')]['from'])){throw _0x111596[_0x4be3('0x22')](0x1f4)[_0x4be3('0x31')](new db[(_0x4be3('0xa5'))]['ValidationError']('from\x20is\x20mandatory'));}if(_['isNil'](_0x37224d[_0x4be3('0x73')][_0x4be3('0x73')])||_0x37224d['body']['body']===''){throw _0x111596[_0x4be3('0x22')](0x1f4)['send'](new db[(_0x4be3('0xa5'))][(_0x4be3('0xa6'))](_0x4be3('0xd9')));}if(_[_0x4be3('0x97')](_0x37224d[_0x4be3('0x73')][_0x4be3('0xda')])){throw _0x111596[_0x4be3('0x22')](0x1f4)[_0x4be3('0x31')](new db[(_0x4be3('0xa5'))]['ValidationError'](_0x4be3('0xdb')+_0xe44b00));}if(!_['includes'](_0xe44b00,_0x37224d[_0x4be3('0x73')][_0x4be3('0xda')])){throw _0x111596['status'](0x1f4)['send'](new db[(_0x4be3('0xa5'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe44b00));}_0x36681d[_0x37224d['body'][_0x4be3('0xda')]]=_0x37224d[_0x4be3('0x73')]['from'];})[_0x4be3('0x16')](function(){return db[_0x4be3('0x5a')][_0x4be3('0x71')]({'where':{'id':_0x37224d[_0x4be3('0x70')]['id']},'include':[{'model':db[_0x4be3('0xb1')],'as':_0x4be3('0xb2')},{'model':db[_0x4be3('0xdc')],'as':_0x4be3('0xdc')}]});})['then'](handleEntityNotFound(_0x111596,null))[_0x4be3('0x16')](function(_0x3023cf){if(_0x3023cf&&_0x3023cf['List']){_0xfafbba=_0x3023cf;var _0x44e0ec=_[_0x4be3('0xe')](_0x37224d['body'],{'firstName':_0x37224d[_0x4be3('0x73')][_0x4be3('0xb0')],'phone':_0x37224d['body'][_0x4be3('0xb0')],'ListId':_0x3023cf[_0x4be3('0xd8')]});_0x44e0ec[_0x37224d[_0x4be3('0x73')][_0x4be3('0xda')]]=_0x37224d[_0x4be3('0x73')][_0x4be3('0xb0')];return db[_0x4be3('0xa4')]['findOrCreate']({'where':_0x36681d,'defaults':_0x44e0ec});}})[_0x4be3('0xb7')](function(_0x39bc04){if(_0x39bc04){_0x45f594=_0x39bc04;var _0x3b3c74=fs['readFileSync'](path[_0x4be3('0x93')](config[_0x4be3('0x94')],_0x4be3('0xdd')),_0x4be3('0xde'));var _0x3a6d9b=ejs[_0x4be3('0xdf')](_0x3b3c74,{'body':_[_0x4be3('0xe0')](_0x37224d[_0x4be3('0x73')][_0x4be3('0x73')]),'bodyTitle':_0xfafbba[_0x4be3('0xe1')]});return db[_0x4be3('0xe2')][_0x4be3('0x72')]({'body':_0x3a6d9b,'plainBody':htmlToText[_0x4be3('0xe3')](_0x3a6d9b),'ContactId':_0x39bc04['id'],'ChatWebsiteId':_0xfafbba['id']});}})['then'](function(_0x339b70){_0xe9aa4d=_0x339b70;if(_0xa93fe3[_0x4be3('0x64')]){var _0x44b8f2=_0xa93fe3['map'](function(_0x5a73d8){return{'name':_0x5a73d8[_0x4be3('0xe4')],'basename':_0x5a73d8['filename'],'type':_0x5a73d8['mimetype'],'ChatOfflineMessageId':_0x339b70['id']};});_0x3842ab=_0x44b8f2['map'](_0x312d4b=>{var _0x367c66={'filename':_0x312d4b[_0x4be3('0x30')],'path':path[_0x4be3('0x93')](config[_0x4be3('0x94')],'server',_0x4be3('0xe5'),_0x4be3('0xe6'),_0x4be3('0xe7'),_0x312d4b[_0x4be3('0xe8')])};return _0x367c66;});if(!_0xfafbba[_0x4be3('0xe9')]){return db['sequelize']['transaction'](function(_0xff91c5){return db[_0x4be3('0xea')][_0x4be3('0xeb')](_0x44b8f2,{'transaction':_0xff91c5});});}}})[_0x4be3('0x16')](function(){if(_0xe9aa4d){_0x67ea32=_0xe9aa4d;return db[_0x4be3('0xdc')][_0x4be3('0x84')]({'where':{'service':!![]},'include':[{'model':db[_0x4be3('0xec')],'as':_0x4be3('0xed'),'raw':!![],'include':[{'model':db[_0x4be3('0xee')],'as':_0x4be3('0xee'),'raw':!![]}]}]});}})[_0x4be3('0x16')](function(_0x41219f){if(_0x41219f&&_0x41219f[_0x4be3('0xed')]&&_0xfafbba[_0x4be3('0xef')]&&_0xfafbba[_0x4be3('0xf0')]){var _0x1f09c1=_0x41219f[_0x4be3('0xf1')]();return respondWithRpcPromise(_0x4be3('0xf2'),_0x4be3('0xf3'),{'account':_0x1f09c1,'message':{'from':util[_0x4be3('0x35')](_0x4be3('0xf4'),_0x41219f[_0x4be3('0x30')],_0x41219f[_0x4be3('0xf5')]||_0x41219f[_0x4be3('0xed')][_0x4be3('0x74')]),'to':_0xfafbba[_0x4be3('0xf0')],'subject':_0xfafbba[_0x4be3('0xf6')],'html':_0x67ea32[_0x4be3('0x73')],'attachments':_0x3842ab}},client9003)['then'](function(){return _0x67ea32;})['catch'](function(_0xf5212e){logger[_0x4be3('0x1c')](_0xf5212e);});}})['then'](function(){if(_0xfafbba&&_0xfafbba[_0x4be3('0xe9')]&&_0xfafbba[_0x4be3('0xf7')]){var _0x48e430=[];if(_0xa93fe3[_0x4be3('0x64')]){_0x48e430=_0xa93fe3[_0x4be3('0x41')](function(_0x28ca21){return{'name':_0x28ca21[_0x4be3('0xe4')],'basename':_0x28ca21[_0x4be3('0x8c')],'type':_0x28ca21[_0x4be3('0xf8')],'ChatOfflineMessageId':_0xe9aa4d['id']};});}var _0x4c267f;if(!_['isNil'](_0xfafbba[_0x4be3('0xf9')])){var _0x11a4a7=_[_0x4be3('0x41')](_0x37224d[_0x4be3('0x73')],function(_0x48d3de){return _0x48d3de;});var _0x36edad=_[_0x4be3('0xfa')](_0x11a4a7)[0x0];var _0x415d83=_[_0x4be3('0xfb')](_0x36edad,function(_0x1eed97){return _0x1eed97;});_0x4c267f=_0x415d83[0x1][_0xfafbba['subjectOffline']];}var _0x4cee1c={'from':_0x45f594[_0x4be3('0xf5')],'firstName':_0x45f594[_0x4be3('0x4b')],'lastName':_0x45f594['lastName'],'mapKey':'email','message':{'from':_0x45f594[_0x4be3('0xf5')],'to':_0xfafbba[_0x4be3('0xdc')][_0x4be3('0xf5')],'cc':'','subject':_[_0x4be3('0x97')](_0x4c267f)?_0xfafbba['offlineMessageSubject']:_0x4c267f,'messageId':'','sentAt':new Date(),'attach':_0x48e430['length'],'attachments':_0x48e430,'originChannel':_0x4be3('0xfc'),'ChatWebsiteId':_0xfafbba['id'],'ChatOfflineMessageId':_0x67ea32['id'],'originTo':_0xfafbba[_0x4be3('0xdc')][_0x4be3('0xf5')]},'body':_0x67ea32['body']};var _0x1493a5={'account':{'id':_0xfafbba[_0x4be3('0xf7')]},'body':_0x4cee1c,'log':_0x4be3('0xfd')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x1493a5,client9001)['then'](function(){return _0x67ea32;})[_0x4be3('0x3e')](function(_0x5af500){logger['error'](_0x5af500);});}return;})[_0x4be3('0x16')](function(){if(_0x67ea32){return _0x67ea32;}})[_0x4be3('0x16')](respondWithResult(_0x111596,null))['catch'](function(){for(var _0x177301 of _0xa93fe3){var _0x2c9ec9=path[_0x4be3('0x93')](config['root'],'server','files',_0x4be3('0xe6'),_0x4be3('0xe7'),_0x177301[_0x4be3('0x8c')]);fs_extra[_0x4be3('0xfe')](_0x2c9ec9)[_0x4be3('0x3e')](function(_0x134953){logger[_0x4be3('0x1c')](_0x4be3('0xff'),_0x2c9ec9,_0x134953);});}});};exports[_0x4be3('0x100')]=function(_0x4c2ff6,_0x4e2f41){return db[_0x4be3('0xc1')][_0x4be3('0x71')]({'where':{'id':_0x4c2ff6[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x4e2f41,null))[_0x4be3('0x16')](function(_0x5d6bb2){if(_0x5d6bb2){return _0x5d6bb2['addInteraction'](_0x4c2ff6[_0x4be3('0x73')][_0x4be3('0x88')],_['omit'](_0x4c2ff6[_0x4be3('0x73')],[_0x4be3('0x88'),'id'])||{});}})[_0x4be3('0x16')](respondWithResult(_0x4e2f41,null))[_0x4be3('0x3e')](handleError(_0x4e2f41,null));};exports[_0x4be3('0x101')]=function(_0x3e298d,_0x113a04){var _0x114a14={'raw':![],'where':{}};var _0x525202={};var _0xee6b77={'count':0x0,'rows':[]};return db[_0x4be3('0x5a')]['findOne']({'where':{'id':_0x3e298d['params']['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x113a04,null))['then'](function(_0x1e78f7){if(_0x1e78f7){_0x525202[_0x4be3('0x55')]=_[_0x4be3('0x5f')](db[_0x4be3('0xc1')][_0x4be3('0x5b')]);_0x525202[_0x4be3('0x5e')]=_[_0x4be3('0x5f')](_0x3e298d['query']);_0x525202[_0x4be3('0x60')]=_['intersection'](_0x525202[_0x4be3('0x55')],_0x525202['query']);_0x114a14['attributes']=_[_0x4be3('0x61')](_0x525202[_0x4be3('0x55')],qs[_0x4be3('0x62')](_0x3e298d['query']['fields']));_0x114a14[_0x4be3('0x63')]=_0x114a14[_0x4be3('0x63')][_0x4be3('0x64')]?_0x114a14[_0x4be3('0x63')]:_0x525202[_0x4be3('0x55')];if(!_0x3e298d['query'][_0x4be3('0x86')](_0x4be3('0x65'))){_0x114a14[_0x4be3('0x25')]=qs[_0x4be3('0x25')](_0x3e298d[_0x4be3('0x5e')]['limit']);_0x114a14['offset']=qs[_0x4be3('0x27')](_0x3e298d['query'][_0x4be3('0x27')]);}_0x114a14[_0x4be3('0x66')]=qs[_0x4be3('0x67')](_0x3e298d[_0x4be3('0x5e')][_0x4be3('0x67')]);_0x114a14[_0x4be3('0x68')]=qs[_0x4be3('0x60')](_[_0x4be3('0x7f')](_0x3e298d['query'],_0x525202['filters']));_0x114a14[_0x4be3('0x68')][_0x4be3('0x7c')]=_0x1e78f7['id'];if(_0x3e298d[_0x4be3('0x5e')][_0x4be3('0x69')]){_0x114a14['where']=_[_0x4be3('0x6a')](_0x114a14[_0x4be3('0x68')],{'$or':_['map'](_0x114a14[_0x4be3('0x63')],function(_0x1cd353){var _0x42ed99={};_0x42ed99[_0x1cd353]={'$like':'%'+_0x3e298d['query'][_0x4be3('0x69')]+'%'};return _0x42ed99;})});}_0x114a14=_[_0x4be3('0x6a')]({},_0x114a14,_0x3e298d[_0x4be3('0x6b')]);return db[_0x4be3('0xc1')][_0x4be3('0x26')]({'where':_0x114a14[_0x4be3('0x68')]})[_0x4be3('0x16')](function(_0x444e64){_0xee6b77[_0x4be3('0x26')]=_0x444e64;if(_0x3e298d[_0x4be3('0x5e')]['includeAll']){_0x114a14[_0x4be3('0x80')]=[{'model':db[_0x4be3('0xa4')],'as':_0x4be3('0x102'),'required':![]},{'model':db[_0x4be3('0x103')],'as':'Owner','attributes':[_0x4be3('0x30'),_0x4be3('0x104'),_0x4be3('0x105')],'required':![]},{'model':db[_0x4be3('0x106')],'as':'Tags','attributes':['id','name',_0x4be3('0x107')],'where':_0x3e298d[_0x4be3('0x5e')]['tag']?{'id':_0x3e298d[_0x4be3('0x5e')][_0x4be3('0x108')]}:undefined,'required':_0x3e298d[_0x4be3('0x5e')][_0x4be3('0x108')]?!![]:![]}];}return db[_0x4be3('0xc1')][_0x4be3('0x6d')](_0x114a14);})['then'](function(_0x472f0a){_0xee6b77['rows']=_0x472f0a;return _0xee6b77;});}})[_0x4be3('0x16')](respondWithFilteredResult(_0x113a04,_0x114a14))['catch'](handleError(_0x113a04,null));};exports[_0x4be3('0x33')]=function(_0xd2a7db,_0x55a680){var _0xcd3c8b=0x0;var _0x1965b4=0x0;var _0x37d4d7=![];var _0x36c15e;var _0x4a2f2e;return db[_0x4be3('0x5a')][_0x4be3('0x71')]({'where':{'id':_0xd2a7db[_0x4be3('0x70')]['id']},'include':[{'model':db[_0x4be3('0xb4')],'as':'Interval','include':[{'model':db['Interval'],'as':_0x4be3('0xb5'),'attributes':['id',_0x4be3('0x37')]}]}]})[_0x4be3('0x16')](handleEntityNotFound(_0x55a680,null))[_0x4be3('0x16')](function(_0x18d761){if(_0x18d761){_0x36c15e=_0x18d761;return _0x18d761[_0x4be3('0x109')]({'raw':!![]});}})[_0x4be3('0x16')](function(_0x5751c7){if(_0x36c15e){if(_0x5751c7){_0x4a2f2e=_0x5751c7;}}return require(_0x4be3('0x10a'))[_0x4be3('0x96')]();})[_0x4be3('0x16')](function(_0x1f4ab7){if(_0x1f4ab7){_0x1965b4=_0x1f4ab7[_0x4be3('0x10b')];_0x37d4d7=_0x1f4ab7[_0x4be3('0x10c')];}})[_0x4be3('0x16')](function(){return db['ChatInteraction'][_0x4be3('0x26')]({'where':{'closed':![]}});})[_0x4be3('0x16')](function(_0x25e9a5){_0xcd3c8b=_0x25e9a5;if(_0x1965b4&&_0x25e9a5>_0x1965b4){return db[_0x4be3('0x10d')]['findOne']({'where':{'id':0x1}})[_0x4be3('0x16')](function(_0x281ebe){if(_0x281ebe){_0x281ebe['increment'](_0x4be3('0x10e'));}});}})[_0x4be3('0x16')](function(){if(!_0x36c15e[_0x4be3('0xb4')]||!_0x36c15e[_0x4be3('0xb4')][_0x4be3('0xb5')])return!![];return checkWebsiteIntervals(_0x36c15e);})[_0x4be3('0x16')](function(_0x55cbc8){var _0x4c7688=fs['readFileSync'](path[_0x4be3('0x93')](config[_0x4be3('0x94')],_0x4be3('0x10f')),_0x4be3('0xde'));var _0x2bc980=new url['URL'](_0x36c15e[_0x4be3('0x110')])[_0x4be3('0x111')];var _0x3da56b='3.5.0';var _0x558e88=![];var _0x348294={'chatVersion':_0x3da56b,'chatWebsiteAddressOrigin':_0x2bc980,'remote':_0x36c15e['remote'],'query':querystring[_0x4be3('0x1b')](_[_0x4be3('0x6a')](_0x36c15e['get']({'plain':!![]}),{'customerIp':_0xd2a7db[_0x4be3('0xbf')][_0x4be3('0x48')]||_0xd2a7db[_0x4be3('0xbf')]['x-real-ip']||_0xd2a7db['connection'][_0x4be3('0x112')]||_0xd2a7db['ip'],'referer':_0xd2a7db[_0x4be3('0xbf')][_0x4be3('0x113')],'openedInteractions':_0xcd3c8b,'maxInteractions':_0x1965b4,'virtual':_0x37d4d7['virtual'],'online':_0x55cbc8,'custom':_0x37d4d7}))[_0x4be3('0x114')](/'/g,'\x5c\x27')};_0x55a680[_0x4be3('0x31')](ejs['render'](Mustache[_0x4be3('0xdf')](_0x4c7688,_0x348294),{'proactiveActions':_0x4a2f2e,'alignment':_0x36c15e['alignment'],'verticalAlignment':_0x36c15e[_0x4be3('0x115')],'div_color':_0x36c15e[_0x4be3('0x107')],'labelText':_0x36c15e['labelText'],'text_color':_0x36c15e[_0x4be3('0x116')],'text_button_color':_0x36c15e[_0x4be3('0x117')],'button_color':_0x36c15e[_0x4be3('0x118')],'background_color':_0x36c15e['backgroundColor'],'hideWhenOffline':_0x36c15e[_0x4be3('0x119')],'intervalId':_0x36c15e[_0x4be3('0x11a')],'isDevelopment':_0x558e88,'chatVersion':_0x3da56b}));})[_0x4be3('0x3e')](handleError(_0x55a680,null));};exports[_0x4be3('0x11b')]=function(_0x4e60aa,_0x204e43){var _0x1029e1=_0x4e60aa[_0x4be3('0x70')]['id'];var _0x26af9f=_0x4e60aa[_0x4be3('0x73')];var _0x24498d=0xc8;var _0xf0b71d=null;return db['sequelize'][_0x4be3('0x11c')]({'isolationLevel':db['sequelize'][_0x4be3('0x11d')][_0x4be3('0x11e')][_0x4be3('0x11f')]},function(_0x22fc88){return db[_0x4be3('0x5a')][_0x4be3('0x84')]({'where':{'id':_0x1029e1},'transaction':_0x22fc88})[_0x4be3('0x16')](function(_0x531d4a){if(_0x531d4a){return db[_0x4be3('0x120')][_0x4be3('0x2b')]({'where':{'ChatWebsiteId':_0x1029e1},'transaction':_0x22fc88})['then'](function(){var _0x3deda9=_['map'](_0x26af9f,function(_0x3a7975){_0x3a7975[_0x4be3('0x7c')]=_0x1029e1;return _0x3a7975;});return db[_0x4be3('0x120')][_0x4be3('0xeb')](_0x3deda9,{'transaction':_0x22fc88});});}else{_0x24498d=0x194;_0xf0b71d=[];}});})[_0x4be3('0x16')](function(){if(_0x24498d!==0x194){return db[_0x4be3('0x120')][_0x4be3('0x121')]({'where':{'ChatWebsiteId':_0x1029e1},'order':_0x4be3('0xba')})[_0x4be3('0x16')](function(_0x21111a){_0xf0b71d=_0x21111a;});}})[_0x4be3('0x3e')](function(_0x23b675){_0x24498d=0x1f4;logger['error'](_0x23b675[_0x4be3('0x2f')]);if(_0x23b675[_0x4be3('0x30')]){delete _0x23b675[_0x4be3('0x30')];}_0xf0b71d=_0x23b675;})['finally'](function(){if(_0xf0b71d===null){_0x204e43[_0x4be3('0x20')](_0x24498d);}else{if(_0x24498d===0x1f4){_0x204e43[_0x4be3('0x22')](_0x24498d)['send'](_0xf0b71d);}else{_0x204e43['status'](_0x24498d)[_0x4be3('0x23')](_0xf0b71d);}}});};exports[_0x4be3('0x122')]=function(_0x1c6628,_0x220f09){var _0x2fcca0={};var _0x503f6f={};var _0x417e92;var _0x546210;return db[_0x4be3('0x5a')][_0x4be3('0x84')]({'where':{'id':_0x1c6628[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x220f09,null))[_0x4be3('0x16')](function(_0xdcf808){if(_0xdcf808){_0x417e92=_0xdcf808;_0x503f6f['model']=_[_0x4be3('0x5f')](db[_0x4be3('0x120')]['rawAttributes']);_0x503f6f[_0x4be3('0x5e')]=_[_0x4be3('0x5f')](_0x1c6628[_0x4be3('0x5e')]);_0x503f6f[_0x4be3('0x60')]=_[_0x4be3('0x61')](_0x503f6f[_0x4be3('0x55')],_0x503f6f[_0x4be3('0x5e')]);_0x2fcca0[_0x4be3('0x63')]=_[_0x4be3('0x61')](_0x503f6f[_0x4be3('0x55')],qs[_0x4be3('0x62')](_0x1c6628['query'][_0x4be3('0x62')]));_0x2fcca0[_0x4be3('0x63')]=_0x2fcca0[_0x4be3('0x63')]['length']?_0x2fcca0[_0x4be3('0x63')]:_0x503f6f[_0x4be3('0x55')];_0x2fcca0['order']=qs[_0x4be3('0x67')](_0x1c6628[_0x4be3('0x5e')][_0x4be3('0x67')]);_0x2fcca0[_0x4be3('0x68')]=qs[_0x4be3('0x60')](_[_0x4be3('0x7f')](_0x1c6628[_0x4be3('0x5e')],_0x503f6f['filters']));if(_0x1c6628[_0x4be3('0x5e')]['filter']){_0x2fcca0['where']=_[_0x4be3('0x6a')](_0x2fcca0[_0x4be3('0x68')],{'$or':_[_0x4be3('0x41')](_0x2fcca0[_0x4be3('0x63')],function(_0xca6dc1){var _0x2f7fc9={};_0x2f7fc9[_0xca6dc1]={'$like':'%'+_0x1c6628[_0x4be3('0x5e')]['filter']+'%'};return _0x2f7fc9;})});}_0x2fcca0=_[_0x4be3('0x6a')]({},_0x2fcca0,_0x1c6628[_0x4be3('0x6b')]);return _0x417e92['getApplications'](_0x2fcca0);}})[_0x4be3('0x16')](function(_0x565dd4){if(_0x565dd4){_0x546210=_0x565dd4[_0x4be3('0x64')];if(!_0x1c6628['query'][_0x4be3('0x86')]('nolimit')){_0x2fcca0[_0x4be3('0x25')]=qs[_0x4be3('0x25')](_0x1c6628['query'][_0x4be3('0x25')]);_0x2fcca0[_0x4be3('0x27')]=qs[_0x4be3('0x27')](_0x1c6628['query']['offset']);}return _0x417e92[_0x4be3('0x122')](_0x2fcca0);}})[_0x4be3('0x16')](function(_0x3972db){if(_0x3972db){return _0x3972db?{'count':_0x546210,'rows':_0x3972db}:null;}})[_0x4be3('0x16')](respondWithResult(_0x220f09,null))['catch'](handleError(_0x220f09,null));};exports[_0x4be3('0x123')]=function(_0x3d2c18,_0x37df0b){return db[_0x4be3('0x124')][_0x4be3('0x71')]({'where':{'id':_0x3d2c18['params']['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x37df0b,null))['then'](function(_0x191d10){if(_0x191d10){return _0x191d10[_0x4be3('0x123')](_0x3d2c18[_0x4be3('0x73')][_0x4be3('0x88')],_['omit'](_0x3d2c18[_0x4be3('0x73')],[_0x4be3('0x88'),'id'])||{});}})[_0x4be3('0x16')](respondWithResult(_0x37df0b,null))['catch'](handleError(_0x37df0b,null));};exports['getProactiveActions']=function(_0x438533,_0x9839f4){var _0x26227a={};var _0x1e0e41={};var _0x79ba73;var _0x4664c2;return db[_0x4be3('0x5a')][_0x4be3('0x84')]({'where':{'id':_0x438533[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x9839f4,null))[_0x4be3('0x16')](function(_0x34719e){if(_0x34719e){_0x79ba73=_0x34719e;_0x1e0e41['model']=_['keys'](db[_0x4be3('0x125')][_0x4be3('0x5b')]);_0x1e0e41[_0x4be3('0x5e')]=_[_0x4be3('0x5f')](_0x438533[_0x4be3('0x5e')]);_0x1e0e41[_0x4be3('0x60')]=_[_0x4be3('0x61')](_0x1e0e41[_0x4be3('0x55')],_0x1e0e41[_0x4be3('0x5e')]);_0x26227a[_0x4be3('0x63')]=_[_0x4be3('0x61')](_0x1e0e41[_0x4be3('0x55')],qs[_0x4be3('0x62')](_0x438533['query'][_0x4be3('0x62')]));_0x26227a[_0x4be3('0x63')]=_0x26227a[_0x4be3('0x63')]['length']?_0x26227a[_0x4be3('0x63')]:_0x1e0e41['model'];_0x26227a[_0x4be3('0x66')]=qs[_0x4be3('0x67')](_0x438533[_0x4be3('0x5e')][_0x4be3('0x67')]);_0x26227a[_0x4be3('0x68')]=qs[_0x4be3('0x60')](_[_0x4be3('0x7f')](_0x438533['query'],_0x1e0e41[_0x4be3('0x60')]));if(_0x438533[_0x4be3('0x5e')]['filter']){_0x26227a[_0x4be3('0x68')]=_[_0x4be3('0x6a')](_0x26227a[_0x4be3('0x68')],{'$or':_['map'](_0x26227a[_0x4be3('0x63')],function(_0x5bc1d8){var _0x53d6a3={};_0x53d6a3[_0x5bc1d8]={'$like':'%'+_0x438533[_0x4be3('0x5e')][_0x4be3('0x69')]+'%'};return _0x53d6a3;})});}_0x26227a=_['merge']({},_0x26227a,_0x438533[_0x4be3('0x6b')]);return _0x79ba73['getProactiveActions'](_0x26227a);}})['then'](function(_0x5a0b84){if(_0x5a0b84){_0x4664c2=_0x5a0b84['length'];if(!_0x438533['query'][_0x4be3('0x86')](_0x4be3('0x65'))){_0x26227a[_0x4be3('0x25')]=qs['limit'](_0x438533[_0x4be3('0x5e')]['limit']);_0x26227a[_0x4be3('0x27')]=qs[_0x4be3('0x27')](_0x438533[_0x4be3('0x5e')]['offset']);}return _0x79ba73['getProactiveActions'](_0x26227a);}})[_0x4be3('0x16')](function(_0x16df3a){if(_0x16df3a){return _0x16df3a?{'count':_0x4664c2,'rows':_0x16df3a}:null;}})['then'](respondWithResult(_0x9839f4,null))[_0x4be3('0x3e')](handleError(_0x9839f4,null));};exports['getFields']=function(_0x5f0533,_0x37c641){var _0x2c5b64=_0x5f0533[_0x4be3('0x5e')][_0x4be3('0x126')]===_0x4be3('0x127')?_0x4be3('0x128'):_0x4be3('0x129');return db[_0x4be3('0x5a')][_0x4be3('0x71')]({'attributes':['id',_0x2c5b64],'where':{'id':_0x5f0533[_0x4be3('0x70')]['id']}})['then'](handleEntityNotFound(_0x37c641,null))['then'](function(_0x18740e){if(_0x18740e){var _0x18c91e=_0x18740e[_0x2c5b64];var _0x54e330=_0x18c91e&&_0x18c91e[_0x4be3('0x12a')]?_0x18c91e['items']:[];_0x37c641[_0x4be3('0x31')]({'fromKey':_['isNil'](_0x18c91e[_0x4be3('0x12b')])?undefined:_0x18c91e[_0x4be3('0x12b')],'count':_0x54e330[_0x4be3('0x64')],'rows':_0x54e330});}})['catch'](handleError(_0x37c641,null));};exports[_0x4be3('0x12c')]=function(_0x39d61b,_0x4b9709){var _0xbebd72={'raw':![],'where':{}};var _0x2af81f={};var _0x5149a4={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4be3('0x84')]({'where':{'id':_0x39d61b['params']['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x4b9709,null))[_0x4be3('0x16')](function(_0x474a3e){if(_0x474a3e){_0x2af81f[_0x4be3('0x55')]=_[_0x4be3('0x5f')](db[_0x4be3('0xe2')][_0x4be3('0x5b')]);_0x2af81f['query']=_[_0x4be3('0x5f')](_0x39d61b['query']);_0x2af81f[_0x4be3('0x60')]=_[_0x4be3('0x61')](_0x2af81f[_0x4be3('0x55')],_0x2af81f[_0x4be3('0x5e')]);_0xbebd72[_0x4be3('0x63')]=_[_0x4be3('0x61')](_0x2af81f[_0x4be3('0x55')],qs[_0x4be3('0x62')](_0x39d61b['query'][_0x4be3('0x62')]));_0xbebd72[_0x4be3('0x63')]=_0xbebd72['attributes'][_0x4be3('0x64')]?_0xbebd72[_0x4be3('0x63')]:_0x2af81f[_0x4be3('0x55')];if(!_0x39d61b[_0x4be3('0x5e')][_0x4be3('0x86')]('nolimit')){_0xbebd72[_0x4be3('0x25')]=qs[_0x4be3('0x25')](_0x39d61b[_0x4be3('0x5e')][_0x4be3('0x25')]);_0xbebd72[_0x4be3('0x27')]=qs[_0x4be3('0x27')](_0x39d61b[_0x4be3('0x5e')][_0x4be3('0x27')]);}_0xbebd72[_0x4be3('0x66')]=qs['sort'](_0x39d61b[_0x4be3('0x5e')][_0x4be3('0x67')]);_0xbebd72[_0x4be3('0x68')]=qs['filters'](_[_0x4be3('0x7f')](_0x39d61b['query'],_0x2af81f['filters']));_0xbebd72[_0x4be3('0x68')][_0x4be3('0x7c')]=_0x474a3e['id'];if(_0x39d61b[_0x4be3('0x5e')][_0x4be3('0x69')]){_0xbebd72['where']=_[_0x4be3('0x6a')](_0xbebd72[_0x4be3('0x68')],{'$or':_[_0x4be3('0x41')](_0xbebd72[_0x4be3('0x63')],function(_0x34004c){var _0x374c49={};_0x374c49[_0x34004c]={'$like':'%'+_0x39d61b[_0x4be3('0x5e')][_0x4be3('0x69')]+'%'};return _0x374c49;})});}_0xbebd72=_[_0x4be3('0x6a')]({},_0xbebd72,_0x39d61b['options']);return db['ChatOfflineMessage']['count']({'where':_0xbebd72['where']})[_0x4be3('0x16')](function(_0x25fd8b){_0x5149a4['count']=_0x25fd8b;if(_0x39d61b[_0x4be3('0x5e')][_0x4be3('0x6c')]){_0xbebd72['include']=[{'all':!![]}];}else{_0xbebd72[_0x4be3('0x80')]=[{'model':db[_0x4be3('0xa4')],'as':_0x4be3('0x102'),'required':![]},{'model':db[_0x4be3('0xea')],'as':_0x4be3('0x12d'),'required':![]}];}return db[_0x4be3('0xe2')][_0x4be3('0x6d')](_0xbebd72);})[_0x4be3('0x16')](function(_0xce7d5a){_0x5149a4[_0x4be3('0x6e')]=_0xce7d5a;return _0x5149a4;});}})[_0x4be3('0x16')](respondWithFilteredResult(_0x4b9709,_0xbebd72))[_0x4be3('0x3e')](handleError(_0x4b9709,null));};exports['addAgents']=function(_0x31c14b,_0xe97f47){return db['ChatWebsite'][_0x4be3('0x71')]({'where':{'id':_0x31c14b[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0xe97f47,null))[_0x4be3('0x16')](function(_0x462c19){if(_0x462c19){return _0x462c19['addAgents'](_0x31c14b['body'][_0x4be3('0x88')],_[_0x4be3('0x12e')](_0x31c14b['body'],['ids','id'])||{})['spread'](function(_0x290cf0){for(var _0x95967d=0x0;_0x95967d<_0x31c14b[_0x4be3('0x73')]['ids'][_0x4be3('0x64')];_0x95967d+=0x1){socket['emit'](_0x4be3('0x12f'),{'UserId':Number(_0x31c14b[_0x4be3('0x73')][_0x4be3('0x88')][_0x95967d]),'ChatWebsiteId':Number(_0x31c14b['params']['id'])});}return _0x290cf0;});}})[_0x4be3('0x16')](respondWithResult(_0xe97f47,null))[_0x4be3('0x3e')](handleError(_0xe97f47,null));};exports[_0x4be3('0x130')]=function(_0x211465,_0x577b3f){return db[_0x4be3('0x5a')]['find']({'where':{'id':_0x211465[_0x4be3('0x70')]['id']}})[_0x4be3('0x16')](handleEntityNotFound(_0x577b3f,null))[_0x4be3('0x16')](function(_0x343b09){if(_0x343b09){return _0x343b09['removeAgents'](_0x211465['query'][_0x4be3('0x88')])[_0x4be3('0x16')](function(){if(_[_0x4be3('0x131')](_0x211465['query'][_0x4be3('0x88')])){for(var _0x2f65f2=0x0;_0x2f65f2<_0x211465[_0x4be3('0x5e')]['ids']['length'];_0x2f65f2+=0x1){socket[_0x4be3('0x132')](_0x4be3('0x133'),{'UserId':Number(_0x211465['query'][_0x4be3('0x88')][_0x2f65f2]),'ChatWebsiteId':Number(_0x211465[_0x4be3('0x70')]['id'])});}}else{socket[_0x4be3('0x132')](_0x4be3('0x133'),{'UserId':Number(_0x211465[_0x4be3('0x5e')]['ids']),'ChatWebsiteId':Number(_0x211465[_0x4be3('0x70')]['id'])});}});}})[_0x4be3('0x16')](respondWithStatusCode(_0x577b3f,null))['catch'](handleError(_0x577b3f,null));};exports[_0x4be3('0x134')]=function(_0x2f9d46,_0x1b3a14){var _0x20c555={};var _0x3a9f7f={};var _0xf38522;var _0x1cec80;return db[_0x4be3('0x5a')][_0x4be3('0x84')]({'where':{'id':_0x2f9d46[_0x4be3('0x70')]['id']}})['then'](handleEntityNotFound(_0x1b3a14,null))[_0x4be3('0x16')](function(_0x2c5bff){if(_0x2c5bff){_0xf38522=_0x2c5bff;_0x3a9f7f[_0x4be3('0x55')]=_[_0x4be3('0x5f')](db['User']['rawAttributes']);_0x3a9f7f['query']=_[_0x4be3('0x5f')](_0x2f9d46[_0x4be3('0x5e')]);_0x3a9f7f[_0x4be3('0x60')]=_['intersection'](_0x3a9f7f[_0x4be3('0x55')],_0x3a9f7f['query']);_0x20c555[_0x4be3('0x63')]=_['intersection'](_0x3a9f7f[_0x4be3('0x55')],qs[_0x4be3('0x62')](_0x2f9d46[_0x4be3('0x5e')][_0x4be3('0x62')]));_0x20c555['attributes']=_0x20c555[_0x4be3('0x63')][_0x4be3('0x64')]?_0x20c555[_0x4be3('0x63')]:_0x3a9f7f[_0x4be3('0x55')];_0x20c555[_0x4be3('0x66')]=qs['sort'](_0x2f9d46[_0x4be3('0x5e')][_0x4be3('0x67')]);_0x20c555[_0x4be3('0x68')]=qs[_0x4be3('0x60')](_['pick'](_0x2f9d46[_0x4be3('0x5e')],_0x3a9f7f[_0x4be3('0x60')]));if(_0x2f9d46[_0x4be3('0x5e')][_0x4be3('0x69')]){_0x20c555[_0x4be3('0x68')]=_[_0x4be3('0x6a')](_0x20c555[_0x4be3('0x68')],{'$or':_[_0x4be3('0x41')](_0x20c555['attributes'],function(_0x5b1b5e){var _0x227812={};_0x227812[_0x5b1b5e]={'$like':'%'+_0x2f9d46[_0x4be3('0x5e')]['filter']+'%'};return _0x227812;})});}_0x20c555=_[_0x4be3('0x6a')]({},_0x20c555,_0x2f9d46['options']);return _0xf38522[_0x4be3('0x134')](_0x20c555);}})[_0x4be3('0x16')](function(_0x53e250){if(_0x53e250){_0x1cec80=_0x53e250[_0x4be3('0x64')];if(!_0x2f9d46[_0x4be3('0x5e')][_0x4be3('0x86')](_0x4be3('0x65'))){_0x20c555[_0x4be3('0x25')]=qs[_0x4be3('0x25')](_0x2f9d46[_0x4be3('0x5e')]['limit']);_0x20c555['offset']=qs[_0x4be3('0x27')](_0x2f9d46[_0x4be3('0x5e')][_0x4be3('0x27')]);}return _0xf38522[_0x4be3('0x134')](_0x20c555);}})['then'](function(_0x7c8275){if(_0x7c8275){return _0x7c8275?{'count':_0x1cec80,'rows':_0x7c8275}:null;}})[_0x4be3('0x16')](respondWithResult(_0x1b3a14,null))[_0x4be3('0x3e')](handleError(_0x1b3a14,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index db619e0..04e13d6 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 _0x95f4=['ChatWebsite','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x95f4,0xf1));var _0x495f=function(_0x31742e,_0x223fdf){_0x31742e=_0x31742e-0x0;var _0x522b5e=_0x95f4[_0x31742e];return _0x522b5e;};'use strict';var EventEmitter=require(_0x495f('0x0'));var ChatWebsite=require(_0x495f('0x1'))['db'][_0x495f('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x495f('0x3'),'afterDestroy':_0x495f('0x4')};function emitEvent(_0x5edb36){return function(_0x501377,_0x87cc22,_0x22465d){ChatWebsiteEvents[_0x495f('0x5')](_0x5edb36+':'+_0x501377['id'],_0x501377);ChatWebsiteEvents['emit'](_0x5edb36,_0x501377);_0x22465d(null);};}for(var e in events){if(events[_0x495f('0x6')](e)){var event=events[e];ChatWebsite[_0x495f('0x7')](e,emitEvent(event));}}module[_0x495f('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x8a8b=['events','setMaxListeners','save','remove','emit','hook'];(function(_0x1df8f8,_0x5db671){var _0xab71a0=function(_0x4f23b1){while(--_0x4f23b1){_0x1df8f8['push'](_0x1df8f8['shift']());}};_0xab71a0(++_0x5db671);}(_0x8a8b,0xae));var _0xb8a8=function(_0x16c495,_0x4f7f07){_0x16c495=_0x16c495-0x0;var _0x231292=_0x8a8b[_0x16c495];return _0x231292;};'use strict';var EventEmitter=require(_0xb8a8('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb8a8('0x1')](0x0);var events={'afterCreate':_0xb8a8('0x2'),'afterUpdate':'update','afterDestroy':_0xb8a8('0x3')};function emitEvent(_0x5710bc){return function(_0xca9854,_0x4fe301,_0x4043fd){ChatWebsiteEvents[_0xb8a8('0x4')](_0x5710bc+':'+_0xca9854['id'],_0xca9854);ChatWebsiteEvents[_0xb8a8('0x4')](_0x5710bc,_0xca9854);_0x4043fd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xb8a8('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index b33044a..3473ba8 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 _0xd9dc=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','chat_websites','lodash','util','../../config/logger'];(function(_0x190d26,_0x133371){var _0x2302e4=function(_0x108222){while(--_0x108222){_0x190d26['push'](_0x190d26['shift']());}};_0x2302e4(++_0x133371);}(_0xd9dc,0x101));var _0xcd9d=function(_0x4bdcbf,_0x306baf){_0x4bdcbf=_0x4bdcbf-0x0;var _0x21b314=_0xd9dc[_0x4bdcbf];return _0x21b314;};'use strict';var _=require(_0xcd9d('0x0'));var util=require(_0xcd9d('0x1'));var logger=require(_0xcd9d('0x2'))(_0xcd9d('0x3'));var moment=require(_0xcd9d('0x4'));var BPromise=require(_0xcd9d('0x5'));var rp=require(_0xcd9d('0x6'));var fs=require('fs');var path=require(_0xcd9d('0x7'));var rimraf=require(_0xcd9d('0x8'));var config=require(_0xcd9d('0x9'));var attributes=require(_0xcd9d('0xa'));module[_0xcd9d('0xb')]=function(_0x47190f,_0x3937d6){return _0x47190f['define']('ChatWebsite',attributes,{'tableName':_0xcd9d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x52c3=['moment','bluebird','rimraf','../../config/environment','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger'];(function(_0x3a0b5f,_0x175511){var _0x370688=function(_0x594aa6){while(--_0x594aa6){_0x3a0b5f['push'](_0x3a0b5f['shift']());}};_0x370688(++_0x175511);}(_0x52c3,0x105));var _0x352c=function(_0x402731,_0x43c115){_0x402731=_0x402731-0x0;var _0x111736=_0x52c3[_0x402731];return _0x111736;};'use strict';var _=require(_0x352c('0x0'));var util=require(_0x352c('0x1'));var logger=require(_0x352c('0x2'))('api');var moment=require(_0x352c('0x3'));var BPromise=require(_0x352c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x352c('0x5'));var config=require(_0x352c('0x6'));var attributes=require('./chatWebsite.attributes');module[_0x352c('0x7')]=function(_0x4dd4d8,_0x384108){return _0x4dd4d8[_0x352c('0x8')](_0x352c('0x9'),attributes,{'tableName':_0x352c('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 8814806..a3f9d1d 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 _0xd22f=['error','message','request\x20sent','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','stringify'];(function(_0x1ebc0f,_0x12171a){var _0x5d9cbd=function(_0x1d3bb4){while(--_0x1d3bb4){_0x1ebc0f['push'](_0x1ebc0f['shift']());}};_0x5d9cbd(++_0x12171a);}(_0xd22f,0x1a4));var _0xfd22=function(_0x97501e,_0x48c8fd){_0x97501e=_0x97501e-0x0;var _0x5919c8=_0xd22f[_0x97501e];return _0x5919c8;};'use strict';var _=require(_0xfd22('0x0'));var util=require(_0xfd22('0x1'));var moment=require(_0xfd22('0x2'));var BPromise=require('bluebird');var rs=require(_0xfd22('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd22('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfd22('0x5'))(_0xfd22('0x6'));var config=require(_0xfd22('0x7'));var jayson=require(_0xfd22('0x8'));var client=jayson[_0xfd22('0x9')]['http']({'port':0x232a});config[_0xfd22('0xa')]=_[_0xfd22('0xb')](config[_0xfd22('0xa')],{'host':_0xfd22('0xc'),'port':0x18eb});var socket=require(_0xfd22('0xd'))(new Redis(config[_0xfd22('0xa')]));require(_0xfd22('0xe'))[_0xfd22('0xf')](socket);function respondWithRpcPromise(_0x9671a,_0x17ea00,_0x2d9aa7){return new BPromise(function(_0xc67996,_0x36e1cc){return client[_0xfd22('0x10')](_0x9671a,_0x2d9aa7)[_0xfd22('0x11')](function(_0x38601f){logger[_0xfd22('0x12')](_0xfd22('0x13'),_0x17ea00,'request\x20sent');logger[_0xfd22('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x17ea00,'request\x20sent',JSON[_0xfd22('0x15')](_0x38601f));if(_0x38601f[_0xfd22('0x16')]){if(_0x38601f['error']['code']===0x1f4){logger[_0xfd22('0x16')](_0xfd22('0x13'),_0x17ea00,_0x38601f[_0xfd22('0x16')][_0xfd22('0x17')]);return _0x36e1cc(_0x38601f[_0xfd22('0x16')]['message']);}logger['error'](_0xfd22('0x13'),_0x17ea00,_0x38601f[_0xfd22('0x16')][_0xfd22('0x17')]);return _0xc67996(_0x38601f['error']['message']);}else{logger[_0xfd22('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x17ea00,_0xfd22('0x18'));_0xc67996(_0x38601f['result']['message']);}})[_0xfd22('0x19')](function(_0x3faade){logger[_0xfd22('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x17ea00,_0x3faade);_0x36e1cc(_0x3faade);});});}
\ No newline at end of file
+var _0x24de=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','moment','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x24de,0x74));var _0xe24d=function(_0x566667,_0x3f99c2){_0x566667=_0x566667-0x0;var _0x277136=_0x24de[_0x566667];return _0x277136;};'use strict';var _=require(_0xe24d('0x0'));var util=require(_0xe24d('0x1'));var moment=require(_0xe24d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe24d('0x3'));var db=require(_0xe24d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe24d('0x5'))(_0xe24d('0x6'));var config=require(_0xe24d('0x7'));var jayson=require(_0xe24d('0x8'));var client=jayson['client'][_0xe24d('0x9')]({'port':0x232a});config[_0xe24d('0xa')]=_[_0xe24d('0xb')](config[_0xe24d('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe24d('0xc'))(new Redis(config[_0xe24d('0xa')]));require(_0xe24d('0xd'))[_0xe24d('0xe')](socket);function respondWithRpcPromise(_0x34b026,_0x1d01b5,_0x571ba1){return new BPromise(function(_0x29056d,_0xfef677){return client[_0xe24d('0xf')](_0x34b026,_0x571ba1)[_0xe24d('0x10')](function(_0x5483c9){logger[_0xe24d('0x11')](_0xe24d('0x12'),_0x1d01b5,'request\x20sent');logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1d01b5,_0xe24d('0x13'),JSON[_0xe24d('0x14')](_0x5483c9));if(_0x5483c9[_0xe24d('0x15')]){if(_0x5483c9[_0xe24d('0x15')][_0xe24d('0x16')]===0x1f4){logger[_0xe24d('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x1d01b5,_0x5483c9[_0xe24d('0x15')][_0xe24d('0x17')]);return _0xfef677(_0x5483c9[_0xe24d('0x15')][_0xe24d('0x17')]);}logger[_0xe24d('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x1d01b5,_0x5483c9[_0xe24d('0x15')][_0xe24d('0x17')]);return _0x29056d(_0x5483c9[_0xe24d('0x15')][_0xe24d('0x17')]);}else{logger[_0xe24d('0x11')](_0xe24d('0x12'),_0x1d01b5,_0xe24d('0x13'));_0x29056d(_0x5483c9['result'][_0xe24d('0x17')]);}})['catch'](function(_0x6e90c2){logger['error'](_0xe24d('0x12'),_0x1d01b5,_0x6e90c2);_0xfef677(_0x6e90c2);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 7f3a1a4..7417c2a 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 _0x6bd9=['emit','removeListener','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x22d7bb,_0x4c158e){var _0x40a737=function(_0xd85bab){while(--_0xd85bab){_0x22d7bb['push'](_0x22d7bb['shift']());}};_0x40a737(++_0x4c158e);}(_0x6bd9,0xea));var _0x96bd=function(_0x2ab202,_0x5a8f28){_0x2ab202=_0x2ab202-0x0;var _0x64b1be=_0x6bd9[_0x2ab202];return _0x64b1be;};'use strict';var ChatWebsiteEvents=require(_0x96bd('0x0'));var events=[_0x96bd('0x1'),_0x96bd('0x2'),_0x96bd('0x3')];function createListener(_0x31c113,_0x585a33){return function(_0x591b34){_0x585a33[_0x96bd('0x4')](_0x31c113,_0x591b34);};}function removeListener(_0x1878a7,_0x5f49e4){return function(){ChatWebsiteEvents[_0x96bd('0x5')](_0x1878a7,_0x5f49e4);};}exports['register']=function(_0x1e50e1){for(var _0x53fbdf=0x0,_0x3cde87=events['length'];_0x53fbdf<_0x3cde87;_0x53fbdf++){var _0x452759=events[_0x53fbdf];var _0x532736=createListener(_0x96bd('0x6')+_0x452759,_0x1e50e1);ChatWebsiteEvents['on'](_0x452759,_0x532736);}};
\ No newline at end of file
+var _0xb3cf=['save','remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x294c1c,_0x567301){var _0x1e7943=function(_0x575323){while(--_0x575323){_0x294c1c['push'](_0x294c1c['shift']());}};_0x1e7943(++_0x567301);}(_0xb3cf,0x1b8));var _0xfb3c=function(_0x4a8e69,_0x593023){_0x4a8e69=_0x4a8e69-0x0;var _0x55d440=_0xb3cf[_0x4a8e69];return _0x55d440;};'use strict';var ChatWebsiteEvents=require(_0xfb3c('0x0'));var events=[_0xfb3c('0x1'),_0xfb3c('0x2'),_0xfb3c('0x3')];function createListener(_0x33066b,_0x2c71cb){return function(_0x3b0aa1){_0x2c71cb[_0xfb3c('0x4')](_0x33066b,_0x3b0aa1);};}function removeListener(_0x31a9d8,_0x29f9ec){return function(){ChatWebsiteEvents[_0xfb3c('0x5')](_0x31a9d8,_0x29f9ec);};}exports[_0xfb3c('0x6')]=function(_0x3befe1){for(var _0x1bae50=0x0,_0xaa53ff=events[_0xfb3c('0x7')];_0x1bae50<_0xaa53ff;_0x1bae50++){var _0x3e1f1f=events[_0x1bae50];var _0x2d3753=createListener(_0xfb3c('0x8')+_0x3e1f1f,_0x3befe1);ChatWebsiteEvents['on'](_0x3e1f1f,_0x2d3753);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 31efb6d..b1f285a 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 _0x8c21=['/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','getProactiveActions','getFields','getOfflineMessages','getAgents','post','create','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','now','originalname','file','addLogo','server/files/images/avatars/','/:id/avatar','single','addAvatar','root','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','offline-chat','ensureDir','replace','addInteraction','/:id/applications','addApplications','/:id/proactive_actions','addProactiveActions','/:id/users','put','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar'];(function(_0x95b44e,_0x4af5e1){var _0x4d33ea=function(_0x35acd6){while(--_0x35acd6){_0x95b44e['push'](_0x95b44e['shift']());}};_0x4d33ea(++_0x4af5e1);}(_0x8c21,0x18c));var _0x18c2=function(_0x54996a,_0x4670ee){_0x54996a=_0x54996a-0x0;var _0x2f2bdd=_0x8c21[_0x54996a];return _0x2f2bdd;};'use strict';var multer=require(_0x18c2('0x0'));var util=require(_0x18c2('0x1'));var path=require(_0x18c2('0x2'));var timeout=require(_0x18c2('0x3'));var express=require(_0x18c2('0x4'));var router=express['Router']();var fs_extra=require(_0x18c2('0x5'));var auth=require(_0x18c2('0x6'));var interaction=require(_0x18c2('0x7'));var config=require(_0x18c2('0x8'));var controller=require(_0x18c2('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x18c2('0xa')]('/describe',auth[_0x18c2('0xb')](),controller[_0x18c2('0xc')]);router[_0x18c2('0xa')](_0x18c2('0xd'),auth['isAuthenticated'](),controller[_0x18c2('0xe')]);router[_0x18c2('0xa')](_0x18c2('0xf'),auth['isAuthenticated'](),controller[_0x18c2('0x10')]);router[_0x18c2('0xa')](_0x18c2('0x11'),auth[_0x18c2('0xb')](),controller[_0x18c2('0x12')]);router[_0x18c2('0xa')](_0x18c2('0x13'),controller[_0x18c2('0x14')]);router[_0x18c2('0xa')]('/:id/avatar',controller[_0x18c2('0x15')]);router[_0x18c2('0xa')](_0x18c2('0x16'),controller[_0x18c2('0x17')]);router['get'](_0x18c2('0x18'),controller[_0x18c2('0x19')]);router[_0x18c2('0xa')](_0x18c2('0x1a'),auth[_0x18c2('0xb')](),controller[_0x18c2('0x1b')]);router[_0x18c2('0xa')]('/:id/snippet',controller[_0x18c2('0x1c')]);router[_0x18c2('0xa')]('/:id/applications',auth[_0x18c2('0xb')](),controller['getApplications']);router['get']('/:id/proactive_actions',auth[_0x18c2('0xb')](),controller[_0x18c2('0x1d')]);router[_0x18c2('0xa')]('/:id/fields',controller[_0x18c2('0x1e')]);router[_0x18c2('0xa')]('/:id/offline_messages',auth[_0x18c2('0xb')](),controller[_0x18c2('0x1f')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x18c2('0x20')]);router[_0x18c2('0x21')]('/',auth['isAuthenticated'](),controller[_0x18c2('0x22')]);router[_0x18c2('0x21')](_0x18c2('0xf'),auth[_0x18c2('0xb')](),controller['addDisposition']);router[_0x18c2('0x21')]('/:id/canned_answers',auth[_0x18c2('0xb')](),controller[_0x18c2('0x23')]);var upload=multer({'storage':multer[_0x18c2('0x24')]({'destination':function(_0xb14e9b,_0x2bfb51,_0x50a013){_0x50a013(null,path[_0x18c2('0x25')](config['root'],_0x18c2('0x26')));},'filename':function(_0x13803f,_0x354cad,_0x11015e){_0x11015e(null,util[_0x18c2('0x27')](_0x18c2('0x28'),Date[_0x18c2('0x29')](),_0x354cad[_0x18c2('0x2a')]));}})});router[_0x18c2('0x21')](_0x18c2('0x13'),upload['single'](_0x18c2('0x2b')),controller[_0x18c2('0x2c')]);var upload=multer({'storage':multer[_0x18c2('0x24')]({'destination':function(_0x2d9a08,_0x575a79,_0x3aac00){_0x3aac00(null,path[_0x18c2('0x25')](config['root'],_0x18c2('0x2d')));},'filename':function(_0xe29d4f,_0x2d9cec,_0x12659e){_0x12659e(null,util['format']('%s-%s',Date[_0x18c2('0x29')](),_0x2d9cec[_0x18c2('0x2a')]));}})});router[_0x18c2('0x21')](_0x18c2('0x2e'),upload[_0x18c2('0x2f')](_0x18c2('0x2b')),controller[_0x18c2('0x30')]);var upload=multer({'storage':multer[_0x18c2('0x24')]({'destination':function(_0x3dc230,_0xc55e6,_0x65c98a){_0x65c98a(null,path['join'](config[_0x18c2('0x31')],_0x18c2('0x2d')));},'filename':function(_0x577ab8,_0x366f38,_0x23d0ca){_0x23d0ca(null,util[_0x18c2('0x27')](_0x18c2('0x28'),Date[_0x18c2('0x29')](),_0x366f38[_0x18c2('0x2a')]));}})});router[_0x18c2('0x21')](_0x18c2('0x16'),upload['single']('file'),controller[_0x18c2('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4a08b9,_0x1c3eb3,_0x2f27da){_0x2f27da(null,path['join'](config[_0x18c2('0x31')],'server/files/images/avatars/'));},'filename':function(_0x367acc,_0x2c2a9c,_0x2f0477){_0x2f0477(null,util[_0x18c2('0x27')](_0x18c2('0x28'),Date[_0x18c2('0x29')](),_0x2c2a9c['originalname']));}})});router['post'](_0x18c2('0x18'),upload['single'](_0x18c2('0x2b')),controller[_0x18c2('0x33')]);router[_0x18c2('0x21')](_0x18c2('0x34'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x18c2('0x24')]({'destination':function(_0x181c52,_0x5e3744,_0x662105){const _0x5718e2=path[_0x18c2('0x25')](config['root'],_0x18c2('0x35'),'attachments',_0x18c2('0x36'));fs_extra[_0x18c2('0x37')](_0x5718e2,function(){_0x662105(null,_0x5718e2);});},'filename':function(_0x2ca086,_0x4d30b3,_0x3ae70d){const _0x524b64=_0x4d30b3[_0x18c2('0x2a')][_0x18c2('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x335fde=path['extname'](_0x524b64);const _0xbe5908=Date[_0x18c2('0x29')]()+'-'+_0x524b64[_0x18c2('0x38')](_0x335fde,'')+_0x335fde;_0x3ae70d(null,_0xbe5908);}})});router[_0x18c2('0x21')]('/:id/offline',offlineUploadMulter['any'](),controller['offline']);router['post'](_0x18c2('0x1a'),auth['isAuthenticated'](),controller[_0x18c2('0x39')]);router['post'](_0x18c2('0x3a'),auth['isAuthenticated'](),controller[_0x18c2('0x3b')]);router['post'](_0x18c2('0x3c'),auth['isAuthenticated'](),controller[_0x18c2('0x3d')]);router[_0x18c2('0x21')](_0x18c2('0x3e'),auth[_0x18c2('0xb')](),controller['addAgents']);router[_0x18c2('0x3f')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x18c2('0xb')](),controller[_0x18c2('0x40')]);router[_0x18c2('0x41')](_0x18c2('0xf'),auth[_0x18c2('0xb')](),controller[_0x18c2('0x42')]);router[_0x18c2('0x41')](_0x18c2('0x11'),auth[_0x18c2('0xb')](),controller[_0x18c2('0x43')]);router[_0x18c2('0x41')](_0x18c2('0x3e'),auth[_0x18c2('0xb')](),controller[_0x18c2('0x44')]);module[_0x18c2('0x45')]=router;
\ No newline at end of file
+var _0x4d29=['join','now','addAvatar','server/files/images/avatars/','/:id/customer_avatar','addCustomerAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','/:id/users','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','describe','/:id','show','/:id/dispositions','isAuthenticated','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/offline_messages','getOfflineMessages','getAgents','post','create','/:id/canned_answers','addAnswer','diskStorage','root','format','%s-%s','originalname','single','file'];(function(_0x2c3bd9,_0x45f815){var _0x112e55=function(_0x22de25){while(--_0x22de25){_0x2c3bd9['push'](_0x2c3bd9['shift']());}};_0x112e55(++_0x45f815);}(_0x4d29,0x1e3));var _0x94d2=function(_0x16e78e,_0x106c9c){_0x16e78e=_0x16e78e-0x0;var _0x273665=_0x4d29[_0x16e78e];return _0x273665;};'use strict';var multer=require('multer');var util=require(_0x94d2('0x0'));var path=require(_0x94d2('0x1'));var timeout=require(_0x94d2('0x2'));var express=require(_0x94d2('0x3'));var router=express[_0x94d2('0x4')]();var fs_extra=require(_0x94d2('0x5'));var auth=require(_0x94d2('0x6'));var interaction=require(_0x94d2('0x7'));var config=require(_0x94d2('0x8'));var controller=require(_0x94d2('0x9'));router[_0x94d2('0xa')]('/',auth['isAuthenticated'](),controller[_0x94d2('0xb')]);router[_0x94d2('0xa')](_0x94d2('0xc'),auth['isAuthenticated'](),controller[_0x94d2('0xd')]);router[_0x94d2('0xa')](_0x94d2('0xe'),auth['isAuthenticated'](),controller[_0x94d2('0xf')]);router[_0x94d2('0xa')](_0x94d2('0x10'),auth[_0x94d2('0x11')](),controller[_0x94d2('0x12')]);router[_0x94d2('0xa')]('/:id/canned_answers',auth[_0x94d2('0x11')](),controller[_0x94d2('0x13')]);router[_0x94d2('0xa')](_0x94d2('0x14'),controller[_0x94d2('0x15')]);router['get'](_0x94d2('0x16'),controller[_0x94d2('0x17')]);router['get']('/:id/customer_avatar',controller[_0x94d2('0x18')]);router[_0x94d2('0xa')](_0x94d2('0x19'),controller[_0x94d2('0x1a')]);router[_0x94d2('0xa')](_0x94d2('0x1b'),auth['isAuthenticated'](),controller[_0x94d2('0x1c')]);router[_0x94d2('0xa')](_0x94d2('0x1d'),controller[_0x94d2('0x1e')]);router[_0x94d2('0xa')](_0x94d2('0x1f'),auth[_0x94d2('0x11')](),controller[_0x94d2('0x20')]);router[_0x94d2('0xa')](_0x94d2('0x21'),auth[_0x94d2('0x11')](),controller[_0x94d2('0x22')]);router['get']('/:id/fields',controller['getFields']);router[_0x94d2('0xa')](_0x94d2('0x23'),auth['isAuthenticated'](),controller[_0x94d2('0x24')]);router['get']('/:id/users',auth[_0x94d2('0x11')](),controller[_0x94d2('0x25')]);router[_0x94d2('0x26')]('/',auth[_0x94d2('0x11')](),controller[_0x94d2('0x27')]);router[_0x94d2('0x26')](_0x94d2('0x10'),auth[_0x94d2('0x11')](),controller['addDisposition']);router[_0x94d2('0x26')](_0x94d2('0x28'),auth['isAuthenticated'](),controller[_0x94d2('0x29')]);var upload=multer({'storage':multer[_0x94d2('0x2a')]({'destination':function(_0x218f0b,_0x5bd37c,_0x58e299){_0x58e299(null,path['join'](config[_0x94d2('0x2b')],'server/files/images/logos/'));},'filename':function(_0x23c9ed,_0xe4c083,_0x32aae8){_0x32aae8(null,util[_0x94d2('0x2c')](_0x94d2('0x2d'),Date['now'](),_0xe4c083[_0x94d2('0x2e')]));}})});router[_0x94d2('0x26')](_0x94d2('0x14'),upload[_0x94d2('0x2f')](_0x94d2('0x30')),controller['addLogo']);var upload=multer({'storage':multer[_0x94d2('0x2a')]({'destination':function(_0x5546b7,_0x1eb542,_0x406b80){_0x406b80(null,path[_0x94d2('0x31')](config[_0x94d2('0x2b')],'server/files/images/avatars/'));},'filename':function(_0x295846,_0x366a27,_0x5ec42c){_0x5ec42c(null,util[_0x94d2('0x2c')](_0x94d2('0x2d'),Date[_0x94d2('0x32')](),_0x366a27[_0x94d2('0x2e')]));}})});router[_0x94d2('0x26')](_0x94d2('0x16'),upload[_0x94d2('0x2f')](_0x94d2('0x30')),controller[_0x94d2('0x33')]);var upload=multer({'storage':multer[_0x94d2('0x2a')]({'destination':function(_0x1be353,_0x38579b,_0x25b66e){_0x25b66e(null,path[_0x94d2('0x31')](config[_0x94d2('0x2b')],_0x94d2('0x34')));},'filename':function(_0x5d009a,_0x17171e,_0x4a2876){_0x4a2876(null,util['format']('%s-%s',Date[_0x94d2('0x32')](),_0x17171e[_0x94d2('0x2e')]));}})});router['post'](_0x94d2('0x35'),upload[_0x94d2('0x2f')]('file'),controller[_0x94d2('0x36')]);var upload=multer({'storage':multer[_0x94d2('0x2a')]({'destination':function(_0x49d328,_0x390160,_0x19c9e8){_0x19c9e8(null,path['join'](config[_0x94d2('0x2b')],_0x94d2('0x34')));},'filename':function(_0x13fbbe,_0x27071a,_0x219217){_0x219217(null,util[_0x94d2('0x2c')](_0x94d2('0x2d'),Date[_0x94d2('0x32')](),_0x27071a['originalname']));}})});router['post'](_0x94d2('0x19'),upload[_0x94d2('0x2f')](_0x94d2('0x30')),controller['addSystemAvatar']);router['post'](_0x94d2('0x37'),controller[_0x94d2('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x94d2('0x2a')]({'destination':function(_0x354342,_0x6c60,_0x44ed63){const _0x48d5de=path[_0x94d2('0x31')](config['root'],_0x94d2('0x39'),_0x94d2('0x3a'),'offline-chat');fs_extra[_0x94d2('0x3b')](_0x48d5de,function(){_0x44ed63(null,_0x48d5de);});},'filename':function(_0x9693e3,_0x261015,_0x16eb43){const _0x194292=_0x261015['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x512c1b=path['extname'](_0x194292);const _0x3c095e=Date[_0x94d2('0x32')]()+'-'+_0x194292[_0x94d2('0x3c')](_0x512c1b,'')+_0x512c1b;_0x16eb43(null,_0x3c095e);}})});router[_0x94d2('0x26')](_0x94d2('0x3d'),offlineUploadMulter[_0x94d2('0x3e')](),controller[_0x94d2('0x3f')]);router[_0x94d2('0x26')](_0x94d2('0x1b'),auth[_0x94d2('0x11')](),controller[_0x94d2('0x40')]);router[_0x94d2('0x26')](_0x94d2('0x1f'),auth[_0x94d2('0x11')](),controller[_0x94d2('0x41')]);router[_0x94d2('0x26')](_0x94d2('0x21'),auth['isAuthenticated'](),controller[_0x94d2('0x42')]);router[_0x94d2('0x26')](_0x94d2('0x43'),auth[_0x94d2('0x11')](),controller[_0x94d2('0x44')]);router[_0x94d2('0x45')]('/:id',auth[_0x94d2('0x11')](),controller[_0x94d2('0x46')]);router['delete'](_0x94d2('0xe'),auth[_0x94d2('0x11')](),controller['destroy']);router[_0x94d2('0x47')]('/:id/dispositions',auth[_0x94d2('0x11')](),controller[_0x94d2('0x48')]);router[_0x94d2('0x47')](_0x94d2('0x28'),auth[_0x94d2('0x11')](),controller[_0x94d2('0x49')]);router[_0x94d2('0x47')](_0x94d2('0x43'),auth[_0x94d2('0x11')](),controller[_0x94d2('0x4a')]);module[_0x94d2('0x4b')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index dd7c0c6..32654b3 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 _0xfabe=['exports','../components/auth/service','../config/environment','Router','env','get','Client-Side\x20logger\x20not\x20found!','/client-logs','isAuthenticated'];(function(_0x466247,_0x5d69e3){var _0x4b352e=function(_0x58c71b){while(--_0x58c71b){_0x466247['push'](_0x466247['shift']());}};_0x4b352e(++_0x5d69e3);}(_0xfabe,0x64));var _0xefab=function(_0x4b4765,_0x32d7b6){_0x4b4765=_0x4b4765-0x0;var _0x590656=_0xfabe[_0x4b4765];return _0x590656;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require(_0xefab('0x0'));var config=require(_0xefab('0x1'));var router=express[_0xefab('0x2')]();var isProduction=config[_0xefab('0x3')]==='production'||![];function clientSideLogs(_0x54d8b3,_0x1d5015,_0x3e5bb7){var _0x36ae9=_0x54d8b3['app'][_0xefab('0x4')]('client-side-logger');if(!_0x36ae9){throw new Error(_0xefab('0x5'));}return beaverLogger['expressEndpoint']({'uri':_0xefab('0x6'),'logger':_0x36ae9,'enableCors':!isProduction})(_0x54d8b3,_0x1d5015,_0x3e5bb7);}router['use'](auth[_0xefab('0x7')](),clientSideLogs);module[_0xefab('0x8')]=router;
\ No newline at end of file
+var _0x20fd=['/client-logs','isAuthenticated','exports','express','../components/auth/service','../config/environment','production','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint'];(function(_0x293630,_0x174077){var _0x5ae4c0=function(_0x514cf7){while(--_0x514cf7){_0x293630['push'](_0x293630['shift']());}};_0x5ae4c0(++_0x174077);}(_0x20fd,0xdf));var _0xd20f=function(_0x328e48,_0x2d31b1){_0x328e48=_0x328e48-0x0;var _0x2fefa4=_0x20fd[_0x328e48];return _0x2fefa4;};var beaverLogger=require('beaver-logger/server');var express=require(_0xd20f('0x0'));var auth=require(_0xd20f('0x1'));var config=require(_0xd20f('0x2'));var router=express['Router']();var isProduction=config['env']===_0xd20f('0x3')||![];function clientSideLogs(_0xe4b9f3,_0x54dd92,_0xf5f411){var _0x401152=_0xe4b9f3['app'][_0xd20f('0x4')]('client-side-logger');if(!_0x401152){throw new Error(_0xd20f('0x5'));}return beaverLogger[_0xd20f('0x6')]({'uri':_0xd20f('0x7'),'logger':_0x401152,'enableCors':!isProduction})(_0xe4b9f3,_0x54dd92,_0xf5f411);}router['use'](auth[_0xd20f('0x8')](),clientSideLogs);module[_0xd20f('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 9554fe9..9b5df81 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 _0x214c=['exports','STRING','ENUM','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token'];(function(_0x1e6601,_0x99250b){var _0x44ddf1=function(_0x118097){while(--_0x118097){_0x1e6601['push'](_0x1e6601['shift']());}};_0x44ddf1(++_0x99250b);}(_0x214c,0x1a0));var _0xc214=function(_0x4353cd,_0x3c8895){_0x4353cd=_0x4353cd-0x0;var _0x4eb363=_0x214c[_0x4353cd];return _0x4eb363;};'use strict';var Sequelize=require('sequelize');module[_0xc214('0x0')]={'name':{'type':Sequelize[_0xc214('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xc214('0x2')]('AmazonAWS',_0xc214('0x3'),_0xc214('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xc214('0x2')](_0xc214('0x5'),_0xc214('0x6'))},'data1':{'type':Sequelize[_0xc214('0x1')],'comment':_0xc214('0x7')},'data2':{'type':Sequelize[_0xc214('0x1')],'comment':_0xc214('0x8')},'data3':{'type':Sequelize['STRING'],'comment':_0xc214('0x9')},'data4':{'type':Sequelize[_0xc214('0x1')],'comment':_0xc214('0xa')},'data5':{'type':Sequelize[_0xc214('0xb')],'comment':_0xc214('0xc')},'data6':{'type':Sequelize[_0xc214('0xb')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xc214('0xb')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0x47ed=['Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365'];(function(_0xe2b8fc,_0x3ec76a){var _0x1bfefb=function(_0x11e1ec){while(--_0x11e1ec){_0xe2b8fc['push'](_0xe2b8fc['shift']());}};_0x1bfefb(++_0x3ec76a);}(_0x47ed,0x98));var _0xd47e=function(_0x534185,_0x1e880f){_0x534185=_0x534185-0x0;var _0xd10ee2=_0x47ed[_0x534185];return _0xd10ee2;};'use strict';var Sequelize=require(_0xd47e('0x0'));module[_0xd47e('0x1')]={'name':{'type':Sequelize[_0xd47e('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd47e('0x3')](_0xd47e('0x4'),_0xd47e('0x5'),_0xd47e('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xd47e('0x7'),_0xd47e('0x8'))},'data1':{'type':Sequelize['STRING'],'comment':_0xd47e('0x9')},'data2':{'type':Sequelize[_0xd47e('0x2')],'comment':_0xd47e('0xa')},'data3':{'type':Sequelize[_0xd47e('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':_0xd47e('0xb')},'data5':{'type':Sequelize['TEXT'],'comment':_0xd47e('0xc')},'data6':{'type':Sequelize['TEXT'],'comment':_0xd47e('0xd')},'data7':{'type':Sequelize[_0xd47e('0xe')],'comment':_0xd47e('0xf')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index ac34583..2a0a8a9 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 _0x201b=['Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','params','encryptString','destroy','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','toString','ascii','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','refresh_token','startRefreshInterval','emit','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','error','stack','send','padEnd','slice','index','CloudProvider','type','key','map','name','query','keys','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','options','includeAll','findAll','service','MicrosoftAzure','data3','show','rawAttributes','intersection','include','merge','find','decryptString','catch','create','body','Service\x20parameter\x20not\x20specified','values','includes'];(function(_0x3b1a74,_0x431559){var _0x58b051=function(_0x2b62c4){while(--_0x2b62c4){_0x3b1a74['push'](_0x3b1a74['shift']());}};_0x58b051(++_0x431559);}(_0x201b,0x77));var _0xb201=function(_0x4ec784,_0x3995d7){_0x4ec784=_0x4ec784-0x0;var _0x4e3ec3=_0x201b[_0x4ec784];return _0x4e3ec3;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0xb201('0x0'));var encryptor=require(_0xb201('0x1'));var config=require(_0xb201('0x2'));var logger=require(_0xb201('0x3'))(_0xb201('0x4'));var db=require('../../mysqldb')['db'];var oauth=require(_0xb201('0x5'));config[_0xb201('0x6')]=_[_0xb201('0x7')](config['redis'],{'host':_0xb201('0x8'),'port':0x18eb});var socket=require(_0xb201('0x9'))(new Redis(config[_0xb201('0x6')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x29ee00,_0x9ead73){_0x9ead73=_0x9ead73||0xcc;return function(_0x4d0f07){if(_0x4d0f07){return _0x29ee00[_0xb201('0xa')](_0x9ead73);}return _0x29ee00[_0xb201('0xb')](_0x9ead73)[_0xb201('0xc')]();};}function respondWithResult(_0xeab41d,_0x20bce8){_0x20bce8=_0x20bce8||0xc8;return function(_0xd03a90){if(_0xd03a90){return _0xeab41d[_0xb201('0xb')](_0x20bce8)[_0xb201('0xd')](_0xd03a90);}};}function respondWithFilteredResult(_0x40be56,_0x528c5b){return function(_0x4ac92f){if(_0x4ac92f){var _0x33ad7b=typeof _0x528c5b[_0xb201('0xe')]===_0xb201('0xf')&&typeof _0x528c5b[_0xb201('0x10')]==='undefined';var _0x3c8c4a=_0x4ac92f[_0xb201('0x11')];var _0x5607fe=_0x33ad7b?0x0:_0x528c5b[_0xb201('0xe')];var _0x40ad8f=_0x33ad7b?_0x4ac92f[_0xb201('0x11')]:_0x528c5b[_0xb201('0xe')]+_0x528c5b['limit'];var _0x3d26b7;if(_0x40ad8f>=_0x3c8c4a){_0x40ad8f=_0x3c8c4a;_0x3d26b7=0xc8;}else{_0x3d26b7=0xce;}_0x40be56[_0xb201('0xb')](_0x3d26b7);return _0x40be56[_0xb201('0x12')]('Content-Range',_0x5607fe+'-'+_0x40ad8f+'/'+_0x3c8c4a)[_0xb201('0xd')](_0x4ac92f);}return null;};}function saveUpdates(_0x5ef6ba){return function(_0x2de787){if(_0x2de787){return _0x2de787[_0xb201('0x13')](_0x5ef6ba)[_0xb201('0x14')](function(_0x2cdd49){return _0x2cdd49;});}return null;};}function removeEntity(_0x32da75){return function(_0xc8cf49){if(_0xc8cf49){return _0xc8cf49['destroy']()['then'](function(){_0x32da75[_0xb201('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3af8a9){return function(_0x3ef4e4){if(!_0x3ef4e4){_0x3af8a9[_0xb201('0xa')](0x194);}return _0x3ef4e4;};}function handleError(_0xe3fcf1,_0x5234a8){_0x5234a8=_0x5234a8||0x1f4;return function(_0x2bb4af){logger[_0xb201('0x15')](_0x2bb4af[_0xb201('0x16')]);if(_0x2bb4af['name']){delete _0x2bb4af['name'];}_0xe3fcf1[_0xb201('0xb')](_0x5234a8)[_0xb201('0x17')](_0x2bb4af);};}function maskClientSecret(_0x1ab884){return _[_0xb201('0x18')](_0x1ab884[_0xb201('0x19')](0x0,0x3),0x14,'*');}exports[_0xb201('0x1a')]=function(_0x52c34c,_0x8acd21){var _0x3384ab={},_0x441a1d={},_0x40be3d={'count':0x0,'rows':[]};var _0x408420=_['map'](db[_0xb201('0x1b')]['rawAttributes'],function(_0x2ae695){return{'name':_0x2ae695['fieldName'],'type':_0x2ae695[_0xb201('0x1c')][_0xb201('0x1d')]};});_0x441a1d['model']=_[_0xb201('0x1e')](_0x408420,_0xb201('0x1f'));_0x441a1d[_0xb201('0x20')]=_[_0xb201('0x21')](_0x52c34c[_0xb201('0x20')]);_0x441a1d['filters']=_['intersection'](_0x441a1d[_0xb201('0x22')],_0x441a1d['query']);_0x3384ab['attributes']=_['intersection'](_0x441a1d['model'],qs[_0xb201('0x23')](_0x52c34c['query']['fields']));_0x3384ab[_0xb201('0x24')]=_0x3384ab[_0xb201('0x24')][_0xb201('0x25')]?_0x3384ab[_0xb201('0x24')]:_0x441a1d[_0xb201('0x22')];if(!_0x52c34c[_0xb201('0x20')][_0xb201('0x26')](_0xb201('0x27'))){_0x3384ab[_0xb201('0x10')]=qs['limit'](_0x52c34c[_0xb201('0x20')][_0xb201('0x10')]);_0x3384ab[_0xb201('0xe')]=qs[_0xb201('0xe')](_0x52c34c[_0xb201('0x20')][_0xb201('0xe')]);}_0x3384ab[_0xb201('0x28')]=qs[_0xb201('0x29')](_0x52c34c[_0xb201('0x20')]['sort']);_0x3384ab[_0xb201('0x2a')]=qs['filters'](_[_0xb201('0x2b')](_0x52c34c[_0xb201('0x20')],_0x441a1d[_0xb201('0x2c')]),_0x408420);if(_0x52c34c['query'][_0xb201('0x2d')]){_0x3384ab[_0xb201('0x2a')]=_['merge'](_0x3384ab[_0xb201('0x2a')],{'$or':_['map'](_0x408420,function(_0x18b526){if(_0x18b526[_0xb201('0x1c')]!=='VIRTUAL'){var _0x452290={};_0x452290[_0x18b526['name']]={'$like':'%'+_0x52c34c[_0xb201('0x20')][_0xb201('0x2d')]+'%'};return _0x452290;}})});}_0x3384ab=_['merge']({},_0x3384ab,_0x52c34c[_0xb201('0x2e')]);var _0x3494ba={'where':_0x3384ab['where']};return db[_0xb201('0x1b')][_0xb201('0x11')](_0x3494ba)[_0xb201('0x14')](function(_0x63d806){_0x40be3d[_0xb201('0x11')]=_0x63d806;if(_0x52c34c[_0xb201('0x20')][_0xb201('0x2f')]){_0x3384ab['include']=[{'all':!![]}];}return db[_0xb201('0x1b')][_0xb201('0x30')](_0x3384ab);})[_0xb201('0x14')](function(_0x3d8507){_0x40be3d['rows']=_['map'](_0x3d8507,function(_0x513d26){if(_0x513d26[_0xb201('0x31')]===_0xb201('0x32')){var _0x22c6ce=encryptor['decryptString'](_0x513d26[_0xb201('0x33')]);_0x513d26[_0xb201('0x33')]=maskClientSecret(_0x22c6ce);}return _0x513d26;});return _0x40be3d;})[_0xb201('0x14')](respondWithFilteredResult(_0x8acd21,_0x3384ab))['catch'](handleError(_0x8acd21,null));};exports[_0xb201('0x34')]=function(_0x4f619c,_0x5cf413){var _0x286a11={'raw':!![],'where':{'id':_0x4f619c['params']['id']}},_0x248b31={};_0x248b31[_0xb201('0x22')]=_[_0xb201('0x21')](db[_0xb201('0x1b')][_0xb201('0x35')]);_0x248b31[_0xb201('0x20')]=_[_0xb201('0x21')](_0x4f619c['query']);_0x248b31[_0xb201('0x2c')]=_[_0xb201('0x36')](_0x248b31[_0xb201('0x22')],_0x248b31[_0xb201('0x20')]);_0x286a11[_0xb201('0x24')]=_[_0xb201('0x36')](_0x248b31[_0xb201('0x22')],qs[_0xb201('0x23')](_0x4f619c[_0xb201('0x20')]['fields']));_0x286a11[_0xb201('0x24')]=_0x286a11[_0xb201('0x24')][_0xb201('0x25')]?_0x286a11['attributes']:_0x248b31[_0xb201('0x22')];if(_0x4f619c[_0xb201('0x20')][_0xb201('0x2f')]){_0x286a11[_0xb201('0x37')]=[{'all':!![]}];}_0x286a11=_[_0xb201('0x38')]({},_0x286a11,_0x4f619c['options']);return db[_0xb201('0x1b')][_0xb201('0x39')](_0x286a11)[_0xb201('0x14')](handleEntityNotFound(_0x5cf413,null))[_0xb201('0x14')](function(_0x4669f5){if(_0x4669f5[_0xb201('0x31')]==='MicrosoftAzure'){var _0x19e62d=encryptor[_0xb201('0x3a')](_0x4669f5[_0xb201('0x33')]);_0x4669f5[_0xb201('0x33')]=maskClientSecret(_0x19e62d);}return _0x4669f5;})['then'](respondWithResult(_0x5cf413,null))[_0xb201('0x3b')](handleError(_0x5cf413,null));};exports[_0xb201('0x3c')]=function(_0x215a02,_0x4c7aef){if(!_0x215a02[_0xb201('0x3d')][_0xb201('0x1f')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x215a02[_0xb201('0x3d')][_0xb201('0x31')])throw new Error(_0xb201('0x3e'));var _0x4cdcf3=db[_0xb201('0x1b')][_0xb201('0x35')][_0xb201('0x31')][_0xb201('0x3f')];if(!_0x4cdcf3[_0xb201('0x40')](_0x215a02[_0xb201('0x3d')][_0xb201('0x31')]))throw new Error(_0xb201('0x41')+_0x4cdcf3[_0xb201('0x42')](',\x20'));if(_0x215a02['body']['service']===_0xb201('0x32')&&_0x215a02[_0xb201('0x3d')][_0xb201('0x33')]){_0x215a02[_0xb201('0x3d')]['data3']=encryptor['encryptString'](_0x215a02['body']['data3']);}return db['CloudProvider'][_0xb201('0x3c')](_0x215a02[_0xb201('0x3d')],{})[_0xb201('0x14')](respondWithResult(_0x4c7aef,0xc9))[_0xb201('0x3b')](handleError(_0x4c7aef,null));};exports['update']=function(_0x2e1f42,_0x2644d6){if(_0x2e1f42[_0xb201('0x3d')]['id']){delete _0x2e1f42[_0xb201('0x3d')]['id'];}return db['CloudProvider'][_0xb201('0x39')]({'where':{'id':_0x2e1f42[_0xb201('0x43')]['id']}})[_0xb201('0x14')](handleEntityNotFound(_0x2644d6,null))[_0xb201('0x14')](function(_0x2a9dc2){if(_0x2a9dc2[_0xb201('0x31')]===_0xb201('0x32')&&_0x2e1f42['body'][_0xb201('0x33')]){_0x2e1f42[_0xb201('0x3d')]['data3']=encryptor[_0xb201('0x44')](_0x2e1f42[_0xb201('0x3d')][_0xb201('0x33')]);}return _0x2a9dc2;})[_0xb201('0x14')](saveUpdates(_0x2e1f42[_0xb201('0x3d')],null))[_0xb201('0x14')](respondWithResult(_0x2644d6,null))[_0xb201('0x3b')](handleError(_0x2644d6,null));};exports[_0xb201('0x45')]=function(_0x280fa4,_0x1c8eff){return db[_0xb201('0x1b')][_0xb201('0x39')]({'where':{'id':_0x280fa4['params']['id']}})[_0xb201('0x14')](handleEntityNotFound(_0x1c8eff,null))[_0xb201('0x14')](removeEntity(_0x1c8eff,null))[_0xb201('0x3b')](handleError(_0x1c8eff,null));};exports[_0xb201('0x46')]=function(_0x4bd5a0,_0x7684c5){return db[_0xb201('0x1b')]['findOne']({'where':{'id':_0x4bd5a0[_0xb201('0x43')]['id']},'raw':!![]})[_0xb201('0x14')](function(_0x594061){if(!_0x594061)return _0x7684c5[_0xb201('0xa')](0x194);return{'url':oauth[_0xb201('0x47')](_0x594061,_0x4bd5a0[_0xb201('0x48')]['id'])};})[_0xb201('0x14')](respondWithResult(_0x7684c5,null))[_0xb201('0x3b')](handleError(_0x7684c5,null));};exports[_0xb201('0x49')]=function(_0x38a099,_0x502265){var _0x472811=_0x38a099[_0xb201('0x3d')];var _0x27ab79;var _0x3d5829;if(_0x472811['error'])throw _0x472811;redis[_0xb201('0x4a')](_0x472811[_0xb201('0x4b')])[_0xb201('0x14')](function(_0x2db7e0){if(!_0x2db7e0)throw new Error(_0xb201('0x4c'));_0x27ab79=JSON[_0xb201('0x4d')](_0x2db7e0);var _0x3ddb28=Buffer[_0xb201('0x4e')](_0x472811[_0xb201('0x4b')],'base64')[_0xb201('0x4f')](_0xb201('0x50'));_0x3d5829=JSON[_0xb201('0x4d')](_0x3ddb28);if(!oauth['isValidIdToken'](_0x472811[_0xb201('0x51')],_0x27ab79[_0xb201('0x52')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xb201('0x53')](_0x472811[_0xb201('0x4b')]);return oauth[_0xb201('0x54')](_0x472811[_0xb201('0x55')],_0x27ab79);})[_0xb201('0x14')](function(_0x88ddb7){_0x27ab79[_0xb201('0x56')]=_0x88ddb7['access_token'];_0x27ab79['data6']=_0x88ddb7[_0xb201('0x57')];return db[_0xb201('0x1b')]['update']({'data5':_0x27ab79[_0xb201('0x56')],'data6':_0x27ab79['data6']},{'where':{'id':_0x27ab79['id']}});})[_0xb201('0x14')](function(){oauth[_0xb201('0x58')](_0x27ab79);socket['emit']('microsoftAuthorization:success',{'id':_0x3d5829['id']});return;})[_0xb201('0x14')](respondWithStatusCode(_0x502265,null))[_0xb201('0x3b')](function(_0x10f25d){if(_0x3d5829){socket[_0xb201('0x59')]('microsoftAuthorization:error',{'id':_0x3d5829['id']});}if(!_0x27ab79){logger[_0xb201('0x15')](_0xb201('0x5a'),_0x10f25d);return _0x502265['status'](0x1f4)[_0xb201('0x17')](_0x10f25d['message']);}logger[_0xb201('0x15')](_0xb201('0x5b'),_0x27ab79['id'],JSON['stringify'](_0x10f25d));});};
\ No newline at end of file
+var _0x58ff=['params','keys','CloudProvider','find','create','body','values','includes','join','encryptString','update','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','stringify','lodash','ioredis','../../components/encryptor','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','then','destroy','error','stack','name','index','map','rawAttributes','key','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x58ff,0x81));var _0xf58f=function(_0x5b446f,_0x1e7e46){_0x5b446f=_0x5b446f-0x0;var _0x20c754=_0x58ff[_0x5b446f];return _0x20c754;};'use strict';var _=require(_0xf58f('0x0'));var Redis=require(_0xf58f('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xf58f('0x2'));var config=require('../../config/environment');var logger=require(_0xf58f('0x3'))(_0xf58f('0x4'));var db=require(_0xf58f('0x5'))['db'];var oauth=require(_0xf58f('0x6'));config[_0xf58f('0x7')]=_[_0xf58f('0x8')](config[_0xf58f('0x7')],{'host':_0xf58f('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf58f('0x7')]));var redis=new Redis(config[_0xf58f('0x7')]);function respondWithStatusCode(_0x4b4020,_0x37d8af){_0x37d8af=_0x37d8af||0xcc;return function(_0xa5443f){if(_0xa5443f){return _0x4b4020[_0xf58f('0xa')](_0x37d8af);}return _0x4b4020[_0xf58f('0xb')](_0x37d8af)[_0xf58f('0xc')]();};}function respondWithResult(_0x15cdae,_0xbc421c){_0xbc421c=_0xbc421c||0xc8;return function(_0x38e407){if(_0x38e407){return _0x15cdae[_0xf58f('0xb')](_0xbc421c)[_0xf58f('0xd')](_0x38e407);}};}function respondWithFilteredResult(_0xdd6dcb,_0x5a2889){return function(_0x197f11){if(_0x197f11){var _0x2e7e2b=typeof _0x5a2889[_0xf58f('0xe')]===_0xf58f('0xf')&&typeof _0x5a2889[_0xf58f('0x10')]===_0xf58f('0xf');var _0x17fbb6=_0x197f11['count'];var _0x2944b2=_0x2e7e2b?0x0:_0x5a2889[_0xf58f('0xe')];var _0x5dd93b=_0x2e7e2b?_0x197f11[_0xf58f('0x11')]:_0x5a2889[_0xf58f('0xe')]+_0x5a2889['limit'];var _0x15db88;if(_0x5dd93b>=_0x17fbb6){_0x5dd93b=_0x17fbb6;_0x15db88=0xc8;}else{_0x15db88=0xce;}_0xdd6dcb['status'](_0x15db88);return _0xdd6dcb['set'](_0xf58f('0x12'),_0x2944b2+'-'+_0x5dd93b+'/'+_0x17fbb6)[_0xf58f('0xd')](_0x197f11);}return null;};}function saveUpdates(_0x2d90a8){return function(_0x5244be){if(_0x5244be){return _0x5244be['update'](_0x2d90a8)[_0xf58f('0x13')](function(_0x3af39f){return _0x3af39f;});}return null;};}function removeEntity(_0x140b83){return function(_0x2de73b){if(_0x2de73b){return _0x2de73b[_0xf58f('0x14')]()[_0xf58f('0x13')](function(){_0x140b83[_0xf58f('0xb')](0xcc)[_0xf58f('0xc')]();});}};}function handleEntityNotFound(_0x2b9738){return function(_0x20eeee){if(!_0x20eeee){_0x2b9738[_0xf58f('0xa')](0x194);}return _0x20eeee;};}function handleError(_0x574871,_0x553a2d){_0x553a2d=_0x553a2d||0x1f4;return function(_0x1afaaf){logger[_0xf58f('0x15')](_0x1afaaf[_0xf58f('0x16')]);if(_0x1afaaf['name']){delete _0x1afaaf[_0xf58f('0x17')];}_0x574871[_0xf58f('0xb')](_0x553a2d)['send'](_0x1afaaf);};}function maskClientSecret(_0x19c828){return _['padEnd'](_0x19c828['slice'](0x0,0x3),0x14,'*');}exports[_0xf58f('0x18')]=function(_0x1b8bc9,_0x112b3c){var _0x598445={},_0x2775c9={},_0x1007d8={'count':0x0,'rows':[]};var _0x4611dd=_[_0xf58f('0x19')](db['CloudProvider'][_0xf58f('0x1a')],function(_0xaacc60){return{'name':_0xaacc60['fieldName'],'type':_0xaacc60['type'][_0xf58f('0x1b')]};});_0x2775c9['model']=_['map'](_0x4611dd,_0xf58f('0x17'));_0x2775c9['query']=_['keys'](_0x1b8bc9['query']);_0x2775c9[_0xf58f('0x1c')]=_[_0xf58f('0x1d')](_0x2775c9[_0xf58f('0x1e')],_0x2775c9[_0xf58f('0x1f')]);_0x598445[_0xf58f('0x20')]=_[_0xf58f('0x1d')](_0x2775c9['model'],qs['fields'](_0x1b8bc9[_0xf58f('0x1f')][_0xf58f('0x21')]));_0x598445[_0xf58f('0x20')]=_0x598445[_0xf58f('0x20')]['length']?_0x598445['attributes']:_0x2775c9[_0xf58f('0x1e')];if(!_0x1b8bc9[_0xf58f('0x1f')][_0xf58f('0x22')](_0xf58f('0x23'))){_0x598445[_0xf58f('0x10')]=qs[_0xf58f('0x10')](_0x1b8bc9[_0xf58f('0x1f')]['limit']);_0x598445['offset']=qs[_0xf58f('0xe')](_0x1b8bc9['query'][_0xf58f('0xe')]);}_0x598445[_0xf58f('0x24')]=qs[_0xf58f('0x25')](_0x1b8bc9[_0xf58f('0x1f')][_0xf58f('0x25')]);_0x598445[_0xf58f('0x26')]=qs[_0xf58f('0x1c')](_[_0xf58f('0x27')](_0x1b8bc9[_0xf58f('0x1f')],_0x2775c9['filters']),_0x4611dd);if(_0x1b8bc9[_0xf58f('0x1f')]['filter']){_0x598445['where']=_['merge'](_0x598445[_0xf58f('0x26')],{'$or':_[_0xf58f('0x19')](_0x4611dd,function(_0x399955){if(_0x399955['type']!==_0xf58f('0x28')){var _0x449c6b={};_0x449c6b[_0x399955['name']]={'$like':'%'+_0x1b8bc9['query'][_0xf58f('0x29')]+'%'};return _0x449c6b;}})});}_0x598445=_[_0xf58f('0x2a')]({},_0x598445,_0x1b8bc9[_0xf58f('0x2b')]);var _0x24caf6={'where':_0x598445['where']};return db['CloudProvider']['count'](_0x24caf6)[_0xf58f('0x13')](function(_0x25045d){_0x1007d8[_0xf58f('0x11')]=_0x25045d;if(_0x1b8bc9['query'][_0xf58f('0x2c')]){_0x598445[_0xf58f('0x2d')]=[{'all':!![]}];}return db['CloudProvider'][_0xf58f('0x2e')](_0x598445);})[_0xf58f('0x13')](function(_0x549e0f){_0x1007d8[_0xf58f('0x2f')]=_[_0xf58f('0x19')](_0x549e0f,function(_0x2f03e1){if(_0x2f03e1[_0xf58f('0x30')]===_0xf58f('0x31')){var _0x2133f4=encryptor[_0xf58f('0x32')](_0x2f03e1[_0xf58f('0x33')]);_0x2f03e1[_0xf58f('0x33')]=maskClientSecret(_0x2133f4);}return _0x2f03e1;});return _0x1007d8;})[_0xf58f('0x13')](respondWithFilteredResult(_0x112b3c,_0x598445))[_0xf58f('0x34')](handleError(_0x112b3c,null));};exports['show']=function(_0x56c1d6,_0x4b1c0a){var _0x33307d={'raw':!![],'where':{'id':_0x56c1d6[_0xf58f('0x35')]['id']}},_0x2daf0c={};_0x2daf0c[_0xf58f('0x1e')]=_[_0xf58f('0x36')](db[_0xf58f('0x37')][_0xf58f('0x1a')]);_0x2daf0c[_0xf58f('0x1f')]=_['keys'](_0x56c1d6[_0xf58f('0x1f')]);_0x2daf0c['filters']=_['intersection'](_0x2daf0c[_0xf58f('0x1e')],_0x2daf0c[_0xf58f('0x1f')]);_0x33307d[_0xf58f('0x20')]=_['intersection'](_0x2daf0c['model'],qs[_0xf58f('0x21')](_0x56c1d6[_0xf58f('0x1f')][_0xf58f('0x21')]));_0x33307d[_0xf58f('0x20')]=_0x33307d[_0xf58f('0x20')]['length']?_0x33307d[_0xf58f('0x20')]:_0x2daf0c['model'];if(_0x56c1d6[_0xf58f('0x1f')]['includeAll']){_0x33307d[_0xf58f('0x2d')]=[{'all':!![]}];}_0x33307d=_['merge']({},_0x33307d,_0x56c1d6[_0xf58f('0x2b')]);return db['CloudProvider'][_0xf58f('0x38')](_0x33307d)[_0xf58f('0x13')](handleEntityNotFound(_0x4b1c0a,null))[_0xf58f('0x13')](function(_0x54f10f){if(_0x54f10f[_0xf58f('0x30')]===_0xf58f('0x31')){var _0x49dabc=encryptor[_0xf58f('0x32')](_0x54f10f[_0xf58f('0x33')]);_0x54f10f['data3']=maskClientSecret(_0x49dabc);}return _0x54f10f;})['then'](respondWithResult(_0x4b1c0a,null))[_0xf58f('0x34')](handleError(_0x4b1c0a,null));};exports[_0xf58f('0x39')]=function(_0x3f87c6,_0x5a0ebb){if(!_0x3f87c6['body'][_0xf58f('0x17')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x3f87c6[_0xf58f('0x3a')][_0xf58f('0x30')])throw new Error('Service\x20parameter\x20not\x20specified');var _0xaffc3f=db[_0xf58f('0x37')][_0xf58f('0x1a')]['service'][_0xf58f('0x3b')];if(!_0xaffc3f[_0xf58f('0x3c')](_0x3f87c6[_0xf58f('0x3a')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0xaffc3f[_0xf58f('0x3d')](',\x20'));if(_0x3f87c6[_0xf58f('0x3a')][_0xf58f('0x30')]===_0xf58f('0x31')&&_0x3f87c6[_0xf58f('0x3a')][_0xf58f('0x33')]){_0x3f87c6[_0xf58f('0x3a')][_0xf58f('0x33')]=encryptor[_0xf58f('0x3e')](_0x3f87c6['body'][_0xf58f('0x33')]);}return db[_0xf58f('0x37')][_0xf58f('0x39')](_0x3f87c6[_0xf58f('0x3a')],{})[_0xf58f('0x13')](respondWithResult(_0x5a0ebb,0xc9))[_0xf58f('0x34')](handleError(_0x5a0ebb,null));};exports[_0xf58f('0x3f')]=function(_0x9820f7,_0x56d31b){if(_0x9820f7[_0xf58f('0x3a')]['id']){delete _0x9820f7[_0xf58f('0x3a')]['id'];}return db[_0xf58f('0x37')][_0xf58f('0x38')]({'where':{'id':_0x9820f7[_0xf58f('0x35')]['id']}})[_0xf58f('0x13')](handleEntityNotFound(_0x56d31b,null))[_0xf58f('0x13')](function(_0x8ddfc6){if(_0x8ddfc6[_0xf58f('0x30')]===_0xf58f('0x31')&&_0x9820f7[_0xf58f('0x3a')]['data3']){_0x9820f7[_0xf58f('0x3a')][_0xf58f('0x33')]=encryptor[_0xf58f('0x3e')](_0x9820f7[_0xf58f('0x3a')]['data3']);}return _0x8ddfc6;})['then'](saveUpdates(_0x9820f7[_0xf58f('0x3a')],null))[_0xf58f('0x13')](respondWithResult(_0x56d31b,null))[_0xf58f('0x34')](handleError(_0x56d31b,null));};exports[_0xf58f('0x14')]=function(_0x180821,_0x11da48){return db['CloudProvider'][_0xf58f('0x38')]({'where':{'id':_0x180821[_0xf58f('0x35')]['id']}})[_0xf58f('0x13')](handleEntityNotFound(_0x11da48,null))[_0xf58f('0x13')](removeEntity(_0x11da48,null))[_0xf58f('0x34')](handleError(_0x11da48,null));};exports[_0xf58f('0x40')]=function(_0x46df21,_0x3a03f0){return db['CloudProvider'][_0xf58f('0x41')]({'where':{'id':_0x46df21[_0xf58f('0x35')]['id']},'raw':!![]})['then'](function(_0x278661){if(!_0x278661)return _0x3a03f0[_0xf58f('0xa')](0x194);return{'url':oauth[_0xf58f('0x42')](_0x278661,_0x46df21['user']['id'])};})['then'](respondWithResult(_0x3a03f0,null))['catch'](handleError(_0x3a03f0,null));};exports[_0xf58f('0x43')]=function(_0xb64737,_0x5884fb){var _0x2412f2=_0xb64737[_0xf58f('0x3a')];var _0x30cc38;var _0x3597b2;if(_0x2412f2[_0xf58f('0x15')])throw _0x2412f2;redis[_0xf58f('0x44')](_0x2412f2[_0xf58f('0x45')])['then'](function(_0x44756f){if(!_0x44756f)throw new Error(_0xf58f('0x46'));_0x30cc38=JSON[_0xf58f('0x47')](_0x44756f);var _0xc199a5=Buffer[_0xf58f('0x48')](_0x2412f2['state'],_0xf58f('0x49'))[_0xf58f('0x4a')]('ascii');_0x3597b2=JSON[_0xf58f('0x47')](_0xc199a5);if(!oauth[_0xf58f('0x4b')](_0x2412f2['id_token'],_0x30cc38[_0xf58f('0x4c')]))throw new Error(_0xf58f('0x4d'));redis[_0xf58f('0x4e')](_0x2412f2[_0xf58f('0x45')]);return oauth[_0xf58f('0x4f')](_0x2412f2[_0xf58f('0x50')],_0x30cc38);})[_0xf58f('0x13')](function(_0xcd5a64){_0x30cc38['data5']=_0xcd5a64[_0xf58f('0x51')];_0x30cc38[_0xf58f('0x52')]=_0xcd5a64[_0xf58f('0x53')];return db['CloudProvider']['update']({'data5':_0x30cc38[_0xf58f('0x54')],'data6':_0x30cc38[_0xf58f('0x52')]},{'where':{'id':_0x30cc38['id']}});})[_0xf58f('0x13')](function(){oauth[_0xf58f('0x55')](_0x30cc38);socket[_0xf58f('0x56')](_0xf58f('0x57'),{'id':_0x3597b2['id']});return;})[_0xf58f('0x13')](respondWithStatusCode(_0x5884fb,null))[_0xf58f('0x34')](function(_0xc7ff69){if(_0x3597b2){socket[_0xf58f('0x56')](_0xf58f('0x58'),{'id':_0x3597b2['id']});}if(!_0x30cc38){logger[_0xf58f('0x15')](_0xf58f('0x59'),_0xc7ff69);return _0x5884fb[_0xf58f('0xb')](0x1f4)['send'](_0xc7ff69['message']);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x30cc38['id'],JSON[_0xf58f('0x5a')](_0xc7ff69));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 9d5d0ff..1f977d2 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 _0x6bef=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash'];(function(_0x1186cb,_0x488e8b){var _0x4500b6=function(_0x2629ae){while(--_0x2629ae){_0x1186cb['push'](_0x1186cb['shift']());}};_0x4500b6(++_0x488e8b);}(_0x6bef,0x158));var _0xf6be=function(_0x272307,_0x34935f){_0x272307=_0x272307-0x0;var _0x279aa2=_0x6bef[_0x272307];return _0x279aa2;};'use strict';var _=require(_0xf6be('0x0'));var util=require(_0xf6be('0x1'));var logger=require(_0xf6be('0x2'))(_0xf6be('0x3'));var moment=require(_0xf6be('0x4'));var BPromise=require(_0xf6be('0x5'));var rp=require(_0xf6be('0x6'));var fs=require('fs');var path=require(_0xf6be('0x7'));var rimraf=require(_0xf6be('0x8'));var config=require(_0xf6be('0x9'));var attributes=require(_0xf6be('0xa'));module[_0xf6be('0xb')]=function(_0x10a7a3,_0x3b5540){return _0x10a7a3[_0xf6be('0xc')](_0xf6be('0xd'),attributes,{'tableName':_0xf6be('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9d18=['request-promise','path','../../config/environment','exports','define','CloudProvider','lodash','util','api','moment'];(function(_0x3bcc49,_0xd32f5){var _0x622a6=function(_0x41cfd5){while(--_0x41cfd5){_0x3bcc49['push'](_0x3bcc49['shift']());}};_0x622a6(++_0xd32f5);}(_0x9d18,0x150));var _0x89d1=function(_0x5305dc,_0x3a0acc){_0x5305dc=_0x5305dc-0x0;var _0x47b203=_0x9d18[_0x5305dc];return _0x47b203;};'use strict';var _=require(_0x89d1('0x0'));var util=require(_0x89d1('0x1'));var logger=require('../../config/logger')(_0x89d1('0x2'));var moment=require(_0x89d1('0x3'));var BPromise=require('bluebird');var rp=require(_0x89d1('0x4'));var fs=require('fs');var path=require(_0x89d1('0x5'));var rimraf=require('rimraf');var config=require(_0x89d1('0x6'));var attributes=require('./cloudProvider.attributes');module[_0x89d1('0x7')]=function(_0x13d5a3,_0x28ff5f){return _0x13d5a3[_0x89d1('0x8')](_0x89d1('0x9'),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 4193f4c..902f885 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 _0xe4ea=['openid','offline_access','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','replace','{TENANT_ID}','code','base64','randomBytes','toString','client_id','data1','data4','response_mode','scope','nonce','key','value','oauth2/','set','stringify','decode','issuer','aud','audience','isAfter','unix','exp','then','CloudProvider','data6','decryptString','data2','access_token','refresh_token','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data3','POST','intervals','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','https://outlook.office.com/POP.AccessAsUser.All'];(function(_0x584b1a,_0x5b4d87){var _0x1a72aa=function(_0x20d216){while(--_0x20d216){_0x584b1a['push'](_0x584b1a['shift']());}};_0x1a72aa(++_0x5b4d87);}(_0xe4ea,0x14e));var _0xae4e=function(_0x21c43f,_0x188b41){_0x21c43f=_0x21c43f-0x0;var _0x3d146a=_0xe4ea[_0x21c43f];return _0x3d146a;};'use strict';var _=require(_0xae4e('0x0'));var crypto=require('crypto');var jwt=require(_0xae4e('0x1'));var moment=require(_0xae4e('0x2'));var Redis=require(_0xae4e('0x3'));var rp=require('request-promise');var util=require(_0xae4e('0x4'));var encryptor=require(_0xae4e('0x5'));var config=require(_0xae4e('0x6'));var logger=require(_0xae4e('0x7'))(_0xae4e('0x8'));var schedule=require(_0xae4e('0x9'));var db=require('../../mysqldb')['db'];config[_0xae4e('0xa')]=_[_0xae4e('0xb')](config[_0xae4e('0xa')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xae4e('0xa')]);var MICROSOFT_AUTH_URL=_0xae4e('0xc');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xae4e('0xd'),_0xae4e('0xe'),'offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All',_0xae4e('0xf'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xae4e('0x10'),_0xae4e('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0xae4e('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xae4e('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4198d4){var _0x1ba975=_[_0xae4e('0x14')](AZURE_AUTH_SCOPES[_0x4198d4[_0xae4e('0x15')]]);if(_0x4198d4[_0xae4e('0x15')]===_0xae4e('0x16'))_0x1ba975[_0xae4e('0x17')](_0x4198d4[_0xae4e('0x18')]+_0xae4e('0x19'));return _0x1ba975[_0xae4e('0x1a')]('\x20');}function getAccessTokenScope(_0x5620c0){if(_0x5620c0['type']==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x5620c0['type']===_0xae4e('0x16'))return _0x5620c0[_0xae4e('0x18')]+_0xae4e('0x19');}function generateMicrosoftAuthorizationUrl(_0x1220a4,_0x4b977f){var _0x21264c=MICROSOFT_AUTH_URL[_0xae4e('0x1b')](_0xae4e('0x1c'),_0x1220a4['data2']);var _0x271138=[_0xae4e('0x1d'),'id_token'];var _0x17cea8=Buffer['from'](JSON['stringify']({'id':_0x4b977f}))['toString'](_0xae4e('0x1e'));var _0x3aaaa7=crypto[_0xae4e('0x1f')](0x10)[_0xae4e('0x20')]('hex');var _0x4ac3c7=getAuthorizationScopes(_0x1220a4);var _0x5b90c1=[{'key':_0xae4e('0x21'),'value':_0x1220a4[_0xae4e('0x22')]},{'key':'response_type','value':encodeURIComponent(_0x271138['join']('\x20'))},{'key':'redirect_uri','value':_0x1220a4[_0xae4e('0x23')]},{'key':_0xae4e('0x24'),'value':'form_post'},{'key':_0xae4e('0x25'),'value':encodeURIComponent(_0x4ac3c7)},{'key':'state','value':_0x17cea8},{'key':_0xae4e('0x26'),'value':_0x3aaaa7},{'key':'prompt','value':'login'}];var _0x5bcfe6=_0x21264c+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xae4e('0x14')](_0x5b90c1,function(_0x3a6ee3){return _0x3a6ee3[_0xae4e('0x27')]+'='+_0x3a6ee3[_0xae4e('0x28')];})[_0xae4e('0x1a')]('&');_0x1220a4['oauth2Claims']={'issuer':_0x21264c[_0xae4e('0x1b')](_0xae4e('0x29'),''),'audience':_0x1220a4[_0xae4e('0x22')],'state':_0x17cea8,'nonce':_0x3aaaa7};redis[_0xae4e('0x2a')](_0x17cea8,JSON[_0xae4e('0x2b')](_0x1220a4));return _0x5bcfe6;}function isValidIdToken(_0x2a1357,_0x309821){try{var _0x1483c2=jwt[_0xae4e('0x2c')](_0x2a1357,{'complete':!![]});var _0x5b0504=_0x1483c2['payload'];if(_0x5b0504['iss']!==_0x309821[_0xae4e('0x2d')])return![];if(_0x5b0504[_0xae4e('0x2e')]!==_0x309821[_0xae4e('0x2f')])return![];if(_0x5b0504[_0xae4e('0x26')]!==_0x309821[_0xae4e('0x26')])return![];if(moment()[_0xae4e('0x30')](moment[_0xae4e('0x31')](_0x5b0504[_0xae4e('0x32')])))return![];return!![];}catch(_0xa67abb){throw _0xa67abb;}}function refreshOauth2MicrosoftAccessToken(_0x4d1f45){return Promise['resolve']()[_0xae4e('0x33')](function(){if(_0x4d1f45['data3'])return _0x4d1f45;return db[_0xae4e('0x34')]['findOne']({'where':{'id':_0x4d1f45['id']},'raw':!![]});})['then'](function(_0x56f646){var _0x32b83b={'grant_type':'refresh_token','refresh_token':_0x56f646[_0xae4e('0x35')],'scope':getAccessTokenScope(_0x56f646),'redirect_uri':_0x56f646[_0xae4e('0x23')],'client_id':_0x56f646[_0xae4e('0x22')],'client_secret':encryptor[_0xae4e('0x36')](_0x56f646['data3'])};var _0x3e721d={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xae4e('0x1b')](_0xae4e('0x1c'),_0x56f646[_0xae4e('0x37')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x32b83b,'json':!![]};return rp(_0x3e721d);})[_0xae4e('0x33')](function(_0x1c1287){_0x4d1f45['data5']=_0x1c1287[_0xae4e('0x38')];_0x4d1f45[_0xae4e('0x35')]=_0x1c1287[_0xae4e('0x39')];return db[_0xae4e('0x34')]['update']({'data5':_0x4d1f45[_0xae4e('0x3a')],'data6':_0x4d1f45['data6']},{'where':{'id':_0x4d1f45['id']}});})[_0xae4e('0x33')](function(){return _0x4d1f45;})[_0xae4e('0x3b')](function(_0x585099){logger[_0xae4e('0x3c')](_0xae4e('0x3d'),_0x4d1f45['id'],_0x585099);});}function getOauth2MicrosoftAccessToken(_0x289181,_0x2dc51f){var _0x4f9588={'grant_type':_0xae4e('0x3e'),'code':_0x289181,'scope':getAccessTokenScope(_0x2dc51f),'redirect_uri':_0x2dc51f[_0xae4e('0x23')],'client_id':_0x2dc51f[_0xae4e('0x22')],'client_secret':encryptor[_0xae4e('0x36')](_0x2dc51f[_0xae4e('0x3f')])};var _0x3e873f={'method':_0xae4e('0x40'),'uri':MICROSOFT_AUTH_URL[_0xae4e('0x1b')](_0xae4e('0x1c'),_0x2dc51f[_0xae4e('0x37')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4f9588,'json':!![]};return rp(_0x3e873f);}function startRefreshInterval(_0x5a8ff0){var _0x3d77a8=schedule[_0xae4e('0x41')];if(_0x3d77a8[_0x5a8ff0['id']])clearInterval(_0x3d77a8[_0x5a8ff0['id']]);_0x3d77a8[_0x5a8ff0['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x5a8ff0['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xae4e('0x41')]=_0x3d77a8;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xae4e('0x42')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xae4e('0x33')](function(_0x4d27e4){var _0x4e3a24=_0x4d27e4['map'](function(_0x316afa){return refreshOauth2MicrosoftAccessToken(_0x316afa)['then'](function(_0x18ee79){startRefreshInterval(_0x18ee79);});});return Promise[_0xae4e('0x43')](_0x4e3a24);})[_0xae4e('0x3b')](function(_0x3ea1ab){var _0x5a3bed=_0x3ea1ab?util['inspect'](_0x3ea1ab,{'showHidden':![],'depth':null}):'';logger[_0xae4e('0x3c')](_0xae4e('0x44'),_0x5a3bed);});}module[_0xae4e('0x45')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xd147=['randomBytes','hex','client_id','data1','response_type','data4','response_mode','state','nonce','prompt','key','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud','audience','exp','resolve','then','data3','CloudProvider','findOne','POST','refresh_token','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','{TENANT_ID}','intervals','findAll','all','inspect','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','data2','stringify','toString'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd147,0x1d1));var _0x7d14=function(_0x20b770,_0x2c2fbb){_0x20b770=_0x20b770-0x0;var _0x4460ff=_0xd147[_0x20b770];return _0x4460ff;};'use strict';var _=require('lodash');var crypto=require(_0x7d14('0x0'));var jwt=require(_0x7d14('0x1'));var moment=require(_0x7d14('0x2'));var Redis=require(_0x7d14('0x3'));var rp=require(_0x7d14('0x4'));var util=require(_0x7d14('0x5'));var encryptor=require(_0x7d14('0x6'));var config=require('../../config/environment');var logger=require(_0x7d14('0x7'))('api');var schedule=require(_0x7d14('0x8'));var db=require(_0x7d14('0x9'))['db'];config[_0x7d14('0xa')]=_['defaults'](config[_0x7d14('0xa')],{'host':_0x7d14('0xb'),'port':0x18eb});var redis=new Redis(config[_0x7d14('0xa')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x7d14('0xc'),_0x7d14('0xd'),_0x7d14('0xe'),_0x7d14('0xf'),_0x7d14('0x10'),_0x7d14('0x11'),_0x7d14('0x12')],'Dynamics365':[_0x7d14('0xc'),_0x7d14('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x7d14('0x13');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x30f204){var _0x3c3390=_[_0x7d14('0x14')](AZURE_AUTH_SCOPES[_0x30f204[_0x7d14('0x15')]]);if(_0x30f204['type']===_0x7d14('0x16'))_0x3c3390[_0x7d14('0x17')](_0x30f204[_0x7d14('0x18')]+_0x7d14('0x19'));return _0x3c3390[_0x7d14('0x1a')]('\x20');}function getAccessTokenScope(_0x2c31f9){if(_0x2c31f9['type']===_0x7d14('0x1b'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x2c31f9[_0x7d14('0x15')]==='Dynamics365')return _0x2c31f9[_0x7d14('0x18')]+_0x7d14('0x19');}function generateMicrosoftAuthorizationUrl(_0x278c25,_0x68be57){var _0x43ff89=MICROSOFT_AUTH_URL[_0x7d14('0x1c')]('{TENANT_ID}',_0x278c25[_0x7d14('0x1d')]);var _0x29e6ed=['code','id_token'];var _0x526b1c=Buffer['from'](JSON[_0x7d14('0x1e')]({'id':_0x68be57}))[_0x7d14('0x1f')]('base64');var _0x5523ed=crypto[_0x7d14('0x20')](0x10)[_0x7d14('0x1f')](_0x7d14('0x21'));var _0x257680=getAuthorizationScopes(_0x278c25);var _0x535ef3=[{'key':_0x7d14('0x22'),'value':_0x278c25[_0x7d14('0x23')]},{'key':_0x7d14('0x24'),'value':encodeURIComponent(_0x29e6ed[_0x7d14('0x1a')]('\x20'))},{'key':'redirect_uri','value':_0x278c25[_0x7d14('0x25')]},{'key':_0x7d14('0x26'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x257680)},{'key':_0x7d14('0x27'),'value':_0x526b1c},{'key':_0x7d14('0x28'),'value':_0x5523ed},{'key':_0x7d14('0x29'),'value':'login'}];var _0x35af6f=_0x43ff89+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x535ef3,function(_0x26a6e6){return _0x26a6e6[_0x7d14('0x2a')]+'='+_0x26a6e6[_0x7d14('0x2b')];})[_0x7d14('0x1a')]('&');_0x278c25[_0x7d14('0x2c')]={'issuer':_0x43ff89[_0x7d14('0x1c')](_0x7d14('0x2d'),''),'audience':_0x278c25[_0x7d14('0x23')],'state':_0x526b1c,'nonce':_0x5523ed};redis[_0x7d14('0x2e')](_0x526b1c,JSON[_0x7d14('0x1e')](_0x278c25));return _0x35af6f;}function isValidIdToken(_0x3c38f7,_0x5969b1){try{var _0x380f24=jwt[_0x7d14('0x2f')](_0x3c38f7,{'complete':!![]});var _0xb8241c=_0x380f24[_0x7d14('0x30')];if(_0xb8241c[_0x7d14('0x31')]!==_0x5969b1[_0x7d14('0x32')])return![];if(_0xb8241c[_0x7d14('0x33')]!==_0x5969b1[_0x7d14('0x34')])return![];if(_0xb8241c[_0x7d14('0x28')]!==_0x5969b1[_0x7d14('0x28')])return![];if(moment()['isAfter'](moment['unix'](_0xb8241c[_0x7d14('0x35')])))return![];return!![];}catch(_0xb0658f){throw _0xb0658f;}}function refreshOauth2MicrosoftAccessToken(_0x3e2fa5){return Promise[_0x7d14('0x36')]()[_0x7d14('0x37')](function(){if(_0x3e2fa5[_0x7d14('0x38')])return _0x3e2fa5;return db[_0x7d14('0x39')][_0x7d14('0x3a')]({'where':{'id':_0x3e2fa5['id']},'raw':!![]});})[_0x7d14('0x37')](function(_0x1b5790){var _0x2b3cd9={'grant_type':'refresh_token','refresh_token':_0x1b5790['data6'],'scope':getAccessTokenScope(_0x1b5790),'redirect_uri':_0x1b5790['data4'],'client_id':_0x1b5790[_0x7d14('0x23')],'client_secret':encryptor['decryptString'](_0x1b5790['data3'])};var _0x257d05={'method':_0x7d14('0x3b'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x1b5790['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2b3cd9,'json':!![]};return rp(_0x257d05);})['then'](function(_0x5113cd){_0x3e2fa5['data5']=_0x5113cd['access_token'];_0x3e2fa5['data6']=_0x5113cd[_0x7d14('0x3c')];return db[_0x7d14('0x39')]['update']({'data5':_0x3e2fa5['data5'],'data6':_0x3e2fa5['data6']},{'where':{'id':_0x3e2fa5['id']}});})['then'](function(){return _0x3e2fa5;})[_0x7d14('0x3d')](function(_0x20e65c){logger[_0x7d14('0x3e')](_0x7d14('0x3f'),_0x3e2fa5['id'],_0x20e65c);});}function getOauth2MicrosoftAccessToken(_0x39bab7,_0x3b7b3a){var _0x48039c={'grant_type':_0x7d14('0x40'),'code':_0x39bab7,'scope':getAccessTokenScope(_0x3b7b3a),'redirect_uri':_0x3b7b3a['data4'],'client_id':_0x3b7b3a[_0x7d14('0x23')],'client_secret':encryptor[_0x7d14('0x41')](_0x3b7b3a[_0x7d14('0x38')])};var _0x68c183={'method':_0x7d14('0x3b'),'uri':MICROSOFT_AUTH_URL[_0x7d14('0x1c')](_0x7d14('0x42'),_0x3b7b3a[_0x7d14('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x48039c,'json':!![]};return rp(_0x68c183);}function startRefreshInterval(_0xc2a214){var _0x12b8b3=schedule[_0x7d14('0x43')];if(_0x12b8b3[_0xc2a214['id']])clearInterval(_0x12b8b3[_0xc2a214['id']]);_0x12b8b3[_0xc2a214['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0xc2a214['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x12b8b3;}function startAllRefreshIntervals(){return db[_0x7d14('0x39')][_0x7d14('0x44')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x7d14('0x37')](function(_0x2021d6){var _0x12d9a6=_0x2021d6[_0x7d14('0x14')](function(_0x25a190){return refreshOauth2MicrosoftAccessToken(_0x25a190)['then'](function(_0x54a622){startRefreshInterval(_0x54a622);});});return Promise[_0x7d14('0x45')](_0x12d9a6);})[_0x7d14('0x3d')](function(_0x3fac06){var _0x3a2b04=_0x3fac06?util[_0x7d14('0x46')](_0x3fac06,{'showHidden':![],'depth':null}):'';logger[_0x7d14('0x3e')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x3a2b04);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 2748c45..3f89940 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 _0x2015=['client','http','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x5c8fc7,_0x571e82){var _0x389dfc=function(_0x830e4b){while(--_0x830e4b){_0x5c8fc7['push'](_0x5c8fc7['shift']());}};_0x389dfc(++_0x571e82);}(_0x2015,0x193));var _0x5201=function(_0x358a1c,_0x2434d4){_0x358a1c=_0x358a1c-0x0;var _0x12e845=_0x2015[_0x358a1c];return _0x12e845;};'use strict';var _=require(_0x5201('0x0'));var util=require(_0x5201('0x1'));var moment=require(_0x5201('0x2'));var BPromise=require(_0x5201('0x3'));var rs=require(_0x5201('0x4'));var fs=require('fs');var Redis=require(_0x5201('0x5'));var db=require(_0x5201('0x6'))['db'];var utils=require(_0x5201('0x7'));var logger=require('../../config/logger')(_0x5201('0x8'));var config=require(_0x5201('0x9'));var jayson=require(_0x5201('0xa'));var client=jayson[_0x5201('0xb')][_0x5201('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11ce7b,_0x334b42,_0x374d23){return new BPromise(function(_0x15367c,_0x6fc2c3){return client['request'](_0x11ce7b,_0x374d23)[_0x5201('0xd')](function(_0x17d8f3){logger['info'](_0x5201('0xe'),_0x334b42,_0x5201('0xf'));logger[_0x5201('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x334b42,_0x5201('0xf'),JSON[_0x5201('0x11')](_0x17d8f3));if(_0x17d8f3[_0x5201('0x12')]){if(_0x17d8f3[_0x5201('0x12')][_0x5201('0x13')]===0x1f4){logger[_0x5201('0x12')](_0x5201('0xe'),_0x334b42,_0x17d8f3[_0x5201('0x12')][_0x5201('0x14')]);return _0x6fc2c3(_0x17d8f3[_0x5201('0x12')][_0x5201('0x14')]);}logger[_0x5201('0x12')]('CloudProvider,\x20%s,\x20%s',_0x334b42,_0x17d8f3[_0x5201('0x12')][_0x5201('0x14')]);return _0x15367c(_0x17d8f3['error']['message']);}else{logger[_0x5201('0x15')](_0x5201('0xe'),_0x334b42,_0x5201('0xf'));_0x15367c(_0x17d8f3['result']['message']);}})[_0x5201('0x16')](function(_0x582210){logger[_0x5201('0x12')]('CloudProvider,\x20%s,\x20%s',_0x334b42,_0x582210);_0x6fc2c3(_0x582210);});});}
\ No newline at end of file
+var _0xf3e2=['rpc','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xf3e2,0x168));var _0x2f3e=function(_0x2f3aa7,_0x2d7ce7){_0x2f3aa7=_0x2f3aa7-0x0;var _0x2c334c=_0xf3e2[_0x2f3aa7];return _0x2c334c;};'use strict';var _=require(_0x2f3e('0x0'));var util=require(_0x2f3e('0x1'));var moment=require(_0x2f3e('0x2'));var BPromise=require(_0x2f3e('0x3'));var rs=require(_0x2f3e('0x4'));var fs=require('fs');var Redis=require(_0x2f3e('0x5'));var db=require(_0x2f3e('0x6'))['db'];var utils=require(_0x2f3e('0x7'));var logger=require('../../config/logger')(_0x2f3e('0x8'));var config=require('../../config/environment');var jayson=require(_0x2f3e('0x9'));var client=jayson[_0x2f3e('0xa')][_0x2f3e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x392f91,_0x3b556b,_0x1ac142){return new BPromise(function(_0x30f939,_0x46ec1b){return client['request'](_0x392f91,_0x1ac142)[_0x2f3e('0xc')](function(_0x4d7f7d){logger[_0x2f3e('0xd')](_0x2f3e('0xe'),_0x3b556b,_0x2f3e('0xf'));logger[_0x2f3e('0x10')](_0x2f3e('0x11'),_0x3b556b,_0x2f3e('0xf'),JSON[_0x2f3e('0x12')](_0x4d7f7d));if(_0x4d7f7d[_0x2f3e('0x13')]){if(_0x4d7f7d[_0x2f3e('0x13')][_0x2f3e('0x14')]===0x1f4){logger[_0x2f3e('0x13')](_0x2f3e('0xe'),_0x3b556b,_0x4d7f7d['error'][_0x2f3e('0x15')]);return _0x46ec1b(_0x4d7f7d['error'][_0x2f3e('0x15')]);}logger[_0x2f3e('0x13')]('CloudProvider,\x20%s,\x20%s',_0x3b556b,_0x4d7f7d['error'][_0x2f3e('0x15')]);return _0x30f939(_0x4d7f7d[_0x2f3e('0x13')][_0x2f3e('0x15')]);}else{logger[_0x2f3e('0xd')](_0x2f3e('0xe'),_0x3b556b,_0x2f3e('0xf'));_0x30f939(_0x4d7f7d['result'][_0x2f3e('0x15')]);}})[_0x2f3e('0x16')](function(_0x15398d){logger[_0x2f3e('0x13')]('CloudProvider,\x20%s,\x20%s',_0x3b556b,_0x15398d);_0x46ec1b(_0x15398d);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 2ec8df6..21a043d 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 _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x4b2716,_0x50e907){var _0x58ef2f=function(_0x3c15de){while(--_0x3c15de){_0x4b2716['push'](_0x4b2716['shift']());}};_0x58ef2f(++_0x50e907);}(_0x2ef3,0xba));var _0x32ef=function(_0x9cf372,_0x20736a){_0x9cf372=_0x9cf372-0x0;var _0xd46b2b=_0x2ef3[_0x9cf372];return _0xd46b2b;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
+var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x5d0273,_0x3fbc92){var _0x461cff=function(_0x571f80){while(--_0x571f80){_0x5d0273['push'](_0x5d0273['shift']());}};_0x461cff(++_0x3fbc92);}(_0xdb28,0x106));var _0x8db2=function(_0x22beff,_0x340efb){_0x22beff=_0x22beff-0x0;var _0x40f153=_0xdb28[_0x22beff];return _0x40f153;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 85ca962..384262f 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 _0xd2df=['STRING','name','sequelize','exports'];(function(_0x5a8fad,_0x3feb4f){var _0x2791d8=function(_0x2987c6){while(--_0x2987c6){_0x5a8fad['push'](_0x5a8fad['shift']());}};_0x2791d8(++_0x3feb4f);}(_0xd2df,0x1ea));var _0xfd2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2df[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xfd2d('0x0'));module[_0xfd2d('0x1')]={'name':{'type':Sequelize[_0xfd2d('0x2')],'unique':_0xfd2d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xfd2d('0x2')]},'companyId':{'type':Sequelize[_0xfd2d('0x2')]},'website':{'type':Sequelize[_0xfd2d('0x2')]},'phone':{'type':Sequelize[_0xfd2d('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xfd2d('0x2')]},'street':{'type':Sequelize[_0xfd2d('0x2')]},'postalCode':{'type':Sequelize[_0xfd2d('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xfd2d('0x2')]},'email':{'type':Sequelize[_0xfd2d('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xfd2d('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xfd2d('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xfd2d('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2e61=['exports','STRING','name','sequelize'];(function(_0xee1ec9,_0x2f0599){var _0x102a53=function(_0x4e5f7f){while(--_0x4e5f7f){_0xee1ec9['push'](_0xee1ec9['shift']());}};_0x102a53(++_0x2f0599);}(_0x2e61,0x11b));var _0x12e6=function(_0x2f39fe,_0x2b88e7){_0x2f39fe=_0x2f39fe-0x0;var _0x32bfce=_0x2e61[_0x2f39fe];return _0x32bfce;};'use strict';var Sequelize=require(_0x12e6('0x0'));module[_0x12e6('0x1')]={'name':{'type':Sequelize[_0x12e6('0x2')],'unique':_0x12e6('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x12e6('0x2')]},'companyId':{'type':Sequelize[_0x12e6('0x2')]},'website':{'type':Sequelize[_0x12e6('0x2')]},'phone':{'type':Sequelize[_0x12e6('0x2')]},'fax':{'type':Sequelize[_0x12e6('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x12e6('0x2')]},'postalCode':{'type':Sequelize[_0x12e6('0x2')]},'city':{'type':Sequelize[_0x12e6('0x2')]},'country':{'type':Sequelize[_0x12e6('0x2')]},'email':{'type':Sequelize[_0x12e6('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x12e6('0x2')]},'sStreet':{'type':Sequelize[_0x12e6('0x2')]},'sPostalCode':{'type':Sequelize[_0x12e6('0x2')]},'sCity':{'type':Sequelize[_0x12e6('0x2')]},'sCountry':{'type':Sequelize[_0x12e6('0x2')]},'description':{'type':Sequelize[_0x12e6('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index ce3630b..ec68851 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 _0x29ef=['UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','pick','filters','filter','merge','map','options','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Companies'];(function(_0xdd0288,_0x548640){var _0x40cf11=function(_0x56bf3f){while(--_0x56bf3f){_0xdd0288['push'](_0xdd0288['shift']());}};_0x40cf11(++_0x548640);}(_0x29ef,0xb4));var _0xf29e=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x29ef[_0x525c7b];return _0x27b33e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf29e('0x0'));var jsonpatch=require(_0xf29e('0x1'));var rp=require(_0xf29e('0x2'));var moment=require(_0xf29e('0x3'));var BPromise=require(_0xf29e('0x4'));var Mustache=require(_0xf29e('0x5'));var util=require(_0xf29e('0x6'));var path=require(_0xf29e('0x7'));var sox=require(_0xf29e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf29e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf29e('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xf29e('0xb'));var querystring=require(_0xf29e('0xc'));var Papa=require('papaparse');var Redis=require(_0xf29e('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xf29e('0xe'));var as=require(_0xf29e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf29e('0x10'))(_0xf29e('0x11'));var utils=require(_0xf29e('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf29e('0x13'))['db'];function respondWithStatusCode(_0x249e64,_0x3ee795){_0x3ee795=_0x3ee795||0xcc;return function(_0x5298bf){if(_0x5298bf){return _0x249e64['sendStatus'](_0x3ee795);}return _0x249e64['status'](_0x3ee795)[_0xf29e('0x14')]();};}function respondWithResult(_0x550b17,_0x1ff2f7){_0x1ff2f7=_0x1ff2f7||0xc8;return function(_0x27e1c9){if(_0x27e1c9){return _0x550b17[_0xf29e('0x15')](_0x1ff2f7)['json'](_0x27e1c9);}};}function respondWithFilteredResult(_0x3b90b3,_0x104710){return function(_0x7effb){if(_0x7effb){var _0x282d32=typeof _0x104710[_0xf29e('0x16')]==='undefined'&&typeof _0x104710[_0xf29e('0x17')]===_0xf29e('0x18');var _0x4861a8=_0x7effb[_0xf29e('0x19')];var _0x477006=_0x282d32?0x0:_0x104710[_0xf29e('0x16')];var _0x18b393=_0x282d32?_0x7effb[_0xf29e('0x19')]:_0x104710[_0xf29e('0x16')]+_0x104710[_0xf29e('0x17')];var _0x2bfde9;if(_0x18b393>=_0x4861a8){_0x18b393=_0x4861a8;_0x2bfde9=0xc8;}else{_0x2bfde9=0xce;}_0x3b90b3[_0xf29e('0x15')](_0x2bfde9);return _0x3b90b3[_0xf29e('0x1a')](_0xf29e('0x1b'),_0x477006+'-'+_0x18b393+'/'+_0x4861a8)[_0xf29e('0x1c')](_0x7effb);}return null;};}function patchUpdates(_0x5d07c2){return function(_0x3eafaf){try{jsonpatch[_0xf29e('0x1d')](_0x3eafaf,_0x5d07c2,!![]);}catch(_0x28e94d){return BPromise['reject'](_0x28e94d);}return _0x3eafaf[_0xf29e('0x1e')]();};}function saveUpdates(_0x2c24df,_0x551fcf){return function(_0x5a1b25){if(_0x5a1b25){return _0x5a1b25[_0xf29e('0x1f')](_0x2c24df)[_0xf29e('0x20')](function(_0x502732){return _0x502732;});}return null;};}function removeEntity(_0x2891bc,_0x1d8187){return function(_0x1b1b8c){if(_0x1b1b8c){return _0x1b1b8c[_0xf29e('0x21')]()[_0xf29e('0x20')](function(){var _0x22938d=_0x1b1b8c[_0xf29e('0x22')]({'plain':!![]});var _0x58b573='Companies';return db[_0xf29e('0x23')][_0xf29e('0x21')]({'where':{'type':_0x58b573,'resourceId':_0x22938d['id']}})[_0xf29e('0x20')](function(){return _0x1b1b8c;});})[_0xf29e('0x20')](function(){_0x2891bc[_0xf29e('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22e63e,_0x3d501d){return function(_0x495c5b){if(!_0x495c5b){_0x22e63e[_0xf29e('0x24')](0x194);}return _0x495c5b;};}function handleError(_0x210598,_0x16c441){_0x16c441=_0x16c441||0x1f4;return function(_0x39cc99){logger['error'](_0x39cc99[_0xf29e('0x25')]);if(_0x39cc99[_0xf29e('0x26')]){delete _0x39cc99['name'];}_0x210598[_0xf29e('0x15')](_0x16c441)[_0xf29e('0x27')](_0x39cc99);};}exports[_0xf29e('0x28')]=function(_0x5da270,_0x495885){var _0x509183={},_0x5bc602={},_0x4325c7={'count':0x0,'rows':[]};return db[_0xf29e('0x29')][_0xf29e('0x2a')]()[_0xf29e('0x20')](function(_0x67cb31){_0x5bc602[_0xf29e('0x2b')]=_[_0xf29e('0x2c')](_0x67cb31);_0x5bc602[_0xf29e('0x2d')]=_['keys'](_0x5da270[_0xf29e('0x2d')]);_0x5bc602['filters']=_[_0xf29e('0x2e')](_0x5bc602[_0xf29e('0x2b')],_0x5bc602['query']);_0x509183[_0xf29e('0x2f')]=_[_0xf29e('0x2e')](_0x5bc602[_0xf29e('0x2b')],qs[_0xf29e('0x30')](_0x5da270[_0xf29e('0x2d')]['fields']));_0x509183[_0xf29e('0x2f')]=_0x509183['attributes']['length']?_0x509183[_0xf29e('0x2f')]:_0x5bc602[_0xf29e('0x2b')];if(!_0x5da270[_0xf29e('0x2d')]['hasOwnProperty'](_0xf29e('0x31'))){_0x509183['limit']=qs[_0xf29e('0x17')](_0x5da270['query']['limit']);_0x509183[_0xf29e('0x16')]=qs[_0xf29e('0x16')](_0x5da270[_0xf29e('0x2d')]['offset']);}_0x509183[_0xf29e('0x32')]=qs[_0xf29e('0x33')](_0x5da270[_0xf29e('0x2d')][_0xf29e('0x33')]);_0x509183[_0xf29e('0x34')]=qs['filters'](_[_0xf29e('0x35')](_0x5da270[_0xf29e('0x2d')],_0x5bc602[_0xf29e('0x36')]),_0x67cb31);if(_0x5da270[_0xf29e('0x2d')][_0xf29e('0x37')]){_0x509183[_0xf29e('0x34')]=_[_0xf29e('0x38')](_0x509183[_0xf29e('0x34')],{'$or':_[_0xf29e('0x39')](_0x509183[_0xf29e('0x2f')],function(_0x1c10b9){var _0x3e0932={};_0x3e0932[_0x1c10b9]={'$like':'%'+_0x5da270[_0xf29e('0x2d')]['filter']+'%'};return _0x3e0932;})});}_0x509183=_[_0xf29e('0x38')]({},_0x509183,_0x5da270[_0xf29e('0x3a')]);var _0x5d95d4={'where':_0x509183['where']};return db[_0xf29e('0x29')]['count'](_0x5d95d4)[_0xf29e('0x20')](function(_0xb1c458){_0x4325c7[_0xf29e('0x19')]=_0xb1c458;if(_0x5da270[_0xf29e('0x2d')]['includeAll']){_0x509183['include']=[{'all':!![]}];}return db[_0xf29e('0x29')][_0xf29e('0x3b')](_0x509183);})[_0xf29e('0x20')](function(_0x52e07c){_0x4325c7[_0xf29e('0x3c')]=_0x52e07c;return _0x4325c7;})[_0xf29e('0x20')](respondWithFilteredResult(_0x495885,_0x509183))[_0xf29e('0x3d')](handleError(_0x495885,null));})['catch'](handleError(_0x495885,null));};exports[_0xf29e('0x3e')]=function(_0x289c96,_0x402788){var _0x4a1155={'raw':![],'where':{'id':_0x289c96[_0xf29e('0x3f')]['id']}},_0x3e8053={};_0x3e8053[_0xf29e('0x2b')]=_[_0xf29e('0x2c')](db[_0xf29e('0x29')][_0xf29e('0x40')]);_0x3e8053[_0xf29e('0x2d')]=_['keys'](_0x289c96['query']);_0x3e8053['filters']=_[_0xf29e('0x2e')](_0x3e8053['model'],_0x3e8053[_0xf29e('0x2d')]);_0x4a1155[_0xf29e('0x2f')]=_[_0xf29e('0x2e')](_0x3e8053[_0xf29e('0x2b')],qs[_0xf29e('0x30')](_0x289c96[_0xf29e('0x2d')][_0xf29e('0x30')]));_0x4a1155[_0xf29e('0x2f')]=_0x4a1155[_0xf29e('0x2f')][_0xf29e('0x41')]?_0x4a1155[_0xf29e('0x2f')]:_0x3e8053[_0xf29e('0x2b')];if(_0x289c96[_0xf29e('0x2d')][_0xf29e('0x42')]){_0x4a1155[_0xf29e('0x43')]=[{'all':!![]}];}_0x4a1155=_['merge']({},_0x4a1155,_0x289c96[_0xf29e('0x3a')]);return db['CmCompany']['find'](_0x4a1155)[_0xf29e('0x20')](handleEntityNotFound(_0x402788,null))[_0xf29e('0x20')](respondWithResult(_0x402788,null))[_0xf29e('0x3d')](handleError(_0x402788,null));};exports['create']=function(_0x26bddd,_0x3c2e81){return db['CmCompany']['create'](_0x26bddd[_0xf29e('0x44')],{})[_0xf29e('0x20')](function(_0x1e8351){var _0x2d1f20=_0x26bddd[_0xf29e('0x45')][_0xf29e('0x22')]({'plain':!![]});if(!_0x2d1f20)throw new Error(_0xf29e('0x46'));if(_0x2d1f20['role']===_0xf29e('0x45')){var _0x50e547=_0x1e8351[_0xf29e('0x22')]({'plain':!![]});var _0x266a43=_0xf29e('0x47');return db[_0xf29e('0x48')][_0xf29e('0x49')]({'where':{'name':_0x266a43,'userProfileId':_0x2d1f20[_0xf29e('0x4a')]},'raw':!![]})['then'](function(_0x41ba59){if(_0x41ba59&&_0x41ba59[_0xf29e('0x4b')]===0x0){return db[_0xf29e('0x23')][_0xf29e('0x4c')]({'name':_0x50e547[_0xf29e('0x26')],'resourceId':_0x50e547['id'],'type':_0x41ba59[_0xf29e('0x26')],'sectionId':_0x41ba59['id']},{})[_0xf29e('0x20')](function(){return _0x1e8351;});}else{return _0x1e8351;}})[_0xf29e('0x3d')](function(_0xe541ad){logger['error'](_0xf29e('0x4d'),_0xe541ad);throw _0xe541ad;});}return _0x1e8351;})['then'](respondWithResult(_0x3c2e81,0xc9))[_0xf29e('0x3d')](handleError(_0x3c2e81,null));};exports[_0xf29e('0x1f')]=function(_0x862657,_0x5d115e){if(_0x862657[_0xf29e('0x44')]['id']){delete _0x862657[_0xf29e('0x44')]['id'];}return db[_0xf29e('0x29')][_0xf29e('0x49')]({'where':{'id':_0x862657[_0xf29e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5d115e,null))[_0xf29e('0x20')](saveUpdates(_0x862657[_0xf29e('0x44')],null))[_0xf29e('0x20')](respondWithResult(_0x5d115e,null))['catch'](handleError(_0x5d115e,null));};exports[_0xf29e('0x21')]=function(_0x4ce492,_0x1a71eb){return db[_0xf29e('0x29')][_0xf29e('0x49')]({'where':{'id':_0x4ce492['params']['id']}})['then'](handleEntityNotFound(_0x1a71eb,null))[_0xf29e('0x20')](removeEntity(_0x1a71eb,null))[_0xf29e('0x3d')](handleError(_0x1a71eb,null));};exports[_0xf29e('0x2a')]=function(_0x2e40f4,_0x53a21c){return db['CmCompany'][_0xf29e('0x2a')]()['then'](respondWithResult(_0x53a21c,null))[_0xf29e('0x3d')](handleError(_0x53a21c,null));};exports[_0xf29e('0x4e')]=function(_0x4f2f42,_0x1d694b,_0x2e74de){return db[_0xf29e('0x4f')][_0xf29e('0x49')]({'where':{'id':_0x4f2f42[_0xf29e('0x3f')]['id']}})[_0xf29e('0x20')](handleEntityNotFound(_0x1d694b,null))['then'](function(_0x3040d2){if(_0x3040d2){return _0x3040d2[_0xf29e('0x4e')](_0x4f2f42[_0xf29e('0x44')][_0xf29e('0x50')],_[_0xf29e('0x51')](_0x4f2f42[_0xf29e('0x44')],['ids','id'])||{});}})[_0xf29e('0x20')](respondWithResult(_0x1d694b,null))[_0xf29e('0x3d')](handleError(_0x1d694b,null));};exports[_0xf29e('0x52')]=function(_0x45cc1e,_0x44ecc1,_0x1ed704){var _0x2789f5={};var _0x368606={};var _0x5e9d9f;var _0x1df646;return db[_0xf29e('0x29')][_0xf29e('0x53')]({'where':{'id':_0x45cc1e[_0xf29e('0x3f')]['id']}})[_0xf29e('0x20')](handleEntityNotFound(_0x44ecc1,null))['then'](function(_0x41aa23){if(_0x41aa23){_0x5e9d9f=_0x41aa23;_0x368606[_0xf29e('0x2b')]=_[_0xf29e('0x2c')](db['CmContact']['rawAttributes']);_0x368606[_0xf29e('0x2d')]=_['keys'](_0x45cc1e['query']);_0x368606[_0xf29e('0x36')]=_[_0xf29e('0x2e')](_0x368606[_0xf29e('0x2b')],_0x368606[_0xf29e('0x2d')]);_0x2789f5['attributes']=_[_0xf29e('0x2e')](_0x368606[_0xf29e('0x2b')],qs[_0xf29e('0x30')](_0x45cc1e[_0xf29e('0x2d')]['fields']));_0x2789f5['attributes']=_0x2789f5[_0xf29e('0x2f')][_0xf29e('0x41')]?_0x2789f5[_0xf29e('0x2f')]:_0x368606[_0xf29e('0x2b')];_0x2789f5[_0xf29e('0x32')]=qs[_0xf29e('0x33')](_0x45cc1e[_0xf29e('0x2d')][_0xf29e('0x33')]);_0x2789f5[_0xf29e('0x34')]=qs[_0xf29e('0x36')](_['pick'](_0x45cc1e[_0xf29e('0x2d')],_0x368606['filters']));if(_0x45cc1e['query']['filter']){_0x2789f5[_0xf29e('0x34')]=_[_0xf29e('0x38')](_0x2789f5[_0xf29e('0x34')],{'$or':_['map'](_0x2789f5[_0xf29e('0x2f')],function(_0x327455){var _0xb767dd={};_0xb767dd[_0x327455]={'$like':'%'+_0x45cc1e[_0xf29e('0x2d')][_0xf29e('0x37')]+'%'};return _0xb767dd;})});}_0x2789f5=_['merge']({},_0x2789f5,_0x45cc1e[_0xf29e('0x3a')]);return _0x5e9d9f[_0xf29e('0x52')](_0x2789f5);}})[_0xf29e('0x20')](function(_0x1e56b3){if(_0x1e56b3){_0x1df646=_0x1e56b3[_0xf29e('0x41')];if(!_0x45cc1e['query']['hasOwnProperty'](_0xf29e('0x31'))){_0x2789f5[_0xf29e('0x17')]=qs[_0xf29e('0x17')](_0x45cc1e[_0xf29e('0x2d')]['limit']);_0x2789f5[_0xf29e('0x16')]=qs[_0xf29e('0x16')](_0x45cc1e['query']['offset']);}return _0x5e9d9f['getContacts'](_0x2789f5);}})[_0xf29e('0x20')](function(_0x1a5027){if(_0x1a5027){return _0x1a5027?{'count':_0x1df646,'rows':_0x1a5027}:null;}})[_0xf29e('0x20')](respondWithResult(_0x44ecc1,null))[_0xf29e('0x3d')](handleError(_0x44ecc1,null));};
\ No newline at end of file
+var _0x77e2=['rawAttributes','intersection','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','CmContact','addContacts','ids','omit','getContacts','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','Companies','UserProfileResource','error','stack','name','index','describe','model','keys','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CmCompany','includeAll','catch','show','params'];(function(_0xc3b9f5,_0x32e40e){var _0x89713=function(_0x5599d6){while(--_0x5599d6){_0xc3b9f5['push'](_0xc3b9f5['shift']());}};_0x89713(++_0x32e40e);}(_0x77e2,0x1b7));var _0x277e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x77e2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x277e('0x0'));var rimraf=require(_0x277e('0x1'));var zipdir=require(_0x277e('0x2'));var jsonpatch=require(_0x277e('0x3'));var rp=require(_0x277e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x277e('0x5'));var util=require(_0x277e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x277e('0x7'));var ejs=require(_0x277e('0x8'));var fs=require('fs');var fs_extra=require(_0x277e('0x9'));var _=require(_0x277e('0xa'));var squel=require(_0x277e('0xb'));var crypto=require(_0x277e('0xc'));var jsforce=require(_0x277e('0xd'));var deskjs=require(_0x277e('0xe'));var toCsv=require(_0x277e('0x7'));var querystring=require(_0x277e('0xf'));var Papa=require(_0x277e('0x10'));var Redis=require(_0x277e('0x11'));var authService=require(_0x277e('0x12'));var qs=require(_0x277e('0x13'));var as=require(_0x277e('0x14'));var hardwareService=require(_0x277e('0x15'));var logger=require(_0x277e('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46755e,_0x58be48){_0x58be48=_0x58be48||0xcc;return function(_0x3db6d8){if(_0x3db6d8){return _0x46755e[_0x277e('0x17')](_0x58be48);}return _0x46755e[_0x277e('0x18')](_0x58be48)[_0x277e('0x19')]();};}function respondWithResult(_0x4bad81,_0x326b90){_0x326b90=_0x326b90||0xc8;return function(_0x2c1102){if(_0x2c1102){return _0x4bad81[_0x277e('0x18')](_0x326b90)[_0x277e('0x1a')](_0x2c1102);}};}function respondWithFilteredResult(_0x178ba7,_0x5903c6){return function(_0x3f7500){if(_0x3f7500){var _0x2dca34=typeof _0x5903c6[_0x277e('0x1b')]==='undefined'&&typeof _0x5903c6[_0x277e('0x1c')]===_0x277e('0x1d');var _0x15ba88=_0x3f7500[_0x277e('0x1e')];var _0x115af7=_0x2dca34?0x0:_0x5903c6[_0x277e('0x1b')];var _0x5d7f1d=_0x2dca34?_0x3f7500[_0x277e('0x1e')]:_0x5903c6[_0x277e('0x1b')]+_0x5903c6[_0x277e('0x1c')];var _0xbadce6;if(_0x5d7f1d>=_0x15ba88){_0x5d7f1d=_0x15ba88;_0xbadce6=0xc8;}else{_0xbadce6=0xce;}_0x178ba7[_0x277e('0x18')](_0xbadce6);return _0x178ba7[_0x277e('0x1f')](_0x277e('0x20'),_0x115af7+'-'+_0x5d7f1d+'/'+_0x15ba88)['json'](_0x3f7500);}return null;};}function patchUpdates(_0x38fdf0){return function(_0x4064e9){try{jsonpatch[_0x277e('0x21')](_0x4064e9,_0x38fdf0,!![]);}catch(_0x4374f1){return BPromise[_0x277e('0x22')](_0x4374f1);}return _0x4064e9[_0x277e('0x23')]();};}function saveUpdates(_0x3142e1,_0x20df10){return function(_0xb5c2e1){if(_0xb5c2e1){return _0xb5c2e1['update'](_0x3142e1)[_0x277e('0x24')](function(_0x200498){return _0x200498;});}return null;};}function removeEntity(_0x4e0232,_0x17b0ad){return function(_0x25d42f){if(_0x25d42f){return _0x25d42f[_0x277e('0x25')]()[_0x277e('0x24')](function(){var _0x570699=_0x25d42f['get']({'plain':!![]});var _0x3b345f=_0x277e('0x26');return db[_0x277e('0x27')][_0x277e('0x25')]({'where':{'type':_0x3b345f,'resourceId':_0x570699['id']}})[_0x277e('0x24')](function(){return _0x25d42f;});})[_0x277e('0x24')](function(){_0x4e0232[_0x277e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47afbb,_0x1d1c4c){return function(_0x10f928){if(!_0x10f928){_0x47afbb[_0x277e('0x17')](0x194);}return _0x10f928;};}function handleError(_0x2db9ac,_0x93a573){_0x93a573=_0x93a573||0x1f4;return function(_0x46fcda){logger[_0x277e('0x28')](_0x46fcda[_0x277e('0x29')]);if(_0x46fcda[_0x277e('0x2a')]){delete _0x46fcda[_0x277e('0x2a')];}_0x2db9ac[_0x277e('0x18')](_0x93a573)['send'](_0x46fcda);};}exports[_0x277e('0x2b')]=function(_0x33d74c,_0x2bc34d){var _0x2afc42={},_0x5c268d={},_0x3d4d9c={'count':0x0,'rows':[]};return db['CmCompany'][_0x277e('0x2c')]()[_0x277e('0x24')](function(_0x39895e){_0x5c268d[_0x277e('0x2d')]=_[_0x277e('0x2e')](_0x39895e);_0x5c268d[_0x277e('0x2f')]=_[_0x277e('0x2e')](_0x33d74c[_0x277e('0x2f')]);_0x5c268d[_0x277e('0x30')]=_['intersection'](_0x5c268d[_0x277e('0x2d')],_0x5c268d[_0x277e('0x2f')]);_0x2afc42[_0x277e('0x31')]=_['intersection'](_0x5c268d['model'],qs[_0x277e('0x32')](_0x33d74c[_0x277e('0x2f')]['fields']));_0x2afc42[_0x277e('0x31')]=_0x2afc42[_0x277e('0x31')][_0x277e('0x33')]?_0x2afc42['attributes']:_0x5c268d[_0x277e('0x2d')];if(!_0x33d74c[_0x277e('0x2f')][_0x277e('0x34')]('nolimit')){_0x2afc42[_0x277e('0x1c')]=qs['limit'](_0x33d74c[_0x277e('0x2f')][_0x277e('0x1c')]);_0x2afc42[_0x277e('0x1b')]=qs['offset'](_0x33d74c['query'][_0x277e('0x1b')]);}_0x2afc42[_0x277e('0x35')]=qs[_0x277e('0x36')](_0x33d74c[_0x277e('0x2f')][_0x277e('0x36')]);_0x2afc42[_0x277e('0x37')]=qs[_0x277e('0x30')](_[_0x277e('0x38')](_0x33d74c['query'],_0x5c268d['filters']),_0x39895e);if(_0x33d74c[_0x277e('0x2f')][_0x277e('0x39')]){_0x2afc42[_0x277e('0x37')]=_[_0x277e('0x3a')](_0x2afc42[_0x277e('0x37')],{'$or':_['map'](_0x2afc42[_0x277e('0x31')],function(_0x172980){var _0x21b543={};_0x21b543[_0x172980]={'$like':'%'+_0x33d74c[_0x277e('0x2f')][_0x277e('0x39')]+'%'};return _0x21b543;})});}_0x2afc42=_[_0x277e('0x3a')]({},_0x2afc42,_0x33d74c[_0x277e('0x3b')]);var _0x5cb67a={'where':_0x2afc42['where']};return db[_0x277e('0x3c')][_0x277e('0x1e')](_0x5cb67a)[_0x277e('0x24')](function(_0x1b985d){_0x3d4d9c['count']=_0x1b985d;if(_0x33d74c[_0x277e('0x2f')][_0x277e('0x3d')]){_0x2afc42['include']=[{'all':!![]}];}return db[_0x277e('0x3c')]['findAll'](_0x2afc42);})[_0x277e('0x24')](function(_0x2ef172){_0x3d4d9c['rows']=_0x2ef172;return _0x3d4d9c;})[_0x277e('0x24')](respondWithFilteredResult(_0x2bc34d,_0x2afc42))['catch'](handleError(_0x2bc34d,null));})[_0x277e('0x3e')](handleError(_0x2bc34d,null));};exports[_0x277e('0x3f')]=function(_0x195474,_0x347bed){var _0x3de823={'raw':![],'where':{'id':_0x195474[_0x277e('0x40')]['id']}},_0x5cabe5={};_0x5cabe5[_0x277e('0x2d')]=_[_0x277e('0x2e')](db[_0x277e('0x3c')][_0x277e('0x41')]);_0x5cabe5[_0x277e('0x2f')]=_[_0x277e('0x2e')](_0x195474[_0x277e('0x2f')]);_0x5cabe5[_0x277e('0x30')]=_[_0x277e('0x42')](_0x5cabe5['model'],_0x5cabe5[_0x277e('0x2f')]);_0x3de823[_0x277e('0x31')]=_[_0x277e('0x42')](_0x5cabe5['model'],qs[_0x277e('0x32')](_0x195474[_0x277e('0x2f')][_0x277e('0x32')]));_0x3de823['attributes']=_0x3de823[_0x277e('0x31')][_0x277e('0x33')]?_0x3de823['attributes']:_0x5cabe5[_0x277e('0x2d')];if(_0x195474['query']['includeAll']){_0x3de823['include']=[{'all':!![]}];}_0x3de823=_[_0x277e('0x3a')]({},_0x3de823,_0x195474[_0x277e('0x3b')]);return db[_0x277e('0x3c')][_0x277e('0x43')](_0x3de823)['then'](handleEntityNotFound(_0x347bed,null))['then'](respondWithResult(_0x347bed,null))[_0x277e('0x3e')](handleError(_0x347bed,null));};exports[_0x277e('0x44')]=function(_0x3f7e4d,_0x5c6603){return db[_0x277e('0x3c')][_0x277e('0x44')](_0x3f7e4d[_0x277e('0x45')],{})[_0x277e('0x24')](function(_0x5faabc){var _0x5038de=_0x3f7e4d[_0x277e('0x46')][_0x277e('0x47')]({'plain':!![]});if(!_0x5038de)throw new Error(_0x277e('0x48'));if(_0x5038de[_0x277e('0x49')]===_0x277e('0x46')){var _0x48f503=_0x5faabc[_0x277e('0x47')]({'plain':!![]});var _0x2a041a=_0x277e('0x26');return db[_0x277e('0x4a')]['find']({'where':{'name':_0x2a041a,'userProfileId':_0x5038de['userProfileId']},'raw':!![]})[_0x277e('0x24')](function(_0x517ba4){if(_0x517ba4&&_0x517ba4[_0x277e('0x4b')]===0x0){return db[_0x277e('0x27')][_0x277e('0x44')]({'name':_0x48f503[_0x277e('0x2a')],'resourceId':_0x48f503['id'],'type':_0x517ba4['name'],'sectionId':_0x517ba4['id']},{})[_0x277e('0x24')](function(){return _0x5faabc;});}else{return _0x5faabc;}})[_0x277e('0x3e')](function(_0x40a1cd){logger[_0x277e('0x28')](_0x277e('0x4c'),_0x40a1cd);throw _0x40a1cd;});}return _0x5faabc;})[_0x277e('0x24')](respondWithResult(_0x5c6603,0xc9))[_0x277e('0x3e')](handleError(_0x5c6603,null));};exports[_0x277e('0x4d')]=function(_0x43d9d9,_0x56c4de){if(_0x43d9d9[_0x277e('0x45')]['id']){delete _0x43d9d9[_0x277e('0x45')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x43d9d9[_0x277e('0x40')]['id']}})[_0x277e('0x24')](handleEntityNotFound(_0x56c4de,null))['then'](saveUpdates(_0x43d9d9[_0x277e('0x45')],null))[_0x277e('0x24')](respondWithResult(_0x56c4de,null))['catch'](handleError(_0x56c4de,null));};exports['destroy']=function(_0x895976,_0x363c48){return db[_0x277e('0x3c')]['find']({'where':{'id':_0x895976[_0x277e('0x40')]['id']}})[_0x277e('0x24')](handleEntityNotFound(_0x363c48,null))[_0x277e('0x24')](removeEntity(_0x363c48,null))[_0x277e('0x3e')](handleError(_0x363c48,null));};exports[_0x277e('0x2c')]=function(_0x37b845,_0x68c2e0){return db[_0x277e('0x3c')][_0x277e('0x2c')]()[_0x277e('0x24')](respondWithResult(_0x68c2e0,null))[_0x277e('0x3e')](handleError(_0x68c2e0,null));};exports['addContacts']=function(_0x52a78c,_0xda97b9,_0xfcd57){return db[_0x277e('0x4e')][_0x277e('0x43')]({'where':{'id':_0x52a78c[_0x277e('0x40')]['id']}})[_0x277e('0x24')](handleEntityNotFound(_0xda97b9,null))['then'](function(_0x56a9ed){if(_0x56a9ed){return _0x56a9ed[_0x277e('0x4f')](_0x52a78c[_0x277e('0x45')][_0x277e('0x50')],_[_0x277e('0x51')](_0x52a78c[_0x277e('0x45')],['ids','id'])||{});}})[_0x277e('0x24')](respondWithResult(_0xda97b9,null))[_0x277e('0x3e')](handleError(_0xda97b9,null));};exports[_0x277e('0x52')]=function(_0x47693e,_0x1170b5,_0x39ca00){var _0x4ddf05={};var _0x45a1c2={};var _0x26c936;var _0x48b534;return db[_0x277e('0x3c')]['findOne']({'where':{'id':_0x47693e[_0x277e('0x40')]['id']}})[_0x277e('0x24')](handleEntityNotFound(_0x1170b5,null))[_0x277e('0x24')](function(_0x1e1f26){if(_0x1e1f26){_0x26c936=_0x1e1f26;_0x45a1c2[_0x277e('0x2d')]=_[_0x277e('0x2e')](db[_0x277e('0x4e')][_0x277e('0x41')]);_0x45a1c2[_0x277e('0x2f')]=_['keys'](_0x47693e[_0x277e('0x2f')]);_0x45a1c2['filters']=_['intersection'](_0x45a1c2[_0x277e('0x2d')],_0x45a1c2[_0x277e('0x2f')]);_0x4ddf05[_0x277e('0x31')]=_['intersection'](_0x45a1c2['model'],qs[_0x277e('0x32')](_0x47693e[_0x277e('0x2f')][_0x277e('0x32')]));_0x4ddf05[_0x277e('0x31')]=_0x4ddf05[_0x277e('0x31')][_0x277e('0x33')]?_0x4ddf05[_0x277e('0x31')]:_0x45a1c2['model'];_0x4ddf05[_0x277e('0x35')]=qs[_0x277e('0x36')](_0x47693e[_0x277e('0x2f')][_0x277e('0x36')]);_0x4ddf05[_0x277e('0x37')]=qs['filters'](_['pick'](_0x47693e['query'],_0x45a1c2[_0x277e('0x30')]));if(_0x47693e[_0x277e('0x2f')][_0x277e('0x39')]){_0x4ddf05[_0x277e('0x37')]=_['merge'](_0x4ddf05[_0x277e('0x37')],{'$or':_['map'](_0x4ddf05[_0x277e('0x31')],function(_0x370d05){var _0x13969c={};_0x13969c[_0x370d05]={'$like':'%'+_0x47693e[_0x277e('0x2f')][_0x277e('0x39')]+'%'};return _0x13969c;})});}_0x4ddf05=_['merge']({},_0x4ddf05,_0x47693e['options']);return _0x26c936['getContacts'](_0x4ddf05);}})[_0x277e('0x24')](function(_0x3b9557){if(_0x3b9557){_0x48b534=_0x3b9557['length'];if(!_0x47693e[_0x277e('0x2f')][_0x277e('0x34')](_0x277e('0x53'))){_0x4ddf05[_0x277e('0x1c')]=qs['limit'](_0x47693e['query'][_0x277e('0x1c')]);_0x4ddf05['offset']=qs[_0x277e('0x1b')](_0x47693e[_0x277e('0x2f')][_0x277e('0x1b')]);}return _0x26c936[_0x277e('0x52')](_0x4ddf05);}})[_0x277e('0x24')](function(_0x44c43c){if(_0x44c43c){return _0x44c43c?{'count':_0x48b534,'rows':_0x44c43c}:null;}})[_0x277e('0x24')](respondWithResult(_0x1170b5,null))['catch'](handleError(_0x1170b5,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 097103f..056f17d 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 _0x1a16=['rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2e5c92,_0x3cb152){var _0x3cdb5e=function(_0x53863b){while(--_0x53863b){_0x2e5c92['push'](_0x2e5c92['shift']());}};_0x3cdb5e(++_0x3cb152);}(_0x1a16,0xca));var _0x61a1=function(_0x390bad,_0x28740b){_0x390bad=_0x390bad-0x0;var _0x498f18=_0x1a16[_0x390bad];return _0x498f18;};'use strict';var _=require(_0x61a1('0x0'));var util=require(_0x61a1('0x1'));var logger=require(_0x61a1('0x2'))(_0x61a1('0x3'));var moment=require(_0x61a1('0x4'));var BPromise=require(_0x61a1('0x5'));var rp=require(_0x61a1('0x6'));var fs=require('fs');var path=require(_0x61a1('0x7'));var rimraf=require(_0x61a1('0x8'));var config=require(_0x61a1('0x9'));var attributes=require(_0x61a1('0xa'));module['exports']=function(_0x5590a0,_0x340b76){return _0x5590a0[_0x61a1('0xb')](_0x61a1('0xc'),attributes,{'tableName':_0x61a1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0ca2=['cm_companies','lodash','util','moment','bluebird','path','../../config/environment','./cmCompany.attributes','define','CmCompany'];(function(_0x526dbb,_0x240d9c){var _0x4c30e8=function(_0x5c6a85){while(--_0x5c6a85){_0x526dbb['push'](_0x526dbb['shift']());}};_0x4c30e8(++_0x240d9c);}(_0x0ca2,0x119));var _0x20ca=function(_0x3cc751,_0x38b8ff){_0x3cc751=_0x3cc751-0x0;var _0x3956a2=_0x0ca2[_0x3cc751];return _0x3956a2;};'use strict';var _=require(_0x20ca('0x0'));var util=require(_0x20ca('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x20ca('0x2'));var BPromise=require(_0x20ca('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20ca('0x4'));var rimraf=require('rimraf');var config=require(_0x20ca('0x5'));var attributes=require(_0x20ca('0x6'));module['exports']=function(_0x4e02aa,_0x3a6e20){return _0x4e02aa[_0x20ca('0x7')](_0x20ca('0x8'),attributes,{'tableName':_0x20ca('0x9'),'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 b62668b..c6719a6 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 _0x7d93=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x7d93,0x1b0));var _0x37d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d93[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x37d9('0x0'));var util=require(_0x37d9('0x1'));var moment=require(_0x37d9('0x2'));var BPromise=require('bluebird');var rs=require(_0x37d9('0x3'));var fs=require('fs');var Redis=require(_0x37d9('0x4'));var db=require(_0x37d9('0x5'))['db'];var utils=require(_0x37d9('0x6'));var logger=require(_0x37d9('0x7'))(_0x37d9('0x8'));var config=require(_0x37d9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x37d9('0xa')][_0x37d9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4976dc,_0x52a609,_0x1855a3){return new BPromise(function(_0x593b81,_0x105140){return client[_0x37d9('0xc')](_0x4976dc,_0x1855a3)['then'](function(_0x2fffb1){logger[_0x37d9('0xd')](_0x37d9('0xe'),_0x52a609,_0x37d9('0xf'));logger[_0x37d9('0x10')](_0x37d9('0x11'),_0x52a609,'request\x20sent',JSON[_0x37d9('0x12')](_0x2fffb1));if(_0x2fffb1[_0x37d9('0x13')]){if(_0x2fffb1[_0x37d9('0x13')][_0x37d9('0x14')]===0x1f4){logger[_0x37d9('0x13')](_0x37d9('0xe'),_0x52a609,_0x2fffb1[_0x37d9('0x13')][_0x37d9('0x15')]);return _0x105140(_0x2fffb1[_0x37d9('0x13')][_0x37d9('0x15')]);}logger[_0x37d9('0x13')](_0x37d9('0xe'),_0x52a609,_0x2fffb1[_0x37d9('0x13')][_0x37d9('0x15')]);return _0x593b81(_0x2fffb1['error']['message']);}else{logger['info'](_0x37d9('0xe'),_0x52a609,_0x37d9('0xf'));_0x593b81(_0x2fffb1[_0x37d9('0x16')][_0x37d9('0x15')]);}})[_0x37d9('0x17')](function(_0x25f413){logger['error'](_0x37d9('0xe'),_0x52a609,_0x25f413);_0x105140(_0x25f413);});});}
\ No newline at end of file
+var _0xab75=['info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xab75,0x198));var _0x5ab7=function(_0x2e3c3a,_0x36f457){_0x2e3c3a=_0x2e3c3a-0x0;var _0x5bcc9c=_0xab75[_0x2e3c3a];return _0x5bcc9c;};'use strict';var _=require(_0x5ab7('0x0'));var util=require(_0x5ab7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5ab7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5ab7('0x3'));var logger=require(_0x5ab7('0x4'))(_0x5ab7('0x5'));var config=require(_0x5ab7('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5ab7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x37ad10,_0x41a304,_0x30aa58){return new BPromise(function(_0x5b50c2,_0x36458b){return client[_0x5ab7('0x8')](_0x37ad10,_0x30aa58)[_0x5ab7('0x9')](function(_0x459d61){logger[_0x5ab7('0xa')](_0x5ab7('0xb'),_0x41a304,_0x5ab7('0xc'));logger[_0x5ab7('0xd')](_0x5ab7('0xe'),_0x41a304,_0x5ab7('0xc'),JSON['stringify'](_0x459d61));if(_0x459d61['error']){if(_0x459d61[_0x5ab7('0xf')][_0x5ab7('0x10')]===0x1f4){logger[_0x5ab7('0xf')](_0x5ab7('0xb'),_0x41a304,_0x459d61[_0x5ab7('0xf')][_0x5ab7('0x11')]);return _0x36458b(_0x459d61[_0x5ab7('0xf')][_0x5ab7('0x11')]);}logger[_0x5ab7('0xf')](_0x5ab7('0xb'),_0x41a304,_0x459d61[_0x5ab7('0xf')]['message']);return _0x5b50c2(_0x459d61[_0x5ab7('0xf')][_0x5ab7('0x11')]);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x41a304,'request\x20sent');_0x5b50c2(_0x459d61['result']['message']);}})[_0x5ab7('0x12')](function(_0x51195c){logger[_0x5ab7('0xf')]('CmCompany,\x20%s,\x20%s',_0x41a304,_0x51195c);_0x36458b(_0x51195c);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index b094cb3..9fd53dc 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 _0x65b6=['../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/contacts','getContacts','post','create','addContacts','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x9efe0,_0x1e7272){var _0x232a0f=function(_0x377439){while(--_0x377439){_0x9efe0['push'](_0x9efe0['shift']());}};_0x232a0f(++_0x1e7272);}(_0x65b6,0x101));var _0x665b=function(_0xa97e74,_0x17c03a){_0xa97e74=_0xa97e74-0x0;var _0x399b97=_0x65b6[_0xa97e74];return _0x399b97;};'use strict';var multer=require(_0x665b('0x0'));var util=require(_0x665b('0x1'));var path=require(_0x665b('0x2'));var timeout=require(_0x665b('0x3'));var express=require(_0x665b('0x4'));var router=express[_0x665b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x665b('0x6'));var interaction=require(_0x665b('0x7'));var config=require(_0x665b('0x8'));var controller=require(_0x665b('0x9'));router[_0x665b('0xa')]('/',auth['isAuthenticated'](),controller[_0x665b('0xb')]);router[_0x665b('0xa')](_0x665b('0xc'),auth[_0x665b('0xd')](),controller[_0x665b('0xe')]);router[_0x665b('0xa')](_0x665b('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x665b('0xa')](_0x665b('0x10'),auth['isAuthenticated'](),controller[_0x665b('0x11')]);router[_0x665b('0x12')]('/',auth['isAuthenticated'](),controller[_0x665b('0x13')]);router[_0x665b('0x12')](_0x665b('0x10'),auth['isAuthenticated'](),controller[_0x665b('0x14')]);router[_0x665b('0x15')](_0x665b('0xf'),auth[_0x665b('0xd')](),controller['update']);router[_0x665b('0x16')](_0x665b('0xf'),auth[_0x665b('0xd')](),controller[_0x665b('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x2838=['post','create','addContacts','put','delete','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','/describe','get','/:id','show','/:id/contacts','getContacts'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2838,0x1bf));var _0x8283=function(_0x24853d,_0x16931f){_0x24853d=_0x24853d-0x0;var _0x4c5cff=_0x2838[_0x24853d];return _0x4c5cff;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8283('0x0'));var timeout=require(_0x8283('0x1'));var express=require('express');var router=express[_0x8283('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8283('0x3'));var interaction=require(_0x8283('0x4'));var config=require(_0x8283('0x5'));var controller=require(_0x8283('0x6'));router['get']('/',auth[_0x8283('0x7')](),controller[_0x8283('0x8')]);router['get'](_0x8283('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x8283('0xa')](_0x8283('0xb'),auth[_0x8283('0x7')](),controller[_0x8283('0xc')]);router['get'](_0x8283('0xd'),auth['isAuthenticated'](),controller[_0x8283('0xe')]);router[_0x8283('0xf')]('/',auth[_0x8283('0x7')](),controller[_0x8283('0x10')]);router[_0x8283('0xf')](_0x8283('0xd'),auth[_0x8283('0x7')](),controller[_0x8283('0x11')]);router[_0x8283('0x12')](_0x8283('0xb'),auth[_0x8283('0x7')](),controller['update']);router[_0x8283('0x13')](_0x8283('0xb'),auth[_0x8283('0x7')](),controller['destroy']);module[_0x8283('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index ba455c4..4605a7f 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 _0xcf9c=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xcf9c,0x99));var _0xccf9=function(_0x1ade92,_0x523089){_0x1ade92=_0x1ade92-0x0;var _0x233f59=_0xcf9c[_0x1ade92];return _0x233f59;};'use strict';var _=require(_0xccf9('0x0'));var Sequelize=require(_0xccf9('0x1'));module[_0xccf9('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xccf9('0x3')]},'street':{'type':Sequelize[_0xccf9('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xccf9('0x3')]},'country':{'type':Sequelize[_0xccf9('0x3')]},'dateOfBirth':{'type':Sequelize[_0xccf9('0x3')]},'description':{'type':Sequelize[_0xccf9('0x4')]},'phone':{'type':Sequelize[_0xccf9('0x3')]},'mobile':{'type':Sequelize[_0xccf9('0x3')]},'fax':{'type':Sequelize[_0xccf9('0x3')]},'email':{'type':Sequelize[_0xccf9('0x3')]},'url':{'type':Sequelize[_0xccf9('0x3')]},'facebook':{'type':Sequelize[_0xccf9('0x3')]},'fb_data':{'type':Sequelize[_0xccf9('0x3')]},'twitter':{'type':Sequelize[_0xccf9('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xccf9('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xccf9('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xccf9('0x5')]},'AdditionalPhones':{'type':Sequelize[_0xccf9('0x3')]},'priority':{'type':Sequelize[_0xccf9('0x5')](0x2)[_0xccf9('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xccf9('0x7')]},'dialTimezone':{'type':Sequelize[_0xccf9('0x3')]},'utcOffset':{'type':Sequelize[_0xccf9('0x5')]}};
\ No newline at end of file
+var _0xe1ce=['TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','STRING'];(function(_0x13d45f,_0x4d89d1){var _0x36f284=function(_0x443adb){while(--_0x443adb){_0x13d45f['push'](_0x13d45f['shift']());}};_0x36f284(++_0x4d89d1);}(_0xe1ce,0x18d));var _0xee1c=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xe1ce[_0x432fca];return _0x3adba4;};'use strict';var _=require(_0xee1c('0x0'));var Sequelize=require(_0xee1c('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xee1c('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xee1c('0x2')]},'city':{'type':Sequelize[_0xee1c('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xee1c('0x3')]},'phone':{'type':Sequelize[_0xee1c('0x2')]},'mobile':{'type':Sequelize[_0xee1c('0x2')]},'fax':{'type':Sequelize[_0xee1c('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xee1c('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xee1c('0x2')]},'teams':{'type':Sequelize[_0xee1c('0x2')]},'viber':{'type':Sequelize[_0xee1c('0x2')]},'line':{'type':Sequelize[_0xee1c('0x2')]},'wechat':{'type':Sequelize[_0xee1c('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xee1c('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xee1c('0x2')]},'priority':{'type':Sequelize[_0xee1c('0x4')](0x2)[_0xee1c('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xee1c('0x6')],'defaultValue':Sequelize[_0xee1c('0x7')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xee1c('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 3f55482..1b0e397 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 _0xd566=['nolimit','setTags','ids','setAdditionalPhones','all','OrderBy','item_types','items','ItemTypeId','description','CmHopper','PHONE','`ItemType`.OrderBy','CmHopperId','item','ItemType.OrderBy','CmHopperAdditionalPhone','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','includeAll','include','rows','getHopperHistories','ContactId','getHopperFinals','CmHopperFinal','getJscriptySessions','JscriptySessionReport','No\x20association\x20keys\x20specified!','socket_timestamp','binding_keys','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','file','filename','chmodSync','0777','fork','../../components/import/cm/csv','binding_values','CompanyId','File\x20uploaded\x20correctly!','pid','path','parse','import','User','agent','No\x20ListId\x20specified','No\x20firstName\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','child_process','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','binding','../../components/import/cm/csvUpdates','getJourney','mail','openchannel','fax','whatsapp','voice','resolve','channel','includes','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','source','destination','callerid','starttime','duration','note','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','createdAt','DESC','findAndCountAll','startCase','chat','Website','Account','closed','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','deviceModel','osName','ratingMessage','referer','subject','substatus','threadId','Interaction','flatten','sortBy','reverse','slice','util','lodash','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','api','../../config/environment','../../config/environment/shared','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','json','offset','undefined','limit','count','status','set','Content-Range','update','then','destroy','error','stack','name','send','index','describe','findAll','catch','CmContact','find','params','tags','keys','length','startsWith','cf_','columnName','displayName','analytics','query','CmCustomField','custom','type','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','hasOwnProperty','merge','body','from','get','mergeWith','isArray','[CmContact][merge]\x20to\x20%s\x20from\x20%s','info','CmHopperBlack','create','ChatInteraction','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','WhatsappInteraction','join','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','ListId','findOrCreate','spread','push','show','Tag','Tags','color','tag','CmContactHasItem','Phones','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','$and','cf_%d','omit','pickBy','map','format','isEmpty','table','cm_contacts','setFields','toParam','values','phone','getTags','findOne','model','rawAttributes','intersection','attributes','fields','order','sort','filters','pick','filter','options'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xd566,0x17a));var _0x6d56=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd566[_0x19950b];return _0x3c6b41;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x6d56('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x6d56('0x1'));var squel=require('squel');var Papa=require(_0x6d56('0x2'));var Redis=require(_0x6d56('0x3'));var contacts=require(_0x6d56('0x4'));var qs=require(_0x6d56('0x5'));var logger=require('../../config/logger')(_0x6d56('0x6'));var config=require(_0x6d56('0x7'));var shared=require(_0x6d56('0x8'));var db=require('../../mysqldb')['db'];config[_0x6d56('0x9')]=_[_0x6d56('0xa')](config['redis'],{'host':_0x6d56('0xb'),'port':0x18eb});var socket=require(_0x6d56('0xc'))(new Redis(config[_0x6d56('0x9')]));require(_0x6d56('0xd'))[_0x6d56('0xe')](socket);function respondWithResult(_0x2262f7,_0x2f671d){_0x2f671d=_0x2f671d||0xc8;return function(_0x5db4cc){if(_0x5db4cc){return _0x2262f7['status'](_0x2f671d)[_0x6d56('0xf')](_0x5db4cc);}};}function respondWithFilteredResult(_0xa45411,_0x22dc36){return function(_0xdc55da){if(_0xdc55da){var _0x49790e=typeof _0x22dc36[_0x6d56('0x10')]===_0x6d56('0x11')&&typeof _0x22dc36[_0x6d56('0x12')]===_0x6d56('0x11');var _0x513e5c=_0xdc55da[_0x6d56('0x13')];var _0x3eac9b=_0x49790e?0x0:_0x22dc36[_0x6d56('0x10')];var _0x37f746=_0x49790e?_0xdc55da['count']:_0x22dc36[_0x6d56('0x10')]+_0x22dc36['limit'];var _0x45f160;if(_0x37f746>=_0x513e5c){_0x37f746=_0x513e5c;_0x45f160=0xc8;}else{_0x45f160=0xce;}_0xa45411[_0x6d56('0x14')](_0x45f160);return _0xa45411[_0x6d56('0x15')](_0x6d56('0x16'),_0x3eac9b+'-'+_0x37f746+'/'+_0x513e5c)[_0x6d56('0xf')](_0xdc55da);}return null;};}function saveUpdates(_0x3f6e91){return function(_0x189136){if(_0x189136){return _0x189136[_0x6d56('0x17')](_0x3f6e91)[_0x6d56('0x18')](function(_0x1d0a08){return _0x1d0a08;});}return null;};}function removeEntity(_0x463318){return function(_0x595ea7){if(_0x595ea7){return _0x595ea7[_0x6d56('0x19')]()['then'](function(){_0x463318[_0x6d56('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f31b4){return function(_0x15231c){if(!_0x15231c){_0x2f31b4['sendStatus'](0x194);}return _0x15231c;};}function handleError(_0x28f022,_0x4881e2){_0x4881e2=_0x4881e2||0x1f4;return function(_0x1ee869){logger[_0x6d56('0x1a')](_0x1ee869[_0x6d56('0x1b')]);if(_0x1ee869[_0x6d56('0x1c')]){delete _0x1ee869[_0x6d56('0x1c')];}_0x28f022['status'](_0x4881e2)[_0x6d56('0x1d')](_0x1ee869);};}exports[_0x6d56('0x1e')]=function(_0x43e820,_0x24e411){var _0x5dde8d={};return contacts[_0x6d56('0x1f')]()[_0x6d56('0x18')](function(_0x41542f){_0x5dde8d=qs['getOptions'](_0x41542f,_0x43e820);return contacts[_0x6d56('0x20')](_0x43e820['query'],_0x43e820['user'],_0x5dde8d,_0x41542f);})[_0x6d56('0x18')](respondWithFilteredResult(_0x24e411,_0x5dde8d))[_0x6d56('0x21')](handleError(_0x24e411,null));};exports[_0x6d56('0x19')]=function(_0x29cf62,_0x1fd712){return db[_0x6d56('0x22')][_0x6d56('0x23')]({'where':{'id':_0x29cf62[_0x6d56('0x24')]['id']}})['then'](handleEntityNotFound(_0x1fd712,null))[_0x6d56('0x18')](removeEntity(_0x1fd712,null))[_0x6d56('0x21')](handleError(_0x1fd712,null));};exports[_0x6d56('0x1f')]=function(_0x3a1b85,_0x46d85b){return db['CmContact']['describe']()['then'](function(_0x491470){delete _0x491470[_0x6d56('0x25')];for(var _0x115fa8=0x0;_0x115fa8
','Attachments','generateXOAuth2Token','user=','utf-8','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','split','length','slice','Anonymous','isEmpty','html','replace','0x1?_0x57449f[_0x7f43('0x12')](0x0,-0x1)['join']('\x20'):_0x5d1d24[_0x7f43('0xf')];}return _0x7f43('0x13');}function getLastName(_0x202c5f){var _0x55f6af=_['head'](_0x202c5f[_0x7f43('0xa')]);if(_0x55f6af&&_0x55f6af[_0x7f43('0xf')]){var _0x588ec3=_0x55f6af[_0x7f43('0xf')][_0x7f43('0x10')](/\s+/);return _0x588ec3[_0x7f43('0x11')]>0x1?_0x588ec3['pop']():'';}return'';}function getMails(_0x3a3509,_0x4860ea){var _0x46dbb8='';for(var _0x5dd9d2=0x0;_0x5dd9d2<_0x4860ea[_0x7f43('0xa')]['length'];_0x5dd9d2+=0x1){if(_0x4860ea[_0x7f43('0xa')][_0x5dd9d2][_0x7f43('0xb')]!==_0x3a3509){if(!_[_0x7f43('0x14')](_0x46dbb8)){_0x46dbb8+=',';}_0x46dbb8+=_0x4860ea[_0x7f43('0xa')][_0x5dd9d2][_0x7f43('0xf')]||_0x4860ea[_0x7f43('0xa')][_0x5dd9d2]['address']||'';_0x46dbb8+='\x20<';_0x46dbb8+=_0x4860ea['value'][_0x5dd9d2][_0x7f43('0xb')]?_0x4860ea['value'][_0x5dd9d2]['address']:'anonymous'+random[_0x7f43('0xd')](0x6)+_0x7f43('0xe');_0x46dbb8+='>';}}return _0x46dbb8;}function parseEmail(_0x406ebd,_0x5abfb8,_0x46d88a){if(_0x5abfb8[_0x7f43('0x15')]){var _0x40368a=/