From: Andrea Bianco
Date: Sun, 30 Jan 2022 19:16:15 +0000 (+0100)
Subject: Built motion from commit 85328c08.|2.5.50
X-Git-Tag: 2.5.50
X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22?a=commitdiff_plain;h=110da1ff22cb856a228cc5d87556e5aa36ca0d22;p=motion2.git
Built motion from commit 85328c08.|2.5.50
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 03a8516..28dbec3 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-01-30T18:58:23.357Z",
+ "time": "2022-01-30T19:09:29.475Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index bf38bd2..409621e 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-01-30T18:58:23.357Z",
+ "time": "2022-01-30T19:09:29.475Z",
"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 f922399..dc9e24b 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 _0xdde1=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','getDataValue','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser'];(function(_0x538a38,_0x1843fb){var _0x137886=function(_0x5b76d2){while(--_0x5b76d2){_0x538a38['push'](_0x538a38['shift']());}};_0x137886(++_0x1843fb);}(_0xdde1,0x14a));var _0x1dde=function(_0x380307,_0x440ccd){_0x380307=_0x380307-0x0;var _0x9ea14b=_0xdde1[_0x380307];return _0x9ea14b;};'use strict';var Sequelize=require(_0x1dde('0x0'));module[_0x1dde('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x411519){return this[_0x1dde('0x2')]('action');}},'action':{'type':Sequelize[_0x1dde('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x1dde('0x4'),_0x1dde('0x5'),_0x1dde('0x6'),_0x1dde('0x7'),_0x1dde('0x8'),_0x1dde('0x9'),'bot',_0x1dde('0xa')]],'msg':_0x1dde('0xb')}},'comment':_0x1dde('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x1dde('0x3')](0x1000),'comment':_0x1dde('0xc')},'data3':{'type':Sequelize[_0x1dde('0x3')](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['STRING'](0x1000),'comments':_0x1dde('0xd')},'data5':{'type':Sequelize[_0x1dde('0x3')](0x1000),'comments':_0x1dde('0xe')},'data6':{'type':Sequelize[_0x1dde('0x3')],'comments':_0x1dde('0xf')},'data7':{'type':Sequelize['TEXT'],'comments':_0x1dde('0x10')}};
\ No newline at end of file
+var _0xfdb3=['motionbar','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','TEXT','urlForward[body]','sequelize','exports','STRING','integration'];(function(_0x14b09e,_0xee7100){var _0x452f52=function(_0x18b775){while(--_0x18b775){_0x14b09e['push'](_0x14b09e['shift']());}};_0x452f52(++_0xee7100);}(_0xfdb3,0x10c));var _0x3fdb=function(_0x51733b,_0x8661bc){_0x51733b=_0x51733b-0x0;var _0x2351af=_0xfdb3[_0x51733b];return _0x2351af;};'use strict';var Sequelize=require(_0x3fdb('0x0'));module[_0x3fdb('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x384456){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x3fdb('0x2')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x3fdb('0x3'),_0x3fdb('0x4'),_0x3fdb('0x5'),_0x3fdb('0x6'),_0x3fdb('0x7'),'bot',_0x3fdb('0x8')]],'msg':_0x3fdb('0x9')}},'comment':_0x3fdb('0x9')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x3fdb('0xa')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x3fdb('0xb')},'data3':{'type':Sequelize[_0x3fdb('0x2')](0x1000),'comment':_0x3fdb('0xc')},'data4':{'type':Sequelize[_0x3fdb('0x2')](0x1000),'comments':_0x3fdb('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x3fdb('0xe')],'comments':_0x3fdb('0xf')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index cf5daff..7ba8b81 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 _0xe110=['destroy','then','stack','name','send','update','body','Action','find','params','catch','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save'];(function(_0x569fef,_0x49c37a){var _0x11f20b=function(_0x3721d8){while(--_0x3721d8){_0x569fef['push'](_0x569fef['shift']());}};_0x11f20b(++_0x49c37a);}(_0xe110,0xcf));var _0x0e11=function(_0x2591e1,_0x1ef4f4){_0x2591e1=_0x2591e1-0x0;var _0x181343=_0xe110[_0x2591e1];return _0x181343;};'use strict';var emlformat=require(_0x0e11('0x0'));var rimraf=require(_0x0e11('0x1'));var zipdir=require(_0x0e11('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0e11('0x3'));var moment=require('moment');var BPromise=require(_0x0e11('0x4'));var Mustache=require(_0x0e11('0x5'));var util=require(_0x0e11('0x6'));var path=require(_0x0e11('0x7'));var sox=require(_0x0e11('0x8'));var csv=require(_0x0e11('0x9'));var ejs=require(_0x0e11('0xa'));var fs=require('fs');var fs_extra=require(_0x0e11('0xb'));var _=require(_0x0e11('0xc'));var squel=require('squel');var crypto=require(_0x0e11('0xd'));var jsforce=require(_0x0e11('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0e11('0x9'));var querystring=require(_0x0e11('0xf'));var Papa=require(_0x0e11('0x10'));var Redis=require(_0x0e11('0x11'));var authService=require(_0x0e11('0x12'));var qs=require(_0x0e11('0x13'));var as=require(_0x0e11('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e11('0x15'))(_0x0e11('0x16'));var utils=require(_0x0e11('0x17'));var config=require(_0x0e11('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0e11('0x19'))['db'];function respondWithStatusCode(_0x46c19e,_0xb12ac2){_0xb12ac2=_0xb12ac2||0xcc;return function(_0x63c9eb){if(_0x63c9eb){return _0x46c19e[_0x0e11('0x1a')](_0xb12ac2);}return _0x46c19e[_0x0e11('0x1b')](_0xb12ac2)[_0x0e11('0x1c')]();};}function respondWithResult(_0x14f941,_0x3a5cd2){_0x3a5cd2=_0x3a5cd2||0xc8;return function(_0x5767a0){if(_0x5767a0){return _0x14f941[_0x0e11('0x1b')](_0x3a5cd2)[_0x0e11('0x1d')](_0x5767a0);}};}function respondWithFilteredResult(_0x5d0c6e,_0x29fb1e){return function(_0x454224){if(_0x454224){var _0x3be52f=typeof _0x29fb1e['offset']===_0x0e11('0x1e')&&typeof _0x29fb1e[_0x0e11('0x1f')]==='undefined';var _0x350f7c=_0x454224[_0x0e11('0x20')];var _0x414e7b=_0x3be52f?0x0:_0x29fb1e[_0x0e11('0x21')];var _0x2b78d8=_0x3be52f?_0x454224[_0x0e11('0x20')]:_0x29fb1e['offset']+_0x29fb1e['limit'];var _0x519bbe;if(_0x2b78d8>=_0x350f7c){_0x2b78d8=_0x350f7c;_0x519bbe=0xc8;}else{_0x519bbe=0xce;}_0x5d0c6e[_0x0e11('0x1b')](_0x519bbe);return _0x5d0c6e[_0x0e11('0x22')]('Content-Range',_0x414e7b+'-'+_0x2b78d8+'/'+_0x350f7c)['json'](_0x454224);}return null;};}function patchUpdates(_0x487131){return function(_0x53e363){try{jsonpatch[_0x0e11('0x23')](_0x53e363,_0x487131,!![]);}catch(_0x2c5783){return BPromise[_0x0e11('0x24')](_0x2c5783);}return _0x53e363[_0x0e11('0x25')]();};}function saveUpdates(_0x2f5efc,_0x1898f1){return function(_0x2455d0){if(_0x2455d0){return _0x2455d0['update'](_0x2f5efc)['then'](function(_0x2595a5){return _0x2595a5;});}return null;};}function removeEntity(_0x447561,_0xe9cc42){return function(_0x16e374){if(_0x16e374){return _0x16e374[_0x0e11('0x26')]()[_0x0e11('0x27')](function(){_0x447561['status'](0xcc)[_0x0e11('0x1c')]();});}};}function handleEntityNotFound(_0xb1d939,_0x11f4f6){return function(_0x544dce){if(!_0x544dce){_0xb1d939[_0x0e11('0x1a')](0x194);}return _0x544dce;};}function handleError(_0x575930,_0x4c1dd1){_0x4c1dd1=_0x4c1dd1||0x1f4;return function(_0x56b918){logger['error'](_0x56b918[_0x0e11('0x28')]);if(_0x56b918['name']){delete _0x56b918[_0x0e11('0x29')];}_0x575930[_0x0e11('0x1b')](_0x4c1dd1)[_0x0e11('0x2a')](_0x56b918);};}exports[_0x0e11('0x2b')]=function(_0x7f52a6,_0x232fc9){if(_0x7f52a6[_0x0e11('0x2c')]['id']){delete _0x7f52a6[_0x0e11('0x2c')]['id'];}return db[_0x0e11('0x2d')][_0x0e11('0x2e')]({'where':{'id':_0x7f52a6[_0x0e11('0x2f')]['id']}})[_0x0e11('0x27')](handleEntityNotFound(_0x232fc9,null))[_0x0e11('0x27')](saveUpdates(_0x7f52a6[_0x0e11('0x2c')],null))['then'](respondWithResult(_0x232fc9,null))[_0x0e11('0x30')](handleError(_0x232fc9,null));};exports[_0x0e11('0x26')]=function(_0x17c7fb,_0x2440bf){return db[_0x0e11('0x2d')][_0x0e11('0x2e')]({'where':{'id':_0x17c7fb[_0x0e11('0x2f')]['id']}})[_0x0e11('0x27')](handleEntityNotFound(_0x2440bf,null))['then'](removeEntity(_0x2440bf,null))[_0x0e11('0x30')](handleError(_0x2440bf,null));};
\ No newline at end of file
+var _0xfdd9=['jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','count','set','Content-Range','save','update','destroy','then','sendStatus','error','stack','name','send','body','Action','find','catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x4ff5b0,_0x2797f0){var _0x4d30eb=function(_0x381685){while(--_0x381685){_0x4ff5b0['push'](_0x4ff5b0['shift']());}};_0x4d30eb(++_0x2797f0);}(_0xfdd9,0x7f));var _0x9fdd=function(_0x1338eb,_0x4d6077){_0x1338eb=_0x1338eb-0x0;var _0x353ded=_0xfdd9[_0x1338eb];return _0x353ded;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9fdd('0x0'));var jsonpatch=require(_0x9fdd('0x1'));var rp=require(_0x9fdd('0x2'));var moment=require(_0x9fdd('0x3'));var BPromise=require(_0x9fdd('0x4'));var Mustache=require(_0x9fdd('0x5'));var util=require('util');var path=require(_0x9fdd('0x6'));var sox=require(_0x9fdd('0x7'));var csv=require(_0x9fdd('0x8'));var ejs=require(_0x9fdd('0x9'));var fs=require('fs');var fs_extra=require(_0x9fdd('0xa'));var _=require(_0x9fdd('0xb'));var squel=require(_0x9fdd('0xc'));var crypto=require(_0x9fdd('0xd'));var jsforce=require(_0x9fdd('0xe'));var deskjs=require(_0x9fdd('0xf'));var toCsv=require(_0x9fdd('0x8'));var querystring=require(_0x9fdd('0x10'));var Papa=require('papaparse');var Redis=require(_0x9fdd('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9fdd('0x12'));var as=require(_0x9fdd('0x13'));var hardwareService=require(_0x9fdd('0x14'));var logger=require(_0x9fdd('0x15'))(_0x9fdd('0x16'));var utils=require(_0x9fdd('0x17'));var config=require(_0x9fdd('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9fdd('0x19'))['db'];function respondWithStatusCode(_0x27c4cd,_0x3dfa80){_0x3dfa80=_0x3dfa80||0xcc;return function(_0x272a66){if(_0x272a66){return _0x27c4cd['sendStatus'](_0x3dfa80);}return _0x27c4cd['status'](_0x3dfa80)[_0x9fdd('0x1a')]();};}function respondWithResult(_0x2860c8,_0x310dbc){_0x310dbc=_0x310dbc||0xc8;return function(_0x4bfc6e){if(_0x4bfc6e){return _0x2860c8[_0x9fdd('0x1b')](_0x310dbc)[_0x9fdd('0x1c')](_0x4bfc6e);}};}function respondWithFilteredResult(_0x29c929,_0x24936e){return function(_0x4e9e78){if(_0x4e9e78){var _0x1b293e=typeof _0x24936e[_0x9fdd('0x1d')]===_0x9fdd('0x1e')&&typeof _0x24936e['limit']===_0x9fdd('0x1e');var _0x57744c=_0x4e9e78[_0x9fdd('0x1f')];var _0x4701b3=_0x1b293e?0x0:_0x24936e[_0x9fdd('0x1d')];var _0x3caf18=_0x1b293e?_0x4e9e78[_0x9fdd('0x1f')]:_0x24936e['offset']+_0x24936e['limit'];var _0x178f15;if(_0x3caf18>=_0x57744c){_0x3caf18=_0x57744c;_0x178f15=0xc8;}else{_0x178f15=0xce;}_0x29c929[_0x9fdd('0x1b')](_0x178f15);return _0x29c929[_0x9fdd('0x20')](_0x9fdd('0x21'),_0x4701b3+'-'+_0x3caf18+'/'+_0x57744c)[_0x9fdd('0x1c')](_0x4e9e78);}return null;};}function patchUpdates(_0x3368f2){return function(_0x288a58){try{jsonpatch['apply'](_0x288a58,_0x3368f2,!![]);}catch(_0x1fd9ce){return BPromise['reject'](_0x1fd9ce);}return _0x288a58[_0x9fdd('0x22')]();};}function saveUpdates(_0x57628e,_0x4394d0){return function(_0x416c3b){if(_0x416c3b){return _0x416c3b[_0x9fdd('0x23')](_0x57628e)['then'](function(_0x5e3f18){return _0x5e3f18;});}return null;};}function removeEntity(_0x31d023,_0x3642c){return function(_0x2e9dcc){if(_0x2e9dcc){return _0x2e9dcc[_0x9fdd('0x24')]()[_0x9fdd('0x25')](function(){_0x31d023[_0x9fdd('0x1b')](0xcc)[_0x9fdd('0x1a')]();});}};}function handleEntityNotFound(_0x50ef1d,_0x4bd9fa){return function(_0x321610){if(!_0x321610){_0x50ef1d[_0x9fdd('0x26')](0x194);}return _0x321610;};}function handleError(_0x1e791b,_0x285829){_0x285829=_0x285829||0x1f4;return function(_0x11c144){logger[_0x9fdd('0x27')](_0x11c144[_0x9fdd('0x28')]);if(_0x11c144[_0x9fdd('0x29')]){delete _0x11c144[_0x9fdd('0x29')];}_0x1e791b[_0x9fdd('0x1b')](_0x285829)[_0x9fdd('0x2a')](_0x11c144);};}exports[_0x9fdd('0x23')]=function(_0x5b8c67,_0x24f148){if(_0x5b8c67[_0x9fdd('0x2b')]['id']){delete _0x5b8c67[_0x9fdd('0x2b')]['id'];}return db[_0x9fdd('0x2c')][_0x9fdd('0x2d')]({'where':{'id':_0x5b8c67['params']['id']}})[_0x9fdd('0x25')](handleEntityNotFound(_0x24f148,null))[_0x9fdd('0x25')](saveUpdates(_0x5b8c67[_0x9fdd('0x2b')],null))[_0x9fdd('0x25')](respondWithResult(_0x24f148,null))[_0x9fdd('0x2e')](handleError(_0x24f148,null));};exports[_0x9fdd('0x24')]=function(_0x62d5a,_0x475d83){return db['Action'][_0x9fdd('0x2d')]({'where':{'id':_0x62d5a['params']['id']}})[_0x9fdd('0x25')](handleEntityNotFound(_0x475d83,null))[_0x9fdd('0x25')](removeEntity(_0x475d83,null))[_0x9fdd('0x2e')](handleError(_0x475d83,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 431be29..abe01af 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 _0x4d43=['exports','define','Action','tools_actions','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./action.attributes'];(function(_0x18811b,_0x6bede4){var _0x2fbee4=function(_0x4dcf84){while(--_0x4dcf84){_0x18811b['push'](_0x18811b['shift']());}};_0x2fbee4(++_0x6bede4);}(_0x4d43,0x154));var _0x34d4=function(_0x9798fd,_0x37765d){_0x9798fd=_0x9798fd-0x0;var _0x41789e=_0x4d43[_0x9798fd];return _0x41789e;};'use strict';var _=require(_0x34d4('0x0'));var util=require(_0x34d4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x34d4('0x2'));var BPromise=require('bluebird');var rp=require(_0x34d4('0x3'));var fs=require('fs');var path=require(_0x34d4('0x4'));var rimraf=require(_0x34d4('0x5'));var config=require(_0x34d4('0x6'));var attributes=require(_0x34d4('0x7'));module[_0x34d4('0x8')]=function(_0x37b23d,_0x3aa141){return _0x37b23d[_0x34d4('0x9')](_0x34d4('0xa'),attributes,{'tableName':_0x34d4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x477c=['path','rimraf','../../config/environment','./action.attributes','tools_actions','lodash','api','moment','bluebird'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x477c,0xe6));var _0xc477=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x477c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc477('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc477('0x1'));var moment=require(_0xc477('0x2'));var BPromise=require(_0xc477('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc477('0x4'));var rimraf=require(_0xc477('0x5'));var config=require(_0xc477('0x6'));var attributes=require(_0xc477('0x7'));module['exports']=function(_0x48ddae,_0x25f3f5){return _0x48ddae['define']('Action',attributes,{'tableName':_0xc477('0x8'),'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 157d6a1..574a834 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 _0x7a54=['info','Action,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x35612e,_0x1b738c){_0x35612e=_0x35612e-0x0;var _0x20d52d=_0x7a54[_0x35612e];return _0x20d52d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Action,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x4975,0x86));var _0x5497=function(_0x6dccf1,_0x4ab13f){_0x6dccf1=_0x6dccf1-0x0;var _0x321575=_0x4975[_0x6dccf1];return _0x321575;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index ea13cd6..12d69d5 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 _0xcf7f=['util','path','connect-timeout','express','Router','fs-extra','./action.controller','put','/:id','isAuthenticated','exports','multer'];(function(_0x32b5b1,_0x1da9ad){var _0x1fcc4c=function(_0x120e25){while(--_0x120e25){_0x32b5b1['push'](_0x32b5b1['shift']());}};_0x1fcc4c(++_0x1da9ad);}(_0xcf7f,0x1a3));var _0xfcf7=function(_0x37b9f7,_0x33e9a1){_0x37b9f7=_0x37b9f7-0x0;var _0x311feb=_0xcf7f[_0x37b9f7];return _0x311feb;};'use strict';var multer=require(_0xfcf7('0x0'));var util=require(_0xfcf7('0x1'));var path=require(_0xfcf7('0x2'));var timeout=require(_0xfcf7('0x3'));var express=require(_0xfcf7('0x4'));var router=express[_0xfcf7('0x5')]();var fs_extra=require(_0xfcf7('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfcf7('0x7'));router[_0xfcf7('0x8')](_0xfcf7('0x9'),auth[_0xfcf7('0xa')](),controller['update']);router['delete']('/:id',auth[_0xfcf7('0xa')](),controller['destroy']);module[_0xfcf7('0xb')]=router;
\ No newline at end of file
+var _0xb76e=['../../components/interaction/service','../../config/environment','put','/:id','update','isAuthenticated','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x4504a0,_0x1ea192){var _0x4efe3a=function(_0x336f17){while(--_0x336f17){_0x4504a0['push'](_0x4504a0['shift']());}};_0x4efe3a(++_0x1ea192);}(_0xb76e,0xe5));var _0xeb76=function(_0x29e99f,_0x4b581e){_0x29e99f=_0x29e99f-0x0;var _0x3a1ae1=_0xb76e[_0x29e99f];return _0x3a1ae1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xeb76('0x0'));var timeout=require(_0xeb76('0x1'));var express=require('express');var router=express[_0xeb76('0x2')]();var fs_extra=require(_0xeb76('0x3'));var auth=require(_0xeb76('0x4'));var interaction=require(_0xeb76('0x5'));var config=require(_0xeb76('0x6'));var controller=require('./action.controller');router[_0xeb76('0x7')](_0xeb76('0x8'),auth['isAuthenticated'](),controller[_0xeb76('0x9')]);router['delete'](_0xeb76('0x8'),auth[_0xeb76('0xa')](),controller[_0xeb76('0xb')]);module[_0xeb76('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 7a905cf..ca53b83 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 _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x1ec684,_0xee510d){var _0x4477ed=function(_0x13777d){while(--_0x13777d){_0x1ec684['push'](_0x1ec684['shift']());}};_0x4477ed(++_0xee510d);}(_0xac9d,0x14d));var _0xdac9=function(_0x5dc45d,_0x55f90f){_0x5dc45d=_0x5dc45d-0x0;var _0x4ce697=_0xac9d[_0x5dc45d];return _0x4ce697;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}};
\ No newline at end of file
+var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x3c28aa,_0x4bba43){var _0x161a1f=function(_0x11c320){while(--_0x11c320){_0x3c28aa['push'](_0x3c28aa['shift']());}};_0x161a1f(++_0x4bba43);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x318914,_0x31fc5a){_0x318914=_0x318914-0x0;var _0x51ffa2=_0x3eea[_0x318914];return _0x51ffa2;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 091c1da..a0197b0 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 _0x98e5=['Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','join','left_join','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20EMPTY','foreignKey','output','web','fullPath','%s-%s.%s','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','COUNT(*)','QueryTypes','run','runReport','COUNT(DISTINCT\x20%s)','getFields','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','dbH','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','get','CustomReports','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','type','key','model','intersection','query','attributes','fields','length','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','findAll','show','keys','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%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\x20EMPTY','rules','operator','group','field','condition','value'];(function(_0x1819a3,_0x142065){var _0x14f218=function(_0x4a7761){while(--_0x4a7761){_0x1819a3['push'](_0x1819a3['shift']());}};_0x14f218(++_0x142065);}(_0x98e5,0xd2));var _0x598e=function(_0x5b5ffe,_0x1c5874){_0x5b5ffe=_0x5b5ffe-0x0;var _0x2d12bc=_0x98e5[_0x5b5ffe];return _0x2d12bc;};'use strict';var emlformat=require(_0x598e('0x0'));var rimraf=require(_0x598e('0x1'));var zipdir=require(_0x598e('0x2'));var jsonpatch=require(_0x598e('0x3'));var rp=require('request-promise');var moment=require(_0x598e('0x4'));var BPromise=require(_0x598e('0x5'));var Mustache=require(_0x598e('0x6'));var util=require(_0x598e('0x7'));var path=require('path');var sox=require(_0x598e('0x8'));var csv=require(_0x598e('0x9'));var ejs=require(_0x598e('0xa'));var fs=require('fs');var fs_extra=require(_0x598e('0xb'));var _=require('lodash');var squel=require(_0x598e('0xc'));var crypto=require(_0x598e('0xd'));var jsforce=require(_0x598e('0xe'));var deskjs=require(_0x598e('0xf'));var toCsv=require(_0x598e('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x598e('0x10'));var as=require(_0x598e('0x11'));var hardwareService=require(_0x598e('0x12'));var logger=require(_0x598e('0x13'))('api');var utils=require(_0x598e('0x14'));var config=require(_0x598e('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require(_0x598e('0x16'))[_0x598e('0x17')];function respondWithStatusCode(_0x1e89f2,_0x34ef86){_0x34ef86=_0x34ef86||0xcc;return function(_0x3ca5c3){if(_0x3ca5c3){return _0x1e89f2['sendStatus'](_0x34ef86);}return _0x1e89f2[_0x598e('0x18')](_0x34ef86)[_0x598e('0x19')]();};}function respondWithResult(_0x1484f7,_0x4ca784){_0x4ca784=_0x4ca784||0xc8;return function(_0x4e9106){if(_0x4e9106){return _0x1484f7[_0x598e('0x18')](_0x4ca784)['json'](_0x4e9106);}};}function respondWithFilteredResult(_0x443155,_0x4bf97e){return function(_0x1a29bd){if(_0x1a29bd){var _0x30d714=typeof _0x4bf97e[_0x598e('0x1a')]===_0x598e('0x1b')&&typeof _0x4bf97e['limit']===_0x598e('0x1b');var _0x476358=_0x1a29bd[_0x598e('0x1c')];var _0x48cc3c=_0x30d714?0x0:_0x4bf97e[_0x598e('0x1a')];var _0x4e8331=_0x30d714?_0x1a29bd[_0x598e('0x1c')]:_0x4bf97e[_0x598e('0x1a')]+_0x4bf97e[_0x598e('0x1d')];var _0x45ac5b;if(_0x4e8331>=_0x476358){_0x4e8331=_0x476358;_0x45ac5b=0xc8;}else{_0x45ac5b=0xce;}_0x443155[_0x598e('0x18')](_0x45ac5b);return _0x443155[_0x598e('0x1e')](_0x598e('0x1f'),_0x48cc3c+'-'+_0x4e8331+'/'+_0x476358)[_0x598e('0x20')](_0x1a29bd);}return null;};}function patchUpdates(_0x4c57bf){return function(_0x2e4733){try{jsonpatch[_0x598e('0x21')](_0x2e4733,_0x4c57bf,!![]);}catch(_0xe87045){return BPromise['reject'](_0xe87045);}return _0x2e4733[_0x598e('0x22')]();};}function saveUpdates(_0x208234,_0x1b60f6){return function(_0x2870a5){if(_0x2870a5){return _0x2870a5[_0x598e('0x23')](_0x208234)[_0x598e('0x24')](function(_0x52c59e){return _0x52c59e;});}return null;};}function removeEntity(_0x3227e7,_0x436b20){return function(_0x18955b){if(_0x18955b){return _0x18955b[_0x598e('0x25')]()['then'](function(){var _0x2e414c=_0x18955b[_0x598e('0x26')]({'plain':!![]});var _0x22b521=_0x598e('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x22b521,'resourceId':_0x2e414c['id']}})[_0x598e('0x24')](function(){return _0x18955b;});})['then'](function(){_0x3227e7[_0x598e('0x18')](0xcc)[_0x598e('0x19')]();});}};}function handleEntityNotFound(_0x33bcc9,_0x2a27d8){return function(_0x3b73d0){if(!_0x3b73d0){_0x33bcc9[_0x598e('0x28')](0x194);}return _0x3b73d0;};}function handleError(_0x486f58,_0x2e7381){_0x2e7381=_0x2e7381||0x1f4;return function(_0x1a3842){logger[_0x598e('0x29')](_0x1a3842[_0x598e('0x2a')]);if(_0x1a3842[_0x598e('0x2b')]){delete _0x1a3842['name'];}_0x486f58[_0x598e('0x18')](_0x2e7381)[_0x598e('0x2c')](_0x1a3842);};}exports[_0x598e('0x2d')]=function(_0x2bba7d,_0xc503a2){var _0x56ce86={},_0x8f582={},_0x3281e4={'count':0x0,'rows':[]};var _0x28492d=_[_0x598e('0x2e')](db[_0x598e('0x2f')]['rawAttributes'],function(_0x2ecc72){return{'name':_0x2ecc72['fieldName'],'type':_0x2ecc72[_0x598e('0x30')][_0x598e('0x31')]};});_0x8f582[_0x598e('0x32')]=_[_0x598e('0x2e')](_0x28492d,'name');_0x8f582['query']=_['keys'](_0x2bba7d['query']);_0x8f582['filters']=_[_0x598e('0x33')](_0x8f582[_0x598e('0x32')],_0x8f582[_0x598e('0x34')]);_0x56ce86[_0x598e('0x35')]=_[_0x598e('0x33')](_0x8f582[_0x598e('0x32')],qs[_0x598e('0x36')](_0x2bba7d['query'][_0x598e('0x36')]));_0x56ce86[_0x598e('0x35')]=_0x56ce86[_0x598e('0x35')][_0x598e('0x37')]?_0x56ce86['attributes']:_0x8f582[_0x598e('0x32')];if(!_0x2bba7d[_0x598e('0x34')]['hasOwnProperty']('nolimit')){_0x56ce86[_0x598e('0x1d')]=qs[_0x598e('0x1d')](_0x2bba7d[_0x598e('0x34')]['limit']);_0x56ce86[_0x598e('0x1a')]=qs[_0x598e('0x1a')](_0x2bba7d[_0x598e('0x34')][_0x598e('0x1a')]);}_0x56ce86[_0x598e('0x38')]=qs['sort'](_0x2bba7d[_0x598e('0x34')][_0x598e('0x39')]);_0x56ce86[_0x598e('0x3a')]=qs[_0x598e('0x3b')](_[_0x598e('0x3c')](_0x2bba7d[_0x598e('0x34')],_0x8f582[_0x598e('0x3b')]),_0x28492d);if(_0x2bba7d[_0x598e('0x34')]['filter']){_0x56ce86[_0x598e('0x3a')]=_[_0x598e('0x3d')](_0x56ce86[_0x598e('0x3a')],{'$or':_[_0x598e('0x2e')](_0x28492d,function(_0x1f7425){if(_0x1f7425[_0x598e('0x30')]!==_0x598e('0x3e')){var _0x3b599e={};_0x3b599e[_0x1f7425['name']]={'$like':'%'+_0x2bba7d[_0x598e('0x34')][_0x598e('0x3f')]+'%'};return _0x3b599e;}})});}_0x56ce86=_['merge']({},_0x56ce86,_0x2bba7d[_0x598e('0x40')]);var _0x8e92dc={'where':_0x56ce86[_0x598e('0x3a')]};return db[_0x598e('0x2f')][_0x598e('0x1c')](_0x8e92dc)[_0x598e('0x24')](function(_0x4dd3a5){_0x3281e4[_0x598e('0x1c')]=_0x4dd3a5;if(_0x2bba7d[_0x598e('0x34')][_0x598e('0x41')]){_0x56ce86['include']=[{'all':!![]}];}return db[_0x598e('0x2f')][_0x598e('0x42')](_0x56ce86);})[_0x598e('0x24')](function(_0x48211c){_0x3281e4['rows']=_0x48211c;return _0x3281e4;})[_0x598e('0x24')](respondWithFilteredResult(_0xc503a2,_0x56ce86))['catch'](handleError(_0xc503a2,null));};exports[_0x598e('0x43')]=function(_0x22b113,_0x5dbeb7){var _0x9e20e7={'raw':![],'where':{'id':_0x22b113['params']['id']}},_0x3fdb68={};_0x3fdb68[_0x598e('0x32')]=_[_0x598e('0x44')](db[_0x598e('0x2f')]['rawAttributes']);_0x3fdb68[_0x598e('0x34')]=_['keys'](_0x22b113[_0x598e('0x34')]);_0x3fdb68[_0x598e('0x3b')]=_['intersection'](_0x3fdb68['model'],_0x3fdb68[_0x598e('0x34')]);_0x9e20e7[_0x598e('0x35')]=_[_0x598e('0x33')](_0x3fdb68[_0x598e('0x32')],qs[_0x598e('0x36')](_0x22b113['query'][_0x598e('0x36')]));_0x9e20e7['attributes']=_0x9e20e7[_0x598e('0x35')]['length']?_0x9e20e7[_0x598e('0x35')]:_0x3fdb68['model'];if(_0x22b113[_0x598e('0x34')][_0x598e('0x41')]){_0x9e20e7[_0x598e('0x45')]=[{'all':!![]}];}_0x9e20e7=_[_0x598e('0x3d')]({},_0x9e20e7,_0x22b113[_0x598e('0x40')]);return db['AnalyticCustomReport']['find'](_0x9e20e7)[_0x598e('0x24')](handleEntityNotFound(_0x5dbeb7,null))['then'](respondWithResult(_0x5dbeb7,null))[_0x598e('0x46')](handleError(_0x5dbeb7,null));};exports[_0x598e('0x47')]=function(_0x3cd7a2,_0x4b8327){return db[_0x598e('0x2f')][_0x598e('0x47')](_0x3cd7a2[_0x598e('0x48')],{})[_0x598e('0x24')](function(_0x10ca33){var _0x101b99=_0x3cd7a2[_0x598e('0x49')][_0x598e('0x26')]({'plain':!![]});if(!_0x101b99)throw new Error(_0x598e('0x4a'));if(_0x101b99[_0x598e('0x4b')]===_0x598e('0x49')){var _0x488d18=_0x10ca33['get']({'plain':!![]});var _0x4096b9=_0x598e('0x4c');return db[_0x598e('0x4d')][_0x598e('0x4e')]({'where':{'name':_0x4096b9,'userProfileId':_0x101b99[_0x598e('0x4f')]},'raw':!![]})[_0x598e('0x24')](function(_0x5e2d6b){if(_0x5e2d6b&&_0x5e2d6b[_0x598e('0x50')]===0x0){return db[_0x598e('0x51')][_0x598e('0x47')]({'name':_0x488d18[_0x598e('0x2b')],'resourceId':_0x488d18['id'],'type':_0x598e('0x27'),'sectionId':_0x5e2d6b['id']},{})[_0x598e('0x24')](function(){return _0x10ca33;});}else{return _0x10ca33;}})[_0x598e('0x46')](function(_0x41ab5b){logger[_0x598e('0x29')](_0x598e('0x52'),_0x41ab5b);throw _0x41ab5b;});}return _0x10ca33;})[_0x598e('0x24')](respondWithResult(_0x4b8327,0xc9))[_0x598e('0x46')](handleError(_0x4b8327,null));};exports[_0x598e('0x23')]=function(_0x2927fb,_0x1ee699){if(_0x2927fb[_0x598e('0x48')]['id']){delete _0x2927fb[_0x598e('0x48')]['id'];}return db[_0x598e('0x2f')][_0x598e('0x4e')]({'where':{'id':_0x2927fb[_0x598e('0x53')]['id']}})[_0x598e('0x24')](handleEntityNotFound(_0x1ee699,null))[_0x598e('0x24')](saveUpdates(_0x2927fb[_0x598e('0x48')],null))[_0x598e('0x24')](respondWithResult(_0x1ee699,null))[_0x598e('0x46')](handleError(_0x1ee699,null));};exports['destroy']=function(_0x13ea81,_0x1c5fe5){return db[_0x598e('0x2f')][_0x598e('0x4e')]({'where':{'id':_0x13ea81[_0x598e('0x53')]['id']}})['then'](handleEntityNotFound(_0x1c5fe5,null))[_0x598e('0x24')](removeEntity(_0x1c5fe5,null))['catch'](handleError(_0x1c5fe5,null));};exports[_0x598e('0x54')]=function(_0x1200f1,_0x4387b1){var _0xc2677d=0xa;var _0xe0e641=['join','left_join',_0x598e('0x55'),_0x598e('0x56')];var _0x564412={'SUM':_0x598e('0x57'),'COUNT':_0x598e('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x598e('0x59'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x598e('0x5a')};var _0x4f3f06={'SEC_TO_TIME':_0x598e('0x5b'),'DATE':_0x598e('0x5c'),'HOUR':_0x598e('0x5d'),'ROUND':_0x598e('0x5e'),'UNIX_TIMESTAMP':_0x598e('0x5f')};var _0x3465fd=function(_0x461784){return!_[_0x598e('0x60')]([_0x598e('0x61'),_0x598e('0x62'),_0x598e('0x63'),'IS\x20NOT\x20EMPTY'],_0x461784);};var _0x3da027=function(_0x1c3e48){if(!_0x1c3e48||!_0x1c3e48[_0x598e('0x64')][_0x598e('0x37')]){return'';}for(var _0x286c54='(',_0x16504f=0x0;_0x16504f<_0x1c3e48['rules'][_0x598e('0x37')];_0x16504f+=0x1){_0x16504f>0x0&&(_0x286c54+='\x20'+_0x1c3e48[_0x598e('0x65')]+'\x20');_0x286c54+=_0x1c3e48['rules'][_0x16504f][_0x598e('0x66')]?_0x3da027(_0x1c3e48[_0x598e('0x64')][_0x16504f][_0x598e('0x66')]):_0x1c3e48[_0x598e('0x64')][_0x16504f][_0x598e('0x67')]+'\x20'+_0x1c3e48[_0x598e('0x64')][_0x16504f][_0x598e('0x68')]+(_0x3465fd(_0x1c3e48['rules'][_0x16504f][_0x598e('0x68')])?'\x20'+_0x1c3e48['rules'][_0x16504f][_0x598e('0x69')]:'');}return _0x286c54+')';};var _0x4f4291={'where':{'id':_0x1200f1[_0x598e('0x53')]['id']}},_0x2df2d8,_0x205562,_0x389b95,_0x532adc,_0x39ae36;_0x4f4291=_[_0x598e('0x3d')]({},_0x4f4291,_0x1200f1['options']);return db[_0x598e('0x2f')][_0x598e('0x4e')](_0x4f4291)[_0x598e('0x24')](function(_0x313744){if(_0x313744){_0x2df2d8=_0x313744;return _0x313744['getFields']();}return null;})[_0x598e('0x24')](function(_0x11fbc9){if(_0x11fbc9){if(!_0x11fbc9[_0x598e('0x37')]){throw new db[(_0x598e('0x6a'))][(_0x598e('0x6b'))](_0x598e('0x6c'),0x193);}_0x205562=_0x11fbc9;return db[_0x598e('0x6d')][_0x598e('0x42')]({'raw':!![]});}return null;})[_0x598e('0x24')](function(_0xe57600){if(_0xe57600){_0x389b95=_[_0x598e('0x6e')](_0xe57600,'id');var _0x2e62fd;var _0x27f46f=squel[_0x598e('0x6f')]();_0x27f46f[_0x598e('0x70')](_0x2df2d8[_0x598e('0x71')]);for(var _0x10ec80=0x0;_0x10ec80<_0x205562[_0x598e('0x37')];_0x10ec80+=0x1){_0x2e62fd=_0x205562[_0x10ec80][_0x598e('0x72')]?_0x389b95[_0x205562[_0x10ec80][_0x598e('0x72')]][_0x598e('0x73')]:_0x205562[_0x10ec80][_0x598e('0x67')];_0x2e62fd=_0x205562[_0x10ec80][_0x598e('0x74')]?_[_0x598e('0x75')](_0x564412[_0x205562[_0x10ec80][_0x598e('0x74')]],'%s',_0x2e62fd):_0x2e62fd;_0x2e62fd=_0x205562[_0x10ec80]['format']?_[_0x598e('0x75')](_0x4f3f06[_0x205562[_0x10ec80][_0x598e('0x76')]],'%s',_0x2e62fd):_0x2e62fd;if(_0x205562[_0x10ec80][_0x598e('0x77')]){_0x27f46f[_0x598e('0x66')](_0x2e62fd);}_0x205562[_0x10ec80]['orderBy']&&_0x27f46f[_0x598e('0x38')](_0x2e62fd,_0x205562[_0x10ec80][_0x598e('0x78')]===_0x598e('0x79')?![]:!![]);_0x27f46f[_0x598e('0x67')](_0x2e62fd,_0x205562[_0x10ec80][_0x598e('0x7a')]||_0x2e62fd);}if(_0x2df2d8[_0x598e('0x7b')]){_0x2df2d8['joins']=JSON[_0x598e('0x7c')](_0x2df2d8['joins']);for(var _0x491c4b=0x0;_0x491c4b<_0x2df2d8[_0x598e('0x7b')]['length'];_0x491c4b+=0x1){if(_0x2df2d8[_0x598e('0x7b')][_0x491c4b][_0x598e('0x30')]&&_[_0x598e('0x60')](_0xe0e641,_0x2df2d8[_0x598e('0x7b')][_0x491c4b][_0x598e('0x30')])&&_0x2df2d8['joins'][_0x491c4b][_0x598e('0x7d')]&&_0x2df2d8[_0x598e('0x7b')][_0x491c4b][_0x598e('0x7e')]&&_0x2df2d8[_0x598e('0x7b')][_0x491c4b]['foreignKey']){_0x27f46f[_0x2df2d8[_0x598e('0x7b')][_0x491c4b][_0x598e('0x30')]](_0x2df2d8[_0x598e('0x7b')][_0x491c4b][_0x598e('0x7e')],null,util[_0x598e('0x76')](_0x598e('0x7f'),_0x2df2d8[_0x598e('0x71')],_0x2df2d8[_0x598e('0x7b')][_0x491c4b][_0x598e('0x7d')],_0x2df2d8[_0x598e('0x7b')][_0x491c4b][_0x598e('0x7e')],_0x2df2d8[_0x598e('0x7b')][_0x491c4b]['foreignKey']));}}}if(_0x2df2d8[_0x598e('0x80')]){_0x2df2d8[_0x598e('0x80')]=JSON[_0x598e('0x7c')](_0x2df2d8[_0x598e('0x80')]);_0x27f46f[_0x598e('0x3a')](_0x3da027(_0x2df2d8[_0x598e('0x80')][_0x598e('0x66')]));}_0x39ae36=_0x27f46f[_0x598e('0x81')]();_0x27f46f[_0x598e('0x1d')](_0xc2677d);_0x27f46f['offset'](0x0);logger[_0x598e('0x82')](_0x598e('0x83'),_0x27f46f[_0x598e('0x84')]());return dbH[_0x598e('0x85')][_0x598e('0x34')](_0x27f46f[_0x598e('0x84')](),{'type':dbH[_0x598e('0x85')]['QueryTypes'][_0x598e('0x86')]});}})['then'](respondWithResult(_0x4387b1,null))[_0x598e('0x46')](handleError(_0x4387b1,null));};function runReport(_0x255b1f,_0x1785b4,_0x2f3fae){var _0x3e286a=_0x1785b4[_0x598e('0x2b')];var _0xbfca0c=0xa;var _0x42071b=[_0x598e('0x87'),_0x598e('0x88'),_0x598e('0x55'),'cross_join'];var _0x21d9f0={'SUM':_0x598e('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x598e('0x59'),'MIN':_0x598e('0x89'),'AVG':_0x598e('0x8a'),'GROUP_CONCAT':_0x598e('0x8b'),'GROUP_CONCAT ASC':_0x598e('0x8c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3c0458={'SEC_TO_TIME':_0x598e('0x5b'),'DATE':_0x598e('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0x598e('0x5e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x240f30=function(_0x5d319d){return!_[_0x598e('0x60')]([_0x598e('0x61'),'IS\x20NOT\x20NULL',_0x598e('0x63'),_0x598e('0x8d')],_0x5d319d);};var _0x1c4d83=function(_0x10e868){if(!_0x10e868||!_0x10e868[_0x598e('0x64')][_0x598e('0x37')]){return'';}for(var _0x198495='(',_0x21f968=0x0;_0x21f968<_0x10e868['rules'][_0x598e('0x37')];_0x21f968+=0x1){_0x21f968>0x0&&(_0x198495+='\x20'+_0x10e868[_0x598e('0x65')]+'\x20');_0x198495+=_0x10e868[_0x598e('0x64')][_0x21f968][_0x598e('0x66')]?_0x1c4d83(_0x10e868[_0x598e('0x64')][_0x21f968]['group']):_0x10e868[_0x598e('0x64')][_0x21f968][_0x598e('0x67')]+'\x20'+_0x10e868[_0x598e('0x64')][_0x21f968]['condition']+(_0x240f30(_0x10e868['rules'][_0x21f968]['condition'])?'\x20'+_0x10e868[_0x598e('0x64')][_0x21f968]['value']:'');}return _0x198495+')';};var _0x521eb0={'where':{'id':_0x255b1f['id']}},_0x2ded26,_0x51297d,_0x46592f,_0x42dc6d,_0x234a56;_0x521eb0=_[_0x598e('0x3d')]({},_0x521eb0,_0x2f3fae);return db[_0x598e('0x2f')][_0x598e('0x4e')](_0x521eb0)[_0x598e('0x24')](function(_0x266665){if(_0x266665){_0x2ded26=_0x266665;return _0x266665['getFields']();}return null;})[_0x598e('0x24')](function(_0x251b48){if(_0x251b48){if(!_0x251b48[_0x598e('0x37')]){throw new db['Sequelize'][(_0x598e('0x6b'))](_0x598e('0x6c'),0x193);}_0x51297d=_0x251b48;return db[_0x598e('0x6d')][_0x598e('0x42')]({'raw':!![]});}return null;})[_0x598e('0x24')](function(_0x251b36){if(_0x251b36){_0x46592f=_['keyBy'](_0x251b36,'id');var _0x1bfe30;var _0x57140c=squel[_0x598e('0x6f')]();_0x57140c['from'](_0x2ded26[_0x598e('0x71')]);for(var _0x143c78=0x0;_0x143c78<_0x51297d[_0x598e('0x37')];_0x143c78+=0x1){_0x1bfe30=_0x51297d[_0x143c78][_0x598e('0x72')]?_0x46592f[_0x51297d[_0x143c78]['MetricId']]['metric']:_0x51297d[_0x143c78][_0x598e('0x67')];_0x1bfe30=_0x51297d[_0x143c78][_0x598e('0x74')]?_[_0x598e('0x75')](_0x21d9f0[_0x51297d[_0x143c78]['function']],'%s',_0x1bfe30):_0x1bfe30;_0x1bfe30=_0x51297d[_0x143c78]['format']?_[_0x598e('0x75')](_0x3c0458[_0x51297d[_0x143c78]['format']],'%s',_0x1bfe30):_0x1bfe30;if(_0x51297d[_0x143c78][_0x598e('0x77')]){_0x57140c['group'](_0x1bfe30);}_0x51297d[_0x143c78]['orderBy']&&_0x57140c[_0x598e('0x38')](_0x1bfe30,_0x51297d[_0x143c78][_0x598e('0x78')]==='DESC'?![]:!![]);_0x57140c[_0x598e('0x67')](_0x1bfe30,_0x51297d[_0x143c78][_0x598e('0x7a')]||_0x1bfe30);}if(_0x2ded26[_0x598e('0x7b')]){_0x2ded26[_0x598e('0x7b')]=JSON['parse'](_0x2ded26[_0x598e('0x7b')]);for(var _0x313713=0x0;_0x313713<_0x2ded26['joins'][_0x598e('0x37')];_0x313713+=0x1){if(_0x2ded26[_0x598e('0x7b')][_0x313713][_0x598e('0x30')]&&_[_0x598e('0x60')](_0x42071b,_0x2ded26[_0x598e('0x7b')][_0x313713][_0x598e('0x30')])&&_0x2ded26[_0x598e('0x7b')][_0x313713]['parentKey']&&_0x2ded26['joins'][_0x313713][_0x598e('0x7e')]&&_0x2ded26['joins'][_0x313713]['foreignKey']){_0x57140c[_0x2ded26[_0x598e('0x7b')][_0x313713][_0x598e('0x30')]](_0x2ded26['joins'][_0x313713]['foreignTable'],null,util[_0x598e('0x76')](_0x598e('0x7f'),_0x2ded26[_0x598e('0x71')],_0x2ded26['joins'][_0x313713]['parentKey'],_0x2ded26['joins'][_0x313713][_0x598e('0x7e')],_0x2ded26['joins'][_0x313713][_0x598e('0x8e')]));}}}if(_0x2ded26[_0x598e('0x80')]){_0x2ded26['conditions']=JSON[_0x598e('0x7c')](_0x2ded26[_0x598e('0x80')]);_0x57140c[_0x598e('0x3a')](_0x1c4d83(_0x2ded26[_0x598e('0x80')]['group']));}_0x234a56=_0x57140c[_0x598e('0x81')]();_0x57140c['limit'](_0xbfca0c);_0x57140c[_0x598e('0x1a')](0x0);return;}})[_0x598e('0x24')](function(){if(_0x1785b4[_0x598e('0x8f')]===_0x598e('0x90')){return null;}var _0xd95b54=_['merge'](_0x1785b4,{'name':_0x1785b4[_0x598e('0x91')]||_0x1785b4[_0x598e('0x2b')]||_0x2ded26[_0x598e('0x2b')],'basename':_0x3e286a,'savename':util[_0x598e('0x76')](_0x598e('0x92'),_0x1785b4[_0x598e('0x2b')]||_0x2ded26[_0x598e('0x2b')],require('randomstring')['generate'](0x4),_0x1785b4[_0x598e('0x8f')]||'csv'),'reportId':_0x2ded26['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0x598e('0x47')](_0xd95b54,{'raw':!![]});})[_0x598e('0x24')](function(_0x6cb4c9){if(_0x2ded26[_0x598e('0x71')]===_0x598e('0x93')){_0x234a56[_0x598e('0x3a')](_0x2ded26[_0x598e('0x71')]+_0x598e('0x94'),_0x1785b4[_0x598e('0x95')],_0x1785b4[_0x598e('0x96')]);}else{_0x234a56[_0x598e('0x3a')](_0x2ded26[_0x598e('0x71')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1785b4['startDate'],_0x1785b4[_0x598e('0x96')]);}if(_0x6cb4c9){logger['info'](_0x598e('0x97'),_0x234a56[_0x598e('0x84')]());require('child_process')['fork'](path[_0x598e('0x87')](__dirname,'../../components/export/',_0x6cb4c9[_0x598e('0x8f')]),[_0x6cb4c9['id'],_0x234a56[_0x598e('0x84')](),path['join'](__dirname,'../../files/reports',_0x6cb4c9['savename']),_0x3e286a]);return _0x6cb4c9;}else{var _0x588a55=squel[_0x598e('0x6f')]();_0x588a55[_0x598e('0x70')]('('+_0x234a56[_0x598e('0x84')]()+')','countTable');_0x588a55[_0x598e('0x67')](_0x598e('0x98'),'count');_0x234a56[_0x598e('0x1d')](_0x1785b4[_0x598e('0x1d')]||_0xbfca0c);_0x234a56[_0x598e('0x1a')](_0x1785b4[_0x598e('0x1a')]||0x0);return dbH['sequelize'][_0x598e('0x34')](_0x588a55[_0x598e('0x84')](),{'type':dbH[_0x598e('0x85')][_0x598e('0x99')][_0x598e('0x86')]})[_0x598e('0x24')](function(_0x1fc7c5){if(!_0x1fc7c5[_0x598e('0x37')]){_0x42dc6d=0x0;}else{_0x42dc6d=_0x1fc7c5[0x0][_0x598e('0x1c')]||0x0;}return dbH[_0x598e('0x85')][_0x598e('0x34')](_0x234a56['toString'](),{'type':dbH[_0x598e('0x85')][_0x598e('0x99')][_0x598e('0x86')]});})['then'](function(_0x58a3e2){return{'rows':_0x58a3e2||[],'count':_0x42dc6d};});}});}exports[_0x598e('0x9a')]=function(_0x4f9c25,_0x2fd65c){return runReport(_0x4f9c25['params'],_0x4f9c25[_0x598e('0x34')],_0x4f9c25[_0x598e('0x40')])['then'](respondWithResult(_0x2fd65c,null))['catch'](handleError(_0x2fd65c,null));};exports[_0x598e('0x9b')]=runReport;exports['query']=function(_0x381539,_0x74c91){var _0x5ad460=0xa;var _0x51968c=['join',_0x598e('0x88'),'right_join','cross_join'];var _0x312405={'SUM':_0x598e('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x598e('0x9c'),'MAX':_0x598e('0x59'),'MIN':_0x598e('0x89'),'AVG':_0x598e('0x8a'),'GROUP_CONCAT':_0x598e('0x8b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x598e('0x5a')};var _0x889936={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x598e('0x5c'),'HOUR':_0x598e('0x5d'),'ROUND':_0x598e('0x5e'),'UNIX_TIMESTAMP':_0x598e('0x5f')};var _0x311610=function(_0x24651b){return!_[_0x598e('0x60')]([_0x598e('0x61'),_0x598e('0x62'),'IS\x20EMPTY',_0x598e('0x8d')],_0x24651b);};var _0x3353eb=function(_0x53b068){if(!_0x53b068||!_0x53b068[_0x598e('0x64')]['length']){return'';}for(var _0x2faa88='(',_0x3b39ae=0x0;_0x3b39ae<_0x53b068[_0x598e('0x64')][_0x598e('0x37')];_0x3b39ae+=0x1){_0x3b39ae>0x0&&(_0x2faa88+='\x20'+_0x53b068['operator']+'\x20');_0x2faa88+=_0x53b068[_0x598e('0x64')][_0x3b39ae][_0x598e('0x66')]?_0x3353eb(_0x53b068[_0x598e('0x64')][_0x3b39ae][_0x598e('0x66')]):_0x53b068[_0x598e('0x64')][_0x3b39ae][_0x598e('0x67')]+'\x20'+_0x53b068[_0x598e('0x64')][_0x3b39ae][_0x598e('0x68')]+(_0x311610(_0x53b068[_0x598e('0x64')][_0x3b39ae]['condition'])?'\x20'+_0x53b068[_0x598e('0x64')][_0x3b39ae][_0x598e('0x69')]:'');}return _0x2faa88+')';};var _0xadc912={'where':{'id':_0x381539[_0x598e('0x53')]['id']}},_0x3e1abf,_0x12e23b,_0x3a80cc,_0x272352,_0x1ab3b3;_0xadc912=_['merge']({},_0xadc912,_0x381539[_0x598e('0x40')]);return db[_0x598e('0x2f')][_0x598e('0x4e')](_0xadc912)['then'](function(_0x268d91){if(_0x268d91){_0x3e1abf=_0x268d91;return _0x268d91[_0x598e('0x9d')]();}return null;})[_0x598e('0x24')](function(_0x3273f6){if(_0x3273f6){if(!_0x3273f6[_0x598e('0x37')]){throw new db[(_0x598e('0x6a'))][(_0x598e('0x6b'))](_0x598e('0x6c'),0x193);}_0x12e23b=_0x3273f6;return db[_0x598e('0x6d')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x522217){if(_0x522217){_0x3a80cc=_[_0x598e('0x6e')](_0x522217,'id');var _0x2405fb;var _0x29ddc3=squel[_0x598e('0x6f')]();_0x29ddc3[_0x598e('0x70')](_0x3e1abf[_0x598e('0x71')]);for(var _0x3f156f=0x0;_0x3f156f<_0x12e23b[_0x598e('0x37')];_0x3f156f+=0x1){_0x2405fb=_0x12e23b[_0x3f156f][_0x598e('0x72')]?_0x3a80cc[_0x12e23b[_0x3f156f][_0x598e('0x72')]][_0x598e('0x73')]:_0x12e23b[_0x3f156f][_0x598e('0x67')];_0x2405fb=_0x12e23b[_0x3f156f]['function']?_[_0x598e('0x75')](_0x312405[_0x12e23b[_0x3f156f][_0x598e('0x74')]],'%s',_0x2405fb):_0x2405fb;_0x2405fb=_0x12e23b[_0x3f156f][_0x598e('0x76')]?_['replace'](_0x889936[_0x12e23b[_0x3f156f][_0x598e('0x76')]],'%s',_0x2405fb):_0x2405fb;if(_0x12e23b[_0x3f156f][_0x598e('0x77')]){_0x29ddc3[_0x598e('0x66')](_0x2405fb);}_0x12e23b[_0x3f156f]['orderBy']&&_0x29ddc3[_0x598e('0x38')](_0x2405fb,_0x12e23b[_0x3f156f][_0x598e('0x78')]==='DESC'?![]:!![]);_0x29ddc3[_0x598e('0x67')](_0x2405fb,_0x12e23b[_0x3f156f][_0x598e('0x7a')]||_0x2405fb);}if(_0x3e1abf[_0x598e('0x7b')]){_0x3e1abf[_0x598e('0x7b')]=JSON[_0x598e('0x7c')](_0x3e1abf[_0x598e('0x7b')]);for(var _0x5d081a=0x0;_0x5d081a<_0x3e1abf[_0x598e('0x7b')]['length'];_0x5d081a+=0x1){if(_0x3e1abf[_0x598e('0x7b')][_0x5d081a][_0x598e('0x30')]&&_[_0x598e('0x60')](_0x51968c,_0x3e1abf[_0x598e('0x7b')][_0x5d081a][_0x598e('0x30')])&&_0x3e1abf[_0x598e('0x7b')][_0x5d081a]['parentKey']&&_0x3e1abf[_0x598e('0x7b')][_0x5d081a][_0x598e('0x7e')]&&_0x3e1abf['joins'][_0x5d081a]['foreignKey']){_0x29ddc3[_0x3e1abf['joins'][_0x5d081a][_0x598e('0x30')]](_0x3e1abf[_0x598e('0x7b')][_0x5d081a][_0x598e('0x7e')],null,util[_0x598e('0x76')](_0x598e('0x7f'),_0x3e1abf['table'],_0x3e1abf[_0x598e('0x7b')][_0x5d081a]['parentKey'],_0x3e1abf[_0x598e('0x7b')][_0x5d081a][_0x598e('0x7e')],_0x3e1abf['joins'][_0x5d081a][_0x598e('0x8e')]));}}}if(_0x3e1abf['conditions']){_0x3e1abf['conditions']=JSON[_0x598e('0x7c')](_0x3e1abf['conditions']);_0x29ddc3[_0x598e('0x3a')](_0x3353eb(_0x3e1abf['conditions'][_0x598e('0x66')]));}_0x1ab3b3=_0x29ddc3['clone']();_0x29ddc3[_0x598e('0x1d')](_0x5ad460);_0x29ddc3[_0x598e('0x1a')](0x0);logger['debug']('Limited\x20Query:',_0x29ddc3[_0x598e('0x84')]());return dbH[_0x598e('0x85')][_0x598e('0x34')](_0x29ddc3[_0x598e('0x84')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});}})[_0x598e('0x24')](function(){return{'sql':_0x1ab3b3[_0x598e('0x84')]()};})['then'](respondWithResult(_0x74c91,null))[_0x598e('0x46')](handleError(_0x74c91,null));};
\ No newline at end of file
+var _0xfa3d=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','include','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','value','params','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','field','function','replace','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','SUM(%s)','DATE(%s)','operator','ValidationErrorItem','metric','groupBy','DESC','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','info','Run\x20Query:','toString','child_process','fork','../../components/export/','output','../../files/reports','savename','countTable','run','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','eml-format','zip-dir','request-promise','moment','bluebird','util','sox'];(function(_0x443246,_0x199405){var _0xf91625=function(_0x6c01ff){while(--_0x6c01ff){_0x443246['push'](_0x443246['shift']());}};_0xf91625(++_0x199405);}(_0xfa3d,0x9d));var _0xdfa3=function(_0x427098,_0x64efac){_0x427098=_0x427098-0x0;var _0x140986=_0xfa3d[_0x427098];return _0x140986;};'use strict';var emlformat=require(_0xdfa3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdfa3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdfa3('0x2'));var moment=require(_0xdfa3('0x3'));var BPromise=require(_0xdfa3('0x4'));var Mustache=require('mustache');var util=require(_0xdfa3('0x5'));var path=require('path');var sox=require(_0xdfa3('0x6'));var csv=require(_0xdfa3('0x7'));var ejs=require(_0xdfa3('0x8'));var fs=require('fs');var fs_extra=require(_0xdfa3('0x9'));var _=require(_0xdfa3('0xa'));var squel=require(_0xdfa3('0xb'));var crypto=require(_0xdfa3('0xc'));var jsforce=require(_0xdfa3('0xd'));var deskjs=require(_0xdfa3('0xe'));var toCsv=require(_0xdfa3('0x7'));var querystring=require(_0xdfa3('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdfa3('0x10'));var qs=require(_0xdfa3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xdfa3('0x12'));var config=require(_0xdfa3('0x13'));var licenseUtil=require(_0xdfa3('0x14'));var db=require(_0xdfa3('0x15'))['db'];var dbH=require(_0xdfa3('0x15'))['dbH'];function respondWithStatusCode(_0x1bb84c,_0x5c4afa){_0x5c4afa=_0x5c4afa||0xcc;return function(_0x5982d9){if(_0x5982d9){return _0x1bb84c[_0xdfa3('0x16')](_0x5c4afa);}return _0x1bb84c[_0xdfa3('0x17')](_0x5c4afa)[_0xdfa3('0x18')]();};}function respondWithResult(_0x12951e,_0x4cbe2b){_0x4cbe2b=_0x4cbe2b||0xc8;return function(_0x442882){if(_0x442882){return _0x12951e[_0xdfa3('0x17')](_0x4cbe2b)[_0xdfa3('0x19')](_0x442882);}};}function respondWithFilteredResult(_0x39ef56,_0x332055){return function(_0x113c9a){if(_0x113c9a){var _0x53141c=typeof _0x332055[_0xdfa3('0x1a')]===_0xdfa3('0x1b')&&typeof _0x332055[_0xdfa3('0x1c')]===_0xdfa3('0x1b');var _0x5b2023=_0x113c9a[_0xdfa3('0x1d')];var _0x127e31=_0x53141c?0x0:_0x332055[_0xdfa3('0x1a')];var _0x51ee97=_0x53141c?_0x113c9a[_0xdfa3('0x1d')]:_0x332055[_0xdfa3('0x1a')]+_0x332055['limit'];var _0x452077;if(_0x51ee97>=_0x5b2023){_0x51ee97=_0x5b2023;_0x452077=0xc8;}else{_0x452077=0xce;}_0x39ef56[_0xdfa3('0x17')](_0x452077);return _0x39ef56[_0xdfa3('0x1e')](_0xdfa3('0x1f'),_0x127e31+'-'+_0x51ee97+'/'+_0x5b2023)['json'](_0x113c9a);}return null;};}function patchUpdates(_0x1f99f9){return function(_0x4d0468){try{jsonpatch[_0xdfa3('0x20')](_0x4d0468,_0x1f99f9,!![]);}catch(_0x54e1d5){return BPromise[_0xdfa3('0x21')](_0x54e1d5);}return _0x4d0468[_0xdfa3('0x22')]();};}function saveUpdates(_0xfcbddb,_0x53b589){return function(_0x3518bf){if(_0x3518bf){return _0x3518bf[_0xdfa3('0x23')](_0xfcbddb)[_0xdfa3('0x24')](function(_0x4ee0d6){return _0x4ee0d6;});}return null;};}function removeEntity(_0x48e71d,_0x1aee78){return function(_0x432a8e){if(_0x432a8e){return _0x432a8e[_0xdfa3('0x25')]()['then'](function(){var _0x929ae4=_0x432a8e[_0xdfa3('0x26')]({'plain':!![]});var _0x4a0bc6=_0xdfa3('0x27');return db[_0xdfa3('0x28')][_0xdfa3('0x25')]({'where':{'type':_0x4a0bc6,'resourceId':_0x929ae4['id']}})['then'](function(){return _0x432a8e;});})[_0xdfa3('0x24')](function(){_0x48e71d['status'](0xcc)[_0xdfa3('0x18')]();});}};}function handleEntityNotFound(_0x5b0a2d,_0x296286){return function(_0x18099a){if(!_0x18099a){_0x5b0a2d['sendStatus'](0x194);}return _0x18099a;};}function handleError(_0x150cbb,_0x29f2c6){_0x29f2c6=_0x29f2c6||0x1f4;return function(_0x53c300){logger[_0xdfa3('0x29')](_0x53c300[_0xdfa3('0x2a')]);if(_0x53c300[_0xdfa3('0x2b')]){delete _0x53c300[_0xdfa3('0x2b')];}_0x150cbb[_0xdfa3('0x17')](_0x29f2c6)[_0xdfa3('0x2c')](_0x53c300);};}exports[_0xdfa3('0x2d')]=function(_0x5337f5,_0xa3c01b){var _0x4e36e3={},_0x5df748={},_0x4ae72b={'count':0x0,'rows':[]};var _0x50105e=_[_0xdfa3('0x2e')](db['AnalyticCustomReport'][_0xdfa3('0x2f')],function(_0x429608){return{'name':_0x429608[_0xdfa3('0x30')],'type':_0x429608[_0xdfa3('0x31')]['key']};});_0x5df748[_0xdfa3('0x32')]=_['map'](_0x50105e,'name');_0x5df748[_0xdfa3('0x33')]=_[_0xdfa3('0x34')](_0x5337f5[_0xdfa3('0x33')]);_0x5df748[_0xdfa3('0x35')]=_[_0xdfa3('0x36')](_0x5df748[_0xdfa3('0x32')],_0x5df748['query']);_0x4e36e3[_0xdfa3('0x37')]=_[_0xdfa3('0x36')](_0x5df748[_0xdfa3('0x32')],qs[_0xdfa3('0x38')](_0x5337f5[_0xdfa3('0x33')][_0xdfa3('0x38')]));_0x4e36e3[_0xdfa3('0x37')]=_0x4e36e3['attributes'][_0xdfa3('0x39')]?_0x4e36e3['attributes']:_0x5df748[_0xdfa3('0x32')];if(!_0x5337f5[_0xdfa3('0x33')]['hasOwnProperty'](_0xdfa3('0x3a'))){_0x4e36e3[_0xdfa3('0x1c')]=qs[_0xdfa3('0x1c')](_0x5337f5[_0xdfa3('0x33')][_0xdfa3('0x1c')]);_0x4e36e3['offset']=qs[_0xdfa3('0x1a')](_0x5337f5[_0xdfa3('0x33')][_0xdfa3('0x1a')]);}_0x4e36e3[_0xdfa3('0x3b')]=qs['sort'](_0x5337f5[_0xdfa3('0x33')][_0xdfa3('0x3c')]);_0x4e36e3[_0xdfa3('0x3d')]=qs[_0xdfa3('0x35')](_[_0xdfa3('0x3e')](_0x5337f5[_0xdfa3('0x33')],_0x5df748['filters']),_0x50105e);if(_0x5337f5[_0xdfa3('0x33')][_0xdfa3('0x3f')]){_0x4e36e3[_0xdfa3('0x3d')]=_[_0xdfa3('0x40')](_0x4e36e3[_0xdfa3('0x3d')],{'$or':_[_0xdfa3('0x2e')](_0x50105e,function(_0x3540ba){if(_0x3540ba['type']!==_0xdfa3('0x41')){var _0x93dd1a={};_0x93dd1a[_0x3540ba[_0xdfa3('0x2b')]]={'$like':'%'+_0x5337f5['query'][_0xdfa3('0x3f')]+'%'};return _0x93dd1a;}})});}_0x4e36e3=_['merge']({},_0x4e36e3,_0x5337f5[_0xdfa3('0x42')]);var _0x4d23f6={'where':_0x4e36e3['where']};return db[_0xdfa3('0x43')][_0xdfa3('0x1d')](_0x4d23f6)[_0xdfa3('0x24')](function(_0x49aad8){_0x4ae72b[_0xdfa3('0x1d')]=_0x49aad8;if(_0x5337f5[_0xdfa3('0x33')][_0xdfa3('0x44')]){_0x4e36e3[_0xdfa3('0x45')]=[{'all':!![]}];}return db[_0xdfa3('0x43')]['findAll'](_0x4e36e3);})['then'](function(_0x191792){_0x4ae72b[_0xdfa3('0x46')]=_0x191792;return _0x4ae72b;})[_0xdfa3('0x24')](respondWithFilteredResult(_0xa3c01b,_0x4e36e3))[_0xdfa3('0x47')](handleError(_0xa3c01b,null));};exports[_0xdfa3('0x48')]=function(_0x292378,_0x1f7449){var _0x17fd30={'raw':![],'where':{'id':_0x292378['params']['id']}},_0x17dca6={};_0x17dca6[_0xdfa3('0x32')]=_[_0xdfa3('0x34')](db[_0xdfa3('0x43')][_0xdfa3('0x2f')]);_0x17dca6[_0xdfa3('0x33')]=_['keys'](_0x292378['query']);_0x17dca6[_0xdfa3('0x35')]=_['intersection'](_0x17dca6['model'],_0x17dca6[_0xdfa3('0x33')]);_0x17fd30[_0xdfa3('0x37')]=_[_0xdfa3('0x36')](_0x17dca6[_0xdfa3('0x32')],qs[_0xdfa3('0x38')](_0x292378[_0xdfa3('0x33')][_0xdfa3('0x38')]));_0x17fd30[_0xdfa3('0x37')]=_0x17fd30[_0xdfa3('0x37')][_0xdfa3('0x39')]?_0x17fd30['attributes']:_0x17dca6[_0xdfa3('0x32')];if(_0x292378['query'][_0xdfa3('0x44')]){_0x17fd30[_0xdfa3('0x45')]=[{'all':!![]}];}_0x17fd30=_[_0xdfa3('0x40')]({},_0x17fd30,_0x292378[_0xdfa3('0x42')]);return db[_0xdfa3('0x43')][_0xdfa3('0x49')](_0x17fd30)[_0xdfa3('0x24')](handleEntityNotFound(_0x1f7449,null))['then'](respondWithResult(_0x1f7449,null))[_0xdfa3('0x47')](handleError(_0x1f7449,null));};exports[_0xdfa3('0x4a')]=function(_0x162d31,_0x5228f6){return db['AnalyticCustomReport']['create'](_0x162d31[_0xdfa3('0x4b')],{})[_0xdfa3('0x24')](function(_0x90c2b7){var _0x5d2f51=_0x162d31[_0xdfa3('0x4c')][_0xdfa3('0x26')]({'plain':!![]});if(!_0x5d2f51)throw new Error(_0xdfa3('0x4d'));if(_0x5d2f51[_0xdfa3('0x4e')]===_0xdfa3('0x4c')){var _0x3b6651=_0x90c2b7['get']({'plain':!![]});var _0x257986=_0xdfa3('0x4f');return db['UserProfileSection']['find']({'where':{'name':_0x257986,'userProfileId':_0x5d2f51[_0xdfa3('0x50')]},'raw':!![]})[_0xdfa3('0x24')](function(_0x2c7ae2){if(_0x2c7ae2&&_0x2c7ae2['autoAssociation']===0x0){return db[_0xdfa3('0x28')][_0xdfa3('0x4a')]({'name':_0x3b6651[_0xdfa3('0x2b')],'resourceId':_0x3b6651['id'],'type':_0xdfa3('0x27'),'sectionId':_0x2c7ae2['id']},{})[_0xdfa3('0x24')](function(){return _0x90c2b7;});}else{return _0x90c2b7;}})['catch'](function(_0x156875){logger[_0xdfa3('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x156875);throw _0x156875;});}return _0x90c2b7;})[_0xdfa3('0x24')](respondWithResult(_0x5228f6,0xc9))[_0xdfa3('0x47')](handleError(_0x5228f6,null));};exports[_0xdfa3('0x23')]=function(_0x35530c,_0x264b19){if(_0x35530c[_0xdfa3('0x4b')]['id']){delete _0x35530c[_0xdfa3('0x4b')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x35530c['params']['id']}})[_0xdfa3('0x24')](handleEntityNotFound(_0x264b19,null))[_0xdfa3('0x24')](saveUpdates(_0x35530c[_0xdfa3('0x4b')],null))[_0xdfa3('0x24')](respondWithResult(_0x264b19,null))['catch'](handleError(_0x264b19,null));};exports[_0xdfa3('0x25')]=function(_0x551bf5,_0x29475e){return db[_0xdfa3('0x43')][_0xdfa3('0x49')]({'where':{'id':_0x551bf5['params']['id']}})['then'](handleEntityNotFound(_0x29475e,null))[_0xdfa3('0x24')](removeEntity(_0x29475e,null))['catch'](handleError(_0x29475e,null));};exports[_0xdfa3('0x51')]=function(_0x5e8e8a,_0x35789b){var _0x42e6a1=0xa;var _0x1f85da=[_0xdfa3('0x52'),_0xdfa3('0x53'),_0xdfa3('0x54'),_0xdfa3('0x55')];var _0x484060={'SUM':'SUM(%s)','COUNT':_0xdfa3('0x56'),'COUNT DISTINCT':_0xdfa3('0x57'),'MAX':_0xdfa3('0x58'),'MIN':_0xdfa3('0x59'),'AVG':_0xdfa3('0x5a'),'GROUP_CONCAT':_0xdfa3('0x5b'),'GROUP_CONCAT ASC':_0xdfa3('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5cdc3d={'SEC_TO_TIME':_0xdfa3('0x5d'),'DATE':'DATE(%s)','HOUR':_0xdfa3('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xdfa3('0x5f')};var _0x53b5b4=function(_0x5daac2){return!_[_0xdfa3('0x60')]([_0xdfa3('0x61'),_0xdfa3('0x62'),_0xdfa3('0x63'),_0xdfa3('0x64')],_0x5daac2);};var _0x551c90=function(_0x5e5843){if(!_0x5e5843||!_0x5e5843[_0xdfa3('0x65')]['length']){return'';}for(var _0x21ddeb='(',_0x5d2d98=0x0;_0x5d2d98<_0x5e5843[_0xdfa3('0x65')][_0xdfa3('0x39')];_0x5d2d98+=0x1){_0x5d2d98>0x0&&(_0x21ddeb+='\x20'+_0x5e5843['operator']+'\x20');_0x21ddeb+=_0x5e5843[_0xdfa3('0x65')][_0x5d2d98][_0xdfa3('0x66')]?_0x551c90(_0x5e5843[_0xdfa3('0x65')][_0x5d2d98][_0xdfa3('0x66')]):_0x5e5843[_0xdfa3('0x65')][_0x5d2d98]['field']+'\x20'+_0x5e5843[_0xdfa3('0x65')][_0x5d2d98][_0xdfa3('0x67')]+(_0x53b5b4(_0x5e5843[_0xdfa3('0x65')][_0x5d2d98][_0xdfa3('0x67')])?'\x20'+_0x5e5843['rules'][_0x5d2d98][_0xdfa3('0x68')]:'');}return _0x21ddeb+')';};var _0x3db12c={'where':{'id':_0x5e8e8a[_0xdfa3('0x69')]['id']}},_0x2879ce,_0x53f7d7,_0x2998a,_0x374b9c,_0x350ee5;_0x3db12c=_[_0xdfa3('0x40')]({},_0x3db12c,_0x5e8e8a[_0xdfa3('0x42')]);return db[_0xdfa3('0x43')][_0xdfa3('0x49')](_0x3db12c)[_0xdfa3('0x24')](function(_0x41b18d){if(_0x41b18d){_0x2879ce=_0x41b18d;return _0x41b18d[_0xdfa3('0x6a')]();}return null;})[_0xdfa3('0x24')](function(_0x324f2a){if(_0x324f2a){if(!_0x324f2a[_0xdfa3('0x39')]){throw new db[(_0xdfa3('0x6b'))]['ValidationErrorItem'](_0xdfa3('0x6c'),0x193);}_0x53f7d7=_0x324f2a;return db[_0xdfa3('0x6d')][_0xdfa3('0x6e')]({'raw':!![]});}return null;})[_0xdfa3('0x24')](function(_0x1f9061){if(_0x1f9061){_0x2998a=_[_0xdfa3('0x6f')](_0x1f9061,'id');var _0x24d5b1;var _0x18d2a4=squel[_0xdfa3('0x70')]();_0x18d2a4[_0xdfa3('0x71')](_0x2879ce[_0xdfa3('0x72')]);for(var _0x56f389=0x0;_0x56f389<_0x53f7d7[_0xdfa3('0x39')];_0x56f389+=0x1){_0x24d5b1=_0x53f7d7[_0x56f389][_0xdfa3('0x73')]?_0x2998a[_0x53f7d7[_0x56f389]['MetricId']]['metric']:_0x53f7d7[_0x56f389][_0xdfa3('0x74')];_0x24d5b1=_0x53f7d7[_0x56f389][_0xdfa3('0x75')]?_[_0xdfa3('0x76')](_0x484060[_0x53f7d7[_0x56f389]['function']],'%s',_0x24d5b1):_0x24d5b1;_0x24d5b1=_0x53f7d7[_0x56f389]['format']?_[_0xdfa3('0x76')](_0x5cdc3d[_0x53f7d7[_0x56f389]['format']],'%s',_0x24d5b1):_0x24d5b1;if(_0x53f7d7[_0x56f389]['groupBy']){_0x18d2a4[_0xdfa3('0x66')](_0x24d5b1);}_0x53f7d7[_0x56f389][_0xdfa3('0x77')]&&_0x18d2a4[_0xdfa3('0x3b')](_0x24d5b1,_0x53f7d7[_0x56f389][_0xdfa3('0x77')]==='DESC'?![]:!![]);_0x18d2a4[_0xdfa3('0x74')](_0x24d5b1,_0x53f7d7[_0x56f389][_0xdfa3('0x78')]||_0x24d5b1);}if(_0x2879ce[_0xdfa3('0x79')]){_0x2879ce[_0xdfa3('0x79')]=JSON[_0xdfa3('0x7a')](_0x2879ce[_0xdfa3('0x79')]);for(var _0x60cb52=0x0;_0x60cb52<_0x2879ce[_0xdfa3('0x79')][_0xdfa3('0x39')];_0x60cb52+=0x1){if(_0x2879ce[_0xdfa3('0x79')][_0x60cb52][_0xdfa3('0x31')]&&_['includes'](_0x1f85da,_0x2879ce['joins'][_0x60cb52][_0xdfa3('0x31')])&&_0x2879ce[_0xdfa3('0x79')][_0x60cb52][_0xdfa3('0x7b')]&&_0x2879ce[_0xdfa3('0x79')][_0x60cb52][_0xdfa3('0x7c')]&&_0x2879ce['joins'][_0x60cb52][_0xdfa3('0x7d')]){_0x18d2a4[_0x2879ce['joins'][_0x60cb52][_0xdfa3('0x31')]](_0x2879ce[_0xdfa3('0x79')][_0x60cb52][_0xdfa3('0x7c')],null,util[_0xdfa3('0x7e')](_0xdfa3('0x7f'),_0x2879ce['table'],_0x2879ce[_0xdfa3('0x79')][_0x60cb52]['parentKey'],_0x2879ce['joins'][_0x60cb52][_0xdfa3('0x7c')],_0x2879ce[_0xdfa3('0x79')][_0x60cb52][_0xdfa3('0x7d')]));}}}if(_0x2879ce['conditions']){_0x2879ce[_0xdfa3('0x80')]=JSON[_0xdfa3('0x7a')](_0x2879ce[_0xdfa3('0x80')]);_0x18d2a4[_0xdfa3('0x3d')](_0x551c90(_0x2879ce[_0xdfa3('0x80')][_0xdfa3('0x66')]));}_0x350ee5=_0x18d2a4[_0xdfa3('0x81')]();_0x18d2a4[_0xdfa3('0x1c')](_0x42e6a1);_0x18d2a4[_0xdfa3('0x1a')](0x0);logger[_0xdfa3('0x82')](_0xdfa3('0x83'),_0x18d2a4['toString']());return dbH[_0xdfa3('0x84')][_0xdfa3('0x33')](_0x18d2a4['toString'](),{'type':dbH[_0xdfa3('0x84')][_0xdfa3('0x85')][_0xdfa3('0x86')]});}})[_0xdfa3('0x24')](respondWithResult(_0x35789b,null))[_0xdfa3('0x47')](handleError(_0x35789b,null));};function runReport(_0x2a441f,_0xa286e5,_0x6884c4){var _0x4a88ee=_0xa286e5[_0xdfa3('0x2b')];var _0x25bc84=0xa;var _0x373928=[_0xdfa3('0x52'),'left_join',_0xdfa3('0x54'),_0xdfa3('0x55')];var _0x5cb017={'SUM':_0xdfa3('0x87'),'COUNT':_0xdfa3('0x56'),'COUNT DISTINCT':_0xdfa3('0x57'),'MAX':_0xdfa3('0x58'),'MIN':_0xdfa3('0x59'),'AVG':_0xdfa3('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xdfa3('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1cddeb={'SEC_TO_TIME':_0xdfa3('0x5d'),'DATE':_0xdfa3('0x88'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xdfa3('0x5f')};var _0x2fe500=function(_0xe8523f){return!_[_0xdfa3('0x60')]([_0xdfa3('0x61'),_0xdfa3('0x62'),_0xdfa3('0x63'),_0xdfa3('0x64')],_0xe8523f);};var _0x39e688=function(_0x59f9ae){if(!_0x59f9ae||!_0x59f9ae[_0xdfa3('0x65')][_0xdfa3('0x39')]){return'';}for(var _0x1eec95='(',_0x354fc4=0x0;_0x354fc4<_0x59f9ae[_0xdfa3('0x65')][_0xdfa3('0x39')];_0x354fc4+=0x1){_0x354fc4>0x0&&(_0x1eec95+='\x20'+_0x59f9ae[_0xdfa3('0x89')]+'\x20');_0x1eec95+=_0x59f9ae[_0xdfa3('0x65')][_0x354fc4]['group']?_0x39e688(_0x59f9ae[_0xdfa3('0x65')][_0x354fc4][_0xdfa3('0x66')]):_0x59f9ae['rules'][_0x354fc4][_0xdfa3('0x74')]+'\x20'+_0x59f9ae[_0xdfa3('0x65')][_0x354fc4][_0xdfa3('0x67')]+(_0x2fe500(_0x59f9ae[_0xdfa3('0x65')][_0x354fc4][_0xdfa3('0x67')])?'\x20'+_0x59f9ae[_0xdfa3('0x65')][_0x354fc4]['value']:'');}return _0x1eec95+')';};var _0x404ae7={'where':{'id':_0x2a441f['id']}},_0x4af565,_0x5281bc,_0x46a623,_0x19c34e,_0x288326;_0x404ae7=_['merge']({},_0x404ae7,_0x6884c4);return db['AnalyticCustomReport'][_0xdfa3('0x49')](_0x404ae7)[_0xdfa3('0x24')](function(_0xe3906d){if(_0xe3906d){_0x4af565=_0xe3906d;return _0xe3906d[_0xdfa3('0x6a')]();}return null;})[_0xdfa3('0x24')](function(_0x5ba177){if(_0x5ba177){if(!_0x5ba177[_0xdfa3('0x39')]){throw new db[(_0xdfa3('0x6b'))][(_0xdfa3('0x8a'))](_0xdfa3('0x6c'),0x193);}_0x5281bc=_0x5ba177;return db[_0xdfa3('0x6d')][_0xdfa3('0x6e')]({'raw':!![]});}return null;})[_0xdfa3('0x24')](function(_0x191a6c){if(_0x191a6c){_0x46a623=_[_0xdfa3('0x6f')](_0x191a6c,'id');var _0x5af3a8;var _0x35393b=squel['select']();_0x35393b[_0xdfa3('0x71')](_0x4af565[_0xdfa3('0x72')]);for(var _0xfb4cc1=0x0;_0xfb4cc1<_0x5281bc[_0xdfa3('0x39')];_0xfb4cc1+=0x1){_0x5af3a8=_0x5281bc[_0xfb4cc1][_0xdfa3('0x73')]?_0x46a623[_0x5281bc[_0xfb4cc1][_0xdfa3('0x73')]][_0xdfa3('0x8b')]:_0x5281bc[_0xfb4cc1][_0xdfa3('0x74')];_0x5af3a8=_0x5281bc[_0xfb4cc1][_0xdfa3('0x75')]?_[_0xdfa3('0x76')](_0x5cb017[_0x5281bc[_0xfb4cc1][_0xdfa3('0x75')]],'%s',_0x5af3a8):_0x5af3a8;_0x5af3a8=_0x5281bc[_0xfb4cc1]['format']?_['replace'](_0x1cddeb[_0x5281bc[_0xfb4cc1]['format']],'%s',_0x5af3a8):_0x5af3a8;if(_0x5281bc[_0xfb4cc1][_0xdfa3('0x8c')]){_0x35393b['group'](_0x5af3a8);}_0x5281bc[_0xfb4cc1]['orderBy']&&_0x35393b['order'](_0x5af3a8,_0x5281bc[_0xfb4cc1][_0xdfa3('0x77')]===_0xdfa3('0x8d')?![]:!![]);_0x35393b[_0xdfa3('0x74')](_0x5af3a8,_0x5281bc[_0xfb4cc1]['alias']||_0x5af3a8);}if(_0x4af565[_0xdfa3('0x79')]){_0x4af565['joins']=JSON[_0xdfa3('0x7a')](_0x4af565['joins']);for(var _0x44ae9c=0x0;_0x44ae9c<_0x4af565['joins'][_0xdfa3('0x39')];_0x44ae9c+=0x1){if(_0x4af565[_0xdfa3('0x79')][_0x44ae9c][_0xdfa3('0x31')]&&_[_0xdfa3('0x60')](_0x373928,_0x4af565[_0xdfa3('0x79')][_0x44ae9c][_0xdfa3('0x31')])&&_0x4af565['joins'][_0x44ae9c][_0xdfa3('0x7b')]&&_0x4af565[_0xdfa3('0x79')][_0x44ae9c][_0xdfa3('0x7c')]&&_0x4af565[_0xdfa3('0x79')][_0x44ae9c][_0xdfa3('0x7d')]){_0x35393b[_0x4af565['joins'][_0x44ae9c]['type']](_0x4af565[_0xdfa3('0x79')][_0x44ae9c][_0xdfa3('0x7c')],null,util[_0xdfa3('0x7e')](_0xdfa3('0x7f'),_0x4af565['table'],_0x4af565[_0xdfa3('0x79')][_0x44ae9c][_0xdfa3('0x7b')],_0x4af565[_0xdfa3('0x79')][_0x44ae9c][_0xdfa3('0x7c')],_0x4af565[_0xdfa3('0x79')][_0x44ae9c][_0xdfa3('0x7d')]));}}}if(_0x4af565[_0xdfa3('0x80')]){_0x4af565[_0xdfa3('0x80')]=JSON[_0xdfa3('0x7a')](_0x4af565[_0xdfa3('0x80')]);_0x35393b['where'](_0x39e688(_0x4af565['conditions'][_0xdfa3('0x66')]));}_0x288326=_0x35393b[_0xdfa3('0x81')]();_0x35393b[_0xdfa3('0x1c')](_0x25bc84);_0x35393b['offset'](0x0);return;}})[_0xdfa3('0x24')](function(){if(_0xa286e5['output']==='web'){return null;}var _0x147211=_[_0xdfa3('0x40')](_0xa286e5,{'name':_0xa286e5[_0xdfa3('0x8e')]||_0xa286e5[_0xdfa3('0x2b')]||_0x4af565[_0xdfa3('0x2b')],'basename':_0x4a88ee,'savename':util[_0xdfa3('0x7e')](_0xdfa3('0x8f'),_0xa286e5[_0xdfa3('0x2b')]||_0x4af565['name'],require(_0xdfa3('0x90'))[_0xdfa3('0x91')](0x4),_0xa286e5['output']||_0xdfa3('0x92')),'reportId':_0x4af565['id'],'reportType':_0xdfa3('0x93')});return db[_0xdfa3('0x94')][_0xdfa3('0x4a')](_0x147211,{'raw':!![]});})[_0xdfa3('0x24')](function(_0x3b8de6){if(_0x4af565[_0xdfa3('0x72')]===_0xdfa3('0x95')){_0x288326[_0xdfa3('0x3d')](_0x4af565[_0xdfa3('0x72')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xa286e5['startDate'],_0xa286e5['endDate']);}else{_0x288326[_0xdfa3('0x3d')](_0x4af565[_0xdfa3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xa286e5[_0xdfa3('0x96')],_0xa286e5['endDate']);}if(_0x3b8de6){logger[_0xdfa3('0x97')](_0xdfa3('0x98'),_0x288326[_0xdfa3('0x99')]());require(_0xdfa3('0x9a'))[_0xdfa3('0x9b')](path['join'](__dirname,_0xdfa3('0x9c'),_0x3b8de6[_0xdfa3('0x9d')]),[_0x3b8de6['id'],_0x288326[_0xdfa3('0x99')](),path[_0xdfa3('0x52')](__dirname,_0xdfa3('0x9e'),_0x3b8de6[_0xdfa3('0x9f')]),_0x4a88ee]);return _0x3b8de6;}else{var _0x1fc502=squel[_0xdfa3('0x70')]();_0x1fc502[_0xdfa3('0x71')]('('+_0x288326[_0xdfa3('0x99')]()+')',_0xdfa3('0xa0'));_0x1fc502[_0xdfa3('0x74')]('COUNT(*)','count');_0x288326[_0xdfa3('0x1c')](_0xa286e5[_0xdfa3('0x1c')]||_0x25bc84);_0x288326[_0xdfa3('0x1a')](_0xa286e5[_0xdfa3('0x1a')]||0x0);return dbH['sequelize'][_0xdfa3('0x33')](_0x1fc502['toString'](),{'type':dbH[_0xdfa3('0x84')][_0xdfa3('0x85')][_0xdfa3('0x86')]})[_0xdfa3('0x24')](function(_0x495c58){if(!_0x495c58[_0xdfa3('0x39')]){_0x19c34e=0x0;}else{_0x19c34e=_0x495c58[0x0][_0xdfa3('0x1d')]||0x0;}return dbH[_0xdfa3('0x84')][_0xdfa3('0x33')](_0x288326[_0xdfa3('0x99')](),{'type':dbH[_0xdfa3('0x84')][_0xdfa3('0x85')]['SELECT']});})[_0xdfa3('0x24')](function(_0x558f2d){return{'rows':_0x558f2d||[],'count':_0x19c34e};});}});}exports[_0xdfa3('0xa1')]=function(_0x1ea4bb,_0x4e4ad3){return runReport(_0x1ea4bb[_0xdfa3('0x69')],_0x1ea4bb[_0xdfa3('0x33')],_0x1ea4bb[_0xdfa3('0x42')])[_0xdfa3('0x24')](respondWithResult(_0x4e4ad3,null))[_0xdfa3('0x47')](handleError(_0x4e4ad3,null));};exports['runReport']=runReport;exports[_0xdfa3('0x33')]=function(_0x2843b7,_0x23d8d3){var _0x1e7f48=0xa;var _0x2a9b7f=[_0xdfa3('0x52'),_0xdfa3('0x53'),'right_join','cross_join'];var _0xddc83d={'SUM':'SUM(%s)','COUNT':_0xdfa3('0x56'),'COUNT DISTINCT':_0xdfa3('0x57'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xdfa3('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xdfa3('0xa2')};var _0x2f2e7e={'SEC_TO_TIME':_0xdfa3('0x5d'),'DATE':_0xdfa3('0x88'),'HOUR':_0xdfa3('0x5e'),'ROUND':_0xdfa3('0xa3'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2e1467=function(_0x15b62c){return!_[_0xdfa3('0x60')]([_0xdfa3('0x61'),_0xdfa3('0x62'),_0xdfa3('0x63'),'IS\x20NOT\x20EMPTY'],_0x15b62c);};var _0x256813=function(_0x7b800){if(!_0x7b800||!_0x7b800['rules'][_0xdfa3('0x39')]){return'';}for(var _0x46397b='(',_0x3dee98=0x0;_0x3dee98<_0x7b800[_0xdfa3('0x65')][_0xdfa3('0x39')];_0x3dee98+=0x1){_0x3dee98>0x0&&(_0x46397b+='\x20'+_0x7b800[_0xdfa3('0x89')]+'\x20');_0x46397b+=_0x7b800[_0xdfa3('0x65')][_0x3dee98][_0xdfa3('0x66')]?_0x256813(_0x7b800[_0xdfa3('0x65')][_0x3dee98]['group']):_0x7b800[_0xdfa3('0x65')][_0x3dee98][_0xdfa3('0x74')]+'\x20'+_0x7b800[_0xdfa3('0x65')][_0x3dee98][_0xdfa3('0x67')]+(_0x2e1467(_0x7b800[_0xdfa3('0x65')][_0x3dee98]['condition'])?'\x20'+_0x7b800[_0xdfa3('0x65')][_0x3dee98][_0xdfa3('0x68')]:'');}return _0x46397b+')';};var _0x2ffaf4={'where':{'id':_0x2843b7[_0xdfa3('0x69')]['id']}},_0x3e96ad,_0x57aca2,_0x2c2c74,_0xfa7791,_0x360055;_0x2ffaf4=_[_0xdfa3('0x40')]({},_0x2ffaf4,_0x2843b7['options']);return db[_0xdfa3('0x43')][_0xdfa3('0x49')](_0x2ffaf4)[_0xdfa3('0x24')](function(_0x246a5f){if(_0x246a5f){_0x3e96ad=_0x246a5f;return _0x246a5f[_0xdfa3('0x6a')]();}return null;})[_0xdfa3('0x24')](function(_0x54ee73){if(_0x54ee73){if(!_0x54ee73[_0xdfa3('0x39')]){throw new db[(_0xdfa3('0x6b'))][(_0xdfa3('0x8a'))](_0xdfa3('0x6c'),0x193);}_0x57aca2=_0x54ee73;return db[_0xdfa3('0x6d')]['findAll']({'raw':!![]});}return null;})[_0xdfa3('0x24')](function(_0x1c2c3b){if(_0x1c2c3b){_0x2c2c74=_['keyBy'](_0x1c2c3b,'id');var _0x1cb5eb;var _0x33da85=squel[_0xdfa3('0x70')]();_0x33da85[_0xdfa3('0x71')](_0x3e96ad[_0xdfa3('0x72')]);for(var _0x3ea73c=0x0;_0x3ea73c<_0x57aca2[_0xdfa3('0x39')];_0x3ea73c+=0x1){_0x1cb5eb=_0x57aca2[_0x3ea73c][_0xdfa3('0x73')]?_0x2c2c74[_0x57aca2[_0x3ea73c]['MetricId']]['metric']:_0x57aca2[_0x3ea73c][_0xdfa3('0x74')];_0x1cb5eb=_0x57aca2[_0x3ea73c][_0xdfa3('0x75')]?_[_0xdfa3('0x76')](_0xddc83d[_0x57aca2[_0x3ea73c][_0xdfa3('0x75')]],'%s',_0x1cb5eb):_0x1cb5eb;_0x1cb5eb=_0x57aca2[_0x3ea73c]['format']?_[_0xdfa3('0x76')](_0x2f2e7e[_0x57aca2[_0x3ea73c][_0xdfa3('0x7e')]],'%s',_0x1cb5eb):_0x1cb5eb;if(_0x57aca2[_0x3ea73c][_0xdfa3('0x8c')]){_0x33da85[_0xdfa3('0x66')](_0x1cb5eb);}_0x57aca2[_0x3ea73c]['orderBy']&&_0x33da85[_0xdfa3('0x3b')](_0x1cb5eb,_0x57aca2[_0x3ea73c][_0xdfa3('0x77')]==='DESC'?![]:!![]);_0x33da85[_0xdfa3('0x74')](_0x1cb5eb,_0x57aca2[_0x3ea73c][_0xdfa3('0x78')]||_0x1cb5eb);}if(_0x3e96ad[_0xdfa3('0x79')]){_0x3e96ad[_0xdfa3('0x79')]=JSON[_0xdfa3('0x7a')](_0x3e96ad['joins']);for(var _0x168052=0x0;_0x168052<_0x3e96ad[_0xdfa3('0x79')]['length'];_0x168052+=0x1){if(_0x3e96ad[_0xdfa3('0x79')][_0x168052]['type']&&_[_0xdfa3('0x60')](_0x2a9b7f,_0x3e96ad[_0xdfa3('0x79')][_0x168052][_0xdfa3('0x31')])&&_0x3e96ad[_0xdfa3('0x79')][_0x168052][_0xdfa3('0x7b')]&&_0x3e96ad[_0xdfa3('0x79')][_0x168052][_0xdfa3('0x7c')]&&_0x3e96ad['joins'][_0x168052][_0xdfa3('0x7d')]){_0x33da85[_0x3e96ad[_0xdfa3('0x79')][_0x168052][_0xdfa3('0x31')]](_0x3e96ad[_0xdfa3('0x79')][_0x168052][_0xdfa3('0x7c')],null,util[_0xdfa3('0x7e')]('%s.%s\x20=\x20%s.%s',_0x3e96ad['table'],_0x3e96ad[_0xdfa3('0x79')][_0x168052][_0xdfa3('0x7b')],_0x3e96ad[_0xdfa3('0x79')][_0x168052][_0xdfa3('0x7c')],_0x3e96ad['joins'][_0x168052][_0xdfa3('0x7d')]));}}}if(_0x3e96ad[_0xdfa3('0x80')]){_0x3e96ad[_0xdfa3('0x80')]=JSON['parse'](_0x3e96ad['conditions']);_0x33da85[_0xdfa3('0x3d')](_0x256813(_0x3e96ad[_0xdfa3('0x80')][_0xdfa3('0x66')]));}_0x360055=_0x33da85[_0xdfa3('0x81')]();_0x33da85['limit'](_0x1e7f48);_0x33da85[_0xdfa3('0x1a')](0x0);logger[_0xdfa3('0x82')](_0xdfa3('0x83'),_0x33da85[_0xdfa3('0x99')]());return dbH[_0xdfa3('0x84')][_0xdfa3('0x33')](_0x33da85[_0xdfa3('0x99')](),{'type':dbH['sequelize'][_0xdfa3('0x85')]['SELECT']});}})['then'](function(){return{'sql':_0x360055[_0xdfa3('0x99')]()};})[_0xdfa3('0x24')](respondWithResult(_0x23d8d3,null))[_0xdfa3('0x47')](handleError(_0x23d8d3,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 78b1df0..1629f01 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 _0x44cd=['AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x21d94c,_0x564a82){var _0x4772dc=function(_0x4d8107){while(--_0x4d8107){_0x21d94c['push'](_0x21d94c['shift']());}};_0x4772dc(++_0x564a82);}(_0x44cd,0xde));var _0xd44c=function(_0x4c2623,_0x4838bb){_0x4c2623=_0x4c2623-0x0;var _0x2be431=_0x44cd[_0x4c2623];return _0x2be431;};'use strict';var _=require(_0xd44c('0x0'));var util=require('util');var logger=require(_0xd44c('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd44c('0x2'));var rp=require(_0xd44c('0x3'));var fs=require('fs');var path=require(_0xd44c('0x4'));var rimraf=require(_0xd44c('0x5'));var config=require(_0xd44c('0x6'));var attributes=require('./analyticCustomReport.attributes');module[_0xd44c('0x7')]=function(_0x3478d8,_0x1c5caf){return _0x3478d8['define'](_0xd44c('0x8'),attributes,{'tableName':_0xd44c('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x588e=['util','api','moment','bluebird','request-promise','rimraf','exports','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x588e,0x95));var _0xe588=function(_0x32b9c9,_0x5881e6){_0x32b9c9=_0x32b9c9-0x0;var _0x1a837f=_0x588e[_0x32b9c9];return _0x1a837f;};'use strict';var _=require(_0xe588('0x0'));var util=require(_0xe588('0x1'));var logger=require('../../config/logger')(_0xe588('0x2'));var moment=require(_0xe588('0x3'));var BPromise=require(_0xe588('0x4'));var rp=require(_0xe588('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe588('0x6'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0xe588('0x7')]=function(_0x40ef65,_0x1f8fcc){return _0x40ef65['define'](_0xe588('0x8'),attributes,{'tableName':_0xe588('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 3363988..01215da 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 _0x89f9=['jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2ca9d4,_0x51d5c6){var _0x258956=function(_0x47a0e5){while(--_0x47a0e5){_0x2ca9d4['push'](_0x2ca9d4['shift']());}};_0x258956(++_0x51d5c6);}(_0x89f9,0x19f));var _0x989f=function(_0x37f9ae,_0x577eaa){_0x37f9ae=_0x37f9ae-0x0;var _0x53fbb4=_0x89f9[_0x37f9ae];return _0x53fbb4;};'use strict';var _=require(_0x989f('0x0'));var util=require(_0x989f('0x1'));var moment=require(_0x989f('0x2'));var BPromise=require(_0x989f('0x3'));var rs=require(_0x989f('0x4'));var fs=require('fs');var Redis=require(_0x989f('0x5'));var db=require(_0x989f('0x6'))['db'];var utils=require(_0x989f('0x7'));var logger=require(_0x989f('0x8'))('rpc');var config=require(_0x989f('0x9'));var jayson=require(_0x989f('0xa'));var client=jayson[_0x989f('0xb')][_0x989f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x307247,_0x47d120,_0x2838cc){return new BPromise(function(_0x1e71b6,_0xb66a36){return client[_0x989f('0xd')](_0x307247,_0x2838cc)[_0x989f('0xe')](function(_0x30bf90){logger[_0x989f('0xf')](_0x989f('0x10'),_0x47d120,_0x989f('0x11'));logger[_0x989f('0x12')](_0x989f('0x13'),_0x47d120,_0x989f('0x11'),JSON[_0x989f('0x14')](_0x30bf90));if(_0x30bf90[_0x989f('0x15')]){if(_0x30bf90['error'][_0x989f('0x16')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x47d120,_0x30bf90['error'][_0x989f('0x17')]);return _0xb66a36(_0x30bf90['error'][_0x989f('0x17')]);}logger[_0x989f('0x15')](_0x989f('0x10'),_0x47d120,_0x30bf90[_0x989f('0x15')][_0x989f('0x17')]);return _0x1e71b6(_0x30bf90['error']['message']);}else{logger[_0x989f('0xf')](_0x989f('0x10'),_0x47d120,_0x989f('0x11'));_0x1e71b6(_0x30bf90[_0x989f('0x18')][_0x989f('0x17')]);}})['catch'](function(_0x291e61){logger['error'](_0x989f('0x10'),_0x47d120,_0x291e61);_0xb66a36(_0x291e61);});});}
\ No newline at end of file
+var _0x42f4=['info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x9e95a9,_0x1686b0){var _0x580883=function(_0x310407){while(--_0x310407){_0x9e95a9['push'](_0x9e95a9['shift']());}};_0x580883(++_0x1686b0);}(_0x42f4,0x13e));var _0x442f=function(_0x138836,_0x229129){_0x138836=_0x138836-0x0;var _0x322688=_0x42f4[_0x138836];return _0x322688;};'use strict';var _=require(_0x442f('0x0'));var util=require(_0x442f('0x1'));var moment=require(_0x442f('0x2'));var BPromise=require(_0x442f('0x3'));var rs=require(_0x442f('0x4'));var fs=require('fs');var Redis=require(_0x442f('0x5'));var db=require(_0x442f('0x6'))['db'];var utils=require(_0x442f('0x7'));var logger=require(_0x442f('0x8'))('rpc');var config=require(_0x442f('0x9'));var jayson=require(_0x442f('0xa'));var client=jayson['client'][_0x442f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a6c04,_0x173a42,_0x4a36dc){return new BPromise(function(_0x3a067b,_0x5a4516){return client['request'](_0x3a6c04,_0x4a36dc)['then'](function(_0xf10037){logger[_0x442f('0xc')](_0x442f('0xd'),_0x173a42,_0x442f('0xe'));logger[_0x442f('0xf')](_0x442f('0x10'),_0x173a42,_0x442f('0xe'),JSON[_0x442f('0x11')](_0xf10037));if(_0xf10037[_0x442f('0x12')]){if(_0xf10037[_0x442f('0x12')][_0x442f('0x13')]===0x1f4){logger[_0x442f('0x12')](_0x442f('0xd'),_0x173a42,_0xf10037[_0x442f('0x12')][_0x442f('0x14')]);return _0x5a4516(_0xf10037[_0x442f('0x12')][_0x442f('0x14')]);}logger[_0x442f('0x12')](_0x442f('0xd'),_0x173a42,_0xf10037[_0x442f('0x12')][_0x442f('0x14')]);return _0x3a067b(_0xf10037[_0x442f('0x12')][_0x442f('0x14')]);}else{logger[_0x442f('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x173a42,_0x442f('0xe'));_0x3a067b(_0xf10037['result'][_0x442f('0x14')]);}})[_0x442f('0x15')](function(_0x221ca3){logger[_0x442f('0x12')](_0x442f('0xd'),_0x173a42,_0x221ca3);_0x5a4516(_0x221ca3);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 702da56..4393437 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 _0x8a33=['isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id'];(function(_0x6c649c,_0x5a5c9e){var _0x28e9e8=function(_0x365f29){while(--_0x365f29){_0x6c649c['push'](_0x6c649c['shift']());}};_0x28e9e8(++_0x5a5c9e);}(_0x8a33,0xee));var _0x38a3=function(_0x443f79,_0x33e446){_0x443f79=_0x443f79-0x0;var _0x3847e4=_0x8a33[_0x443f79];return _0x3847e4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x38a3('0x0'));var timeout=require(_0x38a3('0x1'));var express=require(_0x38a3('0x2'));var router=express[_0x38a3('0x3')]();var fs_extra=require(_0x38a3('0x4'));var auth=require(_0x38a3('0x5'));var interaction=require(_0x38a3('0x6'));var config=require(_0x38a3('0x7'));var controller=require(_0x38a3('0x8'));router[_0x38a3('0x9')]('/',auth['isAuthenticated'](),controller[_0x38a3('0xa')]);router[_0x38a3('0x9')](_0x38a3('0xb'),auth[_0x38a3('0xc')](),controller[_0x38a3('0xd')]);router[_0x38a3('0x9')](_0x38a3('0xe'),auth['isAuthenticated'](),controller[_0x38a3('0xf')]);router[_0x38a3('0x9')](_0x38a3('0x10'),auth[_0x38a3('0xc')](),controller[_0x38a3('0x11')]);router[_0x38a3('0x9')](_0x38a3('0x12'),auth['isAuthenticated'](),controller[_0x38a3('0x13')]);router[_0x38a3('0x14')]('/',auth['isAuthenticated'](),controller[_0x38a3('0x15')]);router[_0x38a3('0x16')](_0x38a3('0xb'),auth[_0x38a3('0xc')](),controller[_0x38a3('0x17')]);router['delete']('/:id',auth[_0x38a3('0xc')](),controller['destroy']);module[_0x38a3('0x18')]=router;
\ No newline at end of file
+var _0x42a4=['index','/:id','preview','run','/:id/query','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated'];(function(_0x13ecf8,_0x3a9000){var _0x44d738=function(_0x403b9f){while(--_0x403b9f){_0x13ecf8['push'](_0x13ecf8['shift']());}};_0x44d738(++_0x3a9000);}(_0x42a4,0x1d9));var _0x442a=function(_0x3beea0,_0x416691){_0x3beea0=_0x3beea0-0x0;var _0x314eb1=_0x42a4[_0x3beea0];return _0x314eb1;};'use strict';var multer=require(_0x442a('0x0'));var util=require(_0x442a('0x1'));var path=require(_0x442a('0x2'));var timeout=require(_0x442a('0x3'));var express=require(_0x442a('0x4'));var router=express['Router']();var fs_extra=require(_0x442a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x442a('0x6'));var config=require(_0x442a('0x7'));var controller=require(_0x442a('0x8'));router[_0x442a('0x9')]('/',auth[_0x442a('0xa')](),controller[_0x442a('0xb')]);router[_0x442a('0x9')](_0x442a('0xc'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/preview',auth[_0x442a('0xa')](),controller[_0x442a('0xd')]);router[_0x442a('0x9')]('/:id/run',auth[_0x442a('0xa')](),controller[_0x442a('0xe')]);router[_0x442a('0x9')](_0x442a('0xf'),auth['isAuthenticated'](),controller['query']);router[_0x442a('0x10')]('/',auth['isAuthenticated'](),controller[_0x442a('0x11')]);router[_0x442a('0x12')](_0x442a('0xc'),auth[_0x442a('0xa')](),controller[_0x442a('0x13')]);router[_0x442a('0x14')](_0x442a('0xc'),auth[_0x442a('0xa')](),controller['destroy']);module[_0x442a('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 6719bb3..c9403cb 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 _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x224ce8,_0x565691){var _0x5054a1=function(_0x5dde3f){while(--_0x5dde3f){_0x224ce8['push'](_0x224ce8['shift']());}};_0x5054a1(++_0x565691);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}};
\ No newline at end of file
+var _0xda19=['exports','STRING','TEXT'];(function(_0xa7a5d7,_0x539cf5){var _0x4030fb=function(_0x260552){while(--_0x260552){_0xa7a5d7['push'](_0xa7a5d7['shift']());}};_0x4030fb(++_0x539cf5);}(_0xda19,0xd5));var _0x9da1=function(_0x25c3b6,_0x33406a){_0x25c3b6=_0x25c3b6-0x0;var _0x49032e=_0xda19[_0x25c3b6];return _0x49032e;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 7be16a5..741fada 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 _0x326f=['order','orderBy','DESC','joins','foreignTable','foreignKey','parentKey','conditions','Limited\x20Query:','toString','sequelize','SELECT','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','UNIX_TIMESTAMP(%s)','operator','AnalyticMetric','select','from','function','parse','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','join','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','SEC_TO_TIME(%s)','debug','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','count','apply','update','then','get','DefaultReports','UserProfileResource','destroy','end','error','name','send','index','map','AnalyticDefaultReport','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','keys','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','left_join','right_join','cross_join','COUNT(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','table','MetricId','metric','format','replace','groupBy'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x326f,0xd1));var _0xf326=function(_0x1e6f3b,_0x58993b){_0x1e6f3b=_0x1e6f3b-0x0;var _0x577290=_0x326f[_0x1e6f3b];return _0x577290;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0xf326('0x17'))[_0xf326('0x18')];function respondWithStatusCode(_0x4b3966,_0x342fe5){_0x342fe5=_0x342fe5||0xcc;return function(_0x472632){if(_0x472632){return _0x4b3966[_0xf326('0x19')](_0x342fe5);}return _0x4b3966[_0xf326('0x1a')](_0x342fe5)['end']();};}function respondWithResult(_0x45c1b6,_0x5204ee){_0x5204ee=_0x5204ee||0xc8;return function(_0x54bd1a){if(_0x54bd1a){return _0x45c1b6[_0xf326('0x1a')](_0x5204ee)[_0xf326('0x1b')](_0x54bd1a);}};}function respondWithFilteredResult(_0x1f2e5a,_0xa63d1a){return function(_0x292f4b){if(_0x292f4b){var _0x287a2a=typeof _0xa63d1a[_0xf326('0x1c')]===_0xf326('0x1d')&&typeof _0xa63d1a['limit']===_0xf326('0x1d');var _0x453100=_0x292f4b[_0xf326('0x1e')];var _0x31ffb9=_0x287a2a?0x0:_0xa63d1a[_0xf326('0x1c')];var _0x311af0=_0x287a2a?_0x292f4b['count']:_0xa63d1a['offset']+_0xa63d1a['limit'];var _0x16e605;if(_0x311af0>=_0x453100){_0x311af0=_0x453100;_0x16e605=0xc8;}else{_0x16e605=0xce;}_0x1f2e5a[_0xf326('0x1a')](_0x16e605);return _0x1f2e5a['set']('Content-Range',_0x31ffb9+'-'+_0x311af0+'/'+_0x453100)[_0xf326('0x1b')](_0x292f4b);}return null;};}function patchUpdates(_0x4dfa76){return function(_0x5b6d3c){try{jsonpatch[_0xf326('0x1f')](_0x5b6d3c,_0x4dfa76,!![]);}catch(_0x18ead3){return BPromise['reject'](_0x18ead3);}return _0x5b6d3c['save']();};}function saveUpdates(_0x19b8ba,_0xb1efcf){return function(_0x5f21a2){if(_0x5f21a2){return _0x5f21a2[_0xf326('0x20')](_0x19b8ba)[_0xf326('0x21')](function(_0x43c53e){return _0x43c53e;});}return null;};}function removeEntity(_0x295752,_0x17c157){return function(_0x2049ec){if(_0x2049ec){return _0x2049ec['destroy']()['then'](function(){var _0x4f31f6=_0x2049ec[_0xf326('0x22')]({'plain':!![]});var _0x1a2c4e=_0xf326('0x23');return db[_0xf326('0x24')][_0xf326('0x25')]({'where':{'type':_0x1a2c4e,'resourceId':_0x4f31f6['id']}})[_0xf326('0x21')](function(){return _0x2049ec;});})['then'](function(){_0x295752[_0xf326('0x1a')](0xcc)[_0xf326('0x26')]();});}};}function handleEntityNotFound(_0x212d5d,_0x581531){return function(_0x1617d2){if(!_0x1617d2){_0x212d5d['sendStatus'](0x194);}return _0x1617d2;};}function handleError(_0x4a9abf,_0x6a8e89){_0x6a8e89=_0x6a8e89||0x1f4;return function(_0x1ae23a){logger[_0xf326('0x27')](_0x1ae23a['stack']);if(_0x1ae23a[_0xf326('0x28')]){delete _0x1ae23a[_0xf326('0x28')];}_0x4a9abf['status'](_0x6a8e89)[_0xf326('0x29')](_0x1ae23a);};}exports[_0xf326('0x2a')]=function(_0xd77aba,_0x18d110){var _0xa80156={},_0x269be9={},_0x161143={'count':0x0,'rows':[]};var _0x39a1e2=_[_0xf326('0x2b')](db[_0xf326('0x2c')]['rawAttributes'],function(_0x1035ed){return{'name':_0x1035ed[_0xf326('0x2d')],'type':_0x1035ed[_0xf326('0x2e')]['key']};});_0x269be9[_0xf326('0x2f')]=_[_0xf326('0x2b')](_0x39a1e2,_0xf326('0x28'));_0x269be9['query']=_['keys'](_0xd77aba[_0xf326('0x30')]);_0x269be9[_0xf326('0x31')]=_[_0xf326('0x32')](_0x269be9[_0xf326('0x2f')],_0x269be9[_0xf326('0x30')]);_0xa80156[_0xf326('0x33')]=_[_0xf326('0x32')](_0x269be9[_0xf326('0x2f')],qs['fields'](_0xd77aba[_0xf326('0x30')][_0xf326('0x34')]));_0xa80156['attributes']=_0xa80156[_0xf326('0x33')]['length']?_0xa80156[_0xf326('0x33')]:_0x269be9['model'];if(!_0xd77aba['query'][_0xf326('0x35')]('nolimit')){_0xa80156[_0xf326('0x36')]=qs['limit'](_0xd77aba[_0xf326('0x30')][_0xf326('0x36')]);_0xa80156[_0xf326('0x1c')]=qs['offset'](_0xd77aba[_0xf326('0x30')][_0xf326('0x1c')]);}_0xa80156['order']=qs[_0xf326('0x37')](_0xd77aba[_0xf326('0x30')][_0xf326('0x37')]);_0xa80156[_0xf326('0x38')]=qs['filters'](_[_0xf326('0x39')](_0xd77aba[_0xf326('0x30')],_0x269be9[_0xf326('0x31')]),_0x39a1e2);if(_0xd77aba[_0xf326('0x30')][_0xf326('0x3a')]){_0xa80156['where']=_[_0xf326('0x3b')](_0xa80156[_0xf326('0x38')],{'$or':_['map'](_0x39a1e2,function(_0x4dd361){if(_0x4dd361[_0xf326('0x2e')]!=='VIRTUAL'){var _0x55dfa8={};_0x55dfa8[_0x4dd361[_0xf326('0x28')]]={'$like':'%'+_0xd77aba['query'][_0xf326('0x3a')]+'%'};return _0x55dfa8;}})});}_0xa80156=_[_0xf326('0x3b')]({},_0xa80156,_0xd77aba[_0xf326('0x3c')]);var _0x39611e={'where':_0xa80156['where']};return db[_0xf326('0x2c')][_0xf326('0x1e')](_0x39611e)[_0xf326('0x21')](function(_0x365627){_0x161143[_0xf326('0x1e')]=_0x365627;if(_0xd77aba[_0xf326('0x30')][_0xf326('0x3d')]){_0xa80156[_0xf326('0x3e')]=[{'all':!![]}];}return db[_0xf326('0x2c')][_0xf326('0x3f')](_0xa80156);})[_0xf326('0x21')](function(_0x2bab13){_0x161143['rows']=_0x2bab13;return _0x161143;})[_0xf326('0x21')](respondWithFilteredResult(_0x18d110,_0xa80156))[_0xf326('0x40')](handleError(_0x18d110,null));};exports[_0xf326('0x41')]=function(_0x270288,_0x1dd262){var _0x1a2d0d={'raw':!![],'where':{'id':_0x270288[_0xf326('0x42')]['id']}},_0x4f4c51={};_0x4f4c51[_0xf326('0x2f')]=_['keys'](db[_0xf326('0x2c')][_0xf326('0x43')]);_0x4f4c51[_0xf326('0x30')]=_[_0xf326('0x44')](_0x270288[_0xf326('0x30')]);_0x4f4c51['filters']=_['intersection'](_0x4f4c51[_0xf326('0x2f')],_0x4f4c51[_0xf326('0x30')]);_0x1a2d0d['attributes']=_['intersection'](_0x4f4c51[_0xf326('0x2f')],qs[_0xf326('0x34')](_0x270288[_0xf326('0x30')]['fields']));_0x1a2d0d[_0xf326('0x33')]=_0x1a2d0d[_0xf326('0x33')][_0xf326('0x45')]?_0x1a2d0d[_0xf326('0x33')]:_0x4f4c51[_0xf326('0x2f')];if(_0x270288[_0xf326('0x30')][_0xf326('0x3d')]){_0x1a2d0d[_0xf326('0x3e')]=[{'all':!![]}];}_0x1a2d0d=_[_0xf326('0x3b')]({},_0x1a2d0d,_0x270288[_0xf326('0x3c')]);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x1a2d0d)[_0xf326('0x21')](handleEntityNotFound(_0x1dd262,null))[_0xf326('0x21')](respondWithResult(_0x1dd262,null))[_0xf326('0x40')](handleError(_0x1dd262,null));};exports['create']=function(_0x199f8b,_0x1b0e03){return db[_0xf326('0x2c')][_0xf326('0x47')](_0x199f8b['body'],{})[_0xf326('0x21')](function(_0x2f5511){var _0xca88e=_0x199f8b[_0xf326('0x48')]['get']({'plain':!![]});if(!_0xca88e)throw new Error(_0xf326('0x49'));if(_0xca88e[_0xf326('0x4a')]===_0xf326('0x48')){var _0x451ac7=_0x2f5511[_0xf326('0x22')]({'plain':!![]});var _0x4970fb='Reports';return db[_0xf326('0x4b')][_0xf326('0x46')]({'where':{'name':_0x4970fb,'userProfileId':_0xca88e[_0xf326('0x4c')]},'raw':!![]})['then'](function(_0x102fba){if(_0x102fba&&_0x102fba[_0xf326('0x4d')]===0x0){return db[_0xf326('0x24')]['create']({'name':_0x451ac7['name'],'resourceId':_0x451ac7['id'],'type':_0xf326('0x23'),'sectionId':_0x102fba['id']},{})['then'](function(){return _0x2f5511;});}else{return _0x2f5511;}})[_0xf326('0x40')](function(_0x554277){logger[_0xf326('0x27')](_0xf326('0x4e'),_0x554277);throw _0x554277;});}return _0x2f5511;})[_0xf326('0x21')](respondWithResult(_0x1b0e03,0xc9))[_0xf326('0x40')](handleError(_0x1b0e03,null));};exports[_0xf326('0x20')]=function(_0x35d3c8,_0x7f7ece){if(_0x35d3c8['body']['id']){delete _0x35d3c8[_0xf326('0x4f')]['id'];}return db[_0xf326('0x2c')][_0xf326('0x46')]({'where':{'id':_0x35d3c8['params']['id']}})[_0xf326('0x21')](handleEntityNotFound(_0x7f7ece,null))[_0xf326('0x21')](saveUpdates(_0x35d3c8[_0xf326('0x4f')],null))[_0xf326('0x21')](respondWithResult(_0x7f7ece,null))[_0xf326('0x40')](handleError(_0x7f7ece,null));};exports['destroy']=function(_0x161fb3,_0x21eac7){return db[_0xf326('0x2c')][_0xf326('0x46')]({'where':{'id':_0x161fb3['params']['id']}})[_0xf326('0x21')](handleEntityNotFound(_0x21eac7,null))[_0xf326('0x21')](removeEntity(_0x21eac7,null))[_0xf326('0x40')](handleError(_0x21eac7,null));};exports[_0xf326('0x50')]=function(_0x4d3b9e,_0x5be2b1){var _0x18b46e=0xa;var _0x44d2ed=['join',_0xf326('0x51'),_0xf326('0x52'),_0xf326('0x53')];var _0x1258d1={'SUM':'SUM(%s)','COUNT':_0xf326('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xf326('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':_0xf326('0x57'),'GROUP_CONCAT DESC':_0xf326('0x58')};var _0x4eef49={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf326('0x59'),'HOUR':_0xf326('0x5a'),'ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2759d7=function(_0x487020){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x487020);};var _0x18dbfc=function(_0x23a9e8){if(!_0x23a9e8||!_0x23a9e8[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x33f9dd='(',_0x33ffb8=0x0;_0x33ffb8<_0x23a9e8[_0xf326('0x61')][_0xf326('0x45')];_0x33ffb8+=0x1){_0x33ffb8>0x0&&(_0x33f9dd+='\x20'+_0x23a9e8['operator']+'\x20');_0x33f9dd+=_0x23a9e8[_0xf326('0x61')][_0x33ffb8]['group']?_0x18dbfc(_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x62')]):_0x23a9e8['rules'][_0x33ffb8][_0xf326('0x63')]+'\x20'+_0x23a9e8['rules'][_0x33ffb8][_0xf326('0x64')]+(_0x2759d7(_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x64')])?'\x20'+_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x65')]:'');}return _0x33f9dd+')';};var _0x51ff5e={'where':{'id':_0x4d3b9e[_0xf326('0x42')]['id']}},_0x4ec099,_0x1209ca,_0x32fe3a,_0x15a538,_0x21b3cc;_0x51ff5e=_['merge']({},_0x51ff5e,_0x4d3b9e[_0xf326('0x3c')]);return db[_0xf326('0x2c')]['find'](_0x51ff5e)['then'](function(_0x5b25ca){if(_0x5b25ca){_0x4ec099=_0x5b25ca;return _0x5b25ca[_0xf326('0x66')]();}return null;})[_0xf326('0x21')](function(_0x4150fa){if(_0x4150fa){if(!_0x4150fa[_0xf326('0x45')]){throw new db[(_0xf326('0x67'))][(_0xf326('0x68'))](_0xf326('0x69'),0x193);}_0x1209ca=_0x4150fa;return db['AnalyticMetric'][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x3c3379){if(_0x3c3379){_0x32fe3a=_[_0xf326('0x6a')](_0x3c3379,'id');var _0x58de1e;var _0x3717fe=squel['select']();_0x3717fe['from'](_0x4ec099[_0xf326('0x6b')]);for(var _0x540fa0=0x0;_0x540fa0<_0x1209ca[_0xf326('0x45')];_0x540fa0+=0x1){_0x58de1e=_0x1209ca[_0x540fa0][_0xf326('0x6c')]?_0x32fe3a[_0x1209ca[_0x540fa0][_0xf326('0x6c')]][_0xf326('0x6d')]:_0x1209ca[_0x540fa0][_0xf326('0x63')];_0x58de1e=_0x1209ca[_0x540fa0]['function']?_['replace'](_0x1258d1[_0x1209ca[_0x540fa0]['function']],'%s',_0x58de1e):_0x58de1e;_0x58de1e=_0x1209ca[_0x540fa0][_0xf326('0x6e')]?_[_0xf326('0x6f')](_0x4eef49[_0x1209ca[_0x540fa0][_0xf326('0x6e')]],'%s',_0x58de1e):_0x58de1e;if(_0x1209ca[_0x540fa0][_0xf326('0x70')]){_0x3717fe[_0xf326('0x62')](_0x58de1e);}_0x1209ca[_0x540fa0]['orderBy']&&_0x3717fe[_0xf326('0x71')](_0x58de1e,_0x1209ca[_0x540fa0][_0xf326('0x72')]===_0xf326('0x73')?![]:!![]);_0x3717fe['field'](_0x58de1e,_0x1209ca[_0x540fa0]['alias']||_0x58de1e);}if(_0x4ec099[_0xf326('0x74')]){_0x4ec099[_0xf326('0x74')]=JSON['parse'](_0x4ec099['joins']);for(var _0x2497fd=0x0;_0x2497fd<_0x4ec099['joins'][_0xf326('0x45')];_0x2497fd+=0x1){if(_0x4ec099['joins'][_0x2497fd]['type']&&_['includes'](_0x44d2ed,_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x2e')])&&_0x4ec099[_0xf326('0x74')][_0x2497fd]['parentKey']&&_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')]&&_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x76')]){_0x3717fe[_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x2e')]](_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')],null,util[_0xf326('0x6e')]('%s.%s\x20=\x20%s.%s',_0x4ec099[_0xf326('0x6b')],_0x4ec099['joins'][_0x2497fd][_0xf326('0x77')],_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')],_0x4ec099['joins'][_0x2497fd][_0xf326('0x76')]));}}}if(_0x4ec099[_0xf326('0x78')]){_0x4ec099[_0xf326('0x78')]=JSON['parse'](_0x4ec099[_0xf326('0x78')]);_0x3717fe[_0xf326('0x38')](_0x18dbfc(_0x4ec099[_0xf326('0x78')][_0xf326('0x62')]));}_0x21b3cc=_0x3717fe['clone']();_0x3717fe[_0xf326('0x36')](_0x18b46e);_0x3717fe['offset'](0x0);logger['debug'](_0xf326('0x79'),_0x3717fe[_0xf326('0x7a')]());return dbH['sequelize']['query'](_0x3717fe['toString'](),{'type':dbH[_0xf326('0x7b')]['QueryTypes'][_0xf326('0x7c')]});}})[_0xf326('0x21')](respondWithResult(_0x5be2b1,null))[_0xf326('0x40')](handleError(_0x5be2b1,null));};function runReport(_0x2ec314,_0xf76a89,_0x25b56c){var _0x5d23f0=_0xf76a89[_0xf326('0x28')];var _0x323926=0xa;var _0x5f1724=['join',_0xf326('0x51'),'right_join',_0xf326('0x53')];var _0x147d51={'SUM':_0xf326('0x7d'),'COUNT':_0xf326('0x54'),'COUNT DISTINCT':_0xf326('0x7e'),'MAX':_0xf326('0x7f'),'MIN':_0xf326('0x55'),'AVG':_0xf326('0x80'),'GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf326('0x58')};var _0x26bbb1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf326('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':_0xf326('0x81')};var _0x14e8c0=function(_0x5814ad){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x5814ad);};var _0x1e50aa=function(_0x148779){if(!_0x148779||!_0x148779[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x38b696='(',_0x384b46=0x0;_0x384b46<_0x148779[_0xf326('0x61')][_0xf326('0x45')];_0x384b46+=0x1){_0x384b46>0x0&&(_0x38b696+='\x20'+_0x148779[_0xf326('0x82')]+'\x20');_0x38b696+=_0x148779[_0xf326('0x61')][_0x384b46]['group']?_0x1e50aa(_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x62')]):_0x148779['rules'][_0x384b46][_0xf326('0x63')]+'\x20'+_0x148779[_0xf326('0x61')][_0x384b46]['condition']+(_0x14e8c0(_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x64')])?'\x20'+_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x65')]:'');}return _0x38b696+')';};var _0x2ab607={'where':{'id':_0x2ec314['id']}},_0x35c228,_0x1bb7cc,_0x5794d0,_0x15d61e,_0x107c00;_0x2ab607=_[_0xf326('0x3b')]({},_0x2ab607,_0x25b56c);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x2ab607)[_0xf326('0x21')](function(_0x204002){if(_0x204002){_0x35c228=_0x204002;return _0x204002[_0xf326('0x66')]();}return null;})['then'](function(_0xa8e05b){if(_0xa8e05b){if(!_0xa8e05b[_0xf326('0x45')]){throw new db['Sequelize'][(_0xf326('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1bb7cc=_0xa8e05b;return db[_0xf326('0x83')][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x2a0f36){if(_0x2a0f36){_0x5794d0=_[_0xf326('0x6a')](_0x2a0f36,'id');var _0x3097cf;var _0xf66b70=squel[_0xf326('0x84')]();_0xf66b70[_0xf326('0x85')](_0x35c228[_0xf326('0x6b')]);for(var _0x3f073c=0x0;_0x3f073c<_0x1bb7cc[_0xf326('0x45')];_0x3f073c+=0x1){_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x6c')]?_0x5794d0[_0x1bb7cc[_0x3f073c][_0xf326('0x6c')]]['metric']:_0x1bb7cc[_0x3f073c][_0xf326('0x63')];_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x86')]?_[_0xf326('0x6f')](_0x147d51[_0x1bb7cc[_0x3f073c][_0xf326('0x86')]],'%s',_0x3097cf):_0x3097cf;_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x6e')]?_['replace'](_0x26bbb1[_0x1bb7cc[_0x3f073c][_0xf326('0x6e')]],'%s',_0x3097cf):_0x3097cf;if(_0x1bb7cc[_0x3f073c][_0xf326('0x70')]){_0xf66b70[_0xf326('0x62')](_0x3097cf);}_0x1bb7cc[_0x3f073c][_0xf326('0x72')]&&_0xf66b70[_0xf326('0x71')](_0x3097cf,_0x1bb7cc[_0x3f073c]['orderBy']==='DESC'?![]:!![]);_0xf66b70[_0xf326('0x63')](_0x3097cf,_0x1bb7cc[_0x3f073c]['alias']||_0x3097cf);}if(_0x35c228[_0xf326('0x74')]){_0x35c228[_0xf326('0x74')]=JSON[_0xf326('0x87')](_0x35c228['joins']);for(var _0x54b023=0x0;_0x54b023<_0x35c228[_0xf326('0x74')][_0xf326('0x45')];_0x54b023+=0x1){if(_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x2e')]&&_[_0xf326('0x5c')](_0x5f1724,_0x35c228['joins'][_0x54b023][_0xf326('0x2e')])&&_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x77')]&&_0x35c228['joins'][_0x54b023]['foreignTable']&&_0x35c228['joins'][_0x54b023][_0xf326('0x76')]){_0xf66b70[_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x2e')]](_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x75')],null,util[_0xf326('0x6e')](_0xf326('0x88'),_0x35c228['table'],_0x35c228['joins'][_0x54b023][_0xf326('0x77')],_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x75')],_0x35c228['joins'][_0x54b023][_0xf326('0x76')]));}}}if(_0x35c228[_0xf326('0x78')]){_0x35c228[_0xf326('0x78')]=JSON['parse'](_0x35c228[_0xf326('0x78')]);_0xf66b70[_0xf326('0x38')](_0x1e50aa(_0x35c228[_0xf326('0x78')][_0xf326('0x62')]));}_0x107c00=_0xf66b70['clone']();_0xf66b70['limit'](_0x323926);_0xf66b70['offset'](0x0);return;}})[_0xf326('0x21')](function(){if(_0xf76a89[_0xf326('0x89')]===_0xf326('0x8a')){return null;}var _0x5f0b45=_[_0xf326('0x3b')](_0xf76a89,{'name':_0xf76a89[_0xf326('0x8b')]||_0xf76a89[_0xf326('0x28')]||_0x35c228['name'],'basename':_0x5d23f0,'savename':util[_0xf326('0x6e')](_0xf326('0x8c'),_0xf76a89[_0xf326('0x28')]||_0x35c228[_0xf326('0x28')],require('randomstring')[_0xf326('0x8d')](0x4),_0xf76a89['output']||_0xf326('0x8e')),'reportId':_0x35c228['id'],'reportType':_0xf326('0x8f')});return db[_0xf326('0x90')][_0xf326('0x47')](_0x5f0b45,{'raw':!![]});})['then'](function(_0x2e2f70){if(_0x35c228['table']===_0xf326('0x91')){_0x107c00[_0xf326('0x38')](_0x35c228[_0xf326('0x6b')]+_0xf326('0x92'),_0xf76a89[_0xf326('0x93')],_0xf76a89['endDate']);}else{_0x107c00['where'](_0x35c228[_0xf326('0x6b')]+_0xf326('0x94'),_0xf76a89[_0xf326('0x93')],_0xf76a89[_0xf326('0x95')]);}if(_0x2e2f70){logger['info'](_0xf326('0x96'),_0x107c00['toString']());require(_0xf326('0x97'))[_0xf326('0x98')](path[_0xf326('0x99')](__dirname,'../../components/export/',_0x2e2f70[_0xf326('0x89')]),[_0x2e2f70['id'],_0x107c00[_0xf326('0x7a')](),path[_0xf326('0x99')](__dirname,_0xf326('0x9a'),_0x2e2f70[_0xf326('0x9b')]),_0x5d23f0]);return _0x2e2f70;}else{var _0x4dc4bc=squel[_0xf326('0x84')]();_0x4dc4bc[_0xf326('0x85')]('('+_0x107c00['toString']()+')',_0xf326('0x9c'));_0x4dc4bc[_0xf326('0x63')](_0xf326('0x9d'),_0xf326('0x1e'));_0x107c00['limit'](_0xf76a89['limit']||_0x323926);_0x107c00[_0xf326('0x1c')](_0xf76a89[_0xf326('0x1c')]||0x0);return dbH['sequelize'][_0xf326('0x30')](_0x4dc4bc['toString'](),{'type':dbH['sequelize'][_0xf326('0x9e')][_0xf326('0x7c')]})[_0xf326('0x21')](function(_0x37cd6f){if(!_0x37cd6f[_0xf326('0x45')]){_0x15d61e=0x0;}else{_0x15d61e=_0x37cd6f[0x0][_0xf326('0x1e')]||0x0;}return dbH[_0xf326('0x7b')][_0xf326('0x30')](_0x107c00[_0xf326('0x7a')](),{'type':dbH['sequelize'][_0xf326('0x9e')][_0xf326('0x7c')]});})[_0xf326('0x21')](function(_0x1c7f81){return{'rows':_0x1c7f81||[],'count':_0x15d61e};});}});}exports['run']=function(_0x3e6a5d,_0x20020c){return runReport(_0x3e6a5d[_0xf326('0x42')],_0x3e6a5d[_0xf326('0x30')],_0x3e6a5d[_0xf326('0x3c')])['then'](respondWithResult(_0x20020c,null))[_0xf326('0x40')](handleError(_0x20020c,null));};exports['runReport']=runReport;exports[_0xf326('0x30')]=function(_0x14d255,_0xffd165){var _0x2bc501=0xa;var _0x4bd216=[_0xf326('0x99'),_0xf326('0x51'),_0xf326('0x52'),'cross_join'];var _0x23451e={'SUM':_0xf326('0x7d'),'COUNT':_0xf326('0x54'),'COUNT DISTINCT':_0xf326('0x7e'),'MAX':'MAX(%s)','MIN':_0xf326('0x55'),'AVG':_0xf326('0x80'),'GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':_0xf326('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x310223={'SEC_TO_TIME':_0xf326('0x9f'),'DATE':_0xf326('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':_0xf326('0x81')};var _0x539d23=function(_0x171c53){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x171c53);};var _0x4c7fc0=function(_0x4ffde1){if(!_0x4ffde1||!_0x4ffde1[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x4307d9='(',_0x2fa05b=0x0;_0x2fa05b<_0x4ffde1[_0xf326('0x61')][_0xf326('0x45')];_0x2fa05b+=0x1){_0x2fa05b>0x0&&(_0x4307d9+='\x20'+_0x4ffde1['operator']+'\x20');_0x4307d9+=_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x62')]?_0x4c7fc0(_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x62')]):_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x63')]+'\x20'+_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x64')]+(_0x539d23(_0x4ffde1[_0xf326('0x61')][_0x2fa05b]['condition'])?'\x20'+_0x4ffde1[_0xf326('0x61')][_0x2fa05b]['value']:'');}return _0x4307d9+')';};var _0x590dc0={'where':{'id':_0x14d255[_0xf326('0x42')]['id']}},_0x32fc6e,_0x549a1f,_0x1f37f9,_0x3e0918,_0x3398fd;_0x590dc0=_[_0xf326('0x3b')]({},_0x590dc0,_0x14d255[_0xf326('0x3c')]);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x590dc0)[_0xf326('0x21')](function(_0x314442){if(_0x314442){_0x32fc6e=_0x314442;return _0x314442[_0xf326('0x66')]();}return null;})[_0xf326('0x21')](function(_0x4c1fcd){if(_0x4c1fcd){if(!_0x4c1fcd[_0xf326('0x45')]){throw new db[(_0xf326('0x67'))][(_0xf326('0x68'))](_0xf326('0x69'),0x193);}_0x549a1f=_0x4c1fcd;return db[_0xf326('0x83')][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x5429a2){if(_0x5429a2){_0x1f37f9=_[_0xf326('0x6a')](_0x5429a2,'id');var _0x15f799;var _0x320ab3=squel[_0xf326('0x84')]();_0x320ab3[_0xf326('0x85')](_0x32fc6e[_0xf326('0x6b')]);for(var _0x2094bf=0x0;_0x2094bf<_0x549a1f['length'];_0x2094bf+=0x1){_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x6c')]?_0x1f37f9[_0x549a1f[_0x2094bf][_0xf326('0x6c')]][_0xf326('0x6d')]:_0x549a1f[_0x2094bf][_0xf326('0x63')];_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x86')]?_[_0xf326('0x6f')](_0x23451e[_0x549a1f[_0x2094bf][_0xf326('0x86')]],'%s',_0x15f799):_0x15f799;_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x6e')]?_[_0xf326('0x6f')](_0x310223[_0x549a1f[_0x2094bf][_0xf326('0x6e')]],'%s',_0x15f799):_0x15f799;if(_0x549a1f[_0x2094bf][_0xf326('0x70')]){_0x320ab3[_0xf326('0x62')](_0x15f799);}_0x549a1f[_0x2094bf]['orderBy']&&_0x320ab3[_0xf326('0x71')](_0x15f799,_0x549a1f[_0x2094bf][_0xf326('0x72')]===_0xf326('0x73')?![]:!![]);_0x320ab3['field'](_0x15f799,_0x549a1f[_0x2094bf]['alias']||_0x15f799);}if(_0x32fc6e[_0xf326('0x74')]){_0x32fc6e[_0xf326('0x74')]=JSON[_0xf326('0x87')](_0x32fc6e[_0xf326('0x74')]);for(var _0x5384a5=0x0;_0x5384a5<_0x32fc6e[_0xf326('0x74')][_0xf326('0x45')];_0x5384a5+=0x1){if(_0x32fc6e[_0xf326('0x74')][_0x5384a5]['type']&&_['includes'](_0x4bd216,_0x32fc6e['joins'][_0x5384a5][_0xf326('0x2e')])&&_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x77')]&&_0x32fc6e['joins'][_0x5384a5][_0xf326('0x75')]&&_0x32fc6e['joins'][_0x5384a5][_0xf326('0x76')]){_0x320ab3[_0x32fc6e['joins'][_0x5384a5][_0xf326('0x2e')]](_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x75')],null,util[_0xf326('0x6e')](_0xf326('0x88'),_0x32fc6e[_0xf326('0x6b')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x77')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x75')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x76')]));}}}if(_0x32fc6e[_0xf326('0x78')]){_0x32fc6e[_0xf326('0x78')]=JSON['parse'](_0x32fc6e[_0xf326('0x78')]);_0x320ab3[_0xf326('0x38')](_0x4c7fc0(_0x32fc6e[_0xf326('0x78')]['group']));}_0x3398fd=_0x320ab3['clone']();_0x320ab3['limit'](_0x2bc501);_0x320ab3[_0xf326('0x1c')](0x0);logger[_0xf326('0xa0')](_0xf326('0x79'),_0x320ab3[_0xf326('0x7a')]());return dbH[_0xf326('0x7b')][_0xf326('0x30')](_0x320ab3['toString'](),{'type':dbH[_0xf326('0x7b')][_0xf326('0x9e')][_0xf326('0x7c')]});}})[_0xf326('0x21')](function(){return{'sql':_0x3398fd[_0xf326('0x7a')]()};})['then'](respondWithResult(_0xffd165,null))[_0xf326('0x40')](handleError(_0xffd165,null));};
\ No newline at end of file
+var _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','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\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','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','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xabce[_0x8de54f];return _0x14cba4;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index bcfb2da..64f7f07 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 _0x22a7=['../../config/logger','api','moment','bluebird','path','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util'];(function(_0x3a030a,_0x56f29a){var _0xcaf7b8=function(_0x3af88a){while(--_0x3af88a){_0x3a030a['push'](_0x3a030a['shift']());}};_0xcaf7b8(++_0x56f29a);}(_0x22a7,0x1ea));var _0x722a=function(_0x1dfb49,_0x3300db){_0x1dfb49=_0x1dfb49-0x0;var _0x7ea566=_0x22a7[_0x1dfb49];return _0x7ea566;};'use strict';var _=require(_0x722a('0x0'));var util=require(_0x722a('0x1'));var logger=require(_0x722a('0x2'))(_0x722a('0x3'));var moment=require(_0x722a('0x4'));var BPromise=require(_0x722a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x722a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x722a('0x7'));module[_0x722a('0x8')]=function(_0xb7d097,_0x57ad58){return _0xb7d097[_0x722a('0x9')](_0x722a('0xa'),attributes,{'tableName':_0x722a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6722=['analytics_default_reports','util','../../config/logger','api','request-promise','rimraf','../../config/environment','exports','define','AnalyticDefaultReport'];(function(_0x5b932f,_0x41bb78){var _0x39aa83=function(_0x465305){while(--_0x465305){_0x5b932f['push'](_0x5b932f['shift']());}};_0x39aa83(++_0x41bb78);}(_0x6722,0xab));var _0x2672=function(_0x41bdd9,_0x4a92f1){_0x41bdd9=_0x41bdd9-0x0;var _0x23894a=_0x6722[_0x41bdd9];return _0x23894a;};'use strict';var _=require('lodash');var util=require(_0x2672('0x0'));var logger=require(_0x2672('0x1'))(_0x2672('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2672('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2672('0x4'));var config=require(_0x2672('0x5'));var attributes=require('./analyticDefaultReport.attributes');module[_0x2672('0x6')]=function(_0x187aa4,_0x19d2b4){return _0x187aa4[_0x2672('0x7')](_0x2672('0x8'),attributes,{'tableName':_0x2672('0x9'),'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 54f8102..c7b8d17 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 _0xfe33=['message','catch','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x232e7a,_0x19997){var _0x445ddd=function(_0x43628d){while(--_0x43628d){_0x232e7a['push'](_0x232e7a['shift']());}};_0x445ddd(++_0x19997);}(_0xfe33,0x87));var _0x3fe3=function(_0x39e15b,_0x555185){_0x39e15b=_0x39e15b-0x0;var _0x4e5766=_0xfe33[_0x39e15b];return _0x4e5766;};'use strict';var _=require('lodash');var util=require(_0x3fe3('0x0'));var moment=require(_0x3fe3('0x1'));var BPromise=require(_0x3fe3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3fe3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3fe3('0x4'))(_0x3fe3('0x5'));var config=require(_0x3fe3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3fe3('0x7')][_0x3fe3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f37ff,_0x21b040,_0x9b80a1){return new BPromise(function(_0x3ef4d9,_0x15bc0d){return client[_0x3fe3('0x9')](_0x2f37ff,_0x9b80a1)[_0x3fe3('0xa')](function(_0x28c716){logger[_0x3fe3('0xb')](_0x3fe3('0xc'),_0x21b040,_0x3fe3('0xd'));logger[_0x3fe3('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x21b040,'request\x20sent',JSON[_0x3fe3('0xf')](_0x28c716));if(_0x28c716['error']){if(_0x28c716[_0x3fe3('0x10')]['code']===0x1f4){logger['error'](_0x3fe3('0xc'),_0x21b040,_0x28c716[_0x3fe3('0x10')][_0x3fe3('0x11')]);return _0x15bc0d(_0x28c716['error'][_0x3fe3('0x11')]);}logger[_0x3fe3('0x10')](_0x3fe3('0xc'),_0x21b040,_0x28c716['error'][_0x3fe3('0x11')]);return _0x3ef4d9(_0x28c716[_0x3fe3('0x10')][_0x3fe3('0x11')]);}else{logger[_0x3fe3('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x21b040,_0x3fe3('0xd'));_0x3ef4d9(_0x28c716['result']['message']);}})[_0x3fe3('0x12')](function(_0x4a9ae3){logger['error'](_0x3fe3('0xc'),_0x21b040,_0x4a9ae3);_0x15bc0d(_0x4a9ae3);});});}
\ No newline at end of file
+var _0x5ab4=['jayson/promise','client','http','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xc90b11,_0x3b9b02){var _0x5ced27=function(_0x269e09){while(--_0x269e09){_0xc90b11['push'](_0xc90b11['shift']());}};_0x5ced27(++_0x3b9b02);}(_0x5ab4,0xbd));var _0x45ab=function(_0x5bb539,_0x2fd421){_0x5bb539=_0x5bb539-0x0;var _0x36b22f=_0x5ab4[_0x5bb539];return _0x36b22f;};'use strict';var _=require(_0x45ab('0x0'));var util=require('util');var moment=require(_0x45ab('0x1'));var BPromise=require(_0x45ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45ab('0x3'));var db=require(_0x45ab('0x4'))['db'];var utils=require(_0x45ab('0x5'));var logger=require(_0x45ab('0x6'))(_0x45ab('0x7'));var config=require(_0x45ab('0x8'));var jayson=require(_0x45ab('0x9'));var client=jayson[_0x45ab('0xa')][_0x45ab('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46e511,_0x11c83a,_0x530f27){return new BPromise(function(_0xe35d92,_0x2e2e52){return client['request'](_0x46e511,_0x530f27)['then'](function(_0xf60f25){logger[_0x45ab('0xc')](_0x45ab('0xd'),_0x11c83a,'request\x20sent');logger[_0x45ab('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x11c83a,_0x45ab('0xf'),JSON[_0x45ab('0x10')](_0xf60f25));if(_0xf60f25['error']){if(_0xf60f25['error'][_0x45ab('0x11')]===0x1f4){logger[_0x45ab('0x12')](_0x45ab('0xd'),_0x11c83a,_0xf60f25[_0x45ab('0x12')][_0x45ab('0x13')]);return _0x2e2e52(_0xf60f25['error'][_0x45ab('0x13')]);}logger[_0x45ab('0x12')](_0x45ab('0xd'),_0x11c83a,_0xf60f25[_0x45ab('0x12')][_0x45ab('0x13')]);return _0xe35d92(_0xf60f25[_0x45ab('0x12')][_0x45ab('0x13')]);}else{logger[_0x45ab('0xc')](_0x45ab('0xd'),_0x11c83a,'request\x20sent');_0xe35d92(_0xf60f25[_0x45ab('0x14')][_0x45ab('0x13')]);}})[_0x45ab('0x15')](function(_0x479751){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x11c83a,_0x479751);_0x2e2e52(_0x479751);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index e8f1325..977168d 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 _0x2009=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query','query','update','delete','exports','multer','path','connect-timeout','express'];(function(_0x37dd5f,_0x104365){var _0x2fc2e7=function(_0x5b7d76){while(--_0x5b7d76){_0x37dd5f['push'](_0x37dd5f['shift']());}};_0x2fc2e7(++_0x104365);}(_0x2009,0xac));var _0x9200=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2009[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9200('0x0'));var util=require('util');var path=require(_0x9200('0x1'));var timeout=require(_0x9200('0x2'));var express=require(_0x9200('0x3'));var router=express[_0x9200('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9200('0x5'));var interaction=require(_0x9200('0x6'));var config=require(_0x9200('0x7'));var controller=require(_0x9200('0x8'));router[_0x9200('0x9')]('/',auth[_0x9200('0xa')](),controller[_0x9200('0xb')]);router[_0x9200('0x9')](_0x9200('0xc'),auth[_0x9200('0xa')](),controller[_0x9200('0xd')]);router[_0x9200('0x9')](_0x9200('0xe'),auth[_0x9200('0xa')](),controller[_0x9200('0xf')]);router[_0x9200('0x9')]('/:id/run',auth[_0x9200('0xa')](),controller[_0x9200('0x10')]);router['get'](_0x9200('0x11'),auth['isAuthenticated'](),controller[_0x9200('0x12')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x9200('0xa')](),controller[_0x9200('0x13')]);router[_0x9200('0x14')](_0x9200('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x9200('0x15')]=router;
\ No newline at end of file
+var _0x56f9=['exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','query','post','create','put','update','delete','destroy'];(function(_0x316b3e,_0x47b154){var _0x45ba95=function(_0x5e68c4){while(--_0x5e68c4){_0x316b3e['push'](_0x316b3e['shift']());}};_0x45ba95(++_0x47b154);}(_0x56f9,0x97));var _0x956f=function(_0x5bb5de,_0x192c4c){_0x5bb5de=_0x5bb5de-0x0;var _0x15de2b=_0x56f9[_0x5bb5de];return _0x15de2b;};'use strict';var multer=require('multer');var util=require(_0x956f('0x0'));var path=require('path');var timeout=require(_0x956f('0x1'));var express=require(_0x956f('0x2'));var router=express['Router']();var fs_extra=require(_0x956f('0x3'));var auth=require(_0x956f('0x4'));var interaction=require(_0x956f('0x5'));var config=require(_0x956f('0x6'));var controller=require(_0x956f('0x7'));router[_0x956f('0x8')]('/',auth[_0x956f('0x9')](),controller[_0x956f('0xa')]);router[_0x956f('0x8')](_0x956f('0xb'),auth['isAuthenticated'](),controller[_0x956f('0xc')]);router[_0x956f('0x8')](_0x956f('0xd'),auth[_0x956f('0x9')](),controller[_0x956f('0xe')]);router[_0x956f('0x8')](_0x956f('0xf'),auth[_0x956f('0x9')](),controller[_0x956f('0x10')]);router[_0x956f('0x8')]('/:id/query',auth[_0x956f('0x9')](),controller[_0x956f('0x11')]);router[_0x956f('0x12')]('/',auth[_0x956f('0x9')](),controller[_0x956f('0x13')]);router[_0x956f('0x14')](_0x956f('0xb'),auth['isAuthenticated'](),controller[_0x956f('0x15')]);router[_0x956f('0x16')](_0x956f('0xb'),auth[_0x956f('0x9')](),controller[_0x956f('0x17')]);module[_0x956f('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index f84e16f..8909b1e 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 _0xb341=['ENUM','pdf','csv','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','STRING'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xb341,0x18f));var _0x1b34=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb341[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0x1b34('0x0')],'allowNull':![]},'basename':{'type':Sequelize[_0x1b34('0x0')],'allowNull':![]},'output':{'type':Sequelize[_0x1b34('0x1')]('csv',_0x1b34('0x2'),'xlsx'),'allowNull':![],'defaultValue':_0x1b34('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x1b34('0x4')]},'status':{'type':Sequelize[_0x1b34('0x0')],'defaultValue':_0x1b34('0x5')},'type':{'type':Sequelize[_0x1b34('0x1')](_0x1b34('0x6'),_0x1b34('0x7')),'allowNull':![],'defaultValue':_0x1b34('0x6')},'reportId':{'type':Sequelize[_0x1b34('0x8')](0xb)[_0x1b34('0x9')]},'reportType':{'type':Sequelize[_0x1b34('0x0')]}};
\ No newline at end of file
+var _0xd9b3=['sequelize','exports','STRING','ENUM','csv','pdf','DATE','Loading','manual','INTEGER','UNSIGNED'];(function(_0x4af039,_0xd79dfd){var _0x41e12c=function(_0x3e240d){while(--_0x3e240d){_0x4af039['push'](_0x4af039['shift']());}};_0x41e12c(++_0xd79dfd);}(_0xd9b3,0xb0));var _0x3d9b=function(_0x325c50,_0x53b39e){_0x325c50=_0x325c50-0x0;var _0x4e2f74=_0xd9b3[_0x325c50];return _0x4e2f74;};'use strict';var Sequelize=require(_0x3d9b('0x0'));var moment=require('moment');module[_0x3d9b('0x1')]={'name':{'type':Sequelize[_0x3d9b('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x3d9b('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x3d9b('0x3')](_0x3d9b('0x4'),_0x3d9b('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x3d9b('0x4')},'savename':{'type':Sequelize[_0x3d9b('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x3d9b('0x6')]},'endDate':{'type':Sequelize[_0x3d9b('0x6')]},'status':{'type':Sequelize[_0x3d9b('0x2')],'defaultValue':_0x3d9b('0x7')},'type':{'type':Sequelize[_0x3d9b('0x3')](_0x3d9b('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0x3d9b('0x8')},'reportId':{'type':Sequelize[_0x3d9b('0x9')](0xb)[_0x3d9b('0xa')]},'reportType':{'type':Sequelize[_0x3d9b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 2b55794..64ec2ec 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 _0x48af=['%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','then','error','stack','name','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','create','body','user','role','ExtractedReports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','download','format'];(function(_0x2ada28,_0x6125b8){var _0x5187c1=function(_0x26cb63){while(--_0x26cb63){_0x2ada28['push'](_0x2ada28['shift']());}};_0x5187c1(++_0x6125b8);}(_0x48af,0x129));var _0xf48a=function(_0x4d515d,_0x108c96){_0x4d515d=_0x4d515d-0x0;var _0x58fe07=_0x48af[_0x4d515d];return _0x58fe07;};'use strict';var emlformat=require(_0xf48a('0x0'));var rimraf=require(_0xf48a('0x1'));var zipdir=require(_0xf48a('0x2'));var jsonpatch=require(_0xf48a('0x3'));var rp=require('request-promise');var moment=require(_0xf48a('0x4'));var BPromise=require(_0xf48a('0x5'));var Mustache=require('mustache');var util=require(_0xf48a('0x6'));var path=require('path');var sox=require(_0xf48a('0x7'));var csv=require(_0xf48a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf48a('0x9'));var _=require(_0xf48a('0xa'));var squel=require(_0xf48a('0xb'));var crypto=require(_0xf48a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf48a('0xd'));var toCsv=require(_0xf48a('0x8'));var querystring=require(_0xf48a('0xe'));var Papa=require(_0xf48a('0xf'));var Redis=require('ioredis');var authService=require(_0xf48a('0x10'));var qs=require(_0xf48a('0x11'));var as=require(_0xf48a('0x12'));var hardwareService=require(_0xf48a('0x13'));var logger=require(_0xf48a('0x14'))(_0xf48a('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf48a('0x16'));var db=require(_0xf48a('0x17'))['db'];function respondWithStatusCode(_0x3f3e1b,_0x3ba802){_0x3ba802=_0x3ba802||0xcc;return function(_0x488625){if(_0x488625){return _0x3f3e1b[_0xf48a('0x18')](_0x3ba802);}return _0x3f3e1b[_0xf48a('0x19')](_0x3ba802)[_0xf48a('0x1a')]();};}function respondWithResult(_0x32bf0d,_0x2ea357){_0x2ea357=_0x2ea357||0xc8;return function(_0x1fadbb){if(_0x1fadbb){return _0x32bf0d['status'](_0x2ea357)[_0xf48a('0x1b')](_0x1fadbb);}};}function respondWithFilteredResult(_0x1eddb1,_0x54fad1){return function(_0x129c94){if(_0x129c94){var _0x20b4d1=typeof _0x54fad1['offset']===_0xf48a('0x1c')&&typeof _0x54fad1[_0xf48a('0x1d')]===_0xf48a('0x1c');var _0x519d35=_0x129c94['count'];var _0xb53d2b=_0x20b4d1?0x0:_0x54fad1[_0xf48a('0x1e')];var _0x1b3716=_0x20b4d1?_0x129c94[_0xf48a('0x1f')]:_0x54fad1[_0xf48a('0x1e')]+_0x54fad1[_0xf48a('0x1d')];var _0x55d1fd;if(_0x1b3716>=_0x519d35){_0x1b3716=_0x519d35;_0x55d1fd=0xc8;}else{_0x55d1fd=0xce;}_0x1eddb1['status'](_0x55d1fd);return _0x1eddb1[_0xf48a('0x20')](_0xf48a('0x21'),_0xb53d2b+'-'+_0x1b3716+'/'+_0x519d35)[_0xf48a('0x1b')](_0x129c94);}return null;};}function patchUpdates(_0x13d44c){return function(_0x25846b){try{jsonpatch[_0xf48a('0x22')](_0x25846b,_0x13d44c,!![]);}catch(_0x2c402c){return BPromise['reject'](_0x2c402c);}return _0x25846b[_0xf48a('0x23')]();};}function saveUpdates(_0x2c7e3b,_0x4cc119){return function(_0x1b38f7){if(_0x1b38f7){return _0x1b38f7[_0xf48a('0x24')](_0x2c7e3b)['then'](function(_0x43346e){return _0x43346e;});}return null;};}function removeEntity(_0x4a97cb,_0x206485){return function(_0xd3fb2b){if(_0xd3fb2b){return _0xd3fb2b[_0xf48a('0x25')]()['then'](function(){var _0x11edd8=_0xd3fb2b[_0xf48a('0x26')]({'plain':!![]});var _0x778208='ExtractedReports';return db[_0xf48a('0x27')]['destroy']({'where':{'type':_0x778208,'resourceId':_0x11edd8['id']}})[_0xf48a('0x28')](function(){return _0xd3fb2b;});})[_0xf48a('0x28')](function(){_0x4a97cb[_0xf48a('0x19')](0xcc)[_0xf48a('0x1a')]();});}};}function handleEntityNotFound(_0x461235,_0x54e4a1){return function(_0x451105){if(!_0x451105){_0x461235[_0xf48a('0x18')](0x194);}return _0x451105;};}function handleError(_0x574345,_0x133252){_0x133252=_0x133252||0x1f4;return function(_0x23bc0b){logger[_0xf48a('0x29')](_0x23bc0b[_0xf48a('0x2a')]);if(_0x23bc0b[_0xf48a('0x2b')]){delete _0x23bc0b[_0xf48a('0x2b')];}_0x574345['status'](_0x133252)['send'](_0x23bc0b);};}exports[_0xf48a('0x2c')]=function(_0x49e260,_0x26f53c){var _0x3eb3ca={},_0x5a9e0d={},_0x5826c0={'count':0x0,'rows':[]};var _0x27255a=_[_0xf48a('0x2d')](db[_0xf48a('0x2e')][_0xf48a('0x2f')],function(_0x4ebc24){return{'name':_0x4ebc24[_0xf48a('0x30')],'type':_0x4ebc24[_0xf48a('0x31')][_0xf48a('0x32')]};});_0x5a9e0d[_0xf48a('0x33')]=_[_0xf48a('0x2d')](_0x27255a,'name');_0x5a9e0d[_0xf48a('0x34')]=_[_0xf48a('0x35')](_0x49e260[_0xf48a('0x34')]);_0x5a9e0d[_0xf48a('0x36')]=_[_0xf48a('0x37')](_0x5a9e0d[_0xf48a('0x33')],_0x5a9e0d[_0xf48a('0x34')]);_0x3eb3ca['attributes']=_['intersection'](_0x5a9e0d[_0xf48a('0x33')],qs[_0xf48a('0x38')](_0x49e260[_0xf48a('0x34')][_0xf48a('0x38')]));_0x3eb3ca[_0xf48a('0x39')]=_0x3eb3ca[_0xf48a('0x39')][_0xf48a('0x3a')]?_0x3eb3ca[_0xf48a('0x39')]:_0x5a9e0d[_0xf48a('0x33')];if(!_0x49e260[_0xf48a('0x34')]['hasOwnProperty'](_0xf48a('0x3b'))){_0x3eb3ca[_0xf48a('0x1d')]=qs[_0xf48a('0x1d')](_0x49e260[_0xf48a('0x34')]['limit']);_0x3eb3ca[_0xf48a('0x1e')]=qs[_0xf48a('0x1e')](_0x49e260['query'][_0xf48a('0x1e')]);}_0x3eb3ca[_0xf48a('0x3c')]=qs[_0xf48a('0x3d')](_0x49e260[_0xf48a('0x34')]['sort']);_0x3eb3ca[_0xf48a('0x3e')]=qs[_0xf48a('0x36')](_[_0xf48a('0x3f')](_0x49e260[_0xf48a('0x34')],_0x5a9e0d[_0xf48a('0x36')]),_0x27255a);if(_0x49e260[_0xf48a('0x34')][_0xf48a('0x40')]){_0x3eb3ca[_0xf48a('0x3e')]=_[_0xf48a('0x41')](_0x3eb3ca[_0xf48a('0x3e')],{'$or':_['map'](_0x27255a,function(_0x20cd0f){if(_0x20cd0f['type']!==_0xf48a('0x42')){var _0x177786={};_0x177786[_0x20cd0f['name']]={'$like':'%'+_0x49e260['query'][_0xf48a('0x40')]+'%'};return _0x177786;}})});}_0x3eb3ca=_[_0xf48a('0x41')]({},_0x3eb3ca,_0x49e260[_0xf48a('0x43')]);var _0x1f5c16={'where':_0x3eb3ca[_0xf48a('0x3e')]};return db['AnalyticExtractedReport'][_0xf48a('0x1f')](_0x1f5c16)['then'](function(_0x3da1ef){_0x5826c0[_0xf48a('0x1f')]=_0x3da1ef;if(_0x49e260[_0xf48a('0x34')][_0xf48a('0x44')]){_0x3eb3ca[_0xf48a('0x45')]=[{'all':!![]}];}return db[_0xf48a('0x2e')][_0xf48a('0x46')](_0x3eb3ca);})['then'](function(_0x4262a6){_0x5826c0['rows']=_0x4262a6;return _0x5826c0;})['then'](respondWithFilteredResult(_0x26f53c,_0x3eb3ca))['catch'](handleError(_0x26f53c,null));};exports[_0xf48a('0x47')]=function(_0x353310,_0x1460ae){var _0x5503ec={'raw':!![],'where':{'id':_0x353310[_0xf48a('0x48')]['id']}},_0x2da097={};_0x2da097[_0xf48a('0x33')]=_[_0xf48a('0x35')](db[_0xf48a('0x2e')][_0xf48a('0x2f')]);_0x2da097[_0xf48a('0x34')]=_[_0xf48a('0x35')](_0x353310[_0xf48a('0x34')]);_0x2da097[_0xf48a('0x36')]=_[_0xf48a('0x37')](_0x2da097[_0xf48a('0x33')],_0x2da097[_0xf48a('0x34')]);_0x5503ec['attributes']=_[_0xf48a('0x37')](_0x2da097[_0xf48a('0x33')],qs[_0xf48a('0x38')](_0x353310[_0xf48a('0x34')][_0xf48a('0x38')]));_0x5503ec['attributes']=_0x5503ec[_0xf48a('0x39')][_0xf48a('0x3a')]?_0x5503ec[_0xf48a('0x39')]:_0x2da097[_0xf48a('0x33')];if(_0x353310['query'][_0xf48a('0x44')]){_0x5503ec[_0xf48a('0x45')]=[{'all':!![]}];}_0x5503ec=_[_0xf48a('0x41')]({},_0x5503ec,_0x353310[_0xf48a('0x43')]);return db[_0xf48a('0x2e')]['find'](_0x5503ec)[_0xf48a('0x28')](handleEntityNotFound(_0x1460ae,null))['then'](respondWithResult(_0x1460ae,null))[_0xf48a('0x49')](handleError(_0x1460ae,null));};exports[_0xf48a('0x4a')]=function(_0x5f0d9a,_0x39b3c3){return db[_0xf48a('0x2e')][_0xf48a('0x4a')](_0x5f0d9a[_0xf48a('0x4b')],{})[_0xf48a('0x28')](function(_0x3d2f44){var _0x23a7b4=_0x5f0d9a[_0xf48a('0x4c')]['get']({'plain':!![]});if(!_0x23a7b4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23a7b4[_0xf48a('0x4d')]===_0xf48a('0x4c')){var _0x308666=_0x3d2f44[_0xf48a('0x26')]({'plain':!![]});var _0x3a617e=_0xf48a('0x4e');return db[_0xf48a('0x4f')][_0xf48a('0x50')]({'where':{'name':_0x3a617e,'userProfileId':_0x23a7b4[_0xf48a('0x51')]},'raw':!![]})[_0xf48a('0x28')](function(_0x3a2124){if(_0x3a2124&&_0x3a2124[_0xf48a('0x52')]===0x0){return db[_0xf48a('0x27')][_0xf48a('0x4a')]({'name':_0x308666['name'],'resourceId':_0x308666['id'],'type':_0x3a2124[_0xf48a('0x2b')],'sectionId':_0x3a2124['id']},{})[_0xf48a('0x28')](function(){return _0x3d2f44;});}else{return _0x3d2f44;}})['catch'](function(_0x480c17){logger[_0xf48a('0x29')](_0xf48a('0x53'),_0x480c17);throw _0x480c17;});}return _0x3d2f44;})['then'](respondWithResult(_0x39b3c3,0xc9))['catch'](handleError(_0x39b3c3,null));};exports['update']=function(_0x5d858a,_0x3c47e0){if(_0x5d858a['body']['id']){delete _0x5d858a[_0xf48a('0x4b')]['id'];}return db[_0xf48a('0x2e')][_0xf48a('0x50')]({'where':{'id':_0x5d858a['params']['id']}})[_0xf48a('0x28')](handleEntityNotFound(_0x3c47e0,null))[_0xf48a('0x28')](saveUpdates(_0x5d858a['body'],null))[_0xf48a('0x28')](respondWithResult(_0x3c47e0,null))[_0xf48a('0x49')](handleError(_0x3c47e0,null));};exports[_0xf48a('0x25')]=function(_0x35bbaa,_0xb37a08){return db[_0xf48a('0x2e')][_0xf48a('0x50')]({'where':{'id':_0x35bbaa[_0xf48a('0x48')]['id']}})[_0xf48a('0x28')](handleEntityNotFound(_0xb37a08,null))[_0xf48a('0x28')](removeEntity(_0xb37a08,null))[_0xf48a('0x49')](handleError(_0xb37a08,null));};exports['download']=function(_0x855549,_0x4e0f68,_0xf35d85){return db[_0xf48a('0x2e')][_0xf48a('0x50')]({'where':{'id':_0x855549[_0xf48a('0x48')]['id']},'attributes':[_0xf48a('0x2b'),'basename',_0xf48a('0x54'),_0xf48a('0x55')],'raw':!![]})['then'](handleEntityNotFound(_0x4e0f68,null))['then'](function(_0x39a764){if(_0x39a764){if(!fs[_0xf48a('0x56')](path[_0xf48a('0x57')](config[_0xf48a('0x58')],_0xf48a('0x59'),_0x39a764[_0xf48a('0x54')]))){throw new db[(_0xf48a('0x5a'))][(_0xf48a('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x855549[_0xf48a('0x34')][_0xf48a('0x5c')]){return _0x4e0f68[_0xf48a('0x18')](0xc8);}return _0x4e0f68[_0xf48a('0x5d')](path[_0xf48a('0x57')](config['root'],'server/files/reports',_0x39a764[_0xf48a('0x54')]),util[_0xf48a('0x5e')](_0xf48a('0x5f'),_0x39a764[_0xf48a('0x60')]||_0x39a764['name'],_0x39a764[_0xf48a('0x55')][_0xf48a('0x61')]()));}})[_0xf48a('0x49')](handleError(_0x4e0f68,null));};
\ No newline at end of file
+var _0xc4b2=['../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','ExtractedReports','UserProfileResource','error','stack','name','send','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','findAll','rows','catch','show','keys','intersection','includeAll','include','find','create','body','user','get','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','output','toLowerCase','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x41b796,_0x73452f){var _0x2f96bf=function(_0x5a9a67){while(--_0x5a9a67){_0x41b796['push'](_0x41b796['shift']());}};_0x2f96bf(++_0x73452f);}(_0xc4b2,0x1b2));var _0x2c4b=function(_0x1d5714,_0x2fa5f4){_0x1d5714=_0x1d5714-0x0;var _0x1b620e=_0xc4b2[_0x1d5714];return _0x1b620e;};'use strict';var emlformat=require(_0x2c4b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2c4b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c4b('0x2'));var moment=require(_0x2c4b('0x3'));var BPromise=require(_0x2c4b('0x4'));var Mustache=require(_0x2c4b('0x5'));var util=require('util');var path=require(_0x2c4b('0x6'));var sox=require(_0x2c4b('0x7'));var csv=require(_0x2c4b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2c4b('0x9'));var squel=require(_0x2c4b('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2c4b('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2c4b('0xc'));var Papa=require(_0x2c4b('0xd'));var Redis=require('ioredis');var authService=require(_0x2c4b('0xe'));var qs=require(_0x2c4b('0xf'));var as=require(_0x2c4b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2c4b('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x2c4b('0x12'));var db=require(_0x2c4b('0x13'))['db'];function respondWithStatusCode(_0x4f58d8,_0x1d6f0a){_0x1d6f0a=_0x1d6f0a||0xcc;return function(_0x1492d8){if(_0x1492d8){return _0x4f58d8[_0x2c4b('0x14')](_0x1d6f0a);}return _0x4f58d8['status'](_0x1d6f0a)[_0x2c4b('0x15')]();};}function respondWithResult(_0xa72bb1,_0x2981c6){_0x2981c6=_0x2981c6||0xc8;return function(_0x186aa5){if(_0x186aa5){return _0xa72bb1[_0x2c4b('0x16')](_0x2981c6)[_0x2c4b('0x17')](_0x186aa5);}};}function respondWithFilteredResult(_0x59cfdb,_0x793c4){return function(_0x30b9cb){if(_0x30b9cb){var _0x50447e=typeof _0x793c4['offset']===_0x2c4b('0x18')&&typeof _0x793c4[_0x2c4b('0x19')]===_0x2c4b('0x18');var _0x28fe87=_0x30b9cb[_0x2c4b('0x1a')];var _0x1bb1d6=_0x50447e?0x0:_0x793c4[_0x2c4b('0x1b')];var _0x5bebde=_0x50447e?_0x30b9cb[_0x2c4b('0x1a')]:_0x793c4[_0x2c4b('0x1b')]+_0x793c4[_0x2c4b('0x19')];var _0x2f0d06;if(_0x5bebde>=_0x28fe87){_0x5bebde=_0x28fe87;_0x2f0d06=0xc8;}else{_0x2f0d06=0xce;}_0x59cfdb['status'](_0x2f0d06);return _0x59cfdb[_0x2c4b('0x1c')]('Content-Range',_0x1bb1d6+'-'+_0x5bebde+'/'+_0x28fe87)['json'](_0x30b9cb);}return null;};}function patchUpdates(_0x49e850){return function(_0x52a6a2){try{jsonpatch[_0x2c4b('0x1d')](_0x52a6a2,_0x49e850,!![]);}catch(_0x223dc3){return BPromise['reject'](_0x223dc3);}return _0x52a6a2[_0x2c4b('0x1e')]();};}function saveUpdates(_0x541bce,_0x16e128){return function(_0x1351c3){if(_0x1351c3){return _0x1351c3[_0x2c4b('0x1f')](_0x541bce)[_0x2c4b('0x20')](function(_0x1d5875){return _0x1d5875;});}return null;};}function removeEntity(_0x66da48,_0x5f798d){return function(_0x20a835){if(_0x20a835){return _0x20a835[_0x2c4b('0x21')]()[_0x2c4b('0x20')](function(){var _0xd72f80=_0x20a835['get']({'plain':!![]});var _0x499f88=_0x2c4b('0x22');return db[_0x2c4b('0x23')][_0x2c4b('0x21')]({'where':{'type':_0x499f88,'resourceId':_0xd72f80['id']}})[_0x2c4b('0x20')](function(){return _0x20a835;});})[_0x2c4b('0x20')](function(){_0x66da48[_0x2c4b('0x16')](0xcc)[_0x2c4b('0x15')]();});}};}function handleEntityNotFound(_0x39fb95,_0x42da41){return function(_0x1624a4){if(!_0x1624a4){_0x39fb95['sendStatus'](0x194);}return _0x1624a4;};}function handleError(_0x31f46e,_0xf79c43){_0xf79c43=_0xf79c43||0x1f4;return function(_0x3d4232){logger[_0x2c4b('0x24')](_0x3d4232[_0x2c4b('0x25')]);if(_0x3d4232[_0x2c4b('0x26')]){delete _0x3d4232[_0x2c4b('0x26')];}_0x31f46e[_0x2c4b('0x16')](_0xf79c43)[_0x2c4b('0x27')](_0x3d4232);};}exports['index']=function(_0x153cd3,_0x1f97d8){var _0x4273a8={},_0x25b024={},_0x51eea1={'count':0x0,'rows':[]};var _0x4d7448=_[_0x2c4b('0x28')](db[_0x2c4b('0x29')][_0x2c4b('0x2a')],function(_0x167e4b){return{'name':_0x167e4b['fieldName'],'type':_0x167e4b[_0x2c4b('0x2b')][_0x2c4b('0x2c')]};});_0x25b024[_0x2c4b('0x2d')]=_[_0x2c4b('0x28')](_0x4d7448,'name');_0x25b024[_0x2c4b('0x2e')]=_['keys'](_0x153cd3[_0x2c4b('0x2e')]);_0x25b024[_0x2c4b('0x2f')]=_['intersection'](_0x25b024[_0x2c4b('0x2d')],_0x25b024[_0x2c4b('0x2e')]);_0x4273a8[_0x2c4b('0x30')]=_['intersection'](_0x25b024[_0x2c4b('0x2d')],qs[_0x2c4b('0x31')](_0x153cd3[_0x2c4b('0x2e')][_0x2c4b('0x31')]));_0x4273a8[_0x2c4b('0x30')]=_0x4273a8[_0x2c4b('0x30')][_0x2c4b('0x32')]?_0x4273a8['attributes']:_0x25b024['model'];if(!_0x153cd3['query'][_0x2c4b('0x33')](_0x2c4b('0x34'))){_0x4273a8['limit']=qs['limit'](_0x153cd3[_0x2c4b('0x2e')]['limit']);_0x4273a8[_0x2c4b('0x1b')]=qs[_0x2c4b('0x1b')](_0x153cd3[_0x2c4b('0x2e')][_0x2c4b('0x1b')]);}_0x4273a8[_0x2c4b('0x35')]=qs[_0x2c4b('0x36')](_0x153cd3[_0x2c4b('0x2e')]['sort']);_0x4273a8['where']=qs[_0x2c4b('0x2f')](_[_0x2c4b('0x37')](_0x153cd3['query'],_0x25b024[_0x2c4b('0x2f')]),_0x4d7448);if(_0x153cd3[_0x2c4b('0x2e')]['filter']){_0x4273a8[_0x2c4b('0x38')]=_[_0x2c4b('0x39')](_0x4273a8['where'],{'$or':_[_0x2c4b('0x28')](_0x4d7448,function(_0x378fd7){if(_0x378fd7[_0x2c4b('0x2b')]!=='VIRTUAL'){var _0x4f0dc5={};_0x4f0dc5[_0x378fd7[_0x2c4b('0x26')]]={'$like':'%'+_0x153cd3[_0x2c4b('0x2e')][_0x2c4b('0x3a')]+'%'};return _0x4f0dc5;}})});}_0x4273a8=_['merge']({},_0x4273a8,_0x153cd3[_0x2c4b('0x3b')]);var _0x119d3a={'where':_0x4273a8[_0x2c4b('0x38')]};return db[_0x2c4b('0x29')]['count'](_0x119d3a)[_0x2c4b('0x20')](function(_0x23e964){_0x51eea1[_0x2c4b('0x1a')]=_0x23e964;if(_0x153cd3[_0x2c4b('0x2e')]['includeAll']){_0x4273a8['include']=[{'all':!![]}];}return db[_0x2c4b('0x29')][_0x2c4b('0x3c')](_0x4273a8);})[_0x2c4b('0x20')](function(_0x301b28){_0x51eea1[_0x2c4b('0x3d')]=_0x301b28;return _0x51eea1;})[_0x2c4b('0x20')](respondWithFilteredResult(_0x1f97d8,_0x4273a8))[_0x2c4b('0x3e')](handleError(_0x1f97d8,null));};exports[_0x2c4b('0x3f')]=function(_0x2ac3fb,_0x51190e){var _0x2af070={'raw':!![],'where':{'id':_0x2ac3fb['params']['id']}},_0x28e7a2={};_0x28e7a2[_0x2c4b('0x2d')]=_[_0x2c4b('0x40')](db['AnalyticExtractedReport'][_0x2c4b('0x2a')]);_0x28e7a2['query']=_['keys'](_0x2ac3fb[_0x2c4b('0x2e')]);_0x28e7a2[_0x2c4b('0x2f')]=_[_0x2c4b('0x41')](_0x28e7a2[_0x2c4b('0x2d')],_0x28e7a2[_0x2c4b('0x2e')]);_0x2af070['attributes']=_[_0x2c4b('0x41')](_0x28e7a2[_0x2c4b('0x2d')],qs[_0x2c4b('0x31')](_0x2ac3fb[_0x2c4b('0x2e')][_0x2c4b('0x31')]));_0x2af070['attributes']=_0x2af070[_0x2c4b('0x30')][_0x2c4b('0x32')]?_0x2af070[_0x2c4b('0x30')]:_0x28e7a2['model'];if(_0x2ac3fb[_0x2c4b('0x2e')][_0x2c4b('0x42')]){_0x2af070[_0x2c4b('0x43')]=[{'all':!![]}];}_0x2af070=_[_0x2c4b('0x39')]({},_0x2af070,_0x2ac3fb[_0x2c4b('0x3b')]);return db[_0x2c4b('0x29')][_0x2c4b('0x44')](_0x2af070)['then'](handleEntityNotFound(_0x51190e,null))[_0x2c4b('0x20')](respondWithResult(_0x51190e,null))['catch'](handleError(_0x51190e,null));};exports[_0x2c4b('0x45')]=function(_0x4f538b,_0x5f5588){return db[_0x2c4b('0x29')]['create'](_0x4f538b[_0x2c4b('0x46')],{})[_0x2c4b('0x20')](function(_0x23a00e){var _0x1fc5ca=_0x4f538b[_0x2c4b('0x47')][_0x2c4b('0x48')]({'plain':!![]});if(!_0x1fc5ca)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1fc5ca['role']===_0x2c4b('0x47')){var _0x227e39=_0x23a00e['get']({'plain':!![]});var _0x1fc464=_0x2c4b('0x22');return db[_0x2c4b('0x49')][_0x2c4b('0x44')]({'where':{'name':_0x1fc464,'userProfileId':_0x1fc5ca['userProfileId']},'raw':!![]})['then'](function(_0x1588f2){if(_0x1588f2&&_0x1588f2['autoAssociation']===0x0){return db[_0x2c4b('0x23')][_0x2c4b('0x45')]({'name':_0x227e39['name'],'resourceId':_0x227e39['id'],'type':_0x1588f2['name'],'sectionId':_0x1588f2['id']},{})[_0x2c4b('0x20')](function(){return _0x23a00e;});}else{return _0x23a00e;}})['catch'](function(_0xcd2a09){logger[_0x2c4b('0x24')](_0x2c4b('0x4a'),_0xcd2a09);throw _0xcd2a09;});}return _0x23a00e;})[_0x2c4b('0x20')](respondWithResult(_0x5f5588,0xc9))[_0x2c4b('0x3e')](handleError(_0x5f5588,null));};exports[_0x2c4b('0x1f')]=function(_0x111673,_0x242873){if(_0x111673[_0x2c4b('0x46')]['id']){delete _0x111673['body']['id'];}return db[_0x2c4b('0x29')][_0x2c4b('0x44')]({'where':{'id':_0x111673[_0x2c4b('0x4b')]['id']}})[_0x2c4b('0x20')](handleEntityNotFound(_0x242873,null))['then'](saveUpdates(_0x111673[_0x2c4b('0x46')],null))['then'](respondWithResult(_0x242873,null))[_0x2c4b('0x3e')](handleError(_0x242873,null));};exports[_0x2c4b('0x21')]=function(_0x42f2de,_0x524236){return db['AnalyticExtractedReport'][_0x2c4b('0x44')]({'where':{'id':_0x42f2de[_0x2c4b('0x4b')]['id']}})[_0x2c4b('0x20')](handleEntityNotFound(_0x524236,null))['then'](removeEntity(_0x524236,null))[_0x2c4b('0x3e')](handleError(_0x524236,null));};exports[_0x2c4b('0x4c')]=function(_0x4d1b42,_0xbfb66f,_0x6b6f96){return db[_0x2c4b('0x29')]['find']({'where':{'id':_0x4d1b42[_0x2c4b('0x4b')]['id']},'attributes':['name',_0x2c4b('0x4d'),_0x2c4b('0x4e'),'output'],'raw':!![]})[_0x2c4b('0x20')](handleEntityNotFound(_0xbfb66f,null))[_0x2c4b('0x20')](function(_0x28a652){if(_0x28a652){if(!fs[_0x2c4b('0x4f')](path[_0x2c4b('0x50')](config[_0x2c4b('0x51')],_0x2c4b('0x52'),_0x28a652[_0x2c4b('0x4e')]))){throw new db[(_0x2c4b('0x53'))][(_0x2c4b('0x54'))](_0x2c4b('0x55'));}if(_0x4d1b42[_0x2c4b('0x2e')][_0x2c4b('0x56')]){return _0xbfb66f[_0x2c4b('0x14')](0xc8);}return _0xbfb66f[_0x2c4b('0x4c')](path[_0x2c4b('0x50')](config[_0x2c4b('0x51')],_0x2c4b('0x52'),_0x28a652[_0x2c4b('0x4e')]),util['format'](_0x2c4b('0x57'),_0x28a652['basename']||_0x28a652['name'],_0x28a652[_0x2c4b('0x58')][_0x2c4b('0x59')]()));}})['catch'](handleError(_0xbfb66f,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 363dda8..41bb1f7 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 _0x5c09=['define','analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x1ec3fa,_0x3e9940){var _0x349bee=function(_0x539e67){while(--_0x539e67){_0x1ec3fa['push'](_0x1ec3fa['shift']());}};_0x349bee(++_0x3e9940);}(_0x5c09,0x6a));var _0x95c0=function(_0x453c56,_0x14b10d){_0x453c56=_0x453c56-0x0;var _0x3a114d=_0x5c09[_0x453c56];return _0x3a114d;};'use strict';var _=require(_0x95c0('0x0'));var util=require(_0x95c0('0x1'));var logger=require(_0x95c0('0x2'))('api');var moment=require(_0x95c0('0x3'));var BPromise=require(_0x95c0('0x4'));var rp=require(_0x95c0('0x5'));var fs=require('fs');var path=require(_0x95c0('0x6'));var rimraf=require(_0x95c0('0x7'));var config=require(_0x95c0('0x8'));var attributes=require(_0x95c0('0x9'));module[_0x95c0('0xa')]=function(_0x22df75,_0x133672){return _0x22df75[_0x95c0('0xb')]('AnalyticExtractedReport',attributes,{'tableName':_0x95c0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5940=['./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','util','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5940,0x108));var _0x0594=function(_0x2e7165,_0x40cd42){_0x2e7165=_0x2e7165-0x0;var _0x44f8cd=_0x5940[_0x2e7165];return _0x44f8cd;};'use strict';var _=require('lodash');var util=require(_0x0594('0x0'));var logger=require('../../config/logger')(_0x0594('0x1'));var moment=require(_0x0594('0x2'));var BPromise=require(_0x0594('0x3'));var rp=require(_0x0594('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0594('0x5'));var attributes=require(_0x0594('0x6'));module[_0x0594('0x7')]=function(_0x3a17ba,_0x516eb2){return _0x3a17ba['define'](_0x0594('0x8'),attributes,{'tableName':_0x0594('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 34a173a..c8029e3 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 _0x90db=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1a5f54,_0x42b4fa){var _0x13f830=function(_0x17c2fb){while(--_0x17c2fb){_0x1a5f54['push'](_0x1a5f54['shift']());}};_0x13f830(++_0x42b4fa);}(_0x90db,0x179));var _0xb90d=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x90db[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0xb90d('0x0'));var util=require(_0xb90d('0x1'));var moment=require(_0xb90d('0x2'));var BPromise=require(_0xb90d('0x3'));var rs=require(_0xb90d('0x4'));var fs=require('fs');var Redis=require(_0xb90d('0x5'));var db=require(_0xb90d('0x6'))['db'];var utils=require(_0xb90d('0x7'));var logger=require(_0xb90d('0x8'))('rpc');var config=require(_0xb90d('0x9'));var jayson=require(_0xb90d('0xa'));var client=jayson[_0xb90d('0xb')][_0xb90d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46fd49,_0x1b3e51,_0x4d3d15){return new BPromise(function(_0x41a338,_0x38e12c){return client[_0xb90d('0xd')](_0x46fd49,_0x4d3d15)['then'](function(_0x242743){logger[_0xb90d('0xe')](_0xb90d('0xf'),_0x1b3e51,_0xb90d('0x10'));logger['debug'](_0xb90d('0x11'),_0x1b3e51,_0xb90d('0x10'),JSON[_0xb90d('0x12')](_0x242743));if(_0x242743['error']){if(_0x242743[_0xb90d('0x13')][_0xb90d('0x14')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1b3e51,_0x242743[_0xb90d('0x13')][_0xb90d('0x15')]);return _0x38e12c(_0x242743[_0xb90d('0x13')][_0xb90d('0x15')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1b3e51,_0x242743[_0xb90d('0x13')][_0xb90d('0x15')]);return _0x41a338(_0x242743['error'][_0xb90d('0x15')]);}else{logger[_0xb90d('0xe')](_0xb90d('0xf'),_0x1b3e51,_0xb90d('0x10'));_0x41a338(_0x242743[_0xb90d('0x16')][_0xb90d('0x15')]);}})[_0xb90d('0x17')](function(_0x5c664d){logger[_0xb90d('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1b3e51,_0x5c664d);_0x38e12c(_0x5c664d);});});}
\ No newline at end of file
+var _0xedb9=['randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0xedb9,0x16e));var _0x9edb=function(_0x2913be,_0x3771dc){_0x2913be=_0x2913be-0x0;var _0x1ac74c=_0xedb9[_0x2913be];return _0x1ac74c;};'use strict';var _=require('lodash');var util=require(_0x9edb('0x0'));var moment=require('moment');var BPromise=require(_0x9edb('0x1'));var rs=require(_0x9edb('0x2'));var fs=require('fs');var Redis=require(_0x9edb('0x3'));var db=require(_0x9edb('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9edb('0x5'));var config=require(_0x9edb('0x6'));var jayson=require(_0x9edb('0x7'));var client=jayson[_0x9edb('0x8')][_0x9edb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f86fb,_0x523d7f,_0x219b6a){return new BPromise(function(_0x4aa55f,_0x2a48de){return client[_0x9edb('0xa')](_0x1f86fb,_0x219b6a)[_0x9edb('0xb')](function(_0xd53e5d){logger[_0x9edb('0xc')](_0x9edb('0xd'),_0x523d7f,'request\x20sent');logger[_0x9edb('0xe')](_0x9edb('0xf'),_0x523d7f,_0x9edb('0x10'),JSON[_0x9edb('0x11')](_0xd53e5d));if(_0xd53e5d[_0x9edb('0x12')]){if(_0xd53e5d[_0x9edb('0x12')][_0x9edb('0x13')]===0x1f4){logger[_0x9edb('0x12')](_0x9edb('0xd'),_0x523d7f,_0xd53e5d[_0x9edb('0x12')][_0x9edb('0x14')]);return _0x2a48de(_0xd53e5d[_0x9edb('0x12')][_0x9edb('0x14')]);}logger[_0x9edb('0x12')](_0x9edb('0xd'),_0x523d7f,_0xd53e5d['error'][_0x9edb('0x14')]);return _0x4aa55f(_0xd53e5d['error'][_0x9edb('0x14')]);}else{logger[_0x9edb('0xc')](_0x9edb('0xd'),_0x523d7f,_0x9edb('0x10'));_0x4aa55f(_0xd53e5d[_0x9edb('0x15')][_0x9edb('0x14')]);}})[_0x9edb('0x16')](function(_0x23f11f){logger[_0x9edb('0x12')](_0x9edb('0xd'),_0x523d7f,_0x23f11f);_0x2a48de(_0x23f11f);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 208ba0e..97454ca 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 _0x65ca=['../../components/auth/service','../../components/interaction/service','get','index','show','isAuthenticated','download','post','create','put','delete','/:id','destroy','exports','multer','util','express','Router','fs-extra'];(function(_0x41ffbb,_0x3ed4a9){var _0x2dc5fd=function(_0x35cf91){while(--_0x35cf91){_0x41ffbb['push'](_0x41ffbb['shift']());}};_0x2dc5fd(++_0x3ed4a9);}(_0x65ca,0xb9));var _0xa65c=function(_0x3ed26c,_0xab6b81){_0x3ed26c=_0x3ed26c-0x0;var _0x20074a=_0x65ca[_0x3ed26c];return _0x20074a;};'use strict';var multer=require(_0xa65c('0x0'));var util=require(_0xa65c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa65c('0x2'));var router=express[_0xa65c('0x3')]();var fs_extra=require(_0xa65c('0x4'));var auth=require(_0xa65c('0x5'));var interaction=require(_0xa65c('0x6'));var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0xa65c('0x7')]('/',auth['isAuthenticated'](),controller[_0xa65c('0x8')]);router[_0xa65c('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xa65c('0x9')]);router[_0xa65c('0x7')]('/:id/download',auth[_0xa65c('0xa')](),controller[_0xa65c('0xb')]);router[_0xa65c('0xc')]('/',auth[_0xa65c('0xa')](),controller[_0xa65c('0xd')]);router[_0xa65c('0xe')]('/:id',auth[_0xa65c('0xa')](),controller['update']);router[_0xa65c('0xf')](_0xa65c('0x10'),auth[_0xa65c('0xa')](),controller[_0xa65c('0x11')]);module[_0xa65c('0x12')]=router;
\ No newline at end of file
+var _0x2336=['multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','/:id','isAuthenticated','show','/:id/download','download','post','create','update','destroy','exports'];(function(_0x3b9afb,_0x2133f4){var _0x136e05=function(_0x1fb7e2){while(--_0x1fb7e2){_0x3b9afb['push'](_0x3b9afb['shift']());}};_0x136e05(++_0x2133f4);}(_0x2336,0x10a));var _0x6233=function(_0x24b8ec,_0x3c8c5b){_0x24b8ec=_0x24b8ec-0x0;var _0x1d1b63=_0x2336[_0x24b8ec];return _0x1d1b63;};'use strict';var multer=require(_0x6233('0x0'));var util=require(_0x6233('0x1'));var path=require('path');var timeout=require(_0x6233('0x2'));var express=require(_0x6233('0x3'));var router=express['Router']();var fs_extra=require(_0x6233('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6233('0x5'));var config=require(_0x6233('0x6'));var controller=require(_0x6233('0x7'));router[_0x6233('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6233('0x8')](_0x6233('0x9'),auth[_0x6233('0xa')](),controller[_0x6233('0xb')]);router['get'](_0x6233('0xc'),auth[_0x6233('0xa')](),controller[_0x6233('0xd')]);router[_0x6233('0xe')]('/',auth[_0x6233('0xa')](),controller[_0x6233('0xf')]);router['put'](_0x6233('0x9'),auth[_0x6233('0xa')](),controller[_0x6233('0x10')]);router['delete'](_0x6233('0x9'),auth[_0x6233('0xa')](),controller[_0x6233('0x11')]);module[_0x6233('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index e86381b..c6d8511 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 _0x3b74=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x2e2555,_0x3b1ad5){var _0x13dec4=function(_0x1f7f6c){while(--_0x1f7f6c){_0x2e2555['push'](_0x2e2555['shift']());}};_0x13dec4(++_0x3b1ad5);}(_0x3b74,0xd1));var _0x43b7=function(_0x1804e0,_0x3e69b7){_0x1804e0=_0x1804e0-0x0;var _0x29b36b=_0x3b74[_0x1804e0];return _0x29b36b;};'use strict';var Sequelize=require(_0x43b7('0x0'));module[_0x43b7('0x1')]={'field':{'type':Sequelize[_0x43b7('0x2')]},'alias':{'type':Sequelize[_0x43b7('0x3')]},'function':{'type':Sequelize[_0x43b7('0x3')]},'format':{'type':Sequelize[_0x43b7('0x3')]},'groupBy':{'type':Sequelize[_0x43b7('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x43b7('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x9330=['STRING','BOOLEAN','exports'];(function(_0x12e590,_0x75675b){var _0x4878f4=function(_0x4e2c12){while(--_0x4e2c12){_0x12e590['push'](_0x12e590['shift']());}};_0x4878f4(++_0x75675b);}(_0x9330,0x10d));var _0x0933=function(_0x4fe309,_0xd472cb){_0x4fe309=_0x4fe309-0x0;var _0x2b1f5c=_0x9330[_0x4fe309];return _0x2b1f5c;};'use strict';var Sequelize=require('sequelize');module[_0x0933('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x0933('0x1')]},'function':{'type':Sequelize[_0x0933('0x1')]},'format':{'type':Sequelize[_0x0933('0x1')]},'groupBy':{'type':Sequelize[_0x0933('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x0933('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 6e5fb7a..4b20480 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 _0xc485=['nolimit','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','create','body','bulkCreate','find','params','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','status','end','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields'];(function(_0x44f974,_0x4db616){var _0x805dbd=function(_0x1a56b7){while(--_0x1a56b7){_0x44f974['push'](_0x44f974['shift']());}};_0x805dbd(++_0x4db616);}(_0xc485,0x105));var _0x5c48=function(_0xdb628e,_0x103e9a){_0xdb628e=_0xdb628e-0x0;var _0x493aa5=_0xc485[_0xdb628e];return _0x493aa5;};'use strict';var emlformat=require(_0x5c48('0x0'));var rimraf=require(_0x5c48('0x1'));var zipdir=require(_0x5c48('0x2'));var jsonpatch=require(_0x5c48('0x3'));var rp=require(_0x5c48('0x4'));var moment=require(_0x5c48('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5c48('0x6'));var util=require(_0x5c48('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5c48('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5c48('0x9'));var jsforce=require(_0x5c48('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x5c48('0xb'));var querystring=require(_0x5c48('0xc'));var Papa=require(_0x5c48('0xd'));var Redis=require('ioredis');var authService=require(_0x5c48('0xe'));var qs=require(_0x5c48('0xf'));var as=require(_0x5c48('0x10'));var hardwareService=require(_0x5c48('0x11'));var logger=require(_0x5c48('0x12'))(_0x5c48('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5c48('0x14'));var db=require(_0x5c48('0x15'))['db'];function respondWithStatusCode(_0x427684,_0x37f8d9){_0x37f8d9=_0x37f8d9||0xcc;return function(_0x3df1d1){if(_0x3df1d1){return _0x427684[_0x5c48('0x16')](_0x37f8d9);}return _0x427684['status'](_0x37f8d9)['end']();};}function respondWithResult(_0x36cb51,_0x1c116e){_0x1c116e=_0x1c116e||0xc8;return function(_0x1e93bc){if(_0x1e93bc){return _0x36cb51['status'](_0x1c116e)[_0x5c48('0x17')](_0x1e93bc);}};}function respondWithFilteredResult(_0x3dda19,_0x36371b){return function(_0x19dc50){if(_0x19dc50){var _0x17a784=typeof _0x36371b[_0x5c48('0x18')]==='undefined'&&typeof _0x36371b[_0x5c48('0x19')]===_0x5c48('0x1a');var _0x12c781=_0x19dc50[_0x5c48('0x1b')];var _0x1b1877=_0x17a784?0x0:_0x36371b[_0x5c48('0x18')];var _0x4f57dc=_0x17a784?_0x19dc50['count']:_0x36371b[_0x5c48('0x18')]+_0x36371b['limit'];var _0x1f1c9a;if(_0x4f57dc>=_0x12c781){_0x4f57dc=_0x12c781;_0x1f1c9a=0xc8;}else{_0x1f1c9a=0xce;}_0x3dda19['status'](_0x1f1c9a);return _0x3dda19['set'](_0x5c48('0x1c'),_0x1b1877+'-'+_0x4f57dc+'/'+_0x12c781)['json'](_0x19dc50);}return null;};}function patchUpdates(_0x3a7975){return function(_0x2adb1d){try{jsonpatch[_0x5c48('0x1d')](_0x2adb1d,_0x3a7975,!![]);}catch(_0xc28b4c){return BPromise[_0x5c48('0x1e')](_0xc28b4c);}return _0x2adb1d[_0x5c48('0x1f')]();};}function saveUpdates(_0x5eb373,_0x175fa7){return function(_0x28c09b){if(_0x28c09b){return _0x28c09b[_0x5c48('0x20')](_0x5eb373)[_0x5c48('0x21')](function(_0x36bc86){return _0x36bc86;});}return null;};}function removeEntity(_0x63c5b1,_0x37c5eb){return function(_0x237380){if(_0x237380){return _0x237380[_0x5c48('0x22')]()[_0x5c48('0x21')](function(){_0x63c5b1[_0x5c48('0x23')](0xcc)[_0x5c48('0x24')]();});}};}function handleEntityNotFound(_0x1c2474,_0x18e2fe){return function(_0x468e49){if(!_0x468e49){_0x1c2474[_0x5c48('0x16')](0x194);}return _0x468e49;};}function handleError(_0x47b309,_0x72662c){_0x72662c=_0x72662c||0x1f4;return function(_0x1ad680){logger[_0x5c48('0x25')](_0x1ad680[_0x5c48('0x26')]);if(_0x1ad680[_0x5c48('0x27')]){delete _0x1ad680[_0x5c48('0x27')];}_0x47b309[_0x5c48('0x23')](_0x72662c)[_0x5c48('0x28')](_0x1ad680);};}exports[_0x5c48('0x29')]=function(_0x2391d8,_0x16f33b){var _0x7c1e9c={},_0x4d1623={},_0x5a5bf7={'count':0x0,'rows':[]};var _0x2c3131=_[_0x5c48('0x2a')](db[_0x5c48('0x2b')][_0x5c48('0x2c')],function(_0x4ec341){return{'name':_0x4ec341[_0x5c48('0x2d')],'type':_0x4ec341[_0x5c48('0x2e')][_0x5c48('0x2f')]};});_0x4d1623['model']=_[_0x5c48('0x2a')](_0x2c3131,_0x5c48('0x27'));_0x4d1623[_0x5c48('0x30')]=_[_0x5c48('0x31')](_0x2391d8[_0x5c48('0x30')]);_0x4d1623[_0x5c48('0x32')]=_[_0x5c48('0x33')](_0x4d1623[_0x5c48('0x34')],_0x4d1623[_0x5c48('0x30')]);_0x7c1e9c[_0x5c48('0x35')]=_[_0x5c48('0x33')](_0x4d1623[_0x5c48('0x34')],qs[_0x5c48('0x36')](_0x2391d8['query']['fields']));_0x7c1e9c[_0x5c48('0x35')]=_0x7c1e9c[_0x5c48('0x35')]['length']?_0x7c1e9c[_0x5c48('0x35')]:_0x4d1623[_0x5c48('0x34')];if(!_0x2391d8[_0x5c48('0x30')]['hasOwnProperty'](_0x5c48('0x37'))){_0x7c1e9c[_0x5c48('0x19')]=qs['limit'](_0x2391d8[_0x5c48('0x30')][_0x5c48('0x19')]);_0x7c1e9c['offset']=qs['offset'](_0x2391d8[_0x5c48('0x30')][_0x5c48('0x18')]);}_0x7c1e9c['order']=qs[_0x5c48('0x38')](_0x2391d8[_0x5c48('0x30')]['sort']);_0x7c1e9c['where']=qs[_0x5c48('0x32')](_[_0x5c48('0x39')](_0x2391d8[_0x5c48('0x30')],_0x4d1623['filters']),_0x2c3131);if(_0x2391d8[_0x5c48('0x30')][_0x5c48('0x3a')]){_0x7c1e9c[_0x5c48('0x3b')]=_['merge'](_0x7c1e9c['where'],{'$or':_[_0x5c48('0x2a')](_0x2c3131,function(_0x22faaa){if(_0x22faaa[_0x5c48('0x2e')]!=='VIRTUAL'){var _0x43bdac={};_0x43bdac[_0x22faaa['name']]={'$like':'%'+_0x2391d8[_0x5c48('0x30')][_0x5c48('0x3a')]+'%'};return _0x43bdac;}})});}_0x7c1e9c=_[_0x5c48('0x3c')]({},_0x7c1e9c,_0x2391d8[_0x5c48('0x3d')]);var _0xe36d2b={'where':_0x7c1e9c[_0x5c48('0x3b')]};return db[_0x5c48('0x2b')][_0x5c48('0x1b')](_0xe36d2b)[_0x5c48('0x21')](function(_0x18b3b1){_0x5a5bf7['count']=_0x18b3b1;if(_0x2391d8[_0x5c48('0x30')][_0x5c48('0x3e')]){_0x7c1e9c[_0x5c48('0x3f')]=[{'all':!![]}];}return db[_0x5c48('0x2b')][_0x5c48('0x40')](_0x7c1e9c);})[_0x5c48('0x21')](function(_0x35cf29){_0x5a5bf7[_0x5c48('0x41')]=_0x35cf29;return _0x5a5bf7;})[_0x5c48('0x21')](respondWithFilteredResult(_0x16f33b,_0x7c1e9c))[_0x5c48('0x42')](handleError(_0x16f33b,null));};exports['show']=function(_0x14036a,_0x5b8a6d){var _0x129860={'raw':![],'where':{'id':_0x14036a['params']['id']}},_0x20bc00={};_0x20bc00[_0x5c48('0x34')]=_[_0x5c48('0x31')](db['AnalyticFieldReport'][_0x5c48('0x2c')]);_0x20bc00[_0x5c48('0x30')]=_[_0x5c48('0x31')](_0x14036a[_0x5c48('0x30')]);_0x20bc00[_0x5c48('0x32')]=_[_0x5c48('0x33')](_0x20bc00[_0x5c48('0x34')],_0x20bc00[_0x5c48('0x30')]);_0x129860[_0x5c48('0x35')]=_[_0x5c48('0x33')](_0x20bc00[_0x5c48('0x34')],qs['fields'](_0x14036a[_0x5c48('0x30')][_0x5c48('0x36')]));_0x129860[_0x5c48('0x35')]=_0x129860[_0x5c48('0x35')]['length']?_0x129860[_0x5c48('0x35')]:_0x20bc00['model'];if(_0x14036a['query']['includeAll']){_0x129860[_0x5c48('0x3f')]=[{'all':!![]}];}_0x129860=_[_0x5c48('0x3c')]({},_0x129860,_0x14036a[_0x5c48('0x3d')]);return db[_0x5c48('0x2b')]['find'](_0x129860)[_0x5c48('0x21')](handleEntityNotFound(_0x5b8a6d,null))[_0x5c48('0x21')](respondWithResult(_0x5b8a6d,null))[_0x5c48('0x42')](handleError(_0x5b8a6d,null));};exports[_0x5c48('0x43')]=function(_0x4e0380,_0x5f1de4){return db[_0x5c48('0x2b')][_0x5c48('0x43')](_0x4e0380[_0x5c48('0x44')],{})[_0x5c48('0x21')](respondWithResult(_0x5f1de4,0xc9))[_0x5c48('0x42')](handleError(_0x5f1de4,null));};exports[_0x5c48('0x45')]=function(_0x16de15,_0x17f77c){return db['AnalyticFieldReport']['bulkCreate'](_0x16de15['body'],{'raw':![],'individualHooks':!![]})[_0x5c48('0x21')](respondWithResult(_0x17f77c,0xc9))[_0x5c48('0x42')](handleError(_0x17f77c,null));};exports[_0x5c48('0x20')]=function(_0x58c0f1,_0x396409){if(_0x58c0f1[_0x5c48('0x44')]['id']){delete _0x58c0f1[_0x5c48('0x44')]['id'];}return db[_0x5c48('0x2b')]['find']({'where':{'id':_0x58c0f1['params']['id']}})['then'](handleEntityNotFound(_0x396409,null))[_0x5c48('0x21')](saveUpdates(_0x58c0f1['body'],null))[_0x5c48('0x21')](respondWithResult(_0x396409,null))['catch'](handleError(_0x396409,null));};exports['destroy']=function(_0x44c605,_0x13895d){return db[_0x5c48('0x2b')][_0x5c48('0x46')]({'where':{'id':_0x44c605[_0x5c48('0x47')]['id']}})[_0x5c48('0x21')](handleEntityNotFound(_0x13895d,null))['then'](removeEntity(_0x13895d,null))['catch'](handleError(_0x13895d,null));};exports[_0x5c48('0x48')]=function(_0x422f26,_0x4a9b31){return db['AnalyticFieldReport'][_0x5c48('0x22')]({'where':{'id':_0x422f26[_0x5c48('0x30')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4a9b31,0xcc))[_0x5c48('0x42')](handleError(_0x4a9b31,null));};exports[_0x5c48('0x49')]=function(_0xc74a0a,_0x76aeae,_0x4e5fcf){return db[_0x5c48('0x4a')][_0x5c48('0x4b')]({'where':{'id':_0xc74a0a[_0x5c48('0x47')]['id']}})['then'](handleEntityNotFound(_0x76aeae,null))[_0x5c48('0x21')](function(_0x1d3c75){if(_0x1d3c75){return db[_0x5c48('0x4c')][_0x5c48('0x4d')](function(_0x2f9338){return db['AnalyticFieldReport'][_0x5c48('0x22')]({'where':{'CustomReportId':_0xc74a0a[_0x5c48('0x47')]['id']},'transaction':_0x2f9338})[_0x5c48('0x21')](function(_0xa102c4){var _0x3509f4=_[_0x5c48('0x2a')](_0xc74a0a[_0x5c48('0x44')],function(_0x254d43){delete _0x254d43['id'];_0x254d43[_0x5c48('0x4e')]=_0xc74a0a[_0x5c48('0x47')]['id'];return _0x254d43;});return db['AnalyticFieldReport'][_0x5c48('0x45')](_0x3509f4,{'transaction':_0x2f9338});});})['then'](function(){return db[_0x5c48('0x2b')][_0x5c48('0x40')]({'where':{'CustomReportId':_0xc74a0a[_0x5c48('0x47')]['id']}});});}})[_0x5c48('0x21')](respondWithResult(_0x76aeae,null))['catch'](handleError(_0x76aeae,null));};
\ No newline at end of file
+var _0xaa90=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','AnalyticFieldReport','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','create','body','bulkCreate','find','ids','addFields','AnalyticCustomReport','sequelize','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0xaad329,_0x842897){var _0x3c7540=function(_0x82b87){while(--_0x82b87){_0xaad329['push'](_0xaad329['shift']());}};_0x3c7540(++_0x842897);}(_0xaa90,0x96));var _0x0aa9=function(_0x208cce,_0x31fe39){_0x208cce=_0x208cce-0x0;var _0x300943=_0xaa90[_0x208cce];return _0x300943;};'use strict';var emlformat=require(_0x0aa9('0x0'));var rimraf=require(_0x0aa9('0x1'));var zipdir=require(_0x0aa9('0x2'));var jsonpatch=require(_0x0aa9('0x3'));var rp=require(_0x0aa9('0x4'));var moment=require(_0x0aa9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0aa9('0x6'));var util=require(_0x0aa9('0x7'));var path=require(_0x0aa9('0x8'));var sox=require('sox');var csv=require(_0x0aa9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0aa9('0xa'));var _=require(_0x0aa9('0xb'));var squel=require('squel');var crypto=require(_0x0aa9('0xc'));var jsforce=require(_0x0aa9('0xd'));var deskjs=require(_0x0aa9('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0aa9('0xf'));var Redis=require(_0x0aa9('0x10'));var authService=require(_0x0aa9('0x11'));var qs=require(_0x0aa9('0x12'));var as=require(_0x0aa9('0x13'));var hardwareService=require(_0x0aa9('0x14'));var logger=require(_0x0aa9('0x15'))(_0x0aa9('0x16'));var utils=require('../../config/utils');var config=require(_0x0aa9('0x17'));var licenseUtil=require(_0x0aa9('0x18'));var db=require(_0x0aa9('0x19'))['db'];function respondWithStatusCode(_0x180a9c,_0xc57710){_0xc57710=_0xc57710||0xcc;return function(_0x287c99){if(_0x287c99){return _0x180a9c[_0x0aa9('0x1a')](_0xc57710);}return _0x180a9c['status'](_0xc57710)[_0x0aa9('0x1b')]();};}function respondWithResult(_0x174519,_0x4cf59f){_0x4cf59f=_0x4cf59f||0xc8;return function(_0x292811){if(_0x292811){return _0x174519['status'](_0x4cf59f)[_0x0aa9('0x1c')](_0x292811);}};}function respondWithFilteredResult(_0x55b427,_0x4171f2){return function(_0x4e2d46){if(_0x4e2d46){var _0x150443=typeof _0x4171f2[_0x0aa9('0x1d')]==='undefined'&&typeof _0x4171f2[_0x0aa9('0x1e')]==='undefined';var _0x22eabd=_0x4e2d46['count'];var _0x17a140=_0x150443?0x0:_0x4171f2['offset'];var _0x1fc321=_0x150443?_0x4e2d46[_0x0aa9('0x1f')]:_0x4171f2[_0x0aa9('0x1d')]+_0x4171f2[_0x0aa9('0x1e')];var _0x2713fc;if(_0x1fc321>=_0x22eabd){_0x1fc321=_0x22eabd;_0x2713fc=0xc8;}else{_0x2713fc=0xce;}_0x55b427[_0x0aa9('0x20')](_0x2713fc);return _0x55b427[_0x0aa9('0x21')](_0x0aa9('0x22'),_0x17a140+'-'+_0x1fc321+'/'+_0x22eabd)[_0x0aa9('0x1c')](_0x4e2d46);}return null;};}function patchUpdates(_0x85a7){return function(_0x466da5){try{jsonpatch[_0x0aa9('0x23')](_0x466da5,_0x85a7,!![]);}catch(_0x111870){return BPromise[_0x0aa9('0x24')](_0x111870);}return _0x466da5[_0x0aa9('0x25')]();};}function saveUpdates(_0x1f456b,_0x2388e1){return function(_0x5c7ab5){if(_0x5c7ab5){return _0x5c7ab5[_0x0aa9('0x26')](_0x1f456b)['then'](function(_0x4f82f0){return _0x4f82f0;});}return null;};}function removeEntity(_0x5c3657,_0x3dab14){return function(_0x3cb25a){if(_0x3cb25a){return _0x3cb25a[_0x0aa9('0x27')]()[_0x0aa9('0x28')](function(){_0x5c3657[_0x0aa9('0x20')](0xcc)[_0x0aa9('0x1b')]();});}};}function handleEntityNotFound(_0x198950,_0x561fe5){return function(_0x684e7b){if(!_0x684e7b){_0x198950[_0x0aa9('0x1a')](0x194);}return _0x684e7b;};}function handleError(_0x4ab14c,_0x11d550){_0x11d550=_0x11d550||0x1f4;return function(_0x26b93d){logger[_0x0aa9('0x29')](_0x26b93d[_0x0aa9('0x2a')]);if(_0x26b93d['name']){delete _0x26b93d[_0x0aa9('0x2b')];}_0x4ab14c['status'](_0x11d550)['send'](_0x26b93d);};}exports[_0x0aa9('0x2c')]=function(_0x3afaab,_0x1a3bae){var _0x3e9596={},_0x287495={},_0x5bd214={'count':0x0,'rows':[]};var _0x3afddb=_[_0x0aa9('0x2d')](db[_0x0aa9('0x2e')][_0x0aa9('0x2f')],function(_0x3020bd){return{'name':_0x3020bd['fieldName'],'type':_0x3020bd[_0x0aa9('0x30')][_0x0aa9('0x31')]};});_0x287495[_0x0aa9('0x32')]=_[_0x0aa9('0x2d')](_0x3afddb,_0x0aa9('0x2b'));_0x287495[_0x0aa9('0x33')]=_[_0x0aa9('0x34')](_0x3afaab['query']);_0x287495['filters']=_['intersection'](_0x287495[_0x0aa9('0x32')],_0x287495[_0x0aa9('0x33')]);_0x3e9596[_0x0aa9('0x35')]=_[_0x0aa9('0x36')](_0x287495[_0x0aa9('0x32')],qs[_0x0aa9('0x37')](_0x3afaab[_0x0aa9('0x33')][_0x0aa9('0x37')]));_0x3e9596[_0x0aa9('0x35')]=_0x3e9596[_0x0aa9('0x35')][_0x0aa9('0x38')]?_0x3e9596['attributes']:_0x287495[_0x0aa9('0x32')];if(!_0x3afaab[_0x0aa9('0x33')][_0x0aa9('0x39')](_0x0aa9('0x3a'))){_0x3e9596[_0x0aa9('0x1e')]=qs[_0x0aa9('0x1e')](_0x3afaab['query'][_0x0aa9('0x1e')]);_0x3e9596[_0x0aa9('0x1d')]=qs['offset'](_0x3afaab[_0x0aa9('0x33')][_0x0aa9('0x1d')]);}_0x3e9596[_0x0aa9('0x3b')]=qs['sort'](_0x3afaab[_0x0aa9('0x33')][_0x0aa9('0x3c')]);_0x3e9596[_0x0aa9('0x3d')]=qs[_0x0aa9('0x3e')](_[_0x0aa9('0x3f')](_0x3afaab['query'],_0x287495['filters']),_0x3afddb);if(_0x3afaab['query'][_0x0aa9('0x40')]){_0x3e9596['where']=_[_0x0aa9('0x41')](_0x3e9596['where'],{'$or':_[_0x0aa9('0x2d')](_0x3afddb,function(_0x4329a0){if(_0x4329a0[_0x0aa9('0x30')]!==_0x0aa9('0x42')){var _0x2d6110={};_0x2d6110[_0x4329a0[_0x0aa9('0x2b')]]={'$like':'%'+_0x3afaab[_0x0aa9('0x33')][_0x0aa9('0x40')]+'%'};return _0x2d6110;}})});}_0x3e9596=_[_0x0aa9('0x41')]({},_0x3e9596,_0x3afaab[_0x0aa9('0x43')]);var _0x238d17={'where':_0x3e9596[_0x0aa9('0x3d')]};return db[_0x0aa9('0x2e')][_0x0aa9('0x1f')](_0x238d17)[_0x0aa9('0x28')](function(_0x2f4615){_0x5bd214['count']=_0x2f4615;if(_0x3afaab[_0x0aa9('0x33')][_0x0aa9('0x44')]){_0x3e9596['include']=[{'all':!![]}];}return db[_0x0aa9('0x2e')][_0x0aa9('0x45')](_0x3e9596);})[_0x0aa9('0x28')](function(_0x542b72){_0x5bd214[_0x0aa9('0x46')]=_0x542b72;return _0x5bd214;})[_0x0aa9('0x28')](respondWithFilteredResult(_0x1a3bae,_0x3e9596))[_0x0aa9('0x47')](handleError(_0x1a3bae,null));};exports[_0x0aa9('0x48')]=function(_0x54c3c0,_0x5477e0){var _0x13b573={'raw':![],'where':{'id':_0x54c3c0[_0x0aa9('0x49')]['id']}},_0x3eeb53={};_0x3eeb53[_0x0aa9('0x32')]=_[_0x0aa9('0x34')](db[_0x0aa9('0x2e')][_0x0aa9('0x2f')]);_0x3eeb53['query']=_[_0x0aa9('0x34')](_0x54c3c0[_0x0aa9('0x33')]);_0x3eeb53[_0x0aa9('0x3e')]=_[_0x0aa9('0x36')](_0x3eeb53[_0x0aa9('0x32')],_0x3eeb53[_0x0aa9('0x33')]);_0x13b573[_0x0aa9('0x35')]=_[_0x0aa9('0x36')](_0x3eeb53[_0x0aa9('0x32')],qs[_0x0aa9('0x37')](_0x54c3c0[_0x0aa9('0x33')][_0x0aa9('0x37')]));_0x13b573[_0x0aa9('0x35')]=_0x13b573['attributes'][_0x0aa9('0x38')]?_0x13b573['attributes']:_0x3eeb53['model'];if(_0x54c3c0[_0x0aa9('0x33')][_0x0aa9('0x44')]){_0x13b573['include']=[{'all':!![]}];}_0x13b573=_[_0x0aa9('0x41')]({},_0x13b573,_0x54c3c0[_0x0aa9('0x43')]);return db[_0x0aa9('0x2e')]['find'](_0x13b573)['then'](handleEntityNotFound(_0x5477e0,null))[_0x0aa9('0x28')](respondWithResult(_0x5477e0,null))[_0x0aa9('0x47')](handleError(_0x5477e0,null));};exports[_0x0aa9('0x4a')]=function(_0x3455ab,_0x503f9c){return db[_0x0aa9('0x2e')][_0x0aa9('0x4a')](_0x3455ab[_0x0aa9('0x4b')],{})[_0x0aa9('0x28')](respondWithResult(_0x503f9c,0xc9))[_0x0aa9('0x47')](handleError(_0x503f9c,null));};exports[_0x0aa9('0x4c')]=function(_0x418007,_0x4ab1fe){return db[_0x0aa9('0x2e')][_0x0aa9('0x4c')](_0x418007[_0x0aa9('0x4b')],{'raw':![],'individualHooks':!![]})[_0x0aa9('0x28')](respondWithResult(_0x4ab1fe,0xc9))[_0x0aa9('0x47')](handleError(_0x4ab1fe,null));};exports['update']=function(_0x2450a6,_0x5c029d){if(_0x2450a6['body']['id']){delete _0x2450a6[_0x0aa9('0x4b')]['id'];}return db['AnalyticFieldReport'][_0x0aa9('0x4d')]({'where':{'id':_0x2450a6[_0x0aa9('0x49')]['id']}})['then'](handleEntityNotFound(_0x5c029d,null))['then'](saveUpdates(_0x2450a6[_0x0aa9('0x4b')],null))['then'](respondWithResult(_0x5c029d,null))[_0x0aa9('0x47')](handleError(_0x5c029d,null));};exports[_0x0aa9('0x27')]=function(_0x225616,_0x4e37de){return db[_0x0aa9('0x2e')][_0x0aa9('0x4d')]({'where':{'id':_0x225616[_0x0aa9('0x49')]['id']}})['then'](handleEntityNotFound(_0x4e37de,null))[_0x0aa9('0x28')](removeEntity(_0x4e37de,null))[_0x0aa9('0x47')](handleError(_0x4e37de,null));};exports['bulkDestroy']=function(_0x316119,_0x13471a){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x316119[_0x0aa9('0x33')][_0x0aa9('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x0aa9('0x28')](respondWithResult(_0x13471a,0xcc))[_0x0aa9('0x47')](handleError(_0x13471a,null));};exports[_0x0aa9('0x4f')]=function(_0x30ad53,_0x290976,_0xb171bc){return db[_0x0aa9('0x50')]['findOne']({'where':{'id':_0x30ad53[_0x0aa9('0x49')]['id']}})[_0x0aa9('0x28')](handleEntityNotFound(_0x290976,null))[_0x0aa9('0x28')](function(_0x5864e0){if(_0x5864e0){return db[_0x0aa9('0x51')]['transaction'](function(_0x270d28){return db[_0x0aa9('0x2e')][_0x0aa9('0x27')]({'where':{'CustomReportId':_0x30ad53['params']['id']},'transaction':_0x270d28})['then'](function(_0x1c69c7){var _0x56a510=_['map'](_0x30ad53[_0x0aa9('0x4b')],function(_0x14a2c6){delete _0x14a2c6['id'];_0x14a2c6['CustomReportId']=_0x30ad53[_0x0aa9('0x49')]['id'];return _0x14a2c6;});return db[_0x0aa9('0x2e')][_0x0aa9('0x4c')](_0x56a510,{'transaction':_0x270d28});});})[_0x0aa9('0x28')](function(){return db[_0x0aa9('0x2e')]['findAll']({'where':{'CustomReportId':_0x30ad53[_0x0aa9('0x49')]['id']}});});}})[_0x0aa9('0x28')](respondWithResult(_0x290976,null))['catch'](handleError(_0x290976,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 0363054..9f43b5a 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 _0xc80e=['analytics_report_fields','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport'];(function(_0x204b09,_0x309f2a){var _0x38508d=function(_0x18d6f5){while(--_0x18d6f5){_0x204b09['push'](_0x204b09['shift']());}};_0x38508d(++_0x309f2a);}(_0xc80e,0x15d));var _0xec80=function(_0xb2320d,_0xe69d49){_0xb2320d=_0xb2320d-0x0;var _0x9db91a=_0xc80e[_0xb2320d];return _0x9db91a;};'use strict';var _=require(_0xec80('0x0'));var util=require(_0xec80('0x1'));var logger=require(_0xec80('0x2'))(_0xec80('0x3'));var moment=require('moment');var BPromise=require(_0xec80('0x4'));var rp=require(_0xec80('0x5'));var fs=require('fs');var path=require(_0xec80('0x6'));var rimraf=require('rimraf');var config=require(_0xec80('0x7'));var attributes=require(_0xec80('0x8'));module[_0xec80('0x9')]=function(_0x315a4f,_0x240161){return _0x315a4f['define'](_0xec80('0xa'),attributes,{'tableName':_0xec80('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3476=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','analytics_report_fields','lodash','util','../../config/logger'];(function(_0x543628,_0x2261d0){var _0x12f69a=function(_0x21ebca){while(--_0x21ebca){_0x543628['push'](_0x543628['shift']());}};_0x12f69a(++_0x2261d0);}(_0x3476,0x8d));var _0x6347=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x3476[_0x5cb1af];return _0x8d7940;};'use strict';var _=require(_0x6347('0x0'));var util=require(_0x6347('0x1'));var logger=require(_0x6347('0x2'))(_0x6347('0x3'));var moment=require(_0x6347('0x4'));var BPromise=require(_0x6347('0x5'));var rp=require(_0x6347('0x6'));var fs=require('fs');var path=require(_0x6347('0x7'));var rimraf=require(_0x6347('0x8'));var config=require(_0x6347('0x9'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x448ace,_0x3bbd08){return _0x448ace[_0x6347('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0x6347('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 fff1b72..7b8b8ae 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 _0x7a20=['request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0xfa4dad,_0x1ae1c9){var _0x454a6d=function(_0x46629d){while(--_0x46629d){_0xfa4dad['push'](_0xfa4dad['shift']());}};_0x454a6d(++_0x1ae1c9);}(_0x7a20,0x64));var _0x07a2=function(_0x39a51b,_0x29a07e){_0x39a51b=_0x39a51b-0x0;var _0x2e882f=_0x7a20[_0x39a51b];return _0x2e882f;};'use strict';var _=require(_0x07a2('0x0'));var util=require(_0x07a2('0x1'));var moment=require(_0x07a2('0x2'));var BPromise=require(_0x07a2('0x3'));var rs=require(_0x07a2('0x4'));var fs=require('fs');var Redis=require(_0x07a2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x07a2('0x6'));var logger=require(_0x07a2('0x7'))(_0x07a2('0x8'));var config=require(_0x07a2('0x9'));var jayson=require(_0x07a2('0xa'));var client=jayson[_0x07a2('0xb')][_0x07a2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xa24d82,_0x33fb70,_0x504732){return new BPromise(function(_0xc7d28a,_0x27b64f){return client[_0x07a2('0xd')](_0xa24d82,_0x504732)[_0x07a2('0xe')](function(_0x525a9c){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x33fb70,_0x07a2('0xf'));logger['debug'](_0x07a2('0x10'),_0x33fb70,_0x07a2('0xf'),JSON[_0x07a2('0x11')](_0x525a9c));if(_0x525a9c[_0x07a2('0x12')]){if(_0x525a9c[_0x07a2('0x12')]['code']===0x1f4){logger[_0x07a2('0x12')](_0x07a2('0x13'),_0x33fb70,_0x525a9c['error'][_0x07a2('0x14')]);return _0x27b64f(_0x525a9c['error'][_0x07a2('0x14')]);}logger[_0x07a2('0x12')](_0x07a2('0x13'),_0x33fb70,_0x525a9c[_0x07a2('0x12')][_0x07a2('0x14')]);return _0xc7d28a(_0x525a9c['error']['message']);}else{logger[_0x07a2('0x15')](_0x07a2('0x13'),_0x33fb70,_0x07a2('0xf'));_0xc7d28a(_0x525a9c[_0x07a2('0x16')]['message']);}})['catch'](function(_0x4fa504){logger[_0x07a2('0x12')](_0x07a2('0x13'),_0x33fb70,_0x4fa504);_0x27b64f(_0x4fa504);});});}
\ No newline at end of file
+var _0x4f7d=['message','result','catch','lodash','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x35e768,_0xbe0d60){var _0x58cc5f=function(_0x1b12fb){while(--_0x1b12fb){_0x35e768['push'](_0x35e768['shift']());}};_0x58cc5f(++_0xbe0d60);}(_0x4f7d,0x1f1));var _0xd4f7=function(_0x27b920,_0x2d5b4e){_0x27b920=_0x27b920-0x0;var _0x37c55e=_0x4f7d[_0x27b920];return _0x37c55e;};'use strict';var _=require(_0xd4f7('0x0'));var util=require('util');var moment=require(_0xd4f7('0x1'));var BPromise=require(_0xd4f7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd4f7('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd4f7('0x4'))('rpc');var config=require(_0xd4f7('0x5'));var jayson=require(_0xd4f7('0x6'));var client=jayson[_0xd4f7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48d64a,_0x2aa853,_0x1f7413){return new BPromise(function(_0x4b9852,_0xc0a275){return client[_0xd4f7('0x8')](_0x48d64a,_0x1f7413)[_0xd4f7('0x9')](function(_0x55ad16){logger[_0xd4f7('0xa')](_0xd4f7('0xb'),_0x2aa853,'request\x20sent');logger[_0xd4f7('0xc')](_0xd4f7('0xd'),_0x2aa853,'request\x20sent',JSON['stringify'](_0x55ad16));if(_0x55ad16[_0xd4f7('0xe')]){if(_0x55ad16[_0xd4f7('0xe')][_0xd4f7('0xf')]===0x1f4){logger['error'](_0xd4f7('0xb'),_0x2aa853,_0x55ad16[_0xd4f7('0xe')][_0xd4f7('0x10')]);return _0xc0a275(_0x55ad16[_0xd4f7('0xe')][_0xd4f7('0x10')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x2aa853,_0x55ad16['error'][_0xd4f7('0x10')]);return _0x4b9852(_0x55ad16[_0xd4f7('0xe')][_0xd4f7('0x10')]);}else{logger[_0xd4f7('0xa')](_0xd4f7('0xb'),_0x2aa853,'request\x20sent');_0x4b9852(_0x55ad16[_0xd4f7('0x11')]['message']);}})[_0xd4f7('0x12')](function(_0x46ecce){logger[_0xd4f7('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2aa853,_0x46ecce);_0xc0a275(_0x46ecce);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 31fd7a8..ec71130 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(_0x2381d5,_0x430612){var _0x4d4e0e=function(_0x553673){while(--_0x553673){_0x2381d5['push'](_0x2381d5['shift']());}};_0x4d4e0e(++_0x430612);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0x1b7395,_0x332d3a){var _0x449767=function(_0x494886){while(--_0x494886){_0x1b7395['push'](_0x1b7395['shift']());}};_0x449767(++_0x332d3a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 b54864d..89fdd33 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 _0xa75b=['sequelize','name','STRING','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa75b,0x170));var _0xba75=function(_0x203a21,_0x274fa9){_0x203a21=_0x203a21-0x0;var _0x3ce90a=_0xa75b[_0x203a21];return _0x3ce90a;};'use strict';var Sequelize=require(_0xba75('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xba75('0x1')},'table':{'type':Sequelize[_0xba75('0x2')]},'metric':{'type':Sequelize[_0xba75('0x3')]},'description':{'type':Sequelize[_0xba75('0x2')]}};
\ No newline at end of file
+var _0x315f=['sequelize','STRING','TEXT'];(function(_0x5a595f,_0x8a7e1f){var _0x39b1a8=function(_0x288676){while(--_0x288676){_0x5a595f['push'](_0x5a595f['shift']());}};_0x39b1a8(++_0x8a7e1f);}(_0x315f,0x174));var _0xf315=function(_0x7a112,_0x2eb4a0){_0x7a112=_0x7a112-0x0;var _0x136dc5=_0x315f[_0x7a112];return _0x136dc5;};'use strict';var Sequelize=require(_0xf315('0x0'));module['exports']={'name':{'type':Sequelize[_0xf315('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xf315('0x2')]},'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 7d38114..52a20eb 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 _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x16669a,_0x168e42){var _0x3db0b7=function(_0x4a5893){while(--_0x4a5893){_0x16669a['push'](_0x16669a['shift']());}};_0x3db0b7(++_0x168e42);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x26b1b8,_0x35bfd4){_0x26b1b8=_0x26b1b8-0x0;var _0x401762=_0x7fbe[_0x26b1b8];return _0x401762;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));};
\ No newline at end of file
+var _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy'];(function(_0x220720,_0x10d6b4){var _0x20f9a7=function(_0xfd086c){while(--_0xfd086c){_0x220720['push'](_0x220720['shift']());}};_0x20f9a7(++_0x10d6b4);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x2de683,_0x176de1){_0x2de683=_0x2de683-0x0;var _0x3b962c=_0x8d0e[_0x2de683];return _0x3b962c;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 37d4756..16a3bd3 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 _0x302c=['moment','path','rimraf','../../config/environment','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api'];(function(_0x34d275,_0x5d84ee){var _0x1379cc=function(_0x320fbe){while(--_0x320fbe){_0x34d275['push'](_0x34d275['shift']());}};_0x1379cc(++_0x5d84ee);}(_0x302c,0x15c));var _0xc302=function(_0x1fb2c6,_0x4a5110){_0x1fb2c6=_0x1fb2c6-0x0;var _0x187e7f=_0x302c[_0x1fb2c6];return _0x187e7f;};'use strict';var _=require(_0xc302('0x0'));var util=require(_0xc302('0x1'));var logger=require(_0xc302('0x2'))(_0xc302('0x3'));var moment=require(_0xc302('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc302('0x5'));var rimraf=require(_0xc302('0x6'));var config=require(_0xc302('0x7'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x13139e,_0x59ba1e){return _0x13139e[_0xc302('0x8')](_0xc302('0x9'),attributes,{'tableName':_0xc302('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa2c8=['exports','define','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x31df10,_0x312458){var _0x3ce6e8=function(_0x187ea0){while(--_0x187ea0){_0x31df10['push'](_0x31df10['shift']());}};_0x3ce6e8(++_0x312458);}(_0xa2c8,0x99));var _0x8a2c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa2c8[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8a2c('0x0'));var util=require(_0x8a2c('0x1'));var logger=require(_0x8a2c('0x2'))(_0x8a2c('0x3'));var moment=require(_0x8a2c('0x4'));var BPromise=require(_0x8a2c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a2c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x8a2c('0x7')]=function(_0x40fb26,_0x3f754a){return _0x40fb26[_0x8a2c('0x8')]('AnalyticMetric',attributes,{'tableName':_0x8a2c('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 0c55aaa..a032ab6 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 _0x2aa9=['../../config/logger','rpc','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0x2aa9,0x18a));var _0x92aa=function(_0x305753,_0x299ca1){_0x305753=_0x305753-0x0;var _0x3ad6ff=_0x2aa9[_0x305753];return _0x3ad6ff;};'use strict';var _=require(_0x92aa('0x0'));var util=require(_0x92aa('0x1'));var moment=require(_0x92aa('0x2'));var BPromise=require(_0x92aa('0x3'));var rs=require(_0x92aa('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92aa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x92aa('0x6'))(_0x92aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x92aa('0x8')][_0x92aa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x486b33,_0x7655b7,_0x3a0ec5){return new BPromise(function(_0x60d396,_0x361f52){return client['request'](_0x486b33,_0x3a0ec5)[_0x92aa('0xa')](function(_0x27b665){logger[_0x92aa('0xb')](_0x92aa('0xc'),_0x7655b7,_0x92aa('0xd'));logger[_0x92aa('0xe')](_0x92aa('0xf'),_0x7655b7,_0x92aa('0xd'),JSON[_0x92aa('0x10')](_0x27b665));if(_0x27b665['error']){if(_0x27b665[_0x92aa('0x11')]['code']===0x1f4){logger[_0x92aa('0x11')](_0x92aa('0xc'),_0x7655b7,_0x27b665['error'][_0x92aa('0x12')]);return _0x361f52(_0x27b665[_0x92aa('0x11')][_0x92aa('0x12')]);}logger[_0x92aa('0x11')](_0x92aa('0xc'),_0x7655b7,_0x27b665['error'][_0x92aa('0x12')]);return _0x60d396(_0x27b665[_0x92aa('0x11')][_0x92aa('0x12')]);}else{logger[_0x92aa('0xb')](_0x92aa('0xc'),_0x7655b7,_0x92aa('0xd'));_0x60d396(_0x27b665['result']['message']);}})[_0x92aa('0x13')](function(_0x35e1aa){logger[_0x92aa('0x11')](_0x92aa('0xc'),_0x7655b7,_0x35e1aa);_0x361f52(_0x35e1aa);});});}
\ No newline at end of file
+var _0xa99e=['message','info','result','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s'];(function(_0x3302e4,_0x56c7c7){var _0x2a1a12=function(_0x1fb13b){while(--_0x1fb13b){_0x3302e4['push'](_0x3302e4['shift']());}};_0x2a1a12(++_0x56c7c7);}(_0xa99e,0x192));var _0xea99=function(_0x4db382,_0x148b4a){_0x4db382=_0x4db382-0x0;var _0x589490=_0xa99e[_0x4db382];return _0x589490;};'use strict';var _=require(_0xea99('0x0'));var util=require(_0xea99('0x1'));var moment=require(_0xea99('0x2'));var BPromise=require(_0xea99('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea99('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xea99('0x5'));var logger=require('../../config/logger')(_0xea99('0x6'));var config=require('../../config/environment');var jayson=require(_0xea99('0x7'));var client=jayson[_0xea99('0x8')][_0xea99('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c8381,_0x41c0d9,_0x4d5158){return new BPromise(function(_0x1bb6c0,_0x1d15ec){return client[_0xea99('0xa')](_0x4c8381,_0x4d5158)['then'](function(_0x3ed57d){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x41c0d9,_0xea99('0xb'));logger['debug'](_0xea99('0xc'),_0x41c0d9,'request\x20sent',JSON[_0xea99('0xd')](_0x3ed57d));if(_0x3ed57d['error']){if(_0x3ed57d['error']['code']===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x41c0d9,_0x3ed57d['error']['message']);return _0x1d15ec(_0x3ed57d[_0xea99('0xe')]['message']);}logger[_0xea99('0xe')](_0xea99('0xf'),_0x41c0d9,_0x3ed57d['error'][_0xea99('0x10')]);return _0x1bb6c0(_0x3ed57d['error']['message']);}else{logger[_0xea99('0x11')](_0xea99('0xf'),_0x41c0d9,'request\x20sent');_0x1bb6c0(_0x3ed57d[_0xea99('0x12')][_0xea99('0x10')]);}})['catch'](function(_0xdde944){logger[_0xea99('0xe')](_0xea99('0xf'),_0x41c0d9,_0xdde944);_0x1d15ec(_0xdde944);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 218b450..2f0bec9 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 _0x5fd1=['exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','destroy'];(function(_0x568172,_0x173414){var _0xda2d46=function(_0x2f2a03){while(--_0x2f2a03){_0x568172['push'](_0x568172['shift']());}};_0xda2d46(++_0x173414);}(_0x5fd1,0x155));var _0x15fd=function(_0x2fa263,_0x38401e){_0x2fa263=_0x2fa263-0x0;var _0x13f4ea=_0x5fd1[_0x2fa263];return _0x13f4ea;};'use strict';var multer=require(_0x15fd('0x0'));var util=require('util');var path=require(_0x15fd('0x1'));var timeout=require(_0x15fd('0x2'));var express=require(_0x15fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x15fd('0x4'));var interaction=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var controller=require('./analyticMetric.controller');router[_0x15fd('0x7')]('/',auth[_0x15fd('0x8')](),controller[_0x15fd('0x9')]);router[_0x15fd('0x7')](_0x15fd('0xa'),auth['isAuthenticated'](),controller[_0x15fd('0xb')]);router[_0x15fd('0xc')]('/',auth[_0x15fd('0x8')](),controller['create']);router[_0x15fd('0xd')]('/:id',auth[_0x15fd('0x8')](),controller[_0x15fd('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x15fd('0xf')]);module[_0x15fd('0x10')]=router;
\ No newline at end of file
+var _0x423b=['isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','util','connect-timeout','Router','../../config/environment','./analyticMetric.controller'];(function(_0x41d432,_0x20e878){var _0x1650f9=function(_0x27f177){while(--_0x27f177){_0x41d432['push'](_0x41d432['shift']());}};_0x1650f9(++_0x20e878);}(_0x423b,0x12b));var _0xb423=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x423b[_0x44bcb0];return _0xfaf881;};'use strict';var multer=require('multer');var util=require(_0xb423('0x0'));var path=require('path');var timeout=require(_0xb423('0x1'));var express=require('express');var router=express[_0xb423('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb423('0x3'));var controller=require(_0xb423('0x4'));router['get']('/',auth[_0xb423('0x5')](),controller[_0xb423('0x6')]);router[_0xb423('0x7')](_0xb423('0x8'),auth['isAuthenticated'](),controller[_0xb423('0x9')]);router[_0xb423('0xa')]('/',auth[_0xb423('0x5')](),controller[_0xb423('0xb')]);router[_0xb423('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xb423('0xd')]);router[_0xb423('0xe')](_0xb423('0x8'),auth[_0xb423('0x5')](),controller[_0xb423('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 4f392eb..d4b50a6 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 _0x16c1=['sequelize','exports','TEXT'];(function(_0x48f85a,_0x1efd94){var _0x1bd655=function(_0x1a800d){while(--_0x1a800d){_0x48f85a['push'](_0x48f85a['shift']());}};_0x1bd655(++_0x1efd94);}(_0x16c1,0x66));var _0x116c=function(_0x46b079,_0x55b2bb){_0x46b079=_0x46b079-0x0;var _0x5c2a9f=_0x16c1[_0x46b079];return _0x5c2a9f;};'use strict';var Sequelize=require(_0x116c('0x0'));module[_0x116c('0x1')]={'tree':{'type':Sequelize[_0x116c('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xeda6=['sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xeda6,0xa3));var _0x6eda=function(_0x45030a,_0x4d1f2e){_0x45030a=_0x45030a-0x0;var _0x5bba0c=_0xeda6[_0x45030a];return _0x5bba0c;};'use strict';var Sequelize=require(_0x6eda('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index e399166..143e5bf 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 _0xb10f=['sox','to-csv','ejs','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb10f,0x160));var _0xfb10=function(_0x551e5,_0x107952){_0x551e5=_0x551e5-0x0;var _0x2b6288=_0xb10f[_0x551e5];return _0x2b6288;};'use strict';var emlformat=require(_0xfb10('0x0'));var rimraf=require(_0xfb10('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb10('0x2'));var rp=require('request-promise');var moment=require(_0xfb10('0x3'));var BPromise=require(_0xfb10('0x4'));var Mustache=require(_0xfb10('0x5'));var util=require(_0xfb10('0x6'));var path=require(_0xfb10('0x7'));var sox=require(_0xfb10('0x8'));var csv=require(_0xfb10('0x9'));var ejs=require(_0xfb10('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xfb10('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfb10('0xc'));var toCsv=require(_0xfb10('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfb10('0xd'));var authService=require(_0xfb10('0xe'));var qs=require(_0xfb10('0xf'));var as=require(_0xfb10('0x10'));var hardwareService=require(_0xfb10('0x11'));var logger=require('../../config/logger')(_0xfb10('0x12'));var utils=require(_0xfb10('0x13'));var config=require(_0xfb10('0x14'));var licenseUtil=require(_0xfb10('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x517e1e,_0x3df9ac){_0x3df9ac=_0x3df9ac||0xcc;return function(_0x3fe5b8){if(_0x3fe5b8){return _0x517e1e[_0xfb10('0x16')](_0x3df9ac);}return _0x517e1e[_0xfb10('0x17')](_0x3df9ac)[_0xfb10('0x18')]();};}function respondWithResult(_0x187ab8,_0x5b70b3){_0x5b70b3=_0x5b70b3||0xc8;return function(_0x436cb5){if(_0x436cb5){return _0x187ab8[_0xfb10('0x17')](_0x5b70b3)['json'](_0x436cb5);}};}function respondWithFilteredResult(_0x59e321,_0x3852bf){return function(_0x4cdb94){if(_0x4cdb94){var _0x3eb1d2=typeof _0x3852bf[_0xfb10('0x19')]===_0xfb10('0x1a')&&typeof _0x3852bf[_0xfb10('0x1b')]===_0xfb10('0x1a');var _0x456849=_0x4cdb94[_0xfb10('0x1c')];var _0x43b19b=_0x3eb1d2?0x0:_0x3852bf[_0xfb10('0x19')];var _0x4cf7bc=_0x3eb1d2?_0x4cdb94[_0xfb10('0x1c')]:_0x3852bf[_0xfb10('0x19')]+_0x3852bf[_0xfb10('0x1b')];var _0x573725;if(_0x4cf7bc>=_0x456849){_0x4cf7bc=_0x456849;_0x573725=0xc8;}else{_0x573725=0xce;}_0x59e321[_0xfb10('0x17')](_0x573725);return _0x59e321[_0xfb10('0x1d')](_0xfb10('0x1e'),_0x43b19b+'-'+_0x4cf7bc+'/'+_0x456849)[_0xfb10('0x1f')](_0x4cdb94);}return null;};}function patchUpdates(_0x243dc9){return function(_0x583bbd){try{jsonpatch[_0xfb10('0x20')](_0x583bbd,_0x243dc9,!![]);}catch(_0x1566d3){return BPromise[_0xfb10('0x21')](_0x1566d3);}return _0x583bbd[_0xfb10('0x22')]();};}function saveUpdates(_0x50a4af,_0x2c2315){return function(_0x546372){if(_0x546372){return _0x546372[_0xfb10('0x23')](_0x50a4af)[_0xfb10('0x24')](function(_0x8e2d70){return _0x8e2d70;});}return null;};}function removeEntity(_0x5a1062,_0x5f1a90){return function(_0x5347f0){if(_0x5347f0){return _0x5347f0[_0xfb10('0x25')]()[_0xfb10('0x24')](function(){_0x5a1062[_0xfb10('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30ddf2,_0x1ff69e){return function(_0x445fc6){if(!_0x445fc6){_0x30ddf2[_0xfb10('0x16')](0x194);}return _0x445fc6;};}function handleError(_0xdd1ee0,_0x1246bf){_0x1246bf=_0x1246bf||0x1f4;return function(_0x49ca50){logger[_0xfb10('0x26')](_0x49ca50[_0xfb10('0x27')]);if(_0x49ca50[_0xfb10('0x28')]){delete _0x49ca50[_0xfb10('0x28')];}_0xdd1ee0[_0xfb10('0x17')](_0x1246bf)[_0xfb10('0x29')](_0x49ca50);};}exports[_0xfb10('0x2a')]=function(_0x2d4caf,_0x36735e){var _0x2cb4c0={},_0x583a70={},_0x2c054d={'count':0x0,'rows':[]};var _0x495b58=_['map'](db[_0xfb10('0x2b')][_0xfb10('0x2c')],function(_0x145d98){return{'name':_0x145d98[_0xfb10('0x2d')],'type':_0x145d98[_0xfb10('0x2e')][_0xfb10('0x2f')]};});_0x583a70[_0xfb10('0x30')]=_[_0xfb10('0x31')](_0x495b58,_0xfb10('0x28'));_0x583a70[_0xfb10('0x32')]=_[_0xfb10('0x33')](_0x2d4caf[_0xfb10('0x32')]);_0x583a70[_0xfb10('0x34')]=_['intersection'](_0x583a70[_0xfb10('0x30')],_0x583a70[_0xfb10('0x32')]);_0x2cb4c0['attributes']=_[_0xfb10('0x35')](_0x583a70[_0xfb10('0x30')],qs['fields'](_0x2d4caf[_0xfb10('0x32')][_0xfb10('0x36')]));_0x2cb4c0['attributes']=_0x2cb4c0[_0xfb10('0x37')][_0xfb10('0x38')]?_0x2cb4c0[_0xfb10('0x37')]:_0x583a70[_0xfb10('0x30')];if(!_0x2d4caf['query']['hasOwnProperty'](_0xfb10('0x39'))){_0x2cb4c0['limit']=qs[_0xfb10('0x1b')](_0x2d4caf['query']['limit']);_0x2cb4c0[_0xfb10('0x19')]=qs[_0xfb10('0x19')](_0x2d4caf['query'][_0xfb10('0x19')]);}_0x2cb4c0['order']=qs['sort'](_0x2d4caf[_0xfb10('0x32')][_0xfb10('0x3a')]);_0x2cb4c0[_0xfb10('0x3b')]=qs[_0xfb10('0x34')](_['pick'](_0x2d4caf[_0xfb10('0x32')],_0x583a70[_0xfb10('0x34')]),_0x495b58);if(_0x2d4caf[_0xfb10('0x32')][_0xfb10('0x3c')]){_0x2cb4c0[_0xfb10('0x3b')]=_[_0xfb10('0x3d')](_0x2cb4c0[_0xfb10('0x3b')],{'$or':_[_0xfb10('0x31')](_0x495b58,function(_0x54976e){if(_0x54976e[_0xfb10('0x2e')]!=='VIRTUAL'){var _0x38575d={};_0x38575d[_0x54976e[_0xfb10('0x28')]]={'$like':'%'+_0x2d4caf[_0xfb10('0x32')][_0xfb10('0x3c')]+'%'};return _0x38575d;}})});}_0x2cb4c0=_[_0xfb10('0x3d')]({},_0x2cb4c0,_0x2d4caf[_0xfb10('0x3e')]);var _0x451d4f={'where':_0x2cb4c0['where']};return db[_0xfb10('0x2b')][_0xfb10('0x1c')](_0x451d4f)[_0xfb10('0x24')](function(_0x587e2e){_0x2c054d[_0xfb10('0x1c')]=_0x587e2e;if(_0x2d4caf['query'][_0xfb10('0x3f')]){_0x2cb4c0[_0xfb10('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xfb10('0x41')](_0x2cb4c0);})['then'](function(_0x531360){_0x2c054d[_0xfb10('0x42')]=_0x531360;return _0x2c054d;})[_0xfb10('0x24')](respondWithFilteredResult(_0x36735e,_0x2cb4c0))[_0xfb10('0x43')](handleError(_0x36735e,null));};exports['show']=function(_0x996047,_0x51804f){var _0x1f84bd={'raw':!![],'where':{'id':_0x996047[_0xfb10('0x44')]['id']}},_0xea909e={};_0xea909e['model']=_[_0xfb10('0x33')](db[_0xfb10('0x2b')]['rawAttributes']);_0xea909e[_0xfb10('0x32')]=_[_0xfb10('0x33')](_0x996047[_0xfb10('0x32')]);_0xea909e[_0xfb10('0x34')]=_[_0xfb10('0x35')](_0xea909e[_0xfb10('0x30')],_0xea909e[_0xfb10('0x32')]);_0x1f84bd[_0xfb10('0x37')]=_[_0xfb10('0x35')](_0xea909e[_0xfb10('0x30')],qs['fields'](_0x996047[_0xfb10('0x32')][_0xfb10('0x36')]));_0x1f84bd[_0xfb10('0x37')]=_0x1f84bd['attributes'][_0xfb10('0x38')]?_0x1f84bd[_0xfb10('0x37')]:_0xea909e[_0xfb10('0x30')];if(_0x996047[_0xfb10('0x32')][_0xfb10('0x3f')]){_0x1f84bd[_0xfb10('0x40')]=[{'all':!![]}];}_0x1f84bd=_['merge']({},_0x1f84bd,_0x996047[_0xfb10('0x3e')]);return db[_0xfb10('0x2b')][_0xfb10('0x45')](_0x1f84bd)['then'](handleEntityNotFound(_0x51804f,null))[_0xfb10('0x24')](respondWithResult(_0x51804f,null))['catch'](handleError(_0x51804f,null));};exports[_0xfb10('0x46')]=function(_0x52a15b,_0x46d854){return db[_0xfb10('0x2b')][_0xfb10('0x46')](_0x52a15b['body'],{})[_0xfb10('0x24')](respondWithResult(_0x46d854,0xc9))[_0xfb10('0x43')](handleError(_0x46d854,null));};exports[_0xfb10('0x23')]=function(_0x1fdbc7,_0x423d52){if(_0x1fdbc7[_0xfb10('0x47')]['id']){delete _0x1fdbc7[_0xfb10('0x47')]['id'];}return db[_0xfb10('0x2b')]['find']({'where':{'id':_0x1fdbc7[_0xfb10('0x44')]['id']}})[_0xfb10('0x24')](handleEntityNotFound(_0x423d52,null))[_0xfb10('0x24')](saveUpdates(_0x1fdbc7[_0xfb10('0x47')],null))[_0xfb10('0x24')](respondWithResult(_0x423d52,null))[_0xfb10('0x43')](handleError(_0x423d52,null));};exports['destroy']=function(_0x56c770,_0x502b62){return db[_0xfb10('0x2b')][_0xfb10('0x45')]({'where':{'id':_0x56c770[_0xfb10('0x44')]['id']}})[_0xfb10('0x24')](handleEntityNotFound(_0x502b62,null))['then'](removeEntity(_0x502b62,null))[_0xfb10('0x43')](handleError(_0x502b62,null));};
\ No newline at end of file
+var _0x58ca=['count','set','apply','reject','save','update','then','end','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','params','AnalyticTreeReport','length','options','find','create','body','destroy','eml-format','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit'];(function(_0x22696a,_0x214fd1){var _0x48b6c4=function(_0x3653b0){while(--_0x3653b0){_0x22696a['push'](_0x22696a['shift']());}};_0x48b6c4(++_0x214fd1);}(_0x58ca,0xff));var _0xa58c=function(_0x1e855f,_0x326f9c){_0x1e855f=_0x1e855f-0x0;var _0x1069b9=_0x58ca[_0x1e855f];return _0x1069b9;};'use strict';var emlformat=require(_0xa58c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa58c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa58c('0x2'));var moment=require(_0xa58c('0x3'));var BPromise=require(_0xa58c('0x4'));var Mustache=require('mustache');var util=require(_0xa58c('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xa58c('0x6'));var ejs=require(_0xa58c('0x7'));var fs=require('fs');var fs_extra=require(_0xa58c('0x8'));var _=require(_0xa58c('0x9'));var squel=require(_0xa58c('0xa'));var crypto=require(_0xa58c('0xb'));var jsforce=require(_0xa58c('0xc'));var deskjs=require(_0xa58c('0xd'));var toCsv=require(_0xa58c('0x6'));var querystring=require(_0xa58c('0xe'));var Papa=require(_0xa58c('0xf'));var Redis=require(_0xa58c('0x10'));var authService=require(_0xa58c('0x11'));var qs=require(_0xa58c('0x12'));var as=require(_0xa58c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa58c('0x14'))(_0xa58c('0x15'));var utils=require(_0xa58c('0x16'));var config=require(_0xa58c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa58c('0x18'))['db'];function respondWithStatusCode(_0x5b8e01,_0x365484){_0x365484=_0x365484||0xcc;return function(_0x13919e){if(_0x13919e){return _0x5b8e01['sendStatus'](_0x365484);}return _0x5b8e01[_0xa58c('0x19')](_0x365484)['end']();};}function respondWithResult(_0x32ab5d,_0x3e381e){_0x3e381e=_0x3e381e||0xc8;return function(_0x51cf81){if(_0x51cf81){return _0x32ab5d['status'](_0x3e381e)[_0xa58c('0x1a')](_0x51cf81);}};}function respondWithFilteredResult(_0x306752,_0x5b7907){return function(_0x4cda22){if(_0x4cda22){var _0x128b98=typeof _0x5b7907[_0xa58c('0x1b')]==='undefined'&&typeof _0x5b7907[_0xa58c('0x1c')]==='undefined';var _0x485e38=_0x4cda22[_0xa58c('0x1d')];var _0x1f8ccd=_0x128b98?0x0:_0x5b7907[_0xa58c('0x1b')];var _0x375319=_0x128b98?_0x4cda22[_0xa58c('0x1d')]:_0x5b7907[_0xa58c('0x1b')]+_0x5b7907[_0xa58c('0x1c')];var _0x2e9490;if(_0x375319>=_0x485e38){_0x375319=_0x485e38;_0x2e9490=0xc8;}else{_0x2e9490=0xce;}_0x306752[_0xa58c('0x19')](_0x2e9490);return _0x306752[_0xa58c('0x1e')]('Content-Range',_0x1f8ccd+'-'+_0x375319+'/'+_0x485e38)[_0xa58c('0x1a')](_0x4cda22);}return null;};}function patchUpdates(_0x5a44b9){return function(_0x42733d){try{jsonpatch[_0xa58c('0x1f')](_0x42733d,_0x5a44b9,!![]);}catch(_0x4808c2){return BPromise[_0xa58c('0x20')](_0x4808c2);}return _0x42733d[_0xa58c('0x21')]();};}function saveUpdates(_0x2314be,_0x13c4a4){return function(_0x3bc1aa){if(_0x3bc1aa){return _0x3bc1aa[_0xa58c('0x22')](_0x2314be)[_0xa58c('0x23')](function(_0x42251d){return _0x42251d;});}return null;};}function removeEntity(_0x44126e,_0x6e61df){return function(_0x56c25d){if(_0x56c25d){return _0x56c25d['destroy']()[_0xa58c('0x23')](function(){_0x44126e[_0xa58c('0x19')](0xcc)[_0xa58c('0x24')]();});}};}function handleEntityNotFound(_0x56811f,_0x3f0495){return function(_0x1fac05){if(!_0x1fac05){_0x56811f['sendStatus'](0x194);}return _0x1fac05;};}function handleError(_0x9ebed2,_0x3b38bc){_0x3b38bc=_0x3b38bc||0x1f4;return function(_0x1c43c5){logger[_0xa58c('0x25')](_0x1c43c5[_0xa58c('0x26')]);if(_0x1c43c5[_0xa58c('0x27')]){delete _0x1c43c5[_0xa58c('0x27')];}_0x9ebed2['status'](_0x3b38bc)['send'](_0x1c43c5);};}exports[_0xa58c('0x28')]=function(_0x3f41c1,_0x552cd0){var _0x4f89f7={},_0x379cbb={},_0x52ea3a={'count':0x0,'rows':[]};var _0xe5714a=_[_0xa58c('0x29')](db['AnalyticTreeReport'][_0xa58c('0x2a')],function(_0x5100e2){return{'name':_0x5100e2['fieldName'],'type':_0x5100e2[_0xa58c('0x2b')][_0xa58c('0x2c')]};});_0x379cbb[_0xa58c('0x2d')]=_[_0xa58c('0x29')](_0xe5714a,'name');_0x379cbb[_0xa58c('0x2e')]=_[_0xa58c('0x2f')](_0x3f41c1['query']);_0x379cbb[_0xa58c('0x30')]=_[_0xa58c('0x31')](_0x379cbb[_0xa58c('0x2d')],_0x379cbb['query']);_0x4f89f7[_0xa58c('0x32')]=_['intersection'](_0x379cbb[_0xa58c('0x2d')],qs['fields'](_0x3f41c1[_0xa58c('0x2e')][_0xa58c('0x33')]));_0x4f89f7['attributes']=_0x4f89f7['attributes']['length']?_0x4f89f7[_0xa58c('0x32')]:_0x379cbb[_0xa58c('0x2d')];if(!_0x3f41c1[_0xa58c('0x2e')]['hasOwnProperty'](_0xa58c('0x34'))){_0x4f89f7[_0xa58c('0x1c')]=qs[_0xa58c('0x1c')](_0x3f41c1[_0xa58c('0x2e')][_0xa58c('0x1c')]);_0x4f89f7['offset']=qs[_0xa58c('0x1b')](_0x3f41c1['query']['offset']);}_0x4f89f7[_0xa58c('0x35')]=qs[_0xa58c('0x36')](_0x3f41c1['query'][_0xa58c('0x36')]);_0x4f89f7[_0xa58c('0x37')]=qs[_0xa58c('0x30')](_['pick'](_0x3f41c1[_0xa58c('0x2e')],_0x379cbb['filters']),_0xe5714a);if(_0x3f41c1[_0xa58c('0x2e')][_0xa58c('0x38')]){_0x4f89f7[_0xa58c('0x37')]=_[_0xa58c('0x39')](_0x4f89f7[_0xa58c('0x37')],{'$or':_['map'](_0xe5714a,function(_0x45e1e1){if(_0x45e1e1['type']!=='VIRTUAL'){var _0x3ddd86={};_0x3ddd86[_0x45e1e1[_0xa58c('0x27')]]={'$like':'%'+_0x3f41c1['query'][_0xa58c('0x38')]+'%'};return _0x3ddd86;}})});}_0x4f89f7=_['merge']({},_0x4f89f7,_0x3f41c1['options']);var _0x4a1544={'where':_0x4f89f7[_0xa58c('0x37')]};return db['AnalyticTreeReport'][_0xa58c('0x1d')](_0x4a1544)['then'](function(_0x3d25ef){_0x52ea3a[_0xa58c('0x1d')]=_0x3d25ef;if(_0x3f41c1['query'][_0xa58c('0x3a')]){_0x4f89f7[_0xa58c('0x3b')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xa58c('0x3c')](_0x4f89f7);})[_0xa58c('0x23')](function(_0x2e0e3c){_0x52ea3a[_0xa58c('0x3d')]=_0x2e0e3c;return _0x52ea3a;})[_0xa58c('0x23')](respondWithFilteredResult(_0x552cd0,_0x4f89f7))[_0xa58c('0x3e')](handleError(_0x552cd0,null));};exports['show']=function(_0x21fa6c,_0x5d119e){var _0x109a22={'raw':!![],'where':{'id':_0x21fa6c[_0xa58c('0x3f')]['id']}},_0x7570ce={};_0x7570ce[_0xa58c('0x2d')]=_[_0xa58c('0x2f')](db[_0xa58c('0x40')][_0xa58c('0x2a')]);_0x7570ce[_0xa58c('0x2e')]=_[_0xa58c('0x2f')](_0x21fa6c[_0xa58c('0x2e')]);_0x7570ce['filters']=_[_0xa58c('0x31')](_0x7570ce['model'],_0x7570ce['query']);_0x109a22['attributes']=_[_0xa58c('0x31')](_0x7570ce['model'],qs[_0xa58c('0x33')](_0x21fa6c[_0xa58c('0x2e')][_0xa58c('0x33')]));_0x109a22['attributes']=_0x109a22[_0xa58c('0x32')][_0xa58c('0x41')]?_0x109a22[_0xa58c('0x32')]:_0x7570ce[_0xa58c('0x2d')];if(_0x21fa6c[_0xa58c('0x2e')]['includeAll']){_0x109a22[_0xa58c('0x3b')]=[{'all':!![]}];}_0x109a22=_[_0xa58c('0x39')]({},_0x109a22,_0x21fa6c[_0xa58c('0x42')]);return db[_0xa58c('0x40')][_0xa58c('0x43')](_0x109a22)['then'](handleEntityNotFound(_0x5d119e,null))[_0xa58c('0x23')](respondWithResult(_0x5d119e,null))[_0xa58c('0x3e')](handleError(_0x5d119e,null));};exports[_0xa58c('0x44')]=function(_0x50eaab,_0x5f3c3f){return db[_0xa58c('0x40')][_0xa58c('0x44')](_0x50eaab['body'],{})[_0xa58c('0x23')](respondWithResult(_0x5f3c3f,0xc9))[_0xa58c('0x3e')](handleError(_0x5f3c3f,null));};exports[_0xa58c('0x22')]=function(_0x16ea4d,_0x56af32){if(_0x16ea4d['body']['id']){delete _0x16ea4d[_0xa58c('0x45')]['id'];}return db[_0xa58c('0x40')]['find']({'where':{'id':_0x16ea4d[_0xa58c('0x3f')]['id']}})[_0xa58c('0x23')](handleEntityNotFound(_0x56af32,null))[_0xa58c('0x23')](saveUpdates(_0x16ea4d[_0xa58c('0x45')],null))['then'](respondWithResult(_0x56af32,null))[_0xa58c('0x3e')](handleError(_0x56af32,null));};exports[_0xa58c('0x46')]=function(_0x5bb0c4,_0x14c3c6){return db['AnalyticTreeReport'][_0xa58c('0x43')]({'where':{'id':_0x5bb0c4[_0xa58c('0x3f')]['id']}})[_0xa58c('0x23')](handleEntityNotFound(_0x14c3c6,null))[_0xa58c('0x23')](removeEntity(_0x14c3c6,null))['catch'](handleError(_0x14c3c6,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index a68f544..d6337ec 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 _0x5afe=['exports','define','AnalyticTreeReport','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0xc70293,_0x2cc6f4){var _0x29036b=function(_0x225d0c){while(--_0x225d0c){_0xc70293['push'](_0xc70293['shift']());}};_0x29036b(++_0x2cc6f4);}(_0x5afe,0x10b));var _0xe5af=function(_0x2128d3,_0x420dfa){_0x2128d3=_0x2128d3-0x0;var _0x49fa00=_0x5afe[_0x2128d3];return _0x49fa00;};'use strict';var _=require('lodash');var util=require(_0xe5af('0x0'));var logger=require(_0xe5af('0x1'))(_0xe5af('0x2'));var moment=require('moment');var BPromise=require(_0xe5af('0x3'));var rp=require(_0xe5af('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe5af('0x5'));var config=require(_0xe5af('0x6'));var attributes=require(_0xe5af('0x7'));module[_0xe5af('0x8')]=function(_0xffac45,_0x719722){return _0xffac45[_0xe5af('0x9')](_0xe5af('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2c87=['api','moment','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x2c87,0x107));var _0x72c8=function(_0xf34a42,_0x5d8a51){_0xf34a42=_0xf34a42-0x0;var _0x159d63=_0x2c87[_0xf34a42];return _0x159d63;};'use strict';var _=require(_0x72c8('0x0'));var util=require(_0x72c8('0x1'));var logger=require(_0x72c8('0x2'))(_0x72c8('0x3'));var moment=require(_0x72c8('0x4'));var BPromise=require('bluebird');var rp=require(_0x72c8('0x5'));var fs=require('fs');var path=require(_0x72c8('0x6'));var rimraf=require(_0x72c8('0x7'));var config=require(_0x72c8('0x8'));var attributes=require(_0x72c8('0x9'));module[_0x72c8('0xa')]=function(_0x45e2a9,_0x384482){return _0x45e2a9[_0x72c8('0xb')](_0x72c8('0xc'),attributes,{'tableName':_0x72c8('0xd'),'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 8c26b5b..c4ac533 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(_0x238a1a,_0x3b01f2){var _0x5bbacc=function(_0x13d7cb){while(--_0x13d7cb){_0x238a1a['push'](_0x238a1a['shift']());}};_0x5bbacc(++_0x3b01f2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x21d47d,_0x46cab0){_0x21d47d=_0x21d47d-0x0;var _0x395148=_0x5f2f[_0x21d47d];return _0x395148;};'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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x989a91,_0x3393a4){var _0x4f54e2=function(_0x1e6eed){while(--_0x1e6eed){_0x989a91['push'](_0x989a91['shift']());}};_0x4f54e2(++_0x3393a4);}(_0xdb28,0x106));var _0x8db2=function(_0x328e17,_0x1e84cf){_0x328e17=_0x328e17-0x0;var _0x1d7b86=_0xdb28[_0x328e17];return _0x1d7b86;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index db4ccb6..824aedb 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 _0x077b=['isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get'];(function(_0x665132,_0x5bbb19){var _0x312117=function(_0x152870){while(--_0x152870){_0x665132['push'](_0x665132['shift']());}};_0x312117(++_0x5bbb19);}(_0x077b,0xbd));var _0xb077=function(_0x4f41cf,_0xdf03fe){_0x4f41cf=_0x4f41cf-0x0;var _0x5e19d0=_0x077b[_0x4f41cf];return _0x5e19d0;};'use strict';var multer=require(_0xb077('0x0'));var util=require(_0xb077('0x1'));var path=require('path');var timeout=require(_0xb077('0x2'));var express=require(_0xb077('0x3'));var router=express[_0xb077('0x4')]();var fs_extra=require(_0xb077('0x5'));var auth=require(_0xb077('0x6'));var interaction=require(_0xb077('0x7'));var config=require(_0xb077('0x8'));var controller=require(_0xb077('0x9'));router[_0xb077('0xa')]('/',auth[_0xb077('0xb')](),controller['index']);router['get'](_0xb077('0xc'),auth[_0xb077('0xb')](),controller['show']);router[_0xb077('0xd')]('/',auth[_0xb077('0xb')](),controller[_0xb077('0xe')]);router[_0xb077('0xf')](_0xb077('0xc'),auth[_0xb077('0xb')](),controller[_0xb077('0x10')]);router[_0xb077('0x11')](_0xb077('0xc'),auth['isAuthenticated'](),controller[_0xb077('0x12')]);module[_0xb077('0x13')]=router;
\ No newline at end of file
+var _0x3d65=['put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','/:id','isAuthenticated','show'];(function(_0x4fd109,_0x33c503){var _0x30f0a6=function(_0xc11c0d){while(--_0xc11c0d){_0x4fd109['push'](_0x4fd109['shift']());}};_0x30f0a6(++_0x33c503);}(_0x3d65,0xc3));var _0x53d6=function(_0x166b14,_0x3ce1ce){_0x166b14=_0x166b14-0x0;var _0x5dc7c6=_0x3d65[_0x166b14];return _0x5dc7c6;};'use strict';var multer=require(_0x53d6('0x0'));var util=require(_0x53d6('0x1'));var path=require(_0x53d6('0x2'));var timeout=require(_0x53d6('0x3'));var express=require(_0x53d6('0x4'));var router=express[_0x53d6('0x5')]();var fs_extra=require(_0x53d6('0x6'));var auth=require(_0x53d6('0x7'));var interaction=require(_0x53d6('0x8'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x53d6('0x9')]);router['get'](_0x53d6('0xa'),auth[_0x53d6('0xb')](),controller[_0x53d6('0xc')]);router['post']('/',auth[_0x53d6('0xb')](),controller['create']);router[_0x53d6('0xd')]('/:id',auth[_0x53d6('0xb')](),controller[_0x53d6('0xe')]);router[_0x53d6('0xf')](_0x53d6('0xa'),auth['isAuthenticated'](),controller['destroy']);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 53b6197..aa816f8 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 _0xc718=['sequelize','STRING'];(function(_0x597b7a,_0x5660e8){var _0xc37f49=function(_0x15053b){while(--_0x15053b){_0x597b7a['push'](_0x597b7a['shift']());}};_0xc37f49(++_0x5660e8);}(_0xc718,0xb6));var _0x8c71=function(_0x195eb3,_0x59180c){_0x195eb3=_0x195eb3-0x0;var _0x36ea03=_0xc718[_0x195eb3];return _0x36ea03;};'use strict';var Sequelize=require(_0x8c71('0x0'));module['exports']={'name':{'type':Sequelize[_0x8c71('0x1')]},'basename':{'type':Sequelize[_0x8c71('0x1')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd246=['exports','STRING','sequelize'];(function(_0x3ae073,_0x401e65){var _0x217cb4=function(_0x1596e6){while(--_0x1596e6){_0x3ae073['push'](_0x3ae073['shift']());}};_0x217cb4(++_0x401e65);}(_0xd246,0xf5));var _0x6d24=function(_0x531c55,_0x3f5d48){_0x531c55=_0x531c55-0x0;var _0x2968f9=_0xd246[_0x531c55];return _0x2968f9;};'use strict';var Sequelize=require(_0x6d24('0x0'));module[_0x6d24('0x1')]={'name':{'type':Sequelize[_0x6d24('0x2')]},'basename':{'type':Sequelize[_0x6d24('0x2')]},'type':{'type':Sequelize[_0x6d24('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 5347cb4..8c86e84 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 _0x946e=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','map','Attachment','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','clone','get','updatedAt','body','createdAt','create','file','originalname','filename','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','basename','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox'];(function(_0xc90440,_0x4cf80b){var _0x46ef96=function(_0x428ee0){while(--_0x428ee0){_0xc90440['push'](_0xc90440['shift']());}};_0x46ef96(++_0x4cf80b);}(_0x946e,0xae));var _0xe946=function(_0x1f878b,_0x1f894d){_0x1f878b=_0x1f878b-0x0;var _0x3fa595=_0x946e[_0x1f878b];return _0x3fa595;};'use strict';var emlformat=require(_0xe946('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe946('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe946('0x2'));var BPromise=require(_0xe946('0x3'));var Mustache=require(_0xe946('0x4'));var util=require(_0xe946('0x5'));var path=require(_0xe946('0x6'));var sox=require(_0xe946('0x7'));var csv=require(_0xe946('0x8'));var ejs=require(_0xe946('0x9'));var fs=require('fs');var fs_extra=require(_0xe946('0xa'));var _=require(_0xe946('0xb'));var squel=require(_0xe946('0xc'));var crypto=require(_0xe946('0xd'));var jsforce=require(_0xe946('0xe'));var deskjs=require(_0xe946('0xf'));var toCsv=require(_0xe946('0x8'));var querystring=require(_0xe946('0x10'));var Papa=require(_0xe946('0x11'));var Redis=require(_0xe946('0x12'));var authService=require(_0xe946('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe946('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe946('0x15'))(_0xe946('0x16'));var utils=require(_0xe946('0x17'));var config=require(_0xe946('0x18'));var licenseUtil=require(_0xe946('0x19'));var db=require(_0xe946('0x1a'))['db'];function respondWithStatusCode(_0x3232b1,_0x1cc8e7){_0x1cc8e7=_0x1cc8e7||0xcc;return function(_0x15f5cc){if(_0x15f5cc){return _0x3232b1[_0xe946('0x1b')](_0x1cc8e7);}return _0x3232b1[_0xe946('0x1c')](_0x1cc8e7)['end']();};}function respondWithResult(_0x40e2f4,_0x292863){_0x292863=_0x292863||0xc8;return function(_0x44404d){if(_0x44404d){return _0x40e2f4['status'](_0x292863)[_0xe946('0x1d')](_0x44404d);}};}function respondWithFilteredResult(_0x5caeb2,_0x4da63a){return function(_0x457ffd){if(_0x457ffd){var _0x2afe31=typeof _0x4da63a['offset']===_0xe946('0x1e')&&typeof _0x4da63a[_0xe946('0x1f')]==='undefined';var _0x49b8d2=_0x457ffd['count'];var _0x5d5feb=_0x2afe31?0x0:_0x4da63a[_0xe946('0x20')];var _0x6e9c58=_0x2afe31?_0x457ffd[_0xe946('0x21')]:_0x4da63a[_0xe946('0x20')]+_0x4da63a[_0xe946('0x1f')];var _0x442cc6;if(_0x6e9c58>=_0x49b8d2){_0x6e9c58=_0x49b8d2;_0x442cc6=0xc8;}else{_0x442cc6=0xce;}_0x5caeb2[_0xe946('0x1c')](_0x442cc6);return _0x5caeb2[_0xe946('0x22')](_0xe946('0x23'),_0x5d5feb+'-'+_0x6e9c58+'/'+_0x49b8d2)[_0xe946('0x1d')](_0x457ffd);}return null;};}function patchUpdates(_0x570632){return function(_0x4ff80b){try{jsonpatch['apply'](_0x4ff80b,_0x570632,!![]);}catch(_0x143551){return BPromise[_0xe946('0x24')](_0x143551);}return _0x4ff80b[_0xe946('0x25')]();};}function saveUpdates(_0x118307,_0x139f7c){return function(_0x1b09e0){if(_0x1b09e0){return _0x1b09e0[_0xe946('0x26')](_0x118307)[_0xe946('0x27')](function(_0x1e0496){return _0x1e0496;});}return null;};}function removeEntity(_0x293197,_0x5c9dcf){return function(_0x583c20){if(_0x583c20){return _0x583c20[_0xe946('0x28')]()[_0xe946('0x27')](function(){_0x293197[_0xe946('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5395a8,_0x325b03){return function(_0x15f995){if(!_0x15f995){_0x5395a8[_0xe946('0x1b')](0x194);}return _0x15f995;};}function handleError(_0x54a7a3,_0x5a7b26){_0x5a7b26=_0x5a7b26||0x1f4;return function(_0x97c5ca){logger['error'](_0x97c5ca[_0xe946('0x29')]);if(_0x97c5ca[_0xe946('0x2a')]){delete _0x97c5ca[_0xe946('0x2a')];}_0x54a7a3['status'](_0x5a7b26)[_0xe946('0x2b')](_0x97c5ca);};}exports['index']=function(_0x5da043,_0x5cac72){var _0x4fb148={},_0x10ef26={},_0x50aee6={'count':0x0,'rows':[]};var _0x1bf6b1=_[_0xe946('0x2c')](db[_0xe946('0x2d')][_0xe946('0x2e')],function(_0x36603e){return{'name':_0x36603e[_0xe946('0x2f')],'type':_0x36603e[_0xe946('0x30')][_0xe946('0x31')]};});_0x10ef26['model']=_[_0xe946('0x2c')](_0x1bf6b1,_0xe946('0x2a'));_0x10ef26[_0xe946('0x32')]=_[_0xe946('0x33')](_0x5da043[_0xe946('0x32')]);_0x10ef26[_0xe946('0x34')]=_[_0xe946('0x35')](_0x10ef26[_0xe946('0x36')],_0x10ef26[_0xe946('0x32')]);_0x4fb148[_0xe946('0x37')]=_[_0xe946('0x35')](_0x10ef26[_0xe946('0x36')],qs['fields'](_0x5da043[_0xe946('0x32')][_0xe946('0x38')]));_0x4fb148[_0xe946('0x37')]=_0x4fb148[_0xe946('0x37')]['length']?_0x4fb148[_0xe946('0x37')]:_0x10ef26['model'];if(!_0x5da043[_0xe946('0x32')][_0xe946('0x39')](_0xe946('0x3a'))){_0x4fb148[_0xe946('0x1f')]=qs[_0xe946('0x1f')](_0x5da043[_0xe946('0x32')]['limit']);_0x4fb148[_0xe946('0x20')]=qs[_0xe946('0x20')](_0x5da043[_0xe946('0x32')][_0xe946('0x20')]);}_0x4fb148[_0xe946('0x3b')]=qs[_0xe946('0x3c')](_0x5da043[_0xe946('0x32')][_0xe946('0x3c')]);_0x4fb148[_0xe946('0x3d')]=qs['filters'](_[_0xe946('0x3e')](_0x5da043[_0xe946('0x32')],_0x10ef26['filters']),_0x1bf6b1);if(_0x5da043[_0xe946('0x32')][_0xe946('0x3f')]){_0x4fb148[_0xe946('0x3d')]=_[_0xe946('0x40')](_0x4fb148[_0xe946('0x3d')],{'$or':_[_0xe946('0x2c')](_0x1bf6b1,function(_0x3da745){if(_0x3da745[_0xe946('0x30')]!==_0xe946('0x41')){var _0x234df1={};_0x234df1[_0x3da745[_0xe946('0x2a')]]={'$like':'%'+_0x5da043[_0xe946('0x32')]['filter']+'%'};return _0x234df1;}})});}_0x4fb148=_[_0xe946('0x40')]({},_0x4fb148,_0x5da043[_0xe946('0x42')]);var _0x3e1d67={'where':_0x4fb148[_0xe946('0x3d')]};return db['Attachment']['count'](_0x3e1d67)['then'](function(_0x22aaba){_0x50aee6[_0xe946('0x21')]=_0x22aaba;if(_0x5da043[_0xe946('0x32')][_0xe946('0x43')]){_0x4fb148[_0xe946('0x44')]=[{'all':!![]}];}return db[_0xe946('0x2d')][_0xe946('0x45')](_0x4fb148);})[_0xe946('0x27')](function(_0x486665){_0x50aee6['rows']=_0x486665;return _0x50aee6;})[_0xe946('0x27')](respondWithFilteredResult(_0x5cac72,_0x4fb148))[_0xe946('0x46')](handleError(_0x5cac72,null));};exports[_0xe946('0x47')]=function(_0x2c23f8,_0x110ff9){var _0x3aa609={'raw':!![],'where':{'id':_0x2c23f8[_0xe946('0x48')]['id']}},_0x1ac248={};_0x1ac248[_0xe946('0x36')]=_[_0xe946('0x33')](db[_0xe946('0x2d')][_0xe946('0x2e')]);_0x1ac248[_0xe946('0x32')]=_[_0xe946('0x33')](_0x2c23f8[_0xe946('0x32')]);_0x1ac248[_0xe946('0x34')]=_[_0xe946('0x35')](_0x1ac248[_0xe946('0x36')],_0x1ac248['query']);_0x3aa609[_0xe946('0x37')]=_[_0xe946('0x35')](_0x1ac248[_0xe946('0x36')],qs[_0xe946('0x38')](_0x2c23f8['query'][_0xe946('0x38')]));_0x3aa609[_0xe946('0x37')]=_0x3aa609[_0xe946('0x37')][_0xe946('0x49')]?_0x3aa609[_0xe946('0x37')]:_0x1ac248[_0xe946('0x36')];if(_0x2c23f8['query'][_0xe946('0x43')]){_0x3aa609[_0xe946('0x44')]=[{'all':!![]}];}_0x3aa609=_['merge']({},_0x3aa609,_0x2c23f8[_0xe946('0x42')]);return db[_0xe946('0x2d')][_0xe946('0x4a')](_0x3aa609)[_0xe946('0x27')](handleEntityNotFound(_0x110ff9,null))[_0xe946('0x27')](respondWithResult(_0x110ff9,null))[_0xe946('0x46')](handleError(_0x110ff9,null));};exports[_0xe946('0x4b')]=function(_0x17dad0,_0x21844f){var _0x8b1615={'where':{'id':_0x17dad0[_0xe946('0x48')]['id']}},_0x5487bc={};_0x5487bc[_0xe946('0x36')]=_[_0xe946('0x33')](db['Attachment'][_0xe946('0x2e')]);_0x8b1615[_0xe946('0x37')]=_[_0xe946('0x35')](_0x5487bc['model'],qs[_0xe946('0x38')](_0x17dad0[_0xe946('0x32')][_0xe946('0x38')]));_0x8b1615['attributes']=_0x8b1615[_0xe946('0x37')][_0xe946('0x49')]?_0x8b1615['attributes']:_0x5487bc[_0xe946('0x36')];if(_0x17dad0[_0xe946('0x32')]['includeAll']){_0x8b1615[_0xe946('0x44')]=[{'all':!![]}];}_0x8b1615=_[_0xe946('0x40')]({},_0x8b1615,_0x17dad0[_0xe946('0x42')]);return db[_0xe946('0x2d')][_0xe946('0x4a')](_0x8b1615)[_0xe946('0x27')](handleEntityNotFound(_0x21844f,null))[_0xe946('0x27')](function(_0x324140){if(_0x324140){var _0x5a8f62=_0x324140[_0xe946('0x4c')]({'plain':!![]});_0x5a8f62=qs['omit'](_0x5a8f62,['id','createdAt',_0xe946('0x4d')]);_0x17dad0[_0xe946('0x4e')]=_['omit'](_0x17dad0['body'],['id',_0xe946('0x4f'),_0xe946('0x4d')]);return db['Attachment'][_0xe946('0x50')](_[_0xe946('0x40')](_0x5a8f62,_0x17dad0[_0xe946('0x4e')]),{'include':_0x17dad0[_0xe946('0x32')][_0xe946('0x43')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x21844f,0xc9))[_0xe946('0x46')](handleError(_0x21844f,null));};exports[_0xe946('0x26')]=function(_0x126fab,_0x339ab2){if(_0x126fab['body']['id']){delete _0x126fab[_0xe946('0x4e')]['id'];}return db[_0xe946('0x2d')][_0xe946('0x4a')]({'where':{'id':_0x126fab[_0xe946('0x48')]['id']}})[_0xe946('0x27')](handleEntityNotFound(_0x339ab2,null))[_0xe946('0x27')](saveUpdates(_0x126fab[_0xe946('0x4e')],null))[_0xe946('0x27')](respondWithResult(_0x339ab2,null))[_0xe946('0x46')](handleError(_0x339ab2,null));};exports[_0xe946('0x28')]=function(_0xbac5c0,_0x5c832c){return db[_0xe946('0x2d')]['find']({'where':{'id':_0xbac5c0[_0xe946('0x48')]['id']}})[_0xe946('0x27')](handleEntityNotFound(_0x5c832c,null))['then'](removeEntity(_0x5c832c,null))['catch'](handleError(_0x5c832c,null));};exports[_0xe946('0x50')]=function(_0x26c754,_0xeb89e1,_0x2279a4){_0x26c754['body'][_0xe946('0x2a')]=_0x26c754[_0xe946('0x51')][_0xe946('0x52')];_0x26c754['body']['basename']=_0x26c754[_0xe946('0x51')][_0xe946('0x53')];_0x26c754['body'][_0xe946('0x30')]=_0x26c754[_0xe946('0x51')]['mimetype'];return db[_0xe946('0x2d')]['create'](_0x26c754[_0xe946('0x4e')])[_0xe946('0x27')](respondWithResult(_0xeb89e1,0xc9))[_0xe946('0x46')](handleError(_0xeb89e1,null));};exports[_0xe946('0x54')]=function(_0x369e02,_0x32333d,_0x34570e){return db[_0xe946('0x2d')][_0xe946('0x55')]({'where':{'id':_0x369e02[_0xe946('0x48')]['id']},'raw':!![]})[_0xe946('0x27')](handleEntityNotFound(_0x32333d,null))[_0xe946('0x27')](function(_0x24d6e7){if(_0x24d6e7){var _0x4825fc=_0x24d6e7[_0xe946('0x56')]!==null;var _0x61c191=path['join'](config[_0xe946('0x57')],_0xe946('0x58'));if(_0x4825fc){_0x61c191=path[_0xe946('0x59')](_0x61c191,'offline-chat/');}var _0xd6bc11=path[_0xe946('0x59')](_0x61c191,_0x24d6e7[_0xe946('0x5a')]);return _0x32333d['download'](_0xd6bc11);}})[_0xe946('0x46')](handleError(_0x32333d,null));};
\ No newline at end of file
+var _0xd18d=['params','options','find','clone','get','omit','createdAt','updatedAt','body','create','catch','file','originalname','basename','filename','type','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','includeAll','include','findAll','rows','show'];(function(_0x5cf40a,_0x21e31f){var _0x26216d=function(_0x82a779){while(--_0x82a779){_0x5cf40a['push'](_0x5cf40a['shift']());}};_0x26216d(++_0x21e31f);}(_0xd18d,0xc7));var _0xdd18=function(_0x487f22,_0x2cc035){_0x487f22=_0x487f22-0x0;var _0x5b8880=_0xd18d[_0x487f22];return _0x5b8880;};'use strict';var emlformat=require(_0xdd18('0x0'));var rimraf=require(_0xdd18('0x1'));var zipdir=require(_0xdd18('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdd18('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdd18('0x4'));var util=require(_0xdd18('0x5'));var path=require(_0xdd18('0x6'));var sox=require(_0xdd18('0x7'));var csv=require(_0xdd18('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd18('0x9'));var squel=require('squel');var crypto=require(_0xdd18('0xa'));var jsforce=require(_0xdd18('0xb'));var deskjs=require(_0xdd18('0xc'));var toCsv=require('to-csv');var querystring=require(_0xdd18('0xd'));var Papa=require(_0xdd18('0xe'));var Redis=require('ioredis');var authService=require(_0xdd18('0xf'));var qs=require(_0xdd18('0x10'));var as=require(_0xdd18('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd18('0x12'))('api');var utils=require(_0xdd18('0x13'));var config=require(_0xdd18('0x14'));var licenseUtil=require(_0xdd18('0x15'));var db=require(_0xdd18('0x16'))['db'];function respondWithStatusCode(_0x124ada,_0x408010){_0x408010=_0x408010||0xcc;return function(_0x12ab1a){if(_0x12ab1a){return _0x124ada['sendStatus'](_0x408010);}return _0x124ada[_0xdd18('0x17')](_0x408010)['end']();};}function respondWithResult(_0x218761,_0x2a8bfa){_0x2a8bfa=_0x2a8bfa||0xc8;return function(_0x5bd222){if(_0x5bd222){return _0x218761[_0xdd18('0x17')](_0x2a8bfa)[_0xdd18('0x18')](_0x5bd222);}};}function respondWithFilteredResult(_0xe42468,_0x277826){return function(_0x1f6478){if(_0x1f6478){var _0x2e8a0c=typeof _0x277826[_0xdd18('0x19')]===_0xdd18('0x1a')&&typeof _0x277826[_0xdd18('0x1b')]==='undefined';var _0x23e11f=_0x1f6478[_0xdd18('0x1c')];var _0x10a362=_0x2e8a0c?0x0:_0x277826[_0xdd18('0x19')];var _0x37aa8f=_0x2e8a0c?_0x1f6478['count']:_0x277826['offset']+_0x277826[_0xdd18('0x1b')];var _0x215ba7;if(_0x37aa8f>=_0x23e11f){_0x37aa8f=_0x23e11f;_0x215ba7=0xc8;}else{_0x215ba7=0xce;}_0xe42468[_0xdd18('0x17')](_0x215ba7);return _0xe42468[_0xdd18('0x1d')]('Content-Range',_0x10a362+'-'+_0x37aa8f+'/'+_0x23e11f)['json'](_0x1f6478);}return null;};}function patchUpdates(_0x292e8b){return function(_0x427392){try{jsonpatch[_0xdd18('0x1e')](_0x427392,_0x292e8b,!![]);}catch(_0x29785f){return BPromise[_0xdd18('0x1f')](_0x29785f);}return _0x427392['save']();};}function saveUpdates(_0x12da67,_0x3c2928){return function(_0x343fbb){if(_0x343fbb){return _0x343fbb[_0xdd18('0x20')](_0x12da67)[_0xdd18('0x21')](function(_0x4cb722){return _0x4cb722;});}return null;};}function removeEntity(_0x325e4c,_0x577433){return function(_0x3ebcf7){if(_0x3ebcf7){return _0x3ebcf7[_0xdd18('0x22')]()[_0xdd18('0x21')](function(){_0x325e4c[_0xdd18('0x17')](0xcc)[_0xdd18('0x23')]();});}};}function handleEntityNotFound(_0x562275,_0x1d21d0){return function(_0x547bd1){if(!_0x547bd1){_0x562275[_0xdd18('0x24')](0x194);}return _0x547bd1;};}function handleError(_0x15ce6d,_0x1f5830){_0x1f5830=_0x1f5830||0x1f4;return function(_0x92599c){logger[_0xdd18('0x25')](_0x92599c[_0xdd18('0x26')]);if(_0x92599c[_0xdd18('0x27')]){delete _0x92599c['name'];}_0x15ce6d[_0xdd18('0x17')](_0x1f5830)[_0xdd18('0x28')](_0x92599c);};}exports[_0xdd18('0x29')]=function(_0x397b98,_0x3327fa){var _0x4b7e74={},_0x4dcf4b={},_0xba02e9={'count':0x0,'rows':[]};var _0x36408d=_[_0xdd18('0x2a')](db[_0xdd18('0x2b')][_0xdd18('0x2c')],function(_0x309a3a){return{'name':_0x309a3a[_0xdd18('0x2d')],'type':_0x309a3a['type'][_0xdd18('0x2e')]};});_0x4dcf4b[_0xdd18('0x2f')]=_[_0xdd18('0x2a')](_0x36408d,'name');_0x4dcf4b[_0xdd18('0x30')]=_[_0xdd18('0x31')](_0x397b98[_0xdd18('0x30')]);_0x4dcf4b[_0xdd18('0x32')]=_[_0xdd18('0x33')](_0x4dcf4b[_0xdd18('0x2f')],_0x4dcf4b[_0xdd18('0x30')]);_0x4b7e74[_0xdd18('0x34')]=_[_0xdd18('0x33')](_0x4dcf4b[_0xdd18('0x2f')],qs[_0xdd18('0x35')](_0x397b98['query'][_0xdd18('0x35')]));_0x4b7e74[_0xdd18('0x34')]=_0x4b7e74[_0xdd18('0x34')][_0xdd18('0x36')]?_0x4b7e74[_0xdd18('0x34')]:_0x4dcf4b[_0xdd18('0x2f')];if(!_0x397b98[_0xdd18('0x30')][_0xdd18('0x37')]('nolimit')){_0x4b7e74[_0xdd18('0x1b')]=qs[_0xdd18('0x1b')](_0x397b98[_0xdd18('0x30')][_0xdd18('0x1b')]);_0x4b7e74['offset']=qs[_0xdd18('0x19')](_0x397b98['query']['offset']);}_0x4b7e74['order']=qs['sort'](_0x397b98[_0xdd18('0x30')][_0xdd18('0x38')]);_0x4b7e74[_0xdd18('0x39')]=qs[_0xdd18('0x32')](_['pick'](_0x397b98[_0xdd18('0x30')],_0x4dcf4b[_0xdd18('0x32')]),_0x36408d);if(_0x397b98[_0xdd18('0x30')][_0xdd18('0x3a')]){_0x4b7e74[_0xdd18('0x39')]=_[_0xdd18('0x3b')](_0x4b7e74['where'],{'$or':_[_0xdd18('0x2a')](_0x36408d,function(_0x24d076){if(_0x24d076['type']!=='VIRTUAL'){var _0x229916={};_0x229916[_0x24d076[_0xdd18('0x27')]]={'$like':'%'+_0x397b98[_0xdd18('0x30')][_0xdd18('0x3a')]+'%'};return _0x229916;}})});}_0x4b7e74=_['merge']({},_0x4b7e74,_0x397b98['options']);var _0x49a25a={'where':_0x4b7e74['where']};return db[_0xdd18('0x2b')]['count'](_0x49a25a)[_0xdd18('0x21')](function(_0x3c0ce4){_0xba02e9[_0xdd18('0x1c')]=_0x3c0ce4;if(_0x397b98[_0xdd18('0x30')][_0xdd18('0x3c')]){_0x4b7e74[_0xdd18('0x3d')]=[{'all':!![]}];}return db[_0xdd18('0x2b')][_0xdd18('0x3e')](_0x4b7e74);})[_0xdd18('0x21')](function(_0x12d506){_0xba02e9[_0xdd18('0x3f')]=_0x12d506;return _0xba02e9;})[_0xdd18('0x21')](respondWithFilteredResult(_0x3327fa,_0x4b7e74))['catch'](handleError(_0x3327fa,null));};exports[_0xdd18('0x40')]=function(_0x5842f1,_0x5b9413){var _0xeb10b5={'raw':!![],'where':{'id':_0x5842f1[_0xdd18('0x41')]['id']}},_0x4277ba={};_0x4277ba[_0xdd18('0x2f')]=_[_0xdd18('0x31')](db[_0xdd18('0x2b')]['rawAttributes']);_0x4277ba[_0xdd18('0x30')]=_[_0xdd18('0x31')](_0x5842f1[_0xdd18('0x30')]);_0x4277ba['filters']=_[_0xdd18('0x33')](_0x4277ba[_0xdd18('0x2f')],_0x4277ba[_0xdd18('0x30')]);_0xeb10b5[_0xdd18('0x34')]=_[_0xdd18('0x33')](_0x4277ba[_0xdd18('0x2f')],qs['fields'](_0x5842f1[_0xdd18('0x30')]['fields']));_0xeb10b5['attributes']=_0xeb10b5[_0xdd18('0x34')][_0xdd18('0x36')]?_0xeb10b5[_0xdd18('0x34')]:_0x4277ba['model'];if(_0x5842f1[_0xdd18('0x30')][_0xdd18('0x3c')]){_0xeb10b5[_0xdd18('0x3d')]=[{'all':!![]}];}_0xeb10b5=_[_0xdd18('0x3b')]({},_0xeb10b5,_0x5842f1[_0xdd18('0x42')]);return db['Attachment'][_0xdd18('0x43')](_0xeb10b5)[_0xdd18('0x21')](handleEntityNotFound(_0x5b9413,null))[_0xdd18('0x21')](respondWithResult(_0x5b9413,null))['catch'](handleError(_0x5b9413,null));};exports[_0xdd18('0x44')]=function(_0x53f7c6,_0x5dda58){var _0x40768c={'where':{'id':_0x53f7c6['params']['id']}},_0x3cd678={};_0x3cd678[_0xdd18('0x2f')]=_[_0xdd18('0x31')](db[_0xdd18('0x2b')]['rawAttributes']);_0x40768c[_0xdd18('0x34')]=_[_0xdd18('0x33')](_0x3cd678[_0xdd18('0x2f')],qs[_0xdd18('0x35')](_0x53f7c6[_0xdd18('0x30')][_0xdd18('0x35')]));_0x40768c[_0xdd18('0x34')]=_0x40768c[_0xdd18('0x34')]['length']?_0x40768c[_0xdd18('0x34')]:_0x3cd678[_0xdd18('0x2f')];if(_0x53f7c6[_0xdd18('0x30')][_0xdd18('0x3c')]){_0x40768c[_0xdd18('0x3d')]=[{'all':!![]}];}_0x40768c=_['merge']({},_0x40768c,_0x53f7c6['options']);return db['Attachment'][_0xdd18('0x43')](_0x40768c)['then'](handleEntityNotFound(_0x5dda58,null))[_0xdd18('0x21')](function(_0x1fedc4){if(_0x1fedc4){var _0x18d1a7=_0x1fedc4[_0xdd18('0x45')]({'plain':!![]});_0x18d1a7=qs[_0xdd18('0x46')](_0x18d1a7,['id',_0xdd18('0x47'),_0xdd18('0x48')]);_0x53f7c6[_0xdd18('0x49')]=_[_0xdd18('0x46')](_0x53f7c6['body'],['id',_0xdd18('0x47'),_0xdd18('0x48')]);return db[_0xdd18('0x2b')][_0xdd18('0x4a')](_[_0xdd18('0x3b')](_0x18d1a7,_0x53f7c6[_0xdd18('0x49')]),{'include':_0x53f7c6[_0xdd18('0x30')]['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x5dda58,0xc9))[_0xdd18('0x4b')](handleError(_0x5dda58,null));};exports['update']=function(_0x159a66,_0x44cc06){if(_0x159a66[_0xdd18('0x49')]['id']){delete _0x159a66[_0xdd18('0x49')]['id'];}return db[_0xdd18('0x2b')][_0xdd18('0x43')]({'where':{'id':_0x159a66[_0xdd18('0x41')]['id']}})[_0xdd18('0x21')](handleEntityNotFound(_0x44cc06,null))[_0xdd18('0x21')](saveUpdates(_0x159a66[_0xdd18('0x49')],null))[_0xdd18('0x21')](respondWithResult(_0x44cc06,null))[_0xdd18('0x4b')](handleError(_0x44cc06,null));};exports[_0xdd18('0x22')]=function(_0x39dc6b,_0xe8f98d){return db['Attachment']['find']({'where':{'id':_0x39dc6b[_0xdd18('0x41')]['id']}})['then'](handleEntityNotFound(_0xe8f98d,null))['then'](removeEntity(_0xe8f98d,null))[_0xdd18('0x4b')](handleError(_0xe8f98d,null));};exports[_0xdd18('0x4a')]=function(_0x13f3e6,_0x1bbdee,_0x4f19c9){_0x13f3e6[_0xdd18('0x49')][_0xdd18('0x27')]=_0x13f3e6[_0xdd18('0x4c')][_0xdd18('0x4d')];_0x13f3e6[_0xdd18('0x49')][_0xdd18('0x4e')]=_0x13f3e6[_0xdd18('0x4c')][_0xdd18('0x4f')];_0x13f3e6[_0xdd18('0x49')][_0xdd18('0x50')]=_0x13f3e6[_0xdd18('0x4c')][_0xdd18('0x51')];return db[_0xdd18('0x2b')][_0xdd18('0x4a')](_0x13f3e6[_0xdd18('0x49')])[_0xdd18('0x21')](respondWithResult(_0x1bbdee,0xc9))[_0xdd18('0x4b')](handleError(_0x1bbdee,null));};exports[_0xdd18('0x52')]=function(_0x47d64f,_0x114221,_0x24f61d){return db[_0xdd18('0x2b')][_0xdd18('0x53')]({'where':{'id':_0x47d64f[_0xdd18('0x41')]['id']},'raw':!![]})[_0xdd18('0x21')](handleEntityNotFound(_0x114221,null))[_0xdd18('0x21')](function(_0x9b232){if(_0x9b232){var _0x43424c=_0x9b232[_0xdd18('0x54')]!==null;var _0x17bcf2=path['join'](config[_0xdd18('0x55')],_0xdd18('0x56'));if(_0x43424c){_0x17bcf2=path[_0xdd18('0x57')](_0x17bcf2,'offline-chat/');}var _0x2cfd0e=path['join'](_0x17bcf2,_0x9b232[_0xdd18('0x4e')]);return _0x114221[_0xdd18('0x52')](_0x2cfd0e);}})['catch'](handleError(_0x114221,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 389b06f..c56eca3 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 _0x5248=['bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','lodash','../../config/logger','api','moment'];(function(_0x232caf,_0x358822){var _0x4a5781=function(_0x33beeb){while(--_0x33beeb){_0x232caf['push'](_0x232caf['shift']());}};_0x4a5781(++_0x358822);}(_0x5248,0x1f4));var _0x8524=function(_0x1a31e5,_0x28b0da){_0x1a31e5=_0x1a31e5-0x0;var _0x14eff7=_0x5248[_0x1a31e5];return _0x14eff7;};'use strict';var _=require(_0x8524('0x0'));var util=require('util');var logger=require(_0x8524('0x1'))(_0x8524('0x2'));var moment=require(_0x8524('0x3'));var BPromise=require(_0x8524('0x4'));var rp=require(_0x8524('0x5'));var fs=require('fs');var path=require(_0x8524('0x6'));var rimraf=require(_0x8524('0x7'));var config=require(_0x8524('0x8'));var attributes=require(_0x8524('0x9'));module[_0x8524('0xa')]=function(_0x120e9d,_0x476c72){return _0x120e9d[_0x8524('0xb')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe2cb=['../../config/environment','./attachment.attributes','exports','define','Attachment','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x282ccc,_0x5d66a1){var _0x27c2dd=function(_0x58431a){while(--_0x58431a){_0x282ccc['push'](_0x282ccc['shift']());}};_0x27c2dd(++_0x5d66a1);}(_0xe2cb,0x171));var _0xbe2c=function(_0x535962,_0x52a05c){_0x535962=_0x535962-0x0;var _0x582ed9=_0xe2cb[_0x535962];return _0x582ed9;};'use strict';var _=require('lodash');var util=require(_0xbe2c('0x0'));var logger=require(_0xbe2c('0x1'))(_0xbe2c('0x2'));var moment=require(_0xbe2c('0x3'));var BPromise=require(_0xbe2c('0x4'));var rp=require(_0xbe2c('0x5'));var fs=require('fs');var path=require(_0xbe2c('0x6'));var rimraf=require(_0xbe2c('0x7'));var config=require(_0xbe2c('0x8'));var attributes=require(_0xbe2c('0x9'));module[_0xbe2c('0xa')]=function(_0x161326,_0x46fa4d){return _0x161326[_0xbe2c('0xb')](_0xbe2c('0xc'),attributes,{'tableName':'attachments','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 3ee86cb..4392e53 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 _0xf874=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','Attachment','create','body','options','raw','CreateAttachment','moment','bluebird','randomstring'];(function(_0x1c80bd,_0x356976){var _0x15b7fc=function(_0x1ad2a){while(--_0x1ad2a){_0x1c80bd['push'](_0x1c80bd['shift']());}};_0x15b7fc(++_0x356976);}(_0xf874,0xed));var _0x4f87=function(_0x5465c3,_0x9698c4){_0x5465c3=_0x5465c3-0x0;var _0x2ee395=_0xf874[_0x5465c3];return _0x2ee395;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4f87('0x0'));var BPromise=require(_0x4f87('0x1'));var rs=require(_0x4f87('0x2'));var fs=require('fs');var Redis=require(_0x4f87('0x3'));var db=require(_0x4f87('0x4'))['db'];var utils=require(_0x4f87('0x5'));var logger=require('../../config/logger')(_0x4f87('0x6'));var config=require(_0x4f87('0x7'));var jayson=require(_0x4f87('0x8'));var client=jayson[_0x4f87('0x9')][_0x4f87('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44fea6,_0x4a0662,_0x3a89e3){return new BPromise(function(_0x194853,_0x592008){return client[_0x4f87('0xb')](_0x44fea6,_0x3a89e3)[_0x4f87('0xc')](function(_0x4d8354){logger[_0x4f87('0xd')](_0x4f87('0xe'),_0x4a0662,_0x4f87('0xf'));logger[_0x4f87('0x10')](_0x4f87('0x11'),_0x4a0662,_0x4f87('0xf'),JSON[_0x4f87('0x12')](_0x4d8354));if(_0x4d8354['error']){if(_0x4d8354['error'][_0x4f87('0x13')]===0x1f4){logger[_0x4f87('0x14')](_0x4f87('0xe'),_0x4a0662,_0x4d8354['error']['message']);return _0x592008(_0x4d8354[_0x4f87('0x14')][_0x4f87('0x15')]);}logger[_0x4f87('0x14')]('Attachment,\x20%s,\x20%s',_0x4a0662,_0x4d8354[_0x4f87('0x14')]['message']);return _0x194853(_0x4d8354[_0x4f87('0x14')][_0x4f87('0x15')]);}else{logger['info'](_0x4f87('0xe'),_0x4a0662,_0x4f87('0xf'));_0x194853(_0x4d8354[_0x4f87('0x16')][_0x4f87('0x15')]);}})[_0x4f87('0x17')](function(_0x3bd90f){logger['error'](_0x4f87('0xe'),_0x4a0662,_0x3bd90f);_0x592008(_0x3bd90f);});});}exports['CreateAttachment']=function(_0x10551e){var _0x6a3017=this;return new Promise(function(_0x46492d,_0x42c399){return db[_0x4f87('0x18')][_0x4f87('0x19')](_0x10551e[_0x4f87('0x1a')],{'raw':_0x10551e[_0x4f87('0x1b')]?_0x10551e[_0x4f87('0x1b')][_0x4f87('0x1c')]===undefined?!![]:![]:!![]})[_0x4f87('0xc')](function(_0x2c13a0){logger[_0x4f87('0xd')]('CreateAttachment',_0x10551e);logger['debug'](_0x4f87('0x1d'),_0x10551e,JSON[_0x4f87('0x12')](_0x2c13a0));_0x46492d(_0x2c13a0);})['catch'](function(_0x592edd){logger[_0x4f87('0x14')]('CreateAttachment',_0x592edd['message'],_0x10551e);_0x42c399(_0x6a3017[_0x4f87('0x14')](0x1f4,_0x592edd[_0x4f87('0x15')]));});});};
\ No newline at end of file
+var _0xb6b1=['raw','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','Attachment,\x20%s,\x20%s','message','info','result','catch','CreateAttachment','Attachment','create','body','options'];(function(_0x3f0f2e,_0xf2b92d){var _0x49fc6f=function(_0x4a2274){while(--_0x4a2274){_0x3f0f2e['push'](_0x3f0f2e['shift']());}};_0x49fc6f(++_0xf2b92d);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x33155c,_0x3fdde1){_0x33155c=_0x33155c-0x0;var _0x5becf7=_0xb6b1[_0x33155c];return _0x5becf7;};'use strict';var _=require(_0x1b6b('0x0'));var util=require('util');var moment=require(_0x1b6b('0x1'));var BPromise=require('bluebird');var rs=require(_0x1b6b('0x2'));var fs=require('fs');var Redis=require(_0x1b6b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b6b('0x4'));var logger=require('../../config/logger')(_0x1b6b('0x5'));var config=require(_0x1b6b('0x6'));var jayson=require(_0x1b6b('0x7'));var client=jayson[_0x1b6b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41d09e,_0x51cfed,_0xae4115){return new BPromise(function(_0x5042f7,_0x21f403){return client[_0x1b6b('0x9')](_0x41d09e,_0xae4115)[_0x1b6b('0xa')](function(_0x29258a){logger['info']('Attachment,\x20%s,\x20%s',_0x51cfed,_0x1b6b('0xb'));logger[_0x1b6b('0xc')](_0x1b6b('0xd'),_0x51cfed,_0x1b6b('0xb'),JSON[_0x1b6b('0xe')](_0x29258a));if(_0x29258a[_0x1b6b('0xf')]){if(_0x29258a[_0x1b6b('0xf')]['code']===0x1f4){logger[_0x1b6b('0xf')](_0x1b6b('0x10'),_0x51cfed,_0x29258a[_0x1b6b('0xf')]['message']);return _0x21f403(_0x29258a[_0x1b6b('0xf')]['message']);}logger['error'](_0x1b6b('0x10'),_0x51cfed,_0x29258a[_0x1b6b('0xf')][_0x1b6b('0x11')]);return _0x5042f7(_0x29258a[_0x1b6b('0xf')][_0x1b6b('0x11')]);}else{logger[_0x1b6b('0x12')](_0x1b6b('0x10'),_0x51cfed,'request\x20sent');_0x5042f7(_0x29258a[_0x1b6b('0x13')][_0x1b6b('0x11')]);}})[_0x1b6b('0x14')](function(_0x33dc7e){logger['error'](_0x1b6b('0x10'),_0x51cfed,_0x33dc7e);_0x21f403(_0x33dc7e);});});}exports[_0x1b6b('0x15')]=function(_0x2e608b){var _0x59e671=this;return new Promise(function(_0x923711,_0x15d44b){return db[_0x1b6b('0x16')][_0x1b6b('0x17')](_0x2e608b[_0x1b6b('0x18')],{'raw':_0x2e608b[_0x1b6b('0x19')]?_0x2e608b[_0x1b6b('0x19')][_0x1b6b('0x1a')]===undefined?!![]:![]:!![]})[_0x1b6b('0xa')](function(_0x20a5a3){logger['info'](_0x1b6b('0x15'),_0x2e608b);logger[_0x1b6b('0xc')](_0x1b6b('0x15'),_0x2e608b,JSON[_0x1b6b('0xe')](_0x20a5a3));_0x923711(_0x20a5a3);})[_0x1b6b('0x14')](function(_0x276713){logger[_0x1b6b('0xf')](_0x1b6b('0x15'),_0x276713[_0x1b6b('0x11')],_0x2e608b);_0x15d44b(_0x59e671['error'](0x1f4,_0x276713[_0x1b6b('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index ce38a5c..96aba69 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 _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x0b0e,0x187));var _0xe0b0=function(_0x54d49e,_0x5d9911){_0x54d49e=_0x54d49e-0x0;var _0x4af0f1=_0x0b0e[_0x54d49e];return _0x4af0f1;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
+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(_0x492246,_0x36a6f7){var _0x21ead7=function(_0x162525){while(--_0x162525){_0x492246['push'](_0x492246['shift']());}};_0x21ead7(++_0x36a6f7);}(_0xb10b,0x12a));var _0xbb10=function(_0x4b3da3,_0x7e6f6a){_0x4b3da3=_0x4b3da3-0x0;var _0x373c4f=_0xb10b[_0x4b3da3];return _0x373c4f;};'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
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 4061a18..6f26e5a 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 _0x194c=['Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','online','user','agent','minutes','getLicense','catch','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','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'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x194c,0x19b));var _0xc194=function(_0x4e8452,_0xf5645a){_0x4e8452=_0x4e8452-0x0;var _0x2b97f4=_0x194c[_0x4e8452];return _0x2b97f4;};'use strict';var passport=require(_0xc194('0x0'));var LocalStrategy=require(_0xc194('0x1'))[_0xc194('0x2')];var moment=require(_0xc194('0x3'));var ActiveDirectory=require(_0xc194('0x4'));var BPromise=require(_0xc194('0x5'));var util=require(_0xc194('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0xc194('0x7'));var utils=require(_0xc194('0x8'));var config=require(_0xc194('0x9'));var logger=require(_0xc194('0xa'))(_0xc194('0xb'));function isActiveDirectoryConfigured(_0x330147){var _0x17462b=![];if(typeof _0x330147[_0xc194('0xc')]!==_0xc194('0xd')){_0x17462b=_0x330147[_0xc194('0xc')]['baseDN']&&_0x330147[_0xc194('0xc')]['url']&&_0x330147[_0xc194('0xc')][_0xc194('0xe')];}return _0x17462b;}function adAuthenticate(_0x7a75b9,_0x5bdc73,_0x3f547c){return new BPromise(function(_0x5608d8,_0x52124e){try{var _0x35c2c2=new ActiveDirectory(_0x7a75b9);_0x35c2c2[_0xc194('0xf')](_0x5bdc73,_0x3f547c,function(_0xb8bcd2,_0x585768){if(_0xb8bcd2){logger[_0xc194('0x10')](_0xc194('0x11'),_0x5bdc73,util[_0xc194('0x12')](_0xb8bcd2,{'showHidden':![],'depth':null}));_0x52124e(_0xc194('0x13'));}else if(!_0x585768){logger['error'](_0xc194('0x14'),_0x5bdc73);_0x52124e('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x5608d8(_0x585768);}});}catch(_0x14920a){_0x52124e(_0x14920a);}});}function ActiveDirectoryAuthenticate(_0x3b832d,_0x4222bd,_0x4ad6c2,_0x46a877){var _0x34a170,_0x4abcc7;if(!isActiveDirectoryConfigured(config)){logger[_0xc194('0x10')](_0xc194('0x15'),_0x4222bd);return _0x46a877(null,![],{'message':_0xc194('0x13')});}return db['Setting'][_0xc194('0x16')]({'where':{'id':0x1},'attributes':[_0xc194('0x17'),_0xc194('0x18')],'raw':!![]})[_0xc194('0x19')](function(_0x16789f){_0x34a170=_0x16789f;if(!_0x34a170[_0xc194('0x17')]){logger['error'](_0xc194('0x1a'),_0x4222bd);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x3b832d[_0xc194('0x16')]({'logging':!![],'attributes':['id',_0xc194('0x1b'),_0xc194('0x1c'),_0xc194('0x1d'),_0xc194('0x1e'),_0xc194('0x1f'),_0xc194('0x20'),_0xc194('0x21'),_0xc194('0x22')],'where':{'name':_0x4222bd,'role':{'$or':['admin',_0xc194('0x23'),_0xc194('0x24')]},'adSsoEnabled':!![]}});})['then'](function(_0xdeb133){if(!_0xdeb133||_0xdeb133&&_0xdeb133[_0xc194('0x1b')]!==_0x4222bd){throw new Error(_0xc194('0x13'));}_0x4abcc7=_0xdeb133;var _0x13e98a=_0x4abcc7['name']+'@'+config[_0xc194('0xc')][_0xc194('0xe')];return adAuthenticate(config[_0xc194('0xc')],_0x13e98a,_0x4ad6c2);})[_0xc194('0x19')](function(_0x279adb){if(_0x4abcc7['disabled']){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x34a170[_0xc194('0x18')]>0x0){if(_0x4abcc7[_0xc194('0x20')]){if(moment(_0x4abcc7[_0xc194('0x21')])['add'](_0x34a170[_0xc194('0x18')],_0xc194('0x25'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x4abcc7,0x0,![],null)[_0xc194('0x19')](function(){return utils[_0xc194('0x26')](_0x4abcc7);})['then'](function(){return _0x46a877(null,_0x4abcc7);});}else{return utils[_0xc194('0x26')](_0x4abcc7)['then'](function(){return _0x46a877(null,_0x4abcc7);});}}else{return utils[_0xc194('0x26')](_0x4abcc7)[_0xc194('0x19')](function(){return _0x46a877(null,_0x4abcc7);});}})[_0xc194('0x27')](function(_0x370f90){return _0x46a877(null,![],_0x370f90);});}function handleError(_0x1e30a9,_0x284d89,_0x567d7f){return _0x1e30a9[_0xc194('0x28')](_0x284d89||0x1f4)[_0xc194('0x29')]({'message':_0x567d7f?_0x567d7f['message']||_0x567d7f:''});}exports[_0xc194('0x2a')]=function(_0x364641,_0x9e77a1,_0x2bbb47){passport['authenticate'](_0xc194('0x2b'),function(_0x88598c,_0x54b6e9,_0x19cbbb){var _0x6ebb26=_0x88598c||_0x19cbbb;if(_0x6ebb26){return handleError(_0x9e77a1,0x191,_0x6ebb26);}if(!_0x54b6e9){return handleError(_0x9e77a1,0x194,{'message':_0xc194('0x2c')});}else{var _0x4f335a={'payload':{'id':_0x54b6e9['id'],'role':_0x54b6e9[_0xc194('0x1e')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4f335a)[_0xc194('0x19')](function(_0x45b007){_0x9e77a1[_0xc194('0x2d')]({'id':_0x54b6e9['id'],'token':_0x45b007,'statusCall':'','isAlreadyLogged':_0x54b6e9[_0xc194('0x22')]});});}})(_0x364641,_0x9e77a1,_0x2bbb47);};passport[_0xc194('0x2e')]('ad-login',new LocalStrategy({'usernameField':_0xc194('0x1b'),'passwordField':_0xc194('0x1c')},function(_0x19b599,_0x4a003b,_0xc2cb8e){return ActiveDirectoryAuthenticate(db[_0xc194('0x2f')],_0x19b599,_0x4a003b,_0xc2cb8e);}));
\ No newline at end of file
+var _0x85bf=['Error\x20authenticate\x20%s:\x20Wrong\x20credentials','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','blocked','blockedAt','online','admin','user','agent','name','disabled','add','clearBlockUser','getLicense','catch','status','send','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','User','passport','passport-local','Strategy','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x38a47d,_0x3ef533){var _0x42c7b1=function(_0x11844d){while(--_0x11844d){_0x38a47d['push'](_0x38a47d['shift']());}};_0x42c7b1(++_0x3ef533);}(_0x85bf,0x183));var _0xf85b=function(_0x358c56,_0x42b5c1){_0x358c56=_0x358c56-0x0;var _0x1eda1f=_0x85bf[_0x358c56];return _0x1eda1f;};'use strict';var passport=require(_0xf85b('0x0'));var LocalStrategy=require(_0xf85b('0x1'))[_0xf85b('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require('bluebird');var util=require(_0xf85b('0x3'));var db=require(_0xf85b('0x4'))['db'];var authService=require(_0xf85b('0x5'));var utils=require(_0xf85b('0x6'));var config=require(_0xf85b('0x7'));var logger=require('../../config/logger')(_0xf85b('0x8'));function isActiveDirectoryConfigured(_0x4fe13c){var _0x3402cc=![];if(typeof _0x4fe13c[_0xf85b('0x9')]!==_0xf85b('0xa')){_0x3402cc=_0x4fe13c[_0xf85b('0x9')][_0xf85b('0xb')]&&_0x4fe13c[_0xf85b('0x9')]['url']&&_0x4fe13c[_0xf85b('0x9')][_0xf85b('0xc')];}return _0x3402cc;}function adAuthenticate(_0x383124,_0x1d87ea,_0x4023b8){return new BPromise(function(_0x86296a,_0x4161da){try{var _0x143fb2=new ActiveDirectory(_0x383124);_0x143fb2[_0xf85b('0xd')](_0x1d87ea,_0x4023b8,function(_0x14b270,_0x56fff2){if(_0x14b270){logger[_0xf85b('0xe')](_0xf85b('0xf'),_0x1d87ea,util[_0xf85b('0x10')](_0x14b270,{'showHidden':![],'depth':null}));_0x4161da(_0xf85b('0x11'));}else if(!_0x56fff2){logger[_0xf85b('0xe')](_0xf85b('0x12'),_0x1d87ea);_0x4161da(_0xf85b('0x11'));}else{_0x86296a(_0x56fff2);}});}catch(_0x4933a8){_0x4161da(_0x4933a8);}});}function ActiveDirectoryAuthenticate(_0x4a03c0,_0xb7d6fd,_0x1e0c84,_0x4c3b8a){var _0x520753,_0x39c187;if(!isActiveDirectoryConfigured(config)){logger[_0xf85b('0xe')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0xb7d6fd);return _0x4c3b8a(null,![],{'message':_0xf85b('0x11')});}return db['Setting'][_0xf85b('0x13')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xf85b('0x14')],'raw':!![]})[_0xf85b('0x15')](function(_0xeca01a){_0x520753=_0xeca01a;if(!_0x520753[_0xf85b('0x16')]){logger[_0xf85b('0xe')](_0xf85b('0x17'),_0xb7d6fd);throw new Error(_0xf85b('0x11'));}return _0x4a03c0['findOne']({'logging':!![],'attributes':['id','name',_0xf85b('0x18'),_0xf85b('0x19'),'role','disabled',_0xf85b('0x1a'),_0xf85b('0x1b'),_0xf85b('0x1c')],'where':{'name':_0xb7d6fd,'role':{'$or':[_0xf85b('0x1d'),_0xf85b('0x1e'),_0xf85b('0x1f')]},'adSsoEnabled':!![]}});})['then'](function(_0x4da7a4){if(!_0x4da7a4||_0x4da7a4&&_0x4da7a4[_0xf85b('0x20')]!==_0xb7d6fd){throw new Error(_0xf85b('0x11'));}_0x39c187=_0x4da7a4;var _0x51b477=_0x39c187[_0xf85b('0x20')]+'@'+config[_0xf85b('0x9')]['domain'];return adAuthenticate(config[_0xf85b('0x9')],_0x51b477,_0x1e0c84);})[_0xf85b('0x15')](function(_0x425751){if(_0x39c187[_0xf85b('0x21')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x520753[_0xf85b('0x14')]>0x0){if(_0x39c187[_0xf85b('0x1a')]){if(moment(_0x39c187['blockedAt'])[_0xf85b('0x22')](_0x520753['blockDuration'],'minutes')>moment()){throw new Error(_0xf85b('0x11'));}return utils[_0xf85b('0x23')](_0x39c187,0x0,![],null)['then'](function(){return utils['getLicense'](_0x39c187);})['then'](function(){return _0x4c3b8a(null,_0x39c187);});}else{return utils[_0xf85b('0x24')](_0x39c187)[_0xf85b('0x15')](function(){return _0x4c3b8a(null,_0x39c187);});}}else{return utils[_0xf85b('0x24')](_0x39c187)['then'](function(){return _0x4c3b8a(null,_0x39c187);});}})[_0xf85b('0x25')](function(_0x598dc7){return _0x4c3b8a(null,![],_0x598dc7);});}function handleError(_0x4fc610,_0x27e2e8,_0x51368d){return _0x4fc610[_0xf85b('0x26')](_0x27e2e8||0x1f4)[_0xf85b('0x27')]({'message':_0x51368d?_0x51368d['message']||_0x51368d:''});}exports['login']=function(_0xf643cc,_0x276bd2,_0x5eb5bd){passport[_0xf85b('0xd')](_0xf85b('0x28'),function(_0x3082ce,_0x3a6b25,_0x5592a3){var _0x5962d3=_0x3082ce||_0x5592a3;if(_0x5962d3){return handleError(_0x276bd2,0x191,_0x5962d3);}if(!_0x3a6b25){return handleError(_0x276bd2,0x194,{'message':_0xf85b('0x29')});}else{var _0x124de1={'payload':{'id':_0x3a6b25['id'],'role':_0x3a6b25['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x124de1)['then'](function(_0x16f13b){_0x276bd2[_0xf85b('0x2a')]({'id':_0x3a6b25['id'],'token':_0x16f13b,'statusCall':'','isAlreadyLogged':_0x3a6b25[_0xf85b('0x1c')]});});}})(_0xf643cc,_0x276bd2,_0x5eb5bd);};passport[_0xf85b('0x2b')](_0xf85b('0x28'),new LocalStrategy({'usernameField':_0xf85b('0x20'),'passwordField':'password'},function(_0x42ae6c,_0x356c9c,_0xbdccef){return ActiveDirectoryAuthenticate(db[_0xf85b('0x2c')],_0x42ae6c,_0x356c9c,_0xbdccef);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index d2acb13..b80522d 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 _0xf6eb=['express','login','exports'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xf6eb,0xb4));var _0xbf6e=function(_0x290700,_0x22b692){_0x290700=_0x290700-0x0;var _0x1cd47d=_0xf6eb[_0x290700];return _0x1cd47d;};'use strict';var express=require(_0xbf6e('0x0'));var router=express['Router']();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0xbf6e('0x1')]);module[_0xbf6e('0x2')]=router;
\ No newline at end of file
+var _0x2fdd=['login','exports','express','Router','./authActiveDirectory.controller','post'];(function(_0x597eb2,_0x165f5c){var _0x56875f=function(_0x5de36e){while(--_0x5de36e){_0x597eb2['push'](_0x597eb2['shift']());}};_0x56875f(++_0x165f5c);}(_0x2fdd,0x128));var _0xd2fd=function(_0x52b921,_0x6b550f){_0x52b921=_0x52b921-0x0;var _0x1cd63d=_0x2fdd[_0x52b921];return _0x1cd63d;};'use strict';var express=require(_0xd2fd('0x0'));var router=express[_0xd2fd('0x1')]();var controller=require(_0xd2fd('0x2'));router[_0xd2fd('0x3')]('/',controller[_0xd2fd('0x4')]);module[_0xd2fd('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 6f5d2b3..0170ce7 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 _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x4ff94f,_0x14c098){var _0x446781=function(_0x30372e){while(--_0x30372e){_0x4ff94f['push'](_0x4ff94f['shift']());}};_0x446781(++_0x14c098);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+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(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x7a54,0x106));var _0x47a5=function(_0xd7a9c2,_0x26baaf){_0xd7a9c2=_0xd7a9c2-0x0;var _0x5852b3=_0x7a54[_0xd7a9c2];return _0x5852b3;};'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 5ebb8a5..638a657 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 _0xea1c=['callback','isMiddleware','setTokenCookie','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get'];(function(_0x423097,_0x8a09f4){var _0x3a73f1=function(_0x9314f0){while(--_0x9314f0){_0x423097['push'](_0x423097['shift']());}};_0x3a73f1(++_0x8a09f4);}(_0xea1c,0xc1));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var passport=require(_0xcea1('0x0'));var router=express[_0xcea1('0x1')]();var controller=require(_0xcea1('0x2'));var userController=require(_0xcea1('0x3'));var authService=require(_0xcea1('0x4'));router['get']('/',controller[_0xcea1('0x5')]);router[_0xcea1('0x6')]('/callback',controller[_0xcea1('0x7')],authService[_0xcea1('0x8')],userController[_0xcea1('0x5')],authService[_0xcea1('0x9')]);module['exports']=router;
\ No newline at end of file
+var _0xecea=['/callback','isMiddleware','setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0x1e3719,_0x3056b3){var _0x56c560=function(_0x42e396){while(--_0x42e396){_0x1e3719['push'](_0x1e3719['shift']());}};_0x56c560(++_0x3056b3);}(_0xecea,0x7d));var _0xaece=function(_0x5af593,_0x2461f2){_0x5af593=_0x5af593-0x0;var _0x3422e0=_0xecea[_0x5af593];return _0x3422e0;};'use strict';var express=require(_0xaece('0x0'));var passport=require(_0xaece('0x1'));var router=express['Router']();var controller=require(_0xaece('0x2'));var userController=require(_0xaece('0x3'));var authService=require(_0xaece('0x4'));router[_0xaece('0x5')]('/',controller[_0xaece('0x6')]);router[_0xaece('0x5')](_0xaece('0x7'),controller['callback'],authService[_0xaece('0x8')],userController[_0xaece('0x6')],authService[_0xaece('0x9')]);module[_0xaece('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 43f6564..c8ebab2 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 _0x781e=['blocked','admin','user','agent','loginAttempts','blockedAt','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','body','Email\x20parameter\x20is\x20missing','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','catch','find','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','passwordHistoryLimit','Password\x20reset!','use','util','passport','Strategy','jayson/promise','randomstring','moment','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','name','password','salt','disabled'];(function(_0x3560de,_0x28b150){var _0x2d31c1=function(_0x1c13d9){while(--_0x1c13d9){_0x3560de['push'](_0x3560de['shift']());}};_0x2d31c1(++_0x28b150);}(_0x781e,0xda));var _0xe781=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x781e[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0xe781('0x0'));var passport=require(_0xe781('0x1'));var LocalStrategy=require('passport-local')[_0xe781('0x2')];var jayson=require(_0xe781('0x3'));var _=require('lodash');var rs=require(_0xe781('0x4'));var moment=require(_0xe781('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0xe781('0x6'));var utils=require(_0xe781('0x7'));var client=jayson[_0xe781('0x8')][_0xe781('0x9')]({'port':0x232b});function localAuthenticate(_0x385920,_0x536217,_0x14b27e,_0x16e9bd){var _0x4ee18d,_0x12c128;return db[_0xe781('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0xe781('0xb'),_0xe781('0xc')],'raw':!![]})[_0xe781('0xd')](function(_0x3bd40b){_0x4ee18d=_0x3bd40b;return _0x385920[_0xe781('0xe')]({'attributes':['id',_0xe781('0xf'),_0xe781('0x10'),_0xe781('0x11'),'role',_0xe781('0x12'),_0xe781('0x13'),'blockedAt','loginAttempts'],'where':{'name':_0x536217,'role':{'$or':[_0xe781('0x14'),_0xe781('0x15'),_0xe781('0x16')]}}});})[_0xe781('0xd')](function(_0x302319){if(!_0x302319||_0x302319&&_0x302319[_0xe781('0xf')]!==_0x536217){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x12c128=_0x302319;return _0x12c128;}})[_0xe781('0xd')](function(){_0x12c128['authenticate'](_0x14b27e,function(_0x58177d,_0x217032){var _0x37472e=_0x12c128[_0xe781('0x17')]+0x1;if(_0x58177d){return _0x16e9bd(_0x58177d);}else if(!_0x217032){if(_0x12c128['disabled']){return _0x16e9bd(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4ee18d[_0xe781('0xb')]>0x0){if(_0x12c128[_0xe781('0x13')]){if(_0x4ee18d[_0xe781('0xc')]>0x0){if(moment(_0x12c128[_0xe781('0x18')])[_0xe781('0x19')](_0x4ee18d[_0xe781('0xc')],_0xe781('0x1a'))>moment()){return _0x16e9bd(null,![],{'message':_0xe781('0x1b')});}else{return utils[_0xe781('0x1c')](_0x12c128,_0x37472e,![],null)['then'](function(){return _0x16e9bd(null,![],{'message':_0xe781('0x1b')});});}}else{return _0x16e9bd(null,![],{'message':_0xe781('0x1b')});}}else{if(_0x37472e>=_0x4ee18d[_0xe781('0xb')]){return utils[_0xe781('0x1c')](_0x12c128,0x0,!![],moment())[_0xe781('0xd')](function(){return _0x16e9bd(null,![],{'message':_0xe781('0x1b')});});}else{return utils[_0xe781('0x1c')](_0x12c128,_0x37472e,![],null)[_0xe781('0xd')](function(){return _0x16e9bd(null,![],{'message':_0xe781('0x1b')});});}}}else{return _0x16e9bd(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x12c128[_0xe781('0x12')]){return _0x16e9bd(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4ee18d['allowedLoginAttempts']>0x0){if(_0x12c128[_0xe781('0x13')]){if(_0x4ee18d[_0xe781('0xc')]>0x0){if(moment(_0x12c128[_0xe781('0x18')])[_0xe781('0x19')](_0x4ee18d[_0xe781('0xc')],_0xe781('0x1a'))>moment()){return _0x16e9bd(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x12c128,0x0,![],null)[_0xe781('0xd')](function(){return utils[_0xe781('0x1d')](_0x12c128);})['then'](function(){return _0x16e9bd(null,_0x12c128);});}}else{return _0x16e9bd(null,![],{'message':_0xe781('0x1b')});}}else{return utils[_0xe781('0x1c')](_0x12c128,0x0,![],null)[_0xe781('0xd')](function(){return utils['getLicense'](_0x12c128);})[_0xe781('0xd')](function(){return _0x16e9bd(null,_0x12c128);})['catch'](function(_0x5ea9b8){return _0x16e9bd(null,![],_0x5ea9b8);});}}else{if(_0x12c128['blocked']){return _0x16e9bd(null,![],{'message':_0xe781('0x1b')});}else{return utils['getLicense'](_0x12c128)[_0xe781('0xd')](function(){return _0x16e9bd(null,_0x12c128);});}}}});})['catch'](function(_0x188a44){return _0x16e9bd(null,![],_0x188a44);});}function sendServiceMail(_0x26e6ec){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id','name',_0xe781('0x1e')],'include':[{'model':db[_0xe781('0x1f')],'as':_0xe781('0x20'),'include':[{'model':db[_0xe781('0x21')],'as':'CloudProvider'}]}]})['then'](function(_0x366f6f){if(!_0x366f6f){throw new Error(_0xe781('0x22'));}var _0x3adf36=_0x366f6f['getSmtpOptions']();var _0xd58a56={'account':_0x3adf36,'message':_[_0xe781('0x23')]({'from':util[_0xe781('0x24')](_0xe781('0x25'),_0x366f6f[_0xe781('0xf')],_0x366f6f[_0xe781('0x1e')]||_0x366f6f['Smtp']['user'])},_0x26e6ec)};return client[_0xe781('0x26')](_0xe781('0x27'),_0xd58a56);})[_0xe781('0xd')](function(_0x29c834){if(_0x29c834[_0xe781('0x28')]){throw new Error(util['format'](_0xe781('0x29'),_0x29c834[_0xe781('0x28')][_0xe781('0x2a')]||JSON['stringify'](_0x29c834[_0xe781('0x28')])));}return!![];});}function handleError(_0x3bdc9e,_0x204b9a,_0x431292){return _0x3bdc9e[_0xe781('0x2b')](_0x204b9a||0x1f4)[_0xe781('0x2c')]({'message':_0x431292?_0x431292[_0xe781('0x2a')]||_0x431292:''});}exports[_0xe781('0x2d')]=function(_0x3eaa2c,_0x16dc43,_0x4ff6fa){passport[_0xe781('0x2e')](_0xe781('0x2f'),function(_0x2311b4,_0x7115f,_0x2b87fe){var _0x512581=_0x2311b4||_0x2b87fe;if(_0x512581){return handleError(_0x16dc43,0x191,_0x512581);}if(!_0x7115f){return handleError(_0x16dc43,0x194,{'message':_0xe781('0x30')});}else{var _0x8d7a26={'payload':{'id':_0x7115f['id'],'role':_0x7115f['role']},'options':{'expiresIn':0x15180}};return authService[_0xe781('0x31')](_0x8d7a26)[_0xe781('0xd')](function(_0x160b33){_0x16dc43[_0xe781('0x32')]({'id':_0x7115f['id'],'token':_0x160b33,'statusCall':'','isAlreadyLogged':_0x7115f['online']});});}})(_0x3eaa2c,_0x16dc43,_0x4ff6fa);};exports['forgot']=function(_0x4f9781,_0x5cc8e4){if(!_0x4f9781[_0xe781('0x33')][_0xe781('0x1e')]){return handleError(_0x5cc8e4,0x1f4,{'message':_0xe781('0x34')});}var _0x40b9d3=rs[_0xe781('0x35')]();_0x4f9781[_0xe781('0x33')][_0xe781('0x1e')]=_0x4f9781[_0xe781('0x33')][_0xe781('0x1e')][_0xe781('0x36')]()['toLowerCase']();var _0x55cdae;return db[_0xe781('0xa')][_0xe781('0xe')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xe781('0xc')],'raw':!![]})[_0xe781('0xd')](function(_0x2c9560){_0x55cdae=_0x2c9560;return db[_0xe781('0x37')]['find']({'where':{'email':_0x4f9781['body'][_0xe781('0x1e')]}});})['then'](function(_0x519546){if(!_0x519546){throw new Error(_0xe781('0x38'));}if(_0x519546[_0xe781('0x12')]){throw new Error(_0xe781('0x39'));}if(_0x519546['blocked']){if(moment(_0x519546[_0xe781('0x18')])['add'](_0x55cdae['blockDuration'],'minutes')>moment()){throw new Error(_0xe781('0x3a'));}else{_0x519546[_0xe781('0x13')]=![];_0x519546[_0xe781('0x18')]=null;}}_0x519546[_0xe781('0x3b')]=_0x40b9d3;_0x519546['resetPasswordExpires']=Date[_0xe781('0x3c')]()+0x36ee80;return _0x519546[_0xe781('0x3d')]();})[_0xe781('0xd')](function(){return sendServiceMail({'to':_0x4f9781['body'][_0xe781('0x1e')],'subject':_0xe781('0x3e'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xe781('0x3f')+_0xe781('0x40')+_0x4f9781['headers'][_0xe781('0x41')]+_0xe781('0x42')+_0x40b9d3+'\x0a\x0a'+_0xe781('0x43')});})[_0xe781('0xd')](function(){_0x5cc8e4[_0xe781('0x2b')](0xc8)[_0xe781('0x2c')]({'message':'Reset\x20Email\x20sent!'});})[_0xe781('0x44')](function(_0x3534f3){return handleError(_0x5cc8e4,0x1f4,_0x3534f3);});};exports['reset']=function(_0x23cb34,_0x21c9e7){return db['User'][_0xe781('0x45')]({'where':{'resetPasswordToken':_0x23cb34['params'][_0xe781('0x46')],'resetPasswordExpires':{'$gt':Date[_0xe781('0x3c')]()}}})[_0xe781('0xd')](function(_0x2689ff){if(!_0x2689ff){throw new Error(_0xe781('0x47'));}return db['Setting'][_0xe781('0xe')]({'attributes':['id',_0xe781('0x48'),_0xe781('0x49'),'passwordHistoryLimit']})[_0xe781('0xd')](function(_0xd397d4){if(_0xd397d4[_0xe781('0x48')])authService[_0xe781('0x4a')](_0x23cb34[_0xe781('0x33')][_0xe781('0x10')]);if(!_0xd397d4['enforcePasswordHistory']||!_0x2689ff[_0xe781('0x4b')])return _0x2689ff;authService['validatePasswordHistory'](_0x23cb34['body'][_0xe781('0x10')],_0x2689ff['previousPasswords'],_0xd397d4[_0xe781('0x4c')]);return _0x2689ff;})[_0xe781('0xd')](function(){_0x2689ff[_0xe781('0x10')]=_0x23cb34[_0xe781('0x33')][_0xe781('0x10')];_0x2689ff[_0xe781('0x3b')]=null;_0x2689ff['resetPasswordExpires']=null;return _0x2689ff[_0xe781('0x3d')]();});})[_0xe781('0xd')](function(){_0x21c9e7[_0xe781('0x2b')](0xc8)[_0xe781('0x2c')]({'message':_0xe781('0x4d')});})[_0xe781('0x44')](function(_0x822bcc){return handleError(_0x21c9e7,0x1f4,_0x822bcc);});};passport[_0xe781('0x4e')](_0xe781('0x2f'),new LocalStrategy({'usernameField':_0xe781('0xf'),'passwordField':_0xe781('0x10')},function(_0x52ad35,_0x1c538d,_0x81b56c){return localAuthenticate(db[_0xe781('0x37')],_0x52ad35,_0x1c538d,_0x81b56c);}));
\ No newline at end of file
+var _0xcc9e=['token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport-local','Strategy','lodash','randomstring','moment','../../mysqldb','http','Setting','allowedLoginAttempts','then','password','disabled','blocked','blockedAt','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','blockDuration','add','minutes','clearBlockUser','getLicense','catch','find','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','email','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','online','forgot','body','Email\x20parameter\x20is\x20missing','findOne','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','status','Reset\x20Email\x20sent!','reset','params'];(function(_0x15d913,_0x51cf7a){var _0x4ae65e=function(_0x2f39a1){while(--_0x2f39a1){_0x15d913['push'](_0x15d913['shift']());}};_0x4ae65e(++_0x51cf7a);}(_0xcc9e,0x13a));var _0xecc9=function(_0x12fbe1,_0x4b9cb6){_0x12fbe1=_0x12fbe1-0x0;var _0x5a6043=_0xcc9e[_0x12fbe1];return _0x5a6043;};'use strict';var util=require(_0xecc9('0x0'));var passport=require('passport');var LocalStrategy=require(_0xecc9('0x1'))[_0xecc9('0x2')];var jayson=require('jayson/promise');var _=require(_0xecc9('0x3'));var rs=require(_0xecc9('0x4'));var moment=require(_0xecc9('0x5'));var db=require(_0xecc9('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson['client'][_0xecc9('0x7')]({'port':0x232b});function localAuthenticate(_0xf467b6,_0x5cafc8,_0x5619ad,_0x3d6975){var _0x1bfc7a,_0x40fe70;return db[_0xecc9('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0xecc9('0x9'),'blockDuration'],'raw':!![]})[_0xecc9('0xa')](function(_0x21210d){_0x1bfc7a=_0x21210d;return _0xf467b6['findOne']({'attributes':['id','name',_0xecc9('0xb'),'salt','role',_0xecc9('0xc'),_0xecc9('0xd'),_0xecc9('0xe'),'loginAttempts'],'where':{'name':_0x5cafc8,'role':{'$or':['admin','user',_0xecc9('0xf')]}}});})['then'](function(_0x59ac94){if(!_0x59ac94||_0x59ac94&&_0x59ac94[_0xecc9('0x10')]!==_0x5cafc8){throw new Error(_0xecc9('0x11'));}else{_0x40fe70=_0x59ac94;return _0x40fe70;}})[_0xecc9('0xa')](function(){_0x40fe70[_0xecc9('0x12')](_0x5619ad,function(_0x585beb,_0x5b88dc){var _0x2a1d1a=_0x40fe70[_0xecc9('0x13')]+0x1;if(_0x585beb){return _0x3d6975(_0x585beb);}else if(!_0x5b88dc){if(_0x40fe70[_0xecc9('0xc')]){return _0x3d6975(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x1bfc7a['allowedLoginAttempts']>0x0){if(_0x40fe70['blocked']){if(_0x1bfc7a[_0xecc9('0x14')]>0x0){if(moment(_0x40fe70[_0xecc9('0xe')])[_0xecc9('0x15')](_0x1bfc7a[_0xecc9('0x14')],_0xecc9('0x16'))>moment()){return _0x3d6975(null,![],{'message':_0xecc9('0x11')});}else{return utils[_0xecc9('0x17')](_0x40fe70,_0x2a1d1a,![],null)[_0xecc9('0xa')](function(){return _0x3d6975(null,![],{'message':_0xecc9('0x11')});});}}else{return _0x3d6975(null,![],{'message':_0xecc9('0x11')});}}else{if(_0x2a1d1a>=_0x1bfc7a[_0xecc9('0x9')]){return utils['clearBlockUser'](_0x40fe70,0x0,!![],moment())[_0xecc9('0xa')](function(){return _0x3d6975(null,![],{'message':_0xecc9('0x11')});});}else{return utils[_0xecc9('0x17')](_0x40fe70,_0x2a1d1a,![],null)[_0xecc9('0xa')](function(){return _0x3d6975(null,![],{'message':_0xecc9('0x11')});});}}}else{return _0x3d6975(null,![],{'message':_0xecc9('0x11')});}}else{if(_0x40fe70['disabled']){return _0x3d6975(null,![],{'message':_0xecc9('0x11')});}else if(_0x1bfc7a[_0xecc9('0x9')]>0x0){if(_0x40fe70['blocked']){if(_0x1bfc7a['blockDuration']>0x0){if(moment(_0x40fe70['blockedAt'])[_0xecc9('0x15')](_0x1bfc7a['blockDuration'],_0xecc9('0x16'))>moment()){return _0x3d6975(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xecc9('0x17')](_0x40fe70,0x0,![],null)['then'](function(){return utils[_0xecc9('0x18')](_0x40fe70);})[_0xecc9('0xa')](function(){return _0x3d6975(null,_0x40fe70);});}}else{return _0x3d6975(null,![],{'message':_0xecc9('0x11')});}}else{return utils[_0xecc9('0x17')](_0x40fe70,0x0,![],null)[_0xecc9('0xa')](function(){return utils['getLicense'](_0x40fe70);})[_0xecc9('0xa')](function(){return _0x3d6975(null,_0x40fe70);})[_0xecc9('0x19')](function(_0x4d51ea){return _0x3d6975(null,![],_0x4d51ea);});}}else{if(_0x40fe70[_0xecc9('0xd')]){return _0x3d6975(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xecc9('0x18')](_0x40fe70)[_0xecc9('0xa')](function(){return _0x3d6975(null,_0x40fe70);});}}}});})[_0xecc9('0x19')](function(_0x3ac5e6){return _0x3d6975(null,![],_0x3ac5e6);});}function sendServiceMail(_0x19a633){return db['MailAccount'][_0xecc9('0x1a')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0xecc9('0x1b')],'as':'Smtp','include':[{'model':db[_0xecc9('0x1c')],'as':'CloudProvider'}]}]})[_0xecc9('0xa')](function(_0x5b1bff){if(!_0x5b1bff){throw new Error(_0xecc9('0x1d'));}var _0x4e64cf=_0x5b1bff['getSmtpOptions']();var _0x1904d7={'account':_0x4e64cf,'message':_[_0xecc9('0x1e')]({'from':util[_0xecc9('0x1f')]('\x22%s\x22\x20<%s>',_0x5b1bff[_0xecc9('0x10')],_0x5b1bff[_0xecc9('0x20')]||_0x5b1bff[_0xecc9('0x21')]['user'])},_0x19a633)};return client[_0xecc9('0x22')](_0xecc9('0x23'),_0x1904d7);})[_0xecc9('0xa')](function(_0x1d2731){if(_0x1d2731[_0xecc9('0x24')]){throw new Error(util[_0xecc9('0x1f')](_0xecc9('0x25'),_0x1d2731[_0xecc9('0x24')]['message']||JSON[_0xecc9('0x26')](_0x1d2731[_0xecc9('0x24')])));}return!![];});}function handleError(_0x10000a,_0x29a160,_0x128203){return _0x10000a['status'](_0x29a160||0x1f4)[_0xecc9('0x27')]({'message':_0x128203?_0x128203[_0xecc9('0x28')]||_0x128203:''});}exports[_0xecc9('0x29')]=function(_0x21c0b1,_0x3491b8,_0x4a211f){passport['authenticate'](_0xecc9('0x2a'),function(_0x10f68e,_0x4f553a,_0x9ed9c8){var _0x3dab2b=_0x10f68e||_0x9ed9c8;if(_0x3dab2b){return handleError(_0x3491b8,0x191,_0x3dab2b);}if(!_0x4f553a){return handleError(_0x3491b8,0x194,{'message':_0xecc9('0x2b')});}else{var _0x23da0d={'payload':{'id':_0x4f553a['id'],'role':_0x4f553a[_0xecc9('0x2c')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x23da0d)[_0xecc9('0xa')](function(_0x1df114){_0x3491b8[_0xecc9('0x2d')]({'id':_0x4f553a['id'],'token':_0x1df114,'statusCall':'','isAlreadyLogged':_0x4f553a[_0xecc9('0x2e')]});});}})(_0x21c0b1,_0x3491b8,_0x4a211f);};exports[_0xecc9('0x2f')]=function(_0x4cc0e6,_0x553d52){if(!_0x4cc0e6[_0xecc9('0x30')][_0xecc9('0x20')]){return handleError(_0x553d52,0x1f4,{'message':_0xecc9('0x31')});}var _0x5270d6=rs['generate']();_0x4cc0e6[_0xecc9('0x30')][_0xecc9('0x20')]=_0x4cc0e6[_0xecc9('0x30')][_0xecc9('0x20')]['trim']()['toLowerCase']();var _0x8a6687;return db['Setting'][_0xecc9('0x32')]({'where':{'id':0x1},'attributes':[_0xecc9('0x9'),'blockDuration'],'raw':!![]})['then'](function(_0x2cd0db){_0x8a6687=_0x2cd0db;return db[_0xecc9('0x33')][_0xecc9('0x1a')]({'where':{'email':_0x4cc0e6['body'][_0xecc9('0x20')]}});})['then'](function(_0x5329de){if(!_0x5329de){throw new Error(_0xecc9('0x34'));}if(_0x5329de[_0xecc9('0xc')]){throw new Error(_0xecc9('0x35'));}if(_0x5329de[_0xecc9('0xd')]){if(moment(_0x5329de[_0xecc9('0xe')])[_0xecc9('0x15')](_0x8a6687[_0xecc9('0x14')],_0xecc9('0x16'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x5329de[_0xecc9('0xd')]=![];_0x5329de[_0xecc9('0xe')]=null;}}_0x5329de['resetPasswordToken']=_0x5270d6;_0x5329de[_0xecc9('0x36')]=Date['now']()+0x36ee80;return _0x5329de[_0xecc9('0x37')]();})[_0xecc9('0xa')](function(){return sendServiceMail({'to':_0x4cc0e6[_0xecc9('0x30')]['email'],'subject':_0xecc9('0x38'),'text':_0xecc9('0x39')+_0xecc9('0x3a')+_0xecc9('0x3b')+_0x4cc0e6[_0xecc9('0x3c')][_0xecc9('0x3d')]+'/reset/'+_0x5270d6+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xecc9('0xa')](function(){_0x553d52[_0xecc9('0x3e')](0xc8)[_0xecc9('0x27')]({'message':_0xecc9('0x3f')});})[_0xecc9('0x19')](function(_0x319568){return handleError(_0x553d52,0x1f4,_0x319568);});};exports[_0xecc9('0x40')]=function(_0x1c6f05,_0x2be612){return db[_0xecc9('0x33')][_0xecc9('0x1a')]({'where':{'resetPasswordToken':_0x1c6f05[_0xecc9('0x41')][_0xecc9('0x42')],'resetPasswordExpires':{'$gt':Date[_0xecc9('0x43')]()}}})['then'](function(_0xb2bac){if(!_0xb2bac){throw new Error(_0xecc9('0x44'));}return db[_0xecc9('0x8')]['findOne']({'attributes':['id','securePassword','enforcePasswordHistory',_0xecc9('0x45')]})[_0xecc9('0xa')](function(_0x10ee73){if(_0x10ee73[_0xecc9('0x46')])authService[_0xecc9('0x47')](_0x1c6f05[_0xecc9('0x30')][_0xecc9('0xb')]);if(!_0x10ee73['enforcePasswordHistory']||!_0xb2bac[_0xecc9('0x48')])return _0xb2bac;authService[_0xecc9('0x49')](_0x1c6f05['body'][_0xecc9('0xb')],_0xb2bac[_0xecc9('0x48')],_0x10ee73[_0xecc9('0x45')]);return _0xb2bac;})['then'](function(){_0xb2bac['password']=_0x1c6f05[_0xecc9('0x30')][_0xecc9('0xb')];_0xb2bac['resetPasswordToken']=null;_0xb2bac[_0xecc9('0x36')]=null;return _0xb2bac[_0xecc9('0x37')]();});})['then'](function(){_0x2be612[_0xecc9('0x3e')](0xc8)[_0xecc9('0x27')]({'message':_0xecc9('0x4a')});})[_0xecc9('0x19')](function(_0x118414){return handleError(_0x2be612,0x1f4,_0x118414);});};passport[_0xecc9('0x4b')](_0xecc9('0x2a'),new LocalStrategy({'usernameField':_0xecc9('0x10'),'passwordField':_0xecc9('0xb')},function(_0xc2ec26,_0x4b3b94,_0x2505b8){return localAuthenticate(db[_0xecc9('0x33')],_0xc2ec26,_0x4b3b94,_0x2505b8);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 64dfe63..d57a185 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 _0x22e0=['/forgot','forgot','/reset/:token','reset','exports','express','Router','login'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x22e0,0xa5));var _0x022e=function(_0x1953e7,_0x20a3d9){_0x1953e7=_0x1953e7-0x0;var _0x3b3d49=_0x22e0[_0x1953e7];return _0x3b3d49;};'use strict';var express=require(_0x022e('0x0'));var router=express[_0x022e('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0x022e('0x2')]);router['post'](_0x022e('0x3'),controller[_0x022e('0x4')]);router['post'](_0x022e('0x5'),controller[_0x022e('0x6')]);module[_0x022e('0x7')]=router;
\ No newline at end of file
+var _0x4ccc=['express','post','login','/forgot','forgot','/reset/:token','reset','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4ccc,0xc0));var _0xc4cc=function(_0x1ac2ab,_0x1f65a2){_0x1ac2ab=_0x1ac2ab-0x0;var _0x5c6291=_0x4ccc[_0x1ac2ab];return _0x5c6291;};'use strict';var express=require(_0xc4cc('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router[_0xc4cc('0x1')]('/',controller[_0xc4cc('0x2')]);router[_0xc4cc('0x1')](_0xc4cc('0x3'),controller[_0xc4cc('0x4')]);router[_0xc4cc('0x1')](_0xc4cc('0x5'),controller[_0xc4cc('0x6')]);module[_0xc4cc('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 83580b3..f1c9c6c 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 _0xb2ed=['STRING','BOOLEAN','INTEGER'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xb2ed,0xc0));var _0xdb2e=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xb2ed[_0x5317b5];return _0x3b7ce2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xdb2e('0x0')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdb2e('0x0')]},'status':{'type':Sequelize[_0xdb2e('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xdb2e('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x7d1d=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x1c13d7,_0x3932d9){var _0x185346=function(_0x39b5ff){while(--_0x39b5ff){_0x1c13d7['push'](_0x1c13d7['shift']());}};_0x185346(++_0x3932d9);}(_0x7d1d,0x66));var _0xd7d1=function(_0x29df9a,_0x42aff3){_0x29df9a=_0x29df9a-0x0;var _0x3a8e96=_0x7d1d[_0x29df9a];return _0x3a8e96;};'use strict';var Sequelize=require(_0xd7d1('0x0'));module[_0xd7d1('0x1')]={'name':{'type':Sequelize[_0xd7d1('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xd7d1('0x2')]},'description':{'type':Sequelize[_0xd7d1('0x2')]},'status':{'type':Sequelize[_0xd7d1('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xd7d1('0x4')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 0bb0aad..46616b7 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 _0x8068=['Condition','pick','getConditions','hasOwnProperty','addActions','Action','getActions','findOne','order','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','Automation','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','VIRTUAL','options','count','include','findAll','rows','catch','params','rawAttributes','includeAll','merge','create','body','destroy','find','addConditions','ids','omit'];(function(_0x54fb7a,_0x24dc21){var _0x981a80=function(_0x40324f){while(--_0x40324f){_0x54fb7a['push'](_0x54fb7a['shift']());}};_0x981a80(++_0x24dc21);}(_0x8068,0x15d));var _0x8806=function(_0x333fc8,_0x2b292c){_0x333fc8=_0x333fc8-0x0;var _0x432439=_0x8068[_0x333fc8];return _0x432439;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8806('0x0'));var zipdir=require(_0x8806('0x1'));var jsonpatch=require(_0x8806('0x2'));var rp=require(_0x8806('0x3'));var moment=require(_0x8806('0x4'));var BPromise=require(_0x8806('0x5'));var Mustache=require('mustache');var util=require(_0x8806('0x6'));var path=require('path');var sox=require(_0x8806('0x7'));var csv=require(_0x8806('0x8'));var ejs=require(_0x8806('0x9'));var fs=require('fs');var fs_extra=require(_0x8806('0xa'));var _=require(_0x8806('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8806('0xc'));var deskjs=require(_0x8806('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8806('0xe'));var Redis=require(_0x8806('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8806('0x10'));var as=require(_0x8806('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8806('0x12'))(_0x8806('0x13'));var utils=require(_0x8806('0x14'));var config=require(_0x8806('0x15'));var licenseUtil=require(_0x8806('0x16'));var db=require(_0x8806('0x17'))['db'];function respondWithStatusCode(_0x4858f0,_0x40453e){_0x40453e=_0x40453e||0xcc;return function(_0x1c9718){if(_0x1c9718){return _0x4858f0['sendStatus'](_0x40453e);}return _0x4858f0['status'](_0x40453e)[_0x8806('0x18')]();};}function respondWithResult(_0x1e56f2,_0x467360){_0x467360=_0x467360||0xc8;return function(_0x4171d1){if(_0x4171d1){return _0x1e56f2[_0x8806('0x19')](_0x467360)[_0x8806('0x1a')](_0x4171d1);}};}function respondWithFilteredResult(_0x1dbcc6,_0x53601e){return function(_0x139b81){if(_0x139b81){var _0x4ff617=typeof _0x53601e[_0x8806('0x1b')]===_0x8806('0x1c')&&typeof _0x53601e[_0x8806('0x1d')]===_0x8806('0x1c');var _0x47c869=_0x139b81['count'];var _0x5355ea=_0x4ff617?0x0:_0x53601e[_0x8806('0x1b')];var _0x50e741=_0x4ff617?_0x139b81['count']:_0x53601e[_0x8806('0x1b')]+_0x53601e['limit'];var _0x4f337d;if(_0x50e741>=_0x47c869){_0x50e741=_0x47c869;_0x4f337d=0xc8;}else{_0x4f337d=0xce;}_0x1dbcc6[_0x8806('0x19')](_0x4f337d);return _0x1dbcc6['set'](_0x8806('0x1e'),_0x5355ea+'-'+_0x50e741+'/'+_0x47c869)[_0x8806('0x1a')](_0x139b81);}return null;};}function patchUpdates(_0x4baca6){return function(_0x4db274){try{jsonpatch[_0x8806('0x1f')](_0x4db274,_0x4baca6,!![]);}catch(_0x3afeea){return BPromise[_0x8806('0x20')](_0x3afeea);}return _0x4db274[_0x8806('0x21')]();};}function saveUpdates(_0x3087c2,_0x734e44){return function(_0x19c3bd){if(_0x19c3bd){return _0x19c3bd[_0x8806('0x22')](_0x3087c2)[_0x8806('0x23')](function(_0x292534){return _0x292534;});}return null;};}function removeEntity(_0xe736dd,_0x38031b){return function(_0x5e7c72){if(_0x5e7c72){return _0x5e7c72['destroy']()[_0x8806('0x23')](function(){_0xe736dd[_0x8806('0x19')](0xcc)[_0x8806('0x18')]();});}};}function handleEntityNotFound(_0x13f220,_0x58709c){return function(_0x24abfa){if(!_0x24abfa){_0x13f220[_0x8806('0x24')](0x194);}return _0x24abfa;};}function handleError(_0x134eb6,_0x2dddfb){_0x2dddfb=_0x2dddfb||0x1f4;return function(_0x4b459c){logger['error'](_0x4b459c[_0x8806('0x25')]);if(_0x4b459c['name']){delete _0x4b459c[_0x8806('0x26')];}_0x134eb6[_0x8806('0x19')](_0x2dddfb)[_0x8806('0x27')](_0x4b459c);};}exports[_0x8806('0x28')]=function(_0x570f3b,_0x177268){var _0x4786c8={},_0x4e06b6={},_0x115cf4={'count':0x0,'rows':[]};var _0x8210c=_[_0x8806('0x29')](db[_0x8806('0x2a')]['rawAttributes'],function(_0x126f00){return{'name':_0x126f00[_0x8806('0x2b')],'type':_0x126f00[_0x8806('0x2c')][_0x8806('0x2d')]};});_0x4e06b6[_0x8806('0x2e')]=_[_0x8806('0x29')](_0x8210c,_0x8806('0x26'));_0x4e06b6[_0x8806('0x2f')]=_[_0x8806('0x30')](_0x570f3b['query']);_0x4e06b6[_0x8806('0x31')]=_[_0x8806('0x32')](_0x4e06b6[_0x8806('0x2e')],_0x4e06b6['query']);_0x4786c8[_0x8806('0x33')]=_[_0x8806('0x32')](_0x4e06b6[_0x8806('0x2e')],qs[_0x8806('0x34')](_0x570f3b[_0x8806('0x2f')][_0x8806('0x34')]));_0x4786c8[_0x8806('0x33')]=_0x4786c8[_0x8806('0x33')][_0x8806('0x35')]?_0x4786c8[_0x8806('0x33')]:_0x4e06b6[_0x8806('0x2e')];if(!_0x570f3b['query']['hasOwnProperty'](_0x8806('0x36'))){_0x4786c8[_0x8806('0x1d')]=qs['limit'](_0x570f3b[_0x8806('0x2f')]['limit']);_0x4786c8[_0x8806('0x1b')]=qs[_0x8806('0x1b')](_0x570f3b['query']['offset']);}_0x4786c8['order']=qs[_0x8806('0x37')](_0x570f3b['query'][_0x8806('0x37')]);_0x4786c8[_0x8806('0x38')]=qs[_0x8806('0x31')](_['pick'](_0x570f3b[_0x8806('0x2f')],_0x4e06b6['filters']),_0x8210c);if(_0x570f3b['query'][_0x8806('0x39')]){_0x4786c8[_0x8806('0x38')]=_['merge'](_0x4786c8[_0x8806('0x38')],{'$or':_[_0x8806('0x29')](_0x8210c,function(_0x42acf8){if(_0x42acf8[_0x8806('0x2c')]!==_0x8806('0x3a')){var _0x4f0d33={};_0x4f0d33[_0x42acf8[_0x8806('0x26')]]={'$like':'%'+_0x570f3b[_0x8806('0x2f')][_0x8806('0x39')]+'%'};return _0x4f0d33;}})});}_0x4786c8=_['merge']({},_0x4786c8,_0x570f3b[_0x8806('0x3b')]);var _0x5d3ac7={'where':_0x4786c8['where']};return db['Automation'][_0x8806('0x3c')](_0x5d3ac7)[_0x8806('0x23')](function(_0x453419){_0x115cf4[_0x8806('0x3c')]=_0x453419;if(_0x570f3b[_0x8806('0x2f')]['includeAll']){_0x4786c8[_0x8806('0x3d')]=[{'all':!![]}];}return db[_0x8806('0x2a')][_0x8806('0x3e')](_0x4786c8);})[_0x8806('0x23')](function(_0x19f8a0){_0x115cf4[_0x8806('0x3f')]=_0x19f8a0;return _0x115cf4;})['then'](respondWithFilteredResult(_0x177268,_0x4786c8))[_0x8806('0x40')](handleError(_0x177268,null));};exports['show']=function(_0x188a37,_0x95b785){var _0x3eea2f={'raw':![],'where':{'id':_0x188a37[_0x8806('0x41')]['id']}},_0x160f95={};_0x160f95[_0x8806('0x2e')]=_[_0x8806('0x30')](db[_0x8806('0x2a')][_0x8806('0x42')]);_0x160f95[_0x8806('0x2f')]=_[_0x8806('0x30')](_0x188a37[_0x8806('0x2f')]);_0x160f95['filters']=_[_0x8806('0x32')](_0x160f95[_0x8806('0x2e')],_0x160f95['query']);_0x3eea2f['attributes']=_[_0x8806('0x32')](_0x160f95[_0x8806('0x2e')],qs['fields'](_0x188a37['query'][_0x8806('0x34')]));_0x3eea2f[_0x8806('0x33')]=_0x3eea2f[_0x8806('0x33')]['length']?_0x3eea2f[_0x8806('0x33')]:_0x160f95[_0x8806('0x2e')];if(_0x188a37[_0x8806('0x2f')][_0x8806('0x43')]){_0x3eea2f[_0x8806('0x3d')]=[{'all':!![]}];}_0x3eea2f=_[_0x8806('0x44')]({},_0x3eea2f,_0x188a37[_0x8806('0x3b')]);return db[_0x8806('0x2a')]['find'](_0x3eea2f)[_0x8806('0x23')](handleEntityNotFound(_0x95b785,null))[_0x8806('0x23')](respondWithResult(_0x95b785,null))['catch'](handleError(_0x95b785,null));};exports[_0x8806('0x45')]=function(_0x2c27de,_0x3bf095){return db[_0x8806('0x2a')][_0x8806('0x45')](_0x2c27de[_0x8806('0x46')],{})[_0x8806('0x23')](respondWithResult(_0x3bf095,0xc9))[_0x8806('0x40')](handleError(_0x3bf095,null));};exports[_0x8806('0x22')]=function(_0x4237cb,_0x334fac){if(_0x4237cb[_0x8806('0x46')]['id']){delete _0x4237cb[_0x8806('0x46')]['id'];}return db[_0x8806('0x2a')]['find']({'where':{'id':_0x4237cb[_0x8806('0x41')]['id']}})[_0x8806('0x23')](handleEntityNotFound(_0x334fac,null))[_0x8806('0x23')](saveUpdates(_0x4237cb[_0x8806('0x46')],null))[_0x8806('0x23')](respondWithResult(_0x334fac,null))[_0x8806('0x40')](handleError(_0x334fac,null));};exports[_0x8806('0x47')]=function(_0x571090,_0x423f67){return db['Automation'][_0x8806('0x48')]({'where':{'id':_0x571090[_0x8806('0x41')]['id']}})[_0x8806('0x23')](handleEntityNotFound(_0x423f67,null))[_0x8806('0x23')](removeEntity(_0x423f67,null))['catch'](handleError(_0x423f67,null));};exports[_0x8806('0x49')]=function(_0x195074,_0x3ba4f4,_0x48705a){return db['Condition'][_0x8806('0x48')]({'where':{'id':_0x195074[_0x8806('0x41')]['id']}})[_0x8806('0x23')](handleEntityNotFound(_0x3ba4f4,null))['then'](function(_0xe1b1f5){if(_0xe1b1f5){return _0xe1b1f5[_0x8806('0x49')](_0x195074['body'][_0x8806('0x4a')],_[_0x8806('0x4b')](_0x195074['body'],[_0x8806('0x4a'),'id'])||{});}})[_0x8806('0x23')](respondWithResult(_0x3ba4f4,null))[_0x8806('0x40')](handleError(_0x3ba4f4,null));};exports['getConditions']=function(_0x23b8dd,_0xdb21ac,_0x4148bf){var _0xe9eca2={};var _0x24fea2={};var _0x1cbf08;var _0x211220;return db[_0x8806('0x2a')]['findOne']({'where':{'id':_0x23b8dd[_0x8806('0x41')]['id']}})['then'](handleEntityNotFound(_0xdb21ac,null))[_0x8806('0x23')](function(_0x398836){if(_0x398836){_0x1cbf08=_0x398836;_0x24fea2[_0x8806('0x2e')]=_[_0x8806('0x30')](db[_0x8806('0x4c')][_0x8806('0x42')]);_0x24fea2[_0x8806('0x2f')]=_[_0x8806('0x30')](_0x23b8dd[_0x8806('0x2f')]);_0x24fea2[_0x8806('0x31')]=_['intersection'](_0x24fea2[_0x8806('0x2e')],_0x24fea2[_0x8806('0x2f')]);_0xe9eca2[_0x8806('0x33')]=_[_0x8806('0x32')](_0x24fea2[_0x8806('0x2e')],qs[_0x8806('0x34')](_0x23b8dd['query'][_0x8806('0x34')]));_0xe9eca2[_0x8806('0x33')]=_0xe9eca2[_0x8806('0x33')]['length']?_0xe9eca2[_0x8806('0x33')]:_0x24fea2[_0x8806('0x2e')];_0xe9eca2['order']=qs['sort'](_0x23b8dd[_0x8806('0x2f')]['sort']);_0xe9eca2[_0x8806('0x38')]=qs[_0x8806('0x31')](_[_0x8806('0x4d')](_0x23b8dd[_0x8806('0x2f')],_0x24fea2[_0x8806('0x31')]));if(_0x23b8dd[_0x8806('0x2f')]['filter']){_0xe9eca2[_0x8806('0x38')]=_[_0x8806('0x44')](_0xe9eca2[_0x8806('0x38')],{'$or':_[_0x8806('0x29')](_0xe9eca2[_0x8806('0x33')],function(_0x3163e3){var _0x4435f6={};_0x4435f6[_0x3163e3]={'$like':'%'+_0x23b8dd[_0x8806('0x2f')][_0x8806('0x39')]+'%'};return _0x4435f6;})});}_0xe9eca2=_[_0x8806('0x44')]({},_0xe9eca2,_0x23b8dd[_0x8806('0x3b')]);return _0x1cbf08[_0x8806('0x4e')](_0xe9eca2);}})[_0x8806('0x23')](function(_0x157aba){if(_0x157aba){_0x211220=_0x157aba[_0x8806('0x35')];if(!_0x23b8dd[_0x8806('0x2f')][_0x8806('0x4f')](_0x8806('0x36'))){_0xe9eca2['limit']=qs[_0x8806('0x1d')](_0x23b8dd[_0x8806('0x2f')][_0x8806('0x1d')]);_0xe9eca2[_0x8806('0x1b')]=qs[_0x8806('0x1b')](_0x23b8dd[_0x8806('0x2f')][_0x8806('0x1b')]);}return _0x1cbf08[_0x8806('0x4e')](_0xe9eca2);}})[_0x8806('0x23')](function(_0x26254b){if(_0x26254b){return _0x26254b?{'count':_0x211220,'rows':_0x26254b}:null;}})[_0x8806('0x23')](respondWithResult(_0xdb21ac,null))[_0x8806('0x40')](handleError(_0xdb21ac,null));};exports[_0x8806('0x50')]=function(_0x51187a,_0x5e306,_0x1a8fc3){return db[_0x8806('0x51')]['find']({'where':{'id':_0x51187a[_0x8806('0x41')]['id']}})[_0x8806('0x23')](handleEntityNotFound(_0x5e306,null))[_0x8806('0x23')](function(_0x5eba2f){if(_0x5eba2f){return _0x5eba2f['addActions'](_0x51187a[_0x8806('0x46')]['ids'],_[_0x8806('0x4b')](_0x51187a[_0x8806('0x46')],[_0x8806('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x5e306,null))[_0x8806('0x40')](handleError(_0x5e306,null));};exports[_0x8806('0x52')]=function(_0x443d2b,_0x5bf539,_0x430d72){var _0x144c9c={};var _0x505f6e={};var _0x11f13f;var _0x45a199;return db[_0x8806('0x2a')][_0x8806('0x53')]({'where':{'id':_0x443d2b[_0x8806('0x41')]['id']}})[_0x8806('0x23')](handleEntityNotFound(_0x5bf539,null))[_0x8806('0x23')](function(_0x2a78ad){if(_0x2a78ad){_0x11f13f=_0x2a78ad;_0x505f6e['model']=_['keys'](db[_0x8806('0x51')][_0x8806('0x42')]);_0x505f6e[_0x8806('0x2f')]=_[_0x8806('0x30')](_0x443d2b[_0x8806('0x2f')]);_0x505f6e[_0x8806('0x31')]=_[_0x8806('0x32')](_0x505f6e[_0x8806('0x2e')],_0x505f6e[_0x8806('0x2f')]);_0x144c9c[_0x8806('0x33')]=_[_0x8806('0x32')](_0x505f6e[_0x8806('0x2e')],qs[_0x8806('0x34')](_0x443d2b[_0x8806('0x2f')][_0x8806('0x34')]));_0x144c9c[_0x8806('0x33')]=_0x144c9c['attributes'][_0x8806('0x35')]?_0x144c9c['attributes']:_0x505f6e['model'];_0x144c9c[_0x8806('0x54')]=qs[_0x8806('0x37')](_0x443d2b['query'][_0x8806('0x37')]);_0x144c9c[_0x8806('0x38')]=qs['filters'](_['pick'](_0x443d2b['query'],_0x505f6e[_0x8806('0x31')]));if(_0x443d2b[_0x8806('0x2f')]['filter']){_0x144c9c[_0x8806('0x38')]=_['merge'](_0x144c9c['where'],{'$or':_[_0x8806('0x29')](_0x144c9c[_0x8806('0x33')],function(_0x465263){var _0x1963e4={};_0x1963e4[_0x465263]={'$like':'%'+_0x443d2b[_0x8806('0x2f')][_0x8806('0x39')]+'%'};return _0x1963e4;})});}_0x144c9c=_[_0x8806('0x44')]({},_0x144c9c,_0x443d2b[_0x8806('0x3b')]);return _0x11f13f['getActions'](_0x144c9c);}})[_0x8806('0x23')](function(_0x73d5dc){if(_0x73d5dc){_0x45a199=_0x73d5dc[_0x8806('0x35')];if(!_0x443d2b[_0x8806('0x2f')]['hasOwnProperty'](_0x8806('0x36'))){_0x144c9c[_0x8806('0x1d')]=qs[_0x8806('0x1d')](_0x443d2b[_0x8806('0x2f')][_0x8806('0x1d')]);_0x144c9c[_0x8806('0x1b')]=qs[_0x8806('0x1b')](_0x443d2b['query']['offset']);}return _0x11f13f['getActions'](_0x144c9c);}})[_0x8806('0x23')](function(_0x445fa1){if(_0x445fa1){return _0x445fa1?{'count':_0x45a199,'rows':_0x445fa1}:null;}})['then'](respondWithResult(_0x5bf539,null))['catch'](handleError(_0x5bf539,null));};
\ No newline at end of file
+var _0x00b9=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','error','stack','name','map','rawAttributes','type','key','model','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','Automation','includeAll','include','findAll','catch','show','keys','length','find','create','body','params','addConditions','Condition','ids','omit','getConditions','findOne','pick','addActions','Action','getActions','eml-format'];(function(_0x54616d,_0x3d34c0){var _0x322202=function(_0x3027f5){while(--_0x3027f5){_0x54616d['push'](_0x54616d['shift']());}};_0x322202(++_0x3d34c0);}(_0x00b9,0xef));var _0x900b=function(_0x2691c1,_0x584a6e){_0x2691c1=_0x2691c1-0x0;var _0x11a3ad=_0x00b9[_0x2691c1];return _0x11a3ad;};'use strict';var emlformat=require(_0x900b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x900b('0x1'));var jsonpatch=require(_0x900b('0x2'));var rp=require(_0x900b('0x3'));var moment=require(_0x900b('0x4'));var BPromise=require(_0x900b('0x5'));var Mustache=require('mustache');var util=require(_0x900b('0x6'));var path=require(_0x900b('0x7'));var sox=require(_0x900b('0x8'));var csv=require('to-csv');var ejs=require(_0x900b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x900b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x900b('0xb'));var toCsv=require(_0x900b('0xc'));var querystring=require(_0x900b('0xd'));var Papa=require(_0x900b('0xe'));var Redis=require('ioredis');var authService=require(_0x900b('0xf'));var qs=require(_0x900b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x900b('0x11'));var logger=require(_0x900b('0x12'))(_0x900b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x900b('0x14'));var db=require(_0x900b('0x15'))['db'];function respondWithStatusCode(_0x351d1a,_0x190341){_0x190341=_0x190341||0xcc;return function(_0x5cc64b){if(_0x5cc64b){return _0x351d1a[_0x900b('0x16')](_0x190341);}return _0x351d1a[_0x900b('0x17')](_0x190341)[_0x900b('0x18')]();};}function respondWithResult(_0x1d3e07,_0x13d5f7){_0x13d5f7=_0x13d5f7||0xc8;return function(_0x233b92){if(_0x233b92){return _0x1d3e07[_0x900b('0x17')](_0x13d5f7)[_0x900b('0x19')](_0x233b92);}};}function respondWithFilteredResult(_0x41019a,_0x2d3d06){return function(_0x106107){if(_0x106107){var _0x187404=typeof _0x2d3d06[_0x900b('0x1a')]===_0x900b('0x1b')&&typeof _0x2d3d06['limit']==='undefined';var _0x4a329a=_0x106107[_0x900b('0x1c')];var _0xd9fd07=_0x187404?0x0:_0x2d3d06[_0x900b('0x1a')];var _0x50b287=_0x187404?_0x106107[_0x900b('0x1c')]:_0x2d3d06[_0x900b('0x1a')]+_0x2d3d06[_0x900b('0x1d')];var _0x29ab8c;if(_0x50b287>=_0x4a329a){_0x50b287=_0x4a329a;_0x29ab8c=0xc8;}else{_0x29ab8c=0xce;}_0x41019a[_0x900b('0x17')](_0x29ab8c);return _0x41019a[_0x900b('0x1e')](_0x900b('0x1f'),_0xd9fd07+'-'+_0x50b287+'/'+_0x4a329a)[_0x900b('0x19')](_0x106107);}return null;};}function patchUpdates(_0x52d137){return function(_0x6cce25){try{jsonpatch['apply'](_0x6cce25,_0x52d137,!![]);}catch(_0x319311){return BPromise['reject'](_0x319311);}return _0x6cce25[_0x900b('0x20')]();};}function saveUpdates(_0xa5bb3c,_0x37b2eb){return function(_0x2c54ac){if(_0x2c54ac){return _0x2c54ac[_0x900b('0x21')](_0xa5bb3c)[_0x900b('0x22')](function(_0x3d827b){return _0x3d827b;});}return null;};}function removeEntity(_0x8fc94c,_0x4e1c1d){return function(_0xe232ac){if(_0xe232ac){return _0xe232ac[_0x900b('0x23')]()['then'](function(){_0x8fc94c[_0x900b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c2ad6,_0x3e9b5e){return function(_0x154877){if(!_0x154877){_0x5c2ad6[_0x900b('0x16')](0x194);}return _0x154877;};}function handleError(_0x4cb61c,_0x4ee598){_0x4ee598=_0x4ee598||0x1f4;return function(_0x5342a4){logger[_0x900b('0x24')](_0x5342a4[_0x900b('0x25')]);if(_0x5342a4['name']){delete _0x5342a4[_0x900b('0x26')];}_0x4cb61c[_0x900b('0x17')](_0x4ee598)['send'](_0x5342a4);};}exports['index']=function(_0x832120,_0x462a4f){var _0x4ea7ea={},_0x41135d={},_0x369116={'count':0x0,'rows':[]};var _0x3e17e6=_[_0x900b('0x27')](db['Automation'][_0x900b('0x28')],function(_0x1af2ca){return{'name':_0x1af2ca['fieldName'],'type':_0x1af2ca[_0x900b('0x29')][_0x900b('0x2a')]};});_0x41135d[_0x900b('0x2b')]=_[_0x900b('0x27')](_0x3e17e6,_0x900b('0x26'));_0x41135d['query']=_['keys'](_0x832120['query']);_0x41135d['filters']=_[_0x900b('0x2c')](_0x41135d[_0x900b('0x2b')],_0x41135d[_0x900b('0x2d')]);_0x4ea7ea[_0x900b('0x2e')]=_[_0x900b('0x2c')](_0x41135d[_0x900b('0x2b')],qs['fields'](_0x832120[_0x900b('0x2d')][_0x900b('0x2f')]));_0x4ea7ea[_0x900b('0x2e')]=_0x4ea7ea[_0x900b('0x2e')]['length']?_0x4ea7ea[_0x900b('0x2e')]:_0x41135d[_0x900b('0x2b')];if(!_0x832120['query'][_0x900b('0x30')](_0x900b('0x31'))){_0x4ea7ea[_0x900b('0x1d')]=qs['limit'](_0x832120[_0x900b('0x2d')][_0x900b('0x1d')]);_0x4ea7ea[_0x900b('0x1a')]=qs[_0x900b('0x1a')](_0x832120[_0x900b('0x2d')][_0x900b('0x1a')]);}_0x4ea7ea[_0x900b('0x32')]=qs[_0x900b('0x33')](_0x832120[_0x900b('0x2d')][_0x900b('0x33')]);_0x4ea7ea[_0x900b('0x34')]=qs[_0x900b('0x35')](_['pick'](_0x832120[_0x900b('0x2d')],_0x41135d[_0x900b('0x35')]),_0x3e17e6);if(_0x832120[_0x900b('0x2d')][_0x900b('0x36')]){_0x4ea7ea['where']=_[_0x900b('0x37')](_0x4ea7ea[_0x900b('0x34')],{'$or':_[_0x900b('0x27')](_0x3e17e6,function(_0x516293){if(_0x516293[_0x900b('0x29')]!==_0x900b('0x38')){var _0x565501={};_0x565501[_0x516293[_0x900b('0x26')]]={'$like':'%'+_0x832120[_0x900b('0x2d')][_0x900b('0x36')]+'%'};return _0x565501;}})});}_0x4ea7ea=_[_0x900b('0x37')]({},_0x4ea7ea,_0x832120[_0x900b('0x39')]);var _0x1718a1={'where':_0x4ea7ea[_0x900b('0x34')]};return db[_0x900b('0x3a')][_0x900b('0x1c')](_0x1718a1)[_0x900b('0x22')](function(_0x3d94b6){_0x369116[_0x900b('0x1c')]=_0x3d94b6;if(_0x832120[_0x900b('0x2d')][_0x900b('0x3b')]){_0x4ea7ea[_0x900b('0x3c')]=[{'all':!![]}];}return db[_0x900b('0x3a')][_0x900b('0x3d')](_0x4ea7ea);})[_0x900b('0x22')](function(_0x59ef39){_0x369116['rows']=_0x59ef39;return _0x369116;})[_0x900b('0x22')](respondWithFilteredResult(_0x462a4f,_0x4ea7ea))[_0x900b('0x3e')](handleError(_0x462a4f,null));};exports[_0x900b('0x3f')]=function(_0x3f1a23,_0x37299e){var _0x98b90e={'raw':![],'where':{'id':_0x3f1a23['params']['id']}},_0x4a0639={};_0x4a0639[_0x900b('0x2b')]=_['keys'](db['Automation'][_0x900b('0x28')]);_0x4a0639[_0x900b('0x2d')]=_[_0x900b('0x40')](_0x3f1a23['query']);_0x4a0639[_0x900b('0x35')]=_[_0x900b('0x2c')](_0x4a0639['model'],_0x4a0639[_0x900b('0x2d')]);_0x98b90e[_0x900b('0x2e')]=_['intersection'](_0x4a0639[_0x900b('0x2b')],qs[_0x900b('0x2f')](_0x3f1a23[_0x900b('0x2d')][_0x900b('0x2f')]));_0x98b90e[_0x900b('0x2e')]=_0x98b90e['attributes'][_0x900b('0x41')]?_0x98b90e[_0x900b('0x2e')]:_0x4a0639['model'];if(_0x3f1a23[_0x900b('0x2d')][_0x900b('0x3b')]){_0x98b90e['include']=[{'all':!![]}];}_0x98b90e=_[_0x900b('0x37')]({},_0x98b90e,_0x3f1a23[_0x900b('0x39')]);return db[_0x900b('0x3a')][_0x900b('0x42')](_0x98b90e)[_0x900b('0x22')](handleEntityNotFound(_0x37299e,null))[_0x900b('0x22')](respondWithResult(_0x37299e,null))[_0x900b('0x3e')](handleError(_0x37299e,null));};exports[_0x900b('0x43')]=function(_0xe2eb45,_0x3cc22a){return db[_0x900b('0x3a')][_0x900b('0x43')](_0xe2eb45[_0x900b('0x44')],{})[_0x900b('0x22')](respondWithResult(_0x3cc22a,0xc9))[_0x900b('0x3e')](handleError(_0x3cc22a,null));};exports['update']=function(_0x583e0e,_0x447e74){if(_0x583e0e[_0x900b('0x44')]['id']){delete _0x583e0e[_0x900b('0x44')]['id'];}return db[_0x900b('0x3a')][_0x900b('0x42')]({'where':{'id':_0x583e0e[_0x900b('0x45')]['id']}})[_0x900b('0x22')](handleEntityNotFound(_0x447e74,null))[_0x900b('0x22')](saveUpdates(_0x583e0e[_0x900b('0x44')],null))[_0x900b('0x22')](respondWithResult(_0x447e74,null))[_0x900b('0x3e')](handleError(_0x447e74,null));};exports[_0x900b('0x23')]=function(_0x4ba0e0,_0x33a87c){return db[_0x900b('0x3a')]['find']({'where':{'id':_0x4ba0e0[_0x900b('0x45')]['id']}})[_0x900b('0x22')](handleEntityNotFound(_0x33a87c,null))[_0x900b('0x22')](removeEntity(_0x33a87c,null))[_0x900b('0x3e')](handleError(_0x33a87c,null));};exports[_0x900b('0x46')]=function(_0x2fd348,_0x3b8b04,_0x358155){return db[_0x900b('0x47')][_0x900b('0x42')]({'where':{'id':_0x2fd348[_0x900b('0x45')]['id']}})[_0x900b('0x22')](handleEntityNotFound(_0x3b8b04,null))[_0x900b('0x22')](function(_0x22e91f){if(_0x22e91f){return _0x22e91f[_0x900b('0x46')](_0x2fd348[_0x900b('0x44')][_0x900b('0x48')],_[_0x900b('0x49')](_0x2fd348[_0x900b('0x44')],[_0x900b('0x48'),'id'])||{});}})['then'](respondWithResult(_0x3b8b04,null))[_0x900b('0x3e')](handleError(_0x3b8b04,null));};exports[_0x900b('0x4a')]=function(_0x2fc901,_0x43505f,_0x117bea){var _0x1748e0={};var _0x5a7955={};var _0x491a6d;var _0x570714;return db[_0x900b('0x3a')][_0x900b('0x4b')]({'where':{'id':_0x2fc901[_0x900b('0x45')]['id']}})[_0x900b('0x22')](handleEntityNotFound(_0x43505f,null))[_0x900b('0x22')](function(_0x186ab0){if(_0x186ab0){_0x491a6d=_0x186ab0;_0x5a7955[_0x900b('0x2b')]=_[_0x900b('0x40')](db[_0x900b('0x47')][_0x900b('0x28')]);_0x5a7955[_0x900b('0x2d')]=_[_0x900b('0x40')](_0x2fc901['query']);_0x5a7955[_0x900b('0x35')]=_[_0x900b('0x2c')](_0x5a7955[_0x900b('0x2b')],_0x5a7955[_0x900b('0x2d')]);_0x1748e0[_0x900b('0x2e')]=_[_0x900b('0x2c')](_0x5a7955[_0x900b('0x2b')],qs[_0x900b('0x2f')](_0x2fc901['query'][_0x900b('0x2f')]));_0x1748e0[_0x900b('0x2e')]=_0x1748e0['attributes'][_0x900b('0x41')]?_0x1748e0[_0x900b('0x2e')]:_0x5a7955['model'];_0x1748e0[_0x900b('0x32')]=qs[_0x900b('0x33')](_0x2fc901['query'][_0x900b('0x33')]);_0x1748e0['where']=qs[_0x900b('0x35')](_[_0x900b('0x4c')](_0x2fc901[_0x900b('0x2d')],_0x5a7955[_0x900b('0x35')]));if(_0x2fc901[_0x900b('0x2d')][_0x900b('0x36')]){_0x1748e0['where']=_['merge'](_0x1748e0[_0x900b('0x34')],{'$or':_[_0x900b('0x27')](_0x1748e0[_0x900b('0x2e')],function(_0x288c1d){var _0x5a50dc={};_0x5a50dc[_0x288c1d]={'$like':'%'+_0x2fc901[_0x900b('0x2d')][_0x900b('0x36')]+'%'};return _0x5a50dc;})});}_0x1748e0=_['merge']({},_0x1748e0,_0x2fc901['options']);return _0x491a6d[_0x900b('0x4a')](_0x1748e0);}})['then'](function(_0x514754){if(_0x514754){_0x570714=_0x514754[_0x900b('0x41')];if(!_0x2fc901[_0x900b('0x2d')][_0x900b('0x30')](_0x900b('0x31'))){_0x1748e0[_0x900b('0x1d')]=qs[_0x900b('0x1d')](_0x2fc901[_0x900b('0x2d')][_0x900b('0x1d')]);_0x1748e0['offset']=qs[_0x900b('0x1a')](_0x2fc901[_0x900b('0x2d')][_0x900b('0x1a')]);}return _0x491a6d[_0x900b('0x4a')](_0x1748e0);}})[_0x900b('0x22')](function(_0x4ac47c){if(_0x4ac47c){return _0x4ac47c?{'count':_0x570714,'rows':_0x4ac47c}:null;}})[_0x900b('0x22')](respondWithResult(_0x43505f,null))[_0x900b('0x3e')](handleError(_0x43505f,null));};exports[_0x900b('0x4d')]=function(_0x311355,_0x2776dd,_0x3aa6f5){return db[_0x900b('0x4e')]['find']({'where':{'id':_0x311355[_0x900b('0x45')]['id']}})[_0x900b('0x22')](handleEntityNotFound(_0x2776dd,null))[_0x900b('0x22')](function(_0x4c4381){if(_0x4c4381){return _0x4c4381[_0x900b('0x4d')](_0x311355[_0x900b('0x44')][_0x900b('0x48')],_[_0x900b('0x49')](_0x311355['body'],[_0x900b('0x48'),'id'])||{});}})[_0x900b('0x22')](respondWithResult(_0x2776dd,null))[_0x900b('0x3e')](handleError(_0x2776dd,null));};exports['getActions']=function(_0x2f4265,_0x134f80,_0x330482){var _0x1af942={};var _0x4ce172={};var _0x333a29;var _0x40e0f1;return db[_0x900b('0x3a')][_0x900b('0x4b')]({'where':{'id':_0x2f4265[_0x900b('0x45')]['id']}})['then'](handleEntityNotFound(_0x134f80,null))[_0x900b('0x22')](function(_0x531981){if(_0x531981){_0x333a29=_0x531981;_0x4ce172['model']=_[_0x900b('0x40')](db[_0x900b('0x4e')][_0x900b('0x28')]);_0x4ce172[_0x900b('0x2d')]=_[_0x900b('0x40')](_0x2f4265[_0x900b('0x2d')]);_0x4ce172[_0x900b('0x35')]=_[_0x900b('0x2c')](_0x4ce172[_0x900b('0x2b')],_0x4ce172[_0x900b('0x2d')]);_0x1af942[_0x900b('0x2e')]=_[_0x900b('0x2c')](_0x4ce172[_0x900b('0x2b')],qs['fields'](_0x2f4265[_0x900b('0x2d')][_0x900b('0x2f')]));_0x1af942[_0x900b('0x2e')]=_0x1af942[_0x900b('0x2e')][_0x900b('0x41')]?_0x1af942[_0x900b('0x2e')]:_0x4ce172[_0x900b('0x2b')];_0x1af942[_0x900b('0x32')]=qs[_0x900b('0x33')](_0x2f4265[_0x900b('0x2d')][_0x900b('0x33')]);_0x1af942[_0x900b('0x34')]=qs[_0x900b('0x35')](_[_0x900b('0x4c')](_0x2f4265[_0x900b('0x2d')],_0x4ce172[_0x900b('0x35')]));if(_0x2f4265['query'][_0x900b('0x36')]){_0x1af942['where']=_[_0x900b('0x37')](_0x1af942[_0x900b('0x34')],{'$or':_['map'](_0x1af942[_0x900b('0x2e')],function(_0x3f13a3){var _0x339cb0={};_0x339cb0[_0x3f13a3]={'$like':'%'+_0x2f4265[_0x900b('0x2d')]['filter']+'%'};return _0x339cb0;})});}_0x1af942=_['merge']({},_0x1af942,_0x2f4265['options']);return _0x333a29[_0x900b('0x4f')](_0x1af942);}})[_0x900b('0x22')](function(_0x161bdb){if(_0x161bdb){_0x40e0f1=_0x161bdb[_0x900b('0x41')];if(!_0x2f4265[_0x900b('0x2d')]['hasOwnProperty']('nolimit')){_0x1af942['limit']=qs[_0x900b('0x1d')](_0x2f4265[_0x900b('0x2d')][_0x900b('0x1d')]);_0x1af942[_0x900b('0x1a')]=qs['offset'](_0x2f4265[_0x900b('0x2d')][_0x900b('0x1a')]);}return _0x333a29[_0x900b('0x4f')](_0x1af942);}})[_0x900b('0x22')](function(_0x3bc8d9){if(_0x3bc8d9){return _0x3bc8d9?{'count':_0x40e0f1,'rows':_0x3bc8d9}:null;}})[_0x900b('0x22')](respondWithResult(_0x134f80,null))[_0x900b('0x3e')](handleError(_0x134f80,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 8cbb004..3bb54cb 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 _0x2b6f=['api','bluebird','request-promise','path','rimraf','../../config/environment','define','Automation','util','../../config/logger'];(function(_0x4a5010,_0x625447){var _0x44f3d5=function(_0xdb2f58){while(--_0xdb2f58){_0x4a5010['push'](_0x4a5010['shift']());}};_0x44f3d5(++_0x625447);}(_0x2b6f,0x94));var _0xf2b6=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x2b6f[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require('lodash');var util=require(_0xf2b6('0x0'));var logger=require(_0xf2b6('0x1'))(_0xf2b6('0x2'));var moment=require('moment');var BPromise=require(_0xf2b6('0x3'));var rp=require(_0xf2b6('0x4'));var fs=require('fs');var path=require(_0xf2b6('0x5'));var rimraf=require(_0xf2b6('0x6'));var config=require(_0xf2b6('0x7'));var attributes=require('./automation.attributes');module['exports']=function(_0x5b7b71,_0x1f2372){return _0x5b7b71[_0xf2b6('0x8')](_0xf2b6('0x9'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd478=['util','bluebird','path','rimraf','../../config/environment','exports','define','Automation','tools_automations','lodash'];(function(_0x456e47,_0x1bfc8f){var _0x45cdc7=function(_0x105d06){while(--_0x105d06){_0x456e47['push'](_0x456e47['shift']());}};_0x45cdc7(++_0x1bfc8f);}(_0xd478,0x171));var _0x8d47=function(_0x1b7442,_0x392128){_0x1b7442=_0x1b7442-0x0;var _0x15ef34=_0xd478[_0x1b7442];return _0x15ef34;};'use strict';var _=require(_0x8d47('0x0'));var util=require(_0x8d47('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8d47('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d47('0x3'));var rimraf=require(_0x8d47('0x4'));var config=require(_0x8d47('0x5'));var attributes=require('./automation.attributes');module[_0x8d47('0x6')]=function(_0x17280e,_0x51e179){return _0x17280e[_0x8d47('0x7')](_0x8d47('0x8'),attributes,{'tableName':_0x8d47('0x9'),'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 5bd07e7..a68c445 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 _0x0570=['request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x58175c,_0x2d9373){var _0x55b88f=function(_0x13ed84){while(--_0x13ed84){_0x58175c['push'](_0x58175c['shift']());}};_0x55b88f(++_0x2d9373);}(_0x0570,0x172));var _0x0057=function(_0x5472cc,_0x35ef9c){_0x5472cc=_0x5472cc-0x0;var _0x4255cf=_0x0570[_0x5472cc];return _0x4255cf;};'use strict';var _=require('lodash');var util=require(_0x0057('0x0'));var moment=require(_0x0057('0x1'));var BPromise=require(_0x0057('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0057('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0057('0x4'));var logger=require('../../config/logger')(_0x0057('0x5'));var config=require(_0x0057('0x6'));var jayson=require(_0x0057('0x7'));var client=jayson[_0x0057('0x8')][_0x0057('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5096e2,_0xc86734,_0x529f55){return new BPromise(function(_0x15d424,_0x2f9d7f){return client[_0x0057('0xa')](_0x5096e2,_0x529f55)[_0x0057('0xb')](function(_0x29b7c6){logger['info'](_0x0057('0xc'),_0xc86734,_0x0057('0xd'));logger[_0x0057('0xe')]('Automation,\x20%s,\x20%s,\x20%s',_0xc86734,_0x0057('0xd'),JSON[_0x0057('0xf')](_0x29b7c6));if(_0x29b7c6['error']){if(_0x29b7c6['error'][_0x0057('0x10')]===0x1f4){logger[_0x0057('0x11')](_0x0057('0xc'),_0xc86734,_0x29b7c6['error'][_0x0057('0x12')]);return _0x2f9d7f(_0x29b7c6[_0x0057('0x11')][_0x0057('0x12')]);}logger[_0x0057('0x11')]('Automation,\x20%s,\x20%s',_0xc86734,_0x29b7c6[_0x0057('0x11')][_0x0057('0x12')]);return _0x15d424(_0x29b7c6['error'][_0x0057('0x12')]);}else{logger[_0x0057('0x13')]('Automation,\x20%s,\x20%s',_0xc86734,_0x0057('0xd'));_0x15d424(_0x29b7c6['result'][_0x0057('0x12')]);}})['catch'](function(_0x4be851){logger[_0x0057('0x11')]('Automation,\x20%s,\x20%s',_0xc86734,_0x4be851);_0x2f9d7f(_0x4be851);});});}
\ No newline at end of file
+var _0x6f18=['moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x246698,_0x24f600){var _0x34ab93=function(_0x49c5bf){while(--_0x49c5bf){_0x246698['push'](_0x246698['shift']());}};_0x34ab93(++_0x24f600);}(_0x6f18,0x1b4));var _0x86f1=function(_0x496e32,_0x3b3d8a){_0x496e32=_0x496e32-0x0;var _0x282961=_0x6f18[_0x496e32];return _0x282961;};'use strict';var _=require(_0x86f1('0x0'));var util=require('util');var moment=require(_0x86f1('0x1'));var BPromise=require('bluebird');var rs=require(_0x86f1('0x2'));var fs=require('fs');var Redis=require(_0x86f1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x86f1('0x4'));var logger=require(_0x86f1('0x5'))('rpc');var config=require(_0x86f1('0x6'));var jayson=require(_0x86f1('0x7'));var client=jayson[_0x86f1('0x8')][_0x86f1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x403f48,_0x4c7943,_0x5b0f45){return new BPromise(function(_0x3cc3c5,_0x3223eb){return client[_0x86f1('0xa')](_0x403f48,_0x5b0f45)[_0x86f1('0xb')](function(_0x4f1f6e){logger[_0x86f1('0xc')](_0x86f1('0xd'),_0x4c7943,_0x86f1('0xe'));logger[_0x86f1('0xf')](_0x86f1('0x10'),_0x4c7943,_0x86f1('0xe'),JSON[_0x86f1('0x11')](_0x4f1f6e));if(_0x4f1f6e[_0x86f1('0x12')]){if(_0x4f1f6e['error'][_0x86f1('0x13')]===0x1f4){logger[_0x86f1('0x12')](_0x86f1('0xd'),_0x4c7943,_0x4f1f6e[_0x86f1('0x12')][_0x86f1('0x14')]);return _0x3223eb(_0x4f1f6e[_0x86f1('0x12')]['message']);}logger[_0x86f1('0x12')](_0x86f1('0xd'),_0x4c7943,_0x4f1f6e[_0x86f1('0x12')][_0x86f1('0x14')]);return _0x3cc3c5(_0x4f1f6e[_0x86f1('0x12')][_0x86f1('0x14')]);}else{logger[_0x86f1('0xc')](_0x86f1('0xd'),_0x4c7943,'request\x20sent');_0x3cc3c5(_0x4f1f6e[_0x86f1('0x15')][_0x86f1('0x14')]);}})[_0x86f1('0x16')](function(_0x4452c4){logger[_0x86f1('0x12')](_0x86f1('0xd'),_0x4c7943,_0x4452c4);_0x3223eb(_0x4452c4);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 583c419..a91d0fe 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 _0x16e4=['Router','../../components/auth/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','getActions','post','create','addConditions','/:id/actions','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x59190d,_0x1fe75c){var _0x3f28c3=function(_0x3069d1){while(--_0x3069d1){_0x59190d['push'](_0x59190d['shift']());}};_0x3f28c3(++_0x1fe75c);}(_0x16e4,0x97));var _0x416e=function(_0x576596,_0x1e85e3){_0x576596=_0x576596-0x0;var _0x5cd85a=_0x16e4[_0x576596];return _0x5cd85a;};'use strict';var multer=require(_0x416e('0x0'));var util=require(_0x416e('0x1'));var path=require(_0x416e('0x2'));var timeout=require(_0x416e('0x3'));var express=require(_0x416e('0x4'));var router=express[_0x416e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x416e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x416e('0x7'));var controller=require(_0x416e('0x8'));router['get']('/',auth[_0x416e('0x9')](),controller[_0x416e('0xa')]);router[_0x416e('0xb')](_0x416e('0xc'),auth[_0x416e('0x9')](),controller[_0x416e('0xd')]);router[_0x416e('0xb')](_0x416e('0xe'),auth[_0x416e('0x9')](),controller['getConditions']);router[_0x416e('0xb')]('/:id/actions',auth[_0x416e('0x9')](),controller[_0x416e('0xf')]);router[_0x416e('0x10')]('/',auth['isAuthenticated'](),controller[_0x416e('0x11')]);router[_0x416e('0x10')](_0x416e('0xe'),auth['isAuthenticated'](),controller[_0x416e('0x12')]);router['post'](_0x416e('0x13'),auth[_0x416e('0x9')](),controller[_0x416e('0x14')]);router[_0x416e('0x15')]('/:id',auth[_0x416e('0x9')](),controller[_0x416e('0x16')]);router[_0x416e('0x17')](_0x416e('0xc'),auth[_0x416e('0x9')](),controller[_0x416e('0x18')]);module[_0x416e('0x19')]=router;
\ No newline at end of file
+var _0x635c=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','update','delete','destroy','exports'];(function(_0xaa6a4,_0x64b067){var _0xdc31a4=function(_0x4269d8){while(--_0x4269d8){_0xaa6a4['push'](_0xaa6a4['shift']());}};_0xdc31a4(++_0x64b067);}(_0x635c,0xa1));var _0xc635=function(_0x1b8aaf,_0x894b62){_0x1b8aaf=_0x1b8aaf-0x0;var _0x5b4758=_0x635c[_0x1b8aaf];return _0x5b4758;};'use strict';var multer=require('multer');var util=require(_0xc635('0x0'));var path=require(_0xc635('0x1'));var timeout=require(_0xc635('0x2'));var express=require(_0xc635('0x3'));var router=express['Router']();var fs_extra=require(_0xc635('0x4'));var auth=require(_0xc635('0x5'));var interaction=require(_0xc635('0x6'));var config=require(_0xc635('0x7'));var controller=require(_0xc635('0x8'));router[_0xc635('0x9')]('/',auth[_0xc635('0xa')](),controller['index']);router[_0xc635('0x9')](_0xc635('0xb'),auth[_0xc635('0xa')](),controller['show']);router[_0xc635('0x9')](_0xc635('0xc'),auth[_0xc635('0xa')](),controller[_0xc635('0xd')]);router[_0xc635('0x9')](_0xc635('0xe'),auth[_0xc635('0xa')](),controller[_0xc635('0xf')]);router[_0xc635('0x10')]('/',auth[_0xc635('0xa')](),controller['create']);router[_0xc635('0x10')](_0xc635('0xc'),auth[_0xc635('0xa')](),controller[_0xc635('0x11')]);router['post'](_0xc635('0xe'),auth[_0xc635('0xa')](),controller[_0xc635('0x12')]);router['put']('/:id',auth[_0xc635('0xa')](),controller[_0xc635('0x13')]);router[_0xc635('0x14')](_0xc635('0xb'),auth[_0xc635('0xa')](),controller[_0xc635('0x15')]);module[_0xc635('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index f3f5c7f..22956aa 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 _0x99e7=['NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','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)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)'];(function(_0x534216,_0x3789b4){var _0x3731ce=function(_0x44c6d1){while(--_0x44c6d1){_0x534216['push'](_0x534216['shift']());}};_0x3731ce(++_0x3789b4);}(_0x99e7,0x1b5));var _0x799e=function(_0x2bb3f6,_0x25fde0){_0x2bb3f6=_0x2bb3f6-0x0;var _0x62b339=_0x99e7[_0x2bb3f6];return _0x62b339;};'use strict';var Sequelize=require(_0x799e('0x0'));module[_0x799e('0x1')]={'name':{'type':Sequelize[_0x799e('0x2')],'unique':_0x799e('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x799e('0x4')](_0x799e('0x5')),'allowNull':![],'defaultValue':_0x799e('0x5')},'description':{'type':Sequelize[_0x799e('0x2')]},'active':{'type':Sequelize[_0x799e('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x799e('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x799e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x799e('0x8')](0x3)[_0x799e('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x799e('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x799e('0x8')](0x3)[_0x799e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x799e('0x8')](0x5)[_0x799e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x799e('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x799e('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x799e('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x799e('0x8')](0x5)[_0x799e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x799e('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x799e('0x8')](0x3)[_0x799e('0x7')],'defaultValue':0x3,'comment':_0x799e('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x799e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x799e('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x799e('0x8')](0x3)[_0x799e('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x799e('0xf')},'dialTimezone':{'type':Sequelize[_0x799e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x799e('0x2')],'defaultValue':_0x799e('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x799e('0x4')](_0x799e('0x11'),'never','onlyIfOpen'),'defaultValue':_0x799e('0x11')},'dialAMDActive':{'type':Sequelize[_0x799e('0x6')],'defaultValue':0x0,'comment':_0x799e('0x12')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x799e('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x799e('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x799e('0x8')](0x9)[_0x799e('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x799e('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x799e('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x799e('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x799e('0x8')](0x9)[_0x799e('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x799e('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x799e('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x799e('0x8')](0x9)[_0x799e('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x799e('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x799e('0x8')](0x9)[_0x799e('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x799e('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x799e('0x8')](0x5)[_0x799e('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x799e('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x799e('0x8')](0x9)[_0x799e('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x799e('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x799e('0x1b'),_0x799e('0x1c')),'defaultValue':_0x799e('0x1b')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x799e('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x799e('0x1d')},'dialCutDigit':{'type':Sequelize[_0x799e('0x8')](0x3)[_0x799e('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x799e('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x799e('0x8')](0x3)[_0x799e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x799e('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x799e('0x8')](0x5)[_0x799e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x799e('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x799e('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x799e('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x799e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x799e('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x799e('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x799e('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x799e('0x8')](0x5)[_0x799e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x799e('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0x799e('0x8')](0x3)[_0x799e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x799e('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0x799e('0x8')](0x5)[_0x799e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x799e('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x799e('0x8')](0x3)[_0x799e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x799e('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x799e('0x8')](0x5)[_0x799e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x799e('0x28')}};
\ No newline at end of file
+var _0xc9de=['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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','DESC','ASC','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\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)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xc9de,0x140));var _0xec9d=function(_0x32c9eb,_0x5596f4){_0x32c9eb=_0x32c9eb-0x0;var _0x5c87f4=_0xc9de[_0x32c9eb];return _0x5c87f4;};'use strict';var Sequelize=require(_0xec9d('0x0'));module[_0xec9d('0x1')]={'name':{'type':Sequelize[_0xec9d('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xec9d('0x3')](_0xec9d('0x4')),'allowNull':![],'defaultValue':_0xec9d('0x4')},'description':{'type':Sequelize[_0xec9d('0x2')]},'active':{'type':Sequelize[_0xec9d('0x5')],'defaultValue':0x0,'comment':_0xec9d('0x6')},'limitCalls':{'type':Sequelize[_0xec9d('0x7')](0x4)[_0xec9d('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xec9d('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xec9d('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xec9d('0x7')](0x3)[_0xec9d('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xec9d('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xec9d('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xec9d('0x7')](0x3)[_0xec9d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xec9d('0x7')](0x5)[_0xec9d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xec9d('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xec9d('0x8')],'defaultValue':0x3,'comment':_0xec9d('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xec9d('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xec9d('0xc')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xec9d('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xec9d('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xec9d('0x2')],'defaultValue':_0xec9d('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xec9d('0x3')](_0xec9d('0xf'),_0xec9d('0x10'),_0xec9d('0x11')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xec9d('0x5')],'defaultValue':0x0,'comment':_0xec9d('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xec9d('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xec9d('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xec9d('0x7')](0x9)[_0xec9d('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xec9d('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xec9d('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xec9d('0x7')](0x9)[_0xec9d('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xec9d('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xec9d('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xec9d('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xec9d('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xec9d('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xec9d('0x7')](0x9)[_0xec9d('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xec9d('0x7')](0x5)[_0xec9d('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xec9d('0x7')](0x9)[_0xec9d('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xec9d('0x3')](_0xec9d('0x18'),_0xec9d('0x19')),'defaultValue':_0xec9d('0x18')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xec9d('0x7')](0x3)[_0xec9d('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xec9d('0x1a')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xec9d('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xec9d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xec9d('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xec9d('0x7')](0x5)[_0xec9d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xec9d('0x1c')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xec9d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xec9d('0x7')](0x5)[_0xec9d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xec9d('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xec9d('0x7')](0x3)[_0xec9d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xec9d('0x7')](0x5)[_0xec9d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xec9d('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xec9d('0x1e')},'dialMachineRetryFrequency':{'type':Sequelize[_0xec9d('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xec9d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xec9d('0x1f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xec9d('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xec9d('0x20')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 9c00954..dba078f 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 _0xa169=['CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','field','NOW()','toString','ListId','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','push','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','sequelize','removeBlackLists','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','update','then','get','UserProfileResource','destroy','stack','name','index','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','Campaign','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','IvrCampaigns','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','body','omit','createdAt','error','getHoppers','findOne','CmHopper'];(function(_0x25cd2c,_0x57498e){var _0x1e364c=function(_0x35ac2e){while(--_0x35ac2e){_0x25cd2c['push'](_0x25cd2c['shift']());}};_0x1e364c(++_0x57498e);}(_0xa169,0x13b));var _0x9a16=function(_0x9c502c,_0x12f7d0){_0x9c502c=_0x9c502c-0x0;var _0x8a1834=_0xa169[_0x9c502c];return _0x8a1834;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a16('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9a16('0x1'));var BPromise=require(_0x9a16('0x2'));var Mustache=require('mustache');var util=require(_0x9a16('0x3'));var path=require(_0x9a16('0x4'));var sox=require(_0x9a16('0x5'));var csv=require(_0x9a16('0x6'));var ejs=require(_0x9a16('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a16('0x8'));var squel=require(_0x9a16('0x9'));var crypto=require(_0x9a16('0xa'));var jsforce=require(_0x9a16('0xb'));var deskjs=require(_0x9a16('0xc'));var toCsv=require(_0x9a16('0x6'));var querystring=require(_0x9a16('0xd'));var Papa=require(_0x9a16('0xe'));var Redis=require(_0x9a16('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9a16('0x10'));var as=require(_0x9a16('0x11'));var hardwareService=require(_0x9a16('0x12'));var logger=require(_0x9a16('0x13'))(_0x9a16('0x14'));var utils=require(_0x9a16('0x15'));var config=require(_0x9a16('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9a16('0x17'))['db'];function respondWithStatusCode(_0x59bcd6,_0x4290c3){_0x4290c3=_0x4290c3||0xcc;return function(_0xab63fb){if(_0xab63fb){return _0x59bcd6[_0x9a16('0x18')](_0x4290c3);}return _0x59bcd6['status'](_0x4290c3)[_0x9a16('0x19')]();};}function respondWithResult(_0x3bfc04,_0x1e59d1){_0x1e59d1=_0x1e59d1||0xc8;return function(_0x2eb354){if(_0x2eb354){return _0x3bfc04['status'](_0x1e59d1)[_0x9a16('0x1a')](_0x2eb354);}};}function respondWithFilteredResult(_0x10253a,_0x27f834){return function(_0x293454){if(_0x293454){var _0x3e044b=typeof _0x27f834[_0x9a16('0x1b')]===_0x9a16('0x1c')&&typeof _0x27f834[_0x9a16('0x1d')]==='undefined';var _0x40bee0=_0x293454[_0x9a16('0x1e')];var _0x33e0bc=_0x3e044b?0x0:_0x27f834[_0x9a16('0x1b')];var _0x1b05e1=_0x3e044b?_0x293454[_0x9a16('0x1e')]:_0x27f834[_0x9a16('0x1b')]+_0x27f834[_0x9a16('0x1d')];var _0xb4d5d6;if(_0x1b05e1>=_0x40bee0){_0x1b05e1=_0x40bee0;_0xb4d5d6=0xc8;}else{_0xb4d5d6=0xce;}_0x10253a[_0x9a16('0x1f')](_0xb4d5d6);return _0x10253a[_0x9a16('0x20')](_0x9a16('0x21'),_0x33e0bc+'-'+_0x1b05e1+'/'+_0x40bee0)[_0x9a16('0x1a')](_0x293454);}return null;};}function patchUpdates(_0xffdcca){return function(_0x442665){try{jsonpatch['apply'](_0x442665,_0xffdcca,!![]);}catch(_0xaa94f4){return BPromise[_0x9a16('0x22')](_0xaa94f4);}return _0x442665['save']();};}function saveUpdates(_0xe7f027,_0x255756){return function(_0x4ef667){if(_0x4ef667){return _0x4ef667[_0x9a16('0x23')](_0xe7f027)[_0x9a16('0x24')](function(_0x43e018){return _0x43e018;});}return null;};}function removeEntity(_0x89c0bd,_0x3fa6e9){return function(_0x133952){if(_0x133952){return _0x133952['destroy']()[_0x9a16('0x24')](function(){var _0x424969=_0x133952[_0x9a16('0x25')]({'plain':!![]});var _0x20e276='IvrCampaigns';return db[_0x9a16('0x26')][_0x9a16('0x27')]({'where':{'type':_0x20e276,'resourceId':_0x424969['id']}})[_0x9a16('0x24')](function(){return _0x133952;});})[_0x9a16('0x24')](function(){_0x89c0bd[_0x9a16('0x1f')](0xcc)[_0x9a16('0x19')]();});}};}function handleEntityNotFound(_0x3424a2,_0x385ad1){return function(_0x3a550f){if(!_0x3a550f){_0x3424a2[_0x9a16('0x18')](0x194);}return _0x3a550f;};}function handleError(_0x16329b,_0x30fa0b){_0x30fa0b=_0x30fa0b||0x1f4;return function(_0x4c118a){logger['error'](_0x4c118a[_0x9a16('0x28')]);if(_0x4c118a[_0x9a16('0x29')]){delete _0x4c118a[_0x9a16('0x29')];}_0x16329b[_0x9a16('0x1f')](_0x30fa0b)['send'](_0x4c118a);};}exports[_0x9a16('0x2a')]=function(_0x483fc1,_0xb279af){var _0x13cc7f={},_0x167b25={},_0x233161={'count':0x0,'rows':[]};var _0x1ab751=_['map'](db['Campaign'][_0x9a16('0x2b')],function(_0x2b6a2e){return{'name':_0x2b6a2e['fieldName'],'type':_0x2b6a2e[_0x9a16('0x2c')]['key']};});_0x167b25[_0x9a16('0x2d')]=_[_0x9a16('0x2e')](_0x1ab751,'name');_0x167b25[_0x9a16('0x2f')]=_[_0x9a16('0x30')](_0x483fc1[_0x9a16('0x2f')]);_0x167b25[_0x9a16('0x31')]=_[_0x9a16('0x32')](_0x167b25['model'],_0x167b25[_0x9a16('0x2f')]);_0x13cc7f[_0x9a16('0x33')]=_[_0x9a16('0x32')](_0x167b25[_0x9a16('0x2d')],qs['fields'](_0x483fc1[_0x9a16('0x2f')][_0x9a16('0x34')]));_0x13cc7f[_0x9a16('0x33')]=_0x13cc7f[_0x9a16('0x33')][_0x9a16('0x35')]?_0x13cc7f['attributes']:_0x167b25[_0x9a16('0x2d')];if(!_0x483fc1[_0x9a16('0x2f')][_0x9a16('0x36')](_0x9a16('0x37'))){_0x13cc7f['limit']=qs[_0x9a16('0x1d')](_0x483fc1[_0x9a16('0x2f')][_0x9a16('0x1d')]);_0x13cc7f['offset']=qs[_0x9a16('0x1b')](_0x483fc1[_0x9a16('0x2f')][_0x9a16('0x1b')]);}_0x13cc7f[_0x9a16('0x38')]=qs[_0x9a16('0x39')](_0x483fc1['query'][_0x9a16('0x39')]);_0x13cc7f[_0x9a16('0x3a')]=qs[_0x9a16('0x31')](_[_0x9a16('0x3b')](_0x483fc1[_0x9a16('0x2f')],_0x167b25[_0x9a16('0x31')]),_0x1ab751);if(_0x483fc1[_0x9a16('0x2f')][_0x9a16('0x3c')]){_0x13cc7f[_0x9a16('0x3a')]=_['merge'](_0x13cc7f[_0x9a16('0x3a')],{'$or':_['map'](_0x1ab751,function(_0x34e71d){if(_0x34e71d['type']!==_0x9a16('0x3d')){var _0x1da105={};_0x1da105[_0x34e71d[_0x9a16('0x29')]]={'$like':'%'+_0x483fc1[_0x9a16('0x2f')][_0x9a16('0x3c')]+'%'};return _0x1da105;}})});}_0x13cc7f=_[_0x9a16('0x3e')]({},_0x13cc7f,_0x483fc1[_0x9a16('0x3f')]);var _0x25ce6c={'where':_0x13cc7f[_0x9a16('0x3a')]};return db['Campaign']['count'](_0x25ce6c)[_0x9a16('0x24')](function(_0x534bea){_0x233161['count']=_0x534bea;if(_0x483fc1[_0x9a16('0x2f')][_0x9a16('0x40')]){_0x13cc7f[_0x9a16('0x41')]=[{'all':!![]}];}return db[_0x9a16('0x42')][_0x9a16('0x43')](_0x13cc7f);})[_0x9a16('0x24')](function(_0x4bf1f2){_0x233161[_0x9a16('0x44')]=_0x4bf1f2;return _0x233161;})[_0x9a16('0x24')](respondWithFilteredResult(_0xb279af,_0x13cc7f))[_0x9a16('0x45')](handleError(_0xb279af,null));};exports[_0x9a16('0x46')]=function(_0x2759aa,_0x1b30b0){var _0x4afa39={'raw':![],'where':{'id':_0x2759aa[_0x9a16('0x47')]['id']}},_0x1b6497={};_0x1b6497['model']=_[_0x9a16('0x30')](db[_0x9a16('0x42')][_0x9a16('0x2b')]);_0x1b6497[_0x9a16('0x2f')]=_[_0x9a16('0x30')](_0x2759aa[_0x9a16('0x2f')]);_0x1b6497['filters']=_[_0x9a16('0x32')](_0x1b6497[_0x9a16('0x2d')],_0x1b6497[_0x9a16('0x2f')]);_0x4afa39[_0x9a16('0x33')]=_[_0x9a16('0x32')](_0x1b6497[_0x9a16('0x2d')],qs[_0x9a16('0x34')](_0x2759aa[_0x9a16('0x2f')][_0x9a16('0x34')]));_0x4afa39['attributes']=_0x4afa39['attributes'][_0x9a16('0x35')]?_0x4afa39[_0x9a16('0x33')]:_0x1b6497[_0x9a16('0x2d')];if(_0x2759aa[_0x9a16('0x2f')][_0x9a16('0x40')]){_0x4afa39[_0x9a16('0x41')]=[{'all':!![]}];}_0x4afa39=_[_0x9a16('0x3e')]({},_0x4afa39,_0x2759aa['options']);return db[_0x9a16('0x42')][_0x9a16('0x48')](_0x4afa39)['then'](handleEntityNotFound(_0x1b30b0,null))['then'](respondWithResult(_0x1b30b0,null))['catch'](handleError(_0x1b30b0,null));};exports['create']=function(_0xebb110,_0x26b126){return db[_0x9a16('0x42')][_0x9a16('0x49')](_0xebb110['body'],{})[_0x9a16('0x24')](function(_0x316665){var _0x1c1b92=_0xebb110['user'][_0x9a16('0x25')]({'plain':!![]});if(!_0x1c1b92)throw new Error(_0x9a16('0x4a'));if(_0x1c1b92[_0x9a16('0x4b')]===_0x9a16('0x4c')){var _0x1c4072=_0x316665[_0x9a16('0x25')]({'plain':!![]});var _0x46b0bf=_0x9a16('0x4d');return db[_0x9a16('0x4e')][_0x9a16('0x48')]({'where':{'name':_0x46b0bf,'userProfileId':_0x1c1b92[_0x9a16('0x4f')]},'raw':!![]})[_0x9a16('0x24')](function(_0x3156ab){if(_0x3156ab&&_0x3156ab['autoAssociation']===0x0){return db[_0x9a16('0x26')][_0x9a16('0x49')]({'name':_0x1c4072[_0x9a16('0x29')],'resourceId':_0x1c4072['id'],'type':_0x3156ab['name'],'sectionId':_0x3156ab['id']},{})[_0x9a16('0x24')](function(){return _0x316665;});}else{return _0x316665;}})[_0x9a16('0x45')](function(_0x2037f0){logger['error'](_0x9a16('0x50'),_0x2037f0);throw _0x2037f0;});}return _0x316665;})[_0x9a16('0x24')](respondWithResult(_0x26b126,0xc9))[_0x9a16('0x45')](handleError(_0x26b126,null));};exports[_0x9a16('0x51')]=function(_0x312895,_0x367ffa){var _0x4e18c1={'where':{'id':_0x312895[_0x9a16('0x47')]['id']}},_0x2dda7c={};_0x2dda7c[_0x9a16('0x2d')]=_[_0x9a16('0x30')](db[_0x9a16('0x42')][_0x9a16('0x2b')]);_0x4e18c1['attributes']=_[_0x9a16('0x32')](_0x2dda7c[_0x9a16('0x2d')],qs[_0x9a16('0x34')](_0x312895['query'][_0x9a16('0x34')]));_0x4e18c1[_0x9a16('0x33')]=_0x4e18c1[_0x9a16('0x33')]['length']?_0x4e18c1[_0x9a16('0x33')]:_0x2dda7c[_0x9a16('0x2d')];if(_0x312895[_0x9a16('0x2f')][_0x9a16('0x40')]){_0x4e18c1['include']=[{'all':!![]}];}_0x4e18c1=_[_0x9a16('0x3e')]({},_0x4e18c1,_0x312895[_0x9a16('0x3f')]);return db['Campaign']['find'](_0x4e18c1)[_0x9a16('0x24')](handleEntityNotFound(_0x367ffa,null))[_0x9a16('0x24')](function(_0x3f339f){if(_0x3f339f){var _0x5b15eb=_0x3f339f[_0x9a16('0x25')]({'plain':!![]});_0x5b15eb=qs['omit'](_0x5b15eb,['id','createdAt',_0x9a16('0x52')]);_0x312895[_0x9a16('0x53')]=_[_0x9a16('0x54')](_0x312895[_0x9a16('0x53')],['id',_0x9a16('0x55'),_0x9a16('0x52')]);return db[_0x9a16('0x42')][_0x9a16('0x49')](_['merge'](_0x5b15eb,_0x312895[_0x9a16('0x53')]),{'include':_0x312895['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x50a3c7){var _0x4de5af=_0x312895['user'][_0x9a16('0x25')]({'plain':!![]});if(!_0x4de5af)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4de5af[_0x9a16('0x4b')]===_0x9a16('0x4c')){var _0x3fa395=_0x50a3c7[_0x9a16('0x25')]({'plain':!![]});var _0x8eb4b7=_0x9a16('0x4d');return db[_0x9a16('0x4e')]['find']({'where':{'name':_0x8eb4b7,'userProfileId':_0x4de5af[_0x9a16('0x4f')]},'raw':!![]})[_0x9a16('0x24')](function(_0x1130c3){if(_0x1130c3&&_0x1130c3['autoAssociation']===0x0){return db[_0x9a16('0x26')][_0x9a16('0x49')]({'name':_0x3fa395[_0x9a16('0x29')],'resourceId':_0x3fa395['id'],'type':_0x1130c3['name'],'sectionId':_0x1130c3['id']},{})['then'](function(){return _0x50a3c7;});}else{return _0x50a3c7;}})[_0x9a16('0x45')](function(_0x8ee3c6){logger[_0x9a16('0x56')](_0x9a16('0x50'),_0x8ee3c6);throw _0x8ee3c6;});}return _0x50a3c7;});}})['then'](respondWithResult(_0x367ffa,0xc9))['catch'](handleError(_0x367ffa,null));};exports[_0x9a16('0x23')]=function(_0x5ec523,_0x21b422){if(_0x5ec523[_0x9a16('0x53')]['id']){delete _0x5ec523[_0x9a16('0x53')]['id'];}return db[_0x9a16('0x42')][_0x9a16('0x48')]({'where':{'id':_0x5ec523['params']['id']}})[_0x9a16('0x24')](handleEntityNotFound(_0x21b422,null))['then'](saveUpdates(_0x5ec523[_0x9a16('0x53')],null))[_0x9a16('0x24')](respondWithResult(_0x21b422,null))['catch'](handleError(_0x21b422,null));};exports[_0x9a16('0x27')]=function(_0x2e78cd,_0x4a9b9e){return db[_0x9a16('0x42')][_0x9a16('0x48')]({'where':{'id':_0x2e78cd[_0x9a16('0x47')]['id']}})[_0x9a16('0x24')](handleEntityNotFound(_0x4a9b9e,null))['then'](removeEntity(_0x4a9b9e,null))[_0x9a16('0x45')](handleError(_0x4a9b9e,null));};exports[_0x9a16('0x57')]=function(_0x3f67a6,_0x3f3c35,_0x2ff8d4){var _0xc90f56={'raw':!![],'where':{}};var _0x3898b0={};var _0xdc6f8a={'count':0x0,'rows':[]};return db[_0x9a16('0x42')][_0x9a16('0x58')]({'where':{'id':_0x3f67a6[_0x9a16('0x47')]['id']}})[_0x9a16('0x24')](handleEntityNotFound(_0x3f3c35,null))[_0x9a16('0x24')](function(_0x556928){if(_0x556928){_0x3898b0[_0x9a16('0x2d')]=_[_0x9a16('0x30')](db[_0x9a16('0x59')]['rawAttributes']);_0x3898b0['query']=_['keys'](_0x3f67a6['query']);_0x3898b0[_0x9a16('0x31')]=_[_0x9a16('0x32')](_0x3898b0[_0x9a16('0x2d')],_0x3898b0[_0x9a16('0x2f')]);_0xc90f56[_0x9a16('0x33')]=_[_0x9a16('0x32')](_0x3898b0[_0x9a16('0x2d')],qs[_0x9a16('0x34')](_0x3f67a6['query'][_0x9a16('0x34')]));_0xc90f56[_0x9a16('0x33')]=_0xc90f56[_0x9a16('0x33')][_0x9a16('0x35')]?_0xc90f56[_0x9a16('0x33')]:_0x3898b0['model'];if(!_0x3f67a6['query'][_0x9a16('0x36')](_0x9a16('0x37'))){_0xc90f56[_0x9a16('0x1d')]=qs[_0x9a16('0x1d')](_0x3f67a6[_0x9a16('0x2f')][_0x9a16('0x1d')]);_0xc90f56['offset']=qs[_0x9a16('0x1b')](_0x3f67a6[_0x9a16('0x2f')][_0x9a16('0x1b')]);}_0xc90f56[_0x9a16('0x38')]=qs[_0x9a16('0x39')](_0x3f67a6[_0x9a16('0x2f')]['sort']);_0xc90f56[_0x9a16('0x3a')]=qs[_0x9a16('0x31')](_[_0x9a16('0x3b')](_0x3f67a6['query'],_0x3898b0[_0x9a16('0x31')]));_0xc90f56[_0x9a16('0x3a')][_0x9a16('0x5a')]=_0x556928['id'];if(_0x3f67a6[_0x9a16('0x2f')][_0x9a16('0x3c')]){_0xc90f56[_0x9a16('0x3a')]=_[_0x9a16('0x3e')](_0xc90f56[_0x9a16('0x3a')],{'$or':_['map'](_0xc90f56['attributes'],function(_0x1b91fc){var _0x5f088e={};_0x5f088e[_0x1b91fc]={'$like':'%'+_0x3f67a6['query'][_0x9a16('0x3c')]+'%'};return _0x5f088e;})});}_0xc90f56=_[_0x9a16('0x3e')]({},_0xc90f56,_0x3f67a6[_0x9a16('0x3f')]);return db[_0x9a16('0x59')][_0x9a16('0x1e')]({'where':_0xc90f56['where']})[_0x9a16('0x24')](function(_0x230f25){_0xdc6f8a[_0x9a16('0x1e')]=_0x230f25;if(_0x3f67a6[_0x9a16('0x2f')]['includeAll']){_0xc90f56[_0x9a16('0x41')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0xc90f56);})['then'](function(_0x485a6c){_0xdc6f8a[_0x9a16('0x44')]=_0x485a6c;return _0xdc6f8a;});}})[_0x9a16('0x24')](respondWithFilteredResult(_0x3f3c35,_0xc90f56))[_0x9a16('0x45')](handleError(_0x3f3c35,null));};exports[_0x9a16('0x5b')]=function(_0x5b21e8,_0x5e58c7,_0x4c01df){var _0x35bb1e={'raw':!![],'where':{}};var _0x289262={};var _0x3cc496={'count':0x0,'rows':[]};return db[_0x9a16('0x42')][_0x9a16('0x58')]({'where':{'id':_0x5b21e8[_0x9a16('0x47')]['id']}})[_0x9a16('0x24')](handleEntityNotFound(_0x5e58c7,null))[_0x9a16('0x24')](function(_0x3d0de0){if(_0x3d0de0){_0x289262[_0x9a16('0x2d')]=_[_0x9a16('0x30')](db[_0x9a16('0x5c')][_0x9a16('0x2b')]);_0x289262[_0x9a16('0x2f')]=_['keys'](_0x5b21e8['query']);_0x289262[_0x9a16('0x31')]=_[_0x9a16('0x32')](_0x289262[_0x9a16('0x2d')],_0x289262['query']);_0x35bb1e['attributes']=_[_0x9a16('0x32')](_0x289262['model'],qs[_0x9a16('0x34')](_0x5b21e8[_0x9a16('0x2f')][_0x9a16('0x34')]));_0x35bb1e[_0x9a16('0x33')]=_0x35bb1e['attributes'][_0x9a16('0x35')]?_0x35bb1e[_0x9a16('0x33')]:_0x289262[_0x9a16('0x2d')];if(!_0x5b21e8[_0x9a16('0x2f')][_0x9a16('0x36')](_0x9a16('0x37'))){_0x35bb1e['limit']=qs[_0x9a16('0x1d')](_0x5b21e8['query'][_0x9a16('0x1d')]);_0x35bb1e['offset']=qs[_0x9a16('0x1b')](_0x5b21e8['query'][_0x9a16('0x1b')]);}_0x35bb1e[_0x9a16('0x38')]=qs[_0x9a16('0x39')](_0x5b21e8[_0x9a16('0x2f')]['sort']);_0x35bb1e['where']=qs[_0x9a16('0x31')](_['pick'](_0x5b21e8['query'],_0x289262[_0x9a16('0x31')]));_0x35bb1e[_0x9a16('0x3a')][_0x9a16('0x5a')]=_0x3d0de0['id'];if(_0x5b21e8[_0x9a16('0x2f')][_0x9a16('0x3c')]){_0x35bb1e['where']=_[_0x9a16('0x3e')](_0x35bb1e[_0x9a16('0x3a')],{'$or':_[_0x9a16('0x2e')](_0x35bb1e[_0x9a16('0x33')],function(_0x3bb9bf){var _0xbaf780={};_0xbaf780[_0x3bb9bf]={'$like':'%'+_0x5b21e8[_0x9a16('0x2f')][_0x9a16('0x3c')]+'%'};return _0xbaf780;})});}_0x35bb1e=_['merge']({},_0x35bb1e,_0x5b21e8[_0x9a16('0x3f')]);return db[_0x9a16('0x5c')][_0x9a16('0x1e')]({'where':_0x35bb1e['where']})['then'](function(_0x15b936){_0x3cc496['count']=_0x15b936;if(_0x5b21e8[_0x9a16('0x2f')]['includeAll']){_0x35bb1e[_0x9a16('0x41')]=[{'all':!![]}];}return db[_0x9a16('0x5c')][_0x9a16('0x43')](_0x35bb1e);})['then'](function(_0x14ff36){_0x3cc496[_0x9a16('0x44')]=_0x14ff36;return _0x3cc496;});}})['then'](respondWithFilteredResult(_0x5e58c7,_0x35bb1e))[_0x9a16('0x45')](handleError(_0x5e58c7,null));};exports[_0x9a16('0x5d')]=function(_0x52442a,_0x4d8d8e,_0x173fe0){var _0xe6a16c={'raw':!![],'where':{}};var _0x493e66={};var _0x185cd8={'count':0x0,'rows':[]};return db[_0x9a16('0x42')][_0x9a16('0x58')]({'where':{'id':_0x52442a[_0x9a16('0x47')]['id']}})[_0x9a16('0x24')](handleEntityNotFound(_0x4d8d8e,null))[_0x9a16('0x24')](function(_0x44984a){if(_0x44984a){_0x493e66[_0x9a16('0x2d')]=_['keys'](db[_0x9a16('0x5e')]['rawAttributes']);_0x493e66[_0x9a16('0x2f')]=_[_0x9a16('0x30')](_0x52442a['query']);_0x493e66[_0x9a16('0x31')]=_[_0x9a16('0x32')](_0x493e66[_0x9a16('0x2d')],_0x493e66[_0x9a16('0x2f')]);_0xe6a16c[_0x9a16('0x33')]=_['intersection'](_0x493e66['model'],qs['fields'](_0x52442a['query'][_0x9a16('0x34')]));_0xe6a16c[_0x9a16('0x33')]=_0xe6a16c[_0x9a16('0x33')][_0x9a16('0x35')]?_0xe6a16c[_0x9a16('0x33')]:_0x493e66[_0x9a16('0x2d')];if(!_0x52442a['query'][_0x9a16('0x36')]('nolimit')){_0xe6a16c[_0x9a16('0x1d')]=qs['limit'](_0x52442a[_0x9a16('0x2f')][_0x9a16('0x1d')]);_0xe6a16c[_0x9a16('0x1b')]=qs[_0x9a16('0x1b')](_0x52442a[_0x9a16('0x2f')][_0x9a16('0x1b')]);}_0xe6a16c[_0x9a16('0x38')]=qs[_0x9a16('0x39')](_0x52442a['query']['sort']);_0xe6a16c['where']=qs[_0x9a16('0x31')](_[_0x9a16('0x3b')](_0x52442a[_0x9a16('0x2f')],_0x493e66[_0x9a16('0x31')]));_0xe6a16c['where']['CampaignId']=_0x44984a['id'];if(_0x52442a[_0x9a16('0x2f')][_0x9a16('0x3c')]){_0xe6a16c[_0x9a16('0x3a')]=_[_0x9a16('0x3e')](_0xe6a16c[_0x9a16('0x3a')],{'$or':_[_0x9a16('0x2e')](_0xe6a16c[_0x9a16('0x33')],function(_0x1762a5){var _0x2edad0={};_0x2edad0[_0x1762a5]={'$like':'%'+_0x52442a[_0x9a16('0x2f')]['filter']+'%'};return _0x2edad0;})});}_0xe6a16c=_[_0x9a16('0x3e')]({},_0xe6a16c,_0x52442a[_0x9a16('0x3f')]);return db[_0x9a16('0x5e')]['count']({'where':_0xe6a16c['where']})[_0x9a16('0x24')](function(_0x32e50c){_0x185cd8[_0x9a16('0x1e')]=_0x32e50c;if(_0x52442a[_0x9a16('0x2f')][_0x9a16('0x40')]){_0xe6a16c['include']=[{'all':!![]}];}return db[_0x9a16('0x5e')][_0x9a16('0x43')](_0xe6a16c);})[_0x9a16('0x24')](function(_0x1d7d55){_0x185cd8[_0x9a16('0x44')]=_0x1d7d55;return _0x185cd8;});}})[_0x9a16('0x24')](respondWithFilteredResult(_0x4d8d8e,_0xe6a16c))[_0x9a16('0x45')](handleError(_0x4d8d8e,null));};exports[_0x9a16('0x5f')]=function(_0xeaddea,_0x3c59f9,_0x3e3dae){var _0x5d3899={'raw':!![],'where':{}};var _0x147753={};var _0x84a3c={'count':0x0,'rows':[]};return db['Campaign'][_0x9a16('0x58')]({'where':{'id':_0xeaddea[_0x9a16('0x47')]['id']}})[_0x9a16('0x24')](handleEntityNotFound(_0x3c59f9,null))['then'](function(_0x46c526){if(_0x46c526){_0x147753[_0x9a16('0x2d')]=_[_0x9a16('0x30')](db[_0x9a16('0x60')][_0x9a16('0x2b')]);_0x147753[_0x9a16('0x2f')]=_[_0x9a16('0x30')](_0xeaddea[_0x9a16('0x2f')]);_0x147753[_0x9a16('0x31')]=_[_0x9a16('0x32')](_0x147753[_0x9a16('0x2d')],_0x147753[_0x9a16('0x2f')]);_0x5d3899[_0x9a16('0x33')]=_[_0x9a16('0x32')](_0x147753[_0x9a16('0x2d')],qs['fields'](_0xeaddea[_0x9a16('0x2f')]['fields']));_0x5d3899[_0x9a16('0x33')]=_0x5d3899[_0x9a16('0x33')]['length']?_0x5d3899[_0x9a16('0x33')]:_0x147753[_0x9a16('0x2d')];if(!_0xeaddea[_0x9a16('0x2f')][_0x9a16('0x36')](_0x9a16('0x37'))){_0x5d3899[_0x9a16('0x1d')]=qs[_0x9a16('0x1d')](_0xeaddea[_0x9a16('0x2f')][_0x9a16('0x1d')]);_0x5d3899['offset']=qs[_0x9a16('0x1b')](_0xeaddea[_0x9a16('0x2f')][_0x9a16('0x1b')]);}_0x5d3899['order']=qs[_0x9a16('0x39')](_0xeaddea[_0x9a16('0x2f')][_0x9a16('0x39')]);_0x5d3899[_0x9a16('0x3a')]=qs[_0x9a16('0x31')](_[_0x9a16('0x3b')](_0xeaddea['query'],_0x147753[_0x9a16('0x31')]));_0x5d3899[_0x9a16('0x3a')][_0x9a16('0x5a')]=_0x46c526['id'];if(_0xeaddea[_0x9a16('0x2f')]['filter']){_0x5d3899[_0x9a16('0x3a')]=_['merge'](_0x5d3899['where'],{'$or':_[_0x9a16('0x2e')](_0x5d3899[_0x9a16('0x33')],function(_0x4a6352){var _0x93a271={};_0x93a271[_0x4a6352]={'$like':'%'+_0xeaddea['query'][_0x9a16('0x3c')]+'%'};return _0x93a271;})});}_0x5d3899=_['merge']({},_0x5d3899,_0xeaddea['options']);return db[_0x9a16('0x60')][_0x9a16('0x1e')]({'where':_0x5d3899[_0x9a16('0x3a')]})[_0x9a16('0x24')](function(_0x402f7d){_0x84a3c[_0x9a16('0x1e')]=_0x402f7d;if(_0xeaddea[_0x9a16('0x2f')][_0x9a16('0x40')]){_0x5d3899['include']=[{'all':!![]}];}return db[_0x9a16('0x60')][_0x9a16('0x43')](_0x5d3899);})[_0x9a16('0x24')](function(_0x5100f2){_0x84a3c['rows']=_0x5100f2;return _0x84a3c;});}})[_0x9a16('0x24')](respondWithFilteredResult(_0x3c59f9,_0x5d3899))[_0x9a16('0x45')](handleError(_0x3c59f9,null));};exports[_0x9a16('0x61')]=function(_0x195a29,_0x49cebf,_0x141949){var _0x22e5d1={};var _0x159891={};var _0x592669;var _0xdaf8ad;return db[_0x9a16('0x42')]['findOne']({'where':{'id':_0x195a29['params']['id']}})['then'](handleEntityNotFound(_0x49cebf,null))[_0x9a16('0x24')](function(_0xf0eaa9){if(_0xf0eaa9){_0x592669=_0xf0eaa9;_0x159891[_0x9a16('0x2d')]=_[_0x9a16('0x30')](db['CmList']['rawAttributes']);_0x159891[_0x9a16('0x2f')]=_[_0x9a16('0x30')](_0x195a29[_0x9a16('0x2f')]);_0x159891[_0x9a16('0x31')]=_[_0x9a16('0x32')](_0x159891[_0x9a16('0x2d')],_0x159891['query']);_0x22e5d1['attributes']=_[_0x9a16('0x32')](_0x159891[_0x9a16('0x2d')],qs[_0x9a16('0x34')](_0x195a29['query']['fields']));_0x22e5d1[_0x9a16('0x33')]=_0x22e5d1[_0x9a16('0x33')][_0x9a16('0x35')]?_0x22e5d1[_0x9a16('0x33')]:_0x159891['model'];_0x22e5d1[_0x9a16('0x38')]=qs[_0x9a16('0x39')](_0x195a29[_0x9a16('0x2f')][_0x9a16('0x39')]);_0x22e5d1['where']=qs[_0x9a16('0x31')](_['pick'](_0x195a29[_0x9a16('0x2f')],_0x159891[_0x9a16('0x31')]));if(_0x195a29[_0x9a16('0x2f')][_0x9a16('0x3c')]){_0x22e5d1[_0x9a16('0x3a')]=_[_0x9a16('0x3e')](_0x22e5d1['where'],{'$or':_[_0x9a16('0x2e')](_0x22e5d1[_0x9a16('0x33')],function(_0x260ba1){var _0x39127a={};_0x39127a[_0x260ba1]={'$like':'%'+_0x195a29[_0x9a16('0x2f')][_0x9a16('0x3c')]+'%'};return _0x39127a;})});}_0x22e5d1=_[_0x9a16('0x3e')]({},_0x22e5d1,_0x195a29[_0x9a16('0x3f')]);return _0x592669[_0x9a16('0x61')](_0x22e5d1);}})['then'](function(_0x284c15){if(_0x284c15){_0xdaf8ad=_0x284c15['length'];if(!_0x195a29[_0x9a16('0x2f')]['hasOwnProperty']('nolimit')){_0x22e5d1['limit']=qs[_0x9a16('0x1d')](_0x195a29[_0x9a16('0x2f')]['limit']);_0x22e5d1['offset']=qs[_0x9a16('0x1b')](_0x195a29[_0x9a16('0x2f')][_0x9a16('0x1b')]);}return _0x592669[_0x9a16('0x61')](_0x22e5d1);}})['then'](function(_0x2a8d2d){if(_0x2a8d2d){return _0x2a8d2d?{'count':_0xdaf8ad,'rows':_0x2a8d2d}:null;}})['then'](respondWithResult(_0x49cebf,null))['catch'](handleError(_0x49cebf,null));};exports[_0x9a16('0x62')]=function(_0x559581,_0x5b332b,_0x4be2e5){var _0x370523,_0x3af669;return db[_0x9a16('0x42')][_0x9a16('0x48')]({'where':{'id':_0x559581[_0x9a16('0x47')]['id']}})[_0x9a16('0x24')](handleEntityNotFound(_0x5b332b,null))[_0x9a16('0x24')](function(_0xba1c55){if(_0xba1c55){_0x3af669=_0xba1c55;return _0xba1c55[_0x9a16('0x62')](_0x559581[_0x9a16('0x53')]['ids'],_['omit'](_0x559581[_0x9a16('0x53')],[_0x9a16('0x63'),'id'])||{});}return null;})['spread'](function(_0x5eddb3){var _0x428a0e;_0x370523=_0x5eddb3||[];var _0x342278=[];if(_0x5eddb3){for(var _0x3fe33a=0x0;_0x3fe33a<_0x5eddb3[_0x9a16('0x35')];_0x3fe33a+=0x1){var _0xbfae=_0x5eddb3[_0x3fe33a][_0x9a16('0x25')]({'plain':!![]});_0x3af669['dialCheckDuplicateType']=_0x559581[_0x9a16('0x53')][_0x9a16('0x64')]?_0x559581[_0x9a16('0x53')][_0x9a16('0x64')]:_0x3af669[_0x9a16('0x64')];switch(_0x3af669[_0x9a16('0x64')]){case _0x9a16('0x65'):_0x428a0e=squel[_0x9a16('0x66')]()[_0x9a16('0x67')](_0x9a16('0x68'))[_0x9a16('0x69')]([_0x9a16('0x6a'),_0x9a16('0x6b'),_0x9a16('0x6c'),'ListId',_0x9a16('0x5a'),_0x9a16('0x55'),_0x9a16('0x52')],squel['select']()[_0x9a16('0x6d')]('phone','phone')[_0x9a16('0x6d')](_0x9a16('0x6e'),_0x9a16('0x6b'))[_0x9a16('0x6d')]('id','ContactId')[_0x9a16('0x6d')](_0xbfae['CmListId'][_0x9a16('0x6f')](),_0x9a16('0x70'))[_0x9a16('0x6d')](_0x559581['params']['id']['toString'](),_0x9a16('0x5a'))['field'](_0x9a16('0x6e'),_0x9a16('0x55'))[_0x9a16('0x6d')](_0x9a16('0x6e'),_0x9a16('0x52'))[_0x9a16('0x71')]('cm_contacts')[_0x9a16('0x3a')](_0x9a16('0x72'))[_0x9a16('0x3a')](_0x9a16('0x73'),_0xbfae[_0x9a16('0x74')]['toString']())['where'](_0x9a16('0x75'))[_0x9a16('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9a16('0x76')]()[_0x9a16('0x6d')](_0x9a16('0x77'))[_0x9a16('0x71')](_0x9a16('0x78'))[_0x9a16('0x3a')](_0x9a16('0x79'),_0x559581[_0x9a16('0x47')]['id'][_0x9a16('0x6f')]()))[_0x9a16('0x3a')](_0x9a16('0x7a'),squel[_0x9a16('0x76')]()[_0x9a16('0x6d')](_0x9a16('0x7b'))[_0x9a16('0x71')]('cm_hopper')['where'](_0x9a16('0x79'),_0x559581[_0x9a16('0x47')]['id'][_0x9a16('0x6f')]())))[_0x9a16('0x6f')]();break;case _0x9a16('0x7c'):_0x428a0e=squel[_0x9a16('0x66')]()['into']('cm_hopper')[_0x9a16('0x69')](['phone',_0x9a16('0x6b'),'ContactId',_0x9a16('0x70'),_0x9a16('0x5a'),_0x9a16('0x55'),_0x9a16('0x52')],squel[_0x9a16('0x76')]()[_0x9a16('0x6d')](_0x9a16('0x6a'),_0x9a16('0x6a'))['field'](_0x9a16('0x6e'),_0x9a16('0x6b'))[_0x9a16('0x6d')]('id',_0x9a16('0x6c'))[_0x9a16('0x6d')](_0xbfae[_0x9a16('0x74')][_0x9a16('0x6f')](),_0x9a16('0x70'))[_0x9a16('0x6d')](_0x559581['params']['id']['toString'](),'CampaignId')[_0x9a16('0x6d')](_0x9a16('0x6e'),_0x9a16('0x55'))[_0x9a16('0x6d')]('NOW()',_0x9a16('0x52'))['from']('cm_contacts')['where'](_0x9a16('0x72'))[_0x9a16('0x3a')](_0x9a16('0x73'),_0xbfae[_0x9a16('0x74')][_0x9a16('0x6f')]())[_0x9a16('0x3a')](_0x9a16('0x75'))[_0x9a16('0x3a')](_0x9a16('0x7a'),squel['select']()[_0x9a16('0x6d')](_0x9a16('0x7b'))[_0x9a16('0x71')](_0x9a16('0x68'))[_0x9a16('0x3a')](_0x9a16('0x79'),_0x559581[_0x9a16('0x47')]['id'][_0x9a16('0x6f')]())))[_0x9a16('0x6f')]();break;default:_0x428a0e=squel[_0x9a16('0x66')]()[_0x9a16('0x67')](_0x9a16('0x68'))['fromQuery'](['phone',_0x9a16('0x6b'),_0x9a16('0x6c'),_0x9a16('0x70'),_0x9a16('0x5a'),'createdAt',_0x9a16('0x52')],squel[_0x9a16('0x76')]()[_0x9a16('0x6d')](_0x9a16('0x6a'),_0x9a16('0x6a'))[_0x9a16('0x6d')](_0x9a16('0x6e'),_0x9a16('0x6b'))[_0x9a16('0x6d')]('id',_0x9a16('0x6c'))[_0x9a16('0x6d')](_0xbfae[_0x9a16('0x74')][_0x9a16('0x6f')](),'ListId')['field'](_0x559581['params']['id']['toString'](),'CampaignId')['field'](_0x9a16('0x6e'),_0x9a16('0x55'))[_0x9a16('0x6d')](_0x9a16('0x6e'),_0x9a16('0x52'))[_0x9a16('0x71')](_0x9a16('0x7d'))[_0x9a16('0x3a')]('deletedAt\x20IS\x20NULL')['where'](_0x9a16('0x73'),_0xbfae[_0x9a16('0x74')][_0x9a16('0x6f')]())[_0x9a16('0x3a')](_0x9a16('0x75')))['toString']();}_0x342278[_0x9a16('0x7e')](db['sequelize'][_0x9a16('0x2f')](_0x428a0e));}return BPromise[_0x9a16('0x7f')](_0x342278);}})[_0x9a16('0x24')](function(){return _0x370523;})[_0x9a16('0x24')](respondWithResult(_0x5b332b,null))[_0x9a16('0x45')](handleError(_0x5b332b,null));};exports[_0x9a16('0x80')]=function(_0x40a0e2,_0x199255,_0xb8fc2d){return db[_0x9a16('0x42')][_0x9a16('0x48')]({'where':{'id':_0x40a0e2[_0x9a16('0x47')]['id']}})[_0x9a16('0x24')](handleEntityNotFound(_0x199255,null))[_0x9a16('0x24')](function(_0x21d101){if(_0x21d101){return _0x21d101['removeLists'](_0x40a0e2[_0x9a16('0x2f')][_0x9a16('0x63')]);}})['then'](function(_0x9a6a1a){if(_0x9a6a1a){return db[_0x9a16('0x59')]['destroy']({'where':{'ListId':_0x40a0e2[_0x9a16('0x2f')][_0x9a16('0x63')],'CampaignId':_0x40a0e2['params']['id']}})['then'](function(){return _0x9a6a1a;});}})[_0x9a16('0x24')](respondWithStatusCode(_0x199255,null))[_0x9a16('0x45')](handleError(_0x199255,null));};exports['getBlackLists']=function(_0x318553,_0x23e42f,_0xb5a6d3){var _0x29d474={};var _0x4db13e={};var _0x26c437;var _0x1a7e4c;return db[_0x9a16('0x42')][_0x9a16('0x58')]({'where':{'id':_0x318553[_0x9a16('0x47')]['id']}})[_0x9a16('0x24')](handleEntityNotFound(_0x23e42f,null))[_0x9a16('0x24')](function(_0x3e800a){if(_0x3e800a){_0x26c437=_0x3e800a;_0x4db13e[_0x9a16('0x2d')]=_[_0x9a16('0x30')](db['CmList'][_0x9a16('0x2b')]);_0x4db13e[_0x9a16('0x2f')]=_[_0x9a16('0x30')](_0x318553['query']);_0x4db13e[_0x9a16('0x31')]=_['intersection'](_0x4db13e[_0x9a16('0x2d')],_0x4db13e[_0x9a16('0x2f')]);_0x29d474[_0x9a16('0x33')]=_['intersection'](_0x4db13e[_0x9a16('0x2d')],qs['fields'](_0x318553[_0x9a16('0x2f')][_0x9a16('0x34')]));_0x29d474[_0x9a16('0x33')]=_0x29d474['attributes'][_0x9a16('0x35')]?_0x29d474[_0x9a16('0x33')]:_0x4db13e[_0x9a16('0x2d')];_0x29d474[_0x9a16('0x38')]=qs[_0x9a16('0x39')](_0x318553[_0x9a16('0x2f')][_0x9a16('0x39')]);_0x29d474[_0x9a16('0x3a')]=qs['filters'](_['pick'](_0x318553[_0x9a16('0x2f')],_0x4db13e[_0x9a16('0x31')]));if(_0x318553[_0x9a16('0x2f')][_0x9a16('0x3c')]){_0x29d474[_0x9a16('0x3a')]=_[_0x9a16('0x3e')](_0x29d474[_0x9a16('0x3a')],{'$or':_[_0x9a16('0x2e')](_0x29d474[_0x9a16('0x33')],function(_0x3f77b2){var _0x2c23d2={};_0x2c23d2[_0x3f77b2]={'$like':'%'+_0x318553[_0x9a16('0x2f')][_0x9a16('0x3c')]+'%'};return _0x2c23d2;})});}_0x29d474=_[_0x9a16('0x3e')]({},_0x29d474,_0x318553['options']);return _0x26c437[_0x9a16('0x81')](_0x29d474);}})[_0x9a16('0x24')](function(_0x18d16d){if(_0x18d16d){_0x1a7e4c=_0x18d16d[_0x9a16('0x35')];if(!_0x318553[_0x9a16('0x2f')][_0x9a16('0x36')]('nolimit')){_0x29d474[_0x9a16('0x1d')]=qs[_0x9a16('0x1d')](_0x318553[_0x9a16('0x2f')][_0x9a16('0x1d')]);_0x29d474[_0x9a16('0x1b')]=qs[_0x9a16('0x1b')](_0x318553['query'][_0x9a16('0x1b')]);}return _0x26c437[_0x9a16('0x81')](_0x29d474);}})[_0x9a16('0x24')](function(_0x4aa7a5){if(_0x4aa7a5){return _0x4aa7a5?{'count':_0x1a7e4c,'rows':_0x4aa7a5}:null;}})[_0x9a16('0x24')](respondWithResult(_0x23e42f,null))[_0x9a16('0x45')](handleError(_0x23e42f,null));};exports[_0x9a16('0x82')]=function(_0x442c2a,_0x577692,_0x3e8c12){var _0xcd787,_0x6a5bff;return db[_0x9a16('0x42')][_0x9a16('0x48')]({'where':{'id':_0x442c2a['params']['id']}})['then'](handleEntityNotFound(_0x577692,null))['then'](function(_0xbb1d3b){if(_0xbb1d3b){_0x6a5bff=_0xbb1d3b;return _0xbb1d3b[_0x9a16('0x82')](_0x442c2a[_0x9a16('0x53')][_0x9a16('0x63')],_[_0x9a16('0x54')](_0x442c2a[_0x9a16('0x53')],[_0x9a16('0x63'),'id'])||{});}return null;})[_0x9a16('0x83')](function(_0x4817be){var _0x64f946;_0xcd787=_0x4817be||[];var _0x20777a=[];if(_0x4817be){for(var _0x5a553b=0x0;_0x5a553b<_0x4817be[_0x9a16('0x35')];_0x5a553b+=0x1){var _0xe45c1e=_0x4817be[_0x5a553b][_0x9a16('0x25')]({'plain':!![]});_0x64f946=squel[_0x9a16('0x66')]()[_0x9a16('0x67')](_0x9a16('0x84'))[_0x9a16('0x69')]([_0x9a16('0x6a'),_0x9a16('0x6c'),_0x9a16('0x70'),'CampaignId',_0x9a16('0x55'),'updatedAt'],squel['select']()[_0x9a16('0x6d')](_0x9a16('0x6a'),_0x9a16('0x6a'))[_0x9a16('0x6d')]('id',_0x9a16('0x6c'))['field'](_0xe45c1e['CmListId']['toString'](),_0x9a16('0x70'))['field'](_0x442c2a['params']['id'][_0x9a16('0x6f')](),_0x9a16('0x5a'))[_0x9a16('0x6d')](_0x9a16('0x6e'),_0x9a16('0x55'))['field'](_0x9a16('0x6e'),'updatedAt')['from']('cm_contacts')[_0x9a16('0x3a')]('deletedAt\x20IS\x20NULL')['where'](_0x9a16('0x73'),_0xe45c1e[_0x9a16('0x74')]['toString']())[_0x9a16('0x3a')](_0x9a16('0x75')))[_0x9a16('0x6f')]();_0x20777a['push'](db[_0x9a16('0x85')]['query'](_0x64f946));}return BPromise['all'](_0x20777a);}})['then'](function(){return _0xcd787;})[_0x9a16('0x24')](respondWithResult(_0x577692,null))['catch'](handleError(_0x577692,null));};exports['removeBlackLists']=function(_0x171a01,_0x12b247,_0x30f28e){return db[_0x9a16('0x42')][_0x9a16('0x48')]({'where':{'id':_0x171a01[_0x9a16('0x47')]['id']}})['then'](handleEntityNotFound(_0x12b247,null))[_0x9a16('0x24')](function(_0x3906d4){if(_0x3906d4){return _0x3906d4[_0x9a16('0x86')](_0x171a01[_0x9a16('0x2f')][_0x9a16('0x63')]);}})['then'](function(_0xaac4ab){if(_0xaac4ab){return db[_0x9a16('0x60')][_0x9a16('0x27')]({'where':{'ListId':_0x171a01['query'][_0x9a16('0x63')],'CampaignId':_0x171a01[_0x9a16('0x47')]['id']}})[_0x9a16('0x24')](function(){return _0xaac4ab;});}})[_0x9a16('0x24')](respondWithStatusCode(_0x12b247,null))[_0x9a16('0x45')](handleError(_0x12b247,null));};
\ No newline at end of file
+var _0x9cdd=['filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','UserProfileSection','getHoppers','CmHopper','hasOwnProperty','findAll','getHopperHistories','CampaignId','CmHopperHistory','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ListId','select','field','NOW()','scheduledAt','ContactId','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','sequelize','all','getBlackLists','addBlackLists','cm_hopper_black','push','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','offset','undefined','limit','count','status','set','json','reject','save','update','then','destroy','get','sendStatus','error','name','index','Campaign','rawAttributes','fieldName','type','key','model','map','query','keys'];(function(_0xc007c,_0x20f0f7){var _0x1942b6=function(_0x56c3a2){while(--_0x56c3a2){_0xc007c['push'](_0xc007c['shift']());}};_0x1942b6(++_0x20f0f7);}(_0x9cdd,0x167));var _0xd9cd=function(_0x327199,_0x1283db){_0x327199=_0x327199-0x0;var _0x5a7cf0=_0x9cdd[_0x327199];return _0x5a7cf0;};'use strict';var emlformat=require(_0xd9cd('0x0'));var rimraf=require(_0xd9cd('0x1'));var zipdir=require(_0xd9cd('0x2'));var jsonpatch=require(_0xd9cd('0x3'));var rp=require(_0xd9cd('0x4'));var moment=require(_0xd9cd('0x5'));var BPromise=require(_0xd9cd('0x6'));var Mustache=require(_0xd9cd('0x7'));var util=require(_0xd9cd('0x8'));var path=require('path');var sox=require(_0xd9cd('0x9'));var csv=require(_0xd9cd('0xa'));var ejs=require(_0xd9cd('0xb'));var fs=require('fs');var fs_extra=require(_0xd9cd('0xc'));var _=require(_0xd9cd('0xd'));var squel=require(_0xd9cd('0xe'));var crypto=require(_0xd9cd('0xf'));var jsforce=require(_0xd9cd('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd9cd('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd9cd('0x12'));var as=require(_0xd9cd('0x13'));var hardwareService=require(_0xd9cd('0x14'));var logger=require('../../config/logger')(_0xd9cd('0x15'));var utils=require(_0xd9cd('0x16'));var config=require(_0xd9cd('0x17'));var licenseUtil=require(_0xd9cd('0x18'));var db=require(_0xd9cd('0x19'))['db'];function respondWithStatusCode(_0x4f88a5,_0x3fbbb9){_0x3fbbb9=_0x3fbbb9||0xcc;return function(_0x283691){if(_0x283691){return _0x4f88a5['sendStatus'](_0x3fbbb9);}return _0x4f88a5['status'](_0x3fbbb9)['end']();};}function respondWithResult(_0x1204fe,_0x5e378f){_0x5e378f=_0x5e378f||0xc8;return function(_0x4934a5){if(_0x4934a5){return _0x1204fe['status'](_0x5e378f)['json'](_0x4934a5);}};}function respondWithFilteredResult(_0x55ae65,_0x591c9b){return function(_0x444172){if(_0x444172){var _0x3bc7f0=typeof _0x591c9b[_0xd9cd('0x1a')]===_0xd9cd('0x1b')&&typeof _0x591c9b[_0xd9cd('0x1c')]===_0xd9cd('0x1b');var _0x505309=_0x444172[_0xd9cd('0x1d')];var _0x455170=_0x3bc7f0?0x0:_0x591c9b[_0xd9cd('0x1a')];var _0x5f3d4e=_0x3bc7f0?_0x444172[_0xd9cd('0x1d')]:_0x591c9b['offset']+_0x591c9b[_0xd9cd('0x1c')];var _0x3c70ef;if(_0x5f3d4e>=_0x505309){_0x5f3d4e=_0x505309;_0x3c70ef=0xc8;}else{_0x3c70ef=0xce;}_0x55ae65[_0xd9cd('0x1e')](_0x3c70ef);return _0x55ae65[_0xd9cd('0x1f')]('Content-Range',_0x455170+'-'+_0x5f3d4e+'/'+_0x505309)[_0xd9cd('0x20')](_0x444172);}return null;};}function patchUpdates(_0x287bc9){return function(_0x120912){try{jsonpatch['apply'](_0x120912,_0x287bc9,!![]);}catch(_0x2f6942){return BPromise[_0xd9cd('0x21')](_0x2f6942);}return _0x120912[_0xd9cd('0x22')]();};}function saveUpdates(_0x3fa6b2,_0x4a4012){return function(_0x5506ad){if(_0x5506ad){return _0x5506ad[_0xd9cd('0x23')](_0x3fa6b2)[_0xd9cd('0x24')](function(_0x59a4df){return _0x59a4df;});}return null;};}function removeEntity(_0xe8c303,_0x3f5b0f){return function(_0x3459b6){if(_0x3459b6){return _0x3459b6[_0xd9cd('0x25')]()[_0xd9cd('0x24')](function(){var _0x269cd4=_0x3459b6[_0xd9cd('0x26')]({'plain':!![]});var _0x211359='IvrCampaigns';return db['UserProfileResource'][_0xd9cd('0x25')]({'where':{'type':_0x211359,'resourceId':_0x269cd4['id']}})[_0xd9cd('0x24')](function(){return _0x3459b6;});})[_0xd9cd('0x24')](function(){_0xe8c303[_0xd9cd('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d73d6,_0x2d7c08){return function(_0x520a72){if(!_0x520a72){_0x4d73d6[_0xd9cd('0x27')](0x194);}return _0x520a72;};}function handleError(_0x50107f,_0x1371e5){_0x1371e5=_0x1371e5||0x1f4;return function(_0x55d3f5){logger[_0xd9cd('0x28')](_0x55d3f5['stack']);if(_0x55d3f5[_0xd9cd('0x29')]){delete _0x55d3f5[_0xd9cd('0x29')];}_0x50107f[_0xd9cd('0x1e')](_0x1371e5)['send'](_0x55d3f5);};}exports[_0xd9cd('0x2a')]=function(_0x33a452,_0x599b68){var _0x5cb100={},_0x43bfe3={},_0x7f6535={'count':0x0,'rows':[]};var _0xceeabf=_['map'](db[_0xd9cd('0x2b')][_0xd9cd('0x2c')],function(_0x316f96){return{'name':_0x316f96[_0xd9cd('0x2d')],'type':_0x316f96[_0xd9cd('0x2e')][_0xd9cd('0x2f')]};});_0x43bfe3[_0xd9cd('0x30')]=_[_0xd9cd('0x31')](_0xceeabf,_0xd9cd('0x29'));_0x43bfe3[_0xd9cd('0x32')]=_[_0xd9cd('0x33')](_0x33a452[_0xd9cd('0x32')]);_0x43bfe3[_0xd9cd('0x34')]=_[_0xd9cd('0x35')](_0x43bfe3[_0xd9cd('0x30')],_0x43bfe3['query']);_0x5cb100[_0xd9cd('0x36')]=_[_0xd9cd('0x35')](_0x43bfe3[_0xd9cd('0x30')],qs[_0xd9cd('0x37')](_0x33a452['query'][_0xd9cd('0x37')]));_0x5cb100['attributes']=_0x5cb100['attributes'][_0xd9cd('0x38')]?_0x5cb100[_0xd9cd('0x36')]:_0x43bfe3[_0xd9cd('0x30')];if(!_0x33a452[_0xd9cd('0x32')]['hasOwnProperty'](_0xd9cd('0x39'))){_0x5cb100[_0xd9cd('0x1c')]=qs[_0xd9cd('0x1c')](_0x33a452[_0xd9cd('0x32')]['limit']);_0x5cb100['offset']=qs[_0xd9cd('0x1a')](_0x33a452['query'][_0xd9cd('0x1a')]);}_0x5cb100[_0xd9cd('0x3a')]=qs[_0xd9cd('0x3b')](_0x33a452[_0xd9cd('0x32')][_0xd9cd('0x3b')]);_0x5cb100[_0xd9cd('0x3c')]=qs[_0xd9cd('0x34')](_[_0xd9cd('0x3d')](_0x33a452['query'],_0x43bfe3[_0xd9cd('0x34')]),_0xceeabf);if(_0x33a452[_0xd9cd('0x32')]['filter']){_0x5cb100[_0xd9cd('0x3c')]=_[_0xd9cd('0x3e')](_0x5cb100[_0xd9cd('0x3c')],{'$or':_[_0xd9cd('0x31')](_0xceeabf,function(_0x316c4e){if(_0x316c4e[_0xd9cd('0x2e')]!==_0xd9cd('0x3f')){var _0x2ce6ad={};_0x2ce6ad[_0x316c4e['name']]={'$like':'%'+_0x33a452['query'][_0xd9cd('0x40')]+'%'};return _0x2ce6ad;}})});}_0x5cb100=_[_0xd9cd('0x3e')]({},_0x5cb100,_0x33a452[_0xd9cd('0x41')]);var _0x5f010d={'where':_0x5cb100['where']};return db[_0xd9cd('0x2b')]['count'](_0x5f010d)[_0xd9cd('0x24')](function(_0xc0b5a5){_0x7f6535[_0xd9cd('0x1d')]=_0xc0b5a5;if(_0x33a452[_0xd9cd('0x32')][_0xd9cd('0x42')]){_0x5cb100[_0xd9cd('0x43')]=[{'all':!![]}];}return db[_0xd9cd('0x2b')]['findAll'](_0x5cb100);})[_0xd9cd('0x24')](function(_0x316795){_0x7f6535[_0xd9cd('0x44')]=_0x316795;return _0x7f6535;})[_0xd9cd('0x24')](respondWithFilteredResult(_0x599b68,_0x5cb100))[_0xd9cd('0x45')](handleError(_0x599b68,null));};exports[_0xd9cd('0x46')]=function(_0x1123ff,_0xdb863c){var _0x429154={'raw':![],'where':{'id':_0x1123ff[_0xd9cd('0x47')]['id']}},_0x2ab754={};_0x2ab754[_0xd9cd('0x30')]=_[_0xd9cd('0x33')](db[_0xd9cd('0x2b')][_0xd9cd('0x2c')]);_0x2ab754['query']=_[_0xd9cd('0x33')](_0x1123ff[_0xd9cd('0x32')]);_0x2ab754[_0xd9cd('0x34')]=_[_0xd9cd('0x35')](_0x2ab754[_0xd9cd('0x30')],_0x2ab754['query']);_0x429154[_0xd9cd('0x36')]=_[_0xd9cd('0x35')](_0x2ab754[_0xd9cd('0x30')],qs['fields'](_0x1123ff['query'][_0xd9cd('0x37')]));_0x429154[_0xd9cd('0x36')]=_0x429154[_0xd9cd('0x36')][_0xd9cd('0x38')]?_0x429154[_0xd9cd('0x36')]:_0x2ab754[_0xd9cd('0x30')];if(_0x1123ff[_0xd9cd('0x32')][_0xd9cd('0x42')]){_0x429154[_0xd9cd('0x43')]=[{'all':!![]}];}_0x429154=_['merge']({},_0x429154,_0x1123ff[_0xd9cd('0x41')]);return db[_0xd9cd('0x2b')][_0xd9cd('0x48')](_0x429154)['then'](handleEntityNotFound(_0xdb863c,null))[_0xd9cd('0x24')](respondWithResult(_0xdb863c,null))[_0xd9cd('0x45')](handleError(_0xdb863c,null));};exports[_0xd9cd('0x49')]=function(_0x15470f,_0x4aac35){return db[_0xd9cd('0x2b')]['create'](_0x15470f[_0xd9cd('0x4a')],{})[_0xd9cd('0x24')](function(_0x467c44){var _0x31ab0e=_0x15470f[_0xd9cd('0x4b')][_0xd9cd('0x26')]({'plain':!![]});if(!_0x31ab0e)throw new Error(_0xd9cd('0x4c'));if(_0x31ab0e[_0xd9cd('0x4d')]===_0xd9cd('0x4b')){var _0x1e7354=_0x467c44[_0xd9cd('0x26')]({'plain':!![]});var _0x3aaae5=_0xd9cd('0x4e');return db['UserProfileSection'][_0xd9cd('0x48')]({'where':{'name':_0x3aaae5,'userProfileId':_0x31ab0e[_0xd9cd('0x4f')]},'raw':!![]})[_0xd9cd('0x24')](function(_0x2330fe){if(_0x2330fe&&_0x2330fe[_0xd9cd('0x50')]===0x0){return db[_0xd9cd('0x51')][_0xd9cd('0x49')]({'name':_0x1e7354['name'],'resourceId':_0x1e7354['id'],'type':_0x2330fe[_0xd9cd('0x29')],'sectionId':_0x2330fe['id']},{})['then'](function(){return _0x467c44;});}else{return _0x467c44;}})[_0xd9cd('0x45')](function(_0x2b56d7){logger[_0xd9cd('0x28')](_0xd9cd('0x52'),_0x2b56d7);throw _0x2b56d7;});}return _0x467c44;})[_0xd9cd('0x24')](respondWithResult(_0x4aac35,0xc9))[_0xd9cd('0x45')](handleError(_0x4aac35,null));};exports[_0xd9cd('0x53')]=function(_0x215fe9,_0xc1e37f){var _0x3835fa={'where':{'id':_0x215fe9['params']['id']}},_0x531746={};_0x531746[_0xd9cd('0x30')]=_[_0xd9cd('0x33')](db['Campaign']['rawAttributes']);_0x3835fa[_0xd9cd('0x36')]=_[_0xd9cd('0x35')](_0x531746[_0xd9cd('0x30')],qs[_0xd9cd('0x37')](_0x215fe9['query'][_0xd9cd('0x37')]));_0x3835fa[_0xd9cd('0x36')]=_0x3835fa[_0xd9cd('0x36')]['length']?_0x3835fa[_0xd9cd('0x36')]:_0x531746['model'];if(_0x215fe9['query'][_0xd9cd('0x42')]){_0x3835fa[_0xd9cd('0x43')]=[{'all':!![]}];}_0x3835fa=_[_0xd9cd('0x3e')]({},_0x3835fa,_0x215fe9[_0xd9cd('0x41')]);return db[_0xd9cd('0x2b')][_0xd9cd('0x48')](_0x3835fa)[_0xd9cd('0x24')](handleEntityNotFound(_0xc1e37f,null))[_0xd9cd('0x24')](function(_0x213c55){if(_0x213c55){var _0x225f95=_0x213c55[_0xd9cd('0x26')]({'plain':!![]});_0x225f95=qs['omit'](_0x225f95,['id',_0xd9cd('0x54'),_0xd9cd('0x55')]);_0x215fe9[_0xd9cd('0x4a')]=_[_0xd9cd('0x56')](_0x215fe9[_0xd9cd('0x4a')],['id',_0xd9cd('0x54'),'updatedAt']);return db[_0xd9cd('0x2b')][_0xd9cd('0x49')](_[_0xd9cd('0x3e')](_0x225f95,_0x215fe9[_0xd9cd('0x4a')]),{'include':_0x215fe9[_0xd9cd('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0xd9cd('0x24')](function(_0x5bb55f){var _0xf25617=_0x215fe9['user']['get']({'plain':!![]});if(!_0xf25617)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf25617['role']===_0xd9cd('0x4b')){var _0xd73988=_0x5bb55f[_0xd9cd('0x26')]({'plain':!![]});var _0x5bb5de=_0xd9cd('0x4e');return db[_0xd9cd('0x57')][_0xd9cd('0x48')]({'where':{'name':_0x5bb5de,'userProfileId':_0xf25617[_0xd9cd('0x4f')]},'raw':!![]})[_0xd9cd('0x24')](function(_0x215ab3){if(_0x215ab3&&_0x215ab3['autoAssociation']===0x0){return db[_0xd9cd('0x51')]['create']({'name':_0xd73988['name'],'resourceId':_0xd73988['id'],'type':_0x215ab3['name'],'sectionId':_0x215ab3['id']},{})[_0xd9cd('0x24')](function(){return _0x5bb55f;});}else{return _0x5bb55f;}})['catch'](function(_0x25f17e){logger['error'](_0xd9cd('0x52'),_0x25f17e);throw _0x25f17e;});}return _0x5bb55f;});}})[_0xd9cd('0x24')](respondWithResult(_0xc1e37f,0xc9))[_0xd9cd('0x45')](handleError(_0xc1e37f,null));};exports[_0xd9cd('0x23')]=function(_0x5438ee,_0x300f56){if(_0x5438ee['body']['id']){delete _0x5438ee[_0xd9cd('0x4a')]['id'];}return db[_0xd9cd('0x2b')][_0xd9cd('0x48')]({'where':{'id':_0x5438ee[_0xd9cd('0x47')]['id']}})['then'](handleEntityNotFound(_0x300f56,null))[_0xd9cd('0x24')](saveUpdates(_0x5438ee[_0xd9cd('0x4a')],null))['then'](respondWithResult(_0x300f56,null))['catch'](handleError(_0x300f56,null));};exports[_0xd9cd('0x25')]=function(_0x5d335b,_0x4a0635){return db[_0xd9cd('0x2b')][_0xd9cd('0x48')]({'where':{'id':_0x5d335b['params']['id']}})[_0xd9cd('0x24')](handleEntityNotFound(_0x4a0635,null))[_0xd9cd('0x24')](removeEntity(_0x4a0635,null))['catch'](handleError(_0x4a0635,null));};exports[_0xd9cd('0x58')]=function(_0x1a338b,_0xe406b8,_0x2d2125){var _0x2ebf56={'raw':!![],'where':{}};var _0x4c036a={};var _0x395b64={'count':0x0,'rows':[]};return db[_0xd9cd('0x2b')]['findOne']({'where':{'id':_0x1a338b[_0xd9cd('0x47')]['id']}})[_0xd9cd('0x24')](handleEntityNotFound(_0xe406b8,null))[_0xd9cd('0x24')](function(_0x12bdd0){if(_0x12bdd0){_0x4c036a['model']=_[_0xd9cd('0x33')](db[_0xd9cd('0x59')]['rawAttributes']);_0x4c036a[_0xd9cd('0x32')]=_[_0xd9cd('0x33')](_0x1a338b['query']);_0x4c036a['filters']=_[_0xd9cd('0x35')](_0x4c036a[_0xd9cd('0x30')],_0x4c036a[_0xd9cd('0x32')]);_0x2ebf56[_0xd9cd('0x36')]=_[_0xd9cd('0x35')](_0x4c036a[_0xd9cd('0x30')],qs['fields'](_0x1a338b[_0xd9cd('0x32')][_0xd9cd('0x37')]));_0x2ebf56[_0xd9cd('0x36')]=_0x2ebf56['attributes'][_0xd9cd('0x38')]?_0x2ebf56[_0xd9cd('0x36')]:_0x4c036a[_0xd9cd('0x30')];if(!_0x1a338b['query'][_0xd9cd('0x5a')](_0xd9cd('0x39'))){_0x2ebf56[_0xd9cd('0x1c')]=qs['limit'](_0x1a338b[_0xd9cd('0x32')][_0xd9cd('0x1c')]);_0x2ebf56['offset']=qs[_0xd9cd('0x1a')](_0x1a338b[_0xd9cd('0x32')]['offset']);}_0x2ebf56[_0xd9cd('0x3a')]=qs['sort'](_0x1a338b[_0xd9cd('0x32')][_0xd9cd('0x3b')]);_0x2ebf56[_0xd9cd('0x3c')]=qs['filters'](_['pick'](_0x1a338b[_0xd9cd('0x32')],_0x4c036a[_0xd9cd('0x34')]));_0x2ebf56[_0xd9cd('0x3c')]['CampaignId']=_0x12bdd0['id'];if(_0x1a338b[_0xd9cd('0x32')]['filter']){_0x2ebf56[_0xd9cd('0x3c')]=_[_0xd9cd('0x3e')](_0x2ebf56[_0xd9cd('0x3c')],{'$or':_[_0xd9cd('0x31')](_0x2ebf56['attributes'],function(_0x399270){var _0x58bb8c={};_0x58bb8c[_0x399270]={'$like':'%'+_0x1a338b[_0xd9cd('0x32')][_0xd9cd('0x40')]+'%'};return _0x58bb8c;})});}_0x2ebf56=_[_0xd9cd('0x3e')]({},_0x2ebf56,_0x1a338b['options']);return db[_0xd9cd('0x59')][_0xd9cd('0x1d')]({'where':_0x2ebf56[_0xd9cd('0x3c')]})['then'](function(_0x370f04){_0x395b64['count']=_0x370f04;if(_0x1a338b[_0xd9cd('0x32')][_0xd9cd('0x42')]){_0x2ebf56[_0xd9cd('0x43')]=[{'all':!![]}];}return db['CmHopper'][_0xd9cd('0x5b')](_0x2ebf56);})[_0xd9cd('0x24')](function(_0x2144cc){_0x395b64[_0xd9cd('0x44')]=_0x2144cc;return _0x395b64;});}})[_0xd9cd('0x24')](respondWithFilteredResult(_0xe406b8,_0x2ebf56))[_0xd9cd('0x45')](handleError(_0xe406b8,null));};exports[_0xd9cd('0x5c')]=function(_0xefaa1e,_0x6e586a,_0x35989c){var _0x18426b={'raw':!![],'where':{}};var _0x1d92c6={};var _0x1c3e0f={'count':0x0,'rows':[]};return db[_0xd9cd('0x2b')]['findOne']({'where':{'id':_0xefaa1e[_0xd9cd('0x47')]['id']}})[_0xd9cd('0x24')](handleEntityNotFound(_0x6e586a,null))[_0xd9cd('0x24')](function(_0x15b53f){if(_0x15b53f){_0x1d92c6[_0xd9cd('0x30')]=_['keys'](db['CmHopperHistory'][_0xd9cd('0x2c')]);_0x1d92c6[_0xd9cd('0x32')]=_[_0xd9cd('0x33')](_0xefaa1e[_0xd9cd('0x32')]);_0x1d92c6[_0xd9cd('0x34')]=_[_0xd9cd('0x35')](_0x1d92c6[_0xd9cd('0x30')],_0x1d92c6['query']);_0x18426b[_0xd9cd('0x36')]=_['intersection'](_0x1d92c6[_0xd9cd('0x30')],qs[_0xd9cd('0x37')](_0xefaa1e['query'][_0xd9cd('0x37')]));_0x18426b[_0xd9cd('0x36')]=_0x18426b[_0xd9cd('0x36')]['length']?_0x18426b[_0xd9cd('0x36')]:_0x1d92c6['model'];if(!_0xefaa1e[_0xd9cd('0x32')]['hasOwnProperty'](_0xd9cd('0x39'))){_0x18426b[_0xd9cd('0x1c')]=qs[_0xd9cd('0x1c')](_0xefaa1e[_0xd9cd('0x32')][_0xd9cd('0x1c')]);_0x18426b[_0xd9cd('0x1a')]=qs[_0xd9cd('0x1a')](_0xefaa1e['query']['offset']);}_0x18426b[_0xd9cd('0x3a')]=qs[_0xd9cd('0x3b')](_0xefaa1e[_0xd9cd('0x32')][_0xd9cd('0x3b')]);_0x18426b[_0xd9cd('0x3c')]=qs[_0xd9cd('0x34')](_[_0xd9cd('0x3d')](_0xefaa1e[_0xd9cd('0x32')],_0x1d92c6['filters']));_0x18426b['where'][_0xd9cd('0x5d')]=_0x15b53f['id'];if(_0xefaa1e[_0xd9cd('0x32')][_0xd9cd('0x40')]){_0x18426b[_0xd9cd('0x3c')]=_[_0xd9cd('0x3e')](_0x18426b['where'],{'$or':_[_0xd9cd('0x31')](_0x18426b[_0xd9cd('0x36')],function(_0x44414a){var _0xa7d7a9={};_0xa7d7a9[_0x44414a]={'$like':'%'+_0xefaa1e[_0xd9cd('0x32')]['filter']+'%'};return _0xa7d7a9;})});}_0x18426b=_[_0xd9cd('0x3e')]({},_0x18426b,_0xefaa1e[_0xd9cd('0x41')]);return db[_0xd9cd('0x5e')]['count']({'where':_0x18426b[_0xd9cd('0x3c')]})[_0xd9cd('0x24')](function(_0x420b57){_0x1c3e0f[_0xd9cd('0x1d')]=_0x420b57;if(_0xefaa1e[_0xd9cd('0x32')][_0xd9cd('0x42')]){_0x18426b[_0xd9cd('0x43')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xd9cd('0x5b')](_0x18426b);})['then'](function(_0xcdff02){_0x1c3e0f['rows']=_0xcdff02;return _0x1c3e0f;});}})[_0xd9cd('0x24')](respondWithFilteredResult(_0x6e586a,_0x18426b))['catch'](handleError(_0x6e586a,null));};exports['getHopperFinals']=function(_0x1438ff,_0x5cbd2f,_0x2b203a){var _0x422aae={'raw':!![],'where':{}};var _0x189a7b={};var _0x25e4a9={'count':0x0,'rows':[]};return db[_0xd9cd('0x2b')][_0xd9cd('0x5f')]({'where':{'id':_0x1438ff[_0xd9cd('0x47')]['id']}})[_0xd9cd('0x24')](handleEntityNotFound(_0x5cbd2f,null))[_0xd9cd('0x24')](function(_0x3f6c2a){if(_0x3f6c2a){_0x189a7b[_0xd9cd('0x30')]=_[_0xd9cd('0x33')](db[_0xd9cd('0x60')][_0xd9cd('0x2c')]);_0x189a7b[_0xd9cd('0x32')]=_[_0xd9cd('0x33')](_0x1438ff[_0xd9cd('0x32')]);_0x189a7b['filters']=_['intersection'](_0x189a7b[_0xd9cd('0x30')],_0x189a7b['query']);_0x422aae[_0xd9cd('0x36')]=_[_0xd9cd('0x35')](_0x189a7b[_0xd9cd('0x30')],qs['fields'](_0x1438ff['query'][_0xd9cd('0x37')]));_0x422aae[_0xd9cd('0x36')]=_0x422aae[_0xd9cd('0x36')][_0xd9cd('0x38')]?_0x422aae['attributes']:_0x189a7b[_0xd9cd('0x30')];if(!_0x1438ff[_0xd9cd('0x32')][_0xd9cd('0x5a')]('nolimit')){_0x422aae[_0xd9cd('0x1c')]=qs[_0xd9cd('0x1c')](_0x1438ff[_0xd9cd('0x32')][_0xd9cd('0x1c')]);_0x422aae[_0xd9cd('0x1a')]=qs[_0xd9cd('0x1a')](_0x1438ff['query'][_0xd9cd('0x1a')]);}_0x422aae[_0xd9cd('0x3a')]=qs[_0xd9cd('0x3b')](_0x1438ff[_0xd9cd('0x32')]['sort']);_0x422aae[_0xd9cd('0x3c')]=qs[_0xd9cd('0x34')](_[_0xd9cd('0x3d')](_0x1438ff[_0xd9cd('0x32')],_0x189a7b[_0xd9cd('0x34')]));_0x422aae['where']['CampaignId']=_0x3f6c2a['id'];if(_0x1438ff[_0xd9cd('0x32')][_0xd9cd('0x40')]){_0x422aae[_0xd9cd('0x3c')]=_[_0xd9cd('0x3e')](_0x422aae[_0xd9cd('0x3c')],{'$or':_[_0xd9cd('0x31')](_0x422aae[_0xd9cd('0x36')],function(_0x2485ad){var _0x3ec385={};_0x3ec385[_0x2485ad]={'$like':'%'+_0x1438ff[_0xd9cd('0x32')][_0xd9cd('0x40')]+'%'};return _0x3ec385;})});}_0x422aae=_[_0xd9cd('0x3e')]({},_0x422aae,_0x1438ff['options']);return db['CmHopperFinal']['count']({'where':_0x422aae[_0xd9cd('0x3c')]})[_0xd9cd('0x24')](function(_0x43369c){_0x25e4a9[_0xd9cd('0x1d')]=_0x43369c;if(_0x1438ff[_0xd9cd('0x32')]['includeAll']){_0x422aae[_0xd9cd('0x43')]=[{'all':!![]}];}return db[_0xd9cd('0x60')][_0xd9cd('0x5b')](_0x422aae);})[_0xd9cd('0x24')](function(_0x59120e){_0x25e4a9[_0xd9cd('0x44')]=_0x59120e;return _0x25e4a9;});}})[_0xd9cd('0x24')](respondWithFilteredResult(_0x5cbd2f,_0x422aae))[_0xd9cd('0x45')](handleError(_0x5cbd2f,null));};exports[_0xd9cd('0x61')]=function(_0xee168e,_0x5553cc,_0x43a96b){var _0xde7ee1={'raw':!![],'where':{}};var _0x44e91f={};var _0x492655={'count':0x0,'rows':[]};return db[_0xd9cd('0x2b')][_0xd9cd('0x5f')]({'where':{'id':_0xee168e[_0xd9cd('0x47')]['id']}})[_0xd9cd('0x24')](handleEntityNotFound(_0x5553cc,null))[_0xd9cd('0x24')](function(_0x3eb5cf){if(_0x3eb5cf){_0x44e91f[_0xd9cd('0x30')]=_[_0xd9cd('0x33')](db[_0xd9cd('0x62')][_0xd9cd('0x2c')]);_0x44e91f[_0xd9cd('0x32')]=_[_0xd9cd('0x33')](_0xee168e['query']);_0x44e91f[_0xd9cd('0x34')]=_['intersection'](_0x44e91f['model'],_0x44e91f['query']);_0xde7ee1[_0xd9cd('0x36')]=_[_0xd9cd('0x35')](_0x44e91f[_0xd9cd('0x30')],qs[_0xd9cd('0x37')](_0xee168e[_0xd9cd('0x32')][_0xd9cd('0x37')]));_0xde7ee1[_0xd9cd('0x36')]=_0xde7ee1['attributes'][_0xd9cd('0x38')]?_0xde7ee1[_0xd9cd('0x36')]:_0x44e91f[_0xd9cd('0x30')];if(!_0xee168e[_0xd9cd('0x32')]['hasOwnProperty'](_0xd9cd('0x39'))){_0xde7ee1[_0xd9cd('0x1c')]=qs['limit'](_0xee168e['query']['limit']);_0xde7ee1[_0xd9cd('0x1a')]=qs[_0xd9cd('0x1a')](_0xee168e[_0xd9cd('0x32')][_0xd9cd('0x1a')]);}_0xde7ee1[_0xd9cd('0x3a')]=qs[_0xd9cd('0x3b')](_0xee168e['query'][_0xd9cd('0x3b')]);_0xde7ee1['where']=qs['filters'](_['pick'](_0xee168e[_0xd9cd('0x32')],_0x44e91f['filters']));_0xde7ee1[_0xd9cd('0x3c')][_0xd9cd('0x5d')]=_0x3eb5cf['id'];if(_0xee168e['query'][_0xd9cd('0x40')]){_0xde7ee1[_0xd9cd('0x3c')]=_[_0xd9cd('0x3e')](_0xde7ee1['where'],{'$or':_[_0xd9cd('0x31')](_0xde7ee1[_0xd9cd('0x36')],function(_0x5e4f3e){var _0x3b665c={};_0x3b665c[_0x5e4f3e]={'$like':'%'+_0xee168e['query']['filter']+'%'};return _0x3b665c;})});}_0xde7ee1=_['merge']({},_0xde7ee1,_0xee168e[_0xd9cd('0x41')]);return db[_0xd9cd('0x62')][_0xd9cd('0x1d')]({'where':_0xde7ee1[_0xd9cd('0x3c')]})[_0xd9cd('0x24')](function(_0x30a132){_0x492655[_0xd9cd('0x1d')]=_0x30a132;if(_0xee168e[_0xd9cd('0x32')][_0xd9cd('0x42')]){_0xde7ee1[_0xd9cd('0x43')]=[{'all':!![]}];}return db[_0xd9cd('0x62')][_0xd9cd('0x5b')](_0xde7ee1);})['then'](function(_0x52d317){_0x492655[_0xd9cd('0x44')]=_0x52d317;return _0x492655;});}})[_0xd9cd('0x24')](respondWithFilteredResult(_0x5553cc,_0xde7ee1))[_0xd9cd('0x45')](handleError(_0x5553cc,null));};exports[_0xd9cd('0x63')]=function(_0x2ccd27,_0x40a416,_0x6fecd8){var _0x2374c9={};var _0x5041ef={};var _0x14389b;var _0x5eebe3;return db[_0xd9cd('0x2b')][_0xd9cd('0x5f')]({'where':{'id':_0x2ccd27[_0xd9cd('0x47')]['id']}})['then'](handleEntityNotFound(_0x40a416,null))[_0xd9cd('0x24')](function(_0xa905ba){if(_0xa905ba){_0x14389b=_0xa905ba;_0x5041ef[_0xd9cd('0x30')]=_['keys'](db[_0xd9cd('0x64')][_0xd9cd('0x2c')]);_0x5041ef['query']=_[_0xd9cd('0x33')](_0x2ccd27[_0xd9cd('0x32')]);_0x5041ef[_0xd9cd('0x34')]=_[_0xd9cd('0x35')](_0x5041ef[_0xd9cd('0x30')],_0x5041ef[_0xd9cd('0x32')]);_0x2374c9[_0xd9cd('0x36')]=_[_0xd9cd('0x35')](_0x5041ef[_0xd9cd('0x30')],qs[_0xd9cd('0x37')](_0x2ccd27[_0xd9cd('0x32')]['fields']));_0x2374c9['attributes']=_0x2374c9[_0xd9cd('0x36')]['length']?_0x2374c9[_0xd9cd('0x36')]:_0x5041ef['model'];_0x2374c9[_0xd9cd('0x3a')]=qs[_0xd9cd('0x3b')](_0x2ccd27[_0xd9cd('0x32')][_0xd9cd('0x3b')]);_0x2374c9['where']=qs[_0xd9cd('0x34')](_[_0xd9cd('0x3d')](_0x2ccd27[_0xd9cd('0x32')],_0x5041ef[_0xd9cd('0x34')]));if(_0x2ccd27[_0xd9cd('0x32')][_0xd9cd('0x40')]){_0x2374c9[_0xd9cd('0x3c')]=_['merge'](_0x2374c9[_0xd9cd('0x3c')],{'$or':_[_0xd9cd('0x31')](_0x2374c9[_0xd9cd('0x36')],function(_0x4748d7){var _0x8ea80a={};_0x8ea80a[_0x4748d7]={'$like':'%'+_0x2ccd27[_0xd9cd('0x32')][_0xd9cd('0x40')]+'%'};return _0x8ea80a;})});}_0x2374c9=_[_0xd9cd('0x3e')]({},_0x2374c9,_0x2ccd27[_0xd9cd('0x41')]);return _0x14389b['getLists'](_0x2374c9);}})['then'](function(_0x28f312){if(_0x28f312){_0x5eebe3=_0x28f312[_0xd9cd('0x38')];if(!_0x2ccd27['query'][_0xd9cd('0x5a')](_0xd9cd('0x39'))){_0x2374c9[_0xd9cd('0x1c')]=qs['limit'](_0x2ccd27[_0xd9cd('0x32')][_0xd9cd('0x1c')]);_0x2374c9[_0xd9cd('0x1a')]=qs[_0xd9cd('0x1a')](_0x2ccd27['query']['offset']);}return _0x14389b[_0xd9cd('0x63')](_0x2374c9);}})[_0xd9cd('0x24')](function(_0x10f21d){if(_0x10f21d){return _0x10f21d?{'count':_0x5eebe3,'rows':_0x10f21d}:null;}})[_0xd9cd('0x24')](respondWithResult(_0x40a416,null))[_0xd9cd('0x45')](handleError(_0x40a416,null));};exports[_0xd9cd('0x65')]=function(_0x5b7522,_0x4797d1,_0x37a75c){var _0x48db75,_0x403681;return db[_0xd9cd('0x2b')][_0xd9cd('0x48')]({'where':{'id':_0x5b7522[_0xd9cd('0x47')]['id']}})[_0xd9cd('0x24')](handleEntityNotFound(_0x4797d1,null))[_0xd9cd('0x24')](function(_0x26b208){if(_0x26b208){_0x403681=_0x26b208;return _0x26b208['addLists'](_0x5b7522[_0xd9cd('0x4a')][_0xd9cd('0x66')],_[_0xd9cd('0x56')](_0x5b7522[_0xd9cd('0x4a')],['ids','id'])||{});}return null;})[_0xd9cd('0x67')](function(_0x391b6f){var _0x5ab86c;_0x48db75=_0x391b6f||[];var _0x24597a=[];if(_0x391b6f){for(var _0x1d0006=0x0;_0x1d0006<_0x391b6f[_0xd9cd('0x38')];_0x1d0006+=0x1){var _0x400ebe=_0x391b6f[_0x1d0006]['get']({'plain':!![]});_0x403681[_0xd9cd('0x68')]=_0x5b7522[_0xd9cd('0x4a')][_0xd9cd('0x68')]?_0x5b7522['body']['dialCheckDuplicateType']:_0x403681[_0xd9cd('0x68')];switch(_0x403681[_0xd9cd('0x68')]){case _0xd9cd('0x69'):_0x5ab86c=squel[_0xd9cd('0x6a')]()[_0xd9cd('0x6b')](_0xd9cd('0x6c'))[_0xd9cd('0x6d')]([_0xd9cd('0x6e'),'scheduledAt','ContactId',_0xd9cd('0x6f'),_0xd9cd('0x5d'),'createdAt',_0xd9cd('0x55')],squel[_0xd9cd('0x70')]()[_0xd9cd('0x71')](_0xd9cd('0x6e'),_0xd9cd('0x6e'))[_0xd9cd('0x71')](_0xd9cd('0x72'),_0xd9cd('0x73'))['field']('id',_0xd9cd('0x74'))[_0xd9cd('0x71')](_0x400ebe[_0xd9cd('0x75')][_0xd9cd('0x76')](),_0xd9cd('0x6f'))['field'](_0x5b7522[_0xd9cd('0x47')]['id'][_0xd9cd('0x76')](),'CampaignId')[_0xd9cd('0x71')](_0xd9cd('0x72'),_0xd9cd('0x54'))[_0xd9cd('0x71')](_0xd9cd('0x72'),_0xd9cd('0x55'))['from'](_0xd9cd('0x77'))[_0xd9cd('0x3c')](_0xd9cd('0x78'))[_0xd9cd('0x3c')](_0xd9cd('0x79'),_0x400ebe['CmListId']['toString']())[_0xd9cd('0x3c')](_0xd9cd('0x7a'))[_0xd9cd('0x3c')](_0xd9cd('0x7b'),squel[_0xd9cd('0x70')]()['field'](_0xd9cd('0x7c'))[_0xd9cd('0x7d')](_0xd9cd('0x7e'))[_0xd9cd('0x3c')](_0xd9cd('0x7f'),_0x5b7522[_0xd9cd('0x47')]['id'][_0xd9cd('0x76')]()))[_0xd9cd('0x3c')](_0xd9cd('0x7b'),squel[_0xd9cd('0x70')]()['field'](_0xd9cd('0x80'))['from'](_0xd9cd('0x6c'))[_0xd9cd('0x3c')](_0xd9cd('0x7f'),_0x5b7522[_0xd9cd('0x47')]['id'][_0xd9cd('0x76')]())))[_0xd9cd('0x76')]();break;case _0xd9cd('0x81'):_0x5ab86c=squel[_0xd9cd('0x6a')]()[_0xd9cd('0x6b')](_0xd9cd('0x6c'))[_0xd9cd('0x6d')](['phone',_0xd9cd('0x73'),_0xd9cd('0x74'),_0xd9cd('0x6f'),_0xd9cd('0x5d'),_0xd9cd('0x54'),'updatedAt'],squel[_0xd9cd('0x70')]()[_0xd9cd('0x71')](_0xd9cd('0x6e'),_0xd9cd('0x6e'))[_0xd9cd('0x71')](_0xd9cd('0x72'),_0xd9cd('0x73'))[_0xd9cd('0x71')]('id',_0xd9cd('0x74'))['field'](_0x400ebe['CmListId']['toString'](),'ListId')['field'](_0x5b7522[_0xd9cd('0x47')]['id'][_0xd9cd('0x76')](),_0xd9cd('0x5d'))[_0xd9cd('0x71')](_0xd9cd('0x72'),_0xd9cd('0x54'))[_0xd9cd('0x71')](_0xd9cd('0x72'),_0xd9cd('0x55'))['from'](_0xd9cd('0x77'))['where']('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x400ebe[_0xd9cd('0x75')][_0xd9cd('0x76')]())[_0xd9cd('0x3c')](_0xd9cd('0x7a'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xd9cd('0x70')]()['field'](_0xd9cd('0x80'))['from'](_0xd9cd('0x6c'))['where'](_0xd9cd('0x7f'),_0x5b7522[_0xd9cd('0x47')]['id'][_0xd9cd('0x76')]())))[_0xd9cd('0x76')]();break;default:_0x5ab86c=squel[_0xd9cd('0x6a')]()[_0xd9cd('0x6b')](_0xd9cd('0x6c'))[_0xd9cd('0x6d')](['phone',_0xd9cd('0x73'),_0xd9cd('0x74'),'ListId',_0xd9cd('0x5d'),_0xd9cd('0x54'),_0xd9cd('0x55')],squel[_0xd9cd('0x70')]()[_0xd9cd('0x71')](_0xd9cd('0x6e'),_0xd9cd('0x6e'))[_0xd9cd('0x71')](_0xd9cd('0x72'),_0xd9cd('0x73'))[_0xd9cd('0x71')]('id','ContactId')[_0xd9cd('0x71')](_0x400ebe[_0xd9cd('0x75')][_0xd9cd('0x76')](),_0xd9cd('0x6f'))[_0xd9cd('0x71')](_0x5b7522[_0xd9cd('0x47')]['id'][_0xd9cd('0x76')](),_0xd9cd('0x5d'))[_0xd9cd('0x71')](_0xd9cd('0x72'),_0xd9cd('0x54'))['field'](_0xd9cd('0x72'),_0xd9cd('0x55'))['from'](_0xd9cd('0x77'))[_0xd9cd('0x3c')](_0xd9cd('0x78'))[_0xd9cd('0x3c')](_0xd9cd('0x79'),_0x400ebe[_0xd9cd('0x75')]['toString']())[_0xd9cd('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0xd9cd('0x76')]();}_0x24597a['push'](db[_0xd9cd('0x82')][_0xd9cd('0x32')](_0x5ab86c));}return BPromise[_0xd9cd('0x83')](_0x24597a);}})[_0xd9cd('0x24')](function(){return _0x48db75;})[_0xd9cd('0x24')](respondWithResult(_0x4797d1,null))[_0xd9cd('0x45')](handleError(_0x4797d1,null));};exports['removeLists']=function(_0x1bd6e8,_0x35c9e9,_0x2cc981){return db[_0xd9cd('0x2b')][_0xd9cd('0x48')]({'where':{'id':_0x1bd6e8[_0xd9cd('0x47')]['id']}})[_0xd9cd('0x24')](handleEntityNotFound(_0x35c9e9,null))[_0xd9cd('0x24')](function(_0x4ce4e3){if(_0x4ce4e3){return _0x4ce4e3['removeLists'](_0x1bd6e8[_0xd9cd('0x32')]['ids']);}})['then'](function(_0x342d72){if(_0x342d72){return db[_0xd9cd('0x59')]['destroy']({'where':{'ListId':_0x1bd6e8[_0xd9cd('0x32')][_0xd9cd('0x66')],'CampaignId':_0x1bd6e8[_0xd9cd('0x47')]['id']}})[_0xd9cd('0x24')](function(){return _0x342d72;});}})[_0xd9cd('0x24')](respondWithStatusCode(_0x35c9e9,null))[_0xd9cd('0x45')](handleError(_0x35c9e9,null));};exports[_0xd9cd('0x84')]=function(_0x1247de,_0x46784c,_0x27b4cc){var _0x403c31={};var _0x1a99b1={};var _0xf856c2;var _0x2f2628;return db[_0xd9cd('0x2b')][_0xd9cd('0x5f')]({'where':{'id':_0x1247de['params']['id']}})['then'](handleEntityNotFound(_0x46784c,null))[_0xd9cd('0x24')](function(_0x27bb49){if(_0x27bb49){_0xf856c2=_0x27bb49;_0x1a99b1[_0xd9cd('0x30')]=_['keys'](db[_0xd9cd('0x64')][_0xd9cd('0x2c')]);_0x1a99b1[_0xd9cd('0x32')]=_[_0xd9cd('0x33')](_0x1247de[_0xd9cd('0x32')]);_0x1a99b1[_0xd9cd('0x34')]=_[_0xd9cd('0x35')](_0x1a99b1[_0xd9cd('0x30')],_0x1a99b1[_0xd9cd('0x32')]);_0x403c31[_0xd9cd('0x36')]=_[_0xd9cd('0x35')](_0x1a99b1[_0xd9cd('0x30')],qs[_0xd9cd('0x37')](_0x1247de[_0xd9cd('0x32')][_0xd9cd('0x37')]));_0x403c31['attributes']=_0x403c31['attributes']['length']?_0x403c31[_0xd9cd('0x36')]:_0x1a99b1[_0xd9cd('0x30')];_0x403c31['order']=qs[_0xd9cd('0x3b')](_0x1247de[_0xd9cd('0x32')][_0xd9cd('0x3b')]);_0x403c31['where']=qs[_0xd9cd('0x34')](_['pick'](_0x1247de[_0xd9cd('0x32')],_0x1a99b1['filters']));if(_0x1247de[_0xd9cd('0x32')][_0xd9cd('0x40')]){_0x403c31[_0xd9cd('0x3c')]=_[_0xd9cd('0x3e')](_0x403c31['where'],{'$or':_['map'](_0x403c31[_0xd9cd('0x36')],function(_0x4e4c7c){var _0x31f637={};_0x31f637[_0x4e4c7c]={'$like':'%'+_0x1247de[_0xd9cd('0x32')][_0xd9cd('0x40')]+'%'};return _0x31f637;})});}_0x403c31=_[_0xd9cd('0x3e')]({},_0x403c31,_0x1247de[_0xd9cd('0x41')]);return _0xf856c2[_0xd9cd('0x84')](_0x403c31);}})['then'](function(_0x180248){if(_0x180248){_0x2f2628=_0x180248[_0xd9cd('0x38')];if(!_0x1247de[_0xd9cd('0x32')][_0xd9cd('0x5a')]('nolimit')){_0x403c31['limit']=qs[_0xd9cd('0x1c')](_0x1247de['query'][_0xd9cd('0x1c')]);_0x403c31['offset']=qs[_0xd9cd('0x1a')](_0x1247de['query'][_0xd9cd('0x1a')]);}return _0xf856c2[_0xd9cd('0x84')](_0x403c31);}})[_0xd9cd('0x24')](function(_0x5827b8){if(_0x5827b8){return _0x5827b8?{'count':_0x2f2628,'rows':_0x5827b8}:null;}})[_0xd9cd('0x24')](respondWithResult(_0x46784c,null))[_0xd9cd('0x45')](handleError(_0x46784c,null));};exports[_0xd9cd('0x85')]=function(_0x1ef614,_0x7fb6ea,_0x362f58){var _0x51f5fb,_0x2bfa6f;return db[_0xd9cd('0x2b')]['find']({'where':{'id':_0x1ef614['params']['id']}})[_0xd9cd('0x24')](handleEntityNotFound(_0x7fb6ea,null))['then'](function(_0x1a709b){if(_0x1a709b){_0x2bfa6f=_0x1a709b;return _0x1a709b[_0xd9cd('0x85')](_0x1ef614[_0xd9cd('0x4a')][_0xd9cd('0x66')],_[_0xd9cd('0x56')](_0x1ef614[_0xd9cd('0x4a')],['ids','id'])||{});}return null;})['spread'](function(_0x1f2526){var _0x104067;_0x51f5fb=_0x1f2526||[];var _0x1dd464=[];if(_0x1f2526){for(var _0x3c6f04=0x0;_0x3c6f04<_0x1f2526[_0xd9cd('0x38')];_0x3c6f04+=0x1){var _0x1acc31=_0x1f2526[_0x3c6f04]['get']({'plain':!![]});_0x104067=squel[_0xd9cd('0x6a')]()[_0xd9cd('0x6b')](_0xd9cd('0x86'))[_0xd9cd('0x6d')]([_0xd9cd('0x6e'),_0xd9cd('0x74'),_0xd9cd('0x6f'),_0xd9cd('0x5d'),_0xd9cd('0x54'),_0xd9cd('0x55')],squel['select']()['field'](_0xd9cd('0x6e'),_0xd9cd('0x6e'))[_0xd9cd('0x71')]('id',_0xd9cd('0x74'))[_0xd9cd('0x71')](_0x1acc31[_0xd9cd('0x75')][_0xd9cd('0x76')](),_0xd9cd('0x6f'))[_0xd9cd('0x71')](_0x1ef614[_0xd9cd('0x47')]['id'][_0xd9cd('0x76')](),_0xd9cd('0x5d'))['field'](_0xd9cd('0x72'),_0xd9cd('0x54'))[_0xd9cd('0x71')]('NOW()',_0xd9cd('0x55'))[_0xd9cd('0x7d')]('cm_contacts')[_0xd9cd('0x3c')](_0xd9cd('0x78'))[_0xd9cd('0x3c')](_0xd9cd('0x79'),_0x1acc31[_0xd9cd('0x75')][_0xd9cd('0x76')]())['where'](_0xd9cd('0x7a')))[_0xd9cd('0x76')]();_0x1dd464[_0xd9cd('0x87')](db['sequelize'][_0xd9cd('0x32')](_0x104067));}return BPromise[_0xd9cd('0x83')](_0x1dd464);}})[_0xd9cd('0x24')](function(){return _0x51f5fb;})[_0xd9cd('0x24')](respondWithResult(_0x7fb6ea,null))[_0xd9cd('0x45')](handleError(_0x7fb6ea,null));};exports[_0xd9cd('0x88')]=function(_0x26ae1c,_0x4ef409,_0x2ebea0){return db[_0xd9cd('0x2b')][_0xd9cd('0x48')]({'where':{'id':_0x26ae1c['params']['id']}})[_0xd9cd('0x24')](handleEntityNotFound(_0x4ef409,null))[_0xd9cd('0x24')](function(_0x3d514c){if(_0x3d514c){return _0x3d514c[_0xd9cd('0x88')](_0x26ae1c['query'][_0xd9cd('0x66')]);}})[_0xd9cd('0x24')](function(_0x3d9fa2){if(_0x3d9fa2){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x26ae1c[_0xd9cd('0x32')][_0xd9cd('0x66')],'CampaignId':_0x26ae1c['params']['id']}})['then'](function(){return _0x3d9fa2;});}})[_0xd9cd('0x24')](respondWithStatusCode(_0x4ef409,null))[_0xd9cd('0x45')](handleError(_0x4ef409,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 4d4ddaa..65ec0a9 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(_0x14e589,_0x5d5c97){var _0x4ceb8c=function(_0x55f065){while(--_0x55f065){_0x14e589['push'](_0x14e589['shift']());}};_0x4ceb8c(++_0x5d5c97);}(_0x7a54,0x106));var _0x47a5=function(_0x522bef,_0x4b6cae){_0x522bef=_0x522bef-0x0;var _0x38c629=_0x7a54[_0x522bef];return _0x38c629;};'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(_0x1c9f7b,_0x2dc4b0){var _0x580a06=function(_0x2c858f){while(--_0x2c858f){_0x1c9f7b['push'](_0x1c9f7b['shift']());}};_0x580a06(++_0x2dc4b0);}(_0x7a54,0x106));var _0x47a5=function(_0xd4bfa5,_0x178d96){_0xd4bfa5=_0xd4bfa5-0x0;var _0x3418d2=_0x7a54[_0xd4bfa5];return _0x3418d2;};'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 ddc5ee1..41b2ba3 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 _0x4403=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetCampaign','findAll','options','raw','where','attributes','include','model','map'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4403,0x179));var _0x3440=function(_0x136de0,_0xed928c){_0x136de0=_0x136de0-0x0;var _0x3a08df=_0x4403[_0x136de0];return _0x3a08df;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3440('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3440('0x1'));var db=require(_0x3440('0x2'))['db'];var utils=require(_0x3440('0x3'));var logger=require(_0x3440('0x4'))('rpc');var config=require(_0x3440('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3440('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3121bd,_0x338e48,_0x4abc5a){return new BPromise(function(_0x33a070,_0x59d581){return client[_0x3440('0x7')](_0x3121bd,_0x4abc5a)[_0x3440('0x8')](function(_0x4559cd){logger['info'](_0x3440('0x9'),_0x338e48,_0x3440('0xa'));logger[_0x3440('0xb')](_0x3440('0xc'),_0x338e48,_0x3440('0xa'),JSON[_0x3440('0xd')](_0x4559cd));if(_0x4559cd[_0x3440('0xe')]){if(_0x4559cd['error'][_0x3440('0xf')]===0x1f4){logger[_0x3440('0xe')](_0x3440('0x9'),_0x338e48,_0x4559cd['error'][_0x3440('0x10')]);return _0x59d581(_0x4559cd[_0x3440('0xe')][_0x3440('0x10')]);}logger[_0x3440('0xe')](_0x3440('0x9'),_0x338e48,_0x4559cd['error'][_0x3440('0x10')]);return _0x33a070(_0x4559cd['error'][_0x3440('0x10')]);}else{logger[_0x3440('0x11')](_0x3440('0x9'),_0x338e48,_0x3440('0xa'));_0x33a070(_0x4559cd[_0x3440('0x12')][_0x3440('0x10')]);}})[_0x3440('0x13')](function(_0xb66a69){logger['error'](_0x3440('0x9'),_0x338e48,_0xb66a69);_0x59d581(_0xb66a69);});});}exports[_0x3440('0x14')]=function(_0x43fd39){var _0x1c10fd=this;return new Promise(function(_0x31a8dd,_0x39ee81){return db['Campaign'][_0x3440('0x15')]({'raw':_0x43fd39[_0x3440('0x16')]?_0x43fd39[_0x3440('0x16')][_0x3440('0x17')]===undefined?!![]:![]:!![],'where':_0x43fd39[_0x3440('0x16')]?_0x43fd39[_0x3440('0x16')][_0x3440('0x18')]||null:null,'attributes':_0x43fd39[_0x3440('0x16')]?_0x43fd39[_0x3440('0x16')][_0x3440('0x19')]||null:null,'limit':_0x43fd39[_0x3440('0x16')]?_0x43fd39['options']['limit']||null:null,'include':_0x43fd39['options']?_0x43fd39[_0x3440('0x16')][_0x3440('0x1a')]?_['map'](_0x43fd39[_0x3440('0x16')][_0x3440('0x1a')],function(_0x33cfb5){return{'model':db[_0x33cfb5[_0x3440('0x1b')]],'as':_0x33cfb5['as'],'attributes':_0x33cfb5[_0x3440('0x19')],'include':_0x33cfb5['include']?_[_0x3440('0x1c')](_0x33cfb5[_0x3440('0x1a')],function(_0x3b9e75){return{'model':db[_0x3b9e75[_0x3440('0x1b')]],'as':_0x3b9e75['as'],'attributes':_0x3b9e75[_0x3440('0x19')],'include':_0x3b9e75['include']?_[_0x3440('0x1c')](_0x3b9e75[_0x3440('0x1a')],function(_0x1cfe3a){return{'model':db[_0x1cfe3a[_0x3440('0x1b')]],'as':_0x1cfe3a['as'],'attributes':_0x1cfe3a[_0x3440('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x391728){logger[_0x3440('0x11')](_0x3440('0x14'),_0x43fd39);logger[_0x3440('0xb')](_0x3440('0x14'),_0x43fd39,JSON[_0x3440('0xd')](_0x391728));_0x31a8dd(_0x391728);})[_0x3440('0x13')](function(_0x1f7fee){logger[_0x3440('0xe')](_0x3440('0x14'),_0x1f7fee[_0x3440('0x10')],_0x43fd39);_0x39ee81(_0x1c10fd['error'](0x1f4,_0x1f7fee['message']));});});};
\ No newline at end of file
+var _0xf675=['../../config/environment','jayson/promise','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xc1edf4,_0x26b0db){var _0x11c9aa=function(_0x25ad6b){while(--_0x25ad6b){_0xc1edf4['push'](_0xc1edf4['shift']());}};_0x11c9aa(++_0x26b0db);}(_0xf675,0x199));var _0x5f67=function(_0xce93c,_0x555be5){_0xce93c=_0xce93c-0x0;var _0x230720=_0xf675[_0xce93c];return _0x230720;};'use strict';var _=require(_0x5f67('0x0'));var util=require(_0x5f67('0x1'));var moment=require(_0x5f67('0x2'));var BPromise=require('bluebird');var rs=require(_0x5f67('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5f67('0x4'))['db'];var utils=require(_0x5f67('0x5'));var logger=require(_0x5f67('0x6'))('rpc');var config=require(_0x5f67('0x7'));var jayson=require(_0x5f67('0x8'));var client=jayson[_0x5f67('0x9')][_0x5f67('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b67eb,_0xc71a7,_0x121d19){return new BPromise(function(_0x55efcd,_0x5749f5){return client[_0x5f67('0xb')](_0x5b67eb,_0x121d19)[_0x5f67('0xc')](function(_0x530ef1){logger['info'](_0x5f67('0xd'),_0xc71a7,_0x5f67('0xe'));logger[_0x5f67('0xf')]('Campaign,\x20%s,\x20%s,\x20%s',_0xc71a7,'request\x20sent',JSON['stringify'](_0x530ef1));if(_0x530ef1[_0x5f67('0x10')]){if(_0x530ef1[_0x5f67('0x10')]['code']===0x1f4){logger[_0x5f67('0x10')]('Campaign,\x20%s,\x20%s',_0xc71a7,_0x530ef1[_0x5f67('0x10')]['message']);return _0x5749f5(_0x530ef1[_0x5f67('0x10')][_0x5f67('0x11')]);}logger[_0x5f67('0x10')]('Campaign,\x20%s,\x20%s',_0xc71a7,_0x530ef1[_0x5f67('0x10')]['message']);return _0x55efcd(_0x530ef1[_0x5f67('0x10')]['message']);}else{logger[_0x5f67('0x12')]('Campaign,\x20%s,\x20%s',_0xc71a7,_0x5f67('0xe'));_0x55efcd(_0x530ef1[_0x5f67('0x13')][_0x5f67('0x11')]);}})[_0x5f67('0x14')](function(_0x444ee5){logger[_0x5f67('0x10')](_0x5f67('0xd'),_0xc71a7,_0x444ee5);_0x5749f5(_0x444ee5);});});}exports[_0x5f67('0x15')]=function(_0xc539c6){var _0x8f3bd6=this;return new Promise(function(_0x5275d6,_0x5bc956){return db[_0x5f67('0x16')][_0x5f67('0x17')]({'raw':_0xc539c6['options']?_0xc539c6[_0x5f67('0x18')][_0x5f67('0x19')]===undefined?!![]:![]:!![],'where':_0xc539c6[_0x5f67('0x18')]?_0xc539c6[_0x5f67('0x18')][_0x5f67('0x1a')]||null:null,'attributes':_0xc539c6[_0x5f67('0x18')]?_0xc539c6[_0x5f67('0x18')][_0x5f67('0x1b')]||null:null,'limit':_0xc539c6[_0x5f67('0x18')]?_0xc539c6[_0x5f67('0x18')][_0x5f67('0x1c')]||null:null,'include':_0xc539c6[_0x5f67('0x18')]?_0xc539c6['options'][_0x5f67('0x1d')]?_[_0x5f67('0x1e')](_0xc539c6[_0x5f67('0x18')]['include'],function(_0x537b39){return{'model':db[_0x537b39[_0x5f67('0x1f')]],'as':_0x537b39['as'],'attributes':_0x537b39[_0x5f67('0x1b')],'include':_0x537b39['include']?_[_0x5f67('0x1e')](_0x537b39[_0x5f67('0x1d')],function(_0x241d17){return{'model':db[_0x241d17[_0x5f67('0x1f')]],'as':_0x241d17['as'],'attributes':_0x241d17['attributes'],'include':_0x241d17[_0x5f67('0x1d')]?_['map'](_0x241d17[_0x5f67('0x1d')],function(_0x167601){return{'model':db[_0x167601['model']],'as':_0x167601['as'],'attributes':_0x167601[_0x5f67('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5f67('0xc')](function(_0x57f373){logger['info'](_0x5f67('0x15'),_0xc539c6);logger[_0x5f67('0xf')](_0x5f67('0x15'),_0xc539c6,JSON['stringify'](_0x57f373));_0x5275d6(_0x57f373);})[_0x5f67('0x14')](function(_0xd36b79){logger['error'](_0x5f67('0x15'),_0xd36b79[_0x5f67('0x11')],_0xc539c6);_0x5bc956(_0x8f3bd6['error'](0x1f4,_0xd36b79[_0x5f67('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 83500fe..01e1f01 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 _0xa051=['./campaign.controller','isAuthenticated','index','/:id','show','get','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','put','update','destroy','delete','removeLists','removeBlackLists','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4bb94b,_0x50628a){var _0x36dcc6=function(_0x3ea436){while(--_0x3ea436){_0x4bb94b['push'](_0x4bb94b['shift']());}};_0x36dcc6(++_0x50628a);}(_0xa051,0x156));var _0x1a05=function(_0x48d94e,_0xfbb342){_0x48d94e=_0x48d94e-0x0;var _0x1fd8e8=_0xa051[_0x48d94e];return _0x1fd8e8;};'use strict';var multer=require(_0x1a05('0x0'));var util=require('util');var path=require(_0x1a05('0x1'));var timeout=require('connect-timeout');var express=require(_0x1a05('0x2'));var router=express[_0x1a05('0x3')]();var fs_extra=require(_0x1a05('0x4'));var auth=require(_0x1a05('0x5'));var interaction=require(_0x1a05('0x6'));var config=require(_0x1a05('0x7'));var controller=require(_0x1a05('0x8'));router['get']('/',auth[_0x1a05('0x9')](),controller[_0x1a05('0xa')]);router['get'](_0x1a05('0xb'),auth[_0x1a05('0x9')](),controller[_0x1a05('0xc')]);router[_0x1a05('0xd')](_0x1a05('0xe'),auth[_0x1a05('0x9')](),controller[_0x1a05('0xf')]);router[_0x1a05('0xd')](_0x1a05('0x10'),auth[_0x1a05('0x9')](),controller[_0x1a05('0x11')]);router[_0x1a05('0xd')](_0x1a05('0x12'),auth['isAuthenticated'](),controller[_0x1a05('0x13')]);router[_0x1a05('0xd')]('/:id/hopper_black',auth[_0x1a05('0x9')](),controller['getHopperBlacks']);router[_0x1a05('0xd')](_0x1a05('0x14'),auth['isAuthenticated'](),controller[_0x1a05('0x15')]);router[_0x1a05('0xd')](_0x1a05('0x16'),auth['isAuthenticated'](),controller[_0x1a05('0x17')]);router[_0x1a05('0x18')]('/',auth['isAuthenticated'](),controller[_0x1a05('0x19')]);router['post'](_0x1a05('0x1a'),auth[_0x1a05('0x9')](),controller[_0x1a05('0x1b')]);router[_0x1a05('0x18')](_0x1a05('0x14'),auth['isAuthenticated'](),controller['addLists']);router['post'](_0x1a05('0x16'),auth[_0x1a05('0x9')](),controller['addBlackLists']);router[_0x1a05('0x1c')](_0x1a05('0xb'),auth[_0x1a05('0x9')](),controller[_0x1a05('0x1d')]);router['delete'](_0x1a05('0xb'),auth[_0x1a05('0x9')](),controller[_0x1a05('0x1e')]);router[_0x1a05('0x1f')](_0x1a05('0x14'),auth[_0x1a05('0x9')](),controller[_0x1a05('0x20')]);router[_0x1a05('0x1f')](_0x1a05('0x16'),auth[_0x1a05('0x9')](),controller[_0x1a05('0x21')]);module[_0x1a05('0x22')]=router;
\ No newline at end of file
+var _0x2aec=['addLists','addBlackLists','put','/:id','delete','destroy','removeLists','removeBlackLists','exports','multer','path','express','Router','fs-extra','../../components/auth/service','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/lists'];(function(_0x438df9,_0x1746b7){var _0x296bef=function(_0x45b00e){while(--_0x45b00e){_0x438df9['push'](_0x438df9['shift']());}};_0x296bef(++_0x1746b7);}(_0x2aec,0x1dd));var _0xc2ae=function(_0x33d433,_0x410e4b){_0x33d433=_0x33d433-0x0;var _0x584876=_0x2aec[_0x33d433];return _0x584876;};'use strict';var multer=require(_0xc2ae('0x0'));var util=require('util');var path=require(_0xc2ae('0x1'));var timeout=require('connect-timeout');var express=require(_0xc2ae('0x2'));var router=express[_0xc2ae('0x3')]();var fs_extra=require(_0xc2ae('0x4'));var auth=require(_0xc2ae('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc2ae('0x6'));router[_0xc2ae('0x7')]('/',auth[_0xc2ae('0x8')](),controller[_0xc2ae('0x9')]);router[_0xc2ae('0x7')]('/:id',auth[_0xc2ae('0x8')](),controller[_0xc2ae('0xa')]);router[_0xc2ae('0x7')](_0xc2ae('0xb'),auth[_0xc2ae('0x8')](),controller[_0xc2ae('0xc')]);router[_0xc2ae('0x7')](_0xc2ae('0xd'),auth[_0xc2ae('0x8')](),controller[_0xc2ae('0xe')]);router['get'](_0xc2ae('0xf'),auth[_0xc2ae('0x8')](),controller[_0xc2ae('0x10')]);router[_0xc2ae('0x7')](_0xc2ae('0x11'),auth[_0xc2ae('0x8')](),controller[_0xc2ae('0x12')]);router[_0xc2ae('0x7')]('/:id/lists',auth[_0xc2ae('0x8')](),controller[_0xc2ae('0x13')]);router[_0xc2ae('0x7')](_0xc2ae('0x14'),auth[_0xc2ae('0x8')](),controller[_0xc2ae('0x15')]);router[_0xc2ae('0x16')]('/',auth[_0xc2ae('0x8')](),controller[_0xc2ae('0x17')]);router[_0xc2ae('0x16')](_0xc2ae('0x18'),auth[_0xc2ae('0x8')](),controller[_0xc2ae('0x19')]);router['post'](_0xc2ae('0x1a'),auth[_0xc2ae('0x8')](),controller[_0xc2ae('0x1b')]);router[_0xc2ae('0x16')](_0xc2ae('0x14'),auth['isAuthenticated'](),controller[_0xc2ae('0x1c')]);router[_0xc2ae('0x1d')](_0xc2ae('0x1e'),auth[_0xc2ae('0x8')](),controller['update']);router[_0xc2ae('0x1f')]('/:id',auth[_0xc2ae('0x8')](),controller[_0xc2ae('0x20')]);router[_0xc2ae('0x1f')](_0xc2ae('0x1a'),auth[_0xc2ae('0x8')](),controller[_0xc2ae('0x21')]);router[_0xc2ae('0x1f')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xc2ae('0x22')]);module[_0xc2ae('0x23')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index c6465cf..b88d43b 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 _0xf0f6=['VIRTUAL','getDataValue','key','sequelize','exports','STRING'];(function(_0x482404,_0x15fb83){var _0x3e8826=function(_0x188b5e){while(--_0x188b5e){_0x482404['push'](_0x482404['shift']());}};_0x3e8826(++_0x15fb83);}(_0xf0f6,0x159));var _0x6f0f=function(_0x1ea797,_0x158bed){_0x1ea797=_0x1ea797-0x0;var _0x420fba=_0xf0f6[_0x1ea797];return _0x420fba;};'use strict';var Sequelize=require(_0x6f0f('0x0'));module[_0x6f0f('0x1')]={'key':{'type':Sequelize[_0x6f0f('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x6f0f('0x2')]},'name':{'type':Sequelize[_0x6f0f('0x3')],'get':function(){return this[_0x6f0f('0x4')](_0x6f0f('0x5'));}}};
\ No newline at end of file
+var _0x8af3=['VIRTUAL','getDataValue','key','exports','STRING','TEXT'];(function(_0x437e13,_0x3af614){var _0x1b5131=function(_0x4f5393){while(--_0x4f5393){_0x437e13['push'](_0x437e13['shift']());}};_0x1b5131(++_0x3af614);}(_0x8af3,0x153));var _0x38af=function(_0x484388,_0x58bb1d){_0x484388=_0x484388-0x0;var _0x508f72=_0x8af3[_0x484388];return _0x508f72;};'use strict';var Sequelize=require('sequelize');module[_0x38af('0x0')]={'key':{'type':Sequelize[_0x38af('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x38af('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x38af('0x1')]},'name':{'type':Sequelize[_0x38af('0x3')],'get':function(){return this[_0x38af('0x4')](_0x38af('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index c426712..747bdcd 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 _0x78f0=['map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','include','CannedAnswer','findAll','show','options','find','catch','body','params','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','get','CannedAnswers','UserProfileResource','destroy','error','name','index','rawAttributes','type','key','model'];(function(_0x2605dc,_0x50cf7e){var _0x4568c9=function(_0x447f7c){while(--_0x447f7c){_0x2605dc['push'](_0x2605dc['shift']());}};_0x4568c9(++_0x50cf7e);}(_0x78f0,0x75));var _0x078f=function(_0x170b3e,_0x46abbf){_0x170b3e=_0x170b3e-0x0;var _0xff2428=_0x78f0[_0x170b3e];return _0xff2428;};'use strict';var emlformat=require(_0x078f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x078f('0x1'));var rp=require(_0x078f('0x2'));var moment=require(_0x078f('0x3'));var BPromise=require(_0x078f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x078f('0x5'));var sox=require(_0x078f('0x6'));var csv=require(_0x078f('0x7'));var ejs=require(_0x078f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x078f('0x9'));var crypto=require(_0x078f('0xa'));var jsforce=require(_0x078f('0xb'));var deskjs=require(_0x078f('0xc'));var toCsv=require(_0x078f('0x7'));var querystring=require('querystring');var Papa=require(_0x078f('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x078f('0xe'));var as=require(_0x078f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x078f('0x10'));var utils=require('../../config/utils');var config=require(_0x078f('0x11'));var licenseUtil=require(_0x078f('0x12'));var db=require(_0x078f('0x13'))['db'];function respondWithStatusCode(_0x34d250,_0x8c2cb5){_0x8c2cb5=_0x8c2cb5||0xcc;return function(_0x505cad){if(_0x505cad){return _0x34d250[_0x078f('0x14')](_0x8c2cb5);}return _0x34d250[_0x078f('0x15')](_0x8c2cb5)[_0x078f('0x16')]();};}function respondWithResult(_0x35e44d,_0x2dabf4){_0x2dabf4=_0x2dabf4||0xc8;return function(_0x2a5d84){if(_0x2a5d84){return _0x35e44d['status'](_0x2dabf4)[_0x078f('0x17')](_0x2a5d84);}};}function respondWithFilteredResult(_0x3b86d5,_0x4647b0){return function(_0x45ab09){if(_0x45ab09){var _0x1e8ecb=typeof _0x4647b0['offset']==='undefined'&&typeof _0x4647b0[_0x078f('0x18')]===_0x078f('0x19');var _0x4c44b8=_0x45ab09[_0x078f('0x1a')];var _0x4fca98=_0x1e8ecb?0x0:_0x4647b0[_0x078f('0x1b')];var _0xe0bb18=_0x1e8ecb?_0x45ab09['count']:_0x4647b0[_0x078f('0x1b')]+_0x4647b0['limit'];var _0x4f1eb0;if(_0xe0bb18>=_0x4c44b8){_0xe0bb18=_0x4c44b8;_0x4f1eb0=0xc8;}else{_0x4f1eb0=0xce;}_0x3b86d5[_0x078f('0x15')](_0x4f1eb0);return _0x3b86d5[_0x078f('0x1c')](_0x078f('0x1d'),_0x4fca98+'-'+_0xe0bb18+'/'+_0x4c44b8)[_0x078f('0x17')](_0x45ab09);}return null;};}function patchUpdates(_0xcbe3be){return function(_0x133047){try{jsonpatch[_0x078f('0x1e')](_0x133047,_0xcbe3be,!![]);}catch(_0x4f1452){return BPromise['reject'](_0x4f1452);}return _0x133047[_0x078f('0x1f')]();};}function saveUpdates(_0x2865e7,_0x3951d9){return function(_0x13c9b4){if(_0x13c9b4){return _0x13c9b4[_0x078f('0x20')](_0x2865e7)[_0x078f('0x21')](function(_0x1877d9){return _0x1877d9;});}return null;};}function removeEntity(_0x3af948,_0xfeefbb){return function(_0x10a87c){if(_0x10a87c){return _0x10a87c['destroy']()['then'](function(){var _0x51dea1=_0x10a87c[_0x078f('0x22')]({'plain':!![]});var _0x214dbd=_0x078f('0x23');return db[_0x078f('0x24')][_0x078f('0x25')]({'where':{'type':_0x214dbd,'resourceId':_0x51dea1['id']}})['then'](function(){return _0x10a87c;});})[_0x078f('0x21')](function(){_0x3af948[_0x078f('0x15')](0xcc)[_0x078f('0x16')]();});}};}function handleEntityNotFound(_0x162007,_0x4c4956){return function(_0x513f5f){if(!_0x513f5f){_0x162007[_0x078f('0x14')](0x194);}return _0x513f5f;};}function handleError(_0x3fa572,_0x564b92){_0x564b92=_0x564b92||0x1f4;return function(_0xa16216){logger[_0x078f('0x26')](_0xa16216['stack']);if(_0xa16216[_0x078f('0x27')]){delete _0xa16216[_0x078f('0x27')];}_0x3fa572['status'](_0x564b92)['send'](_0xa16216);};}exports[_0x078f('0x28')]=function(_0xe30a88,_0x5952ea){var _0x103f7f={},_0x292f60={},_0x40c028={'count':0x0,'rows':[]};var _0x5b4596=_['map'](db['CannedAnswer'][_0x078f('0x29')],function(_0x53b18e){return{'name':_0x53b18e['fieldName'],'type':_0x53b18e[_0x078f('0x2a')][_0x078f('0x2b')]};});_0x292f60[_0x078f('0x2c')]=_[_0x078f('0x2d')](_0x5b4596,_0x078f('0x27'));_0x292f60['query']=_[_0x078f('0x2e')](_0xe30a88[_0x078f('0x2f')]);_0x292f60[_0x078f('0x30')]=_[_0x078f('0x31')](_0x292f60[_0x078f('0x2c')],_0x292f60[_0x078f('0x2f')]);_0x103f7f[_0x078f('0x32')]=_[_0x078f('0x31')](_0x292f60[_0x078f('0x2c')],qs['fields'](_0xe30a88[_0x078f('0x2f')][_0x078f('0x33')]));_0x103f7f[_0x078f('0x32')]=_0x103f7f[_0x078f('0x32')][_0x078f('0x34')]?_0x103f7f[_0x078f('0x32')]:_0x292f60[_0x078f('0x2c')];if(!_0xe30a88['query']['hasOwnProperty'](_0x078f('0x35'))){_0x103f7f[_0x078f('0x18')]=qs['limit'](_0xe30a88[_0x078f('0x2f')][_0x078f('0x18')]);_0x103f7f[_0x078f('0x1b')]=qs[_0x078f('0x1b')](_0xe30a88['query']['offset']);}_0x103f7f[_0x078f('0x36')]=qs[_0x078f('0x37')](_0xe30a88[_0x078f('0x2f')][_0x078f('0x37')]);_0x103f7f[_0x078f('0x38')]=qs[_0x078f('0x30')](_[_0x078f('0x39')](_0xe30a88['query'],_0x292f60[_0x078f('0x30')]),_0x5b4596);if(_0xe30a88[_0x078f('0x2f')][_0x078f('0x3a')]){_0x103f7f[_0x078f('0x38')]=_[_0x078f('0x3b')](_0x103f7f[_0x078f('0x38')],{'$or':[{'key':{'$like':'%'+_0xe30a88[_0x078f('0x2f')]['filter']+'%'}},{'value':{'$like':'%'+_0xe30a88['query'][_0x078f('0x3a')]+'%'}}]});}_0x103f7f=_[_0x078f('0x3b')]({},_0x103f7f,_0xe30a88['options']);var _0x2d154d={'where':_0x103f7f['where']};return db['CannedAnswer'][_0x078f('0x1a')](_0x2d154d)[_0x078f('0x21')](function(_0x4b8ff1){_0x40c028[_0x078f('0x1a')]=_0x4b8ff1;if(_0xe30a88[_0x078f('0x2f')]['includeAll']){_0x103f7f[_0x078f('0x3c')]=[{'all':!![]}];}return db[_0x078f('0x3d')][_0x078f('0x3e')](_0x103f7f);})[_0x078f('0x21')](function(_0x44973f){_0x40c028['rows']=_0x44973f;return _0x40c028;})[_0x078f('0x21')](respondWithFilteredResult(_0x5952ea,_0x103f7f))['catch'](handleError(_0x5952ea,null));};exports[_0x078f('0x3f')]=function(_0x5bc926,_0xd92888){var _0x26a1f8={'raw':!![],'where':{'id':_0x5bc926['params']['id']}},_0xf2b449={};_0xf2b449[_0x078f('0x2c')]=_[_0x078f('0x2e')](db[_0x078f('0x3d')][_0x078f('0x29')]);_0xf2b449['query']=_[_0x078f('0x2e')](_0x5bc926[_0x078f('0x2f')]);_0xf2b449[_0x078f('0x30')]=_[_0x078f('0x31')](_0xf2b449[_0x078f('0x2c')],_0xf2b449['query']);_0x26a1f8[_0x078f('0x32')]=_[_0x078f('0x31')](_0xf2b449[_0x078f('0x2c')],qs[_0x078f('0x33')](_0x5bc926['query'][_0x078f('0x33')]));_0x26a1f8[_0x078f('0x32')]=_0x26a1f8[_0x078f('0x32')]['length']?_0x26a1f8['attributes']:_0xf2b449['model'];if(_0x5bc926[_0x078f('0x2f')]['includeAll']){_0x26a1f8[_0x078f('0x3c')]=[{'all':!![]}];}_0x26a1f8=_[_0x078f('0x3b')]({},_0x26a1f8,_0x5bc926[_0x078f('0x40')]);return db[_0x078f('0x3d')][_0x078f('0x41')](_0x26a1f8)[_0x078f('0x21')](handleEntityNotFound(_0xd92888,null))['then'](respondWithResult(_0xd92888,null))[_0x078f('0x42')](handleError(_0xd92888,null));};exports[_0x078f('0x20')]=function(_0x38c205,_0x169434){if(_0x38c205[_0x078f('0x43')]['id']){delete _0x38c205[_0x078f('0x43')]['id'];}return db[_0x078f('0x3d')]['find']({'where':{'id':_0x38c205[_0x078f('0x44')]['id']}})[_0x078f('0x21')](handleEntityNotFound(_0x169434,null))[_0x078f('0x21')](saveUpdates(_0x38c205[_0x078f('0x43')],null))[_0x078f('0x21')](respondWithResult(_0x169434,null))[_0x078f('0x42')](handleError(_0x169434,null));};exports['destroy']=function(_0x53f2a8,_0xa159a2){return db[_0x078f('0x3d')][_0x078f('0x41')]({'where':{'id':_0x53f2a8[_0x078f('0x44')]['id']}})['then'](handleEntityNotFound(_0xa159a2,null))['then'](removeEntity(_0xa159a2,null))['catch'](handleError(_0xa159a2,null));};exports['create']=function(_0x247757,_0x1fa66a){var _0x364301={'key':_0x247757['body'][_0x078f('0x2b')]};if(_0x247757[_0x078f('0x43')]['MailAccountId']){_0x364301[_0x078f('0x45')]=_0x247757[_0x078f('0x43')]['MailAccountId'];}else if(_0x247757['body'][_0x078f('0x46')]){_0x364301[_0x078f('0x46')]=_0x247757[_0x078f('0x43')]['SmsAccountId'];}else if(_0x247757[_0x078f('0x43')][_0x078f('0x47')]){_0x364301['OpenchannelAccountId']=_0x247757[_0x078f('0x43')][_0x078f('0x47')];}else if(_0x247757[_0x078f('0x43')][_0x078f('0x48')]){_0x364301[_0x078f('0x48')]=_0x247757['body'][_0x078f('0x48')];}return db[_0x078f('0x3d')][_0x078f('0x41')]({'where':_0x364301})[_0x078f('0x21')](function(_0x23a14e){if(_0x23a14e){throw new db['Sequelize'][(_0x078f('0x49'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x078f('0x3d')][_0x078f('0x4a')](_0x247757[_0x078f('0x43')]);})[_0x078f('0x21')](function(_0x918295){var _0x4eb85a=_0x247757[_0x078f('0x4b')]['get']({'plain':!![]});if(!_0x4eb85a)throw new Error(_0x078f('0x4c'));if(_0x4eb85a[_0x078f('0x4d')]===_0x078f('0x4b')){var _0x3ad67c=_0x918295[_0x078f('0x22')]({'plain':!![]});return db[_0x078f('0x4e')][_0x078f('0x41')]({'where':{'name':_0x078f('0x23'),'userProfileId':_0x4eb85a[_0x078f('0x4f')]},'raw':!![]})[_0x078f('0x21')](function(_0x1b3605){if(_0x1b3605&&_0x1b3605[_0x078f('0x50')]===0x0){return db[_0x078f('0x24')][_0x078f('0x4a')]({'name':_0x3ad67c['name'],'resourceId':_0x3ad67c['id'],'type':_0x1b3605[_0x078f('0x27')],'sectionId':_0x1b3605['id']},{})[_0x078f('0x21')](function(){return _0x918295;});}else{return _0x918295;}})['catch'](function(_0xddf7d1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xddf7d1);throw _0xddf7d1;});}return _0x918295;})[_0x078f('0x21')](respondWithResult(_0x1fa66a,0xc9))[_0x078f('0x42')](handleError(_0x1fa66a,null));};
\ No newline at end of file
+var _0x9396=['CannedAnswer','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','options','includeAll','include','findAll','rows','catch','show','params','merge','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','update','destroy','then','get','CannedAnswers','UserProfileResource','name','send','index','map'];(function(_0x435c43,_0x518e4b){var _0x44c67e=function(_0x2e0dbf){while(--_0x2e0dbf){_0x435c43['push'](_0x435c43['shift']());}};_0x44c67e(++_0x518e4b);}(_0x9396,0x144));var _0x6939=function(_0x49ad02,_0x1367dc){_0x49ad02=_0x49ad02-0x0;var _0x34506f=_0x9396[_0x49ad02];return _0x34506f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6939('0x0'));var zipdir=require(_0x6939('0x1'));var jsonpatch=require(_0x6939('0x2'));var rp=require(_0x6939('0x3'));var moment=require(_0x6939('0x4'));var BPromise=require(_0x6939('0x5'));var Mustache=require(_0x6939('0x6'));var util=require(_0x6939('0x7'));var path=require(_0x6939('0x8'));var sox=require(_0x6939('0x9'));var csv=require(_0x6939('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6939('0xb'));var _=require(_0x6939('0xc'));var squel=require('squel');var crypto=require(_0x6939('0xd'));var jsforce=require(_0x6939('0xe'));var deskjs=require(_0x6939('0xf'));var toCsv=require(_0x6939('0xa'));var querystring=require(_0x6939('0x10'));var Papa=require(_0x6939('0x11'));var Redis=require(_0x6939('0x12'));var authService=require(_0x6939('0x13'));var qs=require(_0x6939('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6939('0x15'));var logger=require(_0x6939('0x16'))(_0x6939('0x17'));var utils=require('../../config/utils');var config=require(_0x6939('0x18'));var licenseUtil=require(_0x6939('0x19'));var db=require(_0x6939('0x1a'))['db'];function respondWithStatusCode(_0x21b2db,_0xdd4cd0){_0xdd4cd0=_0xdd4cd0||0xcc;return function(_0x25e8c){if(_0x25e8c){return _0x21b2db[_0x6939('0x1b')](_0xdd4cd0);}return _0x21b2db[_0x6939('0x1c')](_0xdd4cd0)[_0x6939('0x1d')]();};}function respondWithResult(_0x1fdcb3,_0x3d2ef4){_0x3d2ef4=_0x3d2ef4||0xc8;return function(_0x2fad0b){if(_0x2fad0b){return _0x1fdcb3[_0x6939('0x1c')](_0x3d2ef4)['json'](_0x2fad0b);}};}function respondWithFilteredResult(_0x371af2,_0x3f9292){return function(_0x225905){if(_0x225905){var _0x47cac7=typeof _0x3f9292[_0x6939('0x1e')]===_0x6939('0x1f')&&typeof _0x3f9292['limit']===_0x6939('0x1f');var _0x327c6=_0x225905['count'];var _0x5832dc=_0x47cac7?0x0:_0x3f9292['offset'];var _0x6bbc4d=_0x47cac7?_0x225905[_0x6939('0x20')]:_0x3f9292[_0x6939('0x1e')]+_0x3f9292[_0x6939('0x21')];var _0x44b1f7;if(_0x6bbc4d>=_0x327c6){_0x6bbc4d=_0x327c6;_0x44b1f7=0xc8;}else{_0x44b1f7=0xce;}_0x371af2['status'](_0x44b1f7);return _0x371af2['set'](_0x6939('0x22'),_0x5832dc+'-'+_0x6bbc4d+'/'+_0x327c6)[_0x6939('0x23')](_0x225905);}return null;};}function patchUpdates(_0x4b2fcf){return function(_0x3fdc59){try{jsonpatch[_0x6939('0x24')](_0x3fdc59,_0x4b2fcf,!![]);}catch(_0x18e615){return BPromise[_0x6939('0x25')](_0x18e615);}return _0x3fdc59['save']();};}function saveUpdates(_0x3e7862,_0x45206d){return function(_0x4343a2){if(_0x4343a2){return _0x4343a2[_0x6939('0x26')](_0x3e7862)['then'](function(_0x3e99e6){return _0x3e99e6;});}return null;};}function removeEntity(_0x17c553,_0x213180){return function(_0x395133){if(_0x395133){return _0x395133[_0x6939('0x27')]()[_0x6939('0x28')](function(){var _0x27d5b3=_0x395133[_0x6939('0x29')]({'plain':!![]});var _0x2be33b=_0x6939('0x2a');return db[_0x6939('0x2b')][_0x6939('0x27')]({'where':{'type':_0x2be33b,'resourceId':_0x27d5b3['id']}})['then'](function(){return _0x395133;});})[_0x6939('0x28')](function(){_0x17c553[_0x6939('0x1c')](0xcc)[_0x6939('0x1d')]();});}};}function handleEntityNotFound(_0x3c9717,_0x385caf){return function(_0x17df41){if(!_0x17df41){_0x3c9717[_0x6939('0x1b')](0x194);}return _0x17df41;};}function handleError(_0x1b796d,_0xdb12cd){_0xdb12cd=_0xdb12cd||0x1f4;return function(_0x4fb1f7){logger['error'](_0x4fb1f7['stack']);if(_0x4fb1f7[_0x6939('0x2c')]){delete _0x4fb1f7[_0x6939('0x2c')];}_0x1b796d[_0x6939('0x1c')](_0xdb12cd)[_0x6939('0x2d')](_0x4fb1f7);};}exports[_0x6939('0x2e')]=function(_0x5750d8,_0x3f21eb){var _0x4eed6c={},_0x56a843={},_0x58234a={'count':0x0,'rows':[]};var _0x3ea729=_[_0x6939('0x2f')](db[_0x6939('0x30')][_0x6939('0x31')],function(_0x387ae8){return{'name':_0x387ae8['fieldName'],'type':_0x387ae8[_0x6939('0x32')][_0x6939('0x33')]};});_0x56a843[_0x6939('0x34')]=_['map'](_0x3ea729,_0x6939('0x2c'));_0x56a843['query']=_[_0x6939('0x35')](_0x5750d8[_0x6939('0x36')]);_0x56a843[_0x6939('0x37')]=_[_0x6939('0x38')](_0x56a843[_0x6939('0x34')],_0x56a843[_0x6939('0x36')]);_0x4eed6c['attributes']=_['intersection'](_0x56a843[_0x6939('0x34')],qs[_0x6939('0x39')](_0x5750d8[_0x6939('0x36')][_0x6939('0x39')]));_0x4eed6c[_0x6939('0x3a')]=_0x4eed6c[_0x6939('0x3a')][_0x6939('0x3b')]?_0x4eed6c[_0x6939('0x3a')]:_0x56a843[_0x6939('0x34')];if(!_0x5750d8[_0x6939('0x36')][_0x6939('0x3c')](_0x6939('0x3d'))){_0x4eed6c[_0x6939('0x21')]=qs[_0x6939('0x21')](_0x5750d8[_0x6939('0x36')][_0x6939('0x21')]);_0x4eed6c[_0x6939('0x1e')]=qs[_0x6939('0x1e')](_0x5750d8[_0x6939('0x36')][_0x6939('0x1e')]);}_0x4eed6c[_0x6939('0x3e')]=qs[_0x6939('0x3f')](_0x5750d8['query'][_0x6939('0x3f')]);_0x4eed6c['where']=qs[_0x6939('0x37')](_[_0x6939('0x40')](_0x5750d8[_0x6939('0x36')],_0x56a843[_0x6939('0x37')]),_0x3ea729);if(_0x5750d8[_0x6939('0x36')][_0x6939('0x41')]){_0x4eed6c[_0x6939('0x42')]=_['merge'](_0x4eed6c[_0x6939('0x42')],{'$or':[{'key':{'$like':'%'+_0x5750d8[_0x6939('0x36')][_0x6939('0x41')]+'%'}},{'value':{'$like':'%'+_0x5750d8[_0x6939('0x36')]['filter']+'%'}}]});}_0x4eed6c=_['merge']({},_0x4eed6c,_0x5750d8[_0x6939('0x43')]);var _0x1c6c01={'where':_0x4eed6c['where']};return db[_0x6939('0x30')][_0x6939('0x20')](_0x1c6c01)[_0x6939('0x28')](function(_0x532568){_0x58234a[_0x6939('0x20')]=_0x532568;if(_0x5750d8[_0x6939('0x36')][_0x6939('0x44')]){_0x4eed6c[_0x6939('0x45')]=[{'all':!![]}];}return db[_0x6939('0x30')][_0x6939('0x46')](_0x4eed6c);})['then'](function(_0x4254b2){_0x58234a[_0x6939('0x47')]=_0x4254b2;return _0x58234a;})['then'](respondWithFilteredResult(_0x3f21eb,_0x4eed6c))[_0x6939('0x48')](handleError(_0x3f21eb,null));};exports[_0x6939('0x49')]=function(_0x3ebb83,_0x2506a7){var _0xcfd7d2={'raw':!![],'where':{'id':_0x3ebb83[_0x6939('0x4a')]['id']}},_0x366ff3={};_0x366ff3[_0x6939('0x34')]=_[_0x6939('0x35')](db[_0x6939('0x30')][_0x6939('0x31')]);_0x366ff3['query']=_[_0x6939('0x35')](_0x3ebb83[_0x6939('0x36')]);_0x366ff3[_0x6939('0x37')]=_[_0x6939('0x38')](_0x366ff3[_0x6939('0x34')],_0x366ff3[_0x6939('0x36')]);_0xcfd7d2[_0x6939('0x3a')]=_[_0x6939('0x38')](_0x366ff3[_0x6939('0x34')],qs[_0x6939('0x39')](_0x3ebb83[_0x6939('0x36')][_0x6939('0x39')]));_0xcfd7d2[_0x6939('0x3a')]=_0xcfd7d2[_0x6939('0x3a')][_0x6939('0x3b')]?_0xcfd7d2[_0x6939('0x3a')]:_0x366ff3[_0x6939('0x34')];if(_0x3ebb83[_0x6939('0x36')]['includeAll']){_0xcfd7d2[_0x6939('0x45')]=[{'all':!![]}];}_0xcfd7d2=_[_0x6939('0x4b')]({},_0xcfd7d2,_0x3ebb83[_0x6939('0x43')]);return db[_0x6939('0x30')][_0x6939('0x4c')](_0xcfd7d2)['then'](handleEntityNotFound(_0x2506a7,null))['then'](respondWithResult(_0x2506a7,null))[_0x6939('0x48')](handleError(_0x2506a7,null));};exports[_0x6939('0x26')]=function(_0x19b107,_0x339c81){if(_0x19b107['body']['id']){delete _0x19b107[_0x6939('0x4d')]['id'];}return db['CannedAnswer'][_0x6939('0x4c')]({'where':{'id':_0x19b107['params']['id']}})[_0x6939('0x28')](handleEntityNotFound(_0x339c81,null))[_0x6939('0x28')](saveUpdates(_0x19b107[_0x6939('0x4d')],null))[_0x6939('0x28')](respondWithResult(_0x339c81,null))['catch'](handleError(_0x339c81,null));};exports[_0x6939('0x27')]=function(_0x419387,_0x368125){return db[_0x6939('0x30')][_0x6939('0x4c')]({'where':{'id':_0x419387[_0x6939('0x4a')]['id']}})[_0x6939('0x28')](handleEntityNotFound(_0x368125,null))[_0x6939('0x28')](removeEntity(_0x368125,null))['catch'](handleError(_0x368125,null));};exports[_0x6939('0x4e')]=function(_0x2ff079,_0x2c98b6){var _0x3b979d={'key':_0x2ff079[_0x6939('0x4d')][_0x6939('0x33')]};if(_0x2ff079['body'][_0x6939('0x4f')]){_0x3b979d[_0x6939('0x4f')]=_0x2ff079[_0x6939('0x4d')][_0x6939('0x4f')];}else if(_0x2ff079[_0x6939('0x4d')][_0x6939('0x50')]){_0x3b979d['SmsAccountId']=_0x2ff079[_0x6939('0x4d')]['SmsAccountId'];}else if(_0x2ff079[_0x6939('0x4d')][_0x6939('0x51')]){_0x3b979d[_0x6939('0x51')]=_0x2ff079['body'][_0x6939('0x51')];}else if(_0x2ff079[_0x6939('0x4d')][_0x6939('0x52')]){_0x3b979d['ChatWebsiteId']=_0x2ff079[_0x6939('0x4d')]['ChatWebsiteId'];}return db['CannedAnswer'][_0x6939('0x4c')]({'where':_0x3b979d})['then'](function(_0x3b0515){if(_0x3b0515){throw new db[(_0x6939('0x53'))][(_0x6939('0x54'))](_0x6939('0x55'));}return db[_0x6939('0x30')][_0x6939('0x4e')](_0x2ff079['body']);})['then'](function(_0x12f061){var _0x94876d=_0x2ff079[_0x6939('0x56')][_0x6939('0x29')]({'plain':!![]});if(!_0x94876d)throw new Error(_0x6939('0x57'));if(_0x94876d[_0x6939('0x58')]===_0x6939('0x56')){var _0x485228=_0x12f061['get']({'plain':!![]});return db[_0x6939('0x59')][_0x6939('0x4c')]({'where':{'name':_0x6939('0x2a'),'userProfileId':_0x94876d['userProfileId']},'raw':!![]})[_0x6939('0x28')](function(_0x5d27dc){if(_0x5d27dc&&_0x5d27dc[_0x6939('0x5a')]===0x0){return db[_0x6939('0x2b')][_0x6939('0x4e')]({'name':_0x485228[_0x6939('0x2c')],'resourceId':_0x485228['id'],'type':_0x5d27dc[_0x6939('0x2c')],'sectionId':_0x5d27dc['id']},{})[_0x6939('0x28')](function(){return _0x12f061;});}else{return _0x12f061;}})[_0x6939('0x48')](function(_0x3a0be0){logger[_0x6939('0x5b')](_0x6939('0x5c'),_0x3a0be0);throw _0x3a0be0;});}return _0x12f061;})[_0x6939('0x28')](respondWithResult(_0x2c98b6,0xc9))[_0x6939('0x48')](handleError(_0x2c98b6,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 782f257..46a1ab9 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 _0x6cb4=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers'];(function(_0x1f0448,_0xa2865f){var _0x16fe78=function(_0x43517b){while(--_0x43517b){_0x1f0448['push'](_0x1f0448['shift']());}};_0x16fe78(++_0xa2865f);}(_0x6cb4,0x9c));var _0x46cb=function(_0x391ebe,_0x596823){_0x391ebe=_0x391ebe-0x0;var _0x5aac03=_0x6cb4[_0x391ebe];return _0x5aac03;};'use strict';var _=require(_0x46cb('0x0'));var util=require('util');var logger=require(_0x46cb('0x1'))('api');var moment=require(_0x46cb('0x2'));var BPromise=require(_0x46cb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x46cb('0x4'));var rimraf=require(_0x46cb('0x5'));var config=require(_0x46cb('0x6'));var attributes=require(_0x46cb('0x7'));module[_0x46cb('0x8')]=function(_0x566d65,_0x372630){return _0x566d65[_0x46cb('0x9')](_0x46cb('0xa'),attributes,{'tableName':_0x46cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x46cb('0xc'),'collate':_0x46cb('0xd')});};
\ No newline at end of file
+var _0x6d1d=['define','tools_canned_answers','utf8mb4','util','../../config/logger','api','request-promise','path','rimraf','./cannedAnswer.attributes','exports'];(function(_0x2c4d46,_0x2bbf7f){var _0x2573dd=function(_0x570669){while(--_0x570669){_0x2c4d46['push'](_0x2c4d46['shift']());}};_0x2573dd(++_0x2bbf7f);}(_0x6d1d,0x19a));var _0xd6d1=function(_0x168ad0,_0x45e98b){_0x168ad0=_0x168ad0-0x0;var _0x3596fc=_0x6d1d[_0x168ad0];return _0x3596fc;};'use strict';var _=require('lodash');var util=require(_0xd6d1('0x0'));var logger=require(_0xd6d1('0x1'))(_0xd6d1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd6d1('0x3'));var fs=require('fs');var path=require(_0xd6d1('0x4'));var rimraf=require(_0xd6d1('0x5'));var config=require('../../config/environment');var attributes=require(_0xd6d1('0x6'));module[_0xd6d1('0x7')]=function(_0x56dd60,_0x338bd9){return _0x56dd60[_0xd6d1('0x8')]('CannedAnswer',attributes,{'tableName':_0xd6d1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd6d1('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 240521a..48a4428 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(_0x4b7204,_0x1081df){var _0x1ea9b7=function(_0x153741){while(--_0x153741){_0x4b7204['push'](_0x4b7204['shift']());}};_0x1ea9b7(++_0x1081df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+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(_0x29c139,_0x1510dd){var _0x57f226=function(_0x16d4c2){while(--_0x16d4c2){_0x29c139['push'](_0x29c139['shift']());}};_0x57f226(++_0x1510dd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 a9cceb6..7db27cf 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 _0x3eac=['update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','put'];(function(_0x1e4713,_0x558735){var _0x5cddcb=function(_0x14a8c5){while(--_0x14a8c5){_0x1e4713['push'](_0x1e4713['shift']());}};_0x5cddcb(++_0x558735);}(_0x3eac,0xb4));var _0xc3ea=function(_0x4b6778,_0x505a76){_0x4b6778=_0x4b6778-0x0;var _0x22dbb9=_0x3eac[_0x4b6778];return _0x22dbb9;};'use strict';var multer=require(_0xc3ea('0x0'));var util=require('util');var path=require(_0xc3ea('0x1'));var timeout=require(_0xc3ea('0x2'));var express=require(_0xc3ea('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc3ea('0x4'));var config=require(_0xc3ea('0x5'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xc3ea('0x6')](),controller[_0xc3ea('0x7')]);router[_0xc3ea('0x8')](_0xc3ea('0x9'),auth[_0xc3ea('0x6')](),controller[_0xc3ea('0xa')]);router['post']('/',auth[_0xc3ea('0x6')](),controller['create']);router[_0xc3ea('0xb')](_0xc3ea('0x9'),auth[_0xc3ea('0x6')](),controller[_0xc3ea('0xc')]);router[_0xc3ea('0xd')](_0xc3ea('0x9'),auth[_0xc3ea('0x6')](),controller[_0xc3ea('0xe')]);module[_0xc3ea('0xf')]=router;
\ No newline at end of file
+var _0x61bc=['show','post','put','update','delete','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','/:id'];(function(_0x8885cb,_0x3f000e){var _0x25ba05=function(_0xb10e25){while(--_0xb10e25){_0x8885cb['push'](_0x8885cb['shift']());}};_0x25ba05(++_0x3f000e);}(_0x61bc,0x67));var _0xc61b=function(_0x13a973,_0xacdf00){_0x13a973=_0x13a973-0x0;var _0x115e08=_0x61bc[_0x13a973];return _0x115e08;};'use strict';var multer=require(_0xc61b('0x0'));var util=require('util');var path=require(_0xc61b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc61b('0x2')]();var fs_extra=require(_0xc61b('0x3'));var auth=require(_0xc61b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc61b('0x5'));var controller=require(_0xc61b('0x6'));router['get']('/',auth[_0xc61b('0x7')](),controller['index']);router['get'](_0xc61b('0x8'),auth[_0xc61b('0x7')](),controller[_0xc61b('0x9')]);router[_0xc61b('0xa')]('/',auth[_0xc61b('0x7')](),controller['create']);router[_0xc61b('0xb')](_0xc61b('0x8'),auth[_0xc61b('0x7')](),controller[_0xc61b('0xc')]);router[_0xc61b('0xd')](_0xc61b('0x8'),auth[_0xc61b('0x7')](),controller['destroy']);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 04c5cf3..c314cd4 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 _0xa0bc=['STRING','INTEGER','exports','DATE'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xca0b('0x0')]={'calldate':{'type':Sequelize[_0xca0b('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xca0b('0x2')]},'src':{'type':Sequelize[_0xca0b('0x2')]},'dst':{'type':Sequelize[_0xca0b('0x2')]},'dcontext':{'type':Sequelize[_0xca0b('0x2')]},'channel':{'type':Sequelize[_0xca0b('0x2')]},'dstchannel':{'type':Sequelize[_0xca0b('0x2')]},'lastapp':{'type':Sequelize[_0xca0b('0x2')]},'lastdata':{'type':Sequelize[_0xca0b('0x2')]},'duration':{'type':Sequelize[_0xca0b('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xca0b('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xca0b('0x2')]},'amaflags':{'type':Sequelize[_0xca0b('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xca0b('0x2')]},'userfield':{'type':Sequelize[_0xca0b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xca0b('0x2')]},'sequence':{'type':Sequelize[_0xca0b('0x2')]},'peeraccount':{'type':Sequelize[_0xca0b('0x2')]},'type':{'type':Sequelize[_0xca0b('0x2')]},'tag':{'type':Sequelize[_0xca0b('0x2')]}};
\ No newline at end of file
+var _0x4c48=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x35ffbd,_0x228fe3){var _0x4f9bf4=function(_0x57fc6a){while(--_0x57fc6a){_0x35ffbd['push'](_0x35ffbd['shift']());}};_0x4f9bf4(++_0x228fe3);}(_0x4c48,0x1e4));var _0x84c4=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x4c48[_0x47b58b];return _0x46bebe;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x84c4('0x0')],'allowNull':![],'defaultValue':_0x84c4('0x1')},'clid':{'type':Sequelize[_0x84c4('0x2')]},'src':{'type':Sequelize[_0x84c4('0x2')]},'dst':{'type':Sequelize[_0x84c4('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x84c4('0x2')]},'lastapp':{'type':Sequelize[_0x84c4('0x2')]},'lastdata':{'type':Sequelize[_0x84c4('0x2')]},'duration':{'type':Sequelize[_0x84c4('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x84c4('0x2')]},'amaflags':{'type':Sequelize[_0x84c4('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x84c4('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x84c4('0x2')]},'peeraccount':{'type':Sequelize[_0x84c4('0x2')]},'type':{'type':Sequelize[_0x84c4('0x2')]},'tag':{'type':Sequelize[_0x84c4('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 8db855d..ffc2f08 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 _0xd6d6=['key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','Cdr','rawAttributes','fieldName','type'];(function(_0x5800e9,_0xa9ef46){var _0x193060=function(_0x1ff026){while(--_0x1ff026){_0x5800e9['push'](_0x5800e9['shift']());}};_0x193060(++_0xa9ef46);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x3878a0,_0x3a3d86){_0x3878a0=_0x3878a0-0x0;var _0x3cb4a4=_0xd6d6[_0x3878a0];return _0x3cb4a4;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];function respondWithStatusCode(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xcc;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0x19')](_0xe61c36);}return _0x32146d[_0x6d6d('0x1a')](_0xe61c36)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0xc8;return function(_0xd09ea7){if(_0xd09ea7){return _0x2cb2dd[_0x6d6d('0x1a')](_0x5f4154)[_0x6d6d('0x1c')](_0xd09ea7);}};}function respondWithFilteredResult(_0xa3b05d,_0x29cbd8){return function(_0x5d80c0){if(_0x5d80c0){var _0x2e6fdb=typeof _0x29cbd8['offset']===_0x6d6d('0x1d')&&typeof _0x29cbd8[_0x6d6d('0x1e')]===_0x6d6d('0x1d');var _0x4bb3d1=_0x5d80c0['count'];var _0x9e1e18=_0x2e6fdb?0x0:_0x29cbd8[_0x6d6d('0x1f')];var _0x2b59d4=_0x2e6fdb?_0x5d80c0[_0x6d6d('0x20')]:_0x29cbd8['offset']+_0x29cbd8['limit'];var _0x474873;if(_0x2b59d4>=_0x4bb3d1){_0x2b59d4=_0x4bb3d1;_0x474873=0xc8;}else{_0x474873=0xce;}_0xa3b05d['status'](_0x474873);return _0xa3b05d[_0x6d6d('0x21')](_0x6d6d('0x22'),_0x9e1e18+'-'+_0x2b59d4+'/'+_0x4bb3d1)[_0x6d6d('0x1c')](_0x5d80c0);}return null;};}function patchUpdates(_0x450352){return function(_0x40d35b){try{jsonpatch[_0x6d6d('0x23')](_0x40d35b,_0x450352,!![]);}catch(_0x164c67){return BPromise[_0x6d6d('0x24')](_0x164c67);}return _0x40d35b[_0x6d6d('0x25')]();};}function saveUpdates(_0x6f64e3,_0x24b10d){return function(_0x6e58e3){if(_0x6e58e3){return _0x6e58e3[_0x6d6d('0x26')](_0x6f64e3)[_0x6d6d('0x27')](function(_0x1f7f88){return _0x1f7f88;});}return null;};}function removeEntity(_0x25a02e,_0xced622){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(){_0x25a02e[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0xf0df7f,_0x12fab2){return function(_0x554f8e){if(!_0x554f8e){_0xf0df7f[_0x6d6d('0x19')](0x194);}return _0x554f8e;};}function handleError(_0x2b5e31,_0x235451){_0x235451=_0x235451||0x1f4;return function(_0x126ac8){logger[_0x6d6d('0x29')](_0x126ac8[_0x6d6d('0x2a')]);if(_0x126ac8[_0x6d6d('0x2b')]){delete _0x126ac8['name'];}_0x2b5e31[_0x6d6d('0x1a')](_0x235451)[_0x6d6d('0x2c')](_0x126ac8);};}exports['index']=function(_0x553645,_0x3edcce){var _0x5273cd={},_0x8a9a84={},_0x57341f={'count':0x0,'rows':[]};var _0xde3272=_[_0x6d6d('0x2d')](db[_0x6d6d('0x2e')][_0x6d6d('0x2f')],function(_0x64d1f7){return{'name':_0x64d1f7[_0x6d6d('0x30')],'type':_0x64d1f7[_0x6d6d('0x31')][_0x6d6d('0x32')]};});_0x8a9a84[_0x6d6d('0x33')]=_[_0x6d6d('0x2d')](_0xde3272,'name');_0x8a9a84[_0x6d6d('0x34')]=_['keys'](_0x553645[_0x6d6d('0x34')]);_0x8a9a84[_0x6d6d('0x35')]=_[_0x6d6d('0x36')](_0x8a9a84[_0x6d6d('0x33')],_0x8a9a84['query']);_0x5273cd[_0x6d6d('0x37')]=_['intersection'](_0x8a9a84[_0x6d6d('0x33')],qs[_0x6d6d('0x38')](_0x553645['query'][_0x6d6d('0x38')]));_0x5273cd[_0x6d6d('0x37')]=_0x5273cd[_0x6d6d('0x37')][_0x6d6d('0x39')]?_0x5273cd[_0x6d6d('0x37')]:_0x8a9a84[_0x6d6d('0x33')];if(!_0x553645[_0x6d6d('0x34')][_0x6d6d('0x3a')](_0x6d6d('0x3b'))){_0x5273cd[_0x6d6d('0x1e')]=qs[_0x6d6d('0x1e')](_0x553645[_0x6d6d('0x34')][_0x6d6d('0x1e')]);_0x5273cd[_0x6d6d('0x1f')]=qs['offset'](_0x553645[_0x6d6d('0x34')][_0x6d6d('0x1f')]);}_0x5273cd[_0x6d6d('0x3c')]=qs[_0x6d6d('0x3d')](_0x553645['query']['sort']);_0x5273cd[_0x6d6d('0x3e')]=qs[_0x6d6d('0x35')](_[_0x6d6d('0x3f')](_0x553645['query'],_0x8a9a84[_0x6d6d('0x35')]),_0xde3272);if(_0x553645[_0x6d6d('0x34')][_0x6d6d('0x40')]){_0x5273cd[_0x6d6d('0x3e')]=_['merge'](_0x5273cd['where'],{'$or':_['map'](_0xde3272,function(_0x62620d){if(_0x62620d[_0x6d6d('0x31')]!==_0x6d6d('0x41')){var _0x22a49a={};_0x22a49a[_0x62620d['name']]={'$like':'%'+_0x553645[_0x6d6d('0x34')][_0x6d6d('0x40')]+'%'};return _0x22a49a;}})});}_0x5273cd=_[_0x6d6d('0x42')]({},_0x5273cd,_0x553645[_0x6d6d('0x43')]);var _0x3d632c={'where':_0x5273cd[_0x6d6d('0x3e')]};return db['Cdr'][_0x6d6d('0x20')](_0x3d632c)[_0x6d6d('0x27')](function(_0x42aff0){_0x57341f[_0x6d6d('0x20')]=_0x42aff0;if(_0x553645[_0x6d6d('0x34')][_0x6d6d('0x44')]){_0x5273cd[_0x6d6d('0x45')]=[{'all':!![]}];}return db['Cdr'][_0x6d6d('0x46')](_0x5273cd);})[_0x6d6d('0x27')](function(_0x16e177){_0x57341f[_0x6d6d('0x47')]=_0x16e177;return _0x57341f;})[_0x6d6d('0x27')](respondWithFilteredResult(_0x3edcce,_0x5273cd))['catch'](handleError(_0x3edcce,null));};exports[_0x6d6d('0x48')]=function(_0x39f2a9,_0x55dba8){var _0x452de2={'raw':!![],'where':{'id':_0x39f2a9[_0x6d6d('0x49')]['id']}},_0x50dc17={};_0x50dc17[_0x6d6d('0x33')]=_['keys'](db[_0x6d6d('0x2e')][_0x6d6d('0x2f')]);_0x50dc17[_0x6d6d('0x34')]=_[_0x6d6d('0x4a')](_0x39f2a9[_0x6d6d('0x34')]);_0x50dc17['filters']=_['intersection'](_0x50dc17[_0x6d6d('0x33')],_0x50dc17['query']);_0x452de2['attributes']=_[_0x6d6d('0x36')](_0x50dc17[_0x6d6d('0x33')],qs[_0x6d6d('0x38')](_0x39f2a9['query'][_0x6d6d('0x38')]));_0x452de2['attributes']=_0x452de2[_0x6d6d('0x37')][_0x6d6d('0x39')]?_0x452de2[_0x6d6d('0x37')]:_0x50dc17[_0x6d6d('0x33')];if(_0x39f2a9[_0x6d6d('0x34')][_0x6d6d('0x44')]){_0x452de2[_0x6d6d('0x45')]=[{'all':!![]}];}_0x452de2=_['merge']({},_0x452de2,_0x39f2a9[_0x6d6d('0x43')]);return db[_0x6d6d('0x2e')][_0x6d6d('0x4b')](_0x452de2)[_0x6d6d('0x27')](handleEntityNotFound(_0x55dba8,null))[_0x6d6d('0x27')](respondWithResult(_0x55dba8,null))[_0x6d6d('0x4c')](handleError(_0x55dba8,null));};exports[_0x6d6d('0x4d')]=function(_0x1d2b20,_0x24cec2){return db['Cdr']['create'](_0x1d2b20[_0x6d6d('0x4e')],{})[_0x6d6d('0x27')](respondWithResult(_0x24cec2,0xc9))[_0x6d6d('0x4c')](handleError(_0x24cec2,null));};exports[_0x6d6d('0x26')]=function(_0xe2a20e,_0x492834){if(_0xe2a20e[_0x6d6d('0x4e')]['id']){delete _0xe2a20e[_0x6d6d('0x4e')]['id'];}return db[_0x6d6d('0x2e')][_0x6d6d('0x4b')]({'where':{'id':_0xe2a20e[_0x6d6d('0x49')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x492834,null))[_0x6d6d('0x27')](saveUpdates(_0xe2a20e[_0x6d6d('0x4e')],null))[_0x6d6d('0x27')](respondWithResult(_0x492834,null))[_0x6d6d('0x4c')](handleError(_0x492834,null));};exports[_0x6d6d('0x28')]=function(_0x175e26,_0x4d9811){return db[_0x6d6d('0x2e')][_0x6d6d('0x4b')]({'where':{'id':_0x175e26[_0x6d6d('0x49')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x4d9811,null))[_0x6d6d('0x27')](removeEntity(_0x4d9811,null))['catch'](handleError(_0x4d9811,null));};exports[_0x6d6d('0x4f')]=function(_0x36bc5a,_0x45340b){return db['Cdr']['describe']()[_0x6d6d('0x27')](respondWithResult(_0x45340b,null))['catch'](handleError(_0x45340b,null));};
\ No newline at end of file
+var _0x6334=['ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','undefined','limit','count','offset','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','Cdr','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','filter','include','findAll','catch','show','params','length','includeAll','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv'];(function(_0x1291b3,_0x54cc6b){var _0x48645f=function(_0x16c9b6){while(--_0x16c9b6){_0x1291b3['push'](_0x1291b3['shift']());}};_0x48645f(++_0x54cc6b);}(_0x6334,0x119));var _0x4633=function(_0x31cb77,_0x348021){_0x31cb77=_0x31cb77-0x0;var _0x710374=_0x6334[_0x31cb77];return _0x710374;};'use strict';var emlformat=require(_0x4633('0x0'));var rimraf=require(_0x4633('0x1'));var zipdir=require(_0x4633('0x2'));var jsonpatch=require(_0x4633('0x3'));var rp=require(_0x4633('0x4'));var moment=require(_0x4633('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4633('0x6'));var util=require(_0x4633('0x7'));var path=require(_0x4633('0x8'));var sox=require(_0x4633('0x9'));var csv=require(_0x4633('0xa'));var ejs=require(_0x4633('0xb'));var fs=require('fs');var fs_extra=require(_0x4633('0xc'));var _=require('lodash');var squel=require(_0x4633('0xd'));var crypto=require('crypto');var jsforce=require(_0x4633('0xe'));var deskjs=require(_0x4633('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4633('0x10'));var Papa=require(_0x4633('0x11'));var Redis=require(_0x4633('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4633('0x13'));var as=require(_0x4633('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4633('0x15'))(_0x4633('0x16'));var utils=require(_0x4633('0x17'));var config=require(_0x4633('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4633('0x19'))['db'];function respondWithStatusCode(_0xad405,_0x438e87){_0x438e87=_0x438e87||0xcc;return function(_0x48e92c){if(_0x48e92c){return _0xad405['sendStatus'](_0x438e87);}return _0xad405['status'](_0x438e87)[_0x4633('0x1a')]();};}function respondWithResult(_0x1fd00c,_0x579229){_0x579229=_0x579229||0xc8;return function(_0x52955e){if(_0x52955e){return _0x1fd00c[_0x4633('0x1b')](_0x579229)['json'](_0x52955e);}};}function respondWithFilteredResult(_0xcdffcc,_0x33b6e7){return function(_0x2e2dc3){if(_0x2e2dc3){var _0x11fef9=typeof _0x33b6e7['offset']===_0x4633('0x1c')&&typeof _0x33b6e7[_0x4633('0x1d')]===_0x4633('0x1c');var _0x4ffad5=_0x2e2dc3[_0x4633('0x1e')];var _0x37e536=_0x11fef9?0x0:_0x33b6e7[_0x4633('0x1f')];var _0x2ad562=_0x11fef9?_0x2e2dc3[_0x4633('0x1e')]:_0x33b6e7['offset']+_0x33b6e7[_0x4633('0x1d')];var _0xfe3446;if(_0x2ad562>=_0x4ffad5){_0x2ad562=_0x4ffad5;_0xfe3446=0xc8;}else{_0xfe3446=0xce;}_0xcdffcc['status'](_0xfe3446);return _0xcdffcc['set'](_0x4633('0x20'),_0x37e536+'-'+_0x2ad562+'/'+_0x4ffad5)['json'](_0x2e2dc3);}return null;};}function patchUpdates(_0x35e2ad){return function(_0x5b5011){try{jsonpatch['apply'](_0x5b5011,_0x35e2ad,!![]);}catch(_0x109472){return BPromise[_0x4633('0x21')](_0x109472);}return _0x5b5011[_0x4633('0x22')]();};}function saveUpdates(_0x604f3d,_0xd1fcc6){return function(_0x2d46f7){if(_0x2d46f7){return _0x2d46f7['update'](_0x604f3d)[_0x4633('0x23')](function(_0x562e26){return _0x562e26;});}return null;};}function removeEntity(_0x22d9c1,_0xcfac3f){return function(_0xe77cfc){if(_0xe77cfc){return _0xe77cfc[_0x4633('0x24')]()[_0x4633('0x23')](function(){_0x22d9c1['status'](0xcc)[_0x4633('0x1a')]();});}};}function handleEntityNotFound(_0x399220,_0x37e3c4){return function(_0x13ec10){if(!_0x13ec10){_0x399220[_0x4633('0x25')](0x194);}return _0x13ec10;};}function handleError(_0x471d13,_0x1ba1ed){_0x1ba1ed=_0x1ba1ed||0x1f4;return function(_0x368582){logger[_0x4633('0x26')](_0x368582[_0x4633('0x27')]);if(_0x368582[_0x4633('0x28')]){delete _0x368582[_0x4633('0x28')];}_0x471d13[_0x4633('0x1b')](_0x1ba1ed)[_0x4633('0x29')](_0x368582);};}exports[_0x4633('0x2a')]=function(_0x3f03aa,_0x20ca8b){var _0x139e5e={},_0x5de12a={},_0x197aa6={'count':0x0,'rows':[]};var _0x101371=_[_0x4633('0x2b')](db[_0x4633('0x2c')][_0x4633('0x2d')],function(_0x182e12){return{'name':_0x182e12['fieldName'],'type':_0x182e12[_0x4633('0x2e')]['key']};});_0x5de12a[_0x4633('0x2f')]=_[_0x4633('0x2b')](_0x101371,_0x4633('0x28'));_0x5de12a[_0x4633('0x30')]=_[_0x4633('0x31')](_0x3f03aa[_0x4633('0x30')]);_0x5de12a[_0x4633('0x32')]=_[_0x4633('0x33')](_0x5de12a[_0x4633('0x2f')],_0x5de12a[_0x4633('0x30')]);_0x139e5e[_0x4633('0x34')]=_[_0x4633('0x33')](_0x5de12a[_0x4633('0x2f')],qs[_0x4633('0x35')](_0x3f03aa['query']['fields']));_0x139e5e[_0x4633('0x34')]=_0x139e5e[_0x4633('0x34')]['length']?_0x139e5e[_0x4633('0x34')]:_0x5de12a[_0x4633('0x2f')];if(!_0x3f03aa[_0x4633('0x30')][_0x4633('0x36')]('nolimit')){_0x139e5e[_0x4633('0x1d')]=qs['limit'](_0x3f03aa[_0x4633('0x30')][_0x4633('0x1d')]);_0x139e5e[_0x4633('0x1f')]=qs[_0x4633('0x1f')](_0x3f03aa[_0x4633('0x30')][_0x4633('0x1f')]);}_0x139e5e[_0x4633('0x37')]=qs[_0x4633('0x38')](_0x3f03aa['query'][_0x4633('0x38')]);_0x139e5e[_0x4633('0x39')]=qs['filters'](_[_0x4633('0x3a')](_0x3f03aa[_0x4633('0x30')],_0x5de12a[_0x4633('0x32')]),_0x101371);if(_0x3f03aa[_0x4633('0x30')]['filter']){_0x139e5e['where']=_[_0x4633('0x3b')](_0x139e5e['where'],{'$or':_['map'](_0x101371,function(_0x464533){if(_0x464533['type']!=='VIRTUAL'){var _0x1aaf65={};_0x1aaf65[_0x464533[_0x4633('0x28')]]={'$like':'%'+_0x3f03aa[_0x4633('0x30')][_0x4633('0x3c')]+'%'};return _0x1aaf65;}})});}_0x139e5e=_[_0x4633('0x3b')]({},_0x139e5e,_0x3f03aa['options']);var _0x6873d0={'where':_0x139e5e['where']};return db[_0x4633('0x2c')][_0x4633('0x1e')](_0x6873d0)[_0x4633('0x23')](function(_0x402708){_0x197aa6['count']=_0x402708;if(_0x3f03aa[_0x4633('0x30')]['includeAll']){_0x139e5e[_0x4633('0x3d')]=[{'all':!![]}];}return db[_0x4633('0x2c')][_0x4633('0x3e')](_0x139e5e);})[_0x4633('0x23')](function(_0x350e46){_0x197aa6['rows']=_0x350e46;return _0x197aa6;})['then'](respondWithFilteredResult(_0x20ca8b,_0x139e5e))[_0x4633('0x3f')](handleError(_0x20ca8b,null));};exports[_0x4633('0x40')]=function(_0x8b0d9,_0xf51de3){var _0x45fe39={'raw':!![],'where':{'id':_0x8b0d9[_0x4633('0x41')]['id']}},_0x53669c={};_0x53669c['model']=_[_0x4633('0x31')](db['Cdr'][_0x4633('0x2d')]);_0x53669c['query']=_[_0x4633('0x31')](_0x8b0d9[_0x4633('0x30')]);_0x53669c[_0x4633('0x32')]=_[_0x4633('0x33')](_0x53669c[_0x4633('0x2f')],_0x53669c[_0x4633('0x30')]);_0x45fe39[_0x4633('0x34')]=_[_0x4633('0x33')](_0x53669c[_0x4633('0x2f')],qs[_0x4633('0x35')](_0x8b0d9[_0x4633('0x30')][_0x4633('0x35')]));_0x45fe39[_0x4633('0x34')]=_0x45fe39[_0x4633('0x34')][_0x4633('0x42')]?_0x45fe39[_0x4633('0x34')]:_0x53669c[_0x4633('0x2f')];if(_0x8b0d9[_0x4633('0x30')][_0x4633('0x43')]){_0x45fe39[_0x4633('0x3d')]=[{'all':!![]}];}_0x45fe39=_[_0x4633('0x3b')]({},_0x45fe39,_0x8b0d9['options']);return db['Cdr'][_0x4633('0x44')](_0x45fe39)['then'](handleEntityNotFound(_0xf51de3,null))['then'](respondWithResult(_0xf51de3,null))['catch'](handleError(_0xf51de3,null));};exports[_0x4633('0x45')]=function(_0x5dec28,_0x5cb4cc){return db[_0x4633('0x2c')][_0x4633('0x45')](_0x5dec28[_0x4633('0x46')],{})[_0x4633('0x23')](respondWithResult(_0x5cb4cc,0xc9))[_0x4633('0x3f')](handleError(_0x5cb4cc,null));};exports[_0x4633('0x47')]=function(_0x4d3cf4,_0x4ca3d6){if(_0x4d3cf4['body']['id']){delete _0x4d3cf4[_0x4633('0x46')]['id'];}return db[_0x4633('0x2c')][_0x4633('0x44')]({'where':{'id':_0x4d3cf4['params']['id']}})[_0x4633('0x23')](handleEntityNotFound(_0x4ca3d6,null))[_0x4633('0x23')](saveUpdates(_0x4d3cf4['body'],null))[_0x4633('0x23')](respondWithResult(_0x4ca3d6,null))[_0x4633('0x3f')](handleError(_0x4ca3d6,null));};exports[_0x4633('0x24')]=function(_0x4c5367,_0x47e03a){return db[_0x4633('0x2c')][_0x4633('0x44')]({'where':{'id':_0x4c5367[_0x4633('0x41')]['id']}})[_0x4633('0x23')](handleEntityNotFound(_0x47e03a,null))[_0x4633('0x23')](removeEntity(_0x47e03a,null))['catch'](handleError(_0x47e03a,null));};exports[_0x4633('0x48')]=function(_0xf812ca,_0x2108b3){return db[_0x4633('0x2c')][_0x4633('0x48')]()[_0x4633('0x23')](respondWithResult(_0x2108b3,null))['catch'](handleError(_0x2108b3,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 7f4b328..1e8c125 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(_0x50fb4e,_0x39559b){var _0x3bf8ba=function(_0x25a45b){while(--_0x25a45b){_0x50fb4e['push'](_0x50fb4e['shift']());}};_0x3bf8ba(++_0x39559b);}(_0x7a54,0x106));var _0x47a5=function(_0x45149f,_0x2ee534){_0x45149f=_0x45149f-0x0;var _0x473c1b=_0x7a54[_0x45149f];return _0x473c1b;};'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(_0x164858,_0x12f17c){var _0x205462=function(_0x43cc9e){while(--_0x43cc9e){_0x164858['push'](_0x164858['shift']());}};_0x205462(++_0x12f17c);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 5fbe3bf..6938f79 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 _0xc118=['code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x42e3e1,_0x1d45af){var _0x211a2b=function(_0x3ea9b4){while(--_0x3ea9b4){_0x42e3e1['push'](_0x42e3e1['shift']());}};_0x211a2b(++_0x1d45af);}(_0xc118,0x18a));var _0x8c11=function(_0x4d00be,_0x1315c2){_0x4d00be=_0x4d00be-0x0;var _0x4f26fa=_0xc118[_0x4d00be];return _0x4f26fa;};'use strict';var _=require('lodash');var util=require(_0x8c11('0x0'));var moment=require(_0x8c11('0x1'));var BPromise=require(_0x8c11('0x2'));var rs=require(_0x8c11('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c11('0x4'))['db'];var utils=require(_0x8c11('0x5'));var logger=require('../../config/logger')(_0x8c11('0x6'));var config=require(_0x8c11('0x7'));var jayson=require(_0x8c11('0x8'));var client=jayson[_0x8c11('0x9')][_0x8c11('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11e4f7,_0x36289c,_0x9bc943){return new BPromise(function(_0x3e93ce,_0x59f01f){return client[_0x8c11('0xb')](_0x11e4f7,_0x9bc943)[_0x8c11('0xc')](function(_0x4cc773){logger[_0x8c11('0xd')](_0x8c11('0xe'),_0x36289c,_0x8c11('0xf'));logger[_0x8c11('0x10')](_0x8c11('0x11'),_0x36289c,_0x8c11('0xf'),JSON[_0x8c11('0x12')](_0x4cc773));if(_0x4cc773[_0x8c11('0x13')]){if(_0x4cc773['error'][_0x8c11('0x14')]===0x1f4){logger[_0x8c11('0x13')](_0x8c11('0xe'),_0x36289c,_0x4cc773['error'][_0x8c11('0x15')]);return _0x59f01f(_0x4cc773['error'][_0x8c11('0x15')]);}logger[_0x8c11('0x13')](_0x8c11('0xe'),_0x36289c,_0x4cc773['error'][_0x8c11('0x15')]);return _0x3e93ce(_0x4cc773[_0x8c11('0x13')][_0x8c11('0x15')]);}else{logger[_0x8c11('0xd')](_0x8c11('0xe'),_0x36289c,_0x8c11('0xf'));_0x3e93ce(_0x4cc773[_0x8c11('0x16')][_0x8c11('0x15')]);}})['catch'](function(_0x3ac5ad){logger[_0x8c11('0x13')](_0x8c11('0xe'),_0x36289c,_0x3ac5ad);_0x59f01f(_0x3ac5ad);});});}
\ No newline at end of file
+var _0x8c12=['error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8c12,0xf6));var _0x28c1=function(_0x5798b3,_0x2ea26f){_0x5798b3=_0x5798b3-0x0;var _0x18e3c4=_0x8c12[_0x5798b3];return _0x18e3c4;};'use strict';var _=require(_0x28c1('0x0'));var util=require(_0x28c1('0x1'));var moment=require(_0x28c1('0x2'));var BPromise=require(_0x28c1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x28c1('0x4'));var db=require(_0x28c1('0x5'))['db'];var utils=require(_0x28c1('0x6'));var logger=require(_0x28c1('0x7'))(_0x28c1('0x8'));var config=require(_0x28c1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x28c1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf09566,_0x19074a,_0x226fc1){return new BPromise(function(_0xdb0dff,_0x333898){return client[_0x28c1('0xb')](_0xf09566,_0x226fc1)[_0x28c1('0xc')](function(_0x5a41a1){logger[_0x28c1('0xd')](_0x28c1('0xe'),_0x19074a,_0x28c1('0xf'));logger['debug'](_0x28c1('0x10'),_0x19074a,_0x28c1('0xf'),JSON[_0x28c1('0x11')](_0x5a41a1));if(_0x5a41a1[_0x28c1('0x12')]){if(_0x5a41a1['error']['code']===0x1f4){logger[_0x28c1('0x12')](_0x28c1('0xe'),_0x19074a,_0x5a41a1[_0x28c1('0x12')]['message']);return _0x333898(_0x5a41a1[_0x28c1('0x12')][_0x28c1('0x13')]);}logger['error'](_0x28c1('0xe'),_0x19074a,_0x5a41a1[_0x28c1('0x12')][_0x28c1('0x13')]);return _0xdb0dff(_0x5a41a1['error']['message']);}else{logger[_0x28c1('0xd')]('Cdr,\x20%s,\x20%s',_0x19074a,_0x28c1('0xf'));_0xdb0dff(_0x5a41a1[_0x28c1('0x14')]['message']);}})[_0x28c1('0x15')](function(_0x67f14d){logger[_0x28c1('0x12')](_0x28c1('0xe'),_0x19074a,_0x67f14d);_0x333898(_0x67f14d);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 378eac7..9302ce9 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x413838,_0x405f52){var _0x4ec54a=function(_0x568563){while(--_0x568563){_0x413838['push'](_0x413838['shift']());}};_0x4ec54a(++_0x405f52);}(_0xb10b,0x12a));var _0xbb10=function(_0x25f39c,_0x4f231a){_0x25f39c=_0x25f39c-0x0;var _0x19bb4a=_0xb10b[_0x25f39c];return _0x19bb4a;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index fd0ab06..dc50041 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 _0x2693=['exports','STRING','TEXT','sequelize'];(function(_0x33aefe,_0x371ccd){var _0x471d19=function(_0x566c26){while(--_0x566c26){_0x33aefe['push'](_0x33aefe['shift']());}};_0x471d19(++_0x371ccd);}(_0x2693,0x1ef));var _0x3269=function(_0x31571c,_0x1e9e35){_0x31571c=_0x31571c-0x0;var _0x410db2=_0x2693[_0x31571c];return _0x410db2;};'use strict';var Sequelize=require(_0x3269('0x0'));module[_0x3269('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x3269('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x3269('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3269('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x967b=['sequelize','exports','STRING','TEXT','*,*,*,*'];(function(_0xda193c,_0x146013){var _0x29b9fe=function(_0x499a95){while(--_0x499a95){_0xda193c['push'](_0xda193c['shift']());}};_0x29b9fe(++_0x146013);}(_0x967b,0x1ea));var _0xb967=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x967b[_0x3fba9f];return _0x192cf1;};'use strict';var Sequelize=require(_0xb967('0x0'));module[_0xb967('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb967('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb967('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb967('0x2')],'defaultValue':_0xb967('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 8851295..0b8eb79 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 _0x0e0f=['error','stack','name','send','show','model','ChatApplication','query','keys','filters','attributes','intersection','fields','includeAll','include','options','catch','update','body','find','params','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','sendStatus','status','undefined','limit','offset','save','then','destroy','end'];(function(_0x4beb44,_0x45c192){var _0x150dc0=function(_0x2ed5f5){while(--_0x2ed5f5){_0x4beb44['push'](_0x4beb44['shift']());}};_0x150dc0(++_0x45c192);}(_0x0e0f,0xe5));var _0xf0e0=function(_0x446122,_0x2210aa){_0x446122=_0x446122-0x0;var _0x4410c3=_0x0e0f[_0x446122];return _0x4410c3;};'use strict';var emlformat=require(_0xf0e0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf0e0('0x1'));var rp=require(_0xf0e0('0x2'));var moment=require(_0xf0e0('0x3'));var BPromise=require(_0xf0e0('0x4'));var Mustache=require(_0xf0e0('0x5'));var util=require('util');var path=require(_0xf0e0('0x6'));var sox=require(_0xf0e0('0x7'));var csv=require('to-csv');var ejs=require(_0xf0e0('0x8'));var fs=require('fs');var fs_extra=require(_0xf0e0('0x9'));var _=require(_0xf0e0('0xa'));var squel=require(_0xf0e0('0xb'));var crypto=require(_0xf0e0('0xc'));var jsforce=require(_0xf0e0('0xd'));var deskjs=require(_0xf0e0('0xe'));var toCsv=require(_0xf0e0('0xf'));var querystring=require(_0xf0e0('0x10'));var Papa=require('papaparse');var Redis=require(_0xf0e0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf0e0('0x12'));var as=require(_0xf0e0('0x13'));var hardwareService=require(_0xf0e0('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf0e0('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x501c86,_0x24d3a9){_0x24d3a9=_0x24d3a9||0xcc;return function(_0x5bd0ab){if(_0x5bd0ab){return _0x501c86[_0xf0e0('0x16')](_0x24d3a9);}return _0x501c86[_0xf0e0('0x17')](_0x24d3a9)['end']();};}function respondWithResult(_0x552683,_0x457bfc){_0x457bfc=_0x457bfc||0xc8;return function(_0x5b3719){if(_0x5b3719){return _0x552683[_0xf0e0('0x17')](_0x457bfc)['json'](_0x5b3719);}};}function respondWithFilteredResult(_0x3357f0,_0x55e350){return function(_0x40d87b){if(_0x40d87b){var _0x186e92=typeof _0x55e350['offset']===_0xf0e0('0x18')&&typeof _0x55e350[_0xf0e0('0x19')]===_0xf0e0('0x18');var _0x36206d=_0x40d87b['count'];var _0x3d725b=_0x186e92?0x0:_0x55e350[_0xf0e0('0x1a')];var _0x5e221e=_0x186e92?_0x40d87b['count']:_0x55e350[_0xf0e0('0x1a')]+_0x55e350[_0xf0e0('0x19')];var _0x51c8c8;if(_0x5e221e>=_0x36206d){_0x5e221e=_0x36206d;_0x51c8c8=0xc8;}else{_0x51c8c8=0xce;}_0x3357f0[_0xf0e0('0x17')](_0x51c8c8);return _0x3357f0['set']('Content-Range',_0x3d725b+'-'+_0x5e221e+'/'+_0x36206d)['json'](_0x40d87b);}return null;};}function patchUpdates(_0x350649){return function(_0x3ed3f8){try{jsonpatch['apply'](_0x3ed3f8,_0x350649,!![]);}catch(_0x54e139){return BPromise['reject'](_0x54e139);}return _0x3ed3f8[_0xf0e0('0x1b')]();};}function saveUpdates(_0x52e518,_0x586ef0){return function(_0x48b789){if(_0x48b789){return _0x48b789['update'](_0x52e518)[_0xf0e0('0x1c')](function(_0x357e3a){return _0x357e3a;});}return null;};}function removeEntity(_0x1a1cdb,_0x211d1c){return function(_0x507c66){if(_0x507c66){return _0x507c66[_0xf0e0('0x1d')]()[_0xf0e0('0x1c')](function(){_0x1a1cdb['status'](0xcc)[_0xf0e0('0x1e')]();});}};}function handleEntityNotFound(_0x50cb6e,_0x379256){return function(_0x364675){if(!_0x364675){_0x50cb6e['sendStatus'](0x194);}return _0x364675;};}function handleError(_0xce3161,_0x3e7e3a){_0x3e7e3a=_0x3e7e3a||0x1f4;return function(_0x51c3e2){logger[_0xf0e0('0x1f')](_0x51c3e2[_0xf0e0('0x20')]);if(_0x51c3e2[_0xf0e0('0x21')]){delete _0x51c3e2[_0xf0e0('0x21')];}_0xce3161[_0xf0e0('0x17')](_0x3e7e3a)[_0xf0e0('0x22')](_0x51c3e2);};}exports[_0xf0e0('0x23')]=function(_0x3b4a3b,_0xfe6ec){var _0xb08e13={'raw':!![],'where':{'id':_0x3b4a3b['params']['id']}},_0x251a8b={};_0x251a8b[_0xf0e0('0x24')]=_['keys'](db[_0xf0e0('0x25')]['rawAttributes']);_0x251a8b[_0xf0e0('0x26')]=_[_0xf0e0('0x27')](_0x3b4a3b[_0xf0e0('0x26')]);_0x251a8b[_0xf0e0('0x28')]=_['intersection'](_0x251a8b[_0xf0e0('0x24')],_0x251a8b[_0xf0e0('0x26')]);_0xb08e13[_0xf0e0('0x29')]=_[_0xf0e0('0x2a')](_0x251a8b['model'],qs[_0xf0e0('0x2b')](_0x3b4a3b[_0xf0e0('0x26')][_0xf0e0('0x2b')]));_0xb08e13[_0xf0e0('0x29')]=_0xb08e13[_0xf0e0('0x29')]['length']?_0xb08e13[_0xf0e0('0x29')]:_0x251a8b[_0xf0e0('0x24')];if(_0x3b4a3b[_0xf0e0('0x26')][_0xf0e0('0x2c')]){_0xb08e13[_0xf0e0('0x2d')]=[{'all':!![]}];}_0xb08e13=_['merge']({},_0xb08e13,_0x3b4a3b[_0xf0e0('0x2e')]);return db[_0xf0e0('0x25')]['find'](_0xb08e13)[_0xf0e0('0x1c')](handleEntityNotFound(_0xfe6ec,null))[_0xf0e0('0x1c')](respondWithResult(_0xfe6ec,null))[_0xf0e0('0x2f')](handleError(_0xfe6ec,null));};exports[_0xf0e0('0x30')]=function(_0x89dbf3,_0x1105d7){if(_0x89dbf3[_0xf0e0('0x31')]['id']){delete _0x89dbf3['body']['id'];}return db[_0xf0e0('0x25')][_0xf0e0('0x32')]({'where':{'id':_0x89dbf3[_0xf0e0('0x33')]['id']}})[_0xf0e0('0x1c')](handleEntityNotFound(_0x1105d7,null))[_0xf0e0('0x1c')](saveUpdates(_0x89dbf3[_0xf0e0('0x31')],null))['then'](respondWithResult(_0x1105d7,null))['catch'](handleError(_0x1105d7,null));};exports[_0xf0e0('0x1d')]=function(_0x5addaf,_0x11113c){return db[_0xf0e0('0x25')][_0xf0e0('0x32')]({'where':{'id':_0x5addaf[_0xf0e0('0x33')]['id']}})['then'](handleEntityNotFound(_0x11113c,null))['then'](removeEntity(_0x11113c,null))[_0xf0e0('0x2f')](handleError(_0x11113c,null));};
\ No newline at end of file
+var _0x9e0d=['sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','show','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','ChatApplication','find','catch','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x27371f,_0x94445f){var _0xa8587c=function(_0x490c25){while(--_0x490c25){_0x27371f['push'](_0x27371f['shift']());}};_0xa8587c(++_0x94445f);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x10c80d,_0x58e4bf){_0x10c80d=_0x10c80d-0x0;var _0x47659e=_0x9e0d[_0x10c80d];return _0x47659e;};'use strict';var emlformat=require(_0xd9e0('0x0'));var rimraf=require(_0xd9e0('0x1'));var zipdir=require(_0xd9e0('0x2'));var jsonpatch=require(_0xd9e0('0x3'));var rp=require('request-promise');var moment=require(_0xd9e0('0x4'));var BPromise=require(_0xd9e0('0x5'));var Mustache=require(_0xd9e0('0x6'));var util=require(_0xd9e0('0x7'));var path=require(_0xd9e0('0x8'));var sox=require(_0xd9e0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd9e0('0xa'));var _=require(_0xd9e0('0xb'));var squel=require(_0xd9e0('0xc'));var crypto=require(_0xd9e0('0xd'));var jsforce=require(_0xd9e0('0xe'));var deskjs=require(_0xd9e0('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd9e0('0x10'));var Papa=require(_0xd9e0('0x11'));var Redis=require(_0xd9e0('0x12'));var authService=require(_0xd9e0('0x13'));var qs=require(_0xd9e0('0x14'));var as=require(_0xd9e0('0x15'));var hardwareService=require(_0xd9e0('0x16'));var logger=require('../../config/logger')(_0xd9e0('0x17'));var utils=require(_0xd9e0('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd9e0('0x19'));var db=require(_0xd9e0('0x1a'))['db'];function respondWithStatusCode(_0x418d84,_0x1fb454){_0x1fb454=_0x1fb454||0xcc;return function(_0x18fdf2){if(_0x18fdf2){return _0x418d84['sendStatus'](_0x1fb454);}return _0x418d84[_0xd9e0('0x1b')](_0x1fb454)['end']();};}function respondWithResult(_0x2f311c,_0x55c704){_0x55c704=_0x55c704||0xc8;return function(_0x24d361){if(_0x24d361){return _0x2f311c[_0xd9e0('0x1b')](_0x55c704)[_0xd9e0('0x1c')](_0x24d361);}};}function respondWithFilteredResult(_0x18301b,_0x3e4c5d){return function(_0x4da900){if(_0x4da900){var _0x58d44c=typeof _0x3e4c5d['offset']===_0xd9e0('0x1d')&&typeof _0x3e4c5d[_0xd9e0('0x1e')]===_0xd9e0('0x1d');var _0x1cdcb6=_0x4da900['count'];var _0x209c04=_0x58d44c?0x0:_0x3e4c5d['offset'];var _0x483b74=_0x58d44c?_0x4da900[_0xd9e0('0x1f')]:_0x3e4c5d[_0xd9e0('0x20')]+_0x3e4c5d['limit'];var _0x5ac8f5;if(_0x483b74>=_0x1cdcb6){_0x483b74=_0x1cdcb6;_0x5ac8f5=0xc8;}else{_0x5ac8f5=0xce;}_0x18301b[_0xd9e0('0x1b')](_0x5ac8f5);return _0x18301b[_0xd9e0('0x21')]('Content-Range',_0x209c04+'-'+_0x483b74+'/'+_0x1cdcb6)[_0xd9e0('0x1c')](_0x4da900);}return null;};}function patchUpdates(_0x4cc3c9){return function(_0xd3d455){try{jsonpatch[_0xd9e0('0x22')](_0xd3d455,_0x4cc3c9,!![]);}catch(_0x67f69f){return BPromise[_0xd9e0('0x23')](_0x67f69f);}return _0xd3d455[_0xd9e0('0x24')]();};}function saveUpdates(_0x5711a1,_0x19534a){return function(_0x333233){if(_0x333233){return _0x333233['update'](_0x5711a1)[_0xd9e0('0x25')](function(_0x124ca7){return _0x124ca7;});}return null;};}function removeEntity(_0x5d4549,_0x357bd9){return function(_0x5e17d4){if(_0x5e17d4){return _0x5e17d4[_0xd9e0('0x26')]()[_0xd9e0('0x25')](function(){_0x5d4549['status'](0xcc)[_0xd9e0('0x27')]();});}};}function handleEntityNotFound(_0x53cf67,_0x554aeb){return function(_0x50f57d){if(!_0x50f57d){_0x53cf67[_0xd9e0('0x28')](0x194);}return _0x50f57d;};}function handleError(_0x21c796,_0x7065c6){_0x7065c6=_0x7065c6||0x1f4;return function(_0x1c36df){logger[_0xd9e0('0x29')](_0x1c36df[_0xd9e0('0x2a')]);if(_0x1c36df[_0xd9e0('0x2b')]){delete _0x1c36df['name'];}_0x21c796[_0xd9e0('0x1b')](_0x7065c6)[_0xd9e0('0x2c')](_0x1c36df);};}exports[_0xd9e0('0x2d')]=function(_0x17a899,_0x2738e9){var _0x4f5367={'raw':!![],'where':{'id':_0x17a899['params']['id']}},_0x4b4f7d={};_0x4b4f7d[_0xd9e0('0x2e')]=_[_0xd9e0('0x2f')](db['ChatApplication'][_0xd9e0('0x30')]);_0x4b4f7d[_0xd9e0('0x31')]=_[_0xd9e0('0x2f')](_0x17a899[_0xd9e0('0x31')]);_0x4b4f7d[_0xd9e0('0x32')]=_[_0xd9e0('0x33')](_0x4b4f7d[_0xd9e0('0x2e')],_0x4b4f7d['query']);_0x4f5367[_0xd9e0('0x34')]=_[_0xd9e0('0x33')](_0x4b4f7d[_0xd9e0('0x2e')],qs[_0xd9e0('0x35')](_0x17a899[_0xd9e0('0x31')][_0xd9e0('0x35')]));_0x4f5367[_0xd9e0('0x34')]=_0x4f5367[_0xd9e0('0x34')][_0xd9e0('0x36')]?_0x4f5367[_0xd9e0('0x34')]:_0x4b4f7d[_0xd9e0('0x2e')];if(_0x17a899[_0xd9e0('0x31')]['includeAll']){_0x4f5367[_0xd9e0('0x37')]=[{'all':!![]}];}_0x4f5367=_[_0xd9e0('0x38')]({},_0x4f5367,_0x17a899[_0xd9e0('0x39')]);return db[_0xd9e0('0x3a')][_0xd9e0('0x3b')](_0x4f5367)['then'](handleEntityNotFound(_0x2738e9,null))[_0xd9e0('0x25')](respondWithResult(_0x2738e9,null))[_0xd9e0('0x3c')](handleError(_0x2738e9,null));};exports[_0xd9e0('0x3d')]=function(_0x23901a,_0x588f8c){if(_0x23901a[_0xd9e0('0x3e')]['id']){delete _0x23901a['body']['id'];}return db[_0xd9e0('0x3a')][_0xd9e0('0x3b')]({'where':{'id':_0x23901a[_0xd9e0('0x3f')]['id']}})[_0xd9e0('0x25')](handleEntityNotFound(_0x588f8c,null))[_0xd9e0('0x25')](saveUpdates(_0x23901a[_0xd9e0('0x3e')],null))[_0xd9e0('0x25')](respondWithResult(_0x588f8c,null))[_0xd9e0('0x3c')](handleError(_0x588f8c,null));};exports[_0xd9e0('0x26')]=function(_0x5065f7,_0x318679){return db[_0xd9e0('0x3a')][_0xd9e0('0x3b')]({'where':{'id':_0x5065f7[_0xd9e0('0x3f')]['id']}})['then'](handleEntityNotFound(_0x318679,null))[_0xd9e0('0x25')](removeEntity(_0x318679,null))[_0xd9e0('0x3c')](handleError(_0x318679,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 8b563ee..39203df 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 _0x05cd=['api','moment','request-promise','path','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x205123,_0x240ebe){var _0x5b69fb=function(_0x488aaf){while(--_0x488aaf){_0x205123['push'](_0x205123['shift']());}};_0x5b69fb(++_0x240ebe);}(_0x05cd,0x1bd));var _0xd05c=function(_0x266ca7,_0x15005f){_0x266ca7=_0x266ca7-0x0;var _0x2969ca=_0x05cd[_0x266ca7];return _0x2969ca;};'use strict';var _=require(_0xd05c('0x0'));var util=require(_0xd05c('0x1'));var logger=require(_0xd05c('0x2'))(_0xd05c('0x3'));var moment=require(_0xd05c('0x4'));var BPromise=require('bluebird');var rp=require(_0xd05c('0x5'));var fs=require('fs');var path=require(_0xd05c('0x6'));var rimraf=require('rimraf');var config=require(_0xd05c('0x7'));var attributes=require(_0xd05c('0x8'));module[_0xd05c('0x9')]=function(_0x55ed53,_0x572586){return _0x55ed53[_0xd05c('0xa')](_0xd05c('0xb'),attributes,{'tableName':_0xd05c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd05c('0xd')});};
\ No newline at end of file
+var _0xa952=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4'];(function(_0x49f82f,_0x54feda){var _0x55dfc2=function(_0xe92f19){while(--_0xe92f19){_0x49f82f['push'](_0x49f82f['shift']());}};_0x55dfc2(++_0x54feda);}(_0xa952,0x1b2));var _0x2a95=function(_0x48e77c,_0x1da50c){_0x48e77c=_0x48e77c-0x0;var _0x4a49b5=_0xa952[_0x48e77c];return _0x4a49b5;};'use strict';var _=require(_0x2a95('0x0'));var util=require(_0x2a95('0x1'));var logger=require(_0x2a95('0x2'))(_0x2a95('0x3'));var moment=require(_0x2a95('0x4'));var BPromise=require(_0x2a95('0x5'));var rp=require(_0x2a95('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a95('0x7'));var config=require(_0x2a95('0x8'));var attributes=require(_0x2a95('0x9'));module[_0x2a95('0xa')]=function(_0x53c54f,_0x153806){return _0x53c54f[_0x2a95('0xb')](_0x2a95('0xc'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2a95('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 71839fd..4401130 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 _0xcbf8=['code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xcbf8,0x118));var _0x8cbf=function(_0x5b73ac,_0x4a1422){_0x5b73ac=_0x5b73ac-0x0;var _0x32bcdf=_0xcbf8[_0x5b73ac];return _0x32bcdf;};'use strict';var _=require(_0x8cbf('0x0'));var util=require(_0x8cbf('0x1'));var moment=require(_0x8cbf('0x2'));var BPromise=require(_0x8cbf('0x3'));var rs=require(_0x8cbf('0x4'));var fs=require('fs');var Redis=require(_0x8cbf('0x5'));var db=require(_0x8cbf('0x6'))['db'];var utils=require(_0x8cbf('0x7'));var logger=require(_0x8cbf('0x8'))(_0x8cbf('0x9'));var config=require(_0x8cbf('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8cbf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4625cd,_0x3bbcfe,_0x2bb948){return new BPromise(function(_0x936320,_0x425ade){return client[_0x8cbf('0xc')](_0x4625cd,_0x2bb948)[_0x8cbf('0xd')](function(_0x5e1005){logger[_0x8cbf('0xe')]('ChatApplication,\x20%s,\x20%s',_0x3bbcfe,_0x8cbf('0xf'));logger[_0x8cbf('0x10')](_0x8cbf('0x11'),_0x3bbcfe,_0x8cbf('0xf'),JSON[_0x8cbf('0x12')](_0x5e1005));if(_0x5e1005[_0x8cbf('0x13')]){if(_0x5e1005[_0x8cbf('0x13')][_0x8cbf('0x14')]===0x1f4){logger[_0x8cbf('0x13')](_0x8cbf('0x15'),_0x3bbcfe,_0x5e1005[_0x8cbf('0x13')]['message']);return _0x425ade(_0x5e1005['error'][_0x8cbf('0x16')]);}logger[_0x8cbf('0x13')](_0x8cbf('0x15'),_0x3bbcfe,_0x5e1005[_0x8cbf('0x13')][_0x8cbf('0x16')]);return _0x936320(_0x5e1005['error'][_0x8cbf('0x16')]);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x3bbcfe,_0x8cbf('0xf'));_0x936320(_0x5e1005[_0x8cbf('0x17')][_0x8cbf('0x16')]);}})[_0x8cbf('0x18')](function(_0x25cc85){logger[_0x8cbf('0x13')](_0x8cbf('0x15'),_0x3bbcfe,_0x25cc85);_0x425ade(_0x25cc85);});});}
\ No newline at end of file
+var _0x2a90=['catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x70eff9,_0x28ed03){var _0x4befb9=function(_0x2e003b){while(--_0x2e003b){_0x70eff9['push'](_0x70eff9['shift']());}};_0x4befb9(++_0x28ed03);}(_0x2a90,0x1e5));var _0x02a9=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2a90[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x02a9('0x0'));var BPromise=require(_0x02a9('0x1'));var rs=require(_0x02a9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x02a9('0x3'))['db'];var utils=require(_0x02a9('0x4'));var logger=require('../../config/logger')(_0x02a9('0x5'));var config=require(_0x02a9('0x6'));var jayson=require(_0x02a9('0x7'));var client=jayson[_0x02a9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d5421,_0x5ae427,_0x1cf327){return new BPromise(function(_0x1b2943,_0x3d7527){return client[_0x02a9('0x9')](_0x2d5421,_0x1cf327)[_0x02a9('0xa')](function(_0x455d4d){logger[_0x02a9('0xb')](_0x02a9('0xc'),_0x5ae427,'request\x20sent');logger[_0x02a9('0xd')](_0x02a9('0xe'),_0x5ae427,_0x02a9('0xf'),JSON[_0x02a9('0x10')](_0x455d4d));if(_0x455d4d[_0x02a9('0x11')]){if(_0x455d4d[_0x02a9('0x11')][_0x02a9('0x12')]===0x1f4){logger[_0x02a9('0x11')](_0x02a9('0xc'),_0x5ae427,_0x455d4d[_0x02a9('0x11')][_0x02a9('0x13')]);return _0x3d7527(_0x455d4d['error']['message']);}logger['error'](_0x02a9('0xc'),_0x5ae427,_0x455d4d[_0x02a9('0x11')]['message']);return _0x1b2943(_0x455d4d[_0x02a9('0x11')][_0x02a9('0x13')]);}else{logger[_0x02a9('0xb')]('ChatApplication,\x20%s,\x20%s',_0x5ae427,_0x02a9('0xf'));_0x1b2943(_0x455d4d[_0x02a9('0x14')][_0x02a9('0x13')]);}})[_0x02a9('0x15')](function(_0x35825f){logger['error'](_0x02a9('0xc'),_0x5ae427,_0x35825f);_0x3d7527(_0x35825f);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 99f9c00..96af3a4 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 _0xf1a1=['exports','multer','util','Router','fs-extra','/:id','isAuthenticated','put','delete','destroy'];(function(_0x269825,_0x271c62){var _0x2d7a7a=function(_0x6ad778){while(--_0x6ad778){_0x269825['push'](_0x269825['shift']());}};_0x2d7a7a(++_0x271c62);}(_0xf1a1,0xdd));var _0x1f1a=function(_0x39a42e,_0x594f2c){_0x39a42e=_0x39a42e-0x0;var _0x462d94=_0xf1a1[_0x39a42e];return _0x462d94;};'use strict';var multer=require(_0x1f1a('0x0'));var util=require(_0x1f1a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1f1a('0x2')]();var fs_extra=require(_0x1f1a('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatApplication.controller');router['get'](_0x1f1a('0x4'),auth[_0x1f1a('0x5')](),controller['show']);router[_0x1f1a('0x6')](_0x1f1a('0x4'),auth[_0x1f1a('0x5')](),controller['update']);router[_0x1f1a('0x7')]('/:id',auth[_0x1f1a('0x5')](),controller[_0x1f1a('0x8')]);module[_0x1f1a('0x9')]=router;
\ No newline at end of file
+var _0xc445=['put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xc445,0x7c));var _0x5c44=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xc445[_0x1203f];return _0x365f0a;};'use strict';var multer=require(_0x5c44('0x0'));var util=require(_0x5c44('0x1'));var path=require(_0x5c44('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5c44('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5c44('0x4'));var interaction=require(_0x5c44('0x5'));var config=require(_0x5c44('0x6'));var controller=require(_0x5c44('0x7'));router[_0x5c44('0x8')](_0x5c44('0x9'),auth[_0x5c44('0xa')](),controller[_0x5c44('0xb')]);router[_0x5c44('0xc')](_0x5c44('0x9'),auth['isAuthenticated'](),controller[_0x5c44('0xd')]);router[_0x5c44('0xe')](_0x5c44('0x9'),auth[_0x5c44('0xa')](),controller[_0x5c44('0xf')]);module[_0x5c44('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index e99682f..5919f37 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 _0xfb67=['BOOLEAN','sequelize','exports','STRING'];(function(_0x568cf0,_0x1a44cb){var _0x360f81=function(_0x414953){while(--_0x414953){_0x568cf0['push'](_0x568cf0['shift']());}};_0x360f81(++_0x1a44cb);}(_0xfb67,0xdd));var _0x7fb6=function(_0x773a85,_0x11cd42){_0x773a85=_0x773a85-0x0;var _0x4dd465=_0xfb67[_0x773a85];return _0x4dd465;};'use strict';var Sequelize=require(_0x7fb6('0x0'));module[_0x7fb6('0x1')]={'name':{'type':Sequelize[_0x7fb6('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7fb6('0x2')]},'write':{'type':Sequelize[_0x7fb6('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xeb5d=['sequelize','exports','STRING','BOOLEAN'];(function(_0x11d7a5,_0xed05b0){var _0x222fdb=function(_0xec709){while(--_0xec709){_0x11d7a5['push'](_0x11d7a5['shift']());}};_0x222fdb(++_0xed05b0);}(_0xeb5d,0x174));var _0xdeb5=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xeb5d[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xdeb5('0x0'));module[_0xdeb5('0x1')]={'name':{'type':Sequelize[_0xdeb5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdeb5('0x2')]},'write':{'type':Sequelize[_0xdeb5('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index b608454..32974b3 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 _0x3fe7=['fast-json-patch','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','rows','catch','show','params','fields','length','includeAll','include','find','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','findOne','User','pick','removeMembers','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','nolimit','eml-format','rimraf'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x3fe7,0xc4));var _0x73fe=function(_0x2bd1ec,_0x3fe65f){_0x2bd1ec=_0x2bd1ec-0x0;var _0x2f7577=_0x3fe7[_0x2bd1ec];return _0x2f7577;};'use strict';var emlformat=require(_0x73fe('0x0'));var rimraf=require(_0x73fe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x73fe('0x2'));var rp=require(_0x73fe('0x3'));var moment=require(_0x73fe('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x73fe('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x73fe('0x6'));var ejs=require(_0x73fe('0x7'));var fs=require('fs');var fs_extra=require(_0x73fe('0x8'));var _=require(_0x73fe('0x9'));var squel=require(_0x73fe('0xa'));var crypto=require(_0x73fe('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x73fe('0xc'));var toCsv=require('to-csv');var querystring=require(_0x73fe('0xd'));var Papa=require(_0x73fe('0xe'));var Redis=require(_0x73fe('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x73fe('0x10'));var as=require(_0x73fe('0x11'));var hardwareService=require(_0x73fe('0x12'));var logger=require(_0x73fe('0x13'))(_0x73fe('0x14'));var utils=require(_0x73fe('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x73fe('0x16'));var db=require(_0x73fe('0x17'))['db'];config[_0x73fe('0x18')]=_[_0x73fe('0x19')](config[_0x73fe('0x18')],{'host':_0x73fe('0x1a'),'port':0x18eb});var socket=require(_0x73fe('0x1b'))(new Redis(config[_0x73fe('0x18')]));require(_0x73fe('0x1c'))[_0x73fe('0x1d')](socket);function respondWithStatusCode(_0x38ef91,_0x4c934f){_0x4c934f=_0x4c934f||0xcc;return function(_0x29150d){if(_0x29150d){return _0x38ef91['sendStatus'](_0x4c934f);}return _0x38ef91[_0x73fe('0x1e')](_0x4c934f)[_0x73fe('0x1f')]();};}function respondWithResult(_0x253579,_0x53fd08){_0x53fd08=_0x53fd08||0xc8;return function(_0xa7c45d){if(_0xa7c45d){return _0x253579[_0x73fe('0x1e')](_0x53fd08)[_0x73fe('0x20')](_0xa7c45d);}};}function respondWithFilteredResult(_0x3df4e4,_0x531c14){return function(_0x4fafc0){if(_0x4fafc0){var _0x361791=typeof _0x531c14[_0x73fe('0x21')]===_0x73fe('0x22')&&typeof _0x531c14[_0x73fe('0x23')]===_0x73fe('0x22');var _0x4eaa32=_0x4fafc0[_0x73fe('0x24')];var _0x388a3c=_0x361791?0x0:_0x531c14[_0x73fe('0x21')];var _0x2b437f=_0x361791?_0x4fafc0[_0x73fe('0x24')]:_0x531c14[_0x73fe('0x21')]+_0x531c14[_0x73fe('0x23')];var _0x3f6627;if(_0x2b437f>=_0x4eaa32){_0x2b437f=_0x4eaa32;_0x3f6627=0xc8;}else{_0x3f6627=0xce;}_0x3df4e4[_0x73fe('0x1e')](_0x3f6627);return _0x3df4e4[_0x73fe('0x25')](_0x73fe('0x26'),_0x388a3c+'-'+_0x2b437f+'/'+_0x4eaa32)[_0x73fe('0x20')](_0x4fafc0);}return null;};}function patchUpdates(_0x4cd3f9){return function(_0xce58be){try{jsonpatch[_0x73fe('0x27')](_0xce58be,_0x4cd3f9,!![]);}catch(_0x4ece5c){return BPromise['reject'](_0x4ece5c);}return _0xce58be[_0x73fe('0x28')]();};}function saveUpdates(_0x48d620,_0x17c200){return function(_0x5d7370){if(_0x5d7370){return _0x5d7370[_0x73fe('0x29')](_0x48d620)[_0x73fe('0x2a')](function(_0x5be41a){return _0x5be41a;});}return null;};}function removeEntity(_0x54c01a,_0x231f86){return function(_0x49f76c){if(_0x49f76c){return _0x49f76c[_0x73fe('0x2b')]()[_0x73fe('0x2a')](function(){_0x54c01a[_0x73fe('0x1e')](0xcc)[_0x73fe('0x1f')]();});}};}function handleEntityNotFound(_0xa0782d,_0x2261b3){return function(_0x51a176){if(!_0x51a176){_0xa0782d[_0x73fe('0x2c')](0x194);}return _0x51a176;};}function handleError(_0x4c4641,_0x13e46e){_0x13e46e=_0x13e46e||0x1f4;return function(_0x140f5a){logger['error'](_0x140f5a[_0x73fe('0x2d')]);if(_0x140f5a[_0x73fe('0x2e')]){delete _0x140f5a[_0x73fe('0x2e')];}_0x4c4641[_0x73fe('0x1e')](_0x13e46e)[_0x73fe('0x2f')](_0x140f5a);};}exports[_0x73fe('0x30')]=function(_0x1d4d3f,_0x132fca){var _0x589a1a={},_0x18b30c={},_0x52d85f={'count':0x0,'rows':[]};var _0x186103=_[_0x73fe('0x31')](db[_0x73fe('0x32')][_0x73fe('0x33')],function(_0x3bc81e){return{'name':_0x3bc81e[_0x73fe('0x34')],'type':_0x3bc81e[_0x73fe('0x35')][_0x73fe('0x36')]};});_0x18b30c[_0x73fe('0x37')]=_[_0x73fe('0x31')](_0x186103,_0x73fe('0x2e'));_0x18b30c[_0x73fe('0x38')]=_[_0x73fe('0x39')](_0x1d4d3f['query']);_0x18b30c['filters']=_[_0x73fe('0x3a')](_0x18b30c[_0x73fe('0x37')],_0x18b30c['query']);_0x589a1a[_0x73fe('0x3b')]=_[_0x73fe('0x3a')](_0x18b30c[_0x73fe('0x37')],qs['fields'](_0x1d4d3f[_0x73fe('0x38')]['fields']));_0x589a1a['attributes']=_0x589a1a[_0x73fe('0x3b')]['length']?_0x589a1a[_0x73fe('0x3b')]:_0x18b30c[_0x73fe('0x37')];if(!_0x1d4d3f['query'][_0x73fe('0x3c')]('nolimit')){_0x589a1a['limit']=qs[_0x73fe('0x23')](_0x1d4d3f['query'][_0x73fe('0x23')]);_0x589a1a[_0x73fe('0x21')]=qs[_0x73fe('0x21')](_0x1d4d3f[_0x73fe('0x38')][_0x73fe('0x21')]);}_0x589a1a[_0x73fe('0x3d')]=qs[_0x73fe('0x3e')](_0x1d4d3f['query'][_0x73fe('0x3e')]);_0x589a1a[_0x73fe('0x3f')]=qs[_0x73fe('0x40')](_['pick'](_0x1d4d3f['query'],_0x18b30c[_0x73fe('0x40')]),_0x186103);if(_0x1d4d3f['query'][_0x73fe('0x41')]){_0x589a1a[_0x73fe('0x3f')]=_[_0x73fe('0x42')](_0x589a1a[_0x73fe('0x3f')],{'$or':_[_0x73fe('0x31')](_0x186103,function(_0x1fa431){if(_0x1fa431['type']!==_0x73fe('0x43')){var _0x12980d={};_0x12980d[_0x1fa431[_0x73fe('0x2e')]]={'$like':'%'+_0x1d4d3f[_0x73fe('0x38')][_0x73fe('0x41')]+'%'};return _0x12980d;}})});}_0x589a1a=_[_0x73fe('0x42')]({},_0x589a1a,_0x1d4d3f[_0x73fe('0x44')]);var _0x5f05d1={'where':_0x589a1a[_0x73fe('0x3f')]};return db[_0x73fe('0x32')][_0x73fe('0x24')](_0x5f05d1)[_0x73fe('0x2a')](function(_0x42372a){_0x52d85f[_0x73fe('0x24')]=_0x42372a;if(_0x1d4d3f[_0x73fe('0x38')]['includeAll']){_0x589a1a['include']=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x589a1a);})[_0x73fe('0x2a')](function(_0x1c6764){_0x52d85f[_0x73fe('0x45')]=_0x1c6764;return _0x52d85f;})[_0x73fe('0x2a')](respondWithFilteredResult(_0x132fca,_0x589a1a))[_0x73fe('0x46')](handleError(_0x132fca,null));};exports[_0x73fe('0x47')]=function(_0x8cc8dc,_0x12d862){var _0x3eda7d={'raw':!![],'where':{'id':_0x8cc8dc[_0x73fe('0x48')]['id']}},_0x1ffb60={};_0x1ffb60[_0x73fe('0x37')]=_['keys'](db[_0x73fe('0x32')][_0x73fe('0x33')]);_0x1ffb60[_0x73fe('0x38')]=_['keys'](_0x8cc8dc[_0x73fe('0x38')]);_0x1ffb60[_0x73fe('0x40')]=_[_0x73fe('0x3a')](_0x1ffb60[_0x73fe('0x37')],_0x1ffb60[_0x73fe('0x38')]);_0x3eda7d[_0x73fe('0x3b')]=_[_0x73fe('0x3a')](_0x1ffb60[_0x73fe('0x37')],qs['fields'](_0x8cc8dc['query'][_0x73fe('0x49')]));_0x3eda7d[_0x73fe('0x3b')]=_0x3eda7d['attributes'][_0x73fe('0x4a')]?_0x3eda7d['attributes']:_0x1ffb60[_0x73fe('0x37')];if(_0x8cc8dc[_0x73fe('0x38')][_0x73fe('0x4b')]){_0x3eda7d[_0x73fe('0x4c')]=[{'all':!![]}];}_0x3eda7d=_[_0x73fe('0x42')]({},_0x3eda7d,_0x8cc8dc[_0x73fe('0x44')]);return db['ChatGroup'][_0x73fe('0x4d')](_0x3eda7d)['then'](handleEntityNotFound(_0x12d862,null))[_0x73fe('0x2a')](respondWithResult(_0x12d862,null))[_0x73fe('0x46')](handleError(_0x12d862,null));};exports[_0x73fe('0x4e')]=function(_0x444ed7,_0x4afb9e){return db[_0x73fe('0x32')][_0x73fe('0x4e')](_0x444ed7[_0x73fe('0x4f')],{})['then'](respondWithResult(_0x4afb9e,0xc9))['catch'](handleError(_0x4afb9e,null));};exports[_0x73fe('0x29')]=function(_0x1785cb,_0xd0246d){if(_0x1785cb['body']['id']){delete _0x1785cb['body']['id'];}return db[_0x73fe('0x32')]['find']({'where':{'id':_0x1785cb[_0x73fe('0x48')]['id']}})[_0x73fe('0x2a')](handleEntityNotFound(_0xd0246d,null))[_0x73fe('0x2a')](saveUpdates(_0x1785cb[_0x73fe('0x4f')],null))[_0x73fe('0x2a')](respondWithResult(_0xd0246d,null))[_0x73fe('0x46')](handleError(_0xd0246d,null));};exports['destroy']=function(_0x4462d3,_0x258acf){return db[_0x73fe('0x32')][_0x73fe('0x4d')]({'where':{'id':_0x4462d3[_0x73fe('0x48')]['id']}})[_0x73fe('0x2a')](handleEntityNotFound(_0x258acf,null))['then'](removeEntity(_0x258acf,null))['catch'](handleError(_0x258acf,null));};exports[_0x73fe('0x50')]=function(_0x3bf0da,_0x5cda19){return db[_0x73fe('0x32')][_0x73fe('0x50')]()[_0x73fe('0x2a')](respondWithResult(_0x5cda19,null))['catch'](handleError(_0x5cda19,null));};exports[_0x73fe('0x51')]=function(_0x3bf973,_0x23e3c8,_0x2be132){return db[_0x73fe('0x52')][_0x73fe('0x24')]({'where':{'ChatGroupId':_0x3bf973['params']['id'],'ToId':_0x3bf973['user']['id'],'read':![]}})['then'](function(_0x44cf3b){return{'id':_[_0x73fe('0x53')](_0x3bf973[_0x73fe('0x48')]['id']),'count':_0x44cf3b};})[_0x73fe('0x2a')](respondWithResult(_0x23e3c8,null))[_0x73fe('0x46')](handleError(_0x23e3c8,null));};exports['addMembers']=function(_0xa63ad4,_0x5242f6,_0xcd18e9){return db[_0x73fe('0x32')][_0x73fe('0x4d')]({'where':{'id':_0xa63ad4[_0x73fe('0x48')]['id']}})['then'](handleEntityNotFound(_0x5242f6,null))['then'](function(_0x12174a){if(_0x12174a){return _0x12174a[_0x73fe('0x54')](_0xa63ad4[_0x73fe('0x4f')][_0x73fe('0x55')],_[_0x73fe('0x56')](_0xa63ad4[_0x73fe('0x4f')],['ids','id'])||{});}})['then'](respondWithResult(_0x5242f6,null))[_0x73fe('0x46')](handleError(_0x5242f6,null));};exports[_0x73fe('0x57')]=function(_0x32117c,_0x186f96,_0x5c567f){var _0x88af41={};var _0x276c93={};var _0x44b5e9;var _0x384551;return db['ChatGroup'][_0x73fe('0x58')]({'where':{'id':_0x32117c['params']['id']}})[_0x73fe('0x2a')](handleEntityNotFound(_0x186f96,null))['then'](function(_0x7973b9){if(_0x7973b9){_0x44b5e9=_0x7973b9;_0x276c93['model']=_[_0x73fe('0x39')](db[_0x73fe('0x59')][_0x73fe('0x33')]);_0x276c93[_0x73fe('0x38')]=_[_0x73fe('0x39')](_0x32117c['query']);_0x276c93[_0x73fe('0x40')]=_[_0x73fe('0x3a')](_0x276c93[_0x73fe('0x37')],_0x276c93[_0x73fe('0x38')]);_0x88af41['attributes']=_[_0x73fe('0x3a')](_0x276c93[_0x73fe('0x37')],qs[_0x73fe('0x49')](_0x32117c['query']['fields']));_0x88af41[_0x73fe('0x3b')]=_0x88af41[_0x73fe('0x3b')][_0x73fe('0x4a')]?_0x88af41['attributes']:_0x276c93[_0x73fe('0x37')];_0x88af41[_0x73fe('0x3d')]=qs[_0x73fe('0x3e')](_0x32117c['query'][_0x73fe('0x3e')]);_0x88af41[_0x73fe('0x3f')]=qs[_0x73fe('0x40')](_[_0x73fe('0x5a')](_0x32117c[_0x73fe('0x38')],_0x276c93['filters']));if(_0x32117c[_0x73fe('0x38')]['filter']){_0x88af41[_0x73fe('0x3f')]=_[_0x73fe('0x42')](_0x88af41['where'],{'$or':_[_0x73fe('0x31')](_0x88af41[_0x73fe('0x3b')],function(_0x1f879a){var _0x1207da={};_0x1207da[_0x1f879a]={'$like':'%'+_0x32117c[_0x73fe('0x38')][_0x73fe('0x41')]+'%'};return _0x1207da;})});}_0x88af41=_[_0x73fe('0x42')]({},_0x88af41,_0x32117c[_0x73fe('0x44')]);return _0x44b5e9['getMembers'](_0x88af41);}})[_0x73fe('0x2a')](function(_0x2efc61){if(_0x2efc61){_0x384551=_0x2efc61[_0x73fe('0x4a')];if(!_0x32117c['query'][_0x73fe('0x3c')]('nolimit')){_0x88af41[_0x73fe('0x23')]=qs[_0x73fe('0x23')](_0x32117c[_0x73fe('0x38')][_0x73fe('0x23')]);_0x88af41[_0x73fe('0x21')]=qs[_0x73fe('0x21')](_0x32117c[_0x73fe('0x38')][_0x73fe('0x21')]);}return _0x44b5e9['getMembers'](_0x88af41);}})[_0x73fe('0x2a')](function(_0x27c4ef){if(_0x27c4ef){return _0x27c4ef?{'count':_0x384551,'rows':_0x27c4ef}:null;}})['then'](respondWithResult(_0x186f96,null))[_0x73fe('0x46')](handleError(_0x186f96,null));};exports[_0x73fe('0x5b')]=function(_0x30ecf7,_0x4aa862,_0x5470de){return db[_0x73fe('0x32')]['find']({'where':{'id':_0x30ecf7[_0x73fe('0x48')]['id']}})[_0x73fe('0x2a')](handleEntityNotFound(_0x4aa862,null))[_0x73fe('0x2a')](function(_0x530e31){if(_0x530e31){return _0x530e31[_0x73fe('0x5b')](_0x30ecf7['query'][_0x73fe('0x55')]);}})['then'](respondWithStatusCode(_0x4aa862,null))[_0x73fe('0x46')](handleError(_0x4aa862,null));};exports['addMessage']=function(_0x3ae69c,_0x15597d,_0x1e8c59){if(_0x3ae69c['body']['id']){delete _0x3ae69c[_0x73fe('0x4f')]['id'];}return db[_0x73fe('0x32')][_0x73fe('0x4d')]({'where':{'id':_0x3ae69c[_0x73fe('0x48')]['id']}})[_0x73fe('0x2a')](handleEntityNotFound(_0x15597d,null))[_0x73fe('0x2a')](function(_0x1debc4){if(_0x1debc4){_0x3ae69c[_0x73fe('0x4f')][_0x73fe('0x5c')]=_0x1debc4['id'];return db[_0x73fe('0x52')][_0x73fe('0x4e')](_0x3ae69c[_0x73fe('0x4f')]);}})['then'](respondWithResult(_0x15597d,null))['catch'](handleError(_0x15597d,null));};exports[_0x73fe('0x5d')]=function(_0x287eef,_0x1af16f,_0x1e1861){var _0x503167={};var _0x4b58fb={};var _0x31ee52;var _0x53183b;return db[_0x73fe('0x32')]['findOne']({'where':{'id':_0x287eef[_0x73fe('0x48')]['id']}})[_0x73fe('0x2a')](handleEntityNotFound(_0x1af16f,null))[_0x73fe('0x2a')](function(_0x2c3f69){if(_0x2c3f69){_0x31ee52=_0x2c3f69;_0x4b58fb[_0x73fe('0x37')]=_[_0x73fe('0x39')](db[_0x73fe('0x52')][_0x73fe('0x33')]);_0x4b58fb[_0x73fe('0x38')]=_[_0x73fe('0x39')](_0x287eef['query']);_0x4b58fb[_0x73fe('0x40')]=_[_0x73fe('0x3a')](_0x4b58fb['model'],_0x4b58fb['query']);_0x503167[_0x73fe('0x3b')]=_[_0x73fe('0x3a')](_0x4b58fb['model'],qs['fields'](_0x287eef['query'][_0x73fe('0x49')]));_0x503167[_0x73fe('0x3b')]=_0x503167[_0x73fe('0x3b')][_0x73fe('0x4a')]?_0x503167[_0x73fe('0x3b')]:_0x4b58fb['model'];_0x503167[_0x73fe('0x3d')]=qs[_0x73fe('0x3e')](_0x287eef[_0x73fe('0x38')][_0x73fe('0x3e')]);_0x503167[_0x73fe('0x3f')]=qs[_0x73fe('0x40')](_[_0x73fe('0x5a')](_0x287eef['query'],_0x4b58fb[_0x73fe('0x40')]));if(_0x287eef[_0x73fe('0x38')][_0x73fe('0x41')]){_0x503167[_0x73fe('0x3f')]=_[_0x73fe('0x42')](_0x503167['where'],{'$or':_[_0x73fe('0x31')](_0x503167['attributes'],function(_0x460b64){var _0x37c5b8={};_0x37c5b8[_0x460b64]={'$like':'%'+_0x287eef['query'][_0x73fe('0x41')]+'%'};return _0x37c5b8;})});}if(_0x287eef[_0x73fe('0x38')][_0x73fe('0x5e')]){var _0x3c89eb=_0x287eef['query'][_0x73fe('0x5e')][_0x73fe('0x5f')](',');var _0x397a5b={};_0x397a5b[_0x3c89eb[0x0]]={'$gte':moment(_0x3c89eb[0x1])[_0x73fe('0x60')](_0x73fe('0x61'))};_0x503167['where']=_[_0x73fe('0x42')](_0x503167['where'],_0x397a5b);}_0x503167=_[_0x73fe('0x42')]({},_0x503167,_0x287eef['options']);return _0x31ee52[_0x73fe('0x5d')](_0x503167);}})[_0x73fe('0x2a')](function(_0x451c4f){if(_0x451c4f){_0x53183b=_0x451c4f[_0x73fe('0x4a')];if(!_0x287eef['query'][_0x73fe('0x3c')](_0x73fe('0x62'))){_0x503167[_0x73fe('0x23')]=qs[_0x73fe('0x23')](_0x287eef[_0x73fe('0x38')][_0x73fe('0x23')]);_0x503167[_0x73fe('0x21')]=qs[_0x73fe('0x21')](_0x287eef[_0x73fe('0x38')][_0x73fe('0x21')]);}return _0x31ee52[_0x73fe('0x5d')](_0x503167);}})['then'](function(_0x1146ff){if(_0x1146ff){return _0x1146ff?{'count':_0x53183b,'rows':_0x1146ff}:null;}})[_0x73fe('0x2a')](respondWithResult(_0x1af16f,null))['catch'](handleError(_0x1af16f,null));};
\ No newline at end of file
+var _0x21ae=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','limit','count','set','Content-Range','reject','update','then','end','error','stack','name','send','index','ChatGroup','rawAttributes','fieldName','type','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','findAll','rows','catch','params','keys','find','create','body','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','ids','omit','findOne','User','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','filter','$gte','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0xab287a,_0x2db01f){var _0x16ac16=function(_0x3e08ec){while(--_0x3e08ec){_0xab287a['push'](_0xab287a['shift']());}};_0x16ac16(++_0x2db01f);}(_0x21ae,0x1d7));var _0xe21a=function(_0x535a20,_0x278ee4){_0x535a20=_0x535a20-0x0;var _0x13d870=_0x21ae[_0x535a20];return _0x13d870;};'use strict';var emlformat=require(_0xe21a('0x0'));var rimraf=require(_0xe21a('0x1'));var zipdir=require(_0xe21a('0x2'));var jsonpatch=require(_0xe21a('0x3'));var rp=require(_0xe21a('0x4'));var moment=require(_0xe21a('0x5'));var BPromise=require(_0xe21a('0x6'));var Mustache=require(_0xe21a('0x7'));var util=require(_0xe21a('0x8'));var path=require(_0xe21a('0x9'));var sox=require(_0xe21a('0xa'));var csv=require(_0xe21a('0xb'));var ejs=require(_0xe21a('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe21a('0xd'));var squel=require(_0xe21a('0xe'));var crypto=require(_0xe21a('0xf'));var jsforce=require(_0xe21a('0x10'));var deskjs=require(_0xe21a('0x11'));var toCsv=require(_0xe21a('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe21a('0x12'));var authService=require(_0xe21a('0x13'));var qs=require(_0xe21a('0x14'));var as=require(_0xe21a('0x15'));var hardwareService=require(_0xe21a('0x16'));var logger=require(_0xe21a('0x17'))('api');var utils=require(_0xe21a('0x18'));var config=require(_0xe21a('0x19'));var licenseUtil=require(_0xe21a('0x1a'));var db=require('../../mysqldb')['db'];config[_0xe21a('0x1b')]=_['defaults'](config[_0xe21a('0x1b')],{'host':_0xe21a('0x1c'),'port':0x18eb});var socket=require(_0xe21a('0x1d'))(new Redis(config[_0xe21a('0x1b')]));require(_0xe21a('0x1e'))[_0xe21a('0x1f')](socket);function respondWithStatusCode(_0x577c35,_0x4ab347){_0x4ab347=_0x4ab347||0xcc;return function(_0x4fdfce){if(_0x4fdfce){return _0x577c35[_0xe21a('0x20')](_0x4ab347);}return _0x577c35[_0xe21a('0x21')](_0x4ab347)['end']();};}function respondWithResult(_0x176302,_0x8b747d){_0x8b747d=_0x8b747d||0xc8;return function(_0x50f880){if(_0x50f880){return _0x176302['status'](_0x8b747d)[_0xe21a('0x22')](_0x50f880);}};}function respondWithFilteredResult(_0x518189,_0x8aa5ab){return function(_0x228c8){if(_0x228c8){var _0x34aa87=typeof _0x8aa5ab[_0xe21a('0x23')]==='undefined'&&typeof _0x8aa5ab[_0xe21a('0x24')]==='undefined';var _0xd02c99=_0x228c8['count'];var _0xfce545=_0x34aa87?0x0:_0x8aa5ab[_0xe21a('0x23')];var _0x4d1985=_0x34aa87?_0x228c8[_0xe21a('0x25')]:_0x8aa5ab[_0xe21a('0x23')]+_0x8aa5ab[_0xe21a('0x24')];var _0x3eb25e;if(_0x4d1985>=_0xd02c99){_0x4d1985=_0xd02c99;_0x3eb25e=0xc8;}else{_0x3eb25e=0xce;}_0x518189[_0xe21a('0x21')](_0x3eb25e);return _0x518189[_0xe21a('0x26')](_0xe21a('0x27'),_0xfce545+'-'+_0x4d1985+'/'+_0xd02c99)['json'](_0x228c8);}return null;};}function patchUpdates(_0x31a1ef){return function(_0x3e1c0e){try{jsonpatch['apply'](_0x3e1c0e,_0x31a1ef,!![]);}catch(_0x290856){return BPromise[_0xe21a('0x28')](_0x290856);}return _0x3e1c0e['save']();};}function saveUpdates(_0x1b076b,_0x4e059){return function(_0x135f59){if(_0x135f59){return _0x135f59[_0xe21a('0x29')](_0x1b076b)[_0xe21a('0x2a')](function(_0x2303dd){return _0x2303dd;});}return null;};}function removeEntity(_0x861f4e,_0xf265f7){return function(_0x532902){if(_0x532902){return _0x532902['destroy']()[_0xe21a('0x2a')](function(){_0x861f4e[_0xe21a('0x21')](0xcc)[_0xe21a('0x2b')]();});}};}function handleEntityNotFound(_0x11060b,_0x22e8e7){return function(_0x3db690){if(!_0x3db690){_0x11060b[_0xe21a('0x20')](0x194);}return _0x3db690;};}function handleError(_0x5e832d,_0x1089de){_0x1089de=_0x1089de||0x1f4;return function(_0x1282c5){logger[_0xe21a('0x2c')](_0x1282c5[_0xe21a('0x2d')]);if(_0x1282c5[_0xe21a('0x2e')]){delete _0x1282c5['name'];}_0x5e832d[_0xe21a('0x21')](_0x1089de)[_0xe21a('0x2f')](_0x1282c5);};}exports[_0xe21a('0x30')]=function(_0x277eaf,_0x113143){var _0x382f22={},_0x472845={},_0x1b8d18={'count':0x0,'rows':[]};var _0x55b1e3=_['map'](db[_0xe21a('0x31')][_0xe21a('0x32')],function(_0x2e9e0f){return{'name':_0x2e9e0f[_0xe21a('0x33')],'type':_0x2e9e0f[_0xe21a('0x34')]['key']};});_0x472845['model']=_[_0xe21a('0x35')](_0x55b1e3,_0xe21a('0x2e'));_0x472845['query']=_['keys'](_0x277eaf[_0xe21a('0x36')]);_0x472845[_0xe21a('0x37')]=_['intersection'](_0x472845[_0xe21a('0x38')],_0x472845[_0xe21a('0x36')]);_0x382f22[_0xe21a('0x39')]=_[_0xe21a('0x3a')](_0x472845[_0xe21a('0x38')],qs['fields'](_0x277eaf[_0xe21a('0x36')][_0xe21a('0x3b')]));_0x382f22['attributes']=_0x382f22[_0xe21a('0x39')][_0xe21a('0x3c')]?_0x382f22['attributes']:_0x472845['model'];if(!_0x277eaf[_0xe21a('0x36')][_0xe21a('0x3d')](_0xe21a('0x3e'))){_0x382f22[_0xe21a('0x24')]=qs[_0xe21a('0x24')](_0x277eaf[_0xe21a('0x36')][_0xe21a('0x24')]);_0x382f22[_0xe21a('0x23')]=qs[_0xe21a('0x23')](_0x277eaf[_0xe21a('0x36')][_0xe21a('0x23')]);}_0x382f22[_0xe21a('0x3f')]=qs[_0xe21a('0x40')](_0x277eaf[_0xe21a('0x36')]['sort']);_0x382f22[_0xe21a('0x41')]=qs[_0xe21a('0x37')](_[_0xe21a('0x42')](_0x277eaf[_0xe21a('0x36')],_0x472845[_0xe21a('0x37')]),_0x55b1e3);if(_0x277eaf[_0xe21a('0x36')]['filter']){_0x382f22['where']=_[_0xe21a('0x43')](_0x382f22[_0xe21a('0x41')],{'$or':_[_0xe21a('0x35')](_0x55b1e3,function(_0x571f3c){if(_0x571f3c[_0xe21a('0x34')]!=='VIRTUAL'){var _0x2e2167={};_0x2e2167[_0x571f3c['name']]={'$like':'%'+_0x277eaf[_0xe21a('0x36')]['filter']+'%'};return _0x2e2167;}})});}_0x382f22=_[_0xe21a('0x43')]({},_0x382f22,_0x277eaf[_0xe21a('0x44')]);var _0x263f39={'where':_0x382f22['where']};return db[_0xe21a('0x31')][_0xe21a('0x25')](_0x263f39)[_0xe21a('0x2a')](function(_0x4d61b4){_0x1b8d18[_0xe21a('0x25')]=_0x4d61b4;if(_0x277eaf[_0xe21a('0x36')][_0xe21a('0x45')]){_0x382f22['include']=[{'all':!![]}];}return db[_0xe21a('0x31')][_0xe21a('0x46')](_0x382f22);})[_0xe21a('0x2a')](function(_0x129203){_0x1b8d18[_0xe21a('0x47')]=_0x129203;return _0x1b8d18;})['then'](respondWithFilteredResult(_0x113143,_0x382f22))[_0xe21a('0x48')](handleError(_0x113143,null));};exports['show']=function(_0x3f6582,_0x362dfb){var _0xb2bf5b={'raw':!![],'where':{'id':_0x3f6582[_0xe21a('0x49')]['id']}},_0x106e14={};_0x106e14['model']=_[_0xe21a('0x4a')](db[_0xe21a('0x31')]['rawAttributes']);_0x106e14[_0xe21a('0x36')]=_['keys'](_0x3f6582[_0xe21a('0x36')]);_0x106e14['filters']=_[_0xe21a('0x3a')](_0x106e14[_0xe21a('0x38')],_0x106e14[_0xe21a('0x36')]);_0xb2bf5b[_0xe21a('0x39')]=_[_0xe21a('0x3a')](_0x106e14[_0xe21a('0x38')],qs['fields'](_0x3f6582[_0xe21a('0x36')][_0xe21a('0x3b')]));_0xb2bf5b[_0xe21a('0x39')]=_0xb2bf5b[_0xe21a('0x39')][_0xe21a('0x3c')]?_0xb2bf5b[_0xe21a('0x39')]:_0x106e14[_0xe21a('0x38')];if(_0x3f6582['query'][_0xe21a('0x45')]){_0xb2bf5b['include']=[{'all':!![]}];}_0xb2bf5b=_[_0xe21a('0x43')]({},_0xb2bf5b,_0x3f6582[_0xe21a('0x44')]);return db[_0xe21a('0x31')][_0xe21a('0x4b')](_0xb2bf5b)['then'](handleEntityNotFound(_0x362dfb,null))[_0xe21a('0x2a')](respondWithResult(_0x362dfb,null))[_0xe21a('0x48')](handleError(_0x362dfb,null));};exports[_0xe21a('0x4c')]=function(_0x20c5f1,_0x172168){return db[_0xe21a('0x31')]['create'](_0x20c5f1[_0xe21a('0x4d')],{})[_0xe21a('0x2a')](respondWithResult(_0x172168,0xc9))[_0xe21a('0x48')](handleError(_0x172168,null));};exports[_0xe21a('0x29')]=function(_0x49f427,_0xbfe4a1){if(_0x49f427[_0xe21a('0x4d')]['id']){delete _0x49f427[_0xe21a('0x4d')]['id'];}return db[_0xe21a('0x31')][_0xe21a('0x4b')]({'where':{'id':_0x49f427[_0xe21a('0x49')]['id']}})[_0xe21a('0x2a')](handleEntityNotFound(_0xbfe4a1,null))['then'](saveUpdates(_0x49f427[_0xe21a('0x4d')],null))[_0xe21a('0x2a')](respondWithResult(_0xbfe4a1,null))['catch'](handleError(_0xbfe4a1,null));};exports[_0xe21a('0x4e')]=function(_0x1054d2,_0x2678b1){return db[_0xe21a('0x31')]['find']({'where':{'id':_0x1054d2[_0xe21a('0x49')]['id']}})[_0xe21a('0x2a')](handleEntityNotFound(_0x2678b1,null))[_0xe21a('0x2a')](removeEntity(_0x2678b1,null))[_0xe21a('0x48')](handleError(_0x2678b1,null));};exports[_0xe21a('0x4f')]=function(_0x2e51f1,_0x4c0a96){return db[_0xe21a('0x31')]['describe']()[_0xe21a('0x2a')](respondWithResult(_0x4c0a96,null))[_0xe21a('0x48')](handleError(_0x4c0a96,null));};exports[_0xe21a('0x50')]=function(_0x312b6b,_0x475f4a,_0x595f1a){return db[_0xe21a('0x51')]['count']({'where':{'ChatGroupId':_0x312b6b[_0xe21a('0x49')]['id'],'ToId':_0x312b6b[_0xe21a('0x52')]['id'],'read':![]}})['then'](function(_0x1c91bb){return{'id':_[_0xe21a('0x53')](_0x312b6b[_0xe21a('0x49')]['id']),'count':_0x1c91bb};})[_0xe21a('0x2a')](respondWithResult(_0x475f4a,null))[_0xe21a('0x48')](handleError(_0x475f4a,null));};exports['addMembers']=function(_0x5ea347,_0x5b9444,_0x3f5516){return db[_0xe21a('0x31')][_0xe21a('0x4b')]({'where':{'id':_0x5ea347[_0xe21a('0x49')]['id']}})[_0xe21a('0x2a')](handleEntityNotFound(_0x5b9444,null))[_0xe21a('0x2a')](function(_0x5be32e){if(_0x5be32e){return _0x5be32e['addMembers'](_0x5ea347[_0xe21a('0x4d')][_0xe21a('0x54')],_[_0xe21a('0x55')](_0x5ea347[_0xe21a('0x4d')],['ids','id'])||{});}})[_0xe21a('0x2a')](respondWithResult(_0x5b9444,null))[_0xe21a('0x48')](handleError(_0x5b9444,null));};exports['getMembers']=function(_0x5bd832,_0x43399b,_0x5d1cc6){var _0x5cbfcb={};var _0x38c776={};var _0x502b22;var _0x2c7e01;return db[_0xe21a('0x31')][_0xe21a('0x56')]({'where':{'id':_0x5bd832[_0xe21a('0x49')]['id']}})[_0xe21a('0x2a')](handleEntityNotFound(_0x43399b,null))[_0xe21a('0x2a')](function(_0x256353){if(_0x256353){_0x502b22=_0x256353;_0x38c776[_0xe21a('0x38')]=_[_0xe21a('0x4a')](db[_0xe21a('0x57')]['rawAttributes']);_0x38c776['query']=_['keys'](_0x5bd832[_0xe21a('0x36')]);_0x38c776[_0xe21a('0x37')]=_[_0xe21a('0x3a')](_0x38c776[_0xe21a('0x38')],_0x38c776[_0xe21a('0x36')]);_0x5cbfcb['attributes']=_['intersection'](_0x38c776['model'],qs[_0xe21a('0x3b')](_0x5bd832['query'][_0xe21a('0x3b')]));_0x5cbfcb[_0xe21a('0x39')]=_0x5cbfcb[_0xe21a('0x39')]['length']?_0x5cbfcb['attributes']:_0x38c776[_0xe21a('0x38')];_0x5cbfcb[_0xe21a('0x3f')]=qs[_0xe21a('0x40')](_0x5bd832[_0xe21a('0x36')]['sort']);_0x5cbfcb[_0xe21a('0x41')]=qs[_0xe21a('0x37')](_[_0xe21a('0x42')](_0x5bd832[_0xe21a('0x36')],_0x38c776[_0xe21a('0x37')]));if(_0x5bd832['query']['filter']){_0x5cbfcb[_0xe21a('0x41')]=_[_0xe21a('0x43')](_0x5cbfcb[_0xe21a('0x41')],{'$or':_[_0xe21a('0x35')](_0x5cbfcb[_0xe21a('0x39')],function(_0x21c635){var _0x2366f0={};_0x2366f0[_0x21c635]={'$like':'%'+_0x5bd832[_0xe21a('0x36')]['filter']+'%'};return _0x2366f0;})});}_0x5cbfcb=_['merge']({},_0x5cbfcb,_0x5bd832[_0xe21a('0x44')]);return _0x502b22[_0xe21a('0x58')](_0x5cbfcb);}})[_0xe21a('0x2a')](function(_0x31b553){if(_0x31b553){_0x2c7e01=_0x31b553['length'];if(!_0x5bd832[_0xe21a('0x36')][_0xe21a('0x3d')](_0xe21a('0x3e'))){_0x5cbfcb['limit']=qs[_0xe21a('0x24')](_0x5bd832['query']['limit']);_0x5cbfcb[_0xe21a('0x23')]=qs[_0xe21a('0x23')](_0x5bd832[_0xe21a('0x36')][_0xe21a('0x23')]);}return _0x502b22[_0xe21a('0x58')](_0x5cbfcb);}})[_0xe21a('0x2a')](function(_0x500001){if(_0x500001){return _0x500001?{'count':_0x2c7e01,'rows':_0x500001}:null;}})[_0xe21a('0x2a')](respondWithResult(_0x43399b,null))['catch'](handleError(_0x43399b,null));};exports[_0xe21a('0x59')]=function(_0xeef15,_0x22bc77,_0xbf07f9){return db[_0xe21a('0x31')]['find']({'where':{'id':_0xeef15[_0xe21a('0x49')]['id']}})[_0xe21a('0x2a')](handleEntityNotFound(_0x22bc77,null))[_0xe21a('0x2a')](function(_0x231404){if(_0x231404){return _0x231404['removeMembers'](_0xeef15[_0xe21a('0x36')]['ids']);}})[_0xe21a('0x2a')](respondWithStatusCode(_0x22bc77,null))[_0xe21a('0x48')](handleError(_0x22bc77,null));};exports[_0xe21a('0x5a')]=function(_0xfb39e5,_0x3c34a7,_0x255bf3){if(_0xfb39e5[_0xe21a('0x4d')]['id']){delete _0xfb39e5[_0xe21a('0x4d')]['id'];}return db[_0xe21a('0x31')]['find']({'where':{'id':_0xfb39e5[_0xe21a('0x49')]['id']}})[_0xe21a('0x2a')](handleEntityNotFound(_0x3c34a7,null))[_0xe21a('0x2a')](function(_0x48deec){if(_0x48deec){_0xfb39e5[_0xe21a('0x4d')][_0xe21a('0x5b')]=_0x48deec['id'];return db['ChatInternalMessage'][_0xe21a('0x4c')](_0xfb39e5[_0xe21a('0x4d')]);}})[_0xe21a('0x2a')](respondWithResult(_0x3c34a7,null))[_0xe21a('0x48')](handleError(_0x3c34a7,null));};exports[_0xe21a('0x5c')]=function(_0x3cc21b,_0x1dec42,_0x19c80d){var _0x336497={};var _0x5f12ca={};var _0x430e63;var _0xcc6507;return db['ChatGroup'][_0xe21a('0x56')]({'where':{'id':_0x3cc21b['params']['id']}})['then'](handleEntityNotFound(_0x1dec42,null))['then'](function(_0x25decd){if(_0x25decd){_0x430e63=_0x25decd;_0x5f12ca['model']=_[_0xe21a('0x4a')](db[_0xe21a('0x51')][_0xe21a('0x32')]);_0x5f12ca['query']=_['keys'](_0x3cc21b['query']);_0x5f12ca['filters']=_[_0xe21a('0x3a')](_0x5f12ca[_0xe21a('0x38')],_0x5f12ca[_0xe21a('0x36')]);_0x336497[_0xe21a('0x39')]=_[_0xe21a('0x3a')](_0x5f12ca[_0xe21a('0x38')],qs[_0xe21a('0x3b')](_0x3cc21b[_0xe21a('0x36')][_0xe21a('0x3b')]));_0x336497[_0xe21a('0x39')]=_0x336497[_0xe21a('0x39')][_0xe21a('0x3c')]?_0x336497[_0xe21a('0x39')]:_0x5f12ca['model'];_0x336497[_0xe21a('0x3f')]=qs[_0xe21a('0x40')](_0x3cc21b['query'][_0xe21a('0x40')]);_0x336497['where']=qs[_0xe21a('0x37')](_[_0xe21a('0x42')](_0x3cc21b[_0xe21a('0x36')],_0x5f12ca[_0xe21a('0x37')]));if(_0x3cc21b[_0xe21a('0x36')][_0xe21a('0x5d')]){_0x336497['where']=_[_0xe21a('0x43')](_0x336497['where'],{'$or':_[_0xe21a('0x35')](_0x336497[_0xe21a('0x39')],function(_0x2daed6){var _0x402aff={};_0x402aff[_0x2daed6]={'$like':'%'+_0x3cc21b['query']['filter']+'%'};return _0x402aff;})});}if(_0x3cc21b['query'][_0xe21a('0x5e')]){var _0x36905a=_0x3cc21b[_0xe21a('0x36')][_0xe21a('0x5e')]['split'](',');var _0x3726af={};_0x3726af[_0x36905a[0x0]]={'$gte':moment(_0x36905a[0x1])[_0xe21a('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x336497[_0xe21a('0x41')]=_[_0xe21a('0x43')](_0x336497[_0xe21a('0x41')],_0x3726af);}_0x336497=_[_0xe21a('0x43')]({},_0x336497,_0x3cc21b['options']);return _0x430e63[_0xe21a('0x5c')](_0x336497);}})[_0xe21a('0x2a')](function(_0x217d18){if(_0x217d18){_0xcc6507=_0x217d18[_0xe21a('0x3c')];if(!_0x3cc21b['query'][_0xe21a('0x3d')](_0xe21a('0x3e'))){_0x336497['limit']=qs[_0xe21a('0x24')](_0x3cc21b[_0xe21a('0x36')][_0xe21a('0x24')]);_0x336497['offset']=qs[_0xe21a('0x23')](_0x3cc21b[_0xe21a('0x36')][_0xe21a('0x23')]);}return _0x430e63[_0xe21a('0x5c')](_0x336497);}})[_0xe21a('0x2a')](function(_0x49c46e){if(_0x49c46e){return _0x49c46e?{'count':_0xcc6507,'rows':_0x49c46e}:null;}})[_0xe21a('0x2a')](respondWithResult(_0x1dec42,null))['catch'](handleError(_0x1dec42,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 15d71f2..25ff2ef 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 _0x8cad=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update'];(function(_0x3b8bde,_0x75252){var _0x17c714=function(_0x567c17){while(--_0x567c17){_0x3b8bde['push'](_0x3b8bde['shift']());}};_0x17c714(++_0x75252);}(_0x8cad,0xfe));var _0xd8ca=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x8cad[_0x500419];return _0x241c1a;};'use strict';var EventEmitter=require(_0xd8ca('0x0'));var ChatGroup=require(_0xd8ca('0x1'))['db'][_0xd8ca('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xd8ca('0x3')](0x0);var events={'afterCreate':_0xd8ca('0x4'),'afterUpdate':_0xd8ca('0x5'),'afterDestroy':_0xd8ca('0x6')};function emitEvent(_0x10c3c8){return function(_0x1334ec,_0x1e29ce,_0x388aeb){ChatGroupEvents[_0xd8ca('0x7')](_0x10c3c8+':'+_0x1334ec['id'],_0x1334ec);ChatGroupEvents[_0xd8ca('0x7')](_0x10c3c8,_0x1334ec);_0x388aeb(null);};}for(var e in events){if(events[_0xd8ca('0x8')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xd8ca('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0xd6f9=['remove','emit','hasOwnProperty','events','../../mysqldb','save','update'];(function(_0x4ba33d,_0x4c5912){var _0x3c2436=function(_0x2a0658){while(--_0x2a0658){_0x4ba33d['push'](_0x4ba33d['shift']());}};_0x3c2436(++_0x4c5912);}(_0xd6f9,0x1ca));var _0x9d6f=function(_0x26da89,_0x264785){_0x26da89=_0x26da89-0x0;var _0xc95b7b=_0xd6f9[_0x26da89];return _0xc95b7b;};'use strict';var EventEmitter=require(_0x9d6f('0x0'));var ChatGroup=require(_0x9d6f('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9d6f('0x2'),'afterUpdate':_0x9d6f('0x3'),'afterDestroy':_0x9d6f('0x4')};function emitEvent(_0x1a8463){return function(_0x5d8c7f,_0x1c2057,_0x39810d){ChatGroupEvents[_0x9d6f('0x5')](_0x1a8463+':'+_0x5d8c7f['id'],_0x5d8c7f);ChatGroupEvents['emit'](_0x1a8463,_0x5d8c7f);_0x39810d(null);};}for(var e in events){if(events[_0x9d6f('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 256d125..eadbd3f 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 _0xf5bb=['../../config/logger','bluebird','request-promise','rimraf','exports','chat_groups','lodash','util'];(function(_0x3e15f4,_0x2d29a1){var _0x3bb93d=function(_0x396c8b){while(--_0x396c8b){_0x3e15f4['push'](_0x3e15f4['shift']());}};_0x3bb93d(++_0x2d29a1);}(_0xf5bb,0x6e));var _0xbf5b=function(_0x14d82f,_0x59df29){_0x14d82f=_0x14d82f-0x0;var _0x133722=_0xf5bb[_0x14d82f];return _0x133722;};'use strict';var _=require(_0xbf5b('0x0'));var util=require(_0xbf5b('0x1'));var logger=require(_0xbf5b('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbf5b('0x3'));var rp=require(_0xbf5b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf5b('0x5'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0xbf5b('0x6')]=function(_0x4322e1,_0xd9e96a){return _0x4322e1['define']('ChatGroup',attributes,{'tableName':_0xbf5b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xadbb=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','lodash'];(function(_0x48d933,_0x4eaabe){var _0x4caf07=function(_0x403c1f){while(--_0x403c1f){_0x48d933['push'](_0x48d933['shift']());}};_0x4caf07(++_0x4eaabe);}(_0xadbb,0xc2));var _0xbadb=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xadbb[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xbadb('0x0'));var util=require(_0xbadb('0x1'));var logger=require(_0xbadb('0x2'))(_0xbadb('0x3'));var moment=require('moment');var BPromise=require(_0xbadb('0x4'));var rp=require(_0xbadb('0x5'));var fs=require('fs');var path=require(_0xbadb('0x6'));var rimraf=require(_0xbadb('0x7'));var config=require(_0xbadb('0x8'));var attributes=require(_0xbadb('0x9'));module[_0xbadb('0xa')]=function(_0x2c00aa,_0x33c9b2){return _0x2c00aa[_0xbadb('0xb')](_0xbadb('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 07288c9..6e5d627 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 _0x57d4=['ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./chatGroup.socket','register','request','then','info'];(function(_0x34a717,_0x2c828c){var _0x4cf768=function(_0x4db333){while(--_0x4db333){_0x34a717['push'](_0x34a717['shift']());}};_0x4cf768(++_0x2c828c);}(_0x57d4,0x78));var _0x457d=function(_0x5204b2,_0x4a531a){_0x5204b2=_0x5204b2-0x0;var _0x8b129c=_0x57d4[_0x5204b2];return _0x8b129c;};'use strict';var _=require(_0x457d('0x0'));var util=require(_0x457d('0x1'));var moment=require('moment');var BPromise=require(_0x457d('0x2'));var rs=require(_0x457d('0x3'));var fs=require('fs');var Redis=require(_0x457d('0x4'));var db=require(_0x457d('0x5'))['db'];var utils=require(_0x457d('0x6'));var logger=require(_0x457d('0x7'))(_0x457d('0x8'));var config=require(_0x457d('0x9'));var jayson=require(_0x457d('0xa'));var client=jayson[_0x457d('0xb')][_0x457d('0xc')]({'port':0x232a});config['redis']=_[_0x457d('0xd')](config[_0x457d('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x457d('0xe')]));require(_0x457d('0xf'))[_0x457d('0x10')](socket);function respondWithRpcPromise(_0x559024,_0x5bc628,_0x568a59){return new BPromise(function(_0x2214e6,_0x38ec93){return client[_0x457d('0x11')](_0x559024,_0x568a59)[_0x457d('0x12')](function(_0x25ae31){logger[_0x457d('0x13')](_0x457d('0x14'),_0x5bc628,_0x457d('0x15'));logger[_0x457d('0x16')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x5bc628,_0x457d('0x15'),JSON[_0x457d('0x17')](_0x25ae31));if(_0x25ae31['error']){if(_0x25ae31['error'][_0x457d('0x18')]===0x1f4){logger[_0x457d('0x19')](_0x457d('0x14'),_0x5bc628,_0x25ae31[_0x457d('0x19')][_0x457d('0x1a')]);return _0x38ec93(_0x25ae31[_0x457d('0x19')][_0x457d('0x1a')]);}logger[_0x457d('0x19')]('ChatGroup,\x20%s,\x20%s',_0x5bc628,_0x25ae31[_0x457d('0x19')][_0x457d('0x1a')]);return _0x2214e6(_0x25ae31[_0x457d('0x19')]['message']);}else{logger['info'](_0x457d('0x14'),_0x5bc628,'request\x20sent');_0x2214e6(_0x25ae31[_0x457d('0x1b')][_0x457d('0x1a')]);}})['catch'](function(_0x2a22b6){logger['error']('ChatGroup,\x20%s,\x20%s',_0x5bc628,_0x2a22b6);_0x38ec93(_0x2a22b6);});});}
\ No newline at end of file
+var _0xcdd0=['./chatGroup.socket','register','then','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','info','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x3dc258,_0x4c1713){var _0x5a089d=function(_0x41f414){while(--_0x41f414){_0x3dc258['push'](_0x3dc258['shift']());}};_0x5a089d(++_0x4c1713);}(_0xcdd0,0xd9));var _0x0cdd=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xcdd0[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0x0cdd('0x0'));var util=require(_0x0cdd('0x1'));var moment=require(_0x0cdd('0x2'));var BPromise=require(_0x0cdd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0cdd('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0cdd('0x5'))('rpc');var config=require(_0x0cdd('0x6'));var jayson=require(_0x0cdd('0x7'));var client=jayson[_0x0cdd('0x8')]['http']({'port':0x232a});config[_0x0cdd('0x9')]=_[_0x0cdd('0xa')](config[_0x0cdd('0x9')],{'host':_0x0cdd('0xb'),'port':0x18eb});var socket=require(_0x0cdd('0xc'))(new Redis(config[_0x0cdd('0x9')]));require(_0x0cdd('0xd'))[_0x0cdd('0xe')](socket);function respondWithRpcPromise(_0x1708e2,_0x25f1fb,_0x2e2187){return new BPromise(function(_0x246486,_0xe81d8c){return client['request'](_0x1708e2,_0x2e2187)[_0x0cdd('0xf')](function(_0x359813){logger['info'](_0x0cdd('0x10'),_0x25f1fb,_0x0cdd('0x11'));logger['debug'](_0x0cdd('0x12'),_0x25f1fb,'request\x20sent',JSON[_0x0cdd('0x13')](_0x359813));if(_0x359813[_0x0cdd('0x14')]){if(_0x359813['error']['code']===0x1f4){logger[_0x0cdd('0x14')]('ChatGroup,\x20%s,\x20%s',_0x25f1fb,_0x359813['error']['message']);return _0xe81d8c(_0x359813[_0x0cdd('0x14')]['message']);}logger[_0x0cdd('0x14')](_0x0cdd('0x10'),_0x25f1fb,_0x359813[_0x0cdd('0x14')]['message']);return _0x246486(_0x359813[_0x0cdd('0x14')]['message']);}else{logger[_0x0cdd('0x15')](_0x0cdd('0x10'),_0x25f1fb,_0x0cdd('0x11'));_0x246486(_0x359813['result']['message']);}})[_0x0cdd('0x16')](function(_0x534b8f){logger[_0x0cdd('0x14')](_0x0cdd('0x10'),_0x25f1fb,_0x534b8f);_0xe81d8c(_0x534b8f);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 1d03d43..4b0429f 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 _0x19dd=['emit','removeListener','register','length','chatGroup:','./chatGroup.events','save','update'];(function(_0x4ca4ba,_0x155385){var _0x1cf44d=function(_0x25f438){while(--_0x25f438){_0x4ca4ba['push'](_0x4ca4ba['shift']());}};_0x1cf44d(++_0x155385);}(_0x19dd,0xed));var _0xd19d=function(_0x4c108a,_0x446e7d){_0x4c108a=_0x4c108a-0x0;var _0x402892=_0x19dd[_0x4c108a];return _0x402892;};'use strict';var ChatGroupEvents=require(_0xd19d('0x0'));var events=[_0xd19d('0x1'),'remove',_0xd19d('0x2')];function createListener(_0xb4920c,_0x2c0c9f){return function(_0x1d6ecd){_0x2c0c9f[_0xd19d('0x3')](_0xb4920c,_0x1d6ecd);};}function removeListener(_0x255f24,_0x17767b){return function(){ChatGroupEvents[_0xd19d('0x4')](_0x255f24,_0x17767b);};}exports[_0xd19d('0x5')]=function(_0x49c6f1){for(var _0x528600=0x0,_0x16d31c=events[_0xd19d('0x6')];_0x528600<_0x16d31c;_0x528600++){var _0x4a8c63=events[_0x528600];var _0x47ad98=createListener(_0xd19d('0x7')+_0x4a8c63,_0x49c6f1);ChatGroupEvents['on'](_0x4a8c63,_0x47ad98);}};
\ No newline at end of file
+var _0x9ebc=['emit','register','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x2cbc30,_0x225c44){var _0x118268=function(_0x21596f){while(--_0x21596f){_0x2cbc30['push'](_0x2cbc30['shift']());}};_0x118268(++_0x225c44);}(_0x9ebc,0x123));var _0xc9eb=function(_0x1b3d86,_0x4463fa){_0x1b3d86=_0x1b3d86-0x0;var _0x171257=_0x9ebc[_0x1b3d86];return _0x171257;};'use strict';var ChatGroupEvents=require(_0xc9eb('0x0'));var events=[_0xc9eb('0x1'),_0xc9eb('0x2'),'update'];function createListener(_0x310f95,_0x4357c9){return function(_0x58870e){_0x4357c9[_0xc9eb('0x3')](_0x310f95,_0x58870e);};}function removeListener(_0x384035,_0x5b58b5){return function(){ChatGroupEvents['removeListener'](_0x384035,_0x5b58b5);};}exports[_0xc9eb('0x4')]=function(_0xcf7236){for(var _0x2fb721=0x0,_0x48cb97=events[_0xc9eb('0x5')];_0x2fb721<_0x48cb97;_0x2fb721++){var _0x1f6ad0=events[_0x2fb721];var _0x5b3410=createListener(_0xc9eb('0x6')+_0x1f6ad0,_0xcf7236);ChatGroupEvents['on'](_0x1f6ad0,_0x5b3410);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 18a9199..991d0b2 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 _0x5a23=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','post','create','/:id/members','addMembers','addMessage','put','update','delete','destroy','exports','multer'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x5a23,0xdf));var _0x35a2=function(_0x1eb25d,_0x65835a){_0x1eb25d=_0x1eb25d-0x0;var _0x22348c=_0x5a23[_0x1eb25d];return _0x22348c;};'use strict';var multer=require(_0x35a2('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x35a2('0x1'));var router=express[_0x35a2('0x2')]();var fs_extra=require(_0x35a2('0x3'));var auth=require(_0x35a2('0x4'));var interaction=require(_0x35a2('0x5'));var config=require('../../config/environment');var controller=require(_0x35a2('0x6'));router[_0x35a2('0x7')]('/',auth[_0x35a2('0x8')](),controller[_0x35a2('0x9')]);router[_0x35a2('0x7')](_0x35a2('0xa'),auth[_0x35a2('0x8')](),controller['describe']);router[_0x35a2('0x7')](_0x35a2('0xb'),auth['isAuthenticated'](),controller[_0x35a2('0xc')]);router[_0x35a2('0x7')](_0x35a2('0xd'),auth['isAuthenticated'](),controller[_0x35a2('0xe')]);router[_0x35a2('0x7')]('/:id/members',auth['isAuthenticated'](),controller[_0x35a2('0xf')]);router[_0x35a2('0x7')](_0x35a2('0x10'),auth[_0x35a2('0x8')](),controller[_0x35a2('0x11')]);router[_0x35a2('0x12')]('/',auth['isAuthenticated'](),controller[_0x35a2('0x13')]);router[_0x35a2('0x12')](_0x35a2('0x14'),auth[_0x35a2('0x8')](),controller[_0x35a2('0x15')]);router[_0x35a2('0x12')](_0x35a2('0x10'),auth['isAuthenticated'](),controller[_0x35a2('0x16')]);router[_0x35a2('0x17')]('/:id',auth[_0x35a2('0x8')](),controller[_0x35a2('0x18')]);router[_0x35a2('0x19')](_0x35a2('0xb'),auth[_0x35a2('0x8')](),controller[_0x35a2('0x1a')]);router[_0x35a2('0x19')](_0x35a2('0x14'),auth[_0x35a2('0x8')](),controller['removeMembers']);module[_0x35a2('0x1b')]=router;
\ No newline at end of file
+var _0xc5d5=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/messages','getMessages','post','create','addMembers','addMessage','put','delete','destroy','/:id/members','removeMembers','exports','multer','path','connect-timeout','express'];(function(_0x11c8a6,_0x42952e){var _0x4a1e3f=function(_0x264d01){while(--_0x264d01){_0x11c8a6['push'](_0x11c8a6['shift']());}};_0x4a1e3f(++_0x42952e);}(_0xc5d5,0x182));var _0x5c5d=function(_0x2a0d5a,_0x1f722e){_0x2a0d5a=_0x2a0d5a-0x0;var _0x752abb=_0xc5d5[_0x2a0d5a];return _0x752abb;};'use strict';var multer=require(_0x5c5d('0x0'));var util=require('util');var path=require(_0x5c5d('0x1'));var timeout=require(_0x5c5d('0x2'));var express=require(_0x5c5d('0x3'));var router=express['Router']();var fs_extra=require(_0x5c5d('0x4'));var auth=require(_0x5c5d('0x5'));var interaction=require(_0x5c5d('0x6'));var config=require(_0x5c5d('0x7'));var controller=require(_0x5c5d('0x8'));router['get']('/',auth[_0x5c5d('0x9')](),controller[_0x5c5d('0xa')]);router[_0x5c5d('0xb')](_0x5c5d('0xc'),auth[_0x5c5d('0x9')](),controller[_0x5c5d('0xd')]);router[_0x5c5d('0xb')](_0x5c5d('0xe'),auth['isAuthenticated'](),controller[_0x5c5d('0xf')]);router[_0x5c5d('0xb')](_0x5c5d('0x10'),auth[_0x5c5d('0x9')](),controller[_0x5c5d('0x11')]);router[_0x5c5d('0xb')]('/:id/members',auth[_0x5c5d('0x9')](),controller['getMembers']);router['get'](_0x5c5d('0x12'),auth[_0x5c5d('0x9')](),controller[_0x5c5d('0x13')]);router[_0x5c5d('0x14')]('/',auth['isAuthenticated'](),controller[_0x5c5d('0x15')]);router[_0x5c5d('0x14')]('/:id/members',auth['isAuthenticated'](),controller[_0x5c5d('0x16')]);router[_0x5c5d('0x14')](_0x5c5d('0x12'),auth[_0x5c5d('0x9')](),controller[_0x5c5d('0x17')]);router[_0x5c5d('0x18')](_0x5c5d('0xe'),auth[_0x5c5d('0x9')](),controller['update']);router[_0x5c5d('0x19')](_0x5c5d('0xe'),auth[_0x5c5d('0x9')](),controller[_0x5c5d('0x1a')]);router[_0x5c5d('0x19')](_0x5c5d('0x1b'),auth[_0x5c5d('0x9')](),controller[_0x5c5d('0x1c')]);module[_0x5c5d('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index db3ad88..658d345 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 _0xe511=['DATE','long','ENUM','out','sequelize','exports','INTEGER','star','thumb','TEXT','STRING'];(function(_0x275c8f,_0x316886){var _0x47519b=function(_0x576942){while(--_0x576942){_0x275c8f['push'](_0x275c8f['shift']());}};_0x47519b(++_0x316886);}(_0xe511,0x16f));var _0x1e51=function(_0x2a99f1,_0x198fd7){_0x2a99f1=_0x2a99f1-0x0;var _0x6948e5=_0xe511[_0x2a99f1];return _0x6948e5;};'use strict';var Sequelize=require(_0x1e51('0x0'));module[_0x1e51('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x1e51('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x1e51('0x3'),_0x1e51('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x1e51('0x5')]},'pathTranscript':{'type':Sequelize[_0x1e51('0x5')]},'mailTranscript':{'type':Sequelize[_0x1e51('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x1e51('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x1e51('0x6')]},'thirdDisposition':{'type':Sequelize[_0x1e51('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x1e51('0x6')]},'osName':{'type':Sequelize[_0x1e51('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x1e51('0x6')]},'deviceType':{'type':Sequelize[_0x1e51('0x6')]},'referer':{'type':Sequelize[_0x1e51('0x5')]},'customerIp':{'type':Sequelize[_0x1e51('0x6')]},'formData':{'type':Sequelize[_0x1e51('0x5')](_0x1e51('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x1e51('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x1e51('0x9')]('in',_0x1e51('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x1e51('0x6')]},'customerPort':{'type':Sequelize[_0x1e51('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x1e51('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x065e=['sequelize','ENUM','star','thumb','TEXT','STRING','long','DATE','BOOLEAN'];(function(_0x21c478,_0x5460f7){var _0x3a2e82=function(_0x1f8661){while(--_0x1f8661){_0x21c478['push'](_0x21c478['shift']());}};_0x3a2e82(++_0x5460f7);}(_0x065e,0x1a7));var _0xe065=function(_0x2ee935,_0x1f940c){_0x2ee935=_0x2ee935-0x0;var _0x3c960e=_0x065e[_0x2ee935];return _0x3c960e;};'use strict';var Sequelize=require(_0xe065('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xe065('0x1')](_0xe065('0x2'),_0xe065('0x3')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xe065('0x4')]},'mailTranscript':{'type':Sequelize[_0xe065('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xe065('0x5')]},'secondDisposition':{'type':Sequelize[_0xe065('0x5')]},'thirdDisposition':{'type':Sequelize[_0xe065('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xe065('0x5')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xe065('0x5')]},'osVersion':{'type':Sequelize[_0xe065('0x5')]},'deviceModel':{'type':Sequelize[_0xe065('0x5')]},'deviceVendor':{'type':Sequelize[_0xe065('0x5')]},'deviceType':{'type':Sequelize[_0xe065('0x5')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xe065('0x5')]},'formData':{'type':Sequelize[_0xe065('0x4')](_0xe065('0x6'))},'read1stAt':{'type':Sequelize[_0xe065('0x7')]},'lastMsgAt':{'type':Sequelize[_0xe065('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xe065('0x1')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xe065('0x5')]},'vidaooSessionId':{'type':Sequelize[_0xe065('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xe065('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 fe09c43..a60bc37 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 _0x55e0=['nolimit','order','sort','where','select','field','color','tools_tags','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','from','chat_interactions','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','i.id','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','ChatInteractionId','all','rows','catch','show','params','includeAll','include','options','create','describe','findOne','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','follow','isNull','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','close','root','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','Messages','ChatWebsite','ContactId','%s%d','System','customer','format','Visitor','agentIdentifier','agentAlias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','addMessage','ids','omit','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','pick','secret','includeAgent','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','Account','Owner','mkdirSync','Chat','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','createWriteStream','out','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','err','unlinkSync','rimraf','zip-dir','request-promise','moment','util','path','ejs','lodash','squel','ioredis','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','name','render','merge','body','contact','agent','interaction','account','map','fullname','TagIds','Tags','split','forEach','push','waiting','talking','answered','abandoned','total','closed','UserId','disposition','unmanaged','index','ChatInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty'];(function(_0x475516,_0x1a8b71){var _0x2732f2=function(_0x5ab274){while(--_0x5ab274){_0x475516['push'](_0x475516['shift']());}};_0x2732f2(++_0x1a8b71);}(_0x55e0,0xdc));var _0x055e=function(_0x3e29bf,_0xc3b103){_0x3e29bf=_0x3e29bf-0x0;var _0x2c1601=_0x55e0[_0x3e29bf];return _0x2c1601;};'use strict';var rimraf=require(_0x055e('0x0'));var zipdir=require(_0x055e('0x1'));var rp=require(_0x055e('0x2'));var moment=require(_0x055e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x055e('0x4'));var path=require(_0x055e('0x5'));var ejs=require(_0x055e('0x6'));var fs=require('fs');var _=require(_0x055e('0x7'));var squel=require(_0x055e('0x8'));var Redis=require(_0x055e('0x9'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x055e('0xa'));var logger=require('../../config/logger')(_0x055e('0xb'));var config=require(_0x055e('0xc'));var db=require(_0x055e('0xd'))['db'];config[_0x055e('0xe')]=_[_0x055e('0xf')](config['redis'],{'host':_0x055e('0x10'),'port':0x18eb});var socket=require(_0x055e('0x11'))(new Redis(config[_0x055e('0xe')]));require(_0x055e('0x12'))[_0x055e('0x13')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x055e('0x14')]({'port':0x232b});var client9004=jayson['client'][_0x055e('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x466da3,_0x72d424,_0x101bc3,_0xc98c6a){return new BPromise(function(_0x31c649,_0x236a2b){var _0x4bca5d=_0xc98c6a||client;return _0x4bca5d[_0x055e('0x15')](_0x466da3,_0x101bc3)[_0x055e('0x16')](function(_0x3cfd14){logger[_0x055e('0x17')](_0x055e('0x18'),_0x72d424,'request\x20sent');logger[_0x055e('0x19')](_0x055e('0x1a'),_0x72d424,_0x055e('0x1b'),JSON['stringify'](_0x3cfd14));if(_0x3cfd14[_0x055e('0x1c')]){if(_0x3cfd14[_0x055e('0x1c')][_0x055e('0x1d')]===0x1f4){logger[_0x055e('0x1c')](_0x055e('0x18'),_0x72d424,_0x3cfd14['error'][_0x055e('0x1e')]);return _0x236a2b(_0x3cfd14[_0x055e('0x1c')][_0x055e('0x1e')]);}logger[_0x055e('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x72d424,_0x3cfd14[_0x055e('0x1c')][_0x055e('0x1e')]);return _0x31c649(_0x3cfd14['error'][_0x055e('0x1e')]);}else{logger[_0x055e('0x17')](_0x055e('0x18'),_0x72d424,_0x055e('0x1b'));_0x31c649(_0x3cfd14[_0x055e('0x1f')][_0x055e('0x1e')]);}})['catch'](function(_0x31c355){logger[_0x055e('0x1c')](_0x055e('0x18'),_0x72d424,_0x31c355);_0x236a2b(_0x31c355);});});}function respondWithStatusCode(_0x5930ff,_0x3f444a){_0x3f444a=_0x3f444a||0xcc;return function(_0x2da6b){if(_0x2da6b){return _0x5930ff[_0x055e('0x20')](_0x3f444a);}return _0x5930ff[_0x055e('0x21')](_0x3f444a)['end']();};}function respondWithResult(_0x71a6e1,_0x56c372){_0x56c372=_0x56c372||0xc8;return function(_0x33ffdf){if(_0x33ffdf){return _0x71a6e1[_0x055e('0x21')](_0x56c372)[_0x055e('0x22')](_0x33ffdf);}};}function respondWithFilteredResult(_0x1a76c6,_0x40c62a){return function(_0x4c653c){if(_0x4c653c){var _0x58caf9=typeof _0x40c62a[_0x055e('0x23')]===_0x055e('0x24')&&typeof _0x40c62a[_0x055e('0x25')]==='undefined';var _0x408e38=_0x4c653c[_0x055e('0x26')];var _0x42f2df=_0x58caf9?0x0:_0x40c62a[_0x055e('0x23')];var _0x59539d=_0x58caf9?_0x4c653c[_0x055e('0x26')]:_0x40c62a['offset']+_0x40c62a[_0x055e('0x25')];var _0x35def0;if(_0x59539d>=_0x408e38){_0x59539d=_0x408e38;_0x35def0=0xc8;}else{_0x35def0=0xce;}_0x1a76c6[_0x055e('0x21')](_0x35def0);return _0x1a76c6[_0x055e('0x27')](_0x055e('0x28'),_0x42f2df+'-'+_0x59539d+'/'+_0x408e38)['json'](_0x4c653c);}return null;};}function saveUpdates(_0x99a372){return function(_0x453e5e){if(_0x453e5e){return _0x453e5e[_0x055e('0x29')](_0x99a372)[_0x055e('0x16')](function(_0x36abb2){return _0x36abb2;});}return null;};}function removeEntity(_0x225c88){return function(_0x59f8c4){if(_0x59f8c4){return _0x59f8c4[_0x055e('0x2a')]()['then'](function(){_0x225c88[_0x055e('0x21')](0xcc)[_0x055e('0x2b')]();});}};}function handleEntityNotFound(_0x5cfeea){return function(_0xd9298d){if(!_0xd9298d){_0x5cfeea[_0x055e('0x20')](0x194);}return _0xd9298d;};}function handleError(_0x524344,_0x20717b){_0x20717b=_0x20717b||0x1f4;return function(_0x23c611){logger[_0x055e('0x1c')](_0x23c611['stack']);if(_0x23c611['name']){delete _0x23c611[_0x055e('0x2c')];}_0x524344['status'](_0x20717b)['send'](_0x23c611);};}function getMustacheRender(_0x55a1ee,_0x31ee60){return Mustache[_0x055e('0x2d')](_0x55a1ee,_[_0x055e('0x2e')](_0x31ee60[_0x055e('0x2f')],{'contact':_0x31ee60[_0x055e('0x30')],'message':_0x31ee60[_0x055e('0x1e')],'agent':_0x31ee60[_0x055e('0x31')],'interaction':_0x31ee60[_0x055e('0x32')],'account':_0x31ee60[_0x055e('0x33')]}))||'';}function getInteractionUsers(_0x2f60fa,_0x2f839c){return new BPromise(function(_0x263a81,_0x54539e){try{if(_0x2f839c[_0x2f60fa['id']]){_0x2f60fa['Users']=_[_0x055e('0x34')](_0x2f839c[_0x2f60fa['id']],function(_0x47790a){return{'id':_0x47790a['id'],'fullname':_0x47790a[_0x055e('0x35')]};});}}catch(_0xf3abf6){_0x54539e(_0xf3abf6);}_0x263a81(_0x2f60fa);});}function getInteractionTags(_0x34d5f2,_0x21aaad){return new BPromise(function(_0xb08e29,_0x4f24f8){try{if(_0x34d5f2[_0x055e('0x36')]){_0x34d5f2[_0x055e('0x37')]=[];_0x34d5f2[_0x055e('0x36')][_0x055e('0x38')](',')[_0x055e('0x39')](function(_0x585b8a){_0x34d5f2[_0x055e('0x37')][_0x055e('0x3a')](_0x21aaad[_0x585b8a]);});}delete _0x34d5f2['TagIds'];}catch(_0x39ecd7){_0x4f24f8(_0x39ecd7);}_0xb08e29(_0x34d5f2);});}function updateChatInteraction(_0x1a109f,_0x4a97ab,_0x99688b){return new BPromise(function(_0x2d7815,_0x4e424b){return getInteractionUsers(_0x1a109f,_0x99688b)[_0x055e('0x16')](function(_0x233423){return getInteractionTags(_0x233423,_0x4a97ab);})['then'](function(_0x1012a4){return getStateInteraction(_0x1012a4);})[_0x055e('0x16')](function(_0x1478c2){_0x2d7815(_0x1478c2);})['catch'](function(_0x1715ed){_0x4e424b(_0x1715ed);});});}function getStateInteraction(_0x1dd07b){return new BPromise(function(_0x574ea0){_0x1dd07b[_0x055e('0x3b')]=0x0;_0x1dd07b[_0x055e('0x3c')]=0x0;_0x1dd07b[_0x055e('0x3d')]=0x0;_0x1dd07b['unmanaged']=0x0;_0x1dd07b[_0x055e('0x3e')]=0x0;_0x1dd07b[_0x055e('0x3f')]=0x0;if(!_0x1dd07b[_0x055e('0x40')]&&!_0x1dd07b['UserId']){_0x1dd07b['waiting']+=0x1;}if(!_0x1dd07b[_0x055e('0x40')]&&_0x1dd07b[_0x055e('0x41')]){_0x1dd07b['talking']+=0x1;if(_0x1dd07b[_0x055e('0x3b')]){_0x1dd07b['waiting']-=0x1;}}if(_0x1dd07b[_0x055e('0x40')]&&_0x1dd07b['disposition']===_0x055e('0x3e')){_0x1dd07b[_0x055e('0x3e')]+=0x1;if(_0x1dd07b[_0x055e('0x3b')]){_0x1dd07b['waiting']-=0x1;}}else if(_0x1dd07b['closed']&&!_0x1dd07b[_0x055e('0x41')]&&_0x1dd07b[_0x055e('0x42')]){_0x1dd07b[_0x055e('0x43')]+=0x1;if(_0x1dd07b[_0x055e('0x3b')]){_0x1dd07b['waiting']-=0x1;}}else if(_0x1dd07b['closed']&&_0x1dd07b[_0x055e('0x41')]){_0x1dd07b[_0x055e('0x3d')]+=0x1;if(_0x1dd07b['talking']){_0x1dd07b[_0x055e('0x3c')]-=0x1;}}_0x1dd07b[_0x055e('0x3f')]+=0x1;_0x574ea0(_0x1dd07b);});}exports[_0x055e('0x44')]=function(_0x20eb76,_0x19e29c){var _0x1f3c73={},_0x479f4e={},_0x297edd={'count':0x0,'rows':[]};var _0x118a0e=_['map'](db[_0x055e('0x45')][_0x055e('0x46')],function(_0x341c46){return{'name':_0x341c46[_0x055e('0x47')],'type':_0x341c46[_0x055e('0x48')][_0x055e('0x49')]};});_0x479f4e[_0x055e('0x4a')]=_['map'](_0x118a0e,_0x055e('0x2c'));_0x479f4e['query']=_[_0x055e('0x4b')](_0x20eb76[_0x055e('0x4c')]);_0x479f4e[_0x055e('0x4d')]=_['intersection'](_0x479f4e['model'],_0x479f4e[_0x055e('0x4c')]);_0x1f3c73[_0x055e('0x4e')]=_[_0x055e('0x4f')](_0x479f4e[_0x055e('0x4a')],qs[_0x055e('0x50')](_0x20eb76[_0x055e('0x4c')][_0x055e('0x50')]));_0x1f3c73[_0x055e('0x4e')]=_0x1f3c73[_0x055e('0x4e')]['length']?_0x1f3c73[_0x055e('0x4e')]:_0x479f4e[_0x055e('0x4a')];if(!_0x20eb76[_0x055e('0x4c')][_0x055e('0x51')](_0x055e('0x52'))){_0x1f3c73['limit']=qs[_0x055e('0x25')](_0x20eb76[_0x055e('0x4c')][_0x055e('0x25')]);_0x1f3c73['offset']=qs[_0x055e('0x23')](_0x20eb76['query'][_0x055e('0x23')]);}_0x1f3c73[_0x055e('0x53')]=qs['sort'](_0x20eb76[_0x055e('0x4c')][_0x055e('0x54')]);_0x1f3c73[_0x055e('0x55')]=qs['filters'](_['pick'](_0x20eb76[_0x055e('0x4c')],_0x479f4e[_0x055e('0x4d')]),_0x118a0e);var _0x393717=[];var _0x248e5f=squel[_0x055e('0x56')]()[_0x055e('0x57')]('id')[_0x055e('0x57')](_0x055e('0x2c'))[_0x055e('0x57')](_0x055e('0x58'))['from'](_0x055e('0x59'));var _0x7f03ed=squel[_0x055e('0x56')]()[_0x055e('0x57')]('u.id')[_0x055e('0x57')](_0x055e('0x5a'))[_0x055e('0x57')](_0x055e('0x5b'))['from']('user_has_chat_interactions','ui')[_0x055e('0x5c')](_0x055e('0x5d'),'u',_0x055e('0x5e'));var _0x2fbb1c=squel[_0x055e('0x56')]()[_0x055e('0x5f')](_0x055e('0x60'),'i')[_0x055e('0x5c')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x055e('0x5c')](_0x055e('0x5d'),'o','o.id\x20=\x20i.UserId')[_0x055e('0x5c')](_0x055e('0x61'),'a',_0x055e('0x62'))[_0x055e('0x5c')]('chat_messages','me',_0x055e('0x63'))[_0x055e('0x5c')](_0x055e('0x64'),'it',_0x055e('0x65'))[_0x055e('0x5c')](_0x055e('0x59'),'t',_0x055e('0x66'));var _0x31935b=squel['expr']();var _0x3cb600=[];var _0x23794c=squel['expr']();var _0x29b754;if(_0x20eb76[_0x055e('0x4c')][_0x055e('0x67')]){_0x29b754=as[_0x055e('0x68')](_0x20eb76['query'][_0x055e('0x67')]);var _0x18b7f7=_0x29b754[_0x055e('0x69')];for(var _0x4deec3=0x0;_0x4deec3<_0x29b754[_0x055e('0x6a')][_0x055e('0x6b')];_0x4deec3++){var _0xf2c62d=_0x29b754[_0x055e('0x6a')][_0x4deec3];var _0xcc4661='i';var _0x584e60=_[_0x055e('0x6c')](_0x118a0e,[_0x055e('0x2c'),_0xf2c62d[_0x055e('0x57')]]);if(!_0x584e60){switch(_0xf2c62d[_0x055e('0x57')]){case _0x055e('0x6d'):if(_0xf2c62d['value']==0x1){_0x2fbb1c[_0x055e('0x6e')]('`'+_0xf2c62d[_0x055e('0x57')]+_0x055e('0x6f'));}else{_0x2fbb1c['having']('`'+_0xf2c62d[_0x055e('0x57')]+_0x055e('0x70'));}break;case _0x055e('0x71'):if(_0xf2c62d[_0x055e('0x72')]===_0x055e('0x73')){if(_0xf2c62d['value'][_0x055e('0x38')]('\x20')['length']>0x1){_0x31935b[_0x18b7f7](_0x055e('0x74'),qs[_0x055e('0x75')](_0xf2c62d['value']),null);}else{var _0x3137bb='%'+_0xf2c62d[_0x055e('0x76')]+'%';_0x31935b[_0x18b7f7](_0x055e('0x77'),_0x3137bb,_0x3137bb,_0x3137bb);}}else{_0x584e60=_[_0x055e('0x6c')](_0x118a0e,['name','ContactId']);_0xf2c62d[_0x055e('0x57')]='ContactId';_0x200ed2=as[_0x055e('0x78')](_0xcc4661,_0x584e60[_0x055e('0x48')],_0xf2c62d);_0x31935b[_0x18b7f7](_0x200ed2[_0x055e('0x79')],_0x200ed2[_0x055e('0x76')][_0x055e('0x7a')],_0x200ed2[_0x055e('0x76')][_0x055e('0x2b')]);}break;case _0x055e('0x7b'):var _0x3de5f1=_0xf2c62d[_0x055e('0x76')]['split'](',')['map'](function(_0xb8b2a0){return Number(_0xb8b2a0);});_0x3de5f1[_0x055e('0x39')](function(_0x52a6e9){_0x23794c['or'](_0x055e('0x7c'),'%,'+_0x52a6e9+',%');});_0x3cb600=_['union'](_0x3cb600,_0x3de5f1);break;case _0x055e('0x7d'):if(_0xf2c62d[_0x055e('0x72')]===_0x055e('0x73')){_0x31935b[_0x18b7f7](_0x055e('0x7e'),'%'+_0xf2c62d[_0x055e('0x76')]+'%',null);}else{_0x584e60=_[_0x055e('0x6c')](_0x118a0e,[_0x055e('0x2c'),_0x055e('0x41')]);_0xf2c62d['field']=_0x055e('0x41');_0x200ed2=as[_0x055e('0x78')](_0xcc4661,_0x584e60[_0x055e('0x48')],_0xf2c62d);_0x31935b[_0x18b7f7](_0x200ed2[_0x055e('0x79')],_0x200ed2[_0x055e('0x76')][_0x055e('0x7a')],_0x200ed2[_0x055e('0x76')][_0x055e('0x2b')]);}break;case _0x055e('0x2f'):_0x200ed2=as['buildExpression']('me',null,_0xf2c62d);_0x31935b[_0x18b7f7](_0x200ed2[_0x055e('0x79')],_0x200ed2[_0x055e('0x76')]['start'],_0x200ed2[_0x055e('0x76')][_0x055e('0x2b')]);break;}}else{var _0x200ed2=as[_0x055e('0x78')](_0xcc4661,_0x584e60['type'],_0xf2c62d);_0x31935b[_0x18b7f7](_0x200ed2[_0x055e('0x79')],_0x200ed2[_0x055e('0x76')][_0x055e('0x7a')],_0x200ed2[_0x055e('0x76')][_0x055e('0x2b')]);}}}else{var _0x525d4f=_(_0x20eb76[_0x055e('0x4c')])[_0x055e('0x4b')]()[_0x055e('0x34')](function(_0xe21a0e){return _['some'](_0x118a0e,[_0x055e('0x2c'),_0xe21a0e])?_0xe21a0e:undefined;})[_0x055e('0x7f')]()[_0x055e('0x76')]();if(!_[_0x055e('0x80')](_0x525d4f)){_0x525d4f[_0x055e('0x39')](function(_0x59e669){if(_0x59e669===_0x055e('0x81')){_0x2fbb1c[_0x055e('0x55')](_0x055e('0x82'),[][_0x055e('0x83')](_0x20eb76['query'][_0x59e669]));}else if(_0x59e669===_0x055e('0x84')){var _0x94e3e=JSON[_0x055e('0x85')](_0x20eb76[_0x055e('0x4c')][_0x59e669])['$gte'];var _0x22f4db=JSON[_0x055e('0x85')](_0x20eb76[_0x055e('0x4c')][_0x59e669])[_0x055e('0x86')];_0x2fbb1c[_0x055e('0x55')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x94e3e,_0x22f4db);}else{if(_0x20eb76[_0x055e('0x4c')][_0x59e669]===_0x055e('0x87')){_0x2fbb1c[_0x055e('0x55')]('i.'+_0x59e669+'\x20IS\x20NULL');}else{_0x2fbb1c['where']('i.'+_0x59e669+_0x055e('0x88'),_0x20eb76['query'][_0x59e669]);}}});}if(_0x20eb76[_0x055e('0x4c')][_0x055e('0x89')]){if(_0x20eb76['query'][_0x055e('0x89')]==0x1){_0x2fbb1c[_0x055e('0x6e')](_0x055e('0x8a'));}else{_0x2fbb1c[_0x055e('0x6e')](_0x055e('0x8b'));}}if(_0x20eb76[_0x055e('0x4c')][_0x055e('0x8c')]){_0x3cb600=_[_0x055e('0x8d')](_0x20eb76[_0x055e('0x4c')][_0x055e('0x8c')])?_0x20eb76[_0x055e('0x4c')][_0x055e('0x8c')]:new Array(_0x20eb76[_0x055e('0x4c')][_0x055e('0x8c')]);_0x3cb600[_0x055e('0x39')](function(_0xba91c3){_0x23794c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xba91c3+',%');});}if(_0x20eb76[_0x055e('0x4c')]['filter']){var _0x5d2993=_0x20eb76[_0x055e('0x4c')][_0x055e('0x8e')][_0x055e('0x8f')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x055e('0x90')](_0x5d2993)){_0x31935b['or'](_0x055e('0x91'),_0x5d2993+'%');}else{_0x31935b['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x055e('0x75')](_0x5d2993))['or'](_0x055e('0x92'),_0x5d2993+'%');}}}_0x2fbb1c['where'](_0x31935b);_0x2fbb1c[_0x055e('0x93')]('i.id');var _0xc825b0={'type':db[_0x055e('0x94')][_0x055e('0x95')][_0x055e('0x96')],'raw':!![]};var _0x49db81=_0x2fbb1c['clone']();_0x49db81['field'](_0x055e('0x97'));_0x49db81['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x055e('0x6d'));if(_0x1f3c73['order']){_0x1f3c73[_0x055e('0x53')][_0x055e('0x39')](function(_0x15a107){var _0x1c3a1a=_0x15a107[0x0]==='contactName'?_0x15a107[0x0]:'i.'+_0x15a107[0x0];_0x2fbb1c['order'](_0x1c3a1a,_0x15a107[0x1]===_0x055e('0x98')?![]:!![]);});}if(!_[_0x055e('0x80')](_0x3cb600)){_0x2fbb1c[_0x055e('0x6e')](_0x23794c);_0x49db81[_0x055e('0x55')](_0x055e('0x99'),_0x3cb600);}BPromise[_0x055e('0x9a')]()[_0x055e('0x16')](function(){if(!_0x29b754){if(_0x20eb76['query'][_0x055e('0x81')])return;_0x49db81['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x2fbb1c[_0x055e('0x55')](_0x055e('0x9b'));return;}if(_0x20eb76[_0x055e('0x9c')]['role']!==_0x055e('0x31'))return;return _0x20eb76[_0x055e('0x9c')][_0x055e('0x9d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x785c9c){if(_[_0x055e('0x80')](_0x785c9c)){_0x49db81[_0x055e('0x55')](_0x055e('0x9e'));_0x2fbb1c[_0x055e('0x55')](_0x055e('0x9e'));}else{_0x49db81[_0x055e('0x55')](_0x055e('0x82'),_[_0x055e('0x34')](_0x785c9c,'id'));_0x2fbb1c[_0x055e('0x55')](_0x055e('0x82'),_[_0x055e('0x34')](_0x785c9c,'id'));}});})[_0x055e('0x16')](function(){if(_0x20eb76[_0x055e('0x9c')][_0x055e('0x9f')]===_0x055e('0x31')&&!_0x29b754&&!_0x20eb76['query'][_0x055e('0x81')])return[];return db[_0x055e('0xa0')][_0x055e('0x4c')](_0x49db81['toString'](),_0xc825b0);})['then'](function(_0x4fd7e2){_0x297edd[_0x055e('0x26')]=_0x4fd7e2[_0x055e('0x6b')];if(_0x297edd[_0x055e('0x26')]===0x0)return[];return db[_0x055e('0xa0')][_0x055e('0x4c')](_0x248e5f[_0x055e('0xa1')](),_0xc825b0)[_0x055e('0x16')](function(_0x2f9a0f){_0x393717=_['keyBy'](_0x2f9a0f,'id');_0xc825b0=_[_0x055e('0x2e')](_0xc825b0,{'model':db[_0x055e('0x45')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x20eb76[_0x055e('0x4c')][_0x055e('0x50')]){_0x1f3c73[_0x055e('0x4e')][_0x055e('0x39')](function(_0x46e8f4){_0x2fbb1c[_0x055e('0x57')]('i.'+_0x46e8f4);});}else{_0x2fbb1c[_0x055e('0x57')](_0x055e('0xa2'),_0x055e('0x6d'));_0x2fbb1c[_0x055e('0x57')]('a.key','Account.key');_0x2fbb1c[_0x055e('0x57')](_0x055e('0xa3'),_0x055e('0xa4'));_0x2fbb1c['field'](_0x055e('0xa5'),_0x055e('0xa6'));_0x2fbb1c[_0x055e('0x57')]('i.*');_0x2fbb1c[_0x055e('0x57')]('c.firstName',_0x055e('0xa7'));_0x2fbb1c['field'](_0x055e('0xa8'),_0x055e('0xa9'));_0x2fbb1c['field']('c.email',_0x055e('0xaa'));_0x2fbb1c['field']('c.phone',_0x055e('0xab'));_0x2fbb1c[_0x055e('0x57')](_0x055e('0xac'),_0x055e('0xad'));_0x2fbb1c[_0x055e('0x57')]('c.fax',_0x055e('0xae'));_0x2fbb1c[_0x055e('0x57')]('o.fullname',_0x055e('0xaf'));_0x2fbb1c[_0x055e('0x57')](_0x055e('0xb0'),_0x055e('0xb1'));_0x2fbb1c[_0x055e('0x57')](_0x055e('0xb2'),_0x055e('0x36'));}if(_0x1f3c73[_0x055e('0x25')])_0x2fbb1c['limit'](_0x1f3c73[_0x055e('0x25')]);if(_0x1f3c73[_0x055e('0x23')])_0x2fbb1c[_0x055e('0x23')](_0x1f3c73[_0x055e('0x23')]);return db[_0x055e('0xa0')][_0x055e('0x4c')](_0x2fbb1c[_0x055e('0xa1')](),_0xc825b0);})[_0x055e('0x16')](function(_0x21ae7c){if(_0x21ae7c[_0x055e('0x6b')]>0x0)_0x7f03ed[_0x055e('0x55')]('ui.ChatInteractionId\x20IN\x20?',_[_0x055e('0x34')](_0x21ae7c,'id'));return db[_0x055e('0xa0')][_0x055e('0x4c')](_0x7f03ed['toString'](),_0xc825b0)['then'](function(_0x35e203){var _0x27b463=_[_0x055e('0xb3')](_0x35e203,_0x055e('0xb4'));var _0xe63e29=[];_0x21ae7c[_0x055e('0x39')](function(_0x505cc4){_0xe63e29[_0x055e('0x3a')](updateChatInteraction(_0x505cc4,_0x393717,_0x27b463));});return BPromise[_0x055e('0xb5')](_0xe63e29);});});})[_0x055e('0x16')](function(_0x324a3d){_0x297edd[_0x055e('0xb6')]=_0x324a3d;return _0x297edd;})[_0x055e('0x16')](respondWithFilteredResult(_0x19e29c,_0x1f3c73))[_0x055e('0xb7')](handleError(_0x19e29c,null));};exports[_0x055e('0xb8')]=function(_0x207f31,_0x4abd2e){var _0x58bf27={'raw':![],'where':{'id':_0x207f31[_0x055e('0xb9')]['id']}},_0x478da3={};_0x478da3[_0x055e('0x4a')]=_[_0x055e('0x4b')](db['ChatInteraction'][_0x055e('0x46')]);_0x478da3[_0x055e('0x4c')]=_[_0x055e('0x4b')](_0x207f31[_0x055e('0x4c')]);_0x478da3[_0x055e('0x4d')]=_[_0x055e('0x4f')](_0x478da3[_0x055e('0x4a')],_0x478da3[_0x055e('0x4c')]);_0x58bf27['attributes']=_[_0x055e('0x4f')](_0x478da3[_0x055e('0x4a')],qs['fields'](_0x207f31['query'][_0x055e('0x50')]));_0x58bf27[_0x055e('0x4e')]=_0x58bf27[_0x055e('0x4e')][_0x055e('0x6b')]?_0x58bf27['attributes']:_0x478da3['model'];if(_0x207f31[_0x055e('0x4c')][_0x055e('0xba')]){_0x58bf27[_0x055e('0xbb')]=[{'all':!![]}];}_0x58bf27=_[_0x055e('0x2e')]({},_0x58bf27,_0x207f31[_0x055e('0xbc')]);return db['ChatInteraction'][_0x055e('0x6c')](_0x58bf27)[_0x055e('0x16')](handleEntityNotFound(_0x4abd2e,null))['then'](respondWithResult(_0x4abd2e,null))[_0x055e('0xb7')](handleError(_0x4abd2e,null));};exports['create']=function(_0x495d7d,_0x47f131){return db[_0x055e('0x45')][_0x055e('0xbd')](_0x495d7d['body'],{})[_0x055e('0x16')](respondWithResult(_0x47f131,0xc9))[_0x055e('0xb7')](handleError(_0x47f131,null));};exports['update']=function(_0xae5b5a,_0x5dffc3){if(_0xae5b5a[_0x055e('0x2f')]['id']){delete _0xae5b5a['body']['id'];}return db[_0x055e('0x45')][_0x055e('0x6c')]({'where':{'id':_0xae5b5a[_0x055e('0xb9')]['id']}})[_0x055e('0x16')](handleEntityNotFound(_0x5dffc3,null))['then'](saveUpdates(_0xae5b5a[_0x055e('0x2f')],null))[_0x055e('0x16')](respondWithResult(_0x5dffc3,null))['catch'](handleError(_0x5dffc3,null));};exports[_0x055e('0x2a')]=function(_0x116f84,_0x174a30){return db[_0x055e('0x45')][_0x055e('0x6c')]({'where':{'id':_0x116f84[_0x055e('0xb9')]['id']}})[_0x055e('0x16')](handleEntityNotFound(_0x174a30,null))[_0x055e('0x16')](removeEntity(_0x174a30,null))[_0x055e('0xb7')](handleError(_0x174a30,null));};exports[_0x055e('0xbe')]=function(_0x1bd652,_0x32bf47){return db[_0x055e('0x45')][_0x055e('0xbe')]()[_0x055e('0x16')](respondWithResult(_0x32bf47,null))[_0x055e('0xb7')](handleError(_0x32bf47,null));};exports['createVidaooSession']=function(_0x2d5bf8,_0x484ee0){var _0x204fef=_0x2d5bf8[_0x055e('0xb9')]['id'];var _0x5ca835;var _0xfb3b6d;var _0x5ee76f;return db[_0x055e('0x45')]['findOne']({'where':{'id':_0x204fef}})[_0x055e('0x16')](function(_0x127c91){_0x5ca835=_0x127c91;return db['ChatWebsite'][_0x055e('0xbf')]({'where':{'id':_0x127c91[_0x055e('0x81')]},'attributes':['id',_0x055e('0xc0'),'vidaooEscalation',_0x055e('0xc1'),_0x055e('0xc2'),_0x055e('0xc3')],'raw':!![]});})[_0x055e('0x16')](function(_0x9d0c0f){if(_0x9d0c0f&&_0x9d0c0f[_0x055e('0xc0')]&&_0x9d0c0f['vidaooEscalation']){_0xfb3b6d=_0x9d0c0f;var _0x41b2af={'interaction':{'id':_0x204fef},'agent':{'id':_0x2d5bf8['user']['id'],'name':_0x2d5bf8[_0x055e('0x9c')][_0x055e('0x2c')],'fullname':_0x2d5bf8['user']['fullname'],'email':_0x2d5bf8[_0x055e('0x9c')]['email']},'contact':_0x2d5bf8['body'][_0x055e('0x30')],'account':_0x2d5bf8['body'][_0x055e('0x33')]};var _0x51c37b={'rejectUnauthorized':![],'method':_0x055e('0xc4'),'url':_0x055e('0xc5'),'headers':{'X-APIKEY':_0x9d0c0f[_0x055e('0xc0')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2d5bf8[_0x055e('0x9c')][_0x055e('0xc6')]],'buttons':null,'topic':_0xfb3b6d['vidaooTopic'],'note':_['isNull'](_0xfb3b6d[_0x055e('0xc2')])?null:getMustacheRender(_0xfb3b6d[_0x055e('0xc2')],_0x41b2af),'metadata':null},'redirect':_0x055e('0xc7'),'json':!![]};try{if(!_[_0x055e('0xc8')](_0xfb3b6d['vidaooMetadata'])){var _0x2b4096=getMustacheRender(_0xfb3b6d[_0x055e('0xc3')],_0x41b2af);var _0x5ed6a5=JSON[_0x055e('0x85')](_0x2b4096);_0x51c37b[_0x055e('0x2f')][_0x055e('0xc9')]=_0x5ed6a5;}}catch(_0x45a14b){throw new db[(_0x055e('0x94'))][(_0x055e('0xca'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x51c37b);}else{throw new db[(_0x055e('0x94'))][(_0x055e('0xca'))](_0x055e('0xcb'));}})['then'](function(_0x38a846){_0x5ee76f=_0x38a846;if(_0x5ee76f['id']){var _0x7d100={'body':_0x5ee76f[_0x055e('0xcc')],'ChatWebsiteId':_0xfb3b6d['id'],'ChatInteractionId':_0x5ca835['id'],'direction':'out','UserId':_0x2d5bf8['user']['id']};return db[_0x055e('0xcd')][_0x055e('0xbd')](_0x7d100,{});}else{throw new db['Sequelize']['ValidationError'](_0x055e('0xce'));}})['then'](function(){return _0x5ca835[_0x055e('0xcf')]({'vidaooSessionId':_0x5ee76f['id']});})[_0x055e('0x16')](respondWithResult(_0x484ee0,null))[_0x055e('0xb7')](handleError(_0x484ee0,null));};exports['customUpdate']=function(_0x1423f4,_0x31db97){if(_0x1423f4[_0x055e('0x2f')]['id']){delete _0x1423f4['body']['id'];}return db[_0x055e('0x45')]['find']({'where':{'id':_0x1423f4[_0x055e('0xb9')]['id']},'include':[{'model':db[_0x055e('0xd0')],'as':_0x055e('0x71')}]})[_0x055e('0x16')](handleEntityNotFound(_0x31db97,null))[_0x055e('0x16')](saveUpdates(_0x1423f4[_0x055e('0x2f')],null))[_0x055e('0x16')](respondWithResult(_0x31db97,null))[_0x055e('0xb7')](handleError(_0x31db97,null));};exports[_0x055e('0xd1')]=function(_0x2b3b85,_0xb88a07){if(_0x2b3b85['body']['id']){delete _0x2b3b85['body']['id'];}return db[_0x055e('0x45')][_0x055e('0x6c')]({'where':{'id':_0x2b3b85[_0x055e('0xb9')]['id']}})[_0x055e('0x16')](function(_0x2704a1){if(!_0x2704a1){logger[_0x055e('0x1c')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x055e('0xd1'),0x194,_0x055e('0xd2'));_0xb88a07[_0x055e('0x20')](0x194);}else{if(_0x2704a1[_0x055e('0x41')]){throw new db[(_0x055e('0x94'))][(_0x055e('0xca'))](_0x055e('0xd3'));}}return _0x2704a1;})[_0x055e('0x16')](function(_0x4900bc){if(_0x4900bc){return _0x4900bc[_0x055e('0x29')]({'closed':_0x2b3b85[_0x055e('0x2f')]['closed'],'disposition':_0x2b3b85[_0x055e('0x2f')][_0x055e('0x42')]})['then'](function(_0x2a3726){return _0x2a3726;});}})[_0x055e('0x16')](function(){return respondWithRpcPromise(_0x055e('0xd4'),'abandon',_0x2b3b85[_0x055e('0x2f')],client9004);})['then'](respondWithResult(_0xb88a07,null))['catch'](handleError(_0xb88a07,null));};exports[_0x055e('0xd5')]=function(_0x400ab5,_0x324439){_0x400ab5[_0x055e('0x2f')][_0x055e('0x2c')]=_0x400ab5[_0x055e('0xd6')][_0x055e('0xd7')];_0x400ab5[_0x055e('0x2f')][_0x055e('0xd8')]=_0x400ab5[_0x055e('0xd6')][_0x055e('0xd9')];_0x400ab5[_0x055e('0x2f')]['type']=_0x400ab5[_0x055e('0xd6')][_0x055e('0xda')];return db[_0x055e('0xdb')][_0x055e('0xbd')](_0x400ab5[_0x055e('0x2f')])[_0x055e('0x16')](respondWithResult(_0x324439,0xc9))[_0x055e('0xb7')](handleError(_0x324439,null));};exports['attachmentDownload']=function(_0xfbb46b,_0x148aae){return db[_0x055e('0x45')][_0x055e('0xbf')]({'where':{'id':_0xfbb46b[_0x055e('0xb9')]['id']},'raw':!![]})[_0x055e('0x16')](handleEntityNotFound(_0x148aae,null))[_0x055e('0x16')](function(_0x36ae94){if(_0x36ae94){if(_0x36ae94[_0x055e('0x40')]){return _0x148aae[_0x055e('0x21')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0x055e('0xdb')][_0x055e('0xbf')]({'where':{'id':_0xfbb46b[_0x055e('0x4c')][_0x055e('0xdc')]},'raw':!![]})[_0x055e('0x16')](handleEntityNotFound(_0x148aae,null));}})['then'](function(_0xa60f8e){if(_0xa60f8e){var _0x115d2b=_0xa60f8e[_0x055e('0xdd')]!==null;var _0x1d00ab=path[_0x055e('0xde')](config['root'],_0x055e('0xdf'));if(_0x115d2b){_0x1d00ab=path[_0x055e('0xde')](_0x1d00ab,_0x055e('0xe0'));}var _0x444324=path[_0x055e('0xde')](_0x1d00ab,_0xa60f8e[_0x055e('0xd8')]);return _0x148aae[_0x055e('0xe1')](_0x444324);}})[_0x055e('0xb7')](handleError(_0x148aae,null));};exports[_0x055e('0xe2')]=function(_0x42077b,_0x6aeb60){var _0x5b00e4=null;var _0x2fb64a=null;var _0x4d3029=null;if(_0x42077b[_0x055e('0x2f')]['id']){delete _0x42077b[_0x055e('0x2f')]['id'];}if(_0x42077b['body']['mailTranscript']){_0x4d3029=path['join'](config[_0x055e('0xe3')],_0x055e('0xe4'),util['format'](_0x055e('0xe5'),Date[_0x055e('0xe6')]()));_0x42077b[_0x055e('0x2f')][_0x055e('0xe7')]=_0x4d3029;}return db[_0x055e('0x45')][_0x055e('0x6c')]({'where':{'id':_0x42077b['params']['id']},'include':[{'model':db[_0x055e('0xcd')],'as':_0x055e('0xe8'),'include':[{'model':db['User'],'as':_0x055e('0x7d')}]}]})[_0x055e('0x16')](handleEntityNotFound(_0x6aeb60,null))['then'](saveUpdates(_0x42077b[_0x055e('0x2f')],null))[_0x055e('0x16')](function(_0x49db7a){if(_0x49db7a){_0x5b00e4=_0x49db7a;return db[_0x055e('0xe9')]['find']({'where':{'id':_0x5b00e4[_0x055e('0x81')]}});}})['then'](function(_0xb60055){if(_0xb60055){_0x2fb64a=_0xb60055;return db['CmContact'][_0x055e('0x6c')]({'where':{'id':_0x5b00e4[_0x055e('0xea')]}});}})[_0x055e('0x16')](function(_0x25011f){if(_0x25011f){if(_0x4d3029){var _0xe83c1f=null;for(var _0x3084c7=0x1;_0x3084c7<_0x5b00e4[_0x055e('0xe8')][_0x055e('0x6b')];++_0x3084c7){_0xe83c1f=_0x5b00e4['Messages'][_0x3084c7];var _0x1dc506=_0xe83c1f['UserId']?util['format'](_0x055e('0xeb'),_0x2fb64a['agentAlias'],_0xe83c1f[_0x055e('0x41')]):_0x055e('0xec');var _0x2c4cc6=_0x42077b[_0x055e('0x2f')][_0x055e('0xed')]||util[_0x055e('0xee')](_0x055e('0xeb'),_0x055e('0xef'),_0xe83c1f[_0x055e('0xea')]);switch(_0x2fb64a[_0x055e('0xf0')]){case'website_alias':_0x1dc506=_0xe83c1f[_0x055e('0x41')]?util[_0x055e('0xee')](_0x055e('0xeb'),_0x2fb64a[_0x055e('0xf1')],_0xe83c1f[_0x055e('0x41')]):_0x055e('0xec');break;case _0x055e('0xf2'):_0x1dc506=_0xe83c1f['UserId']?_0xe83c1f[_0x055e('0x7d')][_0x055e('0xf3')]||_0xe83c1f['User']['fullname']:_0x055e('0xec');break;case'agent_fullname':_0x1dc506=_0xe83c1f[_0x055e('0x41')]?_0xe83c1f['User'][_0x055e('0x35')]:'System';break;default:_0x1dc506=_0xe83c1f[_0x055e('0x41')]?util[_0x055e('0xee')](_0x055e('0xeb'),_0x2fb64a['agentAlias'],_0xe83c1f[_0x055e('0x41')]):_0x055e('0xec');}var _0x43038c=util[_0x055e('0xee')](_0x055e('0xf4'),moment(_0xe83c1f[_0x055e('0x84')])[_0x055e('0xee')](_0x055e('0xf5')),_0xe83c1f[_0x055e('0xf6')]==='in'?_0x2c4cc6:_0x1dc506,_0xe83c1f['body']);if(!_0xe83c1f['secret']){fs[_0x055e('0xf7')](_0x4d3029,_0x43038c);}}return db[_0x055e('0xf8')][_0x055e('0xbf')]({'where':{'service':!![]},'include':[{'model':db[_0x055e('0xf9')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x055e('0xfa')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x055e('0x16')](function(_0x133c5a){if(!_0x133c5a||!_0x133c5a[_0x055e('0xfb')]||!_0x42077b[_0x055e('0x2f')])return _0x5b00e4;var _0x5c9dfb=_0x133c5a[_0x055e('0xfc')]();return respondWithRpcPromise(_0x055e('0xfd'),_0x055e('0xfe'),{'account':_0x5c9dfb,'message':{'from':util[_0x055e('0xee')](_0x055e('0xff'),_0x133c5a[_0x055e('0x2c')],_0x133c5a['email']||_0x133c5a[_0x055e('0xfb')][_0x055e('0x9c')]),'to':_0x42077b[_0x055e('0x2f')][_0x055e('0x100')],'subject':'Mail\x20Transcript','text':util[_0x055e('0xee')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x42077b['body'][_0x055e('0x100')]),'attachments':[{'path':_0x4d3029}]}})['then'](function(){return _0x5b00e4;})['catch'](function(_0x11025e){logger[_0x055e('0x1c')](_0x11025e);});})['then'](respondWithStatusCode(_0x6aeb60,0xc8))['catch'](handleError(_0x6aeb60,null));};exports[_0x055e('0x101')]=function(_0x1458fc,_0x5be45a){return db[_0x055e('0xcd')][_0x055e('0x6c')]({'where':{'id':_0x1458fc['params']['id']}})[_0x055e('0x16')](handleEntityNotFound(_0x5be45a,null))[_0x055e('0x16')](function(_0x1ac372){if(_0x1ac372){return _0x1ac372[_0x055e('0x101')](_0x1458fc[_0x055e('0x2f')][_0x055e('0x102')],_[_0x055e('0x103')](_0x1458fc['body'],[_0x055e('0x102'),'id'])||{});}})['then'](respondWithResult(_0x5be45a,null))['catch'](handleError(_0x5be45a,null));};exports[_0x055e('0x104')]=function(_0x3168db,_0x293731){var _0x3b58fa={'raw':![],'where':{}};var _0x47bc47={};var _0x5c9091={'count':0x0,'rows':[]};return db[_0x055e('0x45')][_0x055e('0xbf')]({'where':{'id':_0x3168db['params']['id']}})[_0x055e('0x16')](handleEntityNotFound(_0x293731,null))[_0x055e('0x16')](function(_0x5b3e5f){if(_0x5b3e5f){_0x47bc47[_0x055e('0x4a')]=_[_0x055e('0x4b')](db[_0x055e('0xcd')]['rawAttributes']);_0x47bc47['query']=_[_0x055e('0x4b')](_0x3168db['query']);_0x47bc47[_0x055e('0x4d')]=_['intersection'](_0x47bc47['model'],_0x47bc47[_0x055e('0x4c')]);_0x3b58fa[_0x055e('0x4e')]=_[_0x055e('0x4f')](_0x47bc47[_0x055e('0x4a')],qs['fields'](_0x3168db[_0x055e('0x4c')]['fields']));_0x3b58fa['attributes']=_0x3b58fa[_0x055e('0x4e')][_0x055e('0x6b')]?_0x3b58fa[_0x055e('0x4e')]:_0x47bc47[_0x055e('0x4a')];if(!_0x3168db[_0x055e('0x4c')][_0x055e('0x51')]('nolimit')){_0x3b58fa[_0x055e('0x25')]=qs[_0x055e('0x25')](_0x3168db[_0x055e('0x4c')][_0x055e('0x25')]);_0x3b58fa[_0x055e('0x23')]=qs['offset'](_0x3168db[_0x055e('0x4c')]['offset']);}_0x3b58fa['order']=qs[_0x055e('0x54')](_0x3168db['query'][_0x055e('0x54')]);_0x3b58fa[_0x055e('0x55')]=qs[_0x055e('0x4d')](_['pick'](_0x3168db[_0x055e('0x4c')],_0x47bc47[_0x055e('0x4d')]));_0x3b58fa['where'][_0x055e('0xb4')]=_0x5b3e5f['id'];if(_0x3168db[_0x055e('0x4c')][_0x055e('0x8e')]){_0x3b58fa[_0x055e('0x55')]=_[_0x055e('0x2e')](_0x3b58fa[_0x055e('0x55')],{'$or':_[_0x055e('0x34')](_0x3b58fa[_0x055e('0x4e')],function(_0x2a9661){var _0x5e7e2e={};_0x5e7e2e[_0x2a9661]={'$like':'%'+_0x3168db['query']['filter']+'%'};return _0x5e7e2e;})});}if(_0x3168db['query'][_0x055e('0x105')]){var _0x496b08=_0x3168db[_0x055e('0x4c')]['$gte']['split'](',');var _0x366512={};_0x366512[_0x496b08[0x0]]={'$gte':moment(_0x496b08[0x1])[_0x055e('0xee')](_0x055e('0x106'))};_0x3b58fa[_0x055e('0x55')]=_[_0x055e('0x2e')](_0x3b58fa[_0x055e('0x55')],_0x366512);}_0x3b58fa=_['merge']({},_0x3b58fa,_0x3168db['options']);return db[_0x055e('0xcd')][_0x055e('0x26')]({'where':_0x3b58fa[_0x055e('0x55')]})[_0x055e('0x16')](function(_0x56456b){_0x5c9091[_0x055e('0x26')]=_0x56456b;if(_0x3168db[_0x055e('0x4c')][_0x055e('0xba')]){_0x3b58fa[_0x055e('0xbb')]=[{'all':!![]}];}return db[_0x055e('0xcd')][_0x055e('0x107')](_0x3b58fa);})[_0x055e('0x16')](function(_0x5ad564){_0x5c9091[_0x055e('0xb6')]=_0x5ad564;return _0x5c9091;});}})[_0x055e('0x16')](respondWithFilteredResult(_0x293731,_0x3b58fa))[_0x055e('0xb7')](handleError(_0x293731,null));};exports[_0x055e('0x108')]=function(_0x52414e,_0x1b69f8){var _0xdaddd0={'where':{}},_0x5b7239={},_0x456ce6={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x055e('0xbf')]({'where':{'id':_0x52414e[_0x055e('0xb9')]['id']}})['then'](handleEntityNotFound(_0x1b69f8,null))['then'](function(_0x3f6e40){if(_0x3f6e40){_0x5b7239[_0x055e('0x4a')]=_[_0x055e('0x4b')](db[_0x055e('0xcd')]['rawAttributes']);_0x5b7239[_0x055e('0x4c')]=_[_0x055e('0x4b')](_0x52414e['query']);_0x5b7239[_0x055e('0x4d')]=_[_0x055e('0x4f')](_0x5b7239[_0x055e('0x4a')],_0x5b7239[_0x055e('0x4c')]);_0xdaddd0[_0x055e('0x4e')]=_[_0x055e('0x4f')](_0x5b7239[_0x055e('0x4a')],qs['fields'](_0x52414e[_0x055e('0x4c')][_0x055e('0x50')]));_0xdaddd0['attributes']=_0xdaddd0['attributes'][_0x055e('0x6b')]?_0xdaddd0[_0x055e('0x4e')]:_0x5b7239['model'];if(!_0x52414e['query']['hasOwnProperty'](_0x055e('0x52'))){_0xdaddd0[_0x055e('0x25')]=qs[_0x055e('0x25')](_0x52414e[_0x055e('0x4c')]['limit']);_0xdaddd0[_0x055e('0x23')]=qs[_0x055e('0x23')](_0x52414e[_0x055e('0x4c')][_0x055e('0x23')]);}_0xdaddd0[_0x055e('0x53')]=qs[_0x055e('0x54')](_0x52414e[_0x055e('0x4c')][_0x055e('0x54')]);_0xdaddd0[_0x055e('0x55')]=qs[_0x055e('0x4d')](_[_0x055e('0x109')](_0x52414e['query'],_0x5b7239[_0x055e('0x4d')]));_0xdaddd0[_0x055e('0x55')][_0x055e('0xb4')]=_0x3f6e40['id'];if(_0x52414e[_0x055e('0x4c')]['filter']){_0xdaddd0['where']=_['merge'](_0xdaddd0['where'],{'$or':_['map'](_0xdaddd0['attributes'],function(_0x348631){var _0x57d1a6={};_0x57d1a6[_0x348631]={'$like':'%'+_0x52414e['query']['filter']+'%'};return _0x57d1a6;})});}_0xdaddd0['where'][_0x055e('0x10a')]=![];if(_0x52414e['query']['id']){_0xdaddd0[_0x055e('0x55')]['id']={'$gt':_0x52414e['query']['id']};}_0xdaddd0=_[_0x055e('0x2e')]({},_0xdaddd0,_0x52414e['options']);return db[_0x055e('0xcd')]['count']({'where':_0xdaddd0[_0x055e('0x55')]})[_0x055e('0x16')](function(_0x411090){_0x456ce6['count']=_0x411090;_0xdaddd0[_0x055e('0xbb')]=[];if(_0x52414e['query'][_0x055e('0x10b')]){_0xdaddd0[_0x055e('0xbb')][_0x055e('0x3a')]({'model':db[_0x055e('0x7d')],'as':_0x055e('0x7d'),'attributes':['id','fullname',_0x055e('0xf3')]});}if(_0x52414e['query'][_0x055e('0xba')]){_0xdaddd0[_0x055e('0xbb')]=[{'all':!![]}];}return db[_0x055e('0xcd')][_0x055e('0x107')](_0xdaddd0);})['then'](function(_0x597e1d){_0x456ce6[_0x055e('0xb6')]=_0x597e1d;return _0x456ce6;});}})[_0x055e('0x16')](respondWithFilteredResult(_0x1b69f8,_0xdaddd0))[_0x055e('0xb7')](handleError(_0x1b69f8,null));};exports[_0x055e('0x10c')]=function(_0x5c7de1,_0x1f14d1){return db['ChatInteraction'][_0x055e('0x6c')]({'where':{'id':_0x5c7de1[_0x055e('0xb9')]['id']}})[_0x055e('0x16')](handleEntityNotFound(_0x1f14d1,null))[_0x055e('0x16')](function(_0x419b3d){if(_0x419b3d){return _0x419b3d[_0x055e('0x10d')](_0x5c7de1['body'][_0x055e('0x102')],_[_0x055e('0x103')](_0x5c7de1[_0x055e('0x2f')],['ids','id'])||{})[_0x055e('0x10e')](function(){return db[_0x055e('0x7b')][_0x055e('0x107')]({'attributes':['id',_0x055e('0x2c'),'color'],'where':{'id':_0x5c7de1[_0x055e('0x2f')]['ids']}});})[_0x055e('0x16')](function(_0x342b10){socket[_0x055e('0x10f')](_0x055e('0x110'),{'id':Number(_0x5c7de1[_0x055e('0xb9')]['id']),'tags':_0x342b10||[]});return{'id':Number(_0x5c7de1[_0x055e('0xb9')]['id']),'tags':_0x342b10||[]};});}})['then'](respondWithResult(_0x1f14d1,null))[_0x055e('0xb7')](handleError(_0x1f14d1,null));};exports[_0x055e('0x111')]=function(_0x2fdf9b,_0x27e111){return db[_0x055e('0x45')][_0x055e('0x6c')]({'where':{'id':_0x2fdf9b['params']['id']}})[_0x055e('0x16')](handleEntityNotFound(_0x27e111,null))['then'](function(_0x1feb0f){if(_0x1feb0f){return _0x1feb0f[_0x055e('0x111')](_0x2fdf9b[_0x055e('0x4c')]['ids']);}})[_0x055e('0x16')](respondWithStatusCode(_0x27e111,null))[_0x055e('0xb7')](handleError(_0x27e111,null));};exports['download']=function(_0x199b86,_0x4c8dcf){var _0x433494=moment()[_0x055e('0x112')]()[_0x055e('0xa1')]();var _0x2c1052=path[_0x055e('0xde')](config[_0x055e('0xe3')],_0x055e('0x113'),_0x055e('0x114'),_0x055e('0x115'));var _0xebbb8c=path['join'](config[_0x055e('0xe3')],_0x055e('0x113'),_0x055e('0x114'),_0x055e('0x116'));var _0x43cf78=path[_0x055e('0xde')](_0x2c1052,_0x433494);var _0x3b27ba=util[_0x055e('0xee')](_0x055e('0x117'),_0x199b86[_0x055e('0xb9')]['id'],_0x433494);var _0x56cd75=path[_0x055e('0xde')](_0x2c1052,_0x3b27ba);var _0xc967a1=[];_0xc967a1[_0x055e('0x3a')]({'model':db[_0x055e('0x7d')],'as':_0x055e('0x7d'),'attributes':['id',_0x055e('0x35')],'raw':!![]});_0xc967a1[_0x055e('0x3a')]({'model':db['CmContact'],'as':_0x055e('0x71'),'attributes':['id',_0x055e('0x118'),'lastName'],'raw':!![]});if(_0x199b86[_0x055e('0x4c')][_0x055e('0x116')]){_0xc967a1['push']({'model':db[_0x055e('0xdb')],'as':_0x055e('0xdb'),'raw':!![]});}var _0x41313e=[{'model':db[_0x055e('0xcd')],'as':_0x055e('0xe8'),'attributes':['id',_0x055e('0x2f'),_0x055e('0x84'),'direction',_0x055e('0x10a'),_0x055e('0x89')],'include':_0xc967a1}];_0x41313e['push']({'model':db[_0x055e('0xe9')],'as':_0x055e('0x119'),'attributes':['id','name']});_0x41313e[_0x055e('0x3a')]({'model':db[_0x055e('0x7d')],'as':_0x055e('0x11a'),'attributes':['id',_0x055e('0x35')]});return db[_0x055e('0x45')][_0x055e('0x6c')]({'where':{'id':_0x199b86['params']['id']},'include':_0x41313e})['then'](handleEntityNotFound(_0x4c8dcf,null))['then'](function(_0x43b91c){if(_0x43b91c){var _0x26028f=_0x43b91c['get']({'plain':!![]});fs[_0x055e('0x11b')](_0x43cf78);var _0x1167e6={'channel':_0x055e('0x11c'),'account':_0x26028f[_0x055e('0x119')][_0x055e('0x2c')],'agent':_0x26028f[_0x055e('0x11a')]?_0x26028f[_0x055e('0x11a')]['fullname']:'N.A.','createdAt':moment(_0x26028f[_0x055e('0x84')])['format'](_0x055e('0x106'))[_0x055e('0xa1')](),'closedAt':_0x26028f['closed']?moment(_0x26028f['closedAt'])[_0x055e('0xee')](_0x055e('0x106'))['toString']():'','disposition':_0x26028f[_0x055e('0x42')],'chatInfo':{'browser':_0x26028f['browserName'],'os':_0x26028f['osName'],'referer':_0x26028f[_0x055e('0x11d')],'customerIp':_0x26028f[_0x055e('0x11e')],'customerPort':_0x26028f[_0x055e('0x11f')]?_0x26028f[_0x055e('0x11f')]:_0x055e('0x120')},'messages':_(_0x26028f[_0x055e('0xe8')])[_0x055e('0x121')]()[_0x055e('0x8e')]({'secret':![]})['map'](function(_0x45acae){if(_0x45acae[_0x055e('0xdb')]){var _0x1b3fc7=path[_0x055e('0xde')](_0xebbb8c,_0x45acae['Attachment'][_0x055e('0xd8')]);if(fs[_0x055e('0x122')](_0x1b3fc7)){fs[_0x055e('0x123')](_0x1b3fc7)['pipe'](fs[_0x055e('0x124')](path[_0x055e('0xde')](_0x43cf78,_0x45acae[_0x055e('0xdb')]['basename'])));}}return{'date':moment(_0x45acae['createdAt'])[_0x055e('0xee')](_0x055e('0x106'))[_0x055e('0xa1')](),'sender':_0x45acae['direction']===_0x055e('0x125')?_0x45acae[_0x055e('0x7d')]?_0x45acae['User'][_0x055e('0x35')]:_0x055e('0xec'):_0x45acae[_0x055e('0x71')][_0x055e('0x118')]+(_0x45acae[_0x055e('0x71')][_0x055e('0x126')]?'\x20'+_0x45acae[_0x055e('0x71')][_0x055e('0x126')]:''),'body':_0x45acae['Attachment']?_0x45acae[_0x055e('0xdb')][_0x055e('0xd8')]:_0x45acae[_0x055e('0x2f')],'direction':_0x45acae[_0x055e('0xf6')]===_0x055e('0x125')?'A':'C','secret':_0x45acae[_0x055e('0x10a')],'read':_0x45acae[_0x055e('0x89')],'attachment':_0x45acae[_0x055e('0xdb')]};})['value']()};return ejs[_0x055e('0x127')](path['join'](config[_0x055e('0xe3')],_0x055e('0x113'),_0x055e('0x128'),_0x055e('0x129')),{'interaction':_0x1167e6})[_0x055e('0x16')](function(_0x1990c8){var _0x45b0dd=path[_0x055e('0xde')](_0x43cf78,_0x055e('0x12a')+_0x26028f['id']+'-'+_0x433494+_0x055e('0x12b'));var _0x4fac37={'path':_0x45b0dd,'channel':_0x055e('0x11c'),'interactionId':_0x26028f['id']};return pdf['createPdfFromHTML'](_0x1990c8,_0x4fac37);})['then'](function(){return new Promise(function(_0x551a21,_0x365f1c){zipdir(_0x43cf78,{'saveTo':_0x56cd75},function(_0x2bd1a9,_0x2a888e){if(_0x2bd1a9)return _0x365f1c(_0x2bd1a9);return _0x551a21(_0x2a888e);});})[_0x055e('0x16')](function(){return new BPromise(function(_0x3420fc,_0x9b5222){rimraf(_0x43cf78,function(_0xce341b){if(_0xce341b)_0x9b5222(_0xce341b);return _0x3420fc();});});})['then'](function(){return _0x4c8dcf[_0x055e('0xe1')](_0x56cd75,_0x3b27ba,function(_0x8509c7){if(_0x8509c7){logger['error'](_0x055e('0x12c'),_0x8509c7);}else{fs[_0x055e('0x12d')](_0x56cd75);}});});});}else{return _0x4c8dcf[_0x055e('0x20')](0xc8);}})[_0x055e('0xb7')](handleError(_0x4c8dcf,null));};
\ No newline at end of file
+var _0x0e85=['sequelize','groupBy','ChatInteractionId','all','show','params','rawAttributes','includeAll','include','options','create','describe','ChatWebsite','findOne','vidaooApiKey','vidaooTopic','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','disposition','AbandonInteraction','abandon','file','originalname','basename','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','root','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','CmContact','%s%d','Visitor','agentIdentifier','website_alias','agentAlias','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','filter','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','includeAgent','setTags','spread','emit','chatInteractionTags:save','removeTags','download','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Attachment','Account','Owner','mkdirSync','N.A.','closedAt','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','ejs','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','then','end','stack','name','send','render','merge','contact','interaction','account','Users','map','Tags','TagIds','split','forEach','push','catch','waiting','answered','unmanaged','abandoned','total','closed','UserId','talking','index','ChatInteraction','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','field','color','from','tools_tags','select','u.id','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','having','`\x20=\x200','`\x20>\x200','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','value','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','i.ChatWebsiteId\x20IN\x20?','concat','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','replace','isNumeric','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','isEmpty','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','user','ChatWebsiteId','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)'];(function(_0x4a94b1,_0x4f2518){var _0x20949f=function(_0x1c4aa6){while(--_0x1c4aa6){_0x4a94b1['push'](_0x4a94b1['shift']());}};_0x20949f(++_0x4f2518);}(_0x0e85,0x7c));var _0x50e8=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x0e85[_0x21a9d9];return _0x46adce;};'use strict';var rimraf=require(_0x50e8('0x0'));var zipdir=require(_0x50e8('0x1'));var rp=require('request-promise');var moment=require(_0x50e8('0x2'));var BPromise=require(_0x50e8('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var ejs=require(_0x50e8('0x4'));var fs=require('fs');var _=require('lodash');var squel=require(_0x50e8('0x5'));var Redis=require(_0x50e8('0x6'));var qs=require(_0x50e8('0x7'));var as=require(_0x50e8('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0x50e8('0x9'))(_0x50e8('0xa'));var config=require(_0x50e8('0xb'));var db=require(_0x50e8('0xc'))['db'];config[_0x50e8('0xd')]=_[_0x50e8('0xe')](config['redis'],{'host':_0x50e8('0xf'),'port':0x18eb});var socket=require(_0x50e8('0x10'))(new Redis(config[_0x50e8('0xd')]));require(_0x50e8('0x11'))[_0x50e8('0x12')](socket);var jayson=require(_0x50e8('0x13'));var client=jayson[_0x50e8('0x14')][_0x50e8('0x15')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0xfc6bb9,_0x24d381,_0x508377,_0x49e02f){return new BPromise(function(_0x3cb45c,_0x2abda1){var _0x1a4c85=_0x49e02f||client;return _0x1a4c85[_0x50e8('0x16')](_0xfc6bb9,_0x508377)['then'](function(_0x18596f){logger[_0x50e8('0x17')](_0x50e8('0x18'),_0x24d381,'request\x20sent');logger['debug'](_0x50e8('0x19'),_0x24d381,_0x50e8('0x1a'),JSON[_0x50e8('0x1b')](_0x18596f));if(_0x18596f[_0x50e8('0x1c')]){if(_0x18596f[_0x50e8('0x1c')][_0x50e8('0x1d')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x24d381,_0x18596f[_0x50e8('0x1c')][_0x50e8('0x1e')]);return _0x2abda1(_0x18596f[_0x50e8('0x1c')][_0x50e8('0x1e')]);}logger[_0x50e8('0x1c')](_0x50e8('0x18'),_0x24d381,_0x18596f[_0x50e8('0x1c')]['message']);return _0x3cb45c(_0x18596f[_0x50e8('0x1c')]['message']);}else{logger[_0x50e8('0x17')](_0x50e8('0x18'),_0x24d381,_0x50e8('0x1a'));_0x3cb45c(_0x18596f[_0x50e8('0x1f')][_0x50e8('0x1e')]);}})['catch'](function(_0x2c7c25){logger[_0x50e8('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x24d381,_0x2c7c25);_0x2abda1(_0x2c7c25);});});}function respondWithStatusCode(_0x31d23c,_0x41500f){_0x41500f=_0x41500f||0xcc;return function(_0x5691b2){if(_0x5691b2){return _0x31d23c[_0x50e8('0x20')](_0x41500f);}return _0x31d23c[_0x50e8('0x21')](_0x41500f)['end']();};}function respondWithResult(_0x47a3d8,_0x59582d){_0x59582d=_0x59582d||0xc8;return function(_0x3e1234){if(_0x3e1234){return _0x47a3d8[_0x50e8('0x21')](_0x59582d)[_0x50e8('0x22')](_0x3e1234);}};}function respondWithFilteredResult(_0x371a1f,_0xc2f832){return function(_0x13b6e9){if(_0x13b6e9){var _0x53d848=typeof _0xc2f832[_0x50e8('0x23')]===_0x50e8('0x24')&&typeof _0xc2f832['limit']===_0x50e8('0x24');var _0x2bc8d8=_0x13b6e9[_0x50e8('0x25')];var _0x2af330=_0x53d848?0x0:_0xc2f832['offset'];var _0x1f5a6c=_0x53d848?_0x13b6e9['count']:_0xc2f832[_0x50e8('0x23')]+_0xc2f832[_0x50e8('0x26')];var _0x42bbef;if(_0x1f5a6c>=_0x2bc8d8){_0x1f5a6c=_0x2bc8d8;_0x42bbef=0xc8;}else{_0x42bbef=0xce;}_0x371a1f['status'](_0x42bbef);return _0x371a1f[_0x50e8('0x27')](_0x50e8('0x28'),_0x2af330+'-'+_0x1f5a6c+'/'+_0x2bc8d8)[_0x50e8('0x22')](_0x13b6e9);}return null;};}function saveUpdates(_0x8d68c8){return function(_0x1d77d0){if(_0x1d77d0){return _0x1d77d0[_0x50e8('0x29')](_0x8d68c8)[_0x50e8('0x2a')](function(_0x54d81d){return _0x54d81d;});}return null;};}function removeEntity(_0x290fd2){return function(_0x123be9){if(_0x123be9){return _0x123be9['destroy']()['then'](function(){_0x290fd2[_0x50e8('0x21')](0xcc)[_0x50e8('0x2b')]();});}};}function handleEntityNotFound(_0x32db93){return function(_0x47ace2){if(!_0x47ace2){_0x32db93['sendStatus'](0x194);}return _0x47ace2;};}function handleError(_0x3e58a9,_0x19e3cc){_0x19e3cc=_0x19e3cc||0x1f4;return function(_0x5c2e04){logger[_0x50e8('0x1c')](_0x5c2e04[_0x50e8('0x2c')]);if(_0x5c2e04[_0x50e8('0x2d')]){delete _0x5c2e04[_0x50e8('0x2d')];}_0x3e58a9['status'](_0x19e3cc)[_0x50e8('0x2e')](_0x5c2e04);};}function getMustacheRender(_0x4ec6ad,_0x3aec30){return Mustache[_0x50e8('0x2f')](_0x4ec6ad,_[_0x50e8('0x30')](_0x3aec30['body'],{'contact':_0x3aec30[_0x50e8('0x31')],'message':_0x3aec30[_0x50e8('0x1e')],'agent':_0x3aec30['agent'],'interaction':_0x3aec30[_0x50e8('0x32')],'account':_0x3aec30[_0x50e8('0x33')]}))||'';}function getInteractionUsers(_0x5db19b,_0x1a7ba4){return new BPromise(function(_0x5b827f,_0x1c513c){try{if(_0x1a7ba4[_0x5db19b['id']]){_0x5db19b[_0x50e8('0x34')]=_[_0x50e8('0x35')](_0x1a7ba4[_0x5db19b['id']],function(_0x4e2a37){return{'id':_0x4e2a37['id'],'fullname':_0x4e2a37['fullname']};});}}catch(_0x3c7778){_0x1c513c(_0x3c7778);}_0x5b827f(_0x5db19b);});}function getInteractionTags(_0x2d0ccf,_0x3f01ee){return new BPromise(function(_0x4d3454,_0x58ec1c){try{if(_0x2d0ccf['TagIds']){_0x2d0ccf[_0x50e8('0x36')]=[];_0x2d0ccf[_0x50e8('0x37')][_0x50e8('0x38')](',')[_0x50e8('0x39')](function(_0x35514b){_0x2d0ccf[_0x50e8('0x36')][_0x50e8('0x3a')](_0x3f01ee[_0x35514b]);});}delete _0x2d0ccf[_0x50e8('0x37')];}catch(_0x35f802){_0x58ec1c(_0x35f802);}_0x4d3454(_0x2d0ccf);});}function updateChatInteraction(_0x3a1b4d,_0x53066b,_0x3371a4){return new BPromise(function(_0x40214f,_0x2379cf){return getInteractionUsers(_0x3a1b4d,_0x3371a4)[_0x50e8('0x2a')](function(_0x5dbbe1){return getInteractionTags(_0x5dbbe1,_0x53066b);})[_0x50e8('0x2a')](function(_0x944e46){return getStateInteraction(_0x944e46);})[_0x50e8('0x2a')](function(_0x169b4f){_0x40214f(_0x169b4f);})[_0x50e8('0x3b')](function(_0x5c7bef){_0x2379cf(_0x5c7bef);});});}function getStateInteraction(_0x53b198){return new BPromise(function(_0x81e6f3){_0x53b198[_0x50e8('0x3c')]=0x0;_0x53b198['talking']=0x0;_0x53b198[_0x50e8('0x3d')]=0x0;_0x53b198[_0x50e8('0x3e')]=0x0;_0x53b198[_0x50e8('0x3f')]=0x0;_0x53b198[_0x50e8('0x40')]=0x0;if(!_0x53b198[_0x50e8('0x41')]&&!_0x53b198[_0x50e8('0x42')]){_0x53b198[_0x50e8('0x3c')]+=0x1;}if(!_0x53b198[_0x50e8('0x41')]&&_0x53b198['UserId']){_0x53b198[_0x50e8('0x43')]+=0x1;if(_0x53b198[_0x50e8('0x3c')]){_0x53b198[_0x50e8('0x3c')]-=0x1;}}if(_0x53b198[_0x50e8('0x41')]&&_0x53b198['disposition']===_0x50e8('0x3f')){_0x53b198[_0x50e8('0x3f')]+=0x1;if(_0x53b198[_0x50e8('0x3c')]){_0x53b198[_0x50e8('0x3c')]-=0x1;}}else if(_0x53b198['closed']&&!_0x53b198[_0x50e8('0x42')]&&_0x53b198['disposition']){_0x53b198['unmanaged']+=0x1;if(_0x53b198['waiting']){_0x53b198[_0x50e8('0x3c')]-=0x1;}}else if(_0x53b198[_0x50e8('0x41')]&&_0x53b198['UserId']){_0x53b198[_0x50e8('0x3d')]+=0x1;if(_0x53b198[_0x50e8('0x43')]){_0x53b198[_0x50e8('0x43')]-=0x1;}}_0x53b198[_0x50e8('0x40')]+=0x1;_0x81e6f3(_0x53b198);});}exports[_0x50e8('0x44')]=function(_0x22527f,_0x51d239){var _0x16fdf6={},_0x596f62={},_0x1cc4fe={'count':0x0,'rows':[]};var _0x504d97=_['map'](db[_0x50e8('0x45')]['rawAttributes'],function(_0x2cbcac){return{'name':_0x2cbcac[_0x50e8('0x46')],'type':_0x2cbcac[_0x50e8('0x47')][_0x50e8('0x48')]};});_0x596f62[_0x50e8('0x49')]=_[_0x50e8('0x35')](_0x504d97,_0x50e8('0x2d'));_0x596f62[_0x50e8('0x4a')]=_[_0x50e8('0x4b')](_0x22527f[_0x50e8('0x4a')]);_0x596f62[_0x50e8('0x4c')]=_['intersection'](_0x596f62[_0x50e8('0x49')],_0x596f62[_0x50e8('0x4a')]);_0x16fdf6['attributes']=_[_0x50e8('0x4d')](_0x596f62['model'],qs[_0x50e8('0x4e')](_0x22527f['query'][_0x50e8('0x4e')]));_0x16fdf6[_0x50e8('0x4f')]=_0x16fdf6[_0x50e8('0x4f')][_0x50e8('0x50')]?_0x16fdf6[_0x50e8('0x4f')]:_0x596f62[_0x50e8('0x49')];if(!_0x22527f[_0x50e8('0x4a')]['hasOwnProperty'](_0x50e8('0x51'))){_0x16fdf6[_0x50e8('0x26')]=qs[_0x50e8('0x26')](_0x22527f[_0x50e8('0x4a')][_0x50e8('0x26')]);_0x16fdf6[_0x50e8('0x23')]=qs['offset'](_0x22527f[_0x50e8('0x4a')][_0x50e8('0x23')]);}_0x16fdf6[_0x50e8('0x52')]=qs[_0x50e8('0x53')](_0x22527f['query'][_0x50e8('0x53')]);_0x16fdf6[_0x50e8('0x54')]=qs[_0x50e8('0x4c')](_[_0x50e8('0x55')](_0x22527f[_0x50e8('0x4a')],_0x596f62[_0x50e8('0x4c')]),_0x504d97);var _0x320b00=[];var _0x5f5220=squel['select']()['field']('id')[_0x50e8('0x56')](_0x50e8('0x2d'))[_0x50e8('0x56')](_0x50e8('0x57'))[_0x50e8('0x58')](_0x50e8('0x59'));var _0x566723=squel[_0x50e8('0x5a')]()[_0x50e8('0x56')](_0x50e8('0x5b'))[_0x50e8('0x56')]('u.fullname')[_0x50e8('0x56')](_0x50e8('0x5c'))[_0x50e8('0x58')](_0x50e8('0x5d'),'ui')[_0x50e8('0x5e')](_0x50e8('0x5f'),'u','u.id\x20=\x20ui.UserId');var _0x234f94=squel['select']()['from']('chat_interactions','i')[_0x50e8('0x5e')]('cm_contacts','c',_0x50e8('0x60'))[_0x50e8('0x5e')](_0x50e8('0x5f'),'o',_0x50e8('0x61'))[_0x50e8('0x5e')](_0x50e8('0x62'),'a',_0x50e8('0x63'))['left_join'](_0x50e8('0x64'),'me',_0x50e8('0x65'))[_0x50e8('0x5e')]('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')['left_join'](_0x50e8('0x59'),'t',_0x50e8('0x66'));var _0x63ca8=squel[_0x50e8('0x67')]();var _0x3327d5=[];var _0x102181=squel['expr']();var _0x42c2d0;if(_0x22527f['query'][_0x50e8('0x68')]){_0x42c2d0=as[_0x50e8('0x69')](_0x22527f['query']['search']);var _0x51775a=_0x42c2d0[_0x50e8('0x6a')];for(var _0x3588f0=0x0;_0x3588f0<_0x42c2d0['conditions'][_0x50e8('0x50')];_0x3588f0++){var _0xb2d01a=_0x42c2d0[_0x50e8('0x6b')][_0x3588f0];var _0x3bbd6f='i';var _0x71bf27=_['find'](_0x504d97,[_0x50e8('0x2d'),_0xb2d01a[_0x50e8('0x56')]]);if(!_0x71bf27){switch(_0xb2d01a[_0x50e8('0x56')]){case'unreadMessages':if(_0xb2d01a['value']==0x1){_0x234f94[_0x50e8('0x6c')]('`'+_0xb2d01a[_0x50e8('0x56')]+_0x50e8('0x6d'));}else{_0x234f94[_0x50e8('0x6c')]('`'+_0xb2d01a[_0x50e8('0x56')]+_0x50e8('0x6e'));}break;case'Contact':if(_0xb2d01a['operator']===_0x50e8('0x6f')){if(_0xb2d01a['value'][_0x50e8('0x38')]('\x20')[_0x50e8('0x50')]>0x1){_0x63ca8[_0x51775a]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x50e8('0x70')](_0xb2d01a['value']),null);}else{var _0x58657d='%'+_0xb2d01a['value']+'%';_0x63ca8[_0x51775a](_0x50e8('0x71'),_0x58657d,_0x58657d,_0x58657d);}}else{_0x71bf27=_[_0x50e8('0x72')](_0x504d97,[_0x50e8('0x2d'),_0x50e8('0x73')]);_0xb2d01a['field']='ContactId';_0x1637b2=as[_0x50e8('0x74')](_0x3bbd6f,_0x71bf27[_0x50e8('0x47')],_0xb2d01a);_0x63ca8[_0x51775a](_0x1637b2[_0x50e8('0x75')],_0x1637b2[_0x50e8('0x76')][_0x50e8('0x77')],_0x1637b2[_0x50e8('0x76')][_0x50e8('0x2b')]);}break;case _0x50e8('0x78'):var _0x2635f0=_0xb2d01a[_0x50e8('0x76')][_0x50e8('0x38')](',')[_0x50e8('0x35')](function(_0x1ad71a){return Number(_0x1ad71a);});_0x2635f0[_0x50e8('0x39')](function(_0x310091){_0x102181['or'](_0x50e8('0x79'),'%,'+_0x310091+',%');});_0x3327d5=_[_0x50e8('0x7a')](_0x3327d5,_0x2635f0);break;case _0x50e8('0x7b'):if(_0xb2d01a['operator']===_0x50e8('0x6f')){_0x63ca8[_0x51775a](_0x50e8('0x7c'),'%'+_0xb2d01a[_0x50e8('0x76')]+'%',null);}else{_0x71bf27=_[_0x50e8('0x72')](_0x504d97,['name',_0x50e8('0x42')]);_0xb2d01a[_0x50e8('0x56')]=_0x50e8('0x42');_0x1637b2=as[_0x50e8('0x74')](_0x3bbd6f,_0x71bf27[_0x50e8('0x47')],_0xb2d01a);_0x63ca8[_0x51775a](_0x1637b2[_0x50e8('0x75')],_0x1637b2['value'][_0x50e8('0x77')],_0x1637b2[_0x50e8('0x76')][_0x50e8('0x2b')]);}break;case _0x50e8('0x7d'):_0x1637b2=as['buildExpression']('me',null,_0xb2d01a);_0x63ca8[_0x51775a](_0x1637b2[_0x50e8('0x75')],_0x1637b2['value'][_0x50e8('0x77')],_0x1637b2[_0x50e8('0x76')][_0x50e8('0x2b')]);break;}}else{var _0x1637b2=as[_0x50e8('0x74')](_0x3bbd6f,_0x71bf27['type'],_0xb2d01a);_0x63ca8[_0x51775a](_0x1637b2[_0x50e8('0x75')],_0x1637b2[_0x50e8('0x76')][_0x50e8('0x77')],_0x1637b2[_0x50e8('0x76')][_0x50e8('0x2b')]);}}}else{var _0x1dc51d=_(_0x22527f['query'])[_0x50e8('0x4b')]()[_0x50e8('0x35')](function(_0x4fc73d){return _[_0x50e8('0x7e')](_0x504d97,[_0x50e8('0x2d'),_0x4fc73d])?_0x4fc73d:undefined;})['compact']()[_0x50e8('0x76')]();if(!_['isEmpty'](_0x1dc51d)){_0x1dc51d[_0x50e8('0x39')](function(_0x26f96d){if(_0x26f96d==='ChatWebsiteId'){_0x234f94[_0x50e8('0x54')](_0x50e8('0x7f'),[][_0x50e8('0x80')](_0x22527f[_0x50e8('0x4a')][_0x26f96d]));}else if(_0x26f96d==='createdAt'){var _0xf21b2f=JSON['parse'](_0x22527f[_0x50e8('0x4a')][_0x26f96d])[_0x50e8('0x81')];var _0x52cb34=JSON[_0x50e8('0x82')](_0x22527f[_0x50e8('0x4a')][_0x26f96d])[_0x50e8('0x83')];_0x234f94[_0x50e8('0x54')](_0x50e8('0x84'),_0xf21b2f,_0x52cb34);}else{if(_0x22527f[_0x50e8('0x4a')][_0x26f96d]===_0x50e8('0x85')){_0x234f94[_0x50e8('0x54')]('i.'+_0x26f96d+_0x50e8('0x86'));}else{_0x234f94['where']('i.'+_0x26f96d+_0x50e8('0x87'),_0x22527f[_0x50e8('0x4a')][_0x26f96d]);}}});}if(_0x22527f[_0x50e8('0x4a')]['read']){if(_0x22527f[_0x50e8('0x4a')][_0x50e8('0x88')]==0x1){_0x234f94[_0x50e8('0x6c')]('`unreadMessages`\x20=\x200');}else{_0x234f94['having'](_0x50e8('0x89'));}}if(_0x22527f[_0x50e8('0x4a')]['tag']){_0x3327d5=_[_0x50e8('0x8a')](_0x22527f['query'][_0x50e8('0x8b')])?_0x22527f[_0x50e8('0x4a')][_0x50e8('0x8b')]:new Array(_0x22527f[_0x50e8('0x4a')]['tag']);_0x3327d5[_0x50e8('0x39')](function(_0x4ac008){_0x102181['or'](_0x50e8('0x79'),'%,'+_0x4ac008+',%');});}if(_0x22527f['query']['filter']){var _0x368d17=_0x22527f[_0x50e8('0x4a')]['filter'][_0x50e8('0x8c')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x50e8('0x8d')](_0x368d17)){_0x63ca8['or']('i.id\x20LIKE\x20?',_0x368d17+'%');}else{_0x63ca8['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x50e8('0x70')](_0x368d17))['or'](_0x50e8('0x8e'),_0x368d17+'%');}}}_0x234f94[_0x50e8('0x54')](_0x63ca8);_0x234f94[_0x50e8('0x8f')]('i.id');var _0x2de6b4={'type':db['Sequelize']['QueryTypes'][_0x50e8('0x90')],'raw':!![]};var _0x805b93=_0x234f94[_0x50e8('0x91')]();_0x805b93['field']('i.id');_0x805b93['field'](_0x50e8('0x92'),_0x50e8('0x93'));if(_0x16fdf6[_0x50e8('0x52')]){_0x16fdf6[_0x50e8('0x52')][_0x50e8('0x39')](function(_0x1869e9){var _0x500cdd=_0x1869e9[0x0]==='contactName'?_0x1869e9[0x0]:'i.'+_0x1869e9[0x0];_0x234f94[_0x50e8('0x52')](_0x500cdd,_0x1869e9[0x1]===_0x50e8('0x94')?![]:!![]);});}if(!_[_0x50e8('0x95')](_0x3327d5)){_0x234f94[_0x50e8('0x6c')](_0x102181);_0x805b93[_0x50e8('0x54')]('t.id\x20IN\x20?',_0x3327d5);}BPromise[_0x50e8('0x96')]()[_0x50e8('0x2a')](function(){if(!_0x42c2d0){if(_0x22527f[_0x50e8('0x4a')]['ChatWebsiteId'])return;_0x805b93['where'](_0x50e8('0x97'));_0x234f94[_0x50e8('0x54')](_0x50e8('0x97'));return;}if(_0x22527f['user'][_0x50e8('0x98')]!==_0x50e8('0x99'))return;return _0x22527f['user'][_0x50e8('0x9a')]({'attributes':['id'],'raw':!![]})['then'](function(_0x306fc0){if(_[_0x50e8('0x95')](_0x306fc0)){_0x805b93[_0x50e8('0x54')](_0x50e8('0x9b'));_0x234f94[_0x50e8('0x54')](_0x50e8('0x9b'));}else{_0x805b93[_0x50e8('0x54')](_0x50e8('0x7f'),_[_0x50e8('0x35')](_0x306fc0,'id'));_0x234f94['where'](_0x50e8('0x7f'),_['map'](_0x306fc0,'id'));}});})[_0x50e8('0x2a')](function(){if(_0x22527f[_0x50e8('0x9c')][_0x50e8('0x98')]===_0x50e8('0x99')&&!_0x42c2d0&&!_0x22527f[_0x50e8('0x4a')][_0x50e8('0x9d')])return[];return db['sequelize'][_0x50e8('0x4a')](_0x805b93[_0x50e8('0x9e')](),_0x2de6b4);})[_0x50e8('0x2a')](function(_0x10b0cd){_0x1cc4fe[_0x50e8('0x25')]=_0x10b0cd[_0x50e8('0x50')];if(_0x1cc4fe[_0x50e8('0x25')]===0x0)return[];return db['sequelize'][_0x50e8('0x4a')](_0x5f5220[_0x50e8('0x9e')](),_0x2de6b4)[_0x50e8('0x2a')](function(_0xc55fb5){_0x320b00=_[_0x50e8('0x9f')](_0xc55fb5,'id');_0x2de6b4=_[_0x50e8('0x30')](_0x2de6b4,{'model':db[_0x50e8('0x45')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x22527f[_0x50e8('0x4a')]['fields']){_0x16fdf6['attributes']['forEach'](function(_0x27c159){_0x234f94['field']('i.'+_0x27c159);});}else{_0x234f94[_0x50e8('0x56')](_0x50e8('0x92'),_0x50e8('0x93'));_0x234f94[_0x50e8('0x56')](_0x50e8('0xa0'),_0x50e8('0xa1'));_0x234f94[_0x50e8('0x56')](_0x50e8('0xa2'),_0x50e8('0xa3'));_0x234f94[_0x50e8('0x56')](_0x50e8('0xa4'),'contactName');_0x234f94[_0x50e8('0x56')](_0x50e8('0xa5'));_0x234f94['field'](_0x50e8('0xa6'),_0x50e8('0xa7'));_0x234f94[_0x50e8('0x56')](_0x50e8('0xa8'),'Contact.lastName');_0x234f94[_0x50e8('0x56')](_0x50e8('0xa9'),'Contact.email');_0x234f94[_0x50e8('0x56')]('c.phone',_0x50e8('0xaa'));_0x234f94[_0x50e8('0x56')](_0x50e8('0xab'),_0x50e8('0xac'));_0x234f94[_0x50e8('0x56')](_0x50e8('0xad'),_0x50e8('0xae'));_0x234f94[_0x50e8('0x56')](_0x50e8('0xaf'),'Owner.fullname');_0x234f94[_0x50e8('0x56')](_0x50e8('0xb0'),_0x50e8('0xb1'));_0x234f94['field'](_0x50e8('0xb2'),_0x50e8('0x37'));}if(_0x16fdf6[_0x50e8('0x26')])_0x234f94[_0x50e8('0x26')](_0x16fdf6['limit']);if(_0x16fdf6['offset'])_0x234f94[_0x50e8('0x23')](_0x16fdf6[_0x50e8('0x23')]);return db[_0x50e8('0xb3')][_0x50e8('0x4a')](_0x234f94[_0x50e8('0x9e')](),_0x2de6b4);})['then'](function(_0x3b85a9){if(_0x3b85a9[_0x50e8('0x50')]>0x0)_0x566723['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x50e8('0x35')](_0x3b85a9,'id'));return db[_0x50e8('0xb3')]['query'](_0x566723[_0x50e8('0x9e')](),_0x2de6b4)['then'](function(_0x3620e3){var _0x353ab9=_[_0x50e8('0xb4')](_0x3620e3,_0x50e8('0xb5'));var _0x97c1e9=[];_0x3b85a9[_0x50e8('0x39')](function(_0x53f5ef){_0x97c1e9['push'](updateChatInteraction(_0x53f5ef,_0x320b00,_0x353ab9));});return BPromise[_0x50e8('0xb6')](_0x97c1e9);});});})[_0x50e8('0x2a')](function(_0x5d0198){_0x1cc4fe['rows']=_0x5d0198;return _0x1cc4fe;})[_0x50e8('0x2a')](respondWithFilteredResult(_0x51d239,_0x16fdf6))['catch'](handleError(_0x51d239,null));};exports[_0x50e8('0xb7')]=function(_0x384eef,_0x563dcc){var _0x1806ef={'raw':![],'where':{'id':_0x384eef[_0x50e8('0xb8')]['id']}},_0x5248d6={};_0x5248d6['model']=_[_0x50e8('0x4b')](db['ChatInteraction'][_0x50e8('0xb9')]);_0x5248d6[_0x50e8('0x4a')]=_[_0x50e8('0x4b')](_0x384eef[_0x50e8('0x4a')]);_0x5248d6['filters']=_[_0x50e8('0x4d')](_0x5248d6[_0x50e8('0x49')],_0x5248d6['query']);_0x1806ef[_0x50e8('0x4f')]=_[_0x50e8('0x4d')](_0x5248d6[_0x50e8('0x49')],qs[_0x50e8('0x4e')](_0x384eef[_0x50e8('0x4a')][_0x50e8('0x4e')]));_0x1806ef[_0x50e8('0x4f')]=_0x1806ef['attributes'][_0x50e8('0x50')]?_0x1806ef[_0x50e8('0x4f')]:_0x5248d6[_0x50e8('0x49')];if(_0x384eef[_0x50e8('0x4a')][_0x50e8('0xba')]){_0x1806ef[_0x50e8('0xbb')]=[{'all':!![]}];}_0x1806ef=_[_0x50e8('0x30')]({},_0x1806ef,_0x384eef[_0x50e8('0xbc')]);return db[_0x50e8('0x45')]['find'](_0x1806ef)[_0x50e8('0x2a')](handleEntityNotFound(_0x563dcc,null))[_0x50e8('0x2a')](respondWithResult(_0x563dcc,null))[_0x50e8('0x3b')](handleError(_0x563dcc,null));};exports[_0x50e8('0xbd')]=function(_0x2c8f31,_0x179022){return db[_0x50e8('0x45')][_0x50e8('0xbd')](_0x2c8f31[_0x50e8('0x7d')],{})['then'](respondWithResult(_0x179022,0xc9))[_0x50e8('0x3b')](handleError(_0x179022,null));};exports['update']=function(_0x5e15d7,_0x31b00e){if(_0x5e15d7['body']['id']){delete _0x5e15d7[_0x50e8('0x7d')]['id'];}return db[_0x50e8('0x45')]['find']({'where':{'id':_0x5e15d7['params']['id']}})[_0x50e8('0x2a')](handleEntityNotFound(_0x31b00e,null))[_0x50e8('0x2a')](saveUpdates(_0x5e15d7[_0x50e8('0x7d')],null))['then'](respondWithResult(_0x31b00e,null))[_0x50e8('0x3b')](handleError(_0x31b00e,null));};exports['destroy']=function(_0x2cf36f,_0x3cc7e5){return db[_0x50e8('0x45')][_0x50e8('0x72')]({'where':{'id':_0x2cf36f['params']['id']}})[_0x50e8('0x2a')](handleEntityNotFound(_0x3cc7e5,null))[_0x50e8('0x2a')](removeEntity(_0x3cc7e5,null))[_0x50e8('0x3b')](handleError(_0x3cc7e5,null));};exports[_0x50e8('0xbe')]=function(_0x54282e,_0x3e36ea){return db[_0x50e8('0x45')]['describe']()[_0x50e8('0x2a')](respondWithResult(_0x3e36ea,null))[_0x50e8('0x3b')](handleError(_0x3e36ea,null));};exports['createVidaooSession']=function(_0x511606,_0x57ebe1){var _0x2e5e22=_0x511606[_0x50e8('0xb8')]['id'];var _0x16e2fe;var _0x4eb523;var _0x230791;return db[_0x50e8('0x45')]['findOne']({'where':{'id':_0x2e5e22}})[_0x50e8('0x2a')](function(_0x39f412){_0x16e2fe=_0x39f412;return db[_0x50e8('0xbf')][_0x50e8('0xc0')]({'where':{'id':_0x39f412[_0x50e8('0x9d')]},'attributes':['id',_0x50e8('0xc1'),'vidaooEscalation',_0x50e8('0xc2'),'vidaooNote',_0x50e8('0xc3')],'raw':!![]});})['then'](function(_0x2ab4c5){if(_0x2ab4c5&&_0x2ab4c5[_0x50e8('0xc1')]&&_0x2ab4c5['vidaooEscalation']){_0x4eb523=_0x2ab4c5;var _0x2ef5d9={'interaction':{'id':_0x2e5e22},'agent':{'id':_0x511606[_0x50e8('0x9c')]['id'],'name':_0x511606[_0x50e8('0x9c')][_0x50e8('0x2d')],'fullname':_0x511606[_0x50e8('0x9c')][_0x50e8('0xc4')],'email':_0x511606[_0x50e8('0x9c')][_0x50e8('0xc5')]},'contact':_0x511606[_0x50e8('0x7d')][_0x50e8('0x31')],'account':_0x511606[_0x50e8('0x7d')][_0x50e8('0x33')]};var _0x4aa481={'rejectUnauthorized':![],'method':_0x50e8('0xc6'),'url':_0x50e8('0xc7'),'headers':{'X-APIKEY':_0x2ab4c5[_0x50e8('0xc1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x511606[_0x50e8('0x9c')][_0x50e8('0xc5')]],'buttons':null,'topic':_0x4eb523[_0x50e8('0xc2')],'note':_[_0x50e8('0xc8')](_0x4eb523['vidaooNote'])?null:getMustacheRender(_0x4eb523[_0x50e8('0xc9')],_0x2ef5d9),'metadata':null},'redirect':_0x50e8('0xca'),'json':!![]};try{if(!_[_0x50e8('0xc8')](_0x4eb523[_0x50e8('0xc3')])){var _0x27957b=getMustacheRender(_0x4eb523[_0x50e8('0xc3')],_0x2ef5d9);var _0x4a6e82=JSON['parse'](_0x27957b);_0x4aa481[_0x50e8('0x7d')][_0x50e8('0xcb')]=_0x4a6e82;}}catch(_0x546026){throw new db[(_0x50e8('0xcc'))][(_0x50e8('0xcd'))](_0x50e8('0xce'));}return rp(_0x4aa481);}else{throw new db['Sequelize'][(_0x50e8('0xcd'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x50e8('0x2a')](function(_0x224e44){_0x230791=_0x224e44;if(_0x230791['id']){var _0x4e33ff={'body':_0x230791['join_url'],'ChatWebsiteId':_0x4eb523['id'],'ChatInteractionId':_0x16e2fe['id'],'direction':_0x50e8('0xcf'),'UserId':_0x511606[_0x50e8('0x9c')]['id']};return db[_0x50e8('0xd0')]['create'](_0x4e33ff,{});}else{throw new db[(_0x50e8('0xcc'))]['ValidationError'](_0x50e8('0xd1'));}})[_0x50e8('0x2a')](function(){return _0x16e2fe[_0x50e8('0xd2')]({'vidaooSessionId':_0x230791['id']});})[_0x50e8('0x2a')](respondWithResult(_0x57ebe1,null))['catch'](handleError(_0x57ebe1,null));};exports[_0x50e8('0xd3')]=function(_0xe34b94,_0x3c07e0){if(_0xe34b94[_0x50e8('0x7d')]['id']){delete _0xe34b94['body']['id'];}return db[_0x50e8('0x45')]['find']({'where':{'id':_0xe34b94[_0x50e8('0xb8')]['id']},'include':[{'model':db['CmContact'],'as':_0x50e8('0xd4')}]})[_0x50e8('0x2a')](handleEntityNotFound(_0x3c07e0,null))[_0x50e8('0x2a')](saveUpdates(_0xe34b94[_0x50e8('0x7d')],null))[_0x50e8('0x2a')](respondWithResult(_0x3c07e0,null))[_0x50e8('0x3b')](handleError(_0x3c07e0,null));};exports['abandon']=function(_0x105640,_0x9f3ed5){if(_0x105640[_0x50e8('0x7d')]['id']){delete _0x105640[_0x50e8('0x7d')]['id'];}return db[_0x50e8('0x45')][_0x50e8('0x72')]({'where':{'id':_0x105640[_0x50e8('0xb8')]['id']}})[_0x50e8('0x2a')](function(_0x32f213){if(!_0x32f213){logger[_0x50e8('0x1c')](_0x50e8('0xd5'),'abandon',0x194,'entity\x20not\x20found');_0x9f3ed5[_0x50e8('0x20')](0x194);}else{if(_0x32f213[_0x50e8('0x42')]){throw new db[(_0x50e8('0xcc'))][(_0x50e8('0xcd'))]('Interaction\x20already\x20assigned');}}return _0x32f213;})[_0x50e8('0x2a')](function(_0x2b952b){if(_0x2b952b){return _0x2b952b['update']({'closed':_0x105640[_0x50e8('0x7d')][_0x50e8('0x41')],'disposition':_0x105640[_0x50e8('0x7d')][_0x50e8('0xd6')]})[_0x50e8('0x2a')](function(_0x41fff7){return _0x41fff7;});}})[_0x50e8('0x2a')](function(){return respondWithRpcPromise(_0x50e8('0xd7'),_0x50e8('0xd8'),_0x105640[_0x50e8('0x7d')],client9004);})[_0x50e8('0x2a')](respondWithResult(_0x9f3ed5,null))[_0x50e8('0x3b')](handleError(_0x9f3ed5,null));};exports['attachmentUpload']=function(_0x3a408d,_0x1cdea7){_0x3a408d[_0x50e8('0x7d')][_0x50e8('0x2d')]=_0x3a408d[_0x50e8('0xd9')][_0x50e8('0xda')];_0x3a408d[_0x50e8('0x7d')][_0x50e8('0xdb')]=_0x3a408d[_0x50e8('0xd9')]['filename'];_0x3a408d[_0x50e8('0x7d')][_0x50e8('0x47')]=_0x3a408d['file']['mimetype'];return db['Attachment'][_0x50e8('0xbd')](_0x3a408d[_0x50e8('0x7d')])['then'](respondWithResult(_0x1cdea7,0xc9))[_0x50e8('0x3b')](handleError(_0x1cdea7,null));};exports[_0x50e8('0xdc')]=function(_0x4eec14,_0x415022){return db[_0x50e8('0x45')]['findOne']({'where':{'id':_0x4eec14[_0x50e8('0xb8')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x415022,null))[_0x50e8('0x2a')](function(_0x358f4c){if(_0x358f4c){if(_0x358f4c['closed']){return _0x415022[_0x50e8('0x21')](0x193)[_0x50e8('0x22')]({'status':0x193,'message':_0x50e8('0xdd')});}return db['Attachment'][_0x50e8('0xc0')]({'where':{'id':_0x4eec14['query'][_0x50e8('0xde')]},'raw':!![]})['then'](handleEntityNotFound(_0x415022,null));}})['then'](function(_0x20f900){if(_0x20f900){var _0x3fba15=_0x20f900[_0x50e8('0xdf')]!==null;var _0x246bc3=path[_0x50e8('0xe0')](config['root'],_0x50e8('0xe1'));if(_0x3fba15){_0x246bc3=path[_0x50e8('0xe0')](_0x246bc3,_0x50e8('0xe2'));}var _0x5d976a=path['join'](_0x246bc3,_0x20f900[_0x50e8('0xdb')]);return _0x415022['download'](_0x5d976a);}})['catch'](handleError(_0x415022,null));};exports['close']=function(_0x96c8fe,_0x18eb34){var _0x4c5bfe=null;var _0x28886c=null;var _0xc62623=null;if(_0x96c8fe[_0x50e8('0x7d')]['id']){delete _0x96c8fe[_0x50e8('0x7d')]['id'];}if(_0x96c8fe[_0x50e8('0x7d')]['mailTranscript']){_0xc62623=path[_0x50e8('0xe0')](config[_0x50e8('0xe3')],_0x50e8('0xe4'),util[_0x50e8('0xe5')](_0x50e8('0xe6'),Date['now']()));_0x96c8fe[_0x50e8('0x7d')][_0x50e8('0xe7')]=_0xc62623;}return db[_0x50e8('0x45')][_0x50e8('0x72')]({'where':{'id':_0x96c8fe['params']['id']},'include':[{'model':db[_0x50e8('0xd0')],'as':_0x50e8('0xe8'),'include':[{'model':db[_0x50e8('0x7b')],'as':_0x50e8('0x7b')}]}]})['then'](handleEntityNotFound(_0x18eb34,null))[_0x50e8('0x2a')](saveUpdates(_0x96c8fe[_0x50e8('0x7d')],null))[_0x50e8('0x2a')](function(_0x4997d1){if(_0x4997d1){_0x4c5bfe=_0x4997d1;return db['ChatWebsite']['find']({'where':{'id':_0x4c5bfe['ChatWebsiteId']}});}})[_0x50e8('0x2a')](function(_0x1869f1){if(_0x1869f1){_0x28886c=_0x1869f1;return db[_0x50e8('0xe9')][_0x50e8('0x72')]({'where':{'id':_0x4c5bfe[_0x50e8('0x73')]}});}})[_0x50e8('0x2a')](function(_0x5c494d){if(_0x5c494d){if(_0xc62623){var _0x1f2e86=null;for(var _0x138cc2=0x1;_0x138cc2<_0x4c5bfe[_0x50e8('0xe8')]['length'];++_0x138cc2){_0x1f2e86=_0x4c5bfe[_0x50e8('0xe8')][_0x138cc2];var _0x2f6310=_0x1f2e86[_0x50e8('0x42')]?util['format'](_0x50e8('0xea'),_0x28886c['agentAlias'],_0x1f2e86[_0x50e8('0x42')]):'System';var _0x9cdbf6=_0x96c8fe[_0x50e8('0x7d')]['customer']||util[_0x50e8('0xe5')](_0x50e8('0xea'),_0x50e8('0xeb'),_0x1f2e86['ContactId']);switch(_0x28886c[_0x50e8('0xec')]){case _0x50e8('0xed'):_0x2f6310=_0x1f2e86['UserId']?util[_0x50e8('0xe5')](_0x50e8('0xea'),_0x28886c[_0x50e8('0xee')],_0x1f2e86[_0x50e8('0x42')]):_0x50e8('0xef');break;case _0x50e8('0xf0'):_0x2f6310=_0x1f2e86[_0x50e8('0x42')]?_0x1f2e86[_0x50e8('0x7b')][_0x50e8('0xf1')]||_0x1f2e86[_0x50e8('0x7b')][_0x50e8('0xc4')]:'System';break;case _0x50e8('0xf2'):_0x2f6310=_0x1f2e86[_0x50e8('0x42')]?_0x1f2e86[_0x50e8('0x7b')][_0x50e8('0xc4')]:'System';break;default:_0x2f6310=_0x1f2e86[_0x50e8('0x42')]?util[_0x50e8('0xe5')](_0x50e8('0xea'),_0x28886c['agentAlias'],_0x1f2e86[_0x50e8('0x42')]):_0x50e8('0xef');}var _0x229de0=util[_0x50e8('0xe5')](_0x50e8('0xf3'),moment(_0x1f2e86[_0x50e8('0xf4')])['format'](_0x50e8('0xf5')),_0x1f2e86[_0x50e8('0xf6')]==='in'?_0x9cdbf6:_0x2f6310,_0x1f2e86[_0x50e8('0x7d')]);if(!_0x1f2e86[_0x50e8('0xf7')]){fs[_0x50e8('0xf8')](_0xc62623,_0x229de0);}}return db['MailAccount'][_0x50e8('0xc0')]({'where':{'service':!![]},'include':[{'model':db[_0x50e8('0xf9')],'as':_0x50e8('0xfa'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x50e8('0x2a')](function(_0x336e22){if(!_0x336e22||!_0x336e22[_0x50e8('0xfa')]||!_0x96c8fe[_0x50e8('0x7d')])return _0x4c5bfe;var _0x1657bc=_0x336e22[_0x50e8('0xfb')]();return respondWithRpcPromise(_0x50e8('0xfc'),'sendMail',{'account':_0x1657bc,'message':{'from':util[_0x50e8('0xe5')](_0x50e8('0xfd'),_0x336e22[_0x50e8('0x2d')],_0x336e22[_0x50e8('0xc5')]||_0x336e22['Smtp'][_0x50e8('0x9c')]),'to':_0x96c8fe[_0x50e8('0x7d')][_0x50e8('0xfe')],'subject':_0x50e8('0xff'),'text':util[_0x50e8('0xe5')](_0x50e8('0x100'),_0x96c8fe[_0x50e8('0x7d')]['mailTranscript']),'attachments':[{'path':_0xc62623}]}})[_0x50e8('0x2a')](function(){return _0x4c5bfe;})['catch'](function(_0x34eb5d){logger[_0x50e8('0x1c')](_0x34eb5d);});})[_0x50e8('0x2a')](respondWithStatusCode(_0x18eb34,0xc8))[_0x50e8('0x3b')](handleError(_0x18eb34,null));};exports['addMessage']=function(_0x271d19,_0x45a8ff){return db['ChatMessage'][_0x50e8('0x72')]({'where':{'id':_0x271d19[_0x50e8('0xb8')]['id']}})[_0x50e8('0x2a')](handleEntityNotFound(_0x45a8ff,null))[_0x50e8('0x2a')](function(_0x2c4a90){if(_0x2c4a90){return _0x2c4a90[_0x50e8('0x101')](_0x271d19['body'][_0x50e8('0x102')],_[_0x50e8('0x103')](_0x271d19[_0x50e8('0x7d')],['ids','id'])||{});}})['then'](respondWithResult(_0x45a8ff,null))[_0x50e8('0x3b')](handleError(_0x45a8ff,null));};exports[_0x50e8('0x104')]=function(_0x2c8142,_0x1456aa){var _0x5f2cb3={'raw':![],'where':{}};var _0x1a77fb={};var _0xdcb7ce={'count':0x0,'rows':[]};return db[_0x50e8('0x45')]['findOne']({'where':{'id':_0x2c8142[_0x50e8('0xb8')]['id']}})[_0x50e8('0x2a')](handleEntityNotFound(_0x1456aa,null))[_0x50e8('0x2a')](function(_0x49c22c){if(_0x49c22c){_0x1a77fb[_0x50e8('0x49')]=_['keys'](db[_0x50e8('0xd0')][_0x50e8('0xb9')]);_0x1a77fb[_0x50e8('0x4a')]=_[_0x50e8('0x4b')](_0x2c8142['query']);_0x1a77fb['filters']=_[_0x50e8('0x4d')](_0x1a77fb[_0x50e8('0x49')],_0x1a77fb[_0x50e8('0x4a')]);_0x5f2cb3[_0x50e8('0x4f')]=_[_0x50e8('0x4d')](_0x1a77fb['model'],qs['fields'](_0x2c8142[_0x50e8('0x4a')]['fields']));_0x5f2cb3['attributes']=_0x5f2cb3[_0x50e8('0x4f')][_0x50e8('0x50')]?_0x5f2cb3[_0x50e8('0x4f')]:_0x1a77fb['model'];if(!_0x2c8142[_0x50e8('0x4a')][_0x50e8('0x105')](_0x50e8('0x51'))){_0x5f2cb3[_0x50e8('0x26')]=qs[_0x50e8('0x26')](_0x2c8142[_0x50e8('0x4a')]['limit']);_0x5f2cb3['offset']=qs[_0x50e8('0x23')](_0x2c8142[_0x50e8('0x4a')][_0x50e8('0x23')]);}_0x5f2cb3['order']=qs[_0x50e8('0x53')](_0x2c8142['query']['sort']);_0x5f2cb3[_0x50e8('0x54')]=qs[_0x50e8('0x4c')](_[_0x50e8('0x55')](_0x2c8142[_0x50e8('0x4a')],_0x1a77fb[_0x50e8('0x4c')]));_0x5f2cb3[_0x50e8('0x54')][_0x50e8('0xb5')]=_0x49c22c['id'];if(_0x2c8142[_0x50e8('0x4a')][_0x50e8('0x106')]){_0x5f2cb3['where']=_[_0x50e8('0x30')](_0x5f2cb3[_0x50e8('0x54')],{'$or':_[_0x50e8('0x35')](_0x5f2cb3[_0x50e8('0x4f')],function(_0x4952b4){var _0x3818cc={};_0x3818cc[_0x4952b4]={'$like':'%'+_0x2c8142['query']['filter']+'%'};return _0x3818cc;})});}if(_0x2c8142[_0x50e8('0x4a')][_0x50e8('0x81')]){var _0x51f73c=_0x2c8142[_0x50e8('0x4a')][_0x50e8('0x81')][_0x50e8('0x38')](',');var _0x1e4e44={};_0x1e4e44[_0x51f73c[0x0]]={'$gte':moment(_0x51f73c[0x1])['format'](_0x50e8('0x107'))};_0x5f2cb3[_0x50e8('0x54')]=_[_0x50e8('0x30')](_0x5f2cb3[_0x50e8('0x54')],_0x1e4e44);}_0x5f2cb3=_[_0x50e8('0x30')]({},_0x5f2cb3,_0x2c8142['options']);return db[_0x50e8('0xd0')][_0x50e8('0x25')]({'where':_0x5f2cb3[_0x50e8('0x54')]})[_0x50e8('0x2a')](function(_0x5c1ab2){_0xdcb7ce[_0x50e8('0x25')]=_0x5c1ab2;if(_0x2c8142['query'][_0x50e8('0xba')]){_0x5f2cb3[_0x50e8('0xbb')]=[{'all':!![]}];}return db[_0x50e8('0xd0')][_0x50e8('0x108')](_0x5f2cb3);})[_0x50e8('0x2a')](function(_0x329fff){_0xdcb7ce[_0x50e8('0x109')]=_0x329fff;return _0xdcb7ce;});}})[_0x50e8('0x2a')](respondWithFilteredResult(_0x1456aa,_0x5f2cb3))['catch'](handleError(_0x1456aa,null));};exports[_0x50e8('0x10a')]=function(_0x80fe2,_0x2a8b16){var _0x436ce2={'where':{}},_0x4942dd={},_0x812161={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x50e8('0xc0')]({'where':{'id':_0x80fe2[_0x50e8('0xb8')]['id']}})['then'](handleEntityNotFound(_0x2a8b16,null))['then'](function(_0x3e9cae){if(_0x3e9cae){_0x4942dd[_0x50e8('0x49')]=_[_0x50e8('0x4b')](db[_0x50e8('0xd0')][_0x50e8('0xb9')]);_0x4942dd['query']=_[_0x50e8('0x4b')](_0x80fe2[_0x50e8('0x4a')]);_0x4942dd[_0x50e8('0x4c')]=_['intersection'](_0x4942dd['model'],_0x4942dd['query']);_0x436ce2[_0x50e8('0x4f')]=_[_0x50e8('0x4d')](_0x4942dd[_0x50e8('0x49')],qs[_0x50e8('0x4e')](_0x80fe2[_0x50e8('0x4a')][_0x50e8('0x4e')]));_0x436ce2[_0x50e8('0x4f')]=_0x436ce2[_0x50e8('0x4f')]['length']?_0x436ce2[_0x50e8('0x4f')]:_0x4942dd['model'];if(!_0x80fe2[_0x50e8('0x4a')][_0x50e8('0x105')]('nolimit')){_0x436ce2[_0x50e8('0x26')]=qs['limit'](_0x80fe2[_0x50e8('0x4a')]['limit']);_0x436ce2[_0x50e8('0x23')]=qs['offset'](_0x80fe2[_0x50e8('0x4a')][_0x50e8('0x23')]);}_0x436ce2[_0x50e8('0x52')]=qs['sort'](_0x80fe2['query'][_0x50e8('0x53')]);_0x436ce2['where']=qs[_0x50e8('0x4c')](_['pick'](_0x80fe2['query'],_0x4942dd['filters']));_0x436ce2['where'][_0x50e8('0xb5')]=_0x3e9cae['id'];if(_0x80fe2[_0x50e8('0x4a')]['filter']){_0x436ce2[_0x50e8('0x54')]=_[_0x50e8('0x30')](_0x436ce2[_0x50e8('0x54')],{'$or':_['map'](_0x436ce2[_0x50e8('0x4f')],function(_0x2a3344){var _0x37a785={};_0x37a785[_0x2a3344]={'$like':'%'+_0x80fe2[_0x50e8('0x4a')][_0x50e8('0x106')]+'%'};return _0x37a785;})});}_0x436ce2['where']['secret']=![];if(_0x80fe2[_0x50e8('0x4a')]['id']){_0x436ce2[_0x50e8('0x54')]['id']={'$gt':_0x80fe2[_0x50e8('0x4a')]['id']};}_0x436ce2=_[_0x50e8('0x30')]({},_0x436ce2,_0x80fe2[_0x50e8('0xbc')]);return db[_0x50e8('0xd0')]['count']({'where':_0x436ce2[_0x50e8('0x54')]})[_0x50e8('0x2a')](function(_0x100d2d){_0x812161['count']=_0x100d2d;_0x436ce2[_0x50e8('0xbb')]=[];if(_0x80fe2[_0x50e8('0x4a')][_0x50e8('0x10b')]){_0x436ce2[_0x50e8('0xbb')]['push']({'model':db[_0x50e8('0x7b')],'as':_0x50e8('0x7b'),'attributes':['id',_0x50e8('0xc4'),_0x50e8('0xf1')]});}if(_0x80fe2[_0x50e8('0x4a')][_0x50e8('0xba')]){_0x436ce2[_0x50e8('0xbb')]=[{'all':!![]}];}return db[_0x50e8('0xd0')][_0x50e8('0x108')](_0x436ce2);})[_0x50e8('0x2a')](function(_0x26d4b4){_0x812161['rows']=_0x26d4b4;return _0x812161;});}})['then'](respondWithFilteredResult(_0x2a8b16,_0x436ce2))[_0x50e8('0x3b')](handleError(_0x2a8b16,null));};exports['addTags']=function(_0x5b564d,_0x45e5a0){return db[_0x50e8('0x45')][_0x50e8('0x72')]({'where':{'id':_0x5b564d[_0x50e8('0xb8')]['id']}})[_0x50e8('0x2a')](handleEntityNotFound(_0x45e5a0,null))[_0x50e8('0x2a')](function(_0xdda1e5){if(_0xdda1e5){return _0xdda1e5[_0x50e8('0x10c')](_0x5b564d[_0x50e8('0x7d')][_0x50e8('0x102')],_['omit'](_0x5b564d[_0x50e8('0x7d')],[_0x50e8('0x102'),'id'])||{})[_0x50e8('0x10d')](function(){return db['Tag'][_0x50e8('0x108')]({'attributes':['id','name',_0x50e8('0x57')],'where':{'id':_0x5b564d['body'][_0x50e8('0x102')]}});})[_0x50e8('0x2a')](function(_0x26fdc7){socket[_0x50e8('0x10e')](_0x50e8('0x10f'),{'id':Number(_0x5b564d[_0x50e8('0xb8')]['id']),'tags':_0x26fdc7||[]});return{'id':Number(_0x5b564d[_0x50e8('0xb8')]['id']),'tags':_0x26fdc7||[]};});}})[_0x50e8('0x2a')](respondWithResult(_0x45e5a0,null))[_0x50e8('0x3b')](handleError(_0x45e5a0,null));};exports['removeTags']=function(_0xba62b2,_0x2df2ce){return db[_0x50e8('0x45')][_0x50e8('0x72')]({'where':{'id':_0xba62b2[_0x50e8('0xb8')]['id']}})[_0x50e8('0x2a')](handleEntityNotFound(_0x2df2ce,null))[_0x50e8('0x2a')](function(_0x5d5537){if(_0x5d5537){return _0x5d5537[_0x50e8('0x110')](_0xba62b2[_0x50e8('0x4a')][_0x50e8('0x102')]);}})[_0x50e8('0x2a')](respondWithStatusCode(_0x2df2ce,null))[_0x50e8('0x3b')](handleError(_0x2df2ce,null));};exports[_0x50e8('0x111')]=function(_0x319b5a,_0x26fa2c){var _0x40ecf7=moment()[_0x50e8('0x112')]()['toString']();var _0x56d2e6=path[_0x50e8('0xe0')](config[_0x50e8('0xe3')],_0x50e8('0x113'),_0x50e8('0x114'),_0x50e8('0x115'));var _0x32c089=path[_0x50e8('0xe0')](config[_0x50e8('0xe3')],_0x50e8('0x113'),_0x50e8('0x114'),_0x50e8('0x116'));var _0x1c2fd5=path[_0x50e8('0xe0')](_0x56d2e6,_0x40ecf7);var _0x289024=util['format'](_0x50e8('0x117'),_0x319b5a['params']['id'],_0x40ecf7);var _0x1abc45=path[_0x50e8('0xe0')](_0x56d2e6,_0x289024);var _0x6c75c2=[];_0x6c75c2[_0x50e8('0x3a')]({'model':db[_0x50e8('0x7b')],'as':_0x50e8('0x7b'),'attributes':['id',_0x50e8('0xc4')],'raw':!![]});_0x6c75c2[_0x50e8('0x3a')]({'model':db['CmContact'],'as':_0x50e8('0xd4'),'attributes':['id',_0x50e8('0x118'),_0x50e8('0x119')],'raw':!![]});if(_0x319b5a['query'][_0x50e8('0x116')]){_0x6c75c2['push']({'model':db[_0x50e8('0x11a')],'as':_0x50e8('0x11a'),'raw':!![]});}var _0x8ca769=[{'model':db[_0x50e8('0xd0')],'as':_0x50e8('0xe8'),'attributes':['id',_0x50e8('0x7d'),_0x50e8('0xf4'),_0x50e8('0xf6'),_0x50e8('0xf7'),_0x50e8('0x88')],'include':_0x6c75c2}];_0x8ca769['push']({'model':db['ChatWebsite'],'as':_0x50e8('0x11b'),'attributes':['id',_0x50e8('0x2d')]});_0x8ca769[_0x50e8('0x3a')]({'model':db[_0x50e8('0x7b')],'as':_0x50e8('0x11c'),'attributes':['id',_0x50e8('0xc4')]});return db[_0x50e8('0x45')][_0x50e8('0x72')]({'where':{'id':_0x319b5a['params']['id']},'include':_0x8ca769})['then'](handleEntityNotFound(_0x26fa2c,null))[_0x50e8('0x2a')](function(_0x2a030f){if(_0x2a030f){var _0x57e649=_0x2a030f['get']({'plain':!![]});fs[_0x50e8('0x11d')](_0x1c2fd5);var _0x3f342b={'channel':'Chat','account':_0x57e649[_0x50e8('0x11b')][_0x50e8('0x2d')],'agent':_0x57e649[_0x50e8('0x11c')]?_0x57e649[_0x50e8('0x11c')]['fullname']:_0x50e8('0x11e'),'createdAt':moment(_0x57e649[_0x50e8('0xf4')])[_0x50e8('0xe5')](_0x50e8('0x107'))[_0x50e8('0x9e')](),'closedAt':_0x57e649[_0x50e8('0x41')]?moment(_0x57e649[_0x50e8('0x11f')])[_0x50e8('0xe5')](_0x50e8('0x107'))['toString']():'','disposition':_0x57e649['disposition'],'chatInfo':{'browser':_0x57e649['browserName'],'os':_0x57e649[_0x50e8('0x120')],'referer':_0x57e649[_0x50e8('0x121')],'customerIp':_0x57e649[_0x50e8('0x122')],'customerPort':_0x57e649[_0x50e8('0x123')]?_0x57e649[_0x50e8('0x123')]:'N.A.'},'messages':_(_0x57e649[_0x50e8('0xe8')])[_0x50e8('0x124')]()['filter']({'secret':![]})[_0x50e8('0x35')](function(_0x53bad8){if(_0x53bad8[_0x50e8('0x11a')]){var _0x30d372=path[_0x50e8('0xe0')](_0x32c089,_0x53bad8[_0x50e8('0x11a')][_0x50e8('0xdb')]);if(fs[_0x50e8('0x125')](_0x30d372)){fs[_0x50e8('0x126')](_0x30d372)[_0x50e8('0x127')](fs['createWriteStream'](path[_0x50e8('0xe0')](_0x1c2fd5,_0x53bad8[_0x50e8('0x11a')][_0x50e8('0xdb')])));}}return{'date':moment(_0x53bad8[_0x50e8('0xf4')])[_0x50e8('0xe5')]('YYYY-MM-DD\x20HH:mm:ss')[_0x50e8('0x9e')](),'sender':_0x53bad8[_0x50e8('0xf6')]==='out'?_0x53bad8[_0x50e8('0x7b')]?_0x53bad8[_0x50e8('0x7b')]['fullname']:'System':_0x53bad8[_0x50e8('0xd4')]['firstName']+(_0x53bad8[_0x50e8('0xd4')][_0x50e8('0x119')]?'\x20'+_0x53bad8['Contact'][_0x50e8('0x119')]:''),'body':_0x53bad8['Attachment']?_0x53bad8[_0x50e8('0x11a')][_0x50e8('0xdb')]:_0x53bad8[_0x50e8('0x7d')],'direction':_0x53bad8['direction']==='out'?'A':'C','secret':_0x53bad8[_0x50e8('0xf7')],'read':_0x53bad8[_0x50e8('0x88')],'attachment':_0x53bad8['Attachment']};})[_0x50e8('0x76')]()};return ejs[_0x50e8('0x128')](path[_0x50e8('0xe0')](config[_0x50e8('0xe3')],_0x50e8('0x113'),'views',_0x50e8('0x129')),{'interaction':_0x3f342b})[_0x50e8('0x2a')](function(_0x1e3192){var _0x4c294b=path[_0x50e8('0xe0')](_0x1c2fd5,_0x50e8('0x12a')+_0x57e649['id']+'-'+_0x40ecf7+_0x50e8('0x12b'));var _0x3b0c3d={'path':_0x4c294b,'channel':'Chat','interactionId':_0x57e649['id']};return pdf[_0x50e8('0x12c')](_0x1e3192,_0x3b0c3d);})[_0x50e8('0x2a')](function(){return new Promise(function(_0x23eec2,_0x19cf56){zipdir(_0x1c2fd5,{'saveTo':_0x1abc45},function(_0x595588,_0x30f8c9){if(_0x595588)return _0x19cf56(_0x595588);return _0x23eec2(_0x30f8c9);});})[_0x50e8('0x2a')](function(){return new BPromise(function(_0x26fa23,_0x278f3d){rimraf(_0x1c2fd5,function(_0x441ad6){if(_0x441ad6)_0x278f3d(_0x441ad6);return _0x26fa23();});});})[_0x50e8('0x2a')](function(){return _0x26fa2c[_0x50e8('0x111')](_0x1abc45,_0x289024,function(_0x3281d8){if(_0x3281d8){logger[_0x50e8('0x1c')](_0x50e8('0x12d'),_0x3281d8);}else{fs[_0x50e8('0x12e')](_0x1abc45);}});});});}else{return _0x26fa2c[_0x50e8('0x20')](0xc8);}})[_0x50e8('0x3b')](handleError(_0x26fa2c,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 0ea600f..952731f 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 _0xb558=['ChatMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','map','then','length','emit','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction'];(function(_0x3a0019,_0x393997){var _0x135e81=function(_0x2ee99a){while(--_0x2ee99a){_0x3a0019['push'](_0x3a0019['shift']());}};_0x135e81(++_0x393997);}(_0xb558,0x11d));var _0x8b55=function(_0x3470bb,_0x34e3de){_0x3470bb=_0x3470bb-0x0;var _0x51fe56=_0xb558[_0x3470bb];return _0x51fe56;};'use strict';var EventEmitter=require(_0x8b55('0x0'));var ChatInteraction=require(_0x8b55('0x1'))['db'][_0x8b55('0x2')];var ChatMessage=require(_0x8b55('0x1'))['db'][_0x8b55('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x8b55('0x4')](0x0);var events={'afterCreate':_0x8b55('0x5'),'afterUpdate':_0x8b55('0x6'),'afterDestroy':_0x8b55('0x7')};function emitEvent(_0x14f451){return function(_0x5cd075,_0x1186b0,_0x51f856){_0x5cd075[_0x8b55('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x72e5f5){_0x5cd075[_0x8b55('0x9')]('Users',_0x72e5f5[_0x8b55('0xa')](function(_0xca360f){return{'id':_0xca360f['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x5cd075['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8b55('0xb')](function(_0x2ee81d){_0x5cd075[_0x8b55('0x9')]('unreadMessages',_0x2ee81d[_0x8b55('0xc')]);ChatInteractionEvents[_0x8b55('0xd')](_0x14f451+':'+_0x5cd075['id'],_0x5cd075);ChatInteractionEvents[_0x8b55('0xd')](_0x14f451,_0x5cd075);_0x51f856(null);})['catch'](_0x51f856(null));};}for(var e in events){if(events[_0x8b55('0xe')](e)){var event=events[e];ChatInteraction[_0x8b55('0xf')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x0478=['emit','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0x0478,0x1b8));var _0x8047=function(_0x2db45e,_0x3c3b37){_0x2db45e=_0x2db45e-0x0;var _0x200a5=_0x0478[_0x2db45e];return _0x200a5;};'use strict';var EventEmitter=require(_0x8047('0x0'));var ChatInteraction=require(_0x8047('0x1'))['db'][_0x8047('0x2')];var ChatMessage=require(_0x8047('0x1'))['db'][_0x8047('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x8047('0x4')](0x0);var events={'afterCreate':_0x8047('0x5'),'afterUpdate':_0x8047('0x6'),'afterDestroy':_0x8047('0x7')};function emitEvent(_0x321114){return function(_0x420ad6,_0x16f0d6,_0x5da817){_0x420ad6[_0x8047('0x8')]({'attributes':['id'],'raw':!![]})[_0x8047('0x9')](function(_0x4e3c2a){_0x420ad6[_0x8047('0xa')](_0x8047('0xb'),_0x4e3c2a[_0x8047('0xc')](function(_0x158f57){return{'id':_0x158f57['id']};}));return ChatMessage[_0x8047('0xd')]({'where':{'ChatInteractionId':_0x420ad6['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8047('0x9')](function(_0x393dd5){_0x420ad6[_0x8047('0xa')](_0x8047('0xe'),_0x393dd5[_0x8047('0xf')]);ChatInteractionEvents[_0x8047('0x10')](_0x321114+':'+_0x420ad6['id'],_0x420ad6);ChatInteractionEvents[_0x8047('0x10')](_0x321114,_0x420ad6);_0x5da817(null);})['catch'](_0x5da817(null));};}for(var e in events){if(events[_0x8047('0x11')](e)){var event=events[e];ChatInteraction[_0x8047('0x12')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 68e4908..997a12e 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 _0x5539=['chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define'];(function(_0x44eb28,_0x4c4308){var _0x4da0d9=function(_0x2e5c21){while(--_0x2e5c21){_0x44eb28['push'](_0x44eb28['shift']());}};_0x4da0d9(++_0x4c4308);}(_0x5539,0x97));var _0x9553=function(_0x7dd4f6,_0x25fd40){_0x7dd4f6=_0x7dd4f6-0x0;var _0x10809e=_0x5539[_0x7dd4f6];return _0x10809e;};'use strict';var _=require(_0x9553('0x0'));var util=require(_0x9553('0x1'));var logger=require(_0x9553('0x2'))(_0x9553('0x3'));var moment=require(_0x9553('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9553('0x5'));var rimraf=require(_0x9553('0x6'));var config=require(_0x9553('0x7'));var attributes=require(_0x9553('0x8'));module[_0x9553('0x9')]=function(_0x4ebf20,_0xa886ac){return _0x4ebf20[_0x9553('0xa')]('ChatInteraction',attributes,{'tableName':_0x9553('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x41fb17,_0x1d5a47,_0x3412c0){if(_0x41fb17[_0x9553('0xc')](_0x9553('0xd'))){_0x41fb17[_0x9553('0xe')]=moment()[_0x9553('0xf')](_0x9553('0x10'));}_0x3412c0(null,_0x41fb17);}},'charset':'utf8mb4','collate':_0x9553('0x11')});};
\ No newline at end of file
+var _0x6702=['changed','closed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','exports','chat_interactions'];(function(_0x4d2f79,_0x41ca68){var _0x2540c6=function(_0x199db0){while(--_0x199db0){_0x4d2f79['push'](_0x4d2f79['shift']());}};_0x2540c6(++_0x41ca68);}(_0x6702,0x18d));var _0x2670=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x6702[_0x39e84d];return _0x1991bc;};'use strict';var _=require('lodash');var util=require(_0x2670('0x0'));var logger=require('../../config/logger')(_0x2670('0x1'));var moment=require(_0x2670('0x2'));var BPromise=require(_0x2670('0x3'));var rp=require(_0x2670('0x4'));var fs=require('fs');var path=require(_0x2670('0x5'));var rimraf=require(_0x2670('0x6'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0x2670('0x7')]=function(_0x12489e,_0x4ebd95){return _0x12489e['define']('ChatInteraction',attributes,{'tableName':_0x2670('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x276c99,_0x85a18c,_0x5a9957){if(_0x276c99[_0x2670('0x9')](_0x2670('0xa'))){_0x276c99['closedAt']=moment()['format'](_0x2670('0xb'));}_0x5a9957(null,_0x276c99);}},'charset':_0x2670('0xc'),'collate':_0x2670('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index d2c2088..2a6c3e1 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 _0x2e38=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','attributes','then','AddTagsToChatInteraction','addTags','body','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring'];(function(_0x456f1c,_0x4453d5){var _0x51918c=function(_0x12ce55){while(--_0x12ce55){_0x456f1c['push'](_0x456f1c['shift']());}};_0x51918c(++_0x4453d5);}(_0x2e38,0x1be));var _0x82e3=function(_0x4c9ee6,_0x90caf9){_0x4c9ee6=_0x4c9ee6-0x0;var _0x130ee8=_0x2e38[_0x4c9ee6];return _0x130ee8;};'use strict';var _=require(_0x82e3('0x0'));var util=require(_0x82e3('0x1'));var moment=require('moment');var BPromise=require(_0x82e3('0x2'));var rs=require(_0x82e3('0x3'));var fs=require('fs');var Redis=require(_0x82e3('0x4'));var db=require(_0x82e3('0x5'))['db'];var utils=require(_0x82e3('0x6'));var logger=require(_0x82e3('0x7'))(_0x82e3('0x8'));var config=require(_0x82e3('0x9'));var jayson=require(_0x82e3('0xa'));var client=jayson[_0x82e3('0xb')][_0x82e3('0xc')]({'port':0x232a});config[_0x82e3('0xd')]=_['defaults'](config[_0x82e3('0xd')],{'host':_0x82e3('0xe'),'port':0x18eb});var socket=require(_0x82e3('0xf'))(new Redis(config[_0x82e3('0xd')]));require(_0x82e3('0x10'))[_0x82e3('0x11')](socket);function respondWithRpcPromise(_0xd16f14,_0x40bf12,_0x56e175){return new BPromise(function(_0x47290,_0x4e8cd4){return client[_0x82e3('0x12')](_0xd16f14,_0x56e175)['then'](function(_0x46dfc3){logger['info'](_0x82e3('0x13'),_0x40bf12,_0x82e3('0x14'));logger[_0x82e3('0x15')](_0x82e3('0x16'),_0x40bf12,_0x82e3('0x14'),JSON[_0x82e3('0x17')](_0x46dfc3));if(_0x46dfc3[_0x82e3('0x18')]){if(_0x46dfc3[_0x82e3('0x18')][_0x82e3('0x19')]===0x1f4){logger['error'](_0x82e3('0x13'),_0x40bf12,_0x46dfc3[_0x82e3('0x18')][_0x82e3('0x1a')]);return _0x4e8cd4(_0x46dfc3[_0x82e3('0x18')][_0x82e3('0x1a')]);}logger[_0x82e3('0x18')](_0x82e3('0x13'),_0x40bf12,_0x46dfc3[_0x82e3('0x18')][_0x82e3('0x1a')]);return _0x47290(_0x46dfc3[_0x82e3('0x18')]['message']);}else{logger[_0x82e3('0x1b')](_0x82e3('0x13'),_0x40bf12,'request\x20sent');_0x47290(_0x46dfc3[_0x82e3('0x1c')]['message']);}})[_0x82e3('0x1d')](function(_0x3781c5){logger[_0x82e3('0x18')](_0x82e3('0x13'),_0x40bf12,_0x3781c5);_0x4e8cd4(_0x3781c5);});});}exports[_0x82e3('0x1e')]=function(_0x707dc8){var _0x470711=this;return new Promise(function(_0x28bfba,_0x2bfc32){return db[_0x82e3('0x1f')][_0x82e3('0x20')](_0x707dc8['body'],{'raw':_0x707dc8[_0x82e3('0x21')]?_0x707dc8[_0x82e3('0x21')][_0x82e3('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x707dc8[_0x82e3('0x21')]?_0x707dc8[_0x82e3('0x21')][_0x82e3('0x23')]||null:null,'attributes':_0x707dc8[_0x82e3('0x21')]?_0x707dc8[_0x82e3('0x21')][_0x82e3('0x24')]||null:null,'limit':_0x707dc8['options']?_0x707dc8[_0x82e3('0x21')]['limit']||null:null})[_0x82e3('0x25')](function(_0x45756c){logger[_0x82e3('0x1b')]('UpdateChatInteraction',_0x707dc8);logger[_0x82e3('0x15')](_0x82e3('0x1e'),_0x707dc8,JSON['stringify'](_0x45756c));_0x28bfba(_0x45756c);})['catch'](function(_0x12449b){logger[_0x82e3('0x18')](_0x82e3('0x1e'),_0x12449b['message'],_0x707dc8);_0x2bfc32(_0x470711['error'](0x1f4,_0x12449b[_0x82e3('0x1a')]));});});};exports[_0x82e3('0x26')]=function(_0x3efef6){return new Promise(function(_0x49da7a,_0x43918b){return db[_0x82e3('0x1f')]['find']({'where':_0x3efef6[_0x82e3('0x21')]?_0x3efef6['options'][_0x82e3('0x23')]||null:null})[_0x82e3('0x25')](function(_0x33b764){if(_0x33b764){return _0x33b764[_0x82e3('0x27')](_0x3efef6[_0x82e3('0x28')][_0x82e3('0x29')],_[_0x82e3('0x2a')](_0x3efef6[_0x82e3('0x28')],[_0x82e3('0x29'),'id'])||{});}})[_0x82e3('0x2b')](function(_0x37d4dc){logger['info'](_0x82e3('0x2c'),_0x3efef6);logger[_0x82e3('0x15')]('AddTags',_0x3efef6,JSON[_0x82e3('0x17')](_0x37d4dc));_0x49da7a(_0x37d4dc);})[_0x82e3('0x1d')](function(_0x435c29){logger[_0x82e3('0x18')](_0x82e3('0x2c'),_0x435c29['message'],_0x3efef6);_0x43918b(_this[_0x82e3('0x18')](0x1f4,_0x435c29['message']));});});};
\ No newline at end of file
+var _0x60f6=['request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','attributes','limit','debug','find','addTags','body','ids','omit','spread','AddTags','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./chatInteraction.socket','request','then','info'];(function(_0x4544a7,_0x4a889b){var _0x3d2c1c=function(_0x4b129e){while(--_0x4b129e){_0x4544a7['push'](_0x4544a7['shift']());}};_0x3d2c1c(++_0x4a889b);}(_0x60f6,0x66));var _0x660f=function(_0x6efecb,_0xa11209){_0x6efecb=_0x6efecb-0x0;var _0x289d48=_0x60f6[_0x6efecb];return _0x289d48;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x660f('0x0'));var BPromise=require(_0x660f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x660f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x660f('0x3'));var logger=require(_0x660f('0x4'))(_0x660f('0x5'));var config=require(_0x660f('0x6'));var jayson=require(_0x660f('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x660f('0x8')]=_[_0x660f('0x9')](config[_0x660f('0x8')],{'host':_0x660f('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x660f('0x8')]));require(_0x660f('0xb'))['register'](socket);function respondWithRpcPromise(_0x31228d,_0x348fe3,_0x55a4e4){return new BPromise(function(_0xdc57d0,_0xd3962f){return client[_0x660f('0xc')](_0x31228d,_0x55a4e4)[_0x660f('0xd')](function(_0x2f670f){logger[_0x660f('0xe')]('ChatInteraction,\x20%s,\x20%s',_0x348fe3,_0x660f('0xf'));logger['debug'](_0x660f('0x10'),_0x348fe3,_0x660f('0xf'),JSON[_0x660f('0x11')](_0x2f670f));if(_0x2f670f[_0x660f('0x12')]){if(_0x2f670f['error']['code']===0x1f4){logger[_0x660f('0x12')](_0x660f('0x13'),_0x348fe3,_0x2f670f[_0x660f('0x12')][_0x660f('0x14')]);return _0xd3962f(_0x2f670f[_0x660f('0x12')][_0x660f('0x14')]);}logger[_0x660f('0x12')](_0x660f('0x13'),_0x348fe3,_0x2f670f[_0x660f('0x12')][_0x660f('0x14')]);return _0xdc57d0(_0x2f670f[_0x660f('0x12')]['message']);}else{logger[_0x660f('0xe')]('ChatInteraction,\x20%s,\x20%s',_0x348fe3,'request\x20sent');_0xdc57d0(_0x2f670f[_0x660f('0x15')]['message']);}})[_0x660f('0x16')](function(_0x2346d7){logger[_0x660f('0x12')](_0x660f('0x13'),_0x348fe3,_0x2346d7);_0xd3962f(_0x2346d7);});});}exports[_0x660f('0x17')]=function(_0x36c988){var _0x1dbc56=this;return new Promise(function(_0xbcba,_0x3161b5){return db[_0x660f('0x18')][_0x660f('0x19')](_0x36c988['body'],{'raw':_0x36c988[_0x660f('0x1a')]?_0x36c988[_0x660f('0x1a')][_0x660f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36c988['options']?_0x36c988['options'][_0x660f('0x1c')]||null:null,'attributes':_0x36c988[_0x660f('0x1a')]?_0x36c988['options'][_0x660f('0x1d')]||null:null,'limit':_0x36c988['options']?_0x36c988[_0x660f('0x1a')][_0x660f('0x1e')]||null:null})[_0x660f('0xd')](function(_0x293ba1){logger[_0x660f('0xe')](_0x660f('0x17'),_0x36c988);logger[_0x660f('0x1f')](_0x660f('0x17'),_0x36c988,JSON[_0x660f('0x11')](_0x293ba1));_0xbcba(_0x293ba1);})[_0x660f('0x16')](function(_0x1f7e1a){logger['error'](_0x660f('0x17'),_0x1f7e1a[_0x660f('0x14')],_0x36c988);_0x3161b5(_0x1dbc56['error'](0x1f4,_0x1f7e1a[_0x660f('0x14')]));});});};exports['AddTagsToChatInteraction']=function(_0x22d977){return new Promise(function(_0x22990a,_0x4e01c1){return db[_0x660f('0x18')][_0x660f('0x20')]({'where':_0x22d977['options']?_0x22d977[_0x660f('0x1a')][_0x660f('0x1c')]||null:null})[_0x660f('0xd')](function(_0x1a9570){if(_0x1a9570){return _0x1a9570[_0x660f('0x21')](_0x22d977[_0x660f('0x22')][_0x660f('0x23')],_[_0x660f('0x24')](_0x22d977['body'],[_0x660f('0x23'),'id'])||{});}})[_0x660f('0x25')](function(_0xa9f113){logger['info'](_0x660f('0x26'),_0x22d977);logger[_0x660f('0x1f')](_0x660f('0x26'),_0x22d977,JSON[_0x660f('0x11')](_0xa9f113));_0x22990a(_0xa9f113);})['catch'](function(_0x1576c1){logger[_0x660f('0x12')]('AddTags',_0x1576c1[_0x660f('0x14')],_0x22d977);_0x4e01c1(_this[_0x660f('0x12')](0x1f4,_0x1576c1[_0x660f('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index eb753c4..c798742 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 _0x4349=['update','emit','length','chatInteraction:','save'];(function(_0x4ba1e7,_0x23b5ef){var _0xafdfb6=function(_0x1c6ca8){while(--_0x1c6ca8){_0x4ba1e7['push'](_0x4ba1e7['shift']());}};_0xafdfb6(++_0x23b5ef);}(_0x4349,0x1c6));var _0x9434=function(_0x4c6327,_0xcbdd4b){_0x4c6327=_0x4c6327-0x0;var _0x3c8bc1=_0x4349[_0x4c6327];return _0x3c8bc1;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x9434('0x0'),'remove',_0x9434('0x1')];function createListener(_0x428503,_0x2ef439){return function(_0x2c46cc){_0x2ef439[_0x9434('0x2')](_0x428503,_0x2c46cc);};}function removeListener(_0x15817c,_0x46c92d){return function(){ChatInteractionEvents['removeListener'](_0x15817c,_0x46c92d);};}exports['register']=function(_0xa89207){for(var _0x5b80b0=0x0,_0x29a394=events[_0x9434('0x3')];_0x5b80b0<_0x29a394;_0x5b80b0++){var _0x24af73=events[_0x5b80b0];var _0x4270b1=createListener(_0x9434('0x4')+_0x24af73,_0xa89207);ChatInteractionEvents['on'](_0x24af73,_0x4270b1);}};
\ No newline at end of file
+var _0xaf65=['save','remove','update','emit','removeListener','register','chatInteraction:','./chatInteraction.events'];(function(_0x42b2f4,_0x460144){var _0x1bb349=function(_0xfbda02){while(--_0xfbda02){_0x42b2f4['push'](_0x42b2f4['shift']());}};_0x1bb349(++_0x460144);}(_0xaf65,0x1c7));var _0x5af6=function(_0x50ab8f,_0x18237d){_0x50ab8f=_0x50ab8f-0x0;var _0x298d39=_0xaf65[_0x50ab8f];return _0x298d39;};'use strict';var ChatInteractionEvents=require(_0x5af6('0x0'));var events=[_0x5af6('0x1'),_0x5af6('0x2'),_0x5af6('0x3')];function createListener(_0x4f1e94,_0x1921cb){return function(_0x5889b8){_0x1921cb[_0x5af6('0x4')](_0x4f1e94,_0x5889b8);};}function removeListener(_0xd172c7,_0x401021){return function(){ChatInteractionEvents[_0x5af6('0x5')](_0xd172c7,_0x401021);};}exports[_0x5af6('0x6')]=function(_0x1744d3){for(var _0x2be59b=0x0,_0x45b67d=events['length'];_0x2be59b<_0x45b67d;_0x2be59b++){var _0x3f64df=events[_0x2be59b];var _0x5de271=createListener(_0x5af6('0x7')+_0x3f64df,_0x1744d3);ChatInteractionEvents['on'](_0x3f64df,_0x5de271);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index cbd981f..c94706d 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 _0x1a77=['isChatInteractionAuthorized','show','/:id/attachment_download','getMessages','/:id/my_messages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','/:id/messages','addMessage','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','put','/:id/close','close','delete','/:id','chatinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe'];(function(_0xa670ec,_0x14fc26){var _0x117e86=function(_0x46d765){while(--_0x46d765){_0xa670ec['push'](_0xa670ec['shift']());}};_0x117e86(++_0x14fc26);}(_0x1a77,0x12c));var _0x71a7=function(_0x31fac5,_0x48230e){_0x31fac5=_0x31fac5-0x0;var _0x1521db=_0x1a77[_0x31fac5];return _0x1521db;};'use strict';var multer=require(_0x71a7('0x0'));var util=require(_0x71a7('0x1'));var path=require(_0x71a7('0x2'));var timeout=require('connect-timeout');var express=require(_0x71a7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x71a7('0x4'));var interaction=require(_0x71a7('0x5'));var config=require(_0x71a7('0x6'));var controller=require(_0x71a7('0x7'));router[_0x71a7('0x8')]('/',auth[_0x71a7('0x9')](),controller[_0x71a7('0xa')]);router[_0x71a7('0x8')](_0x71a7('0xb'),auth[_0x71a7('0x9')](),controller['describe']);router[_0x71a7('0x8')]('/:id',auth[_0x71a7('0xc')](),controller[_0x71a7('0xd')]);router['get'](_0x71a7('0xe'),auth[_0x71a7('0xc')](),controller['attachmentDownload']);router[_0x71a7('0x8')]('/:id/messages',auth[_0x71a7('0x9')](),controller[_0x71a7('0xf')]);router[_0x71a7('0x8')](_0x71a7('0x10'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0x71a7('0x8')](_0x71a7('0x11'),auth['isAuthenticated'](),controller[_0x71a7('0x12')]);router[_0x71a7('0x13')]('/',auth[_0x71a7('0x9')](),controller[_0x71a7('0x14')]);router[_0x71a7('0x13')](_0x71a7('0x15'),auth[_0x71a7('0x9')](),controller[_0x71a7('0x16')]);var upload=multer({'storage':multer[_0x71a7('0x17')]({'destination':function(_0x36a5be,_0x160b4d,_0x47a47e){_0x47a47e(null,path[_0x71a7('0x18')](config[_0x71a7('0x19')],_0x71a7('0x1a')));},'filename':function(_0x3f59f7,_0x2fe6d9,_0x2317ca){_0x2317ca(null,util[_0x71a7('0x1b')](_0x71a7('0x1c'),Date[_0x71a7('0x1d')](),_0x2fe6d9[_0x71a7('0x1e')][_0x71a7('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x71a7('0x13')]('/:id/attachment_upload',upload[_0x71a7('0x20')]('file'),controller['attachmentUpload']);router['post'](_0x71a7('0x21'),auth[_0x71a7('0xc')](),controller[_0x71a7('0x22')]);router[_0x71a7('0x13')]('/:id/tags',auth[_0x71a7('0x9')](),interaction['tracked'](_0x71a7('0x23'),_0x71a7('0x24')),controller[_0x71a7('0x25')]);router['put']('/:id',auth[_0x71a7('0x9')](),interaction['tracked'](_0x71a7('0x23'),_0x71a7('0x26')),controller[_0x71a7('0x27')]);router['put'](_0x71a7('0x28'),controller[_0x71a7('0x29')]);router['put'](_0x71a7('0x2a'),auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0x71a7('0x2b')](_0x71a7('0x2c'),controller[_0x71a7('0x2d')]);router[_0x71a7('0x2e')](_0x71a7('0x2f'),auth[_0x71a7('0x9')](),interaction['tracked']('chat',_0x71a7('0x30')),controller[_0x71a7('0x31')]);router[_0x71a7('0x2e')](_0x71a7('0x32'),auth[_0x71a7('0x9')](),controller[_0x71a7('0x33')]);module['exports']=router;
\ No newline at end of file
+var _0x1f3f=['customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','/describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update'];(function(_0x218669,_0x44ac90){var _0x8606d9=function(_0x538da8){while(--_0x538da8){_0x218669['push'](_0x218669['shift']());}};_0x8606d9(++_0x44ac90);}(_0x1f3f,0xd5));var _0xf1f3=function(_0x363b89,_0x2f2e75){_0x363b89=_0x363b89-0x0;var _0x2ffc54=_0x1f3f[_0x363b89];return _0x2ffc54;};'use strict';var multer=require(_0xf1f3('0x0'));var util=require(_0xf1f3('0x1'));var path=require('path');var timeout=require(_0xf1f3('0x2'));var express=require(_0xf1f3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf1f3('0x4'));var interaction=require(_0xf1f3('0x5'));var config=require('../../config/environment');var controller=require(_0xf1f3('0x6'));router[_0xf1f3('0x7')]('/',auth[_0xf1f3('0x8')](),controller['index']);router['get'](_0xf1f3('0x9'),auth[_0xf1f3('0x8')](),controller['describe']);router['get'](_0xf1f3('0xa'),auth[_0xf1f3('0xb')](),controller['show']);router[_0xf1f3('0x7')](_0xf1f3('0xc'),auth[_0xf1f3('0xb')](),controller[_0xf1f3('0xd')]);router[_0xf1f3('0x7')]('/:id/messages',auth[_0xf1f3('0x8')](),controller['getMessages']);router[_0xf1f3('0x7')](_0xf1f3('0xe'),auth[_0xf1f3('0xb')](),controller[_0xf1f3('0xf')]);router[_0xf1f3('0x7')](_0xf1f3('0x10'),auth['isAuthenticated'](),controller[_0xf1f3('0x11')]);router[_0xf1f3('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf1f3('0x12')](_0xf1f3('0x13'),auth[_0xf1f3('0x8')](),controller[_0xf1f3('0x14')]);var upload=multer({'storage':multer[_0xf1f3('0x15')]({'destination':function(_0x3ce98b,_0xea0c6d,_0x1e5c8a){_0x1e5c8a(null,path[_0xf1f3('0x16')](config[_0xf1f3('0x17')],_0xf1f3('0x18')));},'filename':function(_0x57620a,_0x5830fe,_0x3c534d){_0x3c534d(null,util[_0xf1f3('0x19')](_0xf1f3('0x1a'),Date[_0xf1f3('0x1b')](),_0x5830fe[_0xf1f3('0x1c')][_0xf1f3('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf1f3('0x12')](_0xf1f3('0x1e'),upload[_0xf1f3('0x1f')](_0xf1f3('0x20')),controller[_0xf1f3('0x21')]);router[_0xf1f3('0x12')](_0xf1f3('0x22'),auth['isChatInteractionAuthorized'](),controller[_0xf1f3('0x23')]);router[_0xf1f3('0x12')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xf1f3('0x24')](_0xf1f3('0x25'),_0xf1f3('0x26')),controller[_0xf1f3('0x27')]);router[_0xf1f3('0x28')](_0xf1f3('0xa'),auth[_0xf1f3('0x8')](),interaction[_0xf1f3('0x24')](_0xf1f3('0x25'),_0xf1f3('0x29')),controller['update']);router[_0xf1f3('0x28')]('/:id/custom_update',controller[_0xf1f3('0x2a')]);router['put'](_0xf1f3('0x2b'),auth[_0xf1f3('0xb')](),controller[_0xf1f3('0x2c')]);router[_0xf1f3('0x28')](_0xf1f3('0x2d'),controller['close']);router[_0xf1f3('0x2e')](_0xf1f3('0xa'),auth[_0xf1f3('0x8')](),interaction[_0xf1f3('0x24')](_0xf1f3('0x25'),_0xf1f3('0x2f')),controller[_0xf1f3('0x30')]);router['delete']('/:id/tags',auth[_0xf1f3('0x8')](),controller[_0xf1f3('0x31')]);module[_0xf1f3('0x32')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 4a49058..82f24c9 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 _0x6aeb=['medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x53955a,_0x1177fd){var _0x146e46=function(_0x5b1535){while(--_0x5b1535){_0x53955a['push'](_0x53955a['shift']());}};_0x146e46(++_0x1177fd);}(_0x6aeb,0x139));var _0xb6ae=function(_0x2e6dbf,_0x57dd06){_0x2e6dbf=_0x2e6dbf-0x0;var _0x2680e5=_0x6aeb[_0x2e6dbf];return _0x2680e5;};'use strict';var Sequelize=require(_0xb6ae('0x0'));module[_0xb6ae('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb6ae('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb6ae('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb6ae('0x4')]}};
\ No newline at end of file
+var _0x1c39=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x587d9b,_0xaea738){var _0x232459=function(_0x2d7e2e){while(--_0x2d7e2e){_0x587d9b['push'](_0x587d9b['shift']());}};_0x232459(++_0xaea738);}(_0x1c39,0x1bd));var _0x91c3=function(_0x365b01,_0x4d1cb4){_0x365b01=_0x365b01-0x0;var _0x4235f5=_0x1c39[_0x365b01];return _0x4235f5;};'use strict';var Sequelize=require(_0x91c3('0x0'));module[_0x91c3('0x1')]={'body':{'type':Sequelize[_0x91c3('0x2')](_0x91c3('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x91c3('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x91c3('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index b32fdde..b4f0e33 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 _0x0783=['update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','body','find','describe','messages','createdAt','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','agent','admin','user','fullname','role','internal','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','ToId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save'];(function(_0x290fc9,_0x3069fe){var _0x31c8bd=function(_0x4bec21){while(--_0x4bec21){_0x290fc9['push'](_0x290fc9['shift']());}};_0x31c8bd(++_0x3069fe);}(_0x0783,0x126));var _0x3078=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0783[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3078('0x0'));var zipdir=require(_0x3078('0x1'));var jsonpatch=require(_0x3078('0x2'));var rp=require(_0x3078('0x3'));var moment=require('moment');var BPromise=require(_0x3078('0x4'));var Mustache=require(_0x3078('0x5'));var util=require(_0x3078('0x6'));var path=require(_0x3078('0x7'));var sox=require(_0x3078('0x8'));var csv=require(_0x3078('0x9'));var ejs=require(_0x3078('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3078('0xb'));var squel=require(_0x3078('0xc'));var crypto=require(_0x3078('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3078('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3078('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3078('0xf'));var as=require(_0x3078('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3078('0x11'))('api');var utils=require(_0x3078('0x12'));var config=require(_0x3078('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3078('0x14'))['db'];config[_0x3078('0x15')]=_[_0x3078('0x16')](config['redis'],{'host':_0x3078('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3078('0x15')]));require(_0x3078('0x18'))[_0x3078('0x19')](socket);function respondWithStatusCode(_0xf5b54b,_0x201d14){_0x201d14=_0x201d14||0xcc;return function(_0x43ae65){if(_0x43ae65){return _0xf5b54b[_0x3078('0x1a')](_0x201d14);}return _0xf5b54b[_0x3078('0x1b')](_0x201d14)[_0x3078('0x1c')]();};}function respondWithResult(_0x349a5e,_0x146f95){_0x146f95=_0x146f95||0xc8;return function(_0x5183ec){if(_0x5183ec){return _0x349a5e[_0x3078('0x1b')](_0x146f95)[_0x3078('0x1d')](_0x5183ec);}};}function respondWithFilteredResult(_0x269a33,_0x5a412f){return function(_0xd4f3b){if(_0xd4f3b){var _0x3330a3=typeof _0x5a412f['offset']===_0x3078('0x1e')&&typeof _0x5a412f[_0x3078('0x1f')]===_0x3078('0x1e');var _0x24bb34=_0xd4f3b[_0x3078('0x20')];var _0x16062c=_0x3330a3?0x0:_0x5a412f[_0x3078('0x21')];var _0x8f91e4=_0x3330a3?_0xd4f3b['count']:_0x5a412f[_0x3078('0x21')]+_0x5a412f[_0x3078('0x1f')];var _0x1a8b13;if(_0x8f91e4>=_0x24bb34){_0x8f91e4=_0x24bb34;_0x1a8b13=0xc8;}else{_0x1a8b13=0xce;}_0x269a33[_0x3078('0x1b')](_0x1a8b13);return _0x269a33[_0x3078('0x22')](_0x3078('0x23'),_0x16062c+'-'+_0x8f91e4+'/'+_0x24bb34)[_0x3078('0x1d')](_0xd4f3b);}return null;};}function patchUpdates(_0x47acdb){return function(_0x5e0993){try{jsonpatch[_0x3078('0x24')](_0x5e0993,_0x47acdb,!![]);}catch(_0x58c806){return BPromise[_0x3078('0x25')](_0x58c806);}return _0x5e0993[_0x3078('0x26')]();};}function saveUpdates(_0x44df8b,_0x165ffb){return function(_0x2b0789){if(_0x2b0789){return _0x2b0789[_0x3078('0x27')](_0x44df8b)[_0x3078('0x28')](function(_0x116ae6){return _0x116ae6;});}return null;};}function removeEntity(_0x37322f,_0x3199a8){return function(_0x4400a3){if(_0x4400a3){return _0x4400a3[_0x3078('0x29')]()[_0x3078('0x28')](function(){_0x37322f[_0x3078('0x1b')](0xcc)[_0x3078('0x1c')]();});}};}function handleEntityNotFound(_0x360d87,_0x3aa993){return function(_0x231b4f){if(!_0x231b4f){_0x360d87[_0x3078('0x1a')](0x194);}return _0x231b4f;};}function handleError(_0x590047,_0x4c7b4f){_0x4c7b4f=_0x4c7b4f||0x1f4;return function(_0x1fea41){logger[_0x3078('0x2a')](_0x1fea41[_0x3078('0x2b')]);if(_0x1fea41[_0x3078('0x2c')]){delete _0x1fea41[_0x3078('0x2c')];}_0x590047['status'](_0x4c7b4f)[_0x3078('0x2d')](_0x1fea41);};}exports[_0x3078('0x2e')]=function(_0x19943e,_0x3a04e9){var _0x52c6dd={},_0x1bcb8e={},_0x202a36={'count':0x0,'rows':[]};var _0x4442b2=_[_0x3078('0x2f')](db[_0x3078('0x30')][_0x3078('0x31')],function(_0x58d4fb){return{'name':_0x58d4fb[_0x3078('0x32')],'type':_0x58d4fb[_0x3078('0x33')]['key']};});_0x1bcb8e[_0x3078('0x34')]=_[_0x3078('0x2f')](_0x4442b2,_0x3078('0x2c'));_0x1bcb8e[_0x3078('0x35')]=_[_0x3078('0x36')](_0x19943e['query']);_0x1bcb8e['filters']=_['intersection'](_0x1bcb8e[_0x3078('0x34')],_0x1bcb8e[_0x3078('0x35')]);_0x52c6dd['attributes']=_[_0x3078('0x37')](_0x1bcb8e['model'],qs[_0x3078('0x38')](_0x19943e[_0x3078('0x35')][_0x3078('0x38')]));_0x52c6dd[_0x3078('0x39')]=_0x52c6dd[_0x3078('0x39')][_0x3078('0x3a')]?_0x52c6dd[_0x3078('0x39')]:_0x1bcb8e[_0x3078('0x34')];if(!_0x19943e[_0x3078('0x35')][_0x3078('0x3b')](_0x3078('0x3c'))){_0x52c6dd['limit']=qs[_0x3078('0x1f')](_0x19943e[_0x3078('0x35')][_0x3078('0x1f')]);_0x52c6dd[_0x3078('0x21')]=qs[_0x3078('0x21')](_0x19943e[_0x3078('0x35')][_0x3078('0x21')]);}_0x52c6dd[_0x3078('0x3d')]=qs[_0x3078('0x3e')](_0x19943e[_0x3078('0x35')][_0x3078('0x3e')]);_0x52c6dd[_0x3078('0x3f')]=qs[_0x3078('0x40')](_[_0x3078('0x41')](_0x19943e[_0x3078('0x35')],_0x1bcb8e[_0x3078('0x40')]),_0x4442b2);if(_0x19943e[_0x3078('0x35')][_0x3078('0x42')]){_0x52c6dd[_0x3078('0x3f')]=_[_0x3078('0x43')](_0x52c6dd[_0x3078('0x3f')],{'$or':_[_0x3078('0x2f')](_0x4442b2,function(_0x3428f5){if(_0x3428f5['type']!==_0x3078('0x44')){var _0xaa9fe2={};_0xaa9fe2[_0x3428f5[_0x3078('0x2c')]]={'$like':'%'+_0x19943e[_0x3078('0x35')]['filter']+'%'};return _0xaa9fe2;}})});}_0x52c6dd=_[_0x3078('0x43')]({},_0x52c6dd,_0x19943e[_0x3078('0x45')]);var _0x2a29a5={'where':_0x52c6dd[_0x3078('0x3f')]};return db['ChatInternalMessage'][_0x3078('0x20')](_0x2a29a5)[_0x3078('0x28')](function(_0x1c0897){_0x202a36[_0x3078('0x20')]=_0x1c0897;if(_0x19943e['query']['includeAll']){_0x52c6dd[_0x3078('0x46')]=[{'all':!![]}];}return db[_0x3078('0x30')][_0x3078('0x47')](_0x52c6dd);})[_0x3078('0x28')](function(_0x303a03){_0x202a36[_0x3078('0x48')]=_0x303a03;return _0x202a36;})['then'](respondWithFilteredResult(_0x3a04e9,_0x52c6dd))[_0x3078('0x49')](handleError(_0x3a04e9,null));};exports[_0x3078('0x4a')]=function(_0x25ac2b,_0x2eeb27){var _0x2b6a46={'raw':!![],'where':{'id':_0x25ac2b[_0x3078('0x4b')]['id']}},_0x138178={};_0x138178[_0x3078('0x34')]=_['keys'](db[_0x3078('0x30')][_0x3078('0x31')]);_0x138178[_0x3078('0x35')]=_[_0x3078('0x36')](_0x25ac2b[_0x3078('0x35')]);_0x138178[_0x3078('0x40')]=_[_0x3078('0x37')](_0x138178[_0x3078('0x34')],_0x138178[_0x3078('0x35')]);_0x2b6a46[_0x3078('0x39')]=_[_0x3078('0x37')](_0x138178['model'],qs[_0x3078('0x38')](_0x25ac2b['query'][_0x3078('0x38')]));_0x2b6a46['attributes']=_0x2b6a46[_0x3078('0x39')][_0x3078('0x3a')]?_0x2b6a46[_0x3078('0x39')]:_0x138178[_0x3078('0x34')];if(_0x25ac2b[_0x3078('0x35')][_0x3078('0x4c')]){_0x2b6a46[_0x3078('0x46')]=[{'all':!![]}];}_0x2b6a46=_[_0x3078('0x43')]({},_0x2b6a46,_0x25ac2b[_0x3078('0x45')]);return db[_0x3078('0x30')]['find'](_0x2b6a46)[_0x3078('0x28')](handleEntityNotFound(_0x2eeb27,null))[_0x3078('0x28')](respondWithResult(_0x2eeb27,null))[_0x3078('0x49')](handleError(_0x2eeb27,null));};exports[_0x3078('0x4d')]=function(_0x35636d,_0x65cf2a){return db[_0x3078('0x30')][_0x3078('0x4d')](_0x35636d[_0x3078('0x4e')],{})[_0x3078('0x28')](respondWithResult(_0x65cf2a,0xc9))[_0x3078('0x49')](handleError(_0x65cf2a,null));};exports[_0x3078('0x27')]=function(_0xb1d79,_0x2ff04c){if(_0xb1d79[_0x3078('0x4e')]['id']){delete _0xb1d79[_0x3078('0x4e')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0xb1d79['params']['id']}})[_0x3078('0x28')](handleEntityNotFound(_0x2ff04c,null))[_0x3078('0x28')](saveUpdates(_0xb1d79[_0x3078('0x4e')],null))['then'](respondWithResult(_0x2ff04c,null))[_0x3078('0x49')](handleError(_0x2ff04c,null));};exports[_0x3078('0x29')]=function(_0x2deb69,_0x47c7c4){return db[_0x3078('0x30')][_0x3078('0x4f')]({'where':{'id':_0x2deb69[_0x3078('0x4b')]['id']}})['then'](handleEntityNotFound(_0x47c7c4,null))['then'](removeEntity(_0x47c7c4,null))[_0x3078('0x49')](handleError(_0x47c7c4,null));};exports[_0x3078('0x50')]=function(_0x3256c0,_0x2e483c){return db[_0x3078('0x30')][_0x3078('0x50')]()[_0x3078('0x28')](respondWithResult(_0x2e483c,null))['catch'](handleError(_0x2e483c,null));};function wrapUser(_0x12cfe1){return function(_0x2d5213){var _0x2e5205=_0x12cfe1['get']({'plain':!![]});_0x2e5205[_0x3078('0x51')]=[];if(_0x2d5213){_0x2e5205['lastMessageAt']=_0x2d5213[_0x3078('0x52')];_0x2e5205['lastMessage']=_0x2d5213;}else{_0x2e5205[_0x3078('0x53')]=moment(0x0)['format'](_0x3078('0x54'));_0x2e5205[_0x3078('0x55')]={};}return _0x2e5205;};}exports[_0x3078('0x56')]=function(_0x7f3bf,_0x46bec6,_0x37818a){var _0x12dc28=[];return db['User']['findAll']({'where':{'role':[_0x3078('0x57'),_0x3078('0x58'),_0x3078('0x59')]},'attributes':['id',_0x3078('0x5a'),_0x3078('0x2c'),_0x3078('0x5b'),'userpic',_0x3078('0x5c'),'online',_0x3078('0x5d'),'allowmessenger',_0x3078('0x5e')],'order':qs[_0x3078('0x3e')](_0x3078('0x5f')),'include':[{'model':db[_0x3078('0x60')],'as':_0x3078('0x61'),'attributes':['id',_0x3078('0x2c'),_0x3078('0x33')],'through':{'attributes':[]}}]})[_0x3078('0x28')](function(_0x1d8ce1){if(_0x1d8ce1){var _0x5c89f7=_0x7f3bf[_0x3078('0x59')][_0x3078('0x62')]({'plain':!![]});if(!_0x5c89f7)throw new Error(_0x3078('0x63'));if(_0x5c89f7['role']===_0x3078('0x59')){return db[_0x3078('0x64')][_0x3078('0x4f')]({'where':{'name':_0x3078('0x65'),'userProfileId':_0x5c89f7[_0x3078('0x66')]},'raw':!![]})[_0x3078('0x28')](function(_0x22e032){if(_0x22e032){if(_0x22e032[_0x3078('0x67')]===0x0){return db[_0x3078('0x68')][_0x3078('0x47')]({'where':{'sectionId':_0x22e032['id']},'raw':!![]})[_0x3078('0x28')](function(_0xbef07f){var _0x35734d=[];if(_['isEmpty'](_0xbef07f)){_0x35734d=_['filter'](_0x1d8ce1,function(_0x1682ad){if(_0x1682ad[_0x3078('0x5b')]!==_0x3078('0x57')){return _0x1682ad;}});return _0x35734d;}else{for(var _0x404c31=0x0;_0x404c31<_0x1d8ce1[_0x3078('0x3a')];_0x404c31++){var _0x3fe74c=_0x1d8ce1[_0x404c31];if(_0x3fe74c[_0x3078('0x5b')]===_0x3078('0x57')){var _0x554223=_[_0x3078('0x4f')](_0xbef07f,function(_0x4260ca){return _0x4260ca[_0x3078('0x69')]===_0x3fe74c['id'];});if(_0x554223)_0x35734d[_0x3078('0x6a')](_0x3fe74c);}else{_0x35734d[_0x3078('0x6a')](_0x3fe74c);}}return _0x35734d;}});}else{return _0x1d8ce1;}}else{var _0x5d7030=_[_0x3078('0x42')](_0x1d8ce1,function(_0x369476){if(_0x369476[_0x3078('0x5b')]!==_0x3078('0x57')){return _0x369476;}});return _0x5d7030;}});}else{return _0x1d8ce1;}}})[_0x3078('0x28')](function(_0x356ab9){var _0x59506e=[];if(_0x356ab9){_0x12dc28=_0x356ab9;for(var _0x3ea1e7=0x0;_0x3ea1e7<_0x356ab9[_0x3078('0x3a')];_0x3ea1e7+=0x1){_0x12dc28[_0x3ea1e7][_0x3078('0x51')]=[];_0x59506e[_0x3078('0x6a')](db[_0x3078('0x30')][_0x3078('0x4f')]({'where':{'FromId':[_0x7f3bf[_0x3078('0x59')]['id'],_0x356ab9[_0x3ea1e7]['id']],'ToId':[_0x7f3bf[_0x3078('0x59')]['id'],_0x356ab9[_0x3ea1e7]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x3078('0x6b'),_0x3078('0x6c'),_0x3078('0x4e')],'order':qs[_0x3078('0x3e')](_0x3078('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x3078('0x28')](wrapUser(_0x356ab9[_0x3ea1e7])));}return BPromise[_0x3078('0x6e')](_0x59506e);}return[];})[_0x3078('0x28')](function(_0x315c9d){return{'rows':_0x315c9d,'count':_0x315c9d['length']};})['then'](respondWithResult(_0x46bec6,null))[_0x3078('0x49')](handleError(_0x46bec6,null));};
\ No newline at end of file
+var _0x3dbe=['internal','online','lastLoginAt','showWebBar','-online','user','get','UserProfileSection','find','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','destroy','then','error','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','VIRTUAL','options','includeAll','include','findAll','rows','params','merge','catch','create','body','update','describe','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','role','userpic'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x3dbe,0xe6));var _0xe3db=function(_0xdc5c98,_0x4dc10d){_0xdc5c98=_0xdc5c98-0x0;var _0x18d7ee=_0x3dbe[_0xdc5c98];return _0x18d7ee;};'use strict';var emlformat=require(_0xe3db('0x0'));var rimraf=require(_0xe3db('0x1'));var zipdir=require(_0xe3db('0x2'));var jsonpatch=require(_0xe3db('0x3'));var rp=require(_0xe3db('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe3db('0x5'));var util=require(_0xe3db('0x6'));var path=require('path');var sox=require(_0xe3db('0x7'));var csv=require(_0xe3db('0x8'));var ejs=require(_0xe3db('0x9'));var fs=require('fs');var fs_extra=require(_0xe3db('0xa'));var _=require('lodash');var squel=require(_0xe3db('0xb'));var crypto=require(_0xe3db('0xc'));var jsforce=require(_0xe3db('0xd'));var deskjs=require(_0xe3db('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe3db('0xf'));var Papa=require('papaparse');var Redis=require(_0xe3db('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe3db('0x11'));var as=require(_0xe3db('0x12'));var hardwareService=require(_0xe3db('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xe3db('0x14'));var config=require(_0xe3db('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe3db('0x16'))['db'];config['redis']=_[_0xe3db('0x17')](config[_0xe3db('0x18')],{'host':_0xe3db('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe3db('0x18')]));require('./chatInternalMessage.socket')[_0xe3db('0x1a')](socket);function respondWithStatusCode(_0x294776,_0x533761){_0x533761=_0x533761||0xcc;return function(_0x17ccb4){if(_0x17ccb4){return _0x294776[_0xe3db('0x1b')](_0x533761);}return _0x294776['status'](_0x533761)['end']();};}function respondWithResult(_0x264e1f,_0x138ce6){_0x138ce6=_0x138ce6||0xc8;return function(_0x51da12){if(_0x51da12){return _0x264e1f[_0xe3db('0x1c')](_0x138ce6)[_0xe3db('0x1d')](_0x51da12);}};}function respondWithFilteredResult(_0x2ed3db,_0xd9e182){return function(_0x4e0a7b){if(_0x4e0a7b){var _0x301903=typeof _0xd9e182[_0xe3db('0x1e')]===_0xe3db('0x1f')&&typeof _0xd9e182[_0xe3db('0x20')]==='undefined';var _0x489b5d=_0x4e0a7b[_0xe3db('0x21')];var _0x4c7b7e=_0x301903?0x0:_0xd9e182[_0xe3db('0x1e')];var _0x43f115=_0x301903?_0x4e0a7b[_0xe3db('0x21')]:_0xd9e182[_0xe3db('0x1e')]+_0xd9e182['limit'];var _0x4ae9c8;if(_0x43f115>=_0x489b5d){_0x43f115=_0x489b5d;_0x4ae9c8=0xc8;}else{_0x4ae9c8=0xce;}_0x2ed3db['status'](_0x4ae9c8);return _0x2ed3db[_0xe3db('0x22')](_0xe3db('0x23'),_0x4c7b7e+'-'+_0x43f115+'/'+_0x489b5d)[_0xe3db('0x1d')](_0x4e0a7b);}return null;};}function patchUpdates(_0x329452){return function(_0x35cd1e){try{jsonpatch[_0xe3db('0x24')](_0x35cd1e,_0x329452,!![]);}catch(_0x74fff8){return BPromise['reject'](_0x74fff8);}return _0x35cd1e['save']();};}function saveUpdates(_0x2c4969,_0x21ff67){return function(_0x581e10){if(_0x581e10){return _0x581e10['update'](_0x2c4969)['then'](function(_0x4e5fb8){return _0x4e5fb8;});}return null;};}function removeEntity(_0xb99584,_0xb88286){return function(_0x36af21){if(_0x36af21){return _0x36af21[_0xe3db('0x25')]()[_0xe3db('0x26')](function(){_0xb99584[_0xe3db('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4913ce,_0x3d4be9){return function(_0x1f0f38){if(!_0x1f0f38){_0x4913ce[_0xe3db('0x1b')](0x194);}return _0x1f0f38;};}function handleError(_0x22804a,_0x1b848c){_0x1b848c=_0x1b848c||0x1f4;return function(_0x32d6f1){logger[_0xe3db('0x27')](_0x32d6f1['stack']);if(_0x32d6f1[_0xe3db('0x28')]){delete _0x32d6f1[_0xe3db('0x28')];}_0x22804a[_0xe3db('0x1c')](_0x1b848c)['send'](_0x32d6f1);};}exports[_0xe3db('0x29')]=function(_0x154764,_0x2594a1){var _0x3616be={},_0x4fb884={},_0x13b032={'count':0x0,'rows':[]};var _0x4cca2b=_[_0xe3db('0x2a')](db[_0xe3db('0x2b')][_0xe3db('0x2c')],function(_0x1e6ec9){return{'name':_0x1e6ec9[_0xe3db('0x2d')],'type':_0x1e6ec9[_0xe3db('0x2e')][_0xe3db('0x2f')]};});_0x4fb884[_0xe3db('0x30')]=_['map'](_0x4cca2b,_0xe3db('0x28'));_0x4fb884[_0xe3db('0x31')]=_[_0xe3db('0x32')](_0x154764['query']);_0x4fb884['filters']=_[_0xe3db('0x33')](_0x4fb884['model'],_0x4fb884['query']);_0x3616be[_0xe3db('0x34')]=_[_0xe3db('0x33')](_0x4fb884[_0xe3db('0x30')],qs['fields'](_0x154764[_0xe3db('0x31')][_0xe3db('0x35')]));_0x3616be[_0xe3db('0x34')]=_0x3616be[_0xe3db('0x34')][_0xe3db('0x36')]?_0x3616be['attributes']:_0x4fb884['model'];if(!_0x154764['query']['hasOwnProperty'](_0xe3db('0x37'))){_0x3616be['limit']=qs['limit'](_0x154764['query'][_0xe3db('0x20')]);_0x3616be[_0xe3db('0x1e')]=qs['offset'](_0x154764[_0xe3db('0x31')][_0xe3db('0x1e')]);}_0x3616be[_0xe3db('0x38')]=qs[_0xe3db('0x39')](_0x154764['query'][_0xe3db('0x39')]);_0x3616be[_0xe3db('0x3a')]=qs[_0xe3db('0x3b')](_['pick'](_0x154764[_0xe3db('0x31')],_0x4fb884[_0xe3db('0x3b')]),_0x4cca2b);if(_0x154764[_0xe3db('0x31')][_0xe3db('0x3c')]){_0x3616be[_0xe3db('0x3a')]=_['merge'](_0x3616be['where'],{'$or':_[_0xe3db('0x2a')](_0x4cca2b,function(_0x316ef1){if(_0x316ef1['type']!==_0xe3db('0x3d')){var _0x5b0226={};_0x5b0226[_0x316ef1['name']]={'$like':'%'+_0x154764[_0xe3db('0x31')][_0xe3db('0x3c')]+'%'};return _0x5b0226;}})});}_0x3616be=_['merge']({},_0x3616be,_0x154764[_0xe3db('0x3e')]);var _0x5b0555={'where':_0x3616be[_0xe3db('0x3a')]};return db[_0xe3db('0x2b')]['count'](_0x5b0555)[_0xe3db('0x26')](function(_0x12c3e2){_0x13b032[_0xe3db('0x21')]=_0x12c3e2;if(_0x154764['query'][_0xe3db('0x3f')]){_0x3616be[_0xe3db('0x40')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xe3db('0x41')](_0x3616be);})[_0xe3db('0x26')](function(_0x4f9a78){_0x13b032[_0xe3db('0x42')]=_0x4f9a78;return _0x13b032;})[_0xe3db('0x26')](respondWithFilteredResult(_0x2594a1,_0x3616be))['catch'](handleError(_0x2594a1,null));};exports['show']=function(_0x449dbc,_0x20b206){var _0x157e2c={'raw':!![],'where':{'id':_0x449dbc[_0xe3db('0x43')]['id']}},_0x4c6558={};_0x4c6558[_0xe3db('0x30')]=_['keys'](db[_0xe3db('0x2b')][_0xe3db('0x2c')]);_0x4c6558[_0xe3db('0x31')]=_[_0xe3db('0x32')](_0x449dbc[_0xe3db('0x31')]);_0x4c6558['filters']=_[_0xe3db('0x33')](_0x4c6558[_0xe3db('0x30')],_0x4c6558['query']);_0x157e2c[_0xe3db('0x34')]=_['intersection'](_0x4c6558[_0xe3db('0x30')],qs['fields'](_0x449dbc[_0xe3db('0x31')][_0xe3db('0x35')]));_0x157e2c[_0xe3db('0x34')]=_0x157e2c[_0xe3db('0x34')][_0xe3db('0x36')]?_0x157e2c[_0xe3db('0x34')]:_0x4c6558[_0xe3db('0x30')];if(_0x449dbc[_0xe3db('0x31')][_0xe3db('0x3f')]){_0x157e2c[_0xe3db('0x40')]=[{'all':!![]}];}_0x157e2c=_[_0xe3db('0x44')]({},_0x157e2c,_0x449dbc['options']);return db[_0xe3db('0x2b')]['find'](_0x157e2c)[_0xe3db('0x26')](handleEntityNotFound(_0x20b206,null))[_0xe3db('0x26')](respondWithResult(_0x20b206,null))[_0xe3db('0x45')](handleError(_0x20b206,null));};exports[_0xe3db('0x46')]=function(_0x158fcf,_0xeabd5d){return db[_0xe3db('0x2b')][_0xe3db('0x46')](_0x158fcf[_0xe3db('0x47')],{})['then'](respondWithResult(_0xeabd5d,0xc9))['catch'](handleError(_0xeabd5d,null));};exports[_0xe3db('0x48')]=function(_0x25df99,_0x2e2401){if(_0x25df99[_0xe3db('0x47')]['id']){delete _0x25df99[_0xe3db('0x47')]['id'];}return db[_0xe3db('0x2b')]['find']({'where':{'id':_0x25df99[_0xe3db('0x43')]['id']}})[_0xe3db('0x26')](handleEntityNotFound(_0x2e2401,null))[_0xe3db('0x26')](saveUpdates(_0x25df99[_0xe3db('0x47')],null))[_0xe3db('0x26')](respondWithResult(_0x2e2401,null))[_0xe3db('0x45')](handleError(_0x2e2401,null));};exports['destroy']=function(_0x45c93c,_0x3d41e6){return db['ChatInternalMessage']['find']({'where':{'id':_0x45c93c['params']['id']}})[_0xe3db('0x26')](handleEntityNotFound(_0x3d41e6,null))['then'](removeEntity(_0x3d41e6,null))[_0xe3db('0x45')](handleError(_0x3d41e6,null));};exports['describe']=function(_0x535c44,_0x216f1f){return db[_0xe3db('0x2b')][_0xe3db('0x49')]()[_0xe3db('0x26')](respondWithResult(_0x216f1f,null))['catch'](handleError(_0x216f1f,null));};function wrapUser(_0x574f24){return function(_0x1a07e4){var _0x4f28ff=_0x574f24['get']({'plain':!![]});_0x4f28ff[_0xe3db('0x4a')]=[];if(_0x1a07e4){_0x4f28ff[_0xe3db('0x4b')]=_0x1a07e4['createdAt'];_0x4f28ff[_0xe3db('0x4c')]=_0x1a07e4;}else{_0x4f28ff['lastMessageAt']=moment(0x0)[_0xe3db('0x4d')](_0xe3db('0x4e'));_0x4f28ff[_0xe3db('0x4c')]={};}return _0x4f28ff;};}exports[_0xe3db('0x4f')]=function(_0x1a8a79,_0x24a53b,_0x49db42){var _0x1b8b01=[];return db[_0xe3db('0x50')]['findAll']({'where':{'role':[_0xe3db('0x51'),_0xe3db('0x52'),'user']},'attributes':['id','fullname','name',_0xe3db('0x53'),_0xe3db('0x54'),_0xe3db('0x55'),_0xe3db('0x56'),_0xe3db('0x57'),'allowmessenger',_0xe3db('0x58')],'order':qs['sort'](_0xe3db('0x59')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0xe3db('0x28'),_0xe3db('0x2e')],'through':{'attributes':[]}}]})['then'](function(_0x4d3aeb){if(_0x4d3aeb){var _0x242fb3=_0x1a8a79[_0xe3db('0x5a')][_0xe3db('0x5b')]({'plain':!![]});if(!_0x242fb3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x242fb3[_0xe3db('0x53')]===_0xe3db('0x5a')){return db[_0xe3db('0x5c')][_0xe3db('0x5d')]({'where':{'name':_0xe3db('0x5e'),'userProfileId':_0x242fb3[_0xe3db('0x5f')]},'raw':!![]})['then'](function(_0x449db6){if(_0x449db6){if(_0x449db6[_0xe3db('0x60')]===0x0){return db[_0xe3db('0x61')][_0xe3db('0x41')]({'where':{'sectionId':_0x449db6['id']},'raw':!![]})['then'](function(_0x27edb0){var _0x479006=[];if(_[_0xe3db('0x62')](_0x27edb0)){_0x479006=_[_0xe3db('0x3c')](_0x4d3aeb,function(_0x2a3596){if(_0x2a3596['role']!==_0xe3db('0x51')){return _0x2a3596;}});return _0x479006;}else{for(var _0x4755bd=0x0;_0x4755bd<_0x4d3aeb['length'];_0x4755bd++){var _0x318823=_0x4d3aeb[_0x4755bd];if(_0x318823['role']===_0xe3db('0x51')){var _0x2592e8=_[_0xe3db('0x5d')](_0x27edb0,function(_0x45f4c8){return _0x45f4c8[_0xe3db('0x63')]===_0x318823['id'];});if(_0x2592e8)_0x479006[_0xe3db('0x64')](_0x318823);}else{_0x479006[_0xe3db('0x64')](_0x318823);}}return _0x479006;}});}else{return _0x4d3aeb;}}else{var _0x4140cd=_[_0xe3db('0x3c')](_0x4d3aeb,function(_0x1b9222){if(_0x1b9222['role']!==_0xe3db('0x51')){return _0x1b9222;}});return _0x4140cd;}});}else{return _0x4d3aeb;}}})[_0xe3db('0x26')](function(_0xfcb9a4){var _0x2f2e78=[];if(_0xfcb9a4){_0x1b8b01=_0xfcb9a4;for(var _0x755a24=0x0;_0x755a24<_0xfcb9a4[_0xe3db('0x36')];_0x755a24+=0x1){_0x1b8b01[_0x755a24][_0xe3db('0x4a')]=[];_0x2f2e78[_0xe3db('0x64')](db[_0xe3db('0x2b')][_0xe3db('0x5d')]({'where':{'FromId':[_0x1a8a79[_0xe3db('0x5a')]['id'],_0xfcb9a4[_0x755a24]['id']],'ToId':[_0x1a8a79[_0xe3db('0x5a')]['id'],_0xfcb9a4[_0x755a24]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xe3db('0x65'),'ToId',_0xe3db('0x66'),_0xe3db('0x47')],'order':qs['sort'](_0xe3db('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0xfcb9a4[_0x755a24])));}return BPromise[_0xe3db('0x68')](_0x2f2e78);}return[];})[_0xe3db('0x26')](function(_0x12be72){return{'rows':_0x12be72,'count':_0x12be72[_0xe3db('0x36')]};})[_0xe3db('0x26')](respondWithResult(_0x24a53b,null))['catch'](handleError(_0x24a53b,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index d3e994c..237336e 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 _0x076b=['exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','hook'];(function(_0x5902a0,_0x5bc8f6){var _0x3d3022=function(_0x4adcd0){while(--_0x4adcd0){_0x5902a0['push'](_0x5902a0['shift']());}};_0x3d3022(++_0x5bc8f6);}(_0x076b,0x1c1));var _0xb076=function(_0x5e207d,_0xe1b62a){_0x5e207d=_0x5e207d-0x0;var _0x263d1a=_0x076b[_0x5e207d];return _0x263d1a;};'use strict';var EventEmitter=require(_0xb076('0x0'));var ChatInternalMessage=require(_0xb076('0x1'))['db'][_0xb076('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb076('0x3')](0x0);var events={'afterCreate':_0xb076('0x4'),'afterUpdate':_0xb076('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5da5dd){return function(_0x1817f6,_0x3168a5,_0x3d872a){ChatInternalMessageEvents['emit'](_0x5da5dd+':'+_0x1817f6['id'],_0x1817f6);ChatInternalMessageEvents['emit'](_0x5da5dd,_0x1817f6);_0x3d872a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xb076('0x6')](e,emitEvent(event));}}module[_0xb076('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xeddc=['hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x336ca2,_0x1a813a){var _0xda59a6=function(_0x47caa6){while(--_0x47caa6){_0x336ca2['push'](_0x336ca2['shift']());}};_0xda59a6(++_0x1a813a);}(_0xeddc,0xfc));var _0xcedd=function(_0x34d46f,_0x3e5397){_0x34d46f=_0x34d46f-0x0;var _0x7eeb32=_0xeddc[_0x34d46f];return _0x7eeb32;};'use strict';var EventEmitter=require(_0xcedd('0x0'));var ChatInternalMessage=require(_0xcedd('0x1'))['db'][_0xcedd('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xcedd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcedd('0x4'),'afterDestroy':_0xcedd('0x5')};function emitEvent(_0x5dd882){return function(_0x26f983,_0x3862ab,_0x2d17f6){ChatInternalMessageEvents[_0xcedd('0x6')](_0x5dd882+':'+_0x26f983['id'],_0x26f983);ChatInternalMessageEvents[_0xcedd('0x6')](_0x5dd882,_0x26f983);_0x2d17f6(null);};}for(var e in events){if(events[_0xcedd('0x7')](e)){var event=events[e];ChatInternalMessage[_0xcedd('0x8')](e,emitEvent(event));}}module[_0xcedd('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 216fe19..04e6da8 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 _0x0984=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash'];(function(_0x6a91d0,_0x208f52){var _0x1abb82=function(_0x3bfb53){while(--_0x3bfb53){_0x6a91d0['push'](_0x6a91d0['shift']());}};_0x1abb82(++_0x208f52);}(_0x0984,0x6d));var _0x4098=function(_0xa22606,_0x497098){_0xa22606=_0xa22606-0x0;var _0x5252d2=_0x0984[_0xa22606];return _0x5252d2;};'use strict';var _=require(_0x4098('0x0'));var util=require(_0x4098('0x1'));var logger=require(_0x4098('0x2'))(_0x4098('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4098('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4098('0x5'));var config=require(_0x4098('0x6'));var attributes=require(_0x4098('0x7'));module['exports']=function(_0x58814f,_0x47aa57){return _0x58814f['define'](_0x4098('0x8'),attributes,{'tableName':_0x4098('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4098('0xa')});};
\ No newline at end of file
+var _0x535a=['util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4'];(function(_0x23b3d1,_0x1ee128){var _0xd2c70=function(_0x329cf9){while(--_0x329cf9){_0x23b3d1['push'](_0x23b3d1['shift']());}};_0xd2c70(++_0x1ee128);}(_0x535a,0x6c));var _0xa535=function(_0x4f4bcc,_0x5e9485){_0x4f4bcc=_0x4f4bcc-0x0;var _0x2ce62c=_0x535a[_0x4f4bcc];return _0x2ce62c;};'use strict';var _=require('lodash');var util=require(_0xa535('0x0'));var logger=require(_0xa535('0x1'))('api');var moment=require(_0xa535('0x2'));var BPromise=require('bluebird');var rp=require(_0xa535('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa535('0x4'));var config=require(_0xa535('0x5'));var attributes=require(_0xa535('0x6'));module[_0xa535('0x7')]=function(_0x2dc28b,_0x2e009c){return _0x2dc28b[_0xa535('0x8')](_0xa535('0x9'),attributes,{'tableName':_0xa535('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa535('0xb'),'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 7113374..a337160 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 _0xf8b5=['info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','register','request','then'];(function(_0x4441b1,_0x17bf98){var _0x3d510f=function(_0x2eed93){while(--_0x2eed93){_0x4441b1['push'](_0x4441b1['shift']());}};_0x3d510f(++_0x17bf98);}(_0xf8b5,0x1c4));var _0x5f8b=function(_0xf970f0,_0x3360b6){_0xf970f0=_0xf970f0-0x0;var _0xd1f8aa=_0xf8b5[_0xf970f0];return _0xd1f8aa;};'use strict';var _=require(_0x5f8b('0x0'));var util=require(_0x5f8b('0x1'));var moment=require('moment');var BPromise=require(_0x5f8b('0x2'));var rs=require(_0x5f8b('0x3'));var fs=require('fs');var Redis=require(_0x5f8b('0x4'));var db=require(_0x5f8b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f8b('0x6'))(_0x5f8b('0x7'));var config=require('../../config/environment');var jayson=require(_0x5f8b('0x8'));var client=jayson[_0x5f8b('0x9')]['http']({'port':0x232a});config[_0x5f8b('0xa')]=_['defaults'](config[_0x5f8b('0xa')],{'host':_0x5f8b('0xb'),'port':0x18eb});var socket=require(_0x5f8b('0xc'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x5f8b('0xd')](socket);function respondWithRpcPromise(_0x2460bf,_0x353d6e,_0x2aecbc){return new BPromise(function(_0x4e67ba,_0x50a623){return client[_0x5f8b('0xe')](_0x2460bf,_0x2aecbc)[_0x5f8b('0xf')](function(_0x558812){logger[_0x5f8b('0x10')](_0x5f8b('0x11'),_0x353d6e,'request\x20sent');logger['debug'](_0x5f8b('0x12'),_0x353d6e,_0x5f8b('0x13'),JSON[_0x5f8b('0x14')](_0x558812));if(_0x558812[_0x5f8b('0x15')]){if(_0x558812['error'][_0x5f8b('0x16')]===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x353d6e,_0x558812[_0x5f8b('0x15')][_0x5f8b('0x17')]);return _0x50a623(_0x558812[_0x5f8b('0x15')][_0x5f8b('0x17')]);}logger[_0x5f8b('0x15')](_0x5f8b('0x11'),_0x353d6e,_0x558812['error'][_0x5f8b('0x17')]);return _0x4e67ba(_0x558812[_0x5f8b('0x15')][_0x5f8b('0x17')]);}else{logger['info'](_0x5f8b('0x11'),_0x353d6e,_0x5f8b('0x13'));_0x4e67ba(_0x558812[_0x5f8b('0x18')][_0x5f8b('0x17')]);}})[_0x5f8b('0x19')](function(_0x11b58a){logger[_0x5f8b('0x15')](_0x5f8b('0x11'),_0x353d6e,_0x11b58a);_0x50a623(_0x11b58a);});});}
\ No newline at end of file
+var _0x1e4c=['error','code','message','lodash','util','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','defaults','localhost','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3e7c60,_0x506a65){var _0x179e80=function(_0x51d655){while(--_0x51d655){_0x3e7c60['push'](_0x3e7c60['shift']());}};_0x179e80(++_0x506a65);}(_0x1e4c,0x1bb));var _0xc1e4=function(_0x1f5717,_0x3f9b8b){_0x1f5717=_0x1f5717-0x0;var _0x39162b=_0x1e4c[_0x1f5717];return _0x39162b;};'use strict';var _=require(_0xc1e4('0x0'));var util=require(_0xc1e4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc1e4('0x2'));var fs=require('fs');var Redis=require(_0xc1e4('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc1e4('0x4'))(_0xc1e4('0x5'));var config=require('../../config/environment');var jayson=require(_0xc1e4('0x6'));var client=jayson['client'][_0xc1e4('0x7')]({'port':0x232a});config['redis']=_[_0xc1e4('0x8')](config['redis'],{'host':_0xc1e4('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc1e4('0xa'))[_0xc1e4('0xb')](socket);function respondWithRpcPromise(_0x5545f9,_0x5f0bfc,_0x10f52c){return new BPromise(function(_0x2f331f,_0x3142ab){return client['request'](_0x5545f9,_0x10f52c)[_0xc1e4('0xc')](function(_0x1fd73d){logger[_0xc1e4('0xd')](_0xc1e4('0xe'),_0x5f0bfc,_0xc1e4('0xf'));logger[_0xc1e4('0x10')](_0xc1e4('0x11'),_0x5f0bfc,_0xc1e4('0xf'),JSON[_0xc1e4('0x12')](_0x1fd73d));if(_0x1fd73d[_0xc1e4('0x13')]){if(_0x1fd73d[_0xc1e4('0x13')][_0xc1e4('0x14')]===0x1f4){logger[_0xc1e4('0x13')](_0xc1e4('0xe'),_0x5f0bfc,_0x1fd73d[_0xc1e4('0x13')][_0xc1e4('0x15')]);return _0x3142ab(_0x1fd73d[_0xc1e4('0x13')]['message']);}logger['error'](_0xc1e4('0xe'),_0x5f0bfc,_0x1fd73d[_0xc1e4('0x13')][_0xc1e4('0x15')]);return _0x2f331f(_0x1fd73d[_0xc1e4('0x13')][_0xc1e4('0x15')]);}else{logger[_0xc1e4('0xd')]('ChatInternalMessage,\x20%s,\x20%s',_0x5f0bfc,_0xc1e4('0xf'));_0x2f331f(_0x1fd73d['result']['message']);}})['catch'](function(_0x1fa1b5){logger[_0xc1e4('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x5f0bfc,_0x1fa1b5);_0x3142ab(_0x1fa1b5);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 0dda5b0..dcf7c31 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 _0x9707=['./chatInternalMessage.events','save','update','emit','removeListener','length','chatInternalMessage:'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x9707,0xbd));var _0x7970=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9707[_0x122ef9];return _0x42fba0;};'use strict';var ChatInternalMessageEvents=require(_0x7970('0x0'));var events=[_0x7970('0x1'),'remove',_0x7970('0x2')];function createListener(_0x31b202,_0x1a1fd1){return function(_0x45953d){_0x1a1fd1[_0x7970('0x3')](_0x31b202,_0x45953d);};}function removeListener(_0x22e828,_0x357285){return function(){ChatInternalMessageEvents[_0x7970('0x4')](_0x22e828,_0x357285);};}exports['register']=function(_0xa33d8e){for(var _0x12c4d9=0x0,_0x2c6b6d=events[_0x7970('0x5')];_0x12c4d9<_0x2c6b6d;_0x12c4d9++){var _0x520375=events[_0x12c4d9];var _0x19e8da=createListener(_0x7970('0x6')+_0x520375,_0xa33d8e);ChatInternalMessageEvents['on'](_0x520375,_0x19e8da);}};
\ No newline at end of file
+var _0xb149=['save','remove','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb149,0x93));var _0x9b14=function(_0x130209,_0x2cc129){_0x130209=_0x130209-0x0;var _0x155fb7=_0xb149[_0x130209];return _0x155fb7;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x9b14('0x0'),_0x9b14('0x1'),'update'];function createListener(_0xd030e1,_0x33144d){return function(_0x8509ad){_0x33144d[_0x9b14('0x2')](_0xd030e1,_0x8509ad);};}function removeListener(_0x5bf451,_0x37e138){return function(){ChatInternalMessageEvents[_0x9b14('0x3')](_0x5bf451,_0x37e138);};}exports[_0x9b14('0x4')]=function(_0x3dd7c7){for(var _0x5b8c35=0x0,_0xcd8d7c=events[_0x9b14('0x5')];_0x5b8c35<_0xcd8d7c;_0x5b8c35++){var _0x504768=events[_0x5b8c35];var _0x58b05a=createListener(_0x9b14('0x6')+_0x504768,_0x3dd7c7);ChatInternalMessageEvents['on'](_0x504768,_0x58b05a);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 5654453..22c4366 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 _0xc0c2=['create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','getUsers','/:id'];(function(_0x2065f7,_0x2f3111){var _0xdbb6fe=function(_0x53e4a9){while(--_0x53e4a9){_0x2065f7['push'](_0x2065f7['shift']());}};_0xdbb6fe(++_0x2f3111);}(_0xc0c2,0x74));var _0x2c0c=function(_0x2e3ebb,_0x5afc59){_0x2e3ebb=_0x2e3ebb-0x0;var _0x8f027f=_0xc0c2[_0x2e3ebb];return _0x8f027f;};'use strict';var multer=require('multer');var util=require(_0x2c0c('0x0'));var path=require(_0x2c0c('0x1'));var timeout=require(_0x2c0c('0x2'));var express=require(_0x2c0c('0x3'));var router=express[_0x2c0c('0x4')]();var fs_extra=require(_0x2c0c('0x5'));var auth=require(_0x2c0c('0x6'));var interaction=require(_0x2c0c('0x7'));var config=require(_0x2c0c('0x8'));var controller=require(_0x2c0c('0x9'));router[_0x2c0c('0xa')]('/',auth[_0x2c0c('0xb')](),controller['index']);router[_0x2c0c('0xa')](_0x2c0c('0xc'),auth[_0x2c0c('0xb')](),controller[_0x2c0c('0xd')]);router['get']('/users',auth[_0x2c0c('0xb')](),controller[_0x2c0c('0xe')]);router['get'](_0x2c0c('0xf'),auth[_0x2c0c('0xb')](),controller['show']);router['post']('/',auth[_0x2c0c('0xb')](),controller[_0x2c0c('0x10')]);router[_0x2c0c('0x11')](_0x2c0c('0xf'),controller[_0x2c0c('0x12')]);router[_0x2c0c('0x13')]('/:id',auth[_0x2c0c('0xb')](),controller[_0x2c0c('0x14')]);module[_0x2c0c('0x15')]=router;
\ No newline at end of file
+var _0xd0a1=['./chatInternalMessage.controller','get','isAuthenticated','describe','getUsers','/:id','put','update','destroy','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0xd0a1,0x135));var _0x1d0a=function(_0x16803d,_0x2d35fa){_0x16803d=_0x16803d-0x0;var _0x47bd54=_0xd0a1[_0x16803d];return _0x47bd54;};'use strict';var multer=require(_0x1d0a('0x0'));var util=require('util');var path=require(_0x1d0a('0x1'));var timeout=require('connect-timeout');var express=require(_0x1d0a('0x2'));var router=express[_0x1d0a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1d0a('0x4'));var interaction=require(_0x1d0a('0x5'));var config=require('../../config/environment');var controller=require(_0x1d0a('0x6'));router[_0x1d0a('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1d0a('0x7')]('/describe',auth[_0x1d0a('0x8')](),controller[_0x1d0a('0x9')]);router['get']('/users',auth[_0x1d0a('0x8')](),controller[_0x1d0a('0xa')]);router[_0x1d0a('0x7')](_0x1d0a('0xb'),auth[_0x1d0a('0x8')](),controller['show']);router['post']('/',auth[_0x1d0a('0x8')](),controller['create']);router[_0x1d0a('0xc')](_0x1d0a('0xb'),controller[_0x1d0a('0xd')]);router['delete'](_0x1d0a('0xb'),auth[_0x1d0a('0x8')](),controller[_0x1d0a('0xe')]);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 b6e879e..6434d43 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 _0xdd6e=['medium','BOOLEAN','ENUM','out','sequelize','exports','TEXT'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0xdd6e,0xa5));var _0xedd6=function(_0x85dc6e,_0x4c0f9b){_0x85dc6e=_0x85dc6e-0x0;var _0x160547=_0xdd6e[_0x85dc6e];return _0x160547;};'use strict';var Sequelize=require(_0xedd6('0x0'));module[_0xedd6('0x1')]={'body':{'type':Sequelize[_0xedd6('0x2')](_0xedd6('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xedd6('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xedd6('0x5')]('in',_0xedd6('0x6')),'defaultValue':_0xedd6('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x5eef=['TEXT','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5eef,0x9c));var _0xf5ee=function(_0x308849,_0x25b2c9){_0x308849=_0x308849-0x0;var _0x3f3cad=_0x5eef[_0x308849];return _0x3f3cad;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xf5ee('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf5ee('0x1')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xf5ee('0x2')]('in',_0xf5ee('0x3')),'defaultValue':_0xf5ee('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf5ee('0x4')]},'providerName':{'type':Sequelize[_0xf5ee('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 6076999..8992996 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 _0x009e=['to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','send','index','map','ChatMessage','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','create','body','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','contact','User','email','manual','interface','SIP/%s','channel','event','accept','acceptmessage','parse','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','internal','motionChannel','EventManager','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','crypto'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x009e,0x100));var _0xe009=function(_0x374c1c,_0x522606){_0x374c1c=_0x374c1c-0x0;var _0x1c1c33=_0x009e[_0x374c1c];return _0x1c1c33;};'use strict';var emlformat=require(_0xe009('0x0'));var rimraf=require(_0xe009('0x1'));var zipdir=require(_0xe009('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe009('0x3'));var moment=require(_0xe009('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe009('0x5'));var util=require(_0xe009('0x6'));var path=require('path');var sox=require(_0xe009('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe009('0x8'));var _=require(_0xe009('0x9'));var squel=require(_0xe009('0xa'));var crypto=require(_0xe009('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe009('0xc'));var querystring=require('querystring');var Papa=require(_0xe009('0xd'));var Redis=require(_0xe009('0xe'));var authService=require(_0xe009('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe009('0x10'));var hardwareService=require(_0xe009('0x11'));var logger=require(_0xe009('0x12'))('api');var utils=require(_0xe009('0x13'));var config=require(_0xe009('0x14'));var licenseUtil=require(_0xe009('0x15'));var db=require(_0xe009('0x16'))['db'];config[_0xe009('0x17')]=_[_0xe009('0x18')](config[_0xe009('0x17')],{'host':_0xe009('0x19'),'port':0x18eb});var socket=require(_0xe009('0x1a'))(new Redis(config[_0xe009('0x17')]));require('./chatMessage.socket')[_0xe009('0x1b')](socket);var jayson=require(_0xe009('0x1c'));var client=jayson[_0xe009('0x1d')][_0xe009('0x1e')]({'port':0x232c});var client9002=jayson[_0xe009('0x1d')][_0xe009('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xc196a1,_0x376b50,_0x2d6eef,_0x1bb718){return new BPromise(function(_0x5608e2,_0x5c6e16){var _0x1be21f=_0x1bb718||client;return _0x1be21f[_0xe009('0x1f')](_0xc196a1,_0x2d6eef)[_0xe009('0x20')](function(_0x17a24d){logger[_0xe009('0x21')]('ChatMessage,\x20%s,\x20%s',_0x376b50,_0xe009('0x22'));logger[_0xe009('0x23')](_0xe009('0x24'),_0x376b50,_0xe009('0x22'),JSON[_0xe009('0x25')](_0x17a24d));if(_0x17a24d['error']){if(_0x17a24d[_0xe009('0x26')][_0xe009('0x27')]===0x1f4){logger['error'](_0xe009('0x28'),_0x376b50,_0x17a24d[_0xe009('0x26')][_0xe009('0x29')]);return _0x5c6e16(_0x17a24d[_0xe009('0x26')][_0xe009('0x29')]);}logger[_0xe009('0x26')](_0xe009('0x28'),_0x376b50,_0x17a24d[_0xe009('0x26')][_0xe009('0x29')]);return _0x5608e2(_0x17a24d[_0xe009('0x26')][_0xe009('0x29')]);}else{logger[_0xe009('0x21')](_0xe009('0x28'),_0x376b50,_0xe009('0x22'));_0x5608e2(_0x17a24d[_0xe009('0x2a')][_0xe009('0x29')]);}})[_0xe009('0x2b')](function(_0x20cb17){logger[_0xe009('0x26')]('ChatMessage,\x20%s,\x20%s',_0x376b50,_0x20cb17);_0x5c6e16(_0x20cb17);});});}function respondWithStatusCode(_0x144ba6,_0x8d7c8a){_0x8d7c8a=_0x8d7c8a||0xcc;return function(_0x27645f){if(_0x27645f){return _0x144ba6[_0xe009('0x2c')](_0x8d7c8a);}return _0x144ba6[_0xe009('0x2d')](_0x8d7c8a)[_0xe009('0x2e')]();};}function respondWithResult(_0x20a0b3,_0x1b5057){_0x1b5057=_0x1b5057||0xc8;return function(_0x4aff80){if(_0x4aff80){return _0x20a0b3[_0xe009('0x2d')](_0x1b5057)[_0xe009('0x2f')](_0x4aff80);}};}function respondWithFilteredResult(_0x29af6d,_0x9e7158){return function(_0x226102){if(_0x226102){var _0x64f245=typeof _0x9e7158[_0xe009('0x30')]==='undefined'&&typeof _0x9e7158[_0xe009('0x31')]==='undefined';var _0x310c83=_0x226102[_0xe009('0x32')];var _0x36a4d2=_0x64f245?0x0:_0x9e7158[_0xe009('0x30')];var _0x47a759=_0x64f245?_0x226102[_0xe009('0x32')]:_0x9e7158['offset']+_0x9e7158[_0xe009('0x31')];var _0xa1619b;if(_0x47a759>=_0x310c83){_0x47a759=_0x310c83;_0xa1619b=0xc8;}else{_0xa1619b=0xce;}_0x29af6d['status'](_0xa1619b);return _0x29af6d[_0xe009('0x33')](_0xe009('0x34'),_0x36a4d2+'-'+_0x47a759+'/'+_0x310c83)[_0xe009('0x2f')](_0x226102);}return null;};}function patchUpdates(_0x107bc6){return function(_0x30860c){try{jsonpatch[_0xe009('0x35')](_0x30860c,_0x107bc6,!![]);}catch(_0x44cdd6){return BPromise[_0xe009('0x36')](_0x44cdd6);}return _0x30860c[_0xe009('0x37')]();};}function saveUpdates(_0xc1873e,_0x43265d){return function(_0x240912){if(_0x240912){return _0x240912[_0xe009('0x38')](_0xc1873e)[_0xe009('0x20')](function(_0x2a1030){return _0x2a1030;});}return null;};}function removeEntity(_0x2a40d5,_0x2d3af4){return function(_0x57cff8){if(_0x57cff8){return _0x57cff8[_0xe009('0x39')]()[_0xe009('0x20')](function(){_0x2a40d5['status'](0xcc)[_0xe009('0x2e')]();});}};}function handleEntityNotFound(_0x3836e6,_0x213ee9){return function(_0xdcea0e){if(!_0xdcea0e){_0x3836e6[_0xe009('0x2c')](0x194);}return _0xdcea0e;};}function handleError(_0x3bd0ed,_0x95f08c){_0x95f08c=_0x95f08c||0x1f4;return function(_0x49c1d4){logger['error'](_0x49c1d4['stack']);if(_0x49c1d4[_0xe009('0x3a')]){delete _0x49c1d4['name'];}_0x3bd0ed[_0xe009('0x2d')](_0x95f08c)[_0xe009('0x3b')](_0x49c1d4);};}exports[_0xe009('0x3c')]=function(_0x48d2af,_0x83152){var _0xa637a2={},_0x5d9ddb={},_0x513008={'count':0x0,'rows':[]};var _0x3a220b=_[_0xe009('0x3d')](db[_0xe009('0x3e')]['rawAttributes'],function(_0x108453){return{'name':_0x108453['fieldName'],'type':_0x108453[_0xe009('0x3f')][_0xe009('0x40')]};});_0x5d9ddb[_0xe009('0x41')]=_['map'](_0x3a220b,_0xe009('0x3a'));_0x5d9ddb['query']=_[_0xe009('0x42')](_0x48d2af['query']);_0x5d9ddb[_0xe009('0x43')]=_['intersection'](_0x5d9ddb[_0xe009('0x41')],_0x5d9ddb[_0xe009('0x44')]);_0xa637a2[_0xe009('0x45')]=_[_0xe009('0x46')](_0x5d9ddb[_0xe009('0x41')],qs[_0xe009('0x47')](_0x48d2af['query']['fields']));_0xa637a2[_0xe009('0x45')]=_0xa637a2[_0xe009('0x45')][_0xe009('0x48')]?_0xa637a2['attributes']:_0x5d9ddb['model'];if(!_0x48d2af['query'][_0xe009('0x49')](_0xe009('0x4a'))){_0xa637a2['limit']=qs[_0xe009('0x31')](_0x48d2af[_0xe009('0x44')]['limit']);_0xa637a2[_0xe009('0x30')]=qs[_0xe009('0x30')](_0x48d2af[_0xe009('0x44')][_0xe009('0x30')]);}_0xa637a2[_0xe009('0x4b')]=qs[_0xe009('0x4c')](_0x48d2af[_0xe009('0x44')]['sort']);_0xa637a2[_0xe009('0x4d')]=qs[_0xe009('0x43')](_[_0xe009('0x4e')](_0x48d2af[_0xe009('0x44')],_0x5d9ddb['filters']),_0x3a220b);if(_0x48d2af['query'][_0xe009('0x4f')]){_0xa637a2['where']=_[_0xe009('0x50')](_0xa637a2[_0xe009('0x4d')],{'$or':_['map'](_0x3a220b,function(_0x3e563d){if(_0x3e563d['type']!==_0xe009('0x51')){var _0x5babb8={};_0x5babb8[_0x3e563d[_0xe009('0x3a')]]={'$like':'%'+_0x48d2af[_0xe009('0x44')]['filter']+'%'};return _0x5babb8;}})});}_0xa637a2=_[_0xe009('0x50')]({},_0xa637a2,_0x48d2af[_0xe009('0x52')]);var _0x35737c={'where':_0xa637a2[_0xe009('0x4d')]};return db['ChatMessage']['count'](_0x35737c)[_0xe009('0x20')](function(_0x578aa3){_0x513008['count']=_0x578aa3;if(_0x48d2af[_0xe009('0x44')]['includeAll']){_0xa637a2[_0xe009('0x53')]=[{'all':!![]}];}return db[_0xe009('0x3e')][_0xe009('0x54')](_0xa637a2);})[_0xe009('0x20')](function(_0x4f153a){_0x513008[_0xe009('0x55')]=_0x4f153a;return _0x513008;})[_0xe009('0x20')](respondWithFilteredResult(_0x83152,_0xa637a2))[_0xe009('0x2b')](handleError(_0x83152,null));};exports[_0xe009('0x56')]=function(_0x25a9ca,_0x409340){var _0xba677d={'raw':!![],'where':{'id':_0x25a9ca[_0xe009('0x57')]['id']}},_0xc3ed02={};_0xc3ed02[_0xe009('0x41')]=_['keys'](db[_0xe009('0x3e')][_0xe009('0x58')]);_0xc3ed02[_0xe009('0x44')]=_['keys'](_0x25a9ca[_0xe009('0x44')]);_0xc3ed02['filters']=_[_0xe009('0x46')](_0xc3ed02[_0xe009('0x41')],_0xc3ed02['query']);_0xba677d[_0xe009('0x45')]=_[_0xe009('0x46')](_0xc3ed02[_0xe009('0x41')],qs[_0xe009('0x47')](_0x25a9ca['query']['fields']));_0xba677d[_0xe009('0x45')]=_0xba677d[_0xe009('0x45')][_0xe009('0x48')]?_0xba677d[_0xe009('0x45')]:_0xc3ed02[_0xe009('0x41')];if(_0x25a9ca[_0xe009('0x44')][_0xe009('0x59')]){_0xba677d['include']=[{'all':!![]}];}_0xba677d=_[_0xe009('0x50')]({},_0xba677d,_0x25a9ca[_0xe009('0x52')]);return db['ChatMessage'][_0xe009('0x5a')](_0xba677d)['then'](handleEntityNotFound(_0x409340,null))['then'](respondWithResult(_0x409340,null))[_0xe009('0x2b')](handleError(_0x409340,null));};exports[_0xe009('0x5b')]=function(_0x4228d5,_0x43555d){return db[_0xe009('0x3e')]['create'](_0x4228d5[_0xe009('0x5c')],{})[_0xe009('0x20')](respondWithResult(_0x43555d,0xc9))['catch'](handleError(_0x43555d,null));};exports[_0xe009('0x38')]=function(_0x396fa3,_0x52f454){if(_0x396fa3['body']['id']){delete _0x396fa3['body']['id'];}return db[_0xe009('0x3e')][_0xe009('0x5a')]({'where':{'id':_0x396fa3[_0xe009('0x57')]['id']}})[_0xe009('0x20')](handleEntityNotFound(_0x52f454,null))['then'](saveUpdates(_0x396fa3['body'],null))[_0xe009('0x20')](respondWithResult(_0x52f454,null))['catch'](handleError(_0x52f454,null));};exports[_0xe009('0x39')]=function(_0x4fe9ed,_0x2ed100){return db[_0xe009('0x3e')][_0xe009('0x5a')]({'where':{'id':_0x4fe9ed['params']['id']}})[_0xe009('0x20')](handleEntityNotFound(_0x2ed100,null))[_0xe009('0x20')](removeEntity(_0x2ed100,null))[_0xe009('0x2b')](handleError(_0x2ed100,null));};exports[_0xe009('0x5d')]=function(_0x2d1531,_0x50c29b){return db[_0xe009('0x3e')][_0xe009('0x5d')]()['then'](respondWithResult(_0x50c29b,null))['catch'](handleError(_0x50c29b,null));};var interaction_log=require('../../config/logger')(_0xe009('0x5e'));exports['accept']=function(_0x1ec3a0,_0x274353,_0x5ae96d){var _0x5eb828={'agent':{},'channel':_0xe009('0x5f')};if(_0x1ec3a0[_0xe009('0x5c')]['id']){delete _0x1ec3a0[_0xe009('0x5c')]['id'];}_0x1ec3a0['body'][_0xe009('0x60')]=!![];_0x1ec3a0[_0xe009('0x5c')][_0xe009('0x61')]=moment()[_0xe009('0x62')](_0xe009('0x63'));_0x1ec3a0[_0xe009('0x5c')][_0xe009('0x64')]=_0x1ec3a0[_0xe009('0x5c')][_0xe009('0x64')]||_0x1ec3a0[_0xe009('0x65')]['id'];_0x5eb828[_0xe009('0x66')]['id']=_0x1ec3a0[_0xe009('0x5c')]['UserId'];return db[_0xe009('0x3e')]['find']({'where':{'id':_0x1ec3a0[_0xe009('0x57')]['id'],'UserId':null}})[_0xe009('0x20')](handleEntityNotFound(_0x274353,null))['then'](saveUpdates(_0x1ec3a0[_0xe009('0x5c')],null))['then'](function(_0x5e5d8a){if(_0x5e5d8a){_0x5eb828[_0xe009('0x29')]=_0x5e5d8a[_0xe009('0x67')]({'plain':!![]});return db[_0xe009('0x68')][_0xe009('0x5a')]({'where':{'id':_0x5e5d8a['ChatInteractionId']}});}return null;})[_0xe009('0x20')](handleEntityNotFound(_0x274353,null))[_0xe009('0x20')](function(_0x268a58){if(_0x268a58){return _0x268a58[_0xe009('0x38')]({'UserId':_0x1ec3a0[_0xe009('0x5c')][_0xe009('0x64')],'read1stAt':_['isNil'](_0x268a58[_0xe009('0x69')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xe009('0x20')](function(_0x2480d1){if(_0x2480d1){_0x5eb828['interaction']=_0x2480d1[_0xe009('0x67')]({'plain':!![]});interaction_log['info'](_0xe009('0x6a'),_0x1ec3a0[_0xe009('0x65')]['id'],_0x1ec3a0[_0xe009('0x65')][_0xe009('0x3a')],_0x1ec3a0[_0xe009('0x65')][_0xe009('0x6b')],_0x5eb828['interaction']['id'],_0x1ec3a0['body']?JSON['stringify'](_0x1ec3a0[_0xe009('0x5c')]):_0xe009('0x6c'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x5eb828);}return null;})[_0xe009('0x20')](function(_0x5008e6){var _0x320a3b=_0xe009('0x6d')+_0x5008e6[_0xe009('0x29')]['ContactId'];return db['sequelize'][_0xe009('0x44')](_0x320a3b,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xe009('0x20')](function(_0x19f8b8){return _0x19f8b8;});})[_0xe009('0x20')](function(_0x5194d9){if(_0x5194d9){_0x5eb828[_0xe009('0x29')][_0xe009('0x6e')]=_0x5194d9[0x0];if(!_0x1ec3a0[_0xe009('0x5c')]['UserId'])return;return db[_0xe009('0x6f')][_0xe009('0x5a')]({'where':{'id':_0x1ec3a0[_0xe009('0x5c')][_0xe009('0x64')],'role':_0xe009('0x66')},'attributes':['id',_0xe009('0x3a'),'fullname',_0xe009('0x70'),'internal'],'raw':!![]});}return null;})[_0xe009('0x20')](function(_0x5b1cfd){if(!_0x5b1cfd)return null;_0x5eb828['message'][_0xe009('0x66')]=_0x5b1cfd;return _0x5eb828;})[_0xe009('0x20')](function(_0x393728){if(_0x393728){if(_0x1ec3a0[_0xe009('0x5c')][_0xe009('0x71')]){_0x5eb828[_0xe009('0x29')][_0xe009('0x72')]=util[_0xe009('0x62')](_0xe009('0x73'),_0x1ec3a0[_0xe009('0x65')][_0xe009('0x3a')]);_0x5eb828[_0xe009('0x29')][_0xe009('0x74')]=_0x5eb828[_0xe009('0x74')];_0x5eb828[_0xe009('0x29')]['motionChannel']=_0x5eb828[_0xe009('0x74')];_0x5eb828[_0xe009('0x29')][_0xe009('0x75')]=_0xe009('0x76');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xe009('0x77'),'message':_[_0xe009('0x50')](_0x5eb828['message'],JSON[_0xe009('0x78')](_0x5eb828['interaction']['formData']))},client9002)['then'](function(){return _0x5eb828;});}return _0x5eb828;}return null;})[_0xe009('0x20')](respondWithResult(_0x274353,null))[_0xe009('0x2b')](handleError(_0x274353,null));};var interaction_log=require(_0xe009('0x12'))(_0xe009('0x5e'));exports[_0xe009('0x36')]=function(_0x485913,_0xbc1f52,_0x3f9980){var _0x1f3806={'agent':{},'channel':_0xe009('0x5f')};if(_0x485913[_0xe009('0x5c')]['id']){delete _0x485913[_0xe009('0x5c')]['id'];}_0x485913['body'][_0xe009('0x64')]=_0x485913['body'][_0xe009('0x64')]||_0x485913[_0xe009('0x65')]['id'];_0x1f3806[_0xe009('0x66')]['id']=_0x485913[_0xe009('0x5c')][_0xe009('0x64')];return db['ChatMessage']['find']({'where':{'id':_0x485913[_0xe009('0x57')]['id'],'UserId':null}})[_0xe009('0x20')](handleEntityNotFound(_0xbc1f52,null))[_0xe009('0x20')](function(_0x54c962){if(_0x54c962){_0x1f3806[_0xe009('0x29')]=_0x54c962['get']({'plain':!![]});return db[_0xe009('0x68')][_0xe009('0x5a')]({'where':{'id':_0x54c962[_0xe009('0x79')]}});}return null;})[_0xe009('0x20')](handleEntityNotFound(_0xbc1f52,null))['then'](function(_0x3b34f3){if(_0x3b34f3){_0x1f3806['interaction']=_0x3b34f3[_0xe009('0x67')]({'plain':!![]});interaction_log[_0xe009('0x21')](_0xe009('0x7a'),_0x485913[_0xe009('0x65')]['id'],_0x485913['user'][_0xe009('0x3a')],_0x485913[_0xe009('0x65')]['role'],_0x1f3806[_0xe009('0x7b')]['id'],_0x485913[_0xe009('0x5c')]?JSON[_0xe009('0x25')](_0x485913[_0xe009('0x5c')]):_0xe009('0x6c'));return respondWithRpcPromise(_0xe009('0x7c'),_0xe009('0x7d'),_0x1f3806);}return null;})[_0xe009('0x20')](function(_0x239596){var _0x73b9b0=_0xe009('0x6d')+_0x239596[_0xe009('0x29')]['ContactId'];return db['sequelize'][_0xe009('0x44')](_0x73b9b0,{'type':db[_0xe009('0x7e')][_0xe009('0x7f')][_0xe009('0x80')],'raw':!![]})['then'](function(_0xb27ecf){return _0xb27ecf;});})[_0xe009('0x20')](function(_0x164c01){if(_0x164c01){_0x1f3806[_0xe009('0x29')]['contact']=_0x164c01[0x0];if(!_0x485913[_0xe009('0x5c')][_0xe009('0x64')])return;return db[_0xe009('0x6f')][_0xe009('0x5a')]({'where':{'id':_0x485913['body'][_0xe009('0x64')],'role':_0xe009('0x66')},'attributes':['id','name',_0xe009('0x81'),_0xe009('0x70'),_0xe009('0x82')],'raw':!![]});}return null;})[_0xe009('0x20')](function(_0x3bbb7a){if(!_0x3bbb7a)return null;_0x1f3806[_0xe009('0x29')][_0xe009('0x66')]=_0x3bbb7a;return _0x1f3806;})['then'](function(_0x31cbfd){if(_0x31cbfd){_0x31cbfd[_0xe009('0x29')][_0xe009('0x72')]=util[_0xe009('0x62')](_0xe009('0x73'),_0x485913[_0xe009('0x65')][_0xe009('0x3a')]);_0x31cbfd[_0xe009('0x29')][_0xe009('0x74')]=_0x1f3806[_0xe009('0x74')];_0x31cbfd[_0xe009('0x29')][_0xe009('0x83')]=_0x1f3806[_0xe009('0x74')];_0x31cbfd[_0xe009('0x29')][_0xe009('0x75')]='reject';respondWithRpcPromise(_0xe009('0x84'),'EventManager',{'event':_0xe009('0x85'),'message':_[_0xe009('0x50')](_0x1f3806[_0xe009('0x29')],JSON[_0xe009('0x78')](_0x1f3806[_0xe009('0x7b')]['formData']))},client9002);return _0x1f3806;}return null;})[_0xe009('0x20')](respondWithResult(_0xbc1f52,null))[_0xe009('0x2b')](handleError(_0xbc1f52,null));};
\ No newline at end of file
+var _0x99c8=['bluebird','util','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','sendStatus','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','key','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','findAll','rows','show','params','length','include','options','create','body','find','destroy','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','formData','RejectMessage','rejectMessage','sequelize','internal','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x99c8,0x18c));var _0x899c=function(_0x3be326,_0x5e0ea4){_0x3be326=_0x3be326-0x0;var _0x39a867=_0x99c8[_0x3be326];return _0x39a867;};'use strict';var emlformat=require(_0x899c('0x0'));var rimraf=require(_0x899c('0x1'));var zipdir=require(_0x899c('0x2'));var jsonpatch=require(_0x899c('0x3'));var rp=require(_0x899c('0x4'));var moment=require(_0x899c('0x5'));var BPromise=require(_0x899c('0x6'));var Mustache=require('mustache');var util=require(_0x899c('0x7'));var path=require('path');var sox=require(_0x899c('0x8'));var csv=require(_0x899c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x899c('0xa'));var squel=require(_0x899c('0xb'));var crypto=require('crypto');var jsforce=require(_0x899c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x899c('0x9'));var querystring=require(_0x899c('0xd'));var Papa=require(_0x899c('0xe'));var Redis=require(_0x899c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x899c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x899c('0x11'));var logger=require(_0x899c('0x12'))(_0x899c('0x13'));var utils=require('../../config/utils');var config=require(_0x899c('0x14'));var licenseUtil=require(_0x899c('0x15'));var db=require(_0x899c('0x16'))['db'];config[_0x899c('0x17')]=_['defaults'](config[_0x899c('0x17')],{'host':_0x899c('0x18'),'port':0x18eb});var socket=require(_0x899c('0x19'))(new Redis(config[_0x899c('0x17')]));require(_0x899c('0x1a'))[_0x899c('0x1b')](socket);var jayson=require(_0x899c('0x1c'));var client=jayson[_0x899c('0x1d')][_0x899c('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c7572,_0x4320fe,_0x572788,_0x274b9b){return new BPromise(function(_0x54f4f2,_0x1d223d){var _0x3c54eb=_0x274b9b||client;return _0x3c54eb[_0x899c('0x1f')](_0x3c7572,_0x572788)[_0x899c('0x20')](function(_0x35a43e){logger[_0x899c('0x21')](_0x899c('0x22'),_0x4320fe,_0x899c('0x23'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4320fe,_0x899c('0x23'),JSON[_0x899c('0x24')](_0x35a43e));if(_0x35a43e[_0x899c('0x25')]){if(_0x35a43e[_0x899c('0x25')][_0x899c('0x26')]===0x1f4){logger[_0x899c('0x25')](_0x899c('0x22'),_0x4320fe,_0x35a43e[_0x899c('0x25')]['message']);return _0x1d223d(_0x35a43e['error'][_0x899c('0x27')]);}logger[_0x899c('0x25')](_0x899c('0x22'),_0x4320fe,_0x35a43e[_0x899c('0x25')]['message']);return _0x54f4f2(_0x35a43e[_0x899c('0x25')][_0x899c('0x27')]);}else{logger[_0x899c('0x21')](_0x899c('0x22'),_0x4320fe,'request\x20sent');_0x54f4f2(_0x35a43e[_0x899c('0x28')][_0x899c('0x27')]);}})[_0x899c('0x29')](function(_0x5e4a6e){logger[_0x899c('0x25')](_0x899c('0x22'),_0x4320fe,_0x5e4a6e);_0x1d223d(_0x5e4a6e);});});}function respondWithStatusCode(_0x54e63e,_0x1b3fa1){_0x1b3fa1=_0x1b3fa1||0xcc;return function(_0x295c39){if(_0x295c39){return _0x54e63e['sendStatus'](_0x1b3fa1);}return _0x54e63e[_0x899c('0x2a')](_0x1b3fa1)[_0x899c('0x2b')]();};}function respondWithResult(_0x5c2b7b,_0x3887c1){_0x3887c1=_0x3887c1||0xc8;return function(_0x220784){if(_0x220784){return _0x5c2b7b[_0x899c('0x2a')](_0x3887c1)[_0x899c('0x2c')](_0x220784);}};}function respondWithFilteredResult(_0x2862c4,_0x3df1cf){return function(_0x4b4e58){if(_0x4b4e58){var _0x4cf036=typeof _0x3df1cf[_0x899c('0x2d')]===_0x899c('0x2e')&&typeof _0x3df1cf[_0x899c('0x2f')]==='undefined';var _0x35e0d5=_0x4b4e58['count'];var _0x17ffde=_0x4cf036?0x0:_0x3df1cf[_0x899c('0x2d')];var _0x3f221f=_0x4cf036?_0x4b4e58[_0x899c('0x30')]:_0x3df1cf[_0x899c('0x2d')]+_0x3df1cf[_0x899c('0x2f')];var _0x28abc4;if(_0x3f221f>=_0x35e0d5){_0x3f221f=_0x35e0d5;_0x28abc4=0xc8;}else{_0x28abc4=0xce;}_0x2862c4[_0x899c('0x2a')](_0x28abc4);return _0x2862c4[_0x899c('0x31')](_0x899c('0x32'),_0x17ffde+'-'+_0x3f221f+'/'+_0x35e0d5)['json'](_0x4b4e58);}return null;};}function patchUpdates(_0x1703b3){return function(_0x1cd62b){try{jsonpatch['apply'](_0x1cd62b,_0x1703b3,!![]);}catch(_0x5b13cd){return BPromise[_0x899c('0x33')](_0x5b13cd);}return _0x1cd62b[_0x899c('0x34')]();};}function saveUpdates(_0x28142b,_0x48bc75){return function(_0x28cdd6){if(_0x28cdd6){return _0x28cdd6[_0x899c('0x35')](_0x28142b)['then'](function(_0x1375aa){return _0x1375aa;});}return null;};}function removeEntity(_0x28122e,_0x56f503){return function(_0x351c39){if(_0x351c39){return _0x351c39['destroy']()['then'](function(){_0x28122e[_0x899c('0x2a')](0xcc)[_0x899c('0x2b')]();});}};}function handleEntityNotFound(_0x2a6cd8,_0x1734f3){return function(_0x4d949c){if(!_0x4d949c){_0x2a6cd8[_0x899c('0x36')](0x194);}return _0x4d949c;};}function handleError(_0x14c63a,_0x5de737){_0x5de737=_0x5de737||0x1f4;return function(_0x6e380a){logger['error'](_0x6e380a[_0x899c('0x37')]);if(_0x6e380a[_0x899c('0x38')]){delete _0x6e380a[_0x899c('0x38')];}_0x14c63a['status'](_0x5de737)[_0x899c('0x39')](_0x6e380a);};}exports[_0x899c('0x3a')]=function(_0x5f2fa4,_0x32c32b){var _0x4cea41={},_0x41bcef={},_0xb95897={'count':0x0,'rows':[]};var _0x2510f6=_[_0x899c('0x3b')](db[_0x899c('0x3c')][_0x899c('0x3d')],function(_0x2e9fd5){return{'name':_0x2e9fd5[_0x899c('0x3e')],'type':_0x2e9fd5['type'][_0x899c('0x3f')]};});_0x41bcef[_0x899c('0x40')]=_[_0x899c('0x3b')](_0x2510f6,_0x899c('0x38'));_0x41bcef['query']=_[_0x899c('0x41')](_0x5f2fa4['query']);_0x41bcef['filters']=_['intersection'](_0x41bcef[_0x899c('0x40')],_0x41bcef[_0x899c('0x42')]);_0x4cea41[_0x899c('0x43')]=_[_0x899c('0x44')](_0x41bcef['model'],qs[_0x899c('0x45')](_0x5f2fa4['query'][_0x899c('0x45')]));_0x4cea41['attributes']=_0x4cea41[_0x899c('0x43')]['length']?_0x4cea41[_0x899c('0x43')]:_0x41bcef[_0x899c('0x40')];if(!_0x5f2fa4[_0x899c('0x42')][_0x899c('0x46')](_0x899c('0x47'))){_0x4cea41[_0x899c('0x2f')]=qs[_0x899c('0x2f')](_0x5f2fa4[_0x899c('0x42')][_0x899c('0x2f')]);_0x4cea41[_0x899c('0x2d')]=qs['offset'](_0x5f2fa4[_0x899c('0x42')][_0x899c('0x2d')]);}_0x4cea41['order']=qs[_0x899c('0x48')](_0x5f2fa4[_0x899c('0x42')][_0x899c('0x48')]);_0x4cea41[_0x899c('0x49')]=qs[_0x899c('0x4a')](_[_0x899c('0x4b')](_0x5f2fa4[_0x899c('0x42')],_0x41bcef[_0x899c('0x4a')]),_0x2510f6);if(_0x5f2fa4[_0x899c('0x42')][_0x899c('0x4c')]){_0x4cea41['where']=_[_0x899c('0x4d')](_0x4cea41[_0x899c('0x49')],{'$or':_[_0x899c('0x3b')](_0x2510f6,function(_0x22a72e){if(_0x22a72e[_0x899c('0x4e')]!==_0x899c('0x4f')){var _0x28b98d={};_0x28b98d[_0x22a72e['name']]={'$like':'%'+_0x5f2fa4[_0x899c('0x42')][_0x899c('0x4c')]+'%'};return _0x28b98d;}})});}_0x4cea41=_[_0x899c('0x4d')]({},_0x4cea41,_0x5f2fa4['options']);var _0x14838a={'where':_0x4cea41[_0x899c('0x49')]};return db[_0x899c('0x3c')]['count'](_0x14838a)[_0x899c('0x20')](function(_0x2e4687){_0xb95897[_0x899c('0x30')]=_0x2e4687;if(_0x5f2fa4[_0x899c('0x42')]['includeAll']){_0x4cea41['include']=[{'all':!![]}];}return db[_0x899c('0x3c')][_0x899c('0x50')](_0x4cea41);})['then'](function(_0x20e9a3){_0xb95897[_0x899c('0x51')]=_0x20e9a3;return _0xb95897;})[_0x899c('0x20')](respondWithFilteredResult(_0x32c32b,_0x4cea41))[_0x899c('0x29')](handleError(_0x32c32b,null));};exports[_0x899c('0x52')]=function(_0x58719c,_0x10f3d1){var _0xf636fc={'raw':!![],'where':{'id':_0x58719c[_0x899c('0x53')]['id']}},_0x450285={};_0x450285['model']=_[_0x899c('0x41')](db[_0x899c('0x3c')][_0x899c('0x3d')]);_0x450285[_0x899c('0x42')]=_[_0x899c('0x41')](_0x58719c[_0x899c('0x42')]);_0x450285['filters']=_['intersection'](_0x450285[_0x899c('0x40')],_0x450285[_0x899c('0x42')]);_0xf636fc[_0x899c('0x43')]=_['intersection'](_0x450285[_0x899c('0x40')],qs['fields'](_0x58719c['query']['fields']));_0xf636fc[_0x899c('0x43')]=_0xf636fc[_0x899c('0x43')][_0x899c('0x54')]?_0xf636fc['attributes']:_0x450285[_0x899c('0x40')];if(_0x58719c['query']['includeAll']){_0xf636fc[_0x899c('0x55')]=[{'all':!![]}];}_0xf636fc=_[_0x899c('0x4d')]({},_0xf636fc,_0x58719c[_0x899c('0x56')]);return db[_0x899c('0x3c')]['find'](_0xf636fc)[_0x899c('0x20')](handleEntityNotFound(_0x10f3d1,null))[_0x899c('0x20')](respondWithResult(_0x10f3d1,null))[_0x899c('0x29')](handleError(_0x10f3d1,null));};exports[_0x899c('0x57')]=function(_0x44fe3d,_0x2f3159){return db[_0x899c('0x3c')]['create'](_0x44fe3d['body'],{})['then'](respondWithResult(_0x2f3159,0xc9))['catch'](handleError(_0x2f3159,null));};exports[_0x899c('0x35')]=function(_0x156ff3,_0x900cfc){if(_0x156ff3['body']['id']){delete _0x156ff3[_0x899c('0x58')]['id'];}return db[_0x899c('0x3c')][_0x899c('0x59')]({'where':{'id':_0x156ff3[_0x899c('0x53')]['id']}})[_0x899c('0x20')](handleEntityNotFound(_0x900cfc,null))[_0x899c('0x20')](saveUpdates(_0x156ff3[_0x899c('0x58')],null))[_0x899c('0x20')](respondWithResult(_0x900cfc,null))[_0x899c('0x29')](handleError(_0x900cfc,null));};exports[_0x899c('0x5a')]=function(_0x38fc35,_0x1090ae){return db[_0x899c('0x3c')]['find']({'where':{'id':_0x38fc35[_0x899c('0x53')]['id']}})[_0x899c('0x20')](handleEntityNotFound(_0x1090ae,null))[_0x899c('0x20')](removeEntity(_0x1090ae,null))[_0x899c('0x29')](handleError(_0x1090ae,null));};exports[_0x899c('0x5b')]=function(_0x3ff94c,_0x3e9cd2){return db['ChatMessage'][_0x899c('0x5b')]()[_0x899c('0x20')](respondWithResult(_0x3e9cd2,null))['catch'](handleError(_0x3e9cd2,null));};var interaction_log=require(_0x899c('0x12'))(_0x899c('0x5c'));exports[_0x899c('0x5d')]=function(_0x106b4d,_0x34b360,_0x4c3fe3){var _0x5b0b23={'agent':{},'channel':_0x899c('0x5e')};if(_0x106b4d[_0x899c('0x58')]['id']){delete _0x106b4d[_0x899c('0x58')]['id'];}_0x106b4d[_0x899c('0x58')][_0x899c('0x5f')]=!![];_0x106b4d[_0x899c('0x58')]['readAt']=moment()[_0x899c('0x60')](_0x899c('0x61'));_0x106b4d[_0x899c('0x58')][_0x899c('0x62')]=_0x106b4d[_0x899c('0x58')][_0x899c('0x62')]||_0x106b4d[_0x899c('0x63')]['id'];_0x5b0b23[_0x899c('0x64')]['id']=_0x106b4d[_0x899c('0x58')][_0x899c('0x62')];return db[_0x899c('0x3c')][_0x899c('0x59')]({'where':{'id':_0x106b4d['params']['id'],'UserId':null}})[_0x899c('0x20')](handleEntityNotFound(_0x34b360,null))[_0x899c('0x20')](saveUpdates(_0x106b4d[_0x899c('0x58')],null))['then'](function(_0x9f913a){if(_0x9f913a){_0x5b0b23[_0x899c('0x27')]=_0x9f913a[_0x899c('0x65')]({'plain':!![]});return db[_0x899c('0x66')][_0x899c('0x59')]({'where':{'id':_0x9f913a[_0x899c('0x67')]}});}return null;})[_0x899c('0x20')](handleEntityNotFound(_0x34b360,null))[_0x899c('0x20')](function(_0x1f6ec9){if(_0x1f6ec9){return _0x1f6ec9[_0x899c('0x35')]({'UserId':_0x106b4d[_0x899c('0x58')][_0x899c('0x62')],'read1stAt':_[_0x899c('0x68')](_0x1f6ec9[_0x899c('0x69')])?moment()[_0x899c('0x60')](_0x899c('0x61')):undefined});}return null;})[_0x899c('0x20')](function(_0x34a72a){if(_0x34a72a){_0x5b0b23[_0x899c('0x6a')]=_0x34a72a['get']({'plain':!![]});interaction_log[_0x899c('0x21')](_0x899c('0x6b'),_0x106b4d[_0x899c('0x63')]['id'],_0x106b4d[_0x899c('0x63')][_0x899c('0x38')],_0x106b4d[_0x899c('0x63')][_0x899c('0x6c')],_0x5b0b23[_0x899c('0x6a')]['id'],_0x106b4d['body']?JSON[_0x899c('0x24')](_0x106b4d[_0x899c('0x58')]):_0x899c('0x6d'));return respondWithRpcPromise(_0x899c('0x6e'),_0x899c('0x6f'),_0x5b0b23);}return null;})['then'](function(_0x2641dd){var _0x4f14db=_0x899c('0x70')+_0x2641dd['message'][_0x899c('0x71')];return db['sequelize']['query'](_0x4f14db,{'type':db[_0x899c('0x72')][_0x899c('0x73')][_0x899c('0x74')],'raw':!![]})[_0x899c('0x20')](function(_0x3b9156){return _0x3b9156;});})['then'](function(_0x3a0fb7){if(_0x3a0fb7){_0x5b0b23['message'][_0x899c('0x75')]=_0x3a0fb7[0x0];if(!_0x106b4d['body'][_0x899c('0x62')])return;return db[_0x899c('0x76')]['find']({'where':{'id':_0x106b4d['body']['UserId'],'role':'agent'},'attributes':['id',_0x899c('0x38'),_0x899c('0x77'),_0x899c('0x78'),'internal'],'raw':!![]});}return null;})['then'](function(_0x24f7e7){if(!_0x24f7e7)return null;_0x5b0b23[_0x899c('0x27')][_0x899c('0x64')]=_0x24f7e7;return _0x5b0b23;})[_0x899c('0x20')](function(_0x4e0b58){if(_0x4e0b58){if(_0x106b4d[_0x899c('0x58')]['manual']){_0x5b0b23['message'][_0x899c('0x79')]=util[_0x899c('0x60')](_0x899c('0x7a'),_0x106b4d[_0x899c('0x63')][_0x899c('0x38')]);_0x5b0b23['message'][_0x899c('0x7b')]=_0x5b0b23[_0x899c('0x7b')];_0x5b0b23[_0x899c('0x27')][_0x899c('0x7c')]=_0x5b0b23[_0x899c('0x7b')];_0x5b0b23['message']['event']=_0x899c('0x5d');return respondWithRpcPromise(_0x899c('0x7d'),_0x899c('0x7d'),{'event':_0x899c('0x7e'),'message':_[_0x899c('0x4d')](_0x5b0b23[_0x899c('0x27')],JSON['parse'](_0x5b0b23[_0x899c('0x6a')][_0x899c('0x7f')]))},client9002)[_0x899c('0x20')](function(){return _0x5b0b23;});}return _0x5b0b23;}return null;})[_0x899c('0x20')](respondWithResult(_0x34b360,null))[_0x899c('0x29')](handleError(_0x34b360,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x899c('0x33')]=function(_0x3910b9,_0x359945,_0x35322a){var _0x5819e9={'agent':{},'channel':_0x899c('0x5e')};if(_0x3910b9['body']['id']){delete _0x3910b9[_0x899c('0x58')]['id'];}_0x3910b9[_0x899c('0x58')][_0x899c('0x62')]=_0x3910b9['body']['UserId']||_0x3910b9[_0x899c('0x63')]['id'];_0x5819e9[_0x899c('0x64')]['id']=_0x3910b9['body'][_0x899c('0x62')];return db['ChatMessage'][_0x899c('0x59')]({'where':{'id':_0x3910b9[_0x899c('0x53')]['id'],'UserId':null}})[_0x899c('0x20')](handleEntityNotFound(_0x359945,null))[_0x899c('0x20')](function(_0x2d915c){if(_0x2d915c){_0x5819e9[_0x899c('0x27')]=_0x2d915c[_0x899c('0x65')]({'plain':!![]});return db[_0x899c('0x66')]['find']({'where':{'id':_0x2d915c['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x359945,null))['then'](function(_0xa546b1){if(_0xa546b1){_0x5819e9[_0x899c('0x6a')]=_0xa546b1['get']({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3910b9[_0x899c('0x63')]['id'],_0x3910b9[_0x899c('0x63')]['name'],_0x3910b9['user']['role'],_0x5819e9[_0x899c('0x6a')]['id'],_0x3910b9[_0x899c('0x58')]?JSON[_0x899c('0x24')](_0x3910b9[_0x899c('0x58')]):_0x899c('0x6d'));return respondWithRpcPromise(_0x899c('0x80'),_0x899c('0x81'),_0x5819e9);}return null;})['then'](function(_0x17a1cc){var _0x20627c=_0x899c('0x70')+_0x17a1cc[_0x899c('0x27')][_0x899c('0x71')];return db[_0x899c('0x82')][_0x899c('0x42')](_0x20627c,{'type':db['Sequelize'][_0x899c('0x73')][_0x899c('0x74')],'raw':!![]})[_0x899c('0x20')](function(_0xafa702){return _0xafa702;});})[_0x899c('0x20')](function(_0x4dcaf3){if(_0x4dcaf3){_0x5819e9['message'][_0x899c('0x75')]=_0x4dcaf3[0x0];if(!_0x3910b9[_0x899c('0x58')][_0x899c('0x62')])return;return db['User']['find']({'where':{'id':_0x3910b9[_0x899c('0x58')]['UserId'],'role':_0x899c('0x64')},'attributes':['id','name',_0x899c('0x77'),_0x899c('0x78'),_0x899c('0x83')],'raw':!![]});}return null;})[_0x899c('0x20')](function(_0x197c1d){if(!_0x197c1d)return null;_0x5819e9[_0x899c('0x27')][_0x899c('0x64')]=_0x197c1d;return _0x5819e9;})[_0x899c('0x20')](function(_0x89960b){if(_0x89960b){_0x89960b[_0x899c('0x27')]['interface']=util[_0x899c('0x60')](_0x899c('0x7a'),_0x3910b9[_0x899c('0x63')][_0x899c('0x38')]);_0x89960b[_0x899c('0x27')]['channel']=_0x5819e9[_0x899c('0x7b')];_0x89960b[_0x899c('0x27')][_0x899c('0x7c')]=_0x5819e9[_0x899c('0x7b')];_0x89960b[_0x899c('0x27')][_0x899c('0x84')]=_0x899c('0x33');respondWithRpcPromise(_0x899c('0x7d'),_0x899c('0x7d'),{'event':_0x899c('0x85'),'message':_['merge'](_0x5819e9[_0x899c('0x27')],JSON['parse'](_0x5819e9[_0x899c('0x6a')]['formData']))},client9002);return _0x5819e9;}return null;})[_0x899c('0x20')](respondWithResult(_0x359945,null))['catch'](handleError(_0x359945,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 0463c86..5cbd061 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 _0xb98a=['ChatMessage','setMaxListeners','update','remove','emit','events'];(function(_0x5e48ba,_0x5dd869){var _0x27076e=function(_0x5e6d75){while(--_0x5e6d75){_0x5e48ba['push'](_0x5e48ba['shift']());}};_0x27076e(++_0x5dd869);}(_0xb98a,0x1f1));var _0xab98=function(_0x1235a8,_0x2db48e){_0x1235a8=_0x1235a8-0x0;var _0x41a2cf=_0xb98a[_0x1235a8];return _0x41a2cf;};'use strict';var EventEmitter=require(_0xab98('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xab98('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xab98('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xab98('0x3'),'afterDestroy':_0xab98('0x4')};function emitEvent(_0x1ae6a0){return function(_0x4c4631,_0x2a2f1e,_0x4cfae4){ChatMessageEvents['emit'](_0x1ae6a0+':'+_0x4c4631['id'],_0x4c4631);ChatMessageEvents[_0xab98('0x5')](_0x1ae6a0,_0x4c4631);_0x4cfae4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x62a8=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatMessage'];(function(_0x24c38e,_0x512304){var _0x5070ed=function(_0x572f4a){while(--_0x572f4a){_0x24c38e['push'](_0x24c38e['shift']());}};_0x5070ed(++_0x512304);}(_0x62a8,0xa8));var _0x862a=function(_0x137062,_0x2306e3){_0x137062=_0x137062-0x0;var _0x2928a8=_0x62a8[_0x137062];return _0x2928a8;};'use strict';var EventEmitter=require(_0x862a('0x0'));var ChatMessage=require(_0x862a('0x1'))['db'][_0x862a('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x862a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x862a('0x4'),'afterDestroy':_0x862a('0x5')};function emitEvent(_0x3bc547){return function(_0xddc502,_0x1ca180,_0x5f29a1){ChatMessageEvents[_0x862a('0x6')](_0x3bc547+':'+_0xddc502['id'],_0xddc502);ChatMessageEvents['emit'](_0x3bc547,_0xddc502);_0x5f29a1(null);};}for(var e in events){if(events[_0x862a('0x7')](e)){var event=events[e];ChatMessage[_0x862a('0x8')](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 b7f515d..981f50a 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 _0x330c=['update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteractionId','then'];(function(_0x383875,_0x45b02b){var _0x128fc2=function(_0x247f99){while(--_0x247f99){_0x383875['push'](_0x383875['shift']());}};_0x128fc2(++_0x45b02b);}(_0x330c,0x186));var _0xc330=function(_0x56f0f8,_0x28d84a){_0x56f0f8=_0x56f0f8-0x0;var _0x29c23c=_0x330c[_0x56f0f8];return _0x29c23c;};'use strict';var _=require(_0xc330('0x0'));var util=require(_0xc330('0x1'));var logger=require(_0xc330('0x2'))(_0xc330('0x3'));var moment=require('moment');var BPromise=require(_0xc330('0x4'));var rp=require(_0xc330('0x5'));var fs=require('fs');var path=require(_0xc330('0x6'));var rimraf=require(_0xc330('0x7'));var config=require(_0xc330('0x8'));var attributes=require(_0xc330('0x9'));module['exports']=function(_0x4f49fb,_0x53d0ca){return _0x4f49fb[_0xc330('0xa')](_0xc330('0xb'),attributes,{'tableName':_0xc330('0xc'),'paranoid':![],'indexes':[{'name':_0xc330('0xd'),'fields':[_0xc330('0xe')],'type':_0xc330('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1bebaa,_0x48480e,_0x150c7d){var _0x4c1a5f=_0x4f49fb[_0xc330('0x10')];var _0x49ad4c=_0x1bebaa[_0xc330('0x11')]({'plain':!![]});if(_0x49ad4c[_0xc330('0x12')][_0xc330('0x13')]()==='in'||_0x49ad4c[_0xc330('0x12')][_0xc330('0x13')]()===_0xc330('0x14')&&!_0x49ad4c[_0xc330('0x15')]&&!_[_0xc330('0x16')](_0x49ad4c[_0xc330('0x17')])){_0x4c1a5f['ChatInteraction']['findOne']({'where':{'id':_0x49ad4c[_0xc330('0x18')]}})[_0xc330('0x19')](function(_0x5066d8){if(_0x5066d8){_0x5066d8[_0xc330('0x1a')]({'lastMsgAt':_0x49ad4c[_0xc330('0x1b')],'lastMsgDirection':_0x49ad4c[_0xc330('0x12')][_0xc330('0x13')]()});}})[_0xc330('0x1c')](function(_0xdd6f7f){console[_0xc330('0x1d')](_0xdd6f7f);});}_0x150c7d();}},'charset':_0xc330('0x1e'),'collate':_0xc330('0x1f')});};
\ No newline at end of file
+var _0x7566=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','error'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x7566,0x110));var _0x6756=function(_0x574617,_0x42eccc){_0x574617=_0x574617-0x0;var _0x29de90=_0x7566[_0x574617];return _0x29de90;};'use strict';var _=require('lodash');var util=require(_0x6756('0x0'));var logger=require(_0x6756('0x1'))(_0x6756('0x2'));var moment=require(_0x6756('0x3'));var BPromise=require(_0x6756('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6756('0x5'));var rimraf=require('rimraf');var config=require(_0x6756('0x6'));var attributes=require('./chatMessage.attributes');module[_0x6756('0x7')]=function(_0x44abef,_0x3331d1){return _0x44abef['define']('ChatMessage',attributes,{'tableName':_0x6756('0x8'),'paranoid':![],'indexes':[{'name':_0x6756('0x9'),'fields':[_0x6756('0xa')],'type':_0x6756('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x30af91,_0xcbd79f,_0x1ba797){var _0x4be34d=_0x44abef[_0x6756('0xc')];var _0x590f0b=_0x30af91['get']({'plain':!![]});if(_0x590f0b[_0x6756('0xd')][_0x6756('0xe')]()==='in'||_0x590f0b[_0x6756('0xd')][_0x6756('0xe')]()===_0x6756('0xf')&&!_0x590f0b[_0x6756('0x10')]&&!_['isNil'](_0x590f0b[_0x6756('0x11')])){_0x4be34d[_0x6756('0x12')][_0x6756('0x13')]({'where':{'id':_0x590f0b[_0x6756('0x14')]}})[_0x6756('0x15')](function(_0x846006){if(_0x846006){_0x846006[_0x6756('0x16')]({'lastMsgAt':_0x590f0b[_0x6756('0x17')],'lastMsgDirection':_0x590f0b[_0x6756('0xd')][_0x6756('0xe')]()});}})['catch'](function(_0x2b996b){console[_0x6756('0x18')](_0x2b996b);});}_0x1ba797();}},'charset':_0x6756('0x19'),'collate':_0x6756('0x1a')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 888ff0f..7bc13b3 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 _0x3cb7=['redis','defaults','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','body','options','debug','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x1f62c9,_0x57a575){var _0x150b84=function(_0x48d237){while(--_0x48d237){_0x1f62c9['push'](_0x1f62c9['shift']());}};_0x150b84(++_0x57a575);}(_0x3cb7,0xcf));var _0x73cb=function(_0x5d68a2,_0x4304cf){_0x5d68a2=_0x5d68a2-0x0;var _0x5b3088=_0x3cb7[_0x5d68a2];return _0x5b3088;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x73cb('0x0'));var BPromise=require('bluebird');var rs=require(_0x73cb('0x1'));var fs=require('fs');var Redis=require(_0x73cb('0x2'));var db=require(_0x73cb('0x3'))['db'];var utils=require(_0x73cb('0x4'));var logger=require(_0x73cb('0x5'))(_0x73cb('0x6'));var config=require(_0x73cb('0x7'));var jayson=require(_0x73cb('0x8'));var client=jayson['client'][_0x73cb('0x9')]({'port':0x232a});config[_0x73cb('0xa')]=_[_0x73cb('0xb')](config[_0x73cb('0xa')],{'host':_0x73cb('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73cb('0xa')]));require(_0x73cb('0xd'))[_0x73cb('0xe')](socket);function respondWithRpcPromise(_0x29deae,_0x1826dd,_0xc1a63e){return new BPromise(function(_0x43eab2,_0x501542){return client[_0x73cb('0xf')](_0x29deae,_0xc1a63e)[_0x73cb('0x10')](function(_0x35900e){logger[_0x73cb('0x11')](_0x73cb('0x12'),_0x1826dd,_0x73cb('0x13'));logger['debug'](_0x73cb('0x14'),_0x1826dd,_0x73cb('0x13'),JSON[_0x73cb('0x15')](_0x35900e));if(_0x35900e[_0x73cb('0x16')]){if(_0x35900e[_0x73cb('0x16')][_0x73cb('0x17')]===0x1f4){logger[_0x73cb('0x16')](_0x73cb('0x12'),_0x1826dd,_0x35900e[_0x73cb('0x16')][_0x73cb('0x18')]);return _0x501542(_0x35900e['error']['message']);}logger['error'](_0x73cb('0x12'),_0x1826dd,_0x35900e[_0x73cb('0x16')][_0x73cb('0x18')]);return _0x43eab2(_0x35900e[_0x73cb('0x16')][_0x73cb('0x18')]);}else{logger['info'](_0x73cb('0x12'),_0x1826dd,_0x73cb('0x13'));_0x43eab2(_0x35900e[_0x73cb('0x19')][_0x73cb('0x18')]);}})[_0x73cb('0x1a')](function(_0x28ee3b){logger[_0x73cb('0x16')](_0x73cb('0x12'),_0x1826dd,_0x28ee3b);_0x501542(_0x28ee3b);});});}exports[_0x73cb('0x1b')]=function(_0x31fb89){var _0x50a5c4=this;return new Promise(function(_0xe092aa,_0x18d19e){return db['ChatMessage']['create'](_0x31fb89[_0x73cb('0x1c')],{'raw':_0x31fb89[_0x73cb('0x1d')]?_0x31fb89[_0x73cb('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x73cb('0x10')](function(_0x4885e9){logger['info'](_0x73cb('0x1b'),_0x31fb89);logger[_0x73cb('0x1e')]('CreateChatMessage',_0x31fb89,JSON[_0x73cb('0x15')](_0x4885e9));_0xe092aa(_0x4885e9);})[_0x73cb('0x1a')](function(_0x24bae0){logger['error'](_0x73cb('0x1b'),_0x24bae0[_0x73cb('0x18')],_0x31fb89);_0x18d19e(_0x50a5c4[_0x73cb('0x16')](0x1f4,_0x24bae0[_0x73cb('0x18')]));});});};
\ No newline at end of file
+var _0x7749=['create','body','options','raw','CreateChatMessage','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','defaults','redis','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x803730,_0x7426de){var _0xf3733c=function(_0x1f7d61){while(--_0x1f7d61){_0x803730['push'](_0x803730['shift']());}};_0xf3733c(++_0x7426de);}(_0x7749,0xf6));var _0x9774=function(_0xeccf0,_0x80aca8){_0xeccf0=_0xeccf0-0x0;var _0x45ea74=_0x7749[_0xeccf0];return _0x45ea74;};'use strict';var _=require(_0x9774('0x0'));var util=require(_0x9774('0x1'));var moment=require(_0x9774('0x2'));var BPromise=require('bluebird');var rs=require(_0x9774('0x3'));var fs=require('fs');var Redis=require(_0x9774('0x4'));var db=require(_0x9774('0x5'))['db'];var utils=require(_0x9774('0x6'));var logger=require('../../config/logger')(_0x9774('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9774('0x8')]['http']({'port':0x232a});config['redis']=_[_0x9774('0x9')](config[_0x9774('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9774('0xa')]));require(_0x9774('0xb'))[_0x9774('0xc')](socket);function respondWithRpcPromise(_0x27d363,_0xe1a87,_0x1f65bc){return new BPromise(function(_0xafe459,_0x3bdde5){return client[_0x9774('0xd')](_0x27d363,_0x1f65bc)[_0x9774('0xe')](function(_0xed35ea){logger[_0x9774('0xf')](_0x9774('0x10'),_0xe1a87,_0x9774('0x11'));logger[_0x9774('0x12')](_0x9774('0x13'),_0xe1a87,_0x9774('0x11'),JSON[_0x9774('0x14')](_0xed35ea));if(_0xed35ea['error']){if(_0xed35ea[_0x9774('0x15')][_0x9774('0x16')]===0x1f4){logger[_0x9774('0x15')](_0x9774('0x10'),_0xe1a87,_0xed35ea[_0x9774('0x15')][_0x9774('0x17')]);return _0x3bdde5(_0xed35ea[_0x9774('0x15')][_0x9774('0x17')]);}logger[_0x9774('0x15')]('ChatMessage,\x20%s,\x20%s',_0xe1a87,_0xed35ea[_0x9774('0x15')]['message']);return _0xafe459(_0xed35ea[_0x9774('0x15')][_0x9774('0x17')]);}else{logger['info'](_0x9774('0x10'),_0xe1a87,_0x9774('0x11'));_0xafe459(_0xed35ea['result'][_0x9774('0x17')]);}})['catch'](function(_0x34a615){logger[_0x9774('0x15')](_0x9774('0x10'),_0xe1a87,_0x34a615);_0x3bdde5(_0x34a615);});});}exports['CreateChatMessage']=function(_0x878283){var _0x4ee07e=this;return new Promise(function(_0x43d408,_0x271c5){return db['ChatMessage'][_0x9774('0x18')](_0x878283[_0x9774('0x19')],{'raw':_0x878283[_0x9774('0x1a')]?_0x878283[_0x9774('0x1a')][_0x9774('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x4a18e5){logger[_0x9774('0xf')](_0x9774('0x1c'),_0x878283);logger[_0x9774('0x12')](_0x9774('0x1c'),_0x878283,JSON[_0x9774('0x14')](_0x4a18e5));_0x43d408(_0x4a18e5);})[_0x9774('0x1d')](function(_0x4b53c6){logger[_0x9774('0x15')]('CreateChatMessage',_0x4b53c6['message'],_0x878283);_0x271c5(_0x4ee07e[_0x9774('0x15')](0x1f4,_0x4b53c6[_0x9774('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 7ef8b49..687a788 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 _0x19da=['update','register','length','save'];(function(_0x3771c8,_0x4f1814){var _0x54917f=function(_0x5287d3){while(--_0x5287d3){_0x3771c8['push'](_0x3771c8['shift']());}};_0x54917f(++_0x4f1814);}(_0x19da,0x9f));var _0xa19d=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0x19da[_0x59bcb1];return _0x4a737f;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xa19d('0x0'),'remove',_0xa19d('0x1')];function createListener(_0x5ba569,_0x3a48f4){return function(_0x17f1c6){_0x3a48f4['emit'](_0x5ba569,_0x17f1c6);};}function removeListener(_0x179db7,_0x28ec9a){return function(){ChatMessageEvents['removeListener'](_0x179db7,_0x28ec9a);};}exports[_0xa19d('0x2')]=function(_0x330adb){for(var _0x1f6e10=0x0,_0x14dc68=events[_0xa19d('0x3')];_0x1f6e10<_0x14dc68;_0x1f6e10++){var _0x4b4627=events[_0x1f6e10];var _0x197c4e=createListener('chatMessage:'+_0x4b4627,_0x330adb);ChatMessageEvents['on'](_0x4b4627,_0x197c4e);}};
\ No newline at end of file
+var _0xa1a5=['register','chatMessage:','./chatMessage.events','remove','update','removeListener'];(function(_0x1a3051,_0x1eaac0){var _0x2e83d6=function(_0x46110c){while(--_0x46110c){_0x1a3051['push'](_0x1a3051['shift']());}};_0x2e83d6(++_0x1eaac0);}(_0xa1a5,0x1b8));var _0x5a1a=function(_0x18405f,_0x47a737){_0x18405f=_0x18405f-0x0;var _0x13a343=_0xa1a5[_0x18405f];return _0x13a343;};'use strict';var ChatMessageEvents=require(_0x5a1a('0x0'));var events=['save',_0x5a1a('0x1'),_0x5a1a('0x2')];function createListener(_0x1d0a04,_0x13223e){return function(_0x1eac2b){_0x13223e['emit'](_0x1d0a04,_0x1eac2b);};}function removeListener(_0x3d3652,_0x12138d){return function(){ChatMessageEvents[_0x5a1a('0x3')](_0x3d3652,_0x12138d);};}exports[_0x5a1a('0x4')]=function(_0x1b718f){for(var _0x27f71f=0x0,_0x1062b9=events['length'];_0x27f71f<_0x1062b9;_0x27f71f++){var _0x1ec37f=events[_0x27f71f];var _0x313212=createListener(_0x5a1a('0x5')+_0x1ec37f,_0x1b718f);ChatMessageEvents['on'](_0x1ec37f,_0x313212);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 7dc0c69..d0917ea 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 _0x87d1=['put','/:id/accept','accept','reject','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','./chatMessage.controller','get','isAuthenticated','describe','/:id','tracked','chat'];(function(_0x22e8a9,_0x148d2b){var _0x46f0b2=function(_0x3b3079){while(--_0x3b3079){_0x22e8a9['push'](_0x22e8a9['shift']());}};_0x46f0b2(++_0x148d2b);}(_0x87d1,0x1bf));var _0x187d=function(_0x1be453,_0x4328ae){_0x1be453=_0x1be453-0x0;var _0x569960=_0x87d1[_0x1be453];return _0x569960;};'use strict';var multer=require(_0x187d('0x0'));var util=require('util');var path=require(_0x187d('0x1'));var timeout=require(_0x187d('0x2'));var express=require('express');var router=express[_0x187d('0x3')]();var fs_extra=require(_0x187d('0x4'));var auth=require(_0x187d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x187d('0x6'));router[_0x187d('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x187d('0x7')]('/describe',auth[_0x187d('0x8')](),controller[_0x187d('0x9')]);router['get'](_0x187d('0xa'),auth[_0x187d('0x8')](),controller['show']);router['post']('/',auth[_0x187d('0x8')](),interaction[_0x187d('0xb')](_0x187d('0xc'),'chatmessage:create'),controller['create']);router[_0x187d('0xd')]('/:id',controller['update']);router['put'](_0x187d('0xe'),auth[_0x187d('0x8')](),controller[_0x187d('0xf')]);router[_0x187d('0xd')]('/:id/reject',auth['isAuthenticated'](),controller[_0x187d('0x10')]);router[_0x187d('0x11')](_0x187d('0xa'),auth['isAuthenticated'](),controller[_0x187d('0x12')]);module[_0x187d('0x13')]=router;
\ No newline at end of file
+var _0x4c0b=['accept','/:id/reject','reject','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','/:id','show','tracked','chat','chatmessage:create','create','put','/:id/accept'];(function(_0x4fdd64,_0x379e15){var _0x1a1296=function(_0x2a8dd5){while(--_0x2a8dd5){_0x4fdd64['push'](_0x4fdd64['shift']());}};_0x1a1296(++_0x379e15);}(_0x4c0b,0xad));var _0xb4c0=function(_0xe4dc7,_0x3abcdc){_0xe4dc7=_0xe4dc7-0x0;var _0x5b3969=_0x4c0b[_0xe4dc7];return _0x5b3969;};'use strict';var multer=require(_0xb4c0('0x0'));var util=require(_0xb4c0('0x1'));var path=require(_0xb4c0('0x2'));var timeout=require('connect-timeout');var express=require(_0xb4c0('0x3'));var router=express[_0xb4c0('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb4c0('0x5'));var config=require(_0xb4c0('0x6'));var controller=require(_0xb4c0('0x7'));router[_0xb4c0('0x8')]('/',auth[_0xb4c0('0x9')](),controller['index']);router[_0xb4c0('0x8')](_0xb4c0('0xa'),auth[_0xb4c0('0x9')](),controller['describe']);router[_0xb4c0('0x8')](_0xb4c0('0xb'),auth['isAuthenticated'](),controller[_0xb4c0('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xb4c0('0xd')](_0xb4c0('0xe'),_0xb4c0('0xf')),controller[_0xb4c0('0x10')]);router[_0xb4c0('0x11')](_0xb4c0('0xb'),controller['update']);router[_0xb4c0('0x11')](_0xb4c0('0x12'),auth['isAuthenticated'](),controller[_0xb4c0('0x13')]);router[_0xb4c0('0x11')](_0xb4c0('0x14'),auth[_0xb4c0('0x9')](),controller[_0xb4c0('0x15')]);router['delete'](_0xb4c0('0xb'),auth[_0xb4c0('0x9')](),controller[_0xb4c0('0x16')]);module[_0xb4c0('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index ba7609d..a7bb65b 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x23183c,_0x46de69){var _0x231ba2=function(_0x1c4eb5){while(--_0x1c4eb5){_0x23183c['push'](_0x23183c['shift']());}};_0x231ba2(++_0x46de69);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3dc688,_0x4c604b){_0x3dc688=_0x3dc688-0x0;var _0x26cea2=_0x5f2f[_0x3dc688];return _0x26cea2;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0b0e,0x187));var _0xe0b0=function(_0x28edda,_0xbd447a){_0x28edda=_0x28edda-0x0;var _0x21f4a4=_0x0b0e[_0x28edda];return _0x21f4a4;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index e2bc9ce..24e6339 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x7a54,0x106));var _0x47a5=function(_0x66f9f7,_0x4ee763){_0x66f9f7=_0x66f9f7-0x0;var _0x51948f=_0x7a54[_0x66f9f7];return _0x51948f;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x7a54,0x106));var _0x47a5=function(_0x1aeb14,_0x3115d3){_0x1aeb14=_0x1aeb14-0x0;var _0x497fb5=_0x7a54[_0x1aeb14];return _0x497fb5;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 5ae0e9d..c5ea32c 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 _0x9b09=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage'];(function(_0x2134b7,_0x1eb5e2){var _0x6c5914=function(_0x1da201){while(--_0x1da201){_0x2134b7['push'](_0x2134b7['shift']());}};_0x6c5914(++_0x1eb5e2);}(_0x9b09,0xfd));var _0x99b0=function(_0x1559a5,_0x41924e){_0x1559a5=_0x1559a5-0x0;var _0x17a783=_0x9b09[_0x1559a5];return _0x17a783;};'use strict';var EventEmitter=require(_0x99b0('0x0'));var ChatOfflineMessage=require(_0x99b0('0x1'))['db'][_0x99b0('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x99b0('0x3')};function emitEvent(_0x38c7be){return function(_0x163d3b,_0x30f596,_0x120ca5){ChatOfflineMessageEvents[_0x99b0('0x4')](_0x38c7be+':'+_0x163d3b['id'],_0x163d3b);ChatOfflineMessageEvents[_0x99b0('0x4')](_0x38c7be,_0x163d3b);_0x120ca5(null);};}for(var e in events){if(events[_0x99b0('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x99b0('0x6')](e,emitEvent(event));}}module[_0x99b0('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xcf98=['save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x4bacb6,_0x2b299d){var _0x58c029=function(_0x2faaf5){while(--_0x2faaf5){_0x4bacb6['push'](_0x4bacb6['shift']());}};_0x58c029(++_0x2b299d);}(_0xcf98,0x8d));var _0x8cf9=function(_0x5a68e5,_0x510207){_0x5a68e5=_0x5a68e5-0x0;var _0x18b9d2=_0xcf98[_0x5a68e5];return _0x18b9d2;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x8cf9('0x0'))['db'][_0x8cf9('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x8cf9('0x2')](0x0);var events={'afterCreate':_0x8cf9('0x3'),'afterUpdate':_0x8cf9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x479f6b){return function(_0x2ebf57,_0x28ae77,_0x1ce13f){ChatOfflineMessageEvents[_0x8cf9('0x5')](_0x479f6b+':'+_0x2ebf57['id'],_0x2ebf57);ChatOfflineMessageEvents[_0x8cf9('0x5')](_0x479f6b,_0x2ebf57);_0x1ce13f(null);};}for(var e in events){if(events[_0x8cf9('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x8cf9('0x7')](e,emitEvent(event));}}module[_0x8cf9('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index afb5525..590a6f9 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 _0x085c=['ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x42a3c0,_0x522753){var _0x1da011=function(_0x24cda7){while(--_0x24cda7){_0x42a3c0['push'](_0x42a3c0['shift']());}};_0x1da011(++_0x522753);}(_0x085c,0x13e));var _0xc085=function(_0x33ea9e,_0x2f0d10){_0x33ea9e=_0x33ea9e-0x0;var _0x3ac557=_0x085c[_0x33ea9e];return _0x3ac557;};'use strict';var attributes=require(_0xc085('0x0'));module[_0xc085('0x1')]=function(_0x4fe6bd){return _0x4fe6bd['define'](_0xc085('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc085('0x3'),'collate':_0xc085('0x4')});};
\ No newline at end of file
+var _0x28d4=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','exports'];(function(_0x2666a0,_0x23fba6){var _0x56ec57=function(_0x35e94a){while(--_0x35e94a){_0x2666a0['push'](_0x2666a0['shift']());}};_0x56ec57(++_0x23fba6);}(_0x28d4,0x13f));var _0x428d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x28d4[_0x502c7d];return _0x30b7ed;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x428d('0x0')]=function(_0x2ed13b){return _0x2ed13b['define']('ChatOfflineMessage',attributes,{'tableName':_0x428d('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x428d('0x2'),'collate':_0x428d('0x3')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 7996092..cc1e0a5 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 _0xb13b=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x474d97,_0x5909ce){var _0x1edf25=function(_0x2831df){while(--_0x2831df){_0x474d97['push'](_0x474d97['shift']());}};_0x1edf25(++_0x5909ce);}(_0xb13b,0x1de));var _0xbb13=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xb13b[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0xbb13('0x0'));var util=require(_0xbb13('0x1'));var moment=require(_0xbb13('0x2'));var BPromise=require(_0xbb13('0x3'));var rs=require(_0xbb13('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb13('0x5'))['db'];var utils=require(_0xbb13('0x6'));var logger=require('../../config/logger')(_0xbb13('0x7'));var config=require(_0xbb13('0x8'));var jayson=require(_0xbb13('0x9'));var client=jayson[_0xbb13('0xa')][_0xbb13('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd4a4bd,_0x1067a5,_0x3be2d2){return new BPromise(function(_0x56dc8f,_0x58d7d0){return client[_0xbb13('0xc')](_0xd4a4bd,_0x3be2d2)[_0xbb13('0xd')](function(_0x1c71b9){logger[_0xbb13('0xe')](_0xbb13('0xf'),_0x1067a5,_0xbb13('0x10'));logger[_0xbb13('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x1067a5,_0xbb13('0x10'),JSON[_0xbb13('0x12')](_0x1c71b9));if(_0x1c71b9[_0xbb13('0x13')]){if(_0x1c71b9['error'][_0xbb13('0x14')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x1067a5,_0x1c71b9[_0xbb13('0x13')][_0xbb13('0x15')]);return _0x58d7d0(_0x1c71b9[_0xbb13('0x13')][_0xbb13('0x15')]);}logger['error'](_0xbb13('0xf'),_0x1067a5,_0x1c71b9[_0xbb13('0x13')][_0xbb13('0x15')]);return _0x56dc8f(_0x1c71b9['error'][_0xbb13('0x15')]);}else{logger['info'](_0xbb13('0xf'),_0x1067a5,'request\x20sent');_0x56dc8f(_0x1c71b9[_0xbb13('0x16')][_0xbb13('0x15')]);}})[_0xbb13('0x17')](function(_0x53602a){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x1067a5,_0x53602a);_0x58d7d0(_0x53602a);});});}
\ No newline at end of file
+var _0x50f0=['request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info'];(function(_0x2f2004,_0x2ea89a){var _0x2ab262=function(_0x41fe41){while(--_0x41fe41){_0x2f2004['push'](_0x2f2004['shift']());}};_0x2ab262(++_0x2ea89a);}(_0x50f0,0x6b));var _0x050f=function(_0x30bd4d,_0x50eb60){_0x30bd4d=_0x30bd4d-0x0;var _0x306915=_0x50f0[_0x30bd4d];return _0x306915;};'use strict';var _=require(_0x050f('0x0'));var util=require(_0x050f('0x1'));var moment=require(_0x050f('0x2'));var BPromise=require(_0x050f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x050f('0x4'));var db=require(_0x050f('0x5'))['db'];var utils=require(_0x050f('0x6'));var logger=require(_0x050f('0x7'))(_0x050f('0x8'));var config=require('../../config/environment');var jayson=require(_0x050f('0x9'));var client=jayson['client'][_0x050f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fb30d,_0x2fee32,_0x2944b8){return new BPromise(function(_0x9c050c,_0x5547f4){return client[_0x050f('0xb')](_0x2fb30d,_0x2944b8)['then'](function(_0x41289e){logger[_0x050f('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2fee32,_0x050f('0xd'));logger['debug'](_0x050f('0xe'),_0x2fee32,_0x050f('0xd'),JSON['stringify'](_0x41289e));if(_0x41289e[_0x050f('0xf')]){if(_0x41289e[_0x050f('0xf')][_0x050f('0x10')]===0x1f4){logger[_0x050f('0xf')](_0x050f('0x11'),_0x2fee32,_0x41289e[_0x050f('0xf')][_0x050f('0x12')]);return _0x5547f4(_0x41289e[_0x050f('0xf')][_0x050f('0x12')]);}logger[_0x050f('0xf')](_0x050f('0x11'),_0x2fee32,_0x41289e[_0x050f('0xf')][_0x050f('0x12')]);return _0x9c050c(_0x41289e[_0x050f('0xf')][_0x050f('0x12')]);}else{logger[_0x050f('0xc')](_0x050f('0x11'),_0x2fee32,'request\x20sent');_0x9c050c(_0x41289e[_0x050f('0x13')][_0x050f('0x12')]);}})['catch'](function(_0x12f1b9){logger[_0x050f('0xf')](_0x050f('0x11'),_0x2fee32,_0x12f1b9);_0x5547f4(_0x12f1b9);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 2ee7f38..b54b847 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 _0x0b93=['../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0b93,0x15f));var _0x30b9=function(_0x49534b,_0x147009){_0x49534b=_0x49534b-0x0;var _0x22517e=_0x0b93[_0x49534b];return _0x22517e;};'use strict';var multer=require('multer');var util=require(_0x30b9('0x0'));var path=require('path');var timeout=require(_0x30b9('0x1'));var express=require(_0x30b9('0x2'));var router=express[_0x30b9('0x3')]();var fs_extra=require(_0x30b9('0x4'));var auth=require(_0x30b9('0x5'));var interaction=require(_0x30b9('0x6'));var config=require(_0x30b9('0x7'));var controller=require(_0x30b9('0x8'));router[_0x30b9('0x9')]('/',auth[_0x30b9('0xa')](),controller[_0x30b9('0xb')]);router[_0x30b9('0x9')](_0x30b9('0xc'),auth[_0x30b9('0xa')](),controller[_0x30b9('0xd')]);router[_0x30b9('0x9')](_0x30b9('0xe'),auth['isAuthenticated'](),controller[_0x30b9('0xf')]);router[_0x30b9('0x10')]('/',auth['isAuthenticated'](),controller[_0x30b9('0x11')]);router[_0x30b9('0x12')](_0x30b9('0xe'),auth[_0x30b9('0xa')](),controller['update']);router[_0x30b9('0x13')](_0x30b9('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x30b9('0x14')]=router;
\ No newline at end of file
+var _0xa185=['./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5a459e,_0x48fa57){var _0x42697d=function(_0xcd4825){while(--_0xcd4825){_0x5a459e['push'](_0x5a459e['shift']());}};_0x42697d(++_0x48fa57);}(_0xa185,0x65));var _0x5a18=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa185[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x5a18('0x0'));var util=require(_0x5a18('0x1'));var path=require(_0x5a18('0x2'));var timeout=require('connect-timeout');var express=require(_0x5a18('0x3'));var router=express[_0x5a18('0x4')]();var fs_extra=require(_0x5a18('0x5'));var auth=require(_0x5a18('0x6'));var interaction=require(_0x5a18('0x7'));var config=require(_0x5a18('0x8'));var controller=require(_0x5a18('0x9'));router[_0x5a18('0xa')]('/',auth[_0x5a18('0xb')](),controller[_0x5a18('0xc')]);router[_0x5a18('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x5a18('0xd')]);router[_0x5a18('0xa')](_0x5a18('0xe'),auth[_0x5a18('0xb')](),controller[_0x5a18('0xf')]);router['post']('/',auth[_0x5a18('0xb')](),controller[_0x5a18('0x10')]);router[_0x5a18('0x11')](_0x5a18('0xe'),auth['isAuthenticated'](),controller[_0x5a18('0x12')]);router[_0x5a18('0x13')](_0x5a18('0xe'),auth[_0x5a18('0xb')](),controller[_0x5a18('0x14')]);module[_0x5a18('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index c125392..98c5aeb 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 _0xe9a9=['exports','STRING','ENUM','mouseOver','timeout'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe9a9,0x1b3));var _0x9e9a=function(_0x5fb411,_0x5e0a38){_0x5fb411=_0x5fb411-0x0;var _0xb5443d=_0xe9a9[_0x5fb411];return _0xb5443d;};'use strict';var Sequelize=require('sequelize');module[_0x9e9a('0x0')]={'name':{'type':Sequelize[_0x9e9a('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x9e9a('0x2')](_0x9e9a('0x3'),_0x9e9a('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x9e9a('0x1')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xe121=['STRING','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x4d337e,_0x2f7eed){var _0x247963=function(_0x3d6564){while(--_0x3d6564){_0x4d337e['push'](_0x4d337e['shift']());}};_0x247963(++_0x2f7eed);}(_0xe121,0xa0));var _0x1e12=function(_0x5c1501,_0x17b28a){_0x5c1501=_0x5c1501-0x0;var _0x5c4197=_0xe121[_0x5c1501];return _0x5c4197;};'use strict';var Sequelize=require(_0x1e12('0x0'));module[_0x1e12('0x1')]={'name':{'type':Sequelize[_0x1e12('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1e12('0x3'),_0x1e12('0x4')),'defaultValue':_0x1e12('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1e12('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index bf7850e..d938558 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 _0x4016=['then','destroy','error','stack','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','rimraf','zip-dir','bluebird','util','path','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x4016,0x131));var _0x6401=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x4016[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6401('0x0'));var zipdir=require(_0x6401('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6401('0x2'));var Mustache=require('mustache');var util=require(_0x6401('0x3'));var path=require(_0x6401('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6401('0x5'));var fs=require('fs');var fs_extra=require(_0x6401('0x6'));var _=require('lodash');var squel=require(_0x6401('0x7'));var crypto=require('crypto');var jsforce=require(_0x6401('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x6401('0x9'));var querystring=require(_0x6401('0xa'));var Papa=require(_0x6401('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6401('0xc'));var as=require(_0x6401('0xd'));var hardwareService=require(_0x6401('0xe'));var logger=require('../../config/logger')(_0x6401('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6401('0x10'));var db=require(_0x6401('0x11'))['db'];function respondWithStatusCode(_0x26ec93,_0x45e88a){_0x45e88a=_0x45e88a||0xcc;return function(_0xf7fc5){if(_0xf7fc5){return _0x26ec93[_0x6401('0x12')](_0x45e88a);}return _0x26ec93[_0x6401('0x13')](_0x45e88a)[_0x6401('0x14')]();};}function respondWithResult(_0x381c17,_0x1f6edf){_0x1f6edf=_0x1f6edf||0xc8;return function(_0x45fcea){if(_0x45fcea){return _0x381c17[_0x6401('0x13')](_0x1f6edf)[_0x6401('0x15')](_0x45fcea);}};}function respondWithFilteredResult(_0x29fedc,_0x4c740a){return function(_0x1b510e){if(_0x1b510e){var _0x1fd3b8=typeof _0x4c740a[_0x6401('0x16')]===_0x6401('0x17')&&typeof _0x4c740a[_0x6401('0x18')]===_0x6401('0x17');var _0x4521b6=_0x1b510e['count'];var _0x55ca87=_0x1fd3b8?0x0:_0x4c740a[_0x6401('0x16')];var _0x50eda7=_0x1fd3b8?_0x1b510e[_0x6401('0x19')]:_0x4c740a[_0x6401('0x16')]+_0x4c740a[_0x6401('0x18')];var _0x3c3a6c;if(_0x50eda7>=_0x4521b6){_0x50eda7=_0x4521b6;_0x3c3a6c=0xc8;}else{_0x3c3a6c=0xce;}_0x29fedc[_0x6401('0x13')](_0x3c3a6c);return _0x29fedc[_0x6401('0x1a')](_0x6401('0x1b'),_0x55ca87+'-'+_0x50eda7+'/'+_0x4521b6)['json'](_0x1b510e);}return null;};}function patchUpdates(_0x10fd3c){return function(_0x44525b){try{jsonpatch[_0x6401('0x1c')](_0x44525b,_0x10fd3c,!![]);}catch(_0x1757ab){return BPromise['reject'](_0x1757ab);}return _0x44525b[_0x6401('0x1d')]();};}function saveUpdates(_0x343d25,_0x4ed76d){return function(_0x20b445){if(_0x20b445){return _0x20b445[_0x6401('0x1e')](_0x343d25)[_0x6401('0x1f')](function(_0xdea921){return _0xdea921;});}return null;};}function removeEntity(_0x19d6a0,_0x39bca3){return function(_0xed5d29){if(_0xed5d29){return _0xed5d29[_0x6401('0x20')]()[_0x6401('0x1f')](function(){_0x19d6a0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55818a,_0xee5737){return function(_0x12f19a){if(!_0x12f19a){_0x55818a[_0x6401('0x12')](0x194);}return _0x12f19a;};}function handleError(_0x4e6d9f,_0x3b1d99){_0x3b1d99=_0x3b1d99||0x1f4;return function(_0x102f69){logger[_0x6401('0x21')](_0x102f69[_0x6401('0x22')]);if(_0x102f69['name']){delete _0x102f69['name'];}_0x4e6d9f[_0x6401('0x13')](_0x3b1d99)[_0x6401('0x23')](_0x102f69);};}exports[_0x6401('0x24')]=function(_0x466a35,_0x549b8c){var _0x7f6e88={'raw':!![],'where':{'id':_0x466a35[_0x6401('0x25')]['id']}},_0x43e089={};_0x43e089[_0x6401('0x26')]=_[_0x6401('0x27')](db[_0x6401('0x28')][_0x6401('0x29')]);_0x43e089[_0x6401('0x2a')]=_['keys'](_0x466a35[_0x6401('0x2a')]);_0x43e089[_0x6401('0x2b')]=_[_0x6401('0x2c')](_0x43e089[_0x6401('0x26')],_0x43e089['query']);_0x7f6e88[_0x6401('0x2d')]=_[_0x6401('0x2c')](_0x43e089[_0x6401('0x26')],qs['fields'](_0x466a35['query'][_0x6401('0x2e')]));_0x7f6e88['attributes']=_0x7f6e88[_0x6401('0x2d')][_0x6401('0x2f')]?_0x7f6e88[_0x6401('0x2d')]:_0x43e089[_0x6401('0x26')];if(_0x466a35[_0x6401('0x2a')][_0x6401('0x30')]){_0x7f6e88[_0x6401('0x31')]=[{'all':!![]}];}_0x7f6e88=_[_0x6401('0x32')]({},_0x7f6e88,_0x466a35[_0x6401('0x33')]);return db['ChatProactiveAction'][_0x6401('0x34')](_0x7f6e88)[_0x6401('0x1f')](handleEntityNotFound(_0x549b8c,null))[_0x6401('0x1f')](respondWithResult(_0x549b8c,null))[_0x6401('0x35')](handleError(_0x549b8c,null));};exports[_0x6401('0x36')]=function(_0x556354,_0xd7a00f){return db[_0x6401('0x28')]['create'](_0x556354[_0x6401('0x37')],{})['then'](respondWithResult(_0xd7a00f,0xc9))[_0x6401('0x35')](handleError(_0xd7a00f,null));};exports[_0x6401('0x1e')]=function(_0x5317f8,_0x444339){if(_0x5317f8[_0x6401('0x37')]['id']){delete _0x5317f8[_0x6401('0x37')]['id'];}return db[_0x6401('0x28')]['find']({'where':{'id':_0x5317f8[_0x6401('0x25')]['id']}})[_0x6401('0x1f')](handleEntityNotFound(_0x444339,null))[_0x6401('0x1f')](saveUpdates(_0x5317f8['body'],null))[_0x6401('0x1f')](respondWithResult(_0x444339,null))[_0x6401('0x35')](handleError(_0x444339,null));};exports['destroy']=function(_0x79d73f,_0x337d1c){return db[_0x6401('0x28')][_0x6401('0x34')]({'where':{'id':_0x79d73f[_0x6401('0x25')]['id']}})[_0x6401('0x1f')](handleEntityNotFound(_0x337d1c,null))[_0x6401('0x1f')](removeEntity(_0x337d1c,null))[_0x6401('0x35')](handleError(_0x337d1c,null));};
\ No newline at end of file
+var _0xd4d1=['fields','length','includeAll','include','ChatProactiveAction','catch','create','body','update','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','count','json','then','destroy','end','error','name','send','show','model','keys','rawAttributes','query','filters','intersection','attributes'];(function(_0x57b971,_0x1ea555){var _0x47d1d8=function(_0x12e4c7){while(--_0x12e4c7){_0x57b971['push'](_0x57b971['shift']());}};_0x47d1d8(++_0x1ea555);}(_0xd4d1,0x123));var _0x1d4d=function(_0x5842ba,_0x18b717){_0x5842ba=_0x5842ba-0x0;var _0x57705f=_0xd4d1[_0x5842ba];return _0x57705f;};'use strict';var emlformat=require(_0x1d4d('0x0'));var rimraf=require(_0x1d4d('0x1'));var zipdir=require(_0x1d4d('0x2'));var jsonpatch=require(_0x1d4d('0x3'));var rp=require(_0x1d4d('0x4'));var moment=require('moment');var BPromise=require(_0x1d4d('0x5'));var Mustache=require('mustache');var util=require(_0x1d4d('0x6'));var path=require('path');var sox=require(_0x1d4d('0x7'));var csv=require('to-csv');var ejs=require(_0x1d4d('0x8'));var fs=require('fs');var fs_extra=require(_0x1d4d('0x9'));var _=require(_0x1d4d('0xa'));var squel=require('squel');var crypto=require(_0x1d4d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1d4d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1d4d('0xd'));var Papa=require(_0x1d4d('0xe'));var Redis=require(_0x1d4d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1d4d('0x10'));var as=require(_0x1d4d('0x11'));var hardwareService=require(_0x1d4d('0x12'));var logger=require('../../config/logger')(_0x1d4d('0x13'));var utils=require(_0x1d4d('0x14'));var config=require(_0x1d4d('0x15'));var licenseUtil=require(_0x1d4d('0x16'));var db=require(_0x1d4d('0x17'))['db'];function respondWithStatusCode(_0x9f5623,_0x111424){_0x111424=_0x111424||0xcc;return function(_0x436699){if(_0x436699){return _0x9f5623[_0x1d4d('0x18')](_0x111424);}return _0x9f5623[_0x1d4d('0x19')](_0x111424)['end']();};}function respondWithResult(_0x2941e6,_0x4561e3){_0x4561e3=_0x4561e3||0xc8;return function(_0x505e7e){if(_0x505e7e){return _0x2941e6['status'](_0x4561e3)['json'](_0x505e7e);}};}function respondWithFilteredResult(_0x14a98c,_0x5d3434){return function(_0xcc78f9){if(_0xcc78f9){var _0x59de78=typeof _0x5d3434['offset']===_0x1d4d('0x1a')&&typeof _0x5d3434[_0x1d4d('0x1b')]==='undefined';var _0x1adf14=_0xcc78f9['count'];var _0x4254a6=_0x59de78?0x0:_0x5d3434[_0x1d4d('0x1c')];var _0x16fa99=_0x59de78?_0xcc78f9[_0x1d4d('0x1d')]:_0x5d3434[_0x1d4d('0x1c')]+_0x5d3434['limit'];var _0x2d1b01;if(_0x16fa99>=_0x1adf14){_0x16fa99=_0x1adf14;_0x2d1b01=0xc8;}else{_0x2d1b01=0xce;}_0x14a98c[_0x1d4d('0x19')](_0x2d1b01);return _0x14a98c['set']('Content-Range',_0x4254a6+'-'+_0x16fa99+'/'+_0x1adf14)[_0x1d4d('0x1e')](_0xcc78f9);}return null;};}function patchUpdates(_0x39f05d){return function(_0x3a2f35){try{jsonpatch['apply'](_0x3a2f35,_0x39f05d,!![]);}catch(_0x5a0f32){return BPromise['reject'](_0x5a0f32);}return _0x3a2f35['save']();};}function saveUpdates(_0x341046,_0x227278){return function(_0x321e00){if(_0x321e00){return _0x321e00['update'](_0x341046)[_0x1d4d('0x1f')](function(_0x5ce064){return _0x5ce064;});}return null;};}function removeEntity(_0x4b985b,_0x3ce3ba){return function(_0x15386b){if(_0x15386b){return _0x15386b[_0x1d4d('0x20')]()['then'](function(){_0x4b985b[_0x1d4d('0x19')](0xcc)[_0x1d4d('0x21')]();});}};}function handleEntityNotFound(_0x28f827,_0x31affb){return function(_0x50a238){if(!_0x50a238){_0x28f827[_0x1d4d('0x18')](0x194);}return _0x50a238;};}function handleError(_0x2b1b8b,_0x14b4e9){_0x14b4e9=_0x14b4e9||0x1f4;return function(_0x5ab0f3){logger[_0x1d4d('0x22')](_0x5ab0f3['stack']);if(_0x5ab0f3['name']){delete _0x5ab0f3[_0x1d4d('0x23')];}_0x2b1b8b[_0x1d4d('0x19')](_0x14b4e9)[_0x1d4d('0x24')](_0x5ab0f3);};}exports[_0x1d4d('0x25')]=function(_0x27daea,_0x575ff3){var _0xc9f05b={'raw':!![],'where':{'id':_0x27daea['params']['id']}},_0x435bcb={};_0x435bcb[_0x1d4d('0x26')]=_[_0x1d4d('0x27')](db['ChatProactiveAction'][_0x1d4d('0x28')]);_0x435bcb[_0x1d4d('0x29')]=_[_0x1d4d('0x27')](_0x27daea[_0x1d4d('0x29')]);_0x435bcb[_0x1d4d('0x2a')]=_[_0x1d4d('0x2b')](_0x435bcb[_0x1d4d('0x26')],_0x435bcb['query']);_0xc9f05b[_0x1d4d('0x2c')]=_[_0x1d4d('0x2b')](_0x435bcb['model'],qs[_0x1d4d('0x2d')](_0x27daea['query'][_0x1d4d('0x2d')]));_0xc9f05b[_0x1d4d('0x2c')]=_0xc9f05b[_0x1d4d('0x2c')][_0x1d4d('0x2e')]?_0xc9f05b[_0x1d4d('0x2c')]:_0x435bcb[_0x1d4d('0x26')];if(_0x27daea[_0x1d4d('0x29')][_0x1d4d('0x2f')]){_0xc9f05b[_0x1d4d('0x30')]=[{'all':!![]}];}_0xc9f05b=_['merge']({},_0xc9f05b,_0x27daea['options']);return db[_0x1d4d('0x31')]['find'](_0xc9f05b)[_0x1d4d('0x1f')](handleEntityNotFound(_0x575ff3,null))[_0x1d4d('0x1f')](respondWithResult(_0x575ff3,null))[_0x1d4d('0x32')](handleError(_0x575ff3,null));};exports[_0x1d4d('0x33')]=function(_0x25f375,_0x39af1f){return db[_0x1d4d('0x31')][_0x1d4d('0x33')](_0x25f375[_0x1d4d('0x34')],{})[_0x1d4d('0x1f')](respondWithResult(_0x39af1f,0xc9))[_0x1d4d('0x32')](handleError(_0x39af1f,null));};exports[_0x1d4d('0x35')]=function(_0x67598f,_0x4c1ec5){if(_0x67598f[_0x1d4d('0x34')]['id']){delete _0x67598f['body']['id'];}return db[_0x1d4d('0x31')][_0x1d4d('0x36')]({'where':{'id':_0x67598f['params']['id']}})[_0x1d4d('0x1f')](handleEntityNotFound(_0x4c1ec5,null))['then'](saveUpdates(_0x67598f[_0x1d4d('0x34')],null))[_0x1d4d('0x1f')](respondWithResult(_0x4c1ec5,null))[_0x1d4d('0x32')](handleError(_0x4c1ec5,null));};exports[_0x1d4d('0x20')]=function(_0x49fbb6,_0x24cc17){return db[_0x1d4d('0x31')]['find']({'where':{'id':_0x49fbb6[_0x1d4d('0x37')]['id']}})[_0x1d4d('0x1f')](handleEntityNotFound(_0x24cc17,null))[_0x1d4d('0x1f')](removeEntity(_0x24cc17,null))[_0x1d4d('0x32')](handleError(_0x24cc17,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index a831cfa..1c94c0a 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 _0x7be2=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x36858d,_0x4e1f31){var _0x59ea81=function(_0x2533ca){while(--_0x2533ca){_0x36858d['push'](_0x36858d['shift']());}};_0x59ea81(++_0x4e1f31);}(_0x7be2,0xdd));var _0x27be=function(_0x3e417d,_0xaf2086){_0x3e417d=_0x3e417d-0x0;var _0x5c2ede=_0x7be2[_0x3e417d];return _0x5c2ede;};'use strict';var _=require(_0x27be('0x0'));var util=require(_0x27be('0x1'));var logger=require(_0x27be('0x2'))('api');var moment=require(_0x27be('0x3'));var BPromise=require(_0x27be('0x4'));var rp=require(_0x27be('0x5'));var fs=require('fs');var path=require(_0x27be('0x6'));var rimraf=require(_0x27be('0x7'));var config=require('../../config/environment');var attributes=require(_0x27be('0x8'));module[_0x27be('0x9')]=function(_0x3da188,_0x31b74e){return _0x3da188[_0x27be('0xa')](_0x27be('0xb'),attributes,{'tableName':_0x27be('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5094=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x38d1b4,_0x58378e){var _0xe7f2d3=function(_0x1e7f81){while(--_0x1e7f81){_0x38d1b4['push'](_0x38d1b4['shift']());}};_0xe7f2d3(++_0x58378e);}(_0x5094,0xb6));var _0x4509=function(_0xa3fadc,_0xd1e16){_0xa3fadc=_0xa3fadc-0x0;var _0x23ecb8=_0x5094[_0xa3fadc];return _0x23ecb8;};'use strict';var _=require(_0x4509('0x0'));var util=require(_0x4509('0x1'));var logger=require(_0x4509('0x2'))('api');var moment=require(_0x4509('0x3'));var BPromise=require(_0x4509('0x4'));var rp=require(_0x4509('0x5'));var fs=require('fs');var path=require(_0x4509('0x6'));var rimraf=require(_0x4509('0x7'));var config=require(_0x4509('0x8'));var attributes=require(_0x4509('0x9'));module['exports']=function(_0x5e2e9a,_0x3d93cf){return _0x5e2e9a[_0x4509('0xa')](_0x4509('0xb'),attributes,{'tableName':_0x4509('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 5a67505..e05a4fd 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 _0x46ee=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x77d310,_0x2b2fe7){var _0x2cdce4=function(_0xbaa481){while(--_0xbaa481){_0x77d310['push'](_0x77d310['shift']());}};_0x2cdce4(++_0x2b2fe7);}(_0x46ee,0x6b));var _0xe46e=function(_0x3545aa,_0x59c5a6){_0x3545aa=_0x3545aa-0x0;var _0x513534=_0x46ee[_0x3545aa];return _0x513534;};'use strict';var _=require(_0xe46e('0x0'));var util=require(_0xe46e('0x1'));var moment=require(_0xe46e('0x2'));var BPromise=require(_0xe46e('0x3'));var rs=require(_0xe46e('0x4'));var fs=require('fs');var Redis=require(_0xe46e('0x5'));var db=require(_0xe46e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xe46e('0x7'));var client=jayson[_0xe46e('0x8')][_0xe46e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cbf01,_0x2bd6db,_0x503d16){return new BPromise(function(_0x417fa7,_0x209d13){return client[_0xe46e('0xa')](_0x5cbf01,_0x503d16)['then'](function(_0x317a04){logger[_0xe46e('0xb')](_0xe46e('0xc'),_0x2bd6db,'request\x20sent');logger['debug'](_0xe46e('0xd'),_0x2bd6db,_0xe46e('0xe'),JSON['stringify'](_0x317a04));if(_0x317a04[_0xe46e('0xf')]){if(_0x317a04[_0xe46e('0xf')][_0xe46e('0x10')]===0x1f4){logger[_0xe46e('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x2bd6db,_0x317a04[_0xe46e('0xf')][_0xe46e('0x11')]);return _0x209d13(_0x317a04[_0xe46e('0xf')][_0xe46e('0x11')]);}logger[_0xe46e('0xf')](_0xe46e('0xc'),_0x2bd6db,_0x317a04['error'][_0xe46e('0x11')]);return _0x417fa7(_0x317a04['error'][_0xe46e('0x11')]);}else{logger[_0xe46e('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x2bd6db,_0xe46e('0xe'));_0x417fa7(_0x317a04[_0xe46e('0x12')][_0xe46e('0x11')]);}})[_0xe46e('0x13')](function(_0x4d359a){logger[_0xe46e('0xf')](_0xe46e('0xc'),_0x2bd6db,_0x4d359a);_0x209d13(_0x4d359a);});});}
\ No newline at end of file
+var _0x636f=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x4920e6,_0x398107){var _0x845c60=function(_0x9079c4){while(--_0x9079c4){_0x4920e6['push'](_0x4920e6['shift']());}};_0x845c60(++_0x398107);}(_0x636f,0xe3));var _0xf636=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x636f[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xf636('0x0'));var util=require(_0xf636('0x1'));var moment=require(_0xf636('0x2'));var BPromise=require('bluebird');var rs=require(_0xf636('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf636('0x4'))['db'];var utils=require(_0xf636('0x5'));var logger=require(_0xf636('0x6'))(_0xf636('0x7'));var config=require(_0xf636('0x8'));var jayson=require(_0xf636('0x9'));var client=jayson[_0xf636('0xa')][_0xf636('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1340b9,_0x8cfd12,_0x5e3497){return new BPromise(function(_0x2a2759,_0x4c3cfd){return client['request'](_0x1340b9,_0x5e3497)[_0xf636('0xc')](function(_0x1f6d5d){logger[_0xf636('0xd')](_0xf636('0xe'),_0x8cfd12,_0xf636('0xf'));logger[_0xf636('0x10')](_0xf636('0x11'),_0x8cfd12,_0xf636('0xf'),JSON[_0xf636('0x12')](_0x1f6d5d));if(_0x1f6d5d[_0xf636('0x13')]){if(_0x1f6d5d[_0xf636('0x13')][_0xf636('0x14')]===0x1f4){logger['error'](_0xf636('0xe'),_0x8cfd12,_0x1f6d5d['error'][_0xf636('0x15')]);return _0x4c3cfd(_0x1f6d5d[_0xf636('0x13')][_0xf636('0x15')]);}logger[_0xf636('0x13')](_0xf636('0xe'),_0x8cfd12,_0x1f6d5d['error'][_0xf636('0x15')]);return _0x2a2759(_0x1f6d5d['error'][_0xf636('0x15')]);}else{logger['info'](_0xf636('0xe'),_0x8cfd12,'request\x20sent');_0x2a2759(_0x1f6d5d['result']['message']);}})[_0xf636('0x16')](function(_0x44b351){logger[_0xf636('0x13')](_0xf636('0xe'),_0x8cfd12,_0x44b351);_0x4c3cfd(_0x44b351);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index e05a691..88dc151 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 _0x038b=['isAuthenticated','/:id','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','show','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x038b,0x114));var _0xb038=function(_0xb091a1,_0x310718){_0xb091a1=_0xb091a1-0x0;var _0x262451=_0x038b[_0xb091a1];return _0x262451;};'use strict';var multer=require('multer');var util=require(_0xb038('0x0'));var path=require(_0xb038('0x1'));var timeout=require(_0xb038('0x2'));var express=require('express');var router=express[_0xb038('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb038('0x4'));var interaction=require(_0xb038('0x5'));var config=require('../../config/environment');var controller=require(_0xb038('0x6'));router[_0xb038('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xb038('0x8')]);router[_0xb038('0x9')]('/',auth[_0xb038('0xa')](),controller['create']);router['put'](_0xb038('0xb'),auth[_0xb038('0xa')](),controller['update']);router['delete'](_0xb038('0xb'),auth[_0xb038('0xa')](),controller['destroy']);module[_0xb038('0xc')]=router;
\ No newline at end of file
+var _0xeff8=['isAuthenticated','show','post','create','put','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xeff8,0x186));var _0x8eff=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0xeff8[_0x2405bc];return _0x5272d4;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8eff('0x5'));var interaction=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var controller=require(_0x8eff('0x8'));router['get'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xb')]);router[_0x8eff('0xc')]('/',auth['isAuthenticated'](),controller[_0x8eff('0xd')]);router[_0x8eff('0xe')](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller['update']);router['delete'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 28958eb..3fb5293 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 _0x09bc=['roundrobin','sequelize','exports','STRING','INTEGER','rrmemory','beepall'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x09bc,0x1ba));var _0xc09b=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x09bc[_0x3635ce];return _0x97ecd0;};'use strict';var Sequelize=require(_0xc09b('0x0'));module[_0xc09b('0x1')]={'name':{'type':Sequelize[_0xc09b('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc09b('0x2')]},'timeout':{'type':Sequelize[_0xc09b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc09b('0x4'),_0xc09b('0x5'),_0xc09b('0x6'))}};
\ No newline at end of file
+var _0x6c23=['INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name'];(function(_0xed0dd9,_0x298830){var _0x270a7c=function(_0x391180){while(--_0x391180){_0xed0dd9['push'](_0xed0dd9['shift']());}};_0x270a7c(++_0x298830);}(_0x6c23,0x64));var _0x36c2=function(_0x56ac40,_0x3eb56c){_0x56ac40=_0x56ac40-0x0;var _0x5e32c3=_0x6c23[_0x56ac40];return _0x5e32c3;};'use strict';var Sequelize=require(_0x36c2('0x0'));module[_0x36c2('0x1')]={'name':{'type':Sequelize[_0x36c2('0x2')],'unique':_0x36c2('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x36c2('0x2')]},'timeout':{'type':Sequelize[_0x36c2('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x36c2('0x5')](_0x36c2('0x6'),'beepall',_0x36c2('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 4d01f40..12a9b88 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 _0x50c2=['UserChatQueue','nolimit','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','SIP','chatPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','toString','SELECT','every','TeamId','includes','all','union','isEmpty','removeAgents','userChatQueue:remove','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','end','status','json','offset','undefined','limit','count','set','apply','reject','then','ChatQueues','UserProfileResource','destroy','sendStatus','stack','name','send','map','ChatQueue','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','length','merge','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne'];(function(_0xe8668f,_0x42446c){var _0xf3d4ff=function(_0x5447d6){while(--_0x5447d6){_0xe8668f['push'](_0xe8668f['shift']());}};_0xf3d4ff(++_0x42446c);}(_0x50c2,0x1e8));var _0x250c=function(_0x4a7244,_0x2eb6d3){_0x4a7244=_0x4a7244-0x0;var _0x551233=_0x50c2[_0x4a7244];return _0x551233;};'use strict';var emlformat=require(_0x250c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x250c('0x1'));var jsonpatch=require(_0x250c('0x2'));var rp=require('request-promise');var moment=require(_0x250c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x250c('0x4'));var util=require(_0x250c('0x5'));var path=require(_0x250c('0x6'));var sox=require(_0x250c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x250c('0x8'));var _=require(_0x250c('0x9'));var squel=require(_0x250c('0xa'));var crypto=require(_0x250c('0xb'));var jsforce=require(_0x250c('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x250c('0xd'));var Redis=require('ioredis');var authService=require(_0x250c('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x250c('0xf'));var hardwareService=require(_0x250c('0x10'));var logger=require(_0x250c('0x11'))('api');var utils=require(_0x250c('0x12'));var config=require(_0x250c('0x13'));var licenseUtil=require(_0x250c('0x14'));var db=require(_0x250c('0x15'))['db'];config[_0x250c('0x16')]=_[_0x250c('0x17')](config[_0x250c('0x16')],{'host':_0x250c('0x18'),'port':0x18eb});var socket=require(_0x250c('0x19'))(new Redis(config['redis']));require(_0x250c('0x1a'))[_0x250c('0x1b')](socket);var jayson=require(_0x250c('0x1c'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xb44357,_0x1d7263,_0x1a90db,_0x59f7fe){return new BPromise(function(_0x1c90b3,_0x2fdf70){var _0x3f36bb=_0x59f7fe||client;return _0x3f36bb['request'](_0xb44357,_0x1a90db)['then'](function(_0x2feecf){logger['info'](_0x250c('0x1d'),_0x1d7263,'request\x20sent');logger[_0x250c('0x1e')](_0x250c('0x1f'),_0x1d7263,'request\x20sent',JSON[_0x250c('0x20')](_0x2feecf));if(_0x2feecf[_0x250c('0x21')]){if(_0x2feecf['error'][_0x250c('0x22')]===0x1f4){logger[_0x250c('0x21')](_0x250c('0x1d'),_0x1d7263,_0x2feecf[_0x250c('0x21')][_0x250c('0x23')]);return _0x2fdf70(_0x2feecf[_0x250c('0x21')][_0x250c('0x23')]);}logger[_0x250c('0x21')](_0x250c('0x1d'),_0x1d7263,_0x2feecf[_0x250c('0x21')][_0x250c('0x23')]);return _0x1c90b3(_0x2feecf[_0x250c('0x21')][_0x250c('0x23')]);}else{logger[_0x250c('0x24')]('ChatQueue,\x20%s,\x20%s',_0x1d7263,_0x250c('0x25'));_0x1c90b3(_0x2feecf[_0x250c('0x26')][_0x250c('0x23')]);}})[_0x250c('0x27')](function(_0x24204a){logger['error'](_0x250c('0x1d'),_0x1d7263,_0x24204a);_0x2fdf70(_0x24204a);});});}function respondWithStatusCode(_0x40239c,_0x2b3fce){_0x2b3fce=_0x2b3fce||0xcc;return function(_0x4a5ab1){if(_0x4a5ab1){return _0x40239c['sendStatus'](_0x2b3fce);}return _0x40239c['status'](_0x2b3fce)[_0x250c('0x28')]();};}function respondWithResult(_0x595900,_0x2bb0f8){_0x2bb0f8=_0x2bb0f8||0xc8;return function(_0x38c2a5){if(_0x38c2a5){return _0x595900[_0x250c('0x29')](_0x2bb0f8)[_0x250c('0x2a')](_0x38c2a5);}};}function respondWithFilteredResult(_0xaca396,_0x4c388d){return function(_0x4a2ea1){if(_0x4a2ea1){var _0x24d97f=typeof _0x4c388d[_0x250c('0x2b')]===_0x250c('0x2c')&&typeof _0x4c388d[_0x250c('0x2d')]==='undefined';var _0x376af7=_0x4a2ea1[_0x250c('0x2e')];var _0x353ee5=_0x24d97f?0x0:_0x4c388d[_0x250c('0x2b')];var _0x53e3c0=_0x24d97f?_0x4a2ea1['count']:_0x4c388d['offset']+_0x4c388d['limit'];var _0x1d0685;if(_0x53e3c0>=_0x376af7){_0x53e3c0=_0x376af7;_0x1d0685=0xc8;}else{_0x1d0685=0xce;}_0xaca396['status'](_0x1d0685);return _0xaca396[_0x250c('0x2f')]('Content-Range',_0x353ee5+'-'+_0x53e3c0+'/'+_0x376af7)[_0x250c('0x2a')](_0x4a2ea1);}return null;};}function patchUpdates(_0x590bd8){return function(_0x2645a9){try{jsonpatch[_0x250c('0x30')](_0x2645a9,_0x590bd8,!![]);}catch(_0x176b6a){return BPromise[_0x250c('0x31')](_0x176b6a);}return _0x2645a9['save']();};}function saveUpdates(_0x1bebfb,_0x2a8691){return function(_0x276ddf){if(_0x276ddf){return _0x276ddf['update'](_0x1bebfb)[_0x250c('0x32')](function(_0x208c04){return _0x208c04;});}return null;};}function removeEntity(_0x387119,_0x40e18f){return function(_0xaad7e5){if(_0xaad7e5){return _0xaad7e5['destroy']()['then'](function(){var _0x549a53=_0xaad7e5['get']({'plain':!![]});var _0x38d75b=_0x250c('0x33');return db[_0x250c('0x34')][_0x250c('0x35')]({'where':{'type':_0x38d75b,'resourceId':_0x549a53['id']}})['then'](function(){return _0xaad7e5;});})[_0x250c('0x32')](function(){_0x387119[_0x250c('0x29')](0xcc)[_0x250c('0x28')]();});}};}function handleEntityNotFound(_0x19e43c,_0x50189c){return function(_0x3b3c2b){if(!_0x3b3c2b){_0x19e43c[_0x250c('0x36')](0x194);}return _0x3b3c2b;};}function handleError(_0x19cc86,_0x4d26d7){_0x4d26d7=_0x4d26d7||0x1f4;return function(_0x2b6e0e){logger[_0x250c('0x21')](_0x2b6e0e[_0x250c('0x37')]);if(_0x2b6e0e[_0x250c('0x38')]){delete _0x2b6e0e[_0x250c('0x38')];}_0x19cc86[_0x250c('0x29')](_0x4d26d7)[_0x250c('0x39')](_0x2b6e0e);};}exports['index']=function(_0x3744a4,_0x442de6){var _0x1501ff={},_0x3fe6db={},_0x38b6a4={'count':0x0,'rows':[]};var _0x408673=_[_0x250c('0x3a')](db[_0x250c('0x3b')][_0x250c('0x3c')],function(_0xda987d){return{'name':_0xda987d[_0x250c('0x3d')],'type':_0xda987d['type'][_0x250c('0x3e')]};});_0x3fe6db[_0x250c('0x3f')]=_[_0x250c('0x3a')](_0x408673,_0x250c('0x38'));_0x3fe6db[_0x250c('0x40')]=_['keys'](_0x3744a4['query']);_0x3fe6db[_0x250c('0x41')]=_[_0x250c('0x42')](_0x3fe6db['model'],_0x3fe6db['query']);_0x1501ff['attributes']=_[_0x250c('0x42')](_0x3fe6db[_0x250c('0x3f')],qs[_0x250c('0x43')](_0x3744a4['query']['fields']));_0x1501ff[_0x250c('0x44')]=_0x1501ff[_0x250c('0x44')]['length']?_0x1501ff['attributes']:_0x3fe6db[_0x250c('0x3f')];if(!_0x3744a4[_0x250c('0x40')][_0x250c('0x45')]('nolimit')){_0x1501ff[_0x250c('0x2d')]=qs[_0x250c('0x2d')](_0x3744a4[_0x250c('0x40')]['limit']);_0x1501ff['offset']=qs[_0x250c('0x2b')](_0x3744a4[_0x250c('0x40')][_0x250c('0x2b')]);}_0x1501ff[_0x250c('0x46')]=qs[_0x250c('0x47')](_0x3744a4[_0x250c('0x40')][_0x250c('0x47')]);_0x1501ff[_0x250c('0x48')]=qs['filters'](_[_0x250c('0x49')](_0x3744a4[_0x250c('0x40')],_0x3fe6db['filters']),_0x408673);if(_0x3744a4[_0x250c('0x40')][_0x250c('0x4a')]){_0x1501ff['where']=_['merge'](_0x1501ff[_0x250c('0x48')],{'$or':_[_0x250c('0x3a')](_0x408673,function(_0x20440b){if(_0x20440b['type']!==_0x250c('0x4b')){var _0x4f8521={};_0x4f8521[_0x20440b[_0x250c('0x38')]]={'$like':'%'+_0x3744a4['query'][_0x250c('0x4a')]+'%'};return _0x4f8521;}})});}_0x1501ff=_['merge']({},_0x1501ff,_0x3744a4['options']);var _0x40a7aa={'where':_0x1501ff[_0x250c('0x48')]};return db[_0x250c('0x3b')][_0x250c('0x2e')](_0x40a7aa)['then'](function(_0xe0a317){_0x38b6a4['count']=_0xe0a317;if(_0x3744a4[_0x250c('0x40')][_0x250c('0x4c')]){_0x1501ff[_0x250c('0x4d')]=[{'all':!![]}];}return db['ChatQueue'][_0x250c('0x4e')](_0x1501ff);})[_0x250c('0x32')](function(_0x30c2a2){_0x38b6a4[_0x250c('0x4f')]=_0x30c2a2;return _0x38b6a4;})['then'](respondWithFilteredResult(_0x442de6,_0x1501ff))[_0x250c('0x27')](handleError(_0x442de6,null));};exports[_0x250c('0x50')]=function(_0x2d05d6,_0x1a56e8){var _0x512dd5={'raw':!![],'where':{'id':_0x2d05d6[_0x250c('0x51')]['id']}},_0x4b6886={};_0x4b6886[_0x250c('0x3f')]=_[_0x250c('0x52')](db[_0x250c('0x3b')][_0x250c('0x3c')]);_0x4b6886['query']=_['keys'](_0x2d05d6[_0x250c('0x40')]);_0x4b6886[_0x250c('0x41')]=_[_0x250c('0x42')](_0x4b6886[_0x250c('0x3f')],_0x4b6886[_0x250c('0x40')]);_0x512dd5[_0x250c('0x44')]=_[_0x250c('0x42')](_0x4b6886[_0x250c('0x3f')],qs[_0x250c('0x43')](_0x2d05d6[_0x250c('0x40')]['fields']));_0x512dd5[_0x250c('0x44')]=_0x512dd5['attributes'][_0x250c('0x53')]?_0x512dd5[_0x250c('0x44')]:_0x4b6886[_0x250c('0x3f')];if(_0x2d05d6[_0x250c('0x40')][_0x250c('0x4c')]){_0x512dd5['include']=[{'all':!![]}];}_0x512dd5=_[_0x250c('0x54')]({},_0x512dd5,_0x2d05d6[_0x250c('0x55')]);return db[_0x250c('0x3b')][_0x250c('0x56')](_0x512dd5)[_0x250c('0x32')](handleEntityNotFound(_0x1a56e8,null))[_0x250c('0x32')](respondWithResult(_0x1a56e8,null))[_0x250c('0x27')](handleError(_0x1a56e8,null));};exports[_0x250c('0x57')]=function(_0x4bfd34,_0x5549e5){return db[_0x250c('0x3b')][_0x250c('0x57')](_0x4bfd34[_0x250c('0x58')],{})[_0x250c('0x32')](function(_0x39fb27){var _0x385365=_0x4bfd34[_0x250c('0x59')][_0x250c('0x5a')]({'plain':!![]});if(!_0x385365)throw new Error(_0x250c('0x5b'));if(_0x385365['role']===_0x250c('0x59')){var _0x3441a8=_0x39fb27[_0x250c('0x5a')]({'plain':!![]});var _0x376f00='ChatQueues';return db[_0x250c('0x5c')]['find']({'where':{'name':_0x376f00,'userProfileId':_0x385365[_0x250c('0x5d')]},'raw':!![]})[_0x250c('0x32')](function(_0x4c59e5){if(_0x4c59e5&&_0x4c59e5[_0x250c('0x5e')]===0x0){return db[_0x250c('0x34')]['create']({'name':_0x3441a8[_0x250c('0x38')],'resourceId':_0x3441a8['id'],'type':_0x4c59e5[_0x250c('0x38')],'sectionId':_0x4c59e5['id']},{})[_0x250c('0x32')](function(){return _0x39fb27;});}else{return _0x39fb27;}})['catch'](function(_0x412217){logger[_0x250c('0x21')](_0x250c('0x5f'),_0x412217);throw _0x412217;});}return _0x39fb27;})[_0x250c('0x32')](respondWithResult(_0x5549e5,0xc9))[_0x250c('0x27')](handleError(_0x5549e5,null));};exports[_0x250c('0x60')]=function(_0x2fd085,_0x43872b){if(_0x2fd085[_0x250c('0x58')]['id']){delete _0x2fd085['body']['id'];}return db[_0x250c('0x3b')]['find']({'where':{'id':_0x2fd085[_0x250c('0x51')]['id']}})[_0x250c('0x32')](handleEntityNotFound(_0x43872b,null))[_0x250c('0x32')](saveUpdates(_0x2fd085[_0x250c('0x58')],null))['then'](respondWithResult(_0x43872b,null))[_0x250c('0x27')](handleError(_0x43872b,null));};exports[_0x250c('0x35')]=function(_0x3cddd2,_0x1d32ad){return db[_0x250c('0x3b')]['find']({'where':{'id':_0x3cddd2[_0x250c('0x51')]['id']}})[_0x250c('0x32')](handleEntityNotFound(_0x1d32ad,null))[_0x250c('0x32')](removeEntity(_0x1d32ad,null))[_0x250c('0x27')](handleError(_0x1d32ad,null));};exports[_0x250c('0x61')]=function(_0x2596b8,_0x4bc91a){return db[_0x250c('0x3b')][_0x250c('0x61')]()[_0x250c('0x32')](respondWithResult(_0x4bc91a,null))[_0x250c('0x27')](handleError(_0x4bc91a,null));};exports[_0x250c('0x62')]=function(_0x1b2976,_0x1cb3ac,_0x26bcbd){var _0x3f1b7a={'raw':!![],'where':{}},_0xc6569={},_0x2d8ddd;return db[_0x250c('0x3b')][_0x250c('0x63')]({'where':{'id':_0x1b2976['params']['id']}})['then'](handleEntityNotFound(_0x1cb3ac,null))[_0x250c('0x32')](function(_0x247f75){if(_0x247f75){_0x2d8ddd=_0x247f75[_0x250c('0x5a')]({'plain':!![]});_0xc6569[_0x250c('0x3f')]=_['keys'](db[_0x250c('0x64')][_0x250c('0x3c')]);_0xc6569['query']=_[_0x250c('0x52')](_0x1b2976[_0x250c('0x40')]);_0xc6569[_0x250c('0x41')]=_['intersection'](_0xc6569[_0x250c('0x3f')],_0xc6569[_0x250c('0x40')]);_0x3f1b7a['attributes']=_['intersection'](_0xc6569['model'],qs[_0x250c('0x43')](_0x1b2976[_0x250c('0x40')][_0x250c('0x43')]));_0x3f1b7a[_0x250c('0x44')]=_0x3f1b7a[_0x250c('0x44')][_0x250c('0x53')]?_0x3f1b7a[_0x250c('0x44')]:_0xc6569[_0x250c('0x3f')];if(!_0x1b2976['query'][_0x250c('0x45')](_0x250c('0x65'))){_0x3f1b7a[_0x250c('0x2d')]=qs[_0x250c('0x2d')](_0x1b2976['query'][_0x250c('0x2d')]);_0x3f1b7a['offset']=qs['offset'](_0x1b2976[_0x250c('0x40')]['offset']);}_0x3f1b7a['order']=qs['sort'](_0x1b2976['query'][_0x250c('0x47')]);_0x3f1b7a['where']=qs[_0x250c('0x41')](_[_0x250c('0x49')](_0x1b2976[_0x250c('0x40')],_0xc6569[_0x250c('0x41')]));_0x3f1b7a[_0x250c('0x48')]['ChatQueueId']=_0x247f75['id'];if(_0x1b2976[_0x250c('0x40')][_0x250c('0x4a')]){_0x3f1b7a['where']=_[_0x250c('0x54')](_0x3f1b7a[_0x250c('0x48')],{'$or':_['map'](_0x3f1b7a[_0x250c('0x44')],function(_0x3e479f){var _0x22e983={};_0x22e983[_0x3e479f]={'$like':'%'+_0x1b2976['query'][_0x250c('0x4a')]+'%'};return _0x22e983;})});}_0x3f1b7a=_[_0x250c('0x54')]({},_0x3f1b7a,_0x1b2976['options']);return db[_0x250c('0x64')][_0x250c('0x4e')](_0x3f1b7a);}})[_0x250c('0x32')](function(_0x1e8698){if(_0x1e8698){return db[_0x250c('0x66')][_0x250c('0x67')]({'where':{'id':_[_0x250c('0x3a')](_0x1e8698,_0x250c('0x68')),'role':_0x250c('0x69')},'attributes':['id','name','chatPause',_0x250c('0x6a'),_0x250c('0x6b')]});}})[_0x250c('0x32')](function(_0x14b892){if(_0x14b892){return{'count':_0x14b892[_0x250c('0x2e')],'rows':_[_0x250c('0x3a')](_0x14b892[_0x250c('0x4f')],function(_0x3d2574){return{'membername':_0x3d2574[_0x250c('0x38')],'UserId':_0x3d2574['id'],'queue_name':_0x2d8ddd[_0x250c('0x38')],'ChatQueueId':_0x2d8ddd['id'],'interface':util[_0x250c('0x6c')]('%s/%s',_0x250c('0x6d'),_0x3d2574['name']),'penalty':0x0,'paused':_0x3d2574[_0x250c('0x6e')],'createdAt':_0x3d2574[_0x250c('0x6b')],'updatedAt':_0x3d2574[_0x250c('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x250c('0x32')](respondWithFilteredResult(_0x1cb3ac,_0x3f1b7a))['catch'](handleError(_0x1cb3ac,null));};exports[_0x250c('0x6f')]=function(_0x43160d,_0x99aeef,_0x28a684){var _0x61a35={};var _0xf28a3b={};var _0x7bc1a6;var _0x302996;return db[_0x250c('0x3b')]['findOne']({'where':{'id':_0x43160d[_0x250c('0x51')]['id']}})[_0x250c('0x32')](handleEntityNotFound(_0x99aeef,null))['then'](function(_0x4b3687){if(_0x4b3687){_0x7bc1a6=_0x4b3687;_0xf28a3b[_0x250c('0x3f')]=_[_0x250c('0x52')](db[_0x250c('0x70')][_0x250c('0x3c')]);_0xf28a3b[_0x250c('0x40')]=_[_0x250c('0x52')](_0x43160d[_0x250c('0x40')]);_0xf28a3b['filters']=_[_0x250c('0x42')](_0xf28a3b['model'],_0xf28a3b[_0x250c('0x40')]);_0x61a35[_0x250c('0x44')]=_[_0x250c('0x42')](_0xf28a3b[_0x250c('0x3f')],qs[_0x250c('0x43')](_0x43160d[_0x250c('0x40')]['fields']));_0x61a35[_0x250c('0x44')]=_0x61a35[_0x250c('0x44')][_0x250c('0x53')]?_0x61a35[_0x250c('0x44')]:_0xf28a3b[_0x250c('0x3f')];_0x61a35[_0x250c('0x46')]=qs[_0x250c('0x47')](_0x43160d[_0x250c('0x40')][_0x250c('0x47')]);_0x61a35[_0x250c('0x48')]=qs['filters'](_[_0x250c('0x49')](_0x43160d[_0x250c('0x40')],_0xf28a3b[_0x250c('0x41')]));if(_0x43160d[_0x250c('0x40')][_0x250c('0x4a')]){_0x61a35[_0x250c('0x48')]=_['merge'](_0x61a35[_0x250c('0x48')],{'$or':_[_0x250c('0x3a')](_0x61a35['attributes'],function(_0x50feda){var _0x73b10={};_0x73b10[_0x50feda]={'$like':'%'+_0x43160d[_0x250c('0x40')]['filter']+'%'};return _0x73b10;})});}_0x61a35=_[_0x250c('0x54')]({},_0x61a35,_0x43160d[_0x250c('0x55')]);return _0x7bc1a6[_0x250c('0x6f')](_0x61a35);}})[_0x250c('0x32')](function(_0x52effa){if(_0x52effa){_0x302996=_0x52effa[_0x250c('0x53')];if(!_0x43160d['query'][_0x250c('0x45')](_0x250c('0x65'))){_0x61a35[_0x250c('0x2d')]=qs['limit'](_0x43160d[_0x250c('0x40')]['limit']);_0x61a35[_0x250c('0x2b')]=qs[_0x250c('0x2b')](_0x43160d[_0x250c('0x40')][_0x250c('0x2b')]);}return _0x7bc1a6['getTeams'](_0x61a35);}})[_0x250c('0x32')](function(_0x5a4131){if(_0x5a4131){return _0x5a4131?{'count':_0x302996,'rows':_0x5a4131}:null;}})[_0x250c('0x32')](respondWithResult(_0x99aeef,null))[_0x250c('0x27')](handleError(_0x99aeef,null));};exports[_0x250c('0x71')]=function(_0xd31f5,_0x353b93,_0x25017e){var _0x1b2052=_0xd31f5[_0x250c('0x58')][_0x250c('0x72')];return db[_0x250c('0x70')]['findAll']({'where':{'id':_0x1b2052},'attributes':['id'],'include':[{'model':db['User'],'as':_0x250c('0x73'),'attributes':['id',_0x250c('0x38'),_0x250c('0x74'),_0x250c('0x75'),'interface'],'raw':!![]}]})[_0x250c('0x32')](function(_0x30130a){if(_0x30130a){var _0x7c3a0c=_[_0x250c('0x76')](_0x30130a,function(_0x4d7402){var _0x2fd7a5=_0x4d7402['get']({'plain':!![]});return _0x2fd7a5[_0x250c('0x73')];});return db['ChatQueue'][_0x250c('0x56')]({'where':{'id':_0xd31f5[_0x250c('0x51')]['id']}})['then'](function(_0x259adb){return db[_0x250c('0x77')][_0x250c('0x78')](function(_0x1befbe){return _0x259adb[_0x250c('0x71')](_0x1b2052,{'transaction':_0x1befbe})[_0x250c('0x32')](function(){return BPromise[_0x250c('0x79')](_0x7c3a0c,function(_0x4d9ae0){return db[_0x250c('0x64')][_0x250c('0x7a')]({'where':{'UserId':_0x4d9ae0['id'],'ChatQueueId':_0xd31f5['params']['id']},'transaction':_0x1befbe});});})[_0x250c('0x32')](function(){_0x7c3a0c[_0x250c('0x7b')](function(_0x5b46be){socket[_0x250c('0x7c')](_0x250c('0x7d'),{'UserId':_0x5b46be['id'],'ChatQueueId':_0x259adb['id']});});});});});}})[_0x250c('0x32')](respondWithStatusCode(_0x353b93,null))['catch'](handleError(_0x353b93,null));};exports[_0x250c('0x7e')]=function(_0x53d06d,_0x474be3,_0x1f517c){return db[_0x250c('0x70')][_0x250c('0x4e')]({'where':{'id':_0x53d06d[_0x250c('0x40')]['ids']},'attributes':['id'],'include':[{'model':db[_0x250c('0x66')],'as':_0x250c('0x73'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x474be3,null))[_0x250c('0x32')](function(_0x3dcfb3){var _0x118712=_['map'](_0x3dcfb3,'id');var _0x5065f0=[];var _0x48d631=[];var _0x3cc2ae=squel['select']();_0x3cc2ae[_0x250c('0x7f')](_0x250c('0x80'))['from']('team_has_chat_queues','tq')[_0x250c('0x81')](_0x250c('0x82'),'ut',_0x250c('0x83'))[_0x250c('0x48')]('ChatQueueId\x20=\x20?',_0x53d06d[_0x250c('0x51')]['id']);for(var _0x1d974d=0x0;_0x1d974d<_0x3dcfb3[_0x250c('0x53')];_0x1d974d+=0x1){let _0x140fa1=_0x3dcfb3[_0x1d974d];for(var _0x35855d=0x0;_0x35855d<_0x140fa1[_0x250c('0x73')][_0x250c('0x53')];_0x35855d+=0x1){let _0x572408=_0x140fa1[_0x250c('0x73')][_0x35855d];var _0x2c9c10=_0x3cc2ae[_0x250c('0x84')]();_0x2c9c10[_0x250c('0x48')]('ut.UserId\x20=\x20?',_0x572408['id']);_0x48d631['push'](db['sequelize'][_0x250c('0x40')](_0x2c9c10[_0x250c('0x85')](),{'type':db['sequelize']['QueryTypes'][_0x250c('0x86')]})['then'](function(_0x2a30c9){if(_0x2a30c9[_0x250c('0x53')]===0x1){return _0x572408['id'];}else{var _0x5e7274=_[_0x250c('0x87')](_['map'](_0x2a30c9,_0x250c('0x88')),function(_0x53d14f){return _[_0x250c('0x89')](_0x118712,_0x53d14f);});if(_0x5e7274){return _0x572408['id'];}}}));}}return BPromise[_0x250c('0x8a')](_0x48d631)[_0x250c('0x32')](function(_0x25220f){_0x5065f0=_(_0x5065f0)[_0x250c('0x8b')](_0x25220f)['compact']()['value']();return db[_0x250c('0x3b')][_0x250c('0x56')]({'where':{'id':_0x53d06d['params']['id']}})[_0x250c('0x32')](function(_0x4b9e34){return db[_0x250c('0x77')][_0x250c('0x78')](function(_0xd9e69f){return _0x4b9e34[_0x250c('0x7e')](_0x53d06d[_0x250c('0x40')][_0x250c('0x72')],{'transaction':_0xd9e69f})[_0x250c('0x32')](function(){if(!_[_0x250c('0x8c')](_0x5065f0)){return _0x4b9e34[_0x250c('0x8d')](_0x5065f0,{'transaction':_0xd9e69f});}})['then'](function(){_0x5065f0[_0x250c('0x7b')](function(_0x37c10d){socket['emit'](_0x250c('0x8e'),{'UserId':_0x37c10d,'ChatQueueId':_0x4b9e34['id']});});});});});});})[_0x250c('0x32')](respondWithStatusCode(_0x474be3,null))[_0x250c('0x27')](handleError(_0x474be3,null));};exports['addAgents']=function(_0x4f8fcd,_0x4bcc6f,_0x42253f){return db['ChatQueue'][_0x250c('0x56')]({'where':{'id':_0x4f8fcd[_0x250c('0x51')]['id']}})[_0x250c('0x32')](handleEntityNotFound(_0x4bcc6f,null))[_0x250c('0x32')](function(_0x2a1604){if(_0x2a1604){return _0x2a1604['addAgents'](_0x4f8fcd[_0x250c('0x58')]['ids'],_[_0x250c('0x8f')](_0x4f8fcd[_0x250c('0x58')],[_0x250c('0x72'),'id'])||{})[_0x250c('0x90')](function(_0x128f27){for(var _0x564e8f=0x0;_0x564e8f<_0x4f8fcd[_0x250c('0x58')][_0x250c('0x72')][_0x250c('0x53')];_0x564e8f+=0x1){socket[_0x250c('0x7c')]('userChatQueue:save',{'UserId':Number(_0x4f8fcd[_0x250c('0x58')][_0x250c('0x72')][_0x564e8f]),'ChatQueueId':Number(_0x4f8fcd[_0x250c('0x51')]['id'])});}return _0x128f27;});}})[_0x250c('0x32')](respondWithResult(_0x4bcc6f,null))[_0x250c('0x27')](handleError(_0x4bcc6f,null));};exports[_0x250c('0x8d')]=function(_0x1249a7,_0x27c807,_0x20f128){return db[_0x250c('0x3b')][_0x250c('0x56')]({'where':{'id':_0x1249a7[_0x250c('0x51')]['id']}})['then'](handleEntityNotFound(_0x27c807,null))['then'](function(_0x2632ae){if(_0x2632ae){return _0x2632ae[_0x250c('0x8d')](_0x1249a7['query'][_0x250c('0x72')])[_0x250c('0x32')](function(){if(_[_0x250c('0x91')](_0x1249a7[_0x250c('0x40')][_0x250c('0x72')])){for(var _0x1e3d0b=0x0;_0x1e3d0b<_0x1249a7[_0x250c('0x40')]['ids']['length'];_0x1e3d0b+=0x1){socket[_0x250c('0x7c')]('userChatQueue:remove',{'UserId':Number(_0x1249a7[_0x250c('0x40')][_0x250c('0x72')][_0x1e3d0b]),'ChatQueueId':Number(_0x1249a7[_0x250c('0x51')]['id'])});}}else{socket[_0x250c('0x7c')](_0x250c('0x8e'),{'UserId':Number(_0x1249a7['query']['ids']),'ChatQueueId':Number(_0x1249a7[_0x250c('0x51')]['id'])});}});}})[_0x250c('0x32')](respondWithStatusCode(_0x27c807,null))[_0x250c('0x27')](handleError(_0x27c807,null));};exports['getAgents']=function(_0x115164,_0x27e479,_0x16ef29){var _0x20027f={};var _0x2c3470={};var _0x23d101;var _0x1299e4;return db[_0x250c('0x3b')][_0x250c('0x63')]({'where':{'id':_0x115164['params']['id']}})['then'](handleEntityNotFound(_0x27e479,null))[_0x250c('0x32')](function(_0x1ee55d){if(_0x1ee55d){_0x23d101=_0x1ee55d;_0x2c3470[_0x250c('0x3f')]=_[_0x250c('0x52')](db[_0x250c('0x66')][_0x250c('0x3c')]);_0x2c3470[_0x250c('0x40')]=_[_0x250c('0x52')](_0x115164[_0x250c('0x40')]);_0x2c3470[_0x250c('0x41')]=_[_0x250c('0x42')](_0x2c3470[_0x250c('0x3f')],_0x2c3470[_0x250c('0x40')]);_0x20027f[_0x250c('0x44')]=_['intersection'](_0x2c3470[_0x250c('0x3f')],qs[_0x250c('0x43')](_0x115164[_0x250c('0x40')]['fields']));_0x20027f['attributes']=_0x20027f[_0x250c('0x44')][_0x250c('0x53')]?_0x20027f[_0x250c('0x44')]:_0x2c3470[_0x250c('0x3f')];_0x20027f[_0x250c('0x46')]=qs[_0x250c('0x47')](_0x115164[_0x250c('0x40')][_0x250c('0x47')]);_0x20027f[_0x250c('0x48')]=qs[_0x250c('0x41')](_['pick'](_0x115164['query'],_0x2c3470[_0x250c('0x41')]));if(_0x115164[_0x250c('0x40')]['filter']){_0x20027f[_0x250c('0x48')]=_['merge'](_0x20027f[_0x250c('0x48')],{'$or':_[_0x250c('0x3a')](_0x20027f[_0x250c('0x44')],function(_0x1bf9f0){var _0x49e578={};_0x49e578[_0x1bf9f0]={'$like':'%'+_0x115164[_0x250c('0x40')][_0x250c('0x4a')]+'%'};return _0x49e578;})});}_0x20027f=_[_0x250c('0x54')]({},_0x20027f,_0x115164[_0x250c('0x55')]);return _0x23d101['getAgents'](_0x20027f);}})['then'](function(_0x4c60b2){if(_0x4c60b2){_0x1299e4=_0x4c60b2[_0x250c('0x53')];if(!_0x115164[_0x250c('0x40')]['hasOwnProperty'](_0x250c('0x65'))){_0x20027f[_0x250c('0x2d')]=qs['limit'](_0x115164[_0x250c('0x40')][_0x250c('0x2d')]);_0x20027f[_0x250c('0x2b')]=qs[_0x250c('0x2b')](_0x115164[_0x250c('0x40')][_0x250c('0x2b')]);}return _0x23d101[_0x250c('0x92')](_0x20027f);}})['then'](function(_0xe39f25){if(_0xe39f25){return _0xe39f25?{'count':_0x1299e4,'rows':_0xe39f25}:null;}})['then'](respondWithResult(_0x27e479,null))[_0x250c('0x27')](handleError(_0x27e479,null));};
\ No newline at end of file
+var _0x762e=['localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','includeAll','include','findAll','show','params','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','autoAssociation','update','describe','getMembers','order','pick','UserChatQueue','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','addTeams','Team','User','Agents','voicePause','flatMap','sequelize','each','forEach','emit','removeTeams','ids','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','includes','all','union','compact','value','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','findOne','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0x3a6a37,_0x136baf){var _0x17c7e1=function(_0x1afebe){while(--_0x1afebe){_0x3a6a37['push'](_0x3a6a37['shift']());}};_0x17c7e1(++_0x136baf);}(_0x762e,0x11a));var _0xe762=function(_0x28b5e9,_0x4b442f){_0x28b5e9=_0x28b5e9-0x0;var _0x23e6a4=_0x762e[_0x28b5e9];return _0x23e6a4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe762('0x0'));var zipdir=require(_0xe762('0x1'));var jsonpatch=require(_0xe762('0x2'));var rp=require('request-promise');var moment=require(_0xe762('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe762('0x4'));var util=require(_0xe762('0x5'));var path=require('path');var sox=require(_0xe762('0x6'));var csv=require(_0xe762('0x7'));var ejs=require(_0xe762('0x8'));var fs=require('fs');var fs_extra=require(_0xe762('0x9'));var _=require(_0xe762('0xa'));var squel=require(_0xe762('0xb'));var crypto=require(_0xe762('0xc'));var jsforce=require(_0xe762('0xd'));var deskjs=require(_0xe762('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe762('0xf'));var Papa=require('papaparse');var Redis=require(_0xe762('0x10'));var authService=require(_0xe762('0x11'));var qs=require(_0xe762('0x12'));var as=require(_0xe762('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe762('0x14'))(_0xe762('0x15'));var utils=require(_0xe762('0x16'));var config=require(_0xe762('0x17'));var licenseUtil=require(_0xe762('0x18'));var db=require(_0xe762('0x19'))['db'];config[_0xe762('0x1a')]=_[_0xe762('0x1b')](config[_0xe762('0x1a')],{'host':_0xe762('0x1c'),'port':0x18eb});var socket=require(_0xe762('0x1d'))(new Redis(config[_0xe762('0x1a')]));require(_0xe762('0x1e'))[_0xe762('0x1f')](socket);var jayson=require(_0xe762('0x20'));var client=jayson[_0xe762('0x21')][_0xe762('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x575d40,_0x25c862,_0x459e28,_0x125239){return new BPromise(function(_0x65098,_0x274cdb){var _0x34f3bc=_0x125239||client;return _0x34f3bc[_0xe762('0x23')](_0x575d40,_0x459e28)[_0xe762('0x24')](function(_0x51ef17){logger['info']('ChatQueue,\x20%s,\x20%s',_0x25c862,_0xe762('0x25'));logger[_0xe762('0x26')](_0xe762('0x27'),_0x25c862,_0xe762('0x25'),JSON[_0xe762('0x28')](_0x51ef17));if(_0x51ef17['error']){if(_0x51ef17[_0xe762('0x29')][_0xe762('0x2a')]===0x1f4){logger[_0xe762('0x29')](_0xe762('0x2b'),_0x25c862,_0x51ef17['error'][_0xe762('0x2c')]);return _0x274cdb(_0x51ef17['error'][_0xe762('0x2c')]);}logger[_0xe762('0x29')](_0xe762('0x2b'),_0x25c862,_0x51ef17['error'][_0xe762('0x2c')]);return _0x65098(_0x51ef17['error']['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x25c862,_0xe762('0x25'));_0x65098(_0x51ef17[_0xe762('0x2d')][_0xe762('0x2c')]);}})[_0xe762('0x2e')](function(_0x4f44ae){logger[_0xe762('0x29')](_0xe762('0x2b'),_0x25c862,_0x4f44ae);_0x274cdb(_0x4f44ae);});});}function respondWithStatusCode(_0x4db0d9,_0x19b084){_0x19b084=_0x19b084||0xcc;return function(_0x5d8b6d){if(_0x5d8b6d){return _0x4db0d9[_0xe762('0x2f')](_0x19b084);}return _0x4db0d9[_0xe762('0x30')](_0x19b084)[_0xe762('0x31')]();};}function respondWithResult(_0x4cd4ad,_0x1f349f){_0x1f349f=_0x1f349f||0xc8;return function(_0x3b5f71){if(_0x3b5f71){return _0x4cd4ad[_0xe762('0x30')](_0x1f349f)[_0xe762('0x32')](_0x3b5f71);}};}function respondWithFilteredResult(_0x3397e0,_0xc1bc78){return function(_0x9238eb){if(_0x9238eb){var _0x45bb50=typeof _0xc1bc78[_0xe762('0x33')]===_0xe762('0x34')&&typeof _0xc1bc78[_0xe762('0x35')]===_0xe762('0x34');var _0x5bcaed=_0x9238eb[_0xe762('0x36')];var _0x1892c3=_0x45bb50?0x0:_0xc1bc78['offset'];var _0x45f607=_0x45bb50?_0x9238eb[_0xe762('0x36')]:_0xc1bc78['offset']+_0xc1bc78[_0xe762('0x35')];var _0x5cd2b8;if(_0x45f607>=_0x5bcaed){_0x45f607=_0x5bcaed;_0x5cd2b8=0xc8;}else{_0x5cd2b8=0xce;}_0x3397e0[_0xe762('0x30')](_0x5cd2b8);return _0x3397e0['set']('Content-Range',_0x1892c3+'-'+_0x45f607+'/'+_0x5bcaed)[_0xe762('0x32')](_0x9238eb);}return null;};}function patchUpdates(_0x153910){return function(_0xfabf63){try{jsonpatch[_0xe762('0x37')](_0xfabf63,_0x153910,!![]);}catch(_0x4e977f){return BPromise['reject'](_0x4e977f);}return _0xfabf63[_0xe762('0x38')]();};}function saveUpdates(_0x2809e5,_0x2a4481){return function(_0x223952){if(_0x223952){return _0x223952['update'](_0x2809e5)[_0xe762('0x24')](function(_0x3bbeee){return _0x3bbeee;});}return null;};}function removeEntity(_0x56312b,_0x66b31b){return function(_0x349acb){if(_0x349acb){return _0x349acb[_0xe762('0x39')]()[_0xe762('0x24')](function(){var _0x121720=_0x349acb[_0xe762('0x3a')]({'plain':!![]});var _0x5b86a1=_0xe762('0x3b');return db[_0xe762('0x3c')]['destroy']({'where':{'type':_0x5b86a1,'resourceId':_0x121720['id']}})['then'](function(){return _0x349acb;});})['then'](function(){_0x56312b[_0xe762('0x30')](0xcc)[_0xe762('0x31')]();});}};}function handleEntityNotFound(_0x46a6db,_0x527bc6){return function(_0x2bd6b5){if(!_0x2bd6b5){_0x46a6db[_0xe762('0x2f')](0x194);}return _0x2bd6b5;};}function handleError(_0x4bfd96,_0x3acd50){_0x3acd50=_0x3acd50||0x1f4;return function(_0x2c3922){logger[_0xe762('0x29')](_0x2c3922[_0xe762('0x3d')]);if(_0x2c3922[_0xe762('0x3e')]){delete _0x2c3922[_0xe762('0x3e')];}_0x4bfd96[_0xe762('0x30')](_0x3acd50)[_0xe762('0x3f')](_0x2c3922);};}exports[_0xe762('0x40')]=function(_0x436c88,_0x5e2a33){var _0x12138c={},_0x3362f4={},_0x4147f0={'count':0x0,'rows':[]};var _0x1220b1=_[_0xe762('0x41')](db[_0xe762('0x42')][_0xe762('0x43')],function(_0x69fed7){return{'name':_0x69fed7[_0xe762('0x44')],'type':_0x69fed7['type'][_0xe762('0x45')]};});_0x3362f4[_0xe762('0x46')]=_[_0xe762('0x41')](_0x1220b1,_0xe762('0x3e'));_0x3362f4[_0xe762('0x47')]=_[_0xe762('0x48')](_0x436c88[_0xe762('0x47')]);_0x3362f4['filters']=_[_0xe762('0x49')](_0x3362f4['model'],_0x3362f4[_0xe762('0x47')]);_0x12138c[_0xe762('0x4a')]=_['intersection'](_0x3362f4[_0xe762('0x46')],qs[_0xe762('0x4b')](_0x436c88['query'][_0xe762('0x4b')]));_0x12138c[_0xe762('0x4a')]=_0x12138c[_0xe762('0x4a')]['length']?_0x12138c[_0xe762('0x4a')]:_0x3362f4['model'];if(!_0x436c88[_0xe762('0x47')][_0xe762('0x4c')](_0xe762('0x4d'))){_0x12138c[_0xe762('0x35')]=qs[_0xe762('0x35')](_0x436c88[_0xe762('0x47')][_0xe762('0x35')]);_0x12138c[_0xe762('0x33')]=qs[_0xe762('0x33')](_0x436c88[_0xe762('0x47')]['offset']);}_0x12138c['order']=qs[_0xe762('0x4e')](_0x436c88[_0xe762('0x47')][_0xe762('0x4e')]);_0x12138c[_0xe762('0x4f')]=qs['filters'](_['pick'](_0x436c88['query'],_0x3362f4[_0xe762('0x50')]),_0x1220b1);if(_0x436c88[_0xe762('0x47')][_0xe762('0x51')]){_0x12138c[_0xe762('0x4f')]=_[_0xe762('0x52')](_0x12138c[_0xe762('0x4f')],{'$or':_[_0xe762('0x41')](_0x1220b1,function(_0x1859e5){if(_0x1859e5[_0xe762('0x53')]!==_0xe762('0x54')){var _0x3925e6={};_0x3925e6[_0x1859e5[_0xe762('0x3e')]]={'$like':'%'+_0x436c88[_0xe762('0x47')][_0xe762('0x51')]+'%'};return _0x3925e6;}})});}_0x12138c=_[_0xe762('0x52')]({},_0x12138c,_0x436c88['options']);var _0x26168b={'where':_0x12138c[_0xe762('0x4f')]};return db[_0xe762('0x42')][_0xe762('0x36')](_0x26168b)[_0xe762('0x24')](function(_0x5b9ee3){_0x4147f0[_0xe762('0x36')]=_0x5b9ee3;if(_0x436c88['query'][_0xe762('0x55')]){_0x12138c[_0xe762('0x56')]=[{'all':!![]}];}return db[_0xe762('0x42')][_0xe762('0x57')](_0x12138c);})[_0xe762('0x24')](function(_0x55c272){_0x4147f0['rows']=_0x55c272;return _0x4147f0;})['then'](respondWithFilteredResult(_0x5e2a33,_0x12138c))[_0xe762('0x2e')](handleError(_0x5e2a33,null));};exports[_0xe762('0x58')]=function(_0x4bfe03,_0x4f2dcf){var _0x1f5f18={'raw':!![],'where':{'id':_0x4bfe03[_0xe762('0x59')]['id']}},_0x2fa0f1={};_0x2fa0f1[_0xe762('0x46')]=_[_0xe762('0x48')](db[_0xe762('0x42')][_0xe762('0x43')]);_0x2fa0f1[_0xe762('0x47')]=_[_0xe762('0x48')](_0x4bfe03['query']);_0x2fa0f1[_0xe762('0x50')]=_[_0xe762('0x49')](_0x2fa0f1[_0xe762('0x46')],_0x2fa0f1[_0xe762('0x47')]);_0x1f5f18['attributes']=_['intersection'](_0x2fa0f1[_0xe762('0x46')],qs[_0xe762('0x4b')](_0x4bfe03[_0xe762('0x47')][_0xe762('0x4b')]));_0x1f5f18[_0xe762('0x4a')]=_0x1f5f18['attributes'][_0xe762('0x5a')]?_0x1f5f18[_0xe762('0x4a')]:_0x2fa0f1[_0xe762('0x46')];if(_0x4bfe03['query'][_0xe762('0x55')]){_0x1f5f18['include']=[{'all':!![]}];}_0x1f5f18=_[_0xe762('0x52')]({},_0x1f5f18,_0x4bfe03[_0xe762('0x5b')]);return db[_0xe762('0x42')]['find'](_0x1f5f18)['then'](handleEntityNotFound(_0x4f2dcf,null))[_0xe762('0x24')](respondWithResult(_0x4f2dcf,null))[_0xe762('0x2e')](handleError(_0x4f2dcf,null));};exports['create']=function(_0x385949,_0x25b422){return db[_0xe762('0x42')][_0xe762('0x5c')](_0x385949[_0xe762('0x5d')],{})[_0xe762('0x24')](function(_0x15fc52){var _0xb197e1=_0x385949[_0xe762('0x5e')][_0xe762('0x3a')]({'plain':!![]});if(!_0xb197e1)throw new Error(_0xe762('0x5f'));if(_0xb197e1['role']===_0xe762('0x5e')){var _0x9a4341=_0x15fc52['get']({'plain':!![]});var _0x41b963=_0xe762('0x3b');return db['UserProfileSection'][_0xe762('0x60')]({'where':{'name':_0x41b963,'userProfileId':_0xb197e1['userProfileId']},'raw':!![]})['then'](function(_0x12ad16){if(_0x12ad16&&_0x12ad16[_0xe762('0x61')]===0x0){return db[_0xe762('0x3c')][_0xe762('0x5c')]({'name':_0x9a4341[_0xe762('0x3e')],'resourceId':_0x9a4341['id'],'type':_0x12ad16['name'],'sectionId':_0x12ad16['id']},{})['then'](function(){return _0x15fc52;});}else{return _0x15fc52;}})['catch'](function(_0x106a67){logger[_0xe762('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x106a67);throw _0x106a67;});}return _0x15fc52;})[_0xe762('0x24')](respondWithResult(_0x25b422,0xc9))['catch'](handleError(_0x25b422,null));};exports[_0xe762('0x62')]=function(_0x2e7614,_0x579709){if(_0x2e7614[_0xe762('0x5d')]['id']){delete _0x2e7614[_0xe762('0x5d')]['id'];}return db[_0xe762('0x42')][_0xe762('0x60')]({'where':{'id':_0x2e7614[_0xe762('0x59')]['id']}})[_0xe762('0x24')](handleEntityNotFound(_0x579709,null))[_0xe762('0x24')](saveUpdates(_0x2e7614[_0xe762('0x5d')],null))[_0xe762('0x24')](respondWithResult(_0x579709,null))['catch'](handleError(_0x579709,null));};exports['destroy']=function(_0xfe1e74,_0x61f3ae){return db[_0xe762('0x42')][_0xe762('0x60')]({'where':{'id':_0xfe1e74[_0xe762('0x59')]['id']}})[_0xe762('0x24')](handleEntityNotFound(_0x61f3ae,null))['then'](removeEntity(_0x61f3ae,null))['catch'](handleError(_0x61f3ae,null));};exports[_0xe762('0x63')]=function(_0x3f7b3a,_0x1e4cf0){return db[_0xe762('0x42')][_0xe762('0x63')]()[_0xe762('0x24')](respondWithResult(_0x1e4cf0,null))['catch'](handleError(_0x1e4cf0,null));};exports[_0xe762('0x64')]=function(_0x34237f,_0x82a19f,_0x510cc1){var _0x10507c={'raw':!![],'where':{}},_0x48b39b={},_0x31d250;return db[_0xe762('0x42')]['findOne']({'where':{'id':_0x34237f[_0xe762('0x59')]['id']}})[_0xe762('0x24')](handleEntityNotFound(_0x82a19f,null))['then'](function(_0x56c92b){if(_0x56c92b){_0x31d250=_0x56c92b[_0xe762('0x3a')]({'plain':!![]});_0x48b39b['model']=_[_0xe762('0x48')](db['UserChatQueue'][_0xe762('0x43')]);_0x48b39b['query']=_[_0xe762('0x48')](_0x34237f[_0xe762('0x47')]);_0x48b39b[_0xe762('0x50')]=_[_0xe762('0x49')](_0x48b39b[_0xe762('0x46')],_0x48b39b[_0xe762('0x47')]);_0x10507c['attributes']=_[_0xe762('0x49')](_0x48b39b[_0xe762('0x46')],qs['fields'](_0x34237f['query']['fields']));_0x10507c['attributes']=_0x10507c[_0xe762('0x4a')][_0xe762('0x5a')]?_0x10507c['attributes']:_0x48b39b['model'];if(!_0x34237f[_0xe762('0x47')]['hasOwnProperty'](_0xe762('0x4d'))){_0x10507c[_0xe762('0x35')]=qs['limit'](_0x34237f[_0xe762('0x47')][_0xe762('0x35')]);_0x10507c['offset']=qs[_0xe762('0x33')](_0x34237f[_0xe762('0x47')][_0xe762('0x33')]);}_0x10507c[_0xe762('0x65')]=qs[_0xe762('0x4e')](_0x34237f[_0xe762('0x47')]['sort']);_0x10507c[_0xe762('0x4f')]=qs[_0xe762('0x50')](_[_0xe762('0x66')](_0x34237f[_0xe762('0x47')],_0x48b39b[_0xe762('0x50')]));_0x10507c[_0xe762('0x4f')]['ChatQueueId']=_0x56c92b['id'];if(_0x34237f['query'][_0xe762('0x51')]){_0x10507c['where']=_[_0xe762('0x52')](_0x10507c[_0xe762('0x4f')],{'$or':_[_0xe762('0x41')](_0x10507c[_0xe762('0x4a')],function(_0x528cc8){var _0xae3c55={};_0xae3c55[_0x528cc8]={'$like':'%'+_0x34237f['query'][_0xe762('0x51')]+'%'};return _0xae3c55;})});}_0x10507c=_[_0xe762('0x52')]({},_0x10507c,_0x34237f[_0xe762('0x5b')]);return db[_0xe762('0x67')][_0xe762('0x57')](_0x10507c);}})[_0xe762('0x24')](function(_0x386679){if(_0x386679){return db['User'][_0xe762('0x68')]({'where':{'id':_['map'](_0x386679,_0xe762('0x69')),'role':_0xe762('0x6a')},'attributes':['id',_0xe762('0x3e'),_0xe762('0x6b'),_0xe762('0x6c'),_0xe762('0x6d')]});}})['then'](function(_0x37cbcc){if(_0x37cbcc){return{'count':_0x37cbcc['count'],'rows':_[_0xe762('0x41')](_0x37cbcc[_0xe762('0x6e')],function(_0x4de74c){return{'membername':_0x4de74c[_0xe762('0x3e')],'UserId':_0x4de74c['id'],'queue_name':_0x31d250[_0xe762('0x3e')],'ChatQueueId':_0x31d250['id'],'interface':util[_0xe762('0x6f')](_0xe762('0x70'),_0xe762('0x71'),_0x4de74c[_0xe762('0x3e')]),'penalty':0x0,'paused':_0x4de74c[_0xe762('0x6b')],'createdAt':_0x4de74c[_0xe762('0x6d')],'updatedAt':_0x4de74c[_0xe762('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe762('0x24')](respondWithFilteredResult(_0x82a19f,_0x10507c))[_0xe762('0x2e')](handleError(_0x82a19f,null));};exports['getTeams']=function(_0x59d0b3,_0x7ccc31,_0x4457c9){var _0x2c8878={};var _0x6583f6={};var _0x288f9e;var _0x312e64;return db[_0xe762('0x42')]['findOne']({'where':{'id':_0x59d0b3[_0xe762('0x59')]['id']}})['then'](handleEntityNotFound(_0x7ccc31,null))['then'](function(_0x5a369c){if(_0x5a369c){_0x288f9e=_0x5a369c;_0x6583f6[_0xe762('0x46')]=_[_0xe762('0x48')](db['Team'][_0xe762('0x43')]);_0x6583f6[_0xe762('0x47')]=_[_0xe762('0x48')](_0x59d0b3['query']);_0x6583f6[_0xe762('0x50')]=_[_0xe762('0x49')](_0x6583f6[_0xe762('0x46')],_0x6583f6[_0xe762('0x47')]);_0x2c8878['attributes']=_[_0xe762('0x49')](_0x6583f6['model'],qs[_0xe762('0x4b')](_0x59d0b3[_0xe762('0x47')]['fields']));_0x2c8878['attributes']=_0x2c8878[_0xe762('0x4a')][_0xe762('0x5a')]?_0x2c8878[_0xe762('0x4a')]:_0x6583f6[_0xe762('0x46')];_0x2c8878[_0xe762('0x65')]=qs[_0xe762('0x4e')](_0x59d0b3['query'][_0xe762('0x4e')]);_0x2c8878[_0xe762('0x4f')]=qs[_0xe762('0x50')](_[_0xe762('0x66')](_0x59d0b3[_0xe762('0x47')],_0x6583f6[_0xe762('0x50')]));if(_0x59d0b3['query'][_0xe762('0x51')]){_0x2c8878[_0xe762('0x4f')]=_['merge'](_0x2c8878['where'],{'$or':_[_0xe762('0x41')](_0x2c8878['attributes'],function(_0x14c3fd){var _0x147c4f={};_0x147c4f[_0x14c3fd]={'$like':'%'+_0x59d0b3[_0xe762('0x47')][_0xe762('0x51')]+'%'};return _0x147c4f;})});}_0x2c8878=_[_0xe762('0x52')]({},_0x2c8878,_0x59d0b3['options']);return _0x288f9e[_0xe762('0x72')](_0x2c8878);}})['then'](function(_0x307d9f){if(_0x307d9f){_0x312e64=_0x307d9f[_0xe762('0x5a')];if(!_0x59d0b3['query']['hasOwnProperty'](_0xe762('0x4d'))){_0x2c8878[_0xe762('0x35')]=qs[_0xe762('0x35')](_0x59d0b3[_0xe762('0x47')][_0xe762('0x35')]);_0x2c8878[_0xe762('0x33')]=qs[_0xe762('0x33')](_0x59d0b3[_0xe762('0x47')][_0xe762('0x33')]);}return _0x288f9e['getTeams'](_0x2c8878);}})[_0xe762('0x24')](function(_0xf6790f){if(_0xf6790f){return _0xf6790f?{'count':_0x312e64,'rows':_0xf6790f}:null;}})['then'](respondWithResult(_0x7ccc31,null))[_0xe762('0x2e')](handleError(_0x7ccc31,null));};exports[_0xe762('0x73')]=function(_0x4a566e,_0x1a3e99,_0x1cfd6e){var _0x3ab5ed=_0x4a566e[_0xe762('0x5d')]['ids'];return db[_0xe762('0x74')][_0xe762('0x57')]({'where':{'id':_0x3ab5ed},'attributes':['id'],'include':[{'model':db[_0xe762('0x75')],'as':_0xe762('0x76'),'attributes':['id',_0xe762('0x3e'),'online',_0xe762('0x77'),'interface'],'raw':!![]}]})[_0xe762('0x24')](function(_0x4cd22f){if(_0x4cd22f){var _0x44a731=_[_0xe762('0x78')](_0x4cd22f,function(_0x159c47){var _0x28292d=_0x159c47[_0xe762('0x3a')]({'plain':!![]});return _0x28292d['Agents'];});return db[_0xe762('0x42')]['find']({'where':{'id':_0x4a566e[_0xe762('0x59')]['id']}})[_0xe762('0x24')](function(_0x30acf3){return db[_0xe762('0x79')]['transaction'](function(_0x323f76){return _0x30acf3[_0xe762('0x73')](_0x3ab5ed,{'transaction':_0x323f76})[_0xe762('0x24')](function(){return BPromise[_0xe762('0x7a')](_0x44a731,function(_0x1ff6b8){return db[_0xe762('0x67')]['findOrCreate']({'where':{'UserId':_0x1ff6b8['id'],'ChatQueueId':_0x4a566e['params']['id']},'transaction':_0x323f76});});})[_0xe762('0x24')](function(){_0x44a731[_0xe762('0x7b')](function(_0x2619e8){socket[_0xe762('0x7c')]('userChatQueue:save',{'UserId':_0x2619e8['id'],'ChatQueueId':_0x30acf3['id']});});});});});}})['then'](respondWithStatusCode(_0x1a3e99,null))[_0xe762('0x2e')](handleError(_0x1a3e99,null));};exports[_0xe762('0x7d')]=function(_0x147200,_0x4d4f7b,_0xbbf374){return db[_0xe762('0x74')]['findAll']({'where':{'id':_0x147200[_0xe762('0x47')][_0xe762('0x7e')]},'attributes':['id'],'include':[{'model':db[_0xe762('0x75')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4d4f7b,null))[_0xe762('0x24')](function(_0x5cf827){var _0x4f8be4=_[_0xe762('0x41')](_0x5cf827,'id');var _0x60207e=[];var _0x5dfed8=[];var _0x1f813e=squel[_0xe762('0x7f')]();_0x1f813e[_0xe762('0x80')](_0xe762('0x81'))['from'](_0xe762('0x82'),'tq')[_0xe762('0x83')](_0xe762('0x84'),'ut',_0xe762('0x85'))[_0xe762('0x4f')](_0xe762('0x86'),_0x147200[_0xe762('0x59')]['id']);for(var _0x37288a=0x0;_0x37288a<_0x5cf827[_0xe762('0x5a')];_0x37288a+=0x1){let _0x54c418=_0x5cf827[_0x37288a];for(var _0x3624ee=0x0;_0x3624ee<_0x54c418[_0xe762('0x76')][_0xe762('0x5a')];_0x3624ee+=0x1){let _0x1369f3=_0x54c418[_0xe762('0x76')][_0x3624ee];var _0x22cdf5=_0x1f813e[_0xe762('0x87')]();_0x22cdf5[_0xe762('0x4f')](_0xe762('0x88'),_0x1369f3['id']);_0x5dfed8[_0xe762('0x89')](db[_0xe762('0x79')][_0xe762('0x47')](_0x22cdf5[_0xe762('0x8a')](),{'type':db[_0xe762('0x79')]['QueryTypes'][_0xe762('0x8b')]})[_0xe762('0x24')](function(_0x2d7d72){if(_0x2d7d72[_0xe762('0x5a')]===0x1){return _0x1369f3['id'];}else{var _0x18d408=_[_0xe762('0x8c')](_[_0xe762('0x41')](_0x2d7d72,'TeamId'),function(_0x56eef8){return _[_0xe762('0x8d')](_0x4f8be4,_0x56eef8);});if(_0x18d408){return _0x1369f3['id'];}}}));}}return BPromise[_0xe762('0x8e')](_0x5dfed8)[_0xe762('0x24')](function(_0x4fc449){_0x60207e=_(_0x60207e)[_0xe762('0x8f')](_0x4fc449)[_0xe762('0x90')]()[_0xe762('0x91')]();return db['ChatQueue'][_0xe762('0x60')]({'where':{'id':_0x147200[_0xe762('0x59')]['id']}})[_0xe762('0x24')](function(_0x5eee8c){return db[_0xe762('0x79')]['transaction'](function(_0x13b176){return _0x5eee8c[_0xe762('0x7d')](_0x147200[_0xe762('0x47')]['ids'],{'transaction':_0x13b176})[_0xe762('0x24')](function(){if(!_['isEmpty'](_0x60207e)){return _0x5eee8c[_0xe762('0x92')](_0x60207e,{'transaction':_0x13b176});}})['then'](function(){_0x60207e[_0xe762('0x7b')](function(_0x2e39e6){socket[_0xe762('0x7c')](_0xe762('0x93'),{'UserId':_0x2e39e6,'ChatQueueId':_0x5eee8c['id']});});});});});});})['then'](respondWithStatusCode(_0x4d4f7b,null))[_0xe762('0x2e')](handleError(_0x4d4f7b,null));};exports[_0xe762('0x94')]=function(_0x4d235c,_0xf09a0a,_0x260c63){return db['ChatQueue'][_0xe762('0x60')]({'where':{'id':_0x4d235c[_0xe762('0x59')]['id']}})[_0xe762('0x24')](handleEntityNotFound(_0xf09a0a,null))['then'](function(_0x347c0e){if(_0x347c0e){return _0x347c0e['addAgents'](_0x4d235c[_0xe762('0x5d')][_0xe762('0x7e')],_[_0xe762('0x95')](_0x4d235c[_0xe762('0x5d')],[_0xe762('0x7e'),'id'])||{})[_0xe762('0x96')](function(_0x48b9a8){for(var _0x44fc86=0x0;_0x44fc86<_0x4d235c[_0xe762('0x5d')]['ids'][_0xe762('0x5a')];_0x44fc86+=0x1){socket[_0xe762('0x7c')](_0xe762('0x97'),{'UserId':Number(_0x4d235c['body'][_0xe762('0x7e')][_0x44fc86]),'ChatQueueId':Number(_0x4d235c[_0xe762('0x59')]['id'])});}return _0x48b9a8;});}})[_0xe762('0x24')](respondWithResult(_0xf09a0a,null))['catch'](handleError(_0xf09a0a,null));};exports[_0xe762('0x92')]=function(_0x960542,_0xa5b551,_0x4c00e1){return db[_0xe762('0x42')][_0xe762('0x60')]({'where':{'id':_0x960542[_0xe762('0x59')]['id']}})['then'](handleEntityNotFound(_0xa5b551,null))['then'](function(_0x4ae0f3){if(_0x4ae0f3){return _0x4ae0f3['removeAgents'](_0x960542[_0xe762('0x47')][_0xe762('0x7e')])[_0xe762('0x24')](function(){if(_[_0xe762('0x98')](_0x960542['query'][_0xe762('0x7e')])){for(var _0x2eccf7=0x0;_0x2eccf7<_0x960542[_0xe762('0x47')][_0xe762('0x7e')][_0xe762('0x5a')];_0x2eccf7+=0x1){socket[_0xe762('0x7c')](_0xe762('0x93'),{'UserId':Number(_0x960542[_0xe762('0x47')][_0xe762('0x7e')][_0x2eccf7]),'ChatQueueId':Number(_0x960542['params']['id'])});}}else{socket[_0xe762('0x7c')](_0xe762('0x93'),{'UserId':Number(_0x960542['query'][_0xe762('0x7e')]),'ChatQueueId':Number(_0x960542['params']['id'])});}});}})[_0xe762('0x24')](respondWithStatusCode(_0xa5b551,null))[_0xe762('0x2e')](handleError(_0xa5b551,null));};exports[_0xe762('0x99')]=function(_0x458448,_0x3f3140,_0xf8049){var _0x13c4b3={};var _0x5ea102={};var _0x54d0b7;var _0x1e4266;return db[_0xe762('0x42')][_0xe762('0x9a')]({'where':{'id':_0x458448[_0xe762('0x59')]['id']}})['then'](handleEntityNotFound(_0x3f3140,null))[_0xe762('0x24')](function(_0xcb608d){if(_0xcb608d){_0x54d0b7=_0xcb608d;_0x5ea102[_0xe762('0x46')]=_[_0xe762('0x48')](db['User'][_0xe762('0x43')]);_0x5ea102[_0xe762('0x47')]=_['keys'](_0x458448[_0xe762('0x47')]);_0x5ea102['filters']=_[_0xe762('0x49')](_0x5ea102[_0xe762('0x46')],_0x5ea102[_0xe762('0x47')]);_0x13c4b3[_0xe762('0x4a')]=_['intersection'](_0x5ea102[_0xe762('0x46')],qs[_0xe762('0x4b')](_0x458448[_0xe762('0x47')][_0xe762('0x4b')]));_0x13c4b3[_0xe762('0x4a')]=_0x13c4b3[_0xe762('0x4a')][_0xe762('0x5a')]?_0x13c4b3[_0xe762('0x4a')]:_0x5ea102[_0xe762('0x46')];_0x13c4b3['order']=qs[_0xe762('0x4e')](_0x458448[_0xe762('0x47')]['sort']);_0x13c4b3[_0xe762('0x4f')]=qs[_0xe762('0x50')](_[_0xe762('0x66')](_0x458448[_0xe762('0x47')],_0x5ea102['filters']));if(_0x458448[_0xe762('0x47')]['filter']){_0x13c4b3[_0xe762('0x4f')]=_[_0xe762('0x52')](_0x13c4b3[_0xe762('0x4f')],{'$or':_[_0xe762('0x41')](_0x13c4b3[_0xe762('0x4a')],function(_0x3fd9bb){var _0x2ce560={};_0x2ce560[_0x3fd9bb]={'$like':'%'+_0x458448[_0xe762('0x47')]['filter']+'%'};return _0x2ce560;})});}_0x13c4b3=_[_0xe762('0x52')]({},_0x13c4b3,_0x458448[_0xe762('0x5b')]);return _0x54d0b7[_0xe762('0x99')](_0x13c4b3);}})[_0xe762('0x24')](function(_0x4bcdff){if(_0x4bcdff){_0x1e4266=_0x4bcdff[_0xe762('0x5a')];if(!_0x458448[_0xe762('0x47')]['hasOwnProperty']('nolimit')){_0x13c4b3[_0xe762('0x35')]=qs[_0xe762('0x35')](_0x458448[_0xe762('0x47')][_0xe762('0x35')]);_0x13c4b3[_0xe762('0x33')]=qs[_0xe762('0x33')](_0x458448['query']['offset']);}return _0x54d0b7[_0xe762('0x99')](_0x13c4b3);}})[_0xe762('0x24')](function(_0x404743){if(_0x404743){return _0x404743?{'count':_0x1e4266,'rows':_0x404743}:null;}})[_0xe762('0x24')](respondWithResult(_0x3f3140,null))['catch'](handleError(_0x3f3140,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index e1795aa..bf8cabd 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 _0x5430=['exports','../../mysqldb','setMaxListeners','remove','emit','hook'];(function(_0x3f6d5a,_0x2a83c8){var _0x33b363=function(_0x2da4c2){while(--_0x2da4c2){_0x3f6d5a['push'](_0x3f6d5a['shift']());}};_0x33b363(++_0x2a83c8);}(_0x5430,0xc7));var _0x0543=function(_0x4a9874,_0x48f997){_0x4a9874=_0x4a9874-0x0;var _0x26b791=_0x5430[_0x4a9874];return _0x26b791;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x0543('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x0543('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0543('0x2')};function emitEvent(_0x50274e){return function(_0x5cce70,_0x3b4e30,_0x377152){ChatQueueEvents['emit'](_0x50274e+':'+_0x5cce70['id'],_0x5cce70);ChatQueueEvents[_0x0543('0x3')](_0x50274e,_0x5cce70);_0x377152(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x0543('0x4')](e,emitEvent(event));}}module[_0x0543('0x5')]=ChatQueueEvents;
\ No newline at end of file
+var _0x69dd=['ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x88ab90,_0x5155df){var _0x241cf0=function(_0x368641){while(--_0x368641){_0x88ab90['push'](_0x88ab90['shift']());}};_0x241cf0(++_0x5155df);}(_0x69dd,0x117));var _0xd69d=function(_0x15fe68,_0xddc145){_0x15fe68=_0x15fe68-0x0;var _0x1d144c=_0x69dd[_0x15fe68];return _0x1d144c;};'use strict';var EventEmitter=require(_0xd69d('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xd69d('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd69d('0x2')](0x0);var events={'afterCreate':_0xd69d('0x3'),'afterUpdate':_0xd69d('0x4'),'afterDestroy':_0xd69d('0x5')};function emitEvent(_0x23145a){return function(_0x12efd0,_0xab993a,_0xca2d44){ChatQueueEvents[_0xd69d('0x6')](_0x23145a+':'+_0x12efd0['id'],_0x12efd0);ChatQueueEvents['emit'](_0x23145a,_0x12efd0);_0xca2d44(null);};}for(var e in events){if(events[_0xd69d('0x7')](e)){var event=events[e];ChatQueue[_0xd69d('0x8')](e,emitEvent(event));}}module[_0xd69d('0x9')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 8506684..119291b 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 _0xd8ba=['exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes'];(function(_0x375c38,_0x1afa1d){var _0x37076c=function(_0x3a2d0f){while(--_0x3a2d0f){_0x375c38['push'](_0x375c38['shift']());}};_0x37076c(++_0x1afa1d);}(_0xd8ba,0xc7));var _0xad8b=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd8ba[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xad8b('0x0'));var util=require(_0xad8b('0x1'));var logger=require(_0xad8b('0x2'))(_0xad8b('0x3'));var moment=require(_0xad8b('0x4'));var BPromise=require(_0xad8b('0x5'));var rp=require(_0xad8b('0x6'));var fs=require('fs');var path=require(_0xad8b('0x7'));var rimraf=require(_0xad8b('0x8'));var config=require(_0xad8b('0x9'));var attributes=require(_0xad8b('0xa'));module[_0xad8b('0xb')]=function(_0x5b8fe6,_0xe75eba){return _0x5b8fe6[_0xad8b('0xc')](_0xad8b('0xd'),attributes,{'tableName':_0xad8b('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4995=['path','rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','request-promise'];(function(_0x4b3b4d,_0x80fb2e){var _0x2006f3=function(_0x2ceea8){while(--_0x2ceea8){_0x4b3b4d['push'](_0x4b3b4d['shift']());}};_0x2006f3(++_0x80fb2e);}(_0x4995,0x127));var _0x5499=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x4995[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x5499('0x0'));var util=require(_0x5499('0x1'));var logger=require(_0x5499('0x2'))(_0x5499('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5499('0x4'));var fs=require('fs');var path=require(_0x5499('0x5'));var rimraf=require(_0x5499('0x6'));var config=require('../../config/environment');var attributes=require(_0x5499('0x7'));module[_0x5499('0x8')]=function(_0x536997,_0x1c21d0){return _0x536997[_0x5499('0x9')](_0x5499('0xa'),attributes,{'tableName':_0x5499('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 391a5b4..a98acad 100644
--- a/server/api/chatQueue/chatQueue.rpc.js
+++ b/server/api/chatQueue/chatQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xebc4=['./chatQueue.socket','register','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','info','GetChatQueue','ChatQueue','then','ShowChatQueue','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','redis','socket.io-emitter'];(function(_0x1b6f3d,_0x52bddf){var _0x2a3d6d=function(_0x348d0d){while(--_0x348d0d){_0x1b6f3d['push'](_0x1b6f3d['shift']());}};_0x2a3d6d(++_0x52bddf);}(_0xebc4,0xf9));var _0x4ebc=function(_0x34e106,_0x91d313){_0x34e106=_0x34e106-0x0;var _0x23a796=_0xebc4[_0x34e106];return _0x23a796;};'use strict';var _=require('lodash');var util=require(_0x4ebc('0x0'));var moment=require(_0x4ebc('0x1'));var BPromise=require(_0x4ebc('0x2'));var rs=require(_0x4ebc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ebc('0x4'))['db'];var utils=require(_0x4ebc('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4ebc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4ebc('0x7')]['http']({'port':0x232a});config[_0x4ebc('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4ebc('0x9'))(new Redis(config[_0x4ebc('0x8')]));require(_0x4ebc('0xa'))[_0x4ebc('0xb')](socket);function respondWithRpcPromise(_0x46e0dc,_0x5d6a99,_0x27a221){return new BPromise(function(_0x1b5dbc,_0x12e3c6){return client[_0x4ebc('0xc')](_0x46e0dc,_0x27a221)['then'](function(_0x1522b9){logger['info'](_0x4ebc('0xd'),_0x5d6a99,_0x4ebc('0xe'));logger[_0x4ebc('0xf')](_0x4ebc('0x10'),_0x5d6a99,'request\x20sent',JSON[_0x4ebc('0x11')](_0x1522b9));if(_0x1522b9['error']){if(_0x1522b9[_0x4ebc('0x12')][_0x4ebc('0x13')]===0x1f4){logger[_0x4ebc('0x12')](_0x4ebc('0xd'),_0x5d6a99,_0x1522b9[_0x4ebc('0x12')][_0x4ebc('0x14')]);return _0x12e3c6(_0x1522b9['error'][_0x4ebc('0x14')]);}logger[_0x4ebc('0x12')](_0x4ebc('0xd'),_0x5d6a99,_0x1522b9[_0x4ebc('0x12')]['message']);return _0x1b5dbc(_0x1522b9[_0x4ebc('0x12')][_0x4ebc('0x14')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x5d6a99,_0x4ebc('0xe'));_0x1b5dbc(_0x1522b9[_0x4ebc('0x15')]['message']);}})[_0x4ebc('0x16')](function(_0x28571e){logger[_0x4ebc('0x12')](_0x4ebc('0xd'),_0x5d6a99,_0x28571e);_0x12e3c6(_0x28571e);});});}exports['GetChatQueue']=function(_0x59251b){var _0x249dcf=this;return new Promise(function(_0x3e6195,_0x137ec9){return db['ChatQueue'][_0x4ebc('0x17')]({'raw':_0x59251b['options']?_0x59251b[_0x4ebc('0x18')][_0x4ebc('0x19')]===undefined?!![]:![]:!![],'where':_0x59251b['options']?_0x59251b['options'][_0x4ebc('0x1a')]||null:null,'attributes':_0x59251b['options']?_0x59251b[_0x4ebc('0x18')][_0x4ebc('0x1b')]||null:null,'limit':_0x59251b[_0x4ebc('0x18')]?_0x59251b[_0x4ebc('0x18')][_0x4ebc('0x1c')]||null:null,'include':_0x59251b[_0x4ebc('0x18')]?_0x59251b[_0x4ebc('0x18')][_0x4ebc('0x1d')]?_[_0x4ebc('0x1e')](_0x59251b[_0x4ebc('0x18')]['include'],function(_0x376a83){return{'model':db[_0x376a83[_0x4ebc('0x1f')]],'as':_0x376a83['as'],'attributes':_0x376a83[_0x4ebc('0x1b')],'include':_0x376a83[_0x4ebc('0x1d')]?_[_0x4ebc('0x1e')](_0x376a83[_0x4ebc('0x1d')],function(_0x165924){return{'model':db[_0x165924[_0x4ebc('0x1f')]],'as':_0x165924['as'],'attributes':_0x165924[_0x4ebc('0x1b')],'include':_0x165924[_0x4ebc('0x1d')]?_[_0x4ebc('0x1e')](_0x165924['include'],function(_0x10b09a){return{'model':db[_0x10b09a[_0x4ebc('0x1f')]],'as':_0x10b09a['as'],'attributes':_0x10b09a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x42590d){logger[_0x4ebc('0x20')](_0x4ebc('0x21'),_0x59251b);logger[_0x4ebc('0xf')](_0x4ebc('0x21'),_0x59251b,JSON[_0x4ebc('0x11')](_0x42590d));_0x3e6195(_0x42590d);})[_0x4ebc('0x16')](function(_0x1d3d15){logger[_0x4ebc('0x12')]('GetChatQueue',_0x1d3d15[_0x4ebc('0x14')],_0x59251b);_0x137ec9(_0x249dcf[_0x4ebc('0x12')](0x1f4,_0x1d3d15[_0x4ebc('0x14')]));});});};exports['ShowChatQueue']=function(_0x3f9c40){var _0xbf2673=this;return new Promise(function(_0x141869,_0x3da50a){return db[_0x4ebc('0x22')]['find']({'raw':_0x3f9c40[_0x4ebc('0x18')]?_0x3f9c40[_0x4ebc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3f9c40[_0x4ebc('0x18')]?_0x3f9c40[_0x4ebc('0x18')][_0x4ebc('0x1a')]||null:null,'attributes':_0x3f9c40[_0x4ebc('0x18')]?_0x3f9c40[_0x4ebc('0x18')][_0x4ebc('0x1b')]||null:null,'include':_0x3f9c40[_0x4ebc('0x18')]?_0x3f9c40[_0x4ebc('0x18')][_0x4ebc('0x1d')]?_['map'](_0x3f9c40['options'][_0x4ebc('0x1d')],function(_0x136d78){return{'model':db[_0x136d78[_0x4ebc('0x1f')]],'as':_0x136d78['as'],'attributes':_0x136d78[_0x4ebc('0x1b')],'include':_0x136d78[_0x4ebc('0x1d')]?_[_0x4ebc('0x1e')](_0x136d78[_0x4ebc('0x1d')],function(_0x4af0ec){return{'model':db[_0x4af0ec[_0x4ebc('0x1f')]],'as':_0x4af0ec['as'],'attributes':_0x4af0ec['attributes'],'include':_0x4af0ec['include']?_[_0x4ebc('0x1e')](_0x4af0ec[_0x4ebc('0x1d')],function(_0x34b276){return{'model':db[_0x34b276[_0x4ebc('0x1f')]],'as':_0x34b276['as'],'attributes':_0x34b276[_0x4ebc('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4ebc('0x23')](function(_0x4fcfb6){logger[_0x4ebc('0x20')]('ShowChatQueue',_0x3f9c40);logger['debug'](_0x4ebc('0x24'),_0x3f9c40,JSON[_0x4ebc('0x11')](_0x4fcfb6));_0x141869(_0x4fcfb6);})[_0x4ebc('0x16')](function(_0x28ab22){logger[_0x4ebc('0x12')](_0x4ebc('0x24'),_0x28ab22[_0x4ebc('0x14')],_0x3f9c40);_0x3da50a(_0xbf2673['error'](0x1f4,_0x28ab22['message']));});});};
\ No newline at end of file
+var _0x4b17=['request\x20sent','stringify','error','message','ChatQueue,\x20%s,\x20%s','result','GetChatQueue','ChatQueue','findAll','options','raw','attributes','include','map','model','debug','catch','ShowChatQueue','find','lodash','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','register','request','then','info'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4b17,0x10f));var _0x74b1=function(_0xb875ee,_0x583042){_0xb875ee=_0xb875ee-0x0;var _0x4c7f3a=_0x4b17[_0xb875ee];return _0x4c7f3a;};'use strict';var _=require(_0x74b1('0x0'));var util=require('util');var moment=require(_0x74b1('0x1'));var BPromise=require('bluebird');var rs=require(_0x74b1('0x2'));var fs=require('fs');var Redis=require(_0x74b1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x74b1('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x74b1('0x5'));var jayson=require(_0x74b1('0x6'));var client=jayson[_0x74b1('0x7')][_0x74b1('0x8')]({'port':0x232a});config[_0x74b1('0x9')]=_[_0x74b1('0xa')](config[_0x74b1('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x74b1('0xb'))(new Redis(config[_0x74b1('0x9')]));require(_0x74b1('0xc'))[_0x74b1('0xd')](socket);function respondWithRpcPromise(_0xc1952,_0x4eab15,_0x33f4bf){return new BPromise(function(_0x20bd4c,_0x57f3ad){return client[_0x74b1('0xe')](_0xc1952,_0x33f4bf)[_0x74b1('0xf')](function(_0x6434fd){logger[_0x74b1('0x10')]('ChatQueue,\x20%s,\x20%s',_0x4eab15,_0x74b1('0x11'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4eab15,_0x74b1('0x11'),JSON[_0x74b1('0x12')](_0x6434fd));if(_0x6434fd['error']){if(_0x6434fd['error']['code']===0x1f4){logger[_0x74b1('0x13')]('ChatQueue,\x20%s,\x20%s',_0x4eab15,_0x6434fd['error'][_0x74b1('0x14')]);return _0x57f3ad(_0x6434fd[_0x74b1('0x13')][_0x74b1('0x14')]);}logger[_0x74b1('0x13')](_0x74b1('0x15'),_0x4eab15,_0x6434fd[_0x74b1('0x13')]['message']);return _0x20bd4c(_0x6434fd[_0x74b1('0x13')][_0x74b1('0x14')]);}else{logger[_0x74b1('0x10')](_0x74b1('0x15'),_0x4eab15,_0x74b1('0x11'));_0x20bd4c(_0x6434fd[_0x74b1('0x16')][_0x74b1('0x14')]);}})['catch'](function(_0xd50f0){logger[_0x74b1('0x13')]('ChatQueue,\x20%s,\x20%s',_0x4eab15,_0xd50f0);_0x57f3ad(_0xd50f0);});});}exports[_0x74b1('0x17')]=function(_0x38d932){var _0x39f261=this;return new Promise(function(_0x25704e,_0x13bb44){return db[_0x74b1('0x18')][_0x74b1('0x19')]({'raw':_0x38d932[_0x74b1('0x1a')]?_0x38d932['options'][_0x74b1('0x1b')]===undefined?!![]:![]:!![],'where':_0x38d932['options']?_0x38d932['options']['where']||null:null,'attributes':_0x38d932[_0x74b1('0x1a')]?_0x38d932[_0x74b1('0x1a')][_0x74b1('0x1c')]||null:null,'limit':_0x38d932[_0x74b1('0x1a')]?_0x38d932[_0x74b1('0x1a')]['limit']||null:null,'include':_0x38d932[_0x74b1('0x1a')]?_0x38d932['options'][_0x74b1('0x1d')]?_[_0x74b1('0x1e')](_0x38d932[_0x74b1('0x1a')][_0x74b1('0x1d')],function(_0x3239d8){return{'model':db[_0x3239d8[_0x74b1('0x1f')]],'as':_0x3239d8['as'],'attributes':_0x3239d8[_0x74b1('0x1c')],'include':_0x3239d8[_0x74b1('0x1d')]?_['map'](_0x3239d8[_0x74b1('0x1d')],function(_0x42b69d){return{'model':db[_0x42b69d[_0x74b1('0x1f')]],'as':_0x42b69d['as'],'attributes':_0x42b69d['attributes'],'include':_0x42b69d[_0x74b1('0x1d')]?_[_0x74b1('0x1e')](_0x42b69d[_0x74b1('0x1d')],function(_0x1b011a){return{'model':db[_0x1b011a[_0x74b1('0x1f')]],'as':_0x1b011a['as'],'attributes':_0x1b011a[_0x74b1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x74b1('0xf')](function(_0x3ce043){logger['info'](_0x74b1('0x17'),_0x38d932);logger[_0x74b1('0x20')]('GetChatQueue',_0x38d932,JSON[_0x74b1('0x12')](_0x3ce043));_0x25704e(_0x3ce043);})[_0x74b1('0x21')](function(_0x1ac433){logger['error'](_0x74b1('0x17'),_0x1ac433[_0x74b1('0x14')],_0x38d932);_0x13bb44(_0x39f261['error'](0x1f4,_0x1ac433[_0x74b1('0x14')]));});});};exports[_0x74b1('0x22')]=function(_0x2211b2){var _0x31c321=this;return new Promise(function(_0x68a3bd,_0x32a8d6){return db[_0x74b1('0x18')][_0x74b1('0x23')]({'raw':_0x2211b2['options']?_0x2211b2[_0x74b1('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2211b2['options']?_0x2211b2[_0x74b1('0x1a')]['where']||null:null,'attributes':_0x2211b2['options']?_0x2211b2[_0x74b1('0x1a')][_0x74b1('0x1c')]||null:null,'include':_0x2211b2[_0x74b1('0x1a')]?_0x2211b2[_0x74b1('0x1a')][_0x74b1('0x1d')]?_[_0x74b1('0x1e')](_0x2211b2[_0x74b1('0x1a')][_0x74b1('0x1d')],function(_0x5607d2){return{'model':db[_0x5607d2['model']],'as':_0x5607d2['as'],'attributes':_0x5607d2['attributes'],'include':_0x5607d2[_0x74b1('0x1d')]?_['map'](_0x5607d2['include'],function(_0xee2bae){return{'model':db[_0xee2bae[_0x74b1('0x1f')]],'as':_0xee2bae['as'],'attributes':_0xee2bae[_0x74b1('0x1c')],'include':_0xee2bae['include']?_[_0x74b1('0x1e')](_0xee2bae['include'],function(_0x2fa859){return{'model':db[_0x2fa859[_0x74b1('0x1f')]],'as':_0x2fa859['as'],'attributes':_0x2fa859['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1be766){logger[_0x74b1('0x10')]('ShowChatQueue',_0x2211b2);logger['debug'](_0x74b1('0x22'),_0x2211b2,JSON['stringify'](_0x1be766));_0x68a3bd(_0x1be766);})[_0x74b1('0x21')](function(_0x39cc71){logger[_0x74b1('0x13')](_0x74b1('0x22'),_0x39cc71[_0x74b1('0x14')],_0x2211b2);_0x32a8d6(_0x31c321['error'](0x1f4,_0x39cc71[_0x74b1('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index c28b02f..60c4403 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 _0x5c12=['removeListener','chatQueue:','save','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c12,0x188));var _0x25c1=function(_0x81e39d,_0x4c3934){_0x81e39d=_0x81e39d-0x0;var _0x548fbb=_0x5c12[_0x81e39d];return _0x548fbb;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x25c1('0x0'),_0x25c1('0x1'),'update'];function createListener(_0x44bc2e,_0x1991e5){return function(_0x4042fe){_0x1991e5[_0x25c1('0x2')](_0x44bc2e,_0x4042fe);};}function removeListener(_0x2c5df0,_0x21ec20){return function(){ChatQueueEvents[_0x25c1('0x3')](_0x2c5df0,_0x21ec20);};}exports['register']=function(_0x204287){for(var _0x42ac16=0x0,_0x382922=events['length'];_0x42ac16<_0x382922;_0x42ac16++){var _0x5c69b1=events[_0x42ac16];var _0x24981c=createListener(_0x25c1('0x4')+_0x5c69b1,_0x204287);ChatQueueEvents['on'](_0x5c69b1,_0x24981c);}};
\ No newline at end of file
+var _0xac9d=['update','emit','register','length','chatQueue:','./chatQueue.events','save','remove'];(function(_0x1d8f29,_0x205904){var _0x5c7854=function(_0xe36152){while(--_0xe36152){_0x1d8f29['push'](_0x1d8f29['shift']());}};_0x5c7854(++_0x205904);}(_0xac9d,0x14d));var _0xdac9=function(_0x47878f,_0x48d3bf){_0x47878f=_0x47878f-0x0;var _0x4b05b8=_0xac9d[_0x47878f];return _0x4b05b8;};'use strict';var ChatQueueEvents=require(_0xdac9('0x0'));var events=[_0xdac9('0x1'),_0xdac9('0x2'),_0xdac9('0x3')];function createListener(_0x12390c,_0x27eb7c){return function(_0x25d1b3){_0x27eb7c[_0xdac9('0x4')](_0x12390c,_0x25d1b3);};}function removeListener(_0x51a5d7,_0x1c17a6){return function(){ChatQueueEvents['removeListener'](_0x51a5d7,_0x1c17a6);};}exports[_0xdac9('0x5')]=function(_0x1f8ff3){for(var _0x1222bb=0x0,_0x776b6c=events[_0xdac9('0x6')];_0x1222bb<_0x776b6c;_0x1222bb++){var _0x39f560=events[_0x1222bb];var _0x5531af=createListener(_0xdac9('0x7')+_0x39f560,_0x1f8ff3);ChatQueueEvents['on'](_0x39f560,_0x5531af);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index cfcd139..497c1e2 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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x5fc3,0xa8));var _0x35fc=function(_0x36feb2,_0x53abef){_0x36feb2=_0x36feb2-0x0;var _0x292b43=_0x5fc3[_0x36feb2];return _0x292b43;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
+var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x5fc3,0xa8));var _0x35fc=function(_0x49d19d,_0x245cf5){_0x49d19d=_0x49d19d-0x0;var _0x4ebef1=_0x5fc3[_0x49d19d];return _0x4ebef1;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index f017f19..9e272f6 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 _0x5b2d=['moment','exports','STRING','DATE'];(function(_0x1a3c0e,_0x1dea68){var _0xdab41=function(_0x3be01a){while(--_0x3be01a){_0x1a3c0e['push'](_0x1a3c0e['shift']());}};_0xdab41(++_0x1dea68);}(_0x5b2d,0x140));var _0xd5b2=function(_0x11d7ac,_0x1aefb4){_0x11d7ac=_0x11d7ac-0x0;var _0xff1914=_0x5b2d[_0x11d7ac];return _0xff1914;};'use strict';var moment=require(_0xd5b2('0x0'));var Sequelize=require('sequelize');module[_0xd5b2('0x1')]={'uniqueid':{'type':Sequelize[_0xd5b2('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd5b2('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd5b2('0x3')]},'acceptAt':{'type':Sequelize[_0xd5b2('0x3')]},'exitAt':{'type':Sequelize[_0xd5b2('0x3')]},'reason':{'type':Sequelize[_0xd5b2('0x2')]}};
\ No newline at end of file
+var _0x1526=['DATE','moment','sequelize','exports','STRING'];(function(_0x4e2cd9,_0x478769){var _0x5edba3=function(_0x3f0b07){while(--_0x3f0b07){_0x4e2cd9['push'](_0x4e2cd9['shift']());}};_0x5edba3(++_0x478769);}(_0x1526,0x16e));var _0x6152=function(_0x431e48,_0xa09911){_0x431e48=_0x431e48-0x0;var _0x37112d=_0x1526[_0x431e48];return _0x37112d;};'use strict';var moment=require(_0x6152('0x0'));var Sequelize=require(_0x6152('0x1'));module[_0x6152('0x2')]={'uniqueid':{'type':Sequelize[_0x6152('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x6152('0x4')]},'leaveAt':{'type':Sequelize[_0x6152('0x4')]},'acceptAt':{'type':Sequelize[_0x6152('0x4')]},'exitAt':{'type':Sequelize[_0x6152('0x4')]},'reason':{'type':Sequelize[_0x6152('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 2e8a55e..ff4d48b 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 _0x084b=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','catch','show','params','keys','fields','include','create','body','find','describe','eml-format','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','desk.js','querystring'];(function(_0x4b9c74,_0x1b66bb){var _0x229a46=function(_0x2edf37){while(--_0x2edf37){_0x4b9c74['push'](_0x4b9c74['shift']());}};_0x229a46(++_0x1b66bb);}(_0x084b,0xd5));var _0xb084=function(_0x1234e5,_0x599458){_0x1234e5=_0x1234e5-0x0;var _0x1a351e=_0x084b[_0x1234e5];return _0x1a351e;};'use strict';var emlformat=require(_0xb084('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb084('0x1'));var moment=require(_0xb084('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xb084('0x3'));var util=require(_0xb084('0x4'));var path=require(_0xb084('0x5'));var sox=require('sox');var csv=require(_0xb084('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb084('0x7'));var _=require(_0xb084('0x8'));var squel=require(_0xb084('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb084('0xa'));var toCsv=require(_0xb084('0x6'));var querystring=require(_0xb084('0xb'));var Papa=require(_0xb084('0xc'));var Redis=require(_0xb084('0xd'));var authService=require(_0xb084('0xe'));var qs=require(_0xb084('0xf'));var as=require(_0xb084('0x10'));var hardwareService=require(_0xb084('0x11'));var logger=require(_0xb084('0x12'))(_0xb084('0x13'));var utils=require(_0xb084('0x14'));var config=require(_0xb084('0x15'));var licenseUtil=require(_0xb084('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51aee2,_0x3582a0){_0x3582a0=_0x3582a0||0xcc;return function(_0x514829){if(_0x514829){return _0x51aee2['sendStatus'](_0x3582a0);}return _0x51aee2[_0xb084('0x17')](_0x3582a0)[_0xb084('0x18')]();};}function respondWithResult(_0x5bae3a,_0x4da0fb){_0x4da0fb=_0x4da0fb||0xc8;return function(_0x44be03){if(_0x44be03){return _0x5bae3a[_0xb084('0x17')](_0x4da0fb)[_0xb084('0x19')](_0x44be03);}};}function respondWithFilteredResult(_0x28ad2d,_0xc6df71){return function(_0x5a5d11){if(_0x5a5d11){var _0x240838=typeof _0xc6df71[_0xb084('0x1a')]===_0xb084('0x1b')&&typeof _0xc6df71[_0xb084('0x1c')]===_0xb084('0x1b');var _0x2cce88=_0x5a5d11[_0xb084('0x1d')];var _0x42657a=_0x240838?0x0:_0xc6df71[_0xb084('0x1a')];var _0x19d426=_0x240838?_0x5a5d11['count']:_0xc6df71['offset']+_0xc6df71['limit'];var _0x5b076b;if(_0x19d426>=_0x2cce88){_0x19d426=_0x2cce88;_0x5b076b=0xc8;}else{_0x5b076b=0xce;}_0x28ad2d[_0xb084('0x17')](_0x5b076b);return _0x28ad2d['set'](_0xb084('0x1e'),_0x42657a+'-'+_0x19d426+'/'+_0x2cce88)[_0xb084('0x19')](_0x5a5d11);}return null;};}function patchUpdates(_0x228ef1){return function(_0x2e8789){try{jsonpatch[_0xb084('0x1f')](_0x2e8789,_0x228ef1,!![]);}catch(_0x434690){return BPromise[_0xb084('0x20')](_0x434690);}return _0x2e8789[_0xb084('0x21')]();};}function saveUpdates(_0x517dc0,_0x5dfc7f){return function(_0x171dd5){if(_0x171dd5){return _0x171dd5[_0xb084('0x22')](_0x517dc0)[_0xb084('0x23')](function(_0x28d074){return _0x28d074;});}return null;};}function removeEntity(_0x5dced1,_0x4795d9){return function(_0x3ef50e){if(_0x3ef50e){return _0x3ef50e[_0xb084('0x24')]()['then'](function(){_0x5dced1[_0xb084('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f4983,_0x22059f){return function(_0x5d9314){if(!_0x5d9314){_0x1f4983[_0xb084('0x25')](0x194);}return _0x5d9314;};}function handleError(_0x3d467e,_0x1ecb58){_0x1ecb58=_0x1ecb58||0x1f4;return function(_0x4ce54c){logger[_0xb084('0x26')](_0x4ce54c['stack']);if(_0x4ce54c[_0xb084('0x27')]){delete _0x4ce54c[_0xb084('0x27')];}_0x3d467e['status'](_0x1ecb58)[_0xb084('0x28')](_0x4ce54c);};}exports[_0xb084('0x29')]=function(_0x49cbd6,_0x4587e7){var _0x1a7726={},_0x57406f={},_0x1ad27b={'count':0x0,'rows':[]};var _0x2795cf=_['map'](db[_0xb084('0x2a')][_0xb084('0x2b')],function(_0x330a35){return{'name':_0x330a35[_0xb084('0x2c')],'type':_0x330a35[_0xb084('0x2d')]['key']};});_0x57406f[_0xb084('0x2e')]=_[_0xb084('0x2f')](_0x2795cf,_0xb084('0x27'));_0x57406f[_0xb084('0x30')]=_['keys'](_0x49cbd6[_0xb084('0x30')]);_0x57406f[_0xb084('0x31')]=_[_0xb084('0x32')](_0x57406f[_0xb084('0x2e')],_0x57406f[_0xb084('0x30')]);_0x1a7726['attributes']=_['intersection'](_0x57406f[_0xb084('0x2e')],qs['fields'](_0x49cbd6[_0xb084('0x30')]['fields']));_0x1a7726[_0xb084('0x33')]=_0x1a7726[_0xb084('0x33')][_0xb084('0x34')]?_0x1a7726[_0xb084('0x33')]:_0x57406f['model'];if(!_0x49cbd6[_0xb084('0x30')][_0xb084('0x35')](_0xb084('0x36'))){_0x1a7726[_0xb084('0x1c')]=qs[_0xb084('0x1c')](_0x49cbd6['query'][_0xb084('0x1c')]);_0x1a7726[_0xb084('0x1a')]=qs['offset'](_0x49cbd6['query'][_0xb084('0x1a')]);}_0x1a7726[_0xb084('0x37')]=qs[_0xb084('0x38')](_0x49cbd6[_0xb084('0x30')][_0xb084('0x38')]);_0x1a7726[_0xb084('0x39')]=qs[_0xb084('0x31')](_[_0xb084('0x3a')](_0x49cbd6['query'],_0x57406f[_0xb084('0x31')]),_0x2795cf);if(_0x49cbd6[_0xb084('0x30')]['filter']){_0x1a7726[_0xb084('0x39')]=_['merge'](_0x1a7726[_0xb084('0x39')],{'$or':_[_0xb084('0x2f')](_0x2795cf,function(_0xad9187){if(_0xad9187[_0xb084('0x2d')]!==_0xb084('0x3b')){var _0x2254a3={};_0x2254a3[_0xad9187[_0xb084('0x27')]]={'$like':'%'+_0x49cbd6[_0xb084('0x30')][_0xb084('0x3c')]+'%'};return _0x2254a3;}})});}_0x1a7726=_[_0xb084('0x3d')]({},_0x1a7726,_0x49cbd6[_0xb084('0x3e')]);var _0x77b2cc={'where':_0x1a7726[_0xb084('0x39')]};return db[_0xb084('0x2a')][_0xb084('0x1d')](_0x77b2cc)[_0xb084('0x23')](function(_0x584b34){_0x1ad27b['count']=_0x584b34;if(_0x49cbd6[_0xb084('0x30')][_0xb084('0x3f')]){_0x1a7726['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0xb084('0x40')](_0x1a7726);})[_0xb084('0x23')](function(_0x1de365){_0x1ad27b['rows']=_0x1de365;return _0x1ad27b;})[_0xb084('0x23')](respondWithFilteredResult(_0x4587e7,_0x1a7726))[_0xb084('0x41')](handleError(_0x4587e7,null));};exports[_0xb084('0x42')]=function(_0x526c47,_0xc63ca9){var _0x13b059={'raw':!![],'where':{'id':_0x526c47[_0xb084('0x43')]['id']}},_0x3f38f9={};_0x3f38f9['model']=_[_0xb084('0x44')](db[_0xb084('0x2a')][_0xb084('0x2b')]);_0x3f38f9[_0xb084('0x30')]=_['keys'](_0x526c47[_0xb084('0x30')]);_0x3f38f9[_0xb084('0x31')]=_[_0xb084('0x32')](_0x3f38f9[_0xb084('0x2e')],_0x3f38f9[_0xb084('0x30')]);_0x13b059[_0xb084('0x33')]=_[_0xb084('0x32')](_0x3f38f9[_0xb084('0x2e')],qs[_0xb084('0x45')](_0x526c47[_0xb084('0x30')][_0xb084('0x45')]));_0x13b059[_0xb084('0x33')]=_0x13b059[_0xb084('0x33')][_0xb084('0x34')]?_0x13b059[_0xb084('0x33')]:_0x3f38f9['model'];if(_0x526c47[_0xb084('0x30')][_0xb084('0x3f')]){_0x13b059[_0xb084('0x46')]=[{'all':!![]}];}_0x13b059=_[_0xb084('0x3d')]({},_0x13b059,_0x526c47[_0xb084('0x3e')]);return db[_0xb084('0x2a')]['find'](_0x13b059)[_0xb084('0x23')](handleEntityNotFound(_0xc63ca9,null))[_0xb084('0x23')](respondWithResult(_0xc63ca9,null))[_0xb084('0x41')](handleError(_0xc63ca9,null));};exports[_0xb084('0x47')]=function(_0x1a95e4,_0x305f4a){return db[_0xb084('0x2a')]['create'](_0x1a95e4[_0xb084('0x48')],{})[_0xb084('0x23')](respondWithResult(_0x305f4a,0xc9))[_0xb084('0x41')](handleError(_0x305f4a,null));};exports[_0xb084('0x22')]=function(_0x32014e,_0xb1fdeb){if(_0x32014e[_0xb084('0x48')]['id']){delete _0x32014e[_0xb084('0x48')]['id'];}return db['ChatQueueReport'][_0xb084('0x49')]({'where':{'id':_0x32014e[_0xb084('0x43')]['id']}})['then'](handleEntityNotFound(_0xb1fdeb,null))[_0xb084('0x23')](saveUpdates(_0x32014e[_0xb084('0x48')],null))[_0xb084('0x23')](respondWithResult(_0xb1fdeb,null))[_0xb084('0x41')](handleError(_0xb1fdeb,null));};exports[_0xb084('0x24')]=function(_0x4bad1b,_0x2d5ebd){return db['ChatQueueReport'][_0xb084('0x49')]({'where':{'id':_0x4bad1b[_0xb084('0x43')]['id']}})[_0xb084('0x23')](handleEntityNotFound(_0x2d5ebd,null))[_0xb084('0x23')](removeEntity(_0x2d5ebd,null))[_0xb084('0x41')](handleError(_0x2d5ebd,null));};exports[_0xb084('0x4a')]=function(_0x2d9239,_0x557649){return db['ChatQueueReport']['describe']()[_0xb084('0x23')](respondWithResult(_0x557649,null))[_0xb084('0x41')](handleError(_0x557649,null));};
\ No newline at end of file
+var _0x0760=['filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','zip-dir','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','error','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x19f9e6,_0x4f59a6){var _0x45c862=function(_0x3447fb){while(--_0x3447fb){_0x19f9e6['push'](_0x19f9e6['shift']());}};_0x45c862(++_0x4f59a6);}(_0x0760,0xa9));var _0x0076=function(_0xc7205a,_0x391d58){_0xc7205a=_0xc7205a-0x0;var _0x3d9c46=_0x0760[_0xc7205a];return _0x3d9c46;};'use strict';var emlformat=require(_0x0076('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0076('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0076('0x2'));var Mustache=require(_0x0076('0x3'));var util=require(_0x0076('0x4'));var path=require(_0x0076('0x5'));var sox=require(_0x0076('0x6'));var csv=require('to-csv');var ejs=require(_0x0076('0x7'));var fs=require('fs');var fs_extra=require(_0x0076('0x8'));var _=require(_0x0076('0x9'));var squel=require(_0x0076('0xa'));var crypto=require(_0x0076('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0076('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0076('0xd'));var Papa=require(_0x0076('0xe'));var Redis=require('ioredis');var authService=require(_0x0076('0xf'));var qs=require(_0x0076('0x10'));var as=require(_0x0076('0x11'));var hardwareService=require(_0x0076('0x12'));var logger=require(_0x0076('0x13'))(_0x0076('0x14'));var utils=require('../../config/utils');var config=require(_0x0076('0x15'));var licenseUtil=require(_0x0076('0x16'));var db=require(_0x0076('0x17'))['db'];function respondWithStatusCode(_0x328bbd,_0x3ecbde){_0x3ecbde=_0x3ecbde||0xcc;return function(_0x220e7d){if(_0x220e7d){return _0x328bbd[_0x0076('0x18')](_0x3ecbde);}return _0x328bbd[_0x0076('0x19')](_0x3ecbde)[_0x0076('0x1a')]();};}function respondWithResult(_0x3c790a,_0x379136){_0x379136=_0x379136||0xc8;return function(_0x5175c7){if(_0x5175c7){return _0x3c790a[_0x0076('0x19')](_0x379136)['json'](_0x5175c7);}};}function respondWithFilteredResult(_0x483ad0,_0x29915b){return function(_0x2a45c6){if(_0x2a45c6){var _0x4ce381=typeof _0x29915b[_0x0076('0x1b')]==='undefined'&&typeof _0x29915b[_0x0076('0x1c')]===_0x0076('0x1d');var _0x5a5623=_0x2a45c6['count'];var _0x5761a4=_0x4ce381?0x0:_0x29915b[_0x0076('0x1b')];var _0x30fb20=_0x4ce381?_0x2a45c6[_0x0076('0x1e')]:_0x29915b[_0x0076('0x1b')]+_0x29915b[_0x0076('0x1c')];var _0x371498;if(_0x30fb20>=_0x5a5623){_0x30fb20=_0x5a5623;_0x371498=0xc8;}else{_0x371498=0xce;}_0x483ad0[_0x0076('0x19')](_0x371498);return _0x483ad0[_0x0076('0x1f')](_0x0076('0x20'),_0x5761a4+'-'+_0x30fb20+'/'+_0x5a5623)[_0x0076('0x21')](_0x2a45c6);}return null;};}function patchUpdates(_0x274c52){return function(_0x1507d4){try{jsonpatch[_0x0076('0x22')](_0x1507d4,_0x274c52,!![]);}catch(_0x26b89c){return BPromise['reject'](_0x26b89c);}return _0x1507d4[_0x0076('0x23')]();};}function saveUpdates(_0x2a5619,_0x180391){return function(_0x58ee11){if(_0x58ee11){return _0x58ee11[_0x0076('0x24')](_0x2a5619)[_0x0076('0x25')](function(_0x2dd436){return _0x2dd436;});}return null;};}function removeEntity(_0x39bb13,_0x250f57){return function(_0x5b73ac){if(_0x5b73ac){return _0x5b73ac[_0x0076('0x26')]()[_0x0076('0x25')](function(){_0x39bb13[_0x0076('0x19')](0xcc)[_0x0076('0x1a')]();});}};}function handleEntityNotFound(_0x2c7def,_0x336661){return function(_0x59f20c){if(!_0x59f20c){_0x2c7def[_0x0076('0x18')](0x194);}return _0x59f20c;};}function handleError(_0x27c087,_0x1dbd77){_0x1dbd77=_0x1dbd77||0x1f4;return function(_0x187827){logger[_0x0076('0x27')](_0x187827['stack']);if(_0x187827[_0x0076('0x28')]){delete _0x187827[_0x0076('0x28')];}_0x27c087[_0x0076('0x19')](_0x1dbd77)[_0x0076('0x29')](_0x187827);};}exports[_0x0076('0x2a')]=function(_0xd4009d,_0x1635b7){var _0x332376={},_0x2bc8b7={},_0xca7c6c={'count':0x0,'rows':[]};var _0x4f6543=_[_0x0076('0x2b')](db[_0x0076('0x2c')][_0x0076('0x2d')],function(_0x1cfad4){return{'name':_0x1cfad4[_0x0076('0x2e')],'type':_0x1cfad4['type']['key']};});_0x2bc8b7[_0x0076('0x2f')]=_[_0x0076('0x2b')](_0x4f6543,_0x0076('0x28'));_0x2bc8b7[_0x0076('0x30')]=_['keys'](_0xd4009d['query']);_0x2bc8b7[_0x0076('0x31')]=_[_0x0076('0x32')](_0x2bc8b7[_0x0076('0x2f')],_0x2bc8b7['query']);_0x332376[_0x0076('0x33')]=_[_0x0076('0x32')](_0x2bc8b7[_0x0076('0x2f')],qs[_0x0076('0x34')](_0xd4009d[_0x0076('0x30')][_0x0076('0x34')]));_0x332376[_0x0076('0x33')]=_0x332376[_0x0076('0x33')][_0x0076('0x35')]?_0x332376[_0x0076('0x33')]:_0x2bc8b7[_0x0076('0x2f')];if(!_0xd4009d['query'][_0x0076('0x36')](_0x0076('0x37'))){_0x332376[_0x0076('0x1c')]=qs[_0x0076('0x1c')](_0xd4009d[_0x0076('0x30')][_0x0076('0x1c')]);_0x332376[_0x0076('0x1b')]=qs['offset'](_0xd4009d[_0x0076('0x30')][_0x0076('0x1b')]);}_0x332376[_0x0076('0x38')]=qs[_0x0076('0x39')](_0xd4009d['query'][_0x0076('0x39')]);_0x332376['where']=qs[_0x0076('0x31')](_[_0x0076('0x3a')](_0xd4009d[_0x0076('0x30')],_0x2bc8b7[_0x0076('0x31')]),_0x4f6543);if(_0xd4009d[_0x0076('0x30')][_0x0076('0x3b')]){_0x332376[_0x0076('0x3c')]=_[_0x0076('0x3d')](_0x332376[_0x0076('0x3c')],{'$or':_[_0x0076('0x2b')](_0x4f6543,function(_0x201366){if(_0x201366[_0x0076('0x3e')]!==_0x0076('0x3f')){var _0x5843e6={};_0x5843e6[_0x201366[_0x0076('0x28')]]={'$like':'%'+_0xd4009d[_0x0076('0x30')][_0x0076('0x3b')]+'%'};return _0x5843e6;}})});}_0x332376=_[_0x0076('0x3d')]({},_0x332376,_0xd4009d[_0x0076('0x40')]);var _0x3d2d82={'where':_0x332376['where']};return db[_0x0076('0x2c')]['count'](_0x3d2d82)[_0x0076('0x25')](function(_0x4f58d0){_0xca7c6c[_0x0076('0x1e')]=_0x4f58d0;if(_0xd4009d[_0x0076('0x30')][_0x0076('0x41')]){_0x332376['include']=[{'all':!![]}];}return db[_0x0076('0x2c')][_0x0076('0x42')](_0x332376);})['then'](function(_0x408b7b){_0xca7c6c[_0x0076('0x43')]=_0x408b7b;return _0xca7c6c;})[_0x0076('0x25')](respondWithFilteredResult(_0x1635b7,_0x332376))[_0x0076('0x44')](handleError(_0x1635b7,null));};exports[_0x0076('0x45')]=function(_0x382ae5,_0x1cefec){var _0xd40131={'raw':!![],'where':{'id':_0x382ae5[_0x0076('0x46')]['id']}},_0x157d6f={};_0x157d6f[_0x0076('0x2f')]=_[_0x0076('0x47')](db[_0x0076('0x2c')][_0x0076('0x2d')]);_0x157d6f[_0x0076('0x30')]=_['keys'](_0x382ae5[_0x0076('0x30')]);_0x157d6f[_0x0076('0x31')]=_[_0x0076('0x32')](_0x157d6f[_0x0076('0x2f')],_0x157d6f['query']);_0xd40131[_0x0076('0x33')]=_[_0x0076('0x32')](_0x157d6f[_0x0076('0x2f')],qs[_0x0076('0x34')](_0x382ae5['query']['fields']));_0xd40131[_0x0076('0x33')]=_0xd40131[_0x0076('0x33')]['length']?_0xd40131[_0x0076('0x33')]:_0x157d6f[_0x0076('0x2f')];if(_0x382ae5['query'][_0x0076('0x41')]){_0xd40131['include']=[{'all':!![]}];}_0xd40131=_[_0x0076('0x3d')]({},_0xd40131,_0x382ae5[_0x0076('0x40')]);return db[_0x0076('0x2c')][_0x0076('0x48')](_0xd40131)[_0x0076('0x25')](handleEntityNotFound(_0x1cefec,null))['then'](respondWithResult(_0x1cefec,null))[_0x0076('0x44')](handleError(_0x1cefec,null));};exports[_0x0076('0x49')]=function(_0x3087c7,_0x43b1dc){return db[_0x0076('0x2c')][_0x0076('0x49')](_0x3087c7['body'],{})[_0x0076('0x25')](respondWithResult(_0x43b1dc,0xc9))['catch'](handleError(_0x43b1dc,null));};exports[_0x0076('0x24')]=function(_0x5bfdf8,_0xb09053){if(_0x5bfdf8[_0x0076('0x4a')]['id']){delete _0x5bfdf8[_0x0076('0x4a')]['id'];}return db['ChatQueueReport'][_0x0076('0x48')]({'where':{'id':_0x5bfdf8[_0x0076('0x46')]['id']}})[_0x0076('0x25')](handleEntityNotFound(_0xb09053,null))['then'](saveUpdates(_0x5bfdf8[_0x0076('0x4a')],null))[_0x0076('0x25')](respondWithResult(_0xb09053,null))['catch'](handleError(_0xb09053,null));};exports[_0x0076('0x26')]=function(_0x129e5c,_0x3ad9c8){return db[_0x0076('0x2c')]['find']({'where':{'id':_0x129e5c[_0x0076('0x46')]['id']}})[_0x0076('0x25')](handleEntityNotFound(_0x3ad9c8,null))[_0x0076('0x25')](removeEntity(_0x3ad9c8,null))[_0x0076('0x44')](handleError(_0x3ad9c8,null));};exports[_0x0076('0x4b')]=function(_0x2163c6,_0x53a424){return db[_0x0076('0x2c')][_0x0076('0x4b')]()['then'](respondWithResult(_0x53a424,null))[_0x0076('0x44')](handleError(_0x53a424,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 3240e58..3370d9d 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x421879,_0x4a00c2){var _0x3bec6f=function(_0x338e76){while(--_0x338e76){_0x421879['push'](_0x421879['shift']());}};_0x3bec6f(++_0x4a00c2);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xb7e7[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x29f258,_0x559572){var _0x1315c7=function(_0x140cde){while(--_0x140cde){_0x29f258['push'](_0x29f258['shift']());}};_0x1315c7(++_0x559572);}(_0xe706,0xa3));var _0x6e70=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0xe706[_0x236d24];return _0x1574cf;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index c2828a8..9fc03df 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 _0xc67c=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateChatQueueReport','create','body','options','raw','then','UpdateChatQueueReport','ChatQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x426854,_0xb8fb57){var _0x1f0aea=function(_0x124dba){while(--_0x124dba){_0x426854['push'](_0x426854['shift']());}};_0x1f0aea(++_0xb8fb57);}(_0xc67c,0x17b));var _0xcc67=function(_0x7b60c7,_0x50a43c){_0x7b60c7=_0x7b60c7-0x0;var _0x533781=_0xc67c[_0x7b60c7];return _0x533781;};'use strict';var _=require(_0xcc67('0x0'));var util=require(_0xcc67('0x1'));var moment=require(_0xcc67('0x2'));var BPromise=require(_0xcc67('0x3'));var rs=require(_0xcc67('0x4'));var fs=require('fs');var Redis=require(_0xcc67('0x5'));var db=require(_0xcc67('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcc67('0x7'))(_0xcc67('0x8'));var config=require(_0xcc67('0x9'));var jayson=require(_0xcc67('0xa'));var client=jayson[_0xcc67('0xb')][_0xcc67('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xac838d,_0x2cb2da,_0x46b9a5){return new BPromise(function(_0x5d0c1d,_0x92d497){return client[_0xcc67('0xd')](_0xac838d,_0x46b9a5)['then'](function(_0x18282d){logger[_0xcc67('0xe')](_0xcc67('0xf'),_0x2cb2da,_0xcc67('0x10'));logger[_0xcc67('0x11')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x2cb2da,_0xcc67('0x10'),JSON[_0xcc67('0x12')](_0x18282d));if(_0x18282d[_0xcc67('0x13')]){if(_0x18282d[_0xcc67('0x13')]['code']===0x1f4){logger['error'](_0xcc67('0xf'),_0x2cb2da,_0x18282d[_0xcc67('0x13')][_0xcc67('0x14')]);return _0x92d497(_0x18282d['error'][_0xcc67('0x14')]);}logger[_0xcc67('0x13')](_0xcc67('0xf'),_0x2cb2da,_0x18282d['error'][_0xcc67('0x14')]);return _0x5d0c1d(_0x18282d[_0xcc67('0x13')][_0xcc67('0x14')]);}else{logger[_0xcc67('0xe')](_0xcc67('0xf'),_0x2cb2da,_0xcc67('0x10'));_0x5d0c1d(_0x18282d[_0xcc67('0x15')][_0xcc67('0x14')]);}})[_0xcc67('0x16')](function(_0x4c09dc){logger[_0xcc67('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x2cb2da,_0x4c09dc);_0x92d497(_0x4c09dc);});});}exports[_0xcc67('0x17')]=function(_0x57c1d6){var _0x153737=this;return new Promise(function(_0x26453c,_0x423bd8){return db['ChatQueueReport'][_0xcc67('0x18')](_0x57c1d6[_0xcc67('0x19')],{'raw':_0x57c1d6[_0xcc67('0x1a')]?_0x57c1d6[_0xcc67('0x1a')][_0xcc67('0x1b')]===undefined?!![]:![]:!![]})[_0xcc67('0x1c')](function(_0x617e7b){logger[_0xcc67('0xe')](_0xcc67('0x17'),_0x57c1d6);logger[_0xcc67('0x11')]('CreateChatQueueReport',_0x57c1d6,JSON[_0xcc67('0x12')](_0x617e7b));_0x26453c(_0x617e7b);})['catch'](function(_0x12b59a){logger[_0xcc67('0x13')]('CreateChatQueueReport',_0x12b59a[_0xcc67('0x14')],_0x57c1d6);_0x423bd8(_0x153737[_0xcc67('0x13')](0x1f4,_0x12b59a[_0xcc67('0x14')]));});});};exports[_0xcc67('0x1d')]=function(_0x1dfe93){var _0x91da96=this;return new Promise(function(_0x23bea2,_0x4c6b30){return db[_0xcc67('0x1e')][_0xcc67('0x1f')](_0x1dfe93[_0xcc67('0x19')],{'raw':_0x1dfe93[_0xcc67('0x1a')]?_0x1dfe93['options'][_0xcc67('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1dfe93[_0xcc67('0x1a')]?_0x1dfe93[_0xcc67('0x1a')][_0xcc67('0x20')]||null:null,'attributes':_0x1dfe93[_0xcc67('0x1a')]?_0x1dfe93[_0xcc67('0x1a')][_0xcc67('0x21')]||null:null,'limit':_0x1dfe93[_0xcc67('0x1a')]?_0x1dfe93['options'][_0xcc67('0x22')]||null:null})[_0xcc67('0x1c')](function(_0x274b84){logger[_0xcc67('0xe')](_0xcc67('0x1d'),_0x1dfe93);logger['debug'](_0xcc67('0x1d'),_0x1dfe93,JSON[_0xcc67('0x12')](_0x274b84));_0x23bea2(_0x274b84);})['catch'](function(_0x24dbde){logger[_0xcc67('0x13')](_0xcc67('0x1d'),_0x24dbde[_0xcc67('0x14')],_0x1dfe93);_0x4c6b30(_0x91da96[_0xcc67('0x13')](0x1f4,_0x24dbde[_0xcc67('0x14')]));});});};
\ No newline at end of file
+var _0xcfe7=['catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','where','attributes','limit','info','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x4309a3,_0x3bd92e){var _0x177e17=function(_0x22d50c){while(--_0x22d50c){_0x4309a3['push'](_0x4309a3['shift']());}};_0x177e17(++_0x3bd92e);}(_0xcfe7,0xfb));var _0x7cfe=function(_0x434f59,_0x378741){_0x434f59=_0x434f59-0x0;var _0x278aae=_0xcfe7[_0x434f59];return _0x278aae;};'use strict';var _=require(_0x7cfe('0x0'));var util=require(_0x7cfe('0x1'));var moment=require('moment');var BPromise=require(_0x7cfe('0x2'));var rs=require(_0x7cfe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7cfe('0x4'))['db'];var utils=require(_0x7cfe('0x5'));var logger=require(_0x7cfe('0x6'))('rpc');var config=require(_0x7cfe('0x7'));var jayson=require(_0x7cfe('0x8'));var client=jayson[_0x7cfe('0x9')][_0x7cfe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c37ce,_0x597f0f,_0x1bed96){return new BPromise(function(_0x1ad64e,_0x25a247){return client[_0x7cfe('0xb')](_0x1c37ce,_0x1bed96)[_0x7cfe('0xc')](function(_0x389f8f){logger['info'](_0x7cfe('0xd'),_0x597f0f,_0x7cfe('0xe'));logger[_0x7cfe('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x597f0f,'request\x20sent',JSON[_0x7cfe('0x10')](_0x389f8f));if(_0x389f8f[_0x7cfe('0x11')]){if(_0x389f8f[_0x7cfe('0x11')][_0x7cfe('0x12')]===0x1f4){logger[_0x7cfe('0x11')](_0x7cfe('0xd'),_0x597f0f,_0x389f8f['error']['message']);return _0x25a247(_0x389f8f[_0x7cfe('0x11')][_0x7cfe('0x13')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x597f0f,_0x389f8f[_0x7cfe('0x11')][_0x7cfe('0x13')]);return _0x1ad64e(_0x389f8f[_0x7cfe('0x11')][_0x7cfe('0x13')]);}else{logger['info'](_0x7cfe('0xd'),_0x597f0f,_0x7cfe('0xe'));_0x1ad64e(_0x389f8f[_0x7cfe('0x14')][_0x7cfe('0x13')]);}})[_0x7cfe('0x15')](function(_0x1c82db){logger[_0x7cfe('0x11')](_0x7cfe('0xd'),_0x597f0f,_0x1c82db);_0x25a247(_0x1c82db);});});}exports[_0x7cfe('0x16')]=function(_0x3694e1){var _0x435b3d=this;return new Promise(function(_0x338e21,_0x2899fc){return db[_0x7cfe('0x17')][_0x7cfe('0x18')](_0x3694e1[_0x7cfe('0x19')],{'raw':_0x3694e1[_0x7cfe('0x1a')]?_0x3694e1['options'][_0x7cfe('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x3568ed){logger['info'](_0x7cfe('0x16'),_0x3694e1);logger[_0x7cfe('0xf')](_0x7cfe('0x16'),_0x3694e1,JSON[_0x7cfe('0x10')](_0x3568ed));_0x338e21(_0x3568ed);})[_0x7cfe('0x15')](function(_0x4ac7a8){logger[_0x7cfe('0x11')](_0x7cfe('0x16'),_0x4ac7a8['message'],_0x3694e1);_0x2899fc(_0x435b3d['error'](0x1f4,_0x4ac7a8[_0x7cfe('0x13')]));});});};exports[_0x7cfe('0x1c')]=function(_0x31977d){var _0x4109f8=this;return new Promise(function(_0x3a1ee1,_0x18e600){return db[_0x7cfe('0x17')][_0x7cfe('0x1d')](_0x31977d['body'],{'raw':_0x31977d[_0x7cfe('0x1a')]?_0x31977d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31977d['options']?_0x31977d[_0x7cfe('0x1a')][_0x7cfe('0x1e')]||null:null,'attributes':_0x31977d['options']?_0x31977d['options'][_0x7cfe('0x1f')]||null:null,'limit':_0x31977d['options']?_0x31977d['options'][_0x7cfe('0x20')]||null:null})[_0x7cfe('0xc')](function(_0x4dd717){logger[_0x7cfe('0x21')](_0x7cfe('0x1c'),_0x31977d);logger[_0x7cfe('0xf')](_0x7cfe('0x1c'),_0x31977d,JSON['stringify'](_0x4dd717));_0x3a1ee1(_0x4dd717);})[_0x7cfe('0x15')](function(_0x2f801d){logger[_0x7cfe('0x11')](_0x7cfe('0x1c'),_0x2f801d['message'],_0x31977d);_0x18e600(_0x4109f8[_0x7cfe('0x11')](0x1f4,_0x2f801d[_0x7cfe('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index a751dd1..40a8abe 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 _0x0629=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x214266,_0x1f6f52){var _0x568f75=function(_0x541904){while(--_0x541904){_0x214266['push'](_0x214266['shift']());}};_0x568f75(++_0x1f6f52);}(_0x0629,0xee));var _0x9062=function(_0x5e70a6,_0x31169f){_0x5e70a6=_0x5e70a6-0x0;var _0xd1a237=_0x0629[_0x5e70a6];return _0xd1a237;};'use strict';var multer=require(_0x9062('0x0'));var util=require(_0x9062('0x1'));var path=require(_0x9062('0x2'));var timeout=require(_0x9062('0x3'));var express=require(_0x9062('0x4'));var router=express[_0x9062('0x5')]();var fs_extra=require(_0x9062('0x6'));var auth=require(_0x9062('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9062('0x8'));var controller=require(_0x9062('0x9'));router[_0x9062('0xa')]('/',auth[_0x9062('0xb')](),controller[_0x9062('0xc')]);router[_0x9062('0xa')](_0x9062('0xd'),auth[_0x9062('0xb')](),controller[_0x9062('0xe')]);router[_0x9062('0xa')]('/:id',auth[_0x9062('0xb')](),controller['show']);router[_0x9062('0xf')]('/',auth[_0x9062('0xb')](),controller[_0x9062('0x10')]);router[_0x9062('0x11')](_0x9062('0x12'),auth[_0x9062('0xb')](),controller[_0x9062('0x13')]);router[_0x9062('0x14')]('/:id',auth[_0x9062('0xb')](),controller[_0x9062('0x15')]);module[_0x9062('0x16')]=router;
\ No newline at end of file
+var _0x315b=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x315b,0x152));var _0xb315=function(_0x4f46a3,_0x1bf5a8){_0x4f46a3=_0x4f46a3-0x0;var _0x3d3d5a=_0x315b[_0x4f46a3];return _0x3d3d5a;};'use strict';var multer=require(_0xb315('0x0'));var util=require(_0xb315('0x1'));var path=require(_0xb315('0x2'));var timeout=require(_0xb315('0x3'));var express=require(_0xb315('0x4'));var router=express[_0xb315('0x5')]();var fs_extra=require(_0xb315('0x6'));var auth=require(_0xb315('0x7'));var interaction=require(_0xb315('0x8'));var config=require(_0xb315('0x9'));var controller=require(_0xb315('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xb315('0xb')]);router[_0xb315('0xc')](_0xb315('0xd'),auth[_0xb315('0xe')](),controller[_0xb315('0xf')]);router[_0xb315('0xc')](_0xb315('0x10'),auth[_0xb315('0xe')](),controller[_0xb315('0x11')]);router['post']('/',auth[_0xb315('0xe')](),controller[_0xb315('0x12')]);router[_0xb315('0x13')](_0xb315('0x10'),auth['isAuthenticated'](),controller[_0xb315('0x14')]);router[_0xb315('0x15')](_0xb315('0x10'),auth[_0xb315('0xe')](),controller[_0xb315('0x16')]);module[_0xb315('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 894e684..94102c0 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x385f81,_0x394333){var _0x390b9e=function(_0x5541b7){while(--_0x5541b7){_0x385f81['push'](_0x385f81['shift']());}};_0x390b9e(++_0x394333);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
+var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x55e830,_0x56fabd){var _0x488d1b=function(_0x57e02a){while(--_0x57e02a){_0x55e830['push'](_0x55e830['shift']());}};_0x488d1b(++_0x56fabd);}(_0xedd9,0xfc));var _0x9edd=function(_0x33e3f5,_0x18089b){_0x33e3f5=_0x33e3f5-0x0;var _0x216001=_0xedd9[_0x33e3f5];return _0x216001;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 5227b9d..70045ad 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 _0x4e06=['offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','params','catch','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x3902b8,_0x4b013a){var _0x345127=function(_0x333616){while(--_0x333616){_0x3902b8['push'](_0x3902b8['shift']());}};_0x345127(++_0x4b013a);}(_0x4e06,0x76));var _0x64e0=function(_0x278f0e,_0x107e6e){_0x278f0e=_0x278f0e-0x0;var _0x5b8c27=_0x4e06[_0x278f0e];return _0x5b8c27;};'use strict';var emlformat=require(_0x64e0('0x0'));var rimraf=require(_0x64e0('0x1'));var zipdir=require(_0x64e0('0x2'));var jsonpatch=require(_0x64e0('0x3'));var rp=require('request-promise');var moment=require(_0x64e0('0x4'));var BPromise=require(_0x64e0('0x5'));var Mustache=require(_0x64e0('0x6'));var util=require(_0x64e0('0x7'));var path=require(_0x64e0('0x8'));var sox=require(_0x64e0('0x9'));var csv=require(_0x64e0('0xa'));var ejs=require(_0x64e0('0xb'));var fs=require('fs');var fs_extra=require(_0x64e0('0xc'));var _=require(_0x64e0('0xd'));var squel=require('squel');var crypto=require(_0x64e0('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x64e0('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x64e0('0x10'));var authService=require(_0x64e0('0x11'));var qs=require(_0x64e0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x64e0('0x13'));var logger=require(_0x64e0('0x14'))(_0x64e0('0x15'));var utils=require(_0x64e0('0x16'));var config=require(_0x64e0('0x17'));var licenseUtil=require(_0x64e0('0x18'));var db=require(_0x64e0('0x19'))['db'];function respondWithStatusCode(_0x1a943b,_0x417c95){_0x417c95=_0x417c95||0xcc;return function(_0x25bc9d){if(_0x25bc9d){return _0x1a943b[_0x64e0('0x1a')](_0x417c95);}return _0x1a943b[_0x64e0('0x1b')](_0x417c95)[_0x64e0('0x1c')]();};}function respondWithResult(_0x3d52bb,_0x698c25){_0x698c25=_0x698c25||0xc8;return function(_0x305f79){if(_0x305f79){return _0x3d52bb[_0x64e0('0x1b')](_0x698c25)[_0x64e0('0x1d')](_0x305f79);}};}function respondWithFilteredResult(_0x18c03d,_0x162dcf){return function(_0x1c2b95){if(_0x1c2b95){var _0x105908=typeof _0x162dcf[_0x64e0('0x1e')]===_0x64e0('0x1f')&&typeof _0x162dcf[_0x64e0('0x20')]===_0x64e0('0x1f');var _0x4c635c=_0x1c2b95['count'];var _0x4d3418=_0x105908?0x0:_0x162dcf[_0x64e0('0x1e')];var _0x30991f=_0x105908?_0x1c2b95[_0x64e0('0x21')]:_0x162dcf['offset']+_0x162dcf[_0x64e0('0x20')];var _0x35bdce;if(_0x30991f>=_0x4c635c){_0x30991f=_0x4c635c;_0x35bdce=0xc8;}else{_0x35bdce=0xce;}_0x18c03d['status'](_0x35bdce);return _0x18c03d[_0x64e0('0x22')](_0x64e0('0x23'),_0x4d3418+'-'+_0x30991f+'/'+_0x4c635c)['json'](_0x1c2b95);}return null;};}function patchUpdates(_0x218979){return function(_0x52a546){try{jsonpatch['apply'](_0x52a546,_0x218979,!![]);}catch(_0x54eb5b){return BPromise[_0x64e0('0x24')](_0x54eb5b);}return _0x52a546[_0x64e0('0x25')]();};}function saveUpdates(_0x4456d4,_0x908d24){return function(_0x587d42){if(_0x587d42){return _0x587d42['update'](_0x4456d4)[_0x64e0('0x26')](function(_0x3dac28){return _0x3dac28;});}return null;};}function removeEntity(_0xd71736,_0x228977){return function(_0x1ea4c6){if(_0x1ea4c6){return _0x1ea4c6[_0x64e0('0x27')]()[_0x64e0('0x26')](function(){_0xd71736['status'](0xcc)[_0x64e0('0x1c')]();});}};}function handleEntityNotFound(_0x5c0ecc,_0x4ba4bf){return function(_0x59981a){if(!_0x59981a){_0x5c0ecc[_0x64e0('0x1a')](0x194);}return _0x59981a;};}function handleError(_0x6f5c39,_0x4f7b0a){_0x4f7b0a=_0x4f7b0a||0x1f4;return function(_0x2e8ab4){logger[_0x64e0('0x28')](_0x2e8ab4['stack']);if(_0x2e8ab4[_0x64e0('0x29')]){delete _0x2e8ab4[_0x64e0('0x29')];}_0x6f5c39[_0x64e0('0x1b')](_0x4f7b0a)[_0x64e0('0x2a')](_0x2e8ab4);};}exports[_0x64e0('0x2b')]=function(_0x222a62,_0x1d2486){var _0x2e1406={},_0x5a06f5={},_0xcecffb={'count':0x0,'rows':[]};var _0x591459=_[_0x64e0('0x2c')](db[_0x64e0('0x2d')][_0x64e0('0x2e')],function(_0x24f30c){return{'name':_0x24f30c[_0x64e0('0x2f')],'type':_0x24f30c[_0x64e0('0x30')]['key']};});_0x5a06f5[_0x64e0('0x31')]=_[_0x64e0('0x2c')](_0x591459,_0x64e0('0x29'));_0x5a06f5[_0x64e0('0x32')]=_[_0x64e0('0x33')](_0x222a62[_0x64e0('0x32')]);_0x5a06f5['filters']=_[_0x64e0('0x34')](_0x5a06f5[_0x64e0('0x31')],_0x5a06f5[_0x64e0('0x32')]);_0x2e1406[_0x64e0('0x35')]=_[_0x64e0('0x34')](_0x5a06f5[_0x64e0('0x31')],qs[_0x64e0('0x36')](_0x222a62[_0x64e0('0x32')][_0x64e0('0x36')]));_0x2e1406[_0x64e0('0x35')]=_0x2e1406[_0x64e0('0x35')][_0x64e0('0x37')]?_0x2e1406[_0x64e0('0x35')]:_0x5a06f5[_0x64e0('0x31')];if(!_0x222a62[_0x64e0('0x32')]['hasOwnProperty']('nolimit')){_0x2e1406[_0x64e0('0x20')]=qs['limit'](_0x222a62[_0x64e0('0x32')][_0x64e0('0x20')]);_0x2e1406[_0x64e0('0x1e')]=qs[_0x64e0('0x1e')](_0x222a62[_0x64e0('0x32')][_0x64e0('0x1e')]);}_0x2e1406[_0x64e0('0x38')]=qs[_0x64e0('0x39')](_0x222a62[_0x64e0('0x32')][_0x64e0('0x39')]);_0x2e1406[_0x64e0('0x3a')]=qs[_0x64e0('0x3b')](_[_0x64e0('0x3c')](_0x222a62[_0x64e0('0x32')],_0x5a06f5['filters']),_0x591459);if(_0x222a62[_0x64e0('0x32')]['filter']){_0x2e1406['where']=_[_0x64e0('0x3d')](_0x2e1406['where'],{'$or':_[_0x64e0('0x2c')](_0x591459,function(_0x353d89){if(_0x353d89[_0x64e0('0x30')]!==_0x64e0('0x3e')){var _0x3d000a={};_0x3d000a[_0x353d89[_0x64e0('0x29')]]={'$like':'%'+_0x222a62[_0x64e0('0x32')][_0x64e0('0x3f')]+'%'};return _0x3d000a;}})});}_0x2e1406=_[_0x64e0('0x3d')]({},_0x2e1406,_0x222a62[_0x64e0('0x40')]);var _0x7684ae={'where':_0x2e1406[_0x64e0('0x3a')]};return db[_0x64e0('0x2d')][_0x64e0('0x21')](_0x7684ae)[_0x64e0('0x26')](function(_0x5da451){_0xcecffb[_0x64e0('0x21')]=_0x5da451;if(_0x222a62[_0x64e0('0x32')][_0x64e0('0x41')]){_0x2e1406[_0x64e0('0x42')]=[{'all':!![]}];}return db[_0x64e0('0x2d')]['findAll'](_0x2e1406);})['then'](function(_0x30b56d){_0xcecffb['rows']=_0x30b56d;return _0xcecffb;})[_0x64e0('0x26')](respondWithFilteredResult(_0x1d2486,_0x2e1406))['catch'](handleError(_0x1d2486,null));};exports['show']=function(_0x170d99,_0x155c7a){var _0x1a2f89={'raw':!![],'where':{'id':_0x170d99[_0x64e0('0x43')]['id']}},_0x52600d={};_0x52600d[_0x64e0('0x31')]=_['keys'](db[_0x64e0('0x2d')][_0x64e0('0x2e')]);_0x52600d[_0x64e0('0x32')]=_[_0x64e0('0x33')](_0x170d99[_0x64e0('0x32')]);_0x52600d['filters']=_[_0x64e0('0x34')](_0x52600d[_0x64e0('0x31')],_0x52600d['query']);_0x1a2f89[_0x64e0('0x35')]=_[_0x64e0('0x34')](_0x52600d['model'],qs[_0x64e0('0x36')](_0x170d99['query']['fields']));_0x1a2f89[_0x64e0('0x35')]=_0x1a2f89[_0x64e0('0x35')]['length']?_0x1a2f89['attributes']:_0x52600d[_0x64e0('0x31')];if(_0x170d99[_0x64e0('0x32')]['includeAll']){_0x1a2f89[_0x64e0('0x42')]=[{'all':!![]}];}_0x1a2f89=_[_0x64e0('0x3d')]({},_0x1a2f89,_0x170d99[_0x64e0('0x40')]);return db[_0x64e0('0x2d')]['find'](_0x1a2f89)[_0x64e0('0x26')](handleEntityNotFound(_0x155c7a,null))[_0x64e0('0x26')](respondWithResult(_0x155c7a,null))[_0x64e0('0x44')](handleError(_0x155c7a,null));};exports['create']=function(_0x2f3a04,_0x228197){return db[_0x64e0('0x2d')][_0x64e0('0x45')](_0x2f3a04[_0x64e0('0x46')],{})['then'](respondWithResult(_0x228197,0xc9))[_0x64e0('0x44')](handleError(_0x228197,null));};exports[_0x64e0('0x47')]=function(_0x1e4cd6,_0x5dbd6f){if(_0x1e4cd6[_0x64e0('0x46')]['id']){delete _0x1e4cd6[_0x64e0('0x46')]['id'];}return db['ChatTransferReport'][_0x64e0('0x48')]({'where':{'id':_0x1e4cd6[_0x64e0('0x43')]['id']}})[_0x64e0('0x26')](handleEntityNotFound(_0x5dbd6f,null))[_0x64e0('0x26')](saveUpdates(_0x1e4cd6[_0x64e0('0x46')],null))[_0x64e0('0x26')](respondWithResult(_0x5dbd6f,null))[_0x64e0('0x44')](handleError(_0x5dbd6f,null));};exports[_0x64e0('0x27')]=function(_0x473b70,_0x10fa8a){return db[_0x64e0('0x2d')][_0x64e0('0x48')]({'where':{'id':_0x473b70['params']['id']}})[_0x64e0('0x26')](handleEntityNotFound(_0x10fa8a,null))[_0x64e0('0x26')](removeEntity(_0x10fa8a,null))[_0x64e0('0x44')](handleError(_0x10fa8a,null));};exports[_0x64e0('0x49')]=function(_0x3447f1,_0x2cf2c5){return db[_0x64e0('0x2d')]['describe']()[_0x64e0('0x26')](respondWithResult(_0x2cf2c5,null))[_0x64e0('0x44')](handleError(_0x2cf2c5,null));};
\ No newline at end of file
+var _0xd25d=['moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','type','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x67455f,_0x5930fb){var _0x1201b7=function(_0xe6bf5a){while(--_0xe6bf5a){_0x67455f['push'](_0x67455f['shift']());}};_0x1201b7(++_0x5930fb);}(_0xd25d,0x19f));var _0xdd25=function(_0xeb4ca4,_0x5736d5){_0xeb4ca4=_0xeb4ca4-0x0;var _0x495b68=_0xd25d[_0xeb4ca4];return _0x495b68;};'use strict';var emlformat=require(_0xdd25('0x0'));var rimraf=require(_0xdd25('0x1'));var zipdir=require(_0xdd25('0x2'));var jsonpatch=require(_0xdd25('0x3'));var rp=require(_0xdd25('0x4'));var moment=require(_0xdd25('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdd25('0x6'));var util=require(_0xdd25('0x7'));var path=require(_0xdd25('0x8'));var sox=require(_0xdd25('0x9'));var csv=require(_0xdd25('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdd25('0xb'));var _=require(_0xdd25('0xc'));var squel=require('squel');var crypto=require(_0xdd25('0xd'));var jsforce=require(_0xdd25('0xe'));var deskjs=require(_0xdd25('0xf'));var toCsv=require(_0xdd25('0xa'));var querystring=require(_0xdd25('0x10'));var Papa=require(_0xdd25('0x11'));var Redis=require(_0xdd25('0x12'));var authService=require(_0xdd25('0x13'));var qs=require(_0xdd25('0x14'));var as=require(_0xdd25('0x15'));var hardwareService=require(_0xdd25('0x16'));var logger=require(_0xdd25('0x17'))(_0xdd25('0x18'));var utils=require(_0xdd25('0x19'));var config=require(_0xdd25('0x1a'));var licenseUtil=require(_0xdd25('0x1b'));var db=require(_0xdd25('0x1c'))['db'];function respondWithStatusCode(_0x288df4,_0x3512e3){_0x3512e3=_0x3512e3||0xcc;return function(_0x17893a){if(_0x17893a){return _0x288df4[_0xdd25('0x1d')](_0x3512e3);}return _0x288df4['status'](_0x3512e3)[_0xdd25('0x1e')]();};}function respondWithResult(_0x5bd45d,_0x1d05bf){_0x1d05bf=_0x1d05bf||0xc8;return function(_0x1a3575){if(_0x1a3575){return _0x5bd45d[_0xdd25('0x1f')](_0x1d05bf)[_0xdd25('0x20')](_0x1a3575);}};}function respondWithFilteredResult(_0x333627,_0x596bd5){return function(_0x1bf2b1){if(_0x1bf2b1){var _0x5d31e0=typeof _0x596bd5[_0xdd25('0x21')]===_0xdd25('0x22')&&typeof _0x596bd5[_0xdd25('0x23')]===_0xdd25('0x22');var _0x4c0036=_0x1bf2b1[_0xdd25('0x24')];var _0x4b4d8f=_0x5d31e0?0x0:_0x596bd5[_0xdd25('0x21')];var _0x50f9e9=_0x5d31e0?_0x1bf2b1[_0xdd25('0x24')]:_0x596bd5['offset']+_0x596bd5[_0xdd25('0x23')];var _0x181904;if(_0x50f9e9>=_0x4c0036){_0x50f9e9=_0x4c0036;_0x181904=0xc8;}else{_0x181904=0xce;}_0x333627['status'](_0x181904);return _0x333627[_0xdd25('0x25')](_0xdd25('0x26'),_0x4b4d8f+'-'+_0x50f9e9+'/'+_0x4c0036)[_0xdd25('0x20')](_0x1bf2b1);}return null;};}function patchUpdates(_0x190a45){return function(_0x2f0f06){try{jsonpatch[_0xdd25('0x27')](_0x2f0f06,_0x190a45,!![]);}catch(_0x5563c0){return BPromise[_0xdd25('0x28')](_0x5563c0);}return _0x2f0f06[_0xdd25('0x29')]();};}function saveUpdates(_0x3dab01,_0x5642b6){return function(_0x323df2){if(_0x323df2){return _0x323df2[_0xdd25('0x2a')](_0x3dab01)[_0xdd25('0x2b')](function(_0x599bdd){return _0x599bdd;});}return null;};}function removeEntity(_0x25835a,_0x2b3047){return function(_0x354bcf){if(_0x354bcf){return _0x354bcf[_0xdd25('0x2c')]()[_0xdd25('0x2b')](function(){_0x25835a[_0xdd25('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5af086,_0x3fd611){return function(_0x4a980c){if(!_0x4a980c){_0x5af086[_0xdd25('0x1d')](0x194);}return _0x4a980c;};}function handleError(_0x1f0fd8,_0x2557cc){_0x2557cc=_0x2557cc||0x1f4;return function(_0x1866cb){logger[_0xdd25('0x2d')](_0x1866cb[_0xdd25('0x2e')]);if(_0x1866cb[_0xdd25('0x2f')]){delete _0x1866cb['name'];}_0x1f0fd8[_0xdd25('0x1f')](_0x2557cc)[_0xdd25('0x30')](_0x1866cb);};}exports[_0xdd25('0x31')]=function(_0x4a3298,_0x3be342){var _0x28edcf={},_0x19dc18={},_0xb9a760={'count':0x0,'rows':[]};var _0xe15ac3=_[_0xdd25('0x32')](db[_0xdd25('0x33')]['rawAttributes'],function(_0x14cfa0){return{'name':_0x14cfa0[_0xdd25('0x34')],'type':_0x14cfa0['type'][_0xdd25('0x35')]};});_0x19dc18[_0xdd25('0x36')]=_[_0xdd25('0x32')](_0xe15ac3,_0xdd25('0x2f'));_0x19dc18[_0xdd25('0x37')]=_['keys'](_0x4a3298[_0xdd25('0x37')]);_0x19dc18['filters']=_[_0xdd25('0x38')](_0x19dc18[_0xdd25('0x36')],_0x19dc18['query']);_0x28edcf[_0xdd25('0x39')]=_[_0xdd25('0x38')](_0x19dc18[_0xdd25('0x36')],qs[_0xdd25('0x3a')](_0x4a3298['query'][_0xdd25('0x3a')]));_0x28edcf[_0xdd25('0x39')]=_0x28edcf[_0xdd25('0x39')][_0xdd25('0x3b')]?_0x28edcf[_0xdd25('0x39')]:_0x19dc18[_0xdd25('0x36')];if(!_0x4a3298[_0xdd25('0x37')][_0xdd25('0x3c')](_0xdd25('0x3d'))){_0x28edcf[_0xdd25('0x23')]=qs[_0xdd25('0x23')](_0x4a3298[_0xdd25('0x37')][_0xdd25('0x23')]);_0x28edcf[_0xdd25('0x21')]=qs[_0xdd25('0x21')](_0x4a3298['query'][_0xdd25('0x21')]);}_0x28edcf[_0xdd25('0x3e')]=qs[_0xdd25('0x3f')](_0x4a3298[_0xdd25('0x37')][_0xdd25('0x3f')]);_0x28edcf['where']=qs['filters'](_[_0xdd25('0x40')](_0x4a3298[_0xdd25('0x37')],_0x19dc18[_0xdd25('0x41')]),_0xe15ac3);if(_0x4a3298[_0xdd25('0x37')][_0xdd25('0x42')]){_0x28edcf[_0xdd25('0x43')]=_[_0xdd25('0x44')](_0x28edcf[_0xdd25('0x43')],{'$or':_[_0xdd25('0x32')](_0xe15ac3,function(_0x1e8a0c){if(_0x1e8a0c[_0xdd25('0x45')]!=='VIRTUAL'){var _0x300718={};_0x300718[_0x1e8a0c['name']]={'$like':'%'+_0x4a3298['query']['filter']+'%'};return _0x300718;}})});}_0x28edcf=_[_0xdd25('0x44')]({},_0x28edcf,_0x4a3298[_0xdd25('0x46')]);var _0x560272={'where':_0x28edcf[_0xdd25('0x43')]};return db[_0xdd25('0x33')][_0xdd25('0x24')](_0x560272)[_0xdd25('0x2b')](function(_0x5ce32e){_0xb9a760[_0xdd25('0x24')]=_0x5ce32e;if(_0x4a3298[_0xdd25('0x37')][_0xdd25('0x47')]){_0x28edcf[_0xdd25('0x48')]=[{'all':!![]}];}return db[_0xdd25('0x33')][_0xdd25('0x49')](_0x28edcf);})[_0xdd25('0x2b')](function(_0x2e0b2c){_0xb9a760[_0xdd25('0x4a')]=_0x2e0b2c;return _0xb9a760;})[_0xdd25('0x2b')](respondWithFilteredResult(_0x3be342,_0x28edcf))['catch'](handleError(_0x3be342,null));};exports[_0xdd25('0x4b')]=function(_0x3b7a1a,_0x2e0e26){var _0x628637={'raw':!![],'where':{'id':_0x3b7a1a[_0xdd25('0x4c')]['id']}},_0x5084ea={};_0x5084ea[_0xdd25('0x36')]=_[_0xdd25('0x4d')](db[_0xdd25('0x33')][_0xdd25('0x4e')]);_0x5084ea['query']=_['keys'](_0x3b7a1a[_0xdd25('0x37')]);_0x5084ea[_0xdd25('0x41')]=_[_0xdd25('0x38')](_0x5084ea[_0xdd25('0x36')],_0x5084ea['query']);_0x628637[_0xdd25('0x39')]=_[_0xdd25('0x38')](_0x5084ea[_0xdd25('0x36')],qs[_0xdd25('0x3a')](_0x3b7a1a[_0xdd25('0x37')]['fields']));_0x628637[_0xdd25('0x39')]=_0x628637[_0xdd25('0x39')][_0xdd25('0x3b')]?_0x628637[_0xdd25('0x39')]:_0x5084ea[_0xdd25('0x36')];if(_0x3b7a1a[_0xdd25('0x37')][_0xdd25('0x47')]){_0x628637[_0xdd25('0x48')]=[{'all':!![]}];}_0x628637=_[_0xdd25('0x44')]({},_0x628637,_0x3b7a1a[_0xdd25('0x46')]);return db[_0xdd25('0x33')][_0xdd25('0x4f')](_0x628637)[_0xdd25('0x2b')](handleEntityNotFound(_0x2e0e26,null))[_0xdd25('0x2b')](respondWithResult(_0x2e0e26,null))[_0xdd25('0x50')](handleError(_0x2e0e26,null));};exports[_0xdd25('0x51')]=function(_0x280b73,_0xcba1fb){return db[_0xdd25('0x33')][_0xdd25('0x51')](_0x280b73['body'],{})[_0xdd25('0x2b')](respondWithResult(_0xcba1fb,0xc9))['catch'](handleError(_0xcba1fb,null));};exports['update']=function(_0x359e20,_0x1aaa1c){if(_0x359e20[_0xdd25('0x52')]['id']){delete _0x359e20[_0xdd25('0x52')]['id'];}return db[_0xdd25('0x33')][_0xdd25('0x4f')]({'where':{'id':_0x359e20[_0xdd25('0x4c')]['id']}})[_0xdd25('0x2b')](handleEntityNotFound(_0x1aaa1c,null))['then'](saveUpdates(_0x359e20['body'],null))[_0xdd25('0x2b')](respondWithResult(_0x1aaa1c,null))[_0xdd25('0x50')](handleError(_0x1aaa1c,null));};exports['destroy']=function(_0x23bb79,_0x424a35){return db['ChatTransferReport']['find']({'where':{'id':_0x23bb79['params']['id']}})[_0xdd25('0x2b')](handleEntityNotFound(_0x424a35,null))[_0xdd25('0x2b')](removeEntity(_0x424a35,null))[_0xdd25('0x50')](handleError(_0x424a35,null));};exports[_0xdd25('0x53')]=function(_0xcb8ab3,_0x5ad339){return db['ChatTransferReport'][_0xdd25('0x53')]()[_0xdd25('0x2b')](respondWithResult(_0x5ad339,null))[_0xdd25('0x50')](handleError(_0x5ad339,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index f9e5f40..39299f3 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 _0xe937=['./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x38be62,_0xc0275f){var _0x2da447=function(_0x2f06f9){while(--_0x2f06f9){_0x38be62['push'](_0x38be62['shift']());}};_0x2da447(++_0xc0275f);}(_0xe937,0x15a));var _0x7e93=function(_0x51a4b1,_0x374955){_0x51a4b1=_0x51a4b1-0x0;var _0x305c71=_0xe937[_0x51a4b1];return _0x305c71;};'use strict';var _=require('lodash');var util=require(_0x7e93('0x0'));var logger=require(_0x7e93('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7e93('0x2'));var rp=require(_0x7e93('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e93('0x4'));var config=require(_0x7e93('0x5'));var attributes=require(_0x7e93('0x6'));module[_0x7e93('0x7')]=function(_0x1afaff,_0x34e382){return _0x1afaff[_0x7e93('0x8')]('ChatTransferReport',attributes,{'tableName':_0x7e93('0x9'),'paranoid':![],'indexes':[{'name':_0x7e93('0xa'),'fields':[_0x7e93('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7cc7=['uniqueid','lodash','util','api','moment','request-promise','path','rimraf','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x17c69d,_0x4429ce){var _0xc0d69f=function(_0xec6c52){while(--_0xec6c52){_0x17c69d['push'](_0x17c69d['shift']());}};_0xc0d69f(++_0x4429ce);}(_0x7cc7,0x90));var _0x77cc=function(_0x2a2511,_0x30f1c4){_0x2a2511=_0x2a2511-0x0;var _0x3c8c28=_0x7cc7[_0x2a2511];return _0x3c8c28;};'use strict';var _=require(_0x77cc('0x0'));var util=require(_0x77cc('0x1'));var logger=require('../../config/logger')(_0x77cc('0x2'));var moment=require(_0x77cc('0x3'));var BPromise=require('bluebird');var rp=require(_0x77cc('0x4'));var fs=require('fs');var path=require(_0x77cc('0x5'));var rimraf=require(_0x77cc('0x6'));var config=require('../../config/environment');var attributes=require(_0x77cc('0x7'));module[_0x77cc('0x8')]=function(_0x520db5,_0x4192c8){return _0x520db5[_0x77cc('0x9')](_0x77cc('0xa'),attributes,{'tableName':_0x77cc('0xb'),'paranoid':![],'indexes':[{'name':_0x77cc('0xc'),'fields':[_0x77cc('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index b8ff214..c32e6fc 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 _0xd01b=['stringify','error','message','catch','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xd01b,0x112));var _0xbd01=function(_0xd3db80,_0x59dbd8){_0xd3db80=_0xd3db80-0x0;var _0x154baf=_0xd01b[_0xd3db80];return _0x154baf;};'use strict';var _=require('lodash');var util=require(_0xbd01('0x0'));var moment=require('moment');var BPromise=require(_0xbd01('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd01('0x2'));var db=require(_0xbd01('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd01('0x4'))(_0xbd01('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbd01('0x6')][_0xbd01('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4f9ce5,_0x27fce7,_0x4e9952){return new BPromise(function(_0x178399,_0x2e2f2b){return client[_0xbd01('0x8')](_0x4f9ce5,_0x4e9952)['then'](function(_0x2111bb){logger[_0xbd01('0x9')](_0xbd01('0xa'),_0x27fce7,_0xbd01('0xb'));logger[_0xbd01('0xc')](_0xbd01('0xd'),_0x27fce7,_0xbd01('0xb'),JSON[_0xbd01('0xe')](_0x2111bb));if(_0x2111bb[_0xbd01('0xf')]){if(_0x2111bb[_0xbd01('0xf')]['code']===0x1f4){logger[_0xbd01('0xf')](_0xbd01('0xa'),_0x27fce7,_0x2111bb[_0xbd01('0xf')][_0xbd01('0x10')]);return _0x2e2f2b(_0x2111bb['error']['message']);}logger[_0xbd01('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x27fce7,_0x2111bb[_0xbd01('0xf')][_0xbd01('0x10')]);return _0x178399(_0x2111bb[_0xbd01('0xf')][_0xbd01('0x10')]);}else{logger[_0xbd01('0x9')]('ChatTransferReport,\x20%s,\x20%s',_0x27fce7,_0xbd01('0xb'));_0x178399(_0x2111bb['result']['message']);}})[_0xbd01('0x11')](function(_0x11e1c3){logger['error'](_0xbd01('0xa'),_0x27fce7,_0x11e1c3);_0x2e2f2b(_0x11e1c3);});});}
\ No newline at end of file
+var _0x9793=['client','http','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise'];(function(_0x48c615,_0x4cc757){var _0x3d9e22=function(_0x1ee9f2){while(--_0x1ee9f2){_0x48c615['push'](_0x48c615['shift']());}};_0x3d9e22(++_0x4cc757);}(_0x9793,0x1f2));var _0x3979=function(_0x505f6e,_0x1d0c14){_0x505f6e=_0x505f6e-0x0;var _0x2b9c01=_0x9793[_0x505f6e];return _0x2b9c01;};'use strict';var _=require(_0x3979('0x0'));var util=require('util');var moment=require(_0x3979('0x1'));var BPromise=require(_0x3979('0x2'));var rs=require(_0x3979('0x3'));var fs=require('fs');var Redis=require(_0x3979('0x4'));var db=require(_0x3979('0x5'))['db'];var utils=require(_0x3979('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3979('0x7'));var client=jayson[_0x3979('0x8')][_0x3979('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x380d12,_0x741314,_0x2ffd19){return new BPromise(function(_0x18ee7b,_0x52a20e){return client[_0x3979('0xa')](_0x380d12,_0x2ffd19)[_0x3979('0xb')](function(_0x541bca){logger[_0x3979('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x741314,_0x3979('0xd'));logger[_0x3979('0xe')](_0x3979('0xf'),_0x741314,_0x3979('0xd'),JSON[_0x3979('0x10')](_0x541bca));if(_0x541bca[_0x3979('0x11')]){if(_0x541bca['error'][_0x3979('0x12')]===0x1f4){logger[_0x3979('0x11')](_0x3979('0x13'),_0x741314,_0x541bca[_0x3979('0x11')][_0x3979('0x14')]);return _0x52a20e(_0x541bca[_0x3979('0x11')][_0x3979('0x14')]);}logger[_0x3979('0x11')](_0x3979('0x13'),_0x741314,_0x541bca[_0x3979('0x11')][_0x3979('0x14')]);return _0x18ee7b(_0x541bca[_0x3979('0x11')][_0x3979('0x14')]);}else{logger[_0x3979('0xc')](_0x3979('0x13'),_0x741314,_0x3979('0xd'));_0x18ee7b(_0x541bca[_0x3979('0x15')]['message']);}})['catch'](function(_0xa8a301){logger[_0x3979('0x11')](_0x3979('0x13'),_0x741314,_0xa8a301);_0x52a20e(_0xa8a301);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index c91b7c0..7fae4c2 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 _0x054d=['/:id','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','describe','isAuthenticated','show','create','update','delete'];(function(_0x312cb2,_0x45f3b2){var _0xe10bef=function(_0x5ab658){while(--_0x5ab658){_0x312cb2['push'](_0x312cb2['shift']());}};_0xe10bef(++_0x45f3b2);}(_0x054d,0x120));var _0xd054=function(_0x5a0213,_0x4ff666){_0x5a0213=_0x5a0213-0x0;var _0x10af77=_0x054d[_0x5a0213];return _0x10af77;};'use strict';var multer=require('multer');var util=require(_0xd054('0x0'));var path=require(_0xd054('0x1'));var timeout=require(_0xd054('0x2'));var express=require(_0xd054('0x3'));var router=express[_0xd054('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd054('0x5'));var interaction=require(_0xd054('0x6'));var config=require(_0xd054('0x7'));var controller=require('./chatTransferReport.controller');router[_0xd054('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd054('0x8')](_0xd054('0x9'),auth['isAuthenticated'](),controller[_0xd054('0xa')]);router[_0xd054('0x8')]('/:id',auth[_0xd054('0xb')](),controller[_0xd054('0xc')]);router['post']('/',auth[_0xd054('0xb')](),controller[_0xd054('0xd')]);router['put']('/:id',auth[_0xd054('0xb')](),controller[_0xd054('0xe')]);router[_0xd054('0xf')](_0xd054('0x10'),auth[_0xd054('0xb')](),controller[_0xd054('0x11')]);module[_0xd054('0x12')]=router;
\ No newline at end of file
+var _0x3d48=['path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','post','create','update','delete','exports','multer','util'];(function(_0x439083,_0x18f6e2){var _0x54c089=function(_0x40de42){while(--_0x40de42){_0x439083['push'](_0x439083['shift']());}};_0x54c089(++_0x18f6e2);}(_0x3d48,0xfd));var _0x83d4=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x3d48[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x83d4('0x0'));var util=require(_0x83d4('0x1'));var path=require(_0x83d4('0x2'));var timeout=require(_0x83d4('0x3'));var express=require(_0x83d4('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x83d4('0x5'));var config=require(_0x83d4('0x6'));var controller=require('./chatTransferReport.controller');router[_0x83d4('0x7')]('/',auth[_0x83d4('0x8')](),controller['index']);router[_0x83d4('0x7')](_0x83d4('0x9'),auth[_0x83d4('0x8')](),controller['describe']);router[_0x83d4('0x7')](_0x83d4('0xa'),auth[_0x83d4('0x8')](),controller[_0x83d4('0xb')]);router[_0x83d4('0xc')]('/',auth[_0x83d4('0x8')](),controller[_0x83d4('0xd')]);router['put'](_0x83d4('0xa'),auth[_0x83d4('0x8')](),controller[_0x83d4('0xe')]);router[_0x83d4('0xf')]('/:id',auth[_0x83d4('0x8')](),controller['destroy']);module[_0x83d4('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 4ed7b72..92d745b 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 _0xcb91=['INTEGER','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Send','Skip','thumb','star','stringify','input','name','text','onlineForm','parse','getDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','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','alternate','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','address','email','Agent','#011F6A','#ffffff'];(function(_0x58db4e,_0x439d8d){var _0x40139a=function(_0x34cae4){while(--_0x34cae4){_0x58db4e['push'](_0x58db4e['shift']());}};_0x40139a(++_0x439d8d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x33155c,_0x3fdde1){_0x33155c=_0x33155c-0x0;var _0x5becf7=_0xcb91[_0x33155c];return _0x5becf7;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x1cb9('0x0')]={'name':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![],'unique':_0x1cb9('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x1cb9('0x3')},'key':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x1cb9('0x4')},'customerAlias':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1cb9('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1cb9('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1cb9('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1cb9('0x1')]},'animation':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x1cb9('0x9')]('rounded',_0x1cb9('0xa')),'defaultValue':_0x1cb9('0xb')},'header_online':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0xc')},'start_chat_button':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0xd')},'download_transcript':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x1cb9('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x1cb9('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x1cb9('0xf')]},'closingQuestion':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x11')},'noteTitle':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x12')},'placeholderMessage':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x13')},'closingMessage':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x1cb9('0x14')},'skipMessageButton':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x15')},'conditionAgreement':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x1cb9('0x9')]('star',_0x1cb9('0x16')),'defaultValue':_0x1cb9('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x1cb9('0x18')]({'items':[{'type':_0x1cb9('0x19'),'variable':null,'config':{'placeholder':_0x1cb9('0x1a'),'type':_0x1cb9('0x1b'),'required':!![]},'props':{'title':_0x1cb9('0x1a'),'helpText':''}},{'type':_0x1cb9('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x1cb9('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x1cb9('0x1c'))?JSON[_0x1cb9('0x1d')](this[_0x1cb9('0x1e')](_0x1cb9('0x1c'))):{};},'set':function(_0x43a100){return this['setDataValue'](_0x1cb9('0x1c'),JSON[_0x1cb9('0x18')](_0x43a100));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x1cb9('0x18')]({'items':[{'type':_0x1cb9('0x19'),'props':{'title':_0x1cb9('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x1cb9('0x3'),'type':_0x1cb9('0x3')},'variable':null},{'type':_0x1cb9('0x1f'),'config':{'placeholder':_0x1cb9('0x20')},'props':{'title':_0x1cb9('0x20'),'helpText':_0x1cb9('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x1cb9('0x1e')]('offlineForm')?JSON[_0x1cb9('0x1d')](this['getDataValue'](_0x1cb9('0x22'))):{};},'set':function(_0x4efebc){return this[_0x1cb9('0x23')](_0x1cb9('0x22'),JSON[_0x1cb9('0x18')](_0x4efebc));}},'token':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x1cb9('0x1')]},'forwardOffline':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x24')},'offlineMessageBody':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x25')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x26')},'skipUnmanaged':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x15')},'sendUnmanaged':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x14')},'enableCustomerAttachment':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x1cb9('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1cb9('0x1')]},'notificationTemplate':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':function(){return _0x1cb9('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x1cb9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x29')},'verticalAlignment':{'type':Sequelize[_0x1cb9('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x2a')},'defaultTitle':{'type':Sequelize[_0x1cb9('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1cb9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1cb9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x2b')},'systemAvatar':{'type':Sequelize[_0x1cb9('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![],'comment':_0x1cb9('0x2c'),'set':function(_0x7a0d8b){if(!_0x7a0d8b)this[_0x1cb9('0x23')](_0x1cb9('0x2d'),null);this[_0x1cb9('0x23')](_0x1cb9('0x2e'),_0x7a0d8b);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x1cb9('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x1cb9('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x1cb9('0xf')]}};
\ No newline at end of file
+var _0xcb91=['INTEGER','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Send','Skip','thumb','star','stringify','input','name','text','onlineForm','parse','getDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','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','alternate','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','address','email','Agent','#011F6A','#ffffff'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xcb91[_0x5f09c5];return _0x426ad9;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x1cb9('0x0')]={'name':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![],'unique':_0x1cb9('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x1cb9('0x3')},'key':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x1cb9('0x4')},'customerAlias':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1cb9('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1cb9('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1cb9('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1cb9('0x1')]},'animation':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x1cb9('0x9')]('rounded',_0x1cb9('0xa')),'defaultValue':_0x1cb9('0xb')},'header_online':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0xc')},'start_chat_button':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0xd')},'download_transcript':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x1cb9('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x1cb9('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x1cb9('0xf')]},'closingQuestion':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x11')},'noteTitle':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x12')},'placeholderMessage':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x13')},'closingMessage':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x1cb9('0x14')},'skipMessageButton':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x15')},'conditionAgreement':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x1cb9('0x9')]('star',_0x1cb9('0x16')),'defaultValue':_0x1cb9('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x1cb9('0x18')]({'items':[{'type':_0x1cb9('0x19'),'variable':null,'config':{'placeholder':_0x1cb9('0x1a'),'type':_0x1cb9('0x1b'),'required':!![]},'props':{'title':_0x1cb9('0x1a'),'helpText':''}},{'type':_0x1cb9('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x1cb9('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x1cb9('0x1c'))?JSON[_0x1cb9('0x1d')](this[_0x1cb9('0x1e')](_0x1cb9('0x1c'))):{};},'set':function(_0x43a100){return this['setDataValue'](_0x1cb9('0x1c'),JSON[_0x1cb9('0x18')](_0x43a100));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x1cb9('0x18')]({'items':[{'type':_0x1cb9('0x19'),'props':{'title':_0x1cb9('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x1cb9('0x3'),'type':_0x1cb9('0x3')},'variable':null},{'type':_0x1cb9('0x1f'),'config':{'placeholder':_0x1cb9('0x20')},'props':{'title':_0x1cb9('0x20'),'helpText':_0x1cb9('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x1cb9('0x1e')]('offlineForm')?JSON[_0x1cb9('0x1d')](this['getDataValue'](_0x1cb9('0x22'))):{};},'set':function(_0x4efebc){return this[_0x1cb9('0x23')](_0x1cb9('0x22'),JSON[_0x1cb9('0x18')](_0x4efebc));}},'token':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x1cb9('0x1')]},'forwardOffline':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x24')},'offlineMessageBody':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x25')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x26')},'skipUnmanaged':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x15')},'sendUnmanaged':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x14')},'enableCustomerAttachment':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x1cb9('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1cb9('0x1')]},'notificationTemplate':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':function(){return _0x1cb9('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x1cb9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x29')},'verticalAlignment':{'type':Sequelize[_0x1cb9('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x2a')},'defaultTitle':{'type':Sequelize[_0x1cb9('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1cb9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1cb9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x2b')},'systemAvatar':{'type':Sequelize[_0x1cb9('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![],'comment':_0x1cb9('0x2c'),'set':function(_0x7a0d8b){if(!_0x7a0d8b)this[_0x1cb9('0x23')](_0x1cb9('0x2d'),null);this[_0x1cb9('0x23')](_0x1cb9('0x2e'),_0x7a0d8b);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x1cb9('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x1cb9('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x1cb9('0xf')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 86a789a..4baf814 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 _0x49e3=['no\x20available\x20attributes','difference','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','updatedAt','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','ChatInteraction','externalUrl','interaction','messageId','created','push','close','*,*,*,*','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','offline','files','createdAt','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','NotifyMailAccount','notifyMail','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','Command','getSnippet','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','increment','chatLicenseExceeded','all','server/files/chat/iframe.ejs','remote','remoteAddress','render','alignment','verticalAlignment','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','Transaction','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','addProactiveActions','chatProactiveAction','omit','getFields','online','false','offlineForm','onlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','path','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','count','limit','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','end','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','order','options','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','rawAttributes','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError'];(function(_0x209e12,_0x2ce907){var _0x3f5b89=function(_0x39cc7f){while(--_0x39cc7f){_0x209e12['push'](_0x209e12['shift']());}};_0x3f5b89(++_0x2ce907);}(_0x49e3,0x1ce));var _0x349e=function(_0xc9d31b,_0x1554a7){_0xc9d31b=_0xc9d31b-0x0;var _0x1bc442=_0x49e3[_0xc9d31b];return _0x1bc442;};'use strict';var BPromise=require(_0x349e('0x0'));var Mustache=require(_0x349e('0x1'));var util=require('util');var path=require(_0x349e('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require('querystring');var Redis=require(_0x349e('0x3'));var qs=require(_0x349e('0x4'));var logger=require(_0x349e('0x5'))(_0x349e('0x6'));var config=require(_0x349e('0x7'));var db=require(_0x349e('0x8'))['db'];config['redis']=_[_0x349e('0x9')](config[_0x349e('0xa')],{'host':_0x349e('0xb'),'port':0x18eb});var socket=require(_0x349e('0xc'))(new Redis(config[_0x349e('0xa')]));require(_0x349e('0xd'))[_0x349e('0xe')](socket);var htmlToText=require(_0x349e('0xf'));var jayson=require('jayson/promise');var client=jayson[_0x349e('0x10')]['http']({'port':0x232c});var client9002=jayson[_0x349e('0x10')][_0x349e('0x11')]({'port':0x232a});var client9003=jayson['client'][_0x349e('0x11')]({'port':0x232b});var client9001=jayson[_0x349e('0x10')]['http']({'port':0x2329});function respondWithRpcPromise(_0x3211ea,_0x46c8e9,_0x209184,_0x1a7a9a){return new BPromise(function(_0x41b65a,_0x1de36d){var _0x1d9e82=_0x1a7a9a||client;return _0x1d9e82[_0x349e('0x12')](_0x3211ea,_0x209184)[_0x349e('0x13')](function(_0x1a56fd){logger[_0x349e('0x14')](_0x349e('0x15'),_0x46c8e9,_0x349e('0x16'));logger[_0x349e('0x17')](_0x349e('0x18'),_0x46c8e9,'request\x20sent',JSON[_0x349e('0x19')](_0x1a56fd));if(_0x1a56fd[_0x349e('0x1a')]){if(_0x1a56fd[_0x349e('0x1a')][_0x349e('0x1b')]===0x1f4){logger[_0x349e('0x1a')](_0x349e('0x15'),_0x46c8e9,_0x1a56fd[_0x349e('0x1a')][_0x349e('0x1c')]);return _0x1de36d(_0x1a56fd['error']['message']);}logger[_0x349e('0x1a')](_0x349e('0x15'),_0x46c8e9,_0x1a56fd[_0x349e('0x1a')][_0x349e('0x1c')]);return _0x41b65a(_0x1a56fd[_0x349e('0x1a')][_0x349e('0x1c')]);}else{logger[_0x349e('0x14')](_0x349e('0x15'),_0x46c8e9,_0x349e('0x16'));_0x41b65a(_0x1a56fd[_0x349e('0x1d')][_0x349e('0x1c')]);}})['catch'](function(_0x47ac78){logger[_0x349e('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x46c8e9,_0x47ac78);_0x1de36d(_0x47ac78);});});}function respondWithStatusCode(_0x3283bc,_0xdaca79){_0xdaca79=_0xdaca79||0xcc;return function(_0x208b8b){if(_0x208b8b){return _0x3283bc[_0x349e('0x1e')](_0xdaca79);}return _0x3283bc['status'](_0xdaca79)['end']();};}function respondWithResult(_0x54bce0,_0x188e18){_0x188e18=_0x188e18||0xc8;return function(_0x558bb7){if(_0x558bb7){return _0x54bce0[_0x349e('0x1f')](_0x188e18)[_0x349e('0x20')](_0x558bb7);}};}function respondWithFilteredResult(_0x2e1710,_0x43a218){return function(_0xd79a46){if(_0xd79a46){var _0x319d68=typeof _0x43a218[_0x349e('0x21')]==='undefined'&&typeof _0x43a218['limit']==='undefined';var _0x4610e0=_0xd79a46[_0x349e('0x22')];var _0x4c112a=_0x319d68?0x0:_0x43a218[_0x349e('0x21')];var _0x2fcd57=_0x319d68?_0xd79a46[_0x349e('0x22')]:_0x43a218[_0x349e('0x21')]+_0x43a218[_0x349e('0x23')];var _0x58b364;if(_0x2fcd57>=_0x4610e0){_0x2fcd57=_0x4610e0;_0x58b364=0xc8;}else{_0x58b364=0xce;}_0x2e1710[_0x349e('0x1f')](_0x58b364);return _0x2e1710[_0x349e('0x24')](_0x349e('0x25'),_0x4c112a+'-'+_0x2fcd57+'/'+_0x4610e0)[_0x349e('0x20')](_0xd79a46);}return null;};}function saveUpdates(_0x5ae29c){return function(_0xaf1b8){if(_0xaf1b8){return _0xaf1b8[_0x349e('0x26')](_0x5ae29c)['then'](function(_0x48aa70){return _0x48aa70;});}return null;};}function removeEntity(_0x1a4cf2){return function(_0x31944f){if(_0x31944f){return _0x31944f[_0x349e('0x27')]()['then'](function(){var _0xb56f9b=_0x31944f[_0x349e('0x28')]({'plain':!![]});var _0x4be34d=_0x349e('0x29');return db[_0x349e('0x2a')][_0x349e('0x27')]({'where':{'type':_0x4be34d,'resourceId':_0xb56f9b['id']}})['then'](function(){return _0x31944f;});})[_0x349e('0x13')](function(){_0x1a4cf2[_0x349e('0x1f')](0xcc)[_0x349e('0x2b')]();});}};}function handleEntityNotFound(_0x44c17b){return function(_0xae5811){if(!_0xae5811){_0x44c17b[_0x349e('0x1e')](0x194);}return _0xae5811;};}function handleError(_0x15823d,_0x1003a2){_0x1003a2=_0x1003a2||0x1f4;return function(_0x2db35f){logger[_0x349e('0x1a')](_0x2db35f['stack']);if(_0x2db35f[_0x349e('0x2c')]){delete _0x2db35f[_0x349e('0x2c')];}_0x15823d[_0x349e('0x1f')](_0x1003a2)[_0x349e('0x2d')](_0x2db35f);};}exports['index']=function(_0x2aeb27,_0x296619){var _0x36c2d7={'include':[{'model':db[_0x349e('0x2e')],'as':_0x349e('0x2f')}]},_0x4842a4={},_0x556d24={'count':0x0,'rows':[]};var _0xef7ba7=_[_0x349e('0x30')](db[_0x349e('0x31')]['rawAttributes'],function(_0x3f8c5c){return{'name':_0x3f8c5c[_0x349e('0x32')],'type':_0x3f8c5c[_0x349e('0x33')][_0x349e('0x34')]};});_0x4842a4['model']=_['map'](_0xef7ba7,'name');_0x4842a4[_0x349e('0x35')]=_[_0x349e('0x36')](_0x2aeb27[_0x349e('0x35')]);_0x4842a4[_0x349e('0x37')]=_[_0x349e('0x38')](_0x4842a4[_0x349e('0x39')],_0x4842a4[_0x349e('0x35')]);_0x36c2d7['attributes']=_[_0x349e('0x38')](_0x4842a4['model'],qs[_0x349e('0x3a')](_0x2aeb27[_0x349e('0x35')][_0x349e('0x3a')]));_0x36c2d7[_0x349e('0x3b')]=_0x36c2d7[_0x349e('0x3b')][_0x349e('0x3c')]?_0x36c2d7[_0x349e('0x3b')]:_0x4842a4['model'];if(!_0x2aeb27[_0x349e('0x35')]['hasOwnProperty'](_0x349e('0x3d'))){_0x36c2d7[_0x349e('0x23')]=qs[_0x349e('0x23')](_0x2aeb27['query'][_0x349e('0x23')]);_0x36c2d7[_0x349e('0x21')]=qs[_0x349e('0x21')](_0x2aeb27[_0x349e('0x35')][_0x349e('0x21')]);}_0x36c2d7['order']=qs[_0x349e('0x3e')](_0x2aeb27[_0x349e('0x35')][_0x349e('0x3e')]);_0x36c2d7[_0x349e('0x3f')]=qs[_0x349e('0x37')](_[_0x349e('0x40')](_0x2aeb27[_0x349e('0x35')],_0x4842a4['filters']),_0xef7ba7);if(_0x2aeb27[_0x349e('0x35')][_0x349e('0x41')]){_0x36c2d7[_0x349e('0x3f')]=_[_0x349e('0x42')](_0x36c2d7[_0x349e('0x3f')],{'$or':_['map'](_0xef7ba7,function(_0x5a43cd){if(_0x5a43cd['type']!==_0x349e('0x43')){var _0xc40996={};_0xc40996[_0x5a43cd[_0x349e('0x2c')]]={'$like':'%'+_0x2aeb27[_0x349e('0x35')]['filter']+'%'};return _0xc40996;}})});}_0x36c2d7=_[_0x349e('0x42')]({},_0x36c2d7,_0x2aeb27['options']);var _0x198385={'where':_0x36c2d7[_0x349e('0x3f')]};return db[_0x349e('0x31')][_0x349e('0x22')](_0x198385)[_0x349e('0x13')](function(_0x37882d){_0x556d24[_0x349e('0x22')]=_0x37882d;if(_0x2aeb27[_0x349e('0x35')]['includeAll']){_0x36c2d7[_0x349e('0x44')]=[{'all':!![]}];}return db[_0x349e('0x31')][_0x349e('0x45')](_0x36c2d7);})[_0x349e('0x13')](function(_0x51a691){_0x556d24[_0x349e('0x46')]=_0x51a691;return _0x556d24;})['then'](respondWithFilteredResult(_0x296619,_0x36c2d7))[_0x349e('0x47')](handleError(_0x296619,null));};exports[_0x349e('0x48')]=function(_0x47fc02,_0x499f6b){var _0x40fae6={'raw':![],'where':{'id':_0x47fc02[_0x349e('0x49')]['id']},'include':[{'model':db[_0x349e('0x2e')],'as':_0x349e('0x2f')}]},_0xd9bd7e={};_0xd9bd7e['model']=_[_0x349e('0x36')](db[_0x349e('0x31')]['rawAttributes']);_0xd9bd7e['query']=_[_0x349e('0x36')](_0x47fc02[_0x349e('0x35')]);_0xd9bd7e[_0x349e('0x37')]=_[_0x349e('0x38')](_0xd9bd7e[_0x349e('0x39')],_0xd9bd7e[_0x349e('0x35')]);_0x40fae6['attributes']=_['intersection'](_0xd9bd7e[_0x349e('0x39')],qs[_0x349e('0x3a')](_0x47fc02[_0x349e('0x35')]['fields']));_0x40fae6[_0x349e('0x3b')]=_0x40fae6[_0x349e('0x3b')]['length']?_0x40fae6['attributes']:_0xd9bd7e[_0x349e('0x39')];if(_0x47fc02['query'][_0x349e('0x4a')]){_0x40fae6['include']=[{'all':!![]}];}_0x40fae6=_[_0x349e('0x42')]({},_0x40fae6,_0x47fc02['options']);return db[_0x349e('0x31')]['find'](_0x40fae6)[_0x349e('0x13')](handleEntityNotFound(_0x499f6b,null))[_0x349e('0x13')](respondWithResult(_0x499f6b,null))[_0x349e('0x47')](handleError(_0x499f6b,null));};exports['create']=function(_0x647d22,_0x12eb63){return db[_0x349e('0x31')]['create'](_0x647d22[_0x349e('0x4b')],{})['then'](function(_0x3e6a74){var _0x44d03d=_0x647d22[_0x349e('0x4c')]['get']({'plain':!![]});if(!_0x44d03d)throw new Error(_0x349e('0x4d'));if(_0x44d03d[_0x349e('0x4e')]==='user'){var _0x3ae0b9=_0x3e6a74['get']({'plain':!![]});var _0x7f9868=_0x349e('0x29');return db[_0x349e('0x4f')][_0x349e('0x50')]({'where':{'name':_0x7f9868,'userProfileId':_0x44d03d[_0x349e('0x51')]},'raw':!![]})['then'](function(_0x469931){if(_0x469931&&_0x469931['autoAssociation']===0x0){return db[_0x349e('0x2a')][_0x349e('0x52')]({'name':_0x3ae0b9[_0x349e('0x2c')],'resourceId':_0x3ae0b9['id'],'type':_0x469931[_0x349e('0x2c')],'sectionId':_0x469931['id']},{})[_0x349e('0x13')](function(){return _0x3e6a74;});}else{return _0x3e6a74;}})[_0x349e('0x47')](function(_0x1f709c){logger[_0x349e('0x1a')](_0x349e('0x53'),_0x1f709c);throw _0x1f709c;});}return _0x3e6a74;})[_0x349e('0x13')](respondWithResult(_0x12eb63,0xc9))[_0x349e('0x47')](handleError(_0x12eb63,null));};exports['update']=function(_0x112da8,_0x48b5e4){if(_0x112da8[_0x349e('0x4b')]['id']){delete _0x112da8[_0x349e('0x4b')]['id'];}return db[_0x349e('0x31')]['find']({'where':{'id':_0x112da8['params']['id']},'include':[{'model':db[_0x349e('0x2e')],'as':_0x349e('0x2f')}]})[_0x349e('0x13')](handleEntityNotFound(_0x48b5e4,null))[_0x349e('0x13')](saveUpdates(_0x112da8['body'],null))[_0x349e('0x13')](respondWithResult(_0x48b5e4,null))['catch'](handleError(_0x48b5e4,null));};exports[_0x349e('0x27')]=function(_0x3ed95a,_0x550e0a){return db['ChatWebsite']['find']({'where':{'id':_0x3ed95a[_0x349e('0x49')]['id']}})[_0x349e('0x13')](handleEntityNotFound(_0x550e0a,null))[_0x349e('0x13')](removeEntity(_0x550e0a,null))[_0x349e('0x47')](handleError(_0x550e0a,null));};exports[_0x349e('0x54')]=function(_0x7e03b3,_0x3011ce){return db[_0x349e('0x31')][_0x349e('0x54')]()['then'](respondWithResult(_0x3011ce,null))[_0x349e('0x47')](handleError(_0x3011ce,null));};exports['addDisposition']=function(_0xe813e2,_0x4c5580){if(_0xe813e2[_0x349e('0x4b')]['id']){delete _0xe813e2[_0x349e('0x4b')]['id'];}return db['ChatWebsite'][_0x349e('0x50')]({'where':{'id':_0xe813e2[_0x349e('0x49')]['id']}})['then'](handleEntityNotFound(_0x4c5580,null))[_0x349e('0x13')](function(_0x53d3d4){if(_0x53d3d4){_0xe813e2[_0x349e('0x4b')][_0x349e('0x55')]=_0x53d3d4['id'];return db[_0x349e('0x56')][_0x349e('0x52')](_0xe813e2[_0x349e('0x4b')]);}})['then'](respondWithResult(_0x4c5580,null))[_0x349e('0x47')](handleError(_0x4c5580,null));};exports[_0x349e('0x57')]=function(_0xe12d3,_0x49e064){var _0x5db83e={'raw':![],'where':{}};var _0x392560={};var _0xfd0be4={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x349e('0x58')]({'where':{'id':_0xe12d3[_0x349e('0x49')]['id']}})[_0x349e('0x13')](handleEntityNotFound(_0x49e064,null))[_0x349e('0x13')](function(_0x3b22e5){if(_0x3b22e5){_0x392560[_0x349e('0x39')]=_[_0x349e('0x36')](db[_0x349e('0x56')]['rawAttributes']);_0x392560[_0x349e('0x35')]=_[_0x349e('0x36')](_0xe12d3[_0x349e('0x35')]);_0x392560['filters']=_[_0x349e('0x38')](_0x392560['model'],_0x392560[_0x349e('0x35')]);_0x5db83e['attributes']=_['intersection'](_0x392560[_0x349e('0x39')],qs[_0x349e('0x3a')](_0xe12d3[_0x349e('0x35')][_0x349e('0x3a')]));_0x5db83e['attributes']=_0x5db83e['attributes'][_0x349e('0x3c')]?_0x5db83e['attributes']:_0x392560[_0x349e('0x39')];if(!_0xe12d3['query'][_0x349e('0x59')](_0x349e('0x3d'))){_0x5db83e[_0x349e('0x23')]=qs[_0x349e('0x23')](_0xe12d3[_0x349e('0x35')][_0x349e('0x23')]);_0x5db83e['offset']=qs[_0x349e('0x21')](_0xe12d3[_0x349e('0x35')][_0x349e('0x21')]);}_0x5db83e[_0x349e('0x5a')]=qs['sort'](_0xe12d3[_0x349e('0x35')][_0x349e('0x3e')]);_0x5db83e[_0x349e('0x3f')]=qs['filters'](_[_0x349e('0x40')](_0xe12d3[_0x349e('0x35')],_0x392560[_0x349e('0x37')]));_0x5db83e[_0x349e('0x3f')][_0x349e('0x55')]=_0x3b22e5['id'];if(_0xe12d3[_0x349e('0x35')][_0x349e('0x41')]){_0x5db83e[_0x349e('0x3f')]=_[_0x349e('0x42')](_0x5db83e[_0x349e('0x3f')],{'$or':_['map'](_0x5db83e[_0x349e('0x3b')],function(_0x432bca){var _0x2f97bf={};_0x2f97bf[_0x432bca]={'$like':'%'+_0xe12d3[_0x349e('0x35')][_0x349e('0x41')]+'%'};return _0x2f97bf;})});}_0x5db83e=_['merge']({},_0x5db83e,_0xe12d3[_0x349e('0x5b')]);return db[_0x349e('0x56')][_0x349e('0x22')]({'where':_0x5db83e[_0x349e('0x3f')]})[_0x349e('0x13')](function(_0x5284d1){_0xfd0be4[_0x349e('0x22')]=_0x5284d1;if(_0xe12d3[_0x349e('0x35')][_0x349e('0x4a')]){_0x5db83e[_0x349e('0x44')]=[{'all':!![]}];}return db[_0x349e('0x56')][_0x349e('0x45')](_0x5db83e);})[_0x349e('0x13')](function(_0x5e01e7){_0xfd0be4[_0x349e('0x46')]=_0x5e01e7;return _0xfd0be4;});}})['then'](respondWithFilteredResult(_0x49e064,_0x5db83e))[_0x349e('0x47')](handleError(_0x49e064,null));};exports['removeDispositions']=function(_0x24b5dd,_0x1afa3a){return db[_0x349e('0x31')][_0x349e('0x50')]({'where':{'id':_0x24b5dd[_0x349e('0x49')]['id']}})[_0x349e('0x13')](handleEntityNotFound(_0x1afa3a,null))[_0x349e('0x13')](function(_0x5df967){if(_0x5df967){return _0x5df967[_0x349e('0x5c')](_0x24b5dd[_0x349e('0x35')][_0x349e('0x5d')]);}})[_0x349e('0x13')](respondWithStatusCode(_0x1afa3a,null))[_0x349e('0x47')](handleError(_0x1afa3a,null));};exports[_0x349e('0x5e')]=function(_0x35ea51,_0x2fc377){if(_0x35ea51[_0x349e('0x4b')]['id']){delete _0x35ea51[_0x349e('0x4b')]['id'];}return db[_0x349e('0x31')]['find']({'where':{'id':_0x35ea51[_0x349e('0x49')]['id']}})[_0x349e('0x13')](handleEntityNotFound(_0x2fc377,null))[_0x349e('0x13')](function(_0x223cb6){if(_0x223cb6){_0x35ea51[_0x349e('0x4b')][_0x349e('0x55')]=_0x223cb6['id'];return db['CannedAnswer']['create'](_0x35ea51[_0x349e('0x4b')]);}})[_0x349e('0x13')](respondWithResult(_0x2fc377,null))['catch'](handleError(_0x2fc377,null));};exports[_0x349e('0x5f')]=function(_0x39afbe,_0x302b73){var _0x4c512e={'raw':![],'where':{}};var _0x2f7423={};var _0x17a023={'count':0x0,'rows':[]};return db[_0x349e('0x31')][_0x349e('0x58')]({'where':{'id':_0x39afbe[_0x349e('0x49')]['id']}})['then'](handleEntityNotFound(_0x302b73,null))[_0x349e('0x13')](function(_0x1927c7){if(_0x1927c7){_0x2f7423[_0x349e('0x39')]=_[_0x349e('0x36')](db[_0x349e('0x60')][_0x349e('0x61')]);_0x2f7423[_0x349e('0x35')]=_[_0x349e('0x36')](_0x39afbe[_0x349e('0x35')]);_0x2f7423[_0x349e('0x37')]=_['intersection'](_0x2f7423[_0x349e('0x39')],_0x2f7423[_0x349e('0x35')]);_0x4c512e[_0x349e('0x3b')]=_[_0x349e('0x38')](_0x2f7423[_0x349e('0x39')],qs[_0x349e('0x3a')](_0x39afbe[_0x349e('0x35')][_0x349e('0x3a')]));_0x4c512e['attributes']=_0x4c512e['attributes'][_0x349e('0x3c')]?_0x4c512e[_0x349e('0x3b')]:_0x2f7423['model'];if(!_0x39afbe['query']['hasOwnProperty'](_0x349e('0x3d'))){_0x4c512e[_0x349e('0x23')]=qs['limit'](_0x39afbe[_0x349e('0x35')][_0x349e('0x23')]);_0x4c512e[_0x349e('0x21')]=qs[_0x349e('0x21')](_0x39afbe[_0x349e('0x35')]['offset']);}_0x4c512e[_0x349e('0x5a')]=qs['sort'](_0x39afbe[_0x349e('0x35')][_0x349e('0x3e')]);_0x4c512e[_0x349e('0x3f')]=qs[_0x349e('0x37')](_[_0x349e('0x40')](_0x39afbe[_0x349e('0x35')],_0x2f7423['filters']));_0x4c512e[_0x349e('0x3f')][_0x349e('0x55')]=_0x1927c7['id'];if(_0x39afbe[_0x349e('0x35')][_0x349e('0x41')]){_0x4c512e[_0x349e('0x3f')]=_['merge'](_0x4c512e[_0x349e('0x3f')],{'$or':_[_0x349e('0x30')](_0x4c512e[_0x349e('0x3b')],function(_0x5248e8){var _0x153b7f={};_0x153b7f[_0x5248e8]={'$like':'%'+_0x39afbe[_0x349e('0x35')][_0x349e('0x41')]+'%'};return _0x153b7f;})});}_0x4c512e=_['merge']({},_0x4c512e,_0x39afbe['options']);return db['CannedAnswer'][_0x349e('0x22')]({'where':_0x4c512e[_0x349e('0x3f')]})[_0x349e('0x13')](function(_0x3f2495){_0x17a023['count']=_0x3f2495;if(_0x39afbe[_0x349e('0x35')]['includeAll']){_0x4c512e['include']=[{'all':!![]}];}return db[_0x349e('0x60')][_0x349e('0x45')](_0x4c512e);})[_0x349e('0x13')](function(_0x2087f1){_0x17a023[_0x349e('0x46')]=_0x2087f1;return _0x17a023;});}})[_0x349e('0x13')](respondWithFilteredResult(_0x302b73,_0x4c512e))[_0x349e('0x47')](handleError(_0x302b73,null));};exports[_0x349e('0x62')]=function(_0x28cedf,_0x1006ea){return db[_0x349e('0x31')][_0x349e('0x50')]({'where':{'id':_0x28cedf[_0x349e('0x49')]['id']}})[_0x349e('0x13')](handleEntityNotFound(_0x1006ea,null))[_0x349e('0x13')](function(_0x4ace29){if(_0x4ace29){return _0x4ace29['removeAnswers'](_0x28cedf[_0x349e('0x35')][_0x349e('0x5d')]);}})[_0x349e('0x13')](respondWithStatusCode(_0x1006ea,null))[_0x349e('0x47')](handleError(_0x1006ea,null));};exports[_0x349e('0x63')]=function(_0x50bb54,_0x576f0c){_0x50bb54[_0x349e('0x4b')][_0x349e('0x64')]=_0x50bb54['file'][_0x349e('0x65')];return db[_0x349e('0x31')][_0x349e('0x50')]({'where':{'id':_0x50bb54[_0x349e('0x49')]['id']}})['then'](handleEntityNotFound(_0x576f0c,null))[_0x349e('0x13')](saveUpdates(_0x50bb54[_0x349e('0x4b')],null))['then'](respondWithResult(_0x576f0c,null))[_0x349e('0x47')](handleError(_0x576f0c,null));};exports[_0x349e('0x66')]=function(_0x166842,_0xc7e7de){_0x166842[_0x349e('0x4b')][_0x349e('0x67')]=_0x166842[_0x349e('0x68')][_0x349e('0x65')];return db[_0x349e('0x31')][_0x349e('0x50')]({'where':{'id':_0x166842['params']['id']}})[_0x349e('0x13')](handleEntityNotFound(_0xc7e7de,null))[_0x349e('0x13')](saveUpdates(_0x166842[_0x349e('0x4b')],null))[_0x349e('0x13')](respondWithResult(_0xc7e7de,null))['catch'](handleError(_0xc7e7de,null));};exports[_0x349e('0x69')]=function(_0x21f65d,_0x3a2e2a){_0x21f65d[_0x349e('0x4b')]['customerAvatar']=_0x21f65d[_0x349e('0x68')][_0x349e('0x65')];return db[_0x349e('0x31')][_0x349e('0x50')]({'where':{'id':_0x21f65d[_0x349e('0x49')]['id']}})[_0x349e('0x13')](handleEntityNotFound(_0x3a2e2a,null))[_0x349e('0x13')](saveUpdates(_0x21f65d[_0x349e('0x4b')],null))[_0x349e('0x13')](respondWithResult(_0x3a2e2a,null))['catch'](handleError(_0x3a2e2a,null));};exports[_0x349e('0x6a')]=function(_0x2e78cf,_0x10e628){_0x2e78cf[_0x349e('0x4b')][_0x349e('0x6b')]=_0x2e78cf[_0x349e('0x68')][_0x349e('0x65')];return db[_0x349e('0x31')][_0x349e('0x50')]({'where':{'id':_0x2e78cf['params']['id']}})['then'](handleEntityNotFound(_0x10e628,null))[_0x349e('0x13')](saveUpdates(_0x2e78cf['body'],null))[_0x349e('0x13')](respondWithResult(_0x10e628,null))[_0x349e('0x47')](handleError(_0x10e628,null));};exports[_0x349e('0x6c')]=function(_0x141cfb,_0x586bd0){var _0x2d5945=path['join'](config[_0x349e('0x6d')],_0x349e('0x6e'));var _0x490a01={'where':{'id':_0x141cfb['params']['id']},'attributes':['id',_0x349e('0x64')],'raw':!![]};var _0x5d68e3=![];return require('../../config/license/util')[_0x349e('0x6f')]()[_0x349e('0x13')](function(_0x25dfbf){if(_0x25dfbf){_0x5d68e3=_0x25dfbf[_0x349e('0x70')];}})['then'](function(){return db[_0x349e('0x31')][_0x349e('0x50')](_0x490a01);})[_0x349e('0x13')](handleEntityNotFound(_0x586bd0,null))[_0x349e('0x13')](function(_0x29d583){if(_0x29d583){if(!_[_0x349e('0x71')](_0x29d583[_0x349e('0x64')])){if(fs[_0x349e('0x72')](path[_0x349e('0x73')](config[_0x349e('0x6d')],_0x349e('0x74'),_0x29d583[_0x349e('0x64')]))&&_0x5d68e3){_0x2d5945=path[_0x349e('0x73')](config[_0x349e('0x6d')],_0x349e('0x74'),_0x29d583['sitepic']);}}return _0x586bd0[_0x349e('0x75')](_0x2d5945);}})[_0x349e('0x47')](handleError(_0x586bd0,null));};exports['getAvatar']=function(_0x5bf46d,_0x1f7cbc){var _0x23ffa7=path[_0x349e('0x73')](config[_0x349e('0x6d')],_0x349e('0x76'));var _0x462ced={'where':{'id':_0x5bf46d[_0x349e('0x49')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x349e('0x31')][_0x349e('0x50')](_0x462ced)['then'](handleEntityNotFound(_0x1f7cbc,null))[_0x349e('0x13')](function(_0x4fc076){if(_0x4fc076){if(!_[_0x349e('0x71')](_0x4fc076['agentAvatar'])){if(fs[_0x349e('0x72')](path['join'](config[_0x349e('0x6d')],_0x349e('0x77'),_0x4fc076[_0x349e('0x67')]))){_0x23ffa7=path['join'](config[_0x349e('0x6d')],_0x349e('0x77'),_0x4fc076[_0x349e('0x67')]);}}return _0x1f7cbc[_0x349e('0x75')](_0x23ffa7);}})[_0x349e('0x47')](handleError(_0x1f7cbc,null));};exports[_0x349e('0x78')]=function(_0x5a6520,_0x30b69d){var _0x21b78c=path[_0x349e('0x73')](config[_0x349e('0x6d')],_0x349e('0x79'));var _0x1293e9={'where':{'id':_0x5a6520[_0x349e('0x49')]['id']},'attributes':['id','customerAvatar',_0x349e('0x7a')],'raw':!![]};return db[_0x349e('0x31')][_0x349e('0x50')](_0x1293e9)[_0x349e('0x13')](handleEntityNotFound(_0x30b69d,null))[_0x349e('0x13')](function(_0x61075b){if(_0x61075b){if(!_['isNil'](_0x61075b['customerAvatar'])){if(fs[_0x349e('0x72')](path['join'](config[_0x349e('0x6d')],_0x349e('0x77'),_0x61075b[_0x349e('0x7b')]))&&_0x61075b[_0x349e('0x7a')]){_0x21b78c=path[_0x349e('0x73')](config['root'],_0x349e('0x77'),_0x61075b[_0x349e('0x7b')]);}}return _0x30b69d[_0x349e('0x75')](_0x21b78c);}})[_0x349e('0x47')](handleError(_0x30b69d,null));};exports[_0x349e('0x7c')]=function(_0x373003,_0x27fccb){var _0x3778d8=path['join'](config['root'],_0x349e('0x7d'));var _0x4d711e={'where':{'id':_0x373003[_0x349e('0x49')]['id']},'attributes':['id',_0x349e('0x6b')],'raw':!![]};return db['ChatWebsite'][_0x349e('0x50')](_0x4d711e)[_0x349e('0x13')](handleEntityNotFound(_0x27fccb,null))[_0x349e('0x13')](function(_0x150451){if(_0x150451){if(!_[_0x349e('0x71')](_0x150451[_0x349e('0x6b')])){if(fs[_0x349e('0x72')](path['join'](config[_0x349e('0x6d')],_0x349e('0x77'),_0x150451['systemAvatar']))){_0x3778d8=path[_0x349e('0x73')](config[_0x349e('0x6d')],_0x349e('0x77'),_0x150451[_0x349e('0x6b')]);}}return _0x27fccb[_0x349e('0x75')](_0x3778d8);}})[_0x349e('0x47')](handleError(_0x27fccb,null));};exports[_0x349e('0x7e')]=function(_0x199844,_0x1739f8){var _0x3fa3ed=require(_0x349e('0x7f'));var _0x2c54b9=new _0x3fa3ed();var _0x2dd88c=_0x2c54b9[_0x349e('0x80')](_0x199844[_0x349e('0x81')][_0x349e('0x82')])[_0x349e('0x83')]();var _0x28ebd1={'body':_0x199844[_0x349e('0x4b')],'channel':_0x349e('0x84')};var _0x17a9be=[];var _0x1d59c6=[];var _0x12672f={};var _0x394c31=![];return db[_0x349e('0x85')][_0x349e('0x54')]()[_0x349e('0x13')](function(_0x5e7251){if(!_0x5e7251){throw new db[(_0x349e('0x86'))][(_0x349e('0x87'))](_0x349e('0x88'));}_0x17a9be=_[_0x349e('0x89')](_['keys'](_0x5e7251),['createdAt','updatedAt']);_0x1d59c6=_['difference'](_['keys'](_0x5e7251),['createdAt','updatedAt',_0x349e('0x8a'),_0x349e('0x8b')]);if(_0x199844[_0x349e('0x4b')]['id']){delete _0x199844['body']['id'];}if(_[_0x349e('0x71')](_0x199844[_0x349e('0x4b')][_0x349e('0x8c')])){throw new db[(_0x349e('0x86'))][(_0x349e('0x87'))](_0x349e('0x8d'));}if(_[_0x349e('0x71')](_0x199844[_0x349e('0x4b')][_0x349e('0x4b')])||_0x199844['body'][_0x349e('0x4b')]===''){throw new db[(_0x349e('0x86'))][(_0x349e('0x87'))](_0x349e('0x8e'));}if(_[_0x349e('0x71')](_0x199844[_0x349e('0x4b')][_0x349e('0x8f')])){throw new db[(_0x349e('0x86'))]['ValidationError'](_0x349e('0x90')+_0x1d59c6);}if(!_[_0x349e('0x91')](_0x1d59c6,_0x199844[_0x349e('0x4b')][_0x349e('0x8f')])){throw new db['Sequelize'][(_0x349e('0x87'))](_0x349e('0x92')+_0x1d59c6);}_0x12672f[_0x199844[_0x349e('0x4b')][_0x349e('0x8f')]]=_0x199844[_0x349e('0x4b')][_0x349e('0x8c')];})['then'](function(){return db[_0x349e('0x31')][_0x349e('0x50')]({'where':{'id':_0x199844[_0x349e('0x49')]['id']},'include':[{'model':db['CmList'],'as':_0x349e('0x93'),'include':[{'model':db[_0x349e('0x85')],'as':_0x349e('0x94'),'where':_0x12672f,'limit':0x1,'order':[[_0x349e('0x95'),_0x349e('0x96')]]}]},{'model':db[_0x349e('0x97')],'as':_0x349e('0x98')}]});})[_0x349e('0x13')](handleEntityNotFound(_0x1739f8,null))[_0x349e('0x13')](function(_0x5cad2c){if(_0x5cad2c&&_0x5cad2c[_0x349e('0x93')]){_0x28ebd1[_0x349e('0x99')]=_0x5cad2c;_0x28ebd1[_0x349e('0x9a')]=_0x5cad2c['Applications'];_0x28ebd1[_0x349e('0x9b')]=_0x5cad2c[_0x349e('0x93')];_0x28ebd1['applications']=_[_0x349e('0x9c')](_0x28ebd1[_0x349e('0x9a')],[_0x349e('0x9d')],[_0x349e('0x9e')]);if(_0x28ebd1[_0x349e('0x99')][_0x349e('0x98')]){delete _0x28ebd1['account'][_0x349e('0x98')];}if(_0x28ebd1[_0x349e('0x99')][_0x349e('0x93')]&&_0x28ebd1[_0x349e('0x99')]['List']['Contacts'][_0x349e('0x3c')]){return _0x28ebd1[_0x349e('0x99')]['List'][_0x349e('0x94')][0x0];}var _0x13c863=_[_0x349e('0x9')](_0x199844[_0x349e('0x4b')],{'firstName':_0x199844[_0x349e('0x4b')][_0x349e('0x8c')],'ListId':_0x5cad2c[_0x349e('0x8b')]});_0x13c863[_0x199844['body']['mapKey']]=_0x199844[_0x349e('0x4b')][_0x349e('0x8c')];return db['CmContact'][_0x349e('0x52')](_0x13c863,{'fields':_0x17a9be,'raw':!![]});}})[_0x349e('0x13')](handleEntityNotFound(_0x1739f8,null))[_0x349e('0x13')](function(_0x28af59){_0x28ebd1[_0x349e('0x9f')]=_0x28af59;var _0x45b78a=_0x199844['body'][_0x349e('0xa0')];if(_0x199844['headers']['cf-connecting-ip']){_0x45b78a=_0x199844[_0x349e('0x81')][_0x349e('0xa1')];}else if(_0x199844[_0x349e('0x81')][_0x349e('0xa2')]){_0x45b78a=_['first'](_0x199844[_0x349e('0x81')][_0x349e('0xa2')][_0x349e('0xa3')](','));}if(_0x28af59){var _0x53ab06={'ContactId':_0x28af59['id'],'ChatWebsiteId':_0x199844[_0x349e('0x49')]['id'],'from':(_0x28af59[_0x349e('0xa4')]||'')+'\x20'+(_0x28af59[_0x349e('0xa5')]||''),'customerIp':_0x45b78a,'customerPort':_0x199844[_0x349e('0x81')][_0x349e('0xa6')]?_0x199844[_0x349e('0x81')]['x-real-port']:null,'referer':_0x199844['body'][_0x349e('0xa7')],'browserName':_0x2dd88c[_0x349e('0xa8')]['name']&&_0x2dd88c[_0x349e('0xa8')][_0x349e('0xa9')]?util[_0x349e('0xaa')](_0x349e('0xab'),_0x2dd88c['browser']['name'],_0x2dd88c[_0x349e('0xa8')][_0x349e('0xa9')]):_0x349e('0xac'),'browserVersion':_0x2dd88c[_0x349e('0xa8')]['version']||_0x349e('0xac'),'osName':util[_0x349e('0xaa')](_0x349e('0xab'),_0x2dd88c['os'][_0x349e('0x2c')],_0x2dd88c['os'][_0x349e('0xa9')]),'osVersion':_0x2dd88c['os'][_0x349e('0xa9')],'deviceModel':_0x2dd88c[_0x349e('0xad')][_0x349e('0x39')]&&_0x2dd88c[_0x349e('0xad')][_0x349e('0xae')]?util[_0x349e('0xaa')]('%s\x20%s\x20%s',_0x2dd88c[_0x349e('0xad')]['model'],_0x2dd88c['device'][_0x349e('0xae')],_0x2dd88c['device'][_0x349e('0x33')]):null,'deviceVendor':_0x2dd88c[_0x349e('0xad')][_0x349e('0xae')],'deviceType':_0x2dd88c['device'][_0x349e('0x33')],'formData':JSON['stringify'](_0x199844[_0x349e('0x4b')])};var _0x30a6fe={'ChatWebsiteId':_0x199844['params']['id'],'closed':![]};if(_0x199844['body'][_0x349e('0xaf')]){_0x30a6fe['threadId']=_0x199844[_0x349e('0x4b')]['threadId'];return db[_0x349e('0xb0')][_0x349e('0x50')]({'where':_0x30a6fe})[_0x349e('0x13')](function(_0x2f687e){if(_0x2f687e){return[_0x2f687e,![]];}_0x53ab06['threadId']=_0x199844[_0x349e('0x4b')]['threadId'];_0x53ab06[_0x349e('0xb1')]=_0x199844[_0x349e('0x4b')][_0x349e('0xb1')];return db['ChatInteraction']['create'](_0x53ab06)[_0x349e('0x13')](function(_0x379550){return[_0x379550,!![]];});});}_0x30a6fe['ContactId']=_0x28af59['id'];if(_0x199844[_0x349e('0x4b')][_0x349e('0xb2')]&&_0x199844[_0x349e('0x4b')][_0x349e('0xb2')]['id']){_0x30a6fe['id']=_0x199844['body'][_0x349e('0xb2')]['id'];return db['ChatInteraction']['find']({'where':_0x30a6fe})[_0x349e('0x13')](function(_0x5c89c1){if(_0x5c89c1){return[_0x5c89c1,![]];}return db[_0x349e('0xb0')][_0x349e('0x52')](_0x53ab06)[_0x349e('0x13')](function(_0x45c626){return[_0x45c626,!![]];});});}return db[_0x349e('0xb0')][_0x349e('0x52')](_0x53ab06)[_0x349e('0x13')](function(_0x3b0808){return[_0x3b0808,!![]];});}})['spread'](function(_0xa09a2e,_0x35e267){if(_0xa09a2e){_0x394c31=_0x35e267;if(!_0x35e267){var _0x285233={'from':(_0x28ebd1[_0x349e('0x9f')]['firstName']||'')+'\x20'+(_0x28ebd1[_0x349e('0x9f')][_0x349e('0xa5')]||'')};if(_0x199844[_0x349e('0x4b')][_0x349e('0xaf')]&&_0x199844[_0x349e('0x4b')][_0x349e('0xb3')]&&_0x199844[_0x349e('0x4b')][_0x349e('0xaf')]!=_0x199844['body'][_0x349e('0xb3')]){_0x285233[_0x349e('0xaf')]=_0x199844[_0x349e('0x4b')][_0x349e('0xb3')];}return _0xa09a2e['update'](_0x285233);}else{return _0xa09a2e;}}})[_0x349e('0x13')](function(_0x8a0f78){_0x28ebd1[_0x349e('0xb2')]=_0x8a0f78[_0x349e('0x28')]({'plain':!![]});_0x28ebd1[_0x349e('0xb2')][_0x349e('0xb4')]=_0x394c31;if(_0x28ebd1[_0x349e('0xb2')][_0x349e('0xb4')]){if(_0x28ebd1[_0x349e('0x99')]['autoclose']){_0x28ebd1[_0x349e('0x9a')][_0x349e('0xb5')]({'id':0x0,'priority':_0x28ebd1[_0x349e('0x9a')][_0x349e('0x3c')]+0x1,'app':_0x349e('0xb6'),'appdata':'unmanaged','interval':_0x349e('0xb7')});}}return db['ChatMessage'][_0x349e('0x52')]({'body':_0x199844[_0x349e('0x4b')][_0x349e('0x4b')],'ChatWebsiteId':_0x199844[_0x349e('0x49')]['id'],'ChatInteractionId':_0x8a0f78['id'],'direction':'in','ContactId':_0x28ebd1[_0x349e('0x9f')]['id'],'AttachmentId':_0x199844[_0x349e('0x4b')]['AttachmentId']});})['then'](function(_0x523506){_0x28ebd1[_0x349e('0x1c')]=_0x523506;if(_0x28ebd1['interaction'][_0x349e('0xb8')]){return db[_0x349e('0xb9')][_0x349e('0x50')]({'attributes':['id','name'],'where':{'id':_0x28ebd1['interaction'][_0x349e('0xb8')]}})[_0x349e('0x13')](function(_0x5f3ff4){if(_0x5f3ff4){_0x28ebd1[_0x349e('0x9a')][_0x349e('0xba')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5f3ff4[_0x349e('0x2c')]+','+(_0x28ebd1[_0x349e('0x99')][_0x349e('0xbb')]||0xa),'interval':_0x349e('0xb7')});_0x28ebd1[_0x349e('0xbc')]=!![];}return respondWithRpcPromise('Start',_0x349e('0xbd'),_0x28ebd1);});}return respondWithRpcPromise(_0x349e('0xbe'),_0x349e('0xbd'),_0x28ebd1);})[_0x349e('0x13')](function(_0x4aab49){respondWithRpcPromise(_0x349e('0xbf'),_0x349e('0xbf'),{'event':_0x349e('0x7e'),'message':_0x4aab49},client9002);return _0x4aab49;})['then'](respondWithResult(_0x1739f8,null))[_0x349e('0x47')](handleError(_0x1739f8,null));};exports[_0x349e('0xc0')]=function(_0x35ba6b,_0x2409cb){var _0xc97dc6,_0x4c5aff,_0xd08627;var _0x49e7a6=[];var _0x1c4013={};var _0x447660=_0x35ba6b[_0x349e('0xc1')]||[];var _0x550e36=[];var _0x110581;return db[_0x349e('0x85')][_0x349e('0x54')]()['then'](function(_0x5346bd){if(!_0x5346bd){throw new db[(_0x349e('0x86'))][(_0x349e('0x87'))]('no\x20available\x20attributes');}_0x49e7a6=_[_0x349e('0x89')](_[_0x349e('0x36')](_0x5346bd),[_0x349e('0xc2'),'updatedAt',_0x349e('0x8a'),_0x349e('0x8b')]);if(_0x35ba6b[_0x349e('0x4b')]['id']){delete _0x35ba6b[_0x349e('0x4b')]['id'];}if(_[_0x349e('0x71')](_0x35ba6b[_0x349e('0x4b')]['from'])){throw _0x2409cb[_0x349e('0x1f')](0x1f4)[_0x349e('0x2d')](new db[(_0x349e('0x86'))][(_0x349e('0x87'))](_0x349e('0x8d')));}if(_[_0x349e('0x71')](_0x35ba6b[_0x349e('0x4b')]['body'])||_0x35ba6b[_0x349e('0x4b')][_0x349e('0x4b')]===''){throw _0x2409cb[_0x349e('0x1f')](0x1f4)[_0x349e('0x2d')](new db[(_0x349e('0x86'))][(_0x349e('0x87'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x35ba6b[_0x349e('0x4b')][_0x349e('0xc3')])){throw _0x2409cb[_0x349e('0x1f')](0x1f4)[_0x349e('0x2d')](new db[(_0x349e('0x86'))]['ValidationError'](_0x349e('0xc4')+_0x49e7a6));}if(!_[_0x349e('0x91')](_0x49e7a6,_0x35ba6b[_0x349e('0x4b')][_0x349e('0xc3')])){throw _0x2409cb[_0x349e('0x1f')](0x1f4)[_0x349e('0x2d')](new db[(_0x349e('0x86'))]['ValidationError'](_0x349e('0xc5')+_0x49e7a6));}_0x1c4013[_0x35ba6b[_0x349e('0x4b')]['mapKeyOffline']]=_0x35ba6b[_0x349e('0x4b')][_0x349e('0x8c')];})['then'](function(){return db[_0x349e('0x31')][_0x349e('0x50')]({'where':{'id':_0x35ba6b[_0x349e('0x49')]['id']},'include':[{'model':db[_0x349e('0xc6')],'as':_0x349e('0x93')},{'model':db[_0x349e('0xc7')],'as':_0x349e('0xc7')}]});})[_0x349e('0x13')](handleEntityNotFound(_0x2409cb,null))[_0x349e('0x13')](function(_0xb4a4a){if(_0xb4a4a&&_0xb4a4a[_0x349e('0x93')]){_0x4c5aff=_0xb4a4a;var _0x1d38b6=_[_0x349e('0x9')](_0x35ba6b[_0x349e('0x4b')],{'firstName':_0x35ba6b[_0x349e('0x4b')][_0x349e('0x8c')],'phone':_0x35ba6b[_0x349e('0x4b')][_0x349e('0x8c')],'ListId':_0xb4a4a[_0x349e('0x8b')]});_0x1d38b6[_0x35ba6b['body'][_0x349e('0xc3')]]=_0x35ba6b[_0x349e('0x4b')][_0x349e('0x8c')];return db[_0x349e('0x85')][_0x349e('0xc8')]({'where':_0x1c4013,'defaults':_0x1d38b6});}})[_0x349e('0xc9')](function(_0x44c0ef){if(_0x44c0ef){_0xd08627=_0x44c0ef;var _0x22ce44=fs[_0x349e('0xca')](path[_0x349e('0x73')](config[_0x349e('0x6d')],_0x349e('0xcb')),_0x349e('0xcc'));var _0x1425e5=ejs['render'](_0x22ce44,{'body':_[_0x349e('0xcd')](_0x35ba6b[_0x349e('0x4b')]['body']),'bodyTitle':_0x4c5aff[_0x349e('0xce')]});return db[_0x349e('0xcf')][_0x349e('0x52')]({'body':_0x1425e5,'plainBody':htmlToText[_0x349e('0xd0')](_0x1425e5),'ContactId':_0x44c0ef['id'],'ChatWebsiteId':_0x4c5aff['id']});}})['then'](function(_0xbb12e7){_0x110581=_0xbb12e7;if(_0x447660[_0x349e('0x3c')]){var _0x495cc6=_0x447660[_0x349e('0x30')](function(_0x36a9a9){return{'name':_0x36a9a9[_0x349e('0xd1')],'basename':_0x36a9a9[_0x349e('0x65')],'type':_0x36a9a9[_0x349e('0xd2')],'ChatOfflineMessageId':_0xbb12e7['id']};});_0x550e36=_0x495cc6[_0x349e('0x30')](_0x21ddc5=>{var _0x4a42fb={'filename':_0x21ddc5[_0x349e('0x2c')],'path':path[_0x349e('0x73')](config['root'],_0x349e('0xd3'),_0x349e('0xc1'),'attachments',_0x349e('0xd4'),_0x21ddc5[_0x349e('0xd5')])};return _0x4a42fb;});if(!_0x4c5aff[_0x349e('0xd6')]){return db[_0x349e('0xd7')][_0x349e('0xd8')](function(_0x490ff1){return db[_0x349e('0xd9')][_0x349e('0xda')](_0x495cc6,{'transaction':_0x490ff1});});}}})[_0x349e('0x13')](function(){if(_0x110581){_0xc97dc6=_0x110581;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x349e('0xdb')],'as':_0x349e('0xdc'),'raw':!![],'include':[{'model':db[_0x349e('0xdd')],'as':_0x349e('0xdd'),'raw':!![]}]}]});}})['then'](function(_0x5b0f17){if(_0x5b0f17&&_0x5b0f17[_0x349e('0xdc')]&&_0x4c5aff[_0x349e('0xde')]&&_0x4c5aff[_0x349e('0xdf')]){var _0x4109be=_0x5b0f17[_0x349e('0xe0')]();return respondWithRpcPromise(_0x349e('0xe1'),_0x349e('0xe2'),{'account':_0x4109be,'message':{'from':util[_0x349e('0xaa')](_0x349e('0xe3'),_0x5b0f17[_0x349e('0x2c')],_0x5b0f17[_0x349e('0xe4')]||_0x5b0f17[_0x349e('0xdc')][_0x349e('0x4c')]),'to':_0x4c5aff[_0x349e('0xdf')],'subject':_0x4c5aff[_0x349e('0xe5')],'html':_0xc97dc6[_0x349e('0x4b')],'attachments':_0x550e36}},client9003)[_0x349e('0x13')](function(){return _0xc97dc6;})['catch'](function(_0x1fc787){logger[_0x349e('0x1a')](_0x1fc787);});}})[_0x349e('0x13')](function(){if(_0x4c5aff&&_0x4c5aff[_0x349e('0xd6')]&&_0x4c5aff[_0x349e('0xe6')]){var _0x4c8081=[];if(_0x447660[_0x349e('0x3c')]){_0x4c8081=_0x447660['map'](function(_0x12d010){return{'name':_0x12d010['originalname'],'basename':_0x12d010[_0x349e('0x65')],'type':_0x12d010[_0x349e('0xd2')],'ChatOfflineMessageId':_0x110581['id']};});}var _0x26169d;if(!_[_0x349e('0x71')](_0x4c5aff[_0x349e('0xe7')])){var _0x12b819=_[_0x349e('0x30')](_0x35ba6b[_0x349e('0x4b')],function(_0x363ca0){return _0x363ca0;});var _0x1256cb=_['toPairsIn'](_0x12b819)[0x0];var _0x5c225f=_[_0x349e('0xe8')](_0x1256cb,function(_0x11532a){return _0x11532a;});_0x26169d=_0x5c225f[0x1][_0x4c5aff[_0x349e('0xe7')]];}var _0x530b28={'from':_0xd08627['email'],'firstName':_0xd08627[_0x349e('0xa4')],'lastName':_0xd08627['lastName'],'mapKey':'email','message':{'from':_0xd08627[_0x349e('0xe4')],'to':_0x4c5aff[_0x349e('0xc7')][_0x349e('0xe4')],'cc':'','subject':_[_0x349e('0x71')](_0x26169d)?_0x4c5aff[_0x349e('0xe5')]:_0x26169d,'messageId':'','sentAt':new Date(),'attach':_0x4c8081['length'],'attachments':_0x4c8081,'originChannel':'Chat','ChatWebsiteId':_0x4c5aff['id'],'ChatOfflineMessageId':_0xc97dc6['id'],'originTo':_0x4c5aff['MailAccount'][_0x349e('0xe4')]},'body':_0xc97dc6[_0x349e('0x4b')]};var _0x56e974={'account':{'id':_0x4c5aff[_0x349e('0xe6')]},'body':_0x530b28,'log':_0x349e('0xe9')};return respondWithRpcPromise(_0x349e('0xe9'),_0x349e('0xea'),_0x56e974,client9001)[_0x349e('0x13')](function(){return _0xc97dc6;})[_0x349e('0x47')](function(_0x1fa04e){logger[_0x349e('0x1a')](_0x1fa04e);});}return;})[_0x349e('0x13')](function(){if(_0xc97dc6){return _0xc97dc6;}})[_0x349e('0x13')](respondWithResult(_0x2409cb,null))[_0x349e('0x47')](function(_0x45283b){logger[_0x349e('0x1a')](_0x349e('0x47'),_0x45283b);for(var _0x4f67d6 of _0x447660){var _0x16af1a=path['join'](config[_0x349e('0x6d')],_0x349e('0xd3'),'files','attachments',_0x349e('0xd4'),_0x4f67d6[_0x349e('0x65')]);fs_extra['remove'](_0x16af1a)[_0x349e('0x47')](function(_0x237d5e){logger[_0x349e('0x1a')]('Could\x20not\x20remove\x20attachment\x20file',_0x16af1a,_0x237d5e);});}});};exports[_0x349e('0xeb')]=function(_0x116486,_0x83b849){return db[_0x349e('0xb0')][_0x349e('0x50')]({'where':{'id':_0x116486[_0x349e('0x49')]['id']}})[_0x349e('0x13')](handleEntityNotFound(_0x83b849,null))[_0x349e('0x13')](function(_0x4a3a78){if(_0x4a3a78){return _0x4a3a78[_0x349e('0xeb')](_0x116486[_0x349e('0x4b')]['ids'],_['omit'](_0x116486[_0x349e('0x4b')],['ids','id'])||{});}})[_0x349e('0x13')](respondWithResult(_0x83b849,null))[_0x349e('0x47')](handleError(_0x83b849,null));};exports[_0x349e('0xec')]=function(_0x214c00,_0x57f90a){var _0x5ca8ee={'raw':![],'where':{}};var _0x2d6ac6={};var _0x31e7b0={'count':0x0,'rows':[]};return db[_0x349e('0x31')]['findOne']({'where':{'id':_0x214c00[_0x349e('0x49')]['id']}})[_0x349e('0x13')](handleEntityNotFound(_0x57f90a,null))[_0x349e('0x13')](function(_0x30ebdc){if(_0x30ebdc){_0x2d6ac6[_0x349e('0x39')]=_[_0x349e('0x36')](db[_0x349e('0xb0')][_0x349e('0x61')]);_0x2d6ac6['query']=_[_0x349e('0x36')](_0x214c00['query']);_0x2d6ac6[_0x349e('0x37')]=_[_0x349e('0x38')](_0x2d6ac6[_0x349e('0x39')],_0x2d6ac6[_0x349e('0x35')]);_0x5ca8ee[_0x349e('0x3b')]=_['intersection'](_0x2d6ac6[_0x349e('0x39')],qs[_0x349e('0x3a')](_0x214c00[_0x349e('0x35')][_0x349e('0x3a')]));_0x5ca8ee[_0x349e('0x3b')]=_0x5ca8ee['attributes'][_0x349e('0x3c')]?_0x5ca8ee[_0x349e('0x3b')]:_0x2d6ac6[_0x349e('0x39')];if(!_0x214c00[_0x349e('0x35')][_0x349e('0x59')]('nolimit')){_0x5ca8ee[_0x349e('0x23')]=qs[_0x349e('0x23')](_0x214c00[_0x349e('0x35')][_0x349e('0x23')]);_0x5ca8ee['offset']=qs[_0x349e('0x21')](_0x214c00[_0x349e('0x35')][_0x349e('0x21')]);}_0x5ca8ee[_0x349e('0x5a')]=qs['sort'](_0x214c00[_0x349e('0x35')][_0x349e('0x3e')]);_0x5ca8ee['where']=qs[_0x349e('0x37')](_[_0x349e('0x40')](_0x214c00[_0x349e('0x35')],_0x2d6ac6[_0x349e('0x37')]));_0x5ca8ee[_0x349e('0x3f')][_0x349e('0x55')]=_0x30ebdc['id'];if(_0x214c00['query'][_0x349e('0x41')]){_0x5ca8ee['where']=_[_0x349e('0x42')](_0x5ca8ee[_0x349e('0x3f')],{'$or':_[_0x349e('0x30')](_0x5ca8ee['attributes'],function(_0x8f9dce){var _0x3a8c4c={};_0x3a8c4c[_0x8f9dce]={'$like':'%'+_0x214c00[_0x349e('0x35')]['filter']+'%'};return _0x3a8c4c;})});}_0x5ca8ee=_['merge']({},_0x5ca8ee,_0x214c00[_0x349e('0x5b')]);return db['ChatInteraction'][_0x349e('0x22')]({'where':_0x5ca8ee[_0x349e('0x3f')]})['then'](function(_0x46ba31){_0x31e7b0[_0x349e('0x22')]=_0x46ba31;if(_0x214c00[_0x349e('0x35')]['includeAll']){_0x5ca8ee[_0x349e('0x44')]=[{'model':db['CmContact'],'as':_0x349e('0xed'),'required':![]},{'model':db[_0x349e('0xb9')],'as':_0x349e('0xee'),'attributes':['name',_0x349e('0xef'),_0x349e('0xf0')],'required':![]},{'model':db['Tag'],'as':_0x349e('0xf1'),'attributes':['id',_0x349e('0x2c'),_0x349e('0xf2')],'where':_0x214c00['query'][_0x349e('0xf3')]?{'id':_0x214c00[_0x349e('0x35')][_0x349e('0xf3')]}:undefined,'required':_0x214c00[_0x349e('0x35')][_0x349e('0xf3')]?!![]:![]}];}return db[_0x349e('0xb0')][_0x349e('0x45')](_0x5ca8ee);})[_0x349e('0x13')](function(_0x13a125){_0x31e7b0[_0x349e('0x46')]=_0x13a125;return _0x31e7b0;});}})[_0x349e('0x13')](respondWithFilteredResult(_0x57f90a,_0x5ca8ee))[_0x349e('0x47')](handleError(_0x57f90a,null));};function iftimePromise(_0x44ff12,_0x41dc25){return respondWithRpcPromise(_0x349e('0xf4'),_0x349e('0xf5'),{'command':_0x41dc25[_0x349e('0xf6')]?util[_0x349e('0xaa')]('iftime\x20%s,%s',_0x44ff12[_0x349e('0xf7')],_0x41dc25[_0x349e('0xf6')]):util[_0x349e('0xaa')](_0x349e('0xf8'),_0x44ff12[_0x349e('0xf7')])},client9002)[_0x349e('0x13')](function(_0x4153a6){var _0x30f316=_0x4153a6&&_0x4153a6[_0x349e('0xf9')](_0x349e('0xfa'))>=0x0?!![]:![];logger['info'](_0x349e('0xfb'),_0x41dc25['id'],_0x44ff12['id'],_0x44ff12[_0x349e('0xf7')],_0x30f316?_0x349e('0xfc'):_0x349e('0xfd'),_0x41dc25[_0x349e('0xf6')]?_0x41dc25['timezone']:_0x349e('0xfe'));return _0x30f316;})['catch'](function(_0x4f6468){logger['error'](_0x349e('0xfb'),_0x41dc25['id'],_0x44ff12['id'],_0x44ff12[_0x349e('0xf7')],util[_0x349e('0xff')](_0x4f6468,{'showHidden':![],'depth':null}),_0x41dc25[_0x349e('0xf6')]?_0x41dc25[_0x349e('0xf6')]:_0x349e('0xfe'));return![];});}exports['getSnippet']=function(_0x20a007,_0x2faa4e){var _0xdcb99=0x0;var _0x1d8c8e=0x0;var _0x1485bd=![];var _0x2659b6;var _0x6e8323;return db[_0x349e('0x31')][_0x349e('0x50')]({'where':{'id':_0x20a007[_0x349e('0x49')]['id']},'include':[{'model':db[_0x349e('0x100')],'as':_0x349e('0x100'),'include':[{'model':db[_0x349e('0x100')],'as':_0x349e('0x101'),'attributes':['id',_0x349e('0xf7')],'raw':!![]}]}]})[_0x349e('0x13')](handleEntityNotFound(_0x2faa4e,null))[_0x349e('0x13')](function(_0x2a48df){if(_0x2a48df){_0x2659b6=_0x2a48df;return _0x2a48df[_0x349e('0x102')]({'raw':!![]});}})[_0x349e('0x13')](function(_0x89e063){if(_0x2659b6){if(_0x89e063){_0x6e8323=_0x89e063;}}return require(_0x349e('0x103'))['getLicense']();})[_0x349e('0x13')](function(_0x3e4d9d){if(_0x3e4d9d){_0x1d8c8e=_0x3e4d9d[_0x349e('0x104')];_0x1485bd=_0x3e4d9d['custom'];}})[_0x349e('0x13')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})['then'](function(_0x3911aa){_0xdcb99=_0x3911aa;if(_0x1d8c8e&&_0x3911aa>_0x1d8c8e){return db[_0x349e('0x105')][_0x349e('0x58')]({'where':{'id':0x1}})[_0x349e('0x13')](function(_0xba8e5a){if(_0xba8e5a){_0xba8e5a[_0x349e('0x106')](_0x349e('0x107'));}});}})[_0x349e('0x13')](function(){if(_0x2659b6[_0x349e('0x100')]&&_0x2659b6[_0x349e('0x100')][_0x349e('0x101')]){var _0x199b08=[];for(var _0x555c57=0x0;_0x555c57<_0x2659b6[_0x349e('0x100')]['Intervals'][_0x349e('0x3c')];_0x555c57++){var _0xcf4d2a=_0x2659b6[_0x349e('0x100')][_0x349e('0x101')][_0x555c57][_0x349e('0x28')]({'plain':!![]});_0x199b08[_0x349e('0xb5')](iftimePromise(_0xcf4d2a,_0x2659b6));}return BPromise[_0x349e('0x108')](_0x199b08)[_0x349e('0x13')](function(_0x362f2b){return _['some'](_0x362f2b);});}else{return!![];}})[_0x349e('0x13')](function(_0x5ef9a6){var _0x3c5d97=fs[_0x349e('0xca')](path['join'](config['root'],_0x349e('0x109')),_0x349e('0xcc'));var _0x572303={'remote':_0x2659b6[_0x349e('0x10a')],'query':querystring[_0x349e('0x19')](_[_0x349e('0x42')](_0x2659b6[_0x349e('0x28')]({'plain':!![]}),{'customerIp':_0x20a007[_0x349e('0x81')][_0x349e('0xa2')]||_0x20a007[_0x349e('0x81')]['x-real-ip']||_0x20a007['connection'][_0x349e('0x10b')]||_0x20a007['ip'],'referer':_0x20a007[_0x349e('0x81')][_0x349e('0xa7')],'openedInteractions':_0xdcb99,'maxInteractions':_0x1d8c8e,'virtual':_0x1485bd[_0x349e('0x104')],'online':_0x5ef9a6,'custom':_0x1485bd}))['replace'](/'/g,'\x5c\x27')};_0x2faa4e[_0x349e('0x2d')](ejs[_0x349e('0x10c')](Mustache[_0x349e('0x10c')](_0x3c5d97,_0x572303),{'proactiveActions':_0x6e8323,'alignment':_0x2659b6[_0x349e('0x10d')],'verticalAlignment':_0x2659b6[_0x349e('0x10e')],'div_color':_0x2659b6[_0x349e('0xf2')],'labelText':_0x2659b6['labelText'],'text_color':_0x2659b6['textColor'],'text_button_color':_0x2659b6[_0x349e('0x10f')],'button_color':_0x2659b6[_0x349e('0x110')],'background_color':_0x2659b6[_0x349e('0x111')],'hideWhenOffline':_0x2659b6[_0x349e('0x112')],'interval':_0x2659b6[_0x349e('0x113')]}));})[_0x349e('0x47')](handleError(_0x2faa4e,null));};exports['addApplications']=function(_0x8293d9,_0x59a823){var _0x26e8b5=_0x8293d9[_0x349e('0x49')]['id'];var _0x6bd0cd=_0x8293d9[_0x349e('0x4b')];var _0x4a95c4=0xc8;var _0x4a1f92=null;return db['sequelize'][_0x349e('0xd8')]({'isolationLevel':db['sequelize'][_0x349e('0x114')][_0x349e('0x115')][_0x349e('0x116')]},function(_0xdb1721){return db[_0x349e('0x31')][_0x349e('0x58')]({'where':{'id':_0x26e8b5},'transaction':_0xdb1721})['then'](function(_0x13f59d){if(_0x13f59d){return db['ChatApplication'][_0x349e('0x27')]({'where':{'ChatWebsiteId':_0x26e8b5},'transaction':_0xdb1721})[_0x349e('0x13')](function(){var _0x77901c=_[_0x349e('0x30')](_0x6bd0cd,function(_0x52467b){_0x52467b[_0x349e('0x55')]=_0x26e8b5;return _0x52467b;});return db['ChatApplication'][_0x349e('0xda')](_0x77901c,{'transaction':_0xdb1721});});}else{_0x4a95c4=0x194;_0x4a1f92=[];}});})['then'](function(){if(_0x4a95c4!==0x194){return db[_0x349e('0x97')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x26e8b5},'order':_0x349e('0x9d')})['then'](function(_0x26fa8a){_0x4a1f92=_0x26fa8a;});}})[_0x349e('0x47')](function(_0x720286){_0x4a95c4=0x1f4;logger[_0x349e('0x1a')](_0x720286['stack']);if(_0x720286['name']){delete _0x720286[_0x349e('0x2c')];}_0x4a1f92=_0x720286;})[_0x349e('0x117')](function(){if(_0x4a1f92===null){_0x59a823['sendStatus'](_0x4a95c4);}else{if(_0x4a95c4===0x1f4){_0x59a823[_0x349e('0x1f')](_0x4a95c4)[_0x349e('0x2d')](_0x4a1f92);}else{_0x59a823['status'](_0x4a95c4)[_0x349e('0x20')](_0x4a1f92);}}});};exports[_0x349e('0x118')]=function(_0x4b90cd,_0x305e04){var _0x3c09e1={};var _0x5bf096={};var _0x241fd4;var _0x2a8933;return db['ChatWebsite']['findOne']({'where':{'id':_0x4b90cd[_0x349e('0x49')]['id']}})['then'](handleEntityNotFound(_0x305e04,null))['then'](function(_0xe36937){if(_0xe36937){_0x241fd4=_0xe36937;_0x5bf096[_0x349e('0x39')]=_[_0x349e('0x36')](db[_0x349e('0x97')][_0x349e('0x61')]);_0x5bf096[_0x349e('0x35')]=_['keys'](_0x4b90cd[_0x349e('0x35')]);_0x5bf096[_0x349e('0x37')]=_[_0x349e('0x38')](_0x5bf096[_0x349e('0x39')],_0x5bf096[_0x349e('0x35')]);_0x3c09e1[_0x349e('0x3b')]=_[_0x349e('0x38')](_0x5bf096['model'],qs[_0x349e('0x3a')](_0x4b90cd['query'][_0x349e('0x3a')]));_0x3c09e1[_0x349e('0x3b')]=_0x3c09e1[_0x349e('0x3b')]['length']?_0x3c09e1['attributes']:_0x5bf096[_0x349e('0x39')];_0x3c09e1[_0x349e('0x5a')]=qs[_0x349e('0x3e')](_0x4b90cd[_0x349e('0x35')][_0x349e('0x3e')]);_0x3c09e1[_0x349e('0x3f')]=qs[_0x349e('0x37')](_[_0x349e('0x40')](_0x4b90cd[_0x349e('0x35')],_0x5bf096['filters']));if(_0x4b90cd[_0x349e('0x35')][_0x349e('0x41')]){_0x3c09e1['where']=_['merge'](_0x3c09e1[_0x349e('0x3f')],{'$or':_[_0x349e('0x30')](_0x3c09e1['attributes'],function(_0x4d4112){var _0x55a88f={};_0x55a88f[_0x4d4112]={'$like':'%'+_0x4b90cd[_0x349e('0x35')][_0x349e('0x41')]+'%'};return _0x55a88f;})});}_0x3c09e1=_[_0x349e('0x42')]({},_0x3c09e1,_0x4b90cd[_0x349e('0x5b')]);return _0x241fd4[_0x349e('0x118')](_0x3c09e1);}})[_0x349e('0x13')](function(_0x4eb664){if(_0x4eb664){_0x2a8933=_0x4eb664[_0x349e('0x3c')];if(!_0x4b90cd[_0x349e('0x35')][_0x349e('0x59')](_0x349e('0x3d'))){_0x3c09e1[_0x349e('0x23')]=qs[_0x349e('0x23')](_0x4b90cd['query'][_0x349e('0x23')]);_0x3c09e1[_0x349e('0x21')]=qs[_0x349e('0x21')](_0x4b90cd[_0x349e('0x35')][_0x349e('0x21')]);}return _0x241fd4[_0x349e('0x118')](_0x3c09e1);}})[_0x349e('0x13')](function(_0x36c128){if(_0x36c128){return _0x36c128?{'count':_0x2a8933,'rows':_0x36c128}:null;}})[_0x349e('0x13')](respondWithResult(_0x305e04,null))[_0x349e('0x47')](handleError(_0x305e04,null));};exports[_0x349e('0x119')]=function(_0x30e64f,_0x4c0153){return db[_0x349e('0x11a')][_0x349e('0x50')]({'where':{'id':_0x30e64f[_0x349e('0x49')]['id']}})['then'](handleEntityNotFound(_0x4c0153,null))[_0x349e('0x13')](function(_0x24b688){if(_0x24b688){return _0x24b688[_0x349e('0x119')](_0x30e64f['body']['ids'],_[_0x349e('0x11b')](_0x30e64f[_0x349e('0x4b')],[_0x349e('0x5d'),'id'])||{});}})[_0x349e('0x13')](respondWithResult(_0x4c0153,null))['catch'](handleError(_0x4c0153,null));};exports[_0x349e('0x102')]=function(_0x5c1d49,_0x4b2044){var _0x21e9c9={};var _0x49485b={};var _0x277e12;var _0xf852f8;return db[_0x349e('0x31')][_0x349e('0x58')]({'where':{'id':_0x5c1d49[_0x349e('0x49')]['id']}})[_0x349e('0x13')](handleEntityNotFound(_0x4b2044,null))[_0x349e('0x13')](function(_0x4b56bc){if(_0x4b56bc){_0x277e12=_0x4b56bc;_0x49485b[_0x349e('0x39')]=_['keys'](db['ChatProactiveAction']['rawAttributes']);_0x49485b[_0x349e('0x35')]=_[_0x349e('0x36')](_0x5c1d49[_0x349e('0x35')]);_0x49485b[_0x349e('0x37')]=_['intersection'](_0x49485b[_0x349e('0x39')],_0x49485b[_0x349e('0x35')]);_0x21e9c9[_0x349e('0x3b')]=_[_0x349e('0x38')](_0x49485b[_0x349e('0x39')],qs[_0x349e('0x3a')](_0x5c1d49[_0x349e('0x35')][_0x349e('0x3a')]));_0x21e9c9['attributes']=_0x21e9c9['attributes'][_0x349e('0x3c')]?_0x21e9c9[_0x349e('0x3b')]:_0x49485b[_0x349e('0x39')];_0x21e9c9['order']=qs[_0x349e('0x3e')](_0x5c1d49[_0x349e('0x35')][_0x349e('0x3e')]);_0x21e9c9[_0x349e('0x3f')]=qs[_0x349e('0x37')](_[_0x349e('0x40')](_0x5c1d49[_0x349e('0x35')],_0x49485b[_0x349e('0x37')]));if(_0x5c1d49[_0x349e('0x35')][_0x349e('0x41')]){_0x21e9c9['where']=_[_0x349e('0x42')](_0x21e9c9['where'],{'$or':_['map'](_0x21e9c9[_0x349e('0x3b')],function(_0x43efb0){var _0x51cdda={};_0x51cdda[_0x43efb0]={'$like':'%'+_0x5c1d49[_0x349e('0x35')][_0x349e('0x41')]+'%'};return _0x51cdda;})});}_0x21e9c9=_[_0x349e('0x42')]({},_0x21e9c9,_0x5c1d49['options']);return _0x277e12[_0x349e('0x102')](_0x21e9c9);}})[_0x349e('0x13')](function(_0x56198f){if(_0x56198f){_0xf852f8=_0x56198f[_0x349e('0x3c')];if(!_0x5c1d49['query'][_0x349e('0x59')](_0x349e('0x3d'))){_0x21e9c9[_0x349e('0x23')]=qs[_0x349e('0x23')](_0x5c1d49[_0x349e('0x35')][_0x349e('0x23')]);_0x21e9c9[_0x349e('0x21')]=qs[_0x349e('0x21')](_0x5c1d49[_0x349e('0x35')]['offset']);}return _0x277e12[_0x349e('0x102')](_0x21e9c9);}})[_0x349e('0x13')](function(_0x11dba5){if(_0x11dba5){return _0x11dba5?{'count':_0xf852f8,'rows':_0x11dba5}:null;}})['then'](respondWithResult(_0x4b2044,null))[_0x349e('0x47')](handleError(_0x4b2044,null));};exports[_0x349e('0x11c')]=function(_0x243937,_0xfd06d7){var _0x5c7b9d=_0x243937[_0x349e('0x35')][_0x349e('0x11d')]===_0x349e('0x11e')?_0x349e('0x11f'):_0x349e('0x120');return db[_0x349e('0x31')][_0x349e('0x50')]({'attributes':['id',_0x5c7b9d],'where':{'id':_0x243937[_0x349e('0x49')]['id']}})[_0x349e('0x13')](handleEntityNotFound(_0xfd06d7,null))[_0x349e('0x13')](function(_0x1a7d41){if(_0x1a7d41){var _0x78e426=_0x1a7d41[_0x5c7b9d];var _0x328a1c=_0x78e426&&_0x78e426[_0x349e('0x121')]?_0x78e426['items']:[];_0xfd06d7[_0x349e('0x2d')]({'fromKey':_['isNil'](_0x78e426[_0x349e('0x122')])?undefined:_0x78e426[_0x349e('0x122')],'count':_0x328a1c[_0x349e('0x3c')],'rows':_0x328a1c});}})['catch'](handleError(_0xfd06d7,null));};exports['getOfflineMessages']=function(_0xc17f3d,_0x47fdc1){var _0x4996c2={'raw':![],'where':{}};var _0x138fb7={};var _0xd8e0a6={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x349e('0x58')]({'where':{'id':_0xc17f3d[_0x349e('0x49')]['id']}})[_0x349e('0x13')](handleEntityNotFound(_0x47fdc1,null))[_0x349e('0x13')](function(_0x29aa4c){if(_0x29aa4c){_0x138fb7['model']=_[_0x349e('0x36')](db[_0x349e('0xcf')][_0x349e('0x61')]);_0x138fb7[_0x349e('0x35')]=_['keys'](_0xc17f3d[_0x349e('0x35')]);_0x138fb7[_0x349e('0x37')]=_['intersection'](_0x138fb7[_0x349e('0x39')],_0x138fb7['query']);_0x4996c2[_0x349e('0x3b')]=_[_0x349e('0x38')](_0x138fb7['model'],qs['fields'](_0xc17f3d[_0x349e('0x35')][_0x349e('0x3a')]));_0x4996c2[_0x349e('0x3b')]=_0x4996c2[_0x349e('0x3b')]['length']?_0x4996c2[_0x349e('0x3b')]:_0x138fb7['model'];if(!_0xc17f3d[_0x349e('0x35')][_0x349e('0x59')]('nolimit')){_0x4996c2[_0x349e('0x23')]=qs[_0x349e('0x23')](_0xc17f3d[_0x349e('0x35')]['limit']);_0x4996c2['offset']=qs[_0x349e('0x21')](_0xc17f3d[_0x349e('0x35')][_0x349e('0x21')]);}_0x4996c2['order']=qs[_0x349e('0x3e')](_0xc17f3d[_0x349e('0x35')][_0x349e('0x3e')]);_0x4996c2[_0x349e('0x3f')]=qs[_0x349e('0x37')](_[_0x349e('0x40')](_0xc17f3d[_0x349e('0x35')],_0x138fb7['filters']));_0x4996c2[_0x349e('0x3f')][_0x349e('0x55')]=_0x29aa4c['id'];if(_0xc17f3d[_0x349e('0x35')][_0x349e('0x41')]){_0x4996c2[_0x349e('0x3f')]=_[_0x349e('0x42')](_0x4996c2['where'],{'$or':_[_0x349e('0x30')](_0x4996c2[_0x349e('0x3b')],function(_0x2e83e2){var _0xf981e8={};_0xf981e8[_0x2e83e2]={'$like':'%'+_0xc17f3d[_0x349e('0x35')][_0x349e('0x41')]+'%'};return _0xf981e8;})});}_0x4996c2=_[_0x349e('0x42')]({},_0x4996c2,_0xc17f3d[_0x349e('0x5b')]);return db[_0x349e('0xcf')][_0x349e('0x22')]({'where':_0x4996c2[_0x349e('0x3f')]})[_0x349e('0x13')](function(_0x4f6832){_0xd8e0a6[_0x349e('0x22')]=_0x4f6832;if(_0xc17f3d[_0x349e('0x35')][_0x349e('0x4a')]){_0x4996c2[_0x349e('0x44')]=[{'all':!![]}];}else{_0x4996c2['include']=[{'model':db['CmContact'],'as':_0x349e('0xed'),'required':![]},{'model':db[_0x349e('0xd9')],'as':_0x349e('0x123'),'required':![]}];}return db['ChatOfflineMessage'][_0x349e('0x45')](_0x4996c2);})[_0x349e('0x13')](function(_0x4c592a){_0xd8e0a6[_0x349e('0x46')]=_0x4c592a;return _0xd8e0a6;});}})[_0x349e('0x13')](respondWithFilteredResult(_0x47fdc1,_0x4996c2))[_0x349e('0x47')](handleError(_0x47fdc1,null));};exports['addAgents']=function(_0x3ca516,_0x3394f5){return db[_0x349e('0x31')][_0x349e('0x50')]({'where':{'id':_0x3ca516[_0x349e('0x49')]['id']}})[_0x349e('0x13')](handleEntityNotFound(_0x3394f5,null))[_0x349e('0x13')](function(_0x505f46){if(_0x505f46){return _0x505f46[_0x349e('0x124')](_0x3ca516[_0x349e('0x4b')][_0x349e('0x5d')],_[_0x349e('0x11b')](_0x3ca516['body'],[_0x349e('0x5d'),'id'])||{})['spread'](function(_0x11e32a){for(var _0x2366b4=0x0;_0x2366b4<_0x3ca516[_0x349e('0x4b')][_0x349e('0x5d')]['length'];_0x2366b4+=0x1){socket[_0x349e('0x125')](_0x349e('0x126'),{'UserId':Number(_0x3ca516[_0x349e('0x4b')][_0x349e('0x5d')][_0x2366b4]),'ChatWebsiteId':Number(_0x3ca516[_0x349e('0x49')]['id'])});}return _0x11e32a;});}})[_0x349e('0x13')](respondWithResult(_0x3394f5,null))[_0x349e('0x47')](handleError(_0x3394f5,null));};exports[_0x349e('0x127')]=function(_0x57e537,_0x2dce5f){return db[_0x349e('0x31')][_0x349e('0x50')]({'where':{'id':_0x57e537[_0x349e('0x49')]['id']}})['then'](handleEntityNotFound(_0x2dce5f,null))[_0x349e('0x13')](function(_0x543aa7){if(_0x543aa7){return _0x543aa7[_0x349e('0x127')](_0x57e537[_0x349e('0x35')][_0x349e('0x5d')])[_0x349e('0x13')](function(){if(_[_0x349e('0x128')](_0x57e537[_0x349e('0x35')][_0x349e('0x5d')])){for(var _0xc0ecdb=0x0;_0xc0ecdb<_0x57e537['query'][_0x349e('0x5d')]['length'];_0xc0ecdb+=0x1){socket[_0x349e('0x125')](_0x349e('0x129'),{'UserId':Number(_0x57e537[_0x349e('0x35')][_0x349e('0x5d')][_0xc0ecdb]),'ChatWebsiteId':Number(_0x57e537['params']['id'])});}}else{socket[_0x349e('0x125')](_0x349e('0x129'),{'UserId':Number(_0x57e537[_0x349e('0x35')][_0x349e('0x5d')]),'ChatWebsiteId':Number(_0x57e537[_0x349e('0x49')]['id'])});}});}})[_0x349e('0x13')](respondWithStatusCode(_0x2dce5f,null))[_0x349e('0x47')](handleError(_0x2dce5f,null));};exports[_0x349e('0x12a')]=function(_0x29a87c,_0x45156f){var _0x3cb3be={};var _0x44bc51={};var _0x50c044;var _0x3bf043;return db[_0x349e('0x31')][_0x349e('0x58')]({'where':{'id':_0x29a87c[_0x349e('0x49')]['id']}})[_0x349e('0x13')](handleEntityNotFound(_0x45156f,null))[_0x349e('0x13')](function(_0x5324a6){if(_0x5324a6){_0x50c044=_0x5324a6;_0x44bc51[_0x349e('0x39')]=_['keys'](db[_0x349e('0xb9')]['rawAttributes']);_0x44bc51['query']=_[_0x349e('0x36')](_0x29a87c[_0x349e('0x35')]);_0x44bc51[_0x349e('0x37')]=_[_0x349e('0x38')](_0x44bc51[_0x349e('0x39')],_0x44bc51[_0x349e('0x35')]);_0x3cb3be[_0x349e('0x3b')]=_[_0x349e('0x38')](_0x44bc51[_0x349e('0x39')],qs[_0x349e('0x3a')](_0x29a87c['query'][_0x349e('0x3a')]));_0x3cb3be[_0x349e('0x3b')]=_0x3cb3be[_0x349e('0x3b')][_0x349e('0x3c')]?_0x3cb3be['attributes']:_0x44bc51[_0x349e('0x39')];_0x3cb3be[_0x349e('0x5a')]=qs[_0x349e('0x3e')](_0x29a87c['query'][_0x349e('0x3e')]);_0x3cb3be[_0x349e('0x3f')]=qs['filters'](_['pick'](_0x29a87c[_0x349e('0x35')],_0x44bc51[_0x349e('0x37')]));if(_0x29a87c[_0x349e('0x35')][_0x349e('0x41')]){_0x3cb3be[_0x349e('0x3f')]=_[_0x349e('0x42')](_0x3cb3be[_0x349e('0x3f')],{'$or':_['map'](_0x3cb3be['attributes'],function(_0x5dbf6b){var _0x13479b={};_0x13479b[_0x5dbf6b]={'$like':'%'+_0x29a87c[_0x349e('0x35')][_0x349e('0x41')]+'%'};return _0x13479b;})});}_0x3cb3be=_[_0x349e('0x42')]({},_0x3cb3be,_0x29a87c[_0x349e('0x5b')]);return _0x50c044[_0x349e('0x12a')](_0x3cb3be);}})['then'](function(_0x2ec315){if(_0x2ec315){_0x3bf043=_0x2ec315[_0x349e('0x3c')];if(!_0x29a87c['query']['hasOwnProperty'](_0x349e('0x3d'))){_0x3cb3be[_0x349e('0x23')]=qs['limit'](_0x29a87c['query'][_0x349e('0x23')]);_0x3cb3be[_0x349e('0x21')]=qs[_0x349e('0x21')](_0x29a87c[_0x349e('0x35')]['offset']);}return _0x50c044[_0x349e('0x12a')](_0x3cb3be);}})[_0x349e('0x13')](function(_0x5259aa){if(_0x5259aa){return _0x5259aa?{'count':_0x3bf043,'rows':_0x5259aa}:null;}})['then'](respondWithResult(_0x45156f,null))[_0x349e('0x47')](handleError(_0x45156f,null));};
\ No newline at end of file
+var _0xf41c=['difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','CmContact','Contacts','DESC','Applications','account','List','applications','priority','asc','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','vendor','threadId','ChatInteraction','externalUrl','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','describe','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','spread','render','toPairs','fromString','originalname','mimetype','server','offline-chat','basename','sequelize','transaction','Attachment','bulkCreate','MailAccount','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','MailAccountId','subjectOffline','mapValues','Chat','NotifyMailAccount','attachments','remove','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','iftime\x20%s,%s','interval','timezone','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','custom','License','chatLicenseExceeded','some','server/files/chat/iframe.ejs','utf8','remote','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','ChatApplication','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','defaults','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','length','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','keys','pick','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','sitepic','existsSync','join','server/files/images/logos/','getAvatar','server/files/images/avatars/','download','getCustomerAvatar','showCustomerAvatar','isNil','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','user-agent','getResult','ValidationError','no\x20available\x20attributes'];(function(_0x3fd414,_0x2185c7){var _0x1ee59d=function(_0x5d21a2){while(--_0x5d21a2){_0x3fd414['push'](_0x3fd414['shift']());}};_0x1ee59d(++_0x2185c7);}(_0xf41c,0xa8));var _0xcf41=function(_0x166fec,_0xf34ed8){_0x166fec=_0x166fec-0x0;var _0xff6f55=_0xf41c[_0x166fec];return _0xff6f55;};'use strict';var BPromise=require(_0xcf41('0x0'));var Mustache=require(_0xcf41('0x1'));var util=require(_0xcf41('0x2'));var path=require(_0xcf41('0x3'));var ejs=require(_0xcf41('0x4'));var fs=require('fs');var fs_extra=require(_0xcf41('0x5'));var _=require(_0xcf41('0x6'));var querystring=require(_0xcf41('0x7'));var Redis=require(_0xcf41('0x8'));var qs=require(_0xcf41('0x9'));var logger=require(_0xcf41('0xa'))('api');var config=require(_0xcf41('0xb'));var db=require(_0xcf41('0xc'))['db'];config['redis']=_[_0xcf41('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcf41('0xe'))(new Redis(config['redis']));require(_0xcf41('0xf'))[_0xcf41('0x10')](socket);var htmlToText=require(_0xcf41('0x11'));var jayson=require(_0xcf41('0x12'));var client=jayson[_0xcf41('0x13')][_0xcf41('0x14')]({'port':0x232c});var client9002=jayson[_0xcf41('0x13')][_0xcf41('0x14')]({'port':0x232a});var client9003=jayson[_0xcf41('0x13')][_0xcf41('0x14')]({'port':0x232b});var client9001=jayson[_0xcf41('0x13')]['http']({'port':0x2329});function respondWithRpcPromise(_0x3243e5,_0x41a64a,_0x525b34,_0x492c39){return new BPromise(function(_0x16477f,_0x13c0b9){var _0x1e190c=_0x492c39||client;return _0x1e190c[_0xcf41('0x15')](_0x3243e5,_0x525b34)['then'](function(_0xebc0d6){logger[_0xcf41('0x16')](_0xcf41('0x17'),_0x41a64a,'request\x20sent');logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x41a64a,_0xcf41('0x18'),JSON[_0xcf41('0x19')](_0xebc0d6));if(_0xebc0d6[_0xcf41('0x1a')]){if(_0xebc0d6[_0xcf41('0x1a')][_0xcf41('0x1b')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x41a64a,_0xebc0d6[_0xcf41('0x1a')][_0xcf41('0x1c')]);return _0x13c0b9(_0xebc0d6[_0xcf41('0x1a')]['message']);}logger[_0xcf41('0x1a')](_0xcf41('0x17'),_0x41a64a,_0xebc0d6[_0xcf41('0x1a')]['message']);return _0x16477f(_0xebc0d6[_0xcf41('0x1a')][_0xcf41('0x1c')]);}else{logger[_0xcf41('0x16')](_0xcf41('0x17'),_0x41a64a,_0xcf41('0x18'));_0x16477f(_0xebc0d6['result'][_0xcf41('0x1c')]);}})[_0xcf41('0x1d')](function(_0x2a3452){logger['error'](_0xcf41('0x17'),_0x41a64a,_0x2a3452);_0x13c0b9(_0x2a3452);});});}function respondWithStatusCode(_0x50c30c,_0x265966){_0x265966=_0x265966||0xcc;return function(_0x283053){if(_0x283053){return _0x50c30c[_0xcf41('0x1e')](_0x265966);}return _0x50c30c['status'](_0x265966)[_0xcf41('0x1f')]();};}function respondWithResult(_0x192bbb,_0x3e3734){_0x3e3734=_0x3e3734||0xc8;return function(_0x26078b){if(_0x26078b){return _0x192bbb[_0xcf41('0x20')](_0x3e3734)[_0xcf41('0x21')](_0x26078b);}};}function respondWithFilteredResult(_0x48d633,_0x349b7b){return function(_0x244c25){if(_0x244c25){var _0x593b61=typeof _0x349b7b[_0xcf41('0x22')]===_0xcf41('0x23')&&typeof _0x349b7b[_0xcf41('0x24')]==='undefined';var _0x1efdea=_0x244c25[_0xcf41('0x25')];var _0x182a36=_0x593b61?0x0:_0x349b7b[_0xcf41('0x22')];var _0x422921=_0x593b61?_0x244c25[_0xcf41('0x25')]:_0x349b7b['offset']+_0x349b7b[_0xcf41('0x24')];var _0x2d1a86;if(_0x422921>=_0x1efdea){_0x422921=_0x1efdea;_0x2d1a86=0xc8;}else{_0x2d1a86=0xce;}_0x48d633[_0xcf41('0x20')](_0x2d1a86);return _0x48d633['set'](_0xcf41('0x26'),_0x182a36+'-'+_0x422921+'/'+_0x1efdea)[_0xcf41('0x21')](_0x244c25);}return null;};}function saveUpdates(_0x31f077){return function(_0xb13b61){if(_0xb13b61){return _0xb13b61[_0xcf41('0x27')](_0x31f077)[_0xcf41('0x28')](function(_0x2a8d4e){return _0x2a8d4e;});}return null;};}function removeEntity(_0x1bf66a){return function(_0x59f531){if(_0x59f531){return _0x59f531[_0xcf41('0x29')]()[_0xcf41('0x28')](function(){var _0x763002=_0x59f531[_0xcf41('0x2a')]({'plain':!![]});var _0x59a2d8=_0xcf41('0x2b');return db[_0xcf41('0x2c')][_0xcf41('0x29')]({'where':{'type':_0x59a2d8,'resourceId':_0x763002['id']}})['then'](function(){return _0x59f531;});})[_0xcf41('0x28')](function(){_0x1bf66a[_0xcf41('0x20')](0xcc)[_0xcf41('0x1f')]();});}};}function handleEntityNotFound(_0x11a148){return function(_0x143e32){if(!_0x143e32){_0x11a148['sendStatus'](0x194);}return _0x143e32;};}function handleError(_0x159320,_0x4cdb02){_0x4cdb02=_0x4cdb02||0x1f4;return function(_0x47eb5a){logger[_0xcf41('0x1a')](_0x47eb5a[_0xcf41('0x2d')]);if(_0x47eb5a[_0xcf41('0x2e')]){delete _0x47eb5a['name'];}_0x159320[_0xcf41('0x20')](_0x4cdb02)[_0xcf41('0x2f')](_0x47eb5a);};}exports[_0xcf41('0x30')]=function(_0x51d41e,_0x307ff3){var _0x43d6c6={'include':[{'model':db[_0xcf41('0x31')],'as':_0xcf41('0x32')}]},_0x93ee03={},_0x3420bd={'count':0x0,'rows':[]};var _0x3d767c=_['map'](db[_0xcf41('0x33')][_0xcf41('0x34')],function(_0x16f02e){return{'name':_0x16f02e[_0xcf41('0x35')],'type':_0x16f02e[_0xcf41('0x36')][_0xcf41('0x37')]};});_0x93ee03[_0xcf41('0x38')]=_[_0xcf41('0x39')](_0x3d767c,'name');_0x93ee03['query']=_['keys'](_0x51d41e[_0xcf41('0x3a')]);_0x93ee03[_0xcf41('0x3b')]=_[_0xcf41('0x3c')](_0x93ee03['model'],_0x93ee03[_0xcf41('0x3a')]);_0x43d6c6[_0xcf41('0x3d')]=_['intersection'](_0x93ee03['model'],qs['fields'](_0x51d41e[_0xcf41('0x3a')][_0xcf41('0x3e')]));_0x43d6c6[_0xcf41('0x3d')]=_0x43d6c6[_0xcf41('0x3d')]['length']?_0x43d6c6[_0xcf41('0x3d')]:_0x93ee03[_0xcf41('0x38')];if(!_0x51d41e[_0xcf41('0x3a')][_0xcf41('0x3f')](_0xcf41('0x40'))){_0x43d6c6[_0xcf41('0x24')]=qs[_0xcf41('0x24')](_0x51d41e[_0xcf41('0x3a')][_0xcf41('0x24')]);_0x43d6c6['offset']=qs[_0xcf41('0x22')](_0x51d41e[_0xcf41('0x3a')][_0xcf41('0x22')]);}_0x43d6c6[_0xcf41('0x41')]=qs[_0xcf41('0x42')](_0x51d41e[_0xcf41('0x3a')][_0xcf41('0x42')]);_0x43d6c6[_0xcf41('0x43')]=qs[_0xcf41('0x3b')](_['pick'](_0x51d41e[_0xcf41('0x3a')],_0x93ee03['filters']),_0x3d767c);if(_0x51d41e[_0xcf41('0x3a')]['filter']){_0x43d6c6[_0xcf41('0x43')]=_[_0xcf41('0x44')](_0x43d6c6[_0xcf41('0x43')],{'$or':_['map'](_0x3d767c,function(_0x5ec098){if(_0x5ec098[_0xcf41('0x36')]!==_0xcf41('0x45')){var _0x485b14={};_0x485b14[_0x5ec098[_0xcf41('0x2e')]]={'$like':'%'+_0x51d41e[_0xcf41('0x3a')][_0xcf41('0x46')]+'%'};return _0x485b14;}})});}_0x43d6c6=_[_0xcf41('0x44')]({},_0x43d6c6,_0x51d41e[_0xcf41('0x47')]);var _0x5bd074={'where':_0x43d6c6['where']};return db[_0xcf41('0x33')]['count'](_0x5bd074)[_0xcf41('0x28')](function(_0x27b0b0){_0x3420bd[_0xcf41('0x25')]=_0x27b0b0;if(_0x51d41e[_0xcf41('0x3a')][_0xcf41('0x48')]){_0x43d6c6[_0xcf41('0x49')]=[{'all':!![]}];}return db[_0xcf41('0x33')][_0xcf41('0x4a')](_0x43d6c6);})[_0xcf41('0x28')](function(_0x4f896b){_0x3420bd[_0xcf41('0x4b')]=_0x4f896b;return _0x3420bd;})['then'](respondWithFilteredResult(_0x307ff3,_0x43d6c6))['catch'](handleError(_0x307ff3,null));};exports['show']=function(_0x561c9f,_0x120fda){var _0x219120={'raw':![],'where':{'id':_0x561c9f['params']['id']},'include':[{'model':db[_0xcf41('0x31')],'as':_0xcf41('0x32')}]},_0x5055a5={};_0x5055a5[_0xcf41('0x38')]=_['keys'](db[_0xcf41('0x33')][_0xcf41('0x34')]);_0x5055a5[_0xcf41('0x3a')]=_['keys'](_0x561c9f[_0xcf41('0x3a')]);_0x5055a5['filters']=_[_0xcf41('0x3c')](_0x5055a5[_0xcf41('0x38')],_0x5055a5[_0xcf41('0x3a')]);_0x219120[_0xcf41('0x3d')]=_['intersection'](_0x5055a5[_0xcf41('0x38')],qs[_0xcf41('0x3e')](_0x561c9f[_0xcf41('0x3a')][_0xcf41('0x3e')]));_0x219120[_0xcf41('0x3d')]=_0x219120['attributes'][_0xcf41('0x4c')]?_0x219120[_0xcf41('0x3d')]:_0x5055a5[_0xcf41('0x38')];if(_0x561c9f[_0xcf41('0x3a')][_0xcf41('0x48')]){_0x219120[_0xcf41('0x49')]=[{'all':!![]}];}_0x219120=_[_0xcf41('0x44')]({},_0x219120,_0x561c9f['options']);return db['ChatWebsite'][_0xcf41('0x4d')](_0x219120)[_0xcf41('0x28')](handleEntityNotFound(_0x120fda,null))[_0xcf41('0x28')](respondWithResult(_0x120fda,null))['catch'](handleError(_0x120fda,null));};exports['create']=function(_0x13f432,_0x5c26f5){return db[_0xcf41('0x33')][_0xcf41('0x4e')](_0x13f432[_0xcf41('0x4f')],{})[_0xcf41('0x28')](function(_0x599b64){var _0x35c4d8=_0x13f432[_0xcf41('0x50')][_0xcf41('0x2a')]({'plain':!![]});if(!_0x35c4d8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35c4d8[_0xcf41('0x51')]===_0xcf41('0x50')){var _0x5e9524=_0x599b64['get']({'plain':!![]});var _0x226365='ChatWebsites';return db[_0xcf41('0x52')][_0xcf41('0x4d')]({'where':{'name':_0x226365,'userProfileId':_0x35c4d8[_0xcf41('0x53')]},'raw':!![]})[_0xcf41('0x28')](function(_0x5ddac8){if(_0x5ddac8&&_0x5ddac8['autoAssociation']===0x0){return db[_0xcf41('0x2c')][_0xcf41('0x4e')]({'name':_0x5e9524[_0xcf41('0x2e')],'resourceId':_0x5e9524['id'],'type':_0x5ddac8[_0xcf41('0x2e')],'sectionId':_0x5ddac8['id']},{})[_0xcf41('0x28')](function(){return _0x599b64;});}else{return _0x599b64;}})['catch'](function(_0x8782d2){logger[_0xcf41('0x1a')](_0xcf41('0x54'),_0x8782d2);throw _0x8782d2;});}return _0x599b64;})['then'](respondWithResult(_0x5c26f5,0xc9))[_0xcf41('0x1d')](handleError(_0x5c26f5,null));};exports['update']=function(_0x3b6de5,_0x33fb49){if(_0x3b6de5[_0xcf41('0x4f')]['id']){delete _0x3b6de5[_0xcf41('0x4f')]['id'];}return db[_0xcf41('0x33')][_0xcf41('0x4d')]({'where':{'id':_0x3b6de5['params']['id']},'include':[{'model':db[_0xcf41('0x31')],'as':_0xcf41('0x32')}]})[_0xcf41('0x28')](handleEntityNotFound(_0x33fb49,null))[_0xcf41('0x28')](saveUpdates(_0x3b6de5[_0xcf41('0x4f')],null))[_0xcf41('0x28')](respondWithResult(_0x33fb49,null))[_0xcf41('0x1d')](handleError(_0x33fb49,null));};exports['destroy']=function(_0x28932c,_0x330f69){return db[_0xcf41('0x33')]['find']({'where':{'id':_0x28932c[_0xcf41('0x55')]['id']}})[_0xcf41('0x28')](handleEntityNotFound(_0x330f69,null))[_0xcf41('0x28')](removeEntity(_0x330f69,null))[_0xcf41('0x1d')](handleError(_0x330f69,null));};exports['describe']=function(_0x8ea1c2,_0xb97fd3){return db[_0xcf41('0x33')]['describe']()['then'](respondWithResult(_0xb97fd3,null))['catch'](handleError(_0xb97fd3,null));};exports[_0xcf41('0x56')]=function(_0x1032ad,_0x3cc33e){if(_0x1032ad[_0xcf41('0x4f')]['id']){delete _0x1032ad[_0xcf41('0x4f')]['id'];}return db[_0xcf41('0x33')][_0xcf41('0x4d')]({'where':{'id':_0x1032ad['params']['id']}})['then'](handleEntityNotFound(_0x3cc33e,null))[_0xcf41('0x28')](function(_0x270286){if(_0x270286){_0x1032ad[_0xcf41('0x4f')][_0xcf41('0x57')]=_0x270286['id'];return db[_0xcf41('0x58')]['create'](_0x1032ad[_0xcf41('0x4f')]);}})[_0xcf41('0x28')](respondWithResult(_0x3cc33e,null))[_0xcf41('0x1d')](handleError(_0x3cc33e,null));};exports[_0xcf41('0x59')]=function(_0x307091,_0x1704f6){var _0x2d70c1={'raw':![],'where':{}};var _0x5c7fd1={};var _0x11f816={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xcf41('0x5a')]({'where':{'id':_0x307091[_0xcf41('0x55')]['id']}})['then'](handleEntityNotFound(_0x1704f6,null))[_0xcf41('0x28')](function(_0x56dfd7){if(_0x56dfd7){_0x5c7fd1[_0xcf41('0x38')]=_['keys'](db[_0xcf41('0x58')]['rawAttributes']);_0x5c7fd1[_0xcf41('0x3a')]=_[_0xcf41('0x5b')](_0x307091['query']);_0x5c7fd1['filters']=_[_0xcf41('0x3c')](_0x5c7fd1[_0xcf41('0x38')],_0x5c7fd1[_0xcf41('0x3a')]);_0x2d70c1[_0xcf41('0x3d')]=_[_0xcf41('0x3c')](_0x5c7fd1['model'],qs[_0xcf41('0x3e')](_0x307091[_0xcf41('0x3a')][_0xcf41('0x3e')]));_0x2d70c1[_0xcf41('0x3d')]=_0x2d70c1[_0xcf41('0x3d')]['length']?_0x2d70c1[_0xcf41('0x3d')]:_0x5c7fd1[_0xcf41('0x38')];if(!_0x307091[_0xcf41('0x3a')]['hasOwnProperty'](_0xcf41('0x40'))){_0x2d70c1[_0xcf41('0x24')]=qs[_0xcf41('0x24')](_0x307091['query']['limit']);_0x2d70c1[_0xcf41('0x22')]=qs[_0xcf41('0x22')](_0x307091[_0xcf41('0x3a')][_0xcf41('0x22')]);}_0x2d70c1[_0xcf41('0x41')]=qs[_0xcf41('0x42')](_0x307091[_0xcf41('0x3a')][_0xcf41('0x42')]);_0x2d70c1[_0xcf41('0x43')]=qs[_0xcf41('0x3b')](_[_0xcf41('0x5c')](_0x307091[_0xcf41('0x3a')],_0x5c7fd1['filters']));_0x2d70c1['where'][_0xcf41('0x57')]=_0x56dfd7['id'];if(_0x307091[_0xcf41('0x3a')][_0xcf41('0x46')]){_0x2d70c1[_0xcf41('0x43')]=_[_0xcf41('0x44')](_0x2d70c1[_0xcf41('0x43')],{'$or':_[_0xcf41('0x39')](_0x2d70c1[_0xcf41('0x3d')],function(_0x49672d){var _0x6616e9={};_0x6616e9[_0x49672d]={'$like':'%'+_0x307091[_0xcf41('0x3a')][_0xcf41('0x46')]+'%'};return _0x6616e9;})});}_0x2d70c1=_[_0xcf41('0x44')]({},_0x2d70c1,_0x307091[_0xcf41('0x47')]);return db['Disposition'][_0xcf41('0x25')]({'where':_0x2d70c1[_0xcf41('0x43')]})[_0xcf41('0x28')](function(_0x2a0e87){_0x11f816['count']=_0x2a0e87;if(_0x307091[_0xcf41('0x3a')][_0xcf41('0x48')]){_0x2d70c1[_0xcf41('0x49')]=[{'all':!![]}];}return db[_0xcf41('0x58')]['findAll'](_0x2d70c1);})['then'](function(_0x2ba9f2){_0x11f816[_0xcf41('0x4b')]=_0x2ba9f2;return _0x11f816;});}})[_0xcf41('0x28')](respondWithFilteredResult(_0x1704f6,_0x2d70c1))['catch'](handleError(_0x1704f6,null));};exports[_0xcf41('0x5d')]=function(_0x3c051b,_0x342f5c){return db['ChatWebsite'][_0xcf41('0x4d')]({'where':{'id':_0x3c051b[_0xcf41('0x55')]['id']}})['then'](handleEntityNotFound(_0x342f5c,null))['then'](function(_0x5685e0){if(_0x5685e0){return _0x5685e0[_0xcf41('0x5d')](_0x3c051b[_0xcf41('0x3a')][_0xcf41('0x5e')]);}})[_0xcf41('0x28')](respondWithStatusCode(_0x342f5c,null))['catch'](handleError(_0x342f5c,null));};exports['addAnswer']=function(_0x876586,_0xebc397){if(_0x876586[_0xcf41('0x4f')]['id']){delete _0x876586[_0xcf41('0x4f')]['id'];}return db[_0xcf41('0x33')][_0xcf41('0x4d')]({'where':{'id':_0x876586[_0xcf41('0x55')]['id']}})[_0xcf41('0x28')](handleEntityNotFound(_0xebc397,null))[_0xcf41('0x28')](function(_0x3697b5){if(_0x3697b5){_0x876586[_0xcf41('0x4f')][_0xcf41('0x57')]=_0x3697b5['id'];return db[_0xcf41('0x5f')][_0xcf41('0x4e')](_0x876586[_0xcf41('0x4f')]);}})['then'](respondWithResult(_0xebc397,null))[_0xcf41('0x1d')](handleError(_0xebc397,null));};exports[_0xcf41('0x60')]=function(_0x383e28,_0x243b3f){var _0xe15e5e={'raw':![],'where':{}};var _0x2e3f0f={};var _0x50e346={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x383e28[_0xcf41('0x55')]['id']}})['then'](handleEntityNotFound(_0x243b3f,null))[_0xcf41('0x28')](function(_0x1c541e){if(_0x1c541e){_0x2e3f0f[_0xcf41('0x38')]=_[_0xcf41('0x5b')](db[_0xcf41('0x5f')][_0xcf41('0x34')]);_0x2e3f0f[_0xcf41('0x3a')]=_[_0xcf41('0x5b')](_0x383e28[_0xcf41('0x3a')]);_0x2e3f0f[_0xcf41('0x3b')]=_[_0xcf41('0x3c')](_0x2e3f0f[_0xcf41('0x38')],_0x2e3f0f['query']);_0xe15e5e[_0xcf41('0x3d')]=_[_0xcf41('0x3c')](_0x2e3f0f[_0xcf41('0x38')],qs[_0xcf41('0x3e')](_0x383e28[_0xcf41('0x3a')]['fields']));_0xe15e5e[_0xcf41('0x3d')]=_0xe15e5e['attributes'][_0xcf41('0x4c')]?_0xe15e5e[_0xcf41('0x3d')]:_0x2e3f0f[_0xcf41('0x38')];if(!_0x383e28[_0xcf41('0x3a')][_0xcf41('0x3f')]('nolimit')){_0xe15e5e['limit']=qs[_0xcf41('0x24')](_0x383e28[_0xcf41('0x3a')]['limit']);_0xe15e5e[_0xcf41('0x22')]=qs[_0xcf41('0x22')](_0x383e28[_0xcf41('0x3a')][_0xcf41('0x22')]);}_0xe15e5e[_0xcf41('0x41')]=qs['sort'](_0x383e28[_0xcf41('0x3a')]['sort']);_0xe15e5e[_0xcf41('0x43')]=qs[_0xcf41('0x3b')](_['pick'](_0x383e28[_0xcf41('0x3a')],_0x2e3f0f['filters']));_0xe15e5e[_0xcf41('0x43')][_0xcf41('0x57')]=_0x1c541e['id'];if(_0x383e28[_0xcf41('0x3a')][_0xcf41('0x46')]){_0xe15e5e[_0xcf41('0x43')]=_[_0xcf41('0x44')](_0xe15e5e[_0xcf41('0x43')],{'$or':_[_0xcf41('0x39')](_0xe15e5e[_0xcf41('0x3d')],function(_0x117704){var _0x2e1c6e={};_0x2e1c6e[_0x117704]={'$like':'%'+_0x383e28['query'][_0xcf41('0x46')]+'%'};return _0x2e1c6e;})});}_0xe15e5e=_[_0xcf41('0x44')]({},_0xe15e5e,_0x383e28[_0xcf41('0x47')]);return db[_0xcf41('0x5f')][_0xcf41('0x25')]({'where':_0xe15e5e[_0xcf41('0x43')]})[_0xcf41('0x28')](function(_0x34a239){_0x50e346[_0xcf41('0x25')]=_0x34a239;if(_0x383e28[_0xcf41('0x3a')][_0xcf41('0x48')]){_0xe15e5e[_0xcf41('0x49')]=[{'all':!![]}];}return db[_0xcf41('0x5f')][_0xcf41('0x4a')](_0xe15e5e);})['then'](function(_0xc7127b){_0x50e346['rows']=_0xc7127b;return _0x50e346;});}})['then'](respondWithFilteredResult(_0x243b3f,_0xe15e5e))[_0xcf41('0x1d')](handleError(_0x243b3f,null));};exports[_0xcf41('0x61')]=function(_0x52189a,_0x30e451){return db[_0xcf41('0x33')]['find']({'where':{'id':_0x52189a[_0xcf41('0x55')]['id']}})['then'](handleEntityNotFound(_0x30e451,null))['then'](function(_0x1c02f9){if(_0x1c02f9){return _0x1c02f9[_0xcf41('0x61')](_0x52189a[_0xcf41('0x3a')]['ids']);}})[_0xcf41('0x28')](respondWithStatusCode(_0x30e451,null))[_0xcf41('0x1d')](handleError(_0x30e451,null));};exports['addLogo']=function(_0x136dc6,_0x27381c){_0x136dc6[_0xcf41('0x4f')]['sitepic']=_0x136dc6['file'][_0xcf41('0x62')];return db[_0xcf41('0x33')]['find']({'where':{'id':_0x136dc6['params']['id']}})[_0xcf41('0x28')](handleEntityNotFound(_0x27381c,null))[_0xcf41('0x28')](saveUpdates(_0x136dc6['body'],null))['then'](respondWithResult(_0x27381c,null))[_0xcf41('0x1d')](handleError(_0x27381c,null));};exports[_0xcf41('0x63')]=function(_0x4a1a39,_0x15ba4d){_0x4a1a39[_0xcf41('0x4f')][_0xcf41('0x64')]=_0x4a1a39[_0xcf41('0x65')][_0xcf41('0x62')];return db['ChatWebsite'][_0xcf41('0x4d')]({'where':{'id':_0x4a1a39[_0xcf41('0x55')]['id']}})[_0xcf41('0x28')](handleEntityNotFound(_0x15ba4d,null))[_0xcf41('0x28')](saveUpdates(_0x4a1a39[_0xcf41('0x4f')],null))[_0xcf41('0x28')](respondWithResult(_0x15ba4d,null))[_0xcf41('0x1d')](handleError(_0x15ba4d,null));};exports[_0xcf41('0x66')]=function(_0x49b924,_0x2f7da9){_0x49b924[_0xcf41('0x4f')][_0xcf41('0x67')]=_0x49b924[_0xcf41('0x65')][_0xcf41('0x62')];return db[_0xcf41('0x33')]['find']({'where':{'id':_0x49b924[_0xcf41('0x55')]['id']}})[_0xcf41('0x28')](handleEntityNotFound(_0x2f7da9,null))[_0xcf41('0x28')](saveUpdates(_0x49b924[_0xcf41('0x4f')],null))[_0xcf41('0x28')](respondWithResult(_0x2f7da9,null))[_0xcf41('0x1d')](handleError(_0x2f7da9,null));};exports[_0xcf41('0x68')]=function(_0x2e12b0,_0x3a553a){_0x2e12b0[_0xcf41('0x4f')][_0xcf41('0x69')]=_0x2e12b0['file'][_0xcf41('0x62')];return db[_0xcf41('0x33')][_0xcf41('0x4d')]({'where':{'id':_0x2e12b0[_0xcf41('0x55')]['id']}})[_0xcf41('0x28')](handleEntityNotFound(_0x3a553a,null))['then'](saveUpdates(_0x2e12b0[_0xcf41('0x4f')],null))['then'](respondWithResult(_0x3a553a,null))[_0xcf41('0x1d')](handleError(_0x3a553a,null));};exports[_0xcf41('0x6a')]=function(_0x3b52f1,_0x12ea7e){var _0x5d9913=path['join'](config[_0xcf41('0x6b')],_0xcf41('0x6c'));var _0x1d2d3c={'where':{'id':_0x3b52f1['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x59e482=![];return require(_0xcf41('0x6d'))[_0xcf41('0x6e')]()[_0xcf41('0x28')](function(_0x1c0459){if(_0x1c0459){_0x59e482=_0x1c0459['custom'];}})[_0xcf41('0x28')](function(){return db[_0xcf41('0x33')][_0xcf41('0x4d')](_0x1d2d3c);})[_0xcf41('0x28')](handleEntityNotFound(_0x12ea7e,null))[_0xcf41('0x28')](function(_0xa1c1a1){if(_0xa1c1a1){if(!_['isNil'](_0xa1c1a1[_0xcf41('0x6f')])){if(fs[_0xcf41('0x70')](path[_0xcf41('0x71')](config[_0xcf41('0x6b')],_0xcf41('0x72'),_0xa1c1a1[_0xcf41('0x6f')]))&&_0x59e482){_0x5d9913=path[_0xcf41('0x71')](config[_0xcf41('0x6b')],_0xcf41('0x72'),_0xa1c1a1['sitepic']);}}return _0x12ea7e['download'](_0x5d9913);}})[_0xcf41('0x1d')](handleError(_0x12ea7e,null));};exports[_0xcf41('0x73')]=function(_0x44f9e7,_0x1c6a8c){var _0x27d3d6=path[_0xcf41('0x71')](config[_0xcf41('0x6b')],'server/files/images/avatars/default_avatar.png');var _0x4ccc68={'where':{'id':_0x44f9e7[_0xcf41('0x55')]['id']},'attributes':['id',_0xcf41('0x64')],'raw':!![]};return db[_0xcf41('0x33')]['find'](_0x4ccc68)['then'](handleEntityNotFound(_0x1c6a8c,null))[_0xcf41('0x28')](function(_0x5c6d6b){if(_0x5c6d6b){if(!_['isNil'](_0x5c6d6b[_0xcf41('0x64')])){if(fs['existsSync'](path['join'](config[_0xcf41('0x6b')],_0xcf41('0x74'),_0x5c6d6b[_0xcf41('0x64')]))){_0x27d3d6=path[_0xcf41('0x71')](config[_0xcf41('0x6b')],_0xcf41('0x74'),_0x5c6d6b['agentAvatar']);}}return _0x1c6a8c[_0xcf41('0x75')](_0x27d3d6);}})['catch'](handleError(_0x1c6a8c,null));};exports[_0xcf41('0x76')]=function(_0xe85cd2,_0x1c98b3){var _0x57c854=path[_0xcf41('0x71')](config[_0xcf41('0x6b')],'server/files/images/avatars/customer_avatar.png');var _0x3cca0d={'where':{'id':_0xe85cd2[_0xcf41('0x55')]['id']},'attributes':['id',_0xcf41('0x67'),_0xcf41('0x77')],'raw':!![]};return db['ChatWebsite'][_0xcf41('0x4d')](_0x3cca0d)[_0xcf41('0x28')](handleEntityNotFound(_0x1c98b3,null))[_0xcf41('0x28')](function(_0x5903a4){if(_0x5903a4){if(!_[_0xcf41('0x78')](_0x5903a4['customerAvatar'])){if(fs['existsSync'](path[_0xcf41('0x71')](config[_0xcf41('0x6b')],_0xcf41('0x74'),_0x5903a4[_0xcf41('0x67')]))&&_0x5903a4[_0xcf41('0x77')]){_0x57c854=path[_0xcf41('0x71')](config[_0xcf41('0x6b')],_0xcf41('0x74'),_0x5903a4['customerAvatar']);}}return _0x1c98b3[_0xcf41('0x75')](_0x57c854);}})['catch'](handleError(_0x1c98b3,null));};exports[_0xcf41('0x79')]=function(_0x27bdef,_0x3ada52){var _0x57a46f=path[_0xcf41('0x71')](config[_0xcf41('0x6b')],_0xcf41('0x7a'));var _0xd4b4d0={'where':{'id':_0x27bdef[_0xcf41('0x55')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xcf41('0x33')][_0xcf41('0x4d')](_0xd4b4d0)[_0xcf41('0x28')](handleEntityNotFound(_0x3ada52,null))[_0xcf41('0x28')](function(_0x597eb6){if(_0x597eb6){if(!_['isNil'](_0x597eb6[_0xcf41('0x69')])){if(fs['existsSync'](path[_0xcf41('0x71')](config[_0xcf41('0x6b')],_0xcf41('0x74'),_0x597eb6[_0xcf41('0x69')]))){_0x57a46f=path['join'](config['root'],_0xcf41('0x74'),_0x597eb6[_0xcf41('0x69')]);}}return _0x3ada52['download'](_0x57a46f);}})[_0xcf41('0x1d')](handleError(_0x3ada52,null));};exports[_0xcf41('0x7b')]=function(_0x165ce0,_0x45c91b){var _0x4f36c7=require('user-agent-parser');var _0x3ec704=new _0x4f36c7();var _0x50aae4=_0x3ec704[_0xcf41('0x7c')](_0x165ce0['headers'][_0xcf41('0x7d')])[_0xcf41('0x7e')]();var _0x3a5a92={'body':_0x165ce0[_0xcf41('0x4f')],'channel':'chat'};var _0x3914d1=[];var _0x15b3ef=[];var _0x3954c6={};var _0x472ffd=![];return db['CmContact']['describe']()[_0xcf41('0x28')](function(_0x4fb738){if(!_0x4fb738){throw new db['Sequelize'][(_0xcf41('0x7f'))](_0xcf41('0x80'));}_0x3914d1=_[_0xcf41('0x81')](_[_0xcf41('0x5b')](_0x4fb738),[_0xcf41('0x82'),'updatedAt']);_0x15b3ef=_[_0xcf41('0x81')](_['keys'](_0x4fb738),[_0xcf41('0x82'),_0xcf41('0x83'),_0xcf41('0x84'),_0xcf41('0x85')]);if(_0x165ce0[_0xcf41('0x4f')]['id']){delete _0x165ce0[_0xcf41('0x4f')]['id'];}if(_[_0xcf41('0x78')](_0x165ce0['body'][_0xcf41('0x86')])){throw new db['Sequelize'][(_0xcf41('0x7f'))]('from\x20is\x20mandatory');}if(_[_0xcf41('0x78')](_0x165ce0[_0xcf41('0x4f')][_0xcf41('0x4f')])||_0x165ce0[_0xcf41('0x4f')]['body']===''){throw new db[(_0xcf41('0x87'))][(_0xcf41('0x7f'))](_0xcf41('0x88'));}if(_['isNil'](_0x165ce0['body'][_0xcf41('0x89')])){throw new db[(_0xcf41('0x87'))][(_0xcf41('0x7f'))](_0xcf41('0x8a')+_0x15b3ef);}if(!_[_0xcf41('0x8b')](_0x15b3ef,_0x165ce0[_0xcf41('0x4f')][_0xcf41('0x89')])){throw new db[(_0xcf41('0x87'))][(_0xcf41('0x7f'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x15b3ef);}_0x3954c6[_0x165ce0['body'][_0xcf41('0x89')]]=_0x165ce0[_0xcf41('0x4f')][_0xcf41('0x86')];})[_0xcf41('0x28')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x165ce0['params']['id']},'include':[{'model':db[_0xcf41('0x8c')],'as':'List','include':[{'model':db[_0xcf41('0x8d')],'as':_0xcf41('0x8e'),'where':_0x3954c6,'limit':0x1,'order':[['updatedAt',_0xcf41('0x8f')]]}]},{'model':db['ChatApplication'],'as':_0xcf41('0x90')}]});})[_0xcf41('0x28')](handleEntityNotFound(_0x45c91b,null))['then'](function(_0x23a246){if(_0x23a246&&_0x23a246['List']){_0x3a5a92[_0xcf41('0x91')]=_0x23a246;_0x3a5a92['applications']=_0x23a246['Applications'];_0x3a5a92['list']=_0x23a246[_0xcf41('0x92')];_0x3a5a92[_0xcf41('0x93')]=_['orderBy'](_0x3a5a92[_0xcf41('0x93')],[_0xcf41('0x94')],[_0xcf41('0x95')]);if(_0x3a5a92[_0xcf41('0x91')][_0xcf41('0x90')]){delete _0x3a5a92[_0xcf41('0x91')][_0xcf41('0x90')];}if(_0x3a5a92[_0xcf41('0x91')]['List']&&_0x3a5a92['account'][_0xcf41('0x92')][_0xcf41('0x8e')][_0xcf41('0x4c')]){return _0x3a5a92[_0xcf41('0x91')][_0xcf41('0x92')][_0xcf41('0x8e')][0x0];}var _0x42a2b1=_['defaults'](_0x165ce0[_0xcf41('0x4f')],{'firstName':_0x165ce0[_0xcf41('0x4f')]['from'],'ListId':_0x23a246[_0xcf41('0x85')]});_0x42a2b1[_0x165ce0[_0xcf41('0x4f')][_0xcf41('0x89')]]=_0x165ce0[_0xcf41('0x4f')][_0xcf41('0x86')];return db['CmContact'][_0xcf41('0x4e')](_0x42a2b1,{'fields':_0x3914d1,'raw':!![]});}})[_0xcf41('0x28')](handleEntityNotFound(_0x45c91b,null))[_0xcf41('0x28')](function(_0x11ae71){_0x3a5a92[_0xcf41('0x96')]=_0x11ae71;var _0x14adca=_0x165ce0['body'][_0xcf41('0x97')];if(_0x165ce0[_0xcf41('0x98')][_0xcf41('0x99')]){_0x14adca=_0x165ce0[_0xcf41('0x98')][_0xcf41('0x99')];}else if(_0x165ce0['headers'][_0xcf41('0x9a')]){_0x14adca=_[_0xcf41('0x9b')](_0x165ce0[_0xcf41('0x98')]['x-forwarded-for'][_0xcf41('0x9c')](','));}if(_0x11ae71){var _0x50c279={'ContactId':_0x11ae71['id'],'ChatWebsiteId':_0x165ce0[_0xcf41('0x55')]['id'],'from':(_0x11ae71[_0xcf41('0x9d')]||'')+'\x20'+(_0x11ae71[_0xcf41('0x9e')]||''),'customerIp':_0x14adca,'customerPort':_0x165ce0[_0xcf41('0x98')][_0xcf41('0x9f')]?_0x165ce0['headers'][_0xcf41('0x9f')]:null,'referer':_0x165ce0[_0xcf41('0x4f')][_0xcf41('0xa0')],'browserName':_0x50aae4[_0xcf41('0xa1')][_0xcf41('0x2e')]&&_0x50aae4[_0xcf41('0xa1')]['version']?util[_0xcf41('0xa2')](_0xcf41('0xa3'),_0x50aae4[_0xcf41('0xa1')][_0xcf41('0x2e')],_0x50aae4['browser'][_0xcf41('0xa4')]):_0xcf41('0xa5'),'browserVersion':_0x50aae4['browser'][_0xcf41('0xa4')]||'unknown','osName':util[_0xcf41('0xa2')](_0xcf41('0xa3'),_0x50aae4['os']['name'],_0x50aae4['os']['version']),'osVersion':_0x50aae4['os'][_0xcf41('0xa4')],'deviceModel':_0x50aae4[_0xcf41('0xa6')][_0xcf41('0x38')]&&_0x50aae4[_0xcf41('0xa6')][_0xcf41('0xa7')]?util[_0xcf41('0xa2')]('%s\x20%s\x20%s',_0x50aae4[_0xcf41('0xa6')][_0xcf41('0x38')],_0x50aae4['device'][_0xcf41('0xa7')],_0x50aae4[_0xcf41('0xa6')][_0xcf41('0x36')]):null,'deviceVendor':_0x50aae4[_0xcf41('0xa6')][_0xcf41('0xa7')],'deviceType':_0x50aae4[_0xcf41('0xa6')]['type'],'formData':JSON[_0xcf41('0x19')](_0x165ce0['body'])};var _0x1d03af={'ChatWebsiteId':_0x165ce0[_0xcf41('0x55')]['id'],'closed':![]};if(_0x165ce0[_0xcf41('0x4f')]['threadId']){_0x1d03af[_0xcf41('0xa8')]=_0x165ce0[_0xcf41('0x4f')][_0xcf41('0xa8')];return db[_0xcf41('0xa9')]['find']({'where':_0x1d03af})[_0xcf41('0x28')](function(_0x28b018){if(_0x28b018){return[_0x28b018,![]];}_0x50c279[_0xcf41('0xa8')]=_0x165ce0[_0xcf41('0x4f')][_0xcf41('0xa8')];_0x50c279[_0xcf41('0xaa')]=_0x165ce0['body'][_0xcf41('0xaa')];return db[_0xcf41('0xa9')][_0xcf41('0x4e')](_0x50c279)[_0xcf41('0x28')](function(_0x27b755){return[_0x27b755,!![]];});});}_0x1d03af['ContactId']=_0x11ae71['id'];if(_0x165ce0['body'][_0xcf41('0xab')]&&_0x165ce0[_0xcf41('0x4f')][_0xcf41('0xab')]['id']){_0x1d03af['id']=_0x165ce0[_0xcf41('0x4f')][_0xcf41('0xab')]['id'];return db['ChatInteraction'][_0xcf41('0x4d')]({'where':_0x1d03af})[_0xcf41('0x28')](function(_0x5d4948){if(_0x5d4948){return[_0x5d4948,![]];}return db[_0xcf41('0xa9')][_0xcf41('0x4e')](_0x50c279)[_0xcf41('0x28')](function(_0x22b6fb){return[_0x22b6fb,!![]];});});}return db[_0xcf41('0xa9')][_0xcf41('0x4e')](_0x50c279)[_0xcf41('0x28')](function(_0x5f3d93){return[_0x5f3d93,!![]];});}})['spread'](function(_0x23771b,_0x546632){if(_0x23771b){_0x472ffd=_0x546632;if(!_0x546632){var _0x28f072={'from':(_0x3a5a92['contact'][_0xcf41('0x9d')]||'')+'\x20'+(_0x3a5a92[_0xcf41('0x96')][_0xcf41('0x9e')]||'')};if(_0x165ce0[_0xcf41('0x4f')][_0xcf41('0xa8')]&&_0x165ce0[_0xcf41('0x4f')][_0xcf41('0xac')]&&_0x165ce0[_0xcf41('0x4f')][_0xcf41('0xa8')]!=_0x165ce0[_0xcf41('0x4f')][_0xcf41('0xac')]){_0x28f072['threadId']=_0x165ce0[_0xcf41('0x4f')]['messageId'];}return _0x23771b[_0xcf41('0x27')](_0x28f072);}else{return _0x23771b;}}})[_0xcf41('0x28')](function(_0x58a088){_0x3a5a92[_0xcf41('0xab')]=_0x58a088[_0xcf41('0x2a')]({'plain':!![]});_0x3a5a92[_0xcf41('0xab')][_0xcf41('0xad')]=_0x472ffd;if(_0x3a5a92[_0xcf41('0xab')]['created']){if(_0x3a5a92[_0xcf41('0x91')][_0xcf41('0xae')]){_0x3a5a92[_0xcf41('0x93')][_0xcf41('0xaf')]({'id':0x0,'priority':_0x3a5a92[_0xcf41('0x93')][_0xcf41('0x4c')]+0x1,'app':_0xcf41('0xb0'),'appdata':_0xcf41('0xb1'),'interval':_0xcf41('0xb2')});}}return db[_0xcf41('0xb3')][_0xcf41('0x4e')]({'body':_0x165ce0[_0xcf41('0x4f')][_0xcf41('0x4f')],'ChatWebsiteId':_0x165ce0['params']['id'],'ChatInteractionId':_0x58a088['id'],'direction':'in','ContactId':_0x3a5a92[_0xcf41('0x96')]['id'],'AttachmentId':_0x165ce0[_0xcf41('0x4f')][_0xcf41('0xb4')]});})[_0xcf41('0x28')](function(_0x4ee8a4){_0x3a5a92[_0xcf41('0x1c')]=_0x4ee8a4;if(_0x3a5a92[_0xcf41('0xab')][_0xcf41('0xb5')]){return db[_0xcf41('0xb6')][_0xcf41('0x4d')]({'attributes':['id',_0xcf41('0x2e')],'where':{'id':_0x3a5a92['interaction'][_0xcf41('0xb5')]}})[_0xcf41('0x28')](function(_0xbe5adf){if(_0xbe5adf){_0x3a5a92[_0xcf41('0x93')][_0xcf41('0xb7')]({'id':0x0,'priority':0x0,'app':_0xcf41('0xb8'),'appdata':_0xbe5adf[_0xcf41('0x2e')]+','+(_0x3a5a92[_0xcf41('0x91')][_0xcf41('0xb9')]||0xa),'interval':_0xcf41('0xb2')});_0x3a5a92[_0xcf41('0xba')]=!![];}return respondWithRpcPromise(_0xcf41('0xbb'),_0xcf41('0xbc'),_0x3a5a92);});}return respondWithRpcPromise(_0xcf41('0xbb'),_0xcf41('0xbc'),_0x3a5a92);})[_0xcf41('0x28')](function(_0x494153){respondWithRpcPromise(_0xcf41('0xbd'),_0xcf41('0xbd'),{'event':_0xcf41('0x7b'),'message':_0x494153},client9002);return _0x494153;})[_0xcf41('0x28')](respondWithResult(_0x45c91b,null))[_0xcf41('0x1d')](handleError(_0x45c91b,null));};exports[_0xcf41('0xbe')]=function(_0x3fe00f,_0x300c5f){var _0x744078,_0x32d725,_0x307c60;var _0x29ccfc=[];var _0x83d960={};var _0x19ae02=_0x3fe00f[_0xcf41('0xbf')]||[];var _0x294154=[];var _0x138afa;return db['CmContact'][_0xcf41('0xc0')]()[_0xcf41('0x28')](function(_0x213632){if(!_0x213632){throw new db[(_0xcf41('0x87'))]['ValidationError'](_0xcf41('0x80'));}_0x29ccfc=_['difference'](_[_0xcf41('0x5b')](_0x213632),[_0xcf41('0x82'),_0xcf41('0x83'),'CompanyId',_0xcf41('0x85')]);if(_0x3fe00f['body']['id']){delete _0x3fe00f['body']['id'];}if(_[_0xcf41('0x78')](_0x3fe00f[_0xcf41('0x4f')]['from'])){throw _0x300c5f[_0xcf41('0x20')](0x1f4)['send'](new db[(_0xcf41('0x87'))][(_0xcf41('0x7f'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x3fe00f[_0xcf41('0x4f')]['body'])||_0x3fe00f[_0xcf41('0x4f')][_0xcf41('0x4f')]===''){throw _0x300c5f[_0xcf41('0x20')](0x1f4)[_0xcf41('0x2f')](new db[(_0xcf41('0x87'))][(_0xcf41('0x7f'))](_0xcf41('0x88')));}if(_['isNil'](_0x3fe00f[_0xcf41('0x4f')][_0xcf41('0xc1')])){throw _0x300c5f['status'](0x1f4)[_0xcf41('0x2f')](new db[(_0xcf41('0x87'))][(_0xcf41('0x7f'))](_0xcf41('0xc2')+_0x29ccfc));}if(!_['includes'](_0x29ccfc,_0x3fe00f['body']['mapKeyOffline'])){throw _0x300c5f[_0xcf41('0x20')](0x1f4)[_0xcf41('0x2f')](new db[(_0xcf41('0x87'))]['ValidationError'](_0xcf41('0xc3')+_0x29ccfc));}_0x83d960[_0x3fe00f[_0xcf41('0x4f')][_0xcf41('0xc1')]]=_0x3fe00f[_0xcf41('0x4f')]['from'];})[_0xcf41('0x28')](function(){return db[_0xcf41('0x33')][_0xcf41('0x4d')]({'where':{'id':_0x3fe00f[_0xcf41('0x55')]['id']},'include':[{'model':db[_0xcf41('0x8c')],'as':'List'},{'model':db['MailAccount'],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x300c5f,null))[_0xcf41('0x28')](function(_0x4f93d8){if(_0x4f93d8&&_0x4f93d8[_0xcf41('0x92')]){_0x32d725=_0x4f93d8;var _0x51ead8=_[_0xcf41('0xd')](_0x3fe00f[_0xcf41('0x4f')],{'firstName':_0x3fe00f['body'][_0xcf41('0x86')],'phone':_0x3fe00f['body'][_0xcf41('0x86')],'ListId':_0x4f93d8['ListId']});_0x51ead8[_0x3fe00f[_0xcf41('0x4f')][_0xcf41('0xc1')]]=_0x3fe00f[_0xcf41('0x4f')][_0xcf41('0x86')];return db[_0xcf41('0x8d')][_0xcf41('0xc4')]({'where':_0x83d960,'defaults':_0x51ead8});}})[_0xcf41('0xc5')](function(_0x1e1e4e){if(_0x1e1e4e){_0x307c60=_0x1e1e4e;var _0x386b07=fs['readFileSync'](path[_0xcf41('0x71')](config[_0xcf41('0x6b')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x5efcc1=ejs[_0xcf41('0xc6')](_0x386b07,{'body':_[_0xcf41('0xc7')](_0x3fe00f[_0xcf41('0x4f')]['body']),'bodyTitle':_0x32d725['offlineMessageBody']});return db['ChatOfflineMessage']['create']({'body':_0x5efcc1,'plainBody':htmlToText[_0xcf41('0xc8')](_0x5efcc1),'ContactId':_0x1e1e4e['id'],'ChatWebsiteId':_0x32d725['id']});}})[_0xcf41('0x28')](function(_0x22e6c5){_0x138afa=_0x22e6c5;if(_0x19ae02[_0xcf41('0x4c')]){var _0x47857c=_0x19ae02[_0xcf41('0x39')](function(_0x3b0f46){return{'name':_0x3b0f46[_0xcf41('0xc9')],'basename':_0x3b0f46['filename'],'type':_0x3b0f46[_0xcf41('0xca')],'ChatOfflineMessageId':_0x22e6c5['id']};});_0x294154=_0x47857c[_0xcf41('0x39')](_0x3c8441=>{var _0x5ca2b1={'filename':_0x3c8441[_0xcf41('0x2e')],'path':path[_0xcf41('0x71')](config['root'],_0xcf41('0xcb'),'files','attachments',_0xcf41('0xcc'),_0x3c8441[_0xcf41('0xcd')])};return _0x5ca2b1;});if(!_0x32d725['openNewInteraction']){return db[_0xcf41('0xce')][_0xcf41('0xcf')](function(_0x332cdb){return db[_0xcf41('0xd0')][_0xcf41('0xd1')](_0x47857c,{'transaction':_0x332cdb});});}}})[_0xcf41('0x28')](function(){if(_0x138afa){_0x744078=_0x138afa;return db[_0xcf41('0xd2')][_0xcf41('0x5a')]({'where':{'service':!![]},'include':[{'model':db[_0xcf41('0xd3')],'as':_0xcf41('0xd4'),'raw':!![],'include':[{'model':db[_0xcf41('0xd5')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x134113){if(_0x134113&&_0x134113[_0xcf41('0xd4')]&&_0x32d725['forwardOffline']&&_0x32d725[_0xcf41('0xd6')]){var _0x55b2e1=_0x134113[_0xcf41('0xd7')]();return respondWithRpcPromise(_0xcf41('0xd8'),'sendMail',{'account':_0x55b2e1,'message':{'from':util[_0xcf41('0xa2')](_0xcf41('0xd9'),_0x134113[_0xcf41('0x2e')],_0x134113[_0xcf41('0xda')]||_0x134113['Smtp'][_0xcf41('0x50')]),'to':_0x32d725[_0xcf41('0xd6')],'subject':_0x32d725[_0xcf41('0xdb')],'html':_0x744078[_0xcf41('0x4f')],'attachments':_0x294154}},client9003)[_0xcf41('0x28')](function(){return _0x744078;})[_0xcf41('0x1d')](function(_0x4963be){logger[_0xcf41('0x1a')](_0x4963be);});}})[_0xcf41('0x28')](function(){if(_0x32d725&&_0x32d725[_0xcf41('0xdc')]&&_0x32d725[_0xcf41('0xdd')]){var _0x383233=[];if(_0x19ae02['length']){_0x383233=_0x19ae02[_0xcf41('0x39')](function(_0x31143c){return{'name':_0x31143c[_0xcf41('0xc9')],'basename':_0x31143c['filename'],'type':_0x31143c[_0xcf41('0xca')],'ChatOfflineMessageId':_0x138afa['id']};});}var _0x4b49d1;if(!_[_0xcf41('0x78')](_0x32d725[_0xcf41('0xde')])){var _0x49e4be=_['map'](_0x3fe00f['body'],function(_0x5a39da){return _0x5a39da;});var _0x2bd208=_['toPairsIn'](_0x49e4be)[0x0];var _0x4003f6=_[_0xcf41('0xdf')](_0x2bd208,function(_0x527b4c){return _0x527b4c;});_0x4b49d1=_0x4003f6[0x1][_0x32d725[_0xcf41('0xde')]];}var _0x58ec78={'from':_0x307c60[_0xcf41('0xda')],'firstName':_0x307c60[_0xcf41('0x9d')],'lastName':_0x307c60['lastName'],'mapKey':_0xcf41('0xda'),'message':{'from':_0x307c60[_0xcf41('0xda')],'to':_0x32d725['MailAccount'][_0xcf41('0xda')],'cc':'','subject':_[_0xcf41('0x78')](_0x4b49d1)?_0x32d725[_0xcf41('0xdb')]:_0x4b49d1,'messageId':'','sentAt':new Date(),'attach':_0x383233[_0xcf41('0x4c')],'attachments':_0x383233,'originChannel':_0xcf41('0xe0'),'ChatWebsiteId':_0x32d725['id'],'ChatOfflineMessageId':_0x744078['id'],'originTo':_0x32d725[_0xcf41('0xd2')][_0xcf41('0xda')]},'body':_0x744078[_0xcf41('0x4f')]};var _0x5e3183={'account':{'id':_0x32d725['MailAccountId']},'body':_0x58ec78,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xcf41('0xe1'),'notifyMail',_0x5e3183,client9001)[_0xcf41('0x28')](function(){return _0x744078;})[_0xcf41('0x1d')](function(_0x4fdcc7){logger[_0xcf41('0x1a')](_0x4fdcc7);});}return;})[_0xcf41('0x28')](function(){if(_0x744078){return _0x744078;}})['then'](respondWithResult(_0x300c5f,null))[_0xcf41('0x1d')](function(_0x35d440){logger[_0xcf41('0x1a')](_0xcf41('0x1d'),_0x35d440);for(var _0x15102d of _0x19ae02){var _0xaa09a8=path[_0xcf41('0x71')](config[_0xcf41('0x6b')],_0xcf41('0xcb'),'files',_0xcf41('0xe2'),_0xcf41('0xcc'),_0x15102d[_0xcf41('0x62')]);fs_extra[_0xcf41('0xe3')](_0xaa09a8)[_0xcf41('0x1d')](function(_0x407cf8){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0xaa09a8,_0x407cf8);});}});};exports[_0xcf41('0xe4')]=function(_0x1ae828,_0x182eff){return db[_0xcf41('0xa9')][_0xcf41('0x4d')]({'where':{'id':_0x1ae828[_0xcf41('0x55')]['id']}})[_0xcf41('0x28')](handleEntityNotFound(_0x182eff,null))['then'](function(_0x76f103){if(_0x76f103){return _0x76f103[_0xcf41('0xe4')](_0x1ae828[_0xcf41('0x4f')]['ids'],_['omit'](_0x1ae828[_0xcf41('0x4f')],[_0xcf41('0x5e'),'id'])||{});}})[_0xcf41('0x28')](respondWithResult(_0x182eff,null))[_0xcf41('0x1d')](handleError(_0x182eff,null));};exports[_0xcf41('0xe5')]=function(_0x4511da,_0x3e8b36){var _0x18eeb1={'raw':![],'where':{}};var _0x22077c={};var _0x145a9b={'count':0x0,'rows':[]};return db[_0xcf41('0x33')][_0xcf41('0x5a')]({'where':{'id':_0x4511da[_0xcf41('0x55')]['id']}})[_0xcf41('0x28')](handleEntityNotFound(_0x3e8b36,null))[_0xcf41('0x28')](function(_0xd7ae61){if(_0xd7ae61){_0x22077c[_0xcf41('0x38')]=_[_0xcf41('0x5b')](db[_0xcf41('0xa9')][_0xcf41('0x34')]);_0x22077c[_0xcf41('0x3a')]=_[_0xcf41('0x5b')](_0x4511da[_0xcf41('0x3a')]);_0x22077c[_0xcf41('0x3b')]=_[_0xcf41('0x3c')](_0x22077c[_0xcf41('0x38')],_0x22077c[_0xcf41('0x3a')]);_0x18eeb1['attributes']=_[_0xcf41('0x3c')](_0x22077c['model'],qs[_0xcf41('0x3e')](_0x4511da[_0xcf41('0x3a')][_0xcf41('0x3e')]));_0x18eeb1[_0xcf41('0x3d')]=_0x18eeb1['attributes'][_0xcf41('0x4c')]?_0x18eeb1[_0xcf41('0x3d')]:_0x22077c['model'];if(!_0x4511da[_0xcf41('0x3a')][_0xcf41('0x3f')]('nolimit')){_0x18eeb1[_0xcf41('0x24')]=qs[_0xcf41('0x24')](_0x4511da[_0xcf41('0x3a')][_0xcf41('0x24')]);_0x18eeb1[_0xcf41('0x22')]=qs[_0xcf41('0x22')](_0x4511da[_0xcf41('0x3a')][_0xcf41('0x22')]);}_0x18eeb1[_0xcf41('0x41')]=qs[_0xcf41('0x42')](_0x4511da[_0xcf41('0x3a')][_0xcf41('0x42')]);_0x18eeb1[_0xcf41('0x43')]=qs[_0xcf41('0x3b')](_['pick'](_0x4511da[_0xcf41('0x3a')],_0x22077c[_0xcf41('0x3b')]));_0x18eeb1[_0xcf41('0x43')]['ChatWebsiteId']=_0xd7ae61['id'];if(_0x4511da['query'][_0xcf41('0x46')]){_0x18eeb1['where']=_[_0xcf41('0x44')](_0x18eeb1[_0xcf41('0x43')],{'$or':_['map'](_0x18eeb1[_0xcf41('0x3d')],function(_0x246cb8){var _0x45f50f={};_0x45f50f[_0x246cb8]={'$like':'%'+_0x4511da[_0xcf41('0x3a')][_0xcf41('0x46')]+'%'};return _0x45f50f;})});}_0x18eeb1=_[_0xcf41('0x44')]({},_0x18eeb1,_0x4511da['options']);return db[_0xcf41('0xa9')][_0xcf41('0x25')]({'where':_0x18eeb1[_0xcf41('0x43')]})[_0xcf41('0x28')](function(_0x1b863e){_0x145a9b[_0xcf41('0x25')]=_0x1b863e;if(_0x4511da[_0xcf41('0x3a')][_0xcf41('0x48')]){_0x18eeb1['include']=[{'model':db['CmContact'],'as':_0xcf41('0xe6'),'required':![]},{'model':db[_0xcf41('0xb6')],'as':_0xcf41('0xe7'),'attributes':[_0xcf41('0x2e'),_0xcf41('0xe8'),_0xcf41('0xe9')],'required':![]},{'model':db[_0xcf41('0xea')],'as':_0xcf41('0xeb'),'attributes':['id',_0xcf41('0x2e'),_0xcf41('0xec')],'where':_0x4511da['query'][_0xcf41('0xed')]?{'id':_0x4511da['query']['tag']}:undefined,'required':_0x4511da['query'][_0xcf41('0xed')]?!![]:![]}];}return db[_0xcf41('0xa9')][_0xcf41('0x4a')](_0x18eeb1);})[_0xcf41('0x28')](function(_0x45d338){_0x145a9b[_0xcf41('0x4b')]=_0x45d338;return _0x145a9b;});}})[_0xcf41('0x28')](respondWithFilteredResult(_0x3e8b36,_0x18eeb1))[_0xcf41('0x1d')](handleError(_0x3e8b36,null));};function iftimePromise(_0x380f54,_0x169739){return respondWithRpcPromise(_0xcf41('0xee'),'getSnippet',{'command':_0x169739['timezone']?util[_0xcf41('0xa2')](_0xcf41('0xef'),_0x380f54[_0xcf41('0xf0')],_0x169739[_0xcf41('0xf1')]):util[_0xcf41('0xa2')](_0xcf41('0xf2'),_0x380f54[_0xcf41('0xf0')])},client9002)[_0xcf41('0x28')](function(_0x225060){var _0x3483c5=_0x225060&&_0x225060['indexOf']('true')>=0x0?!![]:![];logger['info'](_0xcf41('0xf3'),_0x169739['id'],_0x380f54['id'],_0x380f54[_0xcf41('0xf0')],_0x3483c5?'ONLINE':_0xcf41('0xf4'),_0x169739[_0xcf41('0xf1')]?_0x169739[_0xcf41('0xf1')]:_0xcf41('0xf5'));return _0x3483c5;})[_0xcf41('0x1d')](function(_0x5cb921){logger[_0xcf41('0x1a')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x169739['id'],_0x380f54['id'],_0x380f54[_0xcf41('0xf0')],util[_0xcf41('0xf6')](_0x5cb921,{'showHidden':![],'depth':null}),_0x169739['timezone']?_0x169739[_0xcf41('0xf1')]:_0xcf41('0xf5'));return![];});}exports[_0xcf41('0xf7')]=function(_0x193e91,_0x3ea285){var _0x5a701c=0x0;var _0x2dd2c6=0x0;var _0x291819=![];var _0x585c35;var _0x32af4d;return db['ChatWebsite'][_0xcf41('0x4d')]({'where':{'id':_0x193e91['params']['id']},'include':[{'model':db['Interval'],'as':_0xcf41('0xf8'),'include':[{'model':db['Interval'],'as':_0xcf41('0xf9'),'attributes':['id',_0xcf41('0xf0')],'raw':!![]}]}]})[_0xcf41('0x28')](handleEntityNotFound(_0x3ea285,null))[_0xcf41('0x28')](function(_0x5ae99a){if(_0x5ae99a){_0x585c35=_0x5ae99a;return _0x5ae99a[_0xcf41('0xfa')]({'raw':!![]});}})[_0xcf41('0x28')](function(_0x37b4b5){if(_0x585c35){if(_0x37b4b5){_0x32af4d=_0x37b4b5;}}return require(_0xcf41('0x6d'))[_0xcf41('0x6e')]();})[_0xcf41('0x28')](function(_0xc349d2){if(_0xc349d2){_0x2dd2c6=_0xc349d2[_0xcf41('0xfb')];_0x291819=_0xc349d2[_0xcf41('0xfc')];}})[_0xcf41('0x28')](function(){return db[_0xcf41('0xa9')][_0xcf41('0x25')]({'where':{'closed':![]}});})['then'](function(_0x3b19e0){_0x5a701c=_0x3b19e0;if(_0x2dd2c6&&_0x3b19e0>_0x2dd2c6){return db[_0xcf41('0xfd')][_0xcf41('0x5a')]({'where':{'id':0x1}})[_0xcf41('0x28')](function(_0x4cd059){if(_0x4cd059){_0x4cd059['increment'](_0xcf41('0xfe'));}});}})[_0xcf41('0x28')](function(){if(_0x585c35[_0xcf41('0xf8')]&&_0x585c35['Interval']['Intervals']){var _0xc1cfdc=[];for(var _0x470524=0x0;_0x470524<_0x585c35[_0xcf41('0xf8')][_0xcf41('0xf9')]['length'];_0x470524++){var _0x11da27=_0x585c35['Interval'][_0xcf41('0xf9')][_0x470524][_0xcf41('0x2a')]({'plain':!![]});_0xc1cfdc[_0xcf41('0xaf')](iftimePromise(_0x11da27,_0x585c35));}return BPromise['all'](_0xc1cfdc)['then'](function(_0x5324cb){return _[_0xcf41('0xff')](_0x5324cb);});}else{return!![];}})['then'](function(_0x5d1235){var _0x42f7ad=fs['readFileSync'](path['join'](config[_0xcf41('0x6b')],_0xcf41('0x100')),_0xcf41('0x101'));var _0x54998d={'remote':_0x585c35[_0xcf41('0x102')],'query':querystring[_0xcf41('0x19')](_[_0xcf41('0x44')](_0x585c35[_0xcf41('0x2a')]({'plain':!![]}),{'customerIp':_0x193e91['headers']['x-forwarded-for']||_0x193e91[_0xcf41('0x98')]['x-real-ip']||_0x193e91[_0xcf41('0x103')][_0xcf41('0x104')]||_0x193e91['ip'],'referer':_0x193e91[_0xcf41('0x98')][_0xcf41('0xa0')],'openedInteractions':_0x5a701c,'maxInteractions':_0x2dd2c6,'virtual':_0x291819[_0xcf41('0xfb')],'online':_0x5d1235,'custom':_0x291819}))[_0xcf41('0x105')](/'/g,'\x5c\x27')};_0x3ea285[_0xcf41('0x2f')](ejs[_0xcf41('0xc6')](Mustache[_0xcf41('0xc6')](_0x42f7ad,_0x54998d),{'proactiveActions':_0x32af4d,'alignment':_0x585c35[_0xcf41('0x106')],'verticalAlignment':_0x585c35[_0xcf41('0x107')],'div_color':_0x585c35[_0xcf41('0xec')],'labelText':_0x585c35[_0xcf41('0x108')],'text_color':_0x585c35[_0xcf41('0x109')],'text_button_color':_0x585c35[_0xcf41('0x10a')],'button_color':_0x585c35[_0xcf41('0x10b')],'background_color':_0x585c35[_0xcf41('0x10c')],'hideWhenOffline':_0x585c35[_0xcf41('0x10d')],'interval':_0x585c35[_0xcf41('0x10e')]}));})[_0xcf41('0x1d')](handleError(_0x3ea285,null));};exports[_0xcf41('0x10f')]=function(_0x484b90,_0x532f9d){var _0x372216=_0x484b90[_0xcf41('0x55')]['id'];var _0x4d37fc=_0x484b90[_0xcf41('0x4f')];var _0x59ca47=0xc8;var _0x4c91ec=null;return db[_0xcf41('0xce')][_0xcf41('0xcf')]({'isolationLevel':db[_0xcf41('0xce')][_0xcf41('0x110')][_0xcf41('0x111')]['READ_COMMITTED']},function(_0x186c51){return db[_0xcf41('0x33')][_0xcf41('0x5a')]({'where':{'id':_0x372216},'transaction':_0x186c51})['then'](function(_0x3e5485){if(_0x3e5485){return db['ChatApplication'][_0xcf41('0x29')]({'where':{'ChatWebsiteId':_0x372216},'transaction':_0x186c51})['then'](function(){var _0x3b0622=_[_0xcf41('0x39')](_0x4d37fc,function(_0x1816fc){_0x1816fc[_0xcf41('0x57')]=_0x372216;return _0x1816fc;});return db[_0xcf41('0x112')][_0xcf41('0xd1')](_0x3b0622,{'transaction':_0x186c51});});}else{_0x59ca47=0x194;_0x4c91ec=[];}});})['then'](function(){if(_0x59ca47!==0x194){return db[_0xcf41('0x112')][_0xcf41('0x113')]({'where':{'ChatWebsiteId':_0x372216},'order':_0xcf41('0x94')})[_0xcf41('0x28')](function(_0x22fecb){_0x4c91ec=_0x22fecb;});}})[_0xcf41('0x1d')](function(_0x5e3319){_0x59ca47=0x1f4;logger[_0xcf41('0x1a')](_0x5e3319[_0xcf41('0x2d')]);if(_0x5e3319[_0xcf41('0x2e')]){delete _0x5e3319[_0xcf41('0x2e')];}_0x4c91ec=_0x5e3319;})[_0xcf41('0x114')](function(){if(_0x4c91ec===null){_0x532f9d[_0xcf41('0x1e')](_0x59ca47);}else{if(_0x59ca47===0x1f4){_0x532f9d[_0xcf41('0x20')](_0x59ca47)['send'](_0x4c91ec);}else{_0x532f9d[_0xcf41('0x20')](_0x59ca47)[_0xcf41('0x21')](_0x4c91ec);}}});};exports[_0xcf41('0x115')]=function(_0x4060b7,_0x2cfa90){var _0x38ea32={};var _0x7f1572={};var _0x40247b;var _0x48b527;return db['ChatWebsite']['findOne']({'where':{'id':_0x4060b7[_0xcf41('0x55')]['id']}})[_0xcf41('0x28')](handleEntityNotFound(_0x2cfa90,null))[_0xcf41('0x28')](function(_0x4dd53e){if(_0x4dd53e){_0x40247b=_0x4dd53e;_0x7f1572['model']=_[_0xcf41('0x5b')](db['ChatApplication'][_0xcf41('0x34')]);_0x7f1572[_0xcf41('0x3a')]=_[_0xcf41('0x5b')](_0x4060b7['query']);_0x7f1572[_0xcf41('0x3b')]=_['intersection'](_0x7f1572[_0xcf41('0x38')],_0x7f1572[_0xcf41('0x3a')]);_0x38ea32[_0xcf41('0x3d')]=_[_0xcf41('0x3c')](_0x7f1572['model'],qs[_0xcf41('0x3e')](_0x4060b7['query']['fields']));_0x38ea32['attributes']=_0x38ea32[_0xcf41('0x3d')][_0xcf41('0x4c')]?_0x38ea32[_0xcf41('0x3d')]:_0x7f1572[_0xcf41('0x38')];_0x38ea32[_0xcf41('0x41')]=qs[_0xcf41('0x42')](_0x4060b7[_0xcf41('0x3a')][_0xcf41('0x42')]);_0x38ea32[_0xcf41('0x43')]=qs[_0xcf41('0x3b')](_['pick'](_0x4060b7[_0xcf41('0x3a')],_0x7f1572[_0xcf41('0x3b')]));if(_0x4060b7[_0xcf41('0x3a')][_0xcf41('0x46')]){_0x38ea32[_0xcf41('0x43')]=_['merge'](_0x38ea32['where'],{'$or':_[_0xcf41('0x39')](_0x38ea32[_0xcf41('0x3d')],function(_0x46d382){var _0x49aaf8={};_0x49aaf8[_0x46d382]={'$like':'%'+_0x4060b7['query']['filter']+'%'};return _0x49aaf8;})});}_0x38ea32=_[_0xcf41('0x44')]({},_0x38ea32,_0x4060b7[_0xcf41('0x47')]);return _0x40247b['getApplications'](_0x38ea32);}})[_0xcf41('0x28')](function(_0x2d66dd){if(_0x2d66dd){_0x48b527=_0x2d66dd[_0xcf41('0x4c')];if(!_0x4060b7[_0xcf41('0x3a')]['hasOwnProperty'](_0xcf41('0x40'))){_0x38ea32[_0xcf41('0x24')]=qs[_0xcf41('0x24')](_0x4060b7['query'][_0xcf41('0x24')]);_0x38ea32[_0xcf41('0x22')]=qs['offset'](_0x4060b7[_0xcf41('0x3a')][_0xcf41('0x22')]);}return _0x40247b[_0xcf41('0x115')](_0x38ea32);}})[_0xcf41('0x28')](function(_0x1a596e){if(_0x1a596e){return _0x1a596e?{'count':_0x48b527,'rows':_0x1a596e}:null;}})[_0xcf41('0x28')](respondWithResult(_0x2cfa90,null))['catch'](handleError(_0x2cfa90,null));};exports[_0xcf41('0x116')]=function(_0x46ce53,_0x391a69){return db[_0xcf41('0x117')]['find']({'where':{'id':_0x46ce53['params']['id']}})[_0xcf41('0x28')](handleEntityNotFound(_0x391a69,null))[_0xcf41('0x28')](function(_0x355a3a){if(_0x355a3a){return _0x355a3a[_0xcf41('0x116')](_0x46ce53[_0xcf41('0x4f')][_0xcf41('0x5e')],_['omit'](_0x46ce53[_0xcf41('0x4f')],[_0xcf41('0x5e'),'id'])||{});}})[_0xcf41('0x28')](respondWithResult(_0x391a69,null))[_0xcf41('0x1d')](handleError(_0x391a69,null));};exports[_0xcf41('0xfa')]=function(_0x1ba7de,_0x5bb656){var _0x3ee280={};var _0x2c7405={};var _0x4cebd2;var _0x6e6536;return db[_0xcf41('0x33')][_0xcf41('0x5a')]({'where':{'id':_0x1ba7de[_0xcf41('0x55')]['id']}})[_0xcf41('0x28')](handleEntityNotFound(_0x5bb656,null))['then'](function(_0x43a9ad){if(_0x43a9ad){_0x4cebd2=_0x43a9ad;_0x2c7405[_0xcf41('0x38')]=_[_0xcf41('0x5b')](db[_0xcf41('0x118')][_0xcf41('0x34')]);_0x2c7405[_0xcf41('0x3a')]=_[_0xcf41('0x5b')](_0x1ba7de['query']);_0x2c7405[_0xcf41('0x3b')]=_[_0xcf41('0x3c')](_0x2c7405[_0xcf41('0x38')],_0x2c7405[_0xcf41('0x3a')]);_0x3ee280[_0xcf41('0x3d')]=_[_0xcf41('0x3c')](_0x2c7405[_0xcf41('0x38')],qs[_0xcf41('0x3e')](_0x1ba7de[_0xcf41('0x3a')][_0xcf41('0x3e')]));_0x3ee280[_0xcf41('0x3d')]=_0x3ee280[_0xcf41('0x3d')][_0xcf41('0x4c')]?_0x3ee280['attributes']:_0x2c7405[_0xcf41('0x38')];_0x3ee280['order']=qs[_0xcf41('0x42')](_0x1ba7de[_0xcf41('0x3a')][_0xcf41('0x42')]);_0x3ee280[_0xcf41('0x43')]=qs['filters'](_[_0xcf41('0x5c')](_0x1ba7de[_0xcf41('0x3a')],_0x2c7405[_0xcf41('0x3b')]));if(_0x1ba7de['query'][_0xcf41('0x46')]){_0x3ee280[_0xcf41('0x43')]=_['merge'](_0x3ee280[_0xcf41('0x43')],{'$or':_[_0xcf41('0x39')](_0x3ee280[_0xcf41('0x3d')],function(_0x39d9fd){var _0x47a42b={};_0x47a42b[_0x39d9fd]={'$like':'%'+_0x1ba7de[_0xcf41('0x3a')][_0xcf41('0x46')]+'%'};return _0x47a42b;})});}_0x3ee280=_['merge']({},_0x3ee280,_0x1ba7de[_0xcf41('0x47')]);return _0x4cebd2[_0xcf41('0xfa')](_0x3ee280);}})['then'](function(_0x4ee4e4){if(_0x4ee4e4){_0x6e6536=_0x4ee4e4[_0xcf41('0x4c')];if(!_0x1ba7de[_0xcf41('0x3a')][_0xcf41('0x3f')]('nolimit')){_0x3ee280[_0xcf41('0x24')]=qs[_0xcf41('0x24')](_0x1ba7de[_0xcf41('0x3a')]['limit']);_0x3ee280[_0xcf41('0x22')]=qs[_0xcf41('0x22')](_0x1ba7de[_0xcf41('0x3a')][_0xcf41('0x22')]);}return _0x4cebd2['getProactiveActions'](_0x3ee280);}})[_0xcf41('0x28')](function(_0x16332e){if(_0x16332e){return _0x16332e?{'count':_0x6e6536,'rows':_0x16332e}:null;}})[_0xcf41('0x28')](respondWithResult(_0x5bb656,null))[_0xcf41('0x1d')](handleError(_0x5bb656,null));};exports[_0xcf41('0x119')]=function(_0x53cdd6,_0x1f2f98){var _0x1b7930=_0x53cdd6[_0xcf41('0x3a')][_0xcf41('0x11a')]===_0xcf41('0x11b')?_0xcf41('0x11c'):_0xcf41('0x11d');return db['ChatWebsite']['find']({'attributes':['id',_0x1b7930],'where':{'id':_0x53cdd6['params']['id']}})[_0xcf41('0x28')](handleEntityNotFound(_0x1f2f98,null))[_0xcf41('0x28')](function(_0x4485a1){if(_0x4485a1){var _0x18922a=_0x4485a1[_0x1b7930];var _0x2f9917=_0x18922a&&_0x18922a['items']?_0x18922a[_0xcf41('0x11e')]:[];_0x1f2f98['send']({'fromKey':_[_0xcf41('0x78')](_0x18922a[_0xcf41('0x11f')])?undefined:_0x18922a['fromKey'],'count':_0x2f9917['length'],'rows':_0x2f9917});}})[_0xcf41('0x1d')](handleError(_0x1f2f98,null));};exports[_0xcf41('0x120')]=function(_0x2de0de,_0x38fcde){var _0x120b1c={'raw':![],'where':{}};var _0x1e27c7={};var _0x3472b3={'count':0x0,'rows':[]};return db[_0xcf41('0x33')][_0xcf41('0x5a')]({'where':{'id':_0x2de0de[_0xcf41('0x55')]['id']}})['then'](handleEntityNotFound(_0x38fcde,null))['then'](function(_0x513588){if(_0x513588){_0x1e27c7[_0xcf41('0x38')]=_[_0xcf41('0x5b')](db['ChatOfflineMessage'][_0xcf41('0x34')]);_0x1e27c7[_0xcf41('0x3a')]=_['keys'](_0x2de0de[_0xcf41('0x3a')]);_0x1e27c7[_0xcf41('0x3b')]=_[_0xcf41('0x3c')](_0x1e27c7[_0xcf41('0x38')],_0x1e27c7[_0xcf41('0x3a')]);_0x120b1c[_0xcf41('0x3d')]=_['intersection'](_0x1e27c7[_0xcf41('0x38')],qs['fields'](_0x2de0de[_0xcf41('0x3a')][_0xcf41('0x3e')]));_0x120b1c[_0xcf41('0x3d')]=_0x120b1c[_0xcf41('0x3d')][_0xcf41('0x4c')]?_0x120b1c[_0xcf41('0x3d')]:_0x1e27c7[_0xcf41('0x38')];if(!_0x2de0de[_0xcf41('0x3a')][_0xcf41('0x3f')]('nolimit')){_0x120b1c[_0xcf41('0x24')]=qs[_0xcf41('0x24')](_0x2de0de[_0xcf41('0x3a')][_0xcf41('0x24')]);_0x120b1c[_0xcf41('0x22')]=qs[_0xcf41('0x22')](_0x2de0de[_0xcf41('0x3a')]['offset']);}_0x120b1c[_0xcf41('0x41')]=qs['sort'](_0x2de0de[_0xcf41('0x3a')][_0xcf41('0x42')]);_0x120b1c[_0xcf41('0x43')]=qs['filters'](_[_0xcf41('0x5c')](_0x2de0de[_0xcf41('0x3a')],_0x1e27c7[_0xcf41('0x3b')]));_0x120b1c[_0xcf41('0x43')][_0xcf41('0x57')]=_0x513588['id'];if(_0x2de0de[_0xcf41('0x3a')][_0xcf41('0x46')]){_0x120b1c[_0xcf41('0x43')]=_[_0xcf41('0x44')](_0x120b1c[_0xcf41('0x43')],{'$or':_[_0xcf41('0x39')](_0x120b1c[_0xcf41('0x3d')],function(_0x12d097){var _0x5d63d3={};_0x5d63d3[_0x12d097]={'$like':'%'+_0x2de0de['query']['filter']+'%'};return _0x5d63d3;})});}_0x120b1c=_[_0xcf41('0x44')]({},_0x120b1c,_0x2de0de[_0xcf41('0x47')]);return db[_0xcf41('0x121')][_0xcf41('0x25')]({'where':_0x120b1c[_0xcf41('0x43')]})[_0xcf41('0x28')](function(_0x52ecd0){_0x3472b3['count']=_0x52ecd0;if(_0x2de0de[_0xcf41('0x3a')][_0xcf41('0x48')]){_0x120b1c[_0xcf41('0x49')]=[{'all':!![]}];}else{_0x120b1c[_0xcf41('0x49')]=[{'model':db['CmContact'],'as':_0xcf41('0xe6'),'required':![]},{'model':db[_0xcf41('0xd0')],'as':'Attachments','required':![]}];}return db[_0xcf41('0x121')][_0xcf41('0x4a')](_0x120b1c);})[_0xcf41('0x28')](function(_0x429197){_0x3472b3[_0xcf41('0x4b')]=_0x429197;return _0x3472b3;});}})[_0xcf41('0x28')](respondWithFilteredResult(_0x38fcde,_0x120b1c))[_0xcf41('0x1d')](handleError(_0x38fcde,null));};exports[_0xcf41('0x122')]=function(_0x1a42d4,_0x43f2ae){return db['ChatWebsite'][_0xcf41('0x4d')]({'where':{'id':_0x1a42d4[_0xcf41('0x55')]['id']}})[_0xcf41('0x28')](handleEntityNotFound(_0x43f2ae,null))[_0xcf41('0x28')](function(_0x1cf01c){if(_0x1cf01c){return _0x1cf01c['addAgents'](_0x1a42d4[_0xcf41('0x4f')][_0xcf41('0x5e')],_['omit'](_0x1a42d4['body'],[_0xcf41('0x5e'),'id'])||{})[_0xcf41('0xc5')](function(_0x1c52b0){for(var _0x36a3d7=0x0;_0x36a3d7<_0x1a42d4['body']['ids'][_0xcf41('0x4c')];_0x36a3d7+=0x1){socket[_0xcf41('0x123')](_0xcf41('0x124'),{'UserId':Number(_0x1a42d4[_0xcf41('0x4f')][_0xcf41('0x5e')][_0x36a3d7]),'ChatWebsiteId':Number(_0x1a42d4['params']['id'])});}return _0x1c52b0;});}})[_0xcf41('0x28')](respondWithResult(_0x43f2ae,null))['catch'](handleError(_0x43f2ae,null));};exports[_0xcf41('0x125')]=function(_0x53a48d,_0x45b3f2){return db['ChatWebsite']['find']({'where':{'id':_0x53a48d['params']['id']}})[_0xcf41('0x28')](handleEntityNotFound(_0x45b3f2,null))['then'](function(_0x4592ae){if(_0x4592ae){return _0x4592ae['removeAgents'](_0x53a48d['query'][_0xcf41('0x5e')])[_0xcf41('0x28')](function(){if(_[_0xcf41('0x126')](_0x53a48d['query']['ids'])){for(var _0x10ea2e=0x0;_0x10ea2e<_0x53a48d[_0xcf41('0x3a')][_0xcf41('0x5e')]['length'];_0x10ea2e+=0x1){socket[_0xcf41('0x123')](_0xcf41('0x127'),{'UserId':Number(_0x53a48d[_0xcf41('0x3a')][_0xcf41('0x5e')][_0x10ea2e]),'ChatWebsiteId':Number(_0x53a48d[_0xcf41('0x55')]['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x53a48d['query'][_0xcf41('0x5e')]),'ChatWebsiteId':Number(_0x53a48d['params']['id'])});}});}})[_0xcf41('0x28')](respondWithStatusCode(_0x45b3f2,null))[_0xcf41('0x1d')](handleError(_0x45b3f2,null));};exports[_0xcf41('0x128')]=function(_0x3e0875,_0x3a9a8d){var _0x39041b={};var _0x5a5aac={};var _0x4690ee;var _0x26f382;return db[_0xcf41('0x33')][_0xcf41('0x5a')]({'where':{'id':_0x3e0875[_0xcf41('0x55')]['id']}})[_0xcf41('0x28')](handleEntityNotFound(_0x3a9a8d,null))[_0xcf41('0x28')](function(_0x47c43d){if(_0x47c43d){_0x4690ee=_0x47c43d;_0x5a5aac[_0xcf41('0x38')]=_[_0xcf41('0x5b')](db['User'][_0xcf41('0x34')]);_0x5a5aac[_0xcf41('0x3a')]=_['keys'](_0x3e0875[_0xcf41('0x3a')]);_0x5a5aac['filters']=_[_0xcf41('0x3c')](_0x5a5aac[_0xcf41('0x38')],_0x5a5aac[_0xcf41('0x3a')]);_0x39041b[_0xcf41('0x3d')]=_[_0xcf41('0x3c')](_0x5a5aac['model'],qs['fields'](_0x3e0875[_0xcf41('0x3a')][_0xcf41('0x3e')]));_0x39041b[_0xcf41('0x3d')]=_0x39041b[_0xcf41('0x3d')][_0xcf41('0x4c')]?_0x39041b[_0xcf41('0x3d')]:_0x5a5aac[_0xcf41('0x38')];_0x39041b[_0xcf41('0x41')]=qs[_0xcf41('0x42')](_0x3e0875[_0xcf41('0x3a')]['sort']);_0x39041b[_0xcf41('0x43')]=qs[_0xcf41('0x3b')](_[_0xcf41('0x5c')](_0x3e0875[_0xcf41('0x3a')],_0x5a5aac[_0xcf41('0x3b')]));if(_0x3e0875[_0xcf41('0x3a')][_0xcf41('0x46')]){_0x39041b[_0xcf41('0x43')]=_[_0xcf41('0x44')](_0x39041b[_0xcf41('0x43')],{'$or':_['map'](_0x39041b[_0xcf41('0x3d')],function(_0x516583){var _0x96fb53={};_0x96fb53[_0x516583]={'$like':'%'+_0x3e0875[_0xcf41('0x3a')][_0xcf41('0x46')]+'%'};return _0x96fb53;})});}_0x39041b=_['merge']({},_0x39041b,_0x3e0875[_0xcf41('0x47')]);return _0x4690ee[_0xcf41('0x128')](_0x39041b);}})['then'](function(_0x544d63){if(_0x544d63){_0x26f382=_0x544d63['length'];if(!_0x3e0875[_0xcf41('0x3a')][_0xcf41('0x3f')](_0xcf41('0x40'))){_0x39041b['limit']=qs[_0xcf41('0x24')](_0x3e0875[_0xcf41('0x3a')][_0xcf41('0x24')]);_0x39041b['offset']=qs[_0xcf41('0x22')](_0x3e0875[_0xcf41('0x3a')][_0xcf41('0x22')]);}return _0x4690ee['getAgents'](_0x39041b);}})['then'](function(_0x22e914){if(_0x22e914){return _0x22e914?{'count':_0x26f382,'rows':_0x22e914}:null;}})[_0xcf41('0x28')](respondWithResult(_0x3a9a8d,null))[_0xcf41('0x1d')](handleError(_0x3a9a8d,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 5874d65..f9226fd 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 _0x269f=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','save','remove'];(function(_0x83420c,_0x50fd91){var _0x1057d7=function(_0x80befc){while(--_0x80befc){_0x83420c['push'](_0x83420c['shift']());}};_0x1057d7(++_0x50fd91);}(_0x269f,0xee));var _0xf269=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x269f[_0x59ee6f];return _0x4c0979;};'use strict';var EventEmitter=require(_0xf269('0x0'));var ChatWebsite=require(_0xf269('0x1'))['db'][_0xf269('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf269('0x3'),'afterUpdate':'update','afterDestroy':_0xf269('0x4')};function emitEvent(_0x35e943){return function(_0x230d12,_0x22032a,_0x1f9a64){ChatWebsiteEvents['emit'](_0x35e943+':'+_0x230d12['id'],_0x230d12);ChatWebsiteEvents[_0xf269('0x5')](_0x35e943,_0x230d12);_0x1f9a64(null);};}for(var e in events){if(events[_0xf269('0x6')](e)){var event=events[e];ChatWebsite[_0xf269('0x7')](e,emitEvent(event));}}module[_0xf269('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xff96=['../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','events'];(function(_0x33c941,_0x396663){var _0x1574bc=function(_0x5c7c75){while(--_0x5c7c75){_0x33c941['push'](_0x33c941['shift']());}};_0x1574bc(++_0x396663);}(_0xff96,0x179));var _0x6ff9=function(_0x5a8f34,_0x11c27b){_0x5a8f34=_0x5a8f34-0x0;var _0x497614=_0xff96[_0x5a8f34];return _0x497614;};'use strict';var EventEmitter=require(_0x6ff9('0x0'));var ChatWebsite=require(_0x6ff9('0x1'))['db'][_0x6ff9('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x6ff9('0x3')](0x0);var events={'afterCreate':_0x6ff9('0x4'),'afterUpdate':_0x6ff9('0x5'),'afterDestroy':_0x6ff9('0x6')};function emitEvent(_0x1a81c5){return function(_0x3561d7,_0x207c06,_0x874737){ChatWebsiteEvents[_0x6ff9('0x7')](_0x1a81c5+':'+_0x3561d7['id'],_0x3561d7);ChatWebsiteEvents['emit'](_0x1a81c5,_0x3561d7);_0x874737(null);};}for(var e in events){if(events[_0x6ff9('0x8')](e)){var event=events[e];ChatWebsite['hook'](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 717610a..45884a2 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 _0xbce6=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','ChatWebsite','chat_websites'];(function(_0x1012f0,_0xed36f7){var _0x5d0f7f=function(_0x3f16ec){while(--_0x3f16ec){_0x1012f0['push'](_0x1012f0['shift']());}};_0x5d0f7f(++_0xed36f7);}(_0xbce6,0x176));var _0x6bce=function(_0x1c24e9,_0x3a8e49){_0x1c24e9=_0x1c24e9-0x0;var _0xe4fdb2=_0xbce6[_0x1c24e9];return _0xe4fdb2;};'use strict';var _=require('lodash');var util=require(_0x6bce('0x0'));var logger=require(_0x6bce('0x1'))(_0x6bce('0x2'));var moment=require(_0x6bce('0x3'));var BPromise=require(_0x6bce('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6bce('0x5'));var rimraf=require('rimraf');var config=require(_0x6bce('0x6'));var attributes=require('./chatWebsite.attributes');module[_0x6bce('0x7')]=function(_0x1ef6a7,_0x2733d6){return _0x1ef6a7[_0x6bce('0x8')](_0x6bce('0x9'),attributes,{'tableName':_0x6bce('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe9c1=['bluebird','request-promise','rimraf','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment'];(function(_0x316469,_0x32a8d4){var _0x43d3ae=function(_0x1dee88){while(--_0x1dee88){_0x316469['push'](_0x316469['shift']());}};_0x43d3ae(++_0x32a8d4);}(_0xe9c1,0xf7));var _0x1e9c=function(_0x377c40,_0xf252cf){_0x377c40=_0x377c40-0x0;var _0x1f6e34=_0xe9c1[_0x377c40];return _0x1f6e34;};'use strict';var _=require(_0x1e9c('0x0'));var util=require(_0x1e9c('0x1'));var logger=require(_0x1e9c('0x2'))(_0x1e9c('0x3'));var moment=require(_0x1e9c('0x4'));var BPromise=require(_0x1e9c('0x5'));var rp=require(_0x1e9c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e9c('0x7'));var config=require('../../config/environment');var attributes=require(_0x1e9c('0x8'));module[_0x1e9c('0x9')]=function(_0xa718fd,_0x58d123){return _0xa718fd['define'](_0x1e9c('0xa'),attributes,{'tableName':_0x1e9c('0xb'),'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 c4f2ba5..786fae1 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 _0x3960=['defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','client'];(function(_0x35ad5c,_0x58ccf7){var _0x2bd8aa=function(_0x426bdf){while(--_0x426bdf){_0x35ad5c['push'](_0x35ad5c['shift']());}};_0x2bd8aa(++_0x58ccf7);}(_0x3960,0xaf));var _0x0396=function(_0x3de8c5,_0x434f8f){_0x3de8c5=_0x3de8c5-0x0;var _0x48a800=_0x3960[_0x3de8c5];return _0x48a800;};'use strict';var _=require(_0x0396('0x0'));var util=require(_0x0396('0x1'));var moment=require(_0x0396('0x2'));var BPromise=require(_0x0396('0x3'));var rs=require(_0x0396('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0396('0x5'))(_0x0396('0x6'));var config=require(_0x0396('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0396('0x8')]['http']({'port':0x232a});config['redis']=_[_0x0396('0x9')](config[_0x0396('0xa')],{'host':_0x0396('0xb'),'port':0x18eb});var socket=require(_0x0396('0xc'))(new Redis(config['redis']));require(_0x0396('0xd'))['register'](socket);function respondWithRpcPromise(_0x19be2b,_0x5c1cce,_0x1510c1){return new BPromise(function(_0x2f8d51,_0xfeb61a){return client[_0x0396('0xe')](_0x19be2b,_0x1510c1)[_0x0396('0xf')](function(_0xf02a22){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x5c1cce,_0x0396('0x10'));logger[_0x0396('0x11')](_0x0396('0x12'),_0x5c1cce,_0x0396('0x10'),JSON['stringify'](_0xf02a22));if(_0xf02a22[_0x0396('0x13')]){if(_0xf02a22['error'][_0x0396('0x14')]===0x1f4){logger[_0x0396('0x13')](_0x0396('0x15'),_0x5c1cce,_0xf02a22[_0x0396('0x13')][_0x0396('0x16')]);return _0xfeb61a(_0xf02a22[_0x0396('0x13')]['message']);}logger[_0x0396('0x13')](_0x0396('0x15'),_0x5c1cce,_0xf02a22[_0x0396('0x13')]['message']);return _0x2f8d51(_0xf02a22[_0x0396('0x13')][_0x0396('0x16')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x5c1cce,_0x0396('0x10'));_0x2f8d51(_0xf02a22['result'][_0x0396('0x16')]);}})['catch'](function(_0x3f1e39){logger[_0x0396('0x13')](_0x0396('0x15'),_0x5c1cce,_0x3f1e39);_0xfeb61a(_0x3f1e39);});});}
\ No newline at end of file
+var _0xaf9e=['./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xaf9e,0x64));var _0xeaf9=function(_0x13699c,_0x1d1531){_0x13699c=_0x13699c-0x0;var _0x41831f=_0xaf9e[_0x13699c];return _0x41831f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xeaf9('0x0'));var BPromise=require(_0xeaf9('0x1'));var rs=require(_0xeaf9('0x2'));var fs=require('fs');var Redis=require(_0xeaf9('0x3'));var db=require(_0xeaf9('0x4'))['db'];var utils=require(_0xeaf9('0x5'));var logger=require(_0xeaf9('0x6'))(_0xeaf9('0x7'));var config=require(_0xeaf9('0x8'));var jayson=require(_0xeaf9('0x9'));var client=jayson[_0xeaf9('0xa')][_0xeaf9('0xb')]({'port':0x232a});config[_0xeaf9('0xc')]=_[_0xeaf9('0xd')](config[_0xeaf9('0xc')],{'host':_0xeaf9('0xe'),'port':0x18eb});var socket=require(_0xeaf9('0xf'))(new Redis(config[_0xeaf9('0xc')]));require(_0xeaf9('0x10'))[_0xeaf9('0x11')](socket);function respondWithRpcPromise(_0x1370e0,_0x57efe9,_0x5941fa){return new BPromise(function(_0x2fbbbe,_0x59e83a){return client[_0xeaf9('0x12')](_0x1370e0,_0x5941fa)[_0xeaf9('0x13')](function(_0x29cdf1){logger['info'](_0xeaf9('0x14'),_0x57efe9,'request\x20sent');logger[_0xeaf9('0x15')](_0xeaf9('0x16'),_0x57efe9,'request\x20sent',JSON['stringify'](_0x29cdf1));if(_0x29cdf1[_0xeaf9('0x17')]){if(_0x29cdf1[_0xeaf9('0x17')][_0xeaf9('0x18')]===0x1f4){logger['error'](_0xeaf9('0x14'),_0x57efe9,_0x29cdf1[_0xeaf9('0x17')][_0xeaf9('0x19')]);return _0x59e83a(_0x29cdf1[_0xeaf9('0x17')][_0xeaf9('0x19')]);}logger[_0xeaf9('0x17')](_0xeaf9('0x14'),_0x57efe9,_0x29cdf1[_0xeaf9('0x17')]['message']);return _0x2fbbbe(_0x29cdf1[_0xeaf9('0x17')]['message']);}else{logger[_0xeaf9('0x1a')](_0xeaf9('0x14'),_0x57efe9,'request\x20sent');_0x2fbbbe(_0x29cdf1[_0xeaf9('0x1b')][_0xeaf9('0x19')]);}})[_0xeaf9('0x1c')](function(_0x3837f7){logger['error'](_0xeaf9('0x14'),_0x57efe9,_0x3837f7);_0x59e83a(_0x3837f7);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 2b7ccf6..76aa766 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 _0x513f=['length','chatWebsite:','./chatWebsite.events','save','remove','update','removeListener','register'];(function(_0x4fb334,_0x4ca8c9){var _0x56dc84=function(_0x470d7b){while(--_0x470d7b){_0x4fb334['push'](_0x4fb334['shift']());}};_0x56dc84(++_0x4ca8c9);}(_0x513f,0x12a));var _0xf513=function(_0x214ec1,_0x5ace17){_0x214ec1=_0x214ec1-0x0;var _0x54e5f5=_0x513f[_0x214ec1];return _0x54e5f5;};'use strict';var ChatWebsiteEvents=require(_0xf513('0x0'));var events=[_0xf513('0x1'),_0xf513('0x2'),_0xf513('0x3')];function createListener(_0x40c4d7,_0x54cb8a){return function(_0x5a87f3){_0x54cb8a['emit'](_0x40c4d7,_0x5a87f3);};}function removeListener(_0x18639a,_0x2cc3fa){return function(){ChatWebsiteEvents[_0xf513('0x4')](_0x18639a,_0x2cc3fa);};}exports[_0xf513('0x5')]=function(_0x1e94de){for(var _0x15a461=0x0,_0x4202e0=events[_0xf513('0x6')];_0x15a461<_0x4202e0;_0x15a461++){var _0x3c1733=events[_0x15a461];var _0x888a12=createListener(_0xf513('0x7')+_0x3c1733,_0x1e94de);ChatWebsiteEvents['on'](_0x3c1733,_0x888a12);}};
\ No newline at end of file
+var _0x2511=['removeListener','length','chatWebsite:','./chatWebsite.events','save','update'];(function(_0x1d8242,_0x47413c){var _0x1cbd9a=function(_0x28842c){while(--_0x28842c){_0x1d8242['push'](_0x1d8242['shift']());}};_0x1cbd9a(++_0x47413c);}(_0x2511,0x135));var _0x1251=function(_0x20c99d,_0x5ca65e){_0x20c99d=_0x20c99d-0x0;var _0x148af0=_0x2511[_0x20c99d];return _0x148af0;};'use strict';var ChatWebsiteEvents=require(_0x1251('0x0'));var events=[_0x1251('0x1'),'remove',_0x1251('0x2')];function createListener(_0x657f10,_0x25139a){return function(_0x2089ba){_0x25139a['emit'](_0x657f10,_0x2089ba);};}function removeListener(_0x40a8e6,_0x5bca2e){return function(){ChatWebsiteEvents[_0x1251('0x3')](_0x40a8e6,_0x5bca2e);};}exports['register']=function(_0x18e71c){for(var _0x18b8ae=0x0,_0xcd10a7=events[_0x1251('0x4')];_0x18b8ae<_0xcd10a7;_0x18b8ae++){var _0x2078d0=events[_0x18b8ae];var _0x5dacaa=createListener(_0x1251('0x5')+_0x2078d0,_0x18e71c);ChatWebsiteEvents['on'](_0x2078d0,_0x5dacaa);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index c8b2580..d5b335f 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 _0x9f94=['offline-chat','ensureDir','replace','extname','/:id/offline','offline','addInteraction','/:id/applications','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','isAuthenticated','/describe','describe','/:id','show','get','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','diskStorage','join','root','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','server/files','attachments'];(function(_0x53fb41,_0x500026){var _0x3f3cbd=function(_0x261510){while(--_0x261510){_0x53fb41['push'](_0x53fb41['shift']());}};_0x3f3cbd(++_0x500026);}(_0x9f94,0x1db));var _0x49f9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9f94[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x49f9('0x0'));var util=require('util');var path=require(_0x49f9('0x1'));var timeout=require(_0x49f9('0x2'));var express=require(_0x49f9('0x3'));var router=express[_0x49f9('0x4')]();var fs_extra=require(_0x49f9('0x5'));var auth=require(_0x49f9('0x6'));var interaction=require(_0x49f9('0x7'));var config=require('../../config/environment');var controller=require(_0x49f9('0x8'));router['get']('/',auth[_0x49f9('0x9')](),controller['index']);router['get'](_0x49f9('0xa'),auth['isAuthenticated'](),controller[_0x49f9('0xb')]);router['get'](_0x49f9('0xc'),auth[_0x49f9('0x9')](),controller[_0x49f9('0xd')]);router[_0x49f9('0xe')](_0x49f9('0xf'),auth[_0x49f9('0x9')](),controller[_0x49f9('0x10')]);router[_0x49f9('0xe')](_0x49f9('0x11'),auth[_0x49f9('0x9')](),controller[_0x49f9('0x12')]);router['get'](_0x49f9('0x13'),controller[_0x49f9('0x14')]);router['get'](_0x49f9('0x15'),controller[_0x49f9('0x16')]);router[_0x49f9('0xe')](_0x49f9('0x17'),controller['getCustomerAvatar']);router[_0x49f9('0xe')]('/:id/system_avatar',controller[_0x49f9('0x18')]);router[_0x49f9('0xe')](_0x49f9('0x19'),auth[_0x49f9('0x9')](),controller[_0x49f9('0x1a')]);router['get'](_0x49f9('0x1b'),controller['getSnippet']);router['get']('/:id/applications',auth[_0x49f9('0x9')](),controller[_0x49f9('0x1c')]);router[_0x49f9('0xe')]('/:id/proactive_actions',auth[_0x49f9('0x9')](),controller[_0x49f9('0x1d')]);router[_0x49f9('0xe')](_0x49f9('0x1e'),controller[_0x49f9('0x1f')]);router[_0x49f9('0xe')](_0x49f9('0x20'),auth[_0x49f9('0x9')](),controller[_0x49f9('0x21')]);router[_0x49f9('0xe')](_0x49f9('0x22'),auth[_0x49f9('0x9')](),controller[_0x49f9('0x23')]);router[_0x49f9('0x24')]('/',auth['isAuthenticated'](),controller[_0x49f9('0x25')]);router[_0x49f9('0x24')](_0x49f9('0xf'),auth[_0x49f9('0x9')](),controller[_0x49f9('0x26')]);router['post'](_0x49f9('0x11'),auth[_0x49f9('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x49f9('0x27')]({'destination':function(_0x4cde16,_0x2298c8,_0x42af43){_0x42af43(null,path[_0x49f9('0x28')](config[_0x49f9('0x29')],'server/files/images/logos/'));},'filename':function(_0x21f8d1,_0xcdfb65,_0xbf230a){_0xbf230a(null,util[_0x49f9('0x2a')](_0x49f9('0x2b'),Date[_0x49f9('0x2c')](),_0xcdfb65[_0x49f9('0x2d')]));}})});router[_0x49f9('0x24')]('/:id/logo',upload[_0x49f9('0x2e')](_0x49f9('0x2f')),controller[_0x49f9('0x30')]);var upload=multer({'storage':multer[_0x49f9('0x27')]({'destination':function(_0x147b0b,_0x1358e8,_0x119eff){_0x119eff(null,path[_0x49f9('0x28')](config['root'],_0x49f9('0x31')));},'filename':function(_0x387a85,_0x712830,_0x158738){_0x158738(null,util[_0x49f9('0x2a')](_0x49f9('0x2b'),Date[_0x49f9('0x2c')](),_0x712830[_0x49f9('0x2d')]));}})});router['post'](_0x49f9('0x15'),upload['single'](_0x49f9('0x2f')),controller[_0x49f9('0x32')]);var upload=multer({'storage':multer[_0x49f9('0x27')]({'destination':function(_0x194718,_0x13d5a3,_0x47ff42){_0x47ff42(null,path[_0x49f9('0x28')](config['root'],_0x49f9('0x31')));},'filename':function(_0x15501c,_0x2dd588,_0x5ba3fe){_0x5ba3fe(null,util[_0x49f9('0x2a')](_0x49f9('0x2b'),Date['now'](),_0x2dd588[_0x49f9('0x2d')]));}})});router[_0x49f9('0x24')](_0x49f9('0x17'),upload[_0x49f9('0x2e')](_0x49f9('0x2f')),controller[_0x49f9('0x33')]);var upload=multer({'storage':multer[_0x49f9('0x27')]({'destination':function(_0x6d2ed4,_0x383ca2,_0x3a1162){_0x3a1162(null,path['join'](config[_0x49f9('0x29')],_0x49f9('0x31')));},'filename':function(_0x5d32d7,_0x40f334,_0x1eeb1c){_0x1eeb1c(null,util['format'](_0x49f9('0x2b'),Date['now'](),_0x40f334[_0x49f9('0x2d')]));}})});router['post'](_0x49f9('0x34'),upload[_0x49f9('0x2e')](_0x49f9('0x2f')),controller[_0x49f9('0x35')]);router[_0x49f9('0x24')](_0x49f9('0x36'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x49f9('0x27')]({'destination':function(_0x2a03de,_0x4ee4cd,_0x5642f8){const _0x50f107=path[_0x49f9('0x28')](config[_0x49f9('0x29')],_0x49f9('0x37'),_0x49f9('0x38'),_0x49f9('0x39'));fs_extra[_0x49f9('0x3a')](_0x50f107,function(){_0x5642f8(null,_0x50f107);});},'filename':function(_0x2c75d1,_0x33d1e0,_0x56a6d3){const _0x3ababf=_0x33d1e0['originalname'][_0x49f9('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x456995=path[_0x49f9('0x3c')](_0x3ababf);const _0x4cb9f6=Date[_0x49f9('0x2c')]()+'-'+_0x3ababf[_0x49f9('0x3b')](_0x456995,'')+_0x456995;_0x56a6d3(null,_0x4cb9f6);}})});router['post'](_0x49f9('0x3d'),offlineUploadMulter['any'](),controller[_0x49f9('0x3e')]);router[_0x49f9('0x24')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x49f9('0x3f')]);router[_0x49f9('0x24')](_0x49f9('0x40'),auth[_0x49f9('0x9')](),controller[_0x49f9('0x41')]);router[_0x49f9('0x24')](_0x49f9('0x42'),auth[_0x49f9('0x9')](),controller[_0x49f9('0x43')]);router[_0x49f9('0x24')]('/:id/users',auth[_0x49f9('0x9')](),controller[_0x49f9('0x44')]);router[_0x49f9('0x45')](_0x49f9('0xc'),auth['isAuthenticated'](),controller[_0x49f9('0x46')]);router[_0x49f9('0x47')]('/:id',auth[_0x49f9('0x9')](),controller[_0x49f9('0x48')]);router[_0x49f9('0x47')](_0x49f9('0xf'),auth[_0x49f9('0x9')](),controller[_0x49f9('0x49')]);router[_0x49f9('0x47')](_0x49f9('0x11'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x49f9('0x22'),auth[_0x49f9('0x9')](),controller[_0x49f9('0x4a')]);module[_0x49f9('0x4b')]=router;
\ No newline at end of file
+var _0x3b9d=['/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/fields','/:id/offline_messages','getOfflineMessages','getAgents','post','addDisposition','addAnswer','root','server/files/images/logos/','%s-%s','now','originalname','single','file','addLogo','diskStorage','join','server/files/images/avatars/','format','addAvatar','addCustomerAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','any','offline','addInteraction','/:id/applications','addApplications','/:id/proactive_actions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar'];(function(_0x21001b,_0x3ff1a8){var _0x665a00=function(_0x98d912){while(--_0x98d912){_0x21001b['push'](_0x21001b['shift']());}};_0x665a00(++_0x3ff1a8);}(_0x3b9d,0xc4));var _0xd3b9=function(_0x3a60af,_0x4062a8){_0x3a60af=_0x3a60af-0x0;var _0x5be0ec=_0x3b9d[_0x3a60af];return _0x5be0ec;};'use strict';var multer=require(_0xd3b9('0x0'));var util=require('util');var path=require(_0xd3b9('0x1'));var timeout=require(_0xd3b9('0x2'));var express=require(_0xd3b9('0x3'));var router=express[_0xd3b9('0x4')]();var fs_extra=require(_0xd3b9('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd3b9('0x6'));var controller=require('./chatWebsite.controller');router[_0xd3b9('0x7')]('/',auth['isAuthenticated'](),controller[_0xd3b9('0x8')]);router[_0xd3b9('0x7')](_0xd3b9('0x9'),auth[_0xd3b9('0xa')](),controller['describe']);router['get'](_0xd3b9('0xb'),auth['isAuthenticated'](),controller[_0xd3b9('0xc')]);router['get'](_0xd3b9('0xd'),auth[_0xd3b9('0xa')](),controller[_0xd3b9('0xe')]);router[_0xd3b9('0x7')](_0xd3b9('0xf'),auth[_0xd3b9('0xa')](),controller[_0xd3b9('0x10')]);router[_0xd3b9('0x7')](_0xd3b9('0x11'),controller[_0xd3b9('0x12')]);router[_0xd3b9('0x7')](_0xd3b9('0x13'),controller[_0xd3b9('0x14')]);router['get'](_0xd3b9('0x15'),controller[_0xd3b9('0x16')]);router[_0xd3b9('0x7')](_0xd3b9('0x17'),controller[_0xd3b9('0x18')]);router['get'](_0xd3b9('0x19'),auth['isAuthenticated'](),controller[_0xd3b9('0x1a')]);router[_0xd3b9('0x7')](_0xd3b9('0x1b'),controller['getSnippet']);router[_0xd3b9('0x7')]('/:id/applications',auth[_0xd3b9('0xa')](),controller['getApplications']);router['get']('/:id/proactive_actions',auth['isAuthenticated'](),controller['getProactiveActions']);router[_0xd3b9('0x7')](_0xd3b9('0x1c'),controller['getFields']);router['get'](_0xd3b9('0x1d'),auth['isAuthenticated'](),controller[_0xd3b9('0x1e')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xd3b9('0x1f')]);router[_0xd3b9('0x20')]('/',auth[_0xd3b9('0xa')](),controller['create']);router[_0xd3b9('0x20')]('/:id/dispositions',auth[_0xd3b9('0xa')](),controller[_0xd3b9('0x21')]);router[_0xd3b9('0x20')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xd3b9('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x163ca8,_0x319226,_0x3e80a4){_0x3e80a4(null,path['join'](config[_0xd3b9('0x23')],_0xd3b9('0x24')));},'filename':function(_0x76863f,_0x43c4ff,_0x3d9a58){_0x3d9a58(null,util['format'](_0xd3b9('0x25'),Date[_0xd3b9('0x26')](),_0x43c4ff[_0xd3b9('0x27')]));}})});router[_0xd3b9('0x20')](_0xd3b9('0x11'),upload[_0xd3b9('0x28')](_0xd3b9('0x29')),controller[_0xd3b9('0x2a')]);var upload=multer({'storage':multer[_0xd3b9('0x2b')]({'destination':function(_0x12a959,_0x594fcc,_0x3e6872){_0x3e6872(null,path[_0xd3b9('0x2c')](config[_0xd3b9('0x23')],_0xd3b9('0x2d')));},'filename':function(_0x5bccfe,_0x48d34f,_0x14fec6){_0x14fec6(null,util[_0xd3b9('0x2e')](_0xd3b9('0x25'),Date[_0xd3b9('0x26')](),_0x48d34f[_0xd3b9('0x27')]));}})});router[_0xd3b9('0x20')]('/:id/avatar',upload['single']('file'),controller[_0xd3b9('0x2f')]);var upload=multer({'storage':multer[_0xd3b9('0x2b')]({'destination':function(_0x55765e,_0x101b3d,_0x591c9d){_0x591c9d(null,path['join'](config[_0xd3b9('0x23')],_0xd3b9('0x2d')));},'filename':function(_0x4b50ee,_0x2a6f64,_0x51bd86){_0x51bd86(null,util['format'](_0xd3b9('0x25'),Date[_0xd3b9('0x26')](),_0x2a6f64[_0xd3b9('0x27')]));}})});router['post'](_0xd3b9('0x15'),upload[_0xd3b9('0x28')](_0xd3b9('0x29')),controller[_0xd3b9('0x30')]);var upload=multer({'storage':multer[_0xd3b9('0x2b')]({'destination':function(_0x404b45,_0x3e1310,_0x156425){_0x156425(null,path['join'](config[_0xd3b9('0x23')],_0xd3b9('0x2d')));},'filename':function(_0x4e120a,_0x51cc5c,_0x3ca59b){_0x3ca59b(null,util['format']('%s-%s',Date[_0xd3b9('0x26')](),_0x51cc5c[_0xd3b9('0x27')]));}})});router['post'](_0xd3b9('0x17'),upload[_0xd3b9('0x28')]('file'),controller['addSystemAvatar']);router[_0xd3b9('0x20')](_0xd3b9('0x31'),controller[_0xd3b9('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0xd3b9('0x2b')]({'destination':function(_0x265537,_0x5b9c2b,_0x3538d3){const _0x3032bc=path[_0xd3b9('0x2c')](config[_0xd3b9('0x23')],_0xd3b9('0x33'),_0xd3b9('0x34'),_0xd3b9('0x35'));fs_extra[_0xd3b9('0x36')](_0x3032bc,function(){_0x3538d3(null,_0x3032bc);});},'filename':function(_0x485b83,_0x590e5a,_0x2d24b2){const _0x53b1fd=_0x590e5a['originalname'][_0xd3b9('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x79dccf=path[_0xd3b9('0x38')](_0x53b1fd);const _0x2550e0=Date[_0xd3b9('0x26')]()+'-'+_0x53b1fd[_0xd3b9('0x37')](_0x79dccf,'')+_0x79dccf;_0x2d24b2(null,_0x2550e0);}})});router[_0xd3b9('0x20')]('/:id/offline',offlineUploadMulter[_0xd3b9('0x39')](),controller[_0xd3b9('0x3a')]);router['post'](_0xd3b9('0x19'),auth['isAuthenticated'](),controller[_0xd3b9('0x3b')]);router['post'](_0xd3b9('0x3c'),auth['isAuthenticated'](),controller[_0xd3b9('0x3d')]);router[_0xd3b9('0x20')](_0xd3b9('0x3e'),auth[_0xd3b9('0xa')](),controller['addProactiveActions']);router[_0xd3b9('0x20')]('/:id/users',auth['isAuthenticated'](),controller[_0xd3b9('0x3f')]);router[_0xd3b9('0x40')]('/:id',auth[_0xd3b9('0xa')](),controller[_0xd3b9('0x41')]);router[_0xd3b9('0x42')](_0xd3b9('0xb'),auth[_0xd3b9('0xa')](),controller[_0xd3b9('0x43')]);router[_0xd3b9('0x42')](_0xd3b9('0xd'),auth[_0xd3b9('0xa')](),controller[_0xd3b9('0x44')]);router[_0xd3b9('0x42')](_0xd3b9('0xf'),auth[_0xd3b9('0xa')](),controller[_0xd3b9('0x45')]);router[_0xd3b9('0x42')](_0xd3b9('0x46'),auth['isAuthenticated'](),controller[_0xd3b9('0x47')]);module[_0xd3b9('0x48')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index c305c2d..dfc9e76 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 _0xff1b=['../components/auth/service','../config/environment','Router','env','production','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','express'];(function(_0x1e081a,_0x482d6b){var _0x428209=function(_0x524b53){while(--_0x524b53){_0x1e081a['push'](_0x1e081a['shift']());}};_0x428209(++_0x482d6b);}(_0xff1b,0x143));var _0xbff1=function(_0x44b19b,_0x5d33cc){_0x44b19b=_0x44b19b-0x0;var _0x2d7858=_0xff1b[_0x44b19b];return _0x2d7858;};var beaverLogger=require(_0xbff1('0x0'));var express=require(_0xbff1('0x1'));var auth=require(_0xbff1('0x2'));var config=require(_0xbff1('0x3'));var router=express[_0xbff1('0x4')]();var isProduction=config[_0xbff1('0x5')]===_0xbff1('0x6')||![];function clientSideLogs(_0x2abac4,_0x2d2a09,_0x169a02){var _0x13b8f1=_0x2abac4['app'][_0xbff1('0x7')]('client-side-logger');if(!_0x13b8f1){throw new Error(_0xbff1('0x8'));}return beaverLogger[_0xbff1('0x9')]({'uri':'/client-logs','logger':_0x13b8f1,'enableCors':!isProduction})(_0x2abac4,_0x2d2a09,_0x169a02);}router[_0xbff1('0xa')](auth[_0xbff1('0xb')](),clientSideLogs);module[_0xbff1('0xc')]=router;
\ No newline at end of file
+var _0xa8be=['express','../components/auth/service','Router','env','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports'];(function(_0x1a9f06,_0x33a13e){var _0x4a7115=function(_0x49a285){while(--_0x49a285){_0x1a9f06['push'](_0x1a9f06['shift']());}};_0x4a7115(++_0x33a13e);}(_0xa8be,0x114));var _0xea8b=function(_0x323f2c,_0x38c0dd){_0x323f2c=_0x323f2c-0x0;var _0x909352=_0xa8be[_0x323f2c];return _0x909352;};var beaverLogger=require('beaver-logger/server');var express=require(_0xea8b('0x0'));var auth=require(_0xea8b('0x1'));var config=require('../config/environment');var router=express[_0xea8b('0x2')]();var isProduction=config[_0xea8b('0x3')]==='production'||![];function clientSideLogs(_0x3174ec,_0x15289a,_0x4dfb79){var _0x86ec8b=_0x3174ec['app'][_0xea8b('0x4')](_0xea8b('0x5'));if(!_0x86ec8b){throw new Error(_0xea8b('0x6'));}return beaverLogger[_0xea8b('0x7')]({'uri':_0xea8b('0x8'),'logger':_0x86ec8b,'enableCors':!isProduction})(_0x3174ec,_0x15289a,_0x4dfb79);}router[_0xea8b('0x9')](auth[_0xea8b('0xa')](),clientSideLogs);module[_0xea8b('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 3560a9c..623e432 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 _0xcbad=['Dynamics365','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365'];(function(_0x168c0f,_0x579bd4){var _0xaa8902=function(_0x4ae39f){while(--_0x4ae39f){_0x168c0f['push'](_0x168c0f['shift']());}};_0xaa8902(++_0x579bd4);}(_0xcbad,0x110));var _0xdcba=function(_0x5993a5,_0x88f176){_0x5993a5=_0x5993a5-0x0;var _0x2d7a42=_0xcbad[_0x5993a5];return _0x2d7a42;};'use strict';var Sequelize=require(_0xdcba('0x0'));module[_0xdcba('0x1')]={'name':{'type':Sequelize[_0xdcba('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xdcba('0x3')](_0xdcba('0x4'),_0xdcba('0x5'),_0xdcba('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xdcba('0x3')](_0xdcba('0x7'),_0xdcba('0x8'))},'data1':{'type':Sequelize[_0xdcba('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xdcba('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0xdcba('0x2')],'comment':_0xdcba('0x9')},'data5':{'type':Sequelize[_0xdcba('0xa')],'comment':_0xdcba('0xb')},'data6':{'type':Sequelize[_0xdcba('0xa')],'comment':_0xdcba('0xc')},'data7':{'type':Sequelize[_0xdcba('0xa')],'comment':_0xdcba('0xd')}};
\ No newline at end of file
+var _0x14ac=['TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','ENUM','Google','Dynamics365','MicrosoftAzure\x20=>\x20client_secret'];(function(_0x105e4c,_0x1090c1){var _0x582984=function(_0x4ebbdd){while(--_0x4ebbdd){_0x105e4c['push'](_0x105e4c['shift']());}};_0x582984(++_0x1090c1);}(_0x14ac,0x176));var _0xc14a=function(_0x58736a,_0x5d0121){_0x58736a=_0x58736a-0x0;var _0x4518e2=_0x14ac[_0x58736a];return _0x4518e2;};'use strict';var Sequelize=require('sequelize');module[_0xc14a('0x0')]={'name':{'type':Sequelize[_0xc14a('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xc14a('0x2')]('AmazonAWS',_0xc14a('0x3'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xc14a('0x2')]('Outlook365',_0xc14a('0x4'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xc14a('0x1')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xc14a('0x1')],'comment':_0xc14a('0x5')},'data4':{'type':Sequelize[_0xc14a('0x1')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xc14a('0x6')],'comment':_0xc14a('0x7')},'data6':{'type':Sequelize[_0xc14a('0x6')],'comment':_0xc14a('0x8')},'data7':{'type':Sequelize['TEXT'],'comment':_0xc14a('0x9')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index ccc9993..192b9cd 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 _0xca8c=['fieldName','type','key','name','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','keys','includeAll','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','from','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','./cloudProvider.oauth','localhost','socket.io-emitter','redis','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','error','stack','send','padEnd','slice','map','CloudProvider','rawAttributes'];(function(_0x24ce5a,_0x25d7e9){var _0x595ae3=function(_0xf756e7){while(--_0xf756e7){_0x24ce5a['push'](_0x24ce5a['shift']());}};_0x595ae3(++_0x25d7e9);}(_0xca8c,0x102));var _0xcca8=function(_0x1558bc,_0x191ffb){_0x1558bc=_0x1558bc-0x0;var _0xfe234d=_0xca8c[_0x1558bc];return _0xfe234d;};'use strict';var _=require('lodash');var Redis=require(_0xcca8('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xcca8('0x1'));var config=require(_0xcca8('0x2'));var logger=require(_0xcca8('0x3'))(_0xcca8('0x4'));var db=require('../../mysqldb')['db'];var oauth=require(_0xcca8('0x5'));config['redis']=_['defaults'](config['redis'],{'host':_0xcca8('0x6'),'port':0x18eb});var socket=require(_0xcca8('0x7'))(new Redis(config[_0xcca8('0x8')]));var redis=new Redis(config[_0xcca8('0x8')]);function respondWithStatusCode(_0x7a93d,_0x27c349){_0x27c349=_0x27c349||0xcc;return function(_0x3be8d6){if(_0x3be8d6){return _0x7a93d[_0xcca8('0x9')](_0x27c349);}return _0x7a93d[_0xcca8('0xa')](_0x27c349)[_0xcca8('0xb')]();};}function respondWithResult(_0x148c49,_0x4fc523){_0x4fc523=_0x4fc523||0xc8;return function(_0x4bcd31){if(_0x4bcd31){return _0x148c49['status'](_0x4fc523)[_0xcca8('0xc')](_0x4bcd31);}};}function respondWithFilteredResult(_0x50c614,_0x5ae436){return function(_0x4c38db){if(_0x4c38db){var _0x13e622=typeof _0x5ae436[_0xcca8('0xd')]===_0xcca8('0xe')&&typeof _0x5ae436['limit']===_0xcca8('0xe');var _0xe41aef=_0x4c38db['count'];var _0xb03554=_0x13e622?0x0:_0x5ae436[_0xcca8('0xd')];var _0x285bbe=_0x13e622?_0x4c38db[_0xcca8('0xf')]:_0x5ae436['offset']+_0x5ae436[_0xcca8('0x10')];var _0x128a59;if(_0x285bbe>=_0xe41aef){_0x285bbe=_0xe41aef;_0x128a59=0xc8;}else{_0x128a59=0xce;}_0x50c614[_0xcca8('0xa')](_0x128a59);return _0x50c614[_0xcca8('0x11')](_0xcca8('0x12'),_0xb03554+'-'+_0x285bbe+'/'+_0xe41aef)[_0xcca8('0xc')](_0x4c38db);}return null;};}function saveUpdates(_0x207245){return function(_0x34cd6e){if(_0x34cd6e){return _0x34cd6e[_0xcca8('0x13')](_0x207245)[_0xcca8('0x14')](function(_0x419d1f){return _0x419d1f;});}return null;};}function removeEntity(_0x4740b8){return function(_0x51cfea){if(_0x51cfea){return _0x51cfea[_0xcca8('0x15')]()[_0xcca8('0x14')](function(){_0x4740b8[_0xcca8('0xa')](0xcc)[_0xcca8('0xb')]();});}};}function handleEntityNotFound(_0x5a402a){return function(_0x56dcc1){if(!_0x56dcc1){_0x5a402a[_0xcca8('0x9')](0x194);}return _0x56dcc1;};}function handleError(_0x341bb1,_0x180a3b){_0x180a3b=_0x180a3b||0x1f4;return function(_0xe9d3b0){logger[_0xcca8('0x16')](_0xe9d3b0[_0xcca8('0x17')]);if(_0xe9d3b0['name']){delete _0xe9d3b0['name'];}_0x341bb1['status'](_0x180a3b)[_0xcca8('0x18')](_0xe9d3b0);};}function maskClientSecret(_0x210a6d){return _[_0xcca8('0x19')](_0x210a6d[_0xcca8('0x1a')](0x0,0x3),0x14,'*');}exports['index']=function(_0x4b05cc,_0xa57c76){var _0x48249c={},_0x2b76ff={},_0x4dd515={'count':0x0,'rows':[]};var _0x1172cf=_[_0xcca8('0x1b')](db[_0xcca8('0x1c')][_0xcca8('0x1d')],function(_0x5c93bb){return{'name':_0x5c93bb[_0xcca8('0x1e')],'type':_0x5c93bb[_0xcca8('0x1f')][_0xcca8('0x20')]};});_0x2b76ff['model']=_[_0xcca8('0x1b')](_0x1172cf,_0xcca8('0x21'));_0x2b76ff[_0xcca8('0x22')]=_['keys'](_0x4b05cc['query']);_0x2b76ff['filters']=_[_0xcca8('0x23')](_0x2b76ff[_0xcca8('0x24')],_0x2b76ff[_0xcca8('0x22')]);_0x48249c[_0xcca8('0x25')]=_[_0xcca8('0x23')](_0x2b76ff[_0xcca8('0x24')],qs[_0xcca8('0x26')](_0x4b05cc['query'][_0xcca8('0x26')]));_0x48249c[_0xcca8('0x25')]=_0x48249c['attributes'][_0xcca8('0x27')]?_0x48249c[_0xcca8('0x25')]:_0x2b76ff[_0xcca8('0x24')];if(!_0x4b05cc[_0xcca8('0x22')][_0xcca8('0x28')](_0xcca8('0x29'))){_0x48249c[_0xcca8('0x10')]=qs[_0xcca8('0x10')](_0x4b05cc['query']['limit']);_0x48249c[_0xcca8('0xd')]=qs[_0xcca8('0xd')](_0x4b05cc[_0xcca8('0x22')][_0xcca8('0xd')]);}_0x48249c[_0xcca8('0x2a')]=qs['sort'](_0x4b05cc[_0xcca8('0x22')][_0xcca8('0x2b')]);_0x48249c['where']=qs[_0xcca8('0x2c')](_['pick'](_0x4b05cc['query'],_0x2b76ff[_0xcca8('0x2c')]),_0x1172cf);if(_0x4b05cc[_0xcca8('0x22')][_0xcca8('0x2d')]){_0x48249c[_0xcca8('0x2e')]=_[_0xcca8('0x2f')](_0x48249c['where'],{'$or':_[_0xcca8('0x1b')](_0x1172cf,function(_0x2206dc){if(_0x2206dc[_0xcca8('0x1f')]!==_0xcca8('0x30')){var _0x348421={};_0x348421[_0x2206dc[_0xcca8('0x21')]]={'$like':'%'+_0x4b05cc[_0xcca8('0x22')]['filter']+'%'};return _0x348421;}})});}_0x48249c=_[_0xcca8('0x2f')]({},_0x48249c,_0x4b05cc[_0xcca8('0x31')]);var _0x285edf={'where':_0x48249c[_0xcca8('0x2e')]};return db[_0xcca8('0x1c')][_0xcca8('0xf')](_0x285edf)[_0xcca8('0x14')](function(_0x5162fb){_0x4dd515[_0xcca8('0xf')]=_0x5162fb;if(_0x4b05cc['query']['includeAll']){_0x48249c['include']=[{'all':!![]}];}return db['CloudProvider'][_0xcca8('0x32')](_0x48249c);})[_0xcca8('0x14')](function(_0x34e769){_0x4dd515[_0xcca8('0x33')]=_[_0xcca8('0x1b')](_0x34e769,function(_0x5edb87){if(_0x5edb87[_0xcca8('0x34')]===_0xcca8('0x35')){var _0x4195a3=encryptor[_0xcca8('0x36')](_0x5edb87[_0xcca8('0x37')]);_0x5edb87[_0xcca8('0x37')]=maskClientSecret(_0x4195a3);}return _0x5edb87;});return _0x4dd515;})[_0xcca8('0x14')](respondWithFilteredResult(_0xa57c76,_0x48249c))[_0xcca8('0x38')](handleError(_0xa57c76,null));};exports[_0xcca8('0x39')]=function(_0x598e41,_0x1e182f){var _0x14bdec={'raw':!![],'where':{'id':_0x598e41[_0xcca8('0x3a')]['id']}},_0x33c369={};_0x33c369[_0xcca8('0x24')]=_[_0xcca8('0x3b')](db[_0xcca8('0x1c')][_0xcca8('0x1d')]);_0x33c369[_0xcca8('0x22')]=_[_0xcca8('0x3b')](_0x598e41['query']);_0x33c369[_0xcca8('0x2c')]=_[_0xcca8('0x23')](_0x33c369['model'],_0x33c369[_0xcca8('0x22')]);_0x14bdec[_0xcca8('0x25')]=_[_0xcca8('0x23')](_0x33c369[_0xcca8('0x24')],qs['fields'](_0x598e41[_0xcca8('0x22')]['fields']));_0x14bdec[_0xcca8('0x25')]=_0x14bdec[_0xcca8('0x25')][_0xcca8('0x27')]?_0x14bdec[_0xcca8('0x25')]:_0x33c369[_0xcca8('0x24')];if(_0x598e41[_0xcca8('0x22')][_0xcca8('0x3c')]){_0x14bdec['include']=[{'all':!![]}];}_0x14bdec=_[_0xcca8('0x2f')]({},_0x14bdec,_0x598e41['options']);return db[_0xcca8('0x1c')][_0xcca8('0x3d')](_0x14bdec)[_0xcca8('0x14')](handleEntityNotFound(_0x1e182f,null))['then'](function(_0x59fd63){if(_0x59fd63[_0xcca8('0x34')]==='MicrosoftAzure'){var _0x4f6fe2=encryptor['decryptString'](_0x59fd63[_0xcca8('0x37')]);_0x59fd63[_0xcca8('0x37')]=maskClientSecret(_0x4f6fe2);}return _0x59fd63;})[_0xcca8('0x14')](respondWithResult(_0x1e182f,null))[_0xcca8('0x38')](handleError(_0x1e182f,null));};exports[_0xcca8('0x3e')]=function(_0x255a2f,_0x5d7214){if(!_0x255a2f[_0xcca8('0x3f')]['name'])throw new Error(_0xcca8('0x40'));if(!_0x255a2f[_0xcca8('0x3f')]['service'])throw new Error(_0xcca8('0x41'));var _0x5b7718=db['CloudProvider'][_0xcca8('0x1d')][_0xcca8('0x34')]['values'];if(!_0x5b7718[_0xcca8('0x42')](_0x255a2f[_0xcca8('0x3f')][_0xcca8('0x34')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x5b7718[_0xcca8('0x43')](',\x20'));if(_0x255a2f[_0xcca8('0x3f')][_0xcca8('0x34')]==='MicrosoftAzure'&&_0x255a2f[_0xcca8('0x3f')][_0xcca8('0x37')]){_0x255a2f[_0xcca8('0x3f')]['data3']=encryptor[_0xcca8('0x44')](_0x255a2f[_0xcca8('0x3f')]['data3']);}return db['CloudProvider']['create'](_0x255a2f[_0xcca8('0x3f')],{})[_0xcca8('0x14')](respondWithResult(_0x5d7214,0xc9))[_0xcca8('0x38')](handleError(_0x5d7214,null));};exports[_0xcca8('0x13')]=function(_0xc903d2,_0x5e03e5){if(_0xc903d2['body']['id']){delete _0xc903d2[_0xcca8('0x3f')]['id'];}return db[_0xcca8('0x1c')][_0xcca8('0x3d')]({'where':{'id':_0xc903d2[_0xcca8('0x3a')]['id']}})[_0xcca8('0x14')](handleEntityNotFound(_0x5e03e5,null))[_0xcca8('0x14')](function(_0x9ad335){if(_0x9ad335[_0xcca8('0x34')]===_0xcca8('0x35')&&_0xc903d2[_0xcca8('0x3f')][_0xcca8('0x37')]){_0xc903d2[_0xcca8('0x3f')][_0xcca8('0x37')]=encryptor[_0xcca8('0x44')](_0xc903d2[_0xcca8('0x3f')][_0xcca8('0x37')]);}return _0x9ad335;})[_0xcca8('0x14')](saveUpdates(_0xc903d2[_0xcca8('0x3f')],null))[_0xcca8('0x14')](respondWithResult(_0x5e03e5,null))[_0xcca8('0x38')](handleError(_0x5e03e5,null));};exports[_0xcca8('0x15')]=function(_0x2a2312,_0x19b266){return db[_0xcca8('0x1c')][_0xcca8('0x3d')]({'where':{'id':_0x2a2312[_0xcca8('0x3a')]['id']}})[_0xcca8('0x14')](handleEntityNotFound(_0x19b266,null))['then'](removeEntity(_0x19b266,null))[_0xcca8('0x38')](handleError(_0x19b266,null));};exports[_0xcca8('0x45')]=function(_0x4aa6e1,_0x34a944){return db[_0xcca8('0x1c')][_0xcca8('0x46')]({'where':{'id':_0x4aa6e1[_0xcca8('0x3a')]['id']},'raw':!![]})['then'](function(_0x348125){if(!_0x348125)return _0x34a944[_0xcca8('0x9')](0x194);return{'url':oauth[_0xcca8('0x47')](_0x348125,_0x4aa6e1['user']['id'])};})[_0xcca8('0x14')](respondWithResult(_0x34a944,null))['catch'](handleError(_0x34a944,null));};exports[_0xcca8('0x48')]=function(_0x51b1fd,_0x2806d1){var _0x1abefa=_0x51b1fd[_0xcca8('0x3f')];var _0x232d53;var _0x5a4fcf;if(_0x1abefa[_0xcca8('0x16')])throw _0x1abefa;redis[_0xcca8('0x49')](_0x1abefa[_0xcca8('0x4a')])['then'](function(_0xba8b76){if(!_0xba8b76)throw new Error(_0xcca8('0x4b'));_0x232d53=JSON['parse'](_0xba8b76);var _0x470cc3=Buffer[_0xcca8('0x4c')](_0x1abefa[_0xcca8('0x4a')],'base64')['toString'](_0xcca8('0x4d'));_0x5a4fcf=JSON[_0xcca8('0x4e')](_0x470cc3);if(!oauth[_0xcca8('0x4f')](_0x1abefa[_0xcca8('0x50')],_0x232d53[_0xcca8('0x51')]))throw new Error(_0xcca8('0x52'));redis[_0xcca8('0x53')](_0x1abefa[_0xcca8('0x4a')]);return oauth['getOauth2MicrosoftAccessToken'](_0x1abefa[_0xcca8('0x54')],_0x232d53);})[_0xcca8('0x14')](function(_0x4dcca6){_0x232d53[_0xcca8('0x55')]=_0x4dcca6[_0xcca8('0x56')];_0x232d53[_0xcca8('0x57')]=_0x4dcca6[_0xcca8('0x58')];return db['CloudProvider'][_0xcca8('0x13')]({'data5':_0x232d53[_0xcca8('0x55')],'data6':_0x232d53[_0xcca8('0x57')]},{'where':{'id':_0x232d53['id']}});})[_0xcca8('0x14')](function(){oauth[_0xcca8('0x59')](_0x232d53);socket[_0xcca8('0x5a')](_0xcca8('0x5b'),{'id':_0x5a4fcf['id']});return;})[_0xcca8('0x14')](respondWithStatusCode(_0x2806d1,null))[_0xcca8('0x38')](function(_0xeb321d){if(_0x5a4fcf){socket[_0xcca8('0x5a')](_0xcca8('0x5c'),{'id':_0x5a4fcf['id']});}if(!_0x232d53){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0xeb321d);return _0x2806d1['status'](0x1f4)[_0xcca8('0x18')](_0xeb321d[_0xcca8('0x5d')]);}logger[_0xcca8('0x16')](_0xcca8('0x5e'),_0x232d53['id'],JSON[_0xcca8('0x5f')](_0xeb321d));});};
\ No newline at end of file
+var _0xd510=['data5','access_token','data6','refresh_token','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','then','end','sendStatus','stack','name','send','padEnd','slice','index','map','fieldName','query','keys','filters','attributes','intersection','model','fields','length','order','sort','where','filter','merge','options','CloudProvider','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','show','params','find','catch','create','body','Name\x20parameter\x20not\x20specified','rawAttributes','values','includes','join','encryptString','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','error','get','state','Invalid\x20state\x20parameter','parse','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','code'];(function(_0x52e765,_0xf4bd2e){var _0x53cf83=function(_0xc1fb68){while(--_0xc1fb68){_0x52e765['push'](_0x52e765['shift']());}};_0x53cf83(++_0xf4bd2e);}(_0xd510,0xbc));var _0x0d51=function(_0x45b4c3,_0xf3dc72){_0x45b4c3=_0x45b4c3-0x0;var _0x54e82c=_0xd510[_0x45b4c3];return _0x54e82c;};'use strict';var _=require(_0x0d51('0x0'));var Redis=require(_0x0d51('0x1'));var qs=require(_0x0d51('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x0d51('0x3'));var logger=require(_0x0d51('0x4'))(_0x0d51('0x5'));var db=require(_0x0d51('0x6'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x0d51('0x7')]=_[_0x0d51('0x8')](config[_0x0d51('0x7')],{'host':_0x0d51('0x9'),'port':0x18eb});var socket=require(_0x0d51('0xa'))(new Redis(config[_0x0d51('0x7')]));var redis=new Redis(config[_0x0d51('0x7')]);function respondWithStatusCode(_0x193441,_0x4d02ce){_0x4d02ce=_0x4d02ce||0xcc;return function(_0x197fe7){if(_0x197fe7){return _0x193441['sendStatus'](_0x4d02ce);}return _0x193441[_0x0d51('0xb')](_0x4d02ce)['end']();};}function respondWithResult(_0x426d1e,_0x34dd5f){_0x34dd5f=_0x34dd5f||0xc8;return function(_0x1792a3){if(_0x1792a3){return _0x426d1e[_0x0d51('0xb')](_0x34dd5f)['json'](_0x1792a3);}};}function respondWithFilteredResult(_0x4e5df1,_0x5c489d){return function(_0x217402){if(_0x217402){var _0x410390=typeof _0x5c489d[_0x0d51('0xc')]===_0x0d51('0xd')&&typeof _0x5c489d[_0x0d51('0xe')]==='undefined';var _0x5b9f83=_0x217402['count'];var _0x509aa6=_0x410390?0x0:_0x5c489d[_0x0d51('0xc')];var _0x16b3db=_0x410390?_0x217402[_0x0d51('0xf')]:_0x5c489d[_0x0d51('0xc')]+_0x5c489d[_0x0d51('0xe')];var _0x3331da;if(_0x16b3db>=_0x5b9f83){_0x16b3db=_0x5b9f83;_0x3331da=0xc8;}else{_0x3331da=0xce;}_0x4e5df1[_0x0d51('0xb')](_0x3331da);return _0x4e5df1[_0x0d51('0x10')](_0x0d51('0x11'),_0x509aa6+'-'+_0x16b3db+'/'+_0x5b9f83)[_0x0d51('0x12')](_0x217402);}return null;};}function saveUpdates(_0x423c56){return function(_0x241741){if(_0x241741){return _0x241741[_0x0d51('0x13')](_0x423c56)['then'](function(_0x2d1356){return _0x2d1356;});}return null;};}function removeEntity(_0x5463a5){return function(_0x1bd20f){if(_0x1bd20f){return _0x1bd20f[_0x0d51('0x14')]()[_0x0d51('0x15')](function(){_0x5463a5[_0x0d51('0xb')](0xcc)[_0x0d51('0x16')]();});}};}function handleEntityNotFound(_0x2f0a97){return function(_0x53ad76){if(!_0x53ad76){_0x2f0a97[_0x0d51('0x17')](0x194);}return _0x53ad76;};}function handleError(_0x32882c,_0x5e462d){_0x5e462d=_0x5e462d||0x1f4;return function(_0x5ef0cf){logger['error'](_0x5ef0cf[_0x0d51('0x18')]);if(_0x5ef0cf[_0x0d51('0x19')]){delete _0x5ef0cf[_0x0d51('0x19')];}_0x32882c[_0x0d51('0xb')](_0x5e462d)[_0x0d51('0x1a')](_0x5ef0cf);};}function maskClientSecret(_0x10b1d5){return _[_0x0d51('0x1b')](_0x10b1d5[_0x0d51('0x1c')](0x0,0x3),0x14,'*');}exports[_0x0d51('0x1d')]=function(_0x1916f2,_0x532e46){var _0x4f3666={},_0x1b8e55={},_0x4901ab={'count':0x0,'rows':[]};var _0x46fefb=_[_0x0d51('0x1e')](db['CloudProvider']['rawAttributes'],function(_0x523c29){return{'name':_0x523c29[_0x0d51('0x1f')],'type':_0x523c29['type']['key']};});_0x1b8e55['model']=_[_0x0d51('0x1e')](_0x46fefb,'name');_0x1b8e55[_0x0d51('0x20')]=_[_0x0d51('0x21')](_0x1916f2[_0x0d51('0x20')]);_0x1b8e55[_0x0d51('0x22')]=_['intersection'](_0x1b8e55['model'],_0x1b8e55[_0x0d51('0x20')]);_0x4f3666[_0x0d51('0x23')]=_[_0x0d51('0x24')](_0x1b8e55[_0x0d51('0x25')],qs[_0x0d51('0x26')](_0x1916f2[_0x0d51('0x20')][_0x0d51('0x26')]));_0x4f3666[_0x0d51('0x23')]=_0x4f3666[_0x0d51('0x23')][_0x0d51('0x27')]?_0x4f3666[_0x0d51('0x23')]:_0x1b8e55[_0x0d51('0x25')];if(!_0x1916f2[_0x0d51('0x20')]['hasOwnProperty']('nolimit')){_0x4f3666[_0x0d51('0xe')]=qs[_0x0d51('0xe')](_0x1916f2[_0x0d51('0x20')]['limit']);_0x4f3666[_0x0d51('0xc')]=qs[_0x0d51('0xc')](_0x1916f2[_0x0d51('0x20')][_0x0d51('0xc')]);}_0x4f3666[_0x0d51('0x28')]=qs['sort'](_0x1916f2[_0x0d51('0x20')][_0x0d51('0x29')]);_0x4f3666[_0x0d51('0x2a')]=qs['filters'](_['pick'](_0x1916f2[_0x0d51('0x20')],_0x1b8e55[_0x0d51('0x22')]),_0x46fefb);if(_0x1916f2[_0x0d51('0x20')][_0x0d51('0x2b')]){_0x4f3666[_0x0d51('0x2a')]=_[_0x0d51('0x2c')](_0x4f3666[_0x0d51('0x2a')],{'$or':_[_0x0d51('0x1e')](_0x46fefb,function(_0x308d08){if(_0x308d08['type']!=='VIRTUAL'){var _0x2cf09c={};_0x2cf09c[_0x308d08[_0x0d51('0x19')]]={'$like':'%'+_0x1916f2[_0x0d51('0x20')][_0x0d51('0x2b')]+'%'};return _0x2cf09c;}})});}_0x4f3666=_[_0x0d51('0x2c')]({},_0x4f3666,_0x1916f2[_0x0d51('0x2d')]);var _0x389b2b={'where':_0x4f3666[_0x0d51('0x2a')]};return db[_0x0d51('0x2e')][_0x0d51('0xf')](_0x389b2b)['then'](function(_0x5afd67){_0x4901ab[_0x0d51('0xf')]=_0x5afd67;if(_0x1916f2[_0x0d51('0x20')][_0x0d51('0x2f')]){_0x4f3666[_0x0d51('0x30')]=[{'all':!![]}];}return db[_0x0d51('0x2e')][_0x0d51('0x31')](_0x4f3666);})[_0x0d51('0x15')](function(_0x4d1b99){_0x4901ab[_0x0d51('0x32')]=_[_0x0d51('0x1e')](_0x4d1b99,function(_0x1fcbde){if(_0x1fcbde[_0x0d51('0x33')]===_0x0d51('0x34')){var _0x44ff71=encryptor[_0x0d51('0x35')](_0x1fcbde[_0x0d51('0x36')]);_0x1fcbde[_0x0d51('0x36')]=maskClientSecret(_0x44ff71);}return _0x1fcbde;});return _0x4901ab;})['then'](respondWithFilteredResult(_0x532e46,_0x4f3666))['catch'](handleError(_0x532e46,null));};exports[_0x0d51('0x37')]=function(_0x3d9474,_0x44f51b){var _0xea98e={'raw':!![],'where':{'id':_0x3d9474[_0x0d51('0x38')]['id']}},_0x3d4b82={};_0x3d4b82[_0x0d51('0x25')]=_['keys'](db[_0x0d51('0x2e')]['rawAttributes']);_0x3d4b82[_0x0d51('0x20')]=_[_0x0d51('0x21')](_0x3d9474[_0x0d51('0x20')]);_0x3d4b82[_0x0d51('0x22')]=_[_0x0d51('0x24')](_0x3d4b82[_0x0d51('0x25')],_0x3d4b82[_0x0d51('0x20')]);_0xea98e[_0x0d51('0x23')]=_[_0x0d51('0x24')](_0x3d4b82[_0x0d51('0x25')],qs[_0x0d51('0x26')](_0x3d9474[_0x0d51('0x20')][_0x0d51('0x26')]));_0xea98e[_0x0d51('0x23')]=_0xea98e['attributes'][_0x0d51('0x27')]?_0xea98e['attributes']:_0x3d4b82[_0x0d51('0x25')];if(_0x3d9474['query'][_0x0d51('0x2f')]){_0xea98e[_0x0d51('0x30')]=[{'all':!![]}];}_0xea98e=_['merge']({},_0xea98e,_0x3d9474[_0x0d51('0x2d')]);return db[_0x0d51('0x2e')][_0x0d51('0x39')](_0xea98e)[_0x0d51('0x15')](handleEntityNotFound(_0x44f51b,null))['then'](function(_0x528c16){if(_0x528c16[_0x0d51('0x33')]===_0x0d51('0x34')){var _0x54a4c9=encryptor['decryptString'](_0x528c16[_0x0d51('0x36')]);_0x528c16['data3']=maskClientSecret(_0x54a4c9);}return _0x528c16;})['then'](respondWithResult(_0x44f51b,null))[_0x0d51('0x3a')](handleError(_0x44f51b,null));};exports[_0x0d51('0x3b')]=function(_0x44cc99,_0x53ef04){if(!_0x44cc99[_0x0d51('0x3c')][_0x0d51('0x19')])throw new Error(_0x0d51('0x3d'));if(!_0x44cc99['body'][_0x0d51('0x33')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x3b892d=db[_0x0d51('0x2e')][_0x0d51('0x3e')][_0x0d51('0x33')][_0x0d51('0x3f')];if(!_0x3b892d[_0x0d51('0x40')](_0x44cc99[_0x0d51('0x3c')][_0x0d51('0x33')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x3b892d[_0x0d51('0x41')](',\x20'));if(_0x44cc99['body'][_0x0d51('0x33')]===_0x0d51('0x34')&&_0x44cc99[_0x0d51('0x3c')][_0x0d51('0x36')]){_0x44cc99[_0x0d51('0x3c')][_0x0d51('0x36')]=encryptor[_0x0d51('0x42')](_0x44cc99[_0x0d51('0x3c')][_0x0d51('0x36')]);}return db['CloudProvider'][_0x0d51('0x3b')](_0x44cc99[_0x0d51('0x3c')],{})[_0x0d51('0x15')](respondWithResult(_0x53ef04,0xc9))[_0x0d51('0x3a')](handleError(_0x53ef04,null));};exports[_0x0d51('0x13')]=function(_0x3d9334,_0x13ff80){if(_0x3d9334[_0x0d51('0x3c')]['id']){delete _0x3d9334[_0x0d51('0x3c')]['id'];}return db[_0x0d51('0x2e')][_0x0d51('0x39')]({'where':{'id':_0x3d9334[_0x0d51('0x38')]['id']}})[_0x0d51('0x15')](handleEntityNotFound(_0x13ff80,null))[_0x0d51('0x15')](function(_0x2b86e5){if(_0x2b86e5[_0x0d51('0x33')]===_0x0d51('0x34')&&_0x3d9334['body'][_0x0d51('0x36')]){_0x3d9334[_0x0d51('0x3c')]['data3']=encryptor[_0x0d51('0x42')](_0x3d9334['body'][_0x0d51('0x36')]);}return _0x2b86e5;})['then'](saveUpdates(_0x3d9334['body'],null))['then'](respondWithResult(_0x13ff80,null))[_0x0d51('0x3a')](handleError(_0x13ff80,null));};exports[_0x0d51('0x14')]=function(_0x37f0f2,_0x4b3fa9){return db[_0x0d51('0x2e')][_0x0d51('0x39')]({'where':{'id':_0x37f0f2[_0x0d51('0x38')]['id']}})[_0x0d51('0x15')](handleEntityNotFound(_0x4b3fa9,null))[_0x0d51('0x15')](removeEntity(_0x4b3fa9,null))[_0x0d51('0x3a')](handleError(_0x4b3fa9,null));};exports[_0x0d51('0x43')]=function(_0x345b84,_0x5fb260){return db[_0x0d51('0x2e')]['findOne']({'where':{'id':_0x345b84['params']['id']},'raw':!![]})[_0x0d51('0x15')](function(_0x21b1a9){if(!_0x21b1a9)return _0x5fb260['sendStatus'](0x194);return{'url':oauth[_0x0d51('0x44')](_0x21b1a9,_0x345b84[_0x0d51('0x45')]['id'])};})['then'](respondWithResult(_0x5fb260,null))['catch'](handleError(_0x5fb260,null));};exports['oauth2MicrosoftCallback']=function(_0x263bdc,_0x25952b){var _0x2ec994=_0x263bdc[_0x0d51('0x3c')];var _0x4d633f;var _0x4171d1;if(_0x2ec994[_0x0d51('0x46')])throw _0x2ec994;redis[_0x0d51('0x47')](_0x2ec994[_0x0d51('0x48')])['then'](function(_0x3c91b9){if(!_0x3c91b9)throw new Error(_0x0d51('0x49'));_0x4d633f=JSON[_0x0d51('0x4a')](_0x3c91b9);var _0x9905f4=Buffer['from'](_0x2ec994['state'],_0x0d51('0x4b'))[_0x0d51('0x4c')](_0x0d51('0x4d'));_0x4171d1=JSON[_0x0d51('0x4a')](_0x9905f4);if(!oauth[_0x0d51('0x4e')](_0x2ec994['id_token'],_0x4d633f[_0x0d51('0x4f')]))throw new Error(_0x0d51('0x50'));redis['del'](_0x2ec994[_0x0d51('0x48')]);return oauth['getOauth2MicrosoftAccessToken'](_0x2ec994[_0x0d51('0x51')],_0x4d633f);})[_0x0d51('0x15')](function(_0x281954){_0x4d633f[_0x0d51('0x52')]=_0x281954[_0x0d51('0x53')];_0x4d633f[_0x0d51('0x54')]=_0x281954[_0x0d51('0x55')];return db[_0x0d51('0x2e')][_0x0d51('0x13')]({'data5':_0x4d633f[_0x0d51('0x52')],'data6':_0x4d633f[_0x0d51('0x54')]},{'where':{'id':_0x4d633f['id']}});})[_0x0d51('0x15')](function(){oauth['startRefreshInterval'](_0x4d633f);socket['emit'](_0x0d51('0x56'),{'id':_0x4171d1['id']});return;})[_0x0d51('0x15')](respondWithStatusCode(_0x25952b,null))['catch'](function(_0x1556b6){if(_0x4171d1){socket['emit']('microsoftAuthorization:error',{'id':_0x4171d1['id']});}if(!_0x4d633f){logger[_0x0d51('0x46')](_0x0d51('0x57'),_0x1556b6);return _0x25952b['status'](0x1f4)[_0x0d51('0x1a')](_0x1556b6[_0x0d51('0x58')]);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x4d633f['id'],JSON[_0x0d51('0x59')](_0x1556b6));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 4a107c8..9ae779a 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 _0xd867=['./cloudProvider.attributes','exports','define','CloudProvider','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment'];(function(_0x467180,_0x44b5c6){var _0x573b61=function(_0x48df01){while(--_0x48df01){_0x467180['push'](_0x467180['shift']());}};_0x573b61(++_0x44b5c6);}(_0xd867,0x1bc));var _0x7d86=function(_0x24c63a,_0x3017dd){_0x24c63a=_0x24c63a-0x0;var _0x27e88e=_0xd867[_0x24c63a];return _0x27e88e;};'use strict';var _=require(_0x7d86('0x0'));var util=require(_0x7d86('0x1'));var logger=require(_0x7d86('0x2'))(_0x7d86('0x3'));var moment=require('moment');var BPromise=require(_0x7d86('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7d86('0x5'));var config=require(_0x7d86('0x6'));var attributes=require(_0x7d86('0x7'));module[_0x7d86('0x8')]=function(_0x23481a,_0x3db015){return _0x23481a[_0x7d86('0x9')](_0x7d86('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x04b0=['./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x4595d7,_0x1edd92){var _0x1762b3=function(_0x135c90){while(--_0x135c90){_0x4595d7['push'](_0x4595d7['shift']());}};_0x1762b3(++_0x1edd92);}(_0x04b0,0x1c7));var _0x004b=function(_0x26071e,_0x557941){_0x26071e=_0x26071e-0x0;var _0x2b9c70=_0x04b0[_0x26071e];return _0x2b9c70;};'use strict';var _=require(_0x004b('0x0'));var util=require('util');var logger=require(_0x004b('0x1'))(_0x004b('0x2'));var moment=require('moment');var BPromise=require(_0x004b('0x3'));var rp=require(_0x004b('0x4'));var fs=require('fs');var path=require(_0x004b('0x5'));var rimraf=require(_0x004b('0x6'));var config=require('../../config/environment');var attributes=require(_0x004b('0x7'));module['exports']=function(_0x2a93ed,_0x33b789){return _0x2a93ed[_0x004b('0x8')](_0x004b('0x9'),attributes,{'tableName':_0x004b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 79aaf15..616630f 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 _0x8143=['response_mode','form_post','scope','state','nonce','map','key','oauth2Claims','oauth2/','payload','iss','issuer','aud','audience','isAfter','exp','then','data3','CloudProvider','findOne','refresh_token','data6','data4','decryptString','replace','data5','update','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','findAll','all','catch','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','type','Dynamics365','push','/.default','Outlook365','data7','{TENANT_ID}','data2','code','id_token','from','stringify','base64','randomBytes','toString','hex','client_id','data1','join'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x8143,0x73));var _0x3814=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x8143[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x3814('0x0'));var crypto=require('crypto');var jwt=require(_0x3814('0x1'));var moment=require('moment');var Redis=require(_0x3814('0x2'));var rp=require('request-promise');var util=require(_0x3814('0x3'));var encryptor=require(_0x3814('0x4'));var config=require(_0x3814('0x5'));var logger=require(_0x3814('0x6'))(_0x3814('0x7'));var schedule=require(_0x3814('0x8'));var db=require(_0x3814('0x9'))['db'];config[_0x3814('0xa')]=_[_0x3814('0xb')](config[_0x3814('0xa')],{'host':_0x3814('0xc'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x3814('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x3814('0xe'),_0x3814('0xf'),'email',_0x3814('0x10'),_0x3814('0x11'),_0x3814('0x12'),_0x3814('0x13')],'Dynamics365':[_0x3814('0xe'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4e93c6){var _0x29afce=_['map'](AZURE_AUTH_SCOPES[_0x4e93c6['type']]);if(_0x4e93c6[_0x3814('0x14')]===_0x3814('0x15'))_0x29afce[_0x3814('0x16')](_0x4e93c6['data7']+_0x3814('0x17'));return _0x29afce['join']('\x20');}function getAccessTokenScope(_0x126652){if(_0x126652['type']===_0x3814('0x18'))return _0x3814('0x11');if(_0x126652[_0x3814('0x14')]===_0x3814('0x15'))return _0x126652[_0x3814('0x19')]+_0x3814('0x17');}function generateMicrosoftAuthorizationUrl(_0x55bf86,_0x5cc6ef){var _0x4ed6bd=MICROSOFT_AUTH_URL['replace'](_0x3814('0x1a'),_0x55bf86[_0x3814('0x1b')]);var _0xfc2486=[_0x3814('0x1c'),_0x3814('0x1d')];var _0x4c2df5=Buffer[_0x3814('0x1e')](JSON[_0x3814('0x1f')]({'id':_0x5cc6ef}))['toString'](_0x3814('0x20'));var _0x58dd48=crypto[_0x3814('0x21')](0x10)[_0x3814('0x22')](_0x3814('0x23'));var _0x4aa74d=getAuthorizationScopes(_0x55bf86);var _0x120362=[{'key':_0x3814('0x24'),'value':_0x55bf86[_0x3814('0x25')]},{'key':'response_type','value':encodeURIComponent(_0xfc2486[_0x3814('0x26')]('\x20'))},{'key':'redirect_uri','value':_0x55bf86['data4']},{'key':_0x3814('0x27'),'value':_0x3814('0x28')},{'key':_0x3814('0x29'),'value':encodeURIComponent(_0x4aa74d)},{'key':_0x3814('0x2a'),'value':_0x4c2df5},{'key':_0x3814('0x2b'),'value':_0x58dd48},{'key':'prompt','value':'login'}];var _0x2700d0=_0x4ed6bd+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x3814('0x2c')](_0x120362,function(_0x4f6b54){return _0x4f6b54[_0x3814('0x2d')]+'='+_0x4f6b54['value'];})['join']('&');_0x55bf86[_0x3814('0x2e')]={'issuer':_0x4ed6bd['replace'](_0x3814('0x2f'),''),'audience':_0x55bf86[_0x3814('0x25')],'state':_0x4c2df5,'nonce':_0x58dd48};redis['set'](_0x4c2df5,JSON[_0x3814('0x1f')](_0x55bf86));return _0x2700d0;}function isValidIdToken(_0x29cca2,_0x1530d7){try{var _0x3d40c8=jwt['decode'](_0x29cca2,{'complete':!![]});var _0x4c864b=_0x3d40c8[_0x3814('0x30')];if(_0x4c864b[_0x3814('0x31')]!==_0x1530d7[_0x3814('0x32')])return![];if(_0x4c864b[_0x3814('0x33')]!==_0x1530d7[_0x3814('0x34')])return![];if(_0x4c864b[_0x3814('0x2b')]!==_0x1530d7[_0x3814('0x2b')])return![];if(moment()[_0x3814('0x35')](moment['unix'](_0x4c864b[_0x3814('0x36')])))return![];return!![];}catch(_0x54b461){throw _0x54b461;}}function refreshOauth2MicrosoftAccessToken(_0x53bf14){return Promise['resolve']()[_0x3814('0x37')](function(){if(_0x53bf14[_0x3814('0x38')])return _0x53bf14;return db[_0x3814('0x39')][_0x3814('0x3a')]({'where':{'id':_0x53bf14['id']},'raw':!![]});})[_0x3814('0x37')](function(_0x66e419){var _0x31e794={'grant_type':_0x3814('0x3b'),'refresh_token':_0x66e419[_0x3814('0x3c')],'scope':getAccessTokenScope(_0x66e419),'redirect_uri':_0x66e419[_0x3814('0x3d')],'client_id':_0x66e419[_0x3814('0x25')],'client_secret':encryptor[_0x3814('0x3e')](_0x66e419[_0x3814('0x38')])};var _0x27073f={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x3814('0x3f')]('{TENANT_ID}',_0x66e419['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x31e794,'json':!![]};return rp(_0x27073f);})['then'](function(_0x3f9d97){_0x53bf14[_0x3814('0x40')]=_0x3f9d97['access_token'];_0x53bf14[_0x3814('0x3c')]=_0x3f9d97[_0x3814('0x3b')];return db[_0x3814('0x39')][_0x3814('0x41')]({'data5':_0x53bf14[_0x3814('0x40')],'data6':_0x53bf14[_0x3814('0x3c')]},{'where':{'id':_0x53bf14['id']}});})[_0x3814('0x37')](function(){return _0x53bf14;})['catch'](function(_0x2239e1){logger['error'](_0x3814('0x42'),_0x53bf14['id'],_0x2239e1);});}function getOauth2MicrosoftAccessToken(_0x1e6e63,_0xe1d356){var _0x309c5a={'grant_type':_0x3814('0x43'),'code':_0x1e6e63,'scope':getAccessTokenScope(_0xe1d356),'redirect_uri':_0xe1d356[_0x3814('0x3d')],'client_id':_0xe1d356[_0x3814('0x25')],'client_secret':encryptor[_0x3814('0x3e')](_0xe1d356[_0x3814('0x38')])};var _0x468d8b={'method':_0x3814('0x44'),'uri':MICROSOFT_AUTH_URL[_0x3814('0x3f')](_0x3814('0x1a'),_0xe1d356[_0x3814('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x309c5a,'json':!![]};return rp(_0x468d8b);}function startRefreshInterval(_0x29423b){var _0x29ae83=schedule[_0x3814('0x45')];if(_0x29ae83[_0x29423b['id']])clearInterval(_0x29ae83[_0x29423b['id']]);_0x29ae83[_0x29423b['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x3814('0x46')](this,{'id':_0x29423b['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x3814('0x45')]=_0x29ae83;}function startAllRefreshIntervals(){return db[_0x3814('0x39')][_0x3814('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x3814('0x37')](function(_0x4325ac){var _0x5ac3ef=_0x4325ac[_0x3814('0x2c')](function(_0x43b7be){return refreshOauth2MicrosoftAccessToken(_0x43b7be)[_0x3814('0x37')](function(_0x2f91c7){startRefreshInterval(_0x2f91c7);});});return Promise[_0x3814('0x48')](_0x5ac3ef);})[_0x3814('0x49')](function(_0x16b8aa){var _0x480c8e=_0x16b8aa?util['inspect'](_0x16b8aa,{'showHidden':![],'depth':null}):'';logger[_0x3814('0x4a')](_0x3814('0x4b'),_0x480c8e);});}module[_0x3814('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x92c6=['oauth2/','data1','set','decode','payload','iss','aud','audience','isAfter','unix','exp','resolve','then','CloudProvider','findOne','refresh_token','data6','decryptString','data2','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data3','POST','intervals','bind','findAll','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','request-promise','util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','openid','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','code','from','stringify','toString','base64','randomBytes','hex','client_id','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','login','key','value','oauth2Claims'];(function(_0x4c8f99,_0x5511fa){var _0x14b98b=function(_0x258c33){while(--_0x258c33){_0x4c8f99['push'](_0x4c8f99['shift']());}};_0x14b98b(++_0x5511fa);}(_0x92c6,0x72));var _0x692c=function(_0x222659,_0x130f73){_0x222659=_0x222659-0x0;var _0x372310=_0x92c6[_0x222659];return _0x372310;};'use strict';var _=require(_0x692c('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require('ioredis');var rp=require(_0x692c('0x1'));var util=require(_0x692c('0x2'));var encryptor=require(_0x692c('0x3'));var config=require(_0x692c('0x4'));var logger=require('../../config/logger')(_0x692c('0x5'));var schedule=require(_0x692c('0x6'));var db=require(_0x692c('0x7'))['db'];config[_0x692c('0x8')]=_[_0x692c('0x9')](config[_0x692c('0x8')],{'host':_0x692c('0xa'),'port':0x18eb});var redis=new Redis(config[_0x692c('0x8')]);var MICROSOFT_AUTH_URL=_0x692c('0xb');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x692c('0xc'),_0x692c('0xd'),_0x692c('0xe'),_0x692c('0xf'),_0x692c('0x10'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x692c('0x11'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x692c('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0x692c('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2b647b){var _0x3e1096=_[_0x692c('0x14')](AZURE_AUTH_SCOPES[_0x2b647b[_0x692c('0x15')]]);if(_0x2b647b[_0x692c('0x15')]===_0x692c('0x16'))_0x3e1096[_0x692c('0x17')](_0x2b647b[_0x692c('0x18')]+_0x692c('0x19'));return _0x3e1096[_0x692c('0x1a')]('\x20');}function getAccessTokenScope(_0x861e3c){if(_0x861e3c[_0x692c('0x15')]===_0x692c('0x1b'))return _0x692c('0xf');if(_0x861e3c[_0x692c('0x15')]===_0x692c('0x16'))return _0x861e3c[_0x692c('0x18')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x39e599,_0x38431b){var _0x155a31=MICROSOFT_AUTH_URL[_0x692c('0x1c')](_0x692c('0x1d'),_0x39e599['data2']);var _0x8c5d33=[_0x692c('0x1e'),'id_token'];var _0x3e10b6=Buffer[_0x692c('0x1f')](JSON[_0x692c('0x20')]({'id':_0x38431b}))[_0x692c('0x21')](_0x692c('0x22'));var _0x1e8373=crypto[_0x692c('0x23')](0x10)[_0x692c('0x21')](_0x692c('0x24'));var _0x139df2=getAuthorizationScopes(_0x39e599);var _0x8605dd=[{'key':_0x692c('0x25'),'value':_0x39e599['data1']},{'key':_0x692c('0x26'),'value':encodeURIComponent(_0x8c5d33['join']('\x20'))},{'key':_0x692c('0x27'),'value':_0x39e599[_0x692c('0x28')]},{'key':_0x692c('0x29'),'value':_0x692c('0x2a')},{'key':_0x692c('0x2b'),'value':encodeURIComponent(_0x139df2)},{'key':_0x692c('0x2c'),'value':_0x3e10b6},{'key':_0x692c('0x2d'),'value':_0x1e8373},{'key':'prompt','value':_0x692c('0x2e')}];var _0x48fade=_0x155a31+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x8605dd,function(_0x49e333){return _0x49e333[_0x692c('0x2f')]+'='+_0x49e333[_0x692c('0x30')];})[_0x692c('0x1a')]('&');_0x39e599[_0x692c('0x31')]={'issuer':_0x155a31['replace'](_0x692c('0x32'),''),'audience':_0x39e599[_0x692c('0x33')],'state':_0x3e10b6,'nonce':_0x1e8373};redis[_0x692c('0x34')](_0x3e10b6,JSON['stringify'](_0x39e599));return _0x48fade;}function isValidIdToken(_0x4e361d,_0x418912){try{var _0x56b4c7=jwt[_0x692c('0x35')](_0x4e361d,{'complete':!![]});var _0x81de91=_0x56b4c7[_0x692c('0x36')];if(_0x81de91[_0x692c('0x37')]!==_0x418912['issuer'])return![];if(_0x81de91[_0x692c('0x38')]!==_0x418912[_0x692c('0x39')])return![];if(_0x81de91[_0x692c('0x2d')]!==_0x418912[_0x692c('0x2d')])return![];if(moment()[_0x692c('0x3a')](moment[_0x692c('0x3b')](_0x81de91[_0x692c('0x3c')])))return![];return!![];}catch(_0x3c18b9){throw _0x3c18b9;}}function refreshOauth2MicrosoftAccessToken(_0x39ea88){return Promise[_0x692c('0x3d')]()[_0x692c('0x3e')](function(){if(_0x39ea88['data3'])return _0x39ea88;return db[_0x692c('0x3f')][_0x692c('0x40')]({'where':{'id':_0x39ea88['id']},'raw':!![]});})[_0x692c('0x3e')](function(_0x54ca04){var _0x283b96={'grant_type':_0x692c('0x41'),'refresh_token':_0x54ca04[_0x692c('0x42')],'scope':getAccessTokenScope(_0x54ca04),'redirect_uri':_0x54ca04[_0x692c('0x28')],'client_id':_0x54ca04[_0x692c('0x33')],'client_secret':encryptor[_0x692c('0x43')](_0x54ca04['data3'])};var _0x437133={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x692c('0x1c')](_0x692c('0x1d'),_0x54ca04[_0x692c('0x44')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x283b96,'json':!![]};return rp(_0x437133);})[_0x692c('0x3e')](function(_0x100eef){_0x39ea88['data5']=_0x100eef[_0x692c('0x45')];_0x39ea88[_0x692c('0x42')]=_0x100eef[_0x692c('0x41')];return db['CloudProvider'][_0x692c('0x46')]({'data5':_0x39ea88['data5'],'data6':_0x39ea88[_0x692c('0x42')]},{'where':{'id':_0x39ea88['id']}});})['then'](function(){return _0x39ea88;})[_0x692c('0x47')](function(_0x28a158){logger['error'](_0x692c('0x48'),_0x39ea88['id'],_0x28a158);});}function getOauth2MicrosoftAccessToken(_0xa198f8,_0x22eb20){var _0x101ffe={'grant_type':_0x692c('0x49'),'code':_0xa198f8,'scope':getAccessTokenScope(_0x22eb20),'redirect_uri':_0x22eb20[_0x692c('0x28')],'client_id':_0x22eb20[_0x692c('0x33')],'client_secret':encryptor[_0x692c('0x43')](_0x22eb20[_0x692c('0x4a')])};var _0x408f40={'method':_0x692c('0x4b'),'uri':MICROSOFT_AUTH_URL[_0x692c('0x1c')](_0x692c('0x1d'),_0x22eb20['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x101ffe,'json':!![]};return rp(_0x408f40);}function startRefreshInterval(_0x2cb1bc){var _0x1a4f04=schedule[_0x692c('0x4c')];if(_0x1a4f04[_0x2cb1bc['id']])clearInterval(_0x1a4f04[_0x2cb1bc['id']]);_0x1a4f04[_0x2cb1bc['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x692c('0x4d')](this,{'id':_0x2cb1bc['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x692c('0x4c')]=_0x1a4f04;}function startAllRefreshIntervals(){return db[_0x692c('0x3f')][_0x692c('0x4e')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x4522cc){var _0xf3d1fa=_0x4522cc[_0x692c('0x14')](function(_0x3f56d0){return refreshOauth2MicrosoftAccessToken(_0x3f56d0)[_0x692c('0x3e')](function(_0xaab535){startRefreshInterval(_0xaab535);});});return Promise['all'](_0xf3d1fa);})[_0x692c('0x47')](function(_0x16d97e){var _0x54f354=_0x16d97e?util['inspect'](_0x16d97e,{'showHidden':![],'depth':null}):'';logger[_0x692c('0x4f')](_0x692c('0x50'),_0x54f354);});}module[_0x692c('0x51')]={'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 3588bd4..3d756ce 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 _0x896e=['CloudProvider,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x2bcdf4,_0x1a2f20){var _0x4a0f7a=function(_0x1e924f){while(--_0x1e924f){_0x2bcdf4['push'](_0x2bcdf4['shift']());}};_0x4a0f7a(++_0x1a2f20);}(_0x896e,0x1e9));var _0xe896=function(_0x122818,_0x4fab10){_0x122818=_0x122818-0x0;var _0x3d7e15=_0x896e[_0x122818];return _0x3d7e15;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('CloudProvider,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});}
\ No newline at end of file
+var _0xe34f=['result','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x3f25b2,_0x412bd4){var _0xd8caeb=function(_0x52d252){while(--_0x52d252){_0x3f25b2['push'](_0x3f25b2['shift']());}};_0xd8caeb(++_0x412bd4);}(_0xe34f,0xbc));var _0xfe34=function(_0x564e2b,_0x329da5){_0x564e2b=_0x564e2b-0x0;var _0x19d84e=_0xe34f[_0x564e2b];return _0x19d84e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfe34('0x0'));var fs=require('fs');var Redis=require(_0xfe34('0x1'));var db=require(_0xfe34('0x2'))['db'];var utils=require(_0xfe34('0x3'));var logger=require(_0xfe34('0x4'))(_0xfe34('0x5'));var config=require(_0xfe34('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfe34('0x7')][_0xfe34('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x195bcd,_0x3fe816,_0x25f17a){return new BPromise(function(_0x4fa1cd,_0x5cdc7e){return client[_0xfe34('0x9')](_0x195bcd,_0x25f17a)[_0xfe34('0xa')](function(_0x252ec7){logger[_0xfe34('0xb')](_0xfe34('0xc'),_0x3fe816,_0xfe34('0xd'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x3fe816,'request\x20sent',JSON['stringify'](_0x252ec7));if(_0x252ec7[_0xfe34('0xe')]){if(_0x252ec7[_0xfe34('0xe')]['code']===0x1f4){logger[_0xfe34('0xe')](_0xfe34('0xc'),_0x3fe816,_0x252ec7[_0xfe34('0xe')][_0xfe34('0xf')]);return _0x5cdc7e(_0x252ec7[_0xfe34('0xe')][_0xfe34('0xf')]);}logger['error'](_0xfe34('0xc'),_0x3fe816,_0x252ec7[_0xfe34('0xe')][_0xfe34('0xf')]);return _0x4fa1cd(_0x252ec7[_0xfe34('0xe')][_0xfe34('0xf')]);}else{logger['info'](_0xfe34('0xc'),_0x3fe816,_0xfe34('0xd'));_0x4fa1cd(_0x252ec7[_0xfe34('0x10')][_0xfe34('0xf')]);}})['catch'](function(_0x53b469){logger['error'](_0xfe34('0xc'),_0x3fe816,_0x53b469);_0x5cdc7e(_0x53b469);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 97aae92..f3649ed 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x4e4b9c,_0x5874d7){var _0x438597=function(_0xdc17fb){while(--_0xdc17fb){_0x4e4b9c['push'](_0x4e4b9c['shift']());}};_0x438597(++_0x5874d7);}(_0xdb28,0x106));var _0x8db2=function(_0x2034f2,_0x3c62e8){_0x2034f2=_0x2034f2-0x0;var _0x34947d=_0xdb28[_0x2034f2];return _0x34947d;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x5bb733,_0x2276bc){var _0x4291a2=function(_0x326053){while(--_0x326053){_0x5bb733['push'](_0x5bb733['shift']());}};_0x4291a2(++_0x2276bc);}(_0xadb5,0xad));var _0x5adb=function(_0x46583e,_0x10ffa4){_0x46583e=_0x46583e-0x0;var _0x549150=_0xadb5[_0x46583e];return _0x549150;};'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
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index aec1a49..711c7c4 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 _0x4278=['name','exports','STRING'];(function(_0x2bbab0,_0x26d5b1){var _0x2a0573=function(_0x1a6a70){while(--_0x1a6a70){_0x2bbab0['push'](_0x2bbab0['shift']());}};_0x2a0573(++_0x26d5b1);}(_0x4278,0x18d));var _0x8427=function(_0x4a7ea8,_0x29cf44){_0x4a7ea8=_0x4a7ea8-0x0;var _0x37d438=_0x4278[_0x4a7ea8];return _0x37d438;};'use strict';var Sequelize=require('sequelize');module[_0x8427('0x0')]={'name':{'type':Sequelize[_0x8427('0x1')],'unique':_0x8427('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x8427('0x1')]},'companyId':{'type':Sequelize[_0x8427('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x8427('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x8427('0x1')]},'postalCode':{'type':Sequelize[_0x8427('0x1')]},'city':{'type':Sequelize[_0x8427('0x1')]},'country':{'type':Sequelize[_0x8427('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x8427('0x1')]},'sStreet':{'type':Sequelize[_0x8427('0x1')]},'sPostalCode':{'type':Sequelize[_0x8427('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x8427('0x1')]},'description':{'type':Sequelize[_0x8427('0x1')]}};
\ No newline at end of file
+var _0xa421=['sequelize','exports','STRING','name'];(function(_0x8f9cf,_0x404bfe){var _0x2817e3=function(_0x3c2cf9){while(--_0x3c2cf9){_0x8f9cf['push'](_0x8f9cf['shift']());}};_0x2817e3(++_0x404bfe);}(_0xa421,0x1b8));var _0x1a42=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa421[_0x4fc9e6];return _0x551d28;};'use strict';var Sequelize=require(_0x1a42('0x0'));module[_0x1a42('0x1')]={'name':{'type':Sequelize[_0x1a42('0x2')],'unique':_0x1a42('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1a42('0x2')]},'companyId':{'type':Sequelize[_0x1a42('0x2')]},'website':{'type':Sequelize[_0x1a42('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x1a42('0x2')]},'type':{'type':Sequelize[_0x1a42('0x2')]},'street':{'type':Sequelize[_0x1a42('0x2')]},'postalCode':{'type':Sequelize[_0x1a42('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1a42('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x1a42('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x1a42('0x2')]},'sCountry':{'type':Sequelize[_0x1a42('0x2')]},'description':{'type':Sequelize[_0x1a42('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 0cb4a1c..f4392ac 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 _0x6c47=['fields','length','nolimit','sort','where','pick','filter','map','merge','includeAll','findAll','catch','show','params','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContact','ids','getContacts','findOne','rawAttributes','order','hasOwnProperty','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','get','Companies','destroy','then','end','stack','send','CmCompany','describe','model','keys','filters','intersection','query','attributes'];(function(_0x5b72d5,_0xf47723){var _0x2e8fb4=function(_0x397eff){while(--_0x397eff){_0x5b72d5['push'](_0x5b72d5['shift']());}};_0x2e8fb4(++_0xf47723);}(_0x6c47,0x1cc));var _0x76c4=function(_0x58c7a9,_0x4ef324){_0x58c7a9=_0x58c7a9-0x0;var _0x46c842=_0x6c47[_0x58c7a9];return _0x46c842;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x76c4('0x0'));var zipdir=require(_0x76c4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x76c4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x76c4('0x3'));var util=require(_0x76c4('0x4'));var path=require(_0x76c4('0x5'));var sox=require(_0x76c4('0x6'));var csv=require(_0x76c4('0x7'));var ejs=require(_0x76c4('0x8'));var fs=require('fs');var fs_extra=require(_0x76c4('0x9'));var _=require(_0x76c4('0xa'));var squel=require('squel');var crypto=require(_0x76c4('0xb'));var jsforce=require(_0x76c4('0xc'));var deskjs=require(_0x76c4('0xd'));var toCsv=require('to-csv');var querystring=require(_0x76c4('0xe'));var Papa=require(_0x76c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x76c4('0x10'));var hardwareService=require(_0x76c4('0x11'));var logger=require(_0x76c4('0x12'))(_0x76c4('0x13'));var utils=require(_0x76c4('0x14'));var config=require(_0x76c4('0x15'));var licenseUtil=require(_0x76c4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bf600,_0x423a5e){_0x423a5e=_0x423a5e||0xcc;return function(_0x1ecbc7){if(_0x1ecbc7){return _0x4bf600[_0x76c4('0x17')](_0x423a5e);}return _0x4bf600[_0x76c4('0x18')](_0x423a5e)['end']();};}function respondWithResult(_0x194557,_0x39654f){_0x39654f=_0x39654f||0xc8;return function(_0x205bd7){if(_0x205bd7){return _0x194557[_0x76c4('0x18')](_0x39654f)[_0x76c4('0x19')](_0x205bd7);}};}function respondWithFilteredResult(_0x2964e5,_0x25bfe2){return function(_0x175e02){if(_0x175e02){var _0xbcec6b=typeof _0x25bfe2[_0x76c4('0x1a')]===_0x76c4('0x1b')&&typeof _0x25bfe2[_0x76c4('0x1c')]===_0x76c4('0x1b');var _0x44de0e=_0x175e02['count'];var _0x4c293c=_0xbcec6b?0x0:_0x25bfe2[_0x76c4('0x1a')];var _0x293378=_0xbcec6b?_0x175e02[_0x76c4('0x1d')]:_0x25bfe2['offset']+_0x25bfe2[_0x76c4('0x1c')];var _0x3cb3ae;if(_0x293378>=_0x44de0e){_0x293378=_0x44de0e;_0x3cb3ae=0xc8;}else{_0x3cb3ae=0xce;}_0x2964e5['status'](_0x3cb3ae);return _0x2964e5[_0x76c4('0x1e')](_0x76c4('0x1f'),_0x4c293c+'-'+_0x293378+'/'+_0x44de0e)[_0x76c4('0x19')](_0x175e02);}return null;};}function patchUpdates(_0x34b92c){return function(_0x461a09){try{jsonpatch[_0x76c4('0x20')](_0x461a09,_0x34b92c,!![]);}catch(_0x211175){return BPromise[_0x76c4('0x21')](_0x211175);}return _0x461a09['save']();};}function saveUpdates(_0x2e422d,_0x1c449b){return function(_0x1fdfb1){if(_0x1fdfb1){return _0x1fdfb1[_0x76c4('0x22')](_0x2e422d)['then'](function(_0x475c56){return _0x475c56;});}return null;};}function removeEntity(_0x4335e4,_0x52e928){return function(_0x4cf7eb){if(_0x4cf7eb){return _0x4cf7eb['destroy']()['then'](function(){var _0x15a2ed=_0x4cf7eb[_0x76c4('0x23')]({'plain':!![]});var _0x53ba7c=_0x76c4('0x24');return db['UserProfileResource'][_0x76c4('0x25')]({'where':{'type':_0x53ba7c,'resourceId':_0x15a2ed['id']}})[_0x76c4('0x26')](function(){return _0x4cf7eb;});})['then'](function(){_0x4335e4[_0x76c4('0x18')](0xcc)[_0x76c4('0x27')]();});}};}function handleEntityNotFound(_0x553246,_0x49cd2f){return function(_0xf0a816){if(!_0xf0a816){_0x553246[_0x76c4('0x17')](0x194);}return _0xf0a816;};}function handleError(_0x2f4cb6,_0x35e417){_0x35e417=_0x35e417||0x1f4;return function(_0x489952){logger['error'](_0x489952[_0x76c4('0x28')]);if(_0x489952['name']){delete _0x489952['name'];}_0x2f4cb6[_0x76c4('0x18')](_0x35e417)[_0x76c4('0x29')](_0x489952);};}exports['index']=function(_0x40ed2a,_0x4dbad7){var _0x39e33f={},_0x3eb8b2={},_0x2c2f42={'count':0x0,'rows':[]};return db[_0x76c4('0x2a')][_0x76c4('0x2b')]()['then'](function(_0x2eccbb){_0x3eb8b2[_0x76c4('0x2c')]=_[_0x76c4('0x2d')](_0x2eccbb);_0x3eb8b2['query']=_['keys'](_0x40ed2a['query']);_0x3eb8b2[_0x76c4('0x2e')]=_[_0x76c4('0x2f')](_0x3eb8b2[_0x76c4('0x2c')],_0x3eb8b2[_0x76c4('0x30')]);_0x39e33f[_0x76c4('0x31')]=_[_0x76c4('0x2f')](_0x3eb8b2[_0x76c4('0x2c')],qs[_0x76c4('0x32')](_0x40ed2a[_0x76c4('0x30')][_0x76c4('0x32')]));_0x39e33f[_0x76c4('0x31')]=_0x39e33f[_0x76c4('0x31')][_0x76c4('0x33')]?_0x39e33f[_0x76c4('0x31')]:_0x3eb8b2['model'];if(!_0x40ed2a[_0x76c4('0x30')]['hasOwnProperty'](_0x76c4('0x34'))){_0x39e33f[_0x76c4('0x1c')]=qs['limit'](_0x40ed2a[_0x76c4('0x30')]['limit']);_0x39e33f[_0x76c4('0x1a')]=qs[_0x76c4('0x1a')](_0x40ed2a[_0x76c4('0x30')][_0x76c4('0x1a')]);}_0x39e33f['order']=qs['sort'](_0x40ed2a[_0x76c4('0x30')][_0x76c4('0x35')]);_0x39e33f[_0x76c4('0x36')]=qs[_0x76c4('0x2e')](_[_0x76c4('0x37')](_0x40ed2a[_0x76c4('0x30')],_0x3eb8b2[_0x76c4('0x2e')]),_0x2eccbb);if(_0x40ed2a[_0x76c4('0x30')][_0x76c4('0x38')]){_0x39e33f[_0x76c4('0x36')]=_['merge'](_0x39e33f[_0x76c4('0x36')],{'$or':_[_0x76c4('0x39')](_0x39e33f[_0x76c4('0x31')],function(_0x31211f){var _0x5300ab={};_0x5300ab[_0x31211f]={'$like':'%'+_0x40ed2a[_0x76c4('0x30')][_0x76c4('0x38')]+'%'};return _0x5300ab;})});}_0x39e33f=_[_0x76c4('0x3a')]({},_0x39e33f,_0x40ed2a['options']);var _0xee99d8={'where':_0x39e33f[_0x76c4('0x36')]};return db[_0x76c4('0x2a')][_0x76c4('0x1d')](_0xee99d8)[_0x76c4('0x26')](function(_0x81b05e){_0x2c2f42[_0x76c4('0x1d')]=_0x81b05e;if(_0x40ed2a[_0x76c4('0x30')][_0x76c4('0x3b')]){_0x39e33f['include']=[{'all':!![]}];}return db[_0x76c4('0x2a')][_0x76c4('0x3c')](_0x39e33f);})[_0x76c4('0x26')](function(_0x3a0080){_0x2c2f42['rows']=_0x3a0080;return _0x2c2f42;})['then'](respondWithFilteredResult(_0x4dbad7,_0x39e33f))[_0x76c4('0x3d')](handleError(_0x4dbad7,null));})[_0x76c4('0x3d')](handleError(_0x4dbad7,null));};exports[_0x76c4('0x3e')]=function(_0x1f92ca,_0x2f4740){var _0x56d488={'raw':![],'where':{'id':_0x1f92ca[_0x76c4('0x3f')]['id']}},_0x513098={};_0x513098[_0x76c4('0x2c')]=_[_0x76c4('0x2d')](db[_0x76c4('0x2a')]['rawAttributes']);_0x513098['query']=_[_0x76c4('0x2d')](_0x1f92ca['query']);_0x513098[_0x76c4('0x2e')]=_[_0x76c4('0x2f')](_0x513098[_0x76c4('0x2c')],_0x513098[_0x76c4('0x30')]);_0x56d488['attributes']=_[_0x76c4('0x2f')](_0x513098[_0x76c4('0x2c')],qs['fields'](_0x1f92ca[_0x76c4('0x30')][_0x76c4('0x32')]));_0x56d488[_0x76c4('0x31')]=_0x56d488[_0x76c4('0x31')][_0x76c4('0x33')]?_0x56d488['attributes']:_0x513098[_0x76c4('0x2c')];if(_0x1f92ca[_0x76c4('0x30')][_0x76c4('0x3b')]){_0x56d488[_0x76c4('0x40')]=[{'all':!![]}];}_0x56d488=_['merge']({},_0x56d488,_0x1f92ca[_0x76c4('0x41')]);return db[_0x76c4('0x2a')][_0x76c4('0x42')](_0x56d488)[_0x76c4('0x26')](handleEntityNotFound(_0x2f4740,null))[_0x76c4('0x26')](respondWithResult(_0x2f4740,null))[_0x76c4('0x3d')](handleError(_0x2f4740,null));};exports[_0x76c4('0x43')]=function(_0x45fa98,_0x21e2bd){return db[_0x76c4('0x2a')][_0x76c4('0x43')](_0x45fa98[_0x76c4('0x44')],{})[_0x76c4('0x26')](function(_0x5c0cff){var _0x41cfe0=_0x45fa98[_0x76c4('0x45')][_0x76c4('0x23')]({'plain':!![]});if(!_0x41cfe0)throw new Error(_0x76c4('0x46'));if(_0x41cfe0[_0x76c4('0x47')]==='user'){var _0x300cea=_0x5c0cff[_0x76c4('0x23')]({'plain':!![]});var _0x1f9f62=_0x76c4('0x24');return db[_0x76c4('0x48')][_0x76c4('0x42')]({'where':{'name':_0x1f9f62,'userProfileId':_0x41cfe0[_0x76c4('0x49')]},'raw':!![]})[_0x76c4('0x26')](function(_0x6241be){if(_0x6241be&&_0x6241be['autoAssociation']===0x0){return db[_0x76c4('0x4a')][_0x76c4('0x43')]({'name':_0x300cea[_0x76c4('0x4b')],'resourceId':_0x300cea['id'],'type':_0x6241be['name'],'sectionId':_0x6241be['id']},{})[_0x76c4('0x26')](function(){return _0x5c0cff;});}else{return _0x5c0cff;}})['catch'](function(_0x15de53){logger[_0x76c4('0x4c')](_0x76c4('0x4d'),_0x15de53);throw _0x15de53;});}return _0x5c0cff;})[_0x76c4('0x26')](respondWithResult(_0x21e2bd,0xc9))['catch'](handleError(_0x21e2bd,null));};exports[_0x76c4('0x22')]=function(_0x555feb,_0x58e403){if(_0x555feb[_0x76c4('0x44')]['id']){delete _0x555feb[_0x76c4('0x44')]['id'];}return db['CmCompany'][_0x76c4('0x42')]({'where':{'id':_0x555feb['params']['id']}})[_0x76c4('0x26')](handleEntityNotFound(_0x58e403,null))['then'](saveUpdates(_0x555feb['body'],null))[_0x76c4('0x26')](respondWithResult(_0x58e403,null))[_0x76c4('0x3d')](handleError(_0x58e403,null));};exports['destroy']=function(_0x1e45f4,_0x4cd0df){return db[_0x76c4('0x2a')]['find']({'where':{'id':_0x1e45f4[_0x76c4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4cd0df,null))['then'](removeEntity(_0x4cd0df,null))['catch'](handleError(_0x4cd0df,null));};exports[_0x76c4('0x2b')]=function(_0x1cda07,_0x2a7a3c){return db['CmCompany'][_0x76c4('0x2b')]()['then'](respondWithResult(_0x2a7a3c,null))[_0x76c4('0x3d')](handleError(_0x2a7a3c,null));};exports['addContacts']=function(_0x210e96,_0x37c229,_0x1fd91b){return db[_0x76c4('0x4e')][_0x76c4('0x42')]({'where':{'id':_0x210e96[_0x76c4('0x3f')]['id']}})[_0x76c4('0x26')](handleEntityNotFound(_0x37c229,null))[_0x76c4('0x26')](function(_0x389c45){if(_0x389c45){return _0x389c45['addContacts'](_0x210e96[_0x76c4('0x44')][_0x76c4('0x4f')],_['omit'](_0x210e96[_0x76c4('0x44')],[_0x76c4('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x37c229,null))[_0x76c4('0x3d')](handleError(_0x37c229,null));};exports[_0x76c4('0x50')]=function(_0x2f6c7d,_0x230935,_0x3a111a){var _0xcae341={};var _0x3c3405={};var _0x558878;var _0x1468f6;return db[_0x76c4('0x2a')][_0x76c4('0x51')]({'where':{'id':_0x2f6c7d['params']['id']}})[_0x76c4('0x26')](handleEntityNotFound(_0x230935,null))['then'](function(_0x5ee59){if(_0x5ee59){_0x558878=_0x5ee59;_0x3c3405[_0x76c4('0x2c')]=_['keys'](db[_0x76c4('0x4e')][_0x76c4('0x52')]);_0x3c3405[_0x76c4('0x30')]=_[_0x76c4('0x2d')](_0x2f6c7d[_0x76c4('0x30')]);_0x3c3405[_0x76c4('0x2e')]=_[_0x76c4('0x2f')](_0x3c3405['model'],_0x3c3405[_0x76c4('0x30')]);_0xcae341[_0x76c4('0x31')]=_[_0x76c4('0x2f')](_0x3c3405[_0x76c4('0x2c')],qs[_0x76c4('0x32')](_0x2f6c7d[_0x76c4('0x30')]['fields']));_0xcae341[_0x76c4('0x31')]=_0xcae341['attributes'][_0x76c4('0x33')]?_0xcae341[_0x76c4('0x31')]:_0x3c3405[_0x76c4('0x2c')];_0xcae341[_0x76c4('0x53')]=qs[_0x76c4('0x35')](_0x2f6c7d['query'][_0x76c4('0x35')]);_0xcae341[_0x76c4('0x36')]=qs[_0x76c4('0x2e')](_['pick'](_0x2f6c7d[_0x76c4('0x30')],_0x3c3405[_0x76c4('0x2e')]));if(_0x2f6c7d[_0x76c4('0x30')][_0x76c4('0x38')]){_0xcae341[_0x76c4('0x36')]=_['merge'](_0xcae341[_0x76c4('0x36')],{'$or':_['map'](_0xcae341[_0x76c4('0x31')],function(_0x50f7e5){var _0x208922={};_0x208922[_0x50f7e5]={'$like':'%'+_0x2f6c7d['query'][_0x76c4('0x38')]+'%'};return _0x208922;})});}_0xcae341=_[_0x76c4('0x3a')]({},_0xcae341,_0x2f6c7d['options']);return _0x558878[_0x76c4('0x50')](_0xcae341);}})[_0x76c4('0x26')](function(_0x27c5b9){if(_0x27c5b9){_0x1468f6=_0x27c5b9['length'];if(!_0x2f6c7d[_0x76c4('0x30')][_0x76c4('0x54')](_0x76c4('0x34'))){_0xcae341['limit']=qs[_0x76c4('0x1c')](_0x2f6c7d[_0x76c4('0x30')]['limit']);_0xcae341[_0x76c4('0x1a')]=qs['offset'](_0x2f6c7d[_0x76c4('0x30')][_0x76c4('0x1a')]);}return _0x558878['getContacts'](_0xcae341);}})['then'](function(_0x4b8c66){if(_0x4b8c66){return _0x4b8c66?{'count':_0x1468f6,'rows':_0x4b8c66}:null;}})[_0x76c4('0x26')](respondWithResult(_0x230935,null))[_0x76c4('0x3d')](handleError(_0x230935,null));};
\ No newline at end of file
+var _0x0c8e=['util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','get','Companies','then','sendStatus','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','map','merge','options','includeAll','rows','catch','rawAttributes','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','addContacts','ids','omit','getContacts','CmContact','nolimit','eml-format','rimraf','zip-dir','request-promise','mustache'];(function(_0x5e8c32,_0x1b1f3f){var _0x595f7b=function(_0x38840e){while(--_0x38840e){_0x5e8c32['push'](_0x5e8c32['shift']());}};_0x595f7b(++_0x1b1f3f);}(_0x0c8e,0x14b));var _0xe0c8=function(_0x545b11,_0x81555d){_0x545b11=_0x545b11-0x0;var _0x23a986=_0x0c8e[_0x545b11];return _0x23a986;};'use strict';var emlformat=require(_0xe0c8('0x0'));var rimraf=require(_0xe0c8('0x1'));var zipdir=require(_0xe0c8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0c8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe0c8('0x4'));var util=require(_0xe0c8('0x5'));var path=require('path');var sox=require(_0xe0c8('0x6'));var csv=require(_0xe0c8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe0c8('0x8'));var _=require(_0xe0c8('0x9'));var squel=require(_0xe0c8('0xa'));var crypto=require(_0xe0c8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe0c8('0xc'));var toCsv=require(_0xe0c8('0x7'));var querystring=require(_0xe0c8('0xd'));var Papa=require(_0xe0c8('0xe'));var Redis=require(_0xe0c8('0xf'));var authService=require(_0xe0c8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe0c8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe0c8('0x12'));var config=require(_0xe0c8('0x13'));var licenseUtil=require(_0xe0c8('0x14'));var db=require(_0xe0c8('0x15'))['db'];function respondWithStatusCode(_0x4031db,_0x5eae74){_0x5eae74=_0x5eae74||0xcc;return function(_0x16988f){if(_0x16988f){return _0x4031db['sendStatus'](_0x5eae74);}return _0x4031db['status'](_0x5eae74)[_0xe0c8('0x16')]();};}function respondWithResult(_0x1b6026,_0x21d2cf){_0x21d2cf=_0x21d2cf||0xc8;return function(_0x217dc8){if(_0x217dc8){return _0x1b6026[_0xe0c8('0x17')](_0x21d2cf)[_0xe0c8('0x18')](_0x217dc8);}};}function respondWithFilteredResult(_0x324ee3,_0x5dd758){return function(_0x4a988c){if(_0x4a988c){var _0x3ade55=typeof _0x5dd758['offset']===_0xe0c8('0x19')&&typeof _0x5dd758[_0xe0c8('0x1a')]===_0xe0c8('0x19');var _0x3cc509=_0x4a988c[_0xe0c8('0x1b')];var _0x496034=_0x3ade55?0x0:_0x5dd758[_0xe0c8('0x1c')];var _0x11f9c0=_0x3ade55?_0x4a988c[_0xe0c8('0x1b')]:_0x5dd758[_0xe0c8('0x1c')]+_0x5dd758['limit'];var _0x14f36d;if(_0x11f9c0>=_0x3cc509){_0x11f9c0=_0x3cc509;_0x14f36d=0xc8;}else{_0x14f36d=0xce;}_0x324ee3[_0xe0c8('0x17')](_0x14f36d);return _0x324ee3['set'](_0xe0c8('0x1d'),_0x496034+'-'+_0x11f9c0+'/'+_0x3cc509)[_0xe0c8('0x18')](_0x4a988c);}return null;};}function patchUpdates(_0x4ffc32){return function(_0x124be5){try{jsonpatch[_0xe0c8('0x1e')](_0x124be5,_0x4ffc32,!![]);}catch(_0x1d127c){return BPromise[_0xe0c8('0x1f')](_0x1d127c);}return _0x124be5[_0xe0c8('0x20')]();};}function saveUpdates(_0x58914e,_0x42155f){return function(_0x3d7b08){if(_0x3d7b08){return _0x3d7b08[_0xe0c8('0x21')](_0x58914e)['then'](function(_0x37e0f3){return _0x37e0f3;});}return null;};}function removeEntity(_0x1ce32c,_0x3f5769){return function(_0x5c969e){if(_0x5c969e){return _0x5c969e[_0xe0c8('0x22')]()['then'](function(){var _0x3834a3=_0x5c969e[_0xe0c8('0x23')]({'plain':!![]});var _0x2c3fd8=_0xe0c8('0x24');return db['UserProfileResource'][_0xe0c8('0x22')]({'where':{'type':_0x2c3fd8,'resourceId':_0x3834a3['id']}})[_0xe0c8('0x25')](function(){return _0x5c969e;});})[_0xe0c8('0x25')](function(){_0x1ce32c[_0xe0c8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bbc3d,_0x30e99b){return function(_0x5017f1){if(!_0x5017f1){_0x4bbc3d[_0xe0c8('0x26')](0x194);}return _0x5017f1;};}function handleError(_0x2db75f,_0x5cd8bc){_0x5cd8bc=_0x5cd8bc||0x1f4;return function(_0x49e593){logger[_0xe0c8('0x27')](_0x49e593[_0xe0c8('0x28')]);if(_0x49e593[_0xe0c8('0x29')]){delete _0x49e593['name'];}_0x2db75f[_0xe0c8('0x17')](_0x5cd8bc)[_0xe0c8('0x2a')](_0x49e593);};}exports[_0xe0c8('0x2b')]=function(_0x4af9cb,_0x5b8821){var _0x2e59d8={},_0x2ebcbe={},_0x2de83e={'count':0x0,'rows':[]};return db[_0xe0c8('0x2c')][_0xe0c8('0x2d')]()['then'](function(_0x2daa7a){_0x2ebcbe[_0xe0c8('0x2e')]=_[_0xe0c8('0x2f')](_0x2daa7a);_0x2ebcbe[_0xe0c8('0x30')]=_[_0xe0c8('0x2f')](_0x4af9cb[_0xe0c8('0x30')]);_0x2ebcbe[_0xe0c8('0x31')]=_[_0xe0c8('0x32')](_0x2ebcbe[_0xe0c8('0x2e')],_0x2ebcbe['query']);_0x2e59d8[_0xe0c8('0x33')]=_[_0xe0c8('0x32')](_0x2ebcbe['model'],qs[_0xe0c8('0x34')](_0x4af9cb[_0xe0c8('0x30')][_0xe0c8('0x34')]));_0x2e59d8['attributes']=_0x2e59d8[_0xe0c8('0x33')][_0xe0c8('0x35')]?_0x2e59d8[_0xe0c8('0x33')]:_0x2ebcbe[_0xe0c8('0x2e')];if(!_0x4af9cb[_0xe0c8('0x30')][_0xe0c8('0x36')]('nolimit')){_0x2e59d8[_0xe0c8('0x1a')]=qs[_0xe0c8('0x1a')](_0x4af9cb['query'][_0xe0c8('0x1a')]);_0x2e59d8['offset']=qs[_0xe0c8('0x1c')](_0x4af9cb['query'][_0xe0c8('0x1c')]);}_0x2e59d8[_0xe0c8('0x37')]=qs[_0xe0c8('0x38')](_0x4af9cb[_0xe0c8('0x30')][_0xe0c8('0x38')]);_0x2e59d8[_0xe0c8('0x39')]=qs['filters'](_[_0xe0c8('0x3a')](_0x4af9cb[_0xe0c8('0x30')],_0x2ebcbe[_0xe0c8('0x31')]),_0x2daa7a);if(_0x4af9cb[_0xe0c8('0x30')][_0xe0c8('0x3b')]){_0x2e59d8[_0xe0c8('0x39')]=_['merge'](_0x2e59d8[_0xe0c8('0x39')],{'$or':_[_0xe0c8('0x3c')](_0x2e59d8[_0xe0c8('0x33')],function(_0x4086dd){var _0x4302e6={};_0x4302e6[_0x4086dd]={'$like':'%'+_0x4af9cb[_0xe0c8('0x30')][_0xe0c8('0x3b')]+'%'};return _0x4302e6;})});}_0x2e59d8=_[_0xe0c8('0x3d')]({},_0x2e59d8,_0x4af9cb[_0xe0c8('0x3e')]);var _0x3e87e9={'where':_0x2e59d8['where']};return db[_0xe0c8('0x2c')][_0xe0c8('0x1b')](_0x3e87e9)[_0xe0c8('0x25')](function(_0x2e5de8){_0x2de83e[_0xe0c8('0x1b')]=_0x2e5de8;if(_0x4af9cb[_0xe0c8('0x30')][_0xe0c8('0x3f')]){_0x2e59d8['include']=[{'all':!![]}];}return db[_0xe0c8('0x2c')]['findAll'](_0x2e59d8);})[_0xe0c8('0x25')](function(_0x26572a){_0x2de83e[_0xe0c8('0x40')]=_0x26572a;return _0x2de83e;})['then'](respondWithFilteredResult(_0x5b8821,_0x2e59d8))[_0xe0c8('0x41')](handleError(_0x5b8821,null));})[_0xe0c8('0x41')](handleError(_0x5b8821,null));};exports['show']=function(_0x19c430,_0x2743df){var _0x1d639e={'raw':![],'where':{'id':_0x19c430['params']['id']}},_0x1c5838={};_0x1c5838['model']=_[_0xe0c8('0x2f')](db['CmCompany'][_0xe0c8('0x42')]);_0x1c5838[_0xe0c8('0x30')]=_[_0xe0c8('0x2f')](_0x19c430['query']);_0x1c5838[_0xe0c8('0x31')]=_['intersection'](_0x1c5838[_0xe0c8('0x2e')],_0x1c5838[_0xe0c8('0x30')]);_0x1d639e[_0xe0c8('0x33')]=_['intersection'](_0x1c5838['model'],qs[_0xe0c8('0x34')](_0x19c430[_0xe0c8('0x30')][_0xe0c8('0x34')]));_0x1d639e[_0xe0c8('0x33')]=_0x1d639e[_0xe0c8('0x33')][_0xe0c8('0x35')]?_0x1d639e[_0xe0c8('0x33')]:_0x1c5838['model'];if(_0x19c430[_0xe0c8('0x30')][_0xe0c8('0x3f')]){_0x1d639e[_0xe0c8('0x43')]=[{'all':!![]}];}_0x1d639e=_[_0xe0c8('0x3d')]({},_0x1d639e,_0x19c430[_0xe0c8('0x3e')]);return db[_0xe0c8('0x2c')]['find'](_0x1d639e)[_0xe0c8('0x25')](handleEntityNotFound(_0x2743df,null))[_0xe0c8('0x25')](respondWithResult(_0x2743df,null))[_0xe0c8('0x41')](handleError(_0x2743df,null));};exports[_0xe0c8('0x44')]=function(_0x137c75,_0x31e2ec){return db[_0xe0c8('0x2c')][_0xe0c8('0x44')](_0x137c75['body'],{})[_0xe0c8('0x25')](function(_0x5a6373){var _0x1dac80=_0x137c75['user'][_0xe0c8('0x23')]({'plain':!![]});if(!_0x1dac80)throw new Error(_0xe0c8('0x45'));if(_0x1dac80['role']===_0xe0c8('0x46')){var _0x1a929d=_0x5a6373[_0xe0c8('0x23')]({'plain':!![]});var _0x59f113=_0xe0c8('0x24');return db[_0xe0c8('0x47')]['find']({'where':{'name':_0x59f113,'userProfileId':_0x1dac80[_0xe0c8('0x48')]},'raw':!![]})[_0xe0c8('0x25')](function(_0x1440fd){if(_0x1440fd&&_0x1440fd[_0xe0c8('0x49')]===0x0){return db['UserProfileResource'][_0xe0c8('0x44')]({'name':_0x1a929d[_0xe0c8('0x29')],'resourceId':_0x1a929d['id'],'type':_0x1440fd[_0xe0c8('0x29')],'sectionId':_0x1440fd['id']},{})['then'](function(){return _0x5a6373;});}else{return _0x5a6373;}})[_0xe0c8('0x41')](function(_0x4ecddc){logger[_0xe0c8('0x27')](_0xe0c8('0x4a'),_0x4ecddc);throw _0x4ecddc;});}return _0x5a6373;})[_0xe0c8('0x25')](respondWithResult(_0x31e2ec,0xc9))[_0xe0c8('0x41')](handleError(_0x31e2ec,null));};exports[_0xe0c8('0x21')]=function(_0xecdd2e,_0x5d2fbe){if(_0xecdd2e[_0xe0c8('0x4b')]['id']){delete _0xecdd2e[_0xe0c8('0x4b')]['id'];}return db[_0xe0c8('0x2c')]['find']({'where':{'id':_0xecdd2e['params']['id']}})[_0xe0c8('0x25')](handleEntityNotFound(_0x5d2fbe,null))[_0xe0c8('0x25')](saveUpdates(_0xecdd2e[_0xe0c8('0x4b')],null))[_0xe0c8('0x25')](respondWithResult(_0x5d2fbe,null))[_0xe0c8('0x41')](handleError(_0x5d2fbe,null));};exports[_0xe0c8('0x22')]=function(_0x4db68c,_0x30f49e){return db[_0xe0c8('0x2c')][_0xe0c8('0x4c')]({'where':{'id':_0x4db68c[_0xe0c8('0x4d')]['id']}})[_0xe0c8('0x25')](handleEntityNotFound(_0x30f49e,null))['then'](removeEntity(_0x30f49e,null))[_0xe0c8('0x41')](handleError(_0x30f49e,null));};exports['describe']=function(_0x1e5602,_0x3ee208){return db[_0xe0c8('0x2c')]['describe']()['then'](respondWithResult(_0x3ee208,null))['catch'](handleError(_0x3ee208,null));};exports[_0xe0c8('0x4e')]=function(_0xff675c,_0x39dacc,_0x3b3d02){return db['CmContact'][_0xe0c8('0x4c')]({'where':{'id':_0xff675c[_0xe0c8('0x4d')]['id']}})[_0xe0c8('0x25')](handleEntityNotFound(_0x39dacc,null))[_0xe0c8('0x25')](function(_0x567190){if(_0x567190){return _0x567190['addContacts'](_0xff675c[_0xe0c8('0x4b')][_0xe0c8('0x4f')],_[_0xe0c8('0x50')](_0xff675c[_0xe0c8('0x4b')],[_0xe0c8('0x4f'),'id'])||{});}})[_0xe0c8('0x25')](respondWithResult(_0x39dacc,null))[_0xe0c8('0x41')](handleError(_0x39dacc,null));};exports[_0xe0c8('0x51')]=function(_0x31f9d6,_0x242414,_0x4008c3){var _0x3c20e2={};var _0x5b8575={};var _0x3e2a9e;var _0x11208d;return db[_0xe0c8('0x2c')]['findOne']({'where':{'id':_0x31f9d6[_0xe0c8('0x4d')]['id']}})['then'](handleEntityNotFound(_0x242414,null))[_0xe0c8('0x25')](function(_0x1fa759){if(_0x1fa759){_0x3e2a9e=_0x1fa759;_0x5b8575[_0xe0c8('0x2e')]=_['keys'](db[_0xe0c8('0x52')][_0xe0c8('0x42')]);_0x5b8575[_0xe0c8('0x30')]=_[_0xe0c8('0x2f')](_0x31f9d6[_0xe0c8('0x30')]);_0x5b8575[_0xe0c8('0x31')]=_['intersection'](_0x5b8575[_0xe0c8('0x2e')],_0x5b8575[_0xe0c8('0x30')]);_0x3c20e2[_0xe0c8('0x33')]=_[_0xe0c8('0x32')](_0x5b8575[_0xe0c8('0x2e')],qs[_0xe0c8('0x34')](_0x31f9d6[_0xe0c8('0x30')][_0xe0c8('0x34')]));_0x3c20e2[_0xe0c8('0x33')]=_0x3c20e2['attributes'][_0xe0c8('0x35')]?_0x3c20e2[_0xe0c8('0x33')]:_0x5b8575[_0xe0c8('0x2e')];_0x3c20e2[_0xe0c8('0x37')]=qs[_0xe0c8('0x38')](_0x31f9d6[_0xe0c8('0x30')][_0xe0c8('0x38')]);_0x3c20e2[_0xe0c8('0x39')]=qs[_0xe0c8('0x31')](_['pick'](_0x31f9d6[_0xe0c8('0x30')],_0x5b8575[_0xe0c8('0x31')]));if(_0x31f9d6['query'][_0xe0c8('0x3b')]){_0x3c20e2[_0xe0c8('0x39')]=_[_0xe0c8('0x3d')](_0x3c20e2[_0xe0c8('0x39')],{'$or':_[_0xe0c8('0x3c')](_0x3c20e2[_0xe0c8('0x33')],function(_0x292383){var _0x473529={};_0x473529[_0x292383]={'$like':'%'+_0x31f9d6[_0xe0c8('0x30')][_0xe0c8('0x3b')]+'%'};return _0x473529;})});}_0x3c20e2=_[_0xe0c8('0x3d')]({},_0x3c20e2,_0x31f9d6['options']);return _0x3e2a9e[_0xe0c8('0x51')](_0x3c20e2);}})[_0xe0c8('0x25')](function(_0x32d40a){if(_0x32d40a){_0x11208d=_0x32d40a[_0xe0c8('0x35')];if(!_0x31f9d6['query']['hasOwnProperty'](_0xe0c8('0x53'))){_0x3c20e2[_0xe0c8('0x1a')]=qs[_0xe0c8('0x1a')](_0x31f9d6['query']['limit']);_0x3c20e2[_0xe0c8('0x1c')]=qs[_0xe0c8('0x1c')](_0x31f9d6[_0xe0c8('0x30')]['offset']);}return _0x3e2a9e[_0xe0c8('0x51')](_0x3c20e2);}})[_0xe0c8('0x25')](function(_0x28ec1a){if(_0x28ec1a){return _0x28ec1a?{'count':_0x11208d,'rows':_0x28ec1a}:null;}})['then'](respondWithResult(_0x242414,null))[_0xe0c8('0x41')](handleError(_0x242414,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index e40f5d7..f2154b8 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 _0x763e=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util'];(function(_0x1be5ca,_0x4d5966){var _0x255754=function(_0xe270c2){while(--_0xe270c2){_0x1be5ca['push'](_0x1be5ca['shift']());}};_0x255754(++_0x4d5966);}(_0x763e,0x184));var _0xe763=function(_0x56072d,_0x187f3d){_0x56072d=_0x56072d-0x0;var _0x5ef918=_0x763e[_0x56072d];return _0x5ef918;};'use strict';var _=require(_0xe763('0x0'));var util=require(_0xe763('0x1'));var logger=require(_0xe763('0x2'))(_0xe763('0x3'));var moment=require(_0xe763('0x4'));var BPromise=require('bluebird');var rp=require(_0xe763('0x5'));var fs=require('fs');var path=require(_0xe763('0x6'));var rimraf=require(_0xe763('0x7'));var config=require(_0xe763('0x8'));var attributes=require(_0xe763('0x9'));module['exports']=function(_0x44bdd2,_0x5106a1){return _0x44bdd2[_0xe763('0xa')](_0xe763('0xb'),attributes,{'tableName':_0xe763('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x61ab=['bluebird','request-promise','path','rimraf','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment'];(function(_0x5463c7,_0x2b85d2){var _0x489930=function(_0x3447cc){while(--_0x3447cc){_0x5463c7['push'](_0x5463c7['shift']());}};_0x489930(++_0x2b85d2);}(_0x61ab,0x10c));var _0xb61a=function(_0x163e51,_0x563767){_0x163e51=_0x163e51-0x0;var _0x5b9ce5=_0x61ab[_0x163e51];return _0x5b9ce5;};'use strict';var _=require(_0xb61a('0x0'));var util=require(_0xb61a('0x1'));var logger=require(_0xb61a('0x2'))(_0xb61a('0x3'));var moment=require(_0xb61a('0x4'));var BPromise=require(_0xb61a('0x5'));var rp=require(_0xb61a('0x6'));var fs=require('fs');var path=require(_0xb61a('0x7'));var rimraf=require(_0xb61a('0x8'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0xb61a('0x9')]=function(_0x140563,_0x14025b){return _0x140563[_0xb61a('0xa')](_0xb61a('0xb'),attributes,{'tableName':_0xb61a('0xc'),'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 3cc1afe..caf6399 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 _0x7f11=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash'];(function(_0x3b516e,_0x565238){var _0x1a929c=function(_0xe2fab6){while(--_0xe2fab6){_0x3b516e['push'](_0x3b516e['shift']());}};_0x1a929c(++_0x565238);}(_0x7f11,0x175));var _0x17f1=function(_0x16495f,_0x5f2cac){_0x16495f=_0x16495f-0x0;var _0x957e3e=_0x7f11[_0x16495f];return _0x957e3e;};'use strict';var _=require(_0x17f1('0x0'));var util=require(_0x17f1('0x1'));var moment=require(_0x17f1('0x2'));var BPromise=require('bluebird');var rs=require(_0x17f1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x17f1('0x4'))['db'];var utils=require(_0x17f1('0x5'));var logger=require(_0x17f1('0x6'))(_0x17f1('0x7'));var config=require(_0x17f1('0x8'));var jayson=require(_0x17f1('0x9'));var client=jayson[_0x17f1('0xa')][_0x17f1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ce48c,_0x1485a8,_0x1c7dff){return new BPromise(function(_0x5c4804,_0x32ad56){return client[_0x17f1('0xc')](_0x2ce48c,_0x1c7dff)[_0x17f1('0xd')](function(_0x7da095){logger[_0x17f1('0xe')](_0x17f1('0xf'),_0x1485a8,_0x17f1('0x10'));logger[_0x17f1('0x11')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x1485a8,_0x17f1('0x10'),JSON[_0x17f1('0x12')](_0x7da095));if(_0x7da095['error']){if(_0x7da095[_0x17f1('0x13')]['code']===0x1f4){logger['error'](_0x17f1('0xf'),_0x1485a8,_0x7da095[_0x17f1('0x13')][_0x17f1('0x14')]);return _0x32ad56(_0x7da095[_0x17f1('0x13')][_0x17f1('0x14')]);}logger[_0x17f1('0x13')](_0x17f1('0xf'),_0x1485a8,_0x7da095[_0x17f1('0x13')][_0x17f1('0x14')]);return _0x5c4804(_0x7da095[_0x17f1('0x13')]['message']);}else{logger[_0x17f1('0xe')](_0x17f1('0xf'),_0x1485a8,_0x17f1('0x10'));_0x5c4804(_0x7da095['result'][_0x17f1('0x14')]);}})[_0x17f1('0x15')](function(_0x22c8eb){logger[_0x17f1('0x13')]('CmCompany,\x20%s,\x20%s',_0x1485a8,_0x22c8eb);_0x32ad56(_0x22c8eb);});});}
\ No newline at end of file
+var _0x3168=['util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3168,0x17b));var _0x8316=function(_0x594cc7,_0x1e625b){_0x594cc7=_0x594cc7-0x0;var _0x3c1cb5=_0x3168[_0x594cc7];return _0x3c1cb5;};'use strict';var _=require(_0x8316('0x0'));var util=require(_0x8316('0x1'));var moment=require(_0x8316('0x2'));var BPromise=require(_0x8316('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8316('0x4'));var logger=require(_0x8316('0x5'))(_0x8316('0x6'));var config=require(_0x8316('0x7'));var jayson=require(_0x8316('0x8'));var client=jayson[_0x8316('0x9')][_0x8316('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x443dde,_0x179c23,_0xbac269){return new BPromise(function(_0x520e71,_0x5a7fd5){return client['request'](_0x443dde,_0xbac269)['then'](function(_0x177e80){logger['info'](_0x8316('0xb'),_0x179c23,_0x8316('0xc'));logger[_0x8316('0xd')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x179c23,_0x8316('0xc'),JSON[_0x8316('0xe')](_0x177e80));if(_0x177e80['error']){if(_0x177e80[_0x8316('0xf')]['code']===0x1f4){logger[_0x8316('0xf')](_0x8316('0xb'),_0x179c23,_0x177e80['error'][_0x8316('0x10')]);return _0x5a7fd5(_0x177e80[_0x8316('0xf')][_0x8316('0x10')]);}logger[_0x8316('0xf')](_0x8316('0xb'),_0x179c23,_0x177e80[_0x8316('0xf')][_0x8316('0x10')]);return _0x520e71(_0x177e80['error']['message']);}else{logger[_0x8316('0x11')](_0x8316('0xb'),_0x179c23,_0x8316('0xc'));_0x520e71(_0x177e80[_0x8316('0x12')][_0x8316('0x10')]);}})['catch'](function(_0x103cfa){logger['error'](_0x8316('0xb'),_0x179c23,_0x103cfa);_0x5a7fd5(_0x103cfa);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index a39bb7f..2c66c4c 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 _0xaf38=['get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','post','create','addContacts','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xaa24f8,_0x19e09f){var _0x39c565=function(_0xde1729){while(--_0xde1729){_0xaa24f8['push'](_0xaa24f8['shift']());}};_0x39c565(++_0x19e09f);}(_0xaf38,0x10b));var _0x8af3=function(_0x36a5df,_0x3711be){_0x36a5df=_0x36a5df-0x0;var _0x4e671f=_0xaf38[_0x36a5df];return _0x4e671f;};'use strict';var multer=require(_0x8af3('0x0'));var util=require(_0x8af3('0x1'));var path=require(_0x8af3('0x2'));var timeout=require(_0x8af3('0x3'));var express=require(_0x8af3('0x4'));var router=express[_0x8af3('0x5')]();var fs_extra=require(_0x8af3('0x6'));var auth=require(_0x8af3('0x7'));var interaction=require(_0x8af3('0x8'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x8af3('0x9')]('/',auth[_0x8af3('0xa')](),controller[_0x8af3('0xb')]);router[_0x8af3('0x9')](_0x8af3('0xc'),auth[_0x8af3('0xa')](),controller[_0x8af3('0xd')]);router['get'](_0x8af3('0xe'),auth[_0x8af3('0xa')](),controller[_0x8af3('0xf')]);router[_0x8af3('0x9')]('/:id/contacts',auth[_0x8af3('0xa')](),controller[_0x8af3('0x10')]);router[_0x8af3('0x11')]('/',auth[_0x8af3('0xa')](),controller[_0x8af3('0x12')]);router[_0x8af3('0x11')]('/:id/contacts',auth[_0x8af3('0xa')](),controller[_0x8af3('0x13')]);router[_0x8af3('0x14')]('/:id',auth[_0x8af3('0xa')](),controller['update']);router['delete'](_0x8af3('0xe'),auth[_0x8af3('0xa')](),controller[_0x8af3('0x15')]);module[_0x8af3('0x16')]=router;
\ No newline at end of file
+var _0x523c=['post','addContacts','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','/:id/contacts','create'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x523c,0x156));var _0xc523=function(_0x5e3068,_0x1dde86){_0x5e3068=_0x5e3068-0x0;var _0x5c9abb=_0x523c[_0x5e3068];return _0x5c9abb;};'use strict';var multer=require(_0xc523('0x0'));var util=require(_0xc523('0x1'));var path=require(_0xc523('0x2'));var timeout=require(_0xc523('0x3'));var express=require('express');var router=express[_0xc523('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc523('0x5'));var config=require(_0xc523('0x6'));var controller=require(_0xc523('0x7'));router[_0xc523('0x8')]('/',auth[_0xc523('0x9')](),controller['index']);router[_0xc523('0x8')](_0xc523('0xa'),auth[_0xc523('0x9')](),controller[_0xc523('0xb')]);router[_0xc523('0x8')](_0xc523('0xc'),auth[_0xc523('0x9')](),controller['show']);router[_0xc523('0x8')](_0xc523('0xd'),auth[_0xc523('0x9')](),controller['getContacts']);router['post']('/',auth[_0xc523('0x9')](),controller[_0xc523('0xe')]);router[_0xc523('0xf')]('/:id/contacts',auth[_0xc523('0x9')](),controller[_0xc523('0x10')]);router[_0xc523('0x11')]('/:id',auth[_0xc523('0x9')](),controller[_0xc523('0x12')]);router['delete']('/:id',auth[_0xc523('0x9')](),controller[_0xc523('0x13')]);module[_0xc523('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index c0dc139..c4e8ba6 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 _0x0b0e=['exports','STRING','TEXT','INTEGER','DATE','NOW','lodash'];(function(_0x1050b5,_0x4e97c7){var _0x411620=function(_0x573cd0){while(--_0x573cd0){_0x1050b5['push'](_0x1050b5['shift']());}};_0x411620(++_0x4e97c7);}(_0x0b0e,0x187));var _0xe0b0=function(_0x232cf2,_0x4ffb79){_0x232cf2=_0x232cf2-0x0;var _0x463cec=_0x0b0e[_0x232cf2];return _0x463cec;};'use strict';var _=require(_0xe0b0('0x0'));var Sequelize=require('sequelize');module[_0xe0b0('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xe0b0('0x2')]},'street':{'type':Sequelize[_0xe0b0('0x2')]},'postalCode':{'type':Sequelize[_0xe0b0('0x2')]},'city':{'type':Sequelize[_0xe0b0('0x2')]},'country':{'type':Sequelize[_0xe0b0('0x2')]},'dateOfBirth':{'type':Sequelize[_0xe0b0('0x2')]},'description':{'type':Sequelize[_0xe0b0('0x3')]},'phone':{'type':Sequelize[_0xe0b0('0x2')]},'mobile':{'type':Sequelize[_0xe0b0('0x2')]},'fax':{'type':Sequelize[_0xe0b0('0x2')]},'email':{'type':Sequelize[_0xe0b0('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xe0b0('0x2')]},'twitter':{'type':Sequelize[_0xe0b0('0x2')]},'skype':{'type':Sequelize[_0xe0b0('0x2')]},'teams':{'type':Sequelize[_0xe0b0('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xe0b0('0x2')]},'wechat':{'type':Sequelize[_0xe0b0('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xe0b0('0x4')]},'priority':{'type':Sequelize[_0xe0b0('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':Sequelize[_0xe0b0('0x6')]},'dialTimezone':{'type':Sequelize[_0xe0b0('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x757a=['STRING','TEXT','INTEGER','UNSIGNED','DATE','sequelize','exports'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x757a,0xde));var _0xa757=function(_0x5d796e,_0x3b1753){_0x5d796e=_0x5d796e-0x0;var _0x1b481a=_0x757a[_0x5d796e];return _0x1b481a;};'use strict';var _=require('lodash');var Sequelize=require(_0xa757('0x0'));module[_0xa757('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xa757('0x2')]},'city':{'type':Sequelize[_0xa757('0x2')]},'country':{'type':Sequelize[_0xa757('0x2')]},'dateOfBirth':{'type':Sequelize[_0xa757('0x2')]},'description':{'type':Sequelize[_0xa757('0x3')]},'phone':{'type':Sequelize[_0xa757('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xa757('0x2')]},'email':{'type':Sequelize[_0xa757('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xa757('0x2')]},'fb_data':{'type':Sequelize[_0xa757('0x2')]},'twitter':{'type':Sequelize[_0xa757('0x2')]},'skype':{'type':Sequelize[_0xa757('0x2')]},'teams':{'type':Sequelize[_0xa757('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xa757('0x2')]},'wechat':{'type':Sequelize[_0xa757('0x2')]},'telegram':{'type':Sequelize[_0xa757('0x2')]},'UserId':{'type':Sequelize[_0xa757('0x4')]},'priority':{'type':Sequelize[_0xa757('0x4')](0x2)[_0xa757('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa757('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index cdc606e..8eeeb4a 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 _0xb4f2=['c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','clone','having','t.id\x20IN\x20?','resolve','role','agent','some','User','user','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','merge','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.CompanyId','TagIds','Tags','rows','catch','params','columnName','displayName','analytics','CmCustomField','alias','custom','values','body','findAll','get','mergeWith','isArray','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','create','dialTimezone','timezones','utcOffset','bulkCreate','duplicates','$or','findOrCreate','spread','show','Tag','$and','omit','format','cf_%d','pickBy','table','setFields','id\x20=\x20?','toParam','phone','getTags','findOne','rawAttributes','pick','options','setTags','ids','getHoppers','ContactId','includeAll','include','CmHopper','getHopperHistories','getHopperFinals','getJscriptySessions','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','Incorrect\x20binding\x20parameters\x20passed!','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','send','createReadStream','parse','import','binding','firstName','../../components/import/cm/csv2','stringify','error\x20child\x20process','pid','getJourney','mail','sms','openchannel','whatsapp','voice','-createdAt','includes','channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','callerid','starttime','endtime','duration','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','createdAt','DESC','findAndCountAll','startCase','chat','Website','Account','closed','closedAt','note','thirdDisposition','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','externalUrl','threadId','Interaction','sortBy','reverse','moment','bluebird','util','path','lodash','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','status','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','index','CmContact','describe','keys','length','startsWith','push','trimStart','cf_','fieldType','model','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','search','parseSearch','sqlOperator','conditions','find','value','split','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','type','text','start','filter','isNil','Contact','isEmpty','forEach','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','replace','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xb4f2,0x1eb));var _0x2b4f=function(_0x351e94,_0x1f95a8){_0x351e94=_0x351e94-0x0;var _0x3cb652=_0xb4f2[_0x351e94];return _0x3cb652;};'use strict';var moment=require(_0x2b4f('0x0'));var BPromise=require(_0x2b4f('0x1'));var util=require(_0x2b4f('0x2'));var path=require(_0x2b4f('0x3'));var fs=require('fs');var _=require(_0x2b4f('0x4'));var squel=require('squel');var Papa=require(_0x2b4f('0x5'));var Redis=require(_0x2b4f('0x6'));var qs=require(_0x2b4f('0x7'));var as=require(_0x2b4f('0x8'));var logger=require(_0x2b4f('0x9'))('api');var config=require(_0x2b4f('0xa'));var shared=require('../../config/environment/shared');var db=require(_0x2b4f('0xb'))['db'];config[_0x2b4f('0xc')]=_[_0x2b4f('0xd')](config[_0x2b4f('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x2b4f('0xe'))(new Redis(config['redis']));require(_0x2b4f('0xf'))[_0x2b4f('0x10')](socket);function respondWithResult(_0x1fe8e8,_0x44af08){_0x44af08=_0x44af08||0xc8;return function(_0x4eacad){if(_0x4eacad){return _0x1fe8e8[_0x2b4f('0x11')](_0x44af08)['json'](_0x4eacad);}};}function respondWithFilteredResult(_0x98711f,_0x36ae92){return function(_0x2e5b83){if(_0x2e5b83){var _0x2c705f=typeof _0x36ae92[_0x2b4f('0x12')]===_0x2b4f('0x13')&&typeof _0x36ae92[_0x2b4f('0x14')]===_0x2b4f('0x13');var _0xf13cbf=_0x2e5b83[_0x2b4f('0x15')];var _0x2e537c=_0x2c705f?0x0:_0x36ae92[_0x2b4f('0x12')];var _0x43a530=_0x2c705f?_0x2e5b83[_0x2b4f('0x15')]:_0x36ae92[_0x2b4f('0x12')]+_0x36ae92[_0x2b4f('0x14')];var _0x1aae8b;if(_0x43a530>=_0xf13cbf){_0x43a530=_0xf13cbf;_0x1aae8b=0xc8;}else{_0x1aae8b=0xce;}_0x98711f[_0x2b4f('0x11')](_0x1aae8b);return _0x98711f[_0x2b4f('0x16')](_0x2b4f('0x17'),_0x2e537c+'-'+_0x43a530+'/'+_0xf13cbf)['json'](_0x2e5b83);}return null;};}function saveUpdates(_0x1362fb){return function(_0x10e536){if(_0x10e536){return _0x10e536[_0x2b4f('0x18')](_0x1362fb)[_0x2b4f('0x19')](function(_0x278b47){return _0x278b47;});}return null;};}function removeEntity(_0x20d97b){return function(_0x4edd21){if(_0x4edd21){return _0x4edd21[_0x2b4f('0x1a')]()[_0x2b4f('0x19')](function(){_0x20d97b[_0x2b4f('0x11')](0xcc)[_0x2b4f('0x1b')]();});}};}function handleEntityNotFound(_0xc5fb86){return function(_0x2d62cb){if(!_0x2d62cb){_0xc5fb86[_0x2b4f('0x1c')](0x194);}return _0x2d62cb;};}function handleError(_0x12751e,_0x449137){_0x449137=_0x449137||0x1f4;return function(_0x4ba2f1){logger[_0x2b4f('0x1d')](_0x4ba2f1[_0x2b4f('0x1e')]);if(_0x4ba2f1[_0x2b4f('0x1f')]){delete _0x4ba2f1['name'];}_0x12751e['status'](_0x449137)['send'](_0x4ba2f1);};}exports[_0x2b4f('0x20')]=function(_0x4858c8,_0x21f2a5){var _0x59b3c9={},_0x3ce3ee={},_0x3d5621={'count':0x0,'rows':[]};return db[_0x2b4f('0x21')][_0x2b4f('0x22')]()[_0x2b4f('0x19')](function(_0x2922dd){var _0x428b94=[];for(var _0x497004=0x0;_0x497004
','generateXOAuth2Token','auth=Bearer\x20','utf-8','toString','base64','moment','randomstring','path','util','node-tnef','../../../config/logger'];(function(_0x962fa2,_0x59d469){var _0x3411e3=function(_0x11398b){while(--_0x11398b){_0x962fa2['push'](_0x962fa2['shift']());}};_0x3411e3(++_0x59d469);}(_0x1ea3,0x1c2));var _0x31ea=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x1ea3[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var moment=require(_0x31ea('0x0'));var random=require(_0x31ea('0x1'));var fs=require('fs');var path=require(_0x31ea('0x2'));var util=require(_0x31ea('0x3'));var tnef=require(_0x31ea('0x4'));var logger=require(_0x31ea('0x5'))('email');var config=require(_0x31ea('0x6'));function getAddress(_0xf1d998){var _0xe53963=_['head'](_0xf1d998['value']);return _0xe53963&&_0xe53963['address']?_0xe53963['address']:'anonymous'+random[_0x31ea('0x7')](0x6)+_0x31ea('0x8');}function getFirstName(_0x3dec7b){var _0x3b10ce=_['head'](_0x3dec7b[_0x31ea('0x9')]);if(_0x3b10ce&&_0x3b10ce[_0x31ea('0xa')]){if(_0x3b10ce[_0x31ea('0xa')]==_0x3b10ce['address']){return _0x3b10ce[_0x31ea('0xa')][_0x31ea('0xb')](0x0,_0x3b10ce['name'][_0x31ea('0xc')]('@'));}var _0xc580ec=_0x3b10ce['name']['split'](/\s+/);return _0xc580ec['length']>0x1?_0xc580ec[_0x31ea('0xd')](0x0,-0x1)[_0x31ea('0xe')]('\x20'):_0x3b10ce[_0x31ea('0xa')];}return _0x31ea('0xf');}function getLastName(_0x20e87b){var _0x3623a1=_[_0x31ea('0x10')](_0x20e87b[_0x31ea('0x9')]);if(_0x3623a1&&_0x3623a1[_0x31ea('0xa')]){var _0x5bc1de=_0x3623a1[_0x31ea('0xa')]['split'](/\s+/);return _0x5bc1de[_0x31ea('0x11')]>0x1?_0x5bc1de[_0x31ea('0x12')]():'';}return'';}function getMails(_0x36f2c8,_0x29dd62){var _0xa21e62='';for(var _0x5140d7=0x0;_0x5140d7<_0x29dd62[_0x31ea('0x9')][_0x31ea('0x11')];_0x5140d7+=0x1){if(_0x29dd62['value'][_0x5140d7][_0x31ea('0x13')]!==_0x36f2c8){if(!_[_0x31ea('0x14')](_0xa21e62)){_0xa21e62+=',';}_0xa21e62+=_0x29dd62['value'][_0x5140d7][_0x31ea('0xa')]||_0x29dd62[_0x31ea('0x9')][_0x5140d7]['address']||'';_0xa21e62+='\x20<';_0xa21e62+=_0x29dd62[_0x31ea('0x9')][_0x5140d7][_0x31ea('0x13')]?_0x29dd62[_0x31ea('0x9')][_0x5140d7][_0x31ea('0x13')]:_0x31ea('0x15')+random[_0x31ea('0x7')](0x6)+_0x31ea('0x8');_0xa21e62+='>';}}return _0xa21e62;}function parseEmail(_0xb713e9,_0x50f9b0,_0x4d438e){if(_0x50f9b0[_0x31ea('0x16')]){var _0x10e859=/