From: Andrea Bianco
Date: Sat, 27 Mar 2021 11:16:16 +0000 (+0100)
Subject: Built motion from commit (unavailable).|2.5.23
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22https:/fonts.googleapis.com//%22card-image.png/%22?a=commitdiff_plain;h=43920324c916a717332193ccbb9997bed9db985b;p=motion2.git
Built motion from commit (unavailable).|2.5.23
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index bb49bd6..79c2b27 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-03-27T10:07:49.798Z",
+ "time": "2021-03-27T11:06:05.220Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 72ad593..e936f97 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-03-27T10:07:49.798Z",
+ "time": "2021-03-27T11:06:05.220Z",
"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 ba48f09..fb1e95e 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 _0x478c=['STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','TEXT','sequelize','getDataValue'];(function(_0x584756,_0x4c6a30){var _0x11447f=function(_0xa9b3b8){while(--_0xa9b3b8){_0x584756['push'](_0x584756['shift']());}};_0x11447f(++_0x4c6a30);}(_0x478c,0x85));var _0xc478=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x478c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc478('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x381c25){return this[_0xc478('0x1')]('action');}},'action':{'type':Sequelize[_0xc478('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0xc478('0x3'),_0xc478('0x4'),_0xc478('0x5'),_0xc478('0x6'),_0xc478('0x7'),_0xc478('0x8'),_0xc478('0x9'),_0xc478('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xc478('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xc478('0xc')},'data2':{'type':Sequelize[_0xc478('0x2')](0x1000),'comment':_0xc478('0xd')},'data3':{'type':Sequelize[_0xc478('0x2')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0xc478('0x2')](0x1000)},'data6':{'type':Sequelize[_0xc478('0x2')]},'data7':{'type':Sequelize[_0xc478('0xe')]}};
\ No newline at end of file
+var _0x85a3=['getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x85a3,0x19f));var _0x385a=function(_0x249969,_0x4bcf6d){_0x249969=_0x249969-0x0;var _0x4b4a61=_0x85a3[_0x249969];return _0x4b4a61;};'use strict';var Sequelize=require(_0x385a('0x0'));module[_0x385a('0x1')]={'name':{'type':Sequelize[_0x385a('0x2')],'get':function(_0xbee8db){return this[_0x385a('0x3')](_0x385a('0x4'));}},'action':{'type':Sequelize[_0x385a('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x385a('0x6'),_0x385a('0x7'),_0x385a('0x8'),_0x385a('0x9'),_0x385a('0xa'),_0x385a('0xb'),_0x385a('0xc'),_0x385a('0xd')]],'msg':_0x385a('0xe')}},'comment':_0x385a('0xe')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x385a('0xf')},'data2':{'type':Sequelize[_0x385a('0x5')](0x1000),'comment':_0x385a('0x10')},'data3':{'type':Sequelize[_0x385a('0x5')](0x1000),'comment':_0x385a('0x11')},'data4':{'type':Sequelize[_0x385a('0x5')](0x1000)},'data5':{'type':Sequelize[_0x385a('0x5')](0x1000)},'data6':{'type':Sequelize[_0x385a('0x5')]},'data7':{'type':Sequelize[_0x385a('0x12')]}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 384d1d1..74c05c8 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 _0x948d=['name','send','Action','find','body','catch','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','end','error'];(function(_0x3f0ed9,_0x5e7017){var _0x34cb4f=function(_0x317b60){while(--_0x317b60){_0x3f0ed9['push'](_0x3f0ed9['shift']());}};_0x34cb4f(++_0x5e7017);}(_0x948d,0x1c9));var _0xd948=function(_0x59b101,_0x55ec68){_0x59b101=_0x59b101-0x0;var _0x18168e=_0x948d[_0x59b101];return _0x18168e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd948('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd948('0x1'));var jsonpatch=require(_0xd948('0x2'));var rp=require(_0xd948('0x3'));var moment=require('moment');var BPromise=require(_0xd948('0x4'));var Mustache=require('mustache');var util=require(_0xd948('0x5'));var path=require(_0xd948('0x6'));var sox=require(_0xd948('0x7'));var csv=require(_0xd948('0x8'));var ejs=require(_0xd948('0x9'));var fs=require('fs');var fs_extra=require(_0xd948('0xa'));var _=require(_0xd948('0xb'));var squel=require(_0xd948('0xc'));var crypto=require(_0xd948('0xd'));var jsforce=require(_0xd948('0xe'));var deskjs=require(_0xd948('0xf'));var toCsv=require(_0xd948('0x8'));var querystring=require(_0xd948('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd948('0x11'));var as=require(_0xd948('0x12'));var hardwareService=require(_0xd948('0x13'));var logger=require(_0xd948('0x14'))(_0xd948('0x15'));var utils=require('../../config/utils');var config=require(_0xd948('0x16'));var licenseUtil=require(_0xd948('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x501504,_0xb228e9){_0xb228e9=_0xb228e9||0xcc;return function(_0x606c89){if(_0x606c89){return _0x501504[_0xd948('0x18')](_0xb228e9);}return _0x501504[_0xd948('0x19')](_0xb228e9)['end']();};}function respondWithResult(_0x2616f9,_0x5a7d32){_0x5a7d32=_0x5a7d32||0xc8;return function(_0x8727a0){if(_0x8727a0){return _0x2616f9[_0xd948('0x19')](_0x5a7d32)[_0xd948('0x1a')](_0x8727a0);}};}function respondWithFilteredResult(_0x54adc5,_0x262286){return function(_0x58e58a){if(_0x58e58a){var _0x212cc0=_0x58e58a[_0xd948('0x1b')],_0x32c80f=_0x262286[_0xd948('0x1c')],_0x5cfa2b=_0x262286[_0xd948('0x1c')]+_0x262286[_0xd948('0x1d')],_0x4c22a8;if(_0x5cfa2b>=_0x212cc0){_0x5cfa2b=_0x212cc0;_0x4c22a8=0xc8;}else{_0x4c22a8=0xce;}_0x54adc5['status'](_0x4c22a8);return _0x54adc5[_0xd948('0x1e')](_0xd948('0x1f'),_0x32c80f+'-'+_0x5cfa2b+'/'+_0x212cc0)['json'](_0x58e58a);}return null;};}function patchUpdates(_0x2545e8){return function(_0x4065bb){try{jsonpatch[_0xd948('0x20')](_0x4065bb,_0x2545e8,!![]);}catch(_0x19b1a4){return BPromise['reject'](_0x19b1a4);}return _0x4065bb['save']();};}function saveUpdates(_0x1ac8cd,_0x94f76d){return function(_0x5e38bd){if(_0x5e38bd){return _0x5e38bd[_0xd948('0x21')](_0x1ac8cd)[_0xd948('0x22')](function(_0x55a9ae){return _0x55a9ae;});}return null;};}function removeEntity(_0x1151af,_0x4b4ffd){return function(_0x3f6ce0){if(_0x3f6ce0){return _0x3f6ce0[_0xd948('0x23')]()['then'](function(){_0x1151af[_0xd948('0x19')](0xcc)[_0xd948('0x24')]();});}};}function handleEntityNotFound(_0x291110,_0x5adbd3){return function(_0x1709d2){if(!_0x1709d2){_0x291110[_0xd948('0x18')](0x194);}return _0x1709d2;};}function handleError(_0x24b3f4,_0x5b1dd1){_0x5b1dd1=_0x5b1dd1||0x1f4;return function(_0x1411db){logger[_0xd948('0x25')](_0x1411db['stack']);if(_0x1411db[_0xd948('0x26')]){delete _0x1411db[_0xd948('0x26')];}_0x24b3f4['status'](_0x5b1dd1)[_0xd948('0x27')](_0x1411db);};}exports[_0xd948('0x21')]=function(_0x19ee76,_0x5c29fe){if(_0x19ee76['body']['id']){delete _0x19ee76['body']['id'];}return db[_0xd948('0x28')][_0xd948('0x29')]({'where':{'id':_0x19ee76['params']['id']}})[_0xd948('0x22')](handleEntityNotFound(_0x5c29fe,null))[_0xd948('0x22')](saveUpdates(_0x19ee76[_0xd948('0x2a')],null))[_0xd948('0x22')](respondWithResult(_0x5c29fe,null))[_0xd948('0x2b')](handleError(_0x5c29fe,null));};exports[_0xd948('0x23')]=function(_0x262cfb,_0x2926f2){return db[_0xd948('0x28')][_0xd948('0x29')]({'where':{'id':_0x262cfb[_0xd948('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2926f2,null))[_0xd948('0x22')](removeEntity(_0x2926f2,null))['catch'](handleError(_0x2926f2,null));};
\ No newline at end of file
+var _0xc42a=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','update','Action','params','body','catch','find','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api'];(function(_0x104af4,_0x3cd4ea){var _0x162361=function(_0x198ec6){while(--_0x198ec6){_0x104af4['push'](_0x104af4['shift']());}};_0x162361(++_0x3cd4ea);}(_0xc42a,0x17a));var _0xac42=function(_0x3611a7,_0x59563c){_0x3611a7=_0x3611a7-0x0;var _0x569692=_0xc42a[_0x3611a7];return _0x569692;};'use strict';var pdf=require(_0xac42('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xac42('0x1'));var jsonpatch=require(_0xac42('0x2'));var rp=require(_0xac42('0x3'));var moment=require(_0xac42('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xac42('0x5'));var util=require(_0xac42('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xac42('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xac42('0x8'));var squel=require(_0xac42('0x9'));var crypto=require(_0xac42('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xac42('0xb'));var toCsv=require(_0xac42('0x7'));var querystring=require(_0xac42('0xc'));var Papa=require(_0xac42('0xd'));var Redis=require('ioredis');var authService=require(_0xac42('0xe'));var qs=require(_0xac42('0xf'));var as=require(_0xac42('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xac42('0x11'));var utils=require(_0xac42('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xac42('0x13'));var db=require(_0xac42('0x14'))['db'];function respondWithStatusCode(_0x2297ac,_0x1352c2){_0x1352c2=_0x1352c2||0xcc;return function(_0x1355ae){if(_0x1355ae){return _0x2297ac[_0xac42('0x15')](_0x1352c2);}return _0x2297ac[_0xac42('0x16')](_0x1352c2)['end']();};}function respondWithResult(_0x3b1a7b,_0x57f8a1){_0x57f8a1=_0x57f8a1||0xc8;return function(_0x994e3c){if(_0x994e3c){return _0x3b1a7b['status'](_0x57f8a1)[_0xac42('0x17')](_0x994e3c);}};}function respondWithFilteredResult(_0x11b2d4,_0x5c5aed){return function(_0x1e7a55){if(_0x1e7a55){var _0x2ee92e=_0x1e7a55[_0xac42('0x18')],_0x1634dd=_0x5c5aed[_0xac42('0x19')],_0x4bd779=_0x5c5aed[_0xac42('0x19')]+_0x5c5aed[_0xac42('0x1a')],_0x12ed3f;if(_0x4bd779>=_0x2ee92e){_0x4bd779=_0x2ee92e;_0x12ed3f=0xc8;}else{_0x12ed3f=0xce;}_0x11b2d4['status'](_0x12ed3f);return _0x11b2d4[_0xac42('0x1b')](_0xac42('0x1c'),_0x1634dd+'-'+_0x4bd779+'/'+_0x2ee92e)[_0xac42('0x17')](_0x1e7a55);}return null;};}function patchUpdates(_0x366ccf){return function(_0x504799){try{jsonpatch[_0xac42('0x1d')](_0x504799,_0x366ccf,!![]);}catch(_0x574d3){return BPromise[_0xac42('0x1e')](_0x574d3);}return _0x504799['save']();};}function saveUpdates(_0x1bd8d4,_0x59d8c1){return function(_0x52e362){if(_0x52e362){return _0x52e362['update'](_0x1bd8d4)[_0xac42('0x1f')](function(_0x4dc755){return _0x4dc755;});}return null;};}function removeEntity(_0x51d85b,_0x3658fd){return function(_0x5432f6){if(_0x5432f6){return _0x5432f6[_0xac42('0x20')]()[_0xac42('0x1f')](function(){_0x51d85b['status'](0xcc)[_0xac42('0x21')]();});}};}function handleEntityNotFound(_0x54906c,_0xd73bc4){return function(_0x87afca){if(!_0x87afca){_0x54906c[_0xac42('0x15')](0x194);}return _0x87afca;};}function handleError(_0x2e7337,_0x976eda){_0x976eda=_0x976eda||0x1f4;return function(_0x1ab769){logger[_0xac42('0x22')](_0x1ab769[_0xac42('0x23')]);if(_0x1ab769[_0xac42('0x24')]){delete _0x1ab769[_0xac42('0x24')];}_0x2e7337[_0xac42('0x16')](_0x976eda)[_0xac42('0x25')](_0x1ab769);};}exports[_0xac42('0x26')]=function(_0xb47793,_0x38bf00){if(_0xb47793['body']['id']){delete _0xb47793['body']['id'];}return db[_0xac42('0x27')]['find']({'where':{'id':_0xb47793[_0xac42('0x28')]['id']}})[_0xac42('0x1f')](handleEntityNotFound(_0x38bf00,null))[_0xac42('0x1f')](saveUpdates(_0xb47793[_0xac42('0x29')],null))[_0xac42('0x1f')](respondWithResult(_0x38bf00,null))[_0xac42('0x2a')](handleError(_0x38bf00,null));};exports[_0xac42('0x20')]=function(_0x5cedf3,_0x2165ad){return db[_0xac42('0x27')][_0xac42('0x2b')]({'where':{'id':_0x5cedf3[_0xac42('0x28')]['id']}})[_0xac42('0x1f')](handleEntityNotFound(_0x2165ad,null))['then'](removeEntity(_0x2165ad,null))[_0xac42('0x2a')](handleError(_0x2165ad,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 37bf20e..89e3b37 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 _0x437a=['tools_actions','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x437a,0x173));var _0xa437=function(_0x3f38b0,_0x38ba25){_0x3f38b0=_0x3f38b0-0x0;var _0x475fd9=_0x437a[_0x3f38b0];return _0x475fd9;};'use strict';var _=require(_0xa437('0x0'));var util=require('util');var logger=require(_0xa437('0x1'))(_0xa437('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa437('0x3'));var fs=require('fs');var path=require(_0xa437('0x4'));var rimraf=require(_0xa437('0x5'));var config=require(_0xa437('0x6'));var attributes=require('./action.attributes');module[_0xa437('0x7')]=function(_0x570db4,_0x54da73){return _0x570db4[_0xa437('0x8')]('Action',attributes,{'tableName':_0xa437('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x655c=['bluebird','path','rimraf','../../config/environment','./action.attributes','Action','tools_actions','lodash','util','../../config/logger','api','moment'];(function(_0x3d09ec,_0xf30d0f){var _0x4dcbd8=function(_0x944b6d){while(--_0x944b6d){_0x3d09ec['push'](_0x3d09ec['shift']());}};_0x4dcbd8(++_0xf30d0f);}(_0x655c,0x163));var _0xc655=function(_0x414ef0,_0x507dd8){_0x414ef0=_0x414ef0-0x0;var _0xaaadbd=_0x655c[_0x414ef0];return _0xaaadbd;};'use strict';var _=require(_0xc655('0x0'));var util=require(_0xc655('0x1'));var logger=require(_0xc655('0x2'))(_0xc655('0x3'));var moment=require(_0xc655('0x4'));var BPromise=require(_0xc655('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc655('0x6'));var rimraf=require(_0xc655('0x7'));var config=require(_0xc655('0x8'));var attributes=require(_0xc655('0x9'));module['exports']=function(_0x5ded79,_0x58b276){return _0x5ded79['define'](_0xc655('0xa'),attributes,{'tableName':_0xc655('0xb'),'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 c409739..c53d3f0 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x3e3e1f,_0x576859){var _0x2d357c=function(_0x2b4479){while(--_0x2b4479){_0x3e3e1f['push'](_0x3e3e1f['shift']());}};_0x2d357c(++_0x576859);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}
\ No newline at end of file
+var _0x70e0=['code','Action,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xe6d141,_0x192c19){var _0x5e470b=function(_0x49e816){while(--_0x49e816){_0xe6d141['push'](_0xe6d141['shift']());}};_0x5e470b(++_0x192c19);}(_0x70e0,0x17b));var _0x070e=function(_0x455e72,_0xc76ee7){_0x455e72=_0x455e72-0x0;var _0x28c1aa=_0x70e0[_0x455e72];return _0x28c1aa;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('Action,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('Action,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index b5af151..f13ad77 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 _0xe3c8=['delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated'];(function(_0x4d9bb2,_0x3db50d){var _0x3179fe=function(_0x5272f3){while(--_0x5272f3){_0x4d9bb2['push'](_0x4d9bb2['shift']());}};_0x3179fe(++_0x3db50d);}(_0xe3c8,0x145));var _0x8e3c=function(_0x4a5426,_0x31d016){_0x4a5426=_0x4a5426-0x0;var _0x542078=_0xe3c8[_0x4a5426];return _0x542078;};'use strict';var multer=require(_0x8e3c('0x0'));var util=require(_0x8e3c('0x1'));var path=require(_0x8e3c('0x2'));var timeout=require(_0x8e3c('0x3'));var express=require(_0x8e3c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8e3c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8e3c('0x6'));var controller=require(_0x8e3c('0x7'));router[_0x8e3c('0x8')](_0x8e3c('0x9'),auth[_0x8e3c('0xa')](),controller['update']);router[_0x8e3c('0xb')](_0x8e3c('0x9'),auth[_0x8e3c('0xa')](),controller[_0x8e3c('0xc')]);module[_0x8e3c('0xd')]=router;
\ No newline at end of file
+var _0x355e=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete'];(function(_0xf707f5,_0x566532){var _0x246899=function(_0x18f2aa){while(--_0x18f2aa){_0xf707f5['push'](_0xf707f5['shift']());}};_0x246899(++_0x566532);}(_0x355e,0xa7));var _0xe355=function(_0x1daafa,_0x5562d5){_0x1daafa=_0x1daafa-0x0;var _0x421f30=_0x355e[_0x1daafa];return _0x421f30;};'use strict';var multer=require(_0xe355('0x0'));var util=require(_0xe355('0x1'));var path=require('path');var timeout=require(_0xe355('0x2'));var express=require(_0xe355('0x3'));var router=express[_0xe355('0x4')]();var fs_extra=require(_0xe355('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe355('0x6'));var controller=require(_0xe355('0x7'));router[_0xe355('0x8')](_0xe355('0x9'),auth[_0xe355('0xa')](),controller[_0xe355('0xb')]);router[_0xe355('0xc')](_0xe355('0x9'),auth['isAuthenticated'](),controller[_0xe355('0xd')]);module[_0xe355('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 927d3df..48670c9 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 _0x6218=['STRING','TEXT','sequelize','exports'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x6218,0x1be));var _0x8621=function(_0x5c13d5,_0x38a129){_0x5c13d5=_0x5c13d5-0x0;var _0x361eb9=_0x6218[_0x5c13d5];return _0x361eb9;};'use strict';var Sequelize=require(_0x8621('0x0'));module[_0x8621('0x1')]={'name':{'type':Sequelize[_0x8621('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8621('0x2')]},'parent':{'type':Sequelize[_0x8621('0x2')]},'table':{'type':Sequelize[_0x8621('0x2')]},'conditions':{'type':Sequelize[_0x8621('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x75a3=['STRING','TEXT','exports'];(function(_0x7b360c,_0x5cec49){var _0x2dad8e=function(_0x560e7f){while(--_0x560e7f){_0x7b360c['push'](_0x7b360c['shift']());}};_0x2dad8e(++_0x5cec49);}(_0x75a3,0x158));var _0x375a=function(_0x1b4ced,_0x28dfd1){_0x1b4ced=_0x1b4ced-0x0;var _0x34c145=_0x75a3[_0x1b4ced];return _0x34c145;};'use strict';var Sequelize=require('sequelize');module[_0x375a('0x0')]={'name':{'type':Sequelize[_0x375a('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x375a('0x1')]},'parent':{'type':Sequelize[_0x375a('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x375a('0x2')]},'joins':{'type':Sequelize[_0x375a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index d8b39ca..baa6f3d 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 _0x4054=['bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','UserProfileResource','end','sendStatus','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','field','condition','getFields','select','from','table','MetricId','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','debug','Limited\x20Query:','toString','QueryTypes','SELECT','IS\x20NOT\x20NULL','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','metric','output','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','sequelize','runReport','left_join','COUNT(%s)','ValidationErrorItem','clone','html-pdf','eml-format','rimraf','zip-dir','moment'];(function(_0x3a4c79,_0x81f067){var _0x50bbb1=function(_0x3049bf){while(--_0x3049bf){_0x3a4c79['push'](_0x3a4c79['shift']());}};_0x50bbb1(++_0x81f067);}(_0x4054,0x145));var _0x4405=function(_0x3bd2e0,_0x3dc38b){_0x3bd2e0=_0x3bd2e0-0x0;var _0x656dbe=_0x4054[_0x3bd2e0];return _0x656dbe;};'use strict';var pdf=require(_0x4405('0x0'));var emlformat=require(_0x4405('0x1'));var rimraf=require(_0x4405('0x2'));var zipdir=require(_0x4405('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4405('0x4'));var BPromise=require(_0x4405('0x5'));var Mustache=require(_0x4405('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4405('0x7'));var csv=require(_0x4405('0x8'));var ejs=require(_0x4405('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4405('0xa'));var squel=require(_0x4405('0xb'));var crypto=require(_0x4405('0xc'));var jsforce=require(_0x4405('0xd'));var deskjs=require(_0x4405('0xe'));var toCsv=require(_0x4405('0x8'));var querystring=require(_0x4405('0xf'));var Papa=require(_0x4405('0x10'));var Redis=require(_0x4405('0x11'));var authService=require(_0x4405('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4405('0x13'));var logger=require(_0x4405('0x14'))(_0x4405('0x15'));var utils=require(_0x4405('0x16'));var config=require(_0x4405('0x17'));var licenseUtil=require(_0x4405('0x18'));var db=require(_0x4405('0x19'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x31a214,_0x2d0307){_0x2d0307=_0x2d0307||0xcc;return function(_0x49fdbb){if(_0x49fdbb){return _0x31a214['sendStatus'](_0x2d0307);}return _0x31a214['status'](_0x2d0307)['end']();};}function respondWithResult(_0x253711,_0x48fd5a){_0x48fd5a=_0x48fd5a||0xc8;return function(_0x577ec6){if(_0x577ec6){return _0x253711[_0x4405('0x1a')](_0x48fd5a)['json'](_0x577ec6);}};}function respondWithFilteredResult(_0xb9cc90,_0x5057de){return function(_0x1b19d0){if(_0x1b19d0){var _0x3cae42=_0x1b19d0[_0x4405('0x1b')],_0x513a64=_0x5057de[_0x4405('0x1c')],_0x140ef7=_0x5057de[_0x4405('0x1c')]+_0x5057de[_0x4405('0x1d')],_0x4a87e4;if(_0x140ef7>=_0x3cae42){_0x140ef7=_0x3cae42;_0x4a87e4=0xc8;}else{_0x4a87e4=0xce;}_0xb9cc90['status'](_0x4a87e4);return _0xb9cc90[_0x4405('0x1e')](_0x4405('0x1f'),_0x513a64+'-'+_0x140ef7+'/'+_0x3cae42)[_0x4405('0x20')](_0x1b19d0);}return null;};}function patchUpdates(_0x1e3980){return function(_0x25b7a8){try{jsonpatch[_0x4405('0x21')](_0x25b7a8,_0x1e3980,!![]);}catch(_0x282ca0){return BPromise[_0x4405('0x22')](_0x282ca0);}return _0x25b7a8['save']();};}function saveUpdates(_0x3c5719,_0x5a68c0){return function(_0x17a885){if(_0x17a885){return _0x17a885[_0x4405('0x23')](_0x3c5719)[_0x4405('0x24')](function(_0x3ed19b){return _0x3ed19b;});}return null;};}function removeEntity(_0x4f1163,_0x12b6b9){return function(_0x3a3d53){if(_0x3a3d53){return _0x3a3d53[_0x4405('0x25')]()['then'](function(){var _0x13235e=_0x3a3d53['get']({'plain':!![]});var _0x1cf433='CustomReports';return db[_0x4405('0x26')][_0x4405('0x25')]({'where':{'type':_0x1cf433,'resourceId':_0x13235e['id']}})[_0x4405('0x24')](function(){return _0x3a3d53;});})[_0x4405('0x24')](function(){_0x4f1163['status'](0xcc)[_0x4405('0x27')]();});}};}function handleEntityNotFound(_0x5538f8,_0x58901a){return function(_0x248c01){if(!_0x248c01){_0x5538f8[_0x4405('0x28')](0x194);}return _0x248c01;};}function handleError(_0x3f82b5,_0x2a4b86){_0x2a4b86=_0x2a4b86||0x1f4;return function(_0x57f660){logger[_0x4405('0x29')](_0x57f660[_0x4405('0x2a')]);if(_0x57f660['name']){delete _0x57f660[_0x4405('0x2b')];}_0x3f82b5[_0x4405('0x1a')](_0x2a4b86)['send'](_0x57f660);};}exports[_0x4405('0x2c')]=function(_0x224fb6,_0x106312){var _0x3e6d68={},_0x294dfd={},_0x441c03={'count':0x0,'rows':[]};var _0x2f70ba=_[_0x4405('0x2d')](db[_0x4405('0x2e')][_0x4405('0x2f')],function(_0x1a062e){return{'name':_0x1a062e[_0x4405('0x30')],'type':_0x1a062e['type'][_0x4405('0x31')]};});_0x294dfd[_0x4405('0x32')]=_[_0x4405('0x2d')](_0x2f70ba,'name');_0x294dfd[_0x4405('0x33')]=_['keys'](_0x224fb6[_0x4405('0x33')]);_0x294dfd[_0x4405('0x34')]=_['intersection'](_0x294dfd[_0x4405('0x32')],_0x294dfd[_0x4405('0x33')]);_0x3e6d68['attributes']=_[_0x4405('0x35')](_0x294dfd[_0x4405('0x32')],qs[_0x4405('0x36')](_0x224fb6['query'][_0x4405('0x36')]));_0x3e6d68[_0x4405('0x37')]=_0x3e6d68[_0x4405('0x37')][_0x4405('0x38')]?_0x3e6d68[_0x4405('0x37')]:_0x294dfd[_0x4405('0x32')];if(!_0x224fb6[_0x4405('0x33')][_0x4405('0x39')]('nolimit')){_0x3e6d68[_0x4405('0x1d')]=qs[_0x4405('0x1d')](_0x224fb6[_0x4405('0x33')][_0x4405('0x1d')]);_0x3e6d68[_0x4405('0x1c')]=qs['offset'](_0x224fb6[_0x4405('0x33')][_0x4405('0x1c')]);}_0x3e6d68[_0x4405('0x3a')]=qs['sort'](_0x224fb6[_0x4405('0x33')][_0x4405('0x3b')]);_0x3e6d68[_0x4405('0x3c')]=qs[_0x4405('0x34')](_[_0x4405('0x3d')](_0x224fb6[_0x4405('0x33')],_0x294dfd['filters']),_0x2f70ba);if(_0x224fb6[_0x4405('0x33')][_0x4405('0x3e')]){_0x3e6d68['where']=_[_0x4405('0x3f')](_0x3e6d68[_0x4405('0x3c')],{'$or':_['map'](_0x2f70ba,function(_0x4055de){if(_0x4055de[_0x4405('0x40')]!=='VIRTUAL'){var _0x2872d8={};_0x2872d8[_0x4055de[_0x4405('0x2b')]]={'$like':'%'+_0x224fb6[_0x4405('0x33')][_0x4405('0x3e')]+'%'};return _0x2872d8;}})});}_0x3e6d68=_[_0x4405('0x3f')]({},_0x3e6d68,_0x224fb6[_0x4405('0x41')]);var _0x5ea9c7={'where':_0x3e6d68[_0x4405('0x3c')]};return db[_0x4405('0x2e')][_0x4405('0x1b')](_0x5ea9c7)[_0x4405('0x24')](function(_0x3ef314){_0x441c03[_0x4405('0x1b')]=_0x3ef314;if(_0x224fb6[_0x4405('0x33')]['includeAll']){_0x3e6d68[_0x4405('0x42')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x4405('0x43')](_0x3e6d68);})['then'](function(_0x497a45){_0x441c03[_0x4405('0x44')]=_0x497a45;return _0x441c03;})[_0x4405('0x24')](respondWithFilteredResult(_0x106312,_0x3e6d68))[_0x4405('0x45')](handleError(_0x106312,null));};exports[_0x4405('0x46')]=function(_0x201175,_0x52ebc8){var _0x5468f4={'raw':![],'where':{'id':_0x201175[_0x4405('0x47')]['id']}},_0x75a52={};_0x75a52['model']=_['keys'](db['AnalyticCustomReport'][_0x4405('0x2f')]);_0x75a52['query']=_[_0x4405('0x48')](_0x201175[_0x4405('0x33')]);_0x75a52[_0x4405('0x34')]=_[_0x4405('0x35')](_0x75a52['model'],_0x75a52['query']);_0x5468f4[_0x4405('0x37')]=_['intersection'](_0x75a52[_0x4405('0x32')],qs[_0x4405('0x36')](_0x201175[_0x4405('0x33')]['fields']));_0x5468f4[_0x4405('0x37')]=_0x5468f4['attributes'][_0x4405('0x38')]?_0x5468f4[_0x4405('0x37')]:_0x75a52['model'];if(_0x201175['query'][_0x4405('0x49')]){_0x5468f4[_0x4405('0x42')]=[{'all':!![]}];}_0x5468f4=_[_0x4405('0x3f')]({},_0x5468f4,_0x201175[_0x4405('0x41')]);return db[_0x4405('0x2e')][_0x4405('0x4a')](_0x5468f4)[_0x4405('0x24')](handleEntityNotFound(_0x52ebc8,null))[_0x4405('0x24')](respondWithResult(_0x52ebc8,null))['catch'](handleError(_0x52ebc8,null));};exports[_0x4405('0x4b')]=function(_0x3c0580,_0x3730bb){return db[_0x4405('0x2e')]['create'](_0x3c0580[_0x4405('0x4c')],{})[_0x4405('0x24')](function(_0x226b99){var _0x10ac15=_0x3c0580[_0x4405('0x4d')][_0x4405('0x4e')]({'plain':!![]});if(!_0x10ac15)throw new Error(_0x4405('0x4f'));if(_0x10ac15[_0x4405('0x50')]===_0x4405('0x4d')){var _0x1b8535=_0x226b99[_0x4405('0x4e')]({'plain':!![]});var _0xe58312=_0x4405('0x51');return db[_0x4405('0x52')]['find']({'where':{'name':_0xe58312,'userProfileId':_0x10ac15[_0x4405('0x53')]},'raw':!![]})[_0x4405('0x24')](function(_0x41566f){if(_0x41566f&&_0x41566f['autoAssociation']===0x0){return db['UserProfileResource'][_0x4405('0x4b')]({'name':_0x1b8535[_0x4405('0x2b')],'resourceId':_0x1b8535['id'],'type':'CustomReports','sectionId':_0x41566f['id']},{})['then'](function(){return _0x226b99;});}else{return _0x226b99;}})[_0x4405('0x45')](function(_0x26a04b){logger[_0x4405('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x26a04b);throw _0x26a04b;});}return _0x226b99;})[_0x4405('0x24')](respondWithResult(_0x3730bb,0xc9))['catch'](handleError(_0x3730bb,null));};exports['update']=function(_0x42adcf,_0x3cce1b){if(_0x42adcf[_0x4405('0x4c')]['id']){delete _0x42adcf[_0x4405('0x4c')]['id'];}return db[_0x4405('0x2e')][_0x4405('0x4a')]({'where':{'id':_0x42adcf[_0x4405('0x47')]['id']}})[_0x4405('0x24')](handleEntityNotFound(_0x3cce1b,null))['then'](saveUpdates(_0x42adcf['body'],null))['then'](respondWithResult(_0x3cce1b,null))[_0x4405('0x45')](handleError(_0x3cce1b,null));};exports[_0x4405('0x25')]=function(_0x3393a9,_0x130882){return db[_0x4405('0x2e')]['find']({'where':{'id':_0x3393a9['params']['id']}})[_0x4405('0x24')](handleEntityNotFound(_0x130882,null))[_0x4405('0x24')](removeEntity(_0x130882,null))[_0x4405('0x45')](handleError(_0x130882,null));};exports['preview']=function(_0x468847,_0x3bd209){var _0x1f11e6=0xa;var _0x4ed59b=[_0x4405('0x54'),'left_join',_0x4405('0x55'),_0x4405('0x56')];var _0xf83981={'SUM':_0x4405('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4405('0x58'),'MAX':_0x4405('0x59'),'MIN':_0x4405('0x5a'),'AVG':_0x4405('0x5b'),'GROUP_CONCAT':_0x4405('0x5c'),'GROUP_CONCAT ASC':_0x4405('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4b566a={'SEC_TO_TIME':_0x4405('0x5e'),'DATE':_0x4405('0x5f'),'HOUR':_0x4405('0x60'),'ROUND':_0x4405('0x61'),'UNIX_TIMESTAMP':_0x4405('0x62')};var _0x58cacf=function(_0x56c7f4){return!_[_0x4405('0x63')]([_0x4405('0x64'),'IS\x20NOT\x20NULL',_0x4405('0x65'),_0x4405('0x66')],_0x56c7f4);};var _0x1f5842=function(_0x4336cd){if(!_0x4336cd||!_0x4336cd[_0x4405('0x67')][_0x4405('0x38')]){return'';}for(var _0x41e23b='(',_0x5d4df1=0x0;_0x5d4df1<_0x4336cd[_0x4405('0x67')]['length'];_0x5d4df1+=0x1){_0x5d4df1>0x0&&(_0x41e23b+='\x20'+_0x4336cd[_0x4405('0x68')]+'\x20');_0x41e23b+=_0x4336cd['rules'][_0x5d4df1]['group']?_0x1f5842(_0x4336cd[_0x4405('0x67')][_0x5d4df1]['group']):_0x4336cd[_0x4405('0x67')][_0x5d4df1][_0x4405('0x69')]+'\x20'+_0x4336cd[_0x4405('0x67')][_0x5d4df1]['condition']+(_0x58cacf(_0x4336cd[_0x4405('0x67')][_0x5d4df1][_0x4405('0x6a')])?'\x20'+_0x4336cd[_0x4405('0x67')][_0x5d4df1]['value']:'');}return _0x41e23b+')';};var _0x13736a={'where':{'id':_0x468847[_0x4405('0x47')]['id']}},_0x23868c,_0x4564a2,_0x4c3108,_0x46a52d,_0x5e821a;_0x13736a=_[_0x4405('0x3f')]({},_0x13736a,_0x468847[_0x4405('0x41')]);return db[_0x4405('0x2e')]['find'](_0x13736a)[_0x4405('0x24')](function(_0xb7bc48){if(_0xb7bc48){_0x23868c=_0xb7bc48;return _0xb7bc48[_0x4405('0x6b')]();}return null;})[_0x4405('0x24')](function(_0x36b412){if(_0x36b412){if(!_0x36b412['length']){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4564a2=_0x36b412;return db['AnalyticMetric'][_0x4405('0x43')]({'raw':!![]});}return null;})[_0x4405('0x24')](function(_0x1160dd){if(_0x1160dd){_0x4c3108=_['keyBy'](_0x1160dd,'id');var _0x1885d6;var _0x27a3fa=squel[_0x4405('0x6c')]();_0x27a3fa[_0x4405('0x6d')](_0x23868c[_0x4405('0x6e')]);for(var _0x463510=0x0;_0x463510<_0x4564a2[_0x4405('0x38')];_0x463510+=0x1){_0x1885d6=_0x4564a2[_0x463510][_0x4405('0x6f')]?_0x4c3108[_0x4564a2[_0x463510][_0x4405('0x6f')]]['metric']:_0x4564a2[_0x463510][_0x4405('0x69')];_0x1885d6=_0x4564a2[_0x463510][_0x4405('0x70')]?_[_0x4405('0x71')](_0xf83981[_0x4564a2[_0x463510]['function']],'%s',_0x1885d6):_0x1885d6;_0x1885d6=_0x4564a2[_0x463510][_0x4405('0x72')]?_['replace'](_0x4b566a[_0x4564a2[_0x463510][_0x4405('0x72')]],'%s',_0x1885d6):_0x1885d6;if(_0x4564a2[_0x463510][_0x4405('0x73')]){_0x27a3fa[_0x4405('0x74')](_0x1885d6);}_0x4564a2[_0x463510][_0x4405('0x75')]&&_0x27a3fa[_0x4405('0x3a')](_0x1885d6,_0x4564a2[_0x463510][_0x4405('0x75')]===_0x4405('0x76')?![]:!![]);_0x27a3fa[_0x4405('0x69')](_0x1885d6,_0x4564a2[_0x463510][_0x4405('0x77')]||_0x1885d6);}if(_0x23868c[_0x4405('0x78')]){_0x23868c[_0x4405('0x78')]=JSON[_0x4405('0x79')](_0x23868c[_0x4405('0x78')]);for(var _0x21ae41=0x0;_0x21ae41<_0x23868c['joins'][_0x4405('0x38')];_0x21ae41+=0x1){if(_0x23868c['joins'][_0x21ae41]['type']&&_[_0x4405('0x63')](_0x4ed59b,_0x23868c[_0x4405('0x78')][_0x21ae41][_0x4405('0x40')])&&_0x23868c['joins'][_0x21ae41][_0x4405('0x7a')]&&_0x23868c['joins'][_0x21ae41][_0x4405('0x7b')]&&_0x23868c['joins'][_0x21ae41]['foreignKey']){_0x27a3fa[_0x23868c[_0x4405('0x78')][_0x21ae41][_0x4405('0x40')]](_0x23868c[_0x4405('0x78')][_0x21ae41]['foreignTable'],null,util['format'](_0x4405('0x7c'),_0x23868c['table'],_0x23868c[_0x4405('0x78')][_0x21ae41][_0x4405('0x7a')],_0x23868c[_0x4405('0x78')][_0x21ae41]['foreignTable'],_0x23868c[_0x4405('0x78')][_0x21ae41][_0x4405('0x7d')]));}}}if(_0x23868c[_0x4405('0x7e')]){_0x23868c[_0x4405('0x7e')]=JSON[_0x4405('0x79')](_0x23868c[_0x4405('0x7e')]);_0x27a3fa[_0x4405('0x3c')](_0x1f5842(_0x23868c[_0x4405('0x7e')][_0x4405('0x74')]));}_0x5e821a=_0x27a3fa['clone']();_0x27a3fa[_0x4405('0x1d')](_0x1f11e6);_0x27a3fa['offset'](0x0);logger[_0x4405('0x7f')](_0x4405('0x80'),_0x27a3fa['toString']());return dbH['sequelize'][_0x4405('0x33')](_0x27a3fa[_0x4405('0x81')](),{'type':dbH['sequelize'][_0x4405('0x82')][_0x4405('0x83')]});}})[_0x4405('0x24')](respondWithResult(_0x3bd209,null))[_0x4405('0x45')](handleError(_0x3bd209,null));};function runReport(_0xc46973,_0x36fc07,_0x27d21d){var _0x2a0968=_0x36fc07[_0x4405('0x2b')];var _0x227f57=0xa;var _0x24de72=[_0x4405('0x54'),'left_join',_0x4405('0x55'),_0x4405('0x56')];var _0x25c5e3={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4405('0x58'),'MAX':'MAX(%s)','MIN':_0x4405('0x5a'),'AVG':_0x4405('0x5b'),'GROUP_CONCAT':_0x4405('0x5c'),'GROUP_CONCAT ASC':_0x4405('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3f1087={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4405('0x5f'),'HOUR':_0x4405('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4405('0x62')};var _0x4d22af=function(_0x2ab08f){return!_[_0x4405('0x63')]([_0x4405('0x64'),_0x4405('0x84'),_0x4405('0x65'),_0x4405('0x66')],_0x2ab08f);};var _0x4fe771=function(_0x1f0d08){if(!_0x1f0d08||!_0x1f0d08[_0x4405('0x67')][_0x4405('0x38')]){return'';}for(var _0xe6c11a='(',_0x17d030=0x0;_0x17d030<_0x1f0d08[_0x4405('0x67')][_0x4405('0x38')];_0x17d030+=0x1){_0x17d030>0x0&&(_0xe6c11a+='\x20'+_0x1f0d08['operator']+'\x20');_0xe6c11a+=_0x1f0d08['rules'][_0x17d030][_0x4405('0x74')]?_0x4fe771(_0x1f0d08[_0x4405('0x67')][_0x17d030][_0x4405('0x74')]):_0x1f0d08[_0x4405('0x67')][_0x17d030]['field']+'\x20'+_0x1f0d08[_0x4405('0x67')][_0x17d030][_0x4405('0x6a')]+(_0x4d22af(_0x1f0d08[_0x4405('0x67')][_0x17d030]['condition'])?'\x20'+_0x1f0d08[_0x4405('0x67')][_0x17d030][_0x4405('0x85')]:'');}return _0xe6c11a+')';};var _0x5426ef={'where':{'id':_0xc46973['id']}},_0x7b8664,_0x53c1b5,_0x3ce447,_0x21928a,_0x1b6fa8;_0x5426ef=_[_0x4405('0x3f')]({},_0x5426ef,_0x27d21d);return db['AnalyticCustomReport'][_0x4405('0x4a')](_0x5426ef)['then'](function(_0x24eacc){if(_0x24eacc){_0x7b8664=_0x24eacc;return _0x24eacc[_0x4405('0x6b')]();}return null;})[_0x4405('0x24')](function(_0x1c588b){if(_0x1c588b){if(!_0x1c588b[_0x4405('0x38')]){throw new db[(_0x4405('0x86'))]['ValidationErrorItem'](_0x4405('0x87'),0x193);}_0x53c1b5=_0x1c588b;return db[_0x4405('0x88')][_0x4405('0x43')]({'raw':!![]});}return null;})[_0x4405('0x24')](function(_0x153562){if(_0x153562){_0x3ce447=_[_0x4405('0x89')](_0x153562,'id');var _0x269132;var _0x527680=squel[_0x4405('0x6c')]();_0x527680[_0x4405('0x6d')](_0x7b8664['table']);for(var _0x28d4f0=0x0;_0x28d4f0<_0x53c1b5[_0x4405('0x38')];_0x28d4f0+=0x1){_0x269132=_0x53c1b5[_0x28d4f0][_0x4405('0x6f')]?_0x3ce447[_0x53c1b5[_0x28d4f0]['MetricId']][_0x4405('0x8a')]:_0x53c1b5[_0x28d4f0][_0x4405('0x69')];_0x269132=_0x53c1b5[_0x28d4f0][_0x4405('0x70')]?_[_0x4405('0x71')](_0x25c5e3[_0x53c1b5[_0x28d4f0][_0x4405('0x70')]],'%s',_0x269132):_0x269132;_0x269132=_0x53c1b5[_0x28d4f0][_0x4405('0x72')]?_[_0x4405('0x71')](_0x3f1087[_0x53c1b5[_0x28d4f0][_0x4405('0x72')]],'%s',_0x269132):_0x269132;if(_0x53c1b5[_0x28d4f0][_0x4405('0x73')]){_0x527680[_0x4405('0x74')](_0x269132);}_0x53c1b5[_0x28d4f0][_0x4405('0x75')]&&_0x527680[_0x4405('0x3a')](_0x269132,_0x53c1b5[_0x28d4f0][_0x4405('0x75')]==='DESC'?![]:!![]);_0x527680[_0x4405('0x69')](_0x269132,_0x53c1b5[_0x28d4f0]['alias']||_0x269132);}if(_0x7b8664['joins']){_0x7b8664[_0x4405('0x78')]=JSON['parse'](_0x7b8664[_0x4405('0x78')]);for(var _0x43e4b6=0x0;_0x43e4b6<_0x7b8664[_0x4405('0x78')]['length'];_0x43e4b6+=0x1){if(_0x7b8664[_0x4405('0x78')][_0x43e4b6][_0x4405('0x40')]&&_[_0x4405('0x63')](_0x24de72,_0x7b8664[_0x4405('0x78')][_0x43e4b6][_0x4405('0x40')])&&_0x7b8664[_0x4405('0x78')][_0x43e4b6][_0x4405('0x7a')]&&_0x7b8664[_0x4405('0x78')][_0x43e4b6]['foreignTable']&&_0x7b8664[_0x4405('0x78')][_0x43e4b6][_0x4405('0x7d')]){_0x527680[_0x7b8664[_0x4405('0x78')][_0x43e4b6][_0x4405('0x40')]](_0x7b8664[_0x4405('0x78')][_0x43e4b6]['foreignTable'],null,util[_0x4405('0x72')](_0x4405('0x7c'),_0x7b8664[_0x4405('0x6e')],_0x7b8664[_0x4405('0x78')][_0x43e4b6][_0x4405('0x7a')],_0x7b8664[_0x4405('0x78')][_0x43e4b6]['foreignTable'],_0x7b8664[_0x4405('0x78')][_0x43e4b6][_0x4405('0x7d')]));}}}if(_0x7b8664['conditions']){_0x7b8664[_0x4405('0x7e')]=JSON[_0x4405('0x79')](_0x7b8664['conditions']);_0x527680[_0x4405('0x3c')](_0x4fe771(_0x7b8664[_0x4405('0x7e')][_0x4405('0x74')]));}_0x1b6fa8=_0x527680['clone']();_0x527680['limit'](_0x227f57);_0x527680[_0x4405('0x1c')](0x0);return;}})['then'](function(){if(_0x36fc07[_0x4405('0x8b')]==='web'){return null;}var _0x1b2991=_[_0x4405('0x3f')](_0x36fc07,{'name':_0x36fc07[_0x4405('0x8c')]||_0x36fc07[_0x4405('0x2b')]||_0x7b8664[_0x4405('0x2b')],'basename':_0x2a0968,'savename':util['format']('%s-%s.%s',_0x36fc07[_0x4405('0x2b')]||_0x7b8664['name'],require(_0x4405('0x8d'))[_0x4405('0x8e')](0x4),_0x36fc07[_0x4405('0x8b')]||_0x4405('0x8f')),'reportId':_0x7b8664['id'],'reportType':_0x4405('0x90')});return db[_0x4405('0x91')][_0x4405('0x4b')](_0x1b2991,{'raw':!![]});})[_0x4405('0x24')](function(_0x153048){if(_0x7b8664[_0x4405('0x6e')]===_0x4405('0x92')){_0x1b6fa8[_0x4405('0x3c')](_0x7b8664['table']+_0x4405('0x93'),_0x36fc07['startDate'],_0x36fc07[_0x4405('0x94')]);}else{_0x1b6fa8[_0x4405('0x3c')](_0x7b8664['table']+_0x4405('0x95'),_0x36fc07['startDate'],_0x36fc07['endDate']);}if(_0x153048){logger[_0x4405('0x96')](_0x4405('0x97'),_0x1b6fa8[_0x4405('0x81')]());require(_0x4405('0x98'))[_0x4405('0x99')](path['join'](__dirname,_0x4405('0x9a'),_0x153048[_0x4405('0x8b')]),[_0x153048['id'],_0x1b6fa8['toString'](),path[_0x4405('0x54')](__dirname,_0x4405('0x9b'),_0x153048[_0x4405('0x9c')]),_0x2a0968]);return _0x153048;}else{var _0x3b51b9=squel['select']();_0x3b51b9[_0x4405('0x6d')]('('+_0x1b6fa8[_0x4405('0x81')]()+')',_0x4405('0x9d'));_0x3b51b9[_0x4405('0x69')](_0x4405('0x9e'),_0x4405('0x1b'));_0x1b6fa8[_0x4405('0x1d')](_0x36fc07[_0x4405('0x1d')]||_0x227f57);_0x1b6fa8[_0x4405('0x1c')](_0x36fc07[_0x4405('0x1c')]||0x0);return dbH['sequelize'][_0x4405('0x33')](_0x3b51b9[_0x4405('0x81')](),{'type':dbH[_0x4405('0x9f')]['QueryTypes'][_0x4405('0x83')]})[_0x4405('0x24')](function(_0x329432){if(!_0x329432[_0x4405('0x38')]){_0x21928a=0x0;}else{_0x21928a=_0x329432[0x0][_0x4405('0x1b')]||0x0;}return dbH['sequelize'][_0x4405('0x33')](_0x1b6fa8['toString'](),{'type':dbH[_0x4405('0x9f')][_0x4405('0x82')][_0x4405('0x83')]});})['then'](function(_0x50d35d){return{'rows':_0x50d35d||[],'count':_0x21928a};});}});}exports['run']=function(_0x248df6,_0x403df6){return runReport(_0x248df6[_0x4405('0x47')],_0x248df6[_0x4405('0x33')],_0x248df6[_0x4405('0x41')])['then'](respondWithResult(_0x403df6,null))[_0x4405('0x45')](handleError(_0x403df6,null));};exports[_0x4405('0xa0')]=runReport;exports[_0x4405('0x33')]=function(_0x475a1c,_0x33366e){var _0x1fba62=0xa;var _0x40256a=[_0x4405('0x54'),_0x4405('0xa1'),_0x4405('0x55'),'cross_join'];var _0x280589={'SUM':_0x4405('0x57'),'COUNT':_0x4405('0xa2'),'COUNT DISTINCT':_0x4405('0x58'),'MAX':_0x4405('0x59'),'MIN':_0x4405('0x5a'),'AVG':_0x4405('0x5b'),'GROUP_CONCAT':_0x4405('0x5c'),'GROUP_CONCAT ASC':_0x4405('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xa84cbf={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4405('0x5f'),'HOUR':_0x4405('0x60'),'ROUND':_0x4405('0x61'),'UNIX_TIMESTAMP':_0x4405('0x62')};var _0xffdaca=function(_0x4b00bc){return!_['includes']([_0x4405('0x64'),_0x4405('0x84'),'IS\x20EMPTY',_0x4405('0x66')],_0x4b00bc);};var _0x348697=function(_0x366e0d){if(!_0x366e0d||!_0x366e0d['rules'][_0x4405('0x38')]){return'';}for(var _0x3cf1c6='(',_0x4baccc=0x0;_0x4baccc<_0x366e0d[_0x4405('0x67')]['length'];_0x4baccc+=0x1){_0x4baccc>0x0&&(_0x3cf1c6+='\x20'+_0x366e0d[_0x4405('0x68')]+'\x20');_0x3cf1c6+=_0x366e0d['rules'][_0x4baccc][_0x4405('0x74')]?_0x348697(_0x366e0d['rules'][_0x4baccc][_0x4405('0x74')]):_0x366e0d['rules'][_0x4baccc][_0x4405('0x69')]+'\x20'+_0x366e0d[_0x4405('0x67')][_0x4baccc]['condition']+(_0xffdaca(_0x366e0d[_0x4405('0x67')][_0x4baccc][_0x4405('0x6a')])?'\x20'+_0x366e0d[_0x4405('0x67')][_0x4baccc][_0x4405('0x85')]:'');}return _0x3cf1c6+')';};var _0x362227={'where':{'id':_0x475a1c['params']['id']}},_0x243edf,_0x2a62b2,_0x794fd2,_0x2a145c,_0x4e6538;_0x362227=_[_0x4405('0x3f')]({},_0x362227,_0x475a1c[_0x4405('0x41')]);return db['AnalyticCustomReport'][_0x4405('0x4a')](_0x362227)[_0x4405('0x24')](function(_0x412aca){if(_0x412aca){_0x243edf=_0x412aca;return _0x412aca[_0x4405('0x6b')]();}return null;})[_0x4405('0x24')](function(_0x31c436){if(_0x31c436){if(!_0x31c436['length']){throw new db[(_0x4405('0x86'))][(_0x4405('0xa3'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2a62b2=_0x31c436;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4405('0x24')](function(_0x436e7b){if(_0x436e7b){_0x794fd2=_[_0x4405('0x89')](_0x436e7b,'id');var _0x53417b;var _0x3da974=squel[_0x4405('0x6c')]();_0x3da974[_0x4405('0x6d')](_0x243edf[_0x4405('0x6e')]);for(var _0x8eafe=0x0;_0x8eafe<_0x2a62b2[_0x4405('0x38')];_0x8eafe+=0x1){_0x53417b=_0x2a62b2[_0x8eafe][_0x4405('0x6f')]?_0x794fd2[_0x2a62b2[_0x8eafe]['MetricId']][_0x4405('0x8a')]:_0x2a62b2[_0x8eafe]['field'];_0x53417b=_0x2a62b2[_0x8eafe]['function']?_[_0x4405('0x71')](_0x280589[_0x2a62b2[_0x8eafe][_0x4405('0x70')]],'%s',_0x53417b):_0x53417b;_0x53417b=_0x2a62b2[_0x8eafe][_0x4405('0x72')]?_[_0x4405('0x71')](_0xa84cbf[_0x2a62b2[_0x8eafe][_0x4405('0x72')]],'%s',_0x53417b):_0x53417b;if(_0x2a62b2[_0x8eafe][_0x4405('0x73')]){_0x3da974[_0x4405('0x74')](_0x53417b);}_0x2a62b2[_0x8eafe][_0x4405('0x75')]&&_0x3da974[_0x4405('0x3a')](_0x53417b,_0x2a62b2[_0x8eafe][_0x4405('0x75')]===_0x4405('0x76')?![]:!![]);_0x3da974[_0x4405('0x69')](_0x53417b,_0x2a62b2[_0x8eafe][_0x4405('0x77')]||_0x53417b);}if(_0x243edf[_0x4405('0x78')]){_0x243edf[_0x4405('0x78')]=JSON[_0x4405('0x79')](_0x243edf[_0x4405('0x78')]);for(var _0x491210=0x0;_0x491210<_0x243edf[_0x4405('0x78')][_0x4405('0x38')];_0x491210+=0x1){if(_0x243edf[_0x4405('0x78')][_0x491210][_0x4405('0x40')]&&_[_0x4405('0x63')](_0x40256a,_0x243edf['joins'][_0x491210]['type'])&&_0x243edf[_0x4405('0x78')][_0x491210]['parentKey']&&_0x243edf['joins'][_0x491210][_0x4405('0x7b')]&&_0x243edf['joins'][_0x491210][_0x4405('0x7d')]){_0x3da974[_0x243edf[_0x4405('0x78')][_0x491210][_0x4405('0x40')]](_0x243edf[_0x4405('0x78')][_0x491210]['foreignTable'],null,util[_0x4405('0x72')](_0x4405('0x7c'),_0x243edf[_0x4405('0x6e')],_0x243edf[_0x4405('0x78')][_0x491210][_0x4405('0x7a')],_0x243edf[_0x4405('0x78')][_0x491210]['foreignTable'],_0x243edf[_0x4405('0x78')][_0x491210][_0x4405('0x7d')]));}}}if(_0x243edf[_0x4405('0x7e')]){_0x243edf[_0x4405('0x7e')]=JSON[_0x4405('0x79')](_0x243edf[_0x4405('0x7e')]);_0x3da974[_0x4405('0x3c')](_0x348697(_0x243edf[_0x4405('0x7e')][_0x4405('0x74')]));}_0x4e6538=_0x3da974[_0x4405('0xa4')]();_0x3da974[_0x4405('0x1d')](_0x1fba62);_0x3da974['offset'](0x0);logger['debug'](_0x4405('0x80'),_0x3da974[_0x4405('0x81')]());return dbH['sequelize'][_0x4405('0x33')](_0x3da974['toString'](),{'type':dbH[_0x4405('0x9f')][_0x4405('0x82')][_0x4405('0x83')]});}})[_0x4405('0x24')](function(){return{'sql':_0x4e6538[_0x4405('0x81')]()};})['then'](respondWithResult(_0x33366e,null))[_0x4405('0x45')](handleError(_0x33366e,null));};
\ No newline at end of file
+var _0x2ada=['AnalyticMetric','table','MetricId','metric','function','replace','format','groupBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','right_join','cross_join','COUNT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20EMPTY','operator','keyBy','select','orderBy','output','fullPath','%s-%s.%s','randomstring','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','savename','from','countTable','COUNT(*)','run','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','crypto','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticCustomReport','include','findAll','rows','catch','params','rawAttributes','length','includeAll','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field'];(function(_0x59a284,_0x28c308){var _0x3de2cf=function(_0x1bd4bf){while(--_0x1bd4bf){_0x59a284['push'](_0x59a284['shift']());}};_0x3de2cf(++_0x28c308);}(_0x2ada,0xda));var _0xa2ad=function(_0x377f50,_0x5589ba){_0x377f50=_0x377f50-0x0;var _0x14a9d2=_0x2ada[_0x377f50];return _0x14a9d2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa2ad('0x0'));var rimraf=require(_0xa2ad('0x1'));var zipdir=require(_0xa2ad('0x2'));var jsonpatch=require(_0xa2ad('0x3'));var rp=require(_0xa2ad('0x4'));var moment=require(_0xa2ad('0x5'));var BPromise=require(_0xa2ad('0x6'));var Mustache=require('mustache');var util=require(_0xa2ad('0x7'));var path=require('path');var sox=require(_0xa2ad('0x8'));var csv=require('to-csv');var ejs=require(_0xa2ad('0x9'));var fs=require('fs');var fs_extra=require(_0xa2ad('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa2ad('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa2ad('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa2ad('0xd'));var hardwareService=require(_0xa2ad('0xe'));var logger=require(_0xa2ad('0xf'))(_0xa2ad('0x10'));var utils=require(_0xa2ad('0x11'));var config=require(_0xa2ad('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xa2ad('0x13'))['db'];var dbH=require(_0xa2ad('0x13'))['dbH'];function respondWithStatusCode(_0x48c972,_0x3affb4){_0x3affb4=_0x3affb4||0xcc;return function(_0x2c1a73){if(_0x2c1a73){return _0x48c972[_0xa2ad('0x14')](_0x3affb4);}return _0x48c972[_0xa2ad('0x15')](_0x3affb4)[_0xa2ad('0x16')]();};}function respondWithResult(_0x97a2b9,_0x5c6883){_0x5c6883=_0x5c6883||0xc8;return function(_0x4a20df){if(_0x4a20df){return _0x97a2b9['status'](_0x5c6883)['json'](_0x4a20df);}};}function respondWithFilteredResult(_0x52a559,_0x524f){return function(_0x1f0fab){if(_0x1f0fab){var _0x3ae5ec=_0x1f0fab[_0xa2ad('0x17')],_0x4399b8=_0x524f[_0xa2ad('0x18')],_0x576575=_0x524f[_0xa2ad('0x18')]+_0x524f[_0xa2ad('0x19')],_0x1e2ac4;if(_0x576575>=_0x3ae5ec){_0x576575=_0x3ae5ec;_0x1e2ac4=0xc8;}else{_0x1e2ac4=0xce;}_0x52a559[_0xa2ad('0x15')](_0x1e2ac4);return _0x52a559[_0xa2ad('0x1a')](_0xa2ad('0x1b'),_0x4399b8+'-'+_0x576575+'/'+_0x3ae5ec)[_0xa2ad('0x1c')](_0x1f0fab);}return null;};}function patchUpdates(_0x5ec712){return function(_0x20ca9e){try{jsonpatch[_0xa2ad('0x1d')](_0x20ca9e,_0x5ec712,!![]);}catch(_0x4e578d){return BPromise[_0xa2ad('0x1e')](_0x4e578d);}return _0x20ca9e[_0xa2ad('0x1f')]();};}function saveUpdates(_0x4bed25,_0x5ef96b){return function(_0x5e3748){if(_0x5e3748){return _0x5e3748[_0xa2ad('0x20')](_0x4bed25)[_0xa2ad('0x21')](function(_0x180c61){return _0x180c61;});}return null;};}function removeEntity(_0x5675fa,_0x1f15ef){return function(_0x4d7830){if(_0x4d7830){return _0x4d7830[_0xa2ad('0x22')]()[_0xa2ad('0x21')](function(){var _0x35adc7=_0x4d7830['get']({'plain':!![]});var _0x4379a1='CustomReports';return db['UserProfileResource']['destroy']({'where':{'type':_0x4379a1,'resourceId':_0x35adc7['id']}})[_0xa2ad('0x21')](function(){return _0x4d7830;});})['then'](function(){_0x5675fa[_0xa2ad('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x496c84,_0x4e7440){return function(_0x3264a5){if(!_0x3264a5){_0x496c84[_0xa2ad('0x14')](0x194);}return _0x3264a5;};}function handleError(_0xf2a54f,_0x4e38ca){_0x4e38ca=_0x4e38ca||0x1f4;return function(_0xfde6e9){logger['error'](_0xfde6e9[_0xa2ad('0x23')]);if(_0xfde6e9[_0xa2ad('0x24')]){delete _0xfde6e9[_0xa2ad('0x24')];}_0xf2a54f['status'](_0x4e38ca)[_0xa2ad('0x25')](_0xfde6e9);};}exports[_0xa2ad('0x26')]=function(_0xee4fd3,_0x1b5ff4){var _0x270ec6={},_0x3757b6={},_0x47f5b3={'count':0x0,'rows':[]};var _0x1c0a34=_['map'](db['AnalyticCustomReport']['rawAttributes'],function(_0x354d90){return{'name':_0x354d90[_0xa2ad('0x27')],'type':_0x354d90[_0xa2ad('0x28')][_0xa2ad('0x29')]};});_0x3757b6[_0xa2ad('0x2a')]=_[_0xa2ad('0x2b')](_0x1c0a34,'name');_0x3757b6[_0xa2ad('0x2c')]=_[_0xa2ad('0x2d')](_0xee4fd3[_0xa2ad('0x2c')]);_0x3757b6[_0xa2ad('0x2e')]=_['intersection'](_0x3757b6[_0xa2ad('0x2a')],_0x3757b6[_0xa2ad('0x2c')]);_0x270ec6['attributes']=_[_0xa2ad('0x2f')](_0x3757b6['model'],qs[_0xa2ad('0x30')](_0xee4fd3[_0xa2ad('0x2c')][_0xa2ad('0x30')]));_0x270ec6[_0xa2ad('0x31')]=_0x270ec6[_0xa2ad('0x31')]['length']?_0x270ec6[_0xa2ad('0x31')]:_0x3757b6[_0xa2ad('0x2a')];if(!_0xee4fd3['query'][_0xa2ad('0x32')]('nolimit')){_0x270ec6[_0xa2ad('0x19')]=qs[_0xa2ad('0x19')](_0xee4fd3['query'][_0xa2ad('0x19')]);_0x270ec6['offset']=qs[_0xa2ad('0x18')](_0xee4fd3[_0xa2ad('0x2c')]['offset']);}_0x270ec6[_0xa2ad('0x33')]=qs[_0xa2ad('0x34')](_0xee4fd3[_0xa2ad('0x2c')][_0xa2ad('0x34')]);_0x270ec6[_0xa2ad('0x35')]=qs[_0xa2ad('0x2e')](_[_0xa2ad('0x36')](_0xee4fd3[_0xa2ad('0x2c')],_0x3757b6[_0xa2ad('0x2e')]),_0x1c0a34);if(_0xee4fd3[_0xa2ad('0x2c')][_0xa2ad('0x37')]){_0x270ec6[_0xa2ad('0x35')]=_[_0xa2ad('0x38')](_0x270ec6[_0xa2ad('0x35')],{'$or':_[_0xa2ad('0x2b')](_0x1c0a34,function(_0x4e455f){if(_0x4e455f[_0xa2ad('0x28')]!==_0xa2ad('0x39')){var _0x386cda={};_0x386cda[_0x4e455f[_0xa2ad('0x24')]]={'$like':'%'+_0xee4fd3[_0xa2ad('0x2c')][_0xa2ad('0x37')]+'%'};return _0x386cda;}})});}_0x270ec6=_['merge']({},_0x270ec6,_0xee4fd3[_0xa2ad('0x3a')]);var _0x2a829c={'where':_0x270ec6[_0xa2ad('0x35')]};return db[_0xa2ad('0x3b')][_0xa2ad('0x17')](_0x2a829c)[_0xa2ad('0x21')](function(_0x3fe629){_0x47f5b3['count']=_0x3fe629;if(_0xee4fd3[_0xa2ad('0x2c')]['includeAll']){_0x270ec6[_0xa2ad('0x3c')]=[{'all':!![]}];}return db[_0xa2ad('0x3b')][_0xa2ad('0x3d')](_0x270ec6);})['then'](function(_0x4179ff){_0x47f5b3[_0xa2ad('0x3e')]=_0x4179ff;return _0x47f5b3;})['then'](respondWithFilteredResult(_0x1b5ff4,_0x270ec6))[_0xa2ad('0x3f')](handleError(_0x1b5ff4,null));};exports['show']=function(_0x5ca31f,_0x65f868){var _0x1874f2={'raw':![],'where':{'id':_0x5ca31f[_0xa2ad('0x40')]['id']}},_0x4b1ebe={};_0x4b1ebe[_0xa2ad('0x2a')]=_[_0xa2ad('0x2d')](db[_0xa2ad('0x3b')][_0xa2ad('0x41')]);_0x4b1ebe[_0xa2ad('0x2c')]=_[_0xa2ad('0x2d')](_0x5ca31f['query']);_0x4b1ebe['filters']=_[_0xa2ad('0x2f')](_0x4b1ebe[_0xa2ad('0x2a')],_0x4b1ebe[_0xa2ad('0x2c')]);_0x1874f2[_0xa2ad('0x31')]=_[_0xa2ad('0x2f')](_0x4b1ebe[_0xa2ad('0x2a')],qs[_0xa2ad('0x30')](_0x5ca31f[_0xa2ad('0x2c')]['fields']));_0x1874f2['attributes']=_0x1874f2[_0xa2ad('0x31')][_0xa2ad('0x42')]?_0x1874f2[_0xa2ad('0x31')]:_0x4b1ebe[_0xa2ad('0x2a')];if(_0x5ca31f[_0xa2ad('0x2c')][_0xa2ad('0x43')]){_0x1874f2[_0xa2ad('0x3c')]=[{'all':!![]}];}_0x1874f2=_[_0xa2ad('0x38')]({},_0x1874f2,_0x5ca31f[_0xa2ad('0x3a')]);return db[_0xa2ad('0x3b')]['find'](_0x1874f2)['then'](handleEntityNotFound(_0x65f868,null))[_0xa2ad('0x21')](respondWithResult(_0x65f868,null))[_0xa2ad('0x3f')](handleError(_0x65f868,null));};exports['create']=function(_0x3453a3,_0x4f9e0e){return db[_0xa2ad('0x3b')][_0xa2ad('0x44')](_0x3453a3['body'],{})[_0xa2ad('0x21')](function(_0x82f27d){var _0x34a011=_0x3453a3[_0xa2ad('0x45')][_0xa2ad('0x46')]({'plain':!![]});if(!_0x34a011)throw new Error(_0xa2ad('0x47'));if(_0x34a011[_0xa2ad('0x48')]===_0xa2ad('0x45')){var _0x275c1e=_0x82f27d[_0xa2ad('0x46')]({'plain':!![]});var _0x371936=_0xa2ad('0x49');return db[_0xa2ad('0x4a')][_0xa2ad('0x4b')]({'where':{'name':_0x371936,'userProfileId':_0x34a011[_0xa2ad('0x4c')]},'raw':!![]})['then'](function(_0x4a0bb9){if(_0x4a0bb9&&_0x4a0bb9[_0xa2ad('0x4d')]===0x0){return db[_0xa2ad('0x4e')][_0xa2ad('0x44')]({'name':_0x275c1e['name'],'resourceId':_0x275c1e['id'],'type':_0xa2ad('0x4f'),'sectionId':_0x4a0bb9['id']},{})['then'](function(){return _0x82f27d;});}else{return _0x82f27d;}})['catch'](function(_0x19cfe1){logger['error'](_0xa2ad('0x50'),_0x19cfe1);throw _0x19cfe1;});}return _0x82f27d;})['then'](respondWithResult(_0x4f9e0e,0xc9))[_0xa2ad('0x3f')](handleError(_0x4f9e0e,null));};exports[_0xa2ad('0x20')]=function(_0x41a119,_0x1f12cb){if(_0x41a119[_0xa2ad('0x51')]['id']){delete _0x41a119[_0xa2ad('0x51')]['id'];}return db[_0xa2ad('0x3b')]['find']({'where':{'id':_0x41a119['params']['id']}})['then'](handleEntityNotFound(_0x1f12cb,null))[_0xa2ad('0x21')](saveUpdates(_0x41a119[_0xa2ad('0x51')],null))[_0xa2ad('0x21')](respondWithResult(_0x1f12cb,null))[_0xa2ad('0x3f')](handleError(_0x1f12cb,null));};exports[_0xa2ad('0x22')]=function(_0x5365bf,_0x8b3eb2){return db[_0xa2ad('0x3b')][_0xa2ad('0x4b')]({'where':{'id':_0x5365bf[_0xa2ad('0x40')]['id']}})[_0xa2ad('0x21')](handleEntityNotFound(_0x8b3eb2,null))[_0xa2ad('0x21')](removeEntity(_0x8b3eb2,null))[_0xa2ad('0x3f')](handleError(_0x8b3eb2,null));};exports[_0xa2ad('0x52')]=function(_0x19dcd7,_0x4a7e9a){var _0x2962a1=0xa;var _0x5cffa0=[_0xa2ad('0x53'),'left_join','right_join','cross_join'];var _0x18e776={'SUM':_0xa2ad('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xa2ad('0x55'),'MAX':_0xa2ad('0x56'),'MIN':_0xa2ad('0x57'),'AVG':_0xa2ad('0x58'),'GROUP_CONCAT':_0xa2ad('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x187281={'SEC_TO_TIME':_0xa2ad('0x5a'),'DATE':_0xa2ad('0x5b'),'HOUR':_0xa2ad('0x5c'),'ROUND':_0xa2ad('0x5d'),'UNIX_TIMESTAMP':_0xa2ad('0x5e')};var _0x5b423f=function(_0x47b179){return!_[_0xa2ad('0x5f')]([_0xa2ad('0x60'),_0xa2ad('0x61'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x47b179);};var _0x3dbd81=function(_0x20f659){if(!_0x20f659||!_0x20f659[_0xa2ad('0x62')][_0xa2ad('0x42')]){return'';}for(var _0x33e598='(',_0x5d6878=0x0;_0x5d6878<_0x20f659[_0xa2ad('0x62')][_0xa2ad('0x42')];_0x5d6878+=0x1){_0x5d6878>0x0&&(_0x33e598+='\x20'+_0x20f659['operator']+'\x20');_0x33e598+=_0x20f659['rules'][_0x5d6878][_0xa2ad('0x63')]?_0x3dbd81(_0x20f659[_0xa2ad('0x62')][_0x5d6878]['group']):_0x20f659[_0xa2ad('0x62')][_0x5d6878][_0xa2ad('0x64')]+'\x20'+_0x20f659[_0xa2ad('0x62')][_0x5d6878][_0xa2ad('0x65')]+(_0x5b423f(_0x20f659[_0xa2ad('0x62')][_0x5d6878]['condition'])?'\x20'+_0x20f659['rules'][_0x5d6878][_0xa2ad('0x66')]:'');}return _0x33e598+')';};var _0x52b693={'where':{'id':_0x19dcd7['params']['id']}},_0x5c0c19,_0x50b4f3,_0x310c1a,_0x461c4b,_0x3eb905;_0x52b693=_[_0xa2ad('0x38')]({},_0x52b693,_0x19dcd7[_0xa2ad('0x3a')]);return db[_0xa2ad('0x3b')][_0xa2ad('0x4b')](_0x52b693)[_0xa2ad('0x21')](function(_0x7c2345){if(_0x7c2345){_0x5c0c19=_0x7c2345;return _0x7c2345[_0xa2ad('0x67')]();}return null;})[_0xa2ad('0x21')](function(_0x125c8c){if(_0x125c8c){if(!_0x125c8c['length']){throw new db[(_0xa2ad('0x68'))]['ValidationErrorItem'](_0xa2ad('0x69'),0x193);}_0x50b4f3=_0x125c8c;return db[_0xa2ad('0x6a')][_0xa2ad('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x483b52){if(_0x483b52){_0x310c1a=_['keyBy'](_0x483b52,'id');var _0x11e6d3;var _0x2c5045=squel['select']();_0x2c5045['from'](_0x5c0c19[_0xa2ad('0x6b')]);for(var _0x3ed59e=0x0;_0x3ed59e<_0x50b4f3[_0xa2ad('0x42')];_0x3ed59e+=0x1){_0x11e6d3=_0x50b4f3[_0x3ed59e][_0xa2ad('0x6c')]?_0x310c1a[_0x50b4f3[_0x3ed59e][_0xa2ad('0x6c')]][_0xa2ad('0x6d')]:_0x50b4f3[_0x3ed59e][_0xa2ad('0x64')];_0x11e6d3=_0x50b4f3[_0x3ed59e][_0xa2ad('0x6e')]?_[_0xa2ad('0x6f')](_0x18e776[_0x50b4f3[_0x3ed59e]['function']],'%s',_0x11e6d3):_0x11e6d3;_0x11e6d3=_0x50b4f3[_0x3ed59e]['format']?_[_0xa2ad('0x6f')](_0x187281[_0x50b4f3[_0x3ed59e][_0xa2ad('0x70')]],'%s',_0x11e6d3):_0x11e6d3;if(_0x50b4f3[_0x3ed59e][_0xa2ad('0x71')]){_0x2c5045[_0xa2ad('0x63')](_0x11e6d3);}_0x50b4f3[_0x3ed59e]['orderBy']&&_0x2c5045['order'](_0x11e6d3,_0x50b4f3[_0x3ed59e]['orderBy']===_0xa2ad('0x72')?![]:!![]);_0x2c5045[_0xa2ad('0x64')](_0x11e6d3,_0x50b4f3[_0x3ed59e][_0xa2ad('0x73')]||_0x11e6d3);}if(_0x5c0c19[_0xa2ad('0x74')]){_0x5c0c19[_0xa2ad('0x74')]=JSON[_0xa2ad('0x75')](_0x5c0c19[_0xa2ad('0x74')]);for(var _0x15275d=0x0;_0x15275d<_0x5c0c19['joins']['length'];_0x15275d+=0x1){if(_0x5c0c19[_0xa2ad('0x74')][_0x15275d][_0xa2ad('0x28')]&&_[_0xa2ad('0x5f')](_0x5cffa0,_0x5c0c19['joins'][_0x15275d][_0xa2ad('0x28')])&&_0x5c0c19[_0xa2ad('0x74')][_0x15275d]['parentKey']&&_0x5c0c19[_0xa2ad('0x74')][_0x15275d][_0xa2ad('0x76')]&&_0x5c0c19['joins'][_0x15275d]['foreignKey']){_0x2c5045[_0x5c0c19['joins'][_0x15275d][_0xa2ad('0x28')]](_0x5c0c19[_0xa2ad('0x74')][_0x15275d][_0xa2ad('0x76')],null,util[_0xa2ad('0x70')](_0xa2ad('0x77'),_0x5c0c19[_0xa2ad('0x6b')],_0x5c0c19[_0xa2ad('0x74')][_0x15275d][_0xa2ad('0x78')],_0x5c0c19['joins'][_0x15275d][_0xa2ad('0x76')],_0x5c0c19['joins'][_0x15275d][_0xa2ad('0x79')]));}}}if(_0x5c0c19[_0xa2ad('0x7a')]){_0x5c0c19['conditions']=JSON[_0xa2ad('0x75')](_0x5c0c19[_0xa2ad('0x7a')]);_0x2c5045[_0xa2ad('0x35')](_0x3dbd81(_0x5c0c19[_0xa2ad('0x7a')]['group']));}_0x3eb905=_0x2c5045[_0xa2ad('0x7b')]();_0x2c5045[_0xa2ad('0x19')](_0x2962a1);_0x2c5045[_0xa2ad('0x18')](0x0);logger[_0xa2ad('0x7c')](_0xa2ad('0x7d'),_0x2c5045[_0xa2ad('0x7e')]());return dbH[_0xa2ad('0x7f')][_0xa2ad('0x2c')](_0x2c5045[_0xa2ad('0x7e')](),{'type':dbH['sequelize'][_0xa2ad('0x80')][_0xa2ad('0x81')]});}})[_0xa2ad('0x21')](respondWithResult(_0x4a7e9a,null))['catch'](handleError(_0x4a7e9a,null));};function runReport(_0x59947f,_0xdb894c,_0x57c6b3){var _0x3a4fbe=_0xdb894c[_0xa2ad('0x24')];var _0xf9814d=0xa;var _0x522451=[_0xa2ad('0x53'),_0xa2ad('0x82'),_0xa2ad('0x83'),_0xa2ad('0x84')];var _0x43b6a4={'SUM':'SUM(%s)','COUNT':_0xa2ad('0x85'),'COUNT DISTINCT':_0xa2ad('0x55'),'MAX':_0xa2ad('0x56'),'MIN':_0xa2ad('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xa2ad('0x59'),'GROUP_CONCAT ASC':_0xa2ad('0x86'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1b760c={'SEC_TO_TIME':_0xa2ad('0x5a'),'DATE':_0xa2ad('0x5b'),'HOUR':_0xa2ad('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xa2ad('0x5e')};var _0x114651=function(_0x5f4d6c){return!_[_0xa2ad('0x5f')]([_0xa2ad('0x60'),_0xa2ad('0x61'),_0xa2ad('0x87'),'IS\x20NOT\x20EMPTY'],_0x5f4d6c);};var _0x15750b=function(_0x34fa69){if(!_0x34fa69||!_0x34fa69[_0xa2ad('0x62')][_0xa2ad('0x42')]){return'';}for(var _0x509dbf='(',_0x46aeb5=0x0;_0x46aeb5<_0x34fa69['rules']['length'];_0x46aeb5+=0x1){_0x46aeb5>0x0&&(_0x509dbf+='\x20'+_0x34fa69[_0xa2ad('0x88')]+'\x20');_0x509dbf+=_0x34fa69[_0xa2ad('0x62')][_0x46aeb5][_0xa2ad('0x63')]?_0x15750b(_0x34fa69[_0xa2ad('0x62')][_0x46aeb5]['group']):_0x34fa69[_0xa2ad('0x62')][_0x46aeb5][_0xa2ad('0x64')]+'\x20'+_0x34fa69['rules'][_0x46aeb5][_0xa2ad('0x65')]+(_0x114651(_0x34fa69[_0xa2ad('0x62')][_0x46aeb5][_0xa2ad('0x65')])?'\x20'+_0x34fa69['rules'][_0x46aeb5][_0xa2ad('0x66')]:'');}return _0x509dbf+')';};var _0x4cc65f={'where':{'id':_0x59947f['id']}},_0x42fa98,_0x20017e,_0x32809b,_0xefc153,_0x485cfc;_0x4cc65f=_['merge']({},_0x4cc65f,_0x57c6b3);return db[_0xa2ad('0x3b')]['find'](_0x4cc65f)['then'](function(_0x49b315){if(_0x49b315){_0x42fa98=_0x49b315;return _0x49b315[_0xa2ad('0x67')]();}return null;})[_0xa2ad('0x21')](function(_0x4ad506){if(_0x4ad506){if(!_0x4ad506[_0xa2ad('0x42')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x20017e=_0x4ad506;return db[_0xa2ad('0x6a')][_0xa2ad('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x5b2852){if(_0x5b2852){_0x32809b=_[_0xa2ad('0x89')](_0x5b2852,'id');var _0x36f5f5;var _0x4b51c0=squel[_0xa2ad('0x8a')]();_0x4b51c0['from'](_0x42fa98[_0xa2ad('0x6b')]);for(var _0x4bd354=0x0;_0x4bd354<_0x20017e[_0xa2ad('0x42')];_0x4bd354+=0x1){_0x36f5f5=_0x20017e[_0x4bd354]['MetricId']?_0x32809b[_0x20017e[_0x4bd354]['MetricId']][_0xa2ad('0x6d')]:_0x20017e[_0x4bd354]['field'];_0x36f5f5=_0x20017e[_0x4bd354][_0xa2ad('0x6e')]?_[_0xa2ad('0x6f')](_0x43b6a4[_0x20017e[_0x4bd354][_0xa2ad('0x6e')]],'%s',_0x36f5f5):_0x36f5f5;_0x36f5f5=_0x20017e[_0x4bd354][_0xa2ad('0x70')]?_[_0xa2ad('0x6f')](_0x1b760c[_0x20017e[_0x4bd354][_0xa2ad('0x70')]],'%s',_0x36f5f5):_0x36f5f5;if(_0x20017e[_0x4bd354][_0xa2ad('0x71')]){_0x4b51c0[_0xa2ad('0x63')](_0x36f5f5);}_0x20017e[_0x4bd354][_0xa2ad('0x8b')]&&_0x4b51c0[_0xa2ad('0x33')](_0x36f5f5,_0x20017e[_0x4bd354][_0xa2ad('0x8b')]===_0xa2ad('0x72')?![]:!![]);_0x4b51c0[_0xa2ad('0x64')](_0x36f5f5,_0x20017e[_0x4bd354][_0xa2ad('0x73')]||_0x36f5f5);}if(_0x42fa98[_0xa2ad('0x74')]){_0x42fa98['joins']=JSON['parse'](_0x42fa98[_0xa2ad('0x74')]);for(var _0x21b397=0x0;_0x21b397<_0x42fa98[_0xa2ad('0x74')][_0xa2ad('0x42')];_0x21b397+=0x1){if(_0x42fa98[_0xa2ad('0x74')][_0x21b397][_0xa2ad('0x28')]&&_[_0xa2ad('0x5f')](_0x522451,_0x42fa98[_0xa2ad('0x74')][_0x21b397][_0xa2ad('0x28')])&&_0x42fa98['joins'][_0x21b397][_0xa2ad('0x78')]&&_0x42fa98[_0xa2ad('0x74')][_0x21b397][_0xa2ad('0x76')]&&_0x42fa98[_0xa2ad('0x74')][_0x21b397][_0xa2ad('0x79')]){_0x4b51c0[_0x42fa98[_0xa2ad('0x74')][_0x21b397][_0xa2ad('0x28')]](_0x42fa98[_0xa2ad('0x74')][_0x21b397][_0xa2ad('0x76')],null,util[_0xa2ad('0x70')](_0xa2ad('0x77'),_0x42fa98[_0xa2ad('0x6b')],_0x42fa98[_0xa2ad('0x74')][_0x21b397]['parentKey'],_0x42fa98[_0xa2ad('0x74')][_0x21b397]['foreignTable'],_0x42fa98[_0xa2ad('0x74')][_0x21b397][_0xa2ad('0x79')]));}}}if(_0x42fa98[_0xa2ad('0x7a')]){_0x42fa98[_0xa2ad('0x7a')]=JSON[_0xa2ad('0x75')](_0x42fa98['conditions']);_0x4b51c0['where'](_0x15750b(_0x42fa98[_0xa2ad('0x7a')][_0xa2ad('0x63')]));}_0x485cfc=_0x4b51c0[_0xa2ad('0x7b')]();_0x4b51c0['limit'](_0xf9814d);_0x4b51c0[_0xa2ad('0x18')](0x0);return;}})[_0xa2ad('0x21')](function(){if(_0xdb894c[_0xa2ad('0x8c')]==='web'){return null;}var _0x5ef42f=_['merge'](_0xdb894c,{'name':_0xdb894c[_0xa2ad('0x8d')]||_0xdb894c[_0xa2ad('0x24')]||_0x42fa98[_0xa2ad('0x24')],'basename':_0x3a4fbe,'savename':util[_0xa2ad('0x70')](_0xa2ad('0x8e'),_0xdb894c['name']||_0x42fa98['name'],require(_0xa2ad('0x8f'))['generate'](0x4),_0xdb894c[_0xa2ad('0x8c')]||_0xa2ad('0x90')),'reportId':_0x42fa98['id'],'reportType':_0xa2ad('0x91')});return db['AnalyticExtractedReport'][_0xa2ad('0x44')](_0x5ef42f,{'raw':!![]});})[_0xa2ad('0x21')](function(_0x53de66){if(_0x42fa98[_0xa2ad('0x6b')]===_0xa2ad('0x92')){_0x485cfc[_0xa2ad('0x35')](_0x42fa98[_0xa2ad('0x6b')]+_0xa2ad('0x93'),_0xdb894c['startDate'],_0xdb894c[_0xa2ad('0x94')]);}else{_0x485cfc['where'](_0x42fa98['table']+_0xa2ad('0x95'),_0xdb894c[_0xa2ad('0x96')],_0xdb894c[_0xa2ad('0x94')]);}if(_0x53de66){logger[_0xa2ad('0x97')](_0xa2ad('0x98'),_0x485cfc[_0xa2ad('0x7e')]());require(_0xa2ad('0x99'))[_0xa2ad('0x9a')](path['join'](__dirname,'../../components/export/',_0x53de66[_0xa2ad('0x8c')]),[_0x53de66['id'],_0x485cfc[_0xa2ad('0x7e')](),path[_0xa2ad('0x53')](__dirname,'../../files/reports',_0x53de66[_0xa2ad('0x9b')]),_0x3a4fbe]);return _0x53de66;}else{var _0x4765a3=squel[_0xa2ad('0x8a')]();_0x4765a3[_0xa2ad('0x9c')]('('+_0x485cfc[_0xa2ad('0x7e')]()+')',_0xa2ad('0x9d'));_0x4765a3[_0xa2ad('0x64')](_0xa2ad('0x9e'),_0xa2ad('0x17'));_0x485cfc[_0xa2ad('0x19')](_0xdb894c[_0xa2ad('0x19')]||_0xf9814d);_0x485cfc[_0xa2ad('0x18')](_0xdb894c[_0xa2ad('0x18')]||0x0);return dbH[_0xa2ad('0x7f')][_0xa2ad('0x2c')](_0x4765a3[_0xa2ad('0x7e')](),{'type':dbH['sequelize'][_0xa2ad('0x80')]['SELECT']})[_0xa2ad('0x21')](function(_0x3b9051){if(!_0x3b9051['length']){_0xefc153=0x0;}else{_0xefc153=_0x3b9051[0x0]['count']||0x0;}return dbH[_0xa2ad('0x7f')][_0xa2ad('0x2c')](_0x485cfc['toString'](),{'type':dbH['sequelize'][_0xa2ad('0x80')][_0xa2ad('0x81')]});})[_0xa2ad('0x21')](function(_0x34757a){return{'rows':_0x34757a||[],'count':_0xefc153};});}});}exports[_0xa2ad('0x9f')]=function(_0x425a4f,_0x361083){return runReport(_0x425a4f[_0xa2ad('0x40')],_0x425a4f['query'],_0x425a4f[_0xa2ad('0x3a')])[_0xa2ad('0x21')](respondWithResult(_0x361083,null))['catch'](handleError(_0x361083,null));};exports['runReport']=runReport;exports['query']=function(_0x1068d5,_0x156287){var _0x34e6a5=0xa;var _0x1ba373=[_0xa2ad('0x53'),_0xa2ad('0x82'),_0xa2ad('0x83'),_0xa2ad('0x84')];var _0x461868={'SUM':_0xa2ad('0x54'),'COUNT':_0xa2ad('0x85'),'COUNT DISTINCT':_0xa2ad('0x55'),'MAX':_0xa2ad('0x56'),'MIN':_0xa2ad('0x57'),'AVG':_0xa2ad('0x58'),'GROUP_CONCAT':_0xa2ad('0x59'),'GROUP_CONCAT ASC':_0xa2ad('0x86'),'GROUP_CONCAT DESC':_0xa2ad('0xa0')};var _0x1d7ccc={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xa2ad('0x5c'),'ROUND':_0xa2ad('0x5d'),'UNIX_TIMESTAMP':_0xa2ad('0x5e')};var _0x62130a=function(_0x4f20f7){return!_['includes'](['IS\x20NULL',_0xa2ad('0x61'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x4f20f7);};var _0x171530=function(_0x574895){if(!_0x574895||!_0x574895[_0xa2ad('0x62')][_0xa2ad('0x42')]){return'';}for(var _0x33b14f='(',_0x5855e2=0x0;_0x5855e2<_0x574895[_0xa2ad('0x62')][_0xa2ad('0x42')];_0x5855e2+=0x1){_0x5855e2>0x0&&(_0x33b14f+='\x20'+_0x574895[_0xa2ad('0x88')]+'\x20');_0x33b14f+=_0x574895[_0xa2ad('0x62')][_0x5855e2]['group']?_0x171530(_0x574895[_0xa2ad('0x62')][_0x5855e2][_0xa2ad('0x63')]):_0x574895[_0xa2ad('0x62')][_0x5855e2][_0xa2ad('0x64')]+'\x20'+_0x574895['rules'][_0x5855e2][_0xa2ad('0x65')]+(_0x62130a(_0x574895[_0xa2ad('0x62')][_0x5855e2][_0xa2ad('0x65')])?'\x20'+_0x574895[_0xa2ad('0x62')][_0x5855e2]['value']:'');}return _0x33b14f+')';};var _0x3c4d41={'where':{'id':_0x1068d5[_0xa2ad('0x40')]['id']}},_0x265bb5,_0x424b02,_0x2d2b8d,_0x4985ef,_0x316f4c;_0x3c4d41=_['merge']({},_0x3c4d41,_0x1068d5[_0xa2ad('0x3a')]);return db['AnalyticCustomReport'][_0xa2ad('0x4b')](_0x3c4d41)[_0xa2ad('0x21')](function(_0x1fb617){if(_0x1fb617){_0x265bb5=_0x1fb617;return _0x1fb617['getFields']();}return null;})[_0xa2ad('0x21')](function(_0x47a4f1){if(_0x47a4f1){if(!_0x47a4f1[_0xa2ad('0x42')]){throw new db[(_0xa2ad('0x68'))][(_0xa2ad('0xa1'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x424b02=_0x47a4f1;return db[_0xa2ad('0x6a')]['findAll']({'raw':!![]});}return null;})[_0xa2ad('0x21')](function(_0x9af25e){if(_0x9af25e){_0x2d2b8d=_[_0xa2ad('0x89')](_0x9af25e,'id');var _0x21a0fe;var _0x2098fe=squel[_0xa2ad('0x8a')]();_0x2098fe[_0xa2ad('0x9c')](_0x265bb5[_0xa2ad('0x6b')]);for(var _0xd905cd=0x0;_0xd905cd<_0x424b02['length'];_0xd905cd+=0x1){_0x21a0fe=_0x424b02[_0xd905cd][_0xa2ad('0x6c')]?_0x2d2b8d[_0x424b02[_0xd905cd][_0xa2ad('0x6c')]][_0xa2ad('0x6d')]:_0x424b02[_0xd905cd][_0xa2ad('0x64')];_0x21a0fe=_0x424b02[_0xd905cd][_0xa2ad('0x6e')]?_[_0xa2ad('0x6f')](_0x461868[_0x424b02[_0xd905cd][_0xa2ad('0x6e')]],'%s',_0x21a0fe):_0x21a0fe;_0x21a0fe=_0x424b02[_0xd905cd][_0xa2ad('0x70')]?_[_0xa2ad('0x6f')](_0x1d7ccc[_0x424b02[_0xd905cd][_0xa2ad('0x70')]],'%s',_0x21a0fe):_0x21a0fe;if(_0x424b02[_0xd905cd][_0xa2ad('0x71')]){_0x2098fe[_0xa2ad('0x63')](_0x21a0fe);}_0x424b02[_0xd905cd]['orderBy']&&_0x2098fe[_0xa2ad('0x33')](_0x21a0fe,_0x424b02[_0xd905cd][_0xa2ad('0x8b')]===_0xa2ad('0x72')?![]:!![]);_0x2098fe[_0xa2ad('0x64')](_0x21a0fe,_0x424b02[_0xd905cd][_0xa2ad('0x73')]||_0x21a0fe);}if(_0x265bb5[_0xa2ad('0x74')]){_0x265bb5[_0xa2ad('0x74')]=JSON[_0xa2ad('0x75')](_0x265bb5[_0xa2ad('0x74')]);for(var _0x5cd9a9=0x0;_0x5cd9a9<_0x265bb5['joins'][_0xa2ad('0x42')];_0x5cd9a9+=0x1){if(_0x265bb5['joins'][_0x5cd9a9]['type']&&_[_0xa2ad('0x5f')](_0x1ba373,_0x265bb5[_0xa2ad('0x74')][_0x5cd9a9]['type'])&&_0x265bb5[_0xa2ad('0x74')][_0x5cd9a9][_0xa2ad('0x78')]&&_0x265bb5[_0xa2ad('0x74')][_0x5cd9a9][_0xa2ad('0x76')]&&_0x265bb5['joins'][_0x5cd9a9][_0xa2ad('0x79')]){_0x2098fe[_0x265bb5[_0xa2ad('0x74')][_0x5cd9a9][_0xa2ad('0x28')]](_0x265bb5[_0xa2ad('0x74')][_0x5cd9a9][_0xa2ad('0x76')],null,util[_0xa2ad('0x70')](_0xa2ad('0x77'),_0x265bb5['table'],_0x265bb5[_0xa2ad('0x74')][_0x5cd9a9][_0xa2ad('0x78')],_0x265bb5[_0xa2ad('0x74')][_0x5cd9a9]['foreignTable'],_0x265bb5[_0xa2ad('0x74')][_0x5cd9a9]['foreignKey']));}}}if(_0x265bb5['conditions']){_0x265bb5['conditions']=JSON['parse'](_0x265bb5[_0xa2ad('0x7a')]);_0x2098fe[_0xa2ad('0x35')](_0x171530(_0x265bb5[_0xa2ad('0x7a')][_0xa2ad('0x63')]));}_0x316f4c=_0x2098fe['clone']();_0x2098fe[_0xa2ad('0x19')](_0x34e6a5);_0x2098fe['offset'](0x0);logger[_0xa2ad('0x7c')](_0xa2ad('0x7d'),_0x2098fe[_0xa2ad('0x7e')]());return dbH[_0xa2ad('0x7f')]['query'](_0x2098fe[_0xa2ad('0x7e')](),{'type':dbH[_0xa2ad('0x7f')][_0xa2ad('0x80')][_0xa2ad('0x81')]});}})[_0xa2ad('0x21')](function(){return{'sql':_0x316f4c['toString']()};})['then'](respondWithResult(_0x156287,null))[_0xa2ad('0x3f')](handleError(_0x156287,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index a759b8a..b26defa 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 _0x070c=['AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','moment','request-promise','path','exports','define'];(function(_0x2f7dca,_0x5bc814){var _0x485433=function(_0x5528b4){while(--_0x5528b4){_0x2f7dca['push'](_0x2f7dca['shift']());}};_0x485433(++_0x5bc814);}(_0x070c,0x1d8));var _0xc070=function(_0x501e54,_0x169ec1){_0x501e54=_0x501e54-0x0;var _0x448df8=_0x070c[_0x501e54];return _0x448df8;};'use strict';var _=require('lodash');var util=require(_0xc070('0x0'));var logger=require(_0xc070('0x1'))(_0xc070('0x2'));var moment=require(_0xc070('0x3'));var BPromise=require('bluebird');var rp=require(_0xc070('0x4'));var fs=require('fs');var path=require(_0xc070('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0xc070('0x6')]=function(_0x293941,_0x259e19){return _0x293941[_0xc070('0x7')](_0xc070('0x8'),attributes,{'tableName':_0xc070('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5fa2=['moment','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger'];(function(_0x1811e0,_0x487da0){var _0x3ce439=function(_0x1abaf6){while(--_0x1abaf6){_0x1811e0['push'](_0x1811e0['shift']());}};_0x3ce439(++_0x487da0);}(_0x5fa2,0xa3));var _0x25fa=function(_0x3fdedb,_0x57e373){_0x3fdedb=_0x3fdedb-0x0;var _0x492efe=_0x5fa2[_0x3fdedb];return _0x492efe;};'use strict';var _=require(_0x25fa('0x0'));var util=require('util');var logger=require(_0x25fa('0x1'))('api');var moment=require(_0x25fa('0x2'));var BPromise=require('bluebird');var rp=require(_0x25fa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25fa('0x4'));var config=require(_0x25fa('0x5'));var attributes=require(_0x25fa('0x6'));module[_0x25fa('0x7')]=function(_0x10e959,_0x13a0a2){return _0x10e959[_0x25fa('0x8')](_0x25fa('0x9'),attributes,{'tableName':_0x25fa('0xa'),'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 29c661a..6cbfb85 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 _0xdb25=['client','request','then','info','debug','request\x20sent','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x4bc314,_0x5ca486){var _0x3ef3e9=function(_0x2f3c73){while(--_0x2f3c73){_0x4bc314['push'](_0x4bc314['shift']());}};_0x3ef3e9(++_0x5ca486);}(_0xdb25,0x131));var _0x5db2=function(_0xcdc9a9,_0x1f7047){_0xcdc9a9=_0xcdc9a9-0x0;var _0x12a593=_0xdb25[_0xcdc9a9];return _0x12a593;};'use strict';var _=require(_0x5db2('0x0'));var util=require(_0x5db2('0x1'));var moment=require('moment');var BPromise=require(_0x5db2('0x2'));var rs=require(_0x5db2('0x3'));var fs=require('fs');var Redis=require(_0x5db2('0x4'));var db=require(_0x5db2('0x5'))['db'];var utils=require(_0x5db2('0x6'));var logger=require('../../config/logger')(_0x5db2('0x7'));var config=require(_0x5db2('0x8'));var jayson=require(_0x5db2('0x9'));var client=jayson[_0x5db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4affe6,_0x59c894,_0x146da4){return new BPromise(function(_0x5e36c0,_0x22720d){return client[_0x5db2('0xb')](_0x4affe6,_0x146da4)[_0x5db2('0xc')](function(_0x34db83){logger[_0x5db2('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x59c894,'request\x20sent');logger[_0x5db2('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x59c894,_0x5db2('0xf'),JSON['stringify'](_0x34db83));if(_0x34db83[_0x5db2('0x10')]){if(_0x34db83[_0x5db2('0x10')][_0x5db2('0x11')]===0x1f4){logger[_0x5db2('0x10')](_0x5db2('0x12'),_0x59c894,_0x34db83[_0x5db2('0x10')][_0x5db2('0x13')]);return _0x22720d(_0x34db83['error']['message']);}logger[_0x5db2('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x59c894,_0x34db83[_0x5db2('0x10')]['message']);return _0x5e36c0(_0x34db83[_0x5db2('0x10')][_0x5db2('0x13')]);}else{logger[_0x5db2('0xd')](_0x5db2('0x12'),_0x59c894,_0x5db2('0xf'));_0x5e36c0(_0x34db83[_0x5db2('0x14')]['message']);}})['catch'](function(_0x1019e2){logger[_0x5db2('0x10')](_0x5db2('0x12'),_0x59c894,_0x1019e2);_0x22720d(_0x1019e2);});});}
\ No newline at end of file
+var _0x09e4=['client','request','info','request\x20sent','debug','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x09e4,0x1f0));var _0x409e=function(_0x1c07f2,_0x3a720a){_0x1c07f2=_0x1c07f2-0x0;var _0x2bfc32=_0x09e4[_0x1c07f2];return _0x2bfc32;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x409e('0x0'));var BPromise=require(_0x409e('0x1'));var rs=require(_0x409e('0x2'));var fs=require('fs');var Redis=require(_0x409e('0x3'));var db=require(_0x409e('0x4'))['db'];var utils=require(_0x409e('0x5'));var logger=require(_0x409e('0x6'))(_0x409e('0x7'));var config=require(_0x409e('0x8'));var jayson=require(_0x409e('0x9'));var client=jayson[_0x409e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f7d48,_0x40108b,_0x5161a1){return new BPromise(function(_0x205e43,_0x28a60e){return client[_0x409e('0xb')](_0x2f7d48,_0x5161a1)['then'](function(_0x5c0caf){logger[_0x409e('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x40108b,_0x409e('0xd'));logger[_0x409e('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x40108b,'request\x20sent',JSON[_0x409e('0xf')](_0x5c0caf));if(_0x5c0caf['error']){if(_0x5c0caf[_0x409e('0x10')][_0x409e('0x11')]===0x1f4){logger[_0x409e('0x10')](_0x409e('0x12'),_0x40108b,_0x5c0caf[_0x409e('0x10')][_0x409e('0x13')]);return _0x28a60e(_0x5c0caf[_0x409e('0x10')][_0x409e('0x13')]);}logger[_0x409e('0x10')](_0x409e('0x12'),_0x40108b,_0x5c0caf[_0x409e('0x10')][_0x409e('0x13')]);return _0x205e43(_0x5c0caf[_0x409e('0x10')][_0x409e('0x13')]);}else{logger[_0x409e('0xc')](_0x409e('0x12'),_0x40108b,_0x409e('0xd'));_0x205e43(_0x5c0caf[_0x409e('0x14')][_0x409e('0x13')]);}})[_0x409e('0x15')](function(_0x18c303){logger[_0x409e('0x10')](_0x409e('0x12'),_0x40108b,_0x18c303);_0x28a60e(_0x18c303);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index fdd0450..f5166e8 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 _0x31ce=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','index','isAuthenticated','show','preview','/:id/run','query','post','/:id','update','delete','destroy','exports','multer'];(function(_0x1488cd,_0x25a893){var _0x63fa13=function(_0x57dd1c){while(--_0x57dd1c){_0x1488cd['push'](_0x1488cd['shift']());}};_0x63fa13(++_0x25a893);}(_0x31ce,0x99));var _0xe31c=function(_0x5b1aed,_0x322c17){_0x5b1aed=_0x5b1aed-0x0;var _0x26add8=_0x31ce[_0x5b1aed];return _0x26add8;};'use strict';var multer=require(_0xe31c('0x0'));var util=require(_0xe31c('0x1'));var path=require(_0xe31c('0x2'));var timeout=require('connect-timeout');var express=require(_0xe31c('0x3'));var router=express[_0xe31c('0x4')]();var fs_extra=require(_0xe31c('0x5'));var auth=require(_0xe31c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe31c('0x7'));var controller=require(_0xe31c('0x8'));router[_0xe31c('0x9')]('/',auth['isAuthenticated'](),controller[_0xe31c('0xa')]);router[_0xe31c('0x9')]('/:id',auth[_0xe31c('0xb')](),controller[_0xe31c('0xc')]);router[_0xe31c('0x9')]('/:id/preview',auth[_0xe31c('0xb')](),controller[_0xe31c('0xd')]);router['get'](_0xe31c('0xe'),auth[_0xe31c('0xb')](),controller['run']);router[_0xe31c('0x9')]('/:id/query',auth[_0xe31c('0xb')](),controller[_0xe31c('0xf')]);router[_0xe31c('0x10')]('/',auth[_0xe31c('0xb')](),controller['create']);router['put'](_0xe31c('0x11'),auth['isAuthenticated'](),controller[_0xe31c('0x12')]);router[_0xe31c('0x13')](_0xe31c('0x11'),auth[_0xe31c('0xb')](),controller[_0xe31c('0x14')]);module[_0xe31c('0x15')]=router;
\ No newline at end of file
+var _0x7e07=['/:id/run','run','/:id/query','post','put','update','delete','destroy','exports','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/preview','preview'];(function(_0x2a8860,_0x2da926){var _0x2f47a4=function(_0x3b7f54){while(--_0x3b7f54){_0x2a8860['push'](_0x2a8860['shift']());}};_0x2f47a4(++_0x2da926);}(_0x7e07,0x16e));var _0x77e0=function(_0x248e53,_0x123aca){_0x248e53=_0x248e53-0x0;var _0x3a75cb=_0x7e07[_0x248e53];return _0x3a75cb;};'use strict';var multer=require('multer');var util=require(_0x77e0('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x77e0('0x1'));var router=express['Router']();var fs_extra=require(_0x77e0('0x2'));var auth=require(_0x77e0('0x3'));var interaction=require(_0x77e0('0x4'));var config=require(_0x77e0('0x5'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0x77e0('0x6')](),controller[_0x77e0('0x7')]);router[_0x77e0('0x8')](_0x77e0('0x9'),auth[_0x77e0('0x6')](),controller['show']);router[_0x77e0('0x8')](_0x77e0('0xa'),auth[_0x77e0('0x6')](),controller[_0x77e0('0xb')]);router['get'](_0x77e0('0xc'),auth[_0x77e0('0x6')](),controller[_0x77e0('0xd')]);router['get'](_0x77e0('0xe'),auth[_0x77e0('0x6')](),controller['query']);router[_0x77e0('0xf')]('/',auth[_0x77e0('0x6')](),controller['create']);router[_0x77e0('0x10')](_0x77e0('0x9'),auth['isAuthenticated'](),controller[_0x77e0('0x11')]);router[_0x77e0('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x77e0('0x13')]);module[_0x77e0('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 6af507a..7db6c3b 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 _0x0406=['sequelize','STRING'];(function(_0x35edc7,_0x525a8c){var _0x5945bd=function(_0x1637b1){while(--_0x1637b1){_0x35edc7['push'](_0x35edc7['shift']());}};_0x5945bd(++_0x525a8c);}(_0x0406,0x1ba));var _0x6040=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0406[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x6040('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x6040('0x1')]},'parent':{'type':Sequelize[_0x6040('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x8a68=['sequelize','exports','STRING','TEXT'];(function(_0x2ac71a,_0x1d2a02){var _0x3ee904=function(_0x5c902a){while(--_0x5c902a){_0x2ac71a['push'](_0x2ac71a['shift']());}};_0x3ee904(++_0x1d2a02);}(_0x8a68,0x68));var _0x88a6=function(_0x5608fe,_0x699e8){_0x5608fe=_0x5608fe-0x0;var _0x1fb255=_0x8a68[_0x5608fe];return _0x1fb255;};'use strict';var Sequelize=require(_0x88a6('0x0'));module[_0x88a6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x88a6('0x2')]},'parent':{'type':Sequelize[_0x88a6('0x2')]},'table':{'type':Sequelize[_0x88a6('0x2')]},'conditions':{'type':Sequelize[_0x88a6('0x3')]},'joins':{'type':Sequelize[_0x88a6('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index ccd2631..2bacc7f 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 _0xd9cc=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','select','from','table','MetricId','replace','function','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','DATE(%s)','ROUND(%s)','IS\x20NOT\x20NULL','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','DESC','output','web','fullPath','%s-%s.%s','randomstring','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','savename','runReport','AVG(%s)','metric','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','count','offset','limit','set','apply','reject','save','update','then','get','DefaultReports','destroy','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query'];(function(_0x5acfbf,_0x5085bb){var _0x6b9bc=function(_0x1e1c52){while(--_0x1e1c52){_0x5acfbf['push'](_0x5acfbf['shift']());}};_0x6b9bc(++_0x5085bb);}(_0xd9cc,0x10b));var _0xcd9c=function(_0x110af0,_0x37d088){_0x110af0=_0x110af0-0x0;var _0x441b1c=_0xd9cc[_0x110af0];return _0x441b1c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcd9c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd9c('0x1'));var jsonpatch=require(_0xcd9c('0x2'));var rp=require(_0xcd9c('0x3'));var moment=require(_0xcd9c('0x4'));var BPromise=require(_0xcd9c('0x5'));var Mustache=require(_0xcd9c('0x6'));var util=require(_0xcd9c('0x7'));var path=require(_0xcd9c('0x8'));var sox=require('sox');var csv=require(_0xcd9c('0x9'));var ejs=require(_0xcd9c('0xa'));var fs=require('fs');var fs_extra=require(_0xcd9c('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcd9c('0xc'));var jsforce=require(_0xcd9c('0xd'));var deskjs=require(_0xcd9c('0xe'));var toCsv=require(_0xcd9c('0x9'));var querystring=require(_0xcd9c('0xf'));var Papa=require('papaparse');var Redis=require(_0xcd9c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcd9c('0x11'));var as=require(_0xcd9c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcd9c('0x13'));var utils=require(_0xcd9c('0x14'));var config=require(_0xcd9c('0x15'));var licenseUtil=require(_0xcd9c('0x16'));var db=require(_0xcd9c('0x17'))['db'];var dbH=require(_0xcd9c('0x17'))[_0xcd9c('0x18')];function respondWithStatusCode(_0x566e4d,_0x57fdce){_0x57fdce=_0x57fdce||0xcc;return function(_0x146103){if(_0x146103){return _0x566e4d[_0xcd9c('0x19')](_0x57fdce);}return _0x566e4d[_0xcd9c('0x1a')](_0x57fdce)[_0xcd9c('0x1b')]();};}function respondWithResult(_0x52671d,_0x51d1b0){_0x51d1b0=_0x51d1b0||0xc8;return function(_0x5d60b3){if(_0x5d60b3){return _0x52671d[_0xcd9c('0x1a')](_0x51d1b0)['json'](_0x5d60b3);}};}function respondWithFilteredResult(_0x46013a,_0xcfa0c){return function(_0x52c496){if(_0x52c496){var _0xb9ddd8=_0x52c496[_0xcd9c('0x1c')],_0x4dc5c1=_0xcfa0c[_0xcd9c('0x1d')],_0x4232b6=_0xcfa0c[_0xcd9c('0x1d')]+_0xcfa0c[_0xcd9c('0x1e')],_0x383b5d;if(_0x4232b6>=_0xb9ddd8){_0x4232b6=_0xb9ddd8;_0x383b5d=0xc8;}else{_0x383b5d=0xce;}_0x46013a[_0xcd9c('0x1a')](_0x383b5d);return _0x46013a[_0xcd9c('0x1f')]('Content-Range',_0x4dc5c1+'-'+_0x4232b6+'/'+_0xb9ddd8)['json'](_0x52c496);}return null;};}function patchUpdates(_0x57c160){return function(_0x549d3b){try{jsonpatch[_0xcd9c('0x20')](_0x549d3b,_0x57c160,!![]);}catch(_0x4a57f3){return BPromise[_0xcd9c('0x21')](_0x4a57f3);}return _0x549d3b[_0xcd9c('0x22')]();};}function saveUpdates(_0x1a77d2,_0x1fd9b3){return function(_0x3b49bb){if(_0x3b49bb){return _0x3b49bb[_0xcd9c('0x23')](_0x1a77d2)[_0xcd9c('0x24')](function(_0x2e60dc){return _0x2e60dc;});}return null;};}function removeEntity(_0x29eb15,_0x2a7c0f){return function(_0x4bc3b0){if(_0x4bc3b0){return _0x4bc3b0['destroy']()[_0xcd9c('0x24')](function(){var _0x24b12c=_0x4bc3b0[_0xcd9c('0x25')]({'plain':!![]});var _0x20b7ef=_0xcd9c('0x26');return db['UserProfileResource'][_0xcd9c('0x27')]({'where':{'type':_0x20b7ef,'resourceId':_0x24b12c['id']}})[_0xcd9c('0x24')](function(){return _0x4bc3b0;});})[_0xcd9c('0x24')](function(){_0x29eb15[_0xcd9c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd11fbf,_0x1e7c46){return function(_0x55203c){if(!_0x55203c){_0xd11fbf[_0xcd9c('0x19')](0x194);}return _0x55203c;};}function handleError(_0x43975f,_0x43433e){_0x43433e=_0x43433e||0x1f4;return function(_0x34fa60){logger[_0xcd9c('0x28')](_0x34fa60['stack']);if(_0x34fa60['name']){delete _0x34fa60[_0xcd9c('0x29')];}_0x43975f['status'](_0x43433e)[_0xcd9c('0x2a')](_0x34fa60);};}exports[_0xcd9c('0x2b')]=function(_0x3c8e2e,_0x2c7c6d){var _0x37f558={},_0x2f9d9b={},_0x11f3f9={'count':0x0,'rows':[]};var _0x4c40b9=_[_0xcd9c('0x2c')](db[_0xcd9c('0x2d')][_0xcd9c('0x2e')],function(_0x1946e0){return{'name':_0x1946e0['fieldName'],'type':_0x1946e0[_0xcd9c('0x2f')][_0xcd9c('0x30')]};});_0x2f9d9b[_0xcd9c('0x31')]=_[_0xcd9c('0x2c')](_0x4c40b9,_0xcd9c('0x29'));_0x2f9d9b[_0xcd9c('0x32')]=_[_0xcd9c('0x33')](_0x3c8e2e[_0xcd9c('0x32')]);_0x2f9d9b[_0xcd9c('0x34')]=_[_0xcd9c('0x35')](_0x2f9d9b[_0xcd9c('0x31')],_0x2f9d9b['query']);_0x37f558[_0xcd9c('0x36')]=_[_0xcd9c('0x35')](_0x2f9d9b[_0xcd9c('0x31')],qs[_0xcd9c('0x37')](_0x3c8e2e[_0xcd9c('0x32')][_0xcd9c('0x37')]));_0x37f558[_0xcd9c('0x36')]=_0x37f558[_0xcd9c('0x36')][_0xcd9c('0x38')]?_0x37f558['attributes']:_0x2f9d9b[_0xcd9c('0x31')];if(!_0x3c8e2e[_0xcd9c('0x32')][_0xcd9c('0x39')](_0xcd9c('0x3a'))){_0x37f558[_0xcd9c('0x1e')]=qs[_0xcd9c('0x1e')](_0x3c8e2e[_0xcd9c('0x32')][_0xcd9c('0x1e')]);_0x37f558['offset']=qs[_0xcd9c('0x1d')](_0x3c8e2e[_0xcd9c('0x32')]['offset']);}_0x37f558[_0xcd9c('0x3b')]=qs['sort'](_0x3c8e2e[_0xcd9c('0x32')]['sort']);_0x37f558[_0xcd9c('0x3c')]=qs['filters'](_[_0xcd9c('0x3d')](_0x3c8e2e['query'],_0x2f9d9b['filters']),_0x4c40b9);if(_0x3c8e2e[_0xcd9c('0x32')]['filter']){_0x37f558[_0xcd9c('0x3c')]=_[_0xcd9c('0x3e')](_0x37f558[_0xcd9c('0x3c')],{'$or':_[_0xcd9c('0x2c')](_0x4c40b9,function(_0x5482cf){if(_0x5482cf['type']!==_0xcd9c('0x3f')){var _0x176eb7={};_0x176eb7[_0x5482cf['name']]={'$like':'%'+_0x3c8e2e[_0xcd9c('0x32')][_0xcd9c('0x40')]+'%'};return _0x176eb7;}})});}_0x37f558=_[_0xcd9c('0x3e')]({},_0x37f558,_0x3c8e2e[_0xcd9c('0x41')]);var _0x406829={'where':_0x37f558[_0xcd9c('0x3c')]};return db['AnalyticDefaultReport'][_0xcd9c('0x1c')](_0x406829)[_0xcd9c('0x24')](function(_0x27dfbf){_0x11f3f9[_0xcd9c('0x1c')]=_0x27dfbf;if(_0x3c8e2e['query']['includeAll']){_0x37f558[_0xcd9c('0x42')]=[{'all':!![]}];}return db[_0xcd9c('0x2d')][_0xcd9c('0x43')](_0x37f558);})[_0xcd9c('0x24')](function(_0x1a5070){_0x11f3f9[_0xcd9c('0x44')]=_0x1a5070;return _0x11f3f9;})[_0xcd9c('0x24')](respondWithFilteredResult(_0x2c7c6d,_0x37f558))[_0xcd9c('0x45')](handleError(_0x2c7c6d,null));};exports['show']=function(_0x5bb134,_0x1de8fb){var _0x4a5268={'raw':!![],'where':{'id':_0x5bb134['params']['id']}},_0x13eb50={};_0x13eb50[_0xcd9c('0x31')]=_[_0xcd9c('0x33')](db[_0xcd9c('0x2d')]['rawAttributes']);_0x13eb50[_0xcd9c('0x32')]=_[_0xcd9c('0x33')](_0x5bb134[_0xcd9c('0x32')]);_0x13eb50[_0xcd9c('0x34')]=_[_0xcd9c('0x35')](_0x13eb50[_0xcd9c('0x31')],_0x13eb50['query']);_0x4a5268[_0xcd9c('0x36')]=_[_0xcd9c('0x35')](_0x13eb50[_0xcd9c('0x31')],qs[_0xcd9c('0x37')](_0x5bb134[_0xcd9c('0x32')][_0xcd9c('0x37')]));_0x4a5268[_0xcd9c('0x36')]=_0x4a5268[_0xcd9c('0x36')][_0xcd9c('0x38')]?_0x4a5268[_0xcd9c('0x36')]:_0x13eb50[_0xcd9c('0x31')];if(_0x5bb134[_0xcd9c('0x32')]['includeAll']){_0x4a5268[_0xcd9c('0x42')]=[{'all':!![]}];}_0x4a5268=_['merge']({},_0x4a5268,_0x5bb134[_0xcd9c('0x41')]);return db[_0xcd9c('0x2d')][_0xcd9c('0x46')](_0x4a5268)[_0xcd9c('0x24')](handleEntityNotFound(_0x1de8fb,null))[_0xcd9c('0x24')](respondWithResult(_0x1de8fb,null))[_0xcd9c('0x45')](handleError(_0x1de8fb,null));};exports[_0xcd9c('0x47')]=function(_0x1ddd0f,_0x454bb3){return db[_0xcd9c('0x2d')][_0xcd9c('0x47')](_0x1ddd0f[_0xcd9c('0x48')],{})[_0xcd9c('0x24')](function(_0x5301d3){var _0x330533=_0x1ddd0f[_0xcd9c('0x49')][_0xcd9c('0x25')]({'plain':!![]});if(!_0x330533)throw new Error(_0xcd9c('0x4a'));if(_0x330533[_0xcd9c('0x4b')]===_0xcd9c('0x49')){var _0x50337a=_0x5301d3['get']({'plain':!![]});var _0xd9f62a='Reports';return db[_0xcd9c('0x4c')][_0xcd9c('0x46')]({'where':{'name':_0xd9f62a,'userProfileId':_0x330533[_0xcd9c('0x4d')]},'raw':!![]})['then'](function(_0x4dbbbd){if(_0x4dbbbd&&_0x4dbbbd[_0xcd9c('0x4e')]===0x0){return db[_0xcd9c('0x4f')][_0xcd9c('0x47')]({'name':_0x50337a[_0xcd9c('0x29')],'resourceId':_0x50337a['id'],'type':_0xcd9c('0x26'),'sectionId':_0x4dbbbd['id']},{})[_0xcd9c('0x24')](function(){return _0x5301d3;});}else{return _0x5301d3;}})[_0xcd9c('0x45')](function(_0x40e556){logger[_0xcd9c('0x28')](_0xcd9c('0x50'),_0x40e556);throw _0x40e556;});}return _0x5301d3;})['then'](respondWithResult(_0x454bb3,0xc9))[_0xcd9c('0x45')](handleError(_0x454bb3,null));};exports[_0xcd9c('0x23')]=function(_0x23aedd,_0x4e27e0){if(_0x23aedd['body']['id']){delete _0x23aedd[_0xcd9c('0x48')]['id'];}return db['AnalyticDefaultReport']['find']({'where':{'id':_0x23aedd['params']['id']}})[_0xcd9c('0x24')](handleEntityNotFound(_0x4e27e0,null))[_0xcd9c('0x24')](saveUpdates(_0x23aedd[_0xcd9c('0x48')],null))[_0xcd9c('0x24')](respondWithResult(_0x4e27e0,null))[_0xcd9c('0x45')](handleError(_0x4e27e0,null));};exports[_0xcd9c('0x27')]=function(_0x97aa67,_0x45d5c9){return db[_0xcd9c('0x2d')][_0xcd9c('0x46')]({'where':{'id':_0x97aa67[_0xcd9c('0x51')]['id']}})['then'](handleEntityNotFound(_0x45d5c9,null))['then'](removeEntity(_0x45d5c9,null))[_0xcd9c('0x45')](handleError(_0x45d5c9,null));};exports['preview']=function(_0x2623fe,_0x1aff13){var _0xcc04e5=0xa;var _0x1dd395=[_0xcd9c('0x52'),_0xcd9c('0x53'),_0xcd9c('0x54'),_0xcd9c('0x55')];var _0x5c1311={'SUM':_0xcd9c('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcd9c('0x57'),'MAX':_0xcd9c('0x58'),'MIN':_0xcd9c('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xcd9c('0x5a'),'GROUP_CONCAT ASC':_0xcd9c('0x5b'),'GROUP_CONCAT DESC':_0xcd9c('0x5c')};var _0x3c965b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xcd9c('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xcd9c('0x5e')};var _0x3cc2ed=function(_0x38a518){return!_[_0xcd9c('0x5f')]([_0xcd9c('0x60'),'IS\x20NOT\x20NULL',_0xcd9c('0x61'),_0xcd9c('0x62')],_0x38a518);};var _0x262ce0=function(_0x342b0f){if(!_0x342b0f||!_0x342b0f[_0xcd9c('0x63')][_0xcd9c('0x38')]){return'';}for(var _0x57ab57='(',_0x32cff3=0x0;_0x32cff3<_0x342b0f[_0xcd9c('0x63')][_0xcd9c('0x38')];_0x32cff3+=0x1){_0x32cff3>0x0&&(_0x57ab57+='\x20'+_0x342b0f[_0xcd9c('0x64')]+'\x20');_0x57ab57+=_0x342b0f[_0xcd9c('0x63')][_0x32cff3][_0xcd9c('0x65')]?_0x262ce0(_0x342b0f[_0xcd9c('0x63')][_0x32cff3][_0xcd9c('0x65')]):_0x342b0f['rules'][_0x32cff3][_0xcd9c('0x66')]+'\x20'+_0x342b0f['rules'][_0x32cff3][_0xcd9c('0x67')]+(_0x3cc2ed(_0x342b0f[_0xcd9c('0x63')][_0x32cff3]['condition'])?'\x20'+_0x342b0f[_0xcd9c('0x63')][_0x32cff3][_0xcd9c('0x68')]:'');}return _0x57ab57+')';};var _0x20c184={'where':{'id':_0x2623fe[_0xcd9c('0x51')]['id']}},_0x3299c8,_0x3245c3,_0x101cd2,_0x1ff865,_0x5f54c2;_0x20c184=_[_0xcd9c('0x3e')]({},_0x20c184,_0x2623fe[_0xcd9c('0x41')]);return db[_0xcd9c('0x2d')][_0xcd9c('0x46')](_0x20c184)[_0xcd9c('0x24')](function(_0x387d78){if(_0x387d78){_0x3299c8=_0x387d78;return _0x387d78[_0xcd9c('0x69')]();}return null;})[_0xcd9c('0x24')](function(_0x5a12d0){if(_0x5a12d0){if(!_0x5a12d0[_0xcd9c('0x38')]){throw new db[(_0xcd9c('0x6a'))][(_0xcd9c('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3245c3=_0x5a12d0;return db[_0xcd9c('0x6c')]['findAll']({'raw':!![]});}return null;})[_0xcd9c('0x24')](function(_0x41f058){if(_0x41f058){_0x101cd2=_['keyBy'](_0x41f058,'id');var _0x2ef92e;var _0x2b3467=squel[_0xcd9c('0x6d')]();_0x2b3467[_0xcd9c('0x6e')](_0x3299c8[_0xcd9c('0x6f')]);for(var _0x3b1ba6=0x0;_0x3b1ba6<_0x3245c3['length'];_0x3b1ba6+=0x1){_0x2ef92e=_0x3245c3[_0x3b1ba6][_0xcd9c('0x70')]?_0x101cd2[_0x3245c3[_0x3b1ba6][_0xcd9c('0x70')]]['metric']:_0x3245c3[_0x3b1ba6][_0xcd9c('0x66')];_0x2ef92e=_0x3245c3[_0x3b1ba6]['function']?_[_0xcd9c('0x71')](_0x5c1311[_0x3245c3[_0x3b1ba6][_0xcd9c('0x72')]],'%s',_0x2ef92e):_0x2ef92e;_0x2ef92e=_0x3245c3[_0x3b1ba6][_0xcd9c('0x73')]?_[_0xcd9c('0x71')](_0x3c965b[_0x3245c3[_0x3b1ba6][_0xcd9c('0x73')]],'%s',_0x2ef92e):_0x2ef92e;if(_0x3245c3[_0x3b1ba6][_0xcd9c('0x74')]){_0x2b3467[_0xcd9c('0x65')](_0x2ef92e);}_0x3245c3[_0x3b1ba6][_0xcd9c('0x75')]&&_0x2b3467[_0xcd9c('0x3b')](_0x2ef92e,_0x3245c3[_0x3b1ba6][_0xcd9c('0x75')]==='DESC'?![]:!![]);_0x2b3467[_0xcd9c('0x66')](_0x2ef92e,_0x3245c3[_0x3b1ba6][_0xcd9c('0x76')]||_0x2ef92e);}if(_0x3299c8[_0xcd9c('0x77')]){_0x3299c8[_0xcd9c('0x77')]=JSON[_0xcd9c('0x78')](_0x3299c8[_0xcd9c('0x77')]);for(var _0x3e617c=0x0;_0x3e617c<_0x3299c8[_0xcd9c('0x77')]['length'];_0x3e617c+=0x1){if(_0x3299c8[_0xcd9c('0x77')][_0x3e617c][_0xcd9c('0x2f')]&&_[_0xcd9c('0x5f')](_0x1dd395,_0x3299c8[_0xcd9c('0x77')][_0x3e617c][_0xcd9c('0x2f')])&&_0x3299c8[_0xcd9c('0x77')][_0x3e617c][_0xcd9c('0x79')]&&_0x3299c8[_0xcd9c('0x77')][_0x3e617c]['foreignTable']&&_0x3299c8[_0xcd9c('0x77')][_0x3e617c][_0xcd9c('0x7a')]){_0x2b3467[_0x3299c8[_0xcd9c('0x77')][_0x3e617c][_0xcd9c('0x2f')]](_0x3299c8[_0xcd9c('0x77')][_0x3e617c][_0xcd9c('0x7b')],null,util[_0xcd9c('0x73')](_0xcd9c('0x7c'),_0x3299c8[_0xcd9c('0x6f')],_0x3299c8[_0xcd9c('0x77')][_0x3e617c][_0xcd9c('0x79')],_0x3299c8['joins'][_0x3e617c]['foreignTable'],_0x3299c8[_0xcd9c('0x77')][_0x3e617c][_0xcd9c('0x7a')]));}}}if(_0x3299c8[_0xcd9c('0x7d')]){_0x3299c8[_0xcd9c('0x7d')]=JSON['parse'](_0x3299c8['conditions']);_0x2b3467[_0xcd9c('0x3c')](_0x262ce0(_0x3299c8[_0xcd9c('0x7d')][_0xcd9c('0x65')]));}_0x5f54c2=_0x2b3467[_0xcd9c('0x7e')]();_0x2b3467[_0xcd9c('0x1e')](_0xcc04e5);_0x2b3467['offset'](0x0);logger[_0xcd9c('0x7f')](_0xcd9c('0x80'),_0x2b3467[_0xcd9c('0x81')]());return dbH[_0xcd9c('0x82')][_0xcd9c('0x32')](_0x2b3467[_0xcd9c('0x81')](),{'type':dbH[_0xcd9c('0x82')][_0xcd9c('0x83')][_0xcd9c('0x84')]});}})['then'](respondWithResult(_0x1aff13,null))['catch'](handleError(_0x1aff13,null));};function runReport(_0x2ed1e6,_0x3a69b5,_0x455de4){var _0x9fe0ce=_0x3a69b5['name'];var _0x47e87a=0xa;var _0x4f4af7=[_0xcd9c('0x52'),'left_join',_0xcd9c('0x54'),_0xcd9c('0x55')];var _0xfa2f5a={'SUM':_0xcd9c('0x56'),'COUNT':_0xcd9c('0x85'),'COUNT DISTINCT':_0xcd9c('0x57'),'MAX':_0xcd9c('0x58'),'MIN':_0xcd9c('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xcd9c('0x5a'),'GROUP_CONCAT ASC':_0xcd9c('0x5b'),'GROUP_CONCAT DESC':_0xcd9c('0x5c')};var _0x33422d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xcd9c('0x86'),'HOUR':_0xcd9c('0x5d'),'ROUND':_0xcd9c('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x428d81=function(_0x52ba59){return!_[_0xcd9c('0x5f')](['IS\x20NULL',_0xcd9c('0x88'),_0xcd9c('0x61'),_0xcd9c('0x62')],_0x52ba59);};var _0x59ed60=function(_0x48211f){if(!_0x48211f||!_0x48211f[_0xcd9c('0x63')][_0xcd9c('0x38')]){return'';}for(var _0x5c9d89='(',_0x1dbbf9=0x0;_0x1dbbf9<_0x48211f['rules'][_0xcd9c('0x38')];_0x1dbbf9+=0x1){_0x1dbbf9>0x0&&(_0x5c9d89+='\x20'+_0x48211f[_0xcd9c('0x64')]+'\x20');_0x5c9d89+=_0x48211f['rules'][_0x1dbbf9][_0xcd9c('0x65')]?_0x59ed60(_0x48211f[_0xcd9c('0x63')][_0x1dbbf9]['group']):_0x48211f['rules'][_0x1dbbf9][_0xcd9c('0x66')]+'\x20'+_0x48211f['rules'][_0x1dbbf9]['condition']+(_0x428d81(_0x48211f[_0xcd9c('0x63')][_0x1dbbf9]['condition'])?'\x20'+_0x48211f['rules'][_0x1dbbf9]['value']:'');}return _0x5c9d89+')';};var _0x598786={'where':{'id':_0x2ed1e6['id']}},_0xcec500,_0x1479ee,_0x418d42,_0x46c5a4,_0x5a4eb1;_0x598786=_[_0xcd9c('0x3e')]({},_0x598786,_0x455de4);return db[_0xcd9c('0x2d')][_0xcd9c('0x46')](_0x598786)[_0xcd9c('0x24')](function(_0x4dd9e2){if(_0x4dd9e2){_0xcec500=_0x4dd9e2;return _0x4dd9e2[_0xcd9c('0x69')]();}return null;})[_0xcd9c('0x24')](function(_0x34d876){if(_0x34d876){if(!_0x34d876[_0xcd9c('0x38')]){throw new db[(_0xcd9c('0x6a'))][(_0xcd9c('0x6b'))](_0xcd9c('0x89'),0x193);}_0x1479ee=_0x34d876;return db[_0xcd9c('0x6c')]['findAll']({'raw':!![]});}return null;})[_0xcd9c('0x24')](function(_0x59e79f){if(_0x59e79f){_0x418d42=_[_0xcd9c('0x8a')](_0x59e79f,'id');var _0x41f472;var _0x49dae3=squel[_0xcd9c('0x6d')]();_0x49dae3['from'](_0xcec500[_0xcd9c('0x6f')]);for(var _0x2be691=0x0;_0x2be691<_0x1479ee[_0xcd9c('0x38')];_0x2be691+=0x1){_0x41f472=_0x1479ee[_0x2be691]['MetricId']?_0x418d42[_0x1479ee[_0x2be691]['MetricId']]['metric']:_0x1479ee[_0x2be691][_0xcd9c('0x66')];_0x41f472=_0x1479ee[_0x2be691][_0xcd9c('0x72')]?_[_0xcd9c('0x71')](_0xfa2f5a[_0x1479ee[_0x2be691][_0xcd9c('0x72')]],'%s',_0x41f472):_0x41f472;_0x41f472=_0x1479ee[_0x2be691]['format']?_[_0xcd9c('0x71')](_0x33422d[_0x1479ee[_0x2be691][_0xcd9c('0x73')]],'%s',_0x41f472):_0x41f472;if(_0x1479ee[_0x2be691]['groupBy']){_0x49dae3['group'](_0x41f472);}_0x1479ee[_0x2be691][_0xcd9c('0x75')]&&_0x49dae3['order'](_0x41f472,_0x1479ee[_0x2be691]['orderBy']===_0xcd9c('0x8b')?![]:!![]);_0x49dae3[_0xcd9c('0x66')](_0x41f472,_0x1479ee[_0x2be691][_0xcd9c('0x76')]||_0x41f472);}if(_0xcec500[_0xcd9c('0x77')]){_0xcec500['joins']=JSON['parse'](_0xcec500[_0xcd9c('0x77')]);for(var _0x516048=0x0;_0x516048<_0xcec500[_0xcd9c('0x77')][_0xcd9c('0x38')];_0x516048+=0x1){if(_0xcec500[_0xcd9c('0x77')][_0x516048]['type']&&_[_0xcd9c('0x5f')](_0x4f4af7,_0xcec500[_0xcd9c('0x77')][_0x516048]['type'])&&_0xcec500['joins'][_0x516048][_0xcd9c('0x79')]&&_0xcec500['joins'][_0x516048][_0xcd9c('0x7b')]&&_0xcec500[_0xcd9c('0x77')][_0x516048][_0xcd9c('0x7a')]){_0x49dae3[_0xcec500['joins'][_0x516048]['type']](_0xcec500[_0xcd9c('0x77')][_0x516048][_0xcd9c('0x7b')],null,util['format'](_0xcd9c('0x7c'),_0xcec500[_0xcd9c('0x6f')],_0xcec500[_0xcd9c('0x77')][_0x516048]['parentKey'],_0xcec500['joins'][_0x516048][_0xcd9c('0x7b')],_0xcec500[_0xcd9c('0x77')][_0x516048][_0xcd9c('0x7a')]));}}}if(_0xcec500[_0xcd9c('0x7d')]){_0xcec500[_0xcd9c('0x7d')]=JSON['parse'](_0xcec500[_0xcd9c('0x7d')]);_0x49dae3[_0xcd9c('0x3c')](_0x59ed60(_0xcec500['conditions'][_0xcd9c('0x65')]));}_0x5a4eb1=_0x49dae3[_0xcd9c('0x7e')]();_0x49dae3[_0xcd9c('0x1e')](_0x47e87a);_0x49dae3[_0xcd9c('0x1d')](0x0);return;}})['then'](function(){if(_0x3a69b5[_0xcd9c('0x8c')]===_0xcd9c('0x8d')){return null;}var _0x4f015a=_[_0xcd9c('0x3e')](_0x3a69b5,{'name':_0x3a69b5[_0xcd9c('0x8e')]||_0x3a69b5[_0xcd9c('0x29')]||_0xcec500['name'],'basename':_0x9fe0ce,'savename':util[_0xcd9c('0x73')](_0xcd9c('0x8f'),_0x3a69b5[_0xcd9c('0x29')]||_0xcec500[_0xcd9c('0x29')],require(_0xcd9c('0x90'))['generate'](0x4),_0x3a69b5['output']||'csv'),'reportId':_0xcec500['id'],'reportType':'default'});return db[_0xcd9c('0x91')][_0xcd9c('0x47')](_0x4f015a,{'raw':!![]});})[_0xcd9c('0x24')](function(_0x5246d6){if(_0xcec500[_0xcd9c('0x6f')]===_0xcd9c('0x92')){_0x5a4eb1['where'](_0xcec500[_0xcd9c('0x6f')]+_0xcd9c('0x93'),_0x3a69b5[_0xcd9c('0x94')],_0x3a69b5[_0xcd9c('0x95')]);}else{_0x5a4eb1[_0xcd9c('0x3c')](_0xcec500[_0xcd9c('0x6f')]+_0xcd9c('0x96'),_0x3a69b5[_0xcd9c('0x94')],_0x3a69b5[_0xcd9c('0x95')]);}if(_0x5246d6){logger[_0xcd9c('0x97')](_0xcd9c('0x98'),_0x5a4eb1['toString']());require(_0xcd9c('0x99'))[_0xcd9c('0x9a')](path['join'](__dirname,'../../components/export/',_0x5246d6[_0xcd9c('0x8c')]),[_0x5246d6['id'],_0x5a4eb1[_0xcd9c('0x81')](),path[_0xcd9c('0x52')](__dirname,'../../files/reports',_0x5246d6[_0xcd9c('0x9b')]),_0x9fe0ce]);return _0x5246d6;}else{var _0x254202=squel[_0xcd9c('0x6d')]();_0x254202[_0xcd9c('0x6e')]('('+_0x5a4eb1[_0xcd9c('0x81')]()+')','countTable');_0x254202[_0xcd9c('0x66')]('COUNT(*)',_0xcd9c('0x1c'));_0x5a4eb1[_0xcd9c('0x1e')](_0x3a69b5[_0xcd9c('0x1e')]||_0x47e87a);_0x5a4eb1[_0xcd9c('0x1d')](_0x3a69b5[_0xcd9c('0x1d')]||0x0);return dbH[_0xcd9c('0x82')]['query'](_0x254202[_0xcd9c('0x81')](),{'type':dbH['sequelize'][_0xcd9c('0x83')][_0xcd9c('0x84')]})[_0xcd9c('0x24')](function(_0xc5d02c){if(!_0xc5d02c[_0xcd9c('0x38')]){_0x46c5a4=0x0;}else{_0x46c5a4=_0xc5d02c[0x0][_0xcd9c('0x1c')]||0x0;}return dbH[_0xcd9c('0x82')][_0xcd9c('0x32')](_0x5a4eb1[_0xcd9c('0x81')](),{'type':dbH[_0xcd9c('0x82')][_0xcd9c('0x83')][_0xcd9c('0x84')]});})[_0xcd9c('0x24')](function(_0x2a9542){return{'rows':_0x2a9542||[],'count':_0x46c5a4};});}});}exports['run']=function(_0x1c9c51,_0x391e28){return runReport(_0x1c9c51[_0xcd9c('0x51')],_0x1c9c51[_0xcd9c('0x32')],_0x1c9c51[_0xcd9c('0x41')])['then'](respondWithResult(_0x391e28,null))[_0xcd9c('0x45')](handleError(_0x391e28,null));};exports[_0xcd9c('0x9c')]=runReport;exports['query']=function(_0x180c7b,_0x310780){var _0x8e339a=0xa;var _0x4d86d1=['join',_0xcd9c('0x53'),'right_join',_0xcd9c('0x55')];var _0x5a487d={'SUM':'SUM(%s)','COUNT':_0xcd9c('0x85'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xcd9c('0x59'),'AVG':_0xcd9c('0x9d'),'GROUP_CONCAT':_0xcd9c('0x5a'),'GROUP_CONCAT ASC':_0xcd9c('0x5b'),'GROUP_CONCAT DESC':_0xcd9c('0x5c')};var _0x595bda={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xcd9c('0x86'),'HOUR':_0xcd9c('0x5d'),'ROUND':_0xcd9c('0x87'),'UNIX_TIMESTAMP':_0xcd9c('0x5e')};var _0x41b7c8=function(_0x26162d){return!_[_0xcd9c('0x5f')]([_0xcd9c('0x60'),_0xcd9c('0x88'),_0xcd9c('0x61'),_0xcd9c('0x62')],_0x26162d);};var _0x34ea71=function(_0x578341){if(!_0x578341||!_0x578341[_0xcd9c('0x63')][_0xcd9c('0x38')]){return'';}for(var _0x147ec0='(',_0x4d9c27=0x0;_0x4d9c27<_0x578341['rules'][_0xcd9c('0x38')];_0x4d9c27+=0x1){_0x4d9c27>0x0&&(_0x147ec0+='\x20'+_0x578341[_0xcd9c('0x64')]+'\x20');_0x147ec0+=_0x578341['rules'][_0x4d9c27][_0xcd9c('0x65')]?_0x34ea71(_0x578341['rules'][_0x4d9c27][_0xcd9c('0x65')]):_0x578341[_0xcd9c('0x63')][_0x4d9c27][_0xcd9c('0x66')]+'\x20'+_0x578341[_0xcd9c('0x63')][_0x4d9c27]['condition']+(_0x41b7c8(_0x578341[_0xcd9c('0x63')][_0x4d9c27]['condition'])?'\x20'+_0x578341['rules'][_0x4d9c27]['value']:'');}return _0x147ec0+')';};var _0x3135ee={'where':{'id':_0x180c7b[_0xcd9c('0x51')]['id']}},_0x5627dd,_0x2ff292,_0x439aff,_0x2ca9a8,_0x5f4750;_0x3135ee=_[_0xcd9c('0x3e')]({},_0x3135ee,_0x180c7b[_0xcd9c('0x41')]);return db[_0xcd9c('0x2d')][_0xcd9c('0x46')](_0x3135ee)[_0xcd9c('0x24')](function(_0x108f41){if(_0x108f41){_0x5627dd=_0x108f41;return _0x108f41['getFields']();}return null;})[_0xcd9c('0x24')](function(_0x2551f4){if(_0x2551f4){if(!_0x2551f4[_0xcd9c('0x38')]){throw new db[(_0xcd9c('0x6a'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2ff292=_0x2551f4;return db[_0xcd9c('0x6c')][_0xcd9c('0x43')]({'raw':!![]});}return null;})[_0xcd9c('0x24')](function(_0x2bae96){if(_0x2bae96){_0x439aff=_[_0xcd9c('0x8a')](_0x2bae96,'id');var _0x215448;var _0x8817b=squel[_0xcd9c('0x6d')]();_0x8817b[_0xcd9c('0x6e')](_0x5627dd[_0xcd9c('0x6f')]);for(var _0x7a634f=0x0;_0x7a634f<_0x2ff292['length'];_0x7a634f+=0x1){_0x215448=_0x2ff292[_0x7a634f][_0xcd9c('0x70')]?_0x439aff[_0x2ff292[_0x7a634f][_0xcd9c('0x70')]][_0xcd9c('0x9e')]:_0x2ff292[_0x7a634f]['field'];_0x215448=_0x2ff292[_0x7a634f][_0xcd9c('0x72')]?_[_0xcd9c('0x71')](_0x5a487d[_0x2ff292[_0x7a634f]['function']],'%s',_0x215448):_0x215448;_0x215448=_0x2ff292[_0x7a634f][_0xcd9c('0x73')]?_['replace'](_0x595bda[_0x2ff292[_0x7a634f][_0xcd9c('0x73')]],'%s',_0x215448):_0x215448;if(_0x2ff292[_0x7a634f][_0xcd9c('0x74')]){_0x8817b['group'](_0x215448);}_0x2ff292[_0x7a634f][_0xcd9c('0x75')]&&_0x8817b[_0xcd9c('0x3b')](_0x215448,_0x2ff292[_0x7a634f][_0xcd9c('0x75')]==='DESC'?![]:!![]);_0x8817b[_0xcd9c('0x66')](_0x215448,_0x2ff292[_0x7a634f]['alias']||_0x215448);}if(_0x5627dd[_0xcd9c('0x77')]){_0x5627dd[_0xcd9c('0x77')]=JSON['parse'](_0x5627dd['joins']);for(var _0x54d1d8=0x0;_0x54d1d8<_0x5627dd[_0xcd9c('0x77')][_0xcd9c('0x38')];_0x54d1d8+=0x1){if(_0x5627dd[_0xcd9c('0x77')][_0x54d1d8][_0xcd9c('0x2f')]&&_[_0xcd9c('0x5f')](_0x4d86d1,_0x5627dd[_0xcd9c('0x77')][_0x54d1d8][_0xcd9c('0x2f')])&&_0x5627dd['joins'][_0x54d1d8][_0xcd9c('0x79')]&&_0x5627dd[_0xcd9c('0x77')][_0x54d1d8][_0xcd9c('0x7b')]&&_0x5627dd[_0xcd9c('0x77')][_0x54d1d8]['foreignKey']){_0x8817b[_0x5627dd['joins'][_0x54d1d8][_0xcd9c('0x2f')]](_0x5627dd['joins'][_0x54d1d8][_0xcd9c('0x7b')],null,util[_0xcd9c('0x73')](_0xcd9c('0x7c'),_0x5627dd[_0xcd9c('0x6f')],_0x5627dd['joins'][_0x54d1d8][_0xcd9c('0x79')],_0x5627dd['joins'][_0x54d1d8]['foreignTable'],_0x5627dd[_0xcd9c('0x77')][_0x54d1d8]['foreignKey']));}}}if(_0x5627dd[_0xcd9c('0x7d')]){_0x5627dd[_0xcd9c('0x7d')]=JSON['parse'](_0x5627dd[_0xcd9c('0x7d')]);_0x8817b[_0xcd9c('0x3c')](_0x34ea71(_0x5627dd[_0xcd9c('0x7d')][_0xcd9c('0x65')]));}_0x5f4750=_0x8817b[_0xcd9c('0x7e')]();_0x8817b['limit'](_0x8e339a);_0x8817b[_0xcd9c('0x1d')](0x0);logger[_0xcd9c('0x7f')](_0xcd9c('0x80'),_0x8817b[_0xcd9c('0x81')]());return dbH['sequelize'][_0xcd9c('0x32')](_0x8817b[_0xcd9c('0x81')](),{'type':dbH[_0xcd9c('0x82')][_0xcd9c('0x83')][_0xcd9c('0x84')]});}})[_0xcd9c('0x24')](function(){return{'sql':_0x5f4750[_0xcd9c('0x81')]()};})[_0xcd9c('0x24')](respondWithResult(_0x310780,null))[_0xcd9c('0x45')](handleError(_0x310780,null));};
\ No newline at end of file
+var _0x66bd=['moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','get','DefaultReports','name','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','left_join','SEC_TO_TIME(%s)','IS\x20NOT\x20NULL','value','groupBy','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','select','countTable','COUNT(*)','run','runReport','getFields','ValidationErrorItem','html-pdf','rimraf','zip-dir'];(function(_0x5d567e,_0x35f96a){var _0x310c25=function(_0x5d255f){while(--_0x5d255f){_0x5d567e['push'](_0x5d567e['shift']());}};_0x310c25(++_0x35f96a);}(_0x66bd,0x14b));var _0xd66b=function(_0x2a9bf4,_0x5e0ffb){_0x2a9bf4=_0x2a9bf4-0x0;var _0x5f5ff1=_0x66bd[_0x2a9bf4];return _0x5f5ff1;};'use strict';var pdf=require(_0xd66b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd66b('0x1'));var zipdir=require(_0xd66b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd66b('0x3'));var BPromise=require(_0xd66b('0x4'));var Mustache=require(_0xd66b('0x5'));var util=require('util');var path=require('path');var sox=require(_0xd66b('0x6'));var csv=require(_0xd66b('0x7'));var ejs=require(_0xd66b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd66b('0x9'));var squel=require('squel');var crypto=require(_0xd66b('0xa'));var jsforce=require(_0xd66b('0xb'));var deskjs=require(_0xd66b('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd66b('0xd'));var Redis=require(_0xd66b('0xe'));var authService=require(_0xd66b('0xf'));var qs=require(_0xd66b('0x10'));var as=require(_0xd66b('0x11'));var hardwareService=require(_0xd66b('0x12'));var logger=require(_0xd66b('0x13'))(_0xd66b('0x14'));var utils=require(_0xd66b('0x15'));var config=require(_0xd66b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd66b('0x17'))['db'];var dbH=require('../../mysqldb')[_0xd66b('0x18')];function respondWithStatusCode(_0x42acf7,_0x2e4462){_0x2e4462=_0x2e4462||0xcc;return function(_0x42e489){if(_0x42e489){return _0x42acf7[_0xd66b('0x19')](_0x2e4462);}return _0x42acf7[_0xd66b('0x1a')](_0x2e4462)[_0xd66b('0x1b')]();};}function respondWithResult(_0xb4b86b,_0x5c1788){_0x5c1788=_0x5c1788||0xc8;return function(_0x3cc7d1){if(_0x3cc7d1){return _0xb4b86b[_0xd66b('0x1a')](_0x5c1788)[_0xd66b('0x1c')](_0x3cc7d1);}};}function respondWithFilteredResult(_0x4a3fce,_0x1e9a0f){return function(_0x22a1cb){if(_0x22a1cb){var _0x4a77b8=_0x22a1cb[_0xd66b('0x1d')],_0x1d5372=_0x1e9a0f['offset'],_0x45577b=_0x1e9a0f[_0xd66b('0x1e')]+_0x1e9a0f[_0xd66b('0x1f')],_0x1c8f63;if(_0x45577b>=_0x4a77b8){_0x45577b=_0x4a77b8;_0x1c8f63=0xc8;}else{_0x1c8f63=0xce;}_0x4a3fce[_0xd66b('0x1a')](_0x1c8f63);return _0x4a3fce[_0xd66b('0x20')](_0xd66b('0x21'),_0x1d5372+'-'+_0x45577b+'/'+_0x4a77b8)[_0xd66b('0x1c')](_0x22a1cb);}return null;};}function patchUpdates(_0xeb1e44){return function(_0x10e52f){try{jsonpatch['apply'](_0x10e52f,_0xeb1e44,!![]);}catch(_0x277886){return BPromise['reject'](_0x277886);}return _0x10e52f[_0xd66b('0x22')]();};}function saveUpdates(_0x1c2e1e,_0x44e02b){return function(_0x57605b){if(_0x57605b){return _0x57605b[_0xd66b('0x23')](_0x1c2e1e)[_0xd66b('0x24')](function(_0x57a6ce){return _0x57a6ce;});}return null;};}function removeEntity(_0x49a779,_0x2736ca){return function(_0x572748){if(_0x572748){return _0x572748[_0xd66b('0x25')]()['then'](function(){var _0x52f149=_0x572748[_0xd66b('0x26')]({'plain':!![]});var _0x2916b5=_0xd66b('0x27');return db['UserProfileResource'][_0xd66b('0x25')]({'where':{'type':_0x2916b5,'resourceId':_0x52f149['id']}})[_0xd66b('0x24')](function(){return _0x572748;});})[_0xd66b('0x24')](function(){_0x49a779['status'](0xcc)[_0xd66b('0x1b')]();});}};}function handleEntityNotFound(_0x5a6113,_0x5304e7){return function(_0x1ab53e){if(!_0x1ab53e){_0x5a6113[_0xd66b('0x19')](0x194);}return _0x1ab53e;};}function handleError(_0x4e299f,_0x1b0911){_0x1b0911=_0x1b0911||0x1f4;return function(_0x1bb6d3){logger['error'](_0x1bb6d3['stack']);if(_0x1bb6d3['name']){delete _0x1bb6d3[_0xd66b('0x28')];}_0x4e299f[_0xd66b('0x1a')](_0x1b0911)['send'](_0x1bb6d3);};}exports[_0xd66b('0x29')]=function(_0x13653e,_0x3b994a){var _0x419443={},_0x281a0e={},_0x2b5a78={'count':0x0,'rows':[]};var _0x5227=_[_0xd66b('0x2a')](db[_0xd66b('0x2b')][_0xd66b('0x2c')],function(_0x229f4c){return{'name':_0x229f4c[_0xd66b('0x2d')],'type':_0x229f4c[_0xd66b('0x2e')][_0xd66b('0x2f')]};});_0x281a0e[_0xd66b('0x30')]=_[_0xd66b('0x2a')](_0x5227,_0xd66b('0x28'));_0x281a0e[_0xd66b('0x31')]=_[_0xd66b('0x32')](_0x13653e['query']);_0x281a0e[_0xd66b('0x33')]=_[_0xd66b('0x34')](_0x281a0e[_0xd66b('0x30')],_0x281a0e[_0xd66b('0x31')]);_0x419443['attributes']=_[_0xd66b('0x34')](_0x281a0e[_0xd66b('0x30')],qs['fields'](_0x13653e[_0xd66b('0x31')][_0xd66b('0x35')]));_0x419443['attributes']=_0x419443[_0xd66b('0x36')][_0xd66b('0x37')]?_0x419443['attributes']:_0x281a0e[_0xd66b('0x30')];if(!_0x13653e[_0xd66b('0x31')][_0xd66b('0x38')](_0xd66b('0x39'))){_0x419443[_0xd66b('0x1f')]=qs[_0xd66b('0x1f')](_0x13653e[_0xd66b('0x31')][_0xd66b('0x1f')]);_0x419443['offset']=qs[_0xd66b('0x1e')](_0x13653e[_0xd66b('0x31')]['offset']);}_0x419443[_0xd66b('0x3a')]=qs['sort'](_0x13653e[_0xd66b('0x31')][_0xd66b('0x3b')]);_0x419443[_0xd66b('0x3c')]=qs['filters'](_[_0xd66b('0x3d')](_0x13653e[_0xd66b('0x31')],_0x281a0e['filters']),_0x5227);if(_0x13653e[_0xd66b('0x31')][_0xd66b('0x3e')]){_0x419443[_0xd66b('0x3c')]=_[_0xd66b('0x3f')](_0x419443['where'],{'$or':_[_0xd66b('0x2a')](_0x5227,function(_0x2c7b1b){if(_0x2c7b1b['type']!==_0xd66b('0x40')){var _0x660f09={};_0x660f09[_0x2c7b1b['name']]={'$like':'%'+_0x13653e[_0xd66b('0x31')][_0xd66b('0x3e')]+'%'};return _0x660f09;}})});}_0x419443=_['merge']({},_0x419443,_0x13653e[_0xd66b('0x41')]);var _0x2e8a29={'where':_0x419443[_0xd66b('0x3c')]};return db[_0xd66b('0x2b')][_0xd66b('0x1d')](_0x2e8a29)[_0xd66b('0x24')](function(_0x27b4ea){_0x2b5a78[_0xd66b('0x1d')]=_0x27b4ea;if(_0x13653e[_0xd66b('0x31')][_0xd66b('0x42')]){_0x419443[_0xd66b('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0xd66b('0x44')](_0x419443);})[_0xd66b('0x24')](function(_0x4f5df1){_0x2b5a78['rows']=_0x4f5df1;return _0x2b5a78;})[_0xd66b('0x24')](respondWithFilteredResult(_0x3b994a,_0x419443))['catch'](handleError(_0x3b994a,null));};exports[_0xd66b('0x45')]=function(_0x1d6346,_0x30730b){var _0x54ac49={'raw':!![],'where':{'id':_0x1d6346['params']['id']}},_0x2e7295={};_0x2e7295[_0xd66b('0x30')]=_[_0xd66b('0x32')](db[_0xd66b('0x2b')][_0xd66b('0x2c')]);_0x2e7295[_0xd66b('0x31')]=_[_0xd66b('0x32')](_0x1d6346[_0xd66b('0x31')]);_0x2e7295[_0xd66b('0x33')]=_['intersection'](_0x2e7295[_0xd66b('0x30')],_0x2e7295['query']);_0x54ac49['attributes']=_[_0xd66b('0x34')](_0x2e7295[_0xd66b('0x30')],qs[_0xd66b('0x35')](_0x1d6346[_0xd66b('0x31')]['fields']));_0x54ac49[_0xd66b('0x36')]=_0x54ac49[_0xd66b('0x36')]['length']?_0x54ac49[_0xd66b('0x36')]:_0x2e7295[_0xd66b('0x30')];if(_0x1d6346[_0xd66b('0x31')]['includeAll']){_0x54ac49[_0xd66b('0x43')]=[{'all':!![]}];}_0x54ac49=_['merge']({},_0x54ac49,_0x1d6346[_0xd66b('0x41')]);return db[_0xd66b('0x2b')][_0xd66b('0x46')](_0x54ac49)[_0xd66b('0x24')](handleEntityNotFound(_0x30730b,null))[_0xd66b('0x24')](respondWithResult(_0x30730b,null))[_0xd66b('0x47')](handleError(_0x30730b,null));};exports[_0xd66b('0x48')]=function(_0x5bde1a,_0x540269){return db[_0xd66b('0x2b')]['create'](_0x5bde1a[_0xd66b('0x49')],{})[_0xd66b('0x24')](function(_0x132695){var _0x10f3c5=_0x5bde1a[_0xd66b('0x4a')][_0xd66b('0x26')]({'plain':!![]});if(!_0x10f3c5)throw new Error(_0xd66b('0x4b'));if(_0x10f3c5[_0xd66b('0x4c')]==='user'){var _0x36069a=_0x132695[_0xd66b('0x26')]({'plain':!![]});var _0x241049=_0xd66b('0x4d');return db['UserProfileSection']['find']({'where':{'name':_0x241049,'userProfileId':_0x10f3c5[_0xd66b('0x4e')]},'raw':!![]})[_0xd66b('0x24')](function(_0x279624){if(_0x279624&&_0x279624[_0xd66b('0x4f')]===0x0){return db[_0xd66b('0x50')][_0xd66b('0x48')]({'name':_0x36069a[_0xd66b('0x28')],'resourceId':_0x36069a['id'],'type':_0xd66b('0x27'),'sectionId':_0x279624['id']},{})[_0xd66b('0x24')](function(){return _0x132695;});}else{return _0x132695;}})[_0xd66b('0x47')](function(_0x2755bf){logger[_0xd66b('0x51')](_0xd66b('0x52'),_0x2755bf);throw _0x2755bf;});}return _0x132695;})[_0xd66b('0x24')](respondWithResult(_0x540269,0xc9))['catch'](handleError(_0x540269,null));};exports['update']=function(_0x2c7e6c,_0x401f39){if(_0x2c7e6c[_0xd66b('0x49')]['id']){delete _0x2c7e6c[_0xd66b('0x49')]['id'];}return db[_0xd66b('0x2b')][_0xd66b('0x46')]({'where':{'id':_0x2c7e6c[_0xd66b('0x53')]['id']}})[_0xd66b('0x24')](handleEntityNotFound(_0x401f39,null))[_0xd66b('0x24')](saveUpdates(_0x2c7e6c[_0xd66b('0x49')],null))[_0xd66b('0x24')](respondWithResult(_0x401f39,null))['catch'](handleError(_0x401f39,null));};exports[_0xd66b('0x25')]=function(_0x5bb207,_0x5e738a){return db[_0xd66b('0x2b')][_0xd66b('0x46')]({'where':{'id':_0x5bb207['params']['id']}})[_0xd66b('0x24')](handleEntityNotFound(_0x5e738a,null))[_0xd66b('0x24')](removeEntity(_0x5e738a,null))[_0xd66b('0x47')](handleError(_0x5e738a,null));};exports[_0xd66b('0x54')]=function(_0x296fb7,_0x4d3bab){var _0x11be28=0xa;var _0x57ed01=['join','left_join',_0xd66b('0x55'),_0xd66b('0x56')];var _0x1e432e={'SUM':_0xd66b('0x57'),'COUNT':_0xd66b('0x58'),'COUNT DISTINCT':_0xd66b('0x59'),'MAX':_0xd66b('0x5a'),'MIN':_0xd66b('0x5b'),'AVG':_0xd66b('0x5c'),'GROUP_CONCAT':_0xd66b('0x5d'),'GROUP_CONCAT ASC':_0xd66b('0x5e'),'GROUP_CONCAT DESC':_0xd66b('0x5f')};var _0x776f0b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd66b('0x60'),'HOUR':_0xd66b('0x61'),'ROUND':_0xd66b('0x62'),'UNIX_TIMESTAMP':_0xd66b('0x63')};var _0x4536e2=function(_0x2a15b9){return!_[_0xd66b('0x64')]([_0xd66b('0x65'),'IS\x20NOT\x20NULL',_0xd66b('0x66'),_0xd66b('0x67')],_0x2a15b9);};var _0x5f4073=function(_0x49bab0){if(!_0x49bab0||!_0x49bab0[_0xd66b('0x68')]['length']){return'';}for(var _0x234cf8='(',_0x4cfd51=0x0;_0x4cfd51<_0x49bab0[_0xd66b('0x68')][_0xd66b('0x37')];_0x4cfd51+=0x1){_0x4cfd51>0x0&&(_0x234cf8+='\x20'+_0x49bab0['operator']+'\x20');_0x234cf8+=_0x49bab0[_0xd66b('0x68')][_0x4cfd51][_0xd66b('0x69')]?_0x5f4073(_0x49bab0[_0xd66b('0x68')][_0x4cfd51][_0xd66b('0x69')]):_0x49bab0[_0xd66b('0x68')][_0x4cfd51][_0xd66b('0x6a')]+'\x20'+_0x49bab0[_0xd66b('0x68')][_0x4cfd51][_0xd66b('0x6b')]+(_0x4536e2(_0x49bab0[_0xd66b('0x68')][_0x4cfd51][_0xd66b('0x6b')])?'\x20'+_0x49bab0[_0xd66b('0x68')][_0x4cfd51]['value']:'');}return _0x234cf8+')';};var _0x26c9bb={'where':{'id':_0x296fb7['params']['id']}},_0x2de9c3,_0x582f6e,_0x163218,_0xd35613,_0xf2b27f;_0x26c9bb=_[_0xd66b('0x3f')]({},_0x26c9bb,_0x296fb7[_0xd66b('0x41')]);return db[_0xd66b('0x2b')][_0xd66b('0x46')](_0x26c9bb)[_0xd66b('0x24')](function(_0x182437){if(_0x182437){_0x2de9c3=_0x182437;return _0x182437['getFields']();}return null;})[_0xd66b('0x24')](function(_0x3e7d2a){if(_0x3e7d2a){if(!_0x3e7d2a[_0xd66b('0x37')]){throw new db[(_0xd66b('0x6c'))]['ValidationErrorItem'](_0xd66b('0x6d'),0x193);}_0x582f6e=_0x3e7d2a;return db[_0xd66b('0x6e')][_0xd66b('0x44')]({'raw':!![]});}return null;})[_0xd66b('0x24')](function(_0x4519da){if(_0x4519da){_0x163218=_[_0xd66b('0x6f')](_0x4519da,'id');var _0x2e0ddc;var _0x14805a=squel['select']();_0x14805a[_0xd66b('0x70')](_0x2de9c3['table']);for(var _0x38dc9d=0x0;_0x38dc9d<_0x582f6e[_0xd66b('0x37')];_0x38dc9d+=0x1){_0x2e0ddc=_0x582f6e[_0x38dc9d][_0xd66b('0x71')]?_0x163218[_0x582f6e[_0x38dc9d][_0xd66b('0x71')]][_0xd66b('0x72')]:_0x582f6e[_0x38dc9d]['field'];_0x2e0ddc=_0x582f6e[_0x38dc9d][_0xd66b('0x73')]?_[_0xd66b('0x74')](_0x1e432e[_0x582f6e[_0x38dc9d][_0xd66b('0x73')]],'%s',_0x2e0ddc):_0x2e0ddc;_0x2e0ddc=_0x582f6e[_0x38dc9d][_0xd66b('0x75')]?_['replace'](_0x776f0b[_0x582f6e[_0x38dc9d][_0xd66b('0x75')]],'%s',_0x2e0ddc):_0x2e0ddc;if(_0x582f6e[_0x38dc9d]['groupBy']){_0x14805a['group'](_0x2e0ddc);}_0x582f6e[_0x38dc9d][_0xd66b('0x76')]&&_0x14805a[_0xd66b('0x3a')](_0x2e0ddc,_0x582f6e[_0x38dc9d][_0xd66b('0x76')]===_0xd66b('0x77')?![]:!![]);_0x14805a[_0xd66b('0x6a')](_0x2e0ddc,_0x582f6e[_0x38dc9d][_0xd66b('0x78')]||_0x2e0ddc);}if(_0x2de9c3[_0xd66b('0x79')]){_0x2de9c3['joins']=JSON[_0xd66b('0x7a')](_0x2de9c3[_0xd66b('0x79')]);for(var _0x1af25f=0x0;_0x1af25f<_0x2de9c3[_0xd66b('0x79')][_0xd66b('0x37')];_0x1af25f+=0x1){if(_0x2de9c3[_0xd66b('0x79')][_0x1af25f][_0xd66b('0x2e')]&&_['includes'](_0x57ed01,_0x2de9c3[_0xd66b('0x79')][_0x1af25f][_0xd66b('0x2e')])&&_0x2de9c3[_0xd66b('0x79')][_0x1af25f][_0xd66b('0x7b')]&&_0x2de9c3[_0xd66b('0x79')][_0x1af25f][_0xd66b('0x7c')]&&_0x2de9c3[_0xd66b('0x79')][_0x1af25f]['foreignKey']){_0x14805a[_0x2de9c3[_0xd66b('0x79')][_0x1af25f]['type']](_0x2de9c3[_0xd66b('0x79')][_0x1af25f][_0xd66b('0x7c')],null,util[_0xd66b('0x75')](_0xd66b('0x7d'),_0x2de9c3[_0xd66b('0x7e')],_0x2de9c3[_0xd66b('0x79')][_0x1af25f]['parentKey'],_0x2de9c3['joins'][_0x1af25f]['foreignTable'],_0x2de9c3[_0xd66b('0x79')][_0x1af25f][_0xd66b('0x7f')]));}}}if(_0x2de9c3[_0xd66b('0x80')]){_0x2de9c3[_0xd66b('0x80')]=JSON[_0xd66b('0x7a')](_0x2de9c3[_0xd66b('0x80')]);_0x14805a[_0xd66b('0x3c')](_0x5f4073(_0x2de9c3[_0xd66b('0x80')][_0xd66b('0x69')]));}_0xf2b27f=_0x14805a[_0xd66b('0x81')]();_0x14805a['limit'](_0x11be28);_0x14805a[_0xd66b('0x1e')](0x0);logger[_0xd66b('0x82')](_0xd66b('0x83'),_0x14805a[_0xd66b('0x84')]());return dbH[_0xd66b('0x85')]['query'](_0x14805a['toString'](),{'type':dbH[_0xd66b('0x85')][_0xd66b('0x86')][_0xd66b('0x87')]});}})[_0xd66b('0x24')](respondWithResult(_0x4d3bab,null))['catch'](handleError(_0x4d3bab,null));};function runReport(_0x3d3f37,_0x19ccfe,_0x337096){var _0x551a34=_0x19ccfe['name'];var _0x44eecc=0xa;var _0x3db7cc=[_0xd66b('0x88'),_0xd66b('0x89'),'right_join','cross_join'];var _0x264f28={'SUM':_0xd66b('0x57'),'COUNT':_0xd66b('0x58'),'COUNT DISTINCT':_0xd66b('0x59'),'MAX':_0xd66b('0x5a'),'MIN':_0xd66b('0x5b'),'AVG':_0xd66b('0x5c'),'GROUP_CONCAT':_0xd66b('0x5d'),'GROUP_CONCAT ASC':_0xd66b('0x5e'),'GROUP_CONCAT DESC':_0xd66b('0x5f')};var _0x5b26f2={'SEC_TO_TIME':_0xd66b('0x8a'),'DATE':_0xd66b('0x60'),'HOUR':_0xd66b('0x61'),'ROUND':_0xd66b('0x62'),'UNIX_TIMESTAMP':_0xd66b('0x63')};var _0x24703d=function(_0x12cbbc){return!_[_0xd66b('0x64')]([_0xd66b('0x65'),_0xd66b('0x8b'),_0xd66b('0x66'),_0xd66b('0x67')],_0x12cbbc);};var _0x407434=function(_0x172a64){if(!_0x172a64||!_0x172a64[_0xd66b('0x68')][_0xd66b('0x37')]){return'';}for(var _0x479667='(',_0x1fcf0a=0x0;_0x1fcf0a<_0x172a64[_0xd66b('0x68')]['length'];_0x1fcf0a+=0x1){_0x1fcf0a>0x0&&(_0x479667+='\x20'+_0x172a64['operator']+'\x20');_0x479667+=_0x172a64['rules'][_0x1fcf0a][_0xd66b('0x69')]?_0x407434(_0x172a64[_0xd66b('0x68')][_0x1fcf0a][_0xd66b('0x69')]):_0x172a64[_0xd66b('0x68')][_0x1fcf0a]['field']+'\x20'+_0x172a64[_0xd66b('0x68')][_0x1fcf0a][_0xd66b('0x6b')]+(_0x24703d(_0x172a64[_0xd66b('0x68')][_0x1fcf0a]['condition'])?'\x20'+_0x172a64[_0xd66b('0x68')][_0x1fcf0a][_0xd66b('0x8c')]:'');}return _0x479667+')';};var _0x4ef8b8={'where':{'id':_0x3d3f37['id']}},_0x3d85d0,_0x37c071,_0x45821e,_0x20a8fa,_0x3bb165;_0x4ef8b8=_[_0xd66b('0x3f')]({},_0x4ef8b8,_0x337096);return db['AnalyticDefaultReport'][_0xd66b('0x46')](_0x4ef8b8)['then'](function(_0x4ea839){if(_0x4ea839){_0x3d85d0=_0x4ea839;return _0x4ea839['getFields']();}return null;})[_0xd66b('0x24')](function(_0x417ed1){if(_0x417ed1){if(!_0x417ed1['length']){throw new db[(_0xd66b('0x6c'))]['ValidationErrorItem'](_0xd66b('0x6d'),0x193);}_0x37c071=_0x417ed1;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x471547){if(_0x471547){_0x45821e=_[_0xd66b('0x6f')](_0x471547,'id');var _0x43f201;var _0xce9da7=squel['select']();_0xce9da7[_0xd66b('0x70')](_0x3d85d0['table']);for(var _0x51ab57=0x0;_0x51ab57<_0x37c071[_0xd66b('0x37')];_0x51ab57+=0x1){_0x43f201=_0x37c071[_0x51ab57][_0xd66b('0x71')]?_0x45821e[_0x37c071[_0x51ab57][_0xd66b('0x71')]][_0xd66b('0x72')]:_0x37c071[_0x51ab57][_0xd66b('0x6a')];_0x43f201=_0x37c071[_0x51ab57][_0xd66b('0x73')]?_[_0xd66b('0x74')](_0x264f28[_0x37c071[_0x51ab57][_0xd66b('0x73')]],'%s',_0x43f201):_0x43f201;_0x43f201=_0x37c071[_0x51ab57][_0xd66b('0x75')]?_[_0xd66b('0x74')](_0x5b26f2[_0x37c071[_0x51ab57]['format']],'%s',_0x43f201):_0x43f201;if(_0x37c071[_0x51ab57][_0xd66b('0x8d')]){_0xce9da7[_0xd66b('0x69')](_0x43f201);}_0x37c071[_0x51ab57]['orderBy']&&_0xce9da7[_0xd66b('0x3a')](_0x43f201,_0x37c071[_0x51ab57]['orderBy']==='DESC'?![]:!![]);_0xce9da7['field'](_0x43f201,_0x37c071[_0x51ab57][_0xd66b('0x78')]||_0x43f201);}if(_0x3d85d0[_0xd66b('0x79')]){_0x3d85d0[_0xd66b('0x79')]=JSON['parse'](_0x3d85d0[_0xd66b('0x79')]);for(var _0x3cb102=0x0;_0x3cb102<_0x3d85d0[_0xd66b('0x79')][_0xd66b('0x37')];_0x3cb102+=0x1){if(_0x3d85d0[_0xd66b('0x79')][_0x3cb102][_0xd66b('0x2e')]&&_[_0xd66b('0x64')](_0x3db7cc,_0x3d85d0[_0xd66b('0x79')][_0x3cb102][_0xd66b('0x2e')])&&_0x3d85d0['joins'][_0x3cb102]['parentKey']&&_0x3d85d0[_0xd66b('0x79')][_0x3cb102][_0xd66b('0x7c')]&&_0x3d85d0[_0xd66b('0x79')][_0x3cb102]['foreignKey']){_0xce9da7[_0x3d85d0[_0xd66b('0x79')][_0x3cb102]['type']](_0x3d85d0[_0xd66b('0x79')][_0x3cb102][_0xd66b('0x7c')],null,util['format'](_0xd66b('0x7d'),_0x3d85d0[_0xd66b('0x7e')],_0x3d85d0[_0xd66b('0x79')][_0x3cb102][_0xd66b('0x7b')],_0x3d85d0[_0xd66b('0x79')][_0x3cb102][_0xd66b('0x7c')],_0x3d85d0[_0xd66b('0x79')][_0x3cb102]['foreignKey']));}}}if(_0x3d85d0[_0xd66b('0x80')]){_0x3d85d0[_0xd66b('0x80')]=JSON['parse'](_0x3d85d0[_0xd66b('0x80')]);_0xce9da7['where'](_0x407434(_0x3d85d0[_0xd66b('0x80')][_0xd66b('0x69')]));}_0x3bb165=_0xce9da7[_0xd66b('0x81')]();_0xce9da7['limit'](_0x44eecc);_0xce9da7[_0xd66b('0x1e')](0x0);return;}})[_0xd66b('0x24')](function(){if(_0x19ccfe[_0xd66b('0x8e')]===_0xd66b('0x8f')){return null;}var _0x24f8ca=_['merge'](_0x19ccfe,{'name':_0x19ccfe[_0xd66b('0x90')]||_0x19ccfe[_0xd66b('0x28')]||_0x3d85d0[_0xd66b('0x28')],'basename':_0x551a34,'savename':util[_0xd66b('0x75')](_0xd66b('0x91'),_0x19ccfe[_0xd66b('0x28')]||_0x3d85d0[_0xd66b('0x28')],require(_0xd66b('0x92'))[_0xd66b('0x93')](0x4),_0x19ccfe[_0xd66b('0x8e')]||_0xd66b('0x94')),'reportId':_0x3d85d0['id'],'reportType':'default'});return db[_0xd66b('0x95')][_0xd66b('0x48')](_0x24f8ca,{'raw':!![]});})[_0xd66b('0x24')](function(_0xcd22df){if(_0x3d85d0[_0xd66b('0x7e')]===_0xd66b('0x96')){_0x3bb165[_0xd66b('0x3c')](_0x3d85d0[_0xd66b('0x7e')]+_0xd66b('0x97'),_0x19ccfe[_0xd66b('0x98')],_0x19ccfe[_0xd66b('0x99')]);}else{_0x3bb165[_0xd66b('0x3c')](_0x3d85d0[_0xd66b('0x7e')]+_0xd66b('0x9a'),_0x19ccfe['startDate'],_0x19ccfe[_0xd66b('0x99')]);}if(_0xcd22df){logger[_0xd66b('0x9b')](_0xd66b('0x9c'),_0x3bb165['toString']());require(_0xd66b('0x9d'))[_0xd66b('0x9e')](path['join'](__dirname,_0xd66b('0x9f'),_0xcd22df[_0xd66b('0x8e')]),[_0xcd22df['id'],_0x3bb165[_0xd66b('0x84')](),path[_0xd66b('0x88')](__dirname,'../../files/reports',_0xcd22df['savename']),_0x551a34]);return _0xcd22df;}else{var _0x5709c0=squel[_0xd66b('0xa0')]();_0x5709c0['from']('('+_0x3bb165['toString']()+')',_0xd66b('0xa1'));_0x5709c0[_0xd66b('0x6a')](_0xd66b('0xa2'),_0xd66b('0x1d'));_0x3bb165[_0xd66b('0x1f')](_0x19ccfe[_0xd66b('0x1f')]||_0x44eecc);_0x3bb165[_0xd66b('0x1e')](_0x19ccfe[_0xd66b('0x1e')]||0x0);return dbH[_0xd66b('0x85')]['query'](_0x5709c0[_0xd66b('0x84')](),{'type':dbH[_0xd66b('0x85')][_0xd66b('0x86')][_0xd66b('0x87')]})[_0xd66b('0x24')](function(_0x59f303){if(!_0x59f303[_0xd66b('0x37')]){_0x20a8fa=0x0;}else{_0x20a8fa=_0x59f303[0x0][_0xd66b('0x1d')]||0x0;}return dbH[_0xd66b('0x85')]['query'](_0x3bb165['toString'](),{'type':dbH['sequelize'][_0xd66b('0x86')][_0xd66b('0x87')]});})[_0xd66b('0x24')](function(_0x40fb67){return{'rows':_0x40fb67||[],'count':_0x20a8fa};});}});}exports[_0xd66b('0xa3')]=function(_0x488871,_0x1c41c3){return runReport(_0x488871[_0xd66b('0x53')],_0x488871[_0xd66b('0x31')],_0x488871['options'])[_0xd66b('0x24')](respondWithResult(_0x1c41c3,null))['catch'](handleError(_0x1c41c3,null));};exports[_0xd66b('0xa4')]=runReport;exports['query']=function(_0x2a6a26,_0x53f18a){var _0x203b67=0xa;var _0x3fd9fc=['join',_0xd66b('0x89'),_0xd66b('0x55'),'cross_join'];var _0x2b1412={'SUM':_0xd66b('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd66b('0x59'),'MAX':_0xd66b('0x5a'),'MIN':'MIN(%s)','AVG':_0xd66b('0x5c'),'GROUP_CONCAT':_0xd66b('0x5d'),'GROUP_CONCAT ASC':_0xd66b('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f0507={'SEC_TO_TIME':_0xd66b('0x8a'),'DATE':_0xd66b('0x60'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xd66b('0x63')};var _0x5a65d4=function(_0x108f9a){return!_[_0xd66b('0x64')](['IS\x20NULL',_0xd66b('0x8b'),_0xd66b('0x66'),'IS\x20NOT\x20EMPTY'],_0x108f9a);};var _0x3c5a72=function(_0x22703f){if(!_0x22703f||!_0x22703f[_0xd66b('0x68')][_0xd66b('0x37')]){return'';}for(var _0x480c6f='(',_0x2d0070=0x0;_0x2d0070<_0x22703f['rules'][_0xd66b('0x37')];_0x2d0070+=0x1){_0x2d0070>0x0&&(_0x480c6f+='\x20'+_0x22703f['operator']+'\x20');_0x480c6f+=_0x22703f['rules'][_0x2d0070][_0xd66b('0x69')]?_0x3c5a72(_0x22703f['rules'][_0x2d0070]['group']):_0x22703f['rules'][_0x2d0070]['field']+'\x20'+_0x22703f[_0xd66b('0x68')][_0x2d0070]['condition']+(_0x5a65d4(_0x22703f[_0xd66b('0x68')][_0x2d0070][_0xd66b('0x6b')])?'\x20'+_0x22703f[_0xd66b('0x68')][_0x2d0070][_0xd66b('0x8c')]:'');}return _0x480c6f+')';};var _0x43ee36={'where':{'id':_0x2a6a26['params']['id']}},_0x415ffb,_0x5e0b48,_0xa80241,_0x13d9b8,_0x2e5fed;_0x43ee36=_[_0xd66b('0x3f')]({},_0x43ee36,_0x2a6a26[_0xd66b('0x41')]);return db[_0xd66b('0x2b')][_0xd66b('0x46')](_0x43ee36)[_0xd66b('0x24')](function(_0x5766aa){if(_0x5766aa){_0x415ffb=_0x5766aa;return _0x5766aa[_0xd66b('0xa5')]();}return null;})[_0xd66b('0x24')](function(_0x2e6687){if(_0x2e6687){if(!_0x2e6687[_0xd66b('0x37')]){throw new db[(_0xd66b('0x6c'))][(_0xd66b('0xa6'))](_0xd66b('0x6d'),0x193);}_0x5e0b48=_0x2e6687;return db[_0xd66b('0x6e')][_0xd66b('0x44')]({'raw':!![]});}return null;})[_0xd66b('0x24')](function(_0x1738de){if(_0x1738de){_0xa80241=_[_0xd66b('0x6f')](_0x1738de,'id');var _0x5b0519;var _0x1ee72f=squel[_0xd66b('0xa0')]();_0x1ee72f[_0xd66b('0x70')](_0x415ffb[_0xd66b('0x7e')]);for(var _0x37ce00=0x0;_0x37ce00<_0x5e0b48[_0xd66b('0x37')];_0x37ce00+=0x1){_0x5b0519=_0x5e0b48[_0x37ce00]['MetricId']?_0xa80241[_0x5e0b48[_0x37ce00][_0xd66b('0x71')]]['metric']:_0x5e0b48[_0x37ce00][_0xd66b('0x6a')];_0x5b0519=_0x5e0b48[_0x37ce00]['function']?_[_0xd66b('0x74')](_0x2b1412[_0x5e0b48[_0x37ce00][_0xd66b('0x73')]],'%s',_0x5b0519):_0x5b0519;_0x5b0519=_0x5e0b48[_0x37ce00][_0xd66b('0x75')]?_[_0xd66b('0x74')](_0x1f0507[_0x5e0b48[_0x37ce00][_0xd66b('0x75')]],'%s',_0x5b0519):_0x5b0519;if(_0x5e0b48[_0x37ce00][_0xd66b('0x8d')]){_0x1ee72f[_0xd66b('0x69')](_0x5b0519);}_0x5e0b48[_0x37ce00][_0xd66b('0x76')]&&_0x1ee72f['order'](_0x5b0519,_0x5e0b48[_0x37ce00][_0xd66b('0x76')]===_0xd66b('0x77')?![]:!![]);_0x1ee72f['field'](_0x5b0519,_0x5e0b48[_0x37ce00][_0xd66b('0x78')]||_0x5b0519);}if(_0x415ffb[_0xd66b('0x79')]){_0x415ffb[_0xd66b('0x79')]=JSON[_0xd66b('0x7a')](_0x415ffb[_0xd66b('0x79')]);for(var _0x305728=0x0;_0x305728<_0x415ffb['joins'][_0xd66b('0x37')];_0x305728+=0x1){if(_0x415ffb[_0xd66b('0x79')][_0x305728][_0xd66b('0x2e')]&&_[_0xd66b('0x64')](_0x3fd9fc,_0x415ffb['joins'][_0x305728][_0xd66b('0x2e')])&&_0x415ffb['joins'][_0x305728][_0xd66b('0x7b')]&&_0x415ffb[_0xd66b('0x79')][_0x305728]['foreignTable']&&_0x415ffb[_0xd66b('0x79')][_0x305728]['foreignKey']){_0x1ee72f[_0x415ffb[_0xd66b('0x79')][_0x305728][_0xd66b('0x2e')]](_0x415ffb['joins'][_0x305728]['foreignTable'],null,util['format'](_0xd66b('0x7d'),_0x415ffb[_0xd66b('0x7e')],_0x415ffb[_0xd66b('0x79')][_0x305728][_0xd66b('0x7b')],_0x415ffb['joins'][_0x305728][_0xd66b('0x7c')],_0x415ffb[_0xd66b('0x79')][_0x305728][_0xd66b('0x7f')]));}}}if(_0x415ffb[_0xd66b('0x80')]){_0x415ffb[_0xd66b('0x80')]=JSON[_0xd66b('0x7a')](_0x415ffb['conditions']);_0x1ee72f[_0xd66b('0x3c')](_0x3c5a72(_0x415ffb[_0xd66b('0x80')][_0xd66b('0x69')]));}_0x2e5fed=_0x1ee72f[_0xd66b('0x81')]();_0x1ee72f[_0xd66b('0x1f')](_0x203b67);_0x1ee72f[_0xd66b('0x1e')](0x0);logger['debug']('Limited\x20Query:',_0x1ee72f['toString']());return dbH['sequelize'][_0xd66b('0x31')](_0x1ee72f[_0xd66b('0x84')](),{'type':dbH[_0xd66b('0x85')][_0xd66b('0x86')]['SELECT']});}})['then'](function(){return{'sql':_0x2e5fed['toString']()};})[_0xd66b('0x24')](respondWithResult(_0x53f18a,null))[_0xd66b('0x47')](handleError(_0x53f18a,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 3bfc25b..13cfcaa 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 _0x4483=['./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','util','../../config/logger','api','path','../../config/environment'];(function(_0xdcb46f,_0x8f628e){var _0x1382d8=function(_0x381441){while(--_0x381441){_0xdcb46f['push'](_0xdcb46f['shift']());}};_0x1382d8(++_0x8f628e);}(_0x4483,0x16c));var _0x3448=function(_0x34a765,_0x1e5bed){_0x34a765=_0x34a765-0x0;var _0x42e664=_0x4483[_0x34a765];return _0x42e664;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var logger=require(_0x3448('0x2'))(_0x3448('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3448('0x4'));var rimraf=require('rimraf');var config=require(_0x3448('0x5'));var attributes=require(_0x3448('0x6'));module[_0x3448('0x7')]=function(_0x565e36,_0x35fa07){return _0x565e36[_0x3448('0x8')](_0x3448('0x9'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc5b5=['./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1956c9,_0x2ad6b4){var _0x499d4=function(_0x2fa03f){while(--_0x2fa03f){_0x1956c9['push'](_0x1956c9['shift']());}};_0x499d4(++_0x2ad6b4);}(_0xc5b5,0x1b2));var _0x5c5b=function(_0x5e8c7c,_0x3429c6){_0x5e8c7c=_0x5e8c7c-0x0;var _0x48f7bd=_0xc5b5[_0x5e8c7c];return _0x48f7bd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5c5b('0x0'))(_0x5c5b('0x1'));var moment=require('moment');var BPromise=require(_0x5c5b('0x2'));var rp=require(_0x5c5b('0x3'));var fs=require('fs');var path=require(_0x5c5b('0x4'));var rimraf=require(_0x5c5b('0x5'));var config=require('../../config/environment');var attributes=require(_0x5c5b('0x6'));module[_0x5c5b('0x7')]=function(_0x27509d,_0x6cb181){return _0x27509d[_0x5c5b('0x8')](_0x5c5b('0x9'),attributes,{'tableName':'analytics_default_reports','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 2e4a206..4b0897e 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 _0xd52d=['jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x129098,_0x5b4d7a){var _0x588f8c=function(_0x634796){while(--_0x634796){_0x129098['push'](_0x129098['shift']());}};_0x588f8c(++_0x5b4d7a);}(_0xd52d,0x1c7));var _0xdd52=function(_0x2ad674,_0x48f568){_0x2ad674=_0x2ad674-0x0;var _0x544a99=_0xd52d[_0x2ad674];return _0x544a99;};'use strict';var _=require('lodash');var util=require(_0xdd52('0x0'));var moment=require(_0xdd52('0x1'));var BPromise=require('bluebird');var rs=require(_0xdd52('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdd52('0x3'));var logger=require(_0xdd52('0x4'))(_0xdd52('0x5'));var config=require(_0xdd52('0x6'));var jayson=require(_0xdd52('0x7'));var client=jayson[_0xdd52('0x8')][_0xdd52('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18d01d,_0x4ca1a2,_0x1b8b74){return new BPromise(function(_0x6ab1e3,_0x8a6170){return client[_0xdd52('0xa')](_0x18d01d,_0x1b8b74)[_0xdd52('0xb')](function(_0xb6616a){logger[_0xdd52('0xc')](_0xdd52('0xd'),_0x4ca1a2,_0xdd52('0xe'));logger[_0xdd52('0xf')](_0xdd52('0x10'),_0x4ca1a2,_0xdd52('0xe'),JSON[_0xdd52('0x11')](_0xb6616a));if(_0xb6616a['error']){if(_0xb6616a[_0xdd52('0x12')][_0xdd52('0x13')]===0x1f4){logger[_0xdd52('0x12')](_0xdd52('0xd'),_0x4ca1a2,_0xb6616a[_0xdd52('0x12')][_0xdd52('0x14')]);return _0x8a6170(_0xb6616a['error'][_0xdd52('0x14')]);}logger[_0xdd52('0x12')](_0xdd52('0xd'),_0x4ca1a2,_0xb6616a['error'][_0xdd52('0x14')]);return _0x6ab1e3(_0xb6616a[_0xdd52('0x12')][_0xdd52('0x14')]);}else{logger[_0xdd52('0xc')](_0xdd52('0xd'),_0x4ca1a2,_0xdd52('0xe'));_0x6ab1e3(_0xb6616a[_0xdd52('0x15')][_0xdd52('0x14')]);}})['catch'](function(_0x468c7a){logger['error'](_0xdd52('0xd'),_0x4ca1a2,_0x468c7a);_0x8a6170(_0x468c7a);});});}
\ No newline at end of file
+var _0xe3ed=['message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x26c79f,_0x58e5b0){var _0xb36938=function(_0x5e8b6a){while(--_0x5e8b6a){_0x26c79f['push'](_0x26c79f['shift']());}};_0xb36938(++_0x58e5b0);}(_0xe3ed,0x8d));var _0xde3e=function(_0x42ae49,_0x2a8e60){_0x42ae49=_0x42ae49-0x0;var _0x1091a1=_0xe3ed[_0x42ae49];return _0x1091a1;};'use strict';var _=require(_0xde3e('0x0'));var util=require(_0xde3e('0x1'));var moment=require(_0xde3e('0x2'));var BPromise=require(_0xde3e('0x3'));var rs=require(_0xde3e('0x4'));var fs=require('fs');var Redis=require(_0xde3e('0x5'));var db=require(_0xde3e('0x6'))['db'];var utils=require(_0xde3e('0x7'));var logger=require('../../config/logger')(_0xde3e('0x8'));var config=require(_0xde3e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xde3e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x184b02,_0x4c4ac6,_0x47e97f){return new BPromise(function(_0x3e0bb4,_0x3b1597){return client[_0xde3e('0xb')](_0x184b02,_0x47e97f)[_0xde3e('0xc')](function(_0x76daf5){logger['info'](_0xde3e('0xd'),_0x4c4ac6,_0xde3e('0xe'));logger[_0xde3e('0xf')](_0xde3e('0x10'),_0x4c4ac6,'request\x20sent',JSON[_0xde3e('0x11')](_0x76daf5));if(_0x76daf5[_0xde3e('0x12')]){if(_0x76daf5['error'][_0xde3e('0x13')]===0x1f4){logger[_0xde3e('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4c4ac6,_0x76daf5[_0xde3e('0x12')]['message']);return _0x3b1597(_0x76daf5[_0xde3e('0x12')][_0xde3e('0x14')]);}logger[_0xde3e('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4c4ac6,_0x76daf5[_0xde3e('0x12')][_0xde3e('0x14')]);return _0x3e0bb4(_0x76daf5['error']['message']);}else{logger[_0xde3e('0x15')](_0xde3e('0xd'),_0x4c4ac6,_0xde3e('0xe'));_0x3e0bb4(_0x76daf5['result']['message']);}})[_0xde3e('0x16')](function(_0x5e041a){logger['error'](_0xde3e('0xd'),_0x4c4ac6,_0x5e041a);_0x3b1597(_0x5e041a);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 27fb186..bbf93fb 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 _0xbb6c=['query','post','create','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','show','preview','/:id/run'];(function(_0x5c3891,_0x284f4c){var _0x34ecda=function(_0x5d0e10){while(--_0x5d0e10){_0x5c3891['push'](_0x5c3891['shift']());}};_0x34ecda(++_0x284f4c);}(_0xbb6c,0xe1));var _0xcbb6=function(_0x1c6a78,_0x3edd58){_0x1c6a78=_0x1c6a78-0x0;var _0x304b4f=_0xbb6c[_0x1c6a78];return _0x304b4f;};'use strict';var multer=require(_0xcbb6('0x0'));var util=require('util');var path=require(_0xcbb6('0x1'));var timeout=require('connect-timeout');var express=require(_0xcbb6('0x2'));var router=express[_0xcbb6('0x3')]();var fs_extra=require(_0xcbb6('0x4'));var auth=require(_0xcbb6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcbb6('0x6'));var controller=require(_0xcbb6('0x7'));router[_0xcbb6('0x8')]('/',auth['isAuthenticated'](),controller[_0xcbb6('0x9')]);router[_0xcbb6('0x8')](_0xcbb6('0xa'),auth[_0xcbb6('0xb')](),controller[_0xcbb6('0xc')]);router[_0xcbb6('0x8')]('/:id/preview',auth['isAuthenticated'](),controller[_0xcbb6('0xd')]);router[_0xcbb6('0x8')](_0xcbb6('0xe'),auth['isAuthenticated'](),controller['run']);router[_0xcbb6('0x8')]('/:id/query',auth[_0xcbb6('0xb')](),controller[_0xcbb6('0xf')]);router[_0xcbb6('0x10')]('/',auth['isAuthenticated'](),controller[_0xcbb6('0x11')]);router['put']('/:id',auth[_0xcbb6('0xb')](),controller['update']);router['delete'](_0xcbb6('0xa'),auth[_0xcbb6('0xb')](),controller[_0xcbb6('0x12')]);module[_0xcbb6('0x13')]=router;
\ No newline at end of file
+var _0x706d=['/:id','show','/:id/preview','preview','run','/:id/query','query','post','create','put','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index'];(function(_0x382c73,_0x199cab){var _0x1dd0bf=function(_0x358747){while(--_0x358747){_0x382c73['push'](_0x382c73['shift']());}};_0x1dd0bf(++_0x199cab);}(_0x706d,0x174));var _0xd706=function(_0x3f208a,_0x42a861){_0x3f208a=_0x3f208a-0x0;var _0x3af1d4=_0x706d[_0x3f208a];return _0x3af1d4;};'use strict';var multer=require(_0xd706('0x0'));var util=require('util');var path=require(_0xd706('0x1'));var timeout=require(_0xd706('0x2'));var express=require(_0xd706('0x3'));var router=express['Router']();var fs_extra=require(_0xd706('0x4'));var auth=require(_0xd706('0x5'));var interaction=require(_0xd706('0x6'));var config=require(_0xd706('0x7'));var controller=require(_0xd706('0x8'));router[_0xd706('0x9')]('/',auth[_0xd706('0xa')](),controller[_0xd706('0xb')]);router['get'](_0xd706('0xc'),auth[_0xd706('0xa')](),controller[_0xd706('0xd')]);router[_0xd706('0x9')](_0xd706('0xe'),auth[_0xd706('0xa')](),controller[_0xd706('0xf')]);router['get']('/:id/run',auth[_0xd706('0xa')](),controller[_0xd706('0x10')]);router[_0xd706('0x9')](_0xd706('0x11'),auth['isAuthenticated'](),controller[_0xd706('0x12')]);router[_0xd706('0x13')]('/',auth[_0xd706('0xa')](),controller[_0xd706('0x14')]);router[_0xd706('0x15')](_0xd706('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xd706('0x16')](_0xd706('0xc'),auth[_0xd706('0xa')](),controller[_0xd706('0x17')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 9002296..6237932 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 _0x6661=['csv','pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM'];(function(_0x39ee5b,_0x3e52be){var _0x5b178c=function(_0x56c8f5){while(--_0x56c8f5){_0x39ee5b['push'](_0x39ee5b['shift']());}};_0x5b178c(++_0x3e52be);}(_0x6661,0x1d7));var _0x1666=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x6661[_0x2112d4];return _0x434972;};'use strict';var Sequelize=require(_0x1666('0x0'));var moment=require(_0x1666('0x1'));module[_0x1666('0x2')]={'name':{'type':Sequelize[_0x1666('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x1666('0x4')](_0x1666('0x5'),_0x1666('0x6'),_0x1666('0x7')),'allowNull':![],'defaultValue':_0x1666('0x5')},'savename':{'type':Sequelize[_0x1666('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x1666('0x8')]},'endDate':{'type':Sequelize[_0x1666('0x8')]},'status':{'type':Sequelize[_0x1666('0x3')],'defaultValue':_0x1666('0x9')},'type':{'type':Sequelize[_0x1666('0x4')](_0x1666('0xa'),_0x1666('0xb')),'allowNull':![],'defaultValue':_0x1666('0xa')},'reportId':{'type':Sequelize[_0x1666('0xc')](0xb)[_0x1666('0xd')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2a06=['moment','exports','STRING','csv','pdf','DATE','Loading','manual','INTEGER','sequelize'];(function(_0x237b41,_0x4639f3){var _0x8544a0=function(_0x1bb11b){while(--_0x1bb11b){_0x237b41['push'](_0x237b41['shift']());}};_0x8544a0(++_0x4639f3);}(_0x2a06,0xd1));var _0x62a0=function(_0x14dd9e,_0x2cafac){_0x14dd9e=_0x14dd9e-0x0;var _0x583c61=_0x2a06[_0x14dd9e];return _0x583c61;};'use strict';var Sequelize=require(_0x62a0('0x0'));var moment=require(_0x62a0('0x1'));module[_0x62a0('0x2')]={'name':{'type':Sequelize[_0x62a0('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x62a0('0x4'),_0x62a0('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x62a0('0x4')},'savename':{'type':Sequelize[_0x62a0('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x62a0('0x6')]},'endDate':{'type':Sequelize[_0x62a0('0x6')]},'status':{'type':Sequelize[_0x62a0('0x3')],'defaultValue':_0x62a0('0x7')},'type':{'type':Sequelize['ENUM'](_0x62a0('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0x62a0('0x8')},'reportId':{'type':Sequelize[_0x62a0('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x62a0('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 05f3428..6a42a4e 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 _0xb2ff=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','root','format','output','toLowerCase','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','end','status','count','offset','limit','json','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','error','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','where','pick','merge','type','filter','options','includeAll','findAll','show','params','find','catch','create','body','role','user','UserProfileSection'];(function(_0x2a56ad,_0x2b94bf){var _0x425175=function(_0x342f20){while(--_0x342f20){_0x2a56ad['push'](_0x2a56ad['shift']());}};_0x425175(++_0x2b94bf);}(_0xb2ff,0xbe));var _0xfb2f=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb2ff[_0x3bf83f];return _0x22c4a9;};'use strict';var pdf=require(_0xfb2f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfb2f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb2f('0x2'));var rp=require(_0xfb2f('0x3'));var moment=require(_0xfb2f('0x4'));var BPromise=require(_0xfb2f('0x5'));var Mustache=require('mustache');var util=require(_0xfb2f('0x6'));var path=require(_0xfb2f('0x7'));var sox=require(_0xfb2f('0x8'));var csv=require(_0xfb2f('0x9'));var ejs=require(_0xfb2f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb2f('0xb'));var squel=require(_0xfb2f('0xc'));var crypto=require('crypto');var jsforce=require(_0xfb2f('0xd'));var deskjs=require(_0xfb2f('0xe'));var toCsv=require(_0xfb2f('0x9'));var querystring=require(_0xfb2f('0xf'));var Papa=require(_0xfb2f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfb2f('0x11'));var as=require(_0xfb2f('0x12'));var hardwareService=require(_0xfb2f('0x13'));var logger=require(_0xfb2f('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfb2f('0x15'))['db'];function respondWithStatusCode(_0x3c58d7,_0x22af20){_0x22af20=_0x22af20||0xcc;return function(_0x105573){if(_0x105573){return _0x3c58d7[_0xfb2f('0x16')](_0x22af20);}return _0x3c58d7['status'](_0x22af20)[_0xfb2f('0x17')]();};}function respondWithResult(_0x2e7f13,_0x43c90f){_0x43c90f=_0x43c90f||0xc8;return function(_0x38f5a0){if(_0x38f5a0){return _0x2e7f13[_0xfb2f('0x18')](_0x43c90f)['json'](_0x38f5a0);}};}function respondWithFilteredResult(_0x3038ce,_0x494538){return function(_0x180fa8){if(_0x180fa8){var _0x85cdbc=_0x180fa8[_0xfb2f('0x19')],_0x1deec1=_0x494538[_0xfb2f('0x1a')],_0x4162e6=_0x494538[_0xfb2f('0x1a')]+_0x494538[_0xfb2f('0x1b')],_0x12873e;if(_0x4162e6>=_0x85cdbc){_0x4162e6=_0x85cdbc;_0x12873e=0xc8;}else{_0x12873e=0xce;}_0x3038ce[_0xfb2f('0x18')](_0x12873e);return _0x3038ce['set']('Content-Range',_0x1deec1+'-'+_0x4162e6+'/'+_0x85cdbc)[_0xfb2f('0x1c')](_0x180fa8);}return null;};}function patchUpdates(_0x108c4e){return function(_0x890dfb){try{jsonpatch[_0xfb2f('0x1d')](_0x890dfb,_0x108c4e,!![]);}catch(_0xbd3cc9){return BPromise[_0xfb2f('0x1e')](_0xbd3cc9);}return _0x890dfb[_0xfb2f('0x1f')]();};}function saveUpdates(_0x554f54,_0x821e20){return function(_0x210e24){if(_0x210e24){return _0x210e24[_0xfb2f('0x20')](_0x554f54)[_0xfb2f('0x21')](function(_0x8e34ef){return _0x8e34ef;});}return null;};}function removeEntity(_0x173e7f,_0x35d0b7){return function(_0x13ce3a){if(_0x13ce3a){return _0x13ce3a['destroy']()[_0xfb2f('0x21')](function(){var _0x9e48fc=_0x13ce3a[_0xfb2f('0x22')]({'plain':!![]});var _0x761add=_0xfb2f('0x23');return db[_0xfb2f('0x24')][_0xfb2f('0x25')]({'where':{'type':_0x761add,'resourceId':_0x9e48fc['id']}})[_0xfb2f('0x21')](function(){return _0x13ce3a;});})[_0xfb2f('0x21')](function(){_0x173e7f[_0xfb2f('0x18')](0xcc)[_0xfb2f('0x17')]();});}};}function handleEntityNotFound(_0x29d56b,_0x3ba7dd){return function(_0x14eb3f){if(!_0x14eb3f){_0x29d56b[_0xfb2f('0x16')](0x194);}return _0x14eb3f;};}function handleError(_0x22ff22,_0x7adba1){_0x7adba1=_0x7adba1||0x1f4;return function(_0x3c969f){logger[_0xfb2f('0x26')](_0x3c969f[_0xfb2f('0x27')]);if(_0x3c969f[_0xfb2f('0x28')]){delete _0x3c969f['name'];}_0x22ff22['status'](_0x7adba1)[_0xfb2f('0x29')](_0x3c969f);};}exports[_0xfb2f('0x2a')]=function(_0x4ebba5,_0x16dd58){var _0x336676={},_0x587f9e={},_0x336906={'count':0x0,'rows':[]};var _0x121d26=_['map'](db[_0xfb2f('0x2b')][_0xfb2f('0x2c')],function(_0x4c28fe){return{'name':_0x4c28fe[_0xfb2f('0x2d')],'type':_0x4c28fe['type'][_0xfb2f('0x2e')]};});_0x587f9e[_0xfb2f('0x2f')]=_[_0xfb2f('0x30')](_0x121d26,_0xfb2f('0x28'));_0x587f9e[_0xfb2f('0x31')]=_[_0xfb2f('0x32')](_0x4ebba5[_0xfb2f('0x31')]);_0x587f9e[_0xfb2f('0x33')]=_[_0xfb2f('0x34')](_0x587f9e[_0xfb2f('0x2f')],_0x587f9e[_0xfb2f('0x31')]);_0x336676[_0xfb2f('0x35')]=_[_0xfb2f('0x34')](_0x587f9e['model'],qs[_0xfb2f('0x36')](_0x4ebba5[_0xfb2f('0x31')][_0xfb2f('0x36')]));_0x336676[_0xfb2f('0x35')]=_0x336676[_0xfb2f('0x35')][_0xfb2f('0x37')]?_0x336676[_0xfb2f('0x35')]:_0x587f9e[_0xfb2f('0x2f')];if(!_0x4ebba5[_0xfb2f('0x31')]['hasOwnProperty']('nolimit')){_0x336676[_0xfb2f('0x1b')]=qs[_0xfb2f('0x1b')](_0x4ebba5[_0xfb2f('0x31')][_0xfb2f('0x1b')]);_0x336676[_0xfb2f('0x1a')]=qs[_0xfb2f('0x1a')](_0x4ebba5[_0xfb2f('0x31')][_0xfb2f('0x1a')]);}_0x336676[_0xfb2f('0x38')]=qs['sort'](_0x4ebba5['query']['sort']);_0x336676[_0xfb2f('0x39')]=qs['filters'](_[_0xfb2f('0x3a')](_0x4ebba5[_0xfb2f('0x31')],_0x587f9e['filters']),_0x121d26);if(_0x4ebba5[_0xfb2f('0x31')]['filter']){_0x336676[_0xfb2f('0x39')]=_[_0xfb2f('0x3b')](_0x336676[_0xfb2f('0x39')],{'$or':_['map'](_0x121d26,function(_0x42a376){if(_0x42a376[_0xfb2f('0x3c')]!=='VIRTUAL'){var _0x55d53a={};_0x55d53a[_0x42a376[_0xfb2f('0x28')]]={'$like':'%'+_0x4ebba5[_0xfb2f('0x31')][_0xfb2f('0x3d')]+'%'};return _0x55d53a;}})});}_0x336676=_['merge']({},_0x336676,_0x4ebba5[_0xfb2f('0x3e')]);var _0x508bc4={'where':_0x336676['where']};return db[_0xfb2f('0x2b')][_0xfb2f('0x19')](_0x508bc4)[_0xfb2f('0x21')](function(_0x44c04e){_0x336906[_0xfb2f('0x19')]=_0x44c04e;if(_0x4ebba5[_0xfb2f('0x31')][_0xfb2f('0x3f')]){_0x336676['include']=[{'all':!![]}];}return db[_0xfb2f('0x2b')][_0xfb2f('0x40')](_0x336676);})[_0xfb2f('0x21')](function(_0x1f8934){_0x336906['rows']=_0x1f8934;return _0x336906;})[_0xfb2f('0x21')](respondWithFilteredResult(_0x16dd58,_0x336676))['catch'](handleError(_0x16dd58,null));};exports[_0xfb2f('0x41')]=function(_0x1f2230,_0x254cf7){var _0x26393b={'raw':!![],'where':{'id':_0x1f2230[_0xfb2f('0x42')]['id']}},_0xbea443={};_0xbea443[_0xfb2f('0x2f')]=_[_0xfb2f('0x32')](db[_0xfb2f('0x2b')][_0xfb2f('0x2c')]);_0xbea443[_0xfb2f('0x31')]=_[_0xfb2f('0x32')](_0x1f2230[_0xfb2f('0x31')]);_0xbea443[_0xfb2f('0x33')]=_[_0xfb2f('0x34')](_0xbea443['model'],_0xbea443['query']);_0x26393b['attributes']=_[_0xfb2f('0x34')](_0xbea443[_0xfb2f('0x2f')],qs[_0xfb2f('0x36')](_0x1f2230['query']['fields']));_0x26393b['attributes']=_0x26393b[_0xfb2f('0x35')][_0xfb2f('0x37')]?_0x26393b[_0xfb2f('0x35')]:_0xbea443['model'];if(_0x1f2230[_0xfb2f('0x31')][_0xfb2f('0x3f')]){_0x26393b['include']=[{'all':!![]}];}_0x26393b=_['merge']({},_0x26393b,_0x1f2230[_0xfb2f('0x3e')]);return db[_0xfb2f('0x2b')][_0xfb2f('0x43')](_0x26393b)['then'](handleEntityNotFound(_0x254cf7,null))[_0xfb2f('0x21')](respondWithResult(_0x254cf7,null))[_0xfb2f('0x44')](handleError(_0x254cf7,null));};exports['create']=function(_0x2f5ad5,_0x115b06){return db[_0xfb2f('0x2b')][_0xfb2f('0x45')](_0x2f5ad5[_0xfb2f('0x46')],{})[_0xfb2f('0x21')](function(_0x3310c9){var _0x173f39=_0x2f5ad5['user']['get']({'plain':!![]});if(!_0x173f39)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x173f39[_0xfb2f('0x47')]===_0xfb2f('0x48')){var _0x4f1e71=_0x3310c9[_0xfb2f('0x22')]({'plain':!![]});var _0x593687=_0xfb2f('0x23');return db[_0xfb2f('0x49')]['find']({'where':{'name':_0x593687,'userProfileId':_0x173f39['userProfileId']},'raw':!![]})[_0xfb2f('0x21')](function(_0x2d60db){if(_0x2d60db&&_0x2d60db[_0xfb2f('0x4a')]===0x0){return db['UserProfileResource'][_0xfb2f('0x45')]({'name':_0x4f1e71[_0xfb2f('0x28')],'resourceId':_0x4f1e71['id'],'type':_0x2d60db[_0xfb2f('0x28')],'sectionId':_0x2d60db['id']},{})['then'](function(){return _0x3310c9;});}else{return _0x3310c9;}})['catch'](function(_0x3569fd){logger['error'](_0xfb2f('0x4b'),_0x3569fd);throw _0x3569fd;});}return _0x3310c9;})[_0xfb2f('0x21')](respondWithResult(_0x115b06,0xc9))[_0xfb2f('0x44')](handleError(_0x115b06,null));};exports[_0xfb2f('0x20')]=function(_0xfe9c4e,_0x611b29){if(_0xfe9c4e[_0xfb2f('0x46')]['id']){delete _0xfe9c4e[_0xfb2f('0x46')]['id'];}return db['AnalyticExtractedReport'][_0xfb2f('0x43')]({'where':{'id':_0xfe9c4e[_0xfb2f('0x42')]['id']}})[_0xfb2f('0x21')](handleEntityNotFound(_0x611b29,null))[_0xfb2f('0x21')](saveUpdates(_0xfe9c4e[_0xfb2f('0x46')],null))[_0xfb2f('0x21')](respondWithResult(_0x611b29,null))[_0xfb2f('0x44')](handleError(_0x611b29,null));};exports[_0xfb2f('0x25')]=function(_0x3df49d,_0x467662){return db['AnalyticExtractedReport'][_0xfb2f('0x43')]({'where':{'id':_0x3df49d[_0xfb2f('0x42')]['id']}})['then'](handleEntityNotFound(_0x467662,null))[_0xfb2f('0x21')](removeEntity(_0x467662,null))[_0xfb2f('0x44')](handleError(_0x467662,null));};exports[_0xfb2f('0x4c')]=function(_0x2465a3,_0x3bc4fb,_0x1bfbfc){return db['AnalyticExtractedReport'][_0xfb2f('0x43')]({'where':{'id':_0x2465a3[_0xfb2f('0x42')]['id']},'attributes':[_0xfb2f('0x28'),_0xfb2f('0x4d'),_0xfb2f('0x4e'),'output'],'raw':!![]})[_0xfb2f('0x21')](handleEntityNotFound(_0x3bc4fb,null))[_0xfb2f('0x21')](function(_0x1f98b3){if(_0x1f98b3){if(!fs['existsSync'](path[_0xfb2f('0x4f')](config['root'],_0xfb2f('0x50'),_0x1f98b3[_0xfb2f('0x4e')]))){throw new db[(_0xfb2f('0x51'))][(_0xfb2f('0x52'))](_0xfb2f('0x53'));}if(_0x2465a3[_0xfb2f('0x31')]['exists']){return _0x3bc4fb['sendStatus'](0xc8);}return _0x3bc4fb[_0xfb2f('0x4c')](path[_0xfb2f('0x4f')](config[_0xfb2f('0x54')],_0xfb2f('0x50'),_0x1f98b3[_0xfb2f('0x4e')]),util[_0xfb2f('0x55')]('%s.%s',_0x1f98b3[_0xfb2f('0x4d')]||_0x1f98b3[_0xfb2f('0x28')],_0x1f98b3[_0xfb2f('0x56')][_0xfb2f('0x57')]()));}})['catch'](handleError(_0x3bc4fb,null));};
\ No newline at end of file
+var _0x65c2=['stack','name','index','map','AnalyticExtractedReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','params','rawAttributes','length','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','join','root','Report\x20not\x20found\x20or\x20empty','exists','download','format','%s.%s','output','toLowerCase','html-pdf','eml-format','rimraf','zip-dir','mustache','sox','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','error'];(function(_0x15ab62,_0x23feb1){var _0x182543=function(_0x510ef0){while(--_0x510ef0){_0x15ab62['push'](_0x15ab62['shift']());}};_0x182543(++_0x23feb1);}(_0x65c2,0x92));var _0x265c=function(_0x37f0e2,_0x27c5d3){_0x37f0e2=_0x37f0e2-0x0;var _0x3eeb75=_0x65c2[_0x37f0e2];return _0x3eeb75;};'use strict';var pdf=require(_0x265c('0x0'));var emlformat=require(_0x265c('0x1'));var rimraf=require(_0x265c('0x2'));var zipdir=require(_0x265c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x265c('0x4'));var util=require('util');var path=require('path');var sox=require(_0x265c('0x5'));var csv=require('to-csv');var ejs=require(_0x265c('0x6'));var fs=require('fs');var fs_extra=require(_0x265c('0x7'));var _=require(_0x265c('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x265c('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x265c('0xa'));var Papa=require('papaparse');var Redis=require(_0x265c('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x265c('0xc'));var as=require(_0x265c('0xd'));var hardwareService=require(_0x265c('0xe'));var logger=require(_0x265c('0xf'))(_0x265c('0x10'));var utils=require(_0x265c('0x11'));var config=require(_0x265c('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17440f,_0x158c1d){_0x158c1d=_0x158c1d||0xcc;return function(_0x35ae7f){if(_0x35ae7f){return _0x17440f[_0x265c('0x13')](_0x158c1d);}return _0x17440f[_0x265c('0x14')](_0x158c1d)[_0x265c('0x15')]();};}function respondWithResult(_0x2ee295,_0x4b9463){_0x4b9463=_0x4b9463||0xc8;return function(_0x49aae5){if(_0x49aae5){return _0x2ee295[_0x265c('0x14')](_0x4b9463)[_0x265c('0x16')](_0x49aae5);}};}function respondWithFilteredResult(_0x1465b8,_0x7ce747){return function(_0x257466){if(_0x257466){var _0xfbad24=_0x257466[_0x265c('0x17')],_0x1ab230=_0x7ce747[_0x265c('0x18')],_0x21a391=_0x7ce747[_0x265c('0x18')]+_0x7ce747['limit'],_0x17372d;if(_0x21a391>=_0xfbad24){_0x21a391=_0xfbad24;_0x17372d=0xc8;}else{_0x17372d=0xce;}_0x1465b8[_0x265c('0x14')](_0x17372d);return _0x1465b8['set'](_0x265c('0x19'),_0x1ab230+'-'+_0x21a391+'/'+_0xfbad24)[_0x265c('0x16')](_0x257466);}return null;};}function patchUpdates(_0x301adf){return function(_0x9b3719){try{jsonpatch[_0x265c('0x1a')](_0x9b3719,_0x301adf,!![]);}catch(_0x46975c){return BPromise[_0x265c('0x1b')](_0x46975c);}return _0x9b3719[_0x265c('0x1c')]();};}function saveUpdates(_0xd5cf96,_0x57c71a){return function(_0x30e089){if(_0x30e089){return _0x30e089[_0x265c('0x1d')](_0xd5cf96)[_0x265c('0x1e')](function(_0x13f793){return _0x13f793;});}return null;};}function removeEntity(_0x463b95,_0x3370c5){return function(_0x5c0901){if(_0x5c0901){return _0x5c0901[_0x265c('0x1f')]()[_0x265c('0x1e')](function(){var _0x16a3eb=_0x5c0901['get']({'plain':!![]});var _0x25d4d3='ExtractedReports';return db[_0x265c('0x20')][_0x265c('0x1f')]({'where':{'type':_0x25d4d3,'resourceId':_0x16a3eb['id']}})[_0x265c('0x1e')](function(){return _0x5c0901;});})[_0x265c('0x1e')](function(){_0x463b95[_0x265c('0x14')](0xcc)[_0x265c('0x15')]();});}};}function handleEntityNotFound(_0x4518f4,_0x240c1e){return function(_0x445f00){if(!_0x445f00){_0x4518f4['sendStatus'](0x194);}return _0x445f00;};}function handleError(_0x55e270,_0x5a1bb4){_0x5a1bb4=_0x5a1bb4||0x1f4;return function(_0x96878a){logger[_0x265c('0x21')](_0x96878a[_0x265c('0x22')]);if(_0x96878a[_0x265c('0x23')]){delete _0x96878a[_0x265c('0x23')];}_0x55e270[_0x265c('0x14')](_0x5a1bb4)['send'](_0x96878a);};}exports[_0x265c('0x24')]=function(_0x1d32e1,_0x57df82){var _0x148a37={},_0x49732a={},_0x5268c0={'count':0x0,'rows':[]};var _0x5308f3=_[_0x265c('0x25')](db[_0x265c('0x26')]['rawAttributes'],function(_0x13a9dd){return{'name':_0x13a9dd[_0x265c('0x27')],'type':_0x13a9dd[_0x265c('0x28')][_0x265c('0x29')]};});_0x49732a[_0x265c('0x2a')]=_['map'](_0x5308f3,'name');_0x49732a[_0x265c('0x2b')]=_[_0x265c('0x2c')](_0x1d32e1[_0x265c('0x2b')]);_0x49732a[_0x265c('0x2d')]=_[_0x265c('0x2e')](_0x49732a[_0x265c('0x2a')],_0x49732a['query']);_0x148a37[_0x265c('0x2f')]=_[_0x265c('0x2e')](_0x49732a['model'],qs[_0x265c('0x30')](_0x1d32e1[_0x265c('0x2b')][_0x265c('0x30')]));_0x148a37['attributes']=_0x148a37[_0x265c('0x2f')]['length']?_0x148a37['attributes']:_0x49732a[_0x265c('0x2a')];if(!_0x1d32e1[_0x265c('0x2b')][_0x265c('0x31')](_0x265c('0x32'))){_0x148a37[_0x265c('0x33')]=qs[_0x265c('0x33')](_0x1d32e1['query'][_0x265c('0x33')]);_0x148a37[_0x265c('0x18')]=qs[_0x265c('0x18')](_0x1d32e1[_0x265c('0x2b')]['offset']);}_0x148a37[_0x265c('0x34')]=qs[_0x265c('0x35')](_0x1d32e1[_0x265c('0x2b')][_0x265c('0x35')]);_0x148a37[_0x265c('0x36')]=qs['filters'](_[_0x265c('0x37')](_0x1d32e1[_0x265c('0x2b')],_0x49732a[_0x265c('0x2d')]),_0x5308f3);if(_0x1d32e1[_0x265c('0x2b')][_0x265c('0x38')]){_0x148a37[_0x265c('0x36')]=_[_0x265c('0x39')](_0x148a37['where'],{'$or':_[_0x265c('0x25')](_0x5308f3,function(_0x2b8212){if(_0x2b8212[_0x265c('0x28')]!=='VIRTUAL'){var _0xf029df={};_0xf029df[_0x2b8212[_0x265c('0x23')]]={'$like':'%'+_0x1d32e1[_0x265c('0x2b')][_0x265c('0x38')]+'%'};return _0xf029df;}})});}_0x148a37=_['merge']({},_0x148a37,_0x1d32e1[_0x265c('0x3a')]);var _0x3dd4be={'where':_0x148a37['where']};return db[_0x265c('0x26')][_0x265c('0x17')](_0x3dd4be)[_0x265c('0x1e')](function(_0x4cf614){_0x5268c0[_0x265c('0x17')]=_0x4cf614;if(_0x1d32e1[_0x265c('0x2b')][_0x265c('0x3b')]){_0x148a37[_0x265c('0x3c')]=[{'all':!![]}];}return db[_0x265c('0x26')][_0x265c('0x3d')](_0x148a37);})[_0x265c('0x1e')](function(_0x23efac){_0x5268c0['rows']=_0x23efac;return _0x5268c0;})[_0x265c('0x1e')](respondWithFilteredResult(_0x57df82,_0x148a37))['catch'](handleError(_0x57df82,null));};exports[_0x265c('0x3e')]=function(_0x2b4774,_0x228d9b){var _0x21c9cb={'raw':!![],'where':{'id':_0x2b4774[_0x265c('0x3f')]['id']}},_0x422d55={};_0x422d55['model']=_[_0x265c('0x2c')](db[_0x265c('0x26')][_0x265c('0x40')]);_0x422d55[_0x265c('0x2b')]=_[_0x265c('0x2c')](_0x2b4774['query']);_0x422d55[_0x265c('0x2d')]=_['intersection'](_0x422d55[_0x265c('0x2a')],_0x422d55[_0x265c('0x2b')]);_0x21c9cb[_0x265c('0x2f')]=_[_0x265c('0x2e')](_0x422d55[_0x265c('0x2a')],qs['fields'](_0x2b4774[_0x265c('0x2b')]['fields']));_0x21c9cb['attributes']=_0x21c9cb['attributes'][_0x265c('0x41')]?_0x21c9cb[_0x265c('0x2f')]:_0x422d55[_0x265c('0x2a')];if(_0x2b4774[_0x265c('0x2b')][_0x265c('0x3b')]){_0x21c9cb[_0x265c('0x3c')]=[{'all':!![]}];}_0x21c9cb=_[_0x265c('0x39')]({},_0x21c9cb,_0x2b4774[_0x265c('0x3a')]);return db['AnalyticExtractedReport']['find'](_0x21c9cb)[_0x265c('0x1e')](handleEntityNotFound(_0x228d9b,null))[_0x265c('0x1e')](respondWithResult(_0x228d9b,null))[_0x265c('0x42')](handleError(_0x228d9b,null));};exports[_0x265c('0x43')]=function(_0x2e9ece,_0x338cb2){return db[_0x265c('0x26')][_0x265c('0x43')](_0x2e9ece[_0x265c('0x44')],{})[_0x265c('0x1e')](function(_0x770445){var _0x53bcf6=_0x2e9ece[_0x265c('0x45')][_0x265c('0x46')]({'plain':!![]});if(!_0x53bcf6)throw new Error(_0x265c('0x47'));if(_0x53bcf6[_0x265c('0x48')]==='user'){var _0x2ef436=_0x770445['get']({'plain':!![]});var _0x47fa45=_0x265c('0x49');return db[_0x265c('0x4a')][_0x265c('0x4b')]({'where':{'name':_0x47fa45,'userProfileId':_0x53bcf6[_0x265c('0x4c')]},'raw':!![]})[_0x265c('0x1e')](function(_0x17628d){if(_0x17628d&&_0x17628d[_0x265c('0x4d')]===0x0){return db[_0x265c('0x20')][_0x265c('0x43')]({'name':_0x2ef436['name'],'resourceId':_0x2ef436['id'],'type':_0x17628d[_0x265c('0x23')],'sectionId':_0x17628d['id']},{})[_0x265c('0x1e')](function(){return _0x770445;});}else{return _0x770445;}})[_0x265c('0x42')](function(_0x412656){logger[_0x265c('0x21')](_0x265c('0x4e'),_0x412656);throw _0x412656;});}return _0x770445;})[_0x265c('0x1e')](respondWithResult(_0x338cb2,0xc9))['catch'](handleError(_0x338cb2,null));};exports['update']=function(_0x4d6190,_0x1120bc){if(_0x4d6190['body']['id']){delete _0x4d6190[_0x265c('0x44')]['id'];}return db[_0x265c('0x26')][_0x265c('0x4b')]({'where':{'id':_0x4d6190[_0x265c('0x3f')]['id']}})[_0x265c('0x1e')](handleEntityNotFound(_0x1120bc,null))['then'](saveUpdates(_0x4d6190['body'],null))[_0x265c('0x1e')](respondWithResult(_0x1120bc,null))['catch'](handleError(_0x1120bc,null));};exports[_0x265c('0x1f')]=function(_0x56dbf5,_0x390001){return db[_0x265c('0x26')][_0x265c('0x4b')]({'where':{'id':_0x56dbf5[_0x265c('0x3f')]['id']}})[_0x265c('0x1e')](handleEntityNotFound(_0x390001,null))[_0x265c('0x1e')](removeEntity(_0x390001,null))[_0x265c('0x42')](handleError(_0x390001,null));};exports['download']=function(_0xfbfe95,_0x5f4e68,_0x375dd5){return db[_0x265c('0x26')]['find']({'where':{'id':_0xfbfe95['params']['id']},'attributes':[_0x265c('0x23'),_0x265c('0x4f'),_0x265c('0x50'),'output'],'raw':!![]})[_0x265c('0x1e')](handleEntityNotFound(_0x5f4e68,null))['then'](function(_0x1020de){if(_0x1020de){if(!fs['existsSync'](path[_0x265c('0x51')](config[_0x265c('0x52')],'server/files/reports',_0x1020de[_0x265c('0x50')]))){throw new db['Sequelize']['ValidationError'](_0x265c('0x53'));}if(_0xfbfe95['query'][_0x265c('0x54')]){return _0x5f4e68[_0x265c('0x13')](0xc8);}return _0x5f4e68[_0x265c('0x55')](path[_0x265c('0x51')](config[_0x265c('0x52')],'server/files/reports',_0x1020de['savename']),util[_0x265c('0x56')](_0x265c('0x57'),_0x1020de[_0x265c('0x4f')]||_0x1020de[_0x265c('0x23')],_0x1020de[_0x265c('0x58')][_0x265c('0x59')]()));}})[_0x265c('0x42')](handleError(_0x5f4e68,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index f27fb11..68d90c9 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 _0x28da=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x5a0c34,_0x253025){var _0x19ed37=function(_0x425b89){while(--_0x425b89){_0x5a0c34['push'](_0x5a0c34['shift']());}};_0x19ed37(++_0x253025);}(_0x28da,0x9e));var _0xa28d=function(_0x281d9c,_0x4aa520){_0x281d9c=_0x281d9c-0x0;var _0x2a6149=_0x28da[_0x281d9c];return _0x2a6149;};'use strict';var _=require(_0xa28d('0x0'));var util=require(_0xa28d('0x1'));var logger=require(_0xa28d('0x2'))(_0xa28d('0x3'));var moment=require(_0xa28d('0x4'));var BPromise=require(_0xa28d('0x5'));var rp=require(_0xa28d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa28d('0x7'));var config=require(_0xa28d('0x8'));var attributes=require(_0xa28d('0x9'));module[_0xa28d('0xa')]=function(_0x5e7e3c,_0x66d19e){return _0x5e7e3c[_0xa28d('0xb')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a35=['define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x5de445,_0x6556a){var _0x57b8c4=function(_0x27b039){while(--_0x27b039){_0x5de445['push'](_0x5de445['shift']());}};_0x57b8c4(++_0x6556a);}(_0x7a35,0x1c5));var _0x57a3=function(_0x50ffbb,_0x21a925){_0x50ffbb=_0x50ffbb-0x0;var _0x576a1c=_0x7a35[_0x50ffbb];return _0x576a1c;};'use strict';var _=require(_0x57a3('0x0'));var util=require('util');var logger=require(_0x57a3('0x1'))(_0x57a3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x57a3('0x3'));var config=require(_0x57a3('0x4'));var attributes=require(_0x57a3('0x5'));module[_0x57a3('0x6')]=function(_0x2363bf,_0x1330f9){return _0x2363bf[_0x57a3('0x7')](_0x57a3('0x8'),attributes,{'tableName':_0x57a3('0x9'),'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 b5f879f..5b0c182 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 _0x7739=['debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x7739,0xdb));var _0x9773=function(_0x4460bd,_0x18f742){_0x4460bd=_0x4460bd-0x0;var _0x40a92b=_0x7739[_0x4460bd];return _0x40a92b;};'use strict';var _=require(_0x9773('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9773('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9773('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9773('0x3'))('rpc');var config=require(_0x9773('0x4'));var jayson=require(_0x9773('0x5'));var client=jayson[_0x9773('0x6')][_0x9773('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x442166,_0x33dc53,_0xac1ba7){return new BPromise(function(_0x406c39,_0x434133){return client[_0x9773('0x8')](_0x442166,_0xac1ba7)[_0x9773('0x9')](function(_0xaa2950){logger[_0x9773('0xa')](_0x9773('0xb'),_0x33dc53,'request\x20sent');logger[_0x9773('0xc')](_0x9773('0xd'),_0x33dc53,_0x9773('0xe'),JSON[_0x9773('0xf')](_0xaa2950));if(_0xaa2950['error']){if(_0xaa2950[_0x9773('0x10')][_0x9773('0x11')]===0x1f4){logger[_0x9773('0x10')](_0x9773('0xb'),_0x33dc53,_0xaa2950[_0x9773('0x10')][_0x9773('0x12')]);return _0x434133(_0xaa2950[_0x9773('0x10')]['message']);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x33dc53,_0xaa2950[_0x9773('0x10')][_0x9773('0x12')]);return _0x406c39(_0xaa2950[_0x9773('0x10')][_0x9773('0x12')]);}else{logger[_0x9773('0xa')](_0x9773('0xb'),_0x33dc53,'request\x20sent');_0x406c39(_0xaa2950[_0x9773('0x13')][_0x9773('0x12')]);}})[_0x9773('0x14')](function(_0x1ad93a){logger[_0x9773('0x10')](_0x9773('0xb'),_0x33dc53,_0x1ad93a);_0x434133(_0x1ad93a);});});}
\ No newline at end of file
+var _0x6d08=['error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x507bff,_0x3ce65b){var _0x714b98=function(_0x3997f9){while(--_0x3997f9){_0x507bff['push'](_0x507bff['shift']());}};_0x714b98(++_0x3ce65b);}(_0x6d08,0x1b5));var _0x86d0=function(_0x560cd8,_0x126e2f){_0x560cd8=_0x560cd8-0x0;var _0x369de0=_0x6d08[_0x560cd8];return _0x369de0;};'use strict';var _=require(_0x86d0('0x0'));var util=require(_0x86d0('0x1'));var moment=require(_0x86d0('0x2'));var BPromise=require(_0x86d0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x86d0('0x4'));var db=require(_0x86d0('0x5'))['db'];var utils=require(_0x86d0('0x6'));var logger=require(_0x86d0('0x7'))(_0x86d0('0x8'));var config=require('../../config/environment');var jayson=require(_0x86d0('0x9'));var client=jayson[_0x86d0('0xa')][_0x86d0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d1331,_0xf14b7c,_0x29b1e9){return new BPromise(function(_0x30022c,_0xcf26d6){return client[_0x86d0('0xc')](_0x3d1331,_0x29b1e9)[_0x86d0('0xd')](function(_0x21fab2){logger['info'](_0x86d0('0xe'),_0xf14b7c,_0x86d0('0xf'));logger[_0x86d0('0x10')](_0x86d0('0x11'),_0xf14b7c,_0x86d0('0xf'),JSON[_0x86d0('0x12')](_0x21fab2));if(_0x21fab2['error']){if(_0x21fab2['error']['code']===0x1f4){logger[_0x86d0('0x13')](_0x86d0('0xe'),_0xf14b7c,_0x21fab2[_0x86d0('0x13')]['message']);return _0xcf26d6(_0x21fab2[_0x86d0('0x13')][_0x86d0('0x14')]);}logger[_0x86d0('0x13')](_0x86d0('0xe'),_0xf14b7c,_0x21fab2[_0x86d0('0x13')][_0x86d0('0x14')]);return _0x30022c(_0x21fab2[_0x86d0('0x13')][_0x86d0('0x14')]);}else{logger[_0x86d0('0x15')](_0x86d0('0xe'),_0xf14b7c,'request\x20sent');_0x30022c(_0x21fab2[_0x86d0('0x16')][_0x86d0('0x14')]);}})[_0x86d0('0x17')](function(_0x2d81f2){logger[_0x86d0('0x13')](_0x86d0('0xe'),_0xf14b7c,_0x2d81f2);_0xcf26d6(_0x2d81f2);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index dbc3ca0..d78c023 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 _0x4fd7=['get','index','/:id','isAuthenticated','show','download','post','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x368d42,_0x5eb5ae){var _0x26da06=function(_0x3823f1){while(--_0x3823f1){_0x368d42['push'](_0x368d42['shift']());}};_0x26da06(++_0x5eb5ae);}(_0x4fd7,0x107));var _0x74fd=function(_0x4499d8,_0x2fb36e){_0x4499d8=_0x4499d8-0x0;var _0x1fd257=_0x4fd7[_0x4499d8];return _0x1fd257;};'use strict';var multer=require(_0x74fd('0x0'));var util=require(_0x74fd('0x1'));var path=require(_0x74fd('0x2'));var timeout=require('connect-timeout');var express=require(_0x74fd('0x3'));var router=express[_0x74fd('0x4')]();var fs_extra=require(_0x74fd('0x5'));var auth=require(_0x74fd('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0x74fd('0x7')]('/',auth['isAuthenticated'](),controller[_0x74fd('0x8')]);router['get'](_0x74fd('0x9'),auth[_0x74fd('0xa')](),controller[_0x74fd('0xb')]);router[_0x74fd('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x74fd('0xc')]);router[_0x74fd('0xd')]('/',auth[_0x74fd('0xa')](),controller['create']);router[_0x74fd('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x74fd('0xf')]);router[_0x74fd('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x74fd('0x11')]=router;
\ No newline at end of file
+var _0xa472=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/download','post','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x28f4a3,_0x1e9165){var _0x587861=function(_0x3c4b61){while(--_0x3c4b61){_0x28f4a3['push'](_0x28f4a3['shift']());}};_0x587861(++_0x1e9165);}(_0xa472,0x6c));var _0x2a47=function(_0x373dca,_0x336990){_0x373dca=_0x373dca-0x0;var _0x7a6fe=_0xa472[_0x373dca];return _0x7a6fe;};'use strict';var multer=require(_0x2a47('0x0'));var util=require(_0x2a47('0x1'));var path=require(_0x2a47('0x2'));var timeout=require(_0x2a47('0x3'));var express=require('express');var router=express[_0x2a47('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2a47('0x5'));var interaction=require(_0x2a47('0x6'));var config=require(_0x2a47('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x2a47('0x8')]('/',auth[_0x2a47('0x9')](),controller[_0x2a47('0xa')]);router[_0x2a47('0x8')]('/:id',auth[_0x2a47('0x9')](),controller[_0x2a47('0xb')]);router[_0x2a47('0x8')](_0x2a47('0xc'),auth['isAuthenticated'](),controller['download']);router[_0x2a47('0xd')]('/',auth[_0x2a47('0x9')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x2a47('0xe')]);router[_0x2a47('0xf')](_0x2a47('0x10'),auth[_0x2a47('0x9')](),controller[_0x2a47('0x11')]);module[_0x2a47('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 82bd23e..0c6da3f 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 _0x7217=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x3ac27a,_0x41595a){var _0x29823b=function(_0x17c447){while(--_0x17c447){_0x3ac27a['push'](_0x3ac27a['shift']());}};_0x29823b(++_0x41595a);}(_0x7217,0x19e));var _0x7721=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x7217[_0x298ed3];return _0x5aad28;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'field':{'type':Sequelize[_0x7721('0x1')]},'alias':{'type':Sequelize[_0x7721('0x2')]},'function':{'type':Sequelize[_0x7721('0x2')]},'format':{'type':Sequelize[_0x7721('0x2')]},'groupBy':{'type':Sequelize[_0x7721('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x5fc3=['sequelize','exports','STRING','BOOLEAN'];(function(_0x40a91d,_0x565ef0){var _0x2a887e=function(_0x369aa8){while(--_0x369aa8){_0x40a91d['push'](_0x40a91d['shift']());}};_0x2a887e(++_0x565ef0);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3474ac,_0x22d0f7){_0x3474ac=_0x3474ac-0x0;var _0x5345ec=_0x5fc3[_0x3474ac];return _0x5345ec;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x35fc('0x2')]},'function':{'type':Sequelize[_0x35fc('0x2')]},'format':{'type':Sequelize[_0x35fc('0x2')]},'groupBy':{'type':Sequelize[_0x35fc('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x35fc('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index bc09df4..9dacbae 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 _0xc6c3=['apply','reject','save','update','then','destroy','error','stack','send','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','findAll','rows','catch','show','params','length','include','merge','options','find','create','bulkCreate','body','bulkDestroy','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc6c3,0x1cc));var _0x3c6c=function(_0x180e04,_0x1c0f31){_0x180e04=_0x180e04-0x0;var _0x37b2f6=_0xc6c3[_0x180e04];return _0x37b2f6;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3c6c('0x0'));var zipdir=require(_0x3c6c('0x1'));var jsonpatch=require(_0x3c6c('0x2'));var rp=require(_0x3c6c('0x3'));var moment=require(_0x3c6c('0x4'));var BPromise=require(_0x3c6c('0x5'));var Mustache=require(_0x3c6c('0x6'));var util=require(_0x3c6c('0x7'));var path=require(_0x3c6c('0x8'));var sox=require(_0x3c6c('0x9'));var csv=require(_0x3c6c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c6c('0xb'));var squel=require(_0x3c6c('0xc'));var crypto=require('crypto');var jsforce=require(_0x3c6c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3c6c('0xa'));var querystring=require(_0x3c6c('0xe'));var Papa=require(_0x3c6c('0xf'));var Redis=require('ioredis');var authService=require(_0x3c6c('0x10'));var qs=require(_0x3c6c('0x11'));var as=require(_0x3c6c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c6c('0x13'))(_0x3c6c('0x14'));var utils=require('../../config/utils');var config=require(_0x3c6c('0x15'));var licenseUtil=require(_0x3c6c('0x16'));var db=require(_0x3c6c('0x17'))['db'];function respondWithStatusCode(_0x42f50d,_0x37e4be){_0x37e4be=_0x37e4be||0xcc;return function(_0x59e1a4){if(_0x59e1a4){return _0x42f50d[_0x3c6c('0x18')](_0x37e4be);}return _0x42f50d['status'](_0x37e4be)[_0x3c6c('0x19')]();};}function respondWithResult(_0xec6c0a,_0x5795f8){_0x5795f8=_0x5795f8||0xc8;return function(_0x414b93){if(_0x414b93){return _0xec6c0a[_0x3c6c('0x1a')](_0x5795f8)[_0x3c6c('0x1b')](_0x414b93);}};}function respondWithFilteredResult(_0x3276ba,_0x3f7c54){return function(_0x5164a7){if(_0x5164a7){var _0x27c489=_0x5164a7[_0x3c6c('0x1c')],_0x2d0374=_0x3f7c54['offset'],_0x398a2c=_0x3f7c54[_0x3c6c('0x1d')]+_0x3f7c54[_0x3c6c('0x1e')],_0x41d3eb;if(_0x398a2c>=_0x27c489){_0x398a2c=_0x27c489;_0x41d3eb=0xc8;}else{_0x41d3eb=0xce;}_0x3276ba[_0x3c6c('0x1a')](_0x41d3eb);return _0x3276ba['set'](_0x3c6c('0x1f'),_0x2d0374+'-'+_0x398a2c+'/'+_0x27c489)['json'](_0x5164a7);}return null;};}function patchUpdates(_0x30f9b5){return function(_0x1ad18e){try{jsonpatch[_0x3c6c('0x20')](_0x1ad18e,_0x30f9b5,!![]);}catch(_0x4292d4){return BPromise[_0x3c6c('0x21')](_0x4292d4);}return _0x1ad18e[_0x3c6c('0x22')]();};}function saveUpdates(_0x53b97a,_0x20dc17){return function(_0xc9c5ae){if(_0xc9c5ae){return _0xc9c5ae[_0x3c6c('0x23')](_0x53b97a)[_0x3c6c('0x24')](function(_0x62df4f){return _0x62df4f;});}return null;};}function removeEntity(_0x466877,_0x3221e0){return function(_0x24fede){if(_0x24fede){return _0x24fede[_0x3c6c('0x25')]()[_0x3c6c('0x24')](function(){_0x466877[_0x3c6c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28b5de,_0x554190){return function(_0x128eeb){if(!_0x128eeb){_0x28b5de[_0x3c6c('0x18')](0x194);}return _0x128eeb;};}function handleError(_0x547db0,_0x2a092e){_0x2a092e=_0x2a092e||0x1f4;return function(_0x83fdae){logger[_0x3c6c('0x26')](_0x83fdae[_0x3c6c('0x27')]);if(_0x83fdae['name']){delete _0x83fdae['name'];}_0x547db0['status'](_0x2a092e)[_0x3c6c('0x28')](_0x83fdae);};}exports['index']=function(_0x513029,_0x5b6347){var _0x2df226={},_0x21b74f={},_0x140c40={'count':0x0,'rows':[]};var _0x591401=_[_0x3c6c('0x29')](db[_0x3c6c('0x2a')][_0x3c6c('0x2b')],function(_0x347059){return{'name':_0x347059[_0x3c6c('0x2c')],'type':_0x347059[_0x3c6c('0x2d')][_0x3c6c('0x2e')]};});_0x21b74f['model']=_['map'](_0x591401,_0x3c6c('0x2f'));_0x21b74f[_0x3c6c('0x30')]=_[_0x3c6c('0x31')](_0x513029[_0x3c6c('0x30')]);_0x21b74f[_0x3c6c('0x32')]=_[_0x3c6c('0x33')](_0x21b74f[_0x3c6c('0x34')],_0x21b74f[_0x3c6c('0x30')]);_0x2df226['attributes']=_[_0x3c6c('0x33')](_0x21b74f['model'],qs[_0x3c6c('0x35')](_0x513029[_0x3c6c('0x30')][_0x3c6c('0x35')]));_0x2df226[_0x3c6c('0x36')]=_0x2df226[_0x3c6c('0x36')]['length']?_0x2df226[_0x3c6c('0x36')]:_0x21b74f[_0x3c6c('0x34')];if(!_0x513029['query'][_0x3c6c('0x37')](_0x3c6c('0x38'))){_0x2df226[_0x3c6c('0x1e')]=qs[_0x3c6c('0x1e')](_0x513029['query'][_0x3c6c('0x1e')]);_0x2df226['offset']=qs['offset'](_0x513029[_0x3c6c('0x30')][_0x3c6c('0x1d')]);}_0x2df226[_0x3c6c('0x39')]=qs['sort'](_0x513029[_0x3c6c('0x30')][_0x3c6c('0x3a')]);_0x2df226[_0x3c6c('0x3b')]=qs[_0x3c6c('0x32')](_[_0x3c6c('0x3c')](_0x513029[_0x3c6c('0x30')],_0x21b74f[_0x3c6c('0x32')]),_0x591401);if(_0x513029[_0x3c6c('0x30')][_0x3c6c('0x3d')]){_0x2df226[_0x3c6c('0x3b')]=_['merge'](_0x2df226[_0x3c6c('0x3b')],{'$or':_[_0x3c6c('0x29')](_0x591401,function(_0xac0bf2){if(_0xac0bf2[_0x3c6c('0x2d')]!=='VIRTUAL'){var _0x5bf8dc={};_0x5bf8dc[_0xac0bf2[_0x3c6c('0x2f')]]={'$like':'%'+_0x513029[_0x3c6c('0x30')][_0x3c6c('0x3d')]+'%'};return _0x5bf8dc;}})});}_0x2df226=_['merge']({},_0x2df226,_0x513029['options']);var _0x21ef89={'where':_0x2df226['where']};return db[_0x3c6c('0x2a')]['count'](_0x21ef89)[_0x3c6c('0x24')](function(_0x49ab4e){_0x140c40[_0x3c6c('0x1c')]=_0x49ab4e;if(_0x513029[_0x3c6c('0x30')][_0x3c6c('0x3e')]){_0x2df226['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x3c6c('0x3f')](_0x2df226);})[_0x3c6c('0x24')](function(_0x4bc0c4){_0x140c40[_0x3c6c('0x40')]=_0x4bc0c4;return _0x140c40;})[_0x3c6c('0x24')](respondWithFilteredResult(_0x5b6347,_0x2df226))[_0x3c6c('0x41')](handleError(_0x5b6347,null));};exports[_0x3c6c('0x42')]=function(_0x34daf4,_0x39bf9a){var _0x40bf8f={'raw':![],'where':{'id':_0x34daf4[_0x3c6c('0x43')]['id']}},_0x2b05df={};_0x2b05df[_0x3c6c('0x34')]=_[_0x3c6c('0x31')](db[_0x3c6c('0x2a')]['rawAttributes']);_0x2b05df[_0x3c6c('0x30')]=_['keys'](_0x34daf4[_0x3c6c('0x30')]);_0x2b05df[_0x3c6c('0x32')]=_[_0x3c6c('0x33')](_0x2b05df[_0x3c6c('0x34')],_0x2b05df[_0x3c6c('0x30')]);_0x40bf8f['attributes']=_[_0x3c6c('0x33')](_0x2b05df[_0x3c6c('0x34')],qs[_0x3c6c('0x35')](_0x34daf4[_0x3c6c('0x30')][_0x3c6c('0x35')]));_0x40bf8f[_0x3c6c('0x36')]=_0x40bf8f['attributes'][_0x3c6c('0x44')]?_0x40bf8f[_0x3c6c('0x36')]:_0x2b05df[_0x3c6c('0x34')];if(_0x34daf4[_0x3c6c('0x30')]['includeAll']){_0x40bf8f[_0x3c6c('0x45')]=[{'all':!![]}];}_0x40bf8f=_[_0x3c6c('0x46')]({},_0x40bf8f,_0x34daf4[_0x3c6c('0x47')]);return db[_0x3c6c('0x2a')][_0x3c6c('0x48')](_0x40bf8f)[_0x3c6c('0x24')](handleEntityNotFound(_0x39bf9a,null))[_0x3c6c('0x24')](respondWithResult(_0x39bf9a,null))[_0x3c6c('0x41')](handleError(_0x39bf9a,null));};exports['create']=function(_0x4b9431,_0x8a205e){return db['AnalyticFieldReport'][_0x3c6c('0x49')](_0x4b9431['body'],{})['then'](respondWithResult(_0x8a205e,0xc9))[_0x3c6c('0x41')](handleError(_0x8a205e,null));};exports[_0x3c6c('0x4a')]=function(_0x5c5a9e,_0x622fde){return db['AnalyticFieldReport'][_0x3c6c('0x4a')](_0x5c5a9e[_0x3c6c('0x4b')],{'raw':![],'individualHooks':!![]})[_0x3c6c('0x24')](respondWithResult(_0x622fde,0xc9))[_0x3c6c('0x41')](handleError(_0x622fde,null));};exports[_0x3c6c('0x23')]=function(_0x58a2ba,_0x298b9f){if(_0x58a2ba[_0x3c6c('0x4b')]['id']){delete _0x58a2ba[_0x3c6c('0x4b')]['id'];}return db['AnalyticFieldReport'][_0x3c6c('0x48')]({'where':{'id':_0x58a2ba[_0x3c6c('0x43')]['id']}})[_0x3c6c('0x24')](handleEntityNotFound(_0x298b9f,null))[_0x3c6c('0x24')](saveUpdates(_0x58a2ba[_0x3c6c('0x4b')],null))['then'](respondWithResult(_0x298b9f,null))[_0x3c6c('0x41')](handleError(_0x298b9f,null));};exports['destroy']=function(_0x480b28,_0x3238cb){return db[_0x3c6c('0x2a')]['find']({'where':{'id':_0x480b28['params']['id']}})[_0x3c6c('0x24')](handleEntityNotFound(_0x3238cb,null))['then'](removeEntity(_0x3238cb,null))[_0x3c6c('0x41')](handleError(_0x3238cb,null));};exports[_0x3c6c('0x4c')]=function(_0x490678,_0x39042d){return db[_0x3c6c('0x2a')][_0x3c6c('0x25')]({'where':{'id':_0x490678[_0x3c6c('0x30')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x3c6c('0x24')](respondWithResult(_0x39042d,0xcc))[_0x3c6c('0x41')](handleError(_0x39042d,null));};exports['addFields']=function(_0x57ad3d,_0x4d8f60,_0x10744b){return db[_0x3c6c('0x4d')][_0x3c6c('0x4e')]({'where':{'id':_0x57ad3d[_0x3c6c('0x43')]['id']}})[_0x3c6c('0x24')](handleEntityNotFound(_0x4d8f60,null))[_0x3c6c('0x24')](function(_0x38f162){if(_0x38f162){return db[_0x3c6c('0x4f')][_0x3c6c('0x50')](function(_0x3b23d6){return db[_0x3c6c('0x2a')]['destroy']({'where':{'CustomReportId':_0x57ad3d[_0x3c6c('0x43')]['id']},'transaction':_0x3b23d6})[_0x3c6c('0x24')](function(_0x86a02c){var _0xb8ce99=_['map'](_0x57ad3d[_0x3c6c('0x4b')],function(_0x59ba9a){delete _0x59ba9a['id'];_0x59ba9a[_0x3c6c('0x51')]=_0x57ad3d[_0x3c6c('0x43')]['id'];return _0x59ba9a;});return db['AnalyticFieldReport'][_0x3c6c('0x4a')](_0xb8ce99,{'transaction':_0x3b23d6});});})[_0x3c6c('0x24')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x57ad3d[_0x3c6c('0x43')]['id']}});});}})['then'](respondWithResult(_0x4d8f60,null))['catch'](handleError(_0x4d8f60,null));};
\ No newline at end of file
+var _0x475f=['key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','intersection','find','create','bulkCreate','body','params','ids','addFields','AnalyticCustomReport','findOne','transaction','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','count','limit','apply','update','then','destroy','end','sendStatus','error','stack','name','send','map','AnalyticFieldReport','rawAttributes'];(function(_0xfcc030,_0x3ec053){var _0x5caa66=function(_0xf2e6d2){while(--_0xf2e6d2){_0xfcc030['push'](_0xfcc030['shift']());}};_0x5caa66(++_0x3ec053);}(_0x475f,0x112));var _0xf475=function(_0x73e4cf,_0x2a8375){_0x73e4cf=_0x73e4cf-0x0;var _0x1e1bf8=_0x475f[_0x73e4cf];return _0x1e1bf8;};'use strict';var pdf=require(_0xf475('0x0'));var emlformat=require(_0xf475('0x1'));var rimraf=require(_0xf475('0x2'));var zipdir=require(_0xf475('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf475('0x4'));var moment=require(_0xf475('0x5'));var BPromise=require(_0xf475('0x6'));var Mustache=require(_0xf475('0x7'));var util=require(_0xf475('0x8'));var path=require(_0xf475('0x9'));var sox=require(_0xf475('0xa'));var csv=require(_0xf475('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf475('0xc'));var squel=require(_0xf475('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf475('0xb'));var querystring=require('querystring');var Papa=require(_0xf475('0xe'));var Redis=require(_0xf475('0xf'));var authService=require(_0xf475('0x10'));var qs=require(_0xf475('0x11'));var as=require(_0xf475('0x12'));var hardwareService=require(_0xf475('0x13'));var logger=require(_0xf475('0x14'))(_0xf475('0x15'));var utils=require(_0xf475('0x16'));var config=require(_0xf475('0x17'));var licenseUtil=require(_0xf475('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50fb82,_0x5f577e){_0x5f577e=_0x5f577e||0xcc;return function(_0xa65bb){if(_0xa65bb){return _0x50fb82['sendStatus'](_0x5f577e);}return _0x50fb82[_0xf475('0x19')](_0x5f577e)['end']();};}function respondWithResult(_0x59409f,_0x480bb7){_0x480bb7=_0x480bb7||0xc8;return function(_0x2f56fb){if(_0x2f56fb){return _0x59409f[_0xf475('0x19')](_0x480bb7)[_0xf475('0x1a')](_0x2f56fb);}};}function respondWithFilteredResult(_0x36efc4,_0x46332b){return function(_0x4a97ae){if(_0x4a97ae){var _0x577fc4=_0x4a97ae[_0xf475('0x1b')],_0x28f649=_0x46332b['offset'],_0x1f0ac3=_0x46332b['offset']+_0x46332b[_0xf475('0x1c')],_0x2f0ed4;if(_0x1f0ac3>=_0x577fc4){_0x1f0ac3=_0x577fc4;_0x2f0ed4=0xc8;}else{_0x2f0ed4=0xce;}_0x36efc4[_0xf475('0x19')](_0x2f0ed4);return _0x36efc4['set']('Content-Range',_0x28f649+'-'+_0x1f0ac3+'/'+_0x577fc4)[_0xf475('0x1a')](_0x4a97ae);}return null;};}function patchUpdates(_0xcb936f){return function(_0x3d3d2a){try{jsonpatch[_0xf475('0x1d')](_0x3d3d2a,_0xcb936f,!![]);}catch(_0x5981de){return BPromise['reject'](_0x5981de);}return _0x3d3d2a['save']();};}function saveUpdates(_0x15d8cd,_0x3c4ebf){return function(_0x39d950){if(_0x39d950){return _0x39d950[_0xf475('0x1e')](_0x15d8cd)[_0xf475('0x1f')](function(_0x55be4a){return _0x55be4a;});}return null;};}function removeEntity(_0x46a4c9,_0x487247){return function(_0x20d9c4){if(_0x20d9c4){return _0x20d9c4[_0xf475('0x20')]()[_0xf475('0x1f')](function(){_0x46a4c9[_0xf475('0x19')](0xcc)[_0xf475('0x21')]();});}};}function handleEntityNotFound(_0x5febd4,_0x5f1904){return function(_0x2ba680){if(!_0x2ba680){_0x5febd4[_0xf475('0x22')](0x194);}return _0x2ba680;};}function handleError(_0x4be6a4,_0x281284){_0x281284=_0x281284||0x1f4;return function(_0x5497ef){logger[_0xf475('0x23')](_0x5497ef[_0xf475('0x24')]);if(_0x5497ef[_0xf475('0x25')]){delete _0x5497ef[_0xf475('0x25')];}_0x4be6a4['status'](_0x281284)[_0xf475('0x26')](_0x5497ef);};}exports['index']=function(_0x5a35cd,_0x209ec7){var _0x49657e={},_0xfbbfe7={},_0x278bf1={'count':0x0,'rows':[]};var _0x4c8987=_[_0xf475('0x27')](db[_0xf475('0x28')][_0xf475('0x29')],function(_0x375ded){return{'name':_0x375ded['fieldName'],'type':_0x375ded['type'][_0xf475('0x2a')]};});_0xfbbfe7[_0xf475('0x2b')]=_[_0xf475('0x27')](_0x4c8987,_0xf475('0x25'));_0xfbbfe7[_0xf475('0x2c')]=_[_0xf475('0x2d')](_0x5a35cd['query']);_0xfbbfe7[_0xf475('0x2e')]=_['intersection'](_0xfbbfe7[_0xf475('0x2b')],_0xfbbfe7[_0xf475('0x2c')]);_0x49657e[_0xf475('0x2f')]=_['intersection'](_0xfbbfe7[_0xf475('0x2b')],qs['fields'](_0x5a35cd[_0xf475('0x2c')][_0xf475('0x30')]));_0x49657e['attributes']=_0x49657e[_0xf475('0x2f')][_0xf475('0x31')]?_0x49657e[_0xf475('0x2f')]:_0xfbbfe7[_0xf475('0x2b')];if(!_0x5a35cd[_0xf475('0x2c')][_0xf475('0x32')](_0xf475('0x33'))){_0x49657e[_0xf475('0x1c')]=qs[_0xf475('0x1c')](_0x5a35cd[_0xf475('0x2c')][_0xf475('0x1c')]);_0x49657e[_0xf475('0x34')]=qs['offset'](_0x5a35cd[_0xf475('0x2c')][_0xf475('0x34')]);}_0x49657e[_0xf475('0x35')]=qs[_0xf475('0x36')](_0x5a35cd[_0xf475('0x2c')][_0xf475('0x36')]);_0x49657e[_0xf475('0x37')]=qs[_0xf475('0x2e')](_[_0xf475('0x38')](_0x5a35cd[_0xf475('0x2c')],_0xfbbfe7[_0xf475('0x2e')]),_0x4c8987);if(_0x5a35cd[_0xf475('0x2c')]['filter']){_0x49657e['where']=_[_0xf475('0x39')](_0x49657e[_0xf475('0x37')],{'$or':_[_0xf475('0x27')](_0x4c8987,function(_0xc7136c){if(_0xc7136c[_0xf475('0x3a')]!==_0xf475('0x3b')){var _0x1d493e={};_0x1d493e[_0xc7136c[_0xf475('0x25')]]={'$like':'%'+_0x5a35cd[_0xf475('0x2c')][_0xf475('0x3c')]+'%'};return _0x1d493e;}})});}_0x49657e=_[_0xf475('0x39')]({},_0x49657e,_0x5a35cd[_0xf475('0x3d')]);var _0x491b2f={'where':_0x49657e['where']};return db[_0xf475('0x28')][_0xf475('0x1b')](_0x491b2f)['then'](function(_0x216f21){_0x278bf1[_0xf475('0x1b')]=_0x216f21;if(_0x5a35cd[_0xf475('0x2c')][_0xf475('0x3e')]){_0x49657e[_0xf475('0x3f')]=[{'all':!![]}];}return db[_0xf475('0x28')][_0xf475('0x40')](_0x49657e);})[_0xf475('0x1f')](function(_0x3910dd){_0x278bf1[_0xf475('0x41')]=_0x3910dd;return _0x278bf1;})['then'](respondWithFilteredResult(_0x209ec7,_0x49657e))[_0xf475('0x42')](handleError(_0x209ec7,null));};exports[_0xf475('0x43')]=function(_0x34c629,_0x407ccb){var _0x339eb0={'raw':![],'where':{'id':_0x34c629['params']['id']}},_0x9f8ee1={};_0x9f8ee1[_0xf475('0x2b')]=_['keys'](db[_0xf475('0x28')][_0xf475('0x29')]);_0x9f8ee1['query']=_[_0xf475('0x2d')](_0x34c629[_0xf475('0x2c')]);_0x9f8ee1[_0xf475('0x2e')]=_[_0xf475('0x44')](_0x9f8ee1[_0xf475('0x2b')],_0x9f8ee1[_0xf475('0x2c')]);_0x339eb0[_0xf475('0x2f')]=_[_0xf475('0x44')](_0x9f8ee1[_0xf475('0x2b')],qs[_0xf475('0x30')](_0x34c629[_0xf475('0x2c')][_0xf475('0x30')]));_0x339eb0[_0xf475('0x2f')]=_0x339eb0['attributes'][_0xf475('0x31')]?_0x339eb0[_0xf475('0x2f')]:_0x9f8ee1[_0xf475('0x2b')];if(_0x34c629[_0xf475('0x2c')][_0xf475('0x3e')]){_0x339eb0['include']=[{'all':!![]}];}_0x339eb0=_['merge']({},_0x339eb0,_0x34c629[_0xf475('0x3d')]);return db['AnalyticFieldReport'][_0xf475('0x45')](_0x339eb0)[_0xf475('0x1f')](handleEntityNotFound(_0x407ccb,null))[_0xf475('0x1f')](respondWithResult(_0x407ccb,null))[_0xf475('0x42')](handleError(_0x407ccb,null));};exports[_0xf475('0x46')]=function(_0x1d8db4,_0x5685ac){return db['AnalyticFieldReport'][_0xf475('0x46')](_0x1d8db4['body'],{})[_0xf475('0x1f')](respondWithResult(_0x5685ac,0xc9))[_0xf475('0x42')](handleError(_0x5685ac,null));};exports['bulkCreate']=function(_0x27653d,_0xbe0760){return db[_0xf475('0x28')][_0xf475('0x47')](_0x27653d['body'],{'raw':![],'individualHooks':!![]})[_0xf475('0x1f')](respondWithResult(_0xbe0760,0xc9))[_0xf475('0x42')](handleError(_0xbe0760,null));};exports[_0xf475('0x1e')]=function(_0x77ea2c,_0x56d807){if(_0x77ea2c['body']['id']){delete _0x77ea2c[_0xf475('0x48')]['id'];}return db[_0xf475('0x28')][_0xf475('0x45')]({'where':{'id':_0x77ea2c[_0xf475('0x49')]['id']}})[_0xf475('0x1f')](handleEntityNotFound(_0x56d807,null))['then'](saveUpdates(_0x77ea2c[_0xf475('0x48')],null))[_0xf475('0x1f')](respondWithResult(_0x56d807,null))['catch'](handleError(_0x56d807,null));};exports[_0xf475('0x20')]=function(_0x7bdc99,_0x2b48e0){return db[_0xf475('0x28')][_0xf475('0x45')]({'where':{'id':_0x7bdc99[_0xf475('0x49')]['id']}})['then'](handleEntityNotFound(_0x2b48e0,null))[_0xf475('0x1f')](removeEntity(_0x2b48e0,null))[_0xf475('0x42')](handleError(_0x2b48e0,null));};exports['bulkDestroy']=function(_0x39a657,_0x10a680){return db['AnalyticFieldReport'][_0xf475('0x20')]({'where':{'id':_0x39a657['query'][_0xf475('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xf475('0x1f')](respondWithResult(_0x10a680,0xcc))[_0xf475('0x42')](handleError(_0x10a680,null));};exports[_0xf475('0x4b')]=function(_0x50cc17,_0x4bfc62,_0xbd9c58){return db[_0xf475('0x4c')][_0xf475('0x4d')]({'where':{'id':_0x50cc17[_0xf475('0x49')]['id']}})[_0xf475('0x1f')](handleEntityNotFound(_0x4bfc62,null))['then'](function(_0x529ffa){if(_0x529ffa){return db['sequelize'][_0xf475('0x4e')](function(_0x57b562){return db['AnalyticFieldReport'][_0xf475('0x20')]({'where':{'CustomReportId':_0x50cc17[_0xf475('0x49')]['id']},'transaction':_0x57b562})[_0xf475('0x1f')](function(_0x5b08f7){var _0x29bf14=_['map'](_0x50cc17['body'],function(_0x4c5d51){delete _0x4c5d51['id'];_0x4c5d51['CustomReportId']=_0x50cc17[_0xf475('0x49')]['id'];return _0x4c5d51;});return db['AnalyticFieldReport'][_0xf475('0x47')](_0x29bf14,{'transaction':_0x57b562});});})[_0xf475('0x1f')](function(){return db['AnalyticFieldReport'][_0xf475('0x40')]({'where':{'CustomReportId':_0x50cc17[_0xf475('0x49')]['id']}});});}})[_0xf475('0x1f')](respondWithResult(_0x4bfc62,null))['catch'](handleError(_0x4bfc62,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 55ef236..1910f3a 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 _0x3e80=['../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2002e5,_0x2a35f2){var _0x12dbb5=function(_0x173de4){while(--_0x173de4){_0x2002e5['push'](_0x2002e5['shift']());}};_0x12dbb5(++_0x2a35f2);}(_0x3e80,0x19c));var _0x03e8=function(_0x5f49c0,_0x27a1b4){_0x5f49c0=_0x5f49c0-0x0;var _0x5ab653=_0x3e80[_0x5f49c0];return _0x5ab653;};'use strict';var _=require(_0x03e8('0x0'));var util=require('util');var logger=require(_0x03e8('0x1'))(_0x03e8('0x2'));var moment=require(_0x03e8('0x3'));var BPromise=require(_0x03e8('0x4'));var rp=require(_0x03e8('0x5'));var fs=require('fs');var path=require(_0x03e8('0x6'));var rimraf=require(_0x03e8('0x7'));var config=require(_0x03e8('0x8'));var attributes=require(_0x03e8('0x9'));module['exports']=function(_0x30d972,_0x1277e9){return _0x30d972[_0x03e8('0xa')](_0x03e8('0xb'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x63a8=['lodash','util','api','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport'];(function(_0x22548e,_0x172658){var _0x3e6bc1=function(_0x35c582){while(--_0x35c582){_0x22548e['push'](_0x22548e['shift']());}};_0x3e6bc1(++_0x172658);}(_0x63a8,0x1ef));var _0x863a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x63a8[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x863a('0x0'));var util=require(_0x863a('0x1'));var logger=require('../../config/logger')(_0x863a('0x2'));var moment=require('moment');var BPromise=require(_0x863a('0x3'));var rp=require(_0x863a('0x4'));var fs=require('fs');var path=require(_0x863a('0x5'));var rimraf=require('rimraf');var config=require(_0x863a('0x6'));var attributes=require(_0x863a('0x7'));module[_0x863a('0x8')]=function(_0x42cfea,_0x512d99){return _0x42cfea[_0x863a('0x9')](_0x863a('0xa'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 302ef2d..3fac200 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 _0x88f7=['../../config/environment','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x59c23a,_0x4eb28d){var _0x2ce1ae=function(_0x5e7224){while(--_0x5e7224){_0x59c23a['push'](_0x59c23a['shift']());}};_0x2ce1ae(++_0x4eb28d);}(_0x88f7,0x1c8));var _0x788f=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x88f7[_0x288f5e];return _0x476cc9;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x788f('0x0'));var rs=require(_0x788f('0x1'));var fs=require('fs');var Redis=require(_0x788f('0x2'));var db=require(_0x788f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x788f('0x4'))(_0x788f('0x5'));var config=require(_0x788f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x788f('0x7')][_0x788f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f4c8f,_0x49044d,_0x522cfa){return new BPromise(function(_0x507dbe,_0x56dba1){return client[_0x788f('0x9')](_0x5f4c8f,_0x522cfa)[_0x788f('0xa')](function(_0x4f74bd){logger['info'](_0x788f('0xb'),_0x49044d,_0x788f('0xc'));logger[_0x788f('0xd')](_0x788f('0xe'),_0x49044d,_0x788f('0xc'),JSON['stringify'](_0x4f74bd));if(_0x4f74bd[_0x788f('0xf')]){if(_0x4f74bd[_0x788f('0xf')][_0x788f('0x10')]===0x1f4){logger[_0x788f('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x49044d,_0x4f74bd[_0x788f('0xf')][_0x788f('0x11')]);return _0x56dba1(_0x4f74bd[_0x788f('0xf')]['message']);}logger[_0x788f('0xf')](_0x788f('0xb'),_0x49044d,_0x4f74bd['error'][_0x788f('0x11')]);return _0x507dbe(_0x4f74bd[_0x788f('0xf')]['message']);}else{logger[_0x788f('0x12')](_0x788f('0xb'),_0x49044d,_0x788f('0xc'));_0x507dbe(_0x4f74bd[_0x788f('0x13')][_0x788f('0x11')]);}})[_0x788f('0x14')](function(_0x412d1a){logger[_0x788f('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x49044d,_0x412d1a);_0x56dba1(_0x412d1a);});});}
\ No newline at end of file
+var _0x7ca0=['AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','request','then','info'];(function(_0x4fc6f7,_0xea9941){var _0x216b2e=function(_0xedf2b5){while(--_0xedf2b5){_0x4fc6f7['push'](_0x4fc6f7['shift']());}};_0x216b2e(++_0xea9941);}(_0x7ca0,0x6e));var _0x07ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7ca0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x07ca('0x0'));var moment=require('moment');var BPromise=require(_0x07ca('0x1'));var rs=require(_0x07ca('0x2'));var fs=require('fs');var Redis=require(_0x07ca('0x3'));var db=require(_0x07ca('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x07ca('0x5'));var client=jayson[_0x07ca('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x491a9c,_0x3342ba,_0x4cf2f5){return new BPromise(function(_0x35df07,_0x4e9810){return client[_0x07ca('0x7')](_0x491a9c,_0x4cf2f5)[_0x07ca('0x8')](function(_0x11fdf8){logger[_0x07ca('0x9')](_0x07ca('0xa'),_0x3342ba,'request\x20sent');logger[_0x07ca('0xb')](_0x07ca('0xc'),_0x3342ba,_0x07ca('0xd'),JSON[_0x07ca('0xe')](_0x11fdf8));if(_0x11fdf8[_0x07ca('0xf')]){if(_0x11fdf8['error'][_0x07ca('0x10')]===0x1f4){logger[_0x07ca('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3342ba,_0x11fdf8[_0x07ca('0xf')]['message']);return _0x4e9810(_0x11fdf8[_0x07ca('0xf')][_0x07ca('0x11')]);}logger['error'](_0x07ca('0xa'),_0x3342ba,_0x11fdf8[_0x07ca('0xf')][_0x07ca('0x11')]);return _0x35df07(_0x11fdf8[_0x07ca('0xf')][_0x07ca('0x11')]);}else{logger[_0x07ca('0x9')](_0x07ca('0xa'),_0x3342ba,_0x07ca('0xd'));_0x35df07(_0x11fdf8[_0x07ca('0x12')][_0x07ca('0x11')]);}})[_0x07ca('0x13')](function(_0x47b571){logger['error'](_0x07ca('0xa'),_0x3342ba,_0x47b571);_0x4e9810(_0x47b571);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 4cd1bb4..bb56062 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 _0xa241=['delete','/destroy_many','bulkDestroy','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','show','post','/create_many','bulkCreate','/:id/create_many','addFields','put','/:id'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xa241,0xe6));var _0x1a24=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa241[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0x1a24('0x0'));var path=require(_0x1a24('0x1'));var timeout=require(_0x1a24('0x2'));var express=require(_0x1a24('0x3'));var router=express[_0x1a24('0x4')]();var fs_extra=require(_0x1a24('0x5'));var auth=require(_0x1a24('0x6'));var interaction=require(_0x1a24('0x7'));var config=require(_0x1a24('0x8'));var controller=require(_0x1a24('0x9'));router[_0x1a24('0xa')]('/',auth[_0x1a24('0xb')](),controller['index']);router[_0x1a24('0xa')]('/:id',auth[_0x1a24('0xb')](),controller[_0x1a24('0xc')]);router[_0x1a24('0xd')]('/',auth[_0x1a24('0xb')](),controller['create']);router[_0x1a24('0xd')](_0x1a24('0xe'),auth[_0x1a24('0xb')](),controller[_0x1a24('0xf')]);router[_0x1a24('0xd')](_0x1a24('0x10'),auth['isAuthenticated'](),controller[_0x1a24('0x11')]);router[_0x1a24('0x12')](_0x1a24('0x13'),auth['isAuthenticated'](),controller['update']);router[_0x1a24('0x14')](_0x1a24('0x15'),auth[_0x1a24('0xb')](),controller[_0x1a24('0x16')]);router[_0x1a24('0x14')]('/:id',auth[_0x1a24('0xb')](),controller[_0x1a24('0x17')]);module[_0x1a24('0x18')]=router;
\ No newline at end of file
+var _0xe17f=['delete','bulkDestroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','/create_many','put','update'];(function(_0x1cb0b4,_0x1fd48d){var _0x525b60=function(_0x1efccc){while(--_0x1efccc){_0x1cb0b4['push'](_0x1cb0b4['shift']());}};_0x525b60(++_0x1fd48d);}(_0xe17f,0x158));var _0xfe17=function(_0xcf66f6,_0x281d62){_0xcf66f6=_0xcf66f6-0x0;var _0x1c6602=_0xe17f[_0xcf66f6];return _0x1c6602;};'use strict';var multer=require(_0xfe17('0x0'));var util=require(_0xfe17('0x1'));var path=require(_0xfe17('0x2'));var timeout=require(_0xfe17('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfe17('0x4'));var auth=require(_0xfe17('0x5'));var interaction=require(_0xfe17('0x6'));var config=require('../../config/environment');var controller=require('./analyticFieldReport.controller');router[_0xfe17('0x7')]('/',auth[_0xfe17('0x8')](),controller[_0xfe17('0x9')]);router[_0xfe17('0x7')](_0xfe17('0xa'),auth['isAuthenticated'](),controller[_0xfe17('0xb')]);router[_0xfe17('0xc')]('/',auth[_0xfe17('0x8')](),controller['create']);router['post'](_0xfe17('0xd'),auth[_0xfe17('0x8')](),controller['bulkCreate']);router[_0xfe17('0xc')]('/:id/create_many',auth[_0xfe17('0x8')](),controller['addFields']);router[_0xfe17('0xe')](_0xfe17('0xa'),auth[_0xfe17('0x8')](),controller[_0xfe17('0xf')]);router[_0xfe17('0x10')]('/destroy_many',auth[_0xfe17('0x8')](),controller[_0xfe17('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index 7dde424..9beab5f 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 _0xddd1=['exports','STRING','name'];(function(_0x365d5c,_0x228ae5){var _0x355a64=function(_0xea70d3){while(--_0xea70d3){_0x365d5c['push'](_0x365d5c['shift']());}};_0x355a64(++_0x228ae5);}(_0xddd1,0xab));var _0x1ddd=function(_0x416c1a,_0x19c685){_0x416c1a=_0x416c1a-0x0;var _0xcf7188=_0xddd1[_0x416c1a];return _0xcf7188;};'use strict';var Sequelize=require('sequelize');module[_0x1ddd('0x0')]={'name':{'type':Sequelize[_0x1ddd('0x1')],'allowNull':![],'unique':_0x1ddd('0x2')},'table':{'type':Sequelize[_0x1ddd('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x573e=['exports','STRING'];(function(_0x585b10,_0x5d038a){var _0x43f4e6=function(_0x5582b3){while(--_0x5582b3){_0x585b10['push'](_0x585b10['shift']());}};_0x43f4e6(++_0x5d038a);}(_0x573e,0x134));var _0xe573=function(_0x46c955,_0x3e316c){_0x46c955=_0x46c955-0x0;var _0x1b4969=_0x573e[_0x46c955];return _0x1b4969;};'use strict';var Sequelize=require('sequelize');module[_0xe573('0x0')]={'name':{'type':Sequelize[_0xe573('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xe573('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 36bf07b..d95a107 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 _0x444e=['body','html-pdf','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','Metrics','UserProfileResource','sendStatus','error','stack','name','send','index','AnalyticMetric','rawAttributes','fieldName','map','query','keys','intersection','model','fields','attributes','hasOwnProperty','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x3b0912,_0x39d739){var _0xa8f339=function(_0x6a31ab){while(--_0x6a31ab){_0x3b0912['push'](_0x3b0912['shift']());}};_0xa8f339(++_0x39d739);}(_0x444e,0xe8));var _0xe444=function(_0x718a85,_0x5272fb){_0x718a85=_0x718a85-0x0;var _0x180486=_0x444e[_0x718a85];return _0x180486;};'use strict';var pdf=require(_0xe444('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe444('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe444('0x2'));var rp=require('request-promise');var moment=require(_0xe444('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe444('0x4'));var util=require(_0xe444('0x5'));var path=require(_0xe444('0x6'));var sox=require(_0xe444('0x7'));var csv=require(_0xe444('0x8'));var ejs=require(_0xe444('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe444('0xa'));var squel=require('squel');var crypto=require(_0xe444('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe444('0xc'));var toCsv=require(_0xe444('0x8'));var querystring=require(_0xe444('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe444('0xe'));var qs=require(_0xe444('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe444('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xe444('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xe444('0x12'));var db=require(_0xe444('0x13'))['db'];function respondWithStatusCode(_0x59792f,_0x28c3e4){_0x28c3e4=_0x28c3e4||0xcc;return function(_0x4f046c){if(_0x4f046c){return _0x59792f['sendStatus'](_0x28c3e4);}return _0x59792f[_0xe444('0x14')](_0x28c3e4)[_0xe444('0x15')]();};}function respondWithResult(_0x5eb55c,_0x192c1a){_0x192c1a=_0x192c1a||0xc8;return function(_0x5d739a){if(_0x5d739a){return _0x5eb55c[_0xe444('0x14')](_0x192c1a)[_0xe444('0x16')](_0x5d739a);}};}function respondWithFilteredResult(_0x18f7cf,_0x3af415){return function(_0x363716){if(_0x363716){var _0x2d44af=_0x363716[_0xe444('0x17')],_0x16ab23=_0x3af415[_0xe444('0x18')],_0x3e1b57=_0x3af415[_0xe444('0x18')]+_0x3af415[_0xe444('0x19')],_0x11129b;if(_0x3e1b57>=_0x2d44af){_0x3e1b57=_0x2d44af;_0x11129b=0xc8;}else{_0x11129b=0xce;}_0x18f7cf['status'](_0x11129b);return _0x18f7cf[_0xe444('0x1a')](_0xe444('0x1b'),_0x16ab23+'-'+_0x3e1b57+'/'+_0x2d44af)[_0xe444('0x16')](_0x363716);}return null;};}function patchUpdates(_0x2f6a4a){return function(_0x58fd40){try{jsonpatch[_0xe444('0x1c')](_0x58fd40,_0x2f6a4a,!![]);}catch(_0x285dbc){return BPromise[_0xe444('0x1d')](_0x285dbc);}return _0x58fd40[_0xe444('0x1e')]();};}function saveUpdates(_0x37c15e,_0x582bad){return function(_0x21d01d){if(_0x21d01d){return _0x21d01d[_0xe444('0x1f')](_0x37c15e)['then'](function(_0x2b52a6){return _0x2b52a6;});}return null;};}function removeEntity(_0x5ef1a4,_0x13108c){return function(_0x5c5b8){if(_0x5c5b8){return _0x5c5b8[_0xe444('0x20')]()[_0xe444('0x21')](function(){var _0x1fa32b=_0x5c5b8['get']({'plain':!![]});var _0x527bf5=_0xe444('0x22');return db[_0xe444('0x23')][_0xe444('0x20')]({'where':{'type':_0x527bf5,'resourceId':_0x1fa32b['id']}})[_0xe444('0x21')](function(){return _0x5c5b8;});})[_0xe444('0x21')](function(){_0x5ef1a4['status'](0xcc)[_0xe444('0x15')]();});}};}function handleEntityNotFound(_0x40a963,_0x5e36bb){return function(_0x32055b){if(!_0x32055b){_0x40a963[_0xe444('0x24')](0x194);}return _0x32055b;};}function handleError(_0x396fdf,_0x26ca6f){_0x26ca6f=_0x26ca6f||0x1f4;return function(_0x2619cf){logger[_0xe444('0x25')](_0x2619cf[_0xe444('0x26')]);if(_0x2619cf['name']){delete _0x2619cf[_0xe444('0x27')];}_0x396fdf[_0xe444('0x14')](_0x26ca6f)[_0xe444('0x28')](_0x2619cf);};}exports[_0xe444('0x29')]=function(_0x5bc063,_0x594b43){var _0x1bfec6={},_0x6f5319={},_0x33de83={'count':0x0,'rows':[]};var _0x239894=_['map'](db[_0xe444('0x2a')][_0xe444('0x2b')],function(_0x41eac0){return{'name':_0x41eac0[_0xe444('0x2c')],'type':_0x41eac0['type']['key']};});_0x6f5319['model']=_[_0xe444('0x2d')](_0x239894,_0xe444('0x27'));_0x6f5319[_0xe444('0x2e')]=_[_0xe444('0x2f')](_0x5bc063[_0xe444('0x2e')]);_0x6f5319['filters']=_[_0xe444('0x30')](_0x6f5319[_0xe444('0x31')],_0x6f5319[_0xe444('0x2e')]);_0x1bfec6['attributes']=_[_0xe444('0x30')](_0x6f5319['model'],qs['fields'](_0x5bc063[_0xe444('0x2e')][_0xe444('0x32')]));_0x1bfec6['attributes']=_0x1bfec6[_0xe444('0x33')]['length']?_0x1bfec6[_0xe444('0x33')]:_0x6f5319['model'];if(!_0x5bc063['query'][_0xe444('0x34')]('nolimit')){_0x1bfec6[_0xe444('0x19')]=qs[_0xe444('0x19')](_0x5bc063[_0xe444('0x2e')][_0xe444('0x19')]);_0x1bfec6['offset']=qs[_0xe444('0x18')](_0x5bc063[_0xe444('0x2e')][_0xe444('0x18')]);}_0x1bfec6['order']=qs[_0xe444('0x35')](_0x5bc063['query'][_0xe444('0x35')]);_0x1bfec6[_0xe444('0x36')]=qs[_0xe444('0x37')](_['pick'](_0x5bc063['query'],_0x6f5319[_0xe444('0x37')]),_0x239894);if(_0x5bc063[_0xe444('0x2e')][_0xe444('0x38')]){_0x1bfec6[_0xe444('0x36')]=_[_0xe444('0x39')](_0x1bfec6[_0xe444('0x36')],{'$or':_[_0xe444('0x2d')](_0x239894,function(_0x5c2ddf){if(_0x5c2ddf['type']!==_0xe444('0x3a')){var _0x495c9d={};_0x495c9d[_0x5c2ddf[_0xe444('0x27')]]={'$like':'%'+_0x5bc063['query'][_0xe444('0x38')]+'%'};return _0x495c9d;}})});}_0x1bfec6=_[_0xe444('0x39')]({},_0x1bfec6,_0x5bc063[_0xe444('0x3b')]);var _0x16babb={'where':_0x1bfec6[_0xe444('0x36')]};return db[_0xe444('0x2a')]['count'](_0x16babb)[_0xe444('0x21')](function(_0x3039ce){_0x33de83[_0xe444('0x17')]=_0x3039ce;if(_0x5bc063[_0xe444('0x2e')]['includeAll']){_0x1bfec6[_0xe444('0x3c')]=[{'all':!![]}];}return db[_0xe444('0x2a')][_0xe444('0x3d')](_0x1bfec6);})[_0xe444('0x21')](function(_0x1bc32d){_0x33de83[_0xe444('0x3e')]=_0x1bc32d;return _0x33de83;})[_0xe444('0x21')](respondWithFilteredResult(_0x594b43,_0x1bfec6))[_0xe444('0x3f')](handleError(_0x594b43,null));};exports[_0xe444('0x40')]=function(_0x543bae,_0x5cdf87){var _0x4c7713={'raw':!![],'where':{'id':_0x543bae[_0xe444('0x41')]['id']}},_0x22e4de={};_0x22e4de[_0xe444('0x31')]=_[_0xe444('0x2f')](db[_0xe444('0x2a')]['rawAttributes']);_0x22e4de['query']=_[_0xe444('0x2f')](_0x543bae[_0xe444('0x2e')]);_0x22e4de[_0xe444('0x37')]=_['intersection'](_0x22e4de[_0xe444('0x31')],_0x22e4de[_0xe444('0x2e')]);_0x4c7713[_0xe444('0x33')]=_[_0xe444('0x30')](_0x22e4de[_0xe444('0x31')],qs[_0xe444('0x32')](_0x543bae['query']['fields']));_0x4c7713[_0xe444('0x33')]=_0x4c7713[_0xe444('0x33')][_0xe444('0x42')]?_0x4c7713[_0xe444('0x33')]:_0x22e4de['model'];if(_0x543bae[_0xe444('0x2e')][_0xe444('0x43')]){_0x4c7713[_0xe444('0x3c')]=[{'all':!![]}];}_0x4c7713=_[_0xe444('0x39')]({},_0x4c7713,_0x543bae[_0xe444('0x3b')]);return db[_0xe444('0x2a')][_0xe444('0x44')](_0x4c7713)[_0xe444('0x21')](handleEntityNotFound(_0x5cdf87,null))['then'](respondWithResult(_0x5cdf87,null))[_0xe444('0x3f')](handleError(_0x5cdf87,null));};exports[_0xe444('0x45')]=function(_0x5afcdb,_0x4cb019){return db[_0xe444('0x2a')]['create'](_0x5afcdb['body'],{})['then'](function(_0x3b2957){var _0x142af3=_0x5afcdb['user']['get']({'plain':!![]});if(!_0x142af3)throw new Error(_0xe444('0x46'));if(_0x142af3[_0xe444('0x47')]==='user'){var _0xc82495=_0x3b2957[_0xe444('0x48')]({'plain':!![]});var _0x106586='Metrics';return db[_0xe444('0x49')]['find']({'where':{'name':_0x106586,'userProfileId':_0x142af3[_0xe444('0x4a')]},'raw':!![]})[_0xe444('0x21')](function(_0x5d92e6){if(_0x5d92e6&&_0x5d92e6['autoAssociation']===0x0){return db[_0xe444('0x23')]['create']({'name':_0xc82495[_0xe444('0x27')],'resourceId':_0xc82495['id'],'type':_0x5d92e6[_0xe444('0x27')],'sectionId':_0x5d92e6['id']},{})['then'](function(){return _0x3b2957;});}else{return _0x3b2957;}})[_0xe444('0x3f')](function(_0x272482){logger[_0xe444('0x25')](_0xe444('0x4b'),_0x272482);throw _0x272482;});}return _0x3b2957;})[_0xe444('0x21')](respondWithResult(_0x4cb019,0xc9))[_0xe444('0x3f')](handleError(_0x4cb019,null));};exports[_0xe444('0x1f')]=function(_0xc58b,_0x3f92f6){if(_0xc58b[_0xe444('0x4c')]['id']){delete _0xc58b[_0xe444('0x4c')]['id'];}return db[_0xe444('0x2a')]['find']({'where':{'id':_0xc58b[_0xe444('0x41')]['id']}})[_0xe444('0x21')](handleEntityNotFound(_0x3f92f6,null))['then'](saveUpdates(_0xc58b[_0xe444('0x4c')],null))['then'](respondWithResult(_0x3f92f6,null))[_0xe444('0x3f')](handleError(_0x3f92f6,null));};exports['destroy']=function(_0x90a61f,_0x509a4b){return db[_0xe444('0x2a')][_0xe444('0x44')]({'where':{'id':_0x90a61f[_0xe444('0x41')]['id']}})[_0xe444('0x21')](handleEntityNotFound(_0x509a4b,null))[_0xe444('0x21')](removeEntity(_0x509a4b,null))['catch'](handleError(_0x509a4b,null));};
\ No newline at end of file
+var _0x565f=['model','attributes','fields','length','nolimit','order','pick','filter','where','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','Content-Range','apply','save','update','destroy','then','get','Metrics','error','name','send','index','AnalyticMetric','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection'];(function(_0x54a0c7,_0x296e82){var _0x2d6783=function(_0x435447){while(--_0x435447){_0x54a0c7['push'](_0x54a0c7['shift']());}};_0x2d6783(++_0x296e82);}(_0x565f,0x68));var _0xf565=function(_0x3ff6bf,_0x438e79){_0x3ff6bf=_0x3ff6bf-0x0;var _0x8980a1=_0x565f[_0x3ff6bf];return _0x8980a1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf565('0x0'));var rimraf=require(_0xf565('0x1'));var zipdir=require(_0xf565('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf565('0x3'));var moment=require(_0xf565('0x4'));var BPromise=require(_0xf565('0x5'));var Mustache=require(_0xf565('0x6'));var util=require(_0xf565('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf565('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf565('0x9'));var squel=require(_0xf565('0xa'));var crypto=require(_0xf565('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf565('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf565('0xd'));var Papa=require('papaparse');var Redis=require(_0xf565('0xe'));var authService=require(_0xf565('0xf'));var qs=require(_0xf565('0x10'));var as=require(_0xf565('0x11'));var hardwareService=require(_0xf565('0x12'));var logger=require(_0xf565('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf565('0x14'));var licenseUtil=require(_0xf565('0x15'));var db=require(_0xf565('0x16'))['db'];function respondWithStatusCode(_0xb66e55,_0xa56a8b){_0xa56a8b=_0xa56a8b||0xcc;return function(_0x3dad4){if(_0x3dad4){return _0xb66e55[_0xf565('0x17')](_0xa56a8b);}return _0xb66e55[_0xf565('0x18')](_0xa56a8b)[_0xf565('0x19')]();};}function respondWithResult(_0x366ac2,_0x4f926d){_0x4f926d=_0x4f926d||0xc8;return function(_0x25b187){if(_0x25b187){return _0x366ac2[_0xf565('0x18')](_0x4f926d)['json'](_0x25b187);}};}function respondWithFilteredResult(_0x394e33,_0x2cd6a8){return function(_0x468d80){if(_0x468d80){var _0x46ee2e=_0x468d80['count'],_0x38e9d1=_0x2cd6a8['offset'],_0x509ff4=_0x2cd6a8[_0xf565('0x1a')]+_0x2cd6a8[_0xf565('0x1b')],_0x15c485;if(_0x509ff4>=_0x46ee2e){_0x509ff4=_0x46ee2e;_0x15c485=0xc8;}else{_0x15c485=0xce;}_0x394e33['status'](_0x15c485);return _0x394e33['set'](_0xf565('0x1c'),_0x38e9d1+'-'+_0x509ff4+'/'+_0x46ee2e)['json'](_0x468d80);}return null;};}function patchUpdates(_0x248111){return function(_0x1aeb02){try{jsonpatch[_0xf565('0x1d')](_0x1aeb02,_0x248111,!![]);}catch(_0x51215d){return BPromise['reject'](_0x51215d);}return _0x1aeb02[_0xf565('0x1e')]();};}function saveUpdates(_0x3a8a09,_0x2141ee){return function(_0x4114d0){if(_0x4114d0){return _0x4114d0[_0xf565('0x1f')](_0x3a8a09)['then'](function(_0x436a7d){return _0x436a7d;});}return null;};}function removeEntity(_0x24aa90,_0x282f3a){return function(_0x29057a){if(_0x29057a){return _0x29057a[_0xf565('0x20')]()[_0xf565('0x21')](function(){var _0xe23d61=_0x29057a[_0xf565('0x22')]({'plain':!![]});var _0x11d948=_0xf565('0x23');return db['UserProfileResource'][_0xf565('0x20')]({'where':{'type':_0x11d948,'resourceId':_0xe23d61['id']}})['then'](function(){return _0x29057a;});})[_0xf565('0x21')](function(){_0x24aa90[_0xf565('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x385d8f,_0xe06651){return function(_0x2e8f6b){if(!_0x2e8f6b){_0x385d8f[_0xf565('0x17')](0x194);}return _0x2e8f6b;};}function handleError(_0x10a396,_0x1239a7){_0x1239a7=_0x1239a7||0x1f4;return function(_0x42d7ab){logger[_0xf565('0x24')](_0x42d7ab['stack']);if(_0x42d7ab[_0xf565('0x25')]){delete _0x42d7ab[_0xf565('0x25')];}_0x10a396[_0xf565('0x18')](_0x1239a7)[_0xf565('0x26')](_0x42d7ab);};}exports[_0xf565('0x27')]=function(_0x5ecd01,_0x2288db){var _0x2ce91d={},_0x3bf46a={},_0x55b80d={'count':0x0,'rows':[]};var _0x233dca=_['map'](db[_0xf565('0x28')][_0xf565('0x29')],function(_0x3efca0){return{'name':_0x3efca0[_0xf565('0x2a')],'type':_0x3efca0[_0xf565('0x2b')][_0xf565('0x2c')]};});_0x3bf46a['model']=_[_0xf565('0x2d')](_0x233dca,_0xf565('0x25'));_0x3bf46a['query']=_[_0xf565('0x2e')](_0x5ecd01[_0xf565('0x2f')]);_0x3bf46a[_0xf565('0x30')]=_[_0xf565('0x31')](_0x3bf46a[_0xf565('0x32')],_0x3bf46a[_0xf565('0x2f')]);_0x2ce91d[_0xf565('0x33')]=_[_0xf565('0x31')](_0x3bf46a['model'],qs[_0xf565('0x34')](_0x5ecd01[_0xf565('0x2f')][_0xf565('0x34')]));_0x2ce91d['attributes']=_0x2ce91d[_0xf565('0x33')][_0xf565('0x35')]?_0x2ce91d[_0xf565('0x33')]:_0x3bf46a[_0xf565('0x32')];if(!_0x5ecd01[_0xf565('0x2f')]['hasOwnProperty'](_0xf565('0x36'))){_0x2ce91d['limit']=qs[_0xf565('0x1b')](_0x5ecd01[_0xf565('0x2f')]['limit']);_0x2ce91d['offset']=qs[_0xf565('0x1a')](_0x5ecd01[_0xf565('0x2f')]['offset']);}_0x2ce91d[_0xf565('0x37')]=qs['sort'](_0x5ecd01['query']['sort']);_0x2ce91d['where']=qs[_0xf565('0x30')](_[_0xf565('0x38')](_0x5ecd01[_0xf565('0x2f')],_0x3bf46a['filters']),_0x233dca);if(_0x5ecd01[_0xf565('0x2f')][_0xf565('0x39')]){_0x2ce91d[_0xf565('0x3a')]=_['merge'](_0x2ce91d[_0xf565('0x3a')],{'$or':_['map'](_0x233dca,function(_0x2d09fb){if(_0x2d09fb[_0xf565('0x2b')]!==_0xf565('0x3b')){var _0x54bf2d={};_0x54bf2d[_0x2d09fb[_0xf565('0x25')]]={'$like':'%'+_0x5ecd01['query'][_0xf565('0x39')]+'%'};return _0x54bf2d;}})});}_0x2ce91d=_['merge']({},_0x2ce91d,_0x5ecd01[_0xf565('0x3c')]);var _0x25dc34={'where':_0x2ce91d['where']};return db[_0xf565('0x28')][_0xf565('0x3d')](_0x25dc34)[_0xf565('0x21')](function(_0x5b8685){_0x55b80d[_0xf565('0x3d')]=_0x5b8685;if(_0x5ecd01['query'][_0xf565('0x3e')]){_0x2ce91d[_0xf565('0x3f')]=[{'all':!![]}];}return db[_0xf565('0x28')][_0xf565('0x40')](_0x2ce91d);})[_0xf565('0x21')](function(_0x2321f5){_0x55b80d['rows']=_0x2321f5;return _0x55b80d;})['then'](respondWithFilteredResult(_0x2288db,_0x2ce91d))[_0xf565('0x41')](handleError(_0x2288db,null));};exports[_0xf565('0x42')]=function(_0x40920b,_0x43416e){var _0x190f3a={'raw':!![],'where':{'id':_0x40920b[_0xf565('0x43')]['id']}},_0x482efc={};_0x482efc[_0xf565('0x32')]=_[_0xf565('0x2e')](db[_0xf565('0x28')]['rawAttributes']);_0x482efc[_0xf565('0x2f')]=_['keys'](_0x40920b['query']);_0x482efc[_0xf565('0x30')]=_[_0xf565('0x31')](_0x482efc['model'],_0x482efc['query']);_0x190f3a['attributes']=_[_0xf565('0x31')](_0x482efc[_0xf565('0x32')],qs[_0xf565('0x34')](_0x40920b[_0xf565('0x2f')][_0xf565('0x34')]));_0x190f3a[_0xf565('0x33')]=_0x190f3a[_0xf565('0x33')][_0xf565('0x35')]?_0x190f3a[_0xf565('0x33')]:_0x482efc[_0xf565('0x32')];if(_0x40920b[_0xf565('0x2f')]['includeAll']){_0x190f3a['include']=[{'all':!![]}];}_0x190f3a=_['merge']({},_0x190f3a,_0x40920b[_0xf565('0x3c')]);return db[_0xf565('0x28')][_0xf565('0x44')](_0x190f3a)['then'](handleEntityNotFound(_0x43416e,null))['then'](respondWithResult(_0x43416e,null))[_0xf565('0x41')](handleError(_0x43416e,null));};exports[_0xf565('0x45')]=function(_0x1a0386,_0x5ee510){return db[_0xf565('0x28')][_0xf565('0x45')](_0x1a0386[_0xf565('0x46')],{})['then'](function(_0x5b6cbb){var _0x2db9d2=_0x1a0386['user'][_0xf565('0x22')]({'plain':!![]});if(!_0x2db9d2)throw new Error(_0xf565('0x47'));if(_0x2db9d2[_0xf565('0x48')]===_0xf565('0x49')){var _0x3771b9=_0x5b6cbb[_0xf565('0x22')]({'plain':!![]});var _0x4326cc=_0xf565('0x23');return db[_0xf565('0x4a')][_0xf565('0x44')]({'where':{'name':_0x4326cc,'userProfileId':_0x2db9d2[_0xf565('0x4b')]},'raw':!![]})[_0xf565('0x21')](function(_0xe2fffa){if(_0xe2fffa&&_0xe2fffa[_0xf565('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x3771b9[_0xf565('0x25')],'resourceId':_0x3771b9['id'],'type':_0xe2fffa[_0xf565('0x25')],'sectionId':_0xe2fffa['id']},{})['then'](function(){return _0x5b6cbb;});}else{return _0x5b6cbb;}})[_0xf565('0x41')](function(_0x1869ff){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1869ff);throw _0x1869ff;});}return _0x5b6cbb;})[_0xf565('0x21')](respondWithResult(_0x5ee510,0xc9))[_0xf565('0x41')](handleError(_0x5ee510,null));};exports[_0xf565('0x1f')]=function(_0x3d650d,_0x203eed){if(_0x3d650d[_0xf565('0x46')]['id']){delete _0x3d650d[_0xf565('0x46')]['id'];}return db[_0xf565('0x28')]['find']({'where':{'id':_0x3d650d[_0xf565('0x43')]['id']}})['then'](handleEntityNotFound(_0x203eed,null))[_0xf565('0x21')](saveUpdates(_0x3d650d[_0xf565('0x46')],null))['then'](respondWithResult(_0x203eed,null))['catch'](handleError(_0x203eed,null));};exports[_0xf565('0x20')]=function(_0x4243fd,_0x2edcd2){return db[_0xf565('0x28')]['find']({'where':{'id':_0x4243fd[_0xf565('0x43')]['id']}})[_0xf565('0x21')](handleEntityNotFound(_0x2edcd2,null))[_0xf565('0x21')](removeEntity(_0x2edcd2,null))[_0xf565('0x41')](handleError(_0x2edcd2,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index d0f3125..5bbe138 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 _0xa12f=['../../config/logger','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','exports','AnalyticMetric','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa12f,0x152));var _0xfa12=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa12f[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xfa12('0x0'));var util=require(_0xfa12('0x1'));var logger=require(_0xfa12('0x2'))('api');var moment=require('moment');var BPromise=require(_0xfa12('0x3'));var rp=require(_0xfa12('0x4'));var fs=require('fs');var path=require(_0xfa12('0x5'));var rimraf=require('rimraf');var config=require(_0xfa12('0x6'));var attributes=require(_0xfa12('0x7'));module[_0xfa12('0x8')]=function(_0x21356d,_0x479994){return _0x21356d['define'](_0xfa12('0x9'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4886=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','exports','define','analytics_metrics'];(function(_0x16662c,_0x3d32b3){var _0x3e1a15=function(_0x285b01){while(--_0x285b01){_0x16662c['push'](_0x16662c['shift']());}};_0x3e1a15(++_0x3d32b3);}(_0x4886,0xcc));var _0x6488=function(_0x1b7c84,_0x15c14e){_0x1b7c84=_0x1b7c84-0x0;var _0x2ed9df=_0x4886[_0x1b7c84];return _0x2ed9df;};'use strict';var _=require(_0x6488('0x0'));var util=require(_0x6488('0x1'));var logger=require('../../config/logger')(_0x6488('0x2'));var moment=require(_0x6488('0x3'));var BPromise=require(_0x6488('0x4'));var rp=require(_0x6488('0x5'));var fs=require('fs');var path=require(_0x6488('0x6'));var rimraf=require('rimraf');var config=require(_0x6488('0x7'));var attributes=require(_0x6488('0x8'));module[_0x6488('0x9')]=function(_0x7c95b,_0x37e1ce){return _0x7c95b[_0x6488('0xa')]('AnalyticMetric',attributes,{'tableName':_0x6488('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 06a50f1..d0f7899 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 _0x9138=['result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','AnalyticMetric,\x20%s,\x20%s'];(function(_0x188379,_0x7fa345){var _0x3d8a8f=function(_0x1dee72){while(--_0x1dee72){_0x188379['push'](_0x188379['shift']());}};_0x3d8a8f(++_0x7fa345);}(_0x9138,0xca));var _0x8913=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x9138[_0x31e29a];return _0x32d892;};'use strict';var _=require('lodash');var util=require(_0x8913('0x0'));var moment=require('moment');var BPromise=require(_0x8913('0x1'));var rs=require(_0x8913('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8913('0x3'))['db'];var utils=require(_0x8913('0x4'));var logger=require(_0x8913('0x5'))(_0x8913('0x6'));var config=require(_0x8913('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8913('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a0f68,_0xde5425,_0x16dbd0){return new BPromise(function(_0x400aa7,_0x3bde93){return client['request'](_0x3a0f68,_0x16dbd0)[_0x8913('0x9')](function(_0x4bac56){logger[_0x8913('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0xde5425,'request\x20sent');logger[_0x8913('0xb')](_0x8913('0xc'),_0xde5425,_0x8913('0xd'),JSON[_0x8913('0xe')](_0x4bac56));if(_0x4bac56[_0x8913('0xf')]){if(_0x4bac56[_0x8913('0xf')]['code']===0x1f4){logger[_0x8913('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0xde5425,_0x4bac56[_0x8913('0xf')]['message']);return _0x3bde93(_0x4bac56[_0x8913('0xf')][_0x8913('0x10')]);}logger[_0x8913('0xf')](_0x8913('0x11'),_0xde5425,_0x4bac56[_0x8913('0xf')][_0x8913('0x10')]);return _0x400aa7(_0x4bac56[_0x8913('0xf')][_0x8913('0x10')]);}else{logger[_0x8913('0xa')](_0x8913('0x11'),_0xde5425,'request\x20sent');_0x400aa7(_0x4bac56[_0x8913('0x12')][_0x8913('0x10')]);}})[_0x8913('0x13')](function(_0x4f3065){logger['error'](_0x8913('0x11'),_0xde5425,_0x4f3065);_0x3bde93(_0x4f3065);});});}
\ No newline at end of file
+var _0xcc8a=['then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticMetric,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x73ae90,_0x3e2d96){var _0x464671=function(_0xdc4b96){while(--_0xdc4b96){_0x73ae90['push'](_0x73ae90['shift']());}};_0x464671(++_0x3e2d96);}(_0xcc8a,0x12a));var _0xacc8=function(_0x519443,_0x235b27){_0x519443=_0x519443-0x0;var _0x315f8c=_0xcc8a[_0x519443];return _0x315f8c;};'use strict';var _=require(_0xacc8('0x0'));var util=require(_0xacc8('0x1'));var moment=require(_0xacc8('0x2'));var BPromise=require(_0xacc8('0x3'));var rs=require(_0xacc8('0x4'));var fs=require('fs');var Redis=require(_0xacc8('0x5'));var db=require(_0xacc8('0x6'))['db'];var utils=require(_0xacc8('0x7'));var logger=require(_0xacc8('0x8'))(_0xacc8('0x9'));var config=require(_0xacc8('0xa'));var jayson=require(_0xacc8('0xb'));var client=jayson[_0xacc8('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18ab7a,_0x5a47cf,_0x1afb22){return new BPromise(function(_0x552ff2,_0x2016af){return client[_0xacc8('0xd')](_0x18ab7a,_0x1afb22)[_0xacc8('0xe')](function(_0x13bd50){logger[_0xacc8('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x5a47cf,_0xacc8('0x10'));logger[_0xacc8('0x11')](_0xacc8('0x12'),_0x5a47cf,_0xacc8('0x10'),JSON[_0xacc8('0x13')](_0x13bd50));if(_0x13bd50[_0xacc8('0x14')]){if(_0x13bd50['error'][_0xacc8('0x15')]===0x1f4){logger[_0xacc8('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x5a47cf,_0x13bd50[_0xacc8('0x14')][_0xacc8('0x16')]);return _0x2016af(_0x13bd50[_0xacc8('0x14')][_0xacc8('0x16')]);}logger[_0xacc8('0x14')](_0xacc8('0x17'),_0x5a47cf,_0x13bd50[_0xacc8('0x14')]['message']);return _0x552ff2(_0x13bd50[_0xacc8('0x14')][_0xacc8('0x16')]);}else{logger[_0xacc8('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x5a47cf,_0xacc8('0x10'));_0x552ff2(_0x13bd50['result'][_0xacc8('0x16')]);}})['catch'](function(_0x5d7c66){logger[_0xacc8('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x5a47cf,_0x5d7c66);_0x2016af(_0x5d7c66);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index eb480b4..21703ef 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 _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','/:id'];(function(_0x101ccf,_0x37e172){var _0x99b0f1=function(_0x4111c8){while(--_0x4111c8){_0x101ccf['push'](_0x101ccf['shift']());}};_0x99b0f1(++_0x37e172);}(_0x4fc2,0x111));var _0x24fc=function(_0x145a69,_0x243b63){_0x145a69=_0x145a69-0x0;var _0x34ebfb=_0x4fc2[_0x145a69];return _0x34ebfb;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router;
\ No newline at end of file
+var _0xbdb7=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','index','get','show','post','put','/:id','isAuthenticated','update'];(function(_0x502036,_0x502686){var _0x485247=function(_0x135ee3){while(--_0x135ee3){_0x502036['push'](_0x502036['shift']());}};_0x485247(++_0x502686);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x326b39,_0x4143c9){_0x326b39=_0x326b39-0x0;var _0x5b62d1=_0xbdb7[_0x326b39];return _0x5b62d1;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7bdb('0xe')](_0x7bdb('0xf'),auth[_0x7bdb('0x10')](),controller[_0x7bdb('0x11')]);router[_0x7bdb('0x12')](_0x7bdb('0xf'),auth[_0x7bdb('0x10')](),controller[_0x7bdb('0x13')]);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 540b44a..4ddc1c0 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 _0xa12f=['exports','TEXT','sequelize'];(function(_0x81c1bd,_0x5ee432){var _0x4ad0d7=function(_0x1d4a9a){while(--_0x1d4a9a){_0x81c1bd['push'](_0x81c1bd['shift']());}};_0x4ad0d7(++_0x5ee432);}(_0xa12f,0xf8));var _0xfa12=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa12f[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xfa12('0x0'));module[_0xfa12('0x1')]={'tree':{'type':Sequelize[_0xfa12('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x7769=['TEXT','sequelize'];(function(_0x10ff18,_0x11a300){var _0x76d79c=function(_0x10cd21){while(--_0x10cd21){_0x10ff18['push'](_0x10ff18['shift']());}};_0x76d79c(++_0x11a300);}(_0x7769,0x163));var _0x9776=function(_0x1a1b39,_0x2b180a){_0x1a1b39=_0x1a1b39-0x0;var _0x2e03e7=_0x7769[_0x1a1b39];return _0x2e03e7;};'use strict';var Sequelize=require(_0x9776('0x0'));module['exports']={'tree':{'type':Sequelize[_0x9776('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 4eb825b..72f098c 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 _0x3050=['include','findAll','rows','catch','show','params','fields','includeAll','find','create','body','html-pdf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x3050,0x99));var _0x0305=function(_0x184c16,_0x3ac0ee){_0x184c16=_0x184c16-0x0;var _0x5d8e5c=_0x3050[_0x184c16];return _0x5d8e5c;};'use strict';var pdf=require(_0x0305('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0305('0x1'));var jsonpatch=require(_0x0305('0x2'));var rp=require(_0x0305('0x3'));var moment=require(_0x0305('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x0305('0x5'));var sox=require(_0x0305('0x6'));var csv=require(_0x0305('0x7'));var ejs=require(_0x0305('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0305('0x9'));var squel=require(_0x0305('0xa'));var crypto=require(_0x0305('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0305('0x7'));var querystring=require(_0x0305('0xc'));var Papa=require(_0x0305('0xd'));var Redis=require(_0x0305('0xe'));var authService=require(_0x0305('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0305('0x10'));var hardwareService=require(_0x0305('0x11'));var logger=require('../../config/logger')(_0x0305('0x12'));var utils=require('../../config/utils');var config=require(_0x0305('0x13'));var licenseUtil=require(_0x0305('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43f9f5,_0xd2fa5){_0xd2fa5=_0xd2fa5||0xcc;return function(_0x2c51f0){if(_0x2c51f0){return _0x43f9f5['sendStatus'](_0xd2fa5);}return _0x43f9f5[_0x0305('0x15')](_0xd2fa5)[_0x0305('0x16')]();};}function respondWithResult(_0x1af8d4,_0x23ee81){_0x23ee81=_0x23ee81||0xc8;return function(_0x4cd426){if(_0x4cd426){return _0x1af8d4['status'](_0x23ee81)[_0x0305('0x17')](_0x4cd426);}};}function respondWithFilteredResult(_0xc2c761,_0xef7b9c){return function(_0x5171b4){if(_0x5171b4){var _0x57d420=_0x5171b4[_0x0305('0x18')],_0x2706e0=_0xef7b9c[_0x0305('0x19')],_0xbd076c=_0xef7b9c[_0x0305('0x19')]+_0xef7b9c[_0x0305('0x1a')],_0x3ae464;if(_0xbd076c>=_0x57d420){_0xbd076c=_0x57d420;_0x3ae464=0xc8;}else{_0x3ae464=0xce;}_0xc2c761[_0x0305('0x15')](_0x3ae464);return _0xc2c761[_0x0305('0x1b')](_0x0305('0x1c'),_0x2706e0+'-'+_0xbd076c+'/'+_0x57d420)['json'](_0x5171b4);}return null;};}function patchUpdates(_0x101705){return function(_0x2e9c51){try{jsonpatch[_0x0305('0x1d')](_0x2e9c51,_0x101705,!![]);}catch(_0x3670ec){return BPromise[_0x0305('0x1e')](_0x3670ec);}return _0x2e9c51[_0x0305('0x1f')]();};}function saveUpdates(_0x607ebc,_0x276e67){return function(_0x1c3663){if(_0x1c3663){return _0x1c3663[_0x0305('0x20')](_0x607ebc)[_0x0305('0x21')](function(_0xf5d94d){return _0xf5d94d;});}return null;};}function removeEntity(_0x103ef9,_0x4f8379){return function(_0x2df195){if(_0x2df195){return _0x2df195[_0x0305('0x22')]()[_0x0305('0x21')](function(){_0x103ef9['status'](0xcc)[_0x0305('0x16')]();});}};}function handleEntityNotFound(_0x47d895,_0x41e439){return function(_0x3edb9e){if(!_0x3edb9e){_0x47d895[_0x0305('0x23')](0x194);}return _0x3edb9e;};}function handleError(_0x4a8f13,_0x5aa1c0){_0x5aa1c0=_0x5aa1c0||0x1f4;return function(_0x6e3720){logger[_0x0305('0x24')](_0x6e3720[_0x0305('0x25')]);if(_0x6e3720[_0x0305('0x26')]){delete _0x6e3720[_0x0305('0x26')];}_0x4a8f13[_0x0305('0x15')](_0x5aa1c0)[_0x0305('0x27')](_0x6e3720);};}exports['index']=function(_0x182966,_0x2832b6){var _0x2b2777={},_0x46257a={},_0x41896a={'count':0x0,'rows':[]};var _0xe944c8=_[_0x0305('0x28')](db[_0x0305('0x29')][_0x0305('0x2a')],function(_0x57cf2c){return{'name':_0x57cf2c[_0x0305('0x2b')],'type':_0x57cf2c['type']['key']};});_0x46257a[_0x0305('0x2c')]=_['map'](_0xe944c8,_0x0305('0x26'));_0x46257a[_0x0305('0x2d')]=_[_0x0305('0x2e')](_0x182966[_0x0305('0x2d')]);_0x46257a[_0x0305('0x2f')]=_[_0x0305('0x30')](_0x46257a[_0x0305('0x2c')],_0x46257a[_0x0305('0x2d')]);_0x2b2777['attributes']=_[_0x0305('0x30')](_0x46257a[_0x0305('0x2c')],qs['fields'](_0x182966[_0x0305('0x2d')]['fields']));_0x2b2777[_0x0305('0x31')]=_0x2b2777['attributes'][_0x0305('0x32')]?_0x2b2777['attributes']:_0x46257a['model'];if(!_0x182966['query'][_0x0305('0x33')]('nolimit')){_0x2b2777[_0x0305('0x1a')]=qs[_0x0305('0x1a')](_0x182966[_0x0305('0x2d')][_0x0305('0x1a')]);_0x2b2777[_0x0305('0x19')]=qs[_0x0305('0x19')](_0x182966[_0x0305('0x2d')][_0x0305('0x19')]);}_0x2b2777['order']=qs['sort'](_0x182966[_0x0305('0x2d')][_0x0305('0x34')]);_0x2b2777[_0x0305('0x35')]=qs[_0x0305('0x2f')](_[_0x0305('0x36')](_0x182966[_0x0305('0x2d')],_0x46257a[_0x0305('0x2f')]),_0xe944c8);if(_0x182966[_0x0305('0x2d')][_0x0305('0x37')]){_0x2b2777['where']=_[_0x0305('0x38')](_0x2b2777[_0x0305('0x35')],{'$or':_[_0x0305('0x28')](_0xe944c8,function(_0x34ba6e){if(_0x34ba6e[_0x0305('0x39')]!==_0x0305('0x3a')){var _0x257120={};_0x257120[_0x34ba6e['name']]={'$like':'%'+_0x182966['query'][_0x0305('0x37')]+'%'};return _0x257120;}})});}_0x2b2777=_[_0x0305('0x38')]({},_0x2b2777,_0x182966[_0x0305('0x3b')]);var _0xfeb689={'where':_0x2b2777['where']};return db[_0x0305('0x29')][_0x0305('0x18')](_0xfeb689)[_0x0305('0x21')](function(_0x4f6a64){_0x41896a['count']=_0x4f6a64;if(_0x182966[_0x0305('0x2d')]['includeAll']){_0x2b2777[_0x0305('0x3c')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x0305('0x3d')](_0x2b2777);})[_0x0305('0x21')](function(_0xfb4337){_0x41896a[_0x0305('0x3e')]=_0xfb4337;return _0x41896a;})[_0x0305('0x21')](respondWithFilteredResult(_0x2832b6,_0x2b2777))[_0x0305('0x3f')](handleError(_0x2832b6,null));};exports[_0x0305('0x40')]=function(_0x438986,_0x484ff5){var _0x4e2e7b={'raw':!![],'where':{'id':_0x438986[_0x0305('0x41')]['id']}},_0x500feb={};_0x500feb['model']=_[_0x0305('0x2e')](db[_0x0305('0x29')][_0x0305('0x2a')]);_0x500feb['query']=_[_0x0305('0x2e')](_0x438986['query']);_0x500feb[_0x0305('0x2f')]=_[_0x0305('0x30')](_0x500feb[_0x0305('0x2c')],_0x500feb[_0x0305('0x2d')]);_0x4e2e7b['attributes']=_['intersection'](_0x500feb[_0x0305('0x2c')],qs[_0x0305('0x42')](_0x438986[_0x0305('0x2d')]['fields']));_0x4e2e7b[_0x0305('0x31')]=_0x4e2e7b[_0x0305('0x31')][_0x0305('0x32')]?_0x4e2e7b['attributes']:_0x500feb[_0x0305('0x2c')];if(_0x438986[_0x0305('0x2d')][_0x0305('0x43')]){_0x4e2e7b[_0x0305('0x3c')]=[{'all':!![]}];}_0x4e2e7b=_[_0x0305('0x38')]({},_0x4e2e7b,_0x438986['options']);return db['AnalyticTreeReport'][_0x0305('0x44')](_0x4e2e7b)[_0x0305('0x21')](handleEntityNotFound(_0x484ff5,null))['then'](respondWithResult(_0x484ff5,null))['catch'](handleError(_0x484ff5,null));};exports['create']=function(_0x3cbfb1,_0x598ab2){return db['AnalyticTreeReport'][_0x0305('0x45')](_0x3cbfb1[_0x0305('0x46')],{})[_0x0305('0x21')](respondWithResult(_0x598ab2,0xc9))[_0x0305('0x3f')](handleError(_0x598ab2,null));};exports[_0x0305('0x20')]=function(_0x4aacc4,_0x574d2a){if(_0x4aacc4[_0x0305('0x46')]['id']){delete _0x4aacc4[_0x0305('0x46')]['id'];}return db[_0x0305('0x29')][_0x0305('0x44')]({'where':{'id':_0x4aacc4[_0x0305('0x41')]['id']}})[_0x0305('0x21')](handleEntityNotFound(_0x574d2a,null))[_0x0305('0x21')](saveUpdates(_0x4aacc4[_0x0305('0x46')],null))[_0x0305('0x21')](respondWithResult(_0x574d2a,null))[_0x0305('0x3f')](handleError(_0x574d2a,null));};exports[_0x0305('0x22')]=function(_0x3cac08,_0x18d113){return db[_0x0305('0x29')][_0x0305('0x44')]({'where':{'id':_0x3cac08[_0x0305('0x41')]['id']}})[_0x0305('0x21')](handleEntityNotFound(_0x18d113,null))['then'](removeEntity(_0x18d113,null))[_0x0305('0x3f')](handleError(_0x18d113,null));};
\ No newline at end of file
+var _0x4d67=['reject','save','update','then','destroy','status','end','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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','sendStatus','json','count','offset','limit','set','apply'];(function(_0x2a01d3,_0x1b7cf0){var _0x5610d5=function(_0x846f1e){while(--_0x846f1e){_0x2a01d3['push'](_0x2a01d3['shift']());}};_0x5610d5(++_0x1b7cf0);}(_0x4d67,0x16c));var _0x74d6=function(_0x5455e2,_0x4675b4){_0x5455e2=_0x5455e2-0x0;var _0x4c8a44=_0x4d67[_0x5455e2];return _0x4c8a44;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x74d6('0x0'));var rimraf=require(_0x74d6('0x1'));var zipdir=require(_0x74d6('0x2'));var jsonpatch=require(_0x74d6('0x3'));var rp=require(_0x74d6('0x4'));var moment=require(_0x74d6('0x5'));var BPromise=require(_0x74d6('0x6'));var Mustache=require(_0x74d6('0x7'));var util=require(_0x74d6('0x8'));var path=require(_0x74d6('0x9'));var sox=require(_0x74d6('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x74d6('0xb'));var squel=require(_0x74d6('0xc'));var crypto=require(_0x74d6('0xd'));var jsforce=require(_0x74d6('0xe'));var deskjs=require(_0x74d6('0xf'));var toCsv=require(_0x74d6('0x10'));var querystring=require(_0x74d6('0x11'));var Papa=require(_0x74d6('0x12'));var Redis=require(_0x74d6('0x13'));var authService=require(_0x74d6('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x74d6('0x15'));var hardwareService=require(_0x74d6('0x16'));var logger=require(_0x74d6('0x17'))(_0x74d6('0x18'));var utils=require(_0x74d6('0x19'));var config=require(_0x74d6('0x1a'));var licenseUtil=require(_0x74d6('0x1b'));var db=require(_0x74d6('0x1c'))['db'];function respondWithStatusCode(_0x43114e,_0x249bc8){_0x249bc8=_0x249bc8||0xcc;return function(_0x523432){if(_0x523432){return _0x43114e[_0x74d6('0x1d')](_0x249bc8);}return _0x43114e['status'](_0x249bc8)['end']();};}function respondWithResult(_0x1df273,_0x5a09d2){_0x5a09d2=_0x5a09d2||0xc8;return function(_0x10baea){if(_0x10baea){return _0x1df273['status'](_0x5a09d2)[_0x74d6('0x1e')](_0x10baea);}};}function respondWithFilteredResult(_0x4d234f,_0x14f76b){return function(_0x5dd846){if(_0x5dd846){var _0x4da8b8=_0x5dd846[_0x74d6('0x1f')],_0x474347=_0x14f76b[_0x74d6('0x20')],_0x1bc0d5=_0x14f76b[_0x74d6('0x20')]+_0x14f76b[_0x74d6('0x21')],_0x412651;if(_0x1bc0d5>=_0x4da8b8){_0x1bc0d5=_0x4da8b8;_0x412651=0xc8;}else{_0x412651=0xce;}_0x4d234f['status'](_0x412651);return _0x4d234f[_0x74d6('0x22')]('Content-Range',_0x474347+'-'+_0x1bc0d5+'/'+_0x4da8b8)[_0x74d6('0x1e')](_0x5dd846);}return null;};}function patchUpdates(_0x30b156){return function(_0x597b75){try{jsonpatch[_0x74d6('0x23')](_0x597b75,_0x30b156,!![]);}catch(_0x31ae31){return BPromise[_0x74d6('0x24')](_0x31ae31);}return _0x597b75[_0x74d6('0x25')]();};}function saveUpdates(_0x561898,_0x58fa0b){return function(_0x23b006){if(_0x23b006){return _0x23b006[_0x74d6('0x26')](_0x561898)[_0x74d6('0x27')](function(_0x4ca1f9){return _0x4ca1f9;});}return null;};}function removeEntity(_0x20fdc9,_0x36ed3b){return function(_0x2f920e){if(_0x2f920e){return _0x2f920e[_0x74d6('0x28')]()[_0x74d6('0x27')](function(){_0x20fdc9[_0x74d6('0x29')](0xcc)[_0x74d6('0x2a')]();});}};}function handleEntityNotFound(_0x2b2efb,_0x3154fc){return function(_0x2df0b0){if(!_0x2df0b0){_0x2b2efb[_0x74d6('0x1d')](0x194);}return _0x2df0b0;};}function handleError(_0x5328db,_0x585990){_0x585990=_0x585990||0x1f4;return function(_0x4ad4ca){logger['error'](_0x4ad4ca[_0x74d6('0x2b')]);if(_0x4ad4ca['name']){delete _0x4ad4ca[_0x74d6('0x2c')];}_0x5328db[_0x74d6('0x29')](_0x585990)[_0x74d6('0x2d')](_0x4ad4ca);};}exports[_0x74d6('0x2e')]=function(_0x53345a,_0x72f49f){var _0x1159dd={},_0x2cf55c={},_0x564107={'count':0x0,'rows':[]};var _0xc41688=_['map'](db[_0x74d6('0x2f')][_0x74d6('0x30')],function(_0x2db4cd){return{'name':_0x2db4cd[_0x74d6('0x31')],'type':_0x2db4cd[_0x74d6('0x32')][_0x74d6('0x33')]};});_0x2cf55c[_0x74d6('0x34')]=_[_0x74d6('0x35')](_0xc41688,'name');_0x2cf55c[_0x74d6('0x36')]=_['keys'](_0x53345a[_0x74d6('0x36')]);_0x2cf55c[_0x74d6('0x37')]=_['intersection'](_0x2cf55c['model'],_0x2cf55c['query']);_0x1159dd[_0x74d6('0x38')]=_[_0x74d6('0x39')](_0x2cf55c['model'],qs[_0x74d6('0x3a')](_0x53345a[_0x74d6('0x36')]['fields']));_0x1159dd[_0x74d6('0x38')]=_0x1159dd[_0x74d6('0x38')][_0x74d6('0x3b')]?_0x1159dd['attributes']:_0x2cf55c[_0x74d6('0x34')];if(!_0x53345a[_0x74d6('0x36')][_0x74d6('0x3c')](_0x74d6('0x3d'))){_0x1159dd[_0x74d6('0x21')]=qs[_0x74d6('0x21')](_0x53345a[_0x74d6('0x36')][_0x74d6('0x21')]);_0x1159dd[_0x74d6('0x20')]=qs[_0x74d6('0x20')](_0x53345a['query'][_0x74d6('0x20')]);}_0x1159dd[_0x74d6('0x3e')]=qs[_0x74d6('0x3f')](_0x53345a[_0x74d6('0x36')]['sort']);_0x1159dd[_0x74d6('0x40')]=qs[_0x74d6('0x37')](_[_0x74d6('0x41')](_0x53345a[_0x74d6('0x36')],_0x2cf55c[_0x74d6('0x37')]),_0xc41688);if(_0x53345a[_0x74d6('0x36')][_0x74d6('0x42')]){_0x1159dd[_0x74d6('0x40')]=_[_0x74d6('0x43')](_0x1159dd[_0x74d6('0x40')],{'$or':_[_0x74d6('0x35')](_0xc41688,function(_0x31e656){if(_0x31e656[_0x74d6('0x32')]!==_0x74d6('0x44')){var _0x12ca16={};_0x12ca16[_0x31e656['name']]={'$like':'%'+_0x53345a['query'][_0x74d6('0x42')]+'%'};return _0x12ca16;}})});}_0x1159dd=_[_0x74d6('0x43')]({},_0x1159dd,_0x53345a[_0x74d6('0x45')]);var _0x3b6933={'where':_0x1159dd[_0x74d6('0x40')]};return db['AnalyticTreeReport']['count'](_0x3b6933)[_0x74d6('0x27')](function(_0x4db9bc){_0x564107[_0x74d6('0x1f')]=_0x4db9bc;if(_0x53345a[_0x74d6('0x36')][_0x74d6('0x46')]){_0x1159dd[_0x74d6('0x47')]=[{'all':!![]}];}return db[_0x74d6('0x2f')]['findAll'](_0x1159dd);})[_0x74d6('0x27')](function(_0x565edc){_0x564107[_0x74d6('0x48')]=_0x565edc;return _0x564107;})[_0x74d6('0x27')](respondWithFilteredResult(_0x72f49f,_0x1159dd))[_0x74d6('0x49')](handleError(_0x72f49f,null));};exports[_0x74d6('0x4a')]=function(_0x3c0e29,_0x496ddc){var _0x38309d={'raw':!![],'where':{'id':_0x3c0e29[_0x74d6('0x4b')]['id']}},_0x27ce56={};_0x27ce56[_0x74d6('0x34')]=_[_0x74d6('0x4c')](db[_0x74d6('0x2f')][_0x74d6('0x30')]);_0x27ce56[_0x74d6('0x36')]=_['keys'](_0x3c0e29[_0x74d6('0x36')]);_0x27ce56[_0x74d6('0x37')]=_[_0x74d6('0x39')](_0x27ce56[_0x74d6('0x34')],_0x27ce56[_0x74d6('0x36')]);_0x38309d[_0x74d6('0x38')]=_['intersection'](_0x27ce56[_0x74d6('0x34')],qs[_0x74d6('0x3a')](_0x3c0e29[_0x74d6('0x36')][_0x74d6('0x3a')]));_0x38309d[_0x74d6('0x38')]=_0x38309d[_0x74d6('0x38')][_0x74d6('0x3b')]?_0x38309d[_0x74d6('0x38')]:_0x27ce56[_0x74d6('0x34')];if(_0x3c0e29['query'][_0x74d6('0x46')]){_0x38309d[_0x74d6('0x47')]=[{'all':!![]}];}_0x38309d=_[_0x74d6('0x43')]({},_0x38309d,_0x3c0e29[_0x74d6('0x45')]);return db['AnalyticTreeReport'][_0x74d6('0x4d')](_0x38309d)[_0x74d6('0x27')](handleEntityNotFound(_0x496ddc,null))['then'](respondWithResult(_0x496ddc,null))[_0x74d6('0x49')](handleError(_0x496ddc,null));};exports[_0x74d6('0x4e')]=function(_0x4e0e18,_0x2c07fd){return db[_0x74d6('0x2f')][_0x74d6('0x4e')](_0x4e0e18[_0x74d6('0x4f')],{})[_0x74d6('0x27')](respondWithResult(_0x2c07fd,0xc9))[_0x74d6('0x49')](handleError(_0x2c07fd,null));};exports[_0x74d6('0x26')]=function(_0x28d5f4,_0x5a03cf){if(_0x28d5f4[_0x74d6('0x4f')]['id']){delete _0x28d5f4[_0x74d6('0x4f')]['id'];}return db[_0x74d6('0x2f')][_0x74d6('0x4d')]({'where':{'id':_0x28d5f4['params']['id']}})[_0x74d6('0x27')](handleEntityNotFound(_0x5a03cf,null))['then'](saveUpdates(_0x28d5f4[_0x74d6('0x4f')],null))[_0x74d6('0x27')](respondWithResult(_0x5a03cf,null))[_0x74d6('0x49')](handleError(_0x5a03cf,null));};exports[_0x74d6('0x28')]=function(_0x30b90e,_0x4a88ea){return db['AnalyticTreeReport'][_0x74d6('0x4d')]({'where':{'id':_0x30b90e[_0x74d6('0x4b')]['id']}})[_0x74d6('0x27')](handleEntityNotFound(_0x4a88ea,null))[_0x74d6('0x27')](removeEntity(_0x4a88ea,null))['catch'](handleError(_0x4a88ea,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index baf6479..692f72e 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 _0xbd0a=['analytics_report_trees','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x194dae,_0x1288ac){_0x194dae=_0x194dae-0x0;var _0x49560e=_0xbd0a[_0x194dae];return _0x49560e;};'use strict';var _=require(_0xabd0('0x0'));var util=require('util');var logger=require(_0xabd0('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xabd0('0x2'));var fs=require('fs');var path=require(_0xabd0('0x3'));var rimraf=require(_0xabd0('0x4'));var config=require(_0xabd0('0x5'));var attributes=require(_0xabd0('0x6'));module[_0xabd0('0x7')]=function(_0x221368,_0xb41697){return _0x221368[_0xabd0('0x8')]('AnalyticTreeReport',attributes,{'tableName':_0xabd0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa5d7=['analytics_report_trees','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','exports','AnalyticTreeReport'];(function(_0x25dd03,_0x38fe2b){var _0x195a85=function(_0x226a6c){while(--_0x226a6c){_0x25dd03['push'](_0x25dd03['shift']());}};_0x195a85(++_0x38fe2b);}(_0xa5d7,0x1c3));var _0x7a5d=function(_0x26218b,_0x2ce309){_0x26218b=_0x26218b-0x0;var _0x2c19be=_0xa5d7[_0x26218b];return _0x2c19be;};'use strict';var _=require(_0x7a5d('0x0'));var util=require(_0x7a5d('0x1'));var logger=require(_0x7a5d('0x2'))(_0x7a5d('0x3'));var moment=require('moment');var BPromise=require(_0x7a5d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7a5d('0x5'));var rimraf=require('rimraf');var config=require(_0x7a5d('0x6'));var attributes=require('./analyticTreeReport.attributes');module[_0x7a5d('0x7')]=function(_0x42a143,_0x251ef5){return _0x42a143['define'](_0x7a5d('0x8'),attributes,{'tableName':_0x7a5d('0x9'),'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 7757e6e..0c14d63 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 _0xd3c9=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1c1c83,_0x39f701){var _0x3a2650=function(_0xf17943){while(--_0xf17943){_0x1c1c83['push'](_0x1c1c83['shift']());}};_0x3a2650(++_0x39f701);}(_0xd3c9,0xd9));var _0x9d3c=function(_0x9efb2c,_0x18659a){_0x9efb2c=_0x9efb2c-0x0;var _0xc3d5a3=_0xd3c9[_0x9efb2c];return _0xc3d5a3;};'use strict';var _=require(_0x9d3c('0x0'));var util=require(_0x9d3c('0x1'));var moment=require(_0x9d3c('0x2'));var BPromise=require(_0x9d3c('0x3'));var rs=require(_0x9d3c('0x4'));var fs=require('fs');var Redis=require(_0x9d3c('0x5'));var db=require(_0x9d3c('0x6'))['db'];var utils=require(_0x9d3c('0x7'));var logger=require(_0x9d3c('0x8'))(_0x9d3c('0x9'));var config=require(_0x9d3c('0xa'));var jayson=require(_0x9d3c('0xb'));var client=jayson[_0x9d3c('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57396d,_0x1b496a,_0x57967c){return new BPromise(function(_0x4e04a2,_0x1cb565){return client['request'](_0x57396d,_0x57967c)[_0x9d3c('0xd')](function(_0x120de1){logger[_0x9d3c('0xe')](_0x9d3c('0xf'),_0x1b496a,_0x9d3c('0x10'));logger['debug'](_0x9d3c('0x11'),_0x1b496a,_0x9d3c('0x10'),JSON[_0x9d3c('0x12')](_0x120de1));if(_0x120de1[_0x9d3c('0x13')]){if(_0x120de1[_0x9d3c('0x13')]['code']===0x1f4){logger[_0x9d3c('0x13')](_0x9d3c('0xf'),_0x1b496a,_0x120de1[_0x9d3c('0x13')][_0x9d3c('0x14')]);return _0x1cb565(_0x120de1[_0x9d3c('0x13')]['message']);}logger['error'](_0x9d3c('0xf'),_0x1b496a,_0x120de1[_0x9d3c('0x13')][_0x9d3c('0x14')]);return _0x4e04a2(_0x120de1['error'][_0x9d3c('0x14')]);}else{logger[_0x9d3c('0xe')](_0x9d3c('0xf'),_0x1b496a,_0x9d3c('0x10'));_0x4e04a2(_0x120de1[_0x9d3c('0x15')][_0x9d3c('0x14')]);}})[_0x9d3c('0x16')](function(_0x2d9e3b){logger[_0x9d3c('0x13')](_0x9d3c('0xf'),_0x1b496a,_0x2d9e3b);_0x1cb565(_0x2d9e3b);});});}
\ No newline at end of file
+var _0xca74=['request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca74,0x11a));var _0x4ca7=function(_0x30d87a,_0xf3a07f){_0x30d87a=_0x30d87a-0x0;var _0x48f64b=_0xca74[_0x30d87a];return _0x48f64b;};'use strict';var _=require('lodash');var util=require(_0x4ca7('0x0'));var moment=require(_0x4ca7('0x1'));var BPromise=require(_0x4ca7('0x2'));var rs=require(_0x4ca7('0x3'));var fs=require('fs');var Redis=require(_0x4ca7('0x4'));var db=require(_0x4ca7('0x5'))['db'];var utils=require(_0x4ca7('0x6'));var logger=require(_0x4ca7('0x7'))(_0x4ca7('0x8'));var config=require(_0x4ca7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4ca7('0xa')][_0x4ca7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25be50,_0x1690f7,_0x5c649a){return new BPromise(function(_0xd2d4e4,_0x20f97e){return client[_0x4ca7('0xc')](_0x25be50,_0x5c649a)['then'](function(_0x2974fe){logger[_0x4ca7('0xd')](_0x4ca7('0xe'),_0x1690f7,'request\x20sent');logger[_0x4ca7('0xf')](_0x4ca7('0x10'),_0x1690f7,_0x4ca7('0x11'),JSON[_0x4ca7('0x12')](_0x2974fe));if(_0x2974fe[_0x4ca7('0x13')]){if(_0x2974fe[_0x4ca7('0x13')]['code']===0x1f4){logger[_0x4ca7('0x13')](_0x4ca7('0xe'),_0x1690f7,_0x2974fe[_0x4ca7('0x13')][_0x4ca7('0x14')]);return _0x20f97e(_0x2974fe[_0x4ca7('0x13')][_0x4ca7('0x14')]);}logger[_0x4ca7('0x13')](_0x4ca7('0xe'),_0x1690f7,_0x2974fe['error'][_0x4ca7('0x14')]);return _0xd2d4e4(_0x2974fe[_0x4ca7('0x13')][_0x4ca7('0x14')]);}else{logger[_0x4ca7('0xd')](_0x4ca7('0xe'),_0x1690f7,_0x4ca7('0x11'));_0xd2d4e4(_0x2974fe[_0x4ca7('0x15')]['message']);}})[_0x4ca7('0x16')](function(_0x8b1443){logger['error'](_0x4ca7('0xe'),_0x1690f7,_0x8b1443);_0x20f97e(_0x8b1443);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 63a885b..5e16afe 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 _0x663a=['fs-extra','get','index','isAuthenticated','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x663a,0x119));var _0xa663=function(_0x46b43f,_0x4bc3ff){_0x46b43f=_0x46b43f-0x0;var _0x52e1d0=_0x663a[_0x46b43f];return _0x52e1d0;};'use strict';var multer=require(_0xa663('0x0'));var util=require(_0xa663('0x1'));var path=require(_0xa663('0x2'));var timeout=require(_0xa663('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa663('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0xa663('0x5')]('/',auth['isAuthenticated'](),controller[_0xa663('0x6')]);router['get']('/:id',auth[_0xa663('0x7')](),controller['show']);router[_0xa663('0x8')]('/',auth[_0xa663('0x7')](),controller[_0xa663('0x9')]);router[_0xa663('0xa')](_0xa663('0xb'),auth[_0xa663('0x7')](),controller['update']);router[_0xa663('0xc')](_0xa663('0xb'),auth['isAuthenticated'](),controller[_0xa663('0xd')]);module[_0xa663('0xe')]=router;
\ No newline at end of file
+var _0x025c=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete'];(function(_0x3b0c9d,_0x3ddeb5){var _0xcfc8d7=function(_0x320dc6){while(--_0x320dc6){_0x3b0c9d['push'](_0x3b0c9d['shift']());}};_0xcfc8d7(++_0x3ddeb5);}(_0x025c,0x128));var _0xc025=function(_0x114975,_0x4c8b1a){_0x114975=_0x114975-0x0;var _0x41a0bd=_0x025c[_0x114975];return _0x41a0bd;};'use strict';var multer=require(_0xc025('0x0'));var util=require(_0xc025('0x1'));var path=require(_0xc025('0x2'));var timeout=require('connect-timeout');var express=require(_0xc025('0x3'));var router=express[_0xc025('0x4')]();var fs_extra=require(_0xc025('0x5'));var auth=require(_0xc025('0x6'));var interaction=require(_0xc025('0x7'));var config=require('../../config/environment');var controller=require(_0xc025('0x8'));router['get']('/',auth[_0xc025('0x9')](),controller[_0xc025('0xa')]);router[_0xc025('0xb')](_0xc025('0xc'),auth[_0xc025('0x9')](),controller[_0xc025('0xd')]);router[_0xc025('0xe')]('/',auth[_0xc025('0x9')](),controller[_0xc025('0xf')]);router[_0xc025('0x10')](_0xc025('0xc'),auth[_0xc025('0x9')](),controller[_0xc025('0x11')]);router[_0xc025('0x12')](_0xc025('0xc'),auth[_0xc025('0x9')](),controller[_0xc025('0x13')]);module[_0xc025('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index ff47daf..17e62e6 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 _0x50c3=['exports','STRING'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x50c3,0x176));var _0x350c=function(_0x65086d,_0x1b4ee5){_0x65086d=_0x65086d-0x0;var _0x55bca3=_0x50c3[_0x65086d];return _0x55bca3;};'use strict';var Sequelize=require('sequelize');module[_0x350c('0x0')]={'name':{'type':Sequelize[_0x350c('0x1')]},'basename':{'type':Sequelize[_0x350c('0x1')]},'type':{'type':Sequelize[_0x350c('0x1')]}};
\ No newline at end of file
+var _0xbacb=['exports','STRING'];(function(_0x42b1e1,_0x2c393d){var _0x2276eb=function(_0x3e7a56){while(--_0x3e7a56){_0x42b1e1['push'](_0x42b1e1['shift']());}};_0x2276eb(++_0x2c393d);}(_0xbacb,0x104));var _0xbbac=function(_0x32eade,_0x4d817e){_0x32eade=_0x32eade-0x0;var _0x1bc1d6=_0xbacb[_0x32eade];return _0x1bc1d6;};'use strict';var Sequelize=require('sequelize');module[_0xbbac('0x0')]={'name':{'type':Sequelize[_0xbbac('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xbbac('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 7f03a90..ddad7f5 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 _0xa9e0=['sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','fields','find','clone','omit','createdAt','updatedAt','body','update','create','file','originalname','basename','filename','mimetype','join','root','server/files/attachments/','offline-chat/','download','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','stack','name','index','map','Attachment','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit'];(function(_0x3a2849,_0xf7766a){var _0x1456af=function(_0x466000){while(--_0x466000){_0x3a2849['push'](_0x3a2849['shift']());}};_0x1456af(++_0xf7766a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var fs_extra=require(_0x0a9e('0xa'));var _=require(_0x0a9e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0a9e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0a9e('0xd'));var Papa=require(_0x0a9e('0xe'));var Redis=require(_0x0a9e('0xf'));var authService=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var as=require(_0x0a9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0a9e('0x13'));var licenseUtil=require(_0x0a9e('0x14'));var db=require(_0x0a9e('0x15'))['db'];function respondWithStatusCode(_0x26d672,_0x32d742){_0x32d742=_0x32d742||0xcc;return function(_0x69aeb7){if(_0x69aeb7){return _0x26d672['sendStatus'](_0x32d742);}return _0x26d672[_0x0a9e('0x16')](_0x32d742)[_0x0a9e('0x17')]();};}function respondWithResult(_0x2b4227,_0x281129){_0x281129=_0x281129||0xc8;return function(_0x44dcfd){if(_0x44dcfd){return _0x2b4227[_0x0a9e('0x16')](_0x281129)['json'](_0x44dcfd);}};}function respondWithFilteredResult(_0x22dccb,_0x5d0880){return function(_0x1985b6){if(_0x1985b6){var _0x519dfd=_0x1985b6[_0x0a9e('0x18')],_0x16033c=_0x5d0880['offset'],_0x12066b=_0x5d0880[_0x0a9e('0x19')]+_0x5d0880[_0x0a9e('0x1a')],_0x48f32d;if(_0x12066b>=_0x519dfd){_0x12066b=_0x519dfd;_0x48f32d=0xc8;}else{_0x48f32d=0xce;}_0x22dccb[_0x0a9e('0x16')](_0x48f32d);return _0x22dccb[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x16033c+'-'+_0x12066b+'/'+_0x519dfd)[_0x0a9e('0x1d')](_0x1985b6);}return null;};}function patchUpdates(_0x530eb7){return function(_0x20559e){try{jsonpatch[_0x0a9e('0x1e')](_0x20559e,_0x530eb7,!![]);}catch(_0x112016){return BPromise[_0x0a9e('0x1f')](_0x112016);}return _0x20559e[_0x0a9e('0x20')]();};}function saveUpdates(_0x4bb1e3,_0x2c3407){return function(_0x155cce){if(_0x155cce){return _0x155cce['update'](_0x4bb1e3)[_0x0a9e('0x21')](function(_0x5a09ef){return _0x5a09ef;});}return null;};}function removeEntity(_0x588269,_0x3a02e1){return function(_0x432e56){if(_0x432e56){return _0x432e56[_0x0a9e('0x22')]()[_0x0a9e('0x21')](function(){_0x588269['status'](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(!_0x4d00e6){_0x2fb0e4[_0x0a9e('0x23')](0x194);}return _0x4d00e6;};}function handleError(_0x42ac8f,_0x16b1ca){_0x16b1ca=_0x16b1ca||0x1f4;return function(_0x5ea472){logger['error'](_0x5ea472[_0x0a9e('0x24')]);if(_0x5ea472[_0x0a9e('0x25')]){delete _0x5ea472[_0x0a9e('0x25')];}_0x42ac8f[_0x0a9e('0x16')](_0x16b1ca)['send'](_0x5ea472);};}exports[_0x0a9e('0x26')]=function(_0x479bc4,_0x45a1e7){var _0x5bfb33={},_0x1dc186={},_0x34dc65={'count':0x0,'rows':[]};var _0x25fba9=_[_0x0a9e('0x27')](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x11c3b6){return{'name':_0x11c3b6[_0x0a9e('0x2a')],'type':_0x11c3b6['type'][_0x0a9e('0x2b')]};});_0x1dc186[_0x0a9e('0x2c')]=_[_0x0a9e('0x27')](_0x25fba9,_0x0a9e('0x25'));_0x1dc186['query']=_[_0x0a9e('0x2d')](_0x479bc4[_0x0a9e('0x2e')]);_0x1dc186[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x1dc186[_0x0a9e('0x2c')],_0x1dc186[_0x0a9e('0x2e')]);_0x5bfb33[_0x0a9e('0x31')]=_[_0x0a9e('0x30')](_0x1dc186[_0x0a9e('0x2c')],qs['fields'](_0x479bc4[_0x0a9e('0x2e')]['fields']));_0x5bfb33[_0x0a9e('0x31')]=_0x5bfb33[_0x0a9e('0x31')][_0x0a9e('0x32')]?_0x5bfb33[_0x0a9e('0x31')]:_0x1dc186[_0x0a9e('0x2c')];if(!_0x479bc4['query'][_0x0a9e('0x33')](_0x0a9e('0x34'))){_0x5bfb33[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x479bc4[_0x0a9e('0x2e')][_0x0a9e('0x1a')]);_0x5bfb33[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x479bc4['query'][_0x0a9e('0x19')]);}_0x5bfb33['order']=qs[_0x0a9e('0x35')](_0x479bc4[_0x0a9e('0x2e')][_0x0a9e('0x35')]);_0x5bfb33[_0x0a9e('0x36')]=qs['filters'](_[_0x0a9e('0x37')](_0x479bc4[_0x0a9e('0x2e')],_0x1dc186[_0x0a9e('0x2f')]),_0x25fba9);if(_0x479bc4[_0x0a9e('0x2e')]['filter']){_0x5bfb33['where']=_[_0x0a9e('0x38')](_0x5bfb33['where'],{'$or':_[_0x0a9e('0x27')](_0x25fba9,function(_0x3d9717){if(_0x3d9717[_0x0a9e('0x39')]!==_0x0a9e('0x3a')){var _0x4f41ae={};_0x4f41ae[_0x3d9717[_0x0a9e('0x25')]]={'$like':'%'+_0x479bc4[_0x0a9e('0x2e')][_0x0a9e('0x3b')]+'%'};return _0x4f41ae;}})});}_0x5bfb33=_['merge']({},_0x5bfb33,_0x479bc4[_0x0a9e('0x3c')]);var _0x1a180b={'where':_0x5bfb33[_0x0a9e('0x36')]};return db['Attachment']['count'](_0x1a180b)[_0x0a9e('0x21')](function(_0x40d766){_0x34dc65['count']=_0x40d766;if(_0x479bc4[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0x5bfb33[_0x0a9e('0x3e')]=[{'all':!![]}];}return db[_0x0a9e('0x28')]['findAll'](_0x5bfb33);})['then'](function(_0x15e37d){_0x34dc65[_0x0a9e('0x3f')]=_0x15e37d;return _0x34dc65;})['then'](respondWithFilteredResult(_0x45a1e7,_0x5bfb33))[_0x0a9e('0x40')](handleError(_0x45a1e7,null));};exports[_0x0a9e('0x41')]=function(_0x1459bb,_0x5b4f5e){var _0x316c8f={'raw':!![],'where':{'id':_0x1459bb[_0x0a9e('0x42')]['id']}},_0x2cfea9={};_0x2cfea9[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2cfea9[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x1459bb[_0x0a9e('0x2e')]);_0x2cfea9[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x2cfea9[_0x0a9e('0x2c')],_0x2cfea9[_0x0a9e('0x2e')]);_0x316c8f[_0x0a9e('0x31')]=_['intersection'](_0x2cfea9['model'],qs[_0x0a9e('0x43')](_0x1459bb[_0x0a9e('0x2e')][_0x0a9e('0x43')]));_0x316c8f[_0x0a9e('0x31')]=_0x316c8f[_0x0a9e('0x31')][_0x0a9e('0x32')]?_0x316c8f[_0x0a9e('0x31')]:_0x2cfea9[_0x0a9e('0x2c')];if(_0x1459bb[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0x316c8f[_0x0a9e('0x3e')]=[{'all':!![]}];}_0x316c8f=_[_0x0a9e('0x38')]({},_0x316c8f,_0x1459bb['options']);return db[_0x0a9e('0x28')][_0x0a9e('0x44')](_0x316c8f)[_0x0a9e('0x21')](handleEntityNotFound(_0x5b4f5e,null))[_0x0a9e('0x21')](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0x40')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x45')]=function(_0x21eb86,_0x44dd99){var _0x59afe8={'where':{'id':_0x21eb86['params']['id']}},_0x2e9d90={};_0x2e9d90[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x28')]['rawAttributes']);_0x59afe8[_0x0a9e('0x31')]=_[_0x0a9e('0x30')](_0x2e9d90[_0x0a9e('0x2c')],qs[_0x0a9e('0x43')](_0x21eb86[_0x0a9e('0x2e')][_0x0a9e('0x43')]));_0x59afe8[_0x0a9e('0x31')]=_0x59afe8['attributes'][_0x0a9e('0x32')]?_0x59afe8[_0x0a9e('0x31')]:_0x2e9d90[_0x0a9e('0x2c')];if(_0x21eb86[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0x59afe8[_0x0a9e('0x3e')]=[{'all':!![]}];}_0x59afe8=_[_0x0a9e('0x38')]({},_0x59afe8,_0x21eb86[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')]['find'](_0x59afe8)[_0x0a9e('0x21')](handleEntityNotFound(_0x44dd99,null))[_0x0a9e('0x21')](function(_0x4f7240){if(_0x4f7240){var _0x4ae14b=_0x4f7240['get']({'plain':!![]});_0x4ae14b=qs[_0x0a9e('0x46')](_0x4ae14b,['id',_0x0a9e('0x47'),_0x0a9e('0x48')]);_0x21eb86[_0x0a9e('0x49')]=_[_0x0a9e('0x46')](_0x21eb86[_0x0a9e('0x49')],['id',_0x0a9e('0x47'),_0x0a9e('0x48')]);return db['Attachment']['create'](_['merge'](_0x4ae14b,_0x21eb86[_0x0a9e('0x49')]),{'include':_0x21eb86[_0x0a9e('0x2e')][_0x0a9e('0x3d')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x44dd99,0xc9))[_0x0a9e('0x40')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x4a')]=function(_0x53d113,_0x5a88da){if(_0x53d113[_0x0a9e('0x49')]['id']){delete _0x53d113['body']['id'];}return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x53d113[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x5a88da,null))[_0x0a9e('0x21')](saveUpdates(_0x53d113['body'],null))[_0x0a9e('0x21')](respondWithResult(_0x5a88da,null))[_0x0a9e('0x40')](handleError(_0x5a88da,null));};exports['destroy']=function(_0x50f687,_0x128aa6){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x50f687[_0x0a9e('0x42')]['id']}})['then'](handleEntityNotFound(_0x128aa6,null))[_0x0a9e('0x21')](removeEntity(_0x128aa6,null))['catch'](handleError(_0x128aa6,null));};exports[_0x0a9e('0x4b')]=function(_0x4a6deb,_0x5da27d,_0x5df0ad){_0x4a6deb[_0x0a9e('0x49')]['name']=_0x4a6deb[_0x0a9e('0x4c')][_0x0a9e('0x4d')];_0x4a6deb[_0x0a9e('0x49')][_0x0a9e('0x4e')]=_0x4a6deb[_0x0a9e('0x4c')][_0x0a9e('0x4f')];_0x4a6deb[_0x0a9e('0x49')][_0x0a9e('0x39')]=_0x4a6deb['file'][_0x0a9e('0x50')];return db[_0x0a9e('0x28')][_0x0a9e('0x4b')](_0x4a6deb[_0x0a9e('0x49')])[_0x0a9e('0x21')](respondWithResult(_0x5da27d,0xc9))[_0x0a9e('0x40')](handleError(_0x5da27d,null));};exports['download']=function(_0x956fbe,_0x26bc80,_0x5239ef){return db[_0x0a9e('0x28')]['findOne']({'where':{'id':_0x956fbe[_0x0a9e('0x42')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x26bc80,null))['then'](function(_0x5674ee){if(_0x5674ee){var _0x273cb5=_0x5674ee['ChatOfflineMessageId']!==null;var _0x2244d6=path[_0x0a9e('0x51')](config[_0x0a9e('0x52')],_0x0a9e('0x53'));if(_0x273cb5){_0x2244d6=path[_0x0a9e('0x51')](_0x2244d6,_0x0a9e('0x54'));}var _0x49eed0=path[_0x0a9e('0x51')](_0x2244d6,_0x5674ee['basename']);return _0x26bc80[_0x0a9e('0x55')](_0x49eed0);}})[_0x0a9e('0x40')](handleError(_0x26bc80,null));};
\ No newline at end of file
+var _0xa9e0=['sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','fields','find','clone','omit','createdAt','updatedAt','body','update','create','file','originalname','basename','filename','mimetype','join','root','server/files/attachments/','offline-chat/','download','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','stack','name','index','map','Attachment','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit'];(function(_0xe81e03,_0x15695d){var _0x2e87c6=function(_0x17557e){while(--_0x17557e){_0xe81e03['push'](_0xe81e03['shift']());}};_0x2e87c6(++_0x15695d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var fs_extra=require(_0x0a9e('0xa'));var _=require(_0x0a9e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0a9e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0a9e('0xd'));var Papa=require(_0x0a9e('0xe'));var Redis=require(_0x0a9e('0xf'));var authService=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var as=require(_0x0a9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0a9e('0x13'));var licenseUtil=require(_0x0a9e('0x14'));var db=require(_0x0a9e('0x15'))['db'];function respondWithStatusCode(_0x26d672,_0x32d742){_0x32d742=_0x32d742||0xcc;return function(_0x69aeb7){if(_0x69aeb7){return _0x26d672['sendStatus'](_0x32d742);}return _0x26d672[_0x0a9e('0x16')](_0x32d742)[_0x0a9e('0x17')]();};}function respondWithResult(_0x2b4227,_0x281129){_0x281129=_0x281129||0xc8;return function(_0x44dcfd){if(_0x44dcfd){return _0x2b4227[_0x0a9e('0x16')](_0x281129)['json'](_0x44dcfd);}};}function respondWithFilteredResult(_0x22dccb,_0x5d0880){return function(_0x1985b6){if(_0x1985b6){var _0x519dfd=_0x1985b6[_0x0a9e('0x18')],_0x16033c=_0x5d0880['offset'],_0x12066b=_0x5d0880[_0x0a9e('0x19')]+_0x5d0880[_0x0a9e('0x1a')],_0x48f32d;if(_0x12066b>=_0x519dfd){_0x12066b=_0x519dfd;_0x48f32d=0xc8;}else{_0x48f32d=0xce;}_0x22dccb[_0x0a9e('0x16')](_0x48f32d);return _0x22dccb[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x16033c+'-'+_0x12066b+'/'+_0x519dfd)[_0x0a9e('0x1d')](_0x1985b6);}return null;};}function patchUpdates(_0x530eb7){return function(_0x20559e){try{jsonpatch[_0x0a9e('0x1e')](_0x20559e,_0x530eb7,!![]);}catch(_0x112016){return BPromise[_0x0a9e('0x1f')](_0x112016);}return _0x20559e[_0x0a9e('0x20')]();};}function saveUpdates(_0x4bb1e3,_0x2c3407){return function(_0x155cce){if(_0x155cce){return _0x155cce['update'](_0x4bb1e3)[_0x0a9e('0x21')](function(_0x5a09ef){return _0x5a09ef;});}return null;};}function removeEntity(_0x588269,_0x3a02e1){return function(_0x432e56){if(_0x432e56){return _0x432e56[_0x0a9e('0x22')]()[_0x0a9e('0x21')](function(){_0x588269['status'](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(!_0x4d00e6){_0x2fb0e4[_0x0a9e('0x23')](0x194);}return _0x4d00e6;};}function handleError(_0x42ac8f,_0x16b1ca){_0x16b1ca=_0x16b1ca||0x1f4;return function(_0x5ea472){logger['error'](_0x5ea472[_0x0a9e('0x24')]);if(_0x5ea472[_0x0a9e('0x25')]){delete _0x5ea472[_0x0a9e('0x25')];}_0x42ac8f[_0x0a9e('0x16')](_0x16b1ca)['send'](_0x5ea472);};}exports[_0x0a9e('0x26')]=function(_0x479bc4,_0x45a1e7){var _0x5bfb33={},_0x1dc186={},_0x34dc65={'count':0x0,'rows':[]};var _0x25fba9=_[_0x0a9e('0x27')](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x11c3b6){return{'name':_0x11c3b6[_0x0a9e('0x2a')],'type':_0x11c3b6['type'][_0x0a9e('0x2b')]};});_0x1dc186[_0x0a9e('0x2c')]=_[_0x0a9e('0x27')](_0x25fba9,_0x0a9e('0x25'));_0x1dc186['query']=_[_0x0a9e('0x2d')](_0x479bc4[_0x0a9e('0x2e')]);_0x1dc186[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x1dc186[_0x0a9e('0x2c')],_0x1dc186[_0x0a9e('0x2e')]);_0x5bfb33[_0x0a9e('0x31')]=_[_0x0a9e('0x30')](_0x1dc186[_0x0a9e('0x2c')],qs['fields'](_0x479bc4[_0x0a9e('0x2e')]['fields']));_0x5bfb33[_0x0a9e('0x31')]=_0x5bfb33[_0x0a9e('0x31')][_0x0a9e('0x32')]?_0x5bfb33[_0x0a9e('0x31')]:_0x1dc186[_0x0a9e('0x2c')];if(!_0x479bc4['query'][_0x0a9e('0x33')](_0x0a9e('0x34'))){_0x5bfb33[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x479bc4[_0x0a9e('0x2e')][_0x0a9e('0x1a')]);_0x5bfb33[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x479bc4['query'][_0x0a9e('0x19')]);}_0x5bfb33['order']=qs[_0x0a9e('0x35')](_0x479bc4[_0x0a9e('0x2e')][_0x0a9e('0x35')]);_0x5bfb33[_0x0a9e('0x36')]=qs['filters'](_[_0x0a9e('0x37')](_0x479bc4[_0x0a9e('0x2e')],_0x1dc186[_0x0a9e('0x2f')]),_0x25fba9);if(_0x479bc4[_0x0a9e('0x2e')]['filter']){_0x5bfb33['where']=_[_0x0a9e('0x38')](_0x5bfb33['where'],{'$or':_[_0x0a9e('0x27')](_0x25fba9,function(_0x3d9717){if(_0x3d9717[_0x0a9e('0x39')]!==_0x0a9e('0x3a')){var _0x4f41ae={};_0x4f41ae[_0x3d9717[_0x0a9e('0x25')]]={'$like':'%'+_0x479bc4[_0x0a9e('0x2e')][_0x0a9e('0x3b')]+'%'};return _0x4f41ae;}})});}_0x5bfb33=_['merge']({},_0x5bfb33,_0x479bc4[_0x0a9e('0x3c')]);var _0x1a180b={'where':_0x5bfb33[_0x0a9e('0x36')]};return db['Attachment']['count'](_0x1a180b)[_0x0a9e('0x21')](function(_0x40d766){_0x34dc65['count']=_0x40d766;if(_0x479bc4[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0x5bfb33[_0x0a9e('0x3e')]=[{'all':!![]}];}return db[_0x0a9e('0x28')]['findAll'](_0x5bfb33);})['then'](function(_0x15e37d){_0x34dc65[_0x0a9e('0x3f')]=_0x15e37d;return _0x34dc65;})['then'](respondWithFilteredResult(_0x45a1e7,_0x5bfb33))[_0x0a9e('0x40')](handleError(_0x45a1e7,null));};exports[_0x0a9e('0x41')]=function(_0x1459bb,_0x5b4f5e){var _0x316c8f={'raw':!![],'where':{'id':_0x1459bb[_0x0a9e('0x42')]['id']}},_0x2cfea9={};_0x2cfea9[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2cfea9[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x1459bb[_0x0a9e('0x2e')]);_0x2cfea9[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x2cfea9[_0x0a9e('0x2c')],_0x2cfea9[_0x0a9e('0x2e')]);_0x316c8f[_0x0a9e('0x31')]=_['intersection'](_0x2cfea9['model'],qs[_0x0a9e('0x43')](_0x1459bb[_0x0a9e('0x2e')][_0x0a9e('0x43')]));_0x316c8f[_0x0a9e('0x31')]=_0x316c8f[_0x0a9e('0x31')][_0x0a9e('0x32')]?_0x316c8f[_0x0a9e('0x31')]:_0x2cfea9[_0x0a9e('0x2c')];if(_0x1459bb[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0x316c8f[_0x0a9e('0x3e')]=[{'all':!![]}];}_0x316c8f=_[_0x0a9e('0x38')]({},_0x316c8f,_0x1459bb['options']);return db[_0x0a9e('0x28')][_0x0a9e('0x44')](_0x316c8f)[_0x0a9e('0x21')](handleEntityNotFound(_0x5b4f5e,null))[_0x0a9e('0x21')](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0x40')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x45')]=function(_0x21eb86,_0x44dd99){var _0x59afe8={'where':{'id':_0x21eb86['params']['id']}},_0x2e9d90={};_0x2e9d90[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x28')]['rawAttributes']);_0x59afe8[_0x0a9e('0x31')]=_[_0x0a9e('0x30')](_0x2e9d90[_0x0a9e('0x2c')],qs[_0x0a9e('0x43')](_0x21eb86[_0x0a9e('0x2e')][_0x0a9e('0x43')]));_0x59afe8[_0x0a9e('0x31')]=_0x59afe8['attributes'][_0x0a9e('0x32')]?_0x59afe8[_0x0a9e('0x31')]:_0x2e9d90[_0x0a9e('0x2c')];if(_0x21eb86[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0x59afe8[_0x0a9e('0x3e')]=[{'all':!![]}];}_0x59afe8=_[_0x0a9e('0x38')]({},_0x59afe8,_0x21eb86[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')]['find'](_0x59afe8)[_0x0a9e('0x21')](handleEntityNotFound(_0x44dd99,null))[_0x0a9e('0x21')](function(_0x4f7240){if(_0x4f7240){var _0x4ae14b=_0x4f7240['get']({'plain':!![]});_0x4ae14b=qs[_0x0a9e('0x46')](_0x4ae14b,['id',_0x0a9e('0x47'),_0x0a9e('0x48')]);_0x21eb86[_0x0a9e('0x49')]=_[_0x0a9e('0x46')](_0x21eb86[_0x0a9e('0x49')],['id',_0x0a9e('0x47'),_0x0a9e('0x48')]);return db['Attachment']['create'](_['merge'](_0x4ae14b,_0x21eb86[_0x0a9e('0x49')]),{'include':_0x21eb86[_0x0a9e('0x2e')][_0x0a9e('0x3d')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x44dd99,0xc9))[_0x0a9e('0x40')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x4a')]=function(_0x53d113,_0x5a88da){if(_0x53d113[_0x0a9e('0x49')]['id']){delete _0x53d113['body']['id'];}return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x53d113[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x5a88da,null))[_0x0a9e('0x21')](saveUpdates(_0x53d113['body'],null))[_0x0a9e('0x21')](respondWithResult(_0x5a88da,null))[_0x0a9e('0x40')](handleError(_0x5a88da,null));};exports['destroy']=function(_0x50f687,_0x128aa6){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x50f687[_0x0a9e('0x42')]['id']}})['then'](handleEntityNotFound(_0x128aa6,null))[_0x0a9e('0x21')](removeEntity(_0x128aa6,null))['catch'](handleError(_0x128aa6,null));};exports[_0x0a9e('0x4b')]=function(_0x4a6deb,_0x5da27d,_0x5df0ad){_0x4a6deb[_0x0a9e('0x49')]['name']=_0x4a6deb[_0x0a9e('0x4c')][_0x0a9e('0x4d')];_0x4a6deb[_0x0a9e('0x49')][_0x0a9e('0x4e')]=_0x4a6deb[_0x0a9e('0x4c')][_0x0a9e('0x4f')];_0x4a6deb[_0x0a9e('0x49')][_0x0a9e('0x39')]=_0x4a6deb['file'][_0x0a9e('0x50')];return db[_0x0a9e('0x28')][_0x0a9e('0x4b')](_0x4a6deb[_0x0a9e('0x49')])[_0x0a9e('0x21')](respondWithResult(_0x5da27d,0xc9))[_0x0a9e('0x40')](handleError(_0x5da27d,null));};exports['download']=function(_0x956fbe,_0x26bc80,_0x5239ef){return db[_0x0a9e('0x28')]['findOne']({'where':{'id':_0x956fbe[_0x0a9e('0x42')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x26bc80,null))['then'](function(_0x5674ee){if(_0x5674ee){var _0x273cb5=_0x5674ee['ChatOfflineMessageId']!==null;var _0x2244d6=path[_0x0a9e('0x51')](config[_0x0a9e('0x52')],_0x0a9e('0x53'));if(_0x273cb5){_0x2244d6=path[_0x0a9e('0x51')](_0x2244d6,_0x0a9e('0x54'));}var _0x49eed0=path[_0x0a9e('0x51')](_0x2244d6,_0x5674ee['basename']);return _0x26bc80[_0x0a9e('0x55')](_0x49eed0);}})[_0x0a9e('0x40')](handleError(_0x26bc80,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 36418f7..77e4810 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 _0x98b7=['rimraf','../../config/environment','./attachment.attributes','exports','Attachment','attachments','lodash','util','../../config/logger','api','path'];(function(_0x20210e,_0x1603f6){var _0x439c00=function(_0x5b4cc2){while(--_0x5b4cc2){_0x20210e['push'](_0x20210e['shift']());}};_0x439c00(++_0x1603f6);}(_0x98b7,0xc1));var _0x798b=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x98b7[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x798b('0x0'));var util=require(_0x798b('0x1'));var logger=require(_0x798b('0x2'))(_0x798b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x798b('0x4'));var rimraf=require(_0x798b('0x5'));var config=require(_0x798b('0x6'));var attributes=require(_0x798b('0x7'));module[_0x798b('0x8')]=function(_0x4c197e,_0x2bab89){return _0x4c197e['define'](_0x798b('0x9'),attributes,{'tableName':_0x798b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xea5b=['bluebird','request-promise','path','rimraf','./attachment.attributes','define','Attachment','attachments','lodash','util','../../config/logger'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0xea5b,0x152));var _0xbea5=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xea5b[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xbea5('0x0'));var util=require(_0xbea5('0x1'));var logger=require(_0xbea5('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbea5('0x3'));var rp=require(_0xbea5('0x4'));var fs=require('fs');var path=require(_0xbea5('0x5'));var rimraf=require(_0xbea5('0x6'));var config=require('../../config/environment');var attributes=require(_0xbea5('0x7'));module['exports']=function(_0x2db67a,_0x3d9263){return _0x2db67a[_0xbea5('0x8')](_0xbea5('0x9'),attributes,{'tableName':_0xbea5('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 f2fd575..c6d4d72 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 _0x9cbf=['rpc','../../config/environment','client','http','request','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateAttachment','Attachment','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4bb555,_0x3aff4a){var _0x71910a=function(_0x3ce4a8){while(--_0x3ce4a8){_0x4bb555['push'](_0x4bb555['shift']());}};_0x71910a(++_0x3aff4a);}(_0x9cbf,0xe1));var _0xf9cb=function(_0x59355c,_0x10ff75){_0x59355c=_0x59355c-0x0;var _0x5f59bf=_0x9cbf[_0x59355c];return _0x5f59bf;};'use strict';var _=require(_0xf9cb('0x0'));var util=require(_0xf9cb('0x1'));var moment=require(_0xf9cb('0x2'));var BPromise=require(_0xf9cb('0x3'));var rs=require(_0xf9cb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf9cb('0x5'))['db'];var utils=require(_0xf9cb('0x6'));var logger=require('../../config/logger')(_0xf9cb('0x7'));var config=require(_0xf9cb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf9cb('0x9')][_0xf9cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x337ed4,_0x50fd0f,_0x3c6061){return new BPromise(function(_0x58b707,_0x36c7f6){return client[_0xf9cb('0xb')](_0x337ed4,_0x3c6061)['then'](function(_0x54e0be){logger['info'](_0xf9cb('0xc'),_0x50fd0f,_0xf9cb('0xd'));logger[_0xf9cb('0xe')](_0xf9cb('0xf'),_0x50fd0f,_0xf9cb('0xd'),JSON[_0xf9cb('0x10')](_0x54e0be));if(_0x54e0be[_0xf9cb('0x11')]){if(_0x54e0be[_0xf9cb('0x11')][_0xf9cb('0x12')]===0x1f4){logger['error'](_0xf9cb('0xc'),_0x50fd0f,_0x54e0be[_0xf9cb('0x11')][_0xf9cb('0x13')]);return _0x36c7f6(_0x54e0be[_0xf9cb('0x11')]['message']);}logger['error'](_0xf9cb('0xc'),_0x50fd0f,_0x54e0be[_0xf9cb('0x11')][_0xf9cb('0x13')]);return _0x58b707(_0x54e0be[_0xf9cb('0x11')]['message']);}else{logger[_0xf9cb('0x14')]('Attachment,\x20%s,\x20%s',_0x50fd0f,_0xf9cb('0xd'));_0x58b707(_0x54e0be['result'][_0xf9cb('0x13')]);}})[_0xf9cb('0x15')](function(_0x1b9dff){logger['error'](_0xf9cb('0xc'),_0x50fd0f,_0x1b9dff);_0x36c7f6(_0x1b9dff);});});}exports[_0xf9cb('0x16')]=function(_0x134700){var _0x424e62=this;return new Promise(function(_0xcd0aa1,_0x36ac9d){return db[_0xf9cb('0x17')][_0xf9cb('0x18')](_0x134700[_0xf9cb('0x19')],{'raw':_0x134700[_0xf9cb('0x1a')]?_0x134700[_0xf9cb('0x1a')][_0xf9cb('0x1b')]===undefined?!![]:![]:!![]})[_0xf9cb('0x1c')](function(_0x3ace7b){logger['info']('CreateAttachment',_0x134700);logger[_0xf9cb('0xe')](_0xf9cb('0x16'),_0x134700,JSON[_0xf9cb('0x10')](_0x3ace7b));_0xcd0aa1(_0x3ace7b);})['catch'](function(_0x239f8b){logger[_0xf9cb('0x11')]('CreateAttachment',_0x239f8b[_0xf9cb('0x13')],_0x134700);_0x36ac9d(_0x424e62[_0xf9cb('0x11')](0x1f4,_0x239f8b[_0xf9cb('0x13')]));});});};
\ No newline at end of file
+var _0x970c=['create','options','debug','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','client','http','request','then','info','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Attachment,\x20%s,\x20%s','CreateAttachment'];(function(_0x1a57cb,_0x5ec459){var _0x4d59c8=function(_0x2afc92){while(--_0x2afc92){_0x1a57cb['push'](_0x1a57cb['shift']());}};_0x4d59c8(++_0x5ec459);}(_0x970c,0x1ac));var _0xc970=function(_0x8bda08,_0x1fdb02){_0x8bda08=_0x8bda08-0x0;var _0x50007f=_0x970c[_0x8bda08];return _0x50007f;};'use strict';var _=require(_0xc970('0x0'));var util=require(_0xc970('0x1'));var moment=require(_0xc970('0x2'));var BPromise=require('bluebird');var rs=require(_0xc970('0x3'));var fs=require('fs');var Redis=require(_0xc970('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc970('0x5'));var logger=require('../../config/logger')(_0xc970('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc970('0x7')][_0xc970('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e0645,_0x984617,_0x1e6dcd){return new BPromise(function(_0x15a0ad,_0x46fc94){return client[_0xc970('0x9')](_0x4e0645,_0x1e6dcd)[_0xc970('0xa')](function(_0x4563cf){logger[_0xc970('0xb')]('Attachment,\x20%s,\x20%s',_0x984617,'request\x20sent');logger['debug'](_0xc970('0xc'),_0x984617,_0xc970('0xd'),JSON[_0xc970('0xe')](_0x4563cf));if(_0x4563cf['error']){if(_0x4563cf[_0xc970('0xf')][_0xc970('0x10')]===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x984617,_0x4563cf[_0xc970('0xf')][_0xc970('0x11')]);return _0x46fc94(_0x4563cf[_0xc970('0xf')][_0xc970('0x11')]);}logger[_0xc970('0xf')]('Attachment,\x20%s,\x20%s',_0x984617,_0x4563cf[_0xc970('0xf')][_0xc970('0x11')]);return _0x15a0ad(_0x4563cf[_0xc970('0xf')]['message']);}else{logger[_0xc970('0xb')]('Attachment,\x20%s,\x20%s',_0x984617,'request\x20sent');_0x15a0ad(_0x4563cf[_0xc970('0x12')][_0xc970('0x11')]);}})[_0xc970('0x13')](function(_0x4ebfd2){logger['error'](_0xc970('0x14'),_0x984617,_0x4ebfd2);_0x46fc94(_0x4ebfd2);});});}exports[_0xc970('0x15')]=function(_0xded351){var _0x5b242e=this;return new Promise(function(_0x2e719c,_0x4d9ecf){return db['Attachment'][_0xc970('0x16')](_0xded351['body'],{'raw':_0xded351[_0xc970('0x17')]?_0xded351[_0xc970('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xc970('0xa')](function(_0x34b717){logger[_0xc970('0xb')](_0xc970('0x15'),_0xded351);logger[_0xc970('0x18')](_0xc970('0x15'),_0xded351,JSON['stringify'](_0x34b717));_0x2e719c(_0x34b717);})[_0xc970('0x13')](function(_0x591b80){logger[_0xc970('0xf')]('CreateAttachment',_0x591b80[_0xc970('0x11')],_0xded351);_0x4d9ecf(_0x5b242e[_0xc970('0xf')](0x1f4,_0x591b80[_0xc970('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 258f13e..3c330bf 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 _0xb9be=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','now','originalname','replace','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id'];(function(_0x5775c4,_0x11631c){var _0xa2e3a1=function(_0x3c9a67){while(--_0x3c9a67){_0x5775c4['push'](_0x5775c4['shift']());}};_0xa2e3a1(++_0x11631c);}(_0xb9be,0xc5));var _0xeb9b=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xb9be[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var path=require(_0xeb9b('0x2'));var timeout=require(_0xeb9b('0x3'));var express=require(_0xeb9b('0x4'));var router=express[_0xeb9b('0x5')]();var fs_extra=require(_0xeb9b('0x6'));var auth=require(_0xeb9b('0x7'));var interaction=require(_0xeb9b('0x8'));var config=require('../../config/environment');var controller=require('./attachment.controller');router[_0xeb9b('0x9')]('/',auth[_0xeb9b('0xa')](),controller[_0xeb9b('0xb')]);router['get'](_0xeb9b('0xc'),auth[_0xeb9b('0xa')](),controller[_0xeb9b('0xd')]);router[_0xeb9b('0x9')](_0xeb9b('0xe'),auth[_0xeb9b('0xa')](),controller[_0xeb9b('0xf')]);router[_0xeb9b('0x10')](_0xeb9b('0x11'),auth['isAuthenticated'](),controller[_0xeb9b('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4ea7bb,_0xa3b541,_0x4236c0){_0x4236c0(null,path['join'](config[_0xeb9b('0x13')],_0xeb9b('0x14')));},'filename':function(_0x3df18a,_0x2a01df,_0x51598f){_0x51598f(null,util['format']('%s-%s',Date[_0xeb9b('0x15')](),_0x2a01df[_0xeb9b('0x16')][_0xeb9b('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/',upload['single']('file'),controller[_0xeb9b('0x18')]);router[_0xeb9b('0x19')](_0xeb9b('0xc'),auth[_0xeb9b('0xa')](),controller[_0xeb9b('0x1a')]);router[_0xeb9b('0x1b')](_0xeb9b('0xc'),auth['isAuthenticated'](),controller[_0xeb9b('0x1c')]);module[_0xeb9b('0x1d')]=router;
\ No newline at end of file
+var _0x00b3=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','%s-%s','now','originalname','create','put','/:id','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./attachment.controller','get','isAuthenticated','index','/:id/download','download'];(function(_0x272764,_0x16630c){var _0xab237d=function(_0x38195b){while(--_0x38195b){_0x272764['push'](_0x272764['shift']());}};_0xab237d(++_0x16630c);}(_0x00b3,0x17a));var _0x300b=function(_0x529f72,_0x47f1e3){_0x529f72=_0x529f72-0x0;var _0x2d884a=_0x00b3[_0x529f72];return _0x2d884a;};'use strict';var multer=require('multer');var util=require(_0x300b('0x0'));var path=require(_0x300b('0x1'));var timeout=require(_0x300b('0x2'));var express=require(_0x300b('0x3'));var router=express['Router']();var fs_extra=require(_0x300b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x300b('0x5'));var config=require('../../config/environment');var controller=require(_0x300b('0x6'));router[_0x300b('0x7')]('/',auth[_0x300b('0x8')](),controller[_0x300b('0x9')]);router['get']('/:id',auth[_0x300b('0x8')](),controller['show']);router['get'](_0x300b('0xa'),auth[_0x300b('0x8')](),controller[_0x300b('0xb')]);router['post'](_0x300b('0xc'),auth[_0x300b('0x8')](),controller[_0x300b('0xd')]);var upload=multer({'storage':multer[_0x300b('0xe')]({'destination':function(_0x566fb9,_0x1a96aa,_0x2eeb2d){_0x2eeb2d(null,path[_0x300b('0xf')](config['root'],_0x300b('0x10')));},'filename':function(_0xea95bb,_0x138efb,_0x40c03b){_0x40c03b(null,util[_0x300b('0x11')](_0x300b('0x12'),Date[_0x300b('0x13')](),_0x138efb[_0x300b('0x14')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/',upload['single']('file'),controller[_0x300b('0x15')]);router[_0x300b('0x16')](_0x300b('0x17'),auth[_0x300b('0x8')](),controller['update']);router['delete'](_0x300b('0x17'),auth[_0x300b('0x8')](),controller[_0x300b('0x18')]);module[_0x300b('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 0200fca..4f9dd59 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 _0x5c02=['minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/utils','login','authenticate','google','profile','/login','use','clientSecret','secret','Setting','findOne','allowedLoginAttempts','blockDuration','then','find','map','emails','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add'];(function(_0x446f11,_0x1b4d8f){var _0x4edcbd=function(_0x5e9df5){while(--_0x5e9df5){_0x446f11['push'](_0x446f11['shift']());}};_0x4edcbd(++_0x1b4d8f);}(_0x5c02,0x1a8));var _0x25c0=function(_0x760f5c,_0x533de5){_0x760f5c=_0x760f5c-0x0;var _0x210cd6=_0x5c02[_0x760f5c];return _0x210cd6;};'use strict';var _=require(_0x25c0('0x0'));var passport=require(_0x25c0('0x1'));var GoogleStrategy=require(_0x25c0('0x2'))[_0x25c0('0x3')];var moment=require(_0x25c0('0x4'));var db=require(_0x25c0('0x5'))['db'];var config=require('../../config/environment');var signToken=require('../../components/auth/service')['signToken'];var utils=require(_0x25c0('0x6'));exports[_0x25c0('0x7')]=passport[_0x25c0('0x8')](_0x25c0('0x9'),{'failureRedirect':'/login','scope':[_0x25c0('0xa'),'email'],'session':![]});exports['callback']=passport[_0x25c0('0x8')](_0x25c0('0x9'),{'failureRedirect':_0x25c0('0xb'),'session':![]});passport[_0x25c0('0xc')](new GoogleStrategy({'clientID':config['google']?config[_0x25c0('0x9')]['clientID']:'id','clientSecret':config[_0x25c0('0x9')]?config['google'][_0x25c0('0xd')]:_0x25c0('0xe'),'callbackURL':config['google']?config[_0x25c0('0x9')]['callbackURL']:''},function(_0x25062a,_0x212eb6,_0x1e6f8d,_0x49d933){var _0x4bc567,_0x2b65b7;return db[_0x25c0('0xf')][_0x25c0('0x10')]({'where':{'id':0x1},'attributes':[_0x25c0('0x11'),_0x25c0('0x12')],'raw':!![]})[_0x25c0('0x13')](function(_0xc81c72){_0x4bc567=_0xc81c72;return db['User'][_0x25c0('0x14')]({'where':{'email':_[_0x25c0('0x15')](_0x1e6f8d[_0x25c0('0x16')],'value'),'role':{'$or':['admin','user',_0x25c0('0x17')]}}});})['then'](function(_0x5913c6){_0x2b65b7=_0x5913c6;if(_0x2b65b7){if(_0x2b65b7['disabled']){return _0x49d933(_0x25c0('0x18'));}else if(_0x4bc567['blockDuration']>0x0){if(_0x2b65b7['blocked']){if(moment(_0x2b65b7['blockedAt'])[_0x25c0('0x19')](_0x4bc567[_0x25c0('0x12')],_0x25c0('0x1a'))>moment()){return _0x49d933(_0x25c0('0x18'));}else{return utils[_0x25c0('0x1b')](_0x2b65b7,0x0,![],null)['then'](function(){return utils[_0x25c0('0x1c')](_0x2b65b7);})[_0x25c0('0x13')](function(){return _0x49d933(null,_0x2b65b7);});}}else{return utils[_0x25c0('0x1c')](_0x2b65b7)[_0x25c0('0x13')](function(){return _0x49d933(null,_0x2b65b7);});}}else{return utils['getLicense'](_0x2b65b7)[_0x25c0('0x13')](function(){return _0x49d933(null,_0x2b65b7);});}}return _0x49d933(_0x25c0('0x18'));})[_0x25c0('0x1d')](function(_0x43b28f){_0x49d933(_0x43b28f);});}));
\ No newline at end of file
+var _0x04fb=['callback','use','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','find','map','emails','admin','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','profile'];(function(_0x24afa6,_0x5c26db){var _0x2896a2=function(_0x598137){while(--_0x598137){_0x24afa6['push'](_0x24afa6['shift']());}};_0x2896a2(++_0x5c26db);}(_0x04fb,0x15a));var _0xb04f=function(_0xc1cb80,_0x60f7cf){_0xc1cb80=_0xc1cb80-0x0;var _0x55ab6b=_0x04fb[_0xc1cb80];return _0x55ab6b;};'use strict';var _=require('lodash');var passport=require(_0xb04f('0x0'));var GoogleStrategy=require(_0xb04f('0x1'))[_0xb04f('0x2')];var moment=require(_0xb04f('0x3'));var db=require(_0xb04f('0x4'))['db'];var config=require(_0xb04f('0x5'));var signToken=require(_0xb04f('0x6'))[_0xb04f('0x7')];var utils=require(_0xb04f('0x8'));exports[_0xb04f('0x9')]=passport[_0xb04f('0xa')](_0xb04f('0xb'),{'failureRedirect':_0xb04f('0xc'),'scope':[_0xb04f('0xd'),'email'],'session':![]});exports[_0xb04f('0xe')]=passport[_0xb04f('0xa')](_0xb04f('0xb'),{'failureRedirect':_0xb04f('0xc'),'session':![]});passport[_0xb04f('0xf')](new GoogleStrategy({'clientID':config[_0xb04f('0xb')]?config[_0xb04f('0xb')]['clientID']:'id','clientSecret':config[_0xb04f('0xb')]?config['google'][_0xb04f('0x10')]:_0xb04f('0x11'),'callbackURL':config[_0xb04f('0xb')]?config[_0xb04f('0xb')][_0xb04f('0x12')]:''},function(_0x9507ad,_0x5b284c,_0x14094e,_0x3662ef){var _0x5ce9df,_0xe0046c;return db[_0xb04f('0x13')][_0xb04f('0x14')]({'where':{'id':0x1},'attributes':[_0xb04f('0x15'),_0xb04f('0x16')],'raw':!![]})[_0xb04f('0x17')](function(_0x3f153b){_0x5ce9df=_0x3f153b;return db['User'][_0xb04f('0x18')]({'where':{'email':_[_0xb04f('0x19')](_0x14094e[_0xb04f('0x1a')],'value'),'role':{'$or':[_0xb04f('0x1b'),'user','agent']}}});})[_0xb04f('0x17')](function(_0x373dd9){_0xe0046c=_0x373dd9;if(_0xe0046c){if(_0xe0046c[_0xb04f('0x1c')]){return _0x3662ef(_0xb04f('0x1d'));}else if(_0x5ce9df['blockDuration']>0x0){if(_0xe0046c[_0xb04f('0x1e')]){if(moment(_0xe0046c[_0xb04f('0x1f')])[_0xb04f('0x20')](_0x5ce9df[_0xb04f('0x16')],_0xb04f('0x21'))>moment()){return _0x3662ef(_0xb04f('0x1d'));}else{return utils[_0xb04f('0x22')](_0xe0046c,0x0,![],null)[_0xb04f('0x17')](function(){return utils['getLicense'](_0xe0046c);})[_0xb04f('0x17')](function(){return _0x3662ef(null,_0xe0046c);});}}else{return utils[_0xb04f('0x23')](_0xe0046c)[_0xb04f('0x17')](function(){return _0x3662ef(null,_0xe0046c);});}}else{return utils[_0xb04f('0x23')](_0xe0046c)['then'](function(){return _0x3662ef(null,_0xe0046c);});}}return _0x3662ef('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})['catch'](function(_0x2ebdc4){_0x3662ef(_0x2ebdc4);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 67fd469..b4c05a9 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 _0x515d=['passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','callback','setTokenCookie','exports'];(function(_0x186648,_0x420365){var _0x102ad3=function(_0x7ba5f6){while(--_0x7ba5f6){_0x186648['push'](_0x186648['shift']());}};_0x102ad3(++_0x420365);}(_0x515d,0x104));var _0xd515=function(_0x4f3de9,_0x1411ab){_0x4f3de9=_0x4f3de9-0x0;var _0x533c9b=_0x515d[_0x4f3de9];return _0x533c9b;};'use strict';var express=require('express');var passport=require(_0xd515('0x0'));var router=express[_0xd515('0x1')]();var controller=require(_0xd515('0x2'));var userController=require(_0xd515('0x3'));var authService=require(_0xd515('0x4'));router[_0xd515('0x5')]('/',controller[_0xd515('0x6')]);router[_0xd515('0x5')]('/callback',controller[_0xd515('0x7')],authService['isMiddleware'],userController['login'],authService[_0xd515('0x8')]);module[_0xd515('0x9')]=router;
\ No newline at end of file
+var _0x0dba=['callback','isMiddleware','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x38af48,_0x400460){var _0x445384=function(_0x464435){while(--_0x464435){_0x38af48['push'](_0x38af48['shift']());}};_0x445384(++_0x400460);}(_0x0dba,0x136));var _0xa0db=function(_0x3d526b,_0x1b6dda){_0x3d526b=_0x3d526b-0x0;var _0x3ed17e=_0x0dba[_0x3d526b];return _0x3ed17e;};'use strict';var express=require(_0xa0db('0x0'));var passport=require(_0xa0db('0x1'));var router=express[_0xa0db('0x2')]();var controller=require(_0xa0db('0x3'));var userController=require(_0xa0db('0x4'));var authService=require(_0xa0db('0x5'));router[_0xa0db('0x6')]('/',controller[_0xa0db('0x7')]);router[_0xa0db('0x6')](_0xa0db('0x8'),controller[_0xa0db('0x9')],authService[_0xa0db('0xa')],userController['login'],authService['setTokenCookie']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 1693574..0f7cc08 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 _0x6d11=['resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','https://','headers','/reset/','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','Password\x20reset!','use','util','passport','passport-local','jayson/promise','randomstring','moment','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.'];(function(_0x5600ba,_0xe51f7c){var _0x2db0f1=function(_0x4a5896){while(--_0x4a5896){_0x5600ba['push'](_0x5600ba['shift']());}};_0x2db0f1(++_0xe51f7c);}(_0x6d11,0xbf));var _0x16d1=function(_0x5ec056,_0x2455c7){_0x5ec056=_0x5ec056-0x0;var _0x440c92=_0x6d11[_0x5ec056];return _0x440c92;};'use strict';var util=require(_0x16d1('0x0'));var passport=require(_0x16d1('0x1'));var LocalStrategy=require(_0x16d1('0x2'))['Strategy'];var jayson=require(_0x16d1('0x3'));var _=require('lodash');var rs=require(_0x16d1('0x4'));var moment=require(_0x16d1('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x16d1('0x6'));var client=jayson[_0x16d1('0x7')][_0x16d1('0x8')]({'port':0x232b});function localAuthenticate(_0x38626d,_0x1009dc,_0x150217,_0x19390d){var _0x5d0e3f,_0x58a7a2;return db['Setting'][_0x16d1('0x9')]({'where':{'id':0x1},'attributes':[_0x16d1('0xa'),_0x16d1('0xb')],'raw':!![]})[_0x16d1('0xc')](function(_0x4b7d4f){_0x5d0e3f=_0x4b7d4f;return _0x38626d[_0x16d1('0x9')]({'attributes':['id',_0x16d1('0xd'),_0x16d1('0xe'),_0x16d1('0xf'),_0x16d1('0x10'),_0x16d1('0x11'),_0x16d1('0x12'),_0x16d1('0x13'),'loginAttempts'],'where':{'name':_0x1009dc,'role':{'$or':[_0x16d1('0x14'),_0x16d1('0x15'),_0x16d1('0x16')]}}});})[_0x16d1('0xc')](function(_0x2efcba){if(!_0x2efcba||_0x2efcba&&_0x2efcba['name']!==_0x1009dc){throw new Error(_0x16d1('0x17'));}else{_0x58a7a2=_0x2efcba;return _0x58a7a2;}})[_0x16d1('0xc')](function(){_0x58a7a2[_0x16d1('0x18')](_0x150217,function(_0x46fcd0,_0x29ebba){var _0x173e16=_0x58a7a2[_0x16d1('0x19')]+0x1;if(_0x46fcd0){return _0x19390d(_0x46fcd0);}else if(!_0x29ebba){if(_0x58a7a2['disabled']){return _0x19390d(null,![],{'message':_0x16d1('0x17')});}else if(_0x5d0e3f[_0x16d1('0xa')]>0x0){if(_0x58a7a2['blocked']){if(_0x5d0e3f['blockDuration']>0x0){if(moment(_0x58a7a2[_0x16d1('0x13')])['add'](_0x5d0e3f[_0x16d1('0xb')],'minutes')>moment()){return _0x19390d(null,![],{'message':_0x16d1('0x17')});}else{return utils['clearBlockUser'](_0x58a7a2,_0x173e16,![],null)[_0x16d1('0xc')](function(){return _0x19390d(null,![],{'message':_0x16d1('0x17')});});}}else{return _0x19390d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x173e16>=_0x5d0e3f['allowedLoginAttempts']){return utils['clearBlockUser'](_0x58a7a2,0x0,!![],moment())['then'](function(){return _0x19390d(null,![],{'message':_0x16d1('0x17')});});}else{return utils['clearBlockUser'](_0x58a7a2,_0x173e16,![],null)[_0x16d1('0xc')](function(){return _0x19390d(null,![],{'message':_0x16d1('0x17')});});}}}else{return _0x19390d(null,![],{'message':_0x16d1('0x17')});}}else{if(_0x58a7a2[_0x16d1('0x11')]){return _0x19390d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x5d0e3f[_0x16d1('0xa')]>0x0){if(_0x58a7a2[_0x16d1('0x12')]){if(_0x5d0e3f[_0x16d1('0xb')]>0x0){if(moment(_0x58a7a2['blockedAt'])[_0x16d1('0x1a')](_0x5d0e3f[_0x16d1('0xb')],_0x16d1('0x1b'))>moment()){return _0x19390d(null,![],{'message':_0x16d1('0x17')});}else{return utils[_0x16d1('0x1c')](_0x58a7a2,0x0,![],null)[_0x16d1('0xc')](function(){return utils[_0x16d1('0x1d')](_0x58a7a2);})[_0x16d1('0xc')](function(){return _0x19390d(null,_0x58a7a2);});}}else{return _0x19390d(null,![],{'message':_0x16d1('0x17')});}}else{return utils[_0x16d1('0x1c')](_0x58a7a2,0x0,![],null)[_0x16d1('0xc')](function(){return utils[_0x16d1('0x1d')](_0x58a7a2);})[_0x16d1('0xc')](function(){return _0x19390d(null,_0x58a7a2);})[_0x16d1('0x1e')](function(_0x346b69){return _0x19390d(null,![],_0x346b69);});}}else{if(_0x58a7a2[_0x16d1('0x12')]){return _0x19390d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x16d1('0x1d')](_0x58a7a2)[_0x16d1('0xc')](function(){return _0x19390d(null,_0x58a7a2);});}}}});})[_0x16d1('0x1e')](function(_0x49fc1b){return _0x19390d(null,![],_0x49fc1b);});}function sendServiceMail(_0x28837c){return db[_0x16d1('0x1f')][_0x16d1('0x20')]({'where':{'service':!![]},'attributes':['id',_0x16d1('0xd'),_0x16d1('0x21')],'include':[{'model':db[_0x16d1('0x22')],'as':_0x16d1('0x23')}]})['then'](function(_0x3dd104){if(!_0x3dd104){throw new Error(_0x16d1('0x24'));}var _0x31c4e9={'tls':{'rejectUnauthorized':![]}};if(_0x3dd104[_0x16d1('0x23')]['service']){_0x31c4e9['service']=_0x3dd104[_0x16d1('0x23')][_0x16d1('0x25')];}else{_0x31c4e9[_0x16d1('0x26')]=_0x3dd104[_0x16d1('0x23')][_0x16d1('0x26')];_0x31c4e9[_0x16d1('0x27')]=_0x3dd104[_0x16d1('0x23')][_0x16d1('0x27')];_0x31c4e9[_0x16d1('0x28')]=_0x3dd104[_0x16d1('0x23')][_0x16d1('0x28')];}if(_0x3dd104[_0x16d1('0x23')][_0x16d1('0x29')]){_0x31c4e9[_0x16d1('0x2a')]={'user':_0x3dd104['Smtp'][_0x16d1('0x15')],'pass':_0x3dd104['Smtp'][_0x16d1('0x2b')]};}var _0xb6397f={'account':_0x31c4e9,'message':_[_0x16d1('0x2c')]({'from':util[_0x16d1('0x2d')](_0x16d1('0x2e'),_0x3dd104[_0x16d1('0xd')],_0x3dd104['email']||_0x3dd104['Smtp']['user'])},_0x28837c)};return client[_0x16d1('0x2f')](_0x16d1('0x30'),_0xb6397f);})[_0x16d1('0xc')](function(_0x5e89c5){if(_0x5e89c5['error']){throw new Error(util[_0x16d1('0x2d')](_0x16d1('0x31'),_0x5e89c5['error']['message']||JSON['stringify'](_0x5e89c5[_0x16d1('0x32')])));}return!![];});}function handleError(_0xb491bd,_0x186bce,_0x5eb26f){return _0xb491bd[_0x16d1('0x33')](_0x186bce||0x1f4)[_0x16d1('0x34')]({'message':_0x5eb26f?_0x5eb26f[_0x16d1('0x35')]||_0x5eb26f:''});}exports[_0x16d1('0x36')]=function(_0x46c6b3,_0x3ec7fd,_0x25e539){passport['authenticate']('local',function(_0x502d9b,_0x22fa2e,_0x2306d3){var _0x24fd60=_0x502d9b||_0x2306d3;if(_0x24fd60){return handleError(_0x3ec7fd,0x191,_0x24fd60);}if(!_0x22fa2e){return handleError(_0x3ec7fd,0x194,{'message':_0x16d1('0x37')});}else{var _0x2e91ea={'payload':{'id':_0x22fa2e['id'],'role':_0x22fa2e[_0x16d1('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x16d1('0x38')](_0x2e91ea)[_0x16d1('0xc')](function(_0x5a14b7){_0x3ec7fd[_0x16d1('0x39')]({'id':_0x22fa2e['id'],'token':_0x5a14b7,'statusCall':'','isAlreadyLogged':_0x22fa2e['online']});});}})(_0x46c6b3,_0x3ec7fd,_0x25e539);};exports['forgot']=function(_0x352c5b,_0x2bec8f,_0x1e54fc){if(!_0x352c5b[_0x16d1('0x3a')][_0x16d1('0x21')]){return handleError(_0x2bec8f,0x1f4,{'message':_0x16d1('0x3b')});}var _0x504145=rs[_0x16d1('0x3c')]();_0x352c5b['body']['email']=_0x352c5b['body']['email'][_0x16d1('0x3d')]()[_0x16d1('0x3e')]();var _0x24038b;return db[_0x16d1('0x3f')]['findOne']({'where':{'id':0x1},'attributes':[_0x16d1('0xa'),'blockDuration'],'raw':!![]})[_0x16d1('0xc')](function(_0xa444ed){_0x24038b=_0xa444ed;return db[_0x16d1('0x40')][_0x16d1('0x20')]({'where':{'email':_0x352c5b[_0x16d1('0x3a')][_0x16d1('0x21')]}});})[_0x16d1('0xc')](function(_0x33f507){if(!_0x33f507){throw new Error(_0x16d1('0x41'));}if(_0x33f507[_0x16d1('0x11')]){throw new Error(_0x16d1('0x42'));}if(_0x33f507[_0x16d1('0x12')]){if(moment(_0x33f507[_0x16d1('0x13')])[_0x16d1('0x1a')](_0x24038b[_0x16d1('0xb')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x33f507[_0x16d1('0x12')]=![];_0x33f507[_0x16d1('0x13')]=null;}}_0x33f507[_0x16d1('0x43')]=_0x504145;_0x33f507[_0x16d1('0x44')]=Date[_0x16d1('0x45')]()+0x36ee80;return _0x33f507[_0x16d1('0x46')]();})['then'](function(){return sendServiceMail({'to':_0x352c5b[_0x16d1('0x3a')][_0x16d1('0x21')],'subject':_0x16d1('0x47'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x16d1('0x48')+_0x352c5b[_0x16d1('0x49')]['host']+_0x16d1('0x4a')+_0x504145+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x16d1('0xc')](function(){_0x2bec8f[_0x16d1('0x33')](0xc8)[_0x16d1('0x34')]({'message':_0x16d1('0x4b')});})['catch'](function(_0x5710c2){return handleError(_0x2bec8f,0x1f4,_0x5710c2);});};exports[_0x16d1('0x4c')]=function(_0x8bb0c1,_0x5ba9ce,_0x2e02df){return db[_0x16d1('0x40')][_0x16d1('0x20')]({'where':{'resetPasswordToken':_0x8bb0c1[_0x16d1('0x4d')][_0x16d1('0x4e')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x16d1('0xc')](function(_0x5cf8f4){if(!_0x5cf8f4){throw new Error(_0x16d1('0x4f'));}return db[_0x16d1('0x3f')]['findOne']({'attributes':['id',_0x16d1('0x50'),_0x16d1('0x51'),_0x16d1('0x52')]})[_0x16d1('0xc')](function(_0x4d4986){if(_0x4d4986['securePassword'])authService['validatePasswordPattern'](_0x8bb0c1[_0x16d1('0x3a')][_0x16d1('0xe')]);if(!_0x4d4986[_0x16d1('0x51')]||!_0x5cf8f4[_0x16d1('0x53')])return _0x5cf8f4;authService['validatePasswordHistory'](_0x8bb0c1[_0x16d1('0x3a')][_0x16d1('0xe')],_0x5cf8f4['previousPasswords'],_0x4d4986[_0x16d1('0x52')]);return _0x5cf8f4;})[_0x16d1('0xc')](function(){_0x5cf8f4[_0x16d1('0xe')]=_0x8bb0c1[_0x16d1('0x3a')]['password'];_0x5cf8f4[_0x16d1('0x43')]=null;_0x5cf8f4[_0x16d1('0x44')]=null;return _0x5cf8f4[_0x16d1('0x46')]();});})['then'](function(){_0x5ba9ce['status'](0xc8)[_0x16d1('0x34')]({'message':_0x16d1('0x54')});})['catch'](function(_0x2417c5){return handleError(_0x5ba9ce,0x1f4,_0x2417c5);});};passport[_0x16d1('0x55')](new LocalStrategy({'usernameField':_0x16d1('0xd'),'passwordField':'password'},function(_0x33c2b4,_0x96bb71,_0x11209f){return localAuthenticate(db[_0x16d1('0x40')],_0x33c2b4,_0x96bb71,_0x11209f);}));
\ No newline at end of file
+var _0x7c09=['findOne','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','minutes','clearBlockUser','add','getLicense','catch','MailAccount','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','User','find','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','Reset\x20Email\x20sent!','reset','params','token','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','Password\x20reset!','use','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils'];(function(_0x196c01,_0x978ece){var _0x478319=function(_0x1e50a2){while(--_0x1e50a2){_0x196c01['push'](_0x196c01['shift']());}};_0x478319(++_0x978ece);}(_0x7c09,0x102));var _0x97c0=function(_0x16014f,_0x4f5bc7){_0x16014f=_0x16014f-0x0;var _0x308d18=_0x7c09[_0x16014f];return _0x308d18;};'use strict';var util=require('util');var passport=require(_0x97c0('0x0'));var LocalStrategy=require(_0x97c0('0x1'))['Strategy'];var jayson=require(_0x97c0('0x2'));var _=require(_0x97c0('0x3'));var rs=require(_0x97c0('0x4'));var moment=require(_0x97c0('0x5'));var db=require(_0x97c0('0x6'))['db'];var authService=require(_0x97c0('0x7'));var utils=require(_0x97c0('0x8'));var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x590368,_0x46fdd9,_0x42c6c7,_0x2c19fa){var _0x109bc8,_0x293785;return db['Setting'][_0x97c0('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x97c0('0xa')],'raw':!![]})[_0x97c0('0xb')](function(_0x52bce2){_0x109bc8=_0x52bce2;return _0x590368['findOne']({'attributes':['id',_0x97c0('0xc'),_0x97c0('0xd'),_0x97c0('0xe'),_0x97c0('0xf'),_0x97c0('0x10'),_0x97c0('0x11'),_0x97c0('0x12'),_0x97c0('0x13')],'where':{'name':_0x46fdd9,'role':{'$or':[_0x97c0('0x14'),_0x97c0('0x15'),_0x97c0('0x16')]}}});})[_0x97c0('0xb')](function(_0x20acfa){if(!_0x20acfa||_0x20acfa&&_0x20acfa['name']!==_0x46fdd9){throw new Error(_0x97c0('0x17'));}else{_0x293785=_0x20acfa;return _0x293785;}})[_0x97c0('0xb')](function(){_0x293785[_0x97c0('0x18')](_0x42c6c7,function(_0x496017,_0x42027d){var _0x9ca6a8=_0x293785[_0x97c0('0x13')]+0x1;if(_0x496017){return _0x2c19fa(_0x496017);}else if(!_0x42027d){if(_0x293785[_0x97c0('0x10')]){return _0x2c19fa(null,![],{'message':_0x97c0('0x17')});}else if(_0x109bc8[_0x97c0('0x19')]>0x0){if(_0x293785['blocked']){if(_0x109bc8[_0x97c0('0xa')]>0x0){if(moment(_0x293785[_0x97c0('0x12')])['add'](_0x109bc8[_0x97c0('0xa')],_0x97c0('0x1a'))>moment()){return _0x2c19fa(null,![],{'message':_0x97c0('0x17')});}else{return utils[_0x97c0('0x1b')](_0x293785,_0x9ca6a8,![],null)[_0x97c0('0xb')](function(){return _0x2c19fa(null,![],{'message':_0x97c0('0x17')});});}}else{return _0x2c19fa(null,![],{'message':_0x97c0('0x17')});}}else{if(_0x9ca6a8>=_0x109bc8[_0x97c0('0x19')]){return utils[_0x97c0('0x1b')](_0x293785,0x0,!![],moment())[_0x97c0('0xb')](function(){return _0x2c19fa(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x293785,_0x9ca6a8,![],null)[_0x97c0('0xb')](function(){return _0x2c19fa(null,![],{'message':_0x97c0('0x17')});});}}}else{return _0x2c19fa(null,![],{'message':_0x97c0('0x17')});}}else{if(_0x293785['disabled']){return _0x2c19fa(null,![],{'message':_0x97c0('0x17')});}else if(_0x109bc8[_0x97c0('0x19')]>0x0){if(_0x293785[_0x97c0('0x11')]){if(_0x109bc8[_0x97c0('0xa')]>0x0){if(moment(_0x293785[_0x97c0('0x12')])[_0x97c0('0x1c')](_0x109bc8[_0x97c0('0xa')],'minutes')>moment()){return _0x2c19fa(null,![],{'message':_0x97c0('0x17')});}else{return utils[_0x97c0('0x1b')](_0x293785,0x0,![],null)[_0x97c0('0xb')](function(){return utils[_0x97c0('0x1d')](_0x293785);})['then'](function(){return _0x2c19fa(null,_0x293785);});}}else{return _0x2c19fa(null,![],{'message':_0x97c0('0x17')});}}else{return utils[_0x97c0('0x1b')](_0x293785,0x0,![],null)['then'](function(){return utils[_0x97c0('0x1d')](_0x293785);})[_0x97c0('0xb')](function(){return _0x2c19fa(null,_0x293785);})[_0x97c0('0x1e')](function(_0x4af5a5){return _0x2c19fa(null,![],_0x4af5a5);});}}else{if(_0x293785['blocked']){return _0x2c19fa(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x97c0('0x1d')](_0x293785)[_0x97c0('0xb')](function(){return _0x2c19fa(null,_0x293785);});}}}});})[_0x97c0('0x1e')](function(_0x225e43){return _0x2c19fa(null,![],_0x225e43);});}function sendServiceMail(_0x26939e){return db[_0x97c0('0x1f')]['find']({'where':{'service':!![]},'attributes':['id',_0x97c0('0xc'),_0x97c0('0x20')],'include':[{'model':db[_0x97c0('0x21')],'as':'Smtp'}]})[_0x97c0('0xb')](function(_0x148e95){if(!_0x148e95){throw new Error(_0x97c0('0x22'));}var _0x23d2af={'tls':{'rejectUnauthorized':![]}};if(_0x148e95[_0x97c0('0x23')]['service']){_0x23d2af['service']=_0x148e95[_0x97c0('0x23')][_0x97c0('0x24')];}else{_0x23d2af[_0x97c0('0x25')]=_0x148e95['Smtp'][_0x97c0('0x25')];_0x23d2af[_0x97c0('0x26')]=_0x148e95['Smtp'][_0x97c0('0x26')];_0x23d2af[_0x97c0('0x27')]=_0x148e95[_0x97c0('0x23')][_0x97c0('0x27')];}if(_0x148e95[_0x97c0('0x23')][_0x97c0('0x28')]){_0x23d2af[_0x97c0('0x29')]={'user':_0x148e95[_0x97c0('0x23')][_0x97c0('0x15')],'pass':_0x148e95[_0x97c0('0x23')][_0x97c0('0x2a')]};}var _0x356b73={'account':_0x23d2af,'message':_[_0x97c0('0x2b')]({'from':util[_0x97c0('0x2c')](_0x97c0('0x2d'),_0x148e95['name'],_0x148e95[_0x97c0('0x20')]||_0x148e95[_0x97c0('0x23')][_0x97c0('0x15')])},_0x26939e)};return client[_0x97c0('0x2e')](_0x97c0('0x2f'),_0x356b73);})[_0x97c0('0xb')](function(_0x40a780){if(_0x40a780[_0x97c0('0x30')]){throw new Error(util['format'](_0x97c0('0x31'),_0x40a780['error'][_0x97c0('0x32')]||JSON[_0x97c0('0x33')](_0x40a780[_0x97c0('0x30')])));}return!![];});}function handleError(_0x3988d3,_0x41e360,_0x2a613a){return _0x3988d3[_0x97c0('0x34')](_0x41e360||0x1f4)[_0x97c0('0x35')]({'message':_0x2a613a?_0x2a613a[_0x97c0('0x32')]||_0x2a613a:''});}exports[_0x97c0('0x36')]=function(_0x3f202d,_0x4a1dad,_0x3368d0){passport[_0x97c0('0x18')]('local',function(_0x137ee1,_0x477aae,_0x2aeffc){var _0x44dbe6=_0x137ee1||_0x2aeffc;if(_0x44dbe6){return handleError(_0x4a1dad,0x191,_0x44dbe6);}if(!_0x477aae){return handleError(_0x4a1dad,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x860e0c={'payload':{'id':_0x477aae['id'],'role':_0x477aae['role']},'options':{'expiresIn':0x15180}};return authService[_0x97c0('0x37')](_0x860e0c)[_0x97c0('0xb')](function(_0x5660b3){_0x4a1dad[_0x97c0('0x38')]({'id':_0x477aae['id'],'token':_0x5660b3,'statusCall':'','isAlreadyLogged':_0x477aae[_0x97c0('0x39')]});});}})(_0x3f202d,_0x4a1dad,_0x3368d0);};exports[_0x97c0('0x3a')]=function(_0xb13649,_0x33b034,_0x2121e8){if(!_0xb13649[_0x97c0('0x3b')][_0x97c0('0x20')]){return handleError(_0x33b034,0x1f4,{'message':_0x97c0('0x3c')});}var _0x2d4c25=rs[_0x97c0('0x3d')]();_0xb13649[_0x97c0('0x3b')][_0x97c0('0x20')]=_0xb13649['body'][_0x97c0('0x20')][_0x97c0('0x3e')]()[_0x97c0('0x3f')]();var _0x142421;return db[_0x97c0('0x40')][_0x97c0('0x9')]({'where':{'id':0x1},'attributes':[_0x97c0('0x19'),'blockDuration'],'raw':!![]})['then'](function(_0x10ee7b){_0x142421=_0x10ee7b;return db[_0x97c0('0x41')][_0x97c0('0x42')]({'where':{'email':_0xb13649[_0x97c0('0x3b')][_0x97c0('0x20')]}});})['then'](function(_0x5bcdc9){if(!_0x5bcdc9){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x5bcdc9[_0x97c0('0x10')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x5bcdc9['blocked']){if(moment(_0x5bcdc9[_0x97c0('0x12')])[_0x97c0('0x1c')](_0x142421[_0x97c0('0xa')],_0x97c0('0x1a'))>moment()){throw new Error(_0x97c0('0x43'));}else{_0x5bcdc9['blocked']=![];_0x5bcdc9[_0x97c0('0x12')]=null;}}_0x5bcdc9[_0x97c0('0x44')]=_0x2d4c25;_0x5bcdc9[_0x97c0('0x45')]=Date[_0x97c0('0x46')]()+0x36ee80;return _0x5bcdc9[_0x97c0('0x47')]();})[_0x97c0('0xb')](function(){return sendServiceMail({'to':_0xb13649[_0x97c0('0x3b')][_0x97c0('0x20')],'subject':_0x97c0('0x48'),'text':_0x97c0('0x49')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x97c0('0x4a')+_0xb13649[_0x97c0('0x4b')][_0x97c0('0x25')]+_0x97c0('0x4c')+_0x2d4c25+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0x33b034[_0x97c0('0x34')](0xc8)[_0x97c0('0x35')]({'message':_0x97c0('0x4d')});})['catch'](function(_0x3e09d5){return handleError(_0x33b034,0x1f4,_0x3e09d5);});};exports[_0x97c0('0x4e')]=function(_0x240f68,_0x2fc02f,_0x122524){return db['User'][_0x97c0('0x42')]({'where':{'resetPasswordToken':_0x240f68[_0x97c0('0x4f')][_0x97c0('0x50')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x94ce89){if(!_0x94ce89){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x97c0('0x9')]({'attributes':['id',_0x97c0('0x51'),_0x97c0('0x52'),'passwordHistoryLimit']})['then'](function(_0x5190b0){if(_0x5190b0[_0x97c0('0x51')])authService[_0x97c0('0x53')](_0x240f68[_0x97c0('0x3b')][_0x97c0('0xd')]);if(!_0x5190b0[_0x97c0('0x52')]||!_0x94ce89[_0x97c0('0x54')])return _0x94ce89;authService[_0x97c0('0x55')](_0x240f68['body'][_0x97c0('0xd')],_0x94ce89[_0x97c0('0x54')],_0x5190b0[_0x97c0('0x56')]);return _0x94ce89;})[_0x97c0('0xb')](function(){_0x94ce89[_0x97c0('0xd')]=_0x240f68[_0x97c0('0x3b')]['password'];_0x94ce89[_0x97c0('0x44')]=null;_0x94ce89[_0x97c0('0x45')]=null;return _0x94ce89['save']();});})[_0x97c0('0xb')](function(){_0x2fc02f[_0x97c0('0x34')](0xc8)[_0x97c0('0x35')]({'message':_0x97c0('0x57')});})[_0x97c0('0x1e')](function(_0x18992d){return handleError(_0x2fc02f,0x1f4,_0x18992d);});};passport[_0x97c0('0x58')](new LocalStrategy({'usernameField':'name','passwordField':_0x97c0('0xd')},function(_0x14e93c,_0x3cb4c7,_0x1919f5){return localAuthenticate(db[_0x97c0('0x41')],_0x14e93c,_0x3cb4c7,_0x1919f5);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 226ad11..78493d2 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 _0x04d0=['express','Router','post','/forgot','/reset/:token','reset'];(function(_0x1bc5d3,_0x57e93a){var _0xb6cad=function(_0xd1608c){while(--_0xd1608c){_0x1bc5d3['push'](_0x1bc5d3['shift']());}};_0xb6cad(++_0x57e93a);}(_0x04d0,0x1bc));var _0x004d=function(_0x314c5a,_0xd99ef0){_0x314c5a=_0x314c5a-0x0;var _0x1e419a=_0x04d0[_0x314c5a];return _0x1e419a;};'use strict';var express=require(_0x004d('0x0'));var router=express[_0x004d('0x1')]();var controller=require('./authLocal.controller');router[_0x004d('0x2')]('/',controller['login']);router['post'](_0x004d('0x3'),controller['forgot']);router[_0x004d('0x2')](_0x004d('0x4'),controller[_0x004d('0x5')]);module['exports']=router;
\ No newline at end of file
+var _0x6a8a=['/reset/:token','reset','express','Router','post','login','/forgot'];(function(_0x40fcda,_0x2e8598){var _0x38e739=function(_0x16d71a){while(--_0x16d71a){_0x40fcda['push'](_0x40fcda['shift']());}};_0x38e739(++_0x2e8598);}(_0x6a8a,0x72));var _0xa6a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a8a[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xa6a8('0x0'));var router=express[_0xa6a8('0x1')]();var controller=require('./authLocal.controller');router[_0xa6a8('0x2')]('/',controller[_0xa6a8('0x3')]);router[_0xa6a8('0x2')](_0xa6a8('0x4'),controller['forgot']);router[_0xa6a8('0x2')](_0xa6a8('0x5'),controller[_0xa6a8('0x6')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 24ada38..e505aae 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 _0x540a=['sequelize','STRING'];(function(_0x483d15,_0x195c60){var _0xf80886=function(_0x21be2d){while(--_0x21be2d){_0x483d15['push'](_0x483d15['shift']());}};_0xf80886(++_0x195c60);}(_0x540a,0x1de));var _0xa540=function(_0x1021e0,_0x352cb4){_0x1021e0=_0x1021e0-0x0;var _0x4d5cbf=_0x540a[_0x1021e0];return _0x4d5cbf;};'use strict';var Sequelize=require(_0xa540('0x0'));module['exports']={'name':{'type':Sequelize[_0xa540('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x222c=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x1f3fd8,_0x330562){var _0x2d9d33=function(_0x34061f){while(--_0x34061f){_0x1f3fd8['push'](_0x1f3fd8['shift']());}};_0x2d9d33(++_0x330562);}(_0x222c,0x1d6));var _0xc222=function(_0x1666c7,_0x54bb9a){_0x1666c7=_0x1666c7-0x0;var _0x341d90=_0x222c[_0x1666c7];return _0x341d90;};'use strict';var Sequelize=require(_0xc222('0x0'));module[_0xc222('0x1')]={'name':{'type':Sequelize[_0xc222('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xc222('0x2')]},'description':{'type':Sequelize[_0xc222('0x2')]},'status':{'type':Sequelize[_0xc222('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xc222('0x4')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 9232e00..10b3a87 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 _0x93cc=['desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','count','offset','limit','set','apply','reject','save','then','destroy','stack','send','map','Automation','key','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','options','find','create','body','update','addConditions','Condition','ids','getConditions','findOne','order','pick','addActions','Action','omit','getActions','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x23dada,_0xa5aeb2){var _0x21afb4=function(_0x48e573){while(--_0x48e573){_0x23dada['push'](_0x23dada['shift']());}};_0x21afb4(++_0xa5aeb2);}(_0x93cc,0x90));var _0xc93c=function(_0x59b387,_0x4b6849){_0x59b387=_0x59b387-0x0;var _0x5d7377=_0x93cc[_0x59b387];return _0x5d7377;};'use strict';var pdf=require(_0xc93c('0x0'));var emlformat=require(_0xc93c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc93c('0x2'));var rp=require(_0xc93c('0x3'));var moment=require(_0xc93c('0x4'));var BPromise=require(_0xc93c('0x5'));var Mustache=require(_0xc93c('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc93c('0x7'));var ejs=require(_0xc93c('0x8'));var fs=require('fs');var fs_extra=require(_0xc93c('0x9'));var _=require(_0xc93c('0xa'));var squel=require(_0xc93c('0xb'));var crypto=require(_0xc93c('0xc'));var jsforce=require(_0xc93c('0xd'));var deskjs=require(_0xc93c('0xe'));var toCsv=require(_0xc93c('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc93c('0xf'));var authService=require(_0xc93c('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc93c('0x11'));var logger=require(_0xc93c('0x12'))(_0xc93c('0x13'));var utils=require(_0xc93c('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc93c('0x15'))['db'];function respondWithStatusCode(_0x3aba6a,_0x35cb57){_0x35cb57=_0x35cb57||0xcc;return function(_0x57e580){if(_0x57e580){return _0x3aba6a[_0xc93c('0x16')](_0x35cb57);}return _0x3aba6a['status'](_0x35cb57)[_0xc93c('0x17')]();};}function respondWithResult(_0x5c92bc,_0x1daca0){_0x1daca0=_0x1daca0||0xc8;return function(_0xc6280c){if(_0xc6280c){return _0x5c92bc[_0xc93c('0x18')](_0x1daca0)['json'](_0xc6280c);}};}function respondWithFilteredResult(_0x3d7475,_0x327fbd){return function(_0x273c04){if(_0x273c04){var _0x390cf4=_0x273c04[_0xc93c('0x19')],_0x2ff1cf=_0x327fbd[_0xc93c('0x1a')],_0x4403d5=_0x327fbd[_0xc93c('0x1a')]+_0x327fbd[_0xc93c('0x1b')],_0x1b638d;if(_0x4403d5>=_0x390cf4){_0x4403d5=_0x390cf4;_0x1b638d=0xc8;}else{_0x1b638d=0xce;}_0x3d7475[_0xc93c('0x18')](_0x1b638d);return _0x3d7475[_0xc93c('0x1c')]('Content-Range',_0x2ff1cf+'-'+_0x4403d5+'/'+_0x390cf4)['json'](_0x273c04);}return null;};}function patchUpdates(_0x548dff){return function(_0x480c18){try{jsonpatch[_0xc93c('0x1d')](_0x480c18,_0x548dff,!![]);}catch(_0x3e28f7){return BPromise[_0xc93c('0x1e')](_0x3e28f7);}return _0x480c18[_0xc93c('0x1f')]();};}function saveUpdates(_0x55e9f0,_0x212e23){return function(_0x1f735a){if(_0x1f735a){return _0x1f735a['update'](_0x55e9f0)[_0xc93c('0x20')](function(_0x4141c1){return _0x4141c1;});}return null;};}function removeEntity(_0x353014,_0x50cf20){return function(_0x20639c){if(_0x20639c){return _0x20639c[_0xc93c('0x21')]()[_0xc93c('0x20')](function(){_0x353014[_0xc93c('0x18')](0xcc)[_0xc93c('0x17')]();});}};}function handleEntityNotFound(_0x578062,_0x1a0be0){return function(_0x33dca5){if(!_0x33dca5){_0x578062['sendStatus'](0x194);}return _0x33dca5;};}function handleError(_0x1f3abb,_0x4977a1){_0x4977a1=_0x4977a1||0x1f4;return function(_0xcef30c){logger['error'](_0xcef30c[_0xc93c('0x22')]);if(_0xcef30c['name']){delete _0xcef30c['name'];}_0x1f3abb[_0xc93c('0x18')](_0x4977a1)[_0xc93c('0x23')](_0xcef30c);};}exports['index']=function(_0x54d583,_0x21d42a){var _0x3a18b4={},_0x1563af={},_0x7e1995={'count':0x0,'rows':[]};var _0x2a9387=_[_0xc93c('0x24')](db[_0xc93c('0x25')]['rawAttributes'],function(_0x459bc6){return{'name':_0x459bc6['fieldName'],'type':_0x459bc6['type'][_0xc93c('0x26')]};});_0x1563af[_0xc93c('0x27')]=_[_0xc93c('0x24')](_0x2a9387,_0xc93c('0x28'));_0x1563af[_0xc93c('0x29')]=_['keys'](_0x54d583['query']);_0x1563af[_0xc93c('0x2a')]=_['intersection'](_0x1563af[_0xc93c('0x27')],_0x1563af[_0xc93c('0x29')]);_0x3a18b4['attributes']=_[_0xc93c('0x2b')](_0x1563af[_0xc93c('0x27')],qs[_0xc93c('0x2c')](_0x54d583[_0xc93c('0x29')][_0xc93c('0x2c')]));_0x3a18b4[_0xc93c('0x2d')]=_0x3a18b4[_0xc93c('0x2d')][_0xc93c('0x2e')]?_0x3a18b4[_0xc93c('0x2d')]:_0x1563af[_0xc93c('0x27')];if(!_0x54d583['query'][_0xc93c('0x2f')](_0xc93c('0x30'))){_0x3a18b4[_0xc93c('0x1b')]=qs[_0xc93c('0x1b')](_0x54d583[_0xc93c('0x29')]['limit']);_0x3a18b4['offset']=qs[_0xc93c('0x1a')](_0x54d583[_0xc93c('0x29')][_0xc93c('0x1a')]);}_0x3a18b4['order']=qs[_0xc93c('0x31')](_0x54d583['query'][_0xc93c('0x31')]);_0x3a18b4['where']=qs[_0xc93c('0x2a')](_['pick'](_0x54d583['query'],_0x1563af[_0xc93c('0x2a')]),_0x2a9387);if(_0x54d583['query'][_0xc93c('0x32')]){_0x3a18b4[_0xc93c('0x33')]=_[_0xc93c('0x34')](_0x3a18b4[_0xc93c('0x33')],{'$or':_[_0xc93c('0x24')](_0x2a9387,function(_0x26f2d4){if(_0x26f2d4['type']!==_0xc93c('0x35')){var _0x466dec={};_0x466dec[_0x26f2d4['name']]={'$like':'%'+_0x54d583[_0xc93c('0x29')]['filter']+'%'};return _0x466dec;}})});}_0x3a18b4=_[_0xc93c('0x34')]({},_0x3a18b4,_0x54d583['options']);var _0x18e633={'where':_0x3a18b4['where']};return db['Automation'][_0xc93c('0x19')](_0x18e633)[_0xc93c('0x20')](function(_0x20e0d0){_0x7e1995[_0xc93c('0x19')]=_0x20e0d0;if(_0x54d583[_0xc93c('0x29')][_0xc93c('0x36')]){_0x3a18b4[_0xc93c('0x37')]=[{'all':!![]}];}return db[_0xc93c('0x25')][_0xc93c('0x38')](_0x3a18b4);})[_0xc93c('0x20')](function(_0x4887b3){_0x7e1995[_0xc93c('0x39')]=_0x4887b3;return _0x7e1995;})[_0xc93c('0x20')](respondWithFilteredResult(_0x21d42a,_0x3a18b4))[_0xc93c('0x3a')](handleError(_0x21d42a,null));};exports[_0xc93c('0x3b')]=function(_0x485a9,_0x49a13b){var _0x231ac5={'raw':![],'where':{'id':_0x485a9[_0xc93c('0x3c')]['id']}},_0x5751c4={};_0x5751c4[_0xc93c('0x27')]=_['keys'](db[_0xc93c('0x25')][_0xc93c('0x3d')]);_0x5751c4[_0xc93c('0x29')]=_[_0xc93c('0x3e')](_0x485a9[_0xc93c('0x29')]);_0x5751c4[_0xc93c('0x2a')]=_[_0xc93c('0x2b')](_0x5751c4[_0xc93c('0x27')],_0x5751c4[_0xc93c('0x29')]);_0x231ac5[_0xc93c('0x2d')]=_[_0xc93c('0x2b')](_0x5751c4[_0xc93c('0x27')],qs[_0xc93c('0x2c')](_0x485a9[_0xc93c('0x29')]['fields']));_0x231ac5[_0xc93c('0x2d')]=_0x231ac5[_0xc93c('0x2d')][_0xc93c('0x2e')]?_0x231ac5[_0xc93c('0x2d')]:_0x5751c4[_0xc93c('0x27')];if(_0x485a9[_0xc93c('0x29')][_0xc93c('0x36')]){_0x231ac5[_0xc93c('0x37')]=[{'all':!![]}];}_0x231ac5=_['merge']({},_0x231ac5,_0x485a9[_0xc93c('0x3f')]);return db[_0xc93c('0x25')][_0xc93c('0x40')](_0x231ac5)[_0xc93c('0x20')](handleEntityNotFound(_0x49a13b,null))['then'](respondWithResult(_0x49a13b,null))[_0xc93c('0x3a')](handleError(_0x49a13b,null));};exports[_0xc93c('0x41')]=function(_0x25f462,_0x22ba31){return db[_0xc93c('0x25')][_0xc93c('0x41')](_0x25f462[_0xc93c('0x42')],{})[_0xc93c('0x20')](respondWithResult(_0x22ba31,0xc9))['catch'](handleError(_0x22ba31,null));};exports[_0xc93c('0x43')]=function(_0x55e868,_0x5d2b5b){if(_0x55e868[_0xc93c('0x42')]['id']){delete _0x55e868['body']['id'];}return db[_0xc93c('0x25')][_0xc93c('0x40')]({'where':{'id':_0x55e868[_0xc93c('0x3c')]['id']}})[_0xc93c('0x20')](handleEntityNotFound(_0x5d2b5b,null))[_0xc93c('0x20')](saveUpdates(_0x55e868[_0xc93c('0x42')],null))[_0xc93c('0x20')](respondWithResult(_0x5d2b5b,null))[_0xc93c('0x3a')](handleError(_0x5d2b5b,null));};exports[_0xc93c('0x21')]=function(_0x1cd1f2,_0x4cc135){return db['Automation'][_0xc93c('0x40')]({'where':{'id':_0x1cd1f2['params']['id']}})[_0xc93c('0x20')](handleEntityNotFound(_0x4cc135,null))[_0xc93c('0x20')](removeEntity(_0x4cc135,null))[_0xc93c('0x3a')](handleError(_0x4cc135,null));};exports[_0xc93c('0x44')]=function(_0x1dd1ce,_0x4fa5ba,_0xc847d3){return db[_0xc93c('0x45')][_0xc93c('0x40')]({'where':{'id':_0x1dd1ce['params']['id']}})[_0xc93c('0x20')](handleEntityNotFound(_0x4fa5ba,null))[_0xc93c('0x20')](function(_0x294dd2){if(_0x294dd2){return _0x294dd2[_0xc93c('0x44')](_0x1dd1ce[_0xc93c('0x42')][_0xc93c('0x46')],_['omit'](_0x1dd1ce[_0xc93c('0x42')],[_0xc93c('0x46'),'id'])||{});}})[_0xc93c('0x20')](respondWithResult(_0x4fa5ba,null))['catch'](handleError(_0x4fa5ba,null));};exports[_0xc93c('0x47')]=function(_0x2e10a3,_0x1928ae,_0x2d4771){var _0x332159={};var _0x39e4a1={};var _0x386f4e;var _0x39d590;return db[_0xc93c('0x25')][_0xc93c('0x48')]({'where':{'id':_0x2e10a3[_0xc93c('0x3c')]['id']}})[_0xc93c('0x20')](handleEntityNotFound(_0x1928ae,null))['then'](function(_0x12b376){if(_0x12b376){_0x386f4e=_0x12b376;_0x39e4a1[_0xc93c('0x27')]=_[_0xc93c('0x3e')](db['Condition'][_0xc93c('0x3d')]);_0x39e4a1[_0xc93c('0x29')]=_[_0xc93c('0x3e')](_0x2e10a3[_0xc93c('0x29')]);_0x39e4a1[_0xc93c('0x2a')]=_[_0xc93c('0x2b')](_0x39e4a1[_0xc93c('0x27')],_0x39e4a1[_0xc93c('0x29')]);_0x332159[_0xc93c('0x2d')]=_[_0xc93c('0x2b')](_0x39e4a1[_0xc93c('0x27')],qs[_0xc93c('0x2c')](_0x2e10a3[_0xc93c('0x29')][_0xc93c('0x2c')]));_0x332159['attributes']=_0x332159[_0xc93c('0x2d')]['length']?_0x332159[_0xc93c('0x2d')]:_0x39e4a1[_0xc93c('0x27')];_0x332159[_0xc93c('0x49')]=qs[_0xc93c('0x31')](_0x2e10a3[_0xc93c('0x29')][_0xc93c('0x31')]);_0x332159['where']=qs[_0xc93c('0x2a')](_[_0xc93c('0x4a')](_0x2e10a3[_0xc93c('0x29')],_0x39e4a1['filters']));if(_0x2e10a3['query'][_0xc93c('0x32')]){_0x332159[_0xc93c('0x33')]=_[_0xc93c('0x34')](_0x332159[_0xc93c('0x33')],{'$or':_[_0xc93c('0x24')](_0x332159[_0xc93c('0x2d')],function(_0x3396fc){var _0x58615b={};_0x58615b[_0x3396fc]={'$like':'%'+_0x2e10a3[_0xc93c('0x29')][_0xc93c('0x32')]+'%'};return _0x58615b;})});}_0x332159=_['merge']({},_0x332159,_0x2e10a3['options']);return _0x386f4e[_0xc93c('0x47')](_0x332159);}})[_0xc93c('0x20')](function(_0x2a5995){if(_0x2a5995){_0x39d590=_0x2a5995[_0xc93c('0x2e')];if(!_0x2e10a3[_0xc93c('0x29')][_0xc93c('0x2f')]('nolimit')){_0x332159[_0xc93c('0x1b')]=qs[_0xc93c('0x1b')](_0x2e10a3[_0xc93c('0x29')][_0xc93c('0x1b')]);_0x332159[_0xc93c('0x1a')]=qs[_0xc93c('0x1a')](_0x2e10a3[_0xc93c('0x29')]['offset']);}return _0x386f4e[_0xc93c('0x47')](_0x332159);}})['then'](function(_0x33f776){if(_0x33f776){return _0x33f776?{'count':_0x39d590,'rows':_0x33f776}:null;}})[_0xc93c('0x20')](respondWithResult(_0x1928ae,null))[_0xc93c('0x3a')](handleError(_0x1928ae,null));};exports[_0xc93c('0x4b')]=function(_0x398fc3,_0x5819bd,_0x28234f){return db[_0xc93c('0x4c')][_0xc93c('0x40')]({'where':{'id':_0x398fc3[_0xc93c('0x3c')]['id']}})['then'](handleEntityNotFound(_0x5819bd,null))[_0xc93c('0x20')](function(_0x3c1d67){if(_0x3c1d67){return _0x3c1d67[_0xc93c('0x4b')](_0x398fc3[_0xc93c('0x42')]['ids'],_[_0xc93c('0x4d')](_0x398fc3[_0xc93c('0x42')],[_0xc93c('0x46'),'id'])||{});}})[_0xc93c('0x20')](respondWithResult(_0x5819bd,null))[_0xc93c('0x3a')](handleError(_0x5819bd,null));};exports[_0xc93c('0x4e')]=function(_0x2d180f,_0x500196,_0x328d91){var _0x581a4f={};var _0x75bf19={};var _0xdcdb7c;var _0x2858f2;return db['Automation'][_0xc93c('0x48')]({'where':{'id':_0x2d180f['params']['id']}})['then'](handleEntityNotFound(_0x500196,null))[_0xc93c('0x20')](function(_0x1bbba9){if(_0x1bbba9){_0xdcdb7c=_0x1bbba9;_0x75bf19['model']=_[_0xc93c('0x3e')](db[_0xc93c('0x4c')][_0xc93c('0x3d')]);_0x75bf19[_0xc93c('0x29')]=_[_0xc93c('0x3e')](_0x2d180f['query']);_0x75bf19[_0xc93c('0x2a')]=_[_0xc93c('0x2b')](_0x75bf19[_0xc93c('0x27')],_0x75bf19[_0xc93c('0x29')]);_0x581a4f[_0xc93c('0x2d')]=_[_0xc93c('0x2b')](_0x75bf19[_0xc93c('0x27')],qs[_0xc93c('0x2c')](_0x2d180f['query']['fields']));_0x581a4f['attributes']=_0x581a4f[_0xc93c('0x2d')]['length']?_0x581a4f['attributes']:_0x75bf19[_0xc93c('0x27')];_0x581a4f[_0xc93c('0x49')]=qs['sort'](_0x2d180f[_0xc93c('0x29')][_0xc93c('0x31')]);_0x581a4f[_0xc93c('0x33')]=qs[_0xc93c('0x2a')](_[_0xc93c('0x4a')](_0x2d180f[_0xc93c('0x29')],_0x75bf19[_0xc93c('0x2a')]));if(_0x2d180f[_0xc93c('0x29')][_0xc93c('0x32')]){_0x581a4f['where']=_[_0xc93c('0x34')](_0x581a4f['where'],{'$or':_[_0xc93c('0x24')](_0x581a4f[_0xc93c('0x2d')],function(_0x2bb2e2){var _0x2be243={};_0x2be243[_0x2bb2e2]={'$like':'%'+_0x2d180f[_0xc93c('0x29')][_0xc93c('0x32')]+'%'};return _0x2be243;})});}_0x581a4f=_[_0xc93c('0x34')]({},_0x581a4f,_0x2d180f[_0xc93c('0x3f')]);return _0xdcdb7c[_0xc93c('0x4e')](_0x581a4f);}})['then'](function(_0x297343){if(_0x297343){_0x2858f2=_0x297343[_0xc93c('0x2e')];if(!_0x2d180f[_0xc93c('0x29')][_0xc93c('0x2f')](_0xc93c('0x30'))){_0x581a4f['limit']=qs[_0xc93c('0x1b')](_0x2d180f[_0xc93c('0x29')]['limit']);_0x581a4f['offset']=qs[_0xc93c('0x1a')](_0x2d180f[_0xc93c('0x29')][_0xc93c('0x1a')]);}return _0xdcdb7c[_0xc93c('0x4e')](_0x581a4f);}})[_0xc93c('0x20')](function(_0x32f4e3){if(_0x32f4e3){return _0x32f4e3?{'count':_0x2858f2,'rows':_0x32f4e3}:null;}})[_0xc93c('0x20')](respondWithResult(_0x500196,null))[_0xc93c('0x3a')](handleError(_0x500196,null));};
\ No newline at end of file
+var _0x6afd=['Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','VIRTUAL','options','include','findAll','catch','show','params','includeAll','merge','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','order','addActions','Action','getActions','eml-format','rimraf','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset'];(function(_0x464f98,_0x3d69cb){var _0x4604cd=function(_0x392a79){while(--_0x392a79){_0x464f98['push'](_0x464f98['shift']());}};_0x4604cd(++_0x3d69cb);}(_0x6afd,0xe3));var _0xd6af=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x6afd[_0x30ae5e];return _0x1f2e93;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd6af('0x0'));var rimraf=require(_0xd6af('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd6af('0x2'));var moment=require(_0xd6af('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd6af('0x4'));var path=require(_0xd6af('0x5'));var sox=require(_0xd6af('0x6'));var csv=require(_0xd6af('0x7'));var ejs=require(_0xd6af('0x8'));var fs=require('fs');var fs_extra=require(_0xd6af('0x9'));var _=require('lodash');var squel=require(_0xd6af('0xa'));var crypto=require(_0xd6af('0xb'));var jsforce=require(_0xd6af('0xc'));var deskjs=require(_0xd6af('0xd'));var toCsv=require(_0xd6af('0x7'));var querystring=require(_0xd6af('0xe'));var Papa=require(_0xd6af('0xf'));var Redis=require(_0xd6af('0x10'));var authService=require(_0xd6af('0x11'));var qs=require(_0xd6af('0x12'));var as=require(_0xd6af('0x13'));var hardwareService=require(_0xd6af('0x14'));var logger=require(_0xd6af('0x15'))(_0xd6af('0x16'));var utils=require(_0xd6af('0x17'));var config=require(_0xd6af('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd6af('0x19'))['db'];function respondWithStatusCode(_0x5579e6,_0x8d9ec){_0x8d9ec=_0x8d9ec||0xcc;return function(_0x50f3e9){if(_0x50f3e9){return _0x5579e6['sendStatus'](_0x8d9ec);}return _0x5579e6[_0xd6af('0x1a')](_0x8d9ec)[_0xd6af('0x1b')]();};}function respondWithResult(_0x5dd09d,_0x29f685){_0x29f685=_0x29f685||0xc8;return function(_0x4c6f24){if(_0x4c6f24){return _0x5dd09d['status'](_0x29f685)[_0xd6af('0x1c')](_0x4c6f24);}};}function respondWithFilteredResult(_0x28ec5f,_0x431398){return function(_0x8a1895){if(_0x8a1895){var _0x5e4e9a=_0x8a1895[_0xd6af('0x1d')],_0x272ce8=_0x431398[_0xd6af('0x1e')],_0xdc5188=_0x431398['offset']+_0x431398['limit'],_0x595ee1;if(_0xdc5188>=_0x5e4e9a){_0xdc5188=_0x5e4e9a;_0x595ee1=0xc8;}else{_0x595ee1=0xce;}_0x28ec5f[_0xd6af('0x1a')](_0x595ee1);return _0x28ec5f['set'](_0xd6af('0x1f'),_0x272ce8+'-'+_0xdc5188+'/'+_0x5e4e9a)['json'](_0x8a1895);}return null;};}function patchUpdates(_0x1abaad){return function(_0x2298c4){try{jsonpatch['apply'](_0x2298c4,_0x1abaad,!![]);}catch(_0x486238){return BPromise[_0xd6af('0x20')](_0x486238);}return _0x2298c4[_0xd6af('0x21')]();};}function saveUpdates(_0x1d52fb,_0xbba7e5){return function(_0x586c04){if(_0x586c04){return _0x586c04[_0xd6af('0x22')](_0x1d52fb)[_0xd6af('0x23')](function(_0x2faae8){return _0x2faae8;});}return null;};}function removeEntity(_0x2a864c,_0x386da2){return function(_0x438d98){if(_0x438d98){return _0x438d98[_0xd6af('0x24')]()[_0xd6af('0x23')](function(){_0x2a864c[_0xd6af('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49fe33,_0x56b389){return function(_0x36ac94){if(!_0x36ac94){_0x49fe33[_0xd6af('0x25')](0x194);}return _0x36ac94;};}function handleError(_0x1b8b69,_0x255584){_0x255584=_0x255584||0x1f4;return function(_0x53c1d3){logger[_0xd6af('0x26')](_0x53c1d3[_0xd6af('0x27')]);if(_0x53c1d3['name']){delete _0x53c1d3[_0xd6af('0x28')];}_0x1b8b69[_0xd6af('0x1a')](_0x255584)[_0xd6af('0x29')](_0x53c1d3);};}exports[_0xd6af('0x2a')]=function(_0x80473c,_0x55fec1){var _0x5733cf={},_0x5115db={},_0x307056={'count':0x0,'rows':[]};var _0x501ded=_[_0xd6af('0x2b')](db[_0xd6af('0x2c')][_0xd6af('0x2d')],function(_0x518077){return{'name':_0x518077[_0xd6af('0x2e')],'type':_0x518077[_0xd6af('0x2f')][_0xd6af('0x30')]};});_0x5115db[_0xd6af('0x31')]=_[_0xd6af('0x2b')](_0x501ded,_0xd6af('0x28'));_0x5115db[_0xd6af('0x32')]=_[_0xd6af('0x33')](_0x80473c['query']);_0x5115db[_0xd6af('0x34')]=_[_0xd6af('0x35')](_0x5115db[_0xd6af('0x31')],_0x5115db[_0xd6af('0x32')]);_0x5733cf[_0xd6af('0x36')]=_['intersection'](_0x5115db[_0xd6af('0x31')],qs['fields'](_0x80473c[_0xd6af('0x32')][_0xd6af('0x37')]));_0x5733cf[_0xd6af('0x36')]=_0x5733cf[_0xd6af('0x36')][_0xd6af('0x38')]?_0x5733cf[_0xd6af('0x36')]:_0x5115db['model'];if(!_0x80473c[_0xd6af('0x32')][_0xd6af('0x39')](_0xd6af('0x3a'))){_0x5733cf['limit']=qs[_0xd6af('0x3b')](_0x80473c[_0xd6af('0x32')][_0xd6af('0x3b')]);_0x5733cf[_0xd6af('0x1e')]=qs[_0xd6af('0x1e')](_0x80473c[_0xd6af('0x32')]['offset']);}_0x5733cf['order']=qs[_0xd6af('0x3c')](_0x80473c[_0xd6af('0x32')][_0xd6af('0x3c')]);_0x5733cf['where']=qs['filters'](_[_0xd6af('0x3d')](_0x80473c[_0xd6af('0x32')],_0x5115db[_0xd6af('0x34')]),_0x501ded);if(_0x80473c[_0xd6af('0x32')][_0xd6af('0x3e')]){_0x5733cf['where']=_['merge'](_0x5733cf[_0xd6af('0x3f')],{'$or':_[_0xd6af('0x2b')](_0x501ded,function(_0x35834e){if(_0x35834e['type']!==_0xd6af('0x40')){var _0x4b7fd9={};_0x4b7fd9[_0x35834e[_0xd6af('0x28')]]={'$like':'%'+_0x80473c['query'][_0xd6af('0x3e')]+'%'};return _0x4b7fd9;}})});}_0x5733cf=_['merge']({},_0x5733cf,_0x80473c[_0xd6af('0x41')]);var _0x24f2bd={'where':_0x5733cf[_0xd6af('0x3f')]};return db['Automation'][_0xd6af('0x1d')](_0x24f2bd)[_0xd6af('0x23')](function(_0x4d3938){_0x307056[_0xd6af('0x1d')]=_0x4d3938;if(_0x80473c[_0xd6af('0x32')]['includeAll']){_0x5733cf[_0xd6af('0x42')]=[{'all':!![]}];}return db[_0xd6af('0x2c')][_0xd6af('0x43')](_0x5733cf);})['then'](function(_0xa888d8){_0x307056['rows']=_0xa888d8;return _0x307056;})[_0xd6af('0x23')](respondWithFilteredResult(_0x55fec1,_0x5733cf))[_0xd6af('0x44')](handleError(_0x55fec1,null));};exports[_0xd6af('0x45')]=function(_0x7e8dad,_0x32d9f7){var _0x5b15de={'raw':![],'where':{'id':_0x7e8dad[_0xd6af('0x46')]['id']}},_0x4a779a={};_0x4a779a[_0xd6af('0x31')]=_[_0xd6af('0x33')](db[_0xd6af('0x2c')]['rawAttributes']);_0x4a779a[_0xd6af('0x32')]=_[_0xd6af('0x33')](_0x7e8dad['query']);_0x4a779a[_0xd6af('0x34')]=_[_0xd6af('0x35')](_0x4a779a['model'],_0x4a779a[_0xd6af('0x32')]);_0x5b15de['attributes']=_[_0xd6af('0x35')](_0x4a779a[_0xd6af('0x31')],qs[_0xd6af('0x37')](_0x7e8dad[_0xd6af('0x32')][_0xd6af('0x37')]));_0x5b15de[_0xd6af('0x36')]=_0x5b15de[_0xd6af('0x36')]['length']?_0x5b15de[_0xd6af('0x36')]:_0x4a779a[_0xd6af('0x31')];if(_0x7e8dad[_0xd6af('0x32')][_0xd6af('0x47')]){_0x5b15de['include']=[{'all':!![]}];}_0x5b15de=_[_0xd6af('0x48')]({},_0x5b15de,_0x7e8dad[_0xd6af('0x41')]);return db[_0xd6af('0x2c')][_0xd6af('0x49')](_0x5b15de)[_0xd6af('0x23')](handleEntityNotFound(_0x32d9f7,null))['then'](respondWithResult(_0x32d9f7,null))[_0xd6af('0x44')](handleError(_0x32d9f7,null));};exports[_0xd6af('0x4a')]=function(_0x3c027a,_0xecdf66){return db[_0xd6af('0x2c')][_0xd6af('0x4a')](_0x3c027a[_0xd6af('0x4b')],{})[_0xd6af('0x23')](respondWithResult(_0xecdf66,0xc9))[_0xd6af('0x44')](handleError(_0xecdf66,null));};exports[_0xd6af('0x22')]=function(_0x2443ae,_0x32d88d){if(_0x2443ae[_0xd6af('0x4b')]['id']){delete _0x2443ae[_0xd6af('0x4b')]['id'];}return db[_0xd6af('0x2c')][_0xd6af('0x49')]({'where':{'id':_0x2443ae[_0xd6af('0x46')]['id']}})[_0xd6af('0x23')](handleEntityNotFound(_0x32d88d,null))[_0xd6af('0x23')](saveUpdates(_0x2443ae[_0xd6af('0x4b')],null))['then'](respondWithResult(_0x32d88d,null))['catch'](handleError(_0x32d88d,null));};exports['destroy']=function(_0x5f31d3,_0x3ee435){return db['Automation']['find']({'where':{'id':_0x5f31d3[_0xd6af('0x46')]['id']}})[_0xd6af('0x23')](handleEntityNotFound(_0x3ee435,null))['then'](removeEntity(_0x3ee435,null))['catch'](handleError(_0x3ee435,null));};exports[_0xd6af('0x4c')]=function(_0x7e72f0,_0x3db635,_0x4baee8){return db[_0xd6af('0x4d')][_0xd6af('0x49')]({'where':{'id':_0x7e72f0[_0xd6af('0x46')]['id']}})[_0xd6af('0x23')](handleEntityNotFound(_0x3db635,null))[_0xd6af('0x23')](function(_0x5116f1){if(_0x5116f1){return _0x5116f1[_0xd6af('0x4c')](_0x7e72f0[_0xd6af('0x4b')][_0xd6af('0x4e')],_[_0xd6af('0x4f')](_0x7e72f0[_0xd6af('0x4b')],[_0xd6af('0x4e'),'id'])||{});}})[_0xd6af('0x23')](respondWithResult(_0x3db635,null))[_0xd6af('0x44')](handleError(_0x3db635,null));};exports[_0xd6af('0x50')]=function(_0x20d84f,_0x2b2971,_0x27457f){var _0x487d17={};var _0x3e3572={};var _0x53dad8;var _0x5e82f4;return db[_0xd6af('0x2c')][_0xd6af('0x51')]({'where':{'id':_0x20d84f['params']['id']}})[_0xd6af('0x23')](handleEntityNotFound(_0x2b2971,null))[_0xd6af('0x23')](function(_0x4a6911){if(_0x4a6911){_0x53dad8=_0x4a6911;_0x3e3572[_0xd6af('0x31')]=_[_0xd6af('0x33')](db[_0xd6af('0x4d')][_0xd6af('0x2d')]);_0x3e3572[_0xd6af('0x32')]=_[_0xd6af('0x33')](_0x20d84f[_0xd6af('0x32')]);_0x3e3572[_0xd6af('0x34')]=_[_0xd6af('0x35')](_0x3e3572[_0xd6af('0x31')],_0x3e3572[_0xd6af('0x32')]);_0x487d17[_0xd6af('0x36')]=_[_0xd6af('0x35')](_0x3e3572[_0xd6af('0x31')],qs[_0xd6af('0x37')](_0x20d84f[_0xd6af('0x32')][_0xd6af('0x37')]));_0x487d17[_0xd6af('0x36')]=_0x487d17[_0xd6af('0x36')][_0xd6af('0x38')]?_0x487d17[_0xd6af('0x36')]:_0x3e3572[_0xd6af('0x31')];_0x487d17[_0xd6af('0x52')]=qs[_0xd6af('0x3c')](_0x20d84f[_0xd6af('0x32')][_0xd6af('0x3c')]);_0x487d17[_0xd6af('0x3f')]=qs[_0xd6af('0x34')](_[_0xd6af('0x3d')](_0x20d84f[_0xd6af('0x32')],_0x3e3572[_0xd6af('0x34')]));if(_0x20d84f[_0xd6af('0x32')][_0xd6af('0x3e')]){_0x487d17[_0xd6af('0x3f')]=_['merge'](_0x487d17['where'],{'$or':_[_0xd6af('0x2b')](_0x487d17[_0xd6af('0x36')],function(_0x19f82a){var _0x1c3ad5={};_0x1c3ad5[_0x19f82a]={'$like':'%'+_0x20d84f[_0xd6af('0x32')][_0xd6af('0x3e')]+'%'};return _0x1c3ad5;})});}_0x487d17=_[_0xd6af('0x48')]({},_0x487d17,_0x20d84f[_0xd6af('0x41')]);return _0x53dad8[_0xd6af('0x50')](_0x487d17);}})['then'](function(_0x1a702f){if(_0x1a702f){_0x5e82f4=_0x1a702f['length'];if(!_0x20d84f[_0xd6af('0x32')]['hasOwnProperty'](_0xd6af('0x3a'))){_0x487d17[_0xd6af('0x3b')]=qs[_0xd6af('0x3b')](_0x20d84f['query']['limit']);_0x487d17[_0xd6af('0x1e')]=qs['offset'](_0x20d84f[_0xd6af('0x32')]['offset']);}return _0x53dad8['getConditions'](_0x487d17);}})[_0xd6af('0x23')](function(_0x21f776){if(_0x21f776){return _0x21f776?{'count':_0x5e82f4,'rows':_0x21f776}:null;}})[_0xd6af('0x23')](respondWithResult(_0x2b2971,null))[_0xd6af('0x44')](handleError(_0x2b2971,null));};exports[_0xd6af('0x53')]=function(_0x5a3071,_0xc257d4,_0x1fcd9d){return db[_0xd6af('0x54')][_0xd6af('0x49')]({'where':{'id':_0x5a3071[_0xd6af('0x46')]['id']}})['then'](handleEntityNotFound(_0xc257d4,null))['then'](function(_0x3430f9){if(_0x3430f9){return _0x3430f9[_0xd6af('0x53')](_0x5a3071[_0xd6af('0x4b')][_0xd6af('0x4e')],_['omit'](_0x5a3071[_0xd6af('0x4b')],[_0xd6af('0x4e'),'id'])||{});}})[_0xd6af('0x23')](respondWithResult(_0xc257d4,null))[_0xd6af('0x44')](handleError(_0xc257d4,null));};exports[_0xd6af('0x55')]=function(_0x5dfdeb,_0x34ddf7,_0x8048a8){var _0xf9b84f={};var _0x5c677c={};var _0x134e7e;var _0x54b104;return db['Automation'][_0xd6af('0x51')]({'where':{'id':_0x5dfdeb[_0xd6af('0x46')]['id']}})['then'](handleEntityNotFound(_0x34ddf7,null))[_0xd6af('0x23')](function(_0x371dbc){if(_0x371dbc){_0x134e7e=_0x371dbc;_0x5c677c[_0xd6af('0x31')]=_['keys'](db[_0xd6af('0x54')][_0xd6af('0x2d')]);_0x5c677c[_0xd6af('0x32')]=_[_0xd6af('0x33')](_0x5dfdeb[_0xd6af('0x32')]);_0x5c677c['filters']=_[_0xd6af('0x35')](_0x5c677c[_0xd6af('0x31')],_0x5c677c['query']);_0xf9b84f[_0xd6af('0x36')]=_[_0xd6af('0x35')](_0x5c677c[_0xd6af('0x31')],qs[_0xd6af('0x37')](_0x5dfdeb[_0xd6af('0x32')][_0xd6af('0x37')]));_0xf9b84f['attributes']=_0xf9b84f[_0xd6af('0x36')][_0xd6af('0x38')]?_0xf9b84f['attributes']:_0x5c677c[_0xd6af('0x31')];_0xf9b84f[_0xd6af('0x52')]=qs[_0xd6af('0x3c')](_0x5dfdeb[_0xd6af('0x32')]['sort']);_0xf9b84f['where']=qs[_0xd6af('0x34')](_[_0xd6af('0x3d')](_0x5dfdeb[_0xd6af('0x32')],_0x5c677c['filters']));if(_0x5dfdeb[_0xd6af('0x32')][_0xd6af('0x3e')]){_0xf9b84f[_0xd6af('0x3f')]=_['merge'](_0xf9b84f[_0xd6af('0x3f')],{'$or':_[_0xd6af('0x2b')](_0xf9b84f[_0xd6af('0x36')],function(_0x47008d){var _0x238f6d={};_0x238f6d[_0x47008d]={'$like':'%'+_0x5dfdeb[_0xd6af('0x32')][_0xd6af('0x3e')]+'%'};return _0x238f6d;})});}_0xf9b84f=_[_0xd6af('0x48')]({},_0xf9b84f,_0x5dfdeb['options']);return _0x134e7e[_0xd6af('0x55')](_0xf9b84f);}})[_0xd6af('0x23')](function(_0x3a027f){if(_0x3a027f){_0x54b104=_0x3a027f[_0xd6af('0x38')];if(!_0x5dfdeb[_0xd6af('0x32')][_0xd6af('0x39')]('nolimit')){_0xf9b84f[_0xd6af('0x3b')]=qs[_0xd6af('0x3b')](_0x5dfdeb[_0xd6af('0x32')][_0xd6af('0x3b')]);_0xf9b84f[_0xd6af('0x1e')]=qs[_0xd6af('0x1e')](_0x5dfdeb[_0xd6af('0x32')][_0xd6af('0x1e')]);}return _0x134e7e['getActions'](_0xf9b84f);}})['then'](function(_0x2cf0b1){if(_0x2cf0b1){return _0x2cf0b1?{'count':_0x54b104,'rows':_0x2cf0b1}:null;}})[_0xd6af('0x23')](respondWithResult(_0x34ddf7,null))['catch'](handleError(_0x34ddf7,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index e48f521..6830cca 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 _0xca07=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Automation','tools_automations','lodash','util'];(function(_0x35292f,_0x2ed644){var _0x450e0c=function(_0x478836){while(--_0x478836){_0x35292f['push'](_0x35292f['shift']());}};_0x450e0c(++_0x2ed644);}(_0xca07,0x1c5));var _0x7ca0=function(_0x542149,_0x5df180){_0x542149=_0x542149-0x0;var _0x36df57=_0xca07[_0x542149];return _0x36df57;};'use strict';var _=require(_0x7ca0('0x0'));var util=require(_0x7ca0('0x1'));var logger=require(_0x7ca0('0x2'))('api');var moment=require(_0x7ca0('0x3'));var BPromise=require(_0x7ca0('0x4'));var rp=require(_0x7ca0('0x5'));var fs=require('fs');var path=require(_0x7ca0('0x6'));var rimraf=require(_0x7ca0('0x7'));var config=require(_0x7ca0('0x8'));var attributes=require('./automation.attributes');module[_0x7ca0('0x9')]=function(_0x1e1a96,_0x261c57){return _0x1e1a96[_0x7ca0('0xa')](_0x7ca0('0xb'),attributes,{'tableName':_0x7ca0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5981=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Automation','tools_automations','lodash'];(function(_0x538a3d,_0x39470e){var _0x5e63d0=function(_0x290ee4){while(--_0x290ee4){_0x538a3d['push'](_0x538a3d['shift']());}};_0x5e63d0(++_0x39470e);}(_0x5981,0xa7));var _0x1598=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5981[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1598('0x0'));var util=require(_0x1598('0x1'));var logger=require(_0x1598('0x2'))(_0x1598('0x3'));var moment=require(_0x1598('0x4'));var BPromise=require(_0x1598('0x5'));var rp=require(_0x1598('0x6'));var fs=require('fs');var path=require(_0x1598('0x7'));var rimraf=require(_0x1598('0x8'));var config=require(_0x1598('0x9'));var attributes=require('./automation.attributes');module[_0x1598('0xa')]=function(_0x4af2c2,_0xead3f4){return _0x4af2c2[_0x1598('0xb')](_0x1598('0xc'),attributes,{'tableName':_0x1598('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index d576e95..22bfda9 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 _0x2cd3=['request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x255733,_0x52db8c){var _0x2c0d55=function(_0x1062b0){while(--_0x1062b0){_0x255733['push'](_0x255733['shift']());}};_0x2c0d55(++_0x52db8c);}(_0x2cd3,0xf1));var _0x32cd=function(_0xce93c,_0x555be5){_0xce93c=_0xce93c-0x0;var _0x230720=_0x2cd3[_0xce93c];return _0x230720;};'use strict';var _=require(_0x32cd('0x0'));var util=require('util');var moment=require(_0x32cd('0x1'));var BPromise=require(_0x32cd('0x2'));var rs=require(_0x32cd('0x3'));var fs=require('fs');var Redis=require(_0x32cd('0x4'));var db=require(_0x32cd('0x5'))['db'];var utils=require(_0x32cd('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x32cd('0x7'));var jayson=require(_0x32cd('0x8'));var client=jayson[_0x32cd('0x9')][_0x32cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41784f,_0x43eb37,_0x1bbf19){return new BPromise(function(_0x27797f,_0x2d60fa){return client[_0x32cd('0xb')](_0x41784f,_0x1bbf19)[_0x32cd('0xc')](function(_0x192cf4){logger[_0x32cd('0xd')](_0x32cd('0xe'),_0x43eb37,_0x32cd('0xf'));logger[_0x32cd('0x10')](_0x32cd('0x11'),_0x43eb37,_0x32cd('0xf'),JSON['stringify'](_0x192cf4));if(_0x192cf4['error']){if(_0x192cf4[_0x32cd('0x12')]['code']===0x1f4){logger['error'](_0x32cd('0xe'),_0x43eb37,_0x192cf4[_0x32cd('0x12')][_0x32cd('0x13')]);return _0x2d60fa(_0x192cf4[_0x32cd('0x12')][_0x32cd('0x13')]);}logger[_0x32cd('0x12')](_0x32cd('0xe'),_0x43eb37,_0x192cf4['error']['message']);return _0x27797f(_0x192cf4[_0x32cd('0x12')][_0x32cd('0x13')]);}else{logger[_0x32cd('0xd')](_0x32cd('0xe'),_0x43eb37,'request\x20sent');_0x27797f(_0x192cf4[_0x32cd('0x14')]['message']);}})['catch'](function(_0x3de693){logger[_0x32cd('0x12')](_0x32cd('0xe'),_0x43eb37,_0x3de693);_0x2d60fa(_0x3de693);});});}
\ No newline at end of file
+var _0xdeb2=['error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xdeb2,0xd3));var _0x2deb=function(_0x5ce043,_0x52cfdb){_0x5ce043=_0x5ce043-0x0;var _0x5e6530=_0xdeb2[_0x5ce043];return _0x5e6530;};'use strict';var _=require(_0x2deb('0x0'));var util=require(_0x2deb('0x1'));var moment=require(_0x2deb('0x2'));var BPromise=require(_0x2deb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2deb('0x4'));var db=require(_0x2deb('0x5'))['db'];var utils=require(_0x2deb('0x6'));var logger=require(_0x2deb('0x7'))(_0x2deb('0x8'));var config=require(_0x2deb('0x9'));var jayson=require(_0x2deb('0xa'));var client=jayson[_0x2deb('0xb')][_0x2deb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x394f94,_0x53c01a,_0xa47d30){return new BPromise(function(_0x262ea6,_0x57e28c){return client[_0x2deb('0xd')](_0x394f94,_0xa47d30)['then'](function(_0x3de43d){logger[_0x2deb('0xe')](_0x2deb('0xf'),_0x53c01a,_0x2deb('0x10'));logger['debug'](_0x2deb('0x11'),_0x53c01a,_0x2deb('0x10'),JSON[_0x2deb('0x12')](_0x3de43d));if(_0x3de43d['error']){if(_0x3de43d[_0x2deb('0x13')][_0x2deb('0x14')]===0x1f4){logger[_0x2deb('0x13')](_0x2deb('0xf'),_0x53c01a,_0x3de43d[_0x2deb('0x13')][_0x2deb('0x15')]);return _0x57e28c(_0x3de43d[_0x2deb('0x13')]['message']);}logger[_0x2deb('0x13')]('Automation,\x20%s,\x20%s',_0x53c01a,_0x3de43d['error'][_0x2deb('0x15')]);return _0x262ea6(_0x3de43d[_0x2deb('0x13')][_0x2deb('0x15')]);}else{logger[_0x2deb('0xe')]('Automation,\x20%s,\x20%s',_0x53c01a,_0x2deb('0x10'));_0x262ea6(_0x3de43d['result'][_0x2deb('0x15')]);}})[_0x2deb('0x16')](function(_0x41e149){logger[_0x2deb('0x13')](_0x2deb('0xf'),_0x53c01a,_0x41e149);_0x57e28c(_0x41e149);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 99b3195..3b6f724 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 _0x7da5=['addConditions','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post'];(function(_0x3090fd,_0x3b369c){var _0x9f60e8=function(_0x4d3f17){while(--_0x4d3f17){_0x3090fd['push'](_0x3090fd['shift']());}};_0x9f60e8(++_0x3b369c);}(_0x7da5,0x186));var _0x57da=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x7da5[_0x110c3d];return _0x226d67;};'use strict';var multer=require('multer');var util=require(_0x57da('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x57da('0x1'));var router=express[_0x57da('0x2')]();var fs_extra=require(_0x57da('0x3'));var auth=require(_0x57da('0x4'));var interaction=require(_0x57da('0x5'));var config=require(_0x57da('0x6'));var controller=require(_0x57da('0x7'));router[_0x57da('0x8')]('/',auth[_0x57da('0x9')](),controller[_0x57da('0xa')]);router[_0x57da('0x8')](_0x57da('0xb'),auth[_0x57da('0x9')](),controller[_0x57da('0xc')]);router['get'](_0x57da('0xd'),auth[_0x57da('0x9')](),controller[_0x57da('0xe')]);router[_0x57da('0x8')](_0x57da('0xf'),auth['isAuthenticated'](),controller[_0x57da('0x10')]);router[_0x57da('0x11')]('/',auth[_0x57da('0x9')](),controller['create']);router[_0x57da('0x11')](_0x57da('0xd'),auth[_0x57da('0x9')](),controller[_0x57da('0x12')]);router[_0x57da('0x11')](_0x57da('0xf'),auth[_0x57da('0x9')](),controller['addActions']);router[_0x57da('0x13')](_0x57da('0xb'),auth['isAuthenticated'](),controller[_0x57da('0x14')]);router[_0x57da('0x15')](_0x57da('0xb'),auth[_0x57da('0x9')](),controller[_0x57da('0x16')]);module[_0x57da('0x17')]=router;
\ No newline at end of file
+var _0xc4bc=['connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getActions','post','create','addConditions','/:id/actions','addActions','put','/:id','update','destroy','exports','multer','path'];(function(_0x4cc51a,_0x13da08){var _0x16c6da=function(_0x1231b0){while(--_0x1231b0){_0x4cc51a['push'](_0x4cc51a['shift']());}};_0x16c6da(++_0x13da08);}(_0xc4bc,0x1e2));var _0xcc4b=function(_0x41c78d,_0x4c3628){_0x41c78d=_0x41c78d-0x0;var _0x26d028=_0xc4bc[_0x41c78d];return _0x26d028;};'use strict';var multer=require(_0xcc4b('0x0'));var util=require('util');var path=require(_0xcc4b('0x1'));var timeout=require(_0xcc4b('0x2'));var express=require('express');var router=express[_0xcc4b('0x3')]();var fs_extra=require(_0xcc4b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcc4b('0x5'));var config=require(_0xcc4b('0x6'));var controller=require('./automation.controller');router[_0xcc4b('0x7')]('/',auth[_0xcc4b('0x8')](),controller[_0xcc4b('0x9')]);router[_0xcc4b('0x7')]('/:id',auth[_0xcc4b('0x8')](),controller[_0xcc4b('0xa')]);router[_0xcc4b('0x7')]('/:id/conditions',auth[_0xcc4b('0x8')](),controller['getConditions']);router[_0xcc4b('0x7')]('/:id/actions',auth['isAuthenticated'](),controller[_0xcc4b('0xb')]);router[_0xcc4b('0xc')]('/',auth[_0xcc4b('0x8')](),controller[_0xcc4b('0xd')]);router[_0xcc4b('0xc')]('/:id/conditions',auth[_0xcc4b('0x8')](),controller[_0xcc4b('0xe')]);router[_0xcc4b('0xc')](_0xcc4b('0xf'),auth[_0xcc4b('0x8')](),controller[_0xcc4b('0x10')]);router[_0xcc4b('0x11')](_0xcc4b('0x12'),auth[_0xcc4b('0x8')](),controller[_0xcc4b('0x13')]);router['delete'](_0xcc4b('0x12'),auth[_0xcc4b('0x8')](),controller[_0xcc4b('0x14')]);module[_0xcc4b('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 92dec7a..60a9141 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 _0x9dad=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#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\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)'];(function(_0x4a47a2,_0x5c22bb){var _0x34d7bd=function(_0x232e62){while(--_0x232e62){_0x4a47a2['push'](_0x4a47a2['shift']());}};_0x34d7bd(++_0x5c22bb);}(_0x9dad,0x18a));var _0xd9da=function(_0x45b9a5,_0x48f199){_0x45b9a5=_0x45b9a5-0x0;var _0x3495d2=_0x9dad[_0x45b9a5];return _0x3495d2;};'use strict';var Sequelize=require('sequelize');module[_0xd9da('0x0')]={'name':{'type':Sequelize[_0xd9da('0x1')],'unique':_0xd9da('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd9da('0x3')](_0xd9da('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xd9da('0x1')]},'active':{'type':Sequelize[_0xd9da('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xd9da('0x6')](0x4)[_0xd9da('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd9da('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd9da('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd9da('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xd9da('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd9da('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9da('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0xd9da('0x6')](0x3)[_0xd9da('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9da('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd9da('0x6')](0x5)[_0xd9da('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9da('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd9da('0x7')],'defaultValue':0x3,'comment':_0xd9da('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd9da('0x6')](0x5)[_0xd9da('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xd9da('0x6')](0x3)[_0xd9da('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd9da('0xd')},'dialTimezone':{'type':Sequelize[_0xd9da('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd9da('0x1')],'defaultValue':_0xd9da('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xd9da('0x3')](_0xd9da('0xf'),'never',_0xd9da('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xd9da('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xd9da('0x6')](0x9)[_0xd9da('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd9da('0x11')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xd9da('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd9da('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd9da('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd9da('0x6')](0x9)[_0xd9da('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd9da('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0xd9da('0x6')](0x9)[_0xd9da('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd9da('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xd9da('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd9da('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd9da('0x6')](0x9)[_0xd9da('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd9da('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd9da('0x6')](0x5)[_0xd9da('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xd9da('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd9da('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd9da('0x3')]('DESC',_0xd9da('0x19')),'defaultValue':_0xd9da('0x1a')},'dialPrefix':{'type':Sequelize[_0xd9da('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd9da('0x6')](0x3)[_0xd9da('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd9da('0x1b')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xd9da('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd9da('0x6')](0x3)[_0xd9da('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9da('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd9da('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9da('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd9da('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9da('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0xd9da('0x6')](0x5)[_0xd9da('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9da('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xd9da('0x6')](0x3)[_0xd9da('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9da('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd9da('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9da('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xd9da('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd9da('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9da('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9da('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd9da('0x6')](0x5)[_0xd9da('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9da('0x24')}};
\ No newline at end of file
+var _0x2a77=['AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x51272f,_0x40b67c){var _0x3ce31b=function(_0x186db1){while(--_0x186db1){_0x51272f['push'](_0x51272f['shift']());}};_0x3ce31b(++_0x40b67c);}(_0x2a77,0x73));var _0x72a7=function(_0x29975a,_0x2ca253){_0x29975a=_0x29975a-0x0;var _0x41bcac=_0x2a77[_0x29975a];return _0x41bcac;};'use strict';var Sequelize=require(_0x72a7('0x0'));module[_0x72a7('0x1')]={'name':{'type':Sequelize[_0x72a7('0x2')],'unique':_0x72a7('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0x72a7('0x4')},'description':{'type':Sequelize[_0x72a7('0x2')]},'active':{'type':Sequelize[_0x72a7('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x72a7('0x6')](0x4)[_0x72a7('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x72a7('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x72a7('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x72a7('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72a7('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x72a7('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72a7('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x72a7('0x6')](0x5)[_0x72a7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72a7('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x72a7('0x6')](0x3)[_0x72a7('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72a7('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x72a7('0x6')](0x5)[_0x72a7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72a7('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x72a7('0x6')](0x3)[_0x72a7('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x72a7('0x6')](0x5)[_0x72a7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72a7('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x72a7('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x72a7('0xf')},'dialTimezone':{'type':Sequelize[_0x72a7('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x72a7('0x2')],'defaultValue':_0x72a7('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x72a7('0x11')](_0x72a7('0x12'),_0x72a7('0x13'),'onlyIfOpen'),'defaultValue':_0x72a7('0x12')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x72a7('0x6')](0x9)[_0x72a7('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x72a7('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x72a7('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x72a7('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x72a7('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x72a7('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x72a7('0x6')](0x9)[_0x72a7('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x72a7('0x6')](0x9)[_0x72a7('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x72a7('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x72a7('0x6')](0x9)[_0x72a7('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x72a7('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x72a7('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x72a7('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x72a7('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x72a7('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x72a7('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x72a7('0x11')](_0x72a7('0x1b'),_0x72a7('0x1c')),'defaultValue':_0x72a7('0x1b')},'dialPrefix':{'type':Sequelize[_0x72a7('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x72a7('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x72a7('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x72a7('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x72a7('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x72a7('0x6')](0x3)[_0x72a7('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x72a7('0x6')](0x5)[_0x72a7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72a7('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x72a7('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x72a7('0x6')](0x5)[_0x72a7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72a7('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x72a7('0x6')](0x3)[_0x72a7('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72a7('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x72a7('0x6')](0x5)[_0x72a7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72a7('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x72a7('0x6')](0x3)[_0x72a7('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72a7('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x72a7('0x6')](0x5)[_0x72a7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72a7('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x72a7('0x6')](0x3)[_0x72a7('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x72a7('0x6')](0x5)[_0x72a7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72a7('0x25')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index b3c3917..f83af23 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 _0xa9e0=['ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','scheduledAt','CmListId','push','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','all','removeBlackLists','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','error','name','send','index','map','Campaign','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','autoAssociation','update','getHoppers','findOne','hasOwnProperty','CampaignId','CmHopper','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','ContactId','ListId','select','field','phone','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL'];(function(_0x30f951,_0x3ba029){var _0x17cce0=function(_0x5cd9d6){while(--_0x5cd9d6){_0x30f951['push'](_0x30f951['shift']());}};_0x17cce0(++_0x3ba029);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var fs_extra=require(_0x0a9e('0xa'));var _=require(_0x0a9e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0a9e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0a9e('0xd'));var Papa=require(_0x0a9e('0xe'));var Redis=require(_0x0a9e('0xf'));var authService=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var as=require(_0x0a9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0a9e('0x13'));var licenseUtil=require(_0x0a9e('0x14'));var db=require(_0x0a9e('0x15'))['db'];function respondWithStatusCode(_0x26d672,_0x32d742){_0x32d742=_0x32d742||0xcc;return function(_0x69aeb7){if(_0x69aeb7){return _0x26d672['sendStatus'](_0x32d742);}return _0x26d672[_0x0a9e('0x16')](_0x32d742)[_0x0a9e('0x17')]();};}function respondWithResult(_0x2b4227,_0x281129){_0x281129=_0x281129||0xc8;return function(_0x44dcfd){if(_0x44dcfd){return _0x2b4227[_0x0a9e('0x16')](_0x281129)['json'](_0x44dcfd);}};}function respondWithFilteredResult(_0x22dccb,_0x5d0880){return function(_0x1985b6){if(_0x1985b6){var _0x519dfd=_0x1985b6[_0x0a9e('0x18')],_0x16033c=_0x5d0880['offset'],_0x12066b=_0x5d0880[_0x0a9e('0x19')]+_0x5d0880[_0x0a9e('0x1a')],_0x48f32d;if(_0x12066b>=_0x519dfd){_0x12066b=_0x519dfd;_0x48f32d=0xc8;}else{_0x48f32d=0xce;}_0x22dccb[_0x0a9e('0x16')](_0x48f32d);return _0x22dccb[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x16033c+'-'+_0x12066b+'/'+_0x519dfd)[_0x0a9e('0x1d')](_0x1985b6);}return null;};}function patchUpdates(_0x530eb7){return function(_0x20559e){try{jsonpatch[_0x0a9e('0x1e')](_0x20559e,_0x530eb7,!![]);}catch(_0x112016){return BPromise[_0x0a9e('0x1f')](_0x112016);}return _0x20559e[_0x0a9e('0x20')]();};}function saveUpdates(_0x4bb1e3,_0x2c3407){return function(_0x155cce){if(_0x155cce){return _0x155cce['update'](_0x4bb1e3)[_0x0a9e('0x21')](function(_0x5a09ef){return _0x5a09ef;});}return null;};}function removeEntity(_0x588269,_0x3a02e1){return function(_0x432e56){if(_0x432e56){return _0x432e56[_0x0a9e('0x22')]()[_0x0a9e('0x21')](function(){var _0x4abc77=_0x432e56[_0x0a9e('0x23')]({'plain':!![]});var _0x2fb0e4=_0x0a9e('0x24');return db[_0x0a9e('0x25')][_0x0a9e('0x22')]({'where':{'type':_0x2fb0e4,'resourceId':_0x4abc77['id']}})[_0x0a9e('0x21')](function(){return _0x432e56;});})[_0x0a9e('0x21')](function(){_0x588269['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x197ec0,_0x3a8e58){return function(_0x40c424){if(!_0x40c424){_0x197ec0[_0x0a9e('0x26')](0x194);}return _0x40c424;};}function handleError(_0x526cf3,_0x384319){_0x384319=_0x384319||0x1f4;return function(_0x479bc4){logger[_0x0a9e('0x27')](_0x479bc4['stack']);if(_0x479bc4[_0x0a9e('0x28')]){delete _0x479bc4[_0x0a9e('0x28')];}_0x526cf3[_0x0a9e('0x16')](_0x384319)[_0x0a9e('0x29')](_0x479bc4);};}exports[_0x0a9e('0x2a')]=function(_0x1538a4,_0x11c3b6){var _0x14de77={},_0x5a101a={},_0x3652a7={'count':0x0,'rows':[]};var _0x468813=_[_0x0a9e('0x2b')](db[_0x0a9e('0x2c')]['rawAttributes'],function(_0x15b200){return{'name':_0x15b200[_0x0a9e('0x2d')],'type':_0x15b200[_0x0a9e('0x2e')][_0x0a9e('0x2f')]};});_0x5a101a[_0x0a9e('0x30')]=_[_0x0a9e('0x2b')](_0x468813,_0x0a9e('0x28'));_0x5a101a[_0x0a9e('0x31')]=_[_0x0a9e('0x32')](_0x1538a4['query']);_0x5a101a[_0x0a9e('0x33')]=_['intersection'](_0x5a101a[_0x0a9e('0x30')],_0x5a101a[_0x0a9e('0x31')]);_0x14de77[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x5a101a[_0x0a9e('0x30')],qs['fields'](_0x1538a4[_0x0a9e('0x31')][_0x0a9e('0x36')]));_0x14de77[_0x0a9e('0x34')]=_0x14de77[_0x0a9e('0x34')][_0x0a9e('0x37')]?_0x14de77[_0x0a9e('0x34')]:_0x5a101a[_0x0a9e('0x30')];if(!_0x1538a4[_0x0a9e('0x31')]['hasOwnProperty'](_0x0a9e('0x38'))){_0x14de77['limit']=qs[_0x0a9e('0x1a')](_0x1538a4[_0x0a9e('0x31')][_0x0a9e('0x1a')]);_0x14de77[_0x0a9e('0x19')]=qs['offset'](_0x1538a4[_0x0a9e('0x31')][_0x0a9e('0x19')]);}_0x14de77[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x1538a4['query']['sort']);_0x14de77[_0x0a9e('0x3b')]=qs['filters'](_[_0x0a9e('0x3c')](_0x1538a4[_0x0a9e('0x31')],_0x5a101a[_0x0a9e('0x33')]),_0x468813);if(_0x1538a4[_0x0a9e('0x31')]['filter']){_0x14de77[_0x0a9e('0x3b')]=_[_0x0a9e('0x3d')](_0x14de77[_0x0a9e('0x3b')],{'$or':_['map'](_0x468813,function(_0x1dbf74){if(_0x1dbf74[_0x0a9e('0x2e')]!==_0x0a9e('0x3e')){var _0x4c1c0e={};_0x4c1c0e[_0x1dbf74['name']]={'$like':'%'+_0x1538a4[_0x0a9e('0x31')][_0x0a9e('0x3f')]+'%'};return _0x4c1c0e;}})});}_0x14de77=_['merge']({},_0x14de77,_0x1538a4[_0x0a9e('0x40')]);var _0x419125={'where':_0x14de77[_0x0a9e('0x3b')]};return db[_0x0a9e('0x2c')]['count'](_0x419125)['then'](function(_0x15e37d){_0x3652a7[_0x0a9e('0x18')]=_0x15e37d;if(_0x1538a4['query'][_0x0a9e('0x41')]){_0x14de77[_0x0a9e('0x42')]=[{'all':!![]}];}return db[_0x0a9e('0x2c')]['findAll'](_0x14de77);})[_0x0a9e('0x21')](function(_0x2cfea9){_0x3652a7[_0x0a9e('0x43')]=_0x2cfea9;return _0x3652a7;})[_0x0a9e('0x21')](respondWithFilteredResult(_0x11c3b6,_0x14de77))[_0x0a9e('0x44')](handleError(_0x11c3b6,null));};exports[_0x0a9e('0x45')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':![],'where':{'id':_0x2881b3[_0x0a9e('0x46')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x30')]=_[_0x0a9e('0x32')](db[_0x0a9e('0x2c')][_0x0a9e('0x47')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x31')]);_0x3da2cd[_0x0a9e('0x33')]=_[_0x0a9e('0x35')](_0x3da2cd[_0x0a9e('0x30')],_0x3da2cd[_0x0a9e('0x31')]);_0x23b089[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x3da2cd[_0x0a9e('0x30')],qs[_0x0a9e('0x36')](_0x2881b3[_0x0a9e('0x31')][_0x0a9e('0x36')]));_0x23b089[_0x0a9e('0x34')]=_0x23b089['attributes'][_0x0a9e('0x37')]?_0x23b089[_0x0a9e('0x34')]:_0x3da2cd[_0x0a9e('0x30')];if(_0x2881b3[_0x0a9e('0x31')][_0x0a9e('0x41')]){_0x23b089[_0x0a9e('0x42')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x3d')]({},_0x23b089,_0x2881b3[_0x0a9e('0x40')]);return db['Campaign'][_0x0a9e('0x48')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x21')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x44')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x49')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2c')][_0x0a9e('0x49')](_0x562fb4[_0x0a9e('0x4a')],{})[_0x0a9e('0x21')](function(_0x37be73){var _0x45bf7f=_0x562fb4['user'][_0x0a9e('0x23')]({'plain':!![]});if(!_0x45bf7f)throw new Error(_0x0a9e('0x4b'));if(_0x45bf7f[_0x0a9e('0x4c')]===_0x0a9e('0x4d')){var _0x409789=_0x37be73[_0x0a9e('0x23')]({'plain':!![]});var _0x6054ee=_0x0a9e('0x24');return db[_0x0a9e('0x4e')]['find']({'where':{'name':_0x6054ee,'userProfileId':_0x45bf7f[_0x0a9e('0x4f')]},'raw':!![]})[_0x0a9e('0x21')](function(_0x4f7240){if(_0x4f7240&&_0x4f7240['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x49')]({'name':_0x409789[_0x0a9e('0x28')],'resourceId':_0x409789['id'],'type':_0x4f7240[_0x0a9e('0x28')],'sectionId':_0x4f7240['id']},{})[_0x0a9e('0x21')](function(){return _0x37be73;});}else{return _0x37be73;}})[_0x0a9e('0x44')](function(_0x30decb){logger[_0x0a9e('0x27')](_0x0a9e('0x50'),_0x30decb);throw _0x30decb;});}return _0x37be73;})['then'](respondWithResult(_0x14bec2,0xc9))['catch'](handleError(_0x14bec2,null));};exports['clone']=function(_0x39d77d,_0x204173){var _0x14d602={'where':{'id':_0x39d77d[_0x0a9e('0x46')]['id']}},_0x5bb3ed={};_0x5bb3ed[_0x0a9e('0x30')]=_['keys'](db['Campaign'][_0x0a9e('0x47')]);_0x14d602['attributes']=_[_0x0a9e('0x35')](_0x5bb3ed['model'],qs[_0x0a9e('0x36')](_0x39d77d[_0x0a9e('0x31')][_0x0a9e('0x36')]));_0x14d602['attributes']=_0x14d602[_0x0a9e('0x34')][_0x0a9e('0x37')]?_0x14d602['attributes']:_0x5bb3ed['model'];if(_0x39d77d[_0x0a9e('0x31')][_0x0a9e('0x41')]){_0x14d602['include']=[{'all':!![]}];}_0x14d602=_[_0x0a9e('0x3d')]({},_0x14d602,_0x39d77d['options']);return db[_0x0a9e('0x2c')]['find'](_0x14d602)[_0x0a9e('0x21')](handleEntityNotFound(_0x204173,null))['then'](function(_0x5da27d){if(_0x5da27d){var _0x5df0ad=_0x5da27d[_0x0a9e('0x23')]({'plain':!![]});_0x5df0ad=qs['omit'](_0x5df0ad,['id',_0x0a9e('0x51'),_0x0a9e('0x52')]);_0x39d77d[_0x0a9e('0x4a')]=_[_0x0a9e('0x53')](_0x39d77d[_0x0a9e('0x4a')],['id',_0x0a9e('0x51'),_0x0a9e('0x52')]);return db[_0x0a9e('0x2c')]['create'](_[_0x0a9e('0x3d')](_0x5df0ad,_0x39d77d[_0x0a9e('0x4a')]),{'include':_0x39d77d[_0x0a9e('0x31')][_0x0a9e('0x41')]?[{'all':!![]}]:undefined})[_0x0a9e('0x21')](function(_0x156662){var _0x5d86e9=_0x39d77d[_0x0a9e('0x4d')][_0x0a9e('0x23')]({'plain':!![]});if(!_0x5d86e9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d86e9[_0x0a9e('0x4c')]==='user'){var _0x20c668=_0x156662['get']({'plain':!![]});var _0x4b3c1a='IvrCampaigns';return db[_0x0a9e('0x4e')]['find']({'where':{'name':_0x4b3c1a,'userProfileId':_0x5d86e9[_0x0a9e('0x4f')]},'raw':!![]})[_0x0a9e('0x21')](function(_0x261adb){if(_0x261adb&&_0x261adb[_0x0a9e('0x54')]===0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x49')]({'name':_0x20c668['name'],'resourceId':_0x20c668['id'],'type':_0x261adb[_0x0a9e('0x28')],'sectionId':_0x261adb['id']},{})['then'](function(){return _0x156662;});}else{return _0x156662;}})[_0x0a9e('0x44')](function(_0x1f07cb){logger[_0x0a9e('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f07cb);throw _0x1f07cb;});}return _0x156662;});}})[_0x0a9e('0x21')](respondWithResult(_0x204173,0xc9))[_0x0a9e('0x44')](handleError(_0x204173,null));};exports[_0x0a9e('0x55')]=function(_0x32e134,_0x497d91){if(_0x32e134[_0x0a9e('0x4a')]['id']){delete _0x32e134[_0x0a9e('0x4a')]['id'];}return db['Campaign'][_0x0a9e('0x48')]({'where':{'id':_0x32e134[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x497d91,null))[_0x0a9e('0x21')](saveUpdates(_0x32e134[_0x0a9e('0x4a')],null))['then'](respondWithResult(_0x497d91,null))[_0x0a9e('0x44')](handleError(_0x497d91,null));};exports[_0x0a9e('0x22')]=function(_0x281c7d,_0x47bb43){return db[_0x0a9e('0x2c')]['find']({'where':{'id':_0x281c7d['params']['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x47bb43,null))[_0x0a9e('0x21')](removeEntity(_0x47bb43,null))[_0x0a9e('0x44')](handleError(_0x47bb43,null));};exports[_0x0a9e('0x56')]=function(_0x186f39,_0xc8c264,_0x387489){var _0x54a37d={'raw':!![],'where':{}};var _0x2d7205={};var _0x1cc4f3={'count':0x0,'rows':[]};return db[_0x0a9e('0x2c')][_0x0a9e('0x57')]({'where':{'id':_0x186f39[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0xc8c264,null))[_0x0a9e('0x21')](function(_0x412a72){if(_0x412a72){_0x2d7205[_0x0a9e('0x30')]=_[_0x0a9e('0x32')](db['CmHopper'][_0x0a9e('0x47')]);_0x2d7205[_0x0a9e('0x31')]=_[_0x0a9e('0x32')](_0x186f39['query']);_0x2d7205[_0x0a9e('0x33')]=_[_0x0a9e('0x35')](_0x2d7205['model'],_0x2d7205[_0x0a9e('0x31')]);_0x54a37d[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x2d7205[_0x0a9e('0x30')],qs[_0x0a9e('0x36')](_0x186f39['query']['fields']));_0x54a37d['attributes']=_0x54a37d[_0x0a9e('0x34')][_0x0a9e('0x37')]?_0x54a37d[_0x0a9e('0x34')]:_0x2d7205[_0x0a9e('0x30')];if(!_0x186f39[_0x0a9e('0x31')][_0x0a9e('0x58')](_0x0a9e('0x38'))){_0x54a37d[_0x0a9e('0x1a')]=qs['limit'](_0x186f39[_0x0a9e('0x31')][_0x0a9e('0x1a')]);_0x54a37d[_0x0a9e('0x19')]=qs['offset'](_0x186f39[_0x0a9e('0x31')]['offset']);}_0x54a37d[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x186f39['query'][_0x0a9e('0x3a')]);_0x54a37d[_0x0a9e('0x3b')]=qs[_0x0a9e('0x33')](_[_0x0a9e('0x3c')](_0x186f39['query'],_0x2d7205[_0x0a9e('0x33')]));_0x54a37d[_0x0a9e('0x3b')][_0x0a9e('0x59')]=_0x412a72['id'];if(_0x186f39[_0x0a9e('0x31')]['filter']){_0x54a37d[_0x0a9e('0x3b')]=_[_0x0a9e('0x3d')](_0x54a37d[_0x0a9e('0x3b')],{'$or':_[_0x0a9e('0x2b')](_0x54a37d['attributes'],function(_0x290d43){var _0x3511c9={};_0x3511c9[_0x290d43]={'$like':'%'+_0x186f39[_0x0a9e('0x31')][_0x0a9e('0x3f')]+'%'};return _0x3511c9;})});}_0x54a37d=_[_0x0a9e('0x3d')]({},_0x54a37d,_0x186f39[_0x0a9e('0x40')]);return db[_0x0a9e('0x5a')][_0x0a9e('0x18')]({'where':_0x54a37d[_0x0a9e('0x3b')]})[_0x0a9e('0x21')](function(_0xc4c230){_0x1cc4f3[_0x0a9e('0x18')]=_0xc4c230;if(_0x186f39[_0x0a9e('0x31')][_0x0a9e('0x41')]){_0x54a37d['include']=[{'all':!![]}];}return db[_0x0a9e('0x5a')][_0x0a9e('0x5b')](_0x54a37d);})[_0x0a9e('0x21')](function(_0x563627){_0x1cc4f3[_0x0a9e('0x43')]=_0x563627;return _0x1cc4f3;});}})[_0x0a9e('0x21')](respondWithFilteredResult(_0xc8c264,_0x54a37d))[_0x0a9e('0x44')](handleError(_0xc8c264,null));};exports[_0x0a9e('0x5c')]=function(_0x56d650,_0x541e80,_0x7ebea8){var _0x2bbdb5={'raw':!![],'where':{}};var _0x4c54fa={};var _0x45108c={'count':0x0,'rows':[]};return db['Campaign'][_0x0a9e('0x57')]({'where':{'id':_0x56d650[_0x0a9e('0x46')]['id']}})['then'](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x21')](function(_0x41cf12){if(_0x41cf12){_0x4c54fa[_0x0a9e('0x30')]=_[_0x0a9e('0x32')](db[_0x0a9e('0x5d')][_0x0a9e('0x47')]);_0x4c54fa[_0x0a9e('0x31')]=_['keys'](_0x56d650[_0x0a9e('0x31')]);_0x4c54fa[_0x0a9e('0x33')]=_[_0x0a9e('0x35')](_0x4c54fa[_0x0a9e('0x30')],_0x4c54fa['query']);_0x2bbdb5[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x4c54fa['model'],qs[_0x0a9e('0x36')](_0x56d650['query'][_0x0a9e('0x36')]));_0x2bbdb5[_0x0a9e('0x34')]=_0x2bbdb5[_0x0a9e('0x34')][_0x0a9e('0x37')]?_0x2bbdb5['attributes']:_0x4c54fa['model'];if(!_0x56d650[_0x0a9e('0x31')][_0x0a9e('0x58')](_0x0a9e('0x38'))){_0x2bbdb5['limit']=qs[_0x0a9e('0x1a')](_0x56d650[_0x0a9e('0x31')]['limit']);_0x2bbdb5['offset']=qs[_0x0a9e('0x19')](_0x56d650['query']['offset']);}_0x2bbdb5['order']=qs[_0x0a9e('0x3a')](_0x56d650[_0x0a9e('0x31')][_0x0a9e('0x3a')]);_0x2bbdb5[_0x0a9e('0x3b')]=qs[_0x0a9e('0x33')](_[_0x0a9e('0x3c')](_0x56d650['query'],_0x4c54fa[_0x0a9e('0x33')]));_0x2bbdb5['where'][_0x0a9e('0x59')]=_0x41cf12['id'];if(_0x56d650[_0x0a9e('0x31')][_0x0a9e('0x3f')]){_0x2bbdb5[_0x0a9e('0x3b')]=_['merge'](_0x2bbdb5[_0x0a9e('0x3b')],{'$or':_[_0x0a9e('0x2b')](_0x2bbdb5[_0x0a9e('0x34')],function(_0x5b74c3){var _0xb6e411={};_0xb6e411[_0x5b74c3]={'$like':'%'+_0x56d650[_0x0a9e('0x31')][_0x0a9e('0x3f')]+'%'};return _0xb6e411;})});}_0x2bbdb5=_[_0x0a9e('0x3d')]({},_0x2bbdb5,_0x56d650[_0x0a9e('0x40')]);return db[_0x0a9e('0x5d')][_0x0a9e('0x18')]({'where':_0x2bbdb5[_0x0a9e('0x3b')]})['then'](function(_0x2645d6){_0x45108c[_0x0a9e('0x18')]=_0x2645d6;if(_0x56d650['query'][_0x0a9e('0x41')]){_0x2bbdb5[_0x0a9e('0x42')]=[{'all':!![]}];}return db[_0x0a9e('0x5d')]['findAll'](_0x2bbdb5);})[_0x0a9e('0x21')](function(_0x52ec10){_0x45108c[_0x0a9e('0x43')]=_0x52ec10;return _0x45108c;});}})[_0x0a9e('0x21')](respondWithFilteredResult(_0x541e80,_0x2bbdb5))[_0x0a9e('0x44')](handleError(_0x541e80,null));};exports[_0x0a9e('0x5e')]=function(_0x842d6f,_0x16341a,_0x16a039){var _0x3a9a85={'raw':!![],'where':{}};var _0x501050={};var _0x329d88={'count':0x0,'rows':[]};return db[_0x0a9e('0x2c')][_0x0a9e('0x57')]({'where':{'id':_0x842d6f[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x16341a,null))[_0x0a9e('0x21')](function(_0x6803d6){if(_0x6803d6){_0x501050[_0x0a9e('0x30')]=_[_0x0a9e('0x32')](db[_0x0a9e('0x5f')][_0x0a9e('0x47')]);_0x501050[_0x0a9e('0x31')]=_[_0x0a9e('0x32')](_0x842d6f['query']);_0x501050[_0x0a9e('0x33')]=_[_0x0a9e('0x35')](_0x501050[_0x0a9e('0x30')],_0x501050[_0x0a9e('0x31')]);_0x3a9a85[_0x0a9e('0x34')]=_['intersection'](_0x501050[_0x0a9e('0x30')],qs[_0x0a9e('0x36')](_0x842d6f['query'][_0x0a9e('0x36')]));_0x3a9a85['attributes']=_0x3a9a85[_0x0a9e('0x34')][_0x0a9e('0x37')]?_0x3a9a85[_0x0a9e('0x34')]:_0x501050[_0x0a9e('0x30')];if(!_0x842d6f['query'][_0x0a9e('0x58')]('nolimit')){_0x3a9a85[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x842d6f['query'][_0x0a9e('0x1a')]);_0x3a9a85[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x842d6f['query']['offset']);}_0x3a9a85[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x842d6f[_0x0a9e('0x31')][_0x0a9e('0x3a')]);_0x3a9a85[_0x0a9e('0x3b')]=qs[_0x0a9e('0x33')](_[_0x0a9e('0x3c')](_0x842d6f[_0x0a9e('0x31')],_0x501050[_0x0a9e('0x33')]));_0x3a9a85['where'][_0x0a9e('0x59')]=_0x6803d6['id'];if(_0x842d6f['query'][_0x0a9e('0x3f')]){_0x3a9a85[_0x0a9e('0x3b')]=_[_0x0a9e('0x3d')](_0x3a9a85[_0x0a9e('0x3b')],{'$or':_[_0x0a9e('0x2b')](_0x3a9a85['attributes'],function(_0x436313){var _0x4667bf={};_0x4667bf[_0x436313]={'$like':'%'+_0x842d6f[_0x0a9e('0x31')][_0x0a9e('0x3f')]+'%'};return _0x4667bf;})});}_0x3a9a85=_[_0x0a9e('0x3d')]({},_0x3a9a85,_0x842d6f['options']);return db['CmHopperFinal'][_0x0a9e('0x18')]({'where':_0x3a9a85['where']})[_0x0a9e('0x21')](function(_0x4658df){_0x329d88[_0x0a9e('0x18')]=_0x4658df;if(_0x842d6f[_0x0a9e('0x31')][_0x0a9e('0x41')]){_0x3a9a85[_0x0a9e('0x42')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x3a9a85);})[_0x0a9e('0x21')](function(_0x5dfbe2){_0x329d88[_0x0a9e('0x43')]=_0x5dfbe2;return _0x329d88;});}})['then'](respondWithFilteredResult(_0x16341a,_0x3a9a85))[_0x0a9e('0x44')](handleError(_0x16341a,null));};exports['getHopperBlacks']=function(_0x558d60,_0x1c49dc,_0xb8db59){var _0x5e9b0b={'raw':!![],'where':{}};var _0x170af6={};var _0x17cb30={'count':0x0,'rows':[]};return db[_0x0a9e('0x2c')][_0x0a9e('0x57')]({'where':{'id':_0x558d60[_0x0a9e('0x46')]['id']}})['then'](handleEntityNotFound(_0x1c49dc,null))['then'](function(_0x16449b){if(_0x16449b){_0x170af6[_0x0a9e('0x30')]=_[_0x0a9e('0x32')](db[_0x0a9e('0x60')][_0x0a9e('0x47')]);_0x170af6['query']=_[_0x0a9e('0x32')](_0x558d60[_0x0a9e('0x31')]);_0x170af6['filters']=_[_0x0a9e('0x35')](_0x170af6[_0x0a9e('0x30')],_0x170af6[_0x0a9e('0x31')]);_0x5e9b0b[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x170af6[_0x0a9e('0x30')],qs[_0x0a9e('0x36')](_0x558d60[_0x0a9e('0x31')][_0x0a9e('0x36')]));_0x5e9b0b[_0x0a9e('0x34')]=_0x5e9b0b['attributes'][_0x0a9e('0x37')]?_0x5e9b0b[_0x0a9e('0x34')]:_0x170af6[_0x0a9e('0x30')];if(!_0x558d60[_0x0a9e('0x31')][_0x0a9e('0x58')]('nolimit')){_0x5e9b0b['limit']=qs[_0x0a9e('0x1a')](_0x558d60[_0x0a9e('0x31')][_0x0a9e('0x1a')]);_0x5e9b0b[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x558d60['query'][_0x0a9e('0x19')]);}_0x5e9b0b[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x558d60['query'][_0x0a9e('0x3a')]);_0x5e9b0b['where']=qs[_0x0a9e('0x33')](_['pick'](_0x558d60[_0x0a9e('0x31')],_0x170af6[_0x0a9e('0x33')]));_0x5e9b0b[_0x0a9e('0x3b')]['CampaignId']=_0x16449b['id'];if(_0x558d60[_0x0a9e('0x31')]['filter']){_0x5e9b0b[_0x0a9e('0x3b')]=_[_0x0a9e('0x3d')](_0x5e9b0b[_0x0a9e('0x3b')],{'$or':_[_0x0a9e('0x2b')](_0x5e9b0b[_0x0a9e('0x34')],function(_0x1bee04){var _0x4014c7={};_0x4014c7[_0x1bee04]={'$like':'%'+_0x558d60[_0x0a9e('0x31')][_0x0a9e('0x3f')]+'%'};return _0x4014c7;})});}_0x5e9b0b=_[_0x0a9e('0x3d')]({},_0x5e9b0b,_0x558d60[_0x0a9e('0x40')]);return db[_0x0a9e('0x60')][_0x0a9e('0x18')]({'where':_0x5e9b0b[_0x0a9e('0x3b')]})[_0x0a9e('0x21')](function(_0x248368){_0x17cb30['count']=_0x248368;if(_0x558d60['query'][_0x0a9e('0x41')]){_0x5e9b0b['include']=[{'all':!![]}];}return db[_0x0a9e('0x60')][_0x0a9e('0x5b')](_0x5e9b0b);})['then'](function(_0x1a3754){_0x17cb30[_0x0a9e('0x43')]=_0x1a3754;return _0x17cb30;});}})[_0x0a9e('0x21')](respondWithFilteredResult(_0x1c49dc,_0x5e9b0b))[_0x0a9e('0x44')](handleError(_0x1c49dc,null));};exports['getLists']=function(_0x148fd9,_0x26cb76,_0x374f0b){var _0x34a791={};var _0x5d0e1f={};var _0x19e9ed;var _0x1a0b08;return db[_0x0a9e('0x2c')]['findOne']({'where':{'id':_0x148fd9[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x26cb76,null))[_0x0a9e('0x21')](function(_0x54b107){if(_0x54b107){_0x19e9ed=_0x54b107;_0x5d0e1f[_0x0a9e('0x30')]=_[_0x0a9e('0x32')](db[_0x0a9e('0x61')][_0x0a9e('0x47')]);_0x5d0e1f[_0x0a9e('0x31')]=_['keys'](_0x148fd9[_0x0a9e('0x31')]);_0x5d0e1f[_0x0a9e('0x33')]=_['intersection'](_0x5d0e1f[_0x0a9e('0x30')],_0x5d0e1f[_0x0a9e('0x31')]);_0x34a791[_0x0a9e('0x34')]=_['intersection'](_0x5d0e1f['model'],qs['fields'](_0x148fd9[_0x0a9e('0x31')][_0x0a9e('0x36')]));_0x34a791['attributes']=_0x34a791[_0x0a9e('0x34')][_0x0a9e('0x37')]?_0x34a791[_0x0a9e('0x34')]:_0x5d0e1f['model'];_0x34a791[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x148fd9[_0x0a9e('0x31')][_0x0a9e('0x3a')]);_0x34a791[_0x0a9e('0x3b')]=qs[_0x0a9e('0x33')](_[_0x0a9e('0x3c')](_0x148fd9[_0x0a9e('0x31')],_0x5d0e1f[_0x0a9e('0x33')]));if(_0x148fd9['query'][_0x0a9e('0x3f')]){_0x34a791['where']=_[_0x0a9e('0x3d')](_0x34a791[_0x0a9e('0x3b')],{'$or':_[_0x0a9e('0x2b')](_0x34a791[_0x0a9e('0x34')],function(_0x407e9d){var _0x344cd4={};_0x344cd4[_0x407e9d]={'$like':'%'+_0x148fd9['query'][_0x0a9e('0x3f')]+'%'};return _0x344cd4;})});}_0x34a791=_[_0x0a9e('0x3d')]({},_0x34a791,_0x148fd9[_0x0a9e('0x40')]);return _0x19e9ed[_0x0a9e('0x62')](_0x34a791);}})['then'](function(_0x2e4887){if(_0x2e4887){_0x1a0b08=_0x2e4887[_0x0a9e('0x37')];if(!_0x148fd9[_0x0a9e('0x31')][_0x0a9e('0x58')](_0x0a9e('0x38'))){_0x34a791[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x148fd9[_0x0a9e('0x31')][_0x0a9e('0x1a')]);_0x34a791[_0x0a9e('0x19')]=qs['offset'](_0x148fd9[_0x0a9e('0x31')][_0x0a9e('0x19')]);}return _0x19e9ed[_0x0a9e('0x62')](_0x34a791);}})[_0x0a9e('0x21')](function(_0xea8bd1){if(_0xea8bd1){return _0xea8bd1?{'count':_0x1a0b08,'rows':_0xea8bd1}:null;}})[_0x0a9e('0x21')](respondWithResult(_0x26cb76,null))[_0x0a9e('0x44')](handleError(_0x26cb76,null));};exports[_0x0a9e('0x63')]=function(_0x566b90,_0x3b581c,_0xd2391){var _0x1a9ef1,_0x5c65fc;return db[_0x0a9e('0x2c')][_0x0a9e('0x48')]({'where':{'id':_0x566b90[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x3b581c,null))[_0x0a9e('0x21')](function(_0x1ba457){if(_0x1ba457){_0x5c65fc=_0x1ba457;return _0x1ba457[_0x0a9e('0x63')](_0x566b90[_0x0a9e('0x4a')][_0x0a9e('0x64')],_[_0x0a9e('0x53')](_0x566b90['body'],[_0x0a9e('0x64'),'id'])||{});}return null;})[_0x0a9e('0x65')](function(_0x15a9ed){var _0x3db98f;_0x1a9ef1=_0x15a9ed||[];var _0x2b624e=[];if(_0x15a9ed){for(var _0x3942fd=0x0;_0x3942fd<_0x15a9ed['length'];_0x3942fd+=0x1){var _0x382687=_0x15a9ed[_0x3942fd]['get']({'plain':!![]});_0x5c65fc['dialCheckDuplicateType']=_0x566b90['body'][_0x0a9e('0x66')]?_0x566b90[_0x0a9e('0x4a')][_0x0a9e('0x66')]:_0x5c65fc[_0x0a9e('0x66')];switch(_0x5c65fc['dialCheckDuplicateType']){case _0x0a9e('0x67'):_0x3db98f=squel[_0x0a9e('0x68')]()[_0x0a9e('0x69')](_0x0a9e('0x6a'))[_0x0a9e('0x6b')](['phone','scheduledAt',_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x59'),'createdAt',_0x0a9e('0x52')],squel[_0x0a9e('0x6e')]()[_0x0a9e('0x6f')]('phone',_0x0a9e('0x70'))[_0x0a9e('0x6f')](_0x0a9e('0x71'),'scheduledAt')[_0x0a9e('0x6f')]('id',_0x0a9e('0x6c'))[_0x0a9e('0x6f')](_0x382687['CmListId']['toString'](),'ListId')[_0x0a9e('0x6f')](_0x566b90[_0x0a9e('0x46')]['id'][_0x0a9e('0x72')](),_0x0a9e('0x59'))['field'](_0x0a9e('0x71'),'createdAt')[_0x0a9e('0x6f')](_0x0a9e('0x71'),_0x0a9e('0x52'))['from'](_0x0a9e('0x73'))[_0x0a9e('0x3b')](_0x0a9e('0x74'))['where'](_0x0a9e('0x75'),_0x382687['CmListId'][_0x0a9e('0x72')]())['where'](_0x0a9e('0x76'))['where'](_0x0a9e('0x77'),squel[_0x0a9e('0x6e')]()[_0x0a9e('0x6f')](_0x0a9e('0x78'))[_0x0a9e('0x79')](_0x0a9e('0x7a'))[_0x0a9e('0x3b')]('CampaignId\x20=\x20?',_0x566b90[_0x0a9e('0x46')]['id'][_0x0a9e('0x72')]()))['where'](_0x0a9e('0x77'),squel[_0x0a9e('0x6e')]()['field'](_0x0a9e('0x7b'))[_0x0a9e('0x79')](_0x0a9e('0x6a'))['where'](_0x0a9e('0x7c'),_0x566b90[_0x0a9e('0x46')]['id'][_0x0a9e('0x72')]())))[_0x0a9e('0x72')]();break;case _0x0a9e('0x7d'):_0x3db98f=squel[_0x0a9e('0x68')]()[_0x0a9e('0x69')](_0x0a9e('0x6a'))[_0x0a9e('0x6b')]([_0x0a9e('0x70'),'scheduledAt',_0x0a9e('0x6c'),'ListId',_0x0a9e('0x59'),_0x0a9e('0x51'),_0x0a9e('0x52')],squel[_0x0a9e('0x6e')]()[_0x0a9e('0x6f')](_0x0a9e('0x70'),'phone')[_0x0a9e('0x6f')](_0x0a9e('0x71'),_0x0a9e('0x7e'))['field']('id',_0x0a9e('0x6c'))[_0x0a9e('0x6f')](_0x382687[_0x0a9e('0x7f')][_0x0a9e('0x72')](),_0x0a9e('0x6d'))[_0x0a9e('0x6f')](_0x566b90[_0x0a9e('0x46')]['id']['toString'](),_0x0a9e('0x59'))[_0x0a9e('0x6f')](_0x0a9e('0x71'),_0x0a9e('0x51'))[_0x0a9e('0x6f')](_0x0a9e('0x71'),_0x0a9e('0x52'))['from']('cm_contacts')[_0x0a9e('0x3b')](_0x0a9e('0x74'))[_0x0a9e('0x3b')](_0x0a9e('0x75'),_0x382687[_0x0a9e('0x7f')][_0x0a9e('0x72')]())[_0x0a9e('0x3b')]('phone\x20IS\x20NOT\x20NULL')[_0x0a9e('0x3b')](_0x0a9e('0x77'),squel[_0x0a9e('0x6e')]()[_0x0a9e('0x6f')](_0x0a9e('0x7b'))[_0x0a9e('0x79')](_0x0a9e('0x6a'))['where'](_0x0a9e('0x7c'),_0x566b90[_0x0a9e('0x46')]['id'][_0x0a9e('0x72')]())))['toString']();break;default:_0x3db98f=squel[_0x0a9e('0x68')]()[_0x0a9e('0x69')](_0x0a9e('0x6a'))[_0x0a9e('0x6b')](['phone',_0x0a9e('0x7e'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x59'),_0x0a9e('0x51'),_0x0a9e('0x52')],squel[_0x0a9e('0x6e')]()[_0x0a9e('0x6f')]('phone',_0x0a9e('0x70'))[_0x0a9e('0x6f')](_0x0a9e('0x71'),_0x0a9e('0x7e'))['field']('id','ContactId')[_0x0a9e('0x6f')](_0x382687[_0x0a9e('0x7f')][_0x0a9e('0x72')](),'ListId')[_0x0a9e('0x6f')](_0x566b90[_0x0a9e('0x46')]['id']['toString'](),_0x0a9e('0x59'))['field'](_0x0a9e('0x71'),'createdAt')['field']('NOW()',_0x0a9e('0x52'))[_0x0a9e('0x79')](_0x0a9e('0x73'))[_0x0a9e('0x3b')](_0x0a9e('0x74'))[_0x0a9e('0x3b')]('ListId\x20=\x20?',_0x382687[_0x0a9e('0x7f')][_0x0a9e('0x72')]())[_0x0a9e('0x3b')](_0x0a9e('0x76')))[_0x0a9e('0x72')]();}_0x2b624e[_0x0a9e('0x80')](db[_0x0a9e('0x81')]['query'](_0x3db98f));}return BPromise['all'](_0x2b624e);}})[_0x0a9e('0x21')](function(){return _0x1a9ef1;})['then'](respondWithResult(_0x3b581c,null))[_0x0a9e('0x44')](handleError(_0x3b581c,null));};exports[_0x0a9e('0x82')]=function(_0x1f0318,_0xa3695f,_0x37a448){return db[_0x0a9e('0x2c')]['find']({'where':{'id':_0x1f0318[_0x0a9e('0x46')]['id']}})['then'](handleEntityNotFound(_0xa3695f,null))['then'](function(_0x504403){if(_0x504403){return _0x504403['removeLists'](_0x1f0318[_0x0a9e('0x31')]['ids']);}})['then'](function(_0x26223f){if(_0x26223f){return db['CmHopper'][_0x0a9e('0x22')]({'where':{'ListId':_0x1f0318[_0x0a9e('0x31')][_0x0a9e('0x64')],'CampaignId':_0x1f0318['params']['id']}})[_0x0a9e('0x21')](function(){return _0x26223f;});}})[_0x0a9e('0x21')](respondWithStatusCode(_0xa3695f,null))[_0x0a9e('0x44')](handleError(_0xa3695f,null));};exports['getBlackLists']=function(_0x5236c9,_0xdc77d,_0x948aab){var _0x89d2cb={};var _0x2f79fb={};var _0x3b0db2;var _0x376b97;return db[_0x0a9e('0x2c')][_0x0a9e('0x57')]({'where':{'id':_0x5236c9[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0xdc77d,null))['then'](function(_0x51fa33){if(_0x51fa33){_0x3b0db2=_0x51fa33;_0x2f79fb['model']=_[_0x0a9e('0x32')](db[_0x0a9e('0x61')][_0x0a9e('0x47')]);_0x2f79fb[_0x0a9e('0x31')]=_[_0x0a9e('0x32')](_0x5236c9[_0x0a9e('0x31')]);_0x2f79fb[_0x0a9e('0x33')]=_[_0x0a9e('0x35')](_0x2f79fb['model'],_0x2f79fb['query']);_0x89d2cb[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x2f79fb['model'],qs[_0x0a9e('0x36')](_0x5236c9[_0x0a9e('0x31')][_0x0a9e('0x36')]));_0x89d2cb[_0x0a9e('0x34')]=_0x89d2cb[_0x0a9e('0x34')][_0x0a9e('0x37')]?_0x89d2cb[_0x0a9e('0x34')]:_0x2f79fb[_0x0a9e('0x30')];_0x89d2cb[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x5236c9[_0x0a9e('0x31')][_0x0a9e('0x3a')]);_0x89d2cb['where']=qs[_0x0a9e('0x33')](_[_0x0a9e('0x3c')](_0x5236c9[_0x0a9e('0x31')],_0x2f79fb[_0x0a9e('0x33')]));if(_0x5236c9[_0x0a9e('0x31')][_0x0a9e('0x3f')]){_0x89d2cb[_0x0a9e('0x3b')]=_[_0x0a9e('0x3d')](_0x89d2cb[_0x0a9e('0x3b')],{'$or':_[_0x0a9e('0x2b')](_0x89d2cb[_0x0a9e('0x34')],function(_0x3ba472){var _0x4e6eb9={};_0x4e6eb9[_0x3ba472]={'$like':'%'+_0x5236c9['query'][_0x0a9e('0x3f')]+'%'};return _0x4e6eb9;})});}_0x89d2cb=_[_0x0a9e('0x3d')]({},_0x89d2cb,_0x5236c9[_0x0a9e('0x40')]);return _0x3b0db2[_0x0a9e('0x83')](_0x89d2cb);}})[_0x0a9e('0x21')](function(_0x1e29e2){if(_0x1e29e2){_0x376b97=_0x1e29e2[_0x0a9e('0x37')];if(!_0x5236c9['query'][_0x0a9e('0x58')]('nolimit')){_0x89d2cb[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x5236c9[_0x0a9e('0x31')][_0x0a9e('0x1a')]);_0x89d2cb[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x5236c9[_0x0a9e('0x31')][_0x0a9e('0x19')]);}return _0x3b0db2[_0x0a9e('0x83')](_0x89d2cb);}})[_0x0a9e('0x21')](function(_0x39d367){if(_0x39d367){return _0x39d367?{'count':_0x376b97,'rows':_0x39d367}:null;}})[_0x0a9e('0x21')](respondWithResult(_0xdc77d,null))[_0x0a9e('0x44')](handleError(_0xdc77d,null));};exports[_0x0a9e('0x84')]=function(_0x3c8a9a,_0x2d5e00,_0x5b78a8){var _0x54cf62,_0x9dc1de;return db[_0x0a9e('0x2c')]['find']({'where':{'id':_0x3c8a9a['params']['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x2d5e00,null))[_0x0a9e('0x21')](function(_0x3304a1){if(_0x3304a1){_0x9dc1de=_0x3304a1;return _0x3304a1['addBlackLists'](_0x3c8a9a[_0x0a9e('0x4a')]['ids'],_[_0x0a9e('0x53')](_0x3c8a9a['body'],[_0x0a9e('0x64'),'id'])||{});}return null;})['spread'](function(_0x122e7d){var _0x21e210;_0x54cf62=_0x122e7d||[];var _0x1d5432=[];if(_0x122e7d){for(var _0x50e7cc=0x0;_0x50e7cc<_0x122e7d[_0x0a9e('0x37')];_0x50e7cc+=0x1){var _0x497fda=_0x122e7d[_0x50e7cc]['get']({'plain':!![]});_0x21e210=squel[_0x0a9e('0x68')]()[_0x0a9e('0x69')](_0x0a9e('0x85'))[_0x0a9e('0x6b')]([_0x0a9e('0x70'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x59'),_0x0a9e('0x51'),_0x0a9e('0x52')],squel[_0x0a9e('0x6e')]()[_0x0a9e('0x6f')](_0x0a9e('0x70'),_0x0a9e('0x70'))[_0x0a9e('0x6f')]('id',_0x0a9e('0x6c'))[_0x0a9e('0x6f')](_0x497fda[_0x0a9e('0x7f')][_0x0a9e('0x72')](),'ListId')[_0x0a9e('0x6f')](_0x3c8a9a[_0x0a9e('0x46')]['id'][_0x0a9e('0x72')](),_0x0a9e('0x59'))['field']('NOW()','createdAt')[_0x0a9e('0x6f')]('NOW()',_0x0a9e('0x52'))[_0x0a9e('0x79')](_0x0a9e('0x73'))[_0x0a9e('0x3b')](_0x0a9e('0x74'))[_0x0a9e('0x3b')](_0x0a9e('0x75'),_0x497fda[_0x0a9e('0x7f')][_0x0a9e('0x72')]())[_0x0a9e('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0x0a9e('0x72')]();_0x1d5432['push'](db[_0x0a9e('0x81')]['query'](_0x21e210));}return BPromise[_0x0a9e('0x86')](_0x1d5432);}})[_0x0a9e('0x21')](function(){return _0x54cf62;})[_0x0a9e('0x21')](respondWithResult(_0x2d5e00,null))['catch'](handleError(_0x2d5e00,null));};exports[_0x0a9e('0x87')]=function(_0x2571ae,_0x531377,_0x53c4f0){return db[_0x0a9e('0x2c')][_0x0a9e('0x48')]({'where':{'id':_0x2571ae[_0x0a9e('0x46')]['id']}})['then'](handleEntityNotFound(_0x531377,null))['then'](function(_0x4869c1){if(_0x4869c1){return _0x4869c1[_0x0a9e('0x87')](_0x2571ae[_0x0a9e('0x31')][_0x0a9e('0x64')]);}})[_0x0a9e('0x21')](function(_0x3d4349){if(_0x3d4349){return db[_0x0a9e('0x60')][_0x0a9e('0x22')]({'where':{'ListId':_0x2571ae[_0x0a9e('0x31')][_0x0a9e('0x64')],'CampaignId':_0x2571ae[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x21')](function(){return _0x3d4349;});}})[_0x0a9e('0x21')](respondWithStatusCode(_0x531377,null))[_0x0a9e('0x44')](handleError(_0x531377,null));};
\ No newline at end of file
+var _0xa9e0=['ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','scheduledAt','CmListId','push','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','all','removeBlackLists','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','error','name','send','index','map','Campaign','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','autoAssociation','update','getHoppers','findOne','hasOwnProperty','CampaignId','CmHopper','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','ContactId','ListId','select','field','phone','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL'];(function(_0x214a03,_0x2e4061){var _0xda476a=function(_0x1c46b2){while(--_0x1c46b2){_0x214a03['push'](_0x214a03['shift']());}};_0xda476a(++_0x2e4061);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var fs_extra=require(_0x0a9e('0xa'));var _=require(_0x0a9e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0a9e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0a9e('0xd'));var Papa=require(_0x0a9e('0xe'));var Redis=require(_0x0a9e('0xf'));var authService=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var as=require(_0x0a9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0a9e('0x13'));var licenseUtil=require(_0x0a9e('0x14'));var db=require(_0x0a9e('0x15'))['db'];function respondWithStatusCode(_0x26d672,_0x32d742){_0x32d742=_0x32d742||0xcc;return function(_0x69aeb7){if(_0x69aeb7){return _0x26d672['sendStatus'](_0x32d742);}return _0x26d672[_0x0a9e('0x16')](_0x32d742)[_0x0a9e('0x17')]();};}function respondWithResult(_0x2b4227,_0x281129){_0x281129=_0x281129||0xc8;return function(_0x44dcfd){if(_0x44dcfd){return _0x2b4227[_0x0a9e('0x16')](_0x281129)['json'](_0x44dcfd);}};}function respondWithFilteredResult(_0x22dccb,_0x5d0880){return function(_0x1985b6){if(_0x1985b6){var _0x519dfd=_0x1985b6[_0x0a9e('0x18')],_0x16033c=_0x5d0880['offset'],_0x12066b=_0x5d0880[_0x0a9e('0x19')]+_0x5d0880[_0x0a9e('0x1a')],_0x48f32d;if(_0x12066b>=_0x519dfd){_0x12066b=_0x519dfd;_0x48f32d=0xc8;}else{_0x48f32d=0xce;}_0x22dccb[_0x0a9e('0x16')](_0x48f32d);return _0x22dccb[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x16033c+'-'+_0x12066b+'/'+_0x519dfd)[_0x0a9e('0x1d')](_0x1985b6);}return null;};}function patchUpdates(_0x530eb7){return function(_0x20559e){try{jsonpatch[_0x0a9e('0x1e')](_0x20559e,_0x530eb7,!![]);}catch(_0x112016){return BPromise[_0x0a9e('0x1f')](_0x112016);}return _0x20559e[_0x0a9e('0x20')]();};}function saveUpdates(_0x4bb1e3,_0x2c3407){return function(_0x155cce){if(_0x155cce){return _0x155cce['update'](_0x4bb1e3)[_0x0a9e('0x21')](function(_0x5a09ef){return _0x5a09ef;});}return null;};}function removeEntity(_0x588269,_0x3a02e1){return function(_0x432e56){if(_0x432e56){return _0x432e56[_0x0a9e('0x22')]()[_0x0a9e('0x21')](function(){var _0x4abc77=_0x432e56[_0x0a9e('0x23')]({'plain':!![]});var _0x2fb0e4=_0x0a9e('0x24');return db[_0x0a9e('0x25')][_0x0a9e('0x22')]({'where':{'type':_0x2fb0e4,'resourceId':_0x4abc77['id']}})[_0x0a9e('0x21')](function(){return _0x432e56;});})[_0x0a9e('0x21')](function(){_0x588269['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x197ec0,_0x3a8e58){return function(_0x40c424){if(!_0x40c424){_0x197ec0[_0x0a9e('0x26')](0x194);}return _0x40c424;};}function handleError(_0x526cf3,_0x384319){_0x384319=_0x384319||0x1f4;return function(_0x479bc4){logger[_0x0a9e('0x27')](_0x479bc4['stack']);if(_0x479bc4[_0x0a9e('0x28')]){delete _0x479bc4[_0x0a9e('0x28')];}_0x526cf3[_0x0a9e('0x16')](_0x384319)[_0x0a9e('0x29')](_0x479bc4);};}exports[_0x0a9e('0x2a')]=function(_0x1538a4,_0x11c3b6){var _0x14de77={},_0x5a101a={},_0x3652a7={'count':0x0,'rows':[]};var _0x468813=_[_0x0a9e('0x2b')](db[_0x0a9e('0x2c')]['rawAttributes'],function(_0x15b200){return{'name':_0x15b200[_0x0a9e('0x2d')],'type':_0x15b200[_0x0a9e('0x2e')][_0x0a9e('0x2f')]};});_0x5a101a[_0x0a9e('0x30')]=_[_0x0a9e('0x2b')](_0x468813,_0x0a9e('0x28'));_0x5a101a[_0x0a9e('0x31')]=_[_0x0a9e('0x32')](_0x1538a4['query']);_0x5a101a[_0x0a9e('0x33')]=_['intersection'](_0x5a101a[_0x0a9e('0x30')],_0x5a101a[_0x0a9e('0x31')]);_0x14de77[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x5a101a[_0x0a9e('0x30')],qs['fields'](_0x1538a4[_0x0a9e('0x31')][_0x0a9e('0x36')]));_0x14de77[_0x0a9e('0x34')]=_0x14de77[_0x0a9e('0x34')][_0x0a9e('0x37')]?_0x14de77[_0x0a9e('0x34')]:_0x5a101a[_0x0a9e('0x30')];if(!_0x1538a4[_0x0a9e('0x31')]['hasOwnProperty'](_0x0a9e('0x38'))){_0x14de77['limit']=qs[_0x0a9e('0x1a')](_0x1538a4[_0x0a9e('0x31')][_0x0a9e('0x1a')]);_0x14de77[_0x0a9e('0x19')]=qs['offset'](_0x1538a4[_0x0a9e('0x31')][_0x0a9e('0x19')]);}_0x14de77[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x1538a4['query']['sort']);_0x14de77[_0x0a9e('0x3b')]=qs['filters'](_[_0x0a9e('0x3c')](_0x1538a4[_0x0a9e('0x31')],_0x5a101a[_0x0a9e('0x33')]),_0x468813);if(_0x1538a4[_0x0a9e('0x31')]['filter']){_0x14de77[_0x0a9e('0x3b')]=_[_0x0a9e('0x3d')](_0x14de77[_0x0a9e('0x3b')],{'$or':_['map'](_0x468813,function(_0x1dbf74){if(_0x1dbf74[_0x0a9e('0x2e')]!==_0x0a9e('0x3e')){var _0x4c1c0e={};_0x4c1c0e[_0x1dbf74['name']]={'$like':'%'+_0x1538a4[_0x0a9e('0x31')][_0x0a9e('0x3f')]+'%'};return _0x4c1c0e;}})});}_0x14de77=_['merge']({},_0x14de77,_0x1538a4[_0x0a9e('0x40')]);var _0x419125={'where':_0x14de77[_0x0a9e('0x3b')]};return db[_0x0a9e('0x2c')]['count'](_0x419125)['then'](function(_0x15e37d){_0x3652a7[_0x0a9e('0x18')]=_0x15e37d;if(_0x1538a4['query'][_0x0a9e('0x41')]){_0x14de77[_0x0a9e('0x42')]=[{'all':!![]}];}return db[_0x0a9e('0x2c')]['findAll'](_0x14de77);})[_0x0a9e('0x21')](function(_0x2cfea9){_0x3652a7[_0x0a9e('0x43')]=_0x2cfea9;return _0x3652a7;})[_0x0a9e('0x21')](respondWithFilteredResult(_0x11c3b6,_0x14de77))[_0x0a9e('0x44')](handleError(_0x11c3b6,null));};exports[_0x0a9e('0x45')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':![],'where':{'id':_0x2881b3[_0x0a9e('0x46')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x30')]=_[_0x0a9e('0x32')](db[_0x0a9e('0x2c')][_0x0a9e('0x47')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x31')]);_0x3da2cd[_0x0a9e('0x33')]=_[_0x0a9e('0x35')](_0x3da2cd[_0x0a9e('0x30')],_0x3da2cd[_0x0a9e('0x31')]);_0x23b089[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x3da2cd[_0x0a9e('0x30')],qs[_0x0a9e('0x36')](_0x2881b3[_0x0a9e('0x31')][_0x0a9e('0x36')]));_0x23b089[_0x0a9e('0x34')]=_0x23b089['attributes'][_0x0a9e('0x37')]?_0x23b089[_0x0a9e('0x34')]:_0x3da2cd[_0x0a9e('0x30')];if(_0x2881b3[_0x0a9e('0x31')][_0x0a9e('0x41')]){_0x23b089[_0x0a9e('0x42')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x3d')]({},_0x23b089,_0x2881b3[_0x0a9e('0x40')]);return db['Campaign'][_0x0a9e('0x48')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x21')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x44')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x49')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2c')][_0x0a9e('0x49')](_0x562fb4[_0x0a9e('0x4a')],{})[_0x0a9e('0x21')](function(_0x37be73){var _0x45bf7f=_0x562fb4['user'][_0x0a9e('0x23')]({'plain':!![]});if(!_0x45bf7f)throw new Error(_0x0a9e('0x4b'));if(_0x45bf7f[_0x0a9e('0x4c')]===_0x0a9e('0x4d')){var _0x409789=_0x37be73[_0x0a9e('0x23')]({'plain':!![]});var _0x6054ee=_0x0a9e('0x24');return db[_0x0a9e('0x4e')]['find']({'where':{'name':_0x6054ee,'userProfileId':_0x45bf7f[_0x0a9e('0x4f')]},'raw':!![]})[_0x0a9e('0x21')](function(_0x4f7240){if(_0x4f7240&&_0x4f7240['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x49')]({'name':_0x409789[_0x0a9e('0x28')],'resourceId':_0x409789['id'],'type':_0x4f7240[_0x0a9e('0x28')],'sectionId':_0x4f7240['id']},{})[_0x0a9e('0x21')](function(){return _0x37be73;});}else{return _0x37be73;}})[_0x0a9e('0x44')](function(_0x30decb){logger[_0x0a9e('0x27')](_0x0a9e('0x50'),_0x30decb);throw _0x30decb;});}return _0x37be73;})['then'](respondWithResult(_0x14bec2,0xc9))['catch'](handleError(_0x14bec2,null));};exports['clone']=function(_0x39d77d,_0x204173){var _0x14d602={'where':{'id':_0x39d77d[_0x0a9e('0x46')]['id']}},_0x5bb3ed={};_0x5bb3ed[_0x0a9e('0x30')]=_['keys'](db['Campaign'][_0x0a9e('0x47')]);_0x14d602['attributes']=_[_0x0a9e('0x35')](_0x5bb3ed['model'],qs[_0x0a9e('0x36')](_0x39d77d[_0x0a9e('0x31')][_0x0a9e('0x36')]));_0x14d602['attributes']=_0x14d602[_0x0a9e('0x34')][_0x0a9e('0x37')]?_0x14d602['attributes']:_0x5bb3ed['model'];if(_0x39d77d[_0x0a9e('0x31')][_0x0a9e('0x41')]){_0x14d602['include']=[{'all':!![]}];}_0x14d602=_[_0x0a9e('0x3d')]({},_0x14d602,_0x39d77d['options']);return db[_0x0a9e('0x2c')]['find'](_0x14d602)[_0x0a9e('0x21')](handleEntityNotFound(_0x204173,null))['then'](function(_0x5da27d){if(_0x5da27d){var _0x5df0ad=_0x5da27d[_0x0a9e('0x23')]({'plain':!![]});_0x5df0ad=qs['omit'](_0x5df0ad,['id',_0x0a9e('0x51'),_0x0a9e('0x52')]);_0x39d77d[_0x0a9e('0x4a')]=_[_0x0a9e('0x53')](_0x39d77d[_0x0a9e('0x4a')],['id',_0x0a9e('0x51'),_0x0a9e('0x52')]);return db[_0x0a9e('0x2c')]['create'](_[_0x0a9e('0x3d')](_0x5df0ad,_0x39d77d[_0x0a9e('0x4a')]),{'include':_0x39d77d[_0x0a9e('0x31')][_0x0a9e('0x41')]?[{'all':!![]}]:undefined})[_0x0a9e('0x21')](function(_0x156662){var _0x5d86e9=_0x39d77d[_0x0a9e('0x4d')][_0x0a9e('0x23')]({'plain':!![]});if(!_0x5d86e9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d86e9[_0x0a9e('0x4c')]==='user'){var _0x20c668=_0x156662['get']({'plain':!![]});var _0x4b3c1a='IvrCampaigns';return db[_0x0a9e('0x4e')]['find']({'where':{'name':_0x4b3c1a,'userProfileId':_0x5d86e9[_0x0a9e('0x4f')]},'raw':!![]})[_0x0a9e('0x21')](function(_0x261adb){if(_0x261adb&&_0x261adb[_0x0a9e('0x54')]===0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x49')]({'name':_0x20c668['name'],'resourceId':_0x20c668['id'],'type':_0x261adb[_0x0a9e('0x28')],'sectionId':_0x261adb['id']},{})['then'](function(){return _0x156662;});}else{return _0x156662;}})[_0x0a9e('0x44')](function(_0x1f07cb){logger[_0x0a9e('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f07cb);throw _0x1f07cb;});}return _0x156662;});}})[_0x0a9e('0x21')](respondWithResult(_0x204173,0xc9))[_0x0a9e('0x44')](handleError(_0x204173,null));};exports[_0x0a9e('0x55')]=function(_0x32e134,_0x497d91){if(_0x32e134[_0x0a9e('0x4a')]['id']){delete _0x32e134[_0x0a9e('0x4a')]['id'];}return db['Campaign'][_0x0a9e('0x48')]({'where':{'id':_0x32e134[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x497d91,null))[_0x0a9e('0x21')](saveUpdates(_0x32e134[_0x0a9e('0x4a')],null))['then'](respondWithResult(_0x497d91,null))[_0x0a9e('0x44')](handleError(_0x497d91,null));};exports[_0x0a9e('0x22')]=function(_0x281c7d,_0x47bb43){return db[_0x0a9e('0x2c')]['find']({'where':{'id':_0x281c7d['params']['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x47bb43,null))[_0x0a9e('0x21')](removeEntity(_0x47bb43,null))[_0x0a9e('0x44')](handleError(_0x47bb43,null));};exports[_0x0a9e('0x56')]=function(_0x186f39,_0xc8c264,_0x387489){var _0x54a37d={'raw':!![],'where':{}};var _0x2d7205={};var _0x1cc4f3={'count':0x0,'rows':[]};return db[_0x0a9e('0x2c')][_0x0a9e('0x57')]({'where':{'id':_0x186f39[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0xc8c264,null))[_0x0a9e('0x21')](function(_0x412a72){if(_0x412a72){_0x2d7205[_0x0a9e('0x30')]=_[_0x0a9e('0x32')](db['CmHopper'][_0x0a9e('0x47')]);_0x2d7205[_0x0a9e('0x31')]=_[_0x0a9e('0x32')](_0x186f39['query']);_0x2d7205[_0x0a9e('0x33')]=_[_0x0a9e('0x35')](_0x2d7205['model'],_0x2d7205[_0x0a9e('0x31')]);_0x54a37d[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x2d7205[_0x0a9e('0x30')],qs[_0x0a9e('0x36')](_0x186f39['query']['fields']));_0x54a37d['attributes']=_0x54a37d[_0x0a9e('0x34')][_0x0a9e('0x37')]?_0x54a37d[_0x0a9e('0x34')]:_0x2d7205[_0x0a9e('0x30')];if(!_0x186f39[_0x0a9e('0x31')][_0x0a9e('0x58')](_0x0a9e('0x38'))){_0x54a37d[_0x0a9e('0x1a')]=qs['limit'](_0x186f39[_0x0a9e('0x31')][_0x0a9e('0x1a')]);_0x54a37d[_0x0a9e('0x19')]=qs['offset'](_0x186f39[_0x0a9e('0x31')]['offset']);}_0x54a37d[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x186f39['query'][_0x0a9e('0x3a')]);_0x54a37d[_0x0a9e('0x3b')]=qs[_0x0a9e('0x33')](_[_0x0a9e('0x3c')](_0x186f39['query'],_0x2d7205[_0x0a9e('0x33')]));_0x54a37d[_0x0a9e('0x3b')][_0x0a9e('0x59')]=_0x412a72['id'];if(_0x186f39[_0x0a9e('0x31')]['filter']){_0x54a37d[_0x0a9e('0x3b')]=_[_0x0a9e('0x3d')](_0x54a37d[_0x0a9e('0x3b')],{'$or':_[_0x0a9e('0x2b')](_0x54a37d['attributes'],function(_0x290d43){var _0x3511c9={};_0x3511c9[_0x290d43]={'$like':'%'+_0x186f39[_0x0a9e('0x31')][_0x0a9e('0x3f')]+'%'};return _0x3511c9;})});}_0x54a37d=_[_0x0a9e('0x3d')]({},_0x54a37d,_0x186f39[_0x0a9e('0x40')]);return db[_0x0a9e('0x5a')][_0x0a9e('0x18')]({'where':_0x54a37d[_0x0a9e('0x3b')]})[_0x0a9e('0x21')](function(_0xc4c230){_0x1cc4f3[_0x0a9e('0x18')]=_0xc4c230;if(_0x186f39[_0x0a9e('0x31')][_0x0a9e('0x41')]){_0x54a37d['include']=[{'all':!![]}];}return db[_0x0a9e('0x5a')][_0x0a9e('0x5b')](_0x54a37d);})[_0x0a9e('0x21')](function(_0x563627){_0x1cc4f3[_0x0a9e('0x43')]=_0x563627;return _0x1cc4f3;});}})[_0x0a9e('0x21')](respondWithFilteredResult(_0xc8c264,_0x54a37d))[_0x0a9e('0x44')](handleError(_0xc8c264,null));};exports[_0x0a9e('0x5c')]=function(_0x56d650,_0x541e80,_0x7ebea8){var _0x2bbdb5={'raw':!![],'where':{}};var _0x4c54fa={};var _0x45108c={'count':0x0,'rows':[]};return db['Campaign'][_0x0a9e('0x57')]({'where':{'id':_0x56d650[_0x0a9e('0x46')]['id']}})['then'](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x21')](function(_0x41cf12){if(_0x41cf12){_0x4c54fa[_0x0a9e('0x30')]=_[_0x0a9e('0x32')](db[_0x0a9e('0x5d')][_0x0a9e('0x47')]);_0x4c54fa[_0x0a9e('0x31')]=_['keys'](_0x56d650[_0x0a9e('0x31')]);_0x4c54fa[_0x0a9e('0x33')]=_[_0x0a9e('0x35')](_0x4c54fa[_0x0a9e('0x30')],_0x4c54fa['query']);_0x2bbdb5[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x4c54fa['model'],qs[_0x0a9e('0x36')](_0x56d650['query'][_0x0a9e('0x36')]));_0x2bbdb5[_0x0a9e('0x34')]=_0x2bbdb5[_0x0a9e('0x34')][_0x0a9e('0x37')]?_0x2bbdb5['attributes']:_0x4c54fa['model'];if(!_0x56d650[_0x0a9e('0x31')][_0x0a9e('0x58')](_0x0a9e('0x38'))){_0x2bbdb5['limit']=qs[_0x0a9e('0x1a')](_0x56d650[_0x0a9e('0x31')]['limit']);_0x2bbdb5['offset']=qs[_0x0a9e('0x19')](_0x56d650['query']['offset']);}_0x2bbdb5['order']=qs[_0x0a9e('0x3a')](_0x56d650[_0x0a9e('0x31')][_0x0a9e('0x3a')]);_0x2bbdb5[_0x0a9e('0x3b')]=qs[_0x0a9e('0x33')](_[_0x0a9e('0x3c')](_0x56d650['query'],_0x4c54fa[_0x0a9e('0x33')]));_0x2bbdb5['where'][_0x0a9e('0x59')]=_0x41cf12['id'];if(_0x56d650[_0x0a9e('0x31')][_0x0a9e('0x3f')]){_0x2bbdb5[_0x0a9e('0x3b')]=_['merge'](_0x2bbdb5[_0x0a9e('0x3b')],{'$or':_[_0x0a9e('0x2b')](_0x2bbdb5[_0x0a9e('0x34')],function(_0x5b74c3){var _0xb6e411={};_0xb6e411[_0x5b74c3]={'$like':'%'+_0x56d650[_0x0a9e('0x31')][_0x0a9e('0x3f')]+'%'};return _0xb6e411;})});}_0x2bbdb5=_[_0x0a9e('0x3d')]({},_0x2bbdb5,_0x56d650[_0x0a9e('0x40')]);return db[_0x0a9e('0x5d')][_0x0a9e('0x18')]({'where':_0x2bbdb5[_0x0a9e('0x3b')]})['then'](function(_0x2645d6){_0x45108c[_0x0a9e('0x18')]=_0x2645d6;if(_0x56d650['query'][_0x0a9e('0x41')]){_0x2bbdb5[_0x0a9e('0x42')]=[{'all':!![]}];}return db[_0x0a9e('0x5d')]['findAll'](_0x2bbdb5);})[_0x0a9e('0x21')](function(_0x52ec10){_0x45108c[_0x0a9e('0x43')]=_0x52ec10;return _0x45108c;});}})[_0x0a9e('0x21')](respondWithFilteredResult(_0x541e80,_0x2bbdb5))[_0x0a9e('0x44')](handleError(_0x541e80,null));};exports[_0x0a9e('0x5e')]=function(_0x842d6f,_0x16341a,_0x16a039){var _0x3a9a85={'raw':!![],'where':{}};var _0x501050={};var _0x329d88={'count':0x0,'rows':[]};return db[_0x0a9e('0x2c')][_0x0a9e('0x57')]({'where':{'id':_0x842d6f[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x16341a,null))[_0x0a9e('0x21')](function(_0x6803d6){if(_0x6803d6){_0x501050[_0x0a9e('0x30')]=_[_0x0a9e('0x32')](db[_0x0a9e('0x5f')][_0x0a9e('0x47')]);_0x501050[_0x0a9e('0x31')]=_[_0x0a9e('0x32')](_0x842d6f['query']);_0x501050[_0x0a9e('0x33')]=_[_0x0a9e('0x35')](_0x501050[_0x0a9e('0x30')],_0x501050[_0x0a9e('0x31')]);_0x3a9a85[_0x0a9e('0x34')]=_['intersection'](_0x501050[_0x0a9e('0x30')],qs[_0x0a9e('0x36')](_0x842d6f['query'][_0x0a9e('0x36')]));_0x3a9a85['attributes']=_0x3a9a85[_0x0a9e('0x34')][_0x0a9e('0x37')]?_0x3a9a85[_0x0a9e('0x34')]:_0x501050[_0x0a9e('0x30')];if(!_0x842d6f['query'][_0x0a9e('0x58')]('nolimit')){_0x3a9a85[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x842d6f['query'][_0x0a9e('0x1a')]);_0x3a9a85[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x842d6f['query']['offset']);}_0x3a9a85[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x842d6f[_0x0a9e('0x31')][_0x0a9e('0x3a')]);_0x3a9a85[_0x0a9e('0x3b')]=qs[_0x0a9e('0x33')](_[_0x0a9e('0x3c')](_0x842d6f[_0x0a9e('0x31')],_0x501050[_0x0a9e('0x33')]));_0x3a9a85['where'][_0x0a9e('0x59')]=_0x6803d6['id'];if(_0x842d6f['query'][_0x0a9e('0x3f')]){_0x3a9a85[_0x0a9e('0x3b')]=_[_0x0a9e('0x3d')](_0x3a9a85[_0x0a9e('0x3b')],{'$or':_[_0x0a9e('0x2b')](_0x3a9a85['attributes'],function(_0x436313){var _0x4667bf={};_0x4667bf[_0x436313]={'$like':'%'+_0x842d6f[_0x0a9e('0x31')][_0x0a9e('0x3f')]+'%'};return _0x4667bf;})});}_0x3a9a85=_[_0x0a9e('0x3d')]({},_0x3a9a85,_0x842d6f['options']);return db['CmHopperFinal'][_0x0a9e('0x18')]({'where':_0x3a9a85['where']})[_0x0a9e('0x21')](function(_0x4658df){_0x329d88[_0x0a9e('0x18')]=_0x4658df;if(_0x842d6f[_0x0a9e('0x31')][_0x0a9e('0x41')]){_0x3a9a85[_0x0a9e('0x42')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x3a9a85);})[_0x0a9e('0x21')](function(_0x5dfbe2){_0x329d88[_0x0a9e('0x43')]=_0x5dfbe2;return _0x329d88;});}})['then'](respondWithFilteredResult(_0x16341a,_0x3a9a85))[_0x0a9e('0x44')](handleError(_0x16341a,null));};exports['getHopperBlacks']=function(_0x558d60,_0x1c49dc,_0xb8db59){var _0x5e9b0b={'raw':!![],'where':{}};var _0x170af6={};var _0x17cb30={'count':0x0,'rows':[]};return db[_0x0a9e('0x2c')][_0x0a9e('0x57')]({'where':{'id':_0x558d60[_0x0a9e('0x46')]['id']}})['then'](handleEntityNotFound(_0x1c49dc,null))['then'](function(_0x16449b){if(_0x16449b){_0x170af6[_0x0a9e('0x30')]=_[_0x0a9e('0x32')](db[_0x0a9e('0x60')][_0x0a9e('0x47')]);_0x170af6['query']=_[_0x0a9e('0x32')](_0x558d60[_0x0a9e('0x31')]);_0x170af6['filters']=_[_0x0a9e('0x35')](_0x170af6[_0x0a9e('0x30')],_0x170af6[_0x0a9e('0x31')]);_0x5e9b0b[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x170af6[_0x0a9e('0x30')],qs[_0x0a9e('0x36')](_0x558d60[_0x0a9e('0x31')][_0x0a9e('0x36')]));_0x5e9b0b[_0x0a9e('0x34')]=_0x5e9b0b['attributes'][_0x0a9e('0x37')]?_0x5e9b0b[_0x0a9e('0x34')]:_0x170af6[_0x0a9e('0x30')];if(!_0x558d60[_0x0a9e('0x31')][_0x0a9e('0x58')]('nolimit')){_0x5e9b0b['limit']=qs[_0x0a9e('0x1a')](_0x558d60[_0x0a9e('0x31')][_0x0a9e('0x1a')]);_0x5e9b0b[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x558d60['query'][_0x0a9e('0x19')]);}_0x5e9b0b[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x558d60['query'][_0x0a9e('0x3a')]);_0x5e9b0b['where']=qs[_0x0a9e('0x33')](_['pick'](_0x558d60[_0x0a9e('0x31')],_0x170af6[_0x0a9e('0x33')]));_0x5e9b0b[_0x0a9e('0x3b')]['CampaignId']=_0x16449b['id'];if(_0x558d60[_0x0a9e('0x31')]['filter']){_0x5e9b0b[_0x0a9e('0x3b')]=_[_0x0a9e('0x3d')](_0x5e9b0b[_0x0a9e('0x3b')],{'$or':_[_0x0a9e('0x2b')](_0x5e9b0b[_0x0a9e('0x34')],function(_0x1bee04){var _0x4014c7={};_0x4014c7[_0x1bee04]={'$like':'%'+_0x558d60[_0x0a9e('0x31')][_0x0a9e('0x3f')]+'%'};return _0x4014c7;})});}_0x5e9b0b=_[_0x0a9e('0x3d')]({},_0x5e9b0b,_0x558d60[_0x0a9e('0x40')]);return db[_0x0a9e('0x60')][_0x0a9e('0x18')]({'where':_0x5e9b0b[_0x0a9e('0x3b')]})[_0x0a9e('0x21')](function(_0x248368){_0x17cb30['count']=_0x248368;if(_0x558d60['query'][_0x0a9e('0x41')]){_0x5e9b0b['include']=[{'all':!![]}];}return db[_0x0a9e('0x60')][_0x0a9e('0x5b')](_0x5e9b0b);})['then'](function(_0x1a3754){_0x17cb30[_0x0a9e('0x43')]=_0x1a3754;return _0x17cb30;});}})[_0x0a9e('0x21')](respondWithFilteredResult(_0x1c49dc,_0x5e9b0b))[_0x0a9e('0x44')](handleError(_0x1c49dc,null));};exports['getLists']=function(_0x148fd9,_0x26cb76,_0x374f0b){var _0x34a791={};var _0x5d0e1f={};var _0x19e9ed;var _0x1a0b08;return db[_0x0a9e('0x2c')]['findOne']({'where':{'id':_0x148fd9[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x26cb76,null))[_0x0a9e('0x21')](function(_0x54b107){if(_0x54b107){_0x19e9ed=_0x54b107;_0x5d0e1f[_0x0a9e('0x30')]=_[_0x0a9e('0x32')](db[_0x0a9e('0x61')][_0x0a9e('0x47')]);_0x5d0e1f[_0x0a9e('0x31')]=_['keys'](_0x148fd9[_0x0a9e('0x31')]);_0x5d0e1f[_0x0a9e('0x33')]=_['intersection'](_0x5d0e1f[_0x0a9e('0x30')],_0x5d0e1f[_0x0a9e('0x31')]);_0x34a791[_0x0a9e('0x34')]=_['intersection'](_0x5d0e1f['model'],qs['fields'](_0x148fd9[_0x0a9e('0x31')][_0x0a9e('0x36')]));_0x34a791['attributes']=_0x34a791[_0x0a9e('0x34')][_0x0a9e('0x37')]?_0x34a791[_0x0a9e('0x34')]:_0x5d0e1f['model'];_0x34a791[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x148fd9[_0x0a9e('0x31')][_0x0a9e('0x3a')]);_0x34a791[_0x0a9e('0x3b')]=qs[_0x0a9e('0x33')](_[_0x0a9e('0x3c')](_0x148fd9[_0x0a9e('0x31')],_0x5d0e1f[_0x0a9e('0x33')]));if(_0x148fd9['query'][_0x0a9e('0x3f')]){_0x34a791['where']=_[_0x0a9e('0x3d')](_0x34a791[_0x0a9e('0x3b')],{'$or':_[_0x0a9e('0x2b')](_0x34a791[_0x0a9e('0x34')],function(_0x407e9d){var _0x344cd4={};_0x344cd4[_0x407e9d]={'$like':'%'+_0x148fd9['query'][_0x0a9e('0x3f')]+'%'};return _0x344cd4;})});}_0x34a791=_[_0x0a9e('0x3d')]({},_0x34a791,_0x148fd9[_0x0a9e('0x40')]);return _0x19e9ed[_0x0a9e('0x62')](_0x34a791);}})['then'](function(_0x2e4887){if(_0x2e4887){_0x1a0b08=_0x2e4887[_0x0a9e('0x37')];if(!_0x148fd9[_0x0a9e('0x31')][_0x0a9e('0x58')](_0x0a9e('0x38'))){_0x34a791[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x148fd9[_0x0a9e('0x31')][_0x0a9e('0x1a')]);_0x34a791[_0x0a9e('0x19')]=qs['offset'](_0x148fd9[_0x0a9e('0x31')][_0x0a9e('0x19')]);}return _0x19e9ed[_0x0a9e('0x62')](_0x34a791);}})[_0x0a9e('0x21')](function(_0xea8bd1){if(_0xea8bd1){return _0xea8bd1?{'count':_0x1a0b08,'rows':_0xea8bd1}:null;}})[_0x0a9e('0x21')](respondWithResult(_0x26cb76,null))[_0x0a9e('0x44')](handleError(_0x26cb76,null));};exports[_0x0a9e('0x63')]=function(_0x566b90,_0x3b581c,_0xd2391){var _0x1a9ef1,_0x5c65fc;return db[_0x0a9e('0x2c')][_0x0a9e('0x48')]({'where':{'id':_0x566b90[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x3b581c,null))[_0x0a9e('0x21')](function(_0x1ba457){if(_0x1ba457){_0x5c65fc=_0x1ba457;return _0x1ba457[_0x0a9e('0x63')](_0x566b90[_0x0a9e('0x4a')][_0x0a9e('0x64')],_[_0x0a9e('0x53')](_0x566b90['body'],[_0x0a9e('0x64'),'id'])||{});}return null;})[_0x0a9e('0x65')](function(_0x15a9ed){var _0x3db98f;_0x1a9ef1=_0x15a9ed||[];var _0x2b624e=[];if(_0x15a9ed){for(var _0x3942fd=0x0;_0x3942fd<_0x15a9ed['length'];_0x3942fd+=0x1){var _0x382687=_0x15a9ed[_0x3942fd]['get']({'plain':!![]});_0x5c65fc['dialCheckDuplicateType']=_0x566b90['body'][_0x0a9e('0x66')]?_0x566b90[_0x0a9e('0x4a')][_0x0a9e('0x66')]:_0x5c65fc[_0x0a9e('0x66')];switch(_0x5c65fc['dialCheckDuplicateType']){case _0x0a9e('0x67'):_0x3db98f=squel[_0x0a9e('0x68')]()[_0x0a9e('0x69')](_0x0a9e('0x6a'))[_0x0a9e('0x6b')](['phone','scheduledAt',_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x59'),'createdAt',_0x0a9e('0x52')],squel[_0x0a9e('0x6e')]()[_0x0a9e('0x6f')]('phone',_0x0a9e('0x70'))[_0x0a9e('0x6f')](_0x0a9e('0x71'),'scheduledAt')[_0x0a9e('0x6f')]('id',_0x0a9e('0x6c'))[_0x0a9e('0x6f')](_0x382687['CmListId']['toString'](),'ListId')[_0x0a9e('0x6f')](_0x566b90[_0x0a9e('0x46')]['id'][_0x0a9e('0x72')](),_0x0a9e('0x59'))['field'](_0x0a9e('0x71'),'createdAt')[_0x0a9e('0x6f')](_0x0a9e('0x71'),_0x0a9e('0x52'))['from'](_0x0a9e('0x73'))[_0x0a9e('0x3b')](_0x0a9e('0x74'))['where'](_0x0a9e('0x75'),_0x382687['CmListId'][_0x0a9e('0x72')]())['where'](_0x0a9e('0x76'))['where'](_0x0a9e('0x77'),squel[_0x0a9e('0x6e')]()[_0x0a9e('0x6f')](_0x0a9e('0x78'))[_0x0a9e('0x79')](_0x0a9e('0x7a'))[_0x0a9e('0x3b')]('CampaignId\x20=\x20?',_0x566b90[_0x0a9e('0x46')]['id'][_0x0a9e('0x72')]()))['where'](_0x0a9e('0x77'),squel[_0x0a9e('0x6e')]()['field'](_0x0a9e('0x7b'))[_0x0a9e('0x79')](_0x0a9e('0x6a'))['where'](_0x0a9e('0x7c'),_0x566b90[_0x0a9e('0x46')]['id'][_0x0a9e('0x72')]())))[_0x0a9e('0x72')]();break;case _0x0a9e('0x7d'):_0x3db98f=squel[_0x0a9e('0x68')]()[_0x0a9e('0x69')](_0x0a9e('0x6a'))[_0x0a9e('0x6b')]([_0x0a9e('0x70'),'scheduledAt',_0x0a9e('0x6c'),'ListId',_0x0a9e('0x59'),_0x0a9e('0x51'),_0x0a9e('0x52')],squel[_0x0a9e('0x6e')]()[_0x0a9e('0x6f')](_0x0a9e('0x70'),'phone')[_0x0a9e('0x6f')](_0x0a9e('0x71'),_0x0a9e('0x7e'))['field']('id',_0x0a9e('0x6c'))[_0x0a9e('0x6f')](_0x382687[_0x0a9e('0x7f')][_0x0a9e('0x72')](),_0x0a9e('0x6d'))[_0x0a9e('0x6f')](_0x566b90[_0x0a9e('0x46')]['id']['toString'](),_0x0a9e('0x59'))[_0x0a9e('0x6f')](_0x0a9e('0x71'),_0x0a9e('0x51'))[_0x0a9e('0x6f')](_0x0a9e('0x71'),_0x0a9e('0x52'))['from']('cm_contacts')[_0x0a9e('0x3b')](_0x0a9e('0x74'))[_0x0a9e('0x3b')](_0x0a9e('0x75'),_0x382687[_0x0a9e('0x7f')][_0x0a9e('0x72')]())[_0x0a9e('0x3b')]('phone\x20IS\x20NOT\x20NULL')[_0x0a9e('0x3b')](_0x0a9e('0x77'),squel[_0x0a9e('0x6e')]()[_0x0a9e('0x6f')](_0x0a9e('0x7b'))[_0x0a9e('0x79')](_0x0a9e('0x6a'))['where'](_0x0a9e('0x7c'),_0x566b90[_0x0a9e('0x46')]['id'][_0x0a9e('0x72')]())))['toString']();break;default:_0x3db98f=squel[_0x0a9e('0x68')]()[_0x0a9e('0x69')](_0x0a9e('0x6a'))[_0x0a9e('0x6b')](['phone',_0x0a9e('0x7e'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x59'),_0x0a9e('0x51'),_0x0a9e('0x52')],squel[_0x0a9e('0x6e')]()[_0x0a9e('0x6f')]('phone',_0x0a9e('0x70'))[_0x0a9e('0x6f')](_0x0a9e('0x71'),_0x0a9e('0x7e'))['field']('id','ContactId')[_0x0a9e('0x6f')](_0x382687[_0x0a9e('0x7f')][_0x0a9e('0x72')](),'ListId')[_0x0a9e('0x6f')](_0x566b90[_0x0a9e('0x46')]['id']['toString'](),_0x0a9e('0x59'))['field'](_0x0a9e('0x71'),'createdAt')['field']('NOW()',_0x0a9e('0x52'))[_0x0a9e('0x79')](_0x0a9e('0x73'))[_0x0a9e('0x3b')](_0x0a9e('0x74'))[_0x0a9e('0x3b')]('ListId\x20=\x20?',_0x382687[_0x0a9e('0x7f')][_0x0a9e('0x72')]())[_0x0a9e('0x3b')](_0x0a9e('0x76')))[_0x0a9e('0x72')]();}_0x2b624e[_0x0a9e('0x80')](db[_0x0a9e('0x81')]['query'](_0x3db98f));}return BPromise['all'](_0x2b624e);}})[_0x0a9e('0x21')](function(){return _0x1a9ef1;})['then'](respondWithResult(_0x3b581c,null))[_0x0a9e('0x44')](handleError(_0x3b581c,null));};exports[_0x0a9e('0x82')]=function(_0x1f0318,_0xa3695f,_0x37a448){return db[_0x0a9e('0x2c')]['find']({'where':{'id':_0x1f0318[_0x0a9e('0x46')]['id']}})['then'](handleEntityNotFound(_0xa3695f,null))['then'](function(_0x504403){if(_0x504403){return _0x504403['removeLists'](_0x1f0318[_0x0a9e('0x31')]['ids']);}})['then'](function(_0x26223f){if(_0x26223f){return db['CmHopper'][_0x0a9e('0x22')]({'where':{'ListId':_0x1f0318[_0x0a9e('0x31')][_0x0a9e('0x64')],'CampaignId':_0x1f0318['params']['id']}})[_0x0a9e('0x21')](function(){return _0x26223f;});}})[_0x0a9e('0x21')](respondWithStatusCode(_0xa3695f,null))[_0x0a9e('0x44')](handleError(_0xa3695f,null));};exports['getBlackLists']=function(_0x5236c9,_0xdc77d,_0x948aab){var _0x89d2cb={};var _0x2f79fb={};var _0x3b0db2;var _0x376b97;return db[_0x0a9e('0x2c')][_0x0a9e('0x57')]({'where':{'id':_0x5236c9[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0xdc77d,null))['then'](function(_0x51fa33){if(_0x51fa33){_0x3b0db2=_0x51fa33;_0x2f79fb['model']=_[_0x0a9e('0x32')](db[_0x0a9e('0x61')][_0x0a9e('0x47')]);_0x2f79fb[_0x0a9e('0x31')]=_[_0x0a9e('0x32')](_0x5236c9[_0x0a9e('0x31')]);_0x2f79fb[_0x0a9e('0x33')]=_[_0x0a9e('0x35')](_0x2f79fb['model'],_0x2f79fb['query']);_0x89d2cb[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x2f79fb['model'],qs[_0x0a9e('0x36')](_0x5236c9[_0x0a9e('0x31')][_0x0a9e('0x36')]));_0x89d2cb[_0x0a9e('0x34')]=_0x89d2cb[_0x0a9e('0x34')][_0x0a9e('0x37')]?_0x89d2cb[_0x0a9e('0x34')]:_0x2f79fb[_0x0a9e('0x30')];_0x89d2cb[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x5236c9[_0x0a9e('0x31')][_0x0a9e('0x3a')]);_0x89d2cb['where']=qs[_0x0a9e('0x33')](_[_0x0a9e('0x3c')](_0x5236c9[_0x0a9e('0x31')],_0x2f79fb[_0x0a9e('0x33')]));if(_0x5236c9[_0x0a9e('0x31')][_0x0a9e('0x3f')]){_0x89d2cb[_0x0a9e('0x3b')]=_[_0x0a9e('0x3d')](_0x89d2cb[_0x0a9e('0x3b')],{'$or':_[_0x0a9e('0x2b')](_0x89d2cb[_0x0a9e('0x34')],function(_0x3ba472){var _0x4e6eb9={};_0x4e6eb9[_0x3ba472]={'$like':'%'+_0x5236c9['query'][_0x0a9e('0x3f')]+'%'};return _0x4e6eb9;})});}_0x89d2cb=_[_0x0a9e('0x3d')]({},_0x89d2cb,_0x5236c9[_0x0a9e('0x40')]);return _0x3b0db2[_0x0a9e('0x83')](_0x89d2cb);}})[_0x0a9e('0x21')](function(_0x1e29e2){if(_0x1e29e2){_0x376b97=_0x1e29e2[_0x0a9e('0x37')];if(!_0x5236c9['query'][_0x0a9e('0x58')]('nolimit')){_0x89d2cb[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x5236c9[_0x0a9e('0x31')][_0x0a9e('0x1a')]);_0x89d2cb[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x5236c9[_0x0a9e('0x31')][_0x0a9e('0x19')]);}return _0x3b0db2[_0x0a9e('0x83')](_0x89d2cb);}})[_0x0a9e('0x21')](function(_0x39d367){if(_0x39d367){return _0x39d367?{'count':_0x376b97,'rows':_0x39d367}:null;}})[_0x0a9e('0x21')](respondWithResult(_0xdc77d,null))[_0x0a9e('0x44')](handleError(_0xdc77d,null));};exports[_0x0a9e('0x84')]=function(_0x3c8a9a,_0x2d5e00,_0x5b78a8){var _0x54cf62,_0x9dc1de;return db[_0x0a9e('0x2c')]['find']({'where':{'id':_0x3c8a9a['params']['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x2d5e00,null))[_0x0a9e('0x21')](function(_0x3304a1){if(_0x3304a1){_0x9dc1de=_0x3304a1;return _0x3304a1['addBlackLists'](_0x3c8a9a[_0x0a9e('0x4a')]['ids'],_[_0x0a9e('0x53')](_0x3c8a9a['body'],[_0x0a9e('0x64'),'id'])||{});}return null;})['spread'](function(_0x122e7d){var _0x21e210;_0x54cf62=_0x122e7d||[];var _0x1d5432=[];if(_0x122e7d){for(var _0x50e7cc=0x0;_0x50e7cc<_0x122e7d[_0x0a9e('0x37')];_0x50e7cc+=0x1){var _0x497fda=_0x122e7d[_0x50e7cc]['get']({'plain':!![]});_0x21e210=squel[_0x0a9e('0x68')]()[_0x0a9e('0x69')](_0x0a9e('0x85'))[_0x0a9e('0x6b')]([_0x0a9e('0x70'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x59'),_0x0a9e('0x51'),_0x0a9e('0x52')],squel[_0x0a9e('0x6e')]()[_0x0a9e('0x6f')](_0x0a9e('0x70'),_0x0a9e('0x70'))[_0x0a9e('0x6f')]('id',_0x0a9e('0x6c'))[_0x0a9e('0x6f')](_0x497fda[_0x0a9e('0x7f')][_0x0a9e('0x72')](),'ListId')[_0x0a9e('0x6f')](_0x3c8a9a[_0x0a9e('0x46')]['id'][_0x0a9e('0x72')](),_0x0a9e('0x59'))['field']('NOW()','createdAt')[_0x0a9e('0x6f')]('NOW()',_0x0a9e('0x52'))[_0x0a9e('0x79')](_0x0a9e('0x73'))[_0x0a9e('0x3b')](_0x0a9e('0x74'))[_0x0a9e('0x3b')](_0x0a9e('0x75'),_0x497fda[_0x0a9e('0x7f')][_0x0a9e('0x72')]())[_0x0a9e('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0x0a9e('0x72')]();_0x1d5432['push'](db[_0x0a9e('0x81')]['query'](_0x21e210));}return BPromise[_0x0a9e('0x86')](_0x1d5432);}})[_0x0a9e('0x21')](function(){return _0x54cf62;})[_0x0a9e('0x21')](respondWithResult(_0x2d5e00,null))['catch'](handleError(_0x2d5e00,null));};exports[_0x0a9e('0x87')]=function(_0x2571ae,_0x531377,_0x53c4f0){return db[_0x0a9e('0x2c')][_0x0a9e('0x48')]({'where':{'id':_0x2571ae[_0x0a9e('0x46')]['id']}})['then'](handleEntityNotFound(_0x531377,null))['then'](function(_0x4869c1){if(_0x4869c1){return _0x4869c1[_0x0a9e('0x87')](_0x2571ae[_0x0a9e('0x31')][_0x0a9e('0x64')]);}})[_0x0a9e('0x21')](function(_0x3d4349){if(_0x3d4349){return db[_0x0a9e('0x60')][_0x0a9e('0x22')]({'where':{'ListId':_0x2571ae[_0x0a9e('0x31')][_0x0a9e('0x64')],'CampaignId':_0x2571ae[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x21')](function(){return _0x3d4349;});}})[_0x0a9e('0x21')](respondWithStatusCode(_0x531377,null))[_0x0a9e('0x44')](handleError(_0x531377,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 5381c48..e3266e7 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 _0xd985=['define','campaigns','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./campaign.attributes','exports'];(function(_0x49caac,_0x1d585f){var _0xcd51ba=function(_0x142978){while(--_0x142978){_0x49caac['push'](_0x49caac['shift']());}};_0xcd51ba(++_0x1d585f);}(_0xd985,0x1ba));var _0x5d98=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xd985[_0x26f702];return _0x11417d;};'use strict';var _=require(_0x5d98('0x0'));var util=require(_0x5d98('0x1'));var logger=require(_0x5d98('0x2'))(_0x5d98('0x3'));var moment=require(_0x5d98('0x4'));var BPromise=require(_0x5d98('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5d98('0x6'));var config=require('../../config/environment');var attributes=require(_0x5d98('0x7'));module[_0x5d98('0x8')]=function(_0x48118d,_0xe06e9e){return _0x48118d[_0x5d98('0x9')]('Campaign',attributes,{'tableName':_0x5d98('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf828=['request-promise','./campaign.attributes','exports','define','Campaign','campaigns','lodash','../../config/logger','moment','bluebird'];(function(_0x4f6e4f,_0x4dd2d5){var _0x13ba8f=function(_0x568054){while(--_0x568054){_0x4f6e4f['push'](_0x4f6e4f['shift']());}};_0x13ba8f(++_0x4dd2d5);}(_0xf828,0x146));var _0x8f82=function(_0x4d4c10,_0x37a7f6){_0x4d4c10=_0x4d4c10-0x0;var _0x152e03=_0xf828[_0x4d4c10];return _0x152e03;};'use strict';var _=require(_0x8f82('0x0'));var util=require('util');var logger=require(_0x8f82('0x1'))('api');var moment=require(_0x8f82('0x2'));var BPromise=require(_0x8f82('0x3'));var rp=require(_0x8f82('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8f82('0x5'));module[_0x8f82('0x6')]=function(_0x45d50a,_0x58af70){return _0x45d50a[_0x8f82('0x7')](_0x8f82('0x8'),attributes,{'tableName':_0x8f82('0x9'),'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 03437f1..d2fc678 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 _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x3faf8e,_0x58d15b){var _0x136661=function(_0x3e0204){while(--_0x3e0204){_0x3faf8e['push'](_0x3faf8e['shift']());}};_0x136661(++_0x58d15b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};
\ No newline at end of file
+var _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x35641f,_0xcf9399){var _0xeadfe8=function(_0x32ceb4){while(--_0x32ceb4){_0x35641f['push'](_0x35641f['shift']());}};_0xeadfe8(++_0xcf9399);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index f1d0519..759ae29 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 _0x8a1b=['index','get','/:id','show','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','addLists','addBlackLists','put','update','delete','removeLists','removeBlackLists','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated'];(function(_0x393caf,_0xf1736f){var _0x18b224=function(_0x4155ae){while(--_0x4155ae){_0x393caf['push'](_0x393caf['shift']());}};_0x18b224(++_0xf1736f);}(_0x8a1b,0x160));var _0xb8a1=function(_0x45deca,_0x5c8d38){_0x45deca=_0x45deca-0x0;var _0x1e5c9e=_0x8a1b[_0x45deca];return _0x1e5c9e;};'use strict';var multer=require(_0xb8a1('0x0'));var util=require(_0xb8a1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb8a1('0x2'));var router=express[_0xb8a1('0x3')]();var fs_extra=require(_0xb8a1('0x4'));var auth=require(_0xb8a1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb8a1('0x6'));var controller=require('./campaign.controller');router['get']('/',auth[_0xb8a1('0x7')](),controller[_0xb8a1('0x8')]);router[_0xb8a1('0x9')](_0xb8a1('0xa'),auth[_0xb8a1('0x7')](),controller[_0xb8a1('0xb')]);router[_0xb8a1('0x9')]('/:id/hoppers',auth[_0xb8a1('0x7')](),controller['getHoppers']);router[_0xb8a1('0x9')]('/:id/hopper_histories',auth[_0xb8a1('0x7')](),controller[_0xb8a1('0xc')]);router[_0xb8a1('0x9')](_0xb8a1('0xd'),auth[_0xb8a1('0x7')](),controller[_0xb8a1('0xe')]);router[_0xb8a1('0x9')](_0xb8a1('0xf'),auth[_0xb8a1('0x7')](),controller['getHopperBlacks']);router[_0xb8a1('0x9')](_0xb8a1('0x10'),auth[_0xb8a1('0x7')](),controller[_0xb8a1('0x11')]);router['get'](_0xb8a1('0x12'),auth[_0xb8a1('0x7')](),controller[_0xb8a1('0x13')]);router[_0xb8a1('0x14')]('/',auth[_0xb8a1('0x7')](),controller[_0xb8a1('0x15')]);router[_0xb8a1('0x14')]('/:id/clone',auth[_0xb8a1('0x7')](),controller['clone']);router[_0xb8a1('0x14')]('/:id/lists',auth[_0xb8a1('0x7')](),controller[_0xb8a1('0x16')]);router[_0xb8a1('0x14')](_0xb8a1('0x12'),auth[_0xb8a1('0x7')](),controller[_0xb8a1('0x17')]);router[_0xb8a1('0x18')](_0xb8a1('0xa'),auth[_0xb8a1('0x7')](),controller[_0xb8a1('0x19')]);router[_0xb8a1('0x1a')](_0xb8a1('0xa'),auth[_0xb8a1('0x7')](),controller['destroy']);router[_0xb8a1('0x1a')](_0xb8a1('0x10'),auth[_0xb8a1('0x7')](),controller[_0xb8a1('0x1b')]);router[_0xb8a1('0x1a')](_0xb8a1('0x12'),auth['isAuthenticated'](),controller[_0xb8a1('0x1c')]);module[_0xb8a1('0x1d')]=router;
\ No newline at end of file
+var _0xf3eb=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperBlacks','/:id/lists','getBlackLists','post','create','/:id/clone','clone','addLists','/:id/blacklists','put','update','delete','exports','util','path','connect-timeout','express','Router'];(function(_0x48de9e,_0x144e00){var _0x20e60f=function(_0x2f65a3){while(--_0x2f65a3){_0x48de9e['push'](_0x48de9e['shift']());}};_0x20e60f(++_0x144e00);}(_0xf3eb,0xf7));var _0xbf3e=function(_0x111dca,_0x4edf9c){_0x111dca=_0x111dca-0x0;var _0x53b7ff=_0xf3eb[_0x111dca];return _0x53b7ff;};'use strict';var multer=require('multer');var util=require(_0xbf3e('0x0'));var path=require(_0xbf3e('0x1'));var timeout=require(_0xbf3e('0x2'));var express=require(_0xbf3e('0x3'));var router=express[_0xbf3e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf3e('0x5'));var config=require(_0xbf3e('0x6'));var controller=require('./campaign.controller');router['get']('/',auth[_0xbf3e('0x7')](),controller[_0xbf3e('0x8')]);router[_0xbf3e('0x9')](_0xbf3e('0xa'),auth[_0xbf3e('0x7')](),controller[_0xbf3e('0xb')]);router[_0xbf3e('0x9')]('/:id/hoppers',auth[_0xbf3e('0x7')](),controller[_0xbf3e('0xc')]);router[_0xbf3e('0x9')]('/:id/hopper_histories',auth[_0xbf3e('0x7')](),controller[_0xbf3e('0xd')]);router[_0xbf3e('0x9')](_0xbf3e('0xe'),auth[_0xbf3e('0x7')](),controller['getHopperFinals']);router[_0xbf3e('0x9')]('/:id/hopper_black',auth[_0xbf3e('0x7')](),controller[_0xbf3e('0xf')]);router[_0xbf3e('0x9')](_0xbf3e('0x10'),auth[_0xbf3e('0x7')](),controller['getLists']);router['get']('/:id/blacklists',auth[_0xbf3e('0x7')](),controller[_0xbf3e('0x11')]);router[_0xbf3e('0x12')]('/',auth[_0xbf3e('0x7')](),controller[_0xbf3e('0x13')]);router['post'](_0xbf3e('0x14'),auth[_0xbf3e('0x7')](),controller[_0xbf3e('0x15')]);router[_0xbf3e('0x12')](_0xbf3e('0x10'),auth[_0xbf3e('0x7')](),controller[_0xbf3e('0x16')]);router['post'](_0xbf3e('0x17'),auth['isAuthenticated'](),controller['addBlackLists']);router[_0xbf3e('0x18')](_0xbf3e('0xa'),auth[_0xbf3e('0x7')](),controller[_0xbf3e('0x19')]);router['delete'](_0xbf3e('0xa'),auth[_0xbf3e('0x7')](),controller['destroy']);router[_0xbf3e('0x1a')](_0xbf3e('0x10'),auth[_0xbf3e('0x7')](),controller['removeLists']);router[_0xbf3e('0x1a')]('/:id/blacklists',auth[_0xbf3e('0x7')](),controller['removeBlackLists']);module[_0xbf3e('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index a597aa0..61c7809 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 _0xbf5f=['STRING','TEXT','sequelize','exports'];(function(_0x584c02,_0x4e0a9c){var _0x284a0e=function(_0x48d555){while(--_0x48d555){_0x584c02['push'](_0x584c02['shift']());}};_0x284a0e(++_0x4e0a9c);}(_0xbf5f,0x19e));var _0xfbf5=function(_0x5d5eda,_0x5729b2){_0x5d5eda=_0x5d5eda-0x0;var _0x2f13a7=_0xbf5f[_0x5d5eda];return _0x2f13a7;};'use strict';var Sequelize=require(_0xfbf5('0x0'));module[_0xfbf5('0x1')]={'key':{'type':Sequelize[_0xfbf5('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xfbf5('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
+var _0xa024=['VIRTUAL','getDataValue','key','sequelize','exports','STRING','TEXT'];(function(_0x330376,_0x70a3f){var _0xb7f093=function(_0x3f2586){while(--_0x3f2586){_0x330376['push'](_0x330376['shift']());}};_0xb7f093(++_0x70a3f);}(_0xa024,0x1ae));var _0x4a02=function(_0x52e5a8,_0x347fe8){_0x52e5a8=_0x52e5a8-0x0;var _0x293ba5=_0xa024[_0x52e5a8];return _0x293ba5;};'use strict';var Sequelize=require(_0x4a02('0x0'));module[_0x4a02('0x1')]={'key':{'type':Sequelize[_0x4a02('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x4a02('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x4a02('0x2')]},'name':{'type':Sequelize[_0x4a02('0x4')],'get':function(){return this[_0x4a02('0x5')](_0x4a02('0x6'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 021136f..538515f 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 _0x997f=['query','keys','filters','intersection','model','attributes','fields','length','limit','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','includeAll','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','type','key'];(function(_0x15e959,_0x48b37d){var _0xe54316=function(_0xebef87){while(--_0xebef87){_0x15e959['push'](_0x15e959['shift']());}};_0xe54316(++_0x48b37d);}(_0x997f,0xd2));var _0xf997=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x997f[_0x1abb09];return _0xea1c07;};'use strict';var pdf=require(_0xf997('0x0'));var emlformat=require(_0xf997('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf997('0x2'));var jsonpatch=require(_0xf997('0x3'));var rp=require(_0xf997('0x4'));var moment=require(_0xf997('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf997('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf997('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf997('0x8'));var squel=require(_0xf997('0x9'));var crypto=require(_0xf997('0xa'));var jsforce=require(_0xf997('0xb'));var deskjs=require(_0xf997('0xc'));var toCsv=require(_0xf997('0xd'));var querystring=require(_0xf997('0xe'));var Papa=require(_0xf997('0xf'));var Redis=require('ioredis');var authService=require(_0xf997('0x10'));var qs=require(_0xf997('0x11'));var as=require(_0xf997('0x12'));var hardwareService=require(_0xf997('0x13'));var logger=require(_0xf997('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xf997('0x15'));var licenseUtil=require(_0xf997('0x16'));var db=require(_0xf997('0x17'))['db'];function respondWithStatusCode(_0x40da09,_0x464b40){_0x464b40=_0x464b40||0xcc;return function(_0x2def67){if(_0x2def67){return _0x40da09[_0xf997('0x18')](_0x464b40);}return _0x40da09[_0xf997('0x19')](_0x464b40)[_0xf997('0x1a')]();};}function respondWithResult(_0x294cba,_0x16aae3){_0x16aae3=_0x16aae3||0xc8;return function(_0x1ce36d){if(_0x1ce36d){return _0x294cba[_0xf997('0x19')](_0x16aae3)['json'](_0x1ce36d);}};}function respondWithFilteredResult(_0x4acd63,_0x552b33){return function(_0x5c278f){if(_0x5c278f){var _0xe76f69=_0x5c278f['count'],_0x58011c=_0x552b33[_0xf997('0x1b')],_0x3309e2=_0x552b33['offset']+_0x552b33['limit'],_0x325db8;if(_0x3309e2>=_0xe76f69){_0x3309e2=_0xe76f69;_0x325db8=0xc8;}else{_0x325db8=0xce;}_0x4acd63['status'](_0x325db8);return _0x4acd63['set'](_0xf997('0x1c'),_0x58011c+'-'+_0x3309e2+'/'+_0xe76f69)[_0xf997('0x1d')](_0x5c278f);}return null;};}function patchUpdates(_0x2bce9b){return function(_0x23d029){try{jsonpatch[_0xf997('0x1e')](_0x23d029,_0x2bce9b,!![]);}catch(_0xb061fb){return BPromise[_0xf997('0x1f')](_0xb061fb);}return _0x23d029[_0xf997('0x20')]();};}function saveUpdates(_0x4a1893,_0x349b73){return function(_0x3b7b34){if(_0x3b7b34){return _0x3b7b34[_0xf997('0x21')](_0x4a1893)[_0xf997('0x22')](function(_0x92e7aa){return _0x92e7aa;});}return null;};}function removeEntity(_0x2df47b,_0x2a7556){return function(_0x2eca66){if(_0x2eca66){return _0x2eca66[_0xf997('0x23')]()[_0xf997('0x22')](function(){var _0x9dac95=_0x2eca66[_0xf997('0x24')]({'plain':!![]});var _0x17fe0d='CannedAnswers';return db[_0xf997('0x25')]['destroy']({'where':{'type':_0x17fe0d,'resourceId':_0x9dac95['id']}})[_0xf997('0x22')](function(){return _0x2eca66;});})['then'](function(){_0x2df47b[_0xf997('0x19')](0xcc)[_0xf997('0x1a')]();});}};}function handleEntityNotFound(_0x3e2455,_0x200102){return function(_0x1c0c7e){if(!_0x1c0c7e){_0x3e2455['sendStatus'](0x194);}return _0x1c0c7e;};}function handleError(_0x3bbcde,_0x1ab73b){_0x1ab73b=_0x1ab73b||0x1f4;return function(_0x6d34c0){logger[_0xf997('0x26')](_0x6d34c0[_0xf997('0x27')]);if(_0x6d34c0[_0xf997('0x28')]){delete _0x6d34c0['name'];}_0x3bbcde[_0xf997('0x19')](_0x1ab73b)[_0xf997('0x29')](_0x6d34c0);};}exports[_0xf997('0x2a')]=function(_0x703cd1,_0x2187bb){var _0x118d09={},_0x32a33d={},_0x13fd3b={'count':0x0,'rows':[]};var _0xc814e=_[_0xf997('0x2b')](db[_0xf997('0x2c')][_0xf997('0x2d')],function(_0x39510d){return{'name':_0x39510d['fieldName'],'type':_0x39510d[_0xf997('0x2e')][_0xf997('0x2f')]};});_0x32a33d['model']=_['map'](_0xc814e,_0xf997('0x28'));_0x32a33d[_0xf997('0x30')]=_[_0xf997('0x31')](_0x703cd1[_0xf997('0x30')]);_0x32a33d[_0xf997('0x32')]=_[_0xf997('0x33')](_0x32a33d[_0xf997('0x34')],_0x32a33d[_0xf997('0x30')]);_0x118d09[_0xf997('0x35')]=_[_0xf997('0x33')](_0x32a33d[_0xf997('0x34')],qs[_0xf997('0x36')](_0x703cd1[_0xf997('0x30')]['fields']));_0x118d09[_0xf997('0x35')]=_0x118d09[_0xf997('0x35')][_0xf997('0x37')]?_0x118d09[_0xf997('0x35')]:_0x32a33d[_0xf997('0x34')];if(!_0x703cd1[_0xf997('0x30')]['hasOwnProperty']('nolimit')){_0x118d09[_0xf997('0x38')]=qs[_0xf997('0x38')](_0x703cd1['query']['limit']);_0x118d09[_0xf997('0x1b')]=qs[_0xf997('0x1b')](_0x703cd1['query'][_0xf997('0x1b')]);}_0x118d09[_0xf997('0x39')]=qs[_0xf997('0x3a')](_0x703cd1['query'][_0xf997('0x3a')]);_0x118d09[_0xf997('0x3b')]=qs[_0xf997('0x32')](_[_0xf997('0x3c')](_0x703cd1[_0xf997('0x30')],_0x32a33d['filters']),_0xc814e);if(_0x703cd1[_0xf997('0x30')][_0xf997('0x3d')]){_0x118d09[_0xf997('0x3b')]=_[_0xf997('0x3e')](_0x118d09[_0xf997('0x3b')],{'$or':_[_0xf997('0x2b')](_0xc814e,function(_0x854264){if(_0x854264[_0xf997('0x2e')]!=='VIRTUAL'){var _0x53d9fb={};_0x53d9fb[_0x854264[_0xf997('0x28')]]={'$like':'%'+_0x703cd1[_0xf997('0x30')][_0xf997('0x3d')]+'%'};return _0x53d9fb;}})});}_0x118d09=_['merge']({},_0x118d09,_0x703cd1[_0xf997('0x3f')]);var _0x1a1102={'where':_0x118d09['where']};return db[_0xf997('0x2c')]['count'](_0x1a1102)[_0xf997('0x22')](function(_0x3f5fcc){_0x13fd3b['count']=_0x3f5fcc;if(_0x703cd1[_0xf997('0x30')]['includeAll']){_0x118d09[_0xf997('0x40')]=[{'all':!![]}];}return db[_0xf997('0x2c')][_0xf997('0x41')](_0x118d09);})['then'](function(_0x14ccce){_0x13fd3b['rows']=_0x14ccce;return _0x13fd3b;})[_0xf997('0x22')](respondWithFilteredResult(_0x2187bb,_0x118d09))[_0xf997('0x42')](handleError(_0x2187bb,null));};exports[_0xf997('0x43')]=function(_0x2cba8d,_0x55bce4){var _0xc4e03b={'raw':!![],'where':{'id':_0x2cba8d[_0xf997('0x44')]['id']}},_0xeccb68={};_0xeccb68['model']=_[_0xf997('0x31')](db[_0xf997('0x2c')]['rawAttributes']);_0xeccb68[_0xf997('0x30')]=_[_0xf997('0x31')](_0x2cba8d[_0xf997('0x30')]);_0xeccb68[_0xf997('0x32')]=_[_0xf997('0x33')](_0xeccb68[_0xf997('0x34')],_0xeccb68[_0xf997('0x30')]);_0xc4e03b[_0xf997('0x35')]=_[_0xf997('0x33')](_0xeccb68[_0xf997('0x34')],qs['fields'](_0x2cba8d['query'][_0xf997('0x36')]));_0xc4e03b[_0xf997('0x35')]=_0xc4e03b[_0xf997('0x35')][_0xf997('0x37')]?_0xc4e03b[_0xf997('0x35')]:_0xeccb68['model'];if(_0x2cba8d[_0xf997('0x30')][_0xf997('0x45')]){_0xc4e03b['include']=[{'all':!![]}];}_0xc4e03b=_[_0xf997('0x3e')]({},_0xc4e03b,_0x2cba8d['options']);return db[_0xf997('0x2c')]['find'](_0xc4e03b)[_0xf997('0x22')](handleEntityNotFound(_0x55bce4,null))[_0xf997('0x22')](respondWithResult(_0x55bce4,null))['catch'](handleError(_0x55bce4,null));};exports[_0xf997('0x21')]=function(_0x1b7e6e,_0x3ea6b3){if(_0x1b7e6e[_0xf997('0x46')]['id']){delete _0x1b7e6e[_0xf997('0x46')]['id'];}return db[_0xf997('0x2c')]['find']({'where':{'id':_0x1b7e6e['params']['id']}})['then'](handleEntityNotFound(_0x3ea6b3,null))['then'](saveUpdates(_0x1b7e6e[_0xf997('0x46')],null))[_0xf997('0x22')](respondWithResult(_0x3ea6b3,null))['catch'](handleError(_0x3ea6b3,null));};exports[_0xf997('0x23')]=function(_0x14352a,_0x42260f){return db[_0xf997('0x2c')][_0xf997('0x47')]({'where':{'id':_0x14352a[_0xf997('0x44')]['id']}})['then'](handleEntityNotFound(_0x42260f,null))[_0xf997('0x22')](removeEntity(_0x42260f,null))[_0xf997('0x42')](handleError(_0x42260f,null));};exports[_0xf997('0x48')]=function(_0x4ec505,_0x12c72){var _0x5a3499={'key':_0x4ec505['body'][_0xf997('0x2f')]};if(_0x4ec505['body']['MailAccountId']){_0x5a3499[_0xf997('0x49')]=_0x4ec505[_0xf997('0x46')][_0xf997('0x49')];}else if(_0x4ec505[_0xf997('0x46')][_0xf997('0x4a')]){_0x5a3499[_0xf997('0x4a')]=_0x4ec505[_0xf997('0x46')][_0xf997('0x4a')];}else if(_0x4ec505[_0xf997('0x46')][_0xf997('0x4b')]){_0x5a3499['OpenchannelAccountId']=_0x4ec505[_0xf997('0x46')]['OpenchannelAccountId'];}else if(_0x4ec505['body'][_0xf997('0x4c')]){_0x5a3499[_0xf997('0x4c')]=_0x4ec505['body']['ChatWebsiteId'];}return db[_0xf997('0x2c')][_0xf997('0x47')]({'where':_0x5a3499})['then'](function(_0x23ee7e){if(_0x23ee7e){throw new db[(_0xf997('0x4d'))]['ValidationError'](_0xf997('0x4e'));}return db[_0xf997('0x2c')]['create'](_0x4ec505['body']);})[_0xf997('0x22')](function(_0x52fd5f){var _0x12b0e1=_0x4ec505[_0xf997('0x4f')][_0xf997('0x24')]({'plain':!![]});if(!_0x12b0e1)throw new Error(_0xf997('0x50'));if(_0x12b0e1[_0xf997('0x51')]===_0xf997('0x4f')){var _0x42cd48=_0x52fd5f['get']({'plain':!![]});return db['UserProfileSection'][_0xf997('0x47')]({'where':{'name':_0xf997('0x52'),'userProfileId':_0x12b0e1[_0xf997('0x53')]},'raw':!![]})[_0xf997('0x22')](function(_0x49a9a8){if(_0x49a9a8&&_0x49a9a8[_0xf997('0x54')]===0x0){return db[_0xf997('0x25')][_0xf997('0x48')]({'name':_0x42cd48[_0xf997('0x28')],'resourceId':_0x42cd48['id'],'type':_0x49a9a8[_0xf997('0x28')],'sectionId':_0x49a9a8['id']},{})[_0xf997('0x22')](function(){return _0x52fd5f;});}else{return _0x52fd5f;}})['catch'](function(_0x29204b){logger[_0xf997('0x26')](_0xf997('0x55'),_0x29204b);throw _0x29204b;});}return _0x52fd5f;})[_0xf997('0x22')](respondWithResult(_0x12c72,0xc9))[_0xf997('0x42')](handleError(_0x12c72,null));};
\ No newline at end of file
+var _0xba5e=['VIRTUAL','filter','includeAll','include','rows','catch','show','params','options','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','path','ejs','fs-extra','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','UserProfileResource','stack','name','index','map','CannedAnswer','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','pick','merge','where'];(function(_0x1d2157,_0x48382d){var _0x41fa1f=function(_0x39cc04){while(--_0x39cc04){_0x1d2157['push'](_0x1d2157['shift']());}};_0x41fa1f(++_0x48382d);}(_0xba5e,0xc3));var _0xeba5=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xba5e[_0x46e363];return _0x3fb059;};'use strict';var pdf=require(_0xeba5('0x0'));var emlformat=require(_0xeba5('0x1'));var rimraf=require(_0xeba5('0x2'));var zipdir=require(_0xeba5('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeba5('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeba5('0x5'));var util=require('util');var path=require(_0xeba5('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeba5('0x7'));var fs=require('fs');var fs_extra=require(_0xeba5('0x8'));var _=require('lodash');var squel=require(_0xeba5('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xeba5('0xa'));var toCsv=require(_0xeba5('0xb'));var querystring=require(_0xeba5('0xc'));var Papa=require(_0xeba5('0xd'));var Redis=require('ioredis');var authService=require(_0xeba5('0xe'));var qs=require(_0xeba5('0xf'));var as=require(_0xeba5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xeba5('0x11'));var config=require(_0xeba5('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xeba5('0x13'))['db'];function respondWithStatusCode(_0x32176d,_0x5c280f){_0x5c280f=_0x5c280f||0xcc;return function(_0x134362){if(_0x134362){return _0x32176d[_0xeba5('0x14')](_0x5c280f);}return _0x32176d[_0xeba5('0x15')](_0x5c280f)[_0xeba5('0x16')]();};}function respondWithResult(_0x11998e,_0x1c5eab){_0x1c5eab=_0x1c5eab||0xc8;return function(_0x4c3558){if(_0x4c3558){return _0x11998e[_0xeba5('0x15')](_0x1c5eab)['json'](_0x4c3558);}};}function respondWithFilteredResult(_0x364380,_0x4f1f91){return function(_0x3d555d){if(_0x3d555d){var _0x3d4052=_0x3d555d[_0xeba5('0x17')],_0x5aff2a=_0x4f1f91[_0xeba5('0x18')],_0x5ddf1b=_0x4f1f91[_0xeba5('0x18')]+_0x4f1f91[_0xeba5('0x19')],_0x1cebaa;if(_0x5ddf1b>=_0x3d4052){_0x5ddf1b=_0x3d4052;_0x1cebaa=0xc8;}else{_0x1cebaa=0xce;}_0x364380[_0xeba5('0x15')](_0x1cebaa);return _0x364380[_0xeba5('0x1a')](_0xeba5('0x1b'),_0x5aff2a+'-'+_0x5ddf1b+'/'+_0x3d4052)[_0xeba5('0x1c')](_0x3d555d);}return null;};}function patchUpdates(_0x1c968b){return function(_0x29199d){try{jsonpatch['apply'](_0x29199d,_0x1c968b,!![]);}catch(_0x1e8dd2){return BPromise[_0xeba5('0x1d')](_0x1e8dd2);}return _0x29199d[_0xeba5('0x1e')]();};}function saveUpdates(_0x591ec8,_0x47cdcb){return function(_0x27aa5e){if(_0x27aa5e){return _0x27aa5e[_0xeba5('0x1f')](_0x591ec8)[_0xeba5('0x20')](function(_0x31e41d){return _0x31e41d;});}return null;};}function removeEntity(_0x4f1506,_0x53e69c){return function(_0x301548){if(_0x301548){return _0x301548[_0xeba5('0x21')]()[_0xeba5('0x20')](function(){var _0xa482ec=_0x301548['get']({'plain':!![]});var _0x4b50d9='CannedAnswers';return db[_0xeba5('0x22')][_0xeba5('0x21')]({'where':{'type':_0x4b50d9,'resourceId':_0xa482ec['id']}})['then'](function(){return _0x301548;});})[_0xeba5('0x20')](function(){_0x4f1506[_0xeba5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55a580,_0x466cd8){return function(_0x28c65e){if(!_0x28c65e){_0x55a580[_0xeba5('0x14')](0x194);}return _0x28c65e;};}function handleError(_0x19b654,_0x3329b8){_0x3329b8=_0x3329b8||0x1f4;return function(_0x2efe01){logger['error'](_0x2efe01[_0xeba5('0x23')]);if(_0x2efe01[_0xeba5('0x24')]){delete _0x2efe01[_0xeba5('0x24')];}_0x19b654[_0xeba5('0x15')](_0x3329b8)['send'](_0x2efe01);};}exports[_0xeba5('0x25')]=function(_0x5a456e,_0x3fa613){var _0x3a2cc7={},_0x1299ae={},_0x3c7568={'count':0x0,'rows':[]};var _0x133462=_[_0xeba5('0x26')](db[_0xeba5('0x27')][_0xeba5('0x28')],function(_0x26c929){return{'name':_0x26c929['fieldName'],'type':_0x26c929[_0xeba5('0x29')][_0xeba5('0x2a')]};});_0x1299ae[_0xeba5('0x2b')]=_[_0xeba5('0x26')](_0x133462,_0xeba5('0x24'));_0x1299ae['query']=_[_0xeba5('0x2c')](_0x5a456e[_0xeba5('0x2d')]);_0x1299ae[_0xeba5('0x2e')]=_['intersection'](_0x1299ae['model'],_0x1299ae[_0xeba5('0x2d')]);_0x3a2cc7[_0xeba5('0x2f')]=_[_0xeba5('0x30')](_0x1299ae[_0xeba5('0x2b')],qs[_0xeba5('0x31')](_0x5a456e['query'][_0xeba5('0x31')]));_0x3a2cc7[_0xeba5('0x2f')]=_0x3a2cc7[_0xeba5('0x2f')][_0xeba5('0x32')]?_0x3a2cc7[_0xeba5('0x2f')]:_0x1299ae[_0xeba5('0x2b')];if(!_0x5a456e['query'][_0xeba5('0x33')](_0xeba5('0x34'))){_0x3a2cc7[_0xeba5('0x19')]=qs[_0xeba5('0x19')](_0x5a456e['query'][_0xeba5('0x19')]);_0x3a2cc7[_0xeba5('0x18')]=qs[_0xeba5('0x18')](_0x5a456e['query']['offset']);}_0x3a2cc7[_0xeba5('0x35')]=qs['sort'](_0x5a456e[_0xeba5('0x2d')]['sort']);_0x3a2cc7['where']=qs[_0xeba5('0x2e')](_[_0xeba5('0x36')](_0x5a456e[_0xeba5('0x2d')],_0x1299ae['filters']),_0x133462);if(_0x5a456e[_0xeba5('0x2d')]['filter']){_0x3a2cc7['where']=_[_0xeba5('0x37')](_0x3a2cc7[_0xeba5('0x38')],{'$or':_[_0xeba5('0x26')](_0x133462,function(_0x1a3615){if(_0x1a3615[_0xeba5('0x29')]!==_0xeba5('0x39')){var _0x2868b1={};_0x2868b1[_0x1a3615[_0xeba5('0x24')]]={'$like':'%'+_0x5a456e['query'][_0xeba5('0x3a')]+'%'};return _0x2868b1;}})});}_0x3a2cc7=_[_0xeba5('0x37')]({},_0x3a2cc7,_0x5a456e['options']);var _0x653119={'where':_0x3a2cc7[_0xeba5('0x38')]};return db[_0xeba5('0x27')][_0xeba5('0x17')](_0x653119)[_0xeba5('0x20')](function(_0x1d1ae6){_0x3c7568['count']=_0x1d1ae6;if(_0x5a456e[_0xeba5('0x2d')][_0xeba5('0x3b')]){_0x3a2cc7[_0xeba5('0x3c')]=[{'all':!![]}];}return db[_0xeba5('0x27')]['findAll'](_0x3a2cc7);})[_0xeba5('0x20')](function(_0x1ce066){_0x3c7568[_0xeba5('0x3d')]=_0x1ce066;return _0x3c7568;})[_0xeba5('0x20')](respondWithFilteredResult(_0x3fa613,_0x3a2cc7))[_0xeba5('0x3e')](handleError(_0x3fa613,null));};exports[_0xeba5('0x3f')]=function(_0x4b8bd8,_0x43e7c1){var _0x495b1e={'raw':!![],'where':{'id':_0x4b8bd8[_0xeba5('0x40')]['id']}},_0xf9c2bd={};_0xf9c2bd[_0xeba5('0x2b')]=_[_0xeba5('0x2c')](db['CannedAnswer']['rawAttributes']);_0xf9c2bd[_0xeba5('0x2d')]=_[_0xeba5('0x2c')](_0x4b8bd8[_0xeba5('0x2d')]);_0xf9c2bd[_0xeba5('0x2e')]=_[_0xeba5('0x30')](_0xf9c2bd[_0xeba5('0x2b')],_0xf9c2bd[_0xeba5('0x2d')]);_0x495b1e[_0xeba5('0x2f')]=_['intersection'](_0xf9c2bd[_0xeba5('0x2b')],qs[_0xeba5('0x31')](_0x4b8bd8[_0xeba5('0x2d')][_0xeba5('0x31')]));_0x495b1e['attributes']=_0x495b1e[_0xeba5('0x2f')][_0xeba5('0x32')]?_0x495b1e[_0xeba5('0x2f')]:_0xf9c2bd[_0xeba5('0x2b')];if(_0x4b8bd8[_0xeba5('0x2d')]['includeAll']){_0x495b1e[_0xeba5('0x3c')]=[{'all':!![]}];}_0x495b1e=_[_0xeba5('0x37')]({},_0x495b1e,_0x4b8bd8[_0xeba5('0x41')]);return db[_0xeba5('0x27')][_0xeba5('0x42')](_0x495b1e)['then'](handleEntityNotFound(_0x43e7c1,null))[_0xeba5('0x20')](respondWithResult(_0x43e7c1,null))[_0xeba5('0x3e')](handleError(_0x43e7c1,null));};exports['update']=function(_0x5b6805,_0x51d284){if(_0x5b6805[_0xeba5('0x43')]['id']){delete _0x5b6805[_0xeba5('0x43')]['id'];}return db[_0xeba5('0x27')][_0xeba5('0x42')]({'where':{'id':_0x5b6805['params']['id']}})[_0xeba5('0x20')](handleEntityNotFound(_0x51d284,null))['then'](saveUpdates(_0x5b6805[_0xeba5('0x43')],null))[_0xeba5('0x20')](respondWithResult(_0x51d284,null))[_0xeba5('0x3e')](handleError(_0x51d284,null));};exports['destroy']=function(_0x2e04da,_0x32e719){return db[_0xeba5('0x27')]['find']({'where':{'id':_0x2e04da[_0xeba5('0x40')]['id']}})[_0xeba5('0x20')](handleEntityNotFound(_0x32e719,null))[_0xeba5('0x20')](removeEntity(_0x32e719,null))[_0xeba5('0x3e')](handleError(_0x32e719,null));};exports['create']=function(_0x240d12,_0x305017){var _0x5118ce={'key':_0x240d12[_0xeba5('0x43')][_0xeba5('0x2a')]};if(_0x240d12[_0xeba5('0x43')]['MailAccountId']){_0x5118ce[_0xeba5('0x44')]=_0x240d12['body'][_0xeba5('0x44')];}else if(_0x240d12[_0xeba5('0x43')][_0xeba5('0x45')]){_0x5118ce[_0xeba5('0x45')]=_0x240d12[_0xeba5('0x43')]['SmsAccountId'];}else if(_0x240d12[_0xeba5('0x43')]['OpenchannelAccountId']){_0x5118ce['OpenchannelAccountId']=_0x240d12[_0xeba5('0x43')][_0xeba5('0x46')];}else if(_0x240d12[_0xeba5('0x43')][_0xeba5('0x47')]){_0x5118ce[_0xeba5('0x47')]=_0x240d12[_0xeba5('0x43')]['ChatWebsiteId'];}return db[_0xeba5('0x27')]['find']({'where':_0x5118ce})['then'](function(_0x1b1573){if(_0x1b1573){throw new db['Sequelize'][(_0xeba5('0x48'))](_0xeba5('0x49'));}return db[_0xeba5('0x27')][_0xeba5('0x4a')](_0x240d12[_0xeba5('0x43')]);})[_0xeba5('0x20')](function(_0x4ea253){var _0x9e91fe=_0x240d12[_0xeba5('0x4b')][_0xeba5('0x4c')]({'plain':!![]});if(!_0x9e91fe)throw new Error(_0xeba5('0x4d'));if(_0x9e91fe['role']===_0xeba5('0x4b')){var _0x5e1126=_0x4ea253[_0xeba5('0x4c')]({'plain':!![]});return db[_0xeba5('0x4e')][_0xeba5('0x42')]({'where':{'name':_0xeba5('0x4f'),'userProfileId':_0x9e91fe[_0xeba5('0x50')]},'raw':!![]})[_0xeba5('0x20')](function(_0x18691c){if(_0x18691c&&_0x18691c[_0xeba5('0x51')]===0x0){return db[_0xeba5('0x22')]['create']({'name':_0x5e1126[_0xeba5('0x24')],'resourceId':_0x5e1126['id'],'type':_0x18691c[_0xeba5('0x24')],'sectionId':_0x18691c['id']},{})[_0xeba5('0x20')](function(){return _0x4ea253;});}else{return _0x4ea253;}})['catch'](function(_0x409249){logger[_0xeba5('0x52')](_0xeba5('0x53'),_0x409249);throw _0x409249;});}return _0x4ea253;})['then'](respondWithResult(_0x305017,0xc9))[_0xeba5('0x3e')](handleError(_0x305017,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index c63faab..a76fba5 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 _0xfd65=['exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','api','moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes'];(function(_0x1a1310,_0x3c17eb){var _0x5b9a44=function(_0xd4622b){while(--_0xd4622b){_0x1a1310['push'](_0x1a1310['shift']());}};_0x5b9a44(++_0x3c17eb);}(_0xfd65,0x13d));var _0x5fd6=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xfd65[_0x255d5b];return _0x3e141a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x5fd6('0x0'));var moment=require(_0x5fd6('0x1'));var BPromise=require('bluebird');var rp=require(_0x5fd6('0x2'));var fs=require('fs');var path=require(_0x5fd6('0x3'));var rimraf=require(_0x5fd6('0x4'));var config=require(_0x5fd6('0x5'));var attributes=require(_0x5fd6('0x6'));module[_0x5fd6('0x7')]=function(_0x2daf43,_0x4865ee){return _0x2daf43['define'](_0x5fd6('0x8'),attributes,{'tableName':_0x5fd6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5fd6('0xa'),'collate':_0x5fd6('0xb')});};
\ No newline at end of file
+var _0x44f4=['path','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird'];(function(_0x17575b,_0x1d7af7){var _0x5b6f87=function(_0x42e06){while(--_0x42e06){_0x17575b['push'](_0x17575b['shift']());}};_0x5b6f87(++_0x1d7af7);}(_0x44f4,0x140));var _0x444f=function(_0x416ea4,_0x54dd8b){_0x416ea4=_0x416ea4-0x0;var _0x15a849=_0x44f4[_0x416ea4];return _0x15a849;};'use strict';var _=require(_0x444f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x444f('0x1'));var moment=require(_0x444f('0x2'));var BPromise=require(_0x444f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x444f('0x4'));var rimraf=require('rimraf');var config=require(_0x444f('0x5'));var attributes=require(_0x444f('0x6'));module[_0x444f('0x7')]=function(_0x46dac6,_0x2588d9){return _0x46dac6[_0x444f('0x8')](_0x444f('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x444f('0xa'),'collate':_0x444f('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index bd94ede..1d1925f 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 _0x8510=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x21b36c,_0x543483){var _0x236627=function(_0x174f99){while(--_0x174f99){_0x21b36c['push'](_0x21b36c['shift']());}};_0x236627(++_0x543483);}(_0x8510,0x1c7));var _0x0851=function(_0x5db928,_0x113065){_0x5db928=_0x5db928-0x0;var _0x4b9e2c=_0x8510[_0x5db928];return _0x4b9e2c;};'use strict';var _=require(_0x0851('0x0'));var util=require(_0x0851('0x1'));var moment=require(_0x0851('0x2'));var BPromise=require(_0x0851('0x3'));var rs=require(_0x0851('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0851('0x5'));var logger=require(_0x0851('0x6'))('rpc');var config=require(_0x0851('0x7'));var jayson=require(_0x0851('0x8'));var client=jayson[_0x0851('0x9')][_0x0851('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xad5ba2,_0x5bf3ec,_0xca56d1){return new BPromise(function(_0x137ff2,_0x47dc2e){return client[_0x0851('0xb')](_0xad5ba2,_0xca56d1)[_0x0851('0xc')](function(_0xda092){logger[_0x0851('0xd')](_0x0851('0xe'),_0x5bf3ec,_0x0851('0xf'));logger[_0x0851('0x10')](_0x0851('0x11'),_0x5bf3ec,_0x0851('0xf'),JSON[_0x0851('0x12')](_0xda092));if(_0xda092[_0x0851('0x13')]){if(_0xda092[_0x0851('0x13')][_0x0851('0x14')]===0x1f4){logger[_0x0851('0x13')](_0x0851('0xe'),_0x5bf3ec,_0xda092['error']['message']);return _0x47dc2e(_0xda092['error']['message']);}logger[_0x0851('0x13')](_0x0851('0xe'),_0x5bf3ec,_0xda092[_0x0851('0x13')]['message']);return _0x137ff2(_0xda092[_0x0851('0x13')][_0x0851('0x15')]);}else{logger['info'](_0x0851('0xe'),_0x5bf3ec,_0x0851('0xf'));_0x137ff2(_0xda092[_0x0851('0x16')]['message']);}})[_0x0851('0x17')](function(_0x58d490){logger[_0x0851('0x13')](_0x0851('0xe'),_0x5bf3ec,_0x58d490);_0x47dc2e(_0x58d490);});});}
\ No newline at end of file
+var _0x8830=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x23ba2a,_0x516b14){var _0x3eca4a=function(_0x5df423){while(--_0x5df423){_0x23ba2a['push'](_0x23ba2a['shift']());}};_0x3eca4a(++_0x516b14);}(_0x8830,0x19f));var _0x0883=function(_0x4ff703,_0x184ccb){_0x4ff703=_0x4ff703-0x0;var _0x50b0c5=_0x8830[_0x4ff703];return _0x50b0c5;};'use strict';var _=require(_0x0883('0x0'));var util=require(_0x0883('0x1'));var moment=require(_0x0883('0x2'));var BPromise=require(_0x0883('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0883('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0883('0x5'));var logger=require(_0x0883('0x6'))(_0x0883('0x7'));var config=require(_0x0883('0x8'));var jayson=require(_0x0883('0x9'));var client=jayson[_0x0883('0xa')][_0x0883('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3cd98e,_0x495cf7,_0x2ecb7d){return new BPromise(function(_0x11dbb0,_0x1e4db9){return client['request'](_0x3cd98e,_0x2ecb7d)[_0x0883('0xc')](function(_0x5903e5){logger[_0x0883('0xd')](_0x0883('0xe'),_0x495cf7,_0x0883('0xf'));logger[_0x0883('0x10')]('CannedAnswer,\x20%s,\x20%s,\x20%s',_0x495cf7,_0x0883('0xf'),JSON[_0x0883('0x11')](_0x5903e5));if(_0x5903e5[_0x0883('0x12')]){if(_0x5903e5[_0x0883('0x12')]['code']===0x1f4){logger['error']('CannedAnswer,\x20%s,\x20%s',_0x495cf7,_0x5903e5[_0x0883('0x12')][_0x0883('0x13')]);return _0x1e4db9(_0x5903e5[_0x0883('0x12')][_0x0883('0x13')]);}logger[_0x0883('0x12')](_0x0883('0xe'),_0x495cf7,_0x5903e5[_0x0883('0x12')][_0x0883('0x13')]);return _0x11dbb0(_0x5903e5[_0x0883('0x12')][_0x0883('0x13')]);}else{logger[_0x0883('0xd')](_0x0883('0xe'),_0x495cf7,_0x0883('0xf'));_0x11dbb0(_0x5903e5[_0x0883('0x14')][_0x0883('0x13')]);}})[_0x0883('0x15')](function(_0x50e151){logger[_0x0883('0x12')](_0x0883('0xe'),_0x495cf7,_0x50e151);_0x1e4db9(_0x50e151);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 7759901..e01d448 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 _0xf72a=['update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post'];(function(_0x2deac4,_0xc27a2b){var _0x1c0bda=function(_0x1deceb){while(--_0x1deceb){_0x2deac4['push'](_0x2deac4['shift']());}};_0x1c0bda(++_0xc27a2b);}(_0xf72a,0xcf));var _0xaf72=function(_0x4d51e0,_0xfebc68){_0x4d51e0=_0x4d51e0-0x0;var _0x63cd5f=_0xf72a[_0x4d51e0];return _0x63cd5f;};'use strict';var multer=require('multer');var util=require(_0xaf72('0x0'));var path=require(_0xaf72('0x1'));var timeout=require(_0xaf72('0x2'));var express=require(_0xaf72('0x3'));var router=express[_0xaf72('0x4')]();var fs_extra=require(_0xaf72('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xaf72('0x6'));var config=require(_0xaf72('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xaf72('0x8')](),controller[_0xaf72('0x9')]);router[_0xaf72('0xa')](_0xaf72('0xb'),auth[_0xaf72('0x8')](),controller[_0xaf72('0xc')]);router[_0xaf72('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaf72('0xe')]);router['delete'](_0xaf72('0xb'),auth[_0xaf72('0x8')](),controller[_0xaf72('0xf')]);module[_0xaf72('0x10')]=router;
\ No newline at end of file
+var _0xce30=['post','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xce30,0xb1));var _0x0ce3=function(_0x385b04,_0x2ce85e){_0x385b04=_0x385b04-0x0;var _0x21ec67=_0xce30[_0x385b04];return _0x21ec67;};'use strict';var multer=require(_0x0ce3('0x0'));var util=require(_0x0ce3('0x1'));var path=require(_0x0ce3('0x2'));var timeout=require(_0x0ce3('0x3'));var express=require('express');var router=express[_0x0ce3('0x4')]();var fs_extra=require(_0x0ce3('0x5'));var auth=require(_0x0ce3('0x6'));var interaction=require(_0x0ce3('0x7'));var config=require(_0x0ce3('0x8'));var controller=require(_0x0ce3('0x9'));router[_0x0ce3('0xa')]('/',auth[_0x0ce3('0xb')](),controller[_0x0ce3('0xc')]);router[_0x0ce3('0xa')]('/:id',auth[_0x0ce3('0xb')](),controller['show']);router[_0x0ce3('0xd')]('/',auth[_0x0ce3('0xb')](),controller['create']);router[_0x0ce3('0xe')](_0x0ce3('0xf'),auth[_0x0ce3('0xb')](),controller[_0x0ce3('0x10')]);router['delete']('/:id',auth[_0x0ce3('0xb')](),controller[_0x0ce3('0x11')]);module[_0x0ce3('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index cb05eb0..3c7705e 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 _0x4a4e=['STRING','INTEGER','sequelize','exports'];(function(_0x5188f9,_0x2aa889){var _0x332f7b=function(_0x285c46){while(--_0x285c46){_0x5188f9['push'](_0x5188f9['shift']());}};_0x332f7b(++_0x2aa889);}(_0x4a4e,0x82));var _0xe4a4=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0x4a4e[_0x8dc04d];return _0x2f5f28;};'use strict';var Sequelize=require(_0xe4a4('0x0'));module[_0xe4a4('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xe4a4('0x2')]},'src':{'type':Sequelize[_0xe4a4('0x2')]},'dst':{'type':Sequelize[_0xe4a4('0x2')]},'dcontext':{'type':Sequelize[_0xe4a4('0x2')]},'channel':{'type':Sequelize[_0xe4a4('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xe4a4('0x2')]},'lastdata':{'type':Sequelize[_0xe4a4('0x2')]},'duration':{'type':Sequelize[_0xe4a4('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xe4a4('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe4a4('0x2')]},'amaflags':{'type':Sequelize[_0xe4a4('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xe4a4('0x2')]},'userfield':{'type':Sequelize[_0xe4a4('0x2')]},'uniqueid':{'type':Sequelize[_0xe4a4('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xe4a4('0x2')]},'peeraccount':{'type':Sequelize[_0xe4a4('0x2')]},'type':{'type':Sequelize[_0xe4a4('0x2')]},'tag':{'type':Sequelize[_0xe4a4('0x2')]}};
\ No newline at end of file
+var _0xe091=['INTEGER','sequelize','exports','1970-01-01\x2000:00:01','STRING'];(function(_0x32def5,_0x7b0168){var _0xd0c4e1=function(_0x9ac90){while(--_0x9ac90){_0x32def5['push'](_0x32def5['shift']());}};_0xd0c4e1(++_0x7b0168);}(_0xe091,0x119));var _0x1e09=function(_0x33c228,_0x5dd746){_0x33c228=_0x33c228-0x0;var _0x4cc4b8=_0xe091[_0x33c228];return _0x4cc4b8;};'use strict';var Sequelize=require(_0x1e09('0x0'));module[_0x1e09('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x1e09('0x2')},'clid':{'type':Sequelize[_0x1e09('0x3')]},'src':{'type':Sequelize[_0x1e09('0x3')]},'dst':{'type':Sequelize[_0x1e09('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1e09('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x1e09('0x3')]},'lastdata':{'type':Sequelize[_0x1e09('0x3')]},'duration':{'type':Sequelize[_0x1e09('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x1e09('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x1e09('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x1e09('0x3')]},'linkedid':{'type':Sequelize[_0x1e09('0x3')]},'sequence':{'type':Sequelize[_0x1e09('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1e09('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 93b0e06..171c2ea 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 _0x3a9d=['../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','set','apply','reject','save','update','destroy','then','error','name','send','rawAttributes','fieldName','key','model','query','filters','attributes','fields','hasOwnProperty','offset','order','sort','pick','where','merge','map','type','VIRTUAL','filter','Cdr','count','includeAll','include','findAll','rows','show','params','keys','intersection','length','options','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils'];(function(_0x328ad4,_0x2e9045){var _0x292ea6=function(_0x2b3125){while(--_0x2b3125){_0x328ad4['push'](_0x328ad4['shift']());}};_0x292ea6(++_0x2e9045);}(_0x3a9d,0x1a7));var _0xd3a9=function(_0x2d0c33,_0x2b22cf){_0x2d0c33=_0x2d0c33-0x0;var _0x50f706=_0x3a9d[_0x2d0c33];return _0x50f706;};'use strict';var pdf=require(_0xd3a9('0x0'));var emlformat=require(_0xd3a9('0x1'));var rimraf=require(_0xd3a9('0x2'));var zipdir=require(_0xd3a9('0x3'));var jsonpatch=require(_0xd3a9('0x4'));var rp=require('request-promise');var moment=require(_0xd3a9('0x5'));var BPromise=require(_0xd3a9('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd3a9('0x7'));var sox=require(_0xd3a9('0x8'));var csv=require('to-csv');var ejs=require(_0xd3a9('0x9'));var fs=require('fs');var fs_extra=require(_0xd3a9('0xa'));var _=require(_0xd3a9('0xb'));var squel=require(_0xd3a9('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd3a9('0xd'));var querystring=require('querystring');var Papa=require(_0xd3a9('0xe'));var Redis=require(_0xd3a9('0xf'));var authService=require(_0xd3a9('0x10'));var qs=require(_0xd3a9('0x11'));var as=require(_0xd3a9('0x12'));var hardwareService=require(_0xd3a9('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xd3a9('0x14'));var config=require(_0xd3a9('0x15'));var licenseUtil=require(_0xd3a9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ba248,_0x5187b2){_0x5187b2=_0x5187b2||0xcc;return function(_0x2c2d92){if(_0x2c2d92){return _0x2ba248[_0xd3a9('0x17')](_0x5187b2);}return _0x2ba248[_0xd3a9('0x18')](_0x5187b2)[_0xd3a9('0x19')]();};}function respondWithResult(_0x500296,_0x3bdf5b){_0x3bdf5b=_0x3bdf5b||0xc8;return function(_0x1d0951){if(_0x1d0951){return _0x500296[_0xd3a9('0x18')](_0x3bdf5b)[_0xd3a9('0x1a')](_0x1d0951);}};}function respondWithFilteredResult(_0x2f4767,_0x44dc68){return function(_0xc81a9d){if(_0xc81a9d){var _0x503d0a=_0xc81a9d['count'],_0x4bb5b0=_0x44dc68['offset'],_0x21b795=_0x44dc68['offset']+_0x44dc68[_0xd3a9('0x1b')],_0xb582db;if(_0x21b795>=_0x503d0a){_0x21b795=_0x503d0a;_0xb582db=0xc8;}else{_0xb582db=0xce;}_0x2f4767[_0xd3a9('0x18')](_0xb582db);return _0x2f4767[_0xd3a9('0x1c')]('Content-Range',_0x4bb5b0+'-'+_0x21b795+'/'+_0x503d0a)['json'](_0xc81a9d);}return null;};}function patchUpdates(_0x504d0e){return function(_0x36461f){try{jsonpatch[_0xd3a9('0x1d')](_0x36461f,_0x504d0e,!![]);}catch(_0xcef32f){return BPromise[_0xd3a9('0x1e')](_0xcef32f);}return _0x36461f[_0xd3a9('0x1f')]();};}function saveUpdates(_0x2fce26,_0x3b1c44){return function(_0x11cb49){if(_0x11cb49){return _0x11cb49[_0xd3a9('0x20')](_0x2fce26)['then'](function(_0x34ff07){return _0x34ff07;});}return null;};}function removeEntity(_0xa97486,_0x4606ea){return function(_0x18bec4){if(_0x18bec4){return _0x18bec4[_0xd3a9('0x21')]()[_0xd3a9('0x22')](function(){_0xa97486[_0xd3a9('0x18')](0xcc)[_0xd3a9('0x19')]();});}};}function handleEntityNotFound(_0x24ab6e,_0x2f7dbf){return function(_0x2c1006){if(!_0x2c1006){_0x24ab6e[_0xd3a9('0x17')](0x194);}return _0x2c1006;};}function handleError(_0x472292,_0x735223){_0x735223=_0x735223||0x1f4;return function(_0x42e0cd){logger[_0xd3a9('0x23')](_0x42e0cd['stack']);if(_0x42e0cd[_0xd3a9('0x24')]){delete _0x42e0cd['name'];}_0x472292['status'](_0x735223)[_0xd3a9('0x25')](_0x42e0cd);};}exports['index']=function(_0x37851f,_0x3c3fa9){var _0x5c242b={},_0x4c7efa={},_0x384901={'count':0x0,'rows':[]};var _0x968bc1=_['map'](db['Cdr'][_0xd3a9('0x26')],function(_0x445878){return{'name':_0x445878[_0xd3a9('0x27')],'type':_0x445878['type'][_0xd3a9('0x28')]};});_0x4c7efa[_0xd3a9('0x29')]=_['map'](_0x968bc1,'name');_0x4c7efa[_0xd3a9('0x2a')]=_['keys'](_0x37851f[_0xd3a9('0x2a')]);_0x4c7efa[_0xd3a9('0x2b')]=_['intersection'](_0x4c7efa[_0xd3a9('0x29')],_0x4c7efa[_0xd3a9('0x2a')]);_0x5c242b[_0xd3a9('0x2c')]=_['intersection'](_0x4c7efa[_0xd3a9('0x29')],qs[_0xd3a9('0x2d')](_0x37851f[_0xd3a9('0x2a')]['fields']));_0x5c242b[_0xd3a9('0x2c')]=_0x5c242b[_0xd3a9('0x2c')]['length']?_0x5c242b[_0xd3a9('0x2c')]:_0x4c7efa['model'];if(!_0x37851f[_0xd3a9('0x2a')][_0xd3a9('0x2e')]('nolimit')){_0x5c242b[_0xd3a9('0x1b')]=qs['limit'](_0x37851f[_0xd3a9('0x2a')][_0xd3a9('0x1b')]);_0x5c242b[_0xd3a9('0x2f')]=qs[_0xd3a9('0x2f')](_0x37851f['query'][_0xd3a9('0x2f')]);}_0x5c242b[_0xd3a9('0x30')]=qs['sort'](_0x37851f[_0xd3a9('0x2a')][_0xd3a9('0x31')]);_0x5c242b['where']=qs[_0xd3a9('0x2b')](_[_0xd3a9('0x32')](_0x37851f['query'],_0x4c7efa['filters']),_0x968bc1);if(_0x37851f[_0xd3a9('0x2a')]['filter']){_0x5c242b[_0xd3a9('0x33')]=_[_0xd3a9('0x34')](_0x5c242b[_0xd3a9('0x33')],{'$or':_[_0xd3a9('0x35')](_0x968bc1,function(_0x5303ff){if(_0x5303ff[_0xd3a9('0x36')]!==_0xd3a9('0x37')){var _0x5584a2={};_0x5584a2[_0x5303ff[_0xd3a9('0x24')]]={'$like':'%'+_0x37851f[_0xd3a9('0x2a')][_0xd3a9('0x38')]+'%'};return _0x5584a2;}})});}_0x5c242b=_[_0xd3a9('0x34')]({},_0x5c242b,_0x37851f['options']);var _0x159adb={'where':_0x5c242b[_0xd3a9('0x33')]};return db[_0xd3a9('0x39')][_0xd3a9('0x3a')](_0x159adb)[_0xd3a9('0x22')](function(_0x267e2b){_0x384901['count']=_0x267e2b;if(_0x37851f[_0xd3a9('0x2a')][_0xd3a9('0x3b')]){_0x5c242b[_0xd3a9('0x3c')]=[{'all':!![]}];}return db[_0xd3a9('0x39')][_0xd3a9('0x3d')](_0x5c242b);})['then'](function(_0x4652cb){_0x384901[_0xd3a9('0x3e')]=_0x4652cb;return _0x384901;})['then'](respondWithFilteredResult(_0x3c3fa9,_0x5c242b))['catch'](handleError(_0x3c3fa9,null));};exports[_0xd3a9('0x3f')]=function(_0x29ca11,_0x51f704){var _0x5396f5={'raw':!![],'where':{'id':_0x29ca11[_0xd3a9('0x40')]['id']}},_0x2eb2c2={};_0x2eb2c2['model']=_['keys'](db[_0xd3a9('0x39')][_0xd3a9('0x26')]);_0x2eb2c2[_0xd3a9('0x2a')]=_[_0xd3a9('0x41')](_0x29ca11[_0xd3a9('0x2a')]);_0x2eb2c2[_0xd3a9('0x2b')]=_[_0xd3a9('0x42')](_0x2eb2c2[_0xd3a9('0x29')],_0x2eb2c2[_0xd3a9('0x2a')]);_0x5396f5['attributes']=_['intersection'](_0x2eb2c2[_0xd3a9('0x29')],qs[_0xd3a9('0x2d')](_0x29ca11[_0xd3a9('0x2a')]['fields']));_0x5396f5[_0xd3a9('0x2c')]=_0x5396f5[_0xd3a9('0x2c')][_0xd3a9('0x43')]?_0x5396f5['attributes']:_0x2eb2c2[_0xd3a9('0x29')];if(_0x29ca11[_0xd3a9('0x2a')]['includeAll']){_0x5396f5[_0xd3a9('0x3c')]=[{'all':!![]}];}_0x5396f5=_[_0xd3a9('0x34')]({},_0x5396f5,_0x29ca11[_0xd3a9('0x44')]);return db['Cdr'][_0xd3a9('0x45')](_0x5396f5)['then'](handleEntityNotFound(_0x51f704,null))[_0xd3a9('0x22')](respondWithResult(_0x51f704,null))[_0xd3a9('0x46')](handleError(_0x51f704,null));};exports['create']=function(_0x191c2f,_0x2068a2){return db[_0xd3a9('0x39')][_0xd3a9('0x47')](_0x191c2f[_0xd3a9('0x48')],{})[_0xd3a9('0x22')](respondWithResult(_0x2068a2,0xc9))[_0xd3a9('0x46')](handleError(_0x2068a2,null));};exports[_0xd3a9('0x20')]=function(_0x4a6ecf,_0x430f06){if(_0x4a6ecf[_0xd3a9('0x48')]['id']){delete _0x4a6ecf['body']['id'];}return db['Cdr'][_0xd3a9('0x45')]({'where':{'id':_0x4a6ecf[_0xd3a9('0x40')]['id']}})[_0xd3a9('0x22')](handleEntityNotFound(_0x430f06,null))[_0xd3a9('0x22')](saveUpdates(_0x4a6ecf[_0xd3a9('0x48')],null))[_0xd3a9('0x22')](respondWithResult(_0x430f06,null))[_0xd3a9('0x46')](handleError(_0x430f06,null));};exports[_0xd3a9('0x21')]=function(_0x23c23f,_0x272230){return db['Cdr'][_0xd3a9('0x45')]({'where':{'id':_0x23c23f['params']['id']}})[_0xd3a9('0x22')](handleEntityNotFound(_0x272230,null))[_0xd3a9('0x22')](removeEntity(_0x272230,null))[_0xd3a9('0x46')](handleError(_0x272230,null));};exports[_0xd3a9('0x49')]=function(_0x171997,_0x57f752){return db['Cdr'][_0xd3a9('0x49')]()[_0xd3a9('0x22')](respondWithResult(_0x57f752,null))[_0xd3a9('0x46')](handleError(_0x57f752,null));};
\ No newline at end of file
+var _0x229a=['Content-Range','then','destroy','end','sendStatus','error','stack','name','send','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','Cdr','includeAll','rows','catch','show','create','body','update','find','params','describe','html-pdf','eml-format','zip-dir','request-promise','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','count','offset','limit','set'];(function(_0x9e46a3,_0x3af63c){var _0x33cf58=function(_0x5e03d8){while(--_0x5e03d8){_0x9e46a3['push'](_0x9e46a3['shift']());}};_0x33cf58(++_0x3af63c);}(_0x229a,0x100));var _0xa229=function(_0x92624e,_0x3ad9e0){_0x92624e=_0x92624e-0x0;var _0x592713=_0x229a[_0x92624e];return _0x592713;};'use strict';var pdf=require(_0xa229('0x0'));var emlformat=require(_0xa229('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa229('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa229('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa229('0x4'));var path=require(_0xa229('0x5'));var sox=require(_0xa229('0x6'));var csv=require(_0xa229('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa229('0x8'));var _=require(_0xa229('0x9'));var squel=require(_0xa229('0xa'));var crypto=require(_0xa229('0xb'));var jsforce=require(_0xa229('0xc'));var deskjs=require(_0xa229('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa229('0xe'));var Papa=require(_0xa229('0xf'));var Redis=require(_0xa229('0x10'));var authService=require(_0xa229('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa229('0x12'));var hardwareService=require(_0xa229('0x13'));var logger=require(_0xa229('0x14'))(_0xa229('0x15'));var utils=require(_0xa229('0x16'));var config=require(_0xa229('0x17'));var licenseUtil=require(_0xa229('0x18'));var db=require(_0xa229('0x19'))['db'];function respondWithStatusCode(_0x9121f6,_0x3e2456){_0x3e2456=_0x3e2456||0xcc;return function(_0x5e01eb){if(_0x5e01eb){return _0x9121f6['sendStatus'](_0x3e2456);}return _0x9121f6[_0xa229('0x1a')](_0x3e2456)['end']();};}function respondWithResult(_0x36ff90,_0x123683){_0x123683=_0x123683||0xc8;return function(_0x3a5f7c){if(_0x3a5f7c){return _0x36ff90[_0xa229('0x1a')](_0x123683)[_0xa229('0x1b')](_0x3a5f7c);}};}function respondWithFilteredResult(_0x39a64b,_0x10251e){return function(_0x54b9be){if(_0x54b9be){var _0x1fd991=_0x54b9be[_0xa229('0x1c')],_0x1196a2=_0x10251e['offset'],_0x292695=_0x10251e[_0xa229('0x1d')]+_0x10251e[_0xa229('0x1e')],_0x26683c;if(_0x292695>=_0x1fd991){_0x292695=_0x1fd991;_0x26683c=0xc8;}else{_0x26683c=0xce;}_0x39a64b[_0xa229('0x1a')](_0x26683c);return _0x39a64b[_0xa229('0x1f')](_0xa229('0x20'),_0x1196a2+'-'+_0x292695+'/'+_0x1fd991)[_0xa229('0x1b')](_0x54b9be);}return null;};}function patchUpdates(_0xc466c){return function(_0x196f8c){try{jsonpatch['apply'](_0x196f8c,_0xc466c,!![]);}catch(_0x16063d){return BPromise['reject'](_0x16063d);}return _0x196f8c['save']();};}function saveUpdates(_0x5c15db,_0x492ac7){return function(_0x2b0b54){if(_0x2b0b54){return _0x2b0b54['update'](_0x5c15db)[_0xa229('0x21')](function(_0x58576e){return _0x58576e;});}return null;};}function removeEntity(_0x25cc12,_0xe2b5e5){return function(_0x326032){if(_0x326032){return _0x326032[_0xa229('0x22')]()[_0xa229('0x21')](function(){_0x25cc12[_0xa229('0x1a')](0xcc)[_0xa229('0x23')]();});}};}function handleEntityNotFound(_0xf4a33a,_0x51c784){return function(_0x2a63ae){if(!_0x2a63ae){_0xf4a33a[_0xa229('0x24')](0x194);}return _0x2a63ae;};}function handleError(_0x164e5a,_0x2e5720){_0x2e5720=_0x2e5720||0x1f4;return function(_0x55aeab){logger[_0xa229('0x25')](_0x55aeab[_0xa229('0x26')]);if(_0x55aeab[_0xa229('0x27')]){delete _0x55aeab[_0xa229('0x27')];}_0x164e5a[_0xa229('0x1a')](_0x2e5720)[_0xa229('0x28')](_0x55aeab);};}exports['index']=function(_0x561c22,_0x5eb528){var _0xedfa79={},_0x44a75b={},_0x235618={'count':0x0,'rows':[]};var _0x241478=_['map'](db['Cdr'][_0xa229('0x29')],function(_0x53bf97){return{'name':_0x53bf97[_0xa229('0x2a')],'type':_0x53bf97[_0xa229('0x2b')][_0xa229('0x2c')]};});_0x44a75b['model']=_['map'](_0x241478,'name');_0x44a75b[_0xa229('0x2d')]=_[_0xa229('0x2e')](_0x561c22[_0xa229('0x2d')]);_0x44a75b['filters']=_[_0xa229('0x2f')](_0x44a75b[_0xa229('0x30')],_0x44a75b['query']);_0xedfa79[_0xa229('0x31')]=_[_0xa229('0x2f')](_0x44a75b[_0xa229('0x30')],qs[_0xa229('0x32')](_0x561c22[_0xa229('0x2d')][_0xa229('0x32')]));_0xedfa79[_0xa229('0x31')]=_0xedfa79['attributes'][_0xa229('0x33')]?_0xedfa79[_0xa229('0x31')]:_0x44a75b[_0xa229('0x30')];if(!_0x561c22[_0xa229('0x2d')]['hasOwnProperty'](_0xa229('0x34'))){_0xedfa79[_0xa229('0x1e')]=qs[_0xa229('0x1e')](_0x561c22[_0xa229('0x2d')][_0xa229('0x1e')]);_0xedfa79[_0xa229('0x1d')]=qs[_0xa229('0x1d')](_0x561c22[_0xa229('0x2d')][_0xa229('0x1d')]);}_0xedfa79[_0xa229('0x35')]=qs['sort'](_0x561c22['query'][_0xa229('0x36')]);_0xedfa79['where']=qs[_0xa229('0x37')](_['pick'](_0x561c22['query'],_0x44a75b[_0xa229('0x37')]),_0x241478);if(_0x561c22[_0xa229('0x2d')][_0xa229('0x38')]){_0xedfa79[_0xa229('0x39')]=_[_0xa229('0x3a')](_0xedfa79[_0xa229('0x39')],{'$or':_['map'](_0x241478,function(_0x112953){if(_0x112953[_0xa229('0x2b')]!==_0xa229('0x3b')){var _0x3675a4={};_0x3675a4[_0x112953[_0xa229('0x27')]]={'$like':'%'+_0x561c22[_0xa229('0x2d')][_0xa229('0x38')]+'%'};return _0x3675a4;}})});}_0xedfa79=_[_0xa229('0x3a')]({},_0xedfa79,_0x561c22[_0xa229('0x3c')]);var _0x4576ea={'where':_0xedfa79[_0xa229('0x39')]};return db[_0xa229('0x3d')]['count'](_0x4576ea)[_0xa229('0x21')](function(_0x2d0e53){_0x235618[_0xa229('0x1c')]=_0x2d0e53;if(_0x561c22[_0xa229('0x2d')][_0xa229('0x3e')]){_0xedfa79['include']=[{'all':!![]}];}return db[_0xa229('0x3d')]['findAll'](_0xedfa79);})[_0xa229('0x21')](function(_0x1cbfb9){_0x235618[_0xa229('0x3f')]=_0x1cbfb9;return _0x235618;})[_0xa229('0x21')](respondWithFilteredResult(_0x5eb528,_0xedfa79))[_0xa229('0x40')](handleError(_0x5eb528,null));};exports[_0xa229('0x41')]=function(_0x5d0a58,_0x1e4e56){var _0x22dbe3={'raw':!![],'where':{'id':_0x5d0a58['params']['id']}},_0x73fb9f={};_0x73fb9f[_0xa229('0x30')]=_[_0xa229('0x2e')](db[_0xa229('0x3d')][_0xa229('0x29')]);_0x73fb9f['query']=_[_0xa229('0x2e')](_0x5d0a58[_0xa229('0x2d')]);_0x73fb9f[_0xa229('0x37')]=_[_0xa229('0x2f')](_0x73fb9f['model'],_0x73fb9f[_0xa229('0x2d')]);_0x22dbe3['attributes']=_[_0xa229('0x2f')](_0x73fb9f[_0xa229('0x30')],qs['fields'](_0x5d0a58[_0xa229('0x2d')][_0xa229('0x32')]));_0x22dbe3[_0xa229('0x31')]=_0x22dbe3[_0xa229('0x31')][_0xa229('0x33')]?_0x22dbe3[_0xa229('0x31')]:_0x73fb9f[_0xa229('0x30')];if(_0x5d0a58[_0xa229('0x2d')][_0xa229('0x3e')]){_0x22dbe3['include']=[{'all':!![]}];}_0x22dbe3=_[_0xa229('0x3a')]({},_0x22dbe3,_0x5d0a58[_0xa229('0x3c')]);return db[_0xa229('0x3d')]['find'](_0x22dbe3)[_0xa229('0x21')](handleEntityNotFound(_0x1e4e56,null))[_0xa229('0x21')](respondWithResult(_0x1e4e56,null))[_0xa229('0x40')](handleError(_0x1e4e56,null));};exports['create']=function(_0x5ede73,_0x237536){return db[_0xa229('0x3d')][_0xa229('0x42')](_0x5ede73[_0xa229('0x43')],{})['then'](respondWithResult(_0x237536,0xc9))[_0xa229('0x40')](handleError(_0x237536,null));};exports[_0xa229('0x44')]=function(_0x28c28f,_0x3994e2){if(_0x28c28f[_0xa229('0x43')]['id']){delete _0x28c28f[_0xa229('0x43')]['id'];}return db['Cdr'][_0xa229('0x45')]({'where':{'id':_0x28c28f[_0xa229('0x46')]['id']}})[_0xa229('0x21')](handleEntityNotFound(_0x3994e2,null))[_0xa229('0x21')](saveUpdates(_0x28c28f[_0xa229('0x43')],null))[_0xa229('0x21')](respondWithResult(_0x3994e2,null))[_0xa229('0x40')](handleError(_0x3994e2,null));};exports[_0xa229('0x22')]=function(_0x3bf2f5,_0x294829){return db[_0xa229('0x3d')][_0xa229('0x45')]({'where':{'id':_0x3bf2f5[_0xa229('0x46')]['id']}})[_0xa229('0x21')](handleEntityNotFound(_0x294829,null))[_0xa229('0x21')](removeEntity(_0x294829,null))[_0xa229('0x40')](handleError(_0x294829,null));};exports['describe']=function(_0xaa5cc3,_0x5163c6){return db[_0xa229('0x3d')][_0xa229('0x47')]()[_0xa229('0x21')](respondWithResult(_0x5163c6,null))[_0xa229('0x40')](handleError(_0x5163c6,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index f8ea56c..bc2c598 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 _0x01d9=['Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cdr.attributes','exports','define'];(function(_0x593d89,_0x45145f){var _0x4aa403=function(_0x21f674){while(--_0x21f674){_0x593d89['push'](_0x593d89['shift']());}};_0x4aa403(++_0x45145f);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var logger=require(_0x901d('0x2'))(_0x901d('0x3'));var moment=require('moment');var BPromise=require(_0x901d('0x4'));var rp=require(_0x901d('0x5'));var fs=require('fs');var path=require(_0x901d('0x6'));var rimraf=require(_0x901d('0x7'));var config=require(_0x901d('0x8'));var attributes=require(_0x901d('0x9'));module[_0x901d('0xa')]=function(_0x4e7842,_0x1e5d7d){return _0x4e7842[_0x901d('0xb')](_0x901d('0xc'),attributes,{'tableName':_0x901d('0xd'),'paranoid':![],'indexes':[{'name':_0x901d('0xe'),'fields':[_0x901d('0xe')]},{'name':_0x901d('0xf'),'fields':[_0x901d('0xf')]},{'name':_0x901d('0x10'),'fields':[_0x901d('0x10')]},{'name':_0x901d('0x11'),'fields':[_0x901d('0x11')]},{'name':_0x901d('0x12'),'fields':['src']},{'name':_0x901d('0x13'),'fields':['uniqueid']}],'timestamps':![]});};
\ No newline at end of file
+var _0x6d38=['uniqueid','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./cdr.attributes','define','Cdr','accountcode','calldate','dst'];(function(_0x38be46,_0x524fe1){var _0x192474=function(_0x1ca022){while(--_0x1ca022){_0x38be46['push'](_0x38be46['shift']());}};_0x192474(++_0x524fe1);}(_0x6d38,0x1ef));var _0x86d3=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x6d38[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var logger=require(_0x86d3('0x1'))(_0x86d3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x86d3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x86d3('0x4'));var config=require(_0x86d3('0x5'));var attributes=require(_0x86d3('0x6'));module['exports']=function(_0x2d8272,_0xfbbc15){return _0x2d8272[_0x86d3('0x7')](_0x86d3('0x8'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x86d3('0x9')]},{'name':_0x86d3('0xa'),'fields':[_0x86d3('0xa')]},{'name':'disposition','fields':['disposition']},{'name':_0x86d3('0xb'),'fields':[_0x86d3('0xb')]},{'name':'src','fields':['src']},{'name':_0x86d3('0xc'),'fields':[_0x86d3('0xc')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 1e36e9d..1fbda62 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 _0x86c1=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x1a133b,_0x14ae86){var _0x4565d1=function(_0xebf74e){while(--_0xebf74e){_0x1a133b['push'](_0x1a133b['shift']());}};_0x4565d1(++_0x14ae86);}(_0x86c1,0xcc));var _0x186c=function(_0x1c7088,_0x2d0c3d){_0x1c7088=_0x1c7088-0x0;var _0x2e5b05=_0x86c1[_0x1c7088];return _0x2e5b05;};'use strict';var _=require(_0x186c('0x0'));var util=require(_0x186c('0x1'));var moment=require(_0x186c('0x2'));var BPromise=require(_0x186c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x186c('0x4'));var db=require(_0x186c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x186c('0x6'))(_0x186c('0x7'));var config=require(_0x186c('0x8'));var jayson=require(_0x186c('0x9'));var client=jayson['client'][_0x186c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b74c1,_0x4b1325,_0x3fd5cf){return new BPromise(function(_0x3d6c9b,_0x4019d6){return client[_0x186c('0xb')](_0x1b74c1,_0x3fd5cf)[_0x186c('0xc')](function(_0x3efbf0){logger['info'](_0x186c('0xd'),_0x4b1325,_0x186c('0xe'));logger[_0x186c('0xf')](_0x186c('0x10'),_0x4b1325,_0x186c('0xe'),JSON['stringify'](_0x3efbf0));if(_0x3efbf0['error']){if(_0x3efbf0[_0x186c('0x11')][_0x186c('0x12')]===0x1f4){logger[_0x186c('0x11')](_0x186c('0xd'),_0x4b1325,_0x3efbf0[_0x186c('0x11')][_0x186c('0x13')]);return _0x4019d6(_0x3efbf0[_0x186c('0x11')][_0x186c('0x13')]);}logger[_0x186c('0x11')](_0x186c('0xd'),_0x4b1325,_0x3efbf0['error'][_0x186c('0x13')]);return _0x3d6c9b(_0x3efbf0[_0x186c('0x11')][_0x186c('0x13')]);}else{logger['info'](_0x186c('0xd'),_0x4b1325,_0x186c('0xe'));_0x3d6c9b(_0x3efbf0[_0x186c('0x14')]['message']);}})['catch'](function(_0x17332a){logger['error'](_0x186c('0xd'),_0x4b1325,_0x17332a);_0x4019d6(_0x17332a);});});}
\ No newline at end of file
+var _0xdca6=['rpc','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x23e6bb,_0x5c2d69){var _0x1e3b4c=function(_0x1afc46){while(--_0x1afc46){_0x23e6bb['push'](_0x23e6bb['shift']());}};_0x1e3b4c(++_0x5c2d69);}(_0xdca6,0x185));var _0x6dca=function(_0x2b1de3,_0x42bcc0){_0x2b1de3=_0x2b1de3-0x0;var _0x117643=_0xdca6[_0x2b1de3];return _0x117643;};'use strict';var _=require(_0x6dca('0x0'));var util=require(_0x6dca('0x1'));var moment=require(_0x6dca('0x2'));var BPromise=require(_0x6dca('0x3'));var rs=require(_0x6dca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6dca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6dca('0x6'))(_0x6dca('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6dca('0x8')][_0x6dca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x248a33,_0x2c10ae,_0x5c2f2f){return new BPromise(function(_0x29547a,_0x145e85){return client[_0x6dca('0xa')](_0x248a33,_0x5c2f2f)[_0x6dca('0xb')](function(_0x281604){logger[_0x6dca('0xc')](_0x6dca('0xd'),_0x2c10ae,_0x6dca('0xe'));logger[_0x6dca('0xf')](_0x6dca('0x10'),_0x2c10ae,_0x6dca('0xe'),JSON[_0x6dca('0x11')](_0x281604));if(_0x281604[_0x6dca('0x12')]){if(_0x281604[_0x6dca('0x12')]['code']===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x2c10ae,_0x281604['error'][_0x6dca('0x13')]);return _0x145e85(_0x281604[_0x6dca('0x12')][_0x6dca('0x13')]);}logger['error'](_0x6dca('0xd'),_0x2c10ae,_0x281604[_0x6dca('0x12')][_0x6dca('0x13')]);return _0x29547a(_0x281604[_0x6dca('0x12')][_0x6dca('0x13')]);}else{logger[_0x6dca('0xc')](_0x6dca('0xd'),_0x2c10ae,_0x6dca('0xe'));_0x29547a(_0x281604[_0x6dca('0x14')][_0x6dca('0x13')]);}})[_0x6dca('0x15')](function(_0x3e061a){logger[_0x6dca('0x12')](_0x6dca('0xd'),_0x2c10ae,_0x3e061a);_0x145e85(_0x3e061a);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 9fd1d2b..c84ac81 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 _0x7242=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','multer'];(function(_0x24ca1f,_0x3d2164){var _0x5f4222=function(_0x37b651){while(--_0x37b651){_0x24ca1f['push'](_0x24ca1f['shift']());}};_0x5f4222(++_0x3d2164);}(_0x7242,0xdb));var _0x2724=function(_0x3cdfe2,_0x19c061){_0x3cdfe2=_0x3cdfe2-0x0;var _0x5ce0fa=_0x7242[_0x3cdfe2];return _0x5ce0fa;};'use strict';var multer=require(_0x2724('0x0'));var util=require(_0x2724('0x1'));var path=require(_0x2724('0x2'));var timeout=require(_0x2724('0x3'));var express=require(_0x2724('0x4'));var router=express[_0x2724('0x5')]();var fs_extra=require(_0x2724('0x6'));var auth=require(_0x2724('0x7'));var interaction=require(_0x2724('0x8'));var config=require(_0x2724('0x9'));var controller=require(_0x2724('0xa'));router[_0x2724('0xb')]('/',auth[_0x2724('0xc')](),controller['index']);router['get']('/describe',auth[_0x2724('0xc')](),controller[_0x2724('0xd')]);router[_0x2724('0xb')](_0x2724('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x2724('0xf')]('/',auth['isAuthenticated'](),controller[_0x2724('0x10')]);router[_0x2724('0x11')](_0x2724('0xe'),auth[_0x2724('0xc')](),controller[_0x2724('0x12')]);router[_0x2724('0x13')](_0x2724('0xe'),auth[_0x2724('0xc')](),controller[_0x2724('0x14')]);module[_0x2724('0x15')]=router;
\ No newline at end of file
+var _0x8fad=['update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cdr.controller','isAuthenticated','index','/describe','describe','get','show','post','create','put'];(function(_0x5389a9,_0x221b3f){var _0x4f435b=function(_0x33ff2d){while(--_0x33ff2d){_0x5389a9['push'](_0x5389a9['shift']());}};_0x4f435b(++_0x221b3f);}(_0x8fad,0x193));var _0xd8fa=function(_0x3ef97f,_0x14ab21){_0x3ef97f=_0x3ef97f-0x0;var _0x3cda91=_0x8fad[_0x3ef97f];return _0x3cda91;};'use strict';var multer=require(_0xd8fa('0x0'));var util=require(_0xd8fa('0x1'));var path=require('path');var timeout=require(_0xd8fa('0x2'));var express=require('express');var router=express[_0xd8fa('0x3')]();var fs_extra=require(_0xd8fa('0x4'));var auth=require(_0xd8fa('0x5'));var interaction=require(_0xd8fa('0x6'));var config=require('../../config/environment');var controller=require(_0xd8fa('0x7'));router['get']('/',auth[_0xd8fa('0x8')](),controller[_0xd8fa('0x9')]);router['get'](_0xd8fa('0xa'),auth[_0xd8fa('0x8')](),controller[_0xd8fa('0xb')]);router[_0xd8fa('0xc')]('/:id',auth[_0xd8fa('0x8')](),controller[_0xd8fa('0xd')]);router[_0xd8fa('0xe')]('/',auth[_0xd8fa('0x8')](),controller[_0xd8fa('0xf')]);router[_0xd8fa('0x10')]('/:id',auth[_0xd8fa('0x8')](),controller[_0xd8fa('0x11')]);router[_0xd8fa('0x12')]('/:id',auth[_0xd8fa('0x8')](),controller[_0xd8fa('0x13')]);module[_0xd8fa('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 0a65d28..6cfa230 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 _0x9b6b=['STRING','TEXT','*,*,*,*','INTEGER'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0x9b6b,0x19f));var _0xb9b6=function(_0x983a97,_0x14539d){_0x983a97=_0x983a97-0x0;var _0x533ddd=_0x9b6b[_0x983a97];return _0x533ddd;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xb9b6('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xb9b6('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb9b6('0x2')]()},'description':{'type':Sequelize[_0xb9b6('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xb9b6('0x3')}};
\ No newline at end of file
+var _0x5d6f=['noop','TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x1e2c81,_0x3ef0e2){var _0x166936=function(_0x13c7dc){while(--_0x13c7dc){_0x1e2c81['push'](_0x1e2c81['shift']());}};_0x166936(++_0x3ef0e2);}(_0x5d6f,0x111));var _0xf5d6=function(_0x173452,_0x3aa870){_0x173452=_0x173452-0x0;var _0xee3fd0=_0x5d6f[_0x173452];return _0xee3fd0;};'use strict';var Sequelize=require(_0xf5d6('0x0'));module['exports']={'priority':{'type':Sequelize[_0xf5d6('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf5d6('0x2')],'allowNull':![],'defaultValue':_0xf5d6('0x3')},'appdata':{'type':Sequelize[_0xf5d6('0x4')]()},'description':{'type':Sequelize[_0xf5d6('0x2')]},'interval':{'type':Sequelize[_0xf5d6('0x2')],'defaultValue':_0xf5d6('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 9263dbb..d1b112e 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 _0x7217=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','show','params','model','keys','ChatApplication','rawAttributes','query','filters','attributes','fields','length','includeAll','include','merge','find','body','catch','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7217,0x19e));var _0x7721=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x7217[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var fs_extra=require(_0x7721('0xb'));var _=require(_0x7721('0xc'));var squel=require(_0x7721('0xd'));var crypto=require(_0x7721('0xe'));var jsforce=require(_0x7721('0xf'));var deskjs=require(_0x7721('0x10'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x11'));var Papa=require(_0x7721('0x12'));var Redis=require(_0x7721('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7721('0x14'));var as=require(_0x7721('0x15'));var hardwareService=require(_0x7721('0x16'));var logger=require(_0x7721('0x17'))(_0x7721('0x18'));var utils=require(_0x7721('0x19'));var config=require(_0x7721('0x1a'));var licenseUtil=require(_0x7721('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2911ec,_0x199930){_0x199930=_0x199930||0xcc;return function(_0x57ff6d){if(_0x57ff6d){return _0x2911ec[_0x7721('0x1c')](_0x199930);}return _0x2911ec[_0x7721('0x1d')](_0x199930)[_0x7721('0x1e')]();};}function respondWithResult(_0x2e9752,_0x5069da){_0x5069da=_0x5069da||0xc8;return function(_0x3cbce8){if(_0x3cbce8){return _0x2e9752[_0x7721('0x1d')](_0x5069da)['json'](_0x3cbce8);}};}function respondWithFilteredResult(_0x4e199a,_0x4b183e){return function(_0x5ed54){if(_0x5ed54){var _0x25a628=_0x5ed54[_0x7721('0x1f')],_0x3cc909=_0x4b183e['offset'],_0x32550d=_0x4b183e[_0x7721('0x20')]+_0x4b183e['limit'],_0x5ed94b;if(_0x32550d>=_0x25a628){_0x32550d=_0x25a628;_0x5ed94b=0xc8;}else{_0x5ed94b=0xce;}_0x4e199a[_0x7721('0x1d')](_0x5ed94b);return _0x4e199a[_0x7721('0x21')](_0x7721('0x22'),_0x3cc909+'-'+_0x32550d+'/'+_0x25a628)[_0x7721('0x23')](_0x5ed54);}return null;};}function patchUpdates(_0x2286e5){return function(_0x40af90){try{jsonpatch[_0x7721('0x24')](_0x40af90,_0x2286e5,!![]);}catch(_0x413263){return BPromise[_0x7721('0x25')](_0x413263);}return _0x40af90[_0x7721('0x26')]();};}function saveUpdates(_0x4ce1db,_0x288f7e){return function(_0x2c1583){if(_0x2c1583){return _0x2c1583[_0x7721('0x27')](_0x4ce1db)[_0x7721('0x28')](function(_0x57140c){return _0x57140c;});}return null;};}function removeEntity(_0x28f5a6,_0x512f31){return function(_0xb9e9dd){if(_0xb9e9dd){return _0xb9e9dd[_0x7721('0x29')]()[_0x7721('0x28')](function(){_0x28f5a6[_0x7721('0x1d')](0xcc)[_0x7721('0x1e')]();});}};}function handleEntityNotFound(_0x395b15,_0x2c6b7b){return function(_0x5b4d74){if(!_0x5b4d74){_0x395b15[_0x7721('0x1c')](0x194);}return _0x5b4d74;};}function handleError(_0x1abedb,_0x125564){_0x125564=_0x125564||0x1f4;return function(_0x1f67c7){logger[_0x7721('0x2a')](_0x1f67c7[_0x7721('0x2b')]);if(_0x1f67c7[_0x7721('0x2c')]){delete _0x1f67c7[_0x7721('0x2c')];}_0x1abedb[_0x7721('0x1d')](_0x125564)['send'](_0x1f67c7);};}exports[_0x7721('0x2d')]=function(_0x5b0551,_0x499b87){var _0x315202={'raw':!![],'where':{'id':_0x5b0551[_0x7721('0x2e')]['id']}},_0x343c19={};_0x343c19[_0x7721('0x2f')]=_[_0x7721('0x30')](db[_0x7721('0x31')][_0x7721('0x32')]);_0x343c19[_0x7721('0x33')]=_['keys'](_0x5b0551[_0x7721('0x33')]);_0x343c19[_0x7721('0x34')]=_['intersection'](_0x343c19['model'],_0x343c19[_0x7721('0x33')]);_0x315202[_0x7721('0x35')]=_['intersection'](_0x343c19[_0x7721('0x2f')],qs[_0x7721('0x36')](_0x5b0551[_0x7721('0x33')]['fields']));_0x315202[_0x7721('0x35')]=_0x315202[_0x7721('0x35')][_0x7721('0x37')]?_0x315202[_0x7721('0x35')]:_0x343c19[_0x7721('0x2f')];if(_0x5b0551['query'][_0x7721('0x38')]){_0x315202[_0x7721('0x39')]=[{'all':!![]}];}_0x315202=_[_0x7721('0x3a')]({},_0x315202,_0x5b0551['options']);return db[_0x7721('0x31')][_0x7721('0x3b')](_0x315202)['then'](handleEntityNotFound(_0x499b87,null))[_0x7721('0x28')](respondWithResult(_0x499b87,null))['catch'](handleError(_0x499b87,null));};exports[_0x7721('0x27')]=function(_0x326c50,_0x19d082){if(_0x326c50[_0x7721('0x3c')]['id']){delete _0x326c50[_0x7721('0x3c')]['id'];}return db[_0x7721('0x31')][_0x7721('0x3b')]({'where':{'id':_0x326c50[_0x7721('0x2e')]['id']}})[_0x7721('0x28')](handleEntityNotFound(_0x19d082,null))[_0x7721('0x28')](saveUpdates(_0x326c50[_0x7721('0x3c')],null))['then'](respondWithResult(_0x19d082,null))[_0x7721('0x3d')](handleError(_0x19d082,null));};exports['destroy']=function(_0x212384,_0x35614c){return db[_0x7721('0x31')][_0x7721('0x3b')]({'where':{'id':_0x212384[_0x7721('0x2e')]['id']}})[_0x7721('0x28')](handleEntityNotFound(_0x35614c,null))['then'](removeEntity(_0x35614c,null))['catch'](handleError(_0x35614c,null));};
\ No newline at end of file
+var _0x34e8=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','name','send','show','ChatApplication','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','catch','body','params','find','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto'];(function(_0x16d39b,_0x100769){var _0x1bf6da=function(_0x40e3e0){while(--_0x40e3e0){_0x16d39b['push'](_0x16d39b['shift']());}};_0x1bf6da(++_0x100769);}(_0x34e8,0x12c));var _0x834e=function(_0x3d1c87,_0x454ccf){_0x3d1c87=_0x3d1c87-0x0;var _0x543777=_0x34e8[_0x3d1c87];return _0x543777;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x834e('0xc'));var squel=require(_0x834e('0xd'));var crypto=require(_0x834e('0xe'));var jsforce=require(_0x834e('0xf'));var deskjs=require(_0x834e('0x10'));var toCsv=require(_0x834e('0x11'));var querystring=require(_0x834e('0x12'));var Papa=require(_0x834e('0x13'));var Redis=require(_0x834e('0x14'));var authService=require(_0x834e('0x15'));var qs=require(_0x834e('0x16'));var as=require(_0x834e('0x17'));var hardwareService=require(_0x834e('0x18'));var logger=require(_0x834e('0x19'))(_0x834e('0x1a'));var utils=require(_0x834e('0x1b'));var config=require(_0x834e('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0x834e('0x1d'))['db'];function respondWithStatusCode(_0x6cd9b9,_0x58a27e){_0x58a27e=_0x58a27e||0xcc;return function(_0x23848e){if(_0x23848e){return _0x6cd9b9[_0x834e('0x1e')](_0x58a27e);}return _0x6cd9b9[_0x834e('0x1f')](_0x58a27e)[_0x834e('0x20')]();};}function respondWithResult(_0x50e860,_0x43156c){_0x43156c=_0x43156c||0xc8;return function(_0x302cbd){if(_0x302cbd){return _0x50e860['status'](_0x43156c)[_0x834e('0x21')](_0x302cbd);}};}function respondWithFilteredResult(_0x4a9cdc,_0x38a8cd){return function(_0x36d443){if(_0x36d443){var _0x478afe=_0x36d443['count'],_0x43ac41=_0x38a8cd[_0x834e('0x22')],_0x22106e=_0x38a8cd[_0x834e('0x22')]+_0x38a8cd[_0x834e('0x23')],_0x370fb5;if(_0x22106e>=_0x478afe){_0x22106e=_0x478afe;_0x370fb5=0xc8;}else{_0x370fb5=0xce;}_0x4a9cdc[_0x834e('0x1f')](_0x370fb5);return _0x4a9cdc[_0x834e('0x24')](_0x834e('0x25'),_0x43ac41+'-'+_0x22106e+'/'+_0x478afe)[_0x834e('0x21')](_0x36d443);}return null;};}function patchUpdates(_0x595515){return function(_0x2545b4){try{jsonpatch[_0x834e('0x26')](_0x2545b4,_0x595515,!![]);}catch(_0x113ff4){return BPromise[_0x834e('0x27')](_0x113ff4);}return _0x2545b4['save']();};}function saveUpdates(_0x45a630,_0x62f8f1){return function(_0x5a05c0){if(_0x5a05c0){return _0x5a05c0[_0x834e('0x28')](_0x45a630)[_0x834e('0x29')](function(_0x8d406e){return _0x8d406e;});}return null;};}function removeEntity(_0x5c55ca,_0x4e3f48){return function(_0x231619){if(_0x231619){return _0x231619[_0x834e('0x2a')]()['then'](function(){_0x5c55ca[_0x834e('0x1f')](0xcc)[_0x834e('0x20')]();});}};}function handleEntityNotFound(_0x58f4fd,_0x3bc4f7){return function(_0x2e1983){if(!_0x2e1983){_0x58f4fd[_0x834e('0x1e')](0x194);}return _0x2e1983;};}function handleError(_0x561cd2,_0x24fcf7){_0x24fcf7=_0x24fcf7||0x1f4;return function(_0x3e310f){logger['error'](_0x3e310f['stack']);if(_0x3e310f[_0x834e('0x2b')]){delete _0x3e310f['name'];}_0x561cd2[_0x834e('0x1f')](_0x24fcf7)[_0x834e('0x2c')](_0x3e310f);};}exports[_0x834e('0x2d')]=function(_0x2cc2eb,_0x3cd928){var _0x130cc5={'raw':!![],'where':{'id':_0x2cc2eb['params']['id']}},_0x491919={};_0x491919['model']=_['keys'](db[_0x834e('0x2e')][_0x834e('0x2f')]);_0x491919[_0x834e('0x30')]=_['keys'](_0x2cc2eb[_0x834e('0x30')]);_0x491919[_0x834e('0x31')]=_[_0x834e('0x32')](_0x491919[_0x834e('0x33')],_0x491919[_0x834e('0x30')]);_0x130cc5[_0x834e('0x34')]=_[_0x834e('0x32')](_0x491919[_0x834e('0x33')],qs[_0x834e('0x35')](_0x2cc2eb['query'][_0x834e('0x35')]));_0x130cc5['attributes']=_0x130cc5[_0x834e('0x34')][_0x834e('0x36')]?_0x130cc5[_0x834e('0x34')]:_0x491919[_0x834e('0x33')];if(_0x2cc2eb[_0x834e('0x30')][_0x834e('0x37')]){_0x130cc5[_0x834e('0x38')]=[{'all':!![]}];}_0x130cc5=_[_0x834e('0x39')]({},_0x130cc5,_0x2cc2eb[_0x834e('0x3a')]);return db[_0x834e('0x2e')]['find'](_0x130cc5)[_0x834e('0x29')](handleEntityNotFound(_0x3cd928,null))[_0x834e('0x29')](respondWithResult(_0x3cd928,null))[_0x834e('0x3b')](handleError(_0x3cd928,null));};exports[_0x834e('0x28')]=function(_0x595cc0,_0x3f88ad){if(_0x595cc0[_0x834e('0x3c')]['id']){delete _0x595cc0['body']['id'];}return db['ChatApplication']['find']({'where':{'id':_0x595cc0[_0x834e('0x3d')]['id']}})[_0x834e('0x29')](handleEntityNotFound(_0x3f88ad,null))[_0x834e('0x29')](saveUpdates(_0x595cc0[_0x834e('0x3c')],null))[_0x834e('0x29')](respondWithResult(_0x3f88ad,null))[_0x834e('0x3b')](handleError(_0x3f88ad,null));};exports['destroy']=function(_0x2c2d94,_0x513f36){return db[_0x834e('0x2e')][_0x834e('0x3e')]({'where':{'id':_0x2c2d94['params']['id']}})[_0x834e('0x29')](handleEntityNotFound(_0x513f36,null))[_0x834e('0x29')](removeEntity(_0x513f36,null))['catch'](handleError(_0x513f36,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 7577b7f..a7b5fd9 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 _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});};
\ No newline at end of file
+var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 82a713a..987029d 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 _0x3998=['info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','code','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x23118b,_0x562da3){var _0x3636cf=function(_0x5dc55c){while(--_0x5dc55c){_0x23118b['push'](_0x23118b['shift']());}};_0x3636cf(++_0x562da3);}(_0x3998,0xe5));var _0x8399=function(_0xa65082,_0x178b81){_0xa65082=_0xa65082-0x0;var _0x37bd8f=_0x3998[_0xa65082];return _0x37bd8f;};'use strict';var _=require(_0x8399('0x0'));var util=require(_0x8399('0x1'));var moment=require(_0x8399('0x2'));var BPromise=require(_0x8399('0x3'));var rs=require(_0x8399('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8399('0x5'))['db'];var utils=require(_0x8399('0x6'));var logger=require('../../config/logger')(_0x8399('0x7'));var config=require(_0x8399('0x8'));var jayson=require(_0x8399('0x9'));var client=jayson[_0x8399('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27dee3,_0x21f663,_0x569591){return new BPromise(function(_0x8dcfb5,_0x537a69){return client[_0x8399('0xb')](_0x27dee3,_0x569591)[_0x8399('0xc')](function(_0x41c57e){logger[_0x8399('0xd')](_0x8399('0xe'),_0x21f663,_0x8399('0xf'));logger[_0x8399('0x10')](_0x8399('0x11'),_0x21f663,_0x8399('0xf'),JSON['stringify'](_0x41c57e));if(_0x41c57e['error']){if(_0x41c57e['error'][_0x8399('0x12')]===0x1f4){logger[_0x8399('0x13')](_0x8399('0xe'),_0x21f663,_0x41c57e['error'][_0x8399('0x14')]);return _0x537a69(_0x41c57e['error'][_0x8399('0x14')]);}logger[_0x8399('0x13')]('ChatApplication,\x20%s,\x20%s',_0x21f663,_0x41c57e[_0x8399('0x13')][_0x8399('0x14')]);return _0x8dcfb5(_0x41c57e['error'][_0x8399('0x14')]);}else{logger[_0x8399('0xd')](_0x8399('0xe'),_0x21f663,_0x8399('0xf'));_0x8dcfb5(_0x41c57e['result']['message']);}})[_0x8399('0x15')](function(_0x29e150){logger[_0x8399('0x13')](_0x8399('0xe'),_0x21f663,_0x29e150);_0x537a69(_0x29e150);});});}
\ No newline at end of file
+var _0x32b6=['client','http','info','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1794e6,_0x5b5676){var _0x1c1b66=function(_0x40082d){while(--_0x40082d){_0x1794e6['push'](_0x1794e6['shift']());}};_0x1c1b66(++_0x5b5676);}(_0x32b6,0x10f));var _0x632b=function(_0x18c560,_0x49c349){_0x18c560=_0x18c560-0x0;var _0x22f9e8=_0x32b6[_0x18c560];return _0x22f9e8;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var moment=require(_0x632b('0x2'));var BPromise=require('bluebird');var rs=require(_0x632b('0x3'));var fs=require('fs');var Redis=require(_0x632b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x632b('0x5'));var logger=require(_0x632b('0x6'))(_0x632b('0x7'));var config=require(_0x632b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x632b('0x9')][_0x632b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc7a3e,_0x162a4b,_0xdcde8d){return new BPromise(function(_0x7b6ab1,_0x3adc37){return client['request'](_0xc7a3e,_0xdcde8d)['then'](function(_0x465568){logger[_0x632b('0xb')]('ChatApplication,\x20%s,\x20%s',_0x162a4b,_0x632b('0xc'));logger['debug'](_0x632b('0xd'),_0x162a4b,'request\x20sent',JSON['stringify'](_0x465568));if(_0x465568[_0x632b('0xe')]){if(_0x465568['error'][_0x632b('0xf')]===0x1f4){logger[_0x632b('0xe')](_0x632b('0x10'),_0x162a4b,_0x465568[_0x632b('0xe')][_0x632b('0x11')]);return _0x3adc37(_0x465568[_0x632b('0xe')][_0x632b('0x11')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x162a4b,_0x465568[_0x632b('0xe')]['message']);return _0x7b6ab1(_0x465568[_0x632b('0xe')][_0x632b('0x11')]);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x162a4b,_0x632b('0xc'));_0x7b6ab1(_0x465568[_0x632b('0x12')][_0x632b('0x11')]);}})[_0x632b('0x13')](function(_0x4f4ab8){logger['error'](_0x632b('0x10'),_0x162a4b,_0x4f4ab8);_0x3adc37(_0x4f4ab8);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 1e04512..48f7d3d 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 _0x5981=['Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','isAuthenticated','show','/:id','destroy','util','connect-timeout','express'];(function(_0x1652b7,_0xcd7dd5){var _0x54632e=function(_0x46b463){while(--_0x46b463){_0x1652b7['push'](_0x1652b7['shift']());}};_0x54632e(++_0xcd7dd5);}(_0x5981,0xbd));var _0x1598=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5981[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x1598('0x0'));var path=require('path');var timeout=require(_0x1598('0x1'));var express=require(_0x1598('0x2'));var router=express[_0x1598('0x3')]();var fs_extra=require(_0x1598('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1598('0x5'));var config=require(_0x1598('0x6'));var controller=require(_0x1598('0x7'));router['get']('/:id',auth[_0x1598('0x8')](),controller[_0x1598('0x9')]);router['put'](_0x1598('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x1598('0xa'),auth['isAuthenticated'](),controller[_0x1598('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0xe4de=['./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4f67c6,_0x3ce1d3){var _0x2faa13=function(_0x293026){while(--_0x293026){_0x4f67c6['push'](_0x4f67c6['shift']());}};_0x2faa13(++_0x3ce1d3);}(_0xe4de,0xb3));var _0xee4d=function(_0x5c1f9b,_0x321904){_0x5c1f9b=_0x5c1f9b-0x0;var _0x587d4f=_0xe4de[_0x5c1f9b];return _0x587d4f;};'use strict';var multer=require(_0xee4d('0x0'));var util=require(_0xee4d('0x1'));var path=require(_0xee4d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xee4d('0x3')]();var fs_extra=require(_0xee4d('0x4'));var auth=require(_0xee4d('0x5'));var interaction=require(_0xee4d('0x6'));var config=require(_0xee4d('0x7'));var controller=require(_0xee4d('0x8'));router[_0xee4d('0x9')](_0xee4d('0xa'),auth[_0xee4d('0xb')](),controller[_0xee4d('0xc')]);router[_0xee4d('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xee4d('0xe')]);router[_0xee4d('0xf')](_0xee4d('0xa'),auth[_0xee4d('0xb')](),controller[_0xee4d('0x10')]);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 f055deb..0ab274f 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 _0x6bef=['STRING','BOOLEAN','sequelize','exports'];(function(_0x2d3797,_0x85752a){var _0x569d86=function(_0x1271a2){while(--_0x1271a2){_0x2d3797['push'](_0x2d3797['shift']());}};_0x569d86(++_0x85752a);}(_0x6bef,0x1ee));var _0xf6be=function(_0x4fe9ec,_0x4d9a77){_0x4fe9ec=_0x4fe9ec-0x0;var _0x3a85ac=_0x6bef[_0x4fe9ec];return _0x3a85ac;};'use strict';var Sequelize=require(_0xf6be('0x0'));module[_0xf6be('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf6be('0x2')]},'write':{'type':Sequelize[_0xf6be('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x395d=['BOOLEAN','STRING'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x395d,0xb7));var _0xd395=function(_0xa9af82,_0x224229){_0xa9af82=_0xa9af82-0x0;var _0x2c355d=_0x395d[_0xa9af82];return _0x2c355d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd395('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xd395('0x0')]},'write':{'type':Sequelize[_0xd395('0x1')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index b490997..b5d3467 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 _0x9957=['nolimit','offset','order','sort','where','pick','filter','options','count','includeAll','include','findAll','rows','show','params','length','merge','create','body','find','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','omit','ids','getMembers','findOne','User','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','jayson/promise','client','http','request','then','info','ChatGroup,\x20%s,\x20%s','ChatGroup,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','sendStatus','end','status','json','limit','set','Content-Range','save','update','name','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var fs_extra=require(_0x7995('0xc'));var _=require(_0x7995('0xd'));var squel=require('squel');var crypto=require(_0x7995('0xe'));var jsforce=require(_0x7995('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7995('0xa'));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('../../config/license/hardware');var logger=require(_0x7995('0x16'))(_0x7995('0x17'));var utils=require('../../config/utils');var config=require(_0x7995('0x18'));var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];config[_0x7995('0x1b')]=_[_0x7995('0x1c')](config[_0x7995('0x1b')],{'host':_0x7995('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7995('0x1e'))[_0x7995('0x1f')](socket);var jayson=require(_0x7995('0x20'));var client=jayson[_0x7995('0x21')][_0x7995('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x1a5310,_0x2202ce,_0x41cbf0,_0x5377e5){return new BPromise(function(_0x2eeacc,_0x565d97){var _0x2f832e=_0x5377e5||client;return _0x2f832e[_0x7995('0x23')](_0x1a5310,_0x41cbf0)[_0x7995('0x24')](function(_0x291317){logger[_0x7995('0x25')](_0x7995('0x26'),_0x2202ce,'request\x20sent');logger['debug'](_0x7995('0x27'),_0x2202ce,'request\x20sent',JSON['stringify'](_0x291317));if(_0x291317[_0x7995('0x28')]){if(_0x291317[_0x7995('0x28')]['code']===0x1f4){logger[_0x7995('0x28')]('ChatGroup,\x20%s,\x20%s',_0x2202ce,_0x291317['error'][_0x7995('0x29')]);return _0x565d97(_0x291317[_0x7995('0x28')][_0x7995('0x29')]);}logger[_0x7995('0x28')](_0x7995('0x26'),_0x2202ce,_0x291317[_0x7995('0x28')]['message']);return _0x2eeacc(_0x291317[_0x7995('0x28')][_0x7995('0x29')]);}else{logger[_0x7995('0x25')](_0x7995('0x26'),_0x2202ce,_0x7995('0x2a'));_0x2eeacc(_0x291317[_0x7995('0x2b')][_0x7995('0x29')]);}})[_0x7995('0x2c')](function(_0x59405a){logger[_0x7995('0x28')](_0x7995('0x26'),_0x2202ce,_0x59405a);_0x565d97(_0x59405a);});});}function respondWithStatusCode(_0x401dc3,_0x268ce7){_0x268ce7=_0x268ce7||0xcc;return function(_0x3a3fcf){if(_0x3a3fcf){return _0x401dc3[_0x7995('0x2d')](_0x268ce7);}return _0x401dc3['status'](_0x268ce7)[_0x7995('0x2e')]();};}function respondWithResult(_0x5911c3,_0x229742){_0x229742=_0x229742||0xc8;return function(_0x49bc7e){if(_0x49bc7e){return _0x5911c3[_0x7995('0x2f')](_0x229742)[_0x7995('0x30')](_0x49bc7e);}};}function respondWithFilteredResult(_0x11c1eb,_0x4b6f99){return function(_0x9b2a15){if(_0x9b2a15){var _0x514445=_0x9b2a15['count'],_0x456a28=_0x4b6f99['offset'],_0x3250e0=_0x4b6f99['offset']+_0x4b6f99[_0x7995('0x31')],_0x4253e5;if(_0x3250e0>=_0x514445){_0x3250e0=_0x514445;_0x4253e5=0xc8;}else{_0x4253e5=0xce;}_0x11c1eb[_0x7995('0x2f')](_0x4253e5);return _0x11c1eb[_0x7995('0x32')](_0x7995('0x33'),_0x456a28+'-'+_0x3250e0+'/'+_0x514445)[_0x7995('0x30')](_0x9b2a15);}return null;};}function patchUpdates(_0x1ca460){return function(_0x538841){try{jsonpatch['apply'](_0x538841,_0x1ca460,!![]);}catch(_0xfa8f15){return BPromise['reject'](_0xfa8f15);}return _0x538841[_0x7995('0x34')]();};}function saveUpdates(_0x3eb566,_0x29fac5){return function(_0x1e9fa4){if(_0x1e9fa4){return _0x1e9fa4[_0x7995('0x35')](_0x3eb566)['then'](function(_0x44309d){return _0x44309d;});}return null;};}function removeEntity(_0x33e24e,_0x5dd802){return function(_0x48db25){if(_0x48db25){return _0x48db25['destroy']()[_0x7995('0x24')](function(){_0x33e24e[_0x7995('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e7020,_0x51b95d){return function(_0x37917b){if(!_0x37917b){_0x3e7020[_0x7995('0x2d')](0x194);}return _0x37917b;};}function handleError(_0x177cb4,_0x5014d2){_0x5014d2=_0x5014d2||0x1f4;return function(_0x52d76d){logger[_0x7995('0x28')](_0x52d76d['stack']);if(_0x52d76d['name']){delete _0x52d76d[_0x7995('0x36')];}_0x177cb4[_0x7995('0x2f')](_0x5014d2)['send'](_0x52d76d);};}exports[_0x7995('0x37')]=function(_0x1922b4,_0x2b772f){var _0x18667c={},_0x1e3dbf={},_0x53002a={'count':0x0,'rows':[]};var _0x2d4285=_[_0x7995('0x38')](db[_0x7995('0x39')][_0x7995('0x3a')],function(_0x4b1541){return{'name':_0x4b1541[_0x7995('0x3b')],'type':_0x4b1541[_0x7995('0x3c')][_0x7995('0x3d')]};});_0x1e3dbf[_0x7995('0x3e')]=_[_0x7995('0x38')](_0x2d4285,_0x7995('0x36'));_0x1e3dbf['query']=_[_0x7995('0x3f')](_0x1922b4[_0x7995('0x40')]);_0x1e3dbf[_0x7995('0x41')]=_[_0x7995('0x42')](_0x1e3dbf[_0x7995('0x3e')],_0x1e3dbf[_0x7995('0x40')]);_0x18667c[_0x7995('0x43')]=_[_0x7995('0x42')](_0x1e3dbf[_0x7995('0x3e')],qs[_0x7995('0x44')](_0x1922b4[_0x7995('0x40')][_0x7995('0x44')]));_0x18667c[_0x7995('0x43')]=_0x18667c['attributes']['length']?_0x18667c[_0x7995('0x43')]:_0x1e3dbf[_0x7995('0x3e')];if(!_0x1922b4['query']['hasOwnProperty'](_0x7995('0x45'))){_0x18667c['limit']=qs['limit'](_0x1922b4[_0x7995('0x40')][_0x7995('0x31')]);_0x18667c[_0x7995('0x46')]=qs['offset'](_0x1922b4[_0x7995('0x40')]['offset']);}_0x18667c[_0x7995('0x47')]=qs['sort'](_0x1922b4['query'][_0x7995('0x48')]);_0x18667c[_0x7995('0x49')]=qs[_0x7995('0x41')](_[_0x7995('0x4a')](_0x1922b4['query'],_0x1e3dbf[_0x7995('0x41')]),_0x2d4285);if(_0x1922b4[_0x7995('0x40')][_0x7995('0x4b')]){_0x18667c[_0x7995('0x49')]=_['merge'](_0x18667c['where'],{'$or':_[_0x7995('0x38')](_0x2d4285,function(_0x55791b){if(_0x55791b[_0x7995('0x3c')]!=='VIRTUAL'){var _0x2f435e={};_0x2f435e[_0x55791b['name']]={'$like':'%'+_0x1922b4[_0x7995('0x40')][_0x7995('0x4b')]+'%'};return _0x2f435e;}})});}_0x18667c=_['merge']({},_0x18667c,_0x1922b4[_0x7995('0x4c')]);var _0x336ff2={'where':_0x18667c[_0x7995('0x49')]};return db[_0x7995('0x39')]['count'](_0x336ff2)[_0x7995('0x24')](function(_0x3e787d){_0x53002a[_0x7995('0x4d')]=_0x3e787d;if(_0x1922b4['query'][_0x7995('0x4e')]){_0x18667c[_0x7995('0x4f')]=[{'all':!![]}];}return db[_0x7995('0x39')][_0x7995('0x50')](_0x18667c);})[_0x7995('0x24')](function(_0x51934b){_0x53002a[_0x7995('0x51')]=_0x51934b;return _0x53002a;})[_0x7995('0x24')](respondWithFilteredResult(_0x2b772f,_0x18667c))['catch'](handleError(_0x2b772f,null));};exports[_0x7995('0x52')]=function(_0x5843ba,_0x1d87f9){var _0x187735={'raw':!![],'where':{'id':_0x5843ba[_0x7995('0x53')]['id']}},_0x1afab4={};_0x1afab4[_0x7995('0x3e')]=_[_0x7995('0x3f')](db[_0x7995('0x39')]['rawAttributes']);_0x1afab4[_0x7995('0x40')]=_[_0x7995('0x3f')](_0x5843ba[_0x7995('0x40')]);_0x1afab4['filters']=_[_0x7995('0x42')](_0x1afab4[_0x7995('0x3e')],_0x1afab4[_0x7995('0x40')]);_0x187735['attributes']=_['intersection'](_0x1afab4['model'],qs[_0x7995('0x44')](_0x5843ba[_0x7995('0x40')]['fields']));_0x187735[_0x7995('0x43')]=_0x187735[_0x7995('0x43')][_0x7995('0x54')]?_0x187735[_0x7995('0x43')]:_0x1afab4[_0x7995('0x3e')];if(_0x5843ba['query'][_0x7995('0x4e')]){_0x187735['include']=[{'all':!![]}];}_0x187735=_[_0x7995('0x55')]({},_0x187735,_0x5843ba[_0x7995('0x4c')]);return db[_0x7995('0x39')]['find'](_0x187735)['then'](handleEntityNotFound(_0x1d87f9,null))['then'](respondWithResult(_0x1d87f9,null))['catch'](handleError(_0x1d87f9,null));};exports[_0x7995('0x56')]=function(_0x3709de,_0x1a861c){return db[_0x7995('0x39')][_0x7995('0x56')](_0x3709de[_0x7995('0x57')],{})[_0x7995('0x24')](respondWithResult(_0x1a861c,0xc9))[_0x7995('0x2c')](handleError(_0x1a861c,null));};exports[_0x7995('0x35')]=function(_0x17ecd3,_0xa7af8c){if(_0x17ecd3[_0x7995('0x57')]['id']){delete _0x17ecd3[_0x7995('0x57')]['id'];}return db[_0x7995('0x39')][_0x7995('0x58')]({'where':{'id':_0x17ecd3[_0x7995('0x53')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0xa7af8c,null))[_0x7995('0x24')](saveUpdates(_0x17ecd3[_0x7995('0x57')],null))['then'](respondWithResult(_0xa7af8c,null))[_0x7995('0x2c')](handleError(_0xa7af8c,null));};exports[_0x7995('0x59')]=function(_0x3b8a54,_0x32c0d3){return db['ChatGroup']['find']({'where':{'id':_0x3b8a54[_0x7995('0x53')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x32c0d3,null))[_0x7995('0x24')](removeEntity(_0x32c0d3,null))[_0x7995('0x2c')](handleError(_0x32c0d3,null));};exports['describe']=function(_0x13cd7b,_0x74ff38){return db[_0x7995('0x39')][_0x7995('0x5a')]()['then'](respondWithResult(_0x74ff38,null))['catch'](handleError(_0x74ff38,null));};exports[_0x7995('0x5b')]=function(_0x398fac,_0x6c0221,_0x1d69ce){return db[_0x7995('0x5c')][_0x7995('0x4d')]({'where':{'ChatGroupId':_0x398fac[_0x7995('0x53')]['id'],'ToId':_0x398fac[_0x7995('0x5d')]['id'],'read':![]}})[_0x7995('0x24')](function(_0x50caf5){return{'id':_[_0x7995('0x5e')](_0x398fac[_0x7995('0x53')]['id']),'count':_0x50caf5};})[_0x7995('0x24')](respondWithResult(_0x6c0221,null))[_0x7995('0x2c')](handleError(_0x6c0221,null));};exports['addMembers']=function(_0x51bf6a,_0x3053fd,_0xebb5c8){return db['ChatGroup'][_0x7995('0x58')]({'where':{'id':_0x51bf6a[_0x7995('0x53')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x3053fd,null))[_0x7995('0x24')](function(_0x32cb04){if(_0x32cb04){return _0x32cb04['addMembers'](_0x51bf6a[_0x7995('0x57')]['ids'],_[_0x7995('0x5f')](_0x51bf6a[_0x7995('0x57')],[_0x7995('0x60'),'id'])||{});}})[_0x7995('0x24')](respondWithResult(_0x3053fd,null))[_0x7995('0x2c')](handleError(_0x3053fd,null));};exports[_0x7995('0x61')]=function(_0x2b3c1d,_0x44372a,_0x10f012){var _0x3f2bde={};var _0x2618c4={};var _0x234d8d;var _0x56eb85;return db[_0x7995('0x39')][_0x7995('0x62')]({'where':{'id':_0x2b3c1d[_0x7995('0x53')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x44372a,null))[_0x7995('0x24')](function(_0x54a2e0){if(_0x54a2e0){_0x234d8d=_0x54a2e0;_0x2618c4['model']=_[_0x7995('0x3f')](db[_0x7995('0x63')][_0x7995('0x3a')]);_0x2618c4[_0x7995('0x40')]=_['keys'](_0x2b3c1d[_0x7995('0x40')]);_0x2618c4['filters']=_['intersection'](_0x2618c4[_0x7995('0x3e')],_0x2618c4[_0x7995('0x40')]);_0x3f2bde[_0x7995('0x43')]=_[_0x7995('0x42')](_0x2618c4[_0x7995('0x3e')],qs[_0x7995('0x44')](_0x2b3c1d[_0x7995('0x40')][_0x7995('0x44')]));_0x3f2bde[_0x7995('0x43')]=_0x3f2bde[_0x7995('0x43')]['length']?_0x3f2bde[_0x7995('0x43')]:_0x2618c4[_0x7995('0x3e')];_0x3f2bde[_0x7995('0x47')]=qs['sort'](_0x2b3c1d[_0x7995('0x40')][_0x7995('0x48')]);_0x3f2bde[_0x7995('0x49')]=qs[_0x7995('0x41')](_[_0x7995('0x4a')](_0x2b3c1d[_0x7995('0x40')],_0x2618c4[_0x7995('0x41')]));if(_0x2b3c1d[_0x7995('0x40')][_0x7995('0x4b')]){_0x3f2bde[_0x7995('0x49')]=_[_0x7995('0x55')](_0x3f2bde['where'],{'$or':_['map'](_0x3f2bde[_0x7995('0x43')],function(_0xfe1105){var _0x39ebb6={};_0x39ebb6[_0xfe1105]={'$like':'%'+_0x2b3c1d[_0x7995('0x40')]['filter']+'%'};return _0x39ebb6;})});}_0x3f2bde=_[_0x7995('0x55')]({},_0x3f2bde,_0x2b3c1d[_0x7995('0x4c')]);return _0x234d8d['getMembers'](_0x3f2bde);}})['then'](function(_0x3253b5){if(_0x3253b5){_0x56eb85=_0x3253b5[_0x7995('0x54')];if(!_0x2b3c1d['query'][_0x7995('0x64')]('nolimit')){_0x3f2bde[_0x7995('0x31')]=qs[_0x7995('0x31')](_0x2b3c1d['query']['limit']);_0x3f2bde[_0x7995('0x46')]=qs['offset'](_0x2b3c1d[_0x7995('0x40')][_0x7995('0x46')]);}return _0x234d8d[_0x7995('0x61')](_0x3f2bde);}})[_0x7995('0x24')](function(_0x1a1873){if(_0x1a1873){return _0x1a1873?{'count':_0x56eb85,'rows':_0x1a1873}:null;}})[_0x7995('0x24')](respondWithResult(_0x44372a,null))[_0x7995('0x2c')](handleError(_0x44372a,null));};exports[_0x7995('0x65')]=function(_0x29e0ee,_0x117317,_0x1ab590){return db[_0x7995('0x39')][_0x7995('0x58')]({'where':{'id':_0x29e0ee[_0x7995('0x53')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x117317,null))[_0x7995('0x24')](function(_0x6ad274){if(_0x6ad274){return _0x6ad274[_0x7995('0x65')](_0x29e0ee[_0x7995('0x40')][_0x7995('0x60')]);}})[_0x7995('0x24')](respondWithStatusCode(_0x117317,null))[_0x7995('0x2c')](handleError(_0x117317,null));};exports[_0x7995('0x66')]=function(_0x280fbb,_0x260ef1,_0x33479a){if(_0x280fbb[_0x7995('0x57')]['id']){delete _0x280fbb[_0x7995('0x57')]['id'];}return db['ChatGroup'][_0x7995('0x58')]({'where':{'id':_0x280fbb[_0x7995('0x53')]['id']}})['then'](handleEntityNotFound(_0x260ef1,null))['then'](function(_0x15e8d1){if(_0x15e8d1){_0x280fbb[_0x7995('0x57')][_0x7995('0x67')]=_0x15e8d1['id'];return db[_0x7995('0x5c')][_0x7995('0x56')](_0x280fbb[_0x7995('0x57')]);}})['then'](respondWithResult(_0x260ef1,null))[_0x7995('0x2c')](handleError(_0x260ef1,null));};exports[_0x7995('0x68')]=function(_0x3fea6a,_0x77b03f,_0x7d9c6e){var _0x3f0bff={};var _0x151d99={};var _0xc93dcb;var _0x560095;return db[_0x7995('0x39')][_0x7995('0x62')]({'where':{'id':_0x3fea6a['params']['id']}})['then'](handleEntityNotFound(_0x77b03f,null))[_0x7995('0x24')](function(_0xf8c2ed){if(_0xf8c2ed){_0xc93dcb=_0xf8c2ed;_0x151d99[_0x7995('0x3e')]=_[_0x7995('0x3f')](db[_0x7995('0x5c')]['rawAttributes']);_0x151d99[_0x7995('0x40')]=_[_0x7995('0x3f')](_0x3fea6a['query']);_0x151d99[_0x7995('0x41')]=_[_0x7995('0x42')](_0x151d99['model'],_0x151d99[_0x7995('0x40')]);_0x3f0bff['attributes']=_[_0x7995('0x42')](_0x151d99[_0x7995('0x3e')],qs[_0x7995('0x44')](_0x3fea6a[_0x7995('0x40')][_0x7995('0x44')]));_0x3f0bff['attributes']=_0x3f0bff[_0x7995('0x43')][_0x7995('0x54')]?_0x3f0bff[_0x7995('0x43')]:_0x151d99['model'];_0x3f0bff[_0x7995('0x47')]=qs[_0x7995('0x48')](_0x3fea6a[_0x7995('0x40')][_0x7995('0x48')]);_0x3f0bff['where']=qs[_0x7995('0x41')](_[_0x7995('0x4a')](_0x3fea6a[_0x7995('0x40')],_0x151d99['filters']));if(_0x3fea6a['query'][_0x7995('0x4b')]){_0x3f0bff[_0x7995('0x49')]=_['merge'](_0x3f0bff['where'],{'$or':_[_0x7995('0x38')](_0x3f0bff[_0x7995('0x43')],function(_0xcdbd2a){var _0x2384c1={};_0x2384c1[_0xcdbd2a]={'$like':'%'+_0x3fea6a[_0x7995('0x40')]['filter']+'%'};return _0x2384c1;})});}if(_0x3fea6a['query'][_0x7995('0x69')]){var _0x54fad4=_0x3fea6a['query'][_0x7995('0x69')][_0x7995('0x6a')](',');var _0x3192b8={};_0x3192b8[_0x54fad4[0x0]]={'$gte':moment(_0x54fad4[0x1])['format'](_0x7995('0x6b'))};_0x3f0bff[_0x7995('0x49')]=_[_0x7995('0x55')](_0x3f0bff[_0x7995('0x49')],_0x3192b8);}_0x3f0bff=_[_0x7995('0x55')]({},_0x3f0bff,_0x3fea6a['options']);return _0xc93dcb[_0x7995('0x68')](_0x3f0bff);}})[_0x7995('0x24')](function(_0x1a2d6a){if(_0x1a2d6a){_0x560095=_0x1a2d6a[_0x7995('0x54')];if(!_0x3fea6a['query'][_0x7995('0x64')](_0x7995('0x45'))){_0x3f0bff['limit']=qs[_0x7995('0x31')](_0x3fea6a[_0x7995('0x40')]['limit']);_0x3f0bff[_0x7995('0x46')]=qs['offset'](_0x3fea6a[_0x7995('0x40')]['offset']);}return _0xc93dcb[_0x7995('0x68')](_0x3f0bff);}})['then'](function(_0xa97c08){if(_0xa97c08){return _0xa97c08?{'count':_0x560095,'rows':_0xa97c08}:null;}})[_0x7995('0x24')](respondWithResult(_0x77b03f,null))['catch'](handleError(_0x77b03f,null));};
\ No newline at end of file
+var _0xa9e0=['socket.io-emitter','./chatGroup.socket','register','jayson/promise','client','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','then','end','stack','name','index','ChatGroup','rawAttributes','fieldName','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','count','include','findAll','rows','show','params','find','create','body','update','describe','getUnread','ChatInternalMessage','user','addMembers','ids','getMembers','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0x3c8499,_0x1e052e){var _0x51d346=function(_0x311729){while(--_0x311729){_0x3c8499['push'](_0x3c8499['shift']());}};_0x51d346(++_0x1e052e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var fs_extra=require(_0x0a9e('0xa'));var _=require(_0x0a9e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0a9e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0a9e('0xd'));var Papa=require(_0x0a9e('0xe'));var Redis=require(_0x0a9e('0xf'));var authService=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var as=require(_0x0a9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0a9e('0x13'));var licenseUtil=require(_0x0a9e('0x14'));var db=require(_0x0a9e('0x15'))['db'];config[_0x0a9e('0x16')]=_[_0x0a9e('0x17')](config[_0x0a9e('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0x18'))(new Redis(config[_0x0a9e('0x16')]));require(_0x0a9e('0x19'))[_0x0a9e('0x1a')](socket);var jayson=require(_0x0a9e('0x1b'));var client=jayson[_0x0a9e('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22dccb,_0x5d0880,_0x1985b6,_0x519dfd){return new BPromise(function(_0x16033c,_0x12066b){var _0x48f32d=_0x519dfd||client;return _0x48f32d[_0x0a9e('0x1d')](_0x22dccb,_0x1985b6)['then'](function(_0x459eb1){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x5d0880,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x5d0880,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x459eb1));if(_0x459eb1[_0x0a9e('0x24')]){if(_0x459eb1[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger[_0x0a9e('0x24')]('ChatGroup,\x20%s,\x20%s',_0x5d0880,_0x459eb1[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x459eb1['error'][_0x0a9e('0x26')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x5d0880,_0x459eb1[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x16033c(_0x459eb1[_0x0a9e('0x24')][_0x0a9e('0x26')]);}else{logger['info'](_0x0a9e('0x1f'),_0x5d0880,_0x0a9e('0x20'));_0x16033c(_0x459eb1[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x42ac8f){logger[_0x0a9e('0x24')]('ChatGroup,\x20%s,\x20%s',_0x5d0880,_0x42ac8f);_0x12066b(_0x42ac8f);});});}function respondWithStatusCode(_0x59181e,_0x197ec0){_0x197ec0=_0x197ec0||0xcc;return function(_0x3a8e58){if(_0x3a8e58){return _0x59181e[_0x0a9e('0x29')](_0x197ec0);}return _0x59181e[_0x0a9e('0x2a')](_0x197ec0)['end']();};}function respondWithResult(_0x384319,_0x479bc4){_0x479bc4=_0x479bc4||0xc8;return function(_0x45a1e7){if(_0x45a1e7){return _0x384319['status'](_0x479bc4)[_0x0a9e('0x2b')](_0x45a1e7);}};}function respondWithFilteredResult(_0x34dc65,_0x25fba9){return function(_0x14433c){if(_0x14433c){var _0x140511=_0x14433c['count'],_0x1538a4=_0x25fba9[_0x0a9e('0x2c')],_0x11c3b6=_0x25fba9[_0x0a9e('0x2c')]+_0x25fba9[_0x0a9e('0x2d')],_0x14de77;if(_0x11c3b6>=_0x140511){_0x11c3b6=_0x140511;_0x14de77=0xc8;}else{_0x14de77=0xce;}_0x34dc65[_0x0a9e('0x2a')](_0x14de77);return _0x34dc65['set'](_0x0a9e('0x2e'),_0x1538a4+'-'+_0x11c3b6+'/'+_0x140511)[_0x0a9e('0x2b')](_0x14433c);}return null;};}function patchUpdates(_0x1843b2){return function(_0x824a4f){try{jsonpatch[_0x0a9e('0x2f')](_0x824a4f,_0x1843b2,!![]);}catch(_0x563b45){return BPromise[_0x0a9e('0x30')](_0x563b45);}return _0x824a4f[_0x0a9e('0x31')]();};}function saveUpdates(_0x1dbde2,_0x540530){return function(_0x426950){if(_0x426950){return _0x426950['update'](_0x1dbde2)[_0x0a9e('0x32')](function(_0x3ae878){return _0x3ae878;});}return null;};}function removeEntity(_0x1122db,_0x33bdb7){return function(_0x25ce3a){if(_0x25ce3a){return _0x25ce3a['destroy']()[_0x0a9e('0x32')](function(){_0x1122db[_0x0a9e('0x2a')](0xcc)[_0x0a9e('0x33')]();});}};}function handleEntityNotFound(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(!_0x409319){_0x2da5c0[_0x0a9e('0x29')](0x194);}return _0x409319;};}function handleError(_0x39e565,_0x5583a4){_0x5583a4=_0x5583a4||0x1f4;return function(_0x44295a){logger['error'](_0x44295a[_0x0a9e('0x34')]);if(_0x44295a[_0x0a9e('0x35')]){delete _0x44295a[_0x0a9e('0x35')];}_0x39e565[_0x0a9e('0x2a')](_0x5583a4)['send'](_0x44295a);};}exports[_0x0a9e('0x36')]=function(_0xd1836d,_0x1fa90d){var _0x15de0e={},_0x4853b1={},_0x54135e={'count':0x0,'rows':[]};var _0x1e8694=_['map'](db[_0x0a9e('0x37')][_0x0a9e('0x38')],function(_0x381c37){return{'name':_0x381c37[_0x0a9e('0x39')],'type':_0x381c37['type'][_0x0a9e('0x3a')]};});_0x4853b1[_0x0a9e('0x3b')]=_[_0x0a9e('0x3c')](_0x1e8694,'name');_0x4853b1[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0xd1836d[_0x0a9e('0x3d')]);_0x4853b1['filters']=_['intersection'](_0x4853b1[_0x0a9e('0x3b')],_0x4853b1[_0x0a9e('0x3d')]);_0x15de0e['attributes']=_[_0x0a9e('0x3f')](_0x4853b1[_0x0a9e('0x3b')],qs[_0x0a9e('0x40')](_0xd1836d[_0x0a9e('0x3d')]['fields']));_0x15de0e['attributes']=_0x15de0e[_0x0a9e('0x41')][_0x0a9e('0x42')]?_0x15de0e['attributes']:_0x4853b1[_0x0a9e('0x3b')];if(!_0xd1836d[_0x0a9e('0x3d')][_0x0a9e('0x43')]('nolimit')){_0x15de0e[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0xd1836d[_0x0a9e('0x3d')][_0x0a9e('0x2d')]);_0x15de0e[_0x0a9e('0x2c')]=qs[_0x0a9e('0x2c')](_0xd1836d[_0x0a9e('0x3d')][_0x0a9e('0x2c')]);}_0x15de0e[_0x0a9e('0x44')]=qs[_0x0a9e('0x45')](_0xd1836d[_0x0a9e('0x3d')][_0x0a9e('0x45')]);_0x15de0e[_0x0a9e('0x46')]=qs[_0x0a9e('0x47')](_[_0x0a9e('0x48')](_0xd1836d['query'],_0x4853b1['filters']),_0x1e8694);if(_0xd1836d[_0x0a9e('0x3d')][_0x0a9e('0x49')]){_0x15de0e[_0x0a9e('0x46')]=_[_0x0a9e('0x4a')](_0x15de0e[_0x0a9e('0x46')],{'$or':_[_0x0a9e('0x3c')](_0x1e8694,function(_0x10b040){if(_0x10b040[_0x0a9e('0x4b')]!==_0x0a9e('0x4c')){var _0x25c6e6={};_0x25c6e6[_0x10b040[_0x0a9e('0x35')]]={'$like':'%'+_0xd1836d[_0x0a9e('0x3d')]['filter']+'%'};return _0x25c6e6;}})});}_0x15de0e=_[_0x0a9e('0x4a')]({},_0x15de0e,_0xd1836d[_0x0a9e('0x4d')]);var _0xdd268f={'where':_0x15de0e[_0x0a9e('0x46')]};return db[_0x0a9e('0x37')][_0x0a9e('0x4e')](_0xdd268f)[_0x0a9e('0x32')](function(_0x44dd99){_0x54135e['count']=_0x44dd99;if(_0xd1836d[_0x0a9e('0x3d')]['includeAll']){_0x15de0e[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x37')][_0x0a9e('0x50')](_0x15de0e);})['then'](function(_0x14bec2){_0x54135e[_0x0a9e('0x51')]=_0x14bec2;return _0x54135e;})[_0x0a9e('0x32')](respondWithFilteredResult(_0x1fa90d,_0x15de0e))[_0x0a9e('0x28')](handleError(_0x1fa90d,null));};exports[_0x0a9e('0x52')]=function(_0x37be73,_0x45bf7f){var _0x5bbcde={'raw':!![],'where':{'id':_0x37be73[_0x0a9e('0x53')]['id']}},_0x13f44d={};_0x13f44d[_0x0a9e('0x3b')]=_[_0x0a9e('0x3e')](db[_0x0a9e('0x37')][_0x0a9e('0x38')]);_0x13f44d[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x37be73[_0x0a9e('0x3d')]);_0x13f44d['filters']=_[_0x0a9e('0x3f')](_0x13f44d[_0x0a9e('0x3b')],_0x13f44d['query']);_0x5bbcde['attributes']=_['intersection'](_0x13f44d[_0x0a9e('0x3b')],qs[_0x0a9e('0x40')](_0x37be73[_0x0a9e('0x3d')][_0x0a9e('0x40')]));_0x5bbcde[_0x0a9e('0x41')]=_0x5bbcde[_0x0a9e('0x41')][_0x0a9e('0x42')]?_0x5bbcde[_0x0a9e('0x41')]:_0x13f44d['model'];if(_0x37be73['query']['includeAll']){_0x5bbcde[_0x0a9e('0x4f')]=[{'all':!![]}];}_0x5bbcde=_[_0x0a9e('0x4a')]({},_0x5bbcde,_0x37be73[_0x0a9e('0x4d')]);return db['ChatGroup'][_0x0a9e('0x54')](_0x5bbcde)[_0x0a9e('0x32')](handleEntityNotFound(_0x45bf7f,null))['then'](respondWithResult(_0x45bf7f,null))['catch'](handleError(_0x45bf7f,null));};exports[_0x0a9e('0x55')]=function(_0x59c6ff,_0x443e72){return db['ChatGroup'][_0x0a9e('0x55')](_0x59c6ff[_0x0a9e('0x56')],{})[_0x0a9e('0x32')](respondWithResult(_0x443e72,0xc9))['catch'](handleError(_0x443e72,null));};exports[_0x0a9e('0x57')]=function(_0x1bf38a,_0x508b47){if(_0x1bf38a['body']['id']){delete _0x1bf38a[_0x0a9e('0x56')]['id'];}return db[_0x0a9e('0x37')]['find']({'where':{'id':_0x1bf38a[_0x0a9e('0x53')]['id']}})['then'](handleEntityNotFound(_0x508b47,null))[_0x0a9e('0x32')](saveUpdates(_0x1bf38a['body'],null))[_0x0a9e('0x32')](respondWithResult(_0x508b47,null))['catch'](handleError(_0x508b47,null));};exports['destroy']=function(_0x5df0ad,_0x2da03c){return db['ChatGroup'][_0x0a9e('0x54')]({'where':{'id':_0x5df0ad[_0x0a9e('0x53')]['id']}})[_0x0a9e('0x32')](handleEntityNotFound(_0x2da03c,null))[_0x0a9e('0x32')](removeEntity(_0x2da03c,null))[_0x0a9e('0x28')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x58')]=function(_0xd10662,_0x28d814){return db['ChatGroup'][_0x0a9e('0x58')]()[_0x0a9e('0x32')](respondWithResult(_0x28d814,null))[_0x0a9e('0x28')](handleError(_0x28d814,null));};exports[_0x0a9e('0x59')]=function(_0xb83dfd,_0x156662,_0x5d86e9){return db[_0x0a9e('0x5a')][_0x0a9e('0x4e')]({'where':{'ChatGroupId':_0xb83dfd['params']['id'],'ToId':_0xb83dfd[_0x0a9e('0x5b')]['id'],'read':![]}})['then'](function(_0x20c668){return{'id':_['toInteger'](_0xb83dfd['params']['id']),'count':_0x20c668};})['then'](respondWithResult(_0x156662,null))[_0x0a9e('0x28')](handleError(_0x156662,null));};exports['addMembers']=function(_0x2244d6,_0x1fc70e,_0x261adb){return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x2244d6[_0x0a9e('0x53')]['id']}})['then'](handleEntityNotFound(_0x1fc70e,null))[_0x0a9e('0x32')](function(_0x5854cc){if(_0x5854cc){return _0x5854cc[_0x0a9e('0x5c')](_0x2244d6[_0x0a9e('0x56')][_0x0a9e('0x5d')],_['omit'](_0x2244d6[_0x0a9e('0x56')],[_0x0a9e('0x5d'),'id'])||{});}})[_0x0a9e('0x32')](respondWithResult(_0x1fc70e,null))[_0x0a9e('0x28')](handleError(_0x1fc70e,null));};exports['getMembers']=function(_0x1d0dc8,_0xe05a5a,_0x54327c){var _0x797b45={};var _0x17e88c={};var _0x88dcbf;var _0x409b29;return db[_0x0a9e('0x37')]['findOne']({'where':{'id':_0x1d0dc8[_0x0a9e('0x53')]['id']}})[_0x0a9e('0x32')](handleEntityNotFound(_0xe05a5a,null))[_0x0a9e('0x32')](function(_0x47bb43){if(_0x47bb43){_0x88dcbf=_0x47bb43;_0x17e88c[_0x0a9e('0x3b')]=_['keys'](db['User'][_0x0a9e('0x38')]);_0x17e88c[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x1d0dc8[_0x0a9e('0x3d')]);_0x17e88c[_0x0a9e('0x47')]=_[_0x0a9e('0x3f')](_0x17e88c[_0x0a9e('0x3b')],_0x17e88c[_0x0a9e('0x3d')]);_0x797b45[_0x0a9e('0x41')]=_[_0x0a9e('0x3f')](_0x17e88c[_0x0a9e('0x3b')],qs[_0x0a9e('0x40')](_0x1d0dc8[_0x0a9e('0x3d')][_0x0a9e('0x40')]));_0x797b45[_0x0a9e('0x41')]=_0x797b45[_0x0a9e('0x41')][_0x0a9e('0x42')]?_0x797b45[_0x0a9e('0x41')]:_0x17e88c['model'];_0x797b45[_0x0a9e('0x44')]=qs[_0x0a9e('0x45')](_0x1d0dc8[_0x0a9e('0x3d')]['sort']);_0x797b45[_0x0a9e('0x46')]=qs[_0x0a9e('0x47')](_['pick'](_0x1d0dc8[_0x0a9e('0x3d')],_0x17e88c[_0x0a9e('0x47')]));if(_0x1d0dc8[_0x0a9e('0x3d')][_0x0a9e('0x49')]){_0x797b45[_0x0a9e('0x46')]=_['merge'](_0x797b45['where'],{'$or':_['map'](_0x797b45[_0x0a9e('0x41')],function(_0x18bf5d){var _0x1104ad={};_0x1104ad[_0x18bf5d]={'$like':'%'+_0x1d0dc8[_0x0a9e('0x3d')][_0x0a9e('0x49')]+'%'};return _0x1104ad;})});}_0x797b45=_[_0x0a9e('0x4a')]({},_0x797b45,_0x1d0dc8[_0x0a9e('0x4d')]);return _0x88dcbf[_0x0a9e('0x5e')](_0x797b45);}})['then'](function(_0x235f8f){if(_0x235f8f){_0x409b29=_0x235f8f[_0x0a9e('0x42')];if(!_0x1d0dc8[_0x0a9e('0x3d')]['hasOwnProperty'](_0x0a9e('0x5f'))){_0x797b45['limit']=qs[_0x0a9e('0x2d')](_0x1d0dc8[_0x0a9e('0x3d')]['limit']);_0x797b45[_0x0a9e('0x2c')]=qs[_0x0a9e('0x2c')](_0x1d0dc8[_0x0a9e('0x3d')][_0x0a9e('0x2c')]);}return _0x88dcbf['getMembers'](_0x797b45);}})[_0x0a9e('0x32')](function(_0x2e9552){if(_0x2e9552){return _0x2e9552?{'count':_0x409b29,'rows':_0x2e9552}:null;}})[_0x0a9e('0x32')](respondWithResult(_0xe05a5a,null))[_0x0a9e('0x28')](handleError(_0xe05a5a,null));};exports['removeMembers']=function(_0x109ccb,_0x3d91db,_0x2d5506){return db[_0x0a9e('0x37')]['find']({'where':{'id':_0x109ccb[_0x0a9e('0x53')]['id']}})[_0x0a9e('0x32')](handleEntityNotFound(_0x3d91db,null))[_0x0a9e('0x32')](function(_0xf410e5){if(_0xf410e5){return _0xf410e5[_0x0a9e('0x60')](_0x109ccb[_0x0a9e('0x3d')][_0x0a9e('0x5d')]);}})[_0x0a9e('0x32')](respondWithStatusCode(_0x3d91db,null))[_0x0a9e('0x28')](handleError(_0x3d91db,null));};exports[_0x0a9e('0x61')]=function(_0xc4c230,_0x1f10ef,_0x25744a){if(_0xc4c230[_0x0a9e('0x56')]['id']){delete _0xc4c230['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0xc4c230[_0x0a9e('0x53')]['id']}})['then'](handleEntityNotFound(_0x1f10ef,null))[_0x0a9e('0x32')](function(_0x33dda0){if(_0x33dda0){_0xc4c230[_0x0a9e('0x56')][_0x0a9e('0x62')]=_0x33dda0['id'];return db['ChatInternalMessage']['create'](_0xc4c230[_0x0a9e('0x56')]);}})[_0x0a9e('0x32')](respondWithResult(_0x1f10ef,null))['catch'](handleError(_0x1f10ef,null));};exports[_0x0a9e('0x63')]=function(_0x53a6a1,_0x260f4b,_0x8ebf02){var _0x5637a1={};var _0x28a942={};var _0x41cf12;var _0x2d2286;return db[_0x0a9e('0x37')][_0x0a9e('0x64')]({'where':{'id':_0x53a6a1[_0x0a9e('0x53')]['id']}})[_0x0a9e('0x32')](handleEntityNotFound(_0x260f4b,null))['then'](function(_0x2973d3){if(_0x2973d3){_0x41cf12=_0x2973d3;_0x28a942[_0x0a9e('0x3b')]=_[_0x0a9e('0x3e')](db[_0x0a9e('0x5a')]['rawAttributes']);_0x28a942[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x53a6a1['query']);_0x28a942[_0x0a9e('0x47')]=_['intersection'](_0x28a942[_0x0a9e('0x3b')],_0x28a942[_0x0a9e('0x3d')]);_0x5637a1[_0x0a9e('0x41')]=_[_0x0a9e('0x3f')](_0x28a942['model'],qs['fields'](_0x53a6a1[_0x0a9e('0x3d')][_0x0a9e('0x40')]));_0x5637a1[_0x0a9e('0x41')]=_0x5637a1['attributes'][_0x0a9e('0x42')]?_0x5637a1[_0x0a9e('0x41')]:_0x28a942['model'];_0x5637a1['order']=qs[_0x0a9e('0x45')](_0x53a6a1['query']['sort']);_0x5637a1['where']=qs[_0x0a9e('0x47')](_[_0x0a9e('0x48')](_0x53a6a1[_0x0a9e('0x3d')],_0x28a942[_0x0a9e('0x47')]));if(_0x53a6a1[_0x0a9e('0x3d')][_0x0a9e('0x49')]){_0x5637a1['where']=_[_0x0a9e('0x4a')](_0x5637a1['where'],{'$or':_[_0x0a9e('0x3c')](_0x5637a1[_0x0a9e('0x41')],function(_0x18ad56){var _0x4566b0={};_0x4566b0[_0x18ad56]={'$like':'%'+_0x53a6a1['query'][_0x0a9e('0x49')]+'%'};return _0x4566b0;})});}if(_0x53a6a1[_0x0a9e('0x3d')][_0x0a9e('0x65')]){var _0x5b74c3=_0x53a6a1[_0x0a9e('0x3d')][_0x0a9e('0x65')][_0x0a9e('0x66')](',');var _0x22063c={};_0x22063c[_0x5b74c3[0x0]]={'$gte':moment(_0x5b74c3[0x1])[_0x0a9e('0x67')](_0x0a9e('0x68'))};_0x5637a1[_0x0a9e('0x46')]=_[_0x0a9e('0x4a')](_0x5637a1['where'],_0x22063c);}_0x5637a1=_[_0x0a9e('0x4a')]({},_0x5637a1,_0x53a6a1[_0x0a9e('0x4d')]);return _0x41cf12['getMessages'](_0x5637a1);}})[_0x0a9e('0x32')](function(_0x982340){if(_0x982340){_0x2d2286=_0x982340[_0x0a9e('0x42')];if(!_0x53a6a1['query'][_0x0a9e('0x43')]('nolimit')){_0x5637a1[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x53a6a1[_0x0a9e('0x3d')][_0x0a9e('0x2d')]);_0x5637a1[_0x0a9e('0x2c')]=qs[_0x0a9e('0x2c')](_0x53a6a1[_0x0a9e('0x3d')][_0x0a9e('0x2c')]);}return _0x41cf12['getMessages'](_0x5637a1);}})[_0x0a9e('0x32')](function(_0x31d25a){if(_0x31d25a){return _0x31d25a?{'count':_0x2d2286,'rows':_0x31d25a}:null;}})[_0x0a9e('0x32')](respondWithResult(_0x260f4b,null))[_0x0a9e('0x28')](handleError(_0x260f4b,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 752a94c..f7698c5 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 _0xdb28=['ChatGroup','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x2c5b59,_0x4901d7){var _0x5f2dc6=function(_0x43a6e0){while(--_0x43a6e0){_0x2c5b59['push'](_0x2c5b59['shift']());}};_0x5f2dc6(++_0x4901d7);}(_0xdb28,0x106));var _0x8db2=function(_0x40bf0f,_0x1691a7){_0x40bf0f=_0x40bf0f-0x0;var _0x3d29c6=_0xdb28[_0x40bf0f];return _0x3d29c6;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var ChatGroup=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db2('0x4'),'afterDestroy':_0x8db2('0x5')};function emitEvent(_0xfcf49f){return function(_0x4426fe,_0x11109e,_0x52bf99){ChatGroupEvents[_0x8db2('0x6')](_0xfcf49f+':'+_0x4426fe['id'],_0x4426fe);ChatGroupEvents[_0x8db2('0x6')](_0xfcf49f,_0x4426fe);_0x52bf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x8db2('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0x5f66=['remove','emit','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x38d243,_0x3f2062){var _0x347634=function(_0x342e3f){while(--_0x342e3f){_0x38d243['push'](_0x38d243['shift']());}};_0x347634(++_0x3f2062);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x65f6('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x65f6('0x1')](0x0);var events={'afterCreate':_0x65f6('0x2'),'afterUpdate':_0x65f6('0x3'),'afterDestroy':_0x65f6('0x4')};function emitEvent(_0x1a330c){return function(_0x5eb9ad,_0x3c5029,_0x5150c8){ChatGroupEvents[_0x65f6('0x5')](_0x1a330c+':'+_0x5eb9ad['id'],_0x5eb9ad);ChatGroupEvents[_0x65f6('0x5')](_0x1a330c,_0x5eb9ad);_0x5150c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x65f6('0x6')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index c3f902e..836dc77 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 _0xe002=['request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','lodash','util','../../config/logger','moment','bluebird'];(function(_0x42177d,_0x1a5934){var _0x464915=function(_0x5c7abd){while(--_0x5c7abd){_0x42177d['push'](_0x42177d['shift']());}};_0x464915(++_0x1a5934);}(_0xe002,0xf7));var _0x2e00=function(_0x529abc,_0x17b97e){_0x529abc=_0x529abc-0x0;var _0x453afa=_0xe002[_0x529abc];return _0x453afa;};'use strict';var _=require(_0x2e00('0x0'));var util=require(_0x2e00('0x1'));var logger=require(_0x2e00('0x2'))('api');var moment=require(_0x2e00('0x3'));var BPromise=require(_0x2e00('0x4'));var rp=require(_0x2e00('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e00('0x6'));var config=require(_0x2e00('0x7'));var attributes=require(_0x2e00('0x8'));module[_0x2e00('0x9')]=function(_0x3cd8e8,_0x120155){return _0x3cd8e8[_0x2e00('0xa')](_0x2e00('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeedf=['exports','define','chat_groups','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xeedf,0x12c));var _0xfeed=function(_0x3d5b2c,_0x181a6c){_0x3d5b2c=_0x3d5b2c-0x0;var _0x1b4d86=_0xeedf[_0x3d5b2c];return _0x1b4d86;};'use strict';var _=require(_0xfeed('0x0'));var util=require(_0xfeed('0x1'));var logger=require(_0xfeed('0x2'))('api');var moment=require(_0xfeed('0x3'));var BPromise=require('bluebird');var rp=require(_0xfeed('0x4'));var fs=require('fs');var path=require(_0xfeed('0x5'));var rimraf=require(_0xfeed('0x6'));var config=require(_0xfeed('0x7'));var attributes=require('./chatGroup.attributes');module[_0xfeed('0x8')]=function(_0x2c211d,_0x5df4fe){return _0x2c211d[_0xfeed('0x9')]('ChatGroup',attributes,{'tableName':_0xfeed('0xa'),'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 a195717..c995601 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 _0x2d34=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x442c22,_0x596fa5){var _0xf233e5=function(_0x527435){while(--_0x527435){_0x442c22['push'](_0x442c22['shift']());}};_0xf233e5(++_0x596fa5);}(_0x2d34,0x66));var _0x42d3=function(_0x520635,_0x193d6e){_0x520635=_0x520635-0x0;var _0xc0344d=_0x2d34[_0x520635];return _0xc0344d;};'use strict';var _=require(_0x42d3('0x0'));var util=require(_0x42d3('0x1'));var moment=require(_0x42d3('0x2'));var BPromise=require(_0x42d3('0x3'));var rs=require(_0x42d3('0x4'));var fs=require('fs');var Redis=require(_0x42d3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x42d3('0x6'));var logger=require(_0x42d3('0x7'))(_0x42d3('0x8'));var config=require(_0x42d3('0x9'));var jayson=require(_0x42d3('0xa'));var client=jayson[_0x42d3('0xb')][_0x42d3('0xc')]({'port':0x232a});config[_0x42d3('0xd')]=_[_0x42d3('0xe')](config[_0x42d3('0xd')],{'host':_0x42d3('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x42d3('0xd')]));require('./chatGroup.socket')[_0x42d3('0x10')](socket);function respondWithRpcPromise(_0x20b50b,_0x39248f,_0x103ae8){return new BPromise(function(_0x20842f,_0x3100d8){return client['request'](_0x20b50b,_0x103ae8)['then'](function(_0x5a2096){logger[_0x42d3('0x11')](_0x42d3('0x12'),_0x39248f,'request\x20sent');logger[_0x42d3('0x13')](_0x42d3('0x14'),_0x39248f,'request\x20sent',JSON[_0x42d3('0x15')](_0x5a2096));if(_0x5a2096['error']){if(_0x5a2096[_0x42d3('0x16')][_0x42d3('0x17')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x39248f,_0x5a2096['error'][_0x42d3('0x18')]);return _0x3100d8(_0x5a2096[_0x42d3('0x16')]['message']);}logger['error'](_0x42d3('0x12'),_0x39248f,_0x5a2096['error'][_0x42d3('0x18')]);return _0x20842f(_0x5a2096[_0x42d3('0x16')][_0x42d3('0x18')]);}else{logger[_0x42d3('0x11')](_0x42d3('0x12'),_0x39248f,_0x42d3('0x19'));_0x20842f(_0x5a2096['result']['message']);}})[_0x42d3('0x1a')](function(_0x3cf830){logger[_0x42d3('0x16')]('ChatGroup,\x20%s,\x20%s',_0x39248f,_0x3cf830);_0x3100d8(_0x3cf830);});});}
\ No newline at end of file
+var _0x7e25=['socket.io-emitter','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','localhost'];(function(_0x5dfbd0,_0x201eb2){var _0x57cb5c=function(_0x36a5c0){while(--_0x36a5c0){_0x5dfbd0['push'](_0x5dfbd0['shift']());}};_0x57cb5c(++_0x201eb2);}(_0x7e25,0x1ef));var _0x57e2=function(_0x10791d,_0x2562b6){_0x10791d=_0x10791d-0x0;var _0x1b4f9c=_0x7e25[_0x10791d];return _0x1b4f9c;};'use strict';var _=require('lodash');var util=require(_0x57e2('0x0'));var moment=require(_0x57e2('0x1'));var BPromise=require(_0x57e2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x57e2('0x3'));var db=require(_0x57e2('0x4'))['db'];var utils=require(_0x57e2('0x5'));var logger=require(_0x57e2('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x57e2('0x7')][_0x57e2('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x57e2('0x9')],{'host':_0x57e2('0xa'),'port':0x18eb});var socket=require(_0x57e2('0xb'))(new Redis(config[_0x57e2('0x9')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0xb73b33,_0x3b1725,_0x56ae80){return new BPromise(function(_0x1e09e6,_0x5cc832){return client[_0x57e2('0xc')](_0xb73b33,_0x56ae80)[_0x57e2('0xd')](function(_0x1ad638){logger[_0x57e2('0xe')](_0x57e2('0xf'),_0x3b1725,_0x57e2('0x10'));logger[_0x57e2('0x11')](_0x57e2('0x12'),_0x3b1725,_0x57e2('0x10'),JSON[_0x57e2('0x13')](_0x1ad638));if(_0x1ad638[_0x57e2('0x14')]){if(_0x1ad638['error']['code']===0x1f4){logger[_0x57e2('0x14')]('ChatGroup,\x20%s,\x20%s',_0x3b1725,_0x1ad638[_0x57e2('0x14')][_0x57e2('0x15')]);return _0x5cc832(_0x1ad638['error'][_0x57e2('0x15')]);}logger[_0x57e2('0x14')](_0x57e2('0xf'),_0x3b1725,_0x1ad638[_0x57e2('0x14')][_0x57e2('0x15')]);return _0x1e09e6(_0x1ad638[_0x57e2('0x14')]['message']);}else{logger[_0x57e2('0xe')](_0x57e2('0xf'),_0x3b1725,'request\x20sent');_0x1e09e6(_0x1ad638[_0x57e2('0x16')][_0x57e2('0x15')]);}})['catch'](function(_0x262289){logger[_0x57e2('0x14')]('ChatGroup,\x20%s,\x20%s',_0x3b1725,_0x262289);_0x5cc832(_0x262289);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 6a123f7..fbdd224 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 _0x8a56=['register','chatGroup:','./chatGroup.events','save','remove','emit','removeListener'];(function(_0x1922d2,_0x224ada){var _0x268072=function(_0x2838f9){while(--_0x2838f9){_0x1922d2['push'](_0x1922d2['shift']());}};_0x268072(++_0x224ada);}(_0x8a56,0x9c));var _0x68a5=function(_0x1778e1,_0x3e1727){_0x1778e1=_0x1778e1-0x0;var _0x2bc4c6=_0x8a56[_0x1778e1];return _0x2bc4c6;};'use strict';var ChatGroupEvents=require(_0x68a5('0x0'));var events=[_0x68a5('0x1'),_0x68a5('0x2'),'update'];function createListener(_0x3d3f08,_0x5089e6){return function(_0x2f4c0b){_0x5089e6[_0x68a5('0x3')](_0x3d3f08,_0x2f4c0b);};}function removeListener(_0x32f770,_0x35f98c){return function(){ChatGroupEvents[_0x68a5('0x4')](_0x32f770,_0x35f98c);};}exports[_0x68a5('0x5')]=function(_0x409395){for(var _0x1785e5=0x0,_0x796852=events['length'];_0x1785e5<_0x796852;_0x1785e5++){var _0x3ad0c5=events[_0x1785e5];var _0x4eca2a=createListener(_0x68a5('0x6')+_0x3ad0c5,_0x409395);ChatGroupEvents['on'](_0x3ad0c5,_0x4eca2a);}};
\ No newline at end of file
+var _0x20ad=['chatGroup:','save','update','emit','removeListener','register','length'];(function(_0x4191dc,_0x486474){var _0x37707d=function(_0x305a2c){while(--_0x305a2c){_0x4191dc['push'](_0x4191dc['shift']());}};_0x37707d(++_0x486474);}(_0x20ad,0x94));var _0xd20a=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x20ad[_0x381589];return _0x2a075d;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xd20a('0x0'),'remove',_0xd20a('0x1')];function createListener(_0x1c9ac5,_0x2820fe){return function(_0x116f4b){_0x2820fe[_0xd20a('0x2')](_0x1c9ac5,_0x116f4b);};}function removeListener(_0x4d4b61,_0x528c20){return function(){ChatGroupEvents[_0xd20a('0x3')](_0x4d4b61,_0x528c20);};}exports[_0xd20a('0x4')]=function(_0x3fc820){for(var _0x53e1f7=0x0,_0x3d49b2=events[_0xd20a('0x5')];_0x53e1f7<_0x3d49b2;_0x53e1f7++){var _0x5819e8=events[_0x53e1f7];var _0x5303bd=createListener(_0xd20a('0x6')+_0x5819e8,_0x3fc820);ChatGroupEvents['on'](_0x5819e8,_0x5303bd);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 7183d65..04d39ea 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 _0xa046=['/describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','addMembers','post','addMessage','update','delete','destroy','removeMembers','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index'];(function(_0x142ec2,_0x5bb03d){var _0x45ef4e=function(_0x4bc513){while(--_0x4bc513){_0x142ec2['push'](_0x142ec2['shift']());}};_0x45ef4e(++_0x5bb03d);}(_0xa046,0xab));var _0x6a04=function(_0x1cb64f,_0x575045){_0x1cb64f=_0x1cb64f-0x0;var _0x2ef3a2=_0xa046[_0x1cb64f];return _0x2ef3a2;};'use strict';var multer=require(_0x6a04('0x0'));var util=require(_0x6a04('0x1'));var path=require(_0x6a04('0x2'));var timeout=require('connect-timeout');var express=require(_0x6a04('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6a04('0x4'));var interaction=require(_0x6a04('0x5'));var config=require(_0x6a04('0x6'));var controller=require(_0x6a04('0x7'));router[_0x6a04('0x8')]('/',auth[_0x6a04('0x9')](),controller[_0x6a04('0xa')]);router[_0x6a04('0x8')](_0x6a04('0xb'),auth[_0x6a04('0x9')](),controller['describe']);router[_0x6a04('0x8')](_0x6a04('0xc'),auth[_0x6a04('0x9')](),controller['show']);router[_0x6a04('0x8')](_0x6a04('0xd'),auth['isAuthenticated'](),controller[_0x6a04('0xe')]);router[_0x6a04('0x8')](_0x6a04('0xf'),auth[_0x6a04('0x9')](),controller[_0x6a04('0x10')]);router[_0x6a04('0x8')](_0x6a04('0x11'),auth[_0x6a04('0x9')](),controller[_0x6a04('0x12')]);router['post']('/',auth[_0x6a04('0x9')](),controller['create']);router['post'](_0x6a04('0xf'),auth['isAuthenticated'](),controller[_0x6a04('0x13')]);router[_0x6a04('0x14')](_0x6a04('0x11'),auth[_0x6a04('0x9')](),controller[_0x6a04('0x15')]);router['put'](_0x6a04('0xc'),auth[_0x6a04('0x9')](),controller[_0x6a04('0x16')]);router[_0x6a04('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x6a04('0x18')]);router[_0x6a04('0x17')](_0x6a04('0xf'),auth['isAuthenticated'](),controller[_0x6a04('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0xe6b6=['/:id/members','addMembers','update','delete','removeMembers','exports','util','path','express','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/:id','show','getUnread','getMembers','/:id/messages','getMessages','post','create'];(function(_0x2c2beb,_0x51d1af){var _0x5f392f=function(_0x1fa03e){while(--_0x1fa03e){_0x2c2beb['push'](_0x2c2beb['shift']());}};_0x5f392f(++_0x51d1af);}(_0xe6b6,0x150));var _0x6e6b=function(_0x4343ba,_0x1922e0){_0x4343ba=_0x4343ba-0x0;var _0x8d6f0e=_0xe6b6[_0x4343ba];return _0x8d6f0e;};'use strict';var multer=require('multer');var util=require(_0x6e6b('0x0'));var path=require(_0x6e6b('0x1'));var timeout=require('connect-timeout');var express=require(_0x6e6b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6e6b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6e6b('0x4'));var controller=require(_0x6e6b('0x5'));router[_0x6e6b('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6e6b('0x6')]('/describe',auth[_0x6e6b('0x7')](),controller['describe']);router['get'](_0x6e6b('0x8'),auth[_0x6e6b('0x7')](),controller[_0x6e6b('0x9')]);router[_0x6e6b('0x6')]('/:id/unread',auth[_0x6e6b('0x7')](),controller[_0x6e6b('0xa')]);router['get']('/:id/members',auth[_0x6e6b('0x7')](),controller[_0x6e6b('0xb')]);router['get'](_0x6e6b('0xc'),auth[_0x6e6b('0x7')](),controller[_0x6e6b('0xd')]);router[_0x6e6b('0xe')]('/',auth[_0x6e6b('0x7')](),controller[_0x6e6b('0xf')]);router[_0x6e6b('0xe')](_0x6e6b('0x10'),auth['isAuthenticated'](),controller[_0x6e6b('0x11')]);router[_0x6e6b('0xe')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router['put'](_0x6e6b('0x8'),auth['isAuthenticated'](),controller[_0x6e6b('0x12')]);router[_0x6e6b('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x6e6b('0x13')](_0x6e6b('0x10'),auth[_0x6e6b('0x7')](),controller[_0x6e6b('0x14')]);module[_0x6e6b('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index acb00d5..edcf43e 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 _0x89c1=['long','DATE','out','exports','BOOLEAN','INTEGER','ENUM','thumb','star','TEXT','STRING'];(function(_0x5982cd,_0x52091b){var _0x107a28=function(_0x535e9b){while(--_0x535e9b){_0x5982cd['push'](_0x5982cd['shift']());}};_0x107a28(++_0x52091b);}(_0x89c1,0x10b));var _0x189c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x89c1[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x189c('0x0')]={'closed':{'type':Sequelize[_0x189c('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x189c('0x2')]},'ratingType':{'type':Sequelize[_0x189c('0x3')]('star',_0x189c('0x4')),'defaultValue':_0x189c('0x5')},'ratingMessage':{'type':Sequelize[_0x189c('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x189c('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x189c('0x7')]},'secondDisposition':{'type':Sequelize[_0x189c('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x189c('0x7')]},'browserVersion':{'type':Sequelize[_0x189c('0x7')]},'osName':{'type':Sequelize[_0x189c('0x7')]},'osVersion':{'type':Sequelize[_0x189c('0x7')]},'deviceModel':{'type':Sequelize[_0x189c('0x7')]},'deviceVendor':{'type':Sequelize[_0x189c('0x7')]},'deviceType':{'type':Sequelize[_0x189c('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x189c('0x7')]},'formData':{'type':Sequelize[_0x189c('0x6')](_0x189c('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x189c('0x9')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x189c('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x189c('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x189c('0x6')]}};
\ No newline at end of file
+var _0xe459=['long','DATE','out','sequelize','exports','BOOLEAN','INTEGER','thumb','TEXT','STRING'];(function(_0x56f736,_0x521360){var _0x47b49e=function(_0x5707d4){while(--_0x5707d4){_0x56f736['push'](_0x56f736['shift']());}};_0x47b49e(++_0x521360);}(_0xe459,0x1cf));var _0x9e45=function(_0x372200,_0x5c484f){_0x372200=_0x372200-0x0;var _0x4de067=_0xe459[_0x372200];return _0x4de067;};'use strict';var Sequelize=require(_0x9e45('0x0'));module[_0x9e45('0x1')]={'closed':{'type':Sequelize[_0x9e45('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x9e45('0x3')]},'ratingType':{'type':Sequelize['ENUM']('star',_0x9e45('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x9e45('0x5')]},'pathTranscript':{'type':Sequelize[_0x9e45('0x5')]},'mailTranscript':{'type':Sequelize[_0x9e45('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x9e45('0x6')]},'secondDisposition':{'type':Sequelize[_0x9e45('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x9e45('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x9e45('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x9e45('0x6')]},'deviceModel':{'type':Sequelize[_0x9e45('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x9e45('0x6')]},'referer':{'type':Sequelize[_0x9e45('0x5')]},'customerIp':{'type':Sequelize[_0x9e45('0x6')]},'formData':{'type':Sequelize[_0x9e45('0x5')](_0x9e45('0x7'))},'read1stAt':{'type':Sequelize[_0x9e45('0x8')]},'lastMsgAt':{'type':Sequelize[_0x9e45('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x9e45('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x9e45('0x6')]},'customerPort':{'type':Sequelize[_0x9e45('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x9e45('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 445896a..2d71d6e 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 _0x9fe7=['ChatWebsiteId','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','agent','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','sequelize','groupBy','ChatInteractionId','push','all','rows','show','params','rawAttributes','fields','includeAll','merge','create','update','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','POST','https://api-vidaoo.xcally.com/api/v1/sessions','follow','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','basename','filename','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','ChatWebsite','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','MailAccount','MailServerOut','Smtp','service','host','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','getMessages','pick','options','include','findAll','includeAgent','addTags','setTags','spread','Tag','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','Attachment','Account','Owner','get','mkdirSync','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','%s\x20#%d','Chat','YYYY-MM-DD','N.A.','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','destroy','stack','name','send','Users','map','fullname','Tags','TagIds','split','forEach','catch','ChatInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','select','field','color','u.id','u.fullname','from','user_has_chat_interactions','left_join','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start','end','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','text','body','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','contactName','DESC','resolve'];(function(_0x418b75,_0x306f93){var _0x8f9d36=function(_0x23d2b2){while(--_0x23d2b2){_0x418b75['push'](_0x418b75['shift']());}};_0x8f9d36(++_0x306f93);}(_0x9fe7,0x1df));var _0x79fe=function(_0x3ecc62,_0x260cf2){_0x3ecc62=_0x3ecc62-0x0;var _0x3a5028=_0x9fe7[_0x3ecc62];return _0x3a5028;};'use strict';var pdf=require(_0x79fe('0x0'));var emlformat=require(_0x79fe('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x79fe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x79fe('0x3'));var moment=require(_0x79fe('0x4'));var BPromise=require(_0x79fe('0x5'));var Mustache=require('mustache');var util=require(_0x79fe('0x6'));var path=require(_0x79fe('0x7'));var sox=require(_0x79fe('0x8'));var csv=require('to-csv');var ejs=require(_0x79fe('0x9'));var fs=require('fs');var fs_extra=require(_0x79fe('0xa'));var _=require(_0x79fe('0xb'));var squel=require('squel');var crypto=require(_0x79fe('0xc'));var jsforce=require(_0x79fe('0xd'));var deskjs=require(_0x79fe('0xe'));var toCsv=require(_0x79fe('0xf'));var querystring=require(_0x79fe('0x10'));var Papa=require('papaparse');var Redis=require(_0x79fe('0x11'));var authService=require(_0x79fe('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x79fe('0x13'));var hardwareService=require(_0x79fe('0x14'));var logger=require(_0x79fe('0x15'))(_0x79fe('0x16'));var utils=require('../../config/utils');var config=require(_0x79fe('0x17'));var licenseUtil=require(_0x79fe('0x18'));var db=require(_0x79fe('0x19'))['db'];config[_0x79fe('0x1a')]=_[_0x79fe('0x1b')](config[_0x79fe('0x1a')],{'host':_0x79fe('0x1c'),'port':0x18eb});var socket=require(_0x79fe('0x1d'))(new Redis(config['redis']));require(_0x79fe('0x1e'))[_0x79fe('0x1f')](socket);var jayson=require(_0x79fe('0x20'));var client=jayson[_0x79fe('0x21')][_0x79fe('0x22')]({'port':0x232b});var client9004=jayson[_0x79fe('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x127ec4,_0xb1955f,_0xcae4ff,_0x5f0af3){return new BPromise(function(_0x5eadbf,_0x416b5b){var _0x16f93a=_0x5f0af3||client;return _0x16f93a[_0x79fe('0x23')](_0x127ec4,_0xcae4ff)[_0x79fe('0x24')](function(_0x536641){logger['info'](_0x79fe('0x25'),_0xb1955f,_0x79fe('0x26'));logger[_0x79fe('0x27')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xb1955f,_0x79fe('0x26'),JSON[_0x79fe('0x28')](_0x536641));if(_0x536641[_0x79fe('0x29')]){if(_0x536641['error'][_0x79fe('0x2a')]===0x1f4){logger['error'](_0x79fe('0x25'),_0xb1955f,_0x536641[_0x79fe('0x29')][_0x79fe('0x2b')]);return _0x416b5b(_0x536641[_0x79fe('0x29')][_0x79fe('0x2b')]);}logger[_0x79fe('0x29')]('ChatInteraction,\x20%s,\x20%s',_0xb1955f,_0x536641['error'][_0x79fe('0x2b')]);return _0x5eadbf(_0x536641['error'][_0x79fe('0x2b')]);}else{logger[_0x79fe('0x2c')]('ChatInteraction,\x20%s,\x20%s',_0xb1955f,'request\x20sent');_0x5eadbf(_0x536641[_0x79fe('0x2d')][_0x79fe('0x2b')]);}})['catch'](function(_0x46d93d){logger[_0x79fe('0x29')]('ChatInteraction,\x20%s,\x20%s',_0xb1955f,_0x46d93d);_0x416b5b(_0x46d93d);});});}function respondWithStatusCode(_0x4d60e8,_0x4ea368){_0x4ea368=_0x4ea368||0xcc;return function(_0x3720fa){if(_0x3720fa){return _0x4d60e8[_0x79fe('0x2e')](_0x4ea368);}return _0x4d60e8[_0x79fe('0x2f')](_0x4ea368)['end']();};}function respondWithResult(_0x47786f,_0x43782e){_0x43782e=_0x43782e||0xc8;return function(_0x3bc5bc){if(_0x3bc5bc){return _0x47786f['status'](_0x43782e)['json'](_0x3bc5bc);}};}function respondWithFilteredResult(_0x14e055,_0x51200f){return function(_0x196215){if(_0x196215){var _0x5cbb87=_0x196215[_0x79fe('0x30')],_0x4d1a9a=_0x51200f[_0x79fe('0x31')],_0x5b4835=_0x51200f['offset']+_0x51200f[_0x79fe('0x32')],_0x59b44d;if(_0x5b4835>=_0x5cbb87){_0x5b4835=_0x5cbb87;_0x59b44d=0xc8;}else{_0x59b44d=0xce;}_0x14e055['status'](_0x59b44d);return _0x14e055[_0x79fe('0x33')](_0x79fe('0x34'),_0x4d1a9a+'-'+_0x5b4835+'/'+_0x5cbb87)[_0x79fe('0x35')](_0x196215);}return null;};}function patchUpdates(_0x3558f2){return function(_0x128ca3){try{jsonpatch['apply'](_0x128ca3,_0x3558f2,!![]);}catch(_0x436279){return BPromise[_0x79fe('0x36')](_0x436279);}return _0x128ca3[_0x79fe('0x37')]();};}function saveUpdates(_0x190202,_0x445db9){return function(_0x4034b8){if(_0x4034b8){return _0x4034b8['update'](_0x190202)[_0x79fe('0x24')](function(_0x125226){return _0x125226;});}return null;};}function removeEntity(_0x8ddef3,_0x9d93c1){return function(_0xb87efd){if(_0xb87efd){return _0xb87efd[_0x79fe('0x38')]()['then'](function(){_0x8ddef3[_0x79fe('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bdf83,_0x4c9f60){return function(_0x2a533b){if(!_0x2a533b){_0x2bdf83['sendStatus'](0x194);}return _0x2a533b;};}function handleError(_0x1ee275,_0x16c7b8){_0x16c7b8=_0x16c7b8||0x1f4;return function(_0x41177d){logger['error'](_0x41177d[_0x79fe('0x39')]);if(_0x41177d[_0x79fe('0x3a')]){delete _0x41177d[_0x79fe('0x3a')];}_0x1ee275[_0x79fe('0x2f')](_0x16c7b8)[_0x79fe('0x3b')](_0x41177d);};}function getInteractionUsers(_0x5b15bb,_0x53957b){return new BPromise(function(_0x28439a,_0x4a8336){try{if(_0x53957b[_0x5b15bb['id']]){_0x5b15bb[_0x79fe('0x3c')]=_[_0x79fe('0x3d')](_0x53957b[_0x5b15bb['id']],function(_0x497a02){return{'id':_0x497a02['id'],'fullname':_0x497a02[_0x79fe('0x3e')]};});}}catch(_0x46da71){_0x4a8336(_0x46da71);}_0x28439a(_0x5b15bb);});}function getInteractionTags(_0xfa1cc,_0xc3f7ac){return new BPromise(function(_0x43d8b6,_0x4696f4){try{if(_0xfa1cc['TagIds']){_0xfa1cc[_0x79fe('0x3f')]=[];_0xfa1cc[_0x79fe('0x40')][_0x79fe('0x41')](',')[_0x79fe('0x42')](function(_0x4eada4){_0xfa1cc[_0x79fe('0x3f')]['push'](_0xc3f7ac[_0x4eada4]);});}delete _0xfa1cc[_0x79fe('0x40')];}catch(_0x5e29b5){_0x4696f4(_0x5e29b5);}_0x43d8b6(_0xfa1cc);});}function updateChatInteraction(_0x400a36,_0x4ab42e,_0x83737e){return new BPromise(function(_0x132662,_0x577341){return getInteractionUsers(_0x400a36,_0x83737e)['then'](function(_0x4137a3){return getInteractionTags(_0x4137a3,_0x4ab42e);})[_0x79fe('0x24')](function(_0x69ae72){_0x132662(_0x69ae72);})[_0x79fe('0x43')](function(_0x522241){_0x577341(_0x522241);});});}exports['index']=function(_0x37c37b,_0x31b15e){var _0x440ff1={},_0x365b69={},_0x2e0a27={'count':0x0,'rows':[]};var _0x3feb46=_[_0x79fe('0x3d')](db[_0x79fe('0x44')]['rawAttributes'],function(_0x2d13fb){return{'name':_0x2d13fb[_0x79fe('0x45')],'type':_0x2d13fb[_0x79fe('0x46')][_0x79fe('0x47')]};});_0x365b69[_0x79fe('0x48')]=_[_0x79fe('0x3d')](_0x3feb46,'name');_0x365b69[_0x79fe('0x49')]=_[_0x79fe('0x4a')](_0x37c37b[_0x79fe('0x49')]);_0x365b69[_0x79fe('0x4b')]=_[_0x79fe('0x4c')](_0x365b69[_0x79fe('0x48')],_0x365b69['query']);_0x440ff1[_0x79fe('0x4d')]=_[_0x79fe('0x4c')](_0x365b69[_0x79fe('0x48')],qs['fields'](_0x37c37b[_0x79fe('0x49')]['fields']));_0x440ff1['attributes']=_0x440ff1[_0x79fe('0x4d')][_0x79fe('0x4e')]?_0x440ff1[_0x79fe('0x4d')]:_0x365b69['model'];if(!_0x37c37b[_0x79fe('0x49')][_0x79fe('0x4f')](_0x79fe('0x50'))){_0x440ff1['limit']=qs['limit'](_0x37c37b[_0x79fe('0x49')][_0x79fe('0x32')]);_0x440ff1[_0x79fe('0x31')]=qs[_0x79fe('0x31')](_0x37c37b[_0x79fe('0x49')][_0x79fe('0x31')]);}_0x440ff1[_0x79fe('0x51')]=qs[_0x79fe('0x52')](_0x37c37b[_0x79fe('0x49')]['sort']);_0x440ff1[_0x79fe('0x53')]=qs[_0x79fe('0x4b')](_['pick'](_0x37c37b[_0x79fe('0x49')],_0x365b69['filters']),_0x3feb46);var _0x2909d0=[];var _0x204700=squel[_0x79fe('0x54')]()[_0x79fe('0x55')]('id')['field'](_0x79fe('0x3a'))[_0x79fe('0x55')](_0x79fe('0x56'))['from']('tools_tags');var _0x22e221=squel[_0x79fe('0x54')]()['field'](_0x79fe('0x57'))[_0x79fe('0x55')](_0x79fe('0x58'))[_0x79fe('0x55')]('ui.ChatInteractionId')[_0x79fe('0x59')](_0x79fe('0x5a'),'ui')[_0x79fe('0x5b')]('users','u','u.id\x20=\x20ui.UserId');var _0x4dc50e=squel['select']()['from'](_0x79fe('0x5c'),'i')[_0x79fe('0x5b')]('cm_contacts','c',_0x79fe('0x5d'))[_0x79fe('0x5b')](_0x79fe('0x5e'),'o','o.id\x20=\x20i.UserId')['left_join']('chat_websites','a',_0x79fe('0x5f'))['left_join'](_0x79fe('0x60'),'me',_0x79fe('0x61'))[_0x79fe('0x5b')](_0x79fe('0x62'),'it',_0x79fe('0x63'))[_0x79fe('0x5b')](_0x79fe('0x64'),'t',_0x79fe('0x65'));var _0x230ed9=squel[_0x79fe('0x66')]();var _0x20ff3a=[];var _0x4a6885=squel[_0x79fe('0x66')]();var _0x397e40;if(_0x37c37b['query'][_0x79fe('0x67')]){_0x397e40=as['parseSearch'](_0x37c37b[_0x79fe('0x49')][_0x79fe('0x67')]);var _0x523bf8=_0x397e40[_0x79fe('0x68')];for(var _0x5d60d3=0x0;_0x5d60d3<_0x397e40[_0x79fe('0x69')]['length'];_0x5d60d3++){var _0x5ef724=_0x397e40['conditions'][_0x5d60d3];var _0x9728b9='i';var _0x272272=_[_0x79fe('0x6a')](_0x3feb46,[_0x79fe('0x3a'),_0x5ef724[_0x79fe('0x55')]]);if(!_0x272272){switch(_0x5ef724[_0x79fe('0x55')]){case _0x79fe('0x6b'):if(_0x5ef724[_0x79fe('0x6c')]==0x1){_0x4dc50e[_0x79fe('0x6d')]('`'+_0x5ef724['field']+_0x79fe('0x6e'));}else{_0x4dc50e[_0x79fe('0x6d')]('`'+_0x5ef724[_0x79fe('0x55')]+_0x79fe('0x6f'));}break;case'Contact':if(_0x5ef724[_0x79fe('0x70')]==='$substring'){if(_0x5ef724[_0x79fe('0x6c')]['split']('\x20')[_0x79fe('0x4e')]>0x1){_0x230ed9[_0x523bf8](_0x79fe('0x71'),qs[_0x79fe('0x72')](_0x5ef724[_0x79fe('0x6c')]),null);}else{var _0x4e5a50='%'+_0x5ef724[_0x79fe('0x6c')]+'%';_0x230ed9[_0x523bf8](_0x79fe('0x73'),_0x4e5a50,_0x4e5a50,_0x4e5a50);}}else{_0x272272=_[_0x79fe('0x6a')](_0x3feb46,[_0x79fe('0x3a'),'ContactId']);_0x5ef724[_0x79fe('0x55')]=_0x79fe('0x74');_0xbb92d5=as['buildExpression'](_0x9728b9,_0x272272[_0x79fe('0x46')],_0x5ef724);_0x230ed9[_0x523bf8](_0xbb92d5['text'],_0xbb92d5['value'][_0x79fe('0x75')],_0xbb92d5[_0x79fe('0x6c')][_0x79fe('0x76')]);}break;case'Tag':var _0x58adb7=_0x5ef724[_0x79fe('0x6c')]['split'](',')['map'](function(_0x47780b){return Number(_0x47780b);});_0x58adb7[_0x79fe('0x42')](function(_0x45a70f){_0x4a6885['or'](_0x79fe('0x77'),'%,'+_0x45a70f+',%');});_0x20ff3a=_[_0x79fe('0x78')](_0x20ff3a,_0x58adb7);break;case _0x79fe('0x79'):if(_0x5ef724[_0x79fe('0x70')]===_0x79fe('0x7a')){_0x230ed9[_0x523bf8](_0x79fe('0x7b'),'%'+_0x5ef724['value']+'%',null);}else{_0x272272=_[_0x79fe('0x6a')](_0x3feb46,[_0x79fe('0x3a'),'UserId']);_0x5ef724[_0x79fe('0x55')]=_0x79fe('0x7c');_0xbb92d5=as[_0x79fe('0x7d')](_0x9728b9,_0x272272[_0x79fe('0x46')],_0x5ef724);_0x230ed9[_0x523bf8](_0xbb92d5[_0x79fe('0x7e')],_0xbb92d5[_0x79fe('0x6c')][_0x79fe('0x75')],_0xbb92d5[_0x79fe('0x6c')][_0x79fe('0x76')]);}break;case _0x79fe('0x7f'):_0xbb92d5=as[_0x79fe('0x7d')]('me',null,_0x5ef724);_0x230ed9[_0x523bf8](_0xbb92d5['text'],_0xbb92d5[_0x79fe('0x6c')][_0x79fe('0x75')],_0xbb92d5[_0x79fe('0x6c')][_0x79fe('0x76')]);break;}}else{var _0xbb92d5=as[_0x79fe('0x7d')](_0x9728b9,_0x272272[_0x79fe('0x46')],_0x5ef724);_0x230ed9[_0x523bf8](_0xbb92d5['text'],_0xbb92d5[_0x79fe('0x6c')][_0x79fe('0x75')],_0xbb92d5[_0x79fe('0x6c')]['end']);}}}else{var _0x4e7bdc=_(_0x37c37b['query'])['keys']()[_0x79fe('0x3d')](function(_0x485b00){return _[_0x79fe('0x80')](_0x3feb46,[_0x79fe('0x3a'),_0x485b00])?_0x485b00:undefined;})[_0x79fe('0x81')]()[_0x79fe('0x6c')]();if(!_[_0x79fe('0x82')](_0x4e7bdc)){_0x4e7bdc['forEach'](function(_0x426c6d){if(_0x426c6d==='ChatWebsiteId'){_0x4dc50e[_0x79fe('0x53')](_0x79fe('0x83'),[][_0x79fe('0x84')](_0x37c37b[_0x79fe('0x49')][_0x426c6d]));}else if(_0x426c6d===_0x79fe('0x85')){var _0xa0b17f=JSON[_0x79fe('0x86')](_0x37c37b['query'][_0x426c6d])[_0x79fe('0x87')];var _0x50c361=JSON[_0x79fe('0x86')](_0x37c37b[_0x79fe('0x49')][_0x426c6d])[_0x79fe('0x88')];_0x4dc50e['where'](_0x79fe('0x89'),_0xa0b17f,_0x50c361);}else{if(_0x37c37b[_0x79fe('0x49')][_0x426c6d]===_0x79fe('0x8a')){_0x4dc50e[_0x79fe('0x53')]('i.'+_0x426c6d+'\x20IS\x20NULL');}else{_0x4dc50e[_0x79fe('0x53')]('i.'+_0x426c6d+_0x79fe('0x8b'),_0x37c37b[_0x79fe('0x49')][_0x426c6d]);}}});}if(_0x37c37b['query'][_0x79fe('0x8c')]){if(_0x37c37b[_0x79fe('0x49')][_0x79fe('0x8c')]==0x1){_0x4dc50e[_0x79fe('0x6d')](_0x79fe('0x8d'));}else{_0x4dc50e[_0x79fe('0x6d')](_0x79fe('0x8e'));}}if(_0x37c37b[_0x79fe('0x49')][_0x79fe('0x8f')]){_0x20ff3a=_['isArray'](_0x37c37b[_0x79fe('0x49')]['tag'])?_0x37c37b[_0x79fe('0x49')][_0x79fe('0x8f')]:new Array(_0x37c37b[_0x79fe('0x49')][_0x79fe('0x8f')]);_0x20ff3a[_0x79fe('0x42')](function(_0x5d6035){_0x4a6885['or'](_0x79fe('0x77'),'%,'+_0x5d6035+',%');});}if(_0x37c37b['query'][_0x79fe('0x90')]){var _0x136706=_0x37c37b['query'][_0x79fe('0x90')][_0x79fe('0x91')]('\x5c','\x5c\x5c')[_0x79fe('0x91')](/'/g,'\x27\x27');if(qs[_0x79fe('0x92')](_0x136706)){_0x230ed9['or'](_0x79fe('0x93'),_0x136706+'%');}else{_0x230ed9['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x79fe('0x72')](_0x136706))['or'](_0x79fe('0x94'),_0x136706+'%');}}}_0x4dc50e[_0x79fe('0x53')](_0x230ed9);_0x4dc50e[_0x79fe('0x95')](_0x79fe('0x96'));var _0x2f16d1={'type':db[_0x79fe('0x97')][_0x79fe('0x98')][_0x79fe('0x99')],'raw':!![]};var _0x202107=_0x4dc50e['clone']();_0x202107[_0x79fe('0x55')]('i.id');_0x202107[_0x79fe('0x55')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x79fe('0x6b'));if(_0x440ff1[_0x79fe('0x51')]){_0x440ff1[_0x79fe('0x51')][_0x79fe('0x42')](function(_0x34a296){var _0x4dc8cd=_0x34a296[0x0]===_0x79fe('0x9a')?_0x34a296[0x0]:'i.'+_0x34a296[0x0];_0x4dc50e[_0x79fe('0x51')](_0x4dc8cd,_0x34a296[0x1]===_0x79fe('0x9b')?![]:!![]);});}if(!_[_0x79fe('0x82')](_0x20ff3a)){_0x4dc50e['having'](_0x4a6885);_0x202107[_0x79fe('0x53')]('t.id\x20IN\x20?',_0x20ff3a);}BPromise[_0x79fe('0x9c')]()[_0x79fe('0x24')](function(){if(!_0x397e40){if(_0x37c37b[_0x79fe('0x49')][_0x79fe('0x9d')])return;_0x202107[_0x79fe('0x53')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x4dc50e[_0x79fe('0x53')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x37c37b[_0x79fe('0x9e')][_0x79fe('0x9f')]!=='agent')return;return _0x37c37b[_0x79fe('0x9e')][_0x79fe('0xa0')]({'attributes':['id'],'raw':!![]})[_0x79fe('0x24')](function(_0x3aa36b){if(_[_0x79fe('0x82')](_0x3aa36b)){_0x202107[_0x79fe('0x53')]('i.ChatWebsiteId\x20IS\x20NULL');_0x4dc50e['where'](_0x79fe('0xa1'));}else{_0x202107[_0x79fe('0x53')](_0x79fe('0x83'),_['map'](_0x3aa36b,'id'));_0x4dc50e[_0x79fe('0x53')](_0x79fe('0x83'),_[_0x79fe('0x3d')](_0x3aa36b,'id'));}});})[_0x79fe('0x24')](function(){if(_0x37c37b[_0x79fe('0x9e')]['role']===_0x79fe('0xa2')&&!_0x397e40&&!_0x37c37b[_0x79fe('0x49')][_0x79fe('0x9d')])return[];return db['sequelize'][_0x79fe('0x49')](_0x202107[_0x79fe('0xa3')](),_0x2f16d1);})[_0x79fe('0x24')](function(_0x175ee6){_0x2e0a27['count']=_0x175ee6[_0x79fe('0x4e')];if(_0x2e0a27[_0x79fe('0x30')]===0x0)return[];return db['sequelize'][_0x79fe('0x49')](_0x204700[_0x79fe('0xa3')](),_0x2f16d1)[_0x79fe('0x24')](function(_0x6786a1){_0x2909d0=_[_0x79fe('0xa4')](_0x6786a1,'id');_0x2f16d1=_['merge'](_0x2f16d1,{'model':db[_0x79fe('0x44')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x37c37b[_0x79fe('0x49')]['fields']){_0x440ff1['attributes']['forEach'](function(_0x381d08){_0x4dc50e[_0x79fe('0x55')]('i.'+_0x381d08);});}else{_0x4dc50e[_0x79fe('0x55')](_0x79fe('0xa5'),_0x79fe('0x6b'));_0x4dc50e['field'](_0x79fe('0xa6'),_0x79fe('0xa7'));_0x4dc50e['field'](_0x79fe('0xa8'),'Account.mandatoryDisposition');_0x4dc50e['field'](_0x79fe('0xa9'),_0x79fe('0x9a'));_0x4dc50e[_0x79fe('0x55')](_0x79fe('0xaa'));_0x4dc50e[_0x79fe('0x55')](_0x79fe('0xab'),_0x79fe('0xac'));_0x4dc50e[_0x79fe('0x55')](_0x79fe('0xad'),_0x79fe('0xae'));_0x4dc50e[_0x79fe('0x55')]('c.email',_0x79fe('0xaf'));_0x4dc50e[_0x79fe('0x55')](_0x79fe('0xb0'),_0x79fe('0xb1'));_0x4dc50e[_0x79fe('0x55')](_0x79fe('0xb2'),_0x79fe('0xb3'));_0x4dc50e[_0x79fe('0x55')](_0x79fe('0xb4'),'Contact.fax');_0x4dc50e[_0x79fe('0x55')](_0x79fe('0xb5'),_0x79fe('0xb6'));_0x4dc50e[_0x79fe('0x55')]('o.internal',_0x79fe('0xb7'));_0x4dc50e['field'](_0x79fe('0xb8'),'TagIds');}if(_0x440ff1[_0x79fe('0x32')])_0x4dc50e[_0x79fe('0x32')](_0x440ff1[_0x79fe('0x32')]);if(_0x440ff1[_0x79fe('0x31')])_0x4dc50e[_0x79fe('0x31')](_0x440ff1[_0x79fe('0x31')]);return db['sequelize']['query'](_0x4dc50e[_0x79fe('0xa3')](),_0x2f16d1);})[_0x79fe('0x24')](function(_0x2300ba){_0x22e221[_0x79fe('0x53')](_0x79fe('0xb9'),_['map'](_0x2300ba,'id'));return db[_0x79fe('0xba')]['query'](_0x22e221['toString'](),_0x2f16d1)[_0x79fe('0x24')](function(_0x517c85){var _0x3a65d9=_[_0x79fe('0xbb')](_0x517c85,_0x79fe('0xbc'));var _0x1dcf6f=[];_0x2300ba[_0x79fe('0x42')](function(_0x454eb0){_0x1dcf6f[_0x79fe('0xbd')](updateChatInteraction(_0x454eb0,_0x2909d0,_0x3a65d9));});return BPromise[_0x79fe('0xbe')](_0x1dcf6f);});});})['then'](function(_0xebcf05){_0x2e0a27[_0x79fe('0xbf')]=_0xebcf05;return _0x2e0a27;})['then'](respondWithFilteredResult(_0x31b15e,_0x440ff1))[_0x79fe('0x43')](handleError(_0x31b15e,null));};exports[_0x79fe('0xc0')]=function(_0x1fd585,_0x24a505){var _0x57e10f={'raw':![],'where':{'id':_0x1fd585[_0x79fe('0xc1')]['id']}},_0x48e12d={};_0x48e12d['model']=_[_0x79fe('0x4a')](db[_0x79fe('0x44')][_0x79fe('0xc2')]);_0x48e12d['query']=_[_0x79fe('0x4a')](_0x1fd585[_0x79fe('0x49')]);_0x48e12d[_0x79fe('0x4b')]=_[_0x79fe('0x4c')](_0x48e12d[_0x79fe('0x48')],_0x48e12d[_0x79fe('0x49')]);_0x57e10f['attributes']=_['intersection'](_0x48e12d[_0x79fe('0x48')],qs['fields'](_0x1fd585[_0x79fe('0x49')][_0x79fe('0xc3')]));_0x57e10f[_0x79fe('0x4d')]=_0x57e10f[_0x79fe('0x4d')]['length']?_0x57e10f[_0x79fe('0x4d')]:_0x48e12d[_0x79fe('0x48')];if(_0x1fd585[_0x79fe('0x49')][_0x79fe('0xc4')]){_0x57e10f['include']=[{'all':!![]}];}_0x57e10f=_[_0x79fe('0xc5')]({},_0x57e10f,_0x1fd585['options']);return db[_0x79fe('0x44')]['find'](_0x57e10f)[_0x79fe('0x24')](handleEntityNotFound(_0x24a505,null))[_0x79fe('0x24')](respondWithResult(_0x24a505,null))[_0x79fe('0x43')](handleError(_0x24a505,null));};exports[_0x79fe('0xc6')]=function(_0x1061f4,_0x1c5f4c){return db['ChatInteraction'][_0x79fe('0xc6')](_0x1061f4['body'],{})[_0x79fe('0x24')](respondWithResult(_0x1c5f4c,0xc9))[_0x79fe('0x43')](handleError(_0x1c5f4c,null));};exports[_0x79fe('0xc7')]=function(_0x4122d1,_0x2b03ee){if(_0x4122d1[_0x79fe('0x7f')]['id']){delete _0x4122d1[_0x79fe('0x7f')]['id'];}return db[_0x79fe('0x44')][_0x79fe('0x6a')]({'where':{'id':_0x4122d1[_0x79fe('0xc1')]['id']}})[_0x79fe('0x24')](handleEntityNotFound(_0x2b03ee,null))[_0x79fe('0x24')](saveUpdates(_0x4122d1[_0x79fe('0x7f')],null))[_0x79fe('0x24')](respondWithResult(_0x2b03ee,null))['catch'](handleError(_0x2b03ee,null));};exports['destroy']=function(_0x797422,_0x304d1e){return db[_0x79fe('0x44')][_0x79fe('0x6a')]({'where':{'id':_0x797422[_0x79fe('0xc1')]['id']}})[_0x79fe('0x24')](handleEntityNotFound(_0x304d1e,null))[_0x79fe('0x24')](removeEntity(_0x304d1e,null))[_0x79fe('0x43')](handleError(_0x304d1e,null));};exports['describe']=function(_0x32c2ed,_0x241b06){return db[_0x79fe('0x44')]['describe']()[_0x79fe('0x24')](respondWithResult(_0x241b06,null))[_0x79fe('0x43')](handleError(_0x241b06,null));};exports[_0x79fe('0xc8')]=function(_0x12b2b8,_0x750fb6){var _0x2f4d34=_0x12b2b8[_0x79fe('0xc1')]['id'];var _0x2a470b;var _0x163679;var _0x53b354;return db[_0x79fe('0x44')]['findOne']({'where':{'id':_0x2f4d34}})['then'](function(_0x585aa9){_0x2a470b=_0x585aa9;return db['ChatWebsite'][_0x79fe('0xc9')]({'where':{'id':_0x585aa9[_0x79fe('0x9d')]},'attributes':['id',_0x79fe('0xca'),_0x79fe('0xcb')],'raw':!![]});})[_0x79fe('0x24')](function(_0xfcc72a){if(_0xfcc72a&&_0xfcc72a['vidaooApiKey']&&_0xfcc72a['vidaooEscalation']){_0x163679=_0xfcc72a;var _0x370814={'rejectUnauthorized':![],'method':_0x79fe('0xcc'),'uri':_0x79fe('0xcd'),'headers':{'X-APIKEY':_0xfcc72a[_0x79fe('0xca')]},'body':{'name':'MotionCWB:'+_0x2f4d34},'redirect':_0x79fe('0xce'),'json':!![]};return rp(_0x370814);}else{throw new db['Sequelize'][(_0x79fe('0xcf'))](_0x79fe('0xd0'));}})[_0x79fe('0x24')](function(_0x2992e0){_0x53b354=_0x2992e0;if(_0x53b354['id']){var _0x540077={'body':_0x53b354[_0x79fe('0xd1')],'ChatWebsiteId':_0x163679['id'],'ChatInteractionId':_0x2a470b['id'],'direction':_0x79fe('0xd2'),'UserId':_0x12b2b8['user']['id']};return db[_0x79fe('0xd3')][_0x79fe('0xc6')](_0x540077,{});}else{throw new db['Sequelize'][(_0x79fe('0xcf'))](_0x79fe('0xd4'));}})[_0x79fe('0x24')](function(){return _0x2a470b[_0x79fe('0xd5')]({'vidaooSessionId':_0x53b354['id']});})[_0x79fe('0x24')](respondWithResult(_0x750fb6,null))['catch'](handleError(_0x750fb6,null));};exports[_0x79fe('0xd6')]=function(_0xcf0b7d,_0x1c0548){if(_0xcf0b7d[_0x79fe('0x7f')]['id']){delete _0xcf0b7d['body']['id'];}return db[_0x79fe('0x44')][_0x79fe('0x6a')]({'where':{'id':_0xcf0b7d[_0x79fe('0xc1')]['id']},'include':[{'model':db[_0x79fe('0xd7')],'as':_0x79fe('0xd8')}]})[_0x79fe('0x24')](handleEntityNotFound(_0x1c0548,null))[_0x79fe('0x24')](saveUpdates(_0xcf0b7d[_0x79fe('0x7f')],null))['then'](respondWithResult(_0x1c0548,null))[_0x79fe('0x43')](handleError(_0x1c0548,null));};exports['abandon']=function(_0xa21494,_0x461b0a,_0x1566d6){if(_0xa21494[_0x79fe('0x7f')]['id']){delete _0xa21494['body']['id'];}return db[_0x79fe('0x44')][_0x79fe('0x6a')]({'where':{'id':_0xa21494[_0x79fe('0xc1')]['id']}})[_0x79fe('0x24')](function(_0xa2b309){if(!_0xa2b309){logger[_0x79fe('0x29')](_0x79fe('0xd9'),_0x79fe('0xda'),0x194,_0x79fe('0xdb'));_0x461b0a[_0x79fe('0x2e')](0x194);}else{if(_0xa2b309['UserId']){throw new db[(_0x79fe('0x97'))][(_0x79fe('0xcf'))](_0x79fe('0xdc'));}}return _0xa2b309;})[_0x79fe('0x24')](function(_0x168d04){if(_0x168d04){return _0x168d04[_0x79fe('0xc7')]({'closed':_0xa21494[_0x79fe('0x7f')][_0x79fe('0xdd')],'disposition':_0xa21494[_0x79fe('0x7f')][_0x79fe('0xde')]})[_0x79fe('0x24')](function(_0x1f889f){return _0x1f889f;});}})[_0x79fe('0x24')](function(_0x6aadaf){return respondWithRpcPromise(_0x79fe('0xdf'),_0x79fe('0xda'),_0xa21494[_0x79fe('0x7f')],client9004);})['then'](respondWithResult(_0x461b0a,null))['catch'](handleError(_0x461b0a,null));};exports[_0x79fe('0xe0')]=function(_0x35da8a,_0x4ed0cd,_0x269e58){_0x35da8a[_0x79fe('0x7f')]['name']=_0x35da8a[_0x79fe('0xe1')]['originalname'];_0x35da8a[_0x79fe('0x7f')][_0x79fe('0xe2')]=_0x35da8a[_0x79fe('0xe1')][_0x79fe('0xe3')];_0x35da8a[_0x79fe('0x7f')][_0x79fe('0x46')]=_0x35da8a['file']['mimetype'];return db['Attachment'][_0x79fe('0xc6')](_0x35da8a[_0x79fe('0x7f')])[_0x79fe('0x24')](respondWithResult(_0x4ed0cd,0xc9))[_0x79fe('0x43')](handleError(_0x4ed0cd,null));};exports[_0x79fe('0xe4')]=function(_0x56c728,_0x715361,_0x22250a){return db['ChatInteraction'][_0x79fe('0xc9')]({'where':{'id':_0x56c728[_0x79fe('0xc1')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x715361,null))[_0x79fe('0x24')](function(_0x5545c9){if(_0x5545c9){if(_0x5545c9[_0x79fe('0xdd')]){return _0x715361[_0x79fe('0x2f')](0x193)[_0x79fe('0x35')]({'status':0x193,'message':_0x79fe('0xe5')});}return db['Attachment'][_0x79fe('0xc9')]({'where':{'id':_0x56c728['query'][_0x79fe('0xe6')]},'raw':!![]})[_0x79fe('0x24')](handleEntityNotFound(_0x715361,null));}})['then'](function(_0x203c08){if(_0x203c08){var _0x25c44f=_0x203c08[_0x79fe('0xe7')]!==null;var _0xdcb410=path[_0x79fe('0xe8')](config['root'],'server/files/attachments/');if(_0x25c44f){_0xdcb410=path[_0x79fe('0xe8')](_0xdcb410,_0x79fe('0xe9'));}var _0x16a311=path[_0x79fe('0xe8')](_0xdcb410,_0x203c08[_0x79fe('0xe2')]);return _0x715361[_0x79fe('0xea')](_0x16a311);}})['catch'](handleError(_0x715361,null));};exports[_0x79fe('0xeb')]=function(_0x4b1449,_0x58d48e){var _0x5c4f52=null;var _0x4f83a1=null;var _0x1397a5=null;var _0xe4a431=null;if(_0x4b1449[_0x79fe('0x7f')]['id']){delete _0x4b1449[_0x79fe('0x7f')]['id'];}if(_0x4b1449[_0x79fe('0x7f')][_0x79fe('0xec')]){_0xe4a431=path[_0x79fe('0xe8')](config[_0x79fe('0xed')],_0x79fe('0xee'),util[_0x79fe('0xef')](_0x79fe('0xf0'),Date[_0x79fe('0xf1')]()));_0x4b1449[_0x79fe('0x7f')]['pathTranscript']=_0xe4a431;}return db[_0x79fe('0x44')][_0x79fe('0x6a')]({'where':{'id':_0x4b1449['params']['id']},'include':[{'model':db[_0x79fe('0xd3')],'as':_0x79fe('0xf2'),'include':[{'model':db[_0x79fe('0x79')],'as':_0x79fe('0x79')}]}]})['then'](handleEntityNotFound(_0x58d48e,null))[_0x79fe('0x24')](saveUpdates(_0x4b1449[_0x79fe('0x7f')],null))[_0x79fe('0x24')](function(_0x150a8a){if(_0x150a8a){_0x5c4f52=_0x150a8a;return db[_0x79fe('0xf3')][_0x79fe('0x6a')]({'where':{'id':_0x5c4f52[_0x79fe('0x9d')]}});}})['then'](function(_0x2a732f){if(_0x2a732f){_0x1397a5=_0x2a732f;return db[_0x79fe('0xd7')][_0x79fe('0x6a')]({'where':{'id':_0x5c4f52[_0x79fe('0x74')]}});}})[_0x79fe('0x24')](function(_0x2f8a70){if(_0x2f8a70){_0x4f83a1=_0x2f8a70;if(_0xe4a431){var _0x3a4be4=null;for(var _0x42d5ea=0x1;_0x42d5ea<_0x5c4f52[_0x79fe('0xf2')][_0x79fe('0x4e')];++_0x42d5ea){_0x3a4be4=_0x5c4f52[_0x79fe('0xf2')][_0x42d5ea];var _0x140e73=_0x3a4be4[_0x79fe('0x7c')]?util[_0x79fe('0xef')](_0x79fe('0xf4'),_0x1397a5[_0x79fe('0xf5')],_0x3a4be4[_0x79fe('0x7c')]):_0x79fe('0xf6');var _0x2320cd=_0x4b1449[_0x79fe('0x7f')][_0x79fe('0xf7')]||util[_0x79fe('0xef')](_0x79fe('0xf4'),_0x79fe('0xf8'),_0x3a4be4[_0x79fe('0x74')]);switch(_0x1397a5[_0x79fe('0xf9')]){case'website_alias':_0x140e73=_0x3a4be4['UserId']?util[_0x79fe('0xef')](_0x79fe('0xf4'),_0x1397a5['agentAlias'],_0x3a4be4[_0x79fe('0x7c')]):_0x79fe('0xf6');break;case _0x79fe('0xfa'):_0x140e73=_0x3a4be4[_0x79fe('0x7c')]?_0x3a4be4[_0x79fe('0x79')][_0x79fe('0xfb')]||_0x3a4be4[_0x79fe('0x79')][_0x79fe('0x3e')]:_0x79fe('0xf6');break;case _0x79fe('0xfc'):_0x140e73=_0x3a4be4[_0x79fe('0x7c')]?_0x3a4be4[_0x79fe('0x79')][_0x79fe('0x3e')]:_0x79fe('0xf6');break;default:_0x140e73=_0x3a4be4[_0x79fe('0x7c')]?util[_0x79fe('0xef')](_0x79fe('0xf4'),_0x1397a5['agentAlias'],_0x3a4be4[_0x79fe('0x7c')]):_0x79fe('0xf6');}var _0x2521a0=util[_0x79fe('0xef')](_0x79fe('0xfd'),moment(_0x3a4be4['createdAt'])[_0x79fe('0xef')]('MM/DD/YYYY\x20HH:mm:ss'),_0x3a4be4[_0x79fe('0xfe')]==='in'?_0x2320cd:_0x140e73,_0x3a4be4['body']);if(!_0x3a4be4[_0x79fe('0xff')]){fs['appendFileSync'](_0xe4a431,_0x2521a0);}}return db[_0x79fe('0x100')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x79fe('0x101')],'as':_0x79fe('0x102'),'raw':!![]}]});}}})['then'](function(_0x32d99f){if(_0x32d99f&&_0x32d99f['Smtp']&&_0x4b1449['body']){var _0x1d17f1={'tls':{'rejectUnauthorized':![]}};if(_0x32d99f[_0x79fe('0x102')][_0x79fe('0x103')]){_0x1d17f1[_0x79fe('0x103')]=_0x32d99f[_0x79fe('0x102')][_0x79fe('0x103')];}else{_0x1d17f1['host']=_0x32d99f[_0x79fe('0x102')][_0x79fe('0x104')];_0x1d17f1['port']=_0x32d99f['Smtp']['port'];_0x1d17f1[_0x79fe('0x105')]=_0x32d99f[_0x79fe('0x102')][_0x79fe('0x105')];}if(_0x32d99f[_0x79fe('0x102')][_0x79fe('0x106')]){_0x1d17f1['auth']={'user':_0x32d99f[_0x79fe('0x102')][_0x79fe('0x9e')],'pass':_0x32d99f[_0x79fe('0x102')][_0x79fe('0x107')]};}return respondWithRpcPromise(_0x79fe('0x108'),_0x79fe('0x109'),{'account':_0x1d17f1,'message':{'from':util['format'](_0x79fe('0x10a'),_0x32d99f[_0x79fe('0x3a')],_0x32d99f['email']||_0x32d99f['Smtp']['user']),'to':_0x4b1449[_0x79fe('0x7f')][_0x79fe('0xec')],'subject':'Mail\x20Transcript','text':util[_0x79fe('0xef')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x4b1449[_0x79fe('0x7f')][_0x79fe('0xec')]),'attachments':[{'path':_0xe4a431}]}})[_0x79fe('0x24')](function(){return _0x5c4f52;})[_0x79fe('0x43')](function(_0x13939e){console[_0x79fe('0x29')](_0x13939e);});}else{return _0x5c4f52;}})['then'](respondWithStatusCode(_0x58d48e,0xc8))[_0x79fe('0x43')](handleError(_0x58d48e,null));};exports[_0x79fe('0x10b')]=function(_0x9dfdf9,_0xce1c53,_0x4c96a3){return db[_0x79fe('0xd3')][_0x79fe('0x6a')]({'where':{'id':_0x9dfdf9[_0x79fe('0xc1')]['id']}})['then'](handleEntityNotFound(_0xce1c53,null))[_0x79fe('0x24')](function(_0x427306){if(_0x427306){return _0x427306[_0x79fe('0x10b')](_0x9dfdf9[_0x79fe('0x7f')][_0x79fe('0x10c')],_[_0x79fe('0x10d')](_0x9dfdf9[_0x79fe('0x7f')],[_0x79fe('0x10c'),'id'])||{});}})[_0x79fe('0x24')](respondWithResult(_0xce1c53,null))[_0x79fe('0x43')](handleError(_0xce1c53,null));};exports[_0x79fe('0x10e')]=function(_0x3aaf16,_0x1743f3,_0x47dc2c){var _0x36e55f={'raw':![],'where':{}};var _0x3ea297={};var _0x26e078={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x3aaf16[_0x79fe('0xc1')]['id']}})[_0x79fe('0x24')](handleEntityNotFound(_0x1743f3,null))[_0x79fe('0x24')](function(_0x206f77){if(_0x206f77){_0x3ea297['model']=_[_0x79fe('0x4a')](db[_0x79fe('0xd3')][_0x79fe('0xc2')]);_0x3ea297[_0x79fe('0x49')]=_[_0x79fe('0x4a')](_0x3aaf16['query']);_0x3ea297[_0x79fe('0x4b')]=_[_0x79fe('0x4c')](_0x3ea297['model'],_0x3ea297[_0x79fe('0x49')]);_0x36e55f['attributes']=_[_0x79fe('0x4c')](_0x3ea297['model'],qs[_0x79fe('0xc3')](_0x3aaf16['query'][_0x79fe('0xc3')]));_0x36e55f[_0x79fe('0x4d')]=_0x36e55f[_0x79fe('0x4d')][_0x79fe('0x4e')]?_0x36e55f['attributes']:_0x3ea297[_0x79fe('0x48')];if(!_0x3aaf16['query']['hasOwnProperty'](_0x79fe('0x50'))){_0x36e55f[_0x79fe('0x32')]=qs[_0x79fe('0x32')](_0x3aaf16[_0x79fe('0x49')][_0x79fe('0x32')]);_0x36e55f[_0x79fe('0x31')]=qs[_0x79fe('0x31')](_0x3aaf16['query'][_0x79fe('0x31')]);}_0x36e55f[_0x79fe('0x51')]=qs[_0x79fe('0x52')](_0x3aaf16[_0x79fe('0x49')][_0x79fe('0x52')]);_0x36e55f['where']=qs[_0x79fe('0x4b')](_[_0x79fe('0x10f')](_0x3aaf16[_0x79fe('0x49')],_0x3ea297[_0x79fe('0x4b')]));_0x36e55f[_0x79fe('0x53')][_0x79fe('0xbc')]=_0x206f77['id'];if(_0x3aaf16['query'][_0x79fe('0x90')]){_0x36e55f[_0x79fe('0x53')]=_[_0x79fe('0xc5')](_0x36e55f[_0x79fe('0x53')],{'$or':_['map'](_0x36e55f['attributes'],function(_0x2c7bc6){var _0x1709db={};_0x1709db[_0x2c7bc6]={'$like':'%'+_0x3aaf16[_0x79fe('0x49')][_0x79fe('0x90')]+'%'};return _0x1709db;})});}if(_0x3aaf16[_0x79fe('0x49')]['$gte']){var _0x3e043c=_0x3aaf16[_0x79fe('0x49')][_0x79fe('0x87')][_0x79fe('0x41')](',');var _0x180e58={};_0x180e58[_0x3e043c[0x0]]={'$gte':moment(_0x3e043c[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x36e55f[_0x79fe('0x53')]=_[_0x79fe('0xc5')](_0x36e55f[_0x79fe('0x53')],_0x180e58);}_0x36e55f=_[_0x79fe('0xc5')]({},_0x36e55f,_0x3aaf16[_0x79fe('0x110')]);return db['ChatMessage'][_0x79fe('0x30')]({'where':_0x36e55f[_0x79fe('0x53')]})[_0x79fe('0x24')](function(_0x25a7d9){_0x26e078['count']=_0x25a7d9;if(_0x3aaf16[_0x79fe('0x49')][_0x79fe('0xc4')]){_0x36e55f[_0x79fe('0x111')]=[{'all':!![]}];}return db[_0x79fe('0xd3')][_0x79fe('0x112')](_0x36e55f);})[_0x79fe('0x24')](function(_0xdcf88b){_0x26e078[_0x79fe('0xbf')]=_0xdcf88b;return _0x26e078;});}})[_0x79fe('0x24')](respondWithFilteredResult(_0x1743f3,_0x36e55f))[_0x79fe('0x43')](handleError(_0x1743f3,null));};exports['getMyMessages']=function(_0x44f81b,_0x24150d,_0x5e25f8){var _0x9dcedb={'where':{}},_0x5ac5b3={},_0x751461={'count':0x0,'rows':[]};return db[_0x79fe('0x44')][_0x79fe('0xc9')]({'where':{'id':_0x44f81b[_0x79fe('0xc1')]['id']}})['then'](handleEntityNotFound(_0x24150d,null))['then'](function(_0x221a6f){if(_0x221a6f){_0x5ac5b3[_0x79fe('0x48')]=_[_0x79fe('0x4a')](db[_0x79fe('0xd3')][_0x79fe('0xc2')]);_0x5ac5b3[_0x79fe('0x49')]=_[_0x79fe('0x4a')](_0x44f81b['query']);_0x5ac5b3['filters']=_[_0x79fe('0x4c')](_0x5ac5b3[_0x79fe('0x48')],_0x5ac5b3[_0x79fe('0x49')]);_0x9dcedb[_0x79fe('0x4d')]=_[_0x79fe('0x4c')](_0x5ac5b3[_0x79fe('0x48')],qs[_0x79fe('0xc3')](_0x44f81b[_0x79fe('0x49')][_0x79fe('0xc3')]));_0x9dcedb[_0x79fe('0x4d')]=_0x9dcedb[_0x79fe('0x4d')][_0x79fe('0x4e')]?_0x9dcedb['attributes']:_0x5ac5b3[_0x79fe('0x48')];if(!_0x44f81b[_0x79fe('0x49')][_0x79fe('0x4f')](_0x79fe('0x50'))){_0x9dcedb['limit']=qs[_0x79fe('0x32')](_0x44f81b['query'][_0x79fe('0x32')]);_0x9dcedb[_0x79fe('0x31')]=qs[_0x79fe('0x31')](_0x44f81b[_0x79fe('0x49')][_0x79fe('0x31')]);}_0x9dcedb[_0x79fe('0x51')]=qs[_0x79fe('0x52')](_0x44f81b['query']['sort']);_0x9dcedb['where']=qs['filters'](_['pick'](_0x44f81b[_0x79fe('0x49')],_0x5ac5b3['filters']));_0x9dcedb[_0x79fe('0x53')][_0x79fe('0xbc')]=_0x221a6f['id'];if(_0x44f81b[_0x79fe('0x49')][_0x79fe('0x90')]){_0x9dcedb[_0x79fe('0x53')]=_[_0x79fe('0xc5')](_0x9dcedb[_0x79fe('0x53')],{'$or':_[_0x79fe('0x3d')](_0x9dcedb[_0x79fe('0x4d')],function(_0x201267){var _0x2e1334={};_0x2e1334[_0x201267]={'$like':'%'+_0x44f81b[_0x79fe('0x49')][_0x79fe('0x90')]+'%'};return _0x2e1334;})});}_0x9dcedb['where']['secret']=![];if(_0x44f81b[_0x79fe('0x49')]['id']){_0x9dcedb[_0x79fe('0x53')]['id']={'$gt':_0x44f81b[_0x79fe('0x49')]['id']};}_0x9dcedb=_[_0x79fe('0xc5')]({},_0x9dcedb,_0x44f81b[_0x79fe('0x110')]);return db[_0x79fe('0xd3')][_0x79fe('0x30')]({'where':_0x9dcedb[_0x79fe('0x53')]})[_0x79fe('0x24')](function(_0x52ae79){_0x751461[_0x79fe('0x30')]=_0x52ae79;_0x9dcedb[_0x79fe('0x111')]=[];if(_0x44f81b[_0x79fe('0x49')][_0x79fe('0x113')]){_0x9dcedb[_0x79fe('0x111')]['push']({'model':db[_0x79fe('0x79')],'as':_0x79fe('0x79'),'attributes':['id',_0x79fe('0x3e'),_0x79fe('0xfb')]});}if(_0x44f81b[_0x79fe('0x49')]['includeAll']){_0x9dcedb[_0x79fe('0x111')]=[{'all':!![]}];}return db[_0x79fe('0xd3')][_0x79fe('0x112')](_0x9dcedb);})['then'](function(_0x30a2e1){_0x751461[_0x79fe('0xbf')]=_0x30a2e1;return _0x751461;});}})[_0x79fe('0x24')](respondWithFilteredResult(_0x24150d,_0x9dcedb))[_0x79fe('0x43')](handleError(_0x24150d,null));};exports[_0x79fe('0x114')]=function(_0x2ba7b8,_0x3d2214,_0x217da0){return db['ChatInteraction'][_0x79fe('0x6a')]({'where':{'id':_0x2ba7b8['params']['id']}})[_0x79fe('0x24')](handleEntityNotFound(_0x3d2214,null))[_0x79fe('0x24')](function(_0x2386cb){if(_0x2386cb){return _0x2386cb[_0x79fe('0x115')](_0x2ba7b8[_0x79fe('0x7f')][_0x79fe('0x10c')],_[_0x79fe('0x10d')](_0x2ba7b8['body'],[_0x79fe('0x10c'),'id'])||{})[_0x79fe('0x116')](function(){return db[_0x79fe('0x117')][_0x79fe('0x112')]({'attributes':['id',_0x79fe('0x3a'),'color'],'where':{'id':_0x2ba7b8[_0x79fe('0x7f')][_0x79fe('0x10c')]}});})[_0x79fe('0x24')](function(_0xc7c07d){socket['emit'](_0x79fe('0x118'),{'id':Number(_0x2ba7b8[_0x79fe('0xc1')]['id']),'tags':_0xc7c07d||[]});return{'id':Number(_0x2ba7b8[_0x79fe('0xc1')]['id']),'tags':_0xc7c07d||[]};});}})[_0x79fe('0x24')](respondWithResult(_0x3d2214,null))[_0x79fe('0x43')](handleError(_0x3d2214,null));};exports[_0x79fe('0x119')]=function(_0x160895,_0x3a6f19,_0x551a6c){return db[_0x79fe('0x44')][_0x79fe('0x6a')]({'where':{'id':_0x160895[_0x79fe('0xc1')]['id']}})[_0x79fe('0x24')](handleEntityNotFound(_0x3a6f19,null))[_0x79fe('0x24')](function(_0x470043){if(_0x470043){return _0x470043[_0x79fe('0x119')](_0x160895['query'][_0x79fe('0x10c')]);}})['then'](respondWithStatusCode(_0x3a6f19,null))[_0x79fe('0x43')](handleError(_0x3a6f19,null));};exports['download']=function(_0x1c9308,_0x1599fd){var _0x427c2b=moment()[_0x79fe('0x11a')]()[_0x79fe('0xa3')]();var _0x5b0588=path[_0x79fe('0xe8')](config[_0x79fe('0xed')],_0x79fe('0x11b'),'files',_0x79fe('0x11c'));var _0x1810a3=path['join'](config[_0x79fe('0xed')],_0x79fe('0x11b'),_0x79fe('0x11d'),_0x79fe('0x11e'));var _0x322623=path[_0x79fe('0xe8')](_0x5b0588,_0x427c2b);var _0x12e9b7=util[_0x79fe('0xef')](_0x79fe('0x11f'),_0x1c9308['params']['id'],_0x427c2b);var _0x809ad4=path[_0x79fe('0xe8')](_0x5b0588,_0x12e9b7);var _0x4686b8=[];_0x4686b8['push']({'model':db['User'],'as':_0x79fe('0x79'),'attributes':['id',_0x79fe('0x3e')],'raw':!![]});_0x4686b8['push']({'model':db[_0x79fe('0xd7')],'as':_0x79fe('0xd8'),'attributes':['id',_0x79fe('0x120'),'lastName'],'raw':!![]});if(_0x1c9308['query'][_0x79fe('0x11e')]){_0x4686b8[_0x79fe('0xbd')]({'model':db[_0x79fe('0x121')],'as':_0x79fe('0x121'),'raw':!![]});}var _0x51887d=[{'model':db[_0x79fe('0xd3')],'as':_0x79fe('0xf2'),'attributes':['id',_0x79fe('0x7f'),_0x79fe('0x85'),_0x79fe('0xfe'),_0x79fe('0xff'),'read'],'include':_0x4686b8}];_0x51887d[_0x79fe('0xbd')]({'model':db['ChatWebsite'],'as':_0x79fe('0x122'),'attributes':['id','name']});_0x51887d[_0x79fe('0xbd')]({'model':db[_0x79fe('0x79')],'as':_0x79fe('0x123'),'attributes':['id',_0x79fe('0x3e')]});return db[_0x79fe('0x44')]['find']({'where':{'id':_0x1c9308[_0x79fe('0xc1')]['id']},'include':_0x51887d})[_0x79fe('0x24')](handleEntityNotFound(_0x1599fd,null))['then'](function(_0xbde545){if(_0xbde545){var _0x50afe0=_0xbde545[_0x79fe('0x124')]({'plain':!![]});fs[_0x79fe('0x125')](_0x322623);var _0x155bc9={'format':'A4','border':_0x79fe('0x126'),'header':{'height':'40px','contents':{'first':_0x79fe('0x127')}},'footer':{'height':'30px','contents':{'default':util[_0x79fe('0xef')](_0x79fe('0x128'),util['format'](_0x79fe('0x129'),_0x79fe('0x12a'),_0x50afe0['id']),moment()[_0x79fe('0xef')](_0x79fe('0x12b'))['toString']())}}};var _0x1d1a01={'channel':'Chat','account':_0x50afe0['Account']['name'],'agent':_0x50afe0[_0x79fe('0x123')]?_0x50afe0[_0x79fe('0x123')][_0x79fe('0x3e')]:_0x79fe('0x12c'),'createdAt':moment(_0x50afe0['createdAt'])['format'](_0x79fe('0x12d'))[_0x79fe('0xa3')](),'closedAt':_0x50afe0['closed']?moment(_0x50afe0['closedAt'])['format'](_0x79fe('0x12d'))[_0x79fe('0xa3')]():'','disposition':_0x50afe0[_0x79fe('0xde')],'chatInfo':{'browser':_0x50afe0[_0x79fe('0x12e')],'os':_0x50afe0[_0x79fe('0x12f')],'referer':_0x50afe0[_0x79fe('0x130')],'customerIp':_0x50afe0[_0x79fe('0x131')],'customerPort':_0x50afe0[_0x79fe('0x132')]?_0x50afe0['customerPort']:_0x79fe('0x12c')},'messages':_(_0x50afe0[_0x79fe('0xf2')])[_0x79fe('0x133')]()[_0x79fe('0x90')]({'secret':![]})[_0x79fe('0x3d')](function(_0x53d73f){if(_0x53d73f[_0x79fe('0x121')]){var _0xe941a9=path[_0x79fe('0xe8')](_0x1810a3,_0x53d73f['Attachment'][_0x79fe('0xe2')]);if(fs[_0x79fe('0x134')](_0xe941a9)){fs[_0x79fe('0x135')](_0xe941a9)['pipe'](fs[_0x79fe('0x136')](path[_0x79fe('0xe8')](_0x322623,_0x53d73f[_0x79fe('0x121')][_0x79fe('0xe2')])));}}return{'date':moment(_0x53d73f[_0x79fe('0x85')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x53d73f[_0x79fe('0xfe')]===_0x79fe('0xd2')?_0x53d73f['User']?_0x53d73f[_0x79fe('0x79')][_0x79fe('0x3e')]:'System':_0x53d73f[_0x79fe('0xd8')][_0x79fe('0x120')]+(_0x53d73f[_0x79fe('0xd8')]['lastName']?'\x20'+_0x53d73f[_0x79fe('0xd8')]['lastName']:''),'body':_0x53d73f[_0x79fe('0x121')]?_0x53d73f[_0x79fe('0x121')][_0x79fe('0xe2')]:_0x53d73f[_0x79fe('0x7f')],'direction':_0x53d73f[_0x79fe('0xfe')]===_0x79fe('0xd2')?'A':'C','secret':_0x53d73f['secret'],'read':_0x53d73f['read'],'attachment':_0x53d73f[_0x79fe('0x121')]};})[_0x79fe('0x6c')]()};return ejs['renderFile'](path[_0x79fe('0xe8')](config[_0x79fe('0xed')],_0x79fe('0x11b'),_0x79fe('0x137'),_0x79fe('0x138')),{'interaction':_0x1d1a01})[_0x79fe('0x24')](function(_0x220ae0){return new BPromise(function(_0x1e9349,_0x42b22b){pdf[_0x79fe('0xc6')](_0x220ae0,_0x155bc9)[_0x79fe('0x139')](path['join'](_0x322623,_0x79fe('0x13a')+_0x50afe0['id']+'-'+_0x427c2b+_0x79fe('0x13b')),function(_0x45ada8,_0xb4bc27){if(_0x45ada8)return _0x42b22b(_0x45ada8);_0x1e9349(_0xb4bc27);});});})[_0x79fe('0x24')](function(){return new BPromise(function(_0x1154e8,_0x271538){zipdir(_0x322623,{'saveTo':_0x809ad4},function(_0x51b737,_0x12428c){if(_0x51b737)return _0x271538(_0x51b737);return _0x1154e8(_0x12428c);});})[_0x79fe('0x24')](function(){return new BPromise(function(_0x20c503,_0x26813e){rimraf(_0x322623,function(_0x4079f6){if(_0x4079f6)_0x26813e(_0x4079f6);return _0x20c503();});});})[_0x79fe('0x24')](function(){return _0x1599fd[_0x79fe('0xea')](_0x809ad4,_0x12e9b7,function(_0x809c5b){if(_0x809c5b){console[_0x79fe('0x13c')](_0x79fe('0x13d'),_0x809c5b);}else{fs['unlinkSync'](_0x809ad4);}});});});}else{return _0x1599fd['sendStatus'](0xc8);}})['catch'](handleError(_0x1599fd,null));};
\ No newline at end of file
+var _0xe978=['describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','Attachment','attachmentDownload','closed','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','ChatWebsite','%s%d','agentAlias','customer','agentIdentifier','website_alias','System','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','nolimit','options','findAll','getMyMessages','secret','color','emit','chatInteractionTags:save','removeTags','unix','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','Account','Owner','get','mkdirSync','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','Chat','YYYY-MM-DD','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','referer','customerPort','N.A.','tail','existsSync','createReadStream','createWriteStream','direction','lastName','renderFile','views','downloadInteraction.html','toFile','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','fullname','TagIds','split','Tags','push','map','ChatInteraction','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','select','field','from','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','forEach','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','isEmpty','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','role','sequelize','toString','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','keys','rawAttributes','includeAll','include','merge','create'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xe978,0x70));var _0x8e97=function(_0x94c2c3,_0x3c551d){_0x94c2c3=_0x94c2c3-0x0;var _0x50661d=_0xe978[_0x94c2c3];return _0x50661d;};'use strict';var pdf=require(_0x8e97('0x0'));var emlformat=require(_0x8e97('0x1'));var rimraf=require(_0x8e97('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8e97('0x3'));var moment=require(_0x8e97('0x4'));var BPromise=require(_0x8e97('0x5'));var Mustache=require(_0x8e97('0x6'));var util=require(_0x8e97('0x7'));var path=require('path');var sox=require(_0x8e97('0x8'));var csv=require(_0x8e97('0x9'));var ejs=require(_0x8e97('0xa'));var fs=require('fs');var fs_extra=require(_0x8e97('0xb'));var _=require(_0x8e97('0xc'));var squel=require('squel');var crypto=require(_0x8e97('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8e97('0xe'));var toCsv=require(_0x8e97('0x9'));var querystring=require(_0x8e97('0xf'));var Papa=require('papaparse');var Redis=require(_0x8e97('0x10'));var authService=require(_0x8e97('0x11'));var qs=require(_0x8e97('0x12'));var as=require(_0x8e97('0x13'));var hardwareService=require(_0x8e97('0x14'));var logger=require(_0x8e97('0x15'))(_0x8e97('0x16'));var utils=require(_0x8e97('0x17'));var config=require(_0x8e97('0x18'));var licenseUtil=require(_0x8e97('0x19'));var db=require(_0x8e97('0x1a'))['db'];config['redis']=_[_0x8e97('0x1b')](config[_0x8e97('0x1c')],{'host':_0x8e97('0x1d'),'port':0x18eb});var socket=require(_0x8e97('0x1e'))(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});var client9004=jayson[_0x8e97('0x1f')]['http']({'port':0x232c});function respondWithRpcPromise(_0x33b6b3,_0x3bb176,_0x4943c1,_0x4efaa3){return new BPromise(function(_0x185a04,_0x3f3738){var _0xb779ed=_0x4efaa3||client;return _0xb779ed[_0x8e97('0x20')](_0x33b6b3,_0x4943c1)[_0x8e97('0x21')](function(_0x2b823e){logger[_0x8e97('0x22')](_0x8e97('0x23'),_0x3bb176,_0x8e97('0x24'));logger['debug'](_0x8e97('0x25'),_0x3bb176,_0x8e97('0x24'),JSON[_0x8e97('0x26')](_0x2b823e));if(_0x2b823e[_0x8e97('0x27')]){if(_0x2b823e[_0x8e97('0x27')][_0x8e97('0x28')]===0x1f4){logger[_0x8e97('0x27')]('ChatInteraction,\x20%s,\x20%s',_0x3bb176,_0x2b823e[_0x8e97('0x27')][_0x8e97('0x29')]);return _0x3f3738(_0x2b823e[_0x8e97('0x27')][_0x8e97('0x29')]);}logger[_0x8e97('0x27')](_0x8e97('0x23'),_0x3bb176,_0x2b823e[_0x8e97('0x27')][_0x8e97('0x29')]);return _0x185a04(_0x2b823e[_0x8e97('0x27')][_0x8e97('0x29')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x3bb176,'request\x20sent');_0x185a04(_0x2b823e[_0x8e97('0x2a')][_0x8e97('0x29')]);}})[_0x8e97('0x2b')](function(_0xcee009){logger[_0x8e97('0x27')](_0x8e97('0x23'),_0x3bb176,_0xcee009);_0x3f3738(_0xcee009);});});}function respondWithStatusCode(_0x8ffc5b,_0xc48542){_0xc48542=_0xc48542||0xcc;return function(_0x5cc6fc){if(_0x5cc6fc){return _0x8ffc5b[_0x8e97('0x2c')](_0xc48542);}return _0x8ffc5b[_0x8e97('0x2d')](_0xc48542)[_0x8e97('0x2e')]();};}function respondWithResult(_0x5bb338,_0x1ba074){_0x1ba074=_0x1ba074||0xc8;return function(_0x4ef232){if(_0x4ef232){return _0x5bb338[_0x8e97('0x2d')](_0x1ba074)[_0x8e97('0x2f')](_0x4ef232);}};}function respondWithFilteredResult(_0xa5b3de,_0x2f7919){return function(_0xb1ce05){if(_0xb1ce05){var _0x65a7b5=_0xb1ce05[_0x8e97('0x30')],_0x180b9d=_0x2f7919[_0x8e97('0x31')],_0x5b0c76=_0x2f7919[_0x8e97('0x31')]+_0x2f7919[_0x8e97('0x32')],_0x4b7003;if(_0x5b0c76>=_0x65a7b5){_0x5b0c76=_0x65a7b5;_0x4b7003=0xc8;}else{_0x4b7003=0xce;}_0xa5b3de['status'](_0x4b7003);return _0xa5b3de[_0x8e97('0x33')](_0x8e97('0x34'),_0x180b9d+'-'+_0x5b0c76+'/'+_0x65a7b5)[_0x8e97('0x2f')](_0xb1ce05);}return null;};}function patchUpdates(_0x2bab42){return function(_0x46ddaa){try{jsonpatch['apply'](_0x46ddaa,_0x2bab42,!![]);}catch(_0x1a79de){return BPromise[_0x8e97('0x35')](_0x1a79de);}return _0x46ddaa[_0x8e97('0x36')]();};}function saveUpdates(_0x105bc1,_0x1dd009){return function(_0x54356c){if(_0x54356c){return _0x54356c[_0x8e97('0x37')](_0x105bc1)['then'](function(_0x270ce6){return _0x270ce6;});}return null;};}function removeEntity(_0x117971,_0x2da570){return function(_0x2224e0){if(_0x2224e0){return _0x2224e0[_0x8e97('0x38')]()['then'](function(){_0x117971[_0x8e97('0x2d')](0xcc)[_0x8e97('0x2e')]();});}};}function handleEntityNotFound(_0x5420ac,_0x5349ed){return function(_0x30a009){if(!_0x30a009){_0x5420ac[_0x8e97('0x2c')](0x194);}return _0x30a009;};}function handleError(_0x27533d,_0x4d0f88){_0x4d0f88=_0x4d0f88||0x1f4;return function(_0x213883){logger[_0x8e97('0x27')](_0x213883[_0x8e97('0x39')]);if(_0x213883[_0x8e97('0x3a')]){delete _0x213883[_0x8e97('0x3a')];}_0x27533d['status'](_0x4d0f88)[_0x8e97('0x3b')](_0x213883);};}function getInteractionUsers(_0x5302ee,_0x21ea34){return new BPromise(function(_0x374543,_0x2441a1){try{if(_0x21ea34[_0x5302ee['id']]){_0x5302ee['Users']=_['map'](_0x21ea34[_0x5302ee['id']],function(_0x3b8fae){return{'id':_0x3b8fae['id'],'fullname':_0x3b8fae[_0x8e97('0x3c')]};});}}catch(_0x171c06){_0x2441a1(_0x171c06);}_0x374543(_0x5302ee);});}function getInteractionTags(_0x5bf0f8,_0x5b870a){return new BPromise(function(_0x423237,_0x200772){try{if(_0x5bf0f8[_0x8e97('0x3d')]){_0x5bf0f8['Tags']=[];_0x5bf0f8['TagIds'][_0x8e97('0x3e')](',')['forEach'](function(_0x1b05a9){_0x5bf0f8[_0x8e97('0x3f')][_0x8e97('0x40')](_0x5b870a[_0x1b05a9]);});}delete _0x5bf0f8[_0x8e97('0x3d')];}catch(_0x1b5bf2){_0x200772(_0x1b5bf2);}_0x423237(_0x5bf0f8);});}function updateChatInteraction(_0x13d73b,_0x41e925,_0x55d71f){return new BPromise(function(_0x305eae,_0x52f639){return getInteractionUsers(_0x13d73b,_0x55d71f)[_0x8e97('0x21')](function(_0x27185b){return getInteractionTags(_0x27185b,_0x41e925);})[_0x8e97('0x21')](function(_0x3e0e33){_0x305eae(_0x3e0e33);})[_0x8e97('0x2b')](function(_0x3287b0){_0x52f639(_0x3287b0);});});}exports['index']=function(_0xa88699,_0xf79867){var _0x8dd265={},_0x4ba89c={},_0x8e9af1={'count':0x0,'rows':[]};var _0x4e5355=_[_0x8e97('0x41')](db[_0x8e97('0x42')]['rawAttributes'],function(_0x500077){return{'name':_0x500077[_0x8e97('0x43')],'type':_0x500077[_0x8e97('0x44')][_0x8e97('0x45')]};});_0x4ba89c[_0x8e97('0x46')]=_[_0x8e97('0x41')](_0x4e5355,_0x8e97('0x3a'));_0x4ba89c[_0x8e97('0x47')]=_['keys'](_0xa88699[_0x8e97('0x47')]);_0x4ba89c[_0x8e97('0x48')]=_[_0x8e97('0x49')](_0x4ba89c[_0x8e97('0x46')],_0x4ba89c[_0x8e97('0x47')]);_0x8dd265[_0x8e97('0x4a')]=_['intersection'](_0x4ba89c[_0x8e97('0x46')],qs[_0x8e97('0x4b')](_0xa88699[_0x8e97('0x47')]['fields']));_0x8dd265['attributes']=_0x8dd265[_0x8e97('0x4a')][_0x8e97('0x4c')]?_0x8dd265[_0x8e97('0x4a')]:_0x4ba89c[_0x8e97('0x46')];if(!_0xa88699[_0x8e97('0x47')][_0x8e97('0x4d')]('nolimit')){_0x8dd265[_0x8e97('0x32')]=qs[_0x8e97('0x32')](_0xa88699[_0x8e97('0x47')][_0x8e97('0x32')]);_0x8dd265['offset']=qs[_0x8e97('0x31')](_0xa88699['query']['offset']);}_0x8dd265[_0x8e97('0x4e')]=qs[_0x8e97('0x4f')](_0xa88699[_0x8e97('0x47')][_0x8e97('0x4f')]);_0x8dd265[_0x8e97('0x50')]=qs[_0x8e97('0x48')](_[_0x8e97('0x51')](_0xa88699[_0x8e97('0x47')],_0x4ba89c[_0x8e97('0x48')]),_0x4e5355);var _0x1e3b6a=[];var _0x3efbd9=squel[_0x8e97('0x52')]()['field']('id')['field'](_0x8e97('0x3a'))[_0x8e97('0x53')]('color')[_0x8e97('0x54')]('tools_tags');var _0x291ab9=squel['select']()['field'](_0x8e97('0x55'))[_0x8e97('0x53')](_0x8e97('0x56'))[_0x8e97('0x53')](_0x8e97('0x57'))[_0x8e97('0x54')](_0x8e97('0x58'),'ui')[_0x8e97('0x59')](_0x8e97('0x5a'),'u','u.id\x20=\x20ui.UserId');var _0x4a9d99=squel[_0x8e97('0x52')]()[_0x8e97('0x54')](_0x8e97('0x5b'),'i')[_0x8e97('0x59')]('cm_contacts','c',_0x8e97('0x5c'))['left_join']('users','o',_0x8e97('0x5d'))[_0x8e97('0x59')](_0x8e97('0x5e'),'a',_0x8e97('0x5f'))['left_join'](_0x8e97('0x60'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x8e97('0x59')](_0x8e97('0x61'),'it',_0x8e97('0x62'))[_0x8e97('0x59')](_0x8e97('0x63'),'t','t.id\x20=\x20it.TagId');var _0x21c076=squel['expr']();var _0x1e49db=[];var _0x3b6512=squel['expr']();var _0x235df3;if(_0xa88699[_0x8e97('0x47')][_0x8e97('0x64')]){_0x235df3=as[_0x8e97('0x65')](_0xa88699[_0x8e97('0x47')][_0x8e97('0x64')]);var _0x1eb7a6=_0x235df3[_0x8e97('0x66')];for(var _0x1a626b=0x0;_0x1a626b<_0x235df3['conditions'][_0x8e97('0x4c')];_0x1a626b++){var _0x156517=_0x235df3[_0x8e97('0x67')][_0x1a626b];var _0x39b493='i';var _0x4db11a=_[_0x8e97('0x68')](_0x4e5355,[_0x8e97('0x3a'),_0x156517[_0x8e97('0x53')]]);if(!_0x4db11a){switch(_0x156517[_0x8e97('0x53')]){case _0x8e97('0x69'):if(_0x156517[_0x8e97('0x6a')]==0x1){_0x4a9d99[_0x8e97('0x6b')]('`'+_0x156517['field']+'`\x20=\x200');}else{_0x4a9d99['having']('`'+_0x156517[_0x8e97('0x53')]+'`\x20>\x200');}break;case'Contact':if(_0x156517[_0x8e97('0x6c')]===_0x8e97('0x6d')){if(_0x156517[_0x8e97('0x6a')][_0x8e97('0x3e')]('\x20')[_0x8e97('0x4c')]>0x1){_0x21c076[_0x1eb7a6]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8e97('0x6e')](_0x156517[_0x8e97('0x6a')]),null);}else{var _0x3bba0b='%'+_0x156517[_0x8e97('0x6a')]+'%';_0x21c076[_0x1eb7a6](_0x8e97('0x6f'),_0x3bba0b,_0x3bba0b,_0x3bba0b);}}else{_0x4db11a=_[_0x8e97('0x68')](_0x4e5355,['name',_0x8e97('0x70')]);_0x156517[_0x8e97('0x53')]=_0x8e97('0x70');_0xef2acb=as[_0x8e97('0x71')](_0x39b493,_0x4db11a[_0x8e97('0x44')],_0x156517);_0x21c076[_0x1eb7a6](_0xef2acb['text'],_0xef2acb[_0x8e97('0x6a')][_0x8e97('0x72')],_0xef2acb['value'][_0x8e97('0x2e')]);}break;case _0x8e97('0x73'):var _0x33c579=_0x156517['value']['split'](',')[_0x8e97('0x41')](function(_0x5ec6d5){return Number(_0x5ec6d5);});_0x33c579[_0x8e97('0x74')](function(_0x7424f4){_0x3b6512['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x7424f4+',%');});_0x1e49db=_[_0x8e97('0x75')](_0x1e49db,_0x33c579);break;case _0x8e97('0x76'):if(_0x156517[_0x8e97('0x6c')]===_0x8e97('0x6d')){_0x21c076[_0x1eb7a6](_0x8e97('0x77'),'%'+_0x156517[_0x8e97('0x6a')]+'%',null);}else{_0x4db11a=_[_0x8e97('0x68')](_0x4e5355,[_0x8e97('0x3a'),_0x8e97('0x78')]);_0x156517[_0x8e97('0x53')]=_0x8e97('0x78');_0xef2acb=as[_0x8e97('0x71')](_0x39b493,_0x4db11a[_0x8e97('0x44')],_0x156517);_0x21c076[_0x1eb7a6](_0xef2acb[_0x8e97('0x79')],_0xef2acb['value'][_0x8e97('0x72')],_0xef2acb[_0x8e97('0x6a')]['end']);}break;case _0x8e97('0x7a'):_0xef2acb=as['buildExpression']('me',null,_0x156517);_0x21c076[_0x1eb7a6](_0xef2acb[_0x8e97('0x79')],_0xef2acb['value'][_0x8e97('0x72')],_0xef2acb[_0x8e97('0x6a')]['end']);break;}}else{var _0xef2acb=as['buildExpression'](_0x39b493,_0x4db11a[_0x8e97('0x44')],_0x156517);_0x21c076[_0x1eb7a6](_0xef2acb[_0x8e97('0x79')],_0xef2acb['value']['start'],_0xef2acb[_0x8e97('0x6a')][_0x8e97('0x2e')]);}}}else{var _0x434adc=_(_0xa88699[_0x8e97('0x47')])['keys']()[_0x8e97('0x41')](function(_0x2055f3){return _['some'](_0x4e5355,[_0x8e97('0x3a'),_0x2055f3])?_0x2055f3:undefined;})['compact']()[_0x8e97('0x6a')]();if(!_[_0x8e97('0x7b')](_0x434adc)){_0x434adc[_0x8e97('0x74')](function(_0x59f47a){if(_0x59f47a==='ChatWebsiteId'){_0x4a9d99[_0x8e97('0x50')]('i.ChatWebsiteId\x20IN\x20?',[][_0x8e97('0x7c')](_0xa88699[_0x8e97('0x47')][_0x59f47a]));}else if(_0x59f47a===_0x8e97('0x7d')){var _0x2553ec=JSON[_0x8e97('0x7e')](_0xa88699[_0x8e97('0x47')][_0x59f47a])[_0x8e97('0x7f')];var _0x3bb03c=JSON[_0x8e97('0x7e')](_0xa88699[_0x8e97('0x47')][_0x59f47a])['$lte'];_0x4a9d99[_0x8e97('0x50')](_0x8e97('0x80'),_0x2553ec,_0x3bb03c);}else{if(_0xa88699[_0x8e97('0x47')][_0x59f47a]===_0x8e97('0x81')){_0x4a9d99[_0x8e97('0x50')]('i.'+_0x59f47a+_0x8e97('0x82'));}else{_0x4a9d99[_0x8e97('0x50')]('i.'+_0x59f47a+_0x8e97('0x83'),_0xa88699[_0x8e97('0x47')][_0x59f47a]);}}});}if(_0xa88699['query']['read']){if(_0xa88699['query'][_0x8e97('0x84')]==0x1){_0x4a9d99[_0x8e97('0x6b')](_0x8e97('0x85'));}else{_0x4a9d99[_0x8e97('0x6b')](_0x8e97('0x86'));}}if(_0xa88699[_0x8e97('0x47')][_0x8e97('0x87')]){_0x1e49db=_[_0x8e97('0x88')](_0xa88699['query'][_0x8e97('0x87')])?_0xa88699[_0x8e97('0x47')][_0x8e97('0x87')]:new Array(_0xa88699[_0x8e97('0x47')][_0x8e97('0x87')]);_0x1e49db[_0x8e97('0x74')](function(_0x154ad0){_0x3b6512['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x154ad0+',%');});}if(_0xa88699[_0x8e97('0x47')][_0x8e97('0x89')]){var _0x451b5e=_0xa88699[_0x8e97('0x47')][_0x8e97('0x89')][_0x8e97('0x8a')]('\x5c','\x5c\x5c')[_0x8e97('0x8a')](/'/g,'\x27\x27');if(qs[_0x8e97('0x8b')](_0x451b5e)){_0x21c076['or'](_0x8e97('0x8c'),_0x451b5e+'%');}else{_0x21c076['or'](_0x8e97('0x8d'),qs[_0x8e97('0x6e')](_0x451b5e))['or'](_0x8e97('0x8e'),_0x451b5e+'%');}}}_0x4a9d99[_0x8e97('0x50')](_0x21c076);_0x4a9d99['group'](_0x8e97('0x8f'));var _0x293540={'type':db['Sequelize'][_0x8e97('0x90')][_0x8e97('0x91')],'raw':!![]};var _0x33b548=_0x4a9d99[_0x8e97('0x92')]();_0x33b548[_0x8e97('0x53')]('i.id');_0x33b548[_0x8e97('0x53')](_0x8e97('0x93'),'unreadMessages');if(_0x8dd265[_0x8e97('0x4e')]){_0x8dd265[_0x8e97('0x4e')][_0x8e97('0x74')](function(_0x10171a){var _0x5c2f1a=_0x10171a[0x0]===_0x8e97('0x94')?_0x10171a[0x0]:'i.'+_0x10171a[0x0];_0x4a9d99[_0x8e97('0x4e')](_0x5c2f1a,_0x10171a[0x1]===_0x8e97('0x95')?![]:!![]);});}if(!_[_0x8e97('0x7b')](_0x1e49db)){_0x4a9d99[_0x8e97('0x6b')](_0x3b6512);_0x33b548[_0x8e97('0x50')](_0x8e97('0x96'),_0x1e49db);}BPromise[_0x8e97('0x97')]()[_0x8e97('0x21')](function(){if(!_0x235df3){if(_0xa88699['query'][_0x8e97('0x98')])return;_0x33b548[_0x8e97('0x50')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x4a9d99[_0x8e97('0x50')](_0x8e97('0x99'));return;}if(_0xa88699[_0x8e97('0x9a')]['role']!=='agent')return;return _0xa88699[_0x8e97('0x9a')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0x8e97('0x21')](function(_0x308655){if(_[_0x8e97('0x7b')](_0x308655)){_0x33b548[_0x8e97('0x50')](_0x8e97('0x9b'));_0x4a9d99['where']('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x33b548['where'](_0x8e97('0x9c'),_[_0x8e97('0x41')](_0x308655,'id'));_0x4a9d99[_0x8e97('0x50')](_0x8e97('0x9c'),_[_0x8e97('0x41')](_0x308655,'id'));}});})[_0x8e97('0x21')](function(){if(_0xa88699[_0x8e97('0x9a')][_0x8e97('0x9d')]==='agent'&&!_0x235df3&&!_0xa88699[_0x8e97('0x47')][_0x8e97('0x98')])return[];return db[_0x8e97('0x9e')]['query'](_0x33b548[_0x8e97('0x9f')](),_0x293540);})[_0x8e97('0x21')](function(_0x190c26){_0x8e9af1[_0x8e97('0x30')]=_0x190c26[_0x8e97('0x4c')];if(_0x8e9af1['count']===0x0)return[];return db[_0x8e97('0x9e')][_0x8e97('0x47')](_0x3efbd9['toString'](),_0x293540)[_0x8e97('0x21')](function(_0x330ec7){_0x1e3b6a=_['keyBy'](_0x330ec7,'id');_0x293540=_['merge'](_0x293540,{'model':db[_0x8e97('0x42')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xa88699[_0x8e97('0x47')][_0x8e97('0x4b')]){_0x8dd265[_0x8e97('0x4a')][_0x8e97('0x74')](function(_0x281080){_0x4a9d99[_0x8e97('0x53')]('i.'+_0x281080);});}else{_0x4a9d99[_0x8e97('0x53')](_0x8e97('0x93'),_0x8e97('0x69'));_0x4a9d99['field'](_0x8e97('0xa0'),_0x8e97('0xa1'));_0x4a9d99['field'](_0x8e97('0xa2'),_0x8e97('0xa3'));_0x4a9d99['field'](_0x8e97('0xa4'),_0x8e97('0x94'));_0x4a9d99[_0x8e97('0x53')](_0x8e97('0xa5'));_0x4a9d99[_0x8e97('0x53')]('c.firstName','Contact.firstName');_0x4a9d99[_0x8e97('0x53')](_0x8e97('0xa6'),_0x8e97('0xa7'));_0x4a9d99[_0x8e97('0x53')](_0x8e97('0xa8'),_0x8e97('0xa9'));_0x4a9d99['field'](_0x8e97('0xaa'),_0x8e97('0xab'));_0x4a9d99[_0x8e97('0x53')](_0x8e97('0xac'),_0x8e97('0xad'));_0x4a9d99[_0x8e97('0x53')]('c.fax',_0x8e97('0xae'));_0x4a9d99[_0x8e97('0x53')](_0x8e97('0xaf'),_0x8e97('0xb0'));_0x4a9d99[_0x8e97('0x53')](_0x8e97('0xb1'),_0x8e97('0xb2'));_0x4a9d99[_0x8e97('0x53')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x8e97('0x3d'));}if(_0x8dd265[_0x8e97('0x32')])_0x4a9d99[_0x8e97('0x32')](_0x8dd265[_0x8e97('0x32')]);if(_0x8dd265[_0x8e97('0x31')])_0x4a9d99[_0x8e97('0x31')](_0x8dd265[_0x8e97('0x31')]);return db[_0x8e97('0x9e')][_0x8e97('0x47')](_0x4a9d99[_0x8e97('0x9f')](),_0x293540);})['then'](function(_0xe32575){_0x291ab9[_0x8e97('0x50')](_0x8e97('0xb3'),_[_0x8e97('0x41')](_0xe32575,'id'));return db['sequelize']['query'](_0x291ab9[_0x8e97('0x9f')](),_0x293540)[_0x8e97('0x21')](function(_0x404e3a){var _0x15c09a=_[_0x8e97('0xb4')](_0x404e3a,_0x8e97('0xb5'));var _0x50ab21=[];_0xe32575[_0x8e97('0x74')](function(_0x3c778c){_0x50ab21[_0x8e97('0x40')](updateChatInteraction(_0x3c778c,_0x1e3b6a,_0x15c09a));});return BPromise[_0x8e97('0xb6')](_0x50ab21);});});})[_0x8e97('0x21')](function(_0x2ce282){_0x8e9af1[_0x8e97('0xb7')]=_0x2ce282;return _0x8e9af1;})['then'](respondWithFilteredResult(_0xf79867,_0x8dd265))[_0x8e97('0x2b')](handleError(_0xf79867,null));};exports[_0x8e97('0xb8')]=function(_0x34ab23,_0x2acea4){var _0x8a2d7a={'raw':![],'where':{'id':_0x34ab23[_0x8e97('0xb9')]['id']}},_0x314818={};_0x314818['model']=_[_0x8e97('0xba')](db[_0x8e97('0x42')][_0x8e97('0xbb')]);_0x314818[_0x8e97('0x47')]=_[_0x8e97('0xba')](_0x34ab23['query']);_0x314818['filters']=_['intersection'](_0x314818[_0x8e97('0x46')],_0x314818[_0x8e97('0x47')]);_0x8a2d7a[_0x8e97('0x4a')]=_[_0x8e97('0x49')](_0x314818[_0x8e97('0x46')],qs[_0x8e97('0x4b')](_0x34ab23['query'][_0x8e97('0x4b')]));_0x8a2d7a[_0x8e97('0x4a')]=_0x8a2d7a[_0x8e97('0x4a')]['length']?_0x8a2d7a['attributes']:_0x314818['model'];if(_0x34ab23[_0x8e97('0x47')][_0x8e97('0xbc')]){_0x8a2d7a[_0x8e97('0xbd')]=[{'all':!![]}];}_0x8a2d7a=_[_0x8e97('0xbe')]({},_0x8a2d7a,_0x34ab23['options']);return db['ChatInteraction'][_0x8e97('0x68')](_0x8a2d7a)['then'](handleEntityNotFound(_0x2acea4,null))['then'](respondWithResult(_0x2acea4,null))[_0x8e97('0x2b')](handleError(_0x2acea4,null));};exports['create']=function(_0x4f19a7,_0x31b973){return db[_0x8e97('0x42')][_0x8e97('0xbf')](_0x4f19a7[_0x8e97('0x7a')],{})[_0x8e97('0x21')](respondWithResult(_0x31b973,0xc9))[_0x8e97('0x2b')](handleError(_0x31b973,null));};exports['update']=function(_0x4a04e0,_0x2ca907){if(_0x4a04e0[_0x8e97('0x7a')]['id']){delete _0x4a04e0['body']['id'];}return db[_0x8e97('0x42')][_0x8e97('0x68')]({'where':{'id':_0x4a04e0[_0x8e97('0xb9')]['id']}})[_0x8e97('0x21')](handleEntityNotFound(_0x2ca907,null))[_0x8e97('0x21')](saveUpdates(_0x4a04e0[_0x8e97('0x7a')],null))[_0x8e97('0x21')](respondWithResult(_0x2ca907,null))[_0x8e97('0x2b')](handleError(_0x2ca907,null));};exports[_0x8e97('0x38')]=function(_0x2912d3,_0x202c58){return db['ChatInteraction'][_0x8e97('0x68')]({'where':{'id':_0x2912d3[_0x8e97('0xb9')]['id']}})[_0x8e97('0x21')](handleEntityNotFound(_0x202c58,null))[_0x8e97('0x21')](removeEntity(_0x202c58,null))[_0x8e97('0x2b')](handleError(_0x202c58,null));};exports[_0x8e97('0xc0')]=function(_0x21f902,_0x5bba1b){return db[_0x8e97('0x42')][_0x8e97('0xc0')]()[_0x8e97('0x21')](respondWithResult(_0x5bba1b,null))['catch'](handleError(_0x5bba1b,null));};exports[_0x8e97('0xc1')]=function(_0x5c14c1,_0x250ee4){var _0x44bfcf=_0x5c14c1[_0x8e97('0xb9')]['id'];var _0x6ae782;var _0x1bd2e9;var _0x2e9954;return db['ChatInteraction'][_0x8e97('0xc2')]({'where':{'id':_0x44bfcf}})['then'](function(_0x1e533d){_0x6ae782=_0x1e533d;return db['ChatWebsite'][_0x8e97('0xc2')]({'where':{'id':_0x1e533d[_0x8e97('0x98')]},'attributes':['id',_0x8e97('0xc3'),'vidaooEscalation'],'raw':!![]});})[_0x8e97('0x21')](function(_0x1a3512){if(_0x1a3512&&_0x1a3512[_0x8e97('0xc3')]&&_0x1a3512[_0x8e97('0xc4')]){_0x1bd2e9=_0x1a3512;var _0x1c9c9c={'rejectUnauthorized':![],'method':'POST','uri':'https://api-vidaoo.xcally.com/api/v1/sessions','headers':{'X-APIKEY':_0x1a3512[_0x8e97('0xc3')]},'body':{'name':'MotionCWB:'+_0x44bfcf},'redirect':'follow','json':!![]};return rp(_0x1c9c9c);}else{throw new db[(_0x8e97('0xc5'))][(_0x8e97('0xc6'))](_0x8e97('0xc7'));}})[_0x8e97('0x21')](function(_0x235dcc){_0x2e9954=_0x235dcc;if(_0x2e9954['id']){var _0x1a9d6b={'body':_0x2e9954['join_url'],'ChatWebsiteId':_0x1bd2e9['id'],'ChatInteractionId':_0x6ae782['id'],'direction':_0x8e97('0xc8'),'UserId':_0x5c14c1[_0x8e97('0x9a')]['id']};return db[_0x8e97('0xc9')][_0x8e97('0xbf')](_0x1a9d6b,{});}else{throw new db[(_0x8e97('0xc5'))][(_0x8e97('0xc6'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x8e97('0x21')](function(){return _0x6ae782[_0x8e97('0xca')]({'vidaooSessionId':_0x2e9954['id']});})[_0x8e97('0x21')](respondWithResult(_0x250ee4,null))[_0x8e97('0x2b')](handleError(_0x250ee4,null));};exports['customUpdate']=function(_0x58a5a8,_0x5e8180){if(_0x58a5a8[_0x8e97('0x7a')]['id']){delete _0x58a5a8[_0x8e97('0x7a')]['id'];}return db[_0x8e97('0x42')][_0x8e97('0x68')]({'where':{'id':_0x58a5a8['params']['id']},'include':[{'model':db[_0x8e97('0xcb')],'as':'Contact'}]})[_0x8e97('0x21')](handleEntityNotFound(_0x5e8180,null))[_0x8e97('0x21')](saveUpdates(_0x58a5a8[_0x8e97('0x7a')],null))[_0x8e97('0x21')](respondWithResult(_0x5e8180,null))[_0x8e97('0x2b')](handleError(_0x5e8180,null));};exports[_0x8e97('0xcc')]=function(_0x207e63,_0x30ced0,_0x534bd6){if(_0x207e63[_0x8e97('0x7a')]['id']){delete _0x207e63[_0x8e97('0x7a')]['id'];}return db[_0x8e97('0x42')][_0x8e97('0x68')]({'where':{'id':_0x207e63['params']['id']}})[_0x8e97('0x21')](function(_0x457ca5){if(!_0x457ca5){logger[_0x8e97('0x27')](_0x8e97('0xcd'),_0x8e97('0xcc'),0x194,_0x8e97('0xce'));_0x30ced0[_0x8e97('0x2c')](0x194);}else{if(_0x457ca5['UserId']){throw new db[(_0x8e97('0xc5'))][(_0x8e97('0xc6'))]('Interaction\x20already\x20assigned');}}return _0x457ca5;})[_0x8e97('0x21')](function(_0x33e13a){if(_0x33e13a){return _0x33e13a[_0x8e97('0x37')]({'closed':_0x207e63[_0x8e97('0x7a')]['closed'],'disposition':_0x207e63[_0x8e97('0x7a')][_0x8e97('0xcf')]})[_0x8e97('0x21')](function(_0x5188c6){return _0x5188c6;});}})['then'](function(_0x263369){return respondWithRpcPromise(_0x8e97('0xd0'),_0x8e97('0xcc'),_0x207e63['body'],client9004);})[_0x8e97('0x21')](respondWithResult(_0x30ced0,null))[_0x8e97('0x2b')](handleError(_0x30ced0,null));};exports[_0x8e97('0xd1')]=function(_0x1573b7,_0x1855c0,_0x58338d){_0x1573b7[_0x8e97('0x7a')][_0x8e97('0x3a')]=_0x1573b7[_0x8e97('0xd2')][_0x8e97('0xd3')];_0x1573b7[_0x8e97('0x7a')][_0x8e97('0xd4')]=_0x1573b7[_0x8e97('0xd2')]['filename'];_0x1573b7[_0x8e97('0x7a')]['type']=_0x1573b7[_0x8e97('0xd2')]['mimetype'];return db[_0x8e97('0xd5')][_0x8e97('0xbf')](_0x1573b7['body'])[_0x8e97('0x21')](respondWithResult(_0x1855c0,0xc9))[_0x8e97('0x2b')](handleError(_0x1855c0,null));};exports[_0x8e97('0xd6')]=function(_0x11e68d,_0x4d2c50,_0x1f40e0){return db['ChatInteraction']['findOne']({'where':{'id':_0x11e68d[_0x8e97('0xb9')]['id']},'raw':!![]})[_0x8e97('0x21')](handleEntityNotFound(_0x4d2c50,null))[_0x8e97('0x21')](function(_0x5d5ce4){if(_0x5d5ce4){if(_0x5d5ce4[_0x8e97('0xd7')]){return _0x4d2c50['status'](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0x8e97('0xd5')]['findOne']({'where':{'id':_0x11e68d[_0x8e97('0x47')][_0x8e97('0xd8')]},'raw':!![]})['then'](handleEntityNotFound(_0x4d2c50,null));}})['then'](function(_0x5b3d5d){if(_0x5b3d5d){var _0x1046db=_0x5b3d5d[_0x8e97('0xd9')]!==null;var _0x317a74=path[_0x8e97('0xda')](config[_0x8e97('0xdb')],'server/files/attachments/');if(_0x1046db){_0x317a74=path[_0x8e97('0xda')](_0x317a74,_0x8e97('0xdc'));}var _0x2b5408=path[_0x8e97('0xda')](_0x317a74,_0x5b3d5d[_0x8e97('0xd4')]);return _0x4d2c50[_0x8e97('0xdd')](_0x2b5408);}})[_0x8e97('0x2b')](handleError(_0x4d2c50,null));};exports['close']=function(_0x3e110c,_0x444117){var _0x165e28=null;var _0x155472=null;var _0x53de12=null;var _0x3567c2=null;if(_0x3e110c['body']['id']){delete _0x3e110c[_0x8e97('0x7a')]['id'];}if(_0x3e110c[_0x8e97('0x7a')][_0x8e97('0xde')]){_0x3567c2=path[_0x8e97('0xda')](config[_0x8e97('0xdb')],_0x8e97('0xdf'),util[_0x8e97('0xe0')](_0x8e97('0xe1'),Date[_0x8e97('0xe2')]()));_0x3e110c[_0x8e97('0x7a')][_0x8e97('0xe3')]=_0x3567c2;}return db[_0x8e97('0x42')]['find']({'where':{'id':_0x3e110c['params']['id']},'include':[{'model':db[_0x8e97('0xc9')],'as':_0x8e97('0xe4'),'include':[{'model':db[_0x8e97('0x76')],'as':_0x8e97('0x76')}]}]})['then'](handleEntityNotFound(_0x444117,null))[_0x8e97('0x21')](saveUpdates(_0x3e110c[_0x8e97('0x7a')],null))[_0x8e97('0x21')](function(_0x106636){if(_0x106636){_0x165e28=_0x106636;return db[_0x8e97('0xe5')][_0x8e97('0x68')]({'where':{'id':_0x165e28[_0x8e97('0x98')]}});}})[_0x8e97('0x21')](function(_0x330268){if(_0x330268){_0x53de12=_0x330268;return db[_0x8e97('0xcb')]['find']({'where':{'id':_0x165e28[_0x8e97('0x70')]}});}})[_0x8e97('0x21')](function(_0x1ed2e3){if(_0x1ed2e3){_0x155472=_0x1ed2e3;if(_0x3567c2){var _0x3ff82a=null;for(var _0x5673ea=0x1;_0x5673ea<_0x165e28[_0x8e97('0xe4')][_0x8e97('0x4c')];++_0x5673ea){_0x3ff82a=_0x165e28[_0x8e97('0xe4')][_0x5673ea];var _0x3a4f3a=_0x3ff82a['UserId']?util[_0x8e97('0xe0')](_0x8e97('0xe6'),_0x53de12[_0x8e97('0xe7')],_0x3ff82a[_0x8e97('0x78')]):'System';var _0x311153=_0x3e110c['body'][_0x8e97('0xe8')]||util['format'](_0x8e97('0xe6'),'Visitor',_0x3ff82a[_0x8e97('0x70')]);switch(_0x53de12[_0x8e97('0xe9')]){case _0x8e97('0xea'):_0x3a4f3a=_0x3ff82a['UserId']?util[_0x8e97('0xe0')](_0x8e97('0xe6'),_0x53de12[_0x8e97('0xe7')],_0x3ff82a[_0x8e97('0x78')]):_0x8e97('0xeb');break;case _0x8e97('0xec'):_0x3a4f3a=_0x3ff82a[_0x8e97('0x78')]?_0x3ff82a['User']['alias']||_0x3ff82a[_0x8e97('0x76')][_0x8e97('0x3c')]:'System';break;case _0x8e97('0xed'):_0x3a4f3a=_0x3ff82a[_0x8e97('0x78')]?_0x3ff82a[_0x8e97('0x76')][_0x8e97('0x3c')]:_0x8e97('0xeb');break;default:_0x3a4f3a=_0x3ff82a['UserId']?util[_0x8e97('0xe0')](_0x8e97('0xe6'),_0x53de12['agentAlias'],_0x3ff82a[_0x8e97('0x78')]):_0x8e97('0xeb');}var _0xdeef48=util['format'](_0x8e97('0xee'),moment(_0x3ff82a[_0x8e97('0x7d')])[_0x8e97('0xe0')]('MM/DD/YYYY\x20HH:mm:ss'),_0x3ff82a['direction']==='in'?_0x311153:_0x3a4f3a,_0x3ff82a['body']);if(!_0x3ff82a['secret']){fs[_0x8e97('0xef')](_0x3567c2,_0xdeef48);}}return db[_0x8e97('0xf0')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x8e97('0xf1')],'as':'Smtp','raw':!![]}]});}}})[_0x8e97('0x21')](function(_0x1378ab){if(_0x1378ab&&_0x1378ab['Smtp']&&_0x3e110c[_0x8e97('0x7a')]){var _0x418836={'tls':{'rejectUnauthorized':![]}};if(_0x1378ab[_0x8e97('0xf2')][_0x8e97('0xf3')]){_0x418836[_0x8e97('0xf3')]=_0x1378ab['Smtp'][_0x8e97('0xf3')];}else{_0x418836[_0x8e97('0xf4')]=_0x1378ab[_0x8e97('0xf2')][_0x8e97('0xf4')];_0x418836[_0x8e97('0xf5')]=_0x1378ab['Smtp']['port'];_0x418836[_0x8e97('0xf6')]=_0x1378ab[_0x8e97('0xf2')][_0x8e97('0xf6')];}if(_0x1378ab[_0x8e97('0xf2')][_0x8e97('0xf7')]){_0x418836['auth']={'user':_0x1378ab['Smtp']['user'],'pass':_0x1378ab[_0x8e97('0xf2')][_0x8e97('0xf8')]};}return respondWithRpcPromise(_0x8e97('0xf9'),_0x8e97('0xfa'),{'account':_0x418836,'message':{'from':util[_0x8e97('0xe0')](_0x8e97('0xfb'),_0x1378ab[_0x8e97('0x3a')],_0x1378ab[_0x8e97('0xfc')]||_0x1378ab[_0x8e97('0xf2')][_0x8e97('0x9a')]),'to':_0x3e110c['body'][_0x8e97('0xde')],'subject':'Mail\x20Transcript','text':util[_0x8e97('0xe0')](_0x8e97('0xfd'),_0x3e110c[_0x8e97('0x7a')][_0x8e97('0xde')]),'attachments':[{'path':_0x3567c2}]}})[_0x8e97('0x21')](function(){return _0x165e28;})[_0x8e97('0x2b')](function(_0x407469){console[_0x8e97('0x27')](_0x407469);});}else{return _0x165e28;}})[_0x8e97('0x21')](respondWithStatusCode(_0x444117,0xc8))[_0x8e97('0x2b')](handleError(_0x444117,null));};exports['addMessage']=function(_0x3bd311,_0x1c3a91,_0x1227c6){return db[_0x8e97('0xc9')][_0x8e97('0x68')]({'where':{'id':_0x3bd311[_0x8e97('0xb9')]['id']}})['then'](handleEntityNotFound(_0x1c3a91,null))[_0x8e97('0x21')](function(_0x122e75){if(_0x122e75){return _0x122e75[_0x8e97('0xfe')](_0x3bd311['body'][_0x8e97('0xff')],_[_0x8e97('0x100')](_0x3bd311[_0x8e97('0x7a')],['ids','id'])||{});}})[_0x8e97('0x21')](respondWithResult(_0x1c3a91,null))['catch'](handleError(_0x1c3a91,null));};exports[_0x8e97('0x101')]=function(_0x1859ae,_0x5b2097,_0x34fd9b){var _0x142345={'raw':![],'where':{}};var _0x1d0377={};var _0x388e7d={'count':0x0,'rows':[]};return db[_0x8e97('0x42')]['findOne']({'where':{'id':_0x1859ae[_0x8e97('0xb9')]['id']}})[_0x8e97('0x21')](handleEntityNotFound(_0x5b2097,null))['then'](function(_0x58e934){if(_0x58e934){_0x1d0377['model']=_[_0x8e97('0xba')](db[_0x8e97('0xc9')][_0x8e97('0xbb')]);_0x1d0377[_0x8e97('0x47')]=_['keys'](_0x1859ae[_0x8e97('0x47')]);_0x1d0377[_0x8e97('0x48')]=_[_0x8e97('0x49')](_0x1d0377[_0x8e97('0x46')],_0x1d0377[_0x8e97('0x47')]);_0x142345[_0x8e97('0x4a')]=_[_0x8e97('0x49')](_0x1d0377[_0x8e97('0x46')],qs['fields'](_0x1859ae[_0x8e97('0x47')]['fields']));_0x142345[_0x8e97('0x4a')]=_0x142345[_0x8e97('0x4a')][_0x8e97('0x4c')]?_0x142345['attributes']:_0x1d0377['model'];if(!_0x1859ae[_0x8e97('0x47')]['hasOwnProperty'](_0x8e97('0x102'))){_0x142345['limit']=qs[_0x8e97('0x32')](_0x1859ae[_0x8e97('0x47')]['limit']);_0x142345[_0x8e97('0x31')]=qs[_0x8e97('0x31')](_0x1859ae[_0x8e97('0x47')][_0x8e97('0x31')]);}_0x142345['order']=qs[_0x8e97('0x4f')](_0x1859ae['query'][_0x8e97('0x4f')]);_0x142345['where']=qs[_0x8e97('0x48')](_[_0x8e97('0x51')](_0x1859ae['query'],_0x1d0377[_0x8e97('0x48')]));_0x142345['where']['ChatInteractionId']=_0x58e934['id'];if(_0x1859ae[_0x8e97('0x47')][_0x8e97('0x89')]){_0x142345[_0x8e97('0x50')]=_[_0x8e97('0xbe')](_0x142345['where'],{'$or':_[_0x8e97('0x41')](_0x142345['attributes'],function(_0x470d28){var _0xef901c={};_0xef901c[_0x470d28]={'$like':'%'+_0x1859ae['query'][_0x8e97('0x89')]+'%'};return _0xef901c;})});}if(_0x1859ae[_0x8e97('0x47')]['$gte']){var _0x1ac748=_0x1859ae[_0x8e97('0x47')][_0x8e97('0x7f')][_0x8e97('0x3e')](',');var _0x1a6ae7={};_0x1a6ae7[_0x1ac748[0x0]]={'$gte':moment(_0x1ac748[0x1])[_0x8e97('0xe0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x142345[_0x8e97('0x50')]=_[_0x8e97('0xbe')](_0x142345[_0x8e97('0x50')],_0x1a6ae7);}_0x142345=_[_0x8e97('0xbe')]({},_0x142345,_0x1859ae[_0x8e97('0x103')]);return db[_0x8e97('0xc9')]['count']({'where':_0x142345['where']})[_0x8e97('0x21')](function(_0x2dc66b){_0x388e7d[_0x8e97('0x30')]=_0x2dc66b;if(_0x1859ae[_0x8e97('0x47')][_0x8e97('0xbc')]){_0x142345[_0x8e97('0xbd')]=[{'all':!![]}];}return db[_0x8e97('0xc9')][_0x8e97('0x104')](_0x142345);})[_0x8e97('0x21')](function(_0x51847f){_0x388e7d[_0x8e97('0xb7')]=_0x51847f;return _0x388e7d;});}})[_0x8e97('0x21')](respondWithFilteredResult(_0x5b2097,_0x142345))[_0x8e97('0x2b')](handleError(_0x5b2097,null));};exports[_0x8e97('0x105')]=function(_0x5a9826,_0x2dfa5b,_0x3dcec8){var _0x20cb6e={'where':{}},_0x264641={},_0xdfa037={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x8e97('0xc2')]({'where':{'id':_0x5a9826[_0x8e97('0xb9')]['id']}})[_0x8e97('0x21')](handleEntityNotFound(_0x2dfa5b,null))[_0x8e97('0x21')](function(_0x5021c8){if(_0x5021c8){_0x264641[_0x8e97('0x46')]=_[_0x8e97('0xba')](db[_0x8e97('0xc9')][_0x8e97('0xbb')]);_0x264641['query']=_[_0x8e97('0xba')](_0x5a9826[_0x8e97('0x47')]);_0x264641[_0x8e97('0x48')]=_[_0x8e97('0x49')](_0x264641['model'],_0x264641['query']);_0x20cb6e['attributes']=_[_0x8e97('0x49')](_0x264641[_0x8e97('0x46')],qs[_0x8e97('0x4b')](_0x5a9826['query'][_0x8e97('0x4b')]));_0x20cb6e['attributes']=_0x20cb6e[_0x8e97('0x4a')][_0x8e97('0x4c')]?_0x20cb6e[_0x8e97('0x4a')]:_0x264641['model'];if(!_0x5a9826['query'][_0x8e97('0x4d')](_0x8e97('0x102'))){_0x20cb6e['limit']=qs[_0x8e97('0x32')](_0x5a9826[_0x8e97('0x47')][_0x8e97('0x32')]);_0x20cb6e[_0x8e97('0x31')]=qs[_0x8e97('0x31')](_0x5a9826[_0x8e97('0x47')]['offset']);}_0x20cb6e['order']=qs[_0x8e97('0x4f')](_0x5a9826[_0x8e97('0x47')][_0x8e97('0x4f')]);_0x20cb6e[_0x8e97('0x50')]=qs[_0x8e97('0x48')](_[_0x8e97('0x51')](_0x5a9826['query'],_0x264641[_0x8e97('0x48')]));_0x20cb6e[_0x8e97('0x50')][_0x8e97('0xb5')]=_0x5021c8['id'];if(_0x5a9826[_0x8e97('0x47')][_0x8e97('0x89')]){_0x20cb6e['where']=_['merge'](_0x20cb6e['where'],{'$or':_[_0x8e97('0x41')](_0x20cb6e[_0x8e97('0x4a')],function(_0x1bf398){var _0x3cf2f9={};_0x3cf2f9[_0x1bf398]={'$like':'%'+_0x5a9826[_0x8e97('0x47')][_0x8e97('0x89')]+'%'};return _0x3cf2f9;})});}_0x20cb6e[_0x8e97('0x50')][_0x8e97('0x106')]=![];if(_0x5a9826[_0x8e97('0x47')]['id']){_0x20cb6e[_0x8e97('0x50')]['id']={'$gt':_0x5a9826['query']['id']};}_0x20cb6e=_['merge']({},_0x20cb6e,_0x5a9826['options']);return db[_0x8e97('0xc9')]['count']({'where':_0x20cb6e[_0x8e97('0x50')]})[_0x8e97('0x21')](function(_0x85f110){_0xdfa037['count']=_0x85f110;_0x20cb6e[_0x8e97('0xbd')]=[];if(_0x5a9826[_0x8e97('0x47')]['includeAgent']){_0x20cb6e[_0x8e97('0xbd')][_0x8e97('0x40')]({'model':db[_0x8e97('0x76')],'as':_0x8e97('0x76'),'attributes':['id',_0x8e97('0x3c'),'alias']});}if(_0x5a9826[_0x8e97('0x47')][_0x8e97('0xbc')]){_0x20cb6e[_0x8e97('0xbd')]=[{'all':!![]}];}return db[_0x8e97('0xc9')][_0x8e97('0x104')](_0x20cb6e);})[_0x8e97('0x21')](function(_0x2d4710){_0xdfa037['rows']=_0x2d4710;return _0xdfa037;});}})['then'](respondWithFilteredResult(_0x2dfa5b,_0x20cb6e))[_0x8e97('0x2b')](handleError(_0x2dfa5b,null));};exports['addTags']=function(_0x43a0dd,_0x37abb1,_0xfd5409){return db[_0x8e97('0x42')]['find']({'where':{'id':_0x43a0dd[_0x8e97('0xb9')]['id']}})[_0x8e97('0x21')](handleEntityNotFound(_0x37abb1,null))['then'](function(_0x511d7a){if(_0x511d7a){return _0x511d7a['setTags'](_0x43a0dd[_0x8e97('0x7a')][_0x8e97('0xff')],_[_0x8e97('0x100')](_0x43a0dd[_0x8e97('0x7a')],[_0x8e97('0xff'),'id'])||{})['spread'](function(){return db[_0x8e97('0x73')][_0x8e97('0x104')]({'attributes':['id',_0x8e97('0x3a'),_0x8e97('0x107')],'where':{'id':_0x43a0dd[_0x8e97('0x7a')]['ids']}});})[_0x8e97('0x21')](function(_0x1c6d50){socket[_0x8e97('0x108')](_0x8e97('0x109'),{'id':Number(_0x43a0dd[_0x8e97('0xb9')]['id']),'tags':_0x1c6d50||[]});return{'id':Number(_0x43a0dd[_0x8e97('0xb9')]['id']),'tags':_0x1c6d50||[]};});}})[_0x8e97('0x21')](respondWithResult(_0x37abb1,null))[_0x8e97('0x2b')](handleError(_0x37abb1,null));};exports['removeTags']=function(_0x5e8887,_0x33d83e,_0x48f0aa){return db[_0x8e97('0x42')][_0x8e97('0x68')]({'where':{'id':_0x5e8887['params']['id']}})[_0x8e97('0x21')](handleEntityNotFound(_0x33d83e,null))[_0x8e97('0x21')](function(_0x61bccf){if(_0x61bccf){return _0x61bccf[_0x8e97('0x10a')](_0x5e8887[_0x8e97('0x47')][_0x8e97('0xff')]);}})['then'](respondWithStatusCode(_0x33d83e,null))[_0x8e97('0x2b')](handleError(_0x33d83e,null));};exports[_0x8e97('0xdd')]=function(_0x2a1ccb,_0x121e65){var _0x322ec7=moment()[_0x8e97('0x10b')]()[_0x8e97('0x9f')]();var _0x1eb175=path[_0x8e97('0xda')](config['root'],'server',_0x8e97('0x10c'),_0x8e97('0x10d'));var _0x160d67=path[_0x8e97('0xda')](config['root'],'server',_0x8e97('0x10c'),_0x8e97('0x10e'));var _0x356fa9=path['join'](_0x1eb175,_0x322ec7);var _0x32dfac=util[_0x8e97('0xe0')](_0x8e97('0x10f'),_0x2a1ccb[_0x8e97('0xb9')]['id'],_0x322ec7);var _0x11836e=path[_0x8e97('0xda')](_0x1eb175,_0x32dfac);var _0x3d3b36=[];_0x3d3b36[_0x8e97('0x40')]({'model':db[_0x8e97('0x76')],'as':_0x8e97('0x76'),'attributes':['id',_0x8e97('0x3c')],'raw':!![]});_0x3d3b36[_0x8e97('0x40')]({'model':db[_0x8e97('0xcb')],'as':_0x8e97('0x110'),'attributes':['id',_0x8e97('0x111'),'lastName'],'raw':!![]});if(_0x2a1ccb[_0x8e97('0x47')][_0x8e97('0x10e')]){_0x3d3b36[_0x8e97('0x40')]({'model':db[_0x8e97('0xd5')],'as':'Attachment','raw':!![]});}var _0x5d64e9=[{'model':db[_0x8e97('0xc9')],'as':_0x8e97('0xe4'),'attributes':['id',_0x8e97('0x7a'),'createdAt','direction',_0x8e97('0x106'),_0x8e97('0x84')],'include':_0x3d3b36}];_0x5d64e9[_0x8e97('0x40')]({'model':db[_0x8e97('0xe5')],'as':_0x8e97('0x112'),'attributes':['id',_0x8e97('0x3a')]});_0x5d64e9['push']({'model':db[_0x8e97('0x76')],'as':_0x8e97('0x113'),'attributes':['id',_0x8e97('0x3c')]});return db[_0x8e97('0x42')][_0x8e97('0x68')]({'where':{'id':_0x2a1ccb['params']['id']},'include':_0x5d64e9})[_0x8e97('0x21')](handleEntityNotFound(_0x121e65,null))['then'](function(_0x54e7a4){if(_0x54e7a4){var _0x1a0aca=_0x54e7a4[_0x8e97('0x114')]({'plain':!![]});fs[_0x8e97('0x115')](_0x356fa9);var _0x37d2e1={'format':'A4','border':'10px','header':{'height':_0x8e97('0x116'),'contents':{'first':_0x8e97('0x117')}},'footer':{'height':_0x8e97('0x118'),'contents':{'default':util[_0x8e97('0xe0')](_0x8e97('0x119'),util['format']('%s\x20#%d',_0x8e97('0x11a'),_0x1a0aca['id']),moment()['format'](_0x8e97('0x11b'))['toString']())}}};var _0x3c73d7={'channel':'Chat','account':_0x1a0aca[_0x8e97('0x112')][_0x8e97('0x3a')],'agent':_0x1a0aca[_0x8e97('0x113')]?_0x1a0aca[_0x8e97('0x113')][_0x8e97('0x3c')]:'N.A.','createdAt':moment(_0x1a0aca[_0x8e97('0x7d')])[_0x8e97('0xe0')](_0x8e97('0x11c'))[_0x8e97('0x9f')](),'closedAt':_0x1a0aca[_0x8e97('0xd7')]?moment(_0x1a0aca[_0x8e97('0x11d')])[_0x8e97('0xe0')](_0x8e97('0x11c'))[_0x8e97('0x9f')]():'','disposition':_0x1a0aca[_0x8e97('0xcf')],'chatInfo':{'browser':_0x1a0aca[_0x8e97('0x11e')],'os':_0x1a0aca['osName'],'referer':_0x1a0aca[_0x8e97('0x11f')],'customerIp':_0x1a0aca['customerIp'],'customerPort':_0x1a0aca['customerPort']?_0x1a0aca[_0x8e97('0x120')]:_0x8e97('0x121')},'messages':_(_0x1a0aca[_0x8e97('0xe4')])[_0x8e97('0x122')]()['filter']({'secret':![]})[_0x8e97('0x41')](function(_0x3abbc9){if(_0x3abbc9[_0x8e97('0xd5')]){var _0x526ae4=path[_0x8e97('0xda')](_0x160d67,_0x3abbc9[_0x8e97('0xd5')][_0x8e97('0xd4')]);if(fs[_0x8e97('0x123')](_0x526ae4)){fs[_0x8e97('0x124')](_0x526ae4)['pipe'](fs[_0x8e97('0x125')](path[_0x8e97('0xda')](_0x356fa9,_0x3abbc9[_0x8e97('0xd5')]['basename'])));}}return{'date':moment(_0x3abbc9['createdAt'])['format'](_0x8e97('0x11c'))[_0x8e97('0x9f')](),'sender':_0x3abbc9[_0x8e97('0x126')]===_0x8e97('0xc8')?_0x3abbc9['User']?_0x3abbc9['User'][_0x8e97('0x3c')]:'System':_0x3abbc9[_0x8e97('0x110')]['firstName']+(_0x3abbc9[_0x8e97('0x110')][_0x8e97('0x127')]?'\x20'+_0x3abbc9[_0x8e97('0x110')][_0x8e97('0x127')]:''),'body':_0x3abbc9[_0x8e97('0xd5')]?_0x3abbc9['Attachment']['basename']:_0x3abbc9[_0x8e97('0x7a')],'direction':_0x3abbc9[_0x8e97('0x126')]===_0x8e97('0xc8')?'A':'C','secret':_0x3abbc9[_0x8e97('0x106')],'read':_0x3abbc9[_0x8e97('0x84')],'attachment':_0x3abbc9['Attachment']};})[_0x8e97('0x6a')]()};return ejs[_0x8e97('0x128')](path['join'](config['root'],'server',_0x8e97('0x129'),_0x8e97('0x12a')),{'interaction':_0x3c73d7})[_0x8e97('0x21')](function(_0x167085){return new BPromise(function(_0x92b706,_0x391fee){pdf[_0x8e97('0xbf')](_0x167085,_0x37d2e1)[_0x8e97('0x12b')](path[_0x8e97('0xda')](_0x356fa9,'transcript-'+_0x1a0aca['id']+'-'+_0x322ec7+_0x8e97('0x12c')),function(_0x4c2465,_0x13a0d6){if(_0x4c2465)return _0x391fee(_0x4c2465);_0x92b706(_0x13a0d6);});});})['then'](function(){return new BPromise(function(_0x2e7226,_0x2fe24e){zipdir(_0x356fa9,{'saveTo':_0x11836e},function(_0x3863ea,_0x2cd8e7){if(_0x3863ea)return _0x2fe24e(_0x3863ea);return _0x2e7226(_0x2cd8e7);});})['then'](function(){return new BPromise(function(_0x52f748,_0x189084){rimraf(_0x356fa9,function(_0x2e381e){if(_0x2e381e)_0x189084(_0x2e381e);return _0x52f748();});});})[_0x8e97('0x21')](function(){return _0x121e65[_0x8e97('0xdd')](_0x11836e,_0x32dfac,function(_0x5c2c15){if(_0x5c2c15){console[_0x8e97('0x12d')](_0x8e97('0x12e'),_0x5c2c15);}else{fs[_0x8e97('0x12f')](_0x11836e);}});});});}else{return _0x121e65[_0x8e97('0x2c')](0xc8);}})[_0x8e97('0x2b')](handleError(_0x121e65,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index e223963..b4b96f4 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 _0xcac3=['emit','catch','hasOwnProperty','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','length'];(function(_0x5184fd,_0x5d85ba){var _0x10a794=function(_0x153d9b){while(--_0x153d9b){_0x5184fd['push'](_0x5184fd['shift']());}};_0x10a794(++_0x5d85ba);}(_0xcac3,0x193));var _0x3cac=function(_0x119b4b,_0x322a87){_0x119b4b=_0x119b4b-0x0;var _0x2ca4d5=_0xcac3[_0x119b4b];return _0x2ca4d5;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x3cac('0x0'))['db'][_0x3cac('0x1')];var ChatMessage=require(_0x3cac('0x0'))['db'][_0x3cac('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x3cac('0x3')](0x0);var events={'afterCreate':_0x3cac('0x4'),'afterUpdate':_0x3cac('0x5'),'afterDestroy':_0x3cac('0x6')};function emitEvent(_0x2d7790){return function(_0x346c24,_0x725139,_0x2c5e16){_0x346c24[_0x3cac('0x7')]({'attributes':['id'],'raw':!![]})[_0x3cac('0x8')](function(_0x14562c){_0x346c24[_0x3cac('0x9')](_0x3cac('0xa'),_0x14562c['map'](function(_0x3cbf8d){return{'id':_0x3cbf8d['id']};}));return ChatMessage[_0x3cac('0xb')]({'where':{'ChatInteractionId':_0x346c24['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3cac('0x8')](function(_0x306664){_0x346c24[_0x3cac('0x9')]('unreadMessages',_0x306664[_0x3cac('0xc')]);ChatInteractionEvents[_0x3cac('0xd')](_0x2d7790+':'+_0x346c24['id'],_0x346c24);ChatInteractionEvents[_0x3cac('0xd')](_0x2d7790,_0x346c24);_0x2c5e16(null);})[_0x3cac('0xe')](_0x2c5e16(null));};}for(var e in events){if(events[_0x3cac('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x2ace=['setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook','../../mysqldb','ChatInteraction'];(function(_0x1dfcae,_0x495fc1){var _0x508c60=function(_0x48b127){while(--_0x48b127){_0x1dfcae['push'](_0x1dfcae['shift']());}};_0x508c60(++_0x495fc1);}(_0x2ace,0x17e));var _0xe2ac=function(_0x14bf63,_0xdbd373){_0x14bf63=_0x14bf63-0x0;var _0x410d22=_0x2ace[_0x14bf63];return _0x410d22;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xe2ac('0x0'))['db'][_0xe2ac('0x1')];var ChatMessage=require(_0xe2ac('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xe2ac('0x2')](0x0);var events={'afterCreate':_0xe2ac('0x3'),'afterUpdate':'update','afterDestroy':_0xe2ac('0x4')};function emitEvent(_0x464ec4){return function(_0x240663,_0x2d2241,_0x386b18){_0x240663[_0xe2ac('0x5')]({'attributes':['id'],'raw':!![]})[_0xe2ac('0x6')](function(_0x391f96){_0x240663[_0xe2ac('0x7')](_0xe2ac('0x8'),_0x391f96[_0xe2ac('0x9')](function(_0x3ae734){return{'id':_0x3ae734['id']};}));return ChatMessage[_0xe2ac('0xa')]({'where':{'ChatInteractionId':_0x240663['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5e6678){_0x240663[_0xe2ac('0x7')]('unreadMessages',_0x5e6678[_0xe2ac('0xb')]);ChatInteractionEvents[_0xe2ac('0xc')](_0x464ec4+':'+_0x240663['id'],_0x240663);ChatInteractionEvents['emit'](_0x464ec4,_0x240663);_0x386b18(null);})[_0xe2ac('0xd')](_0x386b18(null));};}for(var e in events){if(events[_0xe2ac('0xe')](e)){var event=events[e];ChatInteraction[_0xe2ac('0xf')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index fb92c99..1b62001 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 _0x8288=['request-promise','path','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x208569,_0x4d4049){var _0x1e0ee3=function(_0x4403ee){while(--_0x4403ee){_0x208569['push'](_0x208569['shift']());}};_0x1e0ee3(++_0x4d4049);}(_0x8288,0x10c));var _0x8828=function(_0x20533e,_0x5061d3){_0x20533e=_0x20533e-0x0;var _0x4fe339=_0x8288[_0x20533e];return _0x4fe339;};'use strict';var _=require(_0x8828('0x0'));var util=require(_0x8828('0x1'));var logger=require(_0x8828('0x2'))('api');var moment=require(_0x8828('0x3'));var BPromise=require('bluebird');var rp=require(_0x8828('0x4'));var fs=require('fs');var path=require(_0x8828('0x5'));var rimraf=require('rimraf');var config=require(_0x8828('0x6'));var attributes=require(_0x8828('0x7'));module[_0x8828('0x8')]=function(_0x250b9e,_0x12d479){return _0x250b9e['define'](_0x8828('0x9'),attributes,{'tableName':_0x8828('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x21e762,_0x5f4f6c,_0xcafe57){if(_0x21e762[_0x8828('0xb')](_0x8828('0xc'))){_0x21e762[_0x8828('0xd')]=moment()['format'](_0x8828('0xe'));}_0xcafe57(null,_0x21e762);}},'charset':_0x8828('0xf'),'collate':_0x8828('0x10')});};
\ No newline at end of file
+var _0xa14b=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closedAt'];(function(_0x1a7413,_0x3e7da0){var _0x254221=function(_0x2a29b9){while(--_0x2a29b9){_0x1a7413['push'](_0x1a7413['shift']());}};_0x254221(++_0x3e7da0);}(_0xa14b,0xf2));var _0xba14=function(_0x12c6a5,_0xccbb68){_0x12c6a5=_0x12c6a5-0x0;var _0x82618f=_0xa14b[_0x12c6a5];return _0x82618f;};'use strict';var _=require(_0xba14('0x0'));var util=require(_0xba14('0x1'));var logger=require(_0xba14('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xba14('0x3'));var fs=require('fs');var path=require(_0xba14('0x4'));var rimraf=require('rimraf');var config=require(_0xba14('0x5'));var attributes=require(_0xba14('0x6'));module[_0xba14('0x7')]=function(_0x54d805,_0x50bdbb){return _0x54d805[_0xba14('0x8')](_0xba14('0x9'),attributes,{'tableName':_0xba14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x20de8d,_0x443ae2,_0x54e9a0){if(_0x20de8d[_0xba14('0xb')]('closed')){_0x20de8d[_0xba14('0xc')]=moment()[_0xba14('0xd')](_0xba14('0xe'));}_0x54e9a0(null,_0x20de8d);}},'charset':_0xba14('0xf'),'collate':_0xba14('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 89ffc42..8aac3df 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 _0x30f0=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','update','body','options','attributes','limit','UpdateChatInteraction','ChatInteraction','find','where','addTags','ids','spread','AddTags','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5df081,_0x222330){var _0x3da1c0=function(_0x367c08){while(--_0x367c08){_0x5df081['push'](_0x5df081['shift']());}};_0x3da1c0(++_0x222330);}(_0x30f0,0x11b));var _0x030f=function(_0x2dfca5,_0x4b9215){_0x2dfca5=_0x2dfca5-0x0;var _0x359508=_0x30f0[_0x2dfca5];return _0x359508;};'use strict';var _=require(_0x030f('0x0'));var util=require(_0x030f('0x1'));var moment=require(_0x030f('0x2'));var BPromise=require(_0x030f('0x3'));var rs=require(_0x030f('0x4'));var fs=require('fs');var Redis=require(_0x030f('0x5'));var db=require(_0x030f('0x6'))['db'];var utils=require(_0x030f('0x7'));var logger=require(_0x030f('0x8'))(_0x030f('0x9'));var config=require(_0x030f('0xa'));var jayson=require(_0x030f('0xb'));var client=jayson['client'][_0x030f('0xc')]({'port':0x232a});config[_0x030f('0xd')]=_[_0x030f('0xe')](config[_0x030f('0xd')],{'host':_0x030f('0xf'),'port':0x18eb});var socket=require(_0x030f('0x10'))(new Redis(config[_0x030f('0xd')]));require(_0x030f('0x11'))[_0x030f('0x12')](socket);function respondWithRpcPromise(_0x31c376,_0x2e981b,_0xc5c648){return new BPromise(function(_0x5a8758,_0x2a2a71){return client['request'](_0x31c376,_0xc5c648)[_0x030f('0x13')](function(_0x53b38c){logger[_0x030f('0x14')](_0x030f('0x15'),_0x2e981b,_0x030f('0x16'));logger[_0x030f('0x17')](_0x030f('0x18'),_0x2e981b,_0x030f('0x16'),JSON[_0x030f('0x19')](_0x53b38c));if(_0x53b38c[_0x030f('0x1a')]){if(_0x53b38c[_0x030f('0x1a')]['code']===0x1f4){logger[_0x030f('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x2e981b,_0x53b38c[_0x030f('0x1a')][_0x030f('0x1b')]);return _0x2a2a71(_0x53b38c[_0x030f('0x1a')][_0x030f('0x1b')]);}logger[_0x030f('0x1a')](_0x030f('0x15'),_0x2e981b,_0x53b38c['error'][_0x030f('0x1b')]);return _0x5a8758(_0x53b38c[_0x030f('0x1a')][_0x030f('0x1b')]);}else{logger[_0x030f('0x14')](_0x030f('0x15'),_0x2e981b,_0x030f('0x16'));_0x5a8758(_0x53b38c['result'][_0x030f('0x1b')]);}})['catch'](function(_0x1b7cb5){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2e981b,_0x1b7cb5);_0x2a2a71(_0x1b7cb5);});});}exports['UpdateChatInteraction']=function(_0x20fd2d){var _0x4c5390=this;return new Promise(function(_0x579c30,_0x3aed2e){return db['ChatInteraction'][_0x030f('0x1c')](_0x20fd2d[_0x030f('0x1d')],{'raw':_0x20fd2d['options']?_0x20fd2d[_0x030f('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20fd2d[_0x030f('0x1e')]?_0x20fd2d[_0x030f('0x1e')]['where']||null:null,'attributes':_0x20fd2d[_0x030f('0x1e')]?_0x20fd2d[_0x030f('0x1e')][_0x030f('0x1f')]||null:null,'limit':_0x20fd2d[_0x030f('0x1e')]?_0x20fd2d[_0x030f('0x1e')][_0x030f('0x20')]||null:null})[_0x030f('0x13')](function(_0x2f27c3){logger['info'](_0x030f('0x21'),_0x20fd2d);logger[_0x030f('0x17')]('UpdateChatInteraction',_0x20fd2d,JSON[_0x030f('0x19')](_0x2f27c3));_0x579c30(_0x2f27c3);})['catch'](function(_0x12a41b){logger['error'](_0x030f('0x21'),_0x12a41b['message'],_0x20fd2d);_0x3aed2e(_0x4c5390['error'](0x1f4,_0x12a41b[_0x030f('0x1b')]));});});};exports['AddTagsToChatInteraction']=function(_0x12ba04){return new Promise(function(_0x4c7adc,_0x3a1f03){return db[_0x030f('0x22')][_0x030f('0x23')]({'where':_0x12ba04[_0x030f('0x1e')]?_0x12ba04['options'][_0x030f('0x24')]||null:null})[_0x030f('0x13')](function(_0x1f56e0){if(_0x1f56e0){return _0x1f56e0[_0x030f('0x25')](_0x12ba04[_0x030f('0x1d')][_0x030f('0x26')],_['omit'](_0x12ba04['body'],[_0x030f('0x26'),'id'])||{});}})[_0x030f('0x27')](function(_0x42c5c6){logger[_0x030f('0x14')](_0x030f('0x28'),_0x12ba04);logger[_0x030f('0x17')]('AddTags',_0x12ba04,JSON['stringify'](_0x42c5c6));_0x4c7adc(_0x42c5c6);})[_0x030f('0x29')](function(_0x4d3431){logger[_0x030f('0x1a')](_0x030f('0x28'),_0x4d3431[_0x030f('0x1b')],_0x12ba04);_0x3a1f03(_this['error'](0x1f4,_0x4d3431['message']));});});};
\ No newline at end of file
+var _0xab43=['UpdateChatInteraction','ChatInteraction','options','raw','attributes','limit','then','debug','stringify','AddTagsToChatInteraction','where','body','ids','spread','info','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','error','code','message','catch'];(function(_0xc0a186,_0x31b7fa){var _0x453c1b=function(_0x48373e){while(--_0x48373e){_0xc0a186['push'](_0xc0a186['shift']());}};_0x453c1b(++_0x31b7fa);}(_0xab43,0x85));var _0x3ab4=function(_0x30b7b0,_0x5255cf){_0x30b7b0=_0x30b7b0-0x0;var _0x5024ef=_0xab43[_0x30b7b0];return _0x5024ef;};'use strict';var _=require(_0x3ab4('0x0'));var util=require('util');var moment=require(_0x3ab4('0x1'));var BPromise=require(_0x3ab4('0x2'));var rs=require(_0x3ab4('0x3'));var fs=require('fs');var Redis=require(_0x3ab4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3ab4('0x5'));var logger=require(_0x3ab4('0x6'))(_0x3ab4('0x7'));var config=require(_0x3ab4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3ab4('0x9')][_0x3ab4('0xa')]({'port':0x232a});config['redis']=_[_0x3ab4('0xb')](config[_0x3ab4('0xc')],{'host':_0x3ab4('0xd'),'port':0x18eb});var socket=require(_0x3ab4('0xe'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x3ab4('0xf')](socket);function respondWithRpcPromise(_0x60d6b4,_0x54dea0,_0x62bb17){return new BPromise(function(_0x1d3913,_0x138e4b){return client[_0x3ab4('0x10')](_0x60d6b4,_0x62bb17)['then'](function(_0x478b92){logger['info'](_0x3ab4('0x11'),_0x54dea0,_0x3ab4('0x12'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x54dea0,'request\x20sent',JSON['stringify'](_0x478b92));if(_0x478b92[_0x3ab4('0x13')]){if(_0x478b92[_0x3ab4('0x13')][_0x3ab4('0x14')]===0x1f4){logger[_0x3ab4('0x13')](_0x3ab4('0x11'),_0x54dea0,_0x478b92[_0x3ab4('0x13')][_0x3ab4('0x15')]);return _0x138e4b(_0x478b92['error'][_0x3ab4('0x15')]);}logger[_0x3ab4('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x54dea0,_0x478b92['error']['message']);return _0x1d3913(_0x478b92[_0x3ab4('0x13')][_0x3ab4('0x15')]);}else{logger['info'](_0x3ab4('0x11'),_0x54dea0,'request\x20sent');_0x1d3913(_0x478b92['result'][_0x3ab4('0x15')]);}})[_0x3ab4('0x16')](function(_0x42b071){logger['error'](_0x3ab4('0x11'),_0x54dea0,_0x42b071);_0x138e4b(_0x42b071);});});}exports[_0x3ab4('0x17')]=function(_0x1d67dd){var _0xfa8c42=this;return new Promise(function(_0x5baf9e,_0x2bb8fa){return db[_0x3ab4('0x18')]['update'](_0x1d67dd['body'],{'raw':_0x1d67dd[_0x3ab4('0x19')]?_0x1d67dd[_0x3ab4('0x19')][_0x3ab4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d67dd[_0x3ab4('0x19')]?_0x1d67dd['options']['where']||null:null,'attributes':_0x1d67dd[_0x3ab4('0x19')]?_0x1d67dd[_0x3ab4('0x19')][_0x3ab4('0x1b')]||null:null,'limit':_0x1d67dd[_0x3ab4('0x19')]?_0x1d67dd['options'][_0x3ab4('0x1c')]||null:null})[_0x3ab4('0x1d')](function(_0x3e7bb5){logger['info'](_0x3ab4('0x17'),_0x1d67dd);logger[_0x3ab4('0x1e')]('UpdateChatInteraction',_0x1d67dd,JSON[_0x3ab4('0x1f')](_0x3e7bb5));_0x5baf9e(_0x3e7bb5);})['catch'](function(_0x4c7119){logger[_0x3ab4('0x13')](_0x3ab4('0x17'),_0x4c7119[_0x3ab4('0x15')],_0x1d67dd);_0x2bb8fa(_0xfa8c42[_0x3ab4('0x13')](0x1f4,_0x4c7119['message']));});});};exports[_0x3ab4('0x20')]=function(_0x1622c3){return new Promise(function(_0x19c62e,_0x35d4dd){return db[_0x3ab4('0x18')]['find']({'where':_0x1622c3[_0x3ab4('0x19')]?_0x1622c3['options'][_0x3ab4('0x21')]||null:null})['then'](function(_0x3a4f96){if(_0x3a4f96){return _0x3a4f96['addTags'](_0x1622c3[_0x3ab4('0x22')][_0x3ab4('0x23')],_['omit'](_0x1622c3[_0x3ab4('0x22')],['ids','id'])||{});}})[_0x3ab4('0x24')](function(_0x51ab6f){logger[_0x3ab4('0x25')](_0x3ab4('0x26'),_0x1622c3);logger['debug'](_0x3ab4('0x26'),_0x1622c3,JSON[_0x3ab4('0x1f')](_0x51ab6f));_0x19c62e(_0x51ab6f);})[_0x3ab4('0x16')](function(_0x4ccaaa){logger[_0x3ab4('0x13')](_0x3ab4('0x26'),_0x4ccaaa[_0x3ab4('0x15')],_0x1622c3);_0x35d4dd(_this[_0x3ab4('0x13')](0x1f4,_0x4ccaaa['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index b1706f6..e4ffe2a 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 _0x6825=['remove','update','emit','removeListener','length','chatInteraction:','save'];(function(_0x2d7335,_0x52ffd1){var _0xbf6c1c=function(_0x4e0459){while(--_0x4e0459){_0x2d7335['push'](_0x2d7335['shift']());}};_0xbf6c1c(++_0x52ffd1);}(_0x6825,0x1e2));var _0x5682=function(_0x53bf28,_0x93c0e9){_0x53bf28=_0x53bf28-0x0;var _0x2ac000=_0x6825[_0x53bf28];return _0x2ac000;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x5682('0x0'),_0x5682('0x1'),_0x5682('0x2')];function createListener(_0x2234c4,_0x432215){return function(_0x806011){_0x432215[_0x5682('0x3')](_0x2234c4,_0x806011);};}function removeListener(_0x24330b,_0x5c66a6){return function(){ChatInteractionEvents[_0x5682('0x4')](_0x24330b,_0x5c66a6);};}exports['register']=function(_0x120b06){for(var _0x6ebdac=0x0,_0x508bd5=events[_0x5682('0x5')];_0x6ebdac<_0x508bd5;_0x6ebdac++){var _0x515ec9=events[_0x6ebdac];var _0x52c2bf=createListener(_0x5682('0x6')+_0x515ec9,_0x120b06);ChatInteractionEvents['on'](_0x515ec9,_0x52c2bf);}};
\ No newline at end of file
+var _0x36b4=['length','save','update','emit','removeListener'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x36b4,0x1be));var _0x436b=function(_0x4d4e8a,_0x162fd7){_0x4d4e8a=_0x4d4e8a-0x0;var _0x2e304d=_0x36b4[_0x4d4e8a];return _0x2e304d;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x436b('0x0'),'remove',_0x436b('0x1')];function createListener(_0x30d10e,_0x27bdb8){return function(_0x33dee7){_0x27bdb8[_0x436b('0x2')](_0x30d10e,_0x33dee7);};}function removeListener(_0x3db80c,_0x2d6b79){return function(){ChatInteractionEvents[_0x436b('0x3')](_0x3db80c,_0x2d6b79);};}exports['register']=function(_0x3dd835){for(var _0x547d29=0x0,_0x5f10d5=events[_0x436b('0x4')];_0x547d29<_0x5f10d5;_0x547d29++){var _0x5b1c82=events[_0x547d29];var _0x37e3b8=createListener('chatInteraction:'+_0x5b1c82,_0x3dd835);ChatInteractionEvents['on'](_0x5b1c82,_0x37e3b8);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 34ab4dc..9a425ce 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 _0xb3b8=['join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','destroy','delete','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession'];(function(_0x4bf20,_0x44ba0c){var _0x594bb3=function(_0x24c687){while(--_0x24c687){_0x4bf20['push'](_0x4bf20['shift']());}};_0x594bb3(++_0x44ba0c);}(_0xb3b8,0xe1));var _0x8b3b=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0xb3b8[_0xb24a3e];return _0x4038d7;};'use strict';var multer=require('multer');var util=require(_0x8b3b('0x0'));var path=require(_0x8b3b('0x1'));var timeout=require(_0x8b3b('0x2'));var express=require(_0x8b3b('0x3'));var router=express[_0x8b3b('0x4')]();var fs_extra=require(_0x8b3b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8b3b('0x6'));var controller=require(_0x8b3b('0x7'));router['get']('/',auth[_0x8b3b('0x8')](),controller[_0x8b3b('0x9')]);router[_0x8b3b('0xa')](_0x8b3b('0xb'),auth['isAuthenticated'](),controller[_0x8b3b('0xc')]);router[_0x8b3b('0xa')](_0x8b3b('0xd'),auth[_0x8b3b('0xe')](),controller['show']);router['get']('/:id/attachment_download',auth[_0x8b3b('0xe')](),controller['attachmentDownload']);router[_0x8b3b('0xa')](_0x8b3b('0xf'),auth[_0x8b3b('0x8')](),controller[_0x8b3b('0x10')]);router['get'](_0x8b3b('0x11'),auth[_0x8b3b('0xe')](),controller[_0x8b3b('0x12')]);router['get'](_0x8b3b('0x13'),auth[_0x8b3b('0x8')](),controller[_0x8b3b('0x14')]);router[_0x8b3b('0x15')]('/',auth[_0x8b3b('0x8')](),controller[_0x8b3b('0x16')]);router[_0x8b3b('0x15')](_0x8b3b('0x17'),auth['isAuthenticated'](),controller[_0x8b3b('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4b1f9b,_0x51cbd3,_0x1182e0){_0x1182e0(null,path[_0x8b3b('0x19')](config[_0x8b3b('0x1a')],_0x8b3b('0x1b')));},'filename':function(_0x3c70f8,_0x2483d6,_0x4cd8de){_0x4cd8de(null,util[_0x8b3b('0x1c')](_0x8b3b('0x1d'),Date[_0x8b3b('0x1e')](),_0x2483d6[_0x8b3b('0x1f')][_0x8b3b('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8b3b('0x15')](_0x8b3b('0x21'),upload['single']('file'),controller['attachmentUpload']);router[_0x8b3b('0x15')](_0x8b3b('0xf'),auth[_0x8b3b('0xe')](),controller[_0x8b3b('0x22')]);router[_0x8b3b('0x15')](_0x8b3b('0x23'),auth[_0x8b3b('0x8')](),interaction[_0x8b3b('0x24')](_0x8b3b('0x25'),_0x8b3b('0x26')),controller[_0x8b3b('0x27')]);router[_0x8b3b('0x28')]('/:id',auth[_0x8b3b('0x8')](),interaction[_0x8b3b('0x24')]('chat','chatinteraction:update'),controller['update']);router[_0x8b3b('0x28')](_0x8b3b('0x29'),controller[_0x8b3b('0x2a')]);router['put'](_0x8b3b('0x2b'),auth[_0x8b3b('0xe')](),controller['abandon']);router[_0x8b3b('0x28')](_0x8b3b('0x2c'),controller[_0x8b3b('0x2d')]);router['delete'](_0x8b3b('0xd'),auth[_0x8b3b('0x8')](),interaction[_0x8b3b('0x24')](_0x8b3b('0x25'),'chatinteraction:destroy'),controller[_0x8b3b('0x2e')]);router[_0x8b3b('0x2f')](_0x8b3b('0x23'),auth[_0x8b3b('0x8')](),controller[_0x8b3b('0x30')]);module[_0x8b3b('0x31')]=router;
\ No newline at end of file
+var _0x7cfe=['tracked','chatinteraction:addtags','addTags','put','/:id','chat','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','getMessages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','root','server/files/attachments/','%s-%s','now','originalname','replace','single','file','attachmentUpload','/:id/messages','/:id/tags'];(function(_0x561af6,_0x214a22){var _0x3d6789=function(_0x41ff9a){while(--_0x41ff9a){_0x561af6['push'](_0x561af6['shift']());}};_0x3d6789(++_0x214a22);}(_0x7cfe,0xd9));var _0xe7cf=function(_0x450860,_0x196a04){_0x450860=_0x450860-0x0;var _0x110c2a=_0x7cfe[_0x450860];return _0x110c2a;};'use strict';var multer=require(_0xe7cf('0x0'));var util=require(_0xe7cf('0x1'));var path=require(_0xe7cf('0x2'));var timeout=require('connect-timeout');var express=require(_0xe7cf('0x3'));var router=express[_0xe7cf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe7cf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe7cf('0x6'));var controller=require('./chatInteraction.controller');router[_0xe7cf('0x7')]('/',auth[_0xe7cf('0x8')](),controller[_0xe7cf('0x9')]);router[_0xe7cf('0x7')](_0xe7cf('0xa'),auth[_0xe7cf('0x8')](),controller[_0xe7cf('0xb')]);router[_0xe7cf('0x7')]('/:id',auth[_0xe7cf('0xc')](),controller['show']);router[_0xe7cf('0x7')](_0xe7cf('0xd'),auth['isChatInteractionAuthorized'](),controller[_0xe7cf('0xe')]);router[_0xe7cf('0x7')]('/:id/messages',auth[_0xe7cf('0x8')](),controller[_0xe7cf('0xf')]);router[_0xe7cf('0x7')]('/:id/my_messages',auth[_0xe7cf('0xc')](),controller['getMyMessages']);router['get'](_0xe7cf('0x10'),auth[_0xe7cf('0x8')](),controller[_0xe7cf('0x11')]);router[_0xe7cf('0x12')]('/',auth['isAuthenticated'](),controller[_0xe7cf('0x13')]);router['post'](_0xe7cf('0x14'),auth[_0xe7cf('0x8')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xe7cf('0x15')]({'destination':function(_0xbb52c8,_0x2e34a5,_0x311696){_0x311696(null,path['join'](config[_0xe7cf('0x16')],_0xe7cf('0x17')));},'filename':function(_0xc4f835,_0x57721c,_0x4e8914){_0x4e8914(null,util['format'](_0xe7cf('0x18'),Date[_0xe7cf('0x19')](),_0x57721c[_0xe7cf('0x1a')][_0xe7cf('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe7cf('0x12')]('/:id/attachment_upload',upload[_0xe7cf('0x1c')](_0xe7cf('0x1d')),controller[_0xe7cf('0x1e')]);router['post'](_0xe7cf('0x1f'),auth[_0xe7cf('0xc')](),controller['addMessage']);router[_0xe7cf('0x12')](_0xe7cf('0x20'),auth[_0xe7cf('0x8')](),interaction[_0xe7cf('0x21')]('chat',_0xe7cf('0x22')),controller[_0xe7cf('0x23')]);router[_0xe7cf('0x24')](_0xe7cf('0x25'),auth[_0xe7cf('0x8')](),interaction['tracked'](_0xe7cf('0x26'),'chatinteraction:update'),controller[_0xe7cf('0x27')]);router[_0xe7cf('0x24')](_0xe7cf('0x28'),controller[_0xe7cf('0x29')]);router['put'](_0xe7cf('0x2a'),auth[_0xe7cf('0xc')](),controller[_0xe7cf('0x2b')]);router['put'](_0xe7cf('0x2c'),controller['close']);router[_0xe7cf('0x2d')](_0xe7cf('0x25'),auth['isAuthenticated'](),interaction[_0xe7cf('0x21')]('chat',_0xe7cf('0x2e')),controller[_0xe7cf('0x2f')]);router[_0xe7cf('0x2d')](_0xe7cf('0x20'),auth[_0xe7cf('0x8')](),controller[_0xe7cf('0x30')]);module[_0xe7cf('0x31')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index ee8b132..aa8bd03 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 _0x5f66=['exports','medium','BOOLEAN','INTEGER'];(function(_0x348043,_0x2ba294){var _0x392e48=function(_0x4dbc97){while(--_0x4dbc97){_0x348043['push'](_0x348043['shift']());}};_0x392e48(++_0x2ba294);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x65f6('0x3')]}};
\ No newline at end of file
+var _0x5f2f=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x3f04d0,_0x19fe04){var _0x3562e7=function(_0x2bdbaa){while(--_0x2bdbaa){_0x3f04d0['push'](_0x3f04d0['shift']());}};_0x3562e7(++_0x19fe04);}(_0x5f2f,0x73));var _0xf5f2=function(_0x36e22b,_0x12fdc9){_0x36e22b=_0x36e22b-0x0;var _0x41bc3d=_0x5f2f[_0x36e22b];return _0x41bc3d;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf5f2('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xf5f2('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index c5a17f0..c5abf13 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 _0x0fe6=['messages','ToId','read','-createdAt','all','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','send','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','body','update','get','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','user','fullname','role','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push'];(function(_0x34217f,_0x4954d9){var _0x533721=function(_0x5ea689){while(--_0x5ea689){_0x34217f['push'](_0x34217f['shift']());}};_0x533721(++_0x4954d9);}(_0x0fe6,0x6f));var _0x60fe=function(_0x42bad3,_0x5c5001){_0x42bad3=_0x42bad3-0x0;var _0x35ce77=_0x0fe6[_0x42bad3];return _0x35ce77;};'use strict';var pdf=require(_0x60fe('0x0'));var emlformat=require(_0x60fe('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x60fe('0x2'));var jsonpatch=require(_0x60fe('0x3'));var rp=require(_0x60fe('0x4'));var moment=require(_0x60fe('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x60fe('0x6'));var path=require(_0x60fe('0x7'));var sox=require(_0x60fe('0x8'));var csv=require(_0x60fe('0x9'));var ejs=require(_0x60fe('0xa'));var fs=require('fs');var fs_extra=require(_0x60fe('0xb'));var _=require(_0x60fe('0xc'));var squel=require(_0x60fe('0xd'));var crypto=require(_0x60fe('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x60fe('0xf'));var toCsv=require(_0x60fe('0x9'));var querystring=require(_0x60fe('0x10'));var Papa=require(_0x60fe('0x11'));var Redis=require('ioredis');var authService=require(_0x60fe('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x60fe('0x13'));var hardwareService=require(_0x60fe('0x14'));var logger=require(_0x60fe('0x15'))(_0x60fe('0x16'));var utils=require(_0x60fe('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x60fe('0x18'));var db=require(_0x60fe('0x19'))['db'];config[_0x60fe('0x1a')]=_['defaults'](config[_0x60fe('0x1a')],{'host':_0x60fe('0x1b'),'port':0x18eb});var socket=require(_0x60fe('0x1c'))(new Redis(config[_0x60fe('0x1a')]));require('./chatInternalMessage.socket')[_0x60fe('0x1d')](socket);function respondWithStatusCode(_0xa6e29f,_0x93732c){_0x93732c=_0x93732c||0xcc;return function(_0x255332){if(_0x255332){return _0xa6e29f[_0x60fe('0x1e')](_0x93732c);}return _0xa6e29f[_0x60fe('0x1f')](_0x93732c)[_0x60fe('0x20')]();};}function respondWithResult(_0x225c3e,_0x55e897){_0x55e897=_0x55e897||0xc8;return function(_0x537b0e){if(_0x537b0e){return _0x225c3e[_0x60fe('0x1f')](_0x55e897)['json'](_0x537b0e);}};}function respondWithFilteredResult(_0x1c0b26,_0x13e080){return function(_0x265358){if(_0x265358){var _0x295511=_0x265358[_0x60fe('0x21')],_0x32773a=_0x13e080['offset'],_0xc1e173=_0x13e080[_0x60fe('0x22')]+_0x13e080[_0x60fe('0x23')],_0x149712;if(_0xc1e173>=_0x295511){_0xc1e173=_0x295511;_0x149712=0xc8;}else{_0x149712=0xce;}_0x1c0b26[_0x60fe('0x1f')](_0x149712);return _0x1c0b26[_0x60fe('0x24')]('Content-Range',_0x32773a+'-'+_0xc1e173+'/'+_0x295511)[_0x60fe('0x25')](_0x265358);}return null;};}function patchUpdates(_0x42dedd){return function(_0x493c74){try{jsonpatch[_0x60fe('0x26')](_0x493c74,_0x42dedd,!![]);}catch(_0x4b7461){return BPromise[_0x60fe('0x27')](_0x4b7461);}return _0x493c74[_0x60fe('0x28')]();};}function saveUpdates(_0x4e2b67,_0x2848f9){return function(_0x5ef07a){if(_0x5ef07a){return _0x5ef07a['update'](_0x4e2b67)[_0x60fe('0x29')](function(_0x364c55){return _0x364c55;});}return null;};}function removeEntity(_0x137108,_0x28f50e){return function(_0x2b9b61){if(_0x2b9b61){return _0x2b9b61[_0x60fe('0x2a')]()['then'](function(){_0x137108[_0x60fe('0x1f')](0xcc)[_0x60fe('0x20')]();});}};}function handleEntityNotFound(_0x2dfd1c,_0x3f6a18){return function(_0x16552a){if(!_0x16552a){_0x2dfd1c[_0x60fe('0x1e')](0x194);}return _0x16552a;};}function handleError(_0x5812ca,_0x2026e1){_0x2026e1=_0x2026e1||0x1f4;return function(_0x33c612){logger[_0x60fe('0x2b')](_0x33c612[_0x60fe('0x2c')]);if(_0x33c612[_0x60fe('0x2d')]){delete _0x33c612['name'];}_0x5812ca[_0x60fe('0x1f')](_0x2026e1)[_0x60fe('0x2e')](_0x33c612);};}exports['index']=function(_0x1ede12,_0x23537b){var _0x333c0c={},_0x325ab4={},_0x22e73c={'count':0x0,'rows':[]};var _0x3049bc=_['map'](db['ChatInternalMessage']['rawAttributes'],function(_0x33280a){return{'name':_0x33280a['fieldName'],'type':_0x33280a[_0x60fe('0x2f')][_0x60fe('0x30')]};});_0x325ab4[_0x60fe('0x31')]=_[_0x60fe('0x32')](_0x3049bc,_0x60fe('0x2d'));_0x325ab4[_0x60fe('0x33')]=_[_0x60fe('0x34')](_0x1ede12[_0x60fe('0x33')]);_0x325ab4[_0x60fe('0x35')]=_[_0x60fe('0x36')](_0x325ab4[_0x60fe('0x31')],_0x325ab4[_0x60fe('0x33')]);_0x333c0c['attributes']=_[_0x60fe('0x36')](_0x325ab4['model'],qs['fields'](_0x1ede12[_0x60fe('0x33')][_0x60fe('0x37')]));_0x333c0c['attributes']=_0x333c0c[_0x60fe('0x38')][_0x60fe('0x39')]?_0x333c0c[_0x60fe('0x38')]:_0x325ab4[_0x60fe('0x31')];if(!_0x1ede12[_0x60fe('0x33')]['hasOwnProperty'](_0x60fe('0x3a'))){_0x333c0c['limit']=qs['limit'](_0x1ede12[_0x60fe('0x33')]['limit']);_0x333c0c[_0x60fe('0x22')]=qs[_0x60fe('0x22')](_0x1ede12[_0x60fe('0x33')][_0x60fe('0x22')]);}_0x333c0c[_0x60fe('0x3b')]=qs[_0x60fe('0x3c')](_0x1ede12[_0x60fe('0x33')][_0x60fe('0x3c')]);_0x333c0c['where']=qs[_0x60fe('0x35')](_[_0x60fe('0x3d')](_0x1ede12[_0x60fe('0x33')],_0x325ab4['filters']),_0x3049bc);if(_0x1ede12['query'][_0x60fe('0x3e')]){_0x333c0c[_0x60fe('0x3f')]=_['merge'](_0x333c0c[_0x60fe('0x3f')],{'$or':_[_0x60fe('0x32')](_0x3049bc,function(_0x36196e){if(_0x36196e[_0x60fe('0x2f')]!==_0x60fe('0x40')){var _0x44d2b1={};_0x44d2b1[_0x36196e[_0x60fe('0x2d')]]={'$like':'%'+_0x1ede12[_0x60fe('0x33')][_0x60fe('0x3e')]+'%'};return _0x44d2b1;}})});}_0x333c0c=_['merge']({},_0x333c0c,_0x1ede12[_0x60fe('0x41')]);var _0x50ea40={'where':_0x333c0c['where']};return db[_0x60fe('0x42')][_0x60fe('0x21')](_0x50ea40)[_0x60fe('0x29')](function(_0x190aa8){_0x22e73c['count']=_0x190aa8;if(_0x1ede12[_0x60fe('0x33')][_0x60fe('0x43')]){_0x333c0c[_0x60fe('0x44')]=[{'all':!![]}];}return db[_0x60fe('0x42')][_0x60fe('0x45')](_0x333c0c);})[_0x60fe('0x29')](function(_0xfd7256){_0x22e73c['rows']=_0xfd7256;return _0x22e73c;})[_0x60fe('0x29')](respondWithFilteredResult(_0x23537b,_0x333c0c))['catch'](handleError(_0x23537b,null));};exports[_0x60fe('0x46')]=function(_0x31e132,_0x5bf308){var _0x31ad4b={'raw':!![],'where':{'id':_0x31e132[_0x60fe('0x47')]['id']}},_0x2819bc={};_0x2819bc[_0x60fe('0x31')]=_['keys'](db['ChatInternalMessage'][_0x60fe('0x48')]);_0x2819bc[_0x60fe('0x33')]=_[_0x60fe('0x34')](_0x31e132[_0x60fe('0x33')]);_0x2819bc[_0x60fe('0x35')]=_[_0x60fe('0x36')](_0x2819bc[_0x60fe('0x31')],_0x2819bc['query']);_0x31ad4b[_0x60fe('0x38')]=_[_0x60fe('0x36')](_0x2819bc[_0x60fe('0x31')],qs[_0x60fe('0x37')](_0x31e132[_0x60fe('0x33')][_0x60fe('0x37')]));_0x31ad4b[_0x60fe('0x38')]=_0x31ad4b[_0x60fe('0x38')][_0x60fe('0x39')]?_0x31ad4b[_0x60fe('0x38')]:_0x2819bc[_0x60fe('0x31')];if(_0x31e132[_0x60fe('0x33')][_0x60fe('0x43')]){_0x31ad4b['include']=[{'all':!![]}];}_0x31ad4b=_['merge']({},_0x31ad4b,_0x31e132[_0x60fe('0x41')]);return db[_0x60fe('0x42')][_0x60fe('0x49')](_0x31ad4b)['then'](handleEntityNotFound(_0x5bf308,null))[_0x60fe('0x29')](respondWithResult(_0x5bf308,null))[_0x60fe('0x4a')](handleError(_0x5bf308,null));};exports['create']=function(_0x4d1cac,_0x4361b0){return db[_0x60fe('0x42')][_0x60fe('0x4b')](_0x4d1cac[_0x60fe('0x4c')],{})[_0x60fe('0x29')](respondWithResult(_0x4361b0,0xc9))['catch'](handleError(_0x4361b0,null));};exports[_0x60fe('0x4d')]=function(_0x5491bd,_0x40ac6a){if(_0x5491bd[_0x60fe('0x4c')]['id']){delete _0x5491bd[_0x60fe('0x4c')]['id'];}return db[_0x60fe('0x42')]['find']({'where':{'id':_0x5491bd[_0x60fe('0x47')]['id']}})[_0x60fe('0x29')](handleEntityNotFound(_0x40ac6a,null))['then'](saveUpdates(_0x5491bd[_0x60fe('0x4c')],null))[_0x60fe('0x29')](respondWithResult(_0x40ac6a,null))[_0x60fe('0x4a')](handleError(_0x40ac6a,null));};exports[_0x60fe('0x2a')]=function(_0x46dc73,_0x59a13a){return db[_0x60fe('0x42')][_0x60fe('0x49')]({'where':{'id':_0x46dc73[_0x60fe('0x47')]['id']}})['then'](handleEntityNotFound(_0x59a13a,null))['then'](removeEntity(_0x59a13a,null))[_0x60fe('0x4a')](handleError(_0x59a13a,null));};exports['describe']=function(_0x47e1f0,_0x398ffe){return db['ChatInternalMessage']['describe']()[_0x60fe('0x29')](respondWithResult(_0x398ffe,null))[_0x60fe('0x4a')](handleError(_0x398ffe,null));};function wrapUser(_0x2ed69d){return function(_0x17cdd0){var _0x5c1653=_0x2ed69d[_0x60fe('0x4e')]({'plain':!![]});_0x5c1653['messages']=[];if(_0x17cdd0){_0x5c1653[_0x60fe('0x4f')]=_0x17cdd0[_0x60fe('0x50')];_0x5c1653[_0x60fe('0x51')]=_0x17cdd0;}else{_0x5c1653[_0x60fe('0x4f')]=moment(0x0)['format'](_0x60fe('0x52'));_0x5c1653[_0x60fe('0x51')]={};}return _0x5c1653;};}exports[_0x60fe('0x53')]=function(_0x561f93,_0x5693e0,_0x468aca){var _0x157717=[];return db['User']['findAll']({'where':{'role':['agent','admin',_0x60fe('0x54')]},'attributes':['id',_0x60fe('0x55'),'name',_0x60fe('0x56'),'userpic','internal','online',_0x60fe('0x57'),_0x60fe('0x58'),_0x60fe('0x59')],'order':qs[_0x60fe('0x3c')](_0x60fe('0x5a')),'include':[{'model':db[_0x60fe('0x5b')],'as':'VoiceQueues','attributes':['id',_0x60fe('0x2d'),_0x60fe('0x2f')],'through':{'attributes':[]}}]})[_0x60fe('0x29')](function(_0x24f9e9){if(_0x24f9e9){var _0x541ff7=_0x561f93['user'][_0x60fe('0x4e')]({'plain':!![]});if(!_0x541ff7)throw new Error(_0x60fe('0x5c'));if(_0x541ff7[_0x60fe('0x56')]===_0x60fe('0x54')){return db['UserProfileSection'][_0x60fe('0x49')]({'where':{'name':_0x60fe('0x5d'),'userProfileId':_0x541ff7[_0x60fe('0x5e')]},'raw':!![]})[_0x60fe('0x29')](function(_0x266d02){if(_0x266d02){if(_0x266d02[_0x60fe('0x5f')]===0x0){return db[_0x60fe('0x60')][_0x60fe('0x45')]({'where':{'sectionId':_0x266d02['id']},'raw':!![]})['then'](function(_0x56d095){var _0x373a37=[];if(_[_0x60fe('0x61')](_0x56d095)){_0x373a37=_[_0x60fe('0x3e')](_0x24f9e9,function(_0x3e134d){if(_0x3e134d[_0x60fe('0x56')]!==_0x60fe('0x62')){return _0x3e134d;}});return _0x373a37;}else{for(var _0x500a1d=0x0;_0x500a1d<_0x24f9e9[_0x60fe('0x39')];_0x500a1d++){var _0x3ebe2e=_0x24f9e9[_0x500a1d];if(_0x3ebe2e[_0x60fe('0x56')]===_0x60fe('0x62')){var _0x1c4bcc=_[_0x60fe('0x49')](_0x56d095,function(_0x1acf5c){return _0x1acf5c[_0x60fe('0x63')]===_0x3ebe2e['id'];});if(_0x1c4bcc)_0x373a37[_0x60fe('0x64')](_0x3ebe2e);}else{_0x373a37[_0x60fe('0x64')](_0x3ebe2e);}}return _0x373a37;}});}else{return _0x24f9e9;}}else{var _0x19fbfa=_[_0x60fe('0x3e')](_0x24f9e9,function(_0x105fee){if(_0x105fee[_0x60fe('0x56')]!==_0x60fe('0x62')){return _0x105fee;}});return _0x19fbfa;}});}else{return _0x24f9e9;}}})[_0x60fe('0x29')](function(_0x3df009){var _0x1e3d81=[];if(_0x3df009){_0x157717=_0x3df009;for(var _0x4f1840=0x0;_0x4f1840<_0x3df009[_0x60fe('0x39')];_0x4f1840+=0x1){_0x157717[_0x4f1840][_0x60fe('0x65')]=[];_0x1e3d81['push'](db[_0x60fe('0x42')]['find']({'where':{'FromId':[_0x561f93['user']['id'],_0x3df009[_0x4f1840]['id']],'ToId':[_0x561f93[_0x60fe('0x54')]['id'],_0x3df009[_0x4f1840]['id']],'ChatGroupId':null},'attributes':['id',_0x60fe('0x50'),'FromId',_0x60fe('0x66'),_0x60fe('0x67'),_0x60fe('0x4c')],'order':qs[_0x60fe('0x3c')](_0x60fe('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x60fe('0x29')](wrapUser(_0x3df009[_0x4f1840])));}return BPromise[_0x60fe('0x69')](_0x1e3d81);}return[];})['then'](function(_0x67ad76){return{'rows':_0x67ad76,'count':_0x67ad76[_0x60fe('0x39')]};})[_0x60fe('0x29')](respondWithResult(_0x5693e0,null))['catch'](handleError(_0x5693e0,null));};
\ No newline at end of file
+var _0x6c7b=['params','create','body','find','describe','get','messages','lastMessageAt','createdAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueues','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','resourceId','push','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','json','count','offset','limit','set','apply','save','update','stack','name','index','map','ChatInternalMessage','rawAttributes','type','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show'];(function(_0x4f9981,_0xacd7ab){var _0x1a93ee=function(_0x32455c){while(--_0x32455c){_0x4f9981['push'](_0x4f9981['shift']());}};_0x1a93ee(++_0xacd7ab);}(_0x6c7b,0x8d));var _0xb6c7=function(_0x5e6589,_0x3e261e){_0x5e6589=_0x5e6589-0x0;var _0x5769df=_0x6c7b[_0x5e6589];return _0x5769df;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb6c7('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb6c7('0x1'));var moment=require(_0xb6c7('0x2'));var BPromise=require(_0xb6c7('0x3'));var Mustache=require(_0xb6c7('0x4'));var util=require(_0xb6c7('0x5'));var path=require(_0xb6c7('0x6'));var sox=require(_0xb6c7('0x7'));var csv=require(_0xb6c7('0x8'));var ejs=require(_0xb6c7('0x9'));var fs=require('fs');var fs_extra=require(_0xb6c7('0xa'));var _=require(_0xb6c7('0xb'));var squel=require(_0xb6c7('0xc'));var crypto=require(_0xb6c7('0xd'));var jsforce=require(_0xb6c7('0xe'));var deskjs=require(_0xb6c7('0xf'));var toCsv=require(_0xb6c7('0x8'));var querystring=require(_0xb6c7('0x10'));var Papa=require(_0xb6c7('0x11'));var Redis=require(_0xb6c7('0x12'));var authService=require(_0xb6c7('0x13'));var qs=require(_0xb6c7('0x14'));var as=require(_0xb6c7('0x15'));var hardwareService=require(_0xb6c7('0x16'));var logger=require(_0xb6c7('0x17'))(_0xb6c7('0x18'));var utils=require(_0xb6c7('0x19'));var config=require(_0xb6c7('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xb6c7('0x1b'))['db'];config[_0xb6c7('0x1c')]=_[_0xb6c7('0x1d')](config[_0xb6c7('0x1c')],{'host':_0xb6c7('0x1e'),'port':0x18eb});var socket=require(_0xb6c7('0x1f'))(new Redis(config['redis']));require(_0xb6c7('0x20'))[_0xb6c7('0x21')](socket);function respondWithStatusCode(_0x505e3b,_0xc5805b){_0xc5805b=_0xc5805b||0xcc;return function(_0x26828e){if(_0x26828e){return _0x505e3b[_0xb6c7('0x22')](_0xc5805b);}return _0x505e3b['status'](_0xc5805b)[_0xb6c7('0x23')]();};}function respondWithResult(_0x4d188f,_0x403ac7){_0x403ac7=_0x403ac7||0xc8;return function(_0x4f2ee6){if(_0x4f2ee6){return _0x4d188f[_0xb6c7('0x24')](_0x403ac7)[_0xb6c7('0x25')](_0x4f2ee6);}};}function respondWithFilteredResult(_0x57d42f,_0x27d910){return function(_0xe4b95d){if(_0xe4b95d){var _0x3f04af=_0xe4b95d[_0xb6c7('0x26')],_0x2d9561=_0x27d910[_0xb6c7('0x27')],_0x7a1148=_0x27d910['offset']+_0x27d910[_0xb6c7('0x28')],_0x4c4388;if(_0x7a1148>=_0x3f04af){_0x7a1148=_0x3f04af;_0x4c4388=0xc8;}else{_0x4c4388=0xce;}_0x57d42f[_0xb6c7('0x24')](_0x4c4388);return _0x57d42f[_0xb6c7('0x29')]('Content-Range',_0x2d9561+'-'+_0x7a1148+'/'+_0x3f04af)[_0xb6c7('0x25')](_0xe4b95d);}return null;};}function patchUpdates(_0x23cce2){return function(_0x189e50){try{jsonpatch[_0xb6c7('0x2a')](_0x189e50,_0x23cce2,!![]);}catch(_0x1ce53f){return BPromise['reject'](_0x1ce53f);}return _0x189e50[_0xb6c7('0x2b')]();};}function saveUpdates(_0x4693b8,_0x59e6d3){return function(_0x5cfb7e){if(_0x5cfb7e){return _0x5cfb7e[_0xb6c7('0x2c')](_0x4693b8)['then'](function(_0xa5c863){return _0xa5c863;});}return null;};}function removeEntity(_0x32f6d4,_0x4ff334){return function(_0x5ebc05){if(_0x5ebc05){return _0x5ebc05['destroy']()['then'](function(){_0x32f6d4['status'](0xcc)[_0xb6c7('0x23')]();});}};}function handleEntityNotFound(_0x1a0003,_0x79a0ba){return function(_0x4f861d){if(!_0x4f861d){_0x1a0003[_0xb6c7('0x22')](0x194);}return _0x4f861d;};}function handleError(_0x2a51be,_0x72e41a){_0x72e41a=_0x72e41a||0x1f4;return function(_0x501aa8){logger['error'](_0x501aa8[_0xb6c7('0x2d')]);if(_0x501aa8[_0xb6c7('0x2e')]){delete _0x501aa8[_0xb6c7('0x2e')];}_0x2a51be[_0xb6c7('0x24')](_0x72e41a)['send'](_0x501aa8);};}exports[_0xb6c7('0x2f')]=function(_0x402a61,_0x43a36a){var _0x38ce36={},_0x6641f5={},_0x5cb96b={'count':0x0,'rows':[]};var _0x581ae4=_[_0xb6c7('0x30')](db[_0xb6c7('0x31')][_0xb6c7('0x32')],function(_0x67ab3b){return{'name':_0x67ab3b['fieldName'],'type':_0x67ab3b[_0xb6c7('0x33')][_0xb6c7('0x34')]};});_0x6641f5['model']=_['map'](_0x581ae4,'name');_0x6641f5['query']=_[_0xb6c7('0x35')](_0x402a61[_0xb6c7('0x36')]);_0x6641f5[_0xb6c7('0x37')]=_[_0xb6c7('0x38')](_0x6641f5['model'],_0x6641f5[_0xb6c7('0x36')]);_0x38ce36[_0xb6c7('0x39')]=_[_0xb6c7('0x38')](_0x6641f5[_0xb6c7('0x3a')],qs['fields'](_0x402a61[_0xb6c7('0x36')][_0xb6c7('0x3b')]));_0x38ce36[_0xb6c7('0x39')]=_0x38ce36[_0xb6c7('0x39')][_0xb6c7('0x3c')]?_0x38ce36['attributes']:_0x6641f5[_0xb6c7('0x3a')];if(!_0x402a61['query'][_0xb6c7('0x3d')]('nolimit')){_0x38ce36['limit']=qs[_0xb6c7('0x28')](_0x402a61[_0xb6c7('0x36')][_0xb6c7('0x28')]);_0x38ce36['offset']=qs[_0xb6c7('0x27')](_0x402a61[_0xb6c7('0x36')]['offset']);}_0x38ce36[_0xb6c7('0x3e')]=qs[_0xb6c7('0x3f')](_0x402a61[_0xb6c7('0x36')][_0xb6c7('0x3f')]);_0x38ce36[_0xb6c7('0x40')]=qs[_0xb6c7('0x37')](_[_0xb6c7('0x41')](_0x402a61[_0xb6c7('0x36')],_0x6641f5['filters']),_0x581ae4);if(_0x402a61['query'][_0xb6c7('0x42')]){_0x38ce36[_0xb6c7('0x40')]=_[_0xb6c7('0x43')](_0x38ce36[_0xb6c7('0x40')],{'$or':_[_0xb6c7('0x30')](_0x581ae4,function(_0x508974){if(_0x508974[_0xb6c7('0x33')]!==_0xb6c7('0x44')){var _0x3395b2={};_0x3395b2[_0x508974[_0xb6c7('0x2e')]]={'$like':'%'+_0x402a61[_0xb6c7('0x36')]['filter']+'%'};return _0x3395b2;}})});}_0x38ce36=_['merge']({},_0x38ce36,_0x402a61[_0xb6c7('0x45')]);var _0x47fe44={'where':_0x38ce36[_0xb6c7('0x40')]};return db['ChatInternalMessage'][_0xb6c7('0x26')](_0x47fe44)[_0xb6c7('0x46')](function(_0x3ba679){_0x5cb96b[_0xb6c7('0x26')]=_0x3ba679;if(_0x402a61[_0xb6c7('0x36')][_0xb6c7('0x47')]){_0x38ce36[_0xb6c7('0x48')]=[{'all':!![]}];}return db[_0xb6c7('0x31')][_0xb6c7('0x49')](_0x38ce36);})[_0xb6c7('0x46')](function(_0x934431){_0x5cb96b[_0xb6c7('0x4a')]=_0x934431;return _0x5cb96b;})[_0xb6c7('0x46')](respondWithFilteredResult(_0x43a36a,_0x38ce36))[_0xb6c7('0x4b')](handleError(_0x43a36a,null));};exports[_0xb6c7('0x4c')]=function(_0x4f2544,_0x5ea4f8){var _0x2d7a82={'raw':!![],'where':{'id':_0x4f2544[_0xb6c7('0x4d')]['id']}},_0x5ab142={};_0x5ab142[_0xb6c7('0x3a')]=_['keys'](db['ChatInternalMessage'][_0xb6c7('0x32')]);_0x5ab142['query']=_[_0xb6c7('0x35')](_0x4f2544['query']);_0x5ab142[_0xb6c7('0x37')]=_[_0xb6c7('0x38')](_0x5ab142['model'],_0x5ab142[_0xb6c7('0x36')]);_0x2d7a82['attributes']=_[_0xb6c7('0x38')](_0x5ab142[_0xb6c7('0x3a')],qs[_0xb6c7('0x3b')](_0x4f2544[_0xb6c7('0x36')][_0xb6c7('0x3b')]));_0x2d7a82[_0xb6c7('0x39')]=_0x2d7a82['attributes'][_0xb6c7('0x3c')]?_0x2d7a82['attributes']:_0x5ab142[_0xb6c7('0x3a')];if(_0x4f2544[_0xb6c7('0x36')][_0xb6c7('0x47')]){_0x2d7a82[_0xb6c7('0x48')]=[{'all':!![]}];}_0x2d7a82=_['merge']({},_0x2d7a82,_0x4f2544['options']);return db[_0xb6c7('0x31')]['find'](_0x2d7a82)[_0xb6c7('0x46')](handleEntityNotFound(_0x5ea4f8,null))[_0xb6c7('0x46')](respondWithResult(_0x5ea4f8,null))['catch'](handleError(_0x5ea4f8,null));};exports[_0xb6c7('0x4e')]=function(_0x3d0189,_0x4c2b7b){return db[_0xb6c7('0x31')][_0xb6c7('0x4e')](_0x3d0189['body'],{})['then'](respondWithResult(_0x4c2b7b,0xc9))[_0xb6c7('0x4b')](handleError(_0x4c2b7b,null));};exports[_0xb6c7('0x2c')]=function(_0x894387,_0x298405){if(_0x894387['body']['id']){delete _0x894387[_0xb6c7('0x4f')]['id'];}return db[_0xb6c7('0x31')][_0xb6c7('0x50')]({'where':{'id':_0x894387[_0xb6c7('0x4d')]['id']}})[_0xb6c7('0x46')](handleEntityNotFound(_0x298405,null))['then'](saveUpdates(_0x894387[_0xb6c7('0x4f')],null))[_0xb6c7('0x46')](respondWithResult(_0x298405,null))[_0xb6c7('0x4b')](handleError(_0x298405,null));};exports['destroy']=function(_0x25d65b,_0x22c5b4){return db[_0xb6c7('0x31')][_0xb6c7('0x50')]({'where':{'id':_0x25d65b['params']['id']}})[_0xb6c7('0x46')](handleEntityNotFound(_0x22c5b4,null))[_0xb6c7('0x46')](removeEntity(_0x22c5b4,null))[_0xb6c7('0x4b')](handleError(_0x22c5b4,null));};exports[_0xb6c7('0x51')]=function(_0x1aa32d,_0x4aa479){return db[_0xb6c7('0x31')]['describe']()[_0xb6c7('0x46')](respondWithResult(_0x4aa479,null))['catch'](handleError(_0x4aa479,null));};function wrapUser(_0x33f981){return function(_0x3d09c4){var _0x1c8b91=_0x33f981[_0xb6c7('0x52')]({'plain':!![]});_0x1c8b91[_0xb6c7('0x53')]=[];if(_0x3d09c4){_0x1c8b91[_0xb6c7('0x54')]=_0x3d09c4[_0xb6c7('0x55')];_0x1c8b91['lastMessage']=_0x3d09c4;}else{_0x1c8b91[_0xb6c7('0x54')]=moment(0x0)['format'](_0xb6c7('0x56'));_0x1c8b91[_0xb6c7('0x57')]={};}return _0x1c8b91;};}exports[_0xb6c7('0x58')]=function(_0x5494cf,_0x2b8684,_0x547fec){var _0x11524e=[];return db[_0xb6c7('0x59')][_0xb6c7('0x49')]({'where':{'role':[_0xb6c7('0x5a'),_0xb6c7('0x5b'),_0xb6c7('0x5c')]},'attributes':['id',_0xb6c7('0x5d'),_0xb6c7('0x2e'),_0xb6c7('0x5e'),_0xb6c7('0x5f'),_0xb6c7('0x60'),_0xb6c7('0x61'),_0xb6c7('0x62'),_0xb6c7('0x63'),_0xb6c7('0x64')],'order':qs[_0xb6c7('0x3f')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0xb6c7('0x65'),'attributes':['id',_0xb6c7('0x2e'),_0xb6c7('0x33')],'through':{'attributes':[]}}]})[_0xb6c7('0x46')](function(_0x12dd4f){if(_0x12dd4f){var _0x4f4f93=_0x5494cf['user']['get']({'plain':!![]});if(!_0x4f4f93)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f4f93['role']===_0xb6c7('0x5c')){return db[_0xb6c7('0x66')][_0xb6c7('0x50')]({'where':{'name':_0xb6c7('0x67'),'userProfileId':_0x4f4f93[_0xb6c7('0x68')]},'raw':!![]})[_0xb6c7('0x46')](function(_0x31cc5b){if(_0x31cc5b){if(_0x31cc5b[_0xb6c7('0x69')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x31cc5b['id']},'raw':!![]})[_0xb6c7('0x46')](function(_0xaf4e0b){var _0x2674f=[];if(_[_0xb6c7('0x6a')](_0xaf4e0b)){_0x2674f=_[_0xb6c7('0x42')](_0x12dd4f,function(_0x1aa2f0){if(_0x1aa2f0[_0xb6c7('0x5e')]!==_0xb6c7('0x5a')){return _0x1aa2f0;}});return _0x2674f;}else{for(var _0x2804bc=0x0;_0x2804bc<_0x12dd4f[_0xb6c7('0x3c')];_0x2804bc++){var _0x213533=_0x12dd4f[_0x2804bc];if(_0x213533['role']===_0xb6c7('0x5a')){var _0x121161=_['find'](_0xaf4e0b,function(_0x10e459){return _0x10e459[_0xb6c7('0x6b')]===_0x213533['id'];});if(_0x121161)_0x2674f['push'](_0x213533);}else{_0x2674f[_0xb6c7('0x6c')](_0x213533);}}return _0x2674f;}});}else{return _0x12dd4f;}}else{var _0x4ff436=_['filter'](_0x12dd4f,function(_0x20fcc0){if(_0x20fcc0[_0xb6c7('0x5e')]!==_0xb6c7('0x5a')){return _0x20fcc0;}});return _0x4ff436;}});}else{return _0x12dd4f;}}})[_0xb6c7('0x46')](function(_0x3ce748){var _0x453100=[];if(_0x3ce748){_0x11524e=_0x3ce748;for(var _0x1d5a02=0x0;_0x1d5a02<_0x3ce748['length'];_0x1d5a02+=0x1){_0x11524e[_0x1d5a02][_0xb6c7('0x53')]=[];_0x453100[_0xb6c7('0x6c')](db[_0xb6c7('0x31')][_0xb6c7('0x50')]({'where':{'FromId':[_0x5494cf[_0xb6c7('0x5c')]['id'],_0x3ce748[_0x1d5a02]['id']],'ToId':[_0x5494cf[_0xb6c7('0x5c')]['id'],_0x3ce748[_0x1d5a02]['id']],'ChatGroupId':null},'attributes':['id',_0xb6c7('0x55'),'FromId','ToId','read',_0xb6c7('0x4f')],'order':qs[_0xb6c7('0x3f')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xb6c7('0x46')](wrapUser(_0x3ce748[_0x1d5a02])));}return BPromise['all'](_0x453100);}return[];})[_0xb6c7('0x46')](function(_0x4f78f4){return{'rows':_0x4f78f4,'count':_0x4f78f4['length']};})[_0xb6c7('0x46')](respondWithResult(_0x2b8684,null))['catch'](handleError(_0x2b8684,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 3bdb56a..991e381 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 _0xaf40=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x4624c4,_0x2620c9){var _0x3c0d60=function(_0x18abbe){while(--_0x18abbe){_0x4624c4['push'](_0x4624c4['shift']());}};_0x3c0d60(++_0x2620c9);}(_0xaf40,0x75));var _0x0af4=function(_0x182e7b,_0x4f6d8b){_0x182e7b=_0x182e7b-0x0;var _0x2f39db=_0xaf40[_0x182e7b];return _0x2f39db;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x0af4('0x0'))['db'][_0x0af4('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0af4('0x2')](0x0);var events={'afterCreate':_0x0af4('0x3'),'afterUpdate':_0x0af4('0x4'),'afterDestroy':_0x0af4('0x5')};function emitEvent(_0x2e367a){return function(_0x35be09,_0x18ca82,_0x2b432d){ChatInternalMessageEvents[_0x0af4('0x6')](_0x2e367a+':'+_0x35be09['id'],_0x35be09);ChatInternalMessageEvents[_0x0af4('0x6')](_0x2e367a,_0x35be09);_0x2b432d(null);};}for(var e in events){if(events[_0x0af4('0x7')](e)){var event=events[e];ChatInternalMessage[_0x0af4('0x8')](e,emitEvent(event));}}module[_0x0af4('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x27a8=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','ChatInternalMessage'];(function(_0x71db89,_0x57632){var _0x181bc5=function(_0x5a4faa){while(--_0x5a4faa){_0x71db89['push'](_0x71db89['shift']());}};_0x181bc5(++_0x57632);}(_0x27a8,0x170));var _0x827a=function(_0x48c2f4,_0x531033){_0x48c2f4=_0x48c2f4-0x0;var _0x258e2a=_0x27a8[_0x48c2f4];return _0x258e2a;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x827a('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x827a('0x1')](0x0);var events={'afterCreate':_0x827a('0x2'),'afterUpdate':_0x827a('0x3'),'afterDestroy':_0x827a('0x4')};function emitEvent(_0x300907){return function(_0x18cf5e,_0x215b35,_0x2b3486){ChatInternalMessageEvents[_0x827a('0x5')](_0x300907+':'+_0x18cf5e['id'],_0x18cf5e);ChatInternalMessageEvents[_0x827a('0x5')](_0x300907,_0x18cf5e);_0x2b3486(null);};}for(var e in events){if(events[_0x827a('0x6')](e)){var event=events[e];ChatInternalMessage[_0x827a('0x7')](e,emitEvent(event));}}module[_0x827a('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index a9ddbef..533de05 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 _0xbaf0=['define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports'];(function(_0x354df8,_0x3d996e){var _0x5cf17b=function(_0x482ac9){while(--_0x482ac9){_0x354df8['push'](_0x354df8['shift']());}};_0x5cf17b(++_0x3d996e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'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':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0baf('0xd')});};
\ No newline at end of file
+var _0xaa88=['chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage'];(function(_0x43357f,_0x305c29){var _0x464c70=function(_0x408c20){while(--_0x408c20){_0x43357f['push'](_0x43357f['shift']());}};_0x464c70(++_0x305c29);}(_0xaa88,0x137));var _0x8aa8=function(_0x5c2a2b,_0x22c94e){_0x5c2a2b=_0x5c2a2b-0x0;var _0x19921f=_0xaa88[_0x5c2a2b];return _0x19921f;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var moment=require('moment');var BPromise=require(_0x8aa8('0x4'));var rp=require(_0x8aa8('0x5'));var fs=require('fs');var path=require(_0x8aa8('0x6'));var rimraf=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var attributes=require(_0x8aa8('0x9'));module['exports']=function(_0x5bda0d,_0x460042){return _0x5bda0d['define'](_0x8aa8('0xa'),attributes,{'tableName':_0x8aa8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8aa8('0xc'),'collate':_0x8aa8('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index eba6e1d..6d908b3 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 _0x8f09=['client','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','request','then','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','info','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x2124e0,_0x165568){var _0xde3e29=function(_0x30ad4f){while(--_0x30ad4f){_0x2124e0['push'](_0x2124e0['shift']());}};_0xde3e29(++_0x165568);}(_0x8f09,0x9a));var _0x98f0=function(_0x10bb03,_0xd0e5e8){_0x10bb03=_0x10bb03-0x0;var _0x54bf21=_0x8f09[_0x10bb03];return _0x54bf21;};'use strict';var _=require(_0x98f0('0x0'));var util=require('util');var moment=require(_0x98f0('0x1'));var BPromise=require(_0x98f0('0x2'));var rs=require(_0x98f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x98f0('0x4'))['db'];var utils=require(_0x98f0('0x5'));var logger=require(_0x98f0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x98f0('0x7'));var client=jayson[_0x98f0('0x8')][_0x98f0('0x9')]({'port':0x232a});config[_0x98f0('0xa')]=_[_0x98f0('0xb')](config[_0x98f0('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x98f0('0xc'))(new Redis(config['redis']));require(_0x98f0('0xd'))[_0x98f0('0xe')](socket);function respondWithRpcPromise(_0x261890,_0x372f4f,_0x18ea09){return new BPromise(function(_0x1d7716,_0x327633){return client[_0x98f0('0xf')](_0x261890,_0x18ea09)[_0x98f0('0x10')](function(_0x470a8f){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x372f4f,'request\x20sent');logger[_0x98f0('0x11')](_0x98f0('0x12'),_0x372f4f,_0x98f0('0x13'),JSON[_0x98f0('0x14')](_0x470a8f));if(_0x470a8f[_0x98f0('0x15')]){if(_0x470a8f[_0x98f0('0x15')][_0x98f0('0x16')]===0x1f4){logger[_0x98f0('0x15')](_0x98f0('0x17'),_0x372f4f,_0x470a8f[_0x98f0('0x15')][_0x98f0('0x18')]);return _0x327633(_0x470a8f[_0x98f0('0x15')][_0x98f0('0x18')]);}logger[_0x98f0('0x15')](_0x98f0('0x17'),_0x372f4f,_0x470a8f[_0x98f0('0x15')][_0x98f0('0x18')]);return _0x1d7716(_0x470a8f[_0x98f0('0x15')]['message']);}else{logger[_0x98f0('0x19')](_0x98f0('0x17'),_0x372f4f,_0x98f0('0x13'));_0x1d7716(_0x470a8f[_0x98f0('0x1a')][_0x98f0('0x18')]);}})['catch'](function(_0x4f4f2c){logger[_0x98f0('0x15')](_0x98f0('0x17'),_0x372f4f,_0x4f4f2c);_0x327633(_0x4f4f2c);});});}
\ No newline at end of file
+var _0xebb2=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0xb26ec4,_0x34f43d){var _0x572b66=function(_0x3eeab2){while(--_0x3eeab2){_0xb26ec4['push'](_0xb26ec4['shift']());}};_0x572b66(++_0x34f43d);}(_0xebb2,0x19d));var _0x2ebb=function(_0x30b816,_0x2f4650){_0x30b816=_0x30b816-0x0;var _0x14e76c=_0xebb2[_0x30b816];return _0x14e76c;};'use strict';var _=require(_0x2ebb('0x0'));var util=require(_0x2ebb('0x1'));var moment=require(_0x2ebb('0x2'));var BPromise=require(_0x2ebb('0x3'));var rs=require(_0x2ebb('0x4'));var fs=require('fs');var Redis=require(_0x2ebb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2ebb('0x6'));var logger=require(_0x2ebb('0x7'))('rpc');var config=require(_0x2ebb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2ebb('0x9')]['http']({'port':0x232a});config[_0x2ebb('0xa')]=_[_0x2ebb('0xb')](config[_0x2ebb('0xa')],{'host':_0x2ebb('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2ebb('0xd'))['register'](socket);function respondWithRpcPromise(_0x40efbf,_0x5e6aff,_0x1011c6){return new BPromise(function(_0x41bb01,_0x34b0ab){return client[_0x2ebb('0xe')](_0x40efbf,_0x1011c6)[_0x2ebb('0xf')](function(_0x26ef15){logger[_0x2ebb('0x10')](_0x2ebb('0x11'),_0x5e6aff,_0x2ebb('0x12'));logger[_0x2ebb('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x5e6aff,'request\x20sent',JSON[_0x2ebb('0x14')](_0x26ef15));if(_0x26ef15['error']){if(_0x26ef15[_0x2ebb('0x15')][_0x2ebb('0x16')]===0x1f4){logger[_0x2ebb('0x15')](_0x2ebb('0x11'),_0x5e6aff,_0x26ef15[_0x2ebb('0x15')][_0x2ebb('0x17')]);return _0x34b0ab(_0x26ef15[_0x2ebb('0x15')][_0x2ebb('0x17')]);}logger[_0x2ebb('0x15')](_0x2ebb('0x11'),_0x5e6aff,_0x26ef15[_0x2ebb('0x15')]['message']);return _0x41bb01(_0x26ef15[_0x2ebb('0x15')][_0x2ebb('0x17')]);}else{logger[_0x2ebb('0x10')](_0x2ebb('0x11'),_0x5e6aff,_0x2ebb('0x12'));_0x41bb01(_0x26ef15[_0x2ebb('0x18')][_0x2ebb('0x17')]);}})[_0x2ebb('0x19')](function(_0x3a827e){logger[_0x2ebb('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x5e6aff,_0x3a827e);_0x34b0ab(_0x3a827e);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 7d96f24..d7f05da 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 _0xd2ce=['length','save','update','emit','register'];(function(_0x1ad9b4,_0x5df9ed){var _0xbbee74=function(_0x39c75f){while(--_0x39c75f){_0x1ad9b4['push'](_0x1ad9b4['shift']());}};_0xbbee74(++_0x5df9ed);}(_0xd2ce,0x13c));var _0xed2c=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xd2ce[_0x4baae2];return _0x1a2285;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xed2c('0x0'),'remove',_0xed2c('0x1')];function createListener(_0x271df9,_0x100271){return function(_0x1e3c07){_0x100271[_0xed2c('0x2')](_0x271df9,_0x1e3c07);};}function removeListener(_0x2fe29b,_0x418d1c){return function(){ChatInternalMessageEvents['removeListener'](_0x2fe29b,_0x418d1c);};}exports[_0xed2c('0x3')]=function(_0x5b6ccb){for(var _0x38aa25=0x0,_0x24cd4f=events[_0xed2c('0x4')];_0x38aa25<_0x24cd4f;_0x38aa25++){var _0x523fb0=events[_0x38aa25];var _0x255320=createListener('chatInternalMessage:'+_0x523fb0,_0x5b6ccb);ChatInternalMessageEvents['on'](_0x523fb0,_0x255320);}};
\ No newline at end of file
+var _0xbc17=['./chatInternalMessage.events','save','update','emit','removeListener','length','chatInternalMessage:'];(function(_0x36a907,_0x53da75){var _0x2f0962=function(_0x464677){while(--_0x464677){_0x36a907['push'](_0x36a907['shift']());}};_0x2f0962(++_0x53da75);}(_0xbc17,0x1ab));var _0x7bc1=function(_0x578a80,_0x412698){_0x578a80=_0x578a80-0x0;var _0x4b4ba8=_0xbc17[_0x578a80];return _0x4b4ba8;};'use strict';var ChatInternalMessageEvents=require(_0x7bc1('0x0'));var events=[_0x7bc1('0x1'),'remove',_0x7bc1('0x2')];function createListener(_0xa0421d,_0x5185e7){return function(_0x4b1479){_0x5185e7[_0x7bc1('0x3')](_0xa0421d,_0x4b1479);};}function removeListener(_0x7aa41e,_0x5dfaa8){return function(){ChatInternalMessageEvents[_0x7bc1('0x4')](_0x7aa41e,_0x5dfaa8);};}exports['register']=function(_0xba4fa8){for(var _0xcecb62=0x0,_0x1b720f=events[_0x7bc1('0x5')];_0xcecb62<_0x1b720f;_0xcecb62++){var _0x3fdce7=events[_0xcecb62];var _0x351340=createListener(_0x7bc1('0x6')+_0x3fdce7,_0xba4fa8);ChatInternalMessageEvents['on'](_0x3fdce7,_0x351340);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 3c32ba4..7be5efa 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 _0xacd6=['get','index','/describe','isAuthenticated','describe','/users','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller'];(function(_0x5a5cfb,_0x37ed01){var _0x334936=function(_0x344895){while(--_0x344895){_0x5a5cfb['push'](_0x5a5cfb['shift']());}};_0x334936(++_0x37ed01);}(_0xacd6,0xef));var _0x6acd=function(_0x680821,_0x23e67f){_0x680821=_0x680821-0x0;var _0x3f132c=_0xacd6[_0x680821];return _0x3f132c;};'use strict';var multer=require(_0x6acd('0x0'));var util=require(_0x6acd('0x1'));var path=require(_0x6acd('0x2'));var timeout=require(_0x6acd('0x3'));var express=require(_0x6acd('0x4'));var router=express[_0x6acd('0x5')]();var fs_extra=require(_0x6acd('0x6'));var auth=require(_0x6acd('0x7'));var interaction=require(_0x6acd('0x8'));var config=require(_0x6acd('0x9'));var controller=require(_0x6acd('0xa'));router[_0x6acd('0xb')]('/',auth['isAuthenticated'](),controller[_0x6acd('0xc')]);router[_0x6acd('0xb')](_0x6acd('0xd'),auth[_0x6acd('0xe')](),controller[_0x6acd('0xf')]);router[_0x6acd('0xb')](_0x6acd('0x10'),auth[_0x6acd('0xe')](),controller['getUsers']);router[_0x6acd('0xb')](_0x6acd('0x11'),auth[_0x6acd('0xe')](),controller[_0x6acd('0x12')]);router[_0x6acd('0x13')]('/',auth[_0x6acd('0xe')](),controller[_0x6acd('0x14')]);router['put']('/:id',controller[_0x6acd('0x15')]);router[_0x6acd('0x16')](_0x6acd('0x11'),auth['isAuthenticated'](),controller[_0x6acd('0x17')]);module[_0x6acd('0x18')]=router;
\ No newline at end of file
+var _0xbce7=['connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','index','get','isAuthenticated','/users','getUsers','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x441c2b,_0x55b78d){var _0x2ec518=function(_0x343917){while(--_0x343917){_0x441c2b['push'](_0x441c2b['shift']());}};_0x2ec518(++_0x55b78d);}(_0xbce7,0x163));var _0x7bce=function(_0x20255b,_0x52aa07){_0x20255b=_0x20255b-0x0;var _0x81fe0a=_0xbce7[_0x20255b];return _0x81fe0a;};'use strict';var multer=require(_0x7bce('0x0'));var util=require(_0x7bce('0x1'));var path=require('path');var timeout=require(_0x7bce('0x2'));var express=require('express');var router=express[_0x7bce('0x3')]();var fs_extra=require(_0x7bce('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7bce('0x5'));var config=require(_0x7bce('0x6'));var controller=require(_0x7bce('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bce('0x8')]);router[_0x7bce('0x9')]('/describe',auth[_0x7bce('0xa')](),controller['describe']);router[_0x7bce('0x9')](_0x7bce('0xb'),auth['isAuthenticated'](),controller[_0x7bce('0xc')]);router[_0x7bce('0x9')](_0x7bce('0xd'),auth[_0x7bce('0xa')](),controller[_0x7bce('0xe')]);router[_0x7bce('0xf')]('/',auth[_0x7bce('0xa')](),controller[_0x7bce('0x10')]);router[_0x7bce('0x11')]('/:id',controller[_0x7bce('0x12')]);router[_0x7bce('0x13')](_0x7bce('0xd'),auth[_0x7bce('0xa')](),controller[_0x7bce('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 6ef6b3f..eb6d6a4 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 _0xcd53=['out','DATE','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0xb68772,_0x5253ac){var _0x4189bb=function(_0x1b0cf3){while(--_0x1b0cf3){_0xb68772['push'](_0xb68772['shift']());}};_0x4189bb(++_0x5253ac);}(_0xcd53,0x6b));var _0x3cd5=function(_0x30cc1a,_0x162bbc){_0x30cc1a=_0x30cc1a-0x0;var _0xb3f18f=_0xcd53[_0x30cc1a];return _0xb3f18f;};'use strict';var Sequelize=require('sequelize');module[_0x3cd5('0x0')]={'body':{'type':Sequelize[_0x3cd5('0x1')](_0x3cd5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3cd5('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3cd5('0x4')]('in',_0x3cd5('0x5')),'defaultValue':_0x3cd5('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3cd5('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x9772=['TEXT','medium','BOOLEAN','ENUM','out','DATE','exports'];(function(_0x2726ad,_0x5073b1){var _0xd87993=function(_0x1cb35b){while(--_0x1cb35b){_0x2726ad['push'](_0x2726ad['shift']());}};_0xd87993(++_0x5073b1);}(_0x9772,0xbc));var _0x2977=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x9772[_0x4ae6ef];return _0x3cbb4e;};'use strict';var Sequelize=require('sequelize');module[_0x2977('0x0')]={'body':{'type':Sequelize[_0x2977('0x1')](_0x2977('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2977('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x2977('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2977('0x4')]('in','out'),'defaultValue':_0x2977('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2977('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index fd4e95f..8c866be 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 _0x84be=['hasOwnProperty','nolimit','limit','offset','order','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','length','find','create','body','describe','../../config/logger','chat-interactions','accept','chat','read','format','UserId','user','agent','CmContact','Contact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','role','acceptMessage','manual','interface','channel','event','EventManager','acceptmessage','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SIP/%s','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','client','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','count','set','Content-Range','json','apply','save','update','then','destroy','stack','name','send','map','ChatMessage','fieldName','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x4ad762,_0x3e7464){var _0x56f931=function(_0x1a6c40){while(--_0x1a6c40){_0x4ad762['push'](_0x4ad762['shift']());}};_0x56f931(++_0x3e7464);}(_0x84be,0x138));var _0xe84b=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x84be[_0x4fc9e6];return _0x551d28;};'use strict';var pdf=require(_0xe84b('0x0'));var emlformat=require(_0xe84b('0x1'));var rimraf=require(_0xe84b('0x2'));var zipdir=require(_0xe84b('0x3'));var jsonpatch=require(_0xe84b('0x4'));var rp=require(_0xe84b('0x5'));var moment=require(_0xe84b('0x6'));var BPromise=require(_0xe84b('0x7'));var Mustache=require('mustache');var util=require(_0xe84b('0x8'));var path=require(_0xe84b('0x9'));var sox=require('sox');var csv=require(_0xe84b('0xa'));var ejs=require(_0xe84b('0xb'));var fs=require('fs');var fs_extra=require(_0xe84b('0xc'));var _=require('lodash');var squel=require(_0xe84b('0xd'));var crypto=require('crypto');var jsforce=require(_0xe84b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe84b('0xa'));var querystring=require(_0xe84b('0xf'));var Papa=require(_0xe84b('0x10'));var Redis=require(_0xe84b('0x11'));var authService=require(_0xe84b('0x12'));var qs=require(_0xe84b('0x13'));var as=require(_0xe84b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe84b('0x15'));var utils=require(_0xe84b('0x16'));var config=require(_0xe84b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe84b('0x18'))['db'];config[_0xe84b('0x19')]=_[_0xe84b('0x1a')](config['redis'],{'host':_0xe84b('0x1b'),'port':0x18eb});var socket=require(_0xe84b('0x1c'))(new Redis(config[_0xe84b('0x19')]));require(_0xe84b('0x1d'))[_0xe84b('0x1e')](socket);var jayson=require(_0xe84b('0x1f'));var client=jayson['client'][_0xe84b('0x20')]({'port':0x232c});var client9002=jayson[_0xe84b('0x21')][_0xe84b('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1804bd,_0xc534c7,_0x2e33e2,_0x37c0a6){return new BPromise(function(_0x51f35d,_0x3b61f2){var _0xe585b6=_0x37c0a6||client;return _0xe585b6[_0xe84b('0x22')](_0x1804bd,_0x2e33e2)['then'](function(_0x17cd7a){logger[_0xe84b('0x23')](_0xe84b('0x24'),_0xc534c7,_0xe84b('0x25'));logger[_0xe84b('0x26')](_0xe84b('0x27'),_0xc534c7,_0xe84b('0x25'),JSON[_0xe84b('0x28')](_0x17cd7a));if(_0x17cd7a[_0xe84b('0x29')]){if(_0x17cd7a[_0xe84b('0x29')][_0xe84b('0x2a')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0xc534c7,_0x17cd7a[_0xe84b('0x29')][_0xe84b('0x2b')]);return _0x3b61f2(_0x17cd7a[_0xe84b('0x29')][_0xe84b('0x2b')]);}logger[_0xe84b('0x29')](_0xe84b('0x24'),_0xc534c7,_0x17cd7a[_0xe84b('0x29')][_0xe84b('0x2b')]);return _0x51f35d(_0x17cd7a['error'][_0xe84b('0x2b')]);}else{logger['info'](_0xe84b('0x24'),_0xc534c7,_0xe84b('0x25'));_0x51f35d(_0x17cd7a[_0xe84b('0x2c')][_0xe84b('0x2b')]);}})[_0xe84b('0x2d')](function(_0x32e382){logger[_0xe84b('0x29')](_0xe84b('0x24'),_0xc534c7,_0x32e382);_0x3b61f2(_0x32e382);});});}function respondWithStatusCode(_0x3199c9,_0x16e065){_0x16e065=_0x16e065||0xcc;return function(_0x247cc6){if(_0x247cc6){return _0x3199c9[_0xe84b('0x2e')](_0x16e065);}return _0x3199c9[_0xe84b('0x2f')](_0x16e065)[_0xe84b('0x30')]();};}function respondWithResult(_0x754507,_0x168526){_0x168526=_0x168526||0xc8;return function(_0x239693){if(_0x239693){return _0x754507['status'](_0x168526)['json'](_0x239693);}};}function respondWithFilteredResult(_0x160502,_0x5c056c){return function(_0x5ea94d){if(_0x5ea94d){var _0x2c13fe=_0x5ea94d[_0xe84b('0x31')],_0x2b3cbb=_0x5c056c['offset'],_0x46fa5c=_0x5c056c['offset']+_0x5c056c['limit'],_0x41ae44;if(_0x46fa5c>=_0x2c13fe){_0x46fa5c=_0x2c13fe;_0x41ae44=0xc8;}else{_0x41ae44=0xce;}_0x160502[_0xe84b('0x2f')](_0x41ae44);return _0x160502[_0xe84b('0x32')](_0xe84b('0x33'),_0x2b3cbb+'-'+_0x46fa5c+'/'+_0x2c13fe)[_0xe84b('0x34')](_0x5ea94d);}return null;};}function patchUpdates(_0x4a5f54){return function(_0x412966){try{jsonpatch[_0xe84b('0x35')](_0x412966,_0x4a5f54,!![]);}catch(_0xf8c427){return BPromise['reject'](_0xf8c427);}return _0x412966[_0xe84b('0x36')]();};}function saveUpdates(_0x499e03,_0x12a68c){return function(_0x1e5187){if(_0x1e5187){return _0x1e5187[_0xe84b('0x37')](_0x499e03)[_0xe84b('0x38')](function(_0x3c1b12){return _0x3c1b12;});}return null;};}function removeEntity(_0x26f79f,_0x4aca82){return function(_0x236059){if(_0x236059){return _0x236059[_0xe84b('0x39')]()[_0xe84b('0x38')](function(){_0x26f79f[_0xe84b('0x2f')](0xcc)[_0xe84b('0x30')]();});}};}function handleEntityNotFound(_0x58840c,_0xb2804f){return function(_0x248676){if(!_0x248676){_0x58840c[_0xe84b('0x2e')](0x194);}return _0x248676;};}function handleError(_0x2f8db2,_0x24a516){_0x24a516=_0x24a516||0x1f4;return function(_0x5bddf6){logger['error'](_0x5bddf6[_0xe84b('0x3a')]);if(_0x5bddf6[_0xe84b('0x3b')]){delete _0x5bddf6['name'];}_0x2f8db2[_0xe84b('0x2f')](_0x24a516)[_0xe84b('0x3c')](_0x5bddf6);};}exports['index']=function(_0x21c632,_0x5e8475){var _0x4c4d41={},_0x26899f={},_0x42dbc7={'count':0x0,'rows':[]};var _0xb20acc=_[_0xe84b('0x3d')](db[_0xe84b('0x3e')]['rawAttributes'],function(_0x232ce1){return{'name':_0x232ce1[_0xe84b('0x3f')],'type':_0x232ce1['type'][_0xe84b('0x40')]};});_0x26899f[_0xe84b('0x41')]=_[_0xe84b('0x3d')](_0xb20acc,_0xe84b('0x3b'));_0x26899f[_0xe84b('0x42')]=_[_0xe84b('0x43')](_0x21c632[_0xe84b('0x42')]);_0x26899f[_0xe84b('0x44')]=_[_0xe84b('0x45')](_0x26899f[_0xe84b('0x41')],_0x26899f[_0xe84b('0x42')]);_0x4c4d41[_0xe84b('0x46')]=_[_0xe84b('0x45')](_0x26899f[_0xe84b('0x41')],qs[_0xe84b('0x47')](_0x21c632['query']['fields']));_0x4c4d41[_0xe84b('0x46')]=_0x4c4d41['attributes']['length']?_0x4c4d41['attributes']:_0x26899f[_0xe84b('0x41')];if(!_0x21c632[_0xe84b('0x42')][_0xe84b('0x48')](_0xe84b('0x49'))){_0x4c4d41[_0xe84b('0x4a')]=qs[_0xe84b('0x4a')](_0x21c632[_0xe84b('0x42')][_0xe84b('0x4a')]);_0x4c4d41[_0xe84b('0x4b')]=qs[_0xe84b('0x4b')](_0x21c632[_0xe84b('0x42')][_0xe84b('0x4b')]);}_0x4c4d41[_0xe84b('0x4c')]=qs['sort'](_0x21c632[_0xe84b('0x42')]['sort']);_0x4c4d41['where']=qs[_0xe84b('0x44')](_[_0xe84b('0x4d')](_0x21c632['query'],_0x26899f[_0xe84b('0x44')]),_0xb20acc);if(_0x21c632[_0xe84b('0x42')]['filter']){_0x4c4d41[_0xe84b('0x4e')]=_[_0xe84b('0x4f')](_0x4c4d41[_0xe84b('0x4e')],{'$or':_['map'](_0xb20acc,function(_0x4de72f){if(_0x4de72f[_0xe84b('0x50')]!==_0xe84b('0x51')){var _0x57f10b={};_0x57f10b[_0x4de72f[_0xe84b('0x3b')]]={'$like':'%'+_0x21c632[_0xe84b('0x42')][_0xe84b('0x52')]+'%'};return _0x57f10b;}})});}_0x4c4d41=_['merge']({},_0x4c4d41,_0x21c632[_0xe84b('0x53')]);var _0x46ef4f={'where':_0x4c4d41[_0xe84b('0x4e')]};return db['ChatMessage'][_0xe84b('0x31')](_0x46ef4f)[_0xe84b('0x38')](function(_0x56b468){_0x42dbc7[_0xe84b('0x31')]=_0x56b468;if(_0x21c632[_0xe84b('0x42')][_0xe84b('0x54')]){_0x4c4d41[_0xe84b('0x55')]=[{'all':!![]}];}return db['ChatMessage'][_0xe84b('0x56')](_0x4c4d41);})['then'](function(_0x21a9b3){_0x42dbc7[_0xe84b('0x57')]=_0x21a9b3;return _0x42dbc7;})['then'](respondWithFilteredResult(_0x5e8475,_0x4c4d41))['catch'](handleError(_0x5e8475,null));};exports['show']=function(_0x947d97,_0x598a8e){var _0x2a2a6b={'raw':!![],'where':{'id':_0x947d97[_0xe84b('0x58')]['id']}},_0x3b8efb={};_0x3b8efb[_0xe84b('0x41')]=_[_0xe84b('0x43')](db[_0xe84b('0x3e')]['rawAttributes']);_0x3b8efb['query']=_['keys'](_0x947d97[_0xe84b('0x42')]);_0x3b8efb['filters']=_[_0xe84b('0x45')](_0x3b8efb['model'],_0x3b8efb[_0xe84b('0x42')]);_0x2a2a6b[_0xe84b('0x46')]=_['intersection'](_0x3b8efb[_0xe84b('0x41')],qs[_0xe84b('0x47')](_0x947d97['query']['fields']));_0x2a2a6b['attributes']=_0x2a2a6b['attributes'][_0xe84b('0x59')]?_0x2a2a6b[_0xe84b('0x46')]:_0x3b8efb[_0xe84b('0x41')];if(_0x947d97[_0xe84b('0x42')][_0xe84b('0x54')]){_0x2a2a6b[_0xe84b('0x55')]=[{'all':!![]}];}_0x2a2a6b=_[_0xe84b('0x4f')]({},_0x2a2a6b,_0x947d97[_0xe84b('0x53')]);return db[_0xe84b('0x3e')][_0xe84b('0x5a')](_0x2a2a6b)['then'](handleEntityNotFound(_0x598a8e,null))[_0xe84b('0x38')](respondWithResult(_0x598a8e,null))[_0xe84b('0x2d')](handleError(_0x598a8e,null));};exports[_0xe84b('0x5b')]=function(_0x516e58,_0x28df3b){return db['ChatMessage'][_0xe84b('0x5b')](_0x516e58['body'],{})[_0xe84b('0x38')](respondWithResult(_0x28df3b,0xc9))[_0xe84b('0x2d')](handleError(_0x28df3b,null));};exports[_0xe84b('0x37')]=function(_0x426970,_0x228598){if(_0x426970[_0xe84b('0x5c')]['id']){delete _0x426970[_0xe84b('0x5c')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x426970[_0xe84b('0x58')]['id']}})['then'](handleEntityNotFound(_0x228598,null))[_0xe84b('0x38')](saveUpdates(_0x426970['body'],null))['then'](respondWithResult(_0x228598,null))[_0xe84b('0x2d')](handleError(_0x228598,null));};exports['destroy']=function(_0x36b9e2,_0x124491){return db[_0xe84b('0x3e')][_0xe84b('0x5a')]({'where':{'id':_0x36b9e2[_0xe84b('0x58')]['id']}})[_0xe84b('0x38')](handleEntityNotFound(_0x124491,null))[_0xe84b('0x38')](removeEntity(_0x124491,null))[_0xe84b('0x2d')](handleError(_0x124491,null));};exports[_0xe84b('0x5d')]=function(_0x5b8b7d,_0x503191){return db[_0xe84b('0x3e')][_0xe84b('0x5d')]()[_0xe84b('0x38')](respondWithResult(_0x503191,null))[_0xe84b('0x2d')](handleError(_0x503191,null));};var interaction_log=require(_0xe84b('0x5e'))(_0xe84b('0x5f'));exports[_0xe84b('0x60')]=function(_0x1499af,_0x3e2fdb,_0x347c2c){var _0x905217={'agent':{},'channel':_0xe84b('0x61')};if(_0x1499af[_0xe84b('0x5c')]['id']){delete _0x1499af['body']['id'];}_0x1499af[_0xe84b('0x5c')][_0xe84b('0x62')]=!![];_0x1499af['body']['readAt']=moment()[_0xe84b('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x1499af[_0xe84b('0x5c')][_0xe84b('0x64')]=_0x1499af[_0xe84b('0x5c')][_0xe84b('0x64')]||_0x1499af[_0xe84b('0x65')]['id'];_0x905217[_0xe84b('0x66')]['id']=_0x1499af[_0xe84b('0x5c')][_0xe84b('0x64')];return db[_0xe84b('0x3e')][_0xe84b('0x5a')]({'where':{'id':_0x1499af[_0xe84b('0x58')]['id'],'UserId':null},'include':[{'model':db[_0xe84b('0x67')],'as':_0xe84b('0x68')}]})[_0xe84b('0x38')](handleEntityNotFound(_0x3e2fdb,null))['then'](saveUpdates(_0x1499af['body'],null))[_0xe84b('0x38')](function(_0x120d5d){if(_0x120d5d){_0x905217[_0xe84b('0x2b')]=_0x120d5d[_0xe84b('0x69')]({'plain':!![]});return db[_0xe84b('0x6a')]['find']({'where':{'id':_0x120d5d[_0xe84b('0x6b')]}});}return null;})[_0xe84b('0x38')](handleEntityNotFound(_0x3e2fdb,null))[_0xe84b('0x38')](function(_0x43159f){if(_0x43159f){return _0x43159f['update']({'UserId':_0x1499af['body'][_0xe84b('0x64')],'read1stAt':_[_0xe84b('0x6c')](_0x43159f[_0xe84b('0x6d')])?moment()[_0xe84b('0x63')](_0xe84b('0x6e')):undefined});}return null;})[_0xe84b('0x38')](function(_0x28fc1c){if(_0x28fc1c){_0x905217[_0xe84b('0x6f')]=_0x28fc1c[_0xe84b('0x69')]({'plain':!![]});interaction_log[_0xe84b('0x23')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1499af[_0xe84b('0x65')]['id'],_0x1499af[_0xe84b('0x65')][_0xe84b('0x3b')],_0x1499af['user'][_0xe84b('0x70')],_0x905217[_0xe84b('0x6f')]['id'],_0x1499af[_0xe84b('0x5c')]?JSON[_0xe84b('0x28')](_0x1499af[_0xe84b('0x5c')]):'null');return respondWithRpcPromise('AcceptMessage',_0xe84b('0x71'),_0x905217);}return null;})[_0xe84b('0x38')](function(_0x312e9){if(_0x312e9){if(_0x1499af[_0xe84b('0x5c')][_0xe84b('0x72')]){_0x905217['message'][_0xe84b('0x73')]=util[_0xe84b('0x63')]('SIP/%s',_0x1499af[_0xe84b('0x65')]['name']);_0x905217[_0xe84b('0x2b')][_0xe84b('0x74')]=_0x905217[_0xe84b('0x74')];_0x905217[_0xe84b('0x2b')][_0xe84b('0x75')]=_0xe84b('0x60');return respondWithRpcPromise(_0xe84b('0x76'),_0xe84b('0x76'),{'event':_0xe84b('0x77'),'message':_['merge'](_0x905217['message'],JSON['parse'](_0x905217[_0xe84b('0x6f')][_0xe84b('0x78')]))},client9002)['then'](function(){return _0x905217;});}return _0x905217;}return null;})[_0xe84b('0x38')](respondWithResult(_0x3e2fdb,null))[_0xe84b('0x2d')](handleError(_0x3e2fdb,null));};var interaction_log=require('../../config/logger')(_0xe84b('0x5f'));exports[_0xe84b('0x79')]=function(_0x1d406a,_0x31cf2d,_0x2b6ac6){var _0x1b9432={'agent':{},'channel':'chat'};if(_0x1d406a[_0xe84b('0x5c')]['id']){delete _0x1d406a[_0xe84b('0x5c')]['id'];}_0x1d406a['body'][_0xe84b('0x64')]=_0x1d406a[_0xe84b('0x5c')][_0xe84b('0x64')]||_0x1d406a[_0xe84b('0x65')]['id'];_0x1b9432[_0xe84b('0x66')]['id']=_0x1d406a[_0xe84b('0x5c')][_0xe84b('0x64')];return db[_0xe84b('0x3e')][_0xe84b('0x5a')]({'where':{'id':_0x1d406a[_0xe84b('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x31cf2d,null))['then'](function(_0x157fa5){if(_0x157fa5){_0x1b9432[_0xe84b('0x2b')]=_0x157fa5[_0xe84b('0x69')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x157fa5[_0xe84b('0x6b')]}});}return null;})[_0xe84b('0x38')](handleEntityNotFound(_0x31cf2d,null))[_0xe84b('0x38')](function(_0x4f3405){if(_0x4f3405){_0x1b9432[_0xe84b('0x6f')]=_0x4f3405[_0xe84b('0x69')]({'plain':!![]});interaction_log['info'](_0xe84b('0x7a'),_0x1d406a[_0xe84b('0x65')]['id'],_0x1d406a[_0xe84b('0x65')][_0xe84b('0x3b')],_0x1d406a[_0xe84b('0x65')]['role'],_0x1b9432[_0xe84b('0x6f')]['id'],_0x1d406a[_0xe84b('0x5c')]?JSON['stringify'](_0x1d406a['body']):_0xe84b('0x7b'));return respondWithRpcPromise(_0xe84b('0x7c'),_0xe84b('0x7d'),_0x1b9432);}return null;})[_0xe84b('0x38')](function(_0x1f87ac){if(_0x1f87ac){_0x1f87ac[_0xe84b('0x2b')]['interface']=util[_0xe84b('0x63')](_0xe84b('0x7e'),_0x1d406a[_0xe84b('0x65')]['name']);_0x1f87ac[_0xe84b('0x2b')][_0xe84b('0x74')]=_0x1b9432['channel'];_0x1f87ac[_0xe84b('0x2b')][_0xe84b('0x75')]=_0xe84b('0x79');respondWithRpcPromise(_0xe84b('0x76'),_0xe84b('0x76'),{'event':_0xe84b('0x7f'),'message':_0x1f87ac[_0xe84b('0x2b')]},client9002);return _0x1b9432;}return null;})[_0xe84b('0x38')](respondWithResult(_0x31cf2d,null))[_0xe84b('0x2d')](handleError(_0x31cf2d,null));};
\ No newline at end of file
+var _0xf6ef=['find','create','body','params','destroy','describe','chat-interactions','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','CmContact','Contact','ChatInteractionId','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','status','json','count','set','Content-Range','apply','reject','save','update','end','stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','offset','order','sort','where','pick','type','VIRTUAL','merge','options','ChatMessage','includeAll','include','rows','show','rawAttributes'];(function(_0x25955a,_0x1383b3){var _0x2a6aca=function(_0x555130){while(--_0x555130){_0x25955a['push'](_0x25955a['shift']());}};_0x2a6aca(++_0x1383b3);}(_0xf6ef,0x117));var _0xff6e=function(_0x363dee,_0x4d1a44){_0x363dee=_0x363dee-0x0;var _0x31ae44=_0xf6ef[_0x363dee];return _0x31ae44;};'use strict';var pdf=require(_0xff6e('0x0'));var emlformat=require(_0xff6e('0x1'));var rimraf=require(_0xff6e('0x2'));var zipdir=require(_0xff6e('0x3'));var jsonpatch=require(_0xff6e('0x4'));var rp=require(_0xff6e('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xff6e('0x6'));var util=require(_0xff6e('0x7'));var path=require(_0xff6e('0x8'));var sox=require(_0xff6e('0x9'));var csv=require(_0xff6e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff6e('0xb'));var _=require('lodash');var squel=require(_0xff6e('0xc'));var crypto=require('crypto');var jsforce=require(_0xff6e('0xd'));var deskjs=require(_0xff6e('0xe'));var toCsv=require('to-csv');var querystring=require(_0xff6e('0xf'));var Papa=require('papaparse');var Redis=require(_0xff6e('0x10'));var authService=require(_0xff6e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xff6e('0x12'));var hardwareService=require(_0xff6e('0x13'));var logger=require(_0xff6e('0x14'))(_0xff6e('0x15'));var utils=require(_0xff6e('0x16'));var config=require(_0xff6e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xff6e('0x18'))['db'];config[_0xff6e('0x19')]=_[_0xff6e('0x1a')](config[_0xff6e('0x19')],{'host':_0xff6e('0x1b'),'port':0x18eb});var socket=require(_0xff6e('0x1c'))(new Redis(config[_0xff6e('0x19')]));require(_0xff6e('0x1d'))[_0xff6e('0x1e')](socket);var jayson=require(_0xff6e('0x1f'));var client=jayson[_0xff6e('0x20')][_0xff6e('0x21')]({'port':0x232c});var client9002=jayson[_0xff6e('0x20')][_0xff6e('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x5402f5,_0x534668,_0x74e08a,_0x427094){return new BPromise(function(_0x944ba6,_0x6d211a){var _0x9469be=_0x427094||client;return _0x9469be[_0xff6e('0x22')](_0x5402f5,_0x74e08a)[_0xff6e('0x23')](function(_0x249755){logger[_0xff6e('0x24')](_0xff6e('0x25'),_0x534668,'request\x20sent');logger[_0xff6e('0x26')](_0xff6e('0x27'),_0x534668,_0xff6e('0x28'),JSON['stringify'](_0x249755));if(_0x249755[_0xff6e('0x29')]){if(_0x249755[_0xff6e('0x29')]['code']===0x1f4){logger[_0xff6e('0x29')](_0xff6e('0x25'),_0x534668,_0x249755[_0xff6e('0x29')][_0xff6e('0x2a')]);return _0x6d211a(_0x249755[_0xff6e('0x29')][_0xff6e('0x2a')]);}logger[_0xff6e('0x29')]('ChatMessage,\x20%s,\x20%s',_0x534668,_0x249755[_0xff6e('0x29')][_0xff6e('0x2a')]);return _0x944ba6(_0x249755[_0xff6e('0x29')][_0xff6e('0x2a')]);}else{logger[_0xff6e('0x24')](_0xff6e('0x25'),_0x534668,_0xff6e('0x28'));_0x944ba6(_0x249755[_0xff6e('0x2b')][_0xff6e('0x2a')]);}})[_0xff6e('0x2c')](function(_0x3d0515){logger[_0xff6e('0x29')](_0xff6e('0x25'),_0x534668,_0x3d0515);_0x6d211a(_0x3d0515);});});}function respondWithStatusCode(_0x1d818e,_0x4ab195){_0x4ab195=_0x4ab195||0xcc;return function(_0x373efe){if(_0x373efe){return _0x1d818e[_0xff6e('0x2d')](_0x4ab195);}return _0x1d818e[_0xff6e('0x2e')](_0x4ab195)['end']();};}function respondWithResult(_0xdf7c1f,_0x5e3e56){_0x5e3e56=_0x5e3e56||0xc8;return function(_0x1b0b04){if(_0x1b0b04){return _0xdf7c1f[_0xff6e('0x2e')](_0x5e3e56)[_0xff6e('0x2f')](_0x1b0b04);}};}function respondWithFilteredResult(_0x47ef4c,_0x24a339){return function(_0x57829f){if(_0x57829f){var _0x3d148c=_0x57829f[_0xff6e('0x30')],_0x2dd7bf=_0x24a339['offset'],_0x4df50b=_0x24a339['offset']+_0x24a339['limit'],_0x1043f4;if(_0x4df50b>=_0x3d148c){_0x4df50b=_0x3d148c;_0x1043f4=0xc8;}else{_0x1043f4=0xce;}_0x47ef4c[_0xff6e('0x2e')](_0x1043f4);return _0x47ef4c[_0xff6e('0x31')](_0xff6e('0x32'),_0x2dd7bf+'-'+_0x4df50b+'/'+_0x3d148c)[_0xff6e('0x2f')](_0x57829f);}return null;};}function patchUpdates(_0x2be4e6){return function(_0x4c050e){try{jsonpatch[_0xff6e('0x33')](_0x4c050e,_0x2be4e6,!![]);}catch(_0x5bc304){return BPromise[_0xff6e('0x34')](_0x5bc304);}return _0x4c050e[_0xff6e('0x35')]();};}function saveUpdates(_0x50fdca,_0x17c717){return function(_0x150a08){if(_0x150a08){return _0x150a08[_0xff6e('0x36')](_0x50fdca)[_0xff6e('0x23')](function(_0x534260){return _0x534260;});}return null;};}function removeEntity(_0x4b7b23,_0x31a48b){return function(_0x476bcc){if(_0x476bcc){return _0x476bcc['destroy']()[_0xff6e('0x23')](function(){_0x4b7b23[_0xff6e('0x2e')](0xcc)[_0xff6e('0x37')]();});}};}function handleEntityNotFound(_0x2f1b50,_0x209378){return function(_0x1449f7){if(!_0x1449f7){_0x2f1b50[_0xff6e('0x2d')](0x194);}return _0x1449f7;};}function handleError(_0x5cdeb0,_0x212534){_0x212534=_0x212534||0x1f4;return function(_0x19c1e0){logger['error'](_0x19c1e0[_0xff6e('0x38')]);if(_0x19c1e0[_0xff6e('0x39')]){delete _0x19c1e0[_0xff6e('0x39')];}_0x5cdeb0[_0xff6e('0x2e')](_0x212534)[_0xff6e('0x3a')](_0x19c1e0);};}exports[_0xff6e('0x3b')]=function(_0x426d9a,_0x5648e6){var _0x13b04a={},_0x2466ee={},_0x807d73={'count':0x0,'rows':[]};var _0x52ec12=_[_0xff6e('0x3c')](db['ChatMessage']['rawAttributes'],function(_0x240a64){return{'name':_0x240a64[_0xff6e('0x3d')],'type':_0x240a64['type'][_0xff6e('0x3e')]};});_0x2466ee[_0xff6e('0x3f')]=_[_0xff6e('0x3c')](_0x52ec12,_0xff6e('0x39'));_0x2466ee[_0xff6e('0x40')]=_[_0xff6e('0x41')](_0x426d9a[_0xff6e('0x40')]);_0x2466ee[_0xff6e('0x42')]=_[_0xff6e('0x43')](_0x2466ee['model'],_0x2466ee[_0xff6e('0x40')]);_0x13b04a['attributes']=_[_0xff6e('0x43')](_0x2466ee[_0xff6e('0x3f')],qs['fields'](_0x426d9a[_0xff6e('0x40')][_0xff6e('0x44')]));_0x13b04a['attributes']=_0x13b04a[_0xff6e('0x45')][_0xff6e('0x46')]?_0x13b04a[_0xff6e('0x45')]:_0x2466ee['model'];if(!_0x426d9a['query'][_0xff6e('0x47')]('nolimit')){_0x13b04a['limit']=qs['limit'](_0x426d9a[_0xff6e('0x40')]['limit']);_0x13b04a[_0xff6e('0x48')]=qs[_0xff6e('0x48')](_0x426d9a['query'][_0xff6e('0x48')]);}_0x13b04a[_0xff6e('0x49')]=qs['sort'](_0x426d9a['query'][_0xff6e('0x4a')]);_0x13b04a[_0xff6e('0x4b')]=qs[_0xff6e('0x42')](_[_0xff6e('0x4c')](_0x426d9a[_0xff6e('0x40')],_0x2466ee['filters']),_0x52ec12);if(_0x426d9a[_0xff6e('0x40')]['filter']){_0x13b04a[_0xff6e('0x4b')]=_['merge'](_0x13b04a[_0xff6e('0x4b')],{'$or':_[_0xff6e('0x3c')](_0x52ec12,function(_0x558985){if(_0x558985[_0xff6e('0x4d')]!==_0xff6e('0x4e')){var _0x563c10={};_0x563c10[_0x558985[_0xff6e('0x39')]]={'$like':'%'+_0x426d9a[_0xff6e('0x40')]['filter']+'%'};return _0x563c10;}})});}_0x13b04a=_[_0xff6e('0x4f')]({},_0x13b04a,_0x426d9a[_0xff6e('0x50')]);var _0xe738ac={'where':_0x13b04a['where']};return db[_0xff6e('0x51')][_0xff6e('0x30')](_0xe738ac)[_0xff6e('0x23')](function(_0x32ce63){_0x807d73['count']=_0x32ce63;if(_0x426d9a[_0xff6e('0x40')][_0xff6e('0x52')]){_0x13b04a[_0xff6e('0x53')]=[{'all':!![]}];}return db[_0xff6e('0x51')]['findAll'](_0x13b04a);})['then'](function(_0x1559b0){_0x807d73[_0xff6e('0x54')]=_0x1559b0;return _0x807d73;})[_0xff6e('0x23')](respondWithFilteredResult(_0x5648e6,_0x13b04a))[_0xff6e('0x2c')](handleError(_0x5648e6,null));};exports[_0xff6e('0x55')]=function(_0x322bf1,_0x5d96c6){var _0x52111b={'raw':!![],'where':{'id':_0x322bf1['params']['id']}},_0x5efc87={};_0x5efc87[_0xff6e('0x3f')]=_[_0xff6e('0x41')](db['ChatMessage'][_0xff6e('0x56')]);_0x5efc87[_0xff6e('0x40')]=_['keys'](_0x322bf1[_0xff6e('0x40')]);_0x5efc87[_0xff6e('0x42')]=_[_0xff6e('0x43')](_0x5efc87[_0xff6e('0x3f')],_0x5efc87[_0xff6e('0x40')]);_0x52111b[_0xff6e('0x45')]=_[_0xff6e('0x43')](_0x5efc87[_0xff6e('0x3f')],qs[_0xff6e('0x44')](_0x322bf1[_0xff6e('0x40')][_0xff6e('0x44')]));_0x52111b['attributes']=_0x52111b['attributes'][_0xff6e('0x46')]?_0x52111b[_0xff6e('0x45')]:_0x5efc87[_0xff6e('0x3f')];if(_0x322bf1[_0xff6e('0x40')][_0xff6e('0x52')]){_0x52111b[_0xff6e('0x53')]=[{'all':!![]}];}_0x52111b=_[_0xff6e('0x4f')]({},_0x52111b,_0x322bf1['options']);return db['ChatMessage'][_0xff6e('0x57')](_0x52111b)['then'](handleEntityNotFound(_0x5d96c6,null))[_0xff6e('0x23')](respondWithResult(_0x5d96c6,null))['catch'](handleError(_0x5d96c6,null));};exports[_0xff6e('0x58')]=function(_0x157d52,_0x25191c){return db[_0xff6e('0x51')][_0xff6e('0x58')](_0x157d52[_0xff6e('0x59')],{})['then'](respondWithResult(_0x25191c,0xc9))[_0xff6e('0x2c')](handleError(_0x25191c,null));};exports[_0xff6e('0x36')]=function(_0x16cafa,_0x9035c1){if(_0x16cafa['body']['id']){delete _0x16cafa[_0xff6e('0x59')]['id'];}return db['ChatMessage'][_0xff6e('0x57')]({'where':{'id':_0x16cafa[_0xff6e('0x5a')]['id']}})[_0xff6e('0x23')](handleEntityNotFound(_0x9035c1,null))[_0xff6e('0x23')](saveUpdates(_0x16cafa['body'],null))[_0xff6e('0x23')](respondWithResult(_0x9035c1,null))[_0xff6e('0x2c')](handleError(_0x9035c1,null));};exports[_0xff6e('0x5b')]=function(_0x4c9c4f,_0x2bda50){return db['ChatMessage']['find']({'where':{'id':_0x4c9c4f[_0xff6e('0x5a')]['id']}})[_0xff6e('0x23')](handleEntityNotFound(_0x2bda50,null))[_0xff6e('0x23')](removeEntity(_0x2bda50,null))[_0xff6e('0x2c')](handleError(_0x2bda50,null));};exports[_0xff6e('0x5c')]=function(_0x34a85a,_0x76ac30){return db[_0xff6e('0x51')][_0xff6e('0x5c')]()[_0xff6e('0x23')](respondWithResult(_0x76ac30,null))[_0xff6e('0x2c')](handleError(_0x76ac30,null));};var interaction_log=require('../../config/logger')(_0xff6e('0x5d'));exports['accept']=function(_0x4db775,_0x4c2dc4,_0x4b6920){var _0x3a55fd={'agent':{},'channel':_0xff6e('0x5e')};if(_0x4db775[_0xff6e('0x59')]['id']){delete _0x4db775[_0xff6e('0x59')]['id'];}_0x4db775['body']['read']=!![];_0x4db775[_0xff6e('0x59')][_0xff6e('0x5f')]=moment()[_0xff6e('0x60')](_0xff6e('0x61'));_0x4db775[_0xff6e('0x59')][_0xff6e('0x62')]=_0x4db775['body']['UserId']||_0x4db775[_0xff6e('0x63')]['id'];_0x3a55fd[_0xff6e('0x64')]['id']=_0x4db775[_0xff6e('0x59')][_0xff6e('0x62')];return db[_0xff6e('0x51')][_0xff6e('0x57')]({'where':{'id':_0x4db775[_0xff6e('0x5a')]['id'],'UserId':null},'include':[{'model':db[_0xff6e('0x65')],'as':_0xff6e('0x66')}]})[_0xff6e('0x23')](handleEntityNotFound(_0x4c2dc4,null))[_0xff6e('0x23')](saveUpdates(_0x4db775['body'],null))['then'](function(_0x4bbea3){if(_0x4bbea3){_0x3a55fd[_0xff6e('0x2a')]=_0x4bbea3['get']({'plain':!![]});return db['ChatInteraction'][_0xff6e('0x57')]({'where':{'id':_0x4bbea3[_0xff6e('0x67')]}});}return null;})[_0xff6e('0x23')](handleEntityNotFound(_0x4c2dc4,null))['then'](function(_0x1399c4){if(_0x1399c4){return _0x1399c4[_0xff6e('0x36')]({'UserId':_0x4db775[_0xff6e('0x59')][_0xff6e('0x62')],'read1stAt':_[_0xff6e('0x68')](_0x1399c4[_0xff6e('0x69')])?moment()[_0xff6e('0x60')](_0xff6e('0x61')):undefined});}return null;})['then'](function(_0x4399cb){if(_0x4399cb){_0x3a55fd[_0xff6e('0x6a')]=_0x4399cb[_0xff6e('0x6b')]({'plain':!![]});interaction_log[_0xff6e('0x24')](_0xff6e('0x6c'),_0x4db775[_0xff6e('0x63')]['id'],_0x4db775['user'][_0xff6e('0x39')],_0x4db775[_0xff6e('0x63')][_0xff6e('0x6d')],_0x3a55fd[_0xff6e('0x6a')]['id'],_0x4db775[_0xff6e('0x59')]?JSON[_0xff6e('0x6e')](_0x4db775[_0xff6e('0x59')]):_0xff6e('0x6f'));return respondWithRpcPromise(_0xff6e('0x70'),_0xff6e('0x71'),_0x3a55fd);}return null;})[_0xff6e('0x23')](function(_0x28894c){if(_0x28894c){if(_0x4db775[_0xff6e('0x59')][_0xff6e('0x72')]){_0x3a55fd[_0xff6e('0x2a')][_0xff6e('0x73')]=util[_0xff6e('0x60')](_0xff6e('0x74'),_0x4db775[_0xff6e('0x63')][_0xff6e('0x39')]);_0x3a55fd[_0xff6e('0x2a')][_0xff6e('0x75')]=_0x3a55fd['channel'];_0x3a55fd[_0xff6e('0x2a')]['event']='accept';return respondWithRpcPromise(_0xff6e('0x76'),_0xff6e('0x76'),{'event':_0xff6e('0x77'),'message':_[_0xff6e('0x4f')](_0x3a55fd[_0xff6e('0x2a')],JSON['parse'](_0x3a55fd['interaction']['formData']))},client9002)['then'](function(){return _0x3a55fd;});}return _0x3a55fd;}return null;})[_0xff6e('0x23')](respondWithResult(_0x4c2dc4,null))[_0xff6e('0x2c')](handleError(_0x4c2dc4,null));};var interaction_log=require('../../config/logger')(_0xff6e('0x5d'));exports[_0xff6e('0x34')]=function(_0x22b435,_0x45ad88,_0x398c78){var _0x1c071b={'agent':{},'channel':_0xff6e('0x5e')};if(_0x22b435[_0xff6e('0x59')]['id']){delete _0x22b435['body']['id'];}_0x22b435[_0xff6e('0x59')][_0xff6e('0x62')]=_0x22b435[_0xff6e('0x59')][_0xff6e('0x62')]||_0x22b435[_0xff6e('0x63')]['id'];_0x1c071b[_0xff6e('0x64')]['id']=_0x22b435[_0xff6e('0x59')][_0xff6e('0x62')];return db[_0xff6e('0x51')][_0xff6e('0x57')]({'where':{'id':_0x22b435[_0xff6e('0x5a')]['id'],'UserId':null}})[_0xff6e('0x23')](handleEntityNotFound(_0x45ad88,null))[_0xff6e('0x23')](function(_0xe5acdb){if(_0xe5acdb){_0x1c071b[_0xff6e('0x2a')]=_0xe5acdb[_0xff6e('0x6b')]({'plain':!![]});return db['ChatInteraction'][_0xff6e('0x57')]({'where':{'id':_0xe5acdb['ChatInteractionId']}});}return null;})[_0xff6e('0x23')](handleEntityNotFound(_0x45ad88,null))[_0xff6e('0x23')](function(_0x2f5a67){if(_0x2f5a67){_0x1c071b[_0xff6e('0x6a')]=_0x2f5a67['get']({'plain':!![]});interaction_log[_0xff6e('0x24')](_0xff6e('0x78'),_0x22b435[_0xff6e('0x63')]['id'],_0x22b435[_0xff6e('0x63')]['name'],_0x22b435[_0xff6e('0x63')]['role'],_0x1c071b[_0xff6e('0x6a')]['id'],_0x22b435[_0xff6e('0x59')]?JSON[_0xff6e('0x6e')](_0x22b435[_0xff6e('0x59')]):_0xff6e('0x6f'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x1c071b);}return null;})[_0xff6e('0x23')](function(_0x33cf2e){if(_0x33cf2e){_0x33cf2e['message'][_0xff6e('0x73')]=util[_0xff6e('0x60')](_0xff6e('0x74'),_0x22b435[_0xff6e('0x63')]['name']);_0x33cf2e[_0xff6e('0x2a')][_0xff6e('0x75')]=_0x1c071b[_0xff6e('0x75')];_0x33cf2e[_0xff6e('0x2a')]['event']=_0xff6e('0x34');respondWithRpcPromise(_0xff6e('0x76'),_0xff6e('0x76'),{'event':_0xff6e('0x79'),'message':_0x33cf2e[_0xff6e('0x2a')]},client9002);return _0x1c071b;}return null;})['then'](respondWithResult(_0x45ad88,null))[_0xff6e('0x2c')](handleError(_0x45ad88,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 134122d..92db6d8 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 _0x617a=['../../mysqldb','ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x617a,0x1d5));var _0xa617=function(_0x57056c,_0x12c8a1){_0x57056c=_0x57056c-0x0;var _0xb624a2=_0x617a[_0x57056c];return _0xb624a2;};'use strict';var EventEmitter=require(_0xa617('0x0'));var ChatMessage=require(_0xa617('0x1'))['db'][_0xa617('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa617('0x3')](0x0);var events={'afterCreate':_0xa617('0x4'),'afterUpdate':_0xa617('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2ef7f6){return function(_0x50c14e,_0x1ea186,_0xe6a50e){ChatMessageEvents[_0xa617('0x6')](_0x2ef7f6+':'+_0x50c14e['id'],_0x50c14e);ChatMessageEvents[_0xa617('0x6')](_0x2ef7f6,_0x50c14e);_0xe6a50e(null);};}for(var e in events){if(events[_0xa617('0x7')](e)){var event=events[e];ChatMessage[_0xa617('0x8')](e,emitEvent(event));}}module[_0xa617('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0x3405=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x39450b,_0x529781){var _0x143a51=function(_0x183343){while(--_0x183343){_0x39450b['push'](_0x39450b['shift']());}};_0x143a51(++_0x529781);}(_0x3405,0x6f));var _0x5340=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x3405[_0x45d3f0];return _0x314b79;};'use strict';var EventEmitter=require(_0x5340('0x0'));var ChatMessage=require(_0x5340('0x1'))['db'][_0x5340('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x5340('0x3')](0x0);var events={'afterCreate':_0x5340('0x4'),'afterUpdate':'update','afterDestroy':_0x5340('0x5')};function emitEvent(_0x262236){return function(_0x5f4a3f,_0x5ed5d0,_0x90ba79){ChatMessageEvents[_0x5340('0x6')](_0x262236+':'+_0x5f4a3f['id'],_0x5f4a3f);ChatMessageEvents[_0x5340('0x6')](_0x262236,_0x5f4a3f);_0x90ba79(null);};}for(var e in events){if(events[_0x5340('0x7')](e)){var event=events[e];ChatMessage[_0x5340('0x8')](e,emitEvent(event));}}module[_0x5340('0x9')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 8f5f04c..6fe2d24 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 _0x6e26=['secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','get','direction','toLowerCase','out'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6e26,0x1e8));var _0x66e2=function(_0xfb3207,_0x35029b){_0xfb3207=_0xfb3207-0x0;var _0x1d3a4b=_0x6e26[_0xfb3207];return _0x1d3a4b;};'use strict';var _=require('lodash');var util=require(_0x66e2('0x0'));var logger=require('../../config/logger')(_0x66e2('0x1'));var moment=require(_0x66e2('0x2'));var BPromise=require(_0x66e2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x66e2('0x4'));var config=require('../../config/environment');var attributes=require(_0x66e2('0x5'));module[_0x66e2('0x6')]=function(_0x4f5e61,_0x2cca4c){return _0x4f5e61[_0x66e2('0x7')](_0x66e2('0x8'),attributes,{'tableName':_0x66e2('0x9'),'paranoid':![],'indexes':[{'name':_0x66e2('0xa'),'fields':['body'],'type':_0x66e2('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x382fe7,_0x252702,_0x7a5b80){var _0x37592b=_0x4f5e61['models'];var _0x4f2dd8=_0x382fe7[_0x66e2('0xc')]({'plain':!![]});if(_0x4f2dd8[_0x66e2('0xd')][_0x66e2('0xe')]()==='in'||_0x4f2dd8['direction'][_0x66e2('0xe')]()===_0x66e2('0xf')&&!_0x4f2dd8[_0x66e2('0x10')]&&!_[_0x66e2('0x11')](_0x4f2dd8[_0x66e2('0x12')])){_0x37592b[_0x66e2('0x13')][_0x66e2('0x14')]({'where':{'id':_0x4f2dd8[_0x66e2('0x15')]}})[_0x66e2('0x16')](function(_0x353882){if(_0x353882){_0x353882[_0x66e2('0x17')]({'lastMsgAt':_0x4f2dd8['createdAt'],'lastMsgDirection':_0x4f2dd8[_0x66e2('0xd')][_0x66e2('0xe')]()});}})[_0x66e2('0x18')](function(_0x375ba2){console[_0x66e2('0x19')](_0x375ba2);});}_0x7a5b80();}},'charset':_0x66e2('0x1a'),'collate':_0x66e2('0x1b')});};
\ No newline at end of file
+var _0x482c=['exports','ChatMessage','chat_messages','fti_chat_messages','models','get','toLowerCase','direction','out','isNil','ChatInteractionId','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes'];(function(_0x16987d,_0x566f27){var _0x48b8a4=function(_0x396cad){while(--_0x396cad){_0x16987d['push'](_0x16987d['shift']());}};_0x48b8a4(++_0x566f27);}(_0x482c,0x10c));var _0xc482=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x482c[_0x3054be];return _0x3df150;};'use strict';var _=require(_0xc482('0x0'));var util=require(_0xc482('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc482('0x2'));var BPromise=require(_0xc482('0x3'));var rp=require(_0xc482('0x4'));var fs=require('fs');var path=require(_0xc482('0x5'));var rimraf=require(_0xc482('0x6'));var config=require('../../config/environment');var attributes=require(_0xc482('0x7'));module[_0xc482('0x8')]=function(_0xa773f1,_0x271dd9){return _0xa773f1['define'](_0xc482('0x9'),attributes,{'tableName':_0xc482('0xa'),'paranoid':![],'indexes':[{'name':_0xc482('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x342b76,_0x1ac7a7,_0x1fcfaa){var _0x16ed5c=_0xa773f1[_0xc482('0xc')];var _0x29a7e4=_0x342b76[_0xc482('0xd')]({'plain':!![]});if(_0x29a7e4['direction'][_0xc482('0xe')]()==='in'||_0x29a7e4[_0xc482('0xf')]['toLowerCase']()===_0xc482('0x10')&&!_0x29a7e4['secret']&&!_[_0xc482('0x11')](_0x29a7e4['UserId'])){_0x16ed5c['ChatInteraction']['findOne']({'where':{'id':_0x29a7e4[_0xc482('0x12')]}})['then'](function(_0x280a96){if(_0x280a96){_0x280a96[_0xc482('0x13')]({'lastMsgAt':_0x29a7e4['createdAt'],'lastMsgDirection':_0x29a7e4[_0xc482('0xf')][_0xc482('0xe')]()});}})[_0xc482('0x14')](function(_0x5c95e8){console['error'](_0x5c95e8);});}_0x1fcfaa();}},'charset':_0xc482('0x15'),'collate':_0xc482('0x16')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 7c3de6f..9f151c1 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 _0x876e=['stringify','error','code','message','ChatMessage,\x20%s,\x20%s','catch','create','body','options','raw','CreateChatMessage','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','./chatMessage.socket','register','then','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x1da608,_0x52ac77){var _0x50194a=function(_0x1f3a60){while(--_0x1f3a60){_0x1da608['push'](_0x1da608['shift']());}};_0x50194a(++_0x52ac77);}(_0x876e,0x14f));var _0xe876=function(_0x33ac03,_0x482fd3){_0x33ac03=_0x33ac03-0x0;var _0x37f7c1=_0x876e[_0x33ac03];return _0x37f7c1;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe876('0x0'));var rs=require(_0xe876('0x1'));var fs=require('fs');var Redis=require(_0xe876('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe876('0x3'));var logger=require(_0xe876('0x4'))('rpc');var config=require(_0xe876('0x5'));var jayson=require(_0xe876('0x6'));var client=jayson[_0xe876('0x7')]['http']({'port':0x232a});config[_0xe876('0x8')]=_['defaults'](config[_0xe876('0x8')],{'host':_0xe876('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe876('0xa'))[_0xe876('0xb')](socket);function respondWithRpcPromise(_0x4021a3,_0x44aae1,_0x1ff938){return new BPromise(function(_0x4e4d09,_0x37721b){return client['request'](_0x4021a3,_0x1ff938)[_0xe876('0xc')](function(_0x49afbd){logger['info']('ChatMessage,\x20%s,\x20%s',_0x44aae1,_0xe876('0xd'));logger[_0xe876('0xe')](_0xe876('0xf'),_0x44aae1,_0xe876('0xd'),JSON[_0xe876('0x10')](_0x49afbd));if(_0x49afbd[_0xe876('0x11')]){if(_0x49afbd[_0xe876('0x11')][_0xe876('0x12')]===0x1f4){logger[_0xe876('0x11')]('ChatMessage,\x20%s,\x20%s',_0x44aae1,_0x49afbd[_0xe876('0x11')][_0xe876('0x13')]);return _0x37721b(_0x49afbd[_0xe876('0x11')][_0xe876('0x13')]);}logger[_0xe876('0x11')](_0xe876('0x14'),_0x44aae1,_0x49afbd['error']['message']);return _0x4e4d09(_0x49afbd[_0xe876('0x11')]['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x44aae1,_0xe876('0xd'));_0x4e4d09(_0x49afbd['result']['message']);}})[_0xe876('0x15')](function(_0x39822a){logger['error']('ChatMessage,\x20%s,\x20%s',_0x44aae1,_0x39822a);_0x37721b(_0x39822a);});});}exports['CreateChatMessage']=function(_0x197a24){var _0x43d924=this;return new Promise(function(_0x3a6b93,_0x20553e){return db['ChatMessage'][_0xe876('0x16')](_0x197a24[_0xe876('0x17')],{'raw':_0x197a24[_0xe876('0x18')]?_0x197a24['options'][_0xe876('0x19')]===undefined?!![]:![]:!![]})[_0xe876('0xc')](function(_0x524dfd){logger['info'](_0xe876('0x1a'),_0x197a24);logger[_0xe876('0xe')](_0xe876('0x1a'),_0x197a24,JSON[_0xe876('0x10')](_0x524dfd));_0x3a6b93(_0x524dfd);})[_0xe876('0x15')](function(_0x30bb2e){logger[_0xe876('0x11')](_0xe876('0x1a'),_0x30bb2e[_0xe876('0x13')],_0x197a24);_0x20553e(_0x43d924['error'](0x1f4,_0x30bb2e[_0xe876('0x13')]));});});};
\ No newline at end of file
+var _0x6625=['jayson/promise','client','http','redis','defaults','socket.io-emitter','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6625,0x107));var _0x5662=function(_0x3cc60f,_0x3411fe){_0x3cc60f=_0x3cc60f-0x0;var _0x283455=_0x6625[_0x3cc60f];return _0x283455;};'use strict';var _=require(_0x5662('0x0'));var util=require(_0x5662('0x1'));var moment=require(_0x5662('0x2'));var BPromise=require(_0x5662('0x3'));var rs=require(_0x5662('0x4'));var fs=require('fs');var Redis=require(_0x5662('0x5'));var db=require(_0x5662('0x6'))['db'];var utils=require(_0x5662('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x5662('0x8'));var jayson=require(_0x5662('0x9'));var client=jayson[_0x5662('0xa')][_0x5662('0xb')]({'port':0x232a});config[_0x5662('0xc')]=_[_0x5662('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5662('0xe'))(new Redis(config[_0x5662('0xc')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x4a6d16,_0x37ff4d,_0x4a0ea7){return new BPromise(function(_0x47e1ef,_0x568065){return client[_0x5662('0xf')](_0x4a6d16,_0x4a0ea7)[_0x5662('0x10')](function(_0xaa0c4){logger['info'](_0x5662('0x11'),_0x37ff4d,_0x5662('0x12'));logger[_0x5662('0x13')](_0x5662('0x14'),_0x37ff4d,_0x5662('0x12'),JSON['stringify'](_0xaa0c4));if(_0xaa0c4[_0x5662('0x15')]){if(_0xaa0c4['error'][_0x5662('0x16')]===0x1f4){logger['error'](_0x5662('0x11'),_0x37ff4d,_0xaa0c4[_0x5662('0x15')]['message']);return _0x568065(_0xaa0c4[_0x5662('0x15')][_0x5662('0x17')]);}logger[_0x5662('0x15')](_0x5662('0x11'),_0x37ff4d,_0xaa0c4[_0x5662('0x15')][_0x5662('0x17')]);return _0x47e1ef(_0xaa0c4[_0x5662('0x15')][_0x5662('0x17')]);}else{logger[_0x5662('0x18')](_0x5662('0x11'),_0x37ff4d,_0x5662('0x12'));_0x47e1ef(_0xaa0c4[_0x5662('0x19')]['message']);}})[_0x5662('0x1a')](function(_0x2974fe){logger[_0x5662('0x15')](_0x5662('0x11'),_0x37ff4d,_0x2974fe);_0x568065(_0x2974fe);});});}exports[_0x5662('0x1b')]=function(_0x462a3d){var _0x207b96=this;return new Promise(function(_0x3cc976,_0x2e82cb){return db[_0x5662('0x1c')][_0x5662('0x1d')](_0x462a3d[_0x5662('0x1e')],{'raw':_0x462a3d[_0x5662('0x1f')]?_0x462a3d[_0x5662('0x1f')][_0x5662('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x351dcb){logger[_0x5662('0x18')]('CreateChatMessage',_0x462a3d);logger[_0x5662('0x13')](_0x5662('0x1b'),_0x462a3d,JSON[_0x5662('0x21')](_0x351dcb));_0x3cc976(_0x351dcb);})['catch'](function(_0x103ad1){logger[_0x5662('0x15')](_0x5662('0x1b'),_0x103ad1[_0x5662('0x17')],_0x462a3d);_0x2e82cb(_0x207b96[_0x5662('0x15')](0x1f4,_0x103ad1[_0x5662('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 43064cf..e83a1f0 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 _0xacf4=['removeListener','register','length','remove','update','emit'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xacf4,0xe7));var _0x4acf=function(_0xbf99dd,_0x255ca3){_0xbf99dd=_0xbf99dd-0x0;var _0x3f173d=_0xacf4[_0xbf99dd];return _0x3f173d;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x4acf('0x0'),_0x4acf('0x1')];function createListener(_0x1e2413,_0x21fb75){return function(_0x25709c){_0x21fb75[_0x4acf('0x2')](_0x1e2413,_0x25709c);};}function removeListener(_0x145264,_0x5cf22d){return function(){ChatMessageEvents[_0x4acf('0x3')](_0x145264,_0x5cf22d);};}exports[_0x4acf('0x4')]=function(_0x4e0c43){for(var _0x24bf24=0x0,_0x2ba08a=events[_0x4acf('0x5')];_0x24bf24<_0x2ba08a;_0x24bf24++){var _0x45a5a4=events[_0x24bf24];var _0x25d345=createListener('chatMessage:'+_0x45a5a4,_0x4e0c43);ChatMessageEvents['on'](_0x45a5a4,_0x25d345);}};
\ No newline at end of file
+var _0xc1c6=['length','chatMessage:','./chatMessage.events','save','remove','emit','register'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x88ce76,_0x4dd709){_0x88ce76=_0x88ce76-0x0;var _0x46ad36=_0xc1c6[_0x88ce76];return _0x46ad36;};'use strict';var ChatMessageEvents=require(_0x6c1c('0x0'));var events=[_0x6c1c('0x1'),_0x6c1c('0x2'),'update'];function createListener(_0x114c93,_0x4c33ca){return function(_0x426398){_0x4c33ca[_0x6c1c('0x3')](_0x114c93,_0x426398);};}function removeListener(_0x265d2c,_0x59f799){return function(){ChatMessageEvents['removeListener'](_0x265d2c,_0x59f799);};}exports[_0x6c1c('0x4')]=function(_0x524a6b){for(var _0x50c1bb=0x0,_0x582bec=events[_0x6c1c('0x5')];_0x50c1bb<_0x582bec;_0x50c1bb++){var _0x2eb1ba=events[_0x50c1bb];var _0x38369d=createListener(_0x6c1c('0x6')+_0x2eb1ba,_0x524a6b);ChatMessageEvents['on'](_0x2eb1ba,_0x38369d);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index ba4bdd9..fe2eeba 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 _0x1152=['isAuthenticated','/:id','post','chat','chatmessage:create','create','put','/:id/accept','accept','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x550071,_0x9ba498){var _0x3c7b4c=function(_0x1e6cec){while(--_0x1e6cec){_0x550071['push'](_0x550071['shift']());}};_0x3c7b4c(++_0x9ba498);}(_0x1152,0x182));var _0x2115=function(_0x2af29a,_0x4f44bc){_0x2af29a=_0x2af29a-0x0;var _0x5ef02f=_0x1152[_0x2af29a];return _0x5ef02f;};'use strict';var multer=require(_0x2115('0x0'));var util=require(_0x2115('0x1'));var path=require(_0x2115('0x2'));var timeout=require(_0x2115('0x3'));var express=require(_0x2115('0x4'));var router=express[_0x2115('0x5')]();var fs_extra=require(_0x2115('0x6'));var auth=require(_0x2115('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x2115('0x8'));var controller=require('./chatMessage.controller');router[_0x2115('0x9')]('/',auth[_0x2115('0xa')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x2115('0x9')](_0x2115('0xb'),auth[_0x2115('0xa')](),controller['show']);router[_0x2115('0xc')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x2115('0xd'),_0x2115('0xe')),controller[_0x2115('0xf')]);router['put'](_0x2115('0xb'),controller['update']);router[_0x2115('0x10')](_0x2115('0x11'),auth[_0x2115('0xa')](),controller[_0x2115('0x12')]);router[_0x2115('0x10')]('/:id/reject',auth[_0x2115('0xa')](),controller['reject']);router[_0x2115('0x13')](_0x2115('0xb'),auth[_0x2115('0xa')](),controller[_0x2115('0x14')]);module[_0x2115('0x15')]=router;
\ No newline at end of file
+var _0x55ea=['../../components/interaction/service','./chatMessage.controller','/describe','isAuthenticated','describe','get','/:id','show','post','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4527a0,_0x20bdc1){var _0x4505cf=function(_0x139636){while(--_0x139636){_0x4527a0['push'](_0x4527a0['shift']());}};_0x4505cf(++_0x20bdc1);}(_0x55ea,0xc9));var _0xa55e=function(_0x1300e0,_0x5a1300){_0x1300e0=_0x1300e0-0x0;var _0x2e1ca5=_0x55ea[_0x1300e0];return _0x2e1ca5;};'use strict';var multer=require(_0xa55e('0x0'));var util=require(_0xa55e('0x1'));var path=require(_0xa55e('0x2'));var timeout=require('connect-timeout');var express=require(_0xa55e('0x3'));var router=express[_0xa55e('0x4')]();var fs_extra=require(_0xa55e('0x5'));var auth=require(_0xa55e('0x6'));var interaction=require(_0xa55e('0x7'));var config=require('../../config/environment');var controller=require(_0xa55e('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa55e('0x9'),auth[_0xa55e('0xa')](),controller[_0xa55e('0xb')]);router[_0xa55e('0xc')](_0xa55e('0xd'),auth[_0xa55e('0xa')](),controller[_0xa55e('0xe')]);router[_0xa55e('0xf')]('/',auth[_0xa55e('0xa')](),interaction['tracked']('chat',_0xa55e('0x10')),controller[_0xa55e('0x11')]);router[_0xa55e('0x12')](_0xa55e('0xd'),controller[_0xa55e('0x13')]);router['put'](_0xa55e('0x14'),auth['isAuthenticated'](),controller[_0xa55e('0x15')]);router[_0xa55e('0x12')](_0xa55e('0x16'),auth[_0xa55e('0xa')](),controller[_0xa55e('0x17')]);router[_0xa55e('0x18')](_0xa55e('0xd'),auth[_0xa55e('0xa')](),controller[_0xa55e('0x19')]);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 703cd7b..99348bb 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 _0xcf09=['TEXT','medium','sequelize','exports'];(function(_0x223bbd,_0x2f8c30){var _0x11e852=function(_0x5c03ab){while(--_0x5c03ab){_0x223bbd['push'](_0x223bbd['shift']());}};_0x11e852(++_0x2f8c30);}(_0xcf09,0x1c2));var _0x9cf0=function(_0x1ea569,_0x4e8312){_0x1ea569=_0x1ea569-0x0;var _0x552451=_0xcf09[_0x1ea569];return _0x552451;};'use strict';var Sequelize=require(_0x9cf0('0x0'));module[_0x9cf0('0x1')]={'body':{'type':Sequelize[_0x9cf0('0x2')](_0x9cf0('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0xb758=['medium','exports','TEXT'];(function(_0x56e6b6,_0x41dbce){var _0x1b1f93=function(_0x2db1f1){while(--_0x2db1f1){_0x56e6b6['push'](_0x56e6b6['shift']());}};_0x1b1f93(++_0x41dbce);}(_0xb758,0xb5));var _0x8b75=function(_0x301c34,_0x15701e){_0x301c34=_0x301c34-0x0;var _0x1a8c5a=_0xb758[_0x301c34];return _0x1a8c5a;};'use strict';var Sequelize=require('sequelize');module[_0x8b75('0x0')]={'body':{'type':Sequelize[_0x8b75('0x1')](_0x8b75('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 8b22d81..70a0a21 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 _0x7081=['json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','ChatOfflineMessage','includeAll','include','findAll','rows','show','params','rawAttributes','create','body','catch','find','Attachment','forEach','root','files','attachments','basename','existsSync','remove','describe','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x4e1269,_0x197395){var _0x293b6a=function(_0x5ac937){while(--_0x5ac937){_0x4e1269['push'](_0x4e1269['shift']());}};_0x293b6a(++_0x197395);}(_0x7081,0x8c));var _0x1708=function(_0x156d1b,_0x756c49){_0x156d1b=_0x156d1b-0x0;var _0x4b20ad=_0x7081[_0x156d1b];return _0x4b20ad;};'use strict';var pdf=require(_0x1708('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1708('0x1'));var zipdir=require(_0x1708('0x2'));var jsonpatch=require(_0x1708('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1708('0x4'));var Mustache=require(_0x1708('0x5'));var util=require(_0x1708('0x6'));var path=require(_0x1708('0x7'));var sox=require(_0x1708('0x8'));var csv=require(_0x1708('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1708('0xa'));var squel=require('squel');var crypto=require(_0x1708('0xb'));var jsforce=require(_0x1708('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1708('0x9'));var querystring=require(_0x1708('0xd'));var Papa=require(_0x1708('0xe'));var Redis=require(_0x1708('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1708('0x10'));var as=require(_0x1708('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1708('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1708('0x13'));var db=require(_0x1708('0x14'))['db'];function respondWithStatusCode(_0x499321,_0x582322){_0x582322=_0x582322||0xcc;return function(_0x44872c){if(_0x44872c){return _0x499321[_0x1708('0x15')](_0x582322);}return _0x499321[_0x1708('0x16')](_0x582322)[_0x1708('0x17')]();};}function respondWithResult(_0x4a9a04,_0x219047){_0x219047=_0x219047||0xc8;return function(_0x2b0082){if(_0x2b0082){return _0x4a9a04[_0x1708('0x16')](_0x219047)[_0x1708('0x18')](_0x2b0082);}};}function respondWithFilteredResult(_0x4ce844,_0x4babaa){return function(_0x2619e3){if(_0x2619e3){var _0x38137d=_0x2619e3[_0x1708('0x19')],_0x1ee518=_0x4babaa[_0x1708('0x1a')],_0x440ab0=_0x4babaa[_0x1708('0x1a')]+_0x4babaa[_0x1708('0x1b')],_0x5a00ee;if(_0x440ab0>=_0x38137d){_0x440ab0=_0x38137d;_0x5a00ee=0xc8;}else{_0x5a00ee=0xce;}_0x4ce844['status'](_0x5a00ee);return _0x4ce844[_0x1708('0x1c')](_0x1708('0x1d'),_0x1ee518+'-'+_0x440ab0+'/'+_0x38137d)[_0x1708('0x18')](_0x2619e3);}return null;};}function patchUpdates(_0x269bf3){return function(_0xadadd5){try{jsonpatch[_0x1708('0x1e')](_0xadadd5,_0x269bf3,!![]);}catch(_0x1663d8){return BPromise[_0x1708('0x1f')](_0x1663d8);}return _0xadadd5[_0x1708('0x20')]();};}function saveUpdates(_0x59956b,_0x1ef894){return function(_0x20daff){if(_0x20daff){return _0x20daff[_0x1708('0x21')](_0x59956b)[_0x1708('0x22')](function(_0x4a00c4){return _0x4a00c4;});}return null;};}function removeEntity(_0x1dccff,_0x55f95c){return function(_0x2f859b){if(_0x2f859b){return _0x2f859b[_0x1708('0x23')]()[_0x1708('0x22')](function(){_0x1dccff[_0x1708('0x16')](0xcc)[_0x1708('0x17')]();});}};}function handleEntityNotFound(_0x147c20,_0x58c0c9){return function(_0x1fe4c3){if(!_0x1fe4c3){_0x147c20[_0x1708('0x15')](0x194);}return _0x1fe4c3;};}function handleError(_0x21334f,_0x47859b){_0x47859b=_0x47859b||0x1f4;return function(_0x3768b1){logger[_0x1708('0x24')](_0x3768b1[_0x1708('0x25')]);if(_0x3768b1['name']){delete _0x3768b1[_0x1708('0x26')];}_0x21334f['status'](_0x47859b)['send'](_0x3768b1);};}exports[_0x1708('0x27')]=function(_0x5da7d1,_0x2d662b){var _0x5497b7={},_0x44576c={},_0x494160={'count':0x0,'rows':[]};var _0x5366f9=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x1b179c){return{'name':_0x1b179c[_0x1708('0x28')],'type':_0x1b179c[_0x1708('0x29')][_0x1708('0x2a')]};});_0x44576c[_0x1708('0x2b')]=_[_0x1708('0x2c')](_0x5366f9,_0x1708('0x26'));_0x44576c[_0x1708('0x2d')]=_[_0x1708('0x2e')](_0x5da7d1['query']);_0x44576c[_0x1708('0x2f')]=_['intersection'](_0x44576c[_0x1708('0x2b')],_0x44576c[_0x1708('0x2d')]);_0x5497b7[_0x1708('0x30')]=_[_0x1708('0x31')](_0x44576c[_0x1708('0x2b')],qs['fields'](_0x5da7d1[_0x1708('0x2d')][_0x1708('0x32')]));_0x5497b7[_0x1708('0x30')]=_0x5497b7['attributes'][_0x1708('0x33')]?_0x5497b7[_0x1708('0x30')]:_0x44576c[_0x1708('0x2b')];if(!_0x5da7d1[_0x1708('0x2d')][_0x1708('0x34')]('nolimit')){_0x5497b7[_0x1708('0x1b')]=qs[_0x1708('0x1b')](_0x5da7d1[_0x1708('0x2d')][_0x1708('0x1b')]);_0x5497b7[_0x1708('0x1a')]=qs[_0x1708('0x1a')](_0x5da7d1[_0x1708('0x2d')][_0x1708('0x1a')]);}_0x5497b7[_0x1708('0x35')]=qs['sort'](_0x5da7d1['query'][_0x1708('0x36')]);_0x5497b7['where']=qs[_0x1708('0x2f')](_[_0x1708('0x37')](_0x5da7d1[_0x1708('0x2d')],_0x44576c[_0x1708('0x2f')]),_0x5366f9);if(_0x5da7d1['query'][_0x1708('0x38')]){_0x5497b7[_0x1708('0x39')]=_[_0x1708('0x3a')](_0x5497b7[_0x1708('0x39')],{'$or':_['map'](_0x5366f9,function(_0x1b4368){if(_0x1b4368[_0x1708('0x29')]!==_0x1708('0x3b')){var _0x58df77={};_0x58df77[_0x1b4368[_0x1708('0x26')]]={'$like':'%'+_0x5da7d1['query'][_0x1708('0x38')]+'%'};return _0x58df77;}})});}_0x5497b7=_[_0x1708('0x3a')]({},_0x5497b7,_0x5da7d1[_0x1708('0x3c')]);var _0x15ef19={'where':_0x5497b7[_0x1708('0x39')]};return db[_0x1708('0x3d')]['count'](_0x15ef19)[_0x1708('0x22')](function(_0x43ab9b){_0x494160[_0x1708('0x19')]=_0x43ab9b;if(_0x5da7d1[_0x1708('0x2d')][_0x1708('0x3e')]){_0x5497b7[_0x1708('0x3f')]=[{'all':!![]}];}return db[_0x1708('0x3d')][_0x1708('0x40')](_0x5497b7);})['then'](function(_0x2cdf84){_0x494160[_0x1708('0x41')]=_0x2cdf84;return _0x494160;})[_0x1708('0x22')](respondWithFilteredResult(_0x2d662b,_0x5497b7))['catch'](handleError(_0x2d662b,null));};exports[_0x1708('0x42')]=function(_0x7abc4d,_0x4766f7){var _0x393a57={'raw':!![],'where':{'id':_0x7abc4d[_0x1708('0x43')]['id']}},_0x3ded11={};_0x3ded11[_0x1708('0x2b')]=_[_0x1708('0x2e')](db['ChatOfflineMessage'][_0x1708('0x44')]);_0x3ded11['query']=_[_0x1708('0x2e')](_0x7abc4d[_0x1708('0x2d')]);_0x3ded11['filters']=_[_0x1708('0x31')](_0x3ded11['model'],_0x3ded11[_0x1708('0x2d')]);_0x393a57[_0x1708('0x30')]=_['intersection'](_0x3ded11[_0x1708('0x2b')],qs[_0x1708('0x32')](_0x7abc4d[_0x1708('0x2d')][_0x1708('0x32')]));_0x393a57[_0x1708('0x30')]=_0x393a57['attributes']['length']?_0x393a57[_0x1708('0x30')]:_0x3ded11[_0x1708('0x2b')];if(_0x7abc4d[_0x1708('0x2d')][_0x1708('0x3e')]){_0x393a57['include']=[{'all':!![]}];}_0x393a57=_[_0x1708('0x3a')]({},_0x393a57,_0x7abc4d['options']);return db[_0x1708('0x3d')]['find'](_0x393a57)[_0x1708('0x22')](handleEntityNotFound(_0x4766f7,null))[_0x1708('0x22')](respondWithResult(_0x4766f7,null))['catch'](handleError(_0x4766f7,null));};exports[_0x1708('0x45')]=function(_0x1fc42c,_0x71c247){return db[_0x1708('0x3d')]['create'](_0x1fc42c[_0x1708('0x46')],{})[_0x1708('0x22')](respondWithResult(_0x71c247,0xc9))[_0x1708('0x47')](handleError(_0x71c247,null));};exports['update']=function(_0x10d101,_0x3457e6){if(_0x10d101[_0x1708('0x46')]['id']){delete _0x10d101[_0x1708('0x46')]['id'];}return db['ChatOfflineMessage'][_0x1708('0x48')]({'where':{'id':_0x10d101[_0x1708('0x43')]['id']}})[_0x1708('0x22')](handleEntityNotFound(_0x3457e6,null))[_0x1708('0x22')](saveUpdates(_0x10d101[_0x1708('0x46')],null))[_0x1708('0x22')](respondWithResult(_0x3457e6,null))['catch'](handleError(_0x3457e6,null));};exports[_0x1708('0x23')]=function(_0x205e60,_0x31e8ca){return db[_0x1708('0x49')][_0x1708('0x40')]({'where':{'ChatOfflineMessageId':eq[_0x1708('0x43')]['id']},'raw':!![]})[_0x1708('0x22')](function(_0x46e032){_0x46e032[_0x1708('0x4a')](function(_0x42753a){var _0x5dc60c=path['join'](config[_0x1708('0x4b')],'server',_0x1708('0x4c'),_0x1708('0x4d'),'offline-chat',_0x42753a[_0x1708('0x4e')]);var _0x2ee3a5=fs[_0x1708('0x4f')](_0x5dc60c);if(_0x2ee3a5)fs_extra[_0x1708('0x50')](_0x5dc60c);});})[_0x1708('0x22')](function(){return db[_0x1708('0x3d')][_0x1708('0x48')]({'where':{'id':_0x205e60[_0x1708('0x43')]['id']},'individualHooks':!![]});})[_0x1708('0x22')](handleEntityNotFound(_0x31e8ca,null))[_0x1708('0x22')](removeEntity(_0x31e8ca,null))[_0x1708('0x47')](handleError(_0x31e8ca,null));};exports[_0x1708('0x51')]=function(_0x9f49c4,_0x506c58){return db[_0x1708('0x3d')][_0x1708('0x51')]()[_0x1708('0x22')](respondWithResult(_0x506c58,null))[_0x1708('0x47')](handleError(_0x506c58,null));};
\ No newline at end of file
+var _0xc24b=['name','send','map','ChatOfflineMessage','fieldName','type','key','model','query','attributes','intersection','fields','length','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','rows','show','keys','includeAll','include','find','catch','create','body','params','forEach','server','files','attachments','offline-chat','basename','existsSync','describe','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','count','limit','set','apply','reject','save','update','then','destroy','end','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc24b,0x117));var _0xbc24=function(_0x34d346,_0x4c6502){_0x34d346=_0x34d346-0x0;var _0x122d76=_0xc24b[_0x34d346];return _0x122d76;};'use strict';var pdf=require(_0xbc24('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbc24('0x1'));var zipdir=require(_0xbc24('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbc24('0x3'));var moment=require(_0xbc24('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbc24('0x5'));var util=require(_0xbc24('0x6'));var path=require(_0xbc24('0x7'));var sox=require(_0xbc24('0x8'));var csv=require(_0xbc24('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc24('0xa'));var _=require('lodash');var squel=require(_0xbc24('0xb'));var crypto=require('crypto');var jsforce=require(_0xbc24('0xc'));var deskjs=require(_0xbc24('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbc24('0xe'));var Papa=require('papaparse');var Redis=require(_0xbc24('0xf'));var authService=require(_0xbc24('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbc24('0x11'));var logger=require(_0xbc24('0x12'))(_0xbc24('0x13'));var utils=require('../../config/utils');var config=require(_0xbc24('0x14'));var licenseUtil=require(_0xbc24('0x15'));var db=require(_0xbc24('0x16'))['db'];function respondWithStatusCode(_0xc7cc05,_0x4c80eb){_0x4c80eb=_0x4c80eb||0xcc;return function(_0x4080bc){if(_0x4080bc){return _0xc7cc05[_0xbc24('0x17')](_0x4c80eb);}return _0xc7cc05[_0xbc24('0x18')](_0x4c80eb)['end']();};}function respondWithResult(_0x99c159,_0x50be57){_0x50be57=_0x50be57||0xc8;return function(_0x2ce826){if(_0x2ce826){return _0x99c159[_0xbc24('0x18')](_0x50be57)[_0xbc24('0x19')](_0x2ce826);}};}function respondWithFilteredResult(_0x1a96a0,_0x4cbdf4){return function(_0x50951f){if(_0x50951f){var _0x5c24c8=_0x50951f[_0xbc24('0x1a')],_0x220ae9=_0x4cbdf4['offset'],_0x41d32b=_0x4cbdf4['offset']+_0x4cbdf4[_0xbc24('0x1b')],_0x2bc7b0;if(_0x41d32b>=_0x5c24c8){_0x41d32b=_0x5c24c8;_0x2bc7b0=0xc8;}else{_0x2bc7b0=0xce;}_0x1a96a0[_0xbc24('0x18')](_0x2bc7b0);return _0x1a96a0[_0xbc24('0x1c')]('Content-Range',_0x220ae9+'-'+_0x41d32b+'/'+_0x5c24c8)['json'](_0x50951f);}return null;};}function patchUpdates(_0x539ee0){return function(_0x45c630){try{jsonpatch[_0xbc24('0x1d')](_0x45c630,_0x539ee0,!![]);}catch(_0x514535){return BPromise[_0xbc24('0x1e')](_0x514535);}return _0x45c630[_0xbc24('0x1f')]();};}function saveUpdates(_0x329a54,_0x118d04){return function(_0x44e246){if(_0x44e246){return _0x44e246[_0xbc24('0x20')](_0x329a54)[_0xbc24('0x21')](function(_0x4c6217){return _0x4c6217;});}return null;};}function removeEntity(_0x18d23e,_0x2d76f8){return function(_0x4526e3){if(_0x4526e3){return _0x4526e3[_0xbc24('0x22')]()[_0xbc24('0x21')](function(){_0x18d23e[_0xbc24('0x18')](0xcc)[_0xbc24('0x23')]();});}};}function handleEntityNotFound(_0xacf80,_0x366d1d){return function(_0x3f8b35){if(!_0x3f8b35){_0xacf80[_0xbc24('0x17')](0x194);}return _0x3f8b35;};}function handleError(_0x2a1424,_0x4b1e43){_0x4b1e43=_0x4b1e43||0x1f4;return function(_0x4c4b64){logger[_0xbc24('0x24')](_0x4c4b64['stack']);if(_0x4c4b64[_0xbc24('0x25')]){delete _0x4c4b64[_0xbc24('0x25')];}_0x2a1424['status'](_0x4b1e43)[_0xbc24('0x26')](_0x4c4b64);};}exports['index']=function(_0x59ecc3,_0xdb3e88){var _0x3732cb={},_0x25fd45={},_0x2f7eef={'count':0x0,'rows':[]};var _0x5e16aa=_[_0xbc24('0x27')](db[_0xbc24('0x28')]['rawAttributes'],function(_0x1dac7a){return{'name':_0x1dac7a[_0xbc24('0x29')],'type':_0x1dac7a[_0xbc24('0x2a')][_0xbc24('0x2b')]};});_0x25fd45[_0xbc24('0x2c')]=_['map'](_0x5e16aa,_0xbc24('0x25'));_0x25fd45['query']=_['keys'](_0x59ecc3[_0xbc24('0x2d')]);_0x25fd45['filters']=_['intersection'](_0x25fd45[_0xbc24('0x2c')],_0x25fd45['query']);_0x3732cb[_0xbc24('0x2e')]=_[_0xbc24('0x2f')](_0x25fd45[_0xbc24('0x2c')],qs[_0xbc24('0x30')](_0x59ecc3[_0xbc24('0x2d')][_0xbc24('0x30')]));_0x3732cb[_0xbc24('0x2e')]=_0x3732cb[_0xbc24('0x2e')][_0xbc24('0x31')]?_0x3732cb['attributes']:_0x25fd45['model'];if(!_0x59ecc3[_0xbc24('0x2d')]['hasOwnProperty']('nolimit')){_0x3732cb['limit']=qs['limit'](_0x59ecc3[_0xbc24('0x2d')]['limit']);_0x3732cb['offset']=qs[_0xbc24('0x32')](_0x59ecc3['query'][_0xbc24('0x32')]);}_0x3732cb[_0xbc24('0x33')]=qs[_0xbc24('0x34')](_0x59ecc3[_0xbc24('0x2d')][_0xbc24('0x34')]);_0x3732cb[_0xbc24('0x35')]=qs[_0xbc24('0x36')](_[_0xbc24('0x37')](_0x59ecc3['query'],_0x25fd45[_0xbc24('0x36')]),_0x5e16aa);if(_0x59ecc3[_0xbc24('0x2d')][_0xbc24('0x38')]){_0x3732cb[_0xbc24('0x35')]=_[_0xbc24('0x39')](_0x3732cb[_0xbc24('0x35')],{'$or':_[_0xbc24('0x27')](_0x5e16aa,function(_0x1c69ea){if(_0x1c69ea[_0xbc24('0x2a')]!==_0xbc24('0x3a')){var _0x14b83a={};_0x14b83a[_0x1c69ea['name']]={'$like':'%'+_0x59ecc3[_0xbc24('0x2d')][_0xbc24('0x38')]+'%'};return _0x14b83a;}})});}_0x3732cb=_['merge']({},_0x3732cb,_0x59ecc3[_0xbc24('0x3b')]);var _0x41ffd9={'where':_0x3732cb[_0xbc24('0x35')]};return db[_0xbc24('0x28')][_0xbc24('0x1a')](_0x41ffd9)[_0xbc24('0x21')](function(_0x46a986){_0x2f7eef[_0xbc24('0x1a')]=_0x46a986;if(_0x59ecc3[_0xbc24('0x2d')]['includeAll']){_0x3732cb['include']=[{'all':!![]}];}return db['ChatOfflineMessage'][_0xbc24('0x3c')](_0x3732cb);})[_0xbc24('0x21')](function(_0x22a010){_0x2f7eef[_0xbc24('0x3d')]=_0x22a010;return _0x2f7eef;})[_0xbc24('0x21')](respondWithFilteredResult(_0xdb3e88,_0x3732cb))['catch'](handleError(_0xdb3e88,null));};exports[_0xbc24('0x3e')]=function(_0x3aa9ed,_0x15c8fb){var _0x269250={'raw':!![],'where':{'id':_0x3aa9ed['params']['id']}},_0x539282={};_0x539282[_0xbc24('0x2c')]=_[_0xbc24('0x3f')](db[_0xbc24('0x28')]['rawAttributes']);_0x539282[_0xbc24('0x2d')]=_['keys'](_0x3aa9ed[_0xbc24('0x2d')]);_0x539282['filters']=_['intersection'](_0x539282['model'],_0x539282['query']);_0x269250['attributes']=_[_0xbc24('0x2f')](_0x539282['model'],qs[_0xbc24('0x30')](_0x3aa9ed[_0xbc24('0x2d')][_0xbc24('0x30')]));_0x269250[_0xbc24('0x2e')]=_0x269250[_0xbc24('0x2e')][_0xbc24('0x31')]?_0x269250['attributes']:_0x539282['model'];if(_0x3aa9ed[_0xbc24('0x2d')][_0xbc24('0x40')]){_0x269250[_0xbc24('0x41')]=[{'all':!![]}];}_0x269250=_[_0xbc24('0x39')]({},_0x269250,_0x3aa9ed[_0xbc24('0x3b')]);return db['ChatOfflineMessage'][_0xbc24('0x42')](_0x269250)[_0xbc24('0x21')](handleEntityNotFound(_0x15c8fb,null))[_0xbc24('0x21')](respondWithResult(_0x15c8fb,null))[_0xbc24('0x43')](handleError(_0x15c8fb,null));};exports[_0xbc24('0x44')]=function(_0x47f80d,_0x4fcbc7){return db['ChatOfflineMessage'][_0xbc24('0x44')](_0x47f80d[_0xbc24('0x45')],{})[_0xbc24('0x21')](respondWithResult(_0x4fcbc7,0xc9))[_0xbc24('0x43')](handleError(_0x4fcbc7,null));};exports[_0xbc24('0x20')]=function(_0x21dae4,_0xc6b02b){if(_0x21dae4[_0xbc24('0x45')]['id']){delete _0x21dae4[_0xbc24('0x45')]['id'];}return db[_0xbc24('0x28')][_0xbc24('0x42')]({'where':{'id':_0x21dae4[_0xbc24('0x46')]['id']}})['then'](handleEntityNotFound(_0xc6b02b,null))[_0xbc24('0x21')](saveUpdates(_0x21dae4[_0xbc24('0x45')],null))[_0xbc24('0x21')](respondWithResult(_0xc6b02b,null))[_0xbc24('0x43')](handleError(_0xc6b02b,null));};exports[_0xbc24('0x22')]=function(_0x3f444b,_0xdd73bf){return db['Attachment'][_0xbc24('0x3c')]({'where':{'ChatOfflineMessageId':eq[_0xbc24('0x46')]['id']},'raw':!![]})[_0xbc24('0x21')](function(_0x1d006d){_0x1d006d[_0xbc24('0x47')](function(_0xd92d20){var _0x571862=path['join'](config['root'],_0xbc24('0x48'),_0xbc24('0x49'),_0xbc24('0x4a'),_0xbc24('0x4b'),_0xd92d20[_0xbc24('0x4c')]);var _0x3d2711=fs[_0xbc24('0x4d')](_0x571862);if(_0x3d2711)fs_extra['remove'](_0x571862);});})['then'](function(){return db[_0xbc24('0x28')][_0xbc24('0x42')]({'where':{'id':_0x3f444b['params']['id']},'individualHooks':!![]});})[_0xbc24('0x21')](handleEntityNotFound(_0xdd73bf,null))[_0xbc24('0x21')](removeEntity(_0xdd73bf,null))['catch'](handleError(_0xdd73bf,null));};exports[_0xbc24('0x4e')]=function(_0x1845b9,_0x4b7400){return db['ChatOfflineMessage'][_0xbc24('0x4e')]()[_0xbc24('0x21')](respondWithResult(_0x4b7400,null))['catch'](handleError(_0x4b7400,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 6c1d82c..ba4049d 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 _0x5636=['bluebird','request-promise','path','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0xa95e7f,_0x486d8b){var _0x3620e8=function(_0x56a1df){while(--_0x56a1df){_0xa95e7f['push'](_0xa95e7f['shift']());}};_0x3620e8(++_0x486d8b);}(_0x5636,0x102));var _0x6563=function(_0x2cd871,_0x73c920){_0x2cd871=_0x2cd871-0x0;var _0x3ee90=_0x5636[_0x2cd871];return _0x3ee90;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6563('0x2'));var rp=require(_0x6563('0x3'));var fs=require('fs');var path=require(_0x6563('0x4'));var rimraf=require('rimraf');var config=require(_0x6563('0x5'));var attributes=require(_0x6563('0x6'));module[_0x6563('0x7')]=function(_0x39792f,_0x29f687){return _0x39792f[_0x6563('0x8')](_0x6563('0x9'),attributes,{'tableName':_0x6563('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6563('0xb'),'collate':_0x6563('0xc')});};
\ No newline at end of file
+var _0x9b9b=['path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird','request-promise'];(function(_0x49b56e,_0x448f22){var _0x565d51=function(_0x5dd77c){while(--_0x5dd77c){_0x49b56e['push'](_0x49b56e['shift']());}};_0x565d51(++_0x448f22);}(_0x9b9b,0x114));var _0xb9b9=function(_0x4f89fa,_0x39546d){_0x4f89fa=_0x4f89fa-0x0;var _0x338542=_0x9b9b[_0x4f89fa];return _0x338542;};'use strict';var _=require('lodash');var util=require(_0xb9b9('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb9b9('0x1'));var BPromise=require(_0xb9b9('0x2'));var rp=require(_0xb9b9('0x3'));var fs=require('fs');var path=require(_0xb9b9('0x4'));var rimraf=require(_0xb9b9('0x5'));var config=require(_0xb9b9('0x6'));var attributes=require(_0xb9b9('0x7'));module[_0xb9b9('0x8')]=function(_0x79dd,_0x3d1a95){return _0x79dd[_0xb9b9('0x9')](_0xb9b9('0xa'),attributes,{'tableName':_0xb9b9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb9b9('0xc'),'collate':_0xb9b9('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index bbc6f12..4b0bbb2 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 _0x9689=['../../config/environment','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x32cb5d,_0xe97c1d){var _0x563adf=function(_0x12250a){while(--_0x12250a){_0x32cb5d['push'](_0x32cb5d['shift']());}};_0x563adf(++_0xe97c1d);}(_0x9689,0x1db));var _0x9968=function(_0x25db8b,_0x17e07d){_0x25db8b=_0x25db8b-0x0;var _0x5156cf=_0x9689[_0x25db8b];return _0x5156cf;};'use strict';var _=require(_0x9968('0x0'));var util=require(_0x9968('0x1'));var moment=require(_0x9968('0x2'));var BPromise=require(_0x9968('0x3'));var rs=require(_0x9968('0x4'));var fs=require('fs');var Redis=require(_0x9968('0x5'));var db=require(_0x9968('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9968('0x7'))('rpc');var config=require(_0x9968('0x8'));var jayson=require(_0x9968('0x9'));var client=jayson[_0x9968('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1daaea,_0x333748,_0xdd3c10){return new BPromise(function(_0x2c3704,_0x16d4cd){return client[_0x9968('0xb')](_0x1daaea,_0xdd3c10)[_0x9968('0xc')](function(_0x196ffe){logger[_0x9968('0xd')](_0x9968('0xe'),_0x333748,_0x9968('0xf'));logger['debug'](_0x9968('0x10'),_0x333748,_0x9968('0xf'),JSON['stringify'](_0x196ffe));if(_0x196ffe[_0x9968('0x11')]){if(_0x196ffe['error'][_0x9968('0x12')]===0x1f4){logger[_0x9968('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x333748,_0x196ffe[_0x9968('0x11')]['message']);return _0x16d4cd(_0x196ffe[_0x9968('0x11')]['message']);}logger[_0x9968('0x11')](_0x9968('0xe'),_0x333748,_0x196ffe[_0x9968('0x11')]['message']);return _0x2c3704(_0x196ffe['error'][_0x9968('0x13')]);}else{logger[_0x9968('0xd')](_0x9968('0xe'),_0x333748,'request\x20sent');_0x2c3704(_0x196ffe['result'][_0x9968('0x13')]);}})[_0x9968('0x14')](function(_0x2f7229){logger[_0x9968('0x11')](_0x9968('0xe'),_0x333748,_0x2f7229);_0x16d4cd(_0x2f7229);});});}
\ No newline at end of file
+var _0x51cb=['catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x4532e7,_0x2f125c){var _0x3d2d5e=function(_0x17b509){while(--_0x17b509){_0x4532e7['push'](_0x4532e7['shift']());}};_0x3d2d5e(++_0x2f125c);}(_0x51cb,0x1cd));var _0xb51c=function(_0x48e04f,_0x2e1ef9){_0x48e04f=_0x48e04f-0x0;var _0x1b36e5=_0x51cb[_0x48e04f];return _0x1b36e5;};'use strict';var _=require(_0xb51c('0x0'));var util=require(_0xb51c('0x1'));var moment=require(_0xb51c('0x2'));var BPromise=require(_0xb51c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb51c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb51c('0x5'));var logger=require(_0xb51c('0x6'))(_0xb51c('0x7'));var config=require('../../config/environment');var jayson=require(_0xb51c('0x8'));var client=jayson[_0xb51c('0x9')][_0xb51c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4decaa,_0x3125dc,_0x5f41b2){return new BPromise(function(_0x15c544,_0xfa18f7){return client[_0xb51c('0xb')](_0x4decaa,_0x5f41b2)['then'](function(_0x58f87b){logger['info'](_0xb51c('0xc'),_0x3125dc,_0xb51c('0xd'));logger[_0xb51c('0xe')](_0xb51c('0xf'),_0x3125dc,_0xb51c('0xd'),JSON[_0xb51c('0x10')](_0x58f87b));if(_0x58f87b['error']){if(_0x58f87b[_0xb51c('0x11')][_0xb51c('0x12')]===0x1f4){logger[_0xb51c('0x11')](_0xb51c('0xc'),_0x3125dc,_0x58f87b['error'][_0xb51c('0x13')]);return _0xfa18f7(_0x58f87b[_0xb51c('0x11')]['message']);}logger[_0xb51c('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3125dc,_0x58f87b[_0xb51c('0x11')][_0xb51c('0x13')]);return _0x15c544(_0x58f87b[_0xb51c('0x11')][_0xb51c('0x13')]);}else{logger[_0xb51c('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3125dc,_0xb51c('0xd'));_0x15c544(_0x58f87b[_0xb51c('0x15')][_0xb51c('0x13')]);}})[_0xb51c('0x16')](function(_0x5ae595){logger['error'](_0xb51c('0xc'),_0x3125dc,_0x5ae595);_0xfa18f7(_0x5ae595);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index e91ebd4..bc48245 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 _0xde43=['create','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get','describe','/:id','show','post'];(function(_0x381d54,_0x1d3a82){var _0x2bc0be=function(_0x34570e){while(--_0x34570e){_0x381d54['push'](_0x381d54['shift']());}};_0x2bc0be(++_0x1d3a82);}(_0xde43,0xab));var _0x3de4=function(_0x5347f1,_0x1122ab){_0x5347f1=_0x5347f1-0x0;var _0x31216d=_0xde43[_0x5347f1];return _0x31216d;};'use strict';var multer=require(_0x3de4('0x0'));var util=require(_0x3de4('0x1'));var path=require(_0x3de4('0x2'));var timeout=require(_0x3de4('0x3'));var express=require(_0x3de4('0x4'));var router=express[_0x3de4('0x5')]();var fs_extra=require(_0x3de4('0x6'));var auth=require(_0x3de4('0x7'));var interaction=require(_0x3de4('0x8'));var config=require(_0x3de4('0x9'));var controller=require(_0x3de4('0xa'));router['get']('/',auth[_0x3de4('0xb')](),controller[_0x3de4('0xc')]);router[_0x3de4('0xd')]('/describe',auth[_0x3de4('0xb')](),controller[_0x3de4('0xe')]);router['get'](_0x3de4('0xf'),auth[_0x3de4('0xb')](),controller[_0x3de4('0x10')]);router[_0x3de4('0x11')]('/',auth[_0x3de4('0xb')](),controller[_0x3de4('0x12')]);router[_0x3de4('0x13')]('/:id',auth[_0x3de4('0xb')](),controller[_0x3de4('0x14')]);router['delete']('/:id',auth[_0x3de4('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x7b7c=['index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','util','path','connect-timeout','fs-extra','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated'];(function(_0x2a06f1,_0x5d71e0){var _0x5c43b1=function(_0x20abbc){while(--_0x20abbc){_0x2a06f1['push'](_0x2a06f1['shift']());}};_0x5c43b1(++_0x5d71e0);}(_0x7b7c,0x161));var _0xc7b7=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x7b7c[_0x4154a6];return _0x3b2786;};'use strict';var multer=require('multer');var util=require(_0xc7b7('0x0'));var path=require(_0xc7b7('0x1'));var timeout=require(_0xc7b7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc7b7('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc7b7('0x4'));var config=require('../../config/environment');var controller=require(_0xc7b7('0x5'));router[_0xc7b7('0x6')]('/',auth[_0xc7b7('0x7')](),controller[_0xc7b7('0x8')]);router[_0xc7b7('0x6')](_0xc7b7('0x9'),auth[_0xc7b7('0x7')](),controller[_0xc7b7('0xa')]);router['get']('/:id',auth[_0xc7b7('0x7')](),controller[_0xc7b7('0xb')]);router[_0xc7b7('0xc')]('/',auth[_0xc7b7('0x7')](),controller[_0xc7b7('0xd')]);router[_0xc7b7('0xe')](_0xc7b7('0xf'),auth[_0xc7b7('0x7')](),controller[_0xc7b7('0x10')]);router[_0xc7b7('0x11')](_0xc7b7('0xf'),auth[_0xc7b7('0x7')](),controller[_0xc7b7('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 84c459c..307efc4 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 _0x3d21=['INTEGER','sequelize','mouseOver','timeout','STRING'];(function(_0x42902b,_0x3d4954){var _0xb69b90=function(_0x2fd92b){while(--_0x2fd92b){_0x42902b['push'](_0x42902b['shift']());}};_0xb69b90(++_0x3d4954);}(_0x3d21,0x1c8));var _0x13d2=function(_0x92f9,_0x38fee2){_0x92f9=_0x92f9-0x0;var _0x783918=_0x3d21[_0x92f9];return _0x783918;};'use strict';var Sequelize=require(_0x13d2('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x13d2('0x1'),_0x13d2('0x2')),'defaultValue':_0x13d2('0x1')},'selector':{'type':Sequelize[_0x13d2('0x3')]},'timeout':{'type':Sequelize[_0x13d2('0x4')]}};
\ No newline at end of file
+var _0xf3e1=['exports','STRING','ENUM','mouseOver','INTEGER'];(function(_0x62cbcd,_0x1e61c7){var _0x16d7ac=function(_0x547124){while(--_0x547124){_0x62cbcd['push'](_0x62cbcd['shift']());}};_0x16d7ac(++_0x1e61c7);}(_0xf3e1,0x18b));var _0x1f3e=function(_0x43316d,_0x5ebd8f){_0x43316d=_0x43316d-0x0;var _0x52d343=_0xf3e1[_0x43316d];return _0x52d343;};'use strict';var Sequelize=require('sequelize');module[_0x1f3e('0x0')]={'name':{'type':Sequelize[_0x1f3e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1f3e('0x2')](_0x1f3e('0x3'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x1f3e('0x1')]},'timeout':{'type':Sequelize[_0x1f3e('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 06d761e..9c6f00d 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 _0xe5fc=['send','show','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','length','model','includeAll','options','find','catch','create','body','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','end','status','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name'];(function(_0x9a93d,_0x40e73d){var _0xba8315=function(_0x4a6ba0){while(--_0x4a6ba0){_0x9a93d['push'](_0x9a93d['shift']());}};_0xba8315(++_0x40e73d);}(_0xe5fc,0x12f));var _0xce5f=function(_0x2cce37,_0xcb6d43){_0x2cce37=_0x2cce37-0x0;var _0x446c30=_0xe5fc[_0x2cce37];return _0x446c30;};'use strict';var pdf=require(_0xce5f('0x0'));var emlformat=require(_0xce5f('0x1'));var rimraf=require(_0xce5f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xce5f('0x3'));var rp=require(_0xce5f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xce5f('0x5'));var util=require('util');var path=require(_0xce5f('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xce5f('0x7'));var fs=require('fs');var fs_extra=require(_0xce5f('0x8'));var _=require(_0xce5f('0x9'));var squel=require(_0xce5f('0xa'));var crypto=require(_0xce5f('0xb'));var jsforce=require(_0xce5f('0xc'));var deskjs=require(_0xce5f('0xd'));var toCsv=require(_0xce5f('0xe'));var querystring=require(_0xce5f('0xf'));var Papa=require(_0xce5f('0x10'));var Redis=require('ioredis');var authService=require(_0xce5f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xce5f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xce5f('0x13'))('api');var utils=require(_0xce5f('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xce5f('0x15'))['db'];function respondWithStatusCode(_0x3a8737,_0x5e953){_0x5e953=_0x5e953||0xcc;return function(_0x1140d2){if(_0x1140d2){return _0x3a8737['sendStatus'](_0x5e953);}return _0x3a8737['status'](_0x5e953)[_0xce5f('0x16')]();};}function respondWithResult(_0x3adab7,_0x4d170c){_0x4d170c=_0x4d170c||0xc8;return function(_0x403425){if(_0x403425){return _0x3adab7[_0xce5f('0x17')](_0x4d170c)['json'](_0x403425);}};}function respondWithFilteredResult(_0x49b8ed,_0x5565ef){return function(_0x384c89){if(_0x384c89){var _0x5d72bc=_0x384c89['count'],_0x7a0cbf=_0x5565ef[_0xce5f('0x18')],_0x49962c=_0x5565ef[_0xce5f('0x18')]+_0x5565ef[_0xce5f('0x19')],_0x3da4da;if(_0x49962c>=_0x5d72bc){_0x49962c=_0x5d72bc;_0x3da4da=0xc8;}else{_0x3da4da=0xce;}_0x49b8ed[_0xce5f('0x17')](_0x3da4da);return _0x49b8ed[_0xce5f('0x1a')](_0xce5f('0x1b'),_0x7a0cbf+'-'+_0x49962c+'/'+_0x5d72bc)[_0xce5f('0x1c')](_0x384c89);}return null;};}function patchUpdates(_0x327923){return function(_0x132204){try{jsonpatch[_0xce5f('0x1d')](_0x132204,_0x327923,!![]);}catch(_0x30469d){return BPromise[_0xce5f('0x1e')](_0x30469d);}return _0x132204[_0xce5f('0x1f')]();};}function saveUpdates(_0x22e64d,_0x2850bd){return function(_0xd88232){if(_0xd88232){return _0xd88232[_0xce5f('0x20')](_0x22e64d)[_0xce5f('0x21')](function(_0x1605f0){return _0x1605f0;});}return null;};}function removeEntity(_0x2e0b4f,_0x10f09b){return function(_0x1eeee0){if(_0x1eeee0){return _0x1eeee0[_0xce5f('0x22')]()['then'](function(){_0x2e0b4f['status'](0xcc)[_0xce5f('0x16')]();});}};}function handleEntityNotFound(_0x146c06,_0x4ae57d){return function(_0x31d4b2){if(!_0x31d4b2){_0x146c06[_0xce5f('0x23')](0x194);}return _0x31d4b2;};}function handleError(_0x20b2c0,_0x95c1ee){_0x95c1ee=_0x95c1ee||0x1f4;return function(_0x4841fd){logger[_0xce5f('0x24')](_0x4841fd[_0xce5f('0x25')]);if(_0x4841fd['name']){delete _0x4841fd[_0xce5f('0x26')];}_0x20b2c0['status'](_0x95c1ee)[_0xce5f('0x27')](_0x4841fd);};}exports[_0xce5f('0x28')]=function(_0x36a941,_0x367911){var _0x1fddd9={'raw':!![],'where':{'id':_0x36a941['params']['id']}},_0x2c971d={};_0x2c971d['model']=_[_0xce5f('0x29')](db[_0xce5f('0x2a')][_0xce5f('0x2b')]);_0x2c971d[_0xce5f('0x2c')]=_[_0xce5f('0x29')](_0x36a941[_0xce5f('0x2c')]);_0x2c971d['filters']=_[_0xce5f('0x2d')](_0x2c971d['model'],_0x2c971d[_0xce5f('0x2c')]);_0x1fddd9[_0xce5f('0x2e')]=_[_0xce5f('0x2d')](_0x2c971d['model'],qs['fields'](_0x36a941[_0xce5f('0x2c')][_0xce5f('0x2f')]));_0x1fddd9[_0xce5f('0x2e')]=_0x1fddd9[_0xce5f('0x2e')][_0xce5f('0x30')]?_0x1fddd9['attributes']:_0x2c971d[_0xce5f('0x31')];if(_0x36a941[_0xce5f('0x2c')][_0xce5f('0x32')]){_0x1fddd9['include']=[{'all':!![]}];}_0x1fddd9=_['merge']({},_0x1fddd9,_0x36a941[_0xce5f('0x33')]);return db[_0xce5f('0x2a')][_0xce5f('0x34')](_0x1fddd9)[_0xce5f('0x21')](handleEntityNotFound(_0x367911,null))[_0xce5f('0x21')](respondWithResult(_0x367911,null))[_0xce5f('0x35')](handleError(_0x367911,null));};exports['create']=function(_0x4988e6,_0x417c2c){return db[_0xce5f('0x2a')][_0xce5f('0x36')](_0x4988e6[_0xce5f('0x37')],{})[_0xce5f('0x21')](respondWithResult(_0x417c2c,0xc9))[_0xce5f('0x35')](handleError(_0x417c2c,null));};exports[_0xce5f('0x20')]=function(_0x324e0a,_0x7cfb40){if(_0x324e0a[_0xce5f('0x37')]['id']){delete _0x324e0a[_0xce5f('0x37')]['id'];}return db[_0xce5f('0x2a')][_0xce5f('0x34')]({'where':{'id':_0x324e0a[_0xce5f('0x38')]['id']}})[_0xce5f('0x21')](handleEntityNotFound(_0x7cfb40,null))[_0xce5f('0x21')](saveUpdates(_0x324e0a[_0xce5f('0x37')],null))[_0xce5f('0x21')](respondWithResult(_0x7cfb40,null))['catch'](handleError(_0x7cfb40,null));};exports[_0xce5f('0x22')]=function(_0x306f99,_0x3d69fe){return db['ChatProactiveAction'][_0xce5f('0x34')]({'where':{'id':_0x306f99[_0xce5f('0x38')]['id']}})[_0xce5f('0x21')](handleEntityNotFound(_0x3d69fe,null))[_0xce5f('0x21')](removeEntity(_0x3d69fe,null))[_0xce5f('0x35')](handleError(_0x3d69fe,null));};
\ No newline at end of file
+var _0xceab=['catch','create','body','destroy','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','status','offset','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','show','model','rawAttributes','query','keys','filters','intersection','fields','attributes','length','includeAll','include','merge','options','ChatProactiveAction','find'];(function(_0xc850f8,_0x2f9080){var _0x56ca2d=function(_0x49b320){while(--_0x49b320){_0xc850f8['push'](_0xc850f8['shift']());}};_0x56ca2d(++_0x2f9080);}(_0xceab,0x83));var _0xbcea=function(_0x3b637e,_0x25dc7e){_0x3b637e=_0x3b637e-0x0;var _0x56ec54=_0xceab[_0x3b637e];return _0x56ec54;};'use strict';var pdf=require(_0xbcea('0x0'));var emlformat=require(_0xbcea('0x1'));var rimraf=require(_0xbcea('0x2'));var zipdir=require(_0xbcea('0x3'));var jsonpatch=require(_0xbcea('0x4'));var rp=require(_0xbcea('0x5'));var moment=require(_0xbcea('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xbcea('0x7'));var util=require(_0xbcea('0x8'));var path=require(_0xbcea('0x9'));var sox=require(_0xbcea('0xa'));var csv=require(_0xbcea('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbcea('0xc'));var _=require(_0xbcea('0xd'));var squel=require('squel');var crypto=require(_0xbcea('0xe'));var jsforce=require(_0xbcea('0xf'));var deskjs=require(_0xbcea('0x10'));var toCsv=require(_0xbcea('0xb'));var querystring=require(_0xbcea('0x11'));var Papa=require(_0xbcea('0x12'));var Redis=require(_0xbcea('0x13'));var authService=require(_0xbcea('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xbcea('0x15'));var hardwareService=require(_0xbcea('0x16'));var logger=require('../../config/logger')(_0xbcea('0x17'));var utils=require(_0xbcea('0x18'));var config=require(_0xbcea('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x478fd7,_0x20a74e){_0x20a74e=_0x20a74e||0xcc;return function(_0x2c8421){if(_0x2c8421){return _0x478fd7[_0xbcea('0x1a')](_0x20a74e);}return _0x478fd7['status'](_0x20a74e)[_0xbcea('0x1b')]();};}function respondWithResult(_0x256140,_0x21c404){_0x21c404=_0x21c404||0xc8;return function(_0x291001){if(_0x291001){return _0x256140[_0xbcea('0x1c')](_0x21c404)['json'](_0x291001);}};}function respondWithFilteredResult(_0x58fb15,_0x466ce2){return function(_0xbd13f5){if(_0xbd13f5){var _0x337cf7=_0xbd13f5['count'],_0x497adc=_0x466ce2[_0xbcea('0x1d')],_0x4f19a0=_0x466ce2[_0xbcea('0x1d')]+_0x466ce2['limit'],_0x3b3bda;if(_0x4f19a0>=_0x337cf7){_0x4f19a0=_0x337cf7;_0x3b3bda=0xc8;}else{_0x3b3bda=0xce;}_0x58fb15[_0xbcea('0x1c')](_0x3b3bda);return _0x58fb15[_0xbcea('0x1e')](_0xbcea('0x1f'),_0x497adc+'-'+_0x4f19a0+'/'+_0x337cf7)[_0xbcea('0x20')](_0xbd13f5);}return null;};}function patchUpdates(_0x461693){return function(_0x5069d7){try{jsonpatch[_0xbcea('0x21')](_0x5069d7,_0x461693,!![]);}catch(_0x15ce2f){return BPromise[_0xbcea('0x22')](_0x15ce2f);}return _0x5069d7[_0xbcea('0x23')]();};}function saveUpdates(_0x45d9de,_0x4c73cc){return function(_0x17bfa4){if(_0x17bfa4){return _0x17bfa4[_0xbcea('0x24')](_0x45d9de)[_0xbcea('0x25')](function(_0x59a298){return _0x59a298;});}return null;};}function removeEntity(_0x2ba26a,_0x1d1d69){return function(_0x4c5d9a){if(_0x4c5d9a){return _0x4c5d9a['destroy']()['then'](function(){_0x2ba26a[_0xbcea('0x1c')](0xcc)[_0xbcea('0x1b')]();});}};}function handleEntityNotFound(_0x50c4a3,_0x2fc1d7){return function(_0xee7074){if(!_0xee7074){_0x50c4a3[_0xbcea('0x1a')](0x194);}return _0xee7074;};}function handleError(_0x5c20d2,_0x1db21c){_0x1db21c=_0x1db21c||0x1f4;return function(_0x55867d){logger[_0xbcea('0x26')](_0x55867d[_0xbcea('0x27')]);if(_0x55867d[_0xbcea('0x28')]){delete _0x55867d[_0xbcea('0x28')];}_0x5c20d2[_0xbcea('0x1c')](_0x1db21c)[_0xbcea('0x29')](_0x55867d);};}exports[_0xbcea('0x2a')]=function(_0x630501,_0x3cc1d8){var _0x2692a6={'raw':!![],'where':{'id':_0x630501['params']['id']}},_0x28e2c1={};_0x28e2c1[_0xbcea('0x2b')]=_['keys'](db['ChatProactiveAction'][_0xbcea('0x2c')]);_0x28e2c1[_0xbcea('0x2d')]=_[_0xbcea('0x2e')](_0x630501[_0xbcea('0x2d')]);_0x28e2c1[_0xbcea('0x2f')]=_[_0xbcea('0x30')](_0x28e2c1[_0xbcea('0x2b')],_0x28e2c1['query']);_0x2692a6['attributes']=_['intersection'](_0x28e2c1[_0xbcea('0x2b')],qs[_0xbcea('0x31')](_0x630501['query'][_0xbcea('0x31')]));_0x2692a6[_0xbcea('0x32')]=_0x2692a6[_0xbcea('0x32')][_0xbcea('0x33')]?_0x2692a6[_0xbcea('0x32')]:_0x28e2c1[_0xbcea('0x2b')];if(_0x630501[_0xbcea('0x2d')][_0xbcea('0x34')]){_0x2692a6[_0xbcea('0x35')]=[{'all':!![]}];}_0x2692a6=_[_0xbcea('0x36')]({},_0x2692a6,_0x630501[_0xbcea('0x37')]);return db[_0xbcea('0x38')][_0xbcea('0x39')](_0x2692a6)[_0xbcea('0x25')](handleEntityNotFound(_0x3cc1d8,null))[_0xbcea('0x25')](respondWithResult(_0x3cc1d8,null))[_0xbcea('0x3a')](handleError(_0x3cc1d8,null));};exports[_0xbcea('0x3b')]=function(_0x54976a,_0xbdca56){return db[_0xbcea('0x38')]['create'](_0x54976a[_0xbcea('0x3c')],{})[_0xbcea('0x25')](respondWithResult(_0xbdca56,0xc9))[_0xbcea('0x3a')](handleError(_0xbdca56,null));};exports['update']=function(_0x2caca2,_0x5d9e23){if(_0x2caca2[_0xbcea('0x3c')]['id']){delete _0x2caca2[_0xbcea('0x3c')]['id'];}return db[_0xbcea('0x38')][_0xbcea('0x39')]({'where':{'id':_0x2caca2['params']['id']}})['then'](handleEntityNotFound(_0x5d9e23,null))[_0xbcea('0x25')](saveUpdates(_0x2caca2['body'],null))[_0xbcea('0x25')](respondWithResult(_0x5d9e23,null))[_0xbcea('0x3a')](handleError(_0x5d9e23,null));};exports[_0xbcea('0x3d')]=function(_0x5d2ead,_0x4b95b0){return db[_0xbcea('0x38')][_0xbcea('0x39')]({'where':{'id':_0x5d2ead[_0xbcea('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4b95b0,null))[_0xbcea('0x25')](removeEntity(_0x4b95b0,null))[_0xbcea('0x3a')](handleError(_0x4b95b0,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 8962522..ed72d63 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 _0xaed4=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','lodash'];(function(_0x3c7df7,_0x348a7e){var _0x4b0495=function(_0x5951bf){while(--_0x5951bf){_0x3c7df7['push'](_0x3c7df7['shift']());}};_0x4b0495(++_0x348a7e);}(_0xaed4,0x107));var _0x4aed=function(_0x1222fa,_0x39a7b9){_0x1222fa=_0x1222fa-0x0;var _0x1dcd74=_0xaed4[_0x1222fa];return _0x1dcd74;};'use strict';var _=require(_0x4aed('0x0'));var util=require(_0x4aed('0x1'));var logger=require('../../config/logger')(_0x4aed('0x2'));var moment=require(_0x4aed('0x3'));var BPromise=require(_0x4aed('0x4'));var rp=require(_0x4aed('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4aed('0x6'));var config=require(_0x4aed('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0x4aed('0x8')]=function(_0xa790dc,_0xf6c793){return _0xa790dc[_0x4aed('0x9')](_0x4aed('0xa'),attributes,{'tableName':_0x4aed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x780c=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x15f972,_0x4a1fc7){var _0x3d916e=function(_0x4efd86){while(--_0x4efd86){_0x15f972['push'](_0x15f972['shift']());}};_0x3d916e(++_0x4a1fc7);}(_0x780c,0x1d4));var _0xc780=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x780c[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0xc780('0x0'));var util=require(_0xc780('0x1'));var logger=require(_0xc780('0x2'))(_0xc780('0x3'));var moment=require(_0xc780('0x4'));var BPromise=require(_0xc780('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc780('0x6'));var rimraf=require(_0xc780('0x7'));var config=require(_0xc780('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0xc780('0x9')]=function(_0x386312,_0x447a02){return _0x386312[_0xc780('0xa')](_0xc780('0xb'),attributes,{'tableName':_0xc780('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index c47fc59..6bb681b 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 _0x0dd0=['client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x514317,_0xee82c9){var _0x13805a=function(_0x38a89f){while(--_0x38a89f){_0x514317['push'](_0x514317['shift']());}};_0x13805a(++_0xee82c9);}(_0x0dd0,0x161));var _0x00dd=function(_0x2178c7,_0x1e0d3c){_0x2178c7=_0x2178c7-0x0;var _0x178a47=_0x0dd0[_0x2178c7];return _0x178a47;};'use strict';var _=require(_0x00dd('0x0'));var util=require(_0x00dd('0x1'));var moment=require(_0x00dd('0x2'));var BPromise=require(_0x00dd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x00dd('0x4'));var db=require(_0x00dd('0x5'))['db'];var utils=require(_0x00dd('0x6'));var logger=require(_0x00dd('0x7'))(_0x00dd('0x8'));var config=require(_0x00dd('0x9'));var jayson=require(_0x00dd('0xa'));var client=jayson[_0x00dd('0xb')][_0x00dd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1fef5f,_0x1cb701,_0x3c3312){return new BPromise(function(_0x1af189,_0x46fac5){return client[_0x00dd('0xd')](_0x1fef5f,_0x3c3312)[_0x00dd('0xe')](function(_0x502f5c){logger[_0x00dd('0xf')](_0x00dd('0x10'),_0x1cb701,'request\x20sent');logger[_0x00dd('0x11')](_0x00dd('0x12'),_0x1cb701,'request\x20sent',JSON[_0x00dd('0x13')](_0x502f5c));if(_0x502f5c[_0x00dd('0x14')]){if(_0x502f5c[_0x00dd('0x14')][_0x00dd('0x15')]===0x1f4){logger['error'](_0x00dd('0x10'),_0x1cb701,_0x502f5c[_0x00dd('0x14')][_0x00dd('0x16')]);return _0x46fac5(_0x502f5c['error'][_0x00dd('0x16')]);}logger[_0x00dd('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x1cb701,_0x502f5c['error'][_0x00dd('0x16')]);return _0x1af189(_0x502f5c[_0x00dd('0x14')][_0x00dd('0x16')]);}else{logger[_0x00dd('0xf')](_0x00dd('0x10'),_0x1cb701,_0x00dd('0x17'));_0x1af189(_0x502f5c[_0x00dd('0x18')][_0x00dd('0x16')]);}})[_0x00dd('0x19')](function(_0x9a3fa8){logger[_0x00dd('0x14')](_0x00dd('0x10'),_0x1cb701,_0x9a3fa8);_0x46fac5(_0x9a3fa8);});});}
\ No newline at end of file
+var _0xd0b9=['then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x53e9c6,_0x460d70){var _0x23ef39=function(_0x3004d5){while(--_0x3004d5){_0x53e9c6['push'](_0x53e9c6['shift']());}};_0x23ef39(++_0x460d70);}(_0xd0b9,0x6f));var _0x9d0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0b9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9d0b('0x0'));var util=require(_0x9d0b('0x1'));var moment=require(_0x9d0b('0x2'));var BPromise=require(_0x9d0b('0x3'));var rs=require(_0x9d0b('0x4'));var fs=require('fs');var Redis=require(_0x9d0b('0x5'));var db=require(_0x9d0b('0x6'))['db'];var utils=require(_0x9d0b('0x7'));var logger=require(_0x9d0b('0x8'))('rpc');var config=require(_0x9d0b('0x9'));var jayson=require(_0x9d0b('0xa'));var client=jayson[_0x9d0b('0xb')][_0x9d0b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14d76f,_0x3fce59,_0x2ee830){return new BPromise(function(_0x312fac,_0xbac113){return client[_0x9d0b('0xd')](_0x14d76f,_0x2ee830)[_0x9d0b('0xe')](function(_0xaf0dd2){logger[_0x9d0b('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x3fce59,_0x9d0b('0x10'));logger[_0x9d0b('0x11')](_0x9d0b('0x12'),_0x3fce59,'request\x20sent',JSON[_0x9d0b('0x13')](_0xaf0dd2));if(_0xaf0dd2[_0x9d0b('0x14')]){if(_0xaf0dd2[_0x9d0b('0x14')]['code']===0x1f4){logger[_0x9d0b('0x14')](_0x9d0b('0x15'),_0x3fce59,_0xaf0dd2[_0x9d0b('0x14')][_0x9d0b('0x16')]);return _0xbac113(_0xaf0dd2[_0x9d0b('0x14')][_0x9d0b('0x16')]);}logger['error'](_0x9d0b('0x15'),_0x3fce59,_0xaf0dd2[_0x9d0b('0x14')][_0x9d0b('0x16')]);return _0x312fac(_0xaf0dd2['error'][_0x9d0b('0x16')]);}else{logger[_0x9d0b('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x3fce59,'request\x20sent');_0x312fac(_0xaf0dd2[_0x9d0b('0x17')][_0x9d0b('0x16')]);}})[_0x9d0b('0x18')](function(_0x384061){logger[_0x9d0b('0x14')](_0x9d0b('0x15'),_0x3fce59,_0x384061);_0xbac113(_0x384061);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index a00f96c..6151272 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 _0xd19d=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0xa30766,_0x6f613e){var _0x24e780=function(_0x3d58fb){while(--_0x3d58fb){_0xa30766['push'](_0xa30766['shift']());}};_0x24e780(++_0x6f613e);}(_0xd19d,0x156));var _0xdd19=function(_0x2d6604,_0x5c52a6){_0x2d6604=_0x2d6604-0x0;var _0x27d5ea=_0xd19d[_0x2d6604];return _0x27d5ea;};'use strict';var multer=require('multer');var util=require(_0xdd19('0x0'));var path=require(_0xdd19('0x1'));var timeout=require(_0xdd19('0x2'));var express=require(_0xdd19('0x3'));var router=express[_0xdd19('0x4')]();var fs_extra=require(_0xdd19('0x5'));var auth=require(_0xdd19('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdd19('0x7'));router[_0xdd19('0x8')](_0xdd19('0x9'),auth[_0xdd19('0xa')](),controller[_0xdd19('0xb')]);router[_0xdd19('0xc')]('/',auth[_0xdd19('0xa')](),controller[_0xdd19('0xd')]);router[_0xdd19('0xe')](_0xdd19('0x9'),auth['isAuthenticated'](),controller[_0xdd19('0xf')]);router[_0xdd19('0x10')](_0xdd19('0x9'),auth[_0xdd19('0xa')](),controller[_0xdd19('0x11')]);module[_0xdd19('0x12')]=router;
\ No newline at end of file
+var _0xc669=['show','post','create','isAuthenticated','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./chatProactiveAction.controller','/:id'];(function(_0x53b443,_0x1669f7){var _0x32b461=function(_0x347057){while(--_0x347057){_0x53b443['push'](_0x53b443['shift']());}};_0x32b461(++_0x1669f7);}(_0xc669,0xc7));var _0x9c66=function(_0x395104,_0x5de270){_0x395104=_0x395104-0x0;var _0x4360bb=_0xc669[_0x395104];return _0x4360bb;};'use strict';var multer=require(_0x9c66('0x0'));var util=require(_0x9c66('0x1'));var path=require(_0x9c66('0x2'));var timeout=require(_0x9c66('0x3'));var express=require(_0x9c66('0x4'));var router=express['Router']();var fs_extra=require(_0x9c66('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9c66('0x6'));var config=require('../../config/environment');var controller=require(_0x9c66('0x7'));router['get'](_0x9c66('0x8'),auth['isAuthenticated'](),controller[_0x9c66('0x9')]);router[_0x9c66('0xa')]('/',auth['isAuthenticated'](),controller[_0x9c66('0xb')]);router['put'](_0x9c66('0x8'),auth[_0x9c66('0xc')](),controller[_0x9c66('0xd')]);router[_0x9c66('0xe')]('/:id',auth[_0x9c66('0xc')](),controller['destroy']);module[_0x9c66('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 3c63c6f..78b9a72 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 _0x41bd=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x5ea1b3,_0x7050cd){var _0x12c7ab=function(_0x4b3094){while(--_0x4b3094){_0x5ea1b3['push'](_0x5ea1b3['shift']());}};_0x12c7ab(++_0x7050cd);}(_0x41bd,0x14e));var _0xd41b=function(_0x417583,_0x1a9a17){_0x417583=_0x417583-0x0;var _0x35bb9f=_0x41bd[_0x417583];return _0x35bb9f;};'use strict';var Sequelize=require(_0xd41b('0x0'));module[_0xd41b('0x1')]={'name':{'type':Sequelize[_0xd41b('0x2')],'unique':_0xd41b('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd41b('0x2')]},'timeout':{'type':Sequelize[_0xd41b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd41b('0x5')](_0xd41b('0x6'),_0xd41b('0x7'),_0xd41b('0x8'))}};
\ No newline at end of file
+var _0x1bdd=['name','INTEGER','rrmemory','roundrobin','sequelize','exports','STRING'];(function(_0x12d6de,_0xccc040){var _0x32923b=function(_0x1b150f){while(--_0x1b150f){_0x12d6de['push'](_0x12d6de['shift']());}};_0x32923b(++_0xccc040);}(_0x1bdd,0x10e));var _0xd1bd=function(_0x3e762f,_0x52155f){_0x3e762f=_0x3e762f-0x0;var _0x5277a3=_0x1bdd[_0x3e762f];return _0x5277a3;};'use strict';var Sequelize=require(_0xd1bd('0x0'));module[_0xd1bd('0x1')]={'name':{'type':Sequelize[_0xd1bd('0x2')],'unique':_0xd1bd('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd1bd('0x2')]},'timeout':{'type':Sequelize[_0xd1bd('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd1bd('0x5'),'beepall',_0xd1bd('0x6'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 206f181..f7ed889 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 _0xef8a=['filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','order','ChatQueueId','User','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','each','UserChatQueue','forEach','emit','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','SELECT','TeamId','value','transaction','isEmpty','userChatQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','html-pdf','eml-format','rimraf','moment','bluebird','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','register','jayson/promise','client','http','request','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','keys'];(function(_0x1b672b,_0x384132){var _0x31f42e=function(_0x2f2604){while(--_0x2f2604){_0x1b672b['push'](_0x1b672b['shift']());}};_0x31f42e(++_0x384132);}(_0xef8a,0xed));var _0xaef8=function(_0x51ec61,_0xf9d1e3){_0x51ec61=_0x51ec61-0x0;var _0x223200=_0xef8a[_0x51ec61];return _0x223200;};'use strict';var pdf=require(_0xaef8('0x0'));var emlformat=require(_0xaef8('0x1'));var rimraf=require(_0xaef8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaef8('0x3'));var BPromise=require(_0xaef8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xaef8('0x5'));var sox=require(_0xaef8('0x6'));var csv=require(_0xaef8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaef8('0x8'));var _=require(_0xaef8('0x9'));var squel=require('squel');var crypto=require(_0xaef8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xaef8('0xb'));var toCsv=require(_0xaef8('0x7'));var querystring=require(_0xaef8('0xc'));var Papa=require(_0xaef8('0xd'));var Redis=require(_0xaef8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xaef8('0xf'));var as=require(_0xaef8('0x10'));var hardwareService=require(_0xaef8('0x11'));var logger=require(_0xaef8('0x12'))(_0xaef8('0x13'));var utils=require(_0xaef8('0x14'));var config=require(_0xaef8('0x15'));var licenseUtil=require(_0xaef8('0x16'));var db=require(_0xaef8('0x17'))['db'];config['redis']=_[_0xaef8('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xaef8('0x19'))(new Redis(config[_0xaef8('0x1a')]));require('./chatQueue.socket')[_0xaef8('0x1b')](socket);var jayson=require(_0xaef8('0x1c'));var client=jayson[_0xaef8('0x1d')][_0xaef8('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x53d6d5,_0x5e9967,_0x30d4ba,_0x30557a){return new BPromise(function(_0x2aba76,_0x197d2b){var _0x3a033a=_0x30557a||client;return _0x3a033a[_0xaef8('0x1f')](_0x53d6d5,_0x30d4ba)['then'](function(_0x5f0ba9){logger[_0xaef8('0x20')](_0xaef8('0x21'),_0x5e9967,'request\x20sent');logger[_0xaef8('0x22')](_0xaef8('0x23'),_0x5e9967,_0xaef8('0x24'),JSON[_0xaef8('0x25')](_0x5f0ba9));if(_0x5f0ba9['error']){if(_0x5f0ba9[_0xaef8('0x26')][_0xaef8('0x27')]===0x1f4){logger[_0xaef8('0x26')](_0xaef8('0x21'),_0x5e9967,_0x5f0ba9[_0xaef8('0x26')]['message']);return _0x197d2b(_0x5f0ba9['error'][_0xaef8('0x28')]);}logger[_0xaef8('0x26')](_0xaef8('0x21'),_0x5e9967,_0x5f0ba9[_0xaef8('0x26')][_0xaef8('0x28')]);return _0x2aba76(_0x5f0ba9[_0xaef8('0x26')]['message']);}else{logger[_0xaef8('0x20')](_0xaef8('0x21'),_0x5e9967,_0xaef8('0x24'));_0x2aba76(_0x5f0ba9[_0xaef8('0x29')][_0xaef8('0x28')]);}})['catch'](function(_0x563aa9){logger[_0xaef8('0x26')](_0xaef8('0x21'),_0x5e9967,_0x563aa9);_0x197d2b(_0x563aa9);});});}function respondWithStatusCode(_0x399396,_0x31cc46){_0x31cc46=_0x31cc46||0xcc;return function(_0x340a00){if(_0x340a00){return _0x399396[_0xaef8('0x2a')](_0x31cc46);}return _0x399396[_0xaef8('0x2b')](_0x31cc46)[_0xaef8('0x2c')]();};}function respondWithResult(_0x2cd37d,_0x25c425){_0x25c425=_0x25c425||0xc8;return function(_0x2c0920){if(_0x2c0920){return _0x2cd37d[_0xaef8('0x2b')](_0x25c425)[_0xaef8('0x2d')](_0x2c0920);}};}function respondWithFilteredResult(_0x35ad74,_0x51defd){return function(_0x260c9f){if(_0x260c9f){var _0x1d90c9=_0x260c9f[_0xaef8('0x2e')],_0x50cbb4=_0x51defd[_0xaef8('0x2f')],_0x58cabc=_0x51defd[_0xaef8('0x2f')]+_0x51defd[_0xaef8('0x30')],_0x58e590;if(_0x58cabc>=_0x1d90c9){_0x58cabc=_0x1d90c9;_0x58e590=0xc8;}else{_0x58e590=0xce;}_0x35ad74['status'](_0x58e590);return _0x35ad74[_0xaef8('0x31')](_0xaef8('0x32'),_0x50cbb4+'-'+_0x58cabc+'/'+_0x1d90c9)['json'](_0x260c9f);}return null;};}function patchUpdates(_0x4329f1){return function(_0x77b59){try{jsonpatch['apply'](_0x77b59,_0x4329f1,!![]);}catch(_0x4d4566){return BPromise[_0xaef8('0x33')](_0x4d4566);}return _0x77b59[_0xaef8('0x34')]();};}function saveUpdates(_0x5c4108,_0x5acec4){return function(_0x3c8a9c){if(_0x3c8a9c){return _0x3c8a9c[_0xaef8('0x35')](_0x5c4108)[_0xaef8('0x36')](function(_0x3bc99a){return _0x3bc99a;});}return null;};}function removeEntity(_0x477b0a,_0x5595b1){return function(_0x57494c){if(_0x57494c){return _0x57494c[_0xaef8('0x37')]()[_0xaef8('0x36')](function(){var _0x3097ee=_0x57494c[_0xaef8('0x38')]({'plain':!![]});var _0x541804=_0xaef8('0x39');return db[_0xaef8('0x3a')][_0xaef8('0x37')]({'where':{'type':_0x541804,'resourceId':_0x3097ee['id']}})[_0xaef8('0x36')](function(){return _0x57494c;});})[_0xaef8('0x36')](function(){_0x477b0a[_0xaef8('0x2b')](0xcc)[_0xaef8('0x2c')]();});}};}function handleEntityNotFound(_0xcfe93,_0x80dbe1){return function(_0x37a7fb){if(!_0x37a7fb){_0xcfe93[_0xaef8('0x2a')](0x194);}return _0x37a7fb;};}function handleError(_0x3ca673,_0xcd2b3e){_0xcd2b3e=_0xcd2b3e||0x1f4;return function(_0x37ca4e){logger[_0xaef8('0x26')](_0x37ca4e[_0xaef8('0x3b')]);if(_0x37ca4e[_0xaef8('0x3c')]){delete _0x37ca4e[_0xaef8('0x3c')];}_0x3ca673[_0xaef8('0x2b')](_0xcd2b3e)[_0xaef8('0x3d')](_0x37ca4e);};}exports[_0xaef8('0x3e')]=function(_0x5530eb,_0x29ed10){var _0x301480={},_0x5179b9={},_0xe5969f={'count':0x0,'rows':[]};var _0x518f46=_[_0xaef8('0x3f')](db[_0xaef8('0x40')][_0xaef8('0x41')],function(_0x507634){return{'name':_0x507634[_0xaef8('0x42')],'type':_0x507634['type'][_0xaef8('0x43')]};});_0x5179b9['model']=_[_0xaef8('0x3f')](_0x518f46,_0xaef8('0x3c'));_0x5179b9['query']=_[_0xaef8('0x44')](_0x5530eb['query']);_0x5179b9[_0xaef8('0x45')]=_[_0xaef8('0x46')](_0x5179b9[_0xaef8('0x47')],_0x5179b9[_0xaef8('0x48')]);_0x301480[_0xaef8('0x49')]=_[_0xaef8('0x46')](_0x5179b9['model'],qs[_0xaef8('0x4a')](_0x5530eb[_0xaef8('0x48')][_0xaef8('0x4a')]));_0x301480['attributes']=_0x301480[_0xaef8('0x49')][_0xaef8('0x4b')]?_0x301480[_0xaef8('0x49')]:_0x5179b9[_0xaef8('0x47')];if(!_0x5530eb[_0xaef8('0x48')][_0xaef8('0x4c')](_0xaef8('0x4d'))){_0x301480['limit']=qs[_0xaef8('0x30')](_0x5530eb[_0xaef8('0x48')]['limit']);_0x301480['offset']=qs[_0xaef8('0x2f')](_0x5530eb[_0xaef8('0x48')]['offset']);}_0x301480['order']=qs[_0xaef8('0x4e')](_0x5530eb[_0xaef8('0x48')][_0xaef8('0x4e')]);_0x301480[_0xaef8('0x4f')]=qs['filters'](_[_0xaef8('0x50')](_0x5530eb['query'],_0x5179b9[_0xaef8('0x45')]),_0x518f46);if(_0x5530eb[_0xaef8('0x48')]['filter']){_0x301480['where']=_[_0xaef8('0x51')](_0x301480[_0xaef8('0x4f')],{'$or':_['map'](_0x518f46,function(_0x45043f){if(_0x45043f['type']!==_0xaef8('0x52')){var _0x4c81c9={};_0x4c81c9[_0x45043f['name']]={'$like':'%'+_0x5530eb['query'][_0xaef8('0x53')]+'%'};return _0x4c81c9;}})});}_0x301480=_[_0xaef8('0x51')]({},_0x301480,_0x5530eb[_0xaef8('0x54')]);var _0x1b3ab6={'where':_0x301480[_0xaef8('0x4f')]};return db['ChatQueue'][_0xaef8('0x2e')](_0x1b3ab6)[_0xaef8('0x36')](function(_0x16ebea){_0xe5969f[_0xaef8('0x2e')]=_0x16ebea;if(_0x5530eb[_0xaef8('0x48')]['includeAll']){_0x301480[_0xaef8('0x55')]=[{'all':!![]}];}return db[_0xaef8('0x40')][_0xaef8('0x56')](_0x301480);})[_0xaef8('0x36')](function(_0x1e9d06){_0xe5969f[_0xaef8('0x57')]=_0x1e9d06;return _0xe5969f;})[_0xaef8('0x36')](respondWithFilteredResult(_0x29ed10,_0x301480))[_0xaef8('0x58')](handleError(_0x29ed10,null));};exports[_0xaef8('0x59')]=function(_0x514ad7,_0x238b46){var _0x3e1380={'raw':!![],'where':{'id':_0x514ad7[_0xaef8('0x5a')]['id']}},_0x57cc1a={};_0x57cc1a[_0xaef8('0x47')]=_[_0xaef8('0x44')](db[_0xaef8('0x40')][_0xaef8('0x41')]);_0x57cc1a[_0xaef8('0x48')]=_[_0xaef8('0x44')](_0x514ad7[_0xaef8('0x48')]);_0x57cc1a[_0xaef8('0x45')]=_[_0xaef8('0x46')](_0x57cc1a[_0xaef8('0x47')],_0x57cc1a[_0xaef8('0x48')]);_0x3e1380[_0xaef8('0x49')]=_[_0xaef8('0x46')](_0x57cc1a[_0xaef8('0x47')],qs[_0xaef8('0x4a')](_0x514ad7['query'][_0xaef8('0x4a')]));_0x3e1380[_0xaef8('0x49')]=_0x3e1380[_0xaef8('0x49')][_0xaef8('0x4b')]?_0x3e1380[_0xaef8('0x49')]:_0x57cc1a[_0xaef8('0x47')];if(_0x514ad7['query'][_0xaef8('0x5b')]){_0x3e1380[_0xaef8('0x55')]=[{'all':!![]}];}_0x3e1380=_[_0xaef8('0x51')]({},_0x3e1380,_0x514ad7[_0xaef8('0x54')]);return db[_0xaef8('0x40')]['find'](_0x3e1380)[_0xaef8('0x36')](handleEntityNotFound(_0x238b46,null))['then'](respondWithResult(_0x238b46,null))['catch'](handleError(_0x238b46,null));};exports[_0xaef8('0x5c')]=function(_0x2c3bbd,_0x5d335d){return db[_0xaef8('0x40')][_0xaef8('0x5c')](_0x2c3bbd[_0xaef8('0x5d')],{})['then'](function(_0x46e076){var _0x47270d=_0x2c3bbd[_0xaef8('0x5e')]['get']({'plain':!![]});if(!_0x47270d)throw new Error(_0xaef8('0x5f'));if(_0x47270d[_0xaef8('0x60')]===_0xaef8('0x5e')){var _0x5cac78=_0x46e076['get']({'plain':!![]});var _0x138381='ChatQueues';return db[_0xaef8('0x61')][_0xaef8('0x62')]({'where':{'name':_0x138381,'userProfileId':_0x47270d[_0xaef8('0x63')]},'raw':!![]})[_0xaef8('0x36')](function(_0x1035d6){if(_0x1035d6&&_0x1035d6[_0xaef8('0x64')]===0x0){return db[_0xaef8('0x3a')][_0xaef8('0x5c')]({'name':_0x5cac78['name'],'resourceId':_0x5cac78['id'],'type':_0x1035d6['name'],'sectionId':_0x1035d6['id']},{})[_0xaef8('0x36')](function(){return _0x46e076;});}else{return _0x46e076;}})[_0xaef8('0x58')](function(_0x1df2cd){logger['error'](_0xaef8('0x65'),_0x1df2cd);throw _0x1df2cd;});}return _0x46e076;})['then'](respondWithResult(_0x5d335d,0xc9))[_0xaef8('0x58')](handleError(_0x5d335d,null));};exports[_0xaef8('0x35')]=function(_0x14cada,_0x500571){if(_0x14cada[_0xaef8('0x5d')]['id']){delete _0x14cada[_0xaef8('0x5d')]['id'];}return db[_0xaef8('0x40')][_0xaef8('0x62')]({'where':{'id':_0x14cada[_0xaef8('0x5a')]['id']}})[_0xaef8('0x36')](handleEntityNotFound(_0x500571,null))[_0xaef8('0x36')](saveUpdates(_0x14cada[_0xaef8('0x5d')],null))[_0xaef8('0x36')](respondWithResult(_0x500571,null))[_0xaef8('0x58')](handleError(_0x500571,null));};exports[_0xaef8('0x37')]=function(_0x1f1141,_0x40d483){return db[_0xaef8('0x40')][_0xaef8('0x62')]({'where':{'id':_0x1f1141['params']['id']}})[_0xaef8('0x36')](handleEntityNotFound(_0x40d483,null))[_0xaef8('0x36')](removeEntity(_0x40d483,null))[_0xaef8('0x58')](handleError(_0x40d483,null));};exports[_0xaef8('0x66')]=function(_0x9effdb,_0x2c6d40){return db[_0xaef8('0x40')][_0xaef8('0x66')]()['then'](respondWithResult(_0x2c6d40,null))[_0xaef8('0x58')](handleError(_0x2c6d40,null));};exports[_0xaef8('0x67')]=function(_0x119560,_0x2e4b5d,_0x540c88){var _0x7cd8c8={'raw':!![],'where':{}},_0x22ce57={},_0x45386c;return db['ChatQueue'][_0xaef8('0x68')]({'where':{'id':_0x119560['params']['id']}})[_0xaef8('0x36')](handleEntityNotFound(_0x2e4b5d,null))[_0xaef8('0x36')](function(_0x27b467){if(_0x27b467){_0x45386c=_0x27b467[_0xaef8('0x38')]({'plain':!![]});_0x22ce57['model']=_[_0xaef8('0x44')](db['UserChatQueue'][_0xaef8('0x41')]);_0x22ce57[_0xaef8('0x48')]=_['keys'](_0x119560[_0xaef8('0x48')]);_0x22ce57['filters']=_[_0xaef8('0x46')](_0x22ce57[_0xaef8('0x47')],_0x22ce57['query']);_0x7cd8c8[_0xaef8('0x49')]=_['intersection'](_0x22ce57[_0xaef8('0x47')],qs[_0xaef8('0x4a')](_0x119560[_0xaef8('0x48')][_0xaef8('0x4a')]));_0x7cd8c8[_0xaef8('0x49')]=_0x7cd8c8[_0xaef8('0x49')][_0xaef8('0x4b')]?_0x7cd8c8[_0xaef8('0x49')]:_0x22ce57[_0xaef8('0x47')];if(!_0x119560['query']['hasOwnProperty'](_0xaef8('0x4d'))){_0x7cd8c8['limit']=qs[_0xaef8('0x30')](_0x119560[_0xaef8('0x48')][_0xaef8('0x30')]);_0x7cd8c8[_0xaef8('0x2f')]=qs['offset'](_0x119560['query'][_0xaef8('0x2f')]);}_0x7cd8c8[_0xaef8('0x69')]=qs['sort'](_0x119560[_0xaef8('0x48')]['sort']);_0x7cd8c8['where']=qs[_0xaef8('0x45')](_[_0xaef8('0x50')](_0x119560[_0xaef8('0x48')],_0x22ce57[_0xaef8('0x45')]));_0x7cd8c8[_0xaef8('0x4f')][_0xaef8('0x6a')]=_0x27b467['id'];if(_0x119560['query'][_0xaef8('0x53')]){_0x7cd8c8['where']=_[_0xaef8('0x51')](_0x7cd8c8[_0xaef8('0x4f')],{'$or':_[_0xaef8('0x3f')](_0x7cd8c8[_0xaef8('0x49')],function(_0x576d96){var _0x53783a={};_0x53783a[_0x576d96]={'$like':'%'+_0x119560[_0xaef8('0x48')][_0xaef8('0x53')]+'%'};return _0x53783a;})});}_0x7cd8c8=_[_0xaef8('0x51')]({},_0x7cd8c8,_0x119560[_0xaef8('0x54')]);return db['UserChatQueue'][_0xaef8('0x56')](_0x7cd8c8);}})[_0xaef8('0x36')](function(_0x5012f3){if(_0x5012f3){return db[_0xaef8('0x6b')]['findAndCountAll']({'where':{'id':_[_0xaef8('0x3f')](_0x5012f3,_0xaef8('0x6c')),'role':_0xaef8('0x6d')},'attributes':['id',_0xaef8('0x3c'),_0xaef8('0x6e'),_0xaef8('0x6f'),_0xaef8('0x70')]});}})['then'](function(_0x204d03){if(_0x204d03){return{'count':_0x204d03[_0xaef8('0x2e')],'rows':_[_0xaef8('0x3f')](_0x204d03[_0xaef8('0x57')],function(_0x434ea7){return{'membername':_0x434ea7['name'],'UserId':_0x434ea7['id'],'queue_name':_0x45386c['name'],'ChatQueueId':_0x45386c['id'],'interface':util[_0xaef8('0x71')](_0xaef8('0x72'),_0xaef8('0x73'),_0x434ea7[_0xaef8('0x3c')]),'penalty':0x0,'paused':_0x434ea7[_0xaef8('0x6e')],'createdAt':_0x434ea7[_0xaef8('0x70')],'updatedAt':_0x434ea7[_0xaef8('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xaef8('0x36')](respondWithFilteredResult(_0x2e4b5d,_0x7cd8c8))[_0xaef8('0x58')](handleError(_0x2e4b5d,null));};exports[_0xaef8('0x74')]=function(_0x38300b,_0x42be7f,_0x426af3){var _0x4722b6={};var _0x43bd9f={};var _0x383ca2;var _0x2360d0;return db[_0xaef8('0x40')]['findOne']({'where':{'id':_0x38300b[_0xaef8('0x5a')]['id']}})[_0xaef8('0x36')](handleEntityNotFound(_0x42be7f,null))['then'](function(_0x3666b6){if(_0x3666b6){_0x383ca2=_0x3666b6;_0x43bd9f[_0xaef8('0x47')]=_[_0xaef8('0x44')](db[_0xaef8('0x75')][_0xaef8('0x41')]);_0x43bd9f['query']=_[_0xaef8('0x44')](_0x38300b[_0xaef8('0x48')]);_0x43bd9f[_0xaef8('0x45')]=_[_0xaef8('0x46')](_0x43bd9f[_0xaef8('0x47')],_0x43bd9f[_0xaef8('0x48')]);_0x4722b6['attributes']=_['intersection'](_0x43bd9f[_0xaef8('0x47')],qs[_0xaef8('0x4a')](_0x38300b[_0xaef8('0x48')][_0xaef8('0x4a')]));_0x4722b6[_0xaef8('0x49')]=_0x4722b6[_0xaef8('0x49')][_0xaef8('0x4b')]?_0x4722b6[_0xaef8('0x49')]:_0x43bd9f[_0xaef8('0x47')];_0x4722b6[_0xaef8('0x69')]=qs[_0xaef8('0x4e')](_0x38300b['query'][_0xaef8('0x4e')]);_0x4722b6['where']=qs['filters'](_[_0xaef8('0x50')](_0x38300b[_0xaef8('0x48')],_0x43bd9f['filters']));if(_0x38300b[_0xaef8('0x48')]['filter']){_0x4722b6[_0xaef8('0x4f')]=_[_0xaef8('0x51')](_0x4722b6[_0xaef8('0x4f')],{'$or':_[_0xaef8('0x3f')](_0x4722b6[_0xaef8('0x49')],function(_0x164e8c){var _0x90bab8={};_0x90bab8[_0x164e8c]={'$like':'%'+_0x38300b[_0xaef8('0x48')]['filter']+'%'};return _0x90bab8;})});}_0x4722b6=_[_0xaef8('0x51')]({},_0x4722b6,_0x38300b[_0xaef8('0x54')]);return _0x383ca2['getTeams'](_0x4722b6);}})[_0xaef8('0x36')](function(_0x180fab){if(_0x180fab){_0x2360d0=_0x180fab[_0xaef8('0x4b')];if(!_0x38300b[_0xaef8('0x48')][_0xaef8('0x4c')](_0xaef8('0x4d'))){_0x4722b6[_0xaef8('0x30')]=qs['limit'](_0x38300b[_0xaef8('0x48')]['limit']);_0x4722b6[_0xaef8('0x2f')]=qs['offset'](_0x38300b[_0xaef8('0x48')][_0xaef8('0x2f')]);}return _0x383ca2['getTeams'](_0x4722b6);}})['then'](function(_0x204247){if(_0x204247){return _0x204247?{'count':_0x2360d0,'rows':_0x204247}:null;}})['then'](respondWithResult(_0x42be7f,null))[_0xaef8('0x58')](handleError(_0x42be7f,null));};exports[_0xaef8('0x76')]=function(_0xacb2bb,_0x4a13cf,_0x157e82){var _0x1ee743=_0xacb2bb[_0xaef8('0x5d')]['ids'];return db[_0xaef8('0x75')][_0xaef8('0x56')]({'where':{'id':_0x1ee743},'attributes':['id'],'include':[{'model':db[_0xaef8('0x6b')],'as':_0xaef8('0x77'),'attributes':['id',_0xaef8('0x3c'),_0xaef8('0x78'),_0xaef8('0x79'),_0xaef8('0x7a')],'raw':!![]}]})[_0xaef8('0x36')](function(_0x26e97c){if(_0x26e97c){var _0x120575=_[_0xaef8('0x7b')](_0x26e97c,function(_0x5ee2ff){var _0x3204b7=_0x5ee2ff[_0xaef8('0x38')]({'plain':!![]});return _0x3204b7[_0xaef8('0x77')];});return db[_0xaef8('0x40')][_0xaef8('0x62')]({'where':{'id':_0xacb2bb[_0xaef8('0x5a')]['id']}})[_0xaef8('0x36')](function(_0x4b3654){return db[_0xaef8('0x7c')]['transaction'](function(_0x4c89da){return _0x4b3654['addTeams'](_0x1ee743,{'transaction':_0x4c89da})[_0xaef8('0x36')](function(){return BPromise[_0xaef8('0x7d')](_0x120575,function(_0x13c986){return db[_0xaef8('0x7e')]['findOrCreate']({'where':{'UserId':_0x13c986['id'],'ChatQueueId':_0xacb2bb[_0xaef8('0x5a')]['id']},'transaction':_0x4c89da});});})[_0xaef8('0x36')](function(){_0x120575[_0xaef8('0x7f')](function(_0x400ae3){socket[_0xaef8('0x80')](_0xaef8('0x81'),{'UserId':_0x400ae3['id'],'ChatQueueId':_0x4b3654['id']});});});});});}})['then'](respondWithStatusCode(_0x4a13cf,null))[_0xaef8('0x58')](handleError(_0x4a13cf,null));};exports[_0xaef8('0x82')]=function(_0x316b8f,_0x37304f,_0x9a7a63){return db[_0xaef8('0x75')][_0xaef8('0x56')]({'where':{'id':_0x316b8f['query'][_0xaef8('0x83')]},'attributes':['id'],'include':[{'model':db[_0xaef8('0x6b')],'as':_0xaef8('0x77'),'attributes':['id'],'raw':!![]}]})[_0xaef8('0x36')](handleEntityNotFound(_0x37304f,null))[_0xaef8('0x36')](function(_0x4e6b4a){var _0xd85d2a=_[_0xaef8('0x3f')](_0x4e6b4a,'id');var _0x1e1b4a=[];var _0xb622a9=[];var _0x42df26=squel[_0xaef8('0x84')]();_0x42df26[_0xaef8('0x85')](_0xaef8('0x86'))[_0xaef8('0x87')](_0xaef8('0x88'),'tq')['join']('user_has_teams','ut',_0xaef8('0x89'))[_0xaef8('0x4f')](_0xaef8('0x8a'),_0x316b8f[_0xaef8('0x5a')]['id']);for(var _0x558afd=0x0;_0x558afd<_0x4e6b4a[_0xaef8('0x4b')];_0x558afd+=0x1){let _0x576074=_0x4e6b4a[_0x558afd];for(var _0x86a2ca=0x0;_0x86a2ca<_0x576074['Agents'][_0xaef8('0x4b')];_0x86a2ca+=0x1){let _0x1e2dd8=_0x576074['Agents'][_0x86a2ca];var _0x30ca08=_0x42df26[_0xaef8('0x8b')]();_0x30ca08['where'](_0xaef8('0x8c'),_0x1e2dd8['id']);_0xb622a9[_0xaef8('0x8d')](db[_0xaef8('0x7c')][_0xaef8('0x48')](_0x30ca08['toString'](),{'type':db[_0xaef8('0x7c')]['QueryTypes'][_0xaef8('0x8e')]})['then'](function(_0x120096){if(_0x120096[_0xaef8('0x4b')]===0x1){return _0x1e2dd8['id'];}else{var _0x1076e7=_['every'](_[_0xaef8('0x3f')](_0x120096,_0xaef8('0x8f')),function(_0x48c341){return _['includes'](_0xd85d2a,_0x48c341);});if(_0x1076e7){return _0x1e2dd8['id'];}}}));}}return BPromise['all'](_0xb622a9)[_0xaef8('0x36')](function(_0x4674b5){_0x1e1b4a=_(_0x1e1b4a)['union'](_0x4674b5)['compact']()[_0xaef8('0x90')]();return db[_0xaef8('0x40')][_0xaef8('0x62')]({'where':{'id':_0x316b8f['params']['id']}})[_0xaef8('0x36')](function(_0x51abb5){return db[_0xaef8('0x7c')][_0xaef8('0x91')](function(_0x1bd5e2){return _0x51abb5['removeTeams'](_0x316b8f[_0xaef8('0x48')][_0xaef8('0x83')],{'transaction':_0x1bd5e2})[_0xaef8('0x36')](function(){if(!_[_0xaef8('0x92')](_0x1e1b4a)){return _0x51abb5['removeAgents'](_0x1e1b4a,{'transaction':_0x1bd5e2});}})[_0xaef8('0x36')](function(){_0x1e1b4a[_0xaef8('0x7f')](function(_0x2397c9){socket['emit'](_0xaef8('0x93'),{'UserId':_0x2397c9,'ChatQueueId':_0x51abb5['id']});});});});});});})[_0xaef8('0x36')](respondWithStatusCode(_0x37304f,null))[_0xaef8('0x58')](handleError(_0x37304f,null));};exports[_0xaef8('0x94')]=function(_0x515fe9,_0x1054b7,_0x57cfa0){return db[_0xaef8('0x40')][_0xaef8('0x62')]({'where':{'id':_0x515fe9[_0xaef8('0x5a')]['id']}})[_0xaef8('0x36')](handleEntityNotFound(_0x1054b7,null))[_0xaef8('0x36')](function(_0x206288){if(_0x206288){return _0x206288[_0xaef8('0x94')](_0x515fe9[_0xaef8('0x5d')][_0xaef8('0x83')],_[_0xaef8('0x95')](_0x515fe9[_0xaef8('0x5d')],['ids','id'])||{})['spread'](function(_0xfe42bc){for(var _0x453f76=0x0;_0x453f76<_0x515fe9['body']['ids'][_0xaef8('0x4b')];_0x453f76+=0x1){socket[_0xaef8('0x80')]('userChatQueue:save',{'UserId':_0x515fe9[_0xaef8('0x5d')]['ids'][_0x453f76],'ChatQueueId':_0x515fe9[_0xaef8('0x5a')]['id']});}return _0xfe42bc;});}})[_0xaef8('0x36')](respondWithResult(_0x1054b7,null))[_0xaef8('0x58')](handleError(_0x1054b7,null));};exports[_0xaef8('0x96')]=function(_0x398218,_0x476076,_0x389a1b){return db[_0xaef8('0x40')][_0xaef8('0x62')]({'where':{'id':_0x398218[_0xaef8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x476076,null))['then'](function(_0x10c9f6){if(_0x10c9f6){return _0x10c9f6[_0xaef8('0x96')](_0x398218[_0xaef8('0x48')][_0xaef8('0x83')])['then'](function(){if(_[_0xaef8('0x97')](_0x398218[_0xaef8('0x48')]['ids'])){for(var _0x35e08e=0x0;_0x35e08e<_0x398218[_0xaef8('0x48')][_0xaef8('0x83')][_0xaef8('0x4b')];_0x35e08e+=0x1){socket['emit'](_0xaef8('0x93'),{'UserId':Number(_0x398218[_0xaef8('0x48')][_0xaef8('0x83')][_0x35e08e]),'ChatQueueId':Number(_0x398218[_0xaef8('0x5a')]['id'])});}}else{socket[_0xaef8('0x80')](_0xaef8('0x93'),{'UserId':Number(_0x398218['query']['ids']),'ChatQueueId':Number(_0x398218['params']['id'])});}});}})[_0xaef8('0x36')](respondWithStatusCode(_0x476076,null))[_0xaef8('0x58')](handleError(_0x476076,null));};exports[_0xaef8('0x98')]=function(_0x5df913,_0x1d26e4,_0x4975d3){var _0x68879c={};var _0x489b87={};var _0x1d2fa6;var _0x571dfb;return db[_0xaef8('0x40')]['findOne']({'where':{'id':_0x5df913[_0xaef8('0x5a')]['id']}})[_0xaef8('0x36')](handleEntityNotFound(_0x1d26e4,null))[_0xaef8('0x36')](function(_0x154cb5){if(_0x154cb5){_0x1d2fa6=_0x154cb5;_0x489b87[_0xaef8('0x47')]=_[_0xaef8('0x44')](db[_0xaef8('0x6b')][_0xaef8('0x41')]);_0x489b87[_0xaef8('0x48')]=_[_0xaef8('0x44')](_0x5df913['query']);_0x489b87[_0xaef8('0x45')]=_['intersection'](_0x489b87[_0xaef8('0x47')],_0x489b87[_0xaef8('0x48')]);_0x68879c[_0xaef8('0x49')]=_[_0xaef8('0x46')](_0x489b87[_0xaef8('0x47')],qs[_0xaef8('0x4a')](_0x5df913[_0xaef8('0x48')][_0xaef8('0x4a')]));_0x68879c[_0xaef8('0x49')]=_0x68879c['attributes'][_0xaef8('0x4b')]?_0x68879c['attributes']:_0x489b87[_0xaef8('0x47')];_0x68879c['order']=qs[_0xaef8('0x4e')](_0x5df913[_0xaef8('0x48')]['sort']);_0x68879c[_0xaef8('0x4f')]=qs[_0xaef8('0x45')](_[_0xaef8('0x50')](_0x5df913['query'],_0x489b87[_0xaef8('0x45')]));if(_0x5df913[_0xaef8('0x48')][_0xaef8('0x53')]){_0x68879c[_0xaef8('0x4f')]=_[_0xaef8('0x51')](_0x68879c[_0xaef8('0x4f')],{'$or':_[_0xaef8('0x3f')](_0x68879c[_0xaef8('0x49')],function(_0x9a6432){var _0x535103={};_0x535103[_0x9a6432]={'$like':'%'+_0x5df913[_0xaef8('0x48')][_0xaef8('0x53')]+'%'};return _0x535103;})});}_0x68879c=_[_0xaef8('0x51')]({},_0x68879c,_0x5df913[_0xaef8('0x54')]);return _0x1d2fa6['getAgents'](_0x68879c);}})[_0xaef8('0x36')](function(_0x565722){if(_0x565722){_0x571dfb=_0x565722[_0xaef8('0x4b')];if(!_0x5df913['query'][_0xaef8('0x4c')]('nolimit')){_0x68879c[_0xaef8('0x30')]=qs['limit'](_0x5df913[_0xaef8('0x48')]['limit']);_0x68879c[_0xaef8('0x2f')]=qs[_0xaef8('0x2f')](_0x5df913[_0xaef8('0x48')]['offset']);}return _0x1d2fa6[_0xaef8('0x98')](_0x68879c);}})[_0xaef8('0x36')](function(_0x280d55){if(_0x280d55){return _0x280d55?{'count':_0x571dfb,'rows':_0x280d55}:null;}})[_0xaef8('0x36')](respondWithResult(_0x1d26e4,null))[_0xaef8('0x58')](handleError(_0x1d26e4,null));};
\ No newline at end of file
+var _0x6dec=['localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','get','ChatQueues','UserProfileResource','end','stack','name','send','index','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','include','ChatQueue','findAll','rows','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','params','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','getTeams','rawAttributes','hasOwnProperty','addTeams','ids','Team','Agents','online','flatMap','sequelize','transaction','findOrCreate','forEach','userChatQueue:save','removeTeams','select','tq.TeamId','from','team_has_chat_queues','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','includes','compact','isEmpty','omit','spread','removeAgents','isArray','emit','userChatQueue:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults'];(function(_0xa9eaa0,_0x4ba2b4){var _0x30897a=function(_0x2caa01){while(--_0x2caa01){_0xa9eaa0['push'](_0xa9eaa0['shift']());}};_0x30897a(++_0x4ba2b4);}(_0x6dec,0x10e));var _0xc6de=function(_0x53706d,_0x2fd138){_0x53706d=_0x53706d-0x0;var _0x214e8b=_0x6dec[_0x53706d];return _0x214e8b;};'use strict';var pdf=require(_0xc6de('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc6de('0x1'));var zipdir=require(_0xc6de('0x2'));var jsonpatch=require(_0xc6de('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc6de('0x4'));var Mustache=require(_0xc6de('0x5'));var util=require(_0xc6de('0x6'));var path=require(_0xc6de('0x7'));var sox=require(_0xc6de('0x8'));var csv=require(_0xc6de('0x9'));var ejs=require(_0xc6de('0xa'));var fs=require('fs');var fs_extra=require(_0xc6de('0xb'));var _=require(_0xc6de('0xc'));var squel=require(_0xc6de('0xd'));var crypto=require(_0xc6de('0xe'));var jsforce=require(_0xc6de('0xf'));var deskjs=require(_0xc6de('0x10'));var toCsv=require(_0xc6de('0x9'));var querystring=require(_0xc6de('0x11'));var Papa=require(_0xc6de('0x12'));var Redis=require(_0xc6de('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xc6de('0x14'));var as=require(_0xc6de('0x15'));var hardwareService=require(_0xc6de('0x16'));var logger=require(_0xc6de('0x17'))(_0xc6de('0x18'));var utils=require('../../config/utils');var config=require(_0xc6de('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xc6de('0x1a')]=_[_0xc6de('0x1b')](config[_0xc6de('0x1a')],{'host':_0xc6de('0x1c'),'port':0x18eb});var socket=require(_0xc6de('0x1d'))(new Redis(config[_0xc6de('0x1a')]));require(_0xc6de('0x1e'))['register'](socket);var jayson=require(_0xc6de('0x1f'));var client=jayson[_0xc6de('0x20')][_0xc6de('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x2d3109,_0x53fba0,_0x290cee,_0x133117){return new BPromise(function(_0x2ec7eb,_0x3173c5){var _0x547f01=_0x133117||client;return _0x547f01['request'](_0x2d3109,_0x290cee)['then'](function(_0x5a3a05){logger[_0xc6de('0x22')](_0xc6de('0x23'),_0x53fba0,_0xc6de('0x24'));logger[_0xc6de('0x25')](_0xc6de('0x26'),_0x53fba0,_0xc6de('0x24'),JSON['stringify'](_0x5a3a05));if(_0x5a3a05[_0xc6de('0x27')]){if(_0x5a3a05[_0xc6de('0x27')][_0xc6de('0x28')]===0x1f4){logger['error'](_0xc6de('0x23'),_0x53fba0,_0x5a3a05[_0xc6de('0x27')]['message']);return _0x3173c5(_0x5a3a05[_0xc6de('0x27')][_0xc6de('0x29')]);}logger[_0xc6de('0x27')]('ChatQueue,\x20%s,\x20%s',_0x53fba0,_0x5a3a05[_0xc6de('0x27')][_0xc6de('0x29')]);return _0x2ec7eb(_0x5a3a05['error']['message']);}else{logger[_0xc6de('0x22')](_0xc6de('0x23'),_0x53fba0,'request\x20sent');_0x2ec7eb(_0x5a3a05[_0xc6de('0x2a')][_0xc6de('0x29')]);}})[_0xc6de('0x2b')](function(_0x4cec2e){logger[_0xc6de('0x27')]('ChatQueue,\x20%s,\x20%s',_0x53fba0,_0x4cec2e);_0x3173c5(_0x4cec2e);});});}function respondWithStatusCode(_0x318947,_0x39a5a7){_0x39a5a7=_0x39a5a7||0xcc;return function(_0x2c1d86){if(_0x2c1d86){return _0x318947[_0xc6de('0x2c')](_0x39a5a7);}return _0x318947[_0xc6de('0x2d')](_0x39a5a7)['end']();};}function respondWithResult(_0x125648,_0x3c737f){_0x3c737f=_0x3c737f||0xc8;return function(_0x3cdc43){if(_0x3cdc43){return _0x125648[_0xc6de('0x2d')](_0x3c737f)[_0xc6de('0x2e')](_0x3cdc43);}};}function respondWithFilteredResult(_0x4dbc32,_0x44399b){return function(_0x251465){if(_0x251465){var _0x3fb811=_0x251465[_0xc6de('0x2f')],_0x33d132=_0x44399b['offset'],_0x422c2d=_0x44399b[_0xc6de('0x30')]+_0x44399b[_0xc6de('0x31')],_0x1e8617;if(_0x422c2d>=_0x3fb811){_0x422c2d=_0x3fb811;_0x1e8617=0xc8;}else{_0x1e8617=0xce;}_0x4dbc32[_0xc6de('0x2d')](_0x1e8617);return _0x4dbc32[_0xc6de('0x32')]('Content-Range',_0x33d132+'-'+_0x422c2d+'/'+_0x3fb811)[_0xc6de('0x2e')](_0x251465);}return null;};}function patchUpdates(_0x3c7f3d){return function(_0x3fa838){try{jsonpatch[_0xc6de('0x33')](_0x3fa838,_0x3c7f3d,!![]);}catch(_0x21e6e0){return BPromise[_0xc6de('0x34')](_0x21e6e0);}return _0x3fa838[_0xc6de('0x35')]();};}function saveUpdates(_0x388ec7,_0x2e1210){return function(_0x294977){if(_0x294977){return _0x294977[_0xc6de('0x36')](_0x388ec7)[_0xc6de('0x37')](function(_0x544683){return _0x544683;});}return null;};}function removeEntity(_0x4b2561,_0x2b8bb3){return function(_0x5555e4){if(_0x5555e4){return _0x5555e4[_0xc6de('0x38')]()[_0xc6de('0x37')](function(){var _0x2b6a42=_0x5555e4[_0xc6de('0x39')]({'plain':!![]});var _0x58079a=_0xc6de('0x3a');return db[_0xc6de('0x3b')][_0xc6de('0x38')]({'where':{'type':_0x58079a,'resourceId':_0x2b6a42['id']}})['then'](function(){return _0x5555e4;});})[_0xc6de('0x37')](function(){_0x4b2561[_0xc6de('0x2d')](0xcc)[_0xc6de('0x3c')]();});}};}function handleEntityNotFound(_0x2702a3,_0x2393d3){return function(_0x569c09){if(!_0x569c09){_0x2702a3[_0xc6de('0x2c')](0x194);}return _0x569c09;};}function handleError(_0x5a9205,_0x3893a6){_0x3893a6=_0x3893a6||0x1f4;return function(_0x17cf2b){logger[_0xc6de('0x27')](_0x17cf2b[_0xc6de('0x3d')]);if(_0x17cf2b['name']){delete _0x17cf2b[_0xc6de('0x3e')];}_0x5a9205[_0xc6de('0x2d')](_0x3893a6)[_0xc6de('0x3f')](_0x17cf2b);};}exports[_0xc6de('0x40')]=function(_0xc8c262,_0x11f157){var _0x260fd0={},_0x1e6bf5={},_0x234acd={'count':0x0,'rows':[]};var _0x463876=_['map'](db['ChatQueue']['rawAttributes'],function(_0x25b20c){return{'name':_0x25b20c[_0xc6de('0x41')],'type':_0x25b20c[_0xc6de('0x42')][_0xc6de('0x43')]};});_0x1e6bf5[_0xc6de('0x44')]=_[_0xc6de('0x45')](_0x463876,'name');_0x1e6bf5['query']=_[_0xc6de('0x46')](_0xc8c262[_0xc6de('0x47')]);_0x1e6bf5[_0xc6de('0x48')]=_[_0xc6de('0x49')](_0x1e6bf5[_0xc6de('0x44')],_0x1e6bf5[_0xc6de('0x47')]);_0x260fd0[_0xc6de('0x4a')]=_[_0xc6de('0x49')](_0x1e6bf5['model'],qs[_0xc6de('0x4b')](_0xc8c262['query'][_0xc6de('0x4b')]));_0x260fd0[_0xc6de('0x4a')]=_0x260fd0[_0xc6de('0x4a')][_0xc6de('0x4c')]?_0x260fd0['attributes']:_0x1e6bf5[_0xc6de('0x44')];if(!_0xc8c262[_0xc6de('0x47')]['hasOwnProperty'](_0xc6de('0x4d'))){_0x260fd0[_0xc6de('0x31')]=qs[_0xc6de('0x31')](_0xc8c262['query']['limit']);_0x260fd0['offset']=qs['offset'](_0xc8c262[_0xc6de('0x47')][_0xc6de('0x30')]);}_0x260fd0[_0xc6de('0x4e')]=qs[_0xc6de('0x4f')](_0xc8c262['query']['sort']);_0x260fd0['where']=qs[_0xc6de('0x48')](_[_0xc6de('0x50')](_0xc8c262[_0xc6de('0x47')],_0x1e6bf5[_0xc6de('0x48')]),_0x463876);if(_0xc8c262[_0xc6de('0x47')][_0xc6de('0x51')]){_0x260fd0[_0xc6de('0x52')]=_[_0xc6de('0x53')](_0x260fd0[_0xc6de('0x52')],{'$or':_[_0xc6de('0x45')](_0x463876,function(_0x487597){if(_0x487597['type']!=='VIRTUAL'){var _0x404448={};_0x404448[_0x487597['name']]={'$like':'%'+_0xc8c262[_0xc6de('0x47')][_0xc6de('0x51')]+'%'};return _0x404448;}})});}_0x260fd0=_[_0xc6de('0x53')]({},_0x260fd0,_0xc8c262[_0xc6de('0x54')]);var _0x1010a8={'where':_0x260fd0[_0xc6de('0x52')]};return db['ChatQueue']['count'](_0x1010a8)[_0xc6de('0x37')](function(_0x4b1ce7){_0x234acd[_0xc6de('0x2f')]=_0x4b1ce7;if(_0xc8c262['query']['includeAll']){_0x260fd0[_0xc6de('0x55')]=[{'all':!![]}];}return db[_0xc6de('0x56')][_0xc6de('0x57')](_0x260fd0);})['then'](function(_0x3a6a95){_0x234acd[_0xc6de('0x58')]=_0x3a6a95;return _0x234acd;})[_0xc6de('0x37')](respondWithFilteredResult(_0x11f157,_0x260fd0))['catch'](handleError(_0x11f157,null));};exports[_0xc6de('0x59')]=function(_0xa82802,_0x1c7b43){var _0x42a1b2={'raw':!![],'where':{'id':_0xa82802['params']['id']}},_0x204cfd={};_0x204cfd['model']=_[_0xc6de('0x46')](db['ChatQueue']['rawAttributes']);_0x204cfd[_0xc6de('0x47')]=_[_0xc6de('0x46')](_0xa82802[_0xc6de('0x47')]);_0x204cfd[_0xc6de('0x48')]=_[_0xc6de('0x49')](_0x204cfd[_0xc6de('0x44')],_0x204cfd[_0xc6de('0x47')]);_0x42a1b2[_0xc6de('0x4a')]=_[_0xc6de('0x49')](_0x204cfd[_0xc6de('0x44')],qs[_0xc6de('0x4b')](_0xa82802['query'][_0xc6de('0x4b')]));_0x42a1b2[_0xc6de('0x4a')]=_0x42a1b2['attributes'][_0xc6de('0x4c')]?_0x42a1b2[_0xc6de('0x4a')]:_0x204cfd[_0xc6de('0x44')];if(_0xa82802['query'][_0xc6de('0x5a')]){_0x42a1b2[_0xc6de('0x55')]=[{'all':!![]}];}_0x42a1b2=_['merge']({},_0x42a1b2,_0xa82802[_0xc6de('0x54')]);return db[_0xc6de('0x56')][_0xc6de('0x5b')](_0x42a1b2)[_0xc6de('0x37')](handleEntityNotFound(_0x1c7b43,null))[_0xc6de('0x37')](respondWithResult(_0x1c7b43,null))['catch'](handleError(_0x1c7b43,null));};exports[_0xc6de('0x5c')]=function(_0x33f6a2,_0x591e3a){return db[_0xc6de('0x56')][_0xc6de('0x5c')](_0x33f6a2[_0xc6de('0x5d')],{})[_0xc6de('0x37')](function(_0x2c99e6){var _0x582225=_0x33f6a2[_0xc6de('0x5e')][_0xc6de('0x39')]({'plain':!![]});if(!_0x582225)throw new Error(_0xc6de('0x5f'));if(_0x582225[_0xc6de('0x60')]===_0xc6de('0x5e')){var _0x5170f6=_0x2c99e6[_0xc6de('0x39')]({'plain':!![]});var _0x49ba9b=_0xc6de('0x3a');return db[_0xc6de('0x61')][_0xc6de('0x5b')]({'where':{'name':_0x49ba9b,'userProfileId':_0x582225['userProfileId']},'raw':!![]})['then'](function(_0xedaa22){if(_0xedaa22&&_0xedaa22['autoAssociation']===0x0){return db[_0xc6de('0x3b')]['create']({'name':_0x5170f6['name'],'resourceId':_0x5170f6['id'],'type':_0xedaa22[_0xc6de('0x3e')],'sectionId':_0xedaa22['id']},{})[_0xc6de('0x37')](function(){return _0x2c99e6;});}else{return _0x2c99e6;}})[_0xc6de('0x2b')](function(_0x502f46){logger[_0xc6de('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x502f46);throw _0x502f46;});}return _0x2c99e6;})[_0xc6de('0x37')](respondWithResult(_0x591e3a,0xc9))['catch'](handleError(_0x591e3a,null));};exports['update']=function(_0x10443e,_0x45ee36){if(_0x10443e[_0xc6de('0x5d')]['id']){delete _0x10443e[_0xc6de('0x5d')]['id'];}return db[_0xc6de('0x56')]['find']({'where':{'id':_0x10443e[_0xc6de('0x62')]['id']}})[_0xc6de('0x37')](handleEntityNotFound(_0x45ee36,null))[_0xc6de('0x37')](saveUpdates(_0x10443e[_0xc6de('0x5d')],null))[_0xc6de('0x37')](respondWithResult(_0x45ee36,null))['catch'](handleError(_0x45ee36,null));};exports[_0xc6de('0x38')]=function(_0x3e758d,_0x496e04){return db[_0xc6de('0x56')][_0xc6de('0x5b')]({'where':{'id':_0x3e758d['params']['id']}})['then'](handleEntityNotFound(_0x496e04,null))['then'](removeEntity(_0x496e04,null))['catch'](handleError(_0x496e04,null));};exports[_0xc6de('0x63')]=function(_0x5d2ef5,_0x23b167){return db[_0xc6de('0x56')][_0xc6de('0x63')]()[_0xc6de('0x37')](respondWithResult(_0x23b167,null))['catch'](handleError(_0x23b167,null));};exports[_0xc6de('0x64')]=function(_0x4f4e9d,_0x19eb34,_0x41de09){var _0x3d88d1={'raw':!![],'where':{}},_0x187ca9={},_0x40ea51;return db[_0xc6de('0x56')][_0xc6de('0x65')]({'where':{'id':_0x4f4e9d[_0xc6de('0x62')]['id']}})[_0xc6de('0x37')](handleEntityNotFound(_0x19eb34,null))['then'](function(_0xb75ec3){if(_0xb75ec3){_0x40ea51=_0xb75ec3[_0xc6de('0x39')]({'plain':!![]});_0x187ca9[_0xc6de('0x44')]=_[_0xc6de('0x46')](db[_0xc6de('0x66')]['rawAttributes']);_0x187ca9['query']=_[_0xc6de('0x46')](_0x4f4e9d[_0xc6de('0x47')]);_0x187ca9[_0xc6de('0x48')]=_[_0xc6de('0x49')](_0x187ca9['model'],_0x187ca9[_0xc6de('0x47')]);_0x3d88d1[_0xc6de('0x4a')]=_[_0xc6de('0x49')](_0x187ca9[_0xc6de('0x44')],qs['fields'](_0x4f4e9d[_0xc6de('0x47')]['fields']));_0x3d88d1[_0xc6de('0x4a')]=_0x3d88d1[_0xc6de('0x4a')][_0xc6de('0x4c')]?_0x3d88d1['attributes']:_0x187ca9[_0xc6de('0x44')];if(!_0x4f4e9d[_0xc6de('0x47')]['hasOwnProperty'](_0xc6de('0x4d'))){_0x3d88d1[_0xc6de('0x31')]=qs['limit'](_0x4f4e9d[_0xc6de('0x47')][_0xc6de('0x31')]);_0x3d88d1[_0xc6de('0x30')]=qs[_0xc6de('0x30')](_0x4f4e9d[_0xc6de('0x47')][_0xc6de('0x30')]);}_0x3d88d1[_0xc6de('0x4e')]=qs[_0xc6de('0x4f')](_0x4f4e9d[_0xc6de('0x47')][_0xc6de('0x4f')]);_0x3d88d1[_0xc6de('0x52')]=qs['filters'](_[_0xc6de('0x50')](_0x4f4e9d[_0xc6de('0x47')],_0x187ca9[_0xc6de('0x48')]));_0x3d88d1[_0xc6de('0x52')][_0xc6de('0x67')]=_0xb75ec3['id'];if(_0x4f4e9d[_0xc6de('0x47')][_0xc6de('0x51')]){_0x3d88d1[_0xc6de('0x52')]=_['merge'](_0x3d88d1[_0xc6de('0x52')],{'$or':_[_0xc6de('0x45')](_0x3d88d1[_0xc6de('0x4a')],function(_0x35470d){var _0x2bbd22={};_0x2bbd22[_0x35470d]={'$like':'%'+_0x4f4e9d['query']['filter']+'%'};return _0x2bbd22;})});}_0x3d88d1=_[_0xc6de('0x53')]({},_0x3d88d1,_0x4f4e9d[_0xc6de('0x54')]);return db[_0xc6de('0x66')][_0xc6de('0x57')](_0x3d88d1);}})['then'](function(_0x4bc060){if(_0x4bc060){return db[_0xc6de('0x68')][_0xc6de('0x69')]({'where':{'id':_[_0xc6de('0x45')](_0x4bc060,_0xc6de('0x6a')),'role':_0xc6de('0x6b')},'attributes':['id',_0xc6de('0x3e'),_0xc6de('0x6c'),_0xc6de('0x6d'),_0xc6de('0x6e')]});}})[_0xc6de('0x37')](function(_0x2ae5ee){if(_0x2ae5ee){return{'count':_0x2ae5ee[_0xc6de('0x2f')],'rows':_[_0xc6de('0x45')](_0x2ae5ee[_0xc6de('0x58')],function(_0x216ab6){return{'membername':_0x216ab6[_0xc6de('0x3e')],'UserId':_0x216ab6['id'],'queue_name':_0x40ea51['name'],'ChatQueueId':_0x40ea51['id'],'interface':util['format'](_0xc6de('0x6f'),_0xc6de('0x70'),_0x216ab6[_0xc6de('0x3e')]),'penalty':0x0,'paused':_0x216ab6[_0xc6de('0x6c')],'createdAt':_0x216ab6['createdAt'],'updatedAt':_0x216ab6[_0xc6de('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x19eb34,_0x3d88d1))[_0xc6de('0x2b')](handleError(_0x19eb34,null));};exports[_0xc6de('0x71')]=function(_0x2a4912,_0x2a277e,_0x55a597){var _0x146748={};var _0x34e292={};var _0x29df39;var _0x581313;return db[_0xc6de('0x56')][_0xc6de('0x65')]({'where':{'id':_0x2a4912[_0xc6de('0x62')]['id']}})[_0xc6de('0x37')](handleEntityNotFound(_0x2a277e,null))[_0xc6de('0x37')](function(_0x29b926){if(_0x29b926){_0x29df39=_0x29b926;_0x34e292[_0xc6de('0x44')]=_['keys'](db['Team'][_0xc6de('0x72')]);_0x34e292[_0xc6de('0x47')]=_[_0xc6de('0x46')](_0x2a4912[_0xc6de('0x47')]);_0x34e292['filters']=_[_0xc6de('0x49')](_0x34e292['model'],_0x34e292[_0xc6de('0x47')]);_0x146748['attributes']=_['intersection'](_0x34e292['model'],qs[_0xc6de('0x4b')](_0x2a4912[_0xc6de('0x47')][_0xc6de('0x4b')]));_0x146748[_0xc6de('0x4a')]=_0x146748['attributes'][_0xc6de('0x4c')]?_0x146748['attributes']:_0x34e292[_0xc6de('0x44')];_0x146748['order']=qs['sort'](_0x2a4912[_0xc6de('0x47')]['sort']);_0x146748[_0xc6de('0x52')]=qs[_0xc6de('0x48')](_['pick'](_0x2a4912[_0xc6de('0x47')],_0x34e292['filters']));if(_0x2a4912[_0xc6de('0x47')]['filter']){_0x146748['where']=_[_0xc6de('0x53')](_0x146748[_0xc6de('0x52')],{'$or':_[_0xc6de('0x45')](_0x146748[_0xc6de('0x4a')],function(_0x21408d){var _0x308779={};_0x308779[_0x21408d]={'$like':'%'+_0x2a4912[_0xc6de('0x47')][_0xc6de('0x51')]+'%'};return _0x308779;})});}_0x146748=_[_0xc6de('0x53')]({},_0x146748,_0x2a4912[_0xc6de('0x54')]);return _0x29df39[_0xc6de('0x71')](_0x146748);}})['then'](function(_0x4fd4f2){if(_0x4fd4f2){_0x581313=_0x4fd4f2[_0xc6de('0x4c')];if(!_0x2a4912['query'][_0xc6de('0x73')]('nolimit')){_0x146748[_0xc6de('0x31')]=qs['limit'](_0x2a4912[_0xc6de('0x47')][_0xc6de('0x31')]);_0x146748[_0xc6de('0x30')]=qs['offset'](_0x2a4912['query'][_0xc6de('0x30')]);}return _0x29df39[_0xc6de('0x71')](_0x146748);}})['then'](function(_0x204f17){if(_0x204f17){return _0x204f17?{'count':_0x581313,'rows':_0x204f17}:null;}})[_0xc6de('0x37')](respondWithResult(_0x2a277e,null))[_0xc6de('0x2b')](handleError(_0x2a277e,null));};exports[_0xc6de('0x74')]=function(_0x491955,_0x15ab0f,_0x5cd883){var _0x400440=_0x491955['body'][_0xc6de('0x75')];return db[_0xc6de('0x76')]['findAll']({'where':{'id':_0x400440},'attributes':['id'],'include':[{'model':db[_0xc6de('0x68')],'as':_0xc6de('0x77'),'attributes':['id',_0xc6de('0x3e'),_0xc6de('0x78'),'voicePause','interface'],'raw':!![]}]})[_0xc6de('0x37')](function(_0x34eb91){if(_0x34eb91){var _0x521874=_[_0xc6de('0x79')](_0x34eb91,function(_0x46fbec){var _0x162d92=_0x46fbec[_0xc6de('0x39')]({'plain':!![]});return _0x162d92[_0xc6de('0x77')];});return db['ChatQueue'][_0xc6de('0x5b')]({'where':{'id':_0x491955[_0xc6de('0x62')]['id']}})['then'](function(_0x2d4bc9){return db[_0xc6de('0x7a')][_0xc6de('0x7b')](function(_0x177558){return _0x2d4bc9[_0xc6de('0x74')](_0x400440,{'transaction':_0x177558})[_0xc6de('0x37')](function(){return BPromise['each'](_0x521874,function(_0x28bbe7){return db[_0xc6de('0x66')][_0xc6de('0x7c')]({'where':{'UserId':_0x28bbe7['id'],'ChatQueueId':_0x491955[_0xc6de('0x62')]['id']},'transaction':_0x177558});});})['then'](function(){_0x521874[_0xc6de('0x7d')](function(_0x3d12b2){socket['emit'](_0xc6de('0x7e'),{'UserId':_0x3d12b2['id'],'ChatQueueId':_0x2d4bc9['id']});});});});});}})[_0xc6de('0x37')](respondWithStatusCode(_0x15ab0f,null))[_0xc6de('0x2b')](handleError(_0x15ab0f,null));};exports[_0xc6de('0x7f')]=function(_0x183c40,_0x2f2934,_0x5da176){return db['Team'][_0xc6de('0x57')]({'where':{'id':_0x183c40[_0xc6de('0x47')][_0xc6de('0x75')]},'attributes':['id'],'include':[{'model':db[_0xc6de('0x68')],'as':_0xc6de('0x77'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2f2934,null))['then'](function(_0x5181cb){var _0xb52123=_[_0xc6de('0x45')](_0x5181cb,'id');var _0x21e211=[];var _0x2d2617=[];var _0x30163c=squel[_0xc6de('0x80')]();_0x30163c['field'](_0xc6de('0x81'))[_0xc6de('0x82')](_0xc6de('0x83'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc6de('0x52')](_0xc6de('0x84'),_0x183c40['params']['id']);for(var _0x1d4378=0x0;_0x1d4378<_0x5181cb[_0xc6de('0x4c')];_0x1d4378+=0x1){let _0x328238=_0x5181cb[_0x1d4378];for(var _0x307b8a=0x0;_0x307b8a<_0x328238['Agents'][_0xc6de('0x4c')];_0x307b8a+=0x1){let _0x491b60=_0x328238[_0xc6de('0x77')][_0x307b8a];var _0x49b957=_0x30163c[_0xc6de('0x85')]();_0x49b957[_0xc6de('0x52')](_0xc6de('0x86'),_0x491b60['id']);_0x2d2617[_0xc6de('0x87')](db[_0xc6de('0x7a')]['query'](_0x49b957['toString'](),{'type':db[_0xc6de('0x7a')][_0xc6de('0x88')][_0xc6de('0x89')]})[_0xc6de('0x37')](function(_0x5b454b){if(_0x5b454b[_0xc6de('0x4c')]===0x1){return _0x491b60['id'];}else{var _0x1acb17=_['every'](_[_0xc6de('0x45')](_0x5b454b,_0xc6de('0x8a')),function(_0x2b05c3){return _[_0xc6de('0x8b')](_0xb52123,_0x2b05c3);});if(_0x1acb17){return _0x491b60['id'];}}}));}}return BPromise['all'](_0x2d2617)['then'](function(_0x3e4557){_0x21e211=_(_0x21e211)['union'](_0x3e4557)[_0xc6de('0x8c')]()['value']();return db[_0xc6de('0x56')]['find']({'where':{'id':_0x183c40[_0xc6de('0x62')]['id']}})[_0xc6de('0x37')](function(_0x28ad1a){return db[_0xc6de('0x7a')][_0xc6de('0x7b')](function(_0x1edf57){return _0x28ad1a[_0xc6de('0x7f')](_0x183c40['query'][_0xc6de('0x75')],{'transaction':_0x1edf57})[_0xc6de('0x37')](function(){if(!_[_0xc6de('0x8d')](_0x21e211)){return _0x28ad1a['removeAgents'](_0x21e211,{'transaction':_0x1edf57});}})['then'](function(){_0x21e211[_0xc6de('0x7d')](function(_0x186d18){socket['emit']('userChatQueue:remove',{'UserId':_0x186d18,'ChatQueueId':_0x28ad1a['id']});});});});});});})[_0xc6de('0x37')](respondWithStatusCode(_0x2f2934,null))['catch'](handleError(_0x2f2934,null));};exports['addAgents']=function(_0x225659,_0x44e37a,_0x268615){return db[_0xc6de('0x56')]['find']({'where':{'id':_0x225659[_0xc6de('0x62')]['id']}})[_0xc6de('0x37')](handleEntityNotFound(_0x44e37a,null))[_0xc6de('0x37')](function(_0x51da7b){if(_0x51da7b){return _0x51da7b['addAgents'](_0x225659[_0xc6de('0x5d')][_0xc6de('0x75')],_[_0xc6de('0x8e')](_0x225659[_0xc6de('0x5d')],[_0xc6de('0x75'),'id'])||{})[_0xc6de('0x8f')](function(_0x5f450b){for(var _0x4dca38=0x0;_0x4dca38<_0x225659[_0xc6de('0x5d')][_0xc6de('0x75')]['length'];_0x4dca38+=0x1){socket['emit']('userChatQueue:save',{'UserId':_0x225659['body'][_0xc6de('0x75')][_0x4dca38],'ChatQueueId':_0x225659[_0xc6de('0x62')]['id']});}return _0x5f450b;});}})['then'](respondWithResult(_0x44e37a,null))[_0xc6de('0x2b')](handleError(_0x44e37a,null));};exports[_0xc6de('0x90')]=function(_0x502d7e,_0x38098c,_0x66f7dc){return db[_0xc6de('0x56')][_0xc6de('0x5b')]({'where':{'id':_0x502d7e[_0xc6de('0x62')]['id']}})['then'](handleEntityNotFound(_0x38098c,null))['then'](function(_0x1e88aa){if(_0x1e88aa){return _0x1e88aa['removeAgents'](_0x502d7e['query']['ids'])['then'](function(){if(_[_0xc6de('0x91')](_0x502d7e[_0xc6de('0x47')][_0xc6de('0x75')])){for(var _0x16826d=0x0;_0x16826d<_0x502d7e[_0xc6de('0x47')][_0xc6de('0x75')][_0xc6de('0x4c')];_0x16826d+=0x1){socket[_0xc6de('0x92')](_0xc6de('0x93'),{'UserId':Number(_0x502d7e['query'][_0xc6de('0x75')][_0x16826d]),'ChatQueueId':Number(_0x502d7e[_0xc6de('0x62')]['id'])});}}else{socket['emit'](_0xc6de('0x93'),{'UserId':Number(_0x502d7e[_0xc6de('0x47')][_0xc6de('0x75')]),'ChatQueueId':Number(_0x502d7e[_0xc6de('0x62')]['id'])});}});}})[_0xc6de('0x37')](respondWithStatusCode(_0x38098c,null))[_0xc6de('0x2b')](handleError(_0x38098c,null));};exports[_0xc6de('0x94')]=function(_0x4a8e6a,_0x3555d3,_0x4c3f4a){var _0x3ba1fe={};var _0x36793a={};var _0x4743f2;var _0x4e34dd;return db['ChatQueue'][_0xc6de('0x65')]({'where':{'id':_0x4a8e6a['params']['id']}})[_0xc6de('0x37')](handleEntityNotFound(_0x3555d3,null))[_0xc6de('0x37')](function(_0x43cb3c){if(_0x43cb3c){_0x4743f2=_0x43cb3c;_0x36793a[_0xc6de('0x44')]=_[_0xc6de('0x46')](db[_0xc6de('0x68')][_0xc6de('0x72')]);_0x36793a[_0xc6de('0x47')]=_[_0xc6de('0x46')](_0x4a8e6a['query']);_0x36793a[_0xc6de('0x48')]=_[_0xc6de('0x49')](_0x36793a['model'],_0x36793a[_0xc6de('0x47')]);_0x3ba1fe[_0xc6de('0x4a')]=_[_0xc6de('0x49')](_0x36793a[_0xc6de('0x44')],qs[_0xc6de('0x4b')](_0x4a8e6a[_0xc6de('0x47')][_0xc6de('0x4b')]));_0x3ba1fe[_0xc6de('0x4a')]=_0x3ba1fe[_0xc6de('0x4a')][_0xc6de('0x4c')]?_0x3ba1fe['attributes']:_0x36793a[_0xc6de('0x44')];_0x3ba1fe[_0xc6de('0x4e')]=qs[_0xc6de('0x4f')](_0x4a8e6a[_0xc6de('0x47')][_0xc6de('0x4f')]);_0x3ba1fe[_0xc6de('0x52')]=qs['filters'](_[_0xc6de('0x50')](_0x4a8e6a[_0xc6de('0x47')],_0x36793a[_0xc6de('0x48')]));if(_0x4a8e6a[_0xc6de('0x47')][_0xc6de('0x51')]){_0x3ba1fe['where']=_[_0xc6de('0x53')](_0x3ba1fe[_0xc6de('0x52')],{'$or':_[_0xc6de('0x45')](_0x3ba1fe[_0xc6de('0x4a')],function(_0x48499e){var _0x48537c={};_0x48537c[_0x48499e]={'$like':'%'+_0x4a8e6a[_0xc6de('0x47')]['filter']+'%'};return _0x48537c;})});}_0x3ba1fe=_[_0xc6de('0x53')]({},_0x3ba1fe,_0x4a8e6a[_0xc6de('0x54')]);return _0x4743f2[_0xc6de('0x94')](_0x3ba1fe);}})[_0xc6de('0x37')](function(_0x177e62){if(_0x177e62){_0x4e34dd=_0x177e62[_0xc6de('0x4c')];if(!_0x4a8e6a[_0xc6de('0x47')]['hasOwnProperty'](_0xc6de('0x4d'))){_0x3ba1fe[_0xc6de('0x31')]=qs[_0xc6de('0x31')](_0x4a8e6a['query'][_0xc6de('0x31')]);_0x3ba1fe[_0xc6de('0x30')]=qs[_0xc6de('0x30')](_0x4a8e6a[_0xc6de('0x47')][_0xc6de('0x30')]);}return _0x4743f2[_0xc6de('0x94')](_0x3ba1fe);}})[_0xc6de('0x37')](function(_0x27925d){if(_0x27925d){return _0x27925d?{'count':_0x4e34dd,'rows':_0x27925d}:null;}})[_0xc6de('0x37')](respondWithResult(_0x3555d3,null))['catch'](handleError(_0x3555d3,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 7094dfb..ec07a5f 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 _0xb10b=['hasOwnProperty','hook','events','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x134f9f,_0x382ca5){var _0x2c1a8f=function(_0x12af7d){while(--_0x12af7d){_0x134f9f['push'](_0x134f9f['shift']());}};_0x2c1a8f(++_0x382ca5);}(_0xb10b,0x12a));var _0xbb10=function(_0xcbb8db,_0x1f0a12){_0xcbb8db=_0xcbb8db-0x0;var _0x2fdcac=_0xb10b[_0xcbb8db];return _0x2fdcac;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatQueueEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatQueueEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatQueue[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x59bed0,_0x252817){var _0x592459=function(_0x1ee1a0){while(--_0x1ee1a0){_0x59bed0['push'](_0x59bed0['shift']());}};_0x592459(++_0x252817);}(_0x5f2f,0x73));var _0xf5f2=function(_0x34f9e3,_0x2f74aa){_0x34f9e3=_0x34f9e3-0x0;var _0x7dfdeb=_0x5f2f[_0x34f9e3];return _0x7dfdeb;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var ChatQueue=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){ChatQueueEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);ChatQueueEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];ChatQueue[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index aae6b66..a26c8b2 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 _0xd4bd=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','define','ChatQueue','chat_queues'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xd4bd,0x186));var _0xdd4b=function(_0x57c872,_0x63a1fa){_0x57c872=_0x57c872-0x0;var _0x3ce770=_0xd4bd[_0x57c872];return _0x3ce770;};'use strict';var _=require(_0xdd4b('0x0'));var util=require(_0xdd4b('0x1'));var logger=require('../../config/logger')(_0xdd4b('0x2'));var moment=require(_0xdd4b('0x3'));var BPromise=require(_0xdd4b('0x4'));var rp=require(_0xdd4b('0x5'));var fs=require('fs');var path=require(_0xdd4b('0x6'));var rimraf=require(_0xdd4b('0x7'));var config=require(_0xdd4b('0x8'));var attributes=require(_0xdd4b('0x9'));module['exports']=function(_0x5a8683,_0x4f856a){return _0x5a8683[_0xdd4b('0xa')](_0xdd4b('0xb'),attributes,{'tableName':_0xdd4b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0b9e=['util','moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash'];(function(_0x51df35,_0x3a530d){var _0x225e66=function(_0x180515){while(--_0x180515){_0x51df35['push'](_0x51df35['shift']());}};_0x225e66(++_0x3a530d);}(_0x0b9e,0x1bb));var _0xe0b9=function(_0xba811f,_0x1f316f){_0xba811f=_0xba811f-0x0;var _0x41aaea=_0x0b9e[_0xba811f];return _0x41aaea;};'use strict';var _=require(_0xe0b9('0x0'));var util=require(_0xe0b9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe0b9('0x2'));var BPromise=require(_0xe0b9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe0b9('0x4'));var rimraf=require(_0xe0b9('0x5'));var config=require(_0xe0b9('0x6'));var attributes=require(_0xe0b9('0x7'));module[_0xe0b9('0x8')]=function(_0x52e07b,_0x2ca46a){return _0x52e07b[_0xe0b9('0x9')](_0xe0b9('0xa'),attributes,{'tableName':_0xe0b9('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 8048ed6..f7c9222 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 _0x6ea1=['where','options','attributes','limit','map','include','model','ChatQueue','find','ShowChatQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','findAll','raw'];(function(_0xe77127,_0x38c24c){var _0x34a56a=function(_0x1798fc){while(--_0x1798fc){_0xe77127['push'](_0xe77127['shift']());}};_0x34a56a(++_0x38c24c);}(_0x6ea1,0x1c2));var _0x16ea=function(_0x422fd0,_0x5984e9){_0x422fd0=_0x422fd0-0x0;var _0x19ea4e=_0x6ea1[_0x422fd0];return _0x19ea4e;};'use strict';var _=require(_0x16ea('0x0'));var util=require(_0x16ea('0x1'));var moment=require(_0x16ea('0x2'));var BPromise=require(_0x16ea('0x3'));var rs=require(_0x16ea('0x4'));var fs=require('fs');var Redis=require(_0x16ea('0x5'));var db=require(_0x16ea('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x16ea('0x7'));var config=require(_0x16ea('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x16ea('0x9')][_0x16ea('0xa')]({'port':0x232a});config[_0x16ea('0xb')]=_[_0x16ea('0xc')](config[_0x16ea('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x16ea('0xd'))(new Redis(config[_0x16ea('0xb')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2dad38,_0x42bcd8,_0x1525a9){return new BPromise(function(_0x12753e,_0x4b80ab){return client[_0x16ea('0xe')](_0x2dad38,_0x1525a9)[_0x16ea('0xf')](function(_0x504015){logger[_0x16ea('0x10')]('ChatQueue,\x20%s,\x20%s',_0x42bcd8,_0x16ea('0x11'));logger[_0x16ea('0x12')](_0x16ea('0x13'),_0x42bcd8,_0x16ea('0x11'),JSON[_0x16ea('0x14')](_0x504015));if(_0x504015[_0x16ea('0x15')]){if(_0x504015[_0x16ea('0x15')][_0x16ea('0x16')]===0x1f4){logger[_0x16ea('0x15')](_0x16ea('0x17'),_0x42bcd8,_0x504015['error'][_0x16ea('0x18')]);return _0x4b80ab(_0x504015[_0x16ea('0x15')][_0x16ea('0x18')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x42bcd8,_0x504015[_0x16ea('0x15')][_0x16ea('0x18')]);return _0x12753e(_0x504015['error'][_0x16ea('0x18')]);}else{logger[_0x16ea('0x10')](_0x16ea('0x17'),_0x42bcd8,_0x16ea('0x11'));_0x12753e(_0x504015[_0x16ea('0x19')][_0x16ea('0x18')]);}})[_0x16ea('0x1a')](function(_0x32ab64){logger[_0x16ea('0x15')](_0x16ea('0x17'),_0x42bcd8,_0x32ab64);_0x4b80ab(_0x32ab64);});});}exports[_0x16ea('0x1b')]=function(_0x7b6758){var _0x208dad=this;return new Promise(function(_0x583d6d,_0x3842f6){return db['ChatQueue'][_0x16ea('0x1c')]({'raw':_0x7b6758['options']?_0x7b6758['options'][_0x16ea('0x1d')]===undefined?!![]:![]:!![],'where':_0x7b6758['options']?_0x7b6758['options'][_0x16ea('0x1e')]||null:null,'attributes':_0x7b6758[_0x16ea('0x1f')]?_0x7b6758[_0x16ea('0x1f')][_0x16ea('0x20')]||null:null,'limit':_0x7b6758[_0x16ea('0x1f')]?_0x7b6758[_0x16ea('0x1f')][_0x16ea('0x21')]||null:null,'include':_0x7b6758['options']?_0x7b6758[_0x16ea('0x1f')]['include']?_[_0x16ea('0x22')](_0x7b6758[_0x16ea('0x1f')][_0x16ea('0x23')],function(_0x27723f){return{'model':db[_0x27723f[_0x16ea('0x24')]],'as':_0x27723f['as'],'attributes':_0x27723f[_0x16ea('0x20')],'include':_0x27723f['include']?_[_0x16ea('0x22')](_0x27723f[_0x16ea('0x23')],function(_0x350431){return{'model':db[_0x350431[_0x16ea('0x24')]],'as':_0x350431['as'],'attributes':_0x350431[_0x16ea('0x20')],'include':_0x350431[_0x16ea('0x23')]?_[_0x16ea('0x22')](_0x350431[_0x16ea('0x23')],function(_0x350cf7){return{'model':db[_0x350cf7[_0x16ea('0x24')]],'as':_0x350cf7['as'],'attributes':_0x350cf7['attributes']};}):[]};}):[]};}):[]:[]})[_0x16ea('0xf')](function(_0x460677){logger[_0x16ea('0x10')]('GetChatQueue',_0x7b6758);logger[_0x16ea('0x12')]('GetChatQueue',_0x7b6758,JSON[_0x16ea('0x14')](_0x460677));_0x583d6d(_0x460677);})[_0x16ea('0x1a')](function(_0x14d973){logger[_0x16ea('0x15')]('GetChatQueue',_0x14d973[_0x16ea('0x18')],_0x7b6758);_0x3842f6(_0x208dad[_0x16ea('0x15')](0x1f4,_0x14d973['message']));});});};exports['ShowChatQueue']=function(_0x579265){var _0x52eca2=this;return new Promise(function(_0x67505b,_0x36a69c){return db[_0x16ea('0x25')][_0x16ea('0x26')]({'raw':_0x579265['options']?_0x579265[_0x16ea('0x1f')][_0x16ea('0x1d')]===undefined?!![]:![]:!![],'where':_0x579265[_0x16ea('0x1f')]?_0x579265[_0x16ea('0x1f')][_0x16ea('0x1e')]||null:null,'attributes':_0x579265[_0x16ea('0x1f')]?_0x579265[_0x16ea('0x1f')][_0x16ea('0x20')]||null:null,'include':_0x579265[_0x16ea('0x1f')]?_0x579265[_0x16ea('0x1f')][_0x16ea('0x23')]?_[_0x16ea('0x22')](_0x579265[_0x16ea('0x1f')][_0x16ea('0x23')],function(_0x4decd8){return{'model':db[_0x4decd8['model']],'as':_0x4decd8['as'],'attributes':_0x4decd8[_0x16ea('0x20')],'include':_0x4decd8[_0x16ea('0x23')]?_[_0x16ea('0x22')](_0x4decd8[_0x16ea('0x23')],function(_0x116d31){return{'model':db[_0x116d31['model']],'as':_0x116d31['as'],'attributes':_0x116d31[_0x16ea('0x20')],'include':_0x116d31[_0x16ea('0x23')]?_[_0x16ea('0x22')](_0x116d31['include'],function(_0x3d0578){return{'model':db[_0x3d0578[_0x16ea('0x24')]],'as':_0x3d0578['as'],'attributes':_0x3d0578[_0x16ea('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52ca66){logger[_0x16ea('0x10')]('ShowChatQueue',_0x579265);logger[_0x16ea('0x12')](_0x16ea('0x27'),_0x579265,JSON[_0x16ea('0x14')](_0x52ca66));_0x67505b(_0x52ca66);})[_0x16ea('0x1a')](function(_0x3f0f94){logger[_0x16ea('0x15')](_0x16ea('0x27'),_0x3f0f94[_0x16ea('0x18')],_0x579265);_0x36a69c(_0x52eca2[_0x16ea('0x15')](0x1f4,_0x3f0f94['message']));});});};
\ No newline at end of file
+var _0xbcae=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ChatQueue','findAll','options','raw','where','limit','include','map','model','attributes','GetChatQueue','find','ShowChatQueue','lodash','util','moment'];(function(_0x4d7559,_0x139f3e){var _0x40341c=function(_0x361c68){while(--_0x361c68){_0x4d7559['push'](_0x4d7559['shift']());}};_0x40341c(++_0x139f3e);}(_0xbcae,0xa9));var _0xebca=function(_0x26a31f,_0xb97bc5){_0x26a31f=_0x26a31f-0x0;var _0x39e397=_0xbcae[_0x26a31f];return _0x39e397;};'use strict';var _=require(_0xebca('0x0'));var util=require(_0xebca('0x1'));var moment=require(_0xebca('0x2'));var BPromise=require(_0xebca('0x3'));var rs=require(_0xebca('0x4'));var fs=require('fs');var Redis=require(_0xebca('0x5'));var db=require(_0xebca('0x6'))['db'];var utils=require(_0xebca('0x7'));var logger=require(_0xebca('0x8'))(_0xebca('0x9'));var config=require('../../config/environment');var jayson=require(_0xebca('0xa'));var client=jayson[_0xebca('0xb')]['http']({'port':0x232a});config[_0xebca('0xc')]=_[_0xebca('0xd')](config[_0xebca('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xebca('0xe'))(new Redis(config[_0xebca('0xc')]));require(_0xebca('0xf'))[_0xebca('0x10')](socket);function respondWithRpcPromise(_0x198c66,_0x3c0b2a,_0x4e63b0){return new BPromise(function(_0x525679,_0x5d8909){return client[_0xebca('0x11')](_0x198c66,_0x4e63b0)[_0xebca('0x12')](function(_0x31c3a1){logger[_0xebca('0x13')](_0xebca('0x14'),_0x3c0b2a,'request\x20sent');logger[_0xebca('0x15')](_0xebca('0x16'),_0x3c0b2a,_0xebca('0x17'),JSON[_0xebca('0x18')](_0x31c3a1));if(_0x31c3a1[_0xebca('0x19')]){if(_0x31c3a1[_0xebca('0x19')][_0xebca('0x1a')]===0x1f4){logger[_0xebca('0x19')]('ChatQueue,\x20%s,\x20%s',_0x3c0b2a,_0x31c3a1['error'][_0xebca('0x1b')]);return _0x5d8909(_0x31c3a1['error'][_0xebca('0x1b')]);}logger[_0xebca('0x19')](_0xebca('0x14'),_0x3c0b2a,_0x31c3a1[_0xebca('0x19')]['message']);return _0x525679(_0x31c3a1[_0xebca('0x19')][_0xebca('0x1b')]);}else{logger[_0xebca('0x13')](_0xebca('0x14'),_0x3c0b2a,'request\x20sent');_0x525679(_0x31c3a1[_0xebca('0x1c')][_0xebca('0x1b')]);}})[_0xebca('0x1d')](function(_0x4b1b1e){logger[_0xebca('0x19')](_0xebca('0x14'),_0x3c0b2a,_0x4b1b1e);_0x5d8909(_0x4b1b1e);});});}exports['GetChatQueue']=function(_0x2c0546){var _0x1a7cc0=this;return new Promise(function(_0x37b271,_0x337ebb){return db[_0xebca('0x1e')][_0xebca('0x1f')]({'raw':_0x2c0546[_0xebca('0x20')]?_0x2c0546[_0xebca('0x20')][_0xebca('0x21')]===undefined?!![]:![]:!![],'where':_0x2c0546[_0xebca('0x20')]?_0x2c0546[_0xebca('0x20')][_0xebca('0x22')]||null:null,'attributes':_0x2c0546[_0xebca('0x20')]?_0x2c0546[_0xebca('0x20')]['attributes']||null:null,'limit':_0x2c0546[_0xebca('0x20')]?_0x2c0546[_0xebca('0x20')][_0xebca('0x23')]||null:null,'include':_0x2c0546['options']?_0x2c0546['options'][_0xebca('0x24')]?_[_0xebca('0x25')](_0x2c0546['options'][_0xebca('0x24')],function(_0x163478){return{'model':db[_0x163478[_0xebca('0x26')]],'as':_0x163478['as'],'attributes':_0x163478['attributes'],'include':_0x163478[_0xebca('0x24')]?_[_0xebca('0x25')](_0x163478[_0xebca('0x24')],function(_0x2234af){return{'model':db[_0x2234af[_0xebca('0x26')]],'as':_0x2234af['as'],'attributes':_0x2234af[_0xebca('0x27')],'include':_0x2234af[_0xebca('0x24')]?_[_0xebca('0x25')](_0x2234af[_0xebca('0x24')],function(_0x98b94a){return{'model':db[_0x98b94a[_0xebca('0x26')]],'as':_0x98b94a['as'],'attributes':_0x98b94a[_0xebca('0x27')]};}):[]};}):[]};}):[]:[]})[_0xebca('0x12')](function(_0x3a49ba){logger[_0xebca('0x13')](_0xebca('0x28'),_0x2c0546);logger[_0xebca('0x15')](_0xebca('0x28'),_0x2c0546,JSON[_0xebca('0x18')](_0x3a49ba));_0x37b271(_0x3a49ba);})[_0xebca('0x1d')](function(_0x217398){logger[_0xebca('0x19')](_0xebca('0x28'),_0x217398[_0xebca('0x1b')],_0x2c0546);_0x337ebb(_0x1a7cc0[_0xebca('0x19')](0x1f4,_0x217398[_0xebca('0x1b')]));});});};exports['ShowChatQueue']=function(_0x1bdbbe){var _0xece17d=this;return new Promise(function(_0x4da32b,_0x594fbe){return db['ChatQueue'][_0xebca('0x29')]({'raw':_0x1bdbbe[_0xebca('0x20')]?_0x1bdbbe[_0xebca('0x20')][_0xebca('0x21')]===undefined?!![]:![]:!![],'where':_0x1bdbbe[_0xebca('0x20')]?_0x1bdbbe[_0xebca('0x20')][_0xebca('0x22')]||null:null,'attributes':_0x1bdbbe[_0xebca('0x20')]?_0x1bdbbe[_0xebca('0x20')][_0xebca('0x27')]||null:null,'include':_0x1bdbbe['options']?_0x1bdbbe[_0xebca('0x20')][_0xebca('0x24')]?_[_0xebca('0x25')](_0x1bdbbe[_0xebca('0x20')]['include'],function(_0x3c8eb3){return{'model':db[_0x3c8eb3[_0xebca('0x26')]],'as':_0x3c8eb3['as'],'attributes':_0x3c8eb3[_0xebca('0x27')],'include':_0x3c8eb3[_0xebca('0x24')]?_[_0xebca('0x25')](_0x3c8eb3[_0xebca('0x24')],function(_0x26c28f){return{'model':db[_0x26c28f[_0xebca('0x26')]],'as':_0x26c28f['as'],'attributes':_0x26c28f[_0xebca('0x27')],'include':_0x26c28f[_0xebca('0x24')]?_[_0xebca('0x25')](_0x26c28f[_0xebca('0x24')],function(_0x1c4a68){return{'model':db[_0x1c4a68[_0xebca('0x26')]],'as':_0x1c4a68['as'],'attributes':_0x1c4a68[_0xebca('0x27')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x176782){logger['info'](_0xebca('0x2a'),_0x1bdbbe);logger[_0xebca('0x15')]('ShowChatQueue',_0x1bdbbe,JSON[_0xebca('0x18')](_0x176782));_0x4da32b(_0x176782);})[_0xebca('0x1d')](function(_0x552fa1){logger[_0xebca('0x19')](_0xebca('0x2a'),_0x552fa1[_0xebca('0x1b')],_0x1bdbbe);_0x594fbe(_0xece17d['error'](0x1f4,_0x552fa1[_0xebca('0x1b')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 24ae56d..e8bbb47 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 _0x5f2f=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x14fd54,_0x139fed){var _0x25eb06=function(_0x31e0a7){while(--_0x31e0a7){_0x14fd54['push'](_0x14fd54['shift']());}};_0x25eb06(++_0x139fed);}(_0x5f2f,0x73));var _0xf5f2=function(_0x186500,_0x599e52){_0x186500=_0x186500-0x0;var _0x3cd160=_0x5f2f[_0x186500];return _0x3cd160;};'use strict';var ChatQueueEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatQueueEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatQueueEvents['on'](_0x5907aa,_0x466882);}};
\ No newline at end of file
+var _0xadb5=['update','emit','register','length','chatQueue:','save'];(function(_0x20e991,_0x126d53){var _0xbe4e1f=function(_0x402109){while(--_0x402109){_0x20e991['push'](_0x20e991['shift']());}};_0xbe4e1f(++_0x126d53);}(_0xadb5,0xad));var _0x5adb=function(_0x124345,_0x2fbdbd){_0x124345=_0x124345-0x0;var _0xb5778d=_0xadb5[_0x124345];return _0xb5778d;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x5adb('0x0'),'remove',_0x5adb('0x1')];function createListener(_0x38f67f,_0x3129c3){return function(_0x4aecec){_0x3129c3[_0x5adb('0x2')](_0x38f67f,_0x4aecec);};}function removeListener(_0x31457,_0x2e3ef4){return function(){ChatQueueEvents['removeListener'](_0x31457,_0x2e3ef4);};}exports[_0x5adb('0x3')]=function(_0x168d89){for(var _0x3e2555=0x0,_0x3213e8=events[_0x5adb('0x4')];_0x3e2555<_0x3213e8;_0x3e2555++){var _0x353885=events[_0x3e2555];var _0x47228a=createListener(_0x5adb('0x5')+_0x353885,_0x168d89);ChatQueueEvents['on'](_0x353885,_0x47228a);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 1f574c6..f712bc6 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 _0x6e9c=['removeTeams','multer','util','path','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','update','delete','destroy','/:id/teams'];(function(_0x520cd9,_0x48a7d2){var _0xb14a5a=function(_0x10f179){while(--_0x10f179){_0x520cd9['push'](_0x520cd9['shift']());}};_0xb14a5a(++_0x48a7d2);}(_0x6e9c,0x153));var _0xc6e9=function(_0x200736,_0x3efef9){_0x200736=_0x200736-0x0;var _0x38e9f7=_0x6e9c[_0x200736];return _0x38e9f7;};'use strict';var multer=require(_0xc6e9('0x0'));var util=require(_0xc6e9('0x1'));var path=require(_0xc6e9('0x2'));var timeout=require('connect-timeout');var express=require(_0xc6e9('0x3'));var router=express[_0xc6e9('0x4')]();var fs_extra=require(_0xc6e9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc6e9('0x6'));var config=require('../../config/environment');var controller=require('./chatQueue.controller');router['get']('/',auth[_0xc6e9('0x7')](),controller[_0xc6e9('0x8')]);router[_0xc6e9('0x9')](_0xc6e9('0xa'),auth['isAuthenticated'](),controller[_0xc6e9('0xb')]);router[_0xc6e9('0x9')](_0xc6e9('0xc'),auth[_0xc6e9('0x7')](),controller[_0xc6e9('0xd')]);router[_0xc6e9('0x9')](_0xc6e9('0xe'),auth[_0xc6e9('0x7')](),controller[_0xc6e9('0xf')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0xc6e9('0x10')]);router['get'](_0xc6e9('0x11'),auth[_0xc6e9('0x7')](),controller[_0xc6e9('0x12')]);router[_0xc6e9('0x13')]('/',auth[_0xc6e9('0x7')](),controller[_0xc6e9('0x14')]);router[_0xc6e9('0x13')]('/:id/teams',auth[_0xc6e9('0x7')](),controller['addTeams']);router[_0xc6e9('0x13')](_0xc6e9('0x11'),auth[_0xc6e9('0x7')](),controller['addAgents']);router['put']('/:id',auth[_0xc6e9('0x7')](),controller[_0xc6e9('0x15')]);router[_0xc6e9('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xc6e9('0x17')]);router[_0xc6e9('0x16')](_0xc6e9('0x18'),auth[_0xc6e9('0x7')](),controller[_0xc6e9('0x19')]);router['delete'](_0xc6e9('0x11'),auth[_0xc6e9('0x7')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x953d=['getTeams','/:id/users','getAgents','post','create','addAgents','put','update','destroy','delete','/:id/teams','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','isAuthenticated','get','/:id','show','/:id/members','getMembers'];(function(_0x55b6d1,_0xdaa810){var _0x2b04db=function(_0xe6219c){while(--_0xe6219c){_0x55b6d1['push'](_0x55b6d1['shift']());}};_0x2b04db(++_0xdaa810);}(_0x953d,0x93));var _0xd953=function(_0x92724b,_0x18e7d6){_0x92724b=_0x92724b-0x0;var _0x12e4f5=_0x953d[_0x92724b];return _0x12e4f5;};'use strict';var multer=require('multer');var util=require(_0xd953('0x0'));var path=require(_0xd953('0x1'));var timeout=require(_0xd953('0x2'));var express=require('express');var router=express[_0xd953('0x3')]();var fs_extra=require(_0xd953('0x4'));var auth=require(_0xd953('0x5'));var interaction=require(_0xd953('0x6'));var config=require(_0xd953('0x7'));var controller=require(_0xd953('0x8'));router['get']('/',auth[_0xd953('0x9')](),controller['index']);router[_0xd953('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xd953('0xb'),auth['isAuthenticated'](),controller[_0xd953('0xc')]);router[_0xd953('0xa')](_0xd953('0xd'),auth[_0xd953('0x9')](),controller[_0xd953('0xe')]);router[_0xd953('0xa')]('/:id/teams',auth[_0xd953('0x9')](),controller[_0xd953('0xf')]);router[_0xd953('0xa')](_0xd953('0x10'),auth[_0xd953('0x9')](),controller[_0xd953('0x11')]);router[_0xd953('0x12')]('/',auth[_0xd953('0x9')](),controller[_0xd953('0x13')]);router[_0xd953('0x12')]('/:id/teams',auth[_0xd953('0x9')](),controller['addTeams']);router[_0xd953('0x12')](_0xd953('0x10'),auth['isAuthenticated'](),controller[_0xd953('0x14')]);router[_0xd953('0x15')](_0xd953('0xb'),auth[_0xd953('0x9')](),controller[_0xd953('0x16')]);router['delete']('/:id',auth[_0xd953('0x9')](),controller[_0xd953('0x17')]);router[_0xd953('0x18')](_0xd953('0x19'),auth[_0xd953('0x9')](),controller['removeTeams']);router['delete'](_0xd953('0x10'),auth[_0xd953('0x9')](),controller['removeAgents']);module[_0xd953('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index ce273a2..3295193 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 _0x656c=['DATE','sequelize','exports','STRING'];(function(_0x25069b,_0x982036){var _0x1998c2=function(_0x4d9407){while(--_0x4d9407){_0x25069b['push'](_0x25069b['shift']());}};_0x1998c2(++_0x982036);}(_0x656c,0xc1));var _0xc656=function(_0x517639,_0xf163c3){_0x517639=_0x517639-0x0;var _0x5c05c2=_0x656c[_0x517639];return _0x5c05c2;};'use strict';var moment=require('moment');var Sequelize=require(_0xc656('0x0'));module[_0xc656('0x1')]={'uniqueid':{'type':Sequelize[_0xc656('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xc656('0x2')]},'joinAt':{'type':Sequelize[_0xc656('0x3')]},'leaveAt':{'type':Sequelize[_0xc656('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xc656('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xed0d=['DATE','moment','sequelize','exports','STRING'];(function(_0x35d06e,_0x2e3503){var _0x9e9053=function(_0x1546d3){while(--_0x1546d3){_0x35d06e['push'](_0x35d06e['shift']());}};_0x9e9053(++_0x2e3503);}(_0xed0d,0xc4));var _0xded0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xed0d[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xded0('0x0'));var Sequelize=require(_0xded0('0x1'));module[_0xded0('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xded0('0x3')]},'joinAt':{'type':Sequelize[_0xded0('0x4')]},'leaveAt':{'type':Sequelize[_0xded0('0x4')]},'acceptAt':{'type':Sequelize[_0xded0('0x4')]},'exitAt':{'type':Sequelize[_0xded0('0x4')]},'reason':{'type':Sequelize[_0xded0('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index fc6bbe6..96b6aa1 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 _0x6322=['fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','ChatQueueReport','rawAttributes'];(function(_0x10c51f,_0x11270f){var _0x56a0cd=function(_0x563ac6){while(--_0x563ac6){_0x10c51f['push'](_0x10c51f['shift']());}};_0x56a0cd(++_0x11270f);}(_0x6322,0x1c6));var _0x2632=function(_0x1fa097,_0x1e9453){_0x1fa097=_0x1fa097-0x0;var _0x4318db=_0x6322[_0x1fa097];return _0x4318db;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2632('0x0'));var rimraf=require(_0x2632('0x1'));var zipdir=require(_0x2632('0x2'));var jsonpatch=require(_0x2632('0x3'));var rp=require('request-promise');var moment=require(_0x2632('0x4'));var BPromise=require(_0x2632('0x5'));var Mustache=require('mustache');var util=require(_0x2632('0x6'));var path=require(_0x2632('0x7'));var sox=require(_0x2632('0x8'));var csv=require(_0x2632('0x9'));var ejs=require(_0x2632('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2632('0xb'));var crypto=require(_0x2632('0xc'));var jsforce=require(_0x2632('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2632('0x9'));var querystring=require('querystring');var Papa=require(_0x2632('0xe'));var Redis=require(_0x2632('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2632('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2632('0x11'));var logger=require('../../config/logger')(_0x2632('0x12'));var utils=require(_0x2632('0x13'));var config=require(_0x2632('0x14'));var licenseUtil=require(_0x2632('0x15'));var db=require(_0x2632('0x16'))['db'];function respondWithStatusCode(_0x440f63,_0x644c3a){_0x644c3a=_0x644c3a||0xcc;return function(_0x1441b1){if(_0x1441b1){return _0x440f63[_0x2632('0x17')](_0x644c3a);}return _0x440f63[_0x2632('0x18')](_0x644c3a)[_0x2632('0x19')]();};}function respondWithResult(_0x2012ab,_0x549816){_0x549816=_0x549816||0xc8;return function(_0x4a2826){if(_0x4a2826){return _0x2012ab[_0x2632('0x18')](_0x549816)['json'](_0x4a2826);}};}function respondWithFilteredResult(_0x9ce996,_0x28e052){return function(_0x21abc8){if(_0x21abc8){var _0x58f215=_0x21abc8[_0x2632('0x1a')],_0xf15bee=_0x28e052[_0x2632('0x1b')],_0x211ce1=_0x28e052['offset']+_0x28e052[_0x2632('0x1c')],_0x1d67a3;if(_0x211ce1>=_0x58f215){_0x211ce1=_0x58f215;_0x1d67a3=0xc8;}else{_0x1d67a3=0xce;}_0x9ce996[_0x2632('0x18')](_0x1d67a3);return _0x9ce996['set'](_0x2632('0x1d'),_0xf15bee+'-'+_0x211ce1+'/'+_0x58f215)['json'](_0x21abc8);}return null;};}function patchUpdates(_0x3b1235){return function(_0x46a581){try{jsonpatch[_0x2632('0x1e')](_0x46a581,_0x3b1235,!![]);}catch(_0xfaa5d5){return BPromise['reject'](_0xfaa5d5);}return _0x46a581[_0x2632('0x1f')]();};}function saveUpdates(_0x2f3375,_0x14387d){return function(_0x76e03b){if(_0x76e03b){return _0x76e03b[_0x2632('0x20')](_0x2f3375)['then'](function(_0x54e9d0){return _0x54e9d0;});}return null;};}function removeEntity(_0x217f75,_0x3967e9){return function(_0x254e48){if(_0x254e48){return _0x254e48[_0x2632('0x21')]()[_0x2632('0x22')](function(){_0x217f75['status'](0xcc)[_0x2632('0x19')]();});}};}function handleEntityNotFound(_0xc09244,_0x4920ce){return function(_0x1ee5b6){if(!_0x1ee5b6){_0xc09244[_0x2632('0x17')](0x194);}return _0x1ee5b6;};}function handleError(_0x4f8bc2,_0x27d263){_0x27d263=_0x27d263||0x1f4;return function(_0x352308){logger[_0x2632('0x23')](_0x352308[_0x2632('0x24')]);if(_0x352308[_0x2632('0x25')]){delete _0x352308[_0x2632('0x25')];}_0x4f8bc2[_0x2632('0x18')](_0x27d263)[_0x2632('0x26')](_0x352308);};}exports[_0x2632('0x27')]=function(_0x486d19,_0x513302){var _0x19e0be={},_0x1b8717={},_0x299a8e={'count':0x0,'rows':[]};var _0x1dfec1=_[_0x2632('0x28')](db[_0x2632('0x29')][_0x2632('0x2a')],function(_0x3a3387){return{'name':_0x3a3387[_0x2632('0x2b')],'type':_0x3a3387[_0x2632('0x2c')][_0x2632('0x2d')]};});_0x1b8717[_0x2632('0x2e')]=_[_0x2632('0x28')](_0x1dfec1,_0x2632('0x25'));_0x1b8717['query']=_[_0x2632('0x2f')](_0x486d19[_0x2632('0x30')]);_0x1b8717[_0x2632('0x31')]=_[_0x2632('0x32')](_0x1b8717[_0x2632('0x2e')],_0x1b8717[_0x2632('0x30')]);_0x19e0be[_0x2632('0x33')]=_[_0x2632('0x32')](_0x1b8717[_0x2632('0x2e')],qs[_0x2632('0x34')](_0x486d19['query'][_0x2632('0x34')]));_0x19e0be[_0x2632('0x33')]=_0x19e0be[_0x2632('0x33')][_0x2632('0x35')]?_0x19e0be[_0x2632('0x33')]:_0x1b8717[_0x2632('0x2e')];if(!_0x486d19['query']['hasOwnProperty']('nolimit')){_0x19e0be[_0x2632('0x1c')]=qs[_0x2632('0x1c')](_0x486d19[_0x2632('0x30')][_0x2632('0x1c')]);_0x19e0be[_0x2632('0x1b')]=qs['offset'](_0x486d19[_0x2632('0x30')][_0x2632('0x1b')]);}_0x19e0be[_0x2632('0x36')]=qs[_0x2632('0x37')](_0x486d19[_0x2632('0x30')][_0x2632('0x37')]);_0x19e0be[_0x2632('0x38')]=qs[_0x2632('0x31')](_['pick'](_0x486d19[_0x2632('0x30')],_0x1b8717[_0x2632('0x31')]),_0x1dfec1);if(_0x486d19['query'][_0x2632('0x39')]){_0x19e0be[_0x2632('0x38')]=_[_0x2632('0x3a')](_0x19e0be[_0x2632('0x38')],{'$or':_[_0x2632('0x28')](_0x1dfec1,function(_0x344941){if(_0x344941[_0x2632('0x2c')]!=='VIRTUAL'){var _0x4a0039={};_0x4a0039[_0x344941['name']]={'$like':'%'+_0x486d19[_0x2632('0x30')][_0x2632('0x39')]+'%'};return _0x4a0039;}})});}_0x19e0be=_['merge']({},_0x19e0be,_0x486d19[_0x2632('0x3b')]);var _0x2a6b44={'where':_0x19e0be[_0x2632('0x38')]};return db[_0x2632('0x29')][_0x2632('0x1a')](_0x2a6b44)[_0x2632('0x22')](function(_0x4aec2b){_0x299a8e['count']=_0x4aec2b;if(_0x486d19[_0x2632('0x30')]['includeAll']){_0x19e0be[_0x2632('0x3c')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x2632('0x3d')](_0x19e0be);})[_0x2632('0x22')](function(_0x47d9a8){_0x299a8e[_0x2632('0x3e')]=_0x47d9a8;return _0x299a8e;})[_0x2632('0x22')](respondWithFilteredResult(_0x513302,_0x19e0be))[_0x2632('0x3f')](handleError(_0x513302,null));};exports[_0x2632('0x40')]=function(_0x3c7708,_0x41fa5e){var _0x10bf7b={'raw':!![],'where':{'id':_0x3c7708[_0x2632('0x41')]['id']}},_0x10735d={};_0x10735d['model']=_[_0x2632('0x2f')](db[_0x2632('0x29')][_0x2632('0x2a')]);_0x10735d[_0x2632('0x30')]=_[_0x2632('0x2f')](_0x3c7708['query']);_0x10735d[_0x2632('0x31')]=_['intersection'](_0x10735d[_0x2632('0x2e')],_0x10735d[_0x2632('0x30')]);_0x10bf7b['attributes']=_[_0x2632('0x32')](_0x10735d[_0x2632('0x2e')],qs[_0x2632('0x34')](_0x3c7708['query']['fields']));_0x10bf7b[_0x2632('0x33')]=_0x10bf7b['attributes'][_0x2632('0x35')]?_0x10bf7b[_0x2632('0x33')]:_0x10735d['model'];if(_0x3c7708['query'][_0x2632('0x42')]){_0x10bf7b[_0x2632('0x3c')]=[{'all':!![]}];}_0x10bf7b=_[_0x2632('0x3a')]({},_0x10bf7b,_0x3c7708['options']);return db[_0x2632('0x29')][_0x2632('0x43')](_0x10bf7b)[_0x2632('0x22')](handleEntityNotFound(_0x41fa5e,null))[_0x2632('0x22')](respondWithResult(_0x41fa5e,null))[_0x2632('0x3f')](handleError(_0x41fa5e,null));};exports[_0x2632('0x44')]=function(_0x28ed69,_0x4e0c6e){return db['ChatQueueReport'][_0x2632('0x44')](_0x28ed69[_0x2632('0x45')],{})['then'](respondWithResult(_0x4e0c6e,0xc9))[_0x2632('0x3f')](handleError(_0x4e0c6e,null));};exports[_0x2632('0x20')]=function(_0x5283b0,_0x1f9deb){if(_0x5283b0[_0x2632('0x45')]['id']){delete _0x5283b0[_0x2632('0x45')]['id'];}return db['ChatQueueReport'][_0x2632('0x43')]({'where':{'id':_0x5283b0[_0x2632('0x41')]['id']}})[_0x2632('0x22')](handleEntityNotFound(_0x1f9deb,null))[_0x2632('0x22')](saveUpdates(_0x5283b0[_0x2632('0x45')],null))[_0x2632('0x22')](respondWithResult(_0x1f9deb,null))[_0x2632('0x3f')](handleError(_0x1f9deb,null));};exports[_0x2632('0x21')]=function(_0xb82ef0,_0x6940c0){return db[_0x2632('0x29')][_0x2632('0x43')]({'where':{'id':_0xb82ef0['params']['id']}})[_0x2632('0x22')](handleEntityNotFound(_0x6940c0,null))[_0x2632('0x22')](removeEntity(_0x6940c0,null))[_0x2632('0x3f')](handleError(_0x6940c0,null));};exports[_0x2632('0x46')]=function(_0x4392b1,_0x347fbb){return db[_0x2632('0x29')][_0x2632('0x46')]()[_0x2632('0x22')](respondWithResult(_0x347fbb,null))[_0x2632('0x3f')](handleError(_0x347fbb,null));};
\ No newline at end of file
+var _0xdeeb=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','keys','query','filters','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','find','catch','create','body','params','describe','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x5e5c4c,_0x21abba){var _0x176148=function(_0x59522a){while(--_0x59522a){_0x5e5c4c['push'](_0x5e5c4c['shift']());}};_0x176148(++_0x21abba);}(_0xdeeb,0x1b4));var _0xbdee=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xdeeb[_0x1ae5ab];return _0x1ce001;};'use strict';var pdf=require(_0xbdee('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbdee('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbdee('0x2'));var rp=require(_0xbdee('0x3'));var moment=require('moment');var BPromise=require(_0xbdee('0x4'));var Mustache=require(_0xbdee('0x5'));var util=require(_0xbdee('0x6'));var path=require(_0xbdee('0x7'));var sox=require(_0xbdee('0x8'));var csv=require(_0xbdee('0x9'));var ejs=require(_0xbdee('0xa'));var fs=require('fs');var fs_extra=require(_0xbdee('0xb'));var _=require('lodash');var squel=require(_0xbdee('0xc'));var crypto=require('crypto');var jsforce=require(_0xbdee('0xd'));var deskjs=require(_0xbdee('0xe'));var toCsv=require(_0xbdee('0x9'));var querystring=require('querystring');var Papa=require(_0xbdee('0xf'));var Redis=require(_0xbdee('0x10'));var authService=require(_0xbdee('0x11'));var qs=require(_0xbdee('0x12'));var as=require(_0xbdee('0x13'));var hardwareService=require(_0xbdee('0x14'));var logger=require(_0xbdee('0x15'))(_0xbdee('0x16'));var utils=require(_0xbdee('0x17'));var config=require(_0xbdee('0x18'));var licenseUtil=require(_0xbdee('0x19'));var db=require(_0xbdee('0x1a'))['db'];function respondWithStatusCode(_0x99fe04,_0x26e035){_0x26e035=_0x26e035||0xcc;return function(_0x355b9e){if(_0x355b9e){return _0x99fe04['sendStatus'](_0x26e035);}return _0x99fe04[_0xbdee('0x1b')](_0x26e035)[_0xbdee('0x1c')]();};}function respondWithResult(_0x47521b,_0x560bf3){_0x560bf3=_0x560bf3||0xc8;return function(_0x297d33){if(_0x297d33){return _0x47521b[_0xbdee('0x1b')](_0x560bf3)[_0xbdee('0x1d')](_0x297d33);}};}function respondWithFilteredResult(_0x449c6c,_0x1e5e5a){return function(_0x5d9434){if(_0x5d9434){var _0x4ea595=_0x5d9434[_0xbdee('0x1e')],_0x41a6d1=_0x1e5e5a[_0xbdee('0x1f')],_0x190471=_0x1e5e5a[_0xbdee('0x1f')]+_0x1e5e5a[_0xbdee('0x20')],_0x48640e;if(_0x190471>=_0x4ea595){_0x190471=_0x4ea595;_0x48640e=0xc8;}else{_0x48640e=0xce;}_0x449c6c[_0xbdee('0x1b')](_0x48640e);return _0x449c6c[_0xbdee('0x21')](_0xbdee('0x22'),_0x41a6d1+'-'+_0x190471+'/'+_0x4ea595)['json'](_0x5d9434);}return null;};}function patchUpdates(_0x399441){return function(_0x50700d){try{jsonpatch[_0xbdee('0x23')](_0x50700d,_0x399441,!![]);}catch(_0x27dde5){return BPromise[_0xbdee('0x24')](_0x27dde5);}return _0x50700d['save']();};}function saveUpdates(_0x49fb1e,_0x2ef9d5){return function(_0x1e2e84){if(_0x1e2e84){return _0x1e2e84[_0xbdee('0x25')](_0x49fb1e)[_0xbdee('0x26')](function(_0x3800f5){return _0x3800f5;});}return null;};}function removeEntity(_0x286c34,_0x1bdf2e){return function(_0xba1ad6){if(_0xba1ad6){return _0xba1ad6[_0xbdee('0x27')]()['then'](function(){_0x286c34['status'](0xcc)[_0xbdee('0x1c')]();});}};}function handleEntityNotFound(_0x58f21d,_0x569dfb){return function(_0x2c89ee){if(!_0x2c89ee){_0x58f21d[_0xbdee('0x28')](0x194);}return _0x2c89ee;};}function handleError(_0x5898a9,_0x3707fd){_0x3707fd=_0x3707fd||0x1f4;return function(_0x41f3ff){logger[_0xbdee('0x29')](_0x41f3ff[_0xbdee('0x2a')]);if(_0x41f3ff[_0xbdee('0x2b')]){delete _0x41f3ff['name'];}_0x5898a9['status'](_0x3707fd)[_0xbdee('0x2c')](_0x41f3ff);};}exports[_0xbdee('0x2d')]=function(_0x2dbd6a,_0x17ac42){var _0x47d783={},_0x57c17c={},_0x4e4f39={'count':0x0,'rows':[]};var _0x1de45e=_[_0xbdee('0x2e')](db[_0xbdee('0x2f')][_0xbdee('0x30')],function(_0x46f805){return{'name':_0x46f805[_0xbdee('0x31')],'type':_0x46f805['type']['key']};});_0x57c17c['model']=_[_0xbdee('0x2e')](_0x1de45e,_0xbdee('0x2b'));_0x57c17c['query']=_[_0xbdee('0x32')](_0x2dbd6a[_0xbdee('0x33')]);_0x57c17c[_0xbdee('0x34')]=_['intersection'](_0x57c17c[_0xbdee('0x35')],_0x57c17c[_0xbdee('0x33')]);_0x47d783[_0xbdee('0x36')]=_['intersection'](_0x57c17c[_0xbdee('0x35')],qs[_0xbdee('0x37')](_0x2dbd6a['query'][_0xbdee('0x37')]));_0x47d783[_0xbdee('0x36')]=_0x47d783[_0xbdee('0x36')][_0xbdee('0x38')]?_0x47d783[_0xbdee('0x36')]:_0x57c17c[_0xbdee('0x35')];if(!_0x2dbd6a[_0xbdee('0x33')]['hasOwnProperty'](_0xbdee('0x39'))){_0x47d783[_0xbdee('0x20')]=qs[_0xbdee('0x20')](_0x2dbd6a[_0xbdee('0x33')][_0xbdee('0x20')]);_0x47d783[_0xbdee('0x1f')]=qs[_0xbdee('0x1f')](_0x2dbd6a[_0xbdee('0x33')][_0xbdee('0x1f')]);}_0x47d783[_0xbdee('0x3a')]=qs[_0xbdee('0x3b')](_0x2dbd6a[_0xbdee('0x33')][_0xbdee('0x3b')]);_0x47d783['where']=qs[_0xbdee('0x34')](_[_0xbdee('0x3c')](_0x2dbd6a[_0xbdee('0x33')],_0x57c17c[_0xbdee('0x34')]),_0x1de45e);if(_0x2dbd6a['query'][_0xbdee('0x3d')]){_0x47d783[_0xbdee('0x3e')]=_[_0xbdee('0x3f')](_0x47d783[_0xbdee('0x3e')],{'$or':_[_0xbdee('0x2e')](_0x1de45e,function(_0x31edd6){if(_0x31edd6[_0xbdee('0x40')]!==_0xbdee('0x41')){var _0x29b9e5={};_0x29b9e5[_0x31edd6[_0xbdee('0x2b')]]={'$like':'%'+_0x2dbd6a[_0xbdee('0x33')][_0xbdee('0x3d')]+'%'};return _0x29b9e5;}})});}_0x47d783=_[_0xbdee('0x3f')]({},_0x47d783,_0x2dbd6a[_0xbdee('0x42')]);var _0x183713={'where':_0x47d783[_0xbdee('0x3e')]};return db[_0xbdee('0x2f')][_0xbdee('0x1e')](_0x183713)['then'](function(_0x41c1bc){_0x4e4f39[_0xbdee('0x1e')]=_0x41c1bc;if(_0x2dbd6a[_0xbdee('0x33')][_0xbdee('0x43')]){_0x47d783[_0xbdee('0x44')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xbdee('0x45')](_0x47d783);})['then'](function(_0x385931){_0x4e4f39['rows']=_0x385931;return _0x4e4f39;})['then'](respondWithFilteredResult(_0x17ac42,_0x47d783))['catch'](handleError(_0x17ac42,null));};exports['show']=function(_0x3875f2,_0x2f67cf){var _0x5a2715={'raw':!![],'where':{'id':_0x3875f2['params']['id']}},_0x493634={};_0x493634[_0xbdee('0x35')]=_[_0xbdee('0x32')](db[_0xbdee('0x2f')][_0xbdee('0x30')]);_0x493634[_0xbdee('0x33')]=_[_0xbdee('0x32')](_0x3875f2[_0xbdee('0x33')]);_0x493634[_0xbdee('0x34')]=_['intersection'](_0x493634[_0xbdee('0x35')],_0x493634[_0xbdee('0x33')]);_0x5a2715[_0xbdee('0x36')]=_['intersection'](_0x493634[_0xbdee('0x35')],qs['fields'](_0x3875f2[_0xbdee('0x33')][_0xbdee('0x37')]));_0x5a2715['attributes']=_0x5a2715[_0xbdee('0x36')]['length']?_0x5a2715[_0xbdee('0x36')]:_0x493634['model'];if(_0x3875f2['query'][_0xbdee('0x43')]){_0x5a2715[_0xbdee('0x44')]=[{'all':!![]}];}_0x5a2715=_[_0xbdee('0x3f')]({},_0x5a2715,_0x3875f2[_0xbdee('0x42')]);return db[_0xbdee('0x2f')][_0xbdee('0x46')](_0x5a2715)[_0xbdee('0x26')](handleEntityNotFound(_0x2f67cf,null))['then'](respondWithResult(_0x2f67cf,null))[_0xbdee('0x47')](handleError(_0x2f67cf,null));};exports[_0xbdee('0x48')]=function(_0x459f0c,_0x2f3076){return db[_0xbdee('0x2f')][_0xbdee('0x48')](_0x459f0c[_0xbdee('0x49')],{})[_0xbdee('0x26')](respondWithResult(_0x2f3076,0xc9))[_0xbdee('0x47')](handleError(_0x2f3076,null));};exports[_0xbdee('0x25')]=function(_0x8266f0,_0x397d2e){if(_0x8266f0[_0xbdee('0x49')]['id']){delete _0x8266f0[_0xbdee('0x49')]['id'];}return db['ChatQueueReport'][_0xbdee('0x46')]({'where':{'id':_0x8266f0[_0xbdee('0x4a')]['id']}})[_0xbdee('0x26')](handleEntityNotFound(_0x397d2e,null))[_0xbdee('0x26')](saveUpdates(_0x8266f0[_0xbdee('0x49')],null))[_0xbdee('0x26')](respondWithResult(_0x397d2e,null))['catch'](handleError(_0x397d2e,null));};exports['destroy']=function(_0x40d52f,_0x3f8bbd){return db[_0xbdee('0x2f')][_0xbdee('0x46')]({'where':{'id':_0x40d52f['params']['id']}})['then'](handleEntityNotFound(_0x3f8bbd,null))[_0xbdee('0x26')](removeEntity(_0x3f8bbd,null))['catch'](handleError(_0x3f8bbd,null));};exports[_0xbdee('0x4b')]=function(_0x4c9b6e,_0x25ab35){return db[_0xbdee('0x2f')][_0xbdee('0x4b')]()[_0xbdee('0x26')](respondWithResult(_0x25ab35,null))[_0xbdee('0x47')](handleError(_0x25ab35,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index bf443ad..2ff6109 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 _0xdc47=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','./chatQueueReport.attributes','ChatQueueReport','report_chat_queue'];(function(_0x5666ba,_0x8533c2){var _0x2954a5=function(_0x206aa2){while(--_0x206aa2){_0x5666ba['push'](_0x5666ba['shift']());}};_0x2954a5(++_0x8533c2);}(_0xdc47,0xa1));var _0x7dc4=function(_0x3d2d6f,_0x368872){_0x3d2d6f=_0x3d2d6f-0x0;var _0x5c0022=_0xdc47[_0x3d2d6f];return _0x5c0022;};'use strict';var _=require(_0x7dc4('0x0'));var util=require(_0x7dc4('0x1'));var logger=require(_0x7dc4('0x2'))(_0x7dc4('0x3'));var moment=require('moment');var BPromise=require(_0x7dc4('0x4'));var rp=require(_0x7dc4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7dc4('0x6'));module['exports']=function(_0x4b91ce,_0x57a7cd){return _0x4b91ce['define'](_0x7dc4('0x7'),attributes,{'tableName':_0x7dc4('0x8'),'paranoid':![],'indexes':[{'name':_0x7dc4('0x9'),'fields':[_0x7dc4('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xada5=['uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue'];(function(_0x4116fe,_0x1d04ad){var _0xc7ba30=function(_0x58e560){while(--_0x58e560){_0x4116fe['push'](_0x4116fe['shift']());}};_0xc7ba30(++_0x1d04ad);}(_0xada5,0x196));var _0x5ada=function(_0x2fed61,_0x4a6726){_0x2fed61=_0x2fed61-0x0;var _0x5a1924=_0xada5[_0x2fed61];return _0x5a1924;};'use strict';var _=require(_0x5ada('0x0'));var util=require(_0x5ada('0x1'));var logger=require(_0x5ada('0x2'))('api');var moment=require(_0x5ada('0x3'));var BPromise=require(_0x5ada('0x4'));var rp=require(_0x5ada('0x5'));var fs=require('fs');var path=require(_0x5ada('0x6'));var rimraf=require(_0x5ada('0x7'));var config=require(_0x5ada('0x8'));var attributes=require(_0x5ada('0x9'));module[_0x5ada('0xa')]=function(_0x361d0f,_0x186dfd){return _0x361d0f[_0x5ada('0xb')](_0x5ada('0xc'),attributes,{'tableName':_0x5ada('0xd'),'paranoid':![],'indexes':[{'name':_0x5ada('0xe'),'fields':[_0x5ada('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 786e1c0..c014d38 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 _0x33e2=['update','where','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','info','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','ChatQueueReport','create','options','raw','then','CreateChatQueueReport','debug','stringify'];(function(_0x104b47,_0x491eff){var _0x34a3f1=function(_0x467a15){while(--_0x467a15){_0x104b47['push'](_0x104b47['shift']());}};_0x34a3f1(++_0x491eff);}(_0x33e2,0x19d));var _0x233e=function(_0x531a19,_0x43e019){_0x531a19=_0x531a19-0x0;var _0x4845d2=_0x33e2[_0x531a19];return _0x4845d2;};'use strict';var _=require(_0x233e('0x0'));var util=require(_0x233e('0x1'));var moment=require(_0x233e('0x2'));var BPromise=require(_0x233e('0x3'));var rs=require(_0x233e('0x4'));var fs=require('fs');var Redis=require(_0x233e('0x5'));var db=require(_0x233e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x233e('0x7'))(_0x233e('0x8'));var config=require('../../config/environment');var jayson=require(_0x233e('0x9'));var client=jayson['client'][_0x233e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x343179,_0x5bb573,_0x2a5de8){return new BPromise(function(_0x400025,_0x13b313){return client[_0x233e('0xb')](_0x343179,_0x2a5de8)['then'](function(_0x2adc18){logger[_0x233e('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x5bb573,'request\x20sent');logger['debug'](_0x233e('0xd'),_0x5bb573,_0x233e('0xe'),JSON['stringify'](_0x2adc18));if(_0x2adc18[_0x233e('0xf')]){if(_0x2adc18[_0x233e('0xf')][_0x233e('0x10')]===0x1f4){logger[_0x233e('0xf')](_0x233e('0x11'),_0x5bb573,_0x2adc18[_0x233e('0xf')][_0x233e('0x12')]);return _0x13b313(_0x2adc18[_0x233e('0xf')][_0x233e('0x12')]);}logger['error'](_0x233e('0x11'),_0x5bb573,_0x2adc18[_0x233e('0xf')][_0x233e('0x12')]);return _0x400025(_0x2adc18[_0x233e('0xf')][_0x233e('0x12')]);}else{logger[_0x233e('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x5bb573,_0x233e('0xe'));_0x400025(_0x2adc18[_0x233e('0x13')][_0x233e('0x12')]);}})[_0x233e('0x14')](function(_0x258969){logger[_0x233e('0xf')](_0x233e('0x11'),_0x5bb573,_0x258969);_0x13b313(_0x258969);});});}exports['CreateChatQueueReport']=function(_0x5226d5){var _0x4af3f1=this;return new Promise(function(_0x2c32e7,_0x4990c3){return db[_0x233e('0x15')][_0x233e('0x16')](_0x5226d5['body'],{'raw':_0x5226d5[_0x233e('0x17')]?_0x5226d5[_0x233e('0x17')][_0x233e('0x18')]===undefined?!![]:![]:!![]})[_0x233e('0x19')](function(_0x5f0f5b){logger[_0x233e('0xc')](_0x233e('0x1a'),_0x5226d5);logger[_0x233e('0x1b')]('CreateChatQueueReport',_0x5226d5,JSON[_0x233e('0x1c')](_0x5f0f5b));_0x2c32e7(_0x5f0f5b);})[_0x233e('0x14')](function(_0x2c6632){logger[_0x233e('0xf')](_0x233e('0x1a'),_0x2c6632[_0x233e('0x12')],_0x5226d5);_0x4990c3(_0x4af3f1[_0x233e('0xf')](0x1f4,_0x2c6632[_0x233e('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x1f93db){var _0xaceabf=this;return new Promise(function(_0x958d96,_0x4e0025){return db['ChatQueueReport'][_0x233e('0x1d')](_0x1f93db['body'],{'raw':_0x1f93db[_0x233e('0x17')]?_0x1f93db[_0x233e('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f93db[_0x233e('0x17')]?_0x1f93db[_0x233e('0x17')][_0x233e('0x1e')]||null:null,'attributes':_0x1f93db[_0x233e('0x17')]?_0x1f93db[_0x233e('0x17')][_0x233e('0x1f')]||null:null,'limit':_0x1f93db['options']?_0x1f93db['options'][_0x233e('0x20')]||null:null})[_0x233e('0x19')](function(_0x26f18c){logger['info'](_0x233e('0x21'),_0x1f93db);logger[_0x233e('0x1b')](_0x233e('0x21'),_0x1f93db,JSON[_0x233e('0x1c')](_0x26f18c));_0x958d96(_0x26f18c);})[_0x233e('0x14')](function(_0x5ea241){logger[_0x233e('0xf')](_0x233e('0x21'),_0x5ea241['message'],_0x1f93db);_0x4e0025(_0xaceabf['error'](0x1f4,_0x5ea241['message']));});});};
\ No newline at end of file
+var _0x6111=['UpdateChatQueueReport','update','body','raw','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','options','debug'];(function(_0x132c72,_0x45663f){var _0x12007d=function(_0xb3314b){while(--_0xb3314b){_0x132c72['push'](_0x132c72['shift']());}};_0x12007d(++_0x45663f);}(_0x6111,0x113));var _0x1611=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6111[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x1611('0x0'));var moment=require(_0x1611('0x1'));var BPromise=require(_0x1611('0x2'));var rs=require(_0x1611('0x3'));var fs=require('fs');var Redis=require(_0x1611('0x4'));var db=require(_0x1611('0x5'))['db'];var utils=require(_0x1611('0x6'));var logger=require(_0x1611('0x7'))(_0x1611('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1611('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31a919,_0x589559,_0x35b5b7){return new BPromise(function(_0x5a38ae,_0x393c94){return client['request'](_0x31a919,_0x35b5b7)[_0x1611('0xa')](function(_0x5bb1a8){logger[_0x1611('0xb')](_0x1611('0xc'),_0x589559,_0x1611('0xd'));logger['debug'](_0x1611('0xe'),_0x589559,'request\x20sent',JSON[_0x1611('0xf')](_0x5bb1a8));if(_0x5bb1a8[_0x1611('0x10')]){if(_0x5bb1a8['error'][_0x1611('0x11')]===0x1f4){logger[_0x1611('0x10')](_0x1611('0xc'),_0x589559,_0x5bb1a8[_0x1611('0x10')][_0x1611('0x12')]);return _0x393c94(_0x5bb1a8[_0x1611('0x10')][_0x1611('0x12')]);}logger[_0x1611('0x10')](_0x1611('0xc'),_0x589559,_0x5bb1a8[_0x1611('0x10')][_0x1611('0x12')]);return _0x5a38ae(_0x5bb1a8['error'][_0x1611('0x12')]);}else{logger[_0x1611('0xb')](_0x1611('0xc'),_0x589559,_0x1611('0xd'));_0x5a38ae(_0x5bb1a8[_0x1611('0x13')][_0x1611('0x12')]);}})[_0x1611('0x14')](function(_0x1e979c){logger[_0x1611('0x10')](_0x1611('0xc'),_0x589559,_0x1e979c);_0x393c94(_0x1e979c);});});}exports[_0x1611('0x15')]=function(_0x5b3df0){var _0x220ddb=this;return new Promise(function(_0x115f27,_0x67cb0){return db[_0x1611('0x16')]['create'](_0x5b3df0['body'],{'raw':_0x5b3df0[_0x1611('0x17')]?_0x5b3df0[_0x1611('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x1611('0xa')](function(_0x9b0ec3){logger[_0x1611('0xb')](_0x1611('0x15'),_0x5b3df0);logger[_0x1611('0x18')](_0x1611('0x15'),_0x5b3df0,JSON[_0x1611('0xf')](_0x9b0ec3));_0x115f27(_0x9b0ec3);})[_0x1611('0x14')](function(_0x315657){logger[_0x1611('0x10')](_0x1611('0x15'),_0x315657[_0x1611('0x12')],_0x5b3df0);_0x67cb0(_0x220ddb[_0x1611('0x10')](0x1f4,_0x315657[_0x1611('0x12')]));});});};exports[_0x1611('0x19')]=function(_0x176b80){var _0x31ab44=this;return new Promise(function(_0x4afe10,_0x3d1216){return db[_0x1611('0x16')][_0x1611('0x1a')](_0x176b80[_0x1611('0x1b')],{'raw':_0x176b80[_0x1611('0x17')]?_0x176b80[_0x1611('0x17')][_0x1611('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x176b80[_0x1611('0x17')]?_0x176b80[_0x1611('0x17')]['where']||null:null,'attributes':_0x176b80[_0x1611('0x17')]?_0x176b80[_0x1611('0x17')][_0x1611('0x1d')]||null:null,'limit':_0x176b80[_0x1611('0x17')]?_0x176b80[_0x1611('0x17')]['limit']||null:null})[_0x1611('0xa')](function(_0x3f5d78){logger[_0x1611('0xb')](_0x1611('0x19'),_0x176b80);logger[_0x1611('0x18')]('UpdateChatQueueReport',_0x176b80,JSON['stringify'](_0x3f5d78));_0x4afe10(_0x3f5d78);})[_0x1611('0x14')](function(_0x61f45){logger[_0x1611('0x10')](_0x1611('0x19'),_0x61f45[_0x1611('0x12')],_0x176b80);_0x3d1216(_0x31ab44[_0x1611('0x10')](0x1f4,_0x61f45[_0x1611('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 2b9392e..139d4ac 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 _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','post','put','update','delete','/:id'];(function(_0x567709,_0x1f3c4e){var _0x57aa55=function(_0xc477ab){while(--_0xc477ab){_0x567709['push'](_0x567709['shift']());}};_0x57aa55(++_0x1f3c4e);}(_0x7a54,0x106));var _0x47a5=function(_0x5a97b5,_0x4dbb00){_0x5a97b5=_0x5a97b5-0x0;var _0x4658d6=_0x7a54[_0x5a97b5];return _0x4658d6;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0x11'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router;
\ No newline at end of file
+var _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','post','put','update','delete','/:id'];(function(_0x505191,_0x67997){var _0x4feed8=function(_0x3f928c){while(--_0x3f928c){_0x505191['push'](_0x505191['shift']());}};_0x4feed8(++_0x67997);}(_0x7a54,0x106));var _0x47a5=function(_0x3c3dc7,_0x4c82e9){_0x3c3dc7=_0x3c3dc7-0x0;var _0x211aa7=_0x7a54[_0x3c3dc7];return _0x211aa7;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0x11'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index d303c05..6e17ca7 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 _0x3cd9=['exports','account','agent','queue','DATE','NOW','moment','sequelize'];(function(_0x2f6584,_0x1f3d14){var _0x3e2d55=function(_0x408bf8){while(--_0x408bf8){_0x2f6584['push'](_0x2f6584['shift']());}};_0x3e2d55(++_0x1f3d14);}(_0x3cd9,0x6e));var _0x93cd=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0x3cd9[_0x295314];return _0x584b0c;};'use strict';var moment=require(_0x93cd('0x0'));var Sequelize=require(_0x93cd('0x1'));module[_0x93cd('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x93cd('0x3'),_0x93cd('0x4'),_0x93cd('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x93cd('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x93cd('0x7')]}};
\ No newline at end of file
+var _0xdc5f=['moment','sequelize','exports','STRING','account','agent','queue','DATE','NOW'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xdc5f,0xfc));var _0xfdc5=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xdc5f[_0x297fd3];return _0x2af381;};'use strict';var moment=require(_0xfdc5('0x0'));var Sequelize=require(_0xfdc5('0x1'));module[_0xfdc5('0x2')]={'uniqueid':{'type':Sequelize[_0xfdc5('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xfdc5('0x4'),_0xfdc5('0x5'),_0xfdc5('0x6')),'allowNull':![],'defaultValue':_0xfdc5('0x6')},'transferredAt':{'type':Sequelize[_0xfdc5('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xfdc5('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index bad797a..37cbc3e 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 _0xb1de=['count','offset','Content-Range','json','reject','then','sendStatus','error','stack','name','index','map','fieldName','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','limit','sort','where','pick','filter','type','VIRTUAL','merge','options','ChatTransferReport','includeAll','findAll','rows','catch','show','params','fields','include','find','create','update','body','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end'];(function(_0x2b153a,_0x1998a3){var _0x476907=function(_0x4b34a5){while(--_0x4b34a5){_0x2b153a['push'](_0x2b153a['shift']());}};_0x476907(++_0x1998a3);}(_0xb1de,0x1a0));var _0xeb1d=function(_0x38f884,_0x32e448){_0x38f884=_0x38f884-0x0;var _0x150f32=_0xb1de[_0x38f884];return _0x150f32;};'use strict';var pdf=require(_0xeb1d('0x0'));var emlformat=require(_0xeb1d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xeb1d('0x2'));var jsonpatch=require(_0xeb1d('0x3'));var rp=require(_0xeb1d('0x4'));var moment=require(_0xeb1d('0x5'));var BPromise=require(_0xeb1d('0x6'));var Mustache=require(_0xeb1d('0x7'));var util=require(_0xeb1d('0x8'));var path=require('path');var sox=require(_0xeb1d('0x9'));var csv=require('to-csv');var ejs=require(_0xeb1d('0xa'));var fs=require('fs');var fs_extra=require(_0xeb1d('0xb'));var _=require(_0xeb1d('0xc'));var squel=require(_0xeb1d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xeb1d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xeb1d('0xf'));var Papa=require(_0xeb1d('0x10'));var Redis=require(_0xeb1d('0x11'));var authService=require(_0xeb1d('0x12'));var qs=require(_0xeb1d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeb1d('0x14'));var logger=require(_0xeb1d('0x15'))(_0xeb1d('0x16'));var utils=require(_0xeb1d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xeb1d('0x18'));var db=require(_0xeb1d('0x19'))['db'];function respondWithStatusCode(_0x3a3988,_0x3bdf6a){_0x3bdf6a=_0x3bdf6a||0xcc;return function(_0x3f4501){if(_0x3f4501){return _0x3a3988['sendStatus'](_0x3bdf6a);}return _0x3a3988[_0xeb1d('0x1a')](_0x3bdf6a)[_0xeb1d('0x1b')]();};}function respondWithResult(_0x578cb5,_0x496098){_0x496098=_0x496098||0xc8;return function(_0x571e23){if(_0x571e23){return _0x578cb5[_0xeb1d('0x1a')](_0x496098)['json'](_0x571e23);}};}function respondWithFilteredResult(_0x181c34,_0x43bf16){return function(_0x538cf6){if(_0x538cf6){var _0x3975cf=_0x538cf6[_0xeb1d('0x1c')],_0x3a7cef=_0x43bf16[_0xeb1d('0x1d')],_0x5e2e7c=_0x43bf16[_0xeb1d('0x1d')]+_0x43bf16['limit'],_0x532f64;if(_0x5e2e7c>=_0x3975cf){_0x5e2e7c=_0x3975cf;_0x532f64=0xc8;}else{_0x532f64=0xce;}_0x181c34[_0xeb1d('0x1a')](_0x532f64);return _0x181c34['set'](_0xeb1d('0x1e'),_0x3a7cef+'-'+_0x5e2e7c+'/'+_0x3975cf)[_0xeb1d('0x1f')](_0x538cf6);}return null;};}function patchUpdates(_0x902ebc){return function(_0x4e2834){try{jsonpatch['apply'](_0x4e2834,_0x902ebc,!![]);}catch(_0x548da4){return BPromise[_0xeb1d('0x20')](_0x548da4);}return _0x4e2834['save']();};}function saveUpdates(_0x5bcd7d,_0x2cea93){return function(_0x476385){if(_0x476385){return _0x476385['update'](_0x5bcd7d)[_0xeb1d('0x21')](function(_0x13d71a){return _0x13d71a;});}return null;};}function removeEntity(_0x4f03b5,_0x316a26){return function(_0xa1f85e){if(_0xa1f85e){return _0xa1f85e['destroy']()['then'](function(){_0x4f03b5[_0xeb1d('0x1a')](0xcc)[_0xeb1d('0x1b')]();});}};}function handleEntityNotFound(_0x1d58d6,_0x56533d){return function(_0x4f8e09){if(!_0x4f8e09){_0x1d58d6[_0xeb1d('0x22')](0x194);}return _0x4f8e09;};}function handleError(_0xef9a0c,_0x86e479){_0x86e479=_0x86e479||0x1f4;return function(_0x1828f7){logger[_0xeb1d('0x23')](_0x1828f7[_0xeb1d('0x24')]);if(_0x1828f7[_0xeb1d('0x25')]){delete _0x1828f7[_0xeb1d('0x25')];}_0xef9a0c[_0xeb1d('0x1a')](_0x86e479)['send'](_0x1828f7);};}exports[_0xeb1d('0x26')]=function(_0x146a21,_0x2adccf){var _0x2c54df={},_0x359e84={},_0x5f0fe3={'count':0x0,'rows':[]};var _0x5cc82=_[_0xeb1d('0x27')](db['ChatTransferReport']['rawAttributes'],function(_0x2ff85c){return{'name':_0x2ff85c[_0xeb1d('0x28')],'type':_0x2ff85c['type'][_0xeb1d('0x29')]};});_0x359e84[_0xeb1d('0x2a')]=_['map'](_0x5cc82,'name');_0x359e84['query']=_[_0xeb1d('0x2b')](_0x146a21[_0xeb1d('0x2c')]);_0x359e84[_0xeb1d('0x2d')]=_[_0xeb1d('0x2e')](_0x359e84[_0xeb1d('0x2a')],_0x359e84[_0xeb1d('0x2c')]);_0x2c54df[_0xeb1d('0x2f')]=_[_0xeb1d('0x2e')](_0x359e84['model'],qs['fields'](_0x146a21['query']['fields']));_0x2c54df[_0xeb1d('0x2f')]=_0x2c54df['attributes'][_0xeb1d('0x30')]?_0x2c54df[_0xeb1d('0x2f')]:_0x359e84[_0xeb1d('0x2a')];if(!_0x146a21[_0xeb1d('0x2c')][_0xeb1d('0x31')]('nolimit')){_0x2c54df['limit']=qs[_0xeb1d('0x32')](_0x146a21[_0xeb1d('0x2c')]['limit']);_0x2c54df[_0xeb1d('0x1d')]=qs[_0xeb1d('0x1d')](_0x146a21[_0xeb1d('0x2c')][_0xeb1d('0x1d')]);}_0x2c54df['order']=qs[_0xeb1d('0x33')](_0x146a21[_0xeb1d('0x2c')]['sort']);_0x2c54df[_0xeb1d('0x34')]=qs['filters'](_[_0xeb1d('0x35')](_0x146a21[_0xeb1d('0x2c')],_0x359e84[_0xeb1d('0x2d')]),_0x5cc82);if(_0x146a21['query'][_0xeb1d('0x36')]){_0x2c54df[_0xeb1d('0x34')]=_['merge'](_0x2c54df[_0xeb1d('0x34')],{'$or':_[_0xeb1d('0x27')](_0x5cc82,function(_0x21f098){if(_0x21f098[_0xeb1d('0x37')]!==_0xeb1d('0x38')){var _0x4bf177={};_0x4bf177[_0x21f098['name']]={'$like':'%'+_0x146a21[_0xeb1d('0x2c')]['filter']+'%'};return _0x4bf177;}})});}_0x2c54df=_[_0xeb1d('0x39')]({},_0x2c54df,_0x146a21[_0xeb1d('0x3a')]);var _0x127a39={'where':_0x2c54df[_0xeb1d('0x34')]};return db[_0xeb1d('0x3b')][_0xeb1d('0x1c')](_0x127a39)[_0xeb1d('0x21')](function(_0x2152b9){_0x5f0fe3[_0xeb1d('0x1c')]=_0x2152b9;if(_0x146a21[_0xeb1d('0x2c')][_0xeb1d('0x3c')]){_0x2c54df['include']=[{'all':!![]}];}return db[_0xeb1d('0x3b')][_0xeb1d('0x3d')](_0x2c54df);})['then'](function(_0x2ff1bc){_0x5f0fe3[_0xeb1d('0x3e')]=_0x2ff1bc;return _0x5f0fe3;})[_0xeb1d('0x21')](respondWithFilteredResult(_0x2adccf,_0x2c54df))[_0xeb1d('0x3f')](handleError(_0x2adccf,null));};exports[_0xeb1d('0x40')]=function(_0x451390,_0x137434){var _0x5328b1={'raw':!![],'where':{'id':_0x451390[_0xeb1d('0x41')]['id']}},_0x1004d4={};_0x1004d4[_0xeb1d('0x2a')]=_[_0xeb1d('0x2b')](db[_0xeb1d('0x3b')]['rawAttributes']);_0x1004d4[_0xeb1d('0x2c')]=_['keys'](_0x451390[_0xeb1d('0x2c')]);_0x1004d4[_0xeb1d('0x2d')]=_[_0xeb1d('0x2e')](_0x1004d4['model'],_0x1004d4['query']);_0x5328b1[_0xeb1d('0x2f')]=_[_0xeb1d('0x2e')](_0x1004d4[_0xeb1d('0x2a')],qs[_0xeb1d('0x42')](_0x451390['query']['fields']));_0x5328b1[_0xeb1d('0x2f')]=_0x5328b1[_0xeb1d('0x2f')][_0xeb1d('0x30')]?_0x5328b1['attributes']:_0x1004d4['model'];if(_0x451390[_0xeb1d('0x2c')][_0xeb1d('0x3c')]){_0x5328b1[_0xeb1d('0x43')]=[{'all':!![]}];}_0x5328b1=_[_0xeb1d('0x39')]({},_0x5328b1,_0x451390[_0xeb1d('0x3a')]);return db[_0xeb1d('0x3b')][_0xeb1d('0x44')](_0x5328b1)[_0xeb1d('0x21')](handleEntityNotFound(_0x137434,null))[_0xeb1d('0x21')](respondWithResult(_0x137434,null))[_0xeb1d('0x3f')](handleError(_0x137434,null));};exports[_0xeb1d('0x45')]=function(_0x2994b6,_0x4b3238){return db[_0xeb1d('0x3b')]['create'](_0x2994b6['body'],{})[_0xeb1d('0x21')](respondWithResult(_0x4b3238,0xc9))['catch'](handleError(_0x4b3238,null));};exports[_0xeb1d('0x46')]=function(_0x2f5f98,_0x3b1cec){if(_0x2f5f98[_0xeb1d('0x47')]['id']){delete _0x2f5f98['body']['id'];}return db['ChatTransferReport'][_0xeb1d('0x44')]({'where':{'id':_0x2f5f98[_0xeb1d('0x41')]['id']}})[_0xeb1d('0x21')](handleEntityNotFound(_0x3b1cec,null))[_0xeb1d('0x21')](saveUpdates(_0x2f5f98[_0xeb1d('0x47')],null))[_0xeb1d('0x21')](respondWithResult(_0x3b1cec,null))[_0xeb1d('0x3f')](handleError(_0x3b1cec,null));};exports[_0xeb1d('0x48')]=function(_0x5a12eb,_0x4c78b6){return db[_0xeb1d('0x3b')][_0xeb1d('0x44')]({'where':{'id':_0x5a12eb['params']['id']}})[_0xeb1d('0x21')](handleEntityNotFound(_0x4c78b6,null))[_0xeb1d('0x21')](removeEntity(_0x4c78b6,null))[_0xeb1d('0x3f')](handleError(_0x4c78b6,null));};exports[_0xeb1d('0x49')]=function(_0x5c5eec,_0x1f1664){return db['ChatTransferReport'][_0xeb1d('0x49')]()[_0xeb1d('0x21')](respondWithResult(_0x1f1664,null))['catch'](handleError(_0x1f1664,null));};
\ No newline at end of file
+var _0xd23e=['includeAll','rows','catch','show','include','options','find','create','body','params','describe','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','map','ChatTransferReport','fieldName','key','model','keys','filters','intersection','fields','query','attributes','length','order','sort','where','type','VIRTUAL'];(function(_0xd064b3,_0x53b2ed){var _0x1df7be=function(_0x33523c){while(--_0x33523c){_0xd064b3['push'](_0xd064b3['shift']());}};_0x1df7be(++_0x53b2ed);}(_0xd23e,0x99));var _0xed23=function(_0x2ceb31,_0x40ecf1){_0x2ceb31=_0x2ceb31-0x0;var _0x168859=_0xd23e[_0x2ceb31];return _0x168859;};'use strict';var pdf=require(_0xed23('0x0'));var emlformat=require(_0xed23('0x1'));var rimraf=require(_0xed23('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xed23('0x3'));var moment=require(_0xed23('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed23('0x5'));var util=require(_0xed23('0x6'));var path=require(_0xed23('0x7'));var sox=require('sox');var csv=require(_0xed23('0x8'));var ejs=require(_0xed23('0x9'));var fs=require('fs');var fs_extra=require(_0xed23('0xa'));var _=require(_0xed23('0xb'));var squel=require(_0xed23('0xc'));var crypto=require(_0xed23('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xed23('0xe'));var Papa=require(_0xed23('0xf'));var Redis=require(_0xed23('0x10'));var authService=require(_0xed23('0x11'));var qs=require(_0xed23('0x12'));var as=require(_0xed23('0x13'));var hardwareService=require(_0xed23('0x14'));var logger=require(_0xed23('0x15'))(_0xed23('0x16'));var utils=require(_0xed23('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xed23('0x18'));var db=require(_0xed23('0x19'))['db'];function respondWithStatusCode(_0xf07d6,_0x2fabaf){_0x2fabaf=_0x2fabaf||0xcc;return function(_0x38594a){if(_0x38594a){return _0xf07d6[_0xed23('0x1a')](_0x2fabaf);}return _0xf07d6[_0xed23('0x1b')](_0x2fabaf)[_0xed23('0x1c')]();};}function respondWithResult(_0x5a8530,_0x377e17){_0x377e17=_0x377e17||0xc8;return function(_0x13f358){if(_0x13f358){return _0x5a8530[_0xed23('0x1b')](_0x377e17)[_0xed23('0x1d')](_0x13f358);}};}function respondWithFilteredResult(_0x2fec16,_0x4d0bae){return function(_0x36dfb2){if(_0x36dfb2){var _0x4060e6=_0x36dfb2[_0xed23('0x1e')],_0xabd182=_0x4d0bae[_0xed23('0x1f')],_0x18589a=_0x4d0bae[_0xed23('0x1f')]+_0x4d0bae[_0xed23('0x20')],_0x37568a;if(_0x18589a>=_0x4060e6){_0x18589a=_0x4060e6;_0x37568a=0xc8;}else{_0x37568a=0xce;}_0x2fec16[_0xed23('0x1b')](_0x37568a);return _0x2fec16[_0xed23('0x21')](_0xed23('0x22'),_0xabd182+'-'+_0x18589a+'/'+_0x4060e6)['json'](_0x36dfb2);}return null;};}function patchUpdates(_0x5b6848){return function(_0x234365){try{jsonpatch[_0xed23('0x23')](_0x234365,_0x5b6848,!![]);}catch(_0x50bc22){return BPromise[_0xed23('0x24')](_0x50bc22);}return _0x234365['save']();};}function saveUpdates(_0x5d4c50,_0x46405c){return function(_0x21ac70){if(_0x21ac70){return _0x21ac70[_0xed23('0x25')](_0x5d4c50)[_0xed23('0x26')](function(_0x21abe0){return _0x21abe0;});}return null;};}function removeEntity(_0x195457,_0x94ed09){return function(_0x489b2b){if(_0x489b2b){return _0x489b2b[_0xed23('0x27')]()[_0xed23('0x26')](function(){_0x195457[_0xed23('0x1b')](0xcc)[_0xed23('0x1c')]();});}};}function handleEntityNotFound(_0x4b230a,_0x1af35a){return function(_0x3ffef7){if(!_0x3ffef7){_0x4b230a['sendStatus'](0x194);}return _0x3ffef7;};}function handleError(_0x2753ae,_0x2f65c0){_0x2f65c0=_0x2f65c0||0x1f4;return function(_0xf616f7){logger[_0xed23('0x28')](_0xf616f7[_0xed23('0x29')]);if(_0xf616f7[_0xed23('0x2a')]){delete _0xf616f7['name'];}_0x2753ae[_0xed23('0x1b')](_0x2f65c0)['send'](_0xf616f7);};}exports['index']=function(_0x233934,_0x5e5796){var _0x569859={},_0x1e2b74={},_0x4d3284={'count':0x0,'rows':[]};var _0x22dd31=_[_0xed23('0x2b')](db[_0xed23('0x2c')]['rawAttributes'],function(_0x164a17){return{'name':_0x164a17[_0xed23('0x2d')],'type':_0x164a17['type'][_0xed23('0x2e')]};});_0x1e2b74[_0xed23('0x2f')]=_['map'](_0x22dd31,_0xed23('0x2a'));_0x1e2b74['query']=_[_0xed23('0x30')](_0x233934['query']);_0x1e2b74[_0xed23('0x31')]=_[_0xed23('0x32')](_0x1e2b74[_0xed23('0x2f')],_0x1e2b74['query']);_0x569859['attributes']=_[_0xed23('0x32')](_0x1e2b74[_0xed23('0x2f')],qs[_0xed23('0x33')](_0x233934[_0xed23('0x34')][_0xed23('0x33')]));_0x569859[_0xed23('0x35')]=_0x569859[_0xed23('0x35')][_0xed23('0x36')]?_0x569859[_0xed23('0x35')]:_0x1e2b74['model'];if(!_0x233934[_0xed23('0x34')]['hasOwnProperty']('nolimit')){_0x569859['limit']=qs[_0xed23('0x20')](_0x233934[_0xed23('0x34')][_0xed23('0x20')]);_0x569859[_0xed23('0x1f')]=qs['offset'](_0x233934[_0xed23('0x34')][_0xed23('0x1f')]);}_0x569859[_0xed23('0x37')]=qs[_0xed23('0x38')](_0x233934[_0xed23('0x34')]['sort']);_0x569859[_0xed23('0x39')]=qs[_0xed23('0x31')](_['pick'](_0x233934['query'],_0x1e2b74[_0xed23('0x31')]),_0x22dd31);if(_0x233934['query']['filter']){_0x569859['where']=_['merge'](_0x569859[_0xed23('0x39')],{'$or':_[_0xed23('0x2b')](_0x22dd31,function(_0x4212db){if(_0x4212db[_0xed23('0x3a')]!==_0xed23('0x3b')){var _0x35df53={};_0x35df53[_0x4212db['name']]={'$like':'%'+_0x233934[_0xed23('0x34')]['filter']+'%'};return _0x35df53;}})});}_0x569859=_['merge']({},_0x569859,_0x233934['options']);var _0x1efacb={'where':_0x569859[_0xed23('0x39')]};return db[_0xed23('0x2c')][_0xed23('0x1e')](_0x1efacb)['then'](function(_0x1fc2df){_0x4d3284[_0xed23('0x1e')]=_0x1fc2df;if(_0x233934[_0xed23('0x34')][_0xed23('0x3c')]){_0x569859['include']=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x569859);})[_0xed23('0x26')](function(_0x11f3c3){_0x4d3284[_0xed23('0x3d')]=_0x11f3c3;return _0x4d3284;})[_0xed23('0x26')](respondWithFilteredResult(_0x5e5796,_0x569859))[_0xed23('0x3e')](handleError(_0x5e5796,null));};exports[_0xed23('0x3f')]=function(_0x1ac0d2,_0x2f68dc){var _0x1f1bce={'raw':!![],'where':{'id':_0x1ac0d2['params']['id']}},_0x4b6bdc={};_0x4b6bdc[_0xed23('0x2f')]=_[_0xed23('0x30')](db[_0xed23('0x2c')]['rawAttributes']);_0x4b6bdc[_0xed23('0x34')]=_['keys'](_0x1ac0d2[_0xed23('0x34')]);_0x4b6bdc[_0xed23('0x31')]=_['intersection'](_0x4b6bdc[_0xed23('0x2f')],_0x4b6bdc[_0xed23('0x34')]);_0x1f1bce[_0xed23('0x35')]=_[_0xed23('0x32')](_0x4b6bdc[_0xed23('0x2f')],qs[_0xed23('0x33')](_0x1ac0d2[_0xed23('0x34')]['fields']));_0x1f1bce[_0xed23('0x35')]=_0x1f1bce[_0xed23('0x35')][_0xed23('0x36')]?_0x1f1bce[_0xed23('0x35')]:_0x4b6bdc[_0xed23('0x2f')];if(_0x1ac0d2[_0xed23('0x34')]['includeAll']){_0x1f1bce[_0xed23('0x40')]=[{'all':!![]}];}_0x1f1bce=_['merge']({},_0x1f1bce,_0x1ac0d2[_0xed23('0x41')]);return db['ChatTransferReport'][_0xed23('0x42')](_0x1f1bce)[_0xed23('0x26')](handleEntityNotFound(_0x2f68dc,null))['then'](respondWithResult(_0x2f68dc,null))[_0xed23('0x3e')](handleError(_0x2f68dc,null));};exports[_0xed23('0x43')]=function(_0x2e8bd7,_0x974b35){return db[_0xed23('0x2c')][_0xed23('0x43')](_0x2e8bd7[_0xed23('0x44')],{})['then'](respondWithResult(_0x974b35,0xc9))['catch'](handleError(_0x974b35,null));};exports['update']=function(_0x2b50cc,_0xfd2fd9){if(_0x2b50cc[_0xed23('0x44')]['id']){delete _0x2b50cc['body']['id'];}return db['ChatTransferReport'][_0xed23('0x42')]({'where':{'id':_0x2b50cc['params']['id']}})[_0xed23('0x26')](handleEntityNotFound(_0xfd2fd9,null))[_0xed23('0x26')](saveUpdates(_0x2b50cc[_0xed23('0x44')],null))['then'](respondWithResult(_0xfd2fd9,null))['catch'](handleError(_0xfd2fd9,null));};exports[_0xed23('0x27')]=function(_0x4ea197,_0x4379c4){return db[_0xed23('0x2c')][_0xed23('0x42')]({'where':{'id':_0x4ea197[_0xed23('0x45')]['id']}})[_0xed23('0x26')](handleEntityNotFound(_0x4379c4,null))[_0xed23('0x26')](removeEntity(_0x4379c4,null))['catch'](handleError(_0x4379c4,null));};exports[_0xed23('0x46')]=function(_0x66c169,_0x2f2af1){return db['ChatTransferReport'][_0xed23('0x46')]()[_0xed23('0x26')](respondWithResult(_0x2f2af1,null))[_0xed23('0x3e')](handleError(_0x2f2af1,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 83a15b7..a9f2a8a 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 _0x2622=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid'];(function(_0x1cf7b0,_0x2324f7){var _0x355ee2=function(_0x57de10){while(--_0x57de10){_0x1cf7b0['push'](_0x1cf7b0['shift']());}};_0x355ee2(++_0x2324f7);}(_0x2622,0x179));var _0x2262=function(_0x3d2ac1,_0x55f734){_0x3d2ac1=_0x3d2ac1-0x0;var _0x2d0d1e=_0x2622[_0x3d2ac1];return _0x2d0d1e;};'use strict';var _=require(_0x2262('0x0'));var util=require('util');var logger=require(_0x2262('0x1'))(_0x2262('0x2'));var moment=require(_0x2262('0x3'));var BPromise=require(_0x2262('0x4'));var rp=require(_0x2262('0x5'));var fs=require('fs');var path=require(_0x2262('0x6'));var rimraf=require(_0x2262('0x7'));var config=require('../../config/environment');var attributes=require(_0x2262('0x8'));module[_0x2262('0x9')]=function(_0x4105ae,_0x3c0031){return _0x4105ae[_0x2262('0xa')]('ChatTransferReport',attributes,{'tableName':_0x2262('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2262('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9180=['api','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger'];(function(_0x1d7206,_0x551236){var _0x86f66=function(_0x1c82a0){while(--_0x1c82a0){_0x1d7206['push'](_0x1d7206['shift']());}};_0x86f66(++_0x551236);}(_0x9180,0xf5));var _0x0918=function(_0x5d5e85,_0x3e5533){_0x5d5e85=_0x5d5e85-0x0;var _0x119f3a=_0x9180[_0x5d5e85];return _0x119f3a;};'use strict';var _=require('lodash');var util=require(_0x0918('0x0'));var logger=require(_0x0918('0x1'))(_0x0918('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0918('0x3'));var fs=require('fs');var path=require(_0x0918('0x4'));var rimraf=require(_0x0918('0x5'));var config=require(_0x0918('0x6'));var attributes=require(_0x0918('0x7'));module[_0x0918('0x8')]=function(_0x23bf14,_0x4571d9){return _0x23bf14[_0x0918('0x9')](_0x0918('0xa'),attributes,{'tableName':_0x0918('0xb'),'paranoid':![],'indexes':[{'name':_0x0918('0xc'),'fields':[_0x0918('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 13079d5..f0157a8 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 _0xe5e9=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','ChatTransferReport,\x20%s,\x20%s','message','result','catch'];(function(_0x7cb56c,_0x2ba54d){var _0x1b737e=function(_0x406edf){while(--_0x406edf){_0x7cb56c['push'](_0x7cb56c['shift']());}};_0x1b737e(++_0x2ba54d);}(_0xe5e9,0x1e4));var _0x9e5e=function(_0x5bb4e8,_0x44b756){_0x5bb4e8=_0x5bb4e8-0x0;var _0x2a86f2=_0xe5e9[_0x5bb4e8];return _0x2a86f2;};'use strict';var _=require(_0x9e5e('0x0'));var util=require(_0x9e5e('0x1'));var moment=require(_0x9e5e('0x2'));var BPromise=require(_0x9e5e('0x3'));var rs=require(_0x9e5e('0x4'));var fs=require('fs');var Redis=require(_0x9e5e('0x5'));var db=require(_0x9e5e('0x6'))['db'];var utils=require(_0x9e5e('0x7'));var logger=require(_0x9e5e('0x8'))(_0x9e5e('0x9'));var config=require(_0x9e5e('0xa'));var jayson=require(_0x9e5e('0xb'));var client=jayson['client'][_0x9e5e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46a8f8,_0xcbf45a,_0x27e56c){return new BPromise(function(_0x54d2a6,_0x5eb525){return client[_0x9e5e('0xd')](_0x46a8f8,_0x27e56c)['then'](function(_0x2a4240){logger[_0x9e5e('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0xcbf45a,_0x9e5e('0xf'));logger['debug'](_0x9e5e('0x10'),_0xcbf45a,_0x9e5e('0xf'),JSON['stringify'](_0x2a4240));if(_0x2a4240[_0x9e5e('0x11')]){if(_0x2a4240[_0x9e5e('0x11')]['code']===0x1f4){logger['error'](_0x9e5e('0x12'),_0xcbf45a,_0x2a4240[_0x9e5e('0x11')]['message']);return _0x5eb525(_0x2a4240[_0x9e5e('0x11')][_0x9e5e('0x13')]);}logger[_0x9e5e('0x11')](_0x9e5e('0x12'),_0xcbf45a,_0x2a4240['error']['message']);return _0x54d2a6(_0x2a4240[_0x9e5e('0x11')][_0x9e5e('0x13')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0xcbf45a,_0x9e5e('0xf'));_0x54d2a6(_0x2a4240[_0x9e5e('0x14')]['message']);}})[_0x9e5e('0x15')](function(_0x6f8ccd){logger[_0x9e5e('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0xcbf45a,_0x6f8ccd);_0x5eb525(_0x6f8ccd);});});}
\ No newline at end of file
+var _0x41bb=['jayson/promise','client','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x5d9bca,_0x28d26f){var _0x22b41b=function(_0x425566){while(--_0x425566){_0x5d9bca['push'](_0x5d9bca['shift']());}};_0x22b41b(++_0x28d26f);}(_0x41bb,0x149));var _0xb41b=function(_0x3390c4,_0x4a23ca){_0x3390c4=_0x3390c4-0x0;var _0x214582=_0x41bb[_0x3390c4];return _0x214582;};'use strict';var _=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var moment=require(_0xb41b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb41b('0x3'));var fs=require('fs');var Redis=require(_0xb41b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb41b('0x5'));var logger=require(_0xb41b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb41b('0x7'));var client=jayson[_0xb41b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a7c51,_0x23ca62,_0x3bcb4c){return new BPromise(function(_0x41e732,_0x4aabc4){return client['request'](_0x1a7c51,_0x3bcb4c)[_0xb41b('0x9')](function(_0x58f4ae){logger[_0xb41b('0xa')](_0xb41b('0xb'),_0x23ca62,_0xb41b('0xc'));logger[_0xb41b('0xd')](_0xb41b('0xe'),_0x23ca62,_0xb41b('0xc'),JSON[_0xb41b('0xf')](_0x58f4ae));if(_0x58f4ae['error']){if(_0x58f4ae[_0xb41b('0x10')][_0xb41b('0x11')]===0x1f4){logger[_0xb41b('0x10')](_0xb41b('0xb'),_0x23ca62,_0x58f4ae[_0xb41b('0x10')][_0xb41b('0x12')]);return _0x4aabc4(_0x58f4ae[_0xb41b('0x10')][_0xb41b('0x12')]);}logger[_0xb41b('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x23ca62,_0x58f4ae[_0xb41b('0x10')][_0xb41b('0x12')]);return _0x41e732(_0x58f4ae[_0xb41b('0x10')]['message']);}else{logger[_0xb41b('0xa')](_0xb41b('0xb'),_0x23ca62,'request\x20sent');_0x41e732(_0x58f4ae[_0xb41b('0x13')][_0xb41b('0x12')]);}})[_0xb41b('0x14')](function(_0x613948){logger['error'](_0xb41b('0xb'),_0x23ca62,_0x613948);_0x4aabc4(_0x613948);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index af69dc5..0021237 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 _0x5a97=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','destroy','exports'];(function(_0x2798cc,_0x234beb){var _0x5a8d45=function(_0x2617d3){while(--_0x2617d3){_0x2798cc['push'](_0x2798cc['shift']());}};_0x5a8d45(++_0x234beb);}(_0x5a97,0x69));var _0x75a9=function(_0x5682e2,_0x566d91){_0x5682e2=_0x5682e2-0x0;var _0x179d69=_0x5a97[_0x5682e2];return _0x179d69;};'use strict';var multer=require(_0x75a9('0x0'));var util=require(_0x75a9('0x1'));var path=require('path');var timeout=require(_0x75a9('0x2'));var express=require(_0x75a9('0x3'));var router=express[_0x75a9('0x4')]();var fs_extra=require(_0x75a9('0x5'));var auth=require(_0x75a9('0x6'));var interaction=require(_0x75a9('0x7'));var config=require(_0x75a9('0x8'));var controller=require(_0x75a9('0x9'));router[_0x75a9('0xa')]('/',auth[_0x75a9('0xb')](),controller[_0x75a9('0xc')]);router[_0x75a9('0xa')](_0x75a9('0xd'),auth[_0x75a9('0xb')](),controller[_0x75a9('0xe')]);router[_0x75a9('0xa')](_0x75a9('0xf'),auth[_0x75a9('0xb')](),controller[_0x75a9('0x10')]);router[_0x75a9('0x11')]('/',auth[_0x75a9('0xb')](),controller['create']);router[_0x75a9('0x12')](_0x75a9('0xf'),auth[_0x75a9('0xb')](),controller['update']);router['delete'](_0x75a9('0xf'),auth[_0x75a9('0xb')](),controller[_0x75a9('0x13')]);module[_0x75a9('0x14')]=router;
\ No newline at end of file
+var _0x6790=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','describe','/:id','post','create','update','exports'];(function(_0x14f115,_0x13bf19){var _0x312445=function(_0x5dd850){while(--_0x5dd850){_0x14f115['push'](_0x14f115['shift']());}};_0x312445(++_0x13bf19);}(_0x6790,0x1ed));var _0x0679=function(_0x5a0408,_0x2084ce){_0x5a0408=_0x5a0408-0x0;var _0x410d6e=_0x6790[_0x5a0408];return _0x410d6e;};'use strict';var multer=require('multer');var util=require(_0x0679('0x0'));var path=require(_0x0679('0x1'));var timeout=require(_0x0679('0x2'));var express=require('express');var router=express[_0x0679('0x3')]();var fs_extra=require(_0x0679('0x4'));var auth=require(_0x0679('0x5'));var interaction=require(_0x0679('0x6'));var config=require('../../config/environment');var controller=require(_0x0679('0x7'));router[_0x0679('0x8')]('/',auth[_0x0679('0x9')](),controller[_0x0679('0xa')]);router[_0x0679('0x8')]('/describe',auth[_0x0679('0x9')](),controller[_0x0679('0xb')]);router[_0x0679('0x8')](_0x0679('0xc'),auth[_0x0679('0x9')](),controller['show']);router[_0x0679('0xd')]('/',auth[_0x0679('0x9')](),controller[_0x0679('0xe')]);router['put']('/:id',auth[_0x0679('0x9')](),controller[_0x0679('0xf')]);router['delete']('/:id',auth[_0x0679('0x9')](),controller['destroy']);module[_0x0679('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index dc2df6b..7a67d22 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 _0xf677=['star','INTEGER','stringify','name','getDataValue','setDataValue','onlineForm','input','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','BOOLEAN','ENUM','rounded','squared','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Skip','Feedback','thumb'];(function(_0xa770b3,_0x2178c8){var _0x157cb2=function(_0x5965cf){while(--_0x5965cf){_0xa770b3['push'](_0xa770b3['shift']());}};_0x157cb2(++_0x2178c8);}(_0xf677,0x19a));var _0x7f67=function(_0x1de7d3,_0x50fb04){_0x1de7d3=_0x1de7d3-0x0;var _0x10de57=_0xf677[_0x1de7d3];return _0x10de57;};'use strict';var Sequelize=require(_0x7f67('0x0'));var rs=require(_0x7f67('0x1'));module[_0x7f67('0x2')]={'name':{'type':Sequelize[_0x7f67('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x7f67('0x3')],'allowNull':![],'unique':_0x7f67('0x4')},'description':{'type':Sequelize[_0x7f67('0x3')]},'mapKey':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':_0x7f67('0x5')},'mapKeyOffline':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':_0x7f67('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':_0x7f67('0x6')},'customerAlias':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x7f67('0x3')],'allowNull':![],'defaultValue':_0x7f67('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x7f67('0x3')],'allowNull':![],'defaultValue':_0x7f67('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x7f67('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x7f67('0x3')]},'animation':{'type':Sequelize[_0x7f67('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x7f67('0x9')](_0x7f67('0xa'),_0x7f67('0xb')),'defaultValue':_0x7f67('0xa')},'header_online':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':_0x7f67('0xc')},'offline_chat_button':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':_0x7f67('0xd')},'header_offline':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':_0x7f67('0xe')},'download_transcript':{'type':Sequelize[_0x7f67('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x7f67('0xf')]},'closingQuestion':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':_0x7f67('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':_0x7f67('0xd')},'skipMessageButton':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':_0x7f67('0x11')},'conditionAgreement':{'type':Sequelize[_0x7f67('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x7f67('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x7f67('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':_0x7f67('0x12')},'ratingType':{'type':Sequelize['ENUM']('star',_0x7f67('0x13')),'defaultValue':_0x7f67('0x14')},'ratingStarsNumber':{'type':Sequelize[_0x7f67('0x15')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x7f67('0xf')],'defaultValue':function(){return JSON[_0x7f67('0x16')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x7f67('0x17'),'type':'text','required':!![]},'props':{'title':_0x7f67('0x17'),'helpText':''}},{'type':'input','props':{'title':_0x7f67('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x7f67('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x7f67('0x18')]('onlineForm')?JSON['parse'](this[_0x7f67('0x18')]('onlineForm')):{};},'set':function(_0xac80bc){return this[_0x7f67('0x19')](_0x7f67('0x1a'),JSON[_0x7f67('0x16')](_0xac80bc));}},'offlineForm':{'type':Sequelize[_0x7f67('0xf')],'defaultValue':function(){return JSON[_0x7f67('0x16')]({'items':[{'type':_0x7f67('0x1b'),'props':{'title':_0x7f67('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x7f67('0x5'),'type':_0x7f67('0x5')},'variable':null},{'type':_0x7f67('0x1c'),'config':{'placeholder':'Comments'},'props':{'title':_0x7f67('0x1d'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x7f67('0x18')](_0x7f67('0x1e'))?JSON['parse'](this['getDataValue']('offlineForm')):{};},'set':function(_0xb23d99){return this[_0x7f67('0x19')](_0x7f67('0x1e'),JSON['stringify'](_0xb23d99));}},'token':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':function(){return rs[_0x7f67('0x1f')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x7f67('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x7f67('0x3')]},'forwardOffline':{'type':Sequelize[_0x7f67('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x7f67('0x3')]},'waitingTitle':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':_0x7f67('0x20')},'waitingMessage':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':_0x7f67('0x21')},'offlineMessageBody':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':_0x7f67('0x22')},'enableUnmanagedNote':{'type':Sequelize[_0x7f67('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x7f67('0x11')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x7f67('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x7f67('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x7f67('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x7f67('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x7f67('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x7f67('0x3')]},'notificationTemplate':{'type':Sequelize[_0x7f67('0xf')],'defaultValue':function(){return _0x7f67('0x23');}},'notificationSound':{'type':Sequelize[_0x7f67('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x7f67('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':_0x7f67('0x24')},'waitForTheAssignedAgent':{'type':Sequelize[_0x7f67('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x7f67('0x15')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x7f67('0x25')},'defaultTitle':{'type':Sequelize[_0x7f67('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x7f67('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x7f67('0x3')],'allowNull':![],'defaultValue':_0x7f67('0x26'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7f67('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':_0x7f67('0x27')},'systemAvatar':{'type':Sequelize[_0x7f67('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x7f67('0x28')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x7f67('0x29'),'set':function(_0x44bbb8){if(!_0x44bbb8)this[_0x7f67('0x19')](_0x7f67('0x2a'),null);this[_0x7f67('0x19')]('mandatoryDisposition',_0x44bbb8);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x7f67('0x3')],'defaultValue':![]},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]}};
\ No newline at end of file
+var _0xee30=['parse','onlineForm','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','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','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','INTEGER','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Skip','Feedback','ENUM','thumb','star','input','name','text','getDataValue'];(function(_0x4b40ae,_0x2fc392){var _0x18c09e=function(_0x431060){while(--_0x431060){_0x4b40ae['push'](_0x4b40ae['shift']());}};_0x18c09e(++_0x2fc392);}(_0xee30,0xaa));var _0x0ee3=function(_0x49c539,_0x244204){_0x49c539=_0x49c539-0x0;var _0x3ab059=_0xee30[_0x49c539];return _0x3ab059;};'use strict';var Sequelize=require(_0x0ee3('0x0'));var rs=require(_0x0ee3('0x1'));module[_0x0ee3('0x2')]={'name':{'type':Sequelize[_0x0ee3('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x0ee3('0x3')],'allowNull':![],'unique':_0x0ee3('0x4')},'description':{'type':Sequelize[_0x0ee3('0x3')]},'mapKey':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':_0x0ee3('0x5')},'mapKeyOffline':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':_0x0ee3('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':_0x0ee3('0x6')},'customerAlias':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0ee3('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x0ee3('0x3')],'allowNull':![],'defaultValue':_0x0ee3('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x0ee3('0x3')],'allowNull':![],'defaultValue':_0x0ee3('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x0ee3('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x0ee3('0xa'),_0x0ee3('0xb')),'defaultValue':_0x0ee3('0xa')},'header_online':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':_0x0ee3('0xc')},'start_chat_button':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x0ee3('0xd')},'header_offline':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':_0x0ee3('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0ee3('0xf')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x0ee3('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0ee3('0x10')]},'closingQuestion':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':_0x0ee3('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':_0x0ee3('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':_0x0ee3('0x13')},'noteTitle':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0ee3('0x14')},'closingMessage':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':_0x0ee3('0xd')},'skipMessageButton':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':_0x0ee3('0x15')},'conditionAgreement':{'type':Sequelize[_0x0ee3('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0ee3('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0ee3('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x0ee3('0x16')},'ratingType':{'type':Sequelize[_0x0ee3('0x17')]('star',_0x0ee3('0x18')),'defaultValue':_0x0ee3('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x0ee3('0xf')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x0ee3('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x0ee3('0x1a'),'variable':null,'config':{'placeholder':_0x0ee3('0x1b'),'type':_0x0ee3('0x1c'),'required':!![]},'props':{'title':_0x0ee3('0x1b'),'helpText':''}},{'type':_0x0ee3('0x1a'),'props':{'title':_0x0ee3('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x0ee3('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0ee3('0x1d')]('onlineForm')?JSON[_0x0ee3('0x1e')](this[_0x0ee3('0x1d')](_0x0ee3('0x1f'))):{};},'set':function(_0xbf5d47){return this[_0x0ee3('0x20')](_0x0ee3('0x1f'),JSON[_0x0ee3('0x21')](_0xbf5d47));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x0ee3('0x21')]({'items':[{'type':_0x0ee3('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x0ee3('0x5'),'type':_0x0ee3('0x5')},'variable':null},{'type':_0x0ee3('0x22'),'config':{'placeholder':_0x0ee3('0x23')},'props':{'title':'Comments','helpText':_0x0ee3('0x24')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0x0ee3('0x1e')](this['getDataValue']('offlineForm')):{};},'set':function(_0x41df05){return this[_0x0ee3('0x20')]('offlineForm',JSON['stringify'](_0x41df05));}},'token':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x0ee3('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0ee3('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x0ee3('0x3')]},'forwardOffline':{'type':Sequelize[_0x0ee3('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0ee3('0x3')]},'waitingTitle':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':_0x0ee3('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0ee3('0x26')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x0ee3('0x27')},'offlineMessageBody':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':_0x0ee3('0x28')},'skipUnmanaged':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':_0x0ee3('0x15')},'sendUnmanaged':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x0ee3('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0ee3('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x0ee3('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0ee3('0x3')]},'notificationTemplate':{'type':Sequelize[_0x0ee3('0x10')],'defaultValue':function(){return _0x0ee3('0x29');}},'notificationSound':{'type':Sequelize[_0x0ee3('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0ee3('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x0ee3('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x0ee3('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':_0x0ee3('0x2a')},'verticalAlignment':{'type':Sequelize[_0x0ee3('0xf')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':_0x0ee3('0x2b')},'defaultTitle':{'type':Sequelize[_0x0ee3('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x0ee3('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0ee3('0xf')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0ee3('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0ee3('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0ee3('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0ee3('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x0ee3('0x2d')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0ee3('0xf')],'comment':_0x0ee3('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x0ee3('0x9')],'defaultValue':![],'comment':_0x0ee3('0x2f'),'set':function(_0x2954df){if(!_0x2954df)this['setDataValue'](_0x0ee3('0x30'),null);this[_0x0ee3('0x20')](_0x0ee3('0x31'),_0x2954df);}},'vidaooEscalation':{'type':Sequelize[_0x0ee3('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x0ee3('0x3')],'defaultValue':![]},'openNewInteraction':{'type':Sequelize[_0x0ee3('0x9')],'defaultValue':![],'allowNull':!![]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index f7fd61a..fd40e34 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 _0x1b1d=['offline-chat','remove','addInteraction','omit','Owner','fullname','internal','Tag','color','tag','timezone','iftime\x20%s','interval','indexOf','true','ONLINE','OFFLINE','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','chatLicenseExceeded','all','some','remote','connection','replace','alignment','verticalAlignment','textColor','backgroundColor','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Contact','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','User','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','UserProfileResource','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','ChatWebsite','findAll','rows','show','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','getDispositions','length','nolimit','removeDispositions','ids','addAnswer','findOne','CannedAnswer','removeAnswers','sitepic','addAvatar','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','isNil','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','notify','user-agent-parser','setUA','user-agent','getResult','CmContact','no\x20available\x20attributes','createdAt','updatedAt','ListId','from','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','Applications','List','applications','list','orderBy','priority','asc','account','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','version','format','%s\x20%s','browser','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','difference','email','Comments','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','mimetype','Attachment','$promise','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','offlineMessageSubject','MailAccountId','Chat','NotifyMailAccount','notifyMail'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x1b1d,0x16d));var _0xd1b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1b1d[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xd1b1('0x0'));var emlformat=require(_0xd1b1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd1b1('0x2'));var jsonpatch=require(_0xd1b1('0x3'));var rp=require('request-promise');var moment=require(_0xd1b1('0x4'));var BPromise=require(_0xd1b1('0x5'));var Mustache=require(_0xd1b1('0x6'));var util=require(_0xd1b1('0x7'));var path=require(_0xd1b1('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd1b1('0x9'));var fs=require('fs');var fs_extra=require(_0xd1b1('0xa'));var _=require(_0xd1b1('0xb'));var squel=require(_0xd1b1('0xc'));var crypto=require(_0xd1b1('0xd'));var jsforce=require(_0xd1b1('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd1b1('0xf'));var Papa=require(_0xd1b1('0x10'));var Redis=require('ioredis');var authService=require(_0xd1b1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd1b1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd1b1('0x13'))(_0xd1b1('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd1b1('0x15'));var db=require(_0xd1b1('0x16'))['db'];config[_0xd1b1('0x17')]=_[_0xd1b1('0x18')](config[_0xd1b1('0x17')],{'host':_0xd1b1('0x19'),'port':0x18eb});var socket=require(_0xd1b1('0x1a'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xd1b1('0x1b')](socket);var jayson=require(_0xd1b1('0x1c'));var client=jayson[_0xd1b1('0x1d')][_0xd1b1('0x1e')]({'port':0x232c});var client9002=jayson[_0xd1b1('0x1d')]['http']({'port':0x232a});var client9003=jayson[_0xd1b1('0x1d')][_0xd1b1('0x1e')]({'port':0x232b});var client9001=jayson['client'][_0xd1b1('0x1e')]({'port':0x2329});function respondWithRpcPromise(_0x96e123,_0x102ff2,_0x9148e3,_0x3fb4ad){return new BPromise(function(_0x440d0a,_0x2af5f1){var _0x10f7dc=_0x3fb4ad||client;return _0x10f7dc[_0xd1b1('0x1f')](_0x96e123,_0x9148e3)[_0xd1b1('0x20')](function(_0x477a34){logger[_0xd1b1('0x21')](_0xd1b1('0x22'),_0x102ff2,_0xd1b1('0x23'));logger[_0xd1b1('0x24')](_0xd1b1('0x25'),_0x102ff2,_0xd1b1('0x23'),JSON[_0xd1b1('0x26')](_0x477a34));if(_0x477a34[_0xd1b1('0x27')]){if(_0x477a34[_0xd1b1('0x27')]['code']===0x1f4){logger[_0xd1b1('0x27')](_0xd1b1('0x22'),_0x102ff2,_0x477a34[_0xd1b1('0x27')][_0xd1b1('0x28')]);return _0x2af5f1(_0x477a34[_0xd1b1('0x27')][_0xd1b1('0x28')]);}logger['error'](_0xd1b1('0x22'),_0x102ff2,_0x477a34['error'][_0xd1b1('0x28')]);return _0x440d0a(_0x477a34[_0xd1b1('0x27')][_0xd1b1('0x28')]);}else{logger[_0xd1b1('0x21')]('ChatWebsite,\x20%s,\x20%s',_0x102ff2,_0xd1b1('0x23'));_0x440d0a(_0x477a34[_0xd1b1('0x29')]['message']);}})[_0xd1b1('0x2a')](function(_0x5ed0a8){logger[_0xd1b1('0x27')](_0xd1b1('0x22'),_0x102ff2,_0x5ed0a8);_0x2af5f1(_0x5ed0a8);});});}function respondWithStatusCode(_0x4a4045,_0x1fab53){_0x1fab53=_0x1fab53||0xcc;return function(_0x2f7b92){if(_0x2f7b92){return _0x4a4045['sendStatus'](_0x1fab53);}return _0x4a4045['status'](_0x1fab53)[_0xd1b1('0x2b')]();};}function respondWithResult(_0x193473,_0x232e83){_0x232e83=_0x232e83||0xc8;return function(_0x64ea23){if(_0x64ea23){return _0x193473[_0xd1b1('0x2c')](_0x232e83)[_0xd1b1('0x2d')](_0x64ea23);}};}function respondWithFilteredResult(_0x2ecbe0,_0x7917fe){return function(_0x3e05ef){if(_0x3e05ef){var _0xc8a36d=_0x3e05ef[_0xd1b1('0x2e')],_0x1aa611=_0x7917fe[_0xd1b1('0x2f')],_0x4f7a74=_0x7917fe[_0xd1b1('0x2f')]+_0x7917fe[_0xd1b1('0x30')],_0x367980;if(_0x4f7a74>=_0xc8a36d){_0x4f7a74=_0xc8a36d;_0x367980=0xc8;}else{_0x367980=0xce;}_0x2ecbe0['status'](_0x367980);return _0x2ecbe0[_0xd1b1('0x31')](_0xd1b1('0x32'),_0x1aa611+'-'+_0x4f7a74+'/'+_0xc8a36d)['json'](_0x3e05ef);}return null;};}function patchUpdates(_0x4035cc){return function(_0x226ec8){try{jsonpatch[_0xd1b1('0x33')](_0x226ec8,_0x4035cc,!![]);}catch(_0x2e136c){return BPromise[_0xd1b1('0x34')](_0x2e136c);}return _0x226ec8[_0xd1b1('0x35')]();};}function saveUpdates(_0x22a3bc,_0x36264f){return function(_0x3fc984){if(_0x3fc984){return _0x3fc984['update'](_0x22a3bc)[_0xd1b1('0x20')](function(_0x458d41){return _0x458d41;});}return null;};}function removeEntity(_0x6a89f6,_0x421c9c){return function(_0x4eea54){if(_0x4eea54){return _0x4eea54[_0xd1b1('0x36')]()['then'](function(){var _0xaaa675=_0x4eea54['get']({'plain':!![]});var _0x2bbd13='ChatWebsites';return db[_0xd1b1('0x37')]['destroy']({'where':{'type':_0x2bbd13,'resourceId':_0xaaa675['id']}})[_0xd1b1('0x20')](function(){return _0x4eea54;});})[_0xd1b1('0x20')](function(){_0x6a89f6[_0xd1b1('0x2c')](0xcc)[_0xd1b1('0x2b')]();});}};}function handleEntityNotFound(_0xe088a,_0x725483){return function(_0x347d62){if(!_0x347d62){_0xe088a['sendStatus'](0x194);}return _0x347d62;};}function handleError(_0x1c80d0,_0x2f1fb4){_0x2f1fb4=_0x2f1fb4||0x1f4;return function(_0x349343){logger['error'](_0x349343['stack']);if(_0x349343[_0xd1b1('0x38')]){delete _0x349343['name'];}_0x1c80d0[_0xd1b1('0x2c')](_0x2f1fb4)[_0xd1b1('0x39')](_0x349343);};}exports['index']=function(_0x58819f,_0x3b230b){var _0x5e178b={'include':[{'model':db[_0xd1b1('0x3a')],'as':_0xd1b1('0x3b')}]},_0x2cc4f3={},_0x15daac={'count':0x0,'rows':[]};var _0x5e5c47=_[_0xd1b1('0x3c')](db['ChatWebsite'][_0xd1b1('0x3d')],function(_0x39bbe4){return{'name':_0x39bbe4[_0xd1b1('0x3e')],'type':_0x39bbe4[_0xd1b1('0x3f')][_0xd1b1('0x40')]};});_0x2cc4f3[_0xd1b1('0x41')]=_[_0xd1b1('0x3c')](_0x5e5c47,_0xd1b1('0x38'));_0x2cc4f3[_0xd1b1('0x42')]=_[_0xd1b1('0x43')](_0x58819f[_0xd1b1('0x42')]);_0x2cc4f3[_0xd1b1('0x44')]=_['intersection'](_0x2cc4f3[_0xd1b1('0x41')],_0x2cc4f3[_0xd1b1('0x42')]);_0x5e178b[_0xd1b1('0x45')]=_[_0xd1b1('0x46')](_0x2cc4f3[_0xd1b1('0x41')],qs[_0xd1b1('0x47')](_0x58819f[_0xd1b1('0x42')][_0xd1b1('0x47')]));_0x5e178b[_0xd1b1('0x45')]=_0x5e178b[_0xd1b1('0x45')]['length']?_0x5e178b[_0xd1b1('0x45')]:_0x2cc4f3[_0xd1b1('0x41')];if(!_0x58819f['query'][_0xd1b1('0x48')]('nolimit')){_0x5e178b[_0xd1b1('0x30')]=qs[_0xd1b1('0x30')](_0x58819f[_0xd1b1('0x42')]['limit']);_0x5e178b[_0xd1b1('0x2f')]=qs[_0xd1b1('0x2f')](_0x58819f[_0xd1b1('0x42')][_0xd1b1('0x2f')]);}_0x5e178b[_0xd1b1('0x49')]=qs['sort'](_0x58819f[_0xd1b1('0x42')][_0xd1b1('0x4a')]);_0x5e178b[_0xd1b1('0x4b')]=qs[_0xd1b1('0x44')](_[_0xd1b1('0x4c')](_0x58819f[_0xd1b1('0x42')],_0x2cc4f3[_0xd1b1('0x44')]),_0x5e5c47);if(_0x58819f[_0xd1b1('0x42')][_0xd1b1('0x4d')]){_0x5e178b[_0xd1b1('0x4b')]=_[_0xd1b1('0x4e')](_0x5e178b[_0xd1b1('0x4b')],{'$or':_['map'](_0x5e5c47,function(_0xe32e62){if(_0xe32e62[_0xd1b1('0x3f')]!==_0xd1b1('0x4f')){var _0x703f85={};_0x703f85[_0xe32e62['name']]={'$like':'%'+_0x58819f[_0xd1b1('0x42')][_0xd1b1('0x4d')]+'%'};return _0x703f85;}})});}_0x5e178b=_['merge']({},_0x5e178b,_0x58819f[_0xd1b1('0x50')]);var _0x45b585={'where':_0x5e178b[_0xd1b1('0x4b')]};return db['ChatWebsite'][_0xd1b1('0x2e')](_0x45b585)[_0xd1b1('0x20')](function(_0x144a9e){_0x15daac['count']=_0x144a9e;if(_0x58819f['query']['includeAll']){_0x5e178b[_0xd1b1('0x51')]=[{'all':!![]}];}return db[_0xd1b1('0x52')][_0xd1b1('0x53')](_0x5e178b);})['then'](function(_0x20b832){_0x15daac[_0xd1b1('0x54')]=_0x20b832;return _0x15daac;})['then'](respondWithFilteredResult(_0x3b230b,_0x5e178b))[_0xd1b1('0x2a')](handleError(_0x3b230b,null));};exports[_0xd1b1('0x55')]=function(_0x5ed22e,_0x103bf4){var _0x29a5f2={'raw':![],'where':{'id':_0x5ed22e[_0xd1b1('0x56')]['id']},'include':[{'model':db[_0xd1b1('0x3a')],'as':_0xd1b1('0x3b')}]},_0x1a3c75={};_0x1a3c75[_0xd1b1('0x41')]=_[_0xd1b1('0x43')](db['ChatWebsite'][_0xd1b1('0x3d')]);_0x1a3c75[_0xd1b1('0x42')]=_[_0xd1b1('0x43')](_0x5ed22e['query']);_0x1a3c75[_0xd1b1('0x44')]=_[_0xd1b1('0x46')](_0x1a3c75[_0xd1b1('0x41')],_0x1a3c75[_0xd1b1('0x42')]);_0x29a5f2[_0xd1b1('0x45')]=_[_0xd1b1('0x46')](_0x1a3c75[_0xd1b1('0x41')],qs[_0xd1b1('0x47')](_0x5ed22e[_0xd1b1('0x42')][_0xd1b1('0x47')]));_0x29a5f2[_0xd1b1('0x45')]=_0x29a5f2[_0xd1b1('0x45')]['length']?_0x29a5f2[_0xd1b1('0x45')]:_0x1a3c75[_0xd1b1('0x41')];if(_0x5ed22e['query'][_0xd1b1('0x57')]){_0x29a5f2[_0xd1b1('0x51')]=[{'all':!![]}];}_0x29a5f2=_['merge']({},_0x29a5f2,_0x5ed22e[_0xd1b1('0x50')]);return db[_0xd1b1('0x52')][_0xd1b1('0x58')](_0x29a5f2)[_0xd1b1('0x20')](handleEntityNotFound(_0x103bf4,null))[_0xd1b1('0x20')](respondWithResult(_0x103bf4,null))['catch'](handleError(_0x103bf4,null));};exports[_0xd1b1('0x59')]=function(_0x5d7590,_0x5cc76b){return db[_0xd1b1('0x52')][_0xd1b1('0x59')](_0x5d7590[_0xd1b1('0x5a')],{})[_0xd1b1('0x20')](function(_0x108c66){var _0x21a5fb=_0x5d7590[_0xd1b1('0x5b')][_0xd1b1('0x5c')]({'plain':!![]});if(!_0x21a5fb)throw new Error(_0xd1b1('0x5d'));if(_0x21a5fb['role']==='user'){var _0x40baf9=_0x108c66[_0xd1b1('0x5c')]({'plain':!![]});var _0x15a727='ChatWebsites';return db[_0xd1b1('0x5e')][_0xd1b1('0x58')]({'where':{'name':_0x15a727,'userProfileId':_0x21a5fb['userProfileId']},'raw':!![]})[_0xd1b1('0x20')](function(_0x3670d9){if(_0x3670d9&&_0x3670d9[_0xd1b1('0x5f')]===0x0){return db[_0xd1b1('0x37')]['create']({'name':_0x40baf9['name'],'resourceId':_0x40baf9['id'],'type':_0x3670d9[_0xd1b1('0x38')],'sectionId':_0x3670d9['id']},{})[_0xd1b1('0x20')](function(){return _0x108c66;});}else{return _0x108c66;}})['catch'](function(_0x242820){logger[_0xd1b1('0x27')](_0xd1b1('0x60'),_0x242820);throw _0x242820;});}return _0x108c66;})[_0xd1b1('0x20')](respondWithResult(_0x5cc76b,0xc9))['catch'](handleError(_0x5cc76b,null));};exports['update']=function(_0x392355,_0x2f90d2){if(_0x392355[_0xd1b1('0x5a')]['id']){delete _0x392355[_0xd1b1('0x5a')]['id'];}return db[_0xd1b1('0x52')][_0xd1b1('0x58')]({'where':{'id':_0x392355[_0xd1b1('0x56')]['id']},'include':[{'model':db[_0xd1b1('0x3a')],'as':_0xd1b1('0x3b')}]})[_0xd1b1('0x20')](handleEntityNotFound(_0x2f90d2,null))[_0xd1b1('0x20')](saveUpdates(_0x392355['body'],null))[_0xd1b1('0x20')](respondWithResult(_0x2f90d2,null))[_0xd1b1('0x2a')](handleError(_0x2f90d2,null));};exports['destroy']=function(_0x4effe2,_0x447796){return db[_0xd1b1('0x52')][_0xd1b1('0x58')]({'where':{'id':_0x4effe2[_0xd1b1('0x56')]['id']}})[_0xd1b1('0x20')](handleEntityNotFound(_0x447796,null))['then'](removeEntity(_0x447796,null))['catch'](handleError(_0x447796,null));};exports[_0xd1b1('0x61')]=function(_0x3a5d33,_0x37321e){return db['ChatWebsite'][_0xd1b1('0x61')]()[_0xd1b1('0x20')](respondWithResult(_0x37321e,null))[_0xd1b1('0x2a')](handleError(_0x37321e,null));};exports['addDisposition']=function(_0x331f2b,_0x27f318,_0x512a7a){if(_0x331f2b[_0xd1b1('0x5a')]['id']){delete _0x331f2b[_0xd1b1('0x5a')]['id'];}return db[_0xd1b1('0x52')]['find']({'where':{'id':_0x331f2b[_0xd1b1('0x56')]['id']}})['then'](handleEntityNotFound(_0x27f318,null))[_0xd1b1('0x20')](function(_0x359537){if(_0x359537){_0x331f2b['body'][_0xd1b1('0x62')]=_0x359537['id'];return db[_0xd1b1('0x63')]['create'](_0x331f2b[_0xd1b1('0x5a')]);}})[_0xd1b1('0x20')](respondWithResult(_0x27f318,null))['catch'](handleError(_0x27f318,null));};exports[_0xd1b1('0x64')]=function(_0x2f8f37,_0x10ab72,_0x6e042b){var _0x52f9cc={'raw':![],'where':{}};var _0xcd638e={};var _0x36605d={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x2f8f37[_0xd1b1('0x56')]['id']}})[_0xd1b1('0x20')](handleEntityNotFound(_0x10ab72,null))[_0xd1b1('0x20')](function(_0x97becc){if(_0x97becc){_0xcd638e[_0xd1b1('0x41')]=_['keys'](db[_0xd1b1('0x63')]['rawAttributes']);_0xcd638e[_0xd1b1('0x42')]=_['keys'](_0x2f8f37['query']);_0xcd638e['filters']=_[_0xd1b1('0x46')](_0xcd638e[_0xd1b1('0x41')],_0xcd638e[_0xd1b1('0x42')]);_0x52f9cc[_0xd1b1('0x45')]=_['intersection'](_0xcd638e['model'],qs[_0xd1b1('0x47')](_0x2f8f37['query']['fields']));_0x52f9cc[_0xd1b1('0x45')]=_0x52f9cc['attributes'][_0xd1b1('0x65')]?_0x52f9cc[_0xd1b1('0x45')]:_0xcd638e['model'];if(!_0x2f8f37['query'][_0xd1b1('0x48')](_0xd1b1('0x66'))){_0x52f9cc['limit']=qs[_0xd1b1('0x30')](_0x2f8f37[_0xd1b1('0x42')][_0xd1b1('0x30')]);_0x52f9cc['offset']=qs[_0xd1b1('0x2f')](_0x2f8f37[_0xd1b1('0x42')][_0xd1b1('0x2f')]);}_0x52f9cc['order']=qs[_0xd1b1('0x4a')](_0x2f8f37[_0xd1b1('0x42')][_0xd1b1('0x4a')]);_0x52f9cc[_0xd1b1('0x4b')]=qs['filters'](_['pick'](_0x2f8f37[_0xd1b1('0x42')],_0xcd638e['filters']));_0x52f9cc[_0xd1b1('0x4b')]['ChatWebsiteId']=_0x97becc['id'];if(_0x2f8f37['query']['filter']){_0x52f9cc['where']=_['merge'](_0x52f9cc[_0xd1b1('0x4b')],{'$or':_[_0xd1b1('0x3c')](_0x52f9cc[_0xd1b1('0x45')],function(_0x5d93f7){var _0x5f0df7={};_0x5f0df7[_0x5d93f7]={'$like':'%'+_0x2f8f37[_0xd1b1('0x42')][_0xd1b1('0x4d')]+'%'};return _0x5f0df7;})});}_0x52f9cc=_[_0xd1b1('0x4e')]({},_0x52f9cc,_0x2f8f37[_0xd1b1('0x50')]);return db['Disposition'][_0xd1b1('0x2e')]({'where':_0x52f9cc[_0xd1b1('0x4b')]})[_0xd1b1('0x20')](function(_0x37d23e){_0x36605d[_0xd1b1('0x2e')]=_0x37d23e;if(_0x2f8f37[_0xd1b1('0x42')][_0xd1b1('0x57')]){_0x52f9cc['include']=[{'all':!![]}];}return db[_0xd1b1('0x63')][_0xd1b1('0x53')](_0x52f9cc);})[_0xd1b1('0x20')](function(_0x303580){_0x36605d[_0xd1b1('0x54')]=_0x303580;return _0x36605d;});}})[_0xd1b1('0x20')](respondWithFilteredResult(_0x10ab72,_0x52f9cc))[_0xd1b1('0x2a')](handleError(_0x10ab72,null));};exports['removeDispositions']=function(_0x2bf041,_0x1306da,_0x507f1c){return db[_0xd1b1('0x52')][_0xd1b1('0x58')]({'where':{'id':_0x2bf041[_0xd1b1('0x56')]['id']}})[_0xd1b1('0x20')](handleEntityNotFound(_0x1306da,null))[_0xd1b1('0x20')](function(_0xbc2934){if(_0xbc2934){return _0xbc2934[_0xd1b1('0x67')](_0x2bf041[_0xd1b1('0x42')][_0xd1b1('0x68')]);}})[_0xd1b1('0x20')](respondWithStatusCode(_0x1306da,null))[_0xd1b1('0x2a')](handleError(_0x1306da,null));};exports[_0xd1b1('0x69')]=function(_0xd8c13d,_0x236846,_0x2279ae){if(_0xd8c13d[_0xd1b1('0x5a')]['id']){delete _0xd8c13d[_0xd1b1('0x5a')]['id'];}return db[_0xd1b1('0x52')][_0xd1b1('0x58')]({'where':{'id':_0xd8c13d[_0xd1b1('0x56')]['id']}})[_0xd1b1('0x20')](handleEntityNotFound(_0x236846,null))[_0xd1b1('0x20')](function(_0x5ed443){if(_0x5ed443){_0xd8c13d[_0xd1b1('0x5a')][_0xd1b1('0x62')]=_0x5ed443['id'];return db['CannedAnswer'][_0xd1b1('0x59')](_0xd8c13d['body']);}})[_0xd1b1('0x20')](respondWithResult(_0x236846,null))[_0xd1b1('0x2a')](handleError(_0x236846,null));};exports['getAnswers']=function(_0x2d964f,_0x6ce041,_0x29f2b6){var _0x574281={'raw':![],'where':{}};var _0x247ae8={};var _0x17d7c1={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xd1b1('0x6a')]({'where':{'id':_0x2d964f['params']['id']}})[_0xd1b1('0x20')](handleEntityNotFound(_0x6ce041,null))['then'](function(_0x169f8c){if(_0x169f8c){_0x247ae8['model']=_[_0xd1b1('0x43')](db[_0xd1b1('0x6b')][_0xd1b1('0x3d')]);_0x247ae8[_0xd1b1('0x42')]=_['keys'](_0x2d964f[_0xd1b1('0x42')]);_0x247ae8['filters']=_['intersection'](_0x247ae8[_0xd1b1('0x41')],_0x247ae8[_0xd1b1('0x42')]);_0x574281[_0xd1b1('0x45')]=_['intersection'](_0x247ae8[_0xd1b1('0x41')],qs['fields'](_0x2d964f[_0xd1b1('0x42')][_0xd1b1('0x47')]));_0x574281[_0xd1b1('0x45')]=_0x574281[_0xd1b1('0x45')][_0xd1b1('0x65')]?_0x574281['attributes']:_0x247ae8['model'];if(!_0x2d964f[_0xd1b1('0x42')]['hasOwnProperty'](_0xd1b1('0x66'))){_0x574281['limit']=qs[_0xd1b1('0x30')](_0x2d964f[_0xd1b1('0x42')][_0xd1b1('0x30')]);_0x574281[_0xd1b1('0x2f')]=qs['offset'](_0x2d964f[_0xd1b1('0x42')]['offset']);}_0x574281['order']=qs[_0xd1b1('0x4a')](_0x2d964f[_0xd1b1('0x42')][_0xd1b1('0x4a')]);_0x574281['where']=qs['filters'](_[_0xd1b1('0x4c')](_0x2d964f['query'],_0x247ae8[_0xd1b1('0x44')]));_0x574281['where'][_0xd1b1('0x62')]=_0x169f8c['id'];if(_0x2d964f[_0xd1b1('0x42')][_0xd1b1('0x4d')]){_0x574281['where']=_[_0xd1b1('0x4e')](_0x574281[_0xd1b1('0x4b')],{'$or':_[_0xd1b1('0x3c')](_0x574281['attributes'],function(_0x58bf90){var _0x99c455={};_0x99c455[_0x58bf90]={'$like':'%'+_0x2d964f[_0xd1b1('0x42')][_0xd1b1('0x4d')]+'%'};return _0x99c455;})});}_0x574281=_[_0xd1b1('0x4e')]({},_0x574281,_0x2d964f[_0xd1b1('0x50')]);return db[_0xd1b1('0x6b')][_0xd1b1('0x2e')]({'where':_0x574281['where']})[_0xd1b1('0x20')](function(_0x521850){_0x17d7c1[_0xd1b1('0x2e')]=_0x521850;if(_0x2d964f['query']['includeAll']){_0x574281[_0xd1b1('0x51')]=[{'all':!![]}];}return db[_0xd1b1('0x6b')][_0xd1b1('0x53')](_0x574281);})[_0xd1b1('0x20')](function(_0x321a68){_0x17d7c1[_0xd1b1('0x54')]=_0x321a68;return _0x17d7c1;});}})['then'](respondWithFilteredResult(_0x6ce041,_0x574281))[_0xd1b1('0x2a')](handleError(_0x6ce041,null));};exports[_0xd1b1('0x6c')]=function(_0x58a16a,_0xe5d586,_0xa6457a){return db[_0xd1b1('0x52')]['find']({'where':{'id':_0x58a16a[_0xd1b1('0x56')]['id']}})[_0xd1b1('0x20')](handleEntityNotFound(_0xe5d586,null))[_0xd1b1('0x20')](function(_0x170d8f){if(_0x170d8f){return _0x170d8f['removeAnswers'](_0x58a16a[_0xd1b1('0x42')][_0xd1b1('0x68')]);}})[_0xd1b1('0x20')](respondWithStatusCode(_0xe5d586,null))['catch'](handleError(_0xe5d586,null));};exports['addLogo']=function(_0x261694,_0x5e7a4f,_0x19834e){_0x261694[_0xd1b1('0x5a')][_0xd1b1('0x6d')]=_0x261694['file']['filename'];return db[_0xd1b1('0x52')][_0xd1b1('0x58')]({'where':{'id':_0x261694[_0xd1b1('0x56')]['id']}})[_0xd1b1('0x20')](handleEntityNotFound(_0x5e7a4f,null))[_0xd1b1('0x20')](saveUpdates(_0x261694[_0xd1b1('0x5a')],null))['then'](respondWithResult(_0x5e7a4f,null))[_0xd1b1('0x2a')](handleError(_0x5e7a4f,null));};exports[_0xd1b1('0x6e')]=function(_0x19c00d,_0x516815,_0x496fc0){_0x19c00d['body']['agentAvatar']=_0x19c00d[_0xd1b1('0x6f')][_0xd1b1('0x70')];return db['ChatWebsite'][_0xd1b1('0x58')]({'where':{'id':_0x19c00d[_0xd1b1('0x56')]['id']}})[_0xd1b1('0x20')](handleEntityNotFound(_0x516815,null))['then'](saveUpdates(_0x19c00d[_0xd1b1('0x5a')],null))[_0xd1b1('0x20')](respondWithResult(_0x516815,null))[_0xd1b1('0x2a')](handleError(_0x516815,null));};exports[_0xd1b1('0x71')]=function(_0x4a99e2,_0x5b6e66,_0x22aedd){_0x4a99e2['body'][_0xd1b1('0x72')]=_0x4a99e2[_0xd1b1('0x6f')][_0xd1b1('0x70')];return db[_0xd1b1('0x52')][_0xd1b1('0x58')]({'where':{'id':_0x4a99e2['params']['id']}})['then'](handleEntityNotFound(_0x5b6e66,null))[_0xd1b1('0x20')](saveUpdates(_0x4a99e2[_0xd1b1('0x5a')],null))['then'](respondWithResult(_0x5b6e66,null))[_0xd1b1('0x2a')](handleError(_0x5b6e66,null));};exports[_0xd1b1('0x73')]=function(_0x3157e7,_0x2de870,_0x14c941){_0x3157e7[_0xd1b1('0x5a')][_0xd1b1('0x74')]=_0x3157e7[_0xd1b1('0x6f')][_0xd1b1('0x70')];return db[_0xd1b1('0x52')][_0xd1b1('0x58')]({'where':{'id':_0x3157e7[_0xd1b1('0x56')]['id']}})[_0xd1b1('0x20')](handleEntityNotFound(_0x2de870,null))[_0xd1b1('0x20')](saveUpdates(_0x3157e7[_0xd1b1('0x5a')],null))[_0xd1b1('0x20')](respondWithResult(_0x2de870,null))[_0xd1b1('0x2a')](handleError(_0x2de870,null));};exports[_0xd1b1('0x75')]=function(_0x2e5639,_0x3d3c2f,_0x16d3ea){var _0x3fd62b=path[_0xd1b1('0x76')](config[_0xd1b1('0x77')],_0xd1b1('0x78'));var _0x1bb5b8={'where':{'id':_0x2e5639[_0xd1b1('0x56')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x5be29f=![];return require(_0xd1b1('0x15'))[_0xd1b1('0x79')]()[_0xd1b1('0x20')](function(_0x19552f){if(_0x19552f){_0x5be29f=_0x19552f[_0xd1b1('0x7a')];}})[_0xd1b1('0x20')](function(){return db[_0xd1b1('0x52')][_0xd1b1('0x58')](_0x1bb5b8);})[_0xd1b1('0x20')](handleEntityNotFound(_0x3d3c2f,null))[_0xd1b1('0x20')](function(_0x12e158){if(_0x12e158){if(!_['isNil'](_0x12e158['sitepic'])){if(fs['existsSync'](path[_0xd1b1('0x76')](config[_0xd1b1('0x77')],_0xd1b1('0x7b'),_0x12e158['sitepic']))&&_0x5be29f){_0x3fd62b=path['join'](config[_0xd1b1('0x77')],_0xd1b1('0x7b'),_0x12e158[_0xd1b1('0x6d')]);}}return _0x3d3c2f[_0xd1b1('0x7c')](_0x3fd62b);}})['catch'](handleError(_0x3d3c2f,null));};exports[_0xd1b1('0x7d')]=function(_0x33707c,_0x28856c,_0x2dc72f){var _0x36c655=path[_0xd1b1('0x76')](config[_0xd1b1('0x77')],_0xd1b1('0x7e'));var _0x4a3040={'where':{'id':_0x33707c['params']['id']},'attributes':['id',_0xd1b1('0x7f')],'raw':!![]};return db[_0xd1b1('0x52')][_0xd1b1('0x58')](_0x4a3040)[_0xd1b1('0x20')](handleEntityNotFound(_0x28856c,null))[_0xd1b1('0x20')](function(_0x280594){if(_0x280594){if(!_[_0xd1b1('0x80')](_0x280594[_0xd1b1('0x7f')])){if(fs[_0xd1b1('0x81')](path[_0xd1b1('0x76')](config[_0xd1b1('0x77')],'server/files/images/avatars/',_0x280594[_0xd1b1('0x7f')]))){_0x36c655=path[_0xd1b1('0x76')](config[_0xd1b1('0x77')],_0xd1b1('0x82'),_0x280594[_0xd1b1('0x7f')]);}}return _0x28856c[_0xd1b1('0x7c')](_0x36c655);}})[_0xd1b1('0x2a')](handleError(_0x28856c,null));};exports[_0xd1b1('0x83')]=function(_0x54608b,_0x2f1311,_0x46ad39){var _0xfcf20e=path[_0xd1b1('0x76')](config[_0xd1b1('0x77')],_0xd1b1('0x84'));var _0x3a9740={'where':{'id':_0x54608b[_0xd1b1('0x56')]['id']},'attributes':['id',_0xd1b1('0x72'),_0xd1b1('0x85')],'raw':!![]};return db[_0xd1b1('0x52')][_0xd1b1('0x58')](_0x3a9740)[_0xd1b1('0x20')](handleEntityNotFound(_0x2f1311,null))[_0xd1b1('0x20')](function(_0x5b15fb){if(_0x5b15fb){if(!_[_0xd1b1('0x80')](_0x5b15fb['customerAvatar'])){if(fs[_0xd1b1('0x81')](path[_0xd1b1('0x76')](config[_0xd1b1('0x77')],_0xd1b1('0x82'),_0x5b15fb[_0xd1b1('0x72')]))&&_0x5b15fb[_0xd1b1('0x85')]){_0xfcf20e=path[_0xd1b1('0x76')](config[_0xd1b1('0x77')],_0xd1b1('0x82'),_0x5b15fb['customerAvatar']);}}return _0x2f1311[_0xd1b1('0x7c')](_0xfcf20e);}})[_0xd1b1('0x2a')](handleError(_0x2f1311,null));};exports[_0xd1b1('0x86')]=function(_0x1e82a2,_0xd47e7,_0x31cfd3){var _0x184910=path[_0xd1b1('0x76')](config['root'],'server/files/images/avatars/system_avatar.png');var _0x3b0212={'where':{'id':_0x1e82a2[_0xd1b1('0x56')]['id']},'attributes':['id',_0xd1b1('0x74')],'raw':!![]};return db[_0xd1b1('0x52')][_0xd1b1('0x58')](_0x3b0212)[_0xd1b1('0x20')](handleEntityNotFound(_0xd47e7,null))[_0xd1b1('0x20')](function(_0x5232d6){if(_0x5232d6){if(!_[_0xd1b1('0x80')](_0x5232d6[_0xd1b1('0x74')])){if(fs[_0xd1b1('0x81')](path[_0xd1b1('0x76')](config[_0xd1b1('0x77')],_0xd1b1('0x82'),_0x5232d6[_0xd1b1('0x74')]))){_0x184910=path[_0xd1b1('0x76')](config[_0xd1b1('0x77')],_0xd1b1('0x82'),_0x5232d6['systemAvatar']);}}return _0xd47e7['download'](_0x184910);}})[_0xd1b1('0x2a')](handleError(_0xd47e7,null));};exports[_0xd1b1('0x87')]=function(_0x2fc0e9,_0x4569db,_0x441ee1){var _0xc8cec9=require(_0xd1b1('0x88'));var _0x3143f6=new _0xc8cec9();var _0x752f57=_0x3143f6[_0xd1b1('0x89')](_0x2fc0e9['headers'][_0xd1b1('0x8a')])[_0xd1b1('0x8b')]();var _0x2bf1a0={'body':_0x2fc0e9[_0xd1b1('0x5a')],'channel':'chat'};var _0x29672a=[];var _0x42cd8c=[];var _0x25c63f={};var _0x3136b9=![];return db[_0xd1b1('0x8c')][_0xd1b1('0x61')]()[_0xd1b1('0x20')](function(_0x2cb682){if(!_0x2cb682){throw new db['Sequelize']['ValidationError'](_0xd1b1('0x8d'));}_0x29672a=_['difference'](_['keys'](_0x2cb682),[_0xd1b1('0x8e'),_0xd1b1('0x8f')]);_0x42cd8c=_['difference'](_[_0xd1b1('0x43')](_0x2cb682),[_0xd1b1('0x8e'),_0xd1b1('0x8f'),'CompanyId',_0xd1b1('0x90')]);if(_0x2fc0e9[_0xd1b1('0x5a')]['id']){delete _0x2fc0e9['body']['id'];}if(_[_0xd1b1('0x80')](_0x2fc0e9['body'][_0xd1b1('0x91')])){throw new db[(_0xd1b1('0x92'))][(_0xd1b1('0x93'))](_0xd1b1('0x94'));}if(_[_0xd1b1('0x80')](_0x2fc0e9[_0xd1b1('0x5a')]['body'])||_0x2fc0e9[_0xd1b1('0x5a')][_0xd1b1('0x5a')]===''){throw new db[(_0xd1b1('0x92'))][(_0xd1b1('0x93'))](_0xd1b1('0x95'));}if(_[_0xd1b1('0x80')](_0x2fc0e9[_0xd1b1('0x5a')][_0xd1b1('0x96')])){throw new db[(_0xd1b1('0x92'))][(_0xd1b1('0x93'))](_0xd1b1('0x97')+_0x42cd8c);}if(!_[_0xd1b1('0x98')](_0x42cd8c,_0x2fc0e9[_0xd1b1('0x5a')]['mapKey'])){throw new db[(_0xd1b1('0x92'))][(_0xd1b1('0x93'))](_0xd1b1('0x99')+_0x42cd8c);}_0x25c63f[_0x2fc0e9[_0xd1b1('0x5a')][_0xd1b1('0x96')]]=_0x2fc0e9[_0xd1b1('0x5a')]['from'];})['then'](function(){return db[_0xd1b1('0x52')][_0xd1b1('0x58')]({'where':{'id':_0x2fc0e9[_0xd1b1('0x56')]['id']},'include':[{'model':db[_0xd1b1('0x9a')],'as':'List','include':[{'model':db[_0xd1b1('0x8c')],'as':_0xd1b1('0x9b'),'where':_0x25c63f,'limit':0x1,'order':[['updatedAt',_0xd1b1('0x9c')]]}]},{'model':db[_0xd1b1('0x9d')],'as':_0xd1b1('0x9e')}]});})[_0xd1b1('0x20')](handleEntityNotFound(_0x4569db,null))[_0xd1b1('0x20')](function(_0x278a88){if(_0x278a88&&_0x278a88[_0xd1b1('0x9f')]){_0x2bf1a0['account']=_0x278a88;_0x2bf1a0[_0xd1b1('0xa0')]=_0x278a88['Applications'];_0x2bf1a0[_0xd1b1('0xa1')]=_0x278a88[_0xd1b1('0x9f')];_0x2bf1a0[_0xd1b1('0xa0')]=_[_0xd1b1('0xa2')](_0x2bf1a0['applications'],[_0xd1b1('0xa3')],[_0xd1b1('0xa4')]);if(_0x2bf1a0[_0xd1b1('0xa5')]['Applications']){delete _0x2bf1a0[_0xd1b1('0xa5')][_0xd1b1('0x9e')];}if(_0x2bf1a0[_0xd1b1('0xa5')][_0xd1b1('0x9f')]&&_0x2bf1a0[_0xd1b1('0xa5')][_0xd1b1('0x9f')][_0xd1b1('0x9b')][_0xd1b1('0x65')]){return _0x2bf1a0['account']['List'][_0xd1b1('0x9b')][0x0];}var _0x37ca2a=_[_0xd1b1('0x18')](_0x2fc0e9[_0xd1b1('0x5a')],{'firstName':_0x2fc0e9[_0xd1b1('0x5a')][_0xd1b1('0x91')],'ListId':_0x278a88[_0xd1b1('0x90')]});_0x37ca2a[_0x2fc0e9['body'][_0xd1b1('0x96')]]=_0x2fc0e9['body'][_0xd1b1('0x91')];return db[_0xd1b1('0x8c')][_0xd1b1('0x59')](_0x37ca2a,{'fields':_0x29672a,'raw':!![]});}})[_0xd1b1('0x20')](handleEntityNotFound(_0x4569db,null))['then'](function(_0x4bdc65){_0x2bf1a0[_0xd1b1('0xa6')]=_0x4bdc65;var _0x5bd77b=_0x2fc0e9[_0xd1b1('0x5a')][_0xd1b1('0xa7')];if(_0x2fc0e9[_0xd1b1('0xa8')][_0xd1b1('0xa9')]){_0x5bd77b=_0x2fc0e9['headers'][_0xd1b1('0xa9')];}else if(_0x2fc0e9[_0xd1b1('0xa8')][_0xd1b1('0xaa')]){_0x5bd77b=_[_0xd1b1('0xab')](_0x2fc0e9[_0xd1b1('0xa8')][_0xd1b1('0xaa')][_0xd1b1('0xac')](','));}if(_0x4bdc65){var _0x3eed99={'ContactId':_0x4bdc65['id'],'ChatWebsiteId':_0x2fc0e9[_0xd1b1('0x56')]['id'],'from':(_0x4bdc65[_0xd1b1('0xad')]||'')+'\x20'+(_0x4bdc65[_0xd1b1('0xae')]||''),'customerIp':_0x5bd77b,'customerPort':_0x2fc0e9[_0xd1b1('0xa8')][_0xd1b1('0xaf')]?_0x2fc0e9['headers']['x-real-port']:null,'referer':_0x2fc0e9[_0xd1b1('0x5a')][_0xd1b1('0xb0')],'browserName':_0x752f57['browser']['name']&&_0x752f57['browser'][_0xd1b1('0xb1')]?util[_0xd1b1('0xb2')](_0xd1b1('0xb3'),_0x752f57[_0xd1b1('0xb4')][_0xd1b1('0x38')],_0x752f57[_0xd1b1('0xb4')][_0xd1b1('0xb1')]):_0xd1b1('0xb5'),'browserVersion':_0x752f57[_0xd1b1('0xb4')]['version']||'unknown','osName':util[_0xd1b1('0xb2')](_0xd1b1('0xb3'),_0x752f57['os'][_0xd1b1('0x38')],_0x752f57['os'][_0xd1b1('0xb1')]),'osVersion':_0x752f57['os'][_0xd1b1('0xb1')],'deviceModel':_0x752f57['device'][_0xd1b1('0x41')]&&_0x752f57[_0xd1b1('0xb6')]['vendor']?util[_0xd1b1('0xb2')](_0xd1b1('0xb7'),_0x752f57['device']['model'],_0x752f57[_0xd1b1('0xb6')]['vendor'],_0x752f57[_0xd1b1('0xb6')][_0xd1b1('0x3f')]):null,'deviceVendor':_0x752f57[_0xd1b1('0xb6')][_0xd1b1('0xb8')],'deviceType':_0x752f57[_0xd1b1('0xb6')][_0xd1b1('0x3f')],'formData':JSON[_0xd1b1('0x26')](_0x2fc0e9['body'])};var _0x2d17e8={'ChatWebsiteId':_0x2fc0e9[_0xd1b1('0x56')]['id'],'closed':![]};if(_0x2fc0e9['body'][_0xd1b1('0xb9')]){_0x2d17e8[_0xd1b1('0xb9')]=_0x2fc0e9[_0xd1b1('0x5a')]['threadId'];return db[_0xd1b1('0xba')][_0xd1b1('0x58')]({'where':_0x2d17e8})[_0xd1b1('0x20')](function(_0x152f9c){if(_0x152f9c){return[_0x152f9c,![]];}_0x3eed99[_0xd1b1('0xb9')]=_0x2fc0e9['body'][_0xd1b1('0xb9')];_0x3eed99[_0xd1b1('0xbb')]=_0x2fc0e9[_0xd1b1('0x5a')][_0xd1b1('0xbb')];return db[_0xd1b1('0xba')][_0xd1b1('0x59')](_0x3eed99)[_0xd1b1('0x20')](function(_0x22e116){return[_0x22e116,!![]];});});}_0x2d17e8[_0xd1b1('0xbc')]=_0x4bdc65['id'];if(_0x2fc0e9[_0xd1b1('0x5a')][_0xd1b1('0xbd')]&&_0x2fc0e9[_0xd1b1('0x5a')][_0xd1b1('0xbd')]['id']){_0x2d17e8['id']=_0x2fc0e9[_0xd1b1('0x5a')][_0xd1b1('0xbd')]['id'];return db[_0xd1b1('0xba')][_0xd1b1('0x58')]({'where':_0x2d17e8})[_0xd1b1('0x20')](function(_0x13bea8){if(_0x13bea8){return[_0x13bea8,![]];}return db[_0xd1b1('0xba')][_0xd1b1('0x59')](_0x3eed99)[_0xd1b1('0x20')](function(_0x3fe67d){return[_0x3fe67d,!![]];});});}return db[_0xd1b1('0xba')][_0xd1b1('0x59')](_0x3eed99)[_0xd1b1('0x20')](function(_0x33fbe0){return[_0x33fbe0,!![]];});}})[_0xd1b1('0xbe')](function(_0x2f2579,_0x127278){if(_0x2f2579){_0x3136b9=_0x127278;if(!_0x127278){var _0x7559c5={'from':(_0x2bf1a0[_0xd1b1('0xa6')][_0xd1b1('0xad')]||'')+'\x20'+(_0x2bf1a0[_0xd1b1('0xa6')]['lastName']||'')};if(_0x2fc0e9[_0xd1b1('0x5a')][_0xd1b1('0xb9')]&&_0x2fc0e9[_0xd1b1('0x5a')][_0xd1b1('0xbf')]&&_0x2fc0e9[_0xd1b1('0x5a')][_0xd1b1('0xb9')]!=_0x2fc0e9[_0xd1b1('0x5a')]['messageId']){_0x7559c5[_0xd1b1('0xb9')]=_0x2fc0e9[_0xd1b1('0x5a')][_0xd1b1('0xbf')];}return _0x2f2579['update'](_0x7559c5);}else{return _0x2f2579;}}})['then'](function(_0x42842f){_0x2bf1a0[_0xd1b1('0xbd')]=_0x42842f[_0xd1b1('0x5c')]({'plain':!![]});_0x2bf1a0['interaction']['created']=_0x3136b9;if(_0x2bf1a0[_0xd1b1('0xbd')][_0xd1b1('0xc0')]){if(_0x2bf1a0['account'][_0xd1b1('0xc1')]){_0x2bf1a0[_0xd1b1('0xa0')]['push']({'id':0x0,'priority':_0x2bf1a0[_0xd1b1('0xa0')][_0xd1b1('0x65')]+0x1,'app':_0xd1b1('0xc2'),'appdata':_0xd1b1('0xc3'),'interval':_0xd1b1('0xc4')});}}return db[_0xd1b1('0xc5')]['create']({'body':_0x2fc0e9[_0xd1b1('0x5a')]['body'],'ChatWebsiteId':_0x2fc0e9[_0xd1b1('0x56')]['id'],'ChatInteractionId':_0x42842f['id'],'direction':'in','ContactId':_0x2bf1a0['contact']['id'],'AttachmentId':_0x2fc0e9[_0xd1b1('0x5a')][_0xd1b1('0xc6')]});})[_0xd1b1('0x20')](function(_0x3aa1bb){_0x2bf1a0['message']=_0x3aa1bb;if(_0x2bf1a0[_0xd1b1('0xbd')][_0xd1b1('0xc7')]){return db['User'][_0xd1b1('0x58')]({'attributes':['id',_0xd1b1('0x38')],'where':{'id':_0x2bf1a0[_0xd1b1('0xbd')][_0xd1b1('0xc7')]}})[_0xd1b1('0x20')](function(_0x29f148){if(_0x29f148){_0x2bf1a0[_0xd1b1('0xa0')][_0xd1b1('0xc8')]({'id':0x0,'priority':0x0,'app':_0xd1b1('0xc9'),'appdata':_0x29f148['name']+','+(_0x2bf1a0[_0xd1b1('0xa5')][_0xd1b1('0xca')]||0xa),'interval':_0xd1b1('0xc4')});_0x2bf1a0[_0xd1b1('0xcb')]=!![];}return respondWithRpcPromise(_0xd1b1('0xcc'),_0xd1b1('0xcd'),_0x2bf1a0);});}return respondWithRpcPromise('Start','startRouting',_0x2bf1a0);})[_0xd1b1('0x20')](function(_0x2e6b3a){respondWithRpcPromise(_0xd1b1('0xce'),_0xd1b1('0xce'),{'event':_0xd1b1('0x87'),'message':_0x2e6b3a},client9002);return _0x2e6b3a;})[_0xd1b1('0x20')](respondWithResult(_0x4569db,null))[_0xd1b1('0x2a')](handleError(_0x4569db,null));};exports[_0xd1b1('0xcf')]=function(_0x3be591,_0x56759d,_0x2f4823){var _0x55dd03,_0x32dc7c,_0x11de27;var _0x1124d3=[];var _0x4aff4f=[];var _0x6351f={};var _0x318ee7=_0x3be591[_0xd1b1('0xd0')]||[];return db[_0xd1b1('0x8c')][_0xd1b1('0x61')]()[_0xd1b1('0x20')](function(_0x2a1c4b){if(!_0x2a1c4b){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x4aff4f=_['difference'](_['keys'](_0x2a1c4b),[_0xd1b1('0x8e'),_0xd1b1('0x8f')]);_0x1124d3=_[_0xd1b1('0xd1')](_[_0xd1b1('0x43')](_0x2a1c4b),[_0xd1b1('0x8e'),_0xd1b1('0x8f'),'CompanyId',_0xd1b1('0x90')]);if(_0x3be591[_0xd1b1('0x5a')]['id']){delete _0x3be591['body']['id'];}if(_[_0xd1b1('0x80')](_0x3be591[_0xd1b1('0x5a')][_0xd1b1('0x91')])||_[_0xd1b1('0x80')](_0x3be591[_0xd1b1('0x5a')]['body'][_0xd1b1('0xd2')])){throw _0x56759d[_0xd1b1('0x2c')](0x1f4)[_0xd1b1('0x39')](new db[(_0xd1b1('0x92'))][(_0xd1b1('0x93'))](_0xd1b1('0x94')));}if(_[_0xd1b1('0x80')](_0x3be591[_0xd1b1('0x5a')]['body'])||_0x3be591[_0xd1b1('0x5a')][_0xd1b1('0x5a')]===''||(_[_0xd1b1('0x80')](_0x3be591[_0xd1b1('0x5a')][_0xd1b1('0x5a')][_0xd1b1('0xd3')])||_0x3be591[_0xd1b1('0x5a')][_0xd1b1('0x5a')][_0xd1b1('0xd3')]==='')){throw _0x56759d[_0xd1b1('0x2c')](0x1f4)[_0xd1b1('0x39')](new db[(_0xd1b1('0x92'))][(_0xd1b1('0x93'))](_0xd1b1('0x95')));}if(_[_0xd1b1('0x80')](_0x3be591[_0xd1b1('0x5a')]['mapKeyOffline'])){throw _0x56759d[_0xd1b1('0x2c')](0x1f4)[_0xd1b1('0x39')](new db[(_0xd1b1('0x92'))][(_0xd1b1('0x93'))](_0xd1b1('0xd4')+_0x1124d3));}if(!_['includes'](_0x1124d3,_0x3be591[_0xd1b1('0x5a')][_0xd1b1('0xd5')])){throw _0x56759d['status'](0x1f4)[_0xd1b1('0x39')](new db[(_0xd1b1('0x92'))][(_0xd1b1('0x93'))](_0xd1b1('0xd6')+_0x1124d3));}_0x6351f[_0x3be591['body'][_0xd1b1('0xd5')]]=_0x3be591['body'][_0xd1b1('0x91')];})[_0xd1b1('0x20')](function(){return db[_0xd1b1('0x52')][_0xd1b1('0x58')]({'where':{'id':_0x3be591[_0xd1b1('0x56')]['id']},'include':[{'model':db[_0xd1b1('0x9a')],'as':_0xd1b1('0x9f')},{'model':db[_0xd1b1('0xd7')],'as':'MailAccount'}]});})[_0xd1b1('0x20')](handleEntityNotFound(_0x56759d,null))[_0xd1b1('0x20')](function(_0x39ef1f){if(_0x39ef1f&&_0x39ef1f['List']){_0x32dc7c=_0x39ef1f;var _0xdaeb58=_[_0xd1b1('0x18')](_0x3be591[_0xd1b1('0x5a')],{'firstName':_0x3be591[_0xd1b1('0x5a')][_0xd1b1('0x91')],'phone':_0x3be591[_0xd1b1('0x5a')][_0xd1b1('0x91')],'ListId':_0x39ef1f[_0xd1b1('0x90')]});_0xdaeb58[_0x3be591[_0xd1b1('0x5a')][_0xd1b1('0xd5')]]=_0x3be591[_0xd1b1('0x5a')][_0xd1b1('0x91')];return db[_0xd1b1('0x8c')][_0xd1b1('0xd8')]({'where':_0x6351f,'defaults':_0xdaeb58});}})[_0xd1b1('0xbe')](function(_0x1337b0){if(_0x1337b0){_0x11de27=_0x1337b0;var _0x1c816e=fs[_0xd1b1('0xd9')](path['join'](config[_0xd1b1('0x77')],_0xd1b1('0xda')),_0xd1b1('0xdb'));var _0xaa71ff=ejs[_0xd1b1('0xdc')](_0x1c816e,{'body':_[_0xd1b1('0xdd')](_0x3be591[_0xd1b1('0x5a')][_0xd1b1('0x5a')]),'bodyTitle':_0x32dc7c[_0xd1b1('0xde')]});return db['ChatOfflineMessage'][_0xd1b1('0x59')]({'body':_0xaa71ff,'ContactId':_0x1337b0['id'],'ChatWebsiteId':_0x32dc7c['id']});}})[_0xd1b1('0x20')](function(_0x2ddcce){if(!_[_0xd1b1('0x80')](_0x3be591[_0xd1b1('0xd0')])){var _0x2ebdb6=_0x318ee7['map'](function(_0x402dcb){return{'name':_0x402dcb['originalname'],'basename':_0x402dcb['filename'],'type':_0x402dcb[_0xd1b1('0xdf')],'ChatOfflineMessageId':_0x2ddcce['id']};});db[_0xd1b1('0xe0')]['bulkCreate'](_0x2ebdb6)[_0xd1b1('0xe1')];}return _0x2ddcce;})[_0xd1b1('0x20')](function(_0x9edfea){if(_0x9edfea){_0x55dd03=_0x9edfea;return db[_0xd1b1('0xd7')][_0xd1b1('0x6a')]({'where':{'service':!![]},'include':[{'model':db[_0xd1b1('0xe2')],'as':_0xd1b1('0xe3'),'raw':!![]}]});}})[_0xd1b1('0x20')](function(_0x55de30){if(_0x55de30&&_0x55de30['Smtp']&&_0x32dc7c[_0xd1b1('0xe4')]&&_0x32dc7c[_0xd1b1('0xe5')]){var _0x20a459={'tls':{'rejectUnauthorized':![]}};if(_0x55de30[_0xd1b1('0xe3')]['service']){_0x20a459[_0xd1b1('0xe6')]=_0x55de30[_0xd1b1('0xe3')][_0xd1b1('0xe6')];}else{_0x20a459['host']=_0x55de30[_0xd1b1('0xe3')][_0xd1b1('0xe7')];_0x20a459[_0xd1b1('0xe8')]=_0x55de30[_0xd1b1('0xe3')][_0xd1b1('0xe8')];_0x20a459['secure']=_0x55de30[_0xd1b1('0xe3')][_0xd1b1('0xe9')];}if(_0x55de30[_0xd1b1('0xe3')][_0xd1b1('0xea')]){_0x20a459[_0xd1b1('0xeb')]={'user':_0x55de30[_0xd1b1('0xe3')][_0xd1b1('0x5b')],'pass':_0x55de30['Smtp'][_0xd1b1('0xec')]};}return respondWithRpcPromise(_0xd1b1('0xed'),'sendMail',{'account':_0x20a459,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x55de30[_0xd1b1('0x38')],_0x55de30['email']||_0x55de30[_0xd1b1('0xe3')][_0xd1b1('0x5b')]),'to':_0x32dc7c[_0xd1b1('0xe5')],'subject':_0x32dc7c[_0xd1b1('0xee')],'text':_0x55dd03['body'],'attachments':!_[_0xd1b1('0x80')](_0x3be591[_0xd1b1('0xd0')])?_0x318ee7:[]}},client9003)[_0xd1b1('0x20')](function(){return _0x55dd03;})[_0xd1b1('0x2a')](function(_0x513279){console['error'](_0x513279);});}})[_0xd1b1('0x20')](function(){if(_0x32dc7c&&_0x32dc7c['openNewInteraction']&&_0x32dc7c[_0xd1b1('0xef')]){var _0x5be1bc={'from':_0x11de27[_0xd1b1('0xd2')],'firstName':_0x11de27[_0xd1b1('0xad')],'lastName':_0x11de27[_0xd1b1('0xae')],'mapKey':_0xd1b1('0xd2'),'message':{'from':_0x11de27[_0xd1b1('0xd2')],'to':_0x32dc7c[_0xd1b1('0xd7')]['email'],'cc':'','subject':_0x32dc7c[_0xd1b1('0xee')],'messageId':'','sentAt':new Date(),'attach':!_['isNil'](_0x3be591[_0xd1b1('0xd0')]),'attachments':!_[_0xd1b1('0x80')](_0x3be591[_0xd1b1('0xd0')])?_0x318ee7:[],'originChannel':_0xd1b1('0xf0'),'ChatWebsiteId':_0x32dc7c['id'],'ChatOfflineMessageId':_0x55dd03['id'],'originTo':_0x32dc7c[_0xd1b1('0xd7')][_0xd1b1('0xd2')]},'body':_0x55dd03[_0xd1b1('0x5a')]};var _0x1995db={'account':{'id':_0x32dc7c['MailAccountId']},'body':_0x5be1bc,'log':_0xd1b1('0xf1')};return respondWithRpcPromise(_0xd1b1('0xf1'),_0xd1b1('0xf2'),_0x1995db,client9001)['then'](function(){return _0x55dd03;})['catch'](function(_0xc1ba59){console[_0xd1b1('0x27')](_0xc1ba59);});}return;})[_0xd1b1('0x20')](function(){if(_0x55dd03){return _0x55dd03;}})[_0xd1b1('0x20')](respondWithResult(_0x56759d,null))['catch'](function(_0x3e9888){console[_0xd1b1('0x27')](_0xd1b1('0x2a'),_0x3e9888);for(var _0x3edac8 of _0x318ee7){var _0x4e15f8=path['join'](config[_0xd1b1('0x77')],_0xd1b1('0xd0'),'attachments',_0xd1b1('0xf3'),_0x3edac8[_0xd1b1('0x70')]);fs_extra[_0xd1b1('0xf4')](_0x4e15f8)[_0xd1b1('0x2a')](function(_0x67d8e){console[_0xd1b1('0x27')]('Could\x20not\x20remove\x20attachment\x20file',_0x4e15f8,_0x67d8e);});}});};exports['addInteraction']=function(_0xec64b1,_0x25e5a4,_0x4fc7e7){return db[_0xd1b1('0xba')][_0xd1b1('0x58')]({'where':{'id':_0xec64b1[_0xd1b1('0x56')]['id']}})[_0xd1b1('0x20')](handleEntityNotFound(_0x25e5a4,null))[_0xd1b1('0x20')](function(_0x3c436d){if(_0x3c436d){return _0x3c436d[_0xd1b1('0xf5')](_0xec64b1[_0xd1b1('0x5a')][_0xd1b1('0x68')],_[_0xd1b1('0xf6')](_0xec64b1[_0xd1b1('0x5a')],[_0xd1b1('0x68'),'id'])||{});}})[_0xd1b1('0x20')](respondWithResult(_0x25e5a4,null))['catch'](handleError(_0x25e5a4,null));};exports['getInteractions']=function(_0xca6184,_0xc4cf08,_0x57ea9c){var _0x2e9869={'raw':![],'where':{}};var _0x337672={};var _0x2f285b={'count':0x0,'rows':[]};return db[_0xd1b1('0x52')]['findOne']({'where':{'id':_0xca6184[_0xd1b1('0x56')]['id']}})[_0xd1b1('0x20')](handleEntityNotFound(_0xc4cf08,null))[_0xd1b1('0x20')](function(_0x229647){if(_0x229647){_0x337672['model']=_['keys'](db[_0xd1b1('0xba')][_0xd1b1('0x3d')]);_0x337672[_0xd1b1('0x42')]=_['keys'](_0xca6184[_0xd1b1('0x42')]);_0x337672['filters']=_[_0xd1b1('0x46')](_0x337672[_0xd1b1('0x41')],_0x337672[_0xd1b1('0x42')]);_0x2e9869['attributes']=_[_0xd1b1('0x46')](_0x337672[_0xd1b1('0x41')],qs[_0xd1b1('0x47')](_0xca6184[_0xd1b1('0x42')][_0xd1b1('0x47')]));_0x2e9869['attributes']=_0x2e9869[_0xd1b1('0x45')][_0xd1b1('0x65')]?_0x2e9869['attributes']:_0x337672[_0xd1b1('0x41')];if(!_0xca6184[_0xd1b1('0x42')]['hasOwnProperty']('nolimit')){_0x2e9869[_0xd1b1('0x30')]=qs[_0xd1b1('0x30')](_0xca6184[_0xd1b1('0x42')][_0xd1b1('0x30')]);_0x2e9869[_0xd1b1('0x2f')]=qs['offset'](_0xca6184[_0xd1b1('0x42')][_0xd1b1('0x2f')]);}_0x2e9869[_0xd1b1('0x49')]=qs[_0xd1b1('0x4a')](_0xca6184[_0xd1b1('0x42')]['sort']);_0x2e9869[_0xd1b1('0x4b')]=qs[_0xd1b1('0x44')](_[_0xd1b1('0x4c')](_0xca6184['query'],_0x337672[_0xd1b1('0x44')]));_0x2e9869[_0xd1b1('0x4b')]['ChatWebsiteId']=_0x229647['id'];if(_0xca6184[_0xd1b1('0x42')][_0xd1b1('0x4d')]){_0x2e9869[_0xd1b1('0x4b')]=_[_0xd1b1('0x4e')](_0x2e9869['where'],{'$or':_[_0xd1b1('0x3c')](_0x2e9869[_0xd1b1('0x45')],function(_0x2fb62c){var _0x25f3d9={};_0x25f3d9[_0x2fb62c]={'$like':'%'+_0xca6184['query']['filter']+'%'};return _0x25f3d9;})});}_0x2e9869=_[_0xd1b1('0x4e')]({},_0x2e9869,_0xca6184[_0xd1b1('0x50')]);return db['ChatInteraction'][_0xd1b1('0x2e')]({'where':_0x2e9869['where']})[_0xd1b1('0x20')](function(_0x2c134c){_0x2f285b[_0xd1b1('0x2e')]=_0x2c134c;if(_0xca6184[_0xd1b1('0x42')]['includeAll']){_0x2e9869[_0xd1b1('0x51')]=[{'model':db[_0xd1b1('0x8c')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xd1b1('0xf7'),'attributes':[_0xd1b1('0x38'),_0xd1b1('0xf8'),_0xd1b1('0xf9')],'required':![]},{'model':db[_0xd1b1('0xfa')],'as':'Tags','attributes':['id',_0xd1b1('0x38'),_0xd1b1('0xfb')],'where':_0xca6184[_0xd1b1('0x42')][_0xd1b1('0xfc')]?{'id':_0xca6184[_0xd1b1('0x42')]['tag']}:undefined,'required':_0xca6184[_0xd1b1('0x42')][_0xd1b1('0xfc')]?!![]:![]}];}return db[_0xd1b1('0xba')][_0xd1b1('0x53')](_0x2e9869);})[_0xd1b1('0x20')](function(_0x269536){_0x2f285b[_0xd1b1('0x54')]=_0x269536;return _0x2f285b;});}})[_0xd1b1('0x20')](respondWithFilteredResult(_0xc4cf08,_0x2e9869))[_0xd1b1('0x2a')](handleError(_0xc4cf08,null));};function iftimePromise(_0x4edcc5,_0x355cca){return respondWithRpcPromise('Command','getSnippet',{'command':_0x355cca[_0xd1b1('0xfd')]?util[_0xd1b1('0xb2')]('iftime\x20%s,%s',_0x4edcc5['interval'],_0x355cca['timezone']):util[_0xd1b1('0xb2')](_0xd1b1('0xfe'),_0x4edcc5[_0xd1b1('0xff')])},client9002)['then'](function(_0x471411){var _0x353617=_0x471411&&_0x471411[_0xd1b1('0x100')](_0xd1b1('0x101'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x355cca['id'],_0x4edcc5['id'],_0x4edcc5['interval'],_0x353617?_0xd1b1('0x102'):_0xd1b1('0x103'),_0x355cca['timezone']?_0x355cca['timezone']:'No\x20timezone');return _0x353617;})[_0xd1b1('0x2a')](function(_0x4aaf65){logger[_0xd1b1('0x27')](_0xd1b1('0x104'),_0x355cca['id'],_0x4edcc5['id'],_0x4edcc5['interval'],util[_0xd1b1('0x105')](_0x4aaf65,{'showHidden':![],'depth':null}),_0x355cca['timezone']?_0x355cca['timezone']:_0xd1b1('0x106'));return![];});}exports['getSnippet']=function(_0x1ed091,_0x2912c2,_0x44ae26){var _0x20abcb=0x0;var _0x3e8e4b=0x0;var _0x2347bd=![];var _0x150ecc;var _0x5cb4dd;return db['ChatWebsite'][_0xd1b1('0x58')]({'where':{'id':_0x1ed091[_0xd1b1('0x56')]['id']},'include':[{'model':db['Interval'],'as':_0xd1b1('0x107'),'include':[{'model':db['Interval'],'as':_0xd1b1('0x108'),'attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x2912c2,null))['then'](function(_0x4d4a8b){if(_0x4d4a8b){_0x150ecc=_0x4d4a8b;return _0x4d4a8b[_0xd1b1('0x109')]({'raw':!![]});}})[_0xd1b1('0x20')](function(_0x286d8d){if(_0x150ecc){if(_0x286d8d){_0x5cb4dd=_0x286d8d;}}return require(_0xd1b1('0x15'))[_0xd1b1('0x79')]();})[_0xd1b1('0x20')](function(_0x4f2dc7){if(_0x4f2dc7){_0x3e8e4b=_0x4f2dc7[_0xd1b1('0x10a')];_0x2347bd=_0x4f2dc7[_0xd1b1('0x7a')];}})['then'](function(){return db['ChatInteraction'][_0xd1b1('0x2e')]({'where':{'closed':![]}});})[_0xd1b1('0x20')](function(_0x2544e7){_0x20abcb=_0x2544e7;if(_0x3e8e4b&&_0x2544e7>_0x3e8e4b){return db['License'][_0xd1b1('0x6a')]({'where':{'id':0x1}})['then'](function(_0x22822b){if(_0x22822b){_0x22822b['increment'](_0xd1b1('0x10b'));}});}})[_0xd1b1('0x20')](function(){if(_0x150ecc[_0xd1b1('0x107')]&&_0x150ecc[_0xd1b1('0x107')][_0xd1b1('0x108')]){var _0x5a8f6c=[];for(var _0x573826=0x0;_0x573826<_0x150ecc[_0xd1b1('0x107')][_0xd1b1('0x108')][_0xd1b1('0x65')];_0x573826++){var _0x228f17=_0x150ecc[_0xd1b1('0x107')][_0xd1b1('0x108')][_0x573826][_0xd1b1('0x5c')]({'plain':!![]});_0x5a8f6c['push'](iftimePromise(_0x228f17,_0x150ecc));}return BPromise[_0xd1b1('0x10c')](_0x5a8f6c)[_0xd1b1('0x20')](function(_0x145824){return _[_0xd1b1('0x10d')](_0x145824);});}else{return!![];}})[_0xd1b1('0x20')](function(_0x65c46e){var _0x48f23a=fs[_0xd1b1('0xd9')](path['join'](config[_0xd1b1('0x77')],'server/files/chat/iframe.js'),_0xd1b1('0xdb'));var _0x5289dc={'remote':_0x150ecc[_0xd1b1('0x10e')],'query':querystring[_0xd1b1('0x26')](_['merge'](_0x150ecc['get']({'plain':!![]}),{'customerIp':_0x1ed091[_0xd1b1('0xa8')][_0xd1b1('0xaa')]||_0x1ed091[_0xd1b1('0xa8')]['x-real-ip']||_0x1ed091[_0xd1b1('0x10f')]['remoteAddress']||_0x1ed091['ip'],'referer':_0x1ed091['headers'][_0xd1b1('0xb0')],'openedInteractions':_0x20abcb,'maxInteractions':_0x3e8e4b,'virtual':_0x2347bd['virtual'],'online':_0x65c46e,'custom':_0x2347bd}))[_0xd1b1('0x110')](/'/g,'\x5c\x27')};_0x2912c2['send'](ejs[_0xd1b1('0xdc')](Mustache[_0xd1b1('0xdc')](_0x48f23a,_0x5289dc),{'proactiveActions':_0x5cb4dd,'alignment':_0x150ecc[_0xd1b1('0x111')],'verticalAlignment':_0x150ecc[_0xd1b1('0x112')],'div_color':_0x150ecc[_0xd1b1('0xfb')],'text_color':_0x150ecc[_0xd1b1('0x113')],'button_color':_0x150ecc['color_button'],'background_color':_0x150ecc[_0xd1b1('0x114')]}));})['catch'](handleError(_0x2912c2,null));};exports[_0xd1b1('0x115')]=function(_0x2c8abf,_0x47bab8,_0x15cb14){return db[_0xd1b1('0x52')][_0xd1b1('0x6a')]({'where':{'id':_0x2c8abf[_0xd1b1('0x56')]['id']}})[_0xd1b1('0x20')](handleEntityNotFound(_0x47bab8,null))['then'](function(_0xa5e34e){if(_0xa5e34e){return db[_0xd1b1('0x116')][_0xd1b1('0x117')](function(_0x288ecd){return db[_0xd1b1('0x9d')]['destroy']({'where':{'ChatWebsiteId':_0x2c8abf[_0xd1b1('0x56')]['id']},'transaction':_0x288ecd})['then'](function(_0x167937){var _0x4b3a86=_[_0xd1b1('0x3c')](_0x2c8abf[_0xd1b1('0x5a')],function(_0xf4c058){_0xf4c058[_0xd1b1('0x62')]=_0x2c8abf[_0xd1b1('0x56')]['id'];return _0xf4c058;});return db['ChatApplication'][_0xd1b1('0x118')](_0x4b3a86,{'transaction':_0x288ecd});});})['then'](function(){return db['ChatApplication'][_0xd1b1('0x119')]({'where':{'ChatWebsiteId':_0x2c8abf[_0xd1b1('0x56')]['id']},'order':_0xd1b1('0xa3')});});}})['then'](respondWithResult(_0x47bab8,null))[_0xd1b1('0x2a')](handleError(_0x47bab8,null));};exports[_0xd1b1('0x11a')]=function(_0x1783b3,_0x46a7f2,_0x486a4b){var _0x3d8e5d={};var _0x34918b={};var _0x22b518;var _0x2029f8;return db[_0xd1b1('0x52')][_0xd1b1('0x6a')]({'where':{'id':_0x1783b3['params']['id']}})['then'](handleEntityNotFound(_0x46a7f2,null))[_0xd1b1('0x20')](function(_0x99f13b){if(_0x99f13b){_0x22b518=_0x99f13b;_0x34918b[_0xd1b1('0x41')]=_[_0xd1b1('0x43')](db[_0xd1b1('0x9d')][_0xd1b1('0x3d')]);_0x34918b['query']=_[_0xd1b1('0x43')](_0x1783b3[_0xd1b1('0x42')]);_0x34918b[_0xd1b1('0x44')]=_[_0xd1b1('0x46')](_0x34918b[_0xd1b1('0x41')],_0x34918b[_0xd1b1('0x42')]);_0x3d8e5d[_0xd1b1('0x45')]=_['intersection'](_0x34918b['model'],qs[_0xd1b1('0x47')](_0x1783b3['query']['fields']));_0x3d8e5d[_0xd1b1('0x45')]=_0x3d8e5d[_0xd1b1('0x45')][_0xd1b1('0x65')]?_0x3d8e5d['attributes']:_0x34918b[_0xd1b1('0x41')];_0x3d8e5d[_0xd1b1('0x49')]=qs[_0xd1b1('0x4a')](_0x1783b3[_0xd1b1('0x42')][_0xd1b1('0x4a')]);_0x3d8e5d[_0xd1b1('0x4b')]=qs[_0xd1b1('0x44')](_[_0xd1b1('0x4c')](_0x1783b3[_0xd1b1('0x42')],_0x34918b[_0xd1b1('0x44')]));if(_0x1783b3[_0xd1b1('0x42')]['filter']){_0x3d8e5d[_0xd1b1('0x4b')]=_[_0xd1b1('0x4e')](_0x3d8e5d[_0xd1b1('0x4b')],{'$or':_[_0xd1b1('0x3c')](_0x3d8e5d['attributes'],function(_0x1005d7){var _0xff7cfa={};_0xff7cfa[_0x1005d7]={'$like':'%'+_0x1783b3['query']['filter']+'%'};return _0xff7cfa;})});}_0x3d8e5d=_[_0xd1b1('0x4e')]({},_0x3d8e5d,_0x1783b3[_0xd1b1('0x50')]);return _0x22b518['getApplications'](_0x3d8e5d);}})[_0xd1b1('0x20')](function(_0x4fb1b5){if(_0x4fb1b5){_0x2029f8=_0x4fb1b5[_0xd1b1('0x65')];if(!_0x1783b3['query'][_0xd1b1('0x48')]('nolimit')){_0x3d8e5d[_0xd1b1('0x30')]=qs['limit'](_0x1783b3['query'][_0xd1b1('0x30')]);_0x3d8e5d[_0xd1b1('0x2f')]=qs[_0xd1b1('0x2f')](_0x1783b3[_0xd1b1('0x42')][_0xd1b1('0x2f')]);}return _0x22b518[_0xd1b1('0x11a')](_0x3d8e5d);}})[_0xd1b1('0x20')](function(_0x46054a){if(_0x46054a){return _0x46054a?{'count':_0x2029f8,'rows':_0x46054a}:null;}})['then'](respondWithResult(_0x46a7f2,null))['catch'](handleError(_0x46a7f2,null));};exports[_0xd1b1('0x11b')]=function(_0x2bcfb2,_0x3b0178,_0x30f0ba){return db[_0xd1b1('0x11c')][_0xd1b1('0x58')]({'where':{'id':_0x2bcfb2[_0xd1b1('0x56')]['id']}})[_0xd1b1('0x20')](handleEntityNotFound(_0x3b0178,null))[_0xd1b1('0x20')](function(_0x3c596a){if(_0x3c596a){return _0x3c596a[_0xd1b1('0x11b')](_0x2bcfb2[_0xd1b1('0x5a')]['ids'],_[_0xd1b1('0xf6')](_0x2bcfb2[_0xd1b1('0x5a')],['ids','id'])||{});}})[_0xd1b1('0x20')](respondWithResult(_0x3b0178,null))[_0xd1b1('0x2a')](handleError(_0x3b0178,null));};exports[_0xd1b1('0x109')]=function(_0x488c59,_0x59d507,_0xc3f2f0){var _0x17ef0a={};var _0xdcc113={};var _0x3fa7e9;var _0xcf991e;return db[_0xd1b1('0x52')][_0xd1b1('0x6a')]({'where':{'id':_0x488c59['params']['id']}})['then'](handleEntityNotFound(_0x59d507,null))[_0xd1b1('0x20')](function(_0x11e5a9){if(_0x11e5a9){_0x3fa7e9=_0x11e5a9;_0xdcc113[_0xd1b1('0x41')]=_[_0xd1b1('0x43')](db[_0xd1b1('0x11d')][_0xd1b1('0x3d')]);_0xdcc113['query']=_[_0xd1b1('0x43')](_0x488c59[_0xd1b1('0x42')]);_0xdcc113['filters']=_['intersection'](_0xdcc113[_0xd1b1('0x41')],_0xdcc113[_0xd1b1('0x42')]);_0x17ef0a['attributes']=_[_0xd1b1('0x46')](_0xdcc113[_0xd1b1('0x41')],qs['fields'](_0x488c59['query'][_0xd1b1('0x47')]));_0x17ef0a[_0xd1b1('0x45')]=_0x17ef0a['attributes'][_0xd1b1('0x65')]?_0x17ef0a['attributes']:_0xdcc113[_0xd1b1('0x41')];_0x17ef0a[_0xd1b1('0x49')]=qs[_0xd1b1('0x4a')](_0x488c59[_0xd1b1('0x42')]['sort']);_0x17ef0a['where']=qs['filters'](_[_0xd1b1('0x4c')](_0x488c59[_0xd1b1('0x42')],_0xdcc113[_0xd1b1('0x44')]));if(_0x488c59[_0xd1b1('0x42')]['filter']){_0x17ef0a['where']=_[_0xd1b1('0x4e')](_0x17ef0a[_0xd1b1('0x4b')],{'$or':_['map'](_0x17ef0a[_0xd1b1('0x45')],function(_0x274252){var _0x14ccad={};_0x14ccad[_0x274252]={'$like':'%'+_0x488c59['query'][_0xd1b1('0x4d')]+'%'};return _0x14ccad;})});}_0x17ef0a=_[_0xd1b1('0x4e')]({},_0x17ef0a,_0x488c59[_0xd1b1('0x50')]);return _0x3fa7e9[_0xd1b1('0x109')](_0x17ef0a);}})[_0xd1b1('0x20')](function(_0x44d6ec){if(_0x44d6ec){_0xcf991e=_0x44d6ec[_0xd1b1('0x65')];if(!_0x488c59['query'][_0xd1b1('0x48')](_0xd1b1('0x66'))){_0x17ef0a[_0xd1b1('0x30')]=qs['limit'](_0x488c59[_0xd1b1('0x42')]['limit']);_0x17ef0a[_0xd1b1('0x2f')]=qs[_0xd1b1('0x2f')](_0x488c59[_0xd1b1('0x42')][_0xd1b1('0x2f')]);}return _0x3fa7e9[_0xd1b1('0x109')](_0x17ef0a);}})[_0xd1b1('0x20')](function(_0xa6fe8){if(_0xa6fe8){return _0xa6fe8?{'count':_0xcf991e,'rows':_0xa6fe8}:null;}})[_0xd1b1('0x20')](respondWithResult(_0x59d507,null))[_0xd1b1('0x2a')](handleError(_0x59d507,null));};exports[_0xd1b1('0x11e')]=function(_0x7ec0c,_0x3195e8,_0x78571c){var _0x87b434=_0x7ec0c[_0xd1b1('0x42')][_0xd1b1('0x11f')]===_0xd1b1('0x120')?_0xd1b1('0x121'):_0xd1b1('0x122');return db['ChatWebsite'][_0xd1b1('0x58')]({'attributes':['id',_0x87b434],'where':{'id':_0x7ec0c[_0xd1b1('0x56')]['id']}})['then'](handleEntityNotFound(_0x3195e8,null))[_0xd1b1('0x20')](function(_0x2b1426){if(_0x2b1426){var _0x1b6d66=_0x2b1426[_0x87b434];var _0x5aca91=_0x1b6d66&&_0x1b6d66[_0xd1b1('0x123')]?_0x1b6d66[_0xd1b1('0x123')]:[];_0x3195e8[_0xd1b1('0x39')]({'fromKey':_[_0xd1b1('0x80')](_0x1b6d66['fromKey'])?undefined:_0x1b6d66[_0xd1b1('0x124')],'count':_0x5aca91['length'],'rows':_0x5aca91});}})['catch'](handleError(_0x3195e8,null));};exports[_0xd1b1('0x125')]=function(_0x58b572,_0x9b8968,_0x442802){var _0xaac376={'raw':![],'where':{}};var _0x1aebc8={};var _0x33d8c6={'count':0x0,'rows':[]};return db[_0xd1b1('0x52')][_0xd1b1('0x6a')]({'where':{'id':_0x58b572[_0xd1b1('0x56')]['id']}})[_0xd1b1('0x20')](handleEntityNotFound(_0x9b8968,null))[_0xd1b1('0x20')](function(_0x402d8b){if(_0x402d8b){_0x1aebc8[_0xd1b1('0x41')]=_[_0xd1b1('0x43')](db['ChatOfflineMessage'][_0xd1b1('0x3d')]);_0x1aebc8[_0xd1b1('0x42')]=_[_0xd1b1('0x43')](_0x58b572['query']);_0x1aebc8[_0xd1b1('0x44')]=_[_0xd1b1('0x46')](_0x1aebc8[_0xd1b1('0x41')],_0x1aebc8[_0xd1b1('0x42')]);_0xaac376[_0xd1b1('0x45')]=_['intersection'](_0x1aebc8['model'],qs[_0xd1b1('0x47')](_0x58b572[_0xd1b1('0x42')]['fields']));_0xaac376[_0xd1b1('0x45')]=_0xaac376[_0xd1b1('0x45')][_0xd1b1('0x65')]?_0xaac376[_0xd1b1('0x45')]:_0x1aebc8[_0xd1b1('0x41')];if(!_0x58b572[_0xd1b1('0x42')]['hasOwnProperty'](_0xd1b1('0x66'))){_0xaac376[_0xd1b1('0x30')]=qs['limit'](_0x58b572['query'][_0xd1b1('0x30')]);_0xaac376[_0xd1b1('0x2f')]=qs[_0xd1b1('0x2f')](_0x58b572[_0xd1b1('0x42')]['offset']);}_0xaac376[_0xd1b1('0x49')]=qs[_0xd1b1('0x4a')](_0x58b572[_0xd1b1('0x42')][_0xd1b1('0x4a')]);_0xaac376[_0xd1b1('0x4b')]=qs[_0xd1b1('0x44')](_[_0xd1b1('0x4c')](_0x58b572[_0xd1b1('0x42')],_0x1aebc8[_0xd1b1('0x44')]));_0xaac376[_0xd1b1('0x4b')][_0xd1b1('0x62')]=_0x402d8b['id'];if(_0x58b572['query'][_0xd1b1('0x4d')]){_0xaac376[_0xd1b1('0x4b')]=_[_0xd1b1('0x4e')](_0xaac376[_0xd1b1('0x4b')],{'$or':_[_0xd1b1('0x3c')](_0xaac376[_0xd1b1('0x45')],function(_0x3fb7cd){var _0x6d89e={};_0x6d89e[_0x3fb7cd]={'$like':'%'+_0x58b572[_0xd1b1('0x42')][_0xd1b1('0x4d')]+'%'};return _0x6d89e;})});}_0xaac376=_[_0xd1b1('0x4e')]({},_0xaac376,_0x58b572[_0xd1b1('0x50')]);return db[_0xd1b1('0x126')][_0xd1b1('0x2e')]({'where':_0xaac376['where']})[_0xd1b1('0x20')](function(_0x4ecfb1){_0x33d8c6['count']=_0x4ecfb1;if(_0x58b572[_0xd1b1('0x42')]['includeAll']){_0xaac376[_0xd1b1('0x51')]=[{'all':!![]}];}else{_0xaac376[_0xd1b1('0x51')]=[{'model':db[_0xd1b1('0x8c')],'as':_0xd1b1('0x127'),'required':![]},{'model':db[_0xd1b1('0xe0')],'as':_0xd1b1('0x128'),'required':![]}];}return db['ChatOfflineMessage'][_0xd1b1('0x53')](_0xaac376);})[_0xd1b1('0x20')](function(_0x27aa42){_0x33d8c6['rows']=_0x27aa42;return _0x33d8c6;});}})[_0xd1b1('0x20')](respondWithFilteredResult(_0x9b8968,_0xaac376))[_0xd1b1('0x2a')](handleError(_0x9b8968,null));};exports['addAgents']=function(_0x95e3b8,_0x538d04,_0x3f0ffa){return db[_0xd1b1('0x52')]['find']({'where':{'id':_0x95e3b8[_0xd1b1('0x56')]['id']}})[_0xd1b1('0x20')](handleEntityNotFound(_0x538d04,null))[_0xd1b1('0x20')](function(_0x1b777d){if(_0x1b777d){return _0x1b777d[_0xd1b1('0x129')](_0x95e3b8[_0xd1b1('0x5a')][_0xd1b1('0x68')],_[_0xd1b1('0xf6')](_0x95e3b8['body'],[_0xd1b1('0x68'),'id'])||{})[_0xd1b1('0xbe')](function(_0x125dfd){for(var _0x36dcb9=0x0;_0x36dcb9<_0x95e3b8[_0xd1b1('0x5a')][_0xd1b1('0x68')]['length'];_0x36dcb9+=0x1){socket[_0xd1b1('0x12a')]('userChatWebsite:save',{'UserId':_0x95e3b8['body'][_0xd1b1('0x68')][_0x36dcb9],'ChatWebsiteId':_0x95e3b8['params']['id']});}return _0x125dfd;});}})[_0xd1b1('0x20')](respondWithResult(_0x538d04,null))[_0xd1b1('0x2a')](handleError(_0x538d04,null));};exports[_0xd1b1('0x12b')]=function(_0x5ca31f,_0x126258,_0x305726){return db[_0xd1b1('0x52')][_0xd1b1('0x58')]({'where':{'id':_0x5ca31f[_0xd1b1('0x56')]['id']}})[_0xd1b1('0x20')](handleEntityNotFound(_0x126258,null))[_0xd1b1('0x20')](function(_0x33c5fc){if(_0x33c5fc){return _0x33c5fc['removeAgents'](_0x5ca31f[_0xd1b1('0x42')]['ids'])[_0xd1b1('0x20')](function(){if(_[_0xd1b1('0x12c')](_0x5ca31f[_0xd1b1('0x42')]['ids'])){for(var _0x42f120=0x0;_0x42f120<_0x5ca31f[_0xd1b1('0x42')][_0xd1b1('0x68')][_0xd1b1('0x65')];_0x42f120+=0x1){socket[_0xd1b1('0x12a')]('userChatWebsite:remove',{'UserId':Number(_0x5ca31f['query'][_0xd1b1('0x68')][_0x42f120]),'ChatWebsiteId':Number(_0x5ca31f['params']['id'])});}}else{socket[_0xd1b1('0x12a')](_0xd1b1('0x12d'),{'UserId':Number(_0x5ca31f[_0xd1b1('0x42')][_0xd1b1('0x68')]),'ChatWebsiteId':Number(_0x5ca31f[_0xd1b1('0x56')]['id'])});}});}})[_0xd1b1('0x20')](respondWithStatusCode(_0x126258,null))['catch'](handleError(_0x126258,null));};exports[_0xd1b1('0x12e')]=function(_0x120c89,_0xe5c156,_0xaafcde){var _0x387c78={};var _0x4736d2={};var _0x11d0cc;var _0x3b26bc;return db[_0xd1b1('0x52')][_0xd1b1('0x6a')]({'where':{'id':_0x120c89['params']['id']}})[_0xd1b1('0x20')](handleEntityNotFound(_0xe5c156,null))[_0xd1b1('0x20')](function(_0xfea844){if(_0xfea844){_0x11d0cc=_0xfea844;_0x4736d2[_0xd1b1('0x41')]=_['keys'](db[_0xd1b1('0x12f')][_0xd1b1('0x3d')]);_0x4736d2[_0xd1b1('0x42')]=_[_0xd1b1('0x43')](_0x120c89['query']);_0x4736d2[_0xd1b1('0x44')]=_[_0xd1b1('0x46')](_0x4736d2['model'],_0x4736d2['query']);_0x387c78[_0xd1b1('0x45')]=_[_0xd1b1('0x46')](_0x4736d2[_0xd1b1('0x41')],qs[_0xd1b1('0x47')](_0x120c89[_0xd1b1('0x42')][_0xd1b1('0x47')]));_0x387c78['attributes']=_0x387c78[_0xd1b1('0x45')][_0xd1b1('0x65')]?_0x387c78['attributes']:_0x4736d2['model'];_0x387c78[_0xd1b1('0x49')]=qs[_0xd1b1('0x4a')](_0x120c89[_0xd1b1('0x42')][_0xd1b1('0x4a')]);_0x387c78[_0xd1b1('0x4b')]=qs[_0xd1b1('0x44')](_[_0xd1b1('0x4c')](_0x120c89[_0xd1b1('0x42')],_0x4736d2[_0xd1b1('0x44')]));if(_0x120c89[_0xd1b1('0x42')][_0xd1b1('0x4d')]){_0x387c78[_0xd1b1('0x4b')]=_['merge'](_0x387c78[_0xd1b1('0x4b')],{'$or':_[_0xd1b1('0x3c')](_0x387c78[_0xd1b1('0x45')],function(_0x2148c9){var _0x4b2ee4={};_0x4b2ee4[_0x2148c9]={'$like':'%'+_0x120c89[_0xd1b1('0x42')][_0xd1b1('0x4d')]+'%'};return _0x4b2ee4;})});}_0x387c78=_[_0xd1b1('0x4e')]({},_0x387c78,_0x120c89[_0xd1b1('0x50')]);return _0x11d0cc['getAgents'](_0x387c78);}})[_0xd1b1('0x20')](function(_0x229124){if(_0x229124){_0x3b26bc=_0x229124[_0xd1b1('0x65')];if(!_0x120c89['query'][_0xd1b1('0x48')](_0xd1b1('0x66'))){_0x387c78[_0xd1b1('0x30')]=qs[_0xd1b1('0x30')](_0x120c89[_0xd1b1('0x42')][_0xd1b1('0x30')]);_0x387c78[_0xd1b1('0x2f')]=qs[_0xd1b1('0x2f')](_0x120c89[_0xd1b1('0x42')]['offset']);}return _0x11d0cc[_0xd1b1('0x12e')](_0x387c78);}})[_0xd1b1('0x20')](function(_0x520f16){if(_0x520f16){return _0x520f16?{'count':_0x3b26bc,'rows':_0x520f16}:null;}})[_0xd1b1('0x20')](respondWithResult(_0xe5c156,null))[_0xd1b1('0x2a')](handleError(_0xe5c156,null));};
\ No newline at end of file
+var _0xfb21=['map','ChatWebsite','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','params','find','create','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','describe','ChatWebsiteId','Disposition','getDispositions','findOne','rawAttributes','order','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','sitepic','addAvatar','agentAvatar','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','getResult','chat','CmContact','Sequelize','ValidationError','difference','updatedAt','createdAt','CompanyId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','List','Contacts','Applications','account','applications','list','orderBy','asc','defaults','ListId','customerIp','cf-connecting-ip','x-forwarded-for','first','split','x-real-port','browser','version','format','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','firstName','lastName','messageId','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','files','email','from\x20is\x20mandatory','Comments','mapKeyOffline','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','bulkCreate','$promise','MailServerOut','service','host','Smtp','port','secure','authentication','SendMail','sendMail','forwardOfflineAddress','offlineMessageSubject','MailAccountId','Chat','NotifyMailAccount','notifyMail','attachments','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','fullname','internal','Tag','Tags','color','tag','getSnippet','timezone','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','Interval','../../config/license/util','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.js','remote','connection','remoteAddress','referer','replace','alignment','color_button','addApplications','sequelize','ChatApplication','findAndCountAll','priority','getApplications','addProactiveActions','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','Contact','Attachment','Attachments','rows','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','User','getAgents','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','ChatWebsite,\x20%s,\x20%s','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','save','get','ChatWebsites','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause'];(function(_0x1d9ad5,_0xbb151a){var _0x318aa2=function(_0xd54381){while(--_0xd54381){_0x1d9ad5['push'](_0x1d9ad5['shift']());}};_0x318aa2(++_0xbb151a);}(_0xfb21,0xeb));var _0x1fb2=function(_0x362a1d,_0x5bd04f){_0x362a1d=_0x362a1d-0x0;var _0x53137f=_0xfb21[_0x362a1d];return _0x53137f;};'use strict';var pdf=require(_0x1fb2('0x0'));var emlformat=require(_0x1fb2('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1fb2('0x2'));var rp=require(_0x1fb2('0x3'));var moment=require('moment');var BPromise=require(_0x1fb2('0x4'));var Mustache=require(_0x1fb2('0x5'));var util=require(_0x1fb2('0x6'));var path=require('path');var sox=require(_0x1fb2('0x7'));var csv=require('to-csv');var ejs=require(_0x1fb2('0x8'));var fs=require('fs');var fs_extra=require(_0x1fb2('0x9'));var _=require('lodash');var squel=require(_0x1fb2('0xa'));var crypto=require(_0x1fb2('0xb'));var jsforce=require(_0x1fb2('0xc'));var deskjs=require(_0x1fb2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1fb2('0xe'));var Papa=require(_0x1fb2('0xf'));var Redis=require('ioredis');var authService=require(_0x1fb2('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1fb2('0x11'))(_0x1fb2('0x12'));var utils=require('../../config/utils');var config=require(_0x1fb2('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x1fb2('0x14'))['db'];config[_0x1fb2('0x15')]=_['defaults'](config[_0x1fb2('0x15')],{'host':_0x1fb2('0x16'),'port':0x18eb});var socket=require(_0x1fb2('0x17'))(new Redis(config[_0x1fb2('0x15')]));require(_0x1fb2('0x18'))['register'](socket);var jayson=require(_0x1fb2('0x19'));var client=jayson[_0x1fb2('0x1a')][_0x1fb2('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0x1fb2('0x1b')]({'port':0x232a});var client9003=jayson[_0x1fb2('0x1a')][_0x1fb2('0x1b')]({'port':0x232b});var client9001=jayson[_0x1fb2('0x1a')]['http']({'port':0x2329});function respondWithRpcPromise(_0x35e5fc,_0x12b7bb,_0x16b683,_0x6a1152){return new BPromise(function(_0xafdb8d,_0x4fd194){var _0x406349=_0x6a1152||client;return _0x406349[_0x1fb2('0x1c')](_0x35e5fc,_0x16b683)[_0x1fb2('0x1d')](function(_0xbd7c14){logger[_0x1fb2('0x1e')]('ChatWebsite,\x20%s,\x20%s',_0x12b7bb,_0x1fb2('0x1f'));logger[_0x1fb2('0x20')](_0x1fb2('0x21'),_0x12b7bb,_0x1fb2('0x1f'),JSON['stringify'](_0xbd7c14));if(_0xbd7c14[_0x1fb2('0x22')]){if(_0xbd7c14[_0x1fb2('0x22')]['code']===0x1f4){logger[_0x1fb2('0x22')]('ChatWebsite,\x20%s,\x20%s',_0x12b7bb,_0xbd7c14[_0x1fb2('0x22')][_0x1fb2('0x23')]);return _0x4fd194(_0xbd7c14['error'][_0x1fb2('0x23')]);}logger[_0x1fb2('0x22')](_0x1fb2('0x24'),_0x12b7bb,_0xbd7c14[_0x1fb2('0x22')][_0x1fb2('0x23')]);return _0xafdb8d(_0xbd7c14['error'][_0x1fb2('0x23')]);}else{logger['info'](_0x1fb2('0x24'),_0x12b7bb,_0x1fb2('0x1f'));_0xafdb8d(_0xbd7c14[_0x1fb2('0x25')][_0x1fb2('0x23')]);}})[_0x1fb2('0x26')](function(_0x1c9df1){logger['error'](_0x1fb2('0x24'),_0x12b7bb,_0x1c9df1);_0x4fd194(_0x1c9df1);});});}function respondWithStatusCode(_0x351dd6,_0x1b9e5c){_0x1b9e5c=_0x1b9e5c||0xcc;return function(_0x464296){if(_0x464296){return _0x351dd6['sendStatus'](_0x1b9e5c);}return _0x351dd6[_0x1fb2('0x27')](_0x1b9e5c)[_0x1fb2('0x28')]();};}function respondWithResult(_0x44b82d,_0x4d7fde){_0x4d7fde=_0x4d7fde||0xc8;return function(_0x33ebdd){if(_0x33ebdd){return _0x44b82d['status'](_0x4d7fde)[_0x1fb2('0x29')](_0x33ebdd);}};}function respondWithFilteredResult(_0x181d9e,_0x34cc13){return function(_0x32f4a2){if(_0x32f4a2){var _0x1c730b=_0x32f4a2[_0x1fb2('0x2a')],_0xc2a70f=_0x34cc13[_0x1fb2('0x2b')],_0xb466ff=_0x34cc13['offset']+_0x34cc13[_0x1fb2('0x2c')],_0x437ac2;if(_0xb466ff>=_0x1c730b){_0xb466ff=_0x1c730b;_0x437ac2=0xc8;}else{_0x437ac2=0xce;}_0x181d9e[_0x1fb2('0x27')](_0x437ac2);return _0x181d9e[_0x1fb2('0x2d')](_0x1fb2('0x2e'),_0xc2a70f+'-'+_0xb466ff+'/'+_0x1c730b)[_0x1fb2('0x29')](_0x32f4a2);}return null;};}function patchUpdates(_0x8a6c11){return function(_0x5251d5){try{jsonpatch[_0x1fb2('0x2f')](_0x5251d5,_0x8a6c11,!![]);}catch(_0x1fb94a){return BPromise['reject'](_0x1fb94a);}return _0x5251d5[_0x1fb2('0x30')]();};}function saveUpdates(_0xb9951f,_0x1cfa51){return function(_0x3f787f){if(_0x3f787f){return _0x3f787f['update'](_0xb9951f)[_0x1fb2('0x1d')](function(_0x5639e0){return _0x5639e0;});}return null;};}function removeEntity(_0x46f533,_0x46bd22){return function(_0x37fad4){if(_0x37fad4){return _0x37fad4['destroy']()[_0x1fb2('0x1d')](function(){var _0x5442c1=_0x37fad4[_0x1fb2('0x31')]({'plain':!![]});var _0x535da7=_0x1fb2('0x32');return db[_0x1fb2('0x33')]['destroy']({'where':{'type':_0x535da7,'resourceId':_0x5442c1['id']}})[_0x1fb2('0x1d')](function(){return _0x37fad4;});})[_0x1fb2('0x1d')](function(){_0x46f533[_0x1fb2('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8c18cf,_0x3131fb){return function(_0x1a6ab8){if(!_0x1a6ab8){_0x8c18cf[_0x1fb2('0x34')](0x194);}return _0x1a6ab8;};}function handleError(_0x4bd31b,_0x46ad62){_0x46ad62=_0x46ad62||0x1f4;return function(_0x334634){logger['error'](_0x334634[_0x1fb2('0x35')]);if(_0x334634[_0x1fb2('0x36')]){delete _0x334634[_0x1fb2('0x36')];}_0x4bd31b[_0x1fb2('0x27')](_0x46ad62)[_0x1fb2('0x37')](_0x334634);};}exports[_0x1fb2('0x38')]=function(_0x268b97,_0x14ec87){var _0xcb8268={'include':[{'model':db[_0x1fb2('0x39')],'as':_0x1fb2('0x3a')}]},_0x4e8029={},_0x45ae98={'count':0x0,'rows':[]};var _0x260558=_[_0x1fb2('0x3b')](db[_0x1fb2('0x3c')]['rawAttributes'],function(_0x1d4ffd){return{'name':_0x1d4ffd[_0x1fb2('0x3d')],'type':_0x1d4ffd[_0x1fb2('0x3e')][_0x1fb2('0x3f')]};});_0x4e8029[_0x1fb2('0x40')]=_['map'](_0x260558,'name');_0x4e8029[_0x1fb2('0x41')]=_[_0x1fb2('0x42')](_0x268b97['query']);_0x4e8029[_0x1fb2('0x43')]=_[_0x1fb2('0x44')](_0x4e8029[_0x1fb2('0x40')],_0x4e8029['query']);_0xcb8268[_0x1fb2('0x45')]=_[_0x1fb2('0x44')](_0x4e8029[_0x1fb2('0x40')],qs[_0x1fb2('0x46')](_0x268b97[_0x1fb2('0x41')][_0x1fb2('0x46')]));_0xcb8268['attributes']=_0xcb8268['attributes'][_0x1fb2('0x47')]?_0xcb8268['attributes']:_0x4e8029['model'];if(!_0x268b97[_0x1fb2('0x41')][_0x1fb2('0x48')](_0x1fb2('0x49'))){_0xcb8268[_0x1fb2('0x2c')]=qs['limit'](_0x268b97['query'][_0x1fb2('0x2c')]);_0xcb8268[_0x1fb2('0x2b')]=qs[_0x1fb2('0x2b')](_0x268b97['query']['offset']);}_0xcb8268['order']=qs[_0x1fb2('0x4a')](_0x268b97[_0x1fb2('0x41')][_0x1fb2('0x4a')]);_0xcb8268[_0x1fb2('0x4b')]=qs[_0x1fb2('0x43')](_[_0x1fb2('0x4c')](_0x268b97[_0x1fb2('0x41')],_0x4e8029['filters']),_0x260558);if(_0x268b97[_0x1fb2('0x41')][_0x1fb2('0x4d')]){_0xcb8268[_0x1fb2('0x4b')]=_[_0x1fb2('0x4e')](_0xcb8268[_0x1fb2('0x4b')],{'$or':_[_0x1fb2('0x3b')](_0x260558,function(_0x5daae4){if(_0x5daae4['type']!=='VIRTUAL'){var _0x300b87={};_0x300b87[_0x5daae4[_0x1fb2('0x36')]]={'$like':'%'+_0x268b97['query']['filter']+'%'};return _0x300b87;}})});}_0xcb8268=_['merge']({},_0xcb8268,_0x268b97[_0x1fb2('0x4f')]);var _0x48635a={'where':_0xcb8268[_0x1fb2('0x4b')]};return db['ChatWebsite'][_0x1fb2('0x2a')](_0x48635a)[_0x1fb2('0x1d')](function(_0x5d5d6e){_0x45ae98[_0x1fb2('0x2a')]=_0x5d5d6e;if(_0x268b97[_0x1fb2('0x41')][_0x1fb2('0x50')]){_0xcb8268[_0x1fb2('0x51')]=[{'all':!![]}];}return db['ChatWebsite'][_0x1fb2('0x52')](_0xcb8268);})[_0x1fb2('0x1d')](function(_0x21189a){_0x45ae98['rows']=_0x21189a;return _0x45ae98;})[_0x1fb2('0x1d')](respondWithFilteredResult(_0x14ec87,_0xcb8268))[_0x1fb2('0x26')](handleError(_0x14ec87,null));};exports[_0x1fb2('0x53')]=function(_0x3e9e95,_0x3f56a5){var _0x1a7b26={'raw':![],'where':{'id':_0x3e9e95[_0x1fb2('0x54')]['id']},'include':[{'model':db[_0x1fb2('0x39')],'as':_0x1fb2('0x3a')}]},_0x3d5577={};_0x3d5577['model']=_[_0x1fb2('0x42')](db['ChatWebsite']['rawAttributes']);_0x3d5577[_0x1fb2('0x41')]=_['keys'](_0x3e9e95[_0x1fb2('0x41')]);_0x3d5577[_0x1fb2('0x43')]=_[_0x1fb2('0x44')](_0x3d5577[_0x1fb2('0x40')],_0x3d5577[_0x1fb2('0x41')]);_0x1a7b26['attributes']=_[_0x1fb2('0x44')](_0x3d5577[_0x1fb2('0x40')],qs[_0x1fb2('0x46')](_0x3e9e95[_0x1fb2('0x41')]['fields']));_0x1a7b26[_0x1fb2('0x45')]=_0x1a7b26[_0x1fb2('0x45')][_0x1fb2('0x47')]?_0x1a7b26[_0x1fb2('0x45')]:_0x3d5577['model'];if(_0x3e9e95[_0x1fb2('0x41')]['includeAll']){_0x1a7b26[_0x1fb2('0x51')]=[{'all':!![]}];}_0x1a7b26=_[_0x1fb2('0x4e')]({},_0x1a7b26,_0x3e9e95[_0x1fb2('0x4f')]);return db[_0x1fb2('0x3c')][_0x1fb2('0x55')](_0x1a7b26)[_0x1fb2('0x1d')](handleEntityNotFound(_0x3f56a5,null))[_0x1fb2('0x1d')](respondWithResult(_0x3f56a5,null))[_0x1fb2('0x26')](handleError(_0x3f56a5,null));};exports['create']=function(_0x26cfea,_0x1b4cfd){return db[_0x1fb2('0x3c')][_0x1fb2('0x56')](_0x26cfea['body'],{})[_0x1fb2('0x1d')](function(_0x4a018f){var _0x25fd97=_0x26cfea[_0x1fb2('0x57')][_0x1fb2('0x31')]({'plain':!![]});if(!_0x25fd97)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25fd97['role']===_0x1fb2('0x57')){var _0x57b83e=_0x4a018f[_0x1fb2('0x31')]({'plain':!![]});var _0x5af7c6=_0x1fb2('0x32');return db[_0x1fb2('0x58')][_0x1fb2('0x55')]({'where':{'name':_0x5af7c6,'userProfileId':_0x25fd97[_0x1fb2('0x59')]},'raw':!![]})[_0x1fb2('0x1d')](function(_0x27841b){if(_0x27841b&&_0x27841b['autoAssociation']===0x0){return db['UserProfileResource'][_0x1fb2('0x56')]({'name':_0x57b83e[_0x1fb2('0x36')],'resourceId':_0x57b83e['id'],'type':_0x27841b[_0x1fb2('0x36')],'sectionId':_0x27841b['id']},{})[_0x1fb2('0x1d')](function(){return _0x4a018f;});}else{return _0x4a018f;}})[_0x1fb2('0x26')](function(_0x4bf417){logger[_0x1fb2('0x22')](_0x1fb2('0x5a'),_0x4bf417);throw _0x4bf417;});}return _0x4a018f;})[_0x1fb2('0x1d')](respondWithResult(_0x1b4cfd,0xc9))[_0x1fb2('0x26')](handleError(_0x1b4cfd,null));};exports[_0x1fb2('0x5b')]=function(_0x1d8239,_0x3b1830){if(_0x1d8239[_0x1fb2('0x5c')]['id']){delete _0x1d8239[_0x1fb2('0x5c')]['id'];}return db[_0x1fb2('0x3c')][_0x1fb2('0x55')]({'where':{'id':_0x1d8239[_0x1fb2('0x54')]['id']},'include':[{'model':db[_0x1fb2('0x39')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x3b1830,null))['then'](saveUpdates(_0x1d8239[_0x1fb2('0x5c')],null))[_0x1fb2('0x1d')](respondWithResult(_0x3b1830,null))[_0x1fb2('0x26')](handleError(_0x3b1830,null));};exports[_0x1fb2('0x5d')]=function(_0x4f02f2,_0x2ef98b){return db[_0x1fb2('0x3c')][_0x1fb2('0x55')]({'where':{'id':_0x4f02f2[_0x1fb2('0x54')]['id']}})[_0x1fb2('0x1d')](handleEntityNotFound(_0x2ef98b,null))[_0x1fb2('0x1d')](removeEntity(_0x2ef98b,null))['catch'](handleError(_0x2ef98b,null));};exports[_0x1fb2('0x5e')]=function(_0x4cd054,_0x4e23cf){return db[_0x1fb2('0x3c')][_0x1fb2('0x5e')]()[_0x1fb2('0x1d')](respondWithResult(_0x4e23cf,null))[_0x1fb2('0x26')](handleError(_0x4e23cf,null));};exports['addDisposition']=function(_0x39389a,_0x5e661a,_0x42e6fb){if(_0x39389a[_0x1fb2('0x5c')]['id']){delete _0x39389a['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x39389a['params']['id']}})['then'](handleEntityNotFound(_0x5e661a,null))['then'](function(_0x2f1a7b){if(_0x2f1a7b){_0x39389a[_0x1fb2('0x5c')][_0x1fb2('0x5f')]=_0x2f1a7b['id'];return db[_0x1fb2('0x60')][_0x1fb2('0x56')](_0x39389a[_0x1fb2('0x5c')]);}})[_0x1fb2('0x1d')](respondWithResult(_0x5e661a,null))['catch'](handleError(_0x5e661a,null));};exports[_0x1fb2('0x61')]=function(_0x587045,_0x3d1229,_0x4790b7){var _0x13822d={'raw':![],'where':{}};var _0x168646={};var _0xdcfdf2={'count':0x0,'rows':[]};return db[_0x1fb2('0x3c')][_0x1fb2('0x62')]({'where':{'id':_0x587045['params']['id']}})[_0x1fb2('0x1d')](handleEntityNotFound(_0x3d1229,null))[_0x1fb2('0x1d')](function(_0x5d6dd2){if(_0x5d6dd2){_0x168646[_0x1fb2('0x40')]=_['keys'](db[_0x1fb2('0x60')][_0x1fb2('0x63')]);_0x168646[_0x1fb2('0x41')]=_[_0x1fb2('0x42')](_0x587045[_0x1fb2('0x41')]);_0x168646[_0x1fb2('0x43')]=_['intersection'](_0x168646[_0x1fb2('0x40')],_0x168646[_0x1fb2('0x41')]);_0x13822d['attributes']=_[_0x1fb2('0x44')](_0x168646['model'],qs[_0x1fb2('0x46')](_0x587045[_0x1fb2('0x41')][_0x1fb2('0x46')]));_0x13822d[_0x1fb2('0x45')]=_0x13822d[_0x1fb2('0x45')][_0x1fb2('0x47')]?_0x13822d[_0x1fb2('0x45')]:_0x168646[_0x1fb2('0x40')];if(!_0x587045['query'][_0x1fb2('0x48')](_0x1fb2('0x49'))){_0x13822d[_0x1fb2('0x2c')]=qs[_0x1fb2('0x2c')](_0x587045[_0x1fb2('0x41')][_0x1fb2('0x2c')]);_0x13822d[_0x1fb2('0x2b')]=qs[_0x1fb2('0x2b')](_0x587045[_0x1fb2('0x41')][_0x1fb2('0x2b')]);}_0x13822d[_0x1fb2('0x64')]=qs[_0x1fb2('0x4a')](_0x587045[_0x1fb2('0x41')]['sort']);_0x13822d[_0x1fb2('0x4b')]=qs[_0x1fb2('0x43')](_['pick'](_0x587045[_0x1fb2('0x41')],_0x168646['filters']));_0x13822d[_0x1fb2('0x4b')][_0x1fb2('0x5f')]=_0x5d6dd2['id'];if(_0x587045[_0x1fb2('0x41')][_0x1fb2('0x4d')]){_0x13822d[_0x1fb2('0x4b')]=_[_0x1fb2('0x4e')](_0x13822d[_0x1fb2('0x4b')],{'$or':_[_0x1fb2('0x3b')](_0x13822d['attributes'],function(_0x4e6fac){var _0x54f9b3={};_0x54f9b3[_0x4e6fac]={'$like':'%'+_0x587045[_0x1fb2('0x41')][_0x1fb2('0x4d')]+'%'};return _0x54f9b3;})});}_0x13822d=_[_0x1fb2('0x4e')]({},_0x13822d,_0x587045[_0x1fb2('0x4f')]);return db[_0x1fb2('0x60')][_0x1fb2('0x2a')]({'where':_0x13822d[_0x1fb2('0x4b')]})['then'](function(_0x303e6f){_0xdcfdf2[_0x1fb2('0x2a')]=_0x303e6f;if(_0x587045[_0x1fb2('0x41')]['includeAll']){_0x13822d[_0x1fb2('0x51')]=[{'all':!![]}];}return db['Disposition'][_0x1fb2('0x52')](_0x13822d);})[_0x1fb2('0x1d')](function(_0x3380e2){_0xdcfdf2['rows']=_0x3380e2;return _0xdcfdf2;});}})[_0x1fb2('0x1d')](respondWithFilteredResult(_0x3d1229,_0x13822d))[_0x1fb2('0x26')](handleError(_0x3d1229,null));};exports['removeDispositions']=function(_0x182fd7,_0x1a2b7d,_0x4b7e23){return db[_0x1fb2('0x3c')]['find']({'where':{'id':_0x182fd7[_0x1fb2('0x54')]['id']}})[_0x1fb2('0x1d')](handleEntityNotFound(_0x1a2b7d,null))[_0x1fb2('0x1d')](function(_0x2cdfd0){if(_0x2cdfd0){return _0x2cdfd0[_0x1fb2('0x65')](_0x182fd7[_0x1fb2('0x41')][_0x1fb2('0x66')]);}})[_0x1fb2('0x1d')](respondWithStatusCode(_0x1a2b7d,null))[_0x1fb2('0x26')](handleError(_0x1a2b7d,null));};exports[_0x1fb2('0x67')]=function(_0x59cf80,_0x1e39ba,_0x4da4aa){if(_0x59cf80[_0x1fb2('0x5c')]['id']){delete _0x59cf80[_0x1fb2('0x5c')]['id'];}return db['ChatWebsite'][_0x1fb2('0x55')]({'where':{'id':_0x59cf80[_0x1fb2('0x54')]['id']}})[_0x1fb2('0x1d')](handleEntityNotFound(_0x1e39ba,null))[_0x1fb2('0x1d')](function(_0x15c1a6){if(_0x15c1a6){_0x59cf80[_0x1fb2('0x5c')]['ChatWebsiteId']=_0x15c1a6['id'];return db['CannedAnswer'][_0x1fb2('0x56')](_0x59cf80['body']);}})[_0x1fb2('0x1d')](respondWithResult(_0x1e39ba,null))[_0x1fb2('0x26')](handleError(_0x1e39ba,null));};exports['getAnswers']=function(_0x17ea86,_0x3059b8,_0x4479f0){var _0x216662={'raw':![],'where':{}};var _0x50148b={};var _0x1baecb={'count':0x0,'rows':[]};return db[_0x1fb2('0x3c')]['findOne']({'where':{'id':_0x17ea86[_0x1fb2('0x54')]['id']}})[_0x1fb2('0x1d')](handleEntityNotFound(_0x3059b8,null))[_0x1fb2('0x1d')](function(_0x5bb4fc){if(_0x5bb4fc){_0x50148b[_0x1fb2('0x40')]=_['keys'](db['CannedAnswer'][_0x1fb2('0x63')]);_0x50148b[_0x1fb2('0x41')]=_[_0x1fb2('0x42')](_0x17ea86[_0x1fb2('0x41')]);_0x50148b[_0x1fb2('0x43')]=_[_0x1fb2('0x44')](_0x50148b[_0x1fb2('0x40')],_0x50148b['query']);_0x216662['attributes']=_[_0x1fb2('0x44')](_0x50148b['model'],qs['fields'](_0x17ea86[_0x1fb2('0x41')][_0x1fb2('0x46')]));_0x216662[_0x1fb2('0x45')]=_0x216662['attributes'][_0x1fb2('0x47')]?_0x216662[_0x1fb2('0x45')]:_0x50148b[_0x1fb2('0x40')];if(!_0x17ea86['query'][_0x1fb2('0x48')]('nolimit')){_0x216662[_0x1fb2('0x2c')]=qs[_0x1fb2('0x2c')](_0x17ea86[_0x1fb2('0x41')][_0x1fb2('0x2c')]);_0x216662[_0x1fb2('0x2b')]=qs[_0x1fb2('0x2b')](_0x17ea86['query'][_0x1fb2('0x2b')]);}_0x216662[_0x1fb2('0x64')]=qs['sort'](_0x17ea86['query'][_0x1fb2('0x4a')]);_0x216662[_0x1fb2('0x4b')]=qs[_0x1fb2('0x43')](_[_0x1fb2('0x4c')](_0x17ea86[_0x1fb2('0x41')],_0x50148b['filters']));_0x216662['where']['ChatWebsiteId']=_0x5bb4fc['id'];if(_0x17ea86[_0x1fb2('0x41')]['filter']){_0x216662['where']=_[_0x1fb2('0x4e')](_0x216662[_0x1fb2('0x4b')],{'$or':_[_0x1fb2('0x3b')](_0x216662[_0x1fb2('0x45')],function(_0x4d8976){var _0x4a3369={};_0x4a3369[_0x4d8976]={'$like':'%'+_0x17ea86[_0x1fb2('0x41')]['filter']+'%'};return _0x4a3369;})});}_0x216662=_['merge']({},_0x216662,_0x17ea86[_0x1fb2('0x4f')]);return db[_0x1fb2('0x68')]['count']({'where':_0x216662[_0x1fb2('0x4b')]})[_0x1fb2('0x1d')](function(_0x1e4bcc){_0x1baecb[_0x1fb2('0x2a')]=_0x1e4bcc;if(_0x17ea86['query'][_0x1fb2('0x50')]){_0x216662['include']=[{'all':!![]}];}return db[_0x1fb2('0x68')][_0x1fb2('0x52')](_0x216662);})[_0x1fb2('0x1d')](function(_0x1e3430){_0x1baecb['rows']=_0x1e3430;return _0x1baecb;});}})[_0x1fb2('0x1d')](respondWithFilteredResult(_0x3059b8,_0x216662))[_0x1fb2('0x26')](handleError(_0x3059b8,null));};exports[_0x1fb2('0x69')]=function(_0x336426,_0x38fe30,_0x5a6df5){return db[_0x1fb2('0x3c')][_0x1fb2('0x55')]({'where':{'id':_0x336426[_0x1fb2('0x54')]['id']}})[_0x1fb2('0x1d')](handleEntityNotFound(_0x38fe30,null))[_0x1fb2('0x1d')](function(_0x155987){if(_0x155987){return _0x155987[_0x1fb2('0x69')](_0x336426[_0x1fb2('0x41')][_0x1fb2('0x66')]);}})['then'](respondWithStatusCode(_0x38fe30,null))[_0x1fb2('0x26')](handleError(_0x38fe30,null));};exports['addLogo']=function(_0x5314c2,_0x4546ce,_0x502163){_0x5314c2[_0x1fb2('0x5c')][_0x1fb2('0x6a')]=_0x5314c2['file']['filename'];return db[_0x1fb2('0x3c')][_0x1fb2('0x55')]({'where':{'id':_0x5314c2['params']['id']}})[_0x1fb2('0x1d')](handleEntityNotFound(_0x4546ce,null))[_0x1fb2('0x1d')](saveUpdates(_0x5314c2[_0x1fb2('0x5c')],null))[_0x1fb2('0x1d')](respondWithResult(_0x4546ce,null))[_0x1fb2('0x26')](handleError(_0x4546ce,null));};exports[_0x1fb2('0x6b')]=function(_0x59136d,_0x3235a7,_0x481d1b){_0x59136d[_0x1fb2('0x5c')][_0x1fb2('0x6c')]=_0x59136d[_0x1fb2('0x6d')][_0x1fb2('0x6e')];return db['ChatWebsite']['find']({'where':{'id':_0x59136d[_0x1fb2('0x54')]['id']}})[_0x1fb2('0x1d')](handleEntityNotFound(_0x3235a7,null))[_0x1fb2('0x1d')](saveUpdates(_0x59136d[_0x1fb2('0x5c')],null))['then'](respondWithResult(_0x3235a7,null))[_0x1fb2('0x26')](handleError(_0x3235a7,null));};exports[_0x1fb2('0x6f')]=function(_0x370690,_0x1d227f,_0xaaf33a){_0x370690[_0x1fb2('0x5c')][_0x1fb2('0x70')]=_0x370690[_0x1fb2('0x6d')][_0x1fb2('0x6e')];return db[_0x1fb2('0x3c')][_0x1fb2('0x55')]({'where':{'id':_0x370690[_0x1fb2('0x54')]['id']}})[_0x1fb2('0x1d')](handleEntityNotFound(_0x1d227f,null))[_0x1fb2('0x1d')](saveUpdates(_0x370690[_0x1fb2('0x5c')],null))['then'](respondWithResult(_0x1d227f,null))['catch'](handleError(_0x1d227f,null));};exports[_0x1fb2('0x71')]=function(_0x2da8c4,_0x41a4c6,_0x2d3df5){_0x2da8c4[_0x1fb2('0x5c')][_0x1fb2('0x72')]=_0x2da8c4[_0x1fb2('0x6d')]['filename'];return db[_0x1fb2('0x3c')][_0x1fb2('0x55')]({'where':{'id':_0x2da8c4[_0x1fb2('0x54')]['id']}})[_0x1fb2('0x1d')](handleEntityNotFound(_0x41a4c6,null))[_0x1fb2('0x1d')](saveUpdates(_0x2da8c4[_0x1fb2('0x5c')],null))['then'](respondWithResult(_0x41a4c6,null))[_0x1fb2('0x26')](handleError(_0x41a4c6,null));};exports['getLogo']=function(_0x55393f,_0x371dd0,_0x59b917){var _0x27318c=path[_0x1fb2('0x73')](config[_0x1fb2('0x74')],_0x1fb2('0x75'));var _0x4aae93={'where':{'id':_0x55393f[_0x1fb2('0x54')]['id']},'attributes':['id',_0x1fb2('0x6a')],'raw':!![]};var _0x2fa8f5=![];return require('../../config/license/util')[_0x1fb2('0x76')]()[_0x1fb2('0x1d')](function(_0x282d81){if(_0x282d81){_0x2fa8f5=_0x282d81[_0x1fb2('0x77')];}})[_0x1fb2('0x1d')](function(){return db['ChatWebsite'][_0x1fb2('0x55')](_0x4aae93);})[_0x1fb2('0x1d')](handleEntityNotFound(_0x371dd0,null))['then'](function(_0x44f4e3){if(_0x44f4e3){if(!_[_0x1fb2('0x78')](_0x44f4e3['sitepic'])){if(fs[_0x1fb2('0x79')](path[_0x1fb2('0x73')](config['root'],_0x1fb2('0x7a'),_0x44f4e3[_0x1fb2('0x6a')]))&&_0x2fa8f5){_0x27318c=path[_0x1fb2('0x73')](config['root'],_0x1fb2('0x7a'),_0x44f4e3[_0x1fb2('0x6a')]);}}return _0x371dd0[_0x1fb2('0x7b')](_0x27318c);}})[_0x1fb2('0x26')](handleError(_0x371dd0,null));};exports[_0x1fb2('0x7c')]=function(_0xc77443,_0x1dcf83,_0x363c67){var _0xb0cf5a=path[_0x1fb2('0x73')](config[_0x1fb2('0x74')],_0x1fb2('0x7d'));var _0x4506a8={'where':{'id':_0xc77443[_0x1fb2('0x54')]['id']},'attributes':['id',_0x1fb2('0x6c')],'raw':!![]};return db[_0x1fb2('0x3c')][_0x1fb2('0x55')](_0x4506a8)[_0x1fb2('0x1d')](handleEntityNotFound(_0x1dcf83,null))[_0x1fb2('0x1d')](function(_0x4d668c){if(_0x4d668c){if(!_['isNil'](_0x4d668c[_0x1fb2('0x6c')])){if(fs[_0x1fb2('0x79')](path[_0x1fb2('0x73')](config[_0x1fb2('0x74')],_0x1fb2('0x7e'),_0x4d668c[_0x1fb2('0x6c')]))){_0xb0cf5a=path[_0x1fb2('0x73')](config[_0x1fb2('0x74')],_0x1fb2('0x7e'),_0x4d668c[_0x1fb2('0x6c')]);}}return _0x1dcf83[_0x1fb2('0x7b')](_0xb0cf5a);}})[_0x1fb2('0x26')](handleError(_0x1dcf83,null));};exports[_0x1fb2('0x7f')]=function(_0x2fd748,_0x5c1434,_0x57b591){var _0x2f1536=path[_0x1fb2('0x73')](config[_0x1fb2('0x74')],_0x1fb2('0x80'));var _0xb38df0={'where':{'id':_0x2fd748[_0x1fb2('0x54')]['id']},'attributes':['id',_0x1fb2('0x70'),_0x1fb2('0x81')],'raw':!![]};return db[_0x1fb2('0x3c')][_0x1fb2('0x55')](_0xb38df0)[_0x1fb2('0x1d')](handleEntityNotFound(_0x5c1434,null))[_0x1fb2('0x1d')](function(_0x261e4e){if(_0x261e4e){if(!_['isNil'](_0x261e4e[_0x1fb2('0x70')])){if(fs[_0x1fb2('0x79')](path[_0x1fb2('0x73')](config[_0x1fb2('0x74')],_0x1fb2('0x7e'),_0x261e4e['customerAvatar']))&&_0x261e4e[_0x1fb2('0x81')]){_0x2f1536=path[_0x1fb2('0x73')](config[_0x1fb2('0x74')],'server/files/images/avatars/',_0x261e4e[_0x1fb2('0x70')]);}}return _0x5c1434[_0x1fb2('0x7b')](_0x2f1536);}})[_0x1fb2('0x26')](handleError(_0x5c1434,null));};exports['getSystemAvatar']=function(_0x499339,_0x525fe3,_0x5e7b2f){var _0x3cb561=path[_0x1fb2('0x73')](config['root'],_0x1fb2('0x82'));var _0xd30334={'where':{'id':_0x499339['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x1fb2('0x3c')][_0x1fb2('0x55')](_0xd30334)[_0x1fb2('0x1d')](handleEntityNotFound(_0x525fe3,null))[_0x1fb2('0x1d')](function(_0x2941d5){if(_0x2941d5){if(!_[_0x1fb2('0x78')](_0x2941d5[_0x1fb2('0x72')])){if(fs[_0x1fb2('0x79')](path[_0x1fb2('0x73')](config[_0x1fb2('0x74')],_0x1fb2('0x7e'),_0x2941d5[_0x1fb2('0x72')]))){_0x3cb561=path[_0x1fb2('0x73')](config[_0x1fb2('0x74')],_0x1fb2('0x7e'),_0x2941d5['systemAvatar']);}}return _0x525fe3[_0x1fb2('0x7b')](_0x3cb561);}})[_0x1fb2('0x26')](handleError(_0x525fe3,null));};exports[_0x1fb2('0x83')]=function(_0x164826,_0x3fa432,_0x43431a){var _0x5adddc=require('user-agent-parser');var _0x332017=new _0x5adddc();var _0x59ffe4=_0x332017[_0x1fb2('0x84')](_0x164826[_0x1fb2('0x85')]['user-agent'])[_0x1fb2('0x86')]();var _0x514026={'body':_0x164826[_0x1fb2('0x5c')],'channel':_0x1fb2('0x87')};var _0xe5daac=[];var _0x21c818=[];var _0x1c7138={};var _0x30d14d=![];return db[_0x1fb2('0x88')][_0x1fb2('0x5e')]()[_0x1fb2('0x1d')](function(_0xa38a92){if(!_0xa38a92){throw new db[(_0x1fb2('0x89'))][(_0x1fb2('0x8a'))]('no\x20available\x20attributes');}_0xe5daac=_[_0x1fb2('0x8b')](_['keys'](_0xa38a92),['createdAt',_0x1fb2('0x8c')]);_0x21c818=_[_0x1fb2('0x8b')](_[_0x1fb2('0x42')](_0xa38a92),[_0x1fb2('0x8d'),_0x1fb2('0x8c'),_0x1fb2('0x8e'),'ListId']);if(_0x164826[_0x1fb2('0x5c')]['id']){delete _0x164826[_0x1fb2('0x5c')]['id'];}if(_['isNil'](_0x164826[_0x1fb2('0x5c')][_0x1fb2('0x8f')])){throw new db['Sequelize'][(_0x1fb2('0x8a'))]('from\x20is\x20mandatory');}if(_[_0x1fb2('0x78')](_0x164826[_0x1fb2('0x5c')][_0x1fb2('0x5c')])||_0x164826['body']['body']===''){throw new db[(_0x1fb2('0x89'))][(_0x1fb2('0x8a'))](_0x1fb2('0x90'));}if(_[_0x1fb2('0x78')](_0x164826[_0x1fb2('0x5c')][_0x1fb2('0x91')])){throw new db['Sequelize'][(_0x1fb2('0x8a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x21c818);}if(!_[_0x1fb2('0x92')](_0x21c818,_0x164826['body'][_0x1fb2('0x91')])){throw new db[(_0x1fb2('0x89'))][(_0x1fb2('0x8a'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x21c818);}_0x1c7138[_0x164826[_0x1fb2('0x5c')][_0x1fb2('0x91')]]=_0x164826[_0x1fb2('0x5c')][_0x1fb2('0x8f')];})[_0x1fb2('0x1d')](function(){return db['ChatWebsite'][_0x1fb2('0x55')]({'where':{'id':_0x164826[_0x1fb2('0x54')]['id']},'include':[{'model':db['CmList'],'as':_0x1fb2('0x93'),'include':[{'model':db[_0x1fb2('0x88')],'as':_0x1fb2('0x94'),'where':_0x1c7138,'limit':0x1,'order':[[_0x1fb2('0x8c'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x1fb2('0x95')}]});})[_0x1fb2('0x1d')](handleEntityNotFound(_0x3fa432,null))[_0x1fb2('0x1d')](function(_0x2eb6c1){if(_0x2eb6c1&&_0x2eb6c1[_0x1fb2('0x93')]){_0x514026[_0x1fb2('0x96')]=_0x2eb6c1;_0x514026[_0x1fb2('0x97')]=_0x2eb6c1[_0x1fb2('0x95')];_0x514026[_0x1fb2('0x98')]=_0x2eb6c1[_0x1fb2('0x93')];_0x514026[_0x1fb2('0x97')]=_[_0x1fb2('0x99')](_0x514026[_0x1fb2('0x97')],['priority'],[_0x1fb2('0x9a')]);if(_0x514026[_0x1fb2('0x96')][_0x1fb2('0x95')]){delete _0x514026[_0x1fb2('0x96')]['Applications'];}if(_0x514026['account'][_0x1fb2('0x93')]&&_0x514026[_0x1fb2('0x96')]['List'][_0x1fb2('0x94')][_0x1fb2('0x47')]){return _0x514026[_0x1fb2('0x96')][_0x1fb2('0x93')]['Contacts'][0x0];}var _0x326fa7=_[_0x1fb2('0x9b')](_0x164826[_0x1fb2('0x5c')],{'firstName':_0x164826['body']['from'],'ListId':_0x2eb6c1[_0x1fb2('0x9c')]});_0x326fa7[_0x164826[_0x1fb2('0x5c')][_0x1fb2('0x91')]]=_0x164826[_0x1fb2('0x5c')]['from'];return db[_0x1fb2('0x88')][_0x1fb2('0x56')](_0x326fa7,{'fields':_0xe5daac,'raw':!![]});}})[_0x1fb2('0x1d')](handleEntityNotFound(_0x3fa432,null))[_0x1fb2('0x1d')](function(_0x20e482){_0x514026['contact']=_0x20e482;var _0x5811f6=_0x164826[_0x1fb2('0x5c')][_0x1fb2('0x9d')];if(_0x164826[_0x1fb2('0x85')][_0x1fb2('0x9e')]){_0x5811f6=_0x164826[_0x1fb2('0x85')][_0x1fb2('0x9e')];}else if(_0x164826['headers'][_0x1fb2('0x9f')]){_0x5811f6=_[_0x1fb2('0xa0')](_0x164826[_0x1fb2('0x85')]['x-forwarded-for'][_0x1fb2('0xa1')](','));}if(_0x20e482){var _0x29d2c3={'ContactId':_0x20e482['id'],'ChatWebsiteId':_0x164826[_0x1fb2('0x54')]['id'],'from':(_0x20e482['firstName']||'')+'\x20'+(_0x20e482['lastName']||''),'customerIp':_0x5811f6,'customerPort':_0x164826['headers'][_0x1fb2('0xa2')]?_0x164826[_0x1fb2('0x85')][_0x1fb2('0xa2')]:null,'referer':_0x164826[_0x1fb2('0x5c')]['referer'],'browserName':_0x59ffe4[_0x1fb2('0xa3')][_0x1fb2('0x36')]&&_0x59ffe4[_0x1fb2('0xa3')][_0x1fb2('0xa4')]?util[_0x1fb2('0xa5')](_0x1fb2('0xa6'),_0x59ffe4[_0x1fb2('0xa3')][_0x1fb2('0x36')],_0x59ffe4[_0x1fb2('0xa3')]['version']):'unknown','browserVersion':_0x59ffe4[_0x1fb2('0xa3')][_0x1fb2('0xa4')]||'unknown','osName':util[_0x1fb2('0xa5')]('%s\x20%s',_0x59ffe4['os'][_0x1fb2('0x36')],_0x59ffe4['os'][_0x1fb2('0xa4')]),'osVersion':_0x59ffe4['os'][_0x1fb2('0xa4')],'deviceModel':_0x59ffe4[_0x1fb2('0xa7')][_0x1fb2('0x40')]&&_0x59ffe4[_0x1fb2('0xa7')][_0x1fb2('0xa8')]?util[_0x1fb2('0xa5')](_0x1fb2('0xa9'),_0x59ffe4['device'][_0x1fb2('0x40')],_0x59ffe4[_0x1fb2('0xa7')][_0x1fb2('0xa8')],_0x59ffe4[_0x1fb2('0xa7')][_0x1fb2('0x3e')]):null,'deviceVendor':_0x59ffe4['device'][_0x1fb2('0xa8')],'deviceType':_0x59ffe4[_0x1fb2('0xa7')][_0x1fb2('0x3e')],'formData':JSON[_0x1fb2('0xaa')](_0x164826[_0x1fb2('0x5c')])};var _0x2c6a2e={'ChatWebsiteId':_0x164826[_0x1fb2('0x54')]['id'],'closed':![]};if(_0x164826[_0x1fb2('0x5c')][_0x1fb2('0xab')]){_0x2c6a2e[_0x1fb2('0xab')]=_0x164826[_0x1fb2('0x5c')]['threadId'];return db[_0x1fb2('0xac')][_0x1fb2('0x55')]({'where':_0x2c6a2e})[_0x1fb2('0x1d')](function(_0x44db34){if(_0x44db34){return[_0x44db34,![]];}_0x29d2c3[_0x1fb2('0xab')]=_0x164826[_0x1fb2('0x5c')][_0x1fb2('0xab')];_0x29d2c3[_0x1fb2('0xad')]=_0x164826['body']['externalUrl'];return db[_0x1fb2('0xac')]['create'](_0x29d2c3)['then'](function(_0x3ceb47){return[_0x3ceb47,!![]];});});}_0x2c6a2e[_0x1fb2('0xae')]=_0x20e482['id'];if(_0x164826[_0x1fb2('0x5c')][_0x1fb2('0xaf')]&&_0x164826['body'][_0x1fb2('0xaf')]['id']){_0x2c6a2e['id']=_0x164826[_0x1fb2('0x5c')][_0x1fb2('0xaf')]['id'];return db[_0x1fb2('0xac')]['find']({'where':_0x2c6a2e})['then'](function(_0x4c2a9d){if(_0x4c2a9d){return[_0x4c2a9d,![]];}return db[_0x1fb2('0xac')]['create'](_0x29d2c3)[_0x1fb2('0x1d')](function(_0x4e008f){return[_0x4e008f,!![]];});});}return db[_0x1fb2('0xac')]['create'](_0x29d2c3)[_0x1fb2('0x1d')](function(_0x32cd21){return[_0x32cd21,!![]];});}})[_0x1fb2('0xb0')](function(_0x3dd789,_0x13a872){if(_0x3dd789){_0x30d14d=_0x13a872;if(!_0x13a872){var _0x526f41={'from':(_0x514026[_0x1fb2('0xb1')][_0x1fb2('0xb2')]||'')+'\x20'+(_0x514026[_0x1fb2('0xb1')][_0x1fb2('0xb3')]||'')};if(_0x164826[_0x1fb2('0x5c')][_0x1fb2('0xab')]&&_0x164826[_0x1fb2('0x5c')][_0x1fb2('0xb4')]&&_0x164826[_0x1fb2('0x5c')][_0x1fb2('0xab')]!=_0x164826[_0x1fb2('0x5c')][_0x1fb2('0xb4')]){_0x526f41[_0x1fb2('0xab')]=_0x164826[_0x1fb2('0x5c')]['messageId'];}return _0x3dd789[_0x1fb2('0x5b')](_0x526f41);}else{return _0x3dd789;}}})[_0x1fb2('0x1d')](function(_0x3f36ee){_0x514026[_0x1fb2('0xaf')]=_0x3f36ee[_0x1fb2('0x31')]({'plain':!![]});_0x514026[_0x1fb2('0xaf')]['created']=_0x30d14d;if(_0x514026[_0x1fb2('0xaf')][_0x1fb2('0xb5')]){if(_0x514026['account'][_0x1fb2('0xb6')]){_0x514026['applications'][_0x1fb2('0xb7')]({'id':0x0,'priority':_0x514026[_0x1fb2('0x97')][_0x1fb2('0x47')]+0x1,'app':_0x1fb2('0xb8'),'appdata':_0x1fb2('0xb9'),'interval':'*,*,*,*'});}}return db[_0x1fb2('0xba')][_0x1fb2('0x56')]({'body':_0x164826[_0x1fb2('0x5c')][_0x1fb2('0x5c')],'ChatWebsiteId':_0x164826[_0x1fb2('0x54')]['id'],'ChatInteractionId':_0x3f36ee['id'],'direction':'in','ContactId':_0x514026[_0x1fb2('0xb1')]['id'],'AttachmentId':_0x164826[_0x1fb2('0x5c')][_0x1fb2('0xbb')]});})[_0x1fb2('0x1d')](function(_0x6c3006){_0x514026[_0x1fb2('0x23')]=_0x6c3006;if(_0x514026[_0x1fb2('0xaf')]['UserId']){return db['User'][_0x1fb2('0x55')]({'attributes':['id',_0x1fb2('0x36')],'where':{'id':_0x514026[_0x1fb2('0xaf')][_0x1fb2('0xbc')]}})[_0x1fb2('0x1d')](function(_0x1e5216){if(_0x1e5216){_0x514026[_0x1fb2('0x97')][_0x1fb2('0xbd')]({'id':0x0,'priority':0x0,'app':_0x1fb2('0xbe'),'appdata':_0x1e5216[_0x1fb2('0x36')]+','+(_0x514026[_0x1fb2('0x96')][_0x1fb2('0xbf')]||0xa),'interval':_0x1fb2('0xc0')});_0x514026[_0x1fb2('0xc1')]=!![];}return respondWithRpcPromise(_0x1fb2('0xc2'),_0x1fb2('0xc3'),_0x514026);});}return respondWithRpcPromise('Start',_0x1fb2('0xc3'),_0x514026);})[_0x1fb2('0x1d')](function(_0x3f4a87){respondWithRpcPromise(_0x1fb2('0xc4'),_0x1fb2('0xc4'),{'event':_0x1fb2('0x83'),'message':_0x3f4a87},client9002);return _0x3f4a87;})[_0x1fb2('0x1d')](respondWithResult(_0x3fa432,null))[_0x1fb2('0x26')](handleError(_0x3fa432,null));};exports[_0x1fb2('0xc5')]=function(_0x5424ea,_0x56401e,_0x2f3276){var _0x4f8082,_0x14a439,_0x430e7c;var _0x106898=[];var _0x34b234=[];var _0x348c70={};var _0x18bf7c=_0x5424ea[_0x1fb2('0xc6')]||[];return db[_0x1fb2('0x88')][_0x1fb2('0x5e')]()[_0x1fb2('0x1d')](function(_0x3ed7c8){if(!_0x3ed7c8){throw new db[(_0x1fb2('0x89'))][(_0x1fb2('0x8a'))]('no\x20available\x20attributes');}_0x34b234=_['difference'](_['keys'](_0x3ed7c8),[_0x1fb2('0x8d'),_0x1fb2('0x8c')]);_0x106898=_[_0x1fb2('0x8b')](_[_0x1fb2('0x42')](_0x3ed7c8),[_0x1fb2('0x8d'),'updatedAt',_0x1fb2('0x8e'),_0x1fb2('0x9c')]);if(_0x5424ea[_0x1fb2('0x5c')]['id']){delete _0x5424ea['body']['id'];}if(_['isNil'](_0x5424ea['body'][_0x1fb2('0x8f')])||_[_0x1fb2('0x78')](_0x5424ea['body'][_0x1fb2('0x5c')][_0x1fb2('0xc7')])){throw _0x56401e[_0x1fb2('0x27')](0x1f4)[_0x1fb2('0x37')](new db[(_0x1fb2('0x89'))][(_0x1fb2('0x8a'))](_0x1fb2('0xc8')));}if(_['isNil'](_0x5424ea[_0x1fb2('0x5c')]['body'])||_0x5424ea[_0x1fb2('0x5c')]['body']===''||(_['isNil'](_0x5424ea[_0x1fb2('0x5c')][_0x1fb2('0x5c')][_0x1fb2('0xc9')])||_0x5424ea[_0x1fb2('0x5c')][_0x1fb2('0x5c')][_0x1fb2('0xc9')]==='')){throw _0x56401e[_0x1fb2('0x27')](0x1f4)[_0x1fb2('0x37')](new db[(_0x1fb2('0x89'))][(_0x1fb2('0x8a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x1fb2('0x78')](_0x5424ea[_0x1fb2('0x5c')][_0x1fb2('0xca')])){throw _0x56401e[_0x1fb2('0x27')](0x1f4)[_0x1fb2('0x37')](new db['Sequelize'][(_0x1fb2('0x8a'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x106898));}if(!_[_0x1fb2('0x92')](_0x106898,_0x5424ea[_0x1fb2('0x5c')]['mapKeyOffline'])){throw _0x56401e[_0x1fb2('0x27')](0x1f4)[_0x1fb2('0x37')](new db[(_0x1fb2('0x89'))][(_0x1fb2('0x8a'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x106898));}_0x348c70[_0x5424ea[_0x1fb2('0x5c')][_0x1fb2('0xca')]]=_0x5424ea['body'][_0x1fb2('0x8f')];})['then'](function(){return db[_0x1fb2('0x3c')][_0x1fb2('0x55')]({'where':{'id':_0x5424ea[_0x1fb2('0x54')]['id']},'include':[{'model':db[_0x1fb2('0xcb')],'as':_0x1fb2('0x93')},{'model':db['MailAccount'],'as':_0x1fb2('0xcc')}]});})[_0x1fb2('0x1d')](handleEntityNotFound(_0x56401e,null))[_0x1fb2('0x1d')](function(_0x31fa41){if(_0x31fa41&&_0x31fa41[_0x1fb2('0x93')]){_0x14a439=_0x31fa41;var _0x3c51d1=_['defaults'](_0x5424ea['body'],{'firstName':_0x5424ea[_0x1fb2('0x5c')][_0x1fb2('0x8f')],'phone':_0x5424ea['body'][_0x1fb2('0x8f')],'ListId':_0x31fa41[_0x1fb2('0x9c')]});_0x3c51d1[_0x5424ea['body']['mapKeyOffline']]=_0x5424ea[_0x1fb2('0x5c')][_0x1fb2('0x8f')];return db[_0x1fb2('0x88')][_0x1fb2('0xcd')]({'where':_0x348c70,'defaults':_0x3c51d1});}})[_0x1fb2('0xb0')](function(_0x1b4bde){if(_0x1b4bde){_0x430e7c=_0x1b4bde;var _0x3fed69=fs[_0x1fb2('0xce')](path[_0x1fb2('0x73')](config['root'],_0x1fb2('0xcf')),_0x1fb2('0xd0'));var _0x2b29a1=ejs[_0x1fb2('0xd1')](_0x3fed69,{'body':_[_0x1fb2('0xd2')](_0x5424ea[_0x1fb2('0x5c')][_0x1fb2('0x5c')]),'bodyTitle':_0x14a439[_0x1fb2('0xd3')]});return db[_0x1fb2('0xd4')][_0x1fb2('0x56')]({'body':_0x2b29a1,'ContactId':_0x1b4bde['id'],'ChatWebsiteId':_0x14a439['id']});}})['then'](function(_0x56120d){if(!_[_0x1fb2('0x78')](_0x5424ea[_0x1fb2('0xc6')])){var _0x4c190d=_0x18bf7c['map'](function(_0xb283d5){return{'name':_0xb283d5[_0x1fb2('0xd5')],'basename':_0xb283d5['filename'],'type':_0xb283d5[_0x1fb2('0xd6')],'ChatOfflineMessageId':_0x56120d['id']};});db['Attachment'][_0x1fb2('0xd7')](_0x4c190d)[_0x1fb2('0xd8')];}return _0x56120d;})[_0x1fb2('0x1d')](function(_0x2903be){if(_0x2903be){_0x4f8082=_0x2903be;return db[_0x1fb2('0xcc')][_0x1fb2('0x62')]({'where':{'service':!![]},'include':[{'model':db[_0x1fb2('0xd9')],'as':'Smtp','raw':!![]}]});}})[_0x1fb2('0x1d')](function(_0x2aa924){if(_0x2aa924&&_0x2aa924['Smtp']&&_0x14a439['forwardOffline']&&_0x14a439['forwardOfflineAddress']){var _0x38ee9d={'tls':{'rejectUnauthorized':![]}};if(_0x2aa924['Smtp'][_0x1fb2('0xda')]){_0x38ee9d['service']=_0x2aa924['Smtp']['service'];}else{_0x38ee9d[_0x1fb2('0xdb')]=_0x2aa924[_0x1fb2('0xdc')]['host'];_0x38ee9d[_0x1fb2('0xdd')]=_0x2aa924['Smtp']['port'];_0x38ee9d[_0x1fb2('0xde')]=_0x2aa924[_0x1fb2('0xdc')]['secure'];}if(_0x2aa924[_0x1fb2('0xdc')][_0x1fb2('0xdf')]){_0x38ee9d['auth']={'user':_0x2aa924[_0x1fb2('0xdc')]['user'],'pass':_0x2aa924[_0x1fb2('0xdc')]['pass']};}return respondWithRpcPromise(_0x1fb2('0xe0'),_0x1fb2('0xe1'),{'account':_0x38ee9d,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x2aa924[_0x1fb2('0x36')],_0x2aa924[_0x1fb2('0xc7')]||_0x2aa924[_0x1fb2('0xdc')][_0x1fb2('0x57')]),'to':_0x14a439[_0x1fb2('0xe2')],'subject':_0x14a439[_0x1fb2('0xe3')],'text':_0x4f8082[_0x1fb2('0x5c')],'attachments':!_[_0x1fb2('0x78')](_0x5424ea[_0x1fb2('0xc6')])?_0x18bf7c:[]}},client9003)[_0x1fb2('0x1d')](function(){return _0x4f8082;})[_0x1fb2('0x26')](function(_0x2a8552){console[_0x1fb2('0x22')](_0x2a8552);});}})[_0x1fb2('0x1d')](function(){if(_0x14a439&&_0x14a439['openNewInteraction']&&_0x14a439[_0x1fb2('0xe4')]){var _0x49f366={'from':_0x430e7c['email'],'firstName':_0x430e7c[_0x1fb2('0xb2')],'lastName':_0x430e7c[_0x1fb2('0xb3')],'mapKey':_0x1fb2('0xc7'),'message':{'from':_0x430e7c['email'],'to':_0x14a439[_0x1fb2('0xcc')][_0x1fb2('0xc7')],'cc':'','subject':_0x14a439[_0x1fb2('0xe3')],'messageId':'','sentAt':new Date(),'attach':!_[_0x1fb2('0x78')](_0x5424ea[_0x1fb2('0xc6')]),'attachments':!_['isNil'](_0x5424ea[_0x1fb2('0xc6')])?_0x18bf7c:[],'originChannel':_0x1fb2('0xe5'),'ChatWebsiteId':_0x14a439['id'],'ChatOfflineMessageId':_0x4f8082['id'],'originTo':_0x14a439[_0x1fb2('0xcc')][_0x1fb2('0xc7')]},'body':_0x4f8082[_0x1fb2('0x5c')]};var _0x418b1e={'account':{'id':_0x14a439['MailAccountId']},'body':_0x49f366,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x1fb2('0xe6'),_0x1fb2('0xe7'),_0x418b1e,client9001)['then'](function(){return _0x4f8082;})[_0x1fb2('0x26')](function(_0x3b5e31){console[_0x1fb2('0x22')](_0x3b5e31);});}return;})[_0x1fb2('0x1d')](function(){if(_0x4f8082){return _0x4f8082;}})[_0x1fb2('0x1d')](respondWithResult(_0x56401e,null))[_0x1fb2('0x26')](function(_0x38664c){console[_0x1fb2('0x22')]('catch',_0x38664c);for(var _0x30a070 of _0x18bf7c){var _0x11c684=path[_0x1fb2('0x73')](config['root'],_0x1fb2('0xc6'),_0x1fb2('0xe8'),_0x1fb2('0xe9'),_0x30a070['filename']);fs_extra[_0x1fb2('0xea')](_0x11c684)[_0x1fb2('0x26')](function(_0x2cfbfe){console[_0x1fb2('0x22')](_0x1fb2('0xeb'),_0x11c684,_0x2cfbfe);});}});};exports[_0x1fb2('0xec')]=function(_0x5906d6,_0x256500,_0x33e809){return db['ChatInteraction'][_0x1fb2('0x55')]({'where':{'id':_0x5906d6[_0x1fb2('0x54')]['id']}})[_0x1fb2('0x1d')](handleEntityNotFound(_0x256500,null))[_0x1fb2('0x1d')](function(_0x3709dc){if(_0x3709dc){return _0x3709dc[_0x1fb2('0xec')](_0x5906d6[_0x1fb2('0x5c')][_0x1fb2('0x66')],_[_0x1fb2('0xed')](_0x5906d6[_0x1fb2('0x5c')],[_0x1fb2('0x66'),'id'])||{});}})[_0x1fb2('0x1d')](respondWithResult(_0x256500,null))['catch'](handleError(_0x256500,null));};exports['getInteractions']=function(_0x16ba05,_0x4cc19d,_0xd9672d){var _0x45dd45={'raw':![],'where':{}};var _0x3826a9={};var _0x4e828d={'count':0x0,'rows':[]};return db[_0x1fb2('0x3c')][_0x1fb2('0x62')]({'where':{'id':_0x16ba05['params']['id']}})[_0x1fb2('0x1d')](handleEntityNotFound(_0x4cc19d,null))[_0x1fb2('0x1d')](function(_0x6d7ef2){if(_0x6d7ef2){_0x3826a9[_0x1fb2('0x40')]=_[_0x1fb2('0x42')](db['ChatInteraction'][_0x1fb2('0x63')]);_0x3826a9['query']=_[_0x1fb2('0x42')](_0x16ba05['query']);_0x3826a9['filters']=_[_0x1fb2('0x44')](_0x3826a9[_0x1fb2('0x40')],_0x3826a9[_0x1fb2('0x41')]);_0x45dd45['attributes']=_[_0x1fb2('0x44')](_0x3826a9['model'],qs[_0x1fb2('0x46')](_0x16ba05[_0x1fb2('0x41')][_0x1fb2('0x46')]));_0x45dd45[_0x1fb2('0x45')]=_0x45dd45[_0x1fb2('0x45')][_0x1fb2('0x47')]?_0x45dd45[_0x1fb2('0x45')]:_0x3826a9[_0x1fb2('0x40')];if(!_0x16ba05[_0x1fb2('0x41')][_0x1fb2('0x48')](_0x1fb2('0x49'))){_0x45dd45[_0x1fb2('0x2c')]=qs['limit'](_0x16ba05[_0x1fb2('0x41')][_0x1fb2('0x2c')]);_0x45dd45[_0x1fb2('0x2b')]=qs[_0x1fb2('0x2b')](_0x16ba05[_0x1fb2('0x41')]['offset']);}_0x45dd45[_0x1fb2('0x64')]=qs[_0x1fb2('0x4a')](_0x16ba05[_0x1fb2('0x41')][_0x1fb2('0x4a')]);_0x45dd45[_0x1fb2('0x4b')]=qs[_0x1fb2('0x43')](_[_0x1fb2('0x4c')](_0x16ba05[_0x1fb2('0x41')],_0x3826a9[_0x1fb2('0x43')]));_0x45dd45['where']['ChatWebsiteId']=_0x6d7ef2['id'];if(_0x16ba05[_0x1fb2('0x41')][_0x1fb2('0x4d')]){_0x45dd45[_0x1fb2('0x4b')]=_[_0x1fb2('0x4e')](_0x45dd45[_0x1fb2('0x4b')],{'$or':_[_0x1fb2('0x3b')](_0x45dd45['attributes'],function(_0x1f2cab){var _0x30ef2e={};_0x30ef2e[_0x1f2cab]={'$like':'%'+_0x16ba05[_0x1fb2('0x41')]['filter']+'%'};return _0x30ef2e;})});}_0x45dd45=_[_0x1fb2('0x4e')]({},_0x45dd45,_0x16ba05['options']);return db['ChatInteraction'][_0x1fb2('0x2a')]({'where':_0x45dd45[_0x1fb2('0x4b')]})['then'](function(_0x5493fb){_0x4e828d[_0x1fb2('0x2a')]=_0x5493fb;if(_0x16ba05['query'][_0x1fb2('0x50')]){_0x45dd45['include']=[{'model':db[_0x1fb2('0x88')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x1fb2('0x36'),_0x1fb2('0xee'),_0x1fb2('0xef')],'required':![]},{'model':db[_0x1fb2('0xf0')],'as':_0x1fb2('0xf1'),'attributes':['id','name',_0x1fb2('0xf2')],'where':_0x16ba05['query'][_0x1fb2('0xf3')]?{'id':_0x16ba05[_0x1fb2('0x41')][_0x1fb2('0xf3')]}:undefined,'required':_0x16ba05[_0x1fb2('0x41')][_0x1fb2('0xf3')]?!![]:![]}];}return db[_0x1fb2('0xac')][_0x1fb2('0x52')](_0x45dd45);})[_0x1fb2('0x1d')](function(_0x9cee5c){_0x4e828d['rows']=_0x9cee5c;return _0x4e828d;});}})[_0x1fb2('0x1d')](respondWithFilteredResult(_0x4cc19d,_0x45dd45))[_0x1fb2('0x26')](handleError(_0x4cc19d,null));};function iftimePromise(_0x774cb5,_0x11f3d2){return respondWithRpcPromise('Command',_0x1fb2('0xf4'),{'command':_0x11f3d2[_0x1fb2('0xf5')]?util['format']('iftime\x20%s,%s',_0x774cb5[_0x1fb2('0xf6')],_0x11f3d2[_0x1fb2('0xf5')]):util[_0x1fb2('0xa5')](_0x1fb2('0xf7'),_0x774cb5['interval'])},client9002)['then'](function(_0x2c1401){var _0x14490e=_0x2c1401&&_0x2c1401['indexOf'](_0x1fb2('0xf8'))>=0x0?!![]:![];logger[_0x1fb2('0x1e')](_0x1fb2('0xf9'),_0x11f3d2['id'],_0x774cb5['id'],_0x774cb5['interval'],_0x14490e?_0x1fb2('0xfa'):'OFFLINE',_0x11f3d2[_0x1fb2('0xf5')]?_0x11f3d2['timezone']:_0x1fb2('0xfb'));return _0x14490e;})['catch'](function(_0x4c41eb){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x11f3d2['id'],_0x774cb5['id'],_0x774cb5[_0x1fb2('0xf6')],util['inspect'](_0x4c41eb,{'showHidden':![],'depth':null}),_0x11f3d2['timezone']?_0x11f3d2['timezone']:_0x1fb2('0xfb'));return![];});}exports[_0x1fb2('0xf4')]=function(_0x4427f3,_0x51c20c,_0x5e52d4){var _0x453bc1=0x0;var _0x47cc31=0x0;var _0x40ce22=![];var _0x2a4fe5;var _0x27994c;return db[_0x1fb2('0x3c')][_0x1fb2('0x55')]({'where':{'id':_0x4427f3[_0x1fb2('0x54')]['id']},'include':[{'model':db['Interval'],'as':_0x1fb2('0xfc'),'include':[{'model':db[_0x1fb2('0xfc')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0x1fb2('0x1d')](handleEntityNotFound(_0x51c20c,null))[_0x1fb2('0x1d')](function(_0x4147c8){if(_0x4147c8){_0x2a4fe5=_0x4147c8;return _0x4147c8['getProactiveActions']({'raw':!![]});}})[_0x1fb2('0x1d')](function(_0x5f4bfb){if(_0x2a4fe5){if(_0x5f4bfb){_0x27994c=_0x5f4bfb;}}return require(_0x1fb2('0xfd'))['getLicense']();})[_0x1fb2('0x1d')](function(_0x4116f9){if(_0x4116f9){_0x47cc31=_0x4116f9['virtual'];_0x40ce22=_0x4116f9[_0x1fb2('0x77')];}})[_0x1fb2('0x1d')](function(){return db[_0x1fb2('0xac')][_0x1fb2('0x2a')]({'where':{'closed':![]}});})[_0x1fb2('0x1d')](function(_0x364b2d){_0x453bc1=_0x364b2d;if(_0x47cc31&&_0x364b2d>_0x47cc31){return db['License'][_0x1fb2('0x62')]({'where':{'id':0x1}})[_0x1fb2('0x1d')](function(_0x196129){if(_0x196129){_0x196129['increment'](_0x1fb2('0xfe'));}});}})[_0x1fb2('0x1d')](function(){if(_0x2a4fe5[_0x1fb2('0xfc')]&&_0x2a4fe5[_0x1fb2('0xfc')][_0x1fb2('0xff')]){var _0x150069=[];for(var _0xaae17b=0x0;_0xaae17b<_0x2a4fe5[_0x1fb2('0xfc')][_0x1fb2('0xff')]['length'];_0xaae17b++){var _0x4e8bb1=_0x2a4fe5[_0x1fb2('0xfc')][_0x1fb2('0xff')][_0xaae17b][_0x1fb2('0x31')]({'plain':!![]});_0x150069['push'](iftimePromise(_0x4e8bb1,_0x2a4fe5));}return BPromise[_0x1fb2('0x100')](_0x150069)[_0x1fb2('0x1d')](function(_0x41e1a2){return _[_0x1fb2('0x101')](_0x41e1a2);});}else{return!![];}})[_0x1fb2('0x1d')](function(_0x3d72bf){var _0x4e4d06=fs[_0x1fb2('0xce')](path[_0x1fb2('0x73')](config[_0x1fb2('0x74')],_0x1fb2('0x102')),'utf8');var _0x254c76={'remote':_0x2a4fe5[_0x1fb2('0x103')],'query':querystring['stringify'](_[_0x1fb2('0x4e')](_0x2a4fe5[_0x1fb2('0x31')]({'plain':!![]}),{'customerIp':_0x4427f3[_0x1fb2('0x85')][_0x1fb2('0x9f')]||_0x4427f3[_0x1fb2('0x85')]['x-real-ip']||_0x4427f3[_0x1fb2('0x104')][_0x1fb2('0x105')]||_0x4427f3['ip'],'referer':_0x4427f3[_0x1fb2('0x85')][_0x1fb2('0x106')],'openedInteractions':_0x453bc1,'maxInteractions':_0x47cc31,'virtual':_0x40ce22['virtual'],'online':_0x3d72bf,'custom':_0x40ce22}))[_0x1fb2('0x107')](/'/g,'\x5c\x27')};_0x51c20c[_0x1fb2('0x37')](ejs[_0x1fb2('0xd1')](Mustache[_0x1fb2('0xd1')](_0x4e4d06,_0x254c76),{'proactiveActions':_0x27994c,'alignment':_0x2a4fe5[_0x1fb2('0x108')],'verticalAlignment':_0x2a4fe5['verticalAlignment'],'div_color':_0x2a4fe5[_0x1fb2('0xf2')],'text_color':_0x2a4fe5['textColor'],'button_color':_0x2a4fe5[_0x1fb2('0x109')],'background_color':_0x2a4fe5['backgroundColor']}));})[_0x1fb2('0x26')](handleError(_0x51c20c,null));};exports[_0x1fb2('0x10a')]=function(_0x5ba168,_0x430435,_0x15c6ae){return db[_0x1fb2('0x3c')][_0x1fb2('0x62')]({'where':{'id':_0x5ba168[_0x1fb2('0x54')]['id']}})['then'](handleEntityNotFound(_0x430435,null))[_0x1fb2('0x1d')](function(_0x168e8a){if(_0x168e8a){return db[_0x1fb2('0x10b')]['transaction'](function(_0xc84ddb){return db['ChatApplication'][_0x1fb2('0x5d')]({'where':{'ChatWebsiteId':_0x5ba168[_0x1fb2('0x54')]['id']},'transaction':_0xc84ddb})[_0x1fb2('0x1d')](function(_0x2e7267){var _0x480a18=_[_0x1fb2('0x3b')](_0x5ba168['body'],function(_0x34c981){_0x34c981[_0x1fb2('0x5f')]=_0x5ba168[_0x1fb2('0x54')]['id'];return _0x34c981;});return db[_0x1fb2('0x10c')][_0x1fb2('0xd7')](_0x480a18,{'transaction':_0xc84ddb});});})[_0x1fb2('0x1d')](function(){return db['ChatApplication'][_0x1fb2('0x10d')]({'where':{'ChatWebsiteId':_0x5ba168[_0x1fb2('0x54')]['id']},'order':_0x1fb2('0x10e')});});}})[_0x1fb2('0x1d')](respondWithResult(_0x430435,null))['catch'](handleError(_0x430435,null));};exports[_0x1fb2('0x10f')]=function(_0x509f2d,_0x2724b7,_0x30d4f8){var _0x2e543c={};var _0x77675e={};var _0x33c134;var _0x416bec;return db[_0x1fb2('0x3c')][_0x1fb2('0x62')]({'where':{'id':_0x509f2d[_0x1fb2('0x54')]['id']}})['then'](handleEntityNotFound(_0x2724b7,null))['then'](function(_0x104cda){if(_0x104cda){_0x33c134=_0x104cda;_0x77675e[_0x1fb2('0x40')]=_[_0x1fb2('0x42')](db[_0x1fb2('0x10c')]['rawAttributes']);_0x77675e['query']=_[_0x1fb2('0x42')](_0x509f2d[_0x1fb2('0x41')]);_0x77675e[_0x1fb2('0x43')]=_[_0x1fb2('0x44')](_0x77675e[_0x1fb2('0x40')],_0x77675e[_0x1fb2('0x41')]);_0x2e543c[_0x1fb2('0x45')]=_[_0x1fb2('0x44')](_0x77675e[_0x1fb2('0x40')],qs['fields'](_0x509f2d[_0x1fb2('0x41')][_0x1fb2('0x46')]));_0x2e543c[_0x1fb2('0x45')]=_0x2e543c[_0x1fb2('0x45')][_0x1fb2('0x47')]?_0x2e543c[_0x1fb2('0x45')]:_0x77675e[_0x1fb2('0x40')];_0x2e543c[_0x1fb2('0x64')]=qs[_0x1fb2('0x4a')](_0x509f2d['query'][_0x1fb2('0x4a')]);_0x2e543c[_0x1fb2('0x4b')]=qs[_0x1fb2('0x43')](_[_0x1fb2('0x4c')](_0x509f2d[_0x1fb2('0x41')],_0x77675e['filters']));if(_0x509f2d[_0x1fb2('0x41')][_0x1fb2('0x4d')]){_0x2e543c[_0x1fb2('0x4b')]=_[_0x1fb2('0x4e')](_0x2e543c['where'],{'$or':_[_0x1fb2('0x3b')](_0x2e543c[_0x1fb2('0x45')],function(_0x26e8ce){var _0x5cefc2={};_0x5cefc2[_0x26e8ce]={'$like':'%'+_0x509f2d[_0x1fb2('0x41')][_0x1fb2('0x4d')]+'%'};return _0x5cefc2;})});}_0x2e543c=_[_0x1fb2('0x4e')]({},_0x2e543c,_0x509f2d[_0x1fb2('0x4f')]);return _0x33c134[_0x1fb2('0x10f')](_0x2e543c);}})['then'](function(_0x392821){if(_0x392821){_0x416bec=_0x392821['length'];if(!_0x509f2d[_0x1fb2('0x41')][_0x1fb2('0x48')](_0x1fb2('0x49'))){_0x2e543c[_0x1fb2('0x2c')]=qs[_0x1fb2('0x2c')](_0x509f2d['query'][_0x1fb2('0x2c')]);_0x2e543c[_0x1fb2('0x2b')]=qs[_0x1fb2('0x2b')](_0x509f2d[_0x1fb2('0x41')][_0x1fb2('0x2b')]);}return _0x33c134[_0x1fb2('0x10f')](_0x2e543c);}})[_0x1fb2('0x1d')](function(_0x2e298b){if(_0x2e298b){return _0x2e298b?{'count':_0x416bec,'rows':_0x2e298b}:null;}})['then'](respondWithResult(_0x2724b7,null))[_0x1fb2('0x26')](handleError(_0x2724b7,null));};exports[_0x1fb2('0x110')]=function(_0x140dd4,_0xe371b8,_0x477171){return db['chatProactiveAction'][_0x1fb2('0x55')]({'where':{'id':_0x140dd4[_0x1fb2('0x54')]['id']}})['then'](handleEntityNotFound(_0xe371b8,null))[_0x1fb2('0x1d')](function(_0x3d078d){if(_0x3d078d){return _0x3d078d['addProactiveActions'](_0x140dd4[_0x1fb2('0x5c')][_0x1fb2('0x66')],_[_0x1fb2('0xed')](_0x140dd4[_0x1fb2('0x5c')],[_0x1fb2('0x66'),'id'])||{});}})[_0x1fb2('0x1d')](respondWithResult(_0xe371b8,null))[_0x1fb2('0x26')](handleError(_0xe371b8,null));};exports[_0x1fb2('0x111')]=function(_0x258c8c,_0x458ced,_0x2336c0){var _0x197e15={};var _0x13a1ec={};var _0xe5a3f7;var _0x4af29b;return db[_0x1fb2('0x3c')][_0x1fb2('0x62')]({'where':{'id':_0x258c8c[_0x1fb2('0x54')]['id']}})['then'](handleEntityNotFound(_0x458ced,null))[_0x1fb2('0x1d')](function(_0x106f57){if(_0x106f57){_0xe5a3f7=_0x106f57;_0x13a1ec[_0x1fb2('0x40')]=_[_0x1fb2('0x42')](db[_0x1fb2('0x112')][_0x1fb2('0x63')]);_0x13a1ec[_0x1fb2('0x41')]=_[_0x1fb2('0x42')](_0x258c8c[_0x1fb2('0x41')]);_0x13a1ec[_0x1fb2('0x43')]=_['intersection'](_0x13a1ec[_0x1fb2('0x40')],_0x13a1ec['query']);_0x197e15['attributes']=_[_0x1fb2('0x44')](_0x13a1ec[_0x1fb2('0x40')],qs[_0x1fb2('0x46')](_0x258c8c[_0x1fb2('0x41')][_0x1fb2('0x46')]));_0x197e15[_0x1fb2('0x45')]=_0x197e15[_0x1fb2('0x45')][_0x1fb2('0x47')]?_0x197e15[_0x1fb2('0x45')]:_0x13a1ec[_0x1fb2('0x40')];_0x197e15[_0x1fb2('0x64')]=qs[_0x1fb2('0x4a')](_0x258c8c[_0x1fb2('0x41')][_0x1fb2('0x4a')]);_0x197e15[_0x1fb2('0x4b')]=qs['filters'](_['pick'](_0x258c8c[_0x1fb2('0x41')],_0x13a1ec[_0x1fb2('0x43')]));if(_0x258c8c[_0x1fb2('0x41')]['filter']){_0x197e15[_0x1fb2('0x4b')]=_['merge'](_0x197e15[_0x1fb2('0x4b')],{'$or':_[_0x1fb2('0x3b')](_0x197e15['attributes'],function(_0x4e4518){var _0x1bd12c={};_0x1bd12c[_0x4e4518]={'$like':'%'+_0x258c8c[_0x1fb2('0x41')]['filter']+'%'};return _0x1bd12c;})});}_0x197e15=_[_0x1fb2('0x4e')]({},_0x197e15,_0x258c8c[_0x1fb2('0x4f')]);return _0xe5a3f7[_0x1fb2('0x111')](_0x197e15);}})[_0x1fb2('0x1d')](function(_0x4da589){if(_0x4da589){_0x4af29b=_0x4da589[_0x1fb2('0x47')];if(!_0x258c8c[_0x1fb2('0x41')][_0x1fb2('0x48')](_0x1fb2('0x49'))){_0x197e15[_0x1fb2('0x2c')]=qs[_0x1fb2('0x2c')](_0x258c8c[_0x1fb2('0x41')][_0x1fb2('0x2c')]);_0x197e15[_0x1fb2('0x2b')]=qs[_0x1fb2('0x2b')](_0x258c8c[_0x1fb2('0x41')]['offset']);}return _0xe5a3f7['getProactiveActions'](_0x197e15);}})[_0x1fb2('0x1d')](function(_0x10ca9d){if(_0x10ca9d){return _0x10ca9d?{'count':_0x4af29b,'rows':_0x10ca9d}:null;}})['then'](respondWithResult(_0x458ced,null))['catch'](handleError(_0x458ced,null));};exports[_0x1fb2('0x113')]=function(_0x39348c,_0xdc270,_0x4e1239){var _0x3848b3=_0x39348c[_0x1fb2('0x41')][_0x1fb2('0x114')]===_0x1fb2('0x115')?_0x1fb2('0x116'):_0x1fb2('0x117');return db[_0x1fb2('0x3c')]['find']({'attributes':['id',_0x3848b3],'where':{'id':_0x39348c[_0x1fb2('0x54')]['id']}})[_0x1fb2('0x1d')](handleEntityNotFound(_0xdc270,null))[_0x1fb2('0x1d')](function(_0xc80913){if(_0xc80913){var _0x29bff5=_0xc80913[_0x3848b3];var _0x13559d=_0x29bff5&&_0x29bff5[_0x1fb2('0x118')]?_0x29bff5[_0x1fb2('0x118')]:[];_0xdc270[_0x1fb2('0x37')]({'fromKey':_[_0x1fb2('0x78')](_0x29bff5[_0x1fb2('0x119')])?undefined:_0x29bff5[_0x1fb2('0x119')],'count':_0x13559d['length'],'rows':_0x13559d});}})['catch'](handleError(_0xdc270,null));};exports['getOfflineMessages']=function(_0x47f4a5,_0x268b93,_0x564c54){var _0x42c351={'raw':![],'where':{}};var _0x4e6f98={};var _0x3bcc11={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x47f4a5[_0x1fb2('0x54')]['id']}})[_0x1fb2('0x1d')](handleEntityNotFound(_0x268b93,null))[_0x1fb2('0x1d')](function(_0x3499b0){if(_0x3499b0){_0x4e6f98['model']=_[_0x1fb2('0x42')](db[_0x1fb2('0xd4')][_0x1fb2('0x63')]);_0x4e6f98[_0x1fb2('0x41')]=_[_0x1fb2('0x42')](_0x47f4a5[_0x1fb2('0x41')]);_0x4e6f98[_0x1fb2('0x43')]=_[_0x1fb2('0x44')](_0x4e6f98['model'],_0x4e6f98['query']);_0x42c351[_0x1fb2('0x45')]=_['intersection'](_0x4e6f98[_0x1fb2('0x40')],qs['fields'](_0x47f4a5[_0x1fb2('0x41')][_0x1fb2('0x46')]));_0x42c351[_0x1fb2('0x45')]=_0x42c351[_0x1fb2('0x45')][_0x1fb2('0x47')]?_0x42c351[_0x1fb2('0x45')]:_0x4e6f98[_0x1fb2('0x40')];if(!_0x47f4a5[_0x1fb2('0x41')][_0x1fb2('0x48')](_0x1fb2('0x49'))){_0x42c351[_0x1fb2('0x2c')]=qs['limit'](_0x47f4a5['query'][_0x1fb2('0x2c')]);_0x42c351[_0x1fb2('0x2b')]=qs[_0x1fb2('0x2b')](_0x47f4a5[_0x1fb2('0x41')][_0x1fb2('0x2b')]);}_0x42c351[_0x1fb2('0x64')]=qs[_0x1fb2('0x4a')](_0x47f4a5[_0x1fb2('0x41')][_0x1fb2('0x4a')]);_0x42c351[_0x1fb2('0x4b')]=qs[_0x1fb2('0x43')](_['pick'](_0x47f4a5['query'],_0x4e6f98[_0x1fb2('0x43')]));_0x42c351[_0x1fb2('0x4b')][_0x1fb2('0x5f')]=_0x3499b0['id'];if(_0x47f4a5[_0x1fb2('0x41')][_0x1fb2('0x4d')]){_0x42c351['where']=_[_0x1fb2('0x4e')](_0x42c351[_0x1fb2('0x4b')],{'$or':_[_0x1fb2('0x3b')](_0x42c351[_0x1fb2('0x45')],function(_0x4a7523){var _0x58c8f6={};_0x58c8f6[_0x4a7523]={'$like':'%'+_0x47f4a5[_0x1fb2('0x41')][_0x1fb2('0x4d')]+'%'};return _0x58c8f6;})});}_0x42c351=_[_0x1fb2('0x4e')]({},_0x42c351,_0x47f4a5[_0x1fb2('0x4f')]);return db[_0x1fb2('0xd4')][_0x1fb2('0x2a')]({'where':_0x42c351[_0x1fb2('0x4b')]})['then'](function(_0x37fb91){_0x3bcc11[_0x1fb2('0x2a')]=_0x37fb91;if(_0x47f4a5[_0x1fb2('0x41')][_0x1fb2('0x50')]){_0x42c351[_0x1fb2('0x51')]=[{'all':!![]}];}else{_0x42c351[_0x1fb2('0x51')]=[{'model':db[_0x1fb2('0x88')],'as':_0x1fb2('0x11a'),'required':![]},{'model':db[_0x1fb2('0x11b')],'as':_0x1fb2('0x11c'),'required':![]}];}return db[_0x1fb2('0xd4')][_0x1fb2('0x52')](_0x42c351);})[_0x1fb2('0x1d')](function(_0x22fe56){_0x3bcc11[_0x1fb2('0x11d')]=_0x22fe56;return _0x3bcc11;});}})[_0x1fb2('0x1d')](respondWithFilteredResult(_0x268b93,_0x42c351))['catch'](handleError(_0x268b93,null));};exports['addAgents']=function(_0x2b0d82,_0x111a98,_0x5368e4){return db[_0x1fb2('0x3c')][_0x1fb2('0x55')]({'where':{'id':_0x2b0d82[_0x1fb2('0x54')]['id']}})[_0x1fb2('0x1d')](handleEntityNotFound(_0x111a98,null))[_0x1fb2('0x1d')](function(_0x5e3e6c){if(_0x5e3e6c){return _0x5e3e6c[_0x1fb2('0x11e')](_0x2b0d82[_0x1fb2('0x5c')]['ids'],_[_0x1fb2('0xed')](_0x2b0d82['body'],[_0x1fb2('0x66'),'id'])||{})[_0x1fb2('0xb0')](function(_0x157a56){for(var _0x5c3492=0x0;_0x5c3492<_0x2b0d82['body'][_0x1fb2('0x66')][_0x1fb2('0x47')];_0x5c3492+=0x1){socket[_0x1fb2('0x11f')](_0x1fb2('0x120'),{'UserId':_0x2b0d82[_0x1fb2('0x5c')][_0x1fb2('0x66')][_0x5c3492],'ChatWebsiteId':_0x2b0d82[_0x1fb2('0x54')]['id']});}return _0x157a56;});}})[_0x1fb2('0x1d')](respondWithResult(_0x111a98,null))[_0x1fb2('0x26')](handleError(_0x111a98,null));};exports[_0x1fb2('0x121')]=function(_0x42eecb,_0x4c3613,_0xc83ae9){return db[_0x1fb2('0x3c')]['find']({'where':{'id':_0x42eecb[_0x1fb2('0x54')]['id']}})[_0x1fb2('0x1d')](handleEntityNotFound(_0x4c3613,null))[_0x1fb2('0x1d')](function(_0x1a5653){if(_0x1a5653){return _0x1a5653[_0x1fb2('0x121')](_0x42eecb[_0x1fb2('0x41')][_0x1fb2('0x66')])[_0x1fb2('0x1d')](function(){if(_[_0x1fb2('0x122')](_0x42eecb[_0x1fb2('0x41')][_0x1fb2('0x66')])){for(var _0x5d0b21=0x0;_0x5d0b21<_0x42eecb['query']['ids'][_0x1fb2('0x47')];_0x5d0b21+=0x1){socket['emit'](_0x1fb2('0x123'),{'UserId':Number(_0x42eecb[_0x1fb2('0x41')][_0x1fb2('0x66')][_0x5d0b21]),'ChatWebsiteId':Number(_0x42eecb[_0x1fb2('0x54')]['id'])});}}else{socket[_0x1fb2('0x11f')](_0x1fb2('0x123'),{'UserId':Number(_0x42eecb[_0x1fb2('0x41')][_0x1fb2('0x66')]),'ChatWebsiteId':Number(_0x42eecb[_0x1fb2('0x54')]['id'])});}});}})[_0x1fb2('0x1d')](respondWithStatusCode(_0x4c3613,null))[_0x1fb2('0x26')](handleError(_0x4c3613,null));};exports['getAgents']=function(_0x429d4c,_0x479566,_0x599abe){var _0x3ea25f={};var _0x4028f4={};var _0x9ae01b;var _0x2af4cb;return db[_0x1fb2('0x3c')][_0x1fb2('0x62')]({'where':{'id':_0x429d4c[_0x1fb2('0x54')]['id']}})[_0x1fb2('0x1d')](handleEntityNotFound(_0x479566,null))[_0x1fb2('0x1d')](function(_0x2bdf2e){if(_0x2bdf2e){_0x9ae01b=_0x2bdf2e;_0x4028f4[_0x1fb2('0x40')]=_[_0x1fb2('0x42')](db[_0x1fb2('0x124')][_0x1fb2('0x63')]);_0x4028f4[_0x1fb2('0x41')]=_[_0x1fb2('0x42')](_0x429d4c['query']);_0x4028f4[_0x1fb2('0x43')]=_['intersection'](_0x4028f4['model'],_0x4028f4['query']);_0x3ea25f[_0x1fb2('0x45')]=_['intersection'](_0x4028f4[_0x1fb2('0x40')],qs['fields'](_0x429d4c[_0x1fb2('0x41')]['fields']));_0x3ea25f[_0x1fb2('0x45')]=_0x3ea25f[_0x1fb2('0x45')][_0x1fb2('0x47')]?_0x3ea25f[_0x1fb2('0x45')]:_0x4028f4[_0x1fb2('0x40')];_0x3ea25f[_0x1fb2('0x64')]=qs[_0x1fb2('0x4a')](_0x429d4c[_0x1fb2('0x41')][_0x1fb2('0x4a')]);_0x3ea25f[_0x1fb2('0x4b')]=qs[_0x1fb2('0x43')](_[_0x1fb2('0x4c')](_0x429d4c[_0x1fb2('0x41')],_0x4028f4[_0x1fb2('0x43')]));if(_0x429d4c[_0x1fb2('0x41')]['filter']){_0x3ea25f[_0x1fb2('0x4b')]=_['merge'](_0x3ea25f[_0x1fb2('0x4b')],{'$or':_[_0x1fb2('0x3b')](_0x3ea25f[_0x1fb2('0x45')],function(_0x4f1bd4){var _0x2132d3={};_0x2132d3[_0x4f1bd4]={'$like':'%'+_0x429d4c[_0x1fb2('0x41')][_0x1fb2('0x4d')]+'%'};return _0x2132d3;})});}_0x3ea25f=_[_0x1fb2('0x4e')]({},_0x3ea25f,_0x429d4c[_0x1fb2('0x4f')]);return _0x9ae01b[_0x1fb2('0x125')](_0x3ea25f);}})[_0x1fb2('0x1d')](function(_0x5ddedc){if(_0x5ddedc){_0x2af4cb=_0x5ddedc[_0x1fb2('0x47')];if(!_0x429d4c['query'][_0x1fb2('0x48')](_0x1fb2('0x49'))){_0x3ea25f['limit']=qs[_0x1fb2('0x2c')](_0x429d4c[_0x1fb2('0x41')][_0x1fb2('0x2c')]);_0x3ea25f[_0x1fb2('0x2b')]=qs[_0x1fb2('0x2b')](_0x429d4c['query'][_0x1fb2('0x2b')]);}return _0x9ae01b[_0x1fb2('0x125')](_0x3ea25f);}})['then'](function(_0xaf6a72){if(_0xaf6a72){return _0xaf6a72?{'count':_0x2af4cb,'rows':_0xaf6a72}:null;}})['then'](respondWithResult(_0x479566,null))[_0x1fb2('0x26')](handleError(_0x479566,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index bc69cd5..32ed2d0 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 _0x6666=['remove','emit','hasOwnProperty','hook','exports','events','update'];(function(_0x510520,_0x4c3134){var _0x17cff0=function(_0x2d3325){while(--_0x2d3325){_0x510520['push'](_0x510520['shift']());}};_0x17cff0(++_0x4c3134);}(_0x6666,0x6e));var _0x6666=function(_0x120123,_0x4eff59){_0x120123=_0x120123-0x0;var _0x3bec4c=_0x6666[_0x120123];return _0x3bec4c;};'use strict';var EventEmitter=require(_0x6666('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6666('0x1'),'afterDestroy':_0x6666('0x2')};function emitEvent(_0x589a1e){return function(_0x5ad3be,_0x3ecd6f,_0x1428db){ChatWebsiteEvents[_0x6666('0x3')](_0x589a1e+':'+_0x5ad3be['id'],_0x5ad3be);ChatWebsiteEvents[_0x6666('0x3')](_0x589a1e,_0x5ad3be);_0x1428db(null);};}for(var e in events){if(events[_0x6666('0x4')](e)){var event=events[e];ChatWebsite[_0x6666('0x5')](e,emitEvent(event));}}module[_0x6666('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xc576=['hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','emit'];(function(_0x3a9e6e,_0x2d4a75){var _0x7b4ead=function(_0x544e02){while(--_0x544e02){_0x3a9e6e['push'](_0x3a9e6e['shift']());}};_0x7b4ead(++_0x2d4a75);}(_0xc576,0x1ea));var _0x6c57=function(_0x30cc1a,_0x162bbc){_0x30cc1a=_0x30cc1a-0x0;var _0xb3f18f=_0xc576[_0x30cc1a];return _0xb3f18f;};'use strict';var EventEmitter=require(_0x6c57('0x0'));var ChatWebsite=require(_0x6c57('0x1'))['db'][_0x6c57('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x6c57('0x3')](0x0);var events={'afterCreate':_0x6c57('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x10a252){return function(_0x4e5df7,_0x31ab9f,_0x23861f){ChatWebsiteEvents['emit'](_0x10a252+':'+_0x4e5df7['id'],_0x4e5df7);ChatWebsiteEvents[_0x6c57('0x5')](_0x10a252,_0x4e5df7);_0x23861f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x6c57('0x6')](e,emitEvent(event));}}module[_0x6c57('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 36dd7c8..9beb3b8 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 _0x93e6=['api','bluebird','path','rimraf','../../config/environment','exports','lodash'];(function(_0x1eaacc,_0x3ee3f8){var _0x119d75=function(_0x3fea8e){while(--_0x3fea8e){_0x1eaacc['push'](_0x1eaacc['shift']());}};_0x119d75(++_0x3ee3f8);}(_0x93e6,0x11e));var _0x693e=function(_0xf6bb70,_0x3b21a1){_0xf6bb70=_0xf6bb70-0x0;var _0x46ed1d=_0x93e6[_0xf6bb70];return _0x46ed1d;};'use strict';var _=require(_0x693e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x693e('0x1'));var moment=require('moment');var BPromise=require(_0x693e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x693e('0x3'));var rimraf=require(_0x693e('0x4'));var config=require(_0x693e('0x5'));var attributes=require('./chatWebsite.attributes');module[_0x693e('0x6')]=function(_0x388eb6,_0x2569a4){return _0x388eb6['define']('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd3d1=['../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x295a92,_0x7d70dc){var _0x3f5dac=function(_0x47b9e8){while(--_0x47b9e8){_0x295a92['push'](_0x295a92['shift']());}};_0x3f5dac(++_0x7d70dc);}(_0xd3d1,0x172));var _0x1d3d=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xd3d1[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1d3d('0x2'));var BPromise=require(_0x1d3d('0x3'));var rp=require(_0x1d3d('0x4'));var fs=require('fs');var path=require(_0x1d3d('0x5'));var rimraf=require(_0x1d3d('0x6'));var config=require(_0x1d3d('0x7'));var attributes=require(_0x1d3d('0x8'));module[_0x1d3d('0x9')]=function(_0x1cbe06,_0x449475){return _0x1cbe06[_0x1d3d('0xa')](_0x1d3d('0xb'),attributes,{'tableName':_0x1d3d('0xc'),'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 2061c7c..d36dddf 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 _0xd943=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','localhost','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x4bacde,_0x410a91){var _0x40cfc7=function(_0x2e0213){while(--_0x2e0213){_0x4bacde['push'](_0x4bacde['shift']());}};_0x40cfc7(++_0x410a91);}(_0xd943,0x15d));var _0x3d94=function(_0x2240ca,_0x3e3146){_0x2240ca=_0x2240ca-0x0;var _0x169dfa=_0xd943[_0x2240ca];return _0x169dfa;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x3d94('0xa')],{'host':_0x3d94('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3d94('0xc'))[_0x3d94('0xd')](socket);function respondWithRpcPromise(_0x1cc58c,_0x5908a7,_0x182066){return new BPromise(function(_0x4ac968,_0x39e2fa){return client[_0x3d94('0xe')](_0x1cc58c,_0x182066)['then'](function(_0x1897de){logger[_0x3d94('0xf')](_0x3d94('0x10'),_0x5908a7,_0x3d94('0x11'));logger[_0x3d94('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5908a7,_0x3d94('0x11'),JSON[_0x3d94('0x13')](_0x1897de));if(_0x1897de[_0x3d94('0x14')]){if(_0x1897de['error'][_0x3d94('0x15')]===0x1f4){logger[_0x3d94('0x14')](_0x3d94('0x10'),_0x5908a7,_0x1897de['error'][_0x3d94('0x16')]);return _0x39e2fa(_0x1897de[_0x3d94('0x14')][_0x3d94('0x16')]);}logger[_0x3d94('0x14')](_0x3d94('0x10'),_0x5908a7,_0x1897de[_0x3d94('0x14')][_0x3d94('0x16')]);return _0x4ac968(_0x1897de[_0x3d94('0x14')]['message']);}else{logger[_0x3d94('0xf')](_0x3d94('0x10'),_0x5908a7,_0x3d94('0x11'));_0x4ac968(_0x1897de[_0x3d94('0x17')][_0x3d94('0x16')]);}})[_0x3d94('0x18')](function(_0xef8b3){logger['error'](_0x3d94('0x10'),_0x5908a7,_0xef8b3);_0x39e2fa(_0xef8b3);});});}
\ No newline at end of file
+var _0x896e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x52bff2,_0x2ea2a8){var _0x25574e=function(_0x3dc63b){while(--_0x3dc63b){_0x52bff2['push'](_0x52bff2['shift']());}};_0x25574e(++_0x2ea2a8);}(_0x896e,0x1e9));var _0xe896=function(_0x301a6b,_0x48274b){_0x301a6b=_0x301a6b-0x0;var _0x11d969=_0x896e[_0x301a6b];return _0x11d969;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});config[_0xe896('0xd')]=_[_0xe896('0xe')](config[_0xe896('0xd')],{'host':_0xe896('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe896('0xd')]));require(_0xe896('0x10'))[_0xe896('0x11')](socket);function respondWithRpcPromise(_0x4afd3f,_0x305616,_0x48251e){return new BPromise(function(_0x45b15b,_0x5be679){return client[_0xe896('0x12')](_0x4afd3f,_0x48251e)[_0xe896('0x13')](function(_0xa00ae9){logger['info'](_0xe896('0x14'),_0x305616,_0xe896('0x15'));logger[_0xe896('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x305616,_0xe896('0x15'),JSON[_0xe896('0x17')](_0xa00ae9));if(_0xa00ae9[_0xe896('0x18')]){if(_0xa00ae9['error'][_0xe896('0x19')]===0x1f4){logger[_0xe896('0x18')](_0xe896('0x14'),_0x305616,_0xa00ae9['error']['message']);return _0x5be679(_0xa00ae9[_0xe896('0x18')][_0xe896('0x1a')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x305616,_0xa00ae9[_0xe896('0x18')][_0xe896('0x1a')]);return _0x45b15b(_0xa00ae9['error'][_0xe896('0x1a')]);}else{logger['info'](_0xe896('0x14'),_0x305616,_0xe896('0x15'));_0x45b15b(_0xa00ae9[_0xe896('0x1b')]['message']);}})[_0xe896('0x1c')](function(_0x9714f1){logger[_0xe896('0x18')](_0xe896('0x14'),_0x305616,_0x9714f1);_0x5be679(_0x9714f1);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 6486a08..aefc0af 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 _0xb10b=['emit','removeListener','register','chatWebsite:','./chatWebsite.events','remove','update'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0xb10b,0x12a));var _0xbb10=function(_0x4c7c4a,_0x520920){_0x4c7c4a=_0x4c7c4a-0x0;var _0x4d78ae=_0xb10b[_0x4c7c4a];return _0x4d78ae;};'use strict';var ChatWebsiteEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatWebsiteEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatWebsiteEvents['on'](_0x1b9e94,_0x3fb675);}};
\ No newline at end of file
+var _0x7a54=['remove','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0xc0c89a,_0x1a93ce){var _0x2de380=function(_0x429851){while(--_0x429851){_0xc0c89a['push'](_0xc0c89a['shift']());}};_0x2de380(++_0x1a93ce);}(_0x7a54,0x106));var _0x47a5=function(_0x18347b,_0xb0e425){_0x18347b=_0x18347b-0x0;var _0x5646a0=_0x7a54[_0x18347b];return _0x5646a0;};'use strict';var ChatWebsiteEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){ChatWebsiteEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);ChatWebsiteEvents['on'](_0x30e405,_0x506eda);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 257e9bb..28d0c5e 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 _0x1f92=['getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','addLogo','server/files/images/avatars/','single','file','addAvatar','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','offline-chat','ensureDir','replace','extname','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','put','update','delete','destroy','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions'];(function(_0x7083a2,_0x5cc787){var _0x3d42aa=function(_0x1f691d){while(--_0x1f691d){_0x7083a2['push'](_0x7083a2['shift']());}};_0x3d42aa(++_0x5cc787);}(_0x1f92,0x1ad));var _0x21f9=function(_0x5510f8,_0x5be0f3){_0x5510f8=_0x5510f8-0x0;var _0x43637e=_0x1f92[_0x5510f8];return _0x43637e;};'use strict';var multer=require(_0x21f9('0x0'));var util=require('util');var path=require(_0x21f9('0x1'));var timeout=require(_0x21f9('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x21f9('0x3'));var auth=require(_0x21f9('0x4'));var interaction=require(_0x21f9('0x5'));var config=require(_0x21f9('0x6'));var controller=require(_0x21f9('0x7'));router[_0x21f9('0x8')]('/',auth[_0x21f9('0x9')](),controller[_0x21f9('0xa')]);router[_0x21f9('0x8')](_0x21f9('0xb'),auth[_0x21f9('0x9')](),controller[_0x21f9('0xc')]);router['get'](_0x21f9('0xd'),auth[_0x21f9('0x9')](),controller[_0x21f9('0xe')]);router['get']('/:id/dispositions',auth[_0x21f9('0x9')](),controller[_0x21f9('0xf')]);router['get'](_0x21f9('0x10'),auth[_0x21f9('0x9')](),controller[_0x21f9('0x11')]);router[_0x21f9('0x8')](_0x21f9('0x12'),controller[_0x21f9('0x13')]);router[_0x21f9('0x8')](_0x21f9('0x14'),controller[_0x21f9('0x15')]);router['get']('/:id/customer_avatar',controller[_0x21f9('0x16')]);router['get'](_0x21f9('0x17'),controller[_0x21f9('0x18')]);router[_0x21f9('0x8')](_0x21f9('0x19'),auth[_0x21f9('0x9')](),controller[_0x21f9('0x1a')]);router[_0x21f9('0x8')]('/:id/snippet',controller[_0x21f9('0x1b')]);router[_0x21f9('0x8')](_0x21f9('0x1c'),auth[_0x21f9('0x9')](),controller[_0x21f9('0x1d')]);router[_0x21f9('0x8')](_0x21f9('0x1e'),auth[_0x21f9('0x9')](),controller[_0x21f9('0x1f')]);router[_0x21f9('0x8')](_0x21f9('0x20'),controller[_0x21f9('0x21')]);router[_0x21f9('0x8')](_0x21f9('0x22'),auth[_0x21f9('0x9')](),controller[_0x21f9('0x23')]);router[_0x21f9('0x8')](_0x21f9('0x24'),auth[_0x21f9('0x9')](),controller['getAgents']);router[_0x21f9('0x25')]('/',auth[_0x21f9('0x9')](),controller[_0x21f9('0x26')]);router['post']('/:id/dispositions',auth[_0x21f9('0x9')](),controller[_0x21f9('0x27')]);router[_0x21f9('0x25')]('/:id/canned_answers',auth[_0x21f9('0x9')](),controller[_0x21f9('0x28')]);var upload=multer({'storage':multer[_0x21f9('0x29')]({'destination':function(_0x4fab42,_0x3af2f9,_0x3d8104){_0x3d8104(null,path[_0x21f9('0x2a')](config[_0x21f9('0x2b')],_0x21f9('0x2c')));},'filename':function(_0x3bff9d,_0x48d725,_0x18e259){_0x18e259(null,util[_0x21f9('0x2d')](_0x21f9('0x2e'),Date[_0x21f9('0x2f')](),_0x48d725[_0x21f9('0x30')]));}})});router[_0x21f9('0x25')](_0x21f9('0x12'),upload['single']('file'),controller[_0x21f9('0x31')]);var upload=multer({'storage':multer[_0x21f9('0x29')]({'destination':function(_0x4a451b,_0x5a2767,_0x4527e4){_0x4527e4(null,path[_0x21f9('0x2a')](config[_0x21f9('0x2b')],_0x21f9('0x32')));},'filename':function(_0x59ccec,_0x45e579,_0x5f4b31){_0x5f4b31(null,util[_0x21f9('0x2d')](_0x21f9('0x2e'),Date[_0x21f9('0x2f')](),_0x45e579[_0x21f9('0x30')]));}})});router[_0x21f9('0x25')](_0x21f9('0x14'),upload[_0x21f9('0x33')](_0x21f9('0x34')),controller[_0x21f9('0x35')]);var upload=multer({'storage':multer[_0x21f9('0x29')]({'destination':function(_0x5b2471,_0x538d1c,_0x28eadc){_0x28eadc(null,path[_0x21f9('0x2a')](config[_0x21f9('0x2b')],_0x21f9('0x32')));},'filename':function(_0x44b97c,_0x568e9f,_0x4f19cc){_0x4f19cc(null,util[_0x21f9('0x2d')]('%s-%s',Date[_0x21f9('0x2f')](),_0x568e9f[_0x21f9('0x30')]));}})});router['post'](_0x21f9('0x36'),upload[_0x21f9('0x33')]('file'),controller[_0x21f9('0x37')]);var upload=multer({'storage':multer[_0x21f9('0x29')]({'destination':function(_0x468947,_0x308a3f,_0x10a44c){_0x10a44c(null,path[_0x21f9('0x2a')](config['root'],_0x21f9('0x32')));},'filename':function(_0x508a4c,_0xd31bee,_0x53474b){_0x53474b(null,util[_0x21f9('0x2d')]('%s-%s',Date[_0x21f9('0x2f')](),_0xd31bee[_0x21f9('0x30')]));}})});router[_0x21f9('0x25')](_0x21f9('0x17'),upload[_0x21f9('0x33')](_0x21f9('0x34')),controller[_0x21f9('0x38')]);router[_0x21f9('0x25')](_0x21f9('0x39'),controller[_0x21f9('0x3a')]);const offlineUploadMulter=multer({'storage':multer[_0x21f9('0x29')]({'destination':function(_0x5d5e78,_0x1fcce8,_0x3303ad){const _0x327f18=path['join'](config[_0x21f9('0x2b')],'server/files','attachments',_0x21f9('0x3b'));fs_extra[_0x21f9('0x3c')](_0x327f18,function(){_0x3303ad(null,_0x327f18);});},'filename':function(_0x1463d9,_0x267523,_0x33173e){const _0x2275d4=_0x267523['originalname'][_0x21f9('0x3d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4a8e07=path[_0x21f9('0x3e')](_0x2275d4);const _0xe9d3e4=Date[_0x21f9('0x2f')]()+'-'+_0x2275d4['replace'](_0x4a8e07,'')+_0x4a8e07;_0x33173e(null,_0xe9d3e4);}})});router[_0x21f9('0x25')](_0x21f9('0x3f'),offlineUploadMulter['any'](),controller[_0x21f9('0x40')]);router[_0x21f9('0x25')](_0x21f9('0x19'),auth[_0x21f9('0x9')](),controller[_0x21f9('0x41')]);router[_0x21f9('0x25')](_0x21f9('0x1c'),auth[_0x21f9('0x9')](),controller[_0x21f9('0x42')]);router[_0x21f9('0x25')]('/:id/proactive_actions',auth[_0x21f9('0x9')](),controller[_0x21f9('0x43')]);router['post'](_0x21f9('0x24'),auth['isAuthenticated'](),controller['addAgents']);router[_0x21f9('0x44')](_0x21f9('0xd'),auth[_0x21f9('0x9')](),controller[_0x21f9('0x45')]);router[_0x21f9('0x46')](_0x21f9('0xd'),auth[_0x21f9('0x9')](),controller[_0x21f9('0x47')]);router[_0x21f9('0x46')](_0x21f9('0x48'),auth[_0x21f9('0x9')](),controller[_0x21f9('0x49')]);router[_0x21f9('0x46')](_0x21f9('0x10'),auth[_0x21f9('0x9')](),controller[_0x21f9('0x4a')]);router[_0x21f9('0x46')](_0x21f9('0x24'),auth['isAuthenticated'](),controller[_0x21f9('0x4b')]);module['exports']=router;
\ No newline at end of file
+var _0xd117=['./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/logo','/:id/avatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getOfflineMessages','/:id/users','getAgents','post','/:id/canned_answers','addAnswer','diskStorage','root','%s-%s','now','originalname','single','file','format','addAvatar','server/files/images/avatars/','notify','join','server/files','offline-chat','replace','/:id/offline','any','offline','addInteraction','addApplications','addAgents','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xd117,0x182));var _0x7d11=function(_0xcfcbaa,_0x369d95){_0xcfcbaa=_0xcfcbaa-0x0;var _0x157ed0=_0xd117[_0xcfcbaa];return _0x157ed0;};'use strict';var multer=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var path=require(_0x7d11('0x2'));var timeout=require(_0x7d11('0x3'));var express=require(_0x7d11('0x4'));var router=express[_0x7d11('0x5')]();var fs_extra=require(_0x7d11('0x6'));var auth=require(_0x7d11('0x7'));var interaction=require(_0x7d11('0x8'));var config=require(_0x7d11('0x9'));var controller=require(_0x7d11('0xa'));router[_0x7d11('0xb')]('/',auth[_0x7d11('0xc')](),controller[_0x7d11('0xd')]);router[_0x7d11('0xb')](_0x7d11('0xe'),auth['isAuthenticated'](),controller[_0x7d11('0xf')]);router[_0x7d11('0xb')](_0x7d11('0x10'),auth['isAuthenticated'](),controller[_0x7d11('0x11')]);router[_0x7d11('0xb')](_0x7d11('0x12'),auth['isAuthenticated'](),controller[_0x7d11('0x13')]);router['get']('/:id/canned_answers',auth[_0x7d11('0xc')](),controller['getAnswers']);router['get'](_0x7d11('0x14'),controller['getLogo']);router[_0x7d11('0xb')](_0x7d11('0x15'),controller['getAvatar']);router[_0x7d11('0xb')](_0x7d11('0x16'),controller['getCustomerAvatar']);router[_0x7d11('0xb')](_0x7d11('0x17'),controller[_0x7d11('0x18')]);router[_0x7d11('0xb')](_0x7d11('0x19'),auth[_0x7d11('0xc')](),controller[_0x7d11('0x1a')]);router[_0x7d11('0xb')]('/:id/snippet',controller[_0x7d11('0x1b')]);router[_0x7d11('0xb')](_0x7d11('0x1c'),auth[_0x7d11('0xc')](),controller[_0x7d11('0x1d')]);router['get'](_0x7d11('0x1e'),auth[_0x7d11('0xc')](),controller['getProactiveActions']);router['get'](_0x7d11('0x1f'),controller['getFields']);router[_0x7d11('0xb')]('/:id/offline_messages',auth[_0x7d11('0xc')](),controller[_0x7d11('0x20')]);router[_0x7d11('0xb')](_0x7d11('0x21'),auth[_0x7d11('0xc')](),controller[_0x7d11('0x22')]);router[_0x7d11('0x23')]('/',auth[_0x7d11('0xc')](),controller['create']);router[_0x7d11('0x23')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0x7d11('0x23')](_0x7d11('0x24'),auth[_0x7d11('0xc')](),controller[_0x7d11('0x25')]);var upload=multer({'storage':multer[_0x7d11('0x26')]({'destination':function(_0xd938df,_0x282e5c,_0x1c1edd){_0x1c1edd(null,path['join'](config[_0x7d11('0x27')],'server/files/images/logos/'));},'filename':function(_0x4bfa76,_0x5126cf,_0x3ba092){_0x3ba092(null,util['format'](_0x7d11('0x28'),Date[_0x7d11('0x29')](),_0x5126cf[_0x7d11('0x2a')]));}})});router['post'](_0x7d11('0x14'),upload[_0x7d11('0x2b')](_0x7d11('0x2c')),controller['addLogo']);var upload=multer({'storage':multer[_0x7d11('0x26')]({'destination':function(_0x35a789,_0x18c049,_0x38f1be){_0x38f1be(null,path['join'](config[_0x7d11('0x27')],'server/files/images/avatars/'));},'filename':function(_0x1bc218,_0x509164,_0x31866d){_0x31866d(null,util[_0x7d11('0x2d')](_0x7d11('0x28'),Date['now'](),_0x509164['originalname']));}})});router[_0x7d11('0x23')](_0x7d11('0x15'),upload['single'](_0x7d11('0x2c')),controller[_0x7d11('0x2e')]);var upload=multer({'storage':multer[_0x7d11('0x26')]({'destination':function(_0x53ec4c,_0x9c6609,_0x553117){_0x553117(null,path['join'](config[_0x7d11('0x27')],'server/files/images/avatars/'));},'filename':function(_0x1d5d4e,_0x38fbd3,_0x34f3b6){_0x34f3b6(null,util[_0x7d11('0x2d')]('%s-%s',Date[_0x7d11('0x29')](),_0x38fbd3[_0x7d11('0x2a')]));}})});router['post']('/:id/customer_avatar',upload[_0x7d11('0x2b')](_0x7d11('0x2c')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x7d11('0x26')]({'destination':function(_0x5ac591,_0x5c0113,_0x1286d6){_0x1286d6(null,path['join'](config['root'],_0x7d11('0x2f')));},'filename':function(_0x30e2fa,_0x1b96d8,_0x2e426b){_0x2e426b(null,util[_0x7d11('0x2d')](_0x7d11('0x28'),Date[_0x7d11('0x29')](),_0x1b96d8[_0x7d11('0x2a')]));}})});router[_0x7d11('0x23')](_0x7d11('0x17'),upload[_0x7d11('0x2b')](_0x7d11('0x2c')),controller['addSystemAvatar']);router[_0x7d11('0x23')]('/:id/notify',controller[_0x7d11('0x30')]);const offlineUploadMulter=multer({'storage':multer[_0x7d11('0x26')]({'destination':function(_0x36be62,_0xa37410,_0x4f8fd2){const _0xd36cd3=path[_0x7d11('0x31')](config[_0x7d11('0x27')],_0x7d11('0x32'),'attachments',_0x7d11('0x33'));fs_extra['ensureDir'](_0xd36cd3,function(){_0x4f8fd2(null,_0xd36cd3);});},'filename':function(_0x2e05e8,_0x4d89c3,_0xede1cc){const _0x622725=_0x4d89c3[_0x7d11('0x2a')][_0x7d11('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x52c28b=path['extname'](_0x622725);const _0x1b24af=Date[_0x7d11('0x29')]()+'-'+_0x622725['replace'](_0x52c28b,'')+_0x52c28b;_0xede1cc(null,_0x1b24af);}})});router[_0x7d11('0x23')](_0x7d11('0x35'),offlineUploadMulter[_0x7d11('0x36')](),controller[_0x7d11('0x37')]);router[_0x7d11('0x23')](_0x7d11('0x19'),auth['isAuthenticated'](),controller[_0x7d11('0x38')]);router['post'](_0x7d11('0x1c'),auth[_0x7d11('0xc')](),controller[_0x7d11('0x39')]);router[_0x7d11('0x23')](_0x7d11('0x1e'),auth[_0x7d11('0xc')](),controller['addProactiveActions']);router['post']('/:id/users',auth[_0x7d11('0xc')](),controller[_0x7d11('0x3a')]);router[_0x7d11('0x3b')](_0x7d11('0x10'),auth[_0x7d11('0xc')](),controller['update']);router[_0x7d11('0x3c')](_0x7d11('0x10'),auth['isAuthenticated'](),controller[_0x7d11('0x3d')]);router[_0x7d11('0x3c')](_0x7d11('0x12'),auth['isAuthenticated'](),controller[_0x7d11('0x3e')]);router[_0x7d11('0x3c')](_0x7d11('0x24'),auth['isAuthenticated'](),controller[_0x7d11('0x3f')]);router['delete'](_0x7d11('0x21'),auth[_0x7d11('0xc')](),controller[_0x7d11('0x40')]);module[_0x7d11('0x41')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index b2a9c9b..1038231 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 _0xdedd=['ENUM','AmazonAWS','sequelize','exports','STRING'];(function(_0x5f18b8,_0x4f28f0){var _0x5b2fd6=function(_0x134030){while(--_0x134030){_0x5f18b8['push'](_0x5f18b8['shift']());}};_0x5b2fd6(++_0x4f28f0);}(_0xdedd,0x197));var _0xdded=function(_0x4def11,_0x1cb80d){_0x4def11=_0x4def11-0x0;var _0x1ebe6d=_0xdedd[_0x4def11];return _0x1ebe6d;};'use strict';var Sequelize=require(_0xdded('0x0'));module[_0xdded('0x1')]={'name':{'type':Sequelize[_0xdded('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xdded('0x3')](_0xdded('0x4'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xdded('0x2')]},'data2':{'type':Sequelize[_0xdded('0x2')]}};
\ No newline at end of file
+var _0xca84=['sequelize','exports','STRING','AmazonAWS','Google'];(function(_0x427b29,_0x248470){var _0x346eb1=function(_0xe0985){while(--_0xe0985){_0x427b29['push'](_0x427b29['shift']());}};_0x346eb1(++_0x248470);}(_0xca84,0xf5));var _0x4ca8=function(_0x57fd67,_0x4a14ba){_0x57fd67=_0x57fd67-0x0;var _0x4a45d1=_0xca84[_0x57fd67];return _0x4a45d1;};'use strict';var Sequelize=require(_0x4ca8('0x0'));module[_0x4ca8('0x1')]={'name':{'type':Sequelize[_0x4ca8('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x4ca8('0x3'),_0x4ca8('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x4ca8('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index dcce7c0..ce022fc 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 _0xb258=['sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','count','offset','limit','status','set','apply','reject','update','then','name','send','map','CloudProvider','rawAttributes','fieldName','type','key','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb258,0x19c));var _0x8b25=function(_0x5bc24a,_0x25bef2){_0x5bc24a=_0x5bc24a-0x0;var _0x147623=_0xb258[_0x5bc24a];return _0x147623;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8b25('0x0'));var rimraf=require(_0x8b25('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8b25('0x2'));var rp=require(_0x8b25('0x3'));var moment=require(_0x8b25('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8b25('0x5'));var util=require(_0x8b25('0x6'));var path=require(_0x8b25('0x7'));var sox=require(_0x8b25('0x8'));var csv=require(_0x8b25('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b25('0xa'));var _=require('lodash');var squel=require(_0x8b25('0xb'));var crypto=require(_0x8b25('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8b25('0xd'));var toCsv=require(_0x8b25('0x9'));var querystring=require(_0x8b25('0xe'));var Papa=require('papaparse');var Redis=require(_0x8b25('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8b25('0x10'));var as=require(_0x8b25('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b25('0x12'))(_0x8b25('0x13'));var utils=require(_0x8b25('0x14'));var config=require(_0x8b25('0x15'));var licenseUtil=require(_0x8b25('0x16'));var db=require(_0x8b25('0x17'))['db'];function respondWithStatusCode(_0x1d0950,_0x552239){_0x552239=_0x552239||0xcc;return function(_0x57ac17){if(_0x57ac17){return _0x1d0950[_0x8b25('0x18')](_0x552239);}return _0x1d0950['status'](_0x552239)[_0x8b25('0x19')]();};}function respondWithResult(_0x1dd2dd,_0x2f7e69){_0x2f7e69=_0x2f7e69||0xc8;return function(_0x25e804){if(_0x25e804){return _0x1dd2dd['status'](_0x2f7e69)['json'](_0x25e804);}};}function respondWithFilteredResult(_0x168296,_0x348a39){return function(_0x17f065){if(_0x17f065){var _0xa8e76a=_0x17f065[_0x8b25('0x1a')],_0x18386b=_0x348a39[_0x8b25('0x1b')],_0x218c4e=_0x348a39[_0x8b25('0x1b')]+_0x348a39[_0x8b25('0x1c')],_0x34de9f;if(_0x218c4e>=_0xa8e76a){_0x218c4e=_0xa8e76a;_0x34de9f=0xc8;}else{_0x34de9f=0xce;}_0x168296[_0x8b25('0x1d')](_0x34de9f);return _0x168296[_0x8b25('0x1e')]('Content-Range',_0x18386b+'-'+_0x218c4e+'/'+_0xa8e76a)['json'](_0x17f065);}return null;};}function patchUpdates(_0x10518d){return function(_0x1558a9){try{jsonpatch[_0x8b25('0x1f')](_0x1558a9,_0x10518d,!![]);}catch(_0x3f79f2){return BPromise[_0x8b25('0x20')](_0x3f79f2);}return _0x1558a9['save']();};}function saveUpdates(_0x5370cf,_0x3ef206){return function(_0x134e72){if(_0x134e72){return _0x134e72[_0x8b25('0x21')](_0x5370cf)['then'](function(_0xb91883){return _0xb91883;});}return null;};}function removeEntity(_0x49de9d,_0x44b5db){return function(_0x172799){if(_0x172799){return _0x172799['destroy']()[_0x8b25('0x22')](function(){_0x49de9d['status'](0xcc)[_0x8b25('0x19')]();});}};}function handleEntityNotFound(_0x45c272,_0x3d314e){return function(_0x13bede){if(!_0x13bede){_0x45c272[_0x8b25('0x18')](0x194);}return _0x13bede;};}function handleError(_0x14bc16,_0x47dd67){_0x47dd67=_0x47dd67||0x1f4;return function(_0x59dc2e){logger['error'](_0x59dc2e['stack']);if(_0x59dc2e[_0x8b25('0x23')]){delete _0x59dc2e[_0x8b25('0x23')];}_0x14bc16[_0x8b25('0x1d')](_0x47dd67)[_0x8b25('0x24')](_0x59dc2e);};}exports['index']=function(_0x427561,_0x1c8a22){var _0x459239={},_0x1dcb12={},_0x2b4814={'count':0x0,'rows':[]};var _0x40abaa=_[_0x8b25('0x25')](db[_0x8b25('0x26')][_0x8b25('0x27')],function(_0x5a706e){return{'name':_0x5a706e[_0x8b25('0x28')],'type':_0x5a706e[_0x8b25('0x29')][_0x8b25('0x2a')]};});_0x1dcb12['model']=_[_0x8b25('0x25')](_0x40abaa,_0x8b25('0x23'));_0x1dcb12['query']=_['keys'](_0x427561['query']);_0x1dcb12[_0x8b25('0x2b')]=_[_0x8b25('0x2c')](_0x1dcb12[_0x8b25('0x2d')],_0x1dcb12['query']);_0x459239[_0x8b25('0x2e')]=_[_0x8b25('0x2c')](_0x1dcb12['model'],qs[_0x8b25('0x2f')](_0x427561[_0x8b25('0x30')][_0x8b25('0x2f')]));_0x459239[_0x8b25('0x2e')]=_0x459239[_0x8b25('0x2e')][_0x8b25('0x31')]?_0x459239[_0x8b25('0x2e')]:_0x1dcb12[_0x8b25('0x2d')];if(!_0x427561[_0x8b25('0x30')][_0x8b25('0x32')](_0x8b25('0x33'))){_0x459239['limit']=qs[_0x8b25('0x1c')](_0x427561[_0x8b25('0x30')][_0x8b25('0x1c')]);_0x459239[_0x8b25('0x1b')]=qs['offset'](_0x427561['query'][_0x8b25('0x1b')]);}_0x459239['order']=qs['sort'](_0x427561[_0x8b25('0x30')][_0x8b25('0x34')]);_0x459239[_0x8b25('0x35')]=qs[_0x8b25('0x2b')](_[_0x8b25('0x36')](_0x427561['query'],_0x1dcb12[_0x8b25('0x2b')]),_0x40abaa);if(_0x427561[_0x8b25('0x30')]['filter']){_0x459239[_0x8b25('0x35')]=_[_0x8b25('0x37')](_0x459239['where'],{'$or':_[_0x8b25('0x25')](_0x40abaa,function(_0x38d269){if(_0x38d269['type']!==_0x8b25('0x38')){var _0x47d1f4={};_0x47d1f4[_0x38d269[_0x8b25('0x23')]]={'$like':'%'+_0x427561[_0x8b25('0x30')][_0x8b25('0x39')]+'%'};return _0x47d1f4;}})});}_0x459239=_[_0x8b25('0x37')]({},_0x459239,_0x427561[_0x8b25('0x3a')]);var _0x394ab0={'where':_0x459239[_0x8b25('0x35')]};return db[_0x8b25('0x26')][_0x8b25('0x1a')](_0x394ab0)['then'](function(_0x384cc7){_0x2b4814['count']=_0x384cc7;if(_0x427561[_0x8b25('0x30')]['includeAll']){_0x459239[_0x8b25('0x3b')]=[{'all':!![]}];}return db[_0x8b25('0x26')][_0x8b25('0x3c')](_0x459239);})[_0x8b25('0x22')](function(_0x5c3afe){_0x2b4814[_0x8b25('0x3d')]=_0x5c3afe;return _0x2b4814;})[_0x8b25('0x22')](respondWithFilteredResult(_0x1c8a22,_0x459239))[_0x8b25('0x3e')](handleError(_0x1c8a22,null));};exports[_0x8b25('0x3f')]=function(_0x4df496,_0x4662f2){var _0x44c8ac={'raw':!![],'where':{'id':_0x4df496[_0x8b25('0x40')]['id']}},_0x255e2f={};_0x255e2f[_0x8b25('0x2d')]=_[_0x8b25('0x41')](db['CloudProvider'][_0x8b25('0x27')]);_0x255e2f['query']=_['keys'](_0x4df496[_0x8b25('0x30')]);_0x255e2f['filters']=_[_0x8b25('0x2c')](_0x255e2f['model'],_0x255e2f['query']);_0x44c8ac[_0x8b25('0x2e')]=_[_0x8b25('0x2c')](_0x255e2f['model'],qs[_0x8b25('0x2f')](_0x4df496[_0x8b25('0x30')][_0x8b25('0x2f')]));_0x44c8ac['attributes']=_0x44c8ac[_0x8b25('0x2e')][_0x8b25('0x31')]?_0x44c8ac['attributes']:_0x255e2f[_0x8b25('0x2d')];if(_0x4df496[_0x8b25('0x30')][_0x8b25('0x42')]){_0x44c8ac[_0x8b25('0x3b')]=[{'all':!![]}];}_0x44c8ac=_[_0x8b25('0x37')]({},_0x44c8ac,_0x4df496[_0x8b25('0x3a')]);return db['CloudProvider'][_0x8b25('0x43')](_0x44c8ac)[_0x8b25('0x22')](handleEntityNotFound(_0x4662f2,null))['then'](respondWithResult(_0x4662f2,null))['catch'](handleError(_0x4662f2,null));};exports[_0x8b25('0x44')]=function(_0x486141,_0x32c711){return db['CloudProvider'][_0x8b25('0x44')](_0x486141[_0x8b25('0x45')],{})['then'](respondWithResult(_0x32c711,0xc9))[_0x8b25('0x3e')](handleError(_0x32c711,null));};exports[_0x8b25('0x21')]=function(_0x15f1a6,_0x592e60){if(_0x15f1a6['body']['id']){delete _0x15f1a6[_0x8b25('0x45')]['id'];}return db[_0x8b25('0x26')][_0x8b25('0x43')]({'where':{'id':_0x15f1a6['params']['id']}})[_0x8b25('0x22')](handleEntityNotFound(_0x592e60,null))['then'](saveUpdates(_0x15f1a6[_0x8b25('0x45')],null))[_0x8b25('0x22')](respondWithResult(_0x592e60,null))[_0x8b25('0x3e')](handleError(_0x592e60,null));};exports['destroy']=function(_0x3e0739,_0x6adae3){return db[_0x8b25('0x26')][_0x8b25('0x43')]({'where':{'id':_0x3e0739[_0x8b25('0x40')]['id']}})[_0x8b25('0x22')](handleEntityNotFound(_0x6adae3,null))[_0x8b25('0x22')](removeEntity(_0x6adae3,null))[_0x8b25('0x3e')](handleError(_0x6adae3,null));};
\ No newline at end of file
+var _0x1f52=['json','count','offset','limit','set','Content-Range','apply','reject','save','then','name','send','index','map','CloudProvider','rawAttributes','fieldName','model','keys','filters','intersection','attributes','fields','query','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','destroy','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0xfece2c,_0x351bf8){var _0x27c70c=function(_0x57c5c1){while(--_0x57c5c1){_0xfece2c['push'](_0xfece2c['shift']());}};_0x27c70c(++_0x351bf8);}(_0x1f52,0x74));var _0x21f5=function(_0x6088d5,_0xfaf001){_0x6088d5=_0x6088d5-0x0;var _0x57160b=_0x1f52[_0x6088d5];return _0x57160b;};'use strict';var pdf=require(_0x21f5('0x0'));var emlformat=require(_0x21f5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x21f5('0x2'));var jsonpatch=require(_0x21f5('0x3'));var rp=require(_0x21f5('0x4'));var moment=require('moment');var BPromise=require(_0x21f5('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x21f5('0x6'));var csv=require(_0x21f5('0x7'));var ejs=require(_0x21f5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x21f5('0x9'));var squel=require('squel');var crypto=require(_0x21f5('0xa'));var jsforce=require(_0x21f5('0xb'));var deskjs=require(_0x21f5('0xc'));var toCsv=require(_0x21f5('0x7'));var querystring=require(_0x21f5('0xd'));var Papa=require(_0x21f5('0xe'));var Redis=require(_0x21f5('0xf'));var authService=require(_0x21f5('0x10'));var qs=require(_0x21f5('0x11'));var as=require(_0x21f5('0x12'));var hardwareService=require(_0x21f5('0x13'));var logger=require('../../config/logger')(_0x21f5('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x21f5('0x15'));var db=require(_0x21f5('0x16'))['db'];function respondWithStatusCode(_0x43fb75,_0x113d6d){_0x113d6d=_0x113d6d||0xcc;return function(_0x9716c3){if(_0x9716c3){return _0x43fb75[_0x21f5('0x17')](_0x113d6d);}return _0x43fb75[_0x21f5('0x18')](_0x113d6d)[_0x21f5('0x19')]();};}function respondWithResult(_0x4bb48e,_0x4493cf){_0x4493cf=_0x4493cf||0xc8;return function(_0x111338){if(_0x111338){return _0x4bb48e[_0x21f5('0x18')](_0x4493cf)[_0x21f5('0x1a')](_0x111338);}};}function respondWithFilteredResult(_0x40f713,_0x43074c){return function(_0x492cec){if(_0x492cec){var _0x7860cf=_0x492cec[_0x21f5('0x1b')],_0x5c2d9d=_0x43074c[_0x21f5('0x1c')],_0x213d6c=_0x43074c[_0x21f5('0x1c')]+_0x43074c[_0x21f5('0x1d')],_0x4fda91;if(_0x213d6c>=_0x7860cf){_0x213d6c=_0x7860cf;_0x4fda91=0xc8;}else{_0x4fda91=0xce;}_0x40f713['status'](_0x4fda91);return _0x40f713[_0x21f5('0x1e')](_0x21f5('0x1f'),_0x5c2d9d+'-'+_0x213d6c+'/'+_0x7860cf)[_0x21f5('0x1a')](_0x492cec);}return null;};}function patchUpdates(_0x5c8e47){return function(_0x1b9bf7){try{jsonpatch[_0x21f5('0x20')](_0x1b9bf7,_0x5c8e47,!![]);}catch(_0x4a24ff){return BPromise[_0x21f5('0x21')](_0x4a24ff);}return _0x1b9bf7[_0x21f5('0x22')]();};}function saveUpdates(_0x1549e4,_0x338218){return function(_0x3b4466){if(_0x3b4466){return _0x3b4466['update'](_0x1549e4)[_0x21f5('0x23')](function(_0x14deb0){return _0x14deb0;});}return null;};}function removeEntity(_0x4feefd,_0x14cc66){return function(_0x4309cf){if(_0x4309cf){return _0x4309cf['destroy']()[_0x21f5('0x23')](function(){_0x4feefd[_0x21f5('0x18')](0xcc)[_0x21f5('0x19')]();});}};}function handleEntityNotFound(_0x9ef1a6,_0x7337d8){return function(_0x102f56){if(!_0x102f56){_0x9ef1a6['sendStatus'](0x194);}return _0x102f56;};}function handleError(_0x2815db,_0x4b8757){_0x4b8757=_0x4b8757||0x1f4;return function(_0x2badc3){logger['error'](_0x2badc3['stack']);if(_0x2badc3[_0x21f5('0x24')]){delete _0x2badc3[_0x21f5('0x24')];}_0x2815db[_0x21f5('0x18')](_0x4b8757)[_0x21f5('0x25')](_0x2badc3);};}exports[_0x21f5('0x26')]=function(_0x5abeea,_0x50776a){var _0x3f4738={},_0x5c2e65={},_0x423362={'count':0x0,'rows':[]};var _0x38288b=_[_0x21f5('0x27')](db[_0x21f5('0x28')][_0x21f5('0x29')],function(_0x4d5348){return{'name':_0x4d5348[_0x21f5('0x2a')],'type':_0x4d5348['type']['key']};});_0x5c2e65[_0x21f5('0x2b')]=_[_0x21f5('0x27')](_0x38288b,_0x21f5('0x24'));_0x5c2e65['query']=_[_0x21f5('0x2c')](_0x5abeea['query']);_0x5c2e65[_0x21f5('0x2d')]=_[_0x21f5('0x2e')](_0x5c2e65[_0x21f5('0x2b')],_0x5c2e65['query']);_0x3f4738[_0x21f5('0x2f')]=_['intersection'](_0x5c2e65[_0x21f5('0x2b')],qs[_0x21f5('0x30')](_0x5abeea[_0x21f5('0x31')][_0x21f5('0x30')]));_0x3f4738[_0x21f5('0x2f')]=_0x3f4738['attributes'][_0x21f5('0x32')]?_0x3f4738[_0x21f5('0x2f')]:_0x5c2e65['model'];if(!_0x5abeea[_0x21f5('0x31')]['hasOwnProperty'](_0x21f5('0x33'))){_0x3f4738[_0x21f5('0x1d')]=qs[_0x21f5('0x1d')](_0x5abeea['query'][_0x21f5('0x1d')]);_0x3f4738[_0x21f5('0x1c')]=qs[_0x21f5('0x1c')](_0x5abeea['query'][_0x21f5('0x1c')]);}_0x3f4738[_0x21f5('0x34')]=qs[_0x21f5('0x35')](_0x5abeea['query'][_0x21f5('0x35')]);_0x3f4738[_0x21f5('0x36')]=qs['filters'](_[_0x21f5('0x37')](_0x5abeea['query'],_0x5c2e65[_0x21f5('0x2d')]),_0x38288b);if(_0x5abeea['query'][_0x21f5('0x38')]){_0x3f4738['where']=_[_0x21f5('0x39')](_0x3f4738[_0x21f5('0x36')],{'$or':_[_0x21f5('0x27')](_0x38288b,function(_0x843571){if(_0x843571[_0x21f5('0x3a')]!==_0x21f5('0x3b')){var _0x22c3eb={};_0x22c3eb[_0x843571[_0x21f5('0x24')]]={'$like':'%'+_0x5abeea[_0x21f5('0x31')][_0x21f5('0x38')]+'%'};return _0x22c3eb;}})});}_0x3f4738=_[_0x21f5('0x39')]({},_0x3f4738,_0x5abeea[_0x21f5('0x3c')]);var _0x284fdb={'where':_0x3f4738[_0x21f5('0x36')]};return db[_0x21f5('0x28')][_0x21f5('0x1b')](_0x284fdb)[_0x21f5('0x23')](function(_0x126d37){_0x423362[_0x21f5('0x1b')]=_0x126d37;if(_0x5abeea[_0x21f5('0x31')][_0x21f5('0x3d')]){_0x3f4738[_0x21f5('0x3e')]=[{'all':!![]}];}return db['CloudProvider'][_0x21f5('0x3f')](_0x3f4738);})[_0x21f5('0x23')](function(_0xc9d00b){_0x423362[_0x21f5('0x40')]=_0xc9d00b;return _0x423362;})['then'](respondWithFilteredResult(_0x50776a,_0x3f4738))[_0x21f5('0x41')](handleError(_0x50776a,null));};exports['show']=function(_0x90ef4,_0x42590a){var _0x11271a={'raw':!![],'where':{'id':_0x90ef4['params']['id']}},_0x13cdff={};_0x13cdff[_0x21f5('0x2b')]=_[_0x21f5('0x2c')](db[_0x21f5('0x28')][_0x21f5('0x29')]);_0x13cdff[_0x21f5('0x31')]=_[_0x21f5('0x2c')](_0x90ef4['query']);_0x13cdff[_0x21f5('0x2d')]=_[_0x21f5('0x2e')](_0x13cdff[_0x21f5('0x2b')],_0x13cdff[_0x21f5('0x31')]);_0x11271a[_0x21f5('0x2f')]=_[_0x21f5('0x2e')](_0x13cdff[_0x21f5('0x2b')],qs[_0x21f5('0x30')](_0x90ef4[_0x21f5('0x31')][_0x21f5('0x30')]));_0x11271a[_0x21f5('0x2f')]=_0x11271a['attributes']['length']?_0x11271a['attributes']:_0x13cdff[_0x21f5('0x2b')];if(_0x90ef4[_0x21f5('0x31')][_0x21f5('0x3d')]){_0x11271a[_0x21f5('0x3e')]=[{'all':!![]}];}_0x11271a=_[_0x21f5('0x39')]({},_0x11271a,_0x90ef4[_0x21f5('0x3c')]);return db[_0x21f5('0x28')][_0x21f5('0x42')](_0x11271a)[_0x21f5('0x23')](handleEntityNotFound(_0x42590a,null))[_0x21f5('0x23')](respondWithResult(_0x42590a,null))[_0x21f5('0x41')](handleError(_0x42590a,null));};exports[_0x21f5('0x43')]=function(_0x2f80c7,_0xa30139){return db['CloudProvider']['create'](_0x2f80c7[_0x21f5('0x44')],{})[_0x21f5('0x23')](respondWithResult(_0xa30139,0xc9))[_0x21f5('0x41')](handleError(_0xa30139,null));};exports['update']=function(_0x44c0d5,_0x4a4693){if(_0x44c0d5[_0x21f5('0x44')]['id']){delete _0x44c0d5['body']['id'];}return db[_0x21f5('0x28')][_0x21f5('0x42')]({'where':{'id':_0x44c0d5['params']['id']}})[_0x21f5('0x23')](handleEntityNotFound(_0x4a4693,null))[_0x21f5('0x23')](saveUpdates(_0x44c0d5[_0x21f5('0x44')],null))[_0x21f5('0x23')](respondWithResult(_0x4a4693,null))[_0x21f5('0x41')](handleError(_0x4a4693,null));};exports[_0x21f5('0x45')]=function(_0x4af98d,_0x41484c){return db['CloudProvider']['find']({'where':{'id':_0x4af98d[_0x21f5('0x46')]['id']}})[_0x21f5('0x23')](handleEntityNotFound(_0x41484c,null))['then'](removeEntity(_0x41484c,null))['catch'](handleError(_0x41484c,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 7913678..55916f3 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 _0x4f54=['../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1a3e8f,_0x8b9906){var _0x314ee8=function(_0x51ceb4){while(--_0x51ceb4){_0x1a3e8f['push'](_0x1a3e8f['shift']());}};_0x314ee8(++_0x8b9906);}(_0x4f54,0x18b));var _0x44f5=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4f54[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x44f5('0x0'));var util=require(_0x44f5('0x1'));var logger=require('../../config/logger')(_0x44f5('0x2'));var moment=require(_0x44f5('0x3'));var BPromise=require(_0x44f5('0x4'));var rp=require(_0x44f5('0x5'));var fs=require('fs');var path=require(_0x44f5('0x6'));var rimraf=require(_0x44f5('0x7'));var config=require(_0x44f5('0x8'));var attributes=require(_0x44f5('0x9'));module[_0x44f5('0xa')]=function(_0x5bc0be,_0x2cf6ad){return _0x5bc0be[_0x44f5('0xb')]('CloudProvider',attributes,{'tableName':_0x44f5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf8a7=['exports','define','CloudProvider','util','api','moment','request-promise','rimraf','./cloudProvider.attributes'];(function(_0x227b64,_0x1c6f72){var _0xc84cb5=function(_0x12e690){while(--_0x12e690){_0x227b64['push'](_0x227b64['shift']());}};_0xc84cb5(++_0x1c6f72);}(_0xf8a7,0x147));var _0x7f8a=function(_0x6b09f6,_0x869c74){_0x6b09f6=_0x6b09f6-0x0;var _0x29903b=_0xf8a7[_0x6b09f6];return _0x29903b;};'use strict';var _=require('lodash');var util=require(_0x7f8a('0x0'));var logger=require('../../config/logger')(_0x7f8a('0x1'));var moment=require(_0x7f8a('0x2'));var BPromise=require('bluebird');var rp=require(_0x7f8a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7f8a('0x4'));var config=require('../../config/environment');var attributes=require(_0x7f8a('0x5'));module[_0x7f8a('0x6')]=function(_0x5de62e,_0x1b8ca9){return _0x5de62e[_0x7f8a('0x7')](_0x7f8a('0x8'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 325975e..ba5a734 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 _0x7aa8=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','CloudProvider,\x20%s,\x20%s','message','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3e78f8,_0xe3a862){var _0x13e073=function(_0x1b4e0c){while(--_0x1b4e0c){_0x3e78f8['push'](_0x3e78f8['shift']());}};_0x13e073(++_0xe3a862);}(_0x7aa8,0x1c7));var _0x87aa=function(_0x6d485d,_0x2c9596){_0x6d485d=_0x6d485d-0x0;var _0x2700fe=_0x7aa8[_0x6d485d];return _0x2700fe;};'use strict';var _=require(_0x87aa('0x0'));var util=require(_0x87aa('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x87aa('0x2'));var db=require(_0x87aa('0x3'))['db'];var utils=require(_0x87aa('0x4'));var logger=require(_0x87aa('0x5'))(_0x87aa('0x6'));var config=require(_0x87aa('0x7'));var jayson=require(_0x87aa('0x8'));var client=jayson[_0x87aa('0x9')][_0x87aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a1bef,_0x1acca9,_0x353920){return new BPromise(function(_0x524da4,_0x3514ee){return client[_0x87aa('0xb')](_0x1a1bef,_0x353920)[_0x87aa('0xc')](function(_0x5c1eda){logger[_0x87aa('0xd')]('CloudProvider,\x20%s,\x20%s',_0x1acca9,_0x87aa('0xe'));logger[_0x87aa('0xf')](_0x87aa('0x10'),_0x1acca9,_0x87aa('0xe'),JSON['stringify'](_0x5c1eda));if(_0x5c1eda['error']){if(_0x5c1eda[_0x87aa('0x11')][_0x87aa('0x12')]===0x1f4){logger['error'](_0x87aa('0x13'),_0x1acca9,_0x5c1eda[_0x87aa('0x11')][_0x87aa('0x14')]);return _0x3514ee(_0x5c1eda[_0x87aa('0x11')][_0x87aa('0x14')]);}logger[_0x87aa('0x11')](_0x87aa('0x13'),_0x1acca9,_0x5c1eda['error']['message']);return _0x524da4(_0x5c1eda['error'][_0x87aa('0x14')]);}else{logger[_0x87aa('0xd')](_0x87aa('0x13'),_0x1acca9,'request\x20sent');_0x524da4(_0x5c1eda['result'][_0x87aa('0x14')]);}})[_0x87aa('0x15')](function(_0x19f1d1){logger[_0x87aa('0x11')](_0x87aa('0x13'),_0x1acca9,_0x19f1d1);_0x3514ee(_0x19f1d1);});});}
\ No newline at end of file
+var _0x31d2=['info','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x3e3c7a,_0x381151){var _0x25436a=function(_0x44f95c){while(--_0x44f95c){_0x3e3c7a['push'](_0x3e3c7a['shift']());}};_0x25436a(++_0x381151);}(_0x31d2,0xe5));var _0x231d=function(_0x25b558,_0x18c669){_0x25b558=_0x25b558-0x0;var _0x3c2769=_0x31d2[_0x25b558];return _0x3c2769;};'use strict';var _=require('lodash');var util=require(_0x231d('0x0'));var moment=require('moment');var BPromise=require(_0x231d('0x1'));var rs=require(_0x231d('0x2'));var fs=require('fs');var Redis=require(_0x231d('0x3'));var db=require(_0x231d('0x4'))['db'];var utils=require(_0x231d('0x5'));var logger=require('../../config/logger')(_0x231d('0x6'));var config=require(_0x231d('0x7'));var jayson=require(_0x231d('0x8'));var client=jayson[_0x231d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f13be,_0x250ed5,_0x295b05){return new BPromise(function(_0x4a543f,_0x2f9190){return client[_0x231d('0xa')](_0x3f13be,_0x295b05)['then'](function(_0x174256){logger[_0x231d('0xb')](_0x231d('0xc'),_0x250ed5,_0x231d('0xd'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x250ed5,_0x231d('0xd'),JSON[_0x231d('0xe')](_0x174256));if(_0x174256['error']){if(_0x174256[_0x231d('0xf')][_0x231d('0x10')]===0x1f4){logger[_0x231d('0xf')](_0x231d('0xc'),_0x250ed5,_0x174256[_0x231d('0xf')][_0x231d('0x11')]);return _0x2f9190(_0x174256[_0x231d('0xf')][_0x231d('0x11')]);}logger[_0x231d('0xf')](_0x231d('0xc'),_0x250ed5,_0x174256['error'][_0x231d('0x11')]);return _0x4a543f(_0x174256[_0x231d('0xf')][_0x231d('0x11')]);}else{logger[_0x231d('0xb')](_0x231d('0xc'),_0x250ed5,_0x231d('0xd'));_0x4a543f(_0x174256[_0x231d('0x12')][_0x231d('0x11')]);}})[_0x231d('0x13')](function(_0x213710){logger[_0x231d('0xf')]('CloudProvider,\x20%s,\x20%s',_0x250ed5,_0x213710);_0x2f9190(_0x213710);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 53dc35b..7b279d7 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 _0x426a=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x426a,0x6b));var _0xa426=function(_0x497871,_0x3b4377){_0x497871=_0x497871-0x0;var _0x317904=_0x426a[_0x497871];return _0x317904;};'use strict';var multer=require(_0xa426('0x0'));var util=require(_0xa426('0x1'));var path=require(_0xa426('0x2'));var timeout=require(_0xa426('0x3'));var express=require(_0xa426('0x4'));var router=express['Router']();var fs_extra=require(_0xa426('0x5'));var auth=require(_0xa426('0x6'));var interaction=require(_0xa426('0x7'));var config=require(_0xa426('0x8'));var controller=require(_0xa426('0x9'));router[_0xa426('0xa')]('/',auth[_0xa426('0xb')](),controller[_0xa426('0xc')]);router[_0xa426('0xa')](_0xa426('0xd'),auth[_0xa426('0xb')](),controller[_0xa426('0xe')]);router[_0xa426('0xf')]('/',auth[_0xa426('0xb')](),controller[_0xa426('0x10')]);router[_0xa426('0x11')](_0xa426('0xd'),auth[_0xa426('0xb')](),controller[_0xa426('0x12')]);router[_0xa426('0x13')](_0xa426('0xd'),auth[_0xa426('0xb')](),controller[_0xa426('0x14')]);module[_0xa426('0x15')]=router;
\ No newline at end of file
+var _0x49a1=['multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','put','/:id','update','destroy','exports'];(function(_0x149155,_0x4668d9){var _0x154d7a=function(_0xa1a287){while(--_0xa1a287){_0x149155['push'](_0x149155['shift']());}};_0x154d7a(++_0x4668d9);}(_0x49a1,0x190));var _0x149a=function(_0x4ac58f,_0x4c18f7){_0x4ac58f=_0x4ac58f-0x0;var _0x5c9a88=_0x49a1[_0x4ac58f];return _0x5c9a88;};'use strict';var multer=require(_0x149a('0x0'));var util=require(_0x149a('0x1'));var path=require(_0x149a('0x2'));var timeout=require(_0x149a('0x3'));var express=require(_0x149a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x149a('0x5'));var config=require(_0x149a('0x6'));var controller=require('./cloudProvider.controller');router[_0x149a('0x7')]('/',auth[_0x149a('0x8')](),controller['index']);router[_0x149a('0x7')]('/:id',auth[_0x149a('0x8')](),controller[_0x149a('0x9')]);router['post']('/',auth[_0x149a('0x8')](),controller[_0x149a('0xa')]);router[_0x149a('0xb')](_0x149a('0xc'),auth[_0x149a('0x8')](),controller[_0x149a('0xd')]);router['delete']('/:id',auth[_0x149a('0x8')](),controller[_0x149a('0xe')]);module[_0x149a('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 470dd12..651d890 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 _0xc516=['sequelize','exports','STRING'];(function(_0x241c50,_0x1083b4){var _0x542512=function(_0xdbd7a8){while(--_0xdbd7a8){_0x241c50['push'](_0x241c50['shift']());}};_0x542512(++_0x1083b4);}(_0xc516,0x8a));var _0x6c51=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0xc516[_0xbeb808];return _0x5d6909;};'use strict';var Sequelize=require(_0x6c51('0x0'));module[_0x6c51('0x1')]={'name':{'type':Sequelize[_0x6c51('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x6c51('0x2')]},'companyId':{'type':Sequelize[_0x6c51('0x2')]},'website':{'type':Sequelize[_0x6c51('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x6c51('0x2')]},'type':{'type':Sequelize[_0x6c51('0x2')]},'street':{'type':Sequelize[_0x6c51('0x2')]},'postalCode':{'type':Sequelize[_0x6c51('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x6c51('0x2')]},'email':{'type':Sequelize[_0x6c51('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x6c51('0x2')]},'sPostalCode':{'type':Sequelize[_0x6c51('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x6c51('0x2')]},'description':{'type':Sequelize[_0x6c51('0x2')]}};
\ No newline at end of file
+var _0xfb6c=['name','STRING','sequelize'];(function(_0x15fce8,_0x7612b7){var _0x3f54aa=function(_0x4c1752){while(--_0x4c1752){_0x15fce8['push'](_0x15fce8['shift']());}};_0x3f54aa(++_0x7612b7);}(_0xfb6c,0x152));var _0xcfb6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfb6c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xcfb6('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xcfb6('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xcfb6('0x2')]},'website':{'type':Sequelize[_0xcfb6('0x2')]},'phone':{'type':Sequelize[_0xcfb6('0x2')]},'fax':{'type':Sequelize[_0xcfb6('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xcfb6('0x2')]},'postalCode':{'type':Sequelize[_0xcfb6('0x2')]},'city':{'type':Sequelize[_0xcfb6('0x2')]},'country':{'type':Sequelize[_0xcfb6('0x2')]},'email':{'type':Sequelize[_0xcfb6('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xcfb6('0x2')]},'sStreet':{'type':Sequelize[_0xcfb6('0x2')]},'sPostalCode':{'type':Sequelize[_0xcfb6('0x2')]},'sCity':{'type':Sequelize[_0xcfb6('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 39c37de..4afa02a 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 _0x9ee6=['sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','Companies','destroy','stack','name','send','index','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','options','CmCompany','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addContacts','CmContact','ids','findOne','sort','map','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ee6,0x94));var _0x69ee=function(_0x4bacb6,_0x2b299d){_0x4bacb6=_0x4bacb6-0x0;var _0x58c029=_0x9ee6[_0x4bacb6];return _0x58c029;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x69ee('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x69ee('0x1'));var rp=require('request-promise');var moment=require(_0x69ee('0x2'));var BPromise=require(_0x69ee('0x3'));var Mustache=require(_0x69ee('0x4'));var util=require(_0x69ee('0x5'));var path=require(_0x69ee('0x6'));var sox=require('sox');var csv=require(_0x69ee('0x7'));var ejs=require(_0x69ee('0x8'));var fs=require('fs');var fs_extra=require(_0x69ee('0x9'));var _=require(_0x69ee('0xa'));var squel=require(_0x69ee('0xb'));var crypto=require(_0x69ee('0xc'));var jsforce=require(_0x69ee('0xd'));var deskjs=require(_0x69ee('0xe'));var toCsv=require(_0x69ee('0x7'));var querystring=require(_0x69ee('0xf'));var Papa=require(_0x69ee('0x10'));var Redis=require(_0x69ee('0x11'));var authService=require(_0x69ee('0x12'));var qs=require(_0x69ee('0x13'));var as=require(_0x69ee('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x69ee('0x15'))('api');var utils=require(_0x69ee('0x16'));var config=require(_0x69ee('0x17'));var licenseUtil=require(_0x69ee('0x18'));var db=require(_0x69ee('0x19'))['db'];function respondWithStatusCode(_0x72b6c5,_0x3d19a5){_0x3d19a5=_0x3d19a5||0xcc;return function(_0x5b9c94){if(_0x5b9c94){return _0x72b6c5[_0x69ee('0x1a')](_0x3d19a5);}return _0x72b6c5[_0x69ee('0x1b')](_0x3d19a5)[_0x69ee('0x1c')]();};}function respondWithResult(_0x5bae3f,_0x4b6902){_0x4b6902=_0x4b6902||0xc8;return function(_0x57da68){if(_0x57da68){return _0x5bae3f[_0x69ee('0x1b')](_0x4b6902)[_0x69ee('0x1d')](_0x57da68);}};}function respondWithFilteredResult(_0x4e39a7,_0x263a4a){return function(_0x4cc1b4){if(_0x4cc1b4){var _0x4b8c8a=_0x4cc1b4[_0x69ee('0x1e')],_0x5c4aed=_0x263a4a[_0x69ee('0x1f')],_0x2685ca=_0x263a4a['offset']+_0x263a4a[_0x69ee('0x20')],_0xde4cf6;if(_0x2685ca>=_0x4b8c8a){_0x2685ca=_0x4b8c8a;_0xde4cf6=0xc8;}else{_0xde4cf6=0xce;}_0x4e39a7[_0x69ee('0x1b')](_0xde4cf6);return _0x4e39a7[_0x69ee('0x21')](_0x69ee('0x22'),_0x5c4aed+'-'+_0x2685ca+'/'+_0x4b8c8a)[_0x69ee('0x1d')](_0x4cc1b4);}return null;};}function patchUpdates(_0x583bd0){return function(_0x3d86e1){try{jsonpatch[_0x69ee('0x23')](_0x3d86e1,_0x583bd0,!![]);}catch(_0x219a1a){return BPromise[_0x69ee('0x24')](_0x219a1a);}return _0x3d86e1[_0x69ee('0x25')]();};}function saveUpdates(_0x183d76,_0x6b3a52){return function(_0x47782a){if(_0x47782a){return _0x47782a[_0x69ee('0x26')](_0x183d76)[_0x69ee('0x27')](function(_0x4b62bc){return _0x4b62bc;});}return null;};}function removeEntity(_0x5a17a5,_0x185e9b){return function(_0x5b8a9f){if(_0x5b8a9f){return _0x5b8a9f['destroy']()[_0x69ee('0x27')](function(){var _0x319428=_0x5b8a9f[_0x69ee('0x28')]({'plain':!![]});var _0x4465ae=_0x69ee('0x29');return db['UserProfileResource'][_0x69ee('0x2a')]({'where':{'type':_0x4465ae,'resourceId':_0x319428['id']}})[_0x69ee('0x27')](function(){return _0x5b8a9f;});})[_0x69ee('0x27')](function(){_0x5a17a5[_0x69ee('0x1b')](0xcc)[_0x69ee('0x1c')]();});}};}function handleEntityNotFound(_0x2aeb1e,_0x759b4f){return function(_0xcabf09){if(!_0xcabf09){_0x2aeb1e[_0x69ee('0x1a')](0x194);}return _0xcabf09;};}function handleError(_0x3c34f7,_0x160151){_0x160151=_0x160151||0x1f4;return function(_0x3e7280){logger['error'](_0x3e7280[_0x69ee('0x2b')]);if(_0x3e7280[_0x69ee('0x2c')]){delete _0x3e7280[_0x69ee('0x2c')];}_0x3c34f7[_0x69ee('0x1b')](_0x160151)[_0x69ee('0x2d')](_0x3e7280);};}exports[_0x69ee('0x2e')]=function(_0x5ceaf8,_0x4a757c){var _0x33ffd8={},_0x48d291={},_0x484698={'count':0x0,'rows':[]};return db['CmCompany'][_0x69ee('0x2f')]()[_0x69ee('0x27')](function(_0x524f1a){_0x48d291[_0x69ee('0x30')]=_[_0x69ee('0x31')](_0x524f1a);_0x48d291['query']=_[_0x69ee('0x31')](_0x5ceaf8[_0x69ee('0x32')]);_0x48d291[_0x69ee('0x33')]=_[_0x69ee('0x34')](_0x48d291[_0x69ee('0x30')],_0x48d291[_0x69ee('0x32')]);_0x33ffd8[_0x69ee('0x35')]=_[_0x69ee('0x34')](_0x48d291[_0x69ee('0x30')],qs[_0x69ee('0x36')](_0x5ceaf8[_0x69ee('0x32')]['fields']));_0x33ffd8[_0x69ee('0x35')]=_0x33ffd8[_0x69ee('0x35')][_0x69ee('0x37')]?_0x33ffd8[_0x69ee('0x35')]:_0x48d291[_0x69ee('0x30')];if(!_0x5ceaf8[_0x69ee('0x32')][_0x69ee('0x38')](_0x69ee('0x39'))){_0x33ffd8[_0x69ee('0x20')]=qs[_0x69ee('0x20')](_0x5ceaf8[_0x69ee('0x32')]['limit']);_0x33ffd8[_0x69ee('0x1f')]=qs[_0x69ee('0x1f')](_0x5ceaf8[_0x69ee('0x32')][_0x69ee('0x1f')]);}_0x33ffd8[_0x69ee('0x3a')]=qs['sort'](_0x5ceaf8['query']['sort']);_0x33ffd8['where']=qs[_0x69ee('0x33')](_[_0x69ee('0x3b')](_0x5ceaf8[_0x69ee('0x32')],_0x48d291[_0x69ee('0x33')]),_0x524f1a);if(_0x5ceaf8['query'][_0x69ee('0x3c')]){_0x33ffd8[_0x69ee('0x3d')]=_['merge'](_0x33ffd8[_0x69ee('0x3d')],{'$or':_['map'](_0x33ffd8[_0x69ee('0x35')],function(_0x2d0c33){var _0x955e6={};_0x955e6[_0x2d0c33]={'$like':'%'+_0x5ceaf8['query'][_0x69ee('0x3c')]+'%'};return _0x955e6;})});}_0x33ffd8=_[_0x69ee('0x3e')]({},_0x33ffd8,_0x5ceaf8[_0x69ee('0x3f')]);var _0xcc99b={'where':_0x33ffd8[_0x69ee('0x3d')]};return db[_0x69ee('0x40')][_0x69ee('0x1e')](_0xcc99b)[_0x69ee('0x27')](function(_0x5be400){_0x484698[_0x69ee('0x1e')]=_0x5be400;if(_0x5ceaf8['query'][_0x69ee('0x41')]){_0x33ffd8['include']=[{'all':!![]}];}return db[_0x69ee('0x40')][_0x69ee('0x42')](_0x33ffd8);})[_0x69ee('0x27')](function(_0x11e64d){_0x484698[_0x69ee('0x43')]=_0x11e64d;return _0x484698;})['then'](respondWithFilteredResult(_0x4a757c,_0x33ffd8))[_0x69ee('0x44')](handleError(_0x4a757c,null));})['catch'](handleError(_0x4a757c,null));};exports[_0x69ee('0x45')]=function(_0x4a3150,_0x536106){var _0x535a54={'raw':![],'where':{'id':_0x4a3150['params']['id']}},_0x132f4a={};_0x132f4a[_0x69ee('0x30')]=_[_0x69ee('0x31')](db[_0x69ee('0x40')][_0x69ee('0x46')]);_0x132f4a['query']=_['keys'](_0x4a3150[_0x69ee('0x32')]);_0x132f4a[_0x69ee('0x33')]=_[_0x69ee('0x34')](_0x132f4a['model'],_0x132f4a[_0x69ee('0x32')]);_0x535a54[_0x69ee('0x35')]=_['intersection'](_0x132f4a[_0x69ee('0x30')],qs['fields'](_0x4a3150[_0x69ee('0x32')][_0x69ee('0x36')]));_0x535a54[_0x69ee('0x35')]=_0x535a54[_0x69ee('0x35')]['length']?_0x535a54[_0x69ee('0x35')]:_0x132f4a[_0x69ee('0x30')];if(_0x4a3150[_0x69ee('0x32')][_0x69ee('0x41')]){_0x535a54[_0x69ee('0x47')]=[{'all':!![]}];}_0x535a54=_[_0x69ee('0x3e')]({},_0x535a54,_0x4a3150[_0x69ee('0x3f')]);return db[_0x69ee('0x40')][_0x69ee('0x48')](_0x535a54)[_0x69ee('0x27')](handleEntityNotFound(_0x536106,null))[_0x69ee('0x27')](respondWithResult(_0x536106,null))['catch'](handleError(_0x536106,null));};exports[_0x69ee('0x49')]=function(_0x36324a,_0x346401){return db[_0x69ee('0x40')][_0x69ee('0x49')](_0x36324a['body'],{})[_0x69ee('0x27')](function(_0x23276e){var _0x3aef3e=_0x36324a['user'][_0x69ee('0x28')]({'plain':!![]});if(!_0x3aef3e)throw new Error(_0x69ee('0x4a'));if(_0x3aef3e['role']==='user'){var _0x1e9af5=_0x23276e[_0x69ee('0x28')]({'plain':!![]});var _0x177cec=_0x69ee('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x177cec,'userProfileId':_0x3aef3e[_0x69ee('0x4b')]},'raw':!![]})[_0x69ee('0x27')](function(_0x3bc183){if(_0x3bc183&&_0x3bc183['autoAssociation']===0x0){return db[_0x69ee('0x4c')]['create']({'name':_0x1e9af5[_0x69ee('0x2c')],'resourceId':_0x1e9af5['id'],'type':_0x3bc183[_0x69ee('0x2c')],'sectionId':_0x3bc183['id']},{})[_0x69ee('0x27')](function(){return _0x23276e;});}else{return _0x23276e;}})[_0x69ee('0x44')](function(_0x3c98c4){logger[_0x69ee('0x4d')](_0x69ee('0x4e'),_0x3c98c4);throw _0x3c98c4;});}return _0x23276e;})[_0x69ee('0x27')](respondWithResult(_0x346401,0xc9))[_0x69ee('0x44')](handleError(_0x346401,null));};exports[_0x69ee('0x26')]=function(_0xf6f7ce,_0x58861a){if(_0xf6f7ce['body']['id']){delete _0xf6f7ce[_0x69ee('0x4f')]['id'];}return db[_0x69ee('0x40')][_0x69ee('0x48')]({'where':{'id':_0xf6f7ce[_0x69ee('0x50')]['id']}})[_0x69ee('0x27')](handleEntityNotFound(_0x58861a,null))[_0x69ee('0x27')](saveUpdates(_0xf6f7ce[_0x69ee('0x4f')],null))['then'](respondWithResult(_0x58861a,null))[_0x69ee('0x44')](handleError(_0x58861a,null));};exports['destroy']=function(_0x22a90b,_0x461904){return db[_0x69ee('0x40')][_0x69ee('0x48')]({'where':{'id':_0x22a90b[_0x69ee('0x50')]['id']}})[_0x69ee('0x27')](handleEntityNotFound(_0x461904,null))['then'](removeEntity(_0x461904,null))['catch'](handleError(_0x461904,null));};exports['describe']=function(_0x5e062c,_0x23aaf7){return db[_0x69ee('0x40')][_0x69ee('0x2f')]()[_0x69ee('0x27')](respondWithResult(_0x23aaf7,null))[_0x69ee('0x44')](handleError(_0x23aaf7,null));};exports[_0x69ee('0x51')]=function(_0xb58faa,_0x35472b,_0x2bc38f){return db[_0x69ee('0x52')][_0x69ee('0x48')]({'where':{'id':_0xb58faa[_0x69ee('0x50')]['id']}})['then'](handleEntityNotFound(_0x35472b,null))[_0x69ee('0x27')](function(_0x2a1ae9){if(_0x2a1ae9){return _0x2a1ae9['addContacts'](_0xb58faa[_0x69ee('0x4f')][_0x69ee('0x53')],_['omit'](_0xb58faa[_0x69ee('0x4f')],['ids','id'])||{});}})[_0x69ee('0x27')](respondWithResult(_0x35472b,null))[_0x69ee('0x44')](handleError(_0x35472b,null));};exports['getContacts']=function(_0x42b2a0,_0x46fa14,_0x49bf2a){var _0x5a55d4={};var _0x360235={};var _0x20ef17;var _0x3308d3;return db['CmCompany'][_0x69ee('0x54')]({'where':{'id':_0x42b2a0['params']['id']}})[_0x69ee('0x27')](handleEntityNotFound(_0x46fa14,null))[_0x69ee('0x27')](function(_0x516eba){if(_0x516eba){_0x20ef17=_0x516eba;_0x360235['model']=_['keys'](db['CmContact'][_0x69ee('0x46')]);_0x360235['query']=_[_0x69ee('0x31')](_0x42b2a0[_0x69ee('0x32')]);_0x360235[_0x69ee('0x33')]=_['intersection'](_0x360235['model'],_0x360235['query']);_0x5a55d4['attributes']=_[_0x69ee('0x34')](_0x360235[_0x69ee('0x30')],qs[_0x69ee('0x36')](_0x42b2a0[_0x69ee('0x32')]['fields']));_0x5a55d4[_0x69ee('0x35')]=_0x5a55d4[_0x69ee('0x35')][_0x69ee('0x37')]?_0x5a55d4[_0x69ee('0x35')]:_0x360235[_0x69ee('0x30')];_0x5a55d4[_0x69ee('0x3a')]=qs[_0x69ee('0x55')](_0x42b2a0[_0x69ee('0x32')]['sort']);_0x5a55d4[_0x69ee('0x3d')]=qs[_0x69ee('0x33')](_['pick'](_0x42b2a0['query'],_0x360235[_0x69ee('0x33')]));if(_0x42b2a0[_0x69ee('0x32')][_0x69ee('0x3c')]){_0x5a55d4[_0x69ee('0x3d')]=_[_0x69ee('0x3e')](_0x5a55d4[_0x69ee('0x3d')],{'$or':_[_0x69ee('0x56')](_0x5a55d4[_0x69ee('0x35')],function(_0xb55596){var _0x511de1={};_0x511de1[_0xb55596]={'$like':'%'+_0x42b2a0['query'][_0x69ee('0x3c')]+'%'};return _0x511de1;})});}_0x5a55d4=_[_0x69ee('0x3e')]({},_0x5a55d4,_0x42b2a0[_0x69ee('0x3f')]);return _0x20ef17['getContacts'](_0x5a55d4);}})[_0x69ee('0x27')](function(_0x35f464){if(_0x35f464){_0x3308d3=_0x35f464[_0x69ee('0x37')];if(!_0x42b2a0[_0x69ee('0x32')][_0x69ee('0x38')](_0x69ee('0x39'))){_0x5a55d4['limit']=qs['limit'](_0x42b2a0[_0x69ee('0x32')][_0x69ee('0x20')]);_0x5a55d4[_0x69ee('0x1f')]=qs[_0x69ee('0x1f')](_0x42b2a0[_0x69ee('0x32')]['offset']);}return _0x20ef17['getContacts'](_0x5a55d4);}})[_0x69ee('0x27')](function(_0xe9a3ab){if(_0xe9a3ab){return _0xe9a3ab?{'count':_0x3308d3,'rows':_0xe9a3ab}:null;}})['then'](respondWithResult(_0x46fa14,null))[_0x69ee('0x44')](handleError(_0x46fa14,null));};
\ No newline at end of file
+var _0x1a8f=['json','apply','save','destroy','get','Companies','UserProfileResource','then','error','stack','name','CmCompany','describe','model','query','keys','filters','intersection','attributes','fields','order','sort','merge','map','filter','options','where','include','findAll','rows','catch','show','params','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','CmContact','addContacts','ids','getContacts','pick','hasOwnProperty','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','path','ejs','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','sendStatus','status','end','count','offset','limit','set','Content-Range'];(function(_0x152256,_0x28772e){var _0x2ebc99=function(_0x28c063){while(--_0x28c063){_0x152256['push'](_0x152256['shift']());}};_0x2ebc99(++_0x28772e);}(_0x1a8f,0x88));var _0xf1a8=function(_0x1df378,_0x2c4af3){_0x1df378=_0x1df378-0x0;var _0x2cb9fe=_0x1a8f[_0x1df378];return _0x2cb9fe;};'use strict';var pdf=require(_0xf1a8('0x0'));var emlformat=require(_0xf1a8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf1a8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf1a8('0x3'));var moment=require(_0xf1a8('0x4'));var BPromise=require(_0xf1a8('0x5'));var Mustache=require('mustache');var util=require(_0xf1a8('0x6'));var path=require(_0xf1a8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf1a8('0x8'));var fs=require('fs');var fs_extra=require(_0xf1a8('0x9'));var _=require(_0xf1a8('0xa'));var squel=require(_0xf1a8('0xb'));var crypto=require(_0xf1a8('0xc'));var jsforce=require(_0xf1a8('0xd'));var deskjs=require(_0xf1a8('0xe'));var toCsv=require(_0xf1a8('0xf'));var querystring=require(_0xf1a8('0x10'));var Papa=require(_0xf1a8('0x11'));var Redis=require(_0xf1a8('0x12'));var authService=require(_0xf1a8('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf1a8('0x14'));var hardwareService=require(_0xf1a8('0x15'));var logger=require(_0xf1a8('0x16'))(_0xf1a8('0x17'));var utils=require(_0xf1a8('0x18'));var config=require(_0xf1a8('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32b22b,_0x2151ab){_0x2151ab=_0x2151ab||0xcc;return function(_0x5e28f0){if(_0x5e28f0){return _0x32b22b[_0xf1a8('0x1a')](_0x2151ab);}return _0x32b22b[_0xf1a8('0x1b')](_0x2151ab)[_0xf1a8('0x1c')]();};}function respondWithResult(_0x1fedf3,_0x110e06){_0x110e06=_0x110e06||0xc8;return function(_0x78b03a){if(_0x78b03a){return _0x1fedf3[_0xf1a8('0x1b')](_0x110e06)['json'](_0x78b03a);}};}function respondWithFilteredResult(_0x2d9440,_0x28aca3){return function(_0x35285c){if(_0x35285c){var _0x2f18cc=_0x35285c[_0xf1a8('0x1d')],_0x405c58=_0x28aca3[_0xf1a8('0x1e')],_0x8fd875=_0x28aca3[_0xf1a8('0x1e')]+_0x28aca3[_0xf1a8('0x1f')],_0x47e5d0;if(_0x8fd875>=_0x2f18cc){_0x8fd875=_0x2f18cc;_0x47e5d0=0xc8;}else{_0x47e5d0=0xce;}_0x2d9440[_0xf1a8('0x1b')](_0x47e5d0);return _0x2d9440[_0xf1a8('0x20')](_0xf1a8('0x21'),_0x405c58+'-'+_0x8fd875+'/'+_0x2f18cc)[_0xf1a8('0x22')](_0x35285c);}return null;};}function patchUpdates(_0x392a0d){return function(_0x3fb17d){try{jsonpatch[_0xf1a8('0x23')](_0x3fb17d,_0x392a0d,!![]);}catch(_0x10adb7){return BPromise['reject'](_0x10adb7);}return _0x3fb17d[_0xf1a8('0x24')]();};}function saveUpdates(_0x5ce5c5,_0x562383){return function(_0x102483){if(_0x102483){return _0x102483['update'](_0x5ce5c5)['then'](function(_0x26a707){return _0x26a707;});}return null;};}function removeEntity(_0xae686e,_0x45d6cb){return function(_0x154ac6){if(_0x154ac6){return _0x154ac6[_0xf1a8('0x25')]()['then'](function(){var _0x2feec7=_0x154ac6[_0xf1a8('0x26')]({'plain':!![]});var _0x41a502=_0xf1a8('0x27');return db[_0xf1a8('0x28')]['destroy']({'where':{'type':_0x41a502,'resourceId':_0x2feec7['id']}})['then'](function(){return _0x154ac6;});})[_0xf1a8('0x29')](function(){_0xae686e[_0xf1a8('0x1b')](0xcc)[_0xf1a8('0x1c')]();});}};}function handleEntityNotFound(_0x11b828,_0x2781cd){return function(_0x49fe35){if(!_0x49fe35){_0x11b828['sendStatus'](0x194);}return _0x49fe35;};}function handleError(_0x3ceaba,_0x1d700f){_0x1d700f=_0x1d700f||0x1f4;return function(_0x2e1268){logger[_0xf1a8('0x2a')](_0x2e1268[_0xf1a8('0x2b')]);if(_0x2e1268['name']){delete _0x2e1268[_0xf1a8('0x2c')];}_0x3ceaba[_0xf1a8('0x1b')](_0x1d700f)['send'](_0x2e1268);};}exports['index']=function(_0x5df91a,_0x376d62){var _0x1c0c50={},_0x42d729={},_0x1c711a={'count':0x0,'rows':[]};return db[_0xf1a8('0x2d')][_0xf1a8('0x2e')]()[_0xf1a8('0x29')](function(_0x2c8fa2){_0x42d729[_0xf1a8('0x2f')]=_['keys'](_0x2c8fa2);_0x42d729[_0xf1a8('0x30')]=_[_0xf1a8('0x31')](_0x5df91a[_0xf1a8('0x30')]);_0x42d729[_0xf1a8('0x32')]=_[_0xf1a8('0x33')](_0x42d729[_0xf1a8('0x2f')],_0x42d729[_0xf1a8('0x30')]);_0x1c0c50[_0xf1a8('0x34')]=_[_0xf1a8('0x33')](_0x42d729['model'],qs[_0xf1a8('0x35')](_0x5df91a[_0xf1a8('0x30')][_0xf1a8('0x35')]));_0x1c0c50[_0xf1a8('0x34')]=_0x1c0c50[_0xf1a8('0x34')]['length']?_0x1c0c50[_0xf1a8('0x34')]:_0x42d729[_0xf1a8('0x2f')];if(!_0x5df91a['query']['hasOwnProperty']('nolimit')){_0x1c0c50[_0xf1a8('0x1f')]=qs['limit'](_0x5df91a[_0xf1a8('0x30')][_0xf1a8('0x1f')]);_0x1c0c50['offset']=qs[_0xf1a8('0x1e')](_0x5df91a[_0xf1a8('0x30')][_0xf1a8('0x1e')]);}_0x1c0c50[_0xf1a8('0x36')]=qs[_0xf1a8('0x37')](_0x5df91a[_0xf1a8('0x30')]['sort']);_0x1c0c50['where']=qs[_0xf1a8('0x32')](_['pick'](_0x5df91a[_0xf1a8('0x30')],_0x42d729[_0xf1a8('0x32')]),_0x2c8fa2);if(_0x5df91a[_0xf1a8('0x30')]['filter']){_0x1c0c50['where']=_[_0xf1a8('0x38')](_0x1c0c50['where'],{'$or':_[_0xf1a8('0x39')](_0x1c0c50[_0xf1a8('0x34')],function(_0xa9e11c){var _0x25ba3f={};_0x25ba3f[_0xa9e11c]={'$like':'%'+_0x5df91a['query'][_0xf1a8('0x3a')]+'%'};return _0x25ba3f;})});}_0x1c0c50=_['merge']({},_0x1c0c50,_0x5df91a[_0xf1a8('0x3b')]);var _0x5d56d4={'where':_0x1c0c50[_0xf1a8('0x3c')]};return db['CmCompany']['count'](_0x5d56d4)[_0xf1a8('0x29')](function(_0xb55113){_0x1c711a[_0xf1a8('0x1d')]=_0xb55113;if(_0x5df91a[_0xf1a8('0x30')]['includeAll']){_0x1c0c50[_0xf1a8('0x3d')]=[{'all':!![]}];}return db[_0xf1a8('0x2d')][_0xf1a8('0x3e')](_0x1c0c50);})[_0xf1a8('0x29')](function(_0x2482b0){_0x1c711a[_0xf1a8('0x3f')]=_0x2482b0;return _0x1c711a;})[_0xf1a8('0x29')](respondWithFilteredResult(_0x376d62,_0x1c0c50))[_0xf1a8('0x40')](handleError(_0x376d62,null));})[_0xf1a8('0x40')](handleError(_0x376d62,null));};exports[_0xf1a8('0x41')]=function(_0x5dd4e4,_0x524bb9){var _0x22366f={'raw':![],'where':{'id':_0x5dd4e4[_0xf1a8('0x42')]['id']}},_0x90d98e={};_0x90d98e[_0xf1a8('0x2f')]=_[_0xf1a8('0x31')](db[_0xf1a8('0x2d')]['rawAttributes']);_0x90d98e['query']=_[_0xf1a8('0x31')](_0x5dd4e4['query']);_0x90d98e[_0xf1a8('0x32')]=_[_0xf1a8('0x33')](_0x90d98e[_0xf1a8('0x2f')],_0x90d98e[_0xf1a8('0x30')]);_0x22366f[_0xf1a8('0x34')]=_['intersection'](_0x90d98e['model'],qs['fields'](_0x5dd4e4['query'][_0xf1a8('0x35')]));_0x22366f[_0xf1a8('0x34')]=_0x22366f[_0xf1a8('0x34')][_0xf1a8('0x43')]?_0x22366f[_0xf1a8('0x34')]:_0x90d98e[_0xf1a8('0x2f')];if(_0x5dd4e4[_0xf1a8('0x30')][_0xf1a8('0x44')]){_0x22366f[_0xf1a8('0x3d')]=[{'all':!![]}];}_0x22366f=_[_0xf1a8('0x38')]({},_0x22366f,_0x5dd4e4[_0xf1a8('0x3b')]);return db[_0xf1a8('0x2d')][_0xf1a8('0x45')](_0x22366f)[_0xf1a8('0x29')](handleEntityNotFound(_0x524bb9,null))[_0xf1a8('0x29')](respondWithResult(_0x524bb9,null))[_0xf1a8('0x40')](handleError(_0x524bb9,null));};exports[_0xf1a8('0x46')]=function(_0x4a50a7,_0x5722bc){return db[_0xf1a8('0x2d')][_0xf1a8('0x46')](_0x4a50a7['body'],{})[_0xf1a8('0x29')](function(_0x138185){var _0x2e12aa=_0x4a50a7[_0xf1a8('0x47')][_0xf1a8('0x26')]({'plain':!![]});if(!_0x2e12aa)throw new Error(_0xf1a8('0x48'));if(_0x2e12aa[_0xf1a8('0x49')]===_0xf1a8('0x47')){var _0x1d5757=_0x138185[_0xf1a8('0x26')]({'plain':!![]});var _0x17440c=_0xf1a8('0x27');return db[_0xf1a8('0x4a')][_0xf1a8('0x45')]({'where':{'name':_0x17440c,'userProfileId':_0x2e12aa[_0xf1a8('0x4b')]},'raw':!![]})[_0xf1a8('0x29')](function(_0x7119c){if(_0x7119c&&_0x7119c['autoAssociation']===0x0){return db[_0xf1a8('0x28')][_0xf1a8('0x46')]({'name':_0x1d5757['name'],'resourceId':_0x1d5757['id'],'type':_0x7119c[_0xf1a8('0x2c')],'sectionId':_0x7119c['id']},{})[_0xf1a8('0x29')](function(){return _0x138185;});}else{return _0x138185;}})[_0xf1a8('0x40')](function(_0x16d155){logger[_0xf1a8('0x2a')](_0xf1a8('0x4c'),_0x16d155);throw _0x16d155;});}return _0x138185;})['then'](respondWithResult(_0x5722bc,0xc9))[_0xf1a8('0x40')](handleError(_0x5722bc,null));};exports[_0xf1a8('0x4d')]=function(_0x523a21,_0x3ec70a){if(_0x523a21[_0xf1a8('0x4e')]['id']){delete _0x523a21['body']['id'];}return db[_0xf1a8('0x2d')][_0xf1a8('0x45')]({'where':{'id':_0x523a21[_0xf1a8('0x42')]['id']}})[_0xf1a8('0x29')](handleEntityNotFound(_0x3ec70a,null))[_0xf1a8('0x29')](saveUpdates(_0x523a21[_0xf1a8('0x4e')],null))[_0xf1a8('0x29')](respondWithResult(_0x3ec70a,null))['catch'](handleError(_0x3ec70a,null));};exports[_0xf1a8('0x25')]=function(_0x27b2e6,_0x3cee8e){return db[_0xf1a8('0x2d')][_0xf1a8('0x45')]({'where':{'id':_0x27b2e6[_0xf1a8('0x42')]['id']}})[_0xf1a8('0x29')](handleEntityNotFound(_0x3cee8e,null))[_0xf1a8('0x29')](removeEntity(_0x3cee8e,null))[_0xf1a8('0x40')](handleError(_0x3cee8e,null));};exports[_0xf1a8('0x2e')]=function(_0x2cbe8b,_0x24cb5f){return db[_0xf1a8('0x2d')][_0xf1a8('0x2e')]()[_0xf1a8('0x29')](respondWithResult(_0x24cb5f,null))[_0xf1a8('0x40')](handleError(_0x24cb5f,null));};exports['addContacts']=function(_0x4bfc55,_0x215742,_0x5dafc8){return db[_0xf1a8('0x4f')][_0xf1a8('0x45')]({'where':{'id':_0x4bfc55['params']['id']}})[_0xf1a8('0x29')](handleEntityNotFound(_0x215742,null))[_0xf1a8('0x29')](function(_0x47276e){if(_0x47276e){return _0x47276e[_0xf1a8('0x50')](_0x4bfc55[_0xf1a8('0x4e')]['ids'],_['omit'](_0x4bfc55[_0xf1a8('0x4e')],[_0xf1a8('0x51'),'id'])||{});}})['then'](respondWithResult(_0x215742,null))[_0xf1a8('0x40')](handleError(_0x215742,null));};exports[_0xf1a8('0x52')]=function(_0x20d670,_0x67ce85,_0x3d4ae4){var _0x47c92d={};var _0x5247b2={};var _0x4c68fa;var _0x4c761c;return db[_0xf1a8('0x2d')]['findOne']({'where':{'id':_0x20d670[_0xf1a8('0x42')]['id']}})[_0xf1a8('0x29')](handleEntityNotFound(_0x67ce85,null))[_0xf1a8('0x29')](function(_0x19811d){if(_0x19811d){_0x4c68fa=_0x19811d;_0x5247b2[_0xf1a8('0x2f')]=_[_0xf1a8('0x31')](db[_0xf1a8('0x4f')]['rawAttributes']);_0x5247b2[_0xf1a8('0x30')]=_[_0xf1a8('0x31')](_0x20d670[_0xf1a8('0x30')]);_0x5247b2[_0xf1a8('0x32')]=_['intersection'](_0x5247b2['model'],_0x5247b2['query']);_0x47c92d[_0xf1a8('0x34')]=_[_0xf1a8('0x33')](_0x5247b2[_0xf1a8('0x2f')],qs[_0xf1a8('0x35')](_0x20d670['query'][_0xf1a8('0x35')]));_0x47c92d['attributes']=_0x47c92d[_0xf1a8('0x34')][_0xf1a8('0x43')]?_0x47c92d[_0xf1a8('0x34')]:_0x5247b2[_0xf1a8('0x2f')];_0x47c92d['order']=qs[_0xf1a8('0x37')](_0x20d670['query'][_0xf1a8('0x37')]);_0x47c92d[_0xf1a8('0x3c')]=qs[_0xf1a8('0x32')](_[_0xf1a8('0x53')](_0x20d670[_0xf1a8('0x30')],_0x5247b2[_0xf1a8('0x32')]));if(_0x20d670[_0xf1a8('0x30')][_0xf1a8('0x3a')]){_0x47c92d[_0xf1a8('0x3c')]=_[_0xf1a8('0x38')](_0x47c92d['where'],{'$or':_[_0xf1a8('0x39')](_0x47c92d[_0xf1a8('0x34')],function(_0x4e69a8){var _0x24df03={};_0x24df03[_0x4e69a8]={'$like':'%'+_0x20d670[_0xf1a8('0x30')][_0xf1a8('0x3a')]+'%'};return _0x24df03;})});}_0x47c92d=_[_0xf1a8('0x38')]({},_0x47c92d,_0x20d670[_0xf1a8('0x3b')]);return _0x4c68fa[_0xf1a8('0x52')](_0x47c92d);}})[_0xf1a8('0x29')](function(_0x26fedc){if(_0x26fedc){_0x4c761c=_0x26fedc[_0xf1a8('0x43')];if(!_0x20d670['query'][_0xf1a8('0x54')]('nolimit')){_0x47c92d[_0xf1a8('0x1f')]=qs[_0xf1a8('0x1f')](_0x20d670[_0xf1a8('0x30')]['limit']);_0x47c92d[_0xf1a8('0x1e')]=qs[_0xf1a8('0x1e')](_0x20d670[_0xf1a8('0x30')][_0xf1a8('0x1e')]);}return _0x4c68fa[_0xf1a8('0x52')](_0x47c92d);}})[_0xf1a8('0x29')](function(_0x1cbca8){if(_0x1cbca8){return _0x1cbca8?{'count':_0x4c761c,'rows':_0x1cbca8}:null;}})[_0xf1a8('0x29')](respondWithResult(_0x67ce85,null))[_0xf1a8('0x40')](handleError(_0x67ce85,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index bbe2370..f62823b 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 _0xea89=['CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./cmCompany.attributes','exports','define'];(function(_0x5d2df8,_0x34f53e){var _0xa9ffed=function(_0x2fcc8c){while(--_0x2fcc8c){_0x5d2df8['push'](_0x5d2df8['shift']());}};_0xa9ffed(++_0x34f53e);}(_0xea89,0x1e2));var _0x9ea8=function(_0x1dc9fe,_0x244b6a){_0x1dc9fe=_0x1dc9fe-0x0;var _0x5bf8fd=_0xea89[_0x1dc9fe];return _0x5bf8fd;};'use strict';var _=require(_0x9ea8('0x0'));var util=require(_0x9ea8('0x1'));var logger=require(_0x9ea8('0x2'))(_0x9ea8('0x3'));var moment=require(_0x9ea8('0x4'));var BPromise=require('bluebird');var rp=require(_0x9ea8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ea8('0x6'));var config=require('../../config/environment');var attributes=require(_0x9ea8('0x7'));module[_0x9ea8('0x8')]=function(_0x2c6e50,_0x184f38){return _0x2c6e50[_0x9ea8('0x9')](_0x9ea8('0xa'),attributes,{'tableName':_0x9ea8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1501=['bluebird','request-promise','path','rimraf','./cmCompany.attributes','define','CmCompany','cm_companies','util','../../config/logger','api'];(function(_0x404c49,_0x17c931){var _0x5969ae=function(_0x2e6f4b){while(--_0x2e6f4b){_0x404c49['push'](_0x404c49['shift']());}};_0x5969ae(++_0x17c931);}(_0x1501,0x126));var _0x1150=function(_0x2b2514,_0x25e672){_0x2b2514=_0x2b2514-0x0;var _0x542e61=_0x1501[_0x2b2514];return _0x542e61;};'use strict';var _=require('lodash');var util=require(_0x1150('0x0'));var logger=require(_0x1150('0x1'))(_0x1150('0x2'));var moment=require('moment');var BPromise=require(_0x1150('0x3'));var rp=require(_0x1150('0x4'));var fs=require('fs');var path=require(_0x1150('0x5'));var rimraf=require(_0x1150('0x6'));var config=require('../../config/environment');var attributes=require(_0x1150('0x7'));module['exports']=function(_0x63c724,_0x316a7d){return _0x63c724[_0x1150('0x8')](_0x1150('0x9'),attributes,{'tableName':_0x1150('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index d614db7..80bc6a4 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 _0x344b=['code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2f7270,_0x307af1){var _0xe1d89a=function(_0x1ba203){while(--_0x1ba203){_0x2f7270['push'](_0x2f7270['shift']());}};_0xe1d89a(++_0x307af1);}(_0x344b,0x1b7));var _0xb344=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x344b[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0xb344('0x0'));var util=require(_0xb344('0x1'));var moment=require(_0xb344('0x2'));var BPromise=require(_0xb344('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb344('0x4'));var db=require(_0xb344('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb344('0x6'))(_0xb344('0x7'));var config=require(_0xb344('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb344('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6fc1bf,_0x28ec6b,_0x2926e9){return new BPromise(function(_0x3de87d,_0x157f82){return client['request'](_0x6fc1bf,_0x2926e9)[_0xb344('0xa')](function(_0x31958d){logger[_0xb344('0xb')](_0xb344('0xc'),_0x28ec6b,_0xb344('0xd'));logger['debug'](_0xb344('0xe'),_0x28ec6b,'request\x20sent',JSON[_0xb344('0xf')](_0x31958d));if(_0x31958d[_0xb344('0x10')]){if(_0x31958d[_0xb344('0x10')][_0xb344('0x11')]===0x1f4){logger[_0xb344('0x10')](_0xb344('0xc'),_0x28ec6b,_0x31958d[_0xb344('0x10')][_0xb344('0x12')]);return _0x157f82(_0x31958d[_0xb344('0x10')][_0xb344('0x12')]);}logger[_0xb344('0x10')]('CmCompany,\x20%s,\x20%s',_0x28ec6b,_0x31958d[_0xb344('0x10')][_0xb344('0x12')]);return _0x3de87d(_0x31958d[_0xb344('0x10')][_0xb344('0x12')]);}else{logger[_0xb344('0xb')]('CmCompany,\x20%s,\x20%s',_0x28ec6b,'request\x20sent');_0x3de87d(_0x31958d['result']['message']);}})['catch'](function(_0x3edacf){logger['error'](_0xb344('0xc'),_0x28ec6b,_0x3edacf);_0x157f82(_0x3edacf);});});}
\ No newline at end of file
+var _0xd7bf=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','CmCompany,\x20%s,\x20%s','message','catch','util','moment'];(function(_0x1a0303,_0x6508d3){var _0x4f9bee=function(_0x6d0f04){while(--_0x6d0f04){_0x1a0303['push'](_0x1a0303['shift']());}};_0x4f9bee(++_0x6508d3);}(_0xd7bf,0xb2));var _0xfd7b=function(_0x40a38e,_0x56a98e){_0x40a38e=_0x40a38e-0x0;var _0x186105=_0xd7bf[_0x40a38e];return _0x186105;};'use strict';var _=require('lodash');var util=require(_0xfd7b('0x0'));var moment=require(_0xfd7b('0x1'));var BPromise=require(_0xfd7b('0x2'));var rs=require(_0xfd7b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd7b('0x4'))['db'];var utils=require(_0xfd7b('0x5'));var logger=require(_0xfd7b('0x6'))('rpc');var config=require(_0xfd7b('0x7'));var jayson=require(_0xfd7b('0x8'));var client=jayson[_0xfd7b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x364dc7,_0x4d1aad,_0x5bca22){return new BPromise(function(_0x348580,_0x2d9241){return client[_0xfd7b('0xa')](_0x364dc7,_0x5bca22)['then'](function(_0x284e33){logger[_0xfd7b('0xb')]('CmCompany,\x20%s,\x20%s',_0x4d1aad,_0xfd7b('0xc'));logger[_0xfd7b('0xd')](_0xfd7b('0xe'),_0x4d1aad,_0xfd7b('0xc'),JSON[_0xfd7b('0xf')](_0x284e33));if(_0x284e33[_0xfd7b('0x10')]){if(_0x284e33[_0xfd7b('0x10')]['code']===0x1f4){logger[_0xfd7b('0x10')](_0xfd7b('0x11'),_0x4d1aad,_0x284e33[_0xfd7b('0x10')][_0xfd7b('0x12')]);return _0x2d9241(_0x284e33['error']['message']);}logger['error']('CmCompany,\x20%s,\x20%s',_0x4d1aad,_0x284e33['error'][_0xfd7b('0x12')]);return _0x348580(_0x284e33[_0xfd7b('0x10')]['message']);}else{logger[_0xfd7b('0xb')]('CmCompany,\x20%s,\x20%s',_0x4d1aad,_0xfd7b('0xc'));_0x348580(_0x284e33['result'][_0xfd7b('0x12')]);}})[_0xfd7b('0x13')](function(_0x839463){logger[_0xfd7b('0x10')](_0xfd7b('0x11'),_0x4d1aad,_0x839463);_0x2d9241(_0x839463);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index e36e412..8a46d5c 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 _0x1948=['./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','post','addContacts','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2f25c5,_0x364ba9){var _0x205258=function(_0x2302f9){while(--_0x2302f9){_0x2f25c5['push'](_0x2f25c5['shift']());}};_0x205258(++_0x364ba9);}(_0x1948,0x6b));var _0x8194=function(_0x14babd,_0x213243){_0x14babd=_0x14babd-0x0;var _0x155505=_0x1948[_0x14babd];return _0x155505;};'use strict';var multer=require(_0x8194('0x0'));var util=require(_0x8194('0x1'));var path=require(_0x8194('0x2'));var timeout=require('connect-timeout');var express=require(_0x8194('0x3'));var router=express[_0x8194('0x4')]();var fs_extra=require(_0x8194('0x5'));var auth=require(_0x8194('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8194('0x7'));var controller=require(_0x8194('0x8'));router[_0x8194('0x9')]('/',auth[_0x8194('0xa')](),controller[_0x8194('0xb')]);router[_0x8194('0x9')](_0x8194('0xc'),auth[_0x8194('0xa')](),controller[_0x8194('0xd')]);router['get'](_0x8194('0xe'),auth[_0x8194('0xa')](),controller[_0x8194('0xf')]);router[_0x8194('0x9')](_0x8194('0x10'),auth[_0x8194('0xa')](),controller['getContacts']);router[_0x8194('0x11')]('/',auth[_0x8194('0xa')](),controller['create']);router[_0x8194('0x11')](_0x8194('0x10'),auth[_0x8194('0xa')](),controller[_0x8194('0x12')]);router['put'](_0x8194('0xe'),auth['isAuthenticated'](),controller[_0x8194('0x13')]);router[_0x8194('0x14')](_0x8194('0xe'),auth[_0x8194('0xa')](),controller[_0x8194('0x15')]);module[_0x8194('0x16')]=router;
\ No newline at end of file
+var _0xfa6f=['/:id','post','create','addContacts','put','update','exports','util','Router','fs-extra','../../components/interaction/service','./cmCompany.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x38c699,_0x56fea7){var _0x3b1ded=function(_0x100851){while(--_0x100851){_0x38c699['push'](_0x38c699['shift']());}};_0x3b1ded(++_0x56fea7);}(_0xfa6f,0x15b));var _0xffa6=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xfa6f[_0x341e0f];return _0x59555a;};'use strict';var multer=require('multer');var util=require(_0xffa6('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xffa6('0x1')]();var fs_extra=require(_0xffa6('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xffa6('0x3'));var config=require('../../config/environment');var controller=require(_0xffa6('0x4'));router['get']('/',auth[_0xffa6('0x5')](),controller[_0xffa6('0x6')]);router[_0xffa6('0x7')](_0xffa6('0x8'),auth[_0xffa6('0x5')](),controller[_0xffa6('0x9')]);router['get'](_0xffa6('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xffa6('0x7')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0xffa6('0xb')]('/',auth['isAuthenticated'](),controller[_0xffa6('0xc')]);router[_0xffa6('0xb')]('/:id/contacts',auth[_0xffa6('0x5')](),controller[_0xffa6('0xd')]);router[_0xffa6('0xe')](_0xffa6('0xa'),auth[_0xffa6('0x5')](),controller[_0xffa6('0xf')]);router['delete'](_0xffa6('0xa'),auth[_0xffa6('0x5')](),controller['destroy']);module[_0xffa6('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 1b35cdc..4067f96 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 _0x8433=['sequelize','STRING','UNSIGNED','DATE','NOW'];(function(_0xf44d98,_0x12a472){var _0x5ebb04=function(_0x930c33){while(--_0x930c33){_0xf44d98['push'](_0xf44d98['shift']());}};_0x5ebb04(++_0x12a472);}(_0x8433,0x186));var _0x3843=function(_0x1030ce,_0xbe3f74){_0x1030ce=_0x1030ce-0x0;var _0x3367fd=_0x8433[_0x1030ce];return _0x3367fd;};'use strict';var _=require('lodash');var Sequelize=require(_0x3843('0x0'));module['exports']={'firstName':{'type':Sequelize[_0x3843('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0x3843('0x1')]},'street':{'type':Sequelize[_0x3843('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x3843('0x1')]},'country':{'type':Sequelize[_0x3843('0x1')]},'dateOfBirth':{'type':Sequelize[_0x3843('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x3843('0x1')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x3843('0x1')]},'email':{'type':Sequelize[_0x3843('0x1')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x3843('0x1')]},'twitter':{'type':Sequelize[_0x3843('0x1')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x3843('0x1')]},'viber':{'type':Sequelize[_0x3843('0x1')]},'line':{'type':Sequelize[_0x3843('0x1')]},'wechat':{'type':Sequelize[_0x3843('0x1')]},'telegram':{'type':Sequelize[_0x3843('0x1')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x3843('0x2')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x3843('0x3')],'defaultValue':Sequelize[_0x3843('0x4')]}};
\ No newline at end of file
+var _0x121e=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x212a78,_0x5a5afa){var _0x5685cf=function(_0x59c99f){while(--_0x59c99f){_0x212a78['push'](_0x212a78['shift']());}};_0x5685cf(++_0x5a5afa);}(_0x121e,0x198));var _0xe121=function(_0xf93b6d,_0x2cc413){_0xf93b6d=_0xf93b6d-0x0;var _0x2e83db=_0x121e[_0xf93b6d];return _0x2e83db;};'use strict';var _=require('lodash');var Sequelize=require(_0xe121('0x0'));module[_0xe121('0x1')]={'firstName':{'type':Sequelize[_0xe121('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xe121('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xe121('0x2')]},'country':{'type':Sequelize[_0xe121('0x2')]},'dateOfBirth':{'type':Sequelize[_0xe121('0x2')]},'description':{'type':Sequelize[_0xe121('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xe121('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xe121('0x2')]},'facebook':{'type':Sequelize[_0xe121('0x2')]},'fb_data':{'type':Sequelize[_0xe121('0x2')]},'twitter':{'type':Sequelize[_0xe121('0x2')]},'skype':{'type':Sequelize[_0xe121('0x2')]},'teams':{'type':Sequelize[_0xe121('0x2')]},'viber':{'type':Sequelize[_0xe121('0x2')]},'line':{'type':Sequelize[_0xe121('0x2')]},'wechat':{'type':Sequelize[_0xe121('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xe121('0x4')]},'priority':{'type':Sequelize[_0xe121('0x4')](0x2)[_0xe121('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 7464734..0201edf 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 _0x483f=['No\x20phone\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','child_process','fork','stringify','exit','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','fax','whatsapp','-createdAt','resolve','channel','includes','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','fullname','startCase','Website','Account','disposition','secondDisposition','thirdDisposition','key','browserName','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','substatus','threadId','Interaction','Owner','sortBy','reverse','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','register','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','push','CmCustomField','findOne','trimStart','all','fieldType','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','tools_tags','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','value','split','map','forEach','union','User','and','uc.UserId\x20=\x20?','datetime','castTo','DATE','text','start','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','tag','isArray','replace','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.id','QueryTypes','SELECT','DESC','t.id\x20IN\x20?','user','role','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.createdAt','c.deletedAt','c.CompanyId','TagIds','Tags','rows','catch','tags','columnName','findAll','displayName','alias','values','body','get','mergeWith','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailInteraction','MailMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','join','each','duplicates','$or','spread','show','params','Tag','$and','omit','format','cf_%d','pickBy','table','id\x20=\x20?','toParam','phone','getTags','rawAttributes','options','setTags','ids','getHoppers','ContactId','includeAll','getHopperHistories','getHopperFinals','include','uploadCsv','binding_values','socket_timestamp','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','file','filename','chmodSync','CompanyId','File\x20uploaded\x20correctly!','pid','upload','path','meta','agent','binding'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x483f,0x14a));var _0xf483=function(_0x5029b1,_0x260bf1){_0x5029b1=_0x5029b1-0x0;var _0x317e63=_0x483f[_0x5029b1];return _0x317e63;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf483('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf483('0x1'));var jsonpatch=require(_0xf483('0x2'));var rp=require(_0xf483('0x3'));var moment=require(_0xf483('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf483('0x5'));var util=require(_0xf483('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(_0xf483('0x7'));var _=require(_0xf483('0x8'));var squel=require(_0xf483('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf483('0xa'));var toCsv=require(_0xf483('0xb'));var querystring=require(_0xf483('0xc'));var Papa=require(_0xf483('0xd'));var Redis=require(_0xf483('0xe'));var authService=require(_0xf483('0xf'));var qs=require(_0xf483('0x10'));var as=require(_0xf483('0x11'));var hardwareService=require(_0xf483('0x12'));var logger=require('../../config/logger')(_0xf483('0x13'));var utils=require(_0xf483('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf483('0x15'));var db=require(_0xf483('0x16'))['db'];config[_0xf483('0x17')]=_['defaults'](config[_0xf483('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf483('0x17')]));require('./cmContact.socket')[_0xf483('0x18')](socket);function respondWithStatusCode(_0x5455b1,_0x3a315f){_0x3a315f=_0x3a315f||0xcc;return function(_0x47aa6d){if(_0x47aa6d){return _0x5455b1[_0xf483('0x19')](_0x3a315f);}return _0x5455b1['status'](_0x3a315f)[_0xf483('0x1a')]();};}function respondWithResult(_0x1b6b6e,_0x5120bc){_0x5120bc=_0x5120bc||0xc8;return function(_0x821a4b){if(_0x821a4b){return _0x1b6b6e[_0xf483('0x1b')](_0x5120bc)['json'](_0x821a4b);}};}function respondWithFilteredResult(_0x3c1468,_0x5db244){return function(_0x2c3ee0){if(_0x2c3ee0){var _0x4e7480=_0x2c3ee0[_0xf483('0x1c')],_0x1f8849=_0x5db244['offset'],_0x25b936=_0x5db244[_0xf483('0x1d')]+_0x5db244[_0xf483('0x1e')],_0x7f3670;if(_0x25b936>=_0x4e7480){_0x25b936=_0x4e7480;_0x7f3670=0xc8;}else{_0x7f3670=0xce;}_0x3c1468[_0xf483('0x1b')](_0x7f3670);return _0x3c1468[_0xf483('0x1f')](_0xf483('0x20'),_0x1f8849+'-'+_0x25b936+'/'+_0x4e7480)[_0xf483('0x21')](_0x2c3ee0);}return null;};}function patchUpdates(_0x55d672){return function(_0x36a7a9){try{jsonpatch[_0xf483('0x22')](_0x36a7a9,_0x55d672,!![]);}catch(_0x14d6bc){return BPromise['reject'](_0x14d6bc);}return _0x36a7a9[_0xf483('0x23')]();};}function saveUpdates(_0x1df467,_0x28c6ce){return function(_0x87eec8){if(_0x87eec8){return _0x87eec8[_0xf483('0x24')](_0x1df467)[_0xf483('0x25')](function(_0x57c049){return _0x57c049;});}return null;};}function removeEntity(_0xf67a4f,_0x30855d){return function(_0x1249a7){if(_0x1249a7){return _0x1249a7[_0xf483('0x26')]()[_0xf483('0x25')](function(){_0xf67a4f[_0xf483('0x1b')](0xcc)[_0xf483('0x1a')]();});}};}function handleEntityNotFound(_0x9b1ffc,_0x15f5ab){return function(_0x516da0){if(!_0x516da0){_0x9b1ffc[_0xf483('0x19')](0x194);}return _0x516da0;};}function handleError(_0x3eb618,_0x5449de){_0x5449de=_0x5449de||0x1f4;return function(_0x17665b){logger[_0xf483('0x27')](_0x17665b[_0xf483('0x28')]);if(_0x17665b['name']){delete _0x17665b[_0xf483('0x29')];}_0x3eb618['status'](_0x5449de)[_0xf483('0x2a')](_0x17665b);};}exports[_0xf483('0x2b')]=function(_0x49bf89,_0x41ce06){var _0x3e1dd6={},_0x498b9c={},_0x25ab64={'count':0x0,'rows':[]};return db[_0xf483('0x2c')][_0xf483('0x2d')]()[_0xf483('0x25')](function(_0x2f298e){var _0xb7cee3=[];for(var _0x25444e=0x0;_0x25444e','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','127.0.0.1','randomstring','node-tnef','../../../config/logger','email','../../../config/environment','head'];(function(_0x5a6c6d,_0x48b780){var _0x3b8089=function(_0x1ec3fb){while(--_0x1ec3fb){_0x5a6c6d['push'](_0x5a6c6d['shift']());}};_0x3b8089(++_0x48b780);}(_0x5233,0x10e));var _0x3523=function(_0x119a0b,_0x3d5901){_0x119a0b=_0x119a0b-0x0;var _0x11363e=_0x5233[_0x119a0b];return _0x11363e;};'use strict';var _=require('lodash');var moment=require('moment');var random=require(_0x3523('0x0'));var fs=require('fs');var path=require('path');var util=require('util');var tnef=require(_0x3523('0x1'));var logger=require(_0x3523('0x2'))(_0x3523('0x3'));var config=require(_0x3523('0x4'));function getAddress(_0x51571a){var _0x31a21b=_[_0x3523('0x5')](_0x51571a[_0x3523('0x6')]);return _0x31a21b&&_0x31a21b['address']?_0x31a21b[_0x3523('0x7')]:_0x3523('0x8')+random[_0x3523('0x9')](0x6)+_0x3523('0xa');}function getFirstName(_0x18ed1e){var _0x3df085=_[_0x3523('0x5')](_0x18ed1e['value']);if(_0x3df085&&_0x3df085['name']){var _0x1d2047=_0x3df085[_0x3523('0xb')]['split'](/\s+/);return _0x1d2047[_0x3523('0xc')]?_0x1d2047[_0x3523('0xd')](0x0,-0x1)[_0x3523('0xe')]('\x20'):_0x3df085['name'];}return _0x3523('0xf');}function getLastName(_0x2da38a){var _0x340295=_[_0x3523('0x5')](_0x2da38a[_0x3523('0x6')]);if(_0x340295&&_0x340295[_0x3523('0xb')]){var _0x1a97b6=_0x340295[_0x3523('0xb')][_0x3523('0x10')](/\s+/);return _0x1a97b6[_0x3523('0xc')]>0x1?_0x1a97b6['pop']():'';}return'';}function getMails(_0x1eee22,_0x5002ee){var _0x9f1c0e='';for(var _0x436c1d=0x0;_0x436c1d<_0x5002ee['value'][_0x3523('0xc')];_0x436c1d+=0x1){if(_0x5002ee[_0x3523('0x6')][_0x436c1d][_0x3523('0x7')]!==_0x1eee22){if(!_['isEmpty'](_0x9f1c0e)){_0x9f1c0e+=',';}_0x9f1c0e+=_0x5002ee[_0x3523('0x6')][_0x436c1d][_0x3523('0xb')]||_0x5002ee[_0x3523('0x6')][_0x436c1d][_0x3523('0x7')]||'';_0x9f1c0e+='\x20<';_0x9f1c0e+=_0x5002ee['value'][_0x436c1d]['address']?_0x5002ee[_0x3523('0x6')][_0x436c1d][_0x3523('0x7')]:_0x3523('0x8')+random[_0x3523('0x9')](0x6)+'@xcally.com';_0x9f1c0e+='>';}}return _0x9f1c0e;}function parseEmail(_0x35b048,_0x2e4f37,_0x4348e4){if(_0x2e4f37[_0x3523('0x11')]){var _0x72fda1=/