From: support
Date: Mon, 1 Aug 2022 14:37:44 +0000 (+0000)
Subject: Built motion from commit f6d7e26c.|2.6.14
X-Git-Url: http://repos.xcallymotion.com/base/%22./banner.jpg//%22%7B%7Blicense.messaging?a=commitdiff_plain;h=0fd45454d829cb1f367922ca1b55351b49b297ee;p=motion2.git
Built motion from commit f6d7e26c.|2.6.14
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 4847a36..e23c2b5 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-07-31T21:16:14.105Z",
+ "time": "2022-08-01T14:30:13.026Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index abac729..bcb7a2a 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-07-31T21:16:14.105Z",
+ "time": "2022-08-01T14:30:13.026Z",
"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 c92de10..c6f4aab 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 _0x46c3=['urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','action','contactManager','integration','motionbar','jscripty','bot','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'];(function(_0x5eabd7,_0x408f8f){var _0x47e0ae=function(_0x18d813){while(--_0x18d813){_0x5eabd7['push'](_0x5eabd7['shift']());}};_0x47e0ae(++_0x408f8f);}(_0x46c3,0x13e));var _0x346c=function(_0x1d0934,_0x3bbb10){_0x1d0934=_0x1d0934-0x0;var _0x4575c5=_0x46c3[_0x1d0934];return _0x4575c5;};'use strict';var Sequelize=require(_0x346c('0x0'));module[_0x346c('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xc7a813){return this['getDataValue'](_0x346c('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x346c('0x3'),_0x346c('0x4'),_0x346c('0x5'),_0x346c('0x6'),'urlForward','browser',_0x346c('0x7'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x346c('0x8')](0x1000),'comment':_0x346c('0x9')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x346c('0xa')},'data3':{'type':Sequelize[_0x346c('0x8')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x346c('0x8')](0x1000),'comments':_0x346c('0xb')},'data5':{'type':Sequelize[_0x346c('0x8')](0x1000),'comments':_0x346c('0xc')},'data6':{'type':Sequelize['STRING'],'comments':_0x346c('0xd')},'data7':{'type':Sequelize[_0x346c('0xe')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0x6ece=['urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','action','contactManager','integration','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x6ece,0x13f));var _0xe6ec=function(_0x5261d5,_0x2854f5){_0x5261d5=_0x5261d5-0x0;var _0xd340a8=_0x6ece[_0x5261d5];return _0xd340a8;};'use strict';var Sequelize=require(_0xe6ec('0x0'));module[_0xe6ec('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x358259){return this[_0xe6ec('0x2')](_0xe6ec('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xe6ec('0x4'),_0xe6ec('0x5'),'motionbar',_0xe6ec('0x6'),_0xe6ec('0x7'),_0xe6ec('0x8'),_0xe6ec('0x9'),_0xe6ec('0xa')]],'msg':_0xe6ec('0xb')}},'comment':_0xe6ec('0xb')},'data1':{'type':Sequelize[_0xe6ec('0xc')](0x1000),'comment':_0xe6ec('0xd')},'data2':{'type':Sequelize[_0xe6ec('0xc')](0x1000),'comment':_0xe6ec('0xe')},'data3':{'type':Sequelize[_0xe6ec('0xc')](0x1000),'comment':_0xe6ec('0xf')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xe6ec('0x10')},'data5':{'type':Sequelize[_0xe6ec('0xc')](0x1000),'comments':_0xe6ec('0x11')},'data6':{'type':Sequelize[_0xe6ec('0xc')],'comments':_0xe6ec('0x12')},'data7':{'type':Sequelize[_0xe6ec('0x13')],'comments':_0xe6ec('0x14')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index eedade1..81c7c2d 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 _0x9f95=['count','offset','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','body','Action','params','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit'];(function(_0x5e5218,_0x4226ef){var _0x2dcd35=function(_0x11049f){while(--_0x11049f){_0x5e5218['push'](_0x5e5218['shift']());}};_0x2dcd35(++_0x4226ef);}(_0x9f95,0x1c2));var _0x59f9=function(_0x399e3b,_0x5dd3d2){_0x399e3b=_0x399e3b-0x0;var _0x28c6a4=_0x9f95[_0x399e3b];return _0x28c6a4;};'use strict';var emlformat=require(_0x59f9('0x0'));var rimraf=require(_0x59f9('0x1'));var zipdir=require(_0x59f9('0x2'));var jsonpatch=require(_0x59f9('0x3'));var rp=require('request-promise');var moment=require(_0x59f9('0x4'));var BPromise=require(_0x59f9('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x59f9('0x6'));var sox=require('sox');var csv=require(_0x59f9('0x7'));var ejs=require(_0x59f9('0x8'));var fs=require('fs');var fs_extra=require(_0x59f9('0x9'));var _=require(_0x59f9('0xa'));var squel=require(_0x59f9('0xb'));var crypto=require(_0x59f9('0xc'));var jsforce=require(_0x59f9('0xd'));var deskjs=require(_0x59f9('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x59f9('0xf'));var Redis=require(_0x59f9('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x59f9('0x11'));var hardwareService=require(_0x59f9('0x12'));var logger=require(_0x59f9('0x13'))(_0x59f9('0x14'));var utils=require('../../config/utils');var config=require(_0x59f9('0x15'));var licenseUtil=require(_0x59f9('0x16'));var db=require(_0x59f9('0x17'))['db'];function respondWithStatusCode(_0x3a049e,_0x3676cb){_0x3676cb=_0x3676cb||0xcc;return function(_0x4439e1){if(_0x4439e1){return _0x3a049e[_0x59f9('0x18')](_0x3676cb);}return _0x3a049e[_0x59f9('0x19')](_0x3676cb)[_0x59f9('0x1a')]();};}function respondWithResult(_0x3f907f,_0x996924){_0x996924=_0x996924||0xc8;return function(_0x26aaab){if(_0x26aaab){return _0x3f907f[_0x59f9('0x19')](_0x996924)[_0x59f9('0x1b')](_0x26aaab);}};}function respondWithFilteredResult(_0x317952,_0x33d05d){return function(_0x335e4c){if(_0x335e4c){var _0x1fbeeb=typeof _0x33d05d['offset']===_0x59f9('0x1c')&&typeof _0x33d05d[_0x59f9('0x1d')]===_0x59f9('0x1c');var _0x48d5cd=_0x335e4c['count'];var _0x55dd44=_0x1fbeeb?0x0:_0x33d05d['offset'];var _0x49e44a=_0x1fbeeb?_0x335e4c[_0x59f9('0x1e')]:_0x33d05d[_0x59f9('0x1f')]+_0x33d05d[_0x59f9('0x1d')];var _0x37a6df;if(_0x49e44a>=_0x48d5cd){_0x49e44a=_0x48d5cd;_0x37a6df=0xc8;}else{_0x37a6df=0xce;}_0x317952[_0x59f9('0x19')](_0x37a6df);return _0x317952[_0x59f9('0x20')](_0x59f9('0x21'),_0x55dd44+'-'+_0x49e44a+'/'+_0x48d5cd)[_0x59f9('0x1b')](_0x335e4c);}return null;};}function patchUpdates(_0x10d8c8){return function(_0x36ce7a){try{jsonpatch[_0x59f9('0x22')](_0x36ce7a,_0x10d8c8,!![]);}catch(_0xb64b52){return BPromise[_0x59f9('0x23')](_0xb64b52);}return _0x36ce7a['save']();};}function saveUpdates(_0x543d07,_0x40ae28){return function(_0x745517){if(_0x745517){return _0x745517[_0x59f9('0x24')](_0x543d07)['then'](function(_0x554bdd){return _0x554bdd;});}return null;};}function removeEntity(_0x24f202,_0xc2ea4f){return function(_0x1818dd){if(_0x1818dd){return _0x1818dd[_0x59f9('0x25')]()[_0x59f9('0x26')](function(){_0x24f202[_0x59f9('0x19')](0xcc)[_0x59f9('0x1a')]();});}};}function handleEntityNotFound(_0x21c984,_0x3cd53e){return function(_0x4f5b7c){if(!_0x4f5b7c){_0x21c984[_0x59f9('0x18')](0x194);}return _0x4f5b7c;};}function handleError(_0x3ffb5b,_0x2fb99d){_0x2fb99d=_0x2fb99d||0x1f4;return function(_0x3da7e4){logger[_0x59f9('0x27')](_0x3da7e4[_0x59f9('0x28')]);if(_0x3da7e4[_0x59f9('0x29')]){delete _0x3da7e4[_0x59f9('0x29')];}_0x3ffb5b[_0x59f9('0x19')](_0x2fb99d)[_0x59f9('0x2a')](_0x3da7e4);};}exports['update']=function(_0x1f1ee5,_0x36afd4){if(_0x1f1ee5[_0x59f9('0x2b')]['id']){delete _0x1f1ee5[_0x59f9('0x2b')]['id'];}return db[_0x59f9('0x2c')]['find']({'where':{'id':_0x1f1ee5[_0x59f9('0x2d')]['id']}})[_0x59f9('0x26')](handleEntityNotFound(_0x36afd4,null))[_0x59f9('0x26')](saveUpdates(_0x1f1ee5[_0x59f9('0x2b')],null))[_0x59f9('0x26')](respondWithResult(_0x36afd4,null))[_0x59f9('0x2e')](handleError(_0x36afd4,null));};exports[_0x59f9('0x25')]=function(_0x39b93d,_0x274ffb){return db[_0x59f9('0x2c')][_0x59f9('0x2f')]({'where':{'id':_0x39b93d[_0x59f9('0x2d')]['id']}})[_0x59f9('0x26')](handleEntityNotFound(_0x274ffb,null))[_0x59f9('0x26')](removeEntity(_0x274ffb,null))['catch'](handleError(_0x274ffb,null));};
\ No newline at end of file
+var _0x339e=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','save','update','destroy','end','stack','name','send','body','Action','find','params','then','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x1034bb,_0x4e20b3){var _0x453fdb=function(_0x455356){while(--_0x455356){_0x1034bb['push'](_0x1034bb['shift']());}};_0x453fdb(++_0x4e20b3);}(_0x339e,0xa3));var _0xe339=function(_0x13ac10,_0x46e79e){_0x13ac10=_0x13ac10-0x0;var _0x28eda2=_0x339e[_0x13ac10];return _0x28eda2;};'use strict';var emlformat=require(_0xe339('0x0'));var rimraf=require(_0xe339('0x1'));var zipdir=require(_0xe339('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe339('0x3'));var moment=require(_0xe339('0x4'));var BPromise=require(_0xe339('0x5'));var Mustache=require(_0xe339('0x6'));var util=require(_0xe339('0x7'));var path=require(_0xe339('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe339('0x9'));var _=require(_0xe339('0xa'));var squel=require(_0xe339('0xb'));var crypto=require(_0xe339('0xc'));var jsforce=require(_0xe339('0xd'));var deskjs=require(_0xe339('0xe'));var toCsv=require(_0xe339('0xf'));var querystring=require(_0xe339('0x10'));var Papa=require(_0xe339('0x11'));var Redis=require(_0xe339('0x12'));var authService=require(_0xe339('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe339('0x14'));var logger=require('../../config/logger')(_0xe339('0x15'));var utils=require(_0xe339('0x16'));var config=require(_0xe339('0x17'));var licenseUtil=require(_0xe339('0x18'));var db=require(_0xe339('0x19'))['db'];function respondWithStatusCode(_0x3345b7,_0x516e20){_0x516e20=_0x516e20||0xcc;return function(_0x182577){if(_0x182577){return _0x3345b7[_0xe339('0x1a')](_0x516e20);}return _0x3345b7[_0xe339('0x1b')](_0x516e20)['end']();};}function respondWithResult(_0x38c116,_0x2f9c4b){_0x2f9c4b=_0x2f9c4b||0xc8;return function(_0x6f1555){if(_0x6f1555){return _0x38c116['status'](_0x2f9c4b)[_0xe339('0x1c')](_0x6f1555);}};}function respondWithFilteredResult(_0x545ecf,_0x347f07){return function(_0xa31607){if(_0xa31607){var _0x5cafb9=typeof _0x347f07[_0xe339('0x1d')]===_0xe339('0x1e')&&typeof _0x347f07[_0xe339('0x1f')]===_0xe339('0x1e');var _0x27c60f=_0xa31607[_0xe339('0x20')];var _0xf52dc1=_0x5cafb9?0x0:_0x347f07[_0xe339('0x1d')];var _0x1a5245=_0x5cafb9?_0xa31607[_0xe339('0x20')]:_0x347f07['offset']+_0x347f07[_0xe339('0x1f')];var _0x5e506b;if(_0x1a5245>=_0x27c60f){_0x1a5245=_0x27c60f;_0x5e506b=0xc8;}else{_0x5e506b=0xce;}_0x545ecf[_0xe339('0x1b')](_0x5e506b);return _0x545ecf[_0xe339('0x21')]('Content-Range',_0xf52dc1+'-'+_0x1a5245+'/'+_0x27c60f)['json'](_0xa31607);}return null;};}function patchUpdates(_0x1265d5){return function(_0x3a410a){try{jsonpatch['apply'](_0x3a410a,_0x1265d5,!![]);}catch(_0x2e6d59){return BPromise['reject'](_0x2e6d59);}return _0x3a410a[_0xe339('0x22')]();};}function saveUpdates(_0x2d0695,_0x5f3331){return function(_0x115d34){if(_0x115d34){return _0x115d34[_0xe339('0x23')](_0x2d0695)['then'](function(_0x55f8f1){return _0x55f8f1;});}return null;};}function removeEntity(_0x552d95,_0xbfe710){return function(_0x4c66ae){if(_0x4c66ae){return _0x4c66ae[_0xe339('0x24')]()['then'](function(){_0x552d95[_0xe339('0x1b')](0xcc)[_0xe339('0x25')]();});}};}function handleEntityNotFound(_0x5a85e2,_0x552784){return function(_0x457089){if(!_0x457089){_0x5a85e2[_0xe339('0x1a')](0x194);}return _0x457089;};}function handleError(_0x36502d,_0x3dbd10){_0x3dbd10=_0x3dbd10||0x1f4;return function(_0x25dfbd){logger['error'](_0x25dfbd[_0xe339('0x26')]);if(_0x25dfbd[_0xe339('0x27')]){delete _0x25dfbd['name'];}_0x36502d[_0xe339('0x1b')](_0x3dbd10)[_0xe339('0x28')](_0x25dfbd);};}exports[_0xe339('0x23')]=function(_0x1d4a55,_0x46d188){if(_0x1d4a55[_0xe339('0x29')]['id']){delete _0x1d4a55[_0xe339('0x29')]['id'];}return db[_0xe339('0x2a')][_0xe339('0x2b')]({'where':{'id':_0x1d4a55[_0xe339('0x2c')]['id']}})[_0xe339('0x2d')](handleEntityNotFound(_0x46d188,null))[_0xe339('0x2d')](saveUpdates(_0x1d4a55['body'],null))['then'](respondWithResult(_0x46d188,null))[_0xe339('0x2e')](handleError(_0x46d188,null));};exports['destroy']=function(_0xac9faa,_0x245188){return db[_0xe339('0x2a')][_0xe339('0x2b')]({'where':{'id':_0xac9faa['params']['id']}})[_0xe339('0x2d')](handleEntityNotFound(_0x245188,null))[_0xe339('0x2d')](removeEntity(_0x245188,null))[_0xe339('0x2e')](handleError(_0x245188,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index d59fa75..e3333b7 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 _0x4fab=['moment','request-promise','path','rimraf','../../config/environment','tools_actions','util','../../config/logger','api'];(function(_0x64f937,_0x204fb1){var _0x5e32c0=function(_0x31eb33){while(--_0x31eb33){_0x64f937['push'](_0x64f937['shift']());}};_0x5e32c0(++_0x204fb1);}(_0x4fab,0x72));var _0xb4fa=function(_0x8c324c,_0xe6ae64){_0x8c324c=_0x8c324c-0x0;var _0x12bbb9=_0x4fab[_0x8c324c];return _0x12bbb9;};'use strict';var _=require('lodash');var util=require(_0xb4fa('0x0'));var logger=require(_0xb4fa('0x1'))(_0xb4fa('0x2'));var moment=require(_0xb4fa('0x3'));var BPromise=require('bluebird');var rp=require(_0xb4fa('0x4'));var fs=require('fs');var path=require(_0xb4fa('0x5'));var rimraf=require(_0xb4fa('0x6'));var config=require(_0xb4fa('0x7'));var attributes=require('./action.attributes');module['exports']=function(_0x4cfd88,_0x21c30a){return _0x4cfd88['define']('Action',attributes,{'tableName':_0xb4fa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8998=['Action','tools_actions','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports'];(function(_0x53a0ce,_0x5eaa86){var _0x491112=function(_0xb4b450){while(--_0xb4b450){_0x53a0ce['push'](_0x53a0ce['shift']());}};_0x491112(++_0x5eaa86);}(_0x8998,0x1ca));var _0x8899=function(_0x44b3d0,_0x5e2592){_0x44b3d0=_0x44b3d0-0x0;var _0x14e438=_0x8998[_0x44b3d0];return _0x14e438;};'use strict';var _=require(_0x8899('0x0'));var util=require(_0x8899('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8899('0x2'));var BPromise=require(_0x8899('0x3'));var rp=require(_0x8899('0x4'));var fs=require('fs');var path=require(_0x8899('0x5'));var rimraf=require(_0x8899('0x6'));var config=require(_0x8899('0x7'));var attributes=require(_0x8899('0x8'));module[_0x8899('0x9')]=function(_0x333623,_0x28947d){return _0x333623['define'](_0x8899('0xa'),attributes,{'tableName':_0x8899('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 f35d47a..72d8db6 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 _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x5054c0,_0x3213da){var _0x127010=function(_0x16d5ef){while(--_0x16d5ef){_0x5054c0['push'](_0x5054c0['shift']());}};_0x127010(++_0x3213da);}(_0xabce,0x103));var _0xeabc=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xabce[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
+var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x263785,_0xfc374c){var _0x23f2a3=function(_0x26a168){while(--_0x26a168){_0x263785['push'](_0x263785['shift']());}};_0x23f2a3(++_0xfc374c);}(_0xabce,0x103));var _0xeabc=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xabce[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index aaf97de..763f7ed 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 _0x50e0=['util','path','connect-timeout','Router','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer'];(function(_0x1eb82d,_0x1e23cb){var _0x2c9502=function(_0x4a3500){while(--_0x4a3500){_0x1eb82d['push'](_0x1eb82d['shift']());}};_0x2c9502(++_0x1e23cb);}(_0x50e0,0x19f));var _0x050e=function(_0x427fbd,_0xfa52d){_0x427fbd=_0x427fbd-0x0;var _0x4eddcc=_0x50e0[_0x427fbd];return _0x4eddcc;};'use strict';var multer=require(_0x050e('0x0'));var util=require(_0x050e('0x1'));var path=require(_0x050e('0x2'));var timeout=require(_0x050e('0x3'));var express=require('express');var router=express[_0x050e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x050e('0x5'));router[_0x050e('0x6')](_0x050e('0x7'),auth[_0x050e('0x8')](),controller[_0x050e('0x9')]);router[_0x050e('0xa')](_0x050e('0x7'),auth['isAuthenticated'](),controller[_0x050e('0xb')]);module[_0x050e('0xc')]=router;
\ No newline at end of file
+var _0xd8e2=['isAuthenticated','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','put','/:id'];(function(_0x4a632f,_0x200ab6){var _0x306a2c=function(_0x3e4988){while(--_0x3e4988){_0x4a632f['push'](_0x4a632f['shift']());}};_0x306a2c(++_0x200ab6);}(_0xd8e2,0x6f));var _0x2d8e=function(_0x351e48,_0x1c29df){_0x351e48=_0x351e48-0x0;var _0x326d3a=_0xd8e2[_0x351e48];return _0x326d3a;};'use strict';var multer=require('multer');var util=require(_0x2d8e('0x0'));var path=require(_0x2d8e('0x1'));var timeout=require(_0x2d8e('0x2'));var express=require('express');var router=express[_0x2d8e('0x3')]();var fs_extra=require(_0x2d8e('0x4'));var auth=require(_0x2d8e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2d8e('0x6'));var controller=require('./action.controller');router[_0x2d8e('0x7')](_0x2d8e('0x8'),auth[_0x2d8e('0x9')](),controller['update']);router['delete'](_0x2d8e('0x8'),auth[_0x2d8e('0x9')](),controller[_0x2d8e('0xa')]);module[_0x2d8e('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 1c446ce..c35ad2c 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0x5b7c74,_0x489563){var _0x303ee0=function(_0x15abd7){while(--_0x15abd7){_0x5b7c74['push'](_0x5b7c74['shift']());}};_0x303ee0(++_0x489563);}(_0x98a8,0x12c));var _0x898a=function(_0x2d4c6f,_0x246d71){_0x2d4c6f=_0x2d4c6f-0x0;var _0x4445a6=_0x98a8[_0x2d4c6f];return _0x4445a6;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x898a('0x2')]},'parent':{'type':Sequelize[_0x898a('0x2')]},'table':{'type':Sequelize[_0x898a('0x2')]},'conditions':{'type':Sequelize[_0x898a('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xa630=['STRING','TEXT','sequelize','exports'];(function(_0x267096,_0x549583){var _0x4c4847=function(_0x5a56f5){while(--_0x5a56f5){_0x267096['push'](_0x267096['shift']());}};_0x4c4847(++_0x549583);}(_0xa630,0xbe));var _0x0a63=function(_0x107a52,_0x298ca2){_0x107a52=_0x107a52-0x0;var _0xffd148=_0xa630[_0x107a52];return _0xffd148;};'use strict';var Sequelize=require(_0x0a63('0x0'));module[_0x0a63('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x0a63('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x0a63('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index e70b361..baa5fea 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 _0x9c7d=['findAll','rows','catch','params','keys','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','error','update','destroy','preview','join','left_join','right_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','operator','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','SUM(%s)','COUNT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','from','orderBy','output','web','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','QueryTypes','run','runReport','cross_join','debug','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','limit','undefined','count','Content-Range','reject','then','get','CustomReports','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','AnalyticCustomReport','includeAll'];(function(_0x458ca7,_0x55cbb2){var _0x4a0935=function(_0x268442){while(--_0x268442){_0x458ca7['push'](_0x458ca7['shift']());}};_0x4a0935(++_0x55cbb2);}(_0x9c7d,0x1ba));var _0xd9c7=function(_0x57486e,_0x32283b){_0x57486e=_0x57486e-0x0;var _0x5f110b=_0x9c7d[_0x57486e];return _0x5f110b;};'use strict';var emlformat=require(_0xd9c7('0x0'));var rimraf=require(_0xd9c7('0x1'));var zipdir=require(_0xd9c7('0x2'));var jsonpatch=require(_0xd9c7('0x3'));var rp=require(_0xd9c7('0x4'));var moment=require(_0xd9c7('0x5'));var BPromise=require(_0xd9c7('0x6'));var Mustache=require(_0xd9c7('0x7'));var util=require('util');var path=require(_0xd9c7('0x8'));var sox=require(_0xd9c7('0x9'));var csv=require(_0xd9c7('0xa'));var ejs=require(_0xd9c7('0xb'));var fs=require('fs');var fs_extra=require(_0xd9c7('0xc'));var _=require('lodash');var squel=require(_0xd9c7('0xd'));var crypto=require('crypto');var jsforce=require(_0xd9c7('0xe'));var deskjs=require(_0xd9c7('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd9c7('0x10'));var Papa=require(_0xd9c7('0x11'));var Redis=require(_0xd9c7('0x12'));var authService=require(_0xd9c7('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xd9c7('0x14'));var hardwareService=require(_0xd9c7('0x15'));var logger=require(_0xd9c7('0x16'))(_0xd9c7('0x17'));var utils=require(_0xd9c7('0x18'));var config=require(_0xd9c7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd9c7('0x1a'))['db'];var dbH=require(_0xd9c7('0x1a'))[_0xd9c7('0x1b')];function respondWithStatusCode(_0x1e4842,_0xb1e072){_0xb1e072=_0xb1e072||0xcc;return function(_0x4e0cb3){if(_0x4e0cb3){return _0x1e4842[_0xd9c7('0x1c')](_0xb1e072);}return _0x1e4842[_0xd9c7('0x1d')](_0xb1e072)['end']();};}function respondWithResult(_0x518b40,_0x204b0e){_0x204b0e=_0x204b0e||0xc8;return function(_0x5605e1){if(_0x5605e1){return _0x518b40['status'](_0x204b0e)[_0xd9c7('0x1e')](_0x5605e1);}};}function respondWithFilteredResult(_0x169e91,_0x2a4650){return function(_0x2d8e5c){if(_0x2d8e5c){var _0x1e07d9=typeof _0x2a4650[_0xd9c7('0x1f')]==='undefined'&&typeof _0x2a4650[_0xd9c7('0x20')]===_0xd9c7('0x21');var _0x490350=_0x2d8e5c[_0xd9c7('0x22')];var _0x28700b=_0x1e07d9?0x0:_0x2a4650[_0xd9c7('0x1f')];var _0x396dc3=_0x1e07d9?_0x2d8e5c['count']:_0x2a4650[_0xd9c7('0x1f')]+_0x2a4650[_0xd9c7('0x20')];var _0x7e6d78;if(_0x396dc3>=_0x490350){_0x396dc3=_0x490350;_0x7e6d78=0xc8;}else{_0x7e6d78=0xce;}_0x169e91['status'](_0x7e6d78);return _0x169e91['set'](_0xd9c7('0x23'),_0x28700b+'-'+_0x396dc3+'/'+_0x490350)[_0xd9c7('0x1e')](_0x2d8e5c);}return null;};}function patchUpdates(_0x5e85e6){return function(_0x38cd8d){try{jsonpatch['apply'](_0x38cd8d,_0x5e85e6,!![]);}catch(_0x4a9bc6){return BPromise[_0xd9c7('0x24')](_0x4a9bc6);}return _0x38cd8d['save']();};}function saveUpdates(_0x7d4146,_0x363a3c){return function(_0x542159){if(_0x542159){return _0x542159['update'](_0x7d4146)[_0xd9c7('0x25')](function(_0x12b7b3){return _0x12b7b3;});}return null;};}function removeEntity(_0x34daa5,_0x1b3992){return function(_0x4d9427){if(_0x4d9427){return _0x4d9427['destroy']()['then'](function(){var _0x291a60=_0x4d9427[_0xd9c7('0x26')]({'plain':!![]});var _0x116ba4=_0xd9c7('0x27');return db[_0xd9c7('0x28')]['destroy']({'where':{'type':_0x116ba4,'resourceId':_0x291a60['id']}})[_0xd9c7('0x25')](function(){return _0x4d9427;});})[_0xd9c7('0x25')](function(){_0x34daa5[_0xd9c7('0x1d')](0xcc)[_0xd9c7('0x29')]();});}};}function handleEntityNotFound(_0x15620c,_0x1a2227){return function(_0x1c7d2b){if(!_0x1c7d2b){_0x15620c[_0xd9c7('0x1c')](0x194);}return _0x1c7d2b;};}function handleError(_0x561d8d,_0x35d66a){_0x35d66a=_0x35d66a||0x1f4;return function(_0x2fe1b9){logger['error'](_0x2fe1b9['stack']);if(_0x2fe1b9[_0xd9c7('0x2a')]){delete _0x2fe1b9[_0xd9c7('0x2a')];}_0x561d8d[_0xd9c7('0x1d')](_0x35d66a)[_0xd9c7('0x2b')](_0x2fe1b9);};}exports[_0xd9c7('0x2c')]=function(_0x5dcbb4,_0x1056c7){var _0x3af43b={},_0x496319={},_0x38b3bb={'count':0x0,'rows':[]};var _0x14aedb=_[_0xd9c7('0x2d')](db['AnalyticCustomReport'][_0xd9c7('0x2e')],function(_0x4d5e83){return{'name':_0x4d5e83[_0xd9c7('0x2f')],'type':_0x4d5e83[_0xd9c7('0x30')][_0xd9c7('0x31')]};});_0x496319['model']=_[_0xd9c7('0x2d')](_0x14aedb,'name');_0x496319[_0xd9c7('0x32')]=_['keys'](_0x5dcbb4[_0xd9c7('0x32')]);_0x496319[_0xd9c7('0x33')]=_[_0xd9c7('0x34')](_0x496319[_0xd9c7('0x35')],_0x496319[_0xd9c7('0x32')]);_0x3af43b[_0xd9c7('0x36')]=_[_0xd9c7('0x34')](_0x496319[_0xd9c7('0x35')],qs[_0xd9c7('0x37')](_0x5dcbb4['query'][_0xd9c7('0x37')]));_0x3af43b[_0xd9c7('0x36')]=_0x3af43b[_0xd9c7('0x36')][_0xd9c7('0x38')]?_0x3af43b[_0xd9c7('0x36')]:_0x496319[_0xd9c7('0x35')];if(!_0x5dcbb4[_0xd9c7('0x32')][_0xd9c7('0x39')](_0xd9c7('0x3a'))){_0x3af43b['limit']=qs[_0xd9c7('0x20')](_0x5dcbb4[_0xd9c7('0x32')][_0xd9c7('0x20')]);_0x3af43b[_0xd9c7('0x1f')]=qs[_0xd9c7('0x1f')](_0x5dcbb4[_0xd9c7('0x32')]['offset']);}_0x3af43b[_0xd9c7('0x3b')]=qs[_0xd9c7('0x3c')](_0x5dcbb4['query']['sort']);_0x3af43b['where']=qs[_0xd9c7('0x33')](_[_0xd9c7('0x3d')](_0x5dcbb4['query'],_0x496319[_0xd9c7('0x33')]),_0x14aedb);if(_0x5dcbb4[_0xd9c7('0x32')]['filter']){_0x3af43b[_0xd9c7('0x3e')]=_[_0xd9c7('0x3f')](_0x3af43b[_0xd9c7('0x3e')],{'$or':_[_0xd9c7('0x2d')](_0x14aedb,function(_0x4ad8cb){if(_0x4ad8cb['type']!=='VIRTUAL'){var _0x3cb0f9={};_0x3cb0f9[_0x4ad8cb[_0xd9c7('0x2a')]]={'$like':'%'+_0x5dcbb4[_0xd9c7('0x32')][_0xd9c7('0x40')]+'%'};return _0x3cb0f9;}})});}_0x3af43b=_[_0xd9c7('0x3f')]({},_0x3af43b,_0x5dcbb4[_0xd9c7('0x41')]);var _0x174e21={'where':_0x3af43b['where']};return db[_0xd9c7('0x42')][_0xd9c7('0x22')](_0x174e21)[_0xd9c7('0x25')](function(_0x1dad62){_0x38b3bb['count']=_0x1dad62;if(_0x5dcbb4[_0xd9c7('0x32')][_0xd9c7('0x43')]){_0x3af43b['include']=[{'all':!![]}];}return db[_0xd9c7('0x42')][_0xd9c7('0x44')](_0x3af43b);})[_0xd9c7('0x25')](function(_0x2c0d2e){_0x38b3bb[_0xd9c7('0x45')]=_0x2c0d2e;return _0x38b3bb;})[_0xd9c7('0x25')](respondWithFilteredResult(_0x1056c7,_0x3af43b))[_0xd9c7('0x46')](handleError(_0x1056c7,null));};exports['show']=function(_0x2be492,_0x25ad14){var _0x8035be={'raw':![],'where':{'id':_0x2be492[_0xd9c7('0x47')]['id']}},_0x398fc9={};_0x398fc9[_0xd9c7('0x35')]=_['keys'](db[_0xd9c7('0x42')][_0xd9c7('0x2e')]);_0x398fc9[_0xd9c7('0x32')]=_[_0xd9c7('0x48')](_0x2be492[_0xd9c7('0x32')]);_0x398fc9[_0xd9c7('0x33')]=_[_0xd9c7('0x34')](_0x398fc9[_0xd9c7('0x35')],_0x398fc9[_0xd9c7('0x32')]);_0x8035be[_0xd9c7('0x36')]=_['intersection'](_0x398fc9[_0xd9c7('0x35')],qs['fields'](_0x2be492[_0xd9c7('0x32')][_0xd9c7('0x37')]));_0x8035be[_0xd9c7('0x36')]=_0x8035be['attributes']['length']?_0x8035be[_0xd9c7('0x36')]:_0x398fc9[_0xd9c7('0x35')];if(_0x2be492['query'][_0xd9c7('0x43')]){_0x8035be[_0xd9c7('0x49')]=[{'all':!![]}];}_0x8035be=_[_0xd9c7('0x3f')]({},_0x8035be,_0x2be492[_0xd9c7('0x41')]);return db[_0xd9c7('0x42')][_0xd9c7('0x4a')](_0x8035be)[_0xd9c7('0x25')](handleEntityNotFound(_0x25ad14,null))[_0xd9c7('0x25')](respondWithResult(_0x25ad14,null))[_0xd9c7('0x46')](handleError(_0x25ad14,null));};exports[_0xd9c7('0x4b')]=function(_0x3c9ecd,_0x6e25dc){return db['AnalyticCustomReport'][_0xd9c7('0x4b')](_0x3c9ecd[_0xd9c7('0x4c')],{})[_0xd9c7('0x25')](function(_0x17cabc){var _0x1e6260=_0x3c9ecd['user'][_0xd9c7('0x26')]({'plain':!![]});if(!_0x1e6260)throw new Error(_0xd9c7('0x4d'));if(_0x1e6260[_0xd9c7('0x4e')]===_0xd9c7('0x4f')){var _0x395d3f=_0x17cabc['get']({'plain':!![]});var _0x5ddb96=_0xd9c7('0x50');return db[_0xd9c7('0x51')][_0xd9c7('0x4a')]({'where':{'name':_0x5ddb96,'userProfileId':_0x1e6260[_0xd9c7('0x52')]},'raw':!![]})['then'](function(_0x5c44b1){if(_0x5c44b1&&_0x5c44b1['autoAssociation']===0x0){return db[_0xd9c7('0x28')][_0xd9c7('0x4b')]({'name':_0x395d3f[_0xd9c7('0x2a')],'resourceId':_0x395d3f['id'],'type':_0xd9c7('0x27'),'sectionId':_0x5c44b1['id']},{})[_0xd9c7('0x25')](function(){return _0x17cabc;});}else{return _0x17cabc;}})[_0xd9c7('0x46')](function(_0x2431f1){logger[_0xd9c7('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2431f1);throw _0x2431f1;});}return _0x17cabc;})[_0xd9c7('0x25')](respondWithResult(_0x6e25dc,0xc9))[_0xd9c7('0x46')](handleError(_0x6e25dc,null));};exports[_0xd9c7('0x54')]=function(_0x324ddb,_0x11628c){if(_0x324ddb['body']['id']){delete _0x324ddb[_0xd9c7('0x4c')]['id'];}return db[_0xd9c7('0x42')]['find']({'where':{'id':_0x324ddb[_0xd9c7('0x47')]['id']}})[_0xd9c7('0x25')](handleEntityNotFound(_0x11628c,null))['then'](saveUpdates(_0x324ddb[_0xd9c7('0x4c')],null))[_0xd9c7('0x25')](respondWithResult(_0x11628c,null))[_0xd9c7('0x46')](handleError(_0x11628c,null));};exports[_0xd9c7('0x55')]=function(_0x48c59e,_0x1e5633){return db[_0xd9c7('0x42')][_0xd9c7('0x4a')]({'where':{'id':_0x48c59e[_0xd9c7('0x47')]['id']}})['then'](handleEntityNotFound(_0x1e5633,null))[_0xd9c7('0x25')](removeEntity(_0x1e5633,null))[_0xd9c7('0x46')](handleError(_0x1e5633,null));};exports[_0xd9c7('0x56')]=function(_0x56a46e,_0x35bd8e){var _0x45d648=0xa;var _0x1bd3c8=[_0xd9c7('0x57'),_0xd9c7('0x58'),_0xd9c7('0x59'),'cross_join'];var _0xacd55c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd9c7('0x5a'),'MAX':_0xd9c7('0x5b'),'MIN':_0xd9c7('0x5c'),'AVG':_0xd9c7('0x5d'),'GROUP_CONCAT':_0xd9c7('0x5e'),'GROUP_CONCAT ASC':_0xd9c7('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3e2fa7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xd9c7('0x60'),'ROUND':_0xd9c7('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x164dd5=function(_0x4d885c){return!_[_0xd9c7('0x62')]([_0xd9c7('0x63'),_0xd9c7('0x64'),'IS\x20EMPTY',_0xd9c7('0x65')],_0x4d885c);};var _0x51de1a=function(_0x3c8488){if(!_0x3c8488||!_0x3c8488['rules'][_0xd9c7('0x38')]){return'';}for(var _0x2b9c22='(',_0x41fd6f=0x0;_0x41fd6f<_0x3c8488['rules'][_0xd9c7('0x38')];_0x41fd6f+=0x1){_0x41fd6f>0x0&&(_0x2b9c22+='\x20'+_0x3c8488[_0xd9c7('0x66')]+'\x20');_0x2b9c22+=_0x3c8488[_0xd9c7('0x67')][_0x41fd6f][_0xd9c7('0x68')]?_0x51de1a(_0x3c8488[_0xd9c7('0x67')][_0x41fd6f][_0xd9c7('0x68')]):_0x3c8488[_0xd9c7('0x67')][_0x41fd6f][_0xd9c7('0x69')]+'\x20'+_0x3c8488[_0xd9c7('0x67')][_0x41fd6f][_0xd9c7('0x6a')]+(_0x164dd5(_0x3c8488[_0xd9c7('0x67')][_0x41fd6f]['condition'])?'\x20'+_0x3c8488[_0xd9c7('0x67')][_0x41fd6f][_0xd9c7('0x6b')]:'');}return _0x2b9c22+')';};var _0x4a8e84={'where':{'id':_0x56a46e[_0xd9c7('0x47')]['id']}},_0xa13c7e,_0x134eeb,_0x22093a,_0x32a230,_0x37d59b;_0x4a8e84=_[_0xd9c7('0x3f')]({},_0x4a8e84,_0x56a46e[_0xd9c7('0x41')]);return db['AnalyticCustomReport'][_0xd9c7('0x4a')](_0x4a8e84)[_0xd9c7('0x25')](function(_0x560586){if(_0x560586){_0xa13c7e=_0x560586;return _0x560586[_0xd9c7('0x6c')]();}return null;})['then'](function(_0x179eaf){if(_0x179eaf){if(!_0x179eaf[_0xd9c7('0x38')]){throw new db[(_0xd9c7('0x6d'))][(_0xd9c7('0x6e'))](_0xd9c7('0x6f'),0x193);}_0x134eeb=_0x179eaf;return db[_0xd9c7('0x70')][_0xd9c7('0x44')]({'raw':!![]});}return null;})[_0xd9c7('0x25')](function(_0x5ad050){if(_0x5ad050){_0x22093a=_[_0xd9c7('0x71')](_0x5ad050,'id');var _0xb5131d;var _0x3fe930=squel[_0xd9c7('0x72')]();_0x3fe930['from'](_0xa13c7e[_0xd9c7('0x73')]);for(var _0x5db7f4=0x0;_0x5db7f4<_0x134eeb['length'];_0x5db7f4+=0x1){_0xb5131d=_0x134eeb[_0x5db7f4]['MetricId']?_0x22093a[_0x134eeb[_0x5db7f4][_0xd9c7('0x74')]][_0xd9c7('0x75')]:_0x134eeb[_0x5db7f4][_0xd9c7('0x69')];_0xb5131d=_0x134eeb[_0x5db7f4][_0xd9c7('0x76')]?_[_0xd9c7('0x77')](_0xacd55c[_0x134eeb[_0x5db7f4][_0xd9c7('0x76')]],'%s',_0xb5131d):_0xb5131d;_0xb5131d=_0x134eeb[_0x5db7f4]['format']?_[_0xd9c7('0x77')](_0x3e2fa7[_0x134eeb[_0x5db7f4][_0xd9c7('0x78')]],'%s',_0xb5131d):_0xb5131d;if(_0x134eeb[_0x5db7f4][_0xd9c7('0x79')]){_0x3fe930[_0xd9c7('0x68')](_0xb5131d);}_0x134eeb[_0x5db7f4]['orderBy']&&_0x3fe930['order'](_0xb5131d,_0x134eeb[_0x5db7f4]['orderBy']===_0xd9c7('0x7a')?![]:!![]);_0x3fe930[_0xd9c7('0x69')](_0xb5131d,_0x134eeb[_0x5db7f4][_0xd9c7('0x7b')]||_0xb5131d);}if(_0xa13c7e['joins']){_0xa13c7e[_0xd9c7('0x7c')]=JSON[_0xd9c7('0x7d')](_0xa13c7e[_0xd9c7('0x7c')]);for(var _0x4b8dae=0x0;_0x4b8dae<_0xa13c7e['joins']['length'];_0x4b8dae+=0x1){if(_0xa13c7e[_0xd9c7('0x7c')][_0x4b8dae]['type']&&_[_0xd9c7('0x62')](_0x1bd3c8,_0xa13c7e[_0xd9c7('0x7c')][_0x4b8dae][_0xd9c7('0x30')])&&_0xa13c7e[_0xd9c7('0x7c')][_0x4b8dae][_0xd9c7('0x7e')]&&_0xa13c7e[_0xd9c7('0x7c')][_0x4b8dae][_0xd9c7('0x7f')]&&_0xa13c7e[_0xd9c7('0x7c')][_0x4b8dae]['foreignKey']){_0x3fe930[_0xa13c7e['joins'][_0x4b8dae][_0xd9c7('0x30')]](_0xa13c7e[_0xd9c7('0x7c')][_0x4b8dae][_0xd9c7('0x7f')],null,util[_0xd9c7('0x78')](_0xd9c7('0x80'),_0xa13c7e['table'],_0xa13c7e['joins'][_0x4b8dae][_0xd9c7('0x7e')],_0xa13c7e[_0xd9c7('0x7c')][_0x4b8dae]['foreignTable'],_0xa13c7e[_0xd9c7('0x7c')][_0x4b8dae][_0xd9c7('0x81')]));}}}if(_0xa13c7e[_0xd9c7('0x82')]){_0xa13c7e['conditions']=JSON[_0xd9c7('0x7d')](_0xa13c7e[_0xd9c7('0x82')]);_0x3fe930[_0xd9c7('0x3e')](_0x51de1a(_0xa13c7e[_0xd9c7('0x82')][_0xd9c7('0x68')]));}_0x37d59b=_0x3fe930[_0xd9c7('0x83')]();_0x3fe930[_0xd9c7('0x20')](_0x45d648);_0x3fe930[_0xd9c7('0x1f')](0x0);logger['debug'](_0xd9c7('0x84'),_0x3fe930[_0xd9c7('0x85')]());return dbH[_0xd9c7('0x86')][_0xd9c7('0x32')](_0x3fe930[_0xd9c7('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0xd9c7('0x87')]});}})[_0xd9c7('0x25')](respondWithResult(_0x35bd8e,null))[_0xd9c7('0x46')](handleError(_0x35bd8e,null));};function runReport(_0x5095a8,_0x5bae9e,_0x99d829){var _0x31ee60=_0x5bae9e['name'];var _0xd065a3=0xa;var _0x398eaf=[_0xd9c7('0x57'),_0xd9c7('0x58'),'right_join','cross_join'];var _0x131f73={'SUM':_0xd9c7('0x88'),'COUNT':_0xd9c7('0x89'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd9c7('0x5b'),'MIN':_0xd9c7('0x5c'),'AVG':_0xd9c7('0x5d'),'GROUP_CONCAT':_0xd9c7('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd9c7('0x8a')};var _0x508ff1={'SEC_TO_TIME':_0xd9c7('0x8b'),'DATE':_0xd9c7('0x8c'),'HOUR':_0xd9c7('0x60'),'ROUND':_0xd9c7('0x61'),'UNIX_TIMESTAMP':_0xd9c7('0x8d')};var _0x344357=function(_0x8b54c5){return!_[_0xd9c7('0x62')]([_0xd9c7('0x63'),_0xd9c7('0x64'),_0xd9c7('0x8e'),'IS\x20NOT\x20EMPTY'],_0x8b54c5);};var _0x492e9e=function(_0x1e5808){if(!_0x1e5808||!_0x1e5808[_0xd9c7('0x67')][_0xd9c7('0x38')]){return'';}for(var _0x11a6bf='(',_0x25e4cb=0x0;_0x25e4cb<_0x1e5808[_0xd9c7('0x67')][_0xd9c7('0x38')];_0x25e4cb+=0x1){_0x25e4cb>0x0&&(_0x11a6bf+='\x20'+_0x1e5808[_0xd9c7('0x66')]+'\x20');_0x11a6bf+=_0x1e5808[_0xd9c7('0x67')][_0x25e4cb]['group']?_0x492e9e(_0x1e5808[_0xd9c7('0x67')][_0x25e4cb][_0xd9c7('0x68')]):_0x1e5808[_0xd9c7('0x67')][_0x25e4cb][_0xd9c7('0x69')]+'\x20'+_0x1e5808[_0xd9c7('0x67')][_0x25e4cb][_0xd9c7('0x6a')]+(_0x344357(_0x1e5808['rules'][_0x25e4cb][_0xd9c7('0x6a')])?'\x20'+_0x1e5808[_0xd9c7('0x67')][_0x25e4cb][_0xd9c7('0x6b')]:'');}return _0x11a6bf+')';};var _0xbd7a88={'where':{'id':_0x5095a8['id']}},_0xa90f3b,_0x154ae5,_0x8ad105,_0x2b46aa,_0x5c2b34;_0xbd7a88=_[_0xd9c7('0x3f')]({},_0xbd7a88,_0x99d829);return db[_0xd9c7('0x42')][_0xd9c7('0x4a')](_0xbd7a88)['then'](function(_0x6d3627){if(_0x6d3627){_0xa90f3b=_0x6d3627;return _0x6d3627[_0xd9c7('0x6c')]();}return null;})[_0xd9c7('0x25')](function(_0x5cebb5){if(_0x5cebb5){if(!_0x5cebb5[_0xd9c7('0x38')]){throw new db['Sequelize'][(_0xd9c7('0x6e'))](_0xd9c7('0x6f'),0x193);}_0x154ae5=_0x5cebb5;return db[_0xd9c7('0x70')][_0xd9c7('0x44')]({'raw':!![]});}return null;})[_0xd9c7('0x25')](function(_0x1bcd9a){if(_0x1bcd9a){_0x8ad105=_[_0xd9c7('0x71')](_0x1bcd9a,'id');var _0x339019;var _0x236fa2=squel[_0xd9c7('0x72')]();_0x236fa2[_0xd9c7('0x8f')](_0xa90f3b[_0xd9c7('0x73')]);for(var _0x15b36e=0x0;_0x15b36e<_0x154ae5[_0xd9c7('0x38')];_0x15b36e+=0x1){_0x339019=_0x154ae5[_0x15b36e][_0xd9c7('0x74')]?_0x8ad105[_0x154ae5[_0x15b36e][_0xd9c7('0x74')]][_0xd9c7('0x75')]:_0x154ae5[_0x15b36e][_0xd9c7('0x69')];_0x339019=_0x154ae5[_0x15b36e][_0xd9c7('0x76')]?_[_0xd9c7('0x77')](_0x131f73[_0x154ae5[_0x15b36e][_0xd9c7('0x76')]],'%s',_0x339019):_0x339019;_0x339019=_0x154ae5[_0x15b36e][_0xd9c7('0x78')]?_[_0xd9c7('0x77')](_0x508ff1[_0x154ae5[_0x15b36e][_0xd9c7('0x78')]],'%s',_0x339019):_0x339019;if(_0x154ae5[_0x15b36e][_0xd9c7('0x79')]){_0x236fa2['group'](_0x339019);}_0x154ae5[_0x15b36e][_0xd9c7('0x90')]&&_0x236fa2[_0xd9c7('0x3b')](_0x339019,_0x154ae5[_0x15b36e][_0xd9c7('0x90')]===_0xd9c7('0x7a')?![]:!![]);_0x236fa2['field'](_0x339019,_0x154ae5[_0x15b36e][_0xd9c7('0x7b')]||_0x339019);}if(_0xa90f3b['joins']){_0xa90f3b['joins']=JSON[_0xd9c7('0x7d')](_0xa90f3b[_0xd9c7('0x7c')]);for(var _0x5e8f53=0x0;_0x5e8f53<_0xa90f3b[_0xd9c7('0x7c')][_0xd9c7('0x38')];_0x5e8f53+=0x1){if(_0xa90f3b[_0xd9c7('0x7c')][_0x5e8f53][_0xd9c7('0x30')]&&_[_0xd9c7('0x62')](_0x398eaf,_0xa90f3b['joins'][_0x5e8f53][_0xd9c7('0x30')])&&_0xa90f3b[_0xd9c7('0x7c')][_0x5e8f53][_0xd9c7('0x7e')]&&_0xa90f3b[_0xd9c7('0x7c')][_0x5e8f53][_0xd9c7('0x7f')]&&_0xa90f3b[_0xd9c7('0x7c')][_0x5e8f53][_0xd9c7('0x81')]){_0x236fa2[_0xa90f3b[_0xd9c7('0x7c')][_0x5e8f53][_0xd9c7('0x30')]](_0xa90f3b[_0xd9c7('0x7c')][_0x5e8f53][_0xd9c7('0x7f')],null,util[_0xd9c7('0x78')](_0xd9c7('0x80'),_0xa90f3b[_0xd9c7('0x73')],_0xa90f3b[_0xd9c7('0x7c')][_0x5e8f53][_0xd9c7('0x7e')],_0xa90f3b[_0xd9c7('0x7c')][_0x5e8f53][_0xd9c7('0x7f')],_0xa90f3b['joins'][_0x5e8f53][_0xd9c7('0x81')]));}}}if(_0xa90f3b[_0xd9c7('0x82')]){_0xa90f3b[_0xd9c7('0x82')]=JSON[_0xd9c7('0x7d')](_0xa90f3b[_0xd9c7('0x82')]);_0x236fa2[_0xd9c7('0x3e')](_0x492e9e(_0xa90f3b[_0xd9c7('0x82')][_0xd9c7('0x68')]));}_0x5c2b34=_0x236fa2[_0xd9c7('0x83')]();_0x236fa2[_0xd9c7('0x20')](_0xd065a3);_0x236fa2[_0xd9c7('0x1f')](0x0);return;}})[_0xd9c7('0x25')](function(){if(_0x5bae9e[_0xd9c7('0x91')]===_0xd9c7('0x92')){return null;}var _0x130cd8=_['merge'](_0x5bae9e,{'name':_0x5bae9e[_0xd9c7('0x93')]||_0x5bae9e[_0xd9c7('0x2a')]||_0xa90f3b[_0xd9c7('0x2a')],'basename':_0x31ee60,'savename':util['format']('%s-%s.%s',_0x5bae9e[_0xd9c7('0x2a')]||_0xa90f3b[_0xd9c7('0x2a')],require(_0xd9c7('0x94'))[_0xd9c7('0x95')](0x4),_0x5bae9e[_0xd9c7('0x91')]||_0xd9c7('0x96')),'reportId':_0xa90f3b['id'],'reportType':_0xd9c7('0x97')});return db[_0xd9c7('0x98')][_0xd9c7('0x4b')](_0x130cd8,{'raw':!![]});})['then'](function(_0x3660a5){if(_0xa90f3b[_0xd9c7('0x73')]===_0xd9c7('0x99')){_0x5c2b34['where'](_0xa90f3b[_0xd9c7('0x73')]+_0xd9c7('0x9a'),_0x5bae9e[_0xd9c7('0x9b')],_0x5bae9e[_0xd9c7('0x9c')]);}else{_0x5c2b34[_0xd9c7('0x3e')](_0xa90f3b[_0xd9c7('0x73')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5bae9e[_0xd9c7('0x9b')],_0x5bae9e['endDate']);}if(_0x3660a5){logger[_0xd9c7('0x9d')](_0xd9c7('0x9e'),_0x5c2b34['toString']());require(_0xd9c7('0x9f'))[_0xd9c7('0xa0')](path[_0xd9c7('0x57')](__dirname,_0xd9c7('0xa1'),_0x3660a5[_0xd9c7('0x91')]),[_0x3660a5['id'],_0x5c2b34[_0xd9c7('0x85')](),path[_0xd9c7('0x57')](__dirname,'../../files/reports',_0x3660a5[_0xd9c7('0xa2')]),_0x31ee60]);return _0x3660a5;}else{var _0x59b95b=squel['select']();_0x59b95b['from']('('+_0x5c2b34[_0xd9c7('0x85')]()+')',_0xd9c7('0xa3'));_0x59b95b[_0xd9c7('0x69')](_0xd9c7('0xa4'),_0xd9c7('0x22'));_0x5c2b34['limit'](_0x5bae9e['limit']||_0xd065a3);_0x5c2b34[_0xd9c7('0x1f')](_0x5bae9e[_0xd9c7('0x1f')]||0x0);return dbH[_0xd9c7('0x86')][_0xd9c7('0x32')](_0x59b95b[_0xd9c7('0x85')](),{'type':dbH[_0xd9c7('0x86')]['QueryTypes']['SELECT']})['then'](function(_0x11f57d){if(!_0x11f57d[_0xd9c7('0x38')]){_0x2b46aa=0x0;}else{_0x2b46aa=_0x11f57d[0x0]['count']||0x0;}return dbH[_0xd9c7('0x86')]['query'](_0x5c2b34['toString'](),{'type':dbH[_0xd9c7('0x86')][_0xd9c7('0xa5')]['SELECT']});})[_0xd9c7('0x25')](function(_0x14ff65){return{'rows':_0x14ff65||[],'count':_0x2b46aa};});}});}exports[_0xd9c7('0xa6')]=function(_0x6a0db2,_0x4dfa62){return runReport(_0x6a0db2[_0xd9c7('0x47')],_0x6a0db2['query'],_0x6a0db2[_0xd9c7('0x41')])[_0xd9c7('0x25')](respondWithResult(_0x4dfa62,null))[_0xd9c7('0x46')](handleError(_0x4dfa62,null));};exports[_0xd9c7('0xa7')]=runReport;exports['query']=function(_0x429752,_0xca33c9){var _0x33aa61=0xa;var _0xbe2257=[_0xd9c7('0x57'),_0xd9c7('0x58'),_0xd9c7('0x59'),_0xd9c7('0xa8')];var _0x5c8b1a={'SUM':'SUM(%s)','COUNT':_0xd9c7('0x89'),'COUNT DISTINCT':_0xd9c7('0x5a'),'MAX':_0xd9c7('0x5b'),'MIN':_0xd9c7('0x5c'),'AVG':_0xd9c7('0x5d'),'GROUP_CONCAT':_0xd9c7('0x5e'),'GROUP_CONCAT ASC':_0xd9c7('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3e8824={'SEC_TO_TIME':_0xd9c7('0x8b'),'DATE':_0xd9c7('0x8c'),'HOUR':_0xd9c7('0x60'),'ROUND':_0xd9c7('0x61'),'UNIX_TIMESTAMP':_0xd9c7('0x8d')};var _0x55c522=function(_0x574b75){return!_[_0xd9c7('0x62')]([_0xd9c7('0x63'),_0xd9c7('0x64'),_0xd9c7('0x8e'),_0xd9c7('0x65')],_0x574b75);};var _0x563fd9=function(_0x4ec2ec){if(!_0x4ec2ec||!_0x4ec2ec[_0xd9c7('0x67')][_0xd9c7('0x38')]){return'';}for(var _0x14c607='(',_0x410454=0x0;_0x410454<_0x4ec2ec[_0xd9c7('0x67')][_0xd9c7('0x38')];_0x410454+=0x1){_0x410454>0x0&&(_0x14c607+='\x20'+_0x4ec2ec[_0xd9c7('0x66')]+'\x20');_0x14c607+=_0x4ec2ec['rules'][_0x410454][_0xd9c7('0x68')]?_0x563fd9(_0x4ec2ec[_0xd9c7('0x67')][_0x410454][_0xd9c7('0x68')]):_0x4ec2ec[_0xd9c7('0x67')][_0x410454]['field']+'\x20'+_0x4ec2ec[_0xd9c7('0x67')][_0x410454][_0xd9c7('0x6a')]+(_0x55c522(_0x4ec2ec['rules'][_0x410454]['condition'])?'\x20'+_0x4ec2ec[_0xd9c7('0x67')][_0x410454]['value']:'');}return _0x14c607+')';};var _0x3b2a8e={'where':{'id':_0x429752[_0xd9c7('0x47')]['id']}},_0x3d6267,_0x39ef57,_0x5be25f,_0x3a85f8,_0x45e48b;_0x3b2a8e=_[_0xd9c7('0x3f')]({},_0x3b2a8e,_0x429752[_0xd9c7('0x41')]);return db[_0xd9c7('0x42')]['find'](_0x3b2a8e)[_0xd9c7('0x25')](function(_0x4334bc){if(_0x4334bc){_0x3d6267=_0x4334bc;return _0x4334bc['getFields']();}return null;})[_0xd9c7('0x25')](function(_0x27378e){if(_0x27378e){if(!_0x27378e[_0xd9c7('0x38')]){throw new db[(_0xd9c7('0x6d'))]['ValidationErrorItem'](_0xd9c7('0x6f'),0x193);}_0x39ef57=_0x27378e;return db[_0xd9c7('0x70')][_0xd9c7('0x44')]({'raw':!![]});}return null;})[_0xd9c7('0x25')](function(_0x3de58b){if(_0x3de58b){_0x5be25f=_['keyBy'](_0x3de58b,'id');var _0x59d652;var _0x5124db=squel[_0xd9c7('0x72')]();_0x5124db[_0xd9c7('0x8f')](_0x3d6267[_0xd9c7('0x73')]);for(var _0x5f03d5=0x0;_0x5f03d5<_0x39ef57[_0xd9c7('0x38')];_0x5f03d5+=0x1){_0x59d652=_0x39ef57[_0x5f03d5][_0xd9c7('0x74')]?_0x5be25f[_0x39ef57[_0x5f03d5]['MetricId']]['metric']:_0x39ef57[_0x5f03d5][_0xd9c7('0x69')];_0x59d652=_0x39ef57[_0x5f03d5]['function']?_[_0xd9c7('0x77')](_0x5c8b1a[_0x39ef57[_0x5f03d5][_0xd9c7('0x76')]],'%s',_0x59d652):_0x59d652;_0x59d652=_0x39ef57[_0x5f03d5][_0xd9c7('0x78')]?_[_0xd9c7('0x77')](_0x3e8824[_0x39ef57[_0x5f03d5]['format']],'%s',_0x59d652):_0x59d652;if(_0x39ef57[_0x5f03d5][_0xd9c7('0x79')]){_0x5124db[_0xd9c7('0x68')](_0x59d652);}_0x39ef57[_0x5f03d5][_0xd9c7('0x90')]&&_0x5124db['order'](_0x59d652,_0x39ef57[_0x5f03d5][_0xd9c7('0x90')]==='DESC'?![]:!![]);_0x5124db[_0xd9c7('0x69')](_0x59d652,_0x39ef57[_0x5f03d5][_0xd9c7('0x7b')]||_0x59d652);}if(_0x3d6267[_0xd9c7('0x7c')]){_0x3d6267[_0xd9c7('0x7c')]=JSON[_0xd9c7('0x7d')](_0x3d6267['joins']);for(var _0x5f05c7=0x0;_0x5f05c7<_0x3d6267['joins'][_0xd9c7('0x38')];_0x5f05c7+=0x1){if(_0x3d6267[_0xd9c7('0x7c')][_0x5f05c7][_0xd9c7('0x30')]&&_[_0xd9c7('0x62')](_0xbe2257,_0x3d6267['joins'][_0x5f05c7][_0xd9c7('0x30')])&&_0x3d6267[_0xd9c7('0x7c')][_0x5f05c7][_0xd9c7('0x7e')]&&_0x3d6267[_0xd9c7('0x7c')][_0x5f05c7][_0xd9c7('0x7f')]&&_0x3d6267['joins'][_0x5f05c7][_0xd9c7('0x81')]){_0x5124db[_0x3d6267[_0xd9c7('0x7c')][_0x5f05c7][_0xd9c7('0x30')]](_0x3d6267[_0xd9c7('0x7c')][_0x5f05c7][_0xd9c7('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3d6267[_0xd9c7('0x73')],_0x3d6267['joins'][_0x5f05c7][_0xd9c7('0x7e')],_0x3d6267[_0xd9c7('0x7c')][_0x5f05c7][_0xd9c7('0x7f')],_0x3d6267[_0xd9c7('0x7c')][_0x5f05c7][_0xd9c7('0x81')]));}}}if(_0x3d6267[_0xd9c7('0x82')]){_0x3d6267['conditions']=JSON['parse'](_0x3d6267[_0xd9c7('0x82')]);_0x5124db[_0xd9c7('0x3e')](_0x563fd9(_0x3d6267[_0xd9c7('0x82')][_0xd9c7('0x68')]));}_0x45e48b=_0x5124db[_0xd9c7('0x83')]();_0x5124db[_0xd9c7('0x20')](_0x33aa61);_0x5124db[_0xd9c7('0x1f')](0x0);logger[_0xd9c7('0xa9')](_0xd9c7('0x84'),_0x5124db[_0xd9c7('0x85')]());return dbH['sequelize']['query'](_0x5124db[_0xd9c7('0x85')](),{'type':dbH['sequelize'][_0xd9c7('0xa5')]['SELECT']});}})[_0xd9c7('0x25')](function(){return{'sql':_0x45e48b[_0xd9c7('0x85')]()};})[_0xd9c7('0x25')](respondWithResult(_0xca33c9,null))[_0xd9c7('0x46')](handleError(_0xca33c9,null));};
\ No newline at end of file
+var _0x83bf=['attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','include','rows','catch','show','params','length','options','create','body','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','error','find','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','MetricId','metric','field','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','join','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20EMPTY','from','groupBy','output','web','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','fork','../../components/export/','countTable','COUNT(*)','QueryTypes','run','runReport','getFields','keyBy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','get','CustomReports','UserProfileResource','stack','name','index','map','AnalyticCustomReport','fieldName','type','key','model','keys','query','filters','intersection'];(function(_0x147463,_0x483448){var _0x433933=function(_0x166238){while(--_0x166238){_0x147463['push'](_0x147463['shift']());}};_0x433933(++_0x483448);}(_0x83bf,0x69));var _0xf83b=function(_0x1a6c94,_0x445053){_0x1a6c94=_0x1a6c94-0x0;var _0x4a2d59=_0x83bf[_0x1a6c94];return _0x4a2d59;};'use strict';var emlformat=require(_0xf83b('0x0'));var rimraf=require(_0xf83b('0x1'));var zipdir=require(_0xf83b('0x2'));var jsonpatch=require(_0xf83b('0x3'));var rp=require('request-promise');var moment=require(_0xf83b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf83b('0x5'));var util=require(_0xf83b('0x6'));var path=require(_0xf83b('0x7'));var sox=require(_0xf83b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf83b('0x9'));var squel=require('squel');var crypto=require(_0xf83b('0xa'));var jsforce=require(_0xf83b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf83b('0xc'));var querystring=require('querystring');var Papa=require(_0xf83b('0xd'));var Redis=require(_0xf83b('0xe'));var authService=require(_0xf83b('0xf'));var qs=require(_0xf83b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf83b('0x11'));var logger=require(_0xf83b('0x12'))(_0xf83b('0x13'));var utils=require(_0xf83b('0x14'));var config=require(_0xf83b('0x15'));var licenseUtil=require(_0xf83b('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0xf83b('0x17'))[_0xf83b('0x18')];function respondWithStatusCode(_0x3e1bfa,_0x2d8d5f){_0x2d8d5f=_0x2d8d5f||0xcc;return function(_0xf8141c){if(_0xf8141c){return _0x3e1bfa[_0xf83b('0x19')](_0x2d8d5f);}return _0x3e1bfa[_0xf83b('0x1a')](_0x2d8d5f)[_0xf83b('0x1b')]();};}function respondWithResult(_0x1b5b16,_0x589b47){_0x589b47=_0x589b47||0xc8;return function(_0x2ddb04){if(_0x2ddb04){return _0x1b5b16['status'](_0x589b47)['json'](_0x2ddb04);}};}function respondWithFilteredResult(_0x174a50,_0x28e517){return function(_0x2b17a6){if(_0x2b17a6){var _0x124804=typeof _0x28e517[_0xf83b('0x1c')]==='undefined'&&typeof _0x28e517[_0xf83b('0x1d')]===_0xf83b('0x1e');var _0x288073=_0x2b17a6[_0xf83b('0x1f')];var _0x326c25=_0x124804?0x0:_0x28e517[_0xf83b('0x1c')];var _0x2c89b3=_0x124804?_0x2b17a6['count']:_0x28e517[_0xf83b('0x1c')]+_0x28e517[_0xf83b('0x1d')];var _0x4a8eb0;if(_0x2c89b3>=_0x288073){_0x2c89b3=_0x288073;_0x4a8eb0=0xc8;}else{_0x4a8eb0=0xce;}_0x174a50[_0xf83b('0x1a')](_0x4a8eb0);return _0x174a50[_0xf83b('0x20')]('Content-Range',_0x326c25+'-'+_0x2c89b3+'/'+_0x288073)['json'](_0x2b17a6);}return null;};}function patchUpdates(_0x14ae04){return function(_0x4e038e){try{jsonpatch[_0xf83b('0x21')](_0x4e038e,_0x14ae04,!![]);}catch(_0x18ce08){return BPromise[_0xf83b('0x22')](_0x18ce08);}return _0x4e038e[_0xf83b('0x23')]();};}function saveUpdates(_0x21199c,_0x1cd1cf){return function(_0x33cae8){if(_0x33cae8){return _0x33cae8[_0xf83b('0x24')](_0x21199c)['then'](function(_0x310ac8){return _0x310ac8;});}return null;};}function removeEntity(_0x25d581,_0x3303c5){return function(_0x1b826a){if(_0x1b826a){return _0x1b826a[_0xf83b('0x25')]()[_0xf83b('0x26')](function(){var _0x511676=_0x1b826a[_0xf83b('0x27')]({'plain':!![]});var _0x5d9a6e=_0xf83b('0x28');return db[_0xf83b('0x29')][_0xf83b('0x25')]({'where':{'type':_0x5d9a6e,'resourceId':_0x511676['id']}})[_0xf83b('0x26')](function(){return _0x1b826a;});})['then'](function(){_0x25d581[_0xf83b('0x1a')](0xcc)[_0xf83b('0x1b')]();});}};}function handleEntityNotFound(_0x55882c,_0x558726){return function(_0x5e855c){if(!_0x5e855c){_0x55882c[_0xf83b('0x19')](0x194);}return _0x5e855c;};}function handleError(_0x5cb660,_0x493ee4){_0x493ee4=_0x493ee4||0x1f4;return function(_0x3b448b){logger['error'](_0x3b448b[_0xf83b('0x2a')]);if(_0x3b448b[_0xf83b('0x2b')]){delete _0x3b448b[_0xf83b('0x2b')];}_0x5cb660[_0xf83b('0x1a')](_0x493ee4)['send'](_0x3b448b);};}exports[_0xf83b('0x2c')]=function(_0x1bdf11,_0x37212d){var _0x1d649b={},_0x2a3550={},_0x44ad18={'count':0x0,'rows':[]};var _0x1a3a5c=_[_0xf83b('0x2d')](db[_0xf83b('0x2e')]['rawAttributes'],function(_0x652e9a){return{'name':_0x652e9a[_0xf83b('0x2f')],'type':_0x652e9a[_0xf83b('0x30')][_0xf83b('0x31')]};});_0x2a3550[_0xf83b('0x32')]=_[_0xf83b('0x2d')](_0x1a3a5c,_0xf83b('0x2b'));_0x2a3550['query']=_[_0xf83b('0x33')](_0x1bdf11[_0xf83b('0x34')]);_0x2a3550[_0xf83b('0x35')]=_[_0xf83b('0x36')](_0x2a3550[_0xf83b('0x32')],_0x2a3550[_0xf83b('0x34')]);_0x1d649b[_0xf83b('0x37')]=_[_0xf83b('0x36')](_0x2a3550[_0xf83b('0x32')],qs[_0xf83b('0x38')](_0x1bdf11[_0xf83b('0x34')][_0xf83b('0x38')]));_0x1d649b[_0xf83b('0x37')]=_0x1d649b['attributes']['length']?_0x1d649b['attributes']:_0x2a3550[_0xf83b('0x32')];if(!_0x1bdf11[_0xf83b('0x34')][_0xf83b('0x39')](_0xf83b('0x3a'))){_0x1d649b[_0xf83b('0x1d')]=qs[_0xf83b('0x1d')](_0x1bdf11[_0xf83b('0x34')][_0xf83b('0x1d')]);_0x1d649b[_0xf83b('0x1c')]=qs[_0xf83b('0x1c')](_0x1bdf11[_0xf83b('0x34')][_0xf83b('0x1c')]);}_0x1d649b[_0xf83b('0x3b')]=qs[_0xf83b('0x3c')](_0x1bdf11[_0xf83b('0x34')][_0xf83b('0x3c')]);_0x1d649b['where']=qs[_0xf83b('0x35')](_[_0xf83b('0x3d')](_0x1bdf11[_0xf83b('0x34')],_0x2a3550[_0xf83b('0x35')]),_0x1a3a5c);if(_0x1bdf11[_0xf83b('0x34')]['filter']){_0x1d649b[_0xf83b('0x3e')]=_[_0xf83b('0x3f')](_0x1d649b[_0xf83b('0x3e')],{'$or':_[_0xf83b('0x2d')](_0x1a3a5c,function(_0x193995){if(_0x193995[_0xf83b('0x30')]!=='VIRTUAL'){var _0x2bf682={};_0x2bf682[_0x193995[_0xf83b('0x2b')]]={'$like':'%'+_0x1bdf11['query']['filter']+'%'};return _0x2bf682;}})});}_0x1d649b=_[_0xf83b('0x3f')]({},_0x1d649b,_0x1bdf11['options']);var _0x4940ee={'where':_0x1d649b['where']};return db[_0xf83b('0x2e')][_0xf83b('0x1f')](_0x4940ee)['then'](function(_0x371eb6){_0x44ad18['count']=_0x371eb6;if(_0x1bdf11[_0xf83b('0x34')]['includeAll']){_0x1d649b[_0xf83b('0x40')]=[{'all':!![]}];}return db[_0xf83b('0x2e')]['findAll'](_0x1d649b);})[_0xf83b('0x26')](function(_0x511452){_0x44ad18[_0xf83b('0x41')]=_0x511452;return _0x44ad18;})['then'](respondWithFilteredResult(_0x37212d,_0x1d649b))[_0xf83b('0x42')](handleError(_0x37212d,null));};exports[_0xf83b('0x43')]=function(_0x3e904e,_0x320944){var _0x27c6a9={'raw':![],'where':{'id':_0x3e904e[_0xf83b('0x44')]['id']}},_0x433edd={};_0x433edd[_0xf83b('0x32')]=_[_0xf83b('0x33')](db['AnalyticCustomReport']['rawAttributes']);_0x433edd[_0xf83b('0x34')]=_['keys'](_0x3e904e[_0xf83b('0x34')]);_0x433edd['filters']=_[_0xf83b('0x36')](_0x433edd[_0xf83b('0x32')],_0x433edd['query']);_0x27c6a9[_0xf83b('0x37')]=_[_0xf83b('0x36')](_0x433edd[_0xf83b('0x32')],qs['fields'](_0x3e904e[_0xf83b('0x34')][_0xf83b('0x38')]));_0x27c6a9['attributes']=_0x27c6a9[_0xf83b('0x37')][_0xf83b('0x45')]?_0x27c6a9[_0xf83b('0x37')]:_0x433edd[_0xf83b('0x32')];if(_0x3e904e[_0xf83b('0x34')]['includeAll']){_0x27c6a9[_0xf83b('0x40')]=[{'all':!![]}];}_0x27c6a9=_[_0xf83b('0x3f')]({},_0x27c6a9,_0x3e904e[_0xf83b('0x46')]);return db[_0xf83b('0x2e')]['find'](_0x27c6a9)['then'](handleEntityNotFound(_0x320944,null))[_0xf83b('0x26')](respondWithResult(_0x320944,null))['catch'](handleError(_0x320944,null));};exports[_0xf83b('0x47')]=function(_0xcc1882,_0x86c292){return db[_0xf83b('0x2e')][_0xf83b('0x47')](_0xcc1882[_0xf83b('0x48')],{})['then'](function(_0x201373){var _0x2d6c0c=_0xcc1882['user'][_0xf83b('0x27')]({'plain':!![]});if(!_0x2d6c0c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d6c0c[_0xf83b('0x49')]===_0xf83b('0x4a')){var _0x45237f=_0x201373[_0xf83b('0x27')]({'plain':!![]});var _0x49a022=_0xf83b('0x4b');return db[_0xf83b('0x4c')]['find']({'where':{'name':_0x49a022,'userProfileId':_0x2d6c0c[_0xf83b('0x4d')]},'raw':!![]})[_0xf83b('0x26')](function(_0x26bbd9){if(_0x26bbd9&&_0x26bbd9[_0xf83b('0x4e')]===0x0){return db[_0xf83b('0x29')][_0xf83b('0x47')]({'name':_0x45237f[_0xf83b('0x2b')],'resourceId':_0x45237f['id'],'type':_0xf83b('0x28'),'sectionId':_0x26bbd9['id']},{})[_0xf83b('0x26')](function(){return _0x201373;});}else{return _0x201373;}})[_0xf83b('0x42')](function(_0x799d4d){logger[_0xf83b('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x799d4d);throw _0x799d4d;});}return _0x201373;})[_0xf83b('0x26')](respondWithResult(_0x86c292,0xc9))[_0xf83b('0x42')](handleError(_0x86c292,null));};exports['update']=function(_0x40e85f,_0x594ded){if(_0x40e85f[_0xf83b('0x48')]['id']){delete _0x40e85f[_0xf83b('0x48')]['id'];}return db[_0xf83b('0x2e')]['find']({'where':{'id':_0x40e85f[_0xf83b('0x44')]['id']}})[_0xf83b('0x26')](handleEntityNotFound(_0x594ded,null))[_0xf83b('0x26')](saveUpdates(_0x40e85f[_0xf83b('0x48')],null))['then'](respondWithResult(_0x594ded,null))['catch'](handleError(_0x594ded,null));};exports[_0xf83b('0x25')]=function(_0x54b143,_0x513ec6){return db['AnalyticCustomReport'][_0xf83b('0x50')]({'where':{'id':_0x54b143[_0xf83b('0x44')]['id']}})[_0xf83b('0x26')](handleEntityNotFound(_0x513ec6,null))[_0xf83b('0x26')](removeEntity(_0x513ec6,null))[_0xf83b('0x42')](handleError(_0x513ec6,null));};exports[_0xf83b('0x51')]=function(_0x15e13c,_0x2d4c42){var _0xcfcdd1=0xa;var _0x75beb6=['join',_0xf83b('0x52'),_0xf83b('0x53'),_0xf83b('0x54')];var _0x5242cf={'SUM':_0xf83b('0x55'),'COUNT':_0xf83b('0x56'),'COUNT DISTINCT':_0xf83b('0x57'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xf83b('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf83b('0x59')};var _0x58c89c={'SEC_TO_TIME':_0xf83b('0x5a'),'DATE':_0xf83b('0x5b'),'HOUR':_0xf83b('0x5c'),'ROUND':_0xf83b('0x5d'),'UNIX_TIMESTAMP':_0xf83b('0x5e')};var _0x2128a0=function(_0x7df085){return!_[_0xf83b('0x5f')]([_0xf83b('0x60'),_0xf83b('0x61'),'IS\x20EMPTY',_0xf83b('0x62')],_0x7df085);};var _0x10a549=function(_0x26ec02){if(!_0x26ec02||!_0x26ec02[_0xf83b('0x63')][_0xf83b('0x45')]){return'';}for(var _0x4109a2='(',_0x40a58b=0x0;_0x40a58b<_0x26ec02[_0xf83b('0x63')][_0xf83b('0x45')];_0x40a58b+=0x1){_0x40a58b>0x0&&(_0x4109a2+='\x20'+_0x26ec02[_0xf83b('0x64')]+'\x20');_0x4109a2+=_0x26ec02[_0xf83b('0x63')][_0x40a58b][_0xf83b('0x65')]?_0x10a549(_0x26ec02['rules'][_0x40a58b][_0xf83b('0x65')]):_0x26ec02['rules'][_0x40a58b]['field']+'\x20'+_0x26ec02[_0xf83b('0x63')][_0x40a58b][_0xf83b('0x66')]+(_0x2128a0(_0x26ec02[_0xf83b('0x63')][_0x40a58b][_0xf83b('0x66')])?'\x20'+_0x26ec02['rules'][_0x40a58b]['value']:'');}return _0x4109a2+')';};var _0x18bb80={'where':{'id':_0x15e13c[_0xf83b('0x44')]['id']}},_0x602cbc,_0x8a0cf9,_0x2185ac,_0x661643,_0x3b2f08;_0x18bb80=_[_0xf83b('0x3f')]({},_0x18bb80,_0x15e13c[_0xf83b('0x46')]);return db[_0xf83b('0x2e')][_0xf83b('0x50')](_0x18bb80)[_0xf83b('0x26')](function(_0x3d37ad){if(_0x3d37ad){_0x602cbc=_0x3d37ad;return _0x3d37ad['getFields']();}return null;})[_0xf83b('0x26')](function(_0x11d8d6){if(_0x11d8d6){if(!_0x11d8d6[_0xf83b('0x45')]){throw new db[(_0xf83b('0x67'))][(_0xf83b('0x68'))](_0xf83b('0x69'),0x193);}_0x8a0cf9=_0x11d8d6;return db[_0xf83b('0x6a')][_0xf83b('0x6b')]({'raw':!![]});}return null;})['then'](function(_0x12dfb8){if(_0x12dfb8){_0x2185ac=_['keyBy'](_0x12dfb8,'id');var _0xc79c76;var _0x1a0892=squel[_0xf83b('0x6c')]();_0x1a0892['from'](_0x602cbc['table']);for(var _0x152a09=0x0;_0x152a09<_0x8a0cf9[_0xf83b('0x45')];_0x152a09+=0x1){_0xc79c76=_0x8a0cf9[_0x152a09][_0xf83b('0x6d')]?_0x2185ac[_0x8a0cf9[_0x152a09][_0xf83b('0x6d')]][_0xf83b('0x6e')]:_0x8a0cf9[_0x152a09][_0xf83b('0x6f')];_0xc79c76=_0x8a0cf9[_0x152a09]['function']?_[_0xf83b('0x70')](_0x5242cf[_0x8a0cf9[_0x152a09][_0xf83b('0x71')]],'%s',_0xc79c76):_0xc79c76;_0xc79c76=_0x8a0cf9[_0x152a09]['format']?_[_0xf83b('0x70')](_0x58c89c[_0x8a0cf9[_0x152a09][_0xf83b('0x72')]],'%s',_0xc79c76):_0xc79c76;if(_0x8a0cf9[_0x152a09]['groupBy']){_0x1a0892[_0xf83b('0x65')](_0xc79c76);}_0x8a0cf9[_0x152a09][_0xf83b('0x73')]&&_0x1a0892['order'](_0xc79c76,_0x8a0cf9[_0x152a09][_0xf83b('0x73')]===_0xf83b('0x74')?![]:!![]);_0x1a0892[_0xf83b('0x6f')](_0xc79c76,_0x8a0cf9[_0x152a09][_0xf83b('0x75')]||_0xc79c76);}if(_0x602cbc['joins']){_0x602cbc[_0xf83b('0x76')]=JSON[_0xf83b('0x77')](_0x602cbc[_0xf83b('0x76')]);for(var _0x2396ed=0x0;_0x2396ed<_0x602cbc[_0xf83b('0x76')][_0xf83b('0x45')];_0x2396ed+=0x1){if(_0x602cbc[_0xf83b('0x76')][_0x2396ed]['type']&&_[_0xf83b('0x5f')](_0x75beb6,_0x602cbc[_0xf83b('0x76')][_0x2396ed]['type'])&&_0x602cbc[_0xf83b('0x76')][_0x2396ed][_0xf83b('0x78')]&&_0x602cbc[_0xf83b('0x76')][_0x2396ed][_0xf83b('0x79')]&&_0x602cbc[_0xf83b('0x76')][_0x2396ed]['foreignKey']){_0x1a0892[_0x602cbc[_0xf83b('0x76')][_0x2396ed][_0xf83b('0x30')]](_0x602cbc[_0xf83b('0x76')][_0x2396ed]['foreignTable'],null,util[_0xf83b('0x72')](_0xf83b('0x7a'),_0x602cbc[_0xf83b('0x7b')],_0x602cbc['joins'][_0x2396ed]['parentKey'],_0x602cbc[_0xf83b('0x76')][_0x2396ed][_0xf83b('0x79')],_0x602cbc[_0xf83b('0x76')][_0x2396ed][_0xf83b('0x7c')]));}}}if(_0x602cbc[_0xf83b('0x7d')]){_0x602cbc[_0xf83b('0x7d')]=JSON[_0xf83b('0x77')](_0x602cbc[_0xf83b('0x7d')]);_0x1a0892['where'](_0x10a549(_0x602cbc[_0xf83b('0x7d')][_0xf83b('0x65')]));}_0x3b2f08=_0x1a0892[_0xf83b('0x7e')]();_0x1a0892[_0xf83b('0x1d')](_0xcfcdd1);_0x1a0892[_0xf83b('0x1c')](0x0);logger[_0xf83b('0x7f')](_0xf83b('0x80'),_0x1a0892['toString']());return dbH['sequelize'][_0xf83b('0x34')](_0x1a0892[_0xf83b('0x81')](),{'type':dbH[_0xf83b('0x82')]['QueryTypes'][_0xf83b('0x83')]});}})['then'](respondWithResult(_0x2d4c42,null))[_0xf83b('0x42')](handleError(_0x2d4c42,null));};function runReport(_0x3ac9ed,_0x2e56a5,_0x4e69c4){var _0x4cc184=_0x2e56a5[_0xf83b('0x2b')];var _0x140074=0xa;var _0x563794=[_0xf83b('0x84'),_0xf83b('0x52'),'right_join',_0xf83b('0x54')];var _0x3b13c0={'SUM':_0xf83b('0x55'),'COUNT':_0xf83b('0x56'),'COUNT DISTINCT':_0xf83b('0x57'),'MAX':_0xf83b('0x85'),'MIN':_0xf83b('0x86'),'AVG':_0xf83b('0x58'),'GROUP_CONCAT':_0xf83b('0x87'),'GROUP_CONCAT ASC':_0xf83b('0x88'),'GROUP_CONCAT DESC':_0xf83b('0x59')};var _0x2a333b={'SEC_TO_TIME':_0xf83b('0x5a'),'DATE':_0xf83b('0x5b'),'HOUR':_0xf83b('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xf83b('0x5e')};var _0x18855a=function(_0x41a9c8){return!_[_0xf83b('0x5f')]([_0xf83b('0x60'),'IS\x20NOT\x20NULL',_0xf83b('0x89'),_0xf83b('0x62')],_0x41a9c8);};var _0x12e80d=function(_0x31beb8){if(!_0x31beb8||!_0x31beb8[_0xf83b('0x63')]['length']){return'';}for(var _0x4cb1b5='(',_0x9885df=0x0;_0x9885df<_0x31beb8[_0xf83b('0x63')][_0xf83b('0x45')];_0x9885df+=0x1){_0x9885df>0x0&&(_0x4cb1b5+='\x20'+_0x31beb8[_0xf83b('0x64')]+'\x20');_0x4cb1b5+=_0x31beb8[_0xf83b('0x63')][_0x9885df][_0xf83b('0x65')]?_0x12e80d(_0x31beb8[_0xf83b('0x63')][_0x9885df][_0xf83b('0x65')]):_0x31beb8[_0xf83b('0x63')][_0x9885df][_0xf83b('0x6f')]+'\x20'+_0x31beb8['rules'][_0x9885df][_0xf83b('0x66')]+(_0x18855a(_0x31beb8['rules'][_0x9885df][_0xf83b('0x66')])?'\x20'+_0x31beb8[_0xf83b('0x63')][_0x9885df]['value']:'');}return _0x4cb1b5+')';};var _0x304bc3={'where':{'id':_0x3ac9ed['id']}},_0x595339,_0x2a6c40,_0x2b8e45,_0x24232d,_0x486d87;_0x304bc3=_[_0xf83b('0x3f')]({},_0x304bc3,_0x4e69c4);return db[_0xf83b('0x2e')][_0xf83b('0x50')](_0x304bc3)[_0xf83b('0x26')](function(_0x37e36d){if(_0x37e36d){_0x595339=_0x37e36d;return _0x37e36d['getFields']();}return null;})[_0xf83b('0x26')](function(_0x28a828){if(_0x28a828){if(!_0x28a828[_0xf83b('0x45')]){throw new db[(_0xf83b('0x67'))]['ValidationErrorItem'](_0xf83b('0x69'),0x193);}_0x2a6c40=_0x28a828;return db[_0xf83b('0x6a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x195980){if(_0x195980){_0x2b8e45=_['keyBy'](_0x195980,'id');var _0x3c064b;var _0x182f82=squel[_0xf83b('0x6c')]();_0x182f82[_0xf83b('0x8a')](_0x595339['table']);for(var _0x5d1b87=0x0;_0x5d1b87<_0x2a6c40[_0xf83b('0x45')];_0x5d1b87+=0x1){_0x3c064b=_0x2a6c40[_0x5d1b87][_0xf83b('0x6d')]?_0x2b8e45[_0x2a6c40[_0x5d1b87]['MetricId']][_0xf83b('0x6e')]:_0x2a6c40[_0x5d1b87][_0xf83b('0x6f')];_0x3c064b=_0x2a6c40[_0x5d1b87]['function']?_[_0xf83b('0x70')](_0x3b13c0[_0x2a6c40[_0x5d1b87][_0xf83b('0x71')]],'%s',_0x3c064b):_0x3c064b;_0x3c064b=_0x2a6c40[_0x5d1b87][_0xf83b('0x72')]?_[_0xf83b('0x70')](_0x2a333b[_0x2a6c40[_0x5d1b87]['format']],'%s',_0x3c064b):_0x3c064b;if(_0x2a6c40[_0x5d1b87][_0xf83b('0x8b')]){_0x182f82[_0xf83b('0x65')](_0x3c064b);}_0x2a6c40[_0x5d1b87][_0xf83b('0x73')]&&_0x182f82[_0xf83b('0x3b')](_0x3c064b,_0x2a6c40[_0x5d1b87][_0xf83b('0x73')]===_0xf83b('0x74')?![]:!![]);_0x182f82[_0xf83b('0x6f')](_0x3c064b,_0x2a6c40[_0x5d1b87][_0xf83b('0x75')]||_0x3c064b);}if(_0x595339[_0xf83b('0x76')]){_0x595339[_0xf83b('0x76')]=JSON[_0xf83b('0x77')](_0x595339['joins']);for(var _0x314ee1=0x0;_0x314ee1<_0x595339[_0xf83b('0x76')][_0xf83b('0x45')];_0x314ee1+=0x1){if(_0x595339[_0xf83b('0x76')][_0x314ee1]['type']&&_[_0xf83b('0x5f')](_0x563794,_0x595339[_0xf83b('0x76')][_0x314ee1][_0xf83b('0x30')])&&_0x595339[_0xf83b('0x76')][_0x314ee1][_0xf83b('0x78')]&&_0x595339['joins'][_0x314ee1][_0xf83b('0x79')]&&_0x595339[_0xf83b('0x76')][_0x314ee1][_0xf83b('0x7c')]){_0x182f82[_0x595339[_0xf83b('0x76')][_0x314ee1][_0xf83b('0x30')]](_0x595339[_0xf83b('0x76')][_0x314ee1][_0xf83b('0x79')],null,util[_0xf83b('0x72')](_0xf83b('0x7a'),_0x595339[_0xf83b('0x7b')],_0x595339[_0xf83b('0x76')][_0x314ee1]['parentKey'],_0x595339['joins'][_0x314ee1][_0xf83b('0x79')],_0x595339['joins'][_0x314ee1]['foreignKey']));}}}if(_0x595339['conditions']){_0x595339[_0xf83b('0x7d')]=JSON[_0xf83b('0x77')](_0x595339[_0xf83b('0x7d')]);_0x182f82[_0xf83b('0x3e')](_0x12e80d(_0x595339[_0xf83b('0x7d')][_0xf83b('0x65')]));}_0x486d87=_0x182f82[_0xf83b('0x7e')]();_0x182f82[_0xf83b('0x1d')](_0x140074);_0x182f82['offset'](0x0);return;}})['then'](function(){if(_0x2e56a5[_0xf83b('0x8c')]===_0xf83b('0x8d')){return null;}var _0x271ceb=_['merge'](_0x2e56a5,{'name':_0x2e56a5['fullPath']||_0x2e56a5[_0xf83b('0x2b')]||_0x595339[_0xf83b('0x2b')],'basename':_0x4cc184,'savename':util['format'](_0xf83b('0x8e'),_0x2e56a5[_0xf83b('0x2b')]||_0x595339[_0xf83b('0x2b')],require('randomstring')[_0xf83b('0x8f')](0x4),_0x2e56a5[_0xf83b('0x8c')]||_0xf83b('0x90')),'reportId':_0x595339['id'],'reportType':_0xf83b('0x91')});return db[_0xf83b('0x92')][_0xf83b('0x47')](_0x271ceb,{'raw':!![]});})[_0xf83b('0x26')](function(_0x220865){if(_0x595339[_0xf83b('0x7b')]==='cdr'){_0x486d87[_0xf83b('0x3e')](_0x595339[_0xf83b('0x7b')]+_0xf83b('0x93'),_0x2e56a5[_0xf83b('0x94')],_0x2e56a5['endDate']);}else{_0x486d87[_0xf83b('0x3e')](_0x595339[_0xf83b('0x7b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2e56a5[_0xf83b('0x94')],_0x2e56a5[_0xf83b('0x95')]);}if(_0x220865){logger[_0xf83b('0x96')]('Run\x20Query:',_0x486d87[_0xf83b('0x81')]());require('child_process')[_0xf83b('0x97')](path[_0xf83b('0x84')](__dirname,_0xf83b('0x98'),_0x220865[_0xf83b('0x8c')]),[_0x220865['id'],_0x486d87[_0xf83b('0x81')](),path[_0xf83b('0x84')](__dirname,'../../files/reports',_0x220865['savename']),_0x4cc184]);return _0x220865;}else{var _0x592e98=squel[_0xf83b('0x6c')]();_0x592e98['from']('('+_0x486d87[_0xf83b('0x81')]()+')',_0xf83b('0x99'));_0x592e98[_0xf83b('0x6f')](_0xf83b('0x9a'),'count');_0x486d87[_0xf83b('0x1d')](_0x2e56a5[_0xf83b('0x1d')]||_0x140074);_0x486d87[_0xf83b('0x1c')](_0x2e56a5[_0xf83b('0x1c')]||0x0);return dbH[_0xf83b('0x82')][_0xf83b('0x34')](_0x592e98[_0xf83b('0x81')](),{'type':dbH['sequelize'][_0xf83b('0x9b')][_0xf83b('0x83')]})['then'](function(_0x43885b){if(!_0x43885b['length']){_0x24232d=0x0;}else{_0x24232d=_0x43885b[0x0][_0xf83b('0x1f')]||0x0;}return dbH[_0xf83b('0x82')][_0xf83b('0x34')](_0x486d87[_0xf83b('0x81')](),{'type':dbH['sequelize']['QueryTypes'][_0xf83b('0x83')]});})[_0xf83b('0x26')](function(_0x1085bf){return{'rows':_0x1085bf||[],'count':_0x24232d};});}});}exports[_0xf83b('0x9c')]=function(_0x36908e,_0x3065c4){return runReport(_0x36908e['params'],_0x36908e['query'],_0x36908e[_0xf83b('0x46')])[_0xf83b('0x26')](respondWithResult(_0x3065c4,null))[_0xf83b('0x42')](handleError(_0x3065c4,null));};exports[_0xf83b('0x9d')]=runReport;exports[_0xf83b('0x34')]=function(_0x5c3d28,_0x5a72da){var _0x58127f=0xa;var _0x1c64a0=[_0xf83b('0x84'),'left_join',_0xf83b('0x53'),_0xf83b('0x54')];var _0x1d5d09={'SUM':_0xf83b('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xf83b('0x57'),'MAX':_0xf83b('0x85'),'MIN':_0xf83b('0x86'),'AVG':_0xf83b('0x58'),'GROUP_CONCAT':_0xf83b('0x87'),'GROUP_CONCAT ASC':_0xf83b('0x88'),'GROUP_CONCAT DESC':_0xf83b('0x59')};var _0x9e3d26={'SEC_TO_TIME':_0xf83b('0x5a'),'DATE':_0xf83b('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xf83b('0x5e')};var _0x4af980=function(_0x5e83f7){return!_['includes']([_0xf83b('0x60'),_0xf83b('0x61'),'IS\x20EMPTY',_0xf83b('0x62')],_0x5e83f7);};var _0x3a3618=function(_0x1bec76){if(!_0x1bec76||!_0x1bec76[_0xf83b('0x63')][_0xf83b('0x45')]){return'';}for(var _0x1e1bb5='(',_0x6cf5f9=0x0;_0x6cf5f9<_0x1bec76[_0xf83b('0x63')]['length'];_0x6cf5f9+=0x1){_0x6cf5f9>0x0&&(_0x1e1bb5+='\x20'+_0x1bec76['operator']+'\x20');_0x1e1bb5+=_0x1bec76[_0xf83b('0x63')][_0x6cf5f9][_0xf83b('0x65')]?_0x3a3618(_0x1bec76['rules'][_0x6cf5f9][_0xf83b('0x65')]):_0x1bec76[_0xf83b('0x63')][_0x6cf5f9][_0xf83b('0x6f')]+'\x20'+_0x1bec76[_0xf83b('0x63')][_0x6cf5f9][_0xf83b('0x66')]+(_0x4af980(_0x1bec76[_0xf83b('0x63')][_0x6cf5f9][_0xf83b('0x66')])?'\x20'+_0x1bec76[_0xf83b('0x63')][_0x6cf5f9]['value']:'');}return _0x1e1bb5+')';};var _0x2fec34={'where':{'id':_0x5c3d28[_0xf83b('0x44')]['id']}},_0xad26b3,_0x25d414,_0x110e63,_0x64e99b,_0x20f1b9;_0x2fec34=_[_0xf83b('0x3f')]({},_0x2fec34,_0x5c3d28[_0xf83b('0x46')]);return db[_0xf83b('0x2e')][_0xf83b('0x50')](_0x2fec34)[_0xf83b('0x26')](function(_0x3db044){if(_0x3db044){_0xad26b3=_0x3db044;return _0x3db044[_0xf83b('0x9e')]();}return null;})[_0xf83b('0x26')](function(_0x44c0f0){if(_0x44c0f0){if(!_0x44c0f0[_0xf83b('0x45')]){throw new db['Sequelize'][(_0xf83b('0x68'))](_0xf83b('0x69'),0x193);}_0x25d414=_0x44c0f0;return db['AnalyticMetric'][_0xf83b('0x6b')]({'raw':!![]});}return null;})['then'](function(_0x501edd){if(_0x501edd){_0x110e63=_[_0xf83b('0x9f')](_0x501edd,'id');var _0x37c2e7;var _0x4a07b4=squel[_0xf83b('0x6c')]();_0x4a07b4[_0xf83b('0x8a')](_0xad26b3[_0xf83b('0x7b')]);for(var _0x46cb40=0x0;_0x46cb40<_0x25d414[_0xf83b('0x45')];_0x46cb40+=0x1){_0x37c2e7=_0x25d414[_0x46cb40]['MetricId']?_0x110e63[_0x25d414[_0x46cb40]['MetricId']][_0xf83b('0x6e')]:_0x25d414[_0x46cb40][_0xf83b('0x6f')];_0x37c2e7=_0x25d414[_0x46cb40][_0xf83b('0x71')]?_[_0xf83b('0x70')](_0x1d5d09[_0x25d414[_0x46cb40][_0xf83b('0x71')]],'%s',_0x37c2e7):_0x37c2e7;_0x37c2e7=_0x25d414[_0x46cb40]['format']?_[_0xf83b('0x70')](_0x9e3d26[_0x25d414[_0x46cb40]['format']],'%s',_0x37c2e7):_0x37c2e7;if(_0x25d414[_0x46cb40][_0xf83b('0x8b')]){_0x4a07b4[_0xf83b('0x65')](_0x37c2e7);}_0x25d414[_0x46cb40][_0xf83b('0x73')]&&_0x4a07b4[_0xf83b('0x3b')](_0x37c2e7,_0x25d414[_0x46cb40]['orderBy']===_0xf83b('0x74')?![]:!![]);_0x4a07b4[_0xf83b('0x6f')](_0x37c2e7,_0x25d414[_0x46cb40][_0xf83b('0x75')]||_0x37c2e7);}if(_0xad26b3[_0xf83b('0x76')]){_0xad26b3[_0xf83b('0x76')]=JSON['parse'](_0xad26b3[_0xf83b('0x76')]);for(var _0x85679b=0x0;_0x85679b<_0xad26b3['joins'][_0xf83b('0x45')];_0x85679b+=0x1){if(_0xad26b3[_0xf83b('0x76')][_0x85679b]['type']&&_[_0xf83b('0x5f')](_0x1c64a0,_0xad26b3['joins'][_0x85679b][_0xf83b('0x30')])&&_0xad26b3[_0xf83b('0x76')][_0x85679b][_0xf83b('0x78')]&&_0xad26b3[_0xf83b('0x76')][_0x85679b][_0xf83b('0x79')]&&_0xad26b3[_0xf83b('0x76')][_0x85679b][_0xf83b('0x7c')]){_0x4a07b4[_0xad26b3[_0xf83b('0x76')][_0x85679b][_0xf83b('0x30')]](_0xad26b3['joins'][_0x85679b][_0xf83b('0x79')],null,util[_0xf83b('0x72')](_0xf83b('0x7a'),_0xad26b3[_0xf83b('0x7b')],_0xad26b3[_0xf83b('0x76')][_0x85679b][_0xf83b('0x78')],_0xad26b3[_0xf83b('0x76')][_0x85679b][_0xf83b('0x79')],_0xad26b3[_0xf83b('0x76')][_0x85679b][_0xf83b('0x7c')]));}}}if(_0xad26b3[_0xf83b('0x7d')]){_0xad26b3[_0xf83b('0x7d')]=JSON[_0xf83b('0x77')](_0xad26b3[_0xf83b('0x7d')]);_0x4a07b4[_0xf83b('0x3e')](_0x3a3618(_0xad26b3[_0xf83b('0x7d')][_0xf83b('0x65')]));}_0x20f1b9=_0x4a07b4[_0xf83b('0x7e')]();_0x4a07b4[_0xf83b('0x1d')](_0x58127f);_0x4a07b4[_0xf83b('0x1c')](0x0);logger['debug']('Limited\x20Query:',_0x4a07b4[_0xf83b('0x81')]());return dbH[_0xf83b('0x82')][_0xf83b('0x34')](_0x4a07b4[_0xf83b('0x81')](),{'type':dbH[_0xf83b('0x82')]['QueryTypes']['SELECT']});}})[_0xf83b('0x26')](function(){return{'sql':_0x20f1b9['toString']()};})[_0xf83b('0x26')](respondWithResult(_0x5a72da,null))[_0xf83b('0x42')](handleError(_0x5a72da,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index cc814b7..39fbee1 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 _0xfd17=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport'];(function(_0x4350c2,_0x112f3c){var _0x8b6406=function(_0x49e845){while(--_0x49e845){_0x4350c2['push'](_0x4350c2['shift']());}};_0x8b6406(++_0x112f3c);}(_0xfd17,0x8f));var _0x7fd1=function(_0x53f707,_0x51a2f7){_0x53f707=_0x53f707-0x0;var _0x10a9f5=_0xfd17[_0x53f707];return _0x10a9f5;};'use strict';var _=require(_0x7fd1('0x0'));var util=require(_0x7fd1('0x1'));var logger=require('../../config/logger')(_0x7fd1('0x2'));var moment=require('moment');var BPromise=require(_0x7fd1('0x3'));var rp=require(_0x7fd1('0x4'));var fs=require('fs');var path=require(_0x7fd1('0x5'));var rimraf=require(_0x7fd1('0x6'));var config=require(_0x7fd1('0x7'));var attributes=require(_0x7fd1('0x8'));module[_0x7fd1('0x9')]=function(_0x4cbebb,_0x45d26c){return _0x4cbebb['define'](_0x7fd1('0xa'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4bb3=['../../config/logger','api','moment','bluebird','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4bb3,0x1df));var _0x34bb=function(_0x459b74,_0x5773bd){_0x459b74=_0x459b74-0x0;var _0x46cb16=_0x4bb3[_0x459b74];return _0x46cb16;};'use strict';var _=require(_0x34bb('0x0'));var util=require(_0x34bb('0x1'));var logger=require(_0x34bb('0x2'))(_0x34bb('0x3'));var moment=require(_0x34bb('0x4'));var BPromise=require(_0x34bb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34bb('0x6'));var rimraf=require('rimraf');var config=require(_0x34bb('0x7'));var attributes=require(_0x34bb('0x8'));module[_0x34bb('0x9')]=function(_0x500399,_0x466e79){return _0x500399[_0x34bb('0xa')](_0x34bb('0xb'),attributes,{'tableName':_0x34bb('0xc'),'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 675228b..0e136bc 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 _0xbb0f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','bluebird'];(function(_0x115d1f,_0x28e745){var _0x5a1663=function(_0x29b593){while(--_0x29b593){_0x115d1f['push'](_0x115d1f['shift']());}};_0x5a1663(++_0x28e745);}(_0xbb0f,0xe5));var _0xfbb0=function(_0x271870,_0x50c22d){_0x271870=_0x271870-0x0;var _0x17b9f8=_0xbb0f[_0x271870];return _0x17b9f8;};'use strict';var _=require('lodash');var util=require(_0xfbb0('0x0'));var moment=require('moment');var BPromise=require(_0xfbb0('0x1'));var rs=require(_0xfbb0('0x2'));var fs=require('fs');var Redis=require(_0xfbb0('0x3'));var db=require(_0xfbb0('0x4'))['db'];var utils=require(_0xfbb0('0x5'));var logger=require(_0xfbb0('0x6'))('rpc');var config=require(_0xfbb0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfbb0('0x8')][_0xfbb0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x506d2b,_0x156dd7,_0x336a6a){return new BPromise(function(_0xa41f43,_0x5071c7){return client['request'](_0x506d2b,_0x336a6a)['then'](function(_0x1a717b){logger['info'](_0xfbb0('0xa'),_0x156dd7,_0xfbb0('0xb'));logger[_0xfbb0('0xc')](_0xfbb0('0xd'),_0x156dd7,_0xfbb0('0xb'),JSON[_0xfbb0('0xe')](_0x1a717b));if(_0x1a717b[_0xfbb0('0xf')]){if(_0x1a717b[_0xfbb0('0xf')][_0xfbb0('0x10')]===0x1f4){logger[_0xfbb0('0xf')](_0xfbb0('0xa'),_0x156dd7,_0x1a717b[_0xfbb0('0xf')][_0xfbb0('0x11')]);return _0x5071c7(_0x1a717b['error'][_0xfbb0('0x11')]);}logger[_0xfbb0('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x156dd7,_0x1a717b[_0xfbb0('0xf')][_0xfbb0('0x11')]);return _0xa41f43(_0x1a717b[_0xfbb0('0xf')][_0xfbb0('0x11')]);}else{logger[_0xfbb0('0x12')](_0xfbb0('0xa'),_0x156dd7,_0xfbb0('0xb'));_0xa41f43(_0x1a717b[_0xfbb0('0x13')][_0xfbb0('0x11')]);}})[_0xfbb0('0x14')](function(_0x4f9946){logger[_0xfbb0('0xf')](_0xfbb0('0xa'),_0x156dd7,_0x4f9946);_0x5071c7(_0x4f9946);});});}
\ No newline at end of file
+var _0x9489=['message','result','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xc0720,_0x59b1cf){var _0x12b094=function(_0x545f66){while(--_0x545f66){_0xc0720['push'](_0xc0720['shift']());}};_0x12b094(++_0x59b1cf);}(_0x9489,0xfa));var _0x9948=function(_0x3a1426,_0x217db0){_0x3a1426=_0x3a1426-0x0;var _0x42bc44=_0x9489[_0x3a1426];return _0x42bc44;};'use strict';var _=require(_0x9948('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9948('0x1'));var db=require(_0x9948('0x2'))['db'];var utils=require(_0x9948('0x3'));var logger=require(_0x9948('0x4'))(_0x9948('0x5'));var config=require(_0x9948('0x6'));var jayson=require(_0x9948('0x7'));var client=jayson[_0x9948('0x8')][_0x9948('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x283356,_0x2d55bf,_0x50992a){return new BPromise(function(_0x546686,_0x1d004f){return client['request'](_0x283356,_0x50992a)['then'](function(_0x3f35ae){logger[_0x9948('0xa')](_0x9948('0xb'),_0x2d55bf,'request\x20sent');logger['debug'](_0x9948('0xc'),_0x2d55bf,_0x9948('0xd'),JSON[_0x9948('0xe')](_0x3f35ae));if(_0x3f35ae[_0x9948('0xf')]){if(_0x3f35ae[_0x9948('0xf')]['code']===0x1f4){logger['error'](_0x9948('0xb'),_0x2d55bf,_0x3f35ae[_0x9948('0xf')]['message']);return _0x1d004f(_0x3f35ae['error'][_0x9948('0x10')]);}logger[_0x9948('0xf')](_0x9948('0xb'),_0x2d55bf,_0x3f35ae[_0x9948('0xf')][_0x9948('0x10')]);return _0x546686(_0x3f35ae[_0x9948('0xf')]['message']);}else{logger['info'](_0x9948('0xb'),_0x2d55bf,_0x9948('0xd'));_0x546686(_0x3f35ae[_0x9948('0x11')]['message']);}})[_0x9948('0x12')](function(_0x357981){logger['error'](_0x9948('0xb'),_0x2d55bf,_0x357981);_0x1d004f(_0x357981);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 5da93e2..c83d990 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 _0x475f=['query','post','create','put','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','show','isAuthenticated','/:id/run','/:id/query'];(function(_0x636d1c,_0x29a72d){var _0x57d743=function(_0x4def0e){while(--_0x4def0e){_0x636d1c['push'](_0x636d1c['shift']());}};_0x57d743(++_0x29a72d);}(_0x475f,0xbf));var _0xf475=function(_0x330525,_0x3cf1fb){_0x330525=_0x330525-0x0;var _0x4e6ce3=_0x475f[_0x330525];return _0x4e6ce3;};'use strict';var multer=require(_0xf475('0x0'));var util=require(_0xf475('0x1'));var path=require(_0xf475('0x2'));var timeout=require(_0xf475('0x3'));var express=require('express');var router=express[_0xf475('0x4')]();var fs_extra=require(_0xf475('0x5'));var auth=require(_0xf475('0x6'));var interaction=require(_0xf475('0x7'));var config=require(_0xf475('0x8'));var controller=require(_0xf475('0x9'));router[_0xf475('0xa')]('/',auth['isAuthenticated'](),controller[_0xf475('0xb')]);router[_0xf475('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xf475('0xc')]);router[_0xf475('0xa')]('/:id/preview',auth[_0xf475('0xd')](),controller['preview']);router['get'](_0xf475('0xe'),auth[_0xf475('0xd')](),controller['run']);router[_0xf475('0xa')](_0xf475('0xf'),auth['isAuthenticated'](),controller[_0xf475('0x10')]);router[_0xf475('0x11')]('/',auth[_0xf475('0xd')](),controller[_0xf475('0x12')]);router[_0xf475('0x13')](_0xf475('0x14'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xf475('0xd')](),controller[_0xf475('0x15')]);module[_0xf475('0x16')]=router;
\ No newline at end of file
+var _0xff9d=['/:id/query','query','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','preview','/:id/run'];(function(_0x2aec31,_0x19962c){var _0xfb303e=function(_0x3a34f9){while(--_0x3a34f9){_0x2aec31['push'](_0x2aec31['shift']());}};_0xfb303e(++_0x19962c);}(_0xff9d,0x141));var _0xdff9=function(_0x432f7e,_0x10e4f0){_0x432f7e=_0x432f7e-0x0;var _0x58a5f3=_0xff9d[_0x432f7e];return _0x58a5f3;};'use strict';var multer=require(_0xdff9('0x0'));var util=require(_0xdff9('0x1'));var path=require(_0xdff9('0x2'));var timeout=require(_0xdff9('0x3'));var express=require('express');var router=express[_0xdff9('0x4')]();var fs_extra=require(_0xdff9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdff9('0x6'));var config=require(_0xdff9('0x7'));var controller=require(_0xdff9('0x8'));router[_0xdff9('0x9')]('/',auth[_0xdff9('0xa')](),controller[_0xdff9('0xb')]);router[_0xdff9('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xdff9('0xc')]);router[_0xdff9('0x9')]('/:id/preview',auth[_0xdff9('0xa')](),controller[_0xdff9('0xd')]);router[_0xdff9('0x9')](_0xdff9('0xe'),auth[_0xdff9('0xa')](),controller['run']);router[_0xdff9('0x9')](_0xdff9('0xf'),auth[_0xdff9('0xa')](),controller[_0xdff9('0x10')]);router[_0xdff9('0x11')]('/',auth[_0xdff9('0xa')](),controller[_0xdff9('0x12')]);router[_0xdff9('0x13')](_0xdff9('0x14'),auth[_0xdff9('0xa')](),controller[_0xdff9('0x15')]);router['delete'](_0xdff9('0x14'),auth[_0xdff9('0xa')](),controller[_0xdff9('0x16')]);module[_0xdff9('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 88f82be..e177e76 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 _0xee14=['STRING','TEXT'];(function(_0x5c1514,_0x26126a){var _0x396a97=function(_0x1fb619){while(--_0x1fb619){_0x5c1514['push'](_0x5c1514['shift']());}};_0x396a97(++_0x26126a);}(_0xee14,0x13a));var _0x4ee1=function(_0x5e5fbf,_0x4d8450){_0x5e5fbf=_0x5e5fbf-0x0;var _0x598f4f=_0xee14[_0x5e5fbf];return _0x598f4f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}};
\ No newline at end of file
+var _0x1883=['exports','STRING','TEXT','sequelize'];(function(_0x2ed999,_0x2e7c4d){var _0x49c1cc=function(_0x3be581){while(--_0x3be581){_0x2ed999['push'](_0x2ed999['shift']());}};_0x49c1cc(++_0x2e7c4d);}(_0x1883,0xab));var _0x3188=function(_0x563169,_0x4be6bc){_0x563169=_0x563169-0x0;var _0x4796e2=_0x1883[_0x563169];return _0x4796e2;};'use strict';var Sequelize=require(_0x3188('0x0'));module[_0x3188('0x1')]={'name':{'type':Sequelize[_0x3188('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3188('0x2')]},'parent':{'type':Sequelize[_0x3188('0x2')]},'table':{'type':Sequelize[_0x3188('0x2')]},'conditions':{'type':Sequelize[_0x3188('0x3')]},'joins':{'type':Sequelize[_0x3188('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 1174869..986822d 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 _0x0295=['default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','fork','../../files/reports','COUNT(*)','SELECT','run','runReport','MAX(%s)','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','UserProfileResource','destroy','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','group','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','operator','getFields','findAll','select','replace','output','web','%s-%s.%s','randomstring','generate','csv'];(function(_0x1bfe44,_0x4e410e){var _0x1103cb=function(_0x1e850e){while(--_0x1e850e){_0x1bfe44['push'](_0x1bfe44['shift']());}};_0x1103cb(++_0x4e410e);}(_0x0295,0x1f0));var _0x5029=function(_0xa7fcdd,_0x2316e2){_0xa7fcdd=_0xa7fcdd-0x0;var _0x44f3c2=_0x0295[_0xa7fcdd];return _0x44f3c2;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];var dbH=require(_0x5029('0x14'))['dbH'];function respondWithStatusCode(_0x4fa22d,_0x49f836){_0x49f836=_0x49f836||0xcc;return function(_0x4aebb6){if(_0x4aebb6){return _0x4fa22d[_0x5029('0x15')](_0x49f836);}return _0x4fa22d[_0x5029('0x16')](_0x49f836)[_0x5029('0x17')]();};}function respondWithResult(_0x434630,_0x2c0b33){_0x2c0b33=_0x2c0b33||0xc8;return function(_0x11c24b){if(_0x11c24b){return _0x434630[_0x5029('0x16')](_0x2c0b33)[_0x5029('0x18')](_0x11c24b);}};}function respondWithFilteredResult(_0x10bf55,_0x326923){return function(_0x457c73){if(_0x457c73){var _0x353cba=typeof _0x326923[_0x5029('0x19')]===_0x5029('0x1a')&&typeof _0x326923[_0x5029('0x1b')]==='undefined';var _0x1ed567=_0x457c73[_0x5029('0x1c')];var _0x35de81=_0x353cba?0x0:_0x326923[_0x5029('0x19')];var _0x8cea01=_0x353cba?_0x457c73[_0x5029('0x1c')]:_0x326923[_0x5029('0x19')]+_0x326923['limit'];var _0x226a5c;if(_0x8cea01>=_0x1ed567){_0x8cea01=_0x1ed567;_0x226a5c=0xc8;}else{_0x226a5c=0xce;}_0x10bf55['status'](_0x226a5c);return _0x10bf55[_0x5029('0x1d')](_0x5029('0x1e'),_0x35de81+'-'+_0x8cea01+'/'+_0x1ed567)[_0x5029('0x18')](_0x457c73);}return null;};}function patchUpdates(_0x3cf0fb){return function(_0x4b5854){try{jsonpatch['apply'](_0x4b5854,_0x3cf0fb,!![]);}catch(_0x4c9184){return BPromise['reject'](_0x4c9184);}return _0x4b5854[_0x5029('0x1f')]();};}function saveUpdates(_0x853a34,_0x1eb228){return function(_0x2bbbcb){if(_0x2bbbcb){return _0x2bbbcb[_0x5029('0x20')](_0x853a34)[_0x5029('0x21')](function(_0x125c26){return _0x125c26;});}return null;};}function removeEntity(_0x356dac,_0x3e857d){return function(_0x4ceaae){if(_0x4ceaae){return _0x4ceaae['destroy']()['then'](function(){var _0x588d90=_0x4ceaae[_0x5029('0x22')]({'plain':!![]});var _0x51093c='DefaultReports';return db[_0x5029('0x23')][_0x5029('0x24')]({'where':{'type':_0x51093c,'resourceId':_0x588d90['id']}})[_0x5029('0x21')](function(){return _0x4ceaae;});})['then'](function(){_0x356dac[_0x5029('0x16')](0xcc)[_0x5029('0x17')]();});}};}function handleEntityNotFound(_0x5e45c4,_0x2b6d99){return function(_0x31f0a0){if(!_0x31f0a0){_0x5e45c4[_0x5029('0x15')](0x194);}return _0x31f0a0;};}function handleError(_0x4a24b9,_0x32da06){_0x32da06=_0x32da06||0x1f4;return function(_0x251f99){logger[_0x5029('0x25')](_0x251f99['stack']);if(_0x251f99[_0x5029('0x26')]){delete _0x251f99[_0x5029('0x26')];}_0x4a24b9['status'](_0x32da06)[_0x5029('0x27')](_0x251f99);};}exports[_0x5029('0x28')]=function(_0x4434ff,_0x1c3dd9){var _0x196830={},_0x2a1ed6={},_0x44255a={'count':0x0,'rows':[]};var _0x465153=_[_0x5029('0x29')](db[_0x5029('0x2a')][_0x5029('0x2b')],function(_0x4519c8){return{'name':_0x4519c8['fieldName'],'type':_0x4519c8[_0x5029('0x2c')]['key']};});_0x2a1ed6[_0x5029('0x2d')]=_['map'](_0x465153,'name');_0x2a1ed6[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x4434ff[_0x5029('0x2e')]);_0x2a1ed6['filters']=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],_0x2a1ed6[_0x5029('0x2e')]);_0x196830[_0x5029('0x31')]=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x32')]));_0x196830['attributes']=_0x196830[_0x5029('0x31')][_0x5029('0x33')]?_0x196830[_0x5029('0x31')]:_0x2a1ed6[_0x5029('0x2d')];if(!_0x4434ff['query'][_0x5029('0x34')](_0x5029('0x35'))){_0x196830[_0x5029('0x1b')]=qs['limit'](_0x4434ff['query'][_0x5029('0x1b')]);_0x196830[_0x5029('0x19')]=qs['offset'](_0x4434ff['query'][_0x5029('0x19')]);}_0x196830[_0x5029('0x36')]=qs[_0x5029('0x37')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x37')]);_0x196830[_0x5029('0x38')]=qs[_0x5029('0x39')](_[_0x5029('0x3a')](_0x4434ff[_0x5029('0x2e')],_0x2a1ed6[_0x5029('0x39')]),_0x465153);if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3b')]){_0x196830[_0x5029('0x38')]=_[_0x5029('0x3c')](_0x196830['where'],{'$or':_['map'](_0x465153,function(_0x73797c){if(_0x73797c[_0x5029('0x2c')]!==_0x5029('0x3d')){var _0x48c9eb={};_0x48c9eb[_0x73797c[_0x5029('0x26')]]={'$like':'%'+_0x4434ff[_0x5029('0x2e')]['filter']+'%'};return _0x48c9eb;}})});}_0x196830=_[_0x5029('0x3c')]({},_0x196830,_0x4434ff['options']);var _0x506f0d={'where':_0x196830['where']};return db[_0x5029('0x2a')][_0x5029('0x1c')](_0x506f0d)[_0x5029('0x21')](function(_0x78768){_0x44255a[_0x5029('0x1c')]=_0x78768;if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3e')]){_0x196830[_0x5029('0x3f')]=[{'all':!![]}];}return db[_0x5029('0x2a')]['findAll'](_0x196830);})[_0x5029('0x21')](function(_0x236455){_0x44255a[_0x5029('0x40')]=_0x236455;return _0x44255a;})[_0x5029('0x21')](respondWithFilteredResult(_0x1c3dd9,_0x196830))[_0x5029('0x41')](handleError(_0x1c3dd9,null));};exports[_0x5029('0x42')]=function(_0x5658a7,_0x259db8){var _0xa1580a={'raw':!![],'where':{'id':_0x5658a7[_0x5029('0x43')]['id']}},_0x9434ed={};_0x9434ed[_0x5029('0x2d')]=_['keys'](db[_0x5029('0x2a')][_0x5029('0x2b')]);_0x9434ed[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x5658a7[_0x5029('0x2e')]);_0x9434ed[_0x5029('0x39')]=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],_0x9434ed[_0x5029('0x2e')]);_0xa1580a['attributes']=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x5658a7[_0x5029('0x2e')]['fields']));_0xa1580a['attributes']=_0xa1580a[_0x5029('0x31')][_0x5029('0x33')]?_0xa1580a[_0x5029('0x31')]:_0x9434ed[_0x5029('0x2d')];if(_0x5658a7[_0x5029('0x2e')][_0x5029('0x3e')]){_0xa1580a[_0x5029('0x3f')]=[{'all':!![]}];}_0xa1580a=_[_0x5029('0x3c')]({},_0xa1580a,_0x5658a7[_0x5029('0x44')]);return db[_0x5029('0x2a')][_0x5029('0x45')](_0xa1580a)[_0x5029('0x21')](handleEntityNotFound(_0x259db8,null))[_0x5029('0x21')](respondWithResult(_0x259db8,null))[_0x5029('0x41')](handleError(_0x259db8,null));};exports[_0x5029('0x46')]=function(_0x175cc0,_0x10fc07){return db[_0x5029('0x2a')][_0x5029('0x46')](_0x175cc0[_0x5029('0x47')],{})[_0x5029('0x21')](function(_0x489457){var _0x1069c4=_0x175cc0['user'][_0x5029('0x22')]({'plain':!![]});if(!_0x1069c4)throw new Error(_0x5029('0x48'));if(_0x1069c4['role']==='user'){var _0x319bff=_0x489457['get']({'plain':!![]});var _0x4aaa43=_0x5029('0x49');return db[_0x5029('0x4a')][_0x5029('0x45')]({'where':{'name':_0x4aaa43,'userProfileId':_0x1069c4['userProfileId']},'raw':!![]})['then'](function(_0x1510bb){if(_0x1510bb&&_0x1510bb[_0x5029('0x4b')]===0x0){return db['UserProfileResource'][_0x5029('0x46')]({'name':_0x319bff['name'],'resourceId':_0x319bff['id'],'type':_0x5029('0x4c'),'sectionId':_0x1510bb['id']},{})['then'](function(){return _0x489457;});}else{return _0x489457;}})[_0x5029('0x41')](function(_0x27e1c0){logger[_0x5029('0x25')](_0x5029('0x4d'),_0x27e1c0);throw _0x27e1c0;});}return _0x489457;})[_0x5029('0x21')](respondWithResult(_0x10fc07,0xc9))[_0x5029('0x41')](handleError(_0x10fc07,null));};exports[_0x5029('0x20')]=function(_0xa25013,_0x586936){if(_0xa25013[_0x5029('0x47')]['id']){delete _0xa25013['body']['id'];}return db[_0x5029('0x2a')][_0x5029('0x45')]({'where':{'id':_0xa25013['params']['id']}})[_0x5029('0x21')](handleEntityNotFound(_0x586936,null))['then'](saveUpdates(_0xa25013['body'],null))['then'](respondWithResult(_0x586936,null))[_0x5029('0x41')](handleError(_0x586936,null));};exports['destroy']=function(_0x49d1db,_0x353ae4){return db[_0x5029('0x2a')]['find']({'where':{'id':_0x49d1db[_0x5029('0x43')]['id']}})['then'](handleEntityNotFound(_0x353ae4,null))['then'](removeEntity(_0x353ae4,null))[_0x5029('0x41')](handleError(_0x353ae4,null));};exports[_0x5029('0x4e')]=function(_0x81e39c,_0x448273){var _0x164179=0xa;var _0x4e8d9f=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x4dca54={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4208ab={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x59a718=function(_0x560324){return!_[_0x5029('0x5e')]([_0x5029('0x5f'),_0x5029('0x60'),'IS\x20EMPTY',_0x5029('0x61')],_0x560324);};var _0x2d439a=function(_0x105638){if(!_0x105638||!_0x105638[_0x5029('0x62')][_0x5029('0x33')]){return'';}for(var _0x5264c6='(',_0x2ec5d0=0x0;_0x2ec5d0<_0x105638[_0x5029('0x62')][_0x5029('0x33')];_0x2ec5d0+=0x1){_0x2ec5d0>0x0&&(_0x5264c6+='\x20'+_0x105638['operator']+'\x20');_0x5264c6+=_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']?_0x2d439a(_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']):_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x63')]+'\x20'+_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')]+(_0x59a718(_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')])?'\x20'+_0x105638['rules'][_0x2ec5d0][_0x5029('0x65')]:'');}return _0x5264c6+')';};var _0x19220d={'where':{'id':_0x81e39c['params']['id']}},_0x1ff8df,_0x151562,_0x389700,_0x506f74,_0x13ca47;_0x19220d=_[_0x5029('0x3c')]({},_0x19220d,_0x81e39c['options']);return db[_0x5029('0x2a')]['find'](_0x19220d)[_0x5029('0x21')](function(_0x54daf9){if(_0x54daf9){_0x1ff8df=_0x54daf9;return _0x54daf9['getFields']();}return null;})[_0x5029('0x21')](function(_0x575f09){if(_0x575f09){if(!_0x575f09[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x151562=_0x575f09;return db[_0x5029('0x68')]['findAll']({'raw':!![]});}return null;})[_0x5029('0x21')](function(_0x255dfb){if(_0x255dfb){_0x389700=_[_0x5029('0x69')](_0x255dfb,'id');var _0x1cca02;var _0x1deed7=squel['select']();_0x1deed7[_0x5029('0x6a')](_0x1ff8df[_0x5029('0x6b')]);for(var _0x5890ac=0x0;_0x5890ac<_0x151562[_0x5029('0x33')];_0x5890ac+=0x1){_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6c')]?_0x389700[_0x151562[_0x5890ac][_0x5029('0x6c')]][_0x5029('0x6d')]:_0x151562[_0x5890ac][_0x5029('0x63')];_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6e')]?_['replace'](_0x4dca54[_0x151562[_0x5890ac]['function']],'%s',_0x1cca02):_0x1cca02;_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6f')]?_['replace'](_0x4208ab[_0x151562[_0x5890ac][_0x5029('0x6f')]],'%s',_0x1cca02):_0x1cca02;if(_0x151562[_0x5890ac][_0x5029('0x70')]){_0x1deed7['group'](_0x1cca02);}_0x151562[_0x5890ac][_0x5029('0x71')]&&_0x1deed7['order'](_0x1cca02,_0x151562[_0x5890ac]['orderBy']===_0x5029('0x72')?![]:!![]);_0x1deed7[_0x5029('0x63')](_0x1cca02,_0x151562[_0x5890ac][_0x5029('0x73')]||_0x1cca02);}if(_0x1ff8df[_0x5029('0x74')]){_0x1ff8df['joins']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x74')]);for(var _0x4a2ce8=0x0;_0x4a2ce8<_0x1ff8df[_0x5029('0x74')][_0x5029('0x33')];_0x4a2ce8+=0x1){if(_0x1ff8df['joins'][_0x4a2ce8]['type']&&_['includes'](_0x4e8d9f,_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x2c')])&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x77')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]){_0x1deed7[_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['type']](_0x1ff8df['joins'][_0x4a2ce8][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x1ff8df[_0x5029('0x6b')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['foreignTable'],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]));}}}if(_0x1ff8df[_0x5029('0x7a')]){_0x1ff8df['conditions']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x7a')]);_0x1deed7[_0x5029('0x38')](_0x2d439a(_0x1ff8df['conditions'][_0x5029('0x7b')]));}_0x13ca47=_0x1deed7[_0x5029('0x7c')]();_0x1deed7[_0x5029('0x1b')](_0x164179);_0x1deed7['offset'](0x0);logger[_0x5029('0x7d')](_0x5029('0x7e'),_0x1deed7['toString']());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1deed7[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')]['SELECT']});}})[_0x5029('0x21')](respondWithResult(_0x448273,null))[_0x5029('0x41')](handleError(_0x448273,null));};function runReport(_0x426d70,_0xe6ac28,_0x153cdc){var _0x5e7f50=_0xe6ac28[_0x5029('0x26')];var _0x202c51=0xa;var _0x344203=['join',_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x3e47bd={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x4c40d1={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x41e2d8=function(_0x51098a){return!_['includes'](['IS\x20NULL',_0x5029('0x60'),_0x5029('0x84'),_0x5029('0x61')],_0x51098a);};var _0x4007c8=function(_0x3dc05a){if(!_0x3dc05a||!_0x3dc05a['rules'][_0x5029('0x33')]){return'';}for(var _0x2e4782='(',_0x2c0540=0x0;_0x2c0540<_0x3dc05a['rules']['length'];_0x2c0540+=0x1){_0x2c0540>0x0&&(_0x2e4782+='\x20'+_0x3dc05a[_0x5029('0x85')]+'\x20');_0x2e4782+=_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x7b')]?_0x4007c8(_0x3dc05a[_0x5029('0x62')][_0x2c0540]['group']):_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x63')]+'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')]+(_0x41e2d8(_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')])?'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x65')]:'');}return _0x2e4782+')';};var _0x5aecc2={'where':{'id':_0x426d70['id']}},_0x159450,_0x556c7a,_0x48bbe2,_0x3e3150,_0x533ee2;_0x5aecc2=_[_0x5029('0x3c')]({},_0x5aecc2,_0x153cdc);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x5aecc2)[_0x5029('0x21')](function(_0x1b6f4c){if(_0x1b6f4c){_0x159450=_0x1b6f4c;return _0x1b6f4c[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x1d6092){if(_0x1d6092){if(!_0x1d6092['length']){throw new db['Sequelize'][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x556c7a=_0x1d6092;return db['AnalyticMetric'][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x4b25ed){if(_0x4b25ed){_0x48bbe2=_[_0x5029('0x69')](_0x4b25ed,'id');var _0xb8da0b;var _0x13e07e=squel[_0x5029('0x88')]();_0x13e07e[_0x5029('0x6a')](_0x159450['table']);for(var _0x38c02a=0x0;_0x38c02a<_0x556c7a[_0x5029('0x33')];_0x38c02a+=0x1){_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6c')]?_0x48bbe2[_0x556c7a[_0x38c02a]['MetricId']][_0x5029('0x6d')]:_0x556c7a[_0x38c02a][_0x5029('0x63')];_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x3e47bd[_0x556c7a[_0x38c02a][_0x5029('0x6e')]],'%s',_0xb8da0b):_0xb8da0b;_0xb8da0b=_0x556c7a[_0x38c02a]['format']?_['replace'](_0x4c40d1[_0x556c7a[_0x38c02a][_0x5029('0x6f')]],'%s',_0xb8da0b):_0xb8da0b;if(_0x556c7a[_0x38c02a][_0x5029('0x70')]){_0x13e07e['group'](_0xb8da0b);}_0x556c7a[_0x38c02a][_0x5029('0x71')]&&_0x13e07e[_0x5029('0x36')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x13e07e[_0x5029('0x63')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x73')]||_0xb8da0b);}if(_0x159450[_0x5029('0x74')]){_0x159450[_0x5029('0x74')]=JSON['parse'](_0x159450['joins']);for(var _0x4243c3=0x0;_0x4243c3<_0x159450['joins'][_0x5029('0x33')];_0x4243c3+=0x1){if(_0x159450['joins'][_0x4243c3][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x344203,_0x159450[_0x5029('0x74')][_0x4243c3]['type'])&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')]&&_0x159450[_0x5029('0x74')][_0x4243c3]['foreignTable']&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]){_0x13e07e[_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x2c')]](_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x159450[_0x5029('0x6b')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]));}}}if(_0x159450[_0x5029('0x7a')]){_0x159450[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x159450['conditions']);_0x13e07e[_0x5029('0x38')](_0x4007c8(_0x159450[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x533ee2=_0x13e07e[_0x5029('0x7c')]();_0x13e07e[_0x5029('0x1b')](_0x202c51);_0x13e07e['offset'](0x0);return;}})[_0x5029('0x21')](function(){if(_0xe6ac28[_0x5029('0x8a')]===_0x5029('0x8b')){return null;}var _0xf7729c=_[_0x5029('0x3c')](_0xe6ac28,{'name':_0xe6ac28['fullPath']||_0xe6ac28[_0x5029('0x26')]||_0x159450[_0x5029('0x26')],'basename':_0x5e7f50,'savename':util[_0x5029('0x6f')](_0x5029('0x8c'),_0xe6ac28[_0x5029('0x26')]||_0x159450['name'],require(_0x5029('0x8d'))[_0x5029('0x8e')](0x4),_0xe6ac28[_0x5029('0x8a')]||_0x5029('0x8f')),'reportId':_0x159450['id'],'reportType':_0x5029('0x90')});return db[_0x5029('0x91')][_0x5029('0x46')](_0xf7729c,{'raw':!![]});})[_0x5029('0x21')](function(_0x4a7535){if(_0x159450['table']===_0x5029('0x92')){_0x533ee2[_0x5029('0x38')](_0x159450[_0x5029('0x6b')]+_0x5029('0x93'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28['endDate']);}else{_0x533ee2[_0x5029('0x38')](_0x159450['table']+_0x5029('0x95'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28[_0x5029('0x96')]);}if(_0x4a7535){logger[_0x5029('0x97')](_0x5029('0x98'),_0x533ee2[_0x5029('0x80')]());require('child_process')[_0x5029('0x99')](path[_0x5029('0x4f')](__dirname,'../../components/export/',_0x4a7535[_0x5029('0x8a')]),[_0x4a7535['id'],_0x533ee2[_0x5029('0x80')](),path['join'](__dirname,_0x5029('0x9a'),_0x4a7535['savename']),_0x5e7f50]);return _0x4a7535;}else{var _0x54c0f3=squel['select']();_0x54c0f3['from']('('+_0x533ee2[_0x5029('0x80')]()+')','countTable');_0x54c0f3[_0x5029('0x63')](_0x5029('0x9b'),'count');_0x533ee2[_0x5029('0x1b')](_0xe6ac28[_0x5029('0x1b')]||_0x202c51);_0x533ee2['offset'](_0xe6ac28[_0x5029('0x19')]||0x0);return dbH[_0x5029('0x7f')]['query'](_0x54c0f3[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')]['QueryTypes'][_0x5029('0x9c')]})[_0x5029('0x21')](function(_0x17c755){if(!_0x17c755[_0x5029('0x33')]){_0x3e3150=0x0;}else{_0x3e3150=_0x17c755[0x0][_0x5029('0x1c')]||0x0;}return dbH[_0x5029('0x7f')]['query'](_0x533ee2[_0x5029('0x80')](),{'type':dbH['sequelize'][_0x5029('0x81')][_0x5029('0x9c')]});})[_0x5029('0x21')](function(_0x3ebe00){return{'rows':_0x3ebe00||[],'count':_0x3e3150};});}});}exports[_0x5029('0x9d')]=function(_0x2138cc,_0x331af8){return runReport(_0x2138cc[_0x5029('0x43')],_0x2138cc[_0x5029('0x2e')],_0x2138cc[_0x5029('0x44')])[_0x5029('0x21')](respondWithResult(_0x331af8,null))[_0x5029('0x41')](handleError(_0x331af8,null));};exports[_0x5029('0x9e')]=runReport;exports[_0x5029('0x2e')]=function(_0x9de076,_0x2ac88e){var _0x55ee4f=0xa;var _0x1fa9eb=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x405d47={'SUM':'SUM(%s)','COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':_0x5029('0x9f'),'MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x29c3a2={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0xb39e9d=function(_0x124c5e){return!_['includes']([_0x5029('0x5f'),'IS\x20NOT\x20NULL',_0x5029('0x84'),_0x5029('0x61')],_0x124c5e);};var _0x120acc=function(_0x21bb22){if(!_0x21bb22||!_0x21bb22['rules'][_0x5029('0x33')]){return'';}for(var _0x339112='(',_0x5d7c1a=0x0;_0x5d7c1a<_0x21bb22[_0x5029('0x62')][_0x5029('0x33')];_0x5d7c1a+=0x1){_0x5d7c1a>0x0&&(_0x339112+='\x20'+_0x21bb22['operator']+'\x20');_0x339112+=_0x21bb22[_0x5029('0x62')][_0x5d7c1a][_0x5029('0x7b')]?_0x120acc(_0x21bb22['rules'][_0x5d7c1a]['group']):_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['field']+'\x20'+_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')]+(_0xb39e9d(_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')])?'\x20'+_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['value']:'');}return _0x339112+')';};var _0x327299={'where':{'id':_0x9de076['params']['id']}},_0x3463cc,_0x590cc2,_0x3ac39a,_0x37c47b,_0x62e4af;_0x327299=_[_0x5029('0x3c')]({},_0x327299,_0x9de076['options']);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x327299)[_0x5029('0x21')](function(_0x5e7ec8){if(_0x5e7ec8){_0x3463cc=_0x5e7ec8;return _0x5e7ec8[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x5aa480){if(_0x5aa480){if(!_0x5aa480[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x590cc2=_0x5aa480;return db[_0x5029('0x68')][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x5842a5){if(_0x5842a5){_0x3ac39a=_['keyBy'](_0x5842a5,'id');var _0x313bdb;var _0x1d38e0=squel[_0x5029('0x88')]();_0x1d38e0['from'](_0x3463cc[_0x5029('0x6b')]);for(var _0x581237=0x0;_0x581237<_0x590cc2[_0x5029('0x33')];_0x581237+=0x1){_0x313bdb=_0x590cc2[_0x581237]['MetricId']?_0x3ac39a[_0x590cc2[_0x581237]['MetricId']]['metric']:_0x590cc2[_0x581237]['field'];_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x405d47[_0x590cc2[_0x581237][_0x5029('0x6e')]],'%s',_0x313bdb):_0x313bdb;_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6f')]?_[_0x5029('0x89')](_0x29c3a2[_0x590cc2[_0x581237]['format']],'%s',_0x313bdb):_0x313bdb;if(_0x590cc2[_0x581237][_0x5029('0x70')]){_0x1d38e0[_0x5029('0x7b')](_0x313bdb);}_0x590cc2[_0x581237][_0x5029('0x71')]&&_0x1d38e0[_0x5029('0x36')](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x1d38e0['field'](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x73')]||_0x313bdb);}if(_0x3463cc[_0x5029('0x74')]){_0x3463cc[_0x5029('0x74')]=JSON['parse'](_0x3463cc['joins']);for(var _0xd05bc9=0x0;_0xd05bc9<_0x3463cc[_0x5029('0x74')][_0x5029('0x33')];_0xd05bc9+=0x1){if(_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x1fa9eb,_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')])&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x76')]&&_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')]&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]){_0x1d38e0[_0x3463cc['joins'][_0xd05bc9][_0x5029('0x2c')]](_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x3463cc[_0x5029('0x6b')],_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x76')],_0x3463cc['joins'][_0xd05bc9]['foreignTable'],_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]));}}}if(_0x3463cc[_0x5029('0x7a')]){_0x3463cc[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x3463cc[_0x5029('0x7a')]);_0x1d38e0['where'](_0x120acc(_0x3463cc[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x62e4af=_0x1d38e0[_0x5029('0x7c')]();_0x1d38e0[_0x5029('0x1b')](_0x55ee4f);_0x1d38e0[_0x5029('0x19')](0x0);logger['debug'](_0x5029('0x7e'),_0x1d38e0[_0x5029('0x80')]());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1d38e0[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')][_0x5029('0x9c')]});}})[_0x5029('0x21')](function(){return{'sql':_0x62e4af[_0x5029('0x80')]()};})[_0x5029('0x21')](respondWithResult(_0x2ac88e,null))[_0x5029('0x41')](handleError(_0x2ac88e,null));};
\ No newline at end of file
+var _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x205401,_0x3832c4){var _0x569ec1=function(_0x21d59f){while(--_0x21d59f){_0x205401['push'](_0x205401['shift']());}};_0x569ec1(++_0x3832c4);}(_0xba34,0x119));var _0x4ba3=function(_0x31ff15,_0x1d43e3){_0x31ff15=_0x31ff15-0x0;var _0x226877=_0xba34[_0x31ff15];return _0x226877;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index afa420e..c2389b8 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 _0xb94e=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util'];(function(_0x541a78,_0x219591){var _0x3107f3=function(_0x153053){while(--_0x153053){_0x541a78['push'](_0x541a78['shift']());}};_0x3107f3(++_0x219591);}(_0xb94e,0x1ae));var _0xeb94=function(_0x331dfe,_0x13f0fc){_0x331dfe=_0x331dfe-0x0;var _0x104132=_0xb94e[_0x331dfe];return _0x104132;};'use strict';var _=require(_0xeb94('0x0'));var util=require(_0xeb94('0x1'));var logger=require(_0xeb94('0x2'))(_0xeb94('0x3'));var moment=require(_0xeb94('0x4'));var BPromise=require('bluebird');var rp=require(_0xeb94('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb94('0x6'));var config=require(_0xeb94('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0xeb94('0x8')]=function(_0xec68b1,_0x4cbaba){return _0xec68b1[_0xeb94('0x9')](_0xeb94('0xa'),attributes,{'tableName':_0xeb94('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7df3=['exports','define','analytics_default_reports','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x33ac17,_0x11fe15){var _0x3f7203=function(_0x2f70b9){while(--_0x2f70b9){_0x33ac17['push'](_0x33ac17['shift']());}};_0x3f7203(++_0x11fe15);}(_0x7df3,0x1ef));var _0x37df=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x7df3[_0x4154a6];return _0x3b2786;};'use strict';var _=require('lodash');var util=require(_0x37df('0x0'));var logger=require(_0x37df('0x1'))(_0x37df('0x2'));var moment=require(_0x37df('0x3'));var BPromise=require('bluebird');var rp=require(_0x37df('0x4'));var fs=require('fs');var path=require(_0x37df('0x5'));var rimraf=require(_0x37df('0x6'));var config=require(_0x37df('0x7'));var attributes=require(_0x37df('0x8'));module[_0x37df('0x9')]=function(_0x1ea9db,_0x29c895){return _0x1ea9db[_0x37df('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0x37df('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 473f808..4fee913 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 _0xf124=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x113a6c,_0x10df30){var _0x1ac632=function(_0xbd4fb9){while(--_0xbd4fb9){_0x113a6c['push'](_0x113a6c['shift']());}};_0x1ac632(++_0x10df30);}(_0xf124,0x98));var _0x4f12=function(_0x4471b3,_0x511a9f){_0x4471b3=_0x4471b3-0x0;var _0x386593=_0xf124[_0x4471b3];return _0x386593;};'use strict';var _=require(_0x4f12('0x0'));var util=require(_0x4f12('0x1'));var moment=require(_0x4f12('0x2'));var BPromise=require(_0x4f12('0x3'));var rs=require(_0x4f12('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f12('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f12('0x6'))(_0x4f12('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4f12('0x8')][_0x4f12('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4fca4d,_0xcfe045,_0x5c4fb3){return new BPromise(function(_0x26972d,_0x50284e){return client[_0x4f12('0xa')](_0x4fca4d,_0x5c4fb3)[_0x4f12('0xb')](function(_0xcb39f1){logger[_0x4f12('0xc')](_0x4f12('0xd'),_0xcfe045,_0x4f12('0xe'));logger[_0x4f12('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0xcfe045,_0x4f12('0xe'),JSON[_0x4f12('0x10')](_0xcb39f1));if(_0xcb39f1[_0x4f12('0x11')]){if(_0xcb39f1[_0x4f12('0x11')]['code']===0x1f4){logger[_0x4f12('0x11')](_0x4f12('0xd'),_0xcfe045,_0xcb39f1[_0x4f12('0x11')][_0x4f12('0x12')]);return _0x50284e(_0xcb39f1['error']['message']);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0xcfe045,_0xcb39f1[_0x4f12('0x11')]['message']);return _0x26972d(_0xcb39f1['error'][_0x4f12('0x12')]);}else{logger[_0x4f12('0xc')](_0x4f12('0xd'),_0xcfe045,_0x4f12('0xe'));_0x26972d(_0xcb39f1[_0x4f12('0x13')]['message']);}})[_0x4f12('0x14')](function(_0x1e0c30){logger[_0x4f12('0x11')](_0x4f12('0xd'),_0xcfe045,_0x1e0c30);_0x50284e(_0x1e0c30);});});}
\ No newline at end of file
+var _0x1d7c=['../../config/environment','client','http','request','info','request\x20sent','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x295811,_0x2825f4){var _0x147146=function(_0x939636){while(--_0x939636){_0x295811['push'](_0x295811['shift']());}};_0x147146(++_0x2825f4);}(_0x1d7c,0x101));var _0xc1d7=function(_0x42167f,_0x36c277){_0x42167f=_0x42167f-0x0;var _0x20f119=_0x1d7c[_0x42167f];return _0x20f119;};'use strict';var _=require(_0xc1d7('0x0'));var util=require(_0xc1d7('0x1'));var moment=require(_0xc1d7('0x2'));var BPromise=require(_0xc1d7('0x3'));var rs=require(_0xc1d7('0x4'));var fs=require('fs');var Redis=require(_0xc1d7('0x5'));var db=require(_0xc1d7('0x6'))['db'];var utils=require(_0xc1d7('0x7'));var logger=require(_0xc1d7('0x8'))('rpc');var config=require(_0xc1d7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc1d7('0xa')][_0xc1d7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9f83bc,_0x3883f6,_0x4ae70a){return new BPromise(function(_0x4d14da,_0x49a948){return client[_0xc1d7('0xc')](_0x9f83bc,_0x4ae70a)['then'](function(_0x6b8a89){logger[_0xc1d7('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3883f6,'request\x20sent');logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x3883f6,_0xc1d7('0xe'),JSON['stringify'](_0x6b8a89));if(_0x6b8a89[_0xc1d7('0xf')]){if(_0x6b8a89[_0xc1d7('0xf')]['code']===0x1f4){logger['error'](_0xc1d7('0x10'),_0x3883f6,_0x6b8a89[_0xc1d7('0xf')][_0xc1d7('0x11')]);return _0x49a948(_0x6b8a89['error'][_0xc1d7('0x11')]);}logger[_0xc1d7('0xf')](_0xc1d7('0x10'),_0x3883f6,_0x6b8a89['error'][_0xc1d7('0x11')]);return _0x4d14da(_0x6b8a89['error'][_0xc1d7('0x11')]);}else{logger[_0xc1d7('0xd')](_0xc1d7('0x10'),_0x3883f6,_0xc1d7('0xe'));_0x4d14da(_0x6b8a89[_0xc1d7('0x12')][_0xc1d7('0x11')]);}})['catch'](function(_0x4dc5cb){logger['error'](_0xc1d7('0x10'),_0x3883f6,_0x4dc5cb);_0x49a948(_0x4dc5cb);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index bb45aba..f88f8fc 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 _0x27fa=['Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','preview','run','/:id/query','query','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x29771f,_0x1189ae){var _0x279baf=function(_0xd66325){while(--_0xd66325){_0x29771f['push'](_0x29771f['shift']());}};_0x279baf(++_0x1189ae);}(_0x27fa,0x1c3));var _0xa27f=function(_0x349983,_0x108690){_0x349983=_0x349983-0x0;var _0x2277cb=_0x27fa[_0x349983];return _0x2277cb;};'use strict';var multer=require(_0xa27f('0x0'));var util=require(_0xa27f('0x1'));var path=require(_0xa27f('0x2'));var timeout=require(_0xa27f('0x3'));var express=require(_0xa27f('0x4'));var router=express[_0xa27f('0x5')]();var fs_extra=require(_0xa27f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa27f('0x7'));var config=require(_0xa27f('0x8'));var controller=require(_0xa27f('0x9'));router[_0xa27f('0xa')]('/',auth[_0xa27f('0xb')](),controller['index']);router[_0xa27f('0xa')](_0xa27f('0xc'),auth[_0xa27f('0xb')](),controller[_0xa27f('0xd')]);router[_0xa27f('0xa')]('/:id/preview',auth[_0xa27f('0xb')](),controller[_0xa27f('0xe')]);router[_0xa27f('0xa')]('/:id/run',auth[_0xa27f('0xb')](),controller[_0xa27f('0xf')]);router['get'](_0xa27f('0x10'),auth['isAuthenticated'](),controller[_0xa27f('0x11')]);router[_0xa27f('0x12')]('/',auth[_0xa27f('0xb')](),controller['create']);router[_0xa27f('0x13')](_0xa27f('0xc'),auth[_0xa27f('0xb')](),controller[_0xa27f('0x14')]);router[_0xa27f('0x15')](_0xa27f('0xc'),auth['isAuthenticated'](),controller[_0xa27f('0x16')]);module[_0xa27f('0x17')]=router;
\ No newline at end of file
+var _0x23ce=['/:id/preview','preview','/:id/run','query','post','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x53a231,_0x11303a){var _0x5b69b0=function(_0x23862c){while(--_0x23862c){_0x53a231['push'](_0x53a231['shift']());}};_0x5b69b0(++_0x11303a);}(_0x23ce,0x1e2));var _0xe23c=function(_0x1d2128,_0x52ed41){_0x1d2128=_0x1d2128-0x0;var _0x98cc02=_0x23ce[_0x1d2128];return _0x98cc02;};'use strict';var multer=require(_0xe23c('0x0'));var util=require(_0xe23c('0x1'));var path=require('path');var timeout=require(_0xe23c('0x2'));var express=require(_0xe23c('0x3'));var router=express['Router']();var fs_extra=require(_0xe23c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe23c('0x5'));var config=require(_0xe23c('0x6'));var controller=require('./analyticDefaultReport.controller');router[_0xe23c('0x7')]('/',auth[_0xe23c('0x8')](),controller[_0xe23c('0x9')]);router[_0xe23c('0x7')](_0xe23c('0xa'),auth[_0xe23c('0x8')](),controller[_0xe23c('0xb')]);router[_0xe23c('0x7')](_0xe23c('0xc'),auth[_0xe23c('0x8')](),controller[_0xe23c('0xd')]);router[_0xe23c('0x7')](_0xe23c('0xe'),auth['isAuthenticated'](),controller['run']);router[_0xe23c('0x7')]('/:id/query',auth['isAuthenticated'](),controller[_0xe23c('0xf')]);router[_0xe23c('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xe23c('0xa'),auth[_0xe23c('0x8')](),controller['update']);router[_0xe23c('0x11')](_0xe23c('0xa'),auth[_0xe23c('0x8')](),controller[_0xe23c('0x12')]);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 a122fff..6b3d10b 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 _0x3d34=['xlsx','DATE','Loading','manual','scheduled','INTEGER','sequelize','moment','STRING','ENUM','csv','pdf'];(function(_0x3f62b4,_0x3bfcec){var _0x2668d6=function(_0x245070){while(--_0x245070){_0x3f62b4['push'](_0x3f62b4['shift']());}};_0x2668d6(++_0x3bfcec);}(_0x3d34,0xa2));var _0x43d3=function(_0x749614,_0x9c4b56){_0x749614=_0x749614-0x0;var _0x4cacdf=_0x3d34[_0x749614];return _0x4cacdf;};'use strict';var Sequelize=require(_0x43d3('0x0'));var moment=require(_0x43d3('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x43d3('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x43d3('0x3')](_0x43d3('0x4'),_0x43d3('0x5'),_0x43d3('0x6')),'allowNull':![],'defaultValue':_0x43d3('0x4')},'savename':{'type':Sequelize[_0x43d3('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x43d3('0x7')]},'endDate':{'type':Sequelize[_0x43d3('0x7')]},'status':{'type':Sequelize[_0x43d3('0x2')],'defaultValue':_0x43d3('0x8')},'type':{'type':Sequelize[_0x43d3('0x3')](_0x43d3('0x9'),_0x43d3('0xa')),'allowNull':![],'defaultValue':_0x43d3('0x9')},'reportId':{'type':Sequelize[_0x43d3('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x43d3('0x2')]}};
\ No newline at end of file
+var _0x03bf=['sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual'];(function(_0x120ab6,_0x65fbd6){var _0x4ab62f=function(_0x13d64c){while(--_0x13d64c){_0x120ab6['push'](_0x120ab6['shift']());}};_0x4ab62f(++_0x65fbd6);}(_0x03bf,0xdc));var _0xf03b=function(_0x5cd8b1,_0x489d74){_0x5cd8b1=_0x5cd8b1-0x0;var _0x365e56=_0x03bf[_0x5cd8b1];return _0x365e56;};'use strict';var Sequelize=require(_0xf03b('0x0'));var moment=require(_0xf03b('0x1'));module[_0xf03b('0x2')]={'name':{'type':Sequelize[_0xf03b('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xf03b('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xf03b('0x4')](_0xf03b('0x5'),_0xf03b('0x6'),_0xf03b('0x7')),'allowNull':![],'defaultValue':_0xf03b('0x5')},'savename':{'type':Sequelize[_0xf03b('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xf03b('0x8')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0xf03b('0x9')},'type':{'type':Sequelize[_0xf03b('0x4')](_0xf03b('0xa'),'scheduled'),'allowNull':![],'defaultValue':_0xf03b('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 499135c..7e8628c 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 _0xc738=['%s.%s','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','get','ExtractedReports','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','body','download','basename','savename','output','existsSync','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','format'];(function(_0x2c37b2,_0x107055){var _0x559312=function(_0x53e3d3){while(--_0x53e3d3){_0x2c37b2['push'](_0x2c37b2['shift']());}};_0x559312(++_0x107055);}(_0xc738,0x69));var _0x8c73=function(_0x2e50a2,_0x27f31e){_0x2e50a2=_0x2e50a2-0x0;var _0x47e5de=_0xc738[_0x2e50a2];return _0x47e5de;};'use strict';var emlformat=require(_0x8c73('0x0'));var rimraf=require(_0x8c73('0x1'));var zipdir=require(_0x8c73('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8c73('0x3'));var moment=require(_0x8c73('0x4'));var BPromise=require(_0x8c73('0x5'));var Mustache=require(_0x8c73('0x6'));var util=require(_0x8c73('0x7'));var path=require(_0x8c73('0x8'));var sox=require(_0x8c73('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8c73('0xa'));var _=require('lodash');var squel=require(_0x8c73('0xb'));var crypto=require(_0x8c73('0xc'));var jsforce=require(_0x8c73('0xd'));var deskjs=require(_0x8c73('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8c73('0xf'));var Papa=require(_0x8c73('0x10'));var Redis=require(_0x8c73('0x11'));var authService=require(_0x8c73('0x12'));var qs=require(_0x8c73('0x13'));var as=require(_0x8c73('0x14'));var hardwareService=require(_0x8c73('0x15'));var logger=require(_0x8c73('0x16'))(_0x8c73('0x17'));var utils=require(_0x8c73('0x18'));var config=require(_0x8c73('0x19'));var licenseUtil=require(_0x8c73('0x1a'));var db=require(_0x8c73('0x1b'))['db'];function respondWithStatusCode(_0xce8162,_0x4035ee){_0x4035ee=_0x4035ee||0xcc;return function(_0x15d950){if(_0x15d950){return _0xce8162['sendStatus'](_0x4035ee);}return _0xce8162[_0x8c73('0x1c')](_0x4035ee)[_0x8c73('0x1d')]();};}function respondWithResult(_0x437167,_0x5cf4e2){_0x5cf4e2=_0x5cf4e2||0xc8;return function(_0x1d7a39){if(_0x1d7a39){return _0x437167[_0x8c73('0x1c')](_0x5cf4e2)[_0x8c73('0x1e')](_0x1d7a39);}};}function respondWithFilteredResult(_0x38c537,_0x1ce25d){return function(_0x3cf092){if(_0x3cf092){var _0x3673b5=typeof _0x1ce25d[_0x8c73('0x1f')]==='undefined'&&typeof _0x1ce25d[_0x8c73('0x20')]===_0x8c73('0x21');var _0x262dac=_0x3cf092['count'];var _0x3550e4=_0x3673b5?0x0:_0x1ce25d['offset'];var _0x169349=_0x3673b5?_0x3cf092[_0x8c73('0x22')]:_0x1ce25d[_0x8c73('0x1f')]+_0x1ce25d['limit'];var _0x14e57b;if(_0x169349>=_0x262dac){_0x169349=_0x262dac;_0x14e57b=0xc8;}else{_0x14e57b=0xce;}_0x38c537['status'](_0x14e57b);return _0x38c537[_0x8c73('0x23')](_0x8c73('0x24'),_0x3550e4+'-'+_0x169349+'/'+_0x262dac)['json'](_0x3cf092);}return null;};}function patchUpdates(_0x3b188b){return function(_0x22bfe8){try{jsonpatch[_0x8c73('0x25')](_0x22bfe8,_0x3b188b,!![]);}catch(_0x4c7dea){return BPromise[_0x8c73('0x26')](_0x4c7dea);}return _0x22bfe8[_0x8c73('0x27')]();};}function saveUpdates(_0x34153c,_0xcde10c){return function(_0xd3d6a4){if(_0xd3d6a4){return _0xd3d6a4[_0x8c73('0x28')](_0x34153c)['then'](function(_0x331673){return _0x331673;});}return null;};}function removeEntity(_0x6f5d62,_0x25fb4d){return function(_0x3dab72){if(_0x3dab72){return _0x3dab72[_0x8c73('0x29')]()[_0x8c73('0x2a')](function(){var _0x405d5f=_0x3dab72[_0x8c73('0x2b')]({'plain':!![]});var _0x3c2da1=_0x8c73('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c2da1,'resourceId':_0x405d5f['id']}})[_0x8c73('0x2a')](function(){return _0x3dab72;});})['then'](function(){_0x6f5d62['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x30a84d,_0x1a5ead){return function(_0x529f82){if(!_0x529f82){_0x30a84d[_0x8c73('0x2d')](0x194);}return _0x529f82;};}function handleError(_0x1f2795,_0x591973){_0x591973=_0x591973||0x1f4;return function(_0xfa830b){logger[_0x8c73('0x2e')](_0xfa830b[_0x8c73('0x2f')]);if(_0xfa830b[_0x8c73('0x30')]){delete _0xfa830b[_0x8c73('0x30')];}_0x1f2795[_0x8c73('0x1c')](_0x591973)[_0x8c73('0x31')](_0xfa830b);};}exports[_0x8c73('0x32')]=function(_0x419a48,_0xd81dbd){var _0x4d09fb={},_0x28a731={},_0x36b2d8={'count':0x0,'rows':[]};var _0xbfe6ea=_[_0x8c73('0x33')](db[_0x8c73('0x34')][_0x8c73('0x35')],function(_0x451123){return{'name':_0x451123[_0x8c73('0x36')],'type':_0x451123[_0x8c73('0x37')]['key']};});_0x28a731[_0x8c73('0x38')]=_[_0x8c73('0x33')](_0xbfe6ea,_0x8c73('0x30'));_0x28a731[_0x8c73('0x39')]=_[_0x8c73('0x3a')](_0x419a48['query']);_0x28a731[_0x8c73('0x3b')]=_[_0x8c73('0x3c')](_0x28a731['model'],_0x28a731[_0x8c73('0x39')]);_0x4d09fb[_0x8c73('0x3d')]=_[_0x8c73('0x3c')](_0x28a731[_0x8c73('0x38')],qs[_0x8c73('0x3e')](_0x419a48['query'][_0x8c73('0x3e')]));_0x4d09fb[_0x8c73('0x3d')]=_0x4d09fb[_0x8c73('0x3d')]['length']?_0x4d09fb['attributes']:_0x28a731[_0x8c73('0x38')];if(!_0x419a48['query'][_0x8c73('0x3f')](_0x8c73('0x40'))){_0x4d09fb[_0x8c73('0x20')]=qs[_0x8c73('0x20')](_0x419a48[_0x8c73('0x39')]['limit']);_0x4d09fb['offset']=qs[_0x8c73('0x1f')](_0x419a48[_0x8c73('0x39')]['offset']);}_0x4d09fb[_0x8c73('0x41')]=qs[_0x8c73('0x42')](_0x419a48[_0x8c73('0x39')]['sort']);_0x4d09fb['where']=qs['filters'](_[_0x8c73('0x43')](_0x419a48[_0x8c73('0x39')],_0x28a731[_0x8c73('0x3b')]),_0xbfe6ea);if(_0x419a48[_0x8c73('0x39')][_0x8c73('0x44')]){_0x4d09fb[_0x8c73('0x45')]=_[_0x8c73('0x46')](_0x4d09fb['where'],{'$or':_[_0x8c73('0x33')](_0xbfe6ea,function(_0xe5d5e4){if(_0xe5d5e4[_0x8c73('0x37')]!==_0x8c73('0x47')){var _0x3f47dd={};_0x3f47dd[_0xe5d5e4[_0x8c73('0x30')]]={'$like':'%'+_0x419a48['query'][_0x8c73('0x44')]+'%'};return _0x3f47dd;}})});}_0x4d09fb=_[_0x8c73('0x46')]({},_0x4d09fb,_0x419a48[_0x8c73('0x48')]);var _0x13d776={'where':_0x4d09fb[_0x8c73('0x45')]};return db['AnalyticExtractedReport']['count'](_0x13d776)[_0x8c73('0x2a')](function(_0x4a4a72){_0x36b2d8[_0x8c73('0x22')]=_0x4a4a72;if(_0x419a48[_0x8c73('0x39')][_0x8c73('0x49')]){_0x4d09fb[_0x8c73('0x4a')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x8c73('0x4b')](_0x4d09fb);})[_0x8c73('0x2a')](function(_0x3a1a31){_0x36b2d8['rows']=_0x3a1a31;return _0x36b2d8;})[_0x8c73('0x2a')](respondWithFilteredResult(_0xd81dbd,_0x4d09fb))[_0x8c73('0x4c')](handleError(_0xd81dbd,null));};exports['show']=function(_0x4dd1fa,_0x45c1e7){var _0x413bf7={'raw':!![],'where':{'id':_0x4dd1fa[_0x8c73('0x4d')]['id']}},_0x337fe3={};_0x337fe3[_0x8c73('0x38')]=_[_0x8c73('0x3a')](db[_0x8c73('0x34')]['rawAttributes']);_0x337fe3[_0x8c73('0x39')]=_[_0x8c73('0x3a')](_0x4dd1fa[_0x8c73('0x39')]);_0x337fe3[_0x8c73('0x3b')]=_[_0x8c73('0x3c')](_0x337fe3[_0x8c73('0x38')],_0x337fe3[_0x8c73('0x39')]);_0x413bf7['attributes']=_['intersection'](_0x337fe3[_0x8c73('0x38')],qs['fields'](_0x4dd1fa[_0x8c73('0x39')][_0x8c73('0x3e')]));_0x413bf7[_0x8c73('0x3d')]=_0x413bf7[_0x8c73('0x3d')][_0x8c73('0x4e')]?_0x413bf7[_0x8c73('0x3d')]:_0x337fe3[_0x8c73('0x38')];if(_0x4dd1fa['query'][_0x8c73('0x49')]){_0x413bf7[_0x8c73('0x4a')]=[{'all':!![]}];}_0x413bf7=_[_0x8c73('0x46')]({},_0x413bf7,_0x4dd1fa['options']);return db[_0x8c73('0x34')][_0x8c73('0x4f')](_0x413bf7)[_0x8c73('0x2a')](handleEntityNotFound(_0x45c1e7,null))['then'](respondWithResult(_0x45c1e7,null))[_0x8c73('0x4c')](handleError(_0x45c1e7,null));};exports[_0x8c73('0x50')]=function(_0x28f29d,_0xe852d1){return db[_0x8c73('0x34')][_0x8c73('0x50')](_0x28f29d['body'],{})['then'](function(_0x43a4ad){var _0xda6931=_0x28f29d[_0x8c73('0x51')][_0x8c73('0x2b')]({'plain':!![]});if(!_0xda6931)throw new Error(_0x8c73('0x52'));if(_0xda6931[_0x8c73('0x53')]===_0x8c73('0x51')){var _0x16ee93=_0x43a4ad[_0x8c73('0x2b')]({'plain':!![]});var _0x52c806=_0x8c73('0x2c');return db[_0x8c73('0x54')][_0x8c73('0x4f')]({'where':{'name':_0x52c806,'userProfileId':_0xda6931[_0x8c73('0x55')]},'raw':!![]})[_0x8c73('0x2a')](function(_0x5c1a84){if(_0x5c1a84&&_0x5c1a84['autoAssociation']===0x0){return db[_0x8c73('0x56')][_0x8c73('0x50')]({'name':_0x16ee93[_0x8c73('0x30')],'resourceId':_0x16ee93['id'],'type':_0x5c1a84[_0x8c73('0x30')],'sectionId':_0x5c1a84['id']},{})[_0x8c73('0x2a')](function(){return _0x43a4ad;});}else{return _0x43a4ad;}})['catch'](function(_0x1e3043){logger[_0x8c73('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e3043);throw _0x1e3043;});}return _0x43a4ad;})['then'](respondWithResult(_0xe852d1,0xc9))['catch'](handleError(_0xe852d1,null));};exports[_0x8c73('0x28')]=function(_0x13ba7d,_0x459f1f){if(_0x13ba7d[_0x8c73('0x57')]['id']){delete _0x13ba7d['body']['id'];}return db[_0x8c73('0x34')][_0x8c73('0x4f')]({'where':{'id':_0x13ba7d['params']['id']}})['then'](handleEntityNotFound(_0x459f1f,null))[_0x8c73('0x2a')](saveUpdates(_0x13ba7d[_0x8c73('0x57')],null))[_0x8c73('0x2a')](respondWithResult(_0x459f1f,null))[_0x8c73('0x4c')](handleError(_0x459f1f,null));};exports[_0x8c73('0x29')]=function(_0x4b09d8,_0x118aa1){return db[_0x8c73('0x34')][_0x8c73('0x4f')]({'where':{'id':_0x4b09d8[_0x8c73('0x4d')]['id']}})['then'](handleEntityNotFound(_0x118aa1,null))[_0x8c73('0x2a')](removeEntity(_0x118aa1,null))[_0x8c73('0x4c')](handleError(_0x118aa1,null));};exports[_0x8c73('0x58')]=function(_0x20f2f6,_0x34b2de,_0x3e37cd){return db[_0x8c73('0x34')][_0x8c73('0x4f')]({'where':{'id':_0x20f2f6['params']['id']},'attributes':[_0x8c73('0x30'),_0x8c73('0x59'),_0x8c73('0x5a'),_0x8c73('0x5b')],'raw':!![]})[_0x8c73('0x2a')](handleEntityNotFound(_0x34b2de,null))[_0x8c73('0x2a')](function(_0x52f061){if(_0x52f061){if(!fs[_0x8c73('0x5c')](path['join'](config[_0x8c73('0x5d')],_0x8c73('0x5e'),_0x52f061['savename']))){throw new db[(_0x8c73('0x5f'))][(_0x8c73('0x60'))](_0x8c73('0x61'));}if(_0x20f2f6[_0x8c73('0x39')][_0x8c73('0x62')]){return _0x34b2de[_0x8c73('0x2d')](0xc8);}return _0x34b2de['download'](path[_0x8c73('0x63')](config['root'],_0x8c73('0x5e'),_0x52f061[_0x8c73('0x5a')]),util[_0x8c73('0x64')](_0x8c73('0x65'),_0x52f061[_0x8c73('0x59')]||_0x52f061[_0x8c73('0x30')],_0x52f061[_0x8c73('0x5b')][_0x8c73('0x66')]()));}})[_0x8c73('0x4c')](handleError(_0x34b2de,null));};
\ No newline at end of file
+var _0xc2a2=['fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','error','stack','name','send','map','AnalyticExtractedReport','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','toLowerCase','eml-format','zip-dir'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2a2,0x1e3));var _0x2c2a=function(_0x1655ba,_0x305a62){_0x1655ba=_0x1655ba-0x0;var _0x2571a9=_0xc2a2[_0x1655ba];return _0x2571a9;};'use strict';var emlformat=require(_0x2c2a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2c2a('0x1'));var jsonpatch=require(_0x2c2a('0x2'));var rp=require(_0x2c2a('0x3'));var moment=require(_0x2c2a('0x4'));var BPromise=require(_0x2c2a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2c2a('0x6'));var sox=require('sox');var csv=require(_0x2c2a('0x7'));var ejs=require(_0x2c2a('0x8'));var fs=require('fs');var fs_extra=require(_0x2c2a('0x9'));var _=require(_0x2c2a('0xa'));var squel=require(_0x2c2a('0xb'));var crypto=require(_0x2c2a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2c2a('0xd'));var toCsv=require(_0x2c2a('0x7'));var querystring=require(_0x2c2a('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2c2a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2c2a('0x10'));var hardwareService=require(_0x2c2a('0x11'));var logger=require('../../config/logger')(_0x2c2a('0x12'));var utils=require(_0x2c2a('0x13'));var config=require(_0x2c2a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x2c2a('0x15'))['db'];function respondWithStatusCode(_0x5381b7,_0x529064){_0x529064=_0x529064||0xcc;return function(_0x1386e9){if(_0x1386e9){return _0x5381b7[_0x2c2a('0x16')](_0x529064);}return _0x5381b7[_0x2c2a('0x17')](_0x529064)[_0x2c2a('0x18')]();};}function respondWithResult(_0xaa319d,_0x28117a){_0x28117a=_0x28117a||0xc8;return function(_0x39d42e){if(_0x39d42e){return _0xaa319d[_0x2c2a('0x17')](_0x28117a)['json'](_0x39d42e);}};}function respondWithFilteredResult(_0x3215aa,_0x5dc1a2){return function(_0x2fdc77){if(_0x2fdc77){var _0x4bc219=typeof _0x5dc1a2[_0x2c2a('0x19')]===_0x2c2a('0x1a')&&typeof _0x5dc1a2[_0x2c2a('0x1b')]===_0x2c2a('0x1a');var _0x4bafba=_0x2fdc77['count'];var _0x492c40=_0x4bc219?0x0:_0x5dc1a2[_0x2c2a('0x19')];var _0x47974d=_0x4bc219?_0x2fdc77[_0x2c2a('0x1c')]:_0x5dc1a2[_0x2c2a('0x19')]+_0x5dc1a2[_0x2c2a('0x1b')];var _0x43d706;if(_0x47974d>=_0x4bafba){_0x47974d=_0x4bafba;_0x43d706=0xc8;}else{_0x43d706=0xce;}_0x3215aa[_0x2c2a('0x17')](_0x43d706);return _0x3215aa[_0x2c2a('0x1d')](_0x2c2a('0x1e'),_0x492c40+'-'+_0x47974d+'/'+_0x4bafba)[_0x2c2a('0x1f')](_0x2fdc77);}return null;};}function patchUpdates(_0x3a3848){return function(_0x875807){try{jsonpatch[_0x2c2a('0x20')](_0x875807,_0x3a3848,!![]);}catch(_0x1404ec){return BPromise[_0x2c2a('0x21')](_0x1404ec);}return _0x875807[_0x2c2a('0x22')]();};}function saveUpdates(_0x4fe707,_0x42cd0e){return function(_0x134c59){if(_0x134c59){return _0x134c59[_0x2c2a('0x23')](_0x4fe707)[_0x2c2a('0x24')](function(_0x8845f9){return _0x8845f9;});}return null;};}function removeEntity(_0x41e4ee,_0x5f3738){return function(_0x5094f1){if(_0x5094f1){return _0x5094f1['destroy']()[_0x2c2a('0x24')](function(){var _0x538bbb=_0x5094f1[_0x2c2a('0x25')]({'plain':!![]});var _0x35dccc=_0x2c2a('0x26');return db[_0x2c2a('0x27')][_0x2c2a('0x28')]({'where':{'type':_0x35dccc,'resourceId':_0x538bbb['id']}})['then'](function(){return _0x5094f1;});})[_0x2c2a('0x24')](function(){_0x41e4ee[_0x2c2a('0x17')](0xcc)[_0x2c2a('0x18')]();});}};}function handleEntityNotFound(_0x2a056a,_0x191e64){return function(_0xa99bd2){if(!_0xa99bd2){_0x2a056a[_0x2c2a('0x16')](0x194);}return _0xa99bd2;};}function handleError(_0x14ccb4,_0x3187b0){_0x3187b0=_0x3187b0||0x1f4;return function(_0x4e6fb3){logger[_0x2c2a('0x29')](_0x4e6fb3[_0x2c2a('0x2a')]);if(_0x4e6fb3[_0x2c2a('0x2b')]){delete _0x4e6fb3['name'];}_0x14ccb4[_0x2c2a('0x17')](_0x3187b0)[_0x2c2a('0x2c')](_0x4e6fb3);};}exports['index']=function(_0x3469dc,_0x2eca97){var _0x5d18af={},_0x4eea88={},_0x4cc126={'count':0x0,'rows':[]};var _0x5e2b84=_[_0x2c2a('0x2d')](db[_0x2c2a('0x2e')]['rawAttributes'],function(_0x503ef9){return{'name':_0x503ef9['fieldName'],'type':_0x503ef9[_0x2c2a('0x2f')][_0x2c2a('0x30')]};});_0x4eea88[_0x2c2a('0x31')]=_['map'](_0x5e2b84,_0x2c2a('0x2b'));_0x4eea88['query']=_['keys'](_0x3469dc[_0x2c2a('0x32')]);_0x4eea88[_0x2c2a('0x33')]=_[_0x2c2a('0x34')](_0x4eea88[_0x2c2a('0x31')],_0x4eea88['query']);_0x5d18af[_0x2c2a('0x35')]=_[_0x2c2a('0x34')](_0x4eea88[_0x2c2a('0x31')],qs['fields'](_0x3469dc['query'][_0x2c2a('0x36')]));_0x5d18af[_0x2c2a('0x35')]=_0x5d18af[_0x2c2a('0x35')][_0x2c2a('0x37')]?_0x5d18af[_0x2c2a('0x35')]:_0x4eea88[_0x2c2a('0x31')];if(!_0x3469dc[_0x2c2a('0x32')][_0x2c2a('0x38')](_0x2c2a('0x39'))){_0x5d18af['limit']=qs[_0x2c2a('0x1b')](_0x3469dc[_0x2c2a('0x32')][_0x2c2a('0x1b')]);_0x5d18af[_0x2c2a('0x19')]=qs[_0x2c2a('0x19')](_0x3469dc[_0x2c2a('0x32')][_0x2c2a('0x19')]);}_0x5d18af[_0x2c2a('0x3a')]=qs[_0x2c2a('0x3b')](_0x3469dc[_0x2c2a('0x32')][_0x2c2a('0x3b')]);_0x5d18af[_0x2c2a('0x3c')]=qs[_0x2c2a('0x33')](_[_0x2c2a('0x3d')](_0x3469dc[_0x2c2a('0x32')],_0x4eea88['filters']),_0x5e2b84);if(_0x3469dc[_0x2c2a('0x32')][_0x2c2a('0x3e')]){_0x5d18af[_0x2c2a('0x3c')]=_[_0x2c2a('0x3f')](_0x5d18af['where'],{'$or':_[_0x2c2a('0x2d')](_0x5e2b84,function(_0x340a82){if(_0x340a82[_0x2c2a('0x2f')]!==_0x2c2a('0x40')){var _0x45651b={};_0x45651b[_0x340a82[_0x2c2a('0x2b')]]={'$like':'%'+_0x3469dc[_0x2c2a('0x32')][_0x2c2a('0x3e')]+'%'};return _0x45651b;}})});}_0x5d18af=_[_0x2c2a('0x3f')]({},_0x5d18af,_0x3469dc[_0x2c2a('0x41')]);var _0xc1e43c={'where':_0x5d18af[_0x2c2a('0x3c')]};return db[_0x2c2a('0x2e')][_0x2c2a('0x1c')](_0xc1e43c)['then'](function(_0x557a01){_0x4cc126[_0x2c2a('0x1c')]=_0x557a01;if(_0x3469dc[_0x2c2a('0x32')][_0x2c2a('0x42')]){_0x5d18af['include']=[{'all':!![]}];}return db[_0x2c2a('0x2e')][_0x2c2a('0x43')](_0x5d18af);})['then'](function(_0x4bc4ed){_0x4cc126[_0x2c2a('0x44')]=_0x4bc4ed;return _0x4cc126;})[_0x2c2a('0x24')](respondWithFilteredResult(_0x2eca97,_0x5d18af))[_0x2c2a('0x45')](handleError(_0x2eca97,null));};exports[_0x2c2a('0x46')]=function(_0x1a9c6c,_0x2dd3e2){var _0x4f2502={'raw':!![],'where':{'id':_0x1a9c6c[_0x2c2a('0x47')]['id']}},_0x1bbb69={};_0x1bbb69['model']=_[_0x2c2a('0x48')](db[_0x2c2a('0x2e')][_0x2c2a('0x49')]);_0x1bbb69[_0x2c2a('0x32')]=_['keys'](_0x1a9c6c['query']);_0x1bbb69[_0x2c2a('0x33')]=_[_0x2c2a('0x34')](_0x1bbb69[_0x2c2a('0x31')],_0x1bbb69[_0x2c2a('0x32')]);_0x4f2502[_0x2c2a('0x35')]=_['intersection'](_0x1bbb69[_0x2c2a('0x31')],qs[_0x2c2a('0x36')](_0x1a9c6c[_0x2c2a('0x32')]['fields']));_0x4f2502[_0x2c2a('0x35')]=_0x4f2502[_0x2c2a('0x35')][_0x2c2a('0x37')]?_0x4f2502['attributes']:_0x1bbb69[_0x2c2a('0x31')];if(_0x1a9c6c[_0x2c2a('0x32')][_0x2c2a('0x42')]){_0x4f2502[_0x2c2a('0x4a')]=[{'all':!![]}];}_0x4f2502=_['merge']({},_0x4f2502,_0x1a9c6c[_0x2c2a('0x41')]);return db[_0x2c2a('0x2e')][_0x2c2a('0x4b')](_0x4f2502)[_0x2c2a('0x24')](handleEntityNotFound(_0x2dd3e2,null))[_0x2c2a('0x24')](respondWithResult(_0x2dd3e2,null))['catch'](handleError(_0x2dd3e2,null));};exports[_0x2c2a('0x4c')]=function(_0x21262f,_0x15d917){return db[_0x2c2a('0x2e')][_0x2c2a('0x4c')](_0x21262f[_0x2c2a('0x4d')],{})[_0x2c2a('0x24')](function(_0x49e7da){var _0x149dab=_0x21262f[_0x2c2a('0x4e')][_0x2c2a('0x25')]({'plain':!![]});if(!_0x149dab)throw new Error(_0x2c2a('0x4f'));if(_0x149dab[_0x2c2a('0x50')]===_0x2c2a('0x4e')){var _0x5a25b8=_0x49e7da['get']({'plain':!![]});var _0x11e40a=_0x2c2a('0x26');return db[_0x2c2a('0x51')][_0x2c2a('0x4b')]({'where':{'name':_0x11e40a,'userProfileId':_0x149dab[_0x2c2a('0x52')]},'raw':!![]})[_0x2c2a('0x24')](function(_0x28c9f5){if(_0x28c9f5&&_0x28c9f5[_0x2c2a('0x53')]===0x0){return db[_0x2c2a('0x27')][_0x2c2a('0x4c')]({'name':_0x5a25b8['name'],'resourceId':_0x5a25b8['id'],'type':_0x28c9f5[_0x2c2a('0x2b')],'sectionId':_0x28c9f5['id']},{})[_0x2c2a('0x24')](function(){return _0x49e7da;});}else{return _0x49e7da;}})[_0x2c2a('0x45')](function(_0x411bd6){logger[_0x2c2a('0x29')](_0x2c2a('0x54'),_0x411bd6);throw _0x411bd6;});}return _0x49e7da;})[_0x2c2a('0x24')](respondWithResult(_0x15d917,0xc9))[_0x2c2a('0x45')](handleError(_0x15d917,null));};exports[_0x2c2a('0x23')]=function(_0x210b27,_0x296417){if(_0x210b27['body']['id']){delete _0x210b27['body']['id'];}return db[_0x2c2a('0x2e')][_0x2c2a('0x4b')]({'where':{'id':_0x210b27['params']['id']}})['then'](handleEntityNotFound(_0x296417,null))[_0x2c2a('0x24')](saveUpdates(_0x210b27[_0x2c2a('0x4d')],null))[_0x2c2a('0x24')](respondWithResult(_0x296417,null))['catch'](handleError(_0x296417,null));};exports[_0x2c2a('0x28')]=function(_0x9ff4f4,_0x1c45db){return db[_0x2c2a('0x2e')]['find']({'where':{'id':_0x9ff4f4[_0x2c2a('0x47')]['id']}})[_0x2c2a('0x24')](handleEntityNotFound(_0x1c45db,null))[_0x2c2a('0x24')](removeEntity(_0x1c45db,null))[_0x2c2a('0x45')](handleError(_0x1c45db,null));};exports['download']=function(_0x2a70d0,_0x558f3f,_0x203c72){return db['AnalyticExtractedReport'][_0x2c2a('0x4b')]({'where':{'id':_0x2a70d0[_0x2c2a('0x47')]['id']},'attributes':[_0x2c2a('0x2b'),_0x2c2a('0x55'),_0x2c2a('0x56'),_0x2c2a('0x57')],'raw':!![]})[_0x2c2a('0x24')](handleEntityNotFound(_0x558f3f,null))[_0x2c2a('0x24')](function(_0x3bd7a4){if(_0x3bd7a4){if(!fs[_0x2c2a('0x58')](path[_0x2c2a('0x59')](config[_0x2c2a('0x5a')],_0x2c2a('0x5b'),_0x3bd7a4[_0x2c2a('0x56')]))){throw new db[(_0x2c2a('0x5c'))][(_0x2c2a('0x5d'))](_0x2c2a('0x5e'));}if(_0x2a70d0[_0x2c2a('0x32')][_0x2c2a('0x5f')]){return _0x558f3f[_0x2c2a('0x16')](0xc8);}return _0x558f3f['download'](path[_0x2c2a('0x59')](config['root'],_0x2c2a('0x5b'),_0x3bd7a4[_0x2c2a('0x56')]),util['format']('%s.%s',_0x3bd7a4[_0x2c2a('0x55')]||_0x3bd7a4[_0x2c2a('0x2b')],_0x3bd7a4['output'][_0x2c2a('0x60')]()));}})[_0x2c2a('0x45')](handleError(_0x558f3f,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index aa5b82e..2a80ef4 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 _0x95d0=['define','AnalyticExtractedReport','analytics_extracted_reports','lodash','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x16d4a3,_0x10f630){var _0x3f3c04=function(_0x32be71){while(--_0x32be71){_0x16d4a3['push'](_0x16d4a3['shift']());}};_0x3f3c04(++_0x10f630);}(_0x95d0,0xad));var _0x095d=function(_0x182224,_0x2542c6){_0x182224=_0x182224-0x0;var _0x409b05=_0x95d0[_0x182224];return _0x409b05;};'use strict';var _=require(_0x095d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x095d('0x1'));var rp=require(_0x095d('0x2'));var fs=require('fs');var path=require(_0x095d('0x3'));var rimraf=require(_0x095d('0x4'));var config=require(_0x095d('0x5'));var attributes=require(_0x095d('0x6'));module['exports']=function(_0x4ac31b,_0xa366){return _0x4ac31b[_0x095d('0x7')](_0x095d('0x8'),attributes,{'tableName':_0x095d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x175a=['moment','bluebird','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','lodash'];(function(_0x37dfc3,_0x44f556){var _0x45281d=function(_0x12d603){while(--_0x12d603){_0x37dfc3['push'](_0x37dfc3['shift']());}};_0x45281d(++_0x44f556);}(_0x175a,0xef));var _0xa175=function(_0x45927b,_0xd1f41b){_0x45927b=_0x45927b-0x0;var _0x440315=_0x175a[_0x45927b];return _0x440315;};'use strict';var _=require(_0xa175('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa175('0x1'));var BPromise=require(_0xa175('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa175('0x3'));var rimraf=require(_0xa175('0x4'));var config=require(_0xa175('0x5'));var attributes=require(_0xa175('0x6'));module['exports']=function(_0x1b9c61,_0x5697fe){return _0x1b9c61[_0xa175('0x7')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 2d03e53..bc185d0 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 _0x2572=['AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then'];(function(_0x3060e3,_0x14f2c6){var _0x497d2c=function(_0x2a274a){while(--_0x2a274a){_0x3060e3['push'](_0x3060e3['shift']());}};_0x497d2c(++_0x14f2c6);}(_0x2572,0x110));var _0x2257=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x2572[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x2257('0x0'));var util=require(_0x2257('0x1'));var moment=require(_0x2257('0x2'));var BPromise=require(_0x2257('0x3'));var rs=require(_0x2257('0x4'));var fs=require('fs');var Redis=require(_0x2257('0x5'));var db=require(_0x2257('0x6'))['db'];var utils=require(_0x2257('0x7'));var logger=require(_0x2257('0x8'))('rpc');var config=require(_0x2257('0x9'));var jayson=require(_0x2257('0xa'));var client=jayson[_0x2257('0xb')][_0x2257('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x26b2c6,_0x339619,_0x74aec6){return new BPromise(function(_0x380460,_0xee7249){return client['request'](_0x26b2c6,_0x74aec6)[_0x2257('0xd')](function(_0x3e088a){logger['info'](_0x2257('0xe'),_0x339619,_0x2257('0xf'));logger[_0x2257('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x339619,_0x2257('0xf'),JSON[_0x2257('0x11')](_0x3e088a));if(_0x3e088a[_0x2257('0x12')]){if(_0x3e088a[_0x2257('0x12')]['code']===0x1f4){logger[_0x2257('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x339619,_0x3e088a['error'][_0x2257('0x13')]);return _0xee7249(_0x3e088a[_0x2257('0x12')][_0x2257('0x13')]);}logger[_0x2257('0x12')](_0x2257('0xe'),_0x339619,_0x3e088a[_0x2257('0x12')][_0x2257('0x13')]);return _0x380460(_0x3e088a['error']['message']);}else{logger[_0x2257('0x14')](_0x2257('0xe'),_0x339619,_0x2257('0xf'));_0x380460(_0x3e088a[_0x2257('0x15')]['message']);}})['catch'](function(_0x330216){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x339619,_0x330216);_0xee7249(_0x330216);});});}
\ No newline at end of file
+var _0x851f=['info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','then'];(function(_0x3bbb75,_0x5c9781){var _0x903cb=function(_0x35616c){while(--_0x35616c){_0x3bbb75['push'](_0x3bbb75['shift']());}};_0x903cb(++_0x5c9781);}(_0x851f,0x185));var _0xf851=function(_0x3c5aa6,_0x4c4f86){_0x3c5aa6=_0x3c5aa6-0x0;var _0x49e397=_0x851f[_0x3c5aa6];return _0x49e397;};'use strict';var _=require(_0xf851('0x0'));var util=require(_0xf851('0x1'));var moment=require(_0xf851('0x2'));var BPromise=require('bluebird');var rs=require(_0xf851('0x3'));var fs=require('fs');var Redis=require(_0xf851('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf851('0x5'));var logger=require(_0xf851('0x6'))('rpc');var config=require(_0xf851('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf851('0x8')][_0xf851('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17e8fc,_0x176f70,_0x328346){return new BPromise(function(_0x3c4e2b,_0x1cba38){return client['request'](_0x17e8fc,_0x328346)[_0xf851('0xa')](function(_0x480ee1){logger[_0xf851('0xb')](_0xf851('0xc'),_0x176f70,_0xf851('0xd'));logger[_0xf851('0xe')](_0xf851('0xf'),_0x176f70,'request\x20sent',JSON[_0xf851('0x10')](_0x480ee1));if(_0x480ee1[_0xf851('0x11')]){if(_0x480ee1[_0xf851('0x11')]['code']===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x176f70,_0x480ee1[_0xf851('0x11')][_0xf851('0x12')]);return _0x1cba38(_0x480ee1[_0xf851('0x11')][_0xf851('0x12')]);}logger[_0xf851('0x11')](_0xf851('0xc'),_0x176f70,_0x480ee1[_0xf851('0x11')][_0xf851('0x12')]);return _0x3c4e2b(_0x480ee1[_0xf851('0x11')]['message']);}else{logger['info'](_0xf851('0xc'),_0x176f70,'request\x20sent');_0x3c4e2b(_0x480ee1['result'][_0xf851('0x12')]);}})[_0xf851('0x13')](function(_0x34feed){logger[_0xf851('0x11')](_0xf851('0xc'),_0x176f70,_0x34feed);_0x1cba38(_0x34feed);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 069f2f9..c9647de 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 _0xeb1d=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xeb1d,0x78));var _0xdeb1=function(_0x156a5a,_0x25f590){_0x156a5a=_0x156a5a-0x0;var _0x5a0a16=_0xeb1d[_0x156a5a];return _0x5a0a16;};'use strict';var multer=require(_0xdeb1('0x0'));var util=require(_0xdeb1('0x1'));var path=require(_0xdeb1('0x2'));var timeout=require(_0xdeb1('0x3'));var express=require(_0xdeb1('0x4'));var router=express['Router']();var fs_extra=require(_0xdeb1('0x5'));var auth=require(_0xdeb1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdeb1('0x7'));var controller=require(_0xdeb1('0x8'));router['get']('/',auth[_0xdeb1('0x9')](),controller[_0xdeb1('0xa')]);router[_0xdeb1('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xdeb1('0xb')]('/:id/download',auth[_0xdeb1('0x9')](),controller['download']);router[_0xdeb1('0xc')]('/',auth[_0xdeb1('0x9')](),controller[_0xdeb1('0xd')]);router[_0xdeb1('0xe')](_0xdeb1('0xf'),auth[_0xdeb1('0x9')](),controller[_0xdeb1('0x10')]);router[_0xdeb1('0x11')](_0xdeb1('0xf'),auth[_0xdeb1('0x9')](),controller[_0xdeb1('0x12')]);module[_0xdeb1('0x13')]=router;
\ No newline at end of file
+var _0x0565=['index','/:id','show','/:id/download','post','create','put','destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated'];(function(_0x279368,_0x41c002){var _0x40b6d0=function(_0x493776){while(--_0x493776){_0x279368['push'](_0x279368['shift']());}};_0x40b6d0(++_0x41c002);}(_0x0565,0x13a));var _0x5056=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x0565[_0x725b8e];return _0x43ac45;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5056('0x0'));var timeout=require(_0x5056('0x1'));var express=require(_0x5056('0x2'));var router=express[_0x5056('0x3')]();var fs_extra=require(_0x5056('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5056('0x5'));var config=require(_0x5056('0x6'));var controller=require(_0x5056('0x7'));router[_0x5056('0x8')]('/',auth[_0x5056('0x9')](),controller[_0x5056('0xa')]);router[_0x5056('0x8')](_0x5056('0xb'),auth[_0x5056('0x9')](),controller[_0x5056('0xc')]);router[_0x5056('0x8')](_0x5056('0xd'),auth[_0x5056('0x9')](),controller['download']);router[_0x5056('0xe')]('/',auth['isAuthenticated'](),controller[_0x5056('0xf')]);router[_0x5056('0x10')]('/:id',auth[_0x5056('0x9')](),controller['update']);router['delete'](_0x5056('0xb'),auth[_0x5056('0x9')](),controller[_0x5056('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index c6c9c64..33f0043 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 _0xdf7d=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf7d,0x15f));var _0xddf7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdf7d[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xddf7('0x0'));module[_0xddf7('0x1')]={'field':{'type':Sequelize[_0xddf7('0x2')]},'alias':{'type':Sequelize[_0xddf7('0x3')]},'function':{'type':Sequelize[_0xddf7('0x3')]},'format':{'type':Sequelize[_0xddf7('0x3')]},'groupBy':{'type':Sequelize[_0xddf7('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xddf7('0x3')]},'custom':{'type':Sequelize[_0xddf7('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xdfba=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdfba,0x1ab));var _0xadfb=function(_0x2c77b1,_0xd77fc4){_0x2c77b1=_0x2c77b1-0x0;var _0x16427b=_0xdfba[_0x2c77b1];return _0x16427b;};'use strict';var Sequelize=require(_0xadfb('0x0'));module[_0xadfb('0x1')]={'field':{'type':Sequelize[_0xadfb('0x2')]},'alias':{'type':Sequelize[_0xadfb('0x3')]},'function':{'type':Sequelize[_0xadfb('0x3')]},'format':{'type':Sequelize[_0xadfb('0x3')]},'groupBy':{'type':Sequelize[_0xadfb('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xadfb('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index bef23cc..637c352 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 _0xcf76=['send','index','map','AnalyticFieldReport','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','params','length','catch','create','body','bulkCreate','update','find','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','then','destroy','error','name'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xcf76,0x15b));var _0x6cf7=function(_0x102299,_0x35ef65){_0x102299=_0x102299-0x0;var _0x5ea176=_0xcf76[_0x102299];return _0x5ea176;};'use strict';var emlformat=require(_0x6cf7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6cf7('0x1'));var jsonpatch=require(_0x6cf7('0x2'));var rp=require(_0x6cf7('0x3'));var moment=require(_0x6cf7('0x4'));var BPromise=require(_0x6cf7('0x5'));var Mustache=require('mustache');var util=require(_0x6cf7('0x6'));var path=require('path');var sox=require(_0x6cf7('0x7'));var csv=require(_0x6cf7('0x8'));var ejs=require(_0x6cf7('0x9'));var fs=require('fs');var fs_extra=require(_0x6cf7('0xa'));var _=require(_0x6cf7('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6cf7('0xc'));var deskjs=require(_0x6cf7('0xd'));var toCsv=require(_0x6cf7('0x8'));var querystring=require(_0x6cf7('0xe'));var Papa=require(_0x6cf7('0xf'));var Redis=require(_0x6cf7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6cf7('0x11'));var as=require(_0x6cf7('0x12'));var hardwareService=require(_0x6cf7('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x6cf7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6cf7('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f8798,_0x32be41){_0x32be41=_0x32be41||0xcc;return function(_0x396652){if(_0x396652){return _0x1f8798[_0x6cf7('0x16')](_0x32be41);}return _0x1f8798[_0x6cf7('0x17')](_0x32be41)[_0x6cf7('0x18')]();};}function respondWithResult(_0x1a4de3,_0xda253c){_0xda253c=_0xda253c||0xc8;return function(_0x139a03){if(_0x139a03){return _0x1a4de3[_0x6cf7('0x17')](_0xda253c)['json'](_0x139a03);}};}function respondWithFilteredResult(_0x3409d5,_0x953c48){return function(_0x447373){if(_0x447373){var _0x408b9d=typeof _0x953c48['offset']===_0x6cf7('0x19')&&typeof _0x953c48[_0x6cf7('0x1a')]===_0x6cf7('0x19');var _0xf2eec4=_0x447373[_0x6cf7('0x1b')];var _0x3c04a6=_0x408b9d?0x0:_0x953c48['offset'];var _0x4a1305=_0x408b9d?_0x447373[_0x6cf7('0x1b')]:_0x953c48[_0x6cf7('0x1c')]+_0x953c48[_0x6cf7('0x1a')];var _0x26a751;if(_0x4a1305>=_0xf2eec4){_0x4a1305=_0xf2eec4;_0x26a751=0xc8;}else{_0x26a751=0xce;}_0x3409d5[_0x6cf7('0x17')](_0x26a751);return _0x3409d5[_0x6cf7('0x1d')](_0x6cf7('0x1e'),_0x3c04a6+'-'+_0x4a1305+'/'+_0xf2eec4)[_0x6cf7('0x1f')](_0x447373);}return null;};}function patchUpdates(_0x5173e1){return function(_0x1c76f3){try{jsonpatch[_0x6cf7('0x20')](_0x1c76f3,_0x5173e1,!![]);}catch(_0x2c49f1){return BPromise[_0x6cf7('0x21')](_0x2c49f1);}return _0x1c76f3['save']();};}function saveUpdates(_0x4a2039,_0x1eb0ed){return function(_0x16e0ef){if(_0x16e0ef){return _0x16e0ef['update'](_0x4a2039)[_0x6cf7('0x22')](function(_0x2f4fad){return _0x2f4fad;});}return null;};}function removeEntity(_0x2ff9e9,_0x1bf2fc){return function(_0x4a2020){if(_0x4a2020){return _0x4a2020[_0x6cf7('0x23')]()[_0x6cf7('0x22')](function(){_0x2ff9e9[_0x6cf7('0x17')](0xcc)[_0x6cf7('0x18')]();});}};}function handleEntityNotFound(_0x748172,_0x58d6cc){return function(_0x3b8240){if(!_0x3b8240){_0x748172[_0x6cf7('0x16')](0x194);}return _0x3b8240;};}function handleError(_0x5d2c23,_0x439eed){_0x439eed=_0x439eed||0x1f4;return function(_0x411780){logger[_0x6cf7('0x24')](_0x411780['stack']);if(_0x411780[_0x6cf7('0x25')]){delete _0x411780[_0x6cf7('0x25')];}_0x5d2c23[_0x6cf7('0x17')](_0x439eed)[_0x6cf7('0x26')](_0x411780);};}exports[_0x6cf7('0x27')]=function(_0x5d8292,_0x152b10){var _0x1ce5cb={},_0x7e2086={},_0x2b7f66={'count':0x0,'rows':[]};var _0x39f454=_[_0x6cf7('0x28')](db[_0x6cf7('0x29')][_0x6cf7('0x2a')],function(_0x17da27){return{'name':_0x17da27[_0x6cf7('0x2b')],'type':_0x17da27['type']['key']};});_0x7e2086[_0x6cf7('0x2c')]=_[_0x6cf7('0x28')](_0x39f454,_0x6cf7('0x25'));_0x7e2086[_0x6cf7('0x2d')]=_[_0x6cf7('0x2e')](_0x5d8292[_0x6cf7('0x2d')]);_0x7e2086[_0x6cf7('0x2f')]=_[_0x6cf7('0x30')](_0x7e2086[_0x6cf7('0x2c')],_0x7e2086[_0x6cf7('0x2d')]);_0x1ce5cb['attributes']=_[_0x6cf7('0x30')](_0x7e2086[_0x6cf7('0x2c')],qs[_0x6cf7('0x31')](_0x5d8292[_0x6cf7('0x2d')][_0x6cf7('0x31')]));_0x1ce5cb[_0x6cf7('0x32')]=_0x1ce5cb[_0x6cf7('0x32')]['length']?_0x1ce5cb[_0x6cf7('0x32')]:_0x7e2086['model'];if(!_0x5d8292['query'][_0x6cf7('0x33')](_0x6cf7('0x34'))){_0x1ce5cb['limit']=qs[_0x6cf7('0x1a')](_0x5d8292[_0x6cf7('0x2d')][_0x6cf7('0x1a')]);_0x1ce5cb[_0x6cf7('0x1c')]=qs[_0x6cf7('0x1c')](_0x5d8292[_0x6cf7('0x2d')][_0x6cf7('0x1c')]);}_0x1ce5cb['order']=qs[_0x6cf7('0x35')](_0x5d8292[_0x6cf7('0x2d')][_0x6cf7('0x35')]);_0x1ce5cb[_0x6cf7('0x36')]=qs[_0x6cf7('0x2f')](_['pick'](_0x5d8292[_0x6cf7('0x2d')],_0x7e2086['filters']),_0x39f454);if(_0x5d8292[_0x6cf7('0x2d')]['filter']){_0x1ce5cb['where']=_[_0x6cf7('0x37')](_0x1ce5cb[_0x6cf7('0x36')],{'$or':_[_0x6cf7('0x28')](_0x39f454,function(_0x3ce7d1){if(_0x3ce7d1[_0x6cf7('0x38')]!==_0x6cf7('0x39')){var _0x1df349={};_0x1df349[_0x3ce7d1[_0x6cf7('0x25')]]={'$like':'%'+_0x5d8292['query'][_0x6cf7('0x3a')]+'%'};return _0x1df349;}})});}_0x1ce5cb=_[_0x6cf7('0x37')]({},_0x1ce5cb,_0x5d8292[_0x6cf7('0x3b')]);var _0x3e9663={'where':_0x1ce5cb[_0x6cf7('0x36')]};return db['AnalyticFieldReport'][_0x6cf7('0x1b')](_0x3e9663)[_0x6cf7('0x22')](function(_0x474d95){_0x2b7f66[_0x6cf7('0x1b')]=_0x474d95;if(_0x5d8292[_0x6cf7('0x2d')][_0x6cf7('0x3c')]){_0x1ce5cb[_0x6cf7('0x3d')]=[{'all':!![]}];}return db[_0x6cf7('0x29')][_0x6cf7('0x3e')](_0x1ce5cb);})[_0x6cf7('0x22')](function(_0x208fb1){_0x2b7f66['rows']=_0x208fb1;return _0x2b7f66;})[_0x6cf7('0x22')](respondWithFilteredResult(_0x152b10,_0x1ce5cb))['catch'](handleError(_0x152b10,null));};exports['show']=function(_0x26fdf0,_0x5d5f28){var _0x3d9aae={'raw':![],'where':{'id':_0x26fdf0[_0x6cf7('0x3f')]['id']}},_0x227232={};_0x227232['model']=_['keys'](db['AnalyticFieldReport'][_0x6cf7('0x2a')]);_0x227232[_0x6cf7('0x2d')]=_[_0x6cf7('0x2e')](_0x26fdf0['query']);_0x227232[_0x6cf7('0x2f')]=_[_0x6cf7('0x30')](_0x227232['model'],_0x227232['query']);_0x3d9aae['attributes']=_[_0x6cf7('0x30')](_0x227232['model'],qs[_0x6cf7('0x31')](_0x26fdf0['query']['fields']));_0x3d9aae[_0x6cf7('0x32')]=_0x3d9aae[_0x6cf7('0x32')][_0x6cf7('0x40')]?_0x3d9aae[_0x6cf7('0x32')]:_0x227232['model'];if(_0x26fdf0[_0x6cf7('0x2d')]['includeAll']){_0x3d9aae[_0x6cf7('0x3d')]=[{'all':!![]}];}_0x3d9aae=_[_0x6cf7('0x37')]({},_0x3d9aae,_0x26fdf0['options']);return db[_0x6cf7('0x29')]['find'](_0x3d9aae)[_0x6cf7('0x22')](handleEntityNotFound(_0x5d5f28,null))[_0x6cf7('0x22')](respondWithResult(_0x5d5f28,null))[_0x6cf7('0x41')](handleError(_0x5d5f28,null));};exports[_0x6cf7('0x42')]=function(_0x15881b,_0x458a64){return db[_0x6cf7('0x29')][_0x6cf7('0x42')](_0x15881b[_0x6cf7('0x43')],{})[_0x6cf7('0x22')](respondWithResult(_0x458a64,0xc9))[_0x6cf7('0x41')](handleError(_0x458a64,null));};exports[_0x6cf7('0x44')]=function(_0xa8620f,_0x2bb62d){return db[_0x6cf7('0x29')][_0x6cf7('0x44')](_0xa8620f[_0x6cf7('0x43')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2bb62d,0xc9))[_0x6cf7('0x41')](handleError(_0x2bb62d,null));};exports[_0x6cf7('0x45')]=function(_0x17597,_0x2d7c16){if(_0x17597[_0x6cf7('0x43')]['id']){delete _0x17597[_0x6cf7('0x43')]['id'];}return db[_0x6cf7('0x29')][_0x6cf7('0x46')]({'where':{'id':_0x17597['params']['id']}})[_0x6cf7('0x22')](handleEntityNotFound(_0x2d7c16,null))[_0x6cf7('0x22')](saveUpdates(_0x17597[_0x6cf7('0x43')],null))[_0x6cf7('0x22')](respondWithResult(_0x2d7c16,null))[_0x6cf7('0x41')](handleError(_0x2d7c16,null));};exports['destroy']=function(_0x3d12bf,_0x5e6be0){return db[_0x6cf7('0x29')][_0x6cf7('0x46')]({'where':{'id':_0x3d12bf[_0x6cf7('0x3f')]['id']}})[_0x6cf7('0x22')](handleEntityNotFound(_0x5e6be0,null))[_0x6cf7('0x22')](removeEntity(_0x5e6be0,null))[_0x6cf7('0x41')](handleError(_0x5e6be0,null));};exports[_0x6cf7('0x47')]=function(_0x4d5a8a,_0x3c37f7){return db[_0x6cf7('0x29')][_0x6cf7('0x23')]({'where':{'id':_0x4d5a8a[_0x6cf7('0x2d')][_0x6cf7('0x48')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3c37f7,0xcc))[_0x6cf7('0x41')](handleError(_0x3c37f7,null));};exports['addFields']=function(_0xfcf6ee,_0x3dd04f,_0x43bfd8){return db[_0x6cf7('0x49')][_0x6cf7('0x4a')]({'where':{'id':_0xfcf6ee[_0x6cf7('0x3f')]['id']}})[_0x6cf7('0x22')](handleEntityNotFound(_0x3dd04f,null))[_0x6cf7('0x22')](function(_0x5a3254){if(_0x5a3254){return db[_0x6cf7('0x4b')][_0x6cf7('0x4c')](function(_0x39c822){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0xfcf6ee[_0x6cf7('0x3f')]['id']},'transaction':_0x39c822})[_0x6cf7('0x22')](function(_0x32268c){var _0x13f9e6=_[_0x6cf7('0x28')](_0xfcf6ee[_0x6cf7('0x43')],function(_0x596b0f){delete _0x596b0f['id'];_0x596b0f['CustomReportId']=_0xfcf6ee[_0x6cf7('0x3f')]['id'];return _0x596b0f;});return db['AnalyticFieldReport'][_0x6cf7('0x44')](_0x13f9e6,{'transaction':_0x39c822});});})[_0x6cf7('0x22')](function(){return db[_0x6cf7('0x29')][_0x6cf7('0x3e')]({'where':{'CustomReportId':_0xfcf6ee[_0x6cf7('0x3f')]['id']}});});}})['then'](respondWithResult(_0x3dd04f,null))[_0x6cf7('0x41')](handleError(_0x3dd04f,null));};
\ No newline at end of file
+var _0x64f4=['ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','undefined','limit','count','offset','status','Content-Range','apply','reject','save','update','then','destroy','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','findAll','catch','show','params','includeAll','options','find','create','body','bulkCreate','bulkDestroy','ids','addFields','sequelize','transaction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv'];(function(_0x37fe54,_0x19bc2d){var _0x140281=function(_0x5718dd){while(--_0x5718dd){_0x37fe54['push'](_0x37fe54['shift']());}};_0x140281(++_0x19bc2d);}(_0x64f4,0x180));var _0x464f=function(_0xa1f909,_0x19a33a){_0xa1f909=_0xa1f909-0x0;var _0x4b45de=_0x64f4[_0xa1f909];return _0x4b45de;};'use strict';var emlformat=require(_0x464f('0x0'));var rimraf=require(_0x464f('0x1'));var zipdir=require(_0x464f('0x2'));var jsonpatch=require(_0x464f('0x3'));var rp=require(_0x464f('0x4'));var moment=require(_0x464f('0x5'));var BPromise=require(_0x464f('0x6'));var Mustache=require('mustache');var util=require(_0x464f('0x7'));var path=require(_0x464f('0x8'));var sox=require(_0x464f('0x9'));var csv=require(_0x464f('0xa'));var ejs=require(_0x464f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x464f('0xc'));var crypto=require(_0x464f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x464f('0xe'));var toCsv=require(_0x464f('0xa'));var querystring=require('querystring');var Papa=require(_0x464f('0xf'));var Redis=require(_0x464f('0x10'));var authService=require(_0x464f('0x11'));var qs=require(_0x464f('0x12'));var as=require(_0x464f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x464f('0x14'))(_0x464f('0x15'));var utils=require(_0x464f('0x16'));var config=require(_0x464f('0x17'));var licenseUtil=require(_0x464f('0x18'));var db=require(_0x464f('0x19'))['db'];function respondWithStatusCode(_0x365713,_0x572175){_0x572175=_0x572175||0xcc;return function(_0x44969f){if(_0x44969f){return _0x365713['sendStatus'](_0x572175);}return _0x365713['status'](_0x572175)[_0x464f('0x1a')]();};}function respondWithResult(_0xc03de6,_0x3adfd2){_0x3adfd2=_0x3adfd2||0xc8;return function(_0x47b322){if(_0x47b322){return _0xc03de6['status'](_0x3adfd2)['json'](_0x47b322);}};}function respondWithFilteredResult(_0x33ffb1,_0x58589a){return function(_0x13a4f0){if(_0x13a4f0){var _0x4f834e=typeof _0x58589a['offset']===_0x464f('0x1b')&&typeof _0x58589a[_0x464f('0x1c')]===_0x464f('0x1b');var _0x1e9736=_0x13a4f0[_0x464f('0x1d')];var _0x48958d=_0x4f834e?0x0:_0x58589a[_0x464f('0x1e')];var _0x2b6db6=_0x4f834e?_0x13a4f0[_0x464f('0x1d')]:_0x58589a[_0x464f('0x1e')]+_0x58589a[_0x464f('0x1c')];var _0x3eebc2;if(_0x2b6db6>=_0x1e9736){_0x2b6db6=_0x1e9736;_0x3eebc2=0xc8;}else{_0x3eebc2=0xce;}_0x33ffb1[_0x464f('0x1f')](_0x3eebc2);return _0x33ffb1['set'](_0x464f('0x20'),_0x48958d+'-'+_0x2b6db6+'/'+_0x1e9736)['json'](_0x13a4f0);}return null;};}function patchUpdates(_0x4d35c3){return function(_0x36a027){try{jsonpatch[_0x464f('0x21')](_0x36a027,_0x4d35c3,!![]);}catch(_0x14ff7a){return BPromise[_0x464f('0x22')](_0x14ff7a);}return _0x36a027[_0x464f('0x23')]();};}function saveUpdates(_0x2e7c5d,_0x813d4a){return function(_0x22231d){if(_0x22231d){return _0x22231d[_0x464f('0x24')](_0x2e7c5d)[_0x464f('0x25')](function(_0x4d40d4){return _0x4d40d4;});}return null;};}function removeEntity(_0xcaf6ac,_0x338534){return function(_0x26d1d5){if(_0x26d1d5){return _0x26d1d5[_0x464f('0x26')]()[_0x464f('0x25')](function(){_0xcaf6ac[_0x464f('0x1f')](0xcc)[_0x464f('0x1a')]();});}};}function handleEntityNotFound(_0x5e52ed,_0x389a59){return function(_0x280a54){if(!_0x280a54){_0x5e52ed['sendStatus'](0x194);}return _0x280a54;};}function handleError(_0x23fc1b,_0x3d4923){_0x3d4923=_0x3d4923||0x1f4;return function(_0x3152f6){logger['error'](_0x3152f6['stack']);if(_0x3152f6[_0x464f('0x27')]){delete _0x3152f6['name'];}_0x23fc1b[_0x464f('0x1f')](_0x3d4923)['send'](_0x3152f6);};}exports[_0x464f('0x28')]=function(_0x4184a1,_0x294e1e){var _0x3503f5={},_0x55819a={},_0xf45fe9={'count':0x0,'rows':[]};var _0x5910cd=_[_0x464f('0x29')](db[_0x464f('0x2a')][_0x464f('0x2b')],function(_0x5164bb){return{'name':_0x5164bb[_0x464f('0x2c')],'type':_0x5164bb[_0x464f('0x2d')][_0x464f('0x2e')]};});_0x55819a[_0x464f('0x2f')]=_[_0x464f('0x29')](_0x5910cd,_0x464f('0x27'));_0x55819a[_0x464f('0x30')]=_[_0x464f('0x31')](_0x4184a1[_0x464f('0x30')]);_0x55819a[_0x464f('0x32')]=_[_0x464f('0x33')](_0x55819a[_0x464f('0x2f')],_0x55819a[_0x464f('0x30')]);_0x3503f5[_0x464f('0x34')]=_[_0x464f('0x33')](_0x55819a[_0x464f('0x2f')],qs['fields'](_0x4184a1[_0x464f('0x30')][_0x464f('0x35')]));_0x3503f5[_0x464f('0x34')]=_0x3503f5['attributes'][_0x464f('0x36')]?_0x3503f5['attributes']:_0x55819a[_0x464f('0x2f')];if(!_0x4184a1['query'][_0x464f('0x37')](_0x464f('0x38'))){_0x3503f5[_0x464f('0x1c')]=qs[_0x464f('0x1c')](_0x4184a1[_0x464f('0x30')]['limit']);_0x3503f5[_0x464f('0x1e')]=qs[_0x464f('0x1e')](_0x4184a1[_0x464f('0x30')][_0x464f('0x1e')]);}_0x3503f5[_0x464f('0x39')]=qs['sort'](_0x4184a1[_0x464f('0x30')][_0x464f('0x3a')]);_0x3503f5[_0x464f('0x3b')]=qs[_0x464f('0x32')](_['pick'](_0x4184a1[_0x464f('0x30')],_0x55819a[_0x464f('0x32')]),_0x5910cd);if(_0x4184a1[_0x464f('0x30')][_0x464f('0x3c')]){_0x3503f5[_0x464f('0x3b')]=_[_0x464f('0x3d')](_0x3503f5[_0x464f('0x3b')],{'$or':_[_0x464f('0x29')](_0x5910cd,function(_0x37e3b4){if(_0x37e3b4[_0x464f('0x2d')]!==_0x464f('0x3e')){var _0x254f78={};_0x254f78[_0x37e3b4[_0x464f('0x27')]]={'$like':'%'+_0x4184a1[_0x464f('0x30')][_0x464f('0x3c')]+'%'};return _0x254f78;}})});}_0x3503f5=_[_0x464f('0x3d')]({},_0x3503f5,_0x4184a1['options']);var _0xf17c87={'where':_0x3503f5[_0x464f('0x3b')]};return db[_0x464f('0x2a')]['count'](_0xf17c87)[_0x464f('0x25')](function(_0x200d1a){_0xf45fe9[_0x464f('0x1d')]=_0x200d1a;if(_0x4184a1[_0x464f('0x30')]['includeAll']){_0x3503f5[_0x464f('0x3f')]=[{'all':!![]}];}return db[_0x464f('0x2a')][_0x464f('0x40')](_0x3503f5);})[_0x464f('0x25')](function(_0x139fe1){_0xf45fe9['rows']=_0x139fe1;return _0xf45fe9;})[_0x464f('0x25')](respondWithFilteredResult(_0x294e1e,_0x3503f5))[_0x464f('0x41')](handleError(_0x294e1e,null));};exports[_0x464f('0x42')]=function(_0x1e7eac,_0x5d3423){var _0x201412={'raw':![],'where':{'id':_0x1e7eac[_0x464f('0x43')]['id']}},_0x528880={};_0x528880['model']=_[_0x464f('0x31')](db[_0x464f('0x2a')]['rawAttributes']);_0x528880[_0x464f('0x30')]=_[_0x464f('0x31')](_0x1e7eac[_0x464f('0x30')]);_0x528880['filters']=_['intersection'](_0x528880['model'],_0x528880[_0x464f('0x30')]);_0x201412['attributes']=_[_0x464f('0x33')](_0x528880['model'],qs[_0x464f('0x35')](_0x1e7eac['query'][_0x464f('0x35')]));_0x201412['attributes']=_0x201412[_0x464f('0x34')][_0x464f('0x36')]?_0x201412['attributes']:_0x528880[_0x464f('0x2f')];if(_0x1e7eac[_0x464f('0x30')][_0x464f('0x44')]){_0x201412[_0x464f('0x3f')]=[{'all':!![]}];}_0x201412=_[_0x464f('0x3d')]({},_0x201412,_0x1e7eac[_0x464f('0x45')]);return db[_0x464f('0x2a')][_0x464f('0x46')](_0x201412)[_0x464f('0x25')](handleEntityNotFound(_0x5d3423,null))[_0x464f('0x25')](respondWithResult(_0x5d3423,null))['catch'](handleError(_0x5d3423,null));};exports[_0x464f('0x47')]=function(_0x1180aa,_0x3a200a){return db['AnalyticFieldReport']['create'](_0x1180aa[_0x464f('0x48')],{})[_0x464f('0x25')](respondWithResult(_0x3a200a,0xc9))[_0x464f('0x41')](handleError(_0x3a200a,null));};exports['bulkCreate']=function(_0x53d648,_0x2b4502){return db[_0x464f('0x2a')][_0x464f('0x49')](_0x53d648['body'],{'raw':![],'individualHooks':!![]})[_0x464f('0x25')](respondWithResult(_0x2b4502,0xc9))[_0x464f('0x41')](handleError(_0x2b4502,null));};exports[_0x464f('0x24')]=function(_0x6c8fb8,_0x309c08){if(_0x6c8fb8[_0x464f('0x48')]['id']){delete _0x6c8fb8['body']['id'];}return db[_0x464f('0x2a')][_0x464f('0x46')]({'where':{'id':_0x6c8fb8[_0x464f('0x43')]['id']}})[_0x464f('0x25')](handleEntityNotFound(_0x309c08,null))[_0x464f('0x25')](saveUpdates(_0x6c8fb8[_0x464f('0x48')],null))[_0x464f('0x25')](respondWithResult(_0x309c08,null))[_0x464f('0x41')](handleError(_0x309c08,null));};exports[_0x464f('0x26')]=function(_0x39d1d2,_0x4fc5e3){return db[_0x464f('0x2a')][_0x464f('0x46')]({'where':{'id':_0x39d1d2[_0x464f('0x43')]['id']}})[_0x464f('0x25')](handleEntityNotFound(_0x4fc5e3,null))[_0x464f('0x25')](removeEntity(_0x4fc5e3,null))['catch'](handleError(_0x4fc5e3,null));};exports[_0x464f('0x4a')]=function(_0x1b2474,_0x4039a8){return db[_0x464f('0x2a')]['destroy']({'where':{'id':_0x1b2474[_0x464f('0x30')][_0x464f('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x464f('0x25')](respondWithResult(_0x4039a8,0xcc))[_0x464f('0x41')](handleError(_0x4039a8,null));};exports[_0x464f('0x4c')]=function(_0x43ccd9,_0x4eccf0,_0x5cd605){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x43ccd9[_0x464f('0x43')]['id']}})[_0x464f('0x25')](handleEntityNotFound(_0x4eccf0,null))[_0x464f('0x25')](function(_0x1353ab){if(_0x1353ab){return db[_0x464f('0x4d')][_0x464f('0x4e')](function(_0x5cebf6){return db[_0x464f('0x2a')]['destroy']({'where':{'CustomReportId':_0x43ccd9['params']['id']},'transaction':_0x5cebf6})[_0x464f('0x25')](function(_0x39d5d0){var _0x423184=_[_0x464f('0x29')](_0x43ccd9[_0x464f('0x48')],function(_0x2349af){delete _0x2349af['id'];_0x2349af['CustomReportId']=_0x43ccd9[_0x464f('0x43')]['id'];return _0x2349af;});return db[_0x464f('0x2a')][_0x464f('0x49')](_0x423184,{'transaction':_0x5cebf6});});})[_0x464f('0x25')](function(){return db['AnalyticFieldReport'][_0x464f('0x40')]({'where':{'CustomReportId':_0x43ccd9[_0x464f('0x43')]['id']}});});}})['then'](respondWithResult(_0x4eccf0,null))[_0x464f('0x41')](handleError(_0x4eccf0,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index ce0dcef..696d2c2 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 _0xfd07=['analytics_report_fields','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','define'];(function(_0x84653a,_0x3710e6){var _0x17662f=function(_0x640b1f){while(--_0x640b1f){_0x84653a['push'](_0x84653a['shift']());}};_0x17662f(++_0x3710e6);}(_0xfd07,0x151));var _0x7fd0=function(_0x12877b,_0x8650cf){_0x12877b=_0x12877b-0x0;var _0x3549ff=_0xfd07[_0x12877b];return _0x3549ff;};'use strict';var _=require(_0x7fd0('0x0'));var util=require(_0x7fd0('0x1'));var logger=require(_0x7fd0('0x2'))('api');var moment=require(_0x7fd0('0x3'));var BPromise=require(_0x7fd0('0x4'));var rp=require(_0x7fd0('0x5'));var fs=require('fs');var path=require(_0x7fd0('0x6'));var rimraf=require(_0x7fd0('0x7'));var config=require(_0x7fd0('0x8'));var attributes=require(_0x7fd0('0x9'));module['exports']=function(_0x39ecc8,_0x30280a){return _0x39ecc8[_0x7fd0('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0x7fd0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0535=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger'];(function(_0x581db0,_0x31d992){var _0x198b98=function(_0x3de413){while(--_0x3de413){_0x581db0['push'](_0x581db0['shift']());}};_0x198b98(++_0x31d992);}(_0x0535,0x166));var _0x5053=function(_0x367d18,_0x490319){_0x367d18=_0x367d18-0x0;var _0x88274=_0x0535[_0x367d18];return _0x88274;};'use strict';var _=require(_0x5053('0x0'));var util=require('util');var logger=require(_0x5053('0x1'))(_0x5053('0x2'));var moment=require(_0x5053('0x3'));var BPromise=require(_0x5053('0x4'));var rp=require(_0x5053('0x5'));var fs=require('fs');var path=require(_0x5053('0x6'));var rimraf=require(_0x5053('0x7'));var config=require(_0x5053('0x8'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x3a5a5b,_0x586df2){return _0x3a5a5b[_0x5053('0x9')](_0x5053('0xa'),attributes,{'tableName':_0x5053('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 58857dc..b8fb3ad 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 _0x2b6f=['../../config/environment','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x49684e,_0x9a24fb){var _0x54062f=function(_0x4e410a){while(--_0x4e410a){_0x49684e['push'](_0x49684e['shift']());}};_0x54062f(++_0x9a24fb);}(_0x2b6f,0x111));var _0xf2b6=function(_0x459423,_0x3416a8){_0x459423=_0x459423-0x0;var _0x42ed14=_0x2b6f[_0x459423];return _0x42ed14;};'use strict';var _=require(_0xf2b6('0x0'));var util=require('util');var moment=require(_0xf2b6('0x1'));var BPromise=require(_0xf2b6('0x2'));var rs=require(_0xf2b6('0x3'));var fs=require('fs');var Redis=require(_0xf2b6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf2b6('0x5'));var logger=require(_0xf2b6('0x6'))('rpc');var config=require(_0xf2b6('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf2b6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3fb41b,_0x242e68,_0x4112bd){return new BPromise(function(_0x24699e,_0x48aee5){return client[_0xf2b6('0x9')](_0x3fb41b,_0x4112bd)[_0xf2b6('0xa')](function(_0x253389){logger[_0xf2b6('0xb')](_0xf2b6('0xc'),_0x242e68,_0xf2b6('0xd'));logger['debug'](_0xf2b6('0xe'),_0x242e68,_0xf2b6('0xd'),JSON[_0xf2b6('0xf')](_0x253389));if(_0x253389[_0xf2b6('0x10')]){if(_0x253389['error'][_0xf2b6('0x11')]===0x1f4){logger['error'](_0xf2b6('0xc'),_0x242e68,_0x253389[_0xf2b6('0x10')][_0xf2b6('0x12')]);return _0x48aee5(_0x253389[_0xf2b6('0x10')][_0xf2b6('0x12')]);}logger['error'](_0xf2b6('0xc'),_0x242e68,_0x253389[_0xf2b6('0x10')][_0xf2b6('0x12')]);return _0x24699e(_0x253389['error'][_0xf2b6('0x12')]);}else{logger[_0xf2b6('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x242e68,_0xf2b6('0xd'));_0x24699e(_0x253389['result'][_0xf2b6('0x12')]);}})[_0xf2b6('0x13')](function(_0x31c145){logger[_0xf2b6('0x10')](_0xf2b6('0xc'),_0x242e68,_0x31c145);_0x48aee5(_0x31c145);});});}
\ No newline at end of file
+var _0xf064=['randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','info','result','catch','lodash','util','moment'];(function(_0x371172,_0x386170){var _0x18eeee=function(_0x4dbf66){while(--_0x4dbf66){_0x371172['push'](_0x371172['shift']());}};_0x18eeee(++_0x386170);}(_0xf064,0xcc));var _0x4f06=function(_0xd9f102,_0x5a0d28){_0xd9f102=_0xd9f102-0x0;var _0x2652e4=_0xf064[_0xd9f102];return _0x2652e4;};'use strict';var _=require(_0x4f06('0x0'));var util=require(_0x4f06('0x1'));var moment=require(_0x4f06('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f06('0x3'));var fs=require('fs');var Redis=require(_0x4f06('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4f06('0x5'))(_0x4f06('0x6'));var config=require('../../config/environment');var jayson=require(_0x4f06('0x7'));var client=jayson[_0x4f06('0x8')][_0x4f06('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14aa1f,_0x393575,_0x53ee9f){return new BPromise(function(_0x191619,_0x7915ac){return client[_0x4f06('0xa')](_0x14aa1f,_0x53ee9f)[_0x4f06('0xb')](function(_0x430cbd){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x393575,'request\x20sent');logger[_0x4f06('0xc')](_0x4f06('0xd'),_0x393575,_0x4f06('0xe'),JSON[_0x4f06('0xf')](_0x430cbd));if(_0x430cbd[_0x4f06('0x10')]){if(_0x430cbd[_0x4f06('0x10')][_0x4f06('0x11')]===0x1f4){logger[_0x4f06('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x393575,_0x430cbd[_0x4f06('0x10')]['message']);return _0x7915ac(_0x430cbd['error'][_0x4f06('0x12')]);}logger[_0x4f06('0x10')](_0x4f06('0x13'),_0x393575,_0x430cbd[_0x4f06('0x10')][_0x4f06('0x12')]);return _0x191619(_0x430cbd['error'][_0x4f06('0x12')]);}else{logger[_0x4f06('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x393575,_0x4f06('0xe'));_0x191619(_0x430cbd[_0x4f06('0x15')][_0x4f06('0x12')]);}})[_0x4f06('0x16')](function(_0x6c5161){logger[_0x4f06('0x10')](_0x4f06('0x13'),_0x393575,_0x6c5161);_0x7915ac(_0x6c5161);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index f5ccc07..c33f20f 100644
--- a/server/api/analyticFieldReport/index.js
+++ b/server/api/analyticFieldReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x39c13a,_0x5f01a5){var _0x481d01=function(_0x327444){while(--_0x327444){_0x39c13a['push'](_0x39c13a['shift']());}};_0x481d01(++_0x5f01a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x308abf,_0x2dce56){var _0x24a5b4=function(_0x162d5a){while(--_0x162d5a){_0x308abf['push'](_0x308abf['shift']());}};_0x24a5b4(++_0x2dce56);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index 9d97898..94eba2a 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 _0x7b37=['STRING','sequelize','exports','name'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x7b37,0xd9));var _0x77b3=function(_0x4452f1,_0x5ad396){_0x4452f1=_0x4452f1-0x0;var _0x6cedd0=_0x7b37[_0x4452f1];return _0x6cedd0;};'use strict';var Sequelize=require(_0x77b3('0x0'));module[_0x77b3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x77b3('0x2')},'table':{'type':Sequelize[_0x77b3('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x77b3('0x3')]}};
\ No newline at end of file
+var _0x373d=['name','TEXT','sequelize','STRING'];(function(_0x5cd2ab,_0x2d162b){var _0x4663db=function(_0x54a66d){while(--_0x54a66d){_0x5cd2ab['push'](_0x5cd2ab['shift']());}};_0x4663db(++_0x2d162b);}(_0x373d,0x1e2));var _0xd373=function(_0x4e56a2,_0x5a241c){_0x4e56a2=_0x4e56a2-0x0;var _0x1e819c=_0x373d[_0x4e56a2];return _0x1e819c;};'use strict';var Sequelize=require(_0xd373('0x0'));module['exports']={'name':{'type':Sequelize[_0xd373('0x1')],'allowNull':![],'unique':_0xd373('0x2')},'table':{'type':Sequelize[_0xd373('0x1')]},'metric':{'type':Sequelize[_0xd373('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 79aed05..4883f13 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 _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x38e290,_0x3db827){var _0x1e957c=function(_0x7070b1){while(--_0x7070b1){_0x38e290['push'](_0x38e290['shift']());}};_0x1e957c(++_0x3db827);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x1c3370,_0xf617e8){_0x1c3370=_0x1c3370-0x0;var _0xa9b358=_0xf2ca[_0x1c3370];return _0xa9b358;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));};
\ No newline at end of file
+var _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x4f30bd,_0x2403c0){var _0x3a2b60=function(_0x5202ff){while(--_0x5202ff){_0x4f30bd['push'](_0x4f30bd['shift']());}};_0x3a2b60(++_0x2403c0);}(_0x55ca,0x126));var _0xa55c=function(_0x29c3b2,_0x3c12ac){_0x29c3b2=_0x29c3b2-0x0;var _0x4b3aa7=_0x55ca[_0x29c3b2];return _0x4b3aa7;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 2a34251..7a32b4d 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 _0x96f1=['./analyticMetric.attributes','exports','define','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x36a2d2,_0xe0d35b){var _0x5b0069=function(_0x4f7c23){while(--_0x4f7c23){_0x36a2d2['push'](_0x36a2d2['shift']());}};_0x5b0069(++_0xe0d35b);}(_0x96f1,0x19c));var _0x196f=function(_0x315b12,_0xf7f8c7){_0x315b12=_0x315b12-0x0;var _0x40a925=_0x96f1[_0x315b12];return _0x40a925;};'use strict';var _=require(_0x196f('0x0'));var util=require(_0x196f('0x1'));var logger=require(_0x196f('0x2'))(_0x196f('0x3'));var moment=require(_0x196f('0x4'));var BPromise=require(_0x196f('0x5'));var rp=require(_0x196f('0x6'));var fs=require('fs');var path=require(_0x196f('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x196f('0x8'));module[_0x196f('0x9')]=function(_0x267906,_0x1f401c){return _0x267906[_0x196f('0xa')]('AnalyticMetric',attributes,{'tableName':_0x196f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9432=['exports','AnalyticMetric','analytics_metrics','lodash','util','api','moment','request-promise','../../config/environment','./analyticMetric.attributes'];(function(_0x1c289a,_0x277fe7){var _0x28d68e=function(_0x2f8e98){while(--_0x2f8e98){_0x1c289a['push'](_0x1c289a['shift']());}};_0x28d68e(++_0x277fe7);}(_0x9432,0x1e3));var _0x2943=function(_0x521e56,_0x5c2807){_0x521e56=_0x521e56-0x0;var _0x5267ae=_0x9432[_0x521e56];return _0x5267ae;};'use strict';var _=require(_0x2943('0x0'));var util=require(_0x2943('0x1'));var logger=require('../../config/logger')(_0x2943('0x2'));var moment=require(_0x2943('0x3'));var BPromise=require('bluebird');var rp=require(_0x2943('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2943('0x5'));var attributes=require(_0x2943('0x6'));module[_0x2943('0x7')]=function(_0x27641b,_0x191c65){return _0x27641b['define'](_0x2943('0x8'),attributes,{'tableName':_0x2943('0x9'),'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 f170a80..8bc9f7f 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 _0xdb05=['debug','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x8ef282,_0x417529){var _0x491b86=function(_0x3e7127){while(--_0x3e7127){_0x8ef282['push'](_0x8ef282['shift']());}};_0x491b86(++_0x417529);}(_0xdb05,0x86));var _0x5db0=function(_0x5ad11b,_0x2e602a){_0x5ad11b=_0x5ad11b-0x0;var _0x5edfb6=_0xdb05[_0x5ad11b];return _0x5edfb6;};'use strict';var _=require(_0x5db0('0x0'));var util=require(_0x5db0('0x1'));var moment=require('moment');var BPromise=require(_0x5db0('0x2'));var rs=require(_0x5db0('0x3'));var fs=require('fs');var Redis=require(_0x5db0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5db0('0x5'));var logger=require('../../config/logger')(_0x5db0('0x6'));var config=require(_0x5db0('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5db0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38007b,_0x332c68,_0x4d3dcc){return new BPromise(function(_0x2e102d,_0x55afff){return client[_0x5db0('0x9')](_0x38007b,_0x4d3dcc)[_0x5db0('0xa')](function(_0x296ddd){logger['info'](_0x5db0('0xb'),_0x332c68,_0x5db0('0xc'));logger[_0x5db0('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x332c68,_0x5db0('0xc'),JSON[_0x5db0('0xe')](_0x296ddd));if(_0x296ddd[_0x5db0('0xf')]){if(_0x296ddd[_0x5db0('0xf')][_0x5db0('0x10')]===0x1f4){logger[_0x5db0('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x332c68,_0x296ddd[_0x5db0('0xf')][_0x5db0('0x11')]);return _0x55afff(_0x296ddd[_0x5db0('0xf')][_0x5db0('0x11')]);}logger[_0x5db0('0xf')](_0x5db0('0xb'),_0x332c68,_0x296ddd[_0x5db0('0xf')][_0x5db0('0x11')]);return _0x2e102d(_0x296ddd[_0x5db0('0xf')][_0x5db0('0x11')]);}else{logger[_0x5db0('0x12')](_0x5db0('0xb'),_0x332c68,_0x5db0('0xc'));_0x2e102d(_0x296ddd[_0x5db0('0x13')][_0x5db0('0x11')]);}})[_0x5db0('0x14')](function(_0x15f096){logger[_0x5db0('0xf')](_0x5db0('0xb'),_0x332c68,_0x15f096);_0x55afff(_0x15f096);});});}
\ No newline at end of file
+var _0x6246=['error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x6246,0x153));var _0x6624=function(_0x9dbfc6,_0x2c9e46){_0x9dbfc6=_0x9dbfc6-0x0;var _0x521cc5=_0x6246[_0x9dbfc6];return _0x521cc5;};'use strict';var _=require(_0x6624('0x0'));var util=require(_0x6624('0x1'));var moment=require(_0x6624('0x2'));var BPromise=require(_0x6624('0x3'));var rs=require(_0x6624('0x4'));var fs=require('fs');var Redis=require(_0x6624('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6624('0x6'));var logger=require('../../config/logger')(_0x6624('0x7'));var config=require(_0x6624('0x8'));var jayson=require(_0x6624('0x9'));var client=jayson['client'][_0x6624('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x346a58,_0x350129,_0x169f7c){return new BPromise(function(_0x35bff4,_0x65665d){return client[_0x6624('0xb')](_0x346a58,_0x169f7c)['then'](function(_0xd464fe){logger[_0x6624('0xc')](_0x6624('0xd'),_0x350129,_0x6624('0xe'));logger[_0x6624('0xf')](_0x6624('0x10'),_0x350129,_0x6624('0xe'),JSON[_0x6624('0x11')](_0xd464fe));if(_0xd464fe[_0x6624('0x12')]){if(_0xd464fe[_0x6624('0x12')][_0x6624('0x13')]===0x1f4){logger[_0x6624('0x12')](_0x6624('0xd'),_0x350129,_0xd464fe[_0x6624('0x12')][_0x6624('0x14')]);return _0x65665d(_0xd464fe['error'][_0x6624('0x14')]);}logger['error'](_0x6624('0xd'),_0x350129,_0xd464fe[_0x6624('0x12')][_0x6624('0x14')]);return _0x35bff4(_0xd464fe[_0x6624('0x12')]['message']);}else{logger[_0x6624('0xc')](_0x6624('0xd'),_0x350129,_0x6624('0xe'));_0x35bff4(_0xd464fe['result']['message']);}})['catch'](function(_0x1f1ec1){logger[_0x6624('0x12')](_0x6624('0xd'),_0x350129,_0x1f1ec1);_0x65665d(_0x1f1ec1);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index c1585e6..b891c1c 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 _0x6dac=['../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4bd67a,_0x4f9725){var _0x2be5fb=function(_0x33e132){while(--_0x33e132){_0x4bd67a['push'](_0x4bd67a['shift']());}};_0x2be5fb(++_0x4f9725);}(_0x6dac,0x16e));var _0xc6da=function(_0x5ceab5,_0x190d14){_0x5ceab5=_0x5ceab5-0x0;var _0x59cebf=_0x6dac[_0x5ceab5];return _0x59cebf;};'use strict';var multer=require(_0xc6da('0x0'));var util=require(_0xc6da('0x1'));var path=require(_0xc6da('0x2'));var timeout=require(_0xc6da('0x3'));var express=require(_0xc6da('0x4'));var router=express[_0xc6da('0x5')]();var fs_extra=require(_0xc6da('0x6'));var auth=require(_0xc6da('0x7'));var interaction=require(_0xc6da('0x8'));var config=require(_0xc6da('0x9'));var controller=require(_0xc6da('0xa'));router[_0xc6da('0xb')]('/',auth[_0xc6da('0xc')](),controller['index']);router[_0xc6da('0xb')](_0xc6da('0xd'),auth[_0xc6da('0xc')](),controller[_0xc6da('0xe')]);router[_0xc6da('0xf')]('/',auth[_0xc6da('0xc')](),controller[_0xc6da('0x10')]);router[_0xc6da('0x11')](_0xc6da('0xd'),auth['isAuthenticated'](),controller[_0xc6da('0x12')]);router[_0xc6da('0x13')](_0xc6da('0xd'),auth[_0xc6da('0xc')](),controller[_0xc6da('0x14')]);module[_0xc6da('0x15')]=router;
\ No newline at end of file
+var _0x7cab=['destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','show','post','create','put','update','delete'];(function(_0x4780ae,_0x572fb2){var _0x453ed7=function(_0x328e1e){while(--_0x328e1e){_0x4780ae['push'](_0x4780ae['shift']());}};_0x453ed7(++_0x572fb2);}(_0x7cab,0x91));var _0xb7ca=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x7cab[_0x4c445a];return _0x2f611c;};'use strict';var multer=require(_0xb7ca('0x0'));var util=require(_0xb7ca('0x1'));var path=require(_0xb7ca('0x2'));var timeout=require('connect-timeout');var express=require(_0xb7ca('0x3'));var router=express[_0xb7ca('0x4')]();var fs_extra=require(_0xb7ca('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb7ca('0x6'));var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0xb7ca('0x7')]('/',auth[_0xb7ca('0x8')](),controller['index']);router[_0xb7ca('0x7')]('/:id',auth[_0xb7ca('0x8')](),controller[_0xb7ca('0x9')]);router[_0xb7ca('0xa')]('/',auth[_0xb7ca('0x8')](),controller[_0xb7ca('0xb')]);router[_0xb7ca('0xc')]('/:id',auth[_0xb7ca('0x8')](),controller[_0xb7ca('0xd')]);router[_0xb7ca('0xe')]('/:id',auth[_0xb7ca('0x8')](),controller[_0xb7ca('0xf')]);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 1d23141..8c1abf0 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 _0x8065=['exports'];(function(_0x519bc2,_0x2274f6){var _0x3ac8e4=function(_0x27b030){while(--_0x27b030){_0x519bc2['push'](_0x519bc2['shift']());}};_0x3ac8e4(++_0x2274f6);}(_0x8065,0x187));var _0x5806=function(_0x19dfbd,_0x1ad8bc){_0x19dfbd=_0x19dfbd-0x0;var _0x3032a4=_0x8065[_0x19dfbd];return _0x3032a4;};'use strict';var Sequelize=require('sequelize');module[_0x5806('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x5b3f=['sequelize','exports','TEXT'];(function(_0x2678d6,_0x4e2001){var _0x475503=function(_0x34b23d){while(--_0x34b23d){_0x2678d6['push'](_0x2678d6['shift']());}};_0x475503(++_0x4e2001);}(_0x5b3f,0x159));var _0xf5b3=function(_0x19decf,_0x1ffaae){_0x19decf=_0x19decf-0x0;var _0x56e7eb=_0x5b3f[_0x19decf];return _0x56e7eb;};'use strict';var Sequelize=require(_0xf5b3('0x0'));module[_0xf5b3('0x1')]={'tree':{'type':Sequelize[_0xf5b3('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 1ce41b3..143a32d 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 _0xdd0a=['nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty'];(function(_0x58f1f2,_0x5d44a8){var _0x1c96b5=function(_0x6d56fa){while(--_0x6d56fa){_0x58f1f2['push'](_0x58f1f2['shift']());}};_0x1c96b5(++_0x5d44a8);}(_0xdd0a,0xfe));var _0xadd0=function(_0x48e370,_0x4b7b22){_0x48e370=_0x48e370-0x0;var _0x2ac719=_0xdd0a[_0x48e370];return _0x2ac719;};'use strict';var emlformat=require(_0xadd0('0x0'));var rimraf=require(_0xadd0('0x1'));var zipdir=require(_0xadd0('0x2'));var jsonpatch=require(_0xadd0('0x3'));var rp=require(_0xadd0('0x4'));var moment=require(_0xadd0('0x5'));var BPromise=require(_0xadd0('0x6'));var Mustache=require(_0xadd0('0x7'));var util=require(_0xadd0('0x8'));var path=require(_0xadd0('0x9'));var sox=require(_0xadd0('0xa'));var csv=require('to-csv');var ejs=require(_0xadd0('0xb'));var fs=require('fs');var fs_extra=require(_0xadd0('0xc'));var _=require('lodash');var squel=require(_0xadd0('0xd'));var crypto=require(_0xadd0('0xe'));var jsforce=require(_0xadd0('0xf'));var deskjs=require(_0xadd0('0x10'));var toCsv=require(_0xadd0('0x11'));var querystring=require(_0xadd0('0x12'));var Papa=require(_0xadd0('0x13'));var Redis=require(_0xadd0('0x14'));var authService=require(_0xadd0('0x15'));var qs=require(_0xadd0('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xadd0('0x17'));var logger=require(_0xadd0('0x18'))('api');var utils=require('../../config/utils');var config=require(_0xadd0('0x19'));var licenseUtil=require(_0xadd0('0x1a'));var db=require(_0xadd0('0x1b'))['db'];function respondWithStatusCode(_0x11ab4c,_0x59d81a){_0x59d81a=_0x59d81a||0xcc;return function(_0x2c5fcb){if(_0x2c5fcb){return _0x11ab4c['sendStatus'](_0x59d81a);}return _0x11ab4c[_0xadd0('0x1c')](_0x59d81a)[_0xadd0('0x1d')]();};}function respondWithResult(_0x4825f8,_0x2a36be){_0x2a36be=_0x2a36be||0xc8;return function(_0x47d362){if(_0x47d362){return _0x4825f8[_0xadd0('0x1c')](_0x2a36be)['json'](_0x47d362);}};}function respondWithFilteredResult(_0xcb2918,_0x192345){return function(_0x1180b4){if(_0x1180b4){var _0x5dcfcc=typeof _0x192345[_0xadd0('0x1e')]===_0xadd0('0x1f')&&typeof _0x192345[_0xadd0('0x20')]==='undefined';var _0x2f4c0c=_0x1180b4[_0xadd0('0x21')];var _0x6995ab=_0x5dcfcc?0x0:_0x192345[_0xadd0('0x1e')];var _0x18cc19=_0x5dcfcc?_0x1180b4[_0xadd0('0x21')]:_0x192345[_0xadd0('0x1e')]+_0x192345['limit'];var _0x9b2cc4;if(_0x18cc19>=_0x2f4c0c){_0x18cc19=_0x2f4c0c;_0x9b2cc4=0xc8;}else{_0x9b2cc4=0xce;}_0xcb2918[_0xadd0('0x1c')](_0x9b2cc4);return _0xcb2918[_0xadd0('0x22')](_0xadd0('0x23'),_0x6995ab+'-'+_0x18cc19+'/'+_0x2f4c0c)[_0xadd0('0x24')](_0x1180b4);}return null;};}function patchUpdates(_0x25649f){return function(_0x1c1a1e){try{jsonpatch[_0xadd0('0x25')](_0x1c1a1e,_0x25649f,!![]);}catch(_0xee88ca){return BPromise[_0xadd0('0x26')](_0xee88ca);}return _0x1c1a1e[_0xadd0('0x27')]();};}function saveUpdates(_0x5bd1ca,_0x4754c7){return function(_0x1702fb){if(_0x1702fb){return _0x1702fb[_0xadd0('0x28')](_0x5bd1ca)[_0xadd0('0x29')](function(_0x3a6722){return _0x3a6722;});}return null;};}function removeEntity(_0x361028,_0x5154d2){return function(_0x3e24e6){if(_0x3e24e6){return _0x3e24e6['destroy']()[_0xadd0('0x29')](function(){_0x361028[_0xadd0('0x1c')](0xcc)[_0xadd0('0x1d')]();});}};}function handleEntityNotFound(_0x2b5227,_0x1d68c7){return function(_0x452886){if(!_0x452886){_0x2b5227['sendStatus'](0x194);}return _0x452886;};}function handleError(_0x3a4c87,_0x5eb4f2){_0x5eb4f2=_0x5eb4f2||0x1f4;return function(_0x4dc423){logger[_0xadd0('0x2a')](_0x4dc423[_0xadd0('0x2b')]);if(_0x4dc423[_0xadd0('0x2c')]){delete _0x4dc423[_0xadd0('0x2c')];}_0x3a4c87[_0xadd0('0x1c')](_0x5eb4f2)['send'](_0x4dc423);};}exports[_0xadd0('0x2d')]=function(_0x119bec,_0x5960e8){var _0x45b04a={},_0x42281f={},_0x1ed7ac={'count':0x0,'rows':[]};var _0x30a192=_[_0xadd0('0x2e')](db[_0xadd0('0x2f')][_0xadd0('0x30')],function(_0x194ba4){return{'name':_0x194ba4[_0xadd0('0x31')],'type':_0x194ba4[_0xadd0('0x32')]['key']};});_0x42281f[_0xadd0('0x33')]=_[_0xadd0('0x2e')](_0x30a192,_0xadd0('0x2c'));_0x42281f[_0xadd0('0x34')]=_[_0xadd0('0x35')](_0x119bec['query']);_0x42281f['filters']=_[_0xadd0('0x36')](_0x42281f[_0xadd0('0x33')],_0x42281f[_0xadd0('0x34')]);_0x45b04a[_0xadd0('0x37')]=_['intersection'](_0x42281f[_0xadd0('0x33')],qs[_0xadd0('0x38')](_0x119bec[_0xadd0('0x34')]['fields']));_0x45b04a['attributes']=_0x45b04a[_0xadd0('0x37')]['length']?_0x45b04a['attributes']:_0x42281f['model'];if(!_0x119bec[_0xadd0('0x34')][_0xadd0('0x39')](_0xadd0('0x3a'))){_0x45b04a[_0xadd0('0x20')]=qs['limit'](_0x119bec[_0xadd0('0x34')][_0xadd0('0x20')]);_0x45b04a[_0xadd0('0x1e')]=qs[_0xadd0('0x1e')](_0x119bec['query'][_0xadd0('0x1e')]);}_0x45b04a[_0xadd0('0x3b')]=qs['sort'](_0x119bec[_0xadd0('0x34')][_0xadd0('0x3c')]);_0x45b04a['where']=qs[_0xadd0('0x3d')](_[_0xadd0('0x3e')](_0x119bec['query'],_0x42281f[_0xadd0('0x3d')]),_0x30a192);if(_0x119bec[_0xadd0('0x34')][_0xadd0('0x3f')]){_0x45b04a['where']=_['merge'](_0x45b04a[_0xadd0('0x40')],{'$or':_[_0xadd0('0x2e')](_0x30a192,function(_0x1a40a1){if(_0x1a40a1[_0xadd0('0x32')]!=='VIRTUAL'){var _0x2e5a3c={};_0x2e5a3c[_0x1a40a1[_0xadd0('0x2c')]]={'$like':'%'+_0x119bec[_0xadd0('0x34')][_0xadd0('0x3f')]+'%'};return _0x2e5a3c;}})});}_0x45b04a=_[_0xadd0('0x41')]({},_0x45b04a,_0x119bec[_0xadd0('0x42')]);var _0x3fb1be={'where':_0x45b04a['where']};return db[_0xadd0('0x2f')][_0xadd0('0x21')](_0x3fb1be)['then'](function(_0x5d5769){_0x1ed7ac[_0xadd0('0x21')]=_0x5d5769;if(_0x119bec[_0xadd0('0x34')][_0xadd0('0x43')]){_0x45b04a[_0xadd0('0x44')]=[{'all':!![]}];}return db[_0xadd0('0x2f')][_0xadd0('0x45')](_0x45b04a);})['then'](function(_0x185512){_0x1ed7ac[_0xadd0('0x46')]=_0x185512;return _0x1ed7ac;})['then'](respondWithFilteredResult(_0x5960e8,_0x45b04a))[_0xadd0('0x47')](handleError(_0x5960e8,null));};exports[_0xadd0('0x48')]=function(_0x203a83,_0x4fc4e8){var _0x4e9053={'raw':!![],'where':{'id':_0x203a83[_0xadd0('0x49')]['id']}},_0x4f6f0c={};_0x4f6f0c[_0xadd0('0x33')]=_[_0xadd0('0x35')](db[_0xadd0('0x2f')][_0xadd0('0x30')]);_0x4f6f0c[_0xadd0('0x34')]=_['keys'](_0x203a83[_0xadd0('0x34')]);_0x4f6f0c[_0xadd0('0x3d')]=_[_0xadd0('0x36')](_0x4f6f0c[_0xadd0('0x33')],_0x4f6f0c[_0xadd0('0x34')]);_0x4e9053[_0xadd0('0x37')]=_[_0xadd0('0x36')](_0x4f6f0c[_0xadd0('0x33')],qs[_0xadd0('0x38')](_0x203a83[_0xadd0('0x34')][_0xadd0('0x38')]));_0x4e9053[_0xadd0('0x37')]=_0x4e9053[_0xadd0('0x37')]['length']?_0x4e9053[_0xadd0('0x37')]:_0x4f6f0c[_0xadd0('0x33')];if(_0x203a83[_0xadd0('0x34')][_0xadd0('0x43')]){_0x4e9053[_0xadd0('0x44')]=[{'all':!![]}];}_0x4e9053=_['merge']({},_0x4e9053,_0x203a83['options']);return db[_0xadd0('0x2f')][_0xadd0('0x4a')](_0x4e9053)['then'](handleEntityNotFound(_0x4fc4e8,null))['then'](respondWithResult(_0x4fc4e8,null))[_0xadd0('0x47')](handleError(_0x4fc4e8,null));};exports['create']=function(_0x376fa5,_0x289e6f){return db[_0xadd0('0x2f')][_0xadd0('0x4b')](_0x376fa5['body'],{})[_0xadd0('0x29')](respondWithResult(_0x289e6f,0xc9))['catch'](handleError(_0x289e6f,null));};exports[_0xadd0('0x28')]=function(_0x5dbc57,_0x37f751){if(_0x5dbc57[_0xadd0('0x4c')]['id']){delete _0x5dbc57[_0xadd0('0x4c')]['id'];}return db[_0xadd0('0x2f')][_0xadd0('0x4a')]({'where':{'id':_0x5dbc57['params']['id']}})[_0xadd0('0x29')](handleEntityNotFound(_0x37f751,null))[_0xadd0('0x29')](saveUpdates(_0x5dbc57['body'],null))[_0xadd0('0x29')](respondWithResult(_0x37f751,null))[_0xadd0('0x47')](handleError(_0x37f751,null));};exports[_0xadd0('0x4d')]=function(_0x3f8cc3,_0x352142){return db[_0xadd0('0x2f')][_0xadd0('0x4a')]({'where':{'id':_0x3f8cc3[_0xadd0('0x49')]['id']}})[_0xadd0('0x29')](handleEntityNotFound(_0x352142,null))[_0xadd0('0x29')](removeEntity(_0x352142,null))['catch'](handleError(_0x352142,null));};
\ No newline at end of file
+var _0x2575=['type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','keys','include','find','create','body','eml-format','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','fieldName'];(function(_0xd4a717,_0x423213){var _0x22c4f6=function(_0x3c602f){while(--_0x3c602f){_0xd4a717['push'](_0xd4a717['shift']());}};_0x22c4f6(++_0x423213);}(_0x2575,0x1e5));var _0x5257=function(_0x1de390,_0x2fec64){_0x1de390=_0x1de390-0x0;var _0x438b39=_0x2575[_0x1de390];return _0x438b39;};'use strict';var emlformat=require(_0x5257('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5257('0x1'));var rp=require('request-promise');var moment=require(_0x5257('0x2'));var BPromise=require(_0x5257('0x3'));var Mustache=require(_0x5257('0x4'));var util=require(_0x5257('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x5257('0x6'));var ejs=require(_0x5257('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5257('0x8'));var squel=require(_0x5257('0x9'));var crypto=require(_0x5257('0xa'));var jsforce=require(_0x5257('0xb'));var deskjs=require(_0x5257('0xc'));var toCsv=require(_0x5257('0x6'));var querystring=require(_0x5257('0xd'));var Papa=require(_0x5257('0xe'));var Redis=require(_0x5257('0xf'));var authService=require(_0x5257('0x10'));var qs=require(_0x5257('0x11'));var as=require(_0x5257('0x12'));var hardwareService=require(_0x5257('0x13'));var logger=require(_0x5257('0x14'))(_0x5257('0x15'));var utils=require(_0x5257('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5257('0x17'));var db=require(_0x5257('0x18'))['db'];function respondWithStatusCode(_0x514a94,_0x4ae497){_0x4ae497=_0x4ae497||0xcc;return function(_0x1a790e){if(_0x1a790e){return _0x514a94[_0x5257('0x19')](_0x4ae497);}return _0x514a94[_0x5257('0x1a')](_0x4ae497)[_0x5257('0x1b')]();};}function respondWithResult(_0x53377c,_0x2441ae){_0x2441ae=_0x2441ae||0xc8;return function(_0x27750e){if(_0x27750e){return _0x53377c['status'](_0x2441ae)['json'](_0x27750e);}};}function respondWithFilteredResult(_0x33c9fb,_0x5e26f9){return function(_0x479624){if(_0x479624){var _0x184940=typeof _0x5e26f9['offset']===_0x5257('0x1c')&&typeof _0x5e26f9[_0x5257('0x1d')]===_0x5257('0x1c');var _0x5acf4b=_0x479624[_0x5257('0x1e')];var _0x134920=_0x184940?0x0:_0x5e26f9[_0x5257('0x1f')];var _0x4c4c18=_0x184940?_0x479624[_0x5257('0x1e')]:_0x5e26f9[_0x5257('0x1f')]+_0x5e26f9[_0x5257('0x1d')];var _0x3637e5;if(_0x4c4c18>=_0x5acf4b){_0x4c4c18=_0x5acf4b;_0x3637e5=0xc8;}else{_0x3637e5=0xce;}_0x33c9fb[_0x5257('0x1a')](_0x3637e5);return _0x33c9fb[_0x5257('0x20')](_0x5257('0x21'),_0x134920+'-'+_0x4c4c18+'/'+_0x5acf4b)['json'](_0x479624);}return null;};}function patchUpdates(_0x5c3045){return function(_0x360860){try{jsonpatch[_0x5257('0x22')](_0x360860,_0x5c3045,!![]);}catch(_0x1013e2){return BPromise['reject'](_0x1013e2);}return _0x360860[_0x5257('0x23')]();};}function saveUpdates(_0x144285,_0x104beb){return function(_0x53ee70){if(_0x53ee70){return _0x53ee70[_0x5257('0x24')](_0x144285)[_0x5257('0x25')](function(_0x5c7e1f){return _0x5c7e1f;});}return null;};}function removeEntity(_0xb1296d,_0x213f2a){return function(_0x336df3){if(_0x336df3){return _0x336df3[_0x5257('0x26')]()[_0x5257('0x25')](function(){_0xb1296d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fb12a,_0x4768bc){return function(_0x59b947){if(!_0x59b947){_0x3fb12a[_0x5257('0x19')](0x194);}return _0x59b947;};}function handleError(_0x3615bf,_0x4c8aee){_0x4c8aee=_0x4c8aee||0x1f4;return function(_0x46639a){logger[_0x5257('0x27')](_0x46639a[_0x5257('0x28')]);if(_0x46639a['name']){delete _0x46639a[_0x5257('0x29')];}_0x3615bf[_0x5257('0x1a')](_0x4c8aee)[_0x5257('0x2a')](_0x46639a);};}exports[_0x5257('0x2b')]=function(_0x4e58c3,_0x4fc24a){var _0x396d5e={},_0x1b4ff6={},_0x4d8fff={'count':0x0,'rows':[]};var _0x428153=_[_0x5257('0x2c')](db[_0x5257('0x2d')]['rawAttributes'],function(_0x25805a){return{'name':_0x25805a[_0x5257('0x2e')],'type':_0x25805a[_0x5257('0x2f')]['key']};});_0x1b4ff6[_0x5257('0x30')]=_['map'](_0x428153,'name');_0x1b4ff6[_0x5257('0x31')]=_['keys'](_0x4e58c3[_0x5257('0x31')]);_0x1b4ff6[_0x5257('0x32')]=_[_0x5257('0x33')](_0x1b4ff6[_0x5257('0x30')],_0x1b4ff6[_0x5257('0x31')]);_0x396d5e[_0x5257('0x34')]=_[_0x5257('0x33')](_0x1b4ff6[_0x5257('0x30')],qs[_0x5257('0x35')](_0x4e58c3[_0x5257('0x31')]['fields']));_0x396d5e[_0x5257('0x34')]=_0x396d5e[_0x5257('0x34')][_0x5257('0x36')]?_0x396d5e['attributes']:_0x1b4ff6[_0x5257('0x30')];if(!_0x4e58c3[_0x5257('0x31')][_0x5257('0x37')](_0x5257('0x38'))){_0x396d5e[_0x5257('0x1d')]=qs['limit'](_0x4e58c3['query'][_0x5257('0x1d')]);_0x396d5e[_0x5257('0x1f')]=qs[_0x5257('0x1f')](_0x4e58c3['query'][_0x5257('0x1f')]);}_0x396d5e['order']=qs[_0x5257('0x39')](_0x4e58c3['query'][_0x5257('0x39')]);_0x396d5e[_0x5257('0x3a')]=qs[_0x5257('0x32')](_[_0x5257('0x3b')](_0x4e58c3['query'],_0x1b4ff6['filters']),_0x428153);if(_0x4e58c3[_0x5257('0x31')][_0x5257('0x3c')]){_0x396d5e[_0x5257('0x3a')]=_[_0x5257('0x3d')](_0x396d5e['where'],{'$or':_[_0x5257('0x2c')](_0x428153,function(_0x43b509){if(_0x43b509[_0x5257('0x2f')]!==_0x5257('0x3e')){var _0x4a3ab7={};_0x4a3ab7[_0x43b509[_0x5257('0x29')]]={'$like':'%'+_0x4e58c3[_0x5257('0x31')]['filter']+'%'};return _0x4a3ab7;}})});}_0x396d5e=_[_0x5257('0x3d')]({},_0x396d5e,_0x4e58c3[_0x5257('0x3f')]);var _0x5e3010={'where':_0x396d5e[_0x5257('0x3a')]};return db[_0x5257('0x2d')][_0x5257('0x1e')](_0x5e3010)[_0x5257('0x25')](function(_0x2cf2f8){_0x4d8fff[_0x5257('0x1e')]=_0x2cf2f8;if(_0x4e58c3['query'][_0x5257('0x40')]){_0x396d5e['include']=[{'all':!![]}];}return db[_0x5257('0x2d')][_0x5257('0x41')](_0x396d5e);})[_0x5257('0x25')](function(_0x1ad9c5){_0x4d8fff[_0x5257('0x42')]=_0x1ad9c5;return _0x4d8fff;})[_0x5257('0x25')](respondWithFilteredResult(_0x4fc24a,_0x396d5e))[_0x5257('0x43')](handleError(_0x4fc24a,null));};exports[_0x5257('0x44')]=function(_0x5ba067,_0x248c4c){var _0x281ed1={'raw':!![],'where':{'id':_0x5ba067[_0x5257('0x45')]['id']}},_0x38229e={};_0x38229e[_0x5257('0x30')]=_['keys'](db[_0x5257('0x2d')][_0x5257('0x46')]);_0x38229e[_0x5257('0x31')]=_[_0x5257('0x47')](_0x5ba067['query']);_0x38229e[_0x5257('0x32')]=_[_0x5257('0x33')](_0x38229e['model'],_0x38229e[_0x5257('0x31')]);_0x281ed1[_0x5257('0x34')]=_[_0x5257('0x33')](_0x38229e[_0x5257('0x30')],qs[_0x5257('0x35')](_0x5ba067[_0x5257('0x31')][_0x5257('0x35')]));_0x281ed1[_0x5257('0x34')]=_0x281ed1['attributes'][_0x5257('0x36')]?_0x281ed1[_0x5257('0x34')]:_0x38229e[_0x5257('0x30')];if(_0x5ba067[_0x5257('0x31')]['includeAll']){_0x281ed1[_0x5257('0x48')]=[{'all':!![]}];}_0x281ed1=_[_0x5257('0x3d')]({},_0x281ed1,_0x5ba067[_0x5257('0x3f')]);return db[_0x5257('0x2d')][_0x5257('0x49')](_0x281ed1)[_0x5257('0x25')](handleEntityNotFound(_0x248c4c,null))['then'](respondWithResult(_0x248c4c,null))[_0x5257('0x43')](handleError(_0x248c4c,null));};exports[_0x5257('0x4a')]=function(_0x4295af,_0x5646ba){return db[_0x5257('0x2d')][_0x5257('0x4a')](_0x4295af[_0x5257('0x4b')],{})['then'](respondWithResult(_0x5646ba,0xc9))[_0x5257('0x43')](handleError(_0x5646ba,null));};exports[_0x5257('0x24')]=function(_0x589565,_0x11c116){if(_0x589565[_0x5257('0x4b')]['id']){delete _0x589565[_0x5257('0x4b')]['id'];}return db[_0x5257('0x2d')][_0x5257('0x49')]({'where':{'id':_0x589565[_0x5257('0x45')]['id']}})[_0x5257('0x25')](handleEntityNotFound(_0x11c116,null))[_0x5257('0x25')](saveUpdates(_0x589565[_0x5257('0x4b')],null))['then'](respondWithResult(_0x11c116,null))[_0x5257('0x43')](handleError(_0x11c116,null));};exports[_0x5257('0x26')]=function(_0x4fd948,_0x11ca9f){return db[_0x5257('0x2d')][_0x5257('0x49')]({'where':{'id':_0x4fd948['params']['id']}})['then'](handleEntityNotFound(_0x11ca9f,null))[_0x5257('0x25')](removeEntity(_0x11ca9f,null))[_0x5257('0x43')](handleError(_0x11ca9f,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 7be2760..f75f43f 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 _0x606a=['AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0x5d4600,_0x2c572f){var _0x5e71ef=function(_0x4f046f){while(--_0x4f046f){_0x5d4600['push'](_0x5d4600['shift']());}};_0x5e71ef(++_0x2c572f);}(_0x606a,0x16e));var _0xa606=function(_0xbc2a02,_0xc8d757){_0xbc2a02=_0xbc2a02-0x0;var _0x133be5=_0x606a[_0xbc2a02];return _0x133be5;};'use strict';var _=require('lodash');var util=require(_0xa606('0x0'));var logger=require(_0xa606('0x1'))(_0xa606('0x2'));var moment=require(_0xa606('0x3'));var BPromise=require(_0xa606('0x4'));var rp=require(_0xa606('0x5'));var fs=require('fs');var path=require(_0xa606('0x6'));var rimraf=require('rimraf');var config=require(_0xa606('0x7'));var attributes=require(_0xa606('0x8'));module[_0xa606('0x9')]=function(_0x12852c,_0x20756a){return _0x12852c[_0xa606('0xa')](_0xa606('0xb'),attributes,{'tableName':_0xa606('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7b91=['rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x20ef6a,_0x2c72ec){var _0x3397e9=function(_0x2e5c0b){while(--_0x2e5c0b){_0x20ef6a['push'](_0x20ef6a['shift']());}};_0x3397e9(++_0x2c72ec);}(_0x7b91,0xe3));var _0x17b9=function(_0x30535a,_0x12f97e){_0x30535a=_0x30535a-0x0;var _0x4f4d39=_0x7b91[_0x30535a];return _0x4f4d39;};'use strict';var _=require(_0x17b9('0x0'));var util=require(_0x17b9('0x1'));var logger=require('../../config/logger')(_0x17b9('0x2'));var moment=require(_0x17b9('0x3'));var BPromise=require(_0x17b9('0x4'));var rp=require(_0x17b9('0x5'));var fs=require('fs');var path=require(_0x17b9('0x6'));var rimraf=require(_0x17b9('0x7'));var config=require('../../config/environment');var attributes=require(_0x17b9('0x8'));module[_0x17b9('0x9')]=function(_0x5dd8ba,_0x32227c){return _0x5dd8ba[_0x17b9('0xa')](_0x17b9('0xb'),attributes,{'tableName':_0x17b9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 2aeab97..46f4677 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x38f619,_0x10675e){var _0x4554ab=function(_0x367abf){while(--_0x367abf){_0x38f619['push'](_0x38f619['shift']());}};_0x4554ab(++_0x10675e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x201b89,_0x4fd21f){_0x201b89=_0x201b89-0x0;var _0x2a7b85=_0x5f2f[_0x201b89];return _0x2a7b85;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
+var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x1a3796,_0x1ac06a){var _0x132cca=function(_0x110e21){while(--_0x110e21){_0x1a3796['push'](_0x1a3796['shift']());}};_0x132cca(++_0x1ac06a);}(_0x1261,0x144));var _0x1126=function(_0x4b15a4,_0x4241fe){_0x4b15a4=_0x4b15a4-0x0;var _0x40a783=_0x1261[_0x4b15a4];return _0x40a783;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 9627699..c4b254d 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 _0x5e6c=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x58ffd1,_0x1fbfc5){var _0x255219=function(_0x2be155){while(--_0x2be155){_0x58ffd1['push'](_0x58ffd1['shift']());}};_0x255219(++_0x1fbfc5);}(_0x5e6c,0x1dc));var _0xc5e6=function(_0x596e08,_0x552c0a){_0x596e08=_0x596e08-0x0;var _0x25cd55=_0x5e6c[_0x596e08];return _0x25cd55;};'use strict';var multer=require(_0xc5e6('0x0'));var util=require(_0xc5e6('0x1'));var path=require(_0xc5e6('0x2'));var timeout=require(_0xc5e6('0x3'));var express=require('express');var router=express[_0xc5e6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc5e6('0x5'));var interaction=require(_0xc5e6('0x6'));var config=require(_0xc5e6('0x7'));var controller=require(_0xc5e6('0x8'));router['get']('/',auth[_0xc5e6('0x9')](),controller[_0xc5e6('0xa')]);router['get'](_0xc5e6('0xb'),auth[_0xc5e6('0x9')](),controller[_0xc5e6('0xc')]);router[_0xc5e6('0xd')]('/',auth[_0xc5e6('0x9')](),controller[_0xc5e6('0xe')]);router[_0xc5e6('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xc5e6('0x10')]);router[_0xc5e6('0x11')](_0xc5e6('0xb'),auth[_0xc5e6('0x9')](),controller[_0xc5e6('0x12')]);module[_0xc5e6('0x13')]=router;
\ No newline at end of file
+var _0x4b9a=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','post','put','delete','destroy','multer'];(function(_0x30a976,_0x1df714){var _0x67299a=function(_0x20f909){while(--_0x20f909){_0x30a976['push'](_0x30a976['shift']());}};_0x67299a(++_0x1df714);}(_0x4b9a,0x1d0));var _0xa4b9=function(_0x4d767f,_0x4473ec){_0x4d767f=_0x4d767f-0x0;var _0x3b096d=_0x4b9a[_0x4d767f];return _0x3b096d;};'use strict';var multer=require(_0xa4b9('0x0'));var util=require(_0xa4b9('0x1'));var path=require(_0xa4b9('0x2'));var timeout=require(_0xa4b9('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa4b9('0x4'));var auth=require(_0xa4b9('0x5'));var interaction=require(_0xa4b9('0x6'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0xa4b9('0x7')]('/',auth[_0xa4b9('0x8')](),controller['index']);router['get'](_0xa4b9('0x9'),auth['isAuthenticated'](),controller[_0xa4b9('0xa')]);router[_0xa4b9('0xb')]('/',auth[_0xa4b9('0x8')](),controller['create']);router[_0xa4b9('0xc')](_0xa4b9('0x9'),auth[_0xa4b9('0x8')](),controller['update']);router[_0xa4b9('0xd')](_0xa4b9('0x9'),auth[_0xa4b9('0x8')](),controller[_0xa4b9('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 7fa1e49..124cd43 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 _0xe189=['sequelize','STRING'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xe189,0x194));var _0x9e18=function(_0x10ac9a,_0x2f67a6){_0x10ac9a=_0x10ac9a-0x0;var _0x198567=_0xe189[_0x10ac9a];return _0x198567;};'use strict';var Sequelize=require(_0x9e18('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x9e18('0x1')]},'type':{'type':Sequelize[_0x9e18('0x1')]}};
\ No newline at end of file
+var _0xf0cc=['STRING','sequelize'];(function(_0x5318eb,_0x166f7d){var _0x188659=function(_0x4ef5dd){while(--_0x4ef5dd){_0x5318eb['push'](_0x5318eb['shift']());}};_0x188659(++_0x166f7d);}(_0xf0cc,0xa7));var _0xcf0c=function(_0x571035,_0x1ebfc7){_0x571035=_0x571035-0x0;var _0x369f11=_0xf0cc[_0x571035];return _0x369f11;};'use strict';var Sequelize=require(_0xcf0c('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xcf0c('0x1')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 0dfd2c6..f2015be 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 _0x9f1e=['file','originalname','basename','mimetype','download','findOne','ChatOfflineMessageId','join','offline-chat/','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','then','destroy','name','index','map','rawAttributes','fieldName','type','key','query','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','filter','options','Attachment','include','findAll','rows','keys','length','find','catch','clone','params','includeAll','get','omit','createdAt','updatedAt','body','create'];(function(_0x197abc,_0x2c6868){var _0xa85206=function(_0x3dbe6a){while(--_0x3dbe6a){_0x197abc['push'](_0x197abc['shift']());}};_0xa85206(++_0x2c6868);}(_0x9f1e,0x1b7));var _0xe9f1=function(_0x20ad38,_0x5492a5){_0x20ad38=_0x20ad38-0x0;var _0xb41a2c=_0x9f1e[_0x20ad38];return _0xb41a2c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9f1('0x0'));var zipdir=require(_0xe9f1('0x1'));var jsonpatch=require(_0xe9f1('0x2'));var rp=require(_0xe9f1('0x3'));var moment=require('moment');var BPromise=require(_0xe9f1('0x4'));var Mustache=require(_0xe9f1('0x5'));var util=require(_0xe9f1('0x6'));var path=require(_0xe9f1('0x7'));var sox=require('sox');var csv=require(_0xe9f1('0x8'));var ejs=require(_0xe9f1('0x9'));var fs=require('fs');var fs_extra=require(_0xe9f1('0xa'));var _=require(_0xe9f1('0xb'));var squel=require(_0xe9f1('0xc'));var crypto=require('crypto');var jsforce=require(_0xe9f1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe9f1('0x8'));var querystring=require(_0xe9f1('0xe'));var Papa=require('papaparse');var Redis=require(_0xe9f1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe9f1('0x10'));var as=require(_0xe9f1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe9f1('0x12'));var utils=require(_0xe9f1('0x13'));var config=require(_0xe9f1('0x14'));var licenseUtil=require(_0xe9f1('0x15'));var db=require(_0xe9f1('0x16'))['db'];function respondWithStatusCode(_0x240e3f,_0x579165){_0x579165=_0x579165||0xcc;return function(_0x43269f){if(_0x43269f){return _0x240e3f[_0xe9f1('0x17')](_0x579165);}return _0x240e3f[_0xe9f1('0x18')](_0x579165)[_0xe9f1('0x19')]();};}function respondWithResult(_0x5949b9,_0x4b42a7){_0x4b42a7=_0x4b42a7||0xc8;return function(_0x46b028){if(_0x46b028){return _0x5949b9[_0xe9f1('0x18')](_0x4b42a7)['json'](_0x46b028);}};}function respondWithFilteredResult(_0x4e524f,_0x170fd0){return function(_0x2eaf3d){if(_0x2eaf3d){var _0x26b1a1=typeof _0x170fd0['offset']===_0xe9f1('0x1a')&&typeof _0x170fd0[_0xe9f1('0x1b')]===_0xe9f1('0x1a');var _0x415b4a=_0x2eaf3d[_0xe9f1('0x1c')];var _0x2b1851=_0x26b1a1?0x0:_0x170fd0[_0xe9f1('0x1d')];var _0x2d448e=_0x26b1a1?_0x2eaf3d['count']:_0x170fd0[_0xe9f1('0x1d')]+_0x170fd0['limit'];var _0x1d15b8;if(_0x2d448e>=_0x415b4a){_0x2d448e=_0x415b4a;_0x1d15b8=0xc8;}else{_0x1d15b8=0xce;}_0x4e524f[_0xe9f1('0x18')](_0x1d15b8);return _0x4e524f[_0xe9f1('0x1e')]('Content-Range',_0x2b1851+'-'+_0x2d448e+'/'+_0x415b4a)[_0xe9f1('0x1f')](_0x2eaf3d);}return null;};}function patchUpdates(_0x297a84){return function(_0x513c57){try{jsonpatch[_0xe9f1('0x20')](_0x513c57,_0x297a84,!![]);}catch(_0x34aff5){return BPromise[_0xe9f1('0x21')](_0x34aff5);}return _0x513c57[_0xe9f1('0x22')]();};}function saveUpdates(_0x226510,_0x1784ab){return function(_0x3871fa){if(_0x3871fa){return _0x3871fa[_0xe9f1('0x23')](_0x226510)[_0xe9f1('0x24')](function(_0x13e7ac){return _0x13e7ac;});}return null;};}function removeEntity(_0x26e9fa,_0x5cf313){return function(_0x4c7184){if(_0x4c7184){return _0x4c7184[_0xe9f1('0x25')]()[_0xe9f1('0x24')](function(){_0x26e9fa[_0xe9f1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31597f,_0x35831b){return function(_0x48c84b){if(!_0x48c84b){_0x31597f[_0xe9f1('0x17')](0x194);}return _0x48c84b;};}function handleError(_0x4e66dc,_0xcac115){_0xcac115=_0xcac115||0x1f4;return function(_0x1075da){logger['error'](_0x1075da['stack']);if(_0x1075da[_0xe9f1('0x26')]){delete _0x1075da[_0xe9f1('0x26')];}_0x4e66dc[_0xe9f1('0x18')](_0xcac115)['send'](_0x1075da);};}exports[_0xe9f1('0x27')]=function(_0x198cc7,_0x34362b){var _0x448e56={},_0x148a72={},_0x2878a8={'count':0x0,'rows':[]};var _0x256237=_[_0xe9f1('0x28')](db['Attachment'][_0xe9f1('0x29')],function(_0xe44ae4){return{'name':_0xe44ae4[_0xe9f1('0x2a')],'type':_0xe44ae4[_0xe9f1('0x2b')][_0xe9f1('0x2c')]};});_0x148a72['model']=_[_0xe9f1('0x28')](_0x256237,_0xe9f1('0x26'));_0x148a72[_0xe9f1('0x2d')]=_['keys'](_0x198cc7[_0xe9f1('0x2d')]);_0x148a72['filters']=_[_0xe9f1('0x2e')](_0x148a72['model'],_0x148a72[_0xe9f1('0x2d')]);_0x448e56[_0xe9f1('0x2f')]=_['intersection'](_0x148a72[_0xe9f1('0x30')],qs[_0xe9f1('0x31')](_0x198cc7['query'][_0xe9f1('0x31')]));_0x448e56[_0xe9f1('0x2f')]=_0x448e56[_0xe9f1('0x2f')]['length']?_0x448e56['attributes']:_0x148a72[_0xe9f1('0x30')];if(!_0x198cc7[_0xe9f1('0x2d')][_0xe9f1('0x32')](_0xe9f1('0x33'))){_0x448e56[_0xe9f1('0x1b')]=qs[_0xe9f1('0x1b')](_0x198cc7['query']['limit']);_0x448e56[_0xe9f1('0x1d')]=qs[_0xe9f1('0x1d')](_0x198cc7[_0xe9f1('0x2d')][_0xe9f1('0x1d')]);}_0x448e56[_0xe9f1('0x34')]=qs[_0xe9f1('0x35')](_0x198cc7[_0xe9f1('0x2d')][_0xe9f1('0x35')]);_0x448e56[_0xe9f1('0x36')]=qs['filters'](_[_0xe9f1('0x37')](_0x198cc7['query'],_0x148a72[_0xe9f1('0x38')]),_0x256237);if(_0x198cc7[_0xe9f1('0x2d')]['filter']){_0x448e56[_0xe9f1('0x36')]=_[_0xe9f1('0x39')](_0x448e56[_0xe9f1('0x36')],{'$or':_[_0xe9f1('0x28')](_0x256237,function(_0x2225e6){if(_0x2225e6[_0xe9f1('0x2b')]!=='VIRTUAL'){var _0x5dd32f={};_0x5dd32f[_0x2225e6[_0xe9f1('0x26')]]={'$like':'%'+_0x198cc7[_0xe9f1('0x2d')][_0xe9f1('0x3a')]+'%'};return _0x5dd32f;}})});}_0x448e56=_[_0xe9f1('0x39')]({},_0x448e56,_0x198cc7[_0xe9f1('0x3b')]);var _0x5c4a6a={'where':_0x448e56[_0xe9f1('0x36')]};return db[_0xe9f1('0x3c')][_0xe9f1('0x1c')](_0x5c4a6a)['then'](function(_0x4bef15){_0x2878a8[_0xe9f1('0x1c')]=_0x4bef15;if(_0x198cc7[_0xe9f1('0x2d')]['includeAll']){_0x448e56[_0xe9f1('0x3d')]=[{'all':!![]}];}return db[_0xe9f1('0x3c')][_0xe9f1('0x3e')](_0x448e56);})[_0xe9f1('0x24')](function(_0x4abdc4){_0x2878a8[_0xe9f1('0x3f')]=_0x4abdc4;return _0x2878a8;})[_0xe9f1('0x24')](respondWithFilteredResult(_0x34362b,_0x448e56))['catch'](handleError(_0x34362b,null));};exports['show']=function(_0x9bd41e,_0x10dbe6){var _0x33e228={'raw':!![],'where':{'id':_0x9bd41e['params']['id']}},_0x26304d={};_0x26304d['model']=_[_0xe9f1('0x40')](db[_0xe9f1('0x3c')][_0xe9f1('0x29')]);_0x26304d['query']=_[_0xe9f1('0x40')](_0x9bd41e['query']);_0x26304d[_0xe9f1('0x38')]=_['intersection'](_0x26304d[_0xe9f1('0x30')],_0x26304d[_0xe9f1('0x2d')]);_0x33e228[_0xe9f1('0x2f')]=_[_0xe9f1('0x2e')](_0x26304d[_0xe9f1('0x30')],qs['fields'](_0x9bd41e[_0xe9f1('0x2d')]['fields']));_0x33e228['attributes']=_0x33e228[_0xe9f1('0x2f')][_0xe9f1('0x41')]?_0x33e228['attributes']:_0x26304d[_0xe9f1('0x30')];if(_0x9bd41e['query']['includeAll']){_0x33e228[_0xe9f1('0x3d')]=[{'all':!![]}];}_0x33e228=_[_0xe9f1('0x39')]({},_0x33e228,_0x9bd41e[_0xe9f1('0x3b')]);return db['Attachment'][_0xe9f1('0x42')](_0x33e228)[_0xe9f1('0x24')](handleEntityNotFound(_0x10dbe6,null))[_0xe9f1('0x24')](respondWithResult(_0x10dbe6,null))[_0xe9f1('0x43')](handleError(_0x10dbe6,null));};exports[_0xe9f1('0x44')]=function(_0x107476,_0x5a4981){var _0x1ddf0b={'where':{'id':_0x107476[_0xe9f1('0x45')]['id']}},_0x4fba21={};_0x4fba21[_0xe9f1('0x30')]=_[_0xe9f1('0x40')](db[_0xe9f1('0x3c')]['rawAttributes']);_0x1ddf0b['attributes']=_[_0xe9f1('0x2e')](_0x4fba21[_0xe9f1('0x30')],qs[_0xe9f1('0x31')](_0x107476[_0xe9f1('0x2d')]['fields']));_0x1ddf0b[_0xe9f1('0x2f')]=_0x1ddf0b[_0xe9f1('0x2f')][_0xe9f1('0x41')]?_0x1ddf0b[_0xe9f1('0x2f')]:_0x4fba21[_0xe9f1('0x30')];if(_0x107476[_0xe9f1('0x2d')][_0xe9f1('0x46')]){_0x1ddf0b['include']=[{'all':!![]}];}_0x1ddf0b=_[_0xe9f1('0x39')]({},_0x1ddf0b,_0x107476[_0xe9f1('0x3b')]);return db['Attachment'][_0xe9f1('0x42')](_0x1ddf0b)['then'](handleEntityNotFound(_0x5a4981,null))[_0xe9f1('0x24')](function(_0x14f2a2){if(_0x14f2a2){var _0x2b1167=_0x14f2a2[_0xe9f1('0x47')]({'plain':!![]});_0x2b1167=qs[_0xe9f1('0x48')](_0x2b1167,['id',_0xe9f1('0x49'),_0xe9f1('0x4a')]);_0x107476[_0xe9f1('0x4b')]=_[_0xe9f1('0x48')](_0x107476[_0xe9f1('0x4b')],['id',_0xe9f1('0x49'),_0xe9f1('0x4a')]);return db[_0xe9f1('0x3c')][_0xe9f1('0x4c')](_[_0xe9f1('0x39')](_0x2b1167,_0x107476[_0xe9f1('0x4b')]),{'include':_0x107476[_0xe9f1('0x2d')][_0xe9f1('0x46')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x5a4981,0xc9))[_0xe9f1('0x43')](handleError(_0x5a4981,null));};exports[_0xe9f1('0x23')]=function(_0x35d223,_0x72325){if(_0x35d223[_0xe9f1('0x4b')]['id']){delete _0x35d223[_0xe9f1('0x4b')]['id'];}return db[_0xe9f1('0x3c')][_0xe9f1('0x42')]({'where':{'id':_0x35d223[_0xe9f1('0x45')]['id']}})[_0xe9f1('0x24')](handleEntityNotFound(_0x72325,null))[_0xe9f1('0x24')](saveUpdates(_0x35d223[_0xe9f1('0x4b')],null))[_0xe9f1('0x24')](respondWithResult(_0x72325,null))[_0xe9f1('0x43')](handleError(_0x72325,null));};exports[_0xe9f1('0x25')]=function(_0x358970,_0x2f67cb){return db[_0xe9f1('0x3c')][_0xe9f1('0x42')]({'where':{'id':_0x358970[_0xe9f1('0x45')]['id']}})[_0xe9f1('0x24')](handleEntityNotFound(_0x2f67cb,null))[_0xe9f1('0x24')](removeEntity(_0x2f67cb,null))[_0xe9f1('0x43')](handleError(_0x2f67cb,null));};exports[_0xe9f1('0x4c')]=function(_0x13c89b,_0x1a1ce2,_0x5322e8){_0x13c89b['body'][_0xe9f1('0x26')]=_0x13c89b[_0xe9f1('0x4d')][_0xe9f1('0x4e')];_0x13c89b[_0xe9f1('0x4b')][_0xe9f1('0x4f')]=_0x13c89b[_0xe9f1('0x4d')]['filename'];_0x13c89b[_0xe9f1('0x4b')][_0xe9f1('0x2b')]=_0x13c89b['file'][_0xe9f1('0x50')];return db[_0xe9f1('0x3c')]['create'](_0x13c89b[_0xe9f1('0x4b')])[_0xe9f1('0x24')](respondWithResult(_0x1a1ce2,0xc9))['catch'](handleError(_0x1a1ce2,null));};exports[_0xe9f1('0x51')]=function(_0x4ca6f8,_0x4ffdd0,_0x401d58){return db[_0xe9f1('0x3c')][_0xe9f1('0x52')]({'where':{'id':_0x4ca6f8[_0xe9f1('0x45')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4ffdd0,null))[_0xe9f1('0x24')](function(_0x4b8888){if(_0x4b8888){var _0x464e9b=_0x4b8888[_0xe9f1('0x53')]!==null;var _0x378418=path[_0xe9f1('0x54')](config['root'],'server/files/attachments/');if(_0x464e9b){_0x378418=path[_0xe9f1('0x54')](_0x378418,_0xe9f1('0x55'));}var _0xb53a10=path[_0xe9f1('0x54')](_0x378418,_0x4b8888[_0xe9f1('0x4f')]);return _0x4ffdd0['download'](_0xb53a10);}})[_0xe9f1('0x43')](handleError(_0x4ffdd0,null));};
\ No newline at end of file
+var _0x347a=['stack','name','send','map','Attachment','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','show','params','rawAttributes','include','find','clone','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x4c5a5d,_0x59797c){var _0x3ad927=function(_0x2cabb9){while(--_0x2cabb9){_0x4c5a5d['push'](_0x4c5a5d['shift']());}};_0x3ad927(++_0x59797c);}(_0x347a,0x90));var _0xa347=function(_0xbd3a05,_0xe6c6b7){_0xbd3a05=_0xbd3a05-0x0;var _0x101f90=_0x347a[_0xbd3a05];return _0x101f90;};'use strict';var emlformat=require(_0xa347('0x0'));var rimraf=require(_0xa347('0x1'));var zipdir=require(_0xa347('0x2'));var jsonpatch=require(_0xa347('0x3'));var rp=require(_0xa347('0x4'));var moment=require(_0xa347('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa347('0x6'));var util=require(_0xa347('0x7'));var path=require(_0xa347('0x8'));var sox=require(_0xa347('0x9'));var csv=require(_0xa347('0xa'));var ejs=require(_0xa347('0xb'));var fs=require('fs');var fs_extra=require(_0xa347('0xc'));var _=require(_0xa347('0xd'));var squel=require(_0xa347('0xe'));var crypto=require('crypto');var jsforce=require(_0xa347('0xf'));var deskjs=require(_0xa347('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa347('0x11'));var Papa=require(_0xa347('0x12'));var Redis=require('ioredis');var authService=require(_0xa347('0x13'));var qs=require(_0xa347('0x14'));var as=require(_0xa347('0x15'));var hardwareService=require(_0xa347('0x16'));var logger=require(_0xa347('0x17'))('api');var utils=require(_0xa347('0x18'));var config=require(_0xa347('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa347('0x1a'))['db'];function respondWithStatusCode(_0xf8e12c,_0x5044de){_0x5044de=_0x5044de||0xcc;return function(_0x22361d){if(_0x22361d){return _0xf8e12c[_0xa347('0x1b')](_0x5044de);}return _0xf8e12c[_0xa347('0x1c')](_0x5044de)[_0xa347('0x1d')]();};}function respondWithResult(_0x3e2d62,_0x248b28){_0x248b28=_0x248b28||0xc8;return function(_0x2641a5){if(_0x2641a5){return _0x3e2d62['status'](_0x248b28)[_0xa347('0x1e')](_0x2641a5);}};}function respondWithFilteredResult(_0x5c4825,_0x687f81){return function(_0x1be092){if(_0x1be092){var _0xb4ce05=typeof _0x687f81[_0xa347('0x1f')]===_0xa347('0x20')&&typeof _0x687f81[_0xa347('0x21')]===_0xa347('0x20');var _0x2a5097=_0x1be092['count'];var _0x2a52c0=_0xb4ce05?0x0:_0x687f81[_0xa347('0x1f')];var _0x536fe2=_0xb4ce05?_0x1be092['count']:_0x687f81['offset']+_0x687f81[_0xa347('0x21')];var _0x10373a;if(_0x536fe2>=_0x2a5097){_0x536fe2=_0x2a5097;_0x10373a=0xc8;}else{_0x10373a=0xce;}_0x5c4825[_0xa347('0x1c')](_0x10373a);return _0x5c4825[_0xa347('0x22')](_0xa347('0x23'),_0x2a52c0+'-'+_0x536fe2+'/'+_0x2a5097)[_0xa347('0x1e')](_0x1be092);}return null;};}function patchUpdates(_0x287bd8){return function(_0x2de98d){try{jsonpatch[_0xa347('0x24')](_0x2de98d,_0x287bd8,!![]);}catch(_0x45113c){return BPromise[_0xa347('0x25')](_0x45113c);}return _0x2de98d[_0xa347('0x26')]();};}function saveUpdates(_0x4fd10e,_0x1b0ba2){return function(_0x72904a){if(_0x72904a){return _0x72904a[_0xa347('0x27')](_0x4fd10e)[_0xa347('0x28')](function(_0x28fb61){return _0x28fb61;});}return null;};}function removeEntity(_0x1f0d3e,_0x167e21){return function(_0xa6a323){if(_0xa6a323){return _0xa6a323[_0xa347('0x29')]()[_0xa347('0x28')](function(){_0x1f0d3e[_0xa347('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ad8b2,_0x2878c0){return function(_0x53056d){if(!_0x53056d){_0x2ad8b2[_0xa347('0x1b')](0x194);}return _0x53056d;};}function handleError(_0x3d92f5,_0x46829d){_0x46829d=_0x46829d||0x1f4;return function(_0x1c9e4c){logger['error'](_0x1c9e4c[_0xa347('0x2a')]);if(_0x1c9e4c[_0xa347('0x2b')]){delete _0x1c9e4c[_0xa347('0x2b')];}_0x3d92f5[_0xa347('0x1c')](_0x46829d)[_0xa347('0x2c')](_0x1c9e4c);};}exports['index']=function(_0x1d26ba,_0x3e61f1){var _0x2cdd79={},_0x288a69={},_0x427edd={'count':0x0,'rows':[]};var _0x34842d=_[_0xa347('0x2d')](db[_0xa347('0x2e')]['rawAttributes'],function(_0x4ef7d3){return{'name':_0x4ef7d3['fieldName'],'type':_0x4ef7d3[_0xa347('0x2f')]['key']};});_0x288a69[_0xa347('0x30')]=_[_0xa347('0x2d')](_0x34842d,_0xa347('0x2b'));_0x288a69[_0xa347('0x31')]=_[_0xa347('0x32')](_0x1d26ba[_0xa347('0x31')]);_0x288a69[_0xa347('0x33')]=_[_0xa347('0x34')](_0x288a69['model'],_0x288a69[_0xa347('0x31')]);_0x2cdd79['attributes']=_[_0xa347('0x34')](_0x288a69[_0xa347('0x30')],qs[_0xa347('0x35')](_0x1d26ba[_0xa347('0x31')][_0xa347('0x35')]));_0x2cdd79[_0xa347('0x36')]=_0x2cdd79[_0xa347('0x36')][_0xa347('0x37')]?_0x2cdd79['attributes']:_0x288a69[_0xa347('0x30')];if(!_0x1d26ba[_0xa347('0x31')][_0xa347('0x38')](_0xa347('0x39'))){_0x2cdd79[_0xa347('0x21')]=qs[_0xa347('0x21')](_0x1d26ba[_0xa347('0x31')]['limit']);_0x2cdd79[_0xa347('0x1f')]=qs[_0xa347('0x1f')](_0x1d26ba[_0xa347('0x31')][_0xa347('0x1f')]);}_0x2cdd79[_0xa347('0x3a')]=qs[_0xa347('0x3b')](_0x1d26ba['query'][_0xa347('0x3b')]);_0x2cdd79[_0xa347('0x3c')]=qs[_0xa347('0x33')](_[_0xa347('0x3d')](_0x1d26ba[_0xa347('0x31')],_0x288a69['filters']),_0x34842d);if(_0x1d26ba[_0xa347('0x31')][_0xa347('0x3e')]){_0x2cdd79[_0xa347('0x3c')]=_[_0xa347('0x3f')](_0x2cdd79['where'],{'$or':_[_0xa347('0x2d')](_0x34842d,function(_0x1be04b){if(_0x1be04b['type']!==_0xa347('0x40')){var _0x115d2a={};_0x115d2a[_0x1be04b[_0xa347('0x2b')]]={'$like':'%'+_0x1d26ba[_0xa347('0x31')][_0xa347('0x3e')]+'%'};return _0x115d2a;}})});}_0x2cdd79=_['merge']({},_0x2cdd79,_0x1d26ba[_0xa347('0x41')]);var _0x423b12={'where':_0x2cdd79[_0xa347('0x3c')]};return db[_0xa347('0x2e')]['count'](_0x423b12)[_0xa347('0x28')](function(_0x56d9d4){_0x427edd[_0xa347('0x42')]=_0x56d9d4;if(_0x1d26ba['query'][_0xa347('0x43')]){_0x2cdd79['include']=[{'all':!![]}];}return db[_0xa347('0x2e')]['findAll'](_0x2cdd79);})[_0xa347('0x28')](function(_0x535a97){_0x427edd[_0xa347('0x44')]=_0x535a97;return _0x427edd;})[_0xa347('0x28')](respondWithFilteredResult(_0x3e61f1,_0x2cdd79))[_0xa347('0x45')](handleError(_0x3e61f1,null));};exports[_0xa347('0x46')]=function(_0x3b7ea6,_0x2d96c6){var _0x5e23af={'raw':!![],'where':{'id':_0x3b7ea6[_0xa347('0x47')]['id']}},_0x2f5abc={};_0x2f5abc['model']=_[_0xa347('0x32')](db['Attachment'][_0xa347('0x48')]);_0x2f5abc[_0xa347('0x31')]=_[_0xa347('0x32')](_0x3b7ea6['query']);_0x2f5abc[_0xa347('0x33')]=_[_0xa347('0x34')](_0x2f5abc['model'],_0x2f5abc[_0xa347('0x31')]);_0x5e23af['attributes']=_[_0xa347('0x34')](_0x2f5abc['model'],qs['fields'](_0x3b7ea6['query'][_0xa347('0x35')]));_0x5e23af[_0xa347('0x36')]=_0x5e23af['attributes'][_0xa347('0x37')]?_0x5e23af[_0xa347('0x36')]:_0x2f5abc[_0xa347('0x30')];if(_0x3b7ea6[_0xa347('0x31')][_0xa347('0x43')]){_0x5e23af[_0xa347('0x49')]=[{'all':!![]}];}_0x5e23af=_['merge']({},_0x5e23af,_0x3b7ea6['options']);return db['Attachment'][_0xa347('0x4a')](_0x5e23af)[_0xa347('0x28')](handleEntityNotFound(_0x2d96c6,null))[_0xa347('0x28')](respondWithResult(_0x2d96c6,null))[_0xa347('0x45')](handleError(_0x2d96c6,null));};exports[_0xa347('0x4b')]=function(_0x333137,_0x5b7632){var _0x16af0c={'where':{'id':_0x333137[_0xa347('0x47')]['id']}},_0xca6645={};_0xca6645['model']=_[_0xa347('0x32')](db['Attachment'][_0xa347('0x48')]);_0x16af0c[_0xa347('0x36')]=_[_0xa347('0x34')](_0xca6645[_0xa347('0x30')],qs[_0xa347('0x35')](_0x333137[_0xa347('0x31')][_0xa347('0x35')]));_0x16af0c[_0xa347('0x36')]=_0x16af0c[_0xa347('0x36')][_0xa347('0x37')]?_0x16af0c[_0xa347('0x36')]:_0xca6645[_0xa347('0x30')];if(_0x333137[_0xa347('0x31')][_0xa347('0x43')]){_0x16af0c[_0xa347('0x49')]=[{'all':!![]}];}_0x16af0c=_['merge']({},_0x16af0c,_0x333137['options']);return db[_0xa347('0x2e')]['find'](_0x16af0c)[_0xa347('0x28')](handleEntityNotFound(_0x5b7632,null))[_0xa347('0x28')](function(_0x575e1c){if(_0x575e1c){var _0x5a83de=_0x575e1c[_0xa347('0x4c')]({'plain':!![]});_0x5a83de=qs[_0xa347('0x4d')](_0x5a83de,['id',_0xa347('0x4e'),_0xa347('0x4f')]);_0x333137[_0xa347('0x50')]=_[_0xa347('0x4d')](_0x333137[_0xa347('0x50')],['id',_0xa347('0x4e'),'updatedAt']);return db[_0xa347('0x2e')][_0xa347('0x51')](_[_0xa347('0x3f')](_0x5a83de,_0x333137[_0xa347('0x50')]),{'include':_0x333137[_0xa347('0x31')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xa347('0x28')](respondWithResult(_0x5b7632,0xc9))['catch'](handleError(_0x5b7632,null));};exports['update']=function(_0x4fa0ab,_0x171b8f){if(_0x4fa0ab[_0xa347('0x50')]['id']){delete _0x4fa0ab[_0xa347('0x50')]['id'];}return db[_0xa347('0x2e')][_0xa347('0x4a')]({'where':{'id':_0x4fa0ab[_0xa347('0x47')]['id']}})[_0xa347('0x28')](handleEntityNotFound(_0x171b8f,null))['then'](saveUpdates(_0x4fa0ab['body'],null))[_0xa347('0x28')](respondWithResult(_0x171b8f,null))[_0xa347('0x45')](handleError(_0x171b8f,null));};exports[_0xa347('0x29')]=function(_0x1022f5,_0x1b5cf6){return db[_0xa347('0x2e')][_0xa347('0x4a')]({'where':{'id':_0x1022f5[_0xa347('0x47')]['id']}})[_0xa347('0x28')](handleEntityNotFound(_0x1b5cf6,null))['then'](removeEntity(_0x1b5cf6,null))[_0xa347('0x45')](handleError(_0x1b5cf6,null));};exports['create']=function(_0x497f26,_0x50443b,_0x281fa2){_0x497f26[_0xa347('0x50')][_0xa347('0x2b')]=_0x497f26[_0xa347('0x52')][_0xa347('0x53')];_0x497f26['body'][_0xa347('0x54')]=_0x497f26['file'][_0xa347('0x55')];_0x497f26[_0xa347('0x50')][_0xa347('0x2f')]=_0x497f26[_0xa347('0x52')]['mimetype'];return db[_0xa347('0x2e')][_0xa347('0x51')](_0x497f26[_0xa347('0x50')])[_0xa347('0x28')](respondWithResult(_0x50443b,0xc9))['catch'](handleError(_0x50443b,null));};exports[_0xa347('0x56')]=function(_0xa50f98,_0xa90636,_0x5ad076){return db['Attachment'][_0xa347('0x57')]({'where':{'id':_0xa50f98['params']['id']},'raw':!![]})[_0xa347('0x28')](handleEntityNotFound(_0xa90636,null))['then'](function(_0x21e23c){if(_0x21e23c){var _0x546415=_0x21e23c[_0xa347('0x58')]!==null;var _0x4027e7=path[_0xa347('0x59')](config[_0xa347('0x5a')],_0xa347('0x5b'));if(_0x546415){_0x4027e7=path['join'](_0x4027e7,_0xa347('0x5c'));}var _0x37f2be=path[_0xa347('0x59')](_0x4027e7,_0x21e23c[_0xa347('0x54')]);return _0xa90636[_0xa347('0x56')](_0x37f2be);}})['catch'](handleError(_0xa90636,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 22a01e0..f68968f 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 _0x13be=['Attachment','attachments','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x4e1521,_0x19bb66){var _0x2dc388=function(_0x17ed4a){while(--_0x17ed4a){_0x4e1521['push'](_0x4e1521['shift']());}};_0x2dc388(++_0x19bb66);}(_0x13be,0xf2));var _0xe13b=function(_0x509cd3,_0x2f3032){_0x509cd3=_0x509cd3-0x0;var _0x3cdd06=_0x13be[_0x509cd3];return _0x3cdd06;};'use strict';var _=require(_0xe13b('0x0'));var util=require('util');var logger=require(_0xe13b('0x1'))(_0xe13b('0x2'));var moment=require('moment');var BPromise=require(_0xe13b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe13b('0x4'));var rimraf=require(_0xe13b('0x5'));var config=require(_0xe13b('0x6'));var attributes=require(_0xe13b('0x7'));module[_0xe13b('0x8')]=function(_0x49b29f,_0x57441b){return _0x49b29f[_0xe13b('0x9')](_0xe13b('0xa'),attributes,{'tableName':_0xe13b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfab9=['exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x295af8,_0x36c177){var _0x55ff03=function(_0x156e44){while(--_0x156e44){_0x295af8['push'](_0x295af8['shift']());}};_0x55ff03(++_0x36c177);}(_0xfab9,0x82));var _0x9fab=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfab9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9fab('0x0'));var util=require(_0x9fab('0x1'));var logger=require(_0x9fab('0x2'))(_0x9fab('0x3'));var moment=require(_0x9fab('0x4'));var BPromise=require(_0x9fab('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9fab('0x6'));var rimraf=require(_0x9fab('0x7'));var config=require(_0x9fab('0x8'));var attributes=require(_0x9fab('0x9'));module[_0x9fab('0xa')]=function(_0x44bb79,_0x293968){return _0x44bb79[_0x9fab('0xb')](_0x9fab('0xc'),attributes,{'tableName':_0x9fab('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 306cbe5..1dd7ae9 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 _0xf25a=['Attachment','create','body','options','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateAttachment'];(function(_0x3fb5eb,_0x5947a6){var _0x481291=function(_0x74e4e){while(--_0x74e4e){_0x3fb5eb['push'](_0x3fb5eb['shift']());}};_0x481291(++_0x5947a6);}(_0xf25a,0x195));var _0xaf25=function(_0x2a42ce,_0x38d859){_0x2a42ce=_0x2a42ce-0x0;var _0x4bce71=_0xf25a[_0x2a42ce];return _0x4bce71;};'use strict';var _=require(_0xaf25('0x0'));var util=require(_0xaf25('0x1'));var moment=require(_0xaf25('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf25('0x3'));var fs=require('fs');var Redis=require(_0xaf25('0x4'));var db=require(_0xaf25('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaf25('0x6'))(_0xaf25('0x7'));var config=require(_0xaf25('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xaf25('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48c6e6,_0x4b7258,_0x457ba5){return new BPromise(function(_0x41b3cd,_0x61e8d){return client['request'](_0x48c6e6,_0x457ba5)[_0xaf25('0xa')](function(_0x24ac0a){logger[_0xaf25('0xb')](_0xaf25('0xc'),_0x4b7258,_0xaf25('0xd'));logger['debug'](_0xaf25('0xe'),_0x4b7258,_0xaf25('0xd'),JSON[_0xaf25('0xf')](_0x24ac0a));if(_0x24ac0a[_0xaf25('0x10')]){if(_0x24ac0a['error']['code']===0x1f4){logger[_0xaf25('0x10')](_0xaf25('0xc'),_0x4b7258,_0x24ac0a[_0xaf25('0x10')][_0xaf25('0x11')]);return _0x61e8d(_0x24ac0a[_0xaf25('0x10')]['message']);}logger['error'](_0xaf25('0xc'),_0x4b7258,_0x24ac0a['error'][_0xaf25('0x11')]);return _0x41b3cd(_0x24ac0a[_0xaf25('0x10')][_0xaf25('0x11')]);}else{logger[_0xaf25('0xb')]('Attachment,\x20%s,\x20%s',_0x4b7258,_0xaf25('0xd'));_0x41b3cd(_0x24ac0a['result']['message']);}})[_0xaf25('0x12')](function(_0x4b396d){logger[_0xaf25('0x10')](_0xaf25('0xc'),_0x4b7258,_0x4b396d);_0x61e8d(_0x4b396d);});});}exports[_0xaf25('0x13')]=function(_0x2c815a){var _0x28bb0e=this;return new Promise(function(_0x10ed9a,_0x615537){return db[_0xaf25('0x14')][_0xaf25('0x15')](_0x2c815a[_0xaf25('0x16')],{'raw':_0x2c815a['options']?_0x2c815a[_0xaf25('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xaf25('0xa')](function(_0x396af4){logger[_0xaf25('0xb')](_0xaf25('0x13'),_0x2c815a);logger[_0xaf25('0x18')](_0xaf25('0x13'),_0x2c815a,JSON[_0xaf25('0xf')](_0x396af4));_0x10ed9a(_0x396af4);})[_0xaf25('0x12')](function(_0x2d8b66){logger[_0xaf25('0x10')](_0xaf25('0x13'),_0x2d8b66[_0xaf25('0x11')],_0x2c815a);_0x615537(_0x28bb0e[_0xaf25('0x10')](0x1f4,_0x2d8b66[_0xaf25('0x11')]));});});};
\ No newline at end of file
+var _0xf323=['create','options','raw','debug','CreateAttachment','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Attachment'];(function(_0x3fefe4,_0x2e4831){var _0x2d4204=function(_0x4b234a){while(--_0x4b234a){_0x3fefe4['push'](_0x3fefe4['shift']());}};_0x2d4204(++_0x2e4831);}(_0xf323,0x1c6));var _0x3f32=function(_0x2b5441,_0x1b1c92){_0x2b5441=_0x2b5441-0x0;var _0x1a7533=_0xf323[_0x2b5441];return _0x1a7533;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3f32('0x0'));var BPromise=require(_0x3f32('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f32('0x2'));var db=require(_0x3f32('0x3'))['db'];var utils=require(_0x3f32('0x4'));var logger=require(_0x3f32('0x5'))(_0x3f32('0x6'));var config=require('../../config/environment');var jayson=require(_0x3f32('0x7'));var client=jayson[_0x3f32('0x8')][_0x3f32('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1134e9,_0x5c9dc2,_0x567ab1){return new BPromise(function(_0x34b93e,_0x109af2){return client[_0x3f32('0xa')](_0x1134e9,_0x567ab1)[_0x3f32('0xb')](function(_0x22a9d3){logger[_0x3f32('0xc')](_0x3f32('0xd'),_0x5c9dc2,_0x3f32('0xe'));logger['debug'](_0x3f32('0xf'),_0x5c9dc2,_0x3f32('0xe'),JSON[_0x3f32('0x10')](_0x22a9d3));if(_0x22a9d3['error']){if(_0x22a9d3[_0x3f32('0x11')][_0x3f32('0x12')]===0x1f4){logger[_0x3f32('0x11')](_0x3f32('0xd'),_0x5c9dc2,_0x22a9d3['error']['message']);return _0x109af2(_0x22a9d3[_0x3f32('0x11')][_0x3f32('0x13')]);}logger['error'](_0x3f32('0xd'),_0x5c9dc2,_0x22a9d3[_0x3f32('0x11')][_0x3f32('0x13')]);return _0x34b93e(_0x22a9d3['error']['message']);}else{logger[_0x3f32('0xc')](_0x3f32('0xd'),_0x5c9dc2,_0x3f32('0xe'));_0x34b93e(_0x22a9d3[_0x3f32('0x14')]['message']);}})['catch'](function(_0x352010){logger[_0x3f32('0x11')](_0x3f32('0xd'),_0x5c9dc2,_0x352010);_0x109af2(_0x352010);});});}exports['CreateAttachment']=function(_0x5c36d9){var _0x1697c9=this;return new Promise(function(_0x19ec90,_0x8d70ee){return db[_0x3f32('0x15')][_0x3f32('0x16')](_0x5c36d9['body'],{'raw':_0x5c36d9[_0x3f32('0x17')]?_0x5c36d9[_0x3f32('0x17')][_0x3f32('0x18')]===undefined?!![]:![]:!![]})[_0x3f32('0xb')](function(_0xbc366b){logger[_0x3f32('0xc')]('CreateAttachment',_0x5c36d9);logger[_0x3f32('0x19')](_0x3f32('0x1a'),_0x5c36d9,JSON['stringify'](_0xbc366b));_0x19ec90(_0xbc366b);})[_0x3f32('0x1b')](function(_0x21cf2e){logger[_0x3f32('0x11')](_0x3f32('0x1a'),_0x21cf2e['message'],_0x5c36d9);_0x8d70ee(_0x1697c9[_0x3f32('0x11')](0x1f4,_0x21cf2e[_0x3f32('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 4daba56..2f7b474 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 _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x98c52d,_0x4136ec){var _0x295938=function(_0x588010){while(--_0x588010){_0x98c52d['push'](_0x98c52d['shift']());}};_0x295938(++_0x4136ec);}(_0xb10b,0x12a));var _0xbb10=function(_0xbaf094,_0x2f86ad){_0xbaf094=_0xbaf094-0x0;var _0x3974fd=_0xb10b[_0xbaf094];return _0x3974fd;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
+var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x22dba1,_0x452303){var _0x5252ff=function(_0xc58c3f){while(--_0xc58c3f){_0x22dba1['push'](_0x22dba1['shift']());}};_0x5252ff(++_0x452303);}(_0x2032,0xd9));var _0x2203=function(_0x2e6230,_0x35b650){_0x2e6230=_0x2e6230-0x0;var _0x443fa8=_0x2032[_0x2e6230];return _0x443fa8;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 0b8920b..0b2572a 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3772=['adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','salt','role','disabled','blocked','blockedAt','online','admin','agent','add','minutes','clearBlockUser','getLicense','catch','status','message','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','ad-login','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/environment','../../config/logger','api','undefined','baseDN','activedirectory','url','domain','Error\x20authenticate\x20%s:\x20%s','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3772,0x1d5));var _0x2377=function(_0x2d24e2,_0x38c3af){_0x2d24e2=_0x2d24e2-0x0;var _0x330f61=_0x3772[_0x2d24e2];return _0x330f61;};'use strict';var passport=require(_0x2377('0x0'));var LocalStrategy=require(_0x2377('0x1'))[_0x2377('0x2')];var moment=require(_0x2377('0x3'));var ActiveDirectory=require(_0x2377('0x4'));var BPromise=require(_0x2377('0x5'));var util=require(_0x2377('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x2377('0x7'));var utils=require('../../config/utils');var config=require(_0x2377('0x8'));var logger=require(_0x2377('0x9'))(_0x2377('0xa'));function isActiveDirectoryConfigured(_0x2be407){var _0x1835c9=![];if(typeof _0x2be407['activedirectory']!==_0x2377('0xb')){_0x1835c9=_0x2be407['activedirectory'][_0x2377('0xc')]&&_0x2be407[_0x2377('0xd')][_0x2377('0xe')]&&_0x2be407[_0x2377('0xd')][_0x2377('0xf')];}return _0x1835c9;}function adAuthenticate(_0x4ee5f3,_0x565503,_0x57b727){return new BPromise(function(_0x42916d,_0x1c6533){try{var _0xfa2a59=new ActiveDirectory(_0x4ee5f3);_0xfa2a59['authenticate'](_0x565503,_0x57b727,function(_0x39e596,_0x38240b){if(_0x39e596){logger['error'](_0x2377('0x10'),_0x565503,util['inspect'](_0x39e596,{'showHidden':![],'depth':null}));_0x1c6533('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x38240b){logger[_0x2377('0x11')](_0x2377('0x12'),_0x565503);_0x1c6533('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x42916d(_0x38240b);}});}catch(_0x4c2600){_0x1c6533(_0x4c2600);}});}function ActiveDirectoryAuthenticate(_0x202e61,_0x229cd5,_0x2aab47,_0x279e04){var _0x389a44,_0x2de57c;if(!isActiveDirectoryConfigured(config)){logger[_0x2377('0x11')](_0x2377('0x13'),_0x229cd5);return _0x279e04(null,![],{'message':_0x2377('0x14')});}return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x2377('0x15'),_0x2377('0x16')],'raw':!![]})[_0x2377('0x17')](function(_0x356443){_0x389a44=_0x356443;if(!_0x389a44['adSsoEnabled']){logger['error'](_0x2377('0x18'),_0x229cd5);throw new Error(_0x2377('0x14'));}return _0x202e61[_0x2377('0x19')]({'attributes':['id',_0x2377('0x1a'),_0x2377('0x1b'),_0x2377('0x1c'),_0x2377('0x1d'),_0x2377('0x1e'),_0x2377('0x1f'),_0x2377('0x20'),_0x2377('0x21')],'where':{'name':_0x229cd5,'role':{'$or':[_0x2377('0x22'),'user',_0x2377('0x23')]},'adSsoEnabled':!![]}});})[_0x2377('0x17')](function(_0x1d2b8d){if(!_0x1d2b8d||_0x1d2b8d&&_0x1d2b8d[_0x2377('0x1a')]!==_0x229cd5){throw new Error(_0x2377('0x14'));}_0x2de57c=_0x1d2b8d;var _0x5e90c5=_0x2de57c[_0x2377('0x1a')]+'@'+config[_0x2377('0xd')][_0x2377('0xf')];return adAuthenticate(config[_0x2377('0xd')],_0x5e90c5,_0x2aab47);})['then'](function(_0x7ff330){if(_0x2de57c[_0x2377('0x1e')]){throw new Error(_0x2377('0x14'));}if(_0x389a44['blockDuration']>0x0){if(_0x2de57c[_0x2377('0x1f')]){if(moment(_0x2de57c[_0x2377('0x20')])[_0x2377('0x24')](_0x389a44['blockDuration'],_0x2377('0x25'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x2377('0x26')](_0x2de57c,0x0,![],null)[_0x2377('0x17')](function(){return utils[_0x2377('0x27')](_0x2de57c);})['then'](function(){return _0x279e04(null,_0x2de57c);});}else{return utils[_0x2377('0x27')](_0x2de57c)[_0x2377('0x17')](function(){return _0x279e04(null,_0x2de57c);});}}else{return utils['getLicense'](_0x2de57c)['then'](function(){return _0x279e04(null,_0x2de57c);});}})[_0x2377('0x28')](function(_0xae1ad2){return _0x279e04(null,![],_0xae1ad2);});}function handleError(_0x3475fc,_0xf91a0d,_0x4059b4){return _0x3475fc[_0x2377('0x29')](_0xf91a0d||0x1f4)['send']({'message':_0x4059b4?_0x4059b4[_0x2377('0x2a')]||_0x4059b4:''});}exports['login']=function(_0x1a0d37,_0x5aa89f,_0x141427){passport['authenticate']('ad-login',function(_0x4ce1bd,_0x4531ab,_0x4f0b84){var _0x1c3551=_0x4ce1bd||_0x4f0b84;if(_0x1c3551){return handleError(_0x5aa89f,0x191,_0x1c3551);}if(!_0x4531ab){return handleError(_0x5aa89f,0x194,{'message':_0x2377('0x2b')});}else{var _0x44bb90={'payload':{'id':_0x4531ab['id'],'role':_0x4531ab[_0x2377('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0x2377('0x2c')](_0x44bb90)[_0x2377('0x17')](function(_0x2a44fa){_0x5aa89f[_0x2377('0x2d')]({'id':_0x4531ab['id'],'token':_0x2a44fa,'statusCall':'','isAlreadyLogged':_0x4531ab['online']});});}})(_0x1a0d37,_0x5aa89f,_0x141427);};passport[_0x2377('0x2e')](_0x2377('0x2f'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x340ed6,_0x32b836,_0x46ffd1){return ActiveDirectoryAuthenticate(db[_0x2377('0x30')],_0x340ed6,_0x32b836,_0x46ffd1);}));
\ No newline at end of file
+var _0xe3ef=['minutes','clearBlockUser','getLicense','catch','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blockedAt','online','user','agent','disabled','blocked'];(function(_0x21087c,_0x24aaf2){var _0x4b2f07=function(_0x52a5f1){while(--_0x52a5f1){_0x21087c['push'](_0x21087c['shift']());}};_0x4b2f07(++_0x24aaf2);}(_0xe3ef,0x1bb));var _0xfe3e=function(_0x3d0df3,_0x13464c){_0x3d0df3=_0x3d0df3-0x0;var _0x44e7e1=_0xe3ef[_0x3d0df3];return _0x44e7e1;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xfe3e('0x0'))[_0xfe3e('0x1')];var moment=require(_0xfe3e('0x2'));var ActiveDirectory=require(_0xfe3e('0x3'));var BPromise=require(_0xfe3e('0x4'));var util=require(_0xfe3e('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0xfe3e('0x6'));var config=require(_0xfe3e('0x7'));var logger=require(_0xfe3e('0x8'))(_0xfe3e('0x9'));function isActiveDirectoryConfigured(_0x5c5788){var _0x3d31a3=![];if(typeof _0x5c5788[_0xfe3e('0xa')]!==_0xfe3e('0xb')){_0x3d31a3=_0x5c5788['activedirectory'][_0xfe3e('0xc')]&&_0x5c5788['activedirectory'][_0xfe3e('0xd')]&&_0x5c5788[_0xfe3e('0xa')][_0xfe3e('0xe')];}return _0x3d31a3;}function adAuthenticate(_0x332127,_0x2fa473,_0x55d1db){return new BPromise(function(_0x2ba2f2,_0x32c34c){try{var _0x3ffe3e=new ActiveDirectory(_0x332127);_0x3ffe3e[_0xfe3e('0xf')](_0x2fa473,_0x55d1db,function(_0x3efe56,_0x3c2028){if(_0x3efe56){logger[_0xfe3e('0x10')](_0xfe3e('0x11'),_0x2fa473,util[_0xfe3e('0x12')](_0x3efe56,{'showHidden':![],'depth':null}));_0x32c34c(_0xfe3e('0x13'));}else if(!_0x3c2028){logger[_0xfe3e('0x10')](_0xfe3e('0x14'),_0x2fa473);_0x32c34c('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2ba2f2(_0x3c2028);}});}catch(_0x147880){_0x32c34c(_0x147880);}});}function ActiveDirectoryAuthenticate(_0x58e7ac,_0x452eda,_0x5c8f2f,_0x56c04c){var _0x1fd579,_0x11a470;if(!isActiveDirectoryConfigured(config)){logger[_0xfe3e('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x452eda);return _0x56c04c(null,![],{'message':_0xfe3e('0x13')});}return db[_0xfe3e('0x15')][_0xfe3e('0x16')]({'where':{'id':0x1},'attributes':[_0xfe3e('0x17'),_0xfe3e('0x18')],'raw':!![]})[_0xfe3e('0x19')](function(_0x75cf94){_0x1fd579=_0x75cf94;if(!_0x1fd579[_0xfe3e('0x17')]){logger[_0xfe3e('0x10')](_0xfe3e('0x1a'),_0x452eda);throw new Error(_0xfe3e('0x13'));}return _0x58e7ac['findOne']({'attributes':['id',_0xfe3e('0x1b'),_0xfe3e('0x1c'),_0xfe3e('0x1d'),_0xfe3e('0x1e'),'disabled','blocked',_0xfe3e('0x1f'),_0xfe3e('0x20')],'where':{'name':_0x452eda,'role':{'$or':['admin',_0xfe3e('0x21'),_0xfe3e('0x22')]},'adSsoEnabled':!![]}});})[_0xfe3e('0x19')](function(_0x38f82d){if(!_0x38f82d||_0x38f82d&&_0x38f82d['name']!==_0x452eda){throw new Error(_0xfe3e('0x13'));}_0x11a470=_0x38f82d;var _0x28aa94=_0x11a470[_0xfe3e('0x1b')]+'@'+config[_0xfe3e('0xa')][_0xfe3e('0xe')];return adAuthenticate(config[_0xfe3e('0xa')],_0x28aa94,_0x5c8f2f);})[_0xfe3e('0x19')](function(_0x42395a){if(_0x11a470[_0xfe3e('0x23')]){throw new Error(_0xfe3e('0x13'));}if(_0x1fd579[_0xfe3e('0x18')]>0x0){if(_0x11a470[_0xfe3e('0x24')]){if(moment(_0x11a470[_0xfe3e('0x1f')])['add'](_0x1fd579[_0xfe3e('0x18')],_0xfe3e('0x25'))>moment()){throw new Error(_0xfe3e('0x13'));}return utils[_0xfe3e('0x26')](_0x11a470,0x0,![],null)['then'](function(){return utils[_0xfe3e('0x27')](_0x11a470);})[_0xfe3e('0x19')](function(){return _0x56c04c(null,_0x11a470);});}else{return utils['getLicense'](_0x11a470)['then'](function(){return _0x56c04c(null,_0x11a470);});}}else{return utils[_0xfe3e('0x27')](_0x11a470)[_0xfe3e('0x19')](function(){return _0x56c04c(null,_0x11a470);});}})[_0xfe3e('0x28')](function(_0x199519){return _0x56c04c(null,![],_0x199519);});}function handleError(_0x24b723,_0x3376c8,_0x20a8e3){return _0x24b723[_0xfe3e('0x29')](_0x3376c8||0x1f4)['send']({'message':_0x20a8e3?_0x20a8e3[_0xfe3e('0x2a')]||_0x20a8e3:''});}exports[_0xfe3e('0x2b')]=function(_0x179b43,_0x1a5929,_0x5403ae){passport[_0xfe3e('0xf')](_0xfe3e('0x2c'),function(_0xe6dc54,_0x546aba,_0x4b90b4){var _0x696ee7=_0xe6dc54||_0x4b90b4;if(_0x696ee7){return handleError(_0x1a5929,0x191,_0x696ee7);}if(!_0x546aba){return handleError(_0x1a5929,0x194,{'message':_0xfe3e('0x2d')});}else{var _0x58e7ff={'payload':{'id':_0x546aba['id'],'role':_0x546aba[_0xfe3e('0x1e')]},'options':{'expiresIn':0x15180}};return authService[_0xfe3e('0x2e')](_0x58e7ff)[_0xfe3e('0x19')](function(_0x107c83){_0x1a5929[_0xfe3e('0x2f')]({'id':_0x546aba['id'],'token':_0x107c83,'statusCall':'','isAlreadyLogged':_0x546aba[_0xfe3e('0x20')]});});}})(_0x179b43,_0x1a5929,_0x5403ae);};passport['use'](_0xfe3e('0x2c'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x3fbc0b,_0x321b06,_0x5636bc){return ActiveDirectoryAuthenticate(db['User'],_0x3fbc0b,_0x321b06,_0x5636bc);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index a2a1b27..4abd547 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb8bf=['express','Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x2b4546,_0x4ca951){var _0x3d6ec5=function(_0x460361){while(--_0x460361){_0x2b4546['push'](_0x2b4546['shift']());}};_0x3d6ec5(++_0x4ca951);}(_0xb8bf,0xa8));var _0xfb8b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb8bf[_0x3947c9];return _0x2e7871;};'use strict';var express=require(_0xfb8b('0x0'));var router=express[_0xfb8b('0x1')]();var controller=require(_0xfb8b('0x2'));router[_0xfb8b('0x3')]('/',controller[_0xfb8b('0x4')]);module[_0xfb8b('0x5')]=router;
\ No newline at end of file
+var _0x1703=['exports','express','Router','./authActiveDirectory.controller','post'];(function(_0x4d8bcf,_0x2adfe7){var _0xe3ad0d=function(_0x2b32b5){while(--_0x2b32b5){_0x4d8bcf['push'](_0x4d8bcf['shift']());}};_0xe3ad0d(++_0x2adfe7);}(_0x1703,0x1be));var _0x3170=function(_0x11497b,_0x36d4af){_0x11497b=_0x11497b-0x0;var _0x1dd503=_0x1703[_0x11497b];return _0x1dd503;};'use strict';var express=require(_0x3170('0x0'));var router=express[_0x3170('0x1')]();var controller=require(_0x3170('0x2'));router[_0x3170('0x3')]('/',controller['login']);module[_0x3170('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 7ae9fa1..93e1f4a 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x7a54,0x106));var _0x47a5=function(_0x51087e,_0x5eb300){_0x51087e=_0x51087e-0x0;var _0x5e8a9=_0x7a54[_0x51087e];return _0x5e8a9;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x7a54,0x106));var _0x47a5=function(_0x2b25af,_0x405a1b){_0x2b25af=_0x2b25af-0x0;var _0x159edc=_0x7a54[_0x2b25af];return _0x159edc;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index d7f761b..5703d0f 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 _0x09d3=['express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','isMiddleware','exports'];(function(_0x16183a,_0x482430){var _0x1f03d8=function(_0x1a0dae){while(--_0x1a0dae){_0x16183a['push'](_0x16183a['shift']());}};_0x1f03d8(++_0x482430);}(_0x09d3,0xa5));var _0x309d=function(_0x5a5af6,_0x1859de){_0x5a5af6=_0x5a5af6-0x0;var _0xddbe9b=_0x09d3[_0x5a5af6];return _0xddbe9b;};'use strict';var express=require(_0x309d('0x0'));var passport=require(_0x309d('0x1'));var router=express[_0x309d('0x2')]();var controller=require(_0x309d('0x3'));var userController=require(_0x309d('0x4'));var authService=require(_0x309d('0x5'));router[_0x309d('0x6')]('/',controller[_0x309d('0x7')]);router['get'](_0x309d('0x8'),controller['callback'],authService[_0x309d('0x9')],userController[_0x309d('0x7')],authService['setTokenCookie']);module[_0x309d('0xa')]=router;
\ No newline at end of file
+var _0x37a6=['Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport'];(function(_0x4fc3cb,_0x3cd460){var _0x16c8ee=function(_0xe0d443){while(--_0xe0d443){_0x4fc3cb['push'](_0x4fc3cb['shift']());}};_0x16c8ee(++_0x3cd460);}(_0x37a6,0x8d));var _0x637a=function(_0x304102,_0x43e4f6){_0x304102=_0x304102-0x0;var _0x15e403=_0x37a6[_0x304102];return _0x15e403;};'use strict';var express=require(_0x637a('0x0'));var passport=require(_0x637a('0x1'));var router=express[_0x637a('0x2')]();var controller=require(_0x637a('0x3'));var userController=require(_0x637a('0x4'));var authService=require(_0x637a('0x5'));router[_0x637a('0x6')]('/',controller[_0x637a('0x7')]);router[_0x637a('0x6')](_0x637a('0x8'),controller[_0x637a('0x9')],authService[_0x637a('0xa')],userController['login'],authService[_0x637a('0xb')]);module[_0x637a('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 91f286a..2ef2f12 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 _0xbf7e=['name','password','salt','blocked','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','blockDuration','clearBlockUser','add','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','\x22%s\x22\x20<%s>','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','role','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','use','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../components/auth/service','../../config/utils','client','findOne','allowedLoginAttempts','then'];(function(_0x2688d5,_0x45db72){var _0x372637=function(_0x51c20d){while(--_0x51c20d){_0x2688d5['push'](_0x2688d5['shift']());}};_0x372637(++_0x45db72);}(_0xbf7e,0x183));var _0xebf7=function(_0x277522,_0x43d899){_0x277522=_0x277522-0x0;var _0x36c2de=_0xbf7e[_0x277522];return _0x36c2de;};'use strict';var util=require(_0xebf7('0x0'));var passport=require(_0xebf7('0x1'));var LocalStrategy=require(_0xebf7('0x2'))[_0xebf7('0x3')];var jayson=require(_0xebf7('0x4'));var _=require(_0xebf7('0x5'));var rs=require('randomstring');var moment=require(_0xebf7('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0xebf7('0x7'));var utils=require(_0xebf7('0x8'));var client=jayson[_0xebf7('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x44df47,_0x4368af,_0x1f0698,_0x712e67){var _0x4c6fd8,_0x37fc0d;return db['Setting'][_0xebf7('0xa')]({'where':{'id':0x1},'attributes':[_0xebf7('0xb'),'blockDuration'],'raw':!![]})[_0xebf7('0xc')](function(_0x3ccb9d){_0x4c6fd8=_0x3ccb9d;return _0x44df47[_0xebf7('0xa')]({'attributes':['id',_0xebf7('0xd'),_0xebf7('0xe'),_0xebf7('0xf'),'role','disabled',_0xebf7('0x10'),_0xebf7('0x11'),_0xebf7('0x12')],'where':{'name':_0x4368af,'role':{'$or':[_0xebf7('0x13'),'user',_0xebf7('0x14')]}}});})[_0xebf7('0xc')](function(_0x105a46){if(!_0x105a46||_0x105a46&&_0x105a46[_0xebf7('0xd')]!==_0x4368af){throw new Error(_0xebf7('0x15'));}else{_0x37fc0d=_0x105a46;return _0x37fc0d;}})[_0xebf7('0xc')](function(){_0x37fc0d[_0xebf7('0x16')](_0x1f0698,function(_0x5bb6bf,_0x5d97d4){var _0x13c5b6=_0x37fc0d[_0xebf7('0x12')]+0x1;if(_0x5bb6bf){return _0x712e67(_0x5bb6bf);}else if(!_0x5d97d4){if(_0x37fc0d[_0xebf7('0x17')]){return _0x712e67(null,![],{'message':_0xebf7('0x15')});}else if(_0x4c6fd8[_0xebf7('0xb')]>0x0){if(_0x37fc0d[_0xebf7('0x10')]){if(_0x4c6fd8[_0xebf7('0x18')]>0x0){if(moment(_0x37fc0d[_0xebf7('0x11')])['add'](_0x4c6fd8[_0xebf7('0x18')],'minutes')>moment()){return _0x712e67(null,![],{'message':_0xebf7('0x15')});}else{return utils[_0xebf7('0x19')](_0x37fc0d,_0x13c5b6,![],null)[_0xebf7('0xc')](function(){return _0x712e67(null,![],{'message':_0xebf7('0x15')});});}}else{return _0x712e67(null,![],{'message':_0xebf7('0x15')});}}else{if(_0x13c5b6>=_0x4c6fd8[_0xebf7('0xb')]){return utils[_0xebf7('0x19')](_0x37fc0d,0x0,!![],moment())[_0xebf7('0xc')](function(){return _0x712e67(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xebf7('0x19')](_0x37fc0d,_0x13c5b6,![],null)[_0xebf7('0xc')](function(){return _0x712e67(null,![],{'message':_0xebf7('0x15')});});}}}else{return _0x712e67(null,![],{'message':_0xebf7('0x15')});}}else{if(_0x37fc0d[_0xebf7('0x17')]){return _0x712e67(null,![],{'message':_0xebf7('0x15')});}else if(_0x4c6fd8[_0xebf7('0xb')]>0x0){if(_0x37fc0d[_0xebf7('0x10')]){if(_0x4c6fd8[_0xebf7('0x18')]>0x0){if(moment(_0x37fc0d[_0xebf7('0x11')])[_0xebf7('0x1a')](_0x4c6fd8[_0xebf7('0x18')],_0xebf7('0x1b'))>moment()){return _0x712e67(null,![],{'message':_0xebf7('0x15')});}else{return utils[_0xebf7('0x19')](_0x37fc0d,0x0,![],null)[_0xebf7('0xc')](function(){return utils[_0xebf7('0x1c')](_0x37fc0d);})[_0xebf7('0xc')](function(){return _0x712e67(null,_0x37fc0d);});}}else{return _0x712e67(null,![],{'message':_0xebf7('0x15')});}}else{return utils['clearBlockUser'](_0x37fc0d,0x0,![],null)['then'](function(){return utils[_0xebf7('0x1c')](_0x37fc0d);})['then'](function(){return _0x712e67(null,_0x37fc0d);})[_0xebf7('0x1d')](function(_0x16ed6a){return _0x712e67(null,![],_0x16ed6a);});}}else{if(_0x37fc0d[_0xebf7('0x10')]){return _0x712e67(null,![],{'message':_0xebf7('0x15')});}else{return utils[_0xebf7('0x1c')](_0x37fc0d)[_0xebf7('0xc')](function(){return _0x712e67(null,_0x37fc0d);});}}}});})[_0xebf7('0x1d')](function(_0xfa4e80){return _0x712e67(null,![],_0xfa4e80);});}function sendServiceMail(_0x27cb46){return db[_0xebf7('0x1e')][_0xebf7('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xebf7('0xd'),_0xebf7('0x20')],'include':[{'model':db[_0xebf7('0x21')],'as':_0xebf7('0x22'),'include':[{'model':db[_0xebf7('0x23')],'as':_0xebf7('0x23')}]}]})[_0xebf7('0xc')](function(_0x2fdf4d){if(!_0x2fdf4d){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x289474=_0x2fdf4d[_0xebf7('0x24')]();var _0x21f6a8={'account':_0x289474,'message':_[_0xebf7('0x25')]({'from':util['format'](_0xebf7('0x26'),_0x2fdf4d['name'],_0x2fdf4d[_0xebf7('0x20')]||_0x2fdf4d[_0xebf7('0x22')]['user'])},_0x27cb46)};return client['request'](_0xebf7('0x27'),_0x21f6a8);})[_0xebf7('0xc')](function(_0x599b27){if(_0x599b27[_0xebf7('0x28')]){throw new Error(util[_0xebf7('0x29')](_0xebf7('0x2a'),_0x599b27[_0xebf7('0x28')][_0xebf7('0x2b')]||JSON[_0xebf7('0x2c')](_0x599b27['error'])));}return!![];});}function handleError(_0xd6e1e8,_0x27fe82,_0x397abf){return _0xd6e1e8[_0xebf7('0x2d')](_0x27fe82||0x1f4)[_0xebf7('0x2e')]({'message':_0x397abf?_0x397abf[_0xebf7('0x2b')]||_0x397abf:''});}exports[_0xebf7('0x2f')]=function(_0x21a22d,_0xf1b194,_0xbea225){passport[_0xebf7('0x16')](_0xebf7('0x30'),function(_0x300548,_0x5ace5c,_0x405d6c){var _0x1d9b2b=_0x300548||_0x405d6c;if(_0x1d9b2b){return handleError(_0xf1b194,0x191,_0x1d9b2b);}if(!_0x5ace5c){return handleError(_0xf1b194,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3f54ff={'payload':{'id':_0x5ace5c['id'],'role':_0x5ace5c[_0xebf7('0x31')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x3f54ff)[_0xebf7('0xc')](function(_0x4685d8){_0xf1b194[_0xebf7('0x32')]({'id':_0x5ace5c['id'],'token':_0x4685d8,'statusCall':'','isAlreadyLogged':_0x5ace5c[_0xebf7('0x33')]});});}})(_0x21a22d,_0xf1b194,_0xbea225);};exports[_0xebf7('0x34')]=function(_0x37291c,_0x50faf7){if(!_0x37291c[_0xebf7('0x35')][_0xebf7('0x20')]){return handleError(_0x50faf7,0x1f4,{'message':_0xebf7('0x36')});}var _0x1633aa=rs[_0xebf7('0x37')]();_0x37291c[_0xebf7('0x35')][_0xebf7('0x20')]=_0x37291c[_0xebf7('0x35')][_0xebf7('0x20')][_0xebf7('0x38')]()[_0xebf7('0x39')]();var _0x29b9c9;return db['Setting'][_0xebf7('0xa')]({'where':{'id':0x1},'attributes':[_0xebf7('0xb'),_0xebf7('0x18')],'raw':!![]})['then'](function(_0x3deb2a){_0x29b9c9=_0x3deb2a;return db[_0xebf7('0x3a')][_0xebf7('0x1f')]({'where':{'email':_0x37291c['body'][_0xebf7('0x20')]}});})[_0xebf7('0xc')](function(_0x52ea54){if(!_0x52ea54){throw new Error(_0xebf7('0x3b'));}if(_0x52ea54[_0xebf7('0x17')]){throw new Error(_0xebf7('0x3c'));}if(_0x52ea54[_0xebf7('0x10')]){if(moment(_0x52ea54[_0xebf7('0x11')])[_0xebf7('0x1a')](_0x29b9c9[_0xebf7('0x18')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x52ea54[_0xebf7('0x10')]=![];_0x52ea54['blockedAt']=null;}}_0x52ea54[_0xebf7('0x3d')]=_0x1633aa;_0x52ea54[_0xebf7('0x3e')]=Date[_0xebf7('0x3f')]()+0x36ee80;return _0x52ea54[_0xebf7('0x40')]();})[_0xebf7('0xc')](function(){return sendServiceMail({'to':_0x37291c['body']['email'],'subject':_0xebf7('0x41'),'text':_0xebf7('0x42')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xebf7('0x43')+_0x37291c['headers'][_0xebf7('0x44')]+_0xebf7('0x45')+_0x1633aa+'\x0a\x0a'+_0xebf7('0x46')});})[_0xebf7('0xc')](function(){_0x50faf7['status'](0xc8)[_0xebf7('0x2e')]({'message':'Reset\x20Email\x20sent!'});})[_0xebf7('0x1d')](function(_0x764f7d){return handleError(_0x50faf7,0x1f4,_0x764f7d);});};exports[_0xebf7('0x47')]=function(_0x2a3cf7,_0x3efa79){return db['User'][_0xebf7('0x1f')]({'where':{'resetPasswordToken':_0x2a3cf7[_0xebf7('0x48')]['token'],'resetPasswordExpires':{'$gt':Date[_0xebf7('0x3f')]()}}})[_0xebf7('0xc')](function(_0x5401bf){if(!_0x5401bf){throw new Error(_0xebf7('0x49'));}return db['Setting'][_0xebf7('0xa')]({'attributes':['id','securePassword','enforcePasswordHistory',_0xebf7('0x4a')]})[_0xebf7('0xc')](function(_0x12aa0f){if(_0x12aa0f[_0xebf7('0x4b')])authService[_0xebf7('0x4c')](_0x2a3cf7['body']['password']);if(!_0x12aa0f['enforcePasswordHistory']||!_0x5401bf[_0xebf7('0x4d')])return _0x5401bf;authService[_0xebf7('0x4e')](_0x2a3cf7[_0xebf7('0x35')]['password'],_0x5401bf[_0xebf7('0x4d')],_0x12aa0f['passwordHistoryLimit']);return _0x5401bf;})['then'](function(){_0x5401bf[_0xebf7('0xe')]=_0x2a3cf7['body'][_0xebf7('0xe')];_0x5401bf[_0xebf7('0x3d')]=null;_0x5401bf['resetPasswordExpires']=null;return _0x5401bf[_0xebf7('0x40')]();});})[_0xebf7('0xc')](function(){_0x3efa79[_0xebf7('0x2d')](0xc8)[_0xebf7('0x2e')]({'message':'Password\x20reset!'});})[_0xebf7('0x1d')](function(_0x3727ff){return handleError(_0x3efa79,0x1f4,_0x3727ff);});};passport[_0xebf7('0x4f')](_0xebf7('0x30'),new LocalStrategy({'usernameField':'name','passwordField':_0xebf7('0xe')},function(_0x331942,_0x5a930e,_0x419217){return localAuthenticate(db[_0xebf7('0x3a')],_0x331942,_0x5a930e,_0x419217);}));
\ No newline at end of file
+var _0xb476=['token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','resetPasswordToken','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','findOne','allowedLoginAttempts','then','password','role','disabled','blocked','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blockedAt','add','minutes','clearBlockUser','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','user','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','User'];(function(_0x245b11,_0x37bb3f){var _0x434d15=function(_0xae0870){while(--_0xae0870){_0x245b11['push'](_0x245b11['shift']());}};_0x434d15(++_0x37bb3f);}(_0xb476,0x9e));var _0x6b47=function(_0x24fa1a,_0x16d9c2){_0x24fa1a=_0x24fa1a-0x0;var _0xc5621f=_0xb476[_0x24fa1a];return _0xc5621f;};'use strict';var util=require(_0x6b47('0x0'));var passport=require(_0x6b47('0x1'));var LocalStrategy=require(_0x6b47('0x2'))[_0x6b47('0x3')];var jayson=require(_0x6b47('0x4'));var _=require(_0x6b47('0x5'));var rs=require(_0x6b47('0x6'));var moment=require(_0x6b47('0x7'));var db=require(_0x6b47('0x8'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x6b47('0x9'));var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0xa542b6,_0x3cf785,_0x50bef6,_0x1f0375){var _0x42eff5,_0x3aa43b;return db['Setting'][_0x6b47('0xa')]({'where':{'id':0x1},'attributes':[_0x6b47('0xb'),'blockDuration'],'raw':!![]})[_0x6b47('0xc')](function(_0x579160){_0x42eff5=_0x579160;return _0xa542b6[_0x6b47('0xa')]({'attributes':['id','name',_0x6b47('0xd'),'salt',_0x6b47('0xe'),_0x6b47('0xf'),_0x6b47('0x10'),'blockedAt','loginAttempts'],'where':{'name':_0x3cf785,'role':{'$or':['admin','user',_0x6b47('0x11')]}}});})['then'](function(_0x531ac7){if(!_0x531ac7||_0x531ac7&&_0x531ac7[_0x6b47('0x12')]!==_0x3cf785){throw new Error(_0x6b47('0x13'));}else{_0x3aa43b=_0x531ac7;return _0x3aa43b;}})[_0x6b47('0xc')](function(){_0x3aa43b['authenticate'](_0x50bef6,function(_0x3c67be,_0x203952){var _0x2a9cd9=_0x3aa43b['loginAttempts']+0x1;if(_0x3c67be){return _0x1f0375(_0x3c67be);}else if(!_0x203952){if(_0x3aa43b['disabled']){return _0x1f0375(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x42eff5[_0x6b47('0xb')]>0x0){if(_0x3aa43b[_0x6b47('0x10')]){if(_0x42eff5[_0x6b47('0x14')]>0x0){if(moment(_0x3aa43b[_0x6b47('0x15')])[_0x6b47('0x16')](_0x42eff5[_0x6b47('0x14')],_0x6b47('0x17'))>moment()){return _0x1f0375(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x3aa43b,_0x2a9cd9,![],null)[_0x6b47('0xc')](function(){return _0x1f0375(null,![],{'message':_0x6b47('0x13')});});}}else{return _0x1f0375(null,![],{'message':_0x6b47('0x13')});}}else{if(_0x2a9cd9>=_0x42eff5[_0x6b47('0xb')]){return utils[_0x6b47('0x18')](_0x3aa43b,0x0,!![],moment())[_0x6b47('0xc')](function(){return _0x1f0375(null,![],{'message':_0x6b47('0x13')});});}else{return utils[_0x6b47('0x18')](_0x3aa43b,_0x2a9cd9,![],null)[_0x6b47('0xc')](function(){return _0x1f0375(null,![],{'message':_0x6b47('0x13')});});}}}else{return _0x1f0375(null,![],{'message':_0x6b47('0x13')});}}else{if(_0x3aa43b[_0x6b47('0xf')]){return _0x1f0375(null,![],{'message':_0x6b47('0x13')});}else if(_0x42eff5['allowedLoginAttempts']>0x0){if(_0x3aa43b[_0x6b47('0x10')]){if(_0x42eff5['blockDuration']>0x0){if(moment(_0x3aa43b['blockedAt'])[_0x6b47('0x16')](_0x42eff5[_0x6b47('0x14')],'minutes')>moment()){return _0x1f0375(null,![],{'message':_0x6b47('0x13')});}else{return utils[_0x6b47('0x18')](_0x3aa43b,0x0,![],null)['then'](function(){return utils[_0x6b47('0x19')](_0x3aa43b);})['then'](function(){return _0x1f0375(null,_0x3aa43b);});}}else{return _0x1f0375(null,![],{'message':_0x6b47('0x13')});}}else{return utils['clearBlockUser'](_0x3aa43b,0x0,![],null)[_0x6b47('0xc')](function(){return utils[_0x6b47('0x19')](_0x3aa43b);})['then'](function(){return _0x1f0375(null,_0x3aa43b);})['catch'](function(_0x248419){return _0x1f0375(null,![],_0x248419);});}}else{if(_0x3aa43b['blocked']){return _0x1f0375(null,![],{'message':_0x6b47('0x13')});}else{return utils[_0x6b47('0x19')](_0x3aa43b)['then'](function(){return _0x1f0375(null,_0x3aa43b);});}}}});})[_0x6b47('0x1a')](function(_0x58b83d){return _0x1f0375(null,![],_0x58b83d);});}function sendServiceMail(_0x4ba711){return db['MailAccount'][_0x6b47('0x1b')]({'where':{'service':!![]},'attributes':['id','name',_0x6b47('0x1c')],'include':[{'model':db[_0x6b47('0x1d')],'as':_0x6b47('0x1e'),'include':[{'model':db[_0x6b47('0x1f')],'as':_0x6b47('0x1f')}]}]})[_0x6b47('0xc')](function(_0x34efcd){if(!_0x34efcd){throw new Error(_0x6b47('0x20'));}var _0x2a6449=_0x34efcd[_0x6b47('0x21')]();var _0x430105={'account':_0x2a6449,'message':_['merge']({'from':util[_0x6b47('0x22')]('\x22%s\x22\x20<%s>',_0x34efcd[_0x6b47('0x12')],_0x34efcd[_0x6b47('0x1c')]||_0x34efcd[_0x6b47('0x1e')][_0x6b47('0x23')])},_0x4ba711)};return client[_0x6b47('0x24')]('SendMail',_0x430105);})['then'](function(_0x2dcf95){if(_0x2dcf95[_0x6b47('0x25')]){throw new Error(util[_0x6b47('0x22')](_0x6b47('0x26'),_0x2dcf95[_0x6b47('0x25')][_0x6b47('0x27')]||JSON['stringify'](_0x2dcf95[_0x6b47('0x25')])));}return!![];});}function handleError(_0x4d75d0,_0x5c07b4,_0x3b124c){return _0x4d75d0[_0x6b47('0x28')](_0x5c07b4||0x1f4)[_0x6b47('0x29')]({'message':_0x3b124c?_0x3b124c[_0x6b47('0x27')]||_0x3b124c:''});}exports[_0x6b47('0x2a')]=function(_0x2cebf7,_0x556cf2,_0x2eea78){passport[_0x6b47('0x2b')](_0x6b47('0x2c'),function(_0x19cd56,_0x2a44a3,_0x1ce5d3){var _0x2a7146=_0x19cd56||_0x1ce5d3;if(_0x2a7146){return handleError(_0x556cf2,0x191,_0x2a7146);}if(!_0x2a44a3){return handleError(_0x556cf2,0x194,{'message':_0x6b47('0x2d')});}else{var _0x35430a={'payload':{'id':_0x2a44a3['id'],'role':_0x2a44a3['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x35430a)['then'](function(_0x470f3a){_0x556cf2[_0x6b47('0x2e')]({'id':_0x2a44a3['id'],'token':_0x470f3a,'statusCall':'','isAlreadyLogged':_0x2a44a3[_0x6b47('0x2f')]});});}})(_0x2cebf7,_0x556cf2,_0x2eea78);};exports[_0x6b47('0x30')]=function(_0x32df0b,_0x143007){if(!_0x32df0b[_0x6b47('0x31')][_0x6b47('0x1c')]){return handleError(_0x143007,0x1f4,{'message':_0x6b47('0x32')});}var _0xc8813=rs[_0x6b47('0x33')]();_0x32df0b['body'][_0x6b47('0x1c')]=_0x32df0b[_0x6b47('0x31')][_0x6b47('0x1c')][_0x6b47('0x34')]()[_0x6b47('0x35')]();var _0x1056b2;return db[_0x6b47('0x36')][_0x6b47('0xa')]({'where':{'id':0x1},'attributes':[_0x6b47('0xb'),_0x6b47('0x14')],'raw':!![]})[_0x6b47('0xc')](function(_0x2fb127){_0x1056b2=_0x2fb127;return db['User'][_0x6b47('0x1b')]({'where':{'email':_0x32df0b[_0x6b47('0x31')][_0x6b47('0x1c')]}});})[_0x6b47('0xc')](function(_0x576b3b){if(!_0x576b3b){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x576b3b[_0x6b47('0xf')]){throw new Error(_0x6b47('0x37'));}if(_0x576b3b[_0x6b47('0x10')]){if(moment(_0x576b3b['blockedAt'])[_0x6b47('0x16')](_0x1056b2['blockDuration'],'minutes')>moment()){throw new Error(_0x6b47('0x38'));}else{_0x576b3b[_0x6b47('0x10')]=![];_0x576b3b['blockedAt']=null;}}_0x576b3b['resetPasswordToken']=_0xc8813;_0x576b3b[_0x6b47('0x39')]=Date[_0x6b47('0x3a')]()+0x36ee80;return _0x576b3b[_0x6b47('0x3b')]();})[_0x6b47('0xc')](function(){return sendServiceMail({'to':_0x32df0b['body']['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x6b47('0x3c')+_0x6b47('0x3d')+_0x32df0b['headers'][_0x6b47('0x3e')]+'/reset/'+_0xc8813+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x6b47('0xc')](function(){_0x143007['status'](0xc8)[_0x6b47('0x29')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x3155d1){return handleError(_0x143007,0x1f4,_0x3155d1);});};exports['reset']=function(_0x34d277,_0x3f164f){return db[_0x6b47('0x3f')][_0x6b47('0x1b')]({'where':{'resetPasswordToken':_0x34d277['params'][_0x6b47('0x40')],'resetPasswordExpires':{'$gt':Date[_0x6b47('0x3a')]()}}})[_0x6b47('0xc')](function(_0x23750f){if(!_0x23750f){throw new Error(_0x6b47('0x41'));}return db[_0x6b47('0x36')][_0x6b47('0xa')]({'attributes':['id',_0x6b47('0x42'),_0x6b47('0x43'),_0x6b47('0x44')]})[_0x6b47('0xc')](function(_0x38fe1c){if(_0x38fe1c[_0x6b47('0x42')])authService[_0x6b47('0x45')](_0x34d277['body'][_0x6b47('0xd')]);if(!_0x38fe1c[_0x6b47('0x43')]||!_0x23750f[_0x6b47('0x46')])return _0x23750f;authService['validatePasswordHistory'](_0x34d277['body'][_0x6b47('0xd')],_0x23750f[_0x6b47('0x46')],_0x38fe1c['passwordHistoryLimit']);return _0x23750f;})[_0x6b47('0xc')](function(){_0x23750f['password']=_0x34d277[_0x6b47('0x31')][_0x6b47('0xd')];_0x23750f[_0x6b47('0x47')]=null;_0x23750f[_0x6b47('0x39')]=null;return _0x23750f['save']();});})[_0x6b47('0xc')](function(){_0x3f164f[_0x6b47('0x28')](0xc8)[_0x6b47('0x29')]({'message':_0x6b47('0x48')});})[_0x6b47('0x1a')](function(_0x4203b4){return handleError(_0x3f164f,0x1f4,_0x4203b4);});};passport[_0x6b47('0x49')]('local-login',new LocalStrategy({'usernameField':_0x6b47('0x12'),'passwordField':_0x6b47('0xd')},function(_0x25ab8a,_0x590160,_0x5041c7){return localAuthenticate(db[_0x6b47('0x3f')],_0x25ab8a,_0x590160,_0x5041c7);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 188b5ec..85201bf 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 _0x91ad=['/forgot','forgot','/reset/:token','reset','exports','post'];(function(_0x4f8d61,_0x29eff0){var _0x3bc078=function(_0x4c7203){while(--_0x4c7203){_0x4f8d61['push'](_0x4f8d61['shift']());}};_0x3bc078(++_0x29eff0);}(_0x91ad,0xb9));var _0xd91a=function(_0x2c9b13,_0x4fa585){_0x2c9b13=_0x2c9b13-0x0;var _0x351b56=_0x91ad[_0x2c9b13];return _0x351b56;};'use strict';var express=require('express');var router=express['Router']();var controller=require('./authLocal.controller');router['post']('/',controller['login']);router[_0xd91a('0x0')](_0xd91a('0x1'),controller[_0xd91a('0x2')]);router[_0xd91a('0x0')](_0xd91a('0x3'),controller[_0xd91a('0x4')]);module[_0xd91a('0x5')]=router;
\ No newline at end of file
+var _0x8cc5=['login','/forgot','forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller','post'];(function(_0x4c250d,_0x3acd62){var _0x285449=function(_0x437583){while(--_0x437583){_0x4c250d['push'](_0x4c250d['shift']());}};_0x285449(++_0x3acd62);}(_0x8cc5,0xe2));var _0x58cc=function(_0x222ca9,_0x5a6023){_0x222ca9=_0x222ca9-0x0;var _0x2eb5c0=_0x8cc5[_0x222ca9];return _0x2eb5c0;};'use strict';var express=require(_0x58cc('0x0'));var router=express[_0x58cc('0x1')]();var controller=require(_0x58cc('0x2'));router[_0x58cc('0x3')]('/',controller[_0x58cc('0x4')]);router[_0x58cc('0x3')](_0x58cc('0x5'),controller[_0x58cc('0x6')]);router[_0x58cc('0x3')](_0x58cc('0x7'),controller[_0x58cc('0x8')]);module[_0x58cc('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 40ae4dc..ba334cd 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 _0xbaf9=['STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x443f2e,_0x26e706){var _0x17070d=function(_0x595f67){while(--_0x595f67){_0x443f2e['push'](_0x443f2e['shift']());}};_0x17070d(++_0x26e706);}(_0xbaf9,0x97));var _0x9baf=function(_0x48b94d,_0x2f1b95){_0x48b94d=_0x48b94d-0x0;var _0x30ca8f=_0xbaf9[_0x48b94d];return _0x30ca8f;};'use strict';var Sequelize=require(_0x9baf('0x0'));module['exports']={'name':{'type':Sequelize[_0x9baf('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x9baf('0x1')]},'description':{'type':Sequelize[_0x9baf('0x1')]},'status':{'type':Sequelize[_0x9baf('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9baf('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x7e3d=['sequelize','STRING','BOOLEAN'];(function(_0x36e265,_0x4b41d0){var _0x4c46f0=function(_0x266fda){while(--_0x266fda){_0x36e265['push'](_0x36e265['shift']());}};_0x4c46f0(++_0x4b41d0);}(_0x7e3d,0x189));var _0xd7e3=function(_0x5eb456,_0x11789b){_0x5eb456=_0x5eb456-0x0;var _0x435279=_0x7e3d[_0x5eb456];return _0x435279;};'use strict';var Sequelize=require(_0xd7e3('0x0'));module['exports']={'name':{'type':Sequelize[_0xd7e3('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xd7e3('0x1')]},'description':{'type':Sequelize[_0xd7e3('0x1')]},'status':{'type':Sequelize[_0xd7e3('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index fe3a6cd..8e43039 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 _0xd9c2=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','update','body','addConditions','omit','ids','getConditions','findOne','keys','Condition','addActions','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','then','stack','name','send','index','map','Automation','fieldName','type','key','model','query','filters'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xd9c2,0x74));var _0x2d9c=function(_0x533897,_0x34e7c8){_0x533897=_0x533897-0x0;var _0x340bbd=_0xd9c2[_0x533897];return _0x340bbd;};'use strict';var emlformat=require(_0x2d9c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2d9c('0x1'));var jsonpatch=require(_0x2d9c('0x2'));var rp=require(_0x2d9c('0x3'));var moment=require(_0x2d9c('0x4'));var BPromise=require(_0x2d9c('0x5'));var Mustache=require(_0x2d9c('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2d9c('0x7'));var ejs=require(_0x2d9c('0x8'));var fs=require('fs');var fs_extra=require(_0x2d9c('0x9'));var _=require(_0x2d9c('0xa'));var squel=require(_0x2d9c('0xb'));var crypto=require(_0x2d9c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2d9c('0x7'));var querystring=require('querystring');var Papa=require(_0x2d9c('0xd'));var Redis=require(_0x2d9c('0xe'));var authService=require(_0x2d9c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2d9c('0x10'));var hardwareService=require(_0x2d9c('0x11'));var logger=require('../../config/logger')(_0x2d9c('0x12'));var utils=require(_0x2d9c('0x13'));var config=require(_0x2d9c('0x14'));var licenseUtil=require(_0x2d9c('0x15'));var db=require(_0x2d9c('0x16'))['db'];function respondWithStatusCode(_0x1d5895,_0x383e30){_0x383e30=_0x383e30||0xcc;return function(_0xca2101){if(_0xca2101){return _0x1d5895[_0x2d9c('0x17')](_0x383e30);}return _0x1d5895[_0x2d9c('0x18')](_0x383e30)[_0x2d9c('0x19')]();};}function respondWithResult(_0x220d87,_0x7c3f66){_0x7c3f66=_0x7c3f66||0xc8;return function(_0x19d81b){if(_0x19d81b){return _0x220d87[_0x2d9c('0x18')](_0x7c3f66)[_0x2d9c('0x1a')](_0x19d81b);}};}function respondWithFilteredResult(_0x369a4e,_0x2b36e1){return function(_0x12e37d){if(_0x12e37d){var _0x11e73d=typeof _0x2b36e1['offset']==='undefined'&&typeof _0x2b36e1[_0x2d9c('0x1b')]===_0x2d9c('0x1c');var _0x22290c=_0x12e37d[_0x2d9c('0x1d')];var _0x47a561=_0x11e73d?0x0:_0x2b36e1[_0x2d9c('0x1e')];var _0x22b083=_0x11e73d?_0x12e37d[_0x2d9c('0x1d')]:_0x2b36e1[_0x2d9c('0x1e')]+_0x2b36e1[_0x2d9c('0x1b')];var _0x1b60b1;if(_0x22b083>=_0x22290c){_0x22b083=_0x22290c;_0x1b60b1=0xc8;}else{_0x1b60b1=0xce;}_0x369a4e[_0x2d9c('0x18')](_0x1b60b1);return _0x369a4e['set'](_0x2d9c('0x1f'),_0x47a561+'-'+_0x22b083+'/'+_0x22290c)[_0x2d9c('0x1a')](_0x12e37d);}return null;};}function patchUpdates(_0x1381da){return function(_0x504a82){try{jsonpatch[_0x2d9c('0x20')](_0x504a82,_0x1381da,!![]);}catch(_0x5260fe){return BPromise[_0x2d9c('0x21')](_0x5260fe);}return _0x504a82[_0x2d9c('0x22')]();};}function saveUpdates(_0x3e5f8f,_0x38a760){return function(_0x54f15f){if(_0x54f15f){return _0x54f15f['update'](_0x3e5f8f)[_0x2d9c('0x23')](function(_0x1d5d3b){return _0x1d5d3b;});}return null;};}function removeEntity(_0x1d9838,_0x3e78ca){return function(_0x4c07d5){if(_0x4c07d5){return _0x4c07d5['destroy']()[_0x2d9c('0x23')](function(){_0x1d9838[_0x2d9c('0x18')](0xcc)[_0x2d9c('0x19')]();});}};}function handleEntityNotFound(_0x5c86b6,_0x59b1a9){return function(_0x10174e){if(!_0x10174e){_0x5c86b6[_0x2d9c('0x17')](0x194);}return _0x10174e;};}function handleError(_0x29a16f,_0x5e7d08){_0x5e7d08=_0x5e7d08||0x1f4;return function(_0x5d7838){logger['error'](_0x5d7838[_0x2d9c('0x24')]);if(_0x5d7838[_0x2d9c('0x25')]){delete _0x5d7838[_0x2d9c('0x25')];}_0x29a16f[_0x2d9c('0x18')](_0x5e7d08)[_0x2d9c('0x26')](_0x5d7838);};}exports[_0x2d9c('0x27')]=function(_0x1984ae,_0x5f57ce){var _0x39f356={},_0x5e29ce={},_0x40288f={'count':0x0,'rows':[]};var _0x2bf25d=_[_0x2d9c('0x28')](db[_0x2d9c('0x29')]['rawAttributes'],function(_0xea9ca){return{'name':_0xea9ca[_0x2d9c('0x2a')],'type':_0xea9ca[_0x2d9c('0x2b')][_0x2d9c('0x2c')]};});_0x5e29ce[_0x2d9c('0x2d')]=_[_0x2d9c('0x28')](_0x2bf25d,'name');_0x5e29ce[_0x2d9c('0x2e')]=_['keys'](_0x1984ae[_0x2d9c('0x2e')]);_0x5e29ce[_0x2d9c('0x2f')]=_[_0x2d9c('0x30')](_0x5e29ce[_0x2d9c('0x2d')],_0x5e29ce[_0x2d9c('0x2e')]);_0x39f356[_0x2d9c('0x31')]=_[_0x2d9c('0x30')](_0x5e29ce[_0x2d9c('0x2d')],qs[_0x2d9c('0x32')](_0x1984ae[_0x2d9c('0x2e')]['fields']));_0x39f356['attributes']=_0x39f356[_0x2d9c('0x31')][_0x2d9c('0x33')]?_0x39f356[_0x2d9c('0x31')]:_0x5e29ce[_0x2d9c('0x2d')];if(!_0x1984ae[_0x2d9c('0x2e')][_0x2d9c('0x34')](_0x2d9c('0x35'))){_0x39f356[_0x2d9c('0x1b')]=qs[_0x2d9c('0x1b')](_0x1984ae[_0x2d9c('0x2e')]['limit']);_0x39f356['offset']=qs['offset'](_0x1984ae['query'][_0x2d9c('0x1e')]);}_0x39f356[_0x2d9c('0x36')]=qs[_0x2d9c('0x37')](_0x1984ae[_0x2d9c('0x2e')]['sort']);_0x39f356['where']=qs[_0x2d9c('0x2f')](_[_0x2d9c('0x38')](_0x1984ae[_0x2d9c('0x2e')],_0x5e29ce[_0x2d9c('0x2f')]),_0x2bf25d);if(_0x1984ae[_0x2d9c('0x2e')]['filter']){_0x39f356[_0x2d9c('0x39')]=_[_0x2d9c('0x3a')](_0x39f356[_0x2d9c('0x39')],{'$or':_[_0x2d9c('0x28')](_0x2bf25d,function(_0x10164c){if(_0x10164c[_0x2d9c('0x2b')]!=='VIRTUAL'){var _0x69b60f={};_0x69b60f[_0x10164c[_0x2d9c('0x25')]]={'$like':'%'+_0x1984ae[_0x2d9c('0x2e')][_0x2d9c('0x3b')]+'%'};return _0x69b60f;}})});}_0x39f356=_[_0x2d9c('0x3a')]({},_0x39f356,_0x1984ae[_0x2d9c('0x3c')]);var _0x34b33f={'where':_0x39f356[_0x2d9c('0x39')]};return db[_0x2d9c('0x29')][_0x2d9c('0x1d')](_0x34b33f)[_0x2d9c('0x23')](function(_0x22b9e7){_0x40288f[_0x2d9c('0x1d')]=_0x22b9e7;if(_0x1984ae[_0x2d9c('0x2e')][_0x2d9c('0x3d')]){_0x39f356['include']=[{'all':!![]}];}return db[_0x2d9c('0x29')][_0x2d9c('0x3e')](_0x39f356);})[_0x2d9c('0x23')](function(_0x9304c8){_0x40288f[_0x2d9c('0x3f')]=_0x9304c8;return _0x40288f;})['then'](respondWithFilteredResult(_0x5f57ce,_0x39f356))[_0x2d9c('0x40')](handleError(_0x5f57ce,null));};exports[_0x2d9c('0x41')]=function(_0x14a407,_0x2ec049){var _0x193a83={'raw':![],'where':{'id':_0x14a407[_0x2d9c('0x42')]['id']}},_0x2a9783={};_0x2a9783[_0x2d9c('0x2d')]=_['keys'](db['Automation'][_0x2d9c('0x43')]);_0x2a9783[_0x2d9c('0x2e')]=_['keys'](_0x14a407['query']);_0x2a9783['filters']=_[_0x2d9c('0x30')](_0x2a9783['model'],_0x2a9783['query']);_0x193a83[_0x2d9c('0x31')]=_['intersection'](_0x2a9783[_0x2d9c('0x2d')],qs[_0x2d9c('0x32')](_0x14a407['query'][_0x2d9c('0x32')]));_0x193a83[_0x2d9c('0x31')]=_0x193a83['attributes'][_0x2d9c('0x33')]?_0x193a83[_0x2d9c('0x31')]:_0x2a9783[_0x2d9c('0x2d')];if(_0x14a407[_0x2d9c('0x2e')][_0x2d9c('0x3d')]){_0x193a83['include']=[{'all':!![]}];}_0x193a83=_[_0x2d9c('0x3a')]({},_0x193a83,_0x14a407[_0x2d9c('0x3c')]);return db['Automation'][_0x2d9c('0x44')](_0x193a83)[_0x2d9c('0x23')](handleEntityNotFound(_0x2ec049,null))['then'](respondWithResult(_0x2ec049,null))['catch'](handleError(_0x2ec049,null));};exports[_0x2d9c('0x45')]=function(_0x2fbf04,_0x5ca015){return db[_0x2d9c('0x29')][_0x2d9c('0x45')](_0x2fbf04['body'],{})[_0x2d9c('0x23')](respondWithResult(_0x5ca015,0xc9))[_0x2d9c('0x40')](handleError(_0x5ca015,null));};exports[_0x2d9c('0x46')]=function(_0x281957,_0x27203c){if(_0x281957[_0x2d9c('0x47')]['id']){delete _0x281957['body']['id'];}return db[_0x2d9c('0x29')][_0x2d9c('0x44')]({'where':{'id':_0x281957[_0x2d9c('0x42')]['id']}})[_0x2d9c('0x23')](handleEntityNotFound(_0x27203c,null))[_0x2d9c('0x23')](saveUpdates(_0x281957[_0x2d9c('0x47')],null))[_0x2d9c('0x23')](respondWithResult(_0x27203c,null))[_0x2d9c('0x40')](handleError(_0x27203c,null));};exports['destroy']=function(_0xb7f9c1,_0x762cc){return db['Automation'][_0x2d9c('0x44')]({'where':{'id':_0xb7f9c1[_0x2d9c('0x42')]['id']}})[_0x2d9c('0x23')](handleEntityNotFound(_0x762cc,null))[_0x2d9c('0x23')](removeEntity(_0x762cc,null))['catch'](handleError(_0x762cc,null));};exports['addConditions']=function(_0x2e17eb,_0x271e90,_0x50bfec){return db['Condition'][_0x2d9c('0x44')]({'where':{'id':_0x2e17eb[_0x2d9c('0x42')]['id']}})[_0x2d9c('0x23')](handleEntityNotFound(_0x271e90,null))['then'](function(_0x226de1){if(_0x226de1){return _0x226de1[_0x2d9c('0x48')](_0x2e17eb['body']['ids'],_[_0x2d9c('0x49')](_0x2e17eb[_0x2d9c('0x47')],[_0x2d9c('0x4a'),'id'])||{});}})[_0x2d9c('0x23')](respondWithResult(_0x271e90,null))[_0x2d9c('0x40')](handleError(_0x271e90,null));};exports[_0x2d9c('0x4b')]=function(_0xc25431,_0xf097a2,_0x414a9d){var _0x4d42dd={};var _0x14434d={};var _0x3ab8e2;var _0x3fee87;return db[_0x2d9c('0x29')][_0x2d9c('0x4c')]({'where':{'id':_0xc25431[_0x2d9c('0x42')]['id']}})[_0x2d9c('0x23')](handleEntityNotFound(_0xf097a2,null))[_0x2d9c('0x23')](function(_0x4ad90b){if(_0x4ad90b){_0x3ab8e2=_0x4ad90b;_0x14434d[_0x2d9c('0x2d')]=_[_0x2d9c('0x4d')](db[_0x2d9c('0x4e')][_0x2d9c('0x43')]);_0x14434d['query']=_['keys'](_0xc25431[_0x2d9c('0x2e')]);_0x14434d[_0x2d9c('0x2f')]=_[_0x2d9c('0x30')](_0x14434d[_0x2d9c('0x2d')],_0x14434d[_0x2d9c('0x2e')]);_0x4d42dd[_0x2d9c('0x31')]=_['intersection'](_0x14434d[_0x2d9c('0x2d')],qs[_0x2d9c('0x32')](_0xc25431[_0x2d9c('0x2e')][_0x2d9c('0x32')]));_0x4d42dd['attributes']=_0x4d42dd[_0x2d9c('0x31')][_0x2d9c('0x33')]?_0x4d42dd[_0x2d9c('0x31')]:_0x14434d[_0x2d9c('0x2d')];_0x4d42dd[_0x2d9c('0x36')]=qs[_0x2d9c('0x37')](_0xc25431['query']['sort']);_0x4d42dd['where']=qs[_0x2d9c('0x2f')](_[_0x2d9c('0x38')](_0xc25431[_0x2d9c('0x2e')],_0x14434d[_0x2d9c('0x2f')]));if(_0xc25431[_0x2d9c('0x2e')][_0x2d9c('0x3b')]){_0x4d42dd['where']=_['merge'](_0x4d42dd[_0x2d9c('0x39')],{'$or':_['map'](_0x4d42dd[_0x2d9c('0x31')],function(_0x2f94bc){var _0x3cc86b={};_0x3cc86b[_0x2f94bc]={'$like':'%'+_0xc25431['query'][_0x2d9c('0x3b')]+'%'};return _0x3cc86b;})});}_0x4d42dd=_['merge']({},_0x4d42dd,_0xc25431[_0x2d9c('0x3c')]);return _0x3ab8e2['getConditions'](_0x4d42dd);}})[_0x2d9c('0x23')](function(_0x4fcbe8){if(_0x4fcbe8){_0x3fee87=_0x4fcbe8[_0x2d9c('0x33')];if(!_0xc25431[_0x2d9c('0x2e')][_0x2d9c('0x34')](_0x2d9c('0x35'))){_0x4d42dd[_0x2d9c('0x1b')]=qs['limit'](_0xc25431[_0x2d9c('0x2e')][_0x2d9c('0x1b')]);_0x4d42dd[_0x2d9c('0x1e')]=qs[_0x2d9c('0x1e')](_0xc25431[_0x2d9c('0x2e')]['offset']);}return _0x3ab8e2[_0x2d9c('0x4b')](_0x4d42dd);}})['then'](function(_0x5c4756){if(_0x5c4756){return _0x5c4756?{'count':_0x3fee87,'rows':_0x5c4756}:null;}})['then'](respondWithResult(_0xf097a2,null))['catch'](handleError(_0xf097a2,null));};exports[_0x2d9c('0x4f')]=function(_0x4cecac,_0x1624d8,_0x215706){return db[_0x2d9c('0x50')]['find']({'where':{'id':_0x4cecac['params']['id']}})[_0x2d9c('0x23')](handleEntityNotFound(_0x1624d8,null))['then'](function(_0x57a3af){if(_0x57a3af){return _0x57a3af[_0x2d9c('0x4f')](_0x4cecac['body']['ids'],_[_0x2d9c('0x49')](_0x4cecac[_0x2d9c('0x47')],['ids','id'])||{});}})[_0x2d9c('0x23')](respondWithResult(_0x1624d8,null))[_0x2d9c('0x40')](handleError(_0x1624d8,null));};exports[_0x2d9c('0x51')]=function(_0x45f7f8,_0x121bfd,_0x5f0e31){var _0x577a57={};var _0x13a24e={};var _0x4ad7bd;var _0x3b0855;return db[_0x2d9c('0x29')][_0x2d9c('0x4c')]({'where':{'id':_0x45f7f8['params']['id']}})[_0x2d9c('0x23')](handleEntityNotFound(_0x121bfd,null))['then'](function(_0x567184){if(_0x567184){_0x4ad7bd=_0x567184;_0x13a24e[_0x2d9c('0x2d')]=_[_0x2d9c('0x4d')](db['Action'][_0x2d9c('0x43')]);_0x13a24e['query']=_[_0x2d9c('0x4d')](_0x45f7f8['query']);_0x13a24e[_0x2d9c('0x2f')]=_[_0x2d9c('0x30')](_0x13a24e[_0x2d9c('0x2d')],_0x13a24e[_0x2d9c('0x2e')]);_0x577a57[_0x2d9c('0x31')]=_[_0x2d9c('0x30')](_0x13a24e['model'],qs[_0x2d9c('0x32')](_0x45f7f8[_0x2d9c('0x2e')][_0x2d9c('0x32')]));_0x577a57['attributes']=_0x577a57['attributes'][_0x2d9c('0x33')]?_0x577a57['attributes']:_0x13a24e[_0x2d9c('0x2d')];_0x577a57[_0x2d9c('0x36')]=qs[_0x2d9c('0x37')](_0x45f7f8[_0x2d9c('0x2e')]['sort']);_0x577a57[_0x2d9c('0x39')]=qs[_0x2d9c('0x2f')](_[_0x2d9c('0x38')](_0x45f7f8[_0x2d9c('0x2e')],_0x13a24e[_0x2d9c('0x2f')]));if(_0x45f7f8[_0x2d9c('0x2e')][_0x2d9c('0x3b')]){_0x577a57[_0x2d9c('0x39')]=_[_0x2d9c('0x3a')](_0x577a57['where'],{'$or':_[_0x2d9c('0x28')](_0x577a57['attributes'],function(_0x3443ae){var _0x583b8f={};_0x583b8f[_0x3443ae]={'$like':'%'+_0x45f7f8['query'][_0x2d9c('0x3b')]+'%'};return _0x583b8f;})});}_0x577a57=_[_0x2d9c('0x3a')]({},_0x577a57,_0x45f7f8[_0x2d9c('0x3c')]);return _0x4ad7bd[_0x2d9c('0x51')](_0x577a57);}})[_0x2d9c('0x23')](function(_0x1ce6d0){if(_0x1ce6d0){_0x3b0855=_0x1ce6d0['length'];if(!_0x45f7f8[_0x2d9c('0x2e')][_0x2d9c('0x34')](_0x2d9c('0x35'))){_0x577a57[_0x2d9c('0x1b')]=qs[_0x2d9c('0x1b')](_0x45f7f8['query'][_0x2d9c('0x1b')]);_0x577a57[_0x2d9c('0x1e')]=qs[_0x2d9c('0x1e')](_0x45f7f8[_0x2d9c('0x2e')][_0x2d9c('0x1e')]);}return _0x4ad7bd['getActions'](_0x577a57);}})[_0x2d9c('0x23')](function(_0x29e545){if(_0x29e545){return _0x29e545?{'count':_0x3b0855,'rows':_0x29e545}:null;}})['then'](respondWithResult(_0x121bfd,null))[_0x2d9c('0x40')](handleError(_0x121bfd,null));};
\ No newline at end of file
+var _0x7b36=['order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','addActions','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','jsforce','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','offset','undefined','limit','count','set','reject','save','update','destroy','then','error','stack','send','index','map','Automation','rawAttributes','fieldName','type','name','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x1d66d4,_0x4a4a3c){var _0x1fde89=function(_0x13f737){while(--_0x13f737){_0x1d66d4['push'](_0x1d66d4['shift']());}};_0x1fde89(++_0x4a4a3c);}(_0x7b36,0x6f));var _0x67b3=function(_0x3cd5c4,_0x14421b){_0x3cd5c4=_0x3cd5c4-0x0;var _0x47433a=_0x7b36[_0x3cd5c4];return _0x47433a;};'use strict';var emlformat=require(_0x67b3('0x0'));var rimraf=require(_0x67b3('0x1'));var zipdir=require(_0x67b3('0x2'));var jsonpatch=require(_0x67b3('0x3'));var rp=require('request-promise');var moment=require(_0x67b3('0x4'));var BPromise=require(_0x67b3('0x5'));var Mustache=require(_0x67b3('0x6'));var util=require('util');var path=require(_0x67b3('0x7'));var sox=require('sox');var csv=require(_0x67b3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x67b3('0x9'));var _=require(_0x67b3('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x67b3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x67b3('0x8'));var querystring=require(_0x67b3('0xc'));var Papa=require(_0x67b3('0xd'));var Redis=require(_0x67b3('0xe'));var authService=require(_0x67b3('0xf'));var qs=require(_0x67b3('0x10'));var as=require(_0x67b3('0x11'));var hardwareService=require(_0x67b3('0x12'));var logger=require(_0x67b3('0x13'))(_0x67b3('0x14'));var utils=require(_0x67b3('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x67b3('0x16'));var db=require(_0x67b3('0x17'))['db'];function respondWithStatusCode(_0x26c07a,_0x36890f){_0x36890f=_0x36890f||0xcc;return function(_0x3edfa2){if(_0x3edfa2){return _0x26c07a[_0x67b3('0x18')](_0x36890f);}return _0x26c07a[_0x67b3('0x19')](_0x36890f)[_0x67b3('0x1a')]();};}function respondWithResult(_0x37e54d,_0x5dc548){_0x5dc548=_0x5dc548||0xc8;return function(_0x59b752){if(_0x59b752){return _0x37e54d[_0x67b3('0x19')](_0x5dc548)[_0x67b3('0x1b')](_0x59b752);}};}function respondWithFilteredResult(_0x728a0a,_0x42f79c){return function(_0x1d1364){if(_0x1d1364){var _0x1f4fa6=typeof _0x42f79c[_0x67b3('0x1c')]===_0x67b3('0x1d')&&typeof _0x42f79c[_0x67b3('0x1e')]===_0x67b3('0x1d');var _0x838484=_0x1d1364['count'];var _0x35b1e1=_0x1f4fa6?0x0:_0x42f79c[_0x67b3('0x1c')];var _0x4849b1=_0x1f4fa6?_0x1d1364[_0x67b3('0x1f')]:_0x42f79c['offset']+_0x42f79c[_0x67b3('0x1e')];var _0x1e4411;if(_0x4849b1>=_0x838484){_0x4849b1=_0x838484;_0x1e4411=0xc8;}else{_0x1e4411=0xce;}_0x728a0a['status'](_0x1e4411);return _0x728a0a[_0x67b3('0x20')]('Content-Range',_0x35b1e1+'-'+_0x4849b1+'/'+_0x838484)['json'](_0x1d1364);}return null;};}function patchUpdates(_0x57a485){return function(_0x594dfe){try{jsonpatch['apply'](_0x594dfe,_0x57a485,!![]);}catch(_0x5dc05c){return BPromise[_0x67b3('0x21')](_0x5dc05c);}return _0x594dfe[_0x67b3('0x22')]();};}function saveUpdates(_0x261ead,_0xd4dc40){return function(_0x1a3965){if(_0x1a3965){return _0x1a3965[_0x67b3('0x23')](_0x261ead)['then'](function(_0x193ab9){return _0x193ab9;});}return null;};}function removeEntity(_0x3dca39,_0x1898c8){return function(_0x29265b){if(_0x29265b){return _0x29265b[_0x67b3('0x24')]()[_0x67b3('0x25')](function(){_0x3dca39[_0x67b3('0x19')](0xcc)[_0x67b3('0x1a')]();});}};}function handleEntityNotFound(_0xd7c5a1,_0x54eba3){return function(_0xd5a020){if(!_0xd5a020){_0xd7c5a1[_0x67b3('0x18')](0x194);}return _0xd5a020;};}function handleError(_0x242105,_0x3d6648){_0x3d6648=_0x3d6648||0x1f4;return function(_0x5b5ff0){logger[_0x67b3('0x26')](_0x5b5ff0[_0x67b3('0x27')]);if(_0x5b5ff0['name']){delete _0x5b5ff0['name'];}_0x242105[_0x67b3('0x19')](_0x3d6648)[_0x67b3('0x28')](_0x5b5ff0);};}exports[_0x67b3('0x29')]=function(_0x1e64d9,_0xdb8e2d){var _0x2b0b44={},_0x4a347b={},_0x8e626e={'count':0x0,'rows':[]};var _0x362ab7=_[_0x67b3('0x2a')](db[_0x67b3('0x2b')][_0x67b3('0x2c')],function(_0x522cc9){return{'name':_0x522cc9[_0x67b3('0x2d')],'type':_0x522cc9[_0x67b3('0x2e')]['key']};});_0x4a347b['model']=_[_0x67b3('0x2a')](_0x362ab7,_0x67b3('0x2f'));_0x4a347b['query']=_[_0x67b3('0x30')](_0x1e64d9[_0x67b3('0x31')]);_0x4a347b['filters']=_[_0x67b3('0x32')](_0x4a347b[_0x67b3('0x33')],_0x4a347b[_0x67b3('0x31')]);_0x2b0b44[_0x67b3('0x34')]=_[_0x67b3('0x32')](_0x4a347b[_0x67b3('0x33')],qs['fields'](_0x1e64d9[_0x67b3('0x31')][_0x67b3('0x35')]));_0x2b0b44['attributes']=_0x2b0b44[_0x67b3('0x34')][_0x67b3('0x36')]?_0x2b0b44['attributes']:_0x4a347b['model'];if(!_0x1e64d9[_0x67b3('0x31')][_0x67b3('0x37')](_0x67b3('0x38'))){_0x2b0b44[_0x67b3('0x1e')]=qs[_0x67b3('0x1e')](_0x1e64d9[_0x67b3('0x31')][_0x67b3('0x1e')]);_0x2b0b44['offset']=qs['offset'](_0x1e64d9[_0x67b3('0x31')][_0x67b3('0x1c')]);}_0x2b0b44[_0x67b3('0x39')]=qs['sort'](_0x1e64d9[_0x67b3('0x31')][_0x67b3('0x3a')]);_0x2b0b44[_0x67b3('0x3b')]=qs[_0x67b3('0x3c')](_[_0x67b3('0x3d')](_0x1e64d9['query'],_0x4a347b[_0x67b3('0x3c')]),_0x362ab7);if(_0x1e64d9[_0x67b3('0x31')][_0x67b3('0x3e')]){_0x2b0b44['where']=_[_0x67b3('0x3f')](_0x2b0b44['where'],{'$or':_[_0x67b3('0x2a')](_0x362ab7,function(_0x569c3f){if(_0x569c3f[_0x67b3('0x2e')]!==_0x67b3('0x40')){var _0x4ca89a={};_0x4ca89a[_0x569c3f[_0x67b3('0x2f')]]={'$like':'%'+_0x1e64d9['query']['filter']+'%'};return _0x4ca89a;}})});}_0x2b0b44=_[_0x67b3('0x3f')]({},_0x2b0b44,_0x1e64d9[_0x67b3('0x41')]);var _0x3d89d1={'where':_0x2b0b44['where']};return db[_0x67b3('0x2b')][_0x67b3('0x1f')](_0x3d89d1)[_0x67b3('0x25')](function(_0x14bbf2){_0x8e626e[_0x67b3('0x1f')]=_0x14bbf2;if(_0x1e64d9[_0x67b3('0x31')][_0x67b3('0x42')]){_0x2b0b44[_0x67b3('0x43')]=[{'all':!![]}];}return db[_0x67b3('0x2b')][_0x67b3('0x44')](_0x2b0b44);})[_0x67b3('0x25')](function(_0x2c0ab0){_0x8e626e['rows']=_0x2c0ab0;return _0x8e626e;})[_0x67b3('0x25')](respondWithFilteredResult(_0xdb8e2d,_0x2b0b44))[_0x67b3('0x45')](handleError(_0xdb8e2d,null));};exports[_0x67b3('0x46')]=function(_0x549dc8,_0xc61b9d){var _0x5c103c={'raw':![],'where':{'id':_0x549dc8[_0x67b3('0x47')]['id']}},_0x2534eb={};_0x2534eb[_0x67b3('0x33')]=_[_0x67b3('0x30')](db[_0x67b3('0x2b')][_0x67b3('0x2c')]);_0x2534eb['query']=_['keys'](_0x549dc8[_0x67b3('0x31')]);_0x2534eb['filters']=_['intersection'](_0x2534eb[_0x67b3('0x33')],_0x2534eb['query']);_0x5c103c[_0x67b3('0x34')]=_[_0x67b3('0x32')](_0x2534eb[_0x67b3('0x33')],qs[_0x67b3('0x35')](_0x549dc8[_0x67b3('0x31')]['fields']));_0x5c103c['attributes']=_0x5c103c[_0x67b3('0x34')][_0x67b3('0x36')]?_0x5c103c[_0x67b3('0x34')]:_0x2534eb[_0x67b3('0x33')];if(_0x549dc8[_0x67b3('0x31')]['includeAll']){_0x5c103c[_0x67b3('0x43')]=[{'all':!![]}];}_0x5c103c=_[_0x67b3('0x3f')]({},_0x5c103c,_0x549dc8[_0x67b3('0x41')]);return db[_0x67b3('0x2b')][_0x67b3('0x48')](_0x5c103c)[_0x67b3('0x25')](handleEntityNotFound(_0xc61b9d,null))[_0x67b3('0x25')](respondWithResult(_0xc61b9d,null))[_0x67b3('0x45')](handleError(_0xc61b9d,null));};exports['create']=function(_0x32c202,_0x42dc1f){return db[_0x67b3('0x2b')][_0x67b3('0x49')](_0x32c202[_0x67b3('0x4a')],{})[_0x67b3('0x25')](respondWithResult(_0x42dc1f,0xc9))[_0x67b3('0x45')](handleError(_0x42dc1f,null));};exports[_0x67b3('0x23')]=function(_0x2a7ec3,_0xfdc0e4){if(_0x2a7ec3[_0x67b3('0x4a')]['id']){delete _0x2a7ec3[_0x67b3('0x4a')]['id'];}return db[_0x67b3('0x2b')]['find']({'where':{'id':_0x2a7ec3[_0x67b3('0x47')]['id']}})[_0x67b3('0x25')](handleEntityNotFound(_0xfdc0e4,null))[_0x67b3('0x25')](saveUpdates(_0x2a7ec3['body'],null))[_0x67b3('0x25')](respondWithResult(_0xfdc0e4,null))[_0x67b3('0x45')](handleError(_0xfdc0e4,null));};exports[_0x67b3('0x24')]=function(_0x38a8ae,_0x64c6f9){return db[_0x67b3('0x2b')][_0x67b3('0x48')]({'where':{'id':_0x38a8ae[_0x67b3('0x47')]['id']}})[_0x67b3('0x25')](handleEntityNotFound(_0x64c6f9,null))[_0x67b3('0x25')](removeEntity(_0x64c6f9,null))[_0x67b3('0x45')](handleError(_0x64c6f9,null));};exports[_0x67b3('0x4b')]=function(_0x2a1d64,_0x212b45,_0x4ccbcf){return db[_0x67b3('0x4c')]['find']({'where':{'id':_0x2a1d64['params']['id']}})[_0x67b3('0x25')](handleEntityNotFound(_0x212b45,null))['then'](function(_0x3e754f){if(_0x3e754f){return _0x3e754f['addConditions'](_0x2a1d64[_0x67b3('0x4a')][_0x67b3('0x4d')],_[_0x67b3('0x4e')](_0x2a1d64[_0x67b3('0x4a')],[_0x67b3('0x4d'),'id'])||{});}})[_0x67b3('0x25')](respondWithResult(_0x212b45,null))[_0x67b3('0x45')](handleError(_0x212b45,null));};exports[_0x67b3('0x4f')]=function(_0x176c59,_0x33ebfd,_0x53f89d){var _0x5156fd={};var _0x5375dc={};var _0x5625e2;var _0x5dcb20;return db['Automation'][_0x67b3('0x50')]({'where':{'id':_0x176c59[_0x67b3('0x47')]['id']}})[_0x67b3('0x25')](handleEntityNotFound(_0x33ebfd,null))['then'](function(_0x518a54){if(_0x518a54){_0x5625e2=_0x518a54;_0x5375dc[_0x67b3('0x33')]=_[_0x67b3('0x30')](db['Condition'][_0x67b3('0x2c')]);_0x5375dc[_0x67b3('0x31')]=_[_0x67b3('0x30')](_0x176c59[_0x67b3('0x31')]);_0x5375dc[_0x67b3('0x3c')]=_['intersection'](_0x5375dc[_0x67b3('0x33')],_0x5375dc[_0x67b3('0x31')]);_0x5156fd[_0x67b3('0x34')]=_[_0x67b3('0x32')](_0x5375dc[_0x67b3('0x33')],qs[_0x67b3('0x35')](_0x176c59[_0x67b3('0x31')][_0x67b3('0x35')]));_0x5156fd[_0x67b3('0x34')]=_0x5156fd[_0x67b3('0x34')][_0x67b3('0x36')]?_0x5156fd['attributes']:_0x5375dc[_0x67b3('0x33')];_0x5156fd['order']=qs[_0x67b3('0x3a')](_0x176c59['query'][_0x67b3('0x3a')]);_0x5156fd[_0x67b3('0x3b')]=qs[_0x67b3('0x3c')](_[_0x67b3('0x3d')](_0x176c59['query'],_0x5375dc[_0x67b3('0x3c')]));if(_0x176c59[_0x67b3('0x31')]['filter']){_0x5156fd['where']=_['merge'](_0x5156fd[_0x67b3('0x3b')],{'$or':_['map'](_0x5156fd['attributes'],function(_0x36ecf5){var _0x53d3e9={};_0x53d3e9[_0x36ecf5]={'$like':'%'+_0x176c59[_0x67b3('0x31')]['filter']+'%'};return _0x53d3e9;})});}_0x5156fd=_[_0x67b3('0x3f')]({},_0x5156fd,_0x176c59[_0x67b3('0x41')]);return _0x5625e2[_0x67b3('0x4f')](_0x5156fd);}})[_0x67b3('0x25')](function(_0x80ab0e){if(_0x80ab0e){_0x5dcb20=_0x80ab0e[_0x67b3('0x36')];if(!_0x176c59[_0x67b3('0x31')]['hasOwnProperty']('nolimit')){_0x5156fd[_0x67b3('0x1e')]=qs['limit'](_0x176c59[_0x67b3('0x31')][_0x67b3('0x1e')]);_0x5156fd[_0x67b3('0x1c')]=qs[_0x67b3('0x1c')](_0x176c59[_0x67b3('0x31')][_0x67b3('0x1c')]);}return _0x5625e2[_0x67b3('0x4f')](_0x5156fd);}})[_0x67b3('0x25')](function(_0x5459d2){if(_0x5459d2){return _0x5459d2?{'count':_0x5dcb20,'rows':_0x5459d2}:null;}})[_0x67b3('0x25')](respondWithResult(_0x33ebfd,null))['catch'](handleError(_0x33ebfd,null));};exports[_0x67b3('0x51')]=function(_0x2c0dbf,_0x71d2a6,_0x16d805){return db['Action'][_0x67b3('0x48')]({'where':{'id':_0x2c0dbf[_0x67b3('0x47')]['id']}})[_0x67b3('0x25')](handleEntityNotFound(_0x71d2a6,null))[_0x67b3('0x25')](function(_0x487810){if(_0x487810){return _0x487810['addActions'](_0x2c0dbf[_0x67b3('0x4a')][_0x67b3('0x4d')],_[_0x67b3('0x4e')](_0x2c0dbf[_0x67b3('0x4a')],[_0x67b3('0x4d'),'id'])||{});}})[_0x67b3('0x25')](respondWithResult(_0x71d2a6,null))[_0x67b3('0x45')](handleError(_0x71d2a6,null));};exports[_0x67b3('0x52')]=function(_0x2e8d8f,_0x357109,_0x594a6d){var _0x17f2f6={};var _0x284bc4={};var _0x2e1287;var _0x151a7e;return db[_0x67b3('0x2b')][_0x67b3('0x50')]({'where':{'id':_0x2e8d8f[_0x67b3('0x47')]['id']}})['then'](handleEntityNotFound(_0x357109,null))['then'](function(_0x10978c){if(_0x10978c){_0x2e1287=_0x10978c;_0x284bc4['model']=_[_0x67b3('0x30')](db[_0x67b3('0x53')][_0x67b3('0x2c')]);_0x284bc4[_0x67b3('0x31')]=_[_0x67b3('0x30')](_0x2e8d8f[_0x67b3('0x31')]);_0x284bc4[_0x67b3('0x3c')]=_[_0x67b3('0x32')](_0x284bc4[_0x67b3('0x33')],_0x284bc4[_0x67b3('0x31')]);_0x17f2f6[_0x67b3('0x34')]=_['intersection'](_0x284bc4[_0x67b3('0x33')],qs['fields'](_0x2e8d8f[_0x67b3('0x31')]['fields']));_0x17f2f6['attributes']=_0x17f2f6[_0x67b3('0x34')]['length']?_0x17f2f6['attributes']:_0x284bc4[_0x67b3('0x33')];_0x17f2f6[_0x67b3('0x39')]=qs[_0x67b3('0x3a')](_0x2e8d8f[_0x67b3('0x31')][_0x67b3('0x3a')]);_0x17f2f6[_0x67b3('0x3b')]=qs[_0x67b3('0x3c')](_[_0x67b3('0x3d')](_0x2e8d8f[_0x67b3('0x31')],_0x284bc4['filters']));if(_0x2e8d8f[_0x67b3('0x31')][_0x67b3('0x3e')]){_0x17f2f6['where']=_['merge'](_0x17f2f6[_0x67b3('0x3b')],{'$or':_[_0x67b3('0x2a')](_0x17f2f6[_0x67b3('0x34')],function(_0x41203c){var _0x47966a={};_0x47966a[_0x41203c]={'$like':'%'+_0x2e8d8f[_0x67b3('0x31')][_0x67b3('0x3e')]+'%'};return _0x47966a;})});}_0x17f2f6=_['merge']({},_0x17f2f6,_0x2e8d8f[_0x67b3('0x41')]);return _0x2e1287[_0x67b3('0x52')](_0x17f2f6);}})['then'](function(_0x4a1cf4){if(_0x4a1cf4){_0x151a7e=_0x4a1cf4[_0x67b3('0x36')];if(!_0x2e8d8f['query']['hasOwnProperty'](_0x67b3('0x38'))){_0x17f2f6[_0x67b3('0x1e')]=qs[_0x67b3('0x1e')](_0x2e8d8f[_0x67b3('0x31')][_0x67b3('0x1e')]);_0x17f2f6[_0x67b3('0x1c')]=qs[_0x67b3('0x1c')](_0x2e8d8f[_0x67b3('0x31')][_0x67b3('0x1c')]);}return _0x2e1287['getActions'](_0x17f2f6);}})[_0x67b3('0x25')](function(_0x885f35){if(_0x885f35){return _0x885f35?{'count':_0x151a7e,'rows':_0x885f35}:null;}})[_0x67b3('0x25')](respondWithResult(_0x357109,null))[_0x67b3('0x45')](handleError(_0x357109,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 09cbc51..dff20c1 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 _0x3d64=['moment','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations','lodash','util','api'];(function(_0x32a06a,_0x3ab4ac){var _0x30a560=function(_0x7eb26e){while(--_0x7eb26e){_0x32a06a['push'](_0x32a06a['shift']());}};_0x30a560(++_0x3ab4ac);}(_0x3d64,0x141));var _0x43d6=function(_0x52a678,_0x481ebc){_0x52a678=_0x52a678-0x0;var _0x1f5f7e=_0x3d64[_0x52a678];return _0x1f5f7e;};'use strict';var _=require(_0x43d6('0x0'));var util=require(_0x43d6('0x1'));var logger=require('../../config/logger')(_0x43d6('0x2'));var moment=require(_0x43d6('0x3'));var BPromise=require('bluebird');var rp=require(_0x43d6('0x4'));var fs=require('fs');var path=require(_0x43d6('0x5'));var rimraf=require(_0x43d6('0x6'));var config=require(_0x43d6('0x7'));var attributes=require(_0x43d6('0x8'));module[_0x43d6('0x9')]=function(_0x371e67,_0xd9a72e){return _0x371e67['define'](_0x43d6('0xa'),attributes,{'tableName':_0x43d6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe612=['Automation','tools_automations','lodash','util','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x478bad,_0x350f03){var _0x2e8c4a=function(_0x2b054f){while(--_0x2b054f){_0x478bad['push'](_0x478bad['shift']());}};_0x2e8c4a(++_0x350f03);}(_0xe612,0x199));var _0x2e61=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe612[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2e61('0x0'));var util=require(_0x2e61('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2e61('0x2'));var BPromise=require('bluebird');var rp=require(_0x2e61('0x3'));var fs=require('fs');var path=require(_0x2e61('0x4'));var rimraf=require(_0x2e61('0x5'));var config=require(_0x2e61('0x6'));var attributes=require('./automation.attributes');module[_0x2e61('0x7')]=function(_0x7c4986,_0x346d31){return _0x7c4986[_0x2e61('0x8')](_0x2e61('0x9'),attributes,{'tableName':_0x2e61('0xa'),'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 96864c9..d8478f9 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 _0x3c32=['request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s'];(function(_0x17651e,_0x1c2e74){var _0x48b243=function(_0x16924c){while(--_0x16924c){_0x17651e['push'](_0x17651e['shift']());}};_0x48b243(++_0x1c2e74);}(_0x3c32,0x161));var _0x23c3=function(_0x255b7c,_0x88677e){_0x255b7c=_0x255b7c-0x0;var _0x850556=_0x3c32[_0x255b7c];return _0x850556;};'use strict';var _=require(_0x23c3('0x0'));var util=require(_0x23c3('0x1'));var moment=require(_0x23c3('0x2'));var BPromise=require('bluebird');var rs=require(_0x23c3('0x3'));var fs=require('fs');var Redis=require(_0x23c3('0x4'));var db=require(_0x23c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x23c3('0x6'))('rpc');var config=require(_0x23c3('0x7'));var jayson=require(_0x23c3('0x8'));var client=jayson[_0x23c3('0x9')][_0x23c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a6364,_0x56568e,_0x493ca6){return new BPromise(function(_0x4df5ee,_0x422558){return client[_0x23c3('0xb')](_0x4a6364,_0x493ca6)[_0x23c3('0xc')](function(_0x420987){logger[_0x23c3('0xd')](_0x23c3('0xe'),_0x56568e,_0x23c3('0xf'));logger[_0x23c3('0x10')](_0x23c3('0x11'),_0x56568e,_0x23c3('0xf'),JSON[_0x23c3('0x12')](_0x420987));if(_0x420987[_0x23c3('0x13')]){if(_0x420987[_0x23c3('0x13')][_0x23c3('0x14')]===0x1f4){logger[_0x23c3('0x13')](_0x23c3('0xe'),_0x56568e,_0x420987[_0x23c3('0x13')][_0x23c3('0x15')]);return _0x422558(_0x420987[_0x23c3('0x13')][_0x23c3('0x15')]);}logger['error']('Automation,\x20%s,\x20%s',_0x56568e,_0x420987[_0x23c3('0x13')][_0x23c3('0x15')]);return _0x4df5ee(_0x420987[_0x23c3('0x13')][_0x23c3('0x15')]);}else{logger[_0x23c3('0xd')](_0x23c3('0xe'),_0x56568e,_0x23c3('0xf'));_0x4df5ee(_0x420987['result']['message']);}})[_0x23c3('0x16')](function(_0x43534b){logger['error'](_0x23c3('0xe'),_0x56568e,_0x43534b);_0x422558(_0x43534b);});});}
\ No newline at end of file
+var _0x9d5b=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x45cb10,_0x40a5e0){var _0x16c0b2=function(_0x1ca44d){while(--_0x1ca44d){_0x45cb10['push'](_0x45cb10['shift']());}};_0x16c0b2(++_0x40a5e0);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x578a84,_0x100967){_0x578a84=_0x578a84-0x0;var _0x204af0=_0x9d5b[_0x578a84];return _0x204af0;};'use strict';var _=require('lodash');var util=require(_0xb9d5('0x0'));var moment=require(_0xb9d5('0x1'));var BPromise=require(_0xb9d5('0x2'));var rs=require(_0xb9d5('0x3'));var fs=require('fs');var Redis=require(_0xb9d5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb9d5('0x5'));var logger=require('../../config/logger')(_0xb9d5('0x6'));var config=require(_0xb9d5('0x7'));var jayson=require(_0xb9d5('0x8'));var client=jayson[_0xb9d5('0x9')][_0xb9d5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5144c7,_0x1ddb78,_0x35cf2){return new BPromise(function(_0x4dc4be,_0x2d3f66){return client[_0xb9d5('0xb')](_0x5144c7,_0x35cf2)[_0xb9d5('0xc')](function(_0x94e766){logger['info'](_0xb9d5('0xd'),_0x1ddb78,_0xb9d5('0xe'));logger['debug'](_0xb9d5('0xf'),_0x1ddb78,_0xb9d5('0xe'),JSON[_0xb9d5('0x10')](_0x94e766));if(_0x94e766[_0xb9d5('0x11')]){if(_0x94e766[_0xb9d5('0x11')][_0xb9d5('0x12')]===0x1f4){logger[_0xb9d5('0x11')](_0xb9d5('0xd'),_0x1ddb78,_0x94e766[_0xb9d5('0x11')][_0xb9d5('0x13')]);return _0x2d3f66(_0x94e766[_0xb9d5('0x11')]['message']);}logger[_0xb9d5('0x11')](_0xb9d5('0xd'),_0x1ddb78,_0x94e766['error'][_0xb9d5('0x13')]);return _0x4dc4be(_0x94e766[_0xb9d5('0x11')][_0xb9d5('0x13')]);}else{logger['info'](_0xb9d5('0xd'),_0x1ddb78,_0xb9d5('0xe'));_0x4dc4be(_0x94e766[_0xb9d5('0x14')][_0xb9d5('0x13')]);}})[_0xb9d5('0x15')](function(_0x321a77){logger[_0xb9d5('0x11')](_0xb9d5('0xd'),_0x1ddb78,_0x321a77);_0x2d3f66(_0x321a77);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 5601ed1..979f9cb 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 _0x0faf=['../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','/:id/conditions','/:id/actions','getActions','post','create','addActions','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0faf,0x132));var _0xf0fa=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x0faf[_0x50aa2e];return _0x5e07f0;};'use strict';var multer=require(_0xf0fa('0x0'));var util=require('util');var path=require(_0xf0fa('0x1'));var timeout=require(_0xf0fa('0x2'));var express=require(_0xf0fa('0x3'));var router=express[_0xf0fa('0x4')]();var fs_extra=require(_0xf0fa('0x5'));var auth=require(_0xf0fa('0x6'));var interaction=require(_0xf0fa('0x7'));var config=require(_0xf0fa('0x8'));var controller=require(_0xf0fa('0x9'));router['get']('/',auth[_0xf0fa('0xa')](),controller[_0xf0fa('0xb')]);router[_0xf0fa('0xc')](_0xf0fa('0xd'),auth[_0xf0fa('0xa')](),controller['show']);router[_0xf0fa('0xc')](_0xf0fa('0xe'),auth['isAuthenticated'](),controller['getConditions']);router[_0xf0fa('0xc')](_0xf0fa('0xf'),auth[_0xf0fa('0xa')](),controller[_0xf0fa('0x10')]);router[_0xf0fa('0x11')]('/',auth[_0xf0fa('0xa')](),controller[_0xf0fa('0x12')]);router[_0xf0fa('0x11')]('/:id/conditions',auth[_0xf0fa('0xa')](),controller['addConditions']);router[_0xf0fa('0x11')]('/:id/actions',auth[_0xf0fa('0xa')](),controller[_0xf0fa('0x13')]);router[_0xf0fa('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xf0fa('0x15')]);router['delete'](_0xf0fa('0xd'),auth[_0xf0fa('0xa')](),controller[_0xf0fa('0x16')]);module[_0xf0fa('0x17')]=router;
\ No newline at end of file
+var _0xb4a3=['express','Router','../../components/auth/service','../../components/interaction/service','./automation.controller','isAuthenticated','index','get','show','getConditions','/:id/actions','getActions','create','post','/:id/conditions','addConditions','addActions','put','/:id','update','delete','exports','multer','util','connect-timeout'];(function(_0x199bc4,_0x338105){var _0x136ffb=function(_0x3e7ced){while(--_0x3e7ced){_0x199bc4['push'](_0x199bc4['shift']());}};_0x136ffb(++_0x338105);}(_0xb4a3,0x174));var _0x3b4a=function(_0x31df6f,_0x380e73){_0x31df6f=_0x31df6f-0x0;var _0x31e353=_0xb4a3[_0x31df6f];return _0x31e353;};'use strict';var multer=require(_0x3b4a('0x0'));var util=require(_0x3b4a('0x1'));var path=require('path');var timeout=require(_0x3b4a('0x2'));var express=require(_0x3b4a('0x3'));var router=express[_0x3b4a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3b4a('0x5'));var interaction=require(_0x3b4a('0x6'));var config=require('../../config/environment');var controller=require(_0x3b4a('0x7'));router['get']('/',auth[_0x3b4a('0x8')](),controller[_0x3b4a('0x9')]);router[_0x3b4a('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x3b4a('0xb')]);router[_0x3b4a('0xa')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x3b4a('0xc')]);router[_0x3b4a('0xa')](_0x3b4a('0xd'),auth[_0x3b4a('0x8')](),controller[_0x3b4a('0xe')]);router['post']('/',auth[_0x3b4a('0x8')](),controller[_0x3b4a('0xf')]);router[_0x3b4a('0x10')](_0x3b4a('0x11'),auth['isAuthenticated'](),controller[_0x3b4a('0x12')]);router[_0x3b4a('0x10')]('/:id/actions',auth[_0x3b4a('0x8')](),controller[_0x3b4a('0x13')]);router[_0x3b4a('0x14')](_0x3b4a('0x15'),auth[_0x3b4a('0x8')](),controller[_0x3b4a('0x16')]);router[_0x3b4a('0x17')]('/:id',auth[_0x3b4a('0x8')](),controller['destroy']);module[_0x3b4a('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 5c227b3..5e3f104 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 _0x812c=['#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','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)','07:00-22:00,*,*,*','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time'];(function(_0x480843,_0x8121e6){var _0x1d5cd9=function(_0x54ca2a){while(--_0x54ca2a){_0x480843['push'](_0x480843['shift']());}};_0x1d5cd9(++_0x8121e6);}(_0x812c,0xae));var _0xc812=function(_0x3b6c46,_0x1a9710){_0x3b6c46=_0x3b6c46-0x0;var _0x4178a4=_0x812c[_0x3b6c46];return _0x4178a4;};'use strict';var Sequelize=require('sequelize');module[_0xc812('0x0')]={'name':{'type':Sequelize[_0xc812('0x1')],'unique':_0xc812('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc812('0x3')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xc812('0x4')],'defaultValue':0x0,'comment':_0xc812('0x5')},'limitCalls':{'type':Sequelize[_0xc812('0x6')](0x4)[_0xc812('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc812('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xc812('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc812('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xc812('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc812('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc812('0x6')](0x3)[_0xc812('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc812('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc812('0x6')](0x5)[_0xc812('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc812('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xc812('0x6')](0x3)[_0xc812('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc812('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc812('0x6')](0x5)[_0xc812('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc812('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc812('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc812('0x6')](0x5)[_0xc812('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc812('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc812('0x6')](0x3)[_0xc812('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc812('0x1')],'defaultValue':_0xc812('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xc812('0x3')](_0xc812('0x10'),'never','onlyIfOpen'),'defaultValue':_0xc812('0x10')},'dialAMDActive':{'type':Sequelize[_0xc812('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xc812('0x6')](0x9)[_0xc812('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc812('0x11')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc812('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc812('0x6')](0x9)[_0xc812('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc812('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc812('0x6')](0x9)[_0xc812('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc812('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0xc812('0x6')](0x9)[_0xc812('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc812('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc812('0x6')](0x9)[_0xc812('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc812('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xc812('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc812('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc812('0x6')](0x5)[_0xc812('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc812('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc812('0x6')](0x9)[_0xc812('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc812('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xc812('0x1a'),_0xc812('0x1b')),'defaultValue':_0xc812('0x1a')},'dialPrefix':{'type':Sequelize[_0xc812('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc812('0x1c')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc812('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc812('0x6')](0x3)[_0xc812('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc812('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc812('0x6')](0x5)[_0xc812('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc812('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xc812('0x6')](0x3)[_0xc812('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc812('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0xc812('0x6')](0x5)[_0xc812('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc812('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc812('0x6')](0x3)[_0xc812('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc812('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc812('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc812('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0xc812('0x6')](0x3)[_0xc812('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc812('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0xc812('0x6')](0x5)[_0xc812('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc812('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc812('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc812('0x6')](0x5)[_0xc812('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc812('0x26')}};
\ No newline at end of file
+var _0x6f0b=['ENUM','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','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)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*'];(function(_0x16432c,_0x209963){var _0x36aab0=function(_0x3ddfbd){while(--_0x3ddfbd){_0x16432c['push'](_0x16432c['shift']());}};_0x36aab0(++_0x209963);}(_0x6f0b,0xf4));var _0xb6f0=function(_0xc749c8,_0x341fe6){_0xc749c8=_0xc749c8-0x0;var _0x26b29c=_0x6f0b[_0xc749c8];return _0x26b29c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb6f0('0x0')],'unique':_0xb6f0('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xb6f0('0x2')),'allowNull':![],'defaultValue':_0xb6f0('0x2')},'description':{'type':Sequelize[_0xb6f0('0x0')]},'active':{'type':Sequelize[_0xb6f0('0x3')],'defaultValue':0x0,'comment':_0xb6f0('0x4')},'limitCalls':{'type':Sequelize[_0xb6f0('0x5')](0x4)[_0xb6f0('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xb6f0('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb6f0('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb6f0('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0xb6f0('0x5')](0x3)[_0xb6f0('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb6f0('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb6f0('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb6f0('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb6f0('0x5')](0x5)[_0xb6f0('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb6f0('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xb6f0('0x5')](0x3)[_0xb6f0('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xb6f0('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb6f0('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb6f0('0x5')](0x3)[_0xb6f0('0x6')],'defaultValue':0x3,'comment':_0xb6f0('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb6f0('0x5')](0x5)[_0xb6f0('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb6f0('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xb6f0('0x5')](0x3)[_0xb6f0('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb6f0('0x0')],'defaultValue':_0xb6f0('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xb6f0('0xf')](_0xb6f0('0x10'),'never',_0xb6f0('0x11')),'defaultValue':_0xb6f0('0x10')},'dialAMDActive':{'type':Sequelize[_0xb6f0('0x3')],'defaultValue':0x0,'comment':_0xb6f0('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xb6f0('0x5')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb6f0('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xb6f0('0x5')](0x9)[_0xb6f0('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb6f0('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xb6f0('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xb6f0('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb6f0('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb6f0('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xb6f0('0x5')](0x9)[_0xb6f0('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb6f0('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb6f0('0x5')](0x9)[_0xb6f0('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb6f0('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb6f0('0x5')](0x9)[_0xb6f0('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb6f0('0x5')](0x5)[_0xb6f0('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb6f0('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb6f0('0x5')](0x9)[_0xb6f0('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb6f0('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xb6f0('0xf')](_0xb6f0('0x1b'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xb6f0('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb6f0('0x5')](0x3)[_0xb6f0('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb6f0('0x1c')},'dialCutDigit':{'type':Sequelize[_0xb6f0('0x5')](0x3)[_0xb6f0('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb6f0('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb6f0('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb6f0('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb6f0('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0xb6f0('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb6f0('0x1f')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb6f0('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb6f0('0x5')](0x3)[_0xb6f0('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb6f0('0x5')](0x5)[_0xb6f0('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xb6f0('0x5')](0x3)[_0xb6f0('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb6f0('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0xb6f0('0x5')](0x5)[_0xb6f0('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb6f0('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb6f0('0x5')](0x3)[_0xb6f0('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb6f0('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb6f0('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb6f0('0x24')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 67dd923..07c3d96 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 _0xae88=['COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','insert','cm_hopper_additional_phones','OrderBy','ci.OrderBY','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_contacts','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','offset','count','set','Content-Range','then','IvrCampaigns','UserProfileResource','end','error','name','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','include','omit','updatedAt','createdAt','update','destroy','getHoppers','findOne','nolimit','CmHopper','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','phone','field','NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)'];(function(_0xf89c3,_0x351bf1){var _0x274fc8=function(_0x5e0c91){while(--_0x5e0c91){_0xf89c3['push'](_0xf89c3['shift']());}};_0x274fc8(++_0x351bf1);}(_0xae88,0xa1));var _0x8ae8=function(_0x5e11dc,_0x21406e){_0x5e11dc=_0x5e11dc-0x0;var _0x530af1=_0xae88[_0x5e11dc];return _0x530af1;};'use strict';var emlformat=require(_0x8ae8('0x0'));var rimraf=require(_0x8ae8('0x1'));var zipdir=require(_0x8ae8('0x2'));var jsonpatch=require(_0x8ae8('0x3'));var rp=require(_0x8ae8('0x4'));var moment=require('moment');var BPromise=require(_0x8ae8('0x5'));var Mustache=require('mustache');var util=require(_0x8ae8('0x6'));var path=require('path');var sox=require(_0x8ae8('0x7'));var csv=require('to-csv');var ejs=require(_0x8ae8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ae8('0x9'));var squel=require(_0x8ae8('0xa'));var crypto=require('crypto');var jsforce=require(_0x8ae8('0xb'));var deskjs=require(_0x8ae8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8ae8('0xd'));var Papa=require(_0x8ae8('0xe'));var Redis=require(_0x8ae8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8ae8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ae8('0x11'))(_0x8ae8('0x12'));var utils=require(_0x8ae8('0x13'));var config=require(_0x8ae8('0x14'));var licenseUtil=require(_0x8ae8('0x15'));var db=require(_0x8ae8('0x16'))['db'];function respondWithStatusCode(_0x56ca5d,_0x1e0ca9){_0x1e0ca9=_0x1e0ca9||0xcc;return function(_0xca6f82){if(_0xca6f82){return _0x56ca5d[_0x8ae8('0x17')](_0x1e0ca9);}return _0x56ca5d[_0x8ae8('0x18')](_0x1e0ca9)['end']();};}function respondWithResult(_0x2f47ca,_0x13b09a){_0x13b09a=_0x13b09a||0xc8;return function(_0x30b12c){if(_0x30b12c){return _0x2f47ca[_0x8ae8('0x18')](_0x13b09a)[_0x8ae8('0x19')](_0x30b12c);}};}function respondWithFilteredResult(_0x19a1d9,_0x2df77c){return function(_0x1eb2a9){if(_0x1eb2a9){var _0x3c674f=typeof _0x2df77c['offset']==='undefined'&&typeof _0x2df77c[_0x8ae8('0x1a')]===_0x8ae8('0x1b');var _0x3bc66c=_0x1eb2a9['count'];var _0x2620de=_0x3c674f?0x0:_0x2df77c[_0x8ae8('0x1c')];var _0x3909c7=_0x3c674f?_0x1eb2a9[_0x8ae8('0x1d')]:_0x2df77c['offset']+_0x2df77c['limit'];var _0x3c276c;if(_0x3909c7>=_0x3bc66c){_0x3909c7=_0x3bc66c;_0x3c276c=0xc8;}else{_0x3c276c=0xce;}_0x19a1d9['status'](_0x3c276c);return _0x19a1d9[_0x8ae8('0x1e')](_0x8ae8('0x1f'),_0x2620de+'-'+_0x3909c7+'/'+_0x3bc66c)[_0x8ae8('0x19')](_0x1eb2a9);}return null;};}function patchUpdates(_0x76554d){return function(_0x472718){try{jsonpatch['apply'](_0x472718,_0x76554d,!![]);}catch(_0x9ec156){return BPromise['reject'](_0x9ec156);}return _0x472718['save']();};}function saveUpdates(_0x1ee2a8,_0x20756c){return function(_0xd8b0f6){if(_0xd8b0f6){return _0xd8b0f6['update'](_0x1ee2a8)[_0x8ae8('0x20')](function(_0x5a3df6){return _0x5a3df6;});}return null;};}function removeEntity(_0x2136e0,_0x2e46af){return function(_0x205214){if(_0x205214){return _0x205214['destroy']()[_0x8ae8('0x20')](function(){var _0x25ce3a=_0x205214['get']({'plain':!![]});var _0x2c8ce3=_0x8ae8('0x21');return db[_0x8ae8('0x22')]['destroy']({'where':{'type':_0x2c8ce3,'resourceId':_0x25ce3a['id']}})['then'](function(){return _0x205214;});})[_0x8ae8('0x20')](function(){_0x2136e0[_0x8ae8('0x18')](0xcc)[_0x8ae8('0x23')]();});}};}function handleEntityNotFound(_0xbc7b86,_0x465254){return function(_0x1872d5){if(!_0x1872d5){_0xbc7b86[_0x8ae8('0x17')](0x194);}return _0x1872d5;};}function handleError(_0x5567e4,_0x2b014d){_0x2b014d=_0x2b014d||0x1f4;return function(_0x209bbd){logger[_0x8ae8('0x24')](_0x209bbd['stack']);if(_0x209bbd[_0x8ae8('0x25')]){delete _0x209bbd[_0x8ae8('0x25')];}_0x5567e4[_0x8ae8('0x18')](_0x2b014d)['send'](_0x209bbd);};}exports[_0x8ae8('0x26')]=function(_0x578e8c,_0xfb5c29){var _0x47cbfa={},_0x201bef={},_0x349eae={'count':0x0,'rows':[]};var _0x4e99b2=_[_0x8ae8('0x27')](db[_0x8ae8('0x28')][_0x8ae8('0x29')],function(_0x49d1e5){return{'name':_0x49d1e5[_0x8ae8('0x2a')],'type':_0x49d1e5[_0x8ae8('0x2b')][_0x8ae8('0x2c')]};});_0x201bef[_0x8ae8('0x2d')]=_[_0x8ae8('0x27')](_0x4e99b2,_0x8ae8('0x25'));_0x201bef[_0x8ae8('0x2e')]=_[_0x8ae8('0x2f')](_0x578e8c[_0x8ae8('0x2e')]);_0x201bef[_0x8ae8('0x30')]=_[_0x8ae8('0x31')](_0x201bef[_0x8ae8('0x2d')],_0x201bef[_0x8ae8('0x2e')]);_0x47cbfa[_0x8ae8('0x32')]=_[_0x8ae8('0x31')](_0x201bef['model'],qs['fields'](_0x578e8c[_0x8ae8('0x2e')][_0x8ae8('0x33')]));_0x47cbfa['attributes']=_0x47cbfa[_0x8ae8('0x32')]['length']?_0x47cbfa[_0x8ae8('0x32')]:_0x201bef[_0x8ae8('0x2d')];if(!_0x578e8c[_0x8ae8('0x2e')][_0x8ae8('0x34')]('nolimit')){_0x47cbfa['limit']=qs[_0x8ae8('0x1a')](_0x578e8c[_0x8ae8('0x2e')]['limit']);_0x47cbfa[_0x8ae8('0x1c')]=qs[_0x8ae8('0x1c')](_0x578e8c[_0x8ae8('0x2e')][_0x8ae8('0x1c')]);}_0x47cbfa[_0x8ae8('0x35')]=qs[_0x8ae8('0x36')](_0x578e8c[_0x8ae8('0x2e')][_0x8ae8('0x36')]);_0x47cbfa[_0x8ae8('0x37')]=qs[_0x8ae8('0x30')](_[_0x8ae8('0x38')](_0x578e8c[_0x8ae8('0x2e')],_0x201bef['filters']),_0x4e99b2);if(_0x578e8c['query'][_0x8ae8('0x39')]){_0x47cbfa['where']=_[_0x8ae8('0x3a')](_0x47cbfa[_0x8ae8('0x37')],{'$or':_[_0x8ae8('0x27')](_0x4e99b2,function(_0x12af7c){if(_0x12af7c[_0x8ae8('0x2b')]!=='VIRTUAL'){var _0x9692e4={};_0x9692e4[_0x12af7c[_0x8ae8('0x25')]]={'$like':'%'+_0x578e8c[_0x8ae8('0x2e')][_0x8ae8('0x39')]+'%'};return _0x9692e4;}})});}_0x47cbfa=_[_0x8ae8('0x3a')]({},_0x47cbfa,_0x578e8c[_0x8ae8('0x3b')]);var _0x46b57e={'where':_0x47cbfa['where']};return db['Campaign'][_0x8ae8('0x1d')](_0x46b57e)[_0x8ae8('0x20')](function(_0x9eef24){_0x349eae[_0x8ae8('0x1d')]=_0x9eef24;if(_0x578e8c[_0x8ae8('0x2e')]['includeAll']){_0x47cbfa['include']=[{'all':!![]}];}return db[_0x8ae8('0x28')][_0x8ae8('0x3c')](_0x47cbfa);})[_0x8ae8('0x20')](function(_0x4646e2){_0x349eae[_0x8ae8('0x3d')]=_0x4646e2;return _0x349eae;})[_0x8ae8('0x20')](respondWithFilteredResult(_0xfb5c29,_0x47cbfa))[_0x8ae8('0x3e')](handleError(_0xfb5c29,null));};exports[_0x8ae8('0x3f')]=function(_0x4e6c94,_0x264d86){var _0x424dd8={'raw':![],'where':{'id':_0x4e6c94[_0x8ae8('0x40')]['id']}},_0x3a6c6e={};_0x3a6c6e[_0x8ae8('0x2d')]=_[_0x8ae8('0x2f')](db['Campaign'][_0x8ae8('0x29')]);_0x3a6c6e[_0x8ae8('0x2e')]=_[_0x8ae8('0x2f')](_0x4e6c94['query']);_0x3a6c6e[_0x8ae8('0x30')]=_[_0x8ae8('0x31')](_0x3a6c6e[_0x8ae8('0x2d')],_0x3a6c6e[_0x8ae8('0x2e')]);_0x424dd8[_0x8ae8('0x32')]=_[_0x8ae8('0x31')](_0x3a6c6e[_0x8ae8('0x2d')],qs[_0x8ae8('0x33')](_0x4e6c94[_0x8ae8('0x2e')][_0x8ae8('0x33')]));_0x424dd8[_0x8ae8('0x32')]=_0x424dd8[_0x8ae8('0x32')]['length']?_0x424dd8[_0x8ae8('0x32')]:_0x3a6c6e['model'];if(_0x4e6c94['query'][_0x8ae8('0x41')]){_0x424dd8['include']=[{'all':!![]}];}_0x424dd8=_[_0x8ae8('0x3a')]({},_0x424dd8,_0x4e6c94[_0x8ae8('0x3b')]);return db['Campaign']['find'](_0x424dd8)[_0x8ae8('0x20')](handleEntityNotFound(_0x264d86,null))[_0x8ae8('0x20')](respondWithResult(_0x264d86,null))[_0x8ae8('0x3e')](handleError(_0x264d86,null));};exports[_0x8ae8('0x42')]=function(_0x2de81d,_0x12c4bb){return db[_0x8ae8('0x28')]['create'](_0x2de81d[_0x8ae8('0x43')],{})[_0x8ae8('0x20')](function(_0xbea562){var _0xc7ed31=_0x2de81d[_0x8ae8('0x44')][_0x8ae8('0x45')]({'plain':!![]});if(!_0xc7ed31)throw new Error(_0x8ae8('0x46'));if(_0xc7ed31[_0x8ae8('0x47')]===_0x8ae8('0x44')){var _0x32f674=_0xbea562[_0x8ae8('0x45')]({'plain':!![]});var _0x1e3bd3=_0x8ae8('0x21');return db[_0x8ae8('0x48')][_0x8ae8('0x49')]({'where':{'name':_0x1e3bd3,'userProfileId':_0xc7ed31[_0x8ae8('0x4a')]},'raw':!![]})['then'](function(_0x116090){if(_0x116090&&_0x116090[_0x8ae8('0x4b')]===0x0){return db[_0x8ae8('0x22')]['create']({'name':_0x32f674[_0x8ae8('0x25')],'resourceId':_0x32f674['id'],'type':_0x116090[_0x8ae8('0x25')],'sectionId':_0x116090['id']},{})['then'](function(){return _0xbea562;});}else{return _0xbea562;}})[_0x8ae8('0x3e')](function(_0x52de05){logger[_0x8ae8('0x24')](_0x8ae8('0x4c'),_0x52de05);throw _0x52de05;});}return _0xbea562;})[_0x8ae8('0x20')](respondWithResult(_0x12c4bb,0xc9))[_0x8ae8('0x3e')](handleError(_0x12c4bb,null));};exports[_0x8ae8('0x4d')]=function(_0x1d057b,_0x52e8f4){var _0x12d376={'where':{'id':_0x1d057b['params']['id']}},_0x27cb15={};_0x27cb15[_0x8ae8('0x2d')]=_[_0x8ae8('0x2f')](db[_0x8ae8('0x28')][_0x8ae8('0x29')]);_0x12d376['attributes']=_[_0x8ae8('0x31')](_0x27cb15['model'],qs[_0x8ae8('0x33')](_0x1d057b[_0x8ae8('0x2e')][_0x8ae8('0x33')]));_0x12d376[_0x8ae8('0x32')]=_0x12d376[_0x8ae8('0x32')][_0x8ae8('0x4e')]?_0x12d376[_0x8ae8('0x32')]:_0x27cb15[_0x8ae8('0x2d')];if(_0x1d057b[_0x8ae8('0x2e')][_0x8ae8('0x41')]){_0x12d376[_0x8ae8('0x4f')]=[{'all':!![]}];}_0x12d376=_['merge']({},_0x12d376,_0x1d057b[_0x8ae8('0x3b')]);return db['Campaign'][_0x8ae8('0x49')](_0x12d376)[_0x8ae8('0x20')](handleEntityNotFound(_0x52e8f4,null))[_0x8ae8('0x20')](function(_0x3d4987){if(_0x3d4987){var _0x4a2207=_0x3d4987['get']({'plain':!![]});_0x4a2207=qs[_0x8ae8('0x50')](_0x4a2207,['id','createdAt',_0x8ae8('0x51')]);_0x1d057b['body']=_[_0x8ae8('0x50')](_0x1d057b['body'],['id',_0x8ae8('0x52'),_0x8ae8('0x51')]);return db[_0x8ae8('0x28')][_0x8ae8('0x42')](_[_0x8ae8('0x3a')](_0x4a2207,_0x1d057b[_0x8ae8('0x43')]),{'include':_0x1d057b['query'][_0x8ae8('0x41')]?[{'all':!![]}]:undefined})[_0x8ae8('0x20')](function(_0x1fc36a){var _0x3f7593=_0x1d057b['user'][_0x8ae8('0x45')]({'plain':!![]});if(!_0x3f7593)throw new Error(_0x8ae8('0x46'));if(_0x3f7593[_0x8ae8('0x47')]==='user'){var _0x3cff74=_0x1fc36a[_0x8ae8('0x45')]({'plain':!![]});var _0x471b1e=_0x8ae8('0x21');return db['UserProfileSection'][_0x8ae8('0x49')]({'where':{'name':_0x471b1e,'userProfileId':_0x3f7593[_0x8ae8('0x4a')]},'raw':!![]})[_0x8ae8('0x20')](function(_0x1f7b8f){if(_0x1f7b8f&&_0x1f7b8f['autoAssociation']===0x0){return db[_0x8ae8('0x22')]['create']({'name':_0x3cff74[_0x8ae8('0x25')],'resourceId':_0x3cff74['id'],'type':_0x1f7b8f[_0x8ae8('0x25')],'sectionId':_0x1f7b8f['id']},{})[_0x8ae8('0x20')](function(){return _0x1fc36a;});}else{return _0x1fc36a;}})['catch'](function(_0x2ad525){logger[_0x8ae8('0x24')](_0x8ae8('0x4c'),_0x2ad525);throw _0x2ad525;});}return _0x1fc36a;});}})[_0x8ae8('0x20')](respondWithResult(_0x52e8f4,0xc9))[_0x8ae8('0x3e')](handleError(_0x52e8f4,null));};exports[_0x8ae8('0x53')]=function(_0xe32f4e,_0x53c5fd){if(_0xe32f4e[_0x8ae8('0x43')]['id']){delete _0xe32f4e['body']['id'];}return db[_0x8ae8('0x28')]['find']({'where':{'id':_0xe32f4e[_0x8ae8('0x40')]['id']}})['then'](handleEntityNotFound(_0x53c5fd,null))[_0x8ae8('0x20')](saveUpdates(_0xe32f4e[_0x8ae8('0x43')],null))[_0x8ae8('0x20')](respondWithResult(_0x53c5fd,null))['catch'](handleError(_0x53c5fd,null));};exports[_0x8ae8('0x54')]=function(_0xd4a348,_0x131ec9){return db['Campaign'][_0x8ae8('0x49')]({'where':{'id':_0xd4a348['params']['id']}})['then'](handleEntityNotFound(_0x131ec9,null))[_0x8ae8('0x20')](removeEntity(_0x131ec9,null))['catch'](handleError(_0x131ec9,null));};exports[_0x8ae8('0x55')]=function(_0x233fd1,_0x218e9d,_0x3ae3ee){var _0x520915={'raw':!![],'where':{}};var _0x2b9ae8={};var _0x58def5={'count':0x0,'rows':[]};return db[_0x8ae8('0x28')][_0x8ae8('0x56')]({'where':{'id':_0x233fd1[_0x8ae8('0x40')]['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0x218e9d,null))[_0x8ae8('0x20')](function(_0x21293c){if(_0x21293c){_0x2b9ae8[_0x8ae8('0x2d')]=_[_0x8ae8('0x2f')](db['CmHopper'][_0x8ae8('0x29')]);_0x2b9ae8[_0x8ae8('0x2e')]=_[_0x8ae8('0x2f')](_0x233fd1['query']);_0x2b9ae8['filters']=_[_0x8ae8('0x31')](_0x2b9ae8[_0x8ae8('0x2d')],_0x2b9ae8[_0x8ae8('0x2e')]);_0x520915[_0x8ae8('0x32')]=_[_0x8ae8('0x31')](_0x2b9ae8[_0x8ae8('0x2d')],qs[_0x8ae8('0x33')](_0x233fd1[_0x8ae8('0x2e')]['fields']));_0x520915['attributes']=_0x520915[_0x8ae8('0x32')][_0x8ae8('0x4e')]?_0x520915[_0x8ae8('0x32')]:_0x2b9ae8[_0x8ae8('0x2d')];if(!_0x233fd1['query'][_0x8ae8('0x34')](_0x8ae8('0x57'))){_0x520915[_0x8ae8('0x1a')]=qs[_0x8ae8('0x1a')](_0x233fd1[_0x8ae8('0x2e')]['limit']);_0x520915[_0x8ae8('0x1c')]=qs[_0x8ae8('0x1c')](_0x233fd1[_0x8ae8('0x2e')][_0x8ae8('0x1c')]);}_0x520915['order']=qs[_0x8ae8('0x36')](_0x233fd1[_0x8ae8('0x2e')][_0x8ae8('0x36')]);_0x520915['where']=qs[_0x8ae8('0x30')](_['pick'](_0x233fd1[_0x8ae8('0x2e')],_0x2b9ae8['filters']));_0x520915['where']['CampaignId']=_0x21293c['id'];if(_0x233fd1['query'][_0x8ae8('0x39')]){_0x520915[_0x8ae8('0x37')]=_[_0x8ae8('0x3a')](_0x520915[_0x8ae8('0x37')],{'$or':_[_0x8ae8('0x27')](_0x520915[_0x8ae8('0x32')],function(_0x249885){var _0x29a34b={};_0x29a34b[_0x249885]={'$like':'%'+_0x233fd1[_0x8ae8('0x2e')][_0x8ae8('0x39')]+'%'};return _0x29a34b;})});}_0x520915=_[_0x8ae8('0x3a')]({},_0x520915,_0x233fd1[_0x8ae8('0x3b')]);return db[_0x8ae8('0x58')]['count']({'where':_0x520915[_0x8ae8('0x37')]})[_0x8ae8('0x20')](function(_0x16a65e){_0x58def5['count']=_0x16a65e;if(_0x233fd1[_0x8ae8('0x2e')][_0x8ae8('0x41')]){_0x520915[_0x8ae8('0x4f')]=[{'all':!![]}];}return db[_0x8ae8('0x58')][_0x8ae8('0x3c')](_0x520915);})[_0x8ae8('0x20')](function(_0x49441b){_0x58def5[_0x8ae8('0x3d')]=_0x49441b;return _0x58def5;});}})[_0x8ae8('0x20')](respondWithFilteredResult(_0x218e9d,_0x520915))[_0x8ae8('0x3e')](handleError(_0x218e9d,null));};exports[_0x8ae8('0x59')]=function(_0x39398c,_0x5e8f60,_0x530bc0){var _0x4684b5={'raw':!![],'where':{}};var _0x17c6af={};var _0x51c184={'count':0x0,'rows':[]};return db[_0x8ae8('0x28')][_0x8ae8('0x56')]({'where':{'id':_0x39398c[_0x8ae8('0x40')]['id']}})['then'](handleEntityNotFound(_0x5e8f60,null))[_0x8ae8('0x20')](function(_0x1f9256){if(_0x1f9256){_0x17c6af[_0x8ae8('0x2d')]=_['keys'](db[_0x8ae8('0x5a')]['rawAttributes']);_0x17c6af[_0x8ae8('0x2e')]=_[_0x8ae8('0x2f')](_0x39398c[_0x8ae8('0x2e')]);_0x17c6af['filters']=_['intersection'](_0x17c6af[_0x8ae8('0x2d')],_0x17c6af[_0x8ae8('0x2e')]);_0x4684b5[_0x8ae8('0x32')]=_[_0x8ae8('0x31')](_0x17c6af[_0x8ae8('0x2d')],qs[_0x8ae8('0x33')](_0x39398c['query']['fields']));_0x4684b5[_0x8ae8('0x32')]=_0x4684b5[_0x8ae8('0x32')]['length']?_0x4684b5['attributes']:_0x17c6af['model'];if(!_0x39398c[_0x8ae8('0x2e')][_0x8ae8('0x34')]('nolimit')){_0x4684b5[_0x8ae8('0x1a')]=qs[_0x8ae8('0x1a')](_0x39398c['query'][_0x8ae8('0x1a')]);_0x4684b5[_0x8ae8('0x1c')]=qs[_0x8ae8('0x1c')](_0x39398c[_0x8ae8('0x2e')][_0x8ae8('0x1c')]);}_0x4684b5[_0x8ae8('0x35')]=qs[_0x8ae8('0x36')](_0x39398c[_0x8ae8('0x2e')]['sort']);_0x4684b5[_0x8ae8('0x37')]=qs['filters'](_[_0x8ae8('0x38')](_0x39398c[_0x8ae8('0x2e')],_0x17c6af[_0x8ae8('0x30')]));_0x4684b5[_0x8ae8('0x37')][_0x8ae8('0x5b')]=_0x1f9256['id'];if(_0x39398c[_0x8ae8('0x2e')]['filter']){_0x4684b5[_0x8ae8('0x37')]=_[_0x8ae8('0x3a')](_0x4684b5['where'],{'$or':_[_0x8ae8('0x27')](_0x4684b5[_0x8ae8('0x32')],function(_0xa6b101){var _0x5810d1={};_0x5810d1[_0xa6b101]={'$like':'%'+_0x39398c[_0x8ae8('0x2e')][_0x8ae8('0x39')]+'%'};return _0x5810d1;})});}_0x4684b5=_['merge']({},_0x4684b5,_0x39398c[_0x8ae8('0x3b')]);return db[_0x8ae8('0x5a')][_0x8ae8('0x1d')]({'where':_0x4684b5[_0x8ae8('0x37')]})[_0x8ae8('0x20')](function(_0x5c60fd){_0x51c184[_0x8ae8('0x1d')]=_0x5c60fd;if(_0x39398c[_0x8ae8('0x2e')][_0x8ae8('0x41')]){_0x4684b5[_0x8ae8('0x4f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x8ae8('0x3c')](_0x4684b5);})[_0x8ae8('0x20')](function(_0x167652){_0x51c184[_0x8ae8('0x3d')]=_0x167652;return _0x51c184;});}})['then'](respondWithFilteredResult(_0x5e8f60,_0x4684b5))[_0x8ae8('0x3e')](handleError(_0x5e8f60,null));};exports[_0x8ae8('0x5c')]=function(_0x421c51,_0x269c53,_0x2230d9){var _0x5483b1={'raw':!![],'where':{}};var _0x4fddc6={};var _0x42f7b9={'count':0x0,'rows':[]};return db[_0x8ae8('0x28')][_0x8ae8('0x56')]({'where':{'id':_0x421c51[_0x8ae8('0x40')]['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0x269c53,null))['then'](function(_0x237a86){if(_0x237a86){_0x4fddc6[_0x8ae8('0x2d')]=_[_0x8ae8('0x2f')](db['CmHopperFinal'][_0x8ae8('0x29')]);_0x4fddc6[_0x8ae8('0x2e')]=_[_0x8ae8('0x2f')](_0x421c51[_0x8ae8('0x2e')]);_0x4fddc6['filters']=_['intersection'](_0x4fddc6['model'],_0x4fddc6['query']);_0x5483b1['attributes']=_['intersection'](_0x4fddc6[_0x8ae8('0x2d')],qs[_0x8ae8('0x33')](_0x421c51[_0x8ae8('0x2e')]['fields']));_0x5483b1[_0x8ae8('0x32')]=_0x5483b1[_0x8ae8('0x32')][_0x8ae8('0x4e')]?_0x5483b1[_0x8ae8('0x32')]:_0x4fddc6[_0x8ae8('0x2d')];if(!_0x421c51[_0x8ae8('0x2e')][_0x8ae8('0x34')](_0x8ae8('0x57'))){_0x5483b1['limit']=qs[_0x8ae8('0x1a')](_0x421c51[_0x8ae8('0x2e')][_0x8ae8('0x1a')]);_0x5483b1['offset']=qs[_0x8ae8('0x1c')](_0x421c51['query'][_0x8ae8('0x1c')]);}_0x5483b1[_0x8ae8('0x35')]=qs[_0x8ae8('0x36')](_0x421c51['query'][_0x8ae8('0x36')]);_0x5483b1['where']=qs[_0x8ae8('0x30')](_['pick'](_0x421c51[_0x8ae8('0x2e')],_0x4fddc6[_0x8ae8('0x30')]));_0x5483b1[_0x8ae8('0x37')][_0x8ae8('0x5b')]=_0x237a86['id'];if(_0x421c51[_0x8ae8('0x2e')][_0x8ae8('0x39')]){_0x5483b1[_0x8ae8('0x37')]=_[_0x8ae8('0x3a')](_0x5483b1[_0x8ae8('0x37')],{'$or':_['map'](_0x5483b1['attributes'],function(_0x58baa3){var _0x58aecc={};_0x58aecc[_0x58baa3]={'$like':'%'+_0x421c51['query'][_0x8ae8('0x39')]+'%'};return _0x58aecc;})});}_0x5483b1=_[_0x8ae8('0x3a')]({},_0x5483b1,_0x421c51[_0x8ae8('0x3b')]);return db['CmHopperFinal'][_0x8ae8('0x1d')]({'where':_0x5483b1['where']})[_0x8ae8('0x20')](function(_0x373572){_0x42f7b9[_0x8ae8('0x1d')]=_0x373572;if(_0x421c51[_0x8ae8('0x2e')]['includeAll']){_0x5483b1[_0x8ae8('0x4f')]=[{'all':!![]}];}return db[_0x8ae8('0x5d')]['findAll'](_0x5483b1);})[_0x8ae8('0x20')](function(_0x473850){_0x42f7b9[_0x8ae8('0x3d')]=_0x473850;return _0x42f7b9;});}})[_0x8ae8('0x20')](respondWithFilteredResult(_0x269c53,_0x5483b1))[_0x8ae8('0x3e')](handleError(_0x269c53,null));};exports['getHopperBlacks']=function(_0x5311ac,_0x22e322,_0x119296){var _0xce2d44={'raw':!![],'where':{}};var _0x18f9f3={};var _0x2af79b={'count':0x0,'rows':[]};return db[_0x8ae8('0x28')][_0x8ae8('0x56')]({'where':{'id':_0x5311ac[_0x8ae8('0x40')]['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0x22e322,null))[_0x8ae8('0x20')](function(_0x3cbe55){if(_0x3cbe55){_0x18f9f3[_0x8ae8('0x2d')]=_[_0x8ae8('0x2f')](db[_0x8ae8('0x5e')][_0x8ae8('0x29')]);_0x18f9f3[_0x8ae8('0x2e')]=_[_0x8ae8('0x2f')](_0x5311ac[_0x8ae8('0x2e')]);_0x18f9f3[_0x8ae8('0x30')]=_[_0x8ae8('0x31')](_0x18f9f3[_0x8ae8('0x2d')],_0x18f9f3[_0x8ae8('0x2e')]);_0xce2d44['attributes']=_['intersection'](_0x18f9f3[_0x8ae8('0x2d')],qs[_0x8ae8('0x33')](_0x5311ac[_0x8ae8('0x2e')][_0x8ae8('0x33')]));_0xce2d44['attributes']=_0xce2d44['attributes'][_0x8ae8('0x4e')]?_0xce2d44[_0x8ae8('0x32')]:_0x18f9f3['model'];if(!_0x5311ac[_0x8ae8('0x2e')]['hasOwnProperty'](_0x8ae8('0x57'))){_0xce2d44[_0x8ae8('0x1a')]=qs[_0x8ae8('0x1a')](_0x5311ac[_0x8ae8('0x2e')]['limit']);_0xce2d44[_0x8ae8('0x1c')]=qs['offset'](_0x5311ac['query']['offset']);}_0xce2d44[_0x8ae8('0x35')]=qs[_0x8ae8('0x36')](_0x5311ac[_0x8ae8('0x2e')][_0x8ae8('0x36')]);_0xce2d44[_0x8ae8('0x37')]=qs[_0x8ae8('0x30')](_['pick'](_0x5311ac[_0x8ae8('0x2e')],_0x18f9f3[_0x8ae8('0x30')]));_0xce2d44[_0x8ae8('0x37')]['CampaignId']=_0x3cbe55['id'];if(_0x5311ac[_0x8ae8('0x2e')][_0x8ae8('0x39')]){_0xce2d44[_0x8ae8('0x37')]=_[_0x8ae8('0x3a')](_0xce2d44[_0x8ae8('0x37')],{'$or':_[_0x8ae8('0x27')](_0xce2d44[_0x8ae8('0x32')],function(_0x7cfc10){var _0x2fc658={};_0x2fc658[_0x7cfc10]={'$like':'%'+_0x5311ac[_0x8ae8('0x2e')][_0x8ae8('0x39')]+'%'};return _0x2fc658;})});}_0xce2d44=_['merge']({},_0xce2d44,_0x5311ac[_0x8ae8('0x3b')]);return db[_0x8ae8('0x5e')]['count']({'where':_0xce2d44['where']})[_0x8ae8('0x20')](function(_0x220907){_0x2af79b[_0x8ae8('0x1d')]=_0x220907;if(_0x5311ac['query'][_0x8ae8('0x41')]){_0xce2d44[_0x8ae8('0x4f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x8ae8('0x3c')](_0xce2d44);})[_0x8ae8('0x20')](function(_0x127186){_0x2af79b['rows']=_0x127186;return _0x2af79b;});}})['then'](respondWithFilteredResult(_0x22e322,_0xce2d44))[_0x8ae8('0x3e')](handleError(_0x22e322,null));};exports[_0x8ae8('0x5f')]=function(_0x5b8fa1,_0xa9f8a6,_0x5a6471){var _0x1123b2={};var _0x22ed19={};var _0x154096;var _0x166c41;return db[_0x8ae8('0x28')][_0x8ae8('0x56')]({'where':{'id':_0x5b8fa1['params']['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0xa9f8a6,null))['then'](function(_0x279abc){if(_0x279abc){_0x154096=_0x279abc;_0x22ed19[_0x8ae8('0x2d')]=_[_0x8ae8('0x2f')](db[_0x8ae8('0x60')][_0x8ae8('0x29')]);_0x22ed19[_0x8ae8('0x2e')]=_['keys'](_0x5b8fa1[_0x8ae8('0x2e')]);_0x22ed19[_0x8ae8('0x30')]=_['intersection'](_0x22ed19[_0x8ae8('0x2d')],_0x22ed19[_0x8ae8('0x2e')]);_0x1123b2[_0x8ae8('0x32')]=_[_0x8ae8('0x31')](_0x22ed19[_0x8ae8('0x2d')],qs['fields'](_0x5b8fa1['query'][_0x8ae8('0x33')]));_0x1123b2[_0x8ae8('0x32')]=_0x1123b2[_0x8ae8('0x32')][_0x8ae8('0x4e')]?_0x1123b2['attributes']:_0x22ed19[_0x8ae8('0x2d')];_0x1123b2[_0x8ae8('0x35')]=qs[_0x8ae8('0x36')](_0x5b8fa1[_0x8ae8('0x2e')]['sort']);_0x1123b2[_0x8ae8('0x37')]=qs[_0x8ae8('0x30')](_[_0x8ae8('0x38')](_0x5b8fa1[_0x8ae8('0x2e')],_0x22ed19[_0x8ae8('0x30')]));if(_0x5b8fa1['query'][_0x8ae8('0x39')]){_0x1123b2[_0x8ae8('0x37')]=_['merge'](_0x1123b2[_0x8ae8('0x37')],{'$or':_[_0x8ae8('0x27')](_0x1123b2[_0x8ae8('0x32')],function(_0x93518b){var _0x5908a7={};_0x5908a7[_0x93518b]={'$like':'%'+_0x5b8fa1[_0x8ae8('0x2e')][_0x8ae8('0x39')]+'%'};return _0x5908a7;})});}_0x1123b2=_[_0x8ae8('0x3a')]({},_0x1123b2,_0x5b8fa1['options']);return _0x154096[_0x8ae8('0x5f')](_0x1123b2);}})[_0x8ae8('0x20')](function(_0xe9379c){if(_0xe9379c){_0x166c41=_0xe9379c[_0x8ae8('0x4e')];if(!_0x5b8fa1[_0x8ae8('0x2e')][_0x8ae8('0x34')](_0x8ae8('0x57'))){_0x1123b2[_0x8ae8('0x1a')]=qs[_0x8ae8('0x1a')](_0x5b8fa1['query']['limit']);_0x1123b2[_0x8ae8('0x1c')]=qs[_0x8ae8('0x1c')](_0x5b8fa1[_0x8ae8('0x2e')]['offset']);}return _0x154096['getLists'](_0x1123b2);}})[_0x8ae8('0x20')](function(_0x278600){if(_0x278600){return _0x278600?{'count':_0x166c41,'rows':_0x278600}:null;}})[_0x8ae8('0x20')](respondWithResult(_0xa9f8a6,null))[_0x8ae8('0x3e')](handleError(_0xa9f8a6,null));};exports[_0x8ae8('0x61')]=function(_0x3f7be6,_0x51e7e3,_0x463e18){var _0xc51a79,_0x3cd185;var _0x2280a2=[];var _0x1e4934=moment()[_0x8ae8('0x62')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x8ae8('0x28')][_0x8ae8('0x49')]({'where':{'id':_0x3f7be6[_0x8ae8('0x40')]['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0x51e7e3,null))[_0x8ae8('0x20')](function(_0x1a2340){if(_0x1a2340){_0x3cd185=_0x1a2340;return _0x1a2340[_0x8ae8('0x61')](_0x3f7be6[_0x8ae8('0x43')][_0x8ae8('0x63')],_[_0x8ae8('0x50')](_0x3f7be6[_0x8ae8('0x43')],['ids','id'])||{});}return null;})[_0x8ae8('0x64')](function(_0x305418){var _0x18870e;var _0x35a0c3;_0xc51a79=_0x305418||[];var _0x51fcac=[];if(_0x305418){for(var _0x364ea7=0x0;_0x364ea7<_0x305418[_0x8ae8('0x4e')];_0x364ea7+=0x1){var _0x4ab562=_0x305418[_0x364ea7]['get']({'plain':!![]});_0x3cd185[_0x8ae8('0x65')]=_0x3f7be6[_0x8ae8('0x43')][_0x8ae8('0x65')]?_0x3f7be6[_0x8ae8('0x43')]['dialCheckDuplicateType']:_0x3cd185[_0x8ae8('0x65')];switch(_0x3cd185[_0x8ae8('0x65')]){case'always':_0x18870e=squel['insert']()[_0x8ae8('0x66')](_0x8ae8('0x67'))[_0x8ae8('0x68')](['phone',_0x8ae8('0x69'),_0x8ae8('0x6a'),_0x8ae8('0x6b'),_0x8ae8('0x5b'),'createdAt',_0x8ae8('0x51')],squel[_0x8ae8('0x6c')]()['field']('phone',_0x8ae8('0x6d'))[_0x8ae8('0x6e')](_0x8ae8('0x6f'),_0x8ae8('0x69'))['field']('id','ContactId')[_0x8ae8('0x6e')](_0x4ab562[_0x8ae8('0x70')][_0x8ae8('0x71')](),_0x8ae8('0x6b'))[_0x8ae8('0x6e')](_0x3f7be6[_0x8ae8('0x40')]['id'][_0x8ae8('0x71')](),_0x8ae8('0x5b'))['field']('\x27'+_0x1e4934+'\x27',_0x8ae8('0x52'))['field']('\x27'+_0x1e4934+'\x27',_0x8ae8('0x51'))[_0x8ae8('0x72')]('cm_contacts')[_0x8ae8('0x37')](_0x8ae8('0x73'))[_0x8ae8('0x37')](_0x8ae8('0x74'),_0x4ab562[_0x8ae8('0x70')][_0x8ae8('0x71')]())[_0x8ae8('0x37')](_0x8ae8('0x75'))[_0x8ae8('0x37')](_0x8ae8('0x76'),squel[_0x8ae8('0x6c')]()[_0x8ae8('0x6e')](_0x8ae8('0x77'))[_0x8ae8('0x72')](_0x8ae8('0x78'))[_0x8ae8('0x37')](_0x8ae8('0x79'),_0x3f7be6[_0x8ae8('0x40')]['id'][_0x8ae8('0x71')]()))[_0x8ae8('0x37')](_0x8ae8('0x76'),squel[_0x8ae8('0x6c')]()['field'](_0x8ae8('0x7a'))[_0x8ae8('0x72')](_0x8ae8('0x67'))[_0x8ae8('0x37')](_0x8ae8('0x79'),_0x3f7be6[_0x8ae8('0x40')]['id'][_0x8ae8('0x71')]())))[_0x8ae8('0x71')]();break;case'onlyIfOpen':_0x18870e=squel['insert']()['into'](_0x8ae8('0x67'))[_0x8ae8('0x68')]([_0x8ae8('0x6d'),_0x8ae8('0x69'),_0x8ae8('0x6a'),_0x8ae8('0x6b'),_0x8ae8('0x5b'),'createdAt',_0x8ae8('0x51')],squel[_0x8ae8('0x6c')]()['field']('phone','phone')[_0x8ae8('0x6e')](_0x8ae8('0x6f'),_0x8ae8('0x69'))[_0x8ae8('0x6e')]('id',_0x8ae8('0x6a'))['field'](_0x4ab562[_0x8ae8('0x70')]['toString'](),_0x8ae8('0x6b'))[_0x8ae8('0x6e')](_0x3f7be6[_0x8ae8('0x40')]['id'][_0x8ae8('0x71')](),_0x8ae8('0x5b'))[_0x8ae8('0x6e')]('\x27'+_0x1e4934+'\x27',_0x8ae8('0x52'))[_0x8ae8('0x6e')]('\x27'+_0x1e4934+'\x27',_0x8ae8('0x51'))[_0x8ae8('0x72')]('cm_contacts')[_0x8ae8('0x37')](_0x8ae8('0x73'))['where'](_0x8ae8('0x74'),_0x4ab562['CmListId'][_0x8ae8('0x71')]())[_0x8ae8('0x37')](_0x8ae8('0x75'))[_0x8ae8('0x37')](_0x8ae8('0x76'),squel[_0x8ae8('0x6c')]()[_0x8ae8('0x6e')](_0x8ae8('0x7a'))[_0x8ae8('0x72')]('cm_hopper')['where'](_0x8ae8('0x79'),_0x3f7be6[_0x8ae8('0x40')]['id']['toString']())))[_0x8ae8('0x71')]();break;default:_0x18870e=squel['insert']()[_0x8ae8('0x66')](_0x8ae8('0x67'))['fromQuery']([_0x8ae8('0x6d'),'scheduledAt','ContactId',_0x8ae8('0x6b'),_0x8ae8('0x5b'),'createdAt',_0x8ae8('0x51')],squel[_0x8ae8('0x6c')]()[_0x8ae8('0x6e')](_0x8ae8('0x6d'),_0x8ae8('0x6d'))['field'](_0x8ae8('0x6f'),_0x8ae8('0x69'))[_0x8ae8('0x6e')]('id','ContactId')[_0x8ae8('0x6e')](_0x4ab562['CmListId']['toString'](),_0x8ae8('0x6b'))['field'](_0x3f7be6[_0x8ae8('0x40')]['id'][_0x8ae8('0x71')](),_0x8ae8('0x5b'))[_0x8ae8('0x6e')]('\x27'+_0x1e4934+'\x27',_0x8ae8('0x52'))[_0x8ae8('0x6e')]('\x27'+_0x1e4934+'\x27',_0x8ae8('0x51'))['from']('cm_contacts')[_0x8ae8('0x37')](_0x8ae8('0x73'))[_0x8ae8('0x37')](_0x8ae8('0x74'),_0x4ab562[_0x8ae8('0x70')][_0x8ae8('0x71')]())[_0x8ae8('0x37')](_0x8ae8('0x75')))[_0x8ae8('0x71')]();}_0x35a0c3=squel[_0x8ae8('0x7b')]()[_0x8ae8('0x66')](_0x8ae8('0x7c'))[_0x8ae8('0x68')](['cmHopperId','scheduledAt','phone',_0x8ae8('0x7d'),_0x8ae8('0x52'),_0x8ae8('0x51')],squel[_0x8ae8('0x6c')]()[_0x8ae8('0x6e')]('h.id','id')['field'](_0x8ae8('0x6f'),'scheduledAt')['field']('ci.item',_0x8ae8('0x6d'))['field'](_0x8ae8('0x7e'),_0x8ae8('0x7d'))[_0x8ae8('0x6e')]('\x27'+_0x1e4934+'\x27',_0x8ae8('0x52'))[_0x8ae8('0x6e')]('\x27'+_0x1e4934+'\x27',_0x8ae8('0x51'))[_0x8ae8('0x72')](_0x8ae8('0x7f'),'ci')[_0x8ae8('0x80')]('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')[_0x8ae8('0x37')](_0x8ae8('0x81'),_0x4ab562[_0x8ae8('0x70')][_0x8ae8('0x71')]())[_0x8ae8('0x37')](_0x8ae8('0x82'),_0x3f7be6[_0x8ae8('0x40')]['id']['toString']())[_0x8ae8('0x37')]('h.createdAt\x20=\x20?',_0x1e4934))[_0x8ae8('0x71')]();_0x51fcac[_0x8ae8('0x83')](db[_0x8ae8('0x84')][_0x8ae8('0x2e')](_0x18870e));_0x2280a2[_0x8ae8('0x83')](db[_0x8ae8('0x84')][_0x8ae8('0x2e')](_0x35a0c3));}return BPromise['all'](_0x51fcac);}})[_0x8ae8('0x20')](function(){return BPromise[_0x8ae8('0x85')](_0x2280a2);})[_0x8ae8('0x20')](function(){return _0xc51a79;})[_0x8ae8('0x20')](respondWithResult(_0x51e7e3,null))[_0x8ae8('0x3e')](handleError(_0x51e7e3,null));};exports[_0x8ae8('0x86')]=function(_0x4f4c52,_0x3f54a0,_0x2a51b8){return db[_0x8ae8('0x28')]['find']({'where':{'id':_0x4f4c52['params']['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0x3f54a0,null))[_0x8ae8('0x20')](function(_0x2acdbc){if(_0x2acdbc){return _0x2acdbc[_0x8ae8('0x86')](_0x4f4c52[_0x8ae8('0x2e')][_0x8ae8('0x63')]);}})[_0x8ae8('0x20')](function(_0xcfeb08){if(_0xcfeb08){return db[_0x8ae8('0x58')][_0x8ae8('0x54')]({'where':{'ListId':_0x4f4c52[_0x8ae8('0x2e')][_0x8ae8('0x63')],'CampaignId':_0x4f4c52['params']['id']}})[_0x8ae8('0x20')](function(){return _0xcfeb08;});}})[_0x8ae8('0x20')](respondWithStatusCode(_0x3f54a0,null))[_0x8ae8('0x3e')](handleError(_0x3f54a0,null));};exports[_0x8ae8('0x87')]=function(_0x52e487,_0x657eda,_0x26aeca){var _0x41ea3e={};var _0x11b0a8={};var _0x33f65c;var _0x304707;return db[_0x8ae8('0x28')][_0x8ae8('0x56')]({'where':{'id':_0x52e487['params']['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0x657eda,null))[_0x8ae8('0x20')](function(_0xd3aae6){if(_0xd3aae6){_0x33f65c=_0xd3aae6;_0x11b0a8[_0x8ae8('0x2d')]=_['keys'](db[_0x8ae8('0x60')][_0x8ae8('0x29')]);_0x11b0a8[_0x8ae8('0x2e')]=_[_0x8ae8('0x2f')](_0x52e487[_0x8ae8('0x2e')]);_0x11b0a8[_0x8ae8('0x30')]=_[_0x8ae8('0x31')](_0x11b0a8[_0x8ae8('0x2d')],_0x11b0a8[_0x8ae8('0x2e')]);_0x41ea3e[_0x8ae8('0x32')]=_[_0x8ae8('0x31')](_0x11b0a8[_0x8ae8('0x2d')],qs[_0x8ae8('0x33')](_0x52e487[_0x8ae8('0x2e')]['fields']));_0x41ea3e[_0x8ae8('0x32')]=_0x41ea3e[_0x8ae8('0x32')][_0x8ae8('0x4e')]?_0x41ea3e[_0x8ae8('0x32')]:_0x11b0a8[_0x8ae8('0x2d')];_0x41ea3e[_0x8ae8('0x35')]=qs[_0x8ae8('0x36')](_0x52e487[_0x8ae8('0x2e')][_0x8ae8('0x36')]);_0x41ea3e['where']=qs['filters'](_[_0x8ae8('0x38')](_0x52e487[_0x8ae8('0x2e')],_0x11b0a8[_0x8ae8('0x30')]));if(_0x52e487[_0x8ae8('0x2e')][_0x8ae8('0x39')]){_0x41ea3e['where']=_['merge'](_0x41ea3e['where'],{'$or':_[_0x8ae8('0x27')](_0x41ea3e[_0x8ae8('0x32')],function(_0xbf361b){var _0x476af1={};_0x476af1[_0xbf361b]={'$like':'%'+_0x52e487[_0x8ae8('0x2e')]['filter']+'%'};return _0x476af1;})});}_0x41ea3e=_[_0x8ae8('0x3a')]({},_0x41ea3e,_0x52e487[_0x8ae8('0x3b')]);return _0x33f65c[_0x8ae8('0x87')](_0x41ea3e);}})[_0x8ae8('0x20')](function(_0x4fdcd5){if(_0x4fdcd5){_0x304707=_0x4fdcd5[_0x8ae8('0x4e')];if(!_0x52e487[_0x8ae8('0x2e')][_0x8ae8('0x34')](_0x8ae8('0x57'))){_0x41ea3e[_0x8ae8('0x1a')]=qs[_0x8ae8('0x1a')](_0x52e487['query'][_0x8ae8('0x1a')]);_0x41ea3e[_0x8ae8('0x1c')]=qs['offset'](_0x52e487[_0x8ae8('0x2e')][_0x8ae8('0x1c')]);}return _0x33f65c[_0x8ae8('0x87')](_0x41ea3e);}})[_0x8ae8('0x20')](function(_0x5a5245){if(_0x5a5245){return _0x5a5245?{'count':_0x304707,'rows':_0x5a5245}:null;}})[_0x8ae8('0x20')](respondWithResult(_0x657eda,null))[_0x8ae8('0x3e')](handleError(_0x657eda,null));};exports[_0x8ae8('0x88')]=function(_0xc52744,_0x4bae66,_0x2bf8e8){var _0x208d4f,_0x4937be;var _0x420074=[];var _0x5eed8c=moment()[_0x8ae8('0x62')](_0x8ae8('0x89'));return db[_0x8ae8('0x28')][_0x8ae8('0x49')]({'where':{'id':_0xc52744[_0x8ae8('0x40')]['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0x4bae66,null))[_0x8ae8('0x20')](function(_0x421fe1){if(_0x421fe1){_0x4937be=_0x421fe1;return _0x421fe1[_0x8ae8('0x88')](_0xc52744['body'][_0x8ae8('0x63')],_['omit'](_0xc52744[_0x8ae8('0x43')],[_0x8ae8('0x63'),'id'])||{});}return null;})[_0x8ae8('0x64')](function(_0x2bf902){var _0x2c6ba3;var _0x2dda05;_0x208d4f=_0x2bf902||[];var _0x332acf=[];if(_0x2bf902){for(var _0x487e7a=0x0;_0x487e7a<_0x2bf902['length'];_0x487e7a+=0x1){var _0x26cfab=_0x2bf902[_0x487e7a][_0x8ae8('0x45')]({'plain':!![]});_0x2c6ba3=squel[_0x8ae8('0x7b')]()[_0x8ae8('0x66')]('cm_hopper_black')[_0x8ae8('0x68')]([_0x8ae8('0x6d'),_0x8ae8('0x6a'),_0x8ae8('0x6b'),'CampaignId',_0x8ae8('0x52'),_0x8ae8('0x51')],squel['select']()[_0x8ae8('0x6e')]('phone',_0x8ae8('0x6d'))[_0x8ae8('0x6e')]('id','ContactId')['field'](_0x26cfab['CmListId']['toString'](),_0x8ae8('0x6b'))['field'](_0xc52744[_0x8ae8('0x40')]['id'][_0x8ae8('0x71')](),_0x8ae8('0x5b'))[_0x8ae8('0x6e')](_0x8ae8('0x6f'),_0x8ae8('0x52'))[_0x8ae8('0x6e')](_0x8ae8('0x6f'),_0x8ae8('0x51'))['from'](_0x8ae8('0x8a'))['where'](_0x8ae8('0x73'))[_0x8ae8('0x37')](_0x8ae8('0x74'),_0x26cfab['CmListId'][_0x8ae8('0x71')]())['where'](_0x8ae8('0x75')))['toString']();_0x332acf['push'](db[_0x8ae8('0x84')]['query'](_0x2c6ba3));}return BPromise['all'](_0x332acf);}})['then'](function(){return _0x208d4f;})[_0x8ae8('0x20')](respondWithResult(_0x4bae66,null))[_0x8ae8('0x3e')](handleError(_0x4bae66,null));};exports['removeBlackLists']=function(_0x85110,_0x44e366,_0x4edc32){return db[_0x8ae8('0x28')]['find']({'where':{'id':_0x85110['params']['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0x44e366,null))[_0x8ae8('0x20')](function(_0x317d36){if(_0x317d36){return _0x317d36[_0x8ae8('0x8b')](_0x85110[_0x8ae8('0x2e')]['ids']);}})['then'](function(_0xc8d209){if(_0xc8d209){return db[_0x8ae8('0x5e')][_0x8ae8('0x54')]({'where':{'ListId':_0x85110['query'][_0x8ae8('0x63')],'CampaignId':_0x85110[_0x8ae8('0x40')]['id']}})[_0x8ae8('0x20')](function(){return _0xc8d209;});}})['then'](respondWithStatusCode(_0x44e366,null))['catch'](handleError(_0x44e366,null));};
\ No newline at end of file
+var _0x2b4f=['phone','NOW()','CmListId','toString','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','CampaignId\x20=\x20?','select','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','into','deletedAt\x20IS\x20NULL','ListId','cmHopperId','h.id','ci.item','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','sendStatus','error','stack','name','index','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','Campaign','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','autoAssociation','findOne','CmHopper','nolimit','CampaignId','map','findAll','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','cm_hopper','fromQuery','scheduledAt','ContactId','field'];(function(_0x2a07bc,_0x4b9718){var _0x5bd06=function(_0x43dc1e){while(--_0x43dc1e){_0x2a07bc['push'](_0x2a07bc['shift']());}};_0x5bd06(++_0x4b9718);}(_0x2b4f,0x142));var _0xf2b4=function(_0x1b3401,_0x3086cb){_0x1b3401=_0x1b3401-0x0;var _0x1e80bc=_0x2b4f[_0x1b3401];return _0x1e80bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf2b4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf2b4('0x1'));var rp=require(_0xf2b4('0x2'));var moment=require(_0xf2b4('0x3'));var BPromise=require(_0xf2b4('0x4'));var Mustache=require(_0xf2b4('0x5'));var util=require('util');var path=require(_0xf2b4('0x6'));var sox=require(_0xf2b4('0x7'));var csv=require(_0xf2b4('0x8'));var ejs=require(_0xf2b4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf2b4('0xa'));var squel=require('squel');var crypto=require(_0xf2b4('0xb'));var jsforce=require(_0xf2b4('0xc'));var deskjs=require(_0xf2b4('0xd'));var toCsv=require(_0xf2b4('0x8'));var querystring=require(_0xf2b4('0xe'));var Papa=require(_0xf2b4('0xf'));var Redis=require(_0xf2b4('0x10'));var authService=require(_0xf2b4('0x11'));var qs=require(_0xf2b4('0x12'));var as=require(_0xf2b4('0x13'));var hardwareService=require(_0xf2b4('0x14'));var logger=require(_0xf2b4('0x15'))(_0xf2b4('0x16'));var utils=require(_0xf2b4('0x17'));var config=require(_0xf2b4('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf2b4('0x19'))['db'];function respondWithStatusCode(_0x39f318,_0x25942b){_0x25942b=_0x25942b||0xcc;return function(_0x2c4495){if(_0x2c4495){return _0x39f318['sendStatus'](_0x25942b);}return _0x39f318['status'](_0x25942b)[_0xf2b4('0x1a')]();};}function respondWithResult(_0x5172c0,_0x435022){_0x435022=_0x435022||0xc8;return function(_0x1f5b60){if(_0x1f5b60){return _0x5172c0[_0xf2b4('0x1b')](_0x435022)['json'](_0x1f5b60);}};}function respondWithFilteredResult(_0x4fcecf,_0x39fcea){return function(_0x235ad7){if(_0x235ad7){var _0x3daaf6=typeof _0x39fcea[_0xf2b4('0x1c')]==='undefined'&&typeof _0x39fcea[_0xf2b4('0x1d')]==='undefined';var _0x1872ef=_0x235ad7[_0xf2b4('0x1e')];var _0x1b0a12=_0x3daaf6?0x0:_0x39fcea[_0xf2b4('0x1c')];var _0x1b2429=_0x3daaf6?_0x235ad7[_0xf2b4('0x1e')]:_0x39fcea[_0xf2b4('0x1c')]+_0x39fcea[_0xf2b4('0x1d')];var _0x4a1b6a;if(_0x1b2429>=_0x1872ef){_0x1b2429=_0x1872ef;_0x4a1b6a=0xc8;}else{_0x4a1b6a=0xce;}_0x4fcecf[_0xf2b4('0x1b')](_0x4a1b6a);return _0x4fcecf[_0xf2b4('0x1f')](_0xf2b4('0x20'),_0x1b0a12+'-'+_0x1b2429+'/'+_0x1872ef)[_0xf2b4('0x21')](_0x235ad7);}return null;};}function patchUpdates(_0x38afe7){return function(_0x305fa0){try{jsonpatch[_0xf2b4('0x22')](_0x305fa0,_0x38afe7,!![]);}catch(_0x4f84c8){return BPromise[_0xf2b4('0x23')](_0x4f84c8);}return _0x305fa0[_0xf2b4('0x24')]();};}function saveUpdates(_0x2b3897,_0x5fc66e){return function(_0x51330b){if(_0x51330b){return _0x51330b['update'](_0x2b3897)[_0xf2b4('0x25')](function(_0x1244f2){return _0x1244f2;});}return null;};}function removeEntity(_0x18d28b,_0x290658){return function(_0x7daac1){if(_0x7daac1){return _0x7daac1[_0xf2b4('0x26')]()[_0xf2b4('0x25')](function(){var _0x4346c1=_0x7daac1[_0xf2b4('0x27')]({'plain':!![]});var _0x1b9fb4='IvrCampaigns';return db['UserProfileResource'][_0xf2b4('0x26')]({'where':{'type':_0x1b9fb4,'resourceId':_0x4346c1['id']}})[_0xf2b4('0x25')](function(){return _0x7daac1;});})['then'](function(){_0x18d28b[_0xf2b4('0x1b')](0xcc)[_0xf2b4('0x1a')]();});}};}function handleEntityNotFound(_0x3007eb,_0x19eec2){return function(_0x181e50){if(!_0x181e50){_0x3007eb[_0xf2b4('0x28')](0x194);}return _0x181e50;};}function handleError(_0xcff709,_0x444875){_0x444875=_0x444875||0x1f4;return function(_0x506bab){logger[_0xf2b4('0x29')](_0x506bab[_0xf2b4('0x2a')]);if(_0x506bab[_0xf2b4('0x2b')]){delete _0x506bab['name'];}_0xcff709[_0xf2b4('0x1b')](_0x444875)['send'](_0x506bab);};}exports[_0xf2b4('0x2c')]=function(_0x128658,_0x42ad93){var _0x5db7c2={},_0x4a95e2={},_0x15ebd9={'count':0x0,'rows':[]};var _0x5487e3=_['map'](db['Campaign'][_0xf2b4('0x2d')],function(_0x2384c1){return{'name':_0x2384c1[_0xf2b4('0x2e')],'type':_0x2384c1[_0xf2b4('0x2f')]['key']};});_0x4a95e2[_0xf2b4('0x30')]=_['map'](_0x5487e3,_0xf2b4('0x2b'));_0x4a95e2[_0xf2b4('0x31')]=_['keys'](_0x128658['query']);_0x4a95e2[_0xf2b4('0x32')]=_[_0xf2b4('0x33')](_0x4a95e2[_0xf2b4('0x30')],_0x4a95e2[_0xf2b4('0x31')]);_0x5db7c2[_0xf2b4('0x34')]=_[_0xf2b4('0x33')](_0x4a95e2[_0xf2b4('0x30')],qs['fields'](_0x128658[_0xf2b4('0x31')]['fields']));_0x5db7c2[_0xf2b4('0x34')]=_0x5db7c2[_0xf2b4('0x34')][_0xf2b4('0x35')]?_0x5db7c2[_0xf2b4('0x34')]:_0x4a95e2['model'];if(!_0x128658[_0xf2b4('0x31')][_0xf2b4('0x36')]('nolimit')){_0x5db7c2[_0xf2b4('0x1d')]=qs[_0xf2b4('0x1d')](_0x128658['query'][_0xf2b4('0x1d')]);_0x5db7c2[_0xf2b4('0x1c')]=qs[_0xf2b4('0x1c')](_0x128658[_0xf2b4('0x31')][_0xf2b4('0x1c')]);}_0x5db7c2[_0xf2b4('0x37')]=qs[_0xf2b4('0x38')](_0x128658['query'][_0xf2b4('0x38')]);_0x5db7c2[_0xf2b4('0x39')]=qs[_0xf2b4('0x32')](_[_0xf2b4('0x3a')](_0x128658[_0xf2b4('0x31')],_0x4a95e2[_0xf2b4('0x32')]),_0x5487e3);if(_0x128658[_0xf2b4('0x31')][_0xf2b4('0x3b')]){_0x5db7c2[_0xf2b4('0x39')]=_[_0xf2b4('0x3c')](_0x5db7c2['where'],{'$or':_['map'](_0x5487e3,function(_0x2185f6){if(_0x2185f6[_0xf2b4('0x2f')]!==_0xf2b4('0x3d')){var _0x872df7={};_0x872df7[_0x2185f6['name']]={'$like':'%'+_0x128658[_0xf2b4('0x31')][_0xf2b4('0x3b')]+'%'};return _0x872df7;}})});}_0x5db7c2=_[_0xf2b4('0x3c')]({},_0x5db7c2,_0x128658[_0xf2b4('0x3e')]);var _0x43768c={'where':_0x5db7c2[_0xf2b4('0x39')]};return db['Campaign'][_0xf2b4('0x1e')](_0x43768c)[_0xf2b4('0x25')](function(_0x3968d4){_0x15ebd9[_0xf2b4('0x1e')]=_0x3968d4;if(_0x128658[_0xf2b4('0x31')][_0xf2b4('0x3f')]){_0x5db7c2[_0xf2b4('0x40')]=[{'all':!![]}];}return db[_0xf2b4('0x41')]['findAll'](_0x5db7c2);})['then'](function(_0x42e154){_0x15ebd9[_0xf2b4('0x42')]=_0x42e154;return _0x15ebd9;})['then'](respondWithFilteredResult(_0x42ad93,_0x5db7c2))[_0xf2b4('0x43')](handleError(_0x42ad93,null));};exports[_0xf2b4('0x44')]=function(_0x590ea5,_0x554121){var _0x1f2c5f={'raw':![],'where':{'id':_0x590ea5[_0xf2b4('0x45')]['id']}},_0x362ccd={};_0x362ccd[_0xf2b4('0x30')]=_[_0xf2b4('0x46')](db[_0xf2b4('0x41')][_0xf2b4('0x2d')]);_0x362ccd[_0xf2b4('0x31')]=_[_0xf2b4('0x46')](_0x590ea5[_0xf2b4('0x31')]);_0x362ccd[_0xf2b4('0x32')]=_['intersection'](_0x362ccd[_0xf2b4('0x30')],_0x362ccd['query']);_0x1f2c5f[_0xf2b4('0x34')]=_[_0xf2b4('0x33')](_0x362ccd['model'],qs[_0xf2b4('0x47')](_0x590ea5[_0xf2b4('0x31')][_0xf2b4('0x47')]));_0x1f2c5f[_0xf2b4('0x34')]=_0x1f2c5f[_0xf2b4('0x34')][_0xf2b4('0x35')]?_0x1f2c5f[_0xf2b4('0x34')]:_0x362ccd['model'];if(_0x590ea5['query'][_0xf2b4('0x3f')]){_0x1f2c5f[_0xf2b4('0x40')]=[{'all':!![]}];}_0x1f2c5f=_[_0xf2b4('0x3c')]({},_0x1f2c5f,_0x590ea5[_0xf2b4('0x3e')]);return db[_0xf2b4('0x41')][_0xf2b4('0x48')](_0x1f2c5f)[_0xf2b4('0x25')](handleEntityNotFound(_0x554121,null))['then'](respondWithResult(_0x554121,null))['catch'](handleError(_0x554121,null));};exports[_0xf2b4('0x49')]=function(_0x40aa02,_0x22b9e6){return db['Campaign']['create'](_0x40aa02[_0xf2b4('0x4a')],{})['then'](function(_0x333cd2){var _0x144cf7=_0x40aa02[_0xf2b4('0x4b')][_0xf2b4('0x27')]({'plain':!![]});if(!_0x144cf7)throw new Error(_0xf2b4('0x4c'));if(_0x144cf7['role']==='user'){var _0x36c9bb=_0x333cd2[_0xf2b4('0x27')]({'plain':!![]});var _0x432cb2=_0xf2b4('0x4d');return db[_0xf2b4('0x4e')][_0xf2b4('0x48')]({'where':{'name':_0x432cb2,'userProfileId':_0x144cf7[_0xf2b4('0x4f')]},'raw':!![]})[_0xf2b4('0x25')](function(_0x34578a){if(_0x34578a&&_0x34578a['autoAssociation']===0x0){return db[_0xf2b4('0x50')]['create']({'name':_0x36c9bb[_0xf2b4('0x2b')],'resourceId':_0x36c9bb['id'],'type':_0x34578a[_0xf2b4('0x2b')],'sectionId':_0x34578a['id']},{})[_0xf2b4('0x25')](function(){return _0x333cd2;});}else{return _0x333cd2;}})[_0xf2b4('0x43')](function(_0x3aca99){logger[_0xf2b4('0x29')](_0xf2b4('0x51'),_0x3aca99);throw _0x3aca99;});}return _0x333cd2;})[_0xf2b4('0x25')](respondWithResult(_0x22b9e6,0xc9))[_0xf2b4('0x43')](handleError(_0x22b9e6,null));};exports[_0xf2b4('0x52')]=function(_0x66e6c5,_0x2a6a20){var _0x336127={'where':{'id':_0x66e6c5[_0xf2b4('0x45')]['id']}},_0x242e61={};_0x242e61[_0xf2b4('0x30')]=_['keys'](db[_0xf2b4('0x41')]['rawAttributes']);_0x336127[_0xf2b4('0x34')]=_[_0xf2b4('0x33')](_0x242e61['model'],qs[_0xf2b4('0x47')](_0x66e6c5[_0xf2b4('0x31')][_0xf2b4('0x47')]));_0x336127[_0xf2b4('0x34')]=_0x336127[_0xf2b4('0x34')][_0xf2b4('0x35')]?_0x336127[_0xf2b4('0x34')]:_0x242e61[_0xf2b4('0x30')];if(_0x66e6c5[_0xf2b4('0x31')]['includeAll']){_0x336127[_0xf2b4('0x40')]=[{'all':!![]}];}_0x336127=_['merge']({},_0x336127,_0x66e6c5[_0xf2b4('0x3e')]);return db[_0xf2b4('0x41')][_0xf2b4('0x48')](_0x336127)[_0xf2b4('0x25')](handleEntityNotFound(_0x2a6a20,null))[_0xf2b4('0x25')](function(_0xb7bc70){if(_0xb7bc70){var _0x25f757=_0xb7bc70[_0xf2b4('0x27')]({'plain':!![]});_0x25f757=qs['omit'](_0x25f757,['id',_0xf2b4('0x53'),_0xf2b4('0x54')]);_0x66e6c5['body']=_[_0xf2b4('0x55')](_0x66e6c5[_0xf2b4('0x4a')],['id',_0xf2b4('0x53'),'updatedAt']);return db[_0xf2b4('0x41')][_0xf2b4('0x49')](_[_0xf2b4('0x3c')](_0x25f757,_0x66e6c5['body']),{'include':_0x66e6c5[_0xf2b4('0x31')][_0xf2b4('0x3f')]?[{'all':!![]}]:undefined})['then'](function(_0x45b0eb){var _0xc5097e=_0x66e6c5[_0xf2b4('0x4b')][_0xf2b4('0x27')]({'plain':!![]});if(!_0xc5097e)throw new Error(_0xf2b4('0x4c'));if(_0xc5097e['role']===_0xf2b4('0x4b')){var _0x3a775d=_0x45b0eb[_0xf2b4('0x27')]({'plain':!![]});var _0x557717=_0xf2b4('0x4d');return db[_0xf2b4('0x4e')][_0xf2b4('0x48')]({'where':{'name':_0x557717,'userProfileId':_0xc5097e[_0xf2b4('0x4f')]},'raw':!![]})[_0xf2b4('0x25')](function(_0x196d78){if(_0x196d78&&_0x196d78[_0xf2b4('0x56')]===0x0){return db[_0xf2b4('0x50')][_0xf2b4('0x49')]({'name':_0x3a775d['name'],'resourceId':_0x3a775d['id'],'type':_0x196d78[_0xf2b4('0x2b')],'sectionId':_0x196d78['id']},{})[_0xf2b4('0x25')](function(){return _0x45b0eb;});}else{return _0x45b0eb;}})[_0xf2b4('0x43')](function(_0x20d1ee){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20d1ee);throw _0x20d1ee;});}return _0x45b0eb;});}})[_0xf2b4('0x25')](respondWithResult(_0x2a6a20,0xc9))[_0xf2b4('0x43')](handleError(_0x2a6a20,null));};exports['update']=function(_0x4b98fc,_0x3fe745){if(_0x4b98fc[_0xf2b4('0x4a')]['id']){delete _0x4b98fc[_0xf2b4('0x4a')]['id'];}return db[_0xf2b4('0x41')][_0xf2b4('0x48')]({'where':{'id':_0x4b98fc[_0xf2b4('0x45')]['id']}})[_0xf2b4('0x25')](handleEntityNotFound(_0x3fe745,null))['then'](saveUpdates(_0x4b98fc['body'],null))[_0xf2b4('0x25')](respondWithResult(_0x3fe745,null))[_0xf2b4('0x43')](handleError(_0x3fe745,null));};exports[_0xf2b4('0x26')]=function(_0x5a142a,_0x3bf626){return db[_0xf2b4('0x41')]['find']({'where':{'id':_0x5a142a[_0xf2b4('0x45')]['id']}})[_0xf2b4('0x25')](handleEntityNotFound(_0x3bf626,null))[_0xf2b4('0x25')](removeEntity(_0x3bf626,null))[_0xf2b4('0x43')](handleError(_0x3bf626,null));};exports['getHoppers']=function(_0xab59d0,_0x454fd3,_0x2cda30){var _0x1f6537={'raw':!![],'where':{}};var _0x987c09={};var _0x3e7b56={'count':0x0,'rows':[]};return db['Campaign'][_0xf2b4('0x57')]({'where':{'id':_0xab59d0['params']['id']}})[_0xf2b4('0x25')](handleEntityNotFound(_0x454fd3,null))[_0xf2b4('0x25')](function(_0x42608c){if(_0x42608c){_0x987c09['model']=_[_0xf2b4('0x46')](db[_0xf2b4('0x58')][_0xf2b4('0x2d')]);_0x987c09[_0xf2b4('0x31')]=_[_0xf2b4('0x46')](_0xab59d0['query']);_0x987c09['filters']=_[_0xf2b4('0x33')](_0x987c09['model'],_0x987c09[_0xf2b4('0x31')]);_0x1f6537[_0xf2b4('0x34')]=_['intersection'](_0x987c09[_0xf2b4('0x30')],qs[_0xf2b4('0x47')](_0xab59d0[_0xf2b4('0x31')]['fields']));_0x1f6537[_0xf2b4('0x34')]=_0x1f6537['attributes'][_0xf2b4('0x35')]?_0x1f6537['attributes']:_0x987c09[_0xf2b4('0x30')];if(!_0xab59d0[_0xf2b4('0x31')]['hasOwnProperty'](_0xf2b4('0x59'))){_0x1f6537[_0xf2b4('0x1d')]=qs[_0xf2b4('0x1d')](_0xab59d0[_0xf2b4('0x31')][_0xf2b4('0x1d')]);_0x1f6537[_0xf2b4('0x1c')]=qs[_0xf2b4('0x1c')](_0xab59d0[_0xf2b4('0x31')][_0xf2b4('0x1c')]);}_0x1f6537[_0xf2b4('0x37')]=qs[_0xf2b4('0x38')](_0xab59d0['query'][_0xf2b4('0x38')]);_0x1f6537['where']=qs['filters'](_[_0xf2b4('0x3a')](_0xab59d0[_0xf2b4('0x31')],_0x987c09[_0xf2b4('0x32')]));_0x1f6537['where'][_0xf2b4('0x5a')]=_0x42608c['id'];if(_0xab59d0[_0xf2b4('0x31')][_0xf2b4('0x3b')]){_0x1f6537[_0xf2b4('0x39')]=_[_0xf2b4('0x3c')](_0x1f6537[_0xf2b4('0x39')],{'$or':_[_0xf2b4('0x5b')](_0x1f6537['attributes'],function(_0x172b4e){var _0x566383={};_0x566383[_0x172b4e]={'$like':'%'+_0xab59d0['query']['filter']+'%'};return _0x566383;})});}_0x1f6537=_[_0xf2b4('0x3c')]({},_0x1f6537,_0xab59d0[_0xf2b4('0x3e')]);return db[_0xf2b4('0x58')][_0xf2b4('0x1e')]({'where':_0x1f6537[_0xf2b4('0x39')]})[_0xf2b4('0x25')](function(_0x418e45){_0x3e7b56[_0xf2b4('0x1e')]=_0x418e45;if(_0xab59d0[_0xf2b4('0x31')][_0xf2b4('0x3f')]){_0x1f6537[_0xf2b4('0x40')]=[{'all':!![]}];}return db['CmHopper'][_0xf2b4('0x5c')](_0x1f6537);})[_0xf2b4('0x25')](function(_0x13d46c){_0x3e7b56['rows']=_0x13d46c;return _0x3e7b56;});}})[_0xf2b4('0x25')](respondWithFilteredResult(_0x454fd3,_0x1f6537))[_0xf2b4('0x43')](handleError(_0x454fd3,null));};exports['getHopperHistories']=function(_0x2fa166,_0xc167b9,_0x493a05){var _0x117ce0={'raw':!![],'where':{}};var _0x21b391={};var _0x5015dd={'count':0x0,'rows':[]};return db[_0xf2b4('0x41')]['findOne']({'where':{'id':_0x2fa166[_0xf2b4('0x45')]['id']}})[_0xf2b4('0x25')](handleEntityNotFound(_0xc167b9,null))[_0xf2b4('0x25')](function(_0x1e69b8){if(_0x1e69b8){_0x21b391['model']=_[_0xf2b4('0x46')](db['CmHopperHistory'][_0xf2b4('0x2d')]);_0x21b391[_0xf2b4('0x31')]=_[_0xf2b4('0x46')](_0x2fa166['query']);_0x21b391[_0xf2b4('0x32')]=_[_0xf2b4('0x33')](_0x21b391[_0xf2b4('0x30')],_0x21b391[_0xf2b4('0x31')]);_0x117ce0[_0xf2b4('0x34')]=_['intersection'](_0x21b391[_0xf2b4('0x30')],qs[_0xf2b4('0x47')](_0x2fa166[_0xf2b4('0x31')][_0xf2b4('0x47')]));_0x117ce0[_0xf2b4('0x34')]=_0x117ce0[_0xf2b4('0x34')][_0xf2b4('0x35')]?_0x117ce0[_0xf2b4('0x34')]:_0x21b391[_0xf2b4('0x30')];if(!_0x2fa166[_0xf2b4('0x31')][_0xf2b4('0x36')](_0xf2b4('0x59'))){_0x117ce0['limit']=qs[_0xf2b4('0x1d')](_0x2fa166[_0xf2b4('0x31')][_0xf2b4('0x1d')]);_0x117ce0[_0xf2b4('0x1c')]=qs[_0xf2b4('0x1c')](_0x2fa166[_0xf2b4('0x31')][_0xf2b4('0x1c')]);}_0x117ce0[_0xf2b4('0x37')]=qs[_0xf2b4('0x38')](_0x2fa166[_0xf2b4('0x31')]['sort']);_0x117ce0[_0xf2b4('0x39')]=qs[_0xf2b4('0x32')](_[_0xf2b4('0x3a')](_0x2fa166[_0xf2b4('0x31')],_0x21b391[_0xf2b4('0x32')]));_0x117ce0[_0xf2b4('0x39')][_0xf2b4('0x5a')]=_0x1e69b8['id'];if(_0x2fa166[_0xf2b4('0x31')]['filter']){_0x117ce0[_0xf2b4('0x39')]=_[_0xf2b4('0x3c')](_0x117ce0[_0xf2b4('0x39')],{'$or':_[_0xf2b4('0x5b')](_0x117ce0[_0xf2b4('0x34')],function(_0x373a7e){var _0x47a3dc={};_0x47a3dc[_0x373a7e]={'$like':'%'+_0x2fa166[_0xf2b4('0x31')][_0xf2b4('0x3b')]+'%'};return _0x47a3dc;})});}_0x117ce0=_[_0xf2b4('0x3c')]({},_0x117ce0,_0x2fa166[_0xf2b4('0x3e')]);return db[_0xf2b4('0x5d')][_0xf2b4('0x1e')]({'where':_0x117ce0[_0xf2b4('0x39')]})[_0xf2b4('0x25')](function(_0x1a4a27){_0x5015dd[_0xf2b4('0x1e')]=_0x1a4a27;if(_0x2fa166['query'][_0xf2b4('0x3f')]){_0x117ce0[_0xf2b4('0x40')]=[{'all':!![]}];}return db[_0xf2b4('0x5d')][_0xf2b4('0x5c')](_0x117ce0);})[_0xf2b4('0x25')](function(_0x5a36f8){_0x5015dd[_0xf2b4('0x42')]=_0x5a36f8;return _0x5015dd;});}})['then'](respondWithFilteredResult(_0xc167b9,_0x117ce0))[_0xf2b4('0x43')](handleError(_0xc167b9,null));};exports[_0xf2b4('0x5e')]=function(_0x32c50b,_0x679c2,_0x28c2cb){var _0x1c4f6f={'raw':!![],'where':{}};var _0x11e750={};var _0x44b487={'count':0x0,'rows':[]};return db['Campaign'][_0xf2b4('0x57')]({'where':{'id':_0x32c50b[_0xf2b4('0x45')]['id']}})[_0xf2b4('0x25')](handleEntityNotFound(_0x679c2,null))[_0xf2b4('0x25')](function(_0x2815e9){if(_0x2815e9){_0x11e750[_0xf2b4('0x30')]=_[_0xf2b4('0x46')](db[_0xf2b4('0x5f')][_0xf2b4('0x2d')]);_0x11e750[_0xf2b4('0x31')]=_[_0xf2b4('0x46')](_0x32c50b[_0xf2b4('0x31')]);_0x11e750[_0xf2b4('0x32')]=_[_0xf2b4('0x33')](_0x11e750[_0xf2b4('0x30')],_0x11e750['query']);_0x1c4f6f['attributes']=_[_0xf2b4('0x33')](_0x11e750[_0xf2b4('0x30')],qs[_0xf2b4('0x47')](_0x32c50b[_0xf2b4('0x31')]['fields']));_0x1c4f6f[_0xf2b4('0x34')]=_0x1c4f6f[_0xf2b4('0x34')][_0xf2b4('0x35')]?_0x1c4f6f[_0xf2b4('0x34')]:_0x11e750[_0xf2b4('0x30')];if(!_0x32c50b[_0xf2b4('0x31')][_0xf2b4('0x36')](_0xf2b4('0x59'))){_0x1c4f6f[_0xf2b4('0x1d')]=qs[_0xf2b4('0x1d')](_0x32c50b['query'][_0xf2b4('0x1d')]);_0x1c4f6f[_0xf2b4('0x1c')]=qs['offset'](_0x32c50b[_0xf2b4('0x31')][_0xf2b4('0x1c')]);}_0x1c4f6f[_0xf2b4('0x37')]=qs[_0xf2b4('0x38')](_0x32c50b[_0xf2b4('0x31')][_0xf2b4('0x38')]);_0x1c4f6f['where']=qs[_0xf2b4('0x32')](_[_0xf2b4('0x3a')](_0x32c50b[_0xf2b4('0x31')],_0x11e750[_0xf2b4('0x32')]));_0x1c4f6f['where'][_0xf2b4('0x5a')]=_0x2815e9['id'];if(_0x32c50b[_0xf2b4('0x31')][_0xf2b4('0x3b')]){_0x1c4f6f[_0xf2b4('0x39')]=_[_0xf2b4('0x3c')](_0x1c4f6f['where'],{'$or':_[_0xf2b4('0x5b')](_0x1c4f6f['attributes'],function(_0x49a76b){var _0x1b664f={};_0x1b664f[_0x49a76b]={'$like':'%'+_0x32c50b[_0xf2b4('0x31')][_0xf2b4('0x3b')]+'%'};return _0x1b664f;})});}_0x1c4f6f=_[_0xf2b4('0x3c')]({},_0x1c4f6f,_0x32c50b[_0xf2b4('0x3e')]);return db['CmHopperFinal'][_0xf2b4('0x1e')]({'where':_0x1c4f6f['where']})[_0xf2b4('0x25')](function(_0x5f3123){_0x44b487[_0xf2b4('0x1e')]=_0x5f3123;if(_0x32c50b['query'][_0xf2b4('0x3f')]){_0x1c4f6f['include']=[{'all':!![]}];}return db[_0xf2b4('0x5f')][_0xf2b4('0x5c')](_0x1c4f6f);})['then'](function(_0x398637){_0x44b487[_0xf2b4('0x42')]=_0x398637;return _0x44b487;});}})[_0xf2b4('0x25')](respondWithFilteredResult(_0x679c2,_0x1c4f6f))[_0xf2b4('0x43')](handleError(_0x679c2,null));};exports[_0xf2b4('0x60')]=function(_0x37c075,_0x2a626c,_0x48beb){var _0x224ede={'raw':!![],'where':{}};var _0x44940a={};var _0x449012={'count':0x0,'rows':[]};return db[_0xf2b4('0x41')][_0xf2b4('0x57')]({'where':{'id':_0x37c075['params']['id']}})['then'](handleEntityNotFound(_0x2a626c,null))[_0xf2b4('0x25')](function(_0x1ba6c5){if(_0x1ba6c5){_0x44940a[_0xf2b4('0x30')]=_['keys'](db[_0xf2b4('0x61')]['rawAttributes']);_0x44940a['query']=_[_0xf2b4('0x46')](_0x37c075[_0xf2b4('0x31')]);_0x44940a[_0xf2b4('0x32')]=_[_0xf2b4('0x33')](_0x44940a[_0xf2b4('0x30')],_0x44940a['query']);_0x224ede['attributes']=_[_0xf2b4('0x33')](_0x44940a[_0xf2b4('0x30')],qs['fields'](_0x37c075[_0xf2b4('0x31')][_0xf2b4('0x47')]));_0x224ede[_0xf2b4('0x34')]=_0x224ede['attributes']['length']?_0x224ede['attributes']:_0x44940a[_0xf2b4('0x30')];if(!_0x37c075[_0xf2b4('0x31')][_0xf2b4('0x36')](_0xf2b4('0x59'))){_0x224ede[_0xf2b4('0x1d')]=qs[_0xf2b4('0x1d')](_0x37c075[_0xf2b4('0x31')][_0xf2b4('0x1d')]);_0x224ede['offset']=qs['offset'](_0x37c075[_0xf2b4('0x31')][_0xf2b4('0x1c')]);}_0x224ede[_0xf2b4('0x37')]=qs[_0xf2b4('0x38')](_0x37c075[_0xf2b4('0x31')][_0xf2b4('0x38')]);_0x224ede[_0xf2b4('0x39')]=qs[_0xf2b4('0x32')](_['pick'](_0x37c075[_0xf2b4('0x31')],_0x44940a[_0xf2b4('0x32')]));_0x224ede[_0xf2b4('0x39')]['CampaignId']=_0x1ba6c5['id'];if(_0x37c075[_0xf2b4('0x31')][_0xf2b4('0x3b')]){_0x224ede['where']=_['merge'](_0x224ede[_0xf2b4('0x39')],{'$or':_[_0xf2b4('0x5b')](_0x224ede[_0xf2b4('0x34')],function(_0x207cfd){var _0x441e55={};_0x441e55[_0x207cfd]={'$like':'%'+_0x37c075[_0xf2b4('0x31')][_0xf2b4('0x3b')]+'%'};return _0x441e55;})});}_0x224ede=_[_0xf2b4('0x3c')]({},_0x224ede,_0x37c075['options']);return db[_0xf2b4('0x61')]['count']({'where':_0x224ede['where']})[_0xf2b4('0x25')](function(_0x1d68cc){_0x449012[_0xf2b4('0x1e')]=_0x1d68cc;if(_0x37c075[_0xf2b4('0x31')][_0xf2b4('0x3f')]){_0x224ede[_0xf2b4('0x40')]=[{'all':!![]}];}return db[_0xf2b4('0x61')][_0xf2b4('0x5c')](_0x224ede);})['then'](function(_0x3c37cc){_0x449012['rows']=_0x3c37cc;return _0x449012;});}})[_0xf2b4('0x25')](respondWithFilteredResult(_0x2a626c,_0x224ede))[_0xf2b4('0x43')](handleError(_0x2a626c,null));};exports[_0xf2b4('0x62')]=function(_0x252e01,_0x1178bd,_0x2339cf){var _0x140ae8={};var _0x1efa44={};var _0x281529;var _0x125bcd;return db[_0xf2b4('0x41')][_0xf2b4('0x57')]({'where':{'id':_0x252e01['params']['id']}})[_0xf2b4('0x25')](handleEntityNotFound(_0x1178bd,null))[_0xf2b4('0x25')](function(_0x51a749){if(_0x51a749){_0x281529=_0x51a749;_0x1efa44[_0xf2b4('0x30')]=_[_0xf2b4('0x46')](db[_0xf2b4('0x63')][_0xf2b4('0x2d')]);_0x1efa44[_0xf2b4('0x31')]=_[_0xf2b4('0x46')](_0x252e01['query']);_0x1efa44[_0xf2b4('0x32')]=_[_0xf2b4('0x33')](_0x1efa44['model'],_0x1efa44['query']);_0x140ae8[_0xf2b4('0x34')]=_[_0xf2b4('0x33')](_0x1efa44[_0xf2b4('0x30')],qs[_0xf2b4('0x47')](_0x252e01['query'][_0xf2b4('0x47')]));_0x140ae8[_0xf2b4('0x34')]=_0x140ae8[_0xf2b4('0x34')]['length']?_0x140ae8[_0xf2b4('0x34')]:_0x1efa44['model'];_0x140ae8['order']=qs[_0xf2b4('0x38')](_0x252e01['query'][_0xf2b4('0x38')]);_0x140ae8[_0xf2b4('0x39')]=qs['filters'](_[_0xf2b4('0x3a')](_0x252e01['query'],_0x1efa44['filters']));if(_0x252e01[_0xf2b4('0x31')][_0xf2b4('0x3b')]){_0x140ae8[_0xf2b4('0x39')]=_[_0xf2b4('0x3c')](_0x140ae8['where'],{'$or':_['map'](_0x140ae8[_0xf2b4('0x34')],function(_0x551dc4){var _0x14ad45={};_0x14ad45[_0x551dc4]={'$like':'%'+_0x252e01[_0xf2b4('0x31')][_0xf2b4('0x3b')]+'%'};return _0x14ad45;})});}_0x140ae8=_[_0xf2b4('0x3c')]({},_0x140ae8,_0x252e01['options']);return _0x281529[_0xf2b4('0x62')](_0x140ae8);}})[_0xf2b4('0x25')](function(_0x54cb60){if(_0x54cb60){_0x125bcd=_0x54cb60[_0xf2b4('0x35')];if(!_0x252e01[_0xf2b4('0x31')][_0xf2b4('0x36')]('nolimit')){_0x140ae8[_0xf2b4('0x1d')]=qs[_0xf2b4('0x1d')](_0x252e01[_0xf2b4('0x31')][_0xf2b4('0x1d')]);_0x140ae8['offset']=qs[_0xf2b4('0x1c')](_0x252e01['query'][_0xf2b4('0x1c')]);}return _0x281529[_0xf2b4('0x62')](_0x140ae8);}})[_0xf2b4('0x25')](function(_0x31db50){if(_0x31db50){return _0x31db50?{'count':_0x125bcd,'rows':_0x31db50}:null;}})[_0xf2b4('0x25')](respondWithResult(_0x1178bd,null))[_0xf2b4('0x43')](handleError(_0x1178bd,null));};exports['addLists']=function(_0x48de2f,_0x47a142,_0x1c2f77){var _0x159123,_0x4365a2;var _0x15d123=[];var _0x3f1ce4=moment()[_0xf2b4('0x64')](_0xf2b4('0x65'));return db[_0xf2b4('0x41')]['find']({'where':{'id':_0x48de2f[_0xf2b4('0x45')]['id']}})['then'](handleEntityNotFound(_0x47a142,null))[_0xf2b4('0x25')](function(_0x2c8f2f){if(_0x2c8f2f){_0x4365a2=_0x2c8f2f;return _0x2c8f2f['addLists'](_0x48de2f['body']['ids'],_[_0xf2b4('0x55')](_0x48de2f[_0xf2b4('0x4a')],[_0xf2b4('0x66'),'id'])||{});}return null;})['spread'](function(_0x202b4c){var _0x2e590e;var _0x4b3bf0;_0x159123=_0x202b4c||[];var _0x460a75=[];if(_0x202b4c){for(var _0x10cf95=0x0;_0x10cf95<_0x202b4c['length'];_0x10cf95+=0x1){var _0x444a6f=_0x202b4c[_0x10cf95][_0xf2b4('0x27')]({'plain':!![]});_0x4365a2['dialCheckDuplicateType']=_0x48de2f[_0xf2b4('0x4a')][_0xf2b4('0x67')]?_0x48de2f[_0xf2b4('0x4a')][_0xf2b4('0x67')]:_0x4365a2['dialCheckDuplicateType'];switch(_0x4365a2[_0xf2b4('0x67')]){case _0xf2b4('0x68'):_0x2e590e=squel['insert']()['into'](_0xf2b4('0x69'))[_0xf2b4('0x6a')](['phone',_0xf2b4('0x6b'),_0xf2b4('0x6c'),'ListId',_0xf2b4('0x5a'),_0xf2b4('0x53'),_0xf2b4('0x54')],squel['select']()[_0xf2b4('0x6d')](_0xf2b4('0x6e'),_0xf2b4('0x6e'))['field'](_0xf2b4('0x6f'),_0xf2b4('0x6b'))[_0xf2b4('0x6d')]('id','ContactId')['field'](_0x444a6f[_0xf2b4('0x70')]['toString'](),'ListId')[_0xf2b4('0x6d')](_0x48de2f['params']['id'][_0xf2b4('0x71')](),'CampaignId')['field']('\x27'+_0x3f1ce4+'\x27',_0xf2b4('0x53'))[_0xf2b4('0x6d')]('\x27'+_0x3f1ce4+'\x27',_0xf2b4('0x54'))['from'](_0xf2b4('0x72'))[_0xf2b4('0x39')]('deletedAt\x20IS\x20NULL')[_0xf2b4('0x39')](_0xf2b4('0x73'),_0x444a6f[_0xf2b4('0x70')]['toString']())[_0xf2b4('0x39')](_0xf2b4('0x74'))[_0xf2b4('0x39')](_0xf2b4('0x75'),squel['select']()[_0xf2b4('0x6d')](_0xf2b4('0x76'))[_0xf2b4('0x77')]('cm_hopper_final')[_0xf2b4('0x39')](_0xf2b4('0x78'),_0x48de2f[_0xf2b4('0x45')]['id']['toString']()))[_0xf2b4('0x39')](_0xf2b4('0x75'),squel[_0xf2b4('0x79')]()[_0xf2b4('0x6d')](_0xf2b4('0x7a'))[_0xf2b4('0x77')](_0xf2b4('0x69'))[_0xf2b4('0x39')](_0xf2b4('0x78'),_0x48de2f[_0xf2b4('0x45')]['id'][_0xf2b4('0x71')]())))['toString']();break;case _0xf2b4('0x7b'):_0x2e590e=squel[_0xf2b4('0x7c')]()[_0xf2b4('0x7d')](_0xf2b4('0x69'))[_0xf2b4('0x6a')](['phone',_0xf2b4('0x6b'),_0xf2b4('0x6c'),'ListId','CampaignId','createdAt',_0xf2b4('0x54')],squel['select']()[_0xf2b4('0x6d')](_0xf2b4('0x6e'),_0xf2b4('0x6e'))['field'](_0xf2b4('0x6f'),'scheduledAt')[_0xf2b4('0x6d')]('id','ContactId')[_0xf2b4('0x6d')](_0x444a6f[_0xf2b4('0x70')]['toString'](),'ListId')[_0xf2b4('0x6d')](_0x48de2f[_0xf2b4('0x45')]['id'][_0xf2b4('0x71')](),'CampaignId')[_0xf2b4('0x6d')]('\x27'+_0x3f1ce4+'\x27',_0xf2b4('0x53'))[_0xf2b4('0x6d')]('\x27'+_0x3f1ce4+'\x27',_0xf2b4('0x54'))[_0xf2b4('0x77')](_0xf2b4('0x72'))[_0xf2b4('0x39')](_0xf2b4('0x7e'))[_0xf2b4('0x39')]('ListId\x20=\x20?',_0x444a6f['CmListId'][_0xf2b4('0x71')]())[_0xf2b4('0x39')](_0xf2b4('0x74'))[_0xf2b4('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf2b4('0x79')]()[_0xf2b4('0x6d')](_0xf2b4('0x7a'))['from'](_0xf2b4('0x69'))[_0xf2b4('0x39')](_0xf2b4('0x78'),_0x48de2f[_0xf2b4('0x45')]['id'][_0xf2b4('0x71')]())))[_0xf2b4('0x71')]();break;default:_0x2e590e=squel[_0xf2b4('0x7c')]()['into'](_0xf2b4('0x69'))[_0xf2b4('0x6a')]([_0xf2b4('0x6e'),'scheduledAt','ContactId',_0xf2b4('0x7f'),'CampaignId','createdAt',_0xf2b4('0x54')],squel[_0xf2b4('0x79')]()[_0xf2b4('0x6d')](_0xf2b4('0x6e'),_0xf2b4('0x6e'))[_0xf2b4('0x6d')](_0xf2b4('0x6f'),'scheduledAt')[_0xf2b4('0x6d')]('id',_0xf2b4('0x6c'))[_0xf2b4('0x6d')](_0x444a6f['CmListId'][_0xf2b4('0x71')](),_0xf2b4('0x7f'))[_0xf2b4('0x6d')](_0x48de2f[_0xf2b4('0x45')]['id']['toString'](),_0xf2b4('0x5a'))['field']('\x27'+_0x3f1ce4+'\x27',_0xf2b4('0x53'))[_0xf2b4('0x6d')]('\x27'+_0x3f1ce4+'\x27',_0xf2b4('0x54'))['from']('cm_contacts')[_0xf2b4('0x39')](_0xf2b4('0x7e'))[_0xf2b4('0x39')]('ListId\x20=\x20?',_0x444a6f[_0xf2b4('0x70')][_0xf2b4('0x71')]())[_0xf2b4('0x39')]('phone\x20IS\x20NOT\x20NULL'))[_0xf2b4('0x71')]();}_0x4b3bf0=squel['insert']()[_0xf2b4('0x7d')]('cm_hopper_additional_phones')[_0xf2b4('0x6a')]([_0xf2b4('0x80'),_0xf2b4('0x6b'),'phone','OrderBy',_0xf2b4('0x53'),_0xf2b4('0x54')],squel[_0xf2b4('0x79')]()[_0xf2b4('0x6d')](_0xf2b4('0x81'),'id')[_0xf2b4('0x6d')]('NOW()',_0xf2b4('0x6b'))[_0xf2b4('0x6d')](_0xf2b4('0x82'),_0xf2b4('0x6e'))[_0xf2b4('0x6d')](_0xf2b4('0x83'),'OrderBy')['field']('\x27'+_0x3f1ce4+'\x27','createdAt')[_0xf2b4('0x6d')]('\x27'+_0x3f1ce4+'\x27','updatedAt')[_0xf2b4('0x77')]('cm_contact_has_items','ci')[_0xf2b4('0x84')](_0xf2b4('0x69'),'h',_0xf2b4('0x85'))['where'](_0xf2b4('0x86'),_0x444a6f['CmListId']['toString']())[_0xf2b4('0x39')](_0xf2b4('0x87'),_0x48de2f[_0xf2b4('0x45')]['id']['toString']())[_0xf2b4('0x39')]('h.createdAt\x20=\x20?',_0x3f1ce4))[_0xf2b4('0x71')]();_0x460a75[_0xf2b4('0x88')](db[_0xf2b4('0x89')][_0xf2b4('0x31')](_0x2e590e));_0x15d123[_0xf2b4('0x88')](db['sequelize'][_0xf2b4('0x31')](_0x4b3bf0));}return BPromise['all'](_0x460a75);}})[_0xf2b4('0x25')](function(){return BPromise['all'](_0x15d123);})[_0xf2b4('0x25')](function(){return _0x159123;})[_0xf2b4('0x25')](respondWithResult(_0x47a142,null))[_0xf2b4('0x43')](handleError(_0x47a142,null));};exports[_0xf2b4('0x8a')]=function(_0x574db1,_0x487f23,_0x34449a){return db[_0xf2b4('0x41')]['find']({'where':{'id':_0x574db1[_0xf2b4('0x45')]['id']}})[_0xf2b4('0x25')](handleEntityNotFound(_0x487f23,null))['then'](function(_0x167221){if(_0x167221){return _0x167221[_0xf2b4('0x8a')](_0x574db1[_0xf2b4('0x31')][_0xf2b4('0x66')]);}})['then'](function(_0x2aef41){if(_0x2aef41){return db[_0xf2b4('0x58')][_0xf2b4('0x26')]({'where':{'ListId':_0x574db1[_0xf2b4('0x31')]['ids'],'CampaignId':_0x574db1[_0xf2b4('0x45')]['id']}})['then'](function(){return _0x2aef41;});}})[_0xf2b4('0x25')](respondWithStatusCode(_0x487f23,null))['catch'](handleError(_0x487f23,null));};exports[_0xf2b4('0x8b')]=function(_0x55ae10,_0x215137,_0x23e0ef){var _0xa692cc={};var _0x2a2e07={};var _0xb33fe5;var _0x4e5585;return db[_0xf2b4('0x41')]['findOne']({'where':{'id':_0x55ae10['params']['id']}})[_0xf2b4('0x25')](handleEntityNotFound(_0x215137,null))[_0xf2b4('0x25')](function(_0x5f4fcb){if(_0x5f4fcb){_0xb33fe5=_0x5f4fcb;_0x2a2e07[_0xf2b4('0x30')]=_['keys'](db[_0xf2b4('0x63')][_0xf2b4('0x2d')]);_0x2a2e07[_0xf2b4('0x31')]=_[_0xf2b4('0x46')](_0x55ae10['query']);_0x2a2e07[_0xf2b4('0x32')]=_['intersection'](_0x2a2e07['model'],_0x2a2e07[_0xf2b4('0x31')]);_0xa692cc[_0xf2b4('0x34')]=_[_0xf2b4('0x33')](_0x2a2e07[_0xf2b4('0x30')],qs[_0xf2b4('0x47')](_0x55ae10[_0xf2b4('0x31')][_0xf2b4('0x47')]));_0xa692cc['attributes']=_0xa692cc[_0xf2b4('0x34')][_0xf2b4('0x35')]?_0xa692cc[_0xf2b4('0x34')]:_0x2a2e07[_0xf2b4('0x30')];_0xa692cc['order']=qs[_0xf2b4('0x38')](_0x55ae10[_0xf2b4('0x31')][_0xf2b4('0x38')]);_0xa692cc[_0xf2b4('0x39')]=qs['filters'](_['pick'](_0x55ae10[_0xf2b4('0x31')],_0x2a2e07[_0xf2b4('0x32')]));if(_0x55ae10['query'][_0xf2b4('0x3b')]){_0xa692cc['where']=_[_0xf2b4('0x3c')](_0xa692cc[_0xf2b4('0x39')],{'$or':_[_0xf2b4('0x5b')](_0xa692cc['attributes'],function(_0x113073){var _0x227d33={};_0x227d33[_0x113073]={'$like':'%'+_0x55ae10[_0xf2b4('0x31')][_0xf2b4('0x3b')]+'%'};return _0x227d33;})});}_0xa692cc=_[_0xf2b4('0x3c')]({},_0xa692cc,_0x55ae10[_0xf2b4('0x3e')]);return _0xb33fe5[_0xf2b4('0x8b')](_0xa692cc);}})[_0xf2b4('0x25')](function(_0x45a61f){if(_0x45a61f){_0x4e5585=_0x45a61f['length'];if(!_0x55ae10[_0xf2b4('0x31')][_0xf2b4('0x36')]('nolimit')){_0xa692cc[_0xf2b4('0x1d')]=qs['limit'](_0x55ae10[_0xf2b4('0x31')][_0xf2b4('0x1d')]);_0xa692cc[_0xf2b4('0x1c')]=qs[_0xf2b4('0x1c')](_0x55ae10[_0xf2b4('0x31')][_0xf2b4('0x1c')]);}return _0xb33fe5[_0xf2b4('0x8b')](_0xa692cc);}})['then'](function(_0x486141){if(_0x486141){return _0x486141?{'count':_0x4e5585,'rows':_0x486141}:null;}})[_0xf2b4('0x25')](respondWithResult(_0x215137,null))[_0xf2b4('0x43')](handleError(_0x215137,null));};exports[_0xf2b4('0x8c')]=function(_0x47e8a3,_0x1de253,_0x47a1b5){var _0x5413cb,_0x4eee8c;var _0x1579a0=[];var _0x1a7723=moment()[_0xf2b4('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xf2b4('0x41')][_0xf2b4('0x48')]({'where':{'id':_0x47e8a3[_0xf2b4('0x45')]['id']}})['then'](handleEntityNotFound(_0x1de253,null))[_0xf2b4('0x25')](function(_0x3c312b){if(_0x3c312b){_0x4eee8c=_0x3c312b;return _0x3c312b['addBlackLists'](_0x47e8a3[_0xf2b4('0x4a')][_0xf2b4('0x66')],_['omit'](_0x47e8a3[_0xf2b4('0x4a')],[_0xf2b4('0x66'),'id'])||{});}return null;})[_0xf2b4('0x8d')](function(_0x393b24){var _0x25f4c8;var _0x5a9c87;_0x5413cb=_0x393b24||[];var _0x1183bb=[];if(_0x393b24){for(var _0x2b003a=0x0;_0x2b003a<_0x393b24[_0xf2b4('0x35')];_0x2b003a+=0x1){var _0x6f48a7=_0x393b24[_0x2b003a][_0xf2b4('0x27')]({'plain':!![]});_0x25f4c8=squel[_0xf2b4('0x7c')]()[_0xf2b4('0x7d')](_0xf2b4('0x8e'))[_0xf2b4('0x6a')]([_0xf2b4('0x6e'),_0xf2b4('0x6c'),'ListId','CampaignId',_0xf2b4('0x53'),'updatedAt'],squel['select']()['field'](_0xf2b4('0x6e'),_0xf2b4('0x6e'))[_0xf2b4('0x6d')]('id',_0xf2b4('0x6c'))[_0xf2b4('0x6d')](_0x6f48a7[_0xf2b4('0x70')][_0xf2b4('0x71')](),'ListId')['field'](_0x47e8a3[_0xf2b4('0x45')]['id'][_0xf2b4('0x71')](),'CampaignId')[_0xf2b4('0x6d')](_0xf2b4('0x6f'),_0xf2b4('0x53'))[_0xf2b4('0x6d')](_0xf2b4('0x6f'),_0xf2b4('0x54'))[_0xf2b4('0x77')]('cm_contacts')['where'](_0xf2b4('0x7e'))['where'](_0xf2b4('0x73'),_0x6f48a7[_0xf2b4('0x70')][_0xf2b4('0x71')]())[_0xf2b4('0x39')](_0xf2b4('0x74')))['toString']();_0x1183bb[_0xf2b4('0x88')](db[_0xf2b4('0x89')][_0xf2b4('0x31')](_0x25f4c8));}return BPromise['all'](_0x1183bb);}})[_0xf2b4('0x25')](function(){return _0x5413cb;})['then'](respondWithResult(_0x1de253,null))['catch'](handleError(_0x1de253,null));};exports[_0xf2b4('0x8f')]=function(_0x3b6bea,_0x169bf8,_0x436f69){return db[_0xf2b4('0x41')]['find']({'where':{'id':_0x3b6bea[_0xf2b4('0x45')]['id']}})[_0xf2b4('0x25')](handleEntityNotFound(_0x169bf8,null))[_0xf2b4('0x25')](function(_0x4e3d7e){if(_0x4e3d7e){return _0x4e3d7e[_0xf2b4('0x8f')](_0x3b6bea[_0xf2b4('0x31')][_0xf2b4('0x66')]);}})[_0xf2b4('0x25')](function(_0x1b12f4){if(_0x1b12f4){return db['CmHopperBlack'][_0xf2b4('0x26')]({'where':{'ListId':_0x3b6bea[_0xf2b4('0x31')][_0xf2b4('0x66')],'CampaignId':_0x3b6bea[_0xf2b4('0x45')]['id']}})['then'](function(){return _0x1b12f4;});}})[_0xf2b4('0x25')](respondWithStatusCode(_0x169bf8,null))[_0xf2b4('0x43')](handleError(_0x169bf8,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index a563a67..603eb46 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x197fe4,_0x31e2bc){var _0x4e68a1=function(_0xae0b9e){while(--_0xae0b9e){_0x197fe4['push'](_0x197fe4['shift']());}};_0x4e68a1(++_0x31e2bc);}(_0x7a54,0x106));var _0x47a5=function(_0x48ad2c,_0x478aa2){_0x48ad2c=_0x48ad2c-0x0;var _0x3f17d2=_0x7a54[_0x48ad2c];return _0x3f17d2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x539ce1,_0x4a65eb){var _0x20be8e=function(_0x45efa4){while(--_0x45efa4){_0x539ce1['push'](_0x539ce1['shift']());}};_0x20be8e(++_0x4a65eb);}(_0x7a54,0x106));var _0x47a5=function(_0x37bd0f,_0x16e0e5){_0x37bd0f=_0x37bd0f-0x0;var _0x28a4b8=_0x7a54[_0x37bd0f];return _0x28a4b8;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 710862b..87c33e8 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 _0xb201=['Campaign,\x20%s,\x20%s','message','result','GetCampaign','Campaign','findAll','options','raw','map','include','model','attributes','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','error','code'];(function(_0xc23311,_0x4b4373){var _0xfb9532=function(_0x25f56b){while(--_0x25f56b){_0xc23311['push'](_0xc23311['shift']());}};_0xfb9532(++_0x4b4373);}(_0xb201,0x1b1));var _0x1b20=function(_0x14ee16,_0x5443e9){_0x14ee16=_0x14ee16-0x0;var _0x5296a0=_0xb201[_0x14ee16];return _0x5296a0;};'use strict';var _=require(_0x1b20('0x0'));var util=require('util');var moment=require(_0x1b20('0x1'));var BPromise=require(_0x1b20('0x2'));var rs=require(_0x1b20('0x3'));var fs=require('fs');var Redis=require(_0x1b20('0x4'));var db=require(_0x1b20('0x5'))['db'];var utils=require(_0x1b20('0x6'));var logger=require('../../config/logger')(_0x1b20('0x7'));var config=require(_0x1b20('0x8'));var jayson=require(_0x1b20('0x9'));var client=jayson['client'][_0x1b20('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50cdbc,_0x34304b,_0x2a184f){return new BPromise(function(_0x3cc600,_0x426ae9){return client['request'](_0x50cdbc,_0x2a184f)[_0x1b20('0xb')](function(_0x1f5ae4){logger[_0x1b20('0xc')]('Campaign,\x20%s,\x20%s',_0x34304b,_0x1b20('0xd'));logger['debug'](_0x1b20('0xe'),_0x34304b,'request\x20sent',JSON['stringify'](_0x1f5ae4));if(_0x1f5ae4[_0x1b20('0xf')]){if(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x10')]===0x1f4){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x426ae9(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x3cc600(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}else{logger['info'](_0x1b20('0x11'),_0x34304b,'request\x20sent');_0x3cc600(_0x1f5ae4[_0x1b20('0x13')][_0x1b20('0x12')]);}})['catch'](function(_0x44e713){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x44e713);_0x426ae9(_0x44e713);});});}exports[_0x1b20('0x14')]=function(_0xff7c72){var _0xf9078e=this;return new Promise(function(_0x34517f,_0x46bb09){return db[_0x1b20('0x15')][_0x1b20('0x16')]({'raw':_0xff7c72[_0x1b20('0x17')]?_0xff7c72[_0x1b20('0x17')][_0x1b20('0x18')]===undefined?!![]:![]:!![],'where':_0xff7c72[_0x1b20('0x17')]?_0xff7c72[_0x1b20('0x17')]['where']||null:null,'attributes':_0xff7c72[_0x1b20('0x17')]?_0xff7c72['options']['attributes']||null:null,'limit':_0xff7c72['options']?_0xff7c72[_0x1b20('0x17')]['limit']||null:null,'include':_0xff7c72['options']?_0xff7c72[_0x1b20('0x17')]['include']?_[_0x1b20('0x19')](_0xff7c72['options'][_0x1b20('0x1a')],function(_0x33e6ae){return{'model':db[_0x33e6ae[_0x1b20('0x1b')]],'as':_0x33e6ae['as'],'attributes':_0x33e6ae[_0x1b20('0x1c')],'include':_0x33e6ae[_0x1b20('0x1a')]?_[_0x1b20('0x19')](_0x33e6ae['include'],function(_0x590b44){return{'model':db[_0x590b44[_0x1b20('0x1b')]],'as':_0x590b44['as'],'attributes':_0x590b44[_0x1b20('0x1c')],'include':_0x590b44[_0x1b20('0x1a')]?_[_0x1b20('0x19')](_0x590b44[_0x1b20('0x1a')],function(_0x3a5cda){return{'model':db[_0x3a5cda[_0x1b20('0x1b')]],'as':_0x3a5cda['as'],'attributes':_0x3a5cda[_0x1b20('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1b20('0xb')](function(_0xefa7f3){logger['info']('GetCampaign',_0xff7c72);logger[_0x1b20('0x1d')]('GetCampaign',_0xff7c72,JSON['stringify'](_0xefa7f3));_0x34517f(_0xefa7f3);})['catch'](function(_0x342a84){logger[_0x1b20('0xf')](_0x1b20('0x14'),_0x342a84[_0x1b20('0x12')],_0xff7c72);_0x46bb09(_0xf9078e[_0x1b20('0xf')](0x1f4,_0x342a84[_0x1b20('0x12')]));});});};
\ No newline at end of file
+var _0x758e=['debug','error','code','message','catch','GetCampaign','options','raw','attributes','include','map','model','then','info','stringify','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','Campaign,\x20%s,\x20%s','request\x20sent'];(function(_0x2744c5,_0x3caacd){var _0x4d044b=function(_0x2e2f0c){while(--_0x2e2f0c){_0x2744c5['push'](_0x2744c5['shift']());}};_0x4d044b(++_0x3caacd);}(_0x758e,0x1af));var _0xe758=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x758e[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xe758('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe758('0x1'));var rs=require(_0xe758('0x2'));var fs=require('fs');var Redis=require(_0xe758('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe758('0x4'))(_0xe758('0x5'));var config=require(_0xe758('0x6'));var jayson=require(_0xe758('0x7'));var client=jayson['client'][_0xe758('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21e792,_0x46eec3,_0x5357cf){return new BPromise(function(_0x4c03ba,_0x454ee0){return client['request'](_0x21e792,_0x5357cf)['then'](function(_0x4c16c3){logger['info'](_0xe758('0x9'),_0x46eec3,_0xe758('0xa'));logger[_0xe758('0xb')]('Campaign,\x20%s,\x20%s,\x20%s',_0x46eec3,_0xe758('0xa'),JSON['stringify'](_0x4c16c3));if(_0x4c16c3[_0xe758('0xc')]){if(_0x4c16c3[_0xe758('0xc')][_0xe758('0xd')]===0x1f4){logger['error'](_0xe758('0x9'),_0x46eec3,_0x4c16c3['error'][_0xe758('0xe')]);return _0x454ee0(_0x4c16c3[_0xe758('0xc')][_0xe758('0xe')]);}logger[_0xe758('0xc')](_0xe758('0x9'),_0x46eec3,_0x4c16c3[_0xe758('0xc')][_0xe758('0xe')]);return _0x4c03ba(_0x4c16c3[_0xe758('0xc')][_0xe758('0xe')]);}else{logger['info'](_0xe758('0x9'),_0x46eec3,'request\x20sent');_0x4c03ba(_0x4c16c3['result'][_0xe758('0xe')]);}})[_0xe758('0xf')](function(_0x540eb6){logger['error'](_0xe758('0x9'),_0x46eec3,_0x540eb6);_0x454ee0(_0x540eb6);});});}exports[_0xe758('0x10')]=function(_0x38c30c){var _0xfdf5b0=this;return new Promise(function(_0x3fe7e8,_0x3ee871){return db['Campaign']['findAll']({'raw':_0x38c30c[_0xe758('0x11')]?_0x38c30c[_0xe758('0x11')][_0xe758('0x12')]===undefined?!![]:![]:!![],'where':_0x38c30c[_0xe758('0x11')]?_0x38c30c[_0xe758('0x11')]['where']||null:null,'attributes':_0x38c30c['options']?_0x38c30c[_0xe758('0x11')][_0xe758('0x13')]||null:null,'limit':_0x38c30c[_0xe758('0x11')]?_0x38c30c[_0xe758('0x11')]['limit']||null:null,'include':_0x38c30c[_0xe758('0x11')]?_0x38c30c[_0xe758('0x11')][_0xe758('0x14')]?_[_0xe758('0x15')](_0x38c30c[_0xe758('0x11')][_0xe758('0x14')],function(_0x108bfe){return{'model':db[_0x108bfe['model']],'as':_0x108bfe['as'],'attributes':_0x108bfe['attributes'],'include':_0x108bfe['include']?_['map'](_0x108bfe[_0xe758('0x14')],function(_0x145beb){return{'model':db[_0x145beb[_0xe758('0x16')]],'as':_0x145beb['as'],'attributes':_0x145beb[_0xe758('0x13')],'include':_0x145beb['include']?_[_0xe758('0x15')](_0x145beb['include'],function(_0x3bcdac){return{'model':db[_0x3bcdac['model']],'as':_0x3bcdac['as'],'attributes':_0x3bcdac['attributes']};}):[]};}):[]};}):[]:[]})[_0xe758('0x17')](function(_0x177db1){logger[_0xe758('0x18')](_0xe758('0x10'),_0x38c30c);logger['debug'](_0xe758('0x10'),_0x38c30c,JSON[_0xe758('0x19')](_0x177db1));_0x3fe7e8(_0x177db1);})[_0xe758('0xf')](function(_0x1934d9){logger['error'](_0xe758('0x10'),_0x1934d9['message'],_0x38c30c);_0x3ee871(_0xfdf5b0[_0xe758('0xc')](0x1f4,_0x1934d9[_0xe758('0xe')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index e43861a..fb80f2c 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 _0xd377=['getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getLists','/:id/blacklists','getBlackLists','post','/:id/lists','update','destroy','delete','removeLists','removeBlackLists','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id','isAuthenticated','show'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd377,0x1a3));var _0x7d37=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd377[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x7d37('0x0'));var path=require(_0x7d37('0x1'));var timeout=require(_0x7d37('0x2'));var express=require(_0x7d37('0x3'));var router=express[_0x7d37('0x4')]();var fs_extra=require(_0x7d37('0x5'));var auth=require(_0x7d37('0x6'));var interaction=require(_0x7d37('0x7'));var config=require(_0x7d37('0x8'));var controller=require(_0x7d37('0x9'));router[_0x7d37('0xa')]('/',auth['isAuthenticated'](),controller[_0x7d37('0xb')]);router[_0x7d37('0xa')](_0x7d37('0xc'),auth[_0x7d37('0xd')](),controller[_0x7d37('0xe')]);router['get']('/:id/hoppers',auth['isAuthenticated'](),controller[_0x7d37('0xf')]);router[_0x7d37('0xa')](_0x7d37('0x10'),auth[_0x7d37('0xd')](),controller[_0x7d37('0x11')]);router[_0x7d37('0xa')](_0x7d37('0x12'),auth[_0x7d37('0xd')](),controller['getHopperFinals']);router[_0x7d37('0xa')](_0x7d37('0x13'),auth[_0x7d37('0xd')](),controller['getHopperBlacks']);router[_0x7d37('0xa')]('/:id/lists',auth[_0x7d37('0xd')](),controller[_0x7d37('0x14')]);router[_0x7d37('0xa')](_0x7d37('0x15'),auth[_0x7d37('0xd')](),controller[_0x7d37('0x16')]);router[_0x7d37('0x17')]('/',auth[_0x7d37('0xd')](),controller['create']);router[_0x7d37('0x17')]('/:id/clone',auth['isAuthenticated'](),controller['clone']);router[_0x7d37('0x17')](_0x7d37('0x18'),auth['isAuthenticated'](),controller['addLists']);router[_0x7d37('0x17')](_0x7d37('0x15'),auth[_0x7d37('0xd')](),controller['addBlackLists']);router['put']('/:id',auth[_0x7d37('0xd')](),controller[_0x7d37('0x19')]);router['delete'](_0x7d37('0xc'),auth[_0x7d37('0xd')](),controller[_0x7d37('0x1a')]);router[_0x7d37('0x1b')](_0x7d37('0x18'),auth['isAuthenticated'](),controller[_0x7d37('0x1c')]);router['delete'](_0x7d37('0x15'),auth[_0x7d37('0xd')](),controller[_0x7d37('0x1d')]);module[_0x7d37('0x1e')]=router;
\ No newline at end of file
+var _0x8906=['delete','/:id/lists','removeLists','/:id/blacklists','exports','util','path','express','../../components/auth/service','../../config/environment','./campaign.controller','get','index','/:id','isAuthenticated','/:id/hopper_histories','getHopperFinals','/:id/hopper_black','getLists','getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','put','destroy'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x8906,0x149));var _0x6890=function(_0x5dd85a,_0x17e2ad){_0x5dd85a=_0x5dd85a-0x0;var _0x57bf23=_0x8906[_0x5dd85a];return _0x57bf23;};'use strict';var multer=require('multer');var util=require(_0x6890('0x0'));var path=require(_0x6890('0x1'));var timeout=require('connect-timeout');var express=require(_0x6890('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6890('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6890('0x4'));var controller=require(_0x6890('0x5'));router[_0x6890('0x6')]('/',auth['isAuthenticated'](),controller[_0x6890('0x7')]);router['get'](_0x6890('0x8'),auth[_0x6890('0x9')](),controller['show']);router[_0x6890('0x6')]('/:id/hoppers',auth[_0x6890('0x9')](),controller['getHoppers']);router['get'](_0x6890('0xa'),auth[_0x6890('0x9')](),controller['getHopperHistories']);router[_0x6890('0x6')]('/:id/hopper_finals',auth[_0x6890('0x9')](),controller[_0x6890('0xb')]);router[_0x6890('0x6')](_0x6890('0xc'),auth[_0x6890('0x9')](),controller['getHopperBlacks']);router[_0x6890('0x6')]('/:id/lists',auth[_0x6890('0x9')](),controller[_0x6890('0xd')]);router['get']('/:id/blacklists',auth[_0x6890('0x9')](),controller[_0x6890('0xe')]);router[_0x6890('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6890('0xf')](_0x6890('0x10'),auth[_0x6890('0x9')](),controller[_0x6890('0x11')]);router['post']('/:id/lists',auth[_0x6890('0x9')](),controller[_0x6890('0x12')]);router[_0x6890('0xf')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x6890('0x13')]);router[_0x6890('0x14')](_0x6890('0x8'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x6890('0x8'),auth[_0x6890('0x9')](),controller[_0x6890('0x15')]);router[_0x6890('0x16')](_0x6890('0x17'),auth[_0x6890('0x9')](),controller[_0x6890('0x18')]);router[_0x6890('0x16')](_0x6890('0x19'),auth[_0x6890('0x9')](),controller['removeBlackLists']);module[_0x6890('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 5ab9b2c..66d265a 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 _0x6c53=['VIRTUAL','getDataValue','key','sequelize','STRING','TEXT'];(function(_0x4087db,_0x1dad01){var _0x50be2f=function(_0x1257fe){while(--_0x1257fe){_0x4087db['push'](_0x4087db['shift']());}};_0x50be2f(++_0x1dad01);}(_0x6c53,0x18f));var _0x36c5=function(_0x5ccf2a,_0xb837f1){_0x5ccf2a=_0x5ccf2a-0x0;var _0xb1b8ab=_0x6c53[_0x5ccf2a];return _0xb1b8ab;};'use strict';var Sequelize=require(_0x36c5('0x0'));module['exports']={'key':{'type':Sequelize[_0x36c5('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x36c5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x36c5('0x1')]},'name':{'type':Sequelize[_0x36c5('0x3')],'get':function(){return this[_0x36c5('0x4')](_0x36c5('0x5'));}}};
\ No newline at end of file
+var _0x2616=['STRING','TEXT','getDataValue','sequelize','exports'];(function(_0xe39277,_0x42cf78){var _0x265220=function(_0x40ec04){while(--_0x40ec04){_0xe39277['push'](_0xe39277['shift']());}};_0x265220(++_0x42cf78);}(_0x2616,0x16b));var _0x6261=function(_0x3e0b8f,_0x1cddeb){_0x3e0b8f=_0x3e0b8f-0x0;var _0x22f742=_0x2616[_0x3e0b8f];return _0x22f742;};'use strict';var Sequelize=require(_0x6261('0x0'));module[_0x6261('0x1')]={'key':{'type':Sequelize[_0x6261('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x6261('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x6261('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x6261('0x4')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 7cef628..149ce28 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 _0x8aab=['eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','send','index','map','CannedAnswer','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','findAll','rows','show','params','include','options','find','body','catch','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x2cdc4a,_0xa97f65){var _0x1e2341=function(_0x54d5cc){while(--_0x54d5cc){_0x2cdc4a['push'](_0x2cdc4a['shift']());}};_0x1e2341(++_0xa97f65);}(_0x8aab,0x114));var _0xb8aa=function(_0x736b3c,_0x132551){_0x736b3c=_0x736b3c-0x0;var _0x409141=_0x8aab[_0x736b3c];return _0x409141;};'use strict';var emlformat=require(_0xb8aa('0x0'));var rimraf=require(_0xb8aa('0x1'));var zipdir=require(_0xb8aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb8aa('0x3'));var moment=require('moment');var BPromise=require(_0xb8aa('0x4'));var Mustache=require(_0xb8aa('0x5'));var util=require(_0xb8aa('0x6'));var path=require(_0xb8aa('0x7'));var sox=require('sox');var csv=require(_0xb8aa('0x8'));var ejs=require(_0xb8aa('0x9'));var fs=require('fs');var fs_extra=require(_0xb8aa('0xa'));var _=require(_0xb8aa('0xb'));var squel=require(_0xb8aa('0xc'));var crypto=require(_0xb8aa('0xd'));var jsforce=require(_0xb8aa('0xe'));var deskjs=require(_0xb8aa('0xf'));var toCsv=require(_0xb8aa('0x8'));var querystring=require(_0xb8aa('0x10'));var Papa=require(_0xb8aa('0x11'));var Redis=require('ioredis');var authService=require(_0xb8aa('0x12'));var qs=require(_0xb8aa('0x13'));var as=require(_0xb8aa('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb8aa('0x15'));var utils=require(_0xb8aa('0x16'));var config=require(_0xb8aa('0x17'));var licenseUtil=require(_0xb8aa('0x18'));var db=require(_0xb8aa('0x19'))['db'];function respondWithStatusCode(_0x289fb7,_0x3200f1){_0x3200f1=_0x3200f1||0xcc;return function(_0x32074d){if(_0x32074d){return _0x289fb7[_0xb8aa('0x1a')](_0x3200f1);}return _0x289fb7[_0xb8aa('0x1b')](_0x3200f1)[_0xb8aa('0x1c')]();};}function respondWithResult(_0x499c56,_0x4e5c89){_0x4e5c89=_0x4e5c89||0xc8;return function(_0x4c4906){if(_0x4c4906){return _0x499c56['status'](_0x4e5c89)[_0xb8aa('0x1d')](_0x4c4906);}};}function respondWithFilteredResult(_0x32dccf,_0x5b5bb0){return function(_0x678ff){if(_0x678ff){var _0x38e33c=typeof _0x5b5bb0['offset']===_0xb8aa('0x1e')&&typeof _0x5b5bb0[_0xb8aa('0x1f')]===_0xb8aa('0x1e');var _0x293841=_0x678ff[_0xb8aa('0x20')];var _0x1e9726=_0x38e33c?0x0:_0x5b5bb0[_0xb8aa('0x21')];var _0x122fed=_0x38e33c?_0x678ff[_0xb8aa('0x20')]:_0x5b5bb0[_0xb8aa('0x21')]+_0x5b5bb0['limit'];var _0x3267d3;if(_0x122fed>=_0x293841){_0x122fed=_0x293841;_0x3267d3=0xc8;}else{_0x3267d3=0xce;}_0x32dccf['status'](_0x3267d3);return _0x32dccf[_0xb8aa('0x22')]('Content-Range',_0x1e9726+'-'+_0x122fed+'/'+_0x293841)[_0xb8aa('0x1d')](_0x678ff);}return null;};}function patchUpdates(_0xbf27ce){return function(_0x34de86){try{jsonpatch[_0xb8aa('0x23')](_0x34de86,_0xbf27ce,!![]);}catch(_0xc7affc){return BPromise['reject'](_0xc7affc);}return _0x34de86[_0xb8aa('0x24')]();};}function saveUpdates(_0x4b927b,_0x1ea017){return function(_0x396197){if(_0x396197){return _0x396197[_0xb8aa('0x25')](_0x4b927b)[_0xb8aa('0x26')](function(_0x570663){return _0x570663;});}return null;};}function removeEntity(_0x4d07a0,_0x38f94c){return function(_0x3ce4e4){if(_0x3ce4e4){return _0x3ce4e4[_0xb8aa('0x27')]()[_0xb8aa('0x26')](function(){var _0x58b125=_0x3ce4e4[_0xb8aa('0x28')]({'plain':!![]});var _0x5ccfb8=_0xb8aa('0x29');return db[_0xb8aa('0x2a')][_0xb8aa('0x27')]({'where':{'type':_0x5ccfb8,'resourceId':_0x58b125['id']}})[_0xb8aa('0x26')](function(){return _0x3ce4e4;});})[_0xb8aa('0x26')](function(){_0x4d07a0[_0xb8aa('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x65ec2,_0xed999){return function(_0x5d5b6e){if(!_0x5d5b6e){_0x65ec2[_0xb8aa('0x1a')](0x194);}return _0x5d5b6e;};}function handleError(_0x1e051d,_0x492037){_0x492037=_0x492037||0x1f4;return function(_0x470bf2){logger['error'](_0x470bf2[_0xb8aa('0x2b')]);if(_0x470bf2[_0xb8aa('0x2c')]){delete _0x470bf2[_0xb8aa('0x2c')];}_0x1e051d[_0xb8aa('0x1b')](_0x492037)[_0xb8aa('0x2d')](_0x470bf2);};}exports[_0xb8aa('0x2e')]=function(_0x10908c,_0xa4e929){var _0x465f95={},_0x321d60={},_0x172447={'count':0x0,'rows':[]};var _0x8414e2=_[_0xb8aa('0x2f')](db[_0xb8aa('0x30')]['rawAttributes'],function(_0x4c0645){return{'name':_0x4c0645['fieldName'],'type':_0x4c0645[_0xb8aa('0x31')][_0xb8aa('0x32')]};});_0x321d60[_0xb8aa('0x33')]=_[_0xb8aa('0x2f')](_0x8414e2,'name');_0x321d60[_0xb8aa('0x34')]=_[_0xb8aa('0x35')](_0x10908c[_0xb8aa('0x34')]);_0x321d60[_0xb8aa('0x36')]=_['intersection'](_0x321d60['model'],_0x321d60['query']);_0x465f95[_0xb8aa('0x37')]=_[_0xb8aa('0x38')](_0x321d60[_0xb8aa('0x33')],qs[_0xb8aa('0x39')](_0x10908c[_0xb8aa('0x34')][_0xb8aa('0x39')]));_0x465f95[_0xb8aa('0x37')]=_0x465f95[_0xb8aa('0x37')][_0xb8aa('0x3a')]?_0x465f95[_0xb8aa('0x37')]:_0x321d60[_0xb8aa('0x33')];if(!_0x10908c[_0xb8aa('0x34')][_0xb8aa('0x3b')](_0xb8aa('0x3c'))){_0x465f95[_0xb8aa('0x1f')]=qs['limit'](_0x10908c[_0xb8aa('0x34')][_0xb8aa('0x1f')]);_0x465f95[_0xb8aa('0x21')]=qs['offset'](_0x10908c[_0xb8aa('0x34')][_0xb8aa('0x21')]);}_0x465f95[_0xb8aa('0x3d')]=qs['sort'](_0x10908c[_0xb8aa('0x34')][_0xb8aa('0x3e')]);_0x465f95[_0xb8aa('0x3f')]=qs['filters'](_[_0xb8aa('0x40')](_0x10908c[_0xb8aa('0x34')],_0x321d60['filters']),_0x8414e2);if(_0x10908c[_0xb8aa('0x34')]['filter']){_0x465f95[_0xb8aa('0x3f')]=_[_0xb8aa('0x41')](_0x465f95[_0xb8aa('0x3f')],{'$or':[{'key':{'$like':'%'+_0x10908c[_0xb8aa('0x34')]['filter']+'%'}},{'value':{'$like':'%'+_0x10908c[_0xb8aa('0x34')][_0xb8aa('0x42')]+'%'}}]});}_0x465f95=_[_0xb8aa('0x41')]({},_0x465f95,_0x10908c['options']);var _0x1545e5={'where':_0x465f95[_0xb8aa('0x3f')]};return db[_0xb8aa('0x30')][_0xb8aa('0x20')](_0x1545e5)['then'](function(_0x153620){_0x172447[_0xb8aa('0x20')]=_0x153620;if(_0x10908c[_0xb8aa('0x34')][_0xb8aa('0x43')]){_0x465f95['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xb8aa('0x44')](_0x465f95);})[_0xb8aa('0x26')](function(_0x540e58){_0x172447[_0xb8aa('0x45')]=_0x540e58;return _0x172447;})[_0xb8aa('0x26')](respondWithFilteredResult(_0xa4e929,_0x465f95))['catch'](handleError(_0xa4e929,null));};exports[_0xb8aa('0x46')]=function(_0x18d24a,_0x1a7a0e){var _0x24bd88={'raw':!![],'where':{'id':_0x18d24a[_0xb8aa('0x47')]['id']}},_0x4b0562={};_0x4b0562[_0xb8aa('0x33')]=_[_0xb8aa('0x35')](db[_0xb8aa('0x30')]['rawAttributes']);_0x4b0562[_0xb8aa('0x34')]=_['keys'](_0x18d24a[_0xb8aa('0x34')]);_0x4b0562['filters']=_[_0xb8aa('0x38')](_0x4b0562[_0xb8aa('0x33')],_0x4b0562['query']);_0x24bd88[_0xb8aa('0x37')]=_[_0xb8aa('0x38')](_0x4b0562['model'],qs['fields'](_0x18d24a[_0xb8aa('0x34')][_0xb8aa('0x39')]));_0x24bd88['attributes']=_0x24bd88['attributes'][_0xb8aa('0x3a')]?_0x24bd88[_0xb8aa('0x37')]:_0x4b0562[_0xb8aa('0x33')];if(_0x18d24a[_0xb8aa('0x34')]['includeAll']){_0x24bd88[_0xb8aa('0x48')]=[{'all':!![]}];}_0x24bd88=_[_0xb8aa('0x41')]({},_0x24bd88,_0x18d24a[_0xb8aa('0x49')]);return db[_0xb8aa('0x30')][_0xb8aa('0x4a')](_0x24bd88)['then'](handleEntityNotFound(_0x1a7a0e,null))[_0xb8aa('0x26')](respondWithResult(_0x1a7a0e,null))['catch'](handleError(_0x1a7a0e,null));};exports[_0xb8aa('0x25')]=function(_0x31b25c,_0x35acbd){if(_0x31b25c[_0xb8aa('0x4b')]['id']){delete _0x31b25c[_0xb8aa('0x4b')]['id'];}return db[_0xb8aa('0x30')][_0xb8aa('0x4a')]({'where':{'id':_0x31b25c['params']['id']}})[_0xb8aa('0x26')](handleEntityNotFound(_0x35acbd,null))[_0xb8aa('0x26')](saveUpdates(_0x31b25c[_0xb8aa('0x4b')],null))[_0xb8aa('0x26')](respondWithResult(_0x35acbd,null))[_0xb8aa('0x4c')](handleError(_0x35acbd,null));};exports[_0xb8aa('0x27')]=function(_0x408054,_0x1fc912){return db[_0xb8aa('0x30')][_0xb8aa('0x4a')]({'where':{'id':_0x408054['params']['id']}})[_0xb8aa('0x26')](handleEntityNotFound(_0x1fc912,null))['then'](removeEntity(_0x1fc912,null))[_0xb8aa('0x4c')](handleError(_0x1fc912,null));};exports['create']=function(_0x26dffe,_0xc33a81){var _0x565bf6={'key':_0x26dffe[_0xb8aa('0x4b')][_0xb8aa('0x32')]};if(_0x26dffe['body'][_0xb8aa('0x4d')]){_0x565bf6[_0xb8aa('0x4d')]=_0x26dffe[_0xb8aa('0x4b')][_0xb8aa('0x4d')];}else if(_0x26dffe[_0xb8aa('0x4b')][_0xb8aa('0x4e')]){_0x565bf6[_0xb8aa('0x4e')]=_0x26dffe['body']['SmsAccountId'];}else if(_0x26dffe['body'][_0xb8aa('0x4f')]){_0x565bf6[_0xb8aa('0x4f')]=_0x26dffe[_0xb8aa('0x4b')][_0xb8aa('0x4f')];}else if(_0x26dffe['body'][_0xb8aa('0x50')]){_0x565bf6[_0xb8aa('0x50')]=_0x26dffe[_0xb8aa('0x4b')][_0xb8aa('0x50')];}return db['CannedAnswer'][_0xb8aa('0x4a')]({'where':_0x565bf6})[_0xb8aa('0x26')](function(_0x39a0f9){if(_0x39a0f9){throw new db[(_0xb8aa('0x51'))][(_0xb8aa('0x52'))](_0xb8aa('0x53'));}return db[_0xb8aa('0x30')][_0xb8aa('0x54')](_0x26dffe[_0xb8aa('0x4b')]);})[_0xb8aa('0x26')](function(_0x1e5263){var _0x1390ad=_0x26dffe[_0xb8aa('0x55')][_0xb8aa('0x28')]({'plain':!![]});if(!_0x1390ad)throw new Error(_0xb8aa('0x56'));if(_0x1390ad[_0xb8aa('0x57')]==='user'){var _0x1745cd=_0x1e5263['get']({'plain':!![]});return db[_0xb8aa('0x58')][_0xb8aa('0x4a')]({'where':{'name':_0xb8aa('0x29'),'userProfileId':_0x1390ad[_0xb8aa('0x59')]},'raw':!![]})[_0xb8aa('0x26')](function(_0x46a707){if(_0x46a707&&_0x46a707[_0xb8aa('0x5a')]===0x0){return db[_0xb8aa('0x2a')][_0xb8aa('0x54')]({'name':_0x1745cd[_0xb8aa('0x2c')],'resourceId':_0x1745cd['id'],'type':_0x46a707[_0xb8aa('0x2c')],'sectionId':_0x46a707['id']},{})[_0xb8aa('0x26')](function(){return _0x1e5263;});}else{return _0x1e5263;}})[_0xb8aa('0x4c')](function(_0x5a3ed4){logger['error'](_0xb8aa('0x5b'),_0x5a3ed4);throw _0x5a3ed4;});}return _0x1e5263;})[_0xb8aa('0x26')](respondWithResult(_0xc33a81,0xc9))[_0xb8aa('0x4c')](handleError(_0xc33a81,null));};
\ No newline at end of file
+var _0x923b=['save','update','destroy','then','UserProfileResource','name','index','CannedAnswer','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','catch','show','params','include','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x57dff9,_0x37bd67){var _0x346ae6=function(_0x14197b){while(--_0x14197b){_0x57dff9['push'](_0x57dff9['shift']());}};_0x346ae6(++_0x37bd67);}(_0x923b,0x85));var _0xb923=function(_0x2055a7,_0x415a4c){_0x2055a7=_0x2055a7-0x0;var _0x42a14d=_0x923b[_0x2055a7];return _0x42a14d;};'use strict';var emlformat=require(_0xb923('0x0'));var rimraf=require(_0xb923('0x1'));var zipdir=require(_0xb923('0x2'));var jsonpatch=require(_0xb923('0x3'));var rp=require(_0xb923('0x4'));var moment=require(_0xb923('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb923('0x6'));var sox=require('sox');var csv=require(_0xb923('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb923('0x8'));var _=require(_0xb923('0x9'));var squel=require(_0xb923('0xa'));var crypto=require(_0xb923('0xb'));var jsforce=require(_0xb923('0xc'));var deskjs=require(_0xb923('0xd'));var toCsv=require(_0xb923('0x7'));var querystring=require(_0xb923('0xe'));var Papa=require('papaparse');var Redis=require(_0xb923('0xf'));var authService=require(_0xb923('0x10'));var qs=require(_0xb923('0x11'));var as=require(_0xb923('0x12'));var hardwareService=require(_0xb923('0x13'));var logger=require(_0xb923('0x14'))('api');var utils=require(_0xb923('0x15'));var config=require(_0xb923('0x16'));var licenseUtil=require(_0xb923('0x17'));var db=require(_0xb923('0x18'))['db'];function respondWithStatusCode(_0xb457f5,_0x4ab220){_0x4ab220=_0x4ab220||0xcc;return function(_0x815e4c){if(_0x815e4c){return _0xb457f5[_0xb923('0x19')](_0x4ab220);}return _0xb457f5[_0xb923('0x1a')](_0x4ab220)[_0xb923('0x1b')]();};}function respondWithResult(_0x2e3f01,_0x374bee){_0x374bee=_0x374bee||0xc8;return function(_0x4a5934){if(_0x4a5934){return _0x2e3f01[_0xb923('0x1a')](_0x374bee)['json'](_0x4a5934);}};}function respondWithFilteredResult(_0x4e1fbd,_0x375048){return function(_0x36c49e){if(_0x36c49e){var _0x814d18=typeof _0x375048[_0xb923('0x1c')]===_0xb923('0x1d')&&typeof _0x375048[_0xb923('0x1e')]===_0xb923('0x1d');var _0x55d9e9=_0x36c49e['count'];var _0x543191=_0x814d18?0x0:_0x375048[_0xb923('0x1c')];var _0x34502=_0x814d18?_0x36c49e[_0xb923('0x1f')]:_0x375048[_0xb923('0x1c')]+_0x375048['limit'];var _0x155627;if(_0x34502>=_0x55d9e9){_0x34502=_0x55d9e9;_0x155627=0xc8;}else{_0x155627=0xce;}_0x4e1fbd['status'](_0x155627);return _0x4e1fbd[_0xb923('0x20')](_0xb923('0x21'),_0x543191+'-'+_0x34502+'/'+_0x55d9e9)['json'](_0x36c49e);}return null;};}function patchUpdates(_0x51dce7){return function(_0x1d4c12){try{jsonpatch[_0xb923('0x22')](_0x1d4c12,_0x51dce7,!![]);}catch(_0x376e0a){return BPromise['reject'](_0x376e0a);}return _0x1d4c12[_0xb923('0x23')]();};}function saveUpdates(_0xcb373a,_0xedceaa){return function(_0x3fc66e){if(_0x3fc66e){return _0x3fc66e[_0xb923('0x24')](_0xcb373a)['then'](function(_0x20dfd9){return _0x20dfd9;});}return null;};}function removeEntity(_0xa63741,_0x14226a){return function(_0x1a3830){if(_0x1a3830){return _0x1a3830[_0xb923('0x25')]()[_0xb923('0x26')](function(){var _0x4658a7=_0x1a3830['get']({'plain':!![]});var _0x1c1419='CannedAnswers';return db[_0xb923('0x27')][_0xb923('0x25')]({'where':{'type':_0x1c1419,'resourceId':_0x4658a7['id']}})[_0xb923('0x26')](function(){return _0x1a3830;});})[_0xb923('0x26')](function(){_0xa63741[_0xb923('0x1a')](0xcc)[_0xb923('0x1b')]();});}};}function handleEntityNotFound(_0x505d47,_0x22d08f){return function(_0x5cf546){if(!_0x5cf546){_0x505d47['sendStatus'](0x194);}return _0x5cf546;};}function handleError(_0x4033db,_0x3d0b32){_0x3d0b32=_0x3d0b32||0x1f4;return function(_0x25889c){logger['error'](_0x25889c['stack']);if(_0x25889c[_0xb923('0x28')]){delete _0x25889c[_0xb923('0x28')];}_0x4033db[_0xb923('0x1a')](_0x3d0b32)['send'](_0x25889c);};}exports[_0xb923('0x29')]=function(_0x511008,_0x49cf52){var _0x555707={},_0x432d68={},_0x2e4bb4={'count':0x0,'rows':[]};var _0x44e34f=_['map'](db[_0xb923('0x2a')][_0xb923('0x2b')],function(_0x388b72){return{'name':_0x388b72['fieldName'],'type':_0x388b72[_0xb923('0x2c')][_0xb923('0x2d')]};});_0x432d68[_0xb923('0x2e')]=_['map'](_0x44e34f,_0xb923('0x28'));_0x432d68['query']=_[_0xb923('0x2f')](_0x511008[_0xb923('0x30')]);_0x432d68[_0xb923('0x31')]=_[_0xb923('0x32')](_0x432d68['model'],_0x432d68[_0xb923('0x30')]);_0x555707[_0xb923('0x33')]=_['intersection'](_0x432d68[_0xb923('0x2e')],qs[_0xb923('0x34')](_0x511008[_0xb923('0x30')][_0xb923('0x34')]));_0x555707['attributes']=_0x555707[_0xb923('0x33')][_0xb923('0x35')]?_0x555707['attributes']:_0x432d68[_0xb923('0x2e')];if(!_0x511008[_0xb923('0x30')][_0xb923('0x36')]('nolimit')){_0x555707['limit']=qs['limit'](_0x511008['query'][_0xb923('0x1e')]);_0x555707[_0xb923('0x1c')]=qs[_0xb923('0x1c')](_0x511008[_0xb923('0x30')][_0xb923('0x1c')]);}_0x555707[_0xb923('0x37')]=qs[_0xb923('0x38')](_0x511008[_0xb923('0x30')][_0xb923('0x38')]);_0x555707[_0xb923('0x39')]=qs['filters'](_[_0xb923('0x3a')](_0x511008[_0xb923('0x30')],_0x432d68[_0xb923('0x31')]),_0x44e34f);if(_0x511008['query'][_0xb923('0x3b')]){_0x555707['where']=_[_0xb923('0x3c')](_0x555707[_0xb923('0x39')],{'$or':[{'key':{'$like':'%'+_0x511008[_0xb923('0x30')]['filter']+'%'}},{'value':{'$like':'%'+_0x511008[_0xb923('0x30')][_0xb923('0x3b')]+'%'}}]});}_0x555707=_[_0xb923('0x3c')]({},_0x555707,_0x511008[_0xb923('0x3d')]);var _0x12b800={'where':_0x555707[_0xb923('0x39')]};return db[_0xb923('0x2a')]['count'](_0x12b800)[_0xb923('0x26')](function(_0x2fbcaa){_0x2e4bb4[_0xb923('0x1f')]=_0x2fbcaa;if(_0x511008[_0xb923('0x30')][_0xb923('0x3e')]){_0x555707['include']=[{'all':!![]}];}return db[_0xb923('0x2a')]['findAll'](_0x555707);})[_0xb923('0x26')](function(_0x31bb07){_0x2e4bb4['rows']=_0x31bb07;return _0x2e4bb4;})[_0xb923('0x26')](respondWithFilteredResult(_0x49cf52,_0x555707))[_0xb923('0x3f')](handleError(_0x49cf52,null));};exports[_0xb923('0x40')]=function(_0x12a2f7,_0x482e6f){var _0x7e328a={'raw':!![],'where':{'id':_0x12a2f7[_0xb923('0x41')]['id']}},_0x3c783e={};_0x3c783e['model']=_[_0xb923('0x2f')](db[_0xb923('0x2a')]['rawAttributes']);_0x3c783e[_0xb923('0x30')]=_['keys'](_0x12a2f7[_0xb923('0x30')]);_0x3c783e[_0xb923('0x31')]=_[_0xb923('0x32')](_0x3c783e['model'],_0x3c783e[_0xb923('0x30')]);_0x7e328a['attributes']=_[_0xb923('0x32')](_0x3c783e[_0xb923('0x2e')],qs['fields'](_0x12a2f7[_0xb923('0x30')][_0xb923('0x34')]));_0x7e328a[_0xb923('0x33')]=_0x7e328a[_0xb923('0x33')]['length']?_0x7e328a[_0xb923('0x33')]:_0x3c783e[_0xb923('0x2e')];if(_0x12a2f7['query'][_0xb923('0x3e')]){_0x7e328a[_0xb923('0x42')]=[{'all':!![]}];}_0x7e328a=_[_0xb923('0x3c')]({},_0x7e328a,_0x12a2f7['options']);return db['CannedAnswer']['find'](_0x7e328a)['then'](handleEntityNotFound(_0x482e6f,null))[_0xb923('0x26')](respondWithResult(_0x482e6f,null))[_0xb923('0x3f')](handleError(_0x482e6f,null));};exports['update']=function(_0x37440d,_0x207b46){if(_0x37440d[_0xb923('0x43')]['id']){delete _0x37440d[_0xb923('0x43')]['id'];}return db[_0xb923('0x2a')][_0xb923('0x44')]({'where':{'id':_0x37440d[_0xb923('0x41')]['id']}})[_0xb923('0x26')](handleEntityNotFound(_0x207b46,null))['then'](saveUpdates(_0x37440d[_0xb923('0x43')],null))[_0xb923('0x26')](respondWithResult(_0x207b46,null))[_0xb923('0x3f')](handleError(_0x207b46,null));};exports[_0xb923('0x25')]=function(_0x46abcc,_0x4c7266){return db['CannedAnswer'][_0xb923('0x44')]({'where':{'id':_0x46abcc['params']['id']}})[_0xb923('0x26')](handleEntityNotFound(_0x4c7266,null))[_0xb923('0x26')](removeEntity(_0x4c7266,null))[_0xb923('0x3f')](handleError(_0x4c7266,null));};exports[_0xb923('0x45')]=function(_0x2722e4,_0x2d3141){var _0x10635b={'key':_0x2722e4[_0xb923('0x43')][_0xb923('0x2d')]};if(_0x2722e4[_0xb923('0x43')]['MailAccountId']){_0x10635b[_0xb923('0x46')]=_0x2722e4[_0xb923('0x43')][_0xb923('0x46')];}else if(_0x2722e4[_0xb923('0x43')]['SmsAccountId']){_0x10635b[_0xb923('0x47')]=_0x2722e4[_0xb923('0x43')][_0xb923('0x47')];}else if(_0x2722e4[_0xb923('0x43')][_0xb923('0x48')]){_0x10635b['OpenchannelAccountId']=_0x2722e4[_0xb923('0x43')][_0xb923('0x48')];}else if(_0x2722e4[_0xb923('0x43')][_0xb923('0x49')]){_0x10635b[_0xb923('0x49')]=_0x2722e4[_0xb923('0x43')][_0xb923('0x49')];}return db[_0xb923('0x2a')]['find']({'where':_0x10635b})[_0xb923('0x26')](function(_0x45df91){if(_0x45df91){throw new db['Sequelize']['ValidationError'](_0xb923('0x4a'));}return db[_0xb923('0x2a')]['create'](_0x2722e4[_0xb923('0x43')]);})[_0xb923('0x26')](function(_0x20a814){var _0x14f9ae=_0x2722e4['user'][_0xb923('0x4b')]({'plain':!![]});if(!_0x14f9ae)throw new Error(_0xb923('0x4c'));if(_0x14f9ae[_0xb923('0x4d')]===_0xb923('0x4e')){var _0x1977f2=_0x20a814[_0xb923('0x4b')]({'plain':!![]});return db[_0xb923('0x4f')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x14f9ae[_0xb923('0x50')]},'raw':!![]})[_0xb923('0x26')](function(_0x11733b){if(_0x11733b&&_0x11733b[_0xb923('0x51')]===0x0){return db[_0xb923('0x27')]['create']({'name':_0x1977f2[_0xb923('0x28')],'resourceId':_0x1977f2['id'],'type':_0x11733b[_0xb923('0x28')],'sectionId':_0x11733b['id']},{})[_0xb923('0x26')](function(){return _0x20a814;});}else{return _0x20a814;}})['catch'](function(_0x3a5da2){logger[_0xb923('0x52')](_0xb923('0x53'),_0x3a5da2);throw _0x3a5da2;});}return _0x20a814;})[_0xb923('0x26')](respondWithResult(_0x2d3141,0xc9))[_0xb923('0x3f')](handleError(_0x2d3141,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 0c171f5..c49b182 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 _0x3095=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0xa201ee,_0x37da32){var _0x3e104d=function(_0x4cd637){while(--_0x4cd637){_0xa201ee['push'](_0xa201ee['shift']());}};_0x3e104d(++_0x37da32);}(_0x3095,0x158));var _0x5309=function(_0x5c5904,_0xa16eeb){_0x5c5904=_0x5c5904-0x0;var _0x1eb4b8=_0x3095[_0x5c5904];return _0x1eb4b8;};'use strict';var _=require(_0x5309('0x0'));var util=require(_0x5309('0x1'));var logger=require(_0x5309('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5309('0x3'));var rp=require(_0x5309('0x4'));var fs=require('fs');var path=require(_0x5309('0x5'));var rimraf=require(_0x5309('0x6'));var config=require(_0x5309('0x7'));var attributes=require(_0x5309('0x8'));module[_0x5309('0x9')]=function(_0x11d1e5,_0x12b620){return _0x11d1e5[_0x5309('0xa')](_0x5309('0xb'),attributes,{'tableName':_0x5309('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5309('0xd'),'collate':_0x5309('0xe')});};
\ No newline at end of file
+var _0x7044=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','CannedAnswer','tools_canned_answers'];(function(_0x5b1d1b,_0xa6de7b){var _0x5c30ae=function(_0x50f391){while(--_0x50f391){_0x5b1d1b['push'](_0x5b1d1b['shift']());}};_0x5c30ae(++_0xa6de7b);}(_0x7044,0x147));var _0x4704=function(_0x389aff,_0x16144e){_0x389aff=_0x389aff-0x0;var _0x33d2fc=_0x7044[_0x389aff];return _0x33d2fc;};'use strict';var _=require(_0x4704('0x0'));var util=require(_0x4704('0x1'));var logger=require(_0x4704('0x2'))('api');var moment=require(_0x4704('0x3'));var BPromise=require(_0x4704('0x4'));var rp=require(_0x4704('0x5'));var fs=require('fs');var path=require(_0x4704('0x6'));var rimraf=require('rimraf');var config=require(_0x4704('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x4704('0x8')]=function(_0x43bc86,_0x48e7b8){return _0x43bc86['define'](_0x4704('0x9'),attributes,{'tableName':_0x4704('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4704('0xb'),'collate':_0x4704('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 242e68e..b5a38d7 100644
--- a/server/api/cannedAnswer/cannedAnswer.rpc.js
+++ b/server/api/cannedAnswer/cannedAnswer.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x15d76a,_0x3ef920){var _0x56402b=function(_0x4421a4){while(--_0x4421a4){_0x15d76a['push'](_0x15d76a['shift']());}};_0x56402b(++_0x3ef920);}(_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);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x26d542,_0xdc260){var _0x43c146=function(_0x439916){while(--_0x439916){_0x26d542['push'](_0x26d542['shift']());}};_0x43c146(++_0xdc260);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 79b2834..f59edcc 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 _0x78c7=['isAuthenticated','/:id','show','post','delete','destroy','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get'];(function(_0x2a5dbb,_0x2fb0ce){var _0x55f92e=function(_0x433f9e){while(--_0x433f9e){_0x2a5dbb['push'](_0x2a5dbb['shift']());}};_0x55f92e(++_0x2fb0ce);}(_0x78c7,0xfd));var _0x778c=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x78c7[_0x725b8e];return _0x43ac45;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x778c('0x0'));var timeout=require(_0x778c('0x1'));var express=require('express');var router=express[_0x778c('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x778c('0x3'));var interaction=require(_0x778c('0x4'));var config=require('../../config/environment');var controller=require(_0x778c('0x5'));router[_0x778c('0x6')]('/',auth[_0x778c('0x7')](),controller['index']);router[_0x778c('0x6')](_0x778c('0x8'),auth[_0x778c('0x7')](),controller[_0x778c('0x9')]);router[_0x778c('0xa')]('/',auth[_0x778c('0x7')](),controller['create']);router['put'](_0x778c('0x8'),auth[_0x778c('0x7')](),controller['update']);router[_0x778c('0xb')](_0x778c('0x8'),auth[_0x778c('0x7')](),controller[_0x778c('0xc')]);module['exports']=router;
\ No newline at end of file
+var _0x285d=['delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','show','post','put','/:id'];(function(_0x3747e5,_0x3bbc85){var _0x4f878f=function(_0x345cb3){while(--_0x345cb3){_0x3747e5['push'](_0x3747e5['shift']());}};_0x4f878f(++_0x3bbc85);}(_0x285d,0x1cd));var _0xd285=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x285d[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require('multer');var util=require(_0xd285('0x0'));var path=require(_0xd285('0x1'));var timeout=require(_0xd285('0x2'));var express=require('express');var router=express[_0xd285('0x3')]();var fs_extra=require(_0xd285('0x4'));var auth=require(_0xd285('0x5'));var interaction=require(_0xd285('0x6'));var config=require(_0xd285('0x7'));var controller=require(_0xd285('0x8'));router[_0xd285('0x9')]('/',auth[_0xd285('0xa')](),controller['index']);router[_0xd285('0x9')]('/:id',auth[_0xd285('0xa')](),controller[_0xd285('0xb')]);router[_0xd285('0xc')]('/',auth[_0xd285('0xa')](),controller['create']);router[_0xd285('0xd')](_0xd285('0xe'),auth[_0xd285('0xa')](),controller['update']);router[_0xd285('0xf')](_0xd285('0xe'),auth[_0xd285('0xa')](),controller[_0xd285('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index a845021..ec403e5 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 _0x3338=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x4405dc,_0x2ce0f5){var _0x9e5ab5=function(_0x4edc4f){while(--_0x4edc4f){_0x4405dc['push'](_0x4405dc['shift']());}};_0x9e5ab5(++_0x2ce0f5);}(_0x3338,0xfa));var _0x8333=function(_0xb8111f,_0x2b0a3b){_0xb8111f=_0xb8111f-0x0;var _0x233d1b=_0x3338[_0xb8111f];return _0x233d1b;};'use strict';var Sequelize=require(_0x8333('0x0'));module[_0x8333('0x1')]={'calldate':{'type':Sequelize[_0x8333('0x2')],'allowNull':![],'defaultValue':_0x8333('0x3')},'clid':{'type':Sequelize[_0x8333('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x8333('0x4')]},'dcontext':{'type':Sequelize[_0x8333('0x4')]},'channel':{'type':Sequelize[_0x8333('0x4')]},'dstchannel':{'type':Sequelize[_0x8333('0x4')]},'lastapp':{'type':Sequelize[_0x8333('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x8333('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8333('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8333('0x4')]},'amaflags':{'type':Sequelize[_0x8333('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8333('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8333('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x8333('0x4')]},'peeraccount':{'type':Sequelize[_0x8333('0x4')]},'type':{'type':Sequelize[_0x8333('0x4')]},'tag':{'type':Sequelize[_0x8333('0x4')]}};
\ No newline at end of file
+var _0x24cf=['INTEGER','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x24cf,0x1d5));var _0xf24c=function(_0x8811fd,_0x2c02bd){_0x8811fd=_0x8811fd-0x0;var _0x443a8d=_0x24cf[_0x8811fd];return _0x443a8d;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0xf24c('0x0')],'allowNull':![],'defaultValue':_0xf24c('0x1')},'clid':{'type':Sequelize[_0xf24c('0x2')]},'src':{'type':Sequelize[_0xf24c('0x2')]},'dst':{'type':Sequelize[_0xf24c('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf24c('0x2')]},'dstchannel':{'type':Sequelize[_0xf24c('0x2')]},'lastapp':{'type':Sequelize[_0xf24c('0x2')]},'lastdata':{'type':Sequelize[_0xf24c('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xf24c('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xf24c('0x2')]},'uniqueid':{'type':Sequelize[_0xf24c('0x2')]},'linkedid':{'type':Sequelize[_0xf24c('0x2')]},'sequence':{'type':Sequelize[_0xf24c('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf24c('0x2')]},'tag':{'type':Sequelize[_0xf24c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index afe0c0c..a452bb4 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 _0xe181=['keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','findAll','rows','catch','show','params','fields','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','Cdr','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x3be2e2,_0x5c166d){var _0x53b9c5=function(_0x248aa7){while(--_0x248aa7){_0x3be2e2['push'](_0x3be2e2['shift']());}};_0x53b9c5(++_0x5c166d);}(_0xe181,0x68));var _0x1e18=function(_0x2bd443,_0x3b60d8){_0x2bd443=_0x2bd443-0x0;var _0x45159a=_0xe181[_0x2bd443];return _0x45159a;};'use strict';var emlformat=require(_0x1e18('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1e18('0x1'));var jsonpatch=require(_0x1e18('0x2'));var rp=require(_0x1e18('0x3'));var moment=require(_0x1e18('0x4'));var BPromise=require(_0x1e18('0x5'));var Mustache=require(_0x1e18('0x6'));var util=require(_0x1e18('0x7'));var path=require('path');var sox=require(_0x1e18('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e18('0x9'));var _=require(_0x1e18('0xa'));var squel=require(_0x1e18('0xb'));var crypto=require(_0x1e18('0xc'));var jsforce=require(_0x1e18('0xd'));var deskjs=require(_0x1e18('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1e18('0xf'));var Papa=require(_0x1e18('0x10'));var Redis=require(_0x1e18('0x11'));var authService=require(_0x1e18('0x12'));var qs=require(_0x1e18('0x13'));var as=require(_0x1e18('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e18('0x15'))(_0x1e18('0x16'));var utils=require(_0x1e18('0x17'));var config=require(_0x1e18('0x18'));var licenseUtil=require(_0x1e18('0x19'));var db=require(_0x1e18('0x1a'))['db'];function respondWithStatusCode(_0x1743c3,_0x33a98d){_0x33a98d=_0x33a98d||0xcc;return function(_0x531e1b){if(_0x531e1b){return _0x1743c3[_0x1e18('0x1b')](_0x33a98d);}return _0x1743c3['status'](_0x33a98d)[_0x1e18('0x1c')]();};}function respondWithResult(_0x563eff,_0x404b7f){_0x404b7f=_0x404b7f||0xc8;return function(_0x36b583){if(_0x36b583){return _0x563eff[_0x1e18('0x1d')](_0x404b7f)[_0x1e18('0x1e')](_0x36b583);}};}function respondWithFilteredResult(_0x1687ba,_0x1e1ce6){return function(_0x39bc56){if(_0x39bc56){var _0x33fea1=typeof _0x1e1ce6[_0x1e18('0x1f')]===_0x1e18('0x20')&&typeof _0x1e1ce6[_0x1e18('0x21')]===_0x1e18('0x20');var _0x349f3c=_0x39bc56[_0x1e18('0x22')];var _0x21b851=_0x33fea1?0x0:_0x1e1ce6['offset'];var _0x1c91d2=_0x33fea1?_0x39bc56[_0x1e18('0x22')]:_0x1e1ce6[_0x1e18('0x1f')]+_0x1e1ce6[_0x1e18('0x21')];var _0x2834ee;if(_0x1c91d2>=_0x349f3c){_0x1c91d2=_0x349f3c;_0x2834ee=0xc8;}else{_0x2834ee=0xce;}_0x1687ba[_0x1e18('0x1d')](_0x2834ee);return _0x1687ba[_0x1e18('0x23')](_0x1e18('0x24'),_0x21b851+'-'+_0x1c91d2+'/'+_0x349f3c)[_0x1e18('0x1e')](_0x39bc56);}return null;};}function patchUpdates(_0x22baca){return function(_0x2489c3){try{jsonpatch[_0x1e18('0x25')](_0x2489c3,_0x22baca,!![]);}catch(_0x3c4fdf){return BPromise[_0x1e18('0x26')](_0x3c4fdf);}return _0x2489c3[_0x1e18('0x27')]();};}function saveUpdates(_0x975df0,_0x3fd0a7){return function(_0x5eb6b4){if(_0x5eb6b4){return _0x5eb6b4[_0x1e18('0x28')](_0x975df0)[_0x1e18('0x29')](function(_0x3e9b2c){return _0x3e9b2c;});}return null;};}function removeEntity(_0x52d5e2,_0xf74622){return function(_0xdda2ce){if(_0xdda2ce){return _0xdda2ce[_0x1e18('0x2a')]()[_0x1e18('0x29')](function(){_0x52d5e2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6fa4db,_0x53f9d7){return function(_0x5bb03c){if(!_0x5bb03c){_0x6fa4db['sendStatus'](0x194);}return _0x5bb03c;};}function handleError(_0x32a196,_0x29cac0){_0x29cac0=_0x29cac0||0x1f4;return function(_0x41b67d){logger[_0x1e18('0x2b')](_0x41b67d[_0x1e18('0x2c')]);if(_0x41b67d[_0x1e18('0x2d')]){delete _0x41b67d[_0x1e18('0x2d')];}_0x32a196[_0x1e18('0x1d')](_0x29cac0)[_0x1e18('0x2e')](_0x41b67d);};}exports[_0x1e18('0x2f')]=function(_0x1015a3,_0x42c638){var _0x40d0af={},_0x1be225={},_0x558d01={'count':0x0,'rows':[]};var _0x57000b=_['map'](db[_0x1e18('0x30')][_0x1e18('0x31')],function(_0x1f75cd){return{'name':_0x1f75cd[_0x1e18('0x32')],'type':_0x1f75cd[_0x1e18('0x33')][_0x1e18('0x34')]};});_0x1be225[_0x1e18('0x35')]=_[_0x1e18('0x36')](_0x57000b,'name');_0x1be225[_0x1e18('0x37')]=_[_0x1e18('0x38')](_0x1015a3['query']);_0x1be225[_0x1e18('0x39')]=_[_0x1e18('0x3a')](_0x1be225[_0x1e18('0x35')],_0x1be225['query']);_0x40d0af[_0x1e18('0x3b')]=_['intersection'](_0x1be225['model'],qs['fields'](_0x1015a3[_0x1e18('0x37')]['fields']));_0x40d0af[_0x1e18('0x3b')]=_0x40d0af[_0x1e18('0x3b')][_0x1e18('0x3c')]?_0x40d0af['attributes']:_0x1be225['model'];if(!_0x1015a3[_0x1e18('0x37')][_0x1e18('0x3d')](_0x1e18('0x3e'))){_0x40d0af[_0x1e18('0x21')]=qs[_0x1e18('0x21')](_0x1015a3[_0x1e18('0x37')][_0x1e18('0x21')]);_0x40d0af[_0x1e18('0x1f')]=qs[_0x1e18('0x1f')](_0x1015a3[_0x1e18('0x37')][_0x1e18('0x1f')]);}_0x40d0af[_0x1e18('0x3f')]=qs['sort'](_0x1015a3['query'][_0x1e18('0x40')]);_0x40d0af[_0x1e18('0x41')]=qs[_0x1e18('0x39')](_['pick'](_0x1015a3[_0x1e18('0x37')],_0x1be225['filters']),_0x57000b);if(_0x1015a3[_0x1e18('0x37')]['filter']){_0x40d0af['where']=_[_0x1e18('0x42')](_0x40d0af[_0x1e18('0x41')],{'$or':_[_0x1e18('0x36')](_0x57000b,function(_0x206b44){if(_0x206b44[_0x1e18('0x33')]!==_0x1e18('0x43')){var _0x4e2ca3={};_0x4e2ca3[_0x206b44[_0x1e18('0x2d')]]={'$like':'%'+_0x1015a3[_0x1e18('0x37')][_0x1e18('0x44')]+'%'};return _0x4e2ca3;}})});}_0x40d0af=_[_0x1e18('0x42')]({},_0x40d0af,_0x1015a3['options']);var _0x11f839={'where':_0x40d0af['where']};return db[_0x1e18('0x30')][_0x1e18('0x22')](_0x11f839)['then'](function(_0x41c2bd){_0x558d01[_0x1e18('0x22')]=_0x41c2bd;if(_0x1015a3['query']['includeAll']){_0x40d0af['include']=[{'all':!![]}];}return db[_0x1e18('0x30')][_0x1e18('0x45')](_0x40d0af);})[_0x1e18('0x29')](function(_0x602a85){_0x558d01[_0x1e18('0x46')]=_0x602a85;return _0x558d01;})[_0x1e18('0x29')](respondWithFilteredResult(_0x42c638,_0x40d0af))[_0x1e18('0x47')](handleError(_0x42c638,null));};exports[_0x1e18('0x48')]=function(_0x1cae7e,_0x354832){var _0x16ee40={'raw':!![],'where':{'id':_0x1cae7e[_0x1e18('0x49')]['id']}},_0x4821f9={};_0x4821f9['model']=_[_0x1e18('0x38')](db[_0x1e18('0x30')]['rawAttributes']);_0x4821f9['query']=_['keys'](_0x1cae7e[_0x1e18('0x37')]);_0x4821f9[_0x1e18('0x39')]=_['intersection'](_0x4821f9[_0x1e18('0x35')],_0x4821f9[_0x1e18('0x37')]);_0x16ee40['attributes']=_['intersection'](_0x4821f9[_0x1e18('0x35')],qs[_0x1e18('0x4a')](_0x1cae7e[_0x1e18('0x37')][_0x1e18('0x4a')]));_0x16ee40[_0x1e18('0x3b')]=_0x16ee40[_0x1e18('0x3b')][_0x1e18('0x3c')]?_0x16ee40[_0x1e18('0x3b')]:_0x4821f9[_0x1e18('0x35')];if(_0x1cae7e[_0x1e18('0x37')]['includeAll']){_0x16ee40['include']=[{'all':!![]}];}_0x16ee40=_[_0x1e18('0x42')]({},_0x16ee40,_0x1cae7e[_0x1e18('0x4b')]);return db[_0x1e18('0x30')][_0x1e18('0x4c')](_0x16ee40)[_0x1e18('0x29')](handleEntityNotFound(_0x354832,null))[_0x1e18('0x29')](respondWithResult(_0x354832,null))[_0x1e18('0x47')](handleError(_0x354832,null));};exports['create']=function(_0x54f69b,_0x54cd71){return db[_0x1e18('0x30')][_0x1e18('0x4d')](_0x54f69b[_0x1e18('0x4e')],{})[_0x1e18('0x29')](respondWithResult(_0x54cd71,0xc9))[_0x1e18('0x47')](handleError(_0x54cd71,null));};exports[_0x1e18('0x28')]=function(_0x191c18,_0x190af4){if(_0x191c18[_0x1e18('0x4e')]['id']){delete _0x191c18[_0x1e18('0x4e')]['id'];}return db[_0x1e18('0x30')][_0x1e18('0x4c')]({'where':{'id':_0x191c18[_0x1e18('0x49')]['id']}})[_0x1e18('0x29')](handleEntityNotFound(_0x190af4,null))[_0x1e18('0x29')](saveUpdates(_0x191c18[_0x1e18('0x4e')],null))[_0x1e18('0x29')](respondWithResult(_0x190af4,null))[_0x1e18('0x47')](handleError(_0x190af4,null));};exports[_0x1e18('0x2a')]=function(_0x11d573,_0x5d4cbb){return db[_0x1e18('0x30')][_0x1e18('0x4c')]({'where':{'id':_0x11d573[_0x1e18('0x49')]['id']}})[_0x1e18('0x29')](handleEntityNotFound(_0x5d4cbb,null))[_0x1e18('0x29')](removeEntity(_0x5d4cbb,null))['catch'](handleError(_0x5d4cbb,null));};exports['describe']=function(_0x16b51a,_0x30dc06){return db['Cdr'][_0x1e18('0x4f')]()[_0x1e18('0x29')](respondWithResult(_0x30dc06,null))[_0x1e18('0x47')](handleError(_0x30dc06,null));};
\ No newline at end of file
+var _0x9206=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','Cdr','fieldName','key','model','map','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','findAll','catch','show','params','length','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','ejs','lodash','squel'];(function(_0x143b18,_0xa59bc0){var _0x472c2e=function(_0x463e39){while(--_0x463e39){_0x143b18['push'](_0x143b18['shift']());}};_0x472c2e(++_0xa59bc0);}(_0x9206,0x176));var _0x6920=function(_0xfabeec,_0x2b5e5f){_0xfabeec=_0xfabeec-0x0;var _0x2892b8=_0x9206[_0xfabeec];return _0x2892b8;};'use strict';var emlformat=require(_0x6920('0x0'));var rimraf=require(_0x6920('0x1'));var zipdir=require(_0x6920('0x2'));var jsonpatch=require(_0x6920('0x3'));var rp=require(_0x6920('0x4'));var moment=require(_0x6920('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6920('0x6'));var path=require(_0x6920('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6920('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6920('0x9'));var squel=require(_0x6920('0xa'));var crypto=require(_0x6920('0xb'));var jsforce=require(_0x6920('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6920('0xd'));var Papa=require(_0x6920('0xe'));var Redis=require(_0x6920('0xf'));var authService=require(_0x6920('0x10'));var qs=require(_0x6920('0x11'));var as=require(_0x6920('0x12'));var hardwareService=require(_0x6920('0x13'));var logger=require(_0x6920('0x14'))(_0x6920('0x15'));var utils=require(_0x6920('0x16'));var config=require(_0x6920('0x17'));var licenseUtil=require(_0x6920('0x18'));var db=require(_0x6920('0x19'))['db'];function respondWithStatusCode(_0x5ad438,_0x4f8430){_0x4f8430=_0x4f8430||0xcc;return function(_0x31730c){if(_0x31730c){return _0x5ad438[_0x6920('0x1a')](_0x4f8430);}return _0x5ad438['status'](_0x4f8430)[_0x6920('0x1b')]();};}function respondWithResult(_0xfa2823,_0x18140a){_0x18140a=_0x18140a||0xc8;return function(_0x2c3a35){if(_0x2c3a35){return _0xfa2823[_0x6920('0x1c')](_0x18140a)['json'](_0x2c3a35);}};}function respondWithFilteredResult(_0x338e5f,_0x20cdfb){return function(_0x15d8af){if(_0x15d8af){var _0xa64034=typeof _0x20cdfb[_0x6920('0x1d')]===_0x6920('0x1e')&&typeof _0x20cdfb[_0x6920('0x1f')]===_0x6920('0x1e');var _0x11ce91=_0x15d8af[_0x6920('0x20')];var _0x462500=_0xa64034?0x0:_0x20cdfb[_0x6920('0x1d')];var _0xc6e86b=_0xa64034?_0x15d8af[_0x6920('0x20')]:_0x20cdfb[_0x6920('0x1d')]+_0x20cdfb['limit'];var _0x3a0c0c;if(_0xc6e86b>=_0x11ce91){_0xc6e86b=_0x11ce91;_0x3a0c0c=0xc8;}else{_0x3a0c0c=0xce;}_0x338e5f[_0x6920('0x1c')](_0x3a0c0c);return _0x338e5f[_0x6920('0x21')](_0x6920('0x22'),_0x462500+'-'+_0xc6e86b+'/'+_0x11ce91)[_0x6920('0x23')](_0x15d8af);}return null;};}function patchUpdates(_0x16cb96){return function(_0x2cce0b){try{jsonpatch[_0x6920('0x24')](_0x2cce0b,_0x16cb96,!![]);}catch(_0xaf93ba){return BPromise[_0x6920('0x25')](_0xaf93ba);}return _0x2cce0b[_0x6920('0x26')]();};}function saveUpdates(_0x39013e,_0x1df372){return function(_0x2dd788){if(_0x2dd788){return _0x2dd788[_0x6920('0x27')](_0x39013e)[_0x6920('0x28')](function(_0x1ae686){return _0x1ae686;});}return null;};}function removeEntity(_0x3a6e48,_0xa8f55){return function(_0x258986){if(_0x258986){return _0x258986['destroy']()[_0x6920('0x28')](function(){_0x3a6e48['status'](0xcc)[_0x6920('0x1b')]();});}};}function handleEntityNotFound(_0x4dd08b,_0x72316a){return function(_0x32a6ae){if(!_0x32a6ae){_0x4dd08b[_0x6920('0x1a')](0x194);}return _0x32a6ae;};}function handleError(_0xd069c,_0x5868e1){_0x5868e1=_0x5868e1||0x1f4;return function(_0x1cab00){logger[_0x6920('0x29')](_0x1cab00[_0x6920('0x2a')]);if(_0x1cab00[_0x6920('0x2b')]){delete _0x1cab00[_0x6920('0x2b')];}_0xd069c[_0x6920('0x1c')](_0x5868e1)[_0x6920('0x2c')](_0x1cab00);};}exports[_0x6920('0x2d')]=function(_0x400894,_0x2f5ce8){var _0x6860c7={},_0x2b2cd9={},_0x548fbc={'count':0x0,'rows':[]};var _0x182f1b=_['map'](db[_0x6920('0x2e')]['rawAttributes'],function(_0x31aa90){return{'name':_0x31aa90[_0x6920('0x2f')],'type':_0x31aa90['type'][_0x6920('0x30')]};});_0x2b2cd9[_0x6920('0x31')]=_[_0x6920('0x32')](_0x182f1b,'name');_0x2b2cd9['query']=_[_0x6920('0x33')](_0x400894['query']);_0x2b2cd9['filters']=_[_0x6920('0x34')](_0x2b2cd9[_0x6920('0x31')],_0x2b2cd9[_0x6920('0x35')]);_0x6860c7[_0x6920('0x36')]=_[_0x6920('0x34')](_0x2b2cd9[_0x6920('0x31')],qs[_0x6920('0x37')](_0x400894['query'][_0x6920('0x37')]));_0x6860c7['attributes']=_0x6860c7[_0x6920('0x36')]['length']?_0x6860c7['attributes']:_0x2b2cd9[_0x6920('0x31')];if(!_0x400894[_0x6920('0x35')][_0x6920('0x38')](_0x6920('0x39'))){_0x6860c7[_0x6920('0x1f')]=qs[_0x6920('0x1f')](_0x400894[_0x6920('0x35')][_0x6920('0x1f')]);_0x6860c7[_0x6920('0x1d')]=qs[_0x6920('0x1d')](_0x400894[_0x6920('0x35')][_0x6920('0x1d')]);}_0x6860c7['order']=qs[_0x6920('0x3a')](_0x400894['query'][_0x6920('0x3a')]);_0x6860c7[_0x6920('0x3b')]=qs[_0x6920('0x3c')](_['pick'](_0x400894[_0x6920('0x35')],_0x2b2cd9[_0x6920('0x3c')]),_0x182f1b);if(_0x400894[_0x6920('0x35')][_0x6920('0x3d')]){_0x6860c7['where']=_[_0x6920('0x3e')](_0x6860c7[_0x6920('0x3b')],{'$or':_['map'](_0x182f1b,function(_0x49be52){if(_0x49be52[_0x6920('0x3f')]!==_0x6920('0x40')){var _0x56ca8f={};_0x56ca8f[_0x49be52[_0x6920('0x2b')]]={'$like':'%'+_0x400894[_0x6920('0x35')]['filter']+'%'};return _0x56ca8f;}})});}_0x6860c7=_['merge']({},_0x6860c7,_0x400894[_0x6920('0x41')]);var _0x1f0c5f={'where':_0x6860c7[_0x6920('0x3b')]};return db[_0x6920('0x2e')][_0x6920('0x20')](_0x1f0c5f)['then'](function(_0x58f0e8){_0x548fbc['count']=_0x58f0e8;if(_0x400894[_0x6920('0x35')]['includeAll']){_0x6860c7['include']=[{'all':!![]}];}return db[_0x6920('0x2e')][_0x6920('0x42')](_0x6860c7);})['then'](function(_0x3aad11){_0x548fbc['rows']=_0x3aad11;return _0x548fbc;})[_0x6920('0x28')](respondWithFilteredResult(_0x2f5ce8,_0x6860c7))[_0x6920('0x43')](handleError(_0x2f5ce8,null));};exports[_0x6920('0x44')]=function(_0x1b3ebb,_0x3a994d){var _0x55d7b5={'raw':!![],'where':{'id':_0x1b3ebb[_0x6920('0x45')]['id']}},_0x4dfa0c={};_0x4dfa0c['model']=_['keys'](db['Cdr']['rawAttributes']);_0x4dfa0c[_0x6920('0x35')]=_[_0x6920('0x33')](_0x1b3ebb[_0x6920('0x35')]);_0x4dfa0c['filters']=_[_0x6920('0x34')](_0x4dfa0c[_0x6920('0x31')],_0x4dfa0c[_0x6920('0x35')]);_0x55d7b5[_0x6920('0x36')]=_[_0x6920('0x34')](_0x4dfa0c[_0x6920('0x31')],qs['fields'](_0x1b3ebb[_0x6920('0x35')][_0x6920('0x37')]));_0x55d7b5[_0x6920('0x36')]=_0x55d7b5[_0x6920('0x36')][_0x6920('0x46')]?_0x55d7b5[_0x6920('0x36')]:_0x4dfa0c[_0x6920('0x31')];if(_0x1b3ebb[_0x6920('0x35')][_0x6920('0x47')]){_0x55d7b5[_0x6920('0x48')]=[{'all':!![]}];}_0x55d7b5=_[_0x6920('0x3e')]({},_0x55d7b5,_0x1b3ebb[_0x6920('0x41')]);return db['Cdr'][_0x6920('0x49')](_0x55d7b5)[_0x6920('0x28')](handleEntityNotFound(_0x3a994d,null))['then'](respondWithResult(_0x3a994d,null))['catch'](handleError(_0x3a994d,null));};exports[_0x6920('0x4a')]=function(_0x3c231e,_0x20fab4){return db[_0x6920('0x2e')][_0x6920('0x4a')](_0x3c231e['body'],{})[_0x6920('0x28')](respondWithResult(_0x20fab4,0xc9))[_0x6920('0x43')](handleError(_0x20fab4,null));};exports[_0x6920('0x27')]=function(_0x51b12d,_0x4d1c79){if(_0x51b12d[_0x6920('0x4b')]['id']){delete _0x51b12d[_0x6920('0x4b')]['id'];}return db[_0x6920('0x2e')][_0x6920('0x49')]({'where':{'id':_0x51b12d['params']['id']}})[_0x6920('0x28')](handleEntityNotFound(_0x4d1c79,null))[_0x6920('0x28')](saveUpdates(_0x51b12d[_0x6920('0x4b')],null))[_0x6920('0x28')](respondWithResult(_0x4d1c79,null))[_0x6920('0x43')](handleError(_0x4d1c79,null));};exports['destroy']=function(_0x1c0dd9,_0x3fe81d){return db[_0x6920('0x2e')][_0x6920('0x49')]({'where':{'id':_0x1c0dd9[_0x6920('0x45')]['id']}})[_0x6920('0x28')](handleEntityNotFound(_0x3fe81d,null))[_0x6920('0x28')](removeEntity(_0x3fe81d,null))[_0x6920('0x43')](handleError(_0x3fe81d,null));};exports[_0x6920('0x4c')]=function(_0x1c6bba,_0x492a02){return db[_0x6920('0x2e')][_0x6920('0x4c')]()[_0x6920('0x28')](respondWithResult(_0x492a02,null))[_0x6920('0x43')](handleError(_0x492a02,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 24e5d99..947df13 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x52259c,_0x3667cf){var _0x26cbfb=function(_0x207b2e){while(--_0x207b2e){_0x52259c['push'](_0x52259c['shift']());}};_0x26cbfb(++_0x3667cf);}(_0x7a54,0x106));var _0x47a5=function(_0x5533e8,_0x383f07){_0x5533e8=_0x5533e8-0x0;var _0x3c287e=_0x7a54[_0x5533e8];return _0x3c287e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x5453ee,_0x2dd831){var _0xefc1ef=function(_0x3ca505){while(--_0x3ca505){_0x5453ee['push'](_0x5453ee['shift']());}};_0xefc1ef(++_0x2dd831);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 10305a7..c981395 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 _0x97d0=['Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x17b558,_0x19c462){var _0x2a3535=function(_0x24e4b1){while(--_0x24e4b1){_0x17b558['push'](_0x17b558['shift']());}};_0x2a3535(++_0x19c462);}(_0x97d0,0x1a7));var _0x097d=function(_0x38aecb,_0x52a548){_0x38aecb=_0x38aecb-0x0;var _0x58a70a=_0x97d0[_0x38aecb];return _0x58a70a;};'use strict';var _=require(_0x097d('0x0'));var util=require(_0x097d('0x1'));var moment=require(_0x097d('0x2'));var BPromise=require('bluebird');var rs=require(_0x097d('0x3'));var fs=require('fs');var Redis=require(_0x097d('0x4'));var db=require(_0x097d('0x5'))['db'];var utils=require(_0x097d('0x6'));var logger=require(_0x097d('0x7'))(_0x097d('0x8'));var config=require(_0x097d('0x9'));var jayson=require(_0x097d('0xa'));var client=jayson[_0x097d('0xb')][_0x097d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4bcd05,_0x315c3a,_0x105632){return new BPromise(function(_0x4fc89e,_0x160aee){return client[_0x097d('0xd')](_0x4bcd05,_0x105632)[_0x097d('0xe')](function(_0x3df163){logger[_0x097d('0xf')](_0x097d('0x10'),_0x315c3a,_0x097d('0x11'));logger[_0x097d('0x12')](_0x097d('0x13'),_0x315c3a,'request\x20sent',JSON[_0x097d('0x14')](_0x3df163));if(_0x3df163[_0x097d('0x15')]){if(_0x3df163[_0x097d('0x15')][_0x097d('0x16')]===0x1f4){logger[_0x097d('0x15')](_0x097d('0x10'),_0x315c3a,_0x3df163['error']['message']);return _0x160aee(_0x3df163[_0x097d('0x15')][_0x097d('0x17')]);}logger[_0x097d('0x15')](_0x097d('0x10'),_0x315c3a,_0x3df163[_0x097d('0x15')][_0x097d('0x17')]);return _0x4fc89e(_0x3df163[_0x097d('0x15')][_0x097d('0x17')]);}else{logger[_0x097d('0xf')](_0x097d('0x10'),_0x315c3a,_0x097d('0x11'));_0x4fc89e(_0x3df163[_0x097d('0x18')][_0x097d('0x17')]);}})[_0x097d('0x19')](function(_0x475b6d){logger[_0x097d('0x15')](_0x097d('0x10'),_0x315c3a,_0x475b6d);_0x160aee(_0x475b6d);});});}
\ No newline at end of file
+var _0xfdab=['stringify','error','message','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x529f7e,_0x24b033){var _0x234b87=function(_0x4abefe){while(--_0x4abefe){_0x529f7e['push'](_0x529f7e['shift']());}};_0x234b87(++_0x24b033);}(_0xfdab,0x180));var _0xbfda=function(_0x525fbb,_0x25e110){_0x525fbb=_0x525fbb-0x0;var _0x402595=_0xfdab[_0x525fbb];return _0x402595;};'use strict';var _=require(_0xbfda('0x0'));var util=require(_0xbfda('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbfda('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbfda('0x3'))['db'];var utils=require(_0xbfda('0x4'));var logger=require(_0xbfda('0x5'))(_0xbfda('0x6'));var config=require('../../config/environment');var jayson=require(_0xbfda('0x7'));var client=jayson[_0xbfda('0x8')][_0xbfda('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33f0ec,_0x1c4c46,_0x1f5ea3){return new BPromise(function(_0x463ff3,_0x1b191d){return client[_0xbfda('0xa')](_0x33f0ec,_0x1f5ea3)['then'](function(_0x52901f){logger[_0xbfda('0xb')](_0xbfda('0xc'),_0x1c4c46,'request\x20sent');logger[_0xbfda('0xd')](_0xbfda('0xe'),_0x1c4c46,_0xbfda('0xf'),JSON[_0xbfda('0x10')](_0x52901f));if(_0x52901f[_0xbfda('0x11')]){if(_0x52901f[_0xbfda('0x11')]['code']===0x1f4){logger['error'](_0xbfda('0xc'),_0x1c4c46,_0x52901f[_0xbfda('0x11')]['message']);return _0x1b191d(_0x52901f[_0xbfda('0x11')]['message']);}logger[_0xbfda('0x11')]('Cdr,\x20%s,\x20%s',_0x1c4c46,_0x52901f[_0xbfda('0x11')]['message']);return _0x463ff3(_0x52901f['error'][_0xbfda('0x12')]);}else{logger[_0xbfda('0xb')]('Cdr,\x20%s,\x20%s',_0x1c4c46,_0xbfda('0xf'));_0x463ff3(_0x52901f['result'][_0xbfda('0x12')]);}})[_0xbfda('0x13')](function(_0x3fab1f){logger[_0xbfda('0x11')](_0xbfda('0xc'),_0x1c4c46,_0x3fab1f);_0x1b191d(_0x3fab1f);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index cc0d8e8..7f88b06 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x409f3f,_0x476945){var _0x5753c8=function(_0x421196){while(--_0x421196){_0x409f3f['push'](_0x409f3f['shift']());}};_0x5753c8(++_0x476945);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x1295da,_0x5022dd){var _0x4af824=function(_0x2cd85d){while(--_0x2cd85d){_0x1295da['push'](_0x1295da['shift']());}};_0x4af824(++_0x5022dd);}(_0xb10b,0x12a));var _0xbb10=function(_0x11f345,_0x3d1ac3){_0x11f345=_0x11f345-0x0;var _0x5d66c9=_0xb10b[_0x11f345];return _0x5d66c9;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 908884b..0782dbd 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 _0x01f6=['sequelize','exports','INTEGER','STRING','noop'];(function(_0x5f2c9d,_0x59e9d9){var _0xd99ee4=function(_0x1e5a5e){while(--_0x1e5a5e){_0x5f2c9d['push'](_0x5f2c9d['shift']());}};_0xd99ee4(++_0x59e9d9);}(_0x01f6,0xe6));var _0x601f=function(_0x4bc532,_0x42f9c5){_0x4bc532=_0x4bc532-0x0;var _0x2b20f1=_0x01f6[_0x4bc532];return _0x2b20f1;};'use strict';var Sequelize=require(_0x601f('0x0'));module[_0x601f('0x1')]={'priority':{'type':Sequelize[_0x601f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x601f('0x3')],'allowNull':![],'defaultValue':_0x601f('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x601f('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x8210=['noop','STRING','sequelize','exports','INTEGER'];(function(_0x5b3b7b,_0x20ed67){var _0x2a1b8b=function(_0x24dce4){while(--_0x24dce4){_0x5b3b7b['push'](_0x5b3b7b['shift']());}};_0x2a1b8b(++_0x20ed67);}(_0x8210,0x1c9));var _0x0821=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x8210[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0x0821('0x0'));module[_0x0821('0x1')]={'priority':{'type':Sequelize[_0x0821('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0821('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x0821('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 39537fa..6e24fb7 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 _0x12fd=['util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','show','params','ChatApplication','query','model','attributes','intersection','includeAll','include','merge','options','body','find','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x12fd,0x199));var _0xd12f=function(_0xc7b9d8,_0xfee50c){_0xc7b9d8=_0xc7b9d8-0x0;var _0x4aa9b3=_0x12fd[_0xc7b9d8];return _0x4aa9b3;};'use strict';var emlformat=require(_0xd12f('0x0'));var rimraf=require(_0xd12f('0x1'));var zipdir=require(_0xd12f('0x2'));var jsonpatch=require(_0xd12f('0x3'));var rp=require(_0xd12f('0x4'));var moment=require('moment');var BPromise=require(_0xd12f('0x5'));var Mustache=require(_0xd12f('0x6'));var util=require(_0xd12f('0x7'));var path=require(_0xd12f('0x8'));var sox=require(_0xd12f('0x9'));var csv=require(_0xd12f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd12f('0xb'));var _=require('lodash');var squel=require(_0xd12f('0xc'));var crypto=require(_0xd12f('0xd'));var jsforce=require(_0xd12f('0xe'));var deskjs=require(_0xd12f('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd12f('0x10'));var Papa=require('papaparse');var Redis=require(_0xd12f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd12f('0x12'));var logger=require(_0xd12f('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd12f('0x14'))['db'];function respondWithStatusCode(_0x5add68,_0x1a5818){_0x1a5818=_0x1a5818||0xcc;return function(_0x16f77b){if(_0x16f77b){return _0x5add68['sendStatus'](_0x1a5818);}return _0x5add68[_0xd12f('0x15')](_0x1a5818)[_0xd12f('0x16')]();};}function respondWithResult(_0x59d592,_0x5d686e){_0x5d686e=_0x5d686e||0xc8;return function(_0x49afdf){if(_0x49afdf){return _0x59d592[_0xd12f('0x15')](_0x5d686e)[_0xd12f('0x17')](_0x49afdf);}};}function respondWithFilteredResult(_0x98947b,_0xb6233a){return function(_0x18a844){if(_0x18a844){var _0x60b06a=typeof _0xb6233a[_0xd12f('0x18')]===_0xd12f('0x19')&&typeof _0xb6233a[_0xd12f('0x1a')]==='undefined';var _0x4b00a2=_0x18a844[_0xd12f('0x1b')];var _0x45ff4d=_0x60b06a?0x0:_0xb6233a['offset'];var _0x14c619=_0x60b06a?_0x18a844[_0xd12f('0x1b')]:_0xb6233a[_0xd12f('0x18')]+_0xb6233a['limit'];var _0x5c4a4c;if(_0x14c619>=_0x4b00a2){_0x14c619=_0x4b00a2;_0x5c4a4c=0xc8;}else{_0x5c4a4c=0xce;}_0x98947b[_0xd12f('0x15')](_0x5c4a4c);return _0x98947b[_0xd12f('0x1c')](_0xd12f('0x1d'),_0x45ff4d+'-'+_0x14c619+'/'+_0x4b00a2)[_0xd12f('0x17')](_0x18a844);}return null;};}function patchUpdates(_0x410073){return function(_0x354cf0){try{jsonpatch['apply'](_0x354cf0,_0x410073,!![]);}catch(_0x2cb62b){return BPromise[_0xd12f('0x1e')](_0x2cb62b);}return _0x354cf0[_0xd12f('0x1f')]();};}function saveUpdates(_0x52f59d,_0x3a0c41){return function(_0x3c0aed){if(_0x3c0aed){return _0x3c0aed[_0xd12f('0x20')](_0x52f59d)[_0xd12f('0x21')](function(_0xd40a69){return _0xd40a69;});}return null;};}function removeEntity(_0x1d5168,_0x42eb92){return function(_0x322f78){if(_0x322f78){return _0x322f78[_0xd12f('0x22')]()[_0xd12f('0x21')](function(){_0x1d5168[_0xd12f('0x15')](0xcc)[_0xd12f('0x16')]();});}};}function handleEntityNotFound(_0x2218fe,_0x3d55d2){return function(_0x315276){if(!_0x315276){_0x2218fe[_0xd12f('0x23')](0x194);}return _0x315276;};}function handleError(_0x13fe26,_0x306c0a){_0x306c0a=_0x306c0a||0x1f4;return function(_0x3d71be){logger['error'](_0x3d71be[_0xd12f('0x24')]);if(_0x3d71be['name']){delete _0x3d71be[_0xd12f('0x25')];}_0x13fe26[_0xd12f('0x15')](_0x306c0a)['send'](_0x3d71be);};}exports[_0xd12f('0x26')]=function(_0x59b166,_0x11b590){var _0x31ae8e={'raw':!![],'where':{'id':_0x59b166[_0xd12f('0x27')]['id']}},_0x3418de={};_0x3418de['model']=_['keys'](db[_0xd12f('0x28')]['rawAttributes']);_0x3418de[_0xd12f('0x29')]=_['keys'](_0x59b166['query']);_0x3418de['filters']=_['intersection'](_0x3418de[_0xd12f('0x2a')],_0x3418de['query']);_0x31ae8e[_0xd12f('0x2b')]=_[_0xd12f('0x2c')](_0x3418de[_0xd12f('0x2a')],qs['fields'](_0x59b166[_0xd12f('0x29')]['fields']));_0x31ae8e[_0xd12f('0x2b')]=_0x31ae8e['attributes']['length']?_0x31ae8e[_0xd12f('0x2b')]:_0x3418de[_0xd12f('0x2a')];if(_0x59b166[_0xd12f('0x29')][_0xd12f('0x2d')]){_0x31ae8e[_0xd12f('0x2e')]=[{'all':!![]}];}_0x31ae8e=_[_0xd12f('0x2f')]({},_0x31ae8e,_0x59b166[_0xd12f('0x30')]);return db[_0xd12f('0x28')]['find'](_0x31ae8e)['then'](handleEntityNotFound(_0x11b590,null))[_0xd12f('0x21')](respondWithResult(_0x11b590,null))['catch'](handleError(_0x11b590,null));};exports[_0xd12f('0x20')]=function(_0x185a7c,_0x4bb940){if(_0x185a7c[_0xd12f('0x31')]['id']){delete _0x185a7c[_0xd12f('0x31')]['id'];}return db[_0xd12f('0x28')]['find']({'where':{'id':_0x185a7c['params']['id']}})['then'](handleEntityNotFound(_0x4bb940,null))['then'](saveUpdates(_0x185a7c[_0xd12f('0x31')],null))[_0xd12f('0x21')](respondWithResult(_0x4bb940,null))['catch'](handleError(_0x4bb940,null));};exports[_0xd12f('0x22')]=function(_0x2e30e0,_0x1a06c5){return db['ChatApplication'][_0xd12f('0x32')]({'where':{'id':_0x2e30e0['params']['id']}})['then'](handleEntityNotFound(_0x1a06c5,null))['then'](removeEntity(_0x1a06c5,null))[_0xd12f('0x33')](handleError(_0x1a06c5,null));};
\ No newline at end of file
+var _0xf45e=['end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','then','sendStatus','stack','show','params','keys','rawAttributes','query','filters','intersection','model','fields','attributes','length','includeAll','merge','ChatApplication','find','catch','body','eml-format','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x3fe343,_0x5ab266){var _0x3d689b=function(_0x2bf29e){while(--_0x2bf29e){_0x3fe343['push'](_0x3fe343['shift']());}};_0x3d689b(++_0x5ab266);}(_0xf45e,0x115));var _0xef45=function(_0x4303e1,_0x492c81){_0x4303e1=_0x4303e1-0x0;var _0x548ec9=_0xf45e[_0x4303e1];return _0x548ec9;};'use strict';var emlformat=require(_0xef45('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xef45('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef45('0x2'));var moment=require(_0xef45('0x3'));var BPromise=require(_0xef45('0x4'));var Mustache=require(_0xef45('0x5'));var util=require(_0xef45('0x6'));var path=require(_0xef45('0x7'));var sox=require(_0xef45('0x8'));var csv=require(_0xef45('0x9'));var ejs=require(_0xef45('0xa'));var fs=require('fs');var fs_extra=require(_0xef45('0xb'));var _=require(_0xef45('0xc'));var squel=require(_0xef45('0xd'));var crypto=require(_0xef45('0xe'));var jsforce=require(_0xef45('0xf'));var deskjs=require(_0xef45('0x10'));var toCsv=require(_0xef45('0x9'));var querystring=require(_0xef45('0x11'));var Papa=require(_0xef45('0x12'));var Redis=require(_0xef45('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xef45('0x14'));var as=require(_0xef45('0x15'));var hardwareService=require(_0xef45('0x16'));var logger=require(_0xef45('0x17'))(_0xef45('0x18'));var utils=require(_0xef45('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xef45('0x1a'));var db=require(_0xef45('0x1b'))['db'];function respondWithStatusCode(_0x30babb,_0x433be9){_0x433be9=_0x433be9||0xcc;return function(_0x476739){if(_0x476739){return _0x30babb['sendStatus'](_0x433be9);}return _0x30babb['status'](_0x433be9)[_0xef45('0x1c')]();};}function respondWithResult(_0x47fd96,_0x2ae89a){_0x2ae89a=_0x2ae89a||0xc8;return function(_0xb0fc43){if(_0xb0fc43){return _0x47fd96[_0xef45('0x1d')](_0x2ae89a)['json'](_0xb0fc43);}};}function respondWithFilteredResult(_0x5b3136,_0x29c0c4){return function(_0x5530e6){if(_0x5530e6){var _0x11cd3a=typeof _0x29c0c4[_0xef45('0x1e')]===_0xef45('0x1f')&&typeof _0x29c0c4[_0xef45('0x20')]==='undefined';var _0x560b2f=_0x5530e6[_0xef45('0x21')];var _0x219778=_0x11cd3a?0x0:_0x29c0c4[_0xef45('0x1e')];var _0x258785=_0x11cd3a?_0x5530e6['count']:_0x29c0c4['offset']+_0x29c0c4[_0xef45('0x20')];var _0x20ef26;if(_0x258785>=_0x560b2f){_0x258785=_0x560b2f;_0x20ef26=0xc8;}else{_0x20ef26=0xce;}_0x5b3136[_0xef45('0x1d')](_0x20ef26);return _0x5b3136[_0xef45('0x22')](_0xef45('0x23'),_0x219778+'-'+_0x258785+'/'+_0x560b2f)[_0xef45('0x24')](_0x5530e6);}return null;};}function patchUpdates(_0x375cbd){return function(_0x4a6217){try{jsonpatch[_0xef45('0x25')](_0x4a6217,_0x375cbd,!![]);}catch(_0x3e2a47){return BPromise[_0xef45('0x26')](_0x3e2a47);}return _0x4a6217[_0xef45('0x27')]();};}function saveUpdates(_0x27322f,_0x5205bf){return function(_0x40abc8){if(_0x40abc8){return _0x40abc8['update'](_0x27322f)['then'](function(_0x7707a1){return _0x7707a1;});}return null;};}function removeEntity(_0x2b41d8,_0xbb859b){return function(_0x7817d0){if(_0x7817d0){return _0x7817d0[_0xef45('0x28')]()[_0xef45('0x29')](function(){_0x2b41d8[_0xef45('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x208b35,_0x5f0593){return function(_0x38b470){if(!_0x38b470){_0x208b35[_0xef45('0x2a')](0x194);}return _0x38b470;};}function handleError(_0x578f03,_0x46e423){_0x46e423=_0x46e423||0x1f4;return function(_0x2c356d){logger['error'](_0x2c356d[_0xef45('0x2b')]);if(_0x2c356d['name']){delete _0x2c356d['name'];}_0x578f03['status'](_0x46e423)['send'](_0x2c356d);};}exports[_0xef45('0x2c')]=function(_0x2f72ef,_0x217e8d){var _0x15ad38={'raw':!![],'where':{'id':_0x2f72ef[_0xef45('0x2d')]['id']}},_0x5782d0={};_0x5782d0['model']=_[_0xef45('0x2e')](db['ChatApplication'][_0xef45('0x2f')]);_0x5782d0['query']=_['keys'](_0x2f72ef[_0xef45('0x30')]);_0x5782d0[_0xef45('0x31')]=_[_0xef45('0x32')](_0x5782d0[_0xef45('0x33')],_0x5782d0[_0xef45('0x30')]);_0x15ad38['attributes']=_['intersection'](_0x5782d0['model'],qs[_0xef45('0x34')](_0x2f72ef[_0xef45('0x30')][_0xef45('0x34')]));_0x15ad38[_0xef45('0x35')]=_0x15ad38[_0xef45('0x35')][_0xef45('0x36')]?_0x15ad38[_0xef45('0x35')]:_0x5782d0['model'];if(_0x2f72ef['query'][_0xef45('0x37')]){_0x15ad38['include']=[{'all':!![]}];}_0x15ad38=_[_0xef45('0x38')]({},_0x15ad38,_0x2f72ef['options']);return db[_0xef45('0x39')][_0xef45('0x3a')](_0x15ad38)[_0xef45('0x29')](handleEntityNotFound(_0x217e8d,null))[_0xef45('0x29')](respondWithResult(_0x217e8d,null))[_0xef45('0x3b')](handleError(_0x217e8d,null));};exports['update']=function(_0x372689,_0x331fdb){if(_0x372689[_0xef45('0x3c')]['id']){delete _0x372689['body']['id'];}return db['ChatApplication'][_0xef45('0x3a')]({'where':{'id':_0x372689[_0xef45('0x2d')]['id']}})['then'](handleEntityNotFound(_0x331fdb,null))[_0xef45('0x29')](saveUpdates(_0x372689['body'],null))['then'](respondWithResult(_0x331fdb,null))[_0xef45('0x3b')](handleError(_0x331fdb,null));};exports[_0xef45('0x28')]=function(_0x2688c9,_0x573caf){return db[_0xef45('0x39')][_0xef45('0x3a')]({'where':{'id':_0x2688c9[_0xef45('0x2d')]['id']}})[_0xef45('0x29')](handleEntityNotFound(_0x573caf,null))['then'](removeEntity(_0x573caf,null))['catch'](handleError(_0x573caf,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 708b81c..6996cc9 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 _0x60cb=['bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x60cb,0x172));var _0xb60c=function(_0x4a3bdb,_0x35ace0){_0x4a3bdb=_0x4a3bdb-0x0;var _0x4c1626=_0x60cb[_0x4a3bdb];return _0x4c1626;};'use strict';var _=require(_0xb60c('0x0'));var util=require('util');var logger=require(_0xb60c('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb60c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb60c('0x3'));var rimraf=require(_0xb60c('0x4'));var config=require(_0xb60c('0x5'));var attributes=require(_0xb60c('0x6'));module[_0xb60c('0x7')]=function(_0x467dcb,_0x177339){return _0x467dcb[_0xb60c('0x8')]('ChatApplication',attributes,{'tableName':_0xb60c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb60c('0xa'),'collate':_0xb60c('0xb')});};
\ No newline at end of file
+var _0xb2ed=['bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x228c6c,_0x155629){var _0x2d5278=function(_0x1b5bba){while(--_0x1b5bba){_0x228c6c['push'](_0x228c6c['shift']());}};_0x2d5278(++_0x155629);}(_0xb2ed,0x127));var _0xdb2e=function(_0x47c5bf,_0x45977e){_0x47c5bf=_0x47c5bf-0x0;var _0x11b779=_0xb2ed[_0x47c5bf];return _0x11b779;};'use strict';var _=require(_0xdb2e('0x0'));var util=require(_0xdb2e('0x1'));var logger=require(_0xdb2e('0x2'))(_0xdb2e('0x3'));var moment=require('moment');var BPromise=require(_0xdb2e('0x4'));var rp=require(_0xdb2e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdb2e('0x6'));var config=require(_0xdb2e('0x7'));var attributes=require(_0xdb2e('0x8'));module[_0xdb2e('0x9')]=function(_0x2761f1,_0x1dcc25){return _0x2761f1['define'](_0xdb2e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdb2e('0xb'),'collate':_0xdb2e('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 0f23d9f..eebda9c 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 _0x0195=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x4eb4c4,_0x35e92b){var _0x35e842=function(_0x1fdb48){while(--_0x1fdb48){_0x4eb4c4['push'](_0x4eb4c4['shift']());}};_0x35e842(++_0x35e92b);}(_0x0195,0x103));var _0x5019=function(_0x3dbf6c,_0x55cb15){_0x3dbf6c=_0x3dbf6c-0x0;var _0x46d71f=_0x0195[_0x3dbf6c];return _0x46d71f;};'use strict';var _=require(_0x5019('0x0'));var util=require(_0x5019('0x1'));var moment=require(_0x5019('0x2'));var BPromise=require(_0x5019('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5019('0x4'))['db'];var utils=require(_0x5019('0x5'));var logger=require(_0x5019('0x6'))('rpc');var config=require(_0x5019('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e68d8,_0x26c086,_0xf5e11){return new BPromise(function(_0x4cb336,_0xfcb753){return client['request'](_0x3e68d8,_0xf5e11)[_0x5019('0x8')](function(_0x3b49a0){logger[_0x5019('0x9')](_0x5019('0xa'),_0x26c086,_0x5019('0xb'));logger[_0x5019('0xc')](_0x5019('0xd'),_0x26c086,'request\x20sent',JSON[_0x5019('0xe')](_0x3b49a0));if(_0x3b49a0[_0x5019('0xf')]){if(_0x3b49a0[_0x5019('0xf')][_0x5019('0x10')]===0x1f4){logger['error'](_0x5019('0xa'),_0x26c086,_0x3b49a0[_0x5019('0xf')][_0x5019('0x11')]);return _0xfcb753(_0x3b49a0['error'][_0x5019('0x11')]);}logger[_0x5019('0xf')](_0x5019('0xa'),_0x26c086,_0x3b49a0['error'][_0x5019('0x11')]);return _0x4cb336(_0x3b49a0[_0x5019('0xf')][_0x5019('0x11')]);}else{logger[_0x5019('0x9')](_0x5019('0xa'),_0x26c086,_0x5019('0xb'));_0x4cb336(_0x3b49a0[_0x5019('0x12')][_0x5019('0x11')]);}})[_0x5019('0x13')](function(_0x4a411b){logger[_0x5019('0xf')]('ChatApplication,\x20%s,\x20%s',_0x26c086,_0x4a411b);_0xfcb753(_0x4a411b);});});}
\ No newline at end of file
+var _0xc629=['client','http','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xc629,0x172));var _0x9c62=function(_0x345114,_0x4923df){_0x345114=_0x345114-0x0;var _0x328e36=_0xc629[_0x345114];return _0x328e36;};'use strict';var _=require(_0x9c62('0x0'));var util=require(_0x9c62('0x1'));var moment=require(_0x9c62('0x2'));var BPromise=require('bluebird');var rs=require(_0x9c62('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9c62('0x4'));var logger=require('../../config/logger')(_0x9c62('0x5'));var config=require(_0x9c62('0x6'));var jayson=require(_0x9c62('0x7'));var client=jayson[_0x9c62('0x8')][_0x9c62('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39f92f,_0xfa2008,_0x35fbf7){return new BPromise(function(_0x451ed4,_0x258024){return client['request'](_0x39f92f,_0x35fbf7)[_0x9c62('0xa')](function(_0x4a4f69){logger[_0x9c62('0xb')]('ChatApplication,\x20%s,\x20%s',_0xfa2008,_0x9c62('0xc'));logger[_0x9c62('0xd')](_0x9c62('0xe'),_0xfa2008,_0x9c62('0xc'),JSON[_0x9c62('0xf')](_0x4a4f69));if(_0x4a4f69['error']){if(_0x4a4f69[_0x9c62('0x10')][_0x9c62('0x11')]===0x1f4){logger[_0x9c62('0x10')](_0x9c62('0x12'),_0xfa2008,_0x4a4f69[_0x9c62('0x10')][_0x9c62('0x13')]);return _0x258024(_0x4a4f69['error'][_0x9c62('0x13')]);}logger[_0x9c62('0x10')](_0x9c62('0x12'),_0xfa2008,_0x4a4f69[_0x9c62('0x10')]['message']);return _0x451ed4(_0x4a4f69['error'][_0x9c62('0x13')]);}else{logger[_0x9c62('0xb')](_0x9c62('0x12'),_0xfa2008,_0x9c62('0xc'));_0x451ed4(_0x4a4f69['result'][_0x9c62('0x13')]);}})[_0x9c62('0x14')](function(_0x3683aa){logger['error'](_0x9c62('0x12'),_0xfa2008,_0x3683aa);_0x258024(_0x3683aa);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index e01bca5..97664b4 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 _0xccea=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','express'];(function(_0x290fa6,_0x16d017){var _0x47f1f3=function(_0x2b5eb8){while(--_0x2b5eb8){_0x290fa6['push'](_0x290fa6['shift']());}};_0x47f1f3(++_0x16d017);}(_0xccea,0x1df));var _0xacce=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xccea[_0x102e37];return _0x35a07c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xacce('0x0'));var router=express[_0xacce('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xacce('0x2'));var interaction=require(_0xacce('0x3'));var config=require(_0xacce('0x4'));var controller=require(_0xacce('0x5'));router[_0xacce('0x6')](_0xacce('0x7'),auth[_0xacce('0x8')](),controller[_0xacce('0x9')]);router[_0xacce('0xa')](_0xacce('0x7'),auth[_0xacce('0x8')](),controller[_0xacce('0xb')]);router[_0xacce('0xc')]('/:id',auth[_0xacce('0x8')](),controller[_0xacce('0xd')]);module[_0xacce('0xe')]=router;
\ No newline at end of file
+var _0xa867=['show','put','isAuthenticated','delete','destroy','exports','multer','util','../../components/interaction/service','/:id'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0xa867,0x15a));var _0x7a86=function(_0x1abf57,_0x155dbd){_0x1abf57=_0x1abf57-0x0;var _0x1d5706=_0xa867[_0x1abf57];return _0x1d5706;};'use strict';var multer=require(_0x7a86('0x0'));var util=require(_0x7a86('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7a86('0x2'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router['get'](_0x7a86('0x3'),auth['isAuthenticated'](),controller[_0x7a86('0x4')]);router[_0x7a86('0x5')](_0x7a86('0x3'),auth[_0x7a86('0x6')](),controller['update']);router[_0x7a86('0x7')](_0x7a86('0x3'),auth[_0x7a86('0x6')](),controller[_0x7a86('0x8')]);module[_0x7a86('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 0a7ffbf..f224f45 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 _0x6c20=['BOOLEAN','sequelize','exports'];(function(_0x2d1016,_0x4db53d){var _0x5ca283=function(_0x593d8b){while(--_0x593d8b){_0x2d1016['push'](_0x2d1016['shift']());}};_0x5ca283(++_0x4db53d);}(_0x6c20,0x88));var _0x06c2=function(_0xbdedcd,_0x4064d8){_0xbdedcd=_0xbdedcd-0x0;var _0x32d3d1=_0x6c20[_0xbdedcd];return _0x32d3d1;};'use strict';var Sequelize=require(_0x06c2('0x0'));module[_0x06c2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x06c2('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xdafc=['sequelize','STRING'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xdafc,0x1a6));var _0xcdaf=function(_0x44e40a,_0x5998ef){_0x44e40a=_0x44e40a-0x0;var _0x48e9b4=_0xdafc[_0x44e40a];return _0x48e9b4;};'use strict';var Sequelize=require(_0xcdaf('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xcdaf('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 60a88c6..0535a8c 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 _0x717d=['removeMembers','ids','addMessage','getMessages','pick','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','name','send','index','map','ChatGroup','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','order','sort','filter','where','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','intersection','length','includeAll','create','body','find','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','getMembers','findOne','merge','nolimit'];(function(_0x4ee386,_0x1a9032){var _0x42450c=function(_0x51d08c){while(--_0x51d08c){_0x4ee386['push'](_0x4ee386['shift']());}};_0x42450c(++_0x1a9032);}(_0x717d,0xcf));var _0xd717=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x717d[_0x2d364e];return _0x1b9312;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd717('0x0'));var zipdir=require(_0xd717('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd717('0x2'));var moment=require(_0xd717('0x3'));var BPromise=require(_0xd717('0x4'));var Mustache=require(_0xd717('0x5'));var util=require(_0xd717('0x6'));var path=require(_0xd717('0x7'));var sox=require(_0xd717('0x8'));var csv=require(_0xd717('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd717('0xa'));var _=require(_0xd717('0xb'));var squel=require('squel');var crypto=require(_0xd717('0xc'));var jsforce=require(_0xd717('0xd'));var deskjs=require(_0xd717('0xe'));var toCsv=require(_0xd717('0x9'));var querystring=require(_0xd717('0xf'));var Papa=require('papaparse');var Redis=require(_0xd717('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd717('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd717('0x12'));var logger=require(_0xd717('0x13'))(_0xd717('0x14'));var utils=require(_0xd717('0x15'));var config=require(_0xd717('0x16'));var licenseUtil=require(_0xd717('0x17'));var db=require(_0xd717('0x18'))['db'];config['redis']=_['defaults'](config[_0xd717('0x19')],{'host':_0xd717('0x1a'),'port':0x18eb});var socket=require(_0xd717('0x1b'))(new Redis(config['redis']));require(_0xd717('0x1c'))[_0xd717('0x1d')](socket);function respondWithStatusCode(_0x1f3405,_0x57c602){_0x57c602=_0x57c602||0xcc;return function(_0x532698){if(_0x532698){return _0x1f3405[_0xd717('0x1e')](_0x57c602);}return _0x1f3405[_0xd717('0x1f')](_0x57c602)[_0xd717('0x20')]();};}function respondWithResult(_0x260148,_0x4d0a93){_0x4d0a93=_0x4d0a93||0xc8;return function(_0x43af6b){if(_0x43af6b){return _0x260148[_0xd717('0x1f')](_0x4d0a93)[_0xd717('0x21')](_0x43af6b);}};}function respondWithFilteredResult(_0x5d9ee3,_0x4e9aa8){return function(_0x381f34){if(_0x381f34){var _0x45a37a=typeof _0x4e9aa8[_0xd717('0x22')]===_0xd717('0x23')&&typeof _0x4e9aa8[_0xd717('0x24')]==='undefined';var _0x3e4e62=_0x381f34['count'];var _0x5a3d14=_0x45a37a?0x0:_0x4e9aa8[_0xd717('0x22')];var _0x384beb=_0x45a37a?_0x381f34[_0xd717('0x25')]:_0x4e9aa8[_0xd717('0x22')]+_0x4e9aa8[_0xd717('0x24')];var _0xccccc9;if(_0x384beb>=_0x3e4e62){_0x384beb=_0x3e4e62;_0xccccc9=0xc8;}else{_0xccccc9=0xce;}_0x5d9ee3[_0xd717('0x1f')](_0xccccc9);return _0x5d9ee3[_0xd717('0x26')]('Content-Range',_0x5a3d14+'-'+_0x384beb+'/'+_0x3e4e62)[_0xd717('0x21')](_0x381f34);}return null;};}function patchUpdates(_0x348b6f){return function(_0x474fec){try{jsonpatch[_0xd717('0x27')](_0x474fec,_0x348b6f,!![]);}catch(_0x2d2869){return BPromise[_0xd717('0x28')](_0x2d2869);}return _0x474fec[_0xd717('0x29')]();};}function saveUpdates(_0x5a640e,_0x287f32){return function(_0x468413){if(_0x468413){return _0x468413[_0xd717('0x2a')](_0x5a640e)['then'](function(_0x35a78c){return _0x35a78c;});}return null;};}function removeEntity(_0x4b240,_0x1b91a8){return function(_0x47bcc5){if(_0x47bcc5){return _0x47bcc5[_0xd717('0x2b')]()[_0xd717('0x2c')](function(){_0x4b240[_0xd717('0x1f')](0xcc)[_0xd717('0x20')]();});}};}function handleEntityNotFound(_0x997031,_0x181da5){return function(_0x4c4c63){if(!_0x4c4c63){_0x997031[_0xd717('0x1e')](0x194);}return _0x4c4c63;};}function handleError(_0x2ebf55,_0x445e90){_0x445e90=_0x445e90||0x1f4;return function(_0x14bb87){logger[_0xd717('0x2d')](_0x14bb87['stack']);if(_0x14bb87['name']){delete _0x14bb87[_0xd717('0x2e')];}_0x2ebf55[_0xd717('0x1f')](_0x445e90)[_0xd717('0x2f')](_0x14bb87);};}exports[_0xd717('0x30')]=function(_0x32f5e0,_0x1edf09){var _0x322a94={},_0x471496={},_0x48ebc6={'count':0x0,'rows':[]};var _0x205366=_[_0xd717('0x31')](db[_0xd717('0x32')]['rawAttributes'],function(_0x53668a){return{'name':_0x53668a['fieldName'],'type':_0x53668a[_0xd717('0x33')][_0xd717('0x34')]};});_0x471496[_0xd717('0x35')]=_[_0xd717('0x31')](_0x205366,'name');_0x471496[_0xd717('0x36')]=_[_0xd717('0x37')](_0x32f5e0[_0xd717('0x36')]);_0x471496[_0xd717('0x38')]=_['intersection'](_0x471496[_0xd717('0x35')],_0x471496['query']);_0x322a94[_0xd717('0x39')]=_['intersection'](_0x471496['model'],qs[_0xd717('0x3a')](_0x32f5e0[_0xd717('0x36')][_0xd717('0x3a')]));_0x322a94[_0xd717('0x39')]=_0x322a94['attributes']['length']?_0x322a94['attributes']:_0x471496[_0xd717('0x35')];if(!_0x32f5e0[_0xd717('0x36')][_0xd717('0x3b')]('nolimit')){_0x322a94['limit']=qs['limit'](_0x32f5e0[_0xd717('0x36')][_0xd717('0x24')]);_0x322a94[_0xd717('0x22')]=qs['offset'](_0x32f5e0[_0xd717('0x36')][_0xd717('0x22')]);}_0x322a94[_0xd717('0x3c')]=qs[_0xd717('0x3d')](_0x32f5e0[_0xd717('0x36')][_0xd717('0x3d')]);_0x322a94['where']=qs[_0xd717('0x38')](_['pick'](_0x32f5e0[_0xd717('0x36')],_0x471496[_0xd717('0x38')]),_0x205366);if(_0x32f5e0[_0xd717('0x36')][_0xd717('0x3e')]){_0x322a94['where']=_['merge'](_0x322a94[_0xd717('0x3f')],{'$or':_['map'](_0x205366,function(_0x1fe3b9){if(_0x1fe3b9[_0xd717('0x33')]!==_0xd717('0x40')){var _0x10aa09={};_0x10aa09[_0x1fe3b9[_0xd717('0x2e')]]={'$like':'%'+_0x32f5e0['query'][_0xd717('0x3e')]+'%'};return _0x10aa09;}})});}_0x322a94=_['merge']({},_0x322a94,_0x32f5e0[_0xd717('0x41')]);var _0x5e6a11={'where':_0x322a94['where']};return db['ChatGroup'][_0xd717('0x25')](_0x5e6a11)[_0xd717('0x2c')](function(_0x128a1a){_0x48ebc6[_0xd717('0x25')]=_0x128a1a;if(_0x32f5e0[_0xd717('0x36')]['includeAll']){_0x322a94[_0xd717('0x42')]=[{'all':!![]}];}return db['ChatGroup'][_0xd717('0x43')](_0x322a94);})[_0xd717('0x2c')](function(_0x3bdb51){_0x48ebc6[_0xd717('0x44')]=_0x3bdb51;return _0x48ebc6;})[_0xd717('0x2c')](respondWithFilteredResult(_0x1edf09,_0x322a94))[_0xd717('0x45')](handleError(_0x1edf09,null));};exports[_0xd717('0x46')]=function(_0x454563,_0x4848b7){var _0x55325e={'raw':!![],'where':{'id':_0x454563[_0xd717('0x47')]['id']}},_0x4d72bf={};_0x4d72bf[_0xd717('0x35')]=_[_0xd717('0x37')](db[_0xd717('0x32')][_0xd717('0x48')]);_0x4d72bf[_0xd717('0x36')]=_['keys'](_0x454563['query']);_0x4d72bf['filters']=_[_0xd717('0x49')](_0x4d72bf['model'],_0x4d72bf[_0xd717('0x36')]);_0x55325e[_0xd717('0x39')]=_[_0xd717('0x49')](_0x4d72bf[_0xd717('0x35')],qs[_0xd717('0x3a')](_0x454563['query'][_0xd717('0x3a')]));_0x55325e['attributes']=_0x55325e[_0xd717('0x39')][_0xd717('0x4a')]?_0x55325e[_0xd717('0x39')]:_0x4d72bf[_0xd717('0x35')];if(_0x454563[_0xd717('0x36')][_0xd717('0x4b')]){_0x55325e[_0xd717('0x42')]=[{'all':!![]}];}_0x55325e=_['merge']({},_0x55325e,_0x454563[_0xd717('0x41')]);return db[_0xd717('0x32')]['find'](_0x55325e)['then'](handleEntityNotFound(_0x4848b7,null))['then'](respondWithResult(_0x4848b7,null))[_0xd717('0x45')](handleError(_0x4848b7,null));};exports['create']=function(_0x124d55,_0x422099){return db['ChatGroup'][_0xd717('0x4c')](_0x124d55[_0xd717('0x4d')],{})['then'](respondWithResult(_0x422099,0xc9))['catch'](handleError(_0x422099,null));};exports[_0xd717('0x2a')]=function(_0x35c49e,_0x97dd0e){if(_0x35c49e[_0xd717('0x4d')]['id']){delete _0x35c49e['body']['id'];}return db[_0xd717('0x32')][_0xd717('0x4e')]({'where':{'id':_0x35c49e[_0xd717('0x47')]['id']}})[_0xd717('0x2c')](handleEntityNotFound(_0x97dd0e,null))[_0xd717('0x2c')](saveUpdates(_0x35c49e[_0xd717('0x4d')],null))['then'](respondWithResult(_0x97dd0e,null))[_0xd717('0x45')](handleError(_0x97dd0e,null));};exports[_0xd717('0x2b')]=function(_0x29727b,_0x21e211){return db[_0xd717('0x32')][_0xd717('0x4e')]({'where':{'id':_0x29727b[_0xd717('0x47')]['id']}})[_0xd717('0x2c')](handleEntityNotFound(_0x21e211,null))['then'](removeEntity(_0x21e211,null))['catch'](handleError(_0x21e211,null));};exports[_0xd717('0x4f')]=function(_0x2857c0,_0x395518){return db[_0xd717('0x32')]['describe']()[_0xd717('0x2c')](respondWithResult(_0x395518,null))[_0xd717('0x45')](handleError(_0x395518,null));};exports[_0xd717('0x50')]=function(_0x4ef4cc,_0x1b5875,_0x514282){return db[_0xd717('0x51')]['count']({'where':{'ChatGroupId':_0x4ef4cc[_0xd717('0x47')]['id'],'ToId':_0x4ef4cc[_0xd717('0x52')]['id'],'read':![]}})[_0xd717('0x2c')](function(_0x2832ca){return{'id':_[_0xd717('0x53')](_0x4ef4cc[_0xd717('0x47')]['id']),'count':_0x2832ca};})[_0xd717('0x2c')](respondWithResult(_0x1b5875,null))[_0xd717('0x45')](handleError(_0x1b5875,null));};exports[_0xd717('0x54')]=function(_0x5347f1,_0x3678fb,_0x244c8e){return db['ChatGroup'][_0xd717('0x4e')]({'where':{'id':_0x5347f1[_0xd717('0x47')]['id']}})[_0xd717('0x2c')](handleEntityNotFound(_0x3678fb,null))[_0xd717('0x2c')](function(_0x262537){if(_0x262537){return _0x262537[_0xd717('0x54')](_0x5347f1['body']['ids'],_[_0xd717('0x55')](_0x5347f1[_0xd717('0x4d')],['ids','id'])||{});}})['then'](respondWithResult(_0x3678fb,null))[_0xd717('0x45')](handleError(_0x3678fb,null));};exports[_0xd717('0x56')]=function(_0xfdb6de,_0x5668d5,_0x2eda30){var _0x4a6f73={};var _0x2f220={};var _0xc874af;var _0x5833e3;return db[_0xd717('0x32')][_0xd717('0x57')]({'where':{'id':_0xfdb6de[_0xd717('0x47')]['id']}})[_0xd717('0x2c')](handleEntityNotFound(_0x5668d5,null))[_0xd717('0x2c')](function(_0x3a62a1){if(_0x3a62a1){_0xc874af=_0x3a62a1;_0x2f220[_0xd717('0x35')]=_[_0xd717('0x37')](db['User'][_0xd717('0x48')]);_0x2f220[_0xd717('0x36')]=_[_0xd717('0x37')](_0xfdb6de[_0xd717('0x36')]);_0x2f220[_0xd717('0x38')]=_[_0xd717('0x49')](_0x2f220[_0xd717('0x35')],_0x2f220[_0xd717('0x36')]);_0x4a6f73[_0xd717('0x39')]=_[_0xd717('0x49')](_0x2f220['model'],qs[_0xd717('0x3a')](_0xfdb6de['query']['fields']));_0x4a6f73[_0xd717('0x39')]=_0x4a6f73['attributes']['length']?_0x4a6f73['attributes']:_0x2f220[_0xd717('0x35')];_0x4a6f73[_0xd717('0x3c')]=qs[_0xd717('0x3d')](_0xfdb6de[_0xd717('0x36')][_0xd717('0x3d')]);_0x4a6f73[_0xd717('0x3f')]=qs[_0xd717('0x38')](_['pick'](_0xfdb6de[_0xd717('0x36')],_0x2f220['filters']));if(_0xfdb6de[_0xd717('0x36')][_0xd717('0x3e')]){_0x4a6f73['where']=_[_0xd717('0x58')](_0x4a6f73[_0xd717('0x3f')],{'$or':_['map'](_0x4a6f73[_0xd717('0x39')],function(_0x2e4799){var _0x447e0f={};_0x447e0f[_0x2e4799]={'$like':'%'+_0xfdb6de[_0xd717('0x36')][_0xd717('0x3e')]+'%'};return _0x447e0f;})});}_0x4a6f73=_[_0xd717('0x58')]({},_0x4a6f73,_0xfdb6de[_0xd717('0x41')]);return _0xc874af[_0xd717('0x56')](_0x4a6f73);}})[_0xd717('0x2c')](function(_0x1f98c5){if(_0x1f98c5){_0x5833e3=_0x1f98c5[_0xd717('0x4a')];if(!_0xfdb6de[_0xd717('0x36')][_0xd717('0x3b')](_0xd717('0x59'))){_0x4a6f73[_0xd717('0x24')]=qs[_0xd717('0x24')](_0xfdb6de[_0xd717('0x36')][_0xd717('0x24')]);_0x4a6f73['offset']=qs['offset'](_0xfdb6de[_0xd717('0x36')]['offset']);}return _0xc874af[_0xd717('0x56')](_0x4a6f73);}})[_0xd717('0x2c')](function(_0x5a9c97){if(_0x5a9c97){return _0x5a9c97?{'count':_0x5833e3,'rows':_0x5a9c97}:null;}})['then'](respondWithResult(_0x5668d5,null))[_0xd717('0x45')](handleError(_0x5668d5,null));};exports[_0xd717('0x5a')]=function(_0x5a9404,_0xba82f6,_0x1c4642){return db[_0xd717('0x32')][_0xd717('0x4e')]({'where':{'id':_0x5a9404[_0xd717('0x47')]['id']}})[_0xd717('0x2c')](handleEntityNotFound(_0xba82f6,null))[_0xd717('0x2c')](function(_0xb58b60){if(_0xb58b60){return _0xb58b60[_0xd717('0x5a')](_0x5a9404[_0xd717('0x36')][_0xd717('0x5b')]);}})[_0xd717('0x2c')](respondWithStatusCode(_0xba82f6,null))['catch'](handleError(_0xba82f6,null));};exports[_0xd717('0x5c')]=function(_0x36de90,_0x92dc4c,_0x51d007){if(_0x36de90[_0xd717('0x4d')]['id']){delete _0x36de90['body']['id'];}return db[_0xd717('0x32')][_0xd717('0x4e')]({'where':{'id':_0x36de90[_0xd717('0x47')]['id']}})[_0xd717('0x2c')](handleEntityNotFound(_0x92dc4c,null))[_0xd717('0x2c')](function(_0x7c4bf5){if(_0x7c4bf5){_0x36de90[_0xd717('0x4d')]['ChatGroupId']=_0x7c4bf5['id'];return db[_0xd717('0x51')][_0xd717('0x4c')](_0x36de90[_0xd717('0x4d')]);}})[_0xd717('0x2c')](respondWithResult(_0x92dc4c,null))['catch'](handleError(_0x92dc4c,null));};exports[_0xd717('0x5d')]=function(_0x43ac5f,_0x59f202,_0x14fa16){var _0x8ba9a0={};var _0x2856f0={};var _0x41665b;var _0x2c42eb;return db[_0xd717('0x32')][_0xd717('0x57')]({'where':{'id':_0x43ac5f[_0xd717('0x47')]['id']}})[_0xd717('0x2c')](handleEntityNotFound(_0x59f202,null))[_0xd717('0x2c')](function(_0x25d57d){if(_0x25d57d){_0x41665b=_0x25d57d;_0x2856f0['model']=_[_0xd717('0x37')](db[_0xd717('0x51')][_0xd717('0x48')]);_0x2856f0['query']=_[_0xd717('0x37')](_0x43ac5f[_0xd717('0x36')]);_0x2856f0[_0xd717('0x38')]=_[_0xd717('0x49')](_0x2856f0[_0xd717('0x35')],_0x2856f0[_0xd717('0x36')]);_0x8ba9a0['attributes']=_[_0xd717('0x49')](_0x2856f0[_0xd717('0x35')],qs[_0xd717('0x3a')](_0x43ac5f[_0xd717('0x36')][_0xd717('0x3a')]));_0x8ba9a0[_0xd717('0x39')]=_0x8ba9a0[_0xd717('0x39')][_0xd717('0x4a')]?_0x8ba9a0[_0xd717('0x39')]:_0x2856f0[_0xd717('0x35')];_0x8ba9a0[_0xd717('0x3c')]=qs[_0xd717('0x3d')](_0x43ac5f[_0xd717('0x36')][_0xd717('0x3d')]);_0x8ba9a0[_0xd717('0x3f')]=qs[_0xd717('0x38')](_[_0xd717('0x5e')](_0x43ac5f[_0xd717('0x36')],_0x2856f0[_0xd717('0x38')]));if(_0x43ac5f['query'][_0xd717('0x3e')]){_0x8ba9a0[_0xd717('0x3f')]=_['merge'](_0x8ba9a0[_0xd717('0x3f')],{'$or':_[_0xd717('0x31')](_0x8ba9a0[_0xd717('0x39')],function(_0xc1ddcb){var _0x360cb1={};_0x360cb1[_0xc1ddcb]={'$like':'%'+_0x43ac5f[_0xd717('0x36')]['filter']+'%'};return _0x360cb1;})});}if(_0x43ac5f[_0xd717('0x36')][_0xd717('0x5f')]){var _0x58a27d=_0x43ac5f[_0xd717('0x36')][_0xd717('0x5f')][_0xd717('0x60')](',');var _0x47f524={};_0x47f524[_0x58a27d[0x0]]={'$gte':moment(_0x58a27d[0x1])[_0xd717('0x61')](_0xd717('0x62'))};_0x8ba9a0[_0xd717('0x3f')]=_[_0xd717('0x58')](_0x8ba9a0[_0xd717('0x3f')],_0x47f524);}_0x8ba9a0=_['merge']({},_0x8ba9a0,_0x43ac5f[_0xd717('0x41')]);return _0x41665b['getMessages'](_0x8ba9a0);}})[_0xd717('0x2c')](function(_0x15b6a4){if(_0x15b6a4){_0x2c42eb=_0x15b6a4[_0xd717('0x4a')];if(!_0x43ac5f[_0xd717('0x36')]['hasOwnProperty'](_0xd717('0x59'))){_0x8ba9a0[_0xd717('0x24')]=qs[_0xd717('0x24')](_0x43ac5f[_0xd717('0x36')][_0xd717('0x24')]);_0x8ba9a0['offset']=qs[_0xd717('0x22')](_0x43ac5f[_0xd717('0x36')]['offset']);}return _0x41665b[_0xd717('0x5d')](_0x8ba9a0);}})['then'](function(_0x1ced42){if(_0x1ced42){return _0x1ced42?{'count':_0x2c42eb,'rows':_0x1ced42}:null;}})[_0xd717('0x2c')](respondWithResult(_0x59f202,null))[_0xd717('0x45')](handleError(_0x59f202,null));};
\ No newline at end of file
+var _0x5def=['ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','options','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','User','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0xe896bf,_0x4f8e5e){var _0x4c7a8a=function(_0x410ff2){while(--_0x410ff2){_0xe896bf['push'](_0xe896bf['shift']());}};_0x4c7a8a(++_0x4f8e5e);}(_0x5def,0x1e7));var _0xf5de=function(_0x3fbdf6,_0x47945b){_0x3fbdf6=_0x3fbdf6-0x0;var _0x1d948f=_0x5def[_0x3fbdf6];return _0x1d948f;};'use strict';var emlformat=require(_0xf5de('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf5de('0x1'));var rp=require('request-promise');var moment=require(_0xf5de('0x2'));var BPromise=require(_0xf5de('0x3'));var Mustache=require(_0xf5de('0x4'));var util=require(_0xf5de('0x5'));var path=require(_0xf5de('0x6'));var sox=require(_0xf5de('0x7'));var csv=require('to-csv');var ejs=require(_0xf5de('0x8'));var fs=require('fs');var fs_extra=require(_0xf5de('0x9'));var _=require(_0xf5de('0xa'));var squel=require(_0xf5de('0xb'));var crypto=require(_0xf5de('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf5de('0xd'));var toCsv=require(_0xf5de('0xe'));var querystring=require(_0xf5de('0xf'));var Papa=require(_0xf5de('0x10'));var Redis=require(_0xf5de('0x11'));var authService=require(_0xf5de('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5de('0x13'));var hardwareService=require(_0xf5de('0x14'));var logger=require(_0xf5de('0x15'))('api');var utils=require(_0xf5de('0x16'));var config=require(_0xf5de('0x17'));var licenseUtil=require(_0xf5de('0x18'));var db=require(_0xf5de('0x19'))['db'];config[_0xf5de('0x1a')]=_['defaults'](config[_0xf5de('0x1a')],{'host':_0xf5de('0x1b'),'port':0x18eb});var socket=require(_0xf5de('0x1c'))(new Redis(config[_0xf5de('0x1a')]));require('./chatGroup.socket')[_0xf5de('0x1d')](socket);function respondWithStatusCode(_0x309969,_0x537aac){_0x537aac=_0x537aac||0xcc;return function(_0x57c66c){if(_0x57c66c){return _0x309969[_0xf5de('0x1e')](_0x537aac);}return _0x309969['status'](_0x537aac)[_0xf5de('0x1f')]();};}function respondWithResult(_0x2b0720,_0x125eb9){_0x125eb9=_0x125eb9||0xc8;return function(_0x2afb43){if(_0x2afb43){return _0x2b0720[_0xf5de('0x20')](_0x125eb9)[_0xf5de('0x21')](_0x2afb43);}};}function respondWithFilteredResult(_0x182888,_0x4d1852){return function(_0x2b1213){if(_0x2b1213){var _0x1999cb=typeof _0x4d1852[_0xf5de('0x22')]===_0xf5de('0x23')&&typeof _0x4d1852[_0xf5de('0x24')]==='undefined';var _0x26f451=_0x2b1213[_0xf5de('0x25')];var _0x2305ee=_0x1999cb?0x0:_0x4d1852[_0xf5de('0x22')];var _0x525a86=_0x1999cb?_0x2b1213[_0xf5de('0x25')]:_0x4d1852[_0xf5de('0x22')]+_0x4d1852[_0xf5de('0x24')];var _0x4d6742;if(_0x525a86>=_0x26f451){_0x525a86=_0x26f451;_0x4d6742=0xc8;}else{_0x4d6742=0xce;}_0x182888[_0xf5de('0x20')](_0x4d6742);return _0x182888[_0xf5de('0x26')](_0xf5de('0x27'),_0x2305ee+'-'+_0x525a86+'/'+_0x26f451)['json'](_0x2b1213);}return null;};}function patchUpdates(_0x26322c){return function(_0x2c08a2){try{jsonpatch[_0xf5de('0x28')](_0x2c08a2,_0x26322c,!![]);}catch(_0x22d7e0){return BPromise[_0xf5de('0x29')](_0x22d7e0);}return _0x2c08a2[_0xf5de('0x2a')]();};}function saveUpdates(_0x14f1b1,_0x513a22){return function(_0x2f9b50){if(_0x2f9b50){return _0x2f9b50[_0xf5de('0x2b')](_0x14f1b1)['then'](function(_0x1b526d){return _0x1b526d;});}return null;};}function removeEntity(_0x53e606,_0x12d456){return function(_0x5f213d){if(_0x5f213d){return _0x5f213d[_0xf5de('0x2c')]()[_0xf5de('0x2d')](function(){_0x53e606[_0xf5de('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36986c,_0x4ce080){return function(_0x388b1a){if(!_0x388b1a){_0x36986c[_0xf5de('0x1e')](0x194);}return _0x388b1a;};}function handleError(_0x2bf9d4,_0x36f052){_0x36f052=_0x36f052||0x1f4;return function(_0xce2dff){logger[_0xf5de('0x2e')](_0xce2dff[_0xf5de('0x2f')]);if(_0xce2dff[_0xf5de('0x30')]){delete _0xce2dff[_0xf5de('0x30')];}_0x2bf9d4[_0xf5de('0x20')](_0x36f052)[_0xf5de('0x31')](_0xce2dff);};}exports[_0xf5de('0x32')]=function(_0x340c95,_0x3cb8d3){var _0x1ab697={},_0x473726={},_0x53dc0e={'count':0x0,'rows':[]};var _0x79b8f2=_[_0xf5de('0x33')](db[_0xf5de('0x34')][_0xf5de('0x35')],function(_0x559689){return{'name':_0x559689['fieldName'],'type':_0x559689[_0xf5de('0x36')][_0xf5de('0x37')]};});_0x473726[_0xf5de('0x38')]=_[_0xf5de('0x33')](_0x79b8f2,_0xf5de('0x30'));_0x473726[_0xf5de('0x39')]=_[_0xf5de('0x3a')](_0x340c95[_0xf5de('0x39')]);_0x473726[_0xf5de('0x3b')]=_[_0xf5de('0x3c')](_0x473726[_0xf5de('0x38')],_0x473726[_0xf5de('0x39')]);_0x1ab697[_0xf5de('0x3d')]=_[_0xf5de('0x3c')](_0x473726[_0xf5de('0x38')],qs[_0xf5de('0x3e')](_0x340c95[_0xf5de('0x39')]['fields']));_0x1ab697['attributes']=_0x1ab697[_0xf5de('0x3d')][_0xf5de('0x3f')]?_0x1ab697[_0xf5de('0x3d')]:_0x473726[_0xf5de('0x38')];if(!_0x340c95[_0xf5de('0x39')]['hasOwnProperty'](_0xf5de('0x40'))){_0x1ab697[_0xf5de('0x24')]=qs[_0xf5de('0x24')](_0x340c95[_0xf5de('0x39')][_0xf5de('0x24')]);_0x1ab697['offset']=qs[_0xf5de('0x22')](_0x340c95[_0xf5de('0x39')][_0xf5de('0x22')]);}_0x1ab697['order']=qs[_0xf5de('0x41')](_0x340c95['query'][_0xf5de('0x41')]);_0x1ab697[_0xf5de('0x42')]=qs[_0xf5de('0x3b')](_[_0xf5de('0x43')](_0x340c95['query'],_0x473726[_0xf5de('0x3b')]),_0x79b8f2);if(_0x340c95[_0xf5de('0x39')][_0xf5de('0x44')]){_0x1ab697[_0xf5de('0x42')]=_[_0xf5de('0x45')](_0x1ab697[_0xf5de('0x42')],{'$or':_[_0xf5de('0x33')](_0x79b8f2,function(_0x307dcf){if(_0x307dcf[_0xf5de('0x36')]!==_0xf5de('0x46')){var _0x45bdef={};_0x45bdef[_0x307dcf[_0xf5de('0x30')]]={'$like':'%'+_0x340c95[_0xf5de('0x39')][_0xf5de('0x44')]+'%'};return _0x45bdef;}})});}_0x1ab697=_['merge']({},_0x1ab697,_0x340c95['options']);var _0x485ed7={'where':_0x1ab697[_0xf5de('0x42')]};return db[_0xf5de('0x34')][_0xf5de('0x25')](_0x485ed7)[_0xf5de('0x2d')](function(_0x2060dd){_0x53dc0e['count']=_0x2060dd;if(_0x340c95[_0xf5de('0x39')][_0xf5de('0x47')]){_0x1ab697['include']=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x1ab697);})['then'](function(_0x26bda2){_0x53dc0e[_0xf5de('0x48')]=_0x26bda2;return _0x53dc0e;})[_0xf5de('0x2d')](respondWithFilteredResult(_0x3cb8d3,_0x1ab697))[_0xf5de('0x49')](handleError(_0x3cb8d3,null));};exports[_0xf5de('0x4a')]=function(_0x3a62f5,_0x15bed0){var _0x25eddd={'raw':!![],'where':{'id':_0x3a62f5[_0xf5de('0x4b')]['id']}},_0xd06e83={};_0xd06e83[_0xf5de('0x38')]=_[_0xf5de('0x3a')](db['ChatGroup']['rawAttributes']);_0xd06e83[_0xf5de('0x39')]=_[_0xf5de('0x3a')](_0x3a62f5['query']);_0xd06e83[_0xf5de('0x3b')]=_[_0xf5de('0x3c')](_0xd06e83['model'],_0xd06e83[_0xf5de('0x39')]);_0x25eddd[_0xf5de('0x3d')]=_[_0xf5de('0x3c')](_0xd06e83['model'],qs[_0xf5de('0x3e')](_0x3a62f5[_0xf5de('0x39')][_0xf5de('0x3e')]));_0x25eddd['attributes']=_0x25eddd[_0xf5de('0x3d')][_0xf5de('0x3f')]?_0x25eddd[_0xf5de('0x3d')]:_0xd06e83[_0xf5de('0x38')];if(_0x3a62f5[_0xf5de('0x39')][_0xf5de('0x47')]){_0x25eddd['include']=[{'all':!![]}];}_0x25eddd=_[_0xf5de('0x45')]({},_0x25eddd,_0x3a62f5[_0xf5de('0x4c')]);return db[_0xf5de('0x34')][_0xf5de('0x4d')](_0x25eddd)['then'](handleEntityNotFound(_0x15bed0,null))['then'](respondWithResult(_0x15bed0,null))[_0xf5de('0x49')](handleError(_0x15bed0,null));};exports[_0xf5de('0x4e')]=function(_0x3a9afb,_0xe510fe){return db['ChatGroup'][_0xf5de('0x4e')](_0x3a9afb[_0xf5de('0x4f')],{})[_0xf5de('0x2d')](respondWithResult(_0xe510fe,0xc9))[_0xf5de('0x49')](handleError(_0xe510fe,null));};exports[_0xf5de('0x2b')]=function(_0x4a17dc,_0x16816f){if(_0x4a17dc[_0xf5de('0x4f')]['id']){delete _0x4a17dc[_0xf5de('0x4f')]['id'];}return db[_0xf5de('0x34')]['find']({'where':{'id':_0x4a17dc[_0xf5de('0x4b')]['id']}})[_0xf5de('0x2d')](handleEntityNotFound(_0x16816f,null))[_0xf5de('0x2d')](saveUpdates(_0x4a17dc[_0xf5de('0x4f')],null))[_0xf5de('0x2d')](respondWithResult(_0x16816f,null))[_0xf5de('0x49')](handleError(_0x16816f,null));};exports[_0xf5de('0x2c')]=function(_0x580e27,_0x36e22e){return db['ChatGroup'][_0xf5de('0x4d')]({'where':{'id':_0x580e27[_0xf5de('0x4b')]['id']}})[_0xf5de('0x2d')](handleEntityNotFound(_0x36e22e,null))['then'](removeEntity(_0x36e22e,null))[_0xf5de('0x49')](handleError(_0x36e22e,null));};exports['describe']=function(_0x2d6cf9,_0x441b8d){return db[_0xf5de('0x34')][_0xf5de('0x50')]()[_0xf5de('0x2d')](respondWithResult(_0x441b8d,null))[_0xf5de('0x49')](handleError(_0x441b8d,null));};exports[_0xf5de('0x51')]=function(_0x37c667,_0x5c4c83,_0x336c39){return db[_0xf5de('0x52')]['count']({'where':{'ChatGroupId':_0x37c667[_0xf5de('0x4b')]['id'],'ToId':_0x37c667[_0xf5de('0x53')]['id'],'read':![]}})[_0xf5de('0x2d')](function(_0x3fcb7c){return{'id':_['toInteger'](_0x37c667[_0xf5de('0x4b')]['id']),'count':_0x3fcb7c};})['then'](respondWithResult(_0x5c4c83,null))[_0xf5de('0x49')](handleError(_0x5c4c83,null));};exports['addMembers']=function(_0x59bf2c,_0x16499f,_0x515b0d){return db[_0xf5de('0x34')][_0xf5de('0x4d')]({'where':{'id':_0x59bf2c[_0xf5de('0x4b')]['id']}})[_0xf5de('0x2d')](handleEntityNotFound(_0x16499f,null))['then'](function(_0x380d47){if(_0x380d47){return _0x380d47[_0xf5de('0x54')](_0x59bf2c['body'][_0xf5de('0x55')],_[_0xf5de('0x56')](_0x59bf2c['body'],[_0xf5de('0x55'),'id'])||{});}})[_0xf5de('0x2d')](respondWithResult(_0x16499f,null))['catch'](handleError(_0x16499f,null));};exports[_0xf5de('0x57')]=function(_0x164fd5,_0x1fc2cd,_0x244115){var _0x453a9a={};var _0xc776a9={};var _0x526d4d;var _0x1ff6b5;return db[_0xf5de('0x34')]['findOne']({'where':{'id':_0x164fd5[_0xf5de('0x4b')]['id']}})[_0xf5de('0x2d')](handleEntityNotFound(_0x1fc2cd,null))[_0xf5de('0x2d')](function(_0x190adb){if(_0x190adb){_0x526d4d=_0x190adb;_0xc776a9[_0xf5de('0x38')]=_[_0xf5de('0x3a')](db[_0xf5de('0x58')][_0xf5de('0x35')]);_0xc776a9[_0xf5de('0x39')]=_['keys'](_0x164fd5[_0xf5de('0x39')]);_0xc776a9[_0xf5de('0x3b')]=_[_0xf5de('0x3c')](_0xc776a9['model'],_0xc776a9['query']);_0x453a9a[_0xf5de('0x3d')]=_[_0xf5de('0x3c')](_0xc776a9[_0xf5de('0x38')],qs['fields'](_0x164fd5[_0xf5de('0x39')][_0xf5de('0x3e')]));_0x453a9a[_0xf5de('0x3d')]=_0x453a9a['attributes'][_0xf5de('0x3f')]?_0x453a9a[_0xf5de('0x3d')]:_0xc776a9[_0xf5de('0x38')];_0x453a9a['order']=qs['sort'](_0x164fd5['query']['sort']);_0x453a9a[_0xf5de('0x42')]=qs[_0xf5de('0x3b')](_[_0xf5de('0x43')](_0x164fd5[_0xf5de('0x39')],_0xc776a9[_0xf5de('0x3b')]));if(_0x164fd5['query'][_0xf5de('0x44')]){_0x453a9a[_0xf5de('0x42')]=_['merge'](_0x453a9a['where'],{'$or':_[_0xf5de('0x33')](_0x453a9a[_0xf5de('0x3d')],function(_0x102617){var _0x575688={};_0x575688[_0x102617]={'$like':'%'+_0x164fd5['query']['filter']+'%'};return _0x575688;})});}_0x453a9a=_[_0xf5de('0x45')]({},_0x453a9a,_0x164fd5[_0xf5de('0x4c')]);return _0x526d4d[_0xf5de('0x57')](_0x453a9a);}})[_0xf5de('0x2d')](function(_0x911b58){if(_0x911b58){_0x1ff6b5=_0x911b58[_0xf5de('0x3f')];if(!_0x164fd5[_0xf5de('0x39')][_0xf5de('0x59')]('nolimit')){_0x453a9a[_0xf5de('0x24')]=qs[_0xf5de('0x24')](_0x164fd5[_0xf5de('0x39')][_0xf5de('0x24')]);_0x453a9a[_0xf5de('0x22')]=qs['offset'](_0x164fd5[_0xf5de('0x39')][_0xf5de('0x22')]);}return _0x526d4d['getMembers'](_0x453a9a);}})[_0xf5de('0x2d')](function(_0xc5ca21){if(_0xc5ca21){return _0xc5ca21?{'count':_0x1ff6b5,'rows':_0xc5ca21}:null;}})[_0xf5de('0x2d')](respondWithResult(_0x1fc2cd,null))[_0xf5de('0x49')](handleError(_0x1fc2cd,null));};exports[_0xf5de('0x5a')]=function(_0x22345c,_0x23df7f,_0x45e577){return db['ChatGroup'][_0xf5de('0x4d')]({'where':{'id':_0x22345c[_0xf5de('0x4b')]['id']}})[_0xf5de('0x2d')](handleEntityNotFound(_0x23df7f,null))[_0xf5de('0x2d')](function(_0x5e8ab5){if(_0x5e8ab5){return _0x5e8ab5[_0xf5de('0x5a')](_0x22345c[_0xf5de('0x39')][_0xf5de('0x55')]);}})[_0xf5de('0x2d')](respondWithStatusCode(_0x23df7f,null))[_0xf5de('0x49')](handleError(_0x23df7f,null));};exports[_0xf5de('0x5b')]=function(_0x24936e,_0x41586b,_0x263474){if(_0x24936e[_0xf5de('0x4f')]['id']){delete _0x24936e[_0xf5de('0x4f')]['id'];}return db[_0xf5de('0x34')]['find']({'where':{'id':_0x24936e['params']['id']}})[_0xf5de('0x2d')](handleEntityNotFound(_0x41586b,null))[_0xf5de('0x2d')](function(_0x21cac8){if(_0x21cac8){_0x24936e[_0xf5de('0x4f')][_0xf5de('0x5c')]=_0x21cac8['id'];return db['ChatInternalMessage']['create'](_0x24936e[_0xf5de('0x4f')]);}})[_0xf5de('0x2d')](respondWithResult(_0x41586b,null))[_0xf5de('0x49')](handleError(_0x41586b,null));};exports[_0xf5de('0x5d')]=function(_0x249a32,_0x446fd7,_0x424d72){var _0x48f3c9={};var _0x52c8a4={};var _0x20c5b6;var _0xc4b1c0;return db['ChatGroup'][_0xf5de('0x5e')]({'where':{'id':_0x249a32[_0xf5de('0x4b')]['id']}})[_0xf5de('0x2d')](handleEntityNotFound(_0x446fd7,null))['then'](function(_0x21245f){if(_0x21245f){_0x20c5b6=_0x21245f;_0x52c8a4[_0xf5de('0x38')]=_[_0xf5de('0x3a')](db[_0xf5de('0x52')][_0xf5de('0x35')]);_0x52c8a4['query']=_[_0xf5de('0x3a')](_0x249a32[_0xf5de('0x39')]);_0x52c8a4[_0xf5de('0x3b')]=_[_0xf5de('0x3c')](_0x52c8a4[_0xf5de('0x38')],_0x52c8a4[_0xf5de('0x39')]);_0x48f3c9['attributes']=_['intersection'](_0x52c8a4[_0xf5de('0x38')],qs['fields'](_0x249a32[_0xf5de('0x39')][_0xf5de('0x3e')]));_0x48f3c9[_0xf5de('0x3d')]=_0x48f3c9[_0xf5de('0x3d')]['length']?_0x48f3c9['attributes']:_0x52c8a4[_0xf5de('0x38')];_0x48f3c9['order']=qs['sort'](_0x249a32[_0xf5de('0x39')][_0xf5de('0x41')]);_0x48f3c9[_0xf5de('0x42')]=qs[_0xf5de('0x3b')](_[_0xf5de('0x43')](_0x249a32[_0xf5de('0x39')],_0x52c8a4[_0xf5de('0x3b')]));if(_0x249a32[_0xf5de('0x39')][_0xf5de('0x44')]){_0x48f3c9[_0xf5de('0x42')]=_['merge'](_0x48f3c9[_0xf5de('0x42')],{'$or':_[_0xf5de('0x33')](_0x48f3c9[_0xf5de('0x3d')],function(_0x2a854a){var _0x53af41={};_0x53af41[_0x2a854a]={'$like':'%'+_0x249a32['query'][_0xf5de('0x44')]+'%'};return _0x53af41;})});}if(_0x249a32[_0xf5de('0x39')][_0xf5de('0x5f')]){var _0x5f8c28=_0x249a32[_0xf5de('0x39')][_0xf5de('0x5f')][_0xf5de('0x60')](',');var _0x45ff05={};_0x45ff05[_0x5f8c28[0x0]]={'$gte':moment(_0x5f8c28[0x1])[_0xf5de('0x61')](_0xf5de('0x62'))};_0x48f3c9[_0xf5de('0x42')]=_[_0xf5de('0x45')](_0x48f3c9['where'],_0x45ff05);}_0x48f3c9=_['merge']({},_0x48f3c9,_0x249a32['options']);return _0x20c5b6[_0xf5de('0x5d')](_0x48f3c9);}})[_0xf5de('0x2d')](function(_0x2477ba){if(_0x2477ba){_0xc4b1c0=_0x2477ba['length'];if(!_0x249a32[_0xf5de('0x39')]['hasOwnProperty'](_0xf5de('0x40'))){_0x48f3c9['limit']=qs[_0xf5de('0x24')](_0x249a32[_0xf5de('0x39')][_0xf5de('0x24')]);_0x48f3c9[_0xf5de('0x22')]=qs[_0xf5de('0x22')](_0x249a32[_0xf5de('0x39')][_0xf5de('0x22')]);}return _0x20c5b6[_0xf5de('0x5d')](_0x48f3c9);}})[_0xf5de('0x2d')](function(_0x220c54){if(_0x220c54){return _0x220c54?{'count':_0xc4b1c0,'rows':_0x220c54}:null;}})['then'](respondWithResult(_0x446fd7,null))['catch'](handleError(_0x446fd7,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index a0a7731..01e37d0 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 _0xc376=['hook','exports','../../mysqldb','save','update','remove','emit'];(function(_0x576e2b,_0x328953){var _0x46461a=function(_0xce4d9e){while(--_0xce4d9e){_0x576e2b['push'](_0x576e2b['shift']());}};_0x46461a(++_0x328953);}(_0xc376,0x14b));var _0x6c37=function(_0x5e6cb8,_0x16cf56){_0x5e6cb8=_0x5e6cb8-0x0;var _0x3faeb3=_0xc376[_0x5e6cb8];return _0x3faeb3;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x6c37('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6c37('0x1'),'afterUpdate':_0x6c37('0x2'),'afterDestroy':_0x6c37('0x3')};function emitEvent(_0x40031c){return function(_0x47f6fb,_0x42aced,_0x5dfa69){ChatGroupEvents[_0x6c37('0x4')](_0x40031c+':'+_0x47f6fb['id'],_0x47f6fb);ChatGroupEvents[_0x6c37('0x4')](_0x40031c,_0x47f6fb);_0x5dfa69(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x6c37('0x5')](e,emitEvent(event));}}module[_0x6c37('0x6')]=ChatGroupEvents;
\ No newline at end of file
+var _0xf55c=['exports','events','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x172a45,_0xdcfdb1){var _0x2ece46=function(_0x5be386){while(--_0x5be386){_0x172a45['push'](_0x172a45['shift']());}};_0x2ece46(++_0xdcfdb1);}(_0xf55c,0x1e7));var _0xcf55=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xf55c[_0x220dbb];return _0x2b77de;};'use strict';var EventEmitter=require(_0xcf55('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xcf55('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xcf55('0x2')](0x0);var events={'afterCreate':_0xcf55('0x3'),'afterUpdate':_0xcf55('0x4'),'afterDestroy':_0xcf55('0x5')};function emitEvent(_0x2c24c8){return function(_0x3cd699,_0x5d1baf,_0x2bff1a){ChatGroupEvents[_0xcf55('0x6')](_0x2c24c8+':'+_0x3cd699['id'],_0x3cd699);ChatGroupEvents[_0xcf55('0x6')](_0x2c24c8,_0x3cd699);_0x2bff1a(null);};}for(var e in events){if(events[_0xcf55('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xcf55('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index f426a7a..8e52307 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 _0x76a5=['ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0xbfb72,_0x112b64){var _0x4a4476=function(_0xa544b7){while(--_0xa544b7){_0xbfb72['push'](_0xbfb72['shift']());}};_0x4a4476(++_0x112b64);}(_0x76a5,0x1a2));var _0x576a=function(_0x180216,_0x4ea427){_0x180216=_0x180216-0x0;var _0x2fc363=_0x76a5[_0x180216];return _0x2fc363;};'use strict';var _=require(_0x576a('0x0'));var util=require(_0x576a('0x1'));var logger=require(_0x576a('0x2'))(_0x576a('0x3'));var moment=require(_0x576a('0x4'));var BPromise=require(_0x576a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x576a('0x6'));var rimraf=require(_0x576a('0x7'));var config=require(_0x576a('0x8'));var attributes=require('./chatGroup.attributes');module[_0x576a('0x9')]=function(_0x2b36da,_0x1aa5f5){return _0x2b36da[_0x576a('0xa')](_0x576a('0xb'),attributes,{'tableName':_0x576a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb9dd=['exports','define','ChatGroup','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes'];(function(_0x10e31a,_0x6a302d){var _0xa3e8a0=function(_0x581919){while(--_0x581919){_0x10e31a['push'](_0x10e31a['shift']());}};_0xa3e8a0(++_0x6a302d);}(_0xb9dd,0x16f));var _0xdb9d=function(_0x13035d,_0x15a2a8){_0x13035d=_0x13035d-0x0;var _0x3ae36d=_0xb9dd[_0x13035d];return _0x3ae36d;};'use strict';var _=require(_0xdb9d('0x0'));var util=require(_0xdb9d('0x1'));var logger=require(_0xdb9d('0x2'))(_0xdb9d('0x3'));var moment=require(_0xdb9d('0x4'));var BPromise=require(_0xdb9d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb9d('0x6'));var rimraf=require(_0xdb9d('0x7'));var config=require(_0xdb9d('0x8'));var attributes=require(_0xdb9d('0x9'));module[_0xdb9d('0xa')]=function(_0x2d4bcc,_0x1fce08){return _0x2d4bcc[_0xdb9d('0xb')](_0xdb9d('0xc'),attributes,{'tableName':'chat_groups','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 16c7b40..deb7fcf 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 _0x0298=['request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','request','then','info'];(function(_0x56c1ab,_0x100638){var _0x564b35=function(_0x49927e){while(--_0x49927e){_0x56c1ab['push'](_0x56c1ab['shift']());}};_0x564b35(++_0x100638);}(_0x0298,0x95));var _0x8029=function(_0x14f41c,_0x3becf3){_0x14f41c=_0x14f41c-0x0;var _0x18fcd8=_0x0298[_0x14f41c];return _0x18fcd8;};'use strict';var _=require(_0x8029('0x0'));var util=require('util');var moment=require(_0x8029('0x1'));var BPromise=require(_0x8029('0x2'));var rs=require(_0x8029('0x3'));var fs=require('fs');var Redis=require(_0x8029('0x4'));var db=require(_0x8029('0x5'))['db'];var utils=require(_0x8029('0x6'));var logger=require(_0x8029('0x7'))(_0x8029('0x8'));var config=require(_0x8029('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8029('0xa')][_0x8029('0xb')]({'port':0x232a});config['redis']=_[_0x8029('0xc')](config[_0x8029('0xd')],{'host':_0x8029('0xe'),'port':0x18eb});var socket=require(_0x8029('0xf'))(new Redis(config[_0x8029('0xd')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x1a94ef,_0x1b93b9,_0x288b07){return new BPromise(function(_0x4ebfb4,_0x56e850){return client[_0x8029('0x10')](_0x1a94ef,_0x288b07)[_0x8029('0x11')](function(_0x4943a3){logger[_0x8029('0x12')]('ChatGroup,\x20%s,\x20%s',_0x1b93b9,_0x8029('0x13'));logger[_0x8029('0x14')](_0x8029('0x15'),_0x1b93b9,_0x8029('0x13'),JSON[_0x8029('0x16')](_0x4943a3));if(_0x4943a3[_0x8029('0x17')]){if(_0x4943a3['error'][_0x8029('0x18')]===0x1f4){logger[_0x8029('0x17')](_0x8029('0x19'),_0x1b93b9,_0x4943a3[_0x8029('0x17')]['message']);return _0x56e850(_0x4943a3['error']['message']);}logger[_0x8029('0x17')](_0x8029('0x19'),_0x1b93b9,_0x4943a3[_0x8029('0x17')][_0x8029('0x1a')]);return _0x4ebfb4(_0x4943a3[_0x8029('0x17')][_0x8029('0x1a')]);}else{logger['info'](_0x8029('0x19'),_0x1b93b9,_0x8029('0x13'));_0x4ebfb4(_0x4943a3[_0x8029('0x1b')][_0x8029('0x1a')]);}})['catch'](function(_0x3e3ab2){logger[_0x8029('0x17')]('ChatGroup,\x20%s,\x20%s',_0x1b93b9,_0x3e3ab2);_0x56e850(_0x3e3ab2);});});}
\ No newline at end of file
+var _0x34d2=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment'];(function(_0x2f6d5c,_0x3d1c70){var _0xbc4e8=function(_0x273a34){while(--_0x273a34){_0x2f6d5c['push'](_0x2f6d5c['shift']());}};_0xbc4e8(++_0x3d1c70);}(_0x34d2,0x7b));var _0x234d=function(_0x2d2846,_0x21c4b7){_0x2d2846=_0x2d2846-0x0;var _0x4ecb5b=_0x34d2[_0x2d2846];return _0x4ecb5b;};'use strict';var _=require('lodash');var util=require(_0x234d('0x0'));var moment=require(_0x234d('0x1'));var BPromise=require(_0x234d('0x2'));var rs=require(_0x234d('0x3'));var fs=require('fs');var Redis=require(_0x234d('0x4'));var db=require(_0x234d('0x5'))['db'];var utils=require(_0x234d('0x6'));var logger=require(_0x234d('0x7'))('rpc');var config=require(_0x234d('0x8'));var jayson=require(_0x234d('0x9'));var client=jayson['client'][_0x234d('0xa')]({'port':0x232a});config[_0x234d('0xb')]=_[_0x234d('0xc')](config[_0x234d('0xb')],{'host':_0x234d('0xd'),'port':0x18eb});var socket=require(_0x234d('0xe'))(new Redis(config[_0x234d('0xb')]));require(_0x234d('0xf'))['register'](socket);function respondWithRpcPromise(_0x5d25c9,_0x4d8b16,_0x4f6810){return new BPromise(function(_0x50fdaa,_0x48d44e){return client['request'](_0x5d25c9,_0x4f6810)['then'](function(_0x3ed84f){logger[_0x234d('0x10')](_0x234d('0x11'),_0x4d8b16,_0x234d('0x12'));logger[_0x234d('0x13')](_0x234d('0x14'),_0x4d8b16,'request\x20sent',JSON['stringify'](_0x3ed84f));if(_0x3ed84f['error']){if(_0x3ed84f['error']['code']===0x1f4){logger['error'](_0x234d('0x11'),_0x4d8b16,_0x3ed84f[_0x234d('0x15')][_0x234d('0x16')]);return _0x48d44e(_0x3ed84f['error'][_0x234d('0x16')]);}logger[_0x234d('0x15')](_0x234d('0x11'),_0x4d8b16,_0x3ed84f['error']['message']);return _0x50fdaa(_0x3ed84f['error']['message']);}else{logger[_0x234d('0x10')](_0x234d('0x11'),_0x4d8b16,_0x234d('0x12'));_0x50fdaa(_0x3ed84f[_0x234d('0x17')][_0x234d('0x16')]);}})[_0x234d('0x18')](function(_0x2b4ed2){logger[_0x234d('0x15')](_0x234d('0x11'),_0x4d8b16,_0x2b4ed2);_0x48d44e(_0x2b4ed2);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index c84b88f..87827af 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 _0x36dd=['save','remove','update','register','length','./chatGroup.events'];(function(_0x2b6e53,_0x4ed0d2){var _0x35bab1=function(_0x138843){while(--_0x138843){_0x2b6e53['push'](_0x2b6e53['shift']());}};_0x35bab1(++_0x4ed0d2);}(_0x36dd,0x1f1));var _0xd36d=function(_0x479160,_0x3ab560){_0x479160=_0x479160-0x0;var _0x47ac6d=_0x36dd[_0x479160];return _0x47ac6d;};'use strict';var ChatGroupEvents=require(_0xd36d('0x0'));var events=[_0xd36d('0x1'),_0xd36d('0x2'),_0xd36d('0x3')];function createListener(_0x1ac633,_0x2ea9bc){return function(_0x3de051){_0x2ea9bc['emit'](_0x1ac633,_0x3de051);};}function removeListener(_0x10e576,_0x462d98){return function(){ChatGroupEvents['removeListener'](_0x10e576,_0x462d98);};}exports[_0xd36d('0x4')]=function(_0x55a41f){for(var _0x1a937c=0x0,_0x3a7afd=events[_0xd36d('0x5')];_0x1a937c<_0x3a7afd;_0x1a937c++){var _0x1e06c6=events[_0x1a937c];var _0x239b84=createListener('chatGroup:'+_0x1e06c6,_0x55a41f);ChatGroupEvents['on'](_0x1e06c6,_0x239b84);}};
\ No newline at end of file
+var _0xe9c0=['chatGroup:','./chatGroup.events','emit','removeListener','register','length'];(function(_0x1d13b4,_0x49e300){var _0x29059e=function(_0x74e05c){while(--_0x74e05c){_0x1d13b4['push'](_0x1d13b4['shift']());}};_0x29059e(++_0x49e300);}(_0xe9c0,0xaf));var _0x0e9c=function(_0x13c729,_0x5bea49){_0x13c729=_0x13c729-0x0;var _0x3673c5=_0xe9c0[_0x13c729];return _0x3673c5;};'use strict';var ChatGroupEvents=require(_0x0e9c('0x0'));var events=['save','remove','update'];function createListener(_0x2752b5,_0x8f5833){return function(_0x14b5aa){_0x8f5833[_0x0e9c('0x1')](_0x2752b5,_0x14b5aa);};}function removeListener(_0x44024b,_0xd1b8){return function(){ChatGroupEvents[_0x0e9c('0x2')](_0x44024b,_0xd1b8);};}exports[_0x0e9c('0x3')]=function(_0x526c98){for(var _0x27335d=0x0,_0x214160=events[_0x0e9c('0x4')];_0x27335d<_0x214160;_0x27335d++){var _0x3a2bc7=events[_0x27335d];var _0x4ad6ee=createListener(_0x0e9c('0x5')+_0x3a2bc7,_0x526c98);ChatGroupEvents['on'](_0x3a2bc7,_0x4ad6ee);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 2bb5bdb..ae3558c 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 _0x3aac=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','post','/:id/members','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0x3aac,0x1bb));var _0xc3aa=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3aac[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc3aa('0x0'));var timeout=require(_0xc3aa('0x1'));var express=require(_0xc3aa('0x2'));var router=express[_0xc3aa('0x3')]();var fs_extra=require(_0xc3aa('0x4'));var auth=require(_0xc3aa('0x5'));var interaction=require(_0xc3aa('0x6'));var config=require(_0xc3aa('0x7'));var controller=require('./chatGroup.controller');router[_0xc3aa('0x8')]('/',auth[_0xc3aa('0x9')](),controller[_0xc3aa('0xa')]);router[_0xc3aa('0x8')](_0xc3aa('0xb'),auth['isAuthenticated'](),controller[_0xc3aa('0xc')]);router[_0xc3aa('0x8')](_0xc3aa('0xd'),auth[_0xc3aa('0x9')](),controller[_0xc3aa('0xe')]);router[_0xc3aa('0x8')](_0xc3aa('0xf'),auth[_0xc3aa('0x9')](),controller[_0xc3aa('0x10')]);router[_0xc3aa('0x8')]('/:id/members',auth[_0xc3aa('0x9')](),controller[_0xc3aa('0x11')]);router[_0xc3aa('0x8')](_0xc3aa('0x12'),auth['isAuthenticated'](),controller[_0xc3aa('0x13')]);router[_0xc3aa('0x14')]('/',auth[_0xc3aa('0x9')](),controller['create']);router[_0xc3aa('0x14')](_0xc3aa('0x15'),auth[_0xc3aa('0x9')](),controller[_0xc3aa('0x16')]);router[_0xc3aa('0x14')](_0xc3aa('0x12'),auth[_0xc3aa('0x9')](),controller[_0xc3aa('0x17')]);router[_0xc3aa('0x18')](_0xc3aa('0xd'),auth[_0xc3aa('0x9')](),controller[_0xc3aa('0x19')]);router[_0xc3aa('0x1a')]('/:id',auth[_0xc3aa('0x9')](),controller[_0xc3aa('0x1b')]);router[_0xc3aa('0x1a')](_0xc3aa('0x15'),auth[_0xc3aa('0x9')](),controller[_0xc3aa('0x1c')]);module[_0xc3aa('0x1d')]=router;
\ No newline at end of file
+var _0xbeec=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','index','/describe','/:id','isAuthenticated','show','getUnread','/:id/members','/:id/messages','getMessages','post','create','addMembers','put'];(function(_0x41d2d4,_0x12bcf4){var _0x225e0f=function(_0x8464f5){while(--_0x8464f5){_0x41d2d4['push'](_0x41d2d4['shift']());}};_0x225e0f(++_0x12bcf4);}(_0xbeec,0x122));var _0xcbee=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbeec[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xcbee('0x0'));var util=require(_0xcbee('0x1'));var path=require(_0xcbee('0x2'));var timeout=require(_0xcbee('0x3'));var express=require(_0xcbee('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcbee('0x5'));var interaction=require(_0xcbee('0x6'));var config=require('../../config/environment');var controller=require(_0xcbee('0x7'));router[_0xcbee('0x8')]('/',auth['isAuthenticated'](),controller[_0xcbee('0x9')]);router['get'](_0xcbee('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xcbee('0x8')](_0xcbee('0xb'),auth[_0xcbee('0xc')](),controller[_0xcbee('0xd')]);router[_0xcbee('0x8')]('/:id/unread',auth['isAuthenticated'](),controller[_0xcbee('0xe')]);router['get'](_0xcbee('0xf'),auth[_0xcbee('0xc')](),controller['getMembers']);router[_0xcbee('0x8')](_0xcbee('0x10'),auth[_0xcbee('0xc')](),controller[_0xcbee('0x11')]);router[_0xcbee('0x12')]('/',auth[_0xcbee('0xc')](),controller[_0xcbee('0x13')]);router[_0xcbee('0x12')]('/:id/members',auth[_0xcbee('0xc')](),controller[_0xcbee('0x14')]);router[_0xcbee('0x12')](_0xcbee('0x10'),auth[_0xcbee('0xc')](),controller['addMessage']);router[_0xcbee('0x15')](_0xcbee('0xb'),auth[_0xcbee('0xc')](),controller[_0xcbee('0x16')]);router[_0xcbee('0x17')](_0xcbee('0xb'),auth[_0xcbee('0xc')](),controller[_0xcbee('0x18')]);router['delete'](_0xcbee('0xf'),auth['isAuthenticated'](),controller['removeMembers']);module[_0xcbee('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index fa3fb2b..b27a3fb 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 _0x1678=['exports','BOOLEAN','INTEGER','ENUM','star','TEXT','STRING','DATE','long','sequelize'];(function(_0x35007a,_0x58a0d4){var _0x574f68=function(_0xd1c129){while(--_0xd1c129){_0x35007a['push'](_0x35007a['shift']());}};_0x574f68(++_0x58a0d4);}(_0x1678,0x17b));var _0x8167=function(_0x17a09d,_0x1ed2f1){_0x17a09d=_0x17a09d-0x0;var _0x31a422=_0x1678[_0x17a09d];return _0x31a422;};'use strict';var Sequelize=require(_0x8167('0x0'));module[_0x8167('0x1')]={'closed':{'type':Sequelize[_0x8167('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8167('0x3')]},'ratingType':{'type':Sequelize[_0x8167('0x4')]('star','thumb'),'defaultValue':_0x8167('0x5')},'ratingMessage':{'type':Sequelize[_0x8167('0x6')]},'pathTranscript':{'type':Sequelize[_0x8167('0x6')]},'mailTranscript':{'type':Sequelize[_0x8167('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8167('0x8')]},'disposition':{'type':Sequelize[_0x8167('0x7')]},'secondDisposition':{'type':Sequelize[_0x8167('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x8167('0x7')]},'browserName':{'type':Sequelize[_0x8167('0x7')]},'browserVersion':{'type':Sequelize[_0x8167('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x8167('0x7')]},'deviceVendor':{'type':Sequelize[_0x8167('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x8167('0x6')]},'customerIp':{'type':Sequelize[_0x8167('0x7')]},'formData':{'type':Sequelize[_0x8167('0x6')](_0x8167('0x9'))},'read1stAt':{'type':Sequelize[_0x8167('0x8')]},'lastMsgAt':{'type':Sequelize[_0x8167('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x8167('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x8167('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x8167('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x49f8=['long','DATE','BOOLEAN','sequelize','INTEGER','ENUM','thumb','TEXT','STRING'];(function(_0x486043,_0x58dad9){var _0x2c0a3b=function(_0x2bad97){while(--_0x2bad97){_0x486043['push'](_0x486043['shift']());}};_0x2c0a3b(++_0x58dad9);}(_0x49f8,0xff));var _0x849f=function(_0x9b6cd6,_0x360ac0){_0x9b6cd6=_0x9b6cd6-0x0;var _0x7c35a2=_0x49f8[_0x9b6cd6];return _0x7c35a2;};'use strict';var Sequelize=require(_0x849f('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x849f('0x1')]},'ratingType':{'type':Sequelize[_0x849f('0x2')]('star',_0x849f('0x3')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x849f('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x849f('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x849f('0x5')]},'secondDisposition':{'type':Sequelize[_0x849f('0x5')]},'thirdDisposition':{'type':Sequelize[_0x849f('0x5')]},'note':{'type':Sequelize[_0x849f('0x5')]},'browserName':{'type':Sequelize[_0x849f('0x5')]},'browserVersion':{'type':Sequelize[_0x849f('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x849f('0x5')]},'deviceType':{'type':Sequelize[_0x849f('0x5')]},'referer':{'type':Sequelize[_0x849f('0x4')]},'customerIp':{'type':Sequelize[_0x849f('0x5')]},'formData':{'type':Sequelize[_0x849f('0x4')](_0x849f('0x6'))},'read1stAt':{'type':Sequelize[_0x849f('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x849f('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x849f('0x5')]},'customerPort':{'type':Sequelize[_0x849f('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x849f('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x849f('0x8')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 0d5c816..25ecd3d 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 _0xfa91=['files','tmp','attachments','lastName','Attachment','read','Account','Owner','get','mkdirSync','Chat','toString','closedAt','disposition','browserName','osName','referer','customerIp','tail','createReadStream','pipe','firstName','value','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','name','send','render','merge','body','contact','agent','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','show','params','model','keys','query','intersection','attributes','fields','length','include','options','create','find','describe','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','user','fullname','email','POST','vidaooNote','follow','isNull','parse','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','CmContact','ContactId','UserId','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','filters','hasOwnProperty','nolimit','order','sort','pick','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','getMyMessages','includeAgent','push','addTags','setTags','omit','Tag','color','emit','removeTags','unix','server'];(function(_0x261d17,_0x115fe1){var _0x5a50da=function(_0x409fc0){while(--_0x409fc0){_0x261d17['push'](_0x261d17['shift']());}};_0x5a50da(++_0x115fe1);}(_0xfa91,0x1cd));var _0x1fa9=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xfa91[_0x465a0c];return _0x1e202e;};'use strict';var rimraf=require(_0x1fa9('0x0'));var zipdir=require(_0x1fa9('0x1'));var rp=require(_0x1fa9('0x2'));var moment=require(_0x1fa9('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1fa9('0x4'));var path=require(_0x1fa9('0x5'));var ejs=require(_0x1fa9('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x1fa9('0x7'));var interaction=require(_0x1fa9('0x8'));var qs=require(_0x1fa9('0x9'));var pdf=require(_0x1fa9('0xa'));var logger=require(_0x1fa9('0xb'))(_0x1fa9('0xc'));var config=require(_0x1fa9('0xd'));var db=require(_0x1fa9('0xe'))['db'];config[_0x1fa9('0xf')]=_['defaults'](config['redis'],{'host':_0x1fa9('0x10'),'port':0x18eb});var socket=require(_0x1fa9('0x11'))(new Redis(config['redis']));require(_0x1fa9('0x12'))[_0x1fa9('0x13')](socket);var jayson=require(_0x1fa9('0x14'));var client=jayson['client'][_0x1fa9('0x15')]({'port':0x232b});var client9004=jayson[_0x1fa9('0x16')][_0x1fa9('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x5bc1cf,_0x1e61bd,_0x18c54f,_0x27208c){return new BPromise(function(_0x7d865f,_0x38eb26){var _0x37cc46=_0x27208c||client;return _0x37cc46[_0x1fa9('0x17')](_0x5bc1cf,_0x18c54f)[_0x1fa9('0x18')](function(_0x28fd97){logger[_0x1fa9('0x19')](_0x1fa9('0x1a'),_0x1e61bd,_0x1fa9('0x1b'));logger[_0x1fa9('0x1c')](_0x1fa9('0x1d'),_0x1e61bd,_0x1fa9('0x1b'),JSON[_0x1fa9('0x1e')](_0x28fd97));if(_0x28fd97[_0x1fa9('0x1f')]){if(_0x28fd97[_0x1fa9('0x1f')][_0x1fa9('0x20')]===0x1f4){logger['error'](_0x1fa9('0x1a'),_0x1e61bd,_0x28fd97[_0x1fa9('0x1f')][_0x1fa9('0x21')]);return _0x38eb26(_0x28fd97[_0x1fa9('0x1f')][_0x1fa9('0x21')]);}logger[_0x1fa9('0x1f')]('ChatInteraction,\x20%s,\x20%s',_0x1e61bd,_0x28fd97[_0x1fa9('0x1f')]['message']);return _0x7d865f(_0x28fd97[_0x1fa9('0x1f')]['message']);}else{logger[_0x1fa9('0x19')](_0x1fa9('0x1a'),_0x1e61bd,_0x1fa9('0x1b'));_0x7d865f(_0x28fd97[_0x1fa9('0x22')][_0x1fa9('0x21')]);}})[_0x1fa9('0x23')](function(_0x5419b3){logger[_0x1fa9('0x1f')](_0x1fa9('0x1a'),_0x1e61bd,_0x5419b3);_0x38eb26(_0x5419b3);});});}function respondWithStatusCode(_0x451dc8,_0x153b94){_0x153b94=_0x153b94||0xcc;return function(_0xdbead7){if(_0xdbead7){return _0x451dc8[_0x1fa9('0x24')](_0x153b94);}return _0x451dc8[_0x1fa9('0x25')](_0x153b94)[_0x1fa9('0x26')]();};}function respondWithResult(_0x5a5dad,_0x3d8ff6){_0x3d8ff6=_0x3d8ff6||0xc8;return function(_0x24234f){if(_0x24234f){return _0x5a5dad[_0x1fa9('0x25')](_0x3d8ff6)[_0x1fa9('0x27')](_0x24234f);}};}function respondWithFilteredResult(_0x311f82,_0x3ad311){return function(_0x32fd3a){if(_0x32fd3a){var _0x4d86d8=typeof _0x3ad311[_0x1fa9('0x28')]===_0x1fa9('0x29')&&typeof _0x3ad311[_0x1fa9('0x2a')]===_0x1fa9('0x29');var _0x2e15d6=_0x32fd3a[_0x1fa9('0x2b')];var _0x3bbbd2=_0x4d86d8?0x0:_0x3ad311[_0x1fa9('0x28')];var _0x4532fa=_0x4d86d8?_0x32fd3a[_0x1fa9('0x2b')]:_0x3ad311[_0x1fa9('0x28')]+_0x3ad311['limit'];var _0x2e4246;if(_0x4532fa>=_0x2e15d6){_0x4532fa=_0x2e15d6;_0x2e4246=0xc8;}else{_0x2e4246=0xce;}_0x311f82[_0x1fa9('0x25')](_0x2e4246);return _0x311f82[_0x1fa9('0x2c')](_0x1fa9('0x2d'),_0x3bbbd2+'-'+_0x4532fa+'/'+_0x2e15d6)['json'](_0x32fd3a);}return null;};}function saveUpdates(_0x39267d){return function(_0x23164f){if(_0x23164f){return _0x23164f[_0x1fa9('0x2e')](_0x39267d)[_0x1fa9('0x18')](function(_0x40f21a){return _0x40f21a;});}return null;};}function removeEntity(_0x317dc2){return function(_0xe4a639){if(_0xe4a639){return _0xe4a639[_0x1fa9('0x2f')]()[_0x1fa9('0x18')](function(){_0x317dc2['status'](0xcc)[_0x1fa9('0x26')]();});}};}function handleEntityNotFound(_0x1a774f){return function(_0xf5d196){if(!_0xf5d196){_0x1a774f[_0x1fa9('0x24')](0x194);}return _0xf5d196;};}function handleError(_0x41d9ef,_0x14c0a2){_0x14c0a2=_0x14c0a2||0x1f4;return function(_0x4df67a){logger[_0x1fa9('0x1f')](_0x4df67a['stack']);if(_0x4df67a[_0x1fa9('0x30')]){delete _0x4df67a[_0x1fa9('0x30')];}_0x41d9ef[_0x1fa9('0x25')](_0x14c0a2)[_0x1fa9('0x31')](_0x4df67a);};}function getMustacheRender(_0x2d4062,_0x4c9722){return Mustache[_0x1fa9('0x32')](_0x2d4062,_[_0x1fa9('0x33')](_0x4c9722[_0x1fa9('0x34')],{'contact':_0x4c9722[_0x1fa9('0x35')],'message':_0x4c9722[_0x1fa9('0x21')],'agent':_0x4c9722[_0x1fa9('0x36')],'interaction':_0x4c9722[_0x1fa9('0x37')],'account':_0x4c9722[_0x1fa9('0x38')]}))||'';}exports[_0x1fa9('0x39')]=function(_0x40d90a,_0xa2f99c){var _0x2dcdd7={};var _0x3e4759=_[_0x1fa9('0x3a')](db[_0x1fa9('0x3b')][_0x1fa9('0x3c')],function(_0x1ade1d){return{'name':_0x1ade1d[_0x1fa9('0x3d')],'type':_0x1ade1d[_0x1fa9('0x3e')][_0x1fa9('0x3f')]};});_0x2dcdd7=qs[_0x1fa9('0x40')](_0x3e4759,_0x40d90a);return interaction[_0x1fa9('0x41')](_0x1fa9('0x42'),_0x40d90a['query'],_0x40d90a['user'],_0x2dcdd7,_0x3e4759)['then'](respondWithFilteredResult(_0xa2f99c,_0x2dcdd7))['catch'](handleError(_0xa2f99c,null));};exports[_0x1fa9('0x43')]=function(_0x917dbc,_0x5bc8cf){var _0x458a45={'raw':![],'where':{'id':_0x917dbc[_0x1fa9('0x44')]['id']}},_0x4cd237={};_0x4cd237[_0x1fa9('0x45')]=_[_0x1fa9('0x46')](db['ChatInteraction'][_0x1fa9('0x3c')]);_0x4cd237[_0x1fa9('0x47')]=_['keys'](_0x917dbc[_0x1fa9('0x47')]);_0x4cd237['filters']=_[_0x1fa9('0x48')](_0x4cd237[_0x1fa9('0x45')],_0x4cd237['query']);_0x458a45[_0x1fa9('0x49')]=_[_0x1fa9('0x48')](_0x4cd237['model'],qs[_0x1fa9('0x4a')](_0x917dbc[_0x1fa9('0x47')][_0x1fa9('0x4a')]));_0x458a45[_0x1fa9('0x49')]=_0x458a45[_0x1fa9('0x49')][_0x1fa9('0x4b')]?_0x458a45['attributes']:_0x4cd237[_0x1fa9('0x45')];if(_0x917dbc[_0x1fa9('0x47')]['includeAll']){_0x458a45[_0x1fa9('0x4c')]=[{'all':!![]}];}_0x458a45=_['merge']({},_0x458a45,_0x917dbc[_0x1fa9('0x4d')]);return db['ChatInteraction']['find'](_0x458a45)[_0x1fa9('0x18')](handleEntityNotFound(_0x5bc8cf,null))['then'](respondWithResult(_0x5bc8cf,null))[_0x1fa9('0x23')](handleError(_0x5bc8cf,null));};exports[_0x1fa9('0x4e')]=function(_0x875b,_0x1b8418){return db[_0x1fa9('0x3b')][_0x1fa9('0x4e')](_0x875b[_0x1fa9('0x34')],{})['then'](respondWithResult(_0x1b8418,0xc9))[_0x1fa9('0x23')](handleError(_0x1b8418,null));};exports['update']=function(_0x273509,_0x27da0c){if(_0x273509[_0x1fa9('0x34')]['id']){delete _0x273509['body']['id'];}return db[_0x1fa9('0x3b')]['find']({'where':{'id':_0x273509[_0x1fa9('0x44')]['id']}})[_0x1fa9('0x18')](handleEntityNotFound(_0x27da0c,null))[_0x1fa9('0x18')](saveUpdates(_0x273509[_0x1fa9('0x34')],null))[_0x1fa9('0x18')](respondWithResult(_0x27da0c,null))[_0x1fa9('0x23')](handleError(_0x27da0c,null));};exports['destroy']=function(_0xb00fb5,_0x2acccf){return db[_0x1fa9('0x3b')][_0x1fa9('0x4f')]({'where':{'id':_0xb00fb5[_0x1fa9('0x44')]['id']}})[_0x1fa9('0x18')](handleEntityNotFound(_0x2acccf,null))[_0x1fa9('0x18')](removeEntity(_0x2acccf,null))['catch'](handleError(_0x2acccf,null));};exports[_0x1fa9('0x50')]=function(_0x449e3e,_0x5497ea){return db['ChatInteraction'][_0x1fa9('0x50')]()[_0x1fa9('0x18')](respondWithResult(_0x5497ea,null))['catch'](handleError(_0x5497ea,null));};exports['createVidaooSession']=function(_0x4d6a6e,_0x226bb5){var _0x810053=_0x4d6a6e['params']['id'];var _0x2ba742;var _0x85d52;var _0x23ee2c;return db['ChatInteraction'][_0x1fa9('0x51')]({'where':{'id':_0x810053}})['then'](function(_0xa9c1ad){_0x2ba742=_0xa9c1ad;return db['ChatWebsite'][_0x1fa9('0x51')]({'where':{'id':_0xa9c1ad[_0x1fa9('0x52')]},'attributes':['id',_0x1fa9('0x53'),_0x1fa9('0x54'),_0x1fa9('0x55'),'vidaooNote',_0x1fa9('0x56')],'raw':!![]});})[_0x1fa9('0x18')](function(_0x607e84){if(_0x607e84&&_0x607e84['vidaooApiKey']&&_0x607e84[_0x1fa9('0x54')]){_0x85d52=_0x607e84;var _0x1f7ddf={'interaction':{'id':_0x810053},'agent':{'id':_0x4d6a6e['user']['id'],'name':_0x4d6a6e['user'][_0x1fa9('0x30')],'fullname':_0x4d6a6e[_0x1fa9('0x57')][_0x1fa9('0x58')],'email':_0x4d6a6e[_0x1fa9('0x57')][_0x1fa9('0x59')]},'contact':_0x4d6a6e[_0x1fa9('0x34')][_0x1fa9('0x35')],'account':_0x4d6a6e[_0x1fa9('0x34')][_0x1fa9('0x38')]};var _0x1931a8={'rejectUnauthorized':![],'method':_0x1fa9('0x5a'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x607e84[_0x1fa9('0x53')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4d6a6e[_0x1fa9('0x57')]['email']],'buttons':null,'topic':_0x85d52[_0x1fa9('0x55')],'note':_['isNull'](_0x85d52['vidaooNote'])?null:getMustacheRender(_0x85d52[_0x1fa9('0x5b')],_0x1f7ddf),'metadata':null},'redirect':_0x1fa9('0x5c'),'json':!![]};try{if(!_[_0x1fa9('0x5d')](_0x85d52[_0x1fa9('0x56')])){var _0xd109b2=getMustacheRender(_0x85d52[_0x1fa9('0x56')],_0x1f7ddf);var _0x5e443d=JSON[_0x1fa9('0x5e')](_0xd109b2);_0x1931a8[_0x1fa9('0x34')][_0x1fa9('0x5f')]=_0x5e443d;}}catch(_0x2175e1){throw new db['Sequelize'][(_0x1fa9('0x60'))](_0x1fa9('0x61'));}return rp(_0x1931a8);}else{throw new db[(_0x1fa9('0x62'))][(_0x1fa9('0x60'))](_0x1fa9('0x63'));}})[_0x1fa9('0x18')](function(_0x4d7290){_0x23ee2c=_0x4d7290;if(_0x23ee2c['id']){var _0x580242={'body':_0x23ee2c['join_url'],'ChatWebsiteId':_0x85d52['id'],'ChatInteractionId':_0x2ba742['id'],'direction':_0x1fa9('0x64'),'UserId':_0x4d6a6e[_0x1fa9('0x57')]['id']};return db[_0x1fa9('0x65')][_0x1fa9('0x4e')](_0x580242,{});}else{throw new db[(_0x1fa9('0x62'))][(_0x1fa9('0x60'))](_0x1fa9('0x66'));}})[_0x1fa9('0x18')](function(){return _0x2ba742[_0x1fa9('0x67')]({'vidaooSessionId':_0x23ee2c['id']});})['then'](respondWithResult(_0x226bb5,null))[_0x1fa9('0x23')](handleError(_0x226bb5,null));};exports[_0x1fa9('0x68')]=function(_0x2077c6,_0x4e9494){if(_0x2077c6[_0x1fa9('0x34')]['id']){delete _0x2077c6[_0x1fa9('0x34')]['id'];}return db[_0x1fa9('0x3b')][_0x1fa9('0x4f')]({'where':{'id':_0x2077c6[_0x1fa9('0x44')]['id']},'include':[{'model':db['CmContact'],'as':_0x1fa9('0x69')}]})['then'](handleEntityNotFound(_0x4e9494,null))[_0x1fa9('0x18')](saveUpdates(_0x2077c6[_0x1fa9('0x34')],null))['then'](respondWithResult(_0x4e9494,null))['catch'](handleError(_0x4e9494,null));};exports['abandon']=function(_0x4736c1,_0x47774c){if(_0x4736c1['body']['id']){delete _0x4736c1['body']['id'];}return db[_0x1fa9('0x3b')][_0x1fa9('0x4f')]({'where':{'id':_0x4736c1[_0x1fa9('0x44')]['id']}})[_0x1fa9('0x18')](function(_0x516ecc){if(!_0x516ecc){logger['error'](_0x1fa9('0x6a'),_0x1fa9('0x6b'),0x194,'entity\x20not\x20found');_0x47774c[_0x1fa9('0x24')](0x194);}else{if(_0x516ecc['UserId']){throw new db[(_0x1fa9('0x62'))][(_0x1fa9('0x60'))](_0x1fa9('0x6c'));}}return _0x516ecc;})[_0x1fa9('0x18')](function(_0x514cc0){if(_0x514cc0){return _0x514cc0['update']({'closed':_0x4736c1['body'][_0x1fa9('0x6d')],'disposition':_0x4736c1[_0x1fa9('0x34')]['disposition']})['then'](function(_0x51053f){return _0x51053f;});}})[_0x1fa9('0x18')](function(){return respondWithRpcPromise(_0x1fa9('0x6e'),_0x1fa9('0x6b'),_0x4736c1[_0x1fa9('0x34')],client9004);})['then'](respondWithResult(_0x47774c,null))[_0x1fa9('0x23')](handleError(_0x47774c,null));};exports[_0x1fa9('0x6f')]=function(_0x17ffa8,_0x5bb0db){_0x17ffa8[_0x1fa9('0x34')]['name']=_0x17ffa8[_0x1fa9('0x70')][_0x1fa9('0x71')];_0x17ffa8[_0x1fa9('0x34')][_0x1fa9('0x72')]=_0x17ffa8[_0x1fa9('0x70')]['filename'];_0x17ffa8['body'][_0x1fa9('0x3e')]=_0x17ffa8[_0x1fa9('0x70')]['mimetype'];return db['Attachment'][_0x1fa9('0x4e')](_0x17ffa8[_0x1fa9('0x34')])['then'](respondWithResult(_0x5bb0db,0xc9))[_0x1fa9('0x23')](handleError(_0x5bb0db,null));};exports[_0x1fa9('0x73')]=function(_0x4ca258,_0x1003d6){return db[_0x1fa9('0x3b')][_0x1fa9('0x51')]({'where':{'id':_0x4ca258[_0x1fa9('0x44')]['id']},'raw':!![]})[_0x1fa9('0x18')](handleEntityNotFound(_0x1003d6,null))['then'](function(_0x52ecf0){if(_0x52ecf0){if(_0x52ecf0[_0x1fa9('0x6d')]){return _0x1003d6[_0x1fa9('0x25')](0x193)[_0x1fa9('0x27')]({'status':0x193,'message':_0x1fa9('0x74')});}return db['Attachment'][_0x1fa9('0x51')]({'where':{'id':_0x4ca258[_0x1fa9('0x47')]['attachId']},'raw':!![]})[_0x1fa9('0x18')](handleEntityNotFound(_0x1003d6,null));}})[_0x1fa9('0x18')](function(_0x3ae33a){if(_0x3ae33a){var _0x2c84ff=_0x3ae33a[_0x1fa9('0x75')]!==null;var _0x36a468=path[_0x1fa9('0x76')](config['root'],_0x1fa9('0x77'));if(_0x2c84ff){_0x36a468=path['join'](_0x36a468,_0x1fa9('0x78'));}var _0x1222e3=path[_0x1fa9('0x76')](_0x36a468,_0x3ae33a['basename']);return _0x1003d6[_0x1fa9('0x79')](_0x1222e3);}})[_0x1fa9('0x23')](handleError(_0x1003d6,null));};exports[_0x1fa9('0x7a')]=function(_0x319907,_0x19eae0){var _0x351029=null;var _0x3de2ec=null;var _0x39b8e4=null;if(_0x319907[_0x1fa9('0x34')]['id']){delete _0x319907[_0x1fa9('0x34')]['id'];}if(_0x319907[_0x1fa9('0x34')][_0x1fa9('0x7b')]){_0x39b8e4=path[_0x1fa9('0x76')](config[_0x1fa9('0x7c')],_0x1fa9('0x7d'),util[_0x1fa9('0x7e')](_0x1fa9('0x7f'),Date[_0x1fa9('0x80')]()));_0x319907[_0x1fa9('0x34')][_0x1fa9('0x81')]=_0x39b8e4;}return db['ChatInteraction']['find']({'where':{'id':_0x319907[_0x1fa9('0x44')]['id']},'include':[{'model':db[_0x1fa9('0x65')],'as':_0x1fa9('0x82'),'include':[{'model':db[_0x1fa9('0x83')],'as':_0x1fa9('0x83')}]}]})['then'](handleEntityNotFound(_0x19eae0,null))['then'](saveUpdates(_0x319907[_0x1fa9('0x34')],null))[_0x1fa9('0x18')](function(_0x34c1a6){if(_0x34c1a6){_0x351029=_0x34c1a6;return db['ChatWebsite'][_0x1fa9('0x4f')]({'where':{'id':_0x351029['ChatWebsiteId']}});}})[_0x1fa9('0x18')](function(_0x153ccd){if(_0x153ccd){_0x3de2ec=_0x153ccd;return db[_0x1fa9('0x84')][_0x1fa9('0x4f')]({'where':{'id':_0x351029[_0x1fa9('0x85')]}});}})[_0x1fa9('0x18')](function(_0x476b18){if(_0x476b18){if(_0x39b8e4){var _0x2ce50a=null;for(var _0x5ca72c=0x1;_0x5ca72c<_0x351029['Messages'][_0x1fa9('0x4b')];++_0x5ca72c){_0x2ce50a=_0x351029[_0x1fa9('0x82')][_0x5ca72c];var _0x3151ae=_0x2ce50a[_0x1fa9('0x86')]?util[_0x1fa9('0x7e')](_0x1fa9('0x87'),_0x3de2ec[_0x1fa9('0x88')],_0x2ce50a[_0x1fa9('0x86')]):_0x1fa9('0x89');var _0x43d34c=_0x319907[_0x1fa9('0x34')]['customer']||util[_0x1fa9('0x7e')](_0x1fa9('0x87'),_0x1fa9('0x8a'),_0x2ce50a[_0x1fa9('0x85')]);switch(_0x3de2ec[_0x1fa9('0x8b')]){case _0x1fa9('0x8c'):_0x3151ae=_0x2ce50a[_0x1fa9('0x86')]?util['format'](_0x1fa9('0x87'),_0x3de2ec[_0x1fa9('0x88')],_0x2ce50a[_0x1fa9('0x86')]):_0x1fa9('0x89');break;case _0x1fa9('0x8d'):_0x3151ae=_0x2ce50a['UserId']?_0x2ce50a['User'][_0x1fa9('0x8e')]||_0x2ce50a[_0x1fa9('0x83')][_0x1fa9('0x58')]:_0x1fa9('0x89');break;case _0x1fa9('0x8f'):_0x3151ae=_0x2ce50a[_0x1fa9('0x86')]?_0x2ce50a[_0x1fa9('0x83')][_0x1fa9('0x58')]:_0x1fa9('0x89');break;default:_0x3151ae=_0x2ce50a['UserId']?util[_0x1fa9('0x7e')](_0x1fa9('0x87'),_0x3de2ec[_0x1fa9('0x88')],_0x2ce50a[_0x1fa9('0x86')]):_0x1fa9('0x89');}var _0x2732c5=util[_0x1fa9('0x7e')](_0x1fa9('0x90'),moment(_0x2ce50a[_0x1fa9('0x91')])[_0x1fa9('0x7e')](_0x1fa9('0x92')),_0x2ce50a[_0x1fa9('0x93')]==='in'?_0x43d34c:_0x3151ae,_0x2ce50a[_0x1fa9('0x34')]);if(!_0x2ce50a[_0x1fa9('0x94')]){fs[_0x1fa9('0x95')](_0x39b8e4,_0x2732c5);}}return db[_0x1fa9('0x96')][_0x1fa9('0x51')]({'where':{'service':!![]},'include':[{'model':db[_0x1fa9('0x97')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x1fa9('0x98'),'raw':!![]}]}]});}}})[_0x1fa9('0x18')](function(_0x336b84){if(!_0x336b84||!_0x336b84[_0x1fa9('0x99')]||!_0x319907['body'])return _0x351029;var _0x3ff20f=_0x336b84[_0x1fa9('0x9a')]();return respondWithRpcPromise(_0x1fa9('0x9b'),_0x1fa9('0x9c'),{'account':_0x3ff20f,'message':{'from':util[_0x1fa9('0x7e')]('\x22%s\x22\x20<%s>',_0x336b84[_0x1fa9('0x30')],_0x336b84[_0x1fa9('0x59')]||_0x336b84[_0x1fa9('0x99')][_0x1fa9('0x57')]),'to':_0x319907[_0x1fa9('0x34')][_0x1fa9('0x7b')],'subject':_0x1fa9('0x9d'),'text':util[_0x1fa9('0x7e')](_0x1fa9('0x9e'),_0x319907[_0x1fa9('0x34')][_0x1fa9('0x7b')]),'attachments':[{'path':_0x39b8e4}]}})[_0x1fa9('0x18')](function(){return _0x351029;})[_0x1fa9('0x23')](function(_0x32b9d1){logger[_0x1fa9('0x1f')](_0x32b9d1);});})['then'](respondWithStatusCode(_0x19eae0,0xc8))[_0x1fa9('0x23')](handleError(_0x19eae0,null));};exports[_0x1fa9('0x9f')]=function(_0x35f46f,_0x32c1db){return db[_0x1fa9('0x65')]['find']({'where':{'id':_0x35f46f[_0x1fa9('0x44')]['id']}})['then'](handleEntityNotFound(_0x32c1db,null))[_0x1fa9('0x18')](function(_0x555ee6){if(_0x555ee6){return _0x555ee6[_0x1fa9('0x9f')](_0x35f46f['body']['ids'],_['omit'](_0x35f46f['body'],[_0x1fa9('0xa0'),'id'])||{});}})[_0x1fa9('0x18')](respondWithResult(_0x32c1db,null))[_0x1fa9('0x23')](handleError(_0x32c1db,null));};exports['getMessages']=function(_0x513529,_0x71329f){var _0x592669={'raw':![],'where':{}};var _0x1e6dc9={};var _0x39cc38={'count':0x0,'rows':[]};return db[_0x1fa9('0x3b')][_0x1fa9('0x51')]({'where':{'id':_0x513529[_0x1fa9('0x44')]['id']}})[_0x1fa9('0x18')](handleEntityNotFound(_0x71329f,null))['then'](function(_0x42c533){if(_0x42c533){_0x1e6dc9[_0x1fa9('0x45')]=_[_0x1fa9('0x46')](db[_0x1fa9('0x65')][_0x1fa9('0x3c')]);_0x1e6dc9[_0x1fa9('0x47')]=_[_0x1fa9('0x46')](_0x513529[_0x1fa9('0x47')]);_0x1e6dc9[_0x1fa9('0xa1')]=_[_0x1fa9('0x48')](_0x1e6dc9[_0x1fa9('0x45')],_0x1e6dc9[_0x1fa9('0x47')]);_0x592669[_0x1fa9('0x49')]=_['intersection'](_0x1e6dc9[_0x1fa9('0x45')],qs[_0x1fa9('0x4a')](_0x513529[_0x1fa9('0x47')][_0x1fa9('0x4a')]));_0x592669[_0x1fa9('0x49')]=_0x592669[_0x1fa9('0x49')]['length']?_0x592669['attributes']:_0x1e6dc9[_0x1fa9('0x45')];if(!_0x513529[_0x1fa9('0x47')][_0x1fa9('0xa2')](_0x1fa9('0xa3'))){_0x592669[_0x1fa9('0x2a')]=qs[_0x1fa9('0x2a')](_0x513529[_0x1fa9('0x47')][_0x1fa9('0x2a')]);_0x592669[_0x1fa9('0x28')]=qs[_0x1fa9('0x28')](_0x513529[_0x1fa9('0x47')][_0x1fa9('0x28')]);}_0x592669[_0x1fa9('0xa4')]=qs[_0x1fa9('0xa5')](_0x513529['query'][_0x1fa9('0xa5')]);_0x592669['where']=qs[_0x1fa9('0xa1')](_[_0x1fa9('0xa6')](_0x513529[_0x1fa9('0x47')],_0x1e6dc9['filters']));_0x592669[_0x1fa9('0xa7')][_0x1fa9('0xa8')]=_0x42c533['id'];if(_0x513529[_0x1fa9('0x47')][_0x1fa9('0xa9')]){_0x592669['where']=_[_0x1fa9('0x33')](_0x592669['where'],{'$or':_[_0x1fa9('0x3a')](_0x592669[_0x1fa9('0x49')],function(_0x59242c){var _0x333a7e={};_0x333a7e[_0x59242c]={'$like':'%'+_0x513529['query'][_0x1fa9('0xa9')]+'%'};return _0x333a7e;})});}if(_0x513529[_0x1fa9('0x47')]['$gte']){var _0xa0cc25=_0x513529['query'][_0x1fa9('0xaa')][_0x1fa9('0xab')](',');var _0xff26af={};_0xff26af[_0xa0cc25[0x0]]={'$gte':moment(_0xa0cc25[0x1])[_0x1fa9('0x7e')](_0x1fa9('0xac'))};_0x592669[_0x1fa9('0xa7')]=_[_0x1fa9('0x33')](_0x592669['where'],_0xff26af);}_0x592669=_[_0x1fa9('0x33')]({},_0x592669,_0x513529['options']);return db[_0x1fa9('0x65')]['count']({'where':_0x592669[_0x1fa9('0xa7')]})[_0x1fa9('0x18')](function(_0x54fe4a){_0x39cc38[_0x1fa9('0x2b')]=_0x54fe4a;if(_0x513529['query'][_0x1fa9('0xad')]){_0x592669['include']=[{'all':!![]}];}return db[_0x1fa9('0x65')]['findAll'](_0x592669);})[_0x1fa9('0x18')](function(_0x3db28a){_0x39cc38[_0x1fa9('0xae')]=_0x3db28a;return _0x39cc38;});}})[_0x1fa9('0x18')](respondWithFilteredResult(_0x71329f,_0x592669))['catch'](handleError(_0x71329f,null));};exports[_0x1fa9('0xaf')]=function(_0x2ee337,_0x40bcbc){var _0x53dfc9={'where':{}},_0x47138e={},_0x2f2166={'count':0x0,'rows':[]};return db[_0x1fa9('0x3b')][_0x1fa9('0x51')]({'where':{'id':_0x2ee337[_0x1fa9('0x44')]['id']}})[_0x1fa9('0x18')](handleEntityNotFound(_0x40bcbc,null))[_0x1fa9('0x18')](function(_0x319ee6){if(_0x319ee6){_0x47138e[_0x1fa9('0x45')]=_[_0x1fa9('0x46')](db['ChatMessage']['rawAttributes']);_0x47138e['query']=_[_0x1fa9('0x46')](_0x2ee337[_0x1fa9('0x47')]);_0x47138e[_0x1fa9('0xa1')]=_[_0x1fa9('0x48')](_0x47138e[_0x1fa9('0x45')],_0x47138e[_0x1fa9('0x47')]);_0x53dfc9[_0x1fa9('0x49')]=_['intersection'](_0x47138e[_0x1fa9('0x45')],qs['fields'](_0x2ee337[_0x1fa9('0x47')]['fields']));_0x53dfc9['attributes']=_0x53dfc9['attributes'][_0x1fa9('0x4b')]?_0x53dfc9['attributes']:_0x47138e[_0x1fa9('0x45')];if(!_0x2ee337[_0x1fa9('0x47')]['hasOwnProperty']('nolimit')){_0x53dfc9['limit']=qs[_0x1fa9('0x2a')](_0x2ee337[_0x1fa9('0x47')][_0x1fa9('0x2a')]);_0x53dfc9[_0x1fa9('0x28')]=qs['offset'](_0x2ee337['query'][_0x1fa9('0x28')]);}_0x53dfc9[_0x1fa9('0xa4')]=qs[_0x1fa9('0xa5')](_0x2ee337[_0x1fa9('0x47')]['sort']);_0x53dfc9[_0x1fa9('0xa7')]=qs[_0x1fa9('0xa1')](_[_0x1fa9('0xa6')](_0x2ee337[_0x1fa9('0x47')],_0x47138e[_0x1fa9('0xa1')]));_0x53dfc9['where']['ChatInteractionId']=_0x319ee6['id'];if(_0x2ee337[_0x1fa9('0x47')][_0x1fa9('0xa9')]){_0x53dfc9[_0x1fa9('0xa7')]=_[_0x1fa9('0x33')](_0x53dfc9[_0x1fa9('0xa7')],{'$or':_[_0x1fa9('0x3a')](_0x53dfc9[_0x1fa9('0x49')],function(_0xfdb5f3){var _0x15a5c0={};_0x15a5c0[_0xfdb5f3]={'$like':'%'+_0x2ee337['query']['filter']+'%'};return _0x15a5c0;})});}_0x53dfc9[_0x1fa9('0xa7')][_0x1fa9('0x94')]=![];if(_0x2ee337[_0x1fa9('0x47')]['id']){_0x53dfc9[_0x1fa9('0xa7')]['id']={'$gt':_0x2ee337[_0x1fa9('0x47')]['id']};}_0x53dfc9=_['merge']({},_0x53dfc9,_0x2ee337[_0x1fa9('0x4d')]);return db[_0x1fa9('0x65')]['count']({'where':_0x53dfc9['where']})[_0x1fa9('0x18')](function(_0x367e3d){_0x2f2166[_0x1fa9('0x2b')]=_0x367e3d;_0x53dfc9[_0x1fa9('0x4c')]=[];if(_0x2ee337[_0x1fa9('0x47')][_0x1fa9('0xb0')]){_0x53dfc9[_0x1fa9('0x4c')][_0x1fa9('0xb1')]({'model':db[_0x1fa9('0x83')],'as':_0x1fa9('0x83'),'attributes':['id',_0x1fa9('0x58'),_0x1fa9('0x8e')]});}if(_0x2ee337[_0x1fa9('0x47')][_0x1fa9('0xad')]){_0x53dfc9[_0x1fa9('0x4c')]=[{'all':!![]}];}return db[_0x1fa9('0x65')][_0x1fa9('0x41')](_0x53dfc9);})[_0x1fa9('0x18')](function(_0x3e5380){_0x2f2166['rows']=_0x3e5380;return _0x2f2166;});}})[_0x1fa9('0x18')](respondWithFilteredResult(_0x40bcbc,_0x53dfc9))[_0x1fa9('0x23')](handleError(_0x40bcbc,null));};exports[_0x1fa9('0xb2')]=function(_0x137334,_0x56422f){return db['ChatInteraction'][_0x1fa9('0x4f')]({'where':{'id':_0x137334[_0x1fa9('0x44')]['id']}})[_0x1fa9('0x18')](handleEntityNotFound(_0x56422f,null))['then'](function(_0x56de60){if(_0x56de60){return _0x56de60[_0x1fa9('0xb3')](_0x137334[_0x1fa9('0x34')][_0x1fa9('0xa0')],_[_0x1fa9('0xb4')](_0x137334[_0x1fa9('0x34')],[_0x1fa9('0xa0'),'id'])||{})['spread'](function(){return db[_0x1fa9('0xb5')][_0x1fa9('0x41')]({'attributes':['id',_0x1fa9('0x30'),_0x1fa9('0xb6')],'where':{'id':_0x137334[_0x1fa9('0x34')][_0x1fa9('0xa0')]}});})[_0x1fa9('0x18')](function(_0x306541){socket[_0x1fa9('0xb7')]('chatInteractionTags:save',{'id':Number(_0x137334[_0x1fa9('0x44')]['id']),'tags':_0x306541||[]});return{'id':Number(_0x137334[_0x1fa9('0x44')]['id']),'tags':_0x306541||[]};});}})[_0x1fa9('0x18')](respondWithResult(_0x56422f,null))[_0x1fa9('0x23')](handleError(_0x56422f,null));};exports[_0x1fa9('0xb8')]=function(_0x481ba3,_0x115b68){return db['ChatInteraction'][_0x1fa9('0x4f')]({'where':{'id':_0x481ba3['params']['id']}})['then'](handleEntityNotFound(_0x115b68,null))[_0x1fa9('0x18')](function(_0x33dac2){if(_0x33dac2){return _0x33dac2[_0x1fa9('0xb8')](_0x481ba3['query']['ids']);}})[_0x1fa9('0x18')](respondWithStatusCode(_0x115b68,null))['catch'](handleError(_0x115b68,null));};exports[_0x1fa9('0x79')]=function(_0x29fd88,_0x5489ab){var _0x31df58=moment()[_0x1fa9('0xb9')]()['toString']();var _0x5a9db3=path[_0x1fa9('0x76')](config['root'],_0x1fa9('0xba'),_0x1fa9('0xbb'),_0x1fa9('0xbc'));var _0x3127a5=path['join'](config[_0x1fa9('0x7c')],_0x1fa9('0xba'),_0x1fa9('0xbb'),_0x1fa9('0xbd'));var _0x19678c=path[_0x1fa9('0x76')](_0x5a9db3,_0x31df58);var _0x4ecbbd=util[_0x1fa9('0x7e')]('transcript-%d-%s.zip',_0x29fd88['params']['id'],_0x31df58);var _0x3054b6=path[_0x1fa9('0x76')](_0x5a9db3,_0x4ecbbd);var _0x12a367=[];_0x12a367[_0x1fa9('0xb1')]({'model':db[_0x1fa9('0x83')],'as':_0x1fa9('0x83'),'attributes':['id',_0x1fa9('0x58')],'raw':!![]});_0x12a367['push']({'model':db[_0x1fa9('0x84')],'as':_0x1fa9('0x69'),'attributes':['id','firstName',_0x1fa9('0xbe')],'raw':!![]});if(_0x29fd88[_0x1fa9('0x47')][_0x1fa9('0xbd')]){_0x12a367[_0x1fa9('0xb1')]({'model':db['Attachment'],'as':_0x1fa9('0xbf'),'raw':!![]});}var _0x14408d=[{'model':db[_0x1fa9('0x65')],'as':'Messages','attributes':['id',_0x1fa9('0x34'),_0x1fa9('0x91'),_0x1fa9('0x93'),_0x1fa9('0x94'),_0x1fa9('0xc0')],'include':_0x12a367}];_0x14408d['push']({'model':db['ChatWebsite'],'as':_0x1fa9('0xc1'),'attributes':['id',_0x1fa9('0x30')]});_0x14408d[_0x1fa9('0xb1')]({'model':db[_0x1fa9('0x83')],'as':_0x1fa9('0xc2'),'attributes':['id',_0x1fa9('0x58')]});return db['ChatInteraction'][_0x1fa9('0x4f')]({'where':{'id':_0x29fd88['params']['id']},'include':_0x14408d})[_0x1fa9('0x18')](handleEntityNotFound(_0x5489ab,null))['then'](function(_0xcd877b){if(_0xcd877b){var _0x547de5=_0xcd877b[_0x1fa9('0xc3')]({'plain':!![]});fs[_0x1fa9('0xc4')](_0x19678c);var _0x2be029={'channel':_0x1fa9('0xc5'),'account':_0x547de5['Account'][_0x1fa9('0x30')],'agent':_0x547de5[_0x1fa9('0xc2')]?_0x547de5['Owner'][_0x1fa9('0x58')]:'N.A.','createdAt':moment(_0x547de5[_0x1fa9('0x91')])['format'](_0x1fa9('0xac'))[_0x1fa9('0xc6')](),'closedAt':_0x547de5[_0x1fa9('0x6d')]?moment(_0x547de5[_0x1fa9('0xc7')])['format'](_0x1fa9('0xac'))[_0x1fa9('0xc6')]():'','disposition':_0x547de5[_0x1fa9('0xc8')],'chatInfo':{'browser':_0x547de5[_0x1fa9('0xc9')],'os':_0x547de5[_0x1fa9('0xca')],'referer':_0x547de5[_0x1fa9('0xcb')],'customerIp':_0x547de5[_0x1fa9('0xcc')],'customerPort':_0x547de5['customerPort']?_0x547de5['customerPort']:'N.A.'},'messages':_(_0x547de5['Messages'])[_0x1fa9('0xcd')]()[_0x1fa9('0xa9')]({'secret':![]})[_0x1fa9('0x3a')](function(_0x4a1049){if(_0x4a1049[_0x1fa9('0xbf')]){var _0x55f8a6=path[_0x1fa9('0x76')](_0x3127a5,_0x4a1049[_0x1fa9('0xbf')][_0x1fa9('0x72')]);if(fs['existsSync'](_0x55f8a6)){fs[_0x1fa9('0xce')](_0x55f8a6)[_0x1fa9('0xcf')](fs['createWriteStream'](path[_0x1fa9('0x76')](_0x19678c,_0x4a1049[_0x1fa9('0xbf')][_0x1fa9('0x72')])));}}return{'date':moment(_0x4a1049[_0x1fa9('0x91')])[_0x1fa9('0x7e')]('YYYY-MM-DD\x20HH:mm:ss')[_0x1fa9('0xc6')](),'sender':_0x4a1049[_0x1fa9('0x93')]==='out'?_0x4a1049[_0x1fa9('0x83')]?_0x4a1049[_0x1fa9('0x83')][_0x1fa9('0x58')]:_0x1fa9('0x89'):_0x4a1049[_0x1fa9('0x69')][_0x1fa9('0xd0')]+(_0x4a1049['Contact'][_0x1fa9('0xbe')]?'\x20'+_0x4a1049[_0x1fa9('0x69')]['lastName']:''),'body':_0x4a1049[_0x1fa9('0xbf')]?_0x4a1049[_0x1fa9('0xbf')][_0x1fa9('0x72')]:_0x4a1049[_0x1fa9('0x34')],'direction':_0x4a1049['direction']==='out'?'A':'C','secret':_0x4a1049['secret'],'read':_0x4a1049[_0x1fa9('0xc0')],'attachment':_0x4a1049[_0x1fa9('0xbf')]};})[_0x1fa9('0xd1')]()};return ejs[_0x1fa9('0xd2')](path[_0x1fa9('0x76')](config['root'],_0x1fa9('0xba'),'views',_0x1fa9('0xd3')),{'interaction':_0x2be029})[_0x1fa9('0x18')](function(_0x56907a){var _0x1d267b=path['join'](_0x19678c,'transcript-'+_0x547de5['id']+'-'+_0x31df58+_0x1fa9('0xd4'));var _0x445107={'path':_0x1d267b,'channel':_0x1fa9('0xc5'),'interactionId':_0x547de5['id']};return pdf[_0x1fa9('0xd5')](_0x56907a,_0x445107);})[_0x1fa9('0x18')](function(){return new Promise(function(_0x494114,_0x912e5a){zipdir(_0x19678c,{'saveTo':_0x3054b6},function(_0x13479e,_0x1e5bf3){if(_0x13479e)return _0x912e5a(_0x13479e);return _0x494114(_0x1e5bf3);});})['then'](function(){return new BPromise(function(_0x40ca14,_0x1d4c7a){rimraf(_0x19678c,function(_0x4771e2){if(_0x4771e2)_0x1d4c7a(_0x4771e2);return _0x40ca14();});});})[_0x1fa9('0x18')](function(){return _0x5489ab[_0x1fa9('0x79')](_0x3054b6,_0x4ecbbd,function(_0x25ac70){if(_0x25ac70){logger[_0x1fa9('0x1f')](_0x1fa9('0xd6'),_0x25ac70);}else{fs[_0x1fa9('0xd7')](_0x3054b6);}});});});}else{return _0x5489ab[_0x1fa9('0x24')](0xc8);}})[_0x1fa9('0x23')](handleError(_0x5489ab,null));};
\ No newline at end of file
+var _0x4169=['catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','destroy','stack','name','send','render','merge','index','map','ChatInteraction','rawAttributes','fieldName','type','key','findAll','query','user','params','model','keys','filters','intersection','fields','attributes','length','includeAll','include','find','create','update','body','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','fullname','email','account','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','follow','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','closed','disposition','attachmentUpload','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','root','server/files/chat/upload/','transcript-%s.txt','now','Messages','User','ContactId','format','%s%d','System','customer','Visitor','agentIdentifier','agentAlias','agent_alias','alias','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','rows','includeAgent','push','addTags','omit','spread','Tag','color','emit','chatInteractionTags:save','removeTags','toString','files','server','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','request-promise','moment','path','ioredis','../../components/interaction/service','../../config/logger','api','../../config/environment','defaults','localhost','redis','register','jayson/promise','client','http','request','then','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','ChatInteraction,\x20%s,\x20%s','info','result'];(function(_0x22ee1e,_0x3eff80){var _0x49a5c9=function(_0x373480){while(--_0x373480){_0x22ee1e['push'](_0x22ee1e['shift']());}};_0x49a5c9(++_0x3eff80);}(_0x4169,0xab));var _0x9416=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4169[_0x321bb2];return _0x9c12ed;};'use strict';var rimraf=require(_0x9416('0x0'));var zipdir=require('zip-dir');var rp=require(_0x9416('0x1'));var moment=require(_0x9416('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x9416('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x9416('0x4'));var interaction=require(_0x9416('0x5'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x9416('0x6'))(_0x9416('0x7'));var config=require(_0x9416('0x8'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x9416('0x9')](config['redis'],{'host':_0x9416('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9416('0xb')]));require('./chatInteraction.socket')[_0x9416('0xc')](socket);var jayson=require(_0x9416('0xd'));var client=jayson['client']['http']({'port':0x232b});var client9004=jayson[_0x9416('0xe')][_0x9416('0xf')]({'port':0x232c});function respondWithRpcPromise(_0x4fa699,_0x401928,_0x111033,_0x3ca315){return new BPromise(function(_0x1bcb6b,_0x2317cb){var _0x3b6212=_0x3ca315||client;return _0x3b6212[_0x9416('0x10')](_0x4fa699,_0x111033)[_0x9416('0x11')](function(_0x357dae){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x401928,_0x9416('0x12'));logger['debug'](_0x9416('0x13'),_0x401928,_0x9416('0x12'),JSON[_0x9416('0x14')](_0x357dae));if(_0x357dae['error']){if(_0x357dae['error'][_0x9416('0x15')]===0x1f4){logger[_0x9416('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x401928,_0x357dae['error'][_0x9416('0x17')]);return _0x2317cb(_0x357dae[_0x9416('0x16')][_0x9416('0x17')]);}logger[_0x9416('0x16')](_0x9416('0x18'),_0x401928,_0x357dae['error']['message']);return _0x1bcb6b(_0x357dae[_0x9416('0x16')][_0x9416('0x17')]);}else{logger[_0x9416('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x401928,_0x9416('0x12'));_0x1bcb6b(_0x357dae[_0x9416('0x1a')]['message']);}})[_0x9416('0x1b')](function(_0x598737){logger['error'](_0x9416('0x18'),_0x401928,_0x598737);_0x2317cb(_0x598737);});});}function respondWithStatusCode(_0x3919de,_0x3f0b9e){_0x3f0b9e=_0x3f0b9e||0xcc;return function(_0x5313fc){if(_0x5313fc){return _0x3919de[_0x9416('0x1c')](_0x3f0b9e);}return _0x3919de[_0x9416('0x1d')](_0x3f0b9e)[_0x9416('0x1e')]();};}function respondWithResult(_0x43e5da,_0x58287b){_0x58287b=_0x58287b||0xc8;return function(_0x25deb2){if(_0x25deb2){return _0x43e5da['status'](_0x58287b)[_0x9416('0x1f')](_0x25deb2);}};}function respondWithFilteredResult(_0x4eb486,_0xfa7e7){return function(_0x3b1668){if(_0x3b1668){var _0x52a10d=typeof _0xfa7e7[_0x9416('0x20')]===_0x9416('0x21')&&typeof _0xfa7e7[_0x9416('0x22')]===_0x9416('0x21');var _0x33e336=_0x3b1668['count'];var _0x15d0a4=_0x52a10d?0x0:_0xfa7e7['offset'];var _0x5f528d=_0x52a10d?_0x3b1668[_0x9416('0x23')]:_0xfa7e7[_0x9416('0x20')]+_0xfa7e7[_0x9416('0x22')];var _0x5917d8;if(_0x5f528d>=_0x33e336){_0x5f528d=_0x33e336;_0x5917d8=0xc8;}else{_0x5917d8=0xce;}_0x4eb486[_0x9416('0x1d')](_0x5917d8);return _0x4eb486['set'](_0x9416('0x24'),_0x15d0a4+'-'+_0x5f528d+'/'+_0x33e336)[_0x9416('0x1f')](_0x3b1668);}return null;};}function saveUpdates(_0x343786){return function(_0x5a196a){if(_0x5a196a){return _0x5a196a['update'](_0x343786)['then'](function(_0x3b097b){return _0x3b097b;});}return null;};}function removeEntity(_0x206b7b){return function(_0x378bef){if(_0x378bef){return _0x378bef[_0x9416('0x25')]()[_0x9416('0x11')](function(){_0x206b7b['status'](0xcc)[_0x9416('0x1e')]();});}};}function handleEntityNotFound(_0x15b4b5){return function(_0x2c8e40){if(!_0x2c8e40){_0x15b4b5[_0x9416('0x1c')](0x194);}return _0x2c8e40;};}function handleError(_0x2739b9,_0xc3b84a){_0xc3b84a=_0xc3b84a||0x1f4;return function(_0x2e29d6){logger[_0x9416('0x16')](_0x2e29d6[_0x9416('0x26')]);if(_0x2e29d6[_0x9416('0x27')]){delete _0x2e29d6[_0x9416('0x27')];}_0x2739b9[_0x9416('0x1d')](_0xc3b84a)[_0x9416('0x28')](_0x2e29d6);};}function getMustacheRender(_0x2d5d48,_0x31751d){return Mustache[_0x9416('0x29')](_0x2d5d48,_[_0x9416('0x2a')](_0x31751d['body'],{'contact':_0x31751d['contact'],'message':_0x31751d[_0x9416('0x17')],'agent':_0x31751d['agent'],'interaction':_0x31751d['interaction'],'account':_0x31751d['account']}))||'';}exports[_0x9416('0x2b')]=function(_0x4e4ee6,_0x20c39e){var _0x529018={};var _0x32663e=_[_0x9416('0x2c')](db[_0x9416('0x2d')][_0x9416('0x2e')],function(_0x560d06){return{'name':_0x560d06[_0x9416('0x2f')],'type':_0x560d06[_0x9416('0x30')][_0x9416('0x31')]};});_0x529018=qs['getOptions'](_0x32663e,_0x4e4ee6);return interaction[_0x9416('0x32')]('chat',_0x4e4ee6[_0x9416('0x33')],_0x4e4ee6[_0x9416('0x34')],_0x529018,_0x32663e)['then'](respondWithFilteredResult(_0x20c39e,_0x529018))[_0x9416('0x1b')](handleError(_0x20c39e,null));};exports['show']=function(_0x460727,_0x1501de){var _0x157d4d={'raw':![],'where':{'id':_0x460727[_0x9416('0x35')]['id']}},_0x2c2b3d={};_0x2c2b3d[_0x9416('0x36')]=_[_0x9416('0x37')](db[_0x9416('0x2d')][_0x9416('0x2e')]);_0x2c2b3d[_0x9416('0x33')]=_[_0x9416('0x37')](_0x460727[_0x9416('0x33')]);_0x2c2b3d[_0x9416('0x38')]=_[_0x9416('0x39')](_0x2c2b3d[_0x9416('0x36')],_0x2c2b3d[_0x9416('0x33')]);_0x157d4d['attributes']=_[_0x9416('0x39')](_0x2c2b3d[_0x9416('0x36')],qs['fields'](_0x460727[_0x9416('0x33')][_0x9416('0x3a')]));_0x157d4d[_0x9416('0x3b')]=_0x157d4d[_0x9416('0x3b')][_0x9416('0x3c')]?_0x157d4d[_0x9416('0x3b')]:_0x2c2b3d[_0x9416('0x36')];if(_0x460727['query'][_0x9416('0x3d')]){_0x157d4d[_0x9416('0x3e')]=[{'all':!![]}];}_0x157d4d=_['merge']({},_0x157d4d,_0x460727['options']);return db[_0x9416('0x2d')][_0x9416('0x3f')](_0x157d4d)['then'](handleEntityNotFound(_0x1501de,null))[_0x9416('0x11')](respondWithResult(_0x1501de,null))[_0x9416('0x1b')](handleError(_0x1501de,null));};exports[_0x9416('0x40')]=function(_0x4666a2,_0x16a6a8){return db[_0x9416('0x2d')][_0x9416('0x40')](_0x4666a2['body'],{})[_0x9416('0x11')](respondWithResult(_0x16a6a8,0xc9))['catch'](handleError(_0x16a6a8,null));};exports[_0x9416('0x41')]=function(_0x27ec1b,_0x43c263){if(_0x27ec1b[_0x9416('0x42')]['id']){delete _0x27ec1b[_0x9416('0x42')]['id'];}return db['ChatInteraction'][_0x9416('0x3f')]({'where':{'id':_0x27ec1b['params']['id']}})['then'](handleEntityNotFound(_0x43c263,null))[_0x9416('0x11')](saveUpdates(_0x27ec1b['body'],null))['then'](respondWithResult(_0x43c263,null))[_0x9416('0x1b')](handleError(_0x43c263,null));};exports[_0x9416('0x25')]=function(_0x25085e,_0xe4f723){return db[_0x9416('0x2d')][_0x9416('0x3f')]({'where':{'id':_0x25085e[_0x9416('0x35')]['id']}})[_0x9416('0x11')](handleEntityNotFound(_0xe4f723,null))[_0x9416('0x11')](removeEntity(_0xe4f723,null))[_0x9416('0x1b')](handleError(_0xe4f723,null));};exports[_0x9416('0x43')]=function(_0x871477,_0x116759){return db[_0x9416('0x2d')][_0x9416('0x43')]()['then'](respondWithResult(_0x116759,null))[_0x9416('0x1b')](handleError(_0x116759,null));};exports['createVidaooSession']=function(_0x475404,_0x329d0d){var _0x4a4f0f=_0x475404['params']['id'];var _0x546494;var _0x15fe6e;var _0x590370;return db[_0x9416('0x2d')][_0x9416('0x44')]({'where':{'id':_0x4a4f0f}})[_0x9416('0x11')](function(_0x2b3058){_0x546494=_0x2b3058;return db[_0x9416('0x45')][_0x9416('0x44')]({'where':{'id':_0x2b3058[_0x9416('0x46')]},'attributes':['id',_0x9416('0x47'),_0x9416('0x48'),'vidaooTopic',_0x9416('0x49'),_0x9416('0x4a')],'raw':!![]});})[_0x9416('0x11')](function(_0x593f0f){if(_0x593f0f&&_0x593f0f[_0x9416('0x47')]&&_0x593f0f[_0x9416('0x48')]){_0x15fe6e=_0x593f0f;var _0x272ada={'interaction':{'id':_0x4a4f0f},'agent':{'id':_0x475404[_0x9416('0x34')]['id'],'name':_0x475404[_0x9416('0x34')][_0x9416('0x27')],'fullname':_0x475404['user'][_0x9416('0x4b')],'email':_0x475404[_0x9416('0x34')][_0x9416('0x4c')]},'contact':_0x475404['body']['contact'],'account':_0x475404[_0x9416('0x42')][_0x9416('0x4d')]};var _0x2bf284={'rejectUnauthorized':![],'method':'POST','url':_0x9416('0x4e'),'headers':{'X-APIKEY':_0x593f0f[_0x9416('0x47')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x475404[_0x9416('0x34')][_0x9416('0x4c')]],'buttons':null,'topic':_0x15fe6e[_0x9416('0x4f')],'note':_[_0x9416('0x50')](_0x15fe6e[_0x9416('0x49')])?null:getMustacheRender(_0x15fe6e[_0x9416('0x49')],_0x272ada),'metadata':null},'redirect':_0x9416('0x51'),'json':!![]};try{if(!_[_0x9416('0x50')](_0x15fe6e[_0x9416('0x4a')])){var _0x4a6fc4=getMustacheRender(_0x15fe6e['vidaooMetadata'],_0x272ada);var _0x2aeb82=JSON[_0x9416('0x52')](_0x4a6fc4);_0x2bf284[_0x9416('0x42')]['metadata']=_0x2aeb82;}}catch(_0x4276e9){throw new db[(_0x9416('0x53'))][(_0x9416('0x54'))](_0x9416('0x55'));}return rp(_0x2bf284);}else{throw new db['Sequelize'][(_0x9416('0x54'))](_0x9416('0x56'));}})[_0x9416('0x11')](function(_0x3a746c){_0x590370=_0x3a746c;if(_0x590370['id']){var _0x1c37ba={'body':_0x590370['join_url'],'ChatWebsiteId':_0x15fe6e['id'],'ChatInteractionId':_0x546494['id'],'direction':_0x9416('0x57'),'UserId':_0x475404[_0x9416('0x34')]['id']};return db[_0x9416('0x58')][_0x9416('0x40')](_0x1c37ba,{});}else{throw new db[(_0x9416('0x53'))][(_0x9416('0x54'))](_0x9416('0x59'));}})['then'](function(){return _0x546494['updateAttributes']({'vidaooSessionId':_0x590370['id']});})[_0x9416('0x11')](respondWithResult(_0x329d0d,null))[_0x9416('0x1b')](handleError(_0x329d0d,null));};exports[_0x9416('0x5a')]=function(_0x18158c,_0x52caae){if(_0x18158c['body']['id']){delete _0x18158c[_0x9416('0x42')]['id'];}return db[_0x9416('0x2d')][_0x9416('0x3f')]({'where':{'id':_0x18158c[_0x9416('0x35')]['id']},'include':[{'model':db[_0x9416('0x5b')],'as':_0x9416('0x5c')}]})[_0x9416('0x11')](handleEntityNotFound(_0x52caae,null))['then'](saveUpdates(_0x18158c[_0x9416('0x42')],null))['then'](respondWithResult(_0x52caae,null))[_0x9416('0x1b')](handleError(_0x52caae,null));};exports[_0x9416('0x5d')]=function(_0x2b060d,_0x2be2de){if(_0x2b060d[_0x9416('0x42')]['id']){delete _0x2b060d['body']['id'];}return db[_0x9416('0x2d')]['find']({'where':{'id':_0x2b060d[_0x9416('0x35')]['id']}})[_0x9416('0x11')](function(_0x2f8371){if(!_0x2f8371){logger[_0x9416('0x16')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x9416('0x5d'),0x194,_0x9416('0x5e'));_0x2be2de[_0x9416('0x1c')](0x194);}else{if(_0x2f8371[_0x9416('0x5f')]){throw new db[(_0x9416('0x53'))][(_0x9416('0x54'))]('Interaction\x20already\x20assigned');}}return _0x2f8371;})[_0x9416('0x11')](function(_0x83bde){if(_0x83bde){return _0x83bde[_0x9416('0x41')]({'closed':_0x2b060d[_0x9416('0x42')][_0x9416('0x60')],'disposition':_0x2b060d[_0x9416('0x42')][_0x9416('0x61')]})[_0x9416('0x11')](function(_0x5bcb0f){return _0x5bcb0f;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction',_0x9416('0x5d'),_0x2b060d[_0x9416('0x42')],client9004);})[_0x9416('0x11')](respondWithResult(_0x2be2de,null))['catch'](handleError(_0x2be2de,null));};exports[_0x9416('0x62')]=function(_0x497c4d,_0x6a0e28){_0x497c4d['body'][_0x9416('0x27')]=_0x497c4d[_0x9416('0x63')]['originalname'];_0x497c4d['body']['basename']=_0x497c4d[_0x9416('0x63')][_0x9416('0x64')];_0x497c4d[_0x9416('0x42')][_0x9416('0x30')]=_0x497c4d[_0x9416('0x63')][_0x9416('0x65')];return db[_0x9416('0x66')]['create'](_0x497c4d['body'])[_0x9416('0x11')](respondWithResult(_0x6a0e28,0xc9))[_0x9416('0x1b')](handleError(_0x6a0e28,null));};exports[_0x9416('0x67')]=function(_0x45a7cf,_0x198ebb){return db[_0x9416('0x2d')]['findOne']({'where':{'id':_0x45a7cf[_0x9416('0x35')]['id']},'raw':!![]})[_0x9416('0x11')](handleEntityNotFound(_0x198ebb,null))['then'](function(_0x4fb5a0){if(_0x4fb5a0){if(_0x4fb5a0['closed']){return _0x198ebb[_0x9416('0x1d')](0x193)[_0x9416('0x1f')]({'status':0x193,'message':_0x9416('0x68')});}return db[_0x9416('0x66')][_0x9416('0x44')]({'where':{'id':_0x45a7cf[_0x9416('0x33')][_0x9416('0x69')]},'raw':!![]})[_0x9416('0x11')](handleEntityNotFound(_0x198ebb,null));}})[_0x9416('0x11')](function(_0x55998c){if(_0x55998c){var _0x421fed=_0x55998c[_0x9416('0x6a')]!==null;var _0x1d4f5f=path[_0x9416('0x6b')](config['root'],_0x9416('0x6c'));if(_0x421fed){_0x1d4f5f=path[_0x9416('0x6b')](_0x1d4f5f,_0x9416('0x6d'));}var _0x2832c4=path[_0x9416('0x6b')](_0x1d4f5f,_0x55998c[_0x9416('0x6e')]);return _0x198ebb[_0x9416('0x6f')](_0x2832c4);}})[_0x9416('0x1b')](handleError(_0x198ebb,null));};exports[_0x9416('0x70')]=function(_0x434d18,_0x4811c0){var _0x233d26=null;var _0x2a8cfe=null;var _0x40c4f2=null;if(_0x434d18[_0x9416('0x42')]['id']){delete _0x434d18['body']['id'];}if(_0x434d18['body'][_0x9416('0x71')]){_0x40c4f2=path[_0x9416('0x6b')](config[_0x9416('0x72')],_0x9416('0x73'),util['format'](_0x9416('0x74'),Date[_0x9416('0x75')]()));_0x434d18['body']['pathTranscript']=_0x40c4f2;}return db[_0x9416('0x2d')][_0x9416('0x3f')]({'where':{'id':_0x434d18['params']['id']},'include':[{'model':db[_0x9416('0x58')],'as':_0x9416('0x76'),'include':[{'model':db[_0x9416('0x77')],'as':_0x9416('0x77')}]}]})[_0x9416('0x11')](handleEntityNotFound(_0x4811c0,null))[_0x9416('0x11')](saveUpdates(_0x434d18[_0x9416('0x42')],null))[_0x9416('0x11')](function(_0x4b9da6){if(_0x4b9da6){_0x233d26=_0x4b9da6;return db[_0x9416('0x45')]['find']({'where':{'id':_0x233d26[_0x9416('0x46')]}});}})[_0x9416('0x11')](function(_0x263bc5){if(_0x263bc5){_0x2a8cfe=_0x263bc5;return db[_0x9416('0x5b')][_0x9416('0x3f')]({'where':{'id':_0x233d26[_0x9416('0x78')]}});}})['then'](function(_0xf7dfa1){if(_0xf7dfa1){if(_0x40c4f2){var _0x1cd1c9=null;for(var _0x4becc1=0x1;_0x4becc1<_0x233d26[_0x9416('0x76')][_0x9416('0x3c')];++_0x4becc1){_0x1cd1c9=_0x233d26[_0x9416('0x76')][_0x4becc1];var _0x5a0a7a=_0x1cd1c9['UserId']?util[_0x9416('0x79')](_0x9416('0x7a'),_0x2a8cfe['agentAlias'],_0x1cd1c9[_0x9416('0x5f')]):_0x9416('0x7b');var _0x519058=_0x434d18[_0x9416('0x42')][_0x9416('0x7c')]||util[_0x9416('0x79')](_0x9416('0x7a'),_0x9416('0x7d'),_0x1cd1c9[_0x9416('0x78')]);switch(_0x2a8cfe[_0x9416('0x7e')]){case'website_alias':_0x5a0a7a=_0x1cd1c9[_0x9416('0x5f')]?util[_0x9416('0x79')](_0x9416('0x7a'),_0x2a8cfe[_0x9416('0x7f')],_0x1cd1c9[_0x9416('0x5f')]):_0x9416('0x7b');break;case _0x9416('0x80'):_0x5a0a7a=_0x1cd1c9[_0x9416('0x5f')]?_0x1cd1c9[_0x9416('0x77')][_0x9416('0x81')]||_0x1cd1c9[_0x9416('0x77')][_0x9416('0x4b')]:_0x9416('0x7b');break;case'agent_fullname':_0x5a0a7a=_0x1cd1c9[_0x9416('0x5f')]?_0x1cd1c9[_0x9416('0x77')][_0x9416('0x4b')]:_0x9416('0x7b');break;default:_0x5a0a7a=_0x1cd1c9['UserId']?util[_0x9416('0x79')]('%s%d',_0x2a8cfe[_0x9416('0x7f')],_0x1cd1c9[_0x9416('0x5f')]):_0x9416('0x7b');}var _0x19c602=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x1cd1c9[_0x9416('0x82')])[_0x9416('0x79')](_0x9416('0x83')),_0x1cd1c9[_0x9416('0x84')]==='in'?_0x519058:_0x5a0a7a,_0x1cd1c9[_0x9416('0x42')]);if(!_0x1cd1c9[_0x9416('0x85')]){fs[_0x9416('0x86')](_0x40c4f2,_0x19c602);}}return db[_0x9416('0x87')][_0x9416('0x44')]({'where':{'service':!![]},'include':[{'model':db[_0x9416('0x88')],'as':_0x9416('0x89'),'raw':!![],'include':[{'model':db[_0x9416('0x8a')],'as':_0x9416('0x8a'),'raw':!![]}]}]});}}})['then'](function(_0x4b5158){if(!_0x4b5158||!_0x4b5158[_0x9416('0x89')]||!_0x434d18[_0x9416('0x42')])return _0x233d26;var _0xec617a=_0x4b5158[_0x9416('0x8b')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0xec617a,'message':{'from':util[_0x9416('0x79')](_0x9416('0x8c'),_0x4b5158['name'],_0x4b5158[_0x9416('0x4c')]||_0x4b5158[_0x9416('0x89')][_0x9416('0x34')]),'to':_0x434d18[_0x9416('0x42')][_0x9416('0x71')],'subject':_0x9416('0x8d'),'text':util[_0x9416('0x79')](_0x9416('0x8e'),_0x434d18[_0x9416('0x42')]['mailTranscript']),'attachments':[{'path':_0x40c4f2}]}})[_0x9416('0x11')](function(){return _0x233d26;})['catch'](function(_0x45e2bb){logger[_0x9416('0x16')](_0x45e2bb);});})[_0x9416('0x11')](respondWithStatusCode(_0x4811c0,0xc8))[_0x9416('0x1b')](handleError(_0x4811c0,null));};exports[_0x9416('0x8f')]=function(_0xe17583,_0x51eb67){return db[_0x9416('0x58')]['find']({'where':{'id':_0xe17583[_0x9416('0x35')]['id']}})[_0x9416('0x11')](handleEntityNotFound(_0x51eb67,null))[_0x9416('0x11')](function(_0x4cb675){if(_0x4cb675){return _0x4cb675['addMessage'](_0xe17583[_0x9416('0x42')][_0x9416('0x90')],_['omit'](_0xe17583[_0x9416('0x42')],[_0x9416('0x90'),'id'])||{});}})[_0x9416('0x11')](respondWithResult(_0x51eb67,null))[_0x9416('0x1b')](handleError(_0x51eb67,null));};exports[_0x9416('0x91')]=function(_0x51d7dd,_0x9e90d8){var _0x528571={'raw':![],'where':{}};var _0x19871d={};var _0x81f2c5={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x9416('0x44')]({'where':{'id':_0x51d7dd[_0x9416('0x35')]['id']}})[_0x9416('0x11')](handleEntityNotFound(_0x9e90d8,null))[_0x9416('0x11')](function(_0x281dfb){if(_0x281dfb){_0x19871d[_0x9416('0x36')]=_[_0x9416('0x37')](db[_0x9416('0x58')][_0x9416('0x2e')]);_0x19871d[_0x9416('0x33')]=_[_0x9416('0x37')](_0x51d7dd[_0x9416('0x33')]);_0x19871d['filters']=_[_0x9416('0x39')](_0x19871d[_0x9416('0x36')],_0x19871d[_0x9416('0x33')]);_0x528571[_0x9416('0x3b')]=_['intersection'](_0x19871d[_0x9416('0x36')],qs[_0x9416('0x3a')](_0x51d7dd[_0x9416('0x33')][_0x9416('0x3a')]));_0x528571[_0x9416('0x3b')]=_0x528571['attributes'][_0x9416('0x3c')]?_0x528571[_0x9416('0x3b')]:_0x19871d['model'];if(!_0x51d7dd[_0x9416('0x33')][_0x9416('0x92')](_0x9416('0x93'))){_0x528571['limit']=qs[_0x9416('0x22')](_0x51d7dd[_0x9416('0x33')]['limit']);_0x528571[_0x9416('0x20')]=qs[_0x9416('0x20')](_0x51d7dd['query']['offset']);}_0x528571[_0x9416('0x94')]=qs[_0x9416('0x95')](_0x51d7dd[_0x9416('0x33')][_0x9416('0x95')]);_0x528571[_0x9416('0x96')]=qs['filters'](_[_0x9416('0x97')](_0x51d7dd['query'],_0x19871d[_0x9416('0x38')]));_0x528571['where'][_0x9416('0x98')]=_0x281dfb['id'];if(_0x51d7dd['query'][_0x9416('0x99')]){_0x528571[_0x9416('0x96')]=_[_0x9416('0x2a')](_0x528571[_0x9416('0x96')],{'$or':_[_0x9416('0x2c')](_0x528571[_0x9416('0x3b')],function(_0x49216c){var _0x5245ba={};_0x5245ba[_0x49216c]={'$like':'%'+_0x51d7dd['query'][_0x9416('0x99')]+'%'};return _0x5245ba;})});}if(_0x51d7dd[_0x9416('0x33')]['$gte']){var _0x17aab4=_0x51d7dd['query'][_0x9416('0x9a')][_0x9416('0x9b')](',');var _0x3dcd78={};_0x3dcd78[_0x17aab4[0x0]]={'$gte':moment(_0x17aab4[0x1])[_0x9416('0x79')](_0x9416('0x9c'))};_0x528571[_0x9416('0x96')]=_[_0x9416('0x2a')](_0x528571[_0x9416('0x96')],_0x3dcd78);}_0x528571=_[_0x9416('0x2a')]({},_0x528571,_0x51d7dd[_0x9416('0x9d')]);return db['ChatMessage'][_0x9416('0x23')]({'where':_0x528571[_0x9416('0x96')]})[_0x9416('0x11')](function(_0x4dca15){_0x81f2c5[_0x9416('0x23')]=_0x4dca15;if(_0x51d7dd['query'][_0x9416('0x3d')]){_0x528571[_0x9416('0x3e')]=[{'all':!![]}];}return db['ChatMessage'][_0x9416('0x32')](_0x528571);})[_0x9416('0x11')](function(_0x18ef9e){_0x81f2c5[_0x9416('0x9e')]=_0x18ef9e;return _0x81f2c5;});}})['then'](respondWithFilteredResult(_0x9e90d8,_0x528571))[_0x9416('0x1b')](handleError(_0x9e90d8,null));};exports['getMyMessages']=function(_0x4eaf10,_0x4e9588){var _0xf80f26={'where':{}},_0x41a48b={},_0x52f253={'count':0x0,'rows':[]};return db[_0x9416('0x2d')][_0x9416('0x44')]({'where':{'id':_0x4eaf10[_0x9416('0x35')]['id']}})[_0x9416('0x11')](handleEntityNotFound(_0x4e9588,null))[_0x9416('0x11')](function(_0x141c10){if(_0x141c10){_0x41a48b[_0x9416('0x36')]=_[_0x9416('0x37')](db['ChatMessage'][_0x9416('0x2e')]);_0x41a48b[_0x9416('0x33')]=_['keys'](_0x4eaf10[_0x9416('0x33')]);_0x41a48b[_0x9416('0x38')]=_['intersection'](_0x41a48b[_0x9416('0x36')],_0x41a48b[_0x9416('0x33')]);_0xf80f26['attributes']=_[_0x9416('0x39')](_0x41a48b[_0x9416('0x36')],qs[_0x9416('0x3a')](_0x4eaf10[_0x9416('0x33')][_0x9416('0x3a')]));_0xf80f26[_0x9416('0x3b')]=_0xf80f26[_0x9416('0x3b')][_0x9416('0x3c')]?_0xf80f26[_0x9416('0x3b')]:_0x41a48b['model'];if(!_0x4eaf10[_0x9416('0x33')][_0x9416('0x92')]('nolimit')){_0xf80f26[_0x9416('0x22')]=qs[_0x9416('0x22')](_0x4eaf10[_0x9416('0x33')][_0x9416('0x22')]);_0xf80f26[_0x9416('0x20')]=qs[_0x9416('0x20')](_0x4eaf10['query'][_0x9416('0x20')]);}_0xf80f26[_0x9416('0x94')]=qs[_0x9416('0x95')](_0x4eaf10[_0x9416('0x33')][_0x9416('0x95')]);_0xf80f26[_0x9416('0x96')]=qs[_0x9416('0x38')](_[_0x9416('0x97')](_0x4eaf10[_0x9416('0x33')],_0x41a48b[_0x9416('0x38')]));_0xf80f26[_0x9416('0x96')][_0x9416('0x98')]=_0x141c10['id'];if(_0x4eaf10[_0x9416('0x33')][_0x9416('0x99')]){_0xf80f26['where']=_[_0x9416('0x2a')](_0xf80f26['where'],{'$or':_[_0x9416('0x2c')](_0xf80f26[_0x9416('0x3b')],function(_0x55ae10){var _0x4b0d0a={};_0x4b0d0a[_0x55ae10]={'$like':'%'+_0x4eaf10[_0x9416('0x33')][_0x9416('0x99')]+'%'};return _0x4b0d0a;})});}_0xf80f26[_0x9416('0x96')][_0x9416('0x85')]=![];if(_0x4eaf10[_0x9416('0x33')]['id']){_0xf80f26[_0x9416('0x96')]['id']={'$gt':_0x4eaf10[_0x9416('0x33')]['id']};}_0xf80f26=_[_0x9416('0x2a')]({},_0xf80f26,_0x4eaf10[_0x9416('0x9d')]);return db['ChatMessage'][_0x9416('0x23')]({'where':_0xf80f26['where']})[_0x9416('0x11')](function(_0x2264cf){_0x52f253[_0x9416('0x23')]=_0x2264cf;_0xf80f26['include']=[];if(_0x4eaf10[_0x9416('0x33')][_0x9416('0x9f')]){_0xf80f26['include'][_0x9416('0xa0')]({'model':db['User'],'as':_0x9416('0x77'),'attributes':['id','fullname','alias']});}if(_0x4eaf10[_0x9416('0x33')][_0x9416('0x3d')]){_0xf80f26['include']=[{'all':!![]}];}return db[_0x9416('0x58')][_0x9416('0x32')](_0xf80f26);})[_0x9416('0x11')](function(_0x3ebf9b){_0x52f253[_0x9416('0x9e')]=_0x3ebf9b;return _0x52f253;});}})[_0x9416('0x11')](respondWithFilteredResult(_0x4e9588,_0xf80f26))[_0x9416('0x1b')](handleError(_0x4e9588,null));};exports[_0x9416('0xa1')]=function(_0x2f6e35,_0x1971e4){return db[_0x9416('0x2d')][_0x9416('0x3f')]({'where':{'id':_0x2f6e35[_0x9416('0x35')]['id']}})[_0x9416('0x11')](handleEntityNotFound(_0x1971e4,null))[_0x9416('0x11')](function(_0x3c84b5){if(_0x3c84b5){return _0x3c84b5['setTags'](_0x2f6e35['body'][_0x9416('0x90')],_[_0x9416('0xa2')](_0x2f6e35[_0x9416('0x42')],[_0x9416('0x90'),'id'])||{})[_0x9416('0xa3')](function(){return db[_0x9416('0xa4')]['findAll']({'attributes':['id','name',_0x9416('0xa5')],'where':{'id':_0x2f6e35[_0x9416('0x42')]['ids']}});})[_0x9416('0x11')](function(_0x1588d2){socket[_0x9416('0xa6')](_0x9416('0xa7'),{'id':Number(_0x2f6e35[_0x9416('0x35')]['id']),'tags':_0x1588d2||[]});return{'id':Number(_0x2f6e35['params']['id']),'tags':_0x1588d2||[]};});}})['then'](respondWithResult(_0x1971e4,null))[_0x9416('0x1b')](handleError(_0x1971e4,null));};exports[_0x9416('0xa8')]=function(_0x26cc26,_0x15c651){return db[_0x9416('0x2d')][_0x9416('0x3f')]({'where':{'id':_0x26cc26['params']['id']}})[_0x9416('0x11')](handleEntityNotFound(_0x15c651,null))[_0x9416('0x11')](function(_0xe76b87){if(_0xe76b87){return _0xe76b87[_0x9416('0xa8')](_0x26cc26['query'][_0x9416('0x90')]);}})[_0x9416('0x11')](respondWithStatusCode(_0x15c651,null))[_0x9416('0x1b')](handleError(_0x15c651,null));};exports['download']=function(_0x447c04,_0x3f86af){var _0x40e71f=moment()['unix']()[_0x9416('0xa9')]();var _0x3f1e1f=path[_0x9416('0x6b')](config[_0x9416('0x72')],'server',_0x9416('0xaa'),'tmp');var _0x2567b4=path[_0x9416('0x6b')](config[_0x9416('0x72')],_0x9416('0xab'),_0x9416('0xaa'),_0x9416('0xac'));var _0x328f8b=path[_0x9416('0x6b')](_0x3f1e1f,_0x40e71f);var _0x466d8d=util[_0x9416('0x79')](_0x9416('0xad'),_0x447c04['params']['id'],_0x40e71f);var _0x33ea1a=path[_0x9416('0x6b')](_0x3f1e1f,_0x466d8d);var _0x5e6e2b=[];_0x5e6e2b[_0x9416('0xa0')]({'model':db[_0x9416('0x77')],'as':_0x9416('0x77'),'attributes':['id','fullname'],'raw':!![]});_0x5e6e2b[_0x9416('0xa0')]({'model':db[_0x9416('0x5b')],'as':'Contact','attributes':['id',_0x9416('0xae'),_0x9416('0xaf')],'raw':!![]});if(_0x447c04[_0x9416('0x33')][_0x9416('0xac')]){_0x5e6e2b[_0x9416('0xa0')]({'model':db[_0x9416('0x66')],'as':_0x9416('0x66'),'raw':!![]});}var _0x8e6566=[{'model':db[_0x9416('0x58')],'as':_0x9416('0x76'),'attributes':['id',_0x9416('0x42'),_0x9416('0x82'),_0x9416('0x84'),_0x9416('0x85'),_0x9416('0xb0')],'include':_0x5e6e2b}];_0x8e6566[_0x9416('0xa0')]({'model':db[_0x9416('0x45')],'as':_0x9416('0xb1'),'attributes':['id',_0x9416('0x27')]});_0x8e6566[_0x9416('0xa0')]({'model':db['User'],'as':_0x9416('0xb2'),'attributes':['id','fullname']});return db[_0x9416('0x2d')]['find']({'where':{'id':_0x447c04['params']['id']},'include':_0x8e6566})[_0x9416('0x11')](handleEntityNotFound(_0x3f86af,null))[_0x9416('0x11')](function(_0x44b899){if(_0x44b899){var _0x355b32=_0x44b899[_0x9416('0xb3')]({'plain':!![]});fs[_0x9416('0xb4')](_0x328f8b);var _0x11daae={'channel':_0x9416('0xb5'),'account':_0x355b32[_0x9416('0xb1')][_0x9416('0x27')],'agent':_0x355b32[_0x9416('0xb2')]?_0x355b32['Owner']['fullname']:_0x9416('0xb6'),'createdAt':moment(_0x355b32['createdAt'])[_0x9416('0x79')](_0x9416('0x9c'))[_0x9416('0xa9')](),'closedAt':_0x355b32['closed']?moment(_0x355b32[_0x9416('0xb7')])[_0x9416('0x79')](_0x9416('0x9c'))[_0x9416('0xa9')]():'','disposition':_0x355b32['disposition'],'chatInfo':{'browser':_0x355b32['browserName'],'os':_0x355b32[_0x9416('0xb8')],'referer':_0x355b32[_0x9416('0xb9')],'customerIp':_0x355b32[_0x9416('0xba')],'customerPort':_0x355b32[_0x9416('0xbb')]?_0x355b32[_0x9416('0xbb')]:'N.A.'},'messages':_(_0x355b32[_0x9416('0x76')])[_0x9416('0xbc')]()[_0x9416('0x99')]({'secret':![]})['map'](function(_0x13ba57){if(_0x13ba57[_0x9416('0x66')]){var _0x357048=path[_0x9416('0x6b')](_0x2567b4,_0x13ba57[_0x9416('0x66')][_0x9416('0x6e')]);if(fs[_0x9416('0xbd')](_0x357048)){fs[_0x9416('0xbe')](_0x357048)['pipe'](fs['createWriteStream'](path[_0x9416('0x6b')](_0x328f8b,_0x13ba57['Attachment']['basename'])));}}return{'date':moment(_0x13ba57[_0x9416('0x82')])[_0x9416('0x79')](_0x9416('0x9c'))[_0x9416('0xa9')](),'sender':_0x13ba57[_0x9416('0x84')]===_0x9416('0x57')?_0x13ba57[_0x9416('0x77')]?_0x13ba57[_0x9416('0x77')]['fullname']:_0x9416('0x7b'):_0x13ba57[_0x9416('0x5c')][_0x9416('0xae')]+(_0x13ba57[_0x9416('0x5c')][_0x9416('0xaf')]?'\x20'+_0x13ba57[_0x9416('0x5c')][_0x9416('0xaf')]:''),'body':_0x13ba57[_0x9416('0x66')]?_0x13ba57[_0x9416('0x66')][_0x9416('0x6e')]:_0x13ba57['body'],'direction':_0x13ba57['direction']===_0x9416('0x57')?'A':'C','secret':_0x13ba57['secret'],'read':_0x13ba57[_0x9416('0xb0')],'attachment':_0x13ba57['Attachment']};})[_0x9416('0xbf')]()};return ejs[_0x9416('0xc0')](path[_0x9416('0x6b')](config[_0x9416('0x72')],_0x9416('0xab'),'views',_0x9416('0xc1')),{'interaction':_0x11daae})[_0x9416('0x11')](function(_0x5c58a8){var _0x32745c=path[_0x9416('0x6b')](_0x328f8b,_0x9416('0xc2')+_0x355b32['id']+'-'+_0x40e71f+_0x9416('0xc3'));var _0xf66d4a={'path':_0x32745c,'channel':_0x9416('0xb5'),'interactionId':_0x355b32['id']};return pdf[_0x9416('0xc4')](_0x5c58a8,_0xf66d4a);})[_0x9416('0x11')](function(){return new Promise(function(_0x26cc20,_0x11779b){zipdir(_0x328f8b,{'saveTo':_0x33ea1a},function(_0x1cc995,_0x1ebc5a){if(_0x1cc995)return _0x11779b(_0x1cc995);return _0x26cc20(_0x1ebc5a);});})[_0x9416('0x11')](function(){return new BPromise(function(_0x9656a6,_0x15d7f0){rimraf(_0x328f8b,function(_0x57bfab){if(_0x57bfab)_0x15d7f0(_0x57bfab);return _0x9656a6();});});})[_0x9416('0x11')](function(){return _0x3f86af[_0x9416('0x6f')](_0x33ea1a,_0x466d8d,function(_0x1457fd){if(_0x1457fd){logger[_0x9416('0x16')]('err',_0x1457fd);}else{fs[_0x9416('0xc5')](_0x33ea1a);}});});});}else{return _0x3f86af[_0x9416('0x1c')](0xc8);}})['catch'](handleError(_0x3f86af,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 9648f27..df2a361 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 _0x268a=['emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length'];(function(_0x133ca5,_0x4822ba){var _0x2d9eb3=function(_0x10ce83){while(--_0x10ce83){_0x133ca5['push'](_0x133ca5['shift']());}};_0x2d9eb3(++_0x4822ba);}(_0x268a,0x113));var _0xa268=function(_0x1ccbcc,_0x5c948b){_0x1ccbcc=_0x1ccbcc-0x0;var _0x1e873f=_0x268a[_0x1ccbcc];return _0x1e873f;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xa268('0x0'))['db'][_0xa268('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0xa268('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa268('0x3'),'afterUpdate':_0xa268('0x4'),'afterDestroy':_0xa268('0x5')};function emitEvent(_0x39e14d){return function(_0x53fc42,_0x1f691d,_0xf4d548){_0x53fc42[_0xa268('0x6')]({'attributes':['id'],'raw':!![]})[_0xa268('0x7')](function(_0x28bf33){_0x53fc42[_0xa268('0x8')]('Users',_0x28bf33[_0xa268('0x9')](function(_0x3215bc){return{'id':_0x3215bc['id']};}));return ChatMessage[_0xa268('0xa')]({'where':{'ChatInteractionId':_0x53fc42['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa268('0x7')](function(_0x137d13){_0x53fc42[_0xa268('0x8')](_0xa268('0xb'),_0x137d13[_0xa268('0xc')]);ChatInteractionEvents[_0xa268('0xd')](_0x39e14d+':'+_0x53fc42['id'],_0x53fc42);ChatInteractionEvents[_0xa268('0xd')](_0x39e14d,_0x53fc42);_0xf4d548(null);})[_0xa268('0xe')](_0xf4d548(null));};}for(var e in events){if(events[_0xa268('0xf')](e)){var event=events[e];ChatInteraction[_0xa268('0x10')](e,emitEvent(event));}}module[_0xa268('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xd205=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','update','getUsers','then','Users','setDataValue','unreadMessages','emit','catch'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xd205,0x99));var _0x5d20=function(_0x3ca9c7,_0x36c71c){_0x3ca9c7=_0x3ca9c7-0x0;var _0xd68797=_0xd205[_0x3ca9c7];return _0xd68797;};'use strict';var EventEmitter=require(_0x5d20('0x0'));var ChatInteraction=require(_0x5d20('0x1'))['db'][_0x5d20('0x2')];var ChatMessage=require(_0x5d20('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5d20('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5d20('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5f227e){return function(_0x2d7204,_0x15fd16,_0xdfb4a8){_0x2d7204[_0x5d20('0x5')]({'attributes':['id'],'raw':!![]})[_0x5d20('0x6')](function(_0x263b19){_0x2d7204['setDataValue'](_0x5d20('0x7'),_0x263b19['map'](function(_0x387cb8){return{'id':_0x387cb8['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x2d7204['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4cbae6){_0x2d7204[_0x5d20('0x8')](_0x5d20('0x9'),_0x4cbae6['length']);ChatInteractionEvents[_0x5d20('0xa')](_0x5f227e+':'+_0x2d7204['id'],_0x2d7204);ChatInteractionEvents[_0x5d20('0xa')](_0x5f227e,_0x2d7204);_0xdfb4a8(null);})[_0x5d20('0xb')](_0xdfb4a8(null));};}for(var e in events){if(events[_0x5d20('0xc')](e)){var event=events[e];ChatInteraction[_0x5d20('0xd')](e,emitEvent(event));}}module[_0x5d20('0xe')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 38f423f..2d74954 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 _0xcc8e=['../../config/logger','api','moment','request-promise','path','rimraf','exports','define','ChatInteraction','chat_interactions','closed','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x665846,_0x5503d8){var _0x16c349=function(_0x2b34a9){while(--_0x2b34a9){_0x665846['push'](_0x665846['shift']());}};_0x16c349(++_0x5503d8);}(_0xcc8e,0x1bf));var _0xecc8=function(_0x49dc71,_0x799325){_0x49dc71=_0x49dc71-0x0;var _0xe9def6=_0xcc8e[_0x49dc71];return _0xe9def6;};'use strict';var _=require(_0xecc8('0x0'));var util=require('util');var logger=require(_0xecc8('0x1'))(_0xecc8('0x2'));var moment=require(_0xecc8('0x3'));var BPromise=require('bluebird');var rp=require(_0xecc8('0x4'));var fs=require('fs');var path=require(_0xecc8('0x5'));var rimraf=require(_0xecc8('0x6'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0xecc8('0x7')]=function(_0x152724,_0x3e6d49){return _0x152724[_0xecc8('0x8')](_0xecc8('0x9'),attributes,{'tableName':_0xecc8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x38c1f2,_0x73e0da,_0x2e1a33){if(_0x38c1f2['changed'](_0xecc8('0xb'))){_0x38c1f2['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x2e1a33(null,_0x38c1f2);}},'charset':_0xecc8('0xc'),'collate':_0xecc8('0xd')});};
\ No newline at end of file
+var _0x40c3=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3a7374,_0xfc6988){var _0x252741=function(_0x4ae397){while(--_0x4ae397){_0x3a7374['push'](_0x3a7374['shift']());}};_0x252741(++_0xfc6988);}(_0x40c3,0x16b));var _0x340c=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x40c3[_0x1ae5ab];return _0x1ce001;};'use strict';var _=require(_0x340c('0x0'));var util=require(_0x340c('0x1'));var logger=require(_0x340c('0x2'))(_0x340c('0x3'));var moment=require(_0x340c('0x4'));var BPromise=require(_0x340c('0x5'));var rp=require(_0x340c('0x6'));var fs=require('fs');var path=require(_0x340c('0x7'));var rimraf=require(_0x340c('0x8'));var config=require(_0x340c('0x9'));var attributes=require(_0x340c('0xa'));module[_0x340c('0xb')]=function(_0x5b70e4,_0x3ac2af){return _0x5b70e4['define'](_0x340c('0xc'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a092b,_0x469d76,_0xdb82f8){if(_0x1a092b['changed'](_0x340c('0xd'))){_0x1a092b[_0x340c('0xe')]=moment()[_0x340c('0xf')](_0x340c('0x10'));}_0xdb82f8(null,_0x1a092b);}},'charset':_0x340c('0x11'),'collate':_0x340c('0x12')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 19d2df5..c17f57d 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 _0xf6b6=['socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateChatInteraction','update','body','options','attributes','limit','debug','AddTagsToChatInteraction','find','addTags','ids','omit','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','defaults','localhost'];(function(_0x254067,_0x4d151a){var _0x5e225a=function(_0x1f3e2b){while(--_0x1f3e2b){_0x254067['push'](_0x254067['shift']());}};_0x5e225a(++_0x4d151a);}(_0xf6b6,0x1ee));var _0x6f6b=function(_0x20040f,_0x4969ba){_0x20040f=_0x20040f-0x0;var _0x539e5b=_0xf6b6[_0x20040f];return _0x539e5b;};'use strict';var _=require('lodash');var util=require(_0x6f6b('0x0'));var moment=require(_0x6f6b('0x1'));var BPromise=require(_0x6f6b('0x2'));var rs=require(_0x6f6b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f6b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6f6b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6f6b('0x6'));var client=jayson[_0x6f6b('0x7')]['http']({'port':0x232a});config['redis']=_[_0x6f6b('0x8')](config['redis'],{'host':_0x6f6b('0x9'),'port':0x18eb});var socket=require(_0x6f6b('0xa'))(new Redis(config['redis']));require(_0x6f6b('0xb'))[_0x6f6b('0xc')](socket);function respondWithRpcPromise(_0x371ffd,_0x4672e6,_0x6fdc31){return new BPromise(function(_0x2e8dd7,_0x5eb3b0){return client['request'](_0x371ffd,_0x6fdc31)[_0x6f6b('0xd')](function(_0x23f2b9){logger[_0x6f6b('0xe')](_0x6f6b('0xf'),_0x4672e6,_0x6f6b('0x10'));logger['debug'](_0x6f6b('0x11'),_0x4672e6,'request\x20sent',JSON[_0x6f6b('0x12')](_0x23f2b9));if(_0x23f2b9[_0x6f6b('0x13')]){if(_0x23f2b9[_0x6f6b('0x13')]['code']===0x1f4){logger[_0x6f6b('0x13')](_0x6f6b('0xf'),_0x4672e6,_0x23f2b9[_0x6f6b('0x13')][_0x6f6b('0x14')]);return _0x5eb3b0(_0x23f2b9[_0x6f6b('0x13')][_0x6f6b('0x14')]);}logger['error'](_0x6f6b('0xf'),_0x4672e6,_0x23f2b9['error'][_0x6f6b('0x14')]);return _0x2e8dd7(_0x23f2b9['error'][_0x6f6b('0x14')]);}else{logger[_0x6f6b('0xe')](_0x6f6b('0xf'),_0x4672e6,_0x6f6b('0x10'));_0x2e8dd7(_0x23f2b9[_0x6f6b('0x15')][_0x6f6b('0x14')]);}})[_0x6f6b('0x16')](function(_0x364156){logger['error'](_0x6f6b('0xf'),_0x4672e6,_0x364156);_0x5eb3b0(_0x364156);});});}exports[_0x6f6b('0x17')]=function(_0x2f8af7){var _0x3f992f=this;return new Promise(function(_0x158a9a,_0x522397){return db['ChatInteraction'][_0x6f6b('0x18')](_0x2f8af7[_0x6f6b('0x19')],{'raw':_0x2f8af7[_0x6f6b('0x1a')]?_0x2f8af7['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f8af7[_0x6f6b('0x1a')]?_0x2f8af7[_0x6f6b('0x1a')]['where']||null:null,'attributes':_0x2f8af7[_0x6f6b('0x1a')]?_0x2f8af7[_0x6f6b('0x1a')][_0x6f6b('0x1b')]||null:null,'limit':_0x2f8af7['options']?_0x2f8af7['options'][_0x6f6b('0x1c')]||null:null})[_0x6f6b('0xd')](function(_0x41f61c){logger[_0x6f6b('0xe')]('UpdateChatInteraction',_0x2f8af7);logger[_0x6f6b('0x1d')](_0x6f6b('0x17'),_0x2f8af7,JSON['stringify'](_0x41f61c));_0x158a9a(_0x41f61c);})['catch'](function(_0x49387b){logger[_0x6f6b('0x13')](_0x6f6b('0x17'),_0x49387b['message'],_0x2f8af7);_0x522397(_0x3f992f[_0x6f6b('0x13')](0x1f4,_0x49387b[_0x6f6b('0x14')]));});});};exports[_0x6f6b('0x1e')]=function(_0x4d15f8){return new Promise(function(_0x31ac09,_0x43c806){return db['ChatInteraction'][_0x6f6b('0x1f')]({'where':_0x4d15f8[_0x6f6b('0x1a')]?_0x4d15f8[_0x6f6b('0x1a')]['where']||null:null})['then'](function(_0x5dd367){if(_0x5dd367){return _0x5dd367[_0x6f6b('0x20')](_0x4d15f8[_0x6f6b('0x19')][_0x6f6b('0x21')],_[_0x6f6b('0x22')](_0x4d15f8[_0x6f6b('0x19')],['ids','id'])||{});}})['spread'](function(_0x486fed){logger[_0x6f6b('0xe')]('AddTags',_0x4d15f8);logger['debug'](_0x6f6b('0x23'),_0x4d15f8,JSON['stringify'](_0x486fed));_0x31ac09(_0x486fed);})[_0x6f6b('0x16')](function(_0x5de1e1){logger[_0x6f6b('0x13')]('AddTags',_0x5de1e1[_0x6f6b('0x14')],_0x4d15f8);_0x43c806(_this[_0x6f6b('0x13')](0x1f4,_0x5de1e1['message']));});});};
\ No newline at end of file
+var _0xa3e9=['defaults','redis','socket.io-emitter','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','attributes','info','body','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x3504ec,_0x4d738f){var _0xfb3f61=function(_0x140d2e){while(--_0x140d2e){_0x3504ec['push'](_0x3504ec['shift']());}};_0xfb3f61(++_0x4d738f);}(_0xa3e9,0x106));var _0x9a3e=function(_0xa312ca,_0x275d91){_0xa312ca=_0xa312ca-0x0;var _0x4a34fb=_0xa3e9[_0xa312ca];return _0x4a34fb;};'use strict';var _=require(_0x9a3e('0x0'));var util=require(_0x9a3e('0x1'));var moment=require(_0x9a3e('0x2'));var BPromise=require(_0x9a3e('0x3'));var rs=require(_0x9a3e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9a3e('0x5'));var logger=require(_0x9a3e('0x6'))(_0x9a3e('0x7'));var config=require(_0x9a3e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9a3e('0x9')][_0x9a3e('0xa')]({'port':0x232a});config['redis']=_[_0x9a3e('0xb')](config[_0x9a3e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9a3e('0xd'))(new Redis(config[_0x9a3e('0xc')]));require(_0x9a3e('0xe'))[_0x9a3e('0xf')](socket);function respondWithRpcPromise(_0x125ded,_0x444865,_0x5cd6ce){return new BPromise(function(_0x5cb494,_0x565a53){return client[_0x9a3e('0x10')](_0x125ded,_0x5cd6ce)[_0x9a3e('0x11')](function(_0x5614f8){logger['info'](_0x9a3e('0x12'),_0x444865,'request\x20sent');logger[_0x9a3e('0x13')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x444865,'request\x20sent',JSON[_0x9a3e('0x14')](_0x5614f8));if(_0x5614f8[_0x9a3e('0x15')]){if(_0x5614f8['error'][_0x9a3e('0x16')]===0x1f4){logger[_0x9a3e('0x15')](_0x9a3e('0x12'),_0x444865,_0x5614f8[_0x9a3e('0x15')][_0x9a3e('0x17')]);return _0x565a53(_0x5614f8[_0x9a3e('0x15')][_0x9a3e('0x17')]);}logger[_0x9a3e('0x15')](_0x9a3e('0x12'),_0x444865,_0x5614f8['error'][_0x9a3e('0x17')]);return _0x5cb494(_0x5614f8[_0x9a3e('0x15')][_0x9a3e('0x17')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x444865,_0x9a3e('0x18'));_0x5cb494(_0x5614f8[_0x9a3e('0x19')][_0x9a3e('0x17')]);}})[_0x9a3e('0x1a')](function(_0x173044){logger[_0x9a3e('0x15')](_0x9a3e('0x12'),_0x444865,_0x173044);_0x565a53(_0x173044);});});}exports[_0x9a3e('0x1b')]=function(_0x2852f5){var _0x1232e=this;return new Promise(function(_0x3dfbed,_0x45f6cd){return db[_0x9a3e('0x1c')][_0x9a3e('0x1d')](_0x2852f5['body'],{'raw':_0x2852f5[_0x9a3e('0x1e')]?_0x2852f5['options'][_0x9a3e('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2852f5[_0x9a3e('0x1e')]?_0x2852f5[_0x9a3e('0x1e')][_0x9a3e('0x20')]||null:null,'attributes':_0x2852f5[_0x9a3e('0x1e')]?_0x2852f5['options'][_0x9a3e('0x21')]||null:null,'limit':_0x2852f5[_0x9a3e('0x1e')]?_0x2852f5[_0x9a3e('0x1e')]['limit']||null:null})[_0x9a3e('0x11')](function(_0x48e69c){logger[_0x9a3e('0x22')]('UpdateChatInteraction',_0x2852f5);logger[_0x9a3e('0x13')]('UpdateChatInteraction',_0x2852f5,JSON[_0x9a3e('0x14')](_0x48e69c));_0x3dfbed(_0x48e69c);})['catch'](function(_0x113edb){logger[_0x9a3e('0x15')](_0x9a3e('0x1b'),_0x113edb[_0x9a3e('0x17')],_0x2852f5);_0x45f6cd(_0x1232e[_0x9a3e('0x15')](0x1f4,_0x113edb['message']));});});};exports['AddTagsToChatInteraction']=function(_0x24119b){return new Promise(function(_0xfd761b,_0x4f2f84){return db['ChatInteraction']['find']({'where':_0x24119b[_0x9a3e('0x1e')]?_0x24119b[_0x9a3e('0x1e')]['where']||null:null})[_0x9a3e('0x11')](function(_0xd8af1a){if(_0xd8af1a){return _0xd8af1a['addTags'](_0x24119b[_0x9a3e('0x23')][_0x9a3e('0x24')],_['omit'](_0x24119b['body'],[_0x9a3e('0x24'),'id'])||{});}})[_0x9a3e('0x25')](function(_0x147ee2){logger[_0x9a3e('0x22')]('AddTags',_0x24119b);logger[_0x9a3e('0x13')]('AddTags',_0x24119b,JSON[_0x9a3e('0x14')](_0x147ee2));_0xfd761b(_0x147ee2);})[_0x9a3e('0x1a')](function(_0x44f5c5){logger[_0x9a3e('0x15')](_0x9a3e('0x26'),_0x44f5c5['message'],_0x24119b);_0x4f2f84(_this[_0x9a3e('0x15')](0x1f4,_0x44f5c5['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index e7b3ea0..8c824e9 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 _0x7c91=['remove','update','emit','removeListener','chatInteraction:','./chatInteraction.events'];(function(_0x1b389d,_0x11579d){var _0x4704f2=function(_0x62739f){while(--_0x62739f){_0x1b389d['push'](_0x1b389d['shift']());}};_0x4704f2(++_0x11579d);}(_0x7c91,0x119));var _0x17c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c91[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require(_0x17c9('0x0'));var events=['save',_0x17c9('0x1'),_0x17c9('0x2')];function createListener(_0x182a97,_0x2c8dac){return function(_0x1e74d4){_0x2c8dac[_0x17c9('0x3')](_0x182a97,_0x1e74d4);};}function removeListener(_0x5b486f,_0x6f7866){return function(){ChatInteractionEvents[_0x17c9('0x4')](_0x5b486f,_0x6f7866);};}exports['register']=function(_0x498e9e){for(var _0x298fc2=0x0,_0x4b5030=events['length'];_0x298fc2<_0x4b5030;_0x298fc2++){var _0xfbd1d4=events[_0x298fc2];var _0x4d7861=createListener(_0x17c9('0x5')+_0xfbd1d4,_0x498e9e);ChatInteractionEvents['on'](_0xfbd1d4,_0x4d7861);}};
\ No newline at end of file
+var _0x09bf=['removeListener','register','length','chatInteraction:','./chatInteraction.events','remove','update'];(function(_0x5b013d,_0xc7691c){var _0x2b6eef=function(_0x3143ca){while(--_0x3143ca){_0x5b013d['push'](_0x5b013d['shift']());}};_0x2b6eef(++_0xc7691c);}(_0x09bf,0xa5));var _0xf09b=function(_0x5e3536,_0xace10d){_0x5e3536=_0x5e3536-0x0;var _0x3eb375=_0x09bf[_0x5e3536];return _0x3eb375;};'use strict';var ChatInteractionEvents=require(_0xf09b('0x0'));var events=['save',_0xf09b('0x1'),_0xf09b('0x2')];function createListener(_0x2c20e0,_0x5e2268){return function(_0x51e3b2){_0x5e2268['emit'](_0x2c20e0,_0x51e3b2);};}function removeListener(_0x457683,_0x2e575e){return function(){ChatInteractionEvents[_0xf09b('0x3')](_0x457683,_0x2e575e);};}exports[_0xf09b('0x4')]=function(_0xc2e1df){for(var _0xdcbbcb=0x0,_0xfe69b=events[_0xf09b('0x5')];_0xdcbbcb<_0xfe69b;_0xdcbbcb++){var _0x5b83b4=events[_0xdcbbcb];var _0x52828a=createListener(_0xf09b('0x6')+_0x5b83b4,_0xc2e1df);ChatInteractionEvents['on'](_0x5b83b4,_0x52828a);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 54aa5ad..6c72873 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 _0x46bf=['./chatInteraction.controller','get','isAuthenticated','/describe','describe','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','chat','addTags','chatinteraction:update','update','put','/:id/abandon','abandon','/:id/close','close','delete','/:id','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x46bf,0x1dc));var _0xf46b=function(_0x120123,_0x4eff59){_0x120123=_0x120123-0x0;var _0x3bec4c=_0x46bf[_0x120123];return _0x3bec4c;};'use strict';var multer=require(_0xf46b('0x0'));var util=require(_0xf46b('0x1'));var path=require(_0xf46b('0x2'));var timeout=require(_0xf46b('0x3'));var express=require(_0xf46b('0x4'));var router=express[_0xf46b('0x5')]();var fs_extra=require(_0xf46b('0x6'));var auth=require(_0xf46b('0x7'));var interaction=require(_0xf46b('0x8'));var config=require(_0xf46b('0x9'));var controller=require(_0xf46b('0xa'));router[_0xf46b('0xb')]('/',auth[_0xf46b('0xc')](),controller['index']);router[_0xf46b('0xb')](_0xf46b('0xd'),auth[_0xf46b('0xc')](),controller[_0xf46b('0xe')]);router['get']('/:id',auth[_0xf46b('0xf')](),controller['show']);router[_0xf46b('0xb')](_0xf46b('0x10'),auth[_0xf46b('0xf')](),controller[_0xf46b('0x11')]);router[_0xf46b('0xb')](_0xf46b('0x12'),auth[_0xf46b('0xc')](),controller[_0xf46b('0x13')]);router[_0xf46b('0xb')](_0xf46b('0x14'),auth[_0xf46b('0xf')](),controller[_0xf46b('0x15')]);router[_0xf46b('0xb')]('/:id/download',auth[_0xf46b('0xc')](),controller['download']);router[_0xf46b('0x16')]('/',auth[_0xf46b('0xc')](),controller[_0xf46b('0x17')]);router[_0xf46b('0x16')](_0xf46b('0x18'),auth[_0xf46b('0xc')](),controller[_0xf46b('0x19')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1cc1b6,_0x5ceb1d,_0x23a1d5){_0x23a1d5(null,path[_0xf46b('0x1a')](config[_0xf46b('0x1b')],_0xf46b('0x1c')));},'filename':function(_0x4dd30a,_0x5ad220,_0x39f48a){_0x39f48a(null,util[_0xf46b('0x1d')](_0xf46b('0x1e'),Date[_0xf46b('0x1f')](),_0x5ad220[_0xf46b('0x20')][_0xf46b('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf46b('0x16')](_0xf46b('0x22'),upload['single'](_0xf46b('0x23')),controller[_0xf46b('0x24')]);router[_0xf46b('0x16')](_0xf46b('0x12'),auth[_0xf46b('0xf')](),controller[_0xf46b('0x25')]);router[_0xf46b('0x16')]('/:id/tags',auth[_0xf46b('0xc')](),interaction['tracked'](_0xf46b('0x26'),'chatinteraction:addtags'),controller[_0xf46b('0x27')]);router['put']('/:id',auth[_0xf46b('0xc')](),interaction['tracked'](_0xf46b('0x26'),_0xf46b('0x28')),controller[_0xf46b('0x29')]);router[_0xf46b('0x2a')]('/:id/custom_update',controller['customUpdate']);router[_0xf46b('0x2a')](_0xf46b('0x2b'),auth[_0xf46b('0xf')](),controller[_0xf46b('0x2c')]);router[_0xf46b('0x2a')](_0xf46b('0x2d'),controller[_0xf46b('0x2e')]);router[_0xf46b('0x2f')](_0xf46b('0x30'),auth[_0xf46b('0xc')](),interaction['tracked'](_0xf46b('0x26'),_0xf46b('0x31')),controller[_0xf46b('0x32')]);router[_0xf46b('0x2f')](_0xf46b('0x33'),auth[_0xf46b('0xc')](),controller[_0xf46b('0x34')]);module[_0xf46b('0x35')]=router;
\ No newline at end of file
+var _0x707e=['close','destroy','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x707e,0xd8));var _0xe707=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x707e[_0xc8a931];return _0x28bd27;};'use strict';var multer=require(_0xe707('0x0'));var util=require(_0xe707('0x1'));var path=require(_0xe707('0x2'));var timeout=require(_0xe707('0x3'));var express=require(_0xe707('0x4'));var router=express['Router']();var fs_extra=require(_0xe707('0x5'));var auth=require(_0xe707('0x6'));var interaction=require(_0xe707('0x7'));var config=require(_0xe707('0x8'));var controller=require(_0xe707('0x9'));router[_0xe707('0xa')]('/',auth[_0xe707('0xb')](),controller[_0xe707('0xc')]);router[_0xe707('0xa')](_0xe707('0xd'),auth[_0xe707('0xb')](),controller['describe']);router['get'](_0xe707('0xe'),auth[_0xe707('0xf')](),controller[_0xe707('0x10')]);router['get']('/:id/attachment_download',auth[_0xe707('0xf')](),controller[_0xe707('0x11')]);router[_0xe707('0xa')](_0xe707('0x12'),auth[_0xe707('0xb')](),controller[_0xe707('0x13')]);router['get'](_0xe707('0x14'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router['get'](_0xe707('0x15'),auth[_0xe707('0xb')](),controller[_0xe707('0x16')]);router[_0xe707('0x17')]('/',auth[_0xe707('0xb')](),controller[_0xe707('0x18')]);router[_0xe707('0x17')](_0xe707('0x19'),auth[_0xe707('0xb')](),controller[_0xe707('0x1a')]);var upload=multer({'storage':multer[_0xe707('0x1b')]({'destination':function(_0x4eb2a6,_0x5872c4,_0x976f89){_0x976f89(null,path['join'](config[_0xe707('0x1c')],_0xe707('0x1d')));},'filename':function(_0x4b4aae,_0x3e3d82,_0x510703){_0x510703(null,util[_0xe707('0x1e')]('%s-%s',Date[_0xe707('0x1f')](),_0x3e3d82[_0xe707('0x20')][_0xe707('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe707('0x17')](_0xe707('0x22'),upload[_0xe707('0x23')]('file'),controller[_0xe707('0x24')]);router[_0xe707('0x17')](_0xe707('0x12'),auth[_0xe707('0xf')](),controller[_0xe707('0x25')]);router[_0xe707('0x17')](_0xe707('0x26'),auth[_0xe707('0xb')](),interaction[_0xe707('0x27')](_0xe707('0x28'),_0xe707('0x29')),controller[_0xe707('0x2a')]);router[_0xe707('0x2b')](_0xe707('0xe'),auth[_0xe707('0xb')](),interaction[_0xe707('0x27')]('chat',_0xe707('0x2c')),controller['update']);router[_0xe707('0x2b')](_0xe707('0x2d'),controller[_0xe707('0x2e')]);router['put'](_0xe707('0x2f'),auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0xe707('0x2b')](_0xe707('0x30'),controller[_0xe707('0x31')]);router['delete'](_0xe707('0xe'),auth['isAuthenticated'](),interaction[_0xe707('0x27')]('chat','chatinteraction:destroy'),controller[_0xe707('0x32')]);router[_0xe707('0x33')](_0xe707('0x26'),auth[_0xe707('0xb')](),controller['removeTags']);module[_0xe707('0x34')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 5adeac7..42c40d3 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 _0xf981=['BOOLEAN','INTEGER','sequelize','exports','medium'];(function(_0x5794cd,_0x4fb20c){var _0x4cb669=function(_0x18df71){while(--_0x18df71){_0x5794cd['push'](_0x5794cd['shift']());}};_0x4cb669(++_0x4fb20c);}(_0xf981,0x197));var _0x1f98=function(_0x38f061,_0x3ef289){_0x38f061=_0x38f061-0x0;var _0x472e32=_0xf981[_0x38f061];return _0x472e32;};'use strict';var Sequelize=require(_0x1f98('0x0'));module[_0x1f98('0x1')]={'body':{'type':Sequelize['TEXT'](_0x1f98('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x1f98('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x1f98('0x4')]}};
\ No newline at end of file
+var _0x659d=['exports','BOOLEAN','INTEGER','sequelize'];(function(_0x33694e,_0x3b7ca9){var _0x5c0ef0=function(_0x472e){while(--_0x472e){_0x33694e['push'](_0x33694e['shift']());}};_0x5c0ef0(++_0x3b7ca9);}(_0x659d,0xb3));var _0xd659=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0x659d[_0x4c6d6f];return _0x2d4478;};'use strict';var Sequelize=require(_0xd659('0x0'));module[_0xd659('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd659('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xd659('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index e293e45..2d8daa7 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 _0x28d6=['model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','fields','includeAll','create','body','update','find','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','getUsers','User','agent','admin','fullname','role','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','sendStatus','end','status','offset','count','limit','Content-Range','json','apply','reject','save','then','destroy','name','map','ChatInternalMessage','fieldName','key'];(function(_0x411559,_0x29ad23){var _0x3b51b5=function(_0x59424f){while(--_0x59424f){_0x411559['push'](_0x411559['shift']());}};_0x3b51b5(++_0x29ad23);}(_0x28d6,0x11d));var _0x628d=function(_0x526119,_0x5c4b34){_0x526119=_0x526119-0x0;var _0x402da2=_0x28d6[_0x526119];return _0x402da2;};'use strict';var emlformat=require(_0x628d('0x0'));var rimraf=require(_0x628d('0x1'));var zipdir=require(_0x628d('0x2'));var jsonpatch=require(_0x628d('0x3'));var rp=require(_0x628d('0x4'));var moment=require('moment');var BPromise=require(_0x628d('0x5'));var Mustache=require('mustache');var util=require(_0x628d('0x6'));var path=require('path');var sox=require(_0x628d('0x7'));var csv=require(_0x628d('0x8'));var ejs=require(_0x628d('0x9'));var fs=require('fs');var fs_extra=require(_0x628d('0xa'));var _=require(_0x628d('0xb'));var squel=require('squel');var crypto=require(_0x628d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x628d('0xd'));var toCsv=require(_0x628d('0x8'));var querystring=require(_0x628d('0xe'));var Papa=require(_0x628d('0xf'));var Redis=require('ioredis');var authService=require(_0x628d('0x10'));var qs=require(_0x628d('0x11'));var as=require(_0x628d('0x12'));var hardwareService=require(_0x628d('0x13'));var logger=require(_0x628d('0x14'))(_0x628d('0x15'));var utils=require(_0x628d('0x16'));var config=require(_0x628d('0x17'));var licenseUtil=require(_0x628d('0x18'));var db=require(_0x628d('0x19'))['db'];config[_0x628d('0x1a')]=_[_0x628d('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x628d('0x1c'))(new Redis(config['redis']));require(_0x628d('0x1d'))['register'](socket);function respondWithStatusCode(_0x1c4975,_0x4993b4){_0x4993b4=_0x4993b4||0xcc;return function(_0x34dd6c){if(_0x34dd6c){return _0x1c4975[_0x628d('0x1e')](_0x4993b4);}return _0x1c4975['status'](_0x4993b4)[_0x628d('0x1f')]();};}function respondWithResult(_0x3c738f,_0x2c71a0){_0x2c71a0=_0x2c71a0||0xc8;return function(_0xd30ca6){if(_0xd30ca6){return _0x3c738f[_0x628d('0x20')](_0x2c71a0)['json'](_0xd30ca6);}};}function respondWithFilteredResult(_0x175248,_0x126c0b){return function(_0x3438e7){if(_0x3438e7){var _0x3091bb=typeof _0x126c0b[_0x628d('0x21')]==='undefined'&&typeof _0x126c0b['limit']==='undefined';var _0xc3622d=_0x3438e7[_0x628d('0x22')];var _0x3e56c7=_0x3091bb?0x0:_0x126c0b[_0x628d('0x21')];var _0x2dcc43=_0x3091bb?_0x3438e7[_0x628d('0x22')]:_0x126c0b[_0x628d('0x21')]+_0x126c0b[_0x628d('0x23')];var _0x3a4045;if(_0x2dcc43>=_0xc3622d){_0x2dcc43=_0xc3622d;_0x3a4045=0xc8;}else{_0x3a4045=0xce;}_0x175248['status'](_0x3a4045);return _0x175248['set'](_0x628d('0x24'),_0x3e56c7+'-'+_0x2dcc43+'/'+_0xc3622d)[_0x628d('0x25')](_0x3438e7);}return null;};}function patchUpdates(_0x571fdd){return function(_0x58acea){try{jsonpatch[_0x628d('0x26')](_0x58acea,_0x571fdd,!![]);}catch(_0x30d13c){return BPromise[_0x628d('0x27')](_0x30d13c);}return _0x58acea[_0x628d('0x28')]();};}function saveUpdates(_0x5832c4,_0x3b68d9){return function(_0x2bcd96){if(_0x2bcd96){return _0x2bcd96['update'](_0x5832c4)[_0x628d('0x29')](function(_0x5e542b){return _0x5e542b;});}return null;};}function removeEntity(_0x31e9c0,_0x510471){return function(_0xfdefca){if(_0xfdefca){return _0xfdefca[_0x628d('0x2a')]()['then'](function(){_0x31e9c0[_0x628d('0x20')](0xcc)[_0x628d('0x1f')]();});}};}function handleEntityNotFound(_0x5d126d,_0x3f1441){return function(_0x2cd367){if(!_0x2cd367){_0x5d126d[_0x628d('0x1e')](0x194);}return _0x2cd367;};}function handleError(_0x3480ae,_0x41bdc6){_0x41bdc6=_0x41bdc6||0x1f4;return function(_0x4fbf38){logger['error'](_0x4fbf38['stack']);if(_0x4fbf38[_0x628d('0x2b')]){delete _0x4fbf38[_0x628d('0x2b')];}_0x3480ae['status'](_0x41bdc6)['send'](_0x4fbf38);};}exports['index']=function(_0xf8a59b,_0x15706b){var _0x5bd5dd={},_0x5ace9d={},_0x225265={'count':0x0,'rows':[]};var _0x212812=_[_0x628d('0x2c')](db[_0x628d('0x2d')]['rawAttributes'],function(_0x5a5e18){return{'name':_0x5a5e18[_0x628d('0x2e')],'type':_0x5a5e18['type'][_0x628d('0x2f')]};});_0x5ace9d[_0x628d('0x30')]=_['map'](_0x212812,'name');_0x5ace9d[_0x628d('0x31')]=_[_0x628d('0x32')](_0xf8a59b[_0x628d('0x31')]);_0x5ace9d[_0x628d('0x33')]=_[_0x628d('0x34')](_0x5ace9d['model'],_0x5ace9d[_0x628d('0x31')]);_0x5bd5dd[_0x628d('0x35')]=_[_0x628d('0x34')](_0x5ace9d[_0x628d('0x30')],qs['fields'](_0xf8a59b[_0x628d('0x31')]['fields']));_0x5bd5dd[_0x628d('0x35')]=_0x5bd5dd['attributes'][_0x628d('0x36')]?_0x5bd5dd[_0x628d('0x35')]:_0x5ace9d[_0x628d('0x30')];if(!_0xf8a59b['query']['hasOwnProperty'](_0x628d('0x37'))){_0x5bd5dd['limit']=qs[_0x628d('0x23')](_0xf8a59b[_0x628d('0x31')][_0x628d('0x23')]);_0x5bd5dd['offset']=qs[_0x628d('0x21')](_0xf8a59b[_0x628d('0x31')][_0x628d('0x21')]);}_0x5bd5dd[_0x628d('0x38')]=qs[_0x628d('0x39')](_0xf8a59b['query'][_0x628d('0x39')]);_0x5bd5dd[_0x628d('0x3a')]=qs[_0x628d('0x33')](_[_0x628d('0x3b')](_0xf8a59b['query'],_0x5ace9d[_0x628d('0x33')]),_0x212812);if(_0xf8a59b[_0x628d('0x31')][_0x628d('0x3c')]){_0x5bd5dd[_0x628d('0x3a')]=_[_0x628d('0x3d')](_0x5bd5dd[_0x628d('0x3a')],{'$or':_[_0x628d('0x2c')](_0x212812,function(_0x18558f){if(_0x18558f[_0x628d('0x3e')]!==_0x628d('0x3f')){var _0x398cdf={};_0x398cdf[_0x18558f[_0x628d('0x2b')]]={'$like':'%'+_0xf8a59b['query'][_0x628d('0x3c')]+'%'};return _0x398cdf;}})});}_0x5bd5dd=_['merge']({},_0x5bd5dd,_0xf8a59b[_0x628d('0x40')]);var _0x3968ff={'where':_0x5bd5dd[_0x628d('0x3a')]};return db[_0x628d('0x2d')][_0x628d('0x22')](_0x3968ff)[_0x628d('0x29')](function(_0x25852a){_0x225265[_0x628d('0x22')]=_0x25852a;if(_0xf8a59b[_0x628d('0x31')]['includeAll']){_0x5bd5dd[_0x628d('0x41')]=[{'all':!![]}];}return db[_0x628d('0x2d')][_0x628d('0x42')](_0x5bd5dd);})[_0x628d('0x29')](function(_0x2b46f2){_0x225265[_0x628d('0x43')]=_0x2b46f2;return _0x225265;})[_0x628d('0x29')](respondWithFilteredResult(_0x15706b,_0x5bd5dd))[_0x628d('0x44')](handleError(_0x15706b,null));};exports[_0x628d('0x45')]=function(_0x2a23aa,_0x18962b){var _0xa35248={'raw':!![],'where':{'id':_0x2a23aa[_0x628d('0x46')]['id']}},_0x175c6e={};_0x175c6e['model']=_[_0x628d('0x32')](db[_0x628d('0x2d')][_0x628d('0x47')]);_0x175c6e[_0x628d('0x31')]=_[_0x628d('0x32')](_0x2a23aa[_0x628d('0x31')]);_0x175c6e[_0x628d('0x33')]=_['intersection'](_0x175c6e['model'],_0x175c6e['query']);_0xa35248[_0x628d('0x35')]=_[_0x628d('0x34')](_0x175c6e[_0x628d('0x30')],qs[_0x628d('0x48')](_0x2a23aa[_0x628d('0x31')][_0x628d('0x48')]));_0xa35248[_0x628d('0x35')]=_0xa35248[_0x628d('0x35')][_0x628d('0x36')]?_0xa35248[_0x628d('0x35')]:_0x175c6e['model'];if(_0x2a23aa[_0x628d('0x31')][_0x628d('0x49')]){_0xa35248[_0x628d('0x41')]=[{'all':!![]}];}_0xa35248=_[_0x628d('0x3d')]({},_0xa35248,_0x2a23aa[_0x628d('0x40')]);return db[_0x628d('0x2d')]['find'](_0xa35248)[_0x628d('0x29')](handleEntityNotFound(_0x18962b,null))[_0x628d('0x29')](respondWithResult(_0x18962b,null))[_0x628d('0x44')](handleError(_0x18962b,null));};exports[_0x628d('0x4a')]=function(_0x27f291,_0x508aa1){return db['ChatInternalMessage'][_0x628d('0x4a')](_0x27f291[_0x628d('0x4b')],{})[_0x628d('0x29')](respondWithResult(_0x508aa1,0xc9))['catch'](handleError(_0x508aa1,null));};exports[_0x628d('0x4c')]=function(_0x27fbf6,_0x5e72c7){if(_0x27fbf6['body']['id']){delete _0x27fbf6[_0x628d('0x4b')]['id'];}return db[_0x628d('0x2d')][_0x628d('0x4d')]({'where':{'id':_0x27fbf6[_0x628d('0x46')]['id']}})['then'](handleEntityNotFound(_0x5e72c7,null))[_0x628d('0x29')](saveUpdates(_0x27fbf6[_0x628d('0x4b')],null))[_0x628d('0x29')](respondWithResult(_0x5e72c7,null))[_0x628d('0x44')](handleError(_0x5e72c7,null));};exports[_0x628d('0x2a')]=function(_0x166c50,_0x22e9b2){return db[_0x628d('0x2d')][_0x628d('0x4d')]({'where':{'id':_0x166c50[_0x628d('0x46')]['id']}})['then'](handleEntityNotFound(_0x22e9b2,null))[_0x628d('0x29')](removeEntity(_0x22e9b2,null))[_0x628d('0x44')](handleError(_0x22e9b2,null));};exports[_0x628d('0x4e')]=function(_0x10849c,_0x5e2c1d){return db[_0x628d('0x2d')][_0x628d('0x4e')]()['then'](respondWithResult(_0x5e2c1d,null))[_0x628d('0x44')](handleError(_0x5e2c1d,null));};function wrapUser(_0x2c5261){return function(_0x9597a){var _0x3b4c0b=_0x2c5261[_0x628d('0x4f')]({'plain':!![]});_0x3b4c0b[_0x628d('0x50')]=[];if(_0x9597a){_0x3b4c0b[_0x628d('0x51')]=_0x9597a[_0x628d('0x52')];_0x3b4c0b[_0x628d('0x53')]=_0x9597a;}else{_0x3b4c0b[_0x628d('0x51')]=moment(0x0)[_0x628d('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x3b4c0b[_0x628d('0x53')]={};}return _0x3b4c0b;};}exports[_0x628d('0x55')]=function(_0x39c1b3,_0x3f312b,_0x46d54d){var _0x48c15e=[];return db[_0x628d('0x56')]['findAll']({'where':{'role':[_0x628d('0x57'),_0x628d('0x58'),'user']},'attributes':['id',_0x628d('0x59'),'name',_0x628d('0x5a'),'userpic','internal',_0x628d('0x5b'),_0x628d('0x5c'),_0x628d('0x5d'),_0x628d('0x5e')],'order':qs[_0x628d('0x39')](_0x628d('0x5f')),'include':[{'model':db[_0x628d('0x60')],'as':_0x628d('0x61'),'attributes':['id',_0x628d('0x2b'),_0x628d('0x3e')],'through':{'attributes':[]}}]})[_0x628d('0x29')](function(_0x77a14b){if(_0x77a14b){var _0x4d66ba=_0x39c1b3[_0x628d('0x62')]['get']({'plain':!![]});if(!_0x4d66ba)throw new Error(_0x628d('0x63'));if(_0x4d66ba[_0x628d('0x5a')]==='user'){return db[_0x628d('0x64')]['find']({'where':{'name':_0x628d('0x65'),'userProfileId':_0x4d66ba[_0x628d('0x66')]},'raw':!![]})[_0x628d('0x29')](function(_0x16d0e5){if(_0x16d0e5){if(_0x16d0e5[_0x628d('0x67')]===0x0){return db[_0x628d('0x68')][_0x628d('0x42')]({'where':{'sectionId':_0x16d0e5['id']},'raw':!![]})['then'](function(_0x2ebba5){var _0x3818ab=[];if(_[_0x628d('0x69')](_0x2ebba5)){_0x3818ab=_[_0x628d('0x3c')](_0x77a14b,function(_0x21ff6b){if(_0x21ff6b['role']!=='agent'){return _0x21ff6b;}});return _0x3818ab;}else{for(var _0x54eb00=0x0;_0x54eb00<_0x77a14b[_0x628d('0x36')];_0x54eb00++){var _0x16a24b=_0x77a14b[_0x54eb00];if(_0x16a24b[_0x628d('0x5a')]==='agent'){var _0xc27752=_[_0x628d('0x4d')](_0x2ebba5,function(_0xa43811){return _0xa43811[_0x628d('0x6a')]===_0x16a24b['id'];});if(_0xc27752)_0x3818ab[_0x628d('0x6b')](_0x16a24b);}else{_0x3818ab[_0x628d('0x6b')](_0x16a24b);}}return _0x3818ab;}});}else{return _0x77a14b;}}else{var _0x38b01b=_['filter'](_0x77a14b,function(_0x5e284e){if(_0x5e284e[_0x628d('0x5a')]!==_0x628d('0x57')){return _0x5e284e;}});return _0x38b01b;}});}else{return _0x77a14b;}}})[_0x628d('0x29')](function(_0x40e568){var _0x525076=[];if(_0x40e568){_0x48c15e=_0x40e568;for(var _0x45a0d8=0x0;_0x45a0d8<_0x40e568[_0x628d('0x36')];_0x45a0d8+=0x1){_0x48c15e[_0x45a0d8][_0x628d('0x50')]=[];_0x525076[_0x628d('0x6b')](db[_0x628d('0x2d')][_0x628d('0x4d')]({'where':{'FromId':[_0x39c1b3['user']['id'],_0x40e568[_0x45a0d8]['id']],'ToId':[_0x39c1b3['user']['id'],_0x40e568[_0x45a0d8]['id']],'ChatGroupId':null},'attributes':['id',_0x628d('0x52'),'FromId','ToId',_0x628d('0x6c'),_0x628d('0x4b')],'order':qs[_0x628d('0x39')](_0x628d('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x628d('0x29')](wrapUser(_0x40e568[_0x45a0d8])));}return BPromise[_0x628d('0x6e')](_0x525076);}return[];})[_0x628d('0x29')](function(_0x2b0cf6){return{'rows':_0x2b0cf6,'count':_0x2b0cf6['length']};})[_0x628d('0x29')](respondWithResult(_0x3f312b,null))[_0x628d('0x44')](handleError(_0x3f312b,null));};
\ No newline at end of file
+var _0x5e74=['describe','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','isEmpty','agent','push','createdAt','FromId','ToId','-createdAt','all','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','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','redis','defaults','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','ChatInternalMessage','includeAll','findAll','rows','catch','show','params','include','merge','options','create','body','find'];(function(_0x14fa15,_0x2b8f8d){var _0xad984d=function(_0x2da1f6){while(--_0x2da1f6){_0x14fa15['push'](_0x14fa15['shift']());}};_0xad984d(++_0x2b8f8d);}(_0x5e74,0x161));var _0x45e7=function(_0x53228b,_0x4c83eb){_0x53228b=_0x53228b-0x0;var _0x5d5d6a=_0x5e74[_0x53228b];return _0x5d5d6a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x45e7('0x0'));var zipdir=require(_0x45e7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x45e7('0x2'));var moment=require(_0x45e7('0x3'));var BPromise=require(_0x45e7('0x4'));var Mustache=require('mustache');var util=require(_0x45e7('0x5'));var path=require(_0x45e7('0x6'));var sox=require(_0x45e7('0x7'));var csv=require(_0x45e7('0x8'));var ejs=require(_0x45e7('0x9'));var fs=require('fs');var fs_extra=require(_0x45e7('0xa'));var _=require(_0x45e7('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x45e7('0xc'));var toCsv=require(_0x45e7('0x8'));var querystring=require(_0x45e7('0xd'));var Papa=require(_0x45e7('0xe'));var Redis=require(_0x45e7('0xf'));var authService=require(_0x45e7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x45e7('0x11'));var hardwareService=require(_0x45e7('0x12'));var logger=require(_0x45e7('0x13'))(_0x45e7('0x14'));var utils=require(_0x45e7('0x15'));var config=require(_0x45e7('0x16'));var licenseUtil=require(_0x45e7('0x17'));var db=require(_0x45e7('0x18'))['db'];config[_0x45e7('0x19')]=_[_0x45e7('0x1a')](config[_0x45e7('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x45e7('0x19')]));require('./chatInternalMessage.socket')[_0x45e7('0x1b')](socket);function respondWithStatusCode(_0x424eff,_0x51f3cb){_0x51f3cb=_0x51f3cb||0xcc;return function(_0x2fba9d){if(_0x2fba9d){return _0x424eff[_0x45e7('0x1c')](_0x51f3cb);}return _0x424eff[_0x45e7('0x1d')](_0x51f3cb)[_0x45e7('0x1e')]();};}function respondWithResult(_0x34491e,_0x3b0eb9){_0x3b0eb9=_0x3b0eb9||0xc8;return function(_0x1b6a91){if(_0x1b6a91){return _0x34491e[_0x45e7('0x1d')](_0x3b0eb9)[_0x45e7('0x1f')](_0x1b6a91);}};}function respondWithFilteredResult(_0x206ac6,_0x2fe01f){return function(_0x41543f){if(_0x41543f){var _0x41b2fe=typeof _0x2fe01f[_0x45e7('0x20')]==='undefined'&&typeof _0x2fe01f[_0x45e7('0x21')]===_0x45e7('0x22');var _0x5355f7=_0x41543f[_0x45e7('0x23')];var _0x310fe3=_0x41b2fe?0x0:_0x2fe01f[_0x45e7('0x20')];var _0xbe667e=_0x41b2fe?_0x41543f['count']:_0x2fe01f[_0x45e7('0x20')]+_0x2fe01f[_0x45e7('0x21')];var _0x596f52;if(_0xbe667e>=_0x5355f7){_0xbe667e=_0x5355f7;_0x596f52=0xc8;}else{_0x596f52=0xce;}_0x206ac6[_0x45e7('0x1d')](_0x596f52);return _0x206ac6[_0x45e7('0x24')](_0x45e7('0x25'),_0x310fe3+'-'+_0xbe667e+'/'+_0x5355f7)[_0x45e7('0x1f')](_0x41543f);}return null;};}function patchUpdates(_0xd00b5a){return function(_0xea441){try{jsonpatch[_0x45e7('0x26')](_0xea441,_0xd00b5a,!![]);}catch(_0xd17106){return BPromise['reject'](_0xd17106);}return _0xea441[_0x45e7('0x27')]();};}function saveUpdates(_0x341dd6,_0x32940e){return function(_0x432aa4){if(_0x432aa4){return _0x432aa4[_0x45e7('0x28')](_0x341dd6)[_0x45e7('0x29')](function(_0x4bdab2){return _0x4bdab2;});}return null;};}function removeEntity(_0x700d2e,_0x12f57c){return function(_0x388dc1){if(_0x388dc1){return _0x388dc1[_0x45e7('0x2a')]()['then'](function(){_0x700d2e[_0x45e7('0x1d')](0xcc)[_0x45e7('0x1e')]();});}};}function handleEntityNotFound(_0x81866f,_0x96f295){return function(_0x356350){if(!_0x356350){_0x81866f[_0x45e7('0x1c')](0x194);}return _0x356350;};}function handleError(_0x40f0e8,_0x50c95f){_0x50c95f=_0x50c95f||0x1f4;return function(_0x40dd93){logger[_0x45e7('0x2b')](_0x40dd93[_0x45e7('0x2c')]);if(_0x40dd93[_0x45e7('0x2d')]){delete _0x40dd93[_0x45e7('0x2d')];}_0x40f0e8[_0x45e7('0x1d')](_0x50c95f)[_0x45e7('0x2e')](_0x40dd93);};}exports[_0x45e7('0x2f')]=function(_0x5b506c,_0x38644e){var _0x15d9a7={},_0x447fb1={},_0x54ecab={'count':0x0,'rows':[]};var _0x5b73f1=_[_0x45e7('0x30')](db['ChatInternalMessage'][_0x45e7('0x31')],function(_0x172f42){return{'name':_0x172f42[_0x45e7('0x32')],'type':_0x172f42[_0x45e7('0x33')][_0x45e7('0x34')]};});_0x447fb1[_0x45e7('0x35')]=_[_0x45e7('0x30')](_0x5b73f1,_0x45e7('0x2d'));_0x447fb1['query']=_[_0x45e7('0x36')](_0x5b506c[_0x45e7('0x37')]);_0x447fb1[_0x45e7('0x38')]=_[_0x45e7('0x39')](_0x447fb1[_0x45e7('0x35')],_0x447fb1['query']);_0x15d9a7[_0x45e7('0x3a')]=_[_0x45e7('0x39')](_0x447fb1['model'],qs[_0x45e7('0x3b')](_0x5b506c[_0x45e7('0x37')][_0x45e7('0x3b')]));_0x15d9a7[_0x45e7('0x3a')]=_0x15d9a7[_0x45e7('0x3a')][_0x45e7('0x3c')]?_0x15d9a7['attributes']:_0x447fb1[_0x45e7('0x35')];if(!_0x5b506c[_0x45e7('0x37')][_0x45e7('0x3d')](_0x45e7('0x3e'))){_0x15d9a7[_0x45e7('0x21')]=qs[_0x45e7('0x21')](_0x5b506c[_0x45e7('0x37')][_0x45e7('0x21')]);_0x15d9a7[_0x45e7('0x20')]=qs[_0x45e7('0x20')](_0x5b506c['query'][_0x45e7('0x20')]);}_0x15d9a7['order']=qs[_0x45e7('0x3f')](_0x5b506c['query'][_0x45e7('0x3f')]);_0x15d9a7[_0x45e7('0x40')]=qs['filters'](_['pick'](_0x5b506c[_0x45e7('0x37')],_0x447fb1[_0x45e7('0x38')]),_0x5b73f1);if(_0x5b506c[_0x45e7('0x37')][_0x45e7('0x41')]){_0x15d9a7[_0x45e7('0x40')]=_['merge'](_0x15d9a7[_0x45e7('0x40')],{'$or':_[_0x45e7('0x30')](_0x5b73f1,function(_0x21ba5d){if(_0x21ba5d[_0x45e7('0x33')]!=='VIRTUAL'){var _0x58108d={};_0x58108d[_0x21ba5d[_0x45e7('0x2d')]]={'$like':'%'+_0x5b506c[_0x45e7('0x37')][_0x45e7('0x41')]+'%'};return _0x58108d;}})});}_0x15d9a7=_['merge']({},_0x15d9a7,_0x5b506c['options']);var _0x2d3067={'where':_0x15d9a7[_0x45e7('0x40')]};return db[_0x45e7('0x42')][_0x45e7('0x23')](_0x2d3067)[_0x45e7('0x29')](function(_0x10e3d9){_0x54ecab[_0x45e7('0x23')]=_0x10e3d9;if(_0x5b506c[_0x45e7('0x37')][_0x45e7('0x43')]){_0x15d9a7['include']=[{'all':!![]}];}return db[_0x45e7('0x42')][_0x45e7('0x44')](_0x15d9a7);})[_0x45e7('0x29')](function(_0x2166d5){_0x54ecab[_0x45e7('0x45')]=_0x2166d5;return _0x54ecab;})[_0x45e7('0x29')](respondWithFilteredResult(_0x38644e,_0x15d9a7))[_0x45e7('0x46')](handleError(_0x38644e,null));};exports[_0x45e7('0x47')]=function(_0x483dcf,_0x10e4c){var _0xffd3e5={'raw':!![],'where':{'id':_0x483dcf[_0x45e7('0x48')]['id']}},_0x265a49={};_0x265a49['model']=_['keys'](db[_0x45e7('0x42')][_0x45e7('0x31')]);_0x265a49[_0x45e7('0x37')]=_[_0x45e7('0x36')](_0x483dcf[_0x45e7('0x37')]);_0x265a49[_0x45e7('0x38')]=_['intersection'](_0x265a49[_0x45e7('0x35')],_0x265a49[_0x45e7('0x37')]);_0xffd3e5['attributes']=_[_0x45e7('0x39')](_0x265a49['model'],qs[_0x45e7('0x3b')](_0x483dcf['query'][_0x45e7('0x3b')]));_0xffd3e5[_0x45e7('0x3a')]=_0xffd3e5[_0x45e7('0x3a')][_0x45e7('0x3c')]?_0xffd3e5['attributes']:_0x265a49[_0x45e7('0x35')];if(_0x483dcf[_0x45e7('0x37')][_0x45e7('0x43')]){_0xffd3e5[_0x45e7('0x49')]=[{'all':!![]}];}_0xffd3e5=_[_0x45e7('0x4a')]({},_0xffd3e5,_0x483dcf[_0x45e7('0x4b')]);return db[_0x45e7('0x42')]['find'](_0xffd3e5)['then'](handleEntityNotFound(_0x10e4c,null))[_0x45e7('0x29')](respondWithResult(_0x10e4c,null))[_0x45e7('0x46')](handleError(_0x10e4c,null));};exports[_0x45e7('0x4c')]=function(_0xac7350,_0x5cd02a){return db[_0x45e7('0x42')][_0x45e7('0x4c')](_0xac7350[_0x45e7('0x4d')],{})[_0x45e7('0x29')](respondWithResult(_0x5cd02a,0xc9))[_0x45e7('0x46')](handleError(_0x5cd02a,null));};exports[_0x45e7('0x28')]=function(_0x2da8ac,_0x50fc0a){if(_0x2da8ac[_0x45e7('0x4d')]['id']){delete _0x2da8ac[_0x45e7('0x4d')]['id'];}return db[_0x45e7('0x42')][_0x45e7('0x4e')]({'where':{'id':_0x2da8ac[_0x45e7('0x48')]['id']}})[_0x45e7('0x29')](handleEntityNotFound(_0x50fc0a,null))['then'](saveUpdates(_0x2da8ac[_0x45e7('0x4d')],null))['then'](respondWithResult(_0x50fc0a,null))[_0x45e7('0x46')](handleError(_0x50fc0a,null));};exports['destroy']=function(_0x2ade59,_0x5eaa66){return db[_0x45e7('0x42')]['find']({'where':{'id':_0x2ade59[_0x45e7('0x48')]['id']}})['then'](handleEntityNotFound(_0x5eaa66,null))[_0x45e7('0x29')](removeEntity(_0x5eaa66,null))[_0x45e7('0x46')](handleError(_0x5eaa66,null));};exports[_0x45e7('0x4f')]=function(_0x4abc41,_0x3f7f68){return db[_0x45e7('0x42')]['describe']()[_0x45e7('0x29')](respondWithResult(_0x3f7f68,null))[_0x45e7('0x46')](handleError(_0x3f7f68,null));};function wrapUser(_0x11a411){return function(_0x4f6e09){var _0x491ab0=_0x11a411['get']({'plain':!![]});_0x491ab0[_0x45e7('0x50')]=[];if(_0x4f6e09){_0x491ab0[_0x45e7('0x51')]=_0x4f6e09['createdAt'];_0x491ab0[_0x45e7('0x52')]=_0x4f6e09;}else{_0x491ab0[_0x45e7('0x51')]=moment(0x0)[_0x45e7('0x53')](_0x45e7('0x54'));_0x491ab0[_0x45e7('0x52')]={};}return _0x491ab0;};}exports[_0x45e7('0x55')]=function(_0xb087e5,_0x2227c0,_0x2af321){var _0x2effba=[];return db[_0x45e7('0x56')]['findAll']({'where':{'role':['agent',_0x45e7('0x57'),'user']},'attributes':['id','fullname',_0x45e7('0x2d'),_0x45e7('0x58'),_0x45e7('0x59'),'internal',_0x45e7('0x5a'),_0x45e7('0x5b'),_0x45e7('0x5c'),_0x45e7('0x5d')],'order':qs[_0x45e7('0x3f')]('-online'),'include':[{'model':db[_0x45e7('0x5e')],'as':'VoiceQueues','attributes':['id',_0x45e7('0x2d'),_0x45e7('0x33')],'through':{'attributes':[]}}]})[_0x45e7('0x29')](function(_0xb3a958){if(_0xb3a958){var _0x3525b5=_0xb087e5[_0x45e7('0x5f')]['get']({'plain':!![]});if(!_0x3525b5)throw new Error(_0x45e7('0x60'));if(_0x3525b5[_0x45e7('0x58')]==='user'){return db[_0x45e7('0x61')]['find']({'where':{'name':'Agents','userProfileId':_0x3525b5[_0x45e7('0x62')]},'raw':!![]})['then'](function(_0x41e92d){if(_0x41e92d){if(_0x41e92d['autoAssociation']===0x0){return db[_0x45e7('0x63')][_0x45e7('0x44')]({'where':{'sectionId':_0x41e92d['id']},'raw':!![]})[_0x45e7('0x29')](function(_0x271c60){var _0xac8aa0=[];if(_[_0x45e7('0x64')](_0x271c60)){_0xac8aa0=_[_0x45e7('0x41')](_0xb3a958,function(_0xdb080a){if(_0xdb080a['role']!==_0x45e7('0x65')){return _0xdb080a;}});return _0xac8aa0;}else{for(var _0x295ade=0x0;_0x295ade<_0xb3a958[_0x45e7('0x3c')];_0x295ade++){var _0x228022=_0xb3a958[_0x295ade];if(_0x228022[_0x45e7('0x58')]===_0x45e7('0x65')){var _0xf22f0=_[_0x45e7('0x4e')](_0x271c60,function(_0x2f999e){return _0x2f999e['resourceId']===_0x228022['id'];});if(_0xf22f0)_0xac8aa0[_0x45e7('0x66')](_0x228022);}else{_0xac8aa0['push'](_0x228022);}}return _0xac8aa0;}});}else{return _0xb3a958;}}else{var _0xd229b7=_[_0x45e7('0x41')](_0xb3a958,function(_0x2eec30){if(_0x2eec30['role']!==_0x45e7('0x65')){return _0x2eec30;}});return _0xd229b7;}});}else{return _0xb3a958;}}})[_0x45e7('0x29')](function(_0x4596cd){var _0x43d0cb=[];if(_0x4596cd){_0x2effba=_0x4596cd;for(var _0x1c3aa3=0x0;_0x1c3aa3<_0x4596cd['length'];_0x1c3aa3+=0x1){_0x2effba[_0x1c3aa3]['messages']=[];_0x43d0cb[_0x45e7('0x66')](db[_0x45e7('0x42')][_0x45e7('0x4e')]({'where':{'FromId':[_0xb087e5[_0x45e7('0x5f')]['id'],_0x4596cd[_0x1c3aa3]['id']],'ToId':[_0xb087e5[_0x45e7('0x5f')]['id'],_0x4596cd[_0x1c3aa3]['id']],'ChatGroupId':null},'attributes':['id',_0x45e7('0x67'),_0x45e7('0x68'),_0x45e7('0x69'),'read',_0x45e7('0x4d')],'order':qs[_0x45e7('0x3f')](_0x45e7('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x45e7('0x29')](wrapUser(_0x4596cd[_0x1c3aa3])));}return BPromise[_0x45e7('0x6b')](_0x43d0cb);}return[];})[_0x45e7('0x29')](function(_0x13c231){return{'rows':_0x13c231,'count':_0x13c231[_0x45e7('0x3c')]};})[_0x45e7('0x29')](respondWithResult(_0x2227c0,null))[_0x45e7('0x46')](handleError(_0x2227c0,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 469cc73..3bb5e00 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 _0x3f13=['emit','hook','exports','events','setMaxListeners','remove'];(function(_0x90f6be,_0x5ebf25){var _0x41f160=function(_0x4ea5f6){while(--_0x4ea5f6){_0x90f6be['push'](_0x90f6be['shift']());}};_0x41f160(++_0x5ebf25);}(_0x3f13,0x10b));var _0x33f1=function(_0x4d63a3,_0x1b5e8f){_0x4d63a3=_0x4d63a3-0x0;var _0x1ed1f4=_0x3f13[_0x4d63a3];return _0x1ed1f4;};'use strict';var EventEmitter=require(_0x33f1('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x33f1('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x33f1('0x2')};function emitEvent(_0x19c54b){return function(_0xee5a5,_0xa0e1de,_0x4458eb){ChatInternalMessageEvents[_0x33f1('0x3')](_0x19c54b+':'+_0xee5a5['id'],_0xee5a5);ChatInternalMessageEvents[_0x33f1('0x3')](_0x19c54b,_0xee5a5);_0x4458eb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x33f1('0x4')](e,emitEvent(event));}}module[_0x33f1('0x5')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xbca0=['../../mysqldb','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x44fd6b,_0x5c9794){var _0x1ca5df=function(_0x3d471e){while(--_0x3d471e){_0x44fd6b['push'](_0x44fd6b['shift']());}};_0x1ca5df(++_0x5c9794);}(_0xbca0,0x8b));var _0x0bca=function(_0x327690,_0x34adb1){_0x327690=_0x327690-0x0;var _0xad5ead=_0xbca0[_0x327690];return _0xad5ead;};'use strict';var EventEmitter=require(_0x0bca('0x0'));var ChatInternalMessage=require(_0x0bca('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0bca('0x2'),'afterDestroy':_0x0bca('0x3')};function emitEvent(_0x3ce28e){return function(_0x1a6cb5,_0x595711,_0x494f51){ChatInternalMessageEvents[_0x0bca('0x4')](_0x3ce28e+':'+_0x1a6cb5['id'],_0x1a6cb5);ChatInternalMessageEvents[_0x0bca('0x4')](_0x3ce28e,_0x1a6cb5);_0x494f51(null);};}for(var e in events){if(events[_0x0bca('0x5')](e)){var event=events[e];ChatInternalMessage[_0x0bca('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 9aa9dec..c0dec1d 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 _0xab2c=['utf8mb4','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages'];(function(_0x5cb278,_0x4f721e){var _0x9dd564=function(_0x14798c){while(--_0x14798c){_0x5cb278['push'](_0x5cb278['shift']());}};_0x9dd564(++_0x4f721e);}(_0xab2c,0xb7));var _0xcab2=function(_0x2f2d88,_0x32815c){_0x2f2d88=_0x2f2d88-0x0;var _0x4742ee=_0xab2c[_0x2f2d88];return _0x4742ee;};'use strict';var _=require(_0xcab2('0x0'));var util=require('util');var logger=require(_0xcab2('0x1'))(_0xcab2('0x2'));var moment=require('moment');var BPromise=require(_0xcab2('0x3'));var rp=require(_0xcab2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcab2('0x5'));var config=require(_0xcab2('0x6'));var attributes=require(_0xcab2('0x7'));module[_0xcab2('0x8')]=function(_0x2cd871,_0x379ef3){return _0x2cd871[_0xcab2('0x9')](_0xcab2('0xa'),attributes,{'tableName':_0xcab2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcab2('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xc232=['utf8mb4','lodash','util','../../config/logger','moment','bluebird','path','exports','chat_internal_messages'];(function(_0x5b4070,_0x27332f){var _0x4db834=function(_0x29cab5){while(--_0x29cab5){_0x5b4070['push'](_0x5b4070['shift']());}};_0x4db834(++_0x27332f);}(_0xc232,0x118));var _0x2c23=function(_0x3b970b,_0x2ff4aa){_0x3b970b=_0x3b970b-0x0;var _0x202d50=_0xc232[_0x3b970b];return _0x202d50;};'use strict';var _=require(_0x2c23('0x0'));var util=require(_0x2c23('0x1'));var logger=require(_0x2c23('0x2'))('api');var moment=require(_0x2c23('0x3'));var BPromise=require(_0x2c23('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c23('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x2c23('0x6')]=function(_0x243128,_0x21738b){return _0x243128['define']('ChatInternalMessage',attributes,{'tableName':_0x2c23('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2c23('0x8'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 95c3a6c..c0f8c4b 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 _0xa271=['message','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','redis','localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3b59e8,_0x117635){var _0x441493=function(_0x22802d){while(--_0x22802d){_0x3b59e8['push'](_0x3b59e8['shift']());}};_0x441493(++_0x117635);}(_0xa271,0xe8));var _0x1a27=function(_0x5124d2,_0x3400cb){_0x5124d2=_0x5124d2-0x0;var _0x361478=_0xa271[_0x5124d2];return _0x361478;};'use strict';var _=require('lodash');var util=require(_0x1a27('0x0'));var moment=require(_0x1a27('0x1'));var BPromise=require(_0x1a27('0x2'));var rs=require(_0x1a27('0x3'));var fs=require('fs');var Redis=require(_0x1a27('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a27('0x5'));var logger=require('../../config/logger')(_0x1a27('0x6'));var config=require('../../config/environment');var jayson=require(_0x1a27('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x1a27('0x8')]=_['defaults'](config[_0x1a27('0x8')],{'host':_0x1a27('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1a27('0x8')]));require(_0x1a27('0xa'))[_0x1a27('0xb')](socket);function respondWithRpcPromise(_0x1167c6,_0x42e712,_0x19def0){return new BPromise(function(_0x5538bd,_0x5656c5){return client[_0x1a27('0xc')](_0x1167c6,_0x19def0)[_0x1a27('0xd')](function(_0x5dcbba){logger[_0x1a27('0xe')](_0x1a27('0xf'),_0x42e712,_0x1a27('0x10'));logger['debug'](_0x1a27('0x11'),_0x42e712,_0x1a27('0x10'),JSON['stringify'](_0x5dcbba));if(_0x5dcbba[_0x1a27('0x12')]){if(_0x5dcbba[_0x1a27('0x12')][_0x1a27('0x13')]===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x42e712,_0x5dcbba[_0x1a27('0x12')][_0x1a27('0x14')]);return _0x5656c5(_0x5dcbba[_0x1a27('0x12')][_0x1a27('0x14')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x42e712,_0x5dcbba[_0x1a27('0x12')][_0x1a27('0x14')]);return _0x5538bd(_0x5dcbba[_0x1a27('0x12')][_0x1a27('0x14')]);}else{logger[_0x1a27('0xe')](_0x1a27('0xf'),_0x42e712,'request\x20sent');_0x5538bd(_0x5dcbba['result'][_0x1a27('0x14')]);}})['catch'](function(_0x56b530){logger[_0x1a27('0x12')](_0x1a27('0xf'),_0x42e712,_0x56b530);_0x5656c5(_0x56b530);});});}
\ No newline at end of file
+var _0x0a5c=['request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register'];(function(_0x243a75,_0x4acb96){var _0x2cdf79=function(_0x15e913){while(--_0x15e913){_0x243a75['push'](_0x243a75['shift']());}};_0x2cdf79(++_0x4acb96);}(_0x0a5c,0x97));var _0xc0a5=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x0a5c[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0xc0a5('0x0'));var util=require('util');var moment=require(_0xc0a5('0x1'));var BPromise=require(_0xc0a5('0x2'));var rs=require(_0xc0a5('0x3'));var fs=require('fs');var Redis=require(_0xc0a5('0x4'));var db=require(_0xc0a5('0x5'))['db'];var utils=require(_0xc0a5('0x6'));var logger=require(_0xc0a5('0x7'))(_0xc0a5('0x8'));var config=require('../../config/environment');var jayson=require(_0xc0a5('0x9'));var client=jayson[_0xc0a5('0xa')][_0xc0a5('0xb')]({'port':0x232a});config[_0xc0a5('0xc')]=_[_0xc0a5('0xd')](config[_0xc0a5('0xc')],{'host':_0xc0a5('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc0a5('0xc')]));require(_0xc0a5('0xf'))[_0xc0a5('0x10')](socket);function respondWithRpcPromise(_0x3b9a82,_0x40cf1e,_0x1f1435){return new BPromise(function(_0x95f509,_0x2396d8){return client[_0xc0a5('0x11')](_0x3b9a82,_0x1f1435)['then'](function(_0x45f0c6){logger[_0xc0a5('0x12')](_0xc0a5('0x13'),_0x40cf1e,_0xc0a5('0x14'));logger[_0xc0a5('0x15')](_0xc0a5('0x16'),_0x40cf1e,_0xc0a5('0x14'),JSON[_0xc0a5('0x17')](_0x45f0c6));if(_0x45f0c6[_0xc0a5('0x18')]){if(_0x45f0c6[_0xc0a5('0x18')][_0xc0a5('0x19')]===0x1f4){logger[_0xc0a5('0x18')](_0xc0a5('0x13'),_0x40cf1e,_0x45f0c6[_0xc0a5('0x18')][_0xc0a5('0x1a')]);return _0x2396d8(_0x45f0c6[_0xc0a5('0x18')][_0xc0a5('0x1a')]);}logger[_0xc0a5('0x18')](_0xc0a5('0x13'),_0x40cf1e,_0x45f0c6[_0xc0a5('0x18')][_0xc0a5('0x1a')]);return _0x95f509(_0x45f0c6[_0xc0a5('0x18')][_0xc0a5('0x1a')]);}else{logger[_0xc0a5('0x12')](_0xc0a5('0x13'),_0x40cf1e,_0xc0a5('0x14'));_0x95f509(_0x45f0c6[_0xc0a5('0x1b')][_0xc0a5('0x1a')]);}})['catch'](function(_0x37d92e){logger[_0xc0a5('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x40cf1e,_0x37d92e);_0x2396d8(_0x37d92e);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 49f9048..66d26ec 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 _0xe9c7=['register','./chatInternalMessage.events','remove','update','emit'];(function(_0x53959f,_0x518993){var _0x30c6cd=function(_0x4971b5){while(--_0x4971b5){_0x53959f['push'](_0x53959f['shift']());}};_0x30c6cd(++_0x518993);}(_0xe9c7,0x105));var _0x7e9c=function(_0x1fc7ea,_0x1eb959){_0x1fc7ea=_0x1fc7ea-0x0;var _0x390677=_0xe9c7[_0x1fc7ea];return _0x390677;};'use strict';var ChatInternalMessageEvents=require(_0x7e9c('0x0'));var events=['save',_0x7e9c('0x1'),_0x7e9c('0x2')];function createListener(_0x4e5f4b,_0x2b9e27){return function(_0x425284){_0x2b9e27[_0x7e9c('0x3')](_0x4e5f4b,_0x425284);};}function removeListener(_0x4146a6,_0x3b9123){return function(){ChatInternalMessageEvents['removeListener'](_0x4146a6,_0x3b9123);};}exports[_0x7e9c('0x4')]=function(_0x55891f){for(var _0x9be77f=0x0,_0x16ad53=events['length'];_0x9be77f<_0x16ad53;_0x9be77f++){var _0xe94f56=events[_0x9be77f];var _0x5ac58e=createListener('chatInternalMessage:'+_0xe94f56,_0x55891f);ChatInternalMessageEvents['on'](_0xe94f56,_0x5ac58e);}};
\ No newline at end of file
+var _0x05b2=['./chatInternalMessage.events','update','removeListener','length','chatInternalMessage:'];(function(_0x266885,_0x54ae3b){var _0x1f4936=function(_0x32e545){while(--_0x32e545){_0x266885['push'](_0x266885['shift']());}};_0x1f4936(++_0x54ae3b);}(_0x05b2,0x163));var _0x205b=function(_0x5642e0,_0x5910dc){_0x5642e0=_0x5642e0-0x0;var _0x5c9d47=_0x05b2[_0x5642e0];return _0x5c9d47;};'use strict';var ChatInternalMessageEvents=require(_0x205b('0x0'));var events=['save','remove',_0x205b('0x1')];function createListener(_0x3a470a,_0x478ce9){return function(_0x6cbeda){_0x478ce9['emit'](_0x3a470a,_0x6cbeda);};}function removeListener(_0x416f3b,_0x4ef4d3){return function(){ChatInternalMessageEvents[_0x205b('0x2')](_0x416f3b,_0x4ef4d3);};}exports['register']=function(_0x33b52b){for(var _0x5baa0a=0x0,_0x2826ae=events[_0x205b('0x3')];_0x5baa0a<_0x2826ae;_0x5baa0a++){var _0x47e0d6=events[_0x5baa0a];var _0xc1a43a=createListener(_0x205b('0x4')+_0x47e0d6,_0x33b52b);ChatInternalMessageEvents['on'](_0x47e0d6,_0xc1a43a);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 07058ea..5a3d57d 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 _0x0002=['exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','describe','getUsers','/:id','show','create','put','update','delete','destroy'];(function(_0x7c9341,_0x92e3ca){var _0x14c09f=function(_0x34efa6){while(--_0x34efa6){_0x7c9341['push'](_0x7c9341['shift']());}};_0x14c09f(++_0x92e3ca);}(_0x0002,0x119));var _0x2000=function(_0x53755f,_0x28e72e){_0x53755f=_0x53755f-0x0;var _0x46539d=_0x0002[_0x53755f];return _0x46539d;};'use strict';var multer=require('multer');var util=require(_0x2000('0x0'));var path=require('path');var timeout=require(_0x2000('0x1'));var express=require(_0x2000('0x2'));var router=express[_0x2000('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2000('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2000('0x5'));var controller=require(_0x2000('0x6'));router[_0x2000('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2000('0x7')](_0x2000('0x8'),auth[_0x2000('0x9')](),controller[_0x2000('0xa')]);router[_0x2000('0x7')]('/users',auth['isAuthenticated'](),controller[_0x2000('0xb')]);router[_0x2000('0x7')](_0x2000('0xc'),auth[_0x2000('0x9')](),controller[_0x2000('0xd')]);router['post']('/',auth[_0x2000('0x9')](),controller[_0x2000('0xe')]);router[_0x2000('0xf')](_0x2000('0xc'),controller[_0x2000('0x10')]);router[_0x2000('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x2000('0x12')]);module[_0x2000('0x13')]=router;
\ No newline at end of file
+var _0xceeb=['get','index','/describe','isAuthenticated','describe','/users','getUsers','/:id','show','post','put','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller'];(function(_0x5ad512,_0x587a7d){var _0x5b78c1=function(_0x550665){while(--_0x550665){_0x5ad512['push'](_0x5ad512['shift']());}};_0x5b78c1(++_0x587a7d);}(_0xceeb,0x147));var _0xbcee=function(_0x2b4b3f,_0x3699b3){_0x2b4b3f=_0x2b4b3f-0x0;var _0xd54c71=_0xceeb[_0x2b4b3f];return _0xd54c71;};'use strict';var multer=require('multer');var util=require(_0xbcee('0x0'));var path=require('path');var timeout=require(_0xbcee('0x1'));var express=require(_0xbcee('0x2'));var router=express[_0xbcee('0x3')]();var fs_extra=require(_0xbcee('0x4'));var auth=require(_0xbcee('0x5'));var interaction=require(_0xbcee('0x6'));var config=require(_0xbcee('0x7'));var controller=require(_0xbcee('0x8'));router[_0xbcee('0x9')]('/',auth['isAuthenticated'](),controller[_0xbcee('0xa')]);router[_0xbcee('0x9')](_0xbcee('0xb'),auth[_0xbcee('0xc')](),controller[_0xbcee('0xd')]);router[_0xbcee('0x9')](_0xbcee('0xe'),auth[_0xbcee('0xc')](),controller[_0xbcee('0xf')]);router[_0xbcee('0x9')](_0xbcee('0x10'),auth[_0xbcee('0xc')](),controller[_0xbcee('0x11')]);router[_0xbcee('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbcee('0x13')](_0xbcee('0x10'),controller['update']);router['delete'](_0xbcee('0x10'),auth[_0xbcee('0xc')](),controller[_0xbcee('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 85e803b..808d0da 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 _0xb4f8=['medium','BOOLEAN','ENUM','out','STRING','exports','TEXT'];(function(_0x307831,_0x508287){var _0x12ed17=function(_0x223253){while(--_0x223253){_0x307831['push'](_0x307831['shift']());}};_0x12ed17(++_0x508287);}(_0xb4f8,0x83));var _0x8b4f=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xb4f8[_0x1a36a5];return _0x746243;};'use strict';var Sequelize=require('sequelize');module[_0x8b4f('0x0')]={'body':{'type':Sequelize[_0x8b4f('0x1')](_0x8b4f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8b4f('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x8b4f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8b4f('0x4')]('in','out'),'defaultValue':_0x8b4f('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x8b4f('0x6')]},'providerResponse':{'type':Sequelize[_0x8b4f('0x1')]}};
\ No newline at end of file
+var _0x4227=['TEXT','sequelize','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x3a209c,_0x9bd72a){var _0x506f6b=function(_0x2995f7){while(--_0x2995f7){_0x3a209c['push'](_0x3a209c['shift']());}};_0x506f6b(++_0x9bd72a);}(_0x4227,0x89));var _0x7422=function(_0xe5eebe,_0x5a87b2){_0xe5eebe=_0xe5eebe-0x0;var _0x4581c3=_0x4227[_0xe5eebe];return _0x4581c3;};'use strict';var Sequelize=require(_0x7422('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x7422('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x7422('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7422('0x3')]('in',_0x7422('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x7422('0x5')]},'providerName':{'type':Sequelize[_0x7422('0x6')]},'providerResponse':{'type':Sequelize[_0x7422('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 21316b6..7660ecc 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 _0x9e25=['../../config/environment','../../config/license/util','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','destroy','stack','name','map','ChatMessage','rawAttributes','type','key','model','query','keys','intersection','attributes','length','nolimit','order','sort','where','filters','pick','filter','options','count','includeAll','include','findAll','rows','show','params','fields','merge','find','create','body','describe','chat-interactions','accept','chat','format','UserId','user','agent','get','ChatInteraction','ChatInteractionId','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','RejectMessage','rejectMessage','event','parse','formData','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','ejs','lodash','crypto','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x9e25,0x15c));var _0x59e2=function(_0x3aa79d,_0x4872bb){_0x3aa79d=_0x3aa79d-0x0;var _0x40e15f=_0x9e25[_0x3aa79d];return _0x40e15f;};'use strict';var emlformat=require(_0x59e2('0x0'));var rimraf=require(_0x59e2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x59e2('0x2'));var rp=require('request-promise');var moment=require(_0x59e2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x59e2('0x4'));var util=require(_0x59e2('0x5'));var path=require('path');var sox=require(_0x59e2('0x6'));var csv=require('to-csv');var ejs=require(_0x59e2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x59e2('0x8'));var squel=require('squel');var crypto=require(_0x59e2('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x59e2('0xa'));var querystring=require(_0x59e2('0xb'));var Papa=require(_0x59e2('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x59e2('0xd'));var as=require(_0x59e2('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x59e2('0xf'))(_0x59e2('0x10'));var utils=require(_0x59e2('0x11'));var config=require(_0x59e2('0x12'));var licenseUtil=require(_0x59e2('0x13'));var db=require('../../mysqldb')['db'];config[_0x59e2('0x14')]=_[_0x59e2('0x15')](config[_0x59e2('0x14')],{'host':_0x59e2('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x59e2('0x17'))[_0x59e2('0x18')](socket);var jayson=require(_0x59e2('0x19'));var client=jayson[_0x59e2('0x1a')][_0x59e2('0x1b')]({'port':0x232c});var client9002=jayson[_0x59e2('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x338d8d,_0x2558b8,_0x5713bd,_0x6673fc){return new BPromise(function(_0x2e9923,_0x4a8f8c){var _0x498756=_0x6673fc||client;return _0x498756[_0x59e2('0x1c')](_0x338d8d,_0x5713bd)[_0x59e2('0x1d')](function(_0x19309c){logger[_0x59e2('0x1e')](_0x59e2('0x1f'),_0x2558b8,_0x59e2('0x20'));logger[_0x59e2('0x21')](_0x59e2('0x22'),_0x2558b8,_0x59e2('0x20'),JSON[_0x59e2('0x23')](_0x19309c));if(_0x19309c[_0x59e2('0x24')]){if(_0x19309c[_0x59e2('0x24')]['code']===0x1f4){logger[_0x59e2('0x24')](_0x59e2('0x1f'),_0x2558b8,_0x19309c[_0x59e2('0x24')][_0x59e2('0x25')]);return _0x4a8f8c(_0x19309c[_0x59e2('0x24')]['message']);}logger[_0x59e2('0x24')](_0x59e2('0x1f'),_0x2558b8,_0x19309c[_0x59e2('0x24')][_0x59e2('0x25')]);return _0x2e9923(_0x19309c[_0x59e2('0x24')][_0x59e2('0x25')]);}else{logger[_0x59e2('0x1e')](_0x59e2('0x1f'),_0x2558b8,_0x59e2('0x20'));_0x2e9923(_0x19309c['result']['message']);}})[_0x59e2('0x26')](function(_0x4b34e9){logger['error'](_0x59e2('0x1f'),_0x2558b8,_0x4b34e9);_0x4a8f8c(_0x4b34e9);});});}function respondWithStatusCode(_0x2783f9,_0xb488d3){_0xb488d3=_0xb488d3||0xcc;return function(_0x13ae5d){if(_0x13ae5d){return _0x2783f9[_0x59e2('0x27')](_0xb488d3);}return _0x2783f9[_0x59e2('0x28')](_0xb488d3)['end']();};}function respondWithResult(_0x56fc6f,_0x223c71){_0x223c71=_0x223c71||0xc8;return function(_0x4745fa){if(_0x4745fa){return _0x56fc6f[_0x59e2('0x28')](_0x223c71)[_0x59e2('0x29')](_0x4745fa);}};}function respondWithFilteredResult(_0x6ef7d5,_0x18de1c){return function(_0x161889){if(_0x161889){var _0x206829=typeof _0x18de1c[_0x59e2('0x2a')]===_0x59e2('0x2b')&&typeof _0x18de1c[_0x59e2('0x2c')]==='undefined';var _0x90e79b=_0x161889['count'];var _0x26c37c=_0x206829?0x0:_0x18de1c[_0x59e2('0x2a')];var _0x227341=_0x206829?_0x161889['count']:_0x18de1c[_0x59e2('0x2a')]+_0x18de1c['limit'];var _0x4068ba;if(_0x227341>=_0x90e79b){_0x227341=_0x90e79b;_0x4068ba=0xc8;}else{_0x4068ba=0xce;}_0x6ef7d5[_0x59e2('0x28')](_0x4068ba);return _0x6ef7d5[_0x59e2('0x2d')](_0x59e2('0x2e'),_0x26c37c+'-'+_0x227341+'/'+_0x90e79b)[_0x59e2('0x29')](_0x161889);}return null;};}function patchUpdates(_0x4f6bf8){return function(_0x26643f){try{jsonpatch['apply'](_0x26643f,_0x4f6bf8,!![]);}catch(_0x552676){return BPromise[_0x59e2('0x2f')](_0x552676);}return _0x26643f[_0x59e2('0x30')]();};}function saveUpdates(_0x35b6db,_0x587f4e){return function(_0x577b7f){if(_0x577b7f){return _0x577b7f[_0x59e2('0x31')](_0x35b6db)[_0x59e2('0x1d')](function(_0x2d2c74){return _0x2d2c74;});}return null;};}function removeEntity(_0x1cc729,_0x244651){return function(_0x5425b3){if(_0x5425b3){return _0x5425b3[_0x59e2('0x32')]()[_0x59e2('0x1d')](function(){_0x1cc729[_0x59e2('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x449250,_0x2ffc5e){return function(_0x53a17b){if(!_0x53a17b){_0x449250[_0x59e2('0x27')](0x194);}return _0x53a17b;};}function handleError(_0x2b7064,_0x1d593b){_0x1d593b=_0x1d593b||0x1f4;return function(_0x3645e0){logger[_0x59e2('0x24')](_0x3645e0[_0x59e2('0x33')]);if(_0x3645e0[_0x59e2('0x34')]){delete _0x3645e0[_0x59e2('0x34')];}_0x2b7064[_0x59e2('0x28')](_0x1d593b)['send'](_0x3645e0);};}exports['index']=function(_0x8b456,_0x1b5690){var _0x2bf868={},_0x2e0aed={},_0x2d5829={'count':0x0,'rows':[]};var _0x5c6a66=_[_0x59e2('0x35')](db[_0x59e2('0x36')][_0x59e2('0x37')],function(_0x81ca4a){return{'name':_0x81ca4a['fieldName'],'type':_0x81ca4a[_0x59e2('0x38')][_0x59e2('0x39')]};});_0x2e0aed[_0x59e2('0x3a')]=_[_0x59e2('0x35')](_0x5c6a66,_0x59e2('0x34'));_0x2e0aed[_0x59e2('0x3b')]=_[_0x59e2('0x3c')](_0x8b456[_0x59e2('0x3b')]);_0x2e0aed['filters']=_[_0x59e2('0x3d')](_0x2e0aed[_0x59e2('0x3a')],_0x2e0aed[_0x59e2('0x3b')]);_0x2bf868[_0x59e2('0x3e')]=_['intersection'](_0x2e0aed['model'],qs['fields'](_0x8b456[_0x59e2('0x3b')]['fields']));_0x2bf868[_0x59e2('0x3e')]=_0x2bf868[_0x59e2('0x3e')][_0x59e2('0x3f')]?_0x2bf868[_0x59e2('0x3e')]:_0x2e0aed[_0x59e2('0x3a')];if(!_0x8b456['query']['hasOwnProperty'](_0x59e2('0x40'))){_0x2bf868[_0x59e2('0x2c')]=qs[_0x59e2('0x2c')](_0x8b456[_0x59e2('0x3b')][_0x59e2('0x2c')]);_0x2bf868[_0x59e2('0x2a')]=qs[_0x59e2('0x2a')](_0x8b456[_0x59e2('0x3b')][_0x59e2('0x2a')]);}_0x2bf868[_0x59e2('0x41')]=qs[_0x59e2('0x42')](_0x8b456['query'][_0x59e2('0x42')]);_0x2bf868[_0x59e2('0x43')]=qs[_0x59e2('0x44')](_[_0x59e2('0x45')](_0x8b456['query'],_0x2e0aed[_0x59e2('0x44')]),_0x5c6a66);if(_0x8b456[_0x59e2('0x3b')][_0x59e2('0x46')]){_0x2bf868[_0x59e2('0x43')]=_['merge'](_0x2bf868[_0x59e2('0x43')],{'$or':_[_0x59e2('0x35')](_0x5c6a66,function(_0x14a505){if(_0x14a505[_0x59e2('0x38')]!=='VIRTUAL'){var _0x4eacc6={};_0x4eacc6[_0x14a505[_0x59e2('0x34')]]={'$like':'%'+_0x8b456[_0x59e2('0x3b')]['filter']+'%'};return _0x4eacc6;}})});}_0x2bf868=_['merge']({},_0x2bf868,_0x8b456[_0x59e2('0x47')]);var _0x4d303c={'where':_0x2bf868[_0x59e2('0x43')]};return db[_0x59e2('0x36')][_0x59e2('0x48')](_0x4d303c)['then'](function(_0x1e0ebd){_0x2d5829['count']=_0x1e0ebd;if(_0x8b456[_0x59e2('0x3b')][_0x59e2('0x49')]){_0x2bf868[_0x59e2('0x4a')]=[{'all':!![]}];}return db[_0x59e2('0x36')][_0x59e2('0x4b')](_0x2bf868);})[_0x59e2('0x1d')](function(_0x3af978){_0x2d5829[_0x59e2('0x4c')]=_0x3af978;return _0x2d5829;})[_0x59e2('0x1d')](respondWithFilteredResult(_0x1b5690,_0x2bf868))[_0x59e2('0x26')](handleError(_0x1b5690,null));};exports[_0x59e2('0x4d')]=function(_0x7ce3e5,_0x3ba99e){var _0x27d687={'raw':!![],'where':{'id':_0x7ce3e5[_0x59e2('0x4e')]['id']}},_0x5edc96={};_0x5edc96[_0x59e2('0x3a')]=_[_0x59e2('0x3c')](db[_0x59e2('0x36')][_0x59e2('0x37')]);_0x5edc96['query']=_[_0x59e2('0x3c')](_0x7ce3e5[_0x59e2('0x3b')]);_0x5edc96[_0x59e2('0x44')]=_[_0x59e2('0x3d')](_0x5edc96['model'],_0x5edc96[_0x59e2('0x3b')]);_0x27d687[_0x59e2('0x3e')]=_['intersection'](_0x5edc96[_0x59e2('0x3a')],qs[_0x59e2('0x4f')](_0x7ce3e5[_0x59e2('0x3b')][_0x59e2('0x4f')]));_0x27d687[_0x59e2('0x3e')]=_0x27d687[_0x59e2('0x3e')][_0x59e2('0x3f')]?_0x27d687['attributes']:_0x5edc96[_0x59e2('0x3a')];if(_0x7ce3e5[_0x59e2('0x3b')]['includeAll']){_0x27d687[_0x59e2('0x4a')]=[{'all':!![]}];}_0x27d687=_[_0x59e2('0x50')]({},_0x27d687,_0x7ce3e5[_0x59e2('0x47')]);return db[_0x59e2('0x36')][_0x59e2('0x51')](_0x27d687)[_0x59e2('0x1d')](handleEntityNotFound(_0x3ba99e,null))['then'](respondWithResult(_0x3ba99e,null))[_0x59e2('0x26')](handleError(_0x3ba99e,null));};exports[_0x59e2('0x52')]=function(_0x1c7ad8,_0x133db6){return db[_0x59e2('0x36')][_0x59e2('0x52')](_0x1c7ad8[_0x59e2('0x53')],{})[_0x59e2('0x1d')](respondWithResult(_0x133db6,0xc9))[_0x59e2('0x26')](handleError(_0x133db6,null));};exports[_0x59e2('0x31')]=function(_0x3f6b23,_0x25e2ff){if(_0x3f6b23[_0x59e2('0x53')]['id']){delete _0x3f6b23['body']['id'];}return db[_0x59e2('0x36')][_0x59e2('0x51')]({'where':{'id':_0x3f6b23[_0x59e2('0x4e')]['id']}})[_0x59e2('0x1d')](handleEntityNotFound(_0x25e2ff,null))[_0x59e2('0x1d')](saveUpdates(_0x3f6b23[_0x59e2('0x53')],null))['then'](respondWithResult(_0x25e2ff,null))[_0x59e2('0x26')](handleError(_0x25e2ff,null));};exports[_0x59e2('0x32')]=function(_0x19233f,_0x1c65ee){return db['ChatMessage'][_0x59e2('0x51')]({'where':{'id':_0x19233f['params']['id']}})[_0x59e2('0x1d')](handleEntityNotFound(_0x1c65ee,null))[_0x59e2('0x1d')](removeEntity(_0x1c65ee,null))['catch'](handleError(_0x1c65ee,null));};exports[_0x59e2('0x54')]=function(_0x4ed8ee,_0x165100){return db[_0x59e2('0x36')][_0x59e2('0x54')]()[_0x59e2('0x1d')](respondWithResult(_0x165100,null))[_0x59e2('0x26')](handleError(_0x165100,null));};var interaction_log=require('../../config/logger')(_0x59e2('0x55'));exports[_0x59e2('0x56')]=function(_0x7bac43,_0x323b86,_0x4dba0e){var _0x256ec7={'agent':{},'channel':_0x59e2('0x57')};if(_0x7bac43[_0x59e2('0x53')]['id']){delete _0x7bac43[_0x59e2('0x53')]['id'];}_0x7bac43['body']['read']=!![];_0x7bac43[_0x59e2('0x53')]['readAt']=moment()[_0x59e2('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x7bac43[_0x59e2('0x53')][_0x59e2('0x59')]=_0x7bac43[_0x59e2('0x53')][_0x59e2('0x59')]||_0x7bac43[_0x59e2('0x5a')]['id'];_0x256ec7[_0x59e2('0x5b')]['id']=_0x7bac43[_0x59e2('0x53')][_0x59e2('0x59')];return db[_0x59e2('0x36')]['find']({'where':{'id':_0x7bac43[_0x59e2('0x4e')]['id'],'UserId':null}})[_0x59e2('0x1d')](handleEntityNotFound(_0x323b86,null))[_0x59e2('0x1d')](saveUpdates(_0x7bac43[_0x59e2('0x53')],null))['then'](function(_0x5012e1){if(_0x5012e1){_0x256ec7['message']=_0x5012e1[_0x59e2('0x5c')]({'plain':!![]});return db[_0x59e2('0x5d')]['find']({'where':{'id':_0x5012e1[_0x59e2('0x5e')]}});}return null;})['then'](handleEntityNotFound(_0x323b86,null))['then'](function(_0x163f47){if(_0x163f47){return _0x163f47[_0x59e2('0x31')]({'UserId':_0x7bac43[_0x59e2('0x53')][_0x59e2('0x59')],'read1stAt':_['isNil'](_0x163f47['read1stAt'])?moment()[_0x59e2('0x58')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x59e2('0x1d')](function(_0x95f421){if(_0x95f421){_0x256ec7[_0x59e2('0x5f')]=_0x95f421['get']({'plain':!![]});interaction_log['info'](_0x59e2('0x60'),_0x7bac43[_0x59e2('0x5a')]['id'],_0x7bac43['user'][_0x59e2('0x34')],_0x7bac43[_0x59e2('0x5a')][_0x59e2('0x61')],_0x256ec7[_0x59e2('0x5f')]['id'],_0x7bac43[_0x59e2('0x53')]?JSON[_0x59e2('0x23')](_0x7bac43[_0x59e2('0x53')]):_0x59e2('0x62'));return respondWithRpcPromise(_0x59e2('0x63'),'acceptMessage',_0x256ec7);}return null;})[_0x59e2('0x1d')](function(_0x3c46bb){var _0x359b10=_0x59e2('0x64')+_0x3c46bb[_0x59e2('0x25')][_0x59e2('0x65')];return db[_0x59e2('0x66')][_0x59e2('0x3b')](_0x359b10,{'type':db[_0x59e2('0x67')][_0x59e2('0x68')][_0x59e2('0x69')],'raw':!![]})[_0x59e2('0x1d')](function(_0x1ade2d){return _0x1ade2d;});})[_0x59e2('0x1d')](function(_0x5014a7){if(_0x5014a7){_0x256ec7['message'][_0x59e2('0x6a')]=_0x5014a7[0x0];if(!_0x7bac43[_0x59e2('0x53')][_0x59e2('0x59')])return;return db[_0x59e2('0x6b')][_0x59e2('0x51')]({'where':{'id':_0x7bac43[_0x59e2('0x53')][_0x59e2('0x59')],'role':_0x59e2('0x5b')},'attributes':['id',_0x59e2('0x34'),_0x59e2('0x6c'),_0x59e2('0x6d'),_0x59e2('0x6e')],'raw':!![]});}return null;})[_0x59e2('0x1d')](function(_0x18a09c){if(!_0x18a09c)return null;_0x256ec7[_0x59e2('0x25')][_0x59e2('0x5b')]=_0x18a09c;return _0x256ec7;})[_0x59e2('0x1d')](function(_0x50ec04){if(_0x50ec04){if(_0x7bac43[_0x59e2('0x53')][_0x59e2('0x6f')]){_0x256ec7[_0x59e2('0x25')][_0x59e2('0x70')]=util[_0x59e2('0x58')](_0x59e2('0x71'),_0x7bac43[_0x59e2('0x5a')][_0x59e2('0x34')]);_0x256ec7['message'][_0x59e2('0x72')]=_0x256ec7[_0x59e2('0x72')];_0x256ec7[_0x59e2('0x25')][_0x59e2('0x73')]=_0x256ec7[_0x59e2('0x72')];_0x256ec7[_0x59e2('0x25')]['event']=_0x59e2('0x56');return respondWithRpcPromise('EventManager',_0x59e2('0x74'),{'event':'acceptmessage','message':_[_0x59e2('0x50')](_0x256ec7[_0x59e2('0x25')],JSON['parse'](_0x256ec7[_0x59e2('0x5f')]['formData']))},client9002)[_0x59e2('0x1d')](function(){return _0x256ec7;});}return _0x256ec7;}return null;})[_0x59e2('0x1d')](respondWithResult(_0x323b86,null))[_0x59e2('0x26')](handleError(_0x323b86,null));};var interaction_log=require(_0x59e2('0xf'))('chat-interactions');exports[_0x59e2('0x2f')]=function(_0x44662b,_0x29fa53,_0x1eef4d){var _0x162a65={'agent':{},'channel':_0x59e2('0x57')};if(_0x44662b['body']['id']){delete _0x44662b[_0x59e2('0x53')]['id'];}_0x44662b['body'][_0x59e2('0x59')]=_0x44662b['body'][_0x59e2('0x59')]||_0x44662b[_0x59e2('0x5a')]['id'];_0x162a65[_0x59e2('0x5b')]['id']=_0x44662b['body'][_0x59e2('0x59')];return db[_0x59e2('0x36')][_0x59e2('0x51')]({'where':{'id':_0x44662b[_0x59e2('0x4e')]['id'],'UserId':null}})[_0x59e2('0x1d')](handleEntityNotFound(_0x29fa53,null))['then'](function(_0x39395f){if(_0x39395f){_0x162a65[_0x59e2('0x25')]=_0x39395f['get']({'plain':!![]});return db[_0x59e2('0x5d')]['find']({'where':{'id':_0x39395f[_0x59e2('0x5e')]}});}return null;})[_0x59e2('0x1d')](handleEntityNotFound(_0x29fa53,null))[_0x59e2('0x1d')](function(_0x8c1243){if(_0x8c1243){_0x162a65[_0x59e2('0x5f')]=_0x8c1243[_0x59e2('0x5c')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x44662b[_0x59e2('0x5a')]['id'],_0x44662b['user'][_0x59e2('0x34')],_0x44662b['user']['role'],_0x162a65['interaction']['id'],_0x44662b[_0x59e2('0x53')]?JSON['stringify'](_0x44662b['body']):_0x59e2('0x62'));return respondWithRpcPromise(_0x59e2('0x75'),_0x59e2('0x76'),_0x162a65);}return null;})['then'](function(_0x53aa05){var _0xed2f54=_0x59e2('0x64')+_0x53aa05[_0x59e2('0x25')]['ContactId'];return db['sequelize']['query'](_0xed2f54,{'type':db[_0x59e2('0x67')][_0x59e2('0x68')]['SELECT'],'raw':!![]})[_0x59e2('0x1d')](function(_0x25227c){return _0x25227c;});})[_0x59e2('0x1d')](function(_0xb69821){if(_0xb69821){_0x162a65['message'][_0x59e2('0x6a')]=_0xb69821[0x0];if(!_0x44662b[_0x59e2('0x53')][_0x59e2('0x59')])return;return db[_0x59e2('0x6b')]['find']({'where':{'id':_0x44662b[_0x59e2('0x53')][_0x59e2('0x59')],'role':_0x59e2('0x5b')},'attributes':['id',_0x59e2('0x34'),_0x59e2('0x6c'),'email',_0x59e2('0x6e')],'raw':!![]});}return null;})[_0x59e2('0x1d')](function(_0x361296){if(!_0x361296)return null;_0x162a65['message'][_0x59e2('0x5b')]=_0x361296;return _0x162a65;})[_0x59e2('0x1d')](function(_0x25acf6){if(_0x25acf6){_0x25acf6[_0x59e2('0x25')]['interface']=util[_0x59e2('0x58')]('SIP/%s',_0x44662b['user'][_0x59e2('0x34')]);_0x25acf6['message'][_0x59e2('0x72')]=_0x162a65[_0x59e2('0x72')];_0x25acf6[_0x59e2('0x25')][_0x59e2('0x73')]=_0x162a65[_0x59e2('0x72')];_0x25acf6['message'][_0x59e2('0x77')]=_0x59e2('0x2f');respondWithRpcPromise(_0x59e2('0x74'),_0x59e2('0x74'),{'event':'rejectmessage','message':_[_0x59e2('0x50')](_0x162a65[_0x59e2('0x25')],JSON[_0x59e2('0x78')](_0x162a65[_0x59e2('0x5f')][_0x59e2('0x79')]))},client9002);return _0x162a65;}return null;})[_0x59e2('0x1d')](respondWithResult(_0x29fa53,null))[_0x59e2('0x26')](handleError(_0x29fa53,null));};
\ No newline at end of file
+var _0x010c=['accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','agent','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','interaction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','User','fullname','motionChannel','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','describe'];(function(_0x2dfd68,_0x2fa790){var _0x4a2a63=function(_0xd74a90){while(--_0xd74a90){_0x2dfd68['push'](_0x2dfd68['shift']());}};_0x4a2a63(++_0x2fa790);}(_0x010c,0x136));var _0xc010=function(_0x3c7ddf,_0x356b4b){_0x3c7ddf=_0x3c7ddf-0x0;var _0x25b44b=_0x010c[_0x3c7ddf];return _0x25b44b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc010('0x0'));var zipdir=require(_0xc010('0x1'));var jsonpatch=require(_0xc010('0x2'));var rp=require(_0xc010('0x3'));var moment=require(_0xc010('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc010('0x5'));var util=require(_0xc010('0x6'));var path=require('path');var sox=require(_0xc010('0x7'));var csv=require(_0xc010('0x8'));var ejs=require(_0xc010('0x9'));var fs=require('fs');var fs_extra=require(_0xc010('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc010('0xb'));var jsforce=require(_0xc010('0xc'));var deskjs=require(_0xc010('0xd'));var toCsv=require(_0xc010('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc010('0xe'));var qs=require(_0xc010('0xf'));var as=require(_0xc010('0x10'));var hardwareService=require(_0xc010('0x11'));var logger=require(_0xc010('0x12'))('api');var utils=require(_0xc010('0x13'));var config=require(_0xc010('0x14'));var licenseUtil=require(_0xc010('0x15'));var db=require(_0xc010('0x16'))['db'];config[_0xc010('0x17')]=_[_0xc010('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc010('0x19'))(new Redis(config[_0xc010('0x17')]));require('./chatMessage.socket')[_0xc010('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xc010('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb465dc,_0x127393,_0x4d4e8f,_0x2c19c8){return new BPromise(function(_0x1197c2,_0x51798a){var _0x4bea55=_0x2c19c8||client;return _0x4bea55[_0xc010('0x1c')](_0xb465dc,_0x4d4e8f)[_0xc010('0x1d')](function(_0x5d2c35){logger[_0xc010('0x1e')](_0xc010('0x1f'),_0x127393,_0xc010('0x20'));logger[_0xc010('0x21')](_0xc010('0x22'),_0x127393,_0xc010('0x20'),JSON[_0xc010('0x23')](_0x5d2c35));if(_0x5d2c35['error']){if(_0x5d2c35[_0xc010('0x24')][_0xc010('0x25')]===0x1f4){logger[_0xc010('0x24')](_0xc010('0x1f'),_0x127393,_0x5d2c35[_0xc010('0x24')][_0xc010('0x26')]);return _0x51798a(_0x5d2c35[_0xc010('0x24')][_0xc010('0x26')]);}logger[_0xc010('0x24')]('ChatMessage,\x20%s,\x20%s',_0x127393,_0x5d2c35[_0xc010('0x24')][_0xc010('0x26')]);return _0x1197c2(_0x5d2c35[_0xc010('0x24')]['message']);}else{logger[_0xc010('0x1e')]('ChatMessage,\x20%s,\x20%s',_0x127393,_0xc010('0x20'));_0x1197c2(_0x5d2c35[_0xc010('0x27')][_0xc010('0x26')]);}})['catch'](function(_0x4116a5){logger[_0xc010('0x24')](_0xc010('0x1f'),_0x127393,_0x4116a5);_0x51798a(_0x4116a5);});});}function respondWithStatusCode(_0x24e8d5,_0x21bf5f){_0x21bf5f=_0x21bf5f||0xcc;return function(_0x5be09f){if(_0x5be09f){return _0x24e8d5[_0xc010('0x28')](_0x21bf5f);}return _0x24e8d5[_0xc010('0x29')](_0x21bf5f)[_0xc010('0x2a')]();};}function respondWithResult(_0x526d30,_0x4a6e66){_0x4a6e66=_0x4a6e66||0xc8;return function(_0x52821b){if(_0x52821b){return _0x526d30[_0xc010('0x29')](_0x4a6e66)[_0xc010('0x2b')](_0x52821b);}};}function respondWithFilteredResult(_0x28e771,_0x4982b7){return function(_0x56e37b){if(_0x56e37b){var _0x2549cf=typeof _0x4982b7['offset']===_0xc010('0x2c')&&typeof _0x4982b7[_0xc010('0x2d')]===_0xc010('0x2c');var _0x3ecbbe=_0x56e37b[_0xc010('0x2e')];var _0x58d102=_0x2549cf?0x0:_0x4982b7[_0xc010('0x2f')];var _0x2906d6=_0x2549cf?_0x56e37b[_0xc010('0x2e')]:_0x4982b7['offset']+_0x4982b7[_0xc010('0x2d')];var _0x1d1843;if(_0x2906d6>=_0x3ecbbe){_0x2906d6=_0x3ecbbe;_0x1d1843=0xc8;}else{_0x1d1843=0xce;}_0x28e771[_0xc010('0x29')](_0x1d1843);return _0x28e771[_0xc010('0x30')](_0xc010('0x31'),_0x58d102+'-'+_0x2906d6+'/'+_0x3ecbbe)[_0xc010('0x2b')](_0x56e37b);}return null;};}function patchUpdates(_0x1c5611){return function(_0xeab590){try{jsonpatch[_0xc010('0x32')](_0xeab590,_0x1c5611,!![]);}catch(_0x5b56eb){return BPromise[_0xc010('0x33')](_0x5b56eb);}return _0xeab590[_0xc010('0x34')]();};}function saveUpdates(_0x573c28,_0x57cb7a){return function(_0x3e9bba){if(_0x3e9bba){return _0x3e9bba['update'](_0x573c28)[_0xc010('0x1d')](function(_0x191ecc){return _0x191ecc;});}return null;};}function removeEntity(_0x18bf00,_0x3cdd7c){return function(_0x26edf8){if(_0x26edf8){return _0x26edf8[_0xc010('0x35')]()['then'](function(){_0x18bf00['status'](0xcc)[_0xc010('0x2a')]();});}};}function handleEntityNotFound(_0x54dd1e,_0x31dd22){return function(_0xad5e0f){if(!_0xad5e0f){_0x54dd1e[_0xc010('0x28')](0x194);}return _0xad5e0f;};}function handleError(_0x2faf17,_0x2cc6d1){_0x2cc6d1=_0x2cc6d1||0x1f4;return function(_0x88bb44){logger[_0xc010('0x24')](_0x88bb44[_0xc010('0x36')]);if(_0x88bb44[_0xc010('0x37')]){delete _0x88bb44['name'];}_0x2faf17[_0xc010('0x29')](_0x2cc6d1)[_0xc010('0x38')](_0x88bb44);};}exports[_0xc010('0x39')]=function(_0x1e6b22,_0x4dfcdc){var _0x740794={},_0x5b1bb2={},_0x2de299={'count':0x0,'rows':[]};var _0x3d0cb3=_[_0xc010('0x3a')](db[_0xc010('0x3b')][_0xc010('0x3c')],function(_0x157d22){return{'name':_0x157d22[_0xc010('0x3d')],'type':_0x157d22[_0xc010('0x3e')]['key']};});_0x5b1bb2[_0xc010('0x3f')]=_[_0xc010('0x3a')](_0x3d0cb3,_0xc010('0x37'));_0x5b1bb2['query']=_[_0xc010('0x40')](_0x1e6b22[_0xc010('0x41')]);_0x5b1bb2[_0xc010('0x42')]=_[_0xc010('0x43')](_0x5b1bb2[_0xc010('0x3f')],_0x5b1bb2[_0xc010('0x41')]);_0x740794['attributes']=_[_0xc010('0x43')](_0x5b1bb2[_0xc010('0x3f')],qs[_0xc010('0x44')](_0x1e6b22[_0xc010('0x41')][_0xc010('0x44')]));_0x740794[_0xc010('0x45')]=_0x740794[_0xc010('0x45')][_0xc010('0x46')]?_0x740794[_0xc010('0x45')]:_0x5b1bb2['model'];if(!_0x1e6b22[_0xc010('0x41')][_0xc010('0x47')](_0xc010('0x48'))){_0x740794[_0xc010('0x2d')]=qs[_0xc010('0x2d')](_0x1e6b22[_0xc010('0x41')]['limit']);_0x740794['offset']=qs[_0xc010('0x2f')](_0x1e6b22[_0xc010('0x41')][_0xc010('0x2f')]);}_0x740794[_0xc010('0x49')]=qs['sort'](_0x1e6b22[_0xc010('0x41')]['sort']);_0x740794[_0xc010('0x4a')]=qs[_0xc010('0x42')](_[_0xc010('0x4b')](_0x1e6b22[_0xc010('0x41')],_0x5b1bb2[_0xc010('0x42')]),_0x3d0cb3);if(_0x1e6b22[_0xc010('0x41')][_0xc010('0x4c')]){_0x740794[_0xc010('0x4a')]=_[_0xc010('0x4d')](_0x740794[_0xc010('0x4a')],{'$or':_[_0xc010('0x3a')](_0x3d0cb3,function(_0x5bca4a){if(_0x5bca4a['type']!==_0xc010('0x4e')){var _0x3e194a={};_0x3e194a[_0x5bca4a[_0xc010('0x37')]]={'$like':'%'+_0x1e6b22['query']['filter']+'%'};return _0x3e194a;}})});}_0x740794=_[_0xc010('0x4d')]({},_0x740794,_0x1e6b22[_0xc010('0x4f')]);var _0x557ebf={'where':_0x740794[_0xc010('0x4a')]};return db['ChatMessage']['count'](_0x557ebf)['then'](function(_0x421a0f){_0x2de299[_0xc010('0x2e')]=_0x421a0f;if(_0x1e6b22['query'][_0xc010('0x50')]){_0x740794[_0xc010('0x51')]=[{'all':!![]}];}return db[_0xc010('0x3b')][_0xc010('0x52')](_0x740794);})[_0xc010('0x1d')](function(_0x3fa8a6){_0x2de299[_0xc010('0x53')]=_0x3fa8a6;return _0x2de299;})[_0xc010('0x1d')](respondWithFilteredResult(_0x4dfcdc,_0x740794))[_0xc010('0x54')](handleError(_0x4dfcdc,null));};exports[_0xc010('0x55')]=function(_0x2cdfd3,_0x464752){var _0x1cd11d={'raw':!![],'where':{'id':_0x2cdfd3['params']['id']}},_0x324e19={};_0x324e19[_0xc010('0x3f')]=_[_0xc010('0x40')](db['ChatMessage'][_0xc010('0x3c')]);_0x324e19[_0xc010('0x41')]=_[_0xc010('0x40')](_0x2cdfd3[_0xc010('0x41')]);_0x324e19[_0xc010('0x42')]=_[_0xc010('0x43')](_0x324e19[_0xc010('0x3f')],_0x324e19[_0xc010('0x41')]);_0x1cd11d['attributes']=_[_0xc010('0x43')](_0x324e19[_0xc010('0x3f')],qs[_0xc010('0x44')](_0x2cdfd3[_0xc010('0x41')][_0xc010('0x44')]));_0x1cd11d['attributes']=_0x1cd11d[_0xc010('0x45')]['length']?_0x1cd11d[_0xc010('0x45')]:_0x324e19['model'];if(_0x2cdfd3[_0xc010('0x41')][_0xc010('0x50')]){_0x1cd11d[_0xc010('0x51')]=[{'all':!![]}];}_0x1cd11d=_['merge']({},_0x1cd11d,_0x2cdfd3[_0xc010('0x4f')]);return db['ChatMessage'][_0xc010('0x56')](_0x1cd11d)[_0xc010('0x1d')](handleEntityNotFound(_0x464752,null))[_0xc010('0x1d')](respondWithResult(_0x464752,null))[_0xc010('0x54')](handleError(_0x464752,null));};exports['create']=function(_0x3896c7,_0x15870e){return db[_0xc010('0x3b')][_0xc010('0x57')](_0x3896c7[_0xc010('0x58')],{})[_0xc010('0x1d')](respondWithResult(_0x15870e,0xc9))[_0xc010('0x54')](handleError(_0x15870e,null));};exports[_0xc010('0x59')]=function(_0x2515db,_0x38cc62){if(_0x2515db[_0xc010('0x58')]['id']){delete _0x2515db[_0xc010('0x58')]['id'];}return db[_0xc010('0x3b')]['find']({'where':{'id':_0x2515db[_0xc010('0x5a')]['id']}})[_0xc010('0x1d')](handleEntityNotFound(_0x38cc62,null))[_0xc010('0x1d')](saveUpdates(_0x2515db['body'],null))[_0xc010('0x1d')](respondWithResult(_0x38cc62,null))['catch'](handleError(_0x38cc62,null));};exports[_0xc010('0x35')]=function(_0x2d10d6,_0x3a7c6d){return db['ChatMessage'][_0xc010('0x56')]({'where':{'id':_0x2d10d6[_0xc010('0x5a')]['id']}})[_0xc010('0x1d')](handleEntityNotFound(_0x3a7c6d,null))[_0xc010('0x1d')](removeEntity(_0x3a7c6d,null))[_0xc010('0x54')](handleError(_0x3a7c6d,null));};exports[_0xc010('0x5b')]=function(_0x48d702,_0x6396d7){return db['ChatMessage']['describe']()[_0xc010('0x1d')](respondWithResult(_0x6396d7,null))['catch'](handleError(_0x6396d7,null));};var interaction_log=require(_0xc010('0x12'))('chat-interactions');exports[_0xc010('0x5c')]=function(_0x31cb98,_0x452526,_0x2ca006){var _0x527da3={'agent':{},'channel':_0xc010('0x5d')};if(_0x31cb98[_0xc010('0x58')]['id']){delete _0x31cb98['body']['id'];}_0x31cb98[_0xc010('0x58')]['read']=!![];_0x31cb98[_0xc010('0x58')][_0xc010('0x5e')]=moment()[_0xc010('0x5f')](_0xc010('0x60'));_0x31cb98['body'][_0xc010('0x61')]=_0x31cb98[_0xc010('0x58')][_0xc010('0x61')]||_0x31cb98[_0xc010('0x62')]['id'];_0x527da3['agent']['id']=_0x31cb98['body'][_0xc010('0x61')];return db[_0xc010('0x3b')][_0xc010('0x56')]({'where':{'id':_0x31cb98[_0xc010('0x5a')]['id'],'UserId':null}})[_0xc010('0x1d')](handleEntityNotFound(_0x452526,null))[_0xc010('0x1d')](saveUpdates(_0x31cb98['body'],null))[_0xc010('0x1d')](function(_0x4acda1){if(_0x4acda1){_0x527da3['message']=_0x4acda1[_0xc010('0x63')]({'plain':!![]});return db[_0xc010('0x64')]['find']({'where':{'id':_0x4acda1[_0xc010('0x65')]}});}return null;})[_0xc010('0x1d')](handleEntityNotFound(_0x452526,null))[_0xc010('0x1d')](function(_0x255200){if(_0x255200){return _0x255200[_0xc010('0x59')]({'UserId':_0x31cb98['body'][_0xc010('0x61')],'read1stAt':_['isNil'](_0x255200[_0xc010('0x66')])?moment()[_0xc010('0x5f')](_0xc010('0x60')):undefined});}return null;})['then'](function(_0x2aa9b2){if(_0x2aa9b2){_0x527da3['interaction']=_0x2aa9b2[_0xc010('0x63')]({'plain':!![]});interaction_log[_0xc010('0x1e')](_0xc010('0x67'),_0x31cb98[_0xc010('0x62')]['id'],_0x31cb98['user'][_0xc010('0x37')],_0x31cb98['user'][_0xc010('0x68')],_0x527da3['interaction']['id'],_0x31cb98[_0xc010('0x58')]?JSON[_0xc010('0x23')](_0x31cb98['body']):_0xc010('0x69'));return respondWithRpcPromise(_0xc010('0x6a'),'acceptMessage',_0x527da3);}return null;})[_0xc010('0x1d')](function(_0x57c994){var _0x89991c=_0xc010('0x6b')+_0x57c994[_0xc010('0x26')][_0xc010('0x6c')];return db['sequelize'][_0xc010('0x41')](_0x89991c,{'type':db[_0xc010('0x6d')][_0xc010('0x6e')][_0xc010('0x6f')],'raw':!![]})[_0xc010('0x1d')](function(_0x2ea0f4){return _0x2ea0f4;});})[_0xc010('0x1d')](function(_0x3875a4){if(_0x3875a4){_0x527da3[_0xc010('0x26')][_0xc010('0x70')]=_0x3875a4[0x0];if(!_0x31cb98['body'][_0xc010('0x61')])return;return db['User']['find']({'where':{'id':_0x31cb98[_0xc010('0x58')][_0xc010('0x61')],'role':_0xc010('0x71')},'attributes':['id',_0xc010('0x37'),'fullname',_0xc010('0x72'),_0xc010('0x73')],'raw':!![]});}return null;})['then'](function(_0x207542){if(!_0x207542)return null;_0x527da3[_0xc010('0x26')][_0xc010('0x71')]=_0x207542;return _0x527da3;})['then'](function(_0x3ab21f){if(_0x3ab21f){if(_0x31cb98[_0xc010('0x58')][_0xc010('0x74')]){_0x527da3[_0xc010('0x26')][_0xc010('0x75')]=util[_0xc010('0x5f')](_0xc010('0x76'),_0x31cb98[_0xc010('0x62')][_0xc010('0x37')]);_0x527da3[_0xc010('0x26')][_0xc010('0x77')]=_0x527da3['channel'];_0x527da3['message']['motionChannel']=_0x527da3['channel'];_0x527da3[_0xc010('0x26')][_0xc010('0x78')]=_0xc010('0x5c');return respondWithRpcPromise(_0xc010('0x79'),_0xc010('0x79'),{'event':_0xc010('0x7a'),'message':_[_0xc010('0x4d')](_0x527da3[_0xc010('0x26')],JSON[_0xc010('0x7b')](_0x527da3['interaction'][_0xc010('0x7c')]))},client9002)['then'](function(){return _0x527da3;});}return _0x527da3;}return null;})[_0xc010('0x1d')](respondWithResult(_0x452526,null))[_0xc010('0x54')](handleError(_0x452526,null));};var interaction_log=require('../../config/logger')(_0xc010('0x7d'));exports[_0xc010('0x33')]=function(_0x516a18,_0x197274,_0x375d37){var _0x4125d5={'agent':{},'channel':_0xc010('0x5d')};if(_0x516a18['body']['id']){delete _0x516a18['body']['id'];}_0x516a18[_0xc010('0x58')][_0xc010('0x61')]=_0x516a18[_0xc010('0x58')]['UserId']||_0x516a18[_0xc010('0x62')]['id'];_0x4125d5[_0xc010('0x71')]['id']=_0x516a18[_0xc010('0x58')][_0xc010('0x61')];return db[_0xc010('0x3b')][_0xc010('0x56')]({'where':{'id':_0x516a18[_0xc010('0x5a')]['id'],'UserId':null}})[_0xc010('0x1d')](handleEntityNotFound(_0x197274,null))[_0xc010('0x1d')](function(_0xa598e1){if(_0xa598e1){_0x4125d5['message']=_0xa598e1[_0xc010('0x63')]({'plain':!![]});return db[_0xc010('0x64')][_0xc010('0x56')]({'where':{'id':_0xa598e1[_0xc010('0x65')]}});}return null;})[_0xc010('0x1d')](handleEntityNotFound(_0x197274,null))[_0xc010('0x1d')](function(_0x3b4caf){if(_0x3b4caf){_0x4125d5[_0xc010('0x7e')]=_0x3b4caf['get']({'plain':!![]});interaction_log[_0xc010('0x1e')](_0xc010('0x7f'),_0x516a18[_0xc010('0x62')]['id'],_0x516a18[_0xc010('0x62')][_0xc010('0x37')],_0x516a18[_0xc010('0x62')][_0xc010('0x68')],_0x4125d5['interaction']['id'],_0x516a18[_0xc010('0x58')]?JSON[_0xc010('0x23')](_0x516a18[_0xc010('0x58')]):'null');return respondWithRpcPromise(_0xc010('0x80'),_0xc010('0x81'),_0x4125d5);}return null;})[_0xc010('0x1d')](function(_0x28e95c){var _0x5eed56=_0xc010('0x6b')+_0x28e95c[_0xc010('0x26')]['ContactId'];return db[_0xc010('0x82')][_0xc010('0x41')](_0x5eed56,{'type':db[_0xc010('0x6d')][_0xc010('0x6e')]['SELECT'],'raw':!![]})['then'](function(_0x4c2932){return _0x4c2932;});})[_0xc010('0x1d')](function(_0x1c56c6){if(_0x1c56c6){_0x4125d5[_0xc010('0x26')][_0xc010('0x70')]=_0x1c56c6[0x0];if(!_0x516a18[_0xc010('0x58')][_0xc010('0x61')])return;return db[_0xc010('0x83')][_0xc010('0x56')]({'where':{'id':_0x516a18[_0xc010('0x58')]['UserId'],'role':_0xc010('0x71')},'attributes':['id',_0xc010('0x37'),_0xc010('0x84'),_0xc010('0x72'),_0xc010('0x73')],'raw':!![]});}return null;})['then'](function(_0x525ad2){if(!_0x525ad2)return null;_0x4125d5[_0xc010('0x26')]['agent']=_0x525ad2;return _0x4125d5;})['then'](function(_0x51c103){if(_0x51c103){_0x51c103[_0xc010('0x26')][_0xc010('0x75')]=util[_0xc010('0x5f')](_0xc010('0x76'),_0x516a18[_0xc010('0x62')][_0xc010('0x37')]);_0x51c103[_0xc010('0x26')][_0xc010('0x77')]=_0x4125d5[_0xc010('0x77')];_0x51c103[_0xc010('0x26')][_0xc010('0x85')]=_0x4125d5['channel'];_0x51c103['message'][_0xc010('0x78')]='reject';respondWithRpcPromise('EventManager',_0xc010('0x79'),{'event':'rejectmessage','message':_[_0xc010('0x4d')](_0x4125d5[_0xc010('0x26')],JSON[_0xc010('0x7b')](_0x4125d5[_0xc010('0x7e')][_0xc010('0x7c')]))},client9002);return _0x4125d5;}return null;})[_0xc010('0x1d')](respondWithResult(_0x197274,null))[_0xc010('0x54')](handleError(_0x197274,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 0005a06..539ebf2 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 _0x3074=['../../mysqldb','ChatMessage','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3f92fb,_0x4b8915){var _0x5ecb4e=function(_0x131a8d){while(--_0x131a8d){_0x3f92fb['push'](_0x3f92fb['shift']());}};_0x5ecb4e(++_0x4b8915);}(_0x3074,0x182));var _0x4307=function(_0x3a491a,_0x23fd55){_0x3a491a=_0x3a491a-0x0;var _0x2feee6=_0x3074[_0x3a491a];return _0x2feee6;};'use strict';var EventEmitter=require(_0x4307('0x0'));var ChatMessage=require(_0x4307('0x1'))['db'][_0x4307('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4307('0x3'),'afterDestroy':_0x4307('0x4')};function emitEvent(_0x22b41c){return function(_0x2c42b2,_0x381ea8,_0x902a0a){ChatMessageEvents['emit'](_0x22b41c+':'+_0x2c42b2['id'],_0x2c42b2);ChatMessageEvents[_0x4307('0x5')](_0x22b41c,_0x2c42b2);_0x902a0a(null);};}for(var e in events){if(events[_0x4307('0x6')](e)){var event=events[e];ChatMessage[_0x4307('0x7')](e,emitEvent(event));}}module[_0x4307('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0xec5f=['setMaxListeners','save','emit','hasOwnProperty','events','../../mysqldb','ChatMessage'];(function(_0x539914,_0x297a87){var _0x513e1d=function(_0x35ba25){while(--_0x35ba25){_0x539914['push'](_0x539914['shift']());}};_0x513e1d(++_0x297a87);}(_0xec5f,0xac));var _0xfec5=function(_0x3d4b8e,_0x21e8fd){_0x3d4b8e=_0x3d4b8e-0x0;var _0x390efb=_0xec5f[_0x3d4b8e];return _0x390efb;};'use strict';var EventEmitter=require(_0xfec5('0x0'));var ChatMessage=require(_0xfec5('0x1'))['db'][_0xfec5('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xfec5('0x3')](0x0);var events={'afterCreate':_0xfec5('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1f5c1c){return function(_0x5b4c5e,_0x4f111b,_0x448658){ChatMessageEvents[_0xfec5('0x5')](_0x1f5c1c+':'+_0x5b4c5e['id'],_0x5b4c5e);ChatMessageEvents[_0xfec5('0x5')](_0x1f5c1c,_0x5b4c5e);_0x448658(null);};}for(var e in events){if(events[_0xfec5('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index a9a8cb7..de2ccfd 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 _0xe81d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','models','toLowerCase','direction','out','isNil','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4'];(function(_0x2c3370,_0x36b5f5){var _0x209bb5=function(_0x109922){while(--_0x109922){_0x2c3370['push'](_0x2c3370['shift']());}};_0x209bb5(++_0x36b5f5);}(_0xe81d,0xc4));var _0xde81=function(_0x444196,_0x5659c7){_0x444196=_0x444196-0x0;var _0x49e3b1=_0xe81d[_0x444196];return _0x49e3b1;};'use strict';var _=require(_0xde81('0x0'));var util=require(_0xde81('0x1'));var logger=require(_0xde81('0x2'))(_0xde81('0x3'));var moment=require(_0xde81('0x4'));var BPromise=require(_0xde81('0x5'));var rp=require(_0xde81('0x6'));var fs=require('fs');var path=require(_0xde81('0x7'));var rimraf=require(_0xde81('0x8'));var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module[_0xde81('0x9')]=function(_0x29bb24,_0x4b9051){return _0x29bb24[_0xde81('0xa')](_0xde81('0xb'),attributes,{'tableName':_0xde81('0xc'),'paranoid':![],'indexes':[{'name':_0xde81('0xd'),'fields':[_0xde81('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x11fe4d,_0x585b32,_0x4186b9){var _0x118eff=_0x29bb24[_0xde81('0xf')];var _0x4074ef=_0x11fe4d['get']({'plain':!![]});if(_0x4074ef['direction'][_0xde81('0x10')]()==='in'||_0x4074ef[_0xde81('0x11')][_0xde81('0x10')]()===_0xde81('0x12')&&!_0x4074ef['secret']&&!_[_0xde81('0x13')](_0x4074ef['UserId'])){_0x118eff['ChatInteraction'][_0xde81('0x14')]({'where':{'id':_0x4074ef[_0xde81('0x15')]}})[_0xde81('0x16')](function(_0x4df5ca){if(_0x4df5ca){_0x4df5ca[_0xde81('0x17')]({'lastMsgAt':_0x4074ef[_0xde81('0x18')],'lastMsgDirection':_0x4074ef[_0xde81('0x11')]['toLowerCase']()});}})[_0xde81('0x19')](function(_0x2fe19d){console[_0xde81('0x1a')](_0x2fe19d);});}_0x4186b9();}},'charset':_0xde81('0x1b'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x1f36=['UserId','ChatInteraction','ChatInteractionId','update','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','out','secret'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0x1f36,0x1ed));var _0x61f3=function(_0xc07e77,_0x131f5f){_0xc07e77=_0xc07e77-0x0;var _0x8a489e=_0x1f36[_0xc07e77];return _0x8a489e;};'use strict';var _=require(_0x61f3('0x0'));var util=require(_0x61f3('0x1'));var logger=require(_0x61f3('0x2'))(_0x61f3('0x3'));var moment=require('moment');var BPromise=require(_0x61f3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x61f3('0x5'));var rimraf=require(_0x61f3('0x6'));var config=require(_0x61f3('0x7'));var attributes=require(_0x61f3('0x8'));module[_0x61f3('0x9')]=function(_0x12c372,_0x72af3d){return _0x12c372['define'](_0x61f3('0xa'),attributes,{'tableName':_0x61f3('0xb'),'paranoid':![],'indexes':[{'name':_0x61f3('0xc'),'fields':[_0x61f3('0xd')],'type':_0x61f3('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e184d,_0x3e7987,_0x51f786){var _0x1dba23=_0x12c372[_0x61f3('0xf')];var _0x14b24e=_0x3e184d[_0x61f3('0x10')]({'plain':!![]});if(_0x14b24e[_0x61f3('0x11')]['toLowerCase']()==='in'||_0x14b24e[_0x61f3('0x11')]['toLowerCase']()===_0x61f3('0x12')&&!_0x14b24e[_0x61f3('0x13')]&&!_['isNil'](_0x14b24e[_0x61f3('0x14')])){_0x1dba23[_0x61f3('0x15')]['findOne']({'where':{'id':_0x14b24e[_0x61f3('0x16')]}})['then'](function(_0x42c8b4){if(_0x42c8b4){_0x42c8b4[_0x61f3('0x17')]({'lastMsgAt':_0x14b24e['createdAt'],'lastMsgDirection':_0x14b24e[_0x61f3('0x11')]['toLowerCase']()});}})[_0x61f3('0x18')](function(_0x222d54){console[_0x61f3('0x19')](_0x222d54);});}_0x51f786();}},'charset':'utf8mb4','collate':_0x61f3('0x1a')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 3f2776d..64cec23 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 _0x95a8=['lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','ChatMessage','create','body','options','then','CreateChatMessage'];(function(_0x2148d3,_0x30176c){var _0x5c1de7=function(_0x137fef){while(--_0x137fef){_0x2148d3['push'](_0x2148d3['shift']());}};_0x5c1de7(++_0x30176c);}(_0x95a8,0x1dc));var _0x895a=function(_0x123f6c,_0x3e34bc){_0x123f6c=_0x123f6c-0x0;var _0x1a35d0=_0x95a8[_0x123f6c];return _0x1a35d0;};'use strict';var _=require(_0x895a('0x0'));var util=require('util');var moment=require(_0x895a('0x1'));var BPromise=require('bluebird');var rs=require(_0x895a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x895a('0x3'))['db'];var utils=require(_0x895a('0x4'));var logger=require(_0x895a('0x5'))(_0x895a('0x6'));var config=require(_0x895a('0x7'));var jayson=require(_0x895a('0x8'));var client=jayson[_0x895a('0x9')][_0x895a('0xa')]({'port':0x232a});config['redis']=_[_0x895a('0xb')](config[_0x895a('0xc')],{'host':_0x895a('0xd'),'port':0x18eb});var socket=require(_0x895a('0xe'))(new Redis(config[_0x895a('0xc')]));require(_0x895a('0xf'))[_0x895a('0x10')](socket);function respondWithRpcPromise(_0x3d049e,_0x2d712b,_0x525965){return new BPromise(function(_0x4e15f3,_0xf82301){return client[_0x895a('0x11')](_0x3d049e,_0x525965)['then'](function(_0x336662){logger[_0x895a('0x12')](_0x895a('0x13'),_0x2d712b,'request\x20sent');logger[_0x895a('0x14')](_0x895a('0x15'),_0x2d712b,'request\x20sent',JSON[_0x895a('0x16')](_0x336662));if(_0x336662['error']){if(_0x336662['error']['code']===0x1f4){logger[_0x895a('0x17')]('ChatMessage,\x20%s,\x20%s',_0x2d712b,_0x336662[_0x895a('0x17')][_0x895a('0x18')]);return _0xf82301(_0x336662['error'][_0x895a('0x18')]);}logger['error'](_0x895a('0x13'),_0x2d712b,_0x336662[_0x895a('0x17')][_0x895a('0x18')]);return _0x4e15f3(_0x336662[_0x895a('0x17')]['message']);}else{logger[_0x895a('0x12')]('ChatMessage,\x20%s,\x20%s',_0x2d712b,_0x895a('0x19'));_0x4e15f3(_0x336662[_0x895a('0x1a')][_0x895a('0x18')]);}})[_0x895a('0x1b')](function(_0x15c196){logger[_0x895a('0x17')]('ChatMessage,\x20%s,\x20%s',_0x2d712b,_0x15c196);_0xf82301(_0x15c196);});});}exports['CreateChatMessage']=function(_0x4198f4){var _0x38726c=this;return new Promise(function(_0x360604,_0x13ce10){return db[_0x895a('0x1c')][_0x895a('0x1d')](_0x4198f4[_0x895a('0x1e')],{'raw':_0x4198f4['options']?_0x4198f4[_0x895a('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x895a('0x20')](function(_0x342d07){logger[_0x895a('0x12')](_0x895a('0x21'),_0x4198f4);logger[_0x895a('0x14')](_0x895a('0x21'),_0x4198f4,JSON['stringify'](_0x342d07));_0x360604(_0x342d07);})[_0x895a('0x1b')](function(_0x20cbfa){logger[_0x895a('0x17')](_0x895a('0x21'),_0x20cbfa[_0x895a('0x18')],_0x4198f4);_0x13ce10(_0x38726c[_0x895a('0x17')](0x1f4,_0x20cbfa['message']));});});};
\ No newline at end of file
+var _0xd89d=['result','catch','ChatMessage','create','body','options','CreateChatMessage','debug','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x37c172,_0x201798){var _0x48f0f8=function(_0x9d6780){while(--_0x9d6780){_0x37c172['push'](_0x37c172['shift']());}};_0x48f0f8(++_0x201798);}(_0xd89d,0xce));var _0xdd89=function(_0x4b7898,_0x2eae9a){_0x4b7898=_0x4b7898-0x0;var _0x38fc2e=_0xd89d[_0x4b7898];return _0x38fc2e;};'use strict';var _=require(_0xdd89('0x0'));var util=require('util');var moment=require(_0xdd89('0x1'));var BPromise=require(_0xdd89('0x2'));var rs=require(_0xdd89('0x3'));var fs=require('fs');var Redis=require(_0xdd89('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdd89('0x5'));var logger=require('../../config/logger')(_0xdd89('0x6'));var config=require(_0xdd89('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdd89('0x8')][_0xdd89('0x9')]({'port':0x232a});config['redis']=_[_0xdd89('0xa')](config[_0xdd89('0xb')],{'host':_0xdd89('0xc'),'port':0x18eb});var socket=require(_0xdd89('0xd'))(new Redis(config[_0xdd89('0xb')]));require(_0xdd89('0xe'))['register'](socket);function respondWithRpcPromise(_0x306d11,_0x5554e6,_0x187021){return new BPromise(function(_0xe1e2af,_0x3bdb4c){return client[_0xdd89('0xf')](_0x306d11,_0x187021)[_0xdd89('0x10')](function(_0x13fb3c){logger[_0xdd89('0x11')](_0xdd89('0x12'),_0x5554e6,_0xdd89('0x13'));logger['debug'](_0xdd89('0x14'),_0x5554e6,_0xdd89('0x13'),JSON[_0xdd89('0x15')](_0x13fb3c));if(_0x13fb3c[_0xdd89('0x16')]){if(_0x13fb3c[_0xdd89('0x16')][_0xdd89('0x17')]===0x1f4){logger[_0xdd89('0x16')](_0xdd89('0x12'),_0x5554e6,_0x13fb3c['error'][_0xdd89('0x18')]);return _0x3bdb4c(_0x13fb3c[_0xdd89('0x16')][_0xdd89('0x18')]);}logger[_0xdd89('0x16')]('ChatMessage,\x20%s,\x20%s',_0x5554e6,_0x13fb3c['error']['message']);return _0xe1e2af(_0x13fb3c[_0xdd89('0x16')][_0xdd89('0x18')]);}else{logger[_0xdd89('0x11')]('ChatMessage,\x20%s,\x20%s',_0x5554e6,_0xdd89('0x13'));_0xe1e2af(_0x13fb3c[_0xdd89('0x19')]['message']);}})[_0xdd89('0x1a')](function(_0x13d96f){logger[_0xdd89('0x16')]('ChatMessage,\x20%s,\x20%s',_0x5554e6,_0x13d96f);_0x3bdb4c(_0x13d96f);});});}exports['CreateChatMessage']=function(_0x126117){var _0x23a002=this;return new Promise(function(_0x13c0db,_0x578260){return db[_0xdd89('0x1b')][_0xdd89('0x1c')](_0x126117[_0xdd89('0x1d')],{'raw':_0x126117[_0xdd89('0x1e')]?_0x126117[_0xdd89('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xdd89('0x10')](function(_0x49b0d6){logger[_0xdd89('0x11')](_0xdd89('0x1f'),_0x126117);logger[_0xdd89('0x20')](_0xdd89('0x1f'),_0x126117,JSON[_0xdd89('0x15')](_0x49b0d6));_0x13c0db(_0x49b0d6);})['catch'](function(_0x57f496){logger[_0xdd89('0x16')](_0xdd89('0x1f'),_0x57f496[_0xdd89('0x18')],_0x126117);_0x578260(_0x23a002[_0xdd89('0x16')](0x1f4,_0x57f496[_0xdd89('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 5e960cf..fe7f570 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 _0x46ed=['./chatMessage.events','save','update','emit','removeListener','register','length','chatMessage:'];(function(_0x19d828,_0x2439ce){var _0x25b133=function(_0x5214a8){while(--_0x5214a8){_0x19d828['push'](_0x19d828['shift']());}};_0x25b133(++_0x2439ce);}(_0x46ed,0x168));var _0xd46e=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x46ed[_0x4ae6ef];return _0x3cbb4e;};'use strict';var ChatMessageEvents=require(_0xd46e('0x0'));var events=[_0xd46e('0x1'),'remove',_0xd46e('0x2')];function createListener(_0x1df30e,_0x1f15e7){return function(_0x537ad5){_0x1f15e7[_0xd46e('0x3')](_0x1df30e,_0x537ad5);};}function removeListener(_0x4518b8,_0x54ef98){return function(){ChatMessageEvents[_0xd46e('0x4')](_0x4518b8,_0x54ef98);};}exports[_0xd46e('0x5')]=function(_0x160bcf){for(var _0x25cf78=0x0,_0x45e680=events[_0xd46e('0x6')];_0x25cf78<_0x45e680;_0x25cf78++){var _0x437ea0=events[_0x25cf78];var _0x144687=createListener(_0xd46e('0x7')+_0x437ea0,_0x160bcf);ChatMessageEvents['on'](_0x437ea0,_0x144687);}};
\ No newline at end of file
+var _0x9d92=['update','emit','removeListener','register','length','chatMessage:','./chatMessage.events'];(function(_0x457712,_0x1f9a75){var _0x21f9bd=function(_0x2fad00){while(--_0x2fad00){_0x457712['push'](_0x457712['shift']());}};_0x21f9bd(++_0x1f9a75);}(_0x9d92,0xdf));var _0x29d9=function(_0x4ffa64,_0x271035){_0x4ffa64=_0x4ffa64-0x0;var _0x5da001=_0x9d92[_0x4ffa64];return _0x5da001;};'use strict';var ChatMessageEvents=require(_0x29d9('0x0'));var events=['save','remove',_0x29d9('0x1')];function createListener(_0x3d33ba,_0x48fe57){return function(_0x3dbd9e){_0x48fe57[_0x29d9('0x2')](_0x3d33ba,_0x3dbd9e);};}function removeListener(_0x18371b,_0x6e12eb){return function(){ChatMessageEvents[_0x29d9('0x3')](_0x18371b,_0x6e12eb);};}exports[_0x29d9('0x4')]=function(_0x27d032){for(var _0x52932b=0x0,_0x209595=events[_0x29d9('0x5')];_0x52932b<_0x209595;_0x52932b++){var _0x392265=events[_0x52932b];var _0x5aeb53=createListener(_0x29d9('0x6')+_0x392265,_0x27d032);ChatMessageEvents['on'](_0x392265,_0x5aeb53);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index ba3e6b8..03e8f4d 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 _0x7186=['get','index','isAuthenticated','describe','show','post','tracked','chat','chatmessage:create','put','update','/:id/accept','/:id/reject','reject','delete','/:id','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller'];(function(_0x2b98ee,_0x29387b){var _0x3de098=function(_0x25e6c5){while(--_0x25e6c5){_0x2b98ee['push'](_0x2b98ee['shift']());}};_0x3de098(++_0x29387b);}(_0x7186,0xa1));var _0x6718=function(_0x4eeb7d,_0x3bdc50){_0x4eeb7d=_0x4eeb7d-0x0;var _0x4f1b1c=_0x7186[_0x4eeb7d];return _0x4f1b1c;};'use strict';var multer=require(_0x6718('0x0'));var util=require('util');var path=require(_0x6718('0x1'));var timeout=require(_0x6718('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6718('0x3'));var interaction=require(_0x6718('0x4'));var config=require(_0x6718('0x5'));var controller=require(_0x6718('0x6'));router[_0x6718('0x7')]('/',auth['isAuthenticated'](),controller[_0x6718('0x8')]);router[_0x6718('0x7')]('/describe',auth[_0x6718('0x9')](),controller[_0x6718('0xa')]);router['get']('/:id',auth[_0x6718('0x9')](),controller[_0x6718('0xb')]);router[_0x6718('0xc')]('/',auth[_0x6718('0x9')](),interaction[_0x6718('0xd')](_0x6718('0xe'),_0x6718('0xf')),controller['create']);router[_0x6718('0x10')]('/:id',controller[_0x6718('0x11')]);router[_0x6718('0x10')](_0x6718('0x12'),auth['isAuthenticated'](),controller['accept']);router[_0x6718('0x10')](_0x6718('0x13'),auth[_0x6718('0x9')](),controller[_0x6718('0x14')]);router[_0x6718('0x15')](_0x6718('0x16'),auth[_0x6718('0x9')](),controller['destroy']);module[_0x6718('0x17')]=router;
\ No newline at end of file
+var _0xf36c=['/:id','update','/:id/accept','/:id/reject','reject','destroy','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe','show','post','tracked','chat','chatmessage:create','put'];(function(_0x331d53,_0x543db0){var _0x1a6f98=function(_0x3cd123){while(--_0x3cd123){_0x331d53['push'](_0x331d53['shift']());}};_0x1a6f98(++_0x543db0);}(_0xf36c,0xd5));var _0xcf36=function(_0x3393a8,_0x88c1cd){_0x3393a8=_0x3393a8-0x0;var _0x42a50a=_0xf36c[_0x3393a8];return _0x42a50a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xcf36('0x0'));var express=require('express');var router=express[_0xcf36('0x1')]();var fs_extra=require(_0xcf36('0x2'));var auth=require(_0xcf36('0x3'));var interaction=require(_0xcf36('0x4'));var config=require(_0xcf36('0x5'));var controller=require(_0xcf36('0x6'));router[_0xcf36('0x7')]('/',auth[_0xcf36('0x8')](),controller['index']);router[_0xcf36('0x7')](_0xcf36('0x9'),auth[_0xcf36('0x8')](),controller[_0xcf36('0xa')]);router[_0xcf36('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xcf36('0xb')]);router[_0xcf36('0xc')]('/',auth['isAuthenticated'](),interaction[_0xcf36('0xd')](_0xcf36('0xe'),_0xcf36('0xf')),controller['create']);router[_0xcf36('0x10')](_0xcf36('0x11'),controller[_0xcf36('0x12')]);router[_0xcf36('0x10')](_0xcf36('0x13'),auth['isAuthenticated'](),controller['accept']);router[_0xcf36('0x10')](_0xcf36('0x14'),auth['isAuthenticated'](),controller[_0xcf36('0x15')]);router['delete']('/:id',auth[_0xcf36('0x8')](),controller[_0xcf36('0x16')]);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 49b8a31..a6029c9 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['medium','sequelize','TEXT'];(function(_0x1e38c0,_0x213478){var _0x14415e=function(_0x385329){while(--_0x385329){_0x1e38c0['push'](_0x1e38c0['shift']());}};_0x14415e(++_0x213478);}(_0xb10b,0x12a));var _0xbb10=function(_0x2697d9,_0x26806a){_0x2697d9=_0x2697d9-0x0;var _0x25e6ae=_0xb10b[_0x2697d9];return _0x25e6ae;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x503aff,_0x96d567){var _0x5be37d=function(_0xe68e0b){while(--_0xe68e0b){_0x503aff['push'](_0x503aff['shift']());}};_0x5be37d(++_0x96d567);}(_0x5f2f,0x73));var _0xf5f2=function(_0x47b038,_0x1b0295){_0x47b038=_0x47b038-0x0;var _0xf5a7f1=_0x5f2f[_0x47b038];return _0xf5a7f1;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 48ccbe8..efae7ce 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x5b8cdc,_0x5373b1){var _0x29a185=function(_0x351044){while(--_0x351044){_0x5b8cdc['push'](_0x5b8cdc['shift']());}};_0x29a185(++_0x5373b1);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x3a301d,_0x2e751f){var _0x1f8298=function(_0xf0c31e){while(--_0xf0c31e){_0x3a301d['push'](_0x3a301d['shift']());}};_0x1f8298(++_0x2e751f);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 992f939..11ee921 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xee55=['events','ChatOfflineMessage','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee55,0x1a0));var _0x5ee5=function(_0x20cc29,_0x30a46d){_0x20cc29=_0x20cc29-0x0;var _0x28d513=_0xee55[_0x20cc29];return _0x28d513;};'use strict';var EventEmitter=require(_0x5ee5('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x5ee5('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5ee5('0x2'),'afterUpdate':'update','afterDestroy':_0x5ee5('0x3')};function emitEvent(_0x2fc0fd){return function(_0x4e5f9b,_0x394334,_0x119392){ChatOfflineMessageEvents[_0x5ee5('0x4')](_0x2fc0fd+':'+_0x4e5f9b['id'],_0x4e5f9b);ChatOfflineMessageEvents[_0x5ee5('0x4')](_0x2fc0fd,_0x4e5f9b);_0x119392(null);};}for(var e in events){if(events[_0x5ee5('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x5ee5('0x6')](e,emitEvent(event));}}module[_0x5ee5('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xbcf1=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage'];(function(_0x14f6fa,_0x44743d){var _0x2c62a5=function(_0x398da0){while(--_0x398da0){_0x14f6fa['push'](_0x14f6fa['shift']());}};_0x2c62a5(++_0x44743d);}(_0xbcf1,0x18d));var _0x1bcf=function(_0x1d70db,_0x142b63){_0x1d70db=_0x1d70db-0x0;var _0x3060c6=_0xbcf1[_0x1d70db];return _0x3060c6;};'use strict';var EventEmitter=require(_0x1bcf('0x0'));var ChatOfflineMessage=require(_0x1bcf('0x1'))['db'][_0x1bcf('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x1bcf('0x3')](0x0);var events={'afterCreate':_0x1bcf('0x4'),'afterUpdate':_0x1bcf('0x5'),'afterDestroy':'remove'};function emitEvent(_0x26993a){return function(_0x2923bd,_0x526daf,_0x52a65e){ChatOfflineMessageEvents[_0x1bcf('0x6')](_0x26993a+':'+_0x2923bd['id'],_0x2923bd);ChatOfflineMessageEvents[_0x1bcf('0x6')](_0x26993a,_0x2923bd);_0x52a65e(null);};}for(var e in events){if(events[_0x1bcf('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x1bcf('0x8')](e,emitEvent(event));}}module[_0x1bcf('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 7c9036a..35b23fc 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 _0x7731=['chat_offline_messages','./chatOfflineMessage.attributes','define','ChatOfflineMessage'];(function(_0x305a94,_0xa1ba1e){var _0x3b0b5a=function(_0x1bd1a0){while(--_0x1bd1a0){_0x305a94['push'](_0x305a94['shift']());}};_0x3b0b5a(++_0xa1ba1e);}(_0x7731,0x199));var _0x1773=function(_0x5662f2,_0x550cb0){_0x5662f2=_0x5662f2-0x0;var _0x2469f5=_0x7731[_0x5662f2];return _0x2469f5;};'use strict';var attributes=require(_0x1773('0x0'));module['exports']=function(_0x43f726){return _0x43f726[_0x1773('0x1')](_0x1773('0x2'),attributes,{'tableName':_0x1773('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xc4ec=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','utf8mb4'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc4ec,0x88));var _0xcc4e=function(_0x7b5cdd,_0x8c88d8){_0x7b5cdd=_0x7b5cdd-0x0;var _0x3a29ae=_0xc4ec[_0x7b5cdd];return _0x3a29ae;};'use strict';var attributes=require(_0xcc4e('0x0'));module[_0xcc4e('0x1')]=function(_0x1b7c7d){return _0x1b7c7d[_0xcc4e('0x2')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcc4e('0x3'),'collate':_0xcc4e('0x4')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index c7481b7..8c7cffa 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 _0xaeff=['code','message','error','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3d6e20,_0x121fa5){var _0x118138=function(_0x476504){while(--_0x476504){_0x3d6e20['push'](_0x3d6e20['shift']());}};_0x118138(++_0x121fa5);}(_0xaeff,0xea));var _0xfaef=function(_0x3f7692,_0x4ab6fa){_0x3f7692=_0x3f7692-0x0;var _0x24dd38=_0xaeff[_0x3f7692];return _0x24dd38;};'use strict';var _=require(_0xfaef('0x0'));var util=require(_0xfaef('0x1'));var moment=require(_0xfaef('0x2'));var BPromise=require(_0xfaef('0x3'));var rs=require(_0xfaef('0x4'));var fs=require('fs');var Redis=require(_0xfaef('0x5'));var db=require(_0xfaef('0x6'))['db'];var utils=require(_0xfaef('0x7'));var logger=require('../../config/logger')(_0xfaef('0x8'));var config=require('../../config/environment');var jayson=require(_0xfaef('0x9'));var client=jayson[_0xfaef('0xa')][_0xfaef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b5dca,_0x20f62a,_0x5626c0){return new BPromise(function(_0x4e76eb,_0x397223){return client[_0xfaef('0xc')](_0x4b5dca,_0x5626c0)[_0xfaef('0xd')](function(_0x1c6086){logger[_0xfaef('0xe')](_0xfaef('0xf'),_0x20f62a,_0xfaef('0x10'));logger['debug'](_0xfaef('0x11'),_0x20f62a,_0xfaef('0x10'),JSON[_0xfaef('0x12')](_0x1c6086));if(_0x1c6086['error']){if(_0x1c6086['error'][_0xfaef('0x13')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x20f62a,_0x1c6086['error'][_0xfaef('0x14')]);return _0x397223(_0x1c6086['error'][_0xfaef('0x14')]);}logger[_0xfaef('0x15')](_0xfaef('0xf'),_0x20f62a,_0x1c6086[_0xfaef('0x15')]['message']);return _0x4e76eb(_0x1c6086['error'][_0xfaef('0x14')]);}else{logger['info'](_0xfaef('0xf'),_0x20f62a,_0xfaef('0x10'));_0x4e76eb(_0x1c6086['result'][_0xfaef('0x14')]);}})[_0xfaef('0x16')](function(_0x5e758d){logger['error'](_0xfaef('0xf'),_0x20f62a,_0x5e758d);_0x397223(_0x5e758d);});});}
\ No newline at end of file
+var _0xe5ef=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x17931e,_0x57738a){var _0xd23227=function(_0x3d6be9){while(--_0x3d6be9){_0x17931e['push'](_0x17931e['shift']());}};_0xd23227(++_0x57738a);}(_0xe5ef,0x13a));var _0xfe5e=function(_0x266888,_0x46ac0a){_0x266888=_0x266888-0x0;var _0x5427d5=_0xe5ef[_0x266888];return _0x5427d5;};'use strict';var _=require(_0xfe5e('0x0'));var util=require(_0xfe5e('0x1'));var moment=require(_0xfe5e('0x2'));var BPromise=require(_0xfe5e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe5e('0x4'));var db=require(_0xfe5e('0x5'))['db'];var utils=require(_0xfe5e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xfe5e('0x7'));var jayson=require(_0xfe5e('0x8'));var client=jayson['client'][_0xfe5e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd0aaac,_0x5f45ef,_0x4ff9a3){return new BPromise(function(_0x3beff4,_0x182ce3){return client[_0xfe5e('0xa')](_0xd0aaac,_0x4ff9a3)['then'](function(_0x3dc0e3){logger['info'](_0xfe5e('0xb'),_0x5f45ef,_0xfe5e('0xc'));logger['debug'](_0xfe5e('0xd'),_0x5f45ef,_0xfe5e('0xc'),JSON[_0xfe5e('0xe')](_0x3dc0e3));if(_0x3dc0e3[_0xfe5e('0xf')]){if(_0x3dc0e3[_0xfe5e('0xf')][_0xfe5e('0x10')]===0x1f4){logger[_0xfe5e('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5f45ef,_0x3dc0e3[_0xfe5e('0xf')][_0xfe5e('0x11')]);return _0x182ce3(_0x3dc0e3[_0xfe5e('0xf')][_0xfe5e('0x11')]);}logger[_0xfe5e('0xf')](_0xfe5e('0xb'),_0x5f45ef,_0x3dc0e3[_0xfe5e('0xf')][_0xfe5e('0x11')]);return _0x3beff4(_0x3dc0e3[_0xfe5e('0xf')]['message']);}else{logger[_0xfe5e('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5f45ef,'request\x20sent');_0x3beff4(_0x3dc0e3[_0xfe5e('0x13')][_0xfe5e('0x11')]);}})[_0xfe5e('0x14')](function(_0x5c0fe5){logger[_0xfe5e('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5f45ef,_0x5c0fe5);_0x182ce3(_0x5c0fe5);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index c04a87f..3005470 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 _0x6c2d=['util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','index','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','multer'];(function(_0x5cc89b,_0x4b942a){var _0x5dc5a0=function(_0x40b02c){while(--_0x40b02c){_0x5cc89b['push'](_0x5cc89b['shift']());}};_0x5dc5a0(++_0x4b942a);}(_0x6c2d,0x19d));var _0xd6c2=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x6c2d[_0x36dfbd];return _0x4ecad9;};'use strict';var multer=require(_0xd6c2('0x0'));var util=require(_0xd6c2('0x1'));var path=require(_0xd6c2('0x2'));var timeout=require('connect-timeout');var express=require(_0xd6c2('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd6c2('0x4'));var interaction=require(_0xd6c2('0x5'));var config=require(_0xd6c2('0x6'));var controller=require(_0xd6c2('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xd6c2('0x8')]);router[_0xd6c2('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xd6c2('0x9')](_0xd6c2('0xa'),auth[_0xd6c2('0xb')](),controller[_0xd6c2('0xc')]);router[_0xd6c2('0xd')]('/',auth[_0xd6c2('0xb')](),controller[_0xd6c2('0xe')]);router[_0xd6c2('0xf')](_0xd6c2('0xa'),auth[_0xd6c2('0xb')](),controller['update']);router[_0xd6c2('0x10')](_0xd6c2('0xa'),auth[_0xd6c2('0xb')](),controller[_0xd6c2('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xd27e=['put','/:id','delete','destroy','exports','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/describe','describe','post','create'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0xd27e,0x105));var _0xed27=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd27e[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xed27('0x0'));var timeout=require('connect-timeout');var express=require(_0xed27('0x1'));var router=express['Router']();var fs_extra=require(_0xed27('0x2'));var auth=require(_0xed27('0x3'));var interaction=require(_0xed27('0x4'));var config=require(_0xed27('0x5'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0xed27('0x6')](),controller['index']);router['get'](_0xed27('0x7'),auth['isAuthenticated'](),controller[_0xed27('0x8')]);router['get']('/:id',auth[_0xed27('0x6')](),controller['show']);router[_0xed27('0x9')]('/',auth[_0xed27('0x6')](),controller[_0xed27('0xa')]);router[_0xed27('0xb')](_0xed27('0xc'),auth[_0xed27('0x6')](),controller['update']);router[_0xed27('0xd')](_0xed27('0xc'),auth['isAuthenticated'](),controller[_0xed27('0xe')]);module[_0xed27('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 1b54caa..dd79434 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 _0x3d3a=['ENUM','mouseOver','timeout','sequelize','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3d3a,0x1b9));var _0xa3d3=function(_0x5dfc1e,_0x164a3f){_0x5dfc1e=_0x5dfc1e-0x0;var _0x3904f6=_0x3d3a[_0x5dfc1e];return _0x3904f6;};'use strict';var Sequelize=require(_0xa3d3('0x0'));module[_0xa3d3('0x1')]={'name':{'type':Sequelize[_0xa3d3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa3d3('0x3')](_0xa3d3('0x4'),_0xa3d3('0x5')),'defaultValue':_0xa3d3('0x4')},'selector':{'type':Sequelize[_0xa3d3('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xdba1=['timeout','mouseOver','STRING','INTEGER','sequelize','exports','ENUM'];(function(_0x2595a6,_0x48fc45){var _0x460197=function(_0x18f9db){while(--_0x18f9db){_0x2595a6['push'](_0x2595a6['shift']());}};_0x460197(++_0x48fc45);}(_0xdba1,0xe4));var _0x1dba=function(_0x192501,_0xd3e01c){_0x192501=_0x192501-0x0;var _0x1cd198=_0xdba1[_0x192501];return _0x1cd198;};'use strict';var Sequelize=require(_0x1dba('0x0'));module[_0x1dba('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x1dba('0x2')]('mouseOver',_0x1dba('0x3')),'defaultValue':_0x1dba('0x4')},'selector':{'type':Sequelize[_0x1dba('0x5')]},'timeout':{'type':Sequelize[_0x1dba('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index c258e95..e9d1695 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 _0x7579=['desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto'];(function(_0x52c4e9,_0x5412d0){var _0x252a03=function(_0x57857c){while(--_0x57857c){_0x52c4e9['push'](_0x52c4e9['shift']());}};_0x252a03(++_0x5412d0);}(_0x7579,0x1e2));var _0x9757=function(_0x3660b3,_0x52ad09){_0x3660b3=_0x3660b3-0x0;var _0x497363=_0x7579[_0x3660b3];return _0x497363;};'use strict';var emlformat=require(_0x9757('0x0'));var rimraf=require(_0x9757('0x1'));var zipdir=require(_0x9757('0x2'));var jsonpatch=require(_0x9757('0x3'));var rp=require(_0x9757('0x4'));var moment=require(_0x9757('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9757('0x6'));var util=require(_0x9757('0x7'));var path=require(_0x9757('0x8'));var sox=require(_0x9757('0x9'));var csv=require('to-csv');var ejs=require(_0x9757('0xa'));var fs=require('fs');var fs_extra=require(_0x9757('0xb'));var _=require(_0x9757('0xc'));var squel=require('squel');var crypto=require(_0x9757('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9757('0xe'));var toCsv=require(_0x9757('0xf'));var querystring=require(_0x9757('0x10'));var Papa=require('papaparse');var Redis=require(_0x9757('0x11'));var authService=require(_0x9757('0x12'));var qs=require(_0x9757('0x13'));var as=require(_0x9757('0x14'));var hardwareService=require(_0x9757('0x15'));var logger=require(_0x9757('0x16'))(_0x9757('0x17'));var utils=require(_0x9757('0x18'));var config=require(_0x9757('0x19'));var licenseUtil=require(_0x9757('0x1a'));var db=require(_0x9757('0x1b'))['db'];function respondWithStatusCode(_0x5c19c9,_0x2f2200){_0x2f2200=_0x2f2200||0xcc;return function(_0x1d32ee){if(_0x1d32ee){return _0x5c19c9[_0x9757('0x1c')](_0x2f2200);}return _0x5c19c9['status'](_0x2f2200)[_0x9757('0x1d')]();};}function respondWithResult(_0x39fa5c,_0x413d55){_0x413d55=_0x413d55||0xc8;return function(_0x14f67c){if(_0x14f67c){return _0x39fa5c[_0x9757('0x1e')](_0x413d55)[_0x9757('0x1f')](_0x14f67c);}};}function respondWithFilteredResult(_0x105e56,_0x4b994d){return function(_0x1fd6f6){if(_0x1fd6f6){var _0x55ded7=typeof _0x4b994d[_0x9757('0x20')]===_0x9757('0x21')&&typeof _0x4b994d[_0x9757('0x22')]===_0x9757('0x21');var _0x3f6be9=_0x1fd6f6[_0x9757('0x23')];var _0x57e309=_0x55ded7?0x0:_0x4b994d[_0x9757('0x20')];var _0x2aa360=_0x55ded7?_0x1fd6f6[_0x9757('0x23')]:_0x4b994d[_0x9757('0x20')]+_0x4b994d[_0x9757('0x22')];var _0xd2306b;if(_0x2aa360>=_0x3f6be9){_0x2aa360=_0x3f6be9;_0xd2306b=0xc8;}else{_0xd2306b=0xce;}_0x105e56[_0x9757('0x1e')](_0xd2306b);return _0x105e56['set'](_0x9757('0x24'),_0x57e309+'-'+_0x2aa360+'/'+_0x3f6be9)['json'](_0x1fd6f6);}return null;};}function patchUpdates(_0x517504){return function(_0x37c889){try{jsonpatch[_0x9757('0x25')](_0x37c889,_0x517504,!![]);}catch(_0x1443a9){return BPromise[_0x9757('0x26')](_0x1443a9);}return _0x37c889['save']();};}function saveUpdates(_0x4ef000,_0x53d21c){return function(_0x73dac4){if(_0x73dac4){return _0x73dac4[_0x9757('0x27')](_0x4ef000)[_0x9757('0x28')](function(_0x21435e){return _0x21435e;});}return null;};}function removeEntity(_0x5dc2fa,_0x11f5ac){return function(_0x160108){if(_0x160108){return _0x160108['destroy']()[_0x9757('0x28')](function(){_0x5dc2fa[_0x9757('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b6915,_0x1a7036){return function(_0x172e8c){if(!_0x172e8c){_0x2b6915[_0x9757('0x1c')](0x194);}return _0x172e8c;};}function handleError(_0x115e33,_0x19588f){_0x19588f=_0x19588f||0x1f4;return function(_0x4e6b86){logger[_0x9757('0x29')](_0x4e6b86['stack']);if(_0x4e6b86[_0x9757('0x2a')]){delete _0x4e6b86[_0x9757('0x2a')];}_0x115e33['status'](_0x19588f)['send'](_0x4e6b86);};}exports[_0x9757('0x2b')]=function(_0x21a4bd,_0xc81976){var _0x3aae8b={'raw':!![],'where':{'id':_0x21a4bd[_0x9757('0x2c')]['id']}},_0x4ebdb6={};_0x4ebdb6[_0x9757('0x2d')]=_[_0x9757('0x2e')](db[_0x9757('0x2f')][_0x9757('0x30')]);_0x4ebdb6[_0x9757('0x31')]=_['keys'](_0x21a4bd[_0x9757('0x31')]);_0x4ebdb6[_0x9757('0x32')]=_[_0x9757('0x33')](_0x4ebdb6[_0x9757('0x2d')],_0x4ebdb6[_0x9757('0x31')]);_0x3aae8b[_0x9757('0x34')]=_[_0x9757('0x33')](_0x4ebdb6['model'],qs[_0x9757('0x35')](_0x21a4bd[_0x9757('0x31')][_0x9757('0x35')]));_0x3aae8b[_0x9757('0x34')]=_0x3aae8b[_0x9757('0x34')][_0x9757('0x36')]?_0x3aae8b[_0x9757('0x34')]:_0x4ebdb6[_0x9757('0x2d')];if(_0x21a4bd['query'][_0x9757('0x37')]){_0x3aae8b['include']=[{'all':!![]}];}_0x3aae8b=_[_0x9757('0x38')]({},_0x3aae8b,_0x21a4bd[_0x9757('0x39')]);return db['ChatProactiveAction'][_0x9757('0x3a')](_0x3aae8b)[_0x9757('0x28')](handleEntityNotFound(_0xc81976,null))[_0x9757('0x28')](respondWithResult(_0xc81976,null))[_0x9757('0x3b')](handleError(_0xc81976,null));};exports[_0x9757('0x3c')]=function(_0x2f2688,_0x3c94b2){return db[_0x9757('0x2f')][_0x9757('0x3c')](_0x2f2688[_0x9757('0x3d')],{})['then'](respondWithResult(_0x3c94b2,0xc9))[_0x9757('0x3b')](handleError(_0x3c94b2,null));};exports[_0x9757('0x27')]=function(_0x457d6c,_0x4f2ea4){if(_0x457d6c[_0x9757('0x3d')]['id']){delete _0x457d6c[_0x9757('0x3d')]['id'];}return db[_0x9757('0x2f')][_0x9757('0x3a')]({'where':{'id':_0x457d6c[_0x9757('0x2c')]['id']}})[_0x9757('0x28')](handleEntityNotFound(_0x4f2ea4,null))[_0x9757('0x28')](saveUpdates(_0x457d6c[_0x9757('0x3d')],null))[_0x9757('0x28')](respondWithResult(_0x4f2ea4,null))['catch'](handleError(_0x4f2ea4,null));};exports['destroy']=function(_0x2cf830,_0x2d0a6e){return db[_0x9757('0x2f')][_0x9757('0x3a')]({'where':{'id':_0x2cf830['params']['id']}})[_0x9757('0x28')](handleEntityNotFound(_0x2d0a6e,null))['then'](removeEntity(_0x2d0a6e,null))[_0x9757('0x3b')](handleError(_0x2d0a6e,null));};
\ No newline at end of file
+var _0x04de=['query','keys','filters','intersection','attributes','length','includeAll','merge','options','ChatProactiveAction','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','then','error','stack','name','send','params','model','rawAttributes'];(function(_0x503254,_0x29e551){var _0x383dcc=function(_0x3c27fb){while(--_0x3c27fb){_0x503254['push'](_0x503254['shift']());}};_0x383dcc(++_0x29e551);}(_0x04de,0x107));var _0xe04d=function(_0xaa6c12,_0xa3fbbd){_0xaa6c12=_0xaa6c12-0x0;var _0x4a7877=_0x04de[_0xaa6c12];return _0x4a7877;};'use strict';var emlformat=require(_0xe04d('0x0'));var rimraf=require(_0xe04d('0x1'));var zipdir=require(_0xe04d('0x2'));var jsonpatch=require(_0xe04d('0x3'));var rp=require(_0xe04d('0x4'));var moment=require(_0xe04d('0x5'));var BPromise=require(_0xe04d('0x6'));var Mustache=require(_0xe04d('0x7'));var util=require(_0xe04d('0x8'));var path=require(_0xe04d('0x9'));var sox=require(_0xe04d('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe04d('0xb'));var crypto=require(_0xe04d('0xc'));var jsforce=require(_0xe04d('0xd'));var deskjs=require(_0xe04d('0xe'));var toCsv=require(_0xe04d('0xf'));var querystring=require(_0xe04d('0x10'));var Papa=require(_0xe04d('0x11'));var Redis=require(_0xe04d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe04d('0x13'));var as=require(_0xe04d('0x14'));var hardwareService=require(_0xe04d('0x15'));var logger=require(_0xe04d('0x16'))(_0xe04d('0x17'));var utils=require(_0xe04d('0x18'));var config=require(_0xe04d('0x19'));var licenseUtil=require(_0xe04d('0x1a'));var db=require(_0xe04d('0x1b'))['db'];function respondWithStatusCode(_0x53f59a,_0x8bf2d2){_0x8bf2d2=_0x8bf2d2||0xcc;return function(_0x1d3f03){if(_0x1d3f03){return _0x53f59a[_0xe04d('0x1c')](_0x8bf2d2);}return _0x53f59a[_0xe04d('0x1d')](_0x8bf2d2)[_0xe04d('0x1e')]();};}function respondWithResult(_0xa2521,_0xf205f5){_0xf205f5=_0xf205f5||0xc8;return function(_0x143019){if(_0x143019){return _0xa2521[_0xe04d('0x1d')](_0xf205f5)[_0xe04d('0x1f')](_0x143019);}};}function respondWithFilteredResult(_0xbc5cc7,_0x1aa69b){return function(_0x5cfd5b){if(_0x5cfd5b){var _0x1f29a7=typeof _0x1aa69b['offset']===_0xe04d('0x20')&&typeof _0x1aa69b['limit']===_0xe04d('0x20');var _0xbd5fa1=_0x5cfd5b[_0xe04d('0x21')];var _0x93b107=_0x1f29a7?0x0:_0x1aa69b[_0xe04d('0x22')];var _0x35a2b4=_0x1f29a7?_0x5cfd5b[_0xe04d('0x21')]:_0x1aa69b[_0xe04d('0x22')]+_0x1aa69b[_0xe04d('0x23')];var _0x5d8a1e;if(_0x35a2b4>=_0xbd5fa1){_0x35a2b4=_0xbd5fa1;_0x5d8a1e=0xc8;}else{_0x5d8a1e=0xce;}_0xbc5cc7[_0xe04d('0x1d')](_0x5d8a1e);return _0xbc5cc7[_0xe04d('0x24')](_0xe04d('0x25'),_0x93b107+'-'+_0x35a2b4+'/'+_0xbd5fa1)[_0xe04d('0x1f')](_0x5cfd5b);}return null;};}function patchUpdates(_0x2ac847){return function(_0x34e15f){try{jsonpatch['apply'](_0x34e15f,_0x2ac847,!![]);}catch(_0x3b1f42){return BPromise[_0xe04d('0x26')](_0x3b1f42);}return _0x34e15f['save']();};}function saveUpdates(_0x4b4d8b,_0x5bcfc3){return function(_0x46fab1){if(_0x46fab1){return _0x46fab1['update'](_0x4b4d8b)['then'](function(_0x185d42){return _0x185d42;});}return null;};}function removeEntity(_0x26a869,_0x495f73){return function(_0x942d8a){if(_0x942d8a){return _0x942d8a['destroy']()[_0xe04d('0x27')](function(){_0x26a869['status'](0xcc)[_0xe04d('0x1e')]();});}};}function handleEntityNotFound(_0x456822,_0x48db4e){return function(_0x29ad33){if(!_0x29ad33){_0x456822[_0xe04d('0x1c')](0x194);}return _0x29ad33;};}function handleError(_0x51540e,_0x10aa20){_0x10aa20=_0x10aa20||0x1f4;return function(_0x3e43ca){logger[_0xe04d('0x28')](_0x3e43ca[_0xe04d('0x29')]);if(_0x3e43ca['name']){delete _0x3e43ca[_0xe04d('0x2a')];}_0x51540e[_0xe04d('0x1d')](_0x10aa20)[_0xe04d('0x2b')](_0x3e43ca);};}exports['show']=function(_0x187c29,_0x5a3899){var _0x4f5883={'raw':!![],'where':{'id':_0x187c29[_0xe04d('0x2c')]['id']}},_0x569e4b={};_0x569e4b[_0xe04d('0x2d')]=_['keys'](db['ChatProactiveAction'][_0xe04d('0x2e')]);_0x569e4b[_0xe04d('0x2f')]=_[_0xe04d('0x30')](_0x187c29['query']);_0x569e4b[_0xe04d('0x31')]=_[_0xe04d('0x32')](_0x569e4b['model'],_0x569e4b[_0xe04d('0x2f')]);_0x4f5883['attributes']=_[_0xe04d('0x32')](_0x569e4b[_0xe04d('0x2d')],qs['fields'](_0x187c29[_0xe04d('0x2f')]['fields']));_0x4f5883[_0xe04d('0x33')]=_0x4f5883[_0xe04d('0x33')][_0xe04d('0x34')]?_0x4f5883[_0xe04d('0x33')]:_0x569e4b[_0xe04d('0x2d')];if(_0x187c29[_0xe04d('0x2f')][_0xe04d('0x35')]){_0x4f5883['include']=[{'all':!![]}];}_0x4f5883=_[_0xe04d('0x36')]({},_0x4f5883,_0x187c29[_0xe04d('0x37')]);return db[_0xe04d('0x38')][_0xe04d('0x39')](_0x4f5883)[_0xe04d('0x27')](handleEntityNotFound(_0x5a3899,null))[_0xe04d('0x27')](respondWithResult(_0x5a3899,null))[_0xe04d('0x3a')](handleError(_0x5a3899,null));};exports[_0xe04d('0x3b')]=function(_0x26c6c5,_0x59ed1c){return db[_0xe04d('0x38')]['create'](_0x26c6c5[_0xe04d('0x3c')],{})['then'](respondWithResult(_0x59ed1c,0xc9))['catch'](handleError(_0x59ed1c,null));};exports[_0xe04d('0x3d')]=function(_0x9353a1,_0x261116){if(_0x9353a1[_0xe04d('0x3c')]['id']){delete _0x9353a1['body']['id'];}return db[_0xe04d('0x38')][_0xe04d('0x39')]({'where':{'id':_0x9353a1[_0xe04d('0x2c')]['id']}})[_0xe04d('0x27')](handleEntityNotFound(_0x261116,null))[_0xe04d('0x27')](saveUpdates(_0x9353a1['body'],null))['then'](respondWithResult(_0x261116,null))[_0xe04d('0x3a')](handleError(_0x261116,null));};exports['destroy']=function(_0x53c072,_0x23e4b2){return db[_0xe04d('0x38')][_0xe04d('0x39')]({'where':{'id':_0x53c072[_0xe04d('0x2c')]['id']}})['then'](handleEntityNotFound(_0x23e4b2,null))['then'](removeEntity(_0x23e4b2,null))[_0xe04d('0x3a')](handleError(_0x23e4b2,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index a1c6601..8ac8fe5 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 _0xaeba=['bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util','api','moment'];(function(_0x5dc8b3,_0x56d6e8){var _0xf1289b=function(_0x1770b6){while(--_0x1770b6){_0x5dc8b3['push'](_0x5dc8b3['shift']());}};_0xf1289b(++_0x56d6e8);}(_0xaeba,0x170));var _0xaaeb=function(_0x34f95e,_0x3e6f32){_0x34f95e=_0x34f95e-0x0;var _0x2264e3=_0xaeba[_0x34f95e];return _0x2264e3;};'use strict';var _=require(_0xaaeb('0x0'));var util=require(_0xaaeb('0x1'));var logger=require('../../config/logger')(_0xaaeb('0x2'));var moment=require(_0xaaeb('0x3'));var BPromise=require(_0xaaeb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaaeb('0x5'));var rimraf=require(_0xaaeb('0x6'));var config=require(_0xaaeb('0x7'));var attributes=require(_0xaaeb('0x8'));module[_0xaaeb('0x9')]=function(_0x214ca2,_0xcbe11c){return _0x214ca2[_0xaaeb('0xa')](_0xaaeb('0xb'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1835=['exports','ChatProactiveAction','chat_proactive_actions','lodash','util','api','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1835,0xea));var _0x5183=function(_0x11edb7,_0x2e4952){_0x11edb7=_0x11edb7-0x0;var _0x29235b=_0x1835[_0x11edb7];return _0x29235b;};'use strict';var _=require(_0x5183('0x0'));var util=require(_0x5183('0x1'));var logger=require('../../config/logger')(_0x5183('0x2'));var moment=require('moment');var BPromise=require(_0x5183('0x3'));var rp=require(_0x5183('0x4'));var fs=require('fs');var path=require(_0x5183('0x5'));var rimraf=require(_0x5183('0x6'));var config=require('../../config/environment');var attributes=require(_0x5183('0x7'));module[_0x5183('0x8')]=function(_0x521aeb,_0x5a81ef){return _0x521aeb['define'](_0x5183('0x9'),attributes,{'tableName':_0x5183('0xa'),'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 4171dda..a43880e 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 _0xb7ec=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash'];(function(_0xe4e303,_0x8f9657){var _0x39021e=function(_0x134b8a){while(--_0x134b8a){_0xe4e303['push'](_0xe4e303['shift']());}};_0x39021e(++_0x8f9657);}(_0xb7ec,0xbc));var _0xcb7e=function(_0x18b85e,_0x1a4727){_0x18b85e=_0x18b85e-0x0;var _0xdb0129=_0xb7ec[_0x18b85e];return _0xdb0129;};'use strict';var _=require(_0xcb7e('0x0'));var util=require(_0xcb7e('0x1'));var moment=require(_0xcb7e('0x2'));var BPromise=require(_0xcb7e('0x3'));var rs=require(_0xcb7e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb7e('0x5'))['db'];var utils=require(_0xcb7e('0x6'));var logger=require(_0xcb7e('0x7'))(_0xcb7e('0x8'));var config=require('../../config/environment');var jayson=require(_0xcb7e('0x9'));var client=jayson[_0xcb7e('0xa')][_0xcb7e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x446bbf,_0x949e08,_0x51f096){return new BPromise(function(_0x14d042,_0x9cac9){return client[_0xcb7e('0xc')](_0x446bbf,_0x51f096)['then'](function(_0xbec63c){logger[_0xcb7e('0xd')](_0xcb7e('0xe'),_0x949e08,'request\x20sent');logger['debug'](_0xcb7e('0xf'),_0x949e08,_0xcb7e('0x10'),JSON['stringify'](_0xbec63c));if(_0xbec63c[_0xcb7e('0x11')]){if(_0xbec63c[_0xcb7e('0x11')][_0xcb7e('0x12')]===0x1f4){logger[_0xcb7e('0x11')](_0xcb7e('0xe'),_0x949e08,_0xbec63c[_0xcb7e('0x11')]['message']);return _0x9cac9(_0xbec63c[_0xcb7e('0x11')][_0xcb7e('0x13')]);}logger['error'](_0xcb7e('0xe'),_0x949e08,_0xbec63c[_0xcb7e('0x11')][_0xcb7e('0x13')]);return _0x14d042(_0xbec63c['error'][_0xcb7e('0x13')]);}else{logger[_0xcb7e('0xd')](_0xcb7e('0xe'),_0x949e08,_0xcb7e('0x10'));_0x14d042(_0xbec63c['result']['message']);}})[_0xcb7e('0x14')](function(_0x433cd6){logger[_0xcb7e('0x11')](_0xcb7e('0xe'),_0x949e08,_0x433cd6);_0x9cac9(_0x433cd6);});});}
\ No newline at end of file
+var _0xa58e=['info','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','ChatProactiveAction,\x20%s,\x20%s','message','request\x20sent','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x4f6278,_0xac8b23){var _0x158f78=function(_0x37bc4a){while(--_0x37bc4a){_0x4f6278['push'](_0x4f6278['shift']());}};_0x158f78(++_0xac8b23);}(_0xa58e,0x172));var _0xea58=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xa58e[_0x27af45];return _0x18df21;};'use strict';var _=require(_0xea58('0x0'));var util=require('util');var moment=require(_0xea58('0x1'));var BPromise=require(_0xea58('0x2'));var rs=require(_0xea58('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xea58('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xea58('0x5'))(_0xea58('0x6'));var config=require('../../config/environment');var jayson=require(_0xea58('0x7'));var client=jayson[_0xea58('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5dfb24,_0x3b9805,_0x2dc007){return new BPromise(function(_0x4d9150,_0x363937){return client[_0xea58('0x9')](_0x5dfb24,_0x2dc007)['then'](function(_0x417f7e){logger[_0xea58('0xa')]('ChatProactiveAction,\x20%s,\x20%s',_0x3b9805,'request\x20sent');logger[_0xea58('0xb')](_0xea58('0xc'),_0x3b9805,'request\x20sent',JSON[_0xea58('0xd')](_0x417f7e));if(_0x417f7e[_0xea58('0xe')]){if(_0x417f7e['error']['code']===0x1f4){logger[_0xea58('0xe')](_0xea58('0xf'),_0x3b9805,_0x417f7e[_0xea58('0xe')][_0xea58('0x10')]);return _0x363937(_0x417f7e[_0xea58('0xe')][_0xea58('0x10')]);}logger[_0xea58('0xe')](_0xea58('0xf'),_0x3b9805,_0x417f7e['error']['message']);return _0x4d9150(_0x417f7e[_0xea58('0xe')][_0xea58('0x10')]);}else{logger[_0xea58('0xa')](_0xea58('0xf'),_0x3b9805,_0xea58('0x11'));_0x4d9150(_0x417f7e['result'][_0xea58('0x10')]);}})[_0xea58('0x12')](function(_0x518e75){logger[_0xea58('0xe')](_0xea58('0xf'),_0x3b9805,_0x518e75);_0x363937(_0x518e75);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index d8ef343..e74bb9a 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 _0xb4c7=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','show','create'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x29b0c4,_0x54ffdd){_0x29b0c4=_0x29b0c4-0x0;var _0x470785=_0xb4c7[_0x29b0c4];return _0x470785;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xc')]);router['post']('/',auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xd')]);router['put'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0x10')]);module[_0x7b4c('0x11')]=router;
\ No newline at end of file
+var _0xeec6=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','put','update','delete','exports'];(function(_0x560232,_0x3d3008){var _0x478ab6=function(_0x20e131){while(--_0x20e131){_0x560232['push'](_0x560232['shift']());}};_0x478ab6(++_0x3d3008);}(_0xeec6,0x1c2));var _0x6eec=function(_0x324d02,_0x6d9c0b){_0x324d02=_0x324d02-0x0;var _0x3d4f59=_0xeec6[_0x324d02];return _0x3d4f59;};'use strict';var multer=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var timeout=require(_0x6eec('0x3'));var express=require('express');var router=express[_0x6eec('0x4')]();var fs_extra=require(_0x6eec('0x5'));var auth=require(_0x6eec('0x6'));var interaction=require(_0x6eec('0x7'));var config=require(_0x6eec('0x8'));var controller=require(_0x6eec('0x9'));router['get'](_0x6eec('0xa'),auth[_0x6eec('0xb')](),controller['show']);router[_0x6eec('0xc')]('/',auth[_0x6eec('0xb')](),controller[_0x6eec('0xd')]);router[_0x6eec('0xe')]('/:id',auth[_0x6eec('0xb')](),controller[_0x6eec('0xf')]);router[_0x6eec('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6eec('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 9c7cae9..0a2c6ab 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 _0x27b5=['sequelize','STRING','name','INTEGER','beepall'];(function(_0x2442dd,_0x269ded){var _0x9d4594=function(_0x4964ff){while(--_0x4964ff){_0x2442dd['push'](_0x2442dd['shift']());}};_0x9d4594(++_0x269ded);}(_0x27b5,0x131));var _0x527b=function(_0x4b6507,_0x5518b5){_0x4b6507=_0x4b6507-0x0;var _0x2001ec=_0x27b5[_0x4b6507];return _0x2001ec;};'use strict';var Sequelize=require(_0x527b('0x0'));module['exports']={'name':{'type':Sequelize[_0x527b('0x1')],'unique':_0x527b('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x527b('0x1')]},'timeout':{'type':Sequelize[_0x527b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x527b('0x4'),'roundrobin')}};
\ No newline at end of file
+var _0xf7ad=['INTEGER','rrmemory','beepall','sequelize','STRING','name'];(function(_0x2a16cb,_0x3d646e){var _0x379416=function(_0x8503e4){while(--_0x8503e4){_0x2a16cb['push'](_0x2a16cb['shift']());}};_0x379416(++_0x3d646e);}(_0xf7ad,0x17d));var _0xdf7a=function(_0x16c5a0,_0x253b66){_0x16c5a0=_0x16c5a0-0x0;var _0xc380b5=_0xf7ad[_0x16c5a0];return _0xc380b5;};'use strict';var Sequelize=require(_0xdf7a('0x0'));module['exports']={'name':{'type':Sequelize[_0xdf7a('0x1')],'unique':_0xdf7a('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xdf7a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xdf7a('0x4'),_0xdf7a('0x5'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 2973953..b1f7ebf 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 _0x09ca=['rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','request','then','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','ChatQueue,\x20%s,\x20%s','error','message','info','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','end','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','ChatQueue','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','keys','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','agent','updatedAt','rows','%s/%s','SIP','chatPause','createdAt','getTeams','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','each','findOrCreate','userChatQueue:save','removeTeams','Team','select','field','tq.TeamId','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','union','compact','transaction','forEach','emit','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format'];(function(_0xef49d1,_0x5a9893){var _0x3b5eac=function(_0x5d5305){while(--_0x5d5305){_0xef49d1['push'](_0xef49d1['shift']());}};_0x3b5eac(++_0x5a9893);}(_0x09ca,0x131));var _0xa09c=function(_0x30fb3d,_0x246528){_0x30fb3d=_0x30fb3d-0x0;var _0x4e3adf=_0x09ca[_0x30fb3d];return _0x4e3adf;};'use strict';var emlformat=require(_0xa09c('0x0'));var rimraf=require(_0xa09c('0x1'));var zipdir=require(_0xa09c('0x2'));var jsonpatch=require(_0xa09c('0x3'));var rp=require(_0xa09c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa09c('0x5'));var util=require(_0xa09c('0x6'));var path=require(_0xa09c('0x7'));var sox=require('sox');var csv=require(_0xa09c('0x8'));var ejs=require(_0xa09c('0x9'));var fs=require('fs');var fs_extra=require(_0xa09c('0xa'));var _=require(_0xa09c('0xb'));var squel=require(_0xa09c('0xc'));var crypto=require(_0xa09c('0xd'));var jsforce=require(_0xa09c('0xe'));var deskjs=require(_0xa09c('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa09c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa09c('0x11'));var authService=require(_0xa09c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa09c('0x13'));var hardwareService=require(_0xa09c('0x14'));var logger=require(_0xa09c('0x15'))(_0xa09c('0x16'));var utils=require('../../config/utils');var config=require(_0xa09c('0x17'));var licenseUtil=require(_0xa09c('0x18'));var db=require(_0xa09c('0x19'))['db'];config['redis']=_[_0xa09c('0x1a')](config[_0xa09c('0x1b')],{'host':_0xa09c('0x1c'),'port':0x18eb});var socket=require(_0xa09c('0x1d'))(new Redis(config[_0xa09c('0x1b')]));require(_0xa09c('0x1e'))[_0xa09c('0x1f')](socket);var jayson=require(_0xa09c('0x20'));var client=jayson[_0xa09c('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31a572,_0x4a2f04,_0x51d447,_0x3775b8){return new BPromise(function(_0x45d18a,_0x426dba){var _0x58e186=_0x3775b8||client;return _0x58e186[_0xa09c('0x22')](_0x31a572,_0x51d447)[_0xa09c('0x23')](function(_0x424299){logger['info']('ChatQueue,\x20%s,\x20%s',_0x4a2f04,_0xa09c('0x24'));logger['debug'](_0xa09c('0x25'),_0x4a2f04,'request\x20sent',JSON[_0xa09c('0x26')](_0x424299));if(_0x424299['error']){if(_0x424299['error']['code']===0x1f4){logger['error'](_0xa09c('0x27'),_0x4a2f04,_0x424299[_0xa09c('0x28')][_0xa09c('0x29')]);return _0x426dba(_0x424299['error'][_0xa09c('0x29')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x4a2f04,_0x424299['error']['message']);return _0x45d18a(_0x424299[_0xa09c('0x28')][_0xa09c('0x29')]);}else{logger[_0xa09c('0x2a')](_0xa09c('0x27'),_0x4a2f04,_0xa09c('0x24'));_0x45d18a(_0x424299['result'][_0xa09c('0x29')]);}})[_0xa09c('0x2b')](function(_0x25b26e){logger['error']('ChatQueue,\x20%s,\x20%s',_0x4a2f04,_0x25b26e);_0x426dba(_0x25b26e);});});}function respondWithStatusCode(_0x13c20a,_0x302107){_0x302107=_0x302107||0xcc;return function(_0x38edd6){if(_0x38edd6){return _0x13c20a[_0xa09c('0x2c')](_0x302107);}return _0x13c20a[_0xa09c('0x2d')](_0x302107)['end']();};}function respondWithResult(_0x3c43a3,_0x22ca52){_0x22ca52=_0x22ca52||0xc8;return function(_0x3f921a){if(_0x3f921a){return _0x3c43a3[_0xa09c('0x2d')](_0x22ca52)[_0xa09c('0x2e')](_0x3f921a);}};}function respondWithFilteredResult(_0x45f523,_0x42739){return function(_0x764a2d){if(_0x764a2d){var _0xa1e6d8=typeof _0x42739['offset']===_0xa09c('0x2f')&&typeof _0x42739[_0xa09c('0x30')]==='undefined';var _0x16787d=_0x764a2d[_0xa09c('0x31')];var _0x135df5=_0xa1e6d8?0x0:_0x42739['offset'];var _0x57887e=_0xa1e6d8?_0x764a2d[_0xa09c('0x31')]:_0x42739[_0xa09c('0x32')]+_0x42739['limit'];var _0x4e7b6e;if(_0x57887e>=_0x16787d){_0x57887e=_0x16787d;_0x4e7b6e=0xc8;}else{_0x4e7b6e=0xce;}_0x45f523[_0xa09c('0x2d')](_0x4e7b6e);return _0x45f523[_0xa09c('0x33')](_0xa09c('0x34'),_0x135df5+'-'+_0x57887e+'/'+_0x16787d)['json'](_0x764a2d);}return null;};}function patchUpdates(_0x53ea14){return function(_0xc4ca7f){try{jsonpatch[_0xa09c('0x35')](_0xc4ca7f,_0x53ea14,!![]);}catch(_0x25639d){return BPromise[_0xa09c('0x36')](_0x25639d);}return _0xc4ca7f[_0xa09c('0x37')]();};}function saveUpdates(_0x4e59d9,_0x16052b){return function(_0x187f1f){if(_0x187f1f){return _0x187f1f[_0xa09c('0x38')](_0x4e59d9)[_0xa09c('0x23')](function(_0x2e4734){return _0x2e4734;});}return null;};}function removeEntity(_0x3fc70a,_0x3ea1aa){return function(_0x2e17f1){if(_0x2e17f1){return _0x2e17f1[_0xa09c('0x39')]()[_0xa09c('0x23')](function(){var _0x4faa07=_0x2e17f1[_0xa09c('0x3a')]({'plain':!![]});var _0x2ebd10=_0xa09c('0x3b');return db['UserProfileResource'][_0xa09c('0x39')]({'where':{'type':_0x2ebd10,'resourceId':_0x4faa07['id']}})[_0xa09c('0x23')](function(){return _0x2e17f1;});})[_0xa09c('0x23')](function(){_0x3fc70a[_0xa09c('0x2d')](0xcc)[_0xa09c('0x3c')]();});}};}function handleEntityNotFound(_0x342241,_0x1a524b){return function(_0x17d153){if(!_0x17d153){_0x342241['sendStatus'](0x194);}return _0x17d153;};}function handleError(_0x45ceda,_0x1f3744){_0x1f3744=_0x1f3744||0x1f4;return function(_0x12e6b7){logger[_0xa09c('0x28')](_0x12e6b7[_0xa09c('0x3d')]);if(_0x12e6b7['name']){delete _0x12e6b7[_0xa09c('0x3e')];}_0x45ceda[_0xa09c('0x2d')](_0x1f3744)[_0xa09c('0x3f')](_0x12e6b7);};}exports[_0xa09c('0x40')]=function(_0x3b039c,_0x147a26){var _0x13a4b5={},_0x3f2ce1={},_0x48988f={'count':0x0,'rows':[]};var _0x2c4580=_[_0xa09c('0x41')](db['ChatQueue'][_0xa09c('0x42')],function(_0x580b64){return{'name':_0x580b64[_0xa09c('0x43')],'type':_0x580b64[_0xa09c('0x44')]['key']};});_0x3f2ce1[_0xa09c('0x45')]=_[_0xa09c('0x41')](_0x2c4580,_0xa09c('0x3e'));_0x3f2ce1[_0xa09c('0x46')]=_['keys'](_0x3b039c[_0xa09c('0x46')]);_0x3f2ce1[_0xa09c('0x47')]=_[_0xa09c('0x48')](_0x3f2ce1[_0xa09c('0x45')],_0x3f2ce1[_0xa09c('0x46')]);_0x13a4b5['attributes']=_[_0xa09c('0x48')](_0x3f2ce1['model'],qs[_0xa09c('0x49')](_0x3b039c[_0xa09c('0x46')][_0xa09c('0x49')]));_0x13a4b5[_0xa09c('0x4a')]=_0x13a4b5[_0xa09c('0x4a')][_0xa09c('0x4b')]?_0x13a4b5['attributes']:_0x3f2ce1[_0xa09c('0x45')];if(!_0x3b039c[_0xa09c('0x46')][_0xa09c('0x4c')](_0xa09c('0x4d'))){_0x13a4b5[_0xa09c('0x30')]=qs[_0xa09c('0x30')](_0x3b039c['query']['limit']);_0x13a4b5[_0xa09c('0x32')]=qs['offset'](_0x3b039c[_0xa09c('0x46')][_0xa09c('0x32')]);}_0x13a4b5[_0xa09c('0x4e')]=qs[_0xa09c('0x4f')](_0x3b039c[_0xa09c('0x46')]['sort']);_0x13a4b5[_0xa09c('0x50')]=qs[_0xa09c('0x47')](_[_0xa09c('0x51')](_0x3b039c[_0xa09c('0x46')],_0x3f2ce1[_0xa09c('0x47')]),_0x2c4580);if(_0x3b039c[_0xa09c('0x46')][_0xa09c('0x52')]){_0x13a4b5['where']=_[_0xa09c('0x53')](_0x13a4b5[_0xa09c('0x50')],{'$or':_[_0xa09c('0x41')](_0x2c4580,function(_0x5ea94f){if(_0x5ea94f[_0xa09c('0x44')]!==_0xa09c('0x54')){var _0xa6f3d4={};_0xa6f3d4[_0x5ea94f['name']]={'$like':'%'+_0x3b039c[_0xa09c('0x46')]['filter']+'%'};return _0xa6f3d4;}})});}_0x13a4b5=_['merge']({},_0x13a4b5,_0x3b039c[_0xa09c('0x55')]);var _0x10dfe8={'where':_0x13a4b5[_0xa09c('0x50')]};return db['ChatQueue']['count'](_0x10dfe8)[_0xa09c('0x23')](function(_0x206c65){_0x48988f['count']=_0x206c65;if(_0x3b039c[_0xa09c('0x46')][_0xa09c('0x56')]){_0x13a4b5[_0xa09c('0x57')]=[{'all':!![]}];}return db['ChatQueue'][_0xa09c('0x58')](_0x13a4b5);})[_0xa09c('0x23')](function(_0x3ecf40){_0x48988f['rows']=_0x3ecf40;return _0x48988f;})['then'](respondWithFilteredResult(_0x147a26,_0x13a4b5))['catch'](handleError(_0x147a26,null));};exports['show']=function(_0x182723,_0x7e9a27){var _0x441d7f={'raw':!![],'where':{'id':_0x182723['params']['id']}},_0x4e0575={};_0x4e0575[_0xa09c('0x45')]=_['keys'](db[_0xa09c('0x59')][_0xa09c('0x42')]);_0x4e0575['query']=_['keys'](_0x182723[_0xa09c('0x46')]);_0x4e0575['filters']=_[_0xa09c('0x48')](_0x4e0575['model'],_0x4e0575[_0xa09c('0x46')]);_0x441d7f[_0xa09c('0x4a')]=_['intersection'](_0x4e0575['model'],qs[_0xa09c('0x49')](_0x182723['query']['fields']));_0x441d7f[_0xa09c('0x4a')]=_0x441d7f[_0xa09c('0x4a')][_0xa09c('0x4b')]?_0x441d7f[_0xa09c('0x4a')]:_0x4e0575[_0xa09c('0x45')];if(_0x182723[_0xa09c('0x46')][_0xa09c('0x56')]){_0x441d7f[_0xa09c('0x57')]=[{'all':!![]}];}_0x441d7f=_['merge']({},_0x441d7f,_0x182723[_0xa09c('0x55')]);return db[_0xa09c('0x59')][_0xa09c('0x5a')](_0x441d7f)[_0xa09c('0x23')](handleEntityNotFound(_0x7e9a27,null))[_0xa09c('0x23')](respondWithResult(_0x7e9a27,null))[_0xa09c('0x2b')](handleError(_0x7e9a27,null));};exports[_0xa09c('0x5b')]=function(_0x1dd58c,_0x33624c){return db[_0xa09c('0x59')]['create'](_0x1dd58c['body'],{})[_0xa09c('0x23')](function(_0x16a8ed){var _0x286a24=_0x1dd58c['user'][_0xa09c('0x3a')]({'plain':!![]});if(!_0x286a24)throw new Error(_0xa09c('0x5c'));if(_0x286a24['role']===_0xa09c('0x5d')){var _0xb53951=_0x16a8ed[_0xa09c('0x3a')]({'plain':!![]});var _0x322c30=_0xa09c('0x3b');return db[_0xa09c('0x5e')][_0xa09c('0x5a')]({'where':{'name':_0x322c30,'userProfileId':_0x286a24['userProfileId']},'raw':!![]})[_0xa09c('0x23')](function(_0x3fcea5){if(_0x3fcea5&&_0x3fcea5[_0xa09c('0x5f')]===0x0){return db['UserProfileResource'][_0xa09c('0x5b')]({'name':_0xb53951[_0xa09c('0x3e')],'resourceId':_0xb53951['id'],'type':_0x3fcea5[_0xa09c('0x3e')],'sectionId':_0x3fcea5['id']},{})[_0xa09c('0x23')](function(){return _0x16a8ed;});}else{return _0x16a8ed;}})[_0xa09c('0x2b')](function(_0x1b7bd5){logger[_0xa09c('0x28')](_0xa09c('0x60'),_0x1b7bd5);throw _0x1b7bd5;});}return _0x16a8ed;})[_0xa09c('0x23')](respondWithResult(_0x33624c,0xc9))[_0xa09c('0x2b')](handleError(_0x33624c,null));};exports[_0xa09c('0x38')]=function(_0x20bb79,_0x3af94d){if(_0x20bb79[_0xa09c('0x61')]['id']){delete _0x20bb79[_0xa09c('0x61')]['id'];}return db[_0xa09c('0x59')][_0xa09c('0x5a')]({'where':{'id':_0x20bb79[_0xa09c('0x62')]['id']}})['then'](handleEntityNotFound(_0x3af94d,null))[_0xa09c('0x23')](saveUpdates(_0x20bb79[_0xa09c('0x61')],null))[_0xa09c('0x23')](respondWithResult(_0x3af94d,null))['catch'](handleError(_0x3af94d,null));};exports[_0xa09c('0x39')]=function(_0x4f6034,_0x34e076){return db[_0xa09c('0x59')][_0xa09c('0x5a')]({'where':{'id':_0x4f6034[_0xa09c('0x62')]['id']}})[_0xa09c('0x23')](handleEntityNotFound(_0x34e076,null))[_0xa09c('0x23')](removeEntity(_0x34e076,null))['catch'](handleError(_0x34e076,null));};exports[_0xa09c('0x63')]=function(_0x3d54fa,_0x3f5b3a){return db['ChatQueue'][_0xa09c('0x63')]()['then'](respondWithResult(_0x3f5b3a,null))[_0xa09c('0x2b')](handleError(_0x3f5b3a,null));};exports[_0xa09c('0x64')]=function(_0x9bb70b,_0x4dc961,_0x362d04){var _0x56e378={'raw':!![],'where':{}},_0x454a08={},_0x4cbc28;return db[_0xa09c('0x59')][_0xa09c('0x65')]({'where':{'id':_0x9bb70b[_0xa09c('0x62')]['id']}})[_0xa09c('0x23')](handleEntityNotFound(_0x4dc961,null))['then'](function(_0xddfc4f){if(_0xddfc4f){_0x4cbc28=_0xddfc4f[_0xa09c('0x3a')]({'plain':!![]});_0x454a08[_0xa09c('0x45')]=_[_0xa09c('0x66')](db[_0xa09c('0x67')][_0xa09c('0x42')]);_0x454a08[_0xa09c('0x46')]=_['keys'](_0x9bb70b['query']);_0x454a08[_0xa09c('0x47')]=_[_0xa09c('0x48')](_0x454a08[_0xa09c('0x45')],_0x454a08[_0xa09c('0x46')]);_0x56e378['attributes']=_[_0xa09c('0x48')](_0x454a08['model'],qs[_0xa09c('0x49')](_0x9bb70b[_0xa09c('0x46')][_0xa09c('0x49')]));_0x56e378[_0xa09c('0x4a')]=_0x56e378[_0xa09c('0x4a')][_0xa09c('0x4b')]?_0x56e378[_0xa09c('0x4a')]:_0x454a08['model'];if(!_0x9bb70b[_0xa09c('0x46')][_0xa09c('0x4c')]('nolimit')){_0x56e378[_0xa09c('0x30')]=qs[_0xa09c('0x30')](_0x9bb70b[_0xa09c('0x46')][_0xa09c('0x30')]);_0x56e378[_0xa09c('0x32')]=qs[_0xa09c('0x32')](_0x9bb70b[_0xa09c('0x46')][_0xa09c('0x32')]);}_0x56e378[_0xa09c('0x4e')]=qs[_0xa09c('0x4f')](_0x9bb70b[_0xa09c('0x46')][_0xa09c('0x4f')]);_0x56e378[_0xa09c('0x50')]=qs[_0xa09c('0x47')](_['pick'](_0x9bb70b['query'],_0x454a08[_0xa09c('0x47')]));_0x56e378[_0xa09c('0x50')][_0xa09c('0x68')]=_0xddfc4f['id'];if(_0x9bb70b[_0xa09c('0x46')][_0xa09c('0x52')]){_0x56e378['where']=_[_0xa09c('0x53')](_0x56e378[_0xa09c('0x50')],{'$or':_[_0xa09c('0x41')](_0x56e378[_0xa09c('0x4a')],function(_0x548452){var _0x6516e8={};_0x6516e8[_0x548452]={'$like':'%'+_0x9bb70b['query']['filter']+'%'};return _0x6516e8;})});}_0x56e378=_['merge']({},_0x56e378,_0x9bb70b[_0xa09c('0x55')]);return db['UserChatQueue'][_0xa09c('0x58')](_0x56e378);}})[_0xa09c('0x23')](function(_0x23360e){if(_0x23360e){return db[_0xa09c('0x69')][_0xa09c('0x6a')]({'where':{'id':_[_0xa09c('0x41')](_0x23360e,_0xa09c('0x6b')),'role':_0xa09c('0x6c')},'attributes':['id',_0xa09c('0x3e'),'chatPause',_0xa09c('0x6d'),'createdAt']});}})[_0xa09c('0x23')](function(_0x3111ec){if(_0x3111ec){return{'count':_0x3111ec[_0xa09c('0x31')],'rows':_[_0xa09c('0x41')](_0x3111ec[_0xa09c('0x6e')],function(_0x3e1308){return{'membername':_0x3e1308['name'],'UserId':_0x3e1308['id'],'queue_name':_0x4cbc28[_0xa09c('0x3e')],'ChatQueueId':_0x4cbc28['id'],'interface':util['format'](_0xa09c('0x6f'),_0xa09c('0x70'),_0x3e1308[_0xa09c('0x3e')]),'penalty':0x0,'paused':_0x3e1308[_0xa09c('0x71')],'createdAt':_0x3e1308[_0xa09c('0x72')],'updatedAt':_0x3e1308['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4dc961,_0x56e378))[_0xa09c('0x2b')](handleError(_0x4dc961,null));};exports['getTeams']=function(_0x271460,_0x13ae72,_0x3657f8){var _0x3f87b8={};var _0x1a392a={};var _0x543cab;var _0x4ed3f9;return db[_0xa09c('0x59')][_0xa09c('0x65')]({'where':{'id':_0x271460['params']['id']}})[_0xa09c('0x23')](handleEntityNotFound(_0x13ae72,null))[_0xa09c('0x23')](function(_0x263e57){if(_0x263e57){_0x543cab=_0x263e57;_0x1a392a[_0xa09c('0x45')]=_['keys'](db['Team']['rawAttributes']);_0x1a392a[_0xa09c('0x46')]=_[_0xa09c('0x66')](_0x271460[_0xa09c('0x46')]);_0x1a392a['filters']=_[_0xa09c('0x48')](_0x1a392a[_0xa09c('0x45')],_0x1a392a[_0xa09c('0x46')]);_0x3f87b8[_0xa09c('0x4a')]=_[_0xa09c('0x48')](_0x1a392a[_0xa09c('0x45')],qs[_0xa09c('0x49')](_0x271460[_0xa09c('0x46')]['fields']));_0x3f87b8[_0xa09c('0x4a')]=_0x3f87b8['attributes'][_0xa09c('0x4b')]?_0x3f87b8[_0xa09c('0x4a')]:_0x1a392a[_0xa09c('0x45')];_0x3f87b8[_0xa09c('0x4e')]=qs[_0xa09c('0x4f')](_0x271460[_0xa09c('0x46')][_0xa09c('0x4f')]);_0x3f87b8[_0xa09c('0x50')]=qs[_0xa09c('0x47')](_['pick'](_0x271460[_0xa09c('0x46')],_0x1a392a[_0xa09c('0x47')]));if(_0x271460[_0xa09c('0x46')][_0xa09c('0x52')]){_0x3f87b8['where']=_[_0xa09c('0x53')](_0x3f87b8[_0xa09c('0x50')],{'$or':_['map'](_0x3f87b8[_0xa09c('0x4a')],function(_0x459f30){var _0x14e02f={};_0x14e02f[_0x459f30]={'$like':'%'+_0x271460[_0xa09c('0x46')][_0xa09c('0x52')]+'%'};return _0x14e02f;})});}_0x3f87b8=_['merge']({},_0x3f87b8,_0x271460[_0xa09c('0x55')]);return _0x543cab[_0xa09c('0x73')](_0x3f87b8);}})[_0xa09c('0x23')](function(_0x58d126){if(_0x58d126){_0x4ed3f9=_0x58d126['length'];if(!_0x271460[_0xa09c('0x46')][_0xa09c('0x4c')](_0xa09c('0x4d'))){_0x3f87b8[_0xa09c('0x30')]=qs[_0xa09c('0x30')](_0x271460['query'][_0xa09c('0x30')]);_0x3f87b8[_0xa09c('0x32')]=qs[_0xa09c('0x32')](_0x271460[_0xa09c('0x46')]['offset']);}return _0x543cab['getTeams'](_0x3f87b8);}})[_0xa09c('0x23')](function(_0x2abb18){if(_0x2abb18){return _0x2abb18?{'count':_0x4ed3f9,'rows':_0x2abb18}:null;}})[_0xa09c('0x23')](respondWithResult(_0x13ae72,null))[_0xa09c('0x2b')](handleError(_0x13ae72,null));};exports[_0xa09c('0x74')]=function(_0x4decae,_0x24d4c1,_0x3385cf){var _0x11cc0c=_0x4decae['body'][_0xa09c('0x75')];return db['Team'][_0xa09c('0x58')]({'where':{'id':_0x11cc0c},'attributes':['id'],'include':[{'model':db[_0xa09c('0x69')],'as':_0xa09c('0x76'),'attributes':['id',_0xa09c('0x3e'),'online',_0xa09c('0x77'),_0xa09c('0x78')],'raw':!![]}]})[_0xa09c('0x23')](function(_0x12ab52){if(_0x12ab52){var _0x121d18=_[_0xa09c('0x79')](_0x12ab52,function(_0x2309b5){var _0xe48cd7=_0x2309b5[_0xa09c('0x3a')]({'plain':!![]});return _0xe48cd7[_0xa09c('0x76')];});return db[_0xa09c('0x59')][_0xa09c('0x5a')]({'where':{'id':_0x4decae[_0xa09c('0x62')]['id']}})[_0xa09c('0x23')](function(_0x4461b1){return db[_0xa09c('0x7a')]['transaction'](function(_0x3eeb69){return _0x4461b1[_0xa09c('0x74')](_0x11cc0c,{'transaction':_0x3eeb69})['then'](function(){return BPromise[_0xa09c('0x7b')](_0x121d18,function(_0x52cf4d){return db[_0xa09c('0x67')][_0xa09c('0x7c')]({'where':{'UserId':_0x52cf4d['id'],'ChatQueueId':_0x4decae[_0xa09c('0x62')]['id']},'transaction':_0x3eeb69});});})[_0xa09c('0x23')](function(){_0x121d18['forEach'](function(_0x2077ce){socket['emit'](_0xa09c('0x7d'),{'UserId':_0x2077ce['id'],'ChatQueueId':_0x4461b1['id']});});});});});}})['then'](respondWithStatusCode(_0x24d4c1,null))[_0xa09c('0x2b')](handleError(_0x24d4c1,null));};exports[_0xa09c('0x7e')]=function(_0xc3c061,_0x5204ec,_0x38e879){return db[_0xa09c('0x7f')][_0xa09c('0x58')]({'where':{'id':_0xc3c061[_0xa09c('0x46')][_0xa09c('0x75')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5204ec,null))['then'](function(_0x48f5f7){var _0x2c4ef7=_[_0xa09c('0x41')](_0x48f5f7,'id');var _0x3fbbd7=[];var _0x29f7ec=[];var _0x2dd16e=squel[_0xa09c('0x80')]();_0x2dd16e[_0xa09c('0x81')](_0xa09c('0x82'))['from'](_0xa09c('0x83'),'tq')[_0xa09c('0x84')]('user_has_teams','ut',_0xa09c('0x85'))['where'](_0xa09c('0x86'),_0xc3c061['params']['id']);for(var _0x32565b=0x0;_0x32565b<_0x48f5f7[_0xa09c('0x4b')];_0x32565b+=0x1){let _0x2ae69c=_0x48f5f7[_0x32565b];for(var _0x4d180d=0x0;_0x4d180d<_0x2ae69c[_0xa09c('0x76')]['length'];_0x4d180d+=0x1){let _0x24945b=_0x2ae69c[_0xa09c('0x76')][_0x4d180d];var _0x47219b=_0x2dd16e['clone']();_0x47219b['where'](_0xa09c('0x87'),_0x24945b['id']);_0x29f7ec[_0xa09c('0x88')](db[_0xa09c('0x7a')][_0xa09c('0x46')](_0x47219b[_0xa09c('0x89')](),{'type':db['sequelize']['QueryTypes'][_0xa09c('0x8a')]})['then'](function(_0x2b6677){if(_0x2b6677['length']===0x1){return _0x24945b['id'];}else{var _0x404558=_['every'](_[_0xa09c('0x41')](_0x2b6677,_0xa09c('0x8b')),function(_0x4658d8){return _[_0xa09c('0x8c')](_0x2c4ef7,_0x4658d8);});if(_0x404558){return _0x24945b['id'];}}}));}}return BPromise['all'](_0x29f7ec)[_0xa09c('0x23')](function(_0x47df44){_0x3fbbd7=_(_0x3fbbd7)[_0xa09c('0x8d')](_0x47df44)[_0xa09c('0x8e')]()['value']();return db[_0xa09c('0x59')][_0xa09c('0x5a')]({'where':{'id':_0xc3c061[_0xa09c('0x62')]['id']}})[_0xa09c('0x23')](function(_0x79dc83){return db[_0xa09c('0x7a')][_0xa09c('0x8f')](function(_0x54b52a){return _0x79dc83['removeTeams'](_0xc3c061[_0xa09c('0x46')][_0xa09c('0x75')],{'transaction':_0x54b52a})[_0xa09c('0x23')](function(){if(!_['isEmpty'](_0x3fbbd7)){return _0x79dc83['removeAgents'](_0x3fbbd7,{'transaction':_0x54b52a});}})[_0xa09c('0x23')](function(){_0x3fbbd7[_0xa09c('0x90')](function(_0x46b27b){socket[_0xa09c('0x91')](_0xa09c('0x92'),{'UserId':_0x46b27b,'ChatQueueId':_0x79dc83['id']});});});});});});})[_0xa09c('0x23')](respondWithStatusCode(_0x5204ec,null))['catch'](handleError(_0x5204ec,null));};exports['addAgents']=function(_0x4d4227,_0x16b345,_0x315c1d){return db[_0xa09c('0x59')]['find']({'where':{'id':_0x4d4227[_0xa09c('0x62')]['id']}})[_0xa09c('0x23')](handleEntityNotFound(_0x16b345,null))[_0xa09c('0x23')](function(_0x10c37f){if(_0x10c37f){return _0x10c37f[_0xa09c('0x93')](_0x4d4227[_0xa09c('0x61')][_0xa09c('0x75')],_[_0xa09c('0x94')](_0x4d4227[_0xa09c('0x61')],[_0xa09c('0x75'),'id'])||{})[_0xa09c('0x95')](function(_0x597cb1){for(var _0x10fecc=0x0;_0x10fecc<_0x4d4227[_0xa09c('0x61')][_0xa09c('0x75')][_0xa09c('0x4b')];_0x10fecc+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x4d4227[_0xa09c('0x61')]['ids'][_0x10fecc]),'ChatQueueId':Number(_0x4d4227[_0xa09c('0x62')]['id'])});}return _0x597cb1;});}})['then'](respondWithResult(_0x16b345,null))['catch'](handleError(_0x16b345,null));};exports[_0xa09c('0x96')]=function(_0x52588a,_0x204455,_0x5b99b2){return db[_0xa09c('0x59')][_0xa09c('0x5a')]({'where':{'id':_0x52588a[_0xa09c('0x62')]['id']}})[_0xa09c('0x23')](handleEntityNotFound(_0x204455,null))[_0xa09c('0x23')](function(_0x8bdf93){if(_0x8bdf93){return _0x8bdf93[_0xa09c('0x96')](_0x52588a[_0xa09c('0x46')][_0xa09c('0x75')])[_0xa09c('0x23')](function(){if(_[_0xa09c('0x97')](_0x52588a[_0xa09c('0x46')][_0xa09c('0x75')])){for(var _0x29d3fd=0x0;_0x29d3fd<_0x52588a[_0xa09c('0x46')][_0xa09c('0x75')][_0xa09c('0x4b')];_0x29d3fd+=0x1){socket[_0xa09c('0x91')]('userChatQueue:remove',{'UserId':Number(_0x52588a['query'][_0xa09c('0x75')][_0x29d3fd]),'ChatQueueId':Number(_0x52588a[_0xa09c('0x62')]['id'])});}}else{socket[_0xa09c('0x91')](_0xa09c('0x92'),{'UserId':Number(_0x52588a[_0xa09c('0x46')]['ids']),'ChatQueueId':Number(_0x52588a[_0xa09c('0x62')]['id'])});}});}})[_0xa09c('0x23')](respondWithStatusCode(_0x204455,null))[_0xa09c('0x2b')](handleError(_0x204455,null));};exports[_0xa09c('0x98')]=function(_0x29bb68,_0x67bd64,_0x354655){var _0xa8fe2f={};var _0x422ad8={};var _0x117599;var _0x18d0e5;return db[_0xa09c('0x59')][_0xa09c('0x65')]({'where':{'id':_0x29bb68[_0xa09c('0x62')]['id']}})[_0xa09c('0x23')](handleEntityNotFound(_0x67bd64,null))[_0xa09c('0x23')](function(_0x11d6f8){if(_0x11d6f8){_0x117599=_0x11d6f8;_0x422ad8[_0xa09c('0x45')]=_[_0xa09c('0x66')](db[_0xa09c('0x69')][_0xa09c('0x42')]);_0x422ad8[_0xa09c('0x46')]=_[_0xa09c('0x66')](_0x29bb68[_0xa09c('0x46')]);_0x422ad8['filters']=_[_0xa09c('0x48')](_0x422ad8[_0xa09c('0x45')],_0x422ad8[_0xa09c('0x46')]);_0xa8fe2f[_0xa09c('0x4a')]=_[_0xa09c('0x48')](_0x422ad8['model'],qs[_0xa09c('0x49')](_0x29bb68[_0xa09c('0x46')][_0xa09c('0x49')]));_0xa8fe2f[_0xa09c('0x4a')]=_0xa8fe2f[_0xa09c('0x4a')]['length']?_0xa8fe2f[_0xa09c('0x4a')]:_0x422ad8[_0xa09c('0x45')];_0xa8fe2f['order']=qs[_0xa09c('0x4f')](_0x29bb68[_0xa09c('0x46')][_0xa09c('0x4f')]);_0xa8fe2f[_0xa09c('0x50')]=qs[_0xa09c('0x47')](_['pick'](_0x29bb68['query'],_0x422ad8['filters']));if(_0x29bb68[_0xa09c('0x46')]['filter']){_0xa8fe2f[_0xa09c('0x50')]=_[_0xa09c('0x53')](_0xa8fe2f[_0xa09c('0x50')],{'$or':_[_0xa09c('0x41')](_0xa8fe2f['attributes'],function(_0x427a08){var _0x1b9d32={};_0x1b9d32[_0x427a08]={'$like':'%'+_0x29bb68['query'][_0xa09c('0x52')]+'%'};return _0x1b9d32;})});}_0xa8fe2f=_[_0xa09c('0x53')]({},_0xa8fe2f,_0x29bb68[_0xa09c('0x55')]);return _0x117599['getAgents'](_0xa8fe2f);}})[_0xa09c('0x23')](function(_0x507c3c){if(_0x507c3c){_0x18d0e5=_0x507c3c[_0xa09c('0x4b')];if(!_0x29bb68[_0xa09c('0x46')]['hasOwnProperty'](_0xa09c('0x4d'))){_0xa8fe2f[_0xa09c('0x30')]=qs[_0xa09c('0x30')](_0x29bb68['query'][_0xa09c('0x30')]);_0xa8fe2f['offset']=qs[_0xa09c('0x32')](_0x29bb68['query']['offset']);}return _0x117599[_0xa09c('0x98')](_0xa8fe2f);}})['then'](function(_0x53e641){if(_0x53e641){return _0x53e641?{'count':_0x18d0e5,'rows':_0x53e641}:null;}})[_0xa09c('0x23')](respondWithResult(_0x67bd64,null))[_0xa09c('0x2b')](handleError(_0x67bd64,null));};
\ No newline at end of file
+var _0xa70e=['send','index','map','ChatQueue','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','UserChatQueue','nolimit','ChatQueueId','User','findAndCountAll','UserId','chatPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','transaction','each','findOrCreate','forEach','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','includes','all','compact','value','removeTeams','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','emit','getAgents','rawAttributes','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','get','UserProfileResource','destroy','sendStatus','stack','name'];(function(_0x824626,_0x590cd4){var _0x7247cb=function(_0x18b0b9){while(--_0x18b0b9){_0x824626['push'](_0x824626['shift']());}};_0x7247cb(++_0x590cd4);}(_0xa70e,0xfd));var _0xea70=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa70e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xea70('0x0'));var rimraf=require(_0xea70('0x1'));var zipdir=require(_0xea70('0x2'));var jsonpatch=require(_0xea70('0x3'));var rp=require('request-promise');var moment=require(_0xea70('0x4'));var BPromise=require(_0xea70('0x5'));var Mustache=require(_0xea70('0x6'));var util=require(_0xea70('0x7'));var path=require('path');var sox=require(_0xea70('0x8'));var csv=require(_0xea70('0x9'));var ejs=require(_0xea70('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xea70('0xb'));var squel=require(_0xea70('0xc'));var crypto=require('crypto');var jsforce=require(_0xea70('0xd'));var deskjs=require(_0xea70('0xe'));var toCsv=require(_0xea70('0x9'));var querystring=require(_0xea70('0xf'));var Papa=require(_0xea70('0x10'));var Redis=require(_0xea70('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xea70('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea70('0x13'))(_0xea70('0x14'));var utils=require(_0xea70('0x15'));var config=require(_0xea70('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xea70('0x17'))['db'];config['redis']=_[_0xea70('0x18')](config[_0xea70('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xea70('0x1a'))(new Redis(config[_0xea70('0x19')]));require(_0xea70('0x1b'))[_0xea70('0x1c')](socket);var jayson=require(_0xea70('0x1d'));var client=jayson['client'][_0xea70('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3d7fd8,_0x27a68d,_0x4f9a06,_0x543d5f){return new BPromise(function(_0x15283a,_0x133c03){var _0x3bb471=_0x543d5f||client;return _0x3bb471[_0xea70('0x1f')](_0x3d7fd8,_0x4f9a06)['then'](function(_0x24163f){logger['info'](_0xea70('0x20'),_0x27a68d,_0xea70('0x21'));logger[_0xea70('0x22')](_0xea70('0x23'),_0x27a68d,'request\x20sent',JSON['stringify'](_0x24163f));if(_0x24163f[_0xea70('0x24')]){if(_0x24163f[_0xea70('0x24')][_0xea70('0x25')]===0x1f4){logger[_0xea70('0x24')](_0xea70('0x20'),_0x27a68d,_0x24163f[_0xea70('0x24')][_0xea70('0x26')]);return _0x133c03(_0x24163f[_0xea70('0x24')][_0xea70('0x26')]);}logger[_0xea70('0x24')](_0xea70('0x20'),_0x27a68d,_0x24163f[_0xea70('0x24')][_0xea70('0x26')]);return _0x15283a(_0x24163f[_0xea70('0x24')][_0xea70('0x26')]);}else{logger[_0xea70('0x27')](_0xea70('0x20'),_0x27a68d,_0xea70('0x21'));_0x15283a(_0x24163f[_0xea70('0x28')][_0xea70('0x26')]);}})['catch'](function(_0x91347a){logger[_0xea70('0x24')](_0xea70('0x20'),_0x27a68d,_0x91347a);_0x133c03(_0x91347a);});});}function respondWithStatusCode(_0x11698c,_0x42b189){_0x42b189=_0x42b189||0xcc;return function(_0xcd5427){if(_0xcd5427){return _0x11698c['sendStatus'](_0x42b189);}return _0x11698c[_0xea70('0x29')](_0x42b189)[_0xea70('0x2a')]();};}function respondWithResult(_0x257fc9,_0xe438aa){_0xe438aa=_0xe438aa||0xc8;return function(_0x4a4378){if(_0x4a4378){return _0x257fc9[_0xea70('0x29')](_0xe438aa)[_0xea70('0x2b')](_0x4a4378);}};}function respondWithFilteredResult(_0x4083d8,_0x3d24ef){return function(_0x215707){if(_0x215707){var _0x3e1b32=typeof _0x3d24ef[_0xea70('0x2c')]===_0xea70('0x2d')&&typeof _0x3d24ef[_0xea70('0x2e')]===_0xea70('0x2d');var _0xe66be8=_0x215707[_0xea70('0x2f')];var _0x9485f2=_0x3e1b32?0x0:_0x3d24ef[_0xea70('0x2c')];var _0x243087=_0x3e1b32?_0x215707[_0xea70('0x2f')]:_0x3d24ef[_0xea70('0x2c')]+_0x3d24ef[_0xea70('0x2e')];var _0x2919d3;if(_0x243087>=_0xe66be8){_0x243087=_0xe66be8;_0x2919d3=0xc8;}else{_0x2919d3=0xce;}_0x4083d8['status'](_0x2919d3);return _0x4083d8[_0xea70('0x30')](_0xea70('0x31'),_0x9485f2+'-'+_0x243087+'/'+_0xe66be8)['json'](_0x215707);}return null;};}function patchUpdates(_0xfe8c66){return function(_0x332a5d){try{jsonpatch[_0xea70('0x32')](_0x332a5d,_0xfe8c66,!![]);}catch(_0x1a951a){return BPromise[_0xea70('0x33')](_0x1a951a);}return _0x332a5d['save']();};}function saveUpdates(_0x3fe6aa,_0x28b304){return function(_0x42618a){if(_0x42618a){return _0x42618a['update'](_0x3fe6aa)[_0xea70('0x34')](function(_0xdd629e){return _0xdd629e;});}return null;};}function removeEntity(_0x37a8b9,_0x579561){return function(_0x130e7b){if(_0x130e7b){return _0x130e7b['destroy']()[_0xea70('0x34')](function(){var _0x3b350f=_0x130e7b[_0xea70('0x35')]({'plain':!![]});var _0x3ba9e9='ChatQueues';return db[_0xea70('0x36')][_0xea70('0x37')]({'where':{'type':_0x3ba9e9,'resourceId':_0x3b350f['id']}})[_0xea70('0x34')](function(){return _0x130e7b;});})[_0xea70('0x34')](function(){_0x37a8b9[_0xea70('0x29')](0xcc)[_0xea70('0x2a')]();});}};}function handleEntityNotFound(_0x2ad6c2,_0x4bd078){return function(_0x59a7ef){if(!_0x59a7ef){_0x2ad6c2[_0xea70('0x38')](0x194);}return _0x59a7ef;};}function handleError(_0x100118,_0x18e87d){_0x18e87d=_0x18e87d||0x1f4;return function(_0x3ad920){logger[_0xea70('0x24')](_0x3ad920[_0xea70('0x39')]);if(_0x3ad920[_0xea70('0x3a')]){delete _0x3ad920[_0xea70('0x3a')];}_0x100118[_0xea70('0x29')](_0x18e87d)[_0xea70('0x3b')](_0x3ad920);};}exports[_0xea70('0x3c')]=function(_0x21eca2,_0x2c589e){var _0x8b4aca={},_0x40b284={},_0x43ad0c={'count':0x0,'rows':[]};var _0x3ca589=_[_0xea70('0x3d')](db[_0xea70('0x3e')]['rawAttributes'],function(_0x290b6c){return{'name':_0x290b6c[_0xea70('0x3f')],'type':_0x290b6c[_0xea70('0x40')][_0xea70('0x41')]};});_0x40b284[_0xea70('0x42')]=_[_0xea70('0x3d')](_0x3ca589,_0xea70('0x3a'));_0x40b284[_0xea70('0x43')]=_[_0xea70('0x44')](_0x21eca2['query']);_0x40b284[_0xea70('0x45')]=_['intersection'](_0x40b284[_0xea70('0x42')],_0x40b284[_0xea70('0x43')]);_0x8b4aca['attributes']=_[_0xea70('0x46')](_0x40b284['model'],qs['fields'](_0x21eca2['query'][_0xea70('0x47')]));_0x8b4aca['attributes']=_0x8b4aca[_0xea70('0x48')]['length']?_0x8b4aca[_0xea70('0x48')]:_0x40b284['model'];if(!_0x21eca2[_0xea70('0x43')][_0xea70('0x49')]('nolimit')){_0x8b4aca[_0xea70('0x2e')]=qs[_0xea70('0x2e')](_0x21eca2[_0xea70('0x43')][_0xea70('0x2e')]);_0x8b4aca[_0xea70('0x2c')]=qs[_0xea70('0x2c')](_0x21eca2[_0xea70('0x43')][_0xea70('0x2c')]);}_0x8b4aca[_0xea70('0x4a')]=qs[_0xea70('0x4b')](_0x21eca2[_0xea70('0x43')][_0xea70('0x4b')]);_0x8b4aca[_0xea70('0x4c')]=qs[_0xea70('0x45')](_[_0xea70('0x4d')](_0x21eca2['query'],_0x40b284['filters']),_0x3ca589);if(_0x21eca2[_0xea70('0x43')][_0xea70('0x4e')]){_0x8b4aca[_0xea70('0x4c')]=_[_0xea70('0x4f')](_0x8b4aca[_0xea70('0x4c')],{'$or':_[_0xea70('0x3d')](_0x3ca589,function(_0x493322){if(_0x493322[_0xea70('0x40')]!=='VIRTUAL'){var _0x3fcf77={};_0x3fcf77[_0x493322[_0xea70('0x3a')]]={'$like':'%'+_0x21eca2[_0xea70('0x43')]['filter']+'%'};return _0x3fcf77;}})});}_0x8b4aca=_['merge']({},_0x8b4aca,_0x21eca2['options']);var _0x46a23b={'where':_0x8b4aca[_0xea70('0x4c')]};return db['ChatQueue']['count'](_0x46a23b)[_0xea70('0x34')](function(_0x283656){_0x43ad0c[_0xea70('0x2f')]=_0x283656;if(_0x21eca2[_0xea70('0x43')][_0xea70('0x50')]){_0x8b4aca[_0xea70('0x51')]=[{'all':!![]}];}return db[_0xea70('0x3e')][_0xea70('0x52')](_0x8b4aca);})[_0xea70('0x34')](function(_0x575cf7){_0x43ad0c[_0xea70('0x53')]=_0x575cf7;return _0x43ad0c;})[_0xea70('0x34')](respondWithFilteredResult(_0x2c589e,_0x8b4aca))[_0xea70('0x54')](handleError(_0x2c589e,null));};exports[_0xea70('0x55')]=function(_0x340038,_0x2aa83f){var _0x5b99ad={'raw':!![],'where':{'id':_0x340038[_0xea70('0x56')]['id']}},_0x186679={};_0x186679[_0xea70('0x42')]=_[_0xea70('0x44')](db['ChatQueue']['rawAttributes']);_0x186679[_0xea70('0x43')]=_[_0xea70('0x44')](_0x340038['query']);_0x186679['filters']=_['intersection'](_0x186679['model'],_0x186679[_0xea70('0x43')]);_0x5b99ad[_0xea70('0x48')]=_['intersection'](_0x186679['model'],qs[_0xea70('0x47')](_0x340038[_0xea70('0x43')]['fields']));_0x5b99ad[_0xea70('0x48')]=_0x5b99ad['attributes'][_0xea70('0x57')]?_0x5b99ad[_0xea70('0x48')]:_0x186679[_0xea70('0x42')];if(_0x340038[_0xea70('0x43')][_0xea70('0x50')]){_0x5b99ad['include']=[{'all':!![]}];}_0x5b99ad=_[_0xea70('0x4f')]({},_0x5b99ad,_0x340038[_0xea70('0x58')]);return db[_0xea70('0x3e')][_0xea70('0x59')](_0x5b99ad)[_0xea70('0x34')](handleEntityNotFound(_0x2aa83f,null))[_0xea70('0x34')](respondWithResult(_0x2aa83f,null))[_0xea70('0x54')](handleError(_0x2aa83f,null));};exports['create']=function(_0x3eba53,_0x14a55a){return db[_0xea70('0x3e')][_0xea70('0x5a')](_0x3eba53['body'],{})['then'](function(_0x27c6cd){var _0x54d0d1=_0x3eba53[_0xea70('0x5b')][_0xea70('0x35')]({'plain':!![]});if(!_0x54d0d1)throw new Error(_0xea70('0x5c'));if(_0x54d0d1[_0xea70('0x5d')]==='user'){var _0x5d415c=_0x27c6cd['get']({'plain':!![]});var _0x1109f0=_0xea70('0x5e');return db[_0xea70('0x5f')]['find']({'where':{'name':_0x1109f0,'userProfileId':_0x54d0d1[_0xea70('0x60')]},'raw':!![]})[_0xea70('0x34')](function(_0x160c33){if(_0x160c33&&_0x160c33[_0xea70('0x61')]===0x0){return db['UserProfileResource'][_0xea70('0x5a')]({'name':_0x5d415c[_0xea70('0x3a')],'resourceId':_0x5d415c['id'],'type':_0x160c33[_0xea70('0x3a')],'sectionId':_0x160c33['id']},{})[_0xea70('0x34')](function(){return _0x27c6cd;});}else{return _0x27c6cd;}})[_0xea70('0x54')](function(_0x29af5e){logger['error'](_0xea70('0x62'),_0x29af5e);throw _0x29af5e;});}return _0x27c6cd;})[_0xea70('0x34')](respondWithResult(_0x14a55a,0xc9))[_0xea70('0x54')](handleError(_0x14a55a,null));};exports[_0xea70('0x63')]=function(_0x56c453,_0x45cbdc){if(_0x56c453[_0xea70('0x64')]['id']){delete _0x56c453[_0xea70('0x64')]['id'];}return db['ChatQueue'][_0xea70('0x59')]({'where':{'id':_0x56c453[_0xea70('0x56')]['id']}})[_0xea70('0x34')](handleEntityNotFound(_0x45cbdc,null))[_0xea70('0x34')](saveUpdates(_0x56c453[_0xea70('0x64')],null))['then'](respondWithResult(_0x45cbdc,null))[_0xea70('0x54')](handleError(_0x45cbdc,null));};exports[_0xea70('0x37')]=function(_0x28aa68,_0x44950f){return db[_0xea70('0x3e')][_0xea70('0x59')]({'where':{'id':_0x28aa68['params']['id']}})[_0xea70('0x34')](handleEntityNotFound(_0x44950f,null))['then'](removeEntity(_0x44950f,null))[_0xea70('0x54')](handleError(_0x44950f,null));};exports[_0xea70('0x65')]=function(_0x40fb63,_0x244f5d){return db[_0xea70('0x3e')]['describe']()[_0xea70('0x34')](respondWithResult(_0x244f5d,null))[_0xea70('0x54')](handleError(_0x244f5d,null));};exports[_0xea70('0x66')]=function(_0x5e3eaf,_0x55e055,_0x351cb2){var _0x3314f9={'raw':!![],'where':{}},_0x1937ea={},_0x2b20a8;return db[_0xea70('0x3e')]['findOne']({'where':{'id':_0x5e3eaf['params']['id']}})[_0xea70('0x34')](handleEntityNotFound(_0x55e055,null))[_0xea70('0x34')](function(_0x5cf62e){if(_0x5cf62e){_0x2b20a8=_0x5cf62e['get']({'plain':!![]});_0x1937ea['model']=_[_0xea70('0x44')](db[_0xea70('0x67')]['rawAttributes']);_0x1937ea['query']=_['keys'](_0x5e3eaf['query']);_0x1937ea[_0xea70('0x45')]=_[_0xea70('0x46')](_0x1937ea[_0xea70('0x42')],_0x1937ea[_0xea70('0x43')]);_0x3314f9[_0xea70('0x48')]=_['intersection'](_0x1937ea[_0xea70('0x42')],qs[_0xea70('0x47')](_0x5e3eaf['query']['fields']));_0x3314f9['attributes']=_0x3314f9[_0xea70('0x48')][_0xea70('0x57')]?_0x3314f9[_0xea70('0x48')]:_0x1937ea[_0xea70('0x42')];if(!_0x5e3eaf[_0xea70('0x43')][_0xea70('0x49')](_0xea70('0x68'))){_0x3314f9[_0xea70('0x2e')]=qs[_0xea70('0x2e')](_0x5e3eaf[_0xea70('0x43')]['limit']);_0x3314f9[_0xea70('0x2c')]=qs[_0xea70('0x2c')](_0x5e3eaf[_0xea70('0x43')][_0xea70('0x2c')]);}_0x3314f9[_0xea70('0x4a')]=qs['sort'](_0x5e3eaf[_0xea70('0x43')][_0xea70('0x4b')]);_0x3314f9[_0xea70('0x4c')]=qs[_0xea70('0x45')](_['pick'](_0x5e3eaf['query'],_0x1937ea['filters']));_0x3314f9[_0xea70('0x4c')][_0xea70('0x69')]=_0x5cf62e['id'];if(_0x5e3eaf[_0xea70('0x43')][_0xea70('0x4e')]){_0x3314f9[_0xea70('0x4c')]=_['merge'](_0x3314f9[_0xea70('0x4c')],{'$or':_['map'](_0x3314f9[_0xea70('0x48')],function(_0x2a7c51){var _0x230c2a={};_0x230c2a[_0x2a7c51]={'$like':'%'+_0x5e3eaf[_0xea70('0x43')]['filter']+'%'};return _0x230c2a;})});}_0x3314f9=_['merge']({},_0x3314f9,_0x5e3eaf[_0xea70('0x58')]);return db[_0xea70('0x67')][_0xea70('0x52')](_0x3314f9);}})[_0xea70('0x34')](function(_0x2f4d56){if(_0x2f4d56){return db[_0xea70('0x6a')][_0xea70('0x6b')]({'where':{'id':_[_0xea70('0x3d')](_0x2f4d56,_0xea70('0x6c')),'role':'agent'},'attributes':['id',_0xea70('0x3a'),_0xea70('0x6d'),_0xea70('0x6e'),'createdAt']});}})[_0xea70('0x34')](function(_0x41c9d4){if(_0x41c9d4){return{'count':_0x41c9d4['count'],'rows':_[_0xea70('0x3d')](_0x41c9d4[_0xea70('0x53')],function(_0x3245e4){return{'membername':_0x3245e4[_0xea70('0x3a')],'UserId':_0x3245e4['id'],'queue_name':_0x2b20a8[_0xea70('0x3a')],'ChatQueueId':_0x2b20a8['id'],'interface':util[_0xea70('0x6f')](_0xea70('0x70'),_0xea70('0x71'),_0x3245e4['name']),'penalty':0x0,'paused':_0x3245e4[_0xea70('0x6d')],'createdAt':_0x3245e4[_0xea70('0x72')],'updatedAt':_0x3245e4[_0xea70('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xea70('0x34')](respondWithFilteredResult(_0x55e055,_0x3314f9))[_0xea70('0x54')](handleError(_0x55e055,null));};exports[_0xea70('0x73')]=function(_0x4b3975,_0x377704,_0x1762d1){var _0x120b59={};var _0x3537c6={};var _0x3cea6d;var _0x3623d4;return db[_0xea70('0x3e')]['findOne']({'where':{'id':_0x4b3975['params']['id']}})[_0xea70('0x34')](handleEntityNotFound(_0x377704,null))[_0xea70('0x34')](function(_0x1af8fd){if(_0x1af8fd){_0x3cea6d=_0x1af8fd;_0x3537c6['model']=_[_0xea70('0x44')](db[_0xea70('0x74')]['rawAttributes']);_0x3537c6[_0xea70('0x43')]=_[_0xea70('0x44')](_0x4b3975[_0xea70('0x43')]);_0x3537c6[_0xea70('0x45')]=_[_0xea70('0x46')](_0x3537c6[_0xea70('0x42')],_0x3537c6[_0xea70('0x43')]);_0x120b59[_0xea70('0x48')]=_[_0xea70('0x46')](_0x3537c6['model'],qs[_0xea70('0x47')](_0x4b3975['query'][_0xea70('0x47')]));_0x120b59[_0xea70('0x48')]=_0x120b59[_0xea70('0x48')][_0xea70('0x57')]?_0x120b59[_0xea70('0x48')]:_0x3537c6['model'];_0x120b59['order']=qs[_0xea70('0x4b')](_0x4b3975[_0xea70('0x43')][_0xea70('0x4b')]);_0x120b59['where']=qs[_0xea70('0x45')](_['pick'](_0x4b3975[_0xea70('0x43')],_0x3537c6[_0xea70('0x45')]));if(_0x4b3975['query'][_0xea70('0x4e')]){_0x120b59[_0xea70('0x4c')]=_[_0xea70('0x4f')](_0x120b59[_0xea70('0x4c')],{'$or':_[_0xea70('0x3d')](_0x120b59['attributes'],function(_0x38a7dd){var _0x29e914={};_0x29e914[_0x38a7dd]={'$like':'%'+_0x4b3975['query'][_0xea70('0x4e')]+'%'};return _0x29e914;})});}_0x120b59=_[_0xea70('0x4f')]({},_0x120b59,_0x4b3975[_0xea70('0x58')]);return _0x3cea6d['getTeams'](_0x120b59);}})[_0xea70('0x34')](function(_0x33e60d){if(_0x33e60d){_0x3623d4=_0x33e60d[_0xea70('0x57')];if(!_0x4b3975[_0xea70('0x43')][_0xea70('0x49')](_0xea70('0x68'))){_0x120b59['limit']=qs[_0xea70('0x2e')](_0x4b3975['query'][_0xea70('0x2e')]);_0x120b59['offset']=qs['offset'](_0x4b3975['query'][_0xea70('0x2c')]);}return _0x3cea6d['getTeams'](_0x120b59);}})['then'](function(_0x4ed4b6){if(_0x4ed4b6){return _0x4ed4b6?{'count':_0x3623d4,'rows':_0x4ed4b6}:null;}})[_0xea70('0x34')](respondWithResult(_0x377704,null))[_0xea70('0x54')](handleError(_0x377704,null));};exports[_0xea70('0x75')]=function(_0x2e29c6,_0x5155bd,_0x25c817){var _0xe597a9=_0x2e29c6[_0xea70('0x64')][_0xea70('0x76')];return db[_0xea70('0x74')][_0xea70('0x52')]({'where':{'id':_0xe597a9},'attributes':['id'],'include':[{'model':db[_0xea70('0x6a')],'as':_0xea70('0x77'),'attributes':['id','name',_0xea70('0x78'),'voicePause',_0xea70('0x79')],'raw':!![]}]})[_0xea70('0x34')](function(_0x1095e8){if(_0x1095e8){var _0x52391f=_[_0xea70('0x7a')](_0x1095e8,function(_0x47d1d9){var _0x3b6428=_0x47d1d9[_0xea70('0x35')]({'plain':!![]});return _0x3b6428[_0xea70('0x77')];});return db[_0xea70('0x3e')][_0xea70('0x59')]({'where':{'id':_0x2e29c6[_0xea70('0x56')]['id']}})['then'](function(_0x210302){return db['sequelize'][_0xea70('0x7b')](function(_0x5eb32d){return _0x210302[_0xea70('0x75')](_0xe597a9,{'transaction':_0x5eb32d})[_0xea70('0x34')](function(){return BPromise[_0xea70('0x7c')](_0x52391f,function(_0x1346d8){return db['UserChatQueue'][_0xea70('0x7d')]({'where':{'UserId':_0x1346d8['id'],'ChatQueueId':_0x2e29c6[_0xea70('0x56')]['id']},'transaction':_0x5eb32d});});})[_0xea70('0x34')](function(){_0x52391f[_0xea70('0x7e')](function(_0x55ba65){socket['emit']('userChatQueue:save',{'UserId':_0x55ba65['id'],'ChatQueueId':_0x210302['id']});});});});});}})[_0xea70('0x34')](respondWithStatusCode(_0x5155bd,null))[_0xea70('0x54')](handleError(_0x5155bd,null));};exports['removeTeams']=function(_0x29cf95,_0x59ecb1,_0xcd3ac9){return db['Team'][_0xea70('0x52')]({'where':{'id':_0x29cf95[_0xea70('0x43')][_0xea70('0x76')]},'attributes':['id'],'include':[{'model':db[_0xea70('0x6a')],'as':_0xea70('0x77'),'attributes':['id'],'raw':!![]}]})[_0xea70('0x34')](handleEntityNotFound(_0x59ecb1,null))[_0xea70('0x34')](function(_0x79428d){var _0x3658eb=_['map'](_0x79428d,'id');var _0xb1401e=[];var _0x197087=[];var _0x365921=squel['select']();_0x365921[_0xea70('0x7f')](_0xea70('0x80'))[_0xea70('0x81')](_0xea70('0x82'),'tq')['join'](_0xea70('0x83'),'ut',_0xea70('0x84'))[_0xea70('0x4c')]('ChatQueueId\x20=\x20?',_0x29cf95['params']['id']);for(var _0x12d150=0x0;_0x12d150<_0x79428d[_0xea70('0x57')];_0x12d150+=0x1){let _0x22cc62=_0x79428d[_0x12d150];for(var _0x234523=0x0;_0x234523<_0x22cc62[_0xea70('0x77')][_0xea70('0x57')];_0x234523+=0x1){let _0x144a28=_0x22cc62[_0xea70('0x77')][_0x234523];var _0x1a6380=_0x365921[_0xea70('0x85')]();_0x1a6380[_0xea70('0x4c')](_0xea70('0x86'),_0x144a28['id']);_0x197087[_0xea70('0x87')](db[_0xea70('0x88')][_0xea70('0x43')](_0x1a6380[_0xea70('0x89')](),{'type':db[_0xea70('0x88')]['QueryTypes'][_0xea70('0x8a')]})['then'](function(_0x153fcf){if(_0x153fcf[_0xea70('0x57')]===0x1){return _0x144a28['id'];}else{var _0x20d780=_[_0xea70('0x8b')](_['map'](_0x153fcf,_0xea70('0x8c')),function(_0x455799){return _[_0xea70('0x8d')](_0x3658eb,_0x455799);});if(_0x20d780){return _0x144a28['id'];}}}));}}return BPromise[_0xea70('0x8e')](_0x197087)[_0xea70('0x34')](function(_0x5f4d47){_0xb1401e=_(_0xb1401e)['union'](_0x5f4d47)[_0xea70('0x8f')]()[_0xea70('0x90')]();return db[_0xea70('0x3e')][_0xea70('0x59')]({'where':{'id':_0x29cf95[_0xea70('0x56')]['id']}})[_0xea70('0x34')](function(_0x5a96bb){return db[_0xea70('0x88')][_0xea70('0x7b')](function(_0x5c5fc2){return _0x5a96bb[_0xea70('0x91')](_0x29cf95[_0xea70('0x43')][_0xea70('0x76')],{'transaction':_0x5c5fc2})['then'](function(){if(!_['isEmpty'](_0xb1401e)){return _0x5a96bb[_0xea70('0x92')](_0xb1401e,{'transaction':_0x5c5fc2});}})[_0xea70('0x34')](function(){_0xb1401e[_0xea70('0x7e')](function(_0x41f9f6){socket['emit'](_0xea70('0x93'),{'UserId':_0x41f9f6,'ChatQueueId':_0x5a96bb['id']});});});});});});})[_0xea70('0x34')](respondWithStatusCode(_0x59ecb1,null))[_0xea70('0x54')](handleError(_0x59ecb1,null));};exports['addAgents']=function(_0x208198,_0x23633e,_0x24c266){return db[_0xea70('0x3e')][_0xea70('0x59')]({'where':{'id':_0x208198[_0xea70('0x56')]['id']}})[_0xea70('0x34')](handleEntityNotFound(_0x23633e,null))['then'](function(_0x30fd95){if(_0x30fd95){return _0x30fd95[_0xea70('0x94')](_0x208198[_0xea70('0x64')][_0xea70('0x76')],_[_0xea70('0x95')](_0x208198[_0xea70('0x64')],[_0xea70('0x76'),'id'])||{})[_0xea70('0x96')](function(_0x419f8c){for(var _0x2e5651=0x0;_0x2e5651<_0x208198[_0xea70('0x64')][_0xea70('0x76')]['length'];_0x2e5651+=0x1){socket['emit'](_0xea70('0x97'),{'UserId':Number(_0x208198[_0xea70('0x64')][_0xea70('0x76')][_0x2e5651]),'ChatQueueId':Number(_0x208198[_0xea70('0x56')]['id'])});}return _0x419f8c;});}})[_0xea70('0x34')](respondWithResult(_0x23633e,null))[_0xea70('0x54')](handleError(_0x23633e,null));};exports[_0xea70('0x92')]=function(_0x41c732,_0x226d66,_0x2fa9de){return db[_0xea70('0x3e')][_0xea70('0x59')]({'where':{'id':_0x41c732[_0xea70('0x56')]['id']}})['then'](handleEntityNotFound(_0x226d66,null))[_0xea70('0x34')](function(_0x6955db){if(_0x6955db){return _0x6955db[_0xea70('0x92')](_0x41c732[_0xea70('0x43')][_0xea70('0x76')])[_0xea70('0x34')](function(){if(_[_0xea70('0x98')](_0x41c732['query'][_0xea70('0x76')])){for(var _0x9552a5=0x0;_0x9552a5<_0x41c732[_0xea70('0x43')][_0xea70('0x76')][_0xea70('0x57')];_0x9552a5+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x41c732[_0xea70('0x43')][_0xea70('0x76')][_0x9552a5]),'ChatQueueId':Number(_0x41c732[_0xea70('0x56')]['id'])});}}else{socket[_0xea70('0x99')]('userChatQueue:remove',{'UserId':Number(_0x41c732['query'][_0xea70('0x76')]),'ChatQueueId':Number(_0x41c732[_0xea70('0x56')]['id'])});}});}})[_0xea70('0x34')](respondWithStatusCode(_0x226d66,null))[_0xea70('0x54')](handleError(_0x226d66,null));};exports[_0xea70('0x9a')]=function(_0x2fc519,_0x345db7,_0x5d5315){var _0x19623f={};var _0xe4905b={};var _0x524d37;var _0x5799f4;return db[_0xea70('0x3e')]['findOne']({'where':{'id':_0x2fc519[_0xea70('0x56')]['id']}})[_0xea70('0x34')](handleEntityNotFound(_0x345db7,null))[_0xea70('0x34')](function(_0x1eff33){if(_0x1eff33){_0x524d37=_0x1eff33;_0xe4905b['model']=_['keys'](db[_0xea70('0x6a')][_0xea70('0x9b')]);_0xe4905b[_0xea70('0x43')]=_[_0xea70('0x44')](_0x2fc519['query']);_0xe4905b[_0xea70('0x45')]=_[_0xea70('0x46')](_0xe4905b[_0xea70('0x42')],_0xe4905b['query']);_0x19623f[_0xea70('0x48')]=_[_0xea70('0x46')](_0xe4905b[_0xea70('0x42')],qs[_0xea70('0x47')](_0x2fc519['query'][_0xea70('0x47')]));_0x19623f[_0xea70('0x48')]=_0x19623f['attributes']['length']?_0x19623f['attributes']:_0xe4905b[_0xea70('0x42')];_0x19623f[_0xea70('0x4a')]=qs[_0xea70('0x4b')](_0x2fc519[_0xea70('0x43')][_0xea70('0x4b')]);_0x19623f[_0xea70('0x4c')]=qs[_0xea70('0x45')](_['pick'](_0x2fc519[_0xea70('0x43')],_0xe4905b[_0xea70('0x45')]));if(_0x2fc519['query']['filter']){_0x19623f[_0xea70('0x4c')]=_['merge'](_0x19623f[_0xea70('0x4c')],{'$or':_[_0xea70('0x3d')](_0x19623f[_0xea70('0x48')],function(_0x13241c){var _0x18d461={};_0x18d461[_0x13241c]={'$like':'%'+_0x2fc519[_0xea70('0x43')]['filter']+'%'};return _0x18d461;})});}_0x19623f=_['merge']({},_0x19623f,_0x2fc519['options']);return _0x524d37[_0xea70('0x9a')](_0x19623f);}})[_0xea70('0x34')](function(_0x575be3){if(_0x575be3){_0x5799f4=_0x575be3[_0xea70('0x57')];if(!_0x2fc519[_0xea70('0x43')][_0xea70('0x49')](_0xea70('0x68'))){_0x19623f[_0xea70('0x2e')]=qs[_0xea70('0x2e')](_0x2fc519['query'][_0xea70('0x2e')]);_0x19623f[_0xea70('0x2c')]=qs[_0xea70('0x2c')](_0x2fc519[_0xea70('0x43')]['offset']);}return _0x524d37[_0xea70('0x9a')](_0x19623f);}})[_0xea70('0x34')](function(_0x367786){if(_0x367786){return _0x367786?{'count':_0x5799f4,'rows':_0x367786}:null;}})['then'](respondWithResult(_0x345db7,null))[_0xea70('0x54')](handleError(_0x345db7,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index e79c28b..c2eac07 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 _0x4283=['setMaxListeners','save','remove','hasOwnProperty','hook','events'];(function(_0x14866a,_0x127ada){var _0x40b973=function(_0x34bad3){while(--_0x34bad3){_0x14866a['push'](_0x14866a['shift']());}};_0x40b973(++_0x127ada);}(_0x4283,0x119));var _0x3428=function(_0x16806e,_0x4d52c4){_0x16806e=_0x16806e-0x0;var _0x553909=_0x4283[_0x16806e];return _0x553909;};'use strict';var EventEmitter=require(_0x3428('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x3428('0x1')](0x0);var events={'afterCreate':_0x3428('0x2'),'afterUpdate':'update','afterDestroy':_0x3428('0x3')};function emitEvent(_0x19fe15){return function(_0xa7f10e,_0x5eceda,_0x445574){ChatQueueEvents['emit'](_0x19fe15+':'+_0xa7f10e['id'],_0xa7f10e);ChatQueueEvents['emit'](_0x19fe15,_0xa7f10e);_0x445574(null);};}for(var e in events){if(events[_0x3428('0x4')](e)){var event=events[e];ChatQueue[_0x3428('0x5')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x32c3=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x288949,_0x54a8c2){var _0x4e4953=function(_0x25b1c0){while(--_0x25b1c0){_0x288949['push'](_0x288949['shift']());}};_0x4e4953(++_0x54a8c2);}(_0x32c3,0xfb));var _0x332c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x32c3[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x332c('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x332c('0x1')](0x0);var events={'afterCreate':_0x332c('0x2'),'afterUpdate':_0x332c('0x3'),'afterDestroy':_0x332c('0x4')};function emitEvent(_0x135bd0){return function(_0x3c2159,_0x5f36bf,_0x300afd){ChatQueueEvents[_0x332c('0x5')](_0x135bd0+':'+_0x3c2159['id'],_0x3c2159);ChatQueueEvents['emit'](_0x135bd0,_0x3c2159);_0x300afd(null);};}for(var e in events){if(events[_0x332c('0x6')](e)){var event=events[e];ChatQueue[_0x332c('0x7')](e,emitEvent(event));}}module[_0x332c('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 6aabe75..ea2a3da 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 _0x9258=['ChatQueue','chat_queues','lodash','util','../../config/logger','bluebird','path','../../config/environment','./chatQueue.attributes','exports'];(function(_0x478618,_0x484e97){var _0x3e1d5a=function(_0x5ceaed){while(--_0x5ceaed){_0x478618['push'](_0x478618['shift']());}};_0x3e1d5a(++_0x484e97);}(_0x9258,0xc0));var _0x8925=function(_0x44bcca,_0x494157){_0x44bcca=_0x44bcca-0x0;var _0x1becb6=_0x9258[_0x44bcca];return _0x1becb6;};'use strict';var _=require(_0x8925('0x0'));var util=require(_0x8925('0x1'));var logger=require(_0x8925('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8925('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8925('0x4'));var rimraf=require('rimraf');var config=require(_0x8925('0x5'));var attributes=require(_0x8925('0x6'));module[_0x8925('0x7')]=function(_0x1ce2f0,_0x17d797){return _0x1ce2f0['define'](_0x8925('0x8'),attributes,{'tableName':_0x8925('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x11bd=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','lodash','util'];(function(_0x3914e6,_0x1147ab){var _0x313082=function(_0x38acc6){while(--_0x38acc6){_0x3914e6['push'](_0x3914e6['shift']());}};_0x313082(++_0x1147ab);}(_0x11bd,0x1d2));var _0xd11b=function(_0x2afde7,_0x3ef21d){_0x2afde7=_0x2afde7-0x0;var _0x45fd31=_0x11bd[_0x2afde7];return _0x45fd31;};'use strict';var _=require(_0xd11b('0x0'));var util=require(_0xd11b('0x1'));var logger=require(_0xd11b('0x2'))(_0xd11b('0x3'));var moment=require(_0xd11b('0x4'));var BPromise=require(_0xd11b('0x5'));var rp=require(_0xd11b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd11b('0x7'));var config=require(_0xd11b('0x8'));var attributes=require(_0xd11b('0x9'));module[_0xd11b('0xa')]=function(_0x1b76f8,_0x389516){return _0x1b76f8[_0xd11b('0xb')](_0xd11b('0xc'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 108b173..9608854 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 _0x8ff4=['include','map','model','attributes','ShowChatQueue','find','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetChatQueue','ChatQueue','options','raw','where'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x8ff4,0x11f));var _0x48ff=function(_0x2786ea,_0x16c3c3){_0x2786ea=_0x2786ea-0x0;var _0x5c38e5=_0x8ff4[_0x2786ea];return _0x5c38e5;};'use strict';var _=require(_0x48ff('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x48ff('0x1'));var rs=require(_0x48ff('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x48ff('0x3'))['db'];var utils=require(_0x48ff('0x4'));var logger=require(_0x48ff('0x5'))(_0x48ff('0x6'));var config=require(_0x48ff('0x7'));var jayson=require(_0x48ff('0x8'));var client=jayson[_0x48ff('0x9')][_0x48ff('0xa')]({'port':0x232a});config[_0x48ff('0xb')]=_[_0x48ff('0xc')](config[_0x48ff('0xb')],{'host':_0x48ff('0xd'),'port':0x18eb});var socket=require(_0x48ff('0xe'))(new Redis(config[_0x48ff('0xb')]));require('./chatQueue.socket')[_0x48ff('0xf')](socket);function respondWithRpcPromise(_0x312c3f,_0x5eb71f,_0x37027d){return new BPromise(function(_0x140a23,_0x5754e1){return client[_0x48ff('0x10')](_0x312c3f,_0x37027d)[_0x48ff('0x11')](function(_0x5a3f0a){logger[_0x48ff('0x12')](_0x48ff('0x13'),_0x5eb71f,_0x48ff('0x14'));logger[_0x48ff('0x15')](_0x48ff('0x16'),_0x5eb71f,_0x48ff('0x14'),JSON[_0x48ff('0x17')](_0x5a3f0a));if(_0x5a3f0a[_0x48ff('0x18')]){if(_0x5a3f0a[_0x48ff('0x18')][_0x48ff('0x19')]===0x1f4){logger[_0x48ff('0x18')](_0x48ff('0x13'),_0x5eb71f,_0x5a3f0a[_0x48ff('0x18')][_0x48ff('0x1a')]);return _0x5754e1(_0x5a3f0a['error'][_0x48ff('0x1a')]);}logger[_0x48ff('0x18')]('ChatQueue,\x20%s,\x20%s',_0x5eb71f,_0x5a3f0a[_0x48ff('0x18')][_0x48ff('0x1a')]);return _0x140a23(_0x5a3f0a[_0x48ff('0x18')]['message']);}else{logger[_0x48ff('0x12')](_0x48ff('0x13'),_0x5eb71f,'request\x20sent');_0x140a23(_0x5a3f0a[_0x48ff('0x1b')][_0x48ff('0x1a')]);}})['catch'](function(_0x24d4fb){logger[_0x48ff('0x18')]('ChatQueue,\x20%s,\x20%s',_0x5eb71f,_0x24d4fb);_0x5754e1(_0x24d4fb);});});}exports[_0x48ff('0x1c')]=function(_0x1a4111){var _0x2fe32f=this;return new Promise(function(_0x55bc40,_0x57c773){return db[_0x48ff('0x1d')]['findAll']({'raw':_0x1a4111[_0x48ff('0x1e')]?_0x1a4111[_0x48ff('0x1e')][_0x48ff('0x1f')]===undefined?!![]:![]:!![],'where':_0x1a4111[_0x48ff('0x1e')]?_0x1a4111[_0x48ff('0x1e')][_0x48ff('0x20')]||null:null,'attributes':_0x1a4111[_0x48ff('0x1e')]?_0x1a4111[_0x48ff('0x1e')]['attributes']||null:null,'limit':_0x1a4111[_0x48ff('0x1e')]?_0x1a4111[_0x48ff('0x1e')]['limit']||null:null,'include':_0x1a4111[_0x48ff('0x1e')]?_0x1a4111[_0x48ff('0x1e')][_0x48ff('0x21')]?_[_0x48ff('0x22')](_0x1a4111[_0x48ff('0x1e')][_0x48ff('0x21')],function(_0x4ff1b7){return{'model':db[_0x4ff1b7[_0x48ff('0x23')]],'as':_0x4ff1b7['as'],'attributes':_0x4ff1b7[_0x48ff('0x24')],'include':_0x4ff1b7['include']?_[_0x48ff('0x22')](_0x4ff1b7[_0x48ff('0x21')],function(_0x39088f){return{'model':db[_0x39088f[_0x48ff('0x23')]],'as':_0x39088f['as'],'attributes':_0x39088f[_0x48ff('0x24')],'include':_0x39088f[_0x48ff('0x21')]?_[_0x48ff('0x22')](_0x39088f[_0x48ff('0x21')],function(_0x2b92ad){return{'model':db[_0x2b92ad[_0x48ff('0x23')]],'as':_0x2b92ad['as'],'attributes':_0x2b92ad[_0x48ff('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34def7){logger[_0x48ff('0x12')](_0x48ff('0x1c'),_0x1a4111);logger[_0x48ff('0x15')]('GetChatQueue',_0x1a4111,JSON[_0x48ff('0x17')](_0x34def7));_0x55bc40(_0x34def7);})['catch'](function(_0x2c9185){logger['error'](_0x48ff('0x1c'),_0x2c9185[_0x48ff('0x1a')],_0x1a4111);_0x57c773(_0x2fe32f[_0x48ff('0x18')](0x1f4,_0x2c9185[_0x48ff('0x1a')]));});});};exports[_0x48ff('0x25')]=function(_0x182289){var _0x536eb4=this;return new Promise(function(_0x31f896,_0x6fa03c){return db[_0x48ff('0x1d')][_0x48ff('0x26')]({'raw':_0x182289[_0x48ff('0x1e')]?_0x182289[_0x48ff('0x1e')][_0x48ff('0x1f')]===undefined?!![]:![]:!![],'where':_0x182289['options']?_0x182289[_0x48ff('0x1e')][_0x48ff('0x20')]||null:null,'attributes':_0x182289['options']?_0x182289[_0x48ff('0x1e')][_0x48ff('0x24')]||null:null,'include':_0x182289[_0x48ff('0x1e')]?_0x182289[_0x48ff('0x1e')][_0x48ff('0x21')]?_[_0x48ff('0x22')](_0x182289[_0x48ff('0x1e')][_0x48ff('0x21')],function(_0x36100d){return{'model':db[_0x36100d[_0x48ff('0x23')]],'as':_0x36100d['as'],'attributes':_0x36100d[_0x48ff('0x24')],'include':_0x36100d[_0x48ff('0x21')]?_[_0x48ff('0x22')](_0x36100d[_0x48ff('0x21')],function(_0x58955d){return{'model':db[_0x58955d[_0x48ff('0x23')]],'as':_0x58955d['as'],'attributes':_0x58955d[_0x48ff('0x24')],'include':_0x58955d[_0x48ff('0x21')]?_[_0x48ff('0x22')](_0x58955d['include'],function(_0x5c277d){return{'model':db[_0x5c277d[_0x48ff('0x23')]],'as':_0x5c277d['as'],'attributes':_0x5c277d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x907224){logger[_0x48ff('0x12')](_0x48ff('0x25'),_0x182289);logger[_0x48ff('0x15')]('ShowChatQueue',_0x182289,JSON[_0x48ff('0x17')](_0x907224));_0x31f896(_0x907224);})[_0x48ff('0x27')](function(_0x5a66c4){logger[_0x48ff('0x18')](_0x48ff('0x25'),_0x5a66c4['message'],_0x182289);_0x6fa03c(_0x536eb4[_0x48ff('0x18')](0x1f4,_0x5a66c4['message']));});});};
\ No newline at end of file
+var _0x8cce=['jayson/promise','client','redis','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetChatQueue','ChatQueue','options','where','attributes','limit','include','map','model','debug','stringify','catch','ShowChatQueue','find','raw','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0x8cce,0xd6));var _0xe8cc=function(_0x4fdcf7,_0x5735b0){_0x4fdcf7=_0x4fdcf7-0x0;var _0x1a69ab=_0x8cce[_0x4fdcf7];return _0x1a69ab;};'use strict';var _=require('lodash');var util=require(_0xe8cc('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe8cc('0x1'));var fs=require('fs');var Redis=require(_0xe8cc('0x2'));var db=require(_0xe8cc('0x3'))['db'];var utils=require(_0xe8cc('0x4'));var logger=require(_0xe8cc('0x5'))(_0xe8cc('0x6'));var config=require(_0xe8cc('0x7'));var jayson=require(_0xe8cc('0x8'));var client=jayson[_0xe8cc('0x9')]['http']({'port':0x232a});config[_0xe8cc('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe8cc('0xb'))(new Redis(config[_0xe8cc('0xa')]));require('./chatQueue.socket')[_0xe8cc('0xc')](socket);function respondWithRpcPromise(_0x4c211b,_0x22ca98,_0x401515){return new BPromise(function(_0xcbf3ec,_0x826385){return client[_0xe8cc('0xd')](_0x4c211b,_0x401515)[_0xe8cc('0xe')](function(_0x4d499c){logger[_0xe8cc('0xf')](_0xe8cc('0x10'),_0x22ca98,'request\x20sent');logger['debug'](_0xe8cc('0x11'),_0x22ca98,'request\x20sent',JSON['stringify'](_0x4d499c));if(_0x4d499c[_0xe8cc('0x12')]){if(_0x4d499c['error'][_0xe8cc('0x13')]===0x1f4){logger[_0xe8cc('0x12')](_0xe8cc('0x10'),_0x22ca98,_0x4d499c['error'][_0xe8cc('0x14')]);return _0x826385(_0x4d499c[_0xe8cc('0x12')][_0xe8cc('0x14')]);}logger[_0xe8cc('0x12')](_0xe8cc('0x10'),_0x22ca98,_0x4d499c[_0xe8cc('0x12')][_0xe8cc('0x14')]);return _0xcbf3ec(_0x4d499c[_0xe8cc('0x12')][_0xe8cc('0x14')]);}else{logger[_0xe8cc('0xf')]('ChatQueue,\x20%s,\x20%s',_0x22ca98,'request\x20sent');_0xcbf3ec(_0x4d499c[_0xe8cc('0x15')][_0xe8cc('0x14')]);}})['catch'](function(_0x53014b){logger[_0xe8cc('0x12')](_0xe8cc('0x10'),_0x22ca98,_0x53014b);_0x826385(_0x53014b);});});}exports[_0xe8cc('0x16')]=function(_0x403f91){var _0xbafd99=this;return new Promise(function(_0x21e933,_0x445f4f){return db[_0xe8cc('0x17')]['findAll']({'raw':_0x403f91['options']?_0x403f91[_0xe8cc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x403f91['options']?_0x403f91[_0xe8cc('0x18')][_0xe8cc('0x19')]||null:null,'attributes':_0x403f91[_0xe8cc('0x18')]?_0x403f91['options'][_0xe8cc('0x1a')]||null:null,'limit':_0x403f91[_0xe8cc('0x18')]?_0x403f91[_0xe8cc('0x18')][_0xe8cc('0x1b')]||null:null,'include':_0x403f91[_0xe8cc('0x18')]?_0x403f91[_0xe8cc('0x18')][_0xe8cc('0x1c')]?_[_0xe8cc('0x1d')](_0x403f91['options'][_0xe8cc('0x1c')],function(_0x34d6e0){return{'model':db[_0x34d6e0[_0xe8cc('0x1e')]],'as':_0x34d6e0['as'],'attributes':_0x34d6e0[_0xe8cc('0x1a')],'include':_0x34d6e0[_0xe8cc('0x1c')]?_[_0xe8cc('0x1d')](_0x34d6e0[_0xe8cc('0x1c')],function(_0x2c5fb2){return{'model':db[_0x2c5fb2[_0xe8cc('0x1e')]],'as':_0x2c5fb2['as'],'attributes':_0x2c5fb2[_0xe8cc('0x1a')],'include':_0x2c5fb2[_0xe8cc('0x1c')]?_[_0xe8cc('0x1d')](_0x2c5fb2[_0xe8cc('0x1c')],function(_0x35029c){return{'model':db[_0x35029c['model']],'as':_0x35029c['as'],'attributes':_0x35029c[_0xe8cc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe8cc('0xe')](function(_0x4bed04){logger[_0xe8cc('0xf')](_0xe8cc('0x16'),_0x403f91);logger[_0xe8cc('0x1f')](_0xe8cc('0x16'),_0x403f91,JSON[_0xe8cc('0x20')](_0x4bed04));_0x21e933(_0x4bed04);})[_0xe8cc('0x21')](function(_0xdc9b1b){logger[_0xe8cc('0x12')](_0xe8cc('0x16'),_0xdc9b1b['message'],_0x403f91);_0x445f4f(_0xbafd99[_0xe8cc('0x12')](0x1f4,_0xdc9b1b[_0xe8cc('0x14')]));});});};exports[_0xe8cc('0x22')]=function(_0x5f6a3c){var _0x1518ce=this;return new Promise(function(_0x5048a7,_0x17405d){return db[_0xe8cc('0x17')][_0xe8cc('0x23')]({'raw':_0x5f6a3c[_0xe8cc('0x18')]?_0x5f6a3c[_0xe8cc('0x18')][_0xe8cc('0x24')]===undefined?!![]:![]:!![],'where':_0x5f6a3c['options']?_0x5f6a3c['options']['where']||null:null,'attributes':_0x5f6a3c['options']?_0x5f6a3c[_0xe8cc('0x18')][_0xe8cc('0x1a')]||null:null,'include':_0x5f6a3c[_0xe8cc('0x18')]?_0x5f6a3c['options'][_0xe8cc('0x1c')]?_[_0xe8cc('0x1d')](_0x5f6a3c[_0xe8cc('0x18')][_0xe8cc('0x1c')],function(_0x550d9a){return{'model':db[_0x550d9a[_0xe8cc('0x1e')]],'as':_0x550d9a['as'],'attributes':_0x550d9a['attributes'],'include':_0x550d9a[_0xe8cc('0x1c')]?_[_0xe8cc('0x1d')](_0x550d9a['include'],function(_0x1dcf5b){return{'model':db[_0x1dcf5b[_0xe8cc('0x1e')]],'as':_0x1dcf5b['as'],'attributes':_0x1dcf5b[_0xe8cc('0x1a')],'include':_0x1dcf5b['include']?_[_0xe8cc('0x1d')](_0x1dcf5b[_0xe8cc('0x1c')],function(_0x531555){return{'model':db[_0x531555[_0xe8cc('0x1e')]],'as':_0x531555['as'],'attributes':_0x531555[_0xe8cc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe8cc('0xe')](function(_0x286685){logger[_0xe8cc('0xf')](_0xe8cc('0x22'),_0x5f6a3c);logger[_0xe8cc('0x1f')](_0xe8cc('0x22'),_0x5f6a3c,JSON[_0xe8cc('0x20')](_0x286685));_0x5048a7(_0x286685);})[_0xe8cc('0x21')](function(_0x2e6e13){logger[_0xe8cc('0x12')](_0xe8cc('0x22'),_0x2e6e13[_0xe8cc('0x14')],_0x5f6a3c);_0x17405d(_0x1518ce[_0xe8cc('0x12')](0x1f4,_0x2e6e13['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 321d97d..794e646 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 _0xed1f=['register','length','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xed1f,0x6a));var _0xfed1=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0xed1f[_0x556927];return _0x5f1235;};'use strict';var ChatQueueEvents=require(_0xfed1('0x0'));var events=[_0xfed1('0x1'),_0xfed1('0x2'),_0xfed1('0x3')];function createListener(_0xa45937,_0x25f345){return function(_0x1dd614){_0x25f345[_0xfed1('0x4')](_0xa45937,_0x1dd614);};}function removeListener(_0x2209b3,_0x45c3c1){return function(){ChatQueueEvents[_0xfed1('0x5')](_0x2209b3,_0x45c3c1);};}exports[_0xfed1('0x6')]=function(_0x3d6706){for(var _0x42751d=0x0,_0x380e18=events[_0xfed1('0x7')];_0x42751d<_0x380e18;_0x42751d++){var _0x2a6082=events[_0x42751d];var _0x2967ef=createListener('chatQueue:'+_0x2a6082,_0x3d6706);ChatQueueEvents['on'](_0x2a6082,_0x2967ef);}};
\ No newline at end of file
+var _0x29d4=['removeListener','register','length','./chatQueue.events','remove','update'];(function(_0x2303b0,_0xe92fed){var _0x5afab4=function(_0x4dbdc6){while(--_0x4dbdc6){_0x2303b0['push'](_0x2303b0['shift']());}};_0x5afab4(++_0xe92fed);}(_0x29d4,0x1a1));var _0x429d=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x29d4[_0x56482c];return _0x5aae7a;};'use strict';var ChatQueueEvents=require(_0x429d('0x0'));var events=['save',_0x429d('0x1'),_0x429d('0x2')];function createListener(_0x16ce75,_0x472fc9){return function(_0x45df1c){_0x472fc9['emit'](_0x16ce75,_0x45df1c);};}function removeListener(_0xc3989d,_0x3f43f5){return function(){ChatQueueEvents[_0x429d('0x3')](_0xc3989d,_0x3f43f5);};}exports[_0x429d('0x4')]=function(_0x1c55aa){for(var _0xa71445=0x0,_0x56aa2f=events[_0x429d('0x5')];_0xa71445<_0x56aa2f;_0xa71445++){var _0x4befb9=events[_0xa71445];var _0x9fc337=createListener('chatQueue:'+_0x4befb9,_0x1c55aa);ChatQueueEvents['on'](_0x4befb9,_0x9fc337);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 922d1f3..b3832f7 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x3e74,0x175));var _0x43e7=function(_0x491eee,_0x1a0eaa){_0x491eee=_0x491eee-0x0;var _0x19d78a=_0x3e74[_0x491eee];return _0x19d78a;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
+var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4249a2,_0x536828){var _0x326233=function(_0x20c5b6){while(--_0x20c5b6){_0x4249a2['push'](_0x4249a2['shift']());}};_0x326233(++_0x536828);}(_0x008c,0x188));var _0xc008=function(_0x46fe6a,_0x58ff06){_0x46fe6a=_0x46fe6a-0x0;var _0x58cb14=_0x008c[_0x46fe6a];return _0x58cb14;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index b552532..93cc2c6 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 _0xc470=['DATE','moment','sequelize','exports','STRING'];(function(_0x289891,_0x49a0fa){var _0x31cf2e=function(_0x8cebce){while(--_0x8cebce){_0x289891['push'](_0x289891['shift']());}};_0x31cf2e(++_0x49a0fa);}(_0xc470,0x155));var _0x0c47=function(_0x57d740,_0x50be99){_0x57d740=_0x57d740-0x0;var _0x6607ef=_0xc470[_0x57d740];return _0x6607ef;};'use strict';var moment=require(_0x0c47('0x0'));var Sequelize=require(_0x0c47('0x1'));module[_0x0c47('0x2')]={'uniqueid':{'type':Sequelize[_0x0c47('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x0c47('0x4')]},'leaveAt':{'type':Sequelize[_0x0c47('0x4')]},'acceptAt':{'type':Sequelize[_0x0c47('0x4')]},'exitAt':{'type':Sequelize[_0x0c47('0x4')]},'reason':{'type':Sequelize[_0x0c47('0x3')]}};
\ No newline at end of file
+var _0xb479=['STRING','DATE','sequelize','exports'];(function(_0x360849,_0x3fd95c){var _0x5c9370=function(_0x18862d){while(--_0x18862d){_0x360849['push'](_0x360849['shift']());}};_0x5c9370(++_0x3fd95c);}(_0xb479,0x1ee));var _0x9b47=function(_0x2d1a42,_0x5e804e){_0x2d1a42=_0x2d1a42-0x0;var _0x1d92e1=_0xb479[_0x2d1a42];return _0x1d92e1;};'use strict';var moment=require('moment');var Sequelize=require(_0x9b47('0x0'));module[_0x9b47('0x1')]={'uniqueid':{'type':Sequelize[_0x9b47('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9b47('0x2')]},'joinAt':{'type':Sequelize[_0x9b47('0x3')]},'leaveAt':{'type':Sequelize[_0x9b47('0x3')]},'acceptAt':{'type':Sequelize[_0x9b47('0x3')]},'exitAt':{'type':Sequelize[_0x9b47('0x3')]},'reason':{'type':Sequelize[_0x9b47('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index f789d33..cf0c9bf 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 _0x4351=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','fields','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis'];(function(_0x4aecd9,_0x54c49d){var _0x4089dc=function(_0x3a7a85){while(--_0x3a7a85){_0x4aecd9['push'](_0x4aecd9['shift']());}};_0x4089dc(++_0x54c49d);}(_0x4351,0x1b5));var _0x1435=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4351[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x1435('0x0'));var rimraf=require(_0x1435('0x1'));var zipdir=require(_0x1435('0x2'));var jsonpatch=require(_0x1435('0x3'));var rp=require(_0x1435('0x4'));var moment=require(_0x1435('0x5'));var BPromise=require(_0x1435('0x6'));var Mustache=require(_0x1435('0x7'));var util=require(_0x1435('0x8'));var path=require(_0x1435('0x9'));var sox=require(_0x1435('0xa'));var csv=require(_0x1435('0xb'));var ejs=require(_0x1435('0xc'));var fs=require('fs');var fs_extra=require(_0x1435('0xd'));var _=require(_0x1435('0xe'));var squel=require('squel');var crypto=require(_0x1435('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1435('0xb'));var querystring=require(_0x1435('0x10'));var Papa=require(_0x1435('0x11'));var Redis=require(_0x1435('0x12'));var authService=require(_0x1435('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1435('0x14'));var hardwareService=require(_0x1435('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x1435('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1435('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1632ac,_0x5137c0){_0x5137c0=_0x5137c0||0xcc;return function(_0x47daf0){if(_0x47daf0){return _0x1632ac['sendStatus'](_0x5137c0);}return _0x1632ac[_0x1435('0x18')](_0x5137c0)[_0x1435('0x19')]();};}function respondWithResult(_0x243669,_0x4a80bc){_0x4a80bc=_0x4a80bc||0xc8;return function(_0x4a52ba){if(_0x4a52ba){return _0x243669[_0x1435('0x18')](_0x4a80bc)['json'](_0x4a52ba);}};}function respondWithFilteredResult(_0x39405c,_0x3f0b08){return function(_0x1f5fc3){if(_0x1f5fc3){var _0x202744=typeof _0x3f0b08[_0x1435('0x1a')]===_0x1435('0x1b')&&typeof _0x3f0b08[_0x1435('0x1c')]===_0x1435('0x1b');var _0x2c1a6b=_0x1f5fc3[_0x1435('0x1d')];var _0x430367=_0x202744?0x0:_0x3f0b08[_0x1435('0x1a')];var _0x68f503=_0x202744?_0x1f5fc3[_0x1435('0x1d')]:_0x3f0b08[_0x1435('0x1a')]+_0x3f0b08['limit'];var _0x26da28;if(_0x68f503>=_0x2c1a6b){_0x68f503=_0x2c1a6b;_0x26da28=0xc8;}else{_0x26da28=0xce;}_0x39405c[_0x1435('0x18')](_0x26da28);return _0x39405c['set'](_0x1435('0x1e'),_0x430367+'-'+_0x68f503+'/'+_0x2c1a6b)['json'](_0x1f5fc3);}return null;};}function patchUpdates(_0x15d7c0){return function(_0x2a72aa){try{jsonpatch[_0x1435('0x1f')](_0x2a72aa,_0x15d7c0,!![]);}catch(_0x28bc0a){return BPromise[_0x1435('0x20')](_0x28bc0a);}return _0x2a72aa[_0x1435('0x21')]();};}function saveUpdates(_0x543209,_0x17ed76){return function(_0x437f61){if(_0x437f61){return _0x437f61[_0x1435('0x22')](_0x543209)[_0x1435('0x23')](function(_0x57a94f){return _0x57a94f;});}return null;};}function removeEntity(_0x1b6259,_0x302831){return function(_0xab77fa){if(_0xab77fa){return _0xab77fa[_0x1435('0x24')]()[_0x1435('0x23')](function(){_0x1b6259[_0x1435('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x523792,_0x22241f){return function(_0x2b4828){if(!_0x2b4828){_0x523792[_0x1435('0x25')](0x194);}return _0x2b4828;};}function handleError(_0x4f86f0,_0x42599d){_0x42599d=_0x42599d||0x1f4;return function(_0x25cf29){logger[_0x1435('0x26')](_0x25cf29[_0x1435('0x27')]);if(_0x25cf29[_0x1435('0x28')]){delete _0x25cf29['name'];}_0x4f86f0[_0x1435('0x18')](_0x42599d)[_0x1435('0x29')](_0x25cf29);};}exports[_0x1435('0x2a')]=function(_0x453d68,_0x1c3b7e){var _0x108c25={},_0x2e0e72={},_0x57a02f={'count':0x0,'rows':[]};var _0x31ab10=_[_0x1435('0x2b')](db[_0x1435('0x2c')][_0x1435('0x2d')],function(_0x297edf){return{'name':_0x297edf['fieldName'],'type':_0x297edf[_0x1435('0x2e')][_0x1435('0x2f')]};});_0x2e0e72[_0x1435('0x30')]=_[_0x1435('0x2b')](_0x31ab10,'name');_0x2e0e72[_0x1435('0x31')]=_[_0x1435('0x32')](_0x453d68['query']);_0x2e0e72[_0x1435('0x33')]=_['intersection'](_0x2e0e72[_0x1435('0x30')],_0x2e0e72[_0x1435('0x31')]);_0x108c25['attributes']=_[_0x1435('0x34')](_0x2e0e72[_0x1435('0x30')],qs['fields'](_0x453d68['query']['fields']));_0x108c25[_0x1435('0x35')]=_0x108c25['attributes'][_0x1435('0x36')]?_0x108c25['attributes']:_0x2e0e72[_0x1435('0x30')];if(!_0x453d68['query'][_0x1435('0x37')](_0x1435('0x38'))){_0x108c25[_0x1435('0x1c')]=qs[_0x1435('0x1c')](_0x453d68[_0x1435('0x31')][_0x1435('0x1c')]);_0x108c25['offset']=qs[_0x1435('0x1a')](_0x453d68[_0x1435('0x31')][_0x1435('0x1a')]);}_0x108c25[_0x1435('0x39')]=qs[_0x1435('0x3a')](_0x453d68['query'][_0x1435('0x3a')]);_0x108c25['where']=qs[_0x1435('0x33')](_[_0x1435('0x3b')](_0x453d68['query'],_0x2e0e72[_0x1435('0x33')]),_0x31ab10);if(_0x453d68[_0x1435('0x31')][_0x1435('0x3c')]){_0x108c25[_0x1435('0x3d')]=_[_0x1435('0x3e')](_0x108c25[_0x1435('0x3d')],{'$or':_[_0x1435('0x2b')](_0x31ab10,function(_0x176dbd){if(_0x176dbd[_0x1435('0x2e')]!==_0x1435('0x3f')){var _0x3ecac4={};_0x3ecac4[_0x176dbd[_0x1435('0x28')]]={'$like':'%'+_0x453d68['query'][_0x1435('0x3c')]+'%'};return _0x3ecac4;}})});}_0x108c25=_['merge']({},_0x108c25,_0x453d68[_0x1435('0x40')]);var _0x5b24ab={'where':_0x108c25[_0x1435('0x3d')]};return db['ChatQueueReport'][_0x1435('0x1d')](_0x5b24ab)['then'](function(_0x36bc74){_0x57a02f[_0x1435('0x1d')]=_0x36bc74;if(_0x453d68[_0x1435('0x31')]['includeAll']){_0x108c25[_0x1435('0x41')]=[{'all':!![]}];}return db[_0x1435('0x2c')][_0x1435('0x42')](_0x108c25);})['then'](function(_0x1d6417){_0x57a02f[_0x1435('0x43')]=_0x1d6417;return _0x57a02f;})['then'](respondWithFilteredResult(_0x1c3b7e,_0x108c25))['catch'](handleError(_0x1c3b7e,null));};exports[_0x1435('0x44')]=function(_0x40e9eb,_0x2dd1f5){var _0x5986f8={'raw':!![],'where':{'id':_0x40e9eb[_0x1435('0x45')]['id']}},_0x4e5d0a={};_0x4e5d0a['model']=_[_0x1435('0x32')](db['ChatQueueReport'][_0x1435('0x2d')]);_0x4e5d0a['query']=_[_0x1435('0x32')](_0x40e9eb['query']);_0x4e5d0a[_0x1435('0x33')]=_['intersection'](_0x4e5d0a[_0x1435('0x30')],_0x4e5d0a[_0x1435('0x31')]);_0x5986f8['attributes']=_[_0x1435('0x34')](_0x4e5d0a['model'],qs[_0x1435('0x46')](_0x40e9eb[_0x1435('0x31')][_0x1435('0x46')]));_0x5986f8['attributes']=_0x5986f8[_0x1435('0x35')][_0x1435('0x36')]?_0x5986f8['attributes']:_0x4e5d0a[_0x1435('0x30')];if(_0x40e9eb[_0x1435('0x31')]['includeAll']){_0x5986f8[_0x1435('0x41')]=[{'all':!![]}];}_0x5986f8=_[_0x1435('0x3e')]({},_0x5986f8,_0x40e9eb['options']);return db[_0x1435('0x2c')][_0x1435('0x47')](_0x5986f8)['then'](handleEntityNotFound(_0x2dd1f5,null))[_0x1435('0x23')](respondWithResult(_0x2dd1f5,null))[_0x1435('0x48')](handleError(_0x2dd1f5,null));};exports[_0x1435('0x49')]=function(_0x4b254e,_0x57b5d4){return db[_0x1435('0x2c')]['create'](_0x4b254e[_0x1435('0x4a')],{})['then'](respondWithResult(_0x57b5d4,0xc9))[_0x1435('0x48')](handleError(_0x57b5d4,null));};exports[_0x1435('0x22')]=function(_0x1f8899,_0x148862){if(_0x1f8899[_0x1435('0x4a')]['id']){delete _0x1f8899[_0x1435('0x4a')]['id'];}return db[_0x1435('0x2c')]['find']({'where':{'id':_0x1f8899[_0x1435('0x45')]['id']}})[_0x1435('0x23')](handleEntityNotFound(_0x148862,null))[_0x1435('0x23')](saveUpdates(_0x1f8899['body'],null))[_0x1435('0x23')](respondWithResult(_0x148862,null))[_0x1435('0x48')](handleError(_0x148862,null));};exports[_0x1435('0x24')]=function(_0x24c5d0,_0x118c06){return db[_0x1435('0x2c')][_0x1435('0x47')]({'where':{'id':_0x24c5d0[_0x1435('0x45')]['id']}})['then'](handleEntityNotFound(_0x118c06,null))[_0x1435('0x23')](removeEntity(_0x118c06,null))[_0x1435('0x48')](handleError(_0x118c06,null));};exports[_0x1435('0x4b')]=function(_0x4244e1,_0x5953ce){return db['ChatQueueReport'][_0x1435('0x4b')]()[_0x1435('0x23')](respondWithResult(_0x5953ce,null))[_0x1435('0x48')](handleError(_0x5953ce,null));};
\ No newline at end of file
+var _0x63a6=['findAll','rows','catch','show','rawAttributes','options','find','create','body','params','describe','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','json','undefined','count','status','apply','reject','save','update','then','destroy','error','name','send','index','map','ChatQueueReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include'];(function(_0x16ace9,_0xe208f0){var _0x5bf5f8=function(_0x3e9ac0){while(--_0x3e9ac0){_0x16ace9['push'](_0x16ace9['shift']());}};_0x5bf5f8(++_0xe208f0);}(_0x63a6,0x1c7));var _0x663a=function(_0x5200c4,_0x4d59a6){_0x5200c4=_0x5200c4-0x0;var _0x36cb24=_0x63a6[_0x5200c4];return _0x36cb24;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x663a('0x0'));var zipdir=require(_0x663a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x663a('0x2'));var moment=require(_0x663a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x663a('0x4'));var util=require(_0x663a('0x5'));var path=require(_0x663a('0x6'));var sox=require(_0x663a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x663a('0x8'));var squel=require(_0x663a('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x663a('0xa'));var toCsv=require(_0x663a('0xb'));var querystring=require(_0x663a('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x663a('0xd'));var qs=require(_0x663a('0xe'));var as=require(_0x663a('0xf'));var hardwareService=require(_0x663a('0x10'));var logger=require(_0x663a('0x11'))(_0x663a('0x12'));var utils=require('../../config/utils');var config=require(_0x663a('0x13'));var licenseUtil=require(_0x663a('0x14'));var db=require(_0x663a('0x15'))['db'];function respondWithStatusCode(_0x581440,_0x583366){_0x583366=_0x583366||0xcc;return function(_0x3f3ef4){if(_0x3f3ef4){return _0x581440['sendStatus'](_0x583366);}return _0x581440['status'](_0x583366)[_0x663a('0x16')]();};}function respondWithResult(_0x39d5d4,_0x558f2f){_0x558f2f=_0x558f2f||0xc8;return function(_0x1eaf35){if(_0x1eaf35){return _0x39d5d4['status'](_0x558f2f)[_0x663a('0x17')](_0x1eaf35);}};}function respondWithFilteredResult(_0x1eab42,_0x15afa0){return function(_0x2d794f){if(_0x2d794f){var _0x1a8d76=typeof _0x15afa0['offset']===_0x663a('0x18')&&typeof _0x15afa0['limit']===_0x663a('0x18');var _0x45f489=_0x2d794f[_0x663a('0x19')];var _0x1508ab=_0x1a8d76?0x0:_0x15afa0['offset'];var _0x2a1f33=_0x1a8d76?_0x2d794f['count']:_0x15afa0['offset']+_0x15afa0['limit'];var _0x2d006c;if(_0x2a1f33>=_0x45f489){_0x2a1f33=_0x45f489;_0x2d006c=0xc8;}else{_0x2d006c=0xce;}_0x1eab42[_0x663a('0x1a')](_0x2d006c);return _0x1eab42['set']('Content-Range',_0x1508ab+'-'+_0x2a1f33+'/'+_0x45f489)[_0x663a('0x17')](_0x2d794f);}return null;};}function patchUpdates(_0x173a10){return function(_0x89d455){try{jsonpatch[_0x663a('0x1b')](_0x89d455,_0x173a10,!![]);}catch(_0x221c83){return BPromise[_0x663a('0x1c')](_0x221c83);}return _0x89d455[_0x663a('0x1d')]();};}function saveUpdates(_0x52d97b,_0x1586f3){return function(_0x21152c){if(_0x21152c){return _0x21152c[_0x663a('0x1e')](_0x52d97b)[_0x663a('0x1f')](function(_0x3d4e7c){return _0x3d4e7c;});}return null;};}function removeEntity(_0x207b26,_0x5e1bd1){return function(_0x310339){if(_0x310339){return _0x310339[_0x663a('0x20')]()['then'](function(){_0x207b26[_0x663a('0x1a')](0xcc)[_0x663a('0x16')]();});}};}function handleEntityNotFound(_0x5463d5,_0x3cb58a){return function(_0x2b2762){if(!_0x2b2762){_0x5463d5['sendStatus'](0x194);}return _0x2b2762;};}function handleError(_0x1e2653,_0x41c552){_0x41c552=_0x41c552||0x1f4;return function(_0x57131d){logger[_0x663a('0x21')](_0x57131d['stack']);if(_0x57131d[_0x663a('0x22')]){delete _0x57131d[_0x663a('0x22')];}_0x1e2653[_0x663a('0x1a')](_0x41c552)[_0x663a('0x23')](_0x57131d);};}exports[_0x663a('0x24')]=function(_0x57f93d,_0xcf9f0a){var _0x71efb={},_0x1ab286={},_0xf68801={'count':0x0,'rows':[]};var _0x210f03=_[_0x663a('0x25')](db[_0x663a('0x26')]['rawAttributes'],function(_0x3b4329){return{'name':_0x3b4329[_0x663a('0x27')],'type':_0x3b4329[_0x663a('0x28')][_0x663a('0x29')]};});_0x1ab286[_0x663a('0x2a')]=_['map'](_0x210f03,_0x663a('0x22'));_0x1ab286['query']=_[_0x663a('0x2b')](_0x57f93d[_0x663a('0x2c')]);_0x1ab286[_0x663a('0x2d')]=_[_0x663a('0x2e')](_0x1ab286[_0x663a('0x2a')],_0x1ab286['query']);_0x71efb[_0x663a('0x2f')]=_['intersection'](_0x1ab286[_0x663a('0x2a')],qs[_0x663a('0x30')](_0x57f93d[_0x663a('0x2c')][_0x663a('0x30')]));_0x71efb['attributes']=_0x71efb[_0x663a('0x2f')][_0x663a('0x31')]?_0x71efb[_0x663a('0x2f')]:_0x1ab286[_0x663a('0x2a')];if(!_0x57f93d[_0x663a('0x2c')][_0x663a('0x32')](_0x663a('0x33'))){_0x71efb[_0x663a('0x34')]=qs['limit'](_0x57f93d[_0x663a('0x2c')][_0x663a('0x34')]);_0x71efb['offset']=qs[_0x663a('0x35')](_0x57f93d[_0x663a('0x2c')][_0x663a('0x35')]);}_0x71efb[_0x663a('0x36')]=qs[_0x663a('0x37')](_0x57f93d['query'][_0x663a('0x37')]);_0x71efb['where']=qs[_0x663a('0x2d')](_[_0x663a('0x38')](_0x57f93d['query'],_0x1ab286['filters']),_0x210f03);if(_0x57f93d[_0x663a('0x2c')][_0x663a('0x39')]){_0x71efb['where']=_[_0x663a('0x3a')](_0x71efb[_0x663a('0x3b')],{'$or':_[_0x663a('0x25')](_0x210f03,function(_0x4d0b8d){if(_0x4d0b8d[_0x663a('0x28')]!==_0x663a('0x3c')){var _0x5e2826={};_0x5e2826[_0x4d0b8d[_0x663a('0x22')]]={'$like':'%'+_0x57f93d['query'][_0x663a('0x39')]+'%'};return _0x5e2826;}})});}_0x71efb=_[_0x663a('0x3a')]({},_0x71efb,_0x57f93d['options']);var _0x1aff26={'where':_0x71efb[_0x663a('0x3b')]};return db['ChatQueueReport'][_0x663a('0x19')](_0x1aff26)[_0x663a('0x1f')](function(_0x5de40d){_0xf68801['count']=_0x5de40d;if(_0x57f93d[_0x663a('0x2c')][_0x663a('0x3d')]){_0x71efb[_0x663a('0x3e')]=[{'all':!![]}];}return db[_0x663a('0x26')][_0x663a('0x3f')](_0x71efb);})[_0x663a('0x1f')](function(_0x110afa){_0xf68801[_0x663a('0x40')]=_0x110afa;return _0xf68801;})['then'](respondWithFilteredResult(_0xcf9f0a,_0x71efb))[_0x663a('0x41')](handleError(_0xcf9f0a,null));};exports[_0x663a('0x42')]=function(_0x252963,_0x2e0df7){var _0x51fd91={'raw':!![],'where':{'id':_0x252963['params']['id']}},_0x285ed3={};_0x285ed3['model']=_['keys'](db['ChatQueueReport'][_0x663a('0x43')]);_0x285ed3[_0x663a('0x2c')]=_[_0x663a('0x2b')](_0x252963['query']);_0x285ed3[_0x663a('0x2d')]=_['intersection'](_0x285ed3[_0x663a('0x2a')],_0x285ed3[_0x663a('0x2c')]);_0x51fd91['attributes']=_[_0x663a('0x2e')](_0x285ed3[_0x663a('0x2a')],qs[_0x663a('0x30')](_0x252963[_0x663a('0x2c')][_0x663a('0x30')]));_0x51fd91[_0x663a('0x2f')]=_0x51fd91[_0x663a('0x2f')][_0x663a('0x31')]?_0x51fd91['attributes']:_0x285ed3[_0x663a('0x2a')];if(_0x252963[_0x663a('0x2c')]['includeAll']){_0x51fd91['include']=[{'all':!![]}];}_0x51fd91=_[_0x663a('0x3a')]({},_0x51fd91,_0x252963[_0x663a('0x44')]);return db[_0x663a('0x26')][_0x663a('0x45')](_0x51fd91)['then'](handleEntityNotFound(_0x2e0df7,null))['then'](respondWithResult(_0x2e0df7,null))[_0x663a('0x41')](handleError(_0x2e0df7,null));};exports[_0x663a('0x46')]=function(_0x55b3ed,_0x5efe40){return db[_0x663a('0x26')][_0x663a('0x46')](_0x55b3ed[_0x663a('0x47')],{})[_0x663a('0x1f')](respondWithResult(_0x5efe40,0xc9))[_0x663a('0x41')](handleError(_0x5efe40,null));};exports[_0x663a('0x1e')]=function(_0x1c3bc4,_0x5ec404){if(_0x1c3bc4[_0x663a('0x47')]['id']){delete _0x1c3bc4[_0x663a('0x47')]['id'];}return db[_0x663a('0x26')][_0x663a('0x45')]({'where':{'id':_0x1c3bc4[_0x663a('0x48')]['id']}})[_0x663a('0x1f')](handleEntityNotFound(_0x5ec404,null))[_0x663a('0x1f')](saveUpdates(_0x1c3bc4[_0x663a('0x47')],null))[_0x663a('0x1f')](respondWithResult(_0x5ec404,null))[_0x663a('0x41')](handleError(_0x5ec404,null));};exports[_0x663a('0x20')]=function(_0x4a61f5,_0x32fbe2){return db[_0x663a('0x26')]['find']({'where':{'id':_0x4a61f5[_0x663a('0x48')]['id']}})[_0x663a('0x1f')](handleEntityNotFound(_0x32fbe2,null))[_0x663a('0x1f')](removeEntity(_0x32fbe2,null))['catch'](handleError(_0x32fbe2,null));};exports[_0x663a('0x49')]=function(_0x384629,_0x5462d4){return db[_0x663a('0x26')][_0x663a('0x49')]()['then'](respondWithResult(_0x5462d4,null))['catch'](handleError(_0x5462d4,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 9126ef7..ac72346 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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x309e28,_0x5824b3){var _0x550306=function(_0x19da3e){while(--_0x19da3e){_0x309e28['push'](_0x309e28['shift']());}};_0x550306(++_0x5824b3);}(_0x757a,0xde));var _0xa757=function(_0x2d2b29,_0x53e623){_0x2d2b29=_0x2d2b29-0x0;var _0x4fff94=_0x757a[_0x2d2b29];return _0x4fff94;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x390906,_0xdea321){var _0x1d0ffb=function(_0x4759e7){while(--_0x4759e7){_0x390906['push'](_0x390906['shift']());}};_0x1d0ffb(++_0xdea321);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 156481d..62fbdc2 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 _0x6313=['limit','util','../../mysqldb','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','debug','stringify','UpdateChatQueueReport','update','where','attributes'];(function(_0x219c7d,_0x4b3506){var _0x4459aa=function(_0x3e7121){while(--_0x3e7121){_0x219c7d['push'](_0x219c7d['shift']());}};_0x4459aa(++_0x4b3506);}(_0x6313,0x135));var _0x3631=function(_0x521378,_0x2f8004){_0x521378=_0x521378-0x0;var _0x4b2fc4=_0x6313[_0x521378];return _0x4b2fc4;};'use strict';var _=require('lodash');var util=require(_0x3631('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3631('0x1'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3631('0x2'));var config=require(_0x3631('0x3'));var jayson=require(_0x3631('0x4'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xccc881,_0x49211e,_0x26000d){return new BPromise(function(_0x547fc8,_0x350a0f){return client[_0x3631('0x5')](_0xccc881,_0x26000d)[_0x3631('0x6')](function(_0x2545df){logger[_0x3631('0x7')]('ChatQueueReport,\x20%s,\x20%s',_0x49211e,_0x3631('0x8'));logger['debug'](_0x3631('0x9'),_0x49211e,_0x3631('0x8'),JSON['stringify'](_0x2545df));if(_0x2545df['error']){if(_0x2545df[_0x3631('0xa')][_0x3631('0xb')]===0x1f4){logger['error'](_0x3631('0xc'),_0x49211e,_0x2545df[_0x3631('0xa')][_0x3631('0xd')]);return _0x350a0f(_0x2545df[_0x3631('0xa')][_0x3631('0xd')]);}logger['error'](_0x3631('0xc'),_0x49211e,_0x2545df['error'][_0x3631('0xd')]);return _0x547fc8(_0x2545df['error'][_0x3631('0xd')]);}else{logger[_0x3631('0x7')](_0x3631('0xc'),_0x49211e,_0x3631('0x8'));_0x547fc8(_0x2545df[_0x3631('0xe')][_0x3631('0xd')]);}})[_0x3631('0xf')](function(_0x4a8970){logger[_0x3631('0xa')](_0x3631('0xc'),_0x49211e,_0x4a8970);_0x350a0f(_0x4a8970);});});}exports[_0x3631('0x10')]=function(_0x3f8713){var _0x81cfc5=this;return new Promise(function(_0x31585d,_0x240ca9){return db[_0x3631('0x11')]['create'](_0x3f8713[_0x3631('0x12')],{'raw':_0x3f8713[_0x3631('0x13')]?_0x3f8713[_0x3631('0x13')][_0x3631('0x14')]===undefined?!![]:![]:!![]})[_0x3631('0x6')](function(_0x366239){logger['info'](_0x3631('0x10'),_0x3f8713);logger[_0x3631('0x15')](_0x3631('0x10'),_0x3f8713,JSON[_0x3631('0x16')](_0x366239));_0x31585d(_0x366239);})[_0x3631('0xf')](function(_0x582c64){logger[_0x3631('0xa')](_0x3631('0x10'),_0x582c64[_0x3631('0xd')],_0x3f8713);_0x240ca9(_0x81cfc5['error'](0x1f4,_0x582c64[_0x3631('0xd')]));});});};exports[_0x3631('0x17')]=function(_0x360f09){var _0x4b93fb=this;return new Promise(function(_0x257ab3,_0x4122bf){return db[_0x3631('0x11')][_0x3631('0x18')](_0x360f09[_0x3631('0x12')],{'raw':_0x360f09[_0x3631('0x13')]?_0x360f09[_0x3631('0x13')][_0x3631('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x360f09[_0x3631('0x13')]?_0x360f09['options'][_0x3631('0x19')]||null:null,'attributes':_0x360f09['options']?_0x360f09[_0x3631('0x13')][_0x3631('0x1a')]||null:null,'limit':_0x360f09[_0x3631('0x13')]?_0x360f09[_0x3631('0x13')][_0x3631('0x1b')]||null:null})[_0x3631('0x6')](function(_0xd9f26a){logger['info']('UpdateChatQueueReport',_0x360f09);logger[_0x3631('0x15')](_0x3631('0x17'),_0x360f09,JSON['stringify'](_0xd9f26a));_0x257ab3(_0xd9f26a);})[_0x3631('0xf')](function(_0x33bb98){logger['error']('UpdateChatQueueReport',_0x33bb98['message'],_0x360f09);_0x4122bf(_0x4b93fb[_0x3631('0xa')](0x1f4,_0x33bb98[_0x3631('0xd')]));});});};
\ No newline at end of file
+var _0x8d46=['stringify','error','message','ChatQueueReport,\x20%s,\x20%s','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','debug','UpdateChatQueueReport','raw','where','attributes','limit','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x18c492,_0x540756){var _0x274e04=function(_0x2b4d7a){while(--_0x2b4d7a){_0x18c492['push'](_0x18c492['shift']());}};_0x274e04(++_0x540756);}(_0x8d46,0x184));var _0x68d4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8d46[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x68d4('0x0'));var util=require(_0x68d4('0x1'));var moment=require(_0x68d4('0x2'));var BPromise=require('bluebird');var rs=require(_0x68d4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x68d4('0x4'));var logger=require(_0x68d4('0x5'))(_0x68d4('0x6'));var config=require(_0x68d4('0x7'));var jayson=require(_0x68d4('0x8'));var client=jayson[_0x68d4('0x9')][_0x68d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a10d7,_0x395903,_0x108c90){return new BPromise(function(_0x5b9b83,_0x5b2c1a){return client['request'](_0x1a10d7,_0x108c90)[_0x68d4('0xb')](function(_0x239090){logger[_0x68d4('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x395903,'request\x20sent');logger['debug'](_0x68d4('0xd'),_0x395903,_0x68d4('0xe'),JSON[_0x68d4('0xf')](_0x239090));if(_0x239090[_0x68d4('0x10')]){if(_0x239090[_0x68d4('0x10')]['code']===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x395903,_0x239090[_0x68d4('0x10')][_0x68d4('0x11')]);return _0x5b2c1a(_0x239090[_0x68d4('0x10')][_0x68d4('0x11')]);}logger[_0x68d4('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x395903,_0x239090['error'][_0x68d4('0x11')]);return _0x5b9b83(_0x239090[_0x68d4('0x10')][_0x68d4('0x11')]);}else{logger[_0x68d4('0xc')](_0x68d4('0x12'),_0x395903,'request\x20sent');_0x5b9b83(_0x239090[_0x68d4('0x13')]['message']);}})[_0x68d4('0x14')](function(_0x21a7be){logger[_0x68d4('0x10')](_0x68d4('0x12'),_0x395903,_0x21a7be);_0x5b2c1a(_0x21a7be);});});}exports[_0x68d4('0x15')]=function(_0x30f03c){var _0x23f20b=this;return new Promise(function(_0x361b6e,_0x561849){return db[_0x68d4('0x16')]['create'](_0x30f03c[_0x68d4('0x17')],{'raw':_0x30f03c[_0x68d4('0x18')]?_0x30f03c[_0x68d4('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x68d4('0xb')](function(_0x51589f){logger[_0x68d4('0xc')](_0x68d4('0x15'),_0x30f03c);logger[_0x68d4('0x19')]('CreateChatQueueReport',_0x30f03c,JSON[_0x68d4('0xf')](_0x51589f));_0x361b6e(_0x51589f);})['catch'](function(_0x345f14){logger[_0x68d4('0x10')](_0x68d4('0x15'),_0x345f14[_0x68d4('0x11')],_0x30f03c);_0x561849(_0x23f20b['error'](0x1f4,_0x345f14[_0x68d4('0x11')]));});});};exports[_0x68d4('0x1a')]=function(_0x27f5df){var _0x5e7776=this;return new Promise(function(_0x5b70bf,_0x36c3d0){return db[_0x68d4('0x16')]['update'](_0x27f5df[_0x68d4('0x17')],{'raw':_0x27f5df[_0x68d4('0x18')]?_0x27f5df['options'][_0x68d4('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27f5df[_0x68d4('0x18')]?_0x27f5df['options'][_0x68d4('0x1c')]||null:null,'attributes':_0x27f5df[_0x68d4('0x18')]?_0x27f5df[_0x68d4('0x18')][_0x68d4('0x1d')]||null:null,'limit':_0x27f5df[_0x68d4('0x18')]?_0x27f5df[_0x68d4('0x18')][_0x68d4('0x1e')]||null:null})['then'](function(_0x4c905b){logger['info'](_0x68d4('0x1a'),_0x27f5df);logger[_0x68d4('0x19')](_0x68d4('0x1a'),_0x27f5df,JSON[_0x68d4('0xf')](_0x4c905b));_0x5b70bf(_0x4c905b);})[_0x68d4('0x14')](function(_0x43bebc){logger['error']('UpdateChatQueueReport',_0x43bebc[_0x68d4('0x11')],_0x27f5df);_0x36c3d0(_0x5e7776[_0x68d4('0x10')](0x1f4,_0x43bebc[_0x68d4('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 8c1799a..d8b6559 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 _0x613b=['destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete'];(function(_0x5d90b8,_0x528b3a){var _0x5712b3=function(_0x478049){while(--_0x478049){_0x5d90b8['push'](_0x5d90b8['shift']());}};_0x5712b3(++_0x528b3a);}(_0x613b,0x1b9));var _0xb613=function(_0x1fd69c,_0x1b925b){_0x1fd69c=_0x1fd69c-0x0;var _0x421119=_0x613b[_0x1fd69c];return _0x421119;};'use strict';var multer=require(_0xb613('0x0'));var util=require(_0xb613('0x1'));var path=require(_0xb613('0x2'));var timeout=require(_0xb613('0x3'));var express=require('express');var router=express[_0xb613('0x4')]();var fs_extra=require(_0xb613('0x5'));var auth=require(_0xb613('0x6'));var interaction=require(_0xb613('0x7'));var config=require(_0xb613('0x8'));var controller=require(_0xb613('0x9'));router[_0xb613('0xa')]('/',auth[_0xb613('0xb')](),controller[_0xb613('0xc')]);router[_0xb613('0xa')](_0xb613('0xd'),auth[_0xb613('0xb')](),controller[_0xb613('0xe')]);router['get'](_0xb613('0xf'),auth[_0xb613('0xb')](),controller[_0xb613('0x10')]);router['post']('/',auth[_0xb613('0xb')](),controller[_0xb613('0x11')]);router[_0xb613('0x12')](_0xb613('0xf'),auth[_0xb613('0xb')](),controller[_0xb613('0x13')]);router[_0xb613('0x14')](_0xb613('0xf'),auth[_0xb613('0xb')](),controller[_0xb613('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xe145=['../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3064a2,_0x5bc059){var _0x484180=function(_0x20322a){while(--_0x20322a){_0x3064a2['push'](_0x3064a2['shift']());}};_0x484180(++_0x5bc059);}(_0xe145,0xd5));var _0x5e14=function(_0x2a123f,_0x277688){_0x2a123f=_0x2a123f-0x0;var _0x548d77=_0xe145[_0x2a123f];return _0x548d77;};'use strict';var multer=require(_0x5e14('0x0'));var util=require(_0x5e14('0x1'));var path=require('path');var timeout=require(_0x5e14('0x2'));var express=require(_0x5e14('0x3'));var router=express[_0x5e14('0x4')]();var fs_extra=require(_0x5e14('0x5'));var auth=require(_0x5e14('0x6'));var interaction=require(_0x5e14('0x7'));var config=require(_0x5e14('0x8'));var controller=require(_0x5e14('0x9'));router['get']('/',auth[_0x5e14('0xa')](),controller[_0x5e14('0xb')]);router['get'](_0x5e14('0xc'),auth['isAuthenticated'](),controller[_0x5e14('0xd')]);router['get'](_0x5e14('0xe'),auth[_0x5e14('0xa')](),controller[_0x5e14('0xf')]);router[_0x5e14('0x10')]('/',auth[_0x5e14('0xa')](),controller['create']);router[_0x5e14('0x11')](_0x5e14('0xe'),auth[_0x5e14('0xa')](),controller['update']);router[_0x5e14('0x12')](_0x5e14('0xe'),auth[_0x5e14('0xa')](),controller['destroy']);module[_0x5e14('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 7681e76..83c16ad 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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x4aa25e,_0x58c68b){var _0x36dea5=function(_0xcb3ffe){while(--_0xcb3ffe){_0x4aa25e['push'](_0x4aa25e['shift']());}};_0x36dea5(++_0x58c68b);}(_0x4b84,0x1cc));var _0x44b8=function(_0x23f8c8,_0xb536b9){_0x23f8c8=_0x23f8c8-0x0;var _0x3dc718=_0x4b84[_0x23f8c8];return _0x3dc718;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x3725ee,_0x543bd9){var _0x399c71=function(_0xaf9400){while(--_0xaf9400){_0x3725ee['push'](_0x3725ee['shift']());}};_0x399c71(++_0x543bd9);}(_0x008c,0x188));var _0xc008=function(_0x22c2da,_0x569b31){_0x22c2da=_0x22c2da-0x0;var _0x65a816=_0x008c[_0x22c2da];return _0x65a816;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index ffd157b..5ca7297 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 _0x3cf5=['map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','ChatTransferReport','length','include','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','Content-Range','reject','update','then','error','name','send','index'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3cf5,0xa6));var _0x53cf=function(_0x319fc1,_0x29179b){_0x319fc1=_0x319fc1-0x0;var _0xb768af=_0x3cf5[_0x319fc1];return _0xb768af;};'use strict';var emlformat=require(_0x53cf('0x0'));var rimraf=require(_0x53cf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x53cf('0x2'));var rp=require(_0x53cf('0x3'));var moment=require(_0x53cf('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x53cf('0x5'));var path=require('path');var sox=require(_0x53cf('0x6'));var csv=require(_0x53cf('0x7'));var ejs=require(_0x53cf('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x53cf('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x53cf('0xa'));var toCsv=require(_0x53cf('0x7'));var querystring=require(_0x53cf('0xb'));var Papa=require(_0x53cf('0xc'));var Redis=require(_0x53cf('0xd'));var authService=require(_0x53cf('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x53cf('0xf'))(_0x53cf('0x10'));var utils=require(_0x53cf('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x53cf('0x12'));var db=require(_0x53cf('0x13'))['db'];function respondWithStatusCode(_0x33bede,_0xc34a56){_0xc34a56=_0xc34a56||0xcc;return function(_0x3b3b20){if(_0x3b3b20){return _0x33bede[_0x53cf('0x14')](_0xc34a56);}return _0x33bede['status'](_0xc34a56)[_0x53cf('0x15')]();};}function respondWithResult(_0x1623d3,_0x49e73d){_0x49e73d=_0x49e73d||0xc8;return function(_0x943f2e){if(_0x943f2e){return _0x1623d3[_0x53cf('0x16')](_0x49e73d)[_0x53cf('0x17')](_0x943f2e);}};}function respondWithFilteredResult(_0x4ef376,_0x4b79cf){return function(_0x328dcf){if(_0x328dcf){var _0x1c5322=typeof _0x4b79cf[_0x53cf('0x18')]==='undefined'&&typeof _0x4b79cf[_0x53cf('0x19')]==='undefined';var _0x29ecc9=_0x328dcf[_0x53cf('0x1a')];var _0x1878d9=_0x1c5322?0x0:_0x4b79cf[_0x53cf('0x18')];var _0x50d673=_0x1c5322?_0x328dcf[_0x53cf('0x1a')]:_0x4b79cf['offset']+_0x4b79cf[_0x53cf('0x19')];var _0x355dc7;if(_0x50d673>=_0x29ecc9){_0x50d673=_0x29ecc9;_0x355dc7=0xc8;}else{_0x355dc7=0xce;}_0x4ef376[_0x53cf('0x16')](_0x355dc7);return _0x4ef376['set'](_0x53cf('0x1b'),_0x1878d9+'-'+_0x50d673+'/'+_0x29ecc9)['json'](_0x328dcf);}return null;};}function patchUpdates(_0x4897d7){return function(_0x17df3b){try{jsonpatch['apply'](_0x17df3b,_0x4897d7,!![]);}catch(_0x20af67){return BPromise[_0x53cf('0x1c')](_0x20af67);}return _0x17df3b['save']();};}function saveUpdates(_0x2202a8,_0x149546){return function(_0x4c3227){if(_0x4c3227){return _0x4c3227[_0x53cf('0x1d')](_0x2202a8)[_0x53cf('0x1e')](function(_0x279f45){return _0x279f45;});}return null;};}function removeEntity(_0xdc49ce,_0x58f56a){return function(_0x3ee430){if(_0x3ee430){return _0x3ee430['destroy']()[_0x53cf('0x1e')](function(){_0xdc49ce[_0x53cf('0x16')](0xcc)[_0x53cf('0x15')]();});}};}function handleEntityNotFound(_0x3df440,_0x17b536){return function(_0xed826c){if(!_0xed826c){_0x3df440['sendStatus'](0x194);}return _0xed826c;};}function handleError(_0x46199e,_0xde4b6d){_0xde4b6d=_0xde4b6d||0x1f4;return function(_0x397866){logger[_0x53cf('0x1f')](_0x397866['stack']);if(_0x397866['name']){delete _0x397866[_0x53cf('0x20')];}_0x46199e['status'](_0xde4b6d)[_0x53cf('0x21')](_0x397866);};}exports[_0x53cf('0x22')]=function(_0x479d1a,_0x410e98){var _0x46c60e={},_0x3a6fdb={},_0x5586cc={'count':0x0,'rows':[]};var _0x4dec0e=_[_0x53cf('0x23')](db['ChatTransferReport'][_0x53cf('0x24')],function(_0x5c9f25){return{'name':_0x5c9f25[_0x53cf('0x25')],'type':_0x5c9f25[_0x53cf('0x26')][_0x53cf('0x27')]};});_0x3a6fdb[_0x53cf('0x28')]=_[_0x53cf('0x23')](_0x4dec0e,_0x53cf('0x20'));_0x3a6fdb[_0x53cf('0x29')]=_[_0x53cf('0x2a')](_0x479d1a[_0x53cf('0x29')]);_0x3a6fdb[_0x53cf('0x2b')]=_['intersection'](_0x3a6fdb['model'],_0x3a6fdb[_0x53cf('0x29')]);_0x46c60e[_0x53cf('0x2c')]=_[_0x53cf('0x2d')](_0x3a6fdb[_0x53cf('0x28')],qs[_0x53cf('0x2e')](_0x479d1a['query'][_0x53cf('0x2e')]));_0x46c60e[_0x53cf('0x2c')]=_0x46c60e[_0x53cf('0x2c')]['length']?_0x46c60e[_0x53cf('0x2c')]:_0x3a6fdb[_0x53cf('0x28')];if(!_0x479d1a[_0x53cf('0x29')]['hasOwnProperty'](_0x53cf('0x2f'))){_0x46c60e[_0x53cf('0x19')]=qs['limit'](_0x479d1a['query'][_0x53cf('0x19')]);_0x46c60e['offset']=qs[_0x53cf('0x18')](_0x479d1a[_0x53cf('0x29')][_0x53cf('0x18')]);}_0x46c60e[_0x53cf('0x30')]=qs[_0x53cf('0x31')](_0x479d1a[_0x53cf('0x29')][_0x53cf('0x31')]);_0x46c60e[_0x53cf('0x32')]=qs[_0x53cf('0x2b')](_[_0x53cf('0x33')](_0x479d1a['query'],_0x3a6fdb[_0x53cf('0x2b')]),_0x4dec0e);if(_0x479d1a[_0x53cf('0x29')][_0x53cf('0x34')]){_0x46c60e[_0x53cf('0x32')]=_[_0x53cf('0x35')](_0x46c60e['where'],{'$or':_[_0x53cf('0x23')](_0x4dec0e,function(_0x37bea8){if(_0x37bea8[_0x53cf('0x26')]!==_0x53cf('0x36')){var _0x4527ac={};_0x4527ac[_0x37bea8['name']]={'$like':'%'+_0x479d1a[_0x53cf('0x29')][_0x53cf('0x34')]+'%'};return _0x4527ac;}})});}_0x46c60e=_[_0x53cf('0x35')]({},_0x46c60e,_0x479d1a[_0x53cf('0x37')]);var _0x377a36={'where':_0x46c60e[_0x53cf('0x32')]};return db['ChatTransferReport']['count'](_0x377a36)[_0x53cf('0x1e')](function(_0x1d79dc){_0x5586cc[_0x53cf('0x1a')]=_0x1d79dc;if(_0x479d1a[_0x53cf('0x29')][_0x53cf('0x38')]){_0x46c60e['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x53cf('0x39')](_0x46c60e);})[_0x53cf('0x1e')](function(_0x108a22){_0x5586cc['rows']=_0x108a22;return _0x5586cc;})[_0x53cf('0x1e')](respondWithFilteredResult(_0x410e98,_0x46c60e))[_0x53cf('0x3a')](handleError(_0x410e98,null));};exports[_0x53cf('0x3b')]=function(_0x17cb20,_0x43e588){var _0x27a4df={'raw':!![],'where':{'id':_0x17cb20['params']['id']}},_0x552931={};_0x552931[_0x53cf('0x28')]=_[_0x53cf('0x2a')](db[_0x53cf('0x3c')][_0x53cf('0x24')]);_0x552931[_0x53cf('0x29')]=_['keys'](_0x17cb20[_0x53cf('0x29')]);_0x552931[_0x53cf('0x2b')]=_[_0x53cf('0x2d')](_0x552931['model'],_0x552931['query']);_0x27a4df['attributes']=_['intersection'](_0x552931['model'],qs[_0x53cf('0x2e')](_0x17cb20[_0x53cf('0x29')][_0x53cf('0x2e')]));_0x27a4df[_0x53cf('0x2c')]=_0x27a4df[_0x53cf('0x2c')][_0x53cf('0x3d')]?_0x27a4df['attributes']:_0x552931[_0x53cf('0x28')];if(_0x17cb20[_0x53cf('0x29')][_0x53cf('0x38')]){_0x27a4df[_0x53cf('0x3e')]=[{'all':!![]}];}_0x27a4df=_[_0x53cf('0x35')]({},_0x27a4df,_0x17cb20[_0x53cf('0x37')]);return db[_0x53cf('0x3c')][_0x53cf('0x3f')](_0x27a4df)[_0x53cf('0x1e')](handleEntityNotFound(_0x43e588,null))[_0x53cf('0x1e')](respondWithResult(_0x43e588,null))[_0x53cf('0x3a')](handleError(_0x43e588,null));};exports[_0x53cf('0x40')]=function(_0x367c22,_0x2f7a4d){return db[_0x53cf('0x3c')]['create'](_0x367c22[_0x53cf('0x41')],{})[_0x53cf('0x1e')](respondWithResult(_0x2f7a4d,0xc9))['catch'](handleError(_0x2f7a4d,null));};exports[_0x53cf('0x1d')]=function(_0x2beb72,_0x87e272){if(_0x2beb72[_0x53cf('0x41')]['id']){delete _0x2beb72[_0x53cf('0x41')]['id'];}return db[_0x53cf('0x3c')]['find']({'where':{'id':_0x2beb72[_0x53cf('0x42')]['id']}})[_0x53cf('0x1e')](handleEntityNotFound(_0x87e272,null))[_0x53cf('0x1e')](saveUpdates(_0x2beb72[_0x53cf('0x41')],null))[_0x53cf('0x1e')](respondWithResult(_0x87e272,null))[_0x53cf('0x3a')](handleError(_0x87e272,null));};exports['destroy']=function(_0x51b661,_0x166a58){return db[_0x53cf('0x3c')][_0x53cf('0x3f')]({'where':{'id':_0x51b661['params']['id']}})[_0x53cf('0x1e')](handleEntityNotFound(_0x166a58,null))[_0x53cf('0x1e')](removeEntity(_0x166a58,null))[_0x53cf('0x3a')](handleError(_0x166a58,null));};exports['describe']=function(_0x42f826,_0x5c096c){return db[_0x53cf('0x3c')]['describe']()[_0x53cf('0x1e')](respondWithResult(_0x5c096c,null))['catch'](handleError(_0x5c096c,null));};
\ No newline at end of file
+var _0xa5eb=['apply','save','then','error','stack','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','name','query','keys','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set'];(function(_0x5a413c,_0x2d9f78){var _0x145472=function(_0x177721){while(--_0x177721){_0x5a413c['push'](_0x5a413c['shift']());}};_0x145472(++_0x2d9f78);}(_0xa5eb,0x1ae));var _0xba5e=function(_0x1832cd,_0x5015c4){_0x1832cd=_0x1832cd-0x0;var _0x46bf3b=_0xa5eb[_0x1832cd];return _0x46bf3b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xba5e('0x0'));var zipdir=require(_0xba5e('0x1'));var jsonpatch=require(_0xba5e('0x2'));var rp=require(_0xba5e('0x3'));var moment=require(_0xba5e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xba5e('0x5'));var util=require(_0xba5e('0x6'));var path=require(_0xba5e('0x7'));var sox=require(_0xba5e('0x8'));var csv=require('to-csv');var ejs=require(_0xba5e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xba5e('0xa'));var squel=require(_0xba5e('0xb'));var crypto=require(_0xba5e('0xc'));var jsforce=require(_0xba5e('0xd'));var deskjs=require(_0xba5e('0xe'));var toCsv=require(_0xba5e('0xf'));var querystring=require(_0xba5e('0x10'));var Papa=require('papaparse');var Redis=require(_0xba5e('0x11'));var authService=require(_0xba5e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xba5e('0x13'));var hardwareService=require(_0xba5e('0x14'));var logger=require('../../config/logger')(_0xba5e('0x15'));var utils=require('../../config/utils');var config=require(_0xba5e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xba5e('0x17'))['db'];function respondWithStatusCode(_0x50363f,_0x2966f4){_0x2966f4=_0x2966f4||0xcc;return function(_0x23cbcc){if(_0x23cbcc){return _0x50363f[_0xba5e('0x18')](_0x2966f4);}return _0x50363f[_0xba5e('0x19')](_0x2966f4)[_0xba5e('0x1a')]();};}function respondWithResult(_0x444908,_0x28c378){_0x28c378=_0x28c378||0xc8;return function(_0x543b11){if(_0x543b11){return _0x444908[_0xba5e('0x19')](_0x28c378)[_0xba5e('0x1b')](_0x543b11);}};}function respondWithFilteredResult(_0x8d3e0,_0x4fc979){return function(_0xc4e688){if(_0xc4e688){var _0x430e2e=typeof _0x4fc979[_0xba5e('0x1c')]===_0xba5e('0x1d')&&typeof _0x4fc979['limit']===_0xba5e('0x1d');var _0xae37df=_0xc4e688[_0xba5e('0x1e')];var _0x15c270=_0x430e2e?0x0:_0x4fc979[_0xba5e('0x1c')];var _0x2a2f2c=_0x430e2e?_0xc4e688[_0xba5e('0x1e')]:_0x4fc979[_0xba5e('0x1c')]+_0x4fc979['limit'];var _0x19ebbb;if(_0x2a2f2c>=_0xae37df){_0x2a2f2c=_0xae37df;_0x19ebbb=0xc8;}else{_0x19ebbb=0xce;}_0x8d3e0['status'](_0x19ebbb);return _0x8d3e0[_0xba5e('0x1f')]('Content-Range',_0x15c270+'-'+_0x2a2f2c+'/'+_0xae37df)[_0xba5e('0x1b')](_0xc4e688);}return null;};}function patchUpdates(_0x372d8f){return function(_0x4f7ac2){try{jsonpatch[_0xba5e('0x20')](_0x4f7ac2,_0x372d8f,!![]);}catch(_0x5f23a4){return BPromise['reject'](_0x5f23a4);}return _0x4f7ac2[_0xba5e('0x21')]();};}function saveUpdates(_0x6f3d1b,_0x24dbee){return function(_0x32bdf8){if(_0x32bdf8){return _0x32bdf8['update'](_0x6f3d1b)['then'](function(_0x21414a){return _0x21414a;});}return null;};}function removeEntity(_0x3cb6d3,_0x3cd348){return function(_0x241c27){if(_0x241c27){return _0x241c27['destroy']()[_0xba5e('0x22')](function(){_0x3cb6d3['status'](0xcc)[_0xba5e('0x1a')]();});}};}function handleEntityNotFound(_0x46ae09,_0x58ab56){return function(_0x3a027d){if(!_0x3a027d){_0x46ae09[_0xba5e('0x18')](0x194);}return _0x3a027d;};}function handleError(_0x561c4d,_0x4db62f){_0x4db62f=_0x4db62f||0x1f4;return function(_0xe1bf7f){logger[_0xba5e('0x23')](_0xe1bf7f[_0xba5e('0x24')]);if(_0xe1bf7f['name']){delete _0xe1bf7f['name'];}_0x561c4d['status'](_0x4db62f)[_0xba5e('0x25')](_0xe1bf7f);};}exports[_0xba5e('0x26')]=function(_0x4996b5,_0x1335e3){var _0x1b5f4a={},_0x33a72f={},_0x212ab6={'count':0x0,'rows':[]};var _0xbcd96=_[_0xba5e('0x27')](db[_0xba5e('0x28')][_0xba5e('0x29')],function(_0x4d0c9f){return{'name':_0x4d0c9f[_0xba5e('0x2a')],'type':_0x4d0c9f[_0xba5e('0x2b')][_0xba5e('0x2c')]};});_0x33a72f['model']=_[_0xba5e('0x27')](_0xbcd96,_0xba5e('0x2d'));_0x33a72f[_0xba5e('0x2e')]=_[_0xba5e('0x2f')](_0x4996b5[_0xba5e('0x2e')]);_0x33a72f['filters']=_[_0xba5e('0x30')](_0x33a72f[_0xba5e('0x31')],_0x33a72f['query']);_0x1b5f4a[_0xba5e('0x32')]=_[_0xba5e('0x30')](_0x33a72f[_0xba5e('0x31')],qs[_0xba5e('0x33')](_0x4996b5['query'][_0xba5e('0x33')]));_0x1b5f4a[_0xba5e('0x32')]=_0x1b5f4a[_0xba5e('0x32')][_0xba5e('0x34')]?_0x1b5f4a[_0xba5e('0x32')]:_0x33a72f['model'];if(!_0x4996b5[_0xba5e('0x2e')]['hasOwnProperty'](_0xba5e('0x35'))){_0x1b5f4a[_0xba5e('0x36')]=qs[_0xba5e('0x36')](_0x4996b5[_0xba5e('0x2e')][_0xba5e('0x36')]);_0x1b5f4a[_0xba5e('0x1c')]=qs[_0xba5e('0x1c')](_0x4996b5[_0xba5e('0x2e')][_0xba5e('0x1c')]);}_0x1b5f4a[_0xba5e('0x37')]=qs[_0xba5e('0x38')](_0x4996b5[_0xba5e('0x2e')][_0xba5e('0x38')]);_0x1b5f4a[_0xba5e('0x39')]=qs[_0xba5e('0x3a')](_[_0xba5e('0x3b')](_0x4996b5[_0xba5e('0x2e')],_0x33a72f['filters']),_0xbcd96);if(_0x4996b5[_0xba5e('0x2e')][_0xba5e('0x3c')]){_0x1b5f4a[_0xba5e('0x39')]=_[_0xba5e('0x3d')](_0x1b5f4a['where'],{'$or':_['map'](_0xbcd96,function(_0x1278aa){if(_0x1278aa[_0xba5e('0x2b')]!==_0xba5e('0x3e')){var _0x55f5cb={};_0x55f5cb[_0x1278aa['name']]={'$like':'%'+_0x4996b5[_0xba5e('0x2e')][_0xba5e('0x3c')]+'%'};return _0x55f5cb;}})});}_0x1b5f4a=_[_0xba5e('0x3d')]({},_0x1b5f4a,_0x4996b5[_0xba5e('0x3f')]);var _0x6ac2ee={'where':_0x1b5f4a[_0xba5e('0x39')]};return db[_0xba5e('0x28')][_0xba5e('0x1e')](_0x6ac2ee)[_0xba5e('0x22')](function(_0x1a5a56){_0x212ab6[_0xba5e('0x1e')]=_0x1a5a56;if(_0x4996b5[_0xba5e('0x2e')][_0xba5e('0x40')]){_0x1b5f4a[_0xba5e('0x41')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xba5e('0x42')](_0x1b5f4a);})[_0xba5e('0x22')](function(_0x575af2){_0x212ab6[_0xba5e('0x43')]=_0x575af2;return _0x212ab6;})[_0xba5e('0x22')](respondWithFilteredResult(_0x1335e3,_0x1b5f4a))[_0xba5e('0x44')](handleError(_0x1335e3,null));};exports[_0xba5e('0x45')]=function(_0x485750,_0x3d3d5d){var _0x100d70={'raw':!![],'where':{'id':_0x485750[_0xba5e('0x46')]['id']}},_0x1a38a4={};_0x1a38a4['model']=_[_0xba5e('0x2f')](db[_0xba5e('0x28')][_0xba5e('0x29')]);_0x1a38a4[_0xba5e('0x2e')]=_['keys'](_0x485750['query']);_0x1a38a4[_0xba5e('0x3a')]=_['intersection'](_0x1a38a4[_0xba5e('0x31')],_0x1a38a4[_0xba5e('0x2e')]);_0x100d70[_0xba5e('0x32')]=_['intersection'](_0x1a38a4[_0xba5e('0x31')],qs[_0xba5e('0x33')](_0x485750['query'][_0xba5e('0x33')]));_0x100d70[_0xba5e('0x32')]=_0x100d70[_0xba5e('0x32')]['length']?_0x100d70[_0xba5e('0x32')]:_0x1a38a4[_0xba5e('0x31')];if(_0x485750[_0xba5e('0x2e')][_0xba5e('0x40')]){_0x100d70[_0xba5e('0x41')]=[{'all':!![]}];}_0x100d70=_[_0xba5e('0x3d')]({},_0x100d70,_0x485750[_0xba5e('0x3f')]);return db[_0xba5e('0x28')][_0xba5e('0x47')](_0x100d70)[_0xba5e('0x22')](handleEntityNotFound(_0x3d3d5d,null))['then'](respondWithResult(_0x3d3d5d,null))[_0xba5e('0x44')](handleError(_0x3d3d5d,null));};exports[_0xba5e('0x48')]=function(_0x359d54,_0xc87e74){return db[_0xba5e('0x28')][_0xba5e('0x48')](_0x359d54['body'],{})[_0xba5e('0x22')](respondWithResult(_0xc87e74,0xc9))[_0xba5e('0x44')](handleError(_0xc87e74,null));};exports[_0xba5e('0x49')]=function(_0x4baddd,_0x571316){if(_0x4baddd[_0xba5e('0x4a')]['id']){delete _0x4baddd['body']['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x4baddd[_0xba5e('0x46')]['id']}})[_0xba5e('0x22')](handleEntityNotFound(_0x571316,null))[_0xba5e('0x22')](saveUpdates(_0x4baddd['body'],null))[_0xba5e('0x22')](respondWithResult(_0x571316,null))[_0xba5e('0x44')](handleError(_0x571316,null));};exports[_0xba5e('0x4b')]=function(_0x37d11c,_0x50b476){return db['ChatTransferReport'][_0xba5e('0x47')]({'where':{'id':_0x37d11c[_0xba5e('0x46')]['id']}})['then'](handleEntityNotFound(_0x50b476,null))[_0xba5e('0x22')](removeEntity(_0x50b476,null))[_0xba5e('0x44')](handleError(_0x50b476,null));};exports[_0xba5e('0x4c')]=function(_0x4e81ab,_0x486568){return db[_0xba5e('0x28')][_0xba5e('0x4c')]()[_0xba5e('0x22')](respondWithResult(_0x486568,null))[_0xba5e('0x44')](handleError(_0x486568,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index a38ed22..9fa8938 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 _0xe0a3=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./chatTransferReport.attributes','exports'];(function(_0x4cbf22,_0x2c4b7e){var _0x517c08=function(_0x428735){while(--_0x428735){_0x4cbf22['push'](_0x4cbf22['shift']());}};_0x517c08(++_0x2c4b7e);}(_0xe0a3,0x1bf));var _0x3e0a=function(_0xb66df,_0x4fb5ce){_0xb66df=_0xb66df-0x0;var _0x42a702=_0xe0a3[_0xb66df];return _0x42a702;};'use strict';var _=require(_0x3e0a('0x0'));var util=require(_0x3e0a('0x1'));var logger=require(_0x3e0a('0x2'))(_0x3e0a('0x3'));var moment=require(_0x3e0a('0x4'));var BPromise=require(_0x3e0a('0x5'));var rp=require(_0x3e0a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3e0a('0x7'));module[_0x3e0a('0x8')]=function(_0x373be0,_0x5c7a1f){return _0x373be0['define'](_0x3e0a('0x9'),attributes,{'tableName':_0x3e0a('0xa'),'paranoid':![],'indexes':[{'name':_0x3e0a('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4258=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','ChatTransferReport','report_chat_transfer','uniqueid'];(function(_0x4259a3,_0x2f9e82){var _0x5dfed4=function(_0x443519){while(--_0x443519){_0x4259a3['push'](_0x4259a3['shift']());}};_0x5dfed4(++_0x2f9e82);}(_0x4258,0x198));var _0x8425=function(_0x42da91,_0x337a6d){_0x42da91=_0x42da91-0x0;var _0xeef503=_0x4258[_0x42da91];return _0xeef503;};'use strict';var _=require(_0x8425('0x0'));var util=require('util');var logger=require(_0x8425('0x1'))(_0x8425('0x2'));var moment=require(_0x8425('0x3'));var BPromise=require(_0x8425('0x4'));var rp=require(_0x8425('0x5'));var fs=require('fs');var path=require(_0x8425('0x6'));var rimraf=require(_0x8425('0x7'));var config=require(_0x8425('0x8'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x56b3e9,_0x5a87c4){return _0x56b3e9['define'](_0x8425('0x9'),attributes,{'tableName':_0x8425('0xa'),'paranoid':![],'indexes':[{'name':_0x8425('0xb'),'fields':[_0x8425('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 975d41e..de9d1f4 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 _0x92e3=['ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x92e3,0x15d));var _0x392e=function(_0x1fe3ff,_0x4ba5b7){_0x1fe3ff=_0x1fe3ff-0x0;var _0x11b4f2=_0x92e3[_0x1fe3ff];return _0x11b4f2;};'use strict';var _=require('lodash');var util=require(_0x392e('0x0'));var moment=require(_0x392e('0x1'));var BPromise=require(_0x392e('0x2'));var rs=require(_0x392e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x392e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x392e('0x5'))('rpc');var config=require(_0x392e('0x6'));var jayson=require(_0x392e('0x7'));var client=jayson['client'][_0x392e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x36abc4,_0xb14b69,_0x3b20bb){return new BPromise(function(_0x48c77e,_0x14ca70){return client['request'](_0x36abc4,_0x3b20bb)[_0x392e('0x9')](function(_0x3139a5){logger[_0x392e('0xa')](_0x392e('0xb'),_0xb14b69,'request\x20sent');logger['debug'](_0x392e('0xc'),_0xb14b69,_0x392e('0xd'),JSON[_0x392e('0xe')](_0x3139a5));if(_0x3139a5['error']){if(_0x3139a5[_0x392e('0xf')][_0x392e('0x10')]===0x1f4){logger[_0x392e('0xf')](_0x392e('0xb'),_0xb14b69,_0x3139a5[_0x392e('0xf')][_0x392e('0x11')]);return _0x14ca70(_0x3139a5[_0x392e('0xf')][_0x392e('0x11')]);}logger[_0x392e('0xf')](_0x392e('0xb'),_0xb14b69,_0x3139a5[_0x392e('0xf')][_0x392e('0x11')]);return _0x48c77e(_0x3139a5[_0x392e('0xf')]['message']);}else{logger[_0x392e('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0xb14b69,_0x392e('0xd'));_0x48c77e(_0x3139a5[_0x392e('0x12')][_0x392e('0x11')]);}})[_0x392e('0x13')](function(_0x3b6e11){logger[_0x392e('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0xb14b69,_0x3b6e11);_0x14ca70(_0x3b6e11);});});}
\ No newline at end of file
+var _0xfb0c=['ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x55cd92,_0x2af5b1){var _0x102822=function(_0x49ef9a){while(--_0x49ef9a){_0x55cd92['push'](_0x55cd92['shift']());}};_0x102822(++_0x2af5b1);}(_0xfb0c,0xa7));var _0xcfb0=function(_0x2978a2,_0x462bb8){_0x2978a2=_0x2978a2-0x0;var _0x3e21c8=_0xfb0c[_0x2978a2];return _0x3e21c8;};'use strict';var _=require(_0xcfb0('0x0'));var util=require(_0xcfb0('0x1'));var moment=require('moment');var BPromise=require(_0xcfb0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcfb0('0x3'));var db=require(_0xcfb0('0x4'))['db'];var utils=require(_0xcfb0('0x5'));var logger=require(_0xcfb0('0x6'))(_0xcfb0('0x7'));var config=require('../../config/environment');var jayson=require(_0xcfb0('0x8'));var client=jayson[_0xcfb0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20b294,_0x5c27bf,_0x4edda1){return new BPromise(function(_0x122f09,_0x42269){return client[_0xcfb0('0xa')](_0x20b294,_0x4edda1)['then'](function(_0x246a8e){logger['info'](_0xcfb0('0xb'),_0x5c27bf,_0xcfb0('0xc'));logger['debug'](_0xcfb0('0xd'),_0x5c27bf,_0xcfb0('0xc'),JSON[_0xcfb0('0xe')](_0x246a8e));if(_0x246a8e[_0xcfb0('0xf')]){if(_0x246a8e[_0xcfb0('0xf')][_0xcfb0('0x10')]===0x1f4){logger['error'](_0xcfb0('0xb'),_0x5c27bf,_0x246a8e[_0xcfb0('0xf')][_0xcfb0('0x11')]);return _0x42269(_0x246a8e[_0xcfb0('0xf')]['message']);}logger[_0xcfb0('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x5c27bf,_0x246a8e[_0xcfb0('0xf')][_0xcfb0('0x11')]);return _0x122f09(_0x246a8e['error'][_0xcfb0('0x11')]);}else{logger[_0xcfb0('0x12')](_0xcfb0('0xb'),_0x5c27bf,_0xcfb0('0xc'));_0x122f09(_0x246a8e[_0xcfb0('0x13')]['message']);}})['catch'](function(_0xb110ed){logger[_0xcfb0('0xf')](_0xcfb0('0xb'),_0x5c27bf,_0xb110ed);_0x42269(_0xb110ed);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index f490ecd..055bc0e 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 _0x8c17=['create','put','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show'];(function(_0x4829dd,_0x50391e){var _0x353a08=function(_0x210fc0){while(--_0x210fc0){_0x4829dd['push'](_0x4829dd['shift']());}};_0x353a08(++_0x50391e);}(_0x8c17,0xd7));var _0x78c1=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x8c17[_0x138adb];return _0x1b27f2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x78c1('0x0'));var timeout=require(_0x78c1('0x1'));var express=require(_0x78c1('0x2'));var router=express[_0x78c1('0x3')]();var fs_extra=require(_0x78c1('0x4'));var auth=require(_0x78c1('0x5'));var interaction=require(_0x78c1('0x6'));var config=require(_0x78c1('0x7'));var controller=require(_0x78c1('0x8'));router[_0x78c1('0x9')]('/',auth['isAuthenticated'](),controller[_0x78c1('0xa')]);router[_0x78c1('0x9')](_0x78c1('0xb'),auth['isAuthenticated'](),controller[_0x78c1('0xc')]);router[_0x78c1('0x9')](_0x78c1('0xd'),auth[_0x78c1('0xe')](),controller[_0x78c1('0xf')]);router['post']('/',auth[_0x78c1('0xe')](),controller[_0x78c1('0x10')]);router[_0x78c1('0x11')](_0x78c1('0xd'),auth[_0x78c1('0xe')](),controller[_0x78c1('0x12')]);router['delete'](_0x78c1('0xd'),auth[_0x78c1('0xe')](),controller[_0x78c1('0x13')]);module[_0x78c1('0x14')]=router;
\ No newline at end of file
+var _0xf00d=['get','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller'];(function(_0xec9d8a,_0x3d89cd){var _0x4f3496=function(_0x1acbdc){while(--_0x1acbdc){_0xec9d8a['push'](_0xec9d8a['shift']());}};_0x4f3496(++_0x3d89cd);}(_0xf00d,0x1ce));var _0xdf00=function(_0x3efadf,_0x364aa4){_0x3efadf=_0x3efadf-0x0;var _0x1d1e97=_0xf00d[_0x3efadf];return _0x1d1e97;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdf00('0x0'));var timeout=require(_0xdf00('0x1'));var express=require('express');var router=express[_0xdf00('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xdf00('0x3'));var interaction=require(_0xdf00('0x4'));var config=require('../../config/environment');var controller=require(_0xdf00('0x5'));router[_0xdf00('0x6')]('/',auth['isAuthenticated'](),controller[_0xdf00('0x7')]);router[_0xdf00('0x6')](_0xdf00('0x8'),auth[_0xdf00('0x9')](),controller[_0xdf00('0xa')]);router[_0xdf00('0x6')](_0xdf00('0xb'),auth[_0xdf00('0x9')](),controller[_0xdf00('0xc')]);router['post']('/',auth[_0xdf00('0x9')](),controller[_0xdf00('0xd')]);router[_0xdf00('0xe')](_0xdf00('0xb'),auth[_0xdf00('0x9')](),controller[_0xdf00('0xf')]);router['delete'](_0xdf00('0xb'),auth[_0xdf00('0x9')](),controller[_0xdf00('0x10')]);module[_0xdf00('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 99c508c..b49e034 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 _0xda55=['alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star','stringify','input','text','getDataValue','onlineForm','parse','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT'];(function(_0x3f6e27,_0x188bd7){var _0x2ab5e6=function(_0x3a21b5){while(--_0x3a21b5){_0x3f6e27['push'](_0x3f6e27['shift']());}};_0x2ab5e6(++_0x188bd7);}(_0xda55,0x6d));var _0x5da5=function(_0x15a34f,_0x1378ba){_0x15a34f=_0x15a34f-0x0;var _0x2e7b6b=_0xda55[_0x15a34f];return _0x2e7b6b;};'use strict';var Sequelize=require(_0x5da5('0x0'));var rs=require(_0x5da5('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x5da5('0x2')],'allowNull':![],'unique':_0x5da5('0x3')},'description':{'type':Sequelize[_0x5da5('0x2')]},'mapKey':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':_0x5da5('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x5da5('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x5da5('0x2')],'allowNull':![],'defaultValue':_0x5da5('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x5da5('0x2')],'allowNull':![],'defaultValue':_0x5da5('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x5da5('0x2')],'allowNull':![],'defaultValue':_0x5da5('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x5da5('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x5da5('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x5da5('0x2')]},'animation':{'type':Sequelize[_0x5da5('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x5da5('0x9')](_0x5da5('0xa'),_0x5da5('0xb')),'defaultValue':_0x5da5('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x5da5('0xc')},'start_chat_button':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':_0x5da5('0xd')},'header_offline':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':_0x5da5('0xe')},'download_transcript':{'type':Sequelize[_0x5da5('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x5da5('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x5da5('0xf')]},'closingQuestion':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':_0x5da5('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':_0x5da5('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':_0x5da5('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x5da5('0x13')},'placeholderMessage':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':_0x5da5('0x14')},'closingMessage':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':_0x5da5('0x15')},'closingMessageButton':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':_0x5da5('0x16')},'conditionAgreement':{'type':Sequelize[_0x5da5('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x5da5('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x5da5('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':_0x5da5('0x17')},'ratingType':{'type':Sequelize[_0x5da5('0x9')]('star',_0x5da5('0x18')),'defaultValue':_0x5da5('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x5da5('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x5da5('0xf')],'defaultValue':function(){return JSON[_0x5da5('0x1a')]({'items':[{'type':_0x5da5('0x1b'),'variable':null,'config':{'placeholder':'name','type':_0x5da5('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x5da5('0x1b'),'props':{'title':_0x5da5('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x5da5('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x5da5('0x1d')](_0x5da5('0x1e'))?JSON[_0x5da5('0x1f')](this[_0x5da5('0x1d')]('onlineForm')):{};},'set':function(_0x5b0b43){return this['setDataValue'](_0x5da5('0x1e'),JSON['stringify'](_0x5b0b43));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x5da5('0x1a')]({'items':[{'type':_0x5da5('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x5da5('0x4'),'type':_0x5da5('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x5da5('0x20')},'props':{'title':_0x5da5('0x20'),'helpText':_0x5da5('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x5da5('0x1d')](_0x5da5('0x22'))?JSON['parse'](this[_0x5da5('0x1d')](_0x5da5('0x22'))):{};},'set':function(_0x31cb5f){return this[_0x5da5('0x23')]('offlineForm',JSON['stringify'](_0x31cb5f));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x5da5('0x24')]();}},'autoclose':{'type':Sequelize[_0x5da5('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x5da5('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x5da5('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x5da5('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':_0x5da5('0x25')},'offlineMessageBody':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':_0x5da5('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x5da5('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':_0x5da5('0x27')},'skipUnmanaged':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x5da5('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x5da5('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x5da5('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x5da5('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x5da5('0x2')]},'notificationTemplate':{'type':Sequelize[_0x5da5('0xf')],'defaultValue':function(){return _0x5da5('0x28');}},'notificationSound':{'type':Sequelize[_0x5da5('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5da5('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x5da5('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':_0x5da5('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x5da5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x5da5('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':_0x5da5('0x2b')},'messagesAlignment':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':_0x5da5('0x2c')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x5da5('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x5da5('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x5da5('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5da5('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x5da5('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5da5('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5da5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x5da5('0x2')],'defaultValue':_0x5da5('0x2e')},'systemAvatar':{'type':Sequelize[_0x5da5('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5da5('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5da5('0x8')],'defaultValue':![],'comment':_0x5da5('0x2f'),'set':function(_0x14c3f5){if(!_0x14c3f5)this[_0x5da5('0x23')](_0x5da5('0x30'),null);this['setDataValue'](_0x5da5('0x31'),_0x14c3f5);}},'vidaooEscalation':{'type':Sequelize[_0x5da5('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x5da5('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x5da5('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x5da5('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x5da5('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x5da5('0xf')]}};
\ No newline at end of file
+var _0xa74f=['Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','address','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Feedback','star','TEXT','stringify','input','name','getDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion'];(function(_0x3f25db,_0x1d3686){var _0x54f29d=function(_0x2963bb){while(--_0x2963bb){_0x3f25db['push'](_0x3f25db['shift']());}};_0x54f29d(++_0x1d3686);}(_0xa74f,0x9a));var _0xfa74=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0xa74f[_0x207811];return _0x170d56;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xfa74('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfa74('0x1')},'description':{'type':Sequelize[_0xfa74('0x2')]},'mapKey':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xfa74('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xfa74('0x4')},'customerAlias':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfa74('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xfa74('0x9')]('rounded',_0xfa74('0xa')),'defaultValue':_0xfa74('0xb')},'header_online':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xfa74('0xd')},'offline_chat_button':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0xe')},'header_offline':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x12')},'noteTitle':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x13')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0xe')},'skipMessageButton':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x14')},'ratingType':{'type':Sequelize[_0xfa74('0x9')]('star','thumb'),'defaultValue':_0xfa74('0x15')},'ratingStarsNumber':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xfa74('0x16')],'defaultValue':function(){return JSON[_0xfa74('0x17')]({'items':[{'type':_0xfa74('0x18'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0xfa74('0x19'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xfa74('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xfa74('0x1a')](_0xfa74('0x1b'))?JSON['parse'](this['getDataValue'](_0xfa74('0x1b'))):{};},'set':function(_0xeb6c11){return this['setDataValue'](_0xfa74('0x1b'),JSON['stringify'](_0xeb6c11));}},'offlineForm':{'type':Sequelize[_0xfa74('0x16')],'defaultValue':function(){return JSON[_0xfa74('0x17')]({'items':[{'type':'input','props':{'title':_0xfa74('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xfa74('0x3'),'type':_0xfa74('0x3')},'variable':null},{'type':_0xfa74('0x1c'),'config':{'placeholder':'Comments'},'props':{'title':_0xfa74('0x1d'),'helpText':_0xfa74('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0xfa74('0x1a')]('offlineForm')?JSON['parse'](this[_0xfa74('0x1a')](_0xfa74('0x1f'))):{};},'set':function(_0x5df5cd){return this['setDataValue'](_0xfa74('0x1f'),JSON['stringify'](_0x5df5cd));}},'token':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xfa74('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xfa74('0x2')]},'waitingTitle':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x20')},'waitingMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x21')},'offlineMessageSubject':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x22')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xfa74('0x23')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x24')},'skipUnmanaged':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x25')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xfa74('0x16')]},'showAgentAvatar':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xfa74('0x16')],'defaultValue':function(){return _0xfa74('0x26');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xfa74('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x27')},'verticalAlignment':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x28')},'messagesAlignment':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x29')},'defaultTitle':{'type':Sequelize[_0xfa74('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfa74('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfa74('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x2b')},'systemAvatar':{'type':Sequelize[_0xfa74('0x16')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xfa74('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![],'comment':_0xfa74('0x2d'),'set':function(_0x35f252){if(!_0x35f252)this['setDataValue'](_0xfa74('0x2e'),null);this[_0xfa74('0x2f')](_0xfa74('0x30'),_0x35f252);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x31')},'vidaooNote':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':function(){return _0xfa74('0x32');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xfa74('0x16')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index ce04604..e0ba382 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 _0x1c60=['x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','transaction','Transaction','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','removeAgents','userChatWebsite:remove','emit','getAgents','bluebird','mustache','util','fs-extra','lodash','querystring','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','end','json','offset','undefined','limit','count','Content-Range','update','get','UserProfileResource','destroy','sendStatus','stack','name','send','index','ChatWebsite','rawAttributes','fieldName','key','model','map','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','type','VIRTUAL','options','rows','params','Pause','mandatoryDispositionPause','keys','intersection','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','userProfileId','describe','addDisposition','Disposition','filter','findAll','ids','addAnswer','ChatWebsiteId','getAnswers','findOne','CannedAnswer','pick','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','download','getAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','getResult','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','DESC','ChatApplication','Applications','List','account','applications','list','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','Start','startRouting','EventManager','notify','offline','files','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','ListId','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','toPairsIn','email','MailAccountId','NotifyMailAccount','notifyMail','remove','addInteraction','omit','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','timezone','No\x20timezone','inspect','Interval','Intervals','virtual','License','increment','chatLicenseExceeded','all','server/files/chat/iframe.ejs','origin'];(function(_0x153810,_0x4b3117){var _0x3df31a=function(_0x239357){while(--_0x239357){_0x153810['push'](_0x153810['shift']());}};_0x3df31a(++_0x4b3117);}(_0x1c60,0x145));var _0x01c6=function(_0x3a166a,_0x2018be){_0x3a166a=_0x3a166a-0x0;var _0x1b0279=_0x1c60[_0x3a166a];return _0x1b0279;};'use strict';var BPromise=require(_0x01c6('0x0'));var Mustache=require(_0x01c6('0x1'));var util=require(_0x01c6('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x01c6('0x3'));var _=require(_0x01c6('0x4'));var querystring=require(_0x01c6('0x5'));var Redis=require(_0x01c6('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x01c6('0x7'))(_0x01c6('0x8'));var config=require(_0x01c6('0x9'));var url=require('url');var db=require(_0x01c6('0xa'))['db'];config[_0x01c6('0xb')]=_[_0x01c6('0xc')](config[_0x01c6('0xb')],{'host':_0x01c6('0xd'),'port':0x18eb});var socket=require(_0x01c6('0xe'))(new Redis(config[_0x01c6('0xb')]));require(_0x01c6('0xf'))['register'](socket);var htmlToText=require(_0x01c6('0x10'));var jayson=require('jayson/promise');var client=jayson['client'][_0x01c6('0x11')]({'port':0x232c});var client9002=jayson[_0x01c6('0x12')][_0x01c6('0x11')]({'port':0x232a});var client9003=jayson[_0x01c6('0x12')]['http']({'port':0x232b});var client9001=jayson[_0x01c6('0x12')][_0x01c6('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x1826c4,_0xf701b5,_0x51ae53,_0x29016f){return new BPromise(function(_0x307d30,_0x504f96){var _0x555fb6=_0x29016f||client;return _0x555fb6[_0x01c6('0x13')](_0x1826c4,_0x51ae53)[_0x01c6('0x14')](function(_0x460d78){logger[_0x01c6('0x15')](_0x01c6('0x16'),_0xf701b5,_0x01c6('0x17'));logger['debug'](_0x01c6('0x18'),_0xf701b5,_0x01c6('0x17'),JSON['stringify'](_0x460d78));if(_0x460d78[_0x01c6('0x19')]){if(_0x460d78[_0x01c6('0x19')][_0x01c6('0x1a')]===0x1f4){logger[_0x01c6('0x19')]('ChatWebsite,\x20%s,\x20%s',_0xf701b5,_0x460d78[_0x01c6('0x19')][_0x01c6('0x1b')]);return _0x504f96(_0x460d78[_0x01c6('0x19')][_0x01c6('0x1b')]);}logger[_0x01c6('0x19')](_0x01c6('0x16'),_0xf701b5,_0x460d78[_0x01c6('0x19')][_0x01c6('0x1b')]);return _0x307d30(_0x460d78[_0x01c6('0x19')]['message']);}else{logger[_0x01c6('0x15')](_0x01c6('0x16'),_0xf701b5,'request\x20sent');_0x307d30(_0x460d78['result'][_0x01c6('0x1b')]);}})[_0x01c6('0x1c')](function(_0x55e8e0){logger[_0x01c6('0x19')](_0x01c6('0x16'),_0xf701b5,_0x55e8e0);_0x504f96(_0x55e8e0);});});}function respondWithStatusCode(_0x3a2ea8,_0x286511){_0x286511=_0x286511||0xcc;return function(_0x5f9bd){if(_0x5f9bd){return _0x3a2ea8['sendStatus'](_0x286511);}return _0x3a2ea8[_0x01c6('0x1d')](_0x286511)[_0x01c6('0x1e')]();};}function respondWithResult(_0xce16d2,_0x7d5f0f){_0x7d5f0f=_0x7d5f0f||0xc8;return function(_0x5037c0){if(_0x5037c0){return _0xce16d2[_0x01c6('0x1d')](_0x7d5f0f)[_0x01c6('0x1f')](_0x5037c0);}};}function respondWithFilteredResult(_0x126eeb,_0x3d2ff0){return function(_0x57c376){if(_0x57c376){var _0xff3973=typeof _0x3d2ff0[_0x01c6('0x20')]===_0x01c6('0x21')&&typeof _0x3d2ff0[_0x01c6('0x22')]===_0x01c6('0x21');var _0x5d3076=_0x57c376[_0x01c6('0x23')];var _0x7dbc18=_0xff3973?0x0:_0x3d2ff0[_0x01c6('0x20')];var _0x566ffc=_0xff3973?_0x57c376[_0x01c6('0x23')]:_0x3d2ff0[_0x01c6('0x20')]+_0x3d2ff0[_0x01c6('0x22')];var _0x5337f8;if(_0x566ffc>=_0x5d3076){_0x566ffc=_0x5d3076;_0x5337f8=0xc8;}else{_0x5337f8=0xce;}_0x126eeb[_0x01c6('0x1d')](_0x5337f8);return _0x126eeb['set'](_0x01c6('0x24'),_0x7dbc18+'-'+_0x566ffc+'/'+_0x5d3076)[_0x01c6('0x1f')](_0x57c376);}return null;};}function saveUpdates(_0x5c11d1){return function(_0x3a8a21){if(_0x3a8a21){return _0x3a8a21[_0x01c6('0x25')](_0x5c11d1)[_0x01c6('0x14')](function(_0x41fdc1){return _0x41fdc1;});}return null;};}function removeEntity(_0x3ece58){return function(_0xa5ae44){if(_0xa5ae44){return _0xa5ae44['destroy']()[_0x01c6('0x14')](function(){var _0x59f600=_0xa5ae44[_0x01c6('0x26')]({'plain':!![]});var _0x5c81d1='ChatWebsites';return db[_0x01c6('0x27')][_0x01c6('0x28')]({'where':{'type':_0x5c81d1,'resourceId':_0x59f600['id']}})[_0x01c6('0x14')](function(){return _0xa5ae44;});})[_0x01c6('0x14')](function(){_0x3ece58['status'](0xcc)[_0x01c6('0x1e')]();});}};}function handleEntityNotFound(_0x114da6){return function(_0x13ccff){if(!_0x13ccff){_0x114da6[_0x01c6('0x29')](0x194);}return _0x13ccff;};}function handleError(_0x20584e,_0x817ce3){_0x817ce3=_0x817ce3||0x1f4;return function(_0x34a011){logger[_0x01c6('0x19')](_0x34a011[_0x01c6('0x2a')]);if(_0x34a011[_0x01c6('0x2b')]){delete _0x34a011[_0x01c6('0x2b')];}_0x20584e[_0x01c6('0x1d')](_0x817ce3)[_0x01c6('0x2c')](_0x34a011);};}exports[_0x01c6('0x2d')]=function(_0xeb05c,_0x480985){var _0x3de85c={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x42e851={},_0x200b31={'count':0x0,'rows':[]};var _0x207bc6=_['map'](db[_0x01c6('0x2e')][_0x01c6('0x2f')],function(_0x5c57b9){return{'name':_0x5c57b9[_0x01c6('0x30')],'type':_0x5c57b9['type'][_0x01c6('0x31')]};});_0x42e851[_0x01c6('0x32')]=_[_0x01c6('0x33')](_0x207bc6,_0x01c6('0x2b'));_0x42e851[_0x01c6('0x34')]=_['keys'](_0xeb05c[_0x01c6('0x34')]);_0x42e851['filters']=_['intersection'](_0x42e851['model'],_0x42e851[_0x01c6('0x34')]);_0x3de85c[_0x01c6('0x35')]=_['intersection'](_0x42e851[_0x01c6('0x32')],qs[_0x01c6('0x36')](_0xeb05c[_0x01c6('0x34')][_0x01c6('0x36')]));_0x3de85c[_0x01c6('0x35')]=_0x3de85c[_0x01c6('0x35')][_0x01c6('0x37')]?_0x3de85c['attributes']:_0x42e851['model'];if(!_0xeb05c[_0x01c6('0x34')][_0x01c6('0x38')](_0x01c6('0x39'))){_0x3de85c[_0x01c6('0x22')]=qs[_0x01c6('0x22')](_0xeb05c['query'][_0x01c6('0x22')]);_0x3de85c['offset']=qs['offset'](_0xeb05c['query'][_0x01c6('0x20')]);}_0x3de85c[_0x01c6('0x3a')]=qs['sort'](_0xeb05c[_0x01c6('0x34')][_0x01c6('0x3b')]);_0x3de85c['where']=qs[_0x01c6('0x3c')](_['pick'](_0xeb05c['query'],_0x42e851[_0x01c6('0x3c')]),_0x207bc6);if(_0xeb05c[_0x01c6('0x34')]['filter']){_0x3de85c[_0x01c6('0x3d')]=_[_0x01c6('0x3e')](_0x3de85c[_0x01c6('0x3d')],{'$or':_[_0x01c6('0x33')](_0x207bc6,function(_0x15ddb3){if(_0x15ddb3[_0x01c6('0x3f')]!==_0x01c6('0x40')){var _0x5ad96={};_0x5ad96[_0x15ddb3[_0x01c6('0x2b')]]={'$like':'%'+_0xeb05c[_0x01c6('0x34')]['filter']+'%'};return _0x5ad96;}})});}_0x3de85c=_[_0x01c6('0x3e')]({},_0x3de85c,_0xeb05c[_0x01c6('0x41')]);var _0x8b8e63={'where':_0x3de85c[_0x01c6('0x3d')]};return db['ChatWebsite']['count'](_0x8b8e63)[_0x01c6('0x14')](function(_0x31687c){_0x200b31[_0x01c6('0x23')]=_0x31687c;if(_0xeb05c['query']['includeAll']){_0x3de85c['include']=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x3de85c);})[_0x01c6('0x14')](function(_0x12296c){_0x200b31[_0x01c6('0x42')]=_0x12296c;return _0x200b31;})[_0x01c6('0x14')](respondWithFilteredResult(_0x480985,_0x3de85c))['catch'](handleError(_0x480985,null));};exports['show']=function(_0x2a1631,_0xb3a8dd){var _0x34a96c={'raw':![],'where':{'id':_0x2a1631[_0x01c6('0x43')]['id']},'include':[{'model':db[_0x01c6('0x44')],'as':_0x01c6('0x45')}]},_0x39741a={};_0x39741a['model']=_[_0x01c6('0x46')](db[_0x01c6('0x2e')][_0x01c6('0x2f')]);_0x39741a[_0x01c6('0x34')]=_['keys'](_0x2a1631[_0x01c6('0x34')]);_0x39741a[_0x01c6('0x3c')]=_['intersection'](_0x39741a[_0x01c6('0x32')],_0x39741a['query']);_0x34a96c[_0x01c6('0x35')]=_[_0x01c6('0x47')](_0x39741a[_0x01c6('0x32')],qs[_0x01c6('0x36')](_0x2a1631[_0x01c6('0x34')][_0x01c6('0x36')]));_0x34a96c[_0x01c6('0x35')]=_0x34a96c[_0x01c6('0x35')]['length']?_0x34a96c[_0x01c6('0x35')]:_0x39741a['model'];if(_0x2a1631[_0x01c6('0x34')][_0x01c6('0x48')]){_0x34a96c[_0x01c6('0x49')]=[{'all':!![]}];}_0x34a96c=_[_0x01c6('0x3e')]({},_0x34a96c,_0x2a1631[_0x01c6('0x41')]);return db[_0x01c6('0x2e')][_0x01c6('0x4a')](_0x34a96c)[_0x01c6('0x14')](handleEntityNotFound(_0xb3a8dd,null))[_0x01c6('0x14')](respondWithResult(_0xb3a8dd,null))[_0x01c6('0x1c')](handleError(_0xb3a8dd,null));};exports[_0x01c6('0x4b')]=function(_0x9ffa2e,_0x1be4b3){return db[_0x01c6('0x2e')][_0x01c6('0x4b')](_0x9ffa2e[_0x01c6('0x4c')],{})['then'](function(_0x33c137){var _0x14b3eb=_0x9ffa2e[_0x01c6('0x4d')][_0x01c6('0x26')]({'plain':!![]});if(!_0x14b3eb)throw new Error(_0x01c6('0x4e'));if(_0x14b3eb[_0x01c6('0x4f')]===_0x01c6('0x4d')){var _0x5528f2=_0x33c137[_0x01c6('0x26')]({'plain':!![]});var _0xded1e7=_0x01c6('0x50');return db['UserProfileSection'][_0x01c6('0x4a')]({'where':{'name':_0xded1e7,'userProfileId':_0x14b3eb[_0x01c6('0x51')]},'raw':!![]})['then'](function(_0x352d3f){if(_0x352d3f&&_0x352d3f['autoAssociation']===0x0){return db[_0x01c6('0x27')][_0x01c6('0x4b')]({'name':_0x5528f2[_0x01c6('0x2b')],'resourceId':_0x5528f2['id'],'type':_0x352d3f[_0x01c6('0x2b')],'sectionId':_0x352d3f['id']},{})[_0x01c6('0x14')](function(){return _0x33c137;});}else{return _0x33c137;}})['catch'](function(_0x2f35e1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f35e1);throw _0x2f35e1;});}return _0x33c137;})[_0x01c6('0x14')](respondWithResult(_0x1be4b3,0xc9))[_0x01c6('0x1c')](handleError(_0x1be4b3,null));};exports['update']=function(_0x4b5d62,_0x1469b2){if(_0x4b5d62['body']['id']){delete _0x4b5d62[_0x01c6('0x4c')]['id'];}return db[_0x01c6('0x2e')][_0x01c6('0x4a')]({'where':{'id':_0x4b5d62[_0x01c6('0x43')]['id']},'include':[{'model':db[_0x01c6('0x44')],'as':_0x01c6('0x45')}]})[_0x01c6('0x14')](handleEntityNotFound(_0x1469b2,null))[_0x01c6('0x14')](saveUpdates(_0x4b5d62['body'],null))['then'](respondWithResult(_0x1469b2,null))['catch'](handleError(_0x1469b2,null));};exports[_0x01c6('0x28')]=function(_0x470ad9,_0xf3f2d1){return db[_0x01c6('0x2e')]['find']({'where':{'id':_0x470ad9[_0x01c6('0x43')]['id']}})[_0x01c6('0x14')](handleEntityNotFound(_0xf3f2d1,null))[_0x01c6('0x14')](removeEntity(_0xf3f2d1,null))['catch'](handleError(_0xf3f2d1,null));};exports[_0x01c6('0x52')]=function(_0x34d6dc,_0x472583){return db[_0x01c6('0x2e')][_0x01c6('0x52')]()[_0x01c6('0x14')](respondWithResult(_0x472583,null))['catch'](handleError(_0x472583,null));};exports[_0x01c6('0x53')]=function(_0x37beb2,_0xefb6ac){if(_0x37beb2[_0x01c6('0x4c')]['id']){delete _0x37beb2['body']['id'];}return db[_0x01c6('0x2e')][_0x01c6('0x4a')]({'where':{'id':_0x37beb2[_0x01c6('0x43')]['id']}})[_0x01c6('0x14')](handleEntityNotFound(_0xefb6ac,null))['then'](function(_0x5213a9){if(_0x5213a9){_0x37beb2[_0x01c6('0x4c')]['ChatWebsiteId']=_0x5213a9['id'];return db[_0x01c6('0x54')]['create'](_0x37beb2['body']);}})[_0x01c6('0x14')](respondWithResult(_0xefb6ac,null))[_0x01c6('0x1c')](handleError(_0xefb6ac,null));};exports['getDispositions']=function(_0xd8424d,_0x49f10d){var _0x219f03={'raw':![],'where':{}};var _0x248185={};var _0x4a8b43={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0xd8424d['params']['id']}})['then'](handleEntityNotFound(_0x49f10d,null))[_0x01c6('0x14')](function(_0x5a0ac8){if(_0x5a0ac8){_0x248185[_0x01c6('0x32')]=_[_0x01c6('0x46')](db[_0x01c6('0x54')][_0x01c6('0x2f')]);_0x248185[_0x01c6('0x34')]=_[_0x01c6('0x46')](_0xd8424d[_0x01c6('0x34')]);_0x248185['filters']=_['intersection'](_0x248185[_0x01c6('0x32')],_0x248185[_0x01c6('0x34')]);_0x219f03['attributes']=_['intersection'](_0x248185[_0x01c6('0x32')],qs[_0x01c6('0x36')](_0xd8424d[_0x01c6('0x34')]['fields']));_0x219f03[_0x01c6('0x35')]=_0x219f03[_0x01c6('0x35')]['length']?_0x219f03['attributes']:_0x248185['model'];if(!_0xd8424d[_0x01c6('0x34')]['hasOwnProperty']('nolimit')){_0x219f03[_0x01c6('0x22')]=qs[_0x01c6('0x22')](_0xd8424d[_0x01c6('0x34')][_0x01c6('0x22')]);_0x219f03[_0x01c6('0x20')]=qs[_0x01c6('0x20')](_0xd8424d[_0x01c6('0x34')][_0x01c6('0x20')]);}_0x219f03['order']=qs[_0x01c6('0x3b')](_0xd8424d[_0x01c6('0x34')][_0x01c6('0x3b')]);_0x219f03['where']=qs['filters'](_['pick'](_0xd8424d[_0x01c6('0x34')],_0x248185[_0x01c6('0x3c')]));_0x219f03[_0x01c6('0x3d')]['ChatWebsiteId']=_0x5a0ac8['id'];if(_0xd8424d[_0x01c6('0x34')][_0x01c6('0x55')]){_0x219f03[_0x01c6('0x3d')]=_[_0x01c6('0x3e')](_0x219f03[_0x01c6('0x3d')],{'$or':_['map'](_0x219f03['attributes'],function(_0x5479d7){var _0x3c0954={};_0x3c0954[_0x5479d7]={'$like':'%'+_0xd8424d[_0x01c6('0x34')]['filter']+'%'};return _0x3c0954;})});}_0x219f03=_['merge']({},_0x219f03,_0xd8424d[_0x01c6('0x41')]);return db[_0x01c6('0x54')][_0x01c6('0x23')]({'where':_0x219f03['where']})['then'](function(_0x2f685d){_0x4a8b43[_0x01c6('0x23')]=_0x2f685d;if(_0xd8424d[_0x01c6('0x34')][_0x01c6('0x48')]){_0x219f03[_0x01c6('0x49')]=[{'all':!![]}];}return db[_0x01c6('0x54')][_0x01c6('0x56')](_0x219f03);})[_0x01c6('0x14')](function(_0x2961e3){_0x4a8b43[_0x01c6('0x42')]=_0x2961e3;return _0x4a8b43;});}})[_0x01c6('0x14')](respondWithFilteredResult(_0x49f10d,_0x219f03))[_0x01c6('0x1c')](handleError(_0x49f10d,null));};exports['removeDispositions']=function(_0x5c7e32,_0x339eda){return db['ChatWebsite']['find']({'where':{'id':_0x5c7e32[_0x01c6('0x43')]['id']}})[_0x01c6('0x14')](handleEntityNotFound(_0x339eda,null))[_0x01c6('0x14')](function(_0x38ba10){if(_0x38ba10){return _0x38ba10['removeDispositions'](_0x5c7e32[_0x01c6('0x34')][_0x01c6('0x57')]);}})['then'](respondWithStatusCode(_0x339eda,null))[_0x01c6('0x1c')](handleError(_0x339eda,null));};exports[_0x01c6('0x58')]=function(_0x2b208d,_0x1d1901){if(_0x2b208d[_0x01c6('0x4c')]['id']){delete _0x2b208d[_0x01c6('0x4c')]['id'];}return db[_0x01c6('0x2e')]['find']({'where':{'id':_0x2b208d['params']['id']}})[_0x01c6('0x14')](handleEntityNotFound(_0x1d1901,null))[_0x01c6('0x14')](function(_0x56e885){if(_0x56e885){_0x2b208d[_0x01c6('0x4c')][_0x01c6('0x59')]=_0x56e885['id'];return db['CannedAnswer'][_0x01c6('0x4b')](_0x2b208d[_0x01c6('0x4c')]);}})[_0x01c6('0x14')](respondWithResult(_0x1d1901,null))['catch'](handleError(_0x1d1901,null));};exports[_0x01c6('0x5a')]=function(_0x114033,_0x468201){var _0x33b123={'raw':![],'where':{}};var _0x2b64b5={};var _0x42613c={'count':0x0,'rows':[]};return db[_0x01c6('0x2e')][_0x01c6('0x5b')]({'where':{'id':_0x114033[_0x01c6('0x43')]['id']}})[_0x01c6('0x14')](handleEntityNotFound(_0x468201,null))['then'](function(_0x40a29e){if(_0x40a29e){_0x2b64b5[_0x01c6('0x32')]=_['keys'](db[_0x01c6('0x5c')]['rawAttributes']);_0x2b64b5[_0x01c6('0x34')]=_['keys'](_0x114033[_0x01c6('0x34')]);_0x2b64b5[_0x01c6('0x3c')]=_['intersection'](_0x2b64b5[_0x01c6('0x32')],_0x2b64b5[_0x01c6('0x34')]);_0x33b123['attributes']=_['intersection'](_0x2b64b5[_0x01c6('0x32')],qs[_0x01c6('0x36')](_0x114033[_0x01c6('0x34')][_0x01c6('0x36')]));_0x33b123[_0x01c6('0x35')]=_0x33b123[_0x01c6('0x35')][_0x01c6('0x37')]?_0x33b123[_0x01c6('0x35')]:_0x2b64b5['model'];if(!_0x114033[_0x01c6('0x34')][_0x01c6('0x38')](_0x01c6('0x39'))){_0x33b123['limit']=qs[_0x01c6('0x22')](_0x114033[_0x01c6('0x34')][_0x01c6('0x22')]);_0x33b123[_0x01c6('0x20')]=qs[_0x01c6('0x20')](_0x114033[_0x01c6('0x34')][_0x01c6('0x20')]);}_0x33b123[_0x01c6('0x3a')]=qs[_0x01c6('0x3b')](_0x114033[_0x01c6('0x34')][_0x01c6('0x3b')]);_0x33b123[_0x01c6('0x3d')]=qs[_0x01c6('0x3c')](_[_0x01c6('0x5d')](_0x114033['query'],_0x2b64b5['filters']));_0x33b123[_0x01c6('0x3d')][_0x01c6('0x59')]=_0x40a29e['id'];if(_0x114033[_0x01c6('0x34')][_0x01c6('0x55')]){_0x33b123[_0x01c6('0x3d')]=_['merge'](_0x33b123[_0x01c6('0x3d')],{'$or':_[_0x01c6('0x33')](_0x33b123['attributes'],function(_0x4f10b9){var _0x239025={};_0x239025[_0x4f10b9]={'$like':'%'+_0x114033[_0x01c6('0x34')][_0x01c6('0x55')]+'%'};return _0x239025;})});}_0x33b123=_[_0x01c6('0x3e')]({},_0x33b123,_0x114033[_0x01c6('0x41')]);return db['CannedAnswer']['count']({'where':_0x33b123[_0x01c6('0x3d')]})[_0x01c6('0x14')](function(_0xee8c6c){_0x42613c[_0x01c6('0x23')]=_0xee8c6c;if(_0x114033[_0x01c6('0x34')][_0x01c6('0x48')]){_0x33b123[_0x01c6('0x49')]=[{'all':!![]}];}return db[_0x01c6('0x5c')]['findAll'](_0x33b123);})['then'](function(_0x292847){_0x42613c[_0x01c6('0x42')]=_0x292847;return _0x42613c;});}})[_0x01c6('0x14')](respondWithFilteredResult(_0x468201,_0x33b123))['catch'](handleError(_0x468201,null));};exports[_0x01c6('0x5e')]=function(_0x206790,_0x1d01f8){return db[_0x01c6('0x2e')]['find']({'where':{'id':_0x206790[_0x01c6('0x43')]['id']}})['then'](handleEntityNotFound(_0x1d01f8,null))['then'](function(_0x10be76){if(_0x10be76){return _0x10be76[_0x01c6('0x5e')](_0x206790['query']['ids']);}})[_0x01c6('0x14')](respondWithStatusCode(_0x1d01f8,null))[_0x01c6('0x1c')](handleError(_0x1d01f8,null));};exports[_0x01c6('0x5f')]=function(_0x50e180,_0x2c029a){_0x50e180[_0x01c6('0x4c')][_0x01c6('0x60')]=_0x50e180[_0x01c6('0x61')][_0x01c6('0x62')];return db[_0x01c6('0x2e')][_0x01c6('0x4a')]({'where':{'id':_0x50e180[_0x01c6('0x43')]['id']}})[_0x01c6('0x14')](handleEntityNotFound(_0x2c029a,null))[_0x01c6('0x14')](saveUpdates(_0x50e180['body'],null))[_0x01c6('0x14')](respondWithResult(_0x2c029a,null))[_0x01c6('0x1c')](handleError(_0x2c029a,null));};exports[_0x01c6('0x63')]=function(_0x52e1f2,_0x5d994e){_0x52e1f2[_0x01c6('0x4c')][_0x01c6('0x64')]=_0x52e1f2[_0x01c6('0x61')][_0x01c6('0x62')];return db['ChatWebsite'][_0x01c6('0x4a')]({'where':{'id':_0x52e1f2[_0x01c6('0x43')]['id']}})['then'](handleEntityNotFound(_0x5d994e,null))[_0x01c6('0x14')](saveUpdates(_0x52e1f2[_0x01c6('0x4c')],null))[_0x01c6('0x14')](respondWithResult(_0x5d994e,null))[_0x01c6('0x1c')](handleError(_0x5d994e,null));};exports[_0x01c6('0x65')]=function(_0x2d0fb2,_0x186413){_0x2d0fb2['body'][_0x01c6('0x66')]=_0x2d0fb2[_0x01c6('0x61')][_0x01c6('0x62')];return db[_0x01c6('0x2e')][_0x01c6('0x4a')]({'where':{'id':_0x2d0fb2[_0x01c6('0x43')]['id']}})[_0x01c6('0x14')](handleEntityNotFound(_0x186413,null))[_0x01c6('0x14')](saveUpdates(_0x2d0fb2[_0x01c6('0x4c')],null))['then'](respondWithResult(_0x186413,null))['catch'](handleError(_0x186413,null));};exports['addSystemAvatar']=function(_0x1e83d1,_0x1d3688){_0x1e83d1[_0x01c6('0x4c')][_0x01c6('0x67')]=_0x1e83d1['file'][_0x01c6('0x62')];return db['ChatWebsite'][_0x01c6('0x4a')]({'where':{'id':_0x1e83d1['params']['id']}})[_0x01c6('0x14')](handleEntityNotFound(_0x1d3688,null))[_0x01c6('0x14')](saveUpdates(_0x1e83d1[_0x01c6('0x4c')],null))[_0x01c6('0x14')](respondWithResult(_0x1d3688,null))[_0x01c6('0x1c')](handleError(_0x1d3688,null));};exports[_0x01c6('0x68')]=function(_0x7c2b12,_0x462598){var _0x16a51a=path[_0x01c6('0x69')](config[_0x01c6('0x6a')],'server/files/images/logos/default_logo.svg');var _0x35169f={'where':{'id':_0x7c2b12[_0x01c6('0x43')]['id']},'attributes':['id',_0x01c6('0x60')],'raw':!![]};var _0x73671f=![];return require(_0x01c6('0x6b'))[_0x01c6('0x6c')]()[_0x01c6('0x14')](function(_0x1497cb){if(_0x1497cb){_0x73671f=_0x1497cb[_0x01c6('0x6d')];}})[_0x01c6('0x14')](function(){return db['ChatWebsite']['find'](_0x35169f);})['then'](handleEntityNotFound(_0x462598,null))[_0x01c6('0x14')](function(_0x41e991){if(_0x41e991){if(!_[_0x01c6('0x6e')](_0x41e991[_0x01c6('0x60')])){if(fs['existsSync'](path[_0x01c6('0x69')](config[_0x01c6('0x6a')],_0x01c6('0x6f'),_0x41e991[_0x01c6('0x60')]))&&_0x73671f){_0x16a51a=path[_0x01c6('0x69')](config[_0x01c6('0x6a')],_0x01c6('0x6f'),_0x41e991['sitepic']);}}return _0x462598[_0x01c6('0x70')](_0x16a51a);}})['catch'](handleError(_0x462598,null));};exports[_0x01c6('0x71')]=function(_0x2c3066,_0xff1a06){var _0x5d5e27=path['join'](config['root'],'server/files/images/avatars/default_avatar.png');var _0x8d1cc1={'where':{'id':_0x2c3066[_0x01c6('0x43')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x01c6('0x2e')][_0x01c6('0x4a')](_0x8d1cc1)[_0x01c6('0x14')](handleEntityNotFound(_0xff1a06,null))['then'](function(_0x4d9cec){if(_0x4d9cec){if(!_[_0x01c6('0x6e')](_0x4d9cec['agentAvatar'])){if(fs[_0x01c6('0x72')](path[_0x01c6('0x69')](config[_0x01c6('0x6a')],_0x01c6('0x73'),_0x4d9cec[_0x01c6('0x64')]))){_0x5d5e27=path[_0x01c6('0x69')](config['root'],_0x01c6('0x73'),_0x4d9cec[_0x01c6('0x64')]);}}return _0xff1a06['download'](_0x5d5e27);}})['catch'](handleError(_0xff1a06,null));};exports[_0x01c6('0x74')]=function(_0x405d50,_0x40d276){var _0x1df500=path[_0x01c6('0x69')](config['root'],_0x01c6('0x75'));var _0x2ac796={'where':{'id':_0x405d50[_0x01c6('0x43')]['id']},'attributes':['id',_0x01c6('0x66'),_0x01c6('0x76')],'raw':!![]};return db[_0x01c6('0x2e')][_0x01c6('0x4a')](_0x2ac796)[_0x01c6('0x14')](handleEntityNotFound(_0x40d276,null))[_0x01c6('0x14')](function(_0x28319a){if(_0x28319a){if(!_[_0x01c6('0x6e')](_0x28319a['customerAvatar'])){if(fs[_0x01c6('0x72')](path['join'](config[_0x01c6('0x6a')],_0x01c6('0x73'),_0x28319a[_0x01c6('0x66')]))&&_0x28319a[_0x01c6('0x76')]){_0x1df500=path[_0x01c6('0x69')](config[_0x01c6('0x6a')],_0x01c6('0x73'),_0x28319a['customerAvatar']);}}return _0x40d276[_0x01c6('0x70')](_0x1df500);}})[_0x01c6('0x1c')](handleError(_0x40d276,null));};exports[_0x01c6('0x77')]=function(_0x4baeef,_0xdd22e2){var _0x604baf=path[_0x01c6('0x69')](config[_0x01c6('0x6a')],_0x01c6('0x78'));var _0x3497bc={'where':{'id':_0x4baeef[_0x01c6('0x43')]['id']},'attributes':['id',_0x01c6('0x67')],'raw':!![]};return db[_0x01c6('0x2e')][_0x01c6('0x4a')](_0x3497bc)[_0x01c6('0x14')](handleEntityNotFound(_0xdd22e2,null))[_0x01c6('0x14')](function(_0x360e91){if(_0x360e91){if(!_[_0x01c6('0x6e')](_0x360e91[_0x01c6('0x67')])){if(fs[_0x01c6('0x72')](path[_0x01c6('0x69')](config[_0x01c6('0x6a')],_0x01c6('0x73'),_0x360e91[_0x01c6('0x67')]))){_0x604baf=path['join'](config[_0x01c6('0x6a')],_0x01c6('0x73'),_0x360e91[_0x01c6('0x67')]);}}return _0xdd22e2[_0x01c6('0x70')](_0x604baf);}})[_0x01c6('0x1c')](handleError(_0xdd22e2,null));};exports['notify']=function(_0x3a08d,_0xcfbe0d){var _0x2a68e8=require(_0x01c6('0x79'));var _0x47e3c5=new _0x2a68e8();var _0x3511ce=_0x47e3c5[_0x01c6('0x7a')](_0x3a08d[_0x01c6('0x7b')][_0x01c6('0x7c')])[_0x01c6('0x7d')]();var _0x116632={'body':_0x3a08d[_0x01c6('0x4c')],'channel':'chat'};var _0x506e3e=[];var _0x462ad9=[];var _0x1989c5={};var _0xb29707=![];return db[_0x01c6('0x7e')][_0x01c6('0x52')]()['then'](function(_0x4a19d2){if(!_0x4a19d2){throw new db[(_0x01c6('0x7f'))][(_0x01c6('0x80'))](_0x01c6('0x81'));}_0x506e3e=_[_0x01c6('0x82')](_[_0x01c6('0x46')](_0x4a19d2),[_0x01c6('0x83'),_0x01c6('0x84')]);_0x462ad9=_[_0x01c6('0x82')](_[_0x01c6('0x46')](_0x4a19d2),['createdAt','updatedAt',_0x01c6('0x85'),'ListId']);if(_0x3a08d[_0x01c6('0x4c')]['id']){delete _0x3a08d[_0x01c6('0x4c')]['id'];}if(_['isNil'](_0x3a08d[_0x01c6('0x4c')]['from'])){throw new db[(_0x01c6('0x7f'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x3a08d[_0x01c6('0x4c')][_0x01c6('0x4c')])||_0x3a08d[_0x01c6('0x4c')][_0x01c6('0x4c')]===''){throw new db['Sequelize']['ValidationError'](_0x01c6('0x86'));}if(_['isNil'](_0x3a08d['body'][_0x01c6('0x87')])){throw new db[(_0x01c6('0x7f'))][(_0x01c6('0x80'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x462ad9);}if(!_['includes'](_0x462ad9,_0x3a08d[_0x01c6('0x4c')][_0x01c6('0x87')])){throw new db[(_0x01c6('0x7f'))][(_0x01c6('0x80'))](_0x01c6('0x88')+_0x462ad9);}_0x1989c5[_0x3a08d[_0x01c6('0x4c')]['mapKey']]=_0x3a08d[_0x01c6('0x4c')][_0x01c6('0x89')];})[_0x01c6('0x14')](function(){return db['ChatWebsite'][_0x01c6('0x4a')]({'where':{'id':_0x3a08d['params']['id']},'include':[{'model':db[_0x01c6('0x8a')],'as':'List','include':[{'model':db[_0x01c6('0x7e')],'as':'Contacts','where':_0x1989c5,'limit':0x1,'order':[['updatedAt',_0x01c6('0x8b')]]}]},{'model':db[_0x01c6('0x8c')],'as':_0x01c6('0x8d')}]});})[_0x01c6('0x14')](handleEntityNotFound(_0xcfbe0d,null))['then'](function(_0xf57315){if(_0xf57315&&_0xf57315[_0x01c6('0x8e')]){_0x116632[_0x01c6('0x8f')]=_0xf57315;_0x116632[_0x01c6('0x90')]=_0xf57315['Applications'];_0x116632[_0x01c6('0x91')]=_0xf57315[_0x01c6('0x8e')];_0x116632[_0x01c6('0x90')]=_[_0x01c6('0x92')](_0x116632[_0x01c6('0x90')],[_0x01c6('0x93')],[_0x01c6('0x94')]);if(_0x116632[_0x01c6('0x8f')][_0x01c6('0x8d')]){delete _0x116632[_0x01c6('0x8f')][_0x01c6('0x8d')];}if(_0x116632['account'][_0x01c6('0x8e')]&&_0x116632['account'][_0x01c6('0x8e')]['Contacts']['length']){return _0x116632['account'][_0x01c6('0x8e')]['Contacts'][0x0];}var _0x4814eb=_[_0x01c6('0xc')](_0x3a08d[_0x01c6('0x4c')],{'firstName':_0x3a08d[_0x01c6('0x4c')][_0x01c6('0x89')],'ListId':_0xf57315['ListId']});_0x4814eb[_0x3a08d[_0x01c6('0x4c')][_0x01c6('0x87')]]=_0x3a08d[_0x01c6('0x4c')]['from'];return db[_0x01c6('0x7e')][_0x01c6('0x4b')](_0x4814eb,{'fields':_0x506e3e,'raw':!![]});}})[_0x01c6('0x14')](handleEntityNotFound(_0xcfbe0d,null))[_0x01c6('0x14')](function(_0x4b8c8b){_0x116632[_0x01c6('0x95')]=_0x4b8c8b;var _0x2d66c5=_0x3a08d['body'][_0x01c6('0x96')];if(_0x3a08d[_0x01c6('0x7b')]['cf-connecting-ip']){_0x2d66c5=_0x3a08d[_0x01c6('0x7b')][_0x01c6('0x97')];}else if(_0x3a08d[_0x01c6('0x7b')]['x-forwarded-for']){_0x2d66c5=_[_0x01c6('0x98')](_0x3a08d[_0x01c6('0x7b')][_0x01c6('0x99')][_0x01c6('0x9a')](','));}if(_0x4b8c8b){var _0x89d485={'ContactId':_0x4b8c8b['id'],'ChatWebsiteId':_0x3a08d[_0x01c6('0x43')]['id'],'from':(_0x4b8c8b[_0x01c6('0x9b')]||'')+'\x20'+(_0x4b8c8b[_0x01c6('0x9c')]||''),'customerIp':_0x2d66c5,'customerPort':_0x3a08d[_0x01c6('0x7b')][_0x01c6('0x9d')]?_0x3a08d[_0x01c6('0x7b')][_0x01c6('0x9d')]:null,'referer':_0x3a08d[_0x01c6('0x4c')][_0x01c6('0x9e')],'browserName':_0x3511ce[_0x01c6('0x9f')]['name']&&_0x3511ce[_0x01c6('0x9f')][_0x01c6('0xa0')]?util[_0x01c6('0xa1')]('%s\x20%s',_0x3511ce[_0x01c6('0x9f')][_0x01c6('0x2b')],_0x3511ce[_0x01c6('0x9f')][_0x01c6('0xa0')]):'unknown','browserVersion':_0x3511ce[_0x01c6('0x9f')][_0x01c6('0xa0')]||'unknown','osName':util[_0x01c6('0xa1')](_0x01c6('0xa2'),_0x3511ce['os']['name'],_0x3511ce['os'][_0x01c6('0xa0')]),'osVersion':_0x3511ce['os'][_0x01c6('0xa0')],'deviceModel':_0x3511ce['device'][_0x01c6('0x32')]&&_0x3511ce[_0x01c6('0xa3')][_0x01c6('0xa4')]?util[_0x01c6('0xa1')](_0x01c6('0xa5'),_0x3511ce[_0x01c6('0xa3')][_0x01c6('0x32')],_0x3511ce[_0x01c6('0xa3')]['vendor'],_0x3511ce[_0x01c6('0xa3')][_0x01c6('0x3f')]):null,'deviceVendor':_0x3511ce[_0x01c6('0xa3')]['vendor'],'deviceType':_0x3511ce[_0x01c6('0xa3')][_0x01c6('0x3f')],'formData':JSON[_0x01c6('0xa6')](_0x3a08d[_0x01c6('0x4c')])};var _0x49ac8d={'ChatWebsiteId':_0x3a08d['params']['id'],'closed':![]};if(_0x3a08d['body'][_0x01c6('0xa7')]){_0x49ac8d[_0x01c6('0xa7')]=_0x3a08d[_0x01c6('0x4c')]['threadId'];return db[_0x01c6('0xa8')][_0x01c6('0x4a')]({'where':_0x49ac8d})[_0x01c6('0x14')](function(_0xdd8fcb){if(_0xdd8fcb){return[_0xdd8fcb,![]];}_0x89d485[_0x01c6('0xa7')]=_0x3a08d[_0x01c6('0x4c')][_0x01c6('0xa7')];_0x89d485['externalUrl']=_0x3a08d[_0x01c6('0x4c')][_0x01c6('0xa9')];return db[_0x01c6('0xa8')][_0x01c6('0x4b')](_0x89d485)[_0x01c6('0x14')](function(_0x5a6fec){return[_0x5a6fec,!![]];});});}_0x49ac8d[_0x01c6('0xaa')]=_0x4b8c8b['id'];if(_0x3a08d[_0x01c6('0x4c')]['interaction']&&_0x3a08d['body'][_0x01c6('0xab')]['id']){_0x49ac8d['id']=_0x3a08d[_0x01c6('0x4c')]['interaction']['id'];return db[_0x01c6('0xa8')][_0x01c6('0x4a')]({'where':_0x49ac8d})[_0x01c6('0x14')](function(_0x2a06c4){if(_0x2a06c4){return[_0x2a06c4,![]];}return db['ChatInteraction'][_0x01c6('0x4b')](_0x89d485)[_0x01c6('0x14')](function(_0x11f3db){return[_0x11f3db,!![]];});});}return db[_0x01c6('0xa8')][_0x01c6('0x4b')](_0x89d485)[_0x01c6('0x14')](function(_0x2bf91f){return[_0x2bf91f,!![]];});}})[_0x01c6('0xac')](function(_0x596e97,_0x9a30d4){if(_0x596e97){_0xb29707=_0x9a30d4;if(!_0x9a30d4){var _0x5b6b76={'from':(_0x116632[_0x01c6('0x95')][_0x01c6('0x9b')]||'')+'\x20'+(_0x116632['contact'][_0x01c6('0x9c')]||'')};if(_0x3a08d[_0x01c6('0x4c')][_0x01c6('0xa7')]&&_0x3a08d['body'][_0x01c6('0xad')]&&_0x3a08d['body'][_0x01c6('0xa7')]!=_0x3a08d['body']['messageId']){_0x5b6b76[_0x01c6('0xa7')]=_0x3a08d['body'][_0x01c6('0xad')];}return _0x596e97['update'](_0x5b6b76);}else{return _0x596e97;}}})[_0x01c6('0x14')](function(_0xfc46a){_0x116632[_0x01c6('0xab')]=_0xfc46a[_0x01c6('0x26')]({'plain':!![]});_0x116632[_0x01c6('0xab')][_0x01c6('0xae')]=_0xb29707;if(_0x116632[_0x01c6('0xab')][_0x01c6('0xae')]){if(_0x116632[_0x01c6('0x8f')][_0x01c6('0xaf')]){_0x116632[_0x01c6('0x90')][_0x01c6('0xb0')]({'id':0x0,'priority':_0x116632['applications']['length']+0x1,'app':_0x01c6('0xb1'),'appdata':_0x01c6('0xb2'),'interval':_0x01c6('0xb3')});}}return db[_0x01c6('0xb4')][_0x01c6('0x4b')]({'body':_0x3a08d['body'][_0x01c6('0x4c')],'ChatWebsiteId':_0x3a08d['params']['id'],'ChatInteractionId':_0xfc46a['id'],'direction':'in','ContactId':_0x116632[_0x01c6('0x95')]['id'],'AttachmentId':_0x3a08d['body'][_0x01c6('0xb5')]});})[_0x01c6('0x14')](function(_0x3e4669){_0x116632[_0x01c6('0x1b')]=_0x3e4669;if(_0x116632[_0x01c6('0xab')]['UserId']){return db[_0x01c6('0xb6')]['find']({'attributes':['id',_0x01c6('0x2b')],'where':{'id':_0x116632[_0x01c6('0xab')][_0x01c6('0xb7')]}})[_0x01c6('0x14')](function(_0x4ba28a){if(_0x4ba28a){_0x116632[_0x01c6('0x90')][_0x01c6('0xb8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4ba28a[_0x01c6('0x2b')]+','+(_0x116632['account']['waitForTheAssignedAgent']||0xa),'interval':_0x01c6('0xb3')});_0x116632['forcedOwnership']=!![];}return respondWithRpcPromise(_0x01c6('0xb9'),_0x01c6('0xba'),_0x116632);});}return respondWithRpcPromise('Start',_0x01c6('0xba'),_0x116632);})['then'](function(_0x1edf67){respondWithRpcPromise(_0x01c6('0xbb'),'EventManager',{'event':_0x01c6('0xbc'),'message':_0x1edf67},client9002);return _0x1edf67;})[_0x01c6('0x14')](respondWithResult(_0xcfbe0d,null))['catch'](handleError(_0xcfbe0d,null));};exports[_0x01c6('0xbd')]=function(_0x12d023,_0x2fe7ea){var _0x3d8f2e,_0x13ae75,_0x50dbc8;var _0x274dbb=[];var _0x28c365={};var _0x29da69=_0x12d023[_0x01c6('0xbe')]||[];var _0x3d2b37=[];var _0x18c1ba;return db['CmContact'][_0x01c6('0x52')]()[_0x01c6('0x14')](function(_0x1c9d8){if(!_0x1c9d8){throw new db[(_0x01c6('0x7f'))][(_0x01c6('0x80'))]('no\x20available\x20attributes');}_0x274dbb=_[_0x01c6('0x82')](_['keys'](_0x1c9d8),[_0x01c6('0x83'),_0x01c6('0x84'),_0x01c6('0x85'),'ListId']);if(_0x12d023[_0x01c6('0x4c')]['id']){delete _0x12d023[_0x01c6('0x4c')]['id'];}if(_[_0x01c6('0x6e')](_0x12d023[_0x01c6('0x4c')][_0x01c6('0x89')])){throw _0x2fe7ea['status'](0x1f4)[_0x01c6('0x2c')](new db['Sequelize']['ValidationError'](_0x01c6('0xbf')));}if(_[_0x01c6('0x6e')](_0x12d023[_0x01c6('0x4c')][_0x01c6('0x4c')])||_0x12d023[_0x01c6('0x4c')]['body']===''){throw _0x2fe7ea['status'](0x1f4)[_0x01c6('0x2c')](new db[(_0x01c6('0x7f'))][(_0x01c6('0x80'))](_0x01c6('0x86')));}if(_[_0x01c6('0x6e')](_0x12d023[_0x01c6('0x4c')][_0x01c6('0xc0')])){throw _0x2fe7ea['status'](0x1f4)[_0x01c6('0x2c')](new db[(_0x01c6('0x7f'))][(_0x01c6('0x80'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x274dbb));}if(!_['includes'](_0x274dbb,_0x12d023['body'][_0x01c6('0xc0')])){throw _0x2fe7ea[_0x01c6('0x1d')](0x1f4)[_0x01c6('0x2c')](new db[(_0x01c6('0x7f'))][(_0x01c6('0x80'))](_0x01c6('0xc1')+_0x274dbb));}_0x28c365[_0x12d023['body'][_0x01c6('0xc0')]]=_0x12d023[_0x01c6('0x4c')][_0x01c6('0x89')];})['then'](function(){return db[_0x01c6('0x2e')][_0x01c6('0x4a')]({'where':{'id':_0x12d023[_0x01c6('0x43')]['id']},'include':[{'model':db[_0x01c6('0x8a')],'as':_0x01c6('0x8e')},{'model':db[_0x01c6('0xc2')],'as':_0x01c6('0xc2')}]});})['then'](handleEntityNotFound(_0x2fe7ea,null))[_0x01c6('0x14')](function(_0x1a257f){if(_0x1a257f&&_0x1a257f[_0x01c6('0x8e')]){_0x13ae75=_0x1a257f;var _0x1ca746=_[_0x01c6('0xc')](_0x12d023[_0x01c6('0x4c')],{'firstName':_0x12d023[_0x01c6('0x4c')]['from'],'phone':_0x12d023['body'][_0x01c6('0x89')],'ListId':_0x1a257f[_0x01c6('0xc3')]});_0x1ca746[_0x12d023[_0x01c6('0x4c')][_0x01c6('0xc0')]]=_0x12d023[_0x01c6('0x4c')][_0x01c6('0x89')];return db[_0x01c6('0x7e')][_0x01c6('0xc4')]({'where':_0x28c365,'defaults':_0x1ca746});}})['spread'](function(_0x54d841){if(_0x54d841){_0x50dbc8=_0x54d841;var _0x1a1b17=fs[_0x01c6('0xc5')](path[_0x01c6('0x69')](config[_0x01c6('0x6a')],_0x01c6('0xc6')),'utf8');var _0x2f8244=ejs[_0x01c6('0xc7')](_0x1a1b17,{'body':_['toPairs'](_0x12d023['body'][_0x01c6('0x4c')]),'bodyTitle':_0x13ae75[_0x01c6('0xc8')]});return db[_0x01c6('0xc9')][_0x01c6('0x4b')]({'body':_0x2f8244,'plainBody':htmlToText[_0x01c6('0xca')](_0x2f8244),'ContactId':_0x54d841['id'],'ChatWebsiteId':_0x13ae75['id']});}})['then'](function(_0x317773){_0x18c1ba=_0x317773;if(_0x29da69[_0x01c6('0x37')]){var _0x483fb6=_0x29da69[_0x01c6('0x33')](function(_0x3c0987){return{'name':_0x3c0987[_0x01c6('0xcb')],'basename':_0x3c0987['filename'],'type':_0x3c0987[_0x01c6('0xcc')],'ChatOfflineMessageId':_0x317773['id']};});_0x3d2b37=_0x483fb6['map'](_0x1735ca=>{var _0x13cce8={'filename':_0x1735ca[_0x01c6('0x2b')],'path':path[_0x01c6('0x69')](config[_0x01c6('0x6a')],_0x01c6('0xcd'),'files',_0x01c6('0xce'),_0x01c6('0xcf'),_0x1735ca[_0x01c6('0xd0')])};return _0x13cce8;});if(!_0x13ae75[_0x01c6('0xd1')]){return db[_0x01c6('0xd2')]['transaction'](function(_0x5a03ee){return db[_0x01c6('0xd3')][_0x01c6('0xd4')](_0x483fb6,{'transaction':_0x5a03ee});});}}})[_0x01c6('0x14')](function(){if(_0x18c1ba){_0x3d8f2e=_0x18c1ba;return db[_0x01c6('0xc2')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x01c6('0xd5')],'as':_0x01c6('0xd6'),'raw':!![],'include':[{'model':db[_0x01c6('0xd7')],'as':_0x01c6('0xd7'),'raw':!![]}]}]});}})[_0x01c6('0x14')](function(_0x5acf4a){if(_0x5acf4a&&_0x5acf4a[_0x01c6('0xd6')]&&_0x13ae75['forwardOffline']&&_0x13ae75[_0x01c6('0xd8')]){var _0x29c36a=_0x5acf4a['getSmtpOptions']();return respondWithRpcPromise(_0x01c6('0xd9'),_0x01c6('0xda'),{'account':_0x29c36a,'message':{'from':util[_0x01c6('0xa1')](_0x01c6('0xdb'),_0x5acf4a[_0x01c6('0x2b')],_0x5acf4a['email']||_0x5acf4a[_0x01c6('0xd6')][_0x01c6('0x4d')]),'to':_0x13ae75[_0x01c6('0xd8')],'subject':_0x13ae75[_0x01c6('0xdc')],'html':_0x3d8f2e['body'],'attachments':_0x3d2b37}},client9003)['then'](function(){return _0x3d8f2e;})[_0x01c6('0x1c')](function(_0x55c705){logger[_0x01c6('0x19')](_0x55c705);});}})[_0x01c6('0x14')](function(){if(_0x13ae75&&_0x13ae75[_0x01c6('0xd1')]&&_0x13ae75['MailAccountId']){var _0x486eb6=[];if(_0x29da69[_0x01c6('0x37')]){_0x486eb6=_0x29da69[_0x01c6('0x33')](function(_0x3e05d9){return{'name':_0x3e05d9[_0x01c6('0xcb')],'basename':_0x3e05d9[_0x01c6('0x62')],'type':_0x3e05d9['mimetype'],'ChatOfflineMessageId':_0x18c1ba['id']};});}var _0x41a206;if(!_['isNil'](_0x13ae75['subjectOffline'])){var _0x33edd7=_['map'](_0x12d023[_0x01c6('0x4c')],function(_0x2d9e4d){return _0x2d9e4d;});var _0x598f33=_[_0x01c6('0xdd')](_0x33edd7)[0x0];var _0x2c751e=_['mapValues'](_0x598f33,function(_0x527e86){return _0x527e86;});_0x41a206=_0x2c751e[0x1][_0x13ae75['subjectOffline']];}var _0x27b096={'from':_0x50dbc8[_0x01c6('0xde')],'firstName':_0x50dbc8['firstName'],'lastName':_0x50dbc8['lastName'],'mapKey':'email','message':{'from':_0x50dbc8[_0x01c6('0xde')],'to':_0x13ae75[_0x01c6('0xc2')][_0x01c6('0xde')],'cc':'','subject':_[_0x01c6('0x6e')](_0x41a206)?_0x13ae75[_0x01c6('0xdc')]:_0x41a206,'messageId':'','sentAt':new Date(),'attach':_0x486eb6[_0x01c6('0x37')],'attachments':_0x486eb6,'originChannel':'Chat','ChatWebsiteId':_0x13ae75['id'],'ChatOfflineMessageId':_0x3d8f2e['id'],'originTo':_0x13ae75[_0x01c6('0xc2')][_0x01c6('0xde')]},'body':_0x3d8f2e[_0x01c6('0x4c')]};var _0x5e404c={'account':{'id':_0x13ae75[_0x01c6('0xdf')]},'body':_0x27b096,'log':_0x01c6('0xe0')};return respondWithRpcPromise('NotifyMailAccount',_0x01c6('0xe1'),_0x5e404c,client9001)[_0x01c6('0x14')](function(){return _0x3d8f2e;})[_0x01c6('0x1c')](function(_0x2d1bd0){logger[_0x01c6('0x19')](_0x2d1bd0);});}return;})[_0x01c6('0x14')](function(){if(_0x3d8f2e){return _0x3d8f2e;}})[_0x01c6('0x14')](respondWithResult(_0x2fe7ea,null))['catch'](function(_0x17db17){logger['error'](_0x01c6('0x1c'),_0x17db17);for(var _0x1ad6cf of _0x29da69){var _0x3452dc=path[_0x01c6('0x69')](config[_0x01c6('0x6a')],'server',_0x01c6('0xbe'),_0x01c6('0xce'),_0x01c6('0xcf'),_0x1ad6cf['filename']);fs_extra[_0x01c6('0xe2')](_0x3452dc)[_0x01c6('0x1c')](function(_0x16b01d){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x3452dc,_0x16b01d);});}});};exports['addInteraction']=function(_0x10c538,_0x49752c){return db[_0x01c6('0xa8')][_0x01c6('0x4a')]({'where':{'id':_0x10c538[_0x01c6('0x43')]['id']}})['then'](handleEntityNotFound(_0x49752c,null))[_0x01c6('0x14')](function(_0x4a823f){if(_0x4a823f){return _0x4a823f[_0x01c6('0xe3')](_0x10c538[_0x01c6('0x4c')]['ids'],_[_0x01c6('0xe4')](_0x10c538[_0x01c6('0x4c')],[_0x01c6('0x57'),'id'])||{});}})['then'](respondWithResult(_0x49752c,null))[_0x01c6('0x1c')](handleError(_0x49752c,null));};exports[_0x01c6('0xe5')]=function(_0xfa55c4,_0x45bba6){var _0x5e7e29={'raw':![],'where':{}};var _0x3f8122={};var _0x260a25={'count':0x0,'rows':[]};return db[_0x01c6('0x2e')]['findOne']({'where':{'id':_0xfa55c4[_0x01c6('0x43')]['id']}})['then'](handleEntityNotFound(_0x45bba6,null))[_0x01c6('0x14')](function(_0x3aba39){if(_0x3aba39){_0x3f8122[_0x01c6('0x32')]=_[_0x01c6('0x46')](db[_0x01c6('0xa8')]['rawAttributes']);_0x3f8122[_0x01c6('0x34')]=_[_0x01c6('0x46')](_0xfa55c4[_0x01c6('0x34')]);_0x3f8122[_0x01c6('0x3c')]=_[_0x01c6('0x47')](_0x3f8122['model'],_0x3f8122[_0x01c6('0x34')]);_0x5e7e29[_0x01c6('0x35')]=_['intersection'](_0x3f8122['model'],qs[_0x01c6('0x36')](_0xfa55c4[_0x01c6('0x34')][_0x01c6('0x36')]));_0x5e7e29['attributes']=_0x5e7e29[_0x01c6('0x35')][_0x01c6('0x37')]?_0x5e7e29['attributes']:_0x3f8122[_0x01c6('0x32')];if(!_0xfa55c4[_0x01c6('0x34')]['hasOwnProperty'](_0x01c6('0x39'))){_0x5e7e29[_0x01c6('0x22')]=qs[_0x01c6('0x22')](_0xfa55c4['query']['limit']);_0x5e7e29[_0x01c6('0x20')]=qs[_0x01c6('0x20')](_0xfa55c4[_0x01c6('0x34')][_0x01c6('0x20')]);}_0x5e7e29[_0x01c6('0x3a')]=qs[_0x01c6('0x3b')](_0xfa55c4[_0x01c6('0x34')][_0x01c6('0x3b')]);_0x5e7e29[_0x01c6('0x3d')]=qs[_0x01c6('0x3c')](_['pick'](_0xfa55c4[_0x01c6('0x34')],_0x3f8122[_0x01c6('0x3c')]));_0x5e7e29[_0x01c6('0x3d')]['ChatWebsiteId']=_0x3aba39['id'];if(_0xfa55c4[_0x01c6('0x34')][_0x01c6('0x55')]){_0x5e7e29['where']=_[_0x01c6('0x3e')](_0x5e7e29['where'],{'$or':_[_0x01c6('0x33')](_0x5e7e29[_0x01c6('0x35')],function(_0x1be0dc){var _0x5e69b1={};_0x5e69b1[_0x1be0dc]={'$like':'%'+_0xfa55c4[_0x01c6('0x34')][_0x01c6('0x55')]+'%'};return _0x5e69b1;})});}_0x5e7e29=_['merge']({},_0x5e7e29,_0xfa55c4[_0x01c6('0x41')]);return db['ChatInteraction'][_0x01c6('0x23')]({'where':_0x5e7e29[_0x01c6('0x3d')]})[_0x01c6('0x14')](function(_0x2a7abb){_0x260a25[_0x01c6('0x23')]=_0x2a7abb;if(_0xfa55c4[_0x01c6('0x34')]['includeAll']){_0x5e7e29[_0x01c6('0x49')]=[{'model':db[_0x01c6('0x7e')],'as':_0x01c6('0xe6'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x01c6('0x2b'),_0x01c6('0xe7'),_0x01c6('0xe8')],'required':![]},{'model':db[_0x01c6('0xe9')],'as':_0x01c6('0xea'),'attributes':['id',_0x01c6('0x2b'),_0x01c6('0xeb')],'where':_0xfa55c4['query'][_0x01c6('0xec')]?{'id':_0xfa55c4[_0x01c6('0x34')][_0x01c6('0xec')]}:undefined,'required':_0xfa55c4[_0x01c6('0x34')]['tag']?!![]:![]}];}return db[_0x01c6('0xa8')][_0x01c6('0x56')](_0x5e7e29);})['then'](function(_0x358300){_0x260a25[_0x01c6('0x42')]=_0x358300;return _0x260a25;});}})[_0x01c6('0x14')](respondWithFilteredResult(_0x45bba6,_0x5e7e29))[_0x01c6('0x1c')](handleError(_0x45bba6,null));};function iftimePromise(_0x454b8d,_0x1cf51f){return respondWithRpcPromise(_0x01c6('0xed'),_0x01c6('0xee'),{'command':_0x1cf51f['timezone']?util[_0x01c6('0xa1')]('iftime\x20%s,%s',_0x454b8d[_0x01c6('0xef')],_0x1cf51f['timezone']):util['format'](_0x01c6('0xf0'),_0x454b8d['interval'])},client9002)[_0x01c6('0x14')](function(_0x237d44){var _0x46a28a=_0x237d44&&_0x237d44[_0x01c6('0xf1')]('true')>=0x0?!![]:![];logger[_0x01c6('0x15')](_0x01c6('0xf2'),_0x1cf51f['id'],_0x454b8d['id'],_0x454b8d[_0x01c6('0xef')],_0x46a28a?'ONLINE':'OFFLINE',_0x1cf51f[_0x01c6('0xf3')]?_0x1cf51f[_0x01c6('0xf3')]:_0x01c6('0xf4'));return _0x46a28a;})[_0x01c6('0x1c')](function(_0x22e68e){logger[_0x01c6('0x19')](_0x01c6('0xf2'),_0x1cf51f['id'],_0x454b8d['id'],_0x454b8d[_0x01c6('0xef')],util[_0x01c6('0xf5')](_0x22e68e,{'showHidden':![],'depth':null}),_0x1cf51f[_0x01c6('0xf3')]?_0x1cf51f[_0x01c6('0xf3')]:_0x01c6('0xf4'));return![];});}exports['getSnippet']=function(_0x5168c7,_0x52fc91){var _0x563dea=0x0;var _0x149f7c=0x0;var _0x50eb3f=![];var _0x31dac6;var _0xb3b3c;return db[_0x01c6('0x2e')][_0x01c6('0x4a')]({'where':{'id':_0x5168c7[_0x01c6('0x43')]['id']},'include':[{'model':db[_0x01c6('0xf6')],'as':_0x01c6('0xf6'),'include':[{'model':db[_0x01c6('0xf6')],'as':_0x01c6('0xf7'),'attributes':['id',_0x01c6('0xef')],'raw':!![]}]}]})[_0x01c6('0x14')](handleEntityNotFound(_0x52fc91,null))['then'](function(_0x3c778a){if(_0x3c778a){_0x31dac6=_0x3c778a;return _0x3c778a['getProactiveActions']({'raw':!![]});}})[_0x01c6('0x14')](function(_0x4c86af){if(_0x31dac6){if(_0x4c86af){_0xb3b3c=_0x4c86af;}}return require(_0x01c6('0x6b'))['getLicense']();})[_0x01c6('0x14')](function(_0x192775){if(_0x192775){_0x149f7c=_0x192775[_0x01c6('0xf8')];_0x50eb3f=_0x192775[_0x01c6('0x6d')];}})[_0x01c6('0x14')](function(){return db[_0x01c6('0xa8')]['count']({'where':{'closed':![]}});})['then'](function(_0x2b3381){_0x563dea=_0x2b3381;if(_0x149f7c&&_0x2b3381>_0x149f7c){return db[_0x01c6('0xf9')][_0x01c6('0x5b')]({'where':{'id':0x1}})[_0x01c6('0x14')](function(_0x59138a){if(_0x59138a){_0x59138a[_0x01c6('0xfa')](_0x01c6('0xfb'));}});}})[_0x01c6('0x14')](function(){if(_0x31dac6[_0x01c6('0xf6')]&&_0x31dac6['Interval'][_0x01c6('0xf7')]){var _0xbbfad0=[];for(var _0x56e445=0x0;_0x56e445<_0x31dac6['Interval'][_0x01c6('0xf7')][_0x01c6('0x37')];_0x56e445++){var _0x1c7b71=_0x31dac6[_0x01c6('0xf6')][_0x01c6('0xf7')][_0x56e445][_0x01c6('0x26')]({'plain':!![]});_0xbbfad0[_0x01c6('0xb0')](iftimePromise(_0x1c7b71,_0x31dac6));}return BPromise[_0x01c6('0xfc')](_0xbbfad0)[_0x01c6('0x14')](function(_0x421382){return _['some'](_0x421382);});}else{return!![];}})[_0x01c6('0x14')](function(_0x480e9d){var _0x51a72b=fs['readFileSync'](path[_0x01c6('0x69')](config[_0x01c6('0x6a')],_0x01c6('0xfd')),'utf8');var _0x1d4536=new url['URL'](_0x31dac6['address'])[_0x01c6('0xfe')];var _0x506d6b='3.1.0';var _0x18696e=![];var _0x554d7b={'chatVersion':_0x506d6b,'chatWebsiteAddressOrigin':_0x1d4536,'remote':_0x31dac6['remote'],'query':querystring[_0x01c6('0xa6')](_['merge'](_0x31dac6[_0x01c6('0x26')]({'plain':!![]}),{'customerIp':_0x5168c7[_0x01c6('0x7b')][_0x01c6('0x99')]||_0x5168c7['headers'][_0x01c6('0xff')]||_0x5168c7[_0x01c6('0x100')][_0x01c6('0x101')]||_0x5168c7['ip'],'referer':_0x5168c7[_0x01c6('0x7b')][_0x01c6('0x9e')],'openedInteractions':_0x563dea,'maxInteractions':_0x149f7c,'virtual':_0x50eb3f[_0x01c6('0xf8')],'online':_0x480e9d,'custom':_0x50eb3f}))[_0x01c6('0x102')](/'/g,'\x5c\x27')};_0x52fc91[_0x01c6('0x2c')](ejs[_0x01c6('0xc7')](Mustache[_0x01c6('0xc7')](_0x51a72b,_0x554d7b),{'proactiveActions':_0xb3b3c,'alignment':_0x31dac6[_0x01c6('0x103')],'verticalAlignment':_0x31dac6[_0x01c6('0x104')],'div_color':_0x31dac6[_0x01c6('0xeb')],'labelText':_0x31dac6[_0x01c6('0x105')],'text_color':_0x31dac6[_0x01c6('0x106')],'text_button_color':_0x31dac6['textButtonColor'],'button_color':_0x31dac6[_0x01c6('0x107')],'background_color':_0x31dac6[_0x01c6('0x108')],'hideWhenOffline':_0x31dac6[_0x01c6('0x109')],'intervalId':_0x31dac6[_0x01c6('0x10a')],'isDevelopment':_0x18696e,'chatVersion':_0x506d6b}));})['catch'](handleError(_0x52fc91,null));};exports[_0x01c6('0x10b')]=function(_0x5a264e,_0x3e5e56){var _0x44a7c0=_0x5a264e[_0x01c6('0x43')]['id'];var _0x4a4a90=_0x5a264e[_0x01c6('0x4c')];var _0xdbc4f4=0xc8;var _0x52fcf4=null;return db['sequelize'][_0x01c6('0x10c')]({'isolationLevel':db[_0x01c6('0xd2')][_0x01c6('0x10d')]['ISOLATION_LEVELS'][_0x01c6('0x10e')]},function(_0x1aba14){return db[_0x01c6('0x2e')][_0x01c6('0x5b')]({'where':{'id':_0x44a7c0},'transaction':_0x1aba14})[_0x01c6('0x14')](function(_0x4f2336){if(_0x4f2336){return db[_0x01c6('0x8c')][_0x01c6('0x28')]({'where':{'ChatWebsiteId':_0x44a7c0},'transaction':_0x1aba14})[_0x01c6('0x14')](function(){var _0x1cc775=_[_0x01c6('0x33')](_0x4a4a90,function(_0x344ebd){_0x344ebd[_0x01c6('0x59')]=_0x44a7c0;return _0x344ebd;});return db[_0x01c6('0x8c')][_0x01c6('0xd4')](_0x1cc775,{'transaction':_0x1aba14});});}else{_0xdbc4f4=0x194;_0x52fcf4=[];}});})['then'](function(){if(_0xdbc4f4!==0x194){return db[_0x01c6('0x8c')][_0x01c6('0x10f')]({'where':{'ChatWebsiteId':_0x44a7c0},'order':_0x01c6('0x93')})[_0x01c6('0x14')](function(_0x37f793){_0x52fcf4=_0x37f793;});}})['catch'](function(_0x4e685b){_0xdbc4f4=0x1f4;logger[_0x01c6('0x19')](_0x4e685b[_0x01c6('0x2a')]);if(_0x4e685b['name']){delete _0x4e685b[_0x01c6('0x2b')];}_0x52fcf4=_0x4e685b;})[_0x01c6('0x110')](function(){if(_0x52fcf4===null){_0x3e5e56['sendStatus'](_0xdbc4f4);}else{if(_0xdbc4f4===0x1f4){_0x3e5e56['status'](_0xdbc4f4)[_0x01c6('0x2c')](_0x52fcf4);}else{_0x3e5e56[_0x01c6('0x1d')](_0xdbc4f4)[_0x01c6('0x1f')](_0x52fcf4);}}});};exports[_0x01c6('0x111')]=function(_0x379894,_0x7a09c5){var _0x3c82cd={};var _0x15f2b7={};var _0x1cebf7;var _0x2cbbcb;return db[_0x01c6('0x2e')][_0x01c6('0x5b')]({'where':{'id':_0x379894[_0x01c6('0x43')]['id']}})[_0x01c6('0x14')](handleEntityNotFound(_0x7a09c5,null))[_0x01c6('0x14')](function(_0x340a63){if(_0x340a63){_0x1cebf7=_0x340a63;_0x15f2b7['model']=_[_0x01c6('0x46')](db['ChatApplication']['rawAttributes']);_0x15f2b7[_0x01c6('0x34')]=_[_0x01c6('0x46')](_0x379894[_0x01c6('0x34')]);_0x15f2b7[_0x01c6('0x3c')]=_[_0x01c6('0x47')](_0x15f2b7[_0x01c6('0x32')],_0x15f2b7[_0x01c6('0x34')]);_0x3c82cd[_0x01c6('0x35')]=_['intersection'](_0x15f2b7[_0x01c6('0x32')],qs[_0x01c6('0x36')](_0x379894[_0x01c6('0x34')][_0x01c6('0x36')]));_0x3c82cd[_0x01c6('0x35')]=_0x3c82cd[_0x01c6('0x35')][_0x01c6('0x37')]?_0x3c82cd[_0x01c6('0x35')]:_0x15f2b7['model'];_0x3c82cd[_0x01c6('0x3a')]=qs[_0x01c6('0x3b')](_0x379894['query'][_0x01c6('0x3b')]);_0x3c82cd['where']=qs[_0x01c6('0x3c')](_['pick'](_0x379894[_0x01c6('0x34')],_0x15f2b7[_0x01c6('0x3c')]));if(_0x379894['query'][_0x01c6('0x55')]){_0x3c82cd['where']=_[_0x01c6('0x3e')](_0x3c82cd[_0x01c6('0x3d')],{'$or':_[_0x01c6('0x33')](_0x3c82cd[_0x01c6('0x35')],function(_0x54b7bb){var _0x1ac454={};_0x1ac454[_0x54b7bb]={'$like':'%'+_0x379894[_0x01c6('0x34')][_0x01c6('0x55')]+'%'};return _0x1ac454;})});}_0x3c82cd=_[_0x01c6('0x3e')]({},_0x3c82cd,_0x379894['options']);return _0x1cebf7[_0x01c6('0x111')](_0x3c82cd);}})[_0x01c6('0x14')](function(_0x29f90d){if(_0x29f90d){_0x2cbbcb=_0x29f90d[_0x01c6('0x37')];if(!_0x379894[_0x01c6('0x34')][_0x01c6('0x38')](_0x01c6('0x39'))){_0x3c82cd[_0x01c6('0x22')]=qs[_0x01c6('0x22')](_0x379894[_0x01c6('0x34')][_0x01c6('0x22')]);_0x3c82cd[_0x01c6('0x20')]=qs[_0x01c6('0x20')](_0x379894[_0x01c6('0x34')]['offset']);}return _0x1cebf7[_0x01c6('0x111')](_0x3c82cd);}})[_0x01c6('0x14')](function(_0x1de683){if(_0x1de683){return _0x1de683?{'count':_0x2cbbcb,'rows':_0x1de683}:null;}})[_0x01c6('0x14')](respondWithResult(_0x7a09c5,null))[_0x01c6('0x1c')](handleError(_0x7a09c5,null));};exports[_0x01c6('0x112')]=function(_0x18e348,_0x4b18c2){return db[_0x01c6('0x113')][_0x01c6('0x4a')]({'where':{'id':_0x18e348[_0x01c6('0x43')]['id']}})['then'](handleEntityNotFound(_0x4b18c2,null))[_0x01c6('0x14')](function(_0x295781){if(_0x295781){return _0x295781[_0x01c6('0x112')](_0x18e348[_0x01c6('0x4c')][_0x01c6('0x57')],_[_0x01c6('0xe4')](_0x18e348[_0x01c6('0x4c')],[_0x01c6('0x57'),'id'])||{});}})[_0x01c6('0x14')](respondWithResult(_0x4b18c2,null))[_0x01c6('0x1c')](handleError(_0x4b18c2,null));};exports[_0x01c6('0x114')]=function(_0x3546b4,_0x57764d){var _0x4cc779={};var _0x172c13={};var _0x13f4ec;var _0x3adac5;return db['ChatWebsite']['findOne']({'where':{'id':_0x3546b4[_0x01c6('0x43')]['id']}})['then'](handleEntityNotFound(_0x57764d,null))[_0x01c6('0x14')](function(_0x3f1408){if(_0x3f1408){_0x13f4ec=_0x3f1408;_0x172c13[_0x01c6('0x32')]=_[_0x01c6('0x46')](db[_0x01c6('0x115')][_0x01c6('0x2f')]);_0x172c13['query']=_['keys'](_0x3546b4[_0x01c6('0x34')]);_0x172c13[_0x01c6('0x3c')]=_[_0x01c6('0x47')](_0x172c13[_0x01c6('0x32')],_0x172c13[_0x01c6('0x34')]);_0x4cc779[_0x01c6('0x35')]=_[_0x01c6('0x47')](_0x172c13['model'],qs[_0x01c6('0x36')](_0x3546b4['query']['fields']));_0x4cc779['attributes']=_0x4cc779[_0x01c6('0x35')][_0x01c6('0x37')]?_0x4cc779[_0x01c6('0x35')]:_0x172c13[_0x01c6('0x32')];_0x4cc779[_0x01c6('0x3a')]=qs[_0x01c6('0x3b')](_0x3546b4[_0x01c6('0x34')]['sort']);_0x4cc779[_0x01c6('0x3d')]=qs[_0x01c6('0x3c')](_[_0x01c6('0x5d')](_0x3546b4[_0x01c6('0x34')],_0x172c13[_0x01c6('0x3c')]));if(_0x3546b4[_0x01c6('0x34')][_0x01c6('0x55')]){_0x4cc779[_0x01c6('0x3d')]=_[_0x01c6('0x3e')](_0x4cc779[_0x01c6('0x3d')],{'$or':_[_0x01c6('0x33')](_0x4cc779['attributes'],function(_0xa99809){var _0x37c049={};_0x37c049[_0xa99809]={'$like':'%'+_0x3546b4[_0x01c6('0x34')][_0x01c6('0x55')]+'%'};return _0x37c049;})});}_0x4cc779=_['merge']({},_0x4cc779,_0x3546b4[_0x01c6('0x41')]);return _0x13f4ec['getProactiveActions'](_0x4cc779);}})[_0x01c6('0x14')](function(_0x1d1d1f){if(_0x1d1d1f){_0x3adac5=_0x1d1d1f[_0x01c6('0x37')];if(!_0x3546b4['query'][_0x01c6('0x38')](_0x01c6('0x39'))){_0x4cc779[_0x01c6('0x22')]=qs['limit'](_0x3546b4['query'][_0x01c6('0x22')]);_0x4cc779['offset']=qs[_0x01c6('0x20')](_0x3546b4['query']['offset']);}return _0x13f4ec[_0x01c6('0x114')](_0x4cc779);}})[_0x01c6('0x14')](function(_0x48fd07){if(_0x48fd07){return _0x48fd07?{'count':_0x3adac5,'rows':_0x48fd07}:null;}})[_0x01c6('0x14')](respondWithResult(_0x57764d,null))[_0x01c6('0x1c')](handleError(_0x57764d,null));};exports[_0x01c6('0x116')]=function(_0x4a7d1d,_0x45c720){var _0x365d6e=_0x4a7d1d[_0x01c6('0x34')][_0x01c6('0x117')]==='false'?'offlineForm':_0x01c6('0x118');return db[_0x01c6('0x2e')][_0x01c6('0x4a')]({'attributes':['id',_0x365d6e],'where':{'id':_0x4a7d1d[_0x01c6('0x43')]['id']}})[_0x01c6('0x14')](handleEntityNotFound(_0x45c720,null))[_0x01c6('0x14')](function(_0x3b0683){if(_0x3b0683){var _0x95d7d0=_0x3b0683[_0x365d6e];var _0x261d62=_0x95d7d0&&_0x95d7d0['items']?_0x95d7d0[_0x01c6('0x119')]:[];_0x45c720[_0x01c6('0x2c')]({'fromKey':_['isNil'](_0x95d7d0[_0x01c6('0x11a')])?undefined:_0x95d7d0[_0x01c6('0x11a')],'count':_0x261d62[_0x01c6('0x37')],'rows':_0x261d62});}})[_0x01c6('0x1c')](handleError(_0x45c720,null));};exports[_0x01c6('0x11b')]=function(_0x34d5eb,_0x269cd8){var _0x5f1785={'raw':![],'where':{}};var _0x4ac78e={};var _0x432369={'count':0x0,'rows':[]};return db[_0x01c6('0x2e')][_0x01c6('0x5b')]({'where':{'id':_0x34d5eb['params']['id']}})[_0x01c6('0x14')](handleEntityNotFound(_0x269cd8,null))[_0x01c6('0x14')](function(_0xfa3890){if(_0xfa3890){_0x4ac78e['model']=_[_0x01c6('0x46')](db[_0x01c6('0xc9')][_0x01c6('0x2f')]);_0x4ac78e[_0x01c6('0x34')]=_['keys'](_0x34d5eb[_0x01c6('0x34')]);_0x4ac78e[_0x01c6('0x3c')]=_[_0x01c6('0x47')](_0x4ac78e[_0x01c6('0x32')],_0x4ac78e[_0x01c6('0x34')]);_0x5f1785['attributes']=_[_0x01c6('0x47')](_0x4ac78e['model'],qs[_0x01c6('0x36')](_0x34d5eb[_0x01c6('0x34')][_0x01c6('0x36')]));_0x5f1785[_0x01c6('0x35')]=_0x5f1785[_0x01c6('0x35')]['length']?_0x5f1785['attributes']:_0x4ac78e[_0x01c6('0x32')];if(!_0x34d5eb['query'][_0x01c6('0x38')](_0x01c6('0x39'))){_0x5f1785[_0x01c6('0x22')]=qs['limit'](_0x34d5eb[_0x01c6('0x34')][_0x01c6('0x22')]);_0x5f1785[_0x01c6('0x20')]=qs[_0x01c6('0x20')](_0x34d5eb[_0x01c6('0x34')][_0x01c6('0x20')]);}_0x5f1785[_0x01c6('0x3a')]=qs['sort'](_0x34d5eb[_0x01c6('0x34')][_0x01c6('0x3b')]);_0x5f1785[_0x01c6('0x3d')]=qs[_0x01c6('0x3c')](_['pick'](_0x34d5eb[_0x01c6('0x34')],_0x4ac78e['filters']));_0x5f1785[_0x01c6('0x3d')]['ChatWebsiteId']=_0xfa3890['id'];if(_0x34d5eb[_0x01c6('0x34')][_0x01c6('0x55')]){_0x5f1785[_0x01c6('0x3d')]=_[_0x01c6('0x3e')](_0x5f1785['where'],{'$or':_[_0x01c6('0x33')](_0x5f1785[_0x01c6('0x35')],function(_0x4e5512){var _0x4ec163={};_0x4ec163[_0x4e5512]={'$like':'%'+_0x34d5eb[_0x01c6('0x34')]['filter']+'%'};return _0x4ec163;})});}_0x5f1785=_[_0x01c6('0x3e')]({},_0x5f1785,_0x34d5eb['options']);return db[_0x01c6('0xc9')][_0x01c6('0x23')]({'where':_0x5f1785[_0x01c6('0x3d')]})[_0x01c6('0x14')](function(_0x164d79){_0x432369[_0x01c6('0x23')]=_0x164d79;if(_0x34d5eb['query'][_0x01c6('0x48')]){_0x5f1785[_0x01c6('0x49')]=[{'all':!![]}];}else{_0x5f1785[_0x01c6('0x49')]=[{'model':db[_0x01c6('0x7e')],'as':_0x01c6('0xe6'),'required':![]},{'model':db['Attachment'],'as':_0x01c6('0x11c'),'required':![]}];}return db[_0x01c6('0xc9')][_0x01c6('0x56')](_0x5f1785);})['then'](function(_0x2e040e){_0x432369[_0x01c6('0x42')]=_0x2e040e;return _0x432369;});}})[_0x01c6('0x14')](respondWithFilteredResult(_0x269cd8,_0x5f1785))[_0x01c6('0x1c')](handleError(_0x269cd8,null));};exports[_0x01c6('0x11d')]=function(_0x2f1608,_0x2bc974){return db[_0x01c6('0x2e')][_0x01c6('0x4a')]({'where':{'id':_0x2f1608[_0x01c6('0x43')]['id']}})[_0x01c6('0x14')](handleEntityNotFound(_0x2bc974,null))['then'](function(_0x52cd9d){if(_0x52cd9d){return _0x52cd9d[_0x01c6('0x11d')](_0x2f1608[_0x01c6('0x4c')][_0x01c6('0x57')],_[_0x01c6('0xe4')](_0x2f1608['body'],[_0x01c6('0x57'),'id'])||{})['spread'](function(_0xa1a828){for(var _0x9c1c50=0x0;_0x9c1c50<_0x2f1608[_0x01c6('0x4c')][_0x01c6('0x57')]['length'];_0x9c1c50+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x2f1608[_0x01c6('0x4c')][_0x01c6('0x57')][_0x9c1c50]),'ChatWebsiteId':Number(_0x2f1608[_0x01c6('0x43')]['id'])});}return _0xa1a828;});}})[_0x01c6('0x14')](respondWithResult(_0x2bc974,null))['catch'](handleError(_0x2bc974,null));};exports['removeAgents']=function(_0x20b905,_0x2fe409){return db['ChatWebsite'][_0x01c6('0x4a')]({'where':{'id':_0x20b905[_0x01c6('0x43')]['id']}})[_0x01c6('0x14')](handleEntityNotFound(_0x2fe409,null))[_0x01c6('0x14')](function(_0x3b5664){if(_0x3b5664){return _0x3b5664[_0x01c6('0x11e')](_0x20b905['query'][_0x01c6('0x57')])[_0x01c6('0x14')](function(){if(_['isArray'](_0x20b905['query'][_0x01c6('0x57')])){for(var _0x4fe9a6=0x0;_0x4fe9a6<_0x20b905[_0x01c6('0x34')][_0x01c6('0x57')][_0x01c6('0x37')];_0x4fe9a6+=0x1){socket['emit'](_0x01c6('0x11f'),{'UserId':Number(_0x20b905['query'][_0x01c6('0x57')][_0x4fe9a6]),'ChatWebsiteId':Number(_0x20b905[_0x01c6('0x43')]['id'])});}}else{socket[_0x01c6('0x120')](_0x01c6('0x11f'),{'UserId':Number(_0x20b905[_0x01c6('0x34')][_0x01c6('0x57')]),'ChatWebsiteId':Number(_0x20b905[_0x01c6('0x43')]['id'])});}});}})['then'](respondWithStatusCode(_0x2fe409,null))[_0x01c6('0x1c')](handleError(_0x2fe409,null));};exports[_0x01c6('0x121')]=function(_0x107e01,_0x469d4e){var _0x52075d={};var _0x1d3c14={};var _0x4a0a91;var _0x1bacda;return db[_0x01c6('0x2e')][_0x01c6('0x5b')]({'where':{'id':_0x107e01[_0x01c6('0x43')]['id']}})[_0x01c6('0x14')](handleEntityNotFound(_0x469d4e,null))['then'](function(_0x8ab039){if(_0x8ab039){_0x4a0a91=_0x8ab039;_0x1d3c14[_0x01c6('0x32')]=_[_0x01c6('0x46')](db['User']['rawAttributes']);_0x1d3c14['query']=_[_0x01c6('0x46')](_0x107e01['query']);_0x1d3c14[_0x01c6('0x3c')]=_[_0x01c6('0x47')](_0x1d3c14[_0x01c6('0x32')],_0x1d3c14[_0x01c6('0x34')]);_0x52075d['attributes']=_[_0x01c6('0x47')](_0x1d3c14[_0x01c6('0x32')],qs[_0x01c6('0x36')](_0x107e01[_0x01c6('0x34')]['fields']));_0x52075d['attributes']=_0x52075d[_0x01c6('0x35')]['length']?_0x52075d['attributes']:_0x1d3c14[_0x01c6('0x32')];_0x52075d[_0x01c6('0x3a')]=qs['sort'](_0x107e01['query']['sort']);_0x52075d[_0x01c6('0x3d')]=qs[_0x01c6('0x3c')](_[_0x01c6('0x5d')](_0x107e01[_0x01c6('0x34')],_0x1d3c14[_0x01c6('0x3c')]));if(_0x107e01[_0x01c6('0x34')][_0x01c6('0x55')]){_0x52075d[_0x01c6('0x3d')]=_['merge'](_0x52075d['where'],{'$or':_[_0x01c6('0x33')](_0x52075d['attributes'],function(_0x269845){var _0x27ad50={};_0x27ad50[_0x269845]={'$like':'%'+_0x107e01[_0x01c6('0x34')]['filter']+'%'};return _0x27ad50;})});}_0x52075d=_['merge']({},_0x52075d,_0x107e01[_0x01c6('0x41')]);return _0x4a0a91['getAgents'](_0x52075d);}})[_0x01c6('0x14')](function(_0xe5c04d){if(_0xe5c04d){_0x1bacda=_0xe5c04d[_0x01c6('0x37')];if(!_0x107e01[_0x01c6('0x34')]['hasOwnProperty'](_0x01c6('0x39'))){_0x52075d[_0x01c6('0x22')]=qs['limit'](_0x107e01[_0x01c6('0x34')][_0x01c6('0x22')]);_0x52075d[_0x01c6('0x20')]=qs[_0x01c6('0x20')](_0x107e01['query']['offset']);}return _0x4a0a91[_0x01c6('0x121')](_0x52075d);}})['then'](function(_0x288302){if(_0x288302){return _0x288302?{'count':_0x1bacda,'rows':_0x288302}:null;}})['then'](respondWithResult(_0x469d4e,null))[_0x01c6('0x1c')](handleError(_0x469d4e,null));};
\ No newline at end of file
+var _0x8e3c=['List','CmContact','Contacts','DESC','ChatApplication','account','applications','Applications','list','contact','headers','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','spread','messageId','interaction','created','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','EventManager','offline','files','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','fromString','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','transaction','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','subjectOffline','toPairsIn','mapValues','email','Chat','MailAccountId','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','User','Owner','fullname','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','some','readFileSync','URL','origin','connection','remoteAddress','referer','replace','verticalAlignment','labelText','textColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','finally','getApplications','addProactiveActions','omit','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachment','Attachments','addAgents','userChatWebsite:save','removeAgents','userChatWebsite:remove','emit','getAgents','bluebird','util','ejs','fs-extra','lodash','ioredis','api','../../config/environment','url','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','client','http','request','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','get','ChatWebsites','UserProfileResource','sendStatus','stack','name','index','Pause','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','ChatWebsite','include','findAll','rows','catch','show','mandatoryDispositionPause','length','includeAll','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','update','params','describe','ChatWebsiteId','Disposition','findOne','pick','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','sitepic','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','filename','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','notify','user-agent-parser','setUA','getResult','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList'];(function(_0x3a04f4,_0x325bea){var _0x49a842=function(_0x480659){while(--_0x480659){_0x3a04f4['push'](_0x3a04f4['shift']());}};_0x49a842(++_0x325bea);}(_0x8e3c,0x1c2));var _0xc8e3=function(_0x119cd8,_0x556b73){_0x119cd8=_0x119cd8-0x0;var _0x7072a3=_0x8e3c[_0x119cd8];return _0x7072a3;};'use strict';var BPromise=require(_0xc8e3('0x0'));var Mustache=require('mustache');var util=require(_0xc8e3('0x1'));var path=require('path');var ejs=require(_0xc8e3('0x2'));var fs=require('fs');var fs_extra=require(_0xc8e3('0x3'));var _=require(_0xc8e3('0x4'));var querystring=require('querystring');var Redis=require(_0xc8e3('0x5'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xc8e3('0x6'));var config=require(_0xc8e3('0x7'));var url=require(_0xc8e3('0x8'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xc8e3('0x9')](config[_0xc8e3('0xa')],{'host':_0xc8e3('0xb'),'port':0x18eb});var socket=require(_0xc8e3('0xc'))(new Redis(config['redis']));require(_0xc8e3('0xd'))['register'](socket);var htmlToText=require(_0xc8e3('0xe'));var jayson=require('jayson/promise');var client=jayson[_0xc8e3('0xf')]['http']({'port':0x232c});var client9002=jayson[_0xc8e3('0xf')]['http']({'port':0x232a});var client9003=jayson['client'][_0xc8e3('0x10')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x4e5799,_0x4bd85a,_0x59917d,_0x467c1d){return new BPromise(function(_0x2c0b29,_0x6d5418){var _0x4fd0e1=_0x467c1d||client;return _0x4fd0e1[_0xc8e3('0x11')](_0x4e5799,_0x59917d)['then'](function(_0x2e6ac2){logger[_0xc8e3('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x4bd85a,_0xc8e3('0x13'));logger[_0xc8e3('0x14')](_0xc8e3('0x15'),_0x4bd85a,_0xc8e3('0x13'),JSON[_0xc8e3('0x16')](_0x2e6ac2));if(_0x2e6ac2[_0xc8e3('0x17')]){if(_0x2e6ac2[_0xc8e3('0x17')]['code']===0x1f4){logger[_0xc8e3('0x17')](_0xc8e3('0x18'),_0x4bd85a,_0x2e6ac2[_0xc8e3('0x17')][_0xc8e3('0x19')]);return _0x6d5418(_0x2e6ac2[_0xc8e3('0x17')]['message']);}logger[_0xc8e3('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x4bd85a,_0x2e6ac2['error'][_0xc8e3('0x19')]);return _0x2c0b29(_0x2e6ac2[_0xc8e3('0x17')][_0xc8e3('0x19')]);}else{logger[_0xc8e3('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x4bd85a,'request\x20sent');_0x2c0b29(_0x2e6ac2[_0xc8e3('0x1a')]['message']);}})['catch'](function(_0x1ea732){logger[_0xc8e3('0x17')](_0xc8e3('0x18'),_0x4bd85a,_0x1ea732);_0x6d5418(_0x1ea732);});});}function respondWithStatusCode(_0x48e379,_0x447ef5){_0x447ef5=_0x447ef5||0xcc;return function(_0x37c41e){if(_0x37c41e){return _0x48e379['sendStatus'](_0x447ef5);}return _0x48e379[_0xc8e3('0x1b')](_0x447ef5)[_0xc8e3('0x1c')]();};}function respondWithResult(_0x1f7660,_0x1d89a0){_0x1d89a0=_0x1d89a0||0xc8;return function(_0x504d7f){if(_0x504d7f){return _0x1f7660['status'](_0x1d89a0)[_0xc8e3('0x1d')](_0x504d7f);}};}function respondWithFilteredResult(_0x2e769d,_0x1b900f){return function(_0x337c7c){if(_0x337c7c){var _0xd45b7=typeof _0x1b900f[_0xc8e3('0x1e')]===_0xc8e3('0x1f')&&typeof _0x1b900f[_0xc8e3('0x20')]===_0xc8e3('0x1f');var _0x2f0037=_0x337c7c['count'];var _0x5a604b=_0xd45b7?0x0:_0x1b900f[_0xc8e3('0x1e')];var _0xc9f368=_0xd45b7?_0x337c7c[_0xc8e3('0x21')]:_0x1b900f[_0xc8e3('0x1e')]+_0x1b900f[_0xc8e3('0x20')];var _0x16afce;if(_0xc9f368>=_0x2f0037){_0xc9f368=_0x2f0037;_0x16afce=0xc8;}else{_0x16afce=0xce;}_0x2e769d['status'](_0x16afce);return _0x2e769d[_0xc8e3('0x22')](_0xc8e3('0x23'),_0x5a604b+'-'+_0xc9f368+'/'+_0x2f0037)['json'](_0x337c7c);}return null;};}function saveUpdates(_0x153c8d){return function(_0x1d373b){if(_0x1d373b){return _0x1d373b['update'](_0x153c8d)[_0xc8e3('0x24')](function(_0x395b13){return _0x395b13;});}return null;};}function removeEntity(_0x389dcb){return function(_0x7a9379){if(_0x7a9379){return _0x7a9379[_0xc8e3('0x25')]()[_0xc8e3('0x24')](function(){var _0x19ccac=_0x7a9379[_0xc8e3('0x26')]({'plain':!![]});var _0x4a996c=_0xc8e3('0x27');return db[_0xc8e3('0x28')][_0xc8e3('0x25')]({'where':{'type':_0x4a996c,'resourceId':_0x19ccac['id']}})[_0xc8e3('0x24')](function(){return _0x7a9379;});})[_0xc8e3('0x24')](function(){_0x389dcb[_0xc8e3('0x1b')](0xcc)[_0xc8e3('0x1c')]();});}};}function handleEntityNotFound(_0x370b9c){return function(_0x5b8b3c){if(!_0x5b8b3c){_0x370b9c[_0xc8e3('0x29')](0x194);}return _0x5b8b3c;};}function handleError(_0x519457,_0x2acf8d){_0x2acf8d=_0x2acf8d||0x1f4;return function(_0x5782f7){logger[_0xc8e3('0x17')](_0x5782f7[_0xc8e3('0x2a')]);if(_0x5782f7[_0xc8e3('0x2b')]){delete _0x5782f7[_0xc8e3('0x2b')];}_0x519457['status'](_0x2acf8d)['send'](_0x5782f7);};}exports[_0xc8e3('0x2c')]=function(_0x147f60,_0xdbf802){var _0x31cbd4={'include':[{'model':db[_0xc8e3('0x2d')],'as':'mandatoryDispositionPause'}]},_0x5646c9={},_0x58b161={'count':0x0,'rows':[]};var _0x555e2d=_[_0xc8e3('0x2e')](db['ChatWebsite'][_0xc8e3('0x2f')],function(_0x35e9cd){return{'name':_0x35e9cd[_0xc8e3('0x30')],'type':_0x35e9cd[_0xc8e3('0x31')]['key']};});_0x5646c9[_0xc8e3('0x32')]=_['map'](_0x555e2d,_0xc8e3('0x2b'));_0x5646c9[_0xc8e3('0x33')]=_[_0xc8e3('0x34')](_0x147f60[_0xc8e3('0x33')]);_0x5646c9[_0xc8e3('0x35')]=_[_0xc8e3('0x36')](_0x5646c9[_0xc8e3('0x32')],_0x5646c9['query']);_0x31cbd4[_0xc8e3('0x37')]=_[_0xc8e3('0x36')](_0x5646c9['model'],qs[_0xc8e3('0x38')](_0x147f60[_0xc8e3('0x33')]['fields']));_0x31cbd4[_0xc8e3('0x37')]=_0x31cbd4[_0xc8e3('0x37')]['length']?_0x31cbd4[_0xc8e3('0x37')]:_0x5646c9['model'];if(!_0x147f60[_0xc8e3('0x33')][_0xc8e3('0x39')](_0xc8e3('0x3a'))){_0x31cbd4['limit']=qs[_0xc8e3('0x20')](_0x147f60['query'][_0xc8e3('0x20')]);_0x31cbd4['offset']=qs[_0xc8e3('0x1e')](_0x147f60['query'][_0xc8e3('0x1e')]);}_0x31cbd4[_0xc8e3('0x3b')]=qs[_0xc8e3('0x3c')](_0x147f60[_0xc8e3('0x33')]['sort']);_0x31cbd4[_0xc8e3('0x3d')]=qs[_0xc8e3('0x35')](_['pick'](_0x147f60['query'],_0x5646c9[_0xc8e3('0x35')]),_0x555e2d);if(_0x147f60['query'][_0xc8e3('0x3e')]){_0x31cbd4[_0xc8e3('0x3d')]=_[_0xc8e3('0x3f')](_0x31cbd4[_0xc8e3('0x3d')],{'$or':_[_0xc8e3('0x2e')](_0x555e2d,function(_0x259aea){if(_0x259aea['type']!=='VIRTUAL'){var _0x53c5a2={};_0x53c5a2[_0x259aea['name']]={'$like':'%'+_0x147f60[_0xc8e3('0x33')][_0xc8e3('0x3e')]+'%'};return _0x53c5a2;}})});}_0x31cbd4=_['merge']({},_0x31cbd4,_0x147f60[_0xc8e3('0x40')]);var _0x445f3f={'where':_0x31cbd4[_0xc8e3('0x3d')]};return db[_0xc8e3('0x41')][_0xc8e3('0x21')](_0x445f3f)[_0xc8e3('0x24')](function(_0x17ff26){_0x58b161[_0xc8e3('0x21')]=_0x17ff26;if(_0x147f60[_0xc8e3('0x33')]['includeAll']){_0x31cbd4[_0xc8e3('0x42')]=[{'all':!![]}];}return db['ChatWebsite'][_0xc8e3('0x43')](_0x31cbd4);})['then'](function(_0x53d0ed){_0x58b161[_0xc8e3('0x44')]=_0x53d0ed;return _0x58b161;})[_0xc8e3('0x24')](respondWithFilteredResult(_0xdbf802,_0x31cbd4))[_0xc8e3('0x45')](handleError(_0xdbf802,null));};exports[_0xc8e3('0x46')]=function(_0x5ccfdb,_0x3e1c49){var _0x340a20={'raw':![],'where':{'id':_0x5ccfdb['params']['id']},'include':[{'model':db['Pause'],'as':_0xc8e3('0x47')}]},_0x3d4ba6={};_0x3d4ba6[_0xc8e3('0x32')]=_['keys'](db[_0xc8e3('0x41')][_0xc8e3('0x2f')]);_0x3d4ba6['query']=_[_0xc8e3('0x34')](_0x5ccfdb['query']);_0x3d4ba6['filters']=_[_0xc8e3('0x36')](_0x3d4ba6['model'],_0x3d4ba6['query']);_0x340a20['attributes']=_[_0xc8e3('0x36')](_0x3d4ba6['model'],qs[_0xc8e3('0x38')](_0x5ccfdb[_0xc8e3('0x33')][_0xc8e3('0x38')]));_0x340a20[_0xc8e3('0x37')]=_0x340a20[_0xc8e3('0x37')][_0xc8e3('0x48')]?_0x340a20[_0xc8e3('0x37')]:_0x3d4ba6[_0xc8e3('0x32')];if(_0x5ccfdb['query'][_0xc8e3('0x49')]){_0x340a20[_0xc8e3('0x42')]=[{'all':!![]}];}_0x340a20=_[_0xc8e3('0x3f')]({},_0x340a20,_0x5ccfdb[_0xc8e3('0x40')]);return db[_0xc8e3('0x41')][_0xc8e3('0x4a')](_0x340a20)[_0xc8e3('0x24')](handleEntityNotFound(_0x3e1c49,null))[_0xc8e3('0x24')](respondWithResult(_0x3e1c49,null))[_0xc8e3('0x45')](handleError(_0x3e1c49,null));};exports[_0xc8e3('0x4b')]=function(_0x2b1cd7,_0x235d28){return db[_0xc8e3('0x41')][_0xc8e3('0x4b')](_0x2b1cd7[_0xc8e3('0x4c')],{})['then'](function(_0x4e4102){var _0x5681bf=_0x2b1cd7[_0xc8e3('0x4d')][_0xc8e3('0x26')]({'plain':!![]});if(!_0x5681bf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5681bf['role']===_0xc8e3('0x4d')){var _0x5133f5=_0x4e4102['get']({'plain':!![]});var _0x468e61=_0xc8e3('0x27');return db[_0xc8e3('0x4e')][_0xc8e3('0x4a')]({'where':{'name':_0x468e61,'userProfileId':_0x5681bf[_0xc8e3('0x4f')]},'raw':!![]})['then'](function(_0x59032e){if(_0x59032e&&_0x59032e[_0xc8e3('0x50')]===0x0){return db[_0xc8e3('0x28')][_0xc8e3('0x4b')]({'name':_0x5133f5[_0xc8e3('0x2b')],'resourceId':_0x5133f5['id'],'type':_0x59032e[_0xc8e3('0x2b')],'sectionId':_0x59032e['id']},{})[_0xc8e3('0x24')](function(){return _0x4e4102;});}else{return _0x4e4102;}})[_0xc8e3('0x45')](function(_0x5bcb34){logger[_0xc8e3('0x17')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5bcb34);throw _0x5bcb34;});}return _0x4e4102;})[_0xc8e3('0x24')](respondWithResult(_0x235d28,0xc9))[_0xc8e3('0x45')](handleError(_0x235d28,null));};exports[_0xc8e3('0x51')]=function(_0x4d2201,_0xc874c3){if(_0x4d2201[_0xc8e3('0x4c')]['id']){delete _0x4d2201['body']['id'];}return db[_0xc8e3('0x41')]['find']({'where':{'id':_0x4d2201[_0xc8e3('0x52')]['id']},'include':[{'model':db[_0xc8e3('0x2d')],'as':_0xc8e3('0x47')}]})[_0xc8e3('0x24')](handleEntityNotFound(_0xc874c3,null))['then'](saveUpdates(_0x4d2201['body'],null))[_0xc8e3('0x24')](respondWithResult(_0xc874c3,null))[_0xc8e3('0x45')](handleError(_0xc874c3,null));};exports[_0xc8e3('0x25')]=function(_0x46b15f,_0x323c23){return db['ChatWebsite'][_0xc8e3('0x4a')]({'where':{'id':_0x46b15f['params']['id']}})[_0xc8e3('0x24')](handleEntityNotFound(_0x323c23,null))[_0xc8e3('0x24')](removeEntity(_0x323c23,null))[_0xc8e3('0x45')](handleError(_0x323c23,null));};exports[_0xc8e3('0x53')]=function(_0x3c5238,_0x7847ec){return db['ChatWebsite']['describe']()[_0xc8e3('0x24')](respondWithResult(_0x7847ec,null))['catch'](handleError(_0x7847ec,null));};exports['addDisposition']=function(_0x553ab7,_0x3e49bd){if(_0x553ab7[_0xc8e3('0x4c')]['id']){delete _0x553ab7[_0xc8e3('0x4c')]['id'];}return db['ChatWebsite'][_0xc8e3('0x4a')]({'where':{'id':_0x553ab7['params']['id']}})[_0xc8e3('0x24')](handleEntityNotFound(_0x3e49bd,null))[_0xc8e3('0x24')](function(_0x5c11d0){if(_0x5c11d0){_0x553ab7['body'][_0xc8e3('0x54')]=_0x5c11d0['id'];return db[_0xc8e3('0x55')][_0xc8e3('0x4b')](_0x553ab7[_0xc8e3('0x4c')]);}})['then'](respondWithResult(_0x3e49bd,null))[_0xc8e3('0x45')](handleError(_0x3e49bd,null));};exports['getDispositions']=function(_0x2f0944,_0x4b97b8){var _0xa4f420={'raw':![],'where':{}};var _0x15e23c={};var _0x163f41={'count':0x0,'rows':[]};return db[_0xc8e3('0x41')][_0xc8e3('0x56')]({'where':{'id':_0x2f0944[_0xc8e3('0x52')]['id']}})['then'](handleEntityNotFound(_0x4b97b8,null))[_0xc8e3('0x24')](function(_0x41a432){if(_0x41a432){_0x15e23c[_0xc8e3('0x32')]=_['keys'](db[_0xc8e3('0x55')]['rawAttributes']);_0x15e23c[_0xc8e3('0x33')]=_['keys'](_0x2f0944[_0xc8e3('0x33')]);_0x15e23c[_0xc8e3('0x35')]=_[_0xc8e3('0x36')](_0x15e23c[_0xc8e3('0x32')],_0x15e23c[_0xc8e3('0x33')]);_0xa4f420[_0xc8e3('0x37')]=_[_0xc8e3('0x36')](_0x15e23c[_0xc8e3('0x32')],qs[_0xc8e3('0x38')](_0x2f0944[_0xc8e3('0x33')]['fields']));_0xa4f420[_0xc8e3('0x37')]=_0xa4f420[_0xc8e3('0x37')][_0xc8e3('0x48')]?_0xa4f420[_0xc8e3('0x37')]:_0x15e23c[_0xc8e3('0x32')];if(!_0x2f0944['query'][_0xc8e3('0x39')]('nolimit')){_0xa4f420[_0xc8e3('0x20')]=qs[_0xc8e3('0x20')](_0x2f0944[_0xc8e3('0x33')][_0xc8e3('0x20')]);_0xa4f420[_0xc8e3('0x1e')]=qs[_0xc8e3('0x1e')](_0x2f0944[_0xc8e3('0x33')][_0xc8e3('0x1e')]);}_0xa4f420[_0xc8e3('0x3b')]=qs[_0xc8e3('0x3c')](_0x2f0944['query'][_0xc8e3('0x3c')]);_0xa4f420['where']=qs[_0xc8e3('0x35')](_[_0xc8e3('0x57')](_0x2f0944[_0xc8e3('0x33')],_0x15e23c[_0xc8e3('0x35')]));_0xa4f420[_0xc8e3('0x3d')][_0xc8e3('0x54')]=_0x41a432['id'];if(_0x2f0944[_0xc8e3('0x33')]['filter']){_0xa4f420[_0xc8e3('0x3d')]=_[_0xc8e3('0x3f')](_0xa4f420['where'],{'$or':_[_0xc8e3('0x2e')](_0xa4f420['attributes'],function(_0x109f75){var _0x47daaa={};_0x47daaa[_0x109f75]={'$like':'%'+_0x2f0944[_0xc8e3('0x33')][_0xc8e3('0x3e')]+'%'};return _0x47daaa;})});}_0xa4f420=_[_0xc8e3('0x3f')]({},_0xa4f420,_0x2f0944[_0xc8e3('0x40')]);return db['Disposition'][_0xc8e3('0x21')]({'where':_0xa4f420['where']})[_0xc8e3('0x24')](function(_0x5757c0){_0x163f41[_0xc8e3('0x21')]=_0x5757c0;if(_0x2f0944['query'][_0xc8e3('0x49')]){_0xa4f420[_0xc8e3('0x42')]=[{'all':!![]}];}return db[_0xc8e3('0x55')][_0xc8e3('0x43')](_0xa4f420);})['then'](function(_0x567b96){_0x163f41[_0xc8e3('0x44')]=_0x567b96;return _0x163f41;});}})[_0xc8e3('0x24')](respondWithFilteredResult(_0x4b97b8,_0xa4f420))[_0xc8e3('0x45')](handleError(_0x4b97b8,null));};exports[_0xc8e3('0x58')]=function(_0x20ff86,_0x21e211){return db['ChatWebsite']['find']({'where':{'id':_0x20ff86['params']['id']}})[_0xc8e3('0x24')](handleEntityNotFound(_0x21e211,null))['then'](function(_0x51658f){if(_0x51658f){return _0x51658f['removeDispositions'](_0x20ff86[_0xc8e3('0x33')]['ids']);}})[_0xc8e3('0x24')](respondWithStatusCode(_0x21e211,null))[_0xc8e3('0x45')](handleError(_0x21e211,null));};exports[_0xc8e3('0x59')]=function(_0x2350ab,_0x595fb7){if(_0x2350ab[_0xc8e3('0x4c')]['id']){delete _0x2350ab[_0xc8e3('0x4c')]['id'];}return db[_0xc8e3('0x41')]['find']({'where':{'id':_0x2350ab[_0xc8e3('0x52')]['id']}})[_0xc8e3('0x24')](handleEntityNotFound(_0x595fb7,null))[_0xc8e3('0x24')](function(_0x4656f9){if(_0x4656f9){_0x2350ab[_0xc8e3('0x4c')][_0xc8e3('0x54')]=_0x4656f9['id'];return db[_0xc8e3('0x5a')][_0xc8e3('0x4b')](_0x2350ab[_0xc8e3('0x4c')]);}})['then'](respondWithResult(_0x595fb7,null))[_0xc8e3('0x45')](handleError(_0x595fb7,null));};exports[_0xc8e3('0x5b')]=function(_0x49e860,_0x2fca37){var _0x49fb52={'raw':![],'where':{}};var _0xa6e5bb={};var _0x198c71={'count':0x0,'rows':[]};return db[_0xc8e3('0x41')][_0xc8e3('0x56')]({'where':{'id':_0x49e860[_0xc8e3('0x52')]['id']}})['then'](handleEntityNotFound(_0x2fca37,null))[_0xc8e3('0x24')](function(_0x2ef9b7){if(_0x2ef9b7){_0xa6e5bb[_0xc8e3('0x32')]=_[_0xc8e3('0x34')](db[_0xc8e3('0x5a')][_0xc8e3('0x2f')]);_0xa6e5bb[_0xc8e3('0x33')]=_[_0xc8e3('0x34')](_0x49e860[_0xc8e3('0x33')]);_0xa6e5bb['filters']=_[_0xc8e3('0x36')](_0xa6e5bb[_0xc8e3('0x32')],_0xa6e5bb[_0xc8e3('0x33')]);_0x49fb52['attributes']=_[_0xc8e3('0x36')](_0xa6e5bb[_0xc8e3('0x32')],qs['fields'](_0x49e860[_0xc8e3('0x33')][_0xc8e3('0x38')]));_0x49fb52[_0xc8e3('0x37')]=_0x49fb52['attributes'][_0xc8e3('0x48')]?_0x49fb52[_0xc8e3('0x37')]:_0xa6e5bb['model'];if(!_0x49e860[_0xc8e3('0x33')][_0xc8e3('0x39')](_0xc8e3('0x3a'))){_0x49fb52[_0xc8e3('0x20')]=qs[_0xc8e3('0x20')](_0x49e860[_0xc8e3('0x33')]['limit']);_0x49fb52[_0xc8e3('0x1e')]=qs[_0xc8e3('0x1e')](_0x49e860['query'][_0xc8e3('0x1e')]);}_0x49fb52[_0xc8e3('0x3b')]=qs[_0xc8e3('0x3c')](_0x49e860['query']['sort']);_0x49fb52[_0xc8e3('0x3d')]=qs['filters'](_['pick'](_0x49e860[_0xc8e3('0x33')],_0xa6e5bb[_0xc8e3('0x35')]));_0x49fb52[_0xc8e3('0x3d')][_0xc8e3('0x54')]=_0x2ef9b7['id'];if(_0x49e860['query'][_0xc8e3('0x3e')]){_0x49fb52[_0xc8e3('0x3d')]=_[_0xc8e3('0x3f')](_0x49fb52[_0xc8e3('0x3d')],{'$or':_['map'](_0x49fb52[_0xc8e3('0x37')],function(_0x5240f6){var _0x22c81f={};_0x22c81f[_0x5240f6]={'$like':'%'+_0x49e860['query'][_0xc8e3('0x3e')]+'%'};return _0x22c81f;})});}_0x49fb52=_[_0xc8e3('0x3f')]({},_0x49fb52,_0x49e860[_0xc8e3('0x40')]);return db[_0xc8e3('0x5a')][_0xc8e3('0x21')]({'where':_0x49fb52[_0xc8e3('0x3d')]})['then'](function(_0x55b931){_0x198c71['count']=_0x55b931;if(_0x49e860[_0xc8e3('0x33')][_0xc8e3('0x49')]){_0x49fb52[_0xc8e3('0x42')]=[{'all':!![]}];}return db['CannedAnswer'][_0xc8e3('0x43')](_0x49fb52);})['then'](function(_0x37e858){_0x198c71[_0xc8e3('0x44')]=_0x37e858;return _0x198c71;});}})['then'](respondWithFilteredResult(_0x2fca37,_0x49fb52))[_0xc8e3('0x45')](handleError(_0x2fca37,null));};exports['removeAnswers']=function(_0x43846c,_0x4ebe67){return db[_0xc8e3('0x41')][_0xc8e3('0x4a')]({'where':{'id':_0x43846c[_0xc8e3('0x52')]['id']}})[_0xc8e3('0x24')](handleEntityNotFound(_0x4ebe67,null))[_0xc8e3('0x24')](function(_0x4636bf){if(_0x4636bf){return _0x4636bf[_0xc8e3('0x5c')](_0x43846c[_0xc8e3('0x33')][_0xc8e3('0x5d')]);}})[_0xc8e3('0x24')](respondWithStatusCode(_0x4ebe67,null))[_0xc8e3('0x45')](handleError(_0x4ebe67,null));};exports[_0xc8e3('0x5e')]=function(_0x59149b,_0x5df620){_0x59149b[_0xc8e3('0x4c')][_0xc8e3('0x5f')]=_0x59149b['file']['filename'];return db['ChatWebsite'][_0xc8e3('0x4a')]({'where':{'id':_0x59149b['params']['id']}})['then'](handleEntityNotFound(_0x5df620,null))[_0xc8e3('0x24')](saveUpdates(_0x59149b[_0xc8e3('0x4c')],null))[_0xc8e3('0x24')](respondWithResult(_0x5df620,null))[_0xc8e3('0x45')](handleError(_0x5df620,null));};exports[_0xc8e3('0x60')]=function(_0x3f7090,_0x5383f9){_0x3f7090[_0xc8e3('0x4c')][_0xc8e3('0x61')]=_0x3f7090[_0xc8e3('0x62')]['filename'];return db['ChatWebsite'][_0xc8e3('0x4a')]({'where':{'id':_0x3f7090['params']['id']}})[_0xc8e3('0x24')](handleEntityNotFound(_0x5383f9,null))[_0xc8e3('0x24')](saveUpdates(_0x3f7090[_0xc8e3('0x4c')],null))[_0xc8e3('0x24')](respondWithResult(_0x5383f9,null))['catch'](handleError(_0x5383f9,null));};exports[_0xc8e3('0x63')]=function(_0x59447d,_0x328ee9){_0x59447d['body'][_0xc8e3('0x64')]=_0x59447d[_0xc8e3('0x62')][_0xc8e3('0x65')];return db[_0xc8e3('0x41')][_0xc8e3('0x4a')]({'where':{'id':_0x59447d[_0xc8e3('0x52')]['id']}})[_0xc8e3('0x24')](handleEntityNotFound(_0x328ee9,null))['then'](saveUpdates(_0x59447d[_0xc8e3('0x4c')],null))[_0xc8e3('0x24')](respondWithResult(_0x328ee9,null))[_0xc8e3('0x45')](handleError(_0x328ee9,null));};exports[_0xc8e3('0x66')]=function(_0x53fdb0,_0x11cdfa){_0x53fdb0[_0xc8e3('0x4c')][_0xc8e3('0x67')]=_0x53fdb0[_0xc8e3('0x62')][_0xc8e3('0x65')];return db['ChatWebsite']['find']({'where':{'id':_0x53fdb0[_0xc8e3('0x52')]['id']}})[_0xc8e3('0x24')](handleEntityNotFound(_0x11cdfa,null))[_0xc8e3('0x24')](saveUpdates(_0x53fdb0[_0xc8e3('0x4c')],null))[_0xc8e3('0x24')](respondWithResult(_0x11cdfa,null))[_0xc8e3('0x45')](handleError(_0x11cdfa,null));};exports[_0xc8e3('0x68')]=function(_0x553785,_0x250c49){var _0x303370=path[_0xc8e3('0x69')](config[_0xc8e3('0x6a')],_0xc8e3('0x6b'));var _0x12f1be={'where':{'id':_0x553785[_0xc8e3('0x52')]['id']},'attributes':['id',_0xc8e3('0x5f')],'raw':!![]};var _0x1b74d8=![];return require('../../config/license/util')[_0xc8e3('0x6c')]()[_0xc8e3('0x24')](function(_0x932f0f){if(_0x932f0f){_0x1b74d8=_0x932f0f[_0xc8e3('0x6d')];}})[_0xc8e3('0x24')](function(){return db[_0xc8e3('0x41')]['find'](_0x12f1be);})[_0xc8e3('0x24')](handleEntityNotFound(_0x250c49,null))[_0xc8e3('0x24')](function(_0x5b542c){if(_0x5b542c){if(!_[_0xc8e3('0x6e')](_0x5b542c[_0xc8e3('0x5f')])){if(fs[_0xc8e3('0x6f')](path[_0xc8e3('0x69')](config[_0xc8e3('0x6a')],'server/files/images/logos/',_0x5b542c[_0xc8e3('0x5f')]))&&_0x1b74d8){_0x303370=path[_0xc8e3('0x69')](config[_0xc8e3('0x6a')],_0xc8e3('0x70'),_0x5b542c[_0xc8e3('0x5f')]);}}return _0x250c49['download'](_0x303370);}})[_0xc8e3('0x45')](handleError(_0x250c49,null));};exports[_0xc8e3('0x71')]=function(_0x1eec65,_0x474e27){var _0x9a3d89=path[_0xc8e3('0x69')](config[_0xc8e3('0x6a')],_0xc8e3('0x72'));var _0x40f357={'where':{'id':_0x1eec65[_0xc8e3('0x52')]['id']},'attributes':['id',_0xc8e3('0x61')],'raw':!![]};return db[_0xc8e3('0x41')]['find'](_0x40f357)[_0xc8e3('0x24')](handleEntityNotFound(_0x474e27,null))[_0xc8e3('0x24')](function(_0x5ecc92){if(_0x5ecc92){if(!_[_0xc8e3('0x6e')](_0x5ecc92['agentAvatar'])){if(fs[_0xc8e3('0x6f')](path[_0xc8e3('0x69')](config[_0xc8e3('0x6a')],'server/files/images/avatars/',_0x5ecc92[_0xc8e3('0x61')]))){_0x9a3d89=path[_0xc8e3('0x69')](config[_0xc8e3('0x6a')],_0xc8e3('0x73'),_0x5ecc92[_0xc8e3('0x61')]);}}return _0x474e27[_0xc8e3('0x74')](_0x9a3d89);}})['catch'](handleError(_0x474e27,null));};exports[_0xc8e3('0x75')]=function(_0x12c866,_0x52e286){var _0x3c050f=path[_0xc8e3('0x69')](config[_0xc8e3('0x6a')],_0xc8e3('0x76'));var _0x2f5e61={'where':{'id':_0x12c866[_0xc8e3('0x52')]['id']},'attributes':['id','customerAvatar',_0xc8e3('0x77')],'raw':!![]};return db[_0xc8e3('0x41')][_0xc8e3('0x4a')](_0x2f5e61)[_0xc8e3('0x24')](handleEntityNotFound(_0x52e286,null))[_0xc8e3('0x24')](function(_0x911c1a){if(_0x911c1a){if(!_[_0xc8e3('0x6e')](_0x911c1a['customerAvatar'])){if(fs[_0xc8e3('0x6f')](path[_0xc8e3('0x69')](config[_0xc8e3('0x6a')],_0xc8e3('0x73'),_0x911c1a[_0xc8e3('0x64')]))&&_0x911c1a['showCustomerAvatar']){_0x3c050f=path['join'](config[_0xc8e3('0x6a')],'server/files/images/avatars/',_0x911c1a[_0xc8e3('0x64')]);}}return _0x52e286['download'](_0x3c050f);}})[_0xc8e3('0x45')](handleError(_0x52e286,null));};exports['getSystemAvatar']=function(_0x404dfa,_0x8bea50){var _0x3f3131=path[_0xc8e3('0x69')](config[_0xc8e3('0x6a')],'server/files/images/avatars/system_avatar.png');var _0x5d5f89={'where':{'id':_0x404dfa['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x5d5f89)[_0xc8e3('0x24')](handleEntityNotFound(_0x8bea50,null))[_0xc8e3('0x24')](function(_0x4dda83){if(_0x4dda83){if(!_[_0xc8e3('0x6e')](_0x4dda83[_0xc8e3('0x67')])){if(fs[_0xc8e3('0x6f')](path['join'](config[_0xc8e3('0x6a')],'server/files/images/avatars/',_0x4dda83[_0xc8e3('0x67')]))){_0x3f3131=path['join'](config['root'],_0xc8e3('0x73'),_0x4dda83[_0xc8e3('0x67')]);}}return _0x8bea50[_0xc8e3('0x74')](_0x3f3131);}})['catch'](handleError(_0x8bea50,null));};exports[_0xc8e3('0x78')]=function(_0x360e78,_0xb3652e){var _0x2ae062=require(_0xc8e3('0x79'));var _0x6523b8=new _0x2ae062();var _0x3a2aa0=_0x6523b8[_0xc8e3('0x7a')](_0x360e78['headers']['user-agent'])[_0xc8e3('0x7b')]();var _0x16070d={'body':_0x360e78[_0xc8e3('0x4c')],'channel':'chat'};var _0x1f4f65=[];var _0x5e0361=[];var _0x1010ae={};var _0x380f57=![];return db['CmContact'][_0xc8e3('0x53')]()[_0xc8e3('0x24')](function(_0x373a9a){if(!_0x373a9a){throw new db[(_0xc8e3('0x7c'))][(_0xc8e3('0x7d'))](_0xc8e3('0x7e'));}_0x1f4f65=_['difference'](_[_0xc8e3('0x34')](_0x373a9a),[_0xc8e3('0x7f'),'updatedAt']);_0x5e0361=_[_0xc8e3('0x80')](_[_0xc8e3('0x34')](_0x373a9a),[_0xc8e3('0x7f'),_0xc8e3('0x81'),_0xc8e3('0x82'),_0xc8e3('0x83')]);if(_0x360e78[_0xc8e3('0x4c')]['id']){delete _0x360e78[_0xc8e3('0x4c')]['id'];}if(_['isNil'](_0x360e78['body'][_0xc8e3('0x84')])){throw new db['Sequelize'][(_0xc8e3('0x7d'))](_0xc8e3('0x85'));}if(_[_0xc8e3('0x6e')](_0x360e78[_0xc8e3('0x4c')][_0xc8e3('0x4c')])||_0x360e78[_0xc8e3('0x4c')][_0xc8e3('0x4c')]===''){throw new db[(_0xc8e3('0x7c'))]['ValidationError'](_0xc8e3('0x86'));}if(_[_0xc8e3('0x6e')](_0x360e78['body']['mapKey'])){throw new db[(_0xc8e3('0x7c'))]['ValidationError'](_0xc8e3('0x87')+_0x5e0361);}if(!_[_0xc8e3('0x88')](_0x5e0361,_0x360e78[_0xc8e3('0x4c')][_0xc8e3('0x89')])){throw new db['Sequelize'][(_0xc8e3('0x7d'))](_0xc8e3('0x8a')+_0x5e0361);}_0x1010ae[_0x360e78['body']['mapKey']]=_0x360e78[_0xc8e3('0x4c')][_0xc8e3('0x84')];})[_0xc8e3('0x24')](function(){return db[_0xc8e3('0x41')][_0xc8e3('0x4a')]({'where':{'id':_0x360e78['params']['id']},'include':[{'model':db[_0xc8e3('0x8b')],'as':_0xc8e3('0x8c'),'include':[{'model':db[_0xc8e3('0x8d')],'as':_0xc8e3('0x8e'),'where':_0x1010ae,'limit':0x1,'order':[['updatedAt',_0xc8e3('0x8f')]]}]},{'model':db[_0xc8e3('0x90')],'as':'Applications'}]});})[_0xc8e3('0x24')](handleEntityNotFound(_0xb3652e,null))['then'](function(_0x3b3320){if(_0x3b3320&&_0x3b3320[_0xc8e3('0x8c')]){_0x16070d[_0xc8e3('0x91')]=_0x3b3320;_0x16070d[_0xc8e3('0x92')]=_0x3b3320[_0xc8e3('0x93')];_0x16070d[_0xc8e3('0x94')]=_0x3b3320[_0xc8e3('0x8c')];_0x16070d[_0xc8e3('0x92')]=_['orderBy'](_0x16070d[_0xc8e3('0x92')],['priority'],['asc']);if(_0x16070d[_0xc8e3('0x91')]['Applications']){delete _0x16070d['account'][_0xc8e3('0x93')];}if(_0x16070d[_0xc8e3('0x91')][_0xc8e3('0x8c')]&&_0x16070d[_0xc8e3('0x91')][_0xc8e3('0x8c')][_0xc8e3('0x8e')]['length']){return _0x16070d[_0xc8e3('0x91')][_0xc8e3('0x8c')]['Contacts'][0x0];}var _0xa4aee8=_[_0xc8e3('0x9')](_0x360e78[_0xc8e3('0x4c')],{'firstName':_0x360e78['body'][_0xc8e3('0x84')],'ListId':_0x3b3320[_0xc8e3('0x83')]});_0xa4aee8[_0x360e78[_0xc8e3('0x4c')]['mapKey']]=_0x360e78['body'][_0xc8e3('0x84')];return db[_0xc8e3('0x8d')][_0xc8e3('0x4b')](_0xa4aee8,{'fields':_0x1f4f65,'raw':!![]});}})[_0xc8e3('0x24')](handleEntityNotFound(_0xb3652e,null))[_0xc8e3('0x24')](function(_0x28ebe2){_0x16070d[_0xc8e3('0x95')]=_0x28ebe2;var _0x39b023=_0x360e78['body']['customerIp'];if(_0x360e78[_0xc8e3('0x96')][_0xc8e3('0x97')]){_0x39b023=_0x360e78['headers'][_0xc8e3('0x97')];}else if(_0x360e78['headers'][_0xc8e3('0x98')]){_0x39b023=_['first'](_0x360e78['headers']['x-forwarded-for'][_0xc8e3('0x99')](','));}if(_0x28ebe2){var _0x225eb0={'ContactId':_0x28ebe2['id'],'ChatWebsiteId':_0x360e78[_0xc8e3('0x52')]['id'],'from':(_0x28ebe2[_0xc8e3('0x9a')]||'')+'\x20'+(_0x28ebe2[_0xc8e3('0x9b')]||''),'customerIp':_0x39b023,'customerPort':_0x360e78[_0xc8e3('0x96')][_0xc8e3('0x9c')]?_0x360e78[_0xc8e3('0x96')][_0xc8e3('0x9c')]:null,'referer':_0x360e78[_0xc8e3('0x4c')]['referer'],'browserName':_0x3a2aa0[_0xc8e3('0x9d')][_0xc8e3('0x2b')]&&_0x3a2aa0[_0xc8e3('0x9d')][_0xc8e3('0x9e')]?util[_0xc8e3('0x9f')](_0xc8e3('0xa0'),_0x3a2aa0['browser'][_0xc8e3('0x2b')],_0x3a2aa0['browser'][_0xc8e3('0x9e')]):_0xc8e3('0xa1'),'browserVersion':_0x3a2aa0[_0xc8e3('0x9d')][_0xc8e3('0x9e')]||_0xc8e3('0xa1'),'osName':util['format'](_0xc8e3('0xa0'),_0x3a2aa0['os']['name'],_0x3a2aa0['os']['version']),'osVersion':_0x3a2aa0['os'][_0xc8e3('0x9e')],'deviceModel':_0x3a2aa0['device'][_0xc8e3('0x32')]&&_0x3a2aa0[_0xc8e3('0xa2')][_0xc8e3('0xa3')]?util[_0xc8e3('0x9f')](_0xc8e3('0xa4'),_0x3a2aa0[_0xc8e3('0xa2')]['model'],_0x3a2aa0['device'][_0xc8e3('0xa3')],_0x3a2aa0[_0xc8e3('0xa2')][_0xc8e3('0x31')]):null,'deviceVendor':_0x3a2aa0['device']['vendor'],'deviceType':_0x3a2aa0['device'][_0xc8e3('0x31')],'formData':JSON[_0xc8e3('0x16')](_0x360e78[_0xc8e3('0x4c')])};var _0x2e9a4f={'ChatWebsiteId':_0x360e78[_0xc8e3('0x52')]['id'],'closed':![]};if(_0x360e78[_0xc8e3('0x4c')]['threadId']){_0x2e9a4f['threadId']=_0x360e78[_0xc8e3('0x4c')][_0xc8e3('0xa5')];return db['ChatInteraction']['find']({'where':_0x2e9a4f})[_0xc8e3('0x24')](function(_0x5e12d4){if(_0x5e12d4){return[_0x5e12d4,![]];}_0x225eb0['threadId']=_0x360e78[_0xc8e3('0x4c')][_0xc8e3('0xa5')];_0x225eb0[_0xc8e3('0xa6')]=_0x360e78[_0xc8e3('0x4c')][_0xc8e3('0xa6')];return db[_0xc8e3('0xa7')][_0xc8e3('0x4b')](_0x225eb0)['then'](function(_0x4d278c){return[_0x4d278c,!![]];});});}_0x2e9a4f['ContactId']=_0x28ebe2['id'];if(_0x360e78[_0xc8e3('0x4c')]['interaction']&&_0x360e78[_0xc8e3('0x4c')]['interaction']['id']){_0x2e9a4f['id']=_0x360e78[_0xc8e3('0x4c')]['interaction']['id'];return db[_0xc8e3('0xa7')][_0xc8e3('0x4a')]({'where':_0x2e9a4f})[_0xc8e3('0x24')](function(_0x53f208){if(_0x53f208){return[_0x53f208,![]];}return db[_0xc8e3('0xa7')][_0xc8e3('0x4b')](_0x225eb0)['then'](function(_0x534e87){return[_0x534e87,!![]];});});}return db[_0xc8e3('0xa7')][_0xc8e3('0x4b')](_0x225eb0)[_0xc8e3('0x24')](function(_0x511fe8){return[_0x511fe8,!![]];});}})[_0xc8e3('0xa8')](function(_0x1d8b68,_0x4eef2c){if(_0x1d8b68){_0x380f57=_0x4eef2c;if(!_0x4eef2c){var _0x466368={'from':(_0x16070d[_0xc8e3('0x95')]['firstName']||'')+'\x20'+(_0x16070d[_0xc8e3('0x95')]['lastName']||'')};if(_0x360e78[_0xc8e3('0x4c')]['threadId']&&_0x360e78['body']['messageId']&&_0x360e78[_0xc8e3('0x4c')][_0xc8e3('0xa5')]!=_0x360e78['body'][_0xc8e3('0xa9')]){_0x466368['threadId']=_0x360e78['body']['messageId'];}return _0x1d8b68[_0xc8e3('0x51')](_0x466368);}else{return _0x1d8b68;}}})[_0xc8e3('0x24')](function(_0x4d1f65){_0x16070d[_0xc8e3('0xaa')]=_0x4d1f65[_0xc8e3('0x26')]({'plain':!![]});_0x16070d[_0xc8e3('0xaa')][_0xc8e3('0xab')]=_0x380f57;if(_0x16070d[_0xc8e3('0xaa')][_0xc8e3('0xab')]){if(_0x16070d['account']['autoclose']){_0x16070d[_0xc8e3('0x92')][_0xc8e3('0xac')]({'id':0x0,'priority':_0x16070d[_0xc8e3('0x92')][_0xc8e3('0x48')]+0x1,'app':_0xc8e3('0xad'),'appdata':_0xc8e3('0xae'),'interval':_0xc8e3('0xaf')});}}return db[_0xc8e3('0xb0')]['create']({'body':_0x360e78[_0xc8e3('0x4c')][_0xc8e3('0x4c')],'ChatWebsiteId':_0x360e78[_0xc8e3('0x52')]['id'],'ChatInteractionId':_0x4d1f65['id'],'direction':'in','ContactId':_0x16070d[_0xc8e3('0x95')]['id'],'AttachmentId':_0x360e78[_0xc8e3('0x4c')][_0xc8e3('0xb1')]});})[_0xc8e3('0x24')](function(_0x3148a8){_0x16070d[_0xc8e3('0x19')]=_0x3148a8;if(_0x16070d[_0xc8e3('0xaa')]['UserId']){return db['User'][_0xc8e3('0x4a')]({'attributes':['id',_0xc8e3('0x2b')],'where':{'id':_0x16070d['interaction'][_0xc8e3('0xb2')]}})[_0xc8e3('0x24')](function(_0x2d152){if(_0x2d152){_0x16070d[_0xc8e3('0x92')][_0xc8e3('0xb3')]({'id':0x0,'priority':0x0,'app':_0xc8e3('0xb4'),'appdata':_0x2d152[_0xc8e3('0x2b')]+','+(_0x16070d[_0xc8e3('0x91')][_0xc8e3('0xb5')]||0xa),'interval':'*,*,*,*'});_0x16070d['forcedOwnership']=!![];}return respondWithRpcPromise(_0xc8e3('0xb6'),'startRouting',_0x16070d);});}return respondWithRpcPromise(_0xc8e3('0xb6'),'startRouting',_0x16070d);})[_0xc8e3('0x24')](function(_0x6d3afb){respondWithRpcPromise(_0xc8e3('0xb7'),_0xc8e3('0xb7'),{'event':_0xc8e3('0x78'),'message':_0x6d3afb},client9002);return _0x6d3afb;})['then'](respondWithResult(_0xb3652e,null))['catch'](handleError(_0xb3652e,null));};exports[_0xc8e3('0xb8')]=function(_0x41ed50,_0x593458){var _0x3044f2,_0x2f57cf,_0x4a8dd0;var _0x5708b7=[];var _0x25eb3a={};var _0x9c5dfa=_0x41ed50[_0xc8e3('0xb9')]||[];var _0x2d2053=[];var _0x4d751e;return db['CmContact']['describe']()[_0xc8e3('0x24')](function(_0x40ef4c){if(!_0x40ef4c){throw new db[(_0xc8e3('0x7c'))][(_0xc8e3('0x7d'))](_0xc8e3('0x7e'));}_0x5708b7=_[_0xc8e3('0x80')](_[_0xc8e3('0x34')](_0x40ef4c),[_0xc8e3('0x7f'),_0xc8e3('0x81'),_0xc8e3('0x82'),_0xc8e3('0x83')]);if(_0x41ed50[_0xc8e3('0x4c')]['id']){delete _0x41ed50[_0xc8e3('0x4c')]['id'];}if(_['isNil'](_0x41ed50[_0xc8e3('0x4c')]['from'])){throw _0x593458[_0xc8e3('0x1b')](0x1f4)[_0xc8e3('0xba')](new db[(_0xc8e3('0x7c'))]['ValidationError'](_0xc8e3('0x85')));}if(_['isNil'](_0x41ed50['body']['body'])||_0x41ed50[_0xc8e3('0x4c')][_0xc8e3('0x4c')]===''){throw _0x593458['status'](0x1f4)[_0xc8e3('0xba')](new db[(_0xc8e3('0x7c'))][(_0xc8e3('0x7d'))](_0xc8e3('0x86')));}if(_[_0xc8e3('0x6e')](_0x41ed50['body'][_0xc8e3('0xbb')])){throw _0x593458[_0xc8e3('0x1b')](0x1f4)[_0xc8e3('0xba')](new db[(_0xc8e3('0x7c'))][(_0xc8e3('0x7d'))](_0xc8e3('0xbc')+_0x5708b7));}if(!_[_0xc8e3('0x88')](_0x5708b7,_0x41ed50[_0xc8e3('0x4c')][_0xc8e3('0xbb')])){throw _0x593458[_0xc8e3('0x1b')](0x1f4)['send'](new db['Sequelize'][(_0xc8e3('0x7d'))](_0xc8e3('0xbd')+_0x5708b7));}_0x25eb3a[_0x41ed50['body'][_0xc8e3('0xbb')]]=_0x41ed50['body'][_0xc8e3('0x84')];})[_0xc8e3('0x24')](function(){return db[_0xc8e3('0x41')]['find']({'where':{'id':_0x41ed50[_0xc8e3('0x52')]['id']},'include':[{'model':db[_0xc8e3('0x8b')],'as':'List'},{'model':db[_0xc8e3('0xbe')],'as':_0xc8e3('0xbe')}]});})['then'](handleEntityNotFound(_0x593458,null))[_0xc8e3('0x24')](function(_0x3aef10){if(_0x3aef10&&_0x3aef10[_0xc8e3('0x8c')]){_0x2f57cf=_0x3aef10;var _0x3fec45=_[_0xc8e3('0x9')](_0x41ed50[_0xc8e3('0x4c')],{'firstName':_0x41ed50[_0xc8e3('0x4c')][_0xc8e3('0x84')],'phone':_0x41ed50[_0xc8e3('0x4c')][_0xc8e3('0x84')],'ListId':_0x3aef10[_0xc8e3('0x83')]});_0x3fec45[_0x41ed50['body'][_0xc8e3('0xbb')]]=_0x41ed50[_0xc8e3('0x4c')][_0xc8e3('0x84')];return db[_0xc8e3('0x8d')][_0xc8e3('0xbf')]({'where':_0x25eb3a,'defaults':_0x3fec45});}})[_0xc8e3('0xa8')](function(_0xd34e2b){if(_0xd34e2b){_0x4a8dd0=_0xd34e2b;var _0x1640d0=fs['readFileSync'](path[_0xc8e3('0x69')](config[_0xc8e3('0x6a')],_0xc8e3('0xc0')),_0xc8e3('0xc1'));var _0x220fe1=ejs[_0xc8e3('0xc2')](_0x1640d0,{'body':_['toPairs'](_0x41ed50['body'][_0xc8e3('0x4c')]),'bodyTitle':_0x2f57cf[_0xc8e3('0xc3')]});return db['ChatOfflineMessage']['create']({'body':_0x220fe1,'plainBody':htmlToText[_0xc8e3('0xc4')](_0x220fe1),'ContactId':_0xd34e2b['id'],'ChatWebsiteId':_0x2f57cf['id']});}})[_0xc8e3('0x24')](function(_0x4e5a87){_0x4d751e=_0x4e5a87;if(_0x9c5dfa[_0xc8e3('0x48')]){var _0x5b27b4=_0x9c5dfa[_0xc8e3('0x2e')](function(_0xd9694d){return{'name':_0xd9694d[_0xc8e3('0xc5')],'basename':_0xd9694d[_0xc8e3('0x65')],'type':_0xd9694d[_0xc8e3('0xc6')],'ChatOfflineMessageId':_0x4e5a87['id']};});_0x2d2053=_0x5b27b4[_0xc8e3('0x2e')](_0x633abb=>{var _0x584048={'filename':_0x633abb[_0xc8e3('0x2b')],'path':path[_0xc8e3('0x69')](config['root'],_0xc8e3('0xc7'),_0xc8e3('0xb9'),_0xc8e3('0xc8'),_0xc8e3('0xc9'),_0x633abb['basename'])};return _0x584048;});if(!_0x2f57cf[_0xc8e3('0xca')]){return db['sequelize'][_0xc8e3('0xcb')](function(_0x196f5e){return db['Attachment'][_0xc8e3('0xcc')](_0x5b27b4,{'transaction':_0x196f5e});});}}})[_0xc8e3('0x24')](function(){if(_0x4d751e){_0x3044f2=_0x4d751e;return db[_0xc8e3('0xbe')][_0xc8e3('0x56')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xc8e3('0xcd'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xc8e3('0xce'),'raw':!![]}]}]});}})['then'](function(_0x11ec00){if(_0x11ec00&&_0x11ec00[_0xc8e3('0xcd')]&&_0x2f57cf[_0xc8e3('0xcf')]&&_0x2f57cf[_0xc8e3('0xd0')]){var _0x375e1a=_0x11ec00[_0xc8e3('0xd1')]();return respondWithRpcPromise(_0xc8e3('0xd2'),_0xc8e3('0xd3'),{'account':_0x375e1a,'message':{'from':util['format'](_0xc8e3('0xd4'),_0x11ec00[_0xc8e3('0x2b')],_0x11ec00['email']||_0x11ec00['Smtp'][_0xc8e3('0x4d')]),'to':_0x2f57cf[_0xc8e3('0xd0')],'subject':_0x2f57cf[_0xc8e3('0xd5')],'html':_0x3044f2['body'],'attachments':_0x2d2053}},client9003)[_0xc8e3('0x24')](function(){return _0x3044f2;})[_0xc8e3('0x45')](function(_0x23cde1){logger[_0xc8e3('0x17')](_0x23cde1);});}})['then'](function(){if(_0x2f57cf&&_0x2f57cf[_0xc8e3('0xca')]&&_0x2f57cf['MailAccountId']){var _0x33e778=[];if(_0x9c5dfa[_0xc8e3('0x48')]){_0x33e778=_0x9c5dfa['map'](function(_0x1e5e9e){return{'name':_0x1e5e9e[_0xc8e3('0xc5')],'basename':_0x1e5e9e['filename'],'type':_0x1e5e9e[_0xc8e3('0xc6')],'ChatOfflineMessageId':_0x4d751e['id']};});}var _0x48ff90;if(!_[_0xc8e3('0x6e')](_0x2f57cf[_0xc8e3('0xd6')])){var _0xc097aa=_['map'](_0x41ed50[_0xc8e3('0x4c')],function(_0x4c487c){return _0x4c487c;});var _0x385906=_[_0xc8e3('0xd7')](_0xc097aa)[0x0];var _0x1a4ceb=_[_0xc8e3('0xd8')](_0x385906,function(_0x4bc97e){return _0x4bc97e;});_0x48ff90=_0x1a4ceb[0x1][_0x2f57cf[_0xc8e3('0xd6')]];}var _0x376000={'from':_0x4a8dd0[_0xc8e3('0xd9')],'firstName':_0x4a8dd0[_0xc8e3('0x9a')],'lastName':_0x4a8dd0['lastName'],'mapKey':_0xc8e3('0xd9'),'message':{'from':_0x4a8dd0[_0xc8e3('0xd9')],'to':_0x2f57cf[_0xc8e3('0xbe')]['email'],'cc':'','subject':_['isNil'](_0x48ff90)?_0x2f57cf[_0xc8e3('0xd5')]:_0x48ff90,'messageId':'','sentAt':new Date(),'attach':_0x33e778[_0xc8e3('0x48')],'attachments':_0x33e778,'originChannel':_0xc8e3('0xda'),'ChatWebsiteId':_0x2f57cf['id'],'ChatOfflineMessageId':_0x3044f2['id'],'originTo':_0x2f57cf[_0xc8e3('0xbe')][_0xc8e3('0xd9')]},'body':_0x3044f2['body']};var _0xdd9ed7={'account':{'id':_0x2f57cf[_0xc8e3('0xdb')]},'body':_0x376000,'log':_0xc8e3('0xdc')};return respondWithRpcPromise(_0xc8e3('0xdc'),_0xc8e3('0xdd'),_0xdd9ed7,client9001)['then'](function(){return _0x3044f2;})['catch'](function(_0x4f586c){logger[_0xc8e3('0x17')](_0x4f586c);});}return;})['then'](function(){if(_0x3044f2){return _0x3044f2;}})['then'](respondWithResult(_0x593458,null))[_0xc8e3('0x45')](function(_0x96f5f0){logger['error']('catch',_0x96f5f0);for(var _0x3c9cd9 of _0x9c5dfa){var _0x8a5573=path[_0xc8e3('0x69')](config[_0xc8e3('0x6a')],_0xc8e3('0xc7'),'files',_0xc8e3('0xc8'),_0xc8e3('0xc9'),_0x3c9cd9[_0xc8e3('0x65')]);fs_extra[_0xc8e3('0xde')](_0x8a5573)[_0xc8e3('0x45')](function(_0x39416d){logger[_0xc8e3('0x17')](_0xc8e3('0xdf'),_0x8a5573,_0x39416d);});}});};exports[_0xc8e3('0xe0')]=function(_0x175dbe,_0x6fb923){return db[_0xc8e3('0xa7')][_0xc8e3('0x4a')]({'where':{'id':_0x175dbe[_0xc8e3('0x52')]['id']}})[_0xc8e3('0x24')](handleEntityNotFound(_0x6fb923,null))[_0xc8e3('0x24')](function(_0x3ced1f){if(_0x3ced1f){return _0x3ced1f['addInteraction'](_0x175dbe[_0xc8e3('0x4c')]['ids'],_['omit'](_0x175dbe['body'],[_0xc8e3('0x5d'),'id'])||{});}})[_0xc8e3('0x24')](respondWithResult(_0x6fb923,null))['catch'](handleError(_0x6fb923,null));};exports[_0xc8e3('0xe1')]=function(_0x3ec7ba,_0x291438){var _0x3b79d6={'raw':![],'where':{}};var _0x339d0e={};var _0x35aaff={'count':0x0,'rows':[]};return db[_0xc8e3('0x41')][_0xc8e3('0x56')]({'where':{'id':_0x3ec7ba[_0xc8e3('0x52')]['id']}})[_0xc8e3('0x24')](handleEntityNotFound(_0x291438,null))[_0xc8e3('0x24')](function(_0x39cbe2){if(_0x39cbe2){_0x339d0e[_0xc8e3('0x32')]=_[_0xc8e3('0x34')](db[_0xc8e3('0xa7')][_0xc8e3('0x2f')]);_0x339d0e[_0xc8e3('0x33')]=_['keys'](_0x3ec7ba[_0xc8e3('0x33')]);_0x339d0e['filters']=_[_0xc8e3('0x36')](_0x339d0e[_0xc8e3('0x32')],_0x339d0e[_0xc8e3('0x33')]);_0x3b79d6[_0xc8e3('0x37')]=_[_0xc8e3('0x36')](_0x339d0e[_0xc8e3('0x32')],qs[_0xc8e3('0x38')](_0x3ec7ba[_0xc8e3('0x33')][_0xc8e3('0x38')]));_0x3b79d6[_0xc8e3('0x37')]=_0x3b79d6[_0xc8e3('0x37')][_0xc8e3('0x48')]?_0x3b79d6[_0xc8e3('0x37')]:_0x339d0e['model'];if(!_0x3ec7ba[_0xc8e3('0x33')]['hasOwnProperty'](_0xc8e3('0x3a'))){_0x3b79d6['limit']=qs[_0xc8e3('0x20')](_0x3ec7ba[_0xc8e3('0x33')][_0xc8e3('0x20')]);_0x3b79d6[_0xc8e3('0x1e')]=qs[_0xc8e3('0x1e')](_0x3ec7ba[_0xc8e3('0x33')][_0xc8e3('0x1e')]);}_0x3b79d6[_0xc8e3('0x3b')]=qs[_0xc8e3('0x3c')](_0x3ec7ba[_0xc8e3('0x33')][_0xc8e3('0x3c')]);_0x3b79d6[_0xc8e3('0x3d')]=qs[_0xc8e3('0x35')](_[_0xc8e3('0x57')](_0x3ec7ba['query'],_0x339d0e[_0xc8e3('0x35')]));_0x3b79d6['where'][_0xc8e3('0x54')]=_0x39cbe2['id'];if(_0x3ec7ba[_0xc8e3('0x33')]['filter']){_0x3b79d6[_0xc8e3('0x3d')]=_[_0xc8e3('0x3f')](_0x3b79d6[_0xc8e3('0x3d')],{'$or':_['map'](_0x3b79d6[_0xc8e3('0x37')],function(_0x4392fa){var _0x5b638e={};_0x5b638e[_0x4392fa]={'$like':'%'+_0x3ec7ba['query'][_0xc8e3('0x3e')]+'%'};return _0x5b638e;})});}_0x3b79d6=_[_0xc8e3('0x3f')]({},_0x3b79d6,_0x3ec7ba[_0xc8e3('0x40')]);return db[_0xc8e3('0xa7')][_0xc8e3('0x21')]({'where':_0x3b79d6[_0xc8e3('0x3d')]})['then'](function(_0x7b62e7){_0x35aaff[_0xc8e3('0x21')]=_0x7b62e7;if(_0x3ec7ba[_0xc8e3('0x33')][_0xc8e3('0x49')]){_0x3b79d6[_0xc8e3('0x42')]=[{'model':db[_0xc8e3('0x8d')],'as':_0xc8e3('0xe2'),'required':![]},{'model':db[_0xc8e3('0xe3')],'as':_0xc8e3('0xe4'),'attributes':[_0xc8e3('0x2b'),_0xc8e3('0xe5'),'internal'],'required':![]},{'model':db['Tag'],'as':_0xc8e3('0xe6'),'attributes':['id','name',_0xc8e3('0xe7')],'where':_0x3ec7ba[_0xc8e3('0x33')][_0xc8e3('0xe8')]?{'id':_0x3ec7ba[_0xc8e3('0x33')][_0xc8e3('0xe8')]}:undefined,'required':_0x3ec7ba['query'][_0xc8e3('0xe8')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x3b79d6);})[_0xc8e3('0x24')](function(_0x20ee28){_0x35aaff[_0xc8e3('0x44')]=_0x20ee28;return _0x35aaff;});}})['then'](respondWithFilteredResult(_0x291438,_0x3b79d6))[_0xc8e3('0x45')](handleError(_0x291438,null));};function iftimePromise(_0x1703bf,_0x5f11e8){return respondWithRpcPromise(_0xc8e3('0xe9'),'getSnippet',{'command':_0x5f11e8[_0xc8e3('0xea')]?util['format'](_0xc8e3('0xeb'),_0x1703bf[_0xc8e3('0xec')],_0x5f11e8[_0xc8e3('0xea')]):util[_0xc8e3('0x9f')](_0xc8e3('0xed'),_0x1703bf[_0xc8e3('0xec')])},client9002)[_0xc8e3('0x24')](function(_0x584ba9){var _0x3673b0=_0x584ba9&&_0x584ba9['indexOf'](_0xc8e3('0xee'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x5f11e8['id'],_0x1703bf['id'],_0x1703bf['interval'],_0x3673b0?_0xc8e3('0xef'):_0xc8e3('0xf0'),_0x5f11e8[_0xc8e3('0xea')]?_0x5f11e8[_0xc8e3('0xea')]:_0xc8e3('0xf1'));return _0x3673b0;})[_0xc8e3('0x45')](function(_0x36793f){logger[_0xc8e3('0x17')](_0xc8e3('0xf2'),_0x5f11e8['id'],_0x1703bf['id'],_0x1703bf['interval'],util[_0xc8e3('0xf3')](_0x36793f,{'showHidden':![],'depth':null}),_0x5f11e8[_0xc8e3('0xea')]?_0x5f11e8[_0xc8e3('0xea')]:_0xc8e3('0xf1'));return![];});}exports[_0xc8e3('0xf4')]=function(_0x478942,_0x103006){var _0x183c46=0x0;var _0x169653=0x0;var _0x598d3=![];var _0x233393;var _0x383224;return db[_0xc8e3('0x41')]['find']({'where':{'id':_0x478942[_0xc8e3('0x52')]['id']},'include':[{'model':db[_0xc8e3('0xf5')],'as':_0xc8e3('0xf5'),'include':[{'model':db[_0xc8e3('0xf5')],'as':_0xc8e3('0xf6'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xc8e3('0x24')](handleEntityNotFound(_0x103006,null))[_0xc8e3('0x24')](function(_0x778e51){if(_0x778e51){_0x233393=_0x778e51;return _0x778e51[_0xc8e3('0xf7')]({'raw':!![]});}})[_0xc8e3('0x24')](function(_0x45adf8){if(_0x233393){if(_0x45adf8){_0x383224=_0x45adf8;}}return require('../../config/license/util')[_0xc8e3('0x6c')]();})['then'](function(_0x1d0a34){if(_0x1d0a34){_0x169653=_0x1d0a34[_0xc8e3('0xf8')];_0x598d3=_0x1d0a34[_0xc8e3('0x6d')];}})['then'](function(){return db[_0xc8e3('0xa7')]['count']({'where':{'closed':![]}});})[_0xc8e3('0x24')](function(_0x2eae2e){_0x183c46=_0x2eae2e;if(_0x169653&&_0x2eae2e>_0x169653){return db[_0xc8e3('0xf9')]['findOne']({'where':{'id':0x1}})[_0xc8e3('0x24')](function(_0x3f5929){if(_0x3f5929){_0x3f5929[_0xc8e3('0xfa')](_0xc8e3('0xfb'));}});}})[_0xc8e3('0x24')](function(){if(_0x233393[_0xc8e3('0xf5')]&&_0x233393[_0xc8e3('0xf5')][_0xc8e3('0xf6')]){var _0x515d40=[];for(var _0x101f23=0x0;_0x101f23<_0x233393[_0xc8e3('0xf5')]['Intervals']['length'];_0x101f23++){var _0x11b352=_0x233393[_0xc8e3('0xf5')][_0xc8e3('0xf6')][_0x101f23][_0xc8e3('0x26')]({'plain':!![]});_0x515d40['push'](iftimePromise(_0x11b352,_0x233393));}return BPromise['all'](_0x515d40)[_0xc8e3('0x24')](function(_0x44d6fb){return _[_0xc8e3('0xfc')](_0x44d6fb);});}else{return!![];}})[_0xc8e3('0x24')](function(_0x28ff9d){var _0x31763d=fs[_0xc8e3('0xfd')](path[_0xc8e3('0x69')](config[_0xc8e3('0x6a')],'server/files/chat/iframe.ejs'),_0xc8e3('0xc1'));var _0x1d97d2=new url[(_0xc8e3('0xfe'))](_0x233393['address'])[_0xc8e3('0xff')];var _0x10bc82='3.1.0';var _0x2bf265=![];var _0x5114d8={'chatVersion':_0x10bc82,'chatWebsiteAddressOrigin':_0x1d97d2,'remote':_0x233393['remote'],'query':querystring['stringify'](_[_0xc8e3('0x3f')](_0x233393[_0xc8e3('0x26')]({'plain':!![]}),{'customerIp':_0x478942[_0xc8e3('0x96')]['x-forwarded-for']||_0x478942['headers']['x-real-ip']||_0x478942[_0xc8e3('0x100')][_0xc8e3('0x101')]||_0x478942['ip'],'referer':_0x478942['headers'][_0xc8e3('0x102')],'openedInteractions':_0x183c46,'maxInteractions':_0x169653,'virtual':_0x598d3['virtual'],'online':_0x28ff9d,'custom':_0x598d3}))[_0xc8e3('0x103')](/'/g,'\x5c\x27')};_0x103006['send'](ejs[_0xc8e3('0xc2')](Mustache[_0xc8e3('0xc2')](_0x31763d,_0x5114d8),{'proactiveActions':_0x383224,'alignment':_0x233393['alignment'],'verticalAlignment':_0x233393[_0xc8e3('0x104')],'div_color':_0x233393[_0xc8e3('0xe7')],'labelText':_0x233393[_0xc8e3('0x105')],'text_color':_0x233393[_0xc8e3('0x106')],'text_button_color':_0x233393['textButtonColor'],'button_color':_0x233393['color_button'],'background_color':_0x233393[_0xc8e3('0x107')],'hideWhenOffline':_0x233393[_0xc8e3('0x108')],'intervalId':_0x233393[_0xc8e3('0x109')],'isDevelopment':_0x2bf265,'chatVersion':_0x10bc82}));})[_0xc8e3('0x45')](handleError(_0x103006,null));};exports[_0xc8e3('0x10a')]=function(_0xb991e3,_0x966688){var _0x4b7041=_0xb991e3[_0xc8e3('0x52')]['id'];var _0x16b53b=_0xb991e3['body'];var _0x2f125b=0xc8;var _0x42963b=null;return db[_0xc8e3('0x10b')][_0xc8e3('0xcb')]({'isolationLevel':db[_0xc8e3('0x10b')][_0xc8e3('0x10c')][_0xc8e3('0x10d')][_0xc8e3('0x10e')]},function(_0x4ddb9a){return db['ChatWebsite'][_0xc8e3('0x56')]({'where':{'id':_0x4b7041},'transaction':_0x4ddb9a})[_0xc8e3('0x24')](function(_0x594189){if(_0x594189){return db[_0xc8e3('0x90')][_0xc8e3('0x25')]({'where':{'ChatWebsiteId':_0x4b7041},'transaction':_0x4ddb9a})['then'](function(){var _0x52bd0f=_[_0xc8e3('0x2e')](_0x16b53b,function(_0x22a05f){_0x22a05f[_0xc8e3('0x54')]=_0x4b7041;return _0x22a05f;});return db[_0xc8e3('0x90')][_0xc8e3('0xcc')](_0x52bd0f,{'transaction':_0x4ddb9a});});}else{_0x2f125b=0x194;_0x42963b=[];}});})[_0xc8e3('0x24')](function(){if(_0x2f125b!==0x194){return db['ChatApplication'][_0xc8e3('0x10f')]({'where':{'ChatWebsiteId':_0x4b7041},'order':_0xc8e3('0x110')})['then'](function(_0x3d02c7){_0x42963b=_0x3d02c7;});}})['catch'](function(_0x396f0b){_0x2f125b=0x1f4;logger['error'](_0x396f0b[_0xc8e3('0x2a')]);if(_0x396f0b[_0xc8e3('0x2b')]){delete _0x396f0b[_0xc8e3('0x2b')];}_0x42963b=_0x396f0b;})[_0xc8e3('0x111')](function(){if(_0x42963b===null){_0x966688['sendStatus'](_0x2f125b);}else{if(_0x2f125b===0x1f4){_0x966688[_0xc8e3('0x1b')](_0x2f125b)[_0xc8e3('0xba')](_0x42963b);}else{_0x966688[_0xc8e3('0x1b')](_0x2f125b)['json'](_0x42963b);}}});};exports[_0xc8e3('0x112')]=function(_0x2d0b54,_0x35cc86){var _0x24dea8={};var _0x515cc9={};var _0x3fc185;var _0x29eea9;return db[_0xc8e3('0x41')]['findOne']({'where':{'id':_0x2d0b54[_0xc8e3('0x52')]['id']}})['then'](handleEntityNotFound(_0x35cc86,null))[_0xc8e3('0x24')](function(_0x4173d4){if(_0x4173d4){_0x3fc185=_0x4173d4;_0x515cc9[_0xc8e3('0x32')]=_['keys'](db['ChatApplication']['rawAttributes']);_0x515cc9[_0xc8e3('0x33')]=_['keys'](_0x2d0b54[_0xc8e3('0x33')]);_0x515cc9[_0xc8e3('0x35')]=_[_0xc8e3('0x36')](_0x515cc9[_0xc8e3('0x32')],_0x515cc9[_0xc8e3('0x33')]);_0x24dea8['attributes']=_[_0xc8e3('0x36')](_0x515cc9[_0xc8e3('0x32')],qs[_0xc8e3('0x38')](_0x2d0b54[_0xc8e3('0x33')][_0xc8e3('0x38')]));_0x24dea8['attributes']=_0x24dea8[_0xc8e3('0x37')][_0xc8e3('0x48')]?_0x24dea8['attributes']:_0x515cc9['model'];_0x24dea8[_0xc8e3('0x3b')]=qs[_0xc8e3('0x3c')](_0x2d0b54['query'][_0xc8e3('0x3c')]);_0x24dea8[_0xc8e3('0x3d')]=qs[_0xc8e3('0x35')](_[_0xc8e3('0x57')](_0x2d0b54[_0xc8e3('0x33')],_0x515cc9[_0xc8e3('0x35')]));if(_0x2d0b54['query'][_0xc8e3('0x3e')]){_0x24dea8['where']=_[_0xc8e3('0x3f')](_0x24dea8['where'],{'$or':_[_0xc8e3('0x2e')](_0x24dea8[_0xc8e3('0x37')],function(_0x506f2b){var _0x18a104={};_0x18a104[_0x506f2b]={'$like':'%'+_0x2d0b54['query']['filter']+'%'};return _0x18a104;})});}_0x24dea8=_['merge']({},_0x24dea8,_0x2d0b54[_0xc8e3('0x40')]);return _0x3fc185[_0xc8e3('0x112')](_0x24dea8);}})[_0xc8e3('0x24')](function(_0x45ee75){if(_0x45ee75){_0x29eea9=_0x45ee75[_0xc8e3('0x48')];if(!_0x2d0b54['query'][_0xc8e3('0x39')](_0xc8e3('0x3a'))){_0x24dea8['limit']=qs[_0xc8e3('0x20')](_0x2d0b54[_0xc8e3('0x33')]['limit']);_0x24dea8[_0xc8e3('0x1e')]=qs[_0xc8e3('0x1e')](_0x2d0b54[_0xc8e3('0x33')][_0xc8e3('0x1e')]);}return _0x3fc185[_0xc8e3('0x112')](_0x24dea8);}})[_0xc8e3('0x24')](function(_0x18edae){if(_0x18edae){return _0x18edae?{'count':_0x29eea9,'rows':_0x18edae}:null;}})[_0xc8e3('0x24')](respondWithResult(_0x35cc86,null))[_0xc8e3('0x45')](handleError(_0x35cc86,null));};exports[_0xc8e3('0x113')]=function(_0x51e590,_0x576129){return db['chatProactiveAction'][_0xc8e3('0x4a')]({'where':{'id':_0x51e590['params']['id']}})['then'](handleEntityNotFound(_0x576129,null))[_0xc8e3('0x24')](function(_0xeedfe7){if(_0xeedfe7){return _0xeedfe7[_0xc8e3('0x113')](_0x51e590[_0xc8e3('0x4c')]['ids'],_[_0xc8e3('0x114')](_0x51e590[_0xc8e3('0x4c')],[_0xc8e3('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x576129,null))[_0xc8e3('0x45')](handleError(_0x576129,null));};exports[_0xc8e3('0xf7')]=function(_0x3639ba,_0x3e8f41){var _0x4f6293={};var _0x2839d1={};var _0xe846a5;var _0x1d8b5f;return db[_0xc8e3('0x41')][_0xc8e3('0x56')]({'where':{'id':_0x3639ba[_0xc8e3('0x52')]['id']}})[_0xc8e3('0x24')](handleEntityNotFound(_0x3e8f41,null))[_0xc8e3('0x24')](function(_0x3a28ad){if(_0x3a28ad){_0xe846a5=_0x3a28ad;_0x2839d1[_0xc8e3('0x32')]=_[_0xc8e3('0x34')](db[_0xc8e3('0x115')][_0xc8e3('0x2f')]);_0x2839d1[_0xc8e3('0x33')]=_[_0xc8e3('0x34')](_0x3639ba[_0xc8e3('0x33')]);_0x2839d1[_0xc8e3('0x35')]=_[_0xc8e3('0x36')](_0x2839d1[_0xc8e3('0x32')],_0x2839d1[_0xc8e3('0x33')]);_0x4f6293[_0xc8e3('0x37')]=_[_0xc8e3('0x36')](_0x2839d1[_0xc8e3('0x32')],qs[_0xc8e3('0x38')](_0x3639ba[_0xc8e3('0x33')]['fields']));_0x4f6293['attributes']=_0x4f6293[_0xc8e3('0x37')][_0xc8e3('0x48')]?_0x4f6293[_0xc8e3('0x37')]:_0x2839d1['model'];_0x4f6293[_0xc8e3('0x3b')]=qs[_0xc8e3('0x3c')](_0x3639ba[_0xc8e3('0x33')][_0xc8e3('0x3c')]);_0x4f6293[_0xc8e3('0x3d')]=qs[_0xc8e3('0x35')](_['pick'](_0x3639ba[_0xc8e3('0x33')],_0x2839d1[_0xc8e3('0x35')]));if(_0x3639ba['query']['filter']){_0x4f6293[_0xc8e3('0x3d')]=_[_0xc8e3('0x3f')](_0x4f6293[_0xc8e3('0x3d')],{'$or':_[_0xc8e3('0x2e')](_0x4f6293[_0xc8e3('0x37')],function(_0x3070b5){var _0x517c21={};_0x517c21[_0x3070b5]={'$like':'%'+_0x3639ba[_0xc8e3('0x33')][_0xc8e3('0x3e')]+'%'};return _0x517c21;})});}_0x4f6293=_[_0xc8e3('0x3f')]({},_0x4f6293,_0x3639ba[_0xc8e3('0x40')]);return _0xe846a5[_0xc8e3('0xf7')](_0x4f6293);}})[_0xc8e3('0x24')](function(_0xe58d50){if(_0xe58d50){_0x1d8b5f=_0xe58d50[_0xc8e3('0x48')];if(!_0x3639ba[_0xc8e3('0x33')][_0xc8e3('0x39')]('nolimit')){_0x4f6293['limit']=qs[_0xc8e3('0x20')](_0x3639ba[_0xc8e3('0x33')][_0xc8e3('0x20')]);_0x4f6293[_0xc8e3('0x1e')]=qs['offset'](_0x3639ba[_0xc8e3('0x33')]['offset']);}return _0xe846a5[_0xc8e3('0xf7')](_0x4f6293);}})['then'](function(_0x3f8a86){if(_0x3f8a86){return _0x3f8a86?{'count':_0x1d8b5f,'rows':_0x3f8a86}:null;}})[_0xc8e3('0x24')](respondWithResult(_0x3e8f41,null))[_0xc8e3('0x45')](handleError(_0x3e8f41,null));};exports[_0xc8e3('0x116')]=function(_0x4d59b9,_0x53fce2){var _0x6f70eb=_0x4d59b9['query'][_0xc8e3('0x117')]===_0xc8e3('0x118')?_0xc8e3('0x119'):_0xc8e3('0x11a');return db[_0xc8e3('0x41')][_0xc8e3('0x4a')]({'attributes':['id',_0x6f70eb],'where':{'id':_0x4d59b9[_0xc8e3('0x52')]['id']}})[_0xc8e3('0x24')](handleEntityNotFound(_0x53fce2,null))['then'](function(_0x51c3d4){if(_0x51c3d4){var _0x133c08=_0x51c3d4[_0x6f70eb];var _0xc4f443=_0x133c08&&_0x133c08[_0xc8e3('0x11b')]?_0x133c08[_0xc8e3('0x11b')]:[];_0x53fce2[_0xc8e3('0xba')]({'fromKey':_[_0xc8e3('0x6e')](_0x133c08[_0xc8e3('0x11c')])?undefined:_0x133c08[_0xc8e3('0x11c')],'count':_0xc4f443[_0xc8e3('0x48')],'rows':_0xc4f443});}})['catch'](handleError(_0x53fce2,null));};exports[_0xc8e3('0x11d')]=function(_0x61d73b,_0x392c2f){var _0x57f2d7={'raw':![],'where':{}};var _0xe1d4ca={};var _0x22bb7f={'count':0x0,'rows':[]};return db[_0xc8e3('0x41')][_0xc8e3('0x56')]({'where':{'id':_0x61d73b['params']['id']}})[_0xc8e3('0x24')](handleEntityNotFound(_0x392c2f,null))[_0xc8e3('0x24')](function(_0x126442){if(_0x126442){_0xe1d4ca[_0xc8e3('0x32')]=_['keys'](db[_0xc8e3('0x11e')][_0xc8e3('0x2f')]);_0xe1d4ca[_0xc8e3('0x33')]=_[_0xc8e3('0x34')](_0x61d73b[_0xc8e3('0x33')]);_0xe1d4ca[_0xc8e3('0x35')]=_[_0xc8e3('0x36')](_0xe1d4ca[_0xc8e3('0x32')],_0xe1d4ca[_0xc8e3('0x33')]);_0x57f2d7[_0xc8e3('0x37')]=_[_0xc8e3('0x36')](_0xe1d4ca['model'],qs[_0xc8e3('0x38')](_0x61d73b[_0xc8e3('0x33')][_0xc8e3('0x38')]));_0x57f2d7[_0xc8e3('0x37')]=_0x57f2d7[_0xc8e3('0x37')][_0xc8e3('0x48')]?_0x57f2d7[_0xc8e3('0x37')]:_0xe1d4ca['model'];if(!_0x61d73b['query'][_0xc8e3('0x39')](_0xc8e3('0x3a'))){_0x57f2d7[_0xc8e3('0x20')]=qs['limit'](_0x61d73b['query'][_0xc8e3('0x20')]);_0x57f2d7[_0xc8e3('0x1e')]=qs[_0xc8e3('0x1e')](_0x61d73b['query'][_0xc8e3('0x1e')]);}_0x57f2d7[_0xc8e3('0x3b')]=qs[_0xc8e3('0x3c')](_0x61d73b[_0xc8e3('0x33')]['sort']);_0x57f2d7[_0xc8e3('0x3d')]=qs[_0xc8e3('0x35')](_[_0xc8e3('0x57')](_0x61d73b[_0xc8e3('0x33')],_0xe1d4ca[_0xc8e3('0x35')]));_0x57f2d7[_0xc8e3('0x3d')][_0xc8e3('0x54')]=_0x126442['id'];if(_0x61d73b[_0xc8e3('0x33')][_0xc8e3('0x3e')]){_0x57f2d7[_0xc8e3('0x3d')]=_[_0xc8e3('0x3f')](_0x57f2d7['where'],{'$or':_[_0xc8e3('0x2e')](_0x57f2d7['attributes'],function(_0x53c09d){var _0x32120d={};_0x32120d[_0x53c09d]={'$like':'%'+_0x61d73b[_0xc8e3('0x33')]['filter']+'%'};return _0x32120d;})});}_0x57f2d7=_['merge']({},_0x57f2d7,_0x61d73b[_0xc8e3('0x40')]);return db[_0xc8e3('0x11e')][_0xc8e3('0x21')]({'where':_0x57f2d7[_0xc8e3('0x3d')]})[_0xc8e3('0x24')](function(_0x357793){_0x22bb7f[_0xc8e3('0x21')]=_0x357793;if(_0x61d73b[_0xc8e3('0x33')][_0xc8e3('0x49')]){_0x57f2d7[_0xc8e3('0x42')]=[{'all':!![]}];}else{_0x57f2d7[_0xc8e3('0x42')]=[{'model':db[_0xc8e3('0x8d')],'as':'Contact','required':![]},{'model':db[_0xc8e3('0x11f')],'as':_0xc8e3('0x120'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x57f2d7);})[_0xc8e3('0x24')](function(_0x47933b){_0x22bb7f[_0xc8e3('0x44')]=_0x47933b;return _0x22bb7f;});}})[_0xc8e3('0x24')](respondWithFilteredResult(_0x392c2f,_0x57f2d7))[_0xc8e3('0x45')](handleError(_0x392c2f,null));};exports[_0xc8e3('0x121')]=function(_0x2c2e36,_0xa20126){return db[_0xc8e3('0x41')][_0xc8e3('0x4a')]({'where':{'id':_0x2c2e36[_0xc8e3('0x52')]['id']}})['then'](handleEntityNotFound(_0xa20126,null))[_0xc8e3('0x24')](function(_0x36f74f){if(_0x36f74f){return _0x36f74f['addAgents'](_0x2c2e36[_0xc8e3('0x4c')][_0xc8e3('0x5d')],_['omit'](_0x2c2e36[_0xc8e3('0x4c')],['ids','id'])||{})['spread'](function(_0x244531){for(var _0x1447d9=0x0;_0x1447d9<_0x2c2e36['body'][_0xc8e3('0x5d')][_0xc8e3('0x48')];_0x1447d9+=0x1){socket['emit'](_0xc8e3('0x122'),{'UserId':Number(_0x2c2e36['body']['ids'][_0x1447d9]),'ChatWebsiteId':Number(_0x2c2e36[_0xc8e3('0x52')]['id'])});}return _0x244531;});}})[_0xc8e3('0x24')](respondWithResult(_0xa20126,null))[_0xc8e3('0x45')](handleError(_0xa20126,null));};exports[_0xc8e3('0x123')]=function(_0x1ccd37,_0x22aa11){return db['ChatWebsite'][_0xc8e3('0x4a')]({'where':{'id':_0x1ccd37[_0xc8e3('0x52')]['id']}})['then'](handleEntityNotFound(_0x22aa11,null))[_0xc8e3('0x24')](function(_0x169fe3){if(_0x169fe3){return _0x169fe3[_0xc8e3('0x123')](_0x1ccd37[_0xc8e3('0x33')][_0xc8e3('0x5d')])['then'](function(){if(_['isArray'](_0x1ccd37[_0xc8e3('0x33')][_0xc8e3('0x5d')])){for(var _0x34e170=0x0;_0x34e170<_0x1ccd37['query'][_0xc8e3('0x5d')][_0xc8e3('0x48')];_0x34e170+=0x1){socket['emit'](_0xc8e3('0x124'),{'UserId':Number(_0x1ccd37[_0xc8e3('0x33')]['ids'][_0x34e170]),'ChatWebsiteId':Number(_0x1ccd37[_0xc8e3('0x52')]['id'])});}}else{socket[_0xc8e3('0x125')](_0xc8e3('0x124'),{'UserId':Number(_0x1ccd37[_0xc8e3('0x33')]['ids']),'ChatWebsiteId':Number(_0x1ccd37[_0xc8e3('0x52')]['id'])});}});}})[_0xc8e3('0x24')](respondWithStatusCode(_0x22aa11,null))[_0xc8e3('0x45')](handleError(_0x22aa11,null));};exports[_0xc8e3('0x126')]=function(_0xb98996,_0x2e4917){var _0x558edf={};var _0x4bbc2d={};var _0x4941d1;var _0x4236ae;return db[_0xc8e3('0x41')][_0xc8e3('0x56')]({'where':{'id':_0xb98996['params']['id']}})[_0xc8e3('0x24')](handleEntityNotFound(_0x2e4917,null))[_0xc8e3('0x24')](function(_0x5e4ede){if(_0x5e4ede){_0x4941d1=_0x5e4ede;_0x4bbc2d['model']=_[_0xc8e3('0x34')](db[_0xc8e3('0xe3')][_0xc8e3('0x2f')]);_0x4bbc2d['query']=_[_0xc8e3('0x34')](_0xb98996[_0xc8e3('0x33')]);_0x4bbc2d[_0xc8e3('0x35')]=_[_0xc8e3('0x36')](_0x4bbc2d[_0xc8e3('0x32')],_0x4bbc2d[_0xc8e3('0x33')]);_0x558edf[_0xc8e3('0x37')]=_[_0xc8e3('0x36')](_0x4bbc2d['model'],qs[_0xc8e3('0x38')](_0xb98996[_0xc8e3('0x33')][_0xc8e3('0x38')]));_0x558edf[_0xc8e3('0x37')]=_0x558edf['attributes'][_0xc8e3('0x48')]?_0x558edf[_0xc8e3('0x37')]:_0x4bbc2d[_0xc8e3('0x32')];_0x558edf[_0xc8e3('0x3b')]=qs['sort'](_0xb98996[_0xc8e3('0x33')][_0xc8e3('0x3c')]);_0x558edf[_0xc8e3('0x3d')]=qs[_0xc8e3('0x35')](_['pick'](_0xb98996[_0xc8e3('0x33')],_0x4bbc2d[_0xc8e3('0x35')]));if(_0xb98996['query']['filter']){_0x558edf[_0xc8e3('0x3d')]=_[_0xc8e3('0x3f')](_0x558edf[_0xc8e3('0x3d')],{'$or':_[_0xc8e3('0x2e')](_0x558edf[_0xc8e3('0x37')],function(_0x688491){var _0x45e73e={};_0x45e73e[_0x688491]={'$like':'%'+_0xb98996[_0xc8e3('0x33')][_0xc8e3('0x3e')]+'%'};return _0x45e73e;})});}_0x558edf=_[_0xc8e3('0x3f')]({},_0x558edf,_0xb98996[_0xc8e3('0x40')]);return _0x4941d1[_0xc8e3('0x126')](_0x558edf);}})['then'](function(_0x11caf7){if(_0x11caf7){_0x4236ae=_0x11caf7['length'];if(!_0xb98996[_0xc8e3('0x33')][_0xc8e3('0x39')](_0xc8e3('0x3a'))){_0x558edf['limit']=qs[_0xc8e3('0x20')](_0xb98996[_0xc8e3('0x33')]['limit']);_0x558edf[_0xc8e3('0x1e')]=qs['offset'](_0xb98996[_0xc8e3('0x33')]['offset']);}return _0x4941d1[_0xc8e3('0x126')](_0x558edf);}})[_0xc8e3('0x24')](function(_0x293c7f){if(_0x293c7f){return _0x293c7f?{'count':_0x4236ae,'rows':_0x293c7f}:null;}})['then'](respondWithResult(_0x2e4917,null))[_0xc8e3('0x45')](handleError(_0x2e4917,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 9c05bd1..9f322fe 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 _0xeb5d=['hasOwnProperty','hook','exports','../../mysqldb','ChatWebsite','setMaxListeners','save','emit'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xeb5d[_0x46e363];return _0x3fb059;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xdeb5('0x0'))['db'][_0xdeb5('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xdeb5('0x2')](0x0);var events={'afterCreate':_0xdeb5('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x17d77f){return function(_0x16c31b,_0x546313,_0x19de5e){ChatWebsiteEvents[_0xdeb5('0x4')](_0x17d77f+':'+_0x16c31b['id'],_0x16c31b);ChatWebsiteEvents[_0xdeb5('0x4')](_0x17d77f,_0x16c31b);_0x19de5e(null);};}for(var e in events){if(events[_0xdeb5('0x5')](e)){var event=events[e];ChatWebsite[_0xdeb5('0x6')](e,emitEvent(event));}}module[_0xdeb5('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xb43b=['ChatWebsite','setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x28654e,_0x1eae0a){var _0x52d6c8=function(_0x34e45d){while(--_0x34e45d){_0x28654e['push'](_0x28654e['shift']());}};_0x52d6c8(++_0x1eae0a);}(_0xb43b,0xbf));var _0xbb43=function(_0x3e3b67,_0x8d1bf6){_0x3e3b67=_0x3e3b67-0x0;var _0x4463f9=_0xb43b[_0x3e3b67];return _0x4463f9;};'use strict';var EventEmitter=require(_0xbb43('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xbb43('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xbb43('0x2')](0x0);var events={'afterCreate':_0xbb43('0x3'),'afterUpdate':_0xbb43('0x4'),'afterDestroy':_0xbb43('0x5')};function emitEvent(_0xeeec7c){return function(_0x2e9c09,_0x25f690,_0x24edde){ChatWebsiteEvents[_0xbb43('0x6')](_0xeeec7c+':'+_0x2e9c09['id'],_0x2e9c09);ChatWebsiteEvents[_0xbb43('0x6')](_0xeeec7c,_0x2e9c09);_0x24edde(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xbb43('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 2009d90..2462f69 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 _0xdf62=['exports','ChatWebsite','lodash','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x56a89b,_0x5106a4){var _0xdf565b=function(_0x3dfbfd){while(--_0x3dfbfd){_0x56a89b['push'](_0x56a89b['shift']());}};_0xdf565b(++_0x5106a4);}(_0xdf62,0x152));var _0x2df6=function(_0x42fcd9,_0x2676b7){_0x42fcd9=_0x42fcd9-0x0;var _0x3d2b5a=_0xdf62[_0x42fcd9];return _0x3d2b5a;};'use strict';var _=require(_0x2df6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2df6('0x1'));var moment=require(_0x2df6('0x2'));var BPromise=require(_0x2df6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2df6('0x4'));var config=require(_0x2df6('0x5'));var attributes=require('./chatWebsite.attributes');module[_0x2df6('0x6')]=function(_0x45f80b,_0x165db8){return _0x45f80b['define'](_0x2df6('0x7'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc5c8=['rimraf','../../config/environment','define','ChatWebsite','chat_websites','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x55c947,_0x5e20a8){var _0x2556b3=function(_0x239288){while(--_0x239288){_0x55c947['push'](_0x55c947['shift']());}};_0x2556b3(++_0x5e20a8);}(_0xc5c8,0xe1));var _0x8c5c=function(_0x47db40,_0x5a1d4d){_0x47db40=_0x47db40-0x0;var _0x1aafa8=_0xc5c8[_0x47db40];return _0x1aafa8;};'use strict';var _=require(_0x8c5c('0x0'));var util=require('util');var logger=require(_0x8c5c('0x1'))(_0x8c5c('0x2'));var moment=require('moment');var BPromise=require(_0x8c5c('0x3'));var rp=require(_0x8c5c('0x4'));var fs=require('fs');var path=require(_0x8c5c('0x5'));var rimraf=require(_0x8c5c('0x6'));var config=require(_0x8c5c('0x7'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x103327,_0x8d508b){return _0x103327[_0x8c5c('0x8')](_0x8c5c('0x9'),attributes,{'tableName':_0x8c5c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 4ea2f3f..cfa017b 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 _0x5f10=['rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','debug','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2f418c,_0x100ca7){var _0x1b5aa2=function(_0x241a67){while(--_0x241a67){_0x2f418c['push'](_0x2f418c['shift']());}};_0x1b5aa2(++_0x100ca7);}(_0x5f10,0x14a));var _0x05f1=function(_0x5b26cb,_0x527ab0){_0x5b26cb=_0x5b26cb-0x0;var _0x563d12=_0x5f10[_0x5b26cb];return _0x563d12;};'use strict';var _=require(_0x05f1('0x0'));var util=require(_0x05f1('0x1'));var moment=require(_0x05f1('0x2'));var BPromise=require(_0x05f1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x05f1('0x4'));var db=require(_0x05f1('0x5'))['db'];var utils=require(_0x05f1('0x6'));var logger=require(_0x05f1('0x7'))(_0x05f1('0x8'));var config=require(_0x05f1('0x9'));var jayson=require(_0x05f1('0xa'));var client=jayson['client'][_0x05f1('0xb')]({'port':0x232a});config[_0x05f1('0xc')]=_[_0x05f1('0xd')](config[_0x05f1('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x05f1('0xe'))(new Redis(config[_0x05f1('0xc')]));require(_0x05f1('0xf'))[_0x05f1('0x10')](socket);function respondWithRpcPromise(_0x5257b4,_0x553351,_0x588d92){return new BPromise(function(_0x1a1ac6,_0x201614){return client[_0x05f1('0x11')](_0x5257b4,_0x588d92)[_0x05f1('0x12')](function(_0x4c738f){logger['info'](_0x05f1('0x13'),_0x553351,'request\x20sent');logger[_0x05f1('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x553351,'request\x20sent',JSON['stringify'](_0x4c738f));if(_0x4c738f[_0x05f1('0x15')]){if(_0x4c738f['error'][_0x05f1('0x16')]===0x1f4){logger[_0x05f1('0x15')](_0x05f1('0x13'),_0x553351,_0x4c738f[_0x05f1('0x15')][_0x05f1('0x17')]);return _0x201614(_0x4c738f['error'][_0x05f1('0x17')]);}logger[_0x05f1('0x15')](_0x05f1('0x13'),_0x553351,_0x4c738f['error']['message']);return _0x1a1ac6(_0x4c738f[_0x05f1('0x15')][_0x05f1('0x17')]);}else{logger['info'](_0x05f1('0x13'),_0x553351,_0x05f1('0x18'));_0x1a1ac6(_0x4c738f['result']['message']);}})[_0x05f1('0x19')](function(_0x4b0875){logger[_0x05f1('0x15')](_0x05f1('0x13'),_0x553351,_0x4b0875);_0x201614(_0x4b0875);});});}
\ No newline at end of file
+var _0x2464=['./chatWebsite.socket','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','defaults','socket.io-emitter','redis'];(function(_0x29bd77,_0x805140){var _0x3bee2c=function(_0x4d5b2f){while(--_0x4d5b2f){_0x29bd77['push'](_0x29bd77['shift']());}};_0x3bee2c(++_0x805140);}(_0x2464,0x1e0));var _0x4246=function(_0xbced34,_0x1a4691){_0xbced34=_0xbced34-0x0;var _0x46e614=_0x2464[_0xbced34];return _0x46e614;};'use strict';var _=require(_0x4246('0x0'));var util=require(_0x4246('0x1'));var moment=require(_0x4246('0x2'));var BPromise=require(_0x4246('0x3'));var rs=require(_0x4246('0x4'));var fs=require('fs');var Redis=require(_0x4246('0x5'));var db=require(_0x4246('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4246('0x7'))(_0x4246('0x8'));var config=require('../../config/environment');var jayson=require(_0x4246('0x9'));var client=jayson['client'][_0x4246('0xa')]({'port':0x232a});config['redis']=_[_0x4246('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4246('0xc'))(new Redis(config[_0x4246('0xd')]));require(_0x4246('0xe'))['register'](socket);function respondWithRpcPromise(_0x538e80,_0x4fd057,_0x45bee9){return new BPromise(function(_0x457522,_0x4ae189){return client[_0x4246('0xf')](_0x538e80,_0x45bee9)['then'](function(_0x2f0c31){logger[_0x4246('0x10')](_0x4246('0x11'),_0x4fd057,_0x4246('0x12'));logger[_0x4246('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4fd057,_0x4246('0x12'),JSON[_0x4246('0x14')](_0x2f0c31));if(_0x2f0c31[_0x4246('0x15')]){if(_0x2f0c31[_0x4246('0x15')][_0x4246('0x16')]===0x1f4){logger[_0x4246('0x15')](_0x4246('0x11'),_0x4fd057,_0x2f0c31[_0x4246('0x15')][_0x4246('0x17')]);return _0x4ae189(_0x2f0c31[_0x4246('0x15')]['message']);}logger[_0x4246('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x4fd057,_0x2f0c31[_0x4246('0x15')][_0x4246('0x17')]);return _0x457522(_0x2f0c31[_0x4246('0x15')]['message']);}else{logger[_0x4246('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x4fd057,'request\x20sent');_0x457522(_0x2f0c31[_0x4246('0x18')]['message']);}})[_0x4246('0x19')](function(_0x39c3e8){logger[_0x4246('0x15')](_0x4246('0x11'),_0x4fd057,_0x39c3e8);_0x4ae189(_0x39c3e8);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 94caf7e..ca0d72f 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 _0x725d=['register','length','./chatWebsite.events','save','remove','update','removeListener'];(function(_0x361d3f,_0x3be2aa){var _0x320229=function(_0x138319){while(--_0x138319){_0x361d3f['push'](_0x361d3f['shift']());}};_0x320229(++_0x3be2aa);}(_0x725d,0x159));var _0xd725=function(_0x442dcb,_0x179c35){_0x442dcb=_0x442dcb-0x0;var _0x593554=_0x725d[_0x442dcb];return _0x593554;};'use strict';var ChatWebsiteEvents=require(_0xd725('0x0'));var events=[_0xd725('0x1'),_0xd725('0x2'),_0xd725('0x3')];function createListener(_0x39a1d2,_0x54a7ef){return function(_0x4f4d2f){_0x54a7ef['emit'](_0x39a1d2,_0x4f4d2f);};}function removeListener(_0x4dc885,_0x3f9518){return function(){ChatWebsiteEvents[_0xd725('0x4')](_0x4dc885,_0x3f9518);};}exports[_0xd725('0x5')]=function(_0x2b34e7){for(var _0x294d9b=0x0,_0x323ee8=events[_0xd725('0x6')];_0x294d9b<_0x323ee8;_0x294d9b++){var _0x58c1fa=events[_0x294d9b];var _0x34281e=createListener('chatWebsite:'+_0x58c1fa,_0x2b34e7);ChatWebsiteEvents['on'](_0x58c1fa,_0x34281e);}};
\ No newline at end of file
+var _0x2ca0=['register','length','chatWebsite:','./chatWebsite.events','remove','update','emit'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2ca0,0xc0));var _0x02ca=function(_0x546ac5,_0x59e59b){_0x546ac5=_0x546ac5-0x0;var _0x56a6d8=_0x2ca0[_0x546ac5];return _0x56a6d8;};'use strict';var ChatWebsiteEvents=require(_0x02ca('0x0'));var events=['save',_0x02ca('0x1'),_0x02ca('0x2')];function createListener(_0x112149,_0x3a0ecf){return function(_0x38d5b8){_0x3a0ecf[_0x02ca('0x3')](_0x112149,_0x38d5b8);};}function removeListener(_0x51ba9a,_0x52dddd){return function(){ChatWebsiteEvents['removeListener'](_0x51ba9a,_0x52dddd);};}exports[_0x02ca('0x4')]=function(_0x48ccd1){for(var _0x477438=0x0,_0x12033d=events[_0x02ca('0x5')];_0x477438<_0x12033d;_0x477438++){var _0x43b2c7=events[_0x477438];var _0x41864a=createListener(_0x02ca('0x6')+_0x43b2c7,_0x48ccd1);ChatWebsiteEvents['on'](_0x43b2c7,_0x41864a);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 73ab982..fe14695 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 _0x6d78=['/:id/proactive_actions','getFields','/:id/offline_messages','/:id/users','post','addDisposition','/:id/canned_answers','diskStorage','root','format','%s-%s','now','originalname','/:id/logo','single','file','addLogo','server/files/images/avatars/','addAvatar','join','addSystemAvatar','/:id/notify','server/files','attachments','ensureDir','extname','replace','/:id/offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','addAgents','update','delete','destroy','removeDispositions','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatWebsite.controller','get','describe','/:id','isAuthenticated','show','/:id/dispositions','getDispositions','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6d78,0x121));var _0x86d7=function(_0x1a8d04,_0x50ba5b){_0x1a8d04=_0x1a8d04-0x0;var _0x409144=_0x6d78[_0x1a8d04];return _0x409144;};'use strict';var multer=require(_0x86d7('0x0'));var util=require(_0x86d7('0x1'));var path=require('path');var timeout=require(_0x86d7('0x2'));var express=require(_0x86d7('0x3'));var router=express[_0x86d7('0x4')]();var fs_extra=require(_0x86d7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x86d7('0x6'));var config=require('../../config/environment');var controller=require(_0x86d7('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x86d7('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x86d7('0x9')]);router[_0x86d7('0x8')](_0x86d7('0xa'),auth[_0x86d7('0xb')](),controller[_0x86d7('0xc')]);router[_0x86d7('0x8')](_0x86d7('0xd'),auth[_0x86d7('0xb')](),controller[_0x86d7('0xe')]);router['get']('/:id/canned_answers',auth[_0x86d7('0xb')](),controller['getAnswers']);router['get']('/:id/logo',controller[_0x86d7('0xf')]);router[_0x86d7('0x8')](_0x86d7('0x10'),controller[_0x86d7('0x11')]);router[_0x86d7('0x8')](_0x86d7('0x12'),controller['getCustomerAvatar']);router[_0x86d7('0x8')](_0x86d7('0x13'),controller[_0x86d7('0x14')]);router['get']('/:id/interactions',auth[_0x86d7('0xb')](),controller[_0x86d7('0x15')]);router['get'](_0x86d7('0x16'),controller[_0x86d7('0x17')]);router['get'](_0x86d7('0x18'),auth[_0x86d7('0xb')](),controller[_0x86d7('0x19')]);router[_0x86d7('0x8')](_0x86d7('0x1a'),auth[_0x86d7('0xb')](),controller['getProactiveActions']);router[_0x86d7('0x8')]('/:id/fields',controller[_0x86d7('0x1b')]);router[_0x86d7('0x8')](_0x86d7('0x1c'),auth[_0x86d7('0xb')](),controller['getOfflineMessages']);router[_0x86d7('0x8')](_0x86d7('0x1d'),auth['isAuthenticated'](),controller['getAgents']);router[_0x86d7('0x1e')]('/',auth[_0x86d7('0xb')](),controller['create']);router['post']('/:id/dispositions',auth[_0x86d7('0xb')](),controller[_0x86d7('0x1f')]);router[_0x86d7('0x1e')](_0x86d7('0x20'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer[_0x86d7('0x21')]({'destination':function(_0x43b55c,_0x2fc787,_0x586e5a){_0x586e5a(null,path['join'](config[_0x86d7('0x22')],'server/files/images/logos/'));},'filename':function(_0x41792f,_0x3d5a46,_0x487e81){_0x487e81(null,util[_0x86d7('0x23')](_0x86d7('0x24'),Date[_0x86d7('0x25')](),_0x3d5a46[_0x86d7('0x26')]));}})});router[_0x86d7('0x1e')](_0x86d7('0x27'),upload[_0x86d7('0x28')](_0x86d7('0x29')),controller[_0x86d7('0x2a')]);var upload=multer({'storage':multer[_0x86d7('0x21')]({'destination':function(_0x37c966,_0x19511f,_0x47909c){_0x47909c(null,path['join'](config[_0x86d7('0x22')],_0x86d7('0x2b')));},'filename':function(_0x26b3b5,_0x2bdc68,_0x59977b){_0x59977b(null,util[_0x86d7('0x23')](_0x86d7('0x24'),Date[_0x86d7('0x25')](),_0x2bdc68[_0x86d7('0x26')]));}})});router[_0x86d7('0x1e')](_0x86d7('0x10'),upload[_0x86d7('0x28')](_0x86d7('0x29')),controller[_0x86d7('0x2c')]);var upload=multer({'storage':multer[_0x86d7('0x21')]({'destination':function(_0x29141c,_0x92a0d3,_0x4b6df5){_0x4b6df5(null,path[_0x86d7('0x2d')](config[_0x86d7('0x22')],_0x86d7('0x2b')));},'filename':function(_0x5153a9,_0x4105e8,_0x4ce8e0){_0x4ce8e0(null,util['format'](_0x86d7('0x24'),Date[_0x86d7('0x25')](),_0x4105e8[_0x86d7('0x26')]));}})});router[_0x86d7('0x1e')](_0x86d7('0x12'),upload[_0x86d7('0x28')](_0x86d7('0x29')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x86d7('0x21')]({'destination':function(_0x10bbb8,_0x2e4648,_0x2f2219){_0x2f2219(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x463e8b,_0x43e5d4,_0x39e748){_0x39e748(null,util['format'](_0x86d7('0x24'),Date[_0x86d7('0x25')](),_0x43e5d4[_0x86d7('0x26')]));}})});router[_0x86d7('0x1e')]('/:id/system_avatar',upload[_0x86d7('0x28')](_0x86d7('0x29')),controller[_0x86d7('0x2e')]);router[_0x86d7('0x1e')](_0x86d7('0x2f'),controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x9fb50c,_0x53ce03,_0x3531a5){const _0x523dba=path[_0x86d7('0x2d')](config[_0x86d7('0x22')],_0x86d7('0x30'),_0x86d7('0x31'),'offline-chat');fs_extra[_0x86d7('0x32')](_0x523dba,function(){_0x3531a5(null,_0x523dba);});},'filename':function(_0x2f87c9,_0x2b9dc2,_0x362830){const _0x12f5b2=_0x2b9dc2[_0x86d7('0x26')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1898b6=path[_0x86d7('0x33')](_0x12f5b2);const _0x1c9313=Date[_0x86d7('0x25')]()+'-'+_0x12f5b2[_0x86d7('0x34')](_0x1898b6,'')+_0x1898b6;_0x362830(null,_0x1c9313);}})});router[_0x86d7('0x1e')](_0x86d7('0x35'),offlineUploadMulter['any'](),controller['offline']);router['post'](_0x86d7('0x36'),auth[_0x86d7('0xb')](),controller[_0x86d7('0x37')]);router['post'](_0x86d7('0x18'),auth[_0x86d7('0xb')](),controller[_0x86d7('0x38')]);router[_0x86d7('0x1e')](_0x86d7('0x1a'),auth[_0x86d7('0xb')](),controller[_0x86d7('0x39')]);router[_0x86d7('0x1e')](_0x86d7('0x1d'),auth['isAuthenticated'](),controller[_0x86d7('0x3a')]);router['put'](_0x86d7('0xa'),auth['isAuthenticated'](),controller[_0x86d7('0x3b')]);router[_0x86d7('0x3c')](_0x86d7('0xa'),auth[_0x86d7('0xb')](),controller[_0x86d7('0x3d')]);router[_0x86d7('0x3c')](_0x86d7('0xd'),auth[_0x86d7('0xb')](),controller[_0x86d7('0x3e')]);router[_0x86d7('0x3c')](_0x86d7('0x20'),auth[_0x86d7('0xb')](),controller['removeAnswers']);router['delete'](_0x86d7('0x1d'),auth[_0x86d7('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x5b0b=['/:id/customer_avatar','addCustomerAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','any','offline','/:id/interactions','addInteraction','addProactiveActions','addAgents','put','update','destroy','delete','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../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','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','single','file','addLogo','join','now','originalname','addAvatar','server/files/images/avatars/'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b0b,0x19c));var _0xb5b0=function(_0xd66a31,_0xacd08d){_0xd66a31=_0xd66a31-0x0;var _0x2f4fa4=_0x5b0b[_0xd66a31];return _0x2f4fa4;};'use strict';var multer=require(_0xb5b0('0x0'));var util=require('util');var path=require(_0xb5b0('0x1'));var timeout=require(_0xb5b0('0x2'));var express=require(_0xb5b0('0x3'));var router=express[_0xb5b0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb5b0('0x5'));var interaction=require(_0xb5b0('0x6'));var config=require(_0xb5b0('0x7'));var controller=require(_0xb5b0('0x8'));router[_0xb5b0('0x9')]('/',auth[_0xb5b0('0xa')](),controller[_0xb5b0('0xb')]);router[_0xb5b0('0x9')](_0xb5b0('0xc'),auth[_0xb5b0('0xa')](),controller[_0xb5b0('0xd')]);router[_0xb5b0('0x9')](_0xb5b0('0xe'),auth['isAuthenticated'](),controller[_0xb5b0('0xf')]);router[_0xb5b0('0x9')]('/:id/dispositions',auth[_0xb5b0('0xa')](),controller[_0xb5b0('0x10')]);router[_0xb5b0('0x9')](_0xb5b0('0x11'),auth[_0xb5b0('0xa')](),controller[_0xb5b0('0x12')]);router[_0xb5b0('0x9')](_0xb5b0('0x13'),controller[_0xb5b0('0x14')]);router[_0xb5b0('0x9')](_0xb5b0('0x15'),controller[_0xb5b0('0x16')]);router['get']('/:id/customer_avatar',controller[_0xb5b0('0x17')]);router[_0xb5b0('0x9')](_0xb5b0('0x18'),controller[_0xb5b0('0x19')]);router[_0xb5b0('0x9')]('/:id/interactions',auth[_0xb5b0('0xa')](),controller[_0xb5b0('0x1a')]);router['get'](_0xb5b0('0x1b'),controller[_0xb5b0('0x1c')]);router[_0xb5b0('0x9')]('/:id/applications',auth[_0xb5b0('0xa')](),controller[_0xb5b0('0x1d')]);router[_0xb5b0('0x9')](_0xb5b0('0x1e'),auth[_0xb5b0('0xa')](),controller[_0xb5b0('0x1f')]);router['get'](_0xb5b0('0x20'),controller[_0xb5b0('0x21')]);router[_0xb5b0('0x9')](_0xb5b0('0x22'),auth[_0xb5b0('0xa')](),controller[_0xb5b0('0x23')]);router[_0xb5b0('0x9')](_0xb5b0('0x24'),auth[_0xb5b0('0xa')](),controller[_0xb5b0('0x25')]);router[_0xb5b0('0x26')]('/',auth[_0xb5b0('0xa')](),controller[_0xb5b0('0x27')]);router['post'](_0xb5b0('0x28'),auth['isAuthenticated'](),controller[_0xb5b0('0x29')]);router[_0xb5b0('0x26')]('/:id/canned_answers',auth[_0xb5b0('0xa')](),controller[_0xb5b0('0x2a')]);var upload=multer({'storage':multer[_0xb5b0('0x2b')]({'destination':function(_0x315b62,_0x43b5dc,_0x28db99){_0x28db99(null,path['join'](config[_0xb5b0('0x2c')],_0xb5b0('0x2d')));},'filename':function(_0x236287,_0xa31597,_0x4be787){_0x4be787(null,util[_0xb5b0('0x2e')](_0xb5b0('0x2f'),Date['now'](),_0xa31597['originalname']));}})});router[_0xb5b0('0x26')]('/:id/logo',upload[_0xb5b0('0x30')](_0xb5b0('0x31')),controller[_0xb5b0('0x32')]);var upload=multer({'storage':multer[_0xb5b0('0x2b')]({'destination':function(_0x5a5403,_0x4d331e,_0xaa37e){_0xaa37e(null,path[_0xb5b0('0x33')](config[_0xb5b0('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x4a1e85,_0x25a568,_0x2dbe06){_0x2dbe06(null,util[_0xb5b0('0x2e')]('%s-%s',Date[_0xb5b0('0x34')](),_0x25a568[_0xb5b0('0x35')]));}})});router['post'](_0xb5b0('0x15'),upload['single']('file'),controller[_0xb5b0('0x36')]);var upload=multer({'storage':multer[_0xb5b0('0x2b')]({'destination':function(_0x2d2dd0,_0x231ef6,_0x11eb8f){_0x11eb8f(null,path[_0xb5b0('0x33')](config[_0xb5b0('0x2c')],_0xb5b0('0x37')));},'filename':function(_0x2df4f8,_0x50744b,_0x42fec9){_0x42fec9(null,util[_0xb5b0('0x2e')](_0xb5b0('0x2f'),Date[_0xb5b0('0x34')](),_0x50744b[_0xb5b0('0x35')]));}})});router[_0xb5b0('0x26')](_0xb5b0('0x38'),upload[_0xb5b0('0x30')]('file'),controller[_0xb5b0('0x39')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x7f4b3b,_0x374520,_0x11d09){_0x11d09(null,path[_0xb5b0('0x33')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x473259,_0x162dc8,_0x2e6016){_0x2e6016(null,util[_0xb5b0('0x2e')](_0xb5b0('0x2f'),Date[_0xb5b0('0x34')](),_0x162dc8['originalname']));}})});router[_0xb5b0('0x26')](_0xb5b0('0x18'),upload[_0xb5b0('0x30')]('file'),controller['addSystemAvatar']);router[_0xb5b0('0x26')](_0xb5b0('0x3a'),controller[_0xb5b0('0x3b')]);const offlineUploadMulter=multer({'storage':multer[_0xb5b0('0x2b')]({'destination':function(_0x6eb78b,_0x28db43,_0x5f3bd3){const _0x334312=path[_0xb5b0('0x33')](config['root'],_0xb5b0('0x3c'),'attachments',_0xb5b0('0x3d'));fs_extra[_0xb5b0('0x3e')](_0x334312,function(){_0x5f3bd3(null,_0x334312);});},'filename':function(_0x6956da,_0x3e9c1b,_0x2274f3){const _0x358fbd=_0x3e9c1b[_0xb5b0('0x35')][_0xb5b0('0x3f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3b327e=path[_0xb5b0('0x40')](_0x358fbd);const _0x5a1f84=Date[_0xb5b0('0x34')]()+'-'+_0x358fbd[_0xb5b0('0x3f')](_0x3b327e,'')+_0x3b327e;_0x2274f3(null,_0x5a1f84);}})});router[_0xb5b0('0x26')]('/:id/offline',offlineUploadMulter[_0xb5b0('0x41')](),controller[_0xb5b0('0x42')]);router['post'](_0xb5b0('0x43'),auth[_0xb5b0('0xa')](),controller[_0xb5b0('0x44')]);router[_0xb5b0('0x26')]('/:id/applications',auth[_0xb5b0('0xa')](),controller['addApplications']);router[_0xb5b0('0x26')](_0xb5b0('0x1e'),auth[_0xb5b0('0xa')](),controller[_0xb5b0('0x45')]);router[_0xb5b0('0x26')]('/:id/users',auth['isAuthenticated'](),controller[_0xb5b0('0x46')]);router[_0xb5b0('0x47')](_0xb5b0('0xe'),auth[_0xb5b0('0xa')](),controller[_0xb5b0('0x48')]);router['delete']('/:id',auth[_0xb5b0('0xa')](),controller[_0xb5b0('0x49')]);router[_0xb5b0('0x4a')](_0xb5b0('0x28'),auth[_0xb5b0('0xa')](),controller['removeDispositions']);router[_0xb5b0('0x4a')](_0xb5b0('0x11'),auth[_0xb5b0('0xa')](),controller[_0xb5b0('0x4b')]);router['delete'](_0xb5b0('0x24'),auth[_0xb5b0('0xa')](),controller[_0xb5b0('0x4c')]);module[_0xb5b0('0x4d')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index d469e49..c796a13 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xebc8=['isAuthenticated','exports','beaver-logger/server','../config/environment','Router','env','production','app','get','client-side-logger'];(function(_0xea6b4d,_0x36a149){var _0x504db3=function(_0x3f3163){while(--_0x3f3163){_0xea6b4d['push'](_0xea6b4d['shift']());}};_0x504db3(++_0x36a149);}(_0xebc8,0x124));var _0x8ebc=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xebc8[_0x3b380d];return _0x54502b;};var beaverLogger=require(_0x8ebc('0x0'));var express=require('express');var auth=require('../components/auth/service');var config=require(_0x8ebc('0x1'));var router=express[_0x8ebc('0x2')]();var isProduction=config[_0x8ebc('0x3')]===_0x8ebc('0x4')||![];function clientSideLogs(_0x35a4fa,_0x1048fc,_0x43ed06){var _0x80af24=_0x35a4fa[_0x8ebc('0x5')][_0x8ebc('0x6')](_0x8ebc('0x7'));if(!_0x80af24){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger['expressEndpoint']({'uri':'/client-logs','logger':_0x80af24,'enableCors':!isProduction})(_0x35a4fa,_0x1048fc,_0x43ed06);}router['use'](auth[_0x8ebc('0x8')](),clientSideLogs);module[_0x8ebc('0x9')]=router;
\ No newline at end of file
+var _0xca6c=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','exports','beaver-logger/server','express','../components/auth/service','../config/environment','env','get'];(function(_0x263f05,_0x1a2c41){var _0x167369=function(_0x3c3ae0){while(--_0x3c3ae0){_0x263f05['push'](_0x263f05['shift']());}};_0x167369(++_0x1a2c41);}(_0xca6c,0x68));var _0xcca6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xca6c[_0x3dd15e];return _0x231fd0;};var beaverLogger=require(_0xcca6('0x0'));var express=require(_0xcca6('0x1'));var auth=require(_0xcca6('0x2'));var config=require(_0xcca6('0x3'));var router=express['Router']();var isProduction=config[_0xcca6('0x4')]==='production'||![];function clientSideLogs(_0x717da9,_0x2bcf59,_0x1e66ab){var _0x1525f9=_0x717da9['app'][_0xcca6('0x5')]('client-side-logger');if(!_0x1525f9){throw new Error(_0xcca6('0x6'));}return beaverLogger[_0xcca6('0x7')]({'uri':'/client-logs','logger':_0x1525f9,'enableCors':!isProduction})(_0x717da9,_0x2bcf59,_0x1e66ab);}router[_0xcca6('0x8')](auth['isAuthenticated'](),clientSideLogs);module[_0xcca6('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 17fe71f..bd6b910 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 _0x85ac=['MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google'];(function(_0x378752,_0x158b32){var _0xd5a262=function(_0x3c6f94){while(--_0x3c6f94){_0x378752['push'](_0x378752['shift']());}};_0xd5a262(++_0x158b32);}(_0x85ac,0x1f2));var _0xc85a=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x85ac[_0x54d4a8];return _0x3b321b;};'use strict';var Sequelize=require(_0xc85a('0x0'));module[_0xc85a('0x1')]={'name':{'type':Sequelize[_0xc85a('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xc85a('0x3')](_0xc85a('0x4'),_0xc85a('0x5'),_0xc85a('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xc85a('0x3')](_0xc85a('0x7'),_0xc85a('0x8'))},'data1':{'type':Sequelize[_0xc85a('0x2')],'comment':_0xc85a('0x9')},'data2':{'type':Sequelize[_0xc85a('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xc85a('0x2')],'comment':_0xc85a('0xa')},'data4':{'type':Sequelize[_0xc85a('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xc85a('0xb')],'comment':_0xc85a('0xc')},'data6':{'type':Sequelize[_0xc85a('0xb')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xc85a('0xb')],'comment':_0xc85a('0xd')}};
\ No newline at end of file
+var _0x0265=['MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant'];(function(_0x4c8184,_0x1363f9){var _0x22a8d5=function(_0x5537c8){while(--_0x5537c8){_0x4c8184['push'](_0x4c8184['shift']());}};_0x22a8d5(++_0x1363f9);}(_0x0265,0xc9));var _0x5026=function(_0x155f85,_0x2ba3d4){_0x155f85=_0x155f85-0x0;var _0x313887=_0x0265[_0x155f85];return _0x313887;};'use strict';var Sequelize=require(_0x5026('0x0'));module[_0x5026('0x1')]={'name':{'type':Sequelize[_0x5026('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x5026('0x3')](_0x5026('0x4'),'Google',_0x5026('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x5026('0x3')](_0x5026('0x6'),'Dynamics365')},'data1':{'type':Sequelize[_0x5026('0x2')],'comment':_0x5026('0x7')},'data2':{'type':Sequelize[_0x5026('0x2')],'comment':_0x5026('0x8')},'data3':{'type':Sequelize[_0x5026('0x2')],'comment':_0x5026('0x9')},'data4':{'type':Sequelize[_0x5026('0x2')],'comment':_0x5026('0xa')},'data5':{'type':Sequelize[_0x5026('0xb')],'comment':_0x5026('0xc')},'data6':{'type':Sequelize[_0x5026('0xb')],'comment':_0x5026('0xd')},'data7':{'type':Sequelize[_0x5026('0xb')],'comment':_0x5026('0xe')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index c814d7c..4af4d68 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 _0xfd60=['MicrosoftAzure','decryptString','data3','catch','keys','CloudProvider','attributes','fields','find','service','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','params','findOne','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','toString','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','error','name','send','padEnd','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows'];(function(_0x5e1bc0,_0x103ecf){var _0xc3685f=function(_0x4767a3){while(--_0x4767a3){_0x5e1bc0['push'](_0x5e1bc0['shift']());}};_0xc3685f(++_0x103ecf);}(_0xfd60,0xe2));var _0x0fd6=function(_0x43941d,_0x45fd0d){_0x43941d=_0x43941d-0x0;var _0x27b82a=_0xfd60[_0x43941d];return _0x27b82a;};'use strict';var _=require('lodash');var Redis=require(_0x0fd6('0x0'));var qs=require(_0x0fd6('0x1'));var encryptor=require(_0x0fd6('0x2'));var config=require(_0x0fd6('0x3'));var logger=require(_0x0fd6('0x4'))(_0x0fd6('0x5'));var db=require(_0x0fd6('0x6'))['db'];var oauth=require(_0x0fd6('0x7'));config[_0x0fd6('0x8')]=_[_0x0fd6('0x9')](config[_0x0fd6('0x8')],{'host':_0x0fd6('0xa'),'port':0x18eb});var socket=require(_0x0fd6('0xb'))(new Redis(config[_0x0fd6('0x8')]));var redis=new Redis(config[_0x0fd6('0x8')]);function respondWithStatusCode(_0x4e81b7,_0x3b91dd){_0x3b91dd=_0x3b91dd||0xcc;return function(_0x586d43){if(_0x586d43){return _0x4e81b7[_0x0fd6('0xc')](_0x3b91dd);}return _0x4e81b7['status'](_0x3b91dd)[_0x0fd6('0xd')]();};}function respondWithResult(_0x540bc1,_0x120ae8){_0x120ae8=_0x120ae8||0xc8;return function(_0x30f4eb){if(_0x30f4eb){return _0x540bc1[_0x0fd6('0xe')](_0x120ae8)[_0x0fd6('0xf')](_0x30f4eb);}};}function respondWithFilteredResult(_0x4c9ed2,_0x59c873){return function(_0x4a43b1){if(_0x4a43b1){var _0x5de61c=typeof _0x59c873[_0x0fd6('0x10')]===_0x0fd6('0x11')&&typeof _0x59c873[_0x0fd6('0x12')]==='undefined';var _0x4dde80=_0x4a43b1[_0x0fd6('0x13')];var _0x5a055f=_0x5de61c?0x0:_0x59c873[_0x0fd6('0x10')];var _0x292bc1=_0x5de61c?_0x4a43b1[_0x0fd6('0x13')]:_0x59c873['offset']+_0x59c873[_0x0fd6('0x12')];var _0x4ebc63;if(_0x292bc1>=_0x4dde80){_0x292bc1=_0x4dde80;_0x4ebc63=0xc8;}else{_0x4ebc63=0xce;}_0x4c9ed2[_0x0fd6('0xe')](_0x4ebc63);return _0x4c9ed2['set'](_0x0fd6('0x14'),_0x5a055f+'-'+_0x292bc1+'/'+_0x4dde80)['json'](_0x4a43b1);}return null;};}function saveUpdates(_0xe52b67){return function(_0x5df0d4){if(_0x5df0d4){return _0x5df0d4[_0x0fd6('0x15')](_0xe52b67)[_0x0fd6('0x16')](function(_0x30896b){return _0x30896b;});}return null;};}function removeEntity(_0x4316db){return function(_0x7052bb){if(_0x7052bb){return _0x7052bb[_0x0fd6('0x17')]()['then'](function(){_0x4316db[_0x0fd6('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39b8af){return function(_0x1d8079){if(!_0x1d8079){_0x39b8af[_0x0fd6('0xc')](0x194);}return _0x1d8079;};}function handleError(_0x4dd12c,_0x3f4c46){_0x3f4c46=_0x3f4c46||0x1f4;return function(_0x454a8c){logger[_0x0fd6('0x18')](_0x454a8c['stack']);if(_0x454a8c[_0x0fd6('0x19')]){delete _0x454a8c['name'];}_0x4dd12c[_0x0fd6('0xe')](_0x3f4c46)[_0x0fd6('0x1a')](_0x454a8c);};}function maskClientSecret(_0x20735a){return _[_0x0fd6('0x1b')](_0x20735a['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x42986e,_0x14bda2){var _0x3919bb={},_0x2f9e71={},_0x13dc78={'count':0x0,'rows':[]};var _0xbe653a=_[_0x0fd6('0x1c')](db['CloudProvider'][_0x0fd6('0x1d')],function(_0x4b8d40){return{'name':_0x4b8d40[_0x0fd6('0x1e')],'type':_0x4b8d40[_0x0fd6('0x1f')][_0x0fd6('0x20')]};});_0x2f9e71[_0x0fd6('0x21')]=_[_0x0fd6('0x1c')](_0xbe653a,_0x0fd6('0x19'));_0x2f9e71[_0x0fd6('0x22')]=_['keys'](_0x42986e[_0x0fd6('0x22')]);_0x2f9e71[_0x0fd6('0x23')]=_['intersection'](_0x2f9e71[_0x0fd6('0x21')],_0x2f9e71[_0x0fd6('0x22')]);_0x3919bb['attributes']=_[_0x0fd6('0x24')](_0x2f9e71[_0x0fd6('0x21')],qs['fields'](_0x42986e['query']['fields']));_0x3919bb['attributes']=_0x3919bb['attributes'][_0x0fd6('0x25')]?_0x3919bb['attributes']:_0x2f9e71[_0x0fd6('0x21')];if(!_0x42986e['query']['hasOwnProperty'](_0x0fd6('0x26'))){_0x3919bb[_0x0fd6('0x12')]=qs[_0x0fd6('0x12')](_0x42986e[_0x0fd6('0x22')][_0x0fd6('0x12')]);_0x3919bb[_0x0fd6('0x10')]=qs[_0x0fd6('0x10')](_0x42986e[_0x0fd6('0x22')][_0x0fd6('0x10')]);}_0x3919bb[_0x0fd6('0x27')]=qs['sort'](_0x42986e[_0x0fd6('0x22')][_0x0fd6('0x28')]);_0x3919bb['where']=qs[_0x0fd6('0x23')](_[_0x0fd6('0x29')](_0x42986e['query'],_0x2f9e71['filters']),_0xbe653a);if(_0x42986e[_0x0fd6('0x22')]['filter']){_0x3919bb[_0x0fd6('0x2a')]=_[_0x0fd6('0x2b')](_0x3919bb[_0x0fd6('0x2a')],{'$or':_[_0x0fd6('0x1c')](_0xbe653a,function(_0x2bebf9){if(_0x2bebf9[_0x0fd6('0x1f')]!==_0x0fd6('0x2c')){var _0x16112b={};_0x16112b[_0x2bebf9[_0x0fd6('0x19')]]={'$like':'%'+_0x42986e[_0x0fd6('0x22')][_0x0fd6('0x2d')]+'%'};return _0x16112b;}})});}_0x3919bb=_[_0x0fd6('0x2b')]({},_0x3919bb,_0x42986e['options']);var _0x4d53ff={'where':_0x3919bb[_0x0fd6('0x2a')]};return db['CloudProvider'][_0x0fd6('0x13')](_0x4d53ff)['then'](function(_0x5ab885){_0x13dc78[_0x0fd6('0x13')]=_0x5ab885;if(_0x42986e['query'][_0x0fd6('0x2e')]){_0x3919bb[_0x0fd6('0x2f')]=[{'all':!![]}];}return db['CloudProvider'][_0x0fd6('0x30')](_0x3919bb);})[_0x0fd6('0x16')](function(_0x513317){_0x13dc78[_0x0fd6('0x31')]=_[_0x0fd6('0x1c')](_0x513317,function(_0x17c827){if(_0x17c827['service']===_0x0fd6('0x32')){var _0x44eb6d=encryptor[_0x0fd6('0x33')](_0x17c827[_0x0fd6('0x34')]);_0x17c827['data3']=maskClientSecret(_0x44eb6d);}return _0x17c827;});return _0x13dc78;})[_0x0fd6('0x16')](respondWithFilteredResult(_0x14bda2,_0x3919bb))[_0x0fd6('0x35')](handleError(_0x14bda2,null));};exports['show']=function(_0x10244f,_0x5a1eba){var _0x5829d9={'raw':!![],'where':{'id':_0x10244f['params']['id']}},_0x13de3c={};_0x13de3c[_0x0fd6('0x21')]=_[_0x0fd6('0x36')](db[_0x0fd6('0x37')][_0x0fd6('0x1d')]);_0x13de3c['query']=_['keys'](_0x10244f[_0x0fd6('0x22')]);_0x13de3c[_0x0fd6('0x23')]=_['intersection'](_0x13de3c[_0x0fd6('0x21')],_0x13de3c[_0x0fd6('0x22')]);_0x5829d9[_0x0fd6('0x38')]=_[_0x0fd6('0x24')](_0x13de3c[_0x0fd6('0x21')],qs[_0x0fd6('0x39')](_0x10244f[_0x0fd6('0x22')][_0x0fd6('0x39')]));_0x5829d9[_0x0fd6('0x38')]=_0x5829d9[_0x0fd6('0x38')]['length']?_0x5829d9[_0x0fd6('0x38')]:_0x13de3c[_0x0fd6('0x21')];if(_0x10244f['query'][_0x0fd6('0x2e')]){_0x5829d9[_0x0fd6('0x2f')]=[{'all':!![]}];}_0x5829d9=_[_0x0fd6('0x2b')]({},_0x5829d9,_0x10244f['options']);return db[_0x0fd6('0x37')][_0x0fd6('0x3a')](_0x5829d9)[_0x0fd6('0x16')](handleEntityNotFound(_0x5a1eba,null))['then'](function(_0x387e94){if(_0x387e94[_0x0fd6('0x3b')]===_0x0fd6('0x32')){var _0x10cd04=encryptor[_0x0fd6('0x33')](_0x387e94['data3']);_0x387e94[_0x0fd6('0x34')]=maskClientSecret(_0x10cd04);}return _0x387e94;})['then'](respondWithResult(_0x5a1eba,null))[_0x0fd6('0x35')](handleError(_0x5a1eba,null));};exports[_0x0fd6('0x3c')]=function(_0x18452d,_0x14a289){if(!_0x18452d[_0x0fd6('0x3d')][_0x0fd6('0x19')])throw new Error(_0x0fd6('0x3e'));if(!_0x18452d[_0x0fd6('0x3d')][_0x0fd6('0x3b')])throw new Error(_0x0fd6('0x3f'));var _0x674186=db[_0x0fd6('0x37')][_0x0fd6('0x1d')]['service']['values'];if(!_0x674186[_0x0fd6('0x40')](_0x18452d[_0x0fd6('0x3d')][_0x0fd6('0x3b')]))throw new Error(_0x0fd6('0x41')+_0x674186[_0x0fd6('0x42')](',\x20'));if(_0x18452d['body'][_0x0fd6('0x3b')]===_0x0fd6('0x32')&&_0x18452d[_0x0fd6('0x3d')][_0x0fd6('0x34')]){_0x18452d[_0x0fd6('0x3d')][_0x0fd6('0x34')]=encryptor[_0x0fd6('0x43')](_0x18452d['body'][_0x0fd6('0x34')]);}return db[_0x0fd6('0x37')][_0x0fd6('0x3c')](_0x18452d[_0x0fd6('0x3d')],{})[_0x0fd6('0x16')](respondWithResult(_0x14a289,0xc9))[_0x0fd6('0x35')](handleError(_0x14a289,null));};exports[_0x0fd6('0x15')]=function(_0x4990b,_0x1eda8a){if(_0x4990b[_0x0fd6('0x3d')]['id']){delete _0x4990b[_0x0fd6('0x3d')]['id'];}return db[_0x0fd6('0x37')][_0x0fd6('0x3a')]({'where':{'id':_0x4990b[_0x0fd6('0x44')]['id']}})[_0x0fd6('0x16')](handleEntityNotFound(_0x1eda8a,null))['then'](function(_0x469ca9){if(_0x469ca9[_0x0fd6('0x3b')]===_0x0fd6('0x32')&&_0x4990b[_0x0fd6('0x3d')][_0x0fd6('0x34')]){_0x4990b[_0x0fd6('0x3d')]['data3']=encryptor[_0x0fd6('0x43')](_0x4990b[_0x0fd6('0x3d')]['data3']);}return _0x469ca9;})[_0x0fd6('0x16')](saveUpdates(_0x4990b[_0x0fd6('0x3d')],null))[_0x0fd6('0x16')](respondWithResult(_0x1eda8a,null))['catch'](handleError(_0x1eda8a,null));};exports[_0x0fd6('0x17')]=function(_0x2465fb,_0x37702a){return db[_0x0fd6('0x37')][_0x0fd6('0x3a')]({'where':{'id':_0x2465fb[_0x0fd6('0x44')]['id']}})[_0x0fd6('0x16')](handleEntityNotFound(_0x37702a,null))[_0x0fd6('0x16')](removeEntity(_0x37702a,null))['catch'](handleError(_0x37702a,null));};exports['oauth2MicrosoftAuthorize']=function(_0x58583f,_0x3bbee7){return db[_0x0fd6('0x37')][_0x0fd6('0x45')]({'where':{'id':_0x58583f[_0x0fd6('0x44')]['id']},'raw':!![]})[_0x0fd6('0x16')](function(_0x20b75c){if(!_0x20b75c)return _0x3bbee7['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x20b75c,_0x58583f['user']['id'])};})[_0x0fd6('0x16')](respondWithResult(_0x3bbee7,null))[_0x0fd6('0x35')](handleError(_0x3bbee7,null));};exports[_0x0fd6('0x46')]=function(_0x59732a,_0x20c4aa){var _0x5e1540=_0x59732a[_0x0fd6('0x3d')];var _0x512d46;var _0x13d681;if(_0x5e1540[_0x0fd6('0x18')])throw _0x5e1540;redis[_0x0fd6('0x47')](_0x5e1540[_0x0fd6('0x48')])[_0x0fd6('0x16')](function(_0x129c48){if(!_0x129c48)throw new Error(_0x0fd6('0x49'));_0x512d46=JSON[_0x0fd6('0x4a')](_0x129c48);var _0x53d554=Buffer[_0x0fd6('0x4b')](_0x5e1540[_0x0fd6('0x48')],'base64')[_0x0fd6('0x4c')](_0x0fd6('0x4d'));_0x13d681=JSON[_0x0fd6('0x4a')](_0x53d554);if(!oauth['isValidIdToken'](_0x5e1540[_0x0fd6('0x4e')],_0x512d46[_0x0fd6('0x4f')]))throw new Error(_0x0fd6('0x50'));redis[_0x0fd6('0x51')](_0x5e1540[_0x0fd6('0x48')]);return oauth['getOauth2MicrosoftAccessToken'](_0x5e1540[_0x0fd6('0x52')],_0x512d46);})[_0x0fd6('0x16')](function(_0x2deb81){_0x512d46[_0x0fd6('0x53')]=_0x2deb81[_0x0fd6('0x54')];_0x512d46[_0x0fd6('0x55')]=_0x2deb81[_0x0fd6('0x56')];return db[_0x0fd6('0x37')][_0x0fd6('0x15')]({'data5':_0x512d46[_0x0fd6('0x53')],'data6':_0x512d46['data6']},{'where':{'id':_0x512d46['id']}});})[_0x0fd6('0x16')](function(){oauth['startRefreshInterval'](_0x512d46);socket[_0x0fd6('0x57')](_0x0fd6('0x58'),{'id':_0x13d681['id']});return;})[_0x0fd6('0x16')](respondWithStatusCode(_0x20c4aa,null))[_0x0fd6('0x35')](function(_0x379450){if(_0x13d681){socket[_0x0fd6('0x57')]('microsoftAuthorization:error',{'id':_0x13d681['id']});}if(!_0x512d46){logger['error'](_0x0fd6('0x59'),_0x379450);return _0x20c4aa['status'](0x1f4)[_0x0fd6('0x1a')](_0x379450[_0x0fd6('0x5a')]);}logger[_0x0fd6('0x18')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x512d46['id'],JSON[_0x0fd6('0x5b')](_0x379450));});};
\ No newline at end of file
+var _0x7cd3=['type','key','query','filters','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','include','findAll','service','data3','catch','show','params','keys','includeAll','find','decryptString','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','MicrosoftAzure','encryptString','create','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','get','state','Invalid\x20state\x20parameter','parse','base64','toString','ascii','id_token','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','redis','localhost','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','destroy','error','stack','name','send','padEnd','slice','map','CloudProvider','rawAttributes'];(function(_0x1d3046,_0x8b14e1){var _0x3b9b62=function(_0xb69d69){while(--_0xb69d69){_0x1d3046['push'](_0x1d3046['shift']());}};_0x3b9b62(++_0x8b14e1);}(_0x7cd3,0x156));var _0x37cd=function(_0x4c655b,_0x47f61e){_0x4c655b=_0x4c655b-0x0;var _0x52a131=_0x7cd3[_0x4c655b];return _0x52a131;};'use strict';var _=require(_0x37cd('0x0'));var Redis=require(_0x37cd('0x1'));var qs=require(_0x37cd('0x2'));var encryptor=require(_0x37cd('0x3'));var config=require(_0x37cd('0x4'));var logger=require(_0x37cd('0x5'))('api');var db=require(_0x37cd('0x6'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x37cd('0x7')]=_['defaults'](config[_0x37cd('0x7')],{'host':_0x37cd('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x37cd('0x7')]));var redis=new Redis(config[_0x37cd('0x7')]);function respondWithStatusCode(_0x1c585e,_0x3a0555){_0x3a0555=_0x3a0555||0xcc;return function(_0x1b7016){if(_0x1b7016){return _0x1c585e[_0x37cd('0x9')](_0x3a0555);}return _0x1c585e[_0x37cd('0xa')](_0x3a0555)[_0x37cd('0xb')]();};}function respondWithResult(_0x28c4aa,_0xc8cb99){_0xc8cb99=_0xc8cb99||0xc8;return function(_0x58a479){if(_0x58a479){return _0x28c4aa[_0x37cd('0xa')](_0xc8cb99)[_0x37cd('0xc')](_0x58a479);}};}function respondWithFilteredResult(_0x20ce4a,_0x376ec4){return function(_0x2a9523){if(_0x2a9523){var _0x5ab46f=typeof _0x376ec4[_0x37cd('0xd')]===_0x37cd('0xe')&&typeof _0x376ec4[_0x37cd('0xf')]===_0x37cd('0xe');var _0x4f7555=_0x2a9523[_0x37cd('0x10')];var _0x6352e6=_0x5ab46f?0x0:_0x376ec4['offset'];var _0x3e0acc=_0x5ab46f?_0x2a9523[_0x37cd('0x10')]:_0x376ec4[_0x37cd('0xd')]+_0x376ec4[_0x37cd('0xf')];var _0x5efcc1;if(_0x3e0acc>=_0x4f7555){_0x3e0acc=_0x4f7555;_0x5efcc1=0xc8;}else{_0x5efcc1=0xce;}_0x20ce4a[_0x37cd('0xa')](_0x5efcc1);return _0x20ce4a[_0x37cd('0x11')]('Content-Range',_0x6352e6+'-'+_0x3e0acc+'/'+_0x4f7555)[_0x37cd('0xc')](_0x2a9523);}return null;};}function saveUpdates(_0x34501f){return function(_0x199dc8){if(_0x199dc8){return _0x199dc8[_0x37cd('0x12')](_0x34501f)[_0x37cd('0x13')](function(_0x17897d){return _0x17897d;});}return null;};}function removeEntity(_0xfddbcd){return function(_0x243f56){if(_0x243f56){return _0x243f56[_0x37cd('0x14')]()[_0x37cd('0x13')](function(){_0xfddbcd['status'](0xcc)[_0x37cd('0xb')]();});}};}function handleEntityNotFound(_0x1d472a){return function(_0x8e932f){if(!_0x8e932f){_0x1d472a[_0x37cd('0x9')](0x194);}return _0x8e932f;};}function handleError(_0x4118bc,_0x2f4a10){_0x2f4a10=_0x2f4a10||0x1f4;return function(_0x4af0ea){logger[_0x37cd('0x15')](_0x4af0ea[_0x37cd('0x16')]);if(_0x4af0ea[_0x37cd('0x17')]){delete _0x4af0ea[_0x37cd('0x17')];}_0x4118bc['status'](_0x2f4a10)[_0x37cd('0x18')](_0x4af0ea);};}function maskClientSecret(_0x111495){return _[_0x37cd('0x19')](_0x111495[_0x37cd('0x1a')](0x0,0x3),0x14,'*');}exports['index']=function(_0x1d1ace,_0x53c998){var _0x2866e1={},_0x2661dd={},_0xaed9a3={'count':0x0,'rows':[]};var _0x4d9256=_[_0x37cd('0x1b')](db[_0x37cd('0x1c')][_0x37cd('0x1d')],function(_0x4a48f4){return{'name':_0x4a48f4['fieldName'],'type':_0x4a48f4[_0x37cd('0x1e')][_0x37cd('0x1f')]};});_0x2661dd['model']=_['map'](_0x4d9256,_0x37cd('0x17'));_0x2661dd[_0x37cd('0x20')]=_['keys'](_0x1d1ace[_0x37cd('0x20')]);_0x2661dd[_0x37cd('0x21')]=_['intersection'](_0x2661dd[_0x37cd('0x22')],_0x2661dd[_0x37cd('0x20')]);_0x2866e1[_0x37cd('0x23')]=_['intersection'](_0x2661dd[_0x37cd('0x22')],qs[_0x37cd('0x24')](_0x1d1ace[_0x37cd('0x20')][_0x37cd('0x24')]));_0x2866e1[_0x37cd('0x23')]=_0x2866e1['attributes'][_0x37cd('0x25')]?_0x2866e1[_0x37cd('0x23')]:_0x2661dd['model'];if(!_0x1d1ace[_0x37cd('0x20')][_0x37cd('0x26')]('nolimit')){_0x2866e1['limit']=qs[_0x37cd('0xf')](_0x1d1ace[_0x37cd('0x20')][_0x37cd('0xf')]);_0x2866e1['offset']=qs[_0x37cd('0xd')](_0x1d1ace[_0x37cd('0x20')][_0x37cd('0xd')]);}_0x2866e1[_0x37cd('0x27')]=qs[_0x37cd('0x28')](_0x1d1ace['query']['sort']);_0x2866e1[_0x37cd('0x29')]=qs[_0x37cd('0x21')](_[_0x37cd('0x2a')](_0x1d1ace[_0x37cd('0x20')],_0x2661dd[_0x37cd('0x21')]),_0x4d9256);if(_0x1d1ace['query']['filter']){_0x2866e1['where']=_[_0x37cd('0x2b')](_0x2866e1[_0x37cd('0x29')],{'$or':_['map'](_0x4d9256,function(_0xdd1d73){if(_0xdd1d73['type']!=='VIRTUAL'){var _0x178f90={};_0x178f90[_0xdd1d73[_0x37cd('0x17')]]={'$like':'%'+_0x1d1ace[_0x37cd('0x20')][_0x37cd('0x2c')]+'%'};return _0x178f90;}})});}_0x2866e1=_[_0x37cd('0x2b')]({},_0x2866e1,_0x1d1ace[_0x37cd('0x2d')]);var _0x4ec47d={'where':_0x2866e1[_0x37cd('0x29')]};return db[_0x37cd('0x1c')][_0x37cd('0x10')](_0x4ec47d)[_0x37cd('0x13')](function(_0x265b86){_0xaed9a3[_0x37cd('0x10')]=_0x265b86;if(_0x1d1ace[_0x37cd('0x20')]['includeAll']){_0x2866e1[_0x37cd('0x2e')]=[{'all':!![]}];}return db[_0x37cd('0x1c')][_0x37cd('0x2f')](_0x2866e1);})['then'](function(_0x37dbf1){_0xaed9a3['rows']=_[_0x37cd('0x1b')](_0x37dbf1,function(_0x2e98c4){if(_0x2e98c4[_0x37cd('0x30')]==='MicrosoftAzure'){var _0x43e5b1=encryptor['decryptString'](_0x2e98c4['data3']);_0x2e98c4[_0x37cd('0x31')]=maskClientSecret(_0x43e5b1);}return _0x2e98c4;});return _0xaed9a3;})[_0x37cd('0x13')](respondWithFilteredResult(_0x53c998,_0x2866e1))[_0x37cd('0x32')](handleError(_0x53c998,null));};exports[_0x37cd('0x33')]=function(_0xdc33e8,_0x1b6a2a){var _0x119d21={'raw':!![],'where':{'id':_0xdc33e8[_0x37cd('0x34')]['id']}},_0x216a79={};_0x216a79[_0x37cd('0x22')]=_['keys'](db[_0x37cd('0x1c')][_0x37cd('0x1d')]);_0x216a79['query']=_[_0x37cd('0x35')](_0xdc33e8[_0x37cd('0x20')]);_0x216a79[_0x37cd('0x21')]=_['intersection'](_0x216a79[_0x37cd('0x22')],_0x216a79['query']);_0x119d21['attributes']=_['intersection'](_0x216a79[_0x37cd('0x22')],qs[_0x37cd('0x24')](_0xdc33e8[_0x37cd('0x20')][_0x37cd('0x24')]));_0x119d21[_0x37cd('0x23')]=_0x119d21['attributes']['length']?_0x119d21['attributes']:_0x216a79[_0x37cd('0x22')];if(_0xdc33e8['query'][_0x37cd('0x36')]){_0x119d21[_0x37cd('0x2e')]=[{'all':!![]}];}_0x119d21=_[_0x37cd('0x2b')]({},_0x119d21,_0xdc33e8[_0x37cd('0x2d')]);return db['CloudProvider'][_0x37cd('0x37')](_0x119d21)['then'](handleEntityNotFound(_0x1b6a2a,null))[_0x37cd('0x13')](function(_0x2ae6b4){if(_0x2ae6b4[_0x37cd('0x30')]==='MicrosoftAzure'){var _0x302c80=encryptor[_0x37cd('0x38')](_0x2ae6b4[_0x37cd('0x31')]);_0x2ae6b4[_0x37cd('0x31')]=maskClientSecret(_0x302c80);}return _0x2ae6b4;})[_0x37cd('0x13')](respondWithResult(_0x1b6a2a,null))[_0x37cd('0x32')](handleError(_0x1b6a2a,null));};exports['create']=function(_0x6850c,_0x2fd543){if(!_0x6850c[_0x37cd('0x39')]['name'])throw new Error(_0x37cd('0x3a'));if(!_0x6850c[_0x37cd('0x39')][_0x37cd('0x30')])throw new Error(_0x37cd('0x3b'));var _0x3d30a8=db['CloudProvider'][_0x37cd('0x1d')]['service'][_0x37cd('0x3c')];if(!_0x3d30a8[_0x37cd('0x3d')](_0x6850c['body']['service']))throw new Error(_0x37cd('0x3e')+_0x3d30a8[_0x37cd('0x3f')](',\x20'));if(_0x6850c['body'][_0x37cd('0x30')]===_0x37cd('0x40')&&_0x6850c[_0x37cd('0x39')][_0x37cd('0x31')]){_0x6850c[_0x37cd('0x39')][_0x37cd('0x31')]=encryptor[_0x37cd('0x41')](_0x6850c[_0x37cd('0x39')][_0x37cd('0x31')]);}return db[_0x37cd('0x1c')][_0x37cd('0x42')](_0x6850c[_0x37cd('0x39')],{})['then'](respondWithResult(_0x2fd543,0xc9))[_0x37cd('0x32')](handleError(_0x2fd543,null));};exports['update']=function(_0x560c17,_0x3f8ad0){if(_0x560c17[_0x37cd('0x39')]['id']){delete _0x560c17['body']['id'];}return db['CloudProvider'][_0x37cd('0x37')]({'where':{'id':_0x560c17[_0x37cd('0x34')]['id']}})[_0x37cd('0x13')](handleEntityNotFound(_0x3f8ad0,null))['then'](function(_0x51ac2c){if(_0x51ac2c[_0x37cd('0x30')]==='MicrosoftAzure'&&_0x560c17[_0x37cd('0x39')][_0x37cd('0x31')]){_0x560c17[_0x37cd('0x39')][_0x37cd('0x31')]=encryptor[_0x37cd('0x41')](_0x560c17[_0x37cd('0x39')][_0x37cd('0x31')]);}return _0x51ac2c;})['then'](saveUpdates(_0x560c17['body'],null))['then'](respondWithResult(_0x3f8ad0,null))[_0x37cd('0x32')](handleError(_0x3f8ad0,null));};exports[_0x37cd('0x14')]=function(_0x593998,_0x379c3f){return db[_0x37cd('0x1c')]['find']({'where':{'id':_0x593998[_0x37cd('0x34')]['id']}})[_0x37cd('0x13')](handleEntityNotFound(_0x379c3f,null))['then'](removeEntity(_0x379c3f,null))[_0x37cd('0x32')](handleError(_0x379c3f,null));};exports[_0x37cd('0x43')]=function(_0x675ec,_0x2d8e7c){return db[_0x37cd('0x1c')][_0x37cd('0x44')]({'where':{'id':_0x675ec[_0x37cd('0x34')]['id']},'raw':!![]})[_0x37cd('0x13')](function(_0x21fe35){if(!_0x21fe35)return _0x2d8e7c[_0x37cd('0x9')](0x194);return{'url':oauth[_0x37cd('0x45')](_0x21fe35,_0x675ec[_0x37cd('0x46')]['id'])};})['then'](respondWithResult(_0x2d8e7c,null))['catch'](handleError(_0x2d8e7c,null));};exports['oauth2MicrosoftCallback']=function(_0x215fce,_0x1eedcc){var _0x463120=_0x215fce[_0x37cd('0x39')];var _0x411ea8;var _0x577868;if(_0x463120[_0x37cd('0x15')])throw _0x463120;redis[_0x37cd('0x47')](_0x463120[_0x37cd('0x48')])['then'](function(_0x7ad407){if(!_0x7ad407)throw new Error(_0x37cd('0x49'));_0x411ea8=JSON[_0x37cd('0x4a')](_0x7ad407);var _0x307281=Buffer['from'](_0x463120[_0x37cd('0x48')],_0x37cd('0x4b'))[_0x37cd('0x4c')](_0x37cd('0x4d'));_0x577868=JSON['parse'](_0x307281);if(!oauth['isValidIdToken'](_0x463120[_0x37cd('0x4e')],_0x411ea8['oauth2Claims']))throw new Error(_0x37cd('0x4f'));redis['del'](_0x463120['state']);return oauth[_0x37cd('0x50')](_0x463120[_0x37cd('0x51')],_0x411ea8);})[_0x37cd('0x13')](function(_0x58697f){_0x411ea8[_0x37cd('0x52')]=_0x58697f[_0x37cd('0x53')];_0x411ea8[_0x37cd('0x54')]=_0x58697f[_0x37cd('0x55')];return db[_0x37cd('0x1c')]['update']({'data5':_0x411ea8[_0x37cd('0x52')],'data6':_0x411ea8[_0x37cd('0x54')]},{'where':{'id':_0x411ea8['id']}});})['then'](function(){oauth[_0x37cd('0x56')](_0x411ea8);socket['emit'](_0x37cd('0x57'),{'id':_0x577868['id']});return;})[_0x37cd('0x13')](respondWithStatusCode(_0x1eedcc,null))[_0x37cd('0x32')](function(_0x28dc24){if(_0x577868){socket['emit'](_0x37cd('0x58'),{'id':_0x577868['id']});}if(!_0x411ea8){logger[_0x37cd('0x15')](_0x37cd('0x59'),_0x28dc24);return _0x1eedcc[_0x37cd('0xa')](0x1f4)['send'](_0x28dc24[_0x37cd('0x5a')]);}logger[_0x37cd('0x15')](_0x37cd('0x5b'),_0x411ea8['id'],JSON[_0x37cd('0x5c')](_0x28dc24));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 2356e37..ad56f36 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 _0x6c87=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','util'];(function(_0x9333e2,_0x533acc){var _0xa4a57a=function(_0x27ca38){while(--_0x27ca38){_0x9333e2['push'](_0x9333e2['shift']());}};_0xa4a57a(++_0x533acc);}(_0x6c87,0xdb));var _0x76c8=function(_0x572bbe,_0x3da3b2){_0x572bbe=_0x572bbe-0x0;var _0x6b4827=_0x6c87[_0x572bbe];return _0x6b4827;};'use strict';var _=require('lodash');var util=require(_0x76c8('0x0'));var logger=require(_0x76c8('0x1'))('api');var moment=require(_0x76c8('0x2'));var BPromise=require(_0x76c8('0x3'));var rp=require(_0x76c8('0x4'));var fs=require('fs');var path=require(_0x76c8('0x5'));var rimraf=require('rimraf');var config=require(_0x76c8('0x6'));var attributes=require(_0x76c8('0x7'));module[_0x76c8('0x8')]=function(_0x3116ed,_0x522e9c){return _0x3116ed[_0x76c8('0x9')](_0x76c8('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9511=['api','moment','bluebird','request-promise','path','rimraf','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util'];(function(_0x47c5bf,_0x45977e){var _0x11b779=function(_0x1bd585){while(--_0x1bd585){_0x47c5bf['push'](_0x47c5bf['shift']());}};_0x11b779(++_0x45977e);}(_0x9511,0x1df));var _0x1951=function(_0x7bc4a8,_0x19022a){_0x7bc4a8=_0x7bc4a8-0x0;var _0x4a13e9=_0x9511[_0x7bc4a8];return _0x4a13e9;};'use strict';var _=require(_0x1951('0x0'));var util=require(_0x1951('0x1'));var logger=require('../../config/logger')(_0x1951('0x2'));var moment=require(_0x1951('0x3'));var BPromise=require(_0x1951('0x4'));var rp=require(_0x1951('0x5'));var fs=require('fs');var path=require(_0x1951('0x6'));var rimraf=require(_0x1951('0x7'));var config=require('../../config/environment');var attributes=require(_0x1951('0x8'));module[_0x1951('0x9')]=function(_0x96c7b2,_0x10effc){return _0x96c7b2[_0x1951('0xa')](_0x1951('0xb'),attributes,{'tableName':_0x1951('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 36bbe29..272e5c3 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x29db=['email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','data7','/.default','Outlook365','replace','{TENANT_ID}','data2','from','toString','base64','hex','client_id','data1','response_type','join','redirect_uri','data4','form_post','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','set','payload','iss','issuer','aud','audience','isAfter','unix','exp','then','data3','findOne','refresh_token','data6','decryptString','POST','access_token','CloudProvider','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','request-promise','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','defaults','redis','localhost','profile'];(function(_0x46cad4,_0x2002aa){var _0x2468c6=function(_0x57f73a){while(--_0x57f73a){_0x46cad4['push'](_0x46cad4['shift']());}};_0x2468c6(++_0x2002aa);}(_0x29db,0x8d));var _0xb29d=function(_0x843b07,_0x155d72){_0x843b07=_0x843b07-0x0;var _0x3ed748=_0x29db[_0x843b07];return _0x3ed748;};'use strict';var _=require(_0xb29d('0x0'));var crypto=require('crypto');var jwt=require(_0xb29d('0x1'));var moment=require(_0xb29d('0x2'));var Redis=require('ioredis');var rp=require(_0xb29d('0x3'));var util=require('util');var encryptor=require(_0xb29d('0x4'));var config=require(_0xb29d('0x5'));var logger=require(_0xb29d('0x6'))(_0xb29d('0x7'));var schedule=require(_0xb29d('0x8'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xb29d('0x9')](config[_0xb29d('0xa')],{'host':_0xb29d('0xb'),'port':0x18eb});var redis=new Redis(config[_0xb29d('0xa')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xb29d('0xc'),_0xb29d('0xd'),_0xb29d('0xe'),_0xb29d('0xf'),_0xb29d('0x10'),_0xb29d('0x11')],'Dynamics365':['openid',_0xb29d('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0xb29d('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xb29d('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5c3e8f){var _0x2b9349=_[_0xb29d('0x14')](AZURE_AUTH_SCOPES[_0x5c3e8f[_0xb29d('0x15')]]);if(_0x5c3e8f[_0xb29d('0x15')]===_0xb29d('0x16'))_0x2b9349['push'](_0x5c3e8f[_0xb29d('0x17')]+_0xb29d('0x18'));return _0x2b9349['join']('\x20');}function getAccessTokenScope(_0x2b4f49){if(_0x2b4f49[_0xb29d('0x15')]===_0xb29d('0x19'))return _0xb29d('0xf');if(_0x2b4f49[_0xb29d('0x15')]==='Dynamics365')return _0x2b4f49['data7']+_0xb29d('0x18');}function generateMicrosoftAuthorizationUrl(_0x202318,_0x374394){var _0x29de33=MICROSOFT_AUTH_URL[_0xb29d('0x1a')](_0xb29d('0x1b'),_0x202318[_0xb29d('0x1c')]);var _0x5217e7=['code','id_token'];var _0x36673e=Buffer[_0xb29d('0x1d')](JSON['stringify']({'id':_0x374394}))[_0xb29d('0x1e')](_0xb29d('0x1f'));var _0xee9d5a=crypto['randomBytes'](0x10)[_0xb29d('0x1e')](_0xb29d('0x20'));var _0x5817cc=getAuthorizationScopes(_0x202318);var _0x343ccd=[{'key':_0xb29d('0x21'),'value':_0x202318[_0xb29d('0x22')]},{'key':_0xb29d('0x23'),'value':encodeURIComponent(_0x5217e7[_0xb29d('0x24')]('\x20'))},{'key':_0xb29d('0x25'),'value':_0x202318[_0xb29d('0x26')]},{'key':'response_mode','value':_0xb29d('0x27')},{'key':'scope','value':encodeURIComponent(_0x5817cc)},{'key':_0xb29d('0x28'),'value':_0x36673e},{'key':_0xb29d('0x29'),'value':_0xee9d5a},{'key':_0xb29d('0x2a'),'value':_0xb29d('0x2b')}];var _0x4fbde8=_0x29de33+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xb29d('0x14')](_0x343ccd,function(_0x2dc158){return _0x2dc158[_0xb29d('0x2c')]+'='+_0x2dc158[_0xb29d('0x2d')];})[_0xb29d('0x24')]('&');_0x202318[_0xb29d('0x2e')]={'issuer':_0x29de33['replace'](_0xb29d('0x2f'),''),'audience':_0x202318['data1'],'state':_0x36673e,'nonce':_0xee9d5a};redis[_0xb29d('0x30')](_0x36673e,JSON['stringify'](_0x202318));return _0x4fbde8;}function isValidIdToken(_0x497441,_0x2be86a){try{var _0x52b105=jwt['decode'](_0x497441,{'complete':!![]});var _0x4ef3f4=_0x52b105[_0xb29d('0x31')];if(_0x4ef3f4[_0xb29d('0x32')]!==_0x2be86a[_0xb29d('0x33')])return![];if(_0x4ef3f4[_0xb29d('0x34')]!==_0x2be86a[_0xb29d('0x35')])return![];if(_0x4ef3f4['nonce']!==_0x2be86a[_0xb29d('0x29')])return![];if(moment()[_0xb29d('0x36')](moment[_0xb29d('0x37')](_0x4ef3f4[_0xb29d('0x38')])))return![];return!![];}catch(_0x9d2b6d){throw _0x9d2b6d;}}function refreshOauth2MicrosoftAccessToken(_0x383a16){return Promise['resolve']()[_0xb29d('0x39')](function(){if(_0x383a16[_0xb29d('0x3a')])return _0x383a16;return db['CloudProvider'][_0xb29d('0x3b')]({'where':{'id':_0x383a16['id']},'raw':!![]});})[_0xb29d('0x39')](function(_0xed6083){var _0x2fb545={'grant_type':_0xb29d('0x3c'),'refresh_token':_0xed6083[_0xb29d('0x3d')],'scope':getAccessTokenScope(_0xed6083),'redirect_uri':_0xed6083[_0xb29d('0x26')],'client_id':_0xed6083[_0xb29d('0x22')],'client_secret':encryptor[_0xb29d('0x3e')](_0xed6083[_0xb29d('0x3a')])};var _0x4444da={'method':_0xb29d('0x3f'),'uri':MICROSOFT_AUTH_URL[_0xb29d('0x1a')](_0xb29d('0x1b'),_0xed6083[_0xb29d('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2fb545,'json':!![]};return rp(_0x4444da);})['then'](function(_0x4ab342){_0x383a16['data5']=_0x4ab342[_0xb29d('0x40')];_0x383a16[_0xb29d('0x3d')]=_0x4ab342[_0xb29d('0x3c')];return db[_0xb29d('0x41')]['update']({'data5':_0x383a16[_0xb29d('0x42')],'data6':_0x383a16[_0xb29d('0x3d')]},{'where':{'id':_0x383a16['id']}});})[_0xb29d('0x39')](function(){return _0x383a16;})[_0xb29d('0x43')](function(_0x49d478){logger[_0xb29d('0x44')](_0xb29d('0x45'),_0x383a16['id'],_0x49d478);});}function getOauth2MicrosoftAccessToken(_0x46194c,_0x41872d){var _0x5ee4c8={'grant_type':_0xb29d('0x46'),'code':_0x46194c,'scope':getAccessTokenScope(_0x41872d),'redirect_uri':_0x41872d[_0xb29d('0x26')],'client_id':_0x41872d[_0xb29d('0x22')],'client_secret':encryptor['decryptString'](_0x41872d[_0xb29d('0x3a')])};var _0x2a6bc2={'method':_0xb29d('0x3f'),'uri':MICROSOFT_AUTH_URL['replace'](_0xb29d('0x1b'),_0x41872d['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5ee4c8,'json':!![]};return rp(_0x2a6bc2);}function startRefreshInterval(_0x1fe968){var _0x3c0e04=schedule[_0xb29d('0x47')];if(_0x3c0e04[_0x1fe968['id']])clearInterval(_0x3c0e04[_0x1fe968['id']]);_0x3c0e04[_0x1fe968['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x1fe968['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xb29d('0x47')]=_0x3c0e04;}function startAllRefreshIntervals(){return db[_0xb29d('0x41')][_0xb29d('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xb29d('0x39')](function(_0x40ac5d){var _0x59affc=_0x40ac5d['map'](function(_0x3b7384){return refreshOauth2MicrosoftAccessToken(_0x3b7384)[_0xb29d('0x39')](function(_0x18cae6){startRefreshInterval(_0x18cae6);});});return Promise[_0xb29d('0x49')](_0x59affc);})[_0xb29d('0x43')](function(_0x10afdf){var _0x21b422=_0x10afdf?util[_0xb29d('0x4a')](_0x10afdf,{'showHidden':![],'depth':null}):'';logger[_0xb29d('0x44')](_0xb29d('0x4b'),_0x21b422);});}module[_0xb29d('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x26bd=['data6','decryptString','POST','data2','data5','access_token','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','offline_access','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','{TENANT_ID}','code','id_token','stringify','base64','toString','hex','client_id','data1','redirect_uri','data4','response_mode','form_post','state','prompt','key','oauth2Claims','replace','set','decode','iss','issuer','aud','audience','nonce','then','data3','CloudProvider','findOne','refresh_token'];(function(_0x226d27,_0x7229f){var _0xae723c=function(_0x209946){while(--_0x209946){_0x226d27['push'](_0x226d27['shift']());}};_0xae723c(++_0x7229f);}(_0x26bd,0x1d2));var _0xd26b=function(_0x742f13,_0x1344d8){_0x742f13=_0x742f13-0x0;var _0x236415=_0x26bd[_0x742f13];return _0x236415;};'use strict';var _=require(_0xd26b('0x0'));var crypto=require(_0xd26b('0x1'));var jwt=require(_0xd26b('0x2'));var moment=require(_0xd26b('0x3'));var Redis=require(_0xd26b('0x4'));var rp=require(_0xd26b('0x5'));var util=require(_0xd26b('0x6'));var encryptor=require(_0xd26b('0x7'));var config=require('../../config/environment');var logger=require('../../config/logger')('api');var schedule=require('../../config/schedule/cloud-provider');var db=require(_0xd26b('0x8'))['db'];config[_0xd26b('0x9')]=_[_0xd26b('0xa')](config['redis'],{'host':_0xd26b('0xb'),'port':0x18eb});var redis=new Redis(config[_0xd26b('0x9')]);var MICROSOFT_AUTH_URL=_0xd26b('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xd26b('0xd'),_0xd26b('0xe'),_0xd26b('0xf'),'offline_access',_0xd26b('0x10'),_0xd26b('0x11'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xd26b('0xd'),_0xd26b('0x12')]};var MICROSOFT_AUTH_ENDPOINT=_0xd26b('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xd26b('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x484642){var _0x2e2f76=_[_0xd26b('0x15')](AZURE_AUTH_SCOPES[_0x484642[_0xd26b('0x16')]]);if(_0x484642[_0xd26b('0x16')]===_0xd26b('0x17'))_0x2e2f76[_0xd26b('0x18')](_0x484642[_0xd26b('0x19')]+_0xd26b('0x1a'));return _0x2e2f76[_0xd26b('0x1b')]('\x20');}function getAccessTokenScope(_0x28b3a1){if(_0x28b3a1[_0xd26b('0x16')]===_0xd26b('0x1c'))return _0xd26b('0x10');if(_0x28b3a1[_0xd26b('0x16')]===_0xd26b('0x17'))return _0x28b3a1[_0xd26b('0x19')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x51b6c4,_0x4dc42a){var _0x576f6f=MICROSOFT_AUTH_URL['replace'](_0xd26b('0x1d'),_0x51b6c4['data2']);var _0x332581=[_0xd26b('0x1e'),_0xd26b('0x1f')];var _0x588e3a=Buffer['from'](JSON[_0xd26b('0x20')]({'id':_0x4dc42a}))['toString'](_0xd26b('0x21'));var _0x1b20ff=crypto['randomBytes'](0x10)[_0xd26b('0x22')](_0xd26b('0x23'));var _0x1599a6=getAuthorizationScopes(_0x51b6c4);var _0x9095c9=[{'key':_0xd26b('0x24'),'value':_0x51b6c4[_0xd26b('0x25')]},{'key':'response_type','value':encodeURIComponent(_0x332581[_0xd26b('0x1b')]('\x20'))},{'key':_0xd26b('0x26'),'value':_0x51b6c4[_0xd26b('0x27')]},{'key':_0xd26b('0x28'),'value':_0xd26b('0x29')},{'key':'scope','value':encodeURIComponent(_0x1599a6)},{'key':_0xd26b('0x2a'),'value':_0x588e3a},{'key':'nonce','value':_0x1b20ff},{'key':_0xd26b('0x2b'),'value':'login'}];var _0xb8c7b2=_0x576f6f+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xd26b('0x15')](_0x9095c9,function(_0x84590f){return _0x84590f[_0xd26b('0x2c')]+'='+_0x84590f['value'];})['join']('&');_0x51b6c4[_0xd26b('0x2d')]={'issuer':_0x576f6f[_0xd26b('0x2e')]('oauth2/',''),'audience':_0x51b6c4[_0xd26b('0x25')],'state':_0x588e3a,'nonce':_0x1b20ff};redis[_0xd26b('0x2f')](_0x588e3a,JSON[_0xd26b('0x20')](_0x51b6c4));return _0xb8c7b2;}function isValidIdToken(_0x1ec083,_0x1b6f01){try{var _0x2a1da0=jwt[_0xd26b('0x30')](_0x1ec083,{'complete':!![]});var _0x446700=_0x2a1da0['payload'];if(_0x446700[_0xd26b('0x31')]!==_0x1b6f01[_0xd26b('0x32')])return![];if(_0x446700[_0xd26b('0x33')]!==_0x1b6f01[_0xd26b('0x34')])return![];if(_0x446700[_0xd26b('0x35')]!==_0x1b6f01[_0xd26b('0x35')])return![];if(moment()['isAfter'](moment['unix'](_0x446700['exp'])))return![];return!![];}catch(_0x3f5a73){throw _0x3f5a73;}}function refreshOauth2MicrosoftAccessToken(_0x4d968b){return Promise['resolve']()[_0xd26b('0x36')](function(){if(_0x4d968b[_0xd26b('0x37')])return _0x4d968b;return db[_0xd26b('0x38')][_0xd26b('0x39')]({'where':{'id':_0x4d968b['id']},'raw':!![]});})[_0xd26b('0x36')](function(_0x4bde23){var _0x51d767={'grant_type':_0xd26b('0x3a'),'refresh_token':_0x4bde23[_0xd26b('0x3b')],'scope':getAccessTokenScope(_0x4bde23),'redirect_uri':_0x4bde23['data4'],'client_id':_0x4bde23[_0xd26b('0x25')],'client_secret':encryptor[_0xd26b('0x3c')](_0x4bde23[_0xd26b('0x37')])};var _0x3a435e={'method':_0xd26b('0x3d'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x4bde23[_0xd26b('0x3e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x51d767,'json':!![]};return rp(_0x3a435e);})[_0xd26b('0x36')](function(_0x37a272){_0x4d968b[_0xd26b('0x3f')]=_0x37a272[_0xd26b('0x40')];_0x4d968b[_0xd26b('0x3b')]=_0x37a272['refresh_token'];return db['CloudProvider']['update']({'data5':_0x4d968b['data5'],'data6':_0x4d968b[_0xd26b('0x3b')]},{'where':{'id':_0x4d968b['id']}});})[_0xd26b('0x36')](function(){return _0x4d968b;})[_0xd26b('0x41')](function(_0x4108c3){logger[_0xd26b('0x42')](_0xd26b('0x43'),_0x4d968b['id'],_0x4108c3);});}function getOauth2MicrosoftAccessToken(_0x176974,_0x500803){var _0x35e224={'grant_type':_0xd26b('0x44'),'code':_0x176974,'scope':getAccessTokenScope(_0x500803),'redirect_uri':_0x500803[_0xd26b('0x27')],'client_id':_0x500803[_0xd26b('0x25')],'client_secret':encryptor[_0xd26b('0x3c')](_0x500803['data3'])};var _0x1db87c={'method':_0xd26b('0x3d'),'uri':MICROSOFT_AUTH_URL[_0xd26b('0x2e')](_0xd26b('0x1d'),_0x500803['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x35e224,'json':!![]};return rp(_0x1db87c);}function startRefreshInterval(_0xc79b80){var _0x38f38b=schedule[_0xd26b('0x45')];if(_0x38f38b[_0xc79b80['id']])clearInterval(_0x38f38b[_0xc79b80['id']]);_0x38f38b[_0xc79b80['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0xc79b80['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x38f38b;}function startAllRefreshIntervals(){return db[_0xd26b('0x38')][_0xd26b('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x34366c){var _0x210295=_0x34366c[_0xd26b('0x15')](function(_0x4f6f5d){return refreshOauth2MicrosoftAccessToken(_0x4f6f5d)['then'](function(_0x4c845a){startRefreshInterval(_0x4c845a);});});return Promise[_0xd26b('0x47')](_0x210295);})[_0xd26b('0x41')](function(_0x5effc7){var _0x3534de=_0x5effc7?util[_0xd26b('0x48')](_0x5effc7,{'showHidden':![],'depth':null}):'';logger[_0xd26b('0x42')](_0xd26b('0x49'),_0x3534de);});}module[_0xd26b('0x4a')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index fc3245c..2e557be 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 _0x36fe=['info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\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','client','then'];(function(_0x344f0b,_0x82aaa2){var _0x483ed5=function(_0x586f8a){while(--_0x586f8a){_0x344f0b['push'](_0x344f0b['shift']());}};_0x483ed5(++_0x82aaa2);}(_0x36fe,0x127));var _0xe36f=function(_0xee1ec9,_0x2f0599){_0xee1ec9=_0xee1ec9-0x0;var _0x102a53=_0x36fe[_0xee1ec9];return _0x102a53;};'use strict';var _=require(_0xe36f('0x0'));var util=require(_0xe36f('0x1'));var moment=require(_0xe36f('0x2'));var BPromise=require(_0xe36f('0x3'));var rs=require(_0xe36f('0x4'));var fs=require('fs');var Redis=require(_0xe36f('0x5'));var db=require(_0xe36f('0x6'))['db'];var utils=require(_0xe36f('0x7'));var logger=require(_0xe36f('0x8'))(_0xe36f('0x9'));var config=require(_0xe36f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xe36f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x349c9e,_0xdae131,_0x5a0d3c){return new BPromise(function(_0x1ecd6b,_0x21f2a5){return client['request'](_0x349c9e,_0x5a0d3c)[_0xe36f('0xc')](function(_0x386c00){logger[_0xe36f('0xd')](_0xe36f('0xe'),_0xdae131,_0xe36f('0xf'));logger['debug'](_0xe36f('0x10'),_0xdae131,'request\x20sent',JSON[_0xe36f('0x11')](_0x386c00));if(_0x386c00[_0xe36f('0x12')]){if(_0x386c00[_0xe36f('0x12')]['code']===0x1f4){logger[_0xe36f('0x12')](_0xe36f('0xe'),_0xdae131,_0x386c00['error'][_0xe36f('0x13')]);return _0x21f2a5(_0x386c00[_0xe36f('0x12')][_0xe36f('0x13')]);}logger[_0xe36f('0x12')]('CloudProvider,\x20%s,\x20%s',_0xdae131,_0x386c00[_0xe36f('0x12')][_0xe36f('0x13')]);return _0x1ecd6b(_0x386c00[_0xe36f('0x12')]['message']);}else{logger[_0xe36f('0xd')](_0xe36f('0xe'),_0xdae131,'request\x20sent');_0x1ecd6b(_0x386c00[_0xe36f('0x14')][_0xe36f('0x13')]);}})[_0xe36f('0x15')](function(_0x3f8f9f){logger[_0xe36f('0x12')](_0xe36f('0xe'),_0xdae131,_0x3f8f9f);_0x21f2a5(_0x3f8f9f);});});}
\ No newline at end of file
+var _0x58c9=['client','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x10b30,_0x5f4b99){var _0x1f19f9=function(_0x5aff95){while(--_0x5aff95){_0x10b30['push'](_0x10b30['shift']());}};_0x1f19f9(++_0x5f4b99);}(_0x58c9,0x1bc));var _0x958c=function(_0x57b67e,_0xc5f902){_0x57b67e=_0x57b67e-0x0;var _0x36cc1b=_0x58c9[_0x57b67e];return _0x36cc1b;};'use strict';var _=require(_0x958c('0x0'));var util=require(_0x958c('0x1'));var moment=require(_0x958c('0x2'));var BPromise=require(_0x958c('0x3'));var rs=require(_0x958c('0x4'));var fs=require('fs');var Redis=require(_0x958c('0x5'));var db=require(_0x958c('0x6'))['db'];var utils=require(_0x958c('0x7'));var logger=require(_0x958c('0x8'))(_0x958c('0x9'));var config=require(_0x958c('0xa'));var jayson=require(_0x958c('0xb'));var client=jayson[_0x958c('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x158388,_0xa44c9,_0xf10ad3){return new BPromise(function(_0x2e37a6,_0x31e668){return client[_0x958c('0xd')](_0x158388,_0xf10ad3)[_0x958c('0xe')](function(_0x128ef6){logger[_0x958c('0xf')](_0x958c('0x10'),_0xa44c9,_0x958c('0x11'));logger['debug'](_0x958c('0x12'),_0xa44c9,_0x958c('0x11'),JSON[_0x958c('0x13')](_0x128ef6));if(_0x128ef6[_0x958c('0x14')]){if(_0x128ef6[_0x958c('0x14')][_0x958c('0x15')]===0x1f4){logger[_0x958c('0x14')]('CloudProvider,\x20%s,\x20%s',_0xa44c9,_0x128ef6[_0x958c('0x14')][_0x958c('0x16')]);return _0x31e668(_0x128ef6['error'][_0x958c('0x16')]);}logger[_0x958c('0x14')]('CloudProvider,\x20%s,\x20%s',_0xa44c9,_0x128ef6[_0x958c('0x14')][_0x958c('0x16')]);return _0x2e37a6(_0x128ef6['error']['message']);}else{logger[_0x958c('0xf')]('CloudProvider,\x20%s,\x20%s',_0xa44c9,'request\x20sent');_0x2e37a6(_0x128ef6['result'][_0x958c('0x16')]);}})[_0x958c('0x17')](function(_0x26c739){logger[_0x958c('0x14')]('CloudProvider,\x20%s,\x20%s',_0xa44c9,_0x26c739);_0x31e668(_0x26c739);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 5b1235c..99930b9 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 _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x3fbfc6,_0x508769){var _0x57fe79=function(_0x2b6e9c){while(--_0x2b6e9c){_0x3fbfc6['push'](_0x3fbfc6['shift']());}};_0x57fe79(++_0x508769);}(_0xadb5,0xad));var _0x5adb=function(_0x21c58c,_0x5c9439){_0x21c58c=_0x21c58c-0x0;var _0xa1fe=_0xadb5[_0x21c58c];return _0xa1fe;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router;
\ No newline at end of file
+var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x3c8212,_0x59abf8){var _0x1a7462=function(_0x51f7c9){while(--_0x51f7c9){_0x3c8212['push'](_0x3c8212['shift']());}};_0x1a7462(++_0x59abf8);}(_0x2ef3,0xba));var _0x32ef=function(_0x33f9aa,_0x5cf5f){_0x33f9aa=_0x33f9aa-0x0;var _0x471a74=_0x2ef3[_0x33f9aa];return _0x471a74;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 3bbf77a..746eb52 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 _0xe168=['name','sequelize','exports','STRING'];(function(_0x28b2a7,_0x3c07fa){var _0x1e628a=function(_0x1b3073){while(--_0x1b3073){_0x28b2a7['push'](_0x28b2a7['shift']());}};_0x1e628a(++_0x3c07fa);}(_0xe168,0x159));var _0x8e16=function(_0xd6eaf,_0x41ece8){_0xd6eaf=_0xd6eaf-0x0;var _0x59296b=_0xe168[_0xd6eaf];return _0x59296b;};'use strict';var Sequelize=require(_0x8e16('0x0'));module[_0x8e16('0x1')]={'name':{'type':Sequelize[_0x8e16('0x2')],'unique':_0x8e16('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x8e16('0x2')]},'companyId':{'type':Sequelize[_0x8e16('0x2')]},'website':{'type':Sequelize[_0x8e16('0x2')]},'phone':{'type':Sequelize[_0x8e16('0x2')]},'fax':{'type':Sequelize[_0x8e16('0x2')]},'type':{'type':Sequelize[_0x8e16('0x2')]},'street':{'type':Sequelize[_0x8e16('0x2')]},'postalCode':{'type':Sequelize[_0x8e16('0x2')]},'city':{'type':Sequelize[_0x8e16('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x8e16('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x8e16('0x2')]},'sStreet':{'type':Sequelize[_0x8e16('0x2')]},'sPostalCode':{'type':Sequelize[_0x8e16('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x8e16('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3b2b=['sequelize','exports','name','STRING'];(function(_0x352740,_0x10bd9b){var _0x26c2f7=function(_0x359661){while(--_0x359661){_0x352740['push'](_0x352740['shift']());}};_0x26c2f7(++_0x10bd9b);}(_0x3b2b,0x64));var _0xb3b2=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x3b2b[_0x4c7fb5];return _0x2e10ac;};'use strict';var Sequelize=require(_0xb3b2('0x0'));module[_0xb3b2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb3b2('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xb3b2('0x3')]},'companyId':{'type':Sequelize[_0xb3b2('0x3')]},'website':{'type':Sequelize[_0xb3b2('0x3')]},'phone':{'type':Sequelize[_0xb3b2('0x3')]},'fax':{'type':Sequelize[_0xb3b2('0x3')]},'type':{'type':Sequelize[_0xb3b2('0x3')]},'street':{'type':Sequelize[_0xb3b2('0x3')]},'postalCode':{'type':Sequelize[_0xb3b2('0x3')]},'city':{'type':Sequelize[_0xb3b2('0x3')]},'country':{'type':Sequelize[_0xb3b2('0x3')]},'email':{'type':Sequelize[_0xb3b2('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xb3b2('0x3')]},'sStreet':{'type':Sequelize[_0xb3b2('0x3')]},'sPostalCode':{'type':Sequelize[_0xb3b2('0x3')]},'sCity':{'type':Sequelize[_0xb3b2('0x3')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb3b2('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 2ce65f9..7821eee 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 _0x2f0f=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','save','update','destroy','then','get','UserProfileResource','error','stack','name','send','index','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','CmCompany','includeAll','findAll','rows','catch','rawAttributes','include','options','create','body','user','Companies','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addContacts','CmContact','ids','omit','getContacts','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x46ba2f,_0x49ef17){var _0x25e4c7=function(_0x5ab706){while(--_0x5ab706){_0x46ba2f['push'](_0x46ba2f['shift']());}};_0x25e4c7(++_0x49ef17);}(_0x2f0f,0xa6));var _0xf2f0=function(_0x5efb3c,_0x852a5a){_0x5efb3c=_0x5efb3c-0x0;var _0x349be3=_0x2f0f[_0x5efb3c];return _0x349be3;};'use strict';var emlformat=require(_0xf2f0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf2f0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf2f0('0x2'));var moment=require(_0xf2f0('0x3'));var BPromise=require(_0xf2f0('0x4'));var Mustache=require(_0xf2f0('0x5'));var util=require(_0xf2f0('0x6'));var path=require(_0xf2f0('0x7'));var sox=require(_0xf2f0('0x8'));var csv=require(_0xf2f0('0x9'));var ejs=require(_0xf2f0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf2f0('0xb'));var squel=require(_0xf2f0('0xc'));var crypto=require(_0xf2f0('0xd'));var jsforce=require(_0xf2f0('0xe'));var deskjs=require(_0xf2f0('0xf'));var toCsv=require(_0xf2f0('0x9'));var querystring=require(_0xf2f0('0x10'));var Papa=require(_0xf2f0('0x11'));var Redis=require(_0xf2f0('0x12'));var authService=require(_0xf2f0('0x13'));var qs=require(_0xf2f0('0x14'));var as=require(_0xf2f0('0x15'));var hardwareService=require(_0xf2f0('0x16'));var logger=require('../../config/logger')(_0xf2f0('0x17'));var utils=require(_0xf2f0('0x18'));var config=require(_0xf2f0('0x19'));var licenseUtil=require(_0xf2f0('0x1a'));var db=require(_0xf2f0('0x1b'))['db'];function respondWithStatusCode(_0x568816,_0x2a9c9d){_0x2a9c9d=_0x2a9c9d||0xcc;return function(_0x22bd7a){if(_0x22bd7a){return _0x568816[_0xf2f0('0x1c')](_0x2a9c9d);}return _0x568816[_0xf2f0('0x1d')](_0x2a9c9d)[_0xf2f0('0x1e')]();};}function respondWithResult(_0xa4e04b,_0x4fe18e){_0x4fe18e=_0x4fe18e||0xc8;return function(_0x3a3197){if(_0x3a3197){return _0xa4e04b[_0xf2f0('0x1d')](_0x4fe18e)['json'](_0x3a3197);}};}function respondWithFilteredResult(_0x48a80c,_0x1567a3){return function(_0x5a27ad){if(_0x5a27ad){var _0x398bf3=typeof _0x1567a3['offset']===_0xf2f0('0x1f')&&typeof _0x1567a3['limit']===_0xf2f0('0x1f');var _0x1a4b21=_0x5a27ad[_0xf2f0('0x20')];var _0x1d5e9d=_0x398bf3?0x0:_0x1567a3[_0xf2f0('0x21')];var _0xae8fcb=_0x398bf3?_0x5a27ad['count']:_0x1567a3[_0xf2f0('0x21')]+_0x1567a3[_0xf2f0('0x22')];var _0x1a9a61;if(_0xae8fcb>=_0x1a4b21){_0xae8fcb=_0x1a4b21;_0x1a9a61=0xc8;}else{_0x1a9a61=0xce;}_0x48a80c[_0xf2f0('0x1d')](_0x1a9a61);return _0x48a80c[_0xf2f0('0x23')](_0xf2f0('0x24'),_0x1d5e9d+'-'+_0xae8fcb+'/'+_0x1a4b21)[_0xf2f0('0x25')](_0x5a27ad);}return null;};}function patchUpdates(_0x19b4a3){return function(_0x33dcc1){try{jsonpatch['apply'](_0x33dcc1,_0x19b4a3,!![]);}catch(_0x31b015){return BPromise['reject'](_0x31b015);}return _0x33dcc1[_0xf2f0('0x26')]();};}function saveUpdates(_0x2f4683,_0x22006e){return function(_0x5bd429){if(_0x5bd429){return _0x5bd429[_0xf2f0('0x27')](_0x2f4683)['then'](function(_0x9d7743){return _0x9d7743;});}return null;};}function removeEntity(_0x4818c6,_0x29b7ea){return function(_0xc46fb6){if(_0xc46fb6){return _0xc46fb6[_0xf2f0('0x28')]()[_0xf2f0('0x29')](function(){var _0x514030=_0xc46fb6[_0xf2f0('0x2a')]({'plain':!![]});var _0x260981='Companies';return db[_0xf2f0('0x2b')][_0xf2f0('0x28')]({'where':{'type':_0x260981,'resourceId':_0x514030['id']}})[_0xf2f0('0x29')](function(){return _0xc46fb6;});})['then'](function(){_0x4818c6[_0xf2f0('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x208cb7,_0x10ac53){return function(_0x4f0020){if(!_0x4f0020){_0x208cb7[_0xf2f0('0x1c')](0x194);}return _0x4f0020;};}function handleError(_0x3b2c0f,_0x37657c){_0x37657c=_0x37657c||0x1f4;return function(_0x990107){logger[_0xf2f0('0x2c')](_0x990107[_0xf2f0('0x2d')]);if(_0x990107['name']){delete _0x990107[_0xf2f0('0x2e')];}_0x3b2c0f[_0xf2f0('0x1d')](_0x37657c)[_0xf2f0('0x2f')](_0x990107);};}exports[_0xf2f0('0x30')]=function(_0x56d5a2,_0x120f80){var _0x5ac264={},_0x3629cf={},_0x452a24={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0xf2f0('0x29')](function(_0x230c50){_0x3629cf[_0xf2f0('0x31')]=_[_0xf2f0('0x32')](_0x230c50);_0x3629cf[_0xf2f0('0x33')]=_[_0xf2f0('0x32')](_0x56d5a2['query']);_0x3629cf['filters']=_[_0xf2f0('0x34')](_0x3629cf[_0xf2f0('0x31')],_0x3629cf['query']);_0x5ac264[_0xf2f0('0x35')]=_[_0xf2f0('0x34')](_0x3629cf[_0xf2f0('0x31')],qs['fields'](_0x56d5a2[_0xf2f0('0x33')][_0xf2f0('0x36')]));_0x5ac264['attributes']=_0x5ac264[_0xf2f0('0x35')][_0xf2f0('0x37')]?_0x5ac264[_0xf2f0('0x35')]:_0x3629cf['model'];if(!_0x56d5a2[_0xf2f0('0x33')][_0xf2f0('0x38')](_0xf2f0('0x39'))){_0x5ac264[_0xf2f0('0x22')]=qs[_0xf2f0('0x22')](_0x56d5a2[_0xf2f0('0x33')][_0xf2f0('0x22')]);_0x5ac264[_0xf2f0('0x21')]=qs[_0xf2f0('0x21')](_0x56d5a2[_0xf2f0('0x33')]['offset']);}_0x5ac264[_0xf2f0('0x3a')]=qs[_0xf2f0('0x3b')](_0x56d5a2[_0xf2f0('0x33')][_0xf2f0('0x3b')]);_0x5ac264[_0xf2f0('0x3c')]=qs['filters'](_[_0xf2f0('0x3d')](_0x56d5a2[_0xf2f0('0x33')],_0x3629cf[_0xf2f0('0x3e')]),_0x230c50);if(_0x56d5a2[_0xf2f0('0x33')][_0xf2f0('0x3f')]){_0x5ac264['where']=_[_0xf2f0('0x40')](_0x5ac264['where'],{'$or':_[_0xf2f0('0x41')](_0x5ac264['attributes'],function(_0xc5ccd3){var _0x5bf973={};_0x5bf973[_0xc5ccd3]={'$like':'%'+_0x56d5a2['query'][_0xf2f0('0x3f')]+'%'};return _0x5bf973;})});}_0x5ac264=_[_0xf2f0('0x40')]({},_0x5ac264,_0x56d5a2['options']);var _0x583c90={'where':_0x5ac264['where']};return db[_0xf2f0('0x42')]['count'](_0x583c90)['then'](function(_0x1073c7){_0x452a24['count']=_0x1073c7;if(_0x56d5a2[_0xf2f0('0x33')][_0xf2f0('0x43')]){_0x5ac264['include']=[{'all':!![]}];}return db['CmCompany'][_0xf2f0('0x44')](_0x5ac264);})[_0xf2f0('0x29')](function(_0x550f5a){_0x452a24[_0xf2f0('0x45')]=_0x550f5a;return _0x452a24;})[_0xf2f0('0x29')](respondWithFilteredResult(_0x120f80,_0x5ac264))[_0xf2f0('0x46')](handleError(_0x120f80,null));})[_0xf2f0('0x46')](handleError(_0x120f80,null));};exports['show']=function(_0x5d6193,_0x15c50b){var _0x5e439e={'raw':![],'where':{'id':_0x5d6193['params']['id']}},_0x2e512f={};_0x2e512f[_0xf2f0('0x31')]=_[_0xf2f0('0x32')](db[_0xf2f0('0x42')][_0xf2f0('0x47')]);_0x2e512f['query']=_['keys'](_0x5d6193[_0xf2f0('0x33')]);_0x2e512f[_0xf2f0('0x3e')]=_[_0xf2f0('0x34')](_0x2e512f[_0xf2f0('0x31')],_0x2e512f[_0xf2f0('0x33')]);_0x5e439e[_0xf2f0('0x35')]=_[_0xf2f0('0x34')](_0x2e512f[_0xf2f0('0x31')],qs[_0xf2f0('0x36')](_0x5d6193['query'][_0xf2f0('0x36')]));_0x5e439e['attributes']=_0x5e439e[_0xf2f0('0x35')]['length']?_0x5e439e[_0xf2f0('0x35')]:_0x2e512f[_0xf2f0('0x31')];if(_0x5d6193[_0xf2f0('0x33')]['includeAll']){_0x5e439e[_0xf2f0('0x48')]=[{'all':!![]}];}_0x5e439e=_[_0xf2f0('0x40')]({},_0x5e439e,_0x5d6193[_0xf2f0('0x49')]);return db[_0xf2f0('0x42')]['find'](_0x5e439e)[_0xf2f0('0x29')](handleEntityNotFound(_0x15c50b,null))[_0xf2f0('0x29')](respondWithResult(_0x15c50b,null))['catch'](handleError(_0x15c50b,null));};exports[_0xf2f0('0x4a')]=function(_0x20ff43,_0x19a5ed){return db['CmCompany'][_0xf2f0('0x4a')](_0x20ff43[_0xf2f0('0x4b')],{})[_0xf2f0('0x29')](function(_0x26553c){var _0x40de15=_0x20ff43[_0xf2f0('0x4c')][_0xf2f0('0x2a')]({'plain':!![]});if(!_0x40de15)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40de15['role']===_0xf2f0('0x4c')){var _0x5a86f9=_0x26553c[_0xf2f0('0x2a')]({'plain':!![]});var _0x257f12=_0xf2f0('0x4d');return db[_0xf2f0('0x4e')][_0xf2f0('0x4f')]({'where':{'name':_0x257f12,'userProfileId':_0x40de15[_0xf2f0('0x50')]},'raw':!![]})['then'](function(_0x4a1679){if(_0x4a1679&&_0x4a1679[_0xf2f0('0x51')]===0x0){return db['UserProfileResource'][_0xf2f0('0x4a')]({'name':_0x5a86f9[_0xf2f0('0x2e')],'resourceId':_0x5a86f9['id'],'type':_0x4a1679[_0xf2f0('0x2e')],'sectionId':_0x4a1679['id']},{})[_0xf2f0('0x29')](function(){return _0x26553c;});}else{return _0x26553c;}})[_0xf2f0('0x46')](function(_0xcd6831){logger['error'](_0xf2f0('0x52'),_0xcd6831);throw _0xcd6831;});}return _0x26553c;})[_0xf2f0('0x29')](respondWithResult(_0x19a5ed,0xc9))[_0xf2f0('0x46')](handleError(_0x19a5ed,null));};exports[_0xf2f0('0x27')]=function(_0x2dbf41,_0x15a2fb){if(_0x2dbf41[_0xf2f0('0x4b')]['id']){delete _0x2dbf41[_0xf2f0('0x4b')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x2dbf41[_0xf2f0('0x53')]['id']}})['then'](handleEntityNotFound(_0x15a2fb,null))[_0xf2f0('0x29')](saveUpdates(_0x2dbf41[_0xf2f0('0x4b')],null))[_0xf2f0('0x29')](respondWithResult(_0x15a2fb,null))['catch'](handleError(_0x15a2fb,null));};exports['destroy']=function(_0x1a1b05,_0x8cc308){return db[_0xf2f0('0x42')]['find']({'where':{'id':_0x1a1b05['params']['id']}})[_0xf2f0('0x29')](handleEntityNotFound(_0x8cc308,null))[_0xf2f0('0x29')](removeEntity(_0x8cc308,null))[_0xf2f0('0x46')](handleError(_0x8cc308,null));};exports[_0xf2f0('0x54')]=function(_0x1f7bc0,_0x46a19d){return db[_0xf2f0('0x42')][_0xf2f0('0x54')]()[_0xf2f0('0x29')](respondWithResult(_0x46a19d,null))[_0xf2f0('0x46')](handleError(_0x46a19d,null));};exports[_0xf2f0('0x55')]=function(_0x427a98,_0x369e1d,_0x2ef0a4){return db[_0xf2f0('0x56')][_0xf2f0('0x4f')]({'where':{'id':_0x427a98[_0xf2f0('0x53')]['id']}})['then'](handleEntityNotFound(_0x369e1d,null))[_0xf2f0('0x29')](function(_0x188787){if(_0x188787){return _0x188787['addContacts'](_0x427a98[_0xf2f0('0x4b')][_0xf2f0('0x57')],_[_0xf2f0('0x58')](_0x427a98[_0xf2f0('0x4b')],[_0xf2f0('0x57'),'id'])||{});}})[_0xf2f0('0x29')](respondWithResult(_0x369e1d,null))[_0xf2f0('0x46')](handleError(_0x369e1d,null));};exports[_0xf2f0('0x59')]=function(_0x9f7666,_0x4b62e7,_0x1da1d6){var _0x19f12b={};var _0x3de1f2={};var _0x57d6e5;var _0xc8e9a4;return db['CmCompany']['findOne']({'where':{'id':_0x9f7666[_0xf2f0('0x53')]['id']}})['then'](handleEntityNotFound(_0x4b62e7,null))['then'](function(_0x4e09fa){if(_0x4e09fa){_0x57d6e5=_0x4e09fa;_0x3de1f2[_0xf2f0('0x31')]=_[_0xf2f0('0x32')](db[_0xf2f0('0x56')]['rawAttributes']);_0x3de1f2['query']=_['keys'](_0x9f7666[_0xf2f0('0x33')]);_0x3de1f2[_0xf2f0('0x3e')]=_['intersection'](_0x3de1f2[_0xf2f0('0x31')],_0x3de1f2[_0xf2f0('0x33')]);_0x19f12b[_0xf2f0('0x35')]=_['intersection'](_0x3de1f2[_0xf2f0('0x31')],qs[_0xf2f0('0x36')](_0x9f7666['query'][_0xf2f0('0x36')]));_0x19f12b[_0xf2f0('0x35')]=_0x19f12b[_0xf2f0('0x35')]['length']?_0x19f12b[_0xf2f0('0x35')]:_0x3de1f2['model'];_0x19f12b[_0xf2f0('0x3a')]=qs[_0xf2f0('0x3b')](_0x9f7666[_0xf2f0('0x33')]['sort']);_0x19f12b[_0xf2f0('0x3c')]=qs[_0xf2f0('0x3e')](_[_0xf2f0('0x3d')](_0x9f7666['query'],_0x3de1f2['filters']));if(_0x9f7666[_0xf2f0('0x33')]['filter']){_0x19f12b[_0xf2f0('0x3c')]=_[_0xf2f0('0x40')](_0x19f12b['where'],{'$or':_[_0xf2f0('0x41')](_0x19f12b[_0xf2f0('0x35')],function(_0x3b5fb9){var _0x298a5={};_0x298a5[_0x3b5fb9]={'$like':'%'+_0x9f7666[_0xf2f0('0x33')][_0xf2f0('0x3f')]+'%'};return _0x298a5;})});}_0x19f12b=_['merge']({},_0x19f12b,_0x9f7666[_0xf2f0('0x49')]);return _0x57d6e5[_0xf2f0('0x59')](_0x19f12b);}})[_0xf2f0('0x29')](function(_0x4f85fd){if(_0x4f85fd){_0xc8e9a4=_0x4f85fd['length'];if(!_0x9f7666['query']['hasOwnProperty'](_0xf2f0('0x39'))){_0x19f12b['limit']=qs[_0xf2f0('0x22')](_0x9f7666[_0xf2f0('0x33')]['limit']);_0x19f12b['offset']=qs[_0xf2f0('0x21')](_0x9f7666['query'][_0xf2f0('0x21')]);}return _0x57d6e5[_0xf2f0('0x59')](_0x19f12b);}})[_0xf2f0('0x29')](function(_0x35906f){if(_0x35906f){return _0x35906f?{'count':_0xc8e9a4,'rows':_0x35906f}:null;}})[_0xf2f0('0x29')](respondWithResult(_0x4b62e7,null))[_0xf2f0('0x46')](handleError(_0x4b62e7,null));};
\ No newline at end of file
+var _0x7113=['body','describe','addContacts','CmContact','ids','omit','findOne','map','getContacts','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','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','offset','undefined','limit','count','set','apply','update','destroy','then','get','error','stack','name','index','CmCompany','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','fields','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x25a1dc,_0x536cdf){var _0x248360=function(_0x415614){while(--_0x415614){_0x25a1dc['push'](_0x25a1dc['shift']());}};_0x248360(++_0x536cdf);}(_0x7113,0x10b));var _0x3711=function(_0x294fe1,_0x9e5abf){_0x294fe1=_0x294fe1-0x0;var _0x79432d=_0x7113[_0x294fe1];return _0x79432d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3711('0x0'));var zipdir=require(_0x3711('0x1'));var jsonpatch=require(_0x3711('0x2'));var rp=require(_0x3711('0x3'));var moment=require(_0x3711('0x4'));var BPromise=require(_0x3711('0x5'));var Mustache=require('mustache');var util=require(_0x3711('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3711('0x7'));var ejs=require(_0x3711('0x8'));var fs=require('fs');var fs_extra=require(_0x3711('0x9'));var _=require(_0x3711('0xa'));var squel=require(_0x3711('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3711('0xc'));var toCsv=require(_0x3711('0x7'));var querystring=require('querystring');var Papa=require(_0x3711('0xd'));var Redis=require(_0x3711('0xe'));var authService=require(_0x3711('0xf'));var qs=require(_0x3711('0x10'));var as=require(_0x3711('0x11'));var hardwareService=require(_0x3711('0x12'));var logger=require(_0x3711('0x13'))(_0x3711('0x14'));var utils=require(_0x3711('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3711('0x16'));var db=require(_0x3711('0x17'))['db'];function respondWithStatusCode(_0x4b8c93,_0x36215d){_0x36215d=_0x36215d||0xcc;return function(_0x4f0973){if(_0x4f0973){return _0x4b8c93[_0x3711('0x18')](_0x36215d);}return _0x4b8c93[_0x3711('0x19')](_0x36215d)[_0x3711('0x1a')]();};}function respondWithResult(_0x50c381,_0x1c22ac){_0x1c22ac=_0x1c22ac||0xc8;return function(_0x18cd60){if(_0x18cd60){return _0x50c381[_0x3711('0x19')](_0x1c22ac)[_0x3711('0x1b')](_0x18cd60);}};}function respondWithFilteredResult(_0x3626cc,_0x3341ee){return function(_0x554bd6){if(_0x554bd6){var _0x21317b=typeof _0x3341ee[_0x3711('0x1c')]===_0x3711('0x1d')&&typeof _0x3341ee[_0x3711('0x1e')]==='undefined';var _0x343d9a=_0x554bd6[_0x3711('0x1f')];var _0x7b0dfc=_0x21317b?0x0:_0x3341ee['offset'];var _0x424932=_0x21317b?_0x554bd6[_0x3711('0x1f')]:_0x3341ee[_0x3711('0x1c')]+_0x3341ee[_0x3711('0x1e')];var _0x4d1fbc;if(_0x424932>=_0x343d9a){_0x424932=_0x343d9a;_0x4d1fbc=0xc8;}else{_0x4d1fbc=0xce;}_0x3626cc[_0x3711('0x19')](_0x4d1fbc);return _0x3626cc[_0x3711('0x20')]('Content-Range',_0x7b0dfc+'-'+_0x424932+'/'+_0x343d9a)['json'](_0x554bd6);}return null;};}function patchUpdates(_0x3d131e){return function(_0x5af898){try{jsonpatch[_0x3711('0x21')](_0x5af898,_0x3d131e,!![]);}catch(_0x20374a){return BPromise['reject'](_0x20374a);}return _0x5af898['save']();};}function saveUpdates(_0x377f6c,_0x518d80){return function(_0x2e54d3){if(_0x2e54d3){return _0x2e54d3[_0x3711('0x22')](_0x377f6c)['then'](function(_0x58c563){return _0x58c563;});}return null;};}function removeEntity(_0x54c216,_0xe7d4e5){return function(_0x320a6b){if(_0x320a6b){return _0x320a6b[_0x3711('0x23')]()[_0x3711('0x24')](function(){var _0x47c84e=_0x320a6b[_0x3711('0x25')]({'plain':!![]});var _0x1cdeb2='Companies';return db['UserProfileResource'][_0x3711('0x23')]({'where':{'type':_0x1cdeb2,'resourceId':_0x47c84e['id']}})['then'](function(){return _0x320a6b;});})[_0x3711('0x24')](function(){_0x54c216['status'](0xcc)[_0x3711('0x1a')]();});}};}function handleEntityNotFound(_0x54a2fe,_0x4850a4){return function(_0x19ed2c){if(!_0x19ed2c){_0x54a2fe[_0x3711('0x18')](0x194);}return _0x19ed2c;};}function handleError(_0x3b6810,_0x1996fd){_0x1996fd=_0x1996fd||0x1f4;return function(_0x59d618){logger[_0x3711('0x26')](_0x59d618[_0x3711('0x27')]);if(_0x59d618[_0x3711('0x28')]){delete _0x59d618[_0x3711('0x28')];}_0x3b6810[_0x3711('0x19')](_0x1996fd)['send'](_0x59d618);};}exports[_0x3711('0x29')]=function(_0x52d266,_0x214c79){var _0x19bbd9={},_0x24491a={},_0x2cea90={'count':0x0,'rows':[]};return db[_0x3711('0x2a')]['describe']()['then'](function(_0x42b41c){_0x24491a[_0x3711('0x2b')]=_[_0x3711('0x2c')](_0x42b41c);_0x24491a[_0x3711('0x2d')]=_[_0x3711('0x2c')](_0x52d266[_0x3711('0x2d')]);_0x24491a['filters']=_[_0x3711('0x2e')](_0x24491a[_0x3711('0x2b')],_0x24491a[_0x3711('0x2d')]);_0x19bbd9[_0x3711('0x2f')]=_[_0x3711('0x2e')](_0x24491a[_0x3711('0x2b')],qs['fields'](_0x52d266[_0x3711('0x2d')]['fields']));_0x19bbd9[_0x3711('0x2f')]=_0x19bbd9[_0x3711('0x2f')][_0x3711('0x30')]?_0x19bbd9['attributes']:_0x24491a['model'];if(!_0x52d266['query'][_0x3711('0x31')](_0x3711('0x32'))){_0x19bbd9[_0x3711('0x1e')]=qs[_0x3711('0x1e')](_0x52d266[_0x3711('0x2d')]['limit']);_0x19bbd9[_0x3711('0x1c')]=qs[_0x3711('0x1c')](_0x52d266[_0x3711('0x2d')]['offset']);}_0x19bbd9[_0x3711('0x33')]=qs[_0x3711('0x34')](_0x52d266[_0x3711('0x2d')][_0x3711('0x34')]);_0x19bbd9[_0x3711('0x35')]=qs[_0x3711('0x36')](_[_0x3711('0x37')](_0x52d266[_0x3711('0x2d')],_0x24491a[_0x3711('0x36')]),_0x42b41c);if(_0x52d266['query'][_0x3711('0x38')]){_0x19bbd9['where']=_[_0x3711('0x39')](_0x19bbd9['where'],{'$or':_['map'](_0x19bbd9[_0x3711('0x2f')],function(_0x481f16){var _0x20af79={};_0x20af79[_0x481f16]={'$like':'%'+_0x52d266[_0x3711('0x2d')]['filter']+'%'};return _0x20af79;})});}_0x19bbd9=_[_0x3711('0x39')]({},_0x19bbd9,_0x52d266[_0x3711('0x3a')]);var _0x107e16={'where':_0x19bbd9['where']};return db[_0x3711('0x2a')][_0x3711('0x1f')](_0x107e16)[_0x3711('0x24')](function(_0x450361){_0x2cea90[_0x3711('0x1f')]=_0x450361;if(_0x52d266[_0x3711('0x2d')]['includeAll']){_0x19bbd9[_0x3711('0x3b')]=[{'all':!![]}];}return db['CmCompany'][_0x3711('0x3c')](_0x19bbd9);})[_0x3711('0x24')](function(_0x53476c){_0x2cea90[_0x3711('0x3d')]=_0x53476c;return _0x2cea90;})[_0x3711('0x24')](respondWithFilteredResult(_0x214c79,_0x19bbd9))['catch'](handleError(_0x214c79,null));})[_0x3711('0x3e')](handleError(_0x214c79,null));};exports[_0x3711('0x3f')]=function(_0x381ee8,_0x167edc){var _0x30b6c5={'raw':![],'where':{'id':_0x381ee8[_0x3711('0x40')]['id']}},_0x13692c={};_0x13692c[_0x3711('0x2b')]=_[_0x3711('0x2c')](db['CmCompany'][_0x3711('0x41')]);_0x13692c[_0x3711('0x2d')]=_[_0x3711('0x2c')](_0x381ee8['query']);_0x13692c[_0x3711('0x36')]=_[_0x3711('0x2e')](_0x13692c[_0x3711('0x2b')],_0x13692c[_0x3711('0x2d')]);_0x30b6c5['attributes']=_[_0x3711('0x2e')](_0x13692c[_0x3711('0x2b')],qs[_0x3711('0x42')](_0x381ee8[_0x3711('0x2d')][_0x3711('0x42')]));_0x30b6c5[_0x3711('0x2f')]=_0x30b6c5[_0x3711('0x2f')][_0x3711('0x30')]?_0x30b6c5['attributes']:_0x13692c[_0x3711('0x2b')];if(_0x381ee8[_0x3711('0x2d')][_0x3711('0x43')]){_0x30b6c5[_0x3711('0x3b')]=[{'all':!![]}];}_0x30b6c5=_['merge']({},_0x30b6c5,_0x381ee8[_0x3711('0x3a')]);return db['CmCompany'][_0x3711('0x44')](_0x30b6c5)[_0x3711('0x24')](handleEntityNotFound(_0x167edc,null))[_0x3711('0x24')](respondWithResult(_0x167edc,null))[_0x3711('0x3e')](handleError(_0x167edc,null));};exports[_0x3711('0x45')]=function(_0x2cd5e7,_0xe5a450){return db[_0x3711('0x2a')][_0x3711('0x45')](_0x2cd5e7['body'],{})[_0x3711('0x24')](function(_0x11b5bd){var _0x31be32=_0x2cd5e7[_0x3711('0x46')][_0x3711('0x25')]({'plain':!![]});if(!_0x31be32)throw new Error(_0x3711('0x47'));if(_0x31be32['role']===_0x3711('0x46')){var _0x44efbf=_0x11b5bd[_0x3711('0x25')]({'plain':!![]});var _0x2cc176='Companies';return db[_0x3711('0x48')]['find']({'where':{'name':_0x2cc176,'userProfileId':_0x31be32[_0x3711('0x49')]},'raw':!![]})[_0x3711('0x24')](function(_0x4935f8){if(_0x4935f8&&_0x4935f8[_0x3711('0x4a')]===0x0){return db[_0x3711('0x4b')][_0x3711('0x45')]({'name':_0x44efbf[_0x3711('0x28')],'resourceId':_0x44efbf['id'],'type':_0x4935f8[_0x3711('0x28')],'sectionId':_0x4935f8['id']},{})[_0x3711('0x24')](function(){return _0x11b5bd;});}else{return _0x11b5bd;}})[_0x3711('0x3e')](function(_0x56647b){logger['error'](_0x3711('0x4c'),_0x56647b);throw _0x56647b;});}return _0x11b5bd;})['then'](respondWithResult(_0xe5a450,0xc9))['catch'](handleError(_0xe5a450,null));};exports[_0x3711('0x22')]=function(_0x2d1005,_0x1949c4){if(_0x2d1005[_0x3711('0x4d')]['id']){delete _0x2d1005['body']['id'];}return db[_0x3711('0x2a')][_0x3711('0x44')]({'where':{'id':_0x2d1005[_0x3711('0x40')]['id']}})[_0x3711('0x24')](handleEntityNotFound(_0x1949c4,null))[_0x3711('0x24')](saveUpdates(_0x2d1005['body'],null))[_0x3711('0x24')](respondWithResult(_0x1949c4,null))[_0x3711('0x3e')](handleError(_0x1949c4,null));};exports[_0x3711('0x23')]=function(_0x3501ba,_0x5a5307){return db[_0x3711('0x2a')][_0x3711('0x44')]({'where':{'id':_0x3501ba[_0x3711('0x40')]['id']}})[_0x3711('0x24')](handleEntityNotFound(_0x5a5307,null))[_0x3711('0x24')](removeEntity(_0x5a5307,null))[_0x3711('0x3e')](handleError(_0x5a5307,null));};exports['describe']=function(_0x265519,_0x3a0d6e){return db[_0x3711('0x2a')][_0x3711('0x4e')]()[_0x3711('0x24')](respondWithResult(_0x3a0d6e,null))[_0x3711('0x3e')](handleError(_0x3a0d6e,null));};exports[_0x3711('0x4f')]=function(_0x2957d6,_0x4a6c57,_0x7e328e){return db[_0x3711('0x50')]['find']({'where':{'id':_0x2957d6[_0x3711('0x40')]['id']}})[_0x3711('0x24')](handleEntityNotFound(_0x4a6c57,null))['then'](function(_0x486187){if(_0x486187){return _0x486187[_0x3711('0x4f')](_0x2957d6[_0x3711('0x4d')][_0x3711('0x51')],_[_0x3711('0x52')](_0x2957d6[_0x3711('0x4d')],[_0x3711('0x51'),'id'])||{});}})[_0x3711('0x24')](respondWithResult(_0x4a6c57,null))[_0x3711('0x3e')](handleError(_0x4a6c57,null));};exports['getContacts']=function(_0x4d00db,_0x2e46ac,_0x4c35de){var _0xe623fb={};var _0x2c065a={};var _0x455808;var _0x907bbc;return db['CmCompany'][_0x3711('0x53')]({'where':{'id':_0x4d00db[_0x3711('0x40')]['id']}})['then'](handleEntityNotFound(_0x2e46ac,null))[_0x3711('0x24')](function(_0xe2dcc0){if(_0xe2dcc0){_0x455808=_0xe2dcc0;_0x2c065a['model']=_[_0x3711('0x2c')](db[_0x3711('0x50')]['rawAttributes']);_0x2c065a[_0x3711('0x2d')]=_[_0x3711('0x2c')](_0x4d00db[_0x3711('0x2d')]);_0x2c065a[_0x3711('0x36')]=_[_0x3711('0x2e')](_0x2c065a[_0x3711('0x2b')],_0x2c065a[_0x3711('0x2d')]);_0xe623fb[_0x3711('0x2f')]=_['intersection'](_0x2c065a[_0x3711('0x2b')],qs['fields'](_0x4d00db[_0x3711('0x2d')][_0x3711('0x42')]));_0xe623fb[_0x3711('0x2f')]=_0xe623fb['attributes']['length']?_0xe623fb[_0x3711('0x2f')]:_0x2c065a[_0x3711('0x2b')];_0xe623fb[_0x3711('0x33')]=qs['sort'](_0x4d00db[_0x3711('0x2d')][_0x3711('0x34')]);_0xe623fb[_0x3711('0x35')]=qs[_0x3711('0x36')](_[_0x3711('0x37')](_0x4d00db['query'],_0x2c065a['filters']));if(_0x4d00db[_0x3711('0x2d')][_0x3711('0x38')]){_0xe623fb[_0x3711('0x35')]=_['merge'](_0xe623fb[_0x3711('0x35')],{'$or':_[_0x3711('0x54')](_0xe623fb['attributes'],function(_0x575e76){var _0x207a31={};_0x207a31[_0x575e76]={'$like':'%'+_0x4d00db['query'][_0x3711('0x38')]+'%'};return _0x207a31;})});}_0xe623fb=_['merge']({},_0xe623fb,_0x4d00db[_0x3711('0x3a')]);return _0x455808[_0x3711('0x55')](_0xe623fb);}})[_0x3711('0x24')](function(_0x27e028){if(_0x27e028){_0x907bbc=_0x27e028[_0x3711('0x30')];if(!_0x4d00db[_0x3711('0x2d')][_0x3711('0x31')](_0x3711('0x32'))){_0xe623fb['limit']=qs['limit'](_0x4d00db[_0x3711('0x2d')][_0x3711('0x1e')]);_0xe623fb[_0x3711('0x1c')]=qs[_0x3711('0x1c')](_0x4d00db['query'][_0x3711('0x1c')]);}return _0x455808[_0x3711('0x55')](_0xe623fb);}})[_0x3711('0x24')](function(_0x1fc89b){if(_0x1fc89b){return _0x1fc89b?{'count':_0x907bbc,'rows':_0x1fc89b}:null;}})['then'](respondWithResult(_0x2e46ac,null))[_0x3711('0x3e')](handleError(_0x2e46ac,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 01c51ea..16c98a5 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 _0x24a7=['bluebird','path','../../config/environment','./cmCompany.attributes','exports','define','cm_companies','lodash','../../config/logger','api','moment'];(function(_0x441819,_0x5b8d0a){var _0x478882=function(_0x369786){while(--_0x369786){_0x441819['push'](_0x441819['shift']());}};_0x478882(++_0x5b8d0a);}(_0x24a7,0xf9));var _0x724a=function(_0x3e6e76,_0x2131b1){_0x3e6e76=_0x3e6e76-0x0;var _0x282488=_0x24a7[_0x3e6e76];return _0x282488;};'use strict';var _=require(_0x724a('0x0'));var util=require('util');var logger=require(_0x724a('0x1'))(_0x724a('0x2'));var moment=require(_0x724a('0x3'));var BPromise=require(_0x724a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x724a('0x5'));var rimraf=require('rimraf');var config=require(_0x724a('0x6'));var attributes=require(_0x724a('0x7'));module[_0x724a('0x8')]=function(_0x2ac538,_0x96ee1f){return _0x2ac538[_0x724a('0x9')]('CmCompany',attributes,{'tableName':_0x724a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xefa1=['cm_companies','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','define','CmCompany'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xefa1,0x12a));var _0x1efa=function(_0x153e95,_0x3687bc){_0x153e95=_0x153e95-0x0;var _0x463c22=_0xefa1[_0x153e95];return _0x463c22;};'use strict';var _=require(_0x1efa('0x0'));var util=require('util');var logger=require(_0x1efa('0x1'))(_0x1efa('0x2'));var moment=require('moment');var BPromise=require(_0x1efa('0x3'));var rp=require(_0x1efa('0x4'));var fs=require('fs');var path=require(_0x1efa('0x5'));var rimraf=require('rimraf');var config=require(_0x1efa('0x6'));var attributes=require(_0x1efa('0x7'));module['exports']=function(_0x1afad7,_0x5ae457){return _0x1afad7[_0x1efa('0x8')](_0x1efa('0x9'),attributes,{'tableName':_0x1efa('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 c3032ce..8f6e18a 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 _0xbbfb=['info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xbbfb,0xa1));var _0xbbbf=function(_0x8b6ca5,_0x3c3384){_0x8b6ca5=_0x8b6ca5-0x0;var _0x303384=_0xbbfb[_0x8b6ca5];return _0x303384;};'use strict';var _=require(_0xbbbf('0x0'));var util=require(_0xbbbf('0x1'));var moment=require(_0xbbbf('0x2'));var BPromise=require(_0xbbbf('0x3'));var rs=require(_0xbbbf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbbbf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbbbf('0x6'))(_0xbbbf('0x7'));var config=require(_0xbbbf('0x8'));var jayson=require(_0xbbbf('0x9'));var client=jayson[_0xbbbf('0xa')][_0xbbbf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d153c,_0x372301,_0x5109c9){return new BPromise(function(_0x34c16f,_0x2b0b51){return client[_0xbbbf('0xc')](_0x3d153c,_0x5109c9)[_0xbbbf('0xd')](function(_0x416786){logger[_0xbbbf('0xe')](_0xbbbf('0xf'),_0x372301,_0xbbbf('0x10'));logger[_0xbbbf('0x11')](_0xbbbf('0x12'),_0x372301,'request\x20sent',JSON[_0xbbbf('0x13')](_0x416786));if(_0x416786[_0xbbbf('0x14')]){if(_0x416786[_0xbbbf('0x14')][_0xbbbf('0x15')]===0x1f4){logger[_0xbbbf('0x14')](_0xbbbf('0xf'),_0x372301,_0x416786[_0xbbbf('0x14')][_0xbbbf('0x16')]);return _0x2b0b51(_0x416786['error'][_0xbbbf('0x16')]);}logger[_0xbbbf('0x14')]('CmCompany,\x20%s,\x20%s',_0x372301,_0x416786[_0xbbbf('0x14')][_0xbbbf('0x16')]);return _0x34c16f(_0x416786[_0xbbbf('0x14')]['message']);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x372301,_0xbbbf('0x10'));_0x34c16f(_0x416786[_0xbbbf('0x17')][_0xbbbf('0x16')]);}})[_0xbbbf('0x18')](function(_0x46f647){logger[_0xbbbf('0x14')](_0xbbbf('0xf'),_0x372301,_0x46f647);_0x2b0b51(_0x46f647);});});}
\ No newline at end of file
+var _0x3892=['info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3bbd69,_0xbdd1c1){var _0x4ac244=function(_0x2a7405){while(--_0x2a7405){_0x3bbd69['push'](_0x3bbd69['shift']());}};_0x4ac244(++_0xbdd1c1);}(_0x3892,0x82));var _0x2389=function(_0x3c3639,_0x5ba1f1){_0x3c3639=_0x3c3639-0x0;var _0x1c793e=_0x3892[_0x3c3639];return _0x1c793e;};'use strict';var _=require(_0x2389('0x0'));var util=require(_0x2389('0x1'));var moment=require('moment');var BPromise=require(_0x2389('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2389('0x3'));var db=require(_0x2389('0x4'))['db'];var utils=require(_0x2389('0x5'));var logger=require(_0x2389('0x6'))(_0x2389('0x7'));var config=require(_0x2389('0x8'));var jayson=require(_0x2389('0x9'));var client=jayson[_0x2389('0xa')][_0x2389('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2563c9,_0x245d32,_0x5b9372){return new BPromise(function(_0x313375,_0x28089c){return client[_0x2389('0xc')](_0x2563c9,_0x5b9372)[_0x2389('0xd')](function(_0x113ef1){logger[_0x2389('0xe')](_0x2389('0xf'),_0x245d32,_0x2389('0x10'));logger[_0x2389('0x11')](_0x2389('0x12'),_0x245d32,_0x2389('0x10'),JSON['stringify'](_0x113ef1));if(_0x113ef1[_0x2389('0x13')]){if(_0x113ef1['error'][_0x2389('0x14')]===0x1f4){logger[_0x2389('0x13')]('CmCompany,\x20%s,\x20%s',_0x245d32,_0x113ef1['error']['message']);return _0x28089c(_0x113ef1[_0x2389('0x13')][_0x2389('0x15')]);}logger[_0x2389('0x13')](_0x2389('0xf'),_0x245d32,_0x113ef1[_0x2389('0x13')][_0x2389('0x15')]);return _0x313375(_0x113ef1[_0x2389('0x13')]['message']);}else{logger[_0x2389('0xe')](_0x2389('0xf'),_0x245d32,'request\x20sent');_0x313375(_0x113ef1[_0x2389('0x16')]['message']);}})[_0x2389('0x17')](function(_0x1fb0fa){logger[_0x2389('0x13')](_0x2389('0xf'),_0x245d32,_0x1fb0fa);_0x28089c(_0x1fb0fa);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 4bddc3e..9353e4b 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 _0x49b4=['fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/contacts','getContacts','post','create','addContacts','update','exports','multer','path','connect-timeout','express'];(function(_0x16213f,_0xc89b41){var _0x38f224=function(_0x134c4c){while(--_0x134c4c){_0x16213f['push'](_0x16213f['shift']());}};_0x38f224(++_0xc89b41);}(_0x49b4,0xce));var _0x449b=function(_0x49d794,_0x7ac3c7){_0x49d794=_0x49d794-0x0;var _0x2d5a1a=_0x49b4[_0x49d794];return _0x2d5a1a;};'use strict';var multer=require(_0x449b('0x0'));var util=require('util');var path=require(_0x449b('0x1'));var timeout=require(_0x449b('0x2'));var express=require(_0x449b('0x3'));var router=express['Router']();var fs_extra=require(_0x449b('0x4'));var auth=require(_0x449b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x449b('0x6'));var controller=require(_0x449b('0x7'));router[_0x449b('0x8')]('/',auth[_0x449b('0x9')](),controller[_0x449b('0xa')]);router[_0x449b('0x8')](_0x449b('0xb'),auth['isAuthenticated'](),controller[_0x449b('0xc')]);router[_0x449b('0x8')](_0x449b('0xd'),auth[_0x449b('0x9')](),controller['show']);router[_0x449b('0x8')](_0x449b('0xe'),auth['isAuthenticated'](),controller[_0x449b('0xf')]);router[_0x449b('0x10')]('/',auth['isAuthenticated'](),controller[_0x449b('0x11')]);router['post'](_0x449b('0xe'),auth[_0x449b('0x9')](),controller[_0x449b('0x12')]);router['put'](_0x449b('0xd'),auth[_0x449b('0x9')](),controller[_0x449b('0x13')]);router['delete']('/:id',auth[_0x449b('0x9')](),controller['destroy']);module[_0x449b('0x14')]=router;
\ No newline at end of file
+var _0xc63b=['put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts','create','post'];(function(_0x385d5f,_0x43c178){var _0x17dcd8=function(_0xc597ea){while(--_0xc597ea){_0x385d5f['push'](_0x385d5f['shift']());}};_0x17dcd8(++_0x43c178);}(_0xc63b,0x1ba));var _0xbc63=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0xc63b[_0x4a3898];return _0x25ceb0;};'use strict';var multer=require(_0xbc63('0x0'));var util=require(_0xbc63('0x1'));var path=require(_0xbc63('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbc63('0x3')]();var fs_extra=require(_0xbc63('0x4'));var auth=require(_0xbc63('0x5'));var interaction=require(_0xbc63('0x6'));var config=require(_0xbc63('0x7'));var controller=require(_0xbc63('0x8'));router[_0xbc63('0x9')]('/',auth[_0xbc63('0xa')](),controller['index']);router['get'](_0xbc63('0xb'),auth[_0xbc63('0xa')](),controller[_0xbc63('0xc')]);router[_0xbc63('0x9')](_0xbc63('0xd'),auth[_0xbc63('0xa')](),controller[_0xbc63('0xe')]);router[_0xbc63('0x9')](_0xbc63('0xf'),auth[_0xbc63('0xa')](),controller['getContacts']);router['post']('/',auth[_0xbc63('0xa')](),controller[_0xbc63('0x10')]);router[_0xbc63('0x11')](_0xbc63('0xf'),auth[_0xbc63('0xa')](),controller['addContacts']);router[_0xbc63('0x12')](_0xbc63('0xd'),auth[_0xbc63('0xa')](),controller[_0xbc63('0x13')]);router[_0xbc63('0x14')](_0xbc63('0xd'),auth[_0xbc63('0xa')](),controller[_0xbc63('0x15')]);module[_0xbc63('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index f455759..1dc4b98 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 _0x9447=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','sequelize'];(function(_0x444a02,_0x4abdd1){var _0x25fc20=function(_0x1c0b4f){while(--_0x1c0b4f){_0x444a02['push'](_0x444a02['shift']());}};_0x25fc20(++_0x4abdd1);}(_0x9447,0x197));var _0x7944=function(_0x56ef5c,_0x53d2a7){_0x56ef5c=_0x56ef5c-0x0;var _0x521fd8=_0x9447[_0x56ef5c];return _0x521fd8;};'use strict';var _=require('lodash');var Sequelize=require(_0x7944('0x0'));module[_0x7944('0x1')]={'firstName':{'type':Sequelize[_0x7944('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x7944('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x7944('0x2')]},'country':{'type':Sequelize[_0x7944('0x2')]},'dateOfBirth':{'type':Sequelize[_0x7944('0x2')]},'description':{'type':Sequelize[_0x7944('0x3')]},'phone':{'type':Sequelize[_0x7944('0x2')]},'mobile':{'type':Sequelize[_0x7944('0x2')]},'fax':{'type':Sequelize[_0x7944('0x2')]},'email':{'type':Sequelize[_0x7944('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x7944('0x2')]},'twitter':{'type':Sequelize[_0x7944('0x2')]},'skype':{'type':Sequelize[_0x7944('0x2')]},'teams':{'type':Sequelize[_0x7944('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x7944('0x2')]},'wechat':{'type':Sequelize[_0x7944('0x2')]},'telegram':{'type':Sequelize[_0x7944('0x2')]},'UserId':{'type':Sequelize[_0x7944('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x7944('0x2')]},'priority':{'type':Sequelize[_0x7944('0x4')](0x2)[_0x7944('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x7944('0x6')],'defaultValue':Sequelize[_0x7944('0x7')]},'dialTimezone':{'type':Sequelize[_0x7944('0x2')]},'utcOffset':{'type':Sequelize[_0x7944('0x4')]}};
\ No newline at end of file
+var _0x9e3a=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x561111,_0x4fdfbd){var _0x3c1fd9=function(_0x1e6b83){while(--_0x1e6b83){_0x561111['push'](_0x561111['shift']());}};_0x3c1fd9(++_0x4fdfbd);}(_0x9e3a,0x1ba));var _0xa9e3=function(_0xb2a12b,_0x1511d0){_0xb2a12b=_0xb2a12b-0x0;var _0x4acc72=_0x9e3a[_0xb2a12b];return _0x4acc72;};'use strict';var _=require(_0xa9e3('0x0'));var Sequelize=require(_0xa9e3('0x1'));module[_0xa9e3('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xa9e3('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xa9e3('0x3')]},'city':{'type':Sequelize[_0xa9e3('0x3')]},'country':{'type':Sequelize[_0xa9e3('0x3')]},'dateOfBirth':{'type':Sequelize[_0xa9e3('0x3')]},'description':{'type':Sequelize[_0xa9e3('0x4')]},'phone':{'type':Sequelize[_0xa9e3('0x3')]},'mobile':{'type':Sequelize[_0xa9e3('0x3')]},'fax':{'type':Sequelize[_0xa9e3('0x3')]},'email':{'type':Sequelize[_0xa9e3('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xa9e3('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xa9e3('0x3')]},'skype':{'type':Sequelize[_0xa9e3('0x3')]},'teams':{'type':Sequelize[_0xa9e3('0x3')]},'viber':{'type':Sequelize[_0xa9e3('0x3')]},'line':{'type':Sequelize[_0xa9e3('0x3')]},'wechat':{'type':Sequelize[_0xa9e3('0x3')]},'telegram':{'type':Sequelize[_0xa9e3('0x3')]},'UserId':{'type':Sequelize[_0xa9e3('0x5')]},'AdditionalPhones':{'type':Sequelize[_0xa9e3('0x3')]},'priority':{'type':Sequelize[_0xa9e3('0x5')](0x2)[_0xa9e3('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa9e3('0x7')],'defaultValue':Sequelize[_0xa9e3('0x8')]},'dialTimezone':{'type':Sequelize[_0xa9e3('0x3')]},'utcOffset':{'type':Sequelize[_0xa9e3('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 0e223e5..094d2d1 100644
--- a/server/api/cmContact/cmContact.controller.js
+++ b/server/api/cmContact/cmContact.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','Attachments','Title','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','join','Anonymous','isEmpty','html','test'];(function(_0x2637ac,_0x377857){var _0x4a5758=function(_0x5d5043){while(--_0x5d5043){_0x2637ac['push'](_0x2637ac['shift']());}};_0x4a5758(++_0x377857);}(_0x3ee3,0x1d9));var _0x33ee=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x3ee3[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0x33ee('0x0'));var moment=require(_0x33ee('0x1'));var random=require(_0x33ee('0x2'));var fs=require('fs');var path=require(_0x33ee('0x3'));var util=require(_0x33ee('0x4'));var tnef=require(_0x33ee('0x5'));var logger=require(_0x33ee('0x6'))(_0x33ee('0x7'));var config=require('../../../config/environment');function getAddress(_0x4a8622){var _0x2921ab=_[_0x33ee('0x8')](_0x4a8622[_0x33ee('0x9')]);return _0x2921ab&&_0x2921ab[_0x33ee('0xa')]?_0x2921ab[_0x33ee('0xa')]:_0x33ee('0xb')+random[_0x33ee('0xc')](0x6)+_0x33ee('0xd');}function getFirstName(_0x568cae){var _0x213659=_['head'](_0x568cae[_0x33ee('0x9')]);if(_0x213659&&_0x213659['name']){if(_0x213659['name']==_0x213659['address']){return _0x213659[_0x33ee('0xe')][_0x33ee('0xf')](0x0,_0x213659['name'][_0x33ee('0x10')]('@'));}var _0x246989=_0x213659[_0x33ee('0xe')][_0x33ee('0x11')](/\s+/);return _0x246989[_0x33ee('0x12')]>0x1?_0x246989['slice'](0x0,-0x1)[_0x33ee('0x13')]('\x20'):_0x213659[_0x33ee('0xe')];}return _0x33ee('0x14');}function getLastName(_0x4d0cec){var _0x43fb57=_[_0x33ee('0x8')](_0x4d0cec[_0x33ee('0x9')]);if(_0x43fb57&&_0x43fb57[_0x33ee('0xe')]){var _0x757a0=_0x43fb57[_0x33ee('0xe')]['split'](/\s+/);return _0x757a0[_0x33ee('0x12')]>0x1?_0x757a0['pop']():'';}return'';}function getMails(_0x19f993,_0x4e72e9){var _0x2b79d1='';for(var _0x1ef46e=0x0;_0x1ef46e<_0x4e72e9['value'][_0x33ee('0x12')];_0x1ef46e+=0x1){if(_0x4e72e9[_0x33ee('0x9')][_0x1ef46e]['address']!==_0x19f993){if(!_[_0x33ee('0x15')](_0x2b79d1)){_0x2b79d1+=',';}_0x2b79d1+=_0x4e72e9[_0x33ee('0x9')][_0x1ef46e][_0x33ee('0xe')]||_0x4e72e9[_0x33ee('0x9')][_0x1ef46e]['address']||'';_0x2b79d1+='\x20<';_0x2b79d1+=_0x4e72e9[_0x33ee('0x9')][_0x1ef46e][_0x33ee('0xa')]?_0x4e72e9['value'][_0x1ef46e][_0x33ee('0xa')]:_0x33ee('0xb')+random['generate'](0x6)+_0x33ee('0xd');_0x2b79d1+='>';}}return _0x2b79d1;}function parseEmail(_0x13c451,_0xe1ada6,_0x367464){if(_0xe1ada6[_0x33ee('0x16')]){var _0x557496=/