From: Andrea Bianco
Date: Mon, 17 Jan 2022 22:26:31 +0000 (+0100)
Subject: Built motion from commit 8aeb62e4.|2.5.48
X-Git-Url: http://repos.xcallymotion.com/base//%22?a=commitdiff_plain;h=becef7c83c2e842d6cdb22f919bd8f56a973654f;p=motion2.git
Built motion from commit 8aeb62e4.|2.5.48
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 843d3a1..99ef6cb 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-17T19:31:13.822Z",
+ "time": "2022-01-17T22:04:49.121Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index df56eb5..4916ecc 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-17T19:31:13.822Z",
+ "time": "2022-01-17T22:04:49.121Z",
"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 132cb94..be72294 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 _0x4757=['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]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','VIRTUAL','action','STRING','contactManager','integration','jscripty','urlForward','browser','bot'];(function(_0x548503,_0x1aa00c){var _0xf8f05f=function(_0x2014c2){while(--_0x2014c2){_0x548503['push'](_0x548503['shift']());}};_0xf8f05f(++_0x1aa00c);}(_0x4757,0x1c2));var _0x7475=function(_0x867b0a,_0x587ccf){_0x867b0a=_0x867b0a-0x0;var _0x137438=_0x4757[_0x867b0a];return _0x137438;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7475('0x0')],'get':function(_0x2cbc93){return this['getDataValue'](_0x7475('0x1'));}},'action':{'type':Sequelize[_0x7475('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x7475('0x3'),_0x7475('0x4'),'motionbar',_0x7475('0x5'),_0x7475('0x6'),_0x7475('0x7'),_0x7475('0x8'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x7475('0x9')},'data1':{'type':Sequelize[_0x7475('0x2')](0x1000),'comment':_0x7475('0xa')},'data2':{'type':Sequelize[_0x7475('0x2')](0x1000),'comment':_0x7475('0xb')},'data3':{'type':Sequelize[_0x7475('0x2')](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[_0x7475('0x2')](0x1000),'comments':_0x7475('0xc')},'data5':{'type':Sequelize[_0x7475('0x2')](0x1000),'comments':_0x7475('0xd')},'data6':{'type':Sequelize[_0x7475('0x2')],'comments':_0x7475('0xe')},'data7':{'type':Sequelize[_0x7475('0xf')],'comments':_0x7475('0x10')}};
\ No newline at end of file
+var _0xd4ec=['getDataValue','action','STRING','contactManager','integration','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[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL'];(function(_0x1660c3,_0x3ea35b){var _0x4709d3=function(_0x453bfe){while(--_0x453bfe){_0x1660c3['push'](_0x1660c3['shift']());}};_0x4709d3(++_0x3ea35b);}(_0xd4ec,0x1eb));var _0xcd4e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4ec[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xcd4e('0x0'));module[_0xcd4e('0x1')]={'name':{'type':Sequelize[_0xcd4e('0x2')],'get':function(_0x1022c1){return this[_0xcd4e('0x3')](_0xcd4e('0x4'));}},'action':{'type':Sequelize[_0xcd4e('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xcd4e('0x6'),_0xcd4e('0x7'),'motionbar',_0xcd4e('0x8'),_0xcd4e('0x9'),_0xcd4e('0xa'),'bot',_0xcd4e('0xb')]],'msg':_0xcd4e('0xc')}},'comment':_0xcd4e('0xc')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xcd4e('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xcd4e('0xe')},'data4':{'type':Sequelize[_0xcd4e('0x5')](0x1000),'comments':_0xcd4e('0xf')},'data5':{'type':Sequelize[_0xcd4e('0x5')](0x1000),'comments':_0xcd4e('0x10')},'data6':{'type':Sequelize[_0xcd4e('0x5')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xcd4e('0x11')],'comments':_0xcd4e('0x12')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 6183a42..4b0eb11 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 _0xef77=['util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','reject','update','then','stack','name','send','Action','find','catch','destroy','params','eml-format','rimraf','request-promise','moment','bluebird','mustache'];(function(_0x25c43c,_0x3a3aa3){var _0x28e108=function(_0x425bfe){while(--_0x425bfe){_0x25c43c['push'](_0x25c43c['shift']());}};_0x28e108(++_0x3a3aa3);}(_0xef77,0x1d0));var _0x7ef7=function(_0x2499b7,_0x6aa2c6){_0x2499b7=_0x2499b7-0x0;var _0x5ba8d4=_0xef77[_0x2499b7];return _0x5ba8d4;};'use strict';var emlformat=require(_0x7ef7('0x0'));var rimraf=require(_0x7ef7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7ef7('0x2'));var moment=require(_0x7ef7('0x3'));var BPromise=require(_0x7ef7('0x4'));var Mustache=require(_0x7ef7('0x5'));var util=require(_0x7ef7('0x6'));var path=require(_0x7ef7('0x7'));var sox=require(_0x7ef7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7ef7('0x9'));var _=require(_0x7ef7('0xa'));var squel=require(_0x7ef7('0xb'));var crypto=require(_0x7ef7('0xc'));var jsforce=require(_0x7ef7('0xd'));var deskjs=require(_0x7ef7('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7ef7('0xf'));var Papa=require(_0x7ef7('0x10'));var Redis=require('ioredis');var authService=require(_0x7ef7('0x11'));var qs=require(_0x7ef7('0x12'));var as=require(_0x7ef7('0x13'));var hardwareService=require(_0x7ef7('0x14'));var logger=require(_0x7ef7('0x15'))(_0x7ef7('0x16'));var utils=require(_0x7ef7('0x17'));var config=require(_0x7ef7('0x18'));var licenseUtil=require(_0x7ef7('0x19'));var db=require(_0x7ef7('0x1a'))['db'];function respondWithStatusCode(_0xd6b780,_0x2a084e){_0x2a084e=_0x2a084e||0xcc;return function(_0x51c50b){if(_0x51c50b){return _0xd6b780[_0x7ef7('0x1b')](_0x2a084e);}return _0xd6b780[_0x7ef7('0x1c')](_0x2a084e)['end']();};}function respondWithResult(_0x5b6fd6,_0x56b480){_0x56b480=_0x56b480||0xc8;return function(_0xc3caa8){if(_0xc3caa8){return _0x5b6fd6[_0x7ef7('0x1c')](_0x56b480)['json'](_0xc3caa8);}};}function respondWithFilteredResult(_0x282bbb,_0x29cd41){return function(_0x1e697f){if(_0x1e697f){var _0x4931b8=typeof _0x29cd41[_0x7ef7('0x1d')]==='undefined'&&typeof _0x29cd41[_0x7ef7('0x1e')]===_0x7ef7('0x1f');var _0x42c471=_0x1e697f[_0x7ef7('0x20')];var _0x4afe1e=_0x4931b8?0x0:_0x29cd41['offset'];var _0x4b0d8d=_0x4931b8?_0x1e697f[_0x7ef7('0x20')]:_0x29cd41['offset']+_0x29cd41[_0x7ef7('0x1e')];var _0x533c19;if(_0x4b0d8d>=_0x42c471){_0x4b0d8d=_0x42c471;_0x533c19=0xc8;}else{_0x533c19=0xce;}_0x282bbb[_0x7ef7('0x1c')](_0x533c19);return _0x282bbb[_0x7ef7('0x21')](_0x7ef7('0x22'),_0x4afe1e+'-'+_0x4b0d8d+'/'+_0x42c471)[_0x7ef7('0x23')](_0x1e697f);}return null;};}function patchUpdates(_0x2a70c4){return function(_0x2a51f7){try{jsonpatch['apply'](_0x2a51f7,_0x2a70c4,!![]);}catch(_0xf4a05){return BPromise[_0x7ef7('0x24')](_0xf4a05);}return _0x2a51f7['save']();};}function saveUpdates(_0x6f3281,_0x427e54){return function(_0x2670c0){if(_0x2670c0){return _0x2670c0[_0x7ef7('0x25')](_0x6f3281)[_0x7ef7('0x26')](function(_0x3597c2){return _0x3597c2;});}return null;};}function removeEntity(_0x1a79cc,_0x4a346f){return function(_0x2c4ee0){if(_0x2c4ee0){return _0x2c4ee0['destroy']()[_0x7ef7('0x26')](function(){_0x1a79cc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d4233,_0x4a6aa8){return function(_0x55a86a){if(!_0x55a86a){_0x3d4233[_0x7ef7('0x1b')](0x194);}return _0x55a86a;};}function handleError(_0x577517,_0x79047b){_0x79047b=_0x79047b||0x1f4;return function(_0xd4257d){logger['error'](_0xd4257d[_0x7ef7('0x27')]);if(_0xd4257d[_0x7ef7('0x28')]){delete _0xd4257d[_0x7ef7('0x28')];}_0x577517[_0x7ef7('0x1c')](_0x79047b)[_0x7ef7('0x29')](_0xd4257d);};}exports[_0x7ef7('0x25')]=function(_0x540a07,_0x37d6f3){if(_0x540a07['body']['id']){delete _0x540a07['body']['id'];}return db[_0x7ef7('0x2a')][_0x7ef7('0x2b')]({'where':{'id':_0x540a07['params']['id']}})['then'](handleEntityNotFound(_0x37d6f3,null))[_0x7ef7('0x26')](saveUpdates(_0x540a07['body'],null))[_0x7ef7('0x26')](respondWithResult(_0x37d6f3,null))[_0x7ef7('0x2c')](handleError(_0x37d6f3,null));};exports[_0x7ef7('0x2d')]=function(_0x5c194b,_0x3b4329){return db[_0x7ef7('0x2a')]['find']({'where':{'id':_0x5c194b[_0x7ef7('0x2e')]['id']}})[_0x7ef7('0x26')](handleEntityNotFound(_0x3b4329,null))[_0x7ef7('0x26')](removeEntity(_0x3b4329,null))[_0x7ef7('0x2c')](handleError(_0x3b4329,null));};
\ No newline at end of file
+var _0x1a57=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','sendStatus','error','stack','name','body','Action','find','params','destroy','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js'];(function(_0x10d619,_0x5da8f6){var _0x54cb7f=function(_0x5388db){while(--_0x5388db){_0x10d619['push'](_0x10d619['shift']());}};_0x54cb7f(++_0x5da8f6);}(_0x1a57,0x186));var _0x71a5=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x1a57[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x71a5('0x0'));var zipdir=require(_0x71a5('0x1'));var jsonpatch=require(_0x71a5('0x2'));var rp=require(_0x71a5('0x3'));var moment=require(_0x71a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x71a5('0x5'));var util=require(_0x71a5('0x6'));var path=require(_0x71a5('0x7'));var sox=require(_0x71a5('0x8'));var csv=require(_0x71a5('0x9'));var ejs=require(_0x71a5('0xa'));var fs=require('fs');var fs_extra=require(_0x71a5('0xb'));var _=require('lodash');var squel=require(_0x71a5('0xc'));var crypto=require(_0x71a5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x71a5('0xe'));var toCsv=require(_0x71a5('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x71a5('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x71a5('0x10'));var as=require(_0x71a5('0x11'));var hardwareService=require(_0x71a5('0x12'));var logger=require(_0x71a5('0x13'))(_0x71a5('0x14'));var utils=require(_0x71a5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x71a5('0x16'));var db=require(_0x71a5('0x17'))['db'];function respondWithStatusCode(_0x4d6b90,_0x3fa483){_0x3fa483=_0x3fa483||0xcc;return function(_0x22f236){if(_0x22f236){return _0x4d6b90['sendStatus'](_0x3fa483);}return _0x4d6b90[_0x71a5('0x18')](_0x3fa483)[_0x71a5('0x19')]();};}function respondWithResult(_0xc3af1c,_0x282f57){_0x282f57=_0x282f57||0xc8;return function(_0x448b05){if(_0x448b05){return _0xc3af1c['status'](_0x282f57)[_0x71a5('0x1a')](_0x448b05);}};}function respondWithFilteredResult(_0x42f72d,_0x33ddb7){return function(_0x27bd28){if(_0x27bd28){var _0x1b9013=typeof _0x33ddb7['offset']===_0x71a5('0x1b')&&typeof _0x33ddb7[_0x71a5('0x1c')]==='undefined';var _0x2e2488=_0x27bd28[_0x71a5('0x1d')];var _0x518a21=_0x1b9013?0x0:_0x33ddb7[_0x71a5('0x1e')];var _0x3758b0=_0x1b9013?_0x27bd28[_0x71a5('0x1d')]:_0x33ddb7[_0x71a5('0x1e')]+_0x33ddb7[_0x71a5('0x1c')];var _0x5bdbbf;if(_0x3758b0>=_0x2e2488){_0x3758b0=_0x2e2488;_0x5bdbbf=0xc8;}else{_0x5bdbbf=0xce;}_0x42f72d[_0x71a5('0x18')](_0x5bdbbf);return _0x42f72d[_0x71a5('0x1f')](_0x71a5('0x20'),_0x518a21+'-'+_0x3758b0+'/'+_0x2e2488)['json'](_0x27bd28);}return null;};}function patchUpdates(_0xe1737d){return function(_0x295eb1){try{jsonpatch['apply'](_0x295eb1,_0xe1737d,!![]);}catch(_0x4e253b){return BPromise['reject'](_0x4e253b);}return _0x295eb1['save']();};}function saveUpdates(_0x2f0205,_0x5216d2){return function(_0x36103a){if(_0x36103a){return _0x36103a[_0x71a5('0x21')](_0x2f0205)[_0x71a5('0x22')](function(_0x1d6969){return _0x1d6969;});}return null;};}function removeEntity(_0x532c44,_0x368d28){return function(_0xd9e0f3){if(_0xd9e0f3){return _0xd9e0f3['destroy']()[_0x71a5('0x22')](function(){_0x532c44[_0x71a5('0x18')](0xcc)[_0x71a5('0x19')]();});}};}function handleEntityNotFound(_0x1d3085,_0x2732ba){return function(_0x4324a7){if(!_0x4324a7){_0x1d3085[_0x71a5('0x23')](0x194);}return _0x4324a7;};}function handleError(_0x52fd53,_0x562cbe){_0x562cbe=_0x562cbe||0x1f4;return function(_0x2ba906){logger[_0x71a5('0x24')](_0x2ba906[_0x71a5('0x25')]);if(_0x2ba906[_0x71a5('0x26')]){delete _0x2ba906[_0x71a5('0x26')];}_0x52fd53[_0x71a5('0x18')](_0x562cbe)['send'](_0x2ba906);};}exports[_0x71a5('0x21')]=function(_0x3a648b,_0x49e565){if(_0x3a648b[_0x71a5('0x27')]['id']){delete _0x3a648b[_0x71a5('0x27')]['id'];}return db[_0x71a5('0x28')][_0x71a5('0x29')]({'where':{'id':_0x3a648b[_0x71a5('0x2a')]['id']}})['then'](handleEntityNotFound(_0x49e565,null))['then'](saveUpdates(_0x3a648b[_0x71a5('0x27')],null))[_0x71a5('0x22')](respondWithResult(_0x49e565,null))['catch'](handleError(_0x49e565,null));};exports[_0x71a5('0x2b')]=function(_0x4acdb9,_0x35bf08){return db[_0x71a5('0x28')][_0x71a5('0x29')]({'where':{'id':_0x4acdb9['params']['id']}})['then'](handleEntityNotFound(_0x35bf08,null))[_0x71a5('0x22')](removeEntity(_0x35bf08,null))[_0x71a5('0x2c')](handleError(_0x35bf08,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index db417f7..85706f4 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 _0xf47b=['tools_actions','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','Action'];(function(_0x56d3a2,_0x5f191b){var _0x2c14d0=function(_0xb776e2){while(--_0xb776e2){_0x56d3a2['push'](_0x56d3a2['shift']());}};_0x2c14d0(++_0x5f191b);}(_0xf47b,0x15d));var _0xbf47=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xf47b[_0x432682];return _0x463d05;};'use strict';var _=require(_0xbf47('0x0'));var util=require(_0xbf47('0x1'));var logger=require(_0xbf47('0x2'))('api');var moment=require(_0xbf47('0x3'));var BPromise=require(_0xbf47('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf47('0x5'));var rimraf=require(_0xbf47('0x6'));var config=require(_0xbf47('0x7'));var attributes=require('./action.attributes');module[_0xbf47('0x8')]=function(_0x13a5dc,_0x50cae8){return _0x13a5dc[_0xbf47('0x9')](_0xbf47('0xa'),attributes,{'tableName':_0xbf47('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4442=['exports','define','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x5c058a,_0x266884){var _0x419fa7=function(_0x5892ed){while(--_0x5892ed){_0x5c058a['push'](_0x5c058a['shift']());}};_0x419fa7(++_0x266884);}(_0x4442,0x1cb));var _0x2444=function(_0x408035,_0x202850){_0x408035=_0x408035-0x0;var _0x192cd5=_0x4442[_0x408035];return _0x192cd5;};'use strict';var _=require(_0x2444('0x0'));var util=require(_0x2444('0x1'));var logger=require(_0x2444('0x2'))(_0x2444('0x3'));var moment=require(_0x2444('0x4'));var BPromise=require(_0x2444('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2444('0x6'));var rimraf=require(_0x2444('0x7'));var config=require(_0x2444('0x8'));var attributes=require('./action.attributes');module[_0x2444('0x9')]=function(_0x3e5562,_0x390677){return _0x3e5562[_0x2444('0xa')]('Action',attributes,{'tableName':_0x2444('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 8e74af3..397bf01 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x42d824,_0x1ab5e4){var _0x5a47a5=function(_0x50a03f){while(--_0x50a03f){_0x42d824['push'](_0x42d824['shift']());}};_0x5a47a5(++_0x1ab5e4);}(_0xe14b,0x93));var _0xbe14=function(_0x49c0ed,_0x45c426){_0x49c0ed=_0x49c0ed-0x0;var _0x7d8b63=_0xe14b[_0x49c0ed];return _0x7d8b63;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
+var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x814b,0x1a2));var _0xb814=function(_0x407461,_0x1cf61c){_0x407461=_0x407461-0x0;var _0x2b3ffa=_0x814b[_0x407461];return _0x2b3ffa;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index e361d14..127ddd3 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 _0x811d=['./action.controller','put','delete','/:id','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4f75b5,_0x4db76d){var _0x5c263b=function(_0x31e622){while(--_0x31e622){_0x4f75b5['push'](_0x4f75b5['shift']());}};_0x5c263b(++_0x4db76d);}(_0x811d,0x1b2));var _0xd811=function(_0x3852fd,_0x5b321f){_0x3852fd=_0x3852fd-0x0;var _0x186388=_0x811d[_0x3852fd];return _0x186388;};'use strict';var multer=require(_0xd811('0x0'));var util=require(_0xd811('0x1'));var path=require(_0xd811('0x2'));var timeout=require(_0xd811('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd811('0x4'));var auth=require(_0xd811('0x5'));var interaction=require(_0xd811('0x6'));var config=require(_0xd811('0x7'));var controller=require(_0xd811('0x8'));router[_0xd811('0x9')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd811('0xa')](_0xd811('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xd811('0xc')]=router;
\ No newline at end of file
+var _0x8c37=['../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4571a3,_0x29eb8b){var _0x1ba007=function(_0x2e0a45){while(--_0x2e0a45){_0x4571a3['push'](_0x4571a3['shift']());}};_0x1ba007(++_0x29eb8b);}(_0x8c37,0x157));var _0x78c3=function(_0xa3764c,_0x56490d){_0xa3764c=_0xa3764c-0x0;var _0x141301=_0x8c37[_0xa3764c];return _0x141301;};'use strict';var multer=require(_0x78c3('0x0'));var util=require(_0x78c3('0x1'));var path=require('path');var timeout=require(_0x78c3('0x2'));var express=require(_0x78c3('0x3'));var router=express[_0x78c3('0x4')]();var fs_extra=require(_0x78c3('0x5'));var auth=require(_0x78c3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x78c3('0x7'));var controller=require(_0x78c3('0x8'));router[_0x78c3('0x9')](_0x78c3('0xa'),auth[_0x78c3('0xb')](),controller['update']);router[_0x78c3('0xc')](_0x78c3('0xa'),auth[_0x78c3('0xb')](),controller['destroy']);module[_0x78c3('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 3634263..39697db 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 _0x7da7=['TEXT','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7da7,0x10d));var _0x77da=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x7da7[_0x62c958];return _0x57ec61;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'name':{'type':Sequelize[_0x77da('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x77da('0x2')]},'conditions':{'type':Sequelize[_0x77da('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x1e2a97,_0x156023){var _0xd6dcf0=function(_0x50fea0){while(--_0x50fea0){_0x1e2a97['push'](_0x1e2a97['shift']());}};_0xd6dcf0(++_0x156023);}(_0xac9d,0x14d));var _0xdac9=function(_0x412342,_0x180734){_0x412342=_0x412342-0x0;var _0x3e62cb=_0xac9d[_0x412342];return _0x3e62cb;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 7039de5..fd45553 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 _0xfb4b=['to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','CustomReports','UserProfileResource','sendStatus','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','key','model','query','filters','intersection','attributes','length','nolimit','order','pick','where','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','keys','fields','include','find','create','user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','function','replace','format','orderBy','DESC','alias','joins','parse','type','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','toString','sequelize','SELECT','join','left_join','cross_join','SUM(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','IS\x20EMPTY','metric','groupBy','foreignTable','output','fullPath','%s-%s.%s','randomstring','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../files/reports','savename','countTable','QueryTypes','runReport','ROUND(%s)','Sequelize','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox'];(function(_0x352026,_0x2c8ec4){var _0x13ab75=function(_0x2dac17){while(--_0x2dac17){_0x352026['push'](_0x352026['shift']());}};_0x13ab75(++_0x2c8ec4);}(_0xfb4b,0x1d6));var _0xbfb4=function(_0x32c486,_0xa77c16){_0x32c486=_0x32c486-0x0;var _0x394cb4=_0xfb4b[_0x32c486];return _0x394cb4;};'use strict';var emlformat=require(_0xbfb4('0x0'));var rimraf=require(_0xbfb4('0x1'));var zipdir=require(_0xbfb4('0x2'));var jsonpatch=require(_0xbfb4('0x3'));var rp=require(_0xbfb4('0x4'));var moment=require(_0xbfb4('0x5'));var BPromise=require(_0xbfb4('0x6'));var Mustache=require('mustache');var util=require(_0xbfb4('0x7'));var path=require(_0xbfb4('0x8'));var sox=require(_0xbfb4('0x9'));var csv=require(_0xbfb4('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xbfb4('0xb'));var jsforce=require(_0xbfb4('0xc'));var deskjs=require(_0xbfb4('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbfb4('0xe'));var Papa=require(_0xbfb4('0xf'));var Redis=require(_0xbfb4('0x10'));var authService=require(_0xbfb4('0x11'));var qs=require(_0xbfb4('0x12'));var as=require(_0xbfb4('0x13'));var hardwareService=require(_0xbfb4('0x14'));var logger=require('../../config/logger')(_0xbfb4('0x15'));var utils=require(_0xbfb4('0x16'));var config=require(_0xbfb4('0x17'));var licenseUtil=require(_0xbfb4('0x18'));var db=require(_0xbfb4('0x19'))['db'];var dbH=require(_0xbfb4('0x19'))[_0xbfb4('0x1a')];function respondWithStatusCode(_0x22f6d8,_0xe05b98){_0xe05b98=_0xe05b98||0xcc;return function(_0x227ec9){if(_0x227ec9){return _0x22f6d8['sendStatus'](_0xe05b98);}return _0x22f6d8[_0xbfb4('0x1b')](_0xe05b98)[_0xbfb4('0x1c')]();};}function respondWithResult(_0x2ad597,_0x1937ff){_0x1937ff=_0x1937ff||0xc8;return function(_0x2f358d){if(_0x2f358d){return _0x2ad597[_0xbfb4('0x1b')](_0x1937ff)['json'](_0x2f358d);}};}function respondWithFilteredResult(_0x2764c7,_0x3eb341){return function(_0xe1054d){if(_0xe1054d){var _0x415b74=typeof _0x3eb341['offset']===_0xbfb4('0x1d')&&typeof _0x3eb341[_0xbfb4('0x1e')]===_0xbfb4('0x1d');var _0x2a9767=_0xe1054d[_0xbfb4('0x1f')];var _0x57f5a4=_0x415b74?0x0:_0x3eb341['offset'];var _0x541434=_0x415b74?_0xe1054d['count']:_0x3eb341[_0xbfb4('0x20')]+_0x3eb341['limit'];var _0x4f4b8f;if(_0x541434>=_0x2a9767){_0x541434=_0x2a9767;_0x4f4b8f=0xc8;}else{_0x4f4b8f=0xce;}_0x2764c7[_0xbfb4('0x1b')](_0x4f4b8f);return _0x2764c7[_0xbfb4('0x21')](_0xbfb4('0x22'),_0x57f5a4+'-'+_0x541434+'/'+_0x2a9767)['json'](_0xe1054d);}return null;};}function patchUpdates(_0x571c65){return function(_0x5f0a22){try{jsonpatch[_0xbfb4('0x23')](_0x5f0a22,_0x571c65,!![]);}catch(_0x37db32){return BPromise[_0xbfb4('0x24')](_0x37db32);}return _0x5f0a22['save']();};}function saveUpdates(_0x528781,_0x52c7b2){return function(_0x58a9cb){if(_0x58a9cb){return _0x58a9cb[_0xbfb4('0x25')](_0x528781)[_0xbfb4('0x26')](function(_0x2e170b){return _0x2e170b;});}return null;};}function removeEntity(_0x3bd69d,_0x7f53e3){return function(_0x5c7c75){if(_0x5c7c75){return _0x5c7c75[_0xbfb4('0x27')]()[_0xbfb4('0x26')](function(){var _0x1ae53a=_0x5c7c75[_0xbfb4('0x28')]({'plain':!![]});var _0x54880a=_0xbfb4('0x29');return db[_0xbfb4('0x2a')]['destroy']({'where':{'type':_0x54880a,'resourceId':_0x1ae53a['id']}})['then'](function(){return _0x5c7c75;});})[_0xbfb4('0x26')](function(){_0x3bd69d[_0xbfb4('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cbfec,_0x21300c){return function(_0x552660){if(!_0x552660){_0x3cbfec[_0xbfb4('0x2b')](0x194);}return _0x552660;};}function handleError(_0x2b771a,_0x1a914c){_0x1a914c=_0x1a914c||0x1f4;return function(_0x3ded24){logger['error'](_0x3ded24[_0xbfb4('0x2c')]);if(_0x3ded24[_0xbfb4('0x2d')]){delete _0x3ded24['name'];}_0x2b771a[_0xbfb4('0x1b')](_0x1a914c)[_0xbfb4('0x2e')](_0x3ded24);};}exports[_0xbfb4('0x2f')]=function(_0x1237cd,_0x301a27){var _0x2f0720={},_0x4e97c3={},_0x36d264={'count':0x0,'rows':[]};var _0x4c545c=_[_0xbfb4('0x30')](db[_0xbfb4('0x31')][_0xbfb4('0x32')],function(_0x5d4e63){return{'name':_0x5d4e63['fieldName'],'type':_0x5d4e63['type'][_0xbfb4('0x33')]};});_0x4e97c3[_0xbfb4('0x34')]=_['map'](_0x4c545c,'name');_0x4e97c3[_0xbfb4('0x35')]=_['keys'](_0x1237cd[_0xbfb4('0x35')]);_0x4e97c3[_0xbfb4('0x36')]=_['intersection'](_0x4e97c3['model'],_0x4e97c3[_0xbfb4('0x35')]);_0x2f0720['attributes']=_[_0xbfb4('0x37')](_0x4e97c3[_0xbfb4('0x34')],qs['fields'](_0x1237cd[_0xbfb4('0x35')]['fields']));_0x2f0720[_0xbfb4('0x38')]=_0x2f0720[_0xbfb4('0x38')][_0xbfb4('0x39')]?_0x2f0720[_0xbfb4('0x38')]:_0x4e97c3[_0xbfb4('0x34')];if(!_0x1237cd[_0xbfb4('0x35')]['hasOwnProperty'](_0xbfb4('0x3a'))){_0x2f0720[_0xbfb4('0x1e')]=qs[_0xbfb4('0x1e')](_0x1237cd[_0xbfb4('0x35')][_0xbfb4('0x1e')]);_0x2f0720['offset']=qs['offset'](_0x1237cd[_0xbfb4('0x35')][_0xbfb4('0x20')]);}_0x2f0720[_0xbfb4('0x3b')]=qs['sort'](_0x1237cd[_0xbfb4('0x35')]['sort']);_0x2f0720['where']=qs['filters'](_[_0xbfb4('0x3c')](_0x1237cd['query'],_0x4e97c3[_0xbfb4('0x36')]),_0x4c545c);if(_0x1237cd['query']['filter']){_0x2f0720[_0xbfb4('0x3d')]=_['merge'](_0x2f0720[_0xbfb4('0x3d')],{'$or':_[_0xbfb4('0x30')](_0x4c545c,function(_0x9c522b){if(_0x9c522b['type']!==_0xbfb4('0x3e')){var _0x372722={};_0x372722[_0x9c522b[_0xbfb4('0x2d')]]={'$like':'%'+_0x1237cd[_0xbfb4('0x35')]['filter']+'%'};return _0x372722;}})});}_0x2f0720=_[_0xbfb4('0x3f')]({},_0x2f0720,_0x1237cd[_0xbfb4('0x40')]);var _0x54e585={'where':_0x2f0720['where']};return db[_0xbfb4('0x31')]['count'](_0x54e585)[_0xbfb4('0x26')](function(_0x45afc5){_0x36d264[_0xbfb4('0x1f')]=_0x45afc5;if(_0x1237cd[_0xbfb4('0x35')][_0xbfb4('0x41')]){_0x2f0720['include']=[{'all':!![]}];}return db[_0xbfb4('0x31')][_0xbfb4('0x42')](_0x2f0720);})[_0xbfb4('0x26')](function(_0x1e1832){_0x36d264['rows']=_0x1e1832;return _0x36d264;})[_0xbfb4('0x26')](respondWithFilteredResult(_0x301a27,_0x2f0720))[_0xbfb4('0x43')](handleError(_0x301a27,null));};exports[_0xbfb4('0x44')]=function(_0x3ffcda,_0x457ea4){var _0x595d5f={'raw':![],'where':{'id':_0x3ffcda[_0xbfb4('0x45')]['id']}},_0x586386={};_0x586386[_0xbfb4('0x34')]=_[_0xbfb4('0x46')](db[_0xbfb4('0x31')]['rawAttributes']);_0x586386['query']=_['keys'](_0x3ffcda[_0xbfb4('0x35')]);_0x586386[_0xbfb4('0x36')]=_['intersection'](_0x586386['model'],_0x586386[_0xbfb4('0x35')]);_0x595d5f['attributes']=_[_0xbfb4('0x37')](_0x586386['model'],qs['fields'](_0x3ffcda[_0xbfb4('0x35')][_0xbfb4('0x47')]));_0x595d5f[_0xbfb4('0x38')]=_0x595d5f['attributes'][_0xbfb4('0x39')]?_0x595d5f[_0xbfb4('0x38')]:_0x586386[_0xbfb4('0x34')];if(_0x3ffcda['query'][_0xbfb4('0x41')]){_0x595d5f[_0xbfb4('0x48')]=[{'all':!![]}];}_0x595d5f=_[_0xbfb4('0x3f')]({},_0x595d5f,_0x3ffcda[_0xbfb4('0x40')]);return db[_0xbfb4('0x31')][_0xbfb4('0x49')](_0x595d5f)['then'](handleEntityNotFound(_0x457ea4,null))[_0xbfb4('0x26')](respondWithResult(_0x457ea4,null))[_0xbfb4('0x43')](handleError(_0x457ea4,null));};exports[_0xbfb4('0x4a')]=function(_0x4cf0af,_0x1525df){return db[_0xbfb4('0x31')][_0xbfb4('0x4a')](_0x4cf0af['body'],{})[_0xbfb4('0x26')](function(_0x496b4c){var _0x58f2fc=_0x4cf0af[_0xbfb4('0x4b')][_0xbfb4('0x28')]({'plain':!![]});if(!_0x58f2fc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58f2fc[_0xbfb4('0x4c')]==='user'){var _0x1f542e=_0x496b4c['get']({'plain':!![]});var _0x523895='Reports';return db[_0xbfb4('0x4d')][_0xbfb4('0x49')]({'where':{'name':_0x523895,'userProfileId':_0x58f2fc[_0xbfb4('0x4e')]},'raw':!![]})['then'](function(_0x4e18ee){if(_0x4e18ee&&_0x4e18ee['autoAssociation']===0x0){return db[_0xbfb4('0x2a')]['create']({'name':_0x1f542e[_0xbfb4('0x2d')],'resourceId':_0x1f542e['id'],'type':_0xbfb4('0x29'),'sectionId':_0x4e18ee['id']},{})['then'](function(){return _0x496b4c;});}else{return _0x496b4c;}})[_0xbfb4('0x43')](function(_0x2e7c38){logger[_0xbfb4('0x4f')](_0xbfb4('0x50'),_0x2e7c38);throw _0x2e7c38;});}return _0x496b4c;})[_0xbfb4('0x26')](respondWithResult(_0x1525df,0xc9))[_0xbfb4('0x43')](handleError(_0x1525df,null));};exports[_0xbfb4('0x25')]=function(_0x4c616d,_0x2dfc15){if(_0x4c616d[_0xbfb4('0x51')]['id']){delete _0x4c616d['body']['id'];}return db[_0xbfb4('0x31')][_0xbfb4('0x49')]({'where':{'id':_0x4c616d[_0xbfb4('0x45')]['id']}})['then'](handleEntityNotFound(_0x2dfc15,null))[_0xbfb4('0x26')](saveUpdates(_0x4c616d[_0xbfb4('0x51')],null))[_0xbfb4('0x26')](respondWithResult(_0x2dfc15,null))['catch'](handleError(_0x2dfc15,null));};exports['destroy']=function(_0x5bf479,_0x102275){return db[_0xbfb4('0x31')][_0xbfb4('0x49')]({'where':{'id':_0x5bf479[_0xbfb4('0x45')]['id']}})[_0xbfb4('0x26')](handleEntityNotFound(_0x102275,null))[_0xbfb4('0x26')](removeEntity(_0x102275,null))['catch'](handleError(_0x102275,null));};exports[_0xbfb4('0x52')]=function(_0x1c1e4c,_0x594628){var _0x37f14f=0xa;var _0x255080=['join','left_join',_0xbfb4('0x53'),'cross_join'];var _0x3a5411={'SUM':'SUM(%s)','COUNT':_0xbfb4('0x54'),'COUNT DISTINCT':_0xbfb4('0x55'),'MAX':_0xbfb4('0x56'),'MIN':_0xbfb4('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xbfb4('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x158025={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xbfb4('0x59'),'HOUR':_0xbfb4('0x5a'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xbfb4('0x5b')};var _0x4dc1dd=function(_0x3cd278){return!_[_0xbfb4('0x5c')]([_0xbfb4('0x5d'),_0xbfb4('0x5e'),'IS\x20EMPTY',_0xbfb4('0x5f')],_0x3cd278);};var _0x1867bf=function(_0x294424){if(!_0x294424||!_0x294424[_0xbfb4('0x60')][_0xbfb4('0x39')]){return'';}for(var _0x3b110c='(',_0x101cec=0x0;_0x101cec<_0x294424[_0xbfb4('0x60')]['length'];_0x101cec+=0x1){_0x101cec>0x0&&(_0x3b110c+='\x20'+_0x294424[_0xbfb4('0x61')]+'\x20');_0x3b110c+=_0x294424[_0xbfb4('0x60')][_0x101cec][_0xbfb4('0x62')]?_0x1867bf(_0x294424[_0xbfb4('0x60')][_0x101cec][_0xbfb4('0x62')]):_0x294424[_0xbfb4('0x60')][_0x101cec][_0xbfb4('0x63')]+'\x20'+_0x294424['rules'][_0x101cec]['condition']+(_0x4dc1dd(_0x294424[_0xbfb4('0x60')][_0x101cec][_0xbfb4('0x64')])?'\x20'+_0x294424[_0xbfb4('0x60')][_0x101cec]['value']:'');}return _0x3b110c+')';};var _0x48f6c5={'where':{'id':_0x1c1e4c[_0xbfb4('0x45')]['id']}},_0x28ec5e,_0x291e86,_0x1e4815,_0xeb2b37,_0x2108f9;_0x48f6c5=_[_0xbfb4('0x3f')]({},_0x48f6c5,_0x1c1e4c[_0xbfb4('0x40')]);return db[_0xbfb4('0x31')][_0xbfb4('0x49')](_0x48f6c5)[_0xbfb4('0x26')](function(_0x3fec08){if(_0x3fec08){_0x28ec5e=_0x3fec08;return _0x3fec08[_0xbfb4('0x65')]();}return null;})[_0xbfb4('0x26')](function(_0x57ca88){if(_0x57ca88){if(!_0x57ca88[_0xbfb4('0x39')]){throw new db['Sequelize'][(_0xbfb4('0x66'))](_0xbfb4('0x67'),0x193);}_0x291e86=_0x57ca88;return db[_0xbfb4('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x475612){if(_0x475612){_0x1e4815=_[_0xbfb4('0x69')](_0x475612,'id');var _0x3139b4;var _0x53321c=squel[_0xbfb4('0x6a')]();_0x53321c[_0xbfb4('0x6b')](_0x28ec5e['table']);for(var _0xa0be76=0x0;_0xa0be76<_0x291e86[_0xbfb4('0x39')];_0xa0be76+=0x1){_0x3139b4=_0x291e86[_0xa0be76][_0xbfb4('0x6c')]?_0x1e4815[_0x291e86[_0xa0be76]['MetricId']]['metric']:_0x291e86[_0xa0be76][_0xbfb4('0x63')];_0x3139b4=_0x291e86[_0xa0be76][_0xbfb4('0x6d')]?_[_0xbfb4('0x6e')](_0x3a5411[_0x291e86[_0xa0be76][_0xbfb4('0x6d')]],'%s',_0x3139b4):_0x3139b4;_0x3139b4=_0x291e86[_0xa0be76]['format']?_[_0xbfb4('0x6e')](_0x158025[_0x291e86[_0xa0be76][_0xbfb4('0x6f')]],'%s',_0x3139b4):_0x3139b4;if(_0x291e86[_0xa0be76]['groupBy']){_0x53321c[_0xbfb4('0x62')](_0x3139b4);}_0x291e86[_0xa0be76][_0xbfb4('0x70')]&&_0x53321c[_0xbfb4('0x3b')](_0x3139b4,_0x291e86[_0xa0be76][_0xbfb4('0x70')]===_0xbfb4('0x71')?![]:!![]);_0x53321c['field'](_0x3139b4,_0x291e86[_0xa0be76][_0xbfb4('0x72')]||_0x3139b4);}if(_0x28ec5e[_0xbfb4('0x73')]){_0x28ec5e['joins']=JSON[_0xbfb4('0x74')](_0x28ec5e[_0xbfb4('0x73')]);for(var _0x4b2a16=0x0;_0x4b2a16<_0x28ec5e[_0xbfb4('0x73')][_0xbfb4('0x39')];_0x4b2a16+=0x1){if(_0x28ec5e['joins'][_0x4b2a16]['type']&&_[_0xbfb4('0x5c')](_0x255080,_0x28ec5e[_0xbfb4('0x73')][_0x4b2a16][_0xbfb4('0x75')])&&_0x28ec5e[_0xbfb4('0x73')][_0x4b2a16][_0xbfb4('0x76')]&&_0x28ec5e[_0xbfb4('0x73')][_0x4b2a16]['foreignTable']&&_0x28ec5e[_0xbfb4('0x73')][_0x4b2a16][_0xbfb4('0x77')]){_0x53321c[_0x28ec5e['joins'][_0x4b2a16][_0xbfb4('0x75')]](_0x28ec5e['joins'][_0x4b2a16]['foreignTable'],null,util[_0xbfb4('0x6f')](_0xbfb4('0x78'),_0x28ec5e[_0xbfb4('0x79')],_0x28ec5e['joins'][_0x4b2a16][_0xbfb4('0x76')],_0x28ec5e[_0xbfb4('0x73')][_0x4b2a16]['foreignTable'],_0x28ec5e[_0xbfb4('0x73')][_0x4b2a16]['foreignKey']));}}}if(_0x28ec5e[_0xbfb4('0x7a')]){_0x28ec5e[_0xbfb4('0x7a')]=JSON[_0xbfb4('0x74')](_0x28ec5e['conditions']);_0x53321c[_0xbfb4('0x3d')](_0x1867bf(_0x28ec5e[_0xbfb4('0x7a')][_0xbfb4('0x62')]));}_0x2108f9=_0x53321c[_0xbfb4('0x7b')]();_0x53321c[_0xbfb4('0x1e')](_0x37f14f);_0x53321c[_0xbfb4('0x20')](0x0);logger[_0xbfb4('0x7c')]('Limited\x20Query:',_0x53321c[_0xbfb4('0x7d')]());return dbH[_0xbfb4('0x7e')][_0xbfb4('0x35')](_0x53321c['toString'](),{'type':dbH[_0xbfb4('0x7e')]['QueryTypes'][_0xbfb4('0x7f')]});}})['then'](respondWithResult(_0x594628,null))[_0xbfb4('0x43')](handleError(_0x594628,null));};function runReport(_0x3fc96e,_0x247657,_0x25b295){var _0x5e5085=_0x247657['name'];var _0x48c6cc=0xa;var _0x90cd27=[_0xbfb4('0x80'),_0xbfb4('0x81'),_0xbfb4('0x53'),_0xbfb4('0x82')];var _0x5849d3={'SUM':_0xbfb4('0x83'),'COUNT':_0xbfb4('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xbfb4('0x57'),'AVG':_0xbfb4('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xbfb4('0x85'),'GROUP_CONCAT DESC':_0xbfb4('0x86')};var _0x1bb27a={'SEC_TO_TIME':_0xbfb4('0x87'),'DATE':_0xbfb4('0x59'),'HOUR':_0xbfb4('0x5a'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xbfb4('0x5b')};var _0x136ea8=function(_0x408b8b){return!_[_0xbfb4('0x5c')]([_0xbfb4('0x5d'),'IS\x20NOT\x20NULL',_0xbfb4('0x88'),_0xbfb4('0x5f')],_0x408b8b);};var _0x11cbb5=function(_0x2bc737){if(!_0x2bc737||!_0x2bc737[_0xbfb4('0x60')]['length']){return'';}for(var _0x2a7c03='(',_0x598c93=0x0;_0x598c93<_0x2bc737['rules'][_0xbfb4('0x39')];_0x598c93+=0x1){_0x598c93>0x0&&(_0x2a7c03+='\x20'+_0x2bc737['operator']+'\x20');_0x2a7c03+=_0x2bc737[_0xbfb4('0x60')][_0x598c93][_0xbfb4('0x62')]?_0x11cbb5(_0x2bc737[_0xbfb4('0x60')][_0x598c93][_0xbfb4('0x62')]):_0x2bc737[_0xbfb4('0x60')][_0x598c93][_0xbfb4('0x63')]+'\x20'+_0x2bc737['rules'][_0x598c93][_0xbfb4('0x64')]+(_0x136ea8(_0x2bc737[_0xbfb4('0x60')][_0x598c93][_0xbfb4('0x64')])?'\x20'+_0x2bc737['rules'][_0x598c93]['value']:'');}return _0x2a7c03+')';};var _0x54e15c={'where':{'id':_0x3fc96e['id']}},_0x4191f7,_0x4a63f6,_0x4d0a4d,_0x589c3f,_0x369e42;_0x54e15c=_[_0xbfb4('0x3f')]({},_0x54e15c,_0x25b295);return db[_0xbfb4('0x31')][_0xbfb4('0x49')](_0x54e15c)['then'](function(_0xf92b18){if(_0xf92b18){_0x4191f7=_0xf92b18;return _0xf92b18[_0xbfb4('0x65')]();}return null;})[_0xbfb4('0x26')](function(_0x38aa74){if(_0x38aa74){if(!_0x38aa74['length']){throw new db['Sequelize'][(_0xbfb4('0x66'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4a63f6=_0x38aa74;return db[_0xbfb4('0x68')][_0xbfb4('0x42')]({'raw':!![]});}return null;})['then'](function(_0x28faf9){if(_0x28faf9){_0x4d0a4d=_[_0xbfb4('0x69')](_0x28faf9,'id');var _0x26cf7c;var _0x337cb4=squel['select']();_0x337cb4[_0xbfb4('0x6b')](_0x4191f7['table']);for(var _0xdfd8d1=0x0;_0xdfd8d1<_0x4a63f6[_0xbfb4('0x39')];_0xdfd8d1+=0x1){_0x26cf7c=_0x4a63f6[_0xdfd8d1][_0xbfb4('0x6c')]?_0x4d0a4d[_0x4a63f6[_0xdfd8d1][_0xbfb4('0x6c')]][_0xbfb4('0x89')]:_0x4a63f6[_0xdfd8d1][_0xbfb4('0x63')];_0x26cf7c=_0x4a63f6[_0xdfd8d1][_0xbfb4('0x6d')]?_[_0xbfb4('0x6e')](_0x5849d3[_0x4a63f6[_0xdfd8d1][_0xbfb4('0x6d')]],'%s',_0x26cf7c):_0x26cf7c;_0x26cf7c=_0x4a63f6[_0xdfd8d1][_0xbfb4('0x6f')]?_[_0xbfb4('0x6e')](_0x1bb27a[_0x4a63f6[_0xdfd8d1][_0xbfb4('0x6f')]],'%s',_0x26cf7c):_0x26cf7c;if(_0x4a63f6[_0xdfd8d1][_0xbfb4('0x8a')]){_0x337cb4['group'](_0x26cf7c);}_0x4a63f6[_0xdfd8d1][_0xbfb4('0x70')]&&_0x337cb4[_0xbfb4('0x3b')](_0x26cf7c,_0x4a63f6[_0xdfd8d1]['orderBy']===_0xbfb4('0x71')?![]:!![]);_0x337cb4[_0xbfb4('0x63')](_0x26cf7c,_0x4a63f6[_0xdfd8d1][_0xbfb4('0x72')]||_0x26cf7c);}if(_0x4191f7['joins']){_0x4191f7[_0xbfb4('0x73')]=JSON[_0xbfb4('0x74')](_0x4191f7['joins']);for(var _0x151409=0x0;_0x151409<_0x4191f7['joins'][_0xbfb4('0x39')];_0x151409+=0x1){if(_0x4191f7['joins'][_0x151409][_0xbfb4('0x75')]&&_[_0xbfb4('0x5c')](_0x90cd27,_0x4191f7[_0xbfb4('0x73')][_0x151409]['type'])&&_0x4191f7[_0xbfb4('0x73')][_0x151409][_0xbfb4('0x76')]&&_0x4191f7[_0xbfb4('0x73')][_0x151409]['foreignTable']&&_0x4191f7[_0xbfb4('0x73')][_0x151409]['foreignKey']){_0x337cb4[_0x4191f7[_0xbfb4('0x73')][_0x151409][_0xbfb4('0x75')]](_0x4191f7[_0xbfb4('0x73')][_0x151409][_0xbfb4('0x8b')],null,util[_0xbfb4('0x6f')]('%s.%s\x20=\x20%s.%s',_0x4191f7['table'],_0x4191f7[_0xbfb4('0x73')][_0x151409][_0xbfb4('0x76')],_0x4191f7['joins'][_0x151409]['foreignTable'],_0x4191f7[_0xbfb4('0x73')][_0x151409][_0xbfb4('0x77')]));}}}if(_0x4191f7[_0xbfb4('0x7a')]){_0x4191f7[_0xbfb4('0x7a')]=JSON[_0xbfb4('0x74')](_0x4191f7['conditions']);_0x337cb4[_0xbfb4('0x3d')](_0x11cbb5(_0x4191f7['conditions']['group']));}_0x369e42=_0x337cb4[_0xbfb4('0x7b')]();_0x337cb4[_0xbfb4('0x1e')](_0x48c6cc);_0x337cb4['offset'](0x0);return;}})[_0xbfb4('0x26')](function(){if(_0x247657[_0xbfb4('0x8c')]==='web'){return null;}var _0x3b3ad0=_['merge'](_0x247657,{'name':_0x247657[_0xbfb4('0x8d')]||_0x247657[_0xbfb4('0x2d')]||_0x4191f7[_0xbfb4('0x2d')],'basename':_0x5e5085,'savename':util[_0xbfb4('0x6f')](_0xbfb4('0x8e'),_0x247657[_0xbfb4('0x2d')]||_0x4191f7[_0xbfb4('0x2d')],require(_0xbfb4('0x8f'))['generate'](0x4),_0x247657[_0xbfb4('0x8c')]||_0xbfb4('0x90')),'reportId':_0x4191f7['id'],'reportType':'custom'});return db[_0xbfb4('0x91')]['create'](_0x3b3ad0,{'raw':!![]});})['then'](function(_0x5b305a){if(_0x4191f7['table']==='cdr'){_0x369e42[_0xbfb4('0x3d')](_0x4191f7[_0xbfb4('0x79')]+_0xbfb4('0x92'),_0x247657[_0xbfb4('0x93')],_0x247657['endDate']);}else{_0x369e42[_0xbfb4('0x3d')](_0x4191f7[_0xbfb4('0x79')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x247657[_0xbfb4('0x93')],_0x247657[_0xbfb4('0x94')]);}if(_0x5b305a){logger[_0xbfb4('0x95')]('Run\x20Query:',_0x369e42['toString']());require(_0xbfb4('0x96'))[_0xbfb4('0x97')](path['join'](__dirname,'../../components/export/',_0x5b305a['output']),[_0x5b305a['id'],_0x369e42[_0xbfb4('0x7d')](),path[_0xbfb4('0x80')](__dirname,_0xbfb4('0x98'),_0x5b305a[_0xbfb4('0x99')]),_0x5e5085]);return _0x5b305a;}else{var _0x36db96=squel[_0xbfb4('0x6a')]();_0x36db96['from']('('+_0x369e42['toString']()+')',_0xbfb4('0x9a'));_0x36db96[_0xbfb4('0x63')]('COUNT(*)','count');_0x369e42[_0xbfb4('0x1e')](_0x247657[_0xbfb4('0x1e')]||_0x48c6cc);_0x369e42['offset'](_0x247657[_0xbfb4('0x20')]||0x0);return dbH['sequelize'][_0xbfb4('0x35')](_0x36db96[_0xbfb4('0x7d')](),{'type':dbH[_0xbfb4('0x7e')][_0xbfb4('0x9b')]['SELECT']})[_0xbfb4('0x26')](function(_0x23845c){if(!_0x23845c[_0xbfb4('0x39')]){_0x589c3f=0x0;}else{_0x589c3f=_0x23845c[0x0]['count']||0x0;}return dbH['sequelize'][_0xbfb4('0x35')](_0x369e42[_0xbfb4('0x7d')](),{'type':dbH['sequelize'][_0xbfb4('0x9b')][_0xbfb4('0x7f')]});})[_0xbfb4('0x26')](function(_0x39de82){return{'rows':_0x39de82||[],'count':_0x589c3f};});}});}exports['run']=function(_0x171d00,_0x4b89e2){return runReport(_0x171d00[_0xbfb4('0x45')],_0x171d00['query'],_0x171d00['options'])[_0xbfb4('0x26')](respondWithResult(_0x4b89e2,null))[_0xbfb4('0x43')](handleError(_0x4b89e2,null));};exports[_0xbfb4('0x9c')]=runReport;exports[_0xbfb4('0x35')]=function(_0x11694b,_0x415fc6){var _0x6e79a1=0xa;var _0x1010ce=[_0xbfb4('0x80'),'left_join',_0xbfb4('0x53'),_0xbfb4('0x82')];var _0x4b4556={'SUM':_0xbfb4('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xbfb4('0x55'),'MAX':'MAX(%s)','MIN':_0xbfb4('0x57'),'AVG':_0xbfb4('0x84'),'GROUP_CONCAT':_0xbfb4('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xbfb4('0x86')};var _0x2c85f9={'SEC_TO_TIME':_0xbfb4('0x87'),'DATE':_0xbfb4('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xbfb4('0x9d'),'UNIX_TIMESTAMP':_0xbfb4('0x5b')};var _0x2dd52f=function(_0x113919){return!_[_0xbfb4('0x5c')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xbfb4('0x88'),_0xbfb4('0x5f')],_0x113919);};var _0x434184=function(_0x44394b){if(!_0x44394b||!_0x44394b[_0xbfb4('0x60')][_0xbfb4('0x39')]){return'';}for(var _0x3fc715='(',_0x4e8e32=0x0;_0x4e8e32<_0x44394b['rules']['length'];_0x4e8e32+=0x1){_0x4e8e32>0x0&&(_0x3fc715+='\x20'+_0x44394b[_0xbfb4('0x61')]+'\x20');_0x3fc715+=_0x44394b['rules'][_0x4e8e32][_0xbfb4('0x62')]?_0x434184(_0x44394b[_0xbfb4('0x60')][_0x4e8e32][_0xbfb4('0x62')]):_0x44394b[_0xbfb4('0x60')][_0x4e8e32][_0xbfb4('0x63')]+'\x20'+_0x44394b[_0xbfb4('0x60')][_0x4e8e32][_0xbfb4('0x64')]+(_0x2dd52f(_0x44394b[_0xbfb4('0x60')][_0x4e8e32][_0xbfb4('0x64')])?'\x20'+_0x44394b[_0xbfb4('0x60')][_0x4e8e32]['value']:'');}return _0x3fc715+')';};var _0x56bae2={'where':{'id':_0x11694b[_0xbfb4('0x45')]['id']}},_0x426698,_0x53e786,_0x421221,_0x36e549,_0x2f6100;_0x56bae2=_[_0xbfb4('0x3f')]({},_0x56bae2,_0x11694b[_0xbfb4('0x40')]);return db[_0xbfb4('0x31')]['find'](_0x56bae2)['then'](function(_0x1558d4){if(_0x1558d4){_0x426698=_0x1558d4;return _0x1558d4[_0xbfb4('0x65')]();}return null;})[_0xbfb4('0x26')](function(_0x3f6323){if(_0x3f6323){if(!_0x3f6323[_0xbfb4('0x39')]){throw new db[(_0xbfb4('0x9e'))]['ValidationErrorItem'](_0xbfb4('0x67'),0x193);}_0x53e786=_0x3f6323;return db['AnalyticMetric'][_0xbfb4('0x42')]({'raw':!![]});}return null;})['then'](function(_0x31fe1d){if(_0x31fe1d){_0x421221=_[_0xbfb4('0x69')](_0x31fe1d,'id');var _0x5b2b96;var _0x264441=squel[_0xbfb4('0x6a')]();_0x264441[_0xbfb4('0x6b')](_0x426698[_0xbfb4('0x79')]);for(var _0x15b757=0x0;_0x15b757<_0x53e786['length'];_0x15b757+=0x1){_0x5b2b96=_0x53e786[_0x15b757][_0xbfb4('0x6c')]?_0x421221[_0x53e786[_0x15b757]['MetricId']][_0xbfb4('0x89')]:_0x53e786[_0x15b757][_0xbfb4('0x63')];_0x5b2b96=_0x53e786[_0x15b757][_0xbfb4('0x6d')]?_['replace'](_0x4b4556[_0x53e786[_0x15b757][_0xbfb4('0x6d')]],'%s',_0x5b2b96):_0x5b2b96;_0x5b2b96=_0x53e786[_0x15b757][_0xbfb4('0x6f')]?_[_0xbfb4('0x6e')](_0x2c85f9[_0x53e786[_0x15b757][_0xbfb4('0x6f')]],'%s',_0x5b2b96):_0x5b2b96;if(_0x53e786[_0x15b757]['groupBy']){_0x264441['group'](_0x5b2b96);}_0x53e786[_0x15b757]['orderBy']&&_0x264441[_0xbfb4('0x3b')](_0x5b2b96,_0x53e786[_0x15b757][_0xbfb4('0x70')]===_0xbfb4('0x71')?![]:!![]);_0x264441[_0xbfb4('0x63')](_0x5b2b96,_0x53e786[_0x15b757][_0xbfb4('0x72')]||_0x5b2b96);}if(_0x426698[_0xbfb4('0x73')]){_0x426698[_0xbfb4('0x73')]=JSON[_0xbfb4('0x74')](_0x426698[_0xbfb4('0x73')]);for(var _0x4ec9ec=0x0;_0x4ec9ec<_0x426698[_0xbfb4('0x73')][_0xbfb4('0x39')];_0x4ec9ec+=0x1){if(_0x426698['joins'][_0x4ec9ec][_0xbfb4('0x75')]&&_[_0xbfb4('0x5c')](_0x1010ce,_0x426698[_0xbfb4('0x73')][_0x4ec9ec]['type'])&&_0x426698[_0xbfb4('0x73')][_0x4ec9ec][_0xbfb4('0x76')]&&_0x426698['joins'][_0x4ec9ec][_0xbfb4('0x8b')]&&_0x426698[_0xbfb4('0x73')][_0x4ec9ec]['foreignKey']){_0x264441[_0x426698[_0xbfb4('0x73')][_0x4ec9ec][_0xbfb4('0x75')]](_0x426698[_0xbfb4('0x73')][_0x4ec9ec]['foreignTable'],null,util[_0xbfb4('0x6f')](_0xbfb4('0x78'),_0x426698[_0xbfb4('0x79')],_0x426698[_0xbfb4('0x73')][_0x4ec9ec]['parentKey'],_0x426698[_0xbfb4('0x73')][_0x4ec9ec]['foreignTable'],_0x426698[_0xbfb4('0x73')][_0x4ec9ec][_0xbfb4('0x77')]));}}}if(_0x426698[_0xbfb4('0x7a')]){_0x426698[_0xbfb4('0x7a')]=JSON[_0xbfb4('0x74')](_0x426698['conditions']);_0x264441[_0xbfb4('0x3d')](_0x434184(_0x426698[_0xbfb4('0x7a')][_0xbfb4('0x62')]));}_0x2f6100=_0x264441[_0xbfb4('0x7b')]();_0x264441[_0xbfb4('0x1e')](_0x6e79a1);_0x264441[_0xbfb4('0x20')](0x0);logger['debug'](_0xbfb4('0x9f'),_0x264441[_0xbfb4('0x7d')]());return dbH[_0xbfb4('0x7e')]['query'](_0x264441['toString'](),{'type':dbH[_0xbfb4('0x7e')][_0xbfb4('0x9b')][_0xbfb4('0x7f')]});}})['then'](function(){return{'sql':_0x2f6100[_0xbfb4('0x7d')]()};})['then'](respondWithResult(_0x415fc6,null))[_0xbfb4('0x43')](handleError(_0x415fc6,null));};
\ No newline at end of file
+var _0x0bda=['table','MetricId','function','format','replace','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','debug','toString','sequelize','QueryTypes','left_join','right_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','findAll','metric','%s.%s\x20=\x20%s.%s','parse','clone','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','select','countTable','COUNT(*)','SELECT','runReport','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','lodash','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','destroy','then','get','CustomReports','UserProfileResource','end','error','name','send','index','map','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','AnalyticCustomReport','rows','catch','params','keys','find','create','body','role','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from'];(function(_0x39de34,_0xf7f030){var _0x3dfd2c=function(_0x3b4399){while(--_0x3b4399){_0x39de34['push'](_0x39de34['shift']());}};_0x3dfd2c(++_0xf7f030);}(_0x0bda,0xda));var _0xa0bd=function(_0x248093,_0x4d9d63){_0x248093=_0x248093-0x0;var _0x23de45=_0x0bda[_0x248093];return _0x23de45;};'use strict';var emlformat=require(_0xa0bd('0x0'));var rimraf=require(_0xa0bd('0x1'));var zipdir=require(_0xa0bd('0x2'));var jsonpatch=require(_0xa0bd('0x3'));var rp=require(_0xa0bd('0x4'));var moment=require(_0xa0bd('0x5'));var BPromise=require(_0xa0bd('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa0bd('0x7'));var sox=require(_0xa0bd('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0bd('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa0bd('0xa'));var deskjs=require(_0xa0bd('0xb'));var toCsv=require(_0xa0bd('0xc'));var querystring=require(_0xa0bd('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa0bd('0xe'));var qs=require(_0xa0bd('0xf'));var as=require(_0xa0bd('0x10'));var hardwareService=require(_0xa0bd('0x11'));var logger=require(_0xa0bd('0x12'))(_0xa0bd('0x13'));var utils=require(_0xa0bd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa0bd('0x15'));var db=require(_0xa0bd('0x16'))['db'];var dbH=require(_0xa0bd('0x16'))[_0xa0bd('0x17')];function respondWithStatusCode(_0x12365b,_0x5808f3){_0x5808f3=_0x5808f3||0xcc;return function(_0x2942e8){if(_0x2942e8){return _0x12365b[_0xa0bd('0x18')](_0x5808f3);}return _0x12365b['status'](_0x5808f3)['end']();};}function respondWithResult(_0x5046bc,_0x54ee28){_0x54ee28=_0x54ee28||0xc8;return function(_0x57f0ea){if(_0x57f0ea){return _0x5046bc[_0xa0bd('0x19')](_0x54ee28)[_0xa0bd('0x1a')](_0x57f0ea);}};}function respondWithFilteredResult(_0x273f3e,_0x4c6e04){return function(_0x4f6af3){if(_0x4f6af3){var _0x1a0fa8=typeof _0x4c6e04[_0xa0bd('0x1b')]==='undefined'&&typeof _0x4c6e04[_0xa0bd('0x1c')]===_0xa0bd('0x1d');var _0x37ae54=_0x4f6af3['count'];var _0x31c3a9=_0x1a0fa8?0x0:_0x4c6e04[_0xa0bd('0x1b')];var _0x38644d=_0x1a0fa8?_0x4f6af3['count']:_0x4c6e04[_0xa0bd('0x1b')]+_0x4c6e04[_0xa0bd('0x1c')];var _0x2f0af5;if(_0x38644d>=_0x37ae54){_0x38644d=_0x37ae54;_0x2f0af5=0xc8;}else{_0x2f0af5=0xce;}_0x273f3e[_0xa0bd('0x19')](_0x2f0af5);return _0x273f3e[_0xa0bd('0x1e')](_0xa0bd('0x1f'),_0x31c3a9+'-'+_0x38644d+'/'+_0x37ae54)[_0xa0bd('0x1a')](_0x4f6af3);}return null;};}function patchUpdates(_0x4cde14){return function(_0x1bd627){try{jsonpatch[_0xa0bd('0x20')](_0x1bd627,_0x4cde14,!![]);}catch(_0xc12aae){return BPromise[_0xa0bd('0x21')](_0xc12aae);}return _0x1bd627[_0xa0bd('0x22')]();};}function saveUpdates(_0x4bf2ad,_0x21076e){return function(_0x35041e){if(_0x35041e){return _0x35041e[_0xa0bd('0x23')](_0x4bf2ad)['then'](function(_0x1d8864){return _0x1d8864;});}return null;};}function removeEntity(_0x50fae7,_0x1678e3){return function(_0x2f6b5a){if(_0x2f6b5a){return _0x2f6b5a[_0xa0bd('0x24')]()[_0xa0bd('0x25')](function(){var _0x4bbfd8=_0x2f6b5a[_0xa0bd('0x26')]({'plain':!![]});var _0x50a1eb=_0xa0bd('0x27');return db[_0xa0bd('0x28')][_0xa0bd('0x24')]({'where':{'type':_0x50a1eb,'resourceId':_0x4bbfd8['id']}})[_0xa0bd('0x25')](function(){return _0x2f6b5a;});})[_0xa0bd('0x25')](function(){_0x50fae7[_0xa0bd('0x19')](0xcc)[_0xa0bd('0x29')]();});}};}function handleEntityNotFound(_0x435316,_0x356869){return function(_0x126d9b){if(!_0x126d9b){_0x435316['sendStatus'](0x194);}return _0x126d9b;};}function handleError(_0x76deb6,_0xb1c1c3){_0xb1c1c3=_0xb1c1c3||0x1f4;return function(_0x16a3fb){logger[_0xa0bd('0x2a')](_0x16a3fb['stack']);if(_0x16a3fb[_0xa0bd('0x2b')]){delete _0x16a3fb[_0xa0bd('0x2b')];}_0x76deb6['status'](_0xb1c1c3)[_0xa0bd('0x2c')](_0x16a3fb);};}exports[_0xa0bd('0x2d')]=function(_0x1f7338,_0x47d199){var _0x5c9ec1={},_0x2c3ae7={},_0x22a8d5={'count':0x0,'rows':[]};var _0x459cdb=_[_0xa0bd('0x2e')](db['AnalyticCustomReport']['rawAttributes'],function(_0x971e70){return{'name':_0x971e70['fieldName'],'type':_0x971e70[_0xa0bd('0x2f')][_0xa0bd('0x30')]};});_0x2c3ae7[_0xa0bd('0x31')]=_[_0xa0bd('0x2e')](_0x459cdb,_0xa0bd('0x2b'));_0x2c3ae7['query']=_['keys'](_0x1f7338[_0xa0bd('0x32')]);_0x2c3ae7[_0xa0bd('0x33')]=_[_0xa0bd('0x34')](_0x2c3ae7['model'],_0x2c3ae7[_0xa0bd('0x32')]);_0x5c9ec1[_0xa0bd('0x35')]=_[_0xa0bd('0x34')](_0x2c3ae7[_0xa0bd('0x31')],qs['fields'](_0x1f7338[_0xa0bd('0x32')][_0xa0bd('0x36')]));_0x5c9ec1['attributes']=_0x5c9ec1[_0xa0bd('0x35')][_0xa0bd('0x37')]?_0x5c9ec1[_0xa0bd('0x35')]:_0x2c3ae7['model'];if(!_0x1f7338[_0xa0bd('0x32')][_0xa0bd('0x38')]('nolimit')){_0x5c9ec1[_0xa0bd('0x1c')]=qs[_0xa0bd('0x1c')](_0x1f7338[_0xa0bd('0x32')][_0xa0bd('0x1c')]);_0x5c9ec1[_0xa0bd('0x1b')]=qs[_0xa0bd('0x1b')](_0x1f7338[_0xa0bd('0x32')][_0xa0bd('0x1b')]);}_0x5c9ec1[_0xa0bd('0x39')]=qs['sort'](_0x1f7338['query'][_0xa0bd('0x3a')]);_0x5c9ec1[_0xa0bd('0x3b')]=qs[_0xa0bd('0x33')](_[_0xa0bd('0x3c')](_0x1f7338['query'],_0x2c3ae7['filters']),_0x459cdb);if(_0x1f7338[_0xa0bd('0x32')][_0xa0bd('0x3d')]){_0x5c9ec1[_0xa0bd('0x3b')]=_[_0xa0bd('0x3e')](_0x5c9ec1[_0xa0bd('0x3b')],{'$or':_['map'](_0x459cdb,function(_0x42f6b3){if(_0x42f6b3['type']!==_0xa0bd('0x3f')){var _0x33fc06={};_0x33fc06[_0x42f6b3[_0xa0bd('0x2b')]]={'$like':'%'+_0x1f7338[_0xa0bd('0x32')]['filter']+'%'};return _0x33fc06;}})});}_0x5c9ec1=_[_0xa0bd('0x3e')]({},_0x5c9ec1,_0x1f7338[_0xa0bd('0x40')]);var _0x57a645={'where':_0x5c9ec1[_0xa0bd('0x3b')]};return db['AnalyticCustomReport'][_0xa0bd('0x41')](_0x57a645)[_0xa0bd('0x25')](function(_0x514f04){_0x22a8d5[_0xa0bd('0x41')]=_0x514f04;if(_0x1f7338['query'][_0xa0bd('0x42')]){_0x5c9ec1[_0xa0bd('0x43')]=[{'all':!![]}];}return db[_0xa0bd('0x44')]['findAll'](_0x5c9ec1);})[_0xa0bd('0x25')](function(_0x2290ac){_0x22a8d5[_0xa0bd('0x45')]=_0x2290ac;return _0x22a8d5;})['then'](respondWithFilteredResult(_0x47d199,_0x5c9ec1))[_0xa0bd('0x46')](handleError(_0x47d199,null));};exports['show']=function(_0x331065,_0x395cad){var _0x119fa6={'raw':![],'where':{'id':_0x331065[_0xa0bd('0x47')]['id']}},_0x230983={};_0x230983['model']=_['keys'](db[_0xa0bd('0x44')]['rawAttributes']);_0x230983['query']=_[_0xa0bd('0x48')](_0x331065['query']);_0x230983[_0xa0bd('0x33')]=_[_0xa0bd('0x34')](_0x230983[_0xa0bd('0x31')],_0x230983[_0xa0bd('0x32')]);_0x119fa6[_0xa0bd('0x35')]=_[_0xa0bd('0x34')](_0x230983[_0xa0bd('0x31')],qs[_0xa0bd('0x36')](_0x331065[_0xa0bd('0x32')][_0xa0bd('0x36')]));_0x119fa6['attributes']=_0x119fa6['attributes'][_0xa0bd('0x37')]?_0x119fa6[_0xa0bd('0x35')]:_0x230983[_0xa0bd('0x31')];if(_0x331065['query']['includeAll']){_0x119fa6[_0xa0bd('0x43')]=[{'all':!![]}];}_0x119fa6=_[_0xa0bd('0x3e')]({},_0x119fa6,_0x331065[_0xa0bd('0x40')]);return db[_0xa0bd('0x44')][_0xa0bd('0x49')](_0x119fa6)[_0xa0bd('0x25')](handleEntityNotFound(_0x395cad,null))[_0xa0bd('0x25')](respondWithResult(_0x395cad,null))[_0xa0bd('0x46')](handleError(_0x395cad,null));};exports[_0xa0bd('0x4a')]=function(_0x4e852b,_0x307106){return db[_0xa0bd('0x44')][_0xa0bd('0x4a')](_0x4e852b[_0xa0bd('0x4b')],{})[_0xa0bd('0x25')](function(_0x50bc6b){var _0x145631=_0x4e852b['user'][_0xa0bd('0x26')]({'plain':!![]});if(!_0x145631)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x145631[_0xa0bd('0x4c')]==='user'){var _0x41ead6=_0x50bc6b[_0xa0bd('0x26')]({'plain':!![]});var _0x1002ae=_0xa0bd('0x4d');return db['UserProfileSection'][_0xa0bd('0x49')]({'where':{'name':_0x1002ae,'userProfileId':_0x145631[_0xa0bd('0x4e')]},'raw':!![]})[_0xa0bd('0x25')](function(_0x3b071b){if(_0x3b071b&&_0x3b071b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x41ead6['name'],'resourceId':_0x41ead6['id'],'type':_0xa0bd('0x27'),'sectionId':_0x3b071b['id']},{})[_0xa0bd('0x25')](function(){return _0x50bc6b;});}else{return _0x50bc6b;}})[_0xa0bd('0x46')](function(_0xb397e){logger[_0xa0bd('0x2a')](_0xa0bd('0x4f'),_0xb397e);throw _0xb397e;});}return _0x50bc6b;})[_0xa0bd('0x25')](respondWithResult(_0x307106,0xc9))[_0xa0bd('0x46')](handleError(_0x307106,null));};exports[_0xa0bd('0x23')]=function(_0x58a4ab,_0x4cd199){if(_0x58a4ab[_0xa0bd('0x4b')]['id']){delete _0x58a4ab[_0xa0bd('0x4b')]['id'];}return db[_0xa0bd('0x44')]['find']({'where':{'id':_0x58a4ab[_0xa0bd('0x47')]['id']}})[_0xa0bd('0x25')](handleEntityNotFound(_0x4cd199,null))[_0xa0bd('0x25')](saveUpdates(_0x58a4ab['body'],null))['then'](respondWithResult(_0x4cd199,null))[_0xa0bd('0x46')](handleError(_0x4cd199,null));};exports[_0xa0bd('0x24')]=function(_0x373c9b,_0x501c91){return db[_0xa0bd('0x44')][_0xa0bd('0x49')]({'where':{'id':_0x373c9b['params']['id']}})[_0xa0bd('0x25')](handleEntityNotFound(_0x501c91,null))[_0xa0bd('0x25')](removeEntity(_0x501c91,null))['catch'](handleError(_0x501c91,null));};exports[_0xa0bd('0x50')]=function(_0x4d03a4,_0x28074a){var _0xee2e41=0xa;var _0x5a5973=[_0xa0bd('0x51'),'left_join','right_join',_0xa0bd('0x52')];var _0x1c6cc0={'SUM':_0xa0bd('0x53'),'COUNT':_0xa0bd('0x54'),'COUNT DISTINCT':_0xa0bd('0x55'),'MAX':_0xa0bd('0x56'),'MIN':_0xa0bd('0x57'),'AVG':_0xa0bd('0x58'),'GROUP_CONCAT':_0xa0bd('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xa0bd('0x5a')};var _0x1829d3={'SEC_TO_TIME':_0xa0bd('0x5b'),'DATE':'DATE(%s)','HOUR':_0xa0bd('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x58dc09=function(_0x266a67){return!_[_0xa0bd('0x5d')]([_0xa0bd('0x5e'),_0xa0bd('0x5f'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x266a67);};var _0x1353fd=function(_0x58d31f){if(!_0x58d31f||!_0x58d31f['rules'][_0xa0bd('0x37')]){return'';}for(var _0x1b6f83='(',_0x5de1fc=0x0;_0x5de1fc<_0x58d31f[_0xa0bd('0x60')][_0xa0bd('0x37')];_0x5de1fc+=0x1){_0x5de1fc>0x0&&(_0x1b6f83+='\x20'+_0x58d31f[_0xa0bd('0x61')]+'\x20');_0x1b6f83+=_0x58d31f[_0xa0bd('0x60')][_0x5de1fc][_0xa0bd('0x62')]?_0x1353fd(_0x58d31f[_0xa0bd('0x60')][_0x5de1fc][_0xa0bd('0x62')]):_0x58d31f[_0xa0bd('0x60')][_0x5de1fc][_0xa0bd('0x63')]+'\x20'+_0x58d31f[_0xa0bd('0x60')][_0x5de1fc][_0xa0bd('0x64')]+(_0x58dc09(_0x58d31f[_0xa0bd('0x60')][_0x5de1fc]['condition'])?'\x20'+_0x58d31f[_0xa0bd('0x60')][_0x5de1fc][_0xa0bd('0x65')]:'');}return _0x1b6f83+')';};var _0x24feff={'where':{'id':_0x4d03a4[_0xa0bd('0x47')]['id']}},_0x3133a1,_0x42f75c,_0x1f3935,_0x6d65fd,_0x7c975c;_0x24feff=_[_0xa0bd('0x3e')]({},_0x24feff,_0x4d03a4['options']);return db['AnalyticCustomReport'][_0xa0bd('0x49')](_0x24feff)['then'](function(_0x4aa3e3){if(_0x4aa3e3){_0x3133a1=_0x4aa3e3;return _0x4aa3e3[_0xa0bd('0x66')]();}return null;})['then'](function(_0x31efcb){if(_0x31efcb){if(!_0x31efcb[_0xa0bd('0x37')]){throw new db[(_0xa0bd('0x67'))][(_0xa0bd('0x68'))](_0xa0bd('0x69'),0x193);}_0x42f75c=_0x31efcb;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xa0bd('0x25')](function(_0x45e864){if(_0x45e864){_0x1f3935=_[_0xa0bd('0x6a')](_0x45e864,'id');var _0x4d3beb;var _0xcf3bc9=squel['select']();_0xcf3bc9[_0xa0bd('0x6b')](_0x3133a1[_0xa0bd('0x6c')]);for(var _0x17528c=0x0;_0x17528c<_0x42f75c['length'];_0x17528c+=0x1){_0x4d3beb=_0x42f75c[_0x17528c][_0xa0bd('0x6d')]?_0x1f3935[_0x42f75c[_0x17528c]['MetricId']]['metric']:_0x42f75c[_0x17528c][_0xa0bd('0x63')];_0x4d3beb=_0x42f75c[_0x17528c]['function']?_['replace'](_0x1c6cc0[_0x42f75c[_0x17528c][_0xa0bd('0x6e')]],'%s',_0x4d3beb):_0x4d3beb;_0x4d3beb=_0x42f75c[_0x17528c][_0xa0bd('0x6f')]?_[_0xa0bd('0x70')](_0x1829d3[_0x42f75c[_0x17528c][_0xa0bd('0x6f')]],'%s',_0x4d3beb):_0x4d3beb;if(_0x42f75c[_0x17528c][_0xa0bd('0x71')]){_0xcf3bc9[_0xa0bd('0x62')](_0x4d3beb);}_0x42f75c[_0x17528c]['orderBy']&&_0xcf3bc9[_0xa0bd('0x39')](_0x4d3beb,_0x42f75c[_0x17528c][_0xa0bd('0x72')]===_0xa0bd('0x73')?![]:!![]);_0xcf3bc9[_0xa0bd('0x63')](_0x4d3beb,_0x42f75c[_0x17528c][_0xa0bd('0x74')]||_0x4d3beb);}if(_0x3133a1[_0xa0bd('0x75')]){_0x3133a1[_0xa0bd('0x75')]=JSON['parse'](_0x3133a1[_0xa0bd('0x75')]);for(var _0x1c5397=0x0;_0x1c5397<_0x3133a1[_0xa0bd('0x75')][_0xa0bd('0x37')];_0x1c5397+=0x1){if(_0x3133a1['joins'][_0x1c5397][_0xa0bd('0x2f')]&&_[_0xa0bd('0x5d')](_0x5a5973,_0x3133a1[_0xa0bd('0x75')][_0x1c5397]['type'])&&_0x3133a1['joins'][_0x1c5397][_0xa0bd('0x76')]&&_0x3133a1[_0xa0bd('0x75')][_0x1c5397]['foreignTable']&&_0x3133a1[_0xa0bd('0x75')][_0x1c5397]['foreignKey']){_0xcf3bc9[_0x3133a1['joins'][_0x1c5397][_0xa0bd('0x2f')]](_0x3133a1[_0xa0bd('0x75')][_0x1c5397][_0xa0bd('0x77')],null,util[_0xa0bd('0x6f')]('%s.%s\x20=\x20%s.%s',_0x3133a1['table'],_0x3133a1['joins'][_0x1c5397]['parentKey'],_0x3133a1[_0xa0bd('0x75')][_0x1c5397][_0xa0bd('0x77')],_0x3133a1[_0xa0bd('0x75')][_0x1c5397][_0xa0bd('0x78')]));}}}if(_0x3133a1[_0xa0bd('0x79')]){_0x3133a1['conditions']=JSON['parse'](_0x3133a1[_0xa0bd('0x79')]);_0xcf3bc9[_0xa0bd('0x3b')](_0x1353fd(_0x3133a1[_0xa0bd('0x79')][_0xa0bd('0x62')]));}_0x7c975c=_0xcf3bc9['clone']();_0xcf3bc9[_0xa0bd('0x1c')](_0xee2e41);_0xcf3bc9['offset'](0x0);logger[_0xa0bd('0x7a')]('Limited\x20Query:',_0xcf3bc9[_0xa0bd('0x7b')]());return dbH[_0xa0bd('0x7c')][_0xa0bd('0x32')](_0xcf3bc9['toString'](),{'type':dbH[_0xa0bd('0x7c')][_0xa0bd('0x7d')]['SELECT']});}})['then'](respondWithResult(_0x28074a,null))[_0xa0bd('0x46')](handleError(_0x28074a,null));};function runReport(_0x52a2c4,_0x1d3c9c,_0x3d168b){var _0x744f26=_0x1d3c9c['name'];var _0x188b6f=0xa;var _0x24dd01=[_0xa0bd('0x51'),_0xa0bd('0x7e'),_0xa0bd('0x7f'),_0xa0bd('0x52')];var _0xa1d3a={'SUM':_0xa0bd('0x53'),'COUNT':_0xa0bd('0x54'),'COUNT DISTINCT':_0xa0bd('0x55'),'MAX':_0xa0bd('0x56'),'MIN':'MIN(%s)','AVG':_0xa0bd('0x58'),'GROUP_CONCAT':_0xa0bd('0x59'),'GROUP_CONCAT ASC':_0xa0bd('0x80'),'GROUP_CONCAT DESC':_0xa0bd('0x5a')};var _0x3336ac={'SEC_TO_TIME':_0xa0bd('0x5b'),'DATE':_0xa0bd('0x81'),'HOUR':_0xa0bd('0x5c'),'ROUND':_0xa0bd('0x82'),'UNIX_TIMESTAMP':_0xa0bd('0x83')};var _0x10be38=function(_0x4f32ad){return!_['includes']([_0xa0bd('0x5e'),_0xa0bd('0x5f'),_0xa0bd('0x84'),_0xa0bd('0x85')],_0x4f32ad);};var _0x3e42e=function(_0x4967f1){if(!_0x4967f1||!_0x4967f1[_0xa0bd('0x60')][_0xa0bd('0x37')]){return'';}for(var _0x53f4a1='(',_0xbf5f44=0x0;_0xbf5f44<_0x4967f1[_0xa0bd('0x60')][_0xa0bd('0x37')];_0xbf5f44+=0x1){_0xbf5f44>0x0&&(_0x53f4a1+='\x20'+_0x4967f1['operator']+'\x20');_0x53f4a1+=_0x4967f1[_0xa0bd('0x60')][_0xbf5f44][_0xa0bd('0x62')]?_0x3e42e(_0x4967f1[_0xa0bd('0x60')][_0xbf5f44][_0xa0bd('0x62')]):_0x4967f1['rules'][_0xbf5f44][_0xa0bd('0x63')]+'\x20'+_0x4967f1[_0xa0bd('0x60')][_0xbf5f44][_0xa0bd('0x64')]+(_0x10be38(_0x4967f1[_0xa0bd('0x60')][_0xbf5f44]['condition'])?'\x20'+_0x4967f1[_0xa0bd('0x60')][_0xbf5f44][_0xa0bd('0x65')]:'');}return _0x53f4a1+')';};var _0x4b917d={'where':{'id':_0x52a2c4['id']}},_0x22d752,_0x225c08,_0x1231ce,_0x5bcb3f,_0x13edff;_0x4b917d=_['merge']({},_0x4b917d,_0x3d168b);return db[_0xa0bd('0x44')]['find'](_0x4b917d)['then'](function(_0x597562){if(_0x597562){_0x22d752=_0x597562;return _0x597562['getFields']();}return null;})[_0xa0bd('0x25')](function(_0xbd6e3a){if(_0xbd6e3a){if(!_0xbd6e3a[_0xa0bd('0x37')]){throw new db[(_0xa0bd('0x67'))][(_0xa0bd('0x68'))](_0xa0bd('0x69'),0x193);}_0x225c08=_0xbd6e3a;return db['AnalyticMetric'][_0xa0bd('0x86')]({'raw':!![]});}return null;})['then'](function(_0x242c69){if(_0x242c69){_0x1231ce=_[_0xa0bd('0x6a')](_0x242c69,'id');var _0xf239e9;var _0x3ada6=squel['select']();_0x3ada6['from'](_0x22d752[_0xa0bd('0x6c')]);for(var _0x174611=0x0;_0x174611<_0x225c08[_0xa0bd('0x37')];_0x174611+=0x1){_0xf239e9=_0x225c08[_0x174611][_0xa0bd('0x6d')]?_0x1231ce[_0x225c08[_0x174611][_0xa0bd('0x6d')]][_0xa0bd('0x87')]:_0x225c08[_0x174611]['field'];_0xf239e9=_0x225c08[_0x174611][_0xa0bd('0x6e')]?_[_0xa0bd('0x70')](_0xa1d3a[_0x225c08[_0x174611][_0xa0bd('0x6e')]],'%s',_0xf239e9):_0xf239e9;_0xf239e9=_0x225c08[_0x174611][_0xa0bd('0x6f')]?_[_0xa0bd('0x70')](_0x3336ac[_0x225c08[_0x174611]['format']],'%s',_0xf239e9):_0xf239e9;if(_0x225c08[_0x174611][_0xa0bd('0x71')]){_0x3ada6[_0xa0bd('0x62')](_0xf239e9);}_0x225c08[_0x174611][_0xa0bd('0x72')]&&_0x3ada6[_0xa0bd('0x39')](_0xf239e9,_0x225c08[_0x174611]['orderBy']===_0xa0bd('0x73')?![]:!![]);_0x3ada6[_0xa0bd('0x63')](_0xf239e9,_0x225c08[_0x174611][_0xa0bd('0x74')]||_0xf239e9);}if(_0x22d752[_0xa0bd('0x75')]){_0x22d752[_0xa0bd('0x75')]=JSON['parse'](_0x22d752['joins']);for(var _0x313ff7=0x0;_0x313ff7<_0x22d752[_0xa0bd('0x75')]['length'];_0x313ff7+=0x1){if(_0x22d752[_0xa0bd('0x75')][_0x313ff7][_0xa0bd('0x2f')]&&_['includes'](_0x24dd01,_0x22d752[_0xa0bd('0x75')][_0x313ff7][_0xa0bd('0x2f')])&&_0x22d752['joins'][_0x313ff7][_0xa0bd('0x76')]&&_0x22d752[_0xa0bd('0x75')][_0x313ff7][_0xa0bd('0x77')]&&_0x22d752['joins'][_0x313ff7]['foreignKey']){_0x3ada6[_0x22d752[_0xa0bd('0x75')][_0x313ff7][_0xa0bd('0x2f')]](_0x22d752[_0xa0bd('0x75')][_0x313ff7]['foreignTable'],null,util[_0xa0bd('0x6f')](_0xa0bd('0x88'),_0x22d752['table'],_0x22d752['joins'][_0x313ff7][_0xa0bd('0x76')],_0x22d752[_0xa0bd('0x75')][_0x313ff7][_0xa0bd('0x77')],_0x22d752[_0xa0bd('0x75')][_0x313ff7]['foreignKey']));}}}if(_0x22d752['conditions']){_0x22d752[_0xa0bd('0x79')]=JSON[_0xa0bd('0x89')](_0x22d752[_0xa0bd('0x79')]);_0x3ada6[_0xa0bd('0x3b')](_0x3e42e(_0x22d752['conditions'][_0xa0bd('0x62')]));}_0x13edff=_0x3ada6[_0xa0bd('0x8a')]();_0x3ada6[_0xa0bd('0x1c')](_0x188b6f);_0x3ada6[_0xa0bd('0x1b')](0x0);return;}})[_0xa0bd('0x25')](function(){if(_0x1d3c9c[_0xa0bd('0x8b')]==='web'){return null;}var _0xc654f9=_[_0xa0bd('0x3e')](_0x1d3c9c,{'name':_0x1d3c9c[_0xa0bd('0x8c')]||_0x1d3c9c[_0xa0bd('0x2b')]||_0x22d752[_0xa0bd('0x2b')],'basename':_0x744f26,'savename':util[_0xa0bd('0x6f')](_0xa0bd('0x8d'),_0x1d3c9c['name']||_0x22d752[_0xa0bd('0x2b')],require(_0xa0bd('0x8e'))[_0xa0bd('0x8f')](0x4),_0x1d3c9c[_0xa0bd('0x8b')]||_0xa0bd('0x90')),'reportId':_0x22d752['id'],'reportType':_0xa0bd('0x91')});return db[_0xa0bd('0x92')][_0xa0bd('0x4a')](_0xc654f9,{'raw':!![]});})[_0xa0bd('0x25')](function(_0x13087e){if(_0x22d752[_0xa0bd('0x6c')]===_0xa0bd('0x93')){_0x13edff[_0xa0bd('0x3b')](_0x22d752[_0xa0bd('0x6c')]+_0xa0bd('0x94'),_0x1d3c9c[_0xa0bd('0x95')],_0x1d3c9c[_0xa0bd('0x96')]);}else{_0x13edff['where'](_0x22d752[_0xa0bd('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1d3c9c[_0xa0bd('0x95')],_0x1d3c9c[_0xa0bd('0x96')]);}if(_0x13087e){logger[_0xa0bd('0x97')](_0xa0bd('0x98'),_0x13edff[_0xa0bd('0x7b')]());require(_0xa0bd('0x99'))[_0xa0bd('0x9a')](path[_0xa0bd('0x51')](__dirname,_0xa0bd('0x9b'),_0x13087e[_0xa0bd('0x8b')]),[_0x13087e['id'],_0x13edff['toString'](),path['join'](__dirname,_0xa0bd('0x9c'),_0x13087e['savename']),_0x744f26]);return _0x13087e;}else{var _0x21e0b4=squel[_0xa0bd('0x9d')]();_0x21e0b4[_0xa0bd('0x6b')]('('+_0x13edff[_0xa0bd('0x7b')]()+')',_0xa0bd('0x9e'));_0x21e0b4['field'](_0xa0bd('0x9f'),_0xa0bd('0x41'));_0x13edff[_0xa0bd('0x1c')](_0x1d3c9c[_0xa0bd('0x1c')]||_0x188b6f);_0x13edff[_0xa0bd('0x1b')](_0x1d3c9c['offset']||0x0);return dbH['sequelize'][_0xa0bd('0x32')](_0x21e0b4[_0xa0bd('0x7b')](),{'type':dbH[_0xa0bd('0x7c')][_0xa0bd('0x7d')][_0xa0bd('0xa0')]})[_0xa0bd('0x25')](function(_0x37e30d){if(!_0x37e30d[_0xa0bd('0x37')]){_0x5bcb3f=0x0;}else{_0x5bcb3f=_0x37e30d[0x0][_0xa0bd('0x41')]||0x0;}return dbH[_0xa0bd('0x7c')][_0xa0bd('0x32')](_0x13edff[_0xa0bd('0x7b')](),{'type':dbH[_0xa0bd('0x7c')][_0xa0bd('0x7d')]['SELECT']});})[_0xa0bd('0x25')](function(_0x55332d){return{'rows':_0x55332d||[],'count':_0x5bcb3f};});}});}exports['run']=function(_0x239c86,_0x22d88f){return runReport(_0x239c86[_0xa0bd('0x47')],_0x239c86[_0xa0bd('0x32')],_0x239c86[_0xa0bd('0x40')])[_0xa0bd('0x25')](respondWithResult(_0x22d88f,null))[_0xa0bd('0x46')](handleError(_0x22d88f,null));};exports[_0xa0bd('0xa1')]=runReport;exports[_0xa0bd('0x32')]=function(_0x4fa91c,_0x3d521d){var _0x10027d=0xa;var _0x1f34b3=[_0xa0bd('0x51'),'left_join','right_join',_0xa0bd('0x52')];var _0x354d2c={'SUM':_0xa0bd('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xa0bd('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xa0bd('0x80'),'GROUP_CONCAT DESC':_0xa0bd('0x5a')};var _0x13996a={'SEC_TO_TIME':_0xa0bd('0x5b'),'DATE':_0xa0bd('0x81'),'HOUR':'HOUR(%s)','ROUND':_0xa0bd('0x82'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3740f3=function(_0x275435){return!_['includes'](['IS\x20NULL',_0xa0bd('0x5f'),_0xa0bd('0x84'),'IS\x20NOT\x20EMPTY'],_0x275435);};var _0x5b32b3=function(_0x3f64eb){if(!_0x3f64eb||!_0x3f64eb[_0xa0bd('0x60')][_0xa0bd('0x37')]){return'';}for(var _0x2f2edf='(',_0x1c461a=0x0;_0x1c461a<_0x3f64eb['rules'][_0xa0bd('0x37')];_0x1c461a+=0x1){_0x1c461a>0x0&&(_0x2f2edf+='\x20'+_0x3f64eb[_0xa0bd('0x61')]+'\x20');_0x2f2edf+=_0x3f64eb[_0xa0bd('0x60')][_0x1c461a][_0xa0bd('0x62')]?_0x5b32b3(_0x3f64eb[_0xa0bd('0x60')][_0x1c461a][_0xa0bd('0x62')]):_0x3f64eb['rules'][_0x1c461a][_0xa0bd('0x63')]+'\x20'+_0x3f64eb[_0xa0bd('0x60')][_0x1c461a]['condition']+(_0x3740f3(_0x3f64eb[_0xa0bd('0x60')][_0x1c461a][_0xa0bd('0x64')])?'\x20'+_0x3f64eb[_0xa0bd('0x60')][_0x1c461a]['value']:'');}return _0x2f2edf+')';};var _0x1c0e30={'where':{'id':_0x4fa91c[_0xa0bd('0x47')]['id']}},_0x339e4e,_0x575d2f,_0x1397bb,_0x5b2d7a,_0x521a1f;_0x1c0e30=_[_0xa0bd('0x3e')]({},_0x1c0e30,_0x4fa91c['options']);return db[_0xa0bd('0x44')]['find'](_0x1c0e30)[_0xa0bd('0x25')](function(_0x581f1e){if(_0x581f1e){_0x339e4e=_0x581f1e;return _0x581f1e[_0xa0bd('0x66')]();}return null;})[_0xa0bd('0x25')](function(_0x11be76){if(_0x11be76){if(!_0x11be76['length']){throw new db[(_0xa0bd('0x67'))][(_0xa0bd('0x68'))](_0xa0bd('0x69'),0x193);}_0x575d2f=_0x11be76;return db['AnalyticMetric'][_0xa0bd('0x86')]({'raw':!![]});}return null;})['then'](function(_0x6a74ef){if(_0x6a74ef){_0x1397bb=_[_0xa0bd('0x6a')](_0x6a74ef,'id');var _0xb6ec47;var _0x2eaf99=squel[_0xa0bd('0x9d')]();_0x2eaf99['from'](_0x339e4e[_0xa0bd('0x6c')]);for(var _0x44203f=0x0;_0x44203f<_0x575d2f['length'];_0x44203f+=0x1){_0xb6ec47=_0x575d2f[_0x44203f]['MetricId']?_0x1397bb[_0x575d2f[_0x44203f][_0xa0bd('0x6d')]][_0xa0bd('0x87')]:_0x575d2f[_0x44203f][_0xa0bd('0x63')];_0xb6ec47=_0x575d2f[_0x44203f][_0xa0bd('0x6e')]?_[_0xa0bd('0x70')](_0x354d2c[_0x575d2f[_0x44203f][_0xa0bd('0x6e')]],'%s',_0xb6ec47):_0xb6ec47;_0xb6ec47=_0x575d2f[_0x44203f][_0xa0bd('0x6f')]?_[_0xa0bd('0x70')](_0x13996a[_0x575d2f[_0x44203f][_0xa0bd('0x6f')]],'%s',_0xb6ec47):_0xb6ec47;if(_0x575d2f[_0x44203f][_0xa0bd('0x71')]){_0x2eaf99[_0xa0bd('0x62')](_0xb6ec47);}_0x575d2f[_0x44203f]['orderBy']&&_0x2eaf99[_0xa0bd('0x39')](_0xb6ec47,_0x575d2f[_0x44203f]['orderBy']===_0xa0bd('0x73')?![]:!![]);_0x2eaf99[_0xa0bd('0x63')](_0xb6ec47,_0x575d2f[_0x44203f][_0xa0bd('0x74')]||_0xb6ec47);}if(_0x339e4e['joins']){_0x339e4e[_0xa0bd('0x75')]=JSON['parse'](_0x339e4e[_0xa0bd('0x75')]);for(var _0x560a45=0x0;_0x560a45<_0x339e4e[_0xa0bd('0x75')][_0xa0bd('0x37')];_0x560a45+=0x1){if(_0x339e4e[_0xa0bd('0x75')][_0x560a45][_0xa0bd('0x2f')]&&_[_0xa0bd('0x5d')](_0x1f34b3,_0x339e4e[_0xa0bd('0x75')][_0x560a45][_0xa0bd('0x2f')])&&_0x339e4e[_0xa0bd('0x75')][_0x560a45][_0xa0bd('0x76')]&&_0x339e4e[_0xa0bd('0x75')][_0x560a45]['foreignTable']&&_0x339e4e[_0xa0bd('0x75')][_0x560a45][_0xa0bd('0x78')]){_0x2eaf99[_0x339e4e['joins'][_0x560a45][_0xa0bd('0x2f')]](_0x339e4e[_0xa0bd('0x75')][_0x560a45][_0xa0bd('0x77')],null,util[_0xa0bd('0x6f')]('%s.%s\x20=\x20%s.%s',_0x339e4e[_0xa0bd('0x6c')],_0x339e4e[_0xa0bd('0x75')][_0x560a45][_0xa0bd('0x76')],_0x339e4e[_0xa0bd('0x75')][_0x560a45][_0xa0bd('0x77')],_0x339e4e['joins'][_0x560a45][_0xa0bd('0x78')]));}}}if(_0x339e4e[_0xa0bd('0x79')]){_0x339e4e[_0xa0bd('0x79')]=JSON[_0xa0bd('0x89')](_0x339e4e['conditions']);_0x2eaf99['where'](_0x5b32b3(_0x339e4e[_0xa0bd('0x79')]['group']));}_0x521a1f=_0x2eaf99[_0xa0bd('0x8a')]();_0x2eaf99[_0xa0bd('0x1c')](_0x10027d);_0x2eaf99[_0xa0bd('0x1b')](0x0);logger['debug'](_0xa0bd('0xa2'),_0x2eaf99[_0xa0bd('0x7b')]());return dbH['sequelize'][_0xa0bd('0x32')](_0x2eaf99[_0xa0bd('0x7b')](),{'type':dbH[_0xa0bd('0x7c')]['QueryTypes'][_0xa0bd('0xa0')]});}})[_0xa0bd('0x25')](function(){return{'sql':_0x521a1f['toString']()};})['then'](respondWithResult(_0x3d521d,null))[_0xa0bd('0x46')](handleError(_0x3d521d,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index aed04b1..4100dfd 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 _0x1794=['api','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x11b852,_0x3d6dab){var _0xa16353=function(_0x5c9ec2){while(--_0x5c9ec2){_0x11b852['push'](_0x11b852['shift']());}};_0xa16353(++_0x3d6dab);}(_0x1794,0x8e));var _0x4179=function(_0x2788ee,_0x258844){_0x2788ee=_0x2788ee-0x0;var _0x506f12=_0x1794[_0x2788ee];return _0x506f12;};'use strict';var _=require(_0x4179('0x0'));var util=require(_0x4179('0x1'));var logger=require('../../config/logger')(_0x4179('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4179('0x3'));var fs=require('fs');var path=require(_0x4179('0x4'));var rimraf=require(_0x4179('0x5'));var config=require(_0x4179('0x6'));var attributes=require(_0x4179('0x7'));module[_0x4179('0x8')]=function(_0x23311b,_0x38c026){return _0x23311b[_0x4179('0x9')](_0x4179('0xa'),attributes,{'tableName':_0x4179('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf6ce=['rimraf','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports','util','api','moment','bluebird','path'];(function(_0x246f43,_0x18a2a0){var _0x10edfe=function(_0x187e48){while(--_0x187e48){_0x246f43['push'](_0x246f43['shift']());}};_0x10edfe(++_0x18a2a0);}(_0xf6ce,0x69));var _0xef6c=function(_0x4f296e,_0x2632f9){_0x4f296e=_0x4f296e-0x0;var _0x457d05=_0xf6ce[_0x4f296e];return _0x457d05;};'use strict';var _=require('lodash');var util=require(_0xef6c('0x0'));var logger=require('../../config/logger')(_0xef6c('0x1'));var moment=require(_0xef6c('0x2'));var BPromise=require(_0xef6c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xef6c('0x4'));var rimraf=require(_0xef6c('0x5'));var config=require(_0xef6c('0x6'));var attributes=require('./analyticCustomReport.attributes');module[_0xef6c('0x7')]=function(_0x545226,_0x88f153){return _0x545226[_0xef6c('0x8')](_0xef6c('0x9'),attributes,{'tableName':_0xef6c('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 2972f64..c4c548d 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 _0x977b=['request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x59139b,_0x2d3dac){var _0x28afa4=function(_0x10cd6c){while(--_0x10cd6c){_0x59139b['push'](_0x59139b['shift']());}};_0x28afa4(++_0x2d3dac);}(_0x977b,0xf8));var _0xb977=function(_0x5437b5,_0x55cd61){_0x5437b5=_0x5437b5-0x0;var _0x2757ef=_0x977b[_0x5437b5];return _0x2757ef;};'use strict';var _=require(_0xb977('0x0'));var util=require(_0xb977('0x1'));var moment=require(_0xb977('0x2'));var BPromise=require(_0xb977('0x3'));var rs=require(_0xb977('0x4'));var fs=require('fs');var Redis=require(_0xb977('0x5'));var db=require(_0xb977('0x6'))['db'];var utils=require(_0xb977('0x7'));var logger=require('../../config/logger')(_0xb977('0x8'));var config=require(_0xb977('0x9'));var jayson=require(_0xb977('0xa'));var client=jayson[_0xb977('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e5300,_0x27befc,_0x4054db){return new BPromise(function(_0x5c9e22,_0x23116e){return client[_0xb977('0xc')](_0x5e5300,_0x4054db)[_0xb977('0xd')](function(_0x4adf40){logger[_0xb977('0xe')](_0xb977('0xf'),_0x27befc,_0xb977('0x10'));logger['debug'](_0xb977('0x11'),_0x27befc,_0xb977('0x10'),JSON[_0xb977('0x12')](_0x4adf40));if(_0x4adf40['error']){if(_0x4adf40[_0xb977('0x13')][_0xb977('0x14')]===0x1f4){logger[_0xb977('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x27befc,_0x4adf40[_0xb977('0x13')][_0xb977('0x15')]);return _0x23116e(_0x4adf40[_0xb977('0x13')]['message']);}logger[_0xb977('0x13')](_0xb977('0xf'),_0x27befc,_0x4adf40[_0xb977('0x13')]['message']);return _0x5c9e22(_0x4adf40[_0xb977('0x13')][_0xb977('0x15')]);}else{logger[_0xb977('0xe')](_0xb977('0xf'),_0x27befc,'request\x20sent');_0x5c9e22(_0x4adf40[_0xb977('0x16')][_0xb977('0x15')]);}})[_0xb977('0x17')](function(_0x35e860){logger[_0xb977('0x13')](_0xb977('0xf'),_0x27befc,_0x35e860);_0x23116e(_0x35e860);});});}
\ No newline at end of file
+var _0x5588=['error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s'];(function(_0x63875f,_0xfea539){var _0x4b74c5=function(_0xba35cd){while(--_0xba35cd){_0x63875f['push'](_0x63875f['shift']());}};_0x4b74c5(++_0xfea539);}(_0x5588,0x139));var _0x8558=function(_0x5a46e5,_0x2e5217){_0x5a46e5=_0x5a46e5-0x0;var _0x23d53f=_0x5588[_0x5a46e5];return _0x23d53f;};'use strict';var _=require(_0x8558('0x0'));var util=require('util');var moment=require(_0x8558('0x1'));var BPromise=require(_0x8558('0x2'));var rs=require(_0x8558('0x3'));var fs=require('fs');var Redis=require(_0x8558('0x4'));var db=require(_0x8558('0x5'))['db'];var utils=require(_0x8558('0x6'));var logger=require(_0x8558('0x7'))(_0x8558('0x8'));var config=require(_0x8558('0x9'));var jayson=require(_0x8558('0xa'));var client=jayson['client'][_0x8558('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3df632,_0x36d236,_0x4ddd1d){return new BPromise(function(_0x365444,_0x1e5243){return client['request'](_0x3df632,_0x4ddd1d)[_0x8558('0xc')](function(_0x521d44){logger['info'](_0x8558('0xd'),_0x36d236,_0x8558('0xe'));logger[_0x8558('0xf')](_0x8558('0x10'),_0x36d236,_0x8558('0xe'),JSON['stringify'](_0x521d44));if(_0x521d44[_0x8558('0x11')]){if(_0x521d44[_0x8558('0x11')]['code']===0x1f4){logger[_0x8558('0x11')](_0x8558('0xd'),_0x36d236,_0x521d44['error'][_0x8558('0x12')]);return _0x1e5243(_0x521d44['error'][_0x8558('0x12')]);}logger[_0x8558('0x11')](_0x8558('0xd'),_0x36d236,_0x521d44[_0x8558('0x11')][_0x8558('0x12')]);return _0x365444(_0x521d44[_0x8558('0x11')][_0x8558('0x12')]);}else{logger[_0x8558('0x13')](_0x8558('0xd'),_0x36d236,_0x8558('0xe'));_0x365444(_0x521d44[_0x8558('0x14')][_0x8558('0x12')]);}})[_0x8558('0x15')](function(_0x13a089){logger[_0x8558('0x11')](_0x8558('0xd'),_0x36d236,_0x13a089);_0x1e5243(_0x13a089);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 70375df..693c892 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 _0x6bea=['update','delete','destroy','exports','path','express','Router','fs-extra','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','/:id/run','run','/:id/query','post','/:id'];(function(_0x3b06dd,_0xb782f){var _0x268997=function(_0x56de92){while(--_0x56de92){_0x3b06dd['push'](_0x3b06dd['shift']());}};_0x268997(++_0xb782f);}(_0x6bea,0x68));var _0xa6be=function(_0x3489fc,_0x3d14b7){_0x3489fc=_0x3489fc-0x0;var _0x482ca6=_0x6bea[_0x3489fc];return _0x482ca6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa6be('0x0'));var timeout=require('connect-timeout');var express=require(_0xa6be('0x1'));var router=express[_0xa6be('0x2')]();var fs_extra=require(_0xa6be('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa6be('0x4'));var config=require('../../config/environment');var controller=require(_0xa6be('0x5'));router[_0xa6be('0x6')]('/',auth[_0xa6be('0x7')](),controller[_0xa6be('0x8')]);router[_0xa6be('0x6')]('/:id',auth[_0xa6be('0x7')](),controller[_0xa6be('0x9')]);router[_0xa6be('0x6')](_0xa6be('0xa'),auth[_0xa6be('0x7')](),controller['preview']);router[_0xa6be('0x6')](_0xa6be('0xb'),auth[_0xa6be('0x7')](),controller[_0xa6be('0xc')]);router['get'](_0xa6be('0xd'),auth['isAuthenticated'](),controller['query']);router[_0xa6be('0xe')]('/',auth[_0xa6be('0x7')](),controller['create']);router['put'](_0xa6be('0xf'),auth['isAuthenticated'](),controller[_0xa6be('0x10')]);router[_0xa6be('0x11')]('/:id',auth[_0xa6be('0x7')](),controller[_0xa6be('0x12')]);module[_0xa6be('0x13')]=router;
\ No newline at end of file
+var _0xc4ee=['exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','/:id/preview','preview','/:id/run','isAuthenticated','run','query','post','put','update','delete','destroy'];(function(_0xe3e0af,_0x4564ed){var _0x4828e9=function(_0x55c7a7){while(--_0x55c7a7){_0xe3e0af['push'](_0xe3e0af['shift']());}};_0x4828e9(++_0x4564ed);}(_0xc4ee,0x18d));var _0xec4e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4ee[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xec4e('0x0'));var util=require('util');var path=require(_0xec4e('0x1'));var timeout=require('connect-timeout');var express=require(_0xec4e('0x2'));var router=express['Router']();var fs_extra=require(_0xec4e('0x3'));var auth=require(_0xec4e('0x4'));var interaction=require(_0xec4e('0x5'));var config=require(_0xec4e('0x6'));var controller=require('./analyticCustomReport.controller');router[_0xec4e('0x7')]('/',auth['isAuthenticated'](),controller[_0xec4e('0x8')]);router[_0xec4e('0x7')](_0xec4e('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0xec4e('0xa'),auth['isAuthenticated'](),controller[_0xec4e('0xb')]);router[_0xec4e('0x7')](_0xec4e('0xc'),auth[_0xec4e('0xd')](),controller[_0xec4e('0xe')]);router[_0xec4e('0x7')]('/:id/query',auth[_0xec4e('0xd')](),controller[_0xec4e('0xf')]);router[_0xec4e('0x10')]('/',auth[_0xec4e('0xd')](),controller['create']);router[_0xec4e('0x11')](_0xec4e('0x9'),auth[_0xec4e('0xd')](),controller[_0xec4e('0x12')]);router[_0xec4e('0x13')](_0xec4e('0x9'),auth[_0xec4e('0xd')](),controller[_0xec4e('0x14')]);module[_0xec4e('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 a2bc798..b02bf72 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 _0xa630=['STRING','TEXT','sequelize','exports'];(function(_0xd9413d,_0x2a7ddf){var _0x10ad51=function(_0x392ad9){while(--_0x392ad9){_0xd9413d['push'](_0xd9413d['shift']());}};_0x10ad51(++_0x2a7ddf);}(_0xa630,0xbe));var _0x0a63=function(_0x3b4c90,_0x2780fb){_0x3b4c90=_0x3b4c90-0x0;var _0xc004=_0xa630[_0x3b4c90];return _0xc004;};'use strict';var Sequelize=require(_0x0a63('0x0'));module[_0x0a63('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x0a63('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x0a63('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xda19=['exports','STRING','TEXT'];(function(_0x31872e,_0x283ebd){var _0x39f624=function(_0xd2bb3b){while(--_0xd2bb3b){_0x31872e['push'](_0x31872e['shift']());}};_0x39f624(++_0x283ebd);}(_0xda19,0xd5));var _0x9da1=function(_0x27f1dd,_0x243958){_0x27f1dd=_0x27f1dd-0x0;var _0x5589f4=_0xda19[_0x27f1dd];return _0x5589f4;};'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 eb32e2f..dc24807 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 _0x1261=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','set','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','count','include','findAll','rows','show','length','includeAll','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','AVG(%s)','DATE(%s)','value','keyBy','select','order','%s.%s\x20=\x20%s.%s','clone','web','fullPath','randomstring','generate','output','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','../../components/export/','savename','COUNT(*)','run','runReport','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','Sequelize','debug'];(function(_0x458d19,_0x17097c){var _0x27b134=function(_0xd6700b){while(--_0xd6700b){_0x458d19['push'](_0x458d19['shift']());}};_0x27b134(++_0x17097c);}(_0x1261,0x144));var _0x1126=function(_0x2cdf41,_0x4a277c){_0x2cdf41=_0x2cdf41-0x0;var _0x39a70e=_0x1261[_0x2cdf41];return _0x39a70e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];var dbH=require(_0x1126('0x17'))[_0x1126('0x18')];function respondWithStatusCode(_0xca0355,_0x3f10e9){_0x3f10e9=_0x3f10e9||0xcc;return function(_0xd8ca42){if(_0xd8ca42){return _0xca0355[_0x1126('0x19')](_0x3f10e9);}return _0xca0355[_0x1126('0x1a')](_0x3f10e9)['end']();};}function respondWithResult(_0x5de9a7,_0x1af673){_0x1af673=_0x1af673||0xc8;return function(_0x154e20){if(_0x154e20){return _0x5de9a7[_0x1126('0x1a')](_0x1af673)['json'](_0x154e20);}};}function respondWithFilteredResult(_0x45149c,_0x4794a7){return function(_0x35fe9f){if(_0x35fe9f){var _0x42f379=typeof _0x4794a7[_0x1126('0x1b')]==='undefined'&&typeof _0x4794a7[_0x1126('0x1c')]===_0x1126('0x1d');var _0x4a7b49=_0x35fe9f['count'];var _0x22ae0b=_0x42f379?0x0:_0x4794a7[_0x1126('0x1b')];var _0x58d11a=_0x42f379?_0x35fe9f['count']:_0x4794a7[_0x1126('0x1b')]+_0x4794a7['limit'];var _0x22ed37;if(_0x58d11a>=_0x4a7b49){_0x58d11a=_0x4a7b49;_0x22ed37=0xc8;}else{_0x22ed37=0xce;}_0x45149c[_0x1126('0x1a')](_0x22ed37);return _0x45149c[_0x1126('0x1e')]('Content-Range',_0x22ae0b+'-'+_0x58d11a+'/'+_0x4a7b49)[_0x1126('0x1f')](_0x35fe9f);}return null;};}function patchUpdates(_0x49d209){return function(_0x56efeb){try{jsonpatch[_0x1126('0x20')](_0x56efeb,_0x49d209,!![]);}catch(_0x3a9bed){return BPromise[_0x1126('0x21')](_0x3a9bed);}return _0x56efeb[_0x1126('0x22')]();};}function saveUpdates(_0x526ca1,_0x29ab60){return function(_0x477e6a){if(_0x477e6a){return _0x477e6a['update'](_0x526ca1)[_0x1126('0x23')](function(_0x59cd8e){return _0x59cd8e;});}return null;};}function removeEntity(_0x529dd9,_0x4b57ab){return function(_0x2199d9){if(_0x2199d9){return _0x2199d9[_0x1126('0x24')]()[_0x1126('0x23')](function(){var _0x34bcf1=_0x2199d9[_0x1126('0x25')]({'plain':!![]});var _0x1b07a7=_0x1126('0x26');return db[_0x1126('0x27')]['destroy']({'where':{'type':_0x1b07a7,'resourceId':_0x34bcf1['id']}})[_0x1126('0x23')](function(){return _0x2199d9;});})[_0x1126('0x23')](function(){_0x529dd9[_0x1126('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x541bc9,_0xeb7d89){return function(_0x39bf0e){if(!_0x39bf0e){_0x541bc9['sendStatus'](0x194);}return _0x39bf0e;};}function handleError(_0x2fb797,_0x23d2bc){_0x23d2bc=_0x23d2bc||0x1f4;return function(_0x4a334a){logger[_0x1126('0x28')](_0x4a334a['stack']);if(_0x4a334a[_0x1126('0x29')]){delete _0x4a334a['name'];}_0x2fb797[_0x1126('0x1a')](_0x23d2bc)['send'](_0x4a334a);};}exports[_0x1126('0x2a')]=function(_0x5f2611,_0x5252e0){var _0x4a53ab={},_0x17646e={},_0xa8906d={'count':0x0,'rows':[]};var _0x1cef48=_['map'](db[_0x1126('0x2b')][_0x1126('0x2c')],function(_0x56f7f8){return{'name':_0x56f7f8[_0x1126('0x2d')],'type':_0x56f7f8[_0x1126('0x2e')][_0x1126('0x2f')]};});_0x17646e[_0x1126('0x30')]=_['map'](_0x1cef48,'name');_0x17646e[_0x1126('0x31')]=_[_0x1126('0x32')](_0x5f2611[_0x1126('0x31')]);_0x17646e[_0x1126('0x33')]=_['intersection'](_0x17646e[_0x1126('0x30')],_0x17646e[_0x1126('0x31')]);_0x4a53ab[_0x1126('0x34')]=_[_0x1126('0x35')](_0x17646e[_0x1126('0x30')],qs['fields'](_0x5f2611[_0x1126('0x31')][_0x1126('0x36')]));_0x4a53ab[_0x1126('0x34')]=_0x4a53ab[_0x1126('0x34')]['length']?_0x4a53ab['attributes']:_0x17646e[_0x1126('0x30')];if(!_0x5f2611[_0x1126('0x31')]['hasOwnProperty'](_0x1126('0x37'))){_0x4a53ab[_0x1126('0x1c')]=qs[_0x1126('0x1c')](_0x5f2611['query']['limit']);_0x4a53ab[_0x1126('0x1b')]=qs[_0x1126('0x1b')](_0x5f2611[_0x1126('0x31')][_0x1126('0x1b')]);}_0x4a53ab['order']=qs[_0x1126('0x38')](_0x5f2611['query'][_0x1126('0x38')]);_0x4a53ab[_0x1126('0x39')]=qs[_0x1126('0x33')](_[_0x1126('0x3a')](_0x5f2611[_0x1126('0x31')],_0x17646e['filters']),_0x1cef48);if(_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]){_0x4a53ab[_0x1126('0x39')]=_[_0x1126('0x3c')](_0x4a53ab[_0x1126('0x39')],{'$or':_[_0x1126('0x3d')](_0x1cef48,function(_0x3052f9){if(_0x3052f9['type']!==_0x1126('0x3e')){var _0x154c28={};_0x154c28[_0x3052f9[_0x1126('0x29')]]={'$like':'%'+_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]+'%'};return _0x154c28;}})});}_0x4a53ab=_['merge']({},_0x4a53ab,_0x5f2611['options']);var _0x1c4f06={'where':_0x4a53ab[_0x1126('0x39')]};return db[_0x1126('0x2b')][_0x1126('0x3f')](_0x1c4f06)[_0x1126('0x23')](function(_0x276fd5){_0xa8906d['count']=_0x276fd5;if(_0x5f2611['query']['includeAll']){_0x4a53ab[_0x1126('0x40')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x1126('0x41')](_0x4a53ab);})[_0x1126('0x23')](function(_0x3584a3){_0xa8906d[_0x1126('0x42')]=_0x3584a3;return _0xa8906d;})['then'](respondWithFilteredResult(_0x5252e0,_0x4a53ab))['catch'](handleError(_0x5252e0,null));};exports[_0x1126('0x43')]=function(_0xa93167,_0x1d63b9){var _0x5f5d3a={'raw':!![],'where':{'id':_0xa93167['params']['id']}},_0x2f8551={};_0x2f8551[_0x1126('0x30')]=_['keys'](db[_0x1126('0x2b')][_0x1126('0x2c')]);_0x2f8551[_0x1126('0x31')]=_['keys'](_0xa93167[_0x1126('0x31')]);_0x2f8551[_0x1126('0x33')]=_[_0x1126('0x35')](_0x2f8551['model'],_0x2f8551['query']);_0x5f5d3a['attributes']=_[_0x1126('0x35')](_0x2f8551['model'],qs[_0x1126('0x36')](_0xa93167['query'][_0x1126('0x36')]));_0x5f5d3a[_0x1126('0x34')]=_0x5f5d3a[_0x1126('0x34')][_0x1126('0x44')]?_0x5f5d3a[_0x1126('0x34')]:_0x2f8551['model'];if(_0xa93167[_0x1126('0x31')][_0x1126('0x45')]){_0x5f5d3a['include']=[{'all':!![]}];}_0x5f5d3a=_[_0x1126('0x3c')]({},_0x5f5d3a,_0xa93167[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x5f5d3a)[_0x1126('0x23')](handleEntityNotFound(_0x1d63b9,null))['then'](respondWithResult(_0x1d63b9,null))[_0x1126('0x48')](handleError(_0x1d63b9,null));};exports[_0x1126('0x49')]=function(_0x213a76,_0x59656d){return db[_0x1126('0x2b')][_0x1126('0x49')](_0x213a76[_0x1126('0x4a')],{})[_0x1126('0x23')](function(_0x224456){var _0x2081f2=_0x213a76[_0x1126('0x4b')][_0x1126('0x25')]({'plain':!![]});if(!_0x2081f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2081f2[_0x1126('0x4c')]==='user'){var _0x40168e=_0x224456[_0x1126('0x25')]({'plain':!![]});var _0x4a1831='Reports';return db[_0x1126('0x4d')][_0x1126('0x47')]({'where':{'name':_0x4a1831,'userProfileId':_0x2081f2[_0x1126('0x4e')]},'raw':!![]})['then'](function(_0x3cb44c){if(_0x3cb44c&&_0x3cb44c[_0x1126('0x4f')]===0x0){return db[_0x1126('0x27')][_0x1126('0x49')]({'name':_0x40168e['name'],'resourceId':_0x40168e['id'],'type':_0x1126('0x26'),'sectionId':_0x3cb44c['id']},{})[_0x1126('0x23')](function(){return _0x224456;});}else{return _0x224456;}})['catch'](function(_0x4bcc08){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bcc08);throw _0x4bcc08;});}return _0x224456;})[_0x1126('0x23')](respondWithResult(_0x59656d,0xc9))[_0x1126('0x48')](handleError(_0x59656d,null));};exports['update']=function(_0x16552b,_0x1c7a2b){if(_0x16552b[_0x1126('0x4a')]['id']){delete _0x16552b[_0x1126('0x4a')]['id'];}return db[_0x1126('0x2b')]['find']({'where':{'id':_0x16552b[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x1c7a2b,null))['then'](saveUpdates(_0x16552b[_0x1126('0x4a')],null))[_0x1126('0x23')](respondWithResult(_0x1c7a2b,null))[_0x1126('0x48')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x24')]=function(_0xc8a0f,_0x59c3d0){return db[_0x1126('0x2b')]['find']({'where':{'id':_0xc8a0f[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x59c3d0,null))[_0x1126('0x23')](removeEntity(_0x59c3d0,null))['catch'](handleError(_0x59c3d0,null));};exports[_0x1126('0x51')]=function(_0x2340f8,_0x5763b4){var _0x30812d=0xa;var _0x25038f=[_0x1126('0x52'),'left_join',_0x1126('0x53'),_0x1126('0x54')];var _0x22ab18={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x2a5422={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':'DATE(%s)','HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3767e4=function(_0x5246aa){return!_[_0x1126('0x60')]([_0x1126('0x61'),'IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0x5246aa);};var _0x375b76=function(_0x592960){if(!_0x592960||!_0x592960[_0x1126('0x64')]['length']){return'';}for(var _0x558b6e='(',_0xbdc58=0x0;_0xbdc58<_0x592960[_0x1126('0x64')][_0x1126('0x44')];_0xbdc58+=0x1){_0xbdc58>0x0&&(_0x558b6e+='\x20'+_0x592960[_0x1126('0x65')]+'\x20');_0x558b6e+=_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x66')]?_0x375b76(_0x592960[_0x1126('0x64')][_0xbdc58]['group']):_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x67')]+'\x20'+_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')]+(_0x3767e4(_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')])?'\x20'+_0x592960['rules'][_0xbdc58]['value']:'');}return _0x558b6e+')';};var _0x16a343={'where':{'id':_0x2340f8[_0x1126('0x50')]['id']}},_0x3921c2,_0x4bf2b3,_0x5ee130,_0x5e9260,_0x51a28d;_0x16a343=_[_0x1126('0x3c')]({},_0x16a343,_0x2340f8[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x16a343)[_0x1126('0x23')](function(_0x170bf0){if(_0x170bf0){_0x3921c2=_0x170bf0;return _0x170bf0[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x3f007b){if(_0x3f007b){if(!_0x3f007b[_0x1126('0x44')]){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4bf2b3=_0x3f007b;return db[_0x1126('0x6c')][_0x1126('0x41')]({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x56c003){if(_0x56c003){_0x5ee130=_['keyBy'](_0x56c003,'id');var _0x15cf3d;var _0x2643d7=squel['select']();_0x2643d7[_0x1126('0x6d')](_0x3921c2[_0x1126('0x6e')]);for(var _0x366675=0x0;_0x366675<_0x4bf2b3[_0x1126('0x44')];_0x366675+=0x1){_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x6f')]?_0x5ee130[_0x4bf2b3[_0x366675][_0x1126('0x6f')]][_0x1126('0x70')]:_0x4bf2b3[_0x366675][_0x1126('0x67')];_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x71')]?_[_0x1126('0x72')](_0x22ab18[_0x4bf2b3[_0x366675][_0x1126('0x71')]],'%s',_0x15cf3d):_0x15cf3d;_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x73')]?_[_0x1126('0x72')](_0x2a5422[_0x4bf2b3[_0x366675]['format']],'%s',_0x15cf3d):_0x15cf3d;if(_0x4bf2b3[_0x366675][_0x1126('0x74')]){_0x2643d7[_0x1126('0x66')](_0x15cf3d);}_0x4bf2b3[_0x366675][_0x1126('0x75')]&&_0x2643d7['order'](_0x15cf3d,_0x4bf2b3[_0x366675]['orderBy']===_0x1126('0x76')?![]:!![]);_0x2643d7[_0x1126('0x67')](_0x15cf3d,_0x4bf2b3[_0x366675][_0x1126('0x77')]||_0x15cf3d);}if(_0x3921c2[_0x1126('0x78')]){_0x3921c2['joins']=JSON['parse'](_0x3921c2['joins']);for(var _0x79afca=0x0;_0x79afca<_0x3921c2[_0x1126('0x78')][_0x1126('0x44')];_0x79afca+=0x1){if(_0x3921c2[_0x1126('0x78')][_0x79afca]['type']&&_[_0x1126('0x60')](_0x25038f,_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')])&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x79')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7b')]){_0x2643d7[_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')]](_0x3921c2['joins'][_0x79afca][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x3921c2[_0x1126('0x6e')],_0x3921c2[_0x1126('0x78')][_0x79afca]['parentKey'],_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')],_0x3921c2['joins'][_0x79afca]['foreignKey']));}}}if(_0x3921c2[_0x1126('0x7c')]){_0x3921c2[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x3921c2['conditions']);_0x2643d7['where'](_0x375b76(_0x3921c2['conditions'][_0x1126('0x66')]));}_0x51a28d=_0x2643d7['clone']();_0x2643d7['limit'](_0x30812d);_0x2643d7[_0x1126('0x1b')](0x0);logger['debug'](_0x1126('0x7e'),_0x2643d7[_0x1126('0x7f')]());return dbH['sequelize'][_0x1126('0x31')](_0x2643d7[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](respondWithResult(_0x5763b4,null))[_0x1126('0x48')](handleError(_0x5763b4,null));};function runReport(_0x426faa,_0x5679ec,_0xd182b1){var _0x2d6fcf=_0x5679ec[_0x1126('0x29')];var _0x2af2d0=0xa;var _0x2598a7=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x9a2af0={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':_0x1126('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x33cccf={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':'HOUR(%s)','ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5bdb30=function(_0xb1199b){return!_[_0x1126('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0xb1199b);};var _0x228552=function(_0x1ee970){if(!_0x1ee970||!_0x1ee970[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x2d7150='(',_0x35a9a4=0x0;_0x35a9a4<_0x1ee970[_0x1126('0x64')]['length'];_0x35a9a4+=0x1){_0x35a9a4>0x0&&(_0x2d7150+='\x20'+_0x1ee970[_0x1126('0x65')]+'\x20');_0x2d7150+=_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]?_0x228552(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]):_0x1ee970[_0x1126('0x64')][_0x35a9a4]['field']+'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')]+(_0x5bdb30(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')])?'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x86')]:'');}return _0x2d7150+')';};var _0x2418ca={'where':{'id':_0x426faa['id']}},_0x2d2dfc,_0x38eac6,_0xc3503b,_0x5d6edb,_0x50238d;_0x2418ca=_[_0x1126('0x3c')]({},_0x2418ca,_0xd182b1);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x2418ca)['then'](function(_0x4461ae){if(_0x4461ae){_0x2d2dfc=_0x4461ae;return _0x4461ae['getFields']();}return null;})[_0x1126('0x23')](function(_0x4fbd44){if(_0x4fbd44){if(!_0x4fbd44['length']){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x38eac6=_0x4fbd44;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0xe2f82d){if(_0xe2f82d){_0xc3503b=_[_0x1126('0x87')](_0xe2f82d,'id');var _0x5dfb8f;var _0x48f914=squel[_0x1126('0x88')]();_0x48f914['from'](_0x2d2dfc[_0x1126('0x6e')]);for(var _0x39d9a0=0x0;_0x39d9a0<_0x38eac6[_0x1126('0x44')];_0x39d9a0+=0x1){_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x6f')]?_0xc3503b[_0x38eac6[_0x39d9a0][_0x1126('0x6f')]]['metric']:_0x38eac6[_0x39d9a0]['field'];_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x71')]?_[_0x1126('0x72')](_0x9a2af0[_0x38eac6[_0x39d9a0][_0x1126('0x71')]],'%s',_0x5dfb8f):_0x5dfb8f;_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x73')]?_[_0x1126('0x72')](_0x33cccf[_0x38eac6[_0x39d9a0][_0x1126('0x73')]],'%s',_0x5dfb8f):_0x5dfb8f;if(_0x38eac6[_0x39d9a0][_0x1126('0x74')]){_0x48f914[_0x1126('0x66')](_0x5dfb8f);}_0x38eac6[_0x39d9a0][_0x1126('0x75')]&&_0x48f914[_0x1126('0x89')](_0x5dfb8f,_0x38eac6[_0x39d9a0][_0x1126('0x75')]==='DESC'?![]:!![]);_0x48f914[_0x1126('0x67')](_0x5dfb8f,_0x38eac6[_0x39d9a0]['alias']||_0x5dfb8f);}if(_0x2d2dfc[_0x1126('0x78')]){_0x2d2dfc['joins']=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x78')]);for(var _0x215d4d=0x0;_0x215d4d<_0x2d2dfc[_0x1126('0x78')]['length'];_0x215d4d+=0x1){if(_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x2e')]&&_['includes'](_0x2598a7,_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x2e')])&&_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x79')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7a')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7b')]){_0x48f914[_0x2d2dfc[_0x1126('0x78')][_0x215d4d]['type']](_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],null,util[_0x1126('0x73')](_0x1126('0x8a'),_0x2d2dfc[_0x1126('0x6e')],_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x79')],_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],_0x2d2dfc['joins'][_0x215d4d]['foreignKey']));}}}if(_0x2d2dfc['conditions']){_0x2d2dfc[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x7c')]);_0x48f914[_0x1126('0x39')](_0x228552(_0x2d2dfc['conditions'][_0x1126('0x66')]));}_0x50238d=_0x48f914[_0x1126('0x8b')]();_0x48f914[_0x1126('0x1c')](_0x2af2d0);_0x48f914[_0x1126('0x1b')](0x0);return;}})[_0x1126('0x23')](function(){if(_0x5679ec['output']===_0x1126('0x8c')){return null;}var _0x21c487=_['merge'](_0x5679ec,{'name':_0x5679ec[_0x1126('0x8d')]||_0x5679ec['name']||_0x2d2dfc['name'],'basename':_0x2d6fcf,'savename':util[_0x1126('0x73')]('%s-%s.%s',_0x5679ec[_0x1126('0x29')]||_0x2d2dfc[_0x1126('0x29')],require(_0x1126('0x8e'))[_0x1126('0x8f')](0x4),_0x5679ec[_0x1126('0x90')]||_0x1126('0x91')),'reportId':_0x2d2dfc['id'],'reportType':_0x1126('0x92')});return db[_0x1126('0x93')][_0x1126('0x49')](_0x21c487,{'raw':!![]});})['then'](function(_0x2577f5){if(_0x2d2dfc[_0x1126('0x6e')]===_0x1126('0x94')){_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+_0x1126('0x95'),_0x5679ec[_0x1126('0x96')],_0x5679ec[_0x1126('0x97')]);}else{_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5679ec['startDate'],_0x5679ec[_0x1126('0x97')]);}if(_0x2577f5){logger['info'](_0x1126('0x98'),_0x50238d[_0x1126('0x7f')]());require('child_process')['fork'](path[_0x1126('0x52')](__dirname,_0x1126('0x99'),_0x2577f5['output']),[_0x2577f5['id'],_0x50238d[_0x1126('0x7f')](),path[_0x1126('0x52')](__dirname,'../../files/reports',_0x2577f5[_0x1126('0x9a')]),_0x2d6fcf]);return _0x2577f5;}else{var _0x4a9941=squel[_0x1126('0x88')]();_0x4a9941[_0x1126('0x6d')]('('+_0x50238d[_0x1126('0x7f')]()+')','countTable');_0x4a9941[_0x1126('0x67')](_0x1126('0x9b'),_0x1126('0x3f'));_0x50238d[_0x1126('0x1c')](_0x5679ec[_0x1126('0x1c')]||_0x2af2d0);_0x50238d[_0x1126('0x1b')](_0x5679ec[_0x1126('0x1b')]||0x0);return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x4a9941[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]})[_0x1126('0x23')](function(_0x12ffa5){if(!_0x12ffa5[_0x1126('0x44')]){_0x5d6edb=0x0;}else{_0x5d6edb=_0x12ffa5[0x0][_0x1126('0x3f')]||0x0;}return dbH['sequelize'][_0x1126('0x31')](_0x50238d[_0x1126('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x1126('0x82')]});})[_0x1126('0x23')](function(_0x35065c){return{'rows':_0x35065c||[],'count':_0x5d6edb};});}});}exports[_0x1126('0x9c')]=function(_0x5c0215,_0x444f94){return runReport(_0x5c0215[_0x1126('0x50')],_0x5c0215['query'],_0x5c0215[_0x1126('0x46')])['then'](respondWithResult(_0x444f94,null))[_0x1126('0x48')](handleError(_0x444f94,null));};exports[_0x1126('0x9d')]=runReport;exports['query']=function(_0x4d43ad,_0xa02d9e){var _0x548f9e=0xa;var _0x5edb83=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x4f29ce={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':'MIN(%s)','AVG':_0x1126('0x84'),'GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x17b25d={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':_0x1126('0x9e')};var _0x3a4a91=function(_0x55145f){return!_[_0x1126('0x60')](['IS\x20NULL',_0x1126('0x9f'),_0x1126('0x62'),_0x1126('0x63')],_0x55145f);};var _0x4c7dc7=function(_0x33a27b){if(!_0x33a27b||!_0x33a27b[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x578c1b='(',_0x1562b2=0x0;_0x1562b2<_0x33a27b[_0x1126('0x64')][_0x1126('0x44')];_0x1562b2+=0x1){_0x1562b2>0x0&&(_0x578c1b+='\x20'+_0x33a27b[_0x1126('0x65')]+'\x20');_0x578c1b+=_0x33a27b[_0x1126('0x64')][_0x1562b2]['group']?_0x4c7dc7(_0x33a27b['rules'][_0x1562b2][_0x1126('0x66')]):_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x67')]+'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')]+(_0x3a4a91(_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')])?'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x86')]:'');}return _0x578c1b+')';};var _0x2fb228={'where':{'id':_0x4d43ad[_0x1126('0x50')]['id']}},_0x2c95b6,_0x4a4b43,_0x588f4f,_0x5ac4d6,_0x1168a5;_0x2fb228=_['merge']({},_0x2fb228,_0x4d43ad['options']);return db[_0x1126('0x2b')][_0x1126('0x47')](_0x2fb228)[_0x1126('0x23')](function(_0x48b088){if(_0x48b088){_0x2c95b6=_0x48b088;return _0x48b088[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x5a28f9){if(_0x5a28f9){if(!_0x5a28f9[_0x1126('0x44')]){throw new db[(_0x1126('0xa0'))][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4a4b43=_0x5a28f9;return db[_0x1126('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x1140ec){if(_0x1140ec){_0x588f4f=_['keyBy'](_0x1140ec,'id');var _0x578f5c;var _0x559dae=squel[_0x1126('0x88')]();_0x559dae[_0x1126('0x6d')](_0x2c95b6[_0x1126('0x6e')]);for(var _0x9d7819=0x0;_0x9d7819<_0x4a4b43[_0x1126('0x44')];_0x9d7819+=0x1){_0x578f5c=_0x4a4b43[_0x9d7819]['MetricId']?_0x588f4f[_0x4a4b43[_0x9d7819][_0x1126('0x6f')]]['metric']:_0x4a4b43[_0x9d7819][_0x1126('0x67')];_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x71')]?_['replace'](_0x4f29ce[_0x4a4b43[_0x9d7819]['function']],'%s',_0x578f5c):_0x578f5c;_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x73')]?_[_0x1126('0x72')](_0x17b25d[_0x4a4b43[_0x9d7819]['format']],'%s',_0x578f5c):_0x578f5c;if(_0x4a4b43[_0x9d7819]['groupBy']){_0x559dae[_0x1126('0x66')](_0x578f5c);}_0x4a4b43[_0x9d7819][_0x1126('0x75')]&&_0x559dae[_0x1126('0x89')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x75')]===_0x1126('0x76')?![]:!![]);_0x559dae[_0x1126('0x67')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x77')]||_0x578f5c);}if(_0x2c95b6[_0x1126('0x78')]){_0x2c95b6[_0x1126('0x78')]=JSON[_0x1126('0x7d')](_0x2c95b6['joins']);for(var _0x4d6528=0x0;_0x4d6528<_0x2c95b6[_0x1126('0x78')][_0x1126('0x44')];_0x4d6528+=0x1){if(_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x2e')]&&_[_0x1126('0x60')](_0x5edb83,_0x2c95b6[_0x1126('0x78')][_0x4d6528]['type'])&&_0x2c95b6['joins'][_0x4d6528][_0x1126('0x79')]&&_0x2c95b6['joins'][_0x4d6528]['foreignTable']&&_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]){_0x559dae[_0x2c95b6['joins'][_0x4d6528][_0x1126('0x2e')]](_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x2c95b6[_0x1126('0x6e')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x79')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]));}}}if(_0x2c95b6['conditions']){_0x2c95b6[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2c95b6[_0x1126('0x7c')]);_0x559dae[_0x1126('0x39')](_0x4c7dc7(_0x2c95b6['conditions'][_0x1126('0x66')]));}_0x1168a5=_0x559dae[_0x1126('0x8b')]();_0x559dae['limit'](_0x548f9e);_0x559dae[_0x1126('0x1b')](0x0);logger[_0x1126('0xa1')](_0x1126('0x7e'),_0x559dae['toString']());return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x559dae[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](function(){return{'sql':_0x1168a5[_0x1126('0x7f')]()};})[_0x1126('0x23')](respondWithResult(_0xa02d9e,null))['catch'](handleError(_0xa02d9e,null));};
\ No newline at end of file
+var _0x46ed=['SEC_TO_TIME(%s)','value','AnalyticMetric','select','DESC','output','fullPath','%s-%s.%s','randomstring','csv','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','COUNT(*)','sequelize','runReport','left_join','COUNT(%s)','MIN(%s)','AVG(%s)','Limited\x20Query:','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','QueryTypes','SELECT'];(function(_0x18811b,_0x6bede4){var _0x2fbee4=function(_0x4dcf84){while(--_0x4dcf84){_0x18811b['push'](_0x18811b['shift']());}};_0x2fbee4(++_0x6bede4);}(_0x46ed,0x168));var _0xd46e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x46ed[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xf3048c,_0x27dbfb){_0x27dbfb=_0x27dbfb||0xcc;return function(_0x53b309){if(_0x53b309){return _0xf3048c['sendStatus'](_0x27dbfb);}return _0xf3048c[_0xd46e('0x1a')](_0x27dbfb)[_0xd46e('0x1b')]();};}function respondWithResult(_0x1e9aae,_0x3fdf88){_0x3fdf88=_0x3fdf88||0xc8;return function(_0x50c7c3){if(_0x50c7c3){return _0x1e9aae[_0xd46e('0x1a')](_0x3fdf88)[_0xd46e('0x1c')](_0x50c7c3);}};}function respondWithFilteredResult(_0x417402,_0x3d72ce){return function(_0x36a317){if(_0x36a317){var _0x47fa8f=typeof _0x3d72ce[_0xd46e('0x1d')]===_0xd46e('0x1e')&&typeof _0x3d72ce[_0xd46e('0x1f')]==='undefined';var _0x5ddd04=_0x36a317[_0xd46e('0x20')];var _0x1bd574=_0x47fa8f?0x0:_0x3d72ce['offset'];var _0x4fd1f2=_0x47fa8f?_0x36a317[_0xd46e('0x20')]:_0x3d72ce[_0xd46e('0x1d')]+_0x3d72ce[_0xd46e('0x1f')];var _0x2273c5;if(_0x4fd1f2>=_0x5ddd04){_0x4fd1f2=_0x5ddd04;_0x2273c5=0xc8;}else{_0x2273c5=0xce;}_0x417402[_0xd46e('0x1a')](_0x2273c5);return _0x417402[_0xd46e('0x21')](_0xd46e('0x22'),_0x1bd574+'-'+_0x4fd1f2+'/'+_0x5ddd04)[_0xd46e('0x1c')](_0x36a317);}return null;};}function patchUpdates(_0xb4940){return function(_0x3c7e91){try{jsonpatch[_0xd46e('0x23')](_0x3c7e91,_0xb4940,!![]);}catch(_0x5ba94d){return BPromise[_0xd46e('0x24')](_0x5ba94d);}return _0x3c7e91[_0xd46e('0x25')]();};}function saveUpdates(_0x79aa51,_0x45ce0b){return function(_0x128246){if(_0x128246){return _0x128246[_0xd46e('0x26')](_0x79aa51)[_0xd46e('0x27')](function(_0x8a1be){return _0x8a1be;});}return null;};}function removeEntity(_0x62dea5,_0x4cf899){return function(_0x314570){if(_0x314570){return _0x314570['destroy']()['then'](function(){var _0x371054=_0x314570[_0xd46e('0x28')]({'plain':!![]});var _0x21135f=_0xd46e('0x29');return db[_0xd46e('0x2a')][_0xd46e('0x2b')]({'where':{'type':_0x21135f,'resourceId':_0x371054['id']}})[_0xd46e('0x27')](function(){return _0x314570;});})['then'](function(){_0x62dea5[_0xd46e('0x1a')](0xcc)[_0xd46e('0x1b')]();});}};}function handleEntityNotFound(_0xddbce9,_0x17db79){return function(_0x96f15c){if(!_0x96f15c){_0xddbce9[_0xd46e('0x2c')](0x194);}return _0x96f15c;};}function handleError(_0x58aeef,_0x465d54){_0x465d54=_0x465d54||0x1f4;return function(_0x3a1ced){logger[_0xd46e('0x2d')](_0x3a1ced[_0xd46e('0x2e')]);if(_0x3a1ced[_0xd46e('0x2f')]){delete _0x3a1ced[_0xd46e('0x2f')];}_0x58aeef[_0xd46e('0x1a')](_0x465d54)[_0xd46e('0x30')](_0x3a1ced);};}exports[_0xd46e('0x31')]=function(_0x45ea47,_0x2ff785){var _0x504324={},_0x2f4a1b={},_0x5ed8dc={'count':0x0,'rows':[]};var _0x1248ce=_[_0xd46e('0x32')](db[_0xd46e('0x33')][_0xd46e('0x34')],function(_0x5ef248){return{'name':_0x5ef248[_0xd46e('0x35')],'type':_0x5ef248[_0xd46e('0x36')]['key']};});_0x2f4a1b[_0xd46e('0x37')]=_[_0xd46e('0x32')](_0x1248ce,'name');_0x2f4a1b[_0xd46e('0x38')]=_[_0xd46e('0x39')](_0x45ea47[_0xd46e('0x38')]);_0x2f4a1b['filters']=_['intersection'](_0x2f4a1b[_0xd46e('0x37')],_0x2f4a1b[_0xd46e('0x38')]);_0x504324[_0xd46e('0x3a')]=_[_0xd46e('0x3b')](_0x2f4a1b[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x504324['attributes']=_0x504324[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x504324[_0xd46e('0x3a')]:_0x2f4a1b[_0xd46e('0x37')];if(!_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3e')](_0xd46e('0x3f'))){_0x504324['limit']=qs[_0xd46e('0x1f')](_0x45ea47[_0xd46e('0x38')]['limit']);_0x504324[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x1d')]);}_0x504324['order']=qs[_0xd46e('0x40')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x40')]);_0x504324[_0xd46e('0x41')]=qs[_0xd46e('0x42')](_[_0xd46e('0x43')](_0x45ea47[_0xd46e('0x38')],_0x2f4a1b[_0xd46e('0x42')]),_0x1248ce);if(_0x45ea47['query'][_0xd46e('0x44')]){_0x504324[_0xd46e('0x41')]=_[_0xd46e('0x45')](_0x504324[_0xd46e('0x41')],{'$or':_[_0xd46e('0x32')](_0x1248ce,function(_0x56f99c){if(_0x56f99c[_0xd46e('0x36')]!=='VIRTUAL'){var _0x55230d={};_0x55230d[_0x56f99c['name']]={'$like':'%'+_0x45ea47['query'][_0xd46e('0x44')]+'%'};return _0x55230d;}})});}_0x504324=_['merge']({},_0x504324,_0x45ea47[_0xd46e('0x46')]);var _0x40720e={'where':_0x504324['where']};return db[_0xd46e('0x33')][_0xd46e('0x20')](_0x40720e)[_0xd46e('0x27')](function(_0x31ba12){_0x5ed8dc[_0xd46e('0x20')]=_0x31ba12;if(_0x45ea47[_0xd46e('0x38')][_0xd46e('0x47')]){_0x504324[_0xd46e('0x48')]=[{'all':!![]}];}return db[_0xd46e('0x33')][_0xd46e('0x49')](_0x504324);})[_0xd46e('0x27')](function(_0x5ea048){_0x5ed8dc['rows']=_0x5ea048;return _0x5ed8dc;})['then'](respondWithFilteredResult(_0x2ff785,_0x504324))[_0xd46e('0x4a')](handleError(_0x2ff785,null));};exports['show']=function(_0x168d35,_0x272f5f){var _0x3fdf67={'raw':!![],'where':{'id':_0x168d35[_0xd46e('0x4b')]['id']}},_0x416505={};_0x416505[_0xd46e('0x37')]=_[_0xd46e('0x39')](db[_0xd46e('0x33')]['rawAttributes']);_0x416505[_0xd46e('0x38')]=_['keys'](_0x168d35[_0xd46e('0x38')]);_0x416505[_0xd46e('0x42')]=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],_0x416505[_0xd46e('0x38')]);_0x3fdf67['attributes']=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x168d35[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x3fdf67['attributes']=_0x3fdf67[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x3fdf67[_0xd46e('0x3a')]:_0x416505[_0xd46e('0x37')];if(_0x168d35[_0xd46e('0x38')]['includeAll']){_0x3fdf67[_0xd46e('0x48')]=[{'all':!![]}];}_0x3fdf67=_[_0xd46e('0x45')]({},_0x3fdf67,_0x168d35[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fdf67)[_0xd46e('0x27')](handleEntityNotFound(_0x272f5f,null))[_0xd46e('0x27')](respondWithResult(_0x272f5f,null))[_0xd46e('0x4a')](handleError(_0x272f5f,null));};exports['create']=function(_0xf9dab,_0x71a8dc){return db[_0xd46e('0x33')][_0xd46e('0x4d')](_0xf9dab[_0xd46e('0x4e')],{})['then'](function(_0x4ae314){var _0x3a94cf=_0xf9dab[_0xd46e('0x4f')][_0xd46e('0x28')]({'plain':!![]});if(!_0x3a94cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a94cf['role']===_0xd46e('0x4f')){var _0x9d8638=_0x4ae314['get']({'plain':!![]});var _0x2eee92=_0xd46e('0x50');return db[_0xd46e('0x51')][_0xd46e('0x4c')]({'where':{'name':_0x2eee92,'userProfileId':_0x3a94cf[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x27')](function(_0x80ed51){if(_0x80ed51&&_0x80ed51[_0xd46e('0x53')]===0x0){return db['UserProfileResource'][_0xd46e('0x4d')]({'name':_0x9d8638[_0xd46e('0x2f')],'resourceId':_0x9d8638['id'],'type':_0xd46e('0x29'),'sectionId':_0x80ed51['id']},{})[_0xd46e('0x27')](function(){return _0x4ae314;});}else{return _0x4ae314;}})['catch'](function(_0x56dd9a){logger[_0xd46e('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56dd9a);throw _0x56dd9a;});}return _0x4ae314;})[_0xd46e('0x27')](respondWithResult(_0x71a8dc,0xc9))[_0xd46e('0x4a')](handleError(_0x71a8dc,null));};exports[_0xd46e('0x26')]=function(_0x31f7eb,_0x5a7870){if(_0x31f7eb[_0xd46e('0x4e')]['id']){delete _0x31f7eb['body']['id'];}return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x31f7eb[_0xd46e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5a7870,null))[_0xd46e('0x27')](saveUpdates(_0x31f7eb[_0xd46e('0x4e')],null))[_0xd46e('0x27')](respondWithResult(_0x5a7870,null))[_0xd46e('0x4a')](handleError(_0x5a7870,null));};exports[_0xd46e('0x2b')]=function(_0x2cc676,_0x2760ef){return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x2cc676[_0xd46e('0x4b')]['id']}})[_0xd46e('0x27')](handleEntityNotFound(_0x2760ef,null))[_0xd46e('0x27')](removeEntity(_0x2760ef,null))[_0xd46e('0x4a')](handleError(_0x2760ef,null));};exports[_0xd46e('0x54')]=function(_0x47a86c,_0x3ec709){var _0x37a22f=0xa;var _0xe0cd61=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0xaf9641={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x481dce={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x2dacb4=function(_0x2f9fcb){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x2f9fcb);};var _0x1aaa99=function(_0x272514){if(!_0x272514||!_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x476f09='(',_0x5067b7=0x0;_0x5067b7<_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')];_0x5067b7+=0x1){_0x5067b7>0x0&&(_0x476f09+='\x20'+_0x272514[_0xd46e('0x68')]+'\x20');_0x476f09+=_0x272514['rules'][_0x5067b7][_0xd46e('0x69')]?_0x1aaa99(_0x272514[_0xd46e('0x67')][_0x5067b7]['group']):_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6a')]+'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['condition']+(_0x2dacb4(_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6b')])?'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['value']:'');}return _0x476f09+')';};var _0xe5f8cd={'where':{'id':_0x47a86c[_0xd46e('0x4b')]['id']}},_0x516e7d,_0x32eed0,_0x148187,_0x35db1b,_0x4f3ba0;_0xe5f8cd=_[_0xd46e('0x45')]({},_0xe5f8cd,_0x47a86c[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0xe5f8cd)[_0xd46e('0x27')](function(_0x16f906){if(_0x16f906){_0x516e7d=_0x16f906;return _0x16f906[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0x3e55a3){if(_0x3e55a3){if(!_0x3e55a3[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))](_0xd46e('0x6f'),0x193);}_0x32eed0=_0x3e55a3;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3e0ed5){if(_0x3e0ed5){_0x148187=_[_0xd46e('0x70')](_0x3e0ed5,'id');var _0x2fff69;var _0x249938=squel['select']();_0x249938[_0xd46e('0x71')](_0x516e7d[_0xd46e('0x72')]);for(var _0xfb4073=0x0;_0xfb4073<_0x32eed0[_0xd46e('0x3d')];_0xfb4073+=0x1){_0x2fff69=_0x32eed0[_0xfb4073]['MetricId']?_0x148187[_0x32eed0[_0xfb4073][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x32eed0[_0xfb4073]['field'];_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0xaf9641[_0x32eed0[_0xfb4073]['function']],'%s',_0x2fff69):_0x2fff69;_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x481dce[_0x32eed0[_0xfb4073]['format']],'%s',_0x2fff69):_0x2fff69;if(_0x32eed0[_0xfb4073][_0xd46e('0x78')]){_0x249938['group'](_0x2fff69);}_0x32eed0[_0xfb4073][_0xd46e('0x79')]&&_0x249938[_0xd46e('0x7a')](_0x2fff69,_0x32eed0[_0xfb4073]['orderBy']==='DESC'?![]:!![]);_0x249938[_0xd46e('0x6a')](_0x2fff69,_0x32eed0[_0xfb4073][_0xd46e('0x7b')]||_0x2fff69);}if(_0x516e7d[_0xd46e('0x7c')]){_0x516e7d[_0xd46e('0x7c')]=JSON['parse'](_0x516e7d[_0xd46e('0x7c')]);for(var _0x372509=0x0;_0x372509<_0x516e7d['joins'][_0xd46e('0x3d')];_0x372509+=0x1){if(_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0xe0cd61,_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')])&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7d')]&&_0x516e7d[_0xd46e('0x7c')][_0x372509]['foreignTable']&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7e')]){_0x249938[_0x516e7d['joins'][_0x372509][_0xd46e('0x36')]](_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0x516e7d[_0xd46e('0x72')],_0x516e7d['joins'][_0x372509]['parentKey'],_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],_0x516e7d['joins'][_0x372509]['foreignKey']));}}}if(_0x516e7d['conditions']){_0x516e7d[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x516e7d[_0xd46e('0x81')]);_0x249938['where'](_0x1aaa99(_0x516e7d[_0xd46e('0x81')][_0xd46e('0x69')]));}_0x4f3ba0=_0x249938[_0xd46e('0x83')]();_0x249938['limit'](_0x37a22f);_0x249938['offset'](0x0);logger['debug']('Limited\x20Query:',_0x249938[_0xd46e('0x84')]());return dbH['sequelize'][_0xd46e('0x38')](_0x249938['toString'](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](respondWithResult(_0x3ec709,null))[_0xd46e('0x4a')](handleError(_0x3ec709,null));};function runReport(_0xf16d87,_0x99872a,_0x57a7cc){var _0x586024=_0x99872a[_0xd46e('0x2f')];var _0x383919=0xa;var _0x114f2c=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0x4ca21f={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x5ef4cc={'SEC_TO_TIME':_0xd46e('0x87'),'DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x88460a=function(_0x3a3744){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x3a3744);};var _0x3c476d=function(_0x1b2a6d){if(!_0x1b2a6d||!_0x1b2a6d[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x441f73='(',_0x1d2738=0x0;_0x1d2738<_0x1b2a6d['rules'][_0xd46e('0x3d')];_0x1d2738+=0x1){_0x1d2738>0x0&&(_0x441f73+='\x20'+_0x1b2a6d['operator']+'\x20');_0x441f73+=_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x69')]?_0x3c476d(_0x1b2a6d['rules'][_0x1d2738][_0xd46e('0x69')]):_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6a')]+'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')]+(_0x88460a(_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')])?'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x88')]:'');}return _0x441f73+')';};var _0x3fa34d={'where':{'id':_0xf16d87['id']}},_0xc098c9,_0x5f5ba7,_0x493df5,_0x18e140,_0x459a0c;_0x3fa34d=_[_0xd46e('0x45')]({},_0x3fa34d,_0x57a7cc);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fa34d)[_0xd46e('0x27')](function(_0x5b554e){if(_0x5b554e){_0xc098c9=_0x5b554e;return _0x5b554e[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0xa254f5){if(_0xa254f5){if(!_0xa254f5[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5f5ba7=_0xa254f5;return db[_0xd46e('0x89')][_0xd46e('0x49')]({'raw':!![]});}return null;})['then'](function(_0x3c8d68){if(_0x3c8d68){_0x493df5=_[_0xd46e('0x70')](_0x3c8d68,'id');var _0x9e222d;var _0x3da17e=squel[_0xd46e('0x8a')]();_0x3da17e[_0xd46e('0x71')](_0xc098c9[_0xd46e('0x72')]);for(var _0x282f71=0x0;_0x282f71<_0x5f5ba7[_0xd46e('0x3d')];_0x282f71+=0x1){_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x73')]?_0x493df5[_0x5f5ba7[_0x282f71][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x5f5ba7[_0x282f71][_0xd46e('0x6a')];_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x75')]?_['replace'](_0x4ca21f[_0x5f5ba7[_0x282f71]['function']],'%s',_0x9e222d):_0x9e222d;_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x5ef4cc[_0x5f5ba7[_0x282f71][_0xd46e('0x77')]],'%s',_0x9e222d):_0x9e222d;if(_0x5f5ba7[_0x282f71][_0xd46e('0x78')]){_0x3da17e[_0xd46e('0x69')](_0x9e222d);}_0x5f5ba7[_0x282f71][_0xd46e('0x79')]&&_0x3da17e['order'](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x3da17e[_0xd46e('0x6a')](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x7b')]||_0x9e222d);}if(_0xc098c9['joins']){_0xc098c9[_0xd46e('0x7c')]=JSON[_0xd46e('0x82')](_0xc098c9['joins']);for(var _0xdf967c=0x0;_0xdf967c<_0xc098c9['joins']['length'];_0xdf967c+=0x1){if(_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x114f2c,_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['type'])&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7d')]&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7f')]&&_0xc098c9['joins'][_0xdf967c]['foreignKey']){_0x3da17e[_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]](_0xc098c9['joins'][_0xdf967c]['foreignTable'],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0xc098c9[_0xd46e('0x72')],_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['parentKey'],_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x7f')],_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7e')]));}}}if(_0xc098c9[_0xd46e('0x81')]){_0xc098c9[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0xc098c9[_0xd46e('0x81')]);_0x3da17e[_0xd46e('0x41')](_0x3c476d(_0xc098c9['conditions'][_0xd46e('0x69')]));}_0x459a0c=_0x3da17e[_0xd46e('0x83')]();_0x3da17e['limit'](_0x383919);_0x3da17e['offset'](0x0);return;}})[_0xd46e('0x27')](function(){if(_0x99872a[_0xd46e('0x8c')]==='web'){return null;}var _0x5e637d=_[_0xd46e('0x45')](_0x99872a,{'name':_0x99872a[_0xd46e('0x8d')]||_0x99872a['name']||_0xc098c9[_0xd46e('0x2f')],'basename':_0x586024,'savename':util[_0xd46e('0x77')](_0xd46e('0x8e'),_0x99872a[_0xd46e('0x2f')]||_0xc098c9[_0xd46e('0x2f')],require(_0xd46e('0x8f'))['generate'](0x4),_0x99872a[_0xd46e('0x8c')]||_0xd46e('0x90')),'reportId':_0xc098c9['id'],'reportType':_0xd46e('0x91')});return db[_0xd46e('0x92')][_0xd46e('0x4d')](_0x5e637d,{'raw':!![]});})[_0xd46e('0x27')](function(_0x3311a6){if(_0xc098c9[_0xd46e('0x72')]===_0xd46e('0x93')){_0x459a0c[_0xd46e('0x41')](_0xc098c9[_0xd46e('0x72')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x99872a[_0xd46e('0x94')],_0x99872a['endDate']);}else{_0x459a0c['where'](_0xc098c9[_0xd46e('0x72')]+_0xd46e('0x95'),_0x99872a[_0xd46e('0x94')],_0x99872a[_0xd46e('0x96')]);}if(_0x3311a6){logger[_0xd46e('0x97')](_0xd46e('0x98'),_0x459a0c[_0xd46e('0x84')]());require(_0xd46e('0x99'))['fork'](path[_0xd46e('0x55')](__dirname,'../../components/export/',_0x3311a6[_0xd46e('0x8c')]),[_0x3311a6['id'],_0x459a0c[_0xd46e('0x84')](),path[_0xd46e('0x55')](__dirname,_0xd46e('0x9a'),_0x3311a6[_0xd46e('0x9b')]),_0x586024]);return _0x3311a6;}else{var _0x399918=squel[_0xd46e('0x8a')]();_0x399918[_0xd46e('0x71')]('('+_0x459a0c['toString']()+')',_0xd46e('0x9c'));_0x399918[_0xd46e('0x6a')](_0xd46e('0x9d'),'count');_0x459a0c[_0xd46e('0x1f')](_0x99872a[_0xd46e('0x1f')]||_0x383919);_0x459a0c[_0xd46e('0x1d')](_0x99872a['offset']||0x0);return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x399918[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]})['then'](function(_0x4967ff){if(!_0x4967ff[_0xd46e('0x3d')]){_0x18e140=0x0;}else{_0x18e140=_0x4967ff[0x0][_0xd46e('0x20')]||0x0;}return dbH['sequelize'][_0xd46e('0x38')](_0x459a0c[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]});})[_0xd46e('0x27')](function(_0x4bb76b){return{'rows':_0x4bb76b||[],'count':_0x18e140};});}});}exports['run']=function(_0x204a9f,_0x52ca5a){return runReport(_0x204a9f[_0xd46e('0x4b')],_0x204a9f[_0xd46e('0x38')],_0x204a9f['options'])[_0xd46e('0x27')](respondWithResult(_0x52ca5a,null))[_0xd46e('0x4a')](handleError(_0x52ca5a,null));};exports[_0xd46e('0x9f')]=runReport;exports[_0xd46e('0x38')]=function(_0x786ae,_0x537c73){var _0x1610bd=0xa;var _0x20cc4c=[_0xd46e('0x55'),_0xd46e('0xa0'),_0xd46e('0x56'),_0xd46e('0x57')];var _0x368742={'SUM':_0xd46e('0x58'),'COUNT':_0xd46e('0xa1'),'COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':_0xd46e('0xa2'),'AVG':_0xd46e('0xa3'),'GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x285cf8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xc87da2=function(_0x195f02){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),'IS\x20NOT\x20NULL',_0xd46e('0x65'),_0xd46e('0x66')],_0x195f02);};var _0x44322f=function(_0x49959f){if(!_0x49959f||!_0x49959f['rules'][_0xd46e('0x3d')]){return'';}for(var _0x2094e5='(',_0x85aac1=0x0;_0x85aac1<_0x49959f[_0xd46e('0x67')][_0xd46e('0x3d')];_0x85aac1+=0x1){_0x85aac1>0x0&&(_0x2094e5+='\x20'+_0x49959f[_0xd46e('0x68')]+'\x20');_0x2094e5+=_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]?_0x44322f(_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]):_0x49959f['rules'][_0x85aac1][_0xd46e('0x6a')]+'\x20'+_0x49959f['rules'][_0x85aac1]['condition']+(_0xc87da2(_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x6b')])?'\x20'+_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x88')]:'');}return _0x2094e5+')';};var _0x101a29={'where':{'id':_0x786ae[_0xd46e('0x4b')]['id']}},_0x3a44da,_0x417068,_0x52e73e,_0x206077,_0xe729b6;_0x101a29=_[_0xd46e('0x45')]({},_0x101a29,_0x786ae[_0xd46e('0x46')]);return db['AnalyticDefaultReport'][_0xd46e('0x4c')](_0x101a29)[_0xd46e('0x27')](function(_0x1d08bb){if(_0x1d08bb){_0x3a44da=_0x1d08bb;return _0x1d08bb['getFields']();}return null;})[_0xd46e('0x27')](function(_0x8c6ed1){if(_0x8c6ed1){if(!_0x8c6ed1['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xd46e('0x6f'),0x193);}_0x417068=_0x8c6ed1;return db[_0xd46e('0x89')]['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3a13f8){if(_0x3a13f8){_0x52e73e=_['keyBy'](_0x3a13f8,'id');var _0x5a8661;var _0x157fb0=squel[_0xd46e('0x8a')]();_0x157fb0[_0xd46e('0x71')](_0x3a44da[_0xd46e('0x72')]);for(var _0x50750f=0x0;_0x50750f<_0x417068['length'];_0x50750f+=0x1){_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x73')]?_0x52e73e[_0x417068[_0x50750f][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x417068[_0x50750f][_0xd46e('0x6a')];_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0x368742[_0x417068[_0x50750f][_0xd46e('0x75')]],'%s',_0x5a8661):_0x5a8661;_0x5a8661=_0x417068[_0x50750f]['format']?_[_0xd46e('0x76')](_0x285cf8[_0x417068[_0x50750f][_0xd46e('0x77')]],'%s',_0x5a8661):_0x5a8661;if(_0x417068[_0x50750f]['groupBy']){_0x157fb0[_0xd46e('0x69')](_0x5a8661);}_0x417068[_0x50750f][_0xd46e('0x79')]&&_0x157fb0[_0xd46e('0x7a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x157fb0[_0xd46e('0x6a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x7b')]||_0x5a8661);}if(_0x3a44da[_0xd46e('0x7c')]){_0x3a44da['joins']=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x7c')]);for(var _0x3c819b=0x0;_0x3c819b<_0x3a44da[_0xd46e('0x7c')][_0xd46e('0x3d')];_0x3c819b+=0x1){if(_0x3a44da['joins'][_0x3c819b][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x20cc4c,_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')])&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7d')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']){_0x157fb0[_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')]](_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3a44da[_0xd46e('0x72')],_0x3a44da['joins'][_0x3c819b][_0xd46e('0x7d')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']));}}}if(_0x3a44da[_0xd46e('0x81')]){_0x3a44da[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x81')]);_0x157fb0[_0xd46e('0x41')](_0x44322f(_0x3a44da[_0xd46e('0x81')][_0xd46e('0x69')]));}_0xe729b6=_0x157fb0[_0xd46e('0x83')]();_0x157fb0[_0xd46e('0x1f')](_0x1610bd);_0x157fb0['offset'](0x0);logger['debug'](_0xd46e('0xa4'),_0x157fb0['toString']());return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x157fb0[_0xd46e('0x84')](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](function(){return{'sql':_0xe729b6['toString']()};})['then'](respondWithResult(_0x537c73,null))[_0xd46e('0x4a')](handleError(_0x537c73,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 2dd9b34..63d815f 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 _0xe8c1=['exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x47f14b,_0x293a3b){var _0x1a9a3d=function(_0x373aca){while(--_0x373aca){_0x47f14b['push'](_0x47f14b['shift']());}};_0x1a9a3d(++_0x293a3b);}(_0xe8c1,0x18c));var _0x1e8c=function(_0x522c6d,_0x4d250d){_0x522c6d=_0x522c6d-0x0;var _0x26300d=_0xe8c1[_0x522c6d];return _0x26300d;};'use strict';var _=require(_0x1e8c('0x0'));var util=require(_0x1e8c('0x1'));var logger=require(_0x1e8c('0x2'))(_0x1e8c('0x3'));var moment=require('moment');var BPromise=require(_0x1e8c('0x4'));var rp=require(_0x1e8c('0x5'));var fs=require('fs');var path=require(_0x1e8c('0x6'));var rimraf=require(_0x1e8c('0x7'));var config=require(_0x1e8c('0x8'));var attributes=require(_0x1e8c('0x9'));module[_0x1e8c('0xa')]=function(_0x78f235,_0xfd0310){return _0x78f235[_0x1e8c('0xb')](_0x1e8c('0xc'),attributes,{'tableName':_0x1e8c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9efd=['analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport'];(function(_0x6cc730,_0x4415ee){var _0x18f448=function(_0x727f9c){while(--_0x727f9c){_0x6cc730['push'](_0x6cc730['shift']());}};_0x18f448(++_0x4415ee);}(_0x9efd,0x83));var _0xd9ef=function(_0x4d2021,_0x251ed8){_0x4d2021=_0x4d2021-0x0;var _0x542d0f=_0x9efd[_0x4d2021];return _0x542d0f;};'use strict';var _=require(_0xd9ef('0x0'));var util=require(_0xd9ef('0x1'));var logger=require(_0xd9ef('0x2'))(_0xd9ef('0x3'));var moment=require(_0xd9ef('0x4'));var BPromise=require(_0xd9ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd9ef('0x6'));var rimraf=require(_0xd9ef('0x7'));var config=require(_0xd9ef('0x8'));var attributes=require(_0xd9ef('0x9'));module['exports']=function(_0x38a937,_0x2c8758){return _0x38a937[_0xd9ef('0xa')](_0xd9ef('0xb'),attributes,{'tableName':_0xd9ef('0xc'),'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 2d22c77..1c97e31 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 _0x67df=['request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x2d91c6,_0x10ae0e){var _0x3a8d19=function(_0x27a3ce){while(--_0x27a3ce){_0x2d91c6['push'](_0x2d91c6['shift']());}};_0x3a8d19(++_0x10ae0e);}(_0x67df,0x1d6));var _0xf67d=function(_0x44d9d6,_0x3f4e79){_0x44d9d6=_0x44d9d6-0x0;var _0x2fb9f1=_0x67df[_0x44d9d6];return _0x2fb9f1;};'use strict';var _=require(_0xf67d('0x0'));var util=require(_0xf67d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf67d('0x2'));var fs=require('fs');var Redis=require(_0xf67d('0x3'));var db=require(_0xf67d('0x4'))['db'];var utils=require(_0xf67d('0x5'));var logger=require(_0xf67d('0x6'))(_0xf67d('0x7'));var config=require(_0xf67d('0x8'));var jayson=require(_0xf67d('0x9'));var client=jayson[_0xf67d('0xa')][_0xf67d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a542f,_0x34da87,_0x1512de){return new BPromise(function(_0x5b988d,_0xa03535){return client[_0xf67d('0xc')](_0x1a542f,_0x1512de)['then'](function(_0x33e4c5){logger[_0xf67d('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x34da87,_0xf67d('0xe'));logger['debug'](_0xf67d('0xf'),_0x34da87,_0xf67d('0xe'),JSON[_0xf67d('0x10')](_0x33e4c5));if(_0x33e4c5[_0xf67d('0x11')]){if(_0x33e4c5['error'][_0xf67d('0x12')]===0x1f4){logger['error'](_0xf67d('0x13'),_0x34da87,_0x33e4c5[_0xf67d('0x11')][_0xf67d('0x14')]);return _0xa03535(_0x33e4c5[_0xf67d('0x11')][_0xf67d('0x14')]);}logger[_0xf67d('0x11')](_0xf67d('0x13'),_0x34da87,_0x33e4c5[_0xf67d('0x11')][_0xf67d('0x14')]);return _0x5b988d(_0x33e4c5[_0xf67d('0x11')][_0xf67d('0x14')]);}else{logger[_0xf67d('0xd')](_0xf67d('0x13'),_0x34da87,'request\x20sent');_0x5b988d(_0x33e4c5['result'][_0xf67d('0x14')]);}})[_0xf67d('0x15')](function(_0x733f49){logger[_0xf67d('0x11')](_0xf67d('0x13'),_0x34da87,_0x733f49);_0xa03535(_0x733f49);});});}
\ No newline at end of file
+var _0xd377=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0xb30cbf,_0x385a9c){var _0x22c6c3=function(_0x261681){while(--_0x261681){_0xb30cbf['push'](_0xb30cbf['shift']());}};_0x22c6c3(++_0x385a9c);}(_0xd377,0xa9));var _0x7d37=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xd377[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7d37('0x0'));var util=require(_0x7d37('0x1'));var moment=require(_0x7d37('0x2'));var BPromise=require('bluebird');var rs=require(_0x7d37('0x3'));var fs=require('fs');var Redis=require(_0x7d37('0x4'));var db=require(_0x7d37('0x5'))['db'];var utils=require(_0x7d37('0x6'));var logger=require(_0x7d37('0x7'))(_0x7d37('0x8'));var config=require(_0x7d37('0x9'));var jayson=require(_0x7d37('0xa'));var client=jayson[_0x7d37('0xb')][_0x7d37('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2b18ba,_0x331cb7,_0xea793e){return new BPromise(function(_0x5f0a0d,_0x4694be){return client[_0x7d37('0xd')](_0x2b18ba,_0xea793e)[_0x7d37('0xe')](function(_0xbf3251){logger[_0x7d37('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x331cb7,_0x7d37('0x10'));logger[_0x7d37('0x11')](_0x7d37('0x12'),_0x331cb7,_0x7d37('0x10'),JSON['stringify'](_0xbf3251));if(_0xbf3251['error']){if(_0xbf3251[_0x7d37('0x13')][_0x7d37('0x14')]===0x1f4){logger[_0x7d37('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x331cb7,_0xbf3251[_0x7d37('0x13')][_0x7d37('0x15')]);return _0x4694be(_0xbf3251[_0x7d37('0x13')][_0x7d37('0x15')]);}logger[_0x7d37('0x13')](_0x7d37('0x16'),_0x331cb7,_0xbf3251['error']['message']);return _0x5f0a0d(_0xbf3251[_0x7d37('0x13')]['message']);}else{logger[_0x7d37('0xf')](_0x7d37('0x16'),_0x331cb7,'request\x20sent');_0x5f0a0d(_0xbf3251[_0x7d37('0x17')][_0x7d37('0x15')]);}})['catch'](function(_0x1da301){logger[_0x7d37('0x13')](_0x7d37('0x16'),_0x331cb7,_0x1da301);_0x4694be(_0x1da301);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 77150d5..cd6d4e4 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 _0x9550=['put','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','/:id/query','query','post'];(function(_0x449c69,_0x5a4c82){var _0x4eca43=function(_0x3e656d){while(--_0x3e656d){_0x449c69['push'](_0x449c69['shift']());}};_0x4eca43(++_0x5a4c82);}(_0x9550,0x1cc));var _0x0955=function(_0x128a3b,_0x58add2){_0x128a3b=_0x128a3b-0x0;var _0x3ab862=_0x9550[_0x128a3b];return _0x3ab862;};'use strict';var multer=require('multer');var util=require(_0x0955('0x0'));var path=require(_0x0955('0x1'));var timeout=require('connect-timeout');var express=require(_0x0955('0x2'));var router=express[_0x0955('0x3')]();var fs_extra=require(_0x0955('0x4'));var auth=require(_0x0955('0x5'));var interaction=require(_0x0955('0x6'));var config=require(_0x0955('0x7'));var controller=require(_0x0955('0x8'));router[_0x0955('0x9')]('/',auth[_0x0955('0xa')](),controller[_0x0955('0xb')]);router['get'](_0x0955('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x0955('0x9')](_0x0955('0xd'),auth[_0x0955('0xa')](),controller[_0x0955('0xe')]);router[_0x0955('0x9')](_0x0955('0xf'),auth[_0x0955('0xa')](),controller[_0x0955('0x10')]);router[_0x0955('0x9')](_0x0955('0x11'),auth['isAuthenticated'](),controller[_0x0955('0x12')]);router[_0x0955('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0955('0x14')](_0x0955('0xc'),auth['isAuthenticated'](),controller[_0x0955('0x15')]);router[_0x0955('0x16')](_0x0955('0xc'),auth[_0x0955('0xa')](),controller[_0x0955('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0xa723=['connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','util','path'];(function(_0x2e1777,_0x1f056a){var _0x35628f=function(_0x50499e){while(--_0x50499e){_0x2e1777['push'](_0x2e1777['shift']());}};_0x35628f(++_0x1f056a);}(_0xa723,0x185));var _0x3a72=function(_0x3eb630,_0x552586){_0x3eb630=_0x3eb630-0x0;var _0x1b840d=_0xa723[_0x3eb630];return _0x1b840d;};'use strict';var multer=require('multer');var util=require(_0x3a72('0x0'));var path=require(_0x3a72('0x1'));var timeout=require(_0x3a72('0x2'));var express=require('express');var router=express[_0x3a72('0x3')]();var fs_extra=require(_0x3a72('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3a72('0x5'));var config=require(_0x3a72('0x6'));var controller=require('./analyticDefaultReport.controller');router[_0x3a72('0x7')]('/',auth[_0x3a72('0x8')](),controller[_0x3a72('0x9')]);router[_0x3a72('0x7')](_0x3a72('0xa'),auth[_0x3a72('0x8')](),controller['show']);router[_0x3a72('0x7')](_0x3a72('0xb'),auth['isAuthenticated'](),controller[_0x3a72('0xc')]);router[_0x3a72('0x7')](_0x3a72('0xd'),auth['isAuthenticated'](),controller[_0x3a72('0xe')]);router[_0x3a72('0x7')](_0x3a72('0xf'),auth[_0x3a72('0x8')](),controller[_0x3a72('0x10')]);router[_0x3a72('0x11')]('/',auth[_0x3a72('0x8')](),controller[_0x3a72('0x12')]);router[_0x3a72('0x13')](_0x3a72('0xa'),auth[_0x3a72('0x8')](),controller[_0x3a72('0x14')]);router[_0x3a72('0x15')](_0x3a72('0xa'),auth[_0x3a72('0x8')](),controller[_0x3a72('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index ff1c3a0..d78a337 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 _0xefb5=['csv','DATE','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','xlsx'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xefb5,0x15b));var _0x5efb=function(_0x54de5d,_0x1f8b26){_0x54de5d=_0x54de5d-0x0;var _0x1b349e=_0xefb5[_0x54de5d];return _0x1b349e;};'use strict';var Sequelize=require(_0x5efb('0x0'));var moment=require(_0x5efb('0x1'));module['exports']={'name':{'type':Sequelize[_0x5efb('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x5efb('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x5efb('0x3')]('csv','pdf',_0x5efb('0x4')),'allowNull':![],'defaultValue':_0x5efb('0x5')},'savename':{'type':Sequelize[_0x5efb('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x5efb('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x5efb('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x5efb('0x3')](_0x5efb('0x7'),_0x5efb('0x8')),'allowNull':![],'defaultValue':_0x5efb('0x7')},'reportId':{'type':Sequelize[_0x5efb('0x9')](0xb)[_0x5efb('0xa')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x7d2a=['sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','INTEGER','UNSIGNED'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7d2a,0x14a));var _0xa7d2=function(_0x4e49d2,_0x12a180){_0x4e49d2=_0x4e49d2-0x0;var _0x39ce1d=_0x7d2a[_0x4e49d2];return _0x39ce1d;};'use strict';var Sequelize=require(_0xa7d2('0x0'));var moment=require(_0xa7d2('0x1'));module[_0xa7d2('0x2')]={'name':{'type':Sequelize[_0xa7d2('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xa7d2('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xa7d2('0x4')](_0xa7d2('0x5'),_0xa7d2('0x6'),_0xa7d2('0x7')),'allowNull':![],'defaultValue':_0xa7d2('0x5')},'savename':{'type':Sequelize[_0xa7d2('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xa7d2('0x8')]},'endDate':{'type':Sequelize[_0xa7d2('0x8')]},'status':{'type':Sequelize[_0xa7d2('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xa7d2('0x4')]('manual','scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xa7d2('0x9')](0xb)[_0xa7d2('0xa')]},'reportType':{'type':Sequelize[_0xa7d2('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index dae5384..865fb53 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 _0x0ea6=['Report\x20not\x20found\x20or\x20empty','exists','download','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','ExtractedReports','UserProfileResource','then','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','rows','show','params','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','output','existsSync','root','server/files/reports','Sequelize','ValidationError'];(function(_0x183256,_0x1a596d){var _0x5394a2=function(_0x192025){while(--_0x192025){_0x183256['push'](_0x183256['shift']());}};_0x5394a2(++_0x1a596d);}(_0x0ea6,0x190));var _0x60ea=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x0ea6[_0x1abb09];return _0xea1c07;};'use strict';var emlformat=require(_0x60ea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x60ea('0x1'));var jsonpatch=require(_0x60ea('0x2'));var rp=require(_0x60ea('0x3'));var moment=require(_0x60ea('0x4'));var BPromise=require(_0x60ea('0x5'));var Mustache=require(_0x60ea('0x6'));var util=require(_0x60ea('0x7'));var path=require('path');var sox=require(_0x60ea('0x8'));var csv=require('to-csv');var ejs=require(_0x60ea('0x9'));var fs=require('fs');var fs_extra=require(_0x60ea('0xa'));var _=require(_0x60ea('0xb'));var squel=require(_0x60ea('0xc'));var crypto=require('crypto');var jsforce=require(_0x60ea('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x60ea('0xe'));var querystring=require('querystring');var Papa=require(_0x60ea('0xf'));var Redis=require(_0x60ea('0x10'));var authService=require(_0x60ea('0x11'));var qs=require(_0x60ea('0x12'));var as=require(_0x60ea('0x13'));var hardwareService=require(_0x60ea('0x14'));var logger=require('../../config/logger')(_0x60ea('0x15'));var utils=require(_0x60ea('0x16'));var config=require(_0x60ea('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x60ea('0x18'))['db'];function respondWithStatusCode(_0x4c2b58,_0x384723){_0x384723=_0x384723||0xcc;return function(_0x8a6c81){if(_0x8a6c81){return _0x4c2b58[_0x60ea('0x19')](_0x384723);}return _0x4c2b58['status'](_0x384723)[_0x60ea('0x1a')]();};}function respondWithResult(_0x3c3c7d,_0x407d73){_0x407d73=_0x407d73||0xc8;return function(_0x57366b){if(_0x57366b){return _0x3c3c7d[_0x60ea('0x1b')](_0x407d73)['json'](_0x57366b);}};}function respondWithFilteredResult(_0x3332c0,_0x4fab2f){return function(_0x15722f){if(_0x15722f){var _0x29f0b0=typeof _0x4fab2f['offset']==='undefined'&&typeof _0x4fab2f[_0x60ea('0x1c')]===_0x60ea('0x1d');var _0x2897e6=_0x15722f[_0x60ea('0x1e')];var _0x56713e=_0x29f0b0?0x0:_0x4fab2f['offset'];var _0x491731=_0x29f0b0?_0x15722f[_0x60ea('0x1e')]:_0x4fab2f[_0x60ea('0x1f')]+_0x4fab2f['limit'];var _0x379e8c;if(_0x491731>=_0x2897e6){_0x491731=_0x2897e6;_0x379e8c=0xc8;}else{_0x379e8c=0xce;}_0x3332c0[_0x60ea('0x1b')](_0x379e8c);return _0x3332c0[_0x60ea('0x20')](_0x60ea('0x21'),_0x56713e+'-'+_0x491731+'/'+_0x2897e6)['json'](_0x15722f);}return null;};}function patchUpdates(_0x4da468){return function(_0x315741){try{jsonpatch[_0x60ea('0x22')](_0x315741,_0x4da468,!![]);}catch(_0x40d542){return BPromise[_0x60ea('0x23')](_0x40d542);}return _0x315741[_0x60ea('0x24')]();};}function saveUpdates(_0x526f38,_0xea8c46){return function(_0x2bcfc7){if(_0x2bcfc7){return _0x2bcfc7[_0x60ea('0x25')](_0x526f38)['then'](function(_0x2f4d5d){return _0x2f4d5d;});}return null;};}function removeEntity(_0x1ea00d,_0x2569b7){return function(_0x5dc8e2){if(_0x5dc8e2){return _0x5dc8e2[_0x60ea('0x26')]()['then'](function(){var _0x45f663=_0x5dc8e2[_0x60ea('0x27')]({'plain':!![]});var _0x221417=_0x60ea('0x28');return db[_0x60ea('0x29')]['destroy']({'where':{'type':_0x221417,'resourceId':_0x45f663['id']}})[_0x60ea('0x2a')](function(){return _0x5dc8e2;});})['then'](function(){_0x1ea00d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1163ec,_0x3d3e74){return function(_0x1223ec){if(!_0x1223ec){_0x1163ec['sendStatus'](0x194);}return _0x1223ec;};}function handleError(_0x58e599,_0xebc5d){_0xebc5d=_0xebc5d||0x1f4;return function(_0x5295a2){logger['error'](_0x5295a2[_0x60ea('0x2b')]);if(_0x5295a2[_0x60ea('0x2c')]){delete _0x5295a2['name'];}_0x58e599[_0x60ea('0x1b')](_0xebc5d)[_0x60ea('0x2d')](_0x5295a2);};}exports['index']=function(_0x3175ce,_0x2060b0){var _0x215fc2={},_0x19b368={},_0x49b3b9={'count':0x0,'rows':[]};var _0x4b98da=_[_0x60ea('0x2e')](db['AnalyticExtractedReport'][_0x60ea('0x2f')],function(_0x2e4c7f){return{'name':_0x2e4c7f[_0x60ea('0x30')],'type':_0x2e4c7f[_0x60ea('0x31')][_0x60ea('0x32')]};});_0x19b368[_0x60ea('0x33')]=_[_0x60ea('0x2e')](_0x4b98da,_0x60ea('0x2c'));_0x19b368[_0x60ea('0x34')]=_[_0x60ea('0x35')](_0x3175ce[_0x60ea('0x34')]);_0x19b368[_0x60ea('0x36')]=_[_0x60ea('0x37')](_0x19b368[_0x60ea('0x33')],_0x19b368['query']);_0x215fc2[_0x60ea('0x38')]=_[_0x60ea('0x37')](_0x19b368[_0x60ea('0x33')],qs[_0x60ea('0x39')](_0x3175ce['query'][_0x60ea('0x39')]));_0x215fc2[_0x60ea('0x38')]=_0x215fc2[_0x60ea('0x38')][_0x60ea('0x3a')]?_0x215fc2[_0x60ea('0x38')]:_0x19b368[_0x60ea('0x33')];if(!_0x3175ce[_0x60ea('0x34')][_0x60ea('0x3b')](_0x60ea('0x3c'))){_0x215fc2[_0x60ea('0x1c')]=qs[_0x60ea('0x1c')](_0x3175ce[_0x60ea('0x34')]['limit']);_0x215fc2[_0x60ea('0x1f')]=qs[_0x60ea('0x1f')](_0x3175ce[_0x60ea('0x34')][_0x60ea('0x1f')]);}_0x215fc2[_0x60ea('0x3d')]=qs[_0x60ea('0x3e')](_0x3175ce[_0x60ea('0x34')]['sort']);_0x215fc2['where']=qs[_0x60ea('0x36')](_[_0x60ea('0x3f')](_0x3175ce[_0x60ea('0x34')],_0x19b368[_0x60ea('0x36')]),_0x4b98da);if(_0x3175ce[_0x60ea('0x34')][_0x60ea('0x40')]){_0x215fc2[_0x60ea('0x41')]=_[_0x60ea('0x42')](_0x215fc2['where'],{'$or':_['map'](_0x4b98da,function(_0x4ac5e){if(_0x4ac5e[_0x60ea('0x31')]!==_0x60ea('0x43')){var _0xaddb0c={};_0xaddb0c[_0x4ac5e[_0x60ea('0x2c')]]={'$like':'%'+_0x3175ce[_0x60ea('0x34')][_0x60ea('0x40')]+'%'};return _0xaddb0c;}})});}_0x215fc2=_[_0x60ea('0x42')]({},_0x215fc2,_0x3175ce[_0x60ea('0x44')]);var _0x503ec2={'where':_0x215fc2[_0x60ea('0x41')]};return db[_0x60ea('0x45')]['count'](_0x503ec2)[_0x60ea('0x2a')](function(_0x1e21f2){_0x49b3b9['count']=_0x1e21f2;if(_0x3175ce[_0x60ea('0x34')][_0x60ea('0x46')]){_0x215fc2['include']=[{'all':!![]}];}return db[_0x60ea('0x45')]['findAll'](_0x215fc2);})[_0x60ea('0x2a')](function(_0x1b8ea4){_0x49b3b9[_0x60ea('0x47')]=_0x1b8ea4;return _0x49b3b9;})['then'](respondWithFilteredResult(_0x2060b0,_0x215fc2))['catch'](handleError(_0x2060b0,null));};exports[_0x60ea('0x48')]=function(_0x731c84,_0x35f82b){var _0x63dfa3={'raw':!![],'where':{'id':_0x731c84[_0x60ea('0x49')]['id']}},_0x17f9bf={};_0x17f9bf[_0x60ea('0x33')]=_[_0x60ea('0x35')](db[_0x60ea('0x45')][_0x60ea('0x2f')]);_0x17f9bf['query']=_[_0x60ea('0x35')](_0x731c84['query']);_0x17f9bf[_0x60ea('0x36')]=_[_0x60ea('0x37')](_0x17f9bf['model'],_0x17f9bf[_0x60ea('0x34')]);_0x63dfa3['attributes']=_['intersection'](_0x17f9bf[_0x60ea('0x33')],qs['fields'](_0x731c84[_0x60ea('0x34')][_0x60ea('0x39')]));_0x63dfa3[_0x60ea('0x38')]=_0x63dfa3[_0x60ea('0x38')][_0x60ea('0x3a')]?_0x63dfa3[_0x60ea('0x38')]:_0x17f9bf[_0x60ea('0x33')];if(_0x731c84[_0x60ea('0x34')][_0x60ea('0x46')]){_0x63dfa3[_0x60ea('0x4a')]=[{'all':!![]}];}_0x63dfa3=_['merge']({},_0x63dfa3,_0x731c84[_0x60ea('0x44')]);return db[_0x60ea('0x45')]['find'](_0x63dfa3)[_0x60ea('0x2a')](handleEntityNotFound(_0x35f82b,null))[_0x60ea('0x2a')](respondWithResult(_0x35f82b,null))[_0x60ea('0x4b')](handleError(_0x35f82b,null));};exports[_0x60ea('0x4c')]=function(_0x3d29ef,_0x18fa8a){return db[_0x60ea('0x45')][_0x60ea('0x4c')](_0x3d29ef[_0x60ea('0x4d')],{})[_0x60ea('0x2a')](function(_0x308582){var _0xa16539=_0x3d29ef[_0x60ea('0x4e')][_0x60ea('0x27')]({'plain':!![]});if(!_0xa16539)throw new Error(_0x60ea('0x4f'));if(_0xa16539[_0x60ea('0x50')]==='user'){var _0x3086a8=_0x308582['get']({'plain':!![]});var _0x9d84cf=_0x60ea('0x28');return db[_0x60ea('0x51')][_0x60ea('0x52')]({'where':{'name':_0x9d84cf,'userProfileId':_0xa16539[_0x60ea('0x53')]},'raw':!![]})['then'](function(_0x1bdea3){if(_0x1bdea3&&_0x1bdea3[_0x60ea('0x54')]===0x0){return db[_0x60ea('0x29')]['create']({'name':_0x3086a8[_0x60ea('0x2c')],'resourceId':_0x3086a8['id'],'type':_0x1bdea3['name'],'sectionId':_0x1bdea3['id']},{})[_0x60ea('0x2a')](function(){return _0x308582;});}else{return _0x308582;}})[_0x60ea('0x4b')](function(_0x966ee0){logger[_0x60ea('0x55')](_0x60ea('0x56'),_0x966ee0);throw _0x966ee0;});}return _0x308582;})[_0x60ea('0x2a')](respondWithResult(_0x18fa8a,0xc9))[_0x60ea('0x4b')](handleError(_0x18fa8a,null));};exports[_0x60ea('0x25')]=function(_0xc196bc,_0xba1b66){if(_0xc196bc[_0x60ea('0x4d')]['id']){delete _0xc196bc[_0x60ea('0x4d')]['id'];}return db[_0x60ea('0x45')][_0x60ea('0x52')]({'where':{'id':_0xc196bc[_0x60ea('0x49')]['id']}})[_0x60ea('0x2a')](handleEntityNotFound(_0xba1b66,null))[_0x60ea('0x2a')](saveUpdates(_0xc196bc[_0x60ea('0x4d')],null))[_0x60ea('0x2a')](respondWithResult(_0xba1b66,null))[_0x60ea('0x4b')](handleError(_0xba1b66,null));};exports[_0x60ea('0x26')]=function(_0x303afe,_0xe3f4d){return db['AnalyticExtractedReport'][_0x60ea('0x52')]({'where':{'id':_0x303afe['params']['id']}})[_0x60ea('0x2a')](handleEntityNotFound(_0xe3f4d,null))['then'](removeEntity(_0xe3f4d,null))[_0x60ea('0x4b')](handleError(_0xe3f4d,null));};exports['download']=function(_0x4ad591,_0x17963f,_0x1dc049){return db[_0x60ea('0x45')][_0x60ea('0x52')]({'where':{'id':_0x4ad591['params']['id']},'attributes':[_0x60ea('0x2c'),_0x60ea('0x57'),_0x60ea('0x58'),_0x60ea('0x59')],'raw':!![]})['then'](handleEntityNotFound(_0x17963f,null))[_0x60ea('0x2a')](function(_0x2c34b8){if(_0x2c34b8){if(!fs[_0x60ea('0x5a')](path['join'](config[_0x60ea('0x5b')],_0x60ea('0x5c'),_0x2c34b8['savename']))){throw new db[(_0x60ea('0x5d'))][(_0x60ea('0x5e'))](_0x60ea('0x5f'));}if(_0x4ad591[_0x60ea('0x34')][_0x60ea('0x60')]){return _0x17963f[_0x60ea('0x19')](0xc8);}return _0x17963f[_0x60ea('0x61')](path['join'](config[_0x60ea('0x5b')],_0x60ea('0x5c'),_0x2c34b8[_0x60ea('0x58')]),util['format']('%s.%s',_0x2c34b8['basename']||_0x2c34b8[_0x60ea('0x2c')],_0x2c34b8[_0x60ea('0x59')][_0x60ea('0x62')]()));}})['catch'](handleError(_0x17963f,null));};
\ No newline at end of file
+var _0xbb9c=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','catch','show','params','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','savename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','root','format','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash'];(function(_0x3e3bee,_0x4f91fe){var _0x3ae14c=function(_0x3861a0){while(--_0x3861a0){_0x3e3bee['push'](_0x3e3bee['shift']());}};_0x3ae14c(++_0x4f91fe);}(_0xbb9c,0xb6));var _0xcbb9=function(_0x4d674b,_0x176474){_0x4d674b=_0x4d674b-0x0;var _0x535a1f=_0xbb9c[_0x4d674b];return _0x535a1f;};'use strict';var emlformat=require(_0xcbb9('0x0'));var rimraf=require(_0xcbb9('0x1'));var zipdir=require(_0xcbb9('0x2'));var jsonpatch=require(_0xcbb9('0x3'));var rp=require(_0xcbb9('0x4'));var moment=require('moment');var BPromise=require(_0xcbb9('0x5'));var Mustache=require(_0xcbb9('0x6'));var util=require(_0xcbb9('0x7'));var path=require(_0xcbb9('0x8'));var sox=require('sox');var csv=require(_0xcbb9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcbb9('0xa'));var _=require(_0xcbb9('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcbb9('0xc'));var deskjs=require(_0xcbb9('0xd'));var toCsv=require(_0xcbb9('0x9'));var querystring=require(_0xcbb9('0xe'));var Papa=require(_0xcbb9('0xf'));var Redis=require('ioredis');var authService=require(_0xcbb9('0x10'));var qs=require(_0xcbb9('0x11'));var as=require(_0xcbb9('0x12'));var hardwareService=require(_0xcbb9('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xcbb9('0x14'));var config=require(_0xcbb9('0x15'));var licenseUtil=require(_0xcbb9('0x16'));var db=require(_0xcbb9('0x17'))['db'];function respondWithStatusCode(_0x30608f,_0xe5c0bd){_0xe5c0bd=_0xe5c0bd||0xcc;return function(_0x5bde44){if(_0x5bde44){return _0x30608f[_0xcbb9('0x18')](_0xe5c0bd);}return _0x30608f[_0xcbb9('0x19')](_0xe5c0bd)[_0xcbb9('0x1a')]();};}function respondWithResult(_0x365c34,_0x55eeb7){_0x55eeb7=_0x55eeb7||0xc8;return function(_0x5cc06a){if(_0x5cc06a){return _0x365c34[_0xcbb9('0x19')](_0x55eeb7)[_0xcbb9('0x1b')](_0x5cc06a);}};}function respondWithFilteredResult(_0x16e25c,_0x1ab7d4){return function(_0x48884c){if(_0x48884c){var _0x2ccd2a=typeof _0x1ab7d4[_0xcbb9('0x1c')]===_0xcbb9('0x1d')&&typeof _0x1ab7d4[_0xcbb9('0x1e')]===_0xcbb9('0x1d');var _0x51fdb6=_0x48884c[_0xcbb9('0x1f')];var _0x52c959=_0x2ccd2a?0x0:_0x1ab7d4[_0xcbb9('0x1c')];var _0x52e2f4=_0x2ccd2a?_0x48884c[_0xcbb9('0x1f')]:_0x1ab7d4[_0xcbb9('0x1c')]+_0x1ab7d4[_0xcbb9('0x1e')];var _0x45c7e9;if(_0x52e2f4>=_0x51fdb6){_0x52e2f4=_0x51fdb6;_0x45c7e9=0xc8;}else{_0x45c7e9=0xce;}_0x16e25c[_0xcbb9('0x19')](_0x45c7e9);return _0x16e25c[_0xcbb9('0x20')](_0xcbb9('0x21'),_0x52c959+'-'+_0x52e2f4+'/'+_0x51fdb6)[_0xcbb9('0x1b')](_0x48884c);}return null;};}function patchUpdates(_0x3d6a25){return function(_0x5c36e0){try{jsonpatch['apply'](_0x5c36e0,_0x3d6a25,!![]);}catch(_0xdc6fe2){return BPromise[_0xcbb9('0x22')](_0xdc6fe2);}return _0x5c36e0[_0xcbb9('0x23')]();};}function saveUpdates(_0x5d2f20,_0x5745a5){return function(_0x3d6c86){if(_0x3d6c86){return _0x3d6c86['update'](_0x5d2f20)[_0xcbb9('0x24')](function(_0x193700){return _0x193700;});}return null;};}function removeEntity(_0x44f615,_0x3323c4){return function(_0x305243){if(_0x305243){return _0x305243[_0xcbb9('0x25')]()[_0xcbb9('0x24')](function(){var _0x1ecc8e=_0x305243[_0xcbb9('0x26')]({'plain':!![]});var _0x48caaa=_0xcbb9('0x27');return db[_0xcbb9('0x28')]['destroy']({'where':{'type':_0x48caaa,'resourceId':_0x1ecc8e['id']}})[_0xcbb9('0x24')](function(){return _0x305243;});})[_0xcbb9('0x24')](function(){_0x44f615[_0xcbb9('0x19')](0xcc)[_0xcbb9('0x1a')]();});}};}function handleEntityNotFound(_0x8444be,_0x5e621d){return function(_0x9aa480){if(!_0x9aa480){_0x8444be['sendStatus'](0x194);}return _0x9aa480;};}function handleError(_0x556e10,_0x5cdb2e){_0x5cdb2e=_0x5cdb2e||0x1f4;return function(_0x3ab270){logger[_0xcbb9('0x29')](_0x3ab270['stack']);if(_0x3ab270[_0xcbb9('0x2a')]){delete _0x3ab270[_0xcbb9('0x2a')];}_0x556e10[_0xcbb9('0x19')](_0x5cdb2e)[_0xcbb9('0x2b')](_0x3ab270);};}exports[_0xcbb9('0x2c')]=function(_0x3781dc,_0x999f43){var _0x400963={},_0x4accea={},_0x3e7f56={'count':0x0,'rows':[]};var _0x2de35c=_[_0xcbb9('0x2d')](db[_0xcbb9('0x2e')][_0xcbb9('0x2f')],function(_0x48465f){return{'name':_0x48465f['fieldName'],'type':_0x48465f['type'][_0xcbb9('0x30')]};});_0x4accea[_0xcbb9('0x31')]=_[_0xcbb9('0x2d')](_0x2de35c,_0xcbb9('0x2a'));_0x4accea[_0xcbb9('0x32')]=_[_0xcbb9('0x33')](_0x3781dc[_0xcbb9('0x32')]);_0x4accea[_0xcbb9('0x34')]=_[_0xcbb9('0x35')](_0x4accea['model'],_0x4accea[_0xcbb9('0x32')]);_0x400963[_0xcbb9('0x36')]=_[_0xcbb9('0x35')](_0x4accea['model'],qs[_0xcbb9('0x37')](_0x3781dc[_0xcbb9('0x32')][_0xcbb9('0x37')]));_0x400963['attributes']=_0x400963[_0xcbb9('0x36')]['length']?_0x400963[_0xcbb9('0x36')]:_0x4accea[_0xcbb9('0x31')];if(!_0x3781dc[_0xcbb9('0x32')][_0xcbb9('0x38')](_0xcbb9('0x39'))){_0x400963[_0xcbb9('0x1e')]=qs[_0xcbb9('0x1e')](_0x3781dc[_0xcbb9('0x32')][_0xcbb9('0x1e')]);_0x400963['offset']=qs['offset'](_0x3781dc[_0xcbb9('0x32')][_0xcbb9('0x1c')]);}_0x400963[_0xcbb9('0x3a')]=qs[_0xcbb9('0x3b')](_0x3781dc[_0xcbb9('0x32')][_0xcbb9('0x3b')]);_0x400963[_0xcbb9('0x3c')]=qs['filters'](_[_0xcbb9('0x3d')](_0x3781dc[_0xcbb9('0x32')],_0x4accea[_0xcbb9('0x34')]),_0x2de35c);if(_0x3781dc[_0xcbb9('0x32')]['filter']){_0x400963[_0xcbb9('0x3c')]=_[_0xcbb9('0x3e')](_0x400963[_0xcbb9('0x3c')],{'$or':_['map'](_0x2de35c,function(_0x251719){if(_0x251719['type']!==_0xcbb9('0x3f')){var _0x1b81dc={};_0x1b81dc[_0x251719['name']]={'$like':'%'+_0x3781dc[_0xcbb9('0x32')][_0xcbb9('0x40')]+'%'};return _0x1b81dc;}})});}_0x400963=_['merge']({},_0x400963,_0x3781dc[_0xcbb9('0x41')]);var _0x202505={'where':_0x400963[_0xcbb9('0x3c')]};return db[_0xcbb9('0x2e')][_0xcbb9('0x1f')](_0x202505)[_0xcbb9('0x24')](function(_0x21c965){_0x3e7f56['count']=_0x21c965;if(_0x3781dc['query']['includeAll']){_0x400963[_0xcbb9('0x42')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xcbb9('0x43')](_0x400963);})[_0xcbb9('0x24')](function(_0x2370ea){_0x3e7f56['rows']=_0x2370ea;return _0x3e7f56;})[_0xcbb9('0x24')](respondWithFilteredResult(_0x999f43,_0x400963))[_0xcbb9('0x44')](handleError(_0x999f43,null));};exports[_0xcbb9('0x45')]=function(_0xc51c2f,_0x4d2510){var _0x2107a1={'raw':!![],'where':{'id':_0xc51c2f[_0xcbb9('0x46')]['id']}},_0x403b19={};_0x403b19[_0xcbb9('0x31')]=_['keys'](db[_0xcbb9('0x2e')]['rawAttributes']);_0x403b19[_0xcbb9('0x32')]=_[_0xcbb9('0x33')](_0xc51c2f[_0xcbb9('0x32')]);_0x403b19[_0xcbb9('0x34')]=_['intersection'](_0x403b19[_0xcbb9('0x31')],_0x403b19['query']);_0x2107a1['attributes']=_[_0xcbb9('0x35')](_0x403b19[_0xcbb9('0x31')],qs[_0xcbb9('0x37')](_0xc51c2f[_0xcbb9('0x32')][_0xcbb9('0x37')]));_0x2107a1[_0xcbb9('0x36')]=_0x2107a1[_0xcbb9('0x36')]['length']?_0x2107a1[_0xcbb9('0x36')]:_0x403b19[_0xcbb9('0x31')];if(_0xc51c2f['query'][_0xcbb9('0x47')]){_0x2107a1[_0xcbb9('0x42')]=[{'all':!![]}];}_0x2107a1=_[_0xcbb9('0x3e')]({},_0x2107a1,_0xc51c2f[_0xcbb9('0x41')]);return db[_0xcbb9('0x2e')]['find'](_0x2107a1)['then'](handleEntityNotFound(_0x4d2510,null))[_0xcbb9('0x24')](respondWithResult(_0x4d2510,null))[_0xcbb9('0x44')](handleError(_0x4d2510,null));};exports[_0xcbb9('0x48')]=function(_0xc08f00,_0x5c7931){return db['AnalyticExtractedReport']['create'](_0xc08f00[_0xcbb9('0x49')],{})[_0xcbb9('0x24')](function(_0x4935b6){var _0xf74f40=_0xc08f00['user']['get']({'plain':!![]});if(!_0xf74f40)throw new Error(_0xcbb9('0x4a'));if(_0xf74f40['role']===_0xcbb9('0x4b')){var _0x36287a=_0x4935b6[_0xcbb9('0x26')]({'plain':!![]});var _0x558c44='ExtractedReports';return db[_0xcbb9('0x4c')][_0xcbb9('0x4d')]({'where':{'name':_0x558c44,'userProfileId':_0xf74f40[_0xcbb9('0x4e')]},'raw':!![]})['then'](function(_0x4b2b85){if(_0x4b2b85&&_0x4b2b85[_0xcbb9('0x4f')]===0x0){return db[_0xcbb9('0x28')][_0xcbb9('0x48')]({'name':_0x36287a['name'],'resourceId':_0x36287a['id'],'type':_0x4b2b85[_0xcbb9('0x2a')],'sectionId':_0x4b2b85['id']},{})[_0xcbb9('0x24')](function(){return _0x4935b6;});}else{return _0x4935b6;}})[_0xcbb9('0x44')](function(_0x23c5d8){logger['error'](_0xcbb9('0x50'),_0x23c5d8);throw _0x23c5d8;});}return _0x4935b6;})[_0xcbb9('0x24')](respondWithResult(_0x5c7931,0xc9))['catch'](handleError(_0x5c7931,null));};exports[_0xcbb9('0x51')]=function(_0x6741d8,_0x22a16f){if(_0x6741d8[_0xcbb9('0x49')]['id']){delete _0x6741d8[_0xcbb9('0x49')]['id'];}return db[_0xcbb9('0x2e')]['find']({'where':{'id':_0x6741d8[_0xcbb9('0x46')]['id']}})[_0xcbb9('0x24')](handleEntityNotFound(_0x22a16f,null))[_0xcbb9('0x24')](saveUpdates(_0x6741d8[_0xcbb9('0x49')],null))[_0xcbb9('0x24')](respondWithResult(_0x22a16f,null))[_0xcbb9('0x44')](handleError(_0x22a16f,null));};exports[_0xcbb9('0x25')]=function(_0x39e2b2,_0x42a5f7){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x39e2b2[_0xcbb9('0x46')]['id']}})[_0xcbb9('0x24')](handleEntityNotFound(_0x42a5f7,null))[_0xcbb9('0x24')](removeEntity(_0x42a5f7,null))[_0xcbb9('0x44')](handleError(_0x42a5f7,null));};exports['download']=function(_0x49e7b8,_0x3ee2d3,_0x1f4c1f){return db[_0xcbb9('0x2e')]['find']({'where':{'id':_0x49e7b8[_0xcbb9('0x46')]['id']},'attributes':[_0xcbb9('0x2a'),'basename',_0xcbb9('0x52'),_0xcbb9('0x53')],'raw':!![]})[_0xcbb9('0x24')](handleEntityNotFound(_0x3ee2d3,null))[_0xcbb9('0x24')](function(_0x29a1b7){if(_0x29a1b7){if(!fs[_0xcbb9('0x54')](path[_0xcbb9('0x55')](config['root'],_0xcbb9('0x56'),_0x29a1b7['savename']))){throw new db[(_0xcbb9('0x57'))][(_0xcbb9('0x58'))](_0xcbb9('0x59'));}if(_0x49e7b8[_0xcbb9('0x32')][_0xcbb9('0x5a')]){return _0x3ee2d3[_0xcbb9('0x18')](0xc8);}return _0x3ee2d3[_0xcbb9('0x5b')](path[_0xcbb9('0x55')](config[_0xcbb9('0x5c')],_0xcbb9('0x56'),_0x29a1b7[_0xcbb9('0x52')]),util[_0xcbb9('0x5d')](_0xcbb9('0x5e'),_0x29a1b7[_0xcbb9('0x5f')]||_0x29a1b7[_0xcbb9('0x2a')],_0x29a1b7[_0xcbb9('0x53')][_0xcbb9('0x60')]()));}})['catch'](handleError(_0x3ee2d3,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index fe2f297..e9dd322 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 _0x0dc4=['exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x417b30,_0x5832f5){var _0x5e9a51=function(_0x29ee4b){while(--_0x29ee4b){_0x417b30['push'](_0x417b30['shift']());}};_0x5e9a51(++_0x5832f5);}(_0x0dc4,0x1d0));var _0x40dc=function(_0x22ac5b,_0x2ef85c){_0x22ac5b=_0x22ac5b-0x0;var _0x4b5cc4=_0x0dc4[_0x22ac5b];return _0x4b5cc4;};'use strict';var _=require('lodash');var util=require(_0x40dc('0x0'));var logger=require(_0x40dc('0x1'))('api');var moment=require('moment');var BPromise=require(_0x40dc('0x2'));var rp=require(_0x40dc('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x40dc('0x4'));var config=require(_0x40dc('0x5'));var attributes=require('./analyticExtractedReport.attributes');module[_0x40dc('0x6')]=function(_0x563852,_0x58d58d){return _0x563852[_0x40dc('0x7')](_0x40dc('0x8'),attributes,{'tableName':_0x40dc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7274=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','AnalyticExtractedReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7274,0x136));var _0x4727=function(_0x3401ff,_0x465a74){_0x3401ff=_0x3401ff-0x0;var _0x2cb407=_0x7274[_0x3401ff];return _0x2cb407;};'use strict';var _=require(_0x4727('0x0'));var util=require(_0x4727('0x1'));var logger=require('../../config/logger')(_0x4727('0x2'));var moment=require(_0x4727('0x3'));var BPromise=require(_0x4727('0x4'));var rp=require(_0x4727('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4727('0x6'));var config=require(_0x4727('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0x4727('0x8')]=function(_0x549df7,_0x532af3){return _0x549df7['define'](_0x4727('0x9'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 6f5a2e0..ce2096c 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 _0xe39c=['../../config/utils','../../config/logger','rpc','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3a7614,_0x450eaa){var _0x37a549=function(_0x1151b1){while(--_0x1151b1){_0x3a7614['push'](_0x3a7614['shift']());}};_0x37a549(++_0x450eaa);}(_0xe39c,0x135));var _0xce39=function(_0x491768,_0x44a0e8){_0x491768=_0x491768-0x0;var _0x567b81=_0xe39c[_0x491768];return _0x567b81;};'use strict';var _=require(_0xce39('0x0'));var util=require(_0xce39('0x1'));var moment=require(_0xce39('0x2'));var BPromise=require(_0xce39('0x3'));var rs=require(_0xce39('0x4'));var fs=require('fs');var Redis=require(_0xce39('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xce39('0x6'));var logger=require(_0xce39('0x7'))(_0xce39('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xce39('0x9')][_0xce39('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x310117,_0x44045a,_0xf46620){return new BPromise(function(_0x4ff25b,_0x419b20){return client['request'](_0x310117,_0xf46620)[_0xce39('0xb')](function(_0x252a74){logger[_0xce39('0xc')](_0xce39('0xd'),_0x44045a,'request\x20sent');logger[_0xce39('0xe')](_0xce39('0xf'),_0x44045a,'request\x20sent',JSON['stringify'](_0x252a74));if(_0x252a74[_0xce39('0x10')]){if(_0x252a74['error'][_0xce39('0x11')]===0x1f4){logger[_0xce39('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x44045a,_0x252a74['error'][_0xce39('0x12')]);return _0x419b20(_0x252a74[_0xce39('0x10')][_0xce39('0x12')]);}logger[_0xce39('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x44045a,_0x252a74[_0xce39('0x10')][_0xce39('0x12')]);return _0x4ff25b(_0x252a74[_0xce39('0x10')][_0xce39('0x12')]);}else{logger['info'](_0xce39('0xd'),_0x44045a,_0xce39('0x13'));_0x4ff25b(_0x252a74['result'][_0xce39('0x12')]);}})[_0xce39('0x14')](function(_0x603eb9){logger[_0xce39('0x10')](_0xce39('0xd'),_0x44045a,_0x603eb9);_0x419b20(_0x603eb9);});});}
\ No newline at end of file
+var _0x5635=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','util','bluebird'];(function(_0x24dc8f,_0x14b7e8){var _0x189c9b=function(_0x25b498){while(--_0x25b498){_0x24dc8f['push'](_0x24dc8f['shift']());}};_0x189c9b(++_0x14b7e8);}(_0x5635,0xbb));var _0x5563=function(_0x144045,_0x3b68b1){_0x144045=_0x144045-0x0;var _0x12a942=_0x5635[_0x144045];return _0x12a942;};'use strict';var _=require('lodash');var util=require(_0x5563('0x0'));var moment=require('moment');var BPromise=require(_0x5563('0x1'));var rs=require(_0x5563('0x2'));var fs=require('fs');var Redis=require(_0x5563('0x3'));var db=require(_0x5563('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5563('0x5'))(_0x5563('0x6'));var config=require(_0x5563('0x7'));var jayson=require(_0x5563('0x8'));var client=jayson[_0x5563('0x9')][_0x5563('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x477c7b,_0x307f1a,_0x2dcf5b){return new BPromise(function(_0x36d77f,_0x479c2f){return client['request'](_0x477c7b,_0x2dcf5b)[_0x5563('0xb')](function(_0x89306f){logger[_0x5563('0xc')](_0x5563('0xd'),_0x307f1a,'request\x20sent');logger[_0x5563('0xe')](_0x5563('0xf'),_0x307f1a,'request\x20sent',JSON[_0x5563('0x10')](_0x89306f));if(_0x89306f[_0x5563('0x11')]){if(_0x89306f[_0x5563('0x11')][_0x5563('0x12')]===0x1f4){logger[_0x5563('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x307f1a,_0x89306f[_0x5563('0x11')][_0x5563('0x13')]);return _0x479c2f(_0x89306f['error'][_0x5563('0x13')]);}logger[_0x5563('0x11')](_0x5563('0xd'),_0x307f1a,_0x89306f[_0x5563('0x11')][_0x5563('0x13')]);return _0x36d77f(_0x89306f[_0x5563('0x11')][_0x5563('0x13')]);}else{logger[_0x5563('0xc')](_0x5563('0xd'),_0x307f1a,_0x5563('0x14'));_0x36d77f(_0x89306f['result'][_0x5563('0x13')]);}})['catch'](function(_0x211b09){logger[_0x5563('0x11')](_0x5563('0xd'),_0x307f1a,_0x211b09);_0x479c2f(_0x211b09);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 84e3fbc..2e540eb 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 _0x2d2b=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','isAuthenticated','get','/:id','post','create','put','update','delete','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d2b,0xa9));var _0xb2d2=function(_0x406efe,_0x5c17d5){_0x406efe=_0x406efe-0x0;var _0x1aa088=_0x2d2b[_0x406efe];return _0x1aa088;};'use strict';var multer=require(_0xb2d2('0x0'));var util=require(_0xb2d2('0x1'));var path=require(_0xb2d2('0x2'));var timeout=require(_0xb2d2('0x3'));var express=require(_0xb2d2('0x4'));var router=express[_0xb2d2('0x5')]();var fs_extra=require(_0xb2d2('0x6'));var auth=require(_0xb2d2('0x7'));var interaction=require(_0xb2d2('0x8'));var config=require('../../config/environment');var controller=require(_0xb2d2('0x9'));router['get']('/',auth[_0xb2d2('0xa')](),controller['index']);router[_0xb2d2('0xb')](_0xb2d2('0xc'),auth[_0xb2d2('0xa')](),controller['show']);router['get']('/:id/download',auth[_0xb2d2('0xa')](),controller['download']);router[_0xb2d2('0xd')]('/',auth[_0xb2d2('0xa')](),controller[_0xb2d2('0xe')]);router[_0xb2d2('0xf')](_0xb2d2('0xc'),auth[_0xb2d2('0xa')](),controller[_0xb2d2('0x10')]);router[_0xb2d2('0x11')]('/:id',auth[_0xb2d2('0xa')](),controller['destroy']);module[_0xb2d2('0x12')]=router;
\ No newline at end of file
+var _0x9f8b=['/:id/download','post','create','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment','./analyticExtractedReport.controller','get','/:id','isAuthenticated'];(function(_0x261cfc,_0x3fe3d3){var _0x5cb3eb=function(_0x3cb4f3){while(--_0x3cb4f3){_0x261cfc['push'](_0x261cfc['shift']());}};_0x5cb3eb(++_0x3fe3d3);}(_0x9f8b,0x106));var _0xb9f8=function(_0x109371,_0x441c8e){_0x109371=_0x109371-0x0;var _0x4fd858=_0x9f8b[_0x109371];return _0x4fd858;};'use strict';var multer=require(_0xb9f8('0x0'));var util=require(_0xb9f8('0x1'));var path=require('path');var timeout=require(_0xb9f8('0x2'));var express=require('express');var router=express[_0xb9f8('0x3')]();var fs_extra=require(_0xb9f8('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb9f8('0x5'));var controller=require(_0xb9f8('0x6'));router[_0xb9f8('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb9f8('0x8'),auth[_0xb9f8('0x9')](),controller['show']);router[_0xb9f8('0x7')](_0xb9f8('0xa'),auth['isAuthenticated'](),controller['download']);router[_0xb9f8('0xb')]('/',auth[_0xb9f8('0x9')](),controller[_0xb9f8('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb9f8('0xd')]);router[_0xb9f8('0xe')](_0xb9f8('0x8'),auth[_0xb9f8('0x9')](),controller['destroy']);module[_0xb9f8('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 7ffd35a..ca919dd 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 _0xbefd=['STRING','BOOLEAN','exports','TEXT'];(function(_0x25ecaf,_0x3e9fc1){var _0x41ae78=function(_0x22b6bf){while(--_0x22b6bf){_0x25ecaf['push'](_0x25ecaf['shift']());}};_0x41ae78(++_0x3e9fc1);}(_0xbefd,0x106));var _0xdbef=function(_0x333cd8,_0x47221b){_0x333cd8=_0x333cd8-0x0;var _0x1f0b96=_0xbefd[_0x333cd8];return _0x1f0b96;};'use strict';var Sequelize=require('sequelize');module[_0xdbef('0x0')]={'field':{'type':Sequelize[_0xdbef('0x1')]},'alias':{'type':Sequelize[_0xdbef('0x2')]},'function':{'type':Sequelize[_0xdbef('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xdbef('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xdbef('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x81a1=['sequelize','exports','STRING','BOOLEAN'];(function(_0x10071d,_0x4c5399){var _0x128675=function(_0x378827){while(--_0x378827){_0x10071d['push'](_0x10071d['shift']());}};_0x128675(++_0x4c5399);}(_0x81a1,0x110));var _0x181a=function(_0x56b3fe,_0x3f1224){_0x56b3fe=_0x56b3fe-0x0;var _0x998277=_0x81a1[_0x56b3fe];return _0x998277;};'use strict';var Sequelize=require(_0x181a('0x0'));module[_0x181a('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x181a('0x2')]},'function':{'type':Sequelize[_0x181a('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x181a('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x181a('0x2')]},'custom':{'type':Sequelize[_0x181a('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 49f5ab9..c8cd50c 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 _0x25c7=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x466e08,_0x5c4d83){var _0x417cbb=function(_0x89c0a4){while(--_0x89c0a4){_0x466e08['push'](_0x466e08['shift']());}};_0x417cbb(++_0x5c4d83);}(_0x25c7,0x99));var _0x725c=function(_0x5b84c4,_0xb7e5e8){_0x5b84c4=_0x5b84c4-0x0;var _0x37c25f=_0x25c7[_0x5b84c4];return _0x37c25f;};'use strict';var emlformat=require(_0x725c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x725c('0x1'));var jsonpatch=require(_0x725c('0x2'));var rp=require('request-promise');var moment=require(_0x725c('0x3'));var BPromise=require(_0x725c('0x4'));var Mustache=require(_0x725c('0x5'));var util=require(_0x725c('0x6'));var path=require(_0x725c('0x7'));var sox=require(_0x725c('0x8'));var csv=require(_0x725c('0x9'));var ejs=require(_0x725c('0xa'));var fs=require('fs');var fs_extra=require(_0x725c('0xb'));var _=require(_0x725c('0xc'));var squel=require('squel');var crypto=require(_0x725c('0xd'));var jsforce=require(_0x725c('0xe'));var deskjs=require(_0x725c('0xf'));var toCsv=require(_0x725c('0x9'));var querystring=require(_0x725c('0x10'));var Papa=require(_0x725c('0x11'));var Redis=require(_0x725c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x725c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x725c('0x14'));var logger=require(_0x725c('0x15'))(_0x725c('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x725c('0x17'))['db'];function respondWithStatusCode(_0x2f5d55,_0x53148b){_0x53148b=_0x53148b||0xcc;return function(_0x4308af){if(_0x4308af){return _0x2f5d55[_0x725c('0x18')](_0x53148b);}return _0x2f5d55[_0x725c('0x19')](_0x53148b)[_0x725c('0x1a')]();};}function respondWithResult(_0x42d864,_0x4b4d09){_0x4b4d09=_0x4b4d09||0xc8;return function(_0x1c99a9){if(_0x1c99a9){return _0x42d864['status'](_0x4b4d09)[_0x725c('0x1b')](_0x1c99a9);}};}function respondWithFilteredResult(_0x3a635a,_0x291212){return function(_0xad2875){if(_0xad2875){var _0x1b4a60=typeof _0x291212['offset']===_0x725c('0x1c')&&typeof _0x291212[_0x725c('0x1d')]===_0x725c('0x1c');var _0x2b32bc=_0xad2875[_0x725c('0x1e')];var _0x388f27=_0x1b4a60?0x0:_0x291212[_0x725c('0x1f')];var _0x170751=_0x1b4a60?_0xad2875[_0x725c('0x1e')]:_0x291212[_0x725c('0x1f')]+_0x291212[_0x725c('0x1d')];var _0x502ee0;if(_0x170751>=_0x2b32bc){_0x170751=_0x2b32bc;_0x502ee0=0xc8;}else{_0x502ee0=0xce;}_0x3a635a[_0x725c('0x19')](_0x502ee0);return _0x3a635a[_0x725c('0x20')](_0x725c('0x21'),_0x388f27+'-'+_0x170751+'/'+_0x2b32bc)[_0x725c('0x1b')](_0xad2875);}return null;};}function patchUpdates(_0x1c2383){return function(_0x43e257){try{jsonpatch['apply'](_0x43e257,_0x1c2383,!![]);}catch(_0x26329e){return BPromise[_0x725c('0x22')](_0x26329e);}return _0x43e257[_0x725c('0x23')]();};}function saveUpdates(_0xdb7fc2,_0xd8ddf8){return function(_0x4c76d5){if(_0x4c76d5){return _0x4c76d5[_0x725c('0x24')](_0xdb7fc2)['then'](function(_0x1c0a0e){return _0x1c0a0e;});}return null;};}function removeEntity(_0x2c0ae2,_0x1ba2fb){return function(_0x58e00c){if(_0x58e00c){return _0x58e00c[_0x725c('0x25')]()[_0x725c('0x26')](function(){_0x2c0ae2[_0x725c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29655f,_0x20c6b5){return function(_0xd6722c){if(!_0xd6722c){_0x29655f[_0x725c('0x18')](0x194);}return _0xd6722c;};}function handleError(_0x38ddf5,_0x5e43b6){_0x5e43b6=_0x5e43b6||0x1f4;return function(_0xce4f7d){logger[_0x725c('0x27')](_0xce4f7d['stack']);if(_0xce4f7d[_0x725c('0x28')]){delete _0xce4f7d[_0x725c('0x28')];}_0x38ddf5['status'](_0x5e43b6)[_0x725c('0x29')](_0xce4f7d);};}exports[_0x725c('0x2a')]=function(_0x2855c0,_0x41b4ff){var _0x45035d={},_0x2a70b2={},_0x1634ee={'count':0x0,'rows':[]};var _0x4e1ad0=_[_0x725c('0x2b')](db[_0x725c('0x2c')][_0x725c('0x2d')],function(_0x4c494d){return{'name':_0x4c494d[_0x725c('0x2e')],'type':_0x4c494d[_0x725c('0x2f')][_0x725c('0x30')]};});_0x2a70b2[_0x725c('0x31')]=_[_0x725c('0x2b')](_0x4e1ad0,'name');_0x2a70b2[_0x725c('0x32')]=_[_0x725c('0x33')](_0x2855c0['query']);_0x2a70b2['filters']=_[_0x725c('0x34')](_0x2a70b2[_0x725c('0x31')],_0x2a70b2[_0x725c('0x32')]);_0x45035d[_0x725c('0x35')]=_[_0x725c('0x34')](_0x2a70b2['model'],qs[_0x725c('0x36')](_0x2855c0[_0x725c('0x32')][_0x725c('0x36')]));_0x45035d[_0x725c('0x35')]=_0x45035d[_0x725c('0x35')][_0x725c('0x37')]?_0x45035d['attributes']:_0x2a70b2['model'];if(!_0x2855c0[_0x725c('0x32')][_0x725c('0x38')]('nolimit')){_0x45035d['limit']=qs[_0x725c('0x1d')](_0x2855c0['query'][_0x725c('0x1d')]);_0x45035d['offset']=qs['offset'](_0x2855c0['query']['offset']);}_0x45035d[_0x725c('0x39')]=qs[_0x725c('0x3a')](_0x2855c0['query']['sort']);_0x45035d[_0x725c('0x3b')]=qs['filters'](_[_0x725c('0x3c')](_0x2855c0[_0x725c('0x32')],_0x2a70b2[_0x725c('0x3d')]),_0x4e1ad0);if(_0x2855c0[_0x725c('0x32')][_0x725c('0x3e')]){_0x45035d[_0x725c('0x3b')]=_[_0x725c('0x3f')](_0x45035d[_0x725c('0x3b')],{'$or':_[_0x725c('0x2b')](_0x4e1ad0,function(_0x159eaa){if(_0x159eaa[_0x725c('0x2f')]!==_0x725c('0x40')){var _0x36e5ed={};_0x36e5ed[_0x159eaa['name']]={'$like':'%'+_0x2855c0[_0x725c('0x32')]['filter']+'%'};return _0x36e5ed;}})});}_0x45035d=_[_0x725c('0x3f')]({},_0x45035d,_0x2855c0['options']);var _0x4ecb26={'where':_0x45035d['where']};return db[_0x725c('0x2c')][_0x725c('0x1e')](_0x4ecb26)[_0x725c('0x26')](function(_0x202f32){_0x1634ee['count']=_0x202f32;if(_0x2855c0[_0x725c('0x32')][_0x725c('0x41')]){_0x45035d[_0x725c('0x42')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x725c('0x43')](_0x45035d);})[_0x725c('0x26')](function(_0x45838e){_0x1634ee[_0x725c('0x44')]=_0x45838e;return _0x1634ee;})[_0x725c('0x26')](respondWithFilteredResult(_0x41b4ff,_0x45035d))['catch'](handleError(_0x41b4ff,null));};exports[_0x725c('0x45')]=function(_0x4abcb2,_0x472f49){var _0x244279={'raw':![],'where':{'id':_0x4abcb2[_0x725c('0x46')]['id']}},_0x4673f8={};_0x4673f8[_0x725c('0x31')]=_[_0x725c('0x33')](db['AnalyticFieldReport'][_0x725c('0x2d')]);_0x4673f8[_0x725c('0x32')]=_[_0x725c('0x33')](_0x4abcb2[_0x725c('0x32')]);_0x4673f8[_0x725c('0x3d')]=_[_0x725c('0x34')](_0x4673f8[_0x725c('0x31')],_0x4673f8[_0x725c('0x32')]);_0x244279[_0x725c('0x35')]=_[_0x725c('0x34')](_0x4673f8[_0x725c('0x31')],qs['fields'](_0x4abcb2[_0x725c('0x32')][_0x725c('0x36')]));_0x244279[_0x725c('0x35')]=_0x244279['attributes']['length']?_0x244279[_0x725c('0x35')]:_0x4673f8[_0x725c('0x31')];if(_0x4abcb2['query'][_0x725c('0x41')]){_0x244279['include']=[{'all':!![]}];}_0x244279=_[_0x725c('0x3f')]({},_0x244279,_0x4abcb2[_0x725c('0x47')]);return db['AnalyticFieldReport'][_0x725c('0x48')](_0x244279)[_0x725c('0x26')](handleEntityNotFound(_0x472f49,null))[_0x725c('0x26')](respondWithResult(_0x472f49,null))[_0x725c('0x49')](handleError(_0x472f49,null));};exports['create']=function(_0x3e2d47,_0x43307e){return db[_0x725c('0x2c')][_0x725c('0x4a')](_0x3e2d47[_0x725c('0x4b')],{})['then'](respondWithResult(_0x43307e,0xc9))[_0x725c('0x49')](handleError(_0x43307e,null));};exports[_0x725c('0x4c')]=function(_0x5a8aec,_0x578917){return db[_0x725c('0x2c')]['bulkCreate'](_0x5a8aec['body'],{'raw':![],'individualHooks':!![]})[_0x725c('0x26')](respondWithResult(_0x578917,0xc9))['catch'](handleError(_0x578917,null));};exports[_0x725c('0x24')]=function(_0x3fe07f,_0x150013){if(_0x3fe07f[_0x725c('0x4b')]['id']){delete _0x3fe07f['body']['id'];}return db[_0x725c('0x2c')][_0x725c('0x48')]({'where':{'id':_0x3fe07f['params']['id']}})[_0x725c('0x26')](handleEntityNotFound(_0x150013,null))[_0x725c('0x26')](saveUpdates(_0x3fe07f[_0x725c('0x4b')],null))[_0x725c('0x26')](respondWithResult(_0x150013,null))[_0x725c('0x49')](handleError(_0x150013,null));};exports[_0x725c('0x25')]=function(_0x3a58fb,_0x33d431){return db[_0x725c('0x2c')][_0x725c('0x48')]({'where':{'id':_0x3a58fb[_0x725c('0x46')]['id']}})['then'](handleEntityNotFound(_0x33d431,null))['then'](removeEntity(_0x33d431,null))[_0x725c('0x49')](handleError(_0x33d431,null));};exports[_0x725c('0x4d')]=function(_0x2232b1,_0x146bf5){return db[_0x725c('0x2c')][_0x725c('0x25')]({'where':{'id':_0x2232b1[_0x725c('0x32')][_0x725c('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x725c('0x26')](respondWithResult(_0x146bf5,0xcc))['catch'](handleError(_0x146bf5,null));};exports[_0x725c('0x4f')]=function(_0xf655e6,_0x28b29b,_0x4002b9){return db[_0x725c('0x50')][_0x725c('0x51')]({'where':{'id':_0xf655e6['params']['id']}})[_0x725c('0x26')](handleEntityNotFound(_0x28b29b,null))[_0x725c('0x26')](function(_0x491823){if(_0x491823){return db[_0x725c('0x52')]['transaction'](function(_0x59bd69){return db['AnalyticFieldReport'][_0x725c('0x25')]({'where':{'CustomReportId':_0xf655e6[_0x725c('0x46')]['id']},'transaction':_0x59bd69})[_0x725c('0x26')](function(_0x442e39){var _0x53e38f=_[_0x725c('0x2b')](_0xf655e6['body'],function(_0x3e9811){delete _0x3e9811['id'];_0x3e9811[_0x725c('0x53')]=_0xf655e6['params']['id'];return _0x3e9811;});return db[_0x725c('0x2c')][_0x725c('0x4c')](_0x53e38f,{'transaction':_0x59bd69});});})[_0x725c('0x26')](function(){return db['AnalyticFieldReport'][_0x725c('0x43')]({'where':{'CustomReportId':_0xf655e6['params']['id']}});});}})[_0x725c('0x26')](respondWithResult(_0x28b29b,null))[_0x725c('0x49')](handleError(_0x28b29b,null));};
\ No newline at end of file
+var _0xb582=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','query','keys','intersection','model','attributes','length','order','sort','where','filters','pick','filter','type','merge','options','includeAll','include','findAll','rows','params','find','create','body','catch','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x5a6e3c,_0x28faa0){var _0x3bc48c=function(_0x5ccacf){while(--_0x5ccacf){_0x5a6e3c['push'](_0x5a6e3c['shift']());}};_0x3bc48c(++_0x28faa0);}(_0xb582,0xda));var _0x2b58=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xb582[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require(_0x2b58('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2b58('0x1'));var jsonpatch=require(_0x2b58('0x2'));var rp=require(_0x2b58('0x3'));var moment=require(_0x2b58('0x4'));var BPromise=require(_0x2b58('0x5'));var Mustache=require('mustache');var util=require(_0x2b58('0x6'));var path=require(_0x2b58('0x7'));var sox=require('sox');var csv=require(_0x2b58('0x8'));var ejs=require(_0x2b58('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b58('0xa'));var squel=require('squel');var crypto=require(_0x2b58('0xb'));var jsforce=require(_0x2b58('0xc'));var deskjs=require(_0x2b58('0xd'));var toCsv=require(_0x2b58('0x8'));var querystring=require(_0x2b58('0xe'));var Papa=require(_0x2b58('0xf'));var Redis=require(_0x2b58('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2b58('0x11'));var as=require(_0x2b58('0x12'));var hardwareService=require(_0x2b58('0x13'));var logger=require('../../config/logger')(_0x2b58('0x14'));var utils=require(_0x2b58('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2b58('0x16'));var db=require(_0x2b58('0x17'))['db'];function respondWithStatusCode(_0x435470,_0x522994){_0x522994=_0x522994||0xcc;return function(_0x1d6988){if(_0x1d6988){return _0x435470[_0x2b58('0x18')](_0x522994);}return _0x435470[_0x2b58('0x19')](_0x522994)[_0x2b58('0x1a')]();};}function respondWithResult(_0x124610,_0x1c9fa8){_0x1c9fa8=_0x1c9fa8||0xc8;return function(_0x410535){if(_0x410535){return _0x124610['status'](_0x1c9fa8)[_0x2b58('0x1b')](_0x410535);}};}function respondWithFilteredResult(_0x4993f7,_0x42b9cb){return function(_0x543cfa){if(_0x543cfa){var _0x2fda73=typeof _0x42b9cb[_0x2b58('0x1c')]==='undefined'&&typeof _0x42b9cb[_0x2b58('0x1d')]==='undefined';var _0x4ac18f=_0x543cfa[_0x2b58('0x1e')];var _0x5c9ea1=_0x2fda73?0x0:_0x42b9cb[_0x2b58('0x1c')];var _0x51cd21=_0x2fda73?_0x543cfa[_0x2b58('0x1e')]:_0x42b9cb[_0x2b58('0x1c')]+_0x42b9cb[_0x2b58('0x1d')];var _0x2a8d62;if(_0x51cd21>=_0x4ac18f){_0x51cd21=_0x4ac18f;_0x2a8d62=0xc8;}else{_0x2a8d62=0xce;}_0x4993f7[_0x2b58('0x19')](_0x2a8d62);return _0x4993f7[_0x2b58('0x1f')](_0x2b58('0x20'),_0x5c9ea1+'-'+_0x51cd21+'/'+_0x4ac18f)['json'](_0x543cfa);}return null;};}function patchUpdates(_0x3ced3a){return function(_0x4b1837){try{jsonpatch[_0x2b58('0x21')](_0x4b1837,_0x3ced3a,!![]);}catch(_0x3efee5){return BPromise[_0x2b58('0x22')](_0x3efee5);}return _0x4b1837[_0x2b58('0x23')]();};}function saveUpdates(_0x24af76,_0x17b8ae){return function(_0x3d87b0){if(_0x3d87b0){return _0x3d87b0[_0x2b58('0x24')](_0x24af76)[_0x2b58('0x25')](function(_0x297ecd){return _0x297ecd;});}return null;};}function removeEntity(_0x736a36,_0x50fdbd){return function(_0x5482f1){if(_0x5482f1){return _0x5482f1[_0x2b58('0x26')]()[_0x2b58('0x25')](function(){_0x736a36[_0x2b58('0x19')](0xcc)[_0x2b58('0x1a')]();});}};}function handleEntityNotFound(_0x56fca5,_0x4c11ab){return function(_0x294884){if(!_0x294884){_0x56fca5[_0x2b58('0x18')](0x194);}return _0x294884;};}function handleError(_0x496615,_0x54bf0b){_0x54bf0b=_0x54bf0b||0x1f4;return function(_0x1f1c18){logger[_0x2b58('0x27')](_0x1f1c18[_0x2b58('0x28')]);if(_0x1f1c18['name']){delete _0x1f1c18[_0x2b58('0x29')];}_0x496615[_0x2b58('0x19')](_0x54bf0b)[_0x2b58('0x2a')](_0x1f1c18);};}exports[_0x2b58('0x2b')]=function(_0xc0dceb,_0x1c6d3a){var _0x3728ae={},_0x168e65={},_0x1454d9={'count':0x0,'rows':[]};var _0x362069=_[_0x2b58('0x2c')](db[_0x2b58('0x2d')][_0x2b58('0x2e')],function(_0x577aa1){return{'name':_0x577aa1[_0x2b58('0x2f')],'type':_0x577aa1['type']['key']};});_0x168e65['model']=_['map'](_0x362069,'name');_0x168e65[_0x2b58('0x30')]=_[_0x2b58('0x31')](_0xc0dceb[_0x2b58('0x30')]);_0x168e65['filters']=_[_0x2b58('0x32')](_0x168e65[_0x2b58('0x33')],_0x168e65[_0x2b58('0x30')]);_0x3728ae[_0x2b58('0x34')]=_[_0x2b58('0x32')](_0x168e65[_0x2b58('0x33')],qs['fields'](_0xc0dceb[_0x2b58('0x30')]['fields']));_0x3728ae['attributes']=_0x3728ae[_0x2b58('0x34')][_0x2b58('0x35')]?_0x3728ae[_0x2b58('0x34')]:_0x168e65[_0x2b58('0x33')];if(!_0xc0dceb[_0x2b58('0x30')]['hasOwnProperty']('nolimit')){_0x3728ae[_0x2b58('0x1d')]=qs[_0x2b58('0x1d')](_0xc0dceb['query'][_0x2b58('0x1d')]);_0x3728ae['offset']=qs[_0x2b58('0x1c')](_0xc0dceb[_0x2b58('0x30')][_0x2b58('0x1c')]);}_0x3728ae[_0x2b58('0x36')]=qs[_0x2b58('0x37')](_0xc0dceb['query']['sort']);_0x3728ae[_0x2b58('0x38')]=qs[_0x2b58('0x39')](_[_0x2b58('0x3a')](_0xc0dceb['query'],_0x168e65[_0x2b58('0x39')]),_0x362069);if(_0xc0dceb[_0x2b58('0x30')][_0x2b58('0x3b')]){_0x3728ae[_0x2b58('0x38')]=_['merge'](_0x3728ae[_0x2b58('0x38')],{'$or':_[_0x2b58('0x2c')](_0x362069,function(_0x275aeb){if(_0x275aeb[_0x2b58('0x3c')]!=='VIRTUAL'){var _0x3d8f1c={};_0x3d8f1c[_0x275aeb[_0x2b58('0x29')]]={'$like':'%'+_0xc0dceb[_0x2b58('0x30')][_0x2b58('0x3b')]+'%'};return _0x3d8f1c;}})});}_0x3728ae=_[_0x2b58('0x3d')]({},_0x3728ae,_0xc0dceb[_0x2b58('0x3e')]);var _0x4afbc4={'where':_0x3728ae['where']};return db[_0x2b58('0x2d')][_0x2b58('0x1e')](_0x4afbc4)[_0x2b58('0x25')](function(_0x482fb1){_0x1454d9[_0x2b58('0x1e')]=_0x482fb1;if(_0xc0dceb[_0x2b58('0x30')][_0x2b58('0x3f')]){_0x3728ae[_0x2b58('0x40')]=[{'all':!![]}];}return db[_0x2b58('0x2d')][_0x2b58('0x41')](_0x3728ae);})['then'](function(_0x322f59){_0x1454d9[_0x2b58('0x42')]=_0x322f59;return _0x1454d9;})[_0x2b58('0x25')](respondWithFilteredResult(_0x1c6d3a,_0x3728ae))['catch'](handleError(_0x1c6d3a,null));};exports['show']=function(_0x3924d2,_0x183a3c){var _0x1bfc4f={'raw':![],'where':{'id':_0x3924d2[_0x2b58('0x43')]['id']}},_0x100efd={};_0x100efd['model']=_[_0x2b58('0x31')](db[_0x2b58('0x2d')][_0x2b58('0x2e')]);_0x100efd['query']=_['keys'](_0x3924d2[_0x2b58('0x30')]);_0x100efd['filters']=_[_0x2b58('0x32')](_0x100efd[_0x2b58('0x33')],_0x100efd[_0x2b58('0x30')]);_0x1bfc4f[_0x2b58('0x34')]=_[_0x2b58('0x32')](_0x100efd['model'],qs['fields'](_0x3924d2[_0x2b58('0x30')]['fields']));_0x1bfc4f[_0x2b58('0x34')]=_0x1bfc4f[_0x2b58('0x34')][_0x2b58('0x35')]?_0x1bfc4f['attributes']:_0x100efd['model'];if(_0x3924d2[_0x2b58('0x30')][_0x2b58('0x3f')]){_0x1bfc4f['include']=[{'all':!![]}];}_0x1bfc4f=_[_0x2b58('0x3d')]({},_0x1bfc4f,_0x3924d2[_0x2b58('0x3e')]);return db[_0x2b58('0x2d')][_0x2b58('0x44')](_0x1bfc4f)[_0x2b58('0x25')](handleEntityNotFound(_0x183a3c,null))[_0x2b58('0x25')](respondWithResult(_0x183a3c,null))['catch'](handleError(_0x183a3c,null));};exports[_0x2b58('0x45')]=function(_0x1b51b4,_0x5b4cd7){return db[_0x2b58('0x2d')][_0x2b58('0x45')](_0x1b51b4[_0x2b58('0x46')],{})['then'](respondWithResult(_0x5b4cd7,0xc9))[_0x2b58('0x47')](handleError(_0x5b4cd7,null));};exports[_0x2b58('0x48')]=function(_0x39cb74,_0x19e59e){return db[_0x2b58('0x2d')][_0x2b58('0x48')](_0x39cb74[_0x2b58('0x46')],{'raw':![],'individualHooks':!![]})[_0x2b58('0x25')](respondWithResult(_0x19e59e,0xc9))['catch'](handleError(_0x19e59e,null));};exports[_0x2b58('0x24')]=function(_0x42aadf,_0xb4862){if(_0x42aadf[_0x2b58('0x46')]['id']){delete _0x42aadf['body']['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x42aadf[_0x2b58('0x43')]['id']}})[_0x2b58('0x25')](handleEntityNotFound(_0xb4862,null))['then'](saveUpdates(_0x42aadf[_0x2b58('0x46')],null))[_0x2b58('0x25')](respondWithResult(_0xb4862,null))[_0x2b58('0x47')](handleError(_0xb4862,null));};exports[_0x2b58('0x26')]=function(_0x5afa77,_0x517663){return db[_0x2b58('0x2d')]['find']({'where':{'id':_0x5afa77[_0x2b58('0x43')]['id']}})[_0x2b58('0x25')](handleEntityNotFound(_0x517663,null))[_0x2b58('0x25')](removeEntity(_0x517663,null))[_0x2b58('0x47')](handleError(_0x517663,null));};exports['bulkDestroy']=function(_0x30442f,_0x5a4fa0){return db[_0x2b58('0x2d')][_0x2b58('0x26')]({'where':{'id':_0x30442f['query'][_0x2b58('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0x2b58('0x25')](respondWithResult(_0x5a4fa0,0xcc))[_0x2b58('0x47')](handleError(_0x5a4fa0,null));};exports[_0x2b58('0x4a')]=function(_0x3eb9ff,_0x166797,_0x143bc0){return db[_0x2b58('0x4b')][_0x2b58('0x4c')]({'where':{'id':_0x3eb9ff[_0x2b58('0x43')]['id']}})['then'](handleEntityNotFound(_0x166797,null))[_0x2b58('0x25')](function(_0x2f31df){if(_0x2f31df){return db['sequelize']['transaction'](function(_0x1b89a6){return db['AnalyticFieldReport'][_0x2b58('0x26')]({'where':{'CustomReportId':_0x3eb9ff[_0x2b58('0x43')]['id']},'transaction':_0x1b89a6})['then'](function(_0x5abb73){var _0x3b9209=_[_0x2b58('0x2c')](_0x3eb9ff[_0x2b58('0x46')],function(_0x10c692){delete _0x10c692['id'];_0x10c692[_0x2b58('0x4d')]=_0x3eb9ff[_0x2b58('0x43')]['id'];return _0x10c692;});return db[_0x2b58('0x2d')][_0x2b58('0x48')](_0x3b9209,{'transaction':_0x1b89a6});});})['then'](function(){return db[_0x2b58('0x2d')][_0x2b58('0x41')]({'where':{'CustomReportId':_0x3eb9ff[_0x2b58('0x43')]['id']}});});}})['then'](respondWithResult(_0x166797,null))[_0x2b58('0x47')](handleError(_0x166797,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 6a9bb23..2acec07 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 _0x6fad=['../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2acbba,_0x5cb60f){var _0x4010e9=function(_0x5ab1bf){while(--_0x5ab1bf){_0x2acbba['push'](_0x2acbba['shift']());}};_0x4010e9(++_0x5cb60f);}(_0x6fad,0x117));var _0xd6fa=function(_0x4e6842,_0x468c69){_0x4e6842=_0x4e6842-0x0;var _0x2015d0=_0x6fad[_0x4e6842];return _0x2015d0;};'use strict';var _=require('lodash');var util=require(_0xd6fa('0x0'));var logger=require(_0xd6fa('0x1'))(_0xd6fa('0x2'));var moment=require('moment');var BPromise=require(_0xd6fa('0x3'));var rp=require(_0xd6fa('0x4'));var fs=require('fs');var path=require(_0xd6fa('0x5'));var rimraf=require(_0xd6fa('0x6'));var config=require(_0xd6fa('0x7'));var attributes=require(_0xd6fa('0x8'));module[_0xd6fa('0x9')]=function(_0x2a6899,_0x2754d9){return _0x2a6899[_0xd6fa('0xa')](_0xd6fa('0xb'),attributes,{'tableName':_0xd6fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd33f=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','lodash'];(function(_0x47ab40,_0x110b58){var _0x1b0a50=function(_0x3f0d4b){while(--_0x3f0d4b){_0x47ab40['push'](_0x47ab40['shift']());}};_0x1b0a50(++_0x110b58);}(_0xd33f,0x197));var _0xfd33=function(_0x375b13,_0x56813b){_0x375b13=_0x375b13-0x0;var _0x114f8f=_0xd33f[_0x375b13];return _0x114f8f;};'use strict';var _=require(_0xfd33('0x0'));var util=require('util');var logger=require(_0xfd33('0x1'))('api');var moment=require(_0xfd33('0x2'));var BPromise=require(_0xfd33('0x3'));var rp=require(_0xfd33('0x4'));var fs=require('fs');var path=require(_0xfd33('0x5'));var rimraf=require(_0xfd33('0x6'));var config=require(_0xfd33('0x7'));var attributes=require(_0xfd33('0x8'));module['exports']=function(_0x228aa5,_0x122eff){return _0x228aa5[_0xfd33('0x9')](_0xfd33('0xa'),attributes,{'tableName':_0xfd33('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 ea7a01a..68707fc 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 _0xa205=['code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xdc1176,_0x55c094){var _0x4d7c39=function(_0x280d21){while(--_0x280d21){_0xdc1176['push'](_0xdc1176['shift']());}};_0x4d7c39(++_0x55c094);}(_0xa205,0x1df));var _0x5a20=function(_0x343e44,_0x519af9){_0x343e44=_0x343e44-0x0;var _0xa5130e=_0xa205[_0x343e44];return _0xa5130e;};'use strict';var _=require(_0x5a20('0x0'));var util=require(_0x5a20('0x1'));var moment=require('moment');var BPromise=require(_0x5a20('0x2'));var rs=require(_0x5a20('0x3'));var fs=require('fs');var Redis=require(_0x5a20('0x4'));var db=require(_0x5a20('0x5'))['db'];var utils=require(_0x5a20('0x6'));var logger=require(_0x5a20('0x7'))(_0x5a20('0x8'));var config=require('../../config/environment');var jayson=require(_0x5a20('0x9'));var client=jayson[_0x5a20('0xa')][_0x5a20('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x173ff2,_0x10de61,_0x16fbfa){return new BPromise(function(_0x356108,_0x4f71a8){return client[_0x5a20('0xc')](_0x173ff2,_0x16fbfa)[_0x5a20('0xd')](function(_0x5c0161){logger[_0x5a20('0xe')](_0x5a20('0xf'),_0x10de61,_0x5a20('0x10'));logger[_0x5a20('0x11')](_0x5a20('0x12'),_0x10de61,_0x5a20('0x10'),JSON[_0x5a20('0x13')](_0x5c0161));if(_0x5c0161[_0x5a20('0x14')]){if(_0x5c0161['error'][_0x5a20('0x15')]===0x1f4){logger[_0x5a20('0x14')](_0x5a20('0xf'),_0x10de61,_0x5c0161[_0x5a20('0x14')][_0x5a20('0x16')]);return _0x4f71a8(_0x5c0161[_0x5a20('0x14')][_0x5a20('0x16')]);}logger['error'](_0x5a20('0xf'),_0x10de61,_0x5c0161[_0x5a20('0x14')]['message']);return _0x356108(_0x5c0161[_0x5a20('0x14')][_0x5a20('0x16')]);}else{logger['info'](_0x5a20('0xf'),_0x10de61,_0x5a20('0x10'));_0x356108(_0x5c0161[_0x5a20('0x17')][_0x5a20('0x16')]);}})[_0x5a20('0x18')](function(_0x51b27f){logger[_0x5a20('0x14')](_0x5a20('0xf'),_0x10de61,_0x51b27f);_0x4f71a8(_0x51b27f);});});}
\ No newline at end of file
+var _0x1818=['http','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1ce442,_0x52ab4e){var _0x3f9c63=function(_0x23edc1){while(--_0x23edc1){_0x1ce442['push'](_0x1ce442['shift']());}};_0x3f9c63(++_0x52ab4e);}(_0x1818,0x19b));var _0x8181=function(_0x1562a2,_0x2e4655){_0x1562a2=_0x1562a2-0x0;var _0x39a636=_0x1818[_0x1562a2];return _0x39a636;};'use strict';var _=require('lodash');var util=require(_0x8181('0x0'));var moment=require(_0x8181('0x1'));var BPromise=require(_0x8181('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8181('0x3'));var db=require(_0x8181('0x4'))['db'];var utils=require(_0x8181('0x5'));var logger=require(_0x8181('0x6'))(_0x8181('0x7'));var config=require(_0x8181('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8181('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x381fa4,_0x579bd9,_0x1b0ed4){return new BPromise(function(_0x5adb6d,_0x388ddd){return client[_0x8181('0xa')](_0x381fa4,_0x1b0ed4)[_0x8181('0xb')](function(_0x24ae7e){logger[_0x8181('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x579bd9,_0x8181('0xd'));logger[_0x8181('0xe')](_0x8181('0xf'),_0x579bd9,'request\x20sent',JSON['stringify'](_0x24ae7e));if(_0x24ae7e[_0x8181('0x10')]){if(_0x24ae7e[_0x8181('0x10')][_0x8181('0x11')]===0x1f4){logger[_0x8181('0x10')](_0x8181('0x12'),_0x579bd9,_0x24ae7e[_0x8181('0x10')]['message']);return _0x388ddd(_0x24ae7e[_0x8181('0x10')][_0x8181('0x13')]);}logger[_0x8181('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x579bd9,_0x24ae7e[_0x8181('0x10')][_0x8181('0x13')]);return _0x5adb6d(_0x24ae7e[_0x8181('0x10')]['message']);}else{logger[_0x8181('0xc')](_0x8181('0x12'),_0x579bd9,_0x8181('0xd'));_0x5adb6d(_0x24ae7e[_0x8181('0x14')]['message']);}})['catch'](function(_0x1ab70b){logger[_0x8181('0x10')](_0x8181('0x12'),_0x579bd9,_0x1ab70b);_0x388ddd(_0x1ab70b);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 652769d..d47230c 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(_0x20e986,_0x445a88){var _0x4929df=function(_0x32ff70){while(--_0x32ff70){_0x20e986['push'](_0x20e986['shift']());}};_0x4929df(++_0x445a88);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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(_0x20efe3,_0x48ad9f){var _0xa8aa36=function(_0x590de8){while(--_0x590de8){_0x20efe3['push'](_0x20efe3['shift']());}};_0xa8aa36(++_0x48ad9f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 bb97f43..2c1acfa 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 _0xf81a=['exports','STRING','TEXT','sequelize'];(function(_0x513483,_0x105ccd){var _0x384a1e=function(_0x47bb41){while(--_0x47bb41){_0x513483['push'](_0x513483['shift']());}};_0x384a1e(++_0x105ccd);}(_0xf81a,0x16b));var _0xaf81=function(_0x478032,_0x349dae){_0x478032=_0x478032-0x0;var _0x5d7ef5=_0xf81a[_0x478032];return _0x5d7ef5;};'use strict';var Sequelize=require(_0xaf81('0x0'));module[_0xaf81('0x1')]={'name':{'type':Sequelize[_0xaf81('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xaf81('0x2')]},'metric':{'type':Sequelize[_0xaf81('0x3')]},'description':{'type':Sequelize[_0xaf81('0x2')]}};
\ No newline at end of file
+var _0x76bc=['exports','STRING','name','sequelize'];(function(_0x171fdc,_0x16ae91){var _0x3782ea=function(_0x58b691){while(--_0x58b691){_0x171fdc['push'](_0x171fdc['shift']());}};_0x3782ea(++_0x16ae91);}(_0x76bc,0x17f));var _0xc76b=function(_0x1f8053,_0x111077){_0x1f8053=_0x1f8053-0x0;var _0x174fd8=_0x76bc[_0x1f8053];return _0x174fd8;};'use strict';var Sequelize=require(_0xc76b('0x0'));module[_0xc76b('0x1')]={'name':{'type':Sequelize[_0xc76b('0x2')],'allowNull':![],'unique':_0xc76b('0x3')},'table':{'type':Sequelize[_0xc76b('0x2')]},'metric':{'type':Sequelize['TEXT']},'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 bd83d54..9b282aa 100644
--- a/server/api/analyticMetric/analyticMetric.controller.js
+++ b/server/api/analyticMetric/analyticMetric.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4b84=['status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','stack','name','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x268afe,_0x50bb60){var _0x288d0b=function(_0x5ec113){while(--_0x5ec113){_0x268afe['push'](_0x268afe['shift']());}};_0x288d0b(++_0x50bb60);}(_0x4b84,0x1cc));var _0x44b8=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x4b84[_0xae7c2f];return _0x5d7001;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){var _0x41a922=_0x51a34a[_0x44b8('0x22')]({'plain':!![]});var _0x25a0c1=_0x44b8('0x23');return db[_0x44b8('0x24')]['destroy']({'where':{'type':_0x25a0c1,'resourceId':_0x41a922['id']}})[_0x44b8('0x20')](function(){return _0x51a34a;});})['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x549a26,_0x17ac44){return function(_0x470f49){if(!_0x470f49){_0x549a26[_0x44b8('0x25')](0x194);}return _0x470f49;};}function handleError(_0x59c1bf,_0xb22107){_0xb22107=_0xb22107||0x1f4;return function(_0x242342){logger['error'](_0x242342[_0x44b8('0x26')]);if(_0x242342['name']){delete _0x242342[_0x44b8('0x27')];}_0x59c1bf['status'](_0xb22107)['send'](_0x242342);};}exports['index']=function(_0x387293,_0x29b18d){var _0x44ce5a={},_0x1bd1be={},_0x38cd17={'count':0x0,'rows':[]};var _0xc3f667=_[_0x44b8('0x28')](db[_0x44b8('0x29')][_0x44b8('0x2a')],function(_0x28f918){return{'name':_0x28f918[_0x44b8('0x2b')],'type':_0x28f918[_0x44b8('0x2c')][_0x44b8('0x2d')]};});_0x1bd1be['model']=_[_0x44b8('0x28')](_0xc3f667,'name');_0x1bd1be[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x387293[_0x44b8('0x2e')]);_0x1bd1be[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x1bd1be['model'],_0x1bd1be[_0x44b8('0x2e')]);_0x44ce5a[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x1bd1be[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x387293['query'][_0x44b8('0x34')]));_0x44ce5a[_0x44b8('0x32')]=_0x44ce5a[_0x44b8('0x32')][_0x44b8('0x35')]?_0x44ce5a[_0x44b8('0x32')]:_0x1bd1be[_0x44b8('0x33')];if(!_0x387293[_0x44b8('0x2e')][_0x44b8('0x36')](_0x44b8('0x37'))){_0x44ce5a[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x17')]);_0x44ce5a[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x19')]);}_0x44ce5a[_0x44b8('0x38')]=qs[_0x44b8('0x39')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x39')]);_0x44ce5a[_0x44b8('0x3a')]=qs['filters'](_[_0x44b8('0x3b')](_0x387293[_0x44b8('0x2e')],_0x1bd1be['filters']),_0xc3f667);if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]){_0x44ce5a[_0x44b8('0x3a')]=_[_0x44b8('0x3d')](_0x44ce5a['where'],{'$or':_[_0x44b8('0x28')](_0xc3f667,function(_0x11e4e3){if(_0x11e4e3[_0x44b8('0x2c')]!==_0x44b8('0x3e')){var _0x9cb2a={};_0x9cb2a[_0x11e4e3[_0x44b8('0x27')]]={'$like':'%'+_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]+'%'};return _0x9cb2a;}})});}_0x44ce5a=_[_0x44b8('0x3d')]({},_0x44ce5a,_0x387293[_0x44b8('0x3f')]);var _0x1c9983={'where':_0x44ce5a[_0x44b8('0x3a')]};return db[_0x44b8('0x29')][_0x44b8('0x18')](_0x1c9983)[_0x44b8('0x20')](function(_0x29b43f){_0x38cd17['count']=_0x29b43f;if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x44ce5a[_0x44b8('0x41')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x44b8('0x42')](_0x44ce5a);})[_0x44b8('0x20')](function(_0x229cc9){_0x38cd17['rows']=_0x229cc9;return _0x38cd17;})[_0x44b8('0x20')](respondWithFilteredResult(_0x29b18d,_0x44ce5a))[_0x44b8('0x43')](handleError(_0x29b18d,null));};exports[_0x44b8('0x44')]=function(_0x334f86,_0xfd590a){var _0x499a3e={'raw':!![],'where':{'id':_0x334f86[_0x44b8('0x45')]['id']}},_0x5ae5f9={};_0x5ae5f9[_0x44b8('0x33')]=_[_0x44b8('0x2f')](db[_0x44b8('0x29')][_0x44b8('0x2a')]);_0x5ae5f9[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x334f86[_0x44b8('0x2e')]);_0x5ae5f9[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],_0x5ae5f9[_0x44b8('0x2e')]);_0x499a3e[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x334f86[_0x44b8('0x2e')][_0x44b8('0x34')]));_0x499a3e[_0x44b8('0x32')]=_0x499a3e['attributes']['length']?_0x499a3e[_0x44b8('0x32')]:_0x5ae5f9[_0x44b8('0x33')];if(_0x334f86[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x499a3e[_0x44b8('0x41')]=[{'all':!![]}];}_0x499a3e=_[_0x44b8('0x3d')]({},_0x499a3e,_0x334f86[_0x44b8('0x3f')]);return db['AnalyticMetric'][_0x44b8('0x46')](_0x499a3e)['then'](handleEntityNotFound(_0xfd590a,null))[_0x44b8('0x20')](respondWithResult(_0xfd590a,null))[_0x44b8('0x43')](handleError(_0xfd590a,null));};exports[_0x44b8('0x47')]=function(_0x9207bf,_0x103d57){return db[_0x44b8('0x29')]['create'](_0x9207bf[_0x44b8('0x48')],{})[_0x44b8('0x20')](function(_0x10602c){var _0x25d266=_0x9207bf['user'][_0x44b8('0x22')]({'plain':!![]});if(!_0x25d266)throw new Error(_0x44b8('0x49'));if(_0x25d266[_0x44b8('0x4a')]===_0x44b8('0x4b')){var _0x44ec23=_0x10602c[_0x44b8('0x22')]({'plain':!![]});var _0x500bad=_0x44b8('0x23');return db[_0x44b8('0x4c')][_0x44b8('0x46')]({'where':{'name':_0x500bad,'userProfileId':_0x25d266[_0x44b8('0x4d')]},'raw':!![]})[_0x44b8('0x20')](function(_0x57d0e2){if(_0x57d0e2&&_0x57d0e2['autoAssociation']===0x0){return db[_0x44b8('0x24')]['create']({'name':_0x44ec23[_0x44b8('0x27')],'resourceId':_0x44ec23['id'],'type':_0x57d0e2['name'],'sectionId':_0x57d0e2['id']},{})[_0x44b8('0x20')](function(){return _0x10602c;});}else{return _0x10602c;}})[_0x44b8('0x43')](function(_0x1a29f6){logger[_0x44b8('0x4e')](_0x44b8('0x4f'),_0x1a29f6);throw _0x1a29f6;});}return _0x10602c;})[_0x44b8('0x20')](respondWithResult(_0x103d57,0xc9))[_0x44b8('0x43')](handleError(_0x103d57,null));};exports['update']=function(_0x3ad278,_0x37b2c2){if(_0x3ad278[_0x44b8('0x48')]['id']){delete _0x3ad278['body']['id'];}return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x3ad278[_0x44b8('0x45')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x37b2c2,null))['then'](saveUpdates(_0x3ad278[_0x44b8('0x48')],null))[_0x44b8('0x20')](respondWithResult(_0x37b2c2,null))['catch'](handleError(_0x37b2c2,null));};exports[_0x44b8('0x21')]=function(_0x19f22b,_0x35136e){return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x19f22b['params']['id']}})['then'](handleEntityNotFound(_0x35136e,null))[_0x44b8('0x20')](removeEntity(_0x35136e,null))[_0x44b8('0x43')](handleError(_0x35136e,null));};
\ No newline at end of file
+var _0x9c5a=['update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save'];(function(_0x5182bd,_0xff8120){var _0x3b902d=function(_0x7fdcbc){while(--_0x7fdcbc){_0x5182bd['push'](_0x5182bd['shift']());}};_0x3b902d(++_0xff8120);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x5c600b,_0x24a29d){_0x5c600b=_0x5c600b-0x0;var _0x4df353=_0x9c5a[_0x5c600b];return _0x4df353;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){var _0x424b4c=_0x11d395[_0xa9c5('0x25')]({'plain':!![]});var _0x32fc7d=_0xa9c5('0x26');return db[_0xa9c5('0x27')][_0xa9c5('0x28')]({'where':{'type':_0x32fc7d,'resourceId':_0x424b4c['id']}})['then'](function(){return _0x11d395;});})['then'](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1762ac,_0x830bad){return function(_0x4caefa){if(!_0x4caefa){_0x1762ac[_0xa9c5('0x17')](0x194);}return _0x4caefa;};}function handleError(_0x320dc0,_0x5f468b){_0x5f468b=_0x5f468b||0x1f4;return function(_0x413edf){logger[_0xa9c5('0x29')](_0x413edf[_0xa9c5('0x2a')]);if(_0x413edf[_0xa9c5('0x2b')]){delete _0x413edf[_0xa9c5('0x2b')];}_0x320dc0['status'](_0x5f468b)[_0xa9c5('0x2c')](_0x413edf);};}exports['index']=function(_0x3c3da7,_0x1ef388){var _0x2eeed1={},_0x541475={},_0xc6d0c1={'count':0x0,'rows':[]};var _0xbe29c5=_['map'](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')],function(_0x431e07){return{'name':_0x431e07[_0xa9c5('0x2f')],'type':_0x431e07[_0xa9c5('0x30')][_0xa9c5('0x31')]};});_0x541475[_0xa9c5('0x32')]=_['map'](_0xbe29c5,_0xa9c5('0x2b'));_0x541475[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x3c3da7[_0xa9c5('0x33')]);_0x541475[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0x541475[_0xa9c5('0x32')],_0x541475[_0xa9c5('0x33')]);_0x2eeed1['attributes']=_['intersection'](_0x541475[_0xa9c5('0x32')],qs[_0xa9c5('0x37')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x2eeed1[_0xa9c5('0x38')]=_0x2eeed1[_0xa9c5('0x38')]['length']?_0x2eeed1['attributes']:_0x541475['model'];if(!_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x39')]('nolimit')){_0x2eeed1[_0xa9c5('0x1c')]=qs['limit'](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x1c')]);_0x2eeed1[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x3c3da7['query'][_0xa9c5('0x1e')]);}_0x2eeed1[_0xa9c5('0x3a')]=qs[_0xa9c5('0x3b')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3b')]);_0x2eeed1[_0xa9c5('0x3c')]=qs[_0xa9c5('0x35')](_[_0xa9c5('0x3d')](_0x3c3da7['query'],_0x541475[_0xa9c5('0x35')]),_0xbe29c5);if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]){_0x2eeed1[_0xa9c5('0x3c')]=_[_0xa9c5('0x3f')](_0x2eeed1[_0xa9c5('0x3c')],{'$or':_['map'](_0xbe29c5,function(_0x307736){if(_0x307736['type']!==_0xa9c5('0x40')){var _0x5c89e7={};_0x5c89e7[_0x307736[_0xa9c5('0x2b')]]={'$like':'%'+_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]+'%'};return _0x5c89e7;}})});}_0x2eeed1=_['merge']({},_0x2eeed1,_0x3c3da7[_0xa9c5('0x41')]);var _0x1ddd72={'where':_0x2eeed1[_0xa9c5('0x3c')]};return db[_0xa9c5('0x2d')]['count'](_0x1ddd72)[_0xa9c5('0x24')](function(_0x97803f){_0xc6d0c1[_0xa9c5('0x1d')]=_0x97803f;if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x2eeed1['include']=[{'all':!![]}];}return db[_0xa9c5('0x2d')]['findAll'](_0x2eeed1);})[_0xa9c5('0x24')](function(_0x397614){_0xc6d0c1[_0xa9c5('0x43')]=_0x397614;return _0xc6d0c1;})[_0xa9c5('0x24')](respondWithFilteredResult(_0x1ef388,_0x2eeed1))[_0xa9c5('0x44')](handleError(_0x1ef388,null));};exports[_0xa9c5('0x45')]=function(_0xf35cb3,_0x3e8633){var _0x1f895a={'raw':!![],'where':{'id':_0xf35cb3['params']['id']}},_0xc28b1a={};_0xc28b1a[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')]);_0xc28b1a[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0xf35cb3['query']);_0xc28b1a[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0xc28b1a['model'],_0xc28b1a['query']);_0x1f895a['attributes']=_['intersection'](_0xc28b1a['model'],qs[_0xa9c5('0x37')](_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x1f895a[_0xa9c5('0x38')]=_0x1f895a[_0xa9c5('0x38')][_0xa9c5('0x46')]?_0x1f895a[_0xa9c5('0x38')]:_0xc28b1a[_0xa9c5('0x32')];if(_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x1f895a[_0xa9c5('0x47')]=[{'all':!![]}];}_0x1f895a=_[_0xa9c5('0x3f')]({},_0x1f895a,_0xf35cb3[_0xa9c5('0x41')]);return db['AnalyticMetric'][_0xa9c5('0x48')](_0x1f895a)['then'](handleEntityNotFound(_0x3e8633,null))[_0xa9c5('0x24')](respondWithResult(_0x3e8633,null))[_0xa9c5('0x44')](handleError(_0x3e8633,null));};exports['create']=function(_0x5cbd33,_0xf00970){return db[_0xa9c5('0x2d')][_0xa9c5('0x49')](_0x5cbd33['body'],{})['then'](function(_0x2333c4){var _0xd03cec=_0x5cbd33['user'][_0xa9c5('0x25')]({'plain':!![]});if(!_0xd03cec)throw new Error(_0xa9c5('0x4a'));if(_0xd03cec[_0xa9c5('0x4b')]===_0xa9c5('0x4c')){var _0x34020f=_0x2333c4[_0xa9c5('0x25')]({'plain':!![]});var _0x4b6fc9='Metrics';return db['UserProfileSection'][_0xa9c5('0x48')]({'where':{'name':_0x4b6fc9,'userProfileId':_0xd03cec[_0xa9c5('0x4d')]},'raw':!![]})[_0xa9c5('0x24')](function(_0xef4d2){if(_0xef4d2&&_0xef4d2[_0xa9c5('0x4e')]===0x0){return db[_0xa9c5('0x27')]['create']({'name':_0x34020f[_0xa9c5('0x2b')],'resourceId':_0x34020f['id'],'type':_0xef4d2[_0xa9c5('0x2b')],'sectionId':_0xef4d2['id']},{})[_0xa9c5('0x24')](function(){return _0x2333c4;});}else{return _0x2333c4;}})[_0xa9c5('0x44')](function(_0xa0b458){logger[_0xa9c5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa0b458);throw _0xa0b458;});}return _0x2333c4;})['then'](respondWithResult(_0xf00970,0xc9))[_0xa9c5('0x44')](handleError(_0xf00970,null));};exports['update']=function(_0x1b158f,_0x5ea9b0){if(_0x1b158f[_0xa9c5('0x4f')]['id']){delete _0x1b158f[_0xa9c5('0x4f')]['id'];}return db[_0xa9c5('0x2d')]['find']({'where':{'id':_0x1b158f[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x5ea9b0,null))[_0xa9c5('0x24')](saveUpdates(_0x1b158f[_0xa9c5('0x4f')],null))['then'](respondWithResult(_0x5ea9b0,null))['catch'](handleError(_0x5ea9b0,null));};exports[_0xa9c5('0x28')]=function(_0x2b66ee,_0x3205f2){return db['AnalyticMetric'][_0xa9c5('0x48')]({'where':{'id':_0x2b66ee[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x3205f2,null))[_0xa9c5('0x24')](removeEntity(_0x3205f2,null))[_0xa9c5('0x44')](handleError(_0x3205f2,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 045ba72..418b57b 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 _0xee55=['path','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','../../config/logger','moment','request-promise'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xee55,0x1a0));var _0x5ee5=function(_0x48961c,_0x280e9d){_0x48961c=_0x48961c-0x0;var _0x1d895d=_0xee55[_0x48961c];return _0x1d895d;};'use strict';var _=require(_0x5ee5('0x0'));var util=require('util');var logger=require(_0x5ee5('0x1'))('api');var moment=require(_0x5ee5('0x2'));var BPromise=require('bluebird');var rp=require(_0x5ee5('0x3'));var fs=require('fs');var path=require(_0x5ee5('0x4'));var rimraf=require('rimraf');var config=require(_0x5ee5('0x5'));var attributes=require(_0x5ee5('0x6'));module[_0x5ee5('0x7')]=function(_0x392a8e,_0x684992){return _0x392a8e[_0x5ee5('0x8')](_0x5ee5('0x9'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a6b=['request-promise','path','rimraf','./analyticMetric.attributes','AnalyticMetric','analytics_metrics','lodash','moment'];(function(_0x5f6c8e,_0x4b240a){var _0x5c5e16=function(_0x32a063){while(--_0x32a063){_0x5f6c8e['push'](_0x5f6c8e['shift']());}};_0x5c5e16(++_0x4b240a);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x189305,_0x46c43f){_0x189305=_0x189305-0x0;var _0xea3406=_0x0a6b[_0x189305];return _0xea3406;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb0a6('0x1'));var BPromise=require('bluebird');var rp=require(_0xb0a6('0x2'));var fs=require('fs');var path=require(_0xb0a6('0x3'));var rimraf=require(_0xb0a6('0x4'));var config=require('../../config/environment');var attributes=require(_0xb0a6('0x5'));module['exports']=function(_0xbbdf89,_0x415e9e){return _0xbbdf89['define'](_0xb0a6('0x6'),attributes,{'tableName':_0xb0a6('0x7'),'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 e20e4b4..507e46c 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 _0x3511=['request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s'];(function(_0x216d45,_0x4989fe){var _0xbaac0b=function(_0x308a41){while(--_0x308a41){_0x216d45['push'](_0x216d45['shift']());}};_0xbaac0b(++_0x4989fe);}(_0x3511,0x1eb));var _0x1351=function(_0x52dc0d,_0x4db716){_0x52dc0d=_0x52dc0d-0x0;var _0x9e4e71=_0x3511[_0x52dc0d];return _0x9e4e71;};'use strict';var _=require('lodash');var util=require(_0x1351('0x0'));var moment=require(_0x1351('0x1'));var BPromise=require(_0x1351('0x2'));var rs=require(_0x1351('0x3'));var fs=require('fs');var Redis=require(_0x1351('0x4'));var db=require(_0x1351('0x5'))['db'];var utils=require(_0x1351('0x6'));var logger=require('../../config/logger')(_0x1351('0x7'));var config=require('../../config/environment');var jayson=require(_0x1351('0x8'));var client=jayson[_0x1351('0x9')][_0x1351('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59259e,_0x236026,_0x168bef){return new BPromise(function(_0x252018,_0x14075d){return client[_0x1351('0xb')](_0x59259e,_0x168bef)[_0x1351('0xc')](function(_0x35f766){logger[_0x1351('0xd')](_0x1351('0xe'),_0x236026,_0x1351('0xf'));logger[_0x1351('0x10')](_0x1351('0x11'),_0x236026,'request\x20sent',JSON[_0x1351('0x12')](_0x35f766));if(_0x35f766[_0x1351('0x13')]){if(_0x35f766['error']['code']===0x1f4){logger['error'](_0x1351('0xe'),_0x236026,_0x35f766[_0x1351('0x13')][_0x1351('0x14')]);return _0x14075d(_0x35f766[_0x1351('0x13')][_0x1351('0x14')]);}logger['error'](_0x1351('0xe'),_0x236026,_0x35f766[_0x1351('0x13')][_0x1351('0x14')]);return _0x252018(_0x35f766[_0x1351('0x13')][_0x1351('0x14')]);}else{logger[_0x1351('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x236026,'request\x20sent');_0x252018(_0x35f766[_0x1351('0x15')]['message']);}})[_0x1351('0x16')](function(_0x302eda){logger[_0x1351('0x13')](_0x1351('0xe'),_0x236026,_0x302eda);_0x14075d(_0x302eda);});});}
\ No newline at end of file
+var _0xc9f7=['client','http','request','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','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0xc9f7,0xfd));var _0x7c9f=function(_0x3346d8,_0x1e2e46){_0x3346d8=_0x3346d8-0x0;var _0x4ad342=_0xc9f7[_0x3346d8];return _0x4ad342;};'use strict';var _=require(_0x7c9f('0x0'));var util=require(_0x7c9f('0x1'));var moment=require(_0x7c9f('0x2'));var BPromise=require(_0x7c9f('0x3'));var rs=require(_0x7c9f('0x4'));var fs=require('fs');var Redis=require(_0x7c9f('0x5'));var db=require(_0x7c9f('0x6'))['db'];var utils=require(_0x7c9f('0x7'));var logger=require(_0x7c9f('0x8'))(_0x7c9f('0x9'));var config=require('../../config/environment');var jayson=require(_0x7c9f('0xa'));var client=jayson[_0x7c9f('0xb')][_0x7c9f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x996b2c,_0x41d018,_0x1dd4aa){return new BPromise(function(_0x213c89,_0x39bbbf){return client[_0x7c9f('0xd')](_0x996b2c,_0x1dd4aa)[_0x7c9f('0xe')](function(_0x2db949){logger[_0x7c9f('0xf')](_0x7c9f('0x10'),_0x41d018,_0x7c9f('0x11'));logger[_0x7c9f('0x12')](_0x7c9f('0x13'),_0x41d018,_0x7c9f('0x11'),JSON[_0x7c9f('0x14')](_0x2db949));if(_0x2db949['error']){if(_0x2db949[_0x7c9f('0x15')]['code']===0x1f4){logger[_0x7c9f('0x15')](_0x7c9f('0x10'),_0x41d018,_0x2db949[_0x7c9f('0x15')][_0x7c9f('0x16')]);return _0x39bbbf(_0x2db949[_0x7c9f('0x15')][_0x7c9f('0x16')]);}logger['error'](_0x7c9f('0x10'),_0x41d018,_0x2db949[_0x7c9f('0x15')]['message']);return _0x213c89(_0x2db949[_0x7c9f('0x15')]['message']);}else{logger[_0x7c9f('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x41d018,_0x7c9f('0x11'));_0x213c89(_0x2db949['result'][_0x7c9f('0x16')]);}})[_0x7c9f('0x17')](function(_0x1eee33){logger[_0x7c9f('0x15')]('AnalyticMetric,\x20%s,\x20%s',_0x41d018,_0x1eee33);_0x39bbbf(_0x1eee33);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 4affd27..f557e7b 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 _0x5e17=['get','isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','multer','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x5e17,0x17a));var _0x75e1=function(_0x57f61a,_0x366fe6){_0x57f61a=_0x57f61a-0x0;var _0x253312=_0x5e17[_0x57f61a];return _0x253312;};'use strict';var multer=require(_0x75e1('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x75e1('0x1'));var auth=require(_0x75e1('0x2'));var interaction=require(_0x75e1('0x3'));var config=require(_0x75e1('0x4'));var controller=require(_0x75e1('0x5'));router[_0x75e1('0x6')]('/',auth[_0x75e1('0x7')](),controller[_0x75e1('0x8')]);router[_0x75e1('0x6')](_0x75e1('0x9'),auth[_0x75e1('0x7')](),controller[_0x75e1('0xa')]);router[_0x75e1('0xb')]('/',auth[_0x75e1('0x7')](),controller[_0x75e1('0xc')]);router['put'](_0x75e1('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x75e1('0xd')](_0x75e1('0x9'),auth[_0x75e1('0x7')](),controller[_0x75e1('0xe')]);module[_0x75e1('0xf')]=router;
\ No newline at end of file
+var _0x4a9c=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','create','put'];(function(_0x5103a4,_0x4b7f5c){var _0x4f99e0=function(_0x1fb571){while(--_0x1fb571){_0x5103a4['push'](_0x5103a4['shift']());}};_0x4f99e0(++_0x4b7f5c);}(_0x4a9c,0xcc));var _0xc4a9=function(_0x2669ba,_0x4b2c24){_0x2669ba=_0x2669ba-0x0;var _0x1eccce=_0x4a9c[_0x2669ba];return _0x1eccce;};'use strict';var multer=require(_0xc4a9('0x0'));var util=require(_0xc4a9('0x1'));var path=require(_0xc4a9('0x2'));var timeout=require(_0xc4a9('0x3'));var express=require(_0xc4a9('0x4'));var router=express[_0xc4a9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc4a9('0x6'));var interaction=require(_0xc4a9('0x7'));var config=require(_0xc4a9('0x8'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0xc4a9('0x9')](),controller[_0xc4a9('0xa')]);router[_0xc4a9('0xb')](_0xc4a9('0xc'),auth['isAuthenticated'](),controller[_0xc4a9('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc4a9('0xe')]);router[_0xc4a9('0xf')](_0xc4a9('0xc'),auth[_0xc4a9('0x9')](),controller[_0xc4a9('0x10')]);router[_0xc4a9('0x11')](_0xc4a9('0xc'),auth[_0xc4a9('0x9')](),controller[_0xc4a9('0x12')]);module[_0xc4a9('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 2495cf4..c00a393 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 _0xade8=['TEXT','sequelize','exports'];(function(_0x36db58,_0x120dd9){var _0x3a90c0=function(_0x127f55){while(--_0x127f55){_0x36db58['push'](_0x36db58['shift']());}};_0x3a90c0(++_0x120dd9);}(_0xade8,0x70));var _0x8ade=function(_0x14823a,_0x4b3287){_0x14823a=_0x14823a-0x0;var _0x1b8642=_0xade8[_0x14823a];return _0x1b8642;};'use strict';var Sequelize=require(_0x8ade('0x0'));module[_0x8ade('0x1')]={'tree':{'type':Sequelize[_0x8ade('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x9f92=['TEXT','sequelize'];(function(_0x3a21c0,_0x348451){var _0x411e84=function(_0xdd7b02){while(--_0xdd7b02){_0x3a21c0['push'](_0x3a21c0['shift']());}};_0x411e84(++_0x348451);}(_0x9f92,0x125));var _0x29f9=function(_0x2a31b9,_0x4a634d){_0x2a31b9=_0x2a31b9-0x0;var _0x5cda05=_0x9f92[_0x2a31b9];return _0x5cda05;};'use strict';var Sequelize=require(_0x29f9('0x0'));module['exports']={'tree':{'type':Sequelize[_0x29f9('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index aa29b24..83f7ec6 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 _0xf5fc=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','options','AnalyticTreeReport','includeAll','include','findAll','catch','show','keys','find','create','update','body','params','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x3c3313,_0x1ea90d){var _0xb947aa=function(_0x2d911f){while(--_0x2d911f){_0x3c3313['push'](_0x3c3313['shift']());}};_0xb947aa(++_0x1ea90d);}(_0xf5fc,0x159));var _0xcf5f=function(_0xffd1b5,_0x1ede18){_0xffd1b5=_0xffd1b5-0x0;var _0x3176d6=_0xf5fc[_0xffd1b5];return _0x3176d6;};'use strict';var emlformat=require(_0xcf5f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcf5f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcf5f('0x2'));var BPromise=require(_0xcf5f('0x3'));var Mustache=require('mustache');var util=require(_0xcf5f('0x4'));var path=require(_0xcf5f('0x5'));var sox=require(_0xcf5f('0x6'));var csv=require(_0xcf5f('0x7'));var ejs=require(_0xcf5f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcf5f('0x9'));var squel=require(_0xcf5f('0xa'));var crypto=require(_0xcf5f('0xb'));var jsforce=require(_0xcf5f('0xc'));var deskjs=require(_0xcf5f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcf5f('0xe'));var Papa=require('papaparse');var Redis=require(_0xcf5f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xcf5f('0x10'));var as=require(_0xcf5f('0x11'));var hardwareService=require(_0xcf5f('0x12'));var logger=require(_0xcf5f('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xcf5f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xcf5f('0x15'))['db'];function respondWithStatusCode(_0xbaf88f,_0x2c34e9){_0x2c34e9=_0x2c34e9||0xcc;return function(_0x1872e9){if(_0x1872e9){return _0xbaf88f[_0xcf5f('0x16')](_0x2c34e9);}return _0xbaf88f[_0xcf5f('0x17')](_0x2c34e9)[_0xcf5f('0x18')]();};}function respondWithResult(_0xa8ad16,_0x36a77d){_0x36a77d=_0x36a77d||0xc8;return function(_0x2e9d6c){if(_0x2e9d6c){return _0xa8ad16['status'](_0x36a77d)['json'](_0x2e9d6c);}};}function respondWithFilteredResult(_0xb33246,_0x232e91){return function(_0xd450d6){if(_0xd450d6){var _0x188ca2=typeof _0x232e91[_0xcf5f('0x19')]==='undefined'&&typeof _0x232e91[_0xcf5f('0x1a')]===_0xcf5f('0x1b');var _0x539aaa=_0xd450d6['count'];var _0x25f696=_0x188ca2?0x0:_0x232e91[_0xcf5f('0x19')];var _0x5a7390=_0x188ca2?_0xd450d6[_0xcf5f('0x1c')]:_0x232e91[_0xcf5f('0x19')]+_0x232e91[_0xcf5f('0x1a')];var _0x9271a3;if(_0x5a7390>=_0x539aaa){_0x5a7390=_0x539aaa;_0x9271a3=0xc8;}else{_0x9271a3=0xce;}_0xb33246[_0xcf5f('0x17')](_0x9271a3);return _0xb33246[_0xcf5f('0x1d')](_0xcf5f('0x1e'),_0x25f696+'-'+_0x5a7390+'/'+_0x539aaa)[_0xcf5f('0x1f')](_0xd450d6);}return null;};}function patchUpdates(_0x46f02d){return function(_0x57fbb2){try{jsonpatch[_0xcf5f('0x20')](_0x57fbb2,_0x46f02d,!![]);}catch(_0x49f79f){return BPromise['reject'](_0x49f79f);}return _0x57fbb2[_0xcf5f('0x21')]();};}function saveUpdates(_0x5317de,_0x1817fb){return function(_0x3a71a3){if(_0x3a71a3){return _0x3a71a3['update'](_0x5317de)[_0xcf5f('0x22')](function(_0x385fe7){return _0x385fe7;});}return null;};}function removeEntity(_0x15914f,_0x166087){return function(_0x56dea1){if(_0x56dea1){return _0x56dea1[_0xcf5f('0x23')]()[_0xcf5f('0x22')](function(){_0x15914f[_0xcf5f('0x17')](0xcc)[_0xcf5f('0x18')]();});}};}function handleEntityNotFound(_0x196bfa,_0x1cf2a9){return function(_0x451d05){if(!_0x451d05){_0x196bfa['sendStatus'](0x194);}return _0x451d05;};}function handleError(_0x518a06,_0x125691){_0x125691=_0x125691||0x1f4;return function(_0x397470){logger[_0xcf5f('0x24')](_0x397470[_0xcf5f('0x25')]);if(_0x397470[_0xcf5f('0x26')]){delete _0x397470[_0xcf5f('0x26')];}_0x518a06['status'](_0x125691)[_0xcf5f('0x27')](_0x397470);};}exports[_0xcf5f('0x28')]=function(_0x365e25,_0x1bed0c){var _0x8415e7={},_0x1bc6c6={},_0x2a99eb={'count':0x0,'rows':[]};var _0x563207=_['map'](db['AnalyticTreeReport'][_0xcf5f('0x29')],function(_0x2ec74c){return{'name':_0x2ec74c['fieldName'],'type':_0x2ec74c['type'][_0xcf5f('0x2a')]};});_0x1bc6c6[_0xcf5f('0x2b')]=_['map'](_0x563207,_0xcf5f('0x26'));_0x1bc6c6[_0xcf5f('0x2c')]=_['keys'](_0x365e25['query']);_0x1bc6c6[_0xcf5f('0x2d')]=_[_0xcf5f('0x2e')](_0x1bc6c6[_0xcf5f('0x2b')],_0x1bc6c6[_0xcf5f('0x2c')]);_0x8415e7[_0xcf5f('0x2f')]=_[_0xcf5f('0x2e')](_0x1bc6c6[_0xcf5f('0x2b')],qs[_0xcf5f('0x30')](_0x365e25[_0xcf5f('0x2c')][_0xcf5f('0x30')]));_0x8415e7[_0xcf5f('0x2f')]=_0x8415e7[_0xcf5f('0x2f')][_0xcf5f('0x31')]?_0x8415e7[_0xcf5f('0x2f')]:_0x1bc6c6[_0xcf5f('0x2b')];if(!_0x365e25[_0xcf5f('0x2c')][_0xcf5f('0x32')](_0xcf5f('0x33'))){_0x8415e7[_0xcf5f('0x1a')]=qs[_0xcf5f('0x1a')](_0x365e25['query']['limit']);_0x8415e7[_0xcf5f('0x19')]=qs['offset'](_0x365e25[_0xcf5f('0x2c')]['offset']);}_0x8415e7[_0xcf5f('0x34')]=qs[_0xcf5f('0x35')](_0x365e25['query'][_0xcf5f('0x35')]);_0x8415e7[_0xcf5f('0x36')]=qs[_0xcf5f('0x2d')](_['pick'](_0x365e25['query'],_0x1bc6c6[_0xcf5f('0x2d')]),_0x563207);if(_0x365e25[_0xcf5f('0x2c')][_0xcf5f('0x37')]){_0x8415e7[_0xcf5f('0x36')]=_[_0xcf5f('0x38')](_0x8415e7[_0xcf5f('0x36')],{'$or':_[_0xcf5f('0x39')](_0x563207,function(_0x4cc9b9){if(_0x4cc9b9[_0xcf5f('0x3a')]!=='VIRTUAL'){var _0x100518={};_0x100518[_0x4cc9b9['name']]={'$like':'%'+_0x365e25['query'][_0xcf5f('0x37')]+'%'};return _0x100518;}})});}_0x8415e7=_[_0xcf5f('0x38')]({},_0x8415e7,_0x365e25[_0xcf5f('0x3b')]);var _0x9a9360={'where':_0x8415e7[_0xcf5f('0x36')]};return db[_0xcf5f('0x3c')][_0xcf5f('0x1c')](_0x9a9360)['then'](function(_0x5ec10a){_0x2a99eb[_0xcf5f('0x1c')]=_0x5ec10a;if(_0x365e25[_0xcf5f('0x2c')][_0xcf5f('0x3d')]){_0x8415e7[_0xcf5f('0x3e')]=[{'all':!![]}];}return db[_0xcf5f('0x3c')][_0xcf5f('0x3f')](_0x8415e7);})['then'](function(_0xfb7267){_0x2a99eb['rows']=_0xfb7267;return _0x2a99eb;})[_0xcf5f('0x22')](respondWithFilteredResult(_0x1bed0c,_0x8415e7))[_0xcf5f('0x40')](handleError(_0x1bed0c,null));};exports[_0xcf5f('0x41')]=function(_0x3139e7,_0x505865){var _0x15faca={'raw':!![],'where':{'id':_0x3139e7['params']['id']}},_0x5639ba={};_0x5639ba[_0xcf5f('0x2b')]=_['keys'](db[_0xcf5f('0x3c')][_0xcf5f('0x29')]);_0x5639ba[_0xcf5f('0x2c')]=_[_0xcf5f('0x42')](_0x3139e7['query']);_0x5639ba['filters']=_['intersection'](_0x5639ba[_0xcf5f('0x2b')],_0x5639ba['query']);_0x15faca[_0xcf5f('0x2f')]=_['intersection'](_0x5639ba['model'],qs[_0xcf5f('0x30')](_0x3139e7[_0xcf5f('0x2c')][_0xcf5f('0x30')]));_0x15faca['attributes']=_0x15faca[_0xcf5f('0x2f')][_0xcf5f('0x31')]?_0x15faca[_0xcf5f('0x2f')]:_0x5639ba[_0xcf5f('0x2b')];if(_0x3139e7[_0xcf5f('0x2c')][_0xcf5f('0x3d')]){_0x15faca[_0xcf5f('0x3e')]=[{'all':!![]}];}_0x15faca=_[_0xcf5f('0x38')]({},_0x15faca,_0x3139e7[_0xcf5f('0x3b')]);return db['AnalyticTreeReport'][_0xcf5f('0x43')](_0x15faca)[_0xcf5f('0x22')](handleEntityNotFound(_0x505865,null))[_0xcf5f('0x22')](respondWithResult(_0x505865,null))[_0xcf5f('0x40')](handleError(_0x505865,null));};exports[_0xcf5f('0x44')]=function(_0x545950,_0x283945){return db[_0xcf5f('0x3c')][_0xcf5f('0x44')](_0x545950['body'],{})[_0xcf5f('0x22')](respondWithResult(_0x283945,0xc9))[_0xcf5f('0x40')](handleError(_0x283945,null));};exports[_0xcf5f('0x45')]=function(_0x5357c7,_0x50a930){if(_0x5357c7[_0xcf5f('0x46')]['id']){delete _0x5357c7[_0xcf5f('0x46')]['id'];}return db[_0xcf5f('0x3c')][_0xcf5f('0x43')]({'where':{'id':_0x5357c7[_0xcf5f('0x47')]['id']}})[_0xcf5f('0x22')](handleEntityNotFound(_0x50a930,null))[_0xcf5f('0x22')](saveUpdates(_0x5357c7['body'],null))[_0xcf5f('0x22')](respondWithResult(_0x50a930,null))[_0xcf5f('0x40')](handleError(_0x50a930,null));};exports[_0xcf5f('0x23')]=function(_0x59af1c,_0xfe95a3){return db[_0xcf5f('0x3c')][_0xcf5f('0x43')]({'where':{'id':_0x59af1c[_0xcf5f('0x47')]['id']}})['then'](handleEntityNotFound(_0xfe95a3,null))[_0xcf5f('0x22')](removeEntity(_0xfe95a3,null))[_0xcf5f('0x40')](handleError(_0xfe95a3,null));};
\ No newline at end of file
+var _0x04ba=['AnalyticTreeReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','create','body','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','end','error','stack','name','send','index','map'];(function(_0x3c1f0a,_0x1422d5){var _0x22453e=function(_0x17451f){while(--_0x17451f){_0x3c1f0a['push'](_0x3c1f0a['shift']());}};_0x22453e(++_0x1422d5);}(_0x04ba,0x15c));var _0xa04b=function(_0x2780aa,_0x2fdb35){_0x2780aa=_0x2780aa-0x0;var _0x454f91=_0x04ba[_0x2780aa];return _0x454f91;};'use strict';var emlformat=require(_0xa04b('0x0'));var rimraf=require(_0xa04b('0x1'));var zipdir=require(_0xa04b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa04b('0x3'));var moment=require('moment');var BPromise=require(_0xa04b('0x4'));var Mustache=require(_0xa04b('0x5'));var util=require(_0xa04b('0x6'));var path=require(_0xa04b('0x7'));var sox=require(_0xa04b('0x8'));var csv=require('to-csv');var ejs=require(_0xa04b('0x9'));var fs=require('fs');var fs_extra=require(_0xa04b('0xa'));var _=require(_0xa04b('0xb'));var squel=require(_0xa04b('0xc'));var crypto=require('crypto');var jsforce=require(_0xa04b('0xd'));var deskjs=require(_0xa04b('0xe'));var toCsv=require(_0xa04b('0xf'));var querystring=require(_0xa04b('0x10'));var Papa=require(_0xa04b('0x11'));var Redis=require(_0xa04b('0x12'));var authService=require(_0xa04b('0x13'));var qs=require(_0xa04b('0x14'));var as=require(_0xa04b('0x15'));var hardwareService=require(_0xa04b('0x16'));var logger=require(_0xa04b('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xa04b('0x18'));var licenseUtil=require(_0xa04b('0x19'));var db=require(_0xa04b('0x1a'))['db'];function respondWithStatusCode(_0x394adf,_0xb100ff){_0xb100ff=_0xb100ff||0xcc;return function(_0x23fd9d){if(_0x23fd9d){return _0x394adf[_0xa04b('0x1b')](_0xb100ff);}return _0x394adf[_0xa04b('0x1c')](_0xb100ff)['end']();};}function respondWithResult(_0x5a335e,_0x48dacb){_0x48dacb=_0x48dacb||0xc8;return function(_0x59d0ba){if(_0x59d0ba){return _0x5a335e[_0xa04b('0x1c')](_0x48dacb)['json'](_0x59d0ba);}};}function respondWithFilteredResult(_0x305672,_0x2717a3){return function(_0x15f27b){if(_0x15f27b){var _0x2b3b83=typeof _0x2717a3[_0xa04b('0x1d')]===_0xa04b('0x1e')&&typeof _0x2717a3['limit']===_0xa04b('0x1e');var _0x2dea51=_0x15f27b[_0xa04b('0x1f')];var _0x4fe132=_0x2b3b83?0x0:_0x2717a3[_0xa04b('0x1d')];var _0x5376ea=_0x2b3b83?_0x15f27b['count']:_0x2717a3[_0xa04b('0x1d')]+_0x2717a3['limit'];var _0x1e350a;if(_0x5376ea>=_0x2dea51){_0x5376ea=_0x2dea51;_0x1e350a=0xc8;}else{_0x1e350a=0xce;}_0x305672[_0xa04b('0x1c')](_0x1e350a);return _0x305672[_0xa04b('0x20')](_0xa04b('0x21'),_0x4fe132+'-'+_0x5376ea+'/'+_0x2dea51)[_0xa04b('0x22')](_0x15f27b);}return null;};}function patchUpdates(_0x37c48f){return function(_0x56a473){try{jsonpatch[_0xa04b('0x23')](_0x56a473,_0x37c48f,!![]);}catch(_0x491572){return BPromise[_0xa04b('0x24')](_0x491572);}return _0x56a473['save']();};}function saveUpdates(_0x4ff5a3,_0x1f7370){return function(_0x2ca8aa){if(_0x2ca8aa){return _0x2ca8aa[_0xa04b('0x25')](_0x4ff5a3)[_0xa04b('0x26')](function(_0x54a6dd){return _0x54a6dd;});}return null;};}function removeEntity(_0x16303a,_0x1ef6a1){return function(_0x214d2c){if(_0x214d2c){return _0x214d2c[_0xa04b('0x27')]()[_0xa04b('0x26')](function(){_0x16303a[_0xa04b('0x1c')](0xcc)[_0xa04b('0x28')]();});}};}function handleEntityNotFound(_0x2ccfe1,_0x54e7bf){return function(_0x244481){if(!_0x244481){_0x2ccfe1[_0xa04b('0x1b')](0x194);}return _0x244481;};}function handleError(_0xb465e9,_0xbac081){_0xbac081=_0xbac081||0x1f4;return function(_0x1ca571){logger[_0xa04b('0x29')](_0x1ca571[_0xa04b('0x2a')]);if(_0x1ca571['name']){delete _0x1ca571[_0xa04b('0x2b')];}_0xb465e9[_0xa04b('0x1c')](_0xbac081)[_0xa04b('0x2c')](_0x1ca571);};}exports[_0xa04b('0x2d')]=function(_0x5459fe,_0x20f4b3){var _0x495ea6={},_0x28e261={},_0xa0ed13={'count':0x0,'rows':[]};var _0x39e176=_[_0xa04b('0x2e')](db[_0xa04b('0x2f')][_0xa04b('0x30')],function(_0x1f1712){return{'name':_0x1f1712[_0xa04b('0x31')],'type':_0x1f1712['type'][_0xa04b('0x32')]};});_0x28e261[_0xa04b('0x33')]=_['map'](_0x39e176,_0xa04b('0x2b'));_0x28e261[_0xa04b('0x34')]=_[_0xa04b('0x35')](_0x5459fe['query']);_0x28e261[_0xa04b('0x36')]=_[_0xa04b('0x37')](_0x28e261[_0xa04b('0x33')],_0x28e261[_0xa04b('0x34')]);_0x495ea6[_0xa04b('0x38')]=_['intersection'](_0x28e261[_0xa04b('0x33')],qs[_0xa04b('0x39')](_0x5459fe['query'][_0xa04b('0x39')]));_0x495ea6[_0xa04b('0x38')]=_0x495ea6['attributes'][_0xa04b('0x3a')]?_0x495ea6[_0xa04b('0x38')]:_0x28e261[_0xa04b('0x33')];if(!_0x5459fe[_0xa04b('0x34')][_0xa04b('0x3b')](_0xa04b('0x3c'))){_0x495ea6[_0xa04b('0x3d')]=qs[_0xa04b('0x3d')](_0x5459fe[_0xa04b('0x34')]['limit']);_0x495ea6[_0xa04b('0x1d')]=qs[_0xa04b('0x1d')](_0x5459fe[_0xa04b('0x34')][_0xa04b('0x1d')]);}_0x495ea6[_0xa04b('0x3e')]=qs[_0xa04b('0x3f')](_0x5459fe[_0xa04b('0x34')][_0xa04b('0x3f')]);_0x495ea6[_0xa04b('0x40')]=qs[_0xa04b('0x36')](_['pick'](_0x5459fe[_0xa04b('0x34')],_0x28e261[_0xa04b('0x36')]),_0x39e176);if(_0x5459fe[_0xa04b('0x34')][_0xa04b('0x41')]){_0x495ea6['where']=_[_0xa04b('0x42')](_0x495ea6[_0xa04b('0x40')],{'$or':_[_0xa04b('0x2e')](_0x39e176,function(_0x179308){if(_0x179308[_0xa04b('0x43')]!==_0xa04b('0x44')){var _0x3d8473={};_0x3d8473[_0x179308[_0xa04b('0x2b')]]={'$like':'%'+_0x5459fe[_0xa04b('0x34')]['filter']+'%'};return _0x3d8473;}})});}_0x495ea6=_[_0xa04b('0x42')]({},_0x495ea6,_0x5459fe[_0xa04b('0x45')]);var _0x57a0c3={'where':_0x495ea6[_0xa04b('0x40')]};return db['AnalyticTreeReport'][_0xa04b('0x1f')](_0x57a0c3)['then'](function(_0x40d09a){_0xa0ed13['count']=_0x40d09a;if(_0x5459fe['query'][_0xa04b('0x46')]){_0x495ea6['include']=[{'all':!![]}];}return db[_0xa04b('0x2f')][_0xa04b('0x47')](_0x495ea6);})[_0xa04b('0x26')](function(_0x215db6){_0xa0ed13[_0xa04b('0x48')]=_0x215db6;return _0xa0ed13;})[_0xa04b('0x26')](respondWithFilteredResult(_0x20f4b3,_0x495ea6))[_0xa04b('0x49')](handleError(_0x20f4b3,null));};exports['show']=function(_0x1210e7,_0x143d57){var _0x3c17af={'raw':!![],'where':{'id':_0x1210e7[_0xa04b('0x4a')]['id']}},_0x164559={};_0x164559['model']=_[_0xa04b('0x35')](db[_0xa04b('0x2f')]['rawAttributes']);_0x164559[_0xa04b('0x34')]=_[_0xa04b('0x35')](_0x1210e7[_0xa04b('0x34')]);_0x164559[_0xa04b('0x36')]=_['intersection'](_0x164559['model'],_0x164559[_0xa04b('0x34')]);_0x3c17af[_0xa04b('0x38')]=_['intersection'](_0x164559[_0xa04b('0x33')],qs[_0xa04b('0x39')](_0x1210e7[_0xa04b('0x34')][_0xa04b('0x39')]));_0x3c17af[_0xa04b('0x38')]=_0x3c17af['attributes'][_0xa04b('0x3a')]?_0x3c17af[_0xa04b('0x38')]:_0x164559[_0xa04b('0x33')];if(_0x1210e7[_0xa04b('0x34')][_0xa04b('0x46')]){_0x3c17af[_0xa04b('0x4b')]=[{'all':!![]}];}_0x3c17af=_[_0xa04b('0x42')]({},_0x3c17af,_0x1210e7[_0xa04b('0x45')]);return db['AnalyticTreeReport']['find'](_0x3c17af)['then'](handleEntityNotFound(_0x143d57,null))['then'](respondWithResult(_0x143d57,null))[_0xa04b('0x49')](handleError(_0x143d57,null));};exports['create']=function(_0x254b88,_0x1bf799){return db[_0xa04b('0x2f')][_0xa04b('0x4c')](_0x254b88['body'],{})[_0xa04b('0x26')](respondWithResult(_0x1bf799,0xc9))[_0xa04b('0x49')](handleError(_0x1bf799,null));};exports['update']=function(_0x11c9ef,_0x131244){if(_0x11c9ef[_0xa04b('0x4d')]['id']){delete _0x11c9ef['body']['id'];}return db[_0xa04b('0x2f')][_0xa04b('0x4e')]({'where':{'id':_0x11c9ef[_0xa04b('0x4a')]['id']}})[_0xa04b('0x26')](handleEntityNotFound(_0x131244,null))['then'](saveUpdates(_0x11c9ef['body'],null))[_0xa04b('0x26')](respondWithResult(_0x131244,null))[_0xa04b('0x49')](handleError(_0x131244,null));};exports[_0xa04b('0x27')]=function(_0x4511eb,_0x5883e9){return db[_0xa04b('0x2f')][_0xa04b('0x4e')]({'where':{'id':_0x4511eb[_0xa04b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5883e9,null))[_0xa04b('0x26')](removeEntity(_0x5883e9,null))[_0xa04b('0x49')](handleError(_0x5883e9,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 5605ab0..93df8c5 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 _0x9ca1=['moment','request-promise','path','rimraf','../../config/environment','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api'];(function(_0x36cf5d,_0x3aa354){var _0x5b08cf=function(_0x126400){while(--_0x126400){_0x36cf5d['push'](_0x36cf5d['shift']());}};_0x5b08cf(++_0x3aa354);}(_0x9ca1,0xbc));var _0x19ca=function(_0x2b7f72,_0x182819){_0x2b7f72=_0x2b7f72-0x0;var _0x1e1540=_0x9ca1[_0x2b7f72];return _0x1e1540;};'use strict';var _=require(_0x19ca('0x0'));var util=require(_0x19ca('0x1'));var logger=require(_0x19ca('0x2'))(_0x19ca('0x3'));var moment=require(_0x19ca('0x4'));var BPromise=require('bluebird');var rp=require(_0x19ca('0x5'));var fs=require('fs');var path=require(_0x19ca('0x6'));var rimraf=require(_0x19ca('0x7'));var config=require(_0x19ca('0x8'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x266b79,_0x1dfcc9){return _0x266b79[_0x19ca('0x9')](_0x19ca('0xa'),attributes,{'tableName':_0x19ca('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2707=['./analyticTreeReport.attributes','exports','analytics_report_trees','lodash','util','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x48961c,_0x280e9d){var _0x1d895d=function(_0x248ffa){while(--_0x248ffa){_0x48961c['push'](_0x48961c['shift']());}};_0x1d895d(++_0x280e9d);}(_0x2707,0x1cf));var _0x7270=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x2707[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x7270('0x0'));var util=require(_0x7270('0x1'));var logger=require(_0x7270('0x2'))(_0x7270('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7270('0x4'));var fs=require('fs');var path=require(_0x7270('0x5'));var rimraf=require('rimraf');var config=require(_0x7270('0x6'));var attributes=require(_0x7270('0x7'));module[_0x7270('0x8')]=function(_0x486089,_0x20168c){return _0x486089['define']('AnalyticTreeReport',attributes,{'tableName':_0x7270('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 5bbbe07..6f2166d 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x22f9c0,_0x35410c){var _0x1883fe=function(_0x5a5601){while(--_0x5a5601){_0x22f9c0['push'](_0x22f9c0['shift']());}};_0x1883fe(++_0x35410c);}(_0xadb5,0xad));var _0x5adb=function(_0x27a595,_0x44b48e){_0x27a595=_0x27a595-0x0;var _0x5599bb=_0xadb5[_0x27a595];return _0x5599bb;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x5969fa,_0x5c40ae){var _0x410842=function(_0xca7d89){while(--_0xca7d89){_0x5969fa['push'](_0x5969fa['shift']());}};_0x410842(++_0x5c40ae);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f66[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index e2b66a9..c49b174 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 _0x41e7=['post','create','put','update','destroy','exports','connect-timeout','express','Router','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id'];(function(_0xb51ec9,_0x21b476){var _0x495d62=function(_0x24da70){while(--_0x24da70){_0xb51ec9['push'](_0xb51ec9['shift']());}};_0x495d62(++_0x21b476);}(_0x41e7,0x15f));var _0x741e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x41e7[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x741e('0x0'));var express=require(_0x741e('0x1'));var router=express[_0x741e('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x741e('0x3'));var controller=require(_0x741e('0x4'));router[_0x741e('0x5')]('/',auth[_0x741e('0x6')](),controller[_0x741e('0x7')]);router['get'](_0x741e('0x8'),auth[_0x741e('0x6')](),controller['show']);router[_0x741e('0x9')]('/',auth[_0x741e('0x6')](),controller[_0x741e('0xa')]);router[_0x741e('0xb')](_0x741e('0x8'),auth[_0x741e('0x6')](),controller[_0x741e('0xc')]);router['delete'](_0x741e('0x8'),auth[_0x741e('0x6')](),controller[_0x741e('0xd')]);module[_0x741e('0xe')]=router;
\ No newline at end of file
+var _0xec49=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','multer'];(function(_0xc74254,_0x6822fe){var _0x27c986=function(_0x3fa38f){while(--_0x3fa38f){_0xc74254['push'](_0xc74254['shift']());}};_0x27c986(++_0x6822fe);}(_0xec49,0x1c1));var _0x9ec4=function(_0x1a3c9a,_0x44cbc9){_0x1a3c9a=_0x1a3c9a-0x0;var _0x12689f=_0xec49[_0x1a3c9a];return _0x12689f;};'use strict';var multer=require(_0x9ec4('0x0'));var util=require(_0x9ec4('0x1'));var path=require(_0x9ec4('0x2'));var timeout=require(_0x9ec4('0x3'));var express=require(_0x9ec4('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9ec4('0x5'));var interaction=require(_0x9ec4('0x6'));var config=require(_0x9ec4('0x7'));var controller=require(_0x9ec4('0x8'));router[_0x9ec4('0x9')]('/',auth[_0x9ec4('0xa')](),controller[_0x9ec4('0xb')]);router[_0x9ec4('0x9')](_0x9ec4('0xc'),auth[_0x9ec4('0xa')](),controller['show']);router['post']('/',auth[_0x9ec4('0xa')](),controller[_0x9ec4('0xd')]);router[_0x9ec4('0xe')](_0x9ec4('0xc'),auth[_0x9ec4('0xa')](),controller[_0x9ec4('0xf')]);router[_0x9ec4('0x10')](_0x9ec4('0xc'),auth[_0x9ec4('0xa')](),controller[_0x9ec4('0x11')]);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 1732b7f..d133b42 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 _0x6c4b=['sequelize','exports','STRING'];(function(_0x251e8c,_0x277c33){var _0x1e0c1d=function(_0x20b89c){while(--_0x20b89c){_0x251e8c['push'](_0x251e8c['shift']());}};_0x1e0c1d(++_0x277c33);}(_0x6c4b,0x93));var _0xb6c4=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x6c4b[_0x9aada2];return _0x196dff;};'use strict';var Sequelize=require(_0xb6c4('0x0'));module[_0xb6c4('0x1')]={'name':{'type':Sequelize[_0xb6c4('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb6c4('0x2')]}};
\ No newline at end of file
+var _0x3667=['STRING','sequelize','exports'];(function(_0x26fa5,_0x182714){var _0x564e52=function(_0x1a8f18){while(--_0x1a8f18){_0x26fa5['push'](_0x26fa5['shift']());}};_0x564e52(++_0x182714);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7366('0x0'));module[_0x7366('0x1')]={'name':{'type':Sequelize[_0x7366('0x2')]},'basename':{'type':Sequelize[_0x7366('0x2')]},'type':{'type':Sequelize[_0x7366('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index ec9be5d..d129832 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 _0x0064=['path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','count','set','reject','save','destroy','then','sendStatus','error','name','index','map','Attachment','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','clone','get','omit','createdAt','updatedAt','body','create','update','file','originalname','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x81fc49,_0x262dd8){var _0x596a1e=function(_0x5e4c43){while(--_0x5e4c43){_0x81fc49['push'](_0x81fc49['shift']());}};_0x596a1e(++_0x262dd8);}(_0x0064,0x10b));var _0x4006=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0064[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4006('0x0'));var rimraf=require(_0x4006('0x1'));var zipdir=require(_0x4006('0x2'));var jsonpatch=require(_0x4006('0x3'));var rp=require(_0x4006('0x4'));var moment=require(_0x4006('0x5'));var BPromise=require(_0x4006('0x6'));var Mustache=require(_0x4006('0x7'));var util=require(_0x4006('0x8'));var path=require(_0x4006('0x9'));var sox=require(_0x4006('0xa'));var csv=require(_0x4006('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4006('0xc'));var _=require(_0x4006('0xd'));var squel=require(_0x4006('0xe'));var crypto=require(_0x4006('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4006('0xb'));var querystring=require(_0x4006('0x10'));var Papa=require(_0x4006('0x11'));var Redis=require(_0x4006('0x12'));var authService=require(_0x4006('0x13'));var qs=require(_0x4006('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4006('0x15'));var logger=require('../../config/logger')(_0x4006('0x16'));var utils=require(_0x4006('0x17'));var config=require(_0x4006('0x18'));var licenseUtil=require(_0x4006('0x19'));var db=require(_0x4006('0x1a'))['db'];function respondWithStatusCode(_0x43a700,_0x3bd820){_0x3bd820=_0x3bd820||0xcc;return function(_0xdaf4ae){if(_0xdaf4ae){return _0x43a700['sendStatus'](_0x3bd820);}return _0x43a700['status'](_0x3bd820)[_0x4006('0x1b')]();};}function respondWithResult(_0x58aa3f,_0x2a847a){_0x2a847a=_0x2a847a||0xc8;return function(_0x17842d){if(_0x17842d){return _0x58aa3f[_0x4006('0x1c')](_0x2a847a)[_0x4006('0x1d')](_0x17842d);}};}function respondWithFilteredResult(_0x16782e,_0xf7406c){return function(_0x3d91da){if(_0x3d91da){var _0x360dd2=typeof _0xf7406c[_0x4006('0x1e')]==='undefined'&&typeof _0xf7406c[_0x4006('0x1f')]==='undefined';var _0x3923b7=_0x3d91da['count'];var _0x27a1e1=_0x360dd2?0x0:_0xf7406c[_0x4006('0x1e')];var _0x592107=_0x360dd2?_0x3d91da[_0x4006('0x20')]:_0xf7406c[_0x4006('0x1e')]+_0xf7406c['limit'];var _0x5e354c;if(_0x592107>=_0x3923b7){_0x592107=_0x3923b7;_0x5e354c=0xc8;}else{_0x5e354c=0xce;}_0x16782e[_0x4006('0x1c')](_0x5e354c);return _0x16782e[_0x4006('0x21')]('Content-Range',_0x27a1e1+'-'+_0x592107+'/'+_0x3923b7)[_0x4006('0x1d')](_0x3d91da);}return null;};}function patchUpdates(_0x41937e){return function(_0x461f64){try{jsonpatch['apply'](_0x461f64,_0x41937e,!![]);}catch(_0x59e954){return BPromise[_0x4006('0x22')](_0x59e954);}return _0x461f64[_0x4006('0x23')]();};}function saveUpdates(_0x26ade4,_0x421b02){return function(_0xfdd093){if(_0xfdd093){return _0xfdd093['update'](_0x26ade4)['then'](function(_0x574dd4){return _0x574dd4;});}return null;};}function removeEntity(_0x1a0a5b,_0x4eb436){return function(_0x2f279b){if(_0x2f279b){return _0x2f279b[_0x4006('0x24')]()[_0x4006('0x25')](function(){_0x1a0a5b[_0x4006('0x1c')](0xcc)[_0x4006('0x1b')]();});}};}function handleEntityNotFound(_0xd053a4,_0xc38722){return function(_0x1fd25b){if(!_0x1fd25b){_0xd053a4[_0x4006('0x26')](0x194);}return _0x1fd25b;};}function handleError(_0x358b85,_0x11561b){_0x11561b=_0x11561b||0x1f4;return function(_0x515e5e){logger[_0x4006('0x27')](_0x515e5e['stack']);if(_0x515e5e[_0x4006('0x28')]){delete _0x515e5e[_0x4006('0x28')];}_0x358b85['status'](_0x11561b)['send'](_0x515e5e);};}exports[_0x4006('0x29')]=function(_0x3c5799,_0x4ee6d9){var _0x1c18a1={},_0xf6411b={},_0x19822a={'count':0x0,'rows':[]};var _0x2014aa=_[_0x4006('0x2a')](db[_0x4006('0x2b')][_0x4006('0x2c')],function(_0x537a83){return{'name':_0x537a83[_0x4006('0x2d')],'type':_0x537a83[_0x4006('0x2e')][_0x4006('0x2f')]};});_0xf6411b[_0x4006('0x30')]=_['map'](_0x2014aa,_0x4006('0x28'));_0xf6411b['query']=_[_0x4006('0x31')](_0x3c5799[_0x4006('0x32')]);_0xf6411b['filters']=_[_0x4006('0x33')](_0xf6411b['model'],_0xf6411b[_0x4006('0x32')]);_0x1c18a1[_0x4006('0x34')]=_[_0x4006('0x33')](_0xf6411b[_0x4006('0x30')],qs[_0x4006('0x35')](_0x3c5799['query'][_0x4006('0x35')]));_0x1c18a1['attributes']=_0x1c18a1['attributes'][_0x4006('0x36')]?_0x1c18a1[_0x4006('0x34')]:_0xf6411b['model'];if(!_0x3c5799['query'][_0x4006('0x37')](_0x4006('0x38'))){_0x1c18a1[_0x4006('0x1f')]=qs[_0x4006('0x1f')](_0x3c5799[_0x4006('0x32')][_0x4006('0x1f')]);_0x1c18a1[_0x4006('0x1e')]=qs[_0x4006('0x1e')](_0x3c5799[_0x4006('0x32')]['offset']);}_0x1c18a1[_0x4006('0x39')]=qs[_0x4006('0x3a')](_0x3c5799[_0x4006('0x32')]['sort']);_0x1c18a1['where']=qs[_0x4006('0x3b')](_['pick'](_0x3c5799[_0x4006('0x32')],_0xf6411b[_0x4006('0x3b')]),_0x2014aa);if(_0x3c5799['query'][_0x4006('0x3c')]){_0x1c18a1[_0x4006('0x3d')]=_[_0x4006('0x3e')](_0x1c18a1[_0x4006('0x3d')],{'$or':_[_0x4006('0x2a')](_0x2014aa,function(_0x4a3152){if(_0x4a3152[_0x4006('0x2e')]!==_0x4006('0x3f')){var _0x2a1704={};_0x2a1704[_0x4a3152[_0x4006('0x28')]]={'$like':'%'+_0x3c5799[_0x4006('0x32')]['filter']+'%'};return _0x2a1704;}})});}_0x1c18a1=_[_0x4006('0x3e')]({},_0x1c18a1,_0x3c5799[_0x4006('0x40')]);var _0x3e6dd2={'where':_0x1c18a1[_0x4006('0x3d')]};return db['Attachment'][_0x4006('0x20')](_0x3e6dd2)[_0x4006('0x25')](function(_0x26dd91){_0x19822a[_0x4006('0x20')]=_0x26dd91;if(_0x3c5799[_0x4006('0x32')][_0x4006('0x41')]){_0x1c18a1[_0x4006('0x42')]=[{'all':!![]}];}return db['Attachment'][_0x4006('0x43')](_0x1c18a1);})[_0x4006('0x25')](function(_0xffcee7){_0x19822a[_0x4006('0x44')]=_0xffcee7;return _0x19822a;})['then'](respondWithFilteredResult(_0x4ee6d9,_0x1c18a1))[_0x4006('0x45')](handleError(_0x4ee6d9,null));};exports[_0x4006('0x46')]=function(_0x30b81c,_0x4cfdbb){var _0x7e04db={'raw':!![],'where':{'id':_0x30b81c[_0x4006('0x47')]['id']}},_0x432a={};_0x432a[_0x4006('0x30')]=_[_0x4006('0x31')](db[_0x4006('0x2b')][_0x4006('0x2c')]);_0x432a['query']=_['keys'](_0x30b81c['query']);_0x432a[_0x4006('0x3b')]=_[_0x4006('0x33')](_0x432a['model'],_0x432a[_0x4006('0x32')]);_0x7e04db[_0x4006('0x34')]=_[_0x4006('0x33')](_0x432a[_0x4006('0x30')],qs['fields'](_0x30b81c[_0x4006('0x32')][_0x4006('0x35')]));_0x7e04db[_0x4006('0x34')]=_0x7e04db[_0x4006('0x34')][_0x4006('0x36')]?_0x7e04db[_0x4006('0x34')]:_0x432a[_0x4006('0x30')];if(_0x30b81c[_0x4006('0x32')][_0x4006('0x41')]){_0x7e04db[_0x4006('0x42')]=[{'all':!![]}];}_0x7e04db=_[_0x4006('0x3e')]({},_0x7e04db,_0x30b81c[_0x4006('0x40')]);return db[_0x4006('0x2b')][_0x4006('0x48')](_0x7e04db)[_0x4006('0x25')](handleEntityNotFound(_0x4cfdbb,null))[_0x4006('0x25')](respondWithResult(_0x4cfdbb,null))[_0x4006('0x45')](handleError(_0x4cfdbb,null));};exports[_0x4006('0x49')]=function(_0x8840d9,_0x271f16){var _0x34d094={'where':{'id':_0x8840d9[_0x4006('0x47')]['id']}},_0x3dd535={};_0x3dd535[_0x4006('0x30')]=_[_0x4006('0x31')](db['Attachment'][_0x4006('0x2c')]);_0x34d094[_0x4006('0x34')]=_[_0x4006('0x33')](_0x3dd535[_0x4006('0x30')],qs[_0x4006('0x35')](_0x8840d9['query']['fields']));_0x34d094[_0x4006('0x34')]=_0x34d094[_0x4006('0x34')][_0x4006('0x36')]?_0x34d094['attributes']:_0x3dd535[_0x4006('0x30')];if(_0x8840d9['query'][_0x4006('0x41')]){_0x34d094[_0x4006('0x42')]=[{'all':!![]}];}_0x34d094=_[_0x4006('0x3e')]({},_0x34d094,_0x8840d9['options']);return db[_0x4006('0x2b')][_0x4006('0x48')](_0x34d094)[_0x4006('0x25')](handleEntityNotFound(_0x271f16,null))[_0x4006('0x25')](function(_0x538f59){if(_0x538f59){var _0x37f97e=_0x538f59[_0x4006('0x4a')]({'plain':!![]});_0x37f97e=qs[_0x4006('0x4b')](_0x37f97e,['id',_0x4006('0x4c'),_0x4006('0x4d')]);_0x8840d9[_0x4006('0x4e')]=_[_0x4006('0x4b')](_0x8840d9[_0x4006('0x4e')],['id',_0x4006('0x4c'),_0x4006('0x4d')]);return db['Attachment'][_0x4006('0x4f')](_[_0x4006('0x3e')](_0x37f97e,_0x8840d9[_0x4006('0x4e')]),{'include':_0x8840d9['query']['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x271f16,0xc9))[_0x4006('0x45')](handleError(_0x271f16,null));};exports[_0x4006('0x50')]=function(_0x49ef5a,_0x239592){if(_0x49ef5a[_0x4006('0x4e')]['id']){delete _0x49ef5a[_0x4006('0x4e')]['id'];}return db[_0x4006('0x2b')][_0x4006('0x48')]({'where':{'id':_0x49ef5a[_0x4006('0x47')]['id']}})[_0x4006('0x25')](handleEntityNotFound(_0x239592,null))['then'](saveUpdates(_0x49ef5a[_0x4006('0x4e')],null))[_0x4006('0x25')](respondWithResult(_0x239592,null))[_0x4006('0x45')](handleError(_0x239592,null));};exports[_0x4006('0x24')]=function(_0x450d7a,_0x565ce7){return db[_0x4006('0x2b')][_0x4006('0x48')]({'where':{'id':_0x450d7a[_0x4006('0x47')]['id']}})[_0x4006('0x25')](handleEntityNotFound(_0x565ce7,null))[_0x4006('0x25')](removeEntity(_0x565ce7,null))[_0x4006('0x45')](handleError(_0x565ce7,null));};exports[_0x4006('0x4f')]=function(_0x10ab7d,_0x2f7051,_0xec7c9f){_0x10ab7d[_0x4006('0x4e')][_0x4006('0x28')]=_0x10ab7d[_0x4006('0x51')][_0x4006('0x52')];_0x10ab7d['body']['basename']=_0x10ab7d[_0x4006('0x51')][_0x4006('0x53')];_0x10ab7d[_0x4006('0x4e')][_0x4006('0x2e')]=_0x10ab7d[_0x4006('0x51')][_0x4006('0x54')];return db[_0x4006('0x2b')][_0x4006('0x4f')](_0x10ab7d[_0x4006('0x4e')])[_0x4006('0x25')](respondWithResult(_0x2f7051,0xc9))[_0x4006('0x45')](handleError(_0x2f7051,null));};exports[_0x4006('0x55')]=function(_0x1f1cab,_0x2f8f52,_0x21020a){return db[_0x4006('0x2b')][_0x4006('0x56')]({'where':{'id':_0x1f1cab[_0x4006('0x47')]['id']},'raw':!![]})[_0x4006('0x25')](handleEntityNotFound(_0x2f8f52,null))[_0x4006('0x25')](function(_0x1d003b){if(_0x1d003b){var _0x46abbf=_0x1d003b[_0x4006('0x57')]!==null;var _0x261771=path[_0x4006('0x58')](config[_0x4006('0x59')],_0x4006('0x5a'));if(_0x46abbf){_0x261771=path[_0x4006('0x58')](_0x261771,'offline-chat/');}var _0x55626e=path['join'](_0x261771,_0x1d003b[_0x4006('0x5b')]);return _0x2f8f52[_0x4006('0x55')](_0x55626e);}})[_0x4006('0x45')](handleError(_0x2f8f52,null));};
\ No newline at end of file
+var _0x7986=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','Attachment','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','find','get','omit','createdAt','updatedAt','body','destroy','file','originalname','basename','filename','mimetype','create','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','util','sox','to-csv'];(function(_0x7aa744,_0x450c0d){var _0x3ef3cb=function(_0x44cc93){while(--_0x44cc93){_0x7aa744['push'](_0x7aa744['shift']());}};_0x3ef3cb(++_0x450c0d);}(_0x7986,0xab));var _0x6798=function(_0x1146ca,_0x50249a){_0x1146ca=_0x1146ca-0x0;var _0xce8354=_0x7986[_0x1146ca];return _0xce8354;};'use strict';var emlformat=require(_0x6798('0x0'));var rimraf=require(_0x6798('0x1'));var zipdir=require(_0x6798('0x2'));var jsonpatch=require(_0x6798('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6798('0x4'));var path=require('path');var sox=require(_0x6798('0x5'));var csv=require(_0x6798('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6798('0x7'));var squel=require(_0x6798('0x8'));var crypto=require(_0x6798('0x9'));var jsforce=require(_0x6798('0xa'));var deskjs=require(_0x6798('0xb'));var toCsv=require(_0x6798('0x6'));var querystring=require(_0x6798('0xc'));var Papa=require(_0x6798('0xd'));var Redis=require(_0x6798('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6798('0xf'));var as=require(_0x6798('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6798('0x11'))(_0x6798('0x12'));var utils=require(_0x6798('0x13'));var config=require(_0x6798('0x14'));var licenseUtil=require(_0x6798('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12a0d8,_0x4c146c){_0x4c146c=_0x4c146c||0xcc;return function(_0x29cfa7){if(_0x29cfa7){return _0x12a0d8['sendStatus'](_0x4c146c);}return _0x12a0d8[_0x6798('0x16')](_0x4c146c)[_0x6798('0x17')]();};}function respondWithResult(_0xd96afe,_0x25ad8a){_0x25ad8a=_0x25ad8a||0xc8;return function(_0x181199){if(_0x181199){return _0xd96afe['status'](_0x25ad8a)['json'](_0x181199);}};}function respondWithFilteredResult(_0x5b959c,_0x5adbcb){return function(_0x1c9f15){if(_0x1c9f15){var _0x4c6596=typeof _0x5adbcb[_0x6798('0x18')]===_0x6798('0x19')&&typeof _0x5adbcb[_0x6798('0x1a')]==='undefined';var _0x39164b=_0x1c9f15['count'];var _0x3d7e33=_0x4c6596?0x0:_0x5adbcb['offset'];var _0x426b42=_0x4c6596?_0x1c9f15[_0x6798('0x1b')]:_0x5adbcb[_0x6798('0x18')]+_0x5adbcb['limit'];var _0x37441e;if(_0x426b42>=_0x39164b){_0x426b42=_0x39164b;_0x37441e=0xc8;}else{_0x37441e=0xce;}_0x5b959c[_0x6798('0x16')](_0x37441e);return _0x5b959c['set']('Content-Range',_0x3d7e33+'-'+_0x426b42+'/'+_0x39164b)[_0x6798('0x1c')](_0x1c9f15);}return null;};}function patchUpdates(_0x42c96a){return function(_0x1eb16d){try{jsonpatch[_0x6798('0x1d')](_0x1eb16d,_0x42c96a,!![]);}catch(_0x496f3b){return BPromise[_0x6798('0x1e')](_0x496f3b);}return _0x1eb16d[_0x6798('0x1f')]();};}function saveUpdates(_0x59aaa7,_0x57be28){return function(_0x99aac3){if(_0x99aac3){return _0x99aac3[_0x6798('0x20')](_0x59aaa7)[_0x6798('0x21')](function(_0x382454){return _0x382454;});}return null;};}function removeEntity(_0x5a2b41,_0x8398bb){return function(_0x3567f7){if(_0x3567f7){return _0x3567f7['destroy']()[_0x6798('0x21')](function(){_0x5a2b41[_0x6798('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420c9c,_0x817d2f){return function(_0x42d358){if(!_0x42d358){_0x420c9c[_0x6798('0x22')](0x194);}return _0x42d358;};}function handleError(_0x1c995b,_0xca2090){_0xca2090=_0xca2090||0x1f4;return function(_0x4d017c){logger[_0x6798('0x23')](_0x4d017c[_0x6798('0x24')]);if(_0x4d017c[_0x6798('0x25')]){delete _0x4d017c[_0x6798('0x25')];}_0x1c995b[_0x6798('0x16')](_0xca2090)[_0x6798('0x26')](_0x4d017c);};}exports[_0x6798('0x27')]=function(_0x357852,_0x3d3d59){var _0x5405ae={},_0x10f589={},_0x3bc348={'count':0x0,'rows':[]};var _0x102158=_[_0x6798('0x28')](db[_0x6798('0x29')][_0x6798('0x2a')],function(_0x46fda1){return{'name':_0x46fda1['fieldName'],'type':_0x46fda1[_0x6798('0x2b')][_0x6798('0x2c')]};});_0x10f589[_0x6798('0x2d')]=_['map'](_0x102158,'name');_0x10f589[_0x6798('0x2e')]=_[_0x6798('0x2f')](_0x357852[_0x6798('0x2e')]);_0x10f589[_0x6798('0x30')]=_[_0x6798('0x31')](_0x10f589[_0x6798('0x2d')],_0x10f589[_0x6798('0x2e')]);_0x5405ae[_0x6798('0x32')]=_[_0x6798('0x31')](_0x10f589['model'],qs[_0x6798('0x33')](_0x357852[_0x6798('0x2e')][_0x6798('0x33')]));_0x5405ae[_0x6798('0x32')]=_0x5405ae[_0x6798('0x32')][_0x6798('0x34')]?_0x5405ae[_0x6798('0x32')]:_0x10f589[_0x6798('0x2d')];if(!_0x357852['query'][_0x6798('0x35')](_0x6798('0x36'))){_0x5405ae[_0x6798('0x1a')]=qs[_0x6798('0x1a')](_0x357852[_0x6798('0x2e')][_0x6798('0x1a')]);_0x5405ae[_0x6798('0x18')]=qs[_0x6798('0x18')](_0x357852[_0x6798('0x2e')][_0x6798('0x18')]);}_0x5405ae[_0x6798('0x37')]=qs['sort'](_0x357852[_0x6798('0x2e')][_0x6798('0x38')]);_0x5405ae[_0x6798('0x39')]=qs[_0x6798('0x30')](_[_0x6798('0x3a')](_0x357852[_0x6798('0x2e')],_0x10f589[_0x6798('0x30')]),_0x102158);if(_0x357852['query'][_0x6798('0x3b')]){_0x5405ae[_0x6798('0x39')]=_[_0x6798('0x3c')](_0x5405ae['where'],{'$or':_['map'](_0x102158,function(_0x4b1ea2){if(_0x4b1ea2[_0x6798('0x2b')]!==_0x6798('0x3d')){var _0x217d67={};_0x217d67[_0x4b1ea2['name']]={'$like':'%'+_0x357852[_0x6798('0x2e')][_0x6798('0x3b')]+'%'};return _0x217d67;}})});}_0x5405ae=_[_0x6798('0x3c')]({},_0x5405ae,_0x357852[_0x6798('0x3e')]);var _0x57134c={'where':_0x5405ae[_0x6798('0x39')]};return db['Attachment'][_0x6798('0x1b')](_0x57134c)['then'](function(_0x4b3b1d){_0x3bc348[_0x6798('0x1b')]=_0x4b3b1d;if(_0x357852[_0x6798('0x2e')]['includeAll']){_0x5405ae['include']=[{'all':!![]}];}return db[_0x6798('0x29')][_0x6798('0x3f')](_0x5405ae);})['then'](function(_0x5e8efb){_0x3bc348[_0x6798('0x40')]=_0x5e8efb;return _0x3bc348;})['then'](respondWithFilteredResult(_0x3d3d59,_0x5405ae))[_0x6798('0x41')](handleError(_0x3d3d59,null));};exports[_0x6798('0x42')]=function(_0x428dab,_0x3445d1){var _0x3f4b2a={'raw':!![],'where':{'id':_0x428dab[_0x6798('0x43')]['id']}},_0x13e25d={};_0x13e25d['model']=_[_0x6798('0x2f')](db[_0x6798('0x29')][_0x6798('0x2a')]);_0x13e25d['query']=_[_0x6798('0x2f')](_0x428dab['query']);_0x13e25d[_0x6798('0x30')]=_[_0x6798('0x31')](_0x13e25d[_0x6798('0x2d')],_0x13e25d[_0x6798('0x2e')]);_0x3f4b2a[_0x6798('0x32')]=_[_0x6798('0x31')](_0x13e25d[_0x6798('0x2d')],qs['fields'](_0x428dab[_0x6798('0x2e')][_0x6798('0x33')]));_0x3f4b2a[_0x6798('0x32')]=_0x3f4b2a[_0x6798('0x32')]['length']?_0x3f4b2a['attributes']:_0x13e25d['model'];if(_0x428dab['query'][_0x6798('0x44')]){_0x3f4b2a['include']=[{'all':!![]}];}_0x3f4b2a=_[_0x6798('0x3c')]({},_0x3f4b2a,_0x428dab[_0x6798('0x3e')]);return db[_0x6798('0x29')][_0x6798('0x45')](_0x3f4b2a)['then'](handleEntityNotFound(_0x3445d1,null))[_0x6798('0x21')](respondWithResult(_0x3445d1,null))['catch'](handleError(_0x3445d1,null));};exports['clone']=function(_0x839b9c,_0x1c467d){var _0x14735e={'where':{'id':_0x839b9c[_0x6798('0x43')]['id']}},_0x51eb41={};_0x51eb41[_0x6798('0x2d')]=_[_0x6798('0x2f')](db['Attachment'][_0x6798('0x2a')]);_0x14735e[_0x6798('0x32')]=_[_0x6798('0x31')](_0x51eb41['model'],qs[_0x6798('0x33')](_0x839b9c['query'][_0x6798('0x33')]));_0x14735e[_0x6798('0x32')]=_0x14735e[_0x6798('0x32')]['length']?_0x14735e[_0x6798('0x32')]:_0x51eb41['model'];if(_0x839b9c[_0x6798('0x2e')]['includeAll']){_0x14735e['include']=[{'all':!![]}];}_0x14735e=_[_0x6798('0x3c')]({},_0x14735e,_0x839b9c[_0x6798('0x3e')]);return db[_0x6798('0x29')]['find'](_0x14735e)[_0x6798('0x21')](handleEntityNotFound(_0x1c467d,null))[_0x6798('0x21')](function(_0x10ab10){if(_0x10ab10){var _0x24ec06=_0x10ab10[_0x6798('0x46')]({'plain':!![]});_0x24ec06=qs[_0x6798('0x47')](_0x24ec06,['id',_0x6798('0x48'),_0x6798('0x49')]);_0x839b9c[_0x6798('0x4a')]=_[_0x6798('0x47')](_0x839b9c[_0x6798('0x4a')],['id',_0x6798('0x48'),'updatedAt']);return db[_0x6798('0x29')]['create'](_[_0x6798('0x3c')](_0x24ec06,_0x839b9c['body']),{'include':_0x839b9c[_0x6798('0x2e')][_0x6798('0x44')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x1c467d,0xc9))[_0x6798('0x41')](handleError(_0x1c467d,null));};exports['update']=function(_0x278d5c,_0x8a40fe){if(_0x278d5c[_0x6798('0x4a')]['id']){delete _0x278d5c[_0x6798('0x4a')]['id'];}return db['Attachment']['find']({'where':{'id':_0x278d5c[_0x6798('0x43')]['id']}})[_0x6798('0x21')](handleEntityNotFound(_0x8a40fe,null))[_0x6798('0x21')](saveUpdates(_0x278d5c[_0x6798('0x4a')],null))[_0x6798('0x21')](respondWithResult(_0x8a40fe,null))[_0x6798('0x41')](handleError(_0x8a40fe,null));};exports[_0x6798('0x4b')]=function(_0x3e6a80,_0x40a9a5){return db[_0x6798('0x29')]['find']({'where':{'id':_0x3e6a80[_0x6798('0x43')]['id']}})[_0x6798('0x21')](handleEntityNotFound(_0x40a9a5,null))['then'](removeEntity(_0x40a9a5,null))[_0x6798('0x41')](handleError(_0x40a9a5,null));};exports['create']=function(_0x1d97a2,_0x90c533,_0x4f0841){_0x1d97a2[_0x6798('0x4a')]['name']=_0x1d97a2[_0x6798('0x4c')][_0x6798('0x4d')];_0x1d97a2['body'][_0x6798('0x4e')]=_0x1d97a2['file'][_0x6798('0x4f')];_0x1d97a2[_0x6798('0x4a')][_0x6798('0x2b')]=_0x1d97a2[_0x6798('0x4c')][_0x6798('0x50')];return db[_0x6798('0x29')][_0x6798('0x51')](_0x1d97a2[_0x6798('0x4a')])[_0x6798('0x21')](respondWithResult(_0x90c533,0xc9))[_0x6798('0x41')](handleError(_0x90c533,null));};exports[_0x6798('0x52')]=function(_0x2cf192,_0x586f68,_0x62dc07){return db[_0x6798('0x29')][_0x6798('0x53')]({'where':{'id':_0x2cf192[_0x6798('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x586f68,null))[_0x6798('0x21')](function(_0x2d19ea){if(_0x2d19ea){var _0x48d51b=_0x2d19ea[_0x6798('0x54')]!==null;var _0x1d24ac=path[_0x6798('0x55')](config[_0x6798('0x56')],_0x6798('0x57'));if(_0x48d51b){_0x1d24ac=path[_0x6798('0x55')](_0x1d24ac,_0x6798('0x58'));}var _0xaf2426=path[_0x6798('0x55')](_0x1d24ac,_0x2d19ea[_0x6798('0x4e')]);return _0x586f68['download'](_0xaf2426);}})[_0x6798('0x41')](handleError(_0x586f68,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 8ff03ce..5bdb69c 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 _0x706c=['rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x566dd0,_0x4ec243){var _0x14df27=function(_0x363568){while(--_0x363568){_0x566dd0['push'](_0x566dd0['shift']());}};_0x14df27(++_0x4ec243);}(_0x706c,0x9d));var _0xc706=function(_0x577519,_0x346daf){_0x577519=_0x577519-0x0;var _0x5b12f7=_0x706c[_0x577519];return _0x5b12f7;};'use strict';var _=require(_0xc706('0x0'));var util=require(_0xc706('0x1'));var logger=require(_0xc706('0x2'))(_0xc706('0x3'));var moment=require(_0xc706('0x4'));var BPromise=require(_0xc706('0x5'));var rp=require(_0xc706('0x6'));var fs=require('fs');var path=require(_0xc706('0x7'));var rimraf=require(_0xc706('0x8'));var config=require(_0xc706('0x9'));var attributes=require(_0xc706('0xa'));module[_0xc706('0xb')]=function(_0x3bbba9,_0x73d8b4){return _0x3bbba9[_0xc706('0xc')](_0xc706('0xd'),attributes,{'tableName':_0xc706('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd12c=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','attachments','lodash'];(function(_0x4f9204,_0x5c4f49){var _0x3780b3=function(_0xea99a9){while(--_0xea99a9){_0x4f9204['push'](_0x4f9204['shift']());}};_0x3780b3(++_0x5c4f49);}(_0xd12c,0x16b));var _0xcd12=function(_0xeaf2ab,_0x59c9b8){_0xeaf2ab=_0xeaf2ab-0x0;var _0x33422a=_0xd12c[_0xeaf2ab];return _0x33422a;};'use strict';var _=require(_0xcd12('0x0'));var util=require(_0xcd12('0x1'));var logger=require(_0xcd12('0x2'))(_0xcd12('0x3'));var moment=require(_0xcd12('0x4'));var BPromise=require(_0xcd12('0x5'));var rp=require(_0xcd12('0x6'));var fs=require('fs');var path=require(_0xcd12('0x7'));var rimraf=require(_0xcd12('0x8'));var config=require(_0xcd12('0x9'));var attributes=require(_0xcd12('0xa'));module[_0xcd12('0xb')]=function(_0x516db7,_0x11c0d6){return _0x516db7[_0xcd12('0xc')]('Attachment',attributes,{'tableName':_0xcd12('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 08c9c4c..6501f30 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 _0x803f=['then','info','request\x20sent','debug','stringify','error','code','message','Attachment,\x20%s,\x20%s','result','catch','CreateAttachment','Attachment','create','body','options','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x652dbc,_0x20cb94){var _0x3a9bd4=function(_0x2bba9b){while(--_0x2bba9b){_0x652dbc['push'](_0x652dbc['shift']());}};_0x3a9bd4(++_0x20cb94);}(_0x803f,0x64));var _0xf803=function(_0x22f048,_0x20c372){_0x22f048=_0x22f048-0x0;var _0xda0bfa=_0x803f[_0x22f048];return _0xda0bfa;};'use strict';var _=require(_0xf803('0x0'));var util=require('util');var moment=require(_0xf803('0x1'));var BPromise=require(_0xf803('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf803('0x3'));var db=require(_0xf803('0x4'))['db'];var utils=require(_0xf803('0x5'));var logger=require(_0xf803('0x6'))(_0xf803('0x7'));var config=require('../../config/environment');var jayson=require(_0xf803('0x8'));var client=jayson[_0xf803('0x9')][_0xf803('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x584b2d,_0x214708,_0x47128f){return new BPromise(function(_0x587319,_0x3fc5ce){return client[_0xf803('0xb')](_0x584b2d,_0x47128f)[_0xf803('0xc')](function(_0x4c95cb){logger[_0xf803('0xd')]('Attachment,\x20%s,\x20%s',_0x214708,_0xf803('0xe'));logger[_0xf803('0xf')]('Attachment,\x20%s,\x20%s,\x20%s',_0x214708,_0xf803('0xe'),JSON[_0xf803('0x10')](_0x4c95cb));if(_0x4c95cb[_0xf803('0x11')]){if(_0x4c95cb[_0xf803('0x11')][_0xf803('0x12')]===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x214708,_0x4c95cb[_0xf803('0x11')][_0xf803('0x13')]);return _0x3fc5ce(_0x4c95cb['error'][_0xf803('0x13')]);}logger['error'](_0xf803('0x14'),_0x214708,_0x4c95cb[_0xf803('0x11')][_0xf803('0x13')]);return _0x587319(_0x4c95cb[_0xf803('0x11')]['message']);}else{logger[_0xf803('0xd')](_0xf803('0x14'),_0x214708,_0xf803('0xe'));_0x587319(_0x4c95cb[_0xf803('0x15')][_0xf803('0x13')]);}})[_0xf803('0x16')](function(_0xbd7728){logger['error']('Attachment,\x20%s,\x20%s',_0x214708,_0xbd7728);_0x3fc5ce(_0xbd7728);});});}exports[_0xf803('0x17')]=function(_0x292179){var _0x5c775b=this;return new Promise(function(_0x36d347,_0x29e28f){return db[_0xf803('0x18')][_0xf803('0x19')](_0x292179[_0xf803('0x1a')],{'raw':_0x292179[_0xf803('0x1b')]?_0x292179[_0xf803('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xf803('0xc')](function(_0x252421){logger[_0xf803('0xd')](_0xf803('0x17'),_0x292179);logger[_0xf803('0xf')]('CreateAttachment',_0x292179,JSON[_0xf803('0x10')](_0x252421));_0x36d347(_0x252421);})[_0xf803('0x16')](function(_0x4a5299){logger[_0xf803('0x11')](_0xf803('0x17'),_0x4a5299[_0xf803('0x13')],_0x292179);_0x29e28f(_0x5c775b[_0xf803('0x11')](0x1f4,_0x4a5299[_0xf803('0x13')]));});});};
\ No newline at end of file
+var _0x00b3=['Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','CreateAttachment','create','body','options','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x1e2321,_0x3ae1c5){var _0x1d346d=function(_0x24f171){while(--_0x24f171){_0x1e2321['push'](_0x1e2321['shift']());}};_0x1d346d(++_0x3ae1c5);}(_0x00b3,0x17a));var _0x300b=function(_0x257df1,_0xd301fd){_0x257df1=_0x257df1-0x0;var _0x2e5d03=_0x00b3[_0x257df1];return _0x2e5d03;};'use strict';var _=require('lodash');var util=require(_0x300b('0x0'));var moment=require(_0x300b('0x1'));var BPromise=require(_0x300b('0x2'));var rs=require(_0x300b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x300b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x300b('0x5'))('rpc');var config=require(_0x300b('0x6'));var jayson=require(_0x300b('0x7'));var client=jayson[_0x300b('0x8')][_0x300b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5af470,_0x5dabb9,_0x30b3fe){return new BPromise(function(_0x590c4d,_0x5e283c){return client[_0x300b('0xa')](_0x5af470,_0x30b3fe)[_0x300b('0xb')](function(_0x457aa3){logger['info'](_0x300b('0xc'),_0x5dabb9,_0x300b('0xd'));logger[_0x300b('0xe')](_0x300b('0xf'),_0x5dabb9,'request\x20sent',JSON[_0x300b('0x10')](_0x457aa3));if(_0x457aa3[_0x300b('0x11')]){if(_0x457aa3[_0x300b('0x11')]['code']===0x1f4){logger[_0x300b('0x11')](_0x300b('0xc'),_0x5dabb9,_0x457aa3[_0x300b('0x11')][_0x300b('0x12')]);return _0x5e283c(_0x457aa3[_0x300b('0x11')][_0x300b('0x12')]);}logger[_0x300b('0x11')](_0x300b('0xc'),_0x5dabb9,_0x457aa3['error']['message']);return _0x590c4d(_0x457aa3['error']['message']);}else{logger[_0x300b('0x13')](_0x300b('0xc'),_0x5dabb9,_0x300b('0xd'));_0x590c4d(_0x457aa3[_0x300b('0x14')]['message']);}})['catch'](function(_0x35b1d7){logger[_0x300b('0x11')](_0x300b('0xc'),_0x5dabb9,_0x35b1d7);_0x5e283c(_0x35b1d7);});});}exports[_0x300b('0x15')]=function(_0x4d2024){var _0x1fbf16=this;return new Promise(function(_0x2a7d96,_0xb4b3fa){return db['Attachment'][_0x300b('0x16')](_0x4d2024[_0x300b('0x17')],{'raw':_0x4d2024[_0x300b('0x18')]?_0x4d2024[_0x300b('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x300b('0xb')](function(_0x16bfc6){logger[_0x300b('0x13')]('CreateAttachment',_0x4d2024);logger[_0x300b('0xe')](_0x300b('0x15'),_0x4d2024,JSON[_0x300b('0x10')](_0x16bfc6));_0x2a7d96(_0x16bfc6);})[_0x300b('0x19')](function(_0x26913f){logger['error']('CreateAttachment',_0x26913f[_0x300b('0x12')],_0x4d2024);_0xb4b3fa(_0x1fbf16[_0x300b('0x11')](0x1f4,_0x26913f[_0x300b('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 249208f..a00d655 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x318d7c,_0x3e0150){var _0x550dc2=function(_0x592856){while(--_0x592856){_0x318d7c['push'](_0x318d7c['shift']());}};_0x550dc2(++_0x3e0150);}(_0x2032,0xd9));var _0x2203=function(_0x87db3b,_0x8c8cca){_0x87db3b=_0x87db3b-0x0;var _0x3992be=_0x2032[_0x87db3b];return _0x3992be;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
+var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5f66[_0x122096];return _0x3d1966;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index be25b1e..9d3bb68 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 _0x00c9=['Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','role','disabled','online','admin','user','agent','then','name','blocked','blockedAt','add','clearBlockUser','getLicense','catch','status','message','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport-local','activedirectory2','bluebird','util','../../config/utils','../../config/environment','api','activedirectory','undefined','baseDN','url','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured'];(function(_0x54d77d,_0x4d560a){var _0x40eb65=function(_0x531b88){while(--_0x531b88){_0x54d77d['push'](_0x54d77d['shift']());}};_0x40eb65(++_0x4d560a);}(_0x00c9,0x1ce));var _0x900c=function(_0x267210,_0x2e390f){_0x267210=_0x267210-0x0;var _0x5d0893=_0x00c9[_0x267210];return _0x5d0893;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x900c('0x0'))['Strategy'];var moment=require('moment');var ActiveDirectory=require(_0x900c('0x1'));var BPromise=require(_0x900c('0x2'));var util=require(_0x900c('0x3'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x900c('0x4'));var config=require(_0x900c('0x5'));var logger=require('../../config/logger')(_0x900c('0x6'));function isActiveDirectoryConfigured(_0x583c9f){var _0x5e3d50=![];if(typeof _0x583c9f[_0x900c('0x7')]!==_0x900c('0x8')){_0x5e3d50=_0x583c9f[_0x900c('0x7')][_0x900c('0x9')]&&_0x583c9f[_0x900c('0x7')][_0x900c('0xa')]&&_0x583c9f[_0x900c('0x7')][_0x900c('0xb')];}return _0x5e3d50;}function adAuthenticate(_0xcdca3,_0x40d978,_0x3937ca){return new BPromise(function(_0x583622,_0x11faa1){try{var _0xa9483c=new ActiveDirectory(_0xcdca3);_0xa9483c['authenticate'](_0x40d978,_0x3937ca,function(_0x318899,_0x4afa4a){if(_0x318899){logger[_0x900c('0xc')](_0x900c('0xd'),_0x40d978,util[_0x900c('0xe')](_0x318899,{'showHidden':![],'depth':null}));_0x11faa1('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x4afa4a){logger[_0x900c('0xc')](_0x900c('0xf'),_0x40d978);_0x11faa1(_0x900c('0x10'));}else{_0x583622(_0x4afa4a);}});}catch(_0xf927ef){_0x11faa1(_0xf927ef);}});}function ActiveDirectoryAuthenticate(_0x491197,_0x47382e,_0x49995d,_0x467c45){var _0x4c337d,_0x220fad;if(!isActiveDirectoryConfigured(config)){logger[_0x900c('0xc')](_0x900c('0x11'),_0x47382e);return _0x467c45(null,![],{'message':_0x900c('0x10')});}return db[_0x900c('0x12')][_0x900c('0x13')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x900c('0x14')],'raw':!![]})['then'](function(_0xb31eca){_0x4c337d=_0xb31eca;if(!_0x4c337d[_0x900c('0x15')]){logger[_0x900c('0xc')](_0x900c('0x16'),_0x47382e);throw new Error(_0x900c('0x10'));}return _0x491197[_0x900c('0x13')]({'logging':!![],'attributes':['id','name',_0x900c('0x17'),_0x900c('0x18'),_0x900c('0x19'),_0x900c('0x1a'),'blocked','blockedAt',_0x900c('0x1b')],'where':{'name':_0x47382e,'role':{'$or':[_0x900c('0x1c'),_0x900c('0x1d'),_0x900c('0x1e')]},'adSsoEnabled':!![]}});})[_0x900c('0x1f')](function(_0x8c2fa0){if(!_0x8c2fa0||_0x8c2fa0&&_0x8c2fa0[_0x900c('0x20')]!==_0x47382e){throw new Error(_0x900c('0x10'));}_0x220fad=_0x8c2fa0;var _0x5574ca=_0x220fad[_0x900c('0x20')]+'@'+config[_0x900c('0x7')][_0x900c('0xb')];return adAuthenticate(config[_0x900c('0x7')],_0x5574ca,_0x49995d);})[_0x900c('0x1f')](function(_0x2360e9){if(_0x220fad[_0x900c('0x1a')]){throw new Error(_0x900c('0x10'));}if(_0x4c337d[_0x900c('0x14')]>0x0){if(_0x220fad[_0x900c('0x21')]){if(moment(_0x220fad[_0x900c('0x22')])[_0x900c('0x23')](_0x4c337d[_0x900c('0x14')],'minutes')>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x900c('0x24')](_0x220fad,0x0,![],null)[_0x900c('0x1f')](function(){return utils[_0x900c('0x25')](_0x220fad);})[_0x900c('0x1f')](function(){return _0x467c45(null,_0x220fad);});}else{return utils[_0x900c('0x25')](_0x220fad)[_0x900c('0x1f')](function(){return _0x467c45(null,_0x220fad);});}}else{return utils['getLicense'](_0x220fad)[_0x900c('0x1f')](function(){return _0x467c45(null,_0x220fad);});}})[_0x900c('0x26')](function(_0x31489c){return _0x467c45(null,![],_0x31489c);});}function handleError(_0x222ca0,_0x57752f,_0x39702e){return _0x222ca0[_0x900c('0x27')](_0x57752f||0x1f4)['send']({'message':_0x39702e?_0x39702e[_0x900c('0x28')]||_0x39702e:''});}exports['login']=function(_0x2733c7,_0x5030a6,_0x27f63c){passport[_0x900c('0x29')](_0x900c('0x2a'),function(_0x1304cc,_0x16e668,_0x2a430b){var _0x2a667=_0x1304cc||_0x2a430b;if(_0x2a667){return handleError(_0x5030a6,0x191,_0x2a667);}if(!_0x16e668){return handleError(_0x5030a6,0x194,{'message':_0x900c('0x2b')});}else{var _0x4209d8={'payload':{'id':_0x16e668['id'],'role':_0x16e668[_0x900c('0x19')]},'options':{'expiresIn':0x15180}};return authService[_0x900c('0x2c')](_0x4209d8)[_0x900c('0x1f')](function(_0x56e7d8){_0x5030a6[_0x900c('0x2d')]({'id':_0x16e668['id'],'token':_0x56e7d8,'statusCall':'','isAlreadyLogged':_0x16e668[_0x900c('0x1b')]});});}})(_0x2733c7,_0x5030a6,_0x27f63c);};passport[_0x900c('0x2e')](_0x900c('0x2a'),new LocalStrategy({'usernameField':_0x900c('0x20'),'passwordField':'password'},function(_0x512400,_0x5b245f,_0x417ff1){return ActiveDirectoryAuthenticate(db[_0x900c('0x2f')],_0x512400,_0x5b245f,_0x417ff1);}));
\ No newline at end of file
+var _0xa793=['domain','authenticate','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','adSsoEnabled','blockDuration','then','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','salt','role','disabled','blockedAt','online','admin','user','agent','blocked','add','clearBlockUser','getLicense','status','send','message','ad-login','json','use','User','passport-local','moment','activedirectory2','bluebird','util','../../mysqldb','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url'];(function(_0x398a18,_0xe73c44){var _0x388956=function(_0x44ff0d){while(--_0x44ff0d){_0x398a18['push'](_0x398a18['shift']());}};_0x388956(++_0xe73c44);}(_0xa793,0x101));var _0x3a79=function(_0x5a6961,_0xd41ca6){_0x5a6961=_0x5a6961-0x0;var _0x4af0a6=_0xa793[_0x5a6961];return _0x4af0a6;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x3a79('0x0'))['Strategy'];var moment=require(_0x3a79('0x1'));var ActiveDirectory=require(_0x3a79('0x2'));var BPromise=require(_0x3a79('0x3'));var util=require(_0x3a79('0x4'));var db=require(_0x3a79('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var config=require(_0x3a79('0x6'));var logger=require(_0x3a79('0x7'))(_0x3a79('0x8'));function isActiveDirectoryConfigured(_0x4f472c){var _0x1b85e7=![];if(typeof _0x4f472c[_0x3a79('0x9')]!==_0x3a79('0xa')){_0x1b85e7=_0x4f472c[_0x3a79('0x9')][_0x3a79('0xb')]&&_0x4f472c['activedirectory'][_0x3a79('0xc')]&&_0x4f472c[_0x3a79('0x9')][_0x3a79('0xd')];}return _0x1b85e7;}function adAuthenticate(_0xba653a,_0x2759eb,_0x110ed9){return new BPromise(function(_0x2eb752,_0x53875c){try{var _0x190095=new ActiveDirectory(_0xba653a);_0x190095[_0x3a79('0xe')](_0x2759eb,_0x110ed9,function(_0x1c318a,_0x2aa4d8){if(_0x1c318a){logger['error'](_0x3a79('0xf'),_0x2759eb,util['inspect'](_0x1c318a,{'showHidden':![],'depth':null}));_0x53875c(_0x3a79('0x10'));}else if(!_0x2aa4d8){logger['error'](_0x3a79('0x11'),_0x2759eb);_0x53875c(_0x3a79('0x10'));}else{_0x2eb752(_0x2aa4d8);}});}catch(_0x4b5214){_0x53875c(_0x4b5214);}});}function ActiveDirectoryAuthenticate(_0x2c3081,_0x1e68f2,_0x173c7e,_0x303e70){var _0xaff34d,_0x317a25;if(!isActiveDirectoryConfigured(config)){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x1e68f2);return _0x303e70(null,![],{'message':_0x3a79('0x10')});}return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x3a79('0x12'),_0x3a79('0x13')],'raw':!![]})[_0x3a79('0x14')](function(_0x4747eb){_0xaff34d=_0x4747eb;if(!_0xaff34d[_0x3a79('0x12')]){logger[_0x3a79('0x15')](_0x3a79('0x16'),_0x1e68f2);throw new Error(_0x3a79('0x10'));}return _0x2c3081[_0x3a79('0x17')]({'logging':!![],'attributes':['id',_0x3a79('0x18'),_0x3a79('0x19'),_0x3a79('0x1a'),_0x3a79('0x1b'),_0x3a79('0x1c'),'blocked',_0x3a79('0x1d'),_0x3a79('0x1e')],'where':{'name':_0x1e68f2,'role':{'$or':[_0x3a79('0x1f'),_0x3a79('0x20'),_0x3a79('0x21')]},'adSsoEnabled':!![]}});})['then'](function(_0x1da20a){if(!_0x1da20a||_0x1da20a&&_0x1da20a['name']!==_0x1e68f2){throw new Error(_0x3a79('0x10'));}_0x317a25=_0x1da20a;var _0x37936f=_0x317a25[_0x3a79('0x18')]+'@'+config['activedirectory'][_0x3a79('0xd')];return adAuthenticate(config['activedirectory'],_0x37936f,_0x173c7e);})['then'](function(_0x5d0c0d){if(_0x317a25[_0x3a79('0x1c')]){throw new Error(_0x3a79('0x10'));}if(_0xaff34d[_0x3a79('0x13')]>0x0){if(_0x317a25[_0x3a79('0x22')]){if(moment(_0x317a25[_0x3a79('0x1d')])[_0x3a79('0x23')](_0xaff34d[_0x3a79('0x13')],'minutes')>moment()){throw new Error(_0x3a79('0x10'));}return utils[_0x3a79('0x24')](_0x317a25,0x0,![],null)[_0x3a79('0x14')](function(){return utils[_0x3a79('0x25')](_0x317a25);})[_0x3a79('0x14')](function(){return _0x303e70(null,_0x317a25);});}else{return utils[_0x3a79('0x25')](_0x317a25)['then'](function(){return _0x303e70(null,_0x317a25);});}}else{return utils[_0x3a79('0x25')](_0x317a25)[_0x3a79('0x14')](function(){return _0x303e70(null,_0x317a25);});}})['catch'](function(_0x2c47e6){return _0x303e70(null,![],_0x2c47e6);});}function handleError(_0x2d1476,_0x145054,_0x3a1a50){return _0x2d1476[_0x3a79('0x26')](_0x145054||0x1f4)[_0x3a79('0x27')]({'message':_0x3a1a50?_0x3a1a50[_0x3a79('0x28')]||_0x3a1a50:''});}exports['login']=function(_0x535d53,_0x225669,_0x231c0e){passport[_0x3a79('0xe')](_0x3a79('0x29'),function(_0xfb7024,_0x505b87,_0xf8181b){var _0x3feaed=_0xfb7024||_0xf8181b;if(_0x3feaed){return handleError(_0x225669,0x191,_0x3feaed);}if(!_0x505b87){return handleError(_0x225669,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x525cf2={'payload':{'id':_0x505b87['id'],'role':_0x505b87['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x525cf2)['then'](function(_0x5ef893){_0x225669[_0x3a79('0x2a')]({'id':_0x505b87['id'],'token':_0x5ef893,'statusCall':'','isAlreadyLogged':_0x505b87[_0x3a79('0x1e')]});});}})(_0x535d53,_0x225669,_0x231c0e);};passport[_0x3a79('0x2b')](_0x3a79('0x29'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x55870b,_0x1c85e6,_0x11bc76){return ActiveDirectoryAuthenticate(db[_0x3a79('0x2c')],_0x55870b,_0x1c85e6,_0x11bc76);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index d526f22..5756b3b 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 _0x7de2=['./authActiveDirectory.controller','post','login','exports','express','Router'];(function(_0x523070,_0x403d59){var _0x2475ec=function(_0x54cfdd){while(--_0x54cfdd){_0x523070['push'](_0x523070['shift']());}};_0x2475ec(++_0x403d59);}(_0x7de2,0x1ba));var _0x27de=function(_0x51f0c2,_0x59fc51){_0x51f0c2=_0x51f0c2-0x0;var _0x1f233b=_0x7de2[_0x51f0c2];return _0x1f233b;};'use strict';var express=require(_0x27de('0x0'));var router=express[_0x27de('0x1')]();var controller=require(_0x27de('0x2'));router[_0x27de('0x3')]('/',controller[_0x27de('0x4')]);module[_0x27de('0x5')]=router;
\ No newline at end of file
+var _0x70ae=['Router','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x70ae,0x182));var _0xe70a=function(_0x339854,_0x5cae3f){_0x339854=_0x339854-0x0;var _0x4b10aa=_0x70ae[_0x339854];return _0x4b10aa;};'use strict';var express=require('express');var router=express[_0xe70a('0x0')]();var controller=require('./authActiveDirectory.controller');router[_0xe70a('0x1')]('/',controller['login']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index a9e9f37..0fb0f79 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(_0x33dc2c,_0x358dcc){var _0x4909ac=function(_0x2bc092){while(--_0x2bc092){_0x33dc2c['push'](_0x33dc2c['shift']());}};_0x4909ac(++_0x358dcc);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 _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(_0x50641e,_0x3bc2fe){var _0x426fa1=function(_0x509a53){while(--_0x509a53){_0x50641e['push'](_0x50641e['shift']());}};_0x426fa1(++_0x3bc2fe);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 82a598f..df8c7a6 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 _0xc7e6=['passport','../../components/auth/service','get','login','/callback','isMiddleware','setTokenCookie','express'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc7e6,0x1ef));var _0x6c7e=function(_0x183d0e,_0x1f520f){_0x183d0e=_0x183d0e-0x0;var _0x278ff8=_0xc7e6[_0x183d0e];return _0x278ff8;};'use strict';var express=require(_0x6c7e('0x0'));var passport=require(_0x6c7e('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0x6c7e('0x2'));router[_0x6c7e('0x3')]('/',controller[_0x6c7e('0x4')]);router['get'](_0x6c7e('0x5'),controller['callback'],authService[_0x6c7e('0x6')],userController['login'],authService[_0x6c7e('0x7')]);module['exports']=router;
\ No newline at end of file
+var _0x5294=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get','/callback','isMiddleware','setTokenCookie','exports','express','passport','Router'];(function(_0x39e5a8,_0x367273){var _0x5c9feb=function(_0x5a372e){while(--_0x5a372e){_0x39e5a8['push'](_0x39e5a8['shift']());}};_0x5c9feb(++_0x367273);}(_0x5294,0x111));var _0x4529=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x5294[_0x501510];return _0x1e6ee5;};'use strict';var express=require(_0x4529('0x0'));var passport=require(_0x4529('0x1'));var router=express[_0x4529('0x2')]();var controller=require(_0x4529('0x3'));var userController=require(_0x4529('0x4'));var authService=require(_0x4529('0x5'));router['get']('/',controller[_0x4529('0x6')]);router[_0x4529('0x7')](_0x4529('0x8'),controller['callback'],authService[_0x4529('0x9')],userController[_0x4529('0x6')],authService[_0x4529('0xa')]);module[_0x4529('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 0d2553f..32b573a 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 _0x54ef=['generate','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','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','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','reset','params','token','enforcePasswordHistory','passwordHistoryLimit','securePassword','previousPasswords','resetPasswordToken','Password\x20reset!','use','passport','passport-local','Strategy','randomstring','moment','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','Smtp','CloudProvider','getSmtpOptions','merge','format','email','request','SendMail','error','message','stringify','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x54ef,0x108));var _0xf54e=function(_0x416d6b,_0x5b7d06){_0x416d6b=_0x416d6b-0x0;var _0x498e0c=_0x54ef[_0x416d6b];return _0x498e0c;};'use strict';var util=require('util');var passport=require(_0xf54e('0x0'));var LocalStrategy=require(_0xf54e('0x1'))[_0xf54e('0x2')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0xf54e('0x5'));var utils=require(_0xf54e('0x6'));var client=jayson[_0xf54e('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x204062,_0x426aa9,_0x1546e9,_0x2e6f99){var _0x3b99c0,_0x522e6e;return db[_0xf54e('0x8')][_0xf54e('0x9')]({'where':{'id':0x1},'attributes':[_0xf54e('0xa'),_0xf54e('0xb')],'raw':!![]})[_0xf54e('0xc')](function(_0x8061ee){_0x3b99c0=_0x8061ee;return _0x204062['findOne']({'attributes':['id',_0xf54e('0xd'),_0xf54e('0xe'),_0xf54e('0xf'),_0xf54e('0x10'),_0xf54e('0x11'),'blocked',_0xf54e('0x12'),_0xf54e('0x13')],'where':{'name':_0x426aa9,'role':{'$or':[_0xf54e('0x14'),_0xf54e('0x15'),'agent']}}});})['then'](function(_0x1d60d5){if(!_0x1d60d5||_0x1d60d5&&_0x1d60d5['name']!==_0x426aa9){throw new Error(_0xf54e('0x16'));}else{_0x522e6e=_0x1d60d5;return _0x522e6e;}})['then'](function(){_0x522e6e[_0xf54e('0x17')](_0x1546e9,function(_0x4394ca,_0x66917e){var _0x11bde6=_0x522e6e['loginAttempts']+0x1;if(_0x4394ca){return _0x2e6f99(_0x4394ca);}else if(!_0x66917e){if(_0x522e6e[_0xf54e('0x11')]){return _0x2e6f99(null,![],{'message':_0xf54e('0x16')});}else if(_0x3b99c0[_0xf54e('0xa')]>0x0){if(_0x522e6e[_0xf54e('0x18')]){if(_0x3b99c0[_0xf54e('0xb')]>0x0){if(moment(_0x522e6e[_0xf54e('0x12')])[_0xf54e('0x19')](_0x3b99c0['blockDuration'],_0xf54e('0x1a'))>moment()){return _0x2e6f99(null,![],{'message':_0xf54e('0x16')});}else{return utils['clearBlockUser'](_0x522e6e,_0x11bde6,![],null)[_0xf54e('0xc')](function(){return _0x2e6f99(null,![],{'message':_0xf54e('0x16')});});}}else{return _0x2e6f99(null,![],{'message':_0xf54e('0x16')});}}else{if(_0x11bde6>=_0x3b99c0[_0xf54e('0xa')]){return utils[_0xf54e('0x1b')](_0x522e6e,0x0,!![],moment())[_0xf54e('0xc')](function(){return _0x2e6f99(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x522e6e,_0x11bde6,![],null)[_0xf54e('0xc')](function(){return _0x2e6f99(null,![],{'message':_0xf54e('0x16')});});}}}else{return _0x2e6f99(null,![],{'message':_0xf54e('0x16')});}}else{if(_0x522e6e[_0xf54e('0x11')]){return _0x2e6f99(null,![],{'message':_0xf54e('0x16')});}else if(_0x3b99c0[_0xf54e('0xa')]>0x0){if(_0x522e6e[_0xf54e('0x18')]){if(_0x3b99c0[_0xf54e('0xb')]>0x0){if(moment(_0x522e6e[_0xf54e('0x12')])[_0xf54e('0x19')](_0x3b99c0[_0xf54e('0xb')],_0xf54e('0x1a'))>moment()){return _0x2e6f99(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xf54e('0x1b')](_0x522e6e,0x0,![],null)[_0xf54e('0xc')](function(){return utils[_0xf54e('0x1c')](_0x522e6e);})[_0xf54e('0xc')](function(){return _0x2e6f99(null,_0x522e6e);});}}else{return _0x2e6f99(null,![],{'message':_0xf54e('0x16')});}}else{return utils['clearBlockUser'](_0x522e6e,0x0,![],null)[_0xf54e('0xc')](function(){return utils['getLicense'](_0x522e6e);})[_0xf54e('0xc')](function(){return _0x2e6f99(null,_0x522e6e);})[_0xf54e('0x1d')](function(_0x181c1a){return _0x2e6f99(null,![],_0x181c1a);});}}else{if(_0x522e6e[_0xf54e('0x18')]){return _0x2e6f99(null,![],{'message':_0xf54e('0x16')});}else{return utils[_0xf54e('0x1c')](_0x522e6e)[_0xf54e('0xc')](function(){return _0x2e6f99(null,_0x522e6e);});}}}});})[_0xf54e('0x1d')](function(_0x25f762){return _0x2e6f99(null,![],_0x25f762);});}function sendServiceMail(_0x24991b){return db[_0xf54e('0x1e')][_0xf54e('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xf54e('0xd'),'email'],'include':[{'model':db['MailServerOut'],'as':_0xf54e('0x20'),'include':[{'model':db[_0xf54e('0x21')],'as':'CloudProvider'}]}]})['then'](function(_0x1c6587){if(!_0x1c6587){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5b8088=_0x1c6587[_0xf54e('0x22')]();var _0x8dc62e={'account':_0x5b8088,'message':_[_0xf54e('0x23')]({'from':util[_0xf54e('0x24')]('\x22%s\x22\x20<%s>',_0x1c6587['name'],_0x1c6587[_0xf54e('0x25')]||_0x1c6587['Smtp'][_0xf54e('0x15')])},_0x24991b)};return client[_0xf54e('0x26')](_0xf54e('0x27'),_0x8dc62e);})[_0xf54e('0xc')](function(_0x12982f){if(_0x12982f[_0xf54e('0x28')]){throw new Error(util[_0xf54e('0x24')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x12982f['error'][_0xf54e('0x29')]||JSON[_0xf54e('0x2a')](_0x12982f[_0xf54e('0x28')])));}return!![];});}function handleError(_0x2576ce,_0x4a3a6a,_0x4bd2d5){return _0x2576ce['status'](_0x4a3a6a||0x1f4)[_0xf54e('0x2b')]({'message':_0x4bd2d5?_0x4bd2d5[_0xf54e('0x29')]||_0x4bd2d5:''});}exports[_0xf54e('0x2c')]=function(_0x226a72,_0x1ba218,_0x31b6df){passport['authenticate'](_0xf54e('0x2d'),function(_0x2813c4,_0x48324c,_0x22450d){var _0x3c4f6d=_0x2813c4||_0x22450d;if(_0x3c4f6d){return handleError(_0x1ba218,0x191,_0x3c4f6d);}if(!_0x48324c){return handleError(_0x1ba218,0x194,{'message':_0xf54e('0x2e')});}else{var _0x188cdc={'payload':{'id':_0x48324c['id'],'role':_0x48324c[_0xf54e('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0xf54e('0x2f')](_0x188cdc)[_0xf54e('0xc')](function(_0x289c67){_0x1ba218[_0xf54e('0x30')]({'id':_0x48324c['id'],'token':_0x289c67,'statusCall':'','isAlreadyLogged':_0x48324c['online']});});}})(_0x226a72,_0x1ba218,_0x31b6df);};exports[_0xf54e('0x31')]=function(_0x240038,_0x1c7a41){if(!_0x240038[_0xf54e('0x32')]['email']){return handleError(_0x1c7a41,0x1f4,{'message':_0xf54e('0x33')});}var _0x7f6b89=rs[_0xf54e('0x34')]();_0x240038['body'][_0xf54e('0x25')]=_0x240038['body']['email'][_0xf54e('0x35')]()[_0xf54e('0x36')]();var _0x4aeadd;return db['Setting'][_0xf54e('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf54e('0xb')],'raw':!![]})[_0xf54e('0xc')](function(_0x2b17a1){_0x4aeadd=_0x2b17a1;return db[_0xf54e('0x37')][_0xf54e('0x1f')]({'where':{'email':_0x240038[_0xf54e('0x32')][_0xf54e('0x25')]}});})['then'](function(_0x181ec7){if(!_0x181ec7){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x181ec7[_0xf54e('0x11')]){throw new Error(_0xf54e('0x38'));}if(_0x181ec7[_0xf54e('0x18')]){if(moment(_0x181ec7[_0xf54e('0x12')])[_0xf54e('0x19')](_0x4aeadd[_0xf54e('0xb')],_0xf54e('0x1a'))>moment()){throw new Error(_0xf54e('0x39'));}else{_0x181ec7[_0xf54e('0x18')]=![];_0x181ec7[_0xf54e('0x12')]=null;}}_0x181ec7['resetPasswordToken']=_0x7f6b89;_0x181ec7[_0xf54e('0x3a')]=Date[_0xf54e('0x3b')]()+0x36ee80;return _0x181ec7['save']();})[_0xf54e('0xc')](function(){return sendServiceMail({'to':_0x240038[_0xf54e('0x32')][_0xf54e('0x25')],'subject':_0xf54e('0x3c'),'text':_0xf54e('0x3d')+_0xf54e('0x3e')+_0xf54e('0x3f')+_0x240038[_0xf54e('0x40')][_0xf54e('0x41')]+_0xf54e('0x42')+_0x7f6b89+'\x0a\x0a'+_0xf54e('0x43')});})['then'](function(){_0x1c7a41[_0xf54e('0x44')](0xc8)[_0xf54e('0x2b')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x2bd0d3){return handleError(_0x1c7a41,0x1f4,_0x2bd0d3);});};exports[_0xf54e('0x45')]=function(_0x50a04c,_0x23ec5b){return db[_0xf54e('0x37')][_0xf54e('0x1f')]({'where':{'resetPasswordToken':_0x50a04c[_0xf54e('0x46')][_0xf54e('0x47')],'resetPasswordExpires':{'$gt':Date[_0xf54e('0x3b')]()}}})[_0xf54e('0xc')](function(_0x112280){if(!_0x112280){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xf54e('0x8')]['findOne']({'attributes':['id','securePassword',_0xf54e('0x48'),_0xf54e('0x49')]})[_0xf54e('0xc')](function(_0x381503){if(_0x381503[_0xf54e('0x4a')])authService['validatePasswordPattern'](_0x50a04c[_0xf54e('0x32')][_0xf54e('0xe')]);if(!_0x381503[_0xf54e('0x48')]||!_0x112280['previousPasswords'])return _0x112280;authService['validatePasswordHistory'](_0x50a04c[_0xf54e('0x32')][_0xf54e('0xe')],_0x112280[_0xf54e('0x4b')],_0x381503[_0xf54e('0x49')]);return _0x112280;})[_0xf54e('0xc')](function(){_0x112280[_0xf54e('0xe')]=_0x50a04c[_0xf54e('0x32')][_0xf54e('0xe')];_0x112280[_0xf54e('0x4c')]=null;_0x112280[_0xf54e('0x3a')]=null;return _0x112280['save']();});})[_0xf54e('0xc')](function(){_0x23ec5b[_0xf54e('0x44')](0xc8)[_0xf54e('0x2b')]({'message':_0xf54e('0x4d')});})[_0xf54e('0x1d')](function(_0x59d538){return handleError(_0x23ec5b,0x1f4,_0x59d538);});};passport[_0xf54e('0x4e')](_0xf54e('0x2d'),new LocalStrategy({'usernameField':_0xf54e('0xd'),'passwordField':_0xf54e('0xe')},function(_0x1fe037,_0x77fd08,_0x32451b){return localAuthenticate(db['User'],_0x1fe037,_0x77fd08,_0x32451b);}));
\ No newline at end of file
+var _0x1915=['minutes','clearBlockUser','getLicense','catch','MailAccount','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','body','Email\x20parameter\x20is\x20missing','generate','email','trim','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','resetPasswordExpires','Password\x20reset!','util','passport','passport-local','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','password','salt','role','disabled','blockedAt','loginAttempts','admin','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','authenticate','blocked','add'];(function(_0x6489f3,_0x4f479c){var _0x5583f5=function(_0x1fbfe5){while(--_0x1fbfe5){_0x6489f3['push'](_0x6489f3['shift']());}};_0x5583f5(++_0x4f479c);}(_0x1915,0xd8));var _0x5191=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x1915[_0x40a045];return _0x1a687c;};'use strict';var util=require(_0x5191('0x0'));var passport=require(_0x5191('0x1'));var LocalStrategy=require(_0x5191('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0x5191('0x3'));var rs=require('randomstring');var moment=require(_0x5191('0x4'));var db=require(_0x5191('0x5'))['db'];var authService=require(_0x5191('0x6'));var utils=require(_0x5191('0x7'));var client=jayson['client'][_0x5191('0x8')]({'port':0x232b});function localAuthenticate(_0x13eec1,_0x48af03,_0x2b3e3b,_0x31afe5){var _0x5ead24,_0x10b972;return db[_0x5191('0x9')][_0x5191('0xa')]({'where':{'id':0x1},'attributes':[_0x5191('0xb'),_0x5191('0xc')],'raw':!![]})['then'](function(_0x30cb3d){_0x5ead24=_0x30cb3d;return _0x13eec1[_0x5191('0xa')]({'attributes':['id','name',_0x5191('0xd'),_0x5191('0xe'),_0x5191('0xf'),_0x5191('0x10'),'blocked',_0x5191('0x11'),_0x5191('0x12')],'where':{'name':_0x48af03,'role':{'$or':[_0x5191('0x13'),'user',_0x5191('0x14')]}}});})['then'](function(_0x39b916){if(!_0x39b916||_0x39b916&&_0x39b916[_0x5191('0x15')]!==_0x48af03){throw new Error(_0x5191('0x16'));}else{_0x10b972=_0x39b916;return _0x10b972;}})[_0x5191('0x17')](function(){_0x10b972[_0x5191('0x18')](_0x2b3e3b,function(_0x41ecbb,_0x4ef982){var _0x5d2452=_0x10b972[_0x5191('0x12')]+0x1;if(_0x41ecbb){return _0x31afe5(_0x41ecbb);}else if(!_0x4ef982){if(_0x10b972[_0x5191('0x10')]){return _0x31afe5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x5ead24[_0x5191('0xb')]>0x0){if(_0x10b972[_0x5191('0x19')]){if(_0x5ead24[_0x5191('0xc')]>0x0){if(moment(_0x10b972['blockedAt'])[_0x5191('0x1a')](_0x5ead24[_0x5191('0xc')],_0x5191('0x1b'))>moment()){return _0x31afe5(null,![],{'message':_0x5191('0x16')});}else{return utils[_0x5191('0x1c')](_0x10b972,_0x5d2452,![],null)[_0x5191('0x17')](function(){return _0x31afe5(null,![],{'message':_0x5191('0x16')});});}}else{return _0x31afe5(null,![],{'message':_0x5191('0x16')});}}else{if(_0x5d2452>=_0x5ead24['allowedLoginAttempts']){return utils[_0x5191('0x1c')](_0x10b972,0x0,!![],moment())[_0x5191('0x17')](function(){return _0x31afe5(null,![],{'message':_0x5191('0x16')});});}else{return utils[_0x5191('0x1c')](_0x10b972,_0x5d2452,![],null)[_0x5191('0x17')](function(){return _0x31afe5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x31afe5(null,![],{'message':_0x5191('0x16')});}}else{if(_0x10b972[_0x5191('0x10')]){return _0x31afe5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x5ead24[_0x5191('0xb')]>0x0){if(_0x10b972[_0x5191('0x19')]){if(_0x5ead24[_0x5191('0xc')]>0x0){if(moment(_0x10b972[_0x5191('0x11')])[_0x5191('0x1a')](_0x5ead24[_0x5191('0xc')],_0x5191('0x1b'))>moment()){return _0x31afe5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x5191('0x1c')](_0x10b972,0x0,![],null)[_0x5191('0x17')](function(){return utils[_0x5191('0x1d')](_0x10b972);})[_0x5191('0x17')](function(){return _0x31afe5(null,_0x10b972);});}}else{return _0x31afe5(null,![],{'message':_0x5191('0x16')});}}else{return utils[_0x5191('0x1c')](_0x10b972,0x0,![],null)['then'](function(){return utils[_0x5191('0x1d')](_0x10b972);})[_0x5191('0x17')](function(){return _0x31afe5(null,_0x10b972);})[_0x5191('0x1e')](function(_0xd9066e){return _0x31afe5(null,![],_0xd9066e);});}}else{if(_0x10b972[_0x5191('0x19')]){return _0x31afe5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x10b972)[_0x5191('0x17')](function(){return _0x31afe5(null,_0x10b972);});}}}});})[_0x5191('0x1e')](function(_0x15985a){return _0x31afe5(null,![],_0x15985a);});}function sendServiceMail(_0x14b05c){return db[_0x5191('0x1f')]['find']({'where':{'service':!![]},'attributes':['id',_0x5191('0x15'),'email'],'include':[{'model':db[_0x5191('0x20')],'as':_0x5191('0x21'),'include':[{'model':db[_0x5191('0x22')],'as':_0x5191('0x22')}]}]})['then'](function(_0x5933e6){if(!_0x5933e6){throw new Error(_0x5191('0x23'));}var _0x44f57e=_0x5933e6[_0x5191('0x24')]();var _0x38e72c={'account':_0x44f57e,'message':_[_0x5191('0x25')]({'from':util[_0x5191('0x26')]('\x22%s\x22\x20<%s>',_0x5933e6[_0x5191('0x15')],_0x5933e6['email']||_0x5933e6[_0x5191('0x21')][_0x5191('0x27')])},_0x14b05c)};return client[_0x5191('0x28')](_0x5191('0x29'),_0x38e72c);})[_0x5191('0x17')](function(_0x286f15){if(_0x286f15[_0x5191('0x2a')]){throw new Error(util['format'](_0x5191('0x2b'),_0x286f15[_0x5191('0x2a')][_0x5191('0x2c')]||JSON['stringify'](_0x286f15[_0x5191('0x2a')])));}return!![];});}function handleError(_0x358817,_0x5488e8,_0x518c8d){return _0x358817[_0x5191('0x2d')](_0x5488e8||0x1f4)[_0x5191('0x2e')]({'message':_0x518c8d?_0x518c8d[_0x5191('0x2c')]||_0x518c8d:''});}exports[_0x5191('0x2f')]=function(_0x5f49a8,_0x55f8f3,_0x2a04c3){passport[_0x5191('0x18')](_0x5191('0x30'),function(_0x56c4bf,_0x13fa40,_0x28196a){var _0x4ba50f=_0x56c4bf||_0x28196a;if(_0x4ba50f){return handleError(_0x55f8f3,0x191,_0x4ba50f);}if(!_0x13fa40){return handleError(_0x55f8f3,0x194,{'message':_0x5191('0x31')});}else{var _0x2291ff={'payload':{'id':_0x13fa40['id'],'role':_0x13fa40[_0x5191('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x5191('0x32')](_0x2291ff)[_0x5191('0x17')](function(_0x2adba0){_0x55f8f3[_0x5191('0x33')]({'id':_0x13fa40['id'],'token':_0x2adba0,'statusCall':'','isAlreadyLogged':_0x13fa40['online']});});}})(_0x5f49a8,_0x55f8f3,_0x2a04c3);};exports['forgot']=function(_0x200c67,_0x243a8d){if(!_0x200c67[_0x5191('0x34')]['email']){return handleError(_0x243a8d,0x1f4,{'message':_0x5191('0x35')});}var _0x7d4ac3=rs[_0x5191('0x36')]();_0x200c67[_0x5191('0x34')][_0x5191('0x37')]=_0x200c67[_0x5191('0x34')][_0x5191('0x37')][_0x5191('0x38')]()['toLowerCase']();var _0x39d0d3;return db[_0x5191('0x9')][_0x5191('0xa')]({'where':{'id':0x1},'attributes':[_0x5191('0xb'),_0x5191('0xc')],'raw':!![]})['then'](function(_0x5e8c8b){_0x39d0d3=_0x5e8c8b;return db[_0x5191('0x39')][_0x5191('0x3a')]({'where':{'email':_0x200c67[_0x5191('0x34')][_0x5191('0x37')]}});})[_0x5191('0x17')](function(_0x13d10a){if(!_0x13d10a){throw new Error(_0x5191('0x3b'));}if(_0x13d10a[_0x5191('0x10')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x13d10a[_0x5191('0x19')]){if(moment(_0x13d10a[_0x5191('0x11')])[_0x5191('0x1a')](_0x39d0d3[_0x5191('0xc')],'minutes')>moment()){throw new Error(_0x5191('0x3c'));}else{_0x13d10a[_0x5191('0x19')]=![];_0x13d10a[_0x5191('0x11')]=null;}}_0x13d10a[_0x5191('0x3d')]=_0x7d4ac3;_0x13d10a['resetPasswordExpires']=Date[_0x5191('0x3e')]()+0x36ee80;return _0x13d10a[_0x5191('0x3f')]();})[_0x5191('0x17')](function(){return sendServiceMail({'to':_0x200c67[_0x5191('0x34')][_0x5191('0x37')],'subject':_0x5191('0x40'),'text':_0x5191('0x41')+_0x5191('0x42')+_0x5191('0x43')+_0x200c67[_0x5191('0x44')][_0x5191('0x45')]+_0x5191('0x46')+_0x7d4ac3+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x5191('0x17')](function(){_0x243a8d[_0x5191('0x2d')](0xc8)[_0x5191('0x2e')]({'message':'Reset\x20Email\x20sent!'});})[_0x5191('0x1e')](function(_0x122c38){return handleError(_0x243a8d,0x1f4,_0x122c38);});};exports['reset']=function(_0x4b3050,_0x2c8e09){return db[_0x5191('0x39')][_0x5191('0x3a')]({'where':{'resetPasswordToken':_0x4b3050[_0x5191('0x47')][_0x5191('0x48')],'resetPasswordExpires':{'$gt':Date[_0x5191('0x3e')]()}}})[_0x5191('0x17')](function(_0x500c5a){if(!_0x500c5a){throw new Error(_0x5191('0x49'));}return db[_0x5191('0x9')][_0x5191('0xa')]({'attributes':['id','securePassword',_0x5191('0x4a'),_0x5191('0x4b')]})[_0x5191('0x17')](function(_0x41459b){if(_0x41459b[_0x5191('0x4c')])authService[_0x5191('0x4d')](_0x4b3050[_0x5191('0x34')]['password']);if(!_0x41459b[_0x5191('0x4a')]||!_0x500c5a['previousPasswords'])return _0x500c5a;authService['validatePasswordHistory'](_0x4b3050[_0x5191('0x34')][_0x5191('0xd')],_0x500c5a[_0x5191('0x4e')],_0x41459b[_0x5191('0x4b')]);return _0x500c5a;})[_0x5191('0x17')](function(){_0x500c5a['password']=_0x4b3050[_0x5191('0x34')][_0x5191('0xd')];_0x500c5a[_0x5191('0x3d')]=null;_0x500c5a[_0x5191('0x4f')]=null;return _0x500c5a[_0x5191('0x3f')]();});})['then'](function(){_0x2c8e09[_0x5191('0x2d')](0xc8)[_0x5191('0x2e')]({'message':_0x5191('0x50')});})[_0x5191('0x1e')](function(_0x232ed5){return handleError(_0x2c8e09,0x1f4,_0x232ed5);});};passport['use'](_0x5191('0x30'),new LocalStrategy({'usernameField':_0x5191('0x15'),'passwordField':_0x5191('0xd')},function(_0x3e31c0,_0xd862bb,_0x3f4fe9){return localAuthenticate(db[_0x5191('0x39')],_0x3e31c0,_0xd862bb,_0x3f4fe9);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 6fc7557..735df69 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 _0x70e7=['exports','express','Router','./authLocal.controller','login','/forgot','forgot','post','reset'];(function(_0x3a4e01,_0x4f6da1){var _0x1390a6=function(_0x433816){while(--_0x433816){_0x3a4e01['push'](_0x3a4e01['shift']());}};_0x1390a6(++_0x4f6da1);}(_0x70e7,0x106));var _0x770e=function(_0x175d24,_0x3c6eec){_0x175d24=_0x175d24-0x0;var _0x3137e3=_0x70e7[_0x175d24];return _0x3137e3;};'use strict';var express=require(_0x770e('0x0'));var router=express[_0x770e('0x1')]();var controller=require(_0x770e('0x2'));router['post']('/',controller[_0x770e('0x3')]);router['post'](_0x770e('0x4'),controller[_0x770e('0x5')]);router[_0x770e('0x6')]('/reset/:token',controller[_0x770e('0x7')]);module[_0x770e('0x8')]=router;
\ No newline at end of file
+var _0xe566=['/forgot','post','reset','exports','Router','./authLocal.controller','login'];(function(_0x46b0ce,_0x16acc7){var _0x295ece=function(_0x2d6194){while(--_0x2d6194){_0x46b0ce['push'](_0x46b0ce['shift']());}};_0x295ece(++_0x16acc7);}(_0xe566,0x82));var _0x6e56=function(_0x5a6e7b,_0x18905f){_0x5a6e7b=_0x5a6e7b-0x0;var _0x4af6ff=_0xe566[_0x5a6e7b];return _0x4af6ff;};'use strict';var express=require('express');var router=express[_0x6e56('0x0')]();var controller=require(_0x6e56('0x1'));router['post']('/',controller[_0x6e56('0x2')]);router['post'](_0x6e56('0x3'),controller['forgot']);router[_0x6e56('0x4')]('/reset/:token',controller[_0x6e56('0x5')]);module[_0x6e56('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index fbce9f3..7fdf4ba 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 _0xe1f0=['sequelize','STRING','BOOLEAN','INTEGER'];(function(_0x34cc90,_0x768579){var _0x3359b9=function(_0x2fd0dd){while(--_0x2fd0dd){_0x34cc90['push'](_0x34cc90['shift']());}};_0x3359b9(++_0x768579);}(_0xe1f0,0x160));var _0x0e1f=function(_0x3735af,_0x4bbb9b){_0x3735af=_0x3735af-0x0;var _0x12cfd9=_0xe1f0[_0x3735af];return _0x12cfd9;};'use strict';var Sequelize=require(_0x0e1f('0x0'));module['exports']={'name':{'type':Sequelize[_0x0e1f('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0e1f('0x1')]},'status':{'type':Sequelize[_0x0e1f('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0e1f('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x5e76=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x329664,_0x130748){var _0x4e346e=function(_0x172b0d){while(--_0x172b0d){_0x329664['push'](_0x329664['shift']());}};_0x4e346e(++_0x130748);}(_0x5e76,0x80));var _0x65e7=function(_0x48bff0,_0x5ec28d){_0x48bff0=_0x48bff0-0x0;var _0x5520c7=_0x5e76[_0x48bff0];return _0x5520c7;};'use strict';var Sequelize=require(_0x65e7('0x0'));module[_0x65e7('0x1')]={'name':{'type':Sequelize[_0x65e7('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x65e7('0x2')]},'description':{'type':Sequelize[_0x65e7('0x2')]},'status':{'type':Sequelize[_0x65e7('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x65e7('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 c06942e..3460c46 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 _0x8aed=['order','sort','where','filter','merge','options','includeAll','include','rows','params','keys','catch','create','body','find','addConditions','Condition','ids','omit','findOne','getConditions','length','nolimit','addActions','getActions','Action','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','index','map','Automation','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields'];(function(_0x205e5a,_0x5c19fb){var _0x10da58=function(_0x1ba35d){while(--_0x1ba35d){_0x205e5a['push'](_0x205e5a['shift']());}};_0x10da58(++_0x5c19fb);}(_0x8aed,0x1b5));var _0xd8ae=function(_0x43d97f,_0x36fec3){_0x43d97f=_0x43d97f-0x0;var _0x490481=_0x8aed[_0x43d97f];return _0x490481;};'use strict';var emlformat=require(_0xd8ae('0x0'));var rimraf=require(_0xd8ae('0x1'));var zipdir=require(_0xd8ae('0x2'));var jsonpatch=require(_0xd8ae('0x3'));var rp=require(_0xd8ae('0x4'));var moment=require(_0xd8ae('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd8ae('0x6'));var util=require(_0xd8ae('0x7'));var path=require(_0xd8ae('0x8'));var sox=require('sox');var csv=require(_0xd8ae('0x9'));var ejs=require(_0xd8ae('0xa'));var fs=require('fs');var fs_extra=require(_0xd8ae('0xb'));var _=require(_0xd8ae('0xc'));var squel=require(_0xd8ae('0xd'));var crypto=require(_0xd8ae('0xe'));var jsforce=require(_0xd8ae('0xf'));var deskjs=require(_0xd8ae('0x10'));var toCsv=require(_0xd8ae('0x9'));var querystring=require('querystring');var Papa=require(_0xd8ae('0x11'));var Redis=require(_0xd8ae('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd8ae('0x13'));var as=require(_0xd8ae('0x14'));var hardwareService=require(_0xd8ae('0x15'));var logger=require('../../config/logger')(_0xd8ae('0x16'));var utils=require(_0xd8ae('0x17'));var config=require(_0xd8ae('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd8ae('0x19'))['db'];function respondWithStatusCode(_0x123676,_0x11ed88){_0x11ed88=_0x11ed88||0xcc;return function(_0xb85d1d){if(_0xb85d1d){return _0x123676[_0xd8ae('0x1a')](_0x11ed88);}return _0x123676['status'](_0x11ed88)[_0xd8ae('0x1b')]();};}function respondWithResult(_0x5b97fe,_0x17a12e){_0x17a12e=_0x17a12e||0xc8;return function(_0x1472a2){if(_0x1472a2){return _0x5b97fe[_0xd8ae('0x1c')](_0x17a12e)[_0xd8ae('0x1d')](_0x1472a2);}};}function respondWithFilteredResult(_0x3ca408,_0x3ef5c0){return function(_0x32a8d8){if(_0x32a8d8){var _0xdd9d21=typeof _0x3ef5c0[_0xd8ae('0x1e')]===_0xd8ae('0x1f')&&typeof _0x3ef5c0[_0xd8ae('0x20')]==='undefined';var _0x39119a=_0x32a8d8[_0xd8ae('0x21')];var _0x18a1e2=_0xdd9d21?0x0:_0x3ef5c0['offset'];var _0x5bb641=_0xdd9d21?_0x32a8d8[_0xd8ae('0x21')]:_0x3ef5c0[_0xd8ae('0x1e')]+_0x3ef5c0[_0xd8ae('0x20')];var _0x13cac8;if(_0x5bb641>=_0x39119a){_0x5bb641=_0x39119a;_0x13cac8=0xc8;}else{_0x13cac8=0xce;}_0x3ca408[_0xd8ae('0x1c')](_0x13cac8);return _0x3ca408[_0xd8ae('0x22')]('Content-Range',_0x18a1e2+'-'+_0x5bb641+'/'+_0x39119a)[_0xd8ae('0x1d')](_0x32a8d8);}return null;};}function patchUpdates(_0x3da0f6){return function(_0x2f7d95){try{jsonpatch[_0xd8ae('0x23')](_0x2f7d95,_0x3da0f6,!![]);}catch(_0xae934){return BPromise[_0xd8ae('0x24')](_0xae934);}return _0x2f7d95[_0xd8ae('0x25')]();};}function saveUpdates(_0x435b9e,_0x739129){return function(_0x340c3c){if(_0x340c3c){return _0x340c3c['update'](_0x435b9e)[_0xd8ae('0x26')](function(_0xaa5952){return _0xaa5952;});}return null;};}function removeEntity(_0x38b86c,_0x6ec86e){return function(_0x1118f8){if(_0x1118f8){return _0x1118f8[_0xd8ae('0x27')]()[_0xd8ae('0x26')](function(){_0x38b86c[_0xd8ae('0x1c')](0xcc)[_0xd8ae('0x1b')]();});}};}function handleEntityNotFound(_0x5a1fa7,_0x5461db){return function(_0x39bd63){if(!_0x39bd63){_0x5a1fa7[_0xd8ae('0x1a')](0x194);}return _0x39bd63;};}function handleError(_0x576a89,_0x38d512){_0x38d512=_0x38d512||0x1f4;return function(_0x1b00c1){logger[_0xd8ae('0x28')](_0x1b00c1[_0xd8ae('0x29')]);if(_0x1b00c1[_0xd8ae('0x2a')]){delete _0x1b00c1[_0xd8ae('0x2a')];}_0x576a89['status'](_0x38d512)['send'](_0x1b00c1);};}exports[_0xd8ae('0x2b')]=function(_0x43b409,_0x3d397e){var _0x3349ac={},_0x81250e={},_0x4632c1={'count':0x0,'rows':[]};var _0x238396=_[_0xd8ae('0x2c')](db[_0xd8ae('0x2d')][_0xd8ae('0x2e')],function(_0x9fa33b){return{'name':_0x9fa33b[_0xd8ae('0x2f')],'type':_0x9fa33b[_0xd8ae('0x30')]['key']};});_0x81250e[_0xd8ae('0x31')]=_[_0xd8ae('0x2c')](_0x238396,_0xd8ae('0x2a'));_0x81250e[_0xd8ae('0x32')]=_['keys'](_0x43b409[_0xd8ae('0x32')]);_0x81250e[_0xd8ae('0x33')]=_[_0xd8ae('0x34')](_0x81250e[_0xd8ae('0x31')],_0x81250e['query']);_0x3349ac[_0xd8ae('0x35')]=_['intersection'](_0x81250e[_0xd8ae('0x31')],qs[_0xd8ae('0x36')](_0x43b409[_0xd8ae('0x32')][_0xd8ae('0x36')]));_0x3349ac[_0xd8ae('0x35')]=_0x3349ac[_0xd8ae('0x35')]['length']?_0x3349ac[_0xd8ae('0x35')]:_0x81250e[_0xd8ae('0x31')];if(!_0x43b409['query']['hasOwnProperty']('nolimit')){_0x3349ac[_0xd8ae('0x20')]=qs[_0xd8ae('0x20')](_0x43b409[_0xd8ae('0x32')][_0xd8ae('0x20')]);_0x3349ac['offset']=qs['offset'](_0x43b409['query'][_0xd8ae('0x1e')]);}_0x3349ac[_0xd8ae('0x37')]=qs['sort'](_0x43b409['query'][_0xd8ae('0x38')]);_0x3349ac[_0xd8ae('0x39')]=qs[_0xd8ae('0x33')](_['pick'](_0x43b409[_0xd8ae('0x32')],_0x81250e['filters']),_0x238396);if(_0x43b409[_0xd8ae('0x32')][_0xd8ae('0x3a')]){_0x3349ac[_0xd8ae('0x39')]=_[_0xd8ae('0x3b')](_0x3349ac[_0xd8ae('0x39')],{'$or':_['map'](_0x238396,function(_0x32c761){if(_0x32c761['type']!=='VIRTUAL'){var _0x4aa678={};_0x4aa678[_0x32c761['name']]={'$like':'%'+_0x43b409[_0xd8ae('0x32')][_0xd8ae('0x3a')]+'%'};return _0x4aa678;}})});}_0x3349ac=_[_0xd8ae('0x3b')]({},_0x3349ac,_0x43b409[_0xd8ae('0x3c')]);var _0x385b5f={'where':_0x3349ac[_0xd8ae('0x39')]};return db[_0xd8ae('0x2d')]['count'](_0x385b5f)[_0xd8ae('0x26')](function(_0x3636af){_0x4632c1[_0xd8ae('0x21')]=_0x3636af;if(_0x43b409['query'][_0xd8ae('0x3d')]){_0x3349ac[_0xd8ae('0x3e')]=[{'all':!![]}];}return db[_0xd8ae('0x2d')]['findAll'](_0x3349ac);})[_0xd8ae('0x26')](function(_0x4ba4a8){_0x4632c1[_0xd8ae('0x3f')]=_0x4ba4a8;return _0x4632c1;})['then'](respondWithFilteredResult(_0x3d397e,_0x3349ac))['catch'](handleError(_0x3d397e,null));};exports['show']=function(_0x4d18ef,_0x5dd4c7){var _0x515adf={'raw':![],'where':{'id':_0x4d18ef[_0xd8ae('0x40')]['id']}},_0x2f0418={};_0x2f0418[_0xd8ae('0x31')]=_[_0xd8ae('0x41')](db[_0xd8ae('0x2d')][_0xd8ae('0x2e')]);_0x2f0418[_0xd8ae('0x32')]=_[_0xd8ae('0x41')](_0x4d18ef[_0xd8ae('0x32')]);_0x2f0418['filters']=_[_0xd8ae('0x34')](_0x2f0418[_0xd8ae('0x31')],_0x2f0418[_0xd8ae('0x32')]);_0x515adf[_0xd8ae('0x35')]=_[_0xd8ae('0x34')](_0x2f0418[_0xd8ae('0x31')],qs['fields'](_0x4d18ef[_0xd8ae('0x32')][_0xd8ae('0x36')]));_0x515adf['attributes']=_0x515adf[_0xd8ae('0x35')]['length']?_0x515adf['attributes']:_0x2f0418[_0xd8ae('0x31')];if(_0x4d18ef[_0xd8ae('0x32')][_0xd8ae('0x3d')]){_0x515adf[_0xd8ae('0x3e')]=[{'all':!![]}];}_0x515adf=_['merge']({},_0x515adf,_0x4d18ef[_0xd8ae('0x3c')]);return db['Automation']['find'](_0x515adf)[_0xd8ae('0x26')](handleEntityNotFound(_0x5dd4c7,null))['then'](respondWithResult(_0x5dd4c7,null))[_0xd8ae('0x42')](handleError(_0x5dd4c7,null));};exports[_0xd8ae('0x43')]=function(_0x393dd2,_0x2fae67){return db[_0xd8ae('0x2d')]['create'](_0x393dd2[_0xd8ae('0x44')],{})[_0xd8ae('0x26')](respondWithResult(_0x2fae67,0xc9))[_0xd8ae('0x42')](handleError(_0x2fae67,null));};exports['update']=function(_0x45e001,_0x29722b){if(_0x45e001['body']['id']){delete _0x45e001['body']['id'];}return db['Automation'][_0xd8ae('0x45')]({'where':{'id':_0x45e001[_0xd8ae('0x40')]['id']}})[_0xd8ae('0x26')](handleEntityNotFound(_0x29722b,null))[_0xd8ae('0x26')](saveUpdates(_0x45e001[_0xd8ae('0x44')],null))[_0xd8ae('0x26')](respondWithResult(_0x29722b,null))[_0xd8ae('0x42')](handleError(_0x29722b,null));};exports[_0xd8ae('0x27')]=function(_0x5e5254,_0x1f60c4){return db[_0xd8ae('0x2d')][_0xd8ae('0x45')]({'where':{'id':_0x5e5254[_0xd8ae('0x40')]['id']}})[_0xd8ae('0x26')](handleEntityNotFound(_0x1f60c4,null))[_0xd8ae('0x26')](removeEntity(_0x1f60c4,null))[_0xd8ae('0x42')](handleError(_0x1f60c4,null));};exports[_0xd8ae('0x46')]=function(_0x3484f3,_0x6380fe,_0x23dcd5){return db[_0xd8ae('0x47')][_0xd8ae('0x45')]({'where':{'id':_0x3484f3[_0xd8ae('0x40')]['id']}})[_0xd8ae('0x26')](handleEntityNotFound(_0x6380fe,null))['then'](function(_0x35f23c){if(_0x35f23c){return _0x35f23c[_0xd8ae('0x46')](_0x3484f3[_0xd8ae('0x44')][_0xd8ae('0x48')],_[_0xd8ae('0x49')](_0x3484f3[_0xd8ae('0x44')],[_0xd8ae('0x48'),'id'])||{});}})[_0xd8ae('0x26')](respondWithResult(_0x6380fe,null))[_0xd8ae('0x42')](handleError(_0x6380fe,null));};exports['getConditions']=function(_0x46cd78,_0x424344,_0x232562){var _0x30f57f={};var _0x46217f={};var _0x20930a;var _0x9ee4e9;return db[_0xd8ae('0x2d')][_0xd8ae('0x4a')]({'where':{'id':_0x46cd78[_0xd8ae('0x40')]['id']}})['then'](handleEntityNotFound(_0x424344,null))[_0xd8ae('0x26')](function(_0x54726){if(_0x54726){_0x20930a=_0x54726;_0x46217f[_0xd8ae('0x31')]=_['keys'](db['Condition'][_0xd8ae('0x2e')]);_0x46217f['query']=_[_0xd8ae('0x41')](_0x46cd78['query']);_0x46217f[_0xd8ae('0x33')]=_[_0xd8ae('0x34')](_0x46217f[_0xd8ae('0x31')],_0x46217f['query']);_0x30f57f[_0xd8ae('0x35')]=_['intersection'](_0x46217f['model'],qs[_0xd8ae('0x36')](_0x46cd78[_0xd8ae('0x32')][_0xd8ae('0x36')]));_0x30f57f[_0xd8ae('0x35')]=_0x30f57f['attributes']['length']?_0x30f57f[_0xd8ae('0x35')]:_0x46217f['model'];_0x30f57f[_0xd8ae('0x37')]=qs[_0xd8ae('0x38')](_0x46cd78['query']['sort']);_0x30f57f[_0xd8ae('0x39')]=qs[_0xd8ae('0x33')](_['pick'](_0x46cd78['query'],_0x46217f[_0xd8ae('0x33')]));if(_0x46cd78[_0xd8ae('0x32')][_0xd8ae('0x3a')]){_0x30f57f['where']=_[_0xd8ae('0x3b')](_0x30f57f[_0xd8ae('0x39')],{'$or':_[_0xd8ae('0x2c')](_0x30f57f[_0xd8ae('0x35')],function(_0x153d5f){var _0x1eaaf1={};_0x1eaaf1[_0x153d5f]={'$like':'%'+_0x46cd78[_0xd8ae('0x32')]['filter']+'%'};return _0x1eaaf1;})});}_0x30f57f=_['merge']({},_0x30f57f,_0x46cd78[_0xd8ae('0x3c')]);return _0x20930a[_0xd8ae('0x4b')](_0x30f57f);}})[_0xd8ae('0x26')](function(_0x131d69){if(_0x131d69){_0x9ee4e9=_0x131d69[_0xd8ae('0x4c')];if(!_0x46cd78['query']['hasOwnProperty'](_0xd8ae('0x4d'))){_0x30f57f[_0xd8ae('0x20')]=qs[_0xd8ae('0x20')](_0x46cd78[_0xd8ae('0x32')][_0xd8ae('0x20')]);_0x30f57f[_0xd8ae('0x1e')]=qs[_0xd8ae('0x1e')](_0x46cd78[_0xd8ae('0x32')][_0xd8ae('0x1e')]);}return _0x20930a[_0xd8ae('0x4b')](_0x30f57f);}})[_0xd8ae('0x26')](function(_0xda44c1){if(_0xda44c1){return _0xda44c1?{'count':_0x9ee4e9,'rows':_0xda44c1}:null;}})[_0xd8ae('0x26')](respondWithResult(_0x424344,null))['catch'](handleError(_0x424344,null));};exports['addActions']=function(_0x11b9fc,_0x16f752,_0x2e425e){return db['Action'][_0xd8ae('0x45')]({'where':{'id':_0x11b9fc[_0xd8ae('0x40')]['id']}})['then'](handleEntityNotFound(_0x16f752,null))[_0xd8ae('0x26')](function(_0x4c69cf){if(_0x4c69cf){return _0x4c69cf[_0xd8ae('0x4e')](_0x11b9fc[_0xd8ae('0x44')][_0xd8ae('0x48')],_[_0xd8ae('0x49')](_0x11b9fc[_0xd8ae('0x44')],[_0xd8ae('0x48'),'id'])||{});}})[_0xd8ae('0x26')](respondWithResult(_0x16f752,null))[_0xd8ae('0x42')](handleError(_0x16f752,null));};exports[_0xd8ae('0x4f')]=function(_0x2b5768,_0x3460ef,_0xb10a3b){var _0x28733d={};var _0x3faec7={};var _0x385646;var _0x13f2d5;return db['Automation'][_0xd8ae('0x4a')]({'where':{'id':_0x2b5768['params']['id']}})['then'](handleEntityNotFound(_0x3460ef,null))[_0xd8ae('0x26')](function(_0x3b2cb1){if(_0x3b2cb1){_0x385646=_0x3b2cb1;_0x3faec7[_0xd8ae('0x31')]=_['keys'](db[_0xd8ae('0x50')][_0xd8ae('0x2e')]);_0x3faec7[_0xd8ae('0x32')]=_[_0xd8ae('0x41')](_0x2b5768[_0xd8ae('0x32')]);_0x3faec7[_0xd8ae('0x33')]=_[_0xd8ae('0x34')](_0x3faec7[_0xd8ae('0x31')],_0x3faec7['query']);_0x28733d[_0xd8ae('0x35')]=_[_0xd8ae('0x34')](_0x3faec7[_0xd8ae('0x31')],qs[_0xd8ae('0x36')](_0x2b5768[_0xd8ae('0x32')][_0xd8ae('0x36')]));_0x28733d['attributes']=_0x28733d['attributes'][_0xd8ae('0x4c')]?_0x28733d['attributes']:_0x3faec7[_0xd8ae('0x31')];_0x28733d[_0xd8ae('0x37')]=qs[_0xd8ae('0x38')](_0x2b5768[_0xd8ae('0x32')][_0xd8ae('0x38')]);_0x28733d[_0xd8ae('0x39')]=qs['filters'](_['pick'](_0x2b5768['query'],_0x3faec7[_0xd8ae('0x33')]));if(_0x2b5768['query']['filter']){_0x28733d[_0xd8ae('0x39')]=_[_0xd8ae('0x3b')](_0x28733d[_0xd8ae('0x39')],{'$or':_[_0xd8ae('0x2c')](_0x28733d[_0xd8ae('0x35')],function(_0x4f621b){var _0x362e6d={};_0x362e6d[_0x4f621b]={'$like':'%'+_0x2b5768[_0xd8ae('0x32')][_0xd8ae('0x3a')]+'%'};return _0x362e6d;})});}_0x28733d=_[_0xd8ae('0x3b')]({},_0x28733d,_0x2b5768[_0xd8ae('0x3c')]);return _0x385646['getActions'](_0x28733d);}})[_0xd8ae('0x26')](function(_0x3e8a43){if(_0x3e8a43){_0x13f2d5=_0x3e8a43[_0xd8ae('0x4c')];if(!_0x2b5768[_0xd8ae('0x32')][_0xd8ae('0x51')](_0xd8ae('0x4d'))){_0x28733d['limit']=qs['limit'](_0x2b5768[_0xd8ae('0x32')][_0xd8ae('0x20')]);_0x28733d['offset']=qs[_0xd8ae('0x1e')](_0x2b5768[_0xd8ae('0x32')][_0xd8ae('0x1e')]);}return _0x385646[_0xd8ae('0x4f')](_0x28733d);}})[_0xd8ae('0x26')](function(_0x2bb768){if(_0x2bb768){return _0x2bb768?{'count':_0x13f2d5,'rows':_0x2bb768}:null;}})[_0xd8ae('0x26')](respondWithResult(_0x3460ef,null))[_0xd8ae('0x42')](handleError(_0x3460ef,null));};
\ No newline at end of file
+var _0x868e=['eml-format','zip-dir','request-promise','bluebird','path','ejs','lodash','jsforce','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','then','destroy','name','send','index','map','Automation','rawAttributes','fieldName','key','keys','query','intersection','fields','attributes','length','model','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','create','body','addConditions','Condition','ids','getConditions','findOne','addActions','omit','getActions','hasOwnProperty'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x868e,0x128));var _0xe868=function(_0x37e597,_0x3569a8){_0x37e597=_0x37e597-0x0;var _0x14fe81=_0x868e[_0x37e597];return _0x14fe81;};'use strict';var emlformat=require(_0xe868('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe868('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe868('0x2'));var moment=require('moment');var BPromise=require(_0xe868('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe868('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe868('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe868('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe868('0x7'));var deskjs=require('desk.js');var toCsv=require(_0xe868('0x8'));var querystring=require('querystring');var Papa=require(_0xe868('0x9'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe868('0xa'));var as=require(_0xe868('0xb'));var hardwareService=require(_0xe868('0xc'));var logger=require(_0xe868('0xd'))(_0xe868('0xe'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe868('0xf'))['db'];function respondWithStatusCode(_0x342529,_0x3e1065){_0x3e1065=_0x3e1065||0xcc;return function(_0x459404){if(_0x459404){return _0x342529[_0xe868('0x10')](_0x3e1065);}return _0x342529[_0xe868('0x11')](_0x3e1065)[_0xe868('0x12')]();};}function respondWithResult(_0x4b7181,_0x4f9f47){_0x4f9f47=_0x4f9f47||0xc8;return function(_0x1d5a18){if(_0x1d5a18){return _0x4b7181[_0xe868('0x11')](_0x4f9f47)[_0xe868('0x13')](_0x1d5a18);}};}function respondWithFilteredResult(_0xe2f0cc,_0x5a442f){return function(_0x4dad6c){if(_0x4dad6c){var _0x3c9a2f=typeof _0x5a442f[_0xe868('0x14')]==='undefined'&&typeof _0x5a442f[_0xe868('0x15')]==='undefined';var _0x5a2885=_0x4dad6c['count'];var _0x28f4c8=_0x3c9a2f?0x0:_0x5a442f[_0xe868('0x14')];var _0x3c7211=_0x3c9a2f?_0x4dad6c[_0xe868('0x16')]:_0x5a442f[_0xe868('0x14')]+_0x5a442f['limit'];var _0x3e68d4;if(_0x3c7211>=_0x5a2885){_0x3c7211=_0x5a2885;_0x3e68d4=0xc8;}else{_0x3e68d4=0xce;}_0xe2f0cc[_0xe868('0x11')](_0x3e68d4);return _0xe2f0cc[_0xe868('0x17')](_0xe868('0x18'),_0x28f4c8+'-'+_0x3c7211+'/'+_0x5a2885)['json'](_0x4dad6c);}return null;};}function patchUpdates(_0x81aad1){return function(_0x387102){try{jsonpatch[_0xe868('0x19')](_0x387102,_0x81aad1,!![]);}catch(_0x28cd53){return BPromise['reject'](_0x28cd53);}return _0x387102[_0xe868('0x1a')]();};}function saveUpdates(_0x4d77a6,_0x4fdf9d){return function(_0x372af6){if(_0x372af6){return _0x372af6[_0xe868('0x1b')](_0x4d77a6)[_0xe868('0x1c')](function(_0x4ba0ab){return _0x4ba0ab;});}return null;};}function removeEntity(_0x46bfd3,_0x20fdc8){return function(_0x5c8f34){if(_0x5c8f34){return _0x5c8f34[_0xe868('0x1d')]()['then'](function(){_0x46bfd3[_0xe868('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6c1e2e,_0x458be3){return function(_0x3b25cc){if(!_0x3b25cc){_0x6c1e2e[_0xe868('0x10')](0x194);}return _0x3b25cc;};}function handleError(_0x153048,_0x18123e){_0x18123e=_0x18123e||0x1f4;return function(_0x57cd99){logger['error'](_0x57cd99['stack']);if(_0x57cd99[_0xe868('0x1e')]){delete _0x57cd99[_0xe868('0x1e')];}_0x153048['status'](_0x18123e)[_0xe868('0x1f')](_0x57cd99);};}exports[_0xe868('0x20')]=function(_0x9322d7,_0x853f53){var _0x33a4e2={},_0x57e171={},_0x5548b5={'count':0x0,'rows':[]};var _0x6df6cf=_[_0xe868('0x21')](db[_0xe868('0x22')][_0xe868('0x23')],function(_0x1074da){return{'name':_0x1074da[_0xe868('0x24')],'type':_0x1074da['type'][_0xe868('0x25')]};});_0x57e171['model']=_[_0xe868('0x21')](_0x6df6cf,_0xe868('0x1e'));_0x57e171['query']=_[_0xe868('0x26')](_0x9322d7[_0xe868('0x27')]);_0x57e171['filters']=_[_0xe868('0x28')](_0x57e171['model'],_0x57e171['query']);_0x33a4e2['attributes']=_[_0xe868('0x28')](_0x57e171['model'],qs[_0xe868('0x29')](_0x9322d7[_0xe868('0x27')][_0xe868('0x29')]));_0x33a4e2[_0xe868('0x2a')]=_0x33a4e2[_0xe868('0x2a')][_0xe868('0x2b')]?_0x33a4e2[_0xe868('0x2a')]:_0x57e171[_0xe868('0x2c')];if(!_0x9322d7['query']['hasOwnProperty'](_0xe868('0x2d'))){_0x33a4e2[_0xe868('0x15')]=qs['limit'](_0x9322d7[_0xe868('0x27')][_0xe868('0x15')]);_0x33a4e2[_0xe868('0x14')]=qs[_0xe868('0x14')](_0x9322d7['query'][_0xe868('0x14')]);}_0x33a4e2[_0xe868('0x2e')]=qs['sort'](_0x9322d7[_0xe868('0x27')][_0xe868('0x2f')]);_0x33a4e2['where']=qs[_0xe868('0x30')](_[_0xe868('0x31')](_0x9322d7['query'],_0x57e171['filters']),_0x6df6cf);if(_0x9322d7[_0xe868('0x27')][_0xe868('0x32')]){_0x33a4e2[_0xe868('0x33')]=_[_0xe868('0x34')](_0x33a4e2[_0xe868('0x33')],{'$or':_[_0xe868('0x21')](_0x6df6cf,function(_0x5595a8){if(_0x5595a8[_0xe868('0x35')]!==_0xe868('0x36')){var _0x11f11c={};_0x11f11c[_0x5595a8[_0xe868('0x1e')]]={'$like':'%'+_0x9322d7[_0xe868('0x27')][_0xe868('0x32')]+'%'};return _0x11f11c;}})});}_0x33a4e2=_[_0xe868('0x34')]({},_0x33a4e2,_0x9322d7[_0xe868('0x37')]);var _0x19e6c9={'where':_0x33a4e2[_0xe868('0x33')]};return db['Automation'][_0xe868('0x16')](_0x19e6c9)['then'](function(_0x5e1930){_0x5548b5[_0xe868('0x16')]=_0x5e1930;if(_0x9322d7['query'][_0xe868('0x38')]){_0x33a4e2[_0xe868('0x39')]=[{'all':!![]}];}return db[_0xe868('0x22')][_0xe868('0x3a')](_0x33a4e2);})['then'](function(_0x415b4b){_0x5548b5[_0xe868('0x3b')]=_0x415b4b;return _0x5548b5;})[_0xe868('0x1c')](respondWithFilteredResult(_0x853f53,_0x33a4e2))['catch'](handleError(_0x853f53,null));};exports['show']=function(_0x2f56e4,_0x3f20b6){var _0x51bc34={'raw':![],'where':{'id':_0x2f56e4[_0xe868('0x3c')]['id']}},_0x476342={};_0x476342[_0xe868('0x2c')]=_[_0xe868('0x26')](db['Automation']['rawAttributes']);_0x476342[_0xe868('0x27')]=_[_0xe868('0x26')](_0x2f56e4[_0xe868('0x27')]);_0x476342[_0xe868('0x30')]=_[_0xe868('0x28')](_0x476342[_0xe868('0x2c')],_0x476342[_0xe868('0x27')]);_0x51bc34[_0xe868('0x2a')]=_['intersection'](_0x476342['model'],qs[_0xe868('0x29')](_0x2f56e4[_0xe868('0x27')][_0xe868('0x29')]));_0x51bc34['attributes']=_0x51bc34[_0xe868('0x2a')][_0xe868('0x2b')]?_0x51bc34[_0xe868('0x2a')]:_0x476342['model'];if(_0x2f56e4['query'][_0xe868('0x38')]){_0x51bc34[_0xe868('0x39')]=[{'all':!![]}];}_0x51bc34=_[_0xe868('0x34')]({},_0x51bc34,_0x2f56e4[_0xe868('0x37')]);return db[_0xe868('0x22')][_0xe868('0x3d')](_0x51bc34)[_0xe868('0x1c')](handleEntityNotFound(_0x3f20b6,null))[_0xe868('0x1c')](respondWithResult(_0x3f20b6,null))[_0xe868('0x3e')](handleError(_0x3f20b6,null));};exports[_0xe868('0x3f')]=function(_0x477850,_0x489bf3){return db['Automation']['create'](_0x477850[_0xe868('0x40')],{})[_0xe868('0x1c')](respondWithResult(_0x489bf3,0xc9))[_0xe868('0x3e')](handleError(_0x489bf3,null));};exports[_0xe868('0x1b')]=function(_0x2545c0,_0x46abb9){if(_0x2545c0[_0xe868('0x40')]['id']){delete _0x2545c0[_0xe868('0x40')]['id'];}return db['Automation'][_0xe868('0x3d')]({'where':{'id':_0x2545c0[_0xe868('0x3c')]['id']}})['then'](handleEntityNotFound(_0x46abb9,null))[_0xe868('0x1c')](saveUpdates(_0x2545c0[_0xe868('0x40')],null))[_0xe868('0x1c')](respondWithResult(_0x46abb9,null))[_0xe868('0x3e')](handleError(_0x46abb9,null));};exports[_0xe868('0x1d')]=function(_0x14fcae,_0x504754){return db[_0xe868('0x22')]['find']({'where':{'id':_0x14fcae[_0xe868('0x3c')]['id']}})[_0xe868('0x1c')](handleEntityNotFound(_0x504754,null))[_0xe868('0x1c')](removeEntity(_0x504754,null))[_0xe868('0x3e')](handleError(_0x504754,null));};exports[_0xe868('0x41')]=function(_0x49840a,_0xe41d6f,_0x42934d){return db[_0xe868('0x42')][_0xe868('0x3d')]({'where':{'id':_0x49840a['params']['id']}})['then'](handleEntityNotFound(_0xe41d6f,null))[_0xe868('0x1c')](function(_0x4ea561){if(_0x4ea561){return _0x4ea561[_0xe868('0x41')](_0x49840a['body'][_0xe868('0x43')],_['omit'](_0x49840a['body'],[_0xe868('0x43'),'id'])||{});}})[_0xe868('0x1c')](respondWithResult(_0xe41d6f,null))[_0xe868('0x3e')](handleError(_0xe41d6f,null));};exports[_0xe868('0x44')]=function(_0x4b7f35,_0x29743d,_0x35be34){var _0x3d7db={};var _0x241d27={};var _0x2c3bc6;var _0x1055da;return db[_0xe868('0x22')][_0xe868('0x45')]({'where':{'id':_0x4b7f35['params']['id']}})[_0xe868('0x1c')](handleEntityNotFound(_0x29743d,null))['then'](function(_0x4a71ff){if(_0x4a71ff){_0x2c3bc6=_0x4a71ff;_0x241d27[_0xe868('0x2c')]=_['keys'](db[_0xe868('0x42')]['rawAttributes']);_0x241d27[_0xe868('0x27')]=_[_0xe868('0x26')](_0x4b7f35['query']);_0x241d27[_0xe868('0x30')]=_[_0xe868('0x28')](_0x241d27['model'],_0x241d27['query']);_0x3d7db[_0xe868('0x2a')]=_['intersection'](_0x241d27['model'],qs[_0xe868('0x29')](_0x4b7f35[_0xe868('0x27')]['fields']));_0x3d7db[_0xe868('0x2a')]=_0x3d7db[_0xe868('0x2a')][_0xe868('0x2b')]?_0x3d7db[_0xe868('0x2a')]:_0x241d27[_0xe868('0x2c')];_0x3d7db[_0xe868('0x2e')]=qs[_0xe868('0x2f')](_0x4b7f35[_0xe868('0x27')][_0xe868('0x2f')]);_0x3d7db[_0xe868('0x33')]=qs['filters'](_[_0xe868('0x31')](_0x4b7f35[_0xe868('0x27')],_0x241d27[_0xe868('0x30')]));if(_0x4b7f35[_0xe868('0x27')][_0xe868('0x32')]){_0x3d7db[_0xe868('0x33')]=_['merge'](_0x3d7db[_0xe868('0x33')],{'$or':_[_0xe868('0x21')](_0x3d7db['attributes'],function(_0x5ae1e7){var _0x4dcc5e={};_0x4dcc5e[_0x5ae1e7]={'$like':'%'+_0x4b7f35[_0xe868('0x27')][_0xe868('0x32')]+'%'};return _0x4dcc5e;})});}_0x3d7db=_[_0xe868('0x34')]({},_0x3d7db,_0x4b7f35['options']);return _0x2c3bc6['getConditions'](_0x3d7db);}})[_0xe868('0x1c')](function(_0x1c275e){if(_0x1c275e){_0x1055da=_0x1c275e[_0xe868('0x2b')];if(!_0x4b7f35[_0xe868('0x27')]['hasOwnProperty'](_0xe868('0x2d'))){_0x3d7db[_0xe868('0x15')]=qs[_0xe868('0x15')](_0x4b7f35[_0xe868('0x27')][_0xe868('0x15')]);_0x3d7db[_0xe868('0x14')]=qs['offset'](_0x4b7f35[_0xe868('0x27')]['offset']);}return _0x2c3bc6['getConditions'](_0x3d7db);}})['then'](function(_0x29db43){if(_0x29db43){return _0x29db43?{'count':_0x1055da,'rows':_0x29db43}:null;}})[_0xe868('0x1c')](respondWithResult(_0x29743d,null))[_0xe868('0x3e')](handleError(_0x29743d,null));};exports[_0xe868('0x46')]=function(_0x1f9687,_0x13b609,_0x4c4316){return db['Action']['find']({'where':{'id':_0x1f9687['params']['id']}})[_0xe868('0x1c')](handleEntityNotFound(_0x13b609,null))['then'](function(_0x2d5722){if(_0x2d5722){return _0x2d5722[_0xe868('0x46')](_0x1f9687[_0xe868('0x40')][_0xe868('0x43')],_[_0xe868('0x47')](_0x1f9687['body'],[_0xe868('0x43'),'id'])||{});}})['then'](respondWithResult(_0x13b609,null))[_0xe868('0x3e')](handleError(_0x13b609,null));};exports['getActions']=function(_0x5dd4a0,_0x2cac53,_0x498ce4){var _0x1f7d47={};var _0x454e32={};var _0x14d78c;var _0x13bad5;return db['Automation'][_0xe868('0x45')]({'where':{'id':_0x5dd4a0[_0xe868('0x3c')]['id']}})[_0xe868('0x1c')](handleEntityNotFound(_0x2cac53,null))['then'](function(_0x36de2e){if(_0x36de2e){_0x14d78c=_0x36de2e;_0x454e32[_0xe868('0x2c')]=_['keys'](db['Action']['rawAttributes']);_0x454e32[_0xe868('0x27')]=_['keys'](_0x5dd4a0['query']);_0x454e32['filters']=_[_0xe868('0x28')](_0x454e32[_0xe868('0x2c')],_0x454e32[_0xe868('0x27')]);_0x1f7d47[_0xe868('0x2a')]=_['intersection'](_0x454e32[_0xe868('0x2c')],qs[_0xe868('0x29')](_0x5dd4a0[_0xe868('0x27')][_0xe868('0x29')]));_0x1f7d47[_0xe868('0x2a')]=_0x1f7d47['attributes']['length']?_0x1f7d47[_0xe868('0x2a')]:_0x454e32[_0xe868('0x2c')];_0x1f7d47[_0xe868('0x2e')]=qs[_0xe868('0x2f')](_0x5dd4a0[_0xe868('0x27')][_0xe868('0x2f')]);_0x1f7d47[_0xe868('0x33')]=qs['filters'](_[_0xe868('0x31')](_0x5dd4a0[_0xe868('0x27')],_0x454e32[_0xe868('0x30')]));if(_0x5dd4a0[_0xe868('0x27')][_0xe868('0x32')]){_0x1f7d47[_0xe868('0x33')]=_['merge'](_0x1f7d47[_0xe868('0x33')],{'$or':_[_0xe868('0x21')](_0x1f7d47['attributes'],function(_0x23ddee){var _0x22059a={};_0x22059a[_0x23ddee]={'$like':'%'+_0x5dd4a0['query'][_0xe868('0x32')]+'%'};return _0x22059a;})});}_0x1f7d47=_[_0xe868('0x34')]({},_0x1f7d47,_0x5dd4a0['options']);return _0x14d78c[_0xe868('0x48')](_0x1f7d47);}})[_0xe868('0x1c')](function(_0x534b82){if(_0x534b82){_0x13bad5=_0x534b82[_0xe868('0x2b')];if(!_0x5dd4a0['query'][_0xe868('0x49')]('nolimit')){_0x1f7d47[_0xe868('0x15')]=qs[_0xe868('0x15')](_0x5dd4a0[_0xe868('0x27')][_0xe868('0x15')]);_0x1f7d47[_0xe868('0x14')]=qs['offset'](_0x5dd4a0[_0xe868('0x27')][_0xe868('0x14')]);}return _0x14d78c[_0xe868('0x48')](_0x1f7d47);}})[_0xe868('0x1c')](function(_0x1db7d6){if(_0x1db7d6){return _0x1db7d6?{'count':_0x13bad5,'rows':_0x1db7d6}:null;}})[_0xe868('0x1c')](respondWithResult(_0x2cac53,null))['catch'](handleError(_0x2cac53,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index ee24666..23f7a1b 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 _0x18d6=['tools_automations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation'];(function(_0x1bc9b8,_0x379fc7){var _0x1a9a13=function(_0x3a73ea){while(--_0x3a73ea){_0x1bc9b8['push'](_0x1bc9b8['shift']());}};_0x1a9a13(++_0x379fc7);}(_0x18d6,0x15f));var _0x618d=function(_0x56566d,_0x470d71){_0x56566d=_0x56566d-0x0;var _0x15aa22=_0x18d6[_0x56566d];return _0x15aa22;};'use strict';var _=require(_0x618d('0x0'));var util=require(_0x618d('0x1'));var logger=require(_0x618d('0x2'))('api');var moment=require(_0x618d('0x3'));var BPromise=require(_0x618d('0x4'));var rp=require(_0x618d('0x5'));var fs=require('fs');var path=require(_0x618d('0x6'));var rimraf=require(_0x618d('0x7'));var config=require(_0x618d('0x8'));var attributes=require(_0x618d('0x9'));module[_0x618d('0xa')]=function(_0x16fa0e,_0x4d9897){return _0x16fa0e[_0x618d('0xb')](_0x618d('0xc'),attributes,{'tableName':_0x618d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x129e=['exports','define','Automation','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./automation.attributes'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x129e,0x12e));var _0xe129=function(_0x264917,_0x98e348){_0x264917=_0x264917-0x0;var _0x182b5a=_0x129e[_0x264917];return _0x182b5a;};'use strict';var _=require(_0xe129('0x0'));var util=require(_0xe129('0x1'));var logger=require(_0xe129('0x2'))(_0xe129('0x3'));var moment=require(_0xe129('0x4'));var BPromise=require(_0xe129('0x5'));var rp=require(_0xe129('0x6'));var fs=require('fs');var path=require(_0xe129('0x7'));var rimraf=require(_0xe129('0x8'));var config=require('../../config/environment');var attributes=require(_0xe129('0x9'));module[_0xe129('0xa')]=function(_0x44ad13,_0x23eea5){return _0x44ad13[_0xe129('0xb')](_0xe129('0xc'),attributes,{'tableName':'tools_automations','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 068fc14..cee7b29 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 _0x69d4=['error','Automation,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0x69d4,0x83));var _0x469d=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0x69d4[_0x3203a1];return _0x24215e;};'use strict';var _=require(_0x469d('0x0'));var util=require(_0x469d('0x1'));var moment=require('moment');var BPromise=require(_0x469d('0x2'));var rs=require(_0x469d('0x3'));var fs=require('fs');var Redis=require(_0x469d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x469d('0x5'));var logger=require('../../config/logger')(_0x469d('0x6'));var config=require(_0x469d('0x7'));var jayson=require(_0x469d('0x8'));var client=jayson[_0x469d('0x9')][_0x469d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb15ca9,_0x5129a8,_0x1e9300){return new BPromise(function(_0x486595,_0x37ee05){return client[_0x469d('0xb')](_0xb15ca9,_0x1e9300)[_0x469d('0xc')](function(_0x5f05c9){logger['info']('Automation,\x20%s,\x20%s',_0x5129a8,_0x469d('0xd'));logger[_0x469d('0xe')]('Automation,\x20%s,\x20%s,\x20%s',_0x5129a8,_0x469d('0xd'),JSON[_0x469d('0xf')](_0x5f05c9));if(_0x5f05c9[_0x469d('0x10')]){if(_0x5f05c9['error']['code']===0x1f4){logger['error'](_0x469d('0x11'),_0x5129a8,_0x5f05c9[_0x469d('0x10')][_0x469d('0x12')]);return _0x37ee05(_0x5f05c9[_0x469d('0x10')][_0x469d('0x12')]);}logger[_0x469d('0x10')](_0x469d('0x11'),_0x5129a8,_0x5f05c9['error'][_0x469d('0x12')]);return _0x486595(_0x5f05c9[_0x469d('0x10')][_0x469d('0x12')]);}else{logger[_0x469d('0x13')]('Automation,\x20%s,\x20%s',_0x5129a8,_0x469d('0xd'));_0x486595(_0x5f05c9[_0x469d('0x14')][_0x469d('0x12')]);}})['catch'](function(_0x16d3b5){logger[_0x469d('0x10')](_0x469d('0x11'),_0x5129a8,_0x16d3b5);_0x37ee05(_0x16d3b5);});});}
\ No newline at end of file
+var _0x5204=['rpc','jayson/promise','client','http','request','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5204,0xdf));var _0x4520=function(_0x13f980,_0x1e1c56){_0x13f980=_0x13f980-0x0;var _0x27153c=_0x5204[_0x13f980];return _0x27153c;};'use strict';var _=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var moment=require('moment');var BPromise=require(_0x4520('0x2'));var rs=require(_0x4520('0x3'));var fs=require('fs');var Redis=require(_0x4520('0x4'));var db=require(_0x4520('0x5'))['db'];var utils=require(_0x4520('0x6'));var logger=require('../../config/logger')(_0x4520('0x7'));var config=require('../../config/environment');var jayson=require(_0x4520('0x8'));var client=jayson[_0x4520('0x9')][_0x4520('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe741c2,_0x396d29,_0x446dc9){return new BPromise(function(_0x27890f,_0x55b44f){return client[_0x4520('0xb')](_0xe741c2,_0x446dc9)['then'](function(_0x168e62){logger[_0x4520('0xc')](_0x4520('0xd'),_0x396d29,_0x4520('0xe'));logger[_0x4520('0xf')](_0x4520('0x10'),_0x396d29,_0x4520('0xe'),JSON[_0x4520('0x11')](_0x168e62));if(_0x168e62[_0x4520('0x12')]){if(_0x168e62[_0x4520('0x12')][_0x4520('0x13')]===0x1f4){logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);return _0x55b44f(_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);}logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);return _0x27890f(_0x168e62['error'][_0x4520('0x14')]);}else{logger[_0x4520('0xc')](_0x4520('0xd'),_0x396d29,_0x4520('0xe'));_0x27890f(_0x168e62[_0x4520('0x15')]['message']);}})[_0x4520('0x16')](function(_0x33ac29){logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x33ac29);_0x55b44f(_0x33ac29);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index fb453b4..71edccf 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 _0x58ef=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','post','addConditions','/:id/actions','addActions','delete'];(function(_0x320b8e,_0x1da3fe){var _0x55a10a=function(_0x148a56){while(--_0x148a56){_0x320b8e['push'](_0x320b8e['shift']());}};_0x55a10a(++_0x1da3fe);}(_0x58ef,0x1ce));var _0xf58e=function(_0x27a08e,_0x1d9a5b){_0x27a08e=_0x27a08e-0x0;var _0x20d509=_0x58ef[_0x27a08e];return _0x20d509;};'use strict';var multer=require(_0xf58e('0x0'));var util=require('util');var path=require(_0xf58e('0x1'));var timeout=require(_0xf58e('0x2'));var express=require(_0xf58e('0x3'));var router=express[_0xf58e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf58e('0x5'));var interaction=require(_0xf58e('0x6'));var config=require(_0xf58e('0x7'));var controller=require(_0xf58e('0x8'));router[_0xf58e('0x9')]('/',auth[_0xf58e('0xa')](),controller[_0xf58e('0xb')]);router[_0xf58e('0x9')](_0xf58e('0xc'),auth['isAuthenticated'](),controller[_0xf58e('0xd')]);router['get'](_0xf58e('0xe'),auth[_0xf58e('0xa')](),controller[_0xf58e('0xf')]);router[_0xf58e('0x9')]('/:id/actions',auth[_0xf58e('0xa')](),controller['getActions']);router[_0xf58e('0x10')]('/',auth[_0xf58e('0xa')](),controller['create']);router[_0xf58e('0x10')](_0xf58e('0xe'),auth[_0xf58e('0xa')](),controller[_0xf58e('0x11')]);router[_0xf58e('0x10')](_0xf58e('0x12'),auth[_0xf58e('0xa')](),controller[_0xf58e('0x13')]);router['put'](_0xf58e('0xc'),auth[_0xf58e('0xa')](),controller['update']);router[_0xf58e('0x14')](_0xf58e('0xc'),auth[_0xf58e('0xa')](),controller[_0xf58e('0x15')]);module[_0xf58e('0x16')]=router;
\ No newline at end of file
+var _0x8bc3=['create','update','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post'];(function(_0x119da2,_0x1651ee){var _0x5724ec=function(_0x388b79){while(--_0x388b79){_0x119da2['push'](_0x119da2['shift']());}};_0x5724ec(++_0x1651ee);}(_0x8bc3,0x82));var _0x38bc=function(_0x38d4ac,_0x19cf87){_0x38d4ac=_0x38d4ac-0x0;var _0x3497fb=_0x8bc3[_0x38d4ac];return _0x3497fb;};'use strict';var multer=require(_0x38bc('0x0'));var util=require('util');var path=require(_0x38bc('0x1'));var timeout=require('connect-timeout');var express=require(_0x38bc('0x2'));var router=express[_0x38bc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x38bc('0x4'));var interaction=require(_0x38bc('0x5'));var config=require(_0x38bc('0x6'));var controller=require(_0x38bc('0x7'));router['get']('/',auth[_0x38bc('0x8')](),controller[_0x38bc('0x9')]);router[_0x38bc('0xa')](_0x38bc('0xb'),auth[_0x38bc('0x8')](),controller['show']);router['get'](_0x38bc('0xc'),auth[_0x38bc('0x8')](),controller[_0x38bc('0xd')]);router[_0x38bc('0xa')](_0x38bc('0xe'),auth[_0x38bc('0x8')](),controller[_0x38bc('0xf')]);router[_0x38bc('0x10')]('/',auth[_0x38bc('0x8')](),controller[_0x38bc('0x11')]);router['post']('/:id/conditions',auth['isAuthenticated'](),controller['addConditions']);router[_0x38bc('0x10')]('/:id/actions',auth['isAuthenticated'](),controller['addActions']);router['put'](_0x38bc('0xb'),auth[_0x38bc('0x8')](),controller[_0x38bc('0x12')]);router['delete'](_0x38bc('0xb'),auth[_0x38bc('0x8')](),controller[_0x38bc('0x13')]);module[_0x38bc('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 55f1a77..af38eca 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 _0x8156=['AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)'];(function(_0x45b1ba,_0x5a6a21){var _0x145ddb=function(_0x650d42){while(--_0x650d42){_0x45b1ba['push'](_0x45b1ba['shift']());}};_0x145ddb(++_0x5a6a21);}(_0x8156,0xad));var _0x6815=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x8156[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0x6815('0x0')]={'name':{'type':Sequelize[_0x6815('0x1')],'unique':_0x6815('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x6815('0x3')](_0x6815('0x4')),'allowNull':![],'defaultValue':_0x6815('0x4')},'description':{'type':Sequelize[_0x6815('0x1')]},'active':{'type':Sequelize[_0x6815('0x5')],'defaultValue':0x0,'comment':_0x6815('0x6')},'limitCalls':{'type':Sequelize[_0x6815('0x7')](0x4)[_0x6815('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x6815('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x6815('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x6815('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x6815('0x7')](0x3)[_0x6815('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6815('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x6815('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6815('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x6815('0x7')](0x5)[_0x6815('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6815('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x6815('0x7')](0x3)[_0x6815('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6815('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x6815('0x7')](0x5)[_0x6815('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6815('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6815('0x8')],'defaultValue':0x3,'comment':_0x6815('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x6815('0x7')](0x5)[_0x6815('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6815('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x6815('0x7')](0x3)[_0x6815('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x6815('0x11')},'dialTimezone':{'type':Sequelize[_0x6815('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x6815('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x6815('0x3')](_0x6815('0x12'),_0x6815('0x13'),_0x6815('0x14')),'defaultValue':_0x6815('0x12')},'dialAMDActive':{'type':Sequelize[_0x6815('0x5')],'defaultValue':0x0,'comment':_0x6815('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x6815('0x7')](0x9)[_0x6815('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x6815('0x16')},'dialAMDGreeting':{'type':Sequelize[_0x6815('0x7')](0x9)[_0x6815('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x6815('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x6815('0x7')](0x9)[_0x6815('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x6815('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x6815('0x7')](0x9)[_0x6815('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6815('0x19')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x6815('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x6815('0x7')](0x9)[_0x6815('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x6815('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x6815('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x6815('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x6815('0x7')](0x5)[_0x6815('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x6815('0x1c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x6815('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6815('0x1d')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x6815('0x1e'),_0x6815('0x1f')),'defaultValue':_0x6815('0x1e')},'dialPrefix':{'type':Sequelize[_0x6815('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x6815('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6815('0x20')},'dialCutDigit':{'type':Sequelize[_0x6815('0x7')](0x3)[_0x6815('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6815('0x21')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x6815('0x7')](0x3)[_0x6815('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6815('0x22')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x6815('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6815('0x23')},'dialDropMaxRetry':{'type':Sequelize[_0x6815('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6815('0x24')},'dialDropRetryFrequency':{'type':Sequelize[_0x6815('0x7')](0x5)[_0x6815('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6815('0x25')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6815('0x26')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x6815('0x7')](0x5)[_0x6815('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6815('0x27')},'dialMachineMaxRetry':{'type':Sequelize[_0x6815('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6815('0x28')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6815('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x6815('0x7')](0x3)[_0x6815('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6815('0x29')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x6815('0x7')](0x5)[_0x6815('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6815('0x2a')}};
\ No newline at end of file
+var _0x6ce5=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','ASC','#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)','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','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)'];(function(_0x3bb06c,_0x2e3a24){var _0x4e1722=function(_0x502ab7){while(--_0x502ab7){_0x3bb06c['push'](_0x3bb06c['shift']());}};_0x4e1722(++_0x2e3a24);}(_0x6ce5,0x1b9));var _0x56ce=function(_0x2d1f90,_0x522ec3){_0x2d1f90=_0x2d1f90-0x0;var _0x3927f5=_0x6ce5[_0x2d1f90];return _0x3927f5;};'use strict';var Sequelize=require(_0x56ce('0x0'));module[_0x56ce('0x1')]={'name':{'type':Sequelize[_0x56ce('0x2')],'unique':_0x56ce('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x56ce('0x4')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x56ce('0x2')]},'active':{'type':Sequelize[_0x56ce('0x5')],'defaultValue':0x0,'comment':_0x56ce('0x6')},'limitCalls':{'type':Sequelize[_0x56ce('0x7')](0x4)[_0x56ce('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x56ce('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x56ce('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x56ce('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x56ce('0x7')](0x3)[_0x56ce('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x56ce('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x56ce('0x7')](0x3)[_0x56ce('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x56ce('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x56ce('0x7')](0x5)[_0x56ce('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x56ce('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x56ce('0x7')](0x3)[_0x56ce('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x56ce('0x7')](0x5)[_0x56ce('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x56ce('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x56ce('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x56ce('0x7')](0x5)[_0x56ce('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x56ce('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x56ce('0xe')},'dialTimezone':{'type':Sequelize[_0x56ce('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x56ce('0x2')],'defaultValue':_0x56ce('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x56ce('0x4')](_0x56ce('0x10'),_0x56ce('0x11'),_0x56ce('0x12')),'defaultValue':_0x56ce('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x56ce('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x56ce('0x7')](0x9)[_0x56ce('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x56ce('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x56ce('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x56ce('0x7')](0x9)[_0x56ce('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x56ce('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x56ce('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x56ce('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x56ce('0x7')](0x9)[_0x56ce('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x56ce('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x56ce('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x56ce('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x56ce('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x56ce('0x7')](0x9)[_0x56ce('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x56ce('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x56ce('0x4')]('DESC',_0x56ce('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x56ce('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x56ce('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x56ce('0x7')](0x3)[_0x56ce('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x56ce('0x7')](0x3)[_0x56ce('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x56ce('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x56ce('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x56ce('0x1c')},'dialDropMaxRetry':{'type':Sequelize[_0x56ce('0x7')](0x3)[_0x56ce('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x56ce('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x56ce('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x56ce('0x7')](0x3)[_0x56ce('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x56ce('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x56ce('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0x56ce('0x7')](0x3)[_0x56ce('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x56ce('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0x56ce('0x7')](0x5)[_0x56ce('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x56ce('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x56ce('0x7')](0x3)[_0x56ce('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x56ce('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x56ce('0x7')](0x5)[_0x56ce('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x56ce('0x22')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index f554520..ae711e3 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 _0x9563=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','Campaign','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','destroy','hasOwnProperty','CampaignId','CmHopper','include','getHopperHistories','CmHopperHistory','pick','getHopperFinals','findOne','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','into','fromQuery','phone','scheduledAt','ContactId','select','field','CmListId','toString','ListId','NOW()','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','push','sequelize','removeLists','getBlackLists','addBlackLists','cm_contacts','all','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x968411,_0x151619){var _0x46e3e5=function(_0x3c621e){while(--_0x3c621e){_0x968411['push'](_0x968411['shift']());}};_0x46e3e5(++_0x151619);}(_0x9563,0x71));var _0x3956=function(_0x395909,_0x1f851c){_0x395909=_0x395909-0x0;var _0x1800dc=_0x9563[_0x395909];return _0x1800dc;};'use strict';var emlformat=require(_0x3956('0x0'));var rimraf=require(_0x3956('0x1'));var zipdir=require(_0x3956('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3956('0x3'));var moment=require('moment');var BPromise=require(_0x3956('0x4'));var Mustache=require(_0x3956('0x5'));var util=require('util');var path=require(_0x3956('0x6'));var sox=require(_0x3956('0x7'));var csv=require(_0x3956('0x8'));var ejs=require(_0x3956('0x9'));var fs=require('fs');var fs_extra=require(_0x3956('0xa'));var _=require(_0x3956('0xb'));var squel=require(_0x3956('0xc'));var crypto=require('crypto');var jsforce=require(_0x3956('0xd'));var deskjs=require(_0x3956('0xe'));var toCsv=require(_0x3956('0x8'));var querystring=require(_0x3956('0xf'));var Papa=require(_0x3956('0x10'));var Redis=require(_0x3956('0x11'));var authService=require(_0x3956('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3956('0x13'));var logger=require(_0x3956('0x14'))(_0x3956('0x15'));var utils=require(_0x3956('0x16'));var config=require(_0x3956('0x17'));var licenseUtil=require(_0x3956('0x18'));var db=require(_0x3956('0x19'))['db'];function respondWithStatusCode(_0x19c41c,_0xa4481f){_0xa4481f=_0xa4481f||0xcc;return function(_0x2c5408){if(_0x2c5408){return _0x19c41c[_0x3956('0x1a')](_0xa4481f);}return _0x19c41c['status'](_0xa4481f)['end']();};}function respondWithResult(_0x3ed725,_0x1c3fcd){_0x1c3fcd=_0x1c3fcd||0xc8;return function(_0x3d1a7f){if(_0x3d1a7f){return _0x3ed725[_0x3956('0x1b')](_0x1c3fcd)['json'](_0x3d1a7f);}};}function respondWithFilteredResult(_0x52b4ab,_0x12c8eb){return function(_0x790260){if(_0x790260){var _0x25dbe3=typeof _0x12c8eb['offset']===_0x3956('0x1c')&&typeof _0x12c8eb[_0x3956('0x1d')]===_0x3956('0x1c');var _0x2980e1=_0x790260[_0x3956('0x1e')];var _0x5ed3ed=_0x25dbe3?0x0:_0x12c8eb[_0x3956('0x1f')];var _0x17555a=_0x25dbe3?_0x790260[_0x3956('0x1e')]:_0x12c8eb[_0x3956('0x1f')]+_0x12c8eb['limit'];var _0x3cd4be;if(_0x17555a>=_0x2980e1){_0x17555a=_0x2980e1;_0x3cd4be=0xc8;}else{_0x3cd4be=0xce;}_0x52b4ab[_0x3956('0x1b')](_0x3cd4be);return _0x52b4ab[_0x3956('0x20')](_0x3956('0x21'),_0x5ed3ed+'-'+_0x17555a+'/'+_0x2980e1)[_0x3956('0x22')](_0x790260);}return null;};}function patchUpdates(_0x4fbef2){return function(_0x4ba6ef){try{jsonpatch[_0x3956('0x23')](_0x4ba6ef,_0x4fbef2,!![]);}catch(_0x1c1ac8){return BPromise['reject'](_0x1c1ac8);}return _0x4ba6ef[_0x3956('0x24')]();};}function saveUpdates(_0x16f7cc,_0xb23a42){return function(_0x3e9420){if(_0x3e9420){return _0x3e9420[_0x3956('0x25')](_0x16f7cc)[_0x3956('0x26')](function(_0x3fe564){return _0x3fe564;});}return null;};}function removeEntity(_0x148a4a,_0x23d1a9){return function(_0x11d6cd){if(_0x11d6cd){return _0x11d6cd['destroy']()[_0x3956('0x26')](function(){var _0x3e2652=_0x11d6cd[_0x3956('0x27')]({'plain':!![]});var _0x4f1252=_0x3956('0x28');return db[_0x3956('0x29')]['destroy']({'where':{'type':_0x4f1252,'resourceId':_0x3e2652['id']}})['then'](function(){return _0x11d6cd;});})[_0x3956('0x26')](function(){_0x148a4a[_0x3956('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x158860,_0x6ad435){return function(_0x4982b1){if(!_0x4982b1){_0x158860[_0x3956('0x1a')](0x194);}return _0x4982b1;};}function handleError(_0x3d9e74,_0x322d3c){_0x322d3c=_0x322d3c||0x1f4;return function(_0x9cfe30){logger[_0x3956('0x2a')](_0x9cfe30[_0x3956('0x2b')]);if(_0x9cfe30[_0x3956('0x2c')]){delete _0x9cfe30[_0x3956('0x2c')];}_0x3d9e74[_0x3956('0x1b')](_0x322d3c)[_0x3956('0x2d')](_0x9cfe30);};}exports[_0x3956('0x2e')]=function(_0x41b4c3,_0x3ad496){var _0x4f7dcf={},_0x1c6170={},_0x49d91a={'count':0x0,'rows':[]};var _0x401759=_[_0x3956('0x2f')](db['Campaign'][_0x3956('0x30')],function(_0xb174ae){return{'name':_0xb174ae[_0x3956('0x31')],'type':_0xb174ae[_0x3956('0x32')][_0x3956('0x33')]};});_0x1c6170[_0x3956('0x34')]=_['map'](_0x401759,_0x3956('0x2c'));_0x1c6170[_0x3956('0x35')]=_[_0x3956('0x36')](_0x41b4c3[_0x3956('0x35')]);_0x1c6170[_0x3956('0x37')]=_[_0x3956('0x38')](_0x1c6170[_0x3956('0x34')],_0x1c6170[_0x3956('0x35')]);_0x4f7dcf[_0x3956('0x39')]=_[_0x3956('0x38')](_0x1c6170[_0x3956('0x34')],qs[_0x3956('0x3a')](_0x41b4c3[_0x3956('0x35')][_0x3956('0x3a')]));_0x4f7dcf['attributes']=_0x4f7dcf[_0x3956('0x39')][_0x3956('0x3b')]?_0x4f7dcf[_0x3956('0x39')]:_0x1c6170[_0x3956('0x34')];if(!_0x41b4c3[_0x3956('0x35')]['hasOwnProperty'](_0x3956('0x3c'))){_0x4f7dcf[_0x3956('0x1d')]=qs[_0x3956('0x1d')](_0x41b4c3[_0x3956('0x35')][_0x3956('0x1d')]);_0x4f7dcf[_0x3956('0x1f')]=qs[_0x3956('0x1f')](_0x41b4c3[_0x3956('0x35')]['offset']);}_0x4f7dcf[_0x3956('0x3d')]=qs['sort'](_0x41b4c3[_0x3956('0x35')][_0x3956('0x3e')]);_0x4f7dcf['where']=qs['filters'](_['pick'](_0x41b4c3['query'],_0x1c6170['filters']),_0x401759);if(_0x41b4c3[_0x3956('0x35')][_0x3956('0x3f')]){_0x4f7dcf[_0x3956('0x40')]=_[_0x3956('0x41')](_0x4f7dcf[_0x3956('0x40')],{'$or':_[_0x3956('0x2f')](_0x401759,function(_0xcea750){if(_0xcea750[_0x3956('0x32')]!==_0x3956('0x42')){var _0x4ba484={};_0x4ba484[_0xcea750['name']]={'$like':'%'+_0x41b4c3[_0x3956('0x35')]['filter']+'%'};return _0x4ba484;}})});}_0x4f7dcf=_[_0x3956('0x41')]({},_0x4f7dcf,_0x41b4c3[_0x3956('0x43')]);var _0xf064c2={'where':_0x4f7dcf[_0x3956('0x40')]};return db['Campaign']['count'](_0xf064c2)[_0x3956('0x26')](function(_0x334073){_0x49d91a['count']=_0x334073;if(_0x41b4c3[_0x3956('0x35')][_0x3956('0x44')]){_0x4f7dcf['include']=[{'all':!![]}];}return db[_0x3956('0x45')][_0x3956('0x46')](_0x4f7dcf);})[_0x3956('0x26')](function(_0x2515b8){_0x49d91a[_0x3956('0x47')]=_0x2515b8;return _0x49d91a;})[_0x3956('0x26')](respondWithFilteredResult(_0x3ad496,_0x4f7dcf))[_0x3956('0x48')](handleError(_0x3ad496,null));};exports[_0x3956('0x49')]=function(_0x189210,_0x5744b1){var _0x4b8f54={'raw':![],'where':{'id':_0x189210[_0x3956('0x4a')]['id']}},_0x50e5d1={};_0x50e5d1[_0x3956('0x34')]=_[_0x3956('0x36')](db[_0x3956('0x45')]['rawAttributes']);_0x50e5d1['query']=_['keys'](_0x189210[_0x3956('0x35')]);_0x50e5d1[_0x3956('0x37')]=_['intersection'](_0x50e5d1['model'],_0x50e5d1[_0x3956('0x35')]);_0x4b8f54['attributes']=_[_0x3956('0x38')](_0x50e5d1['model'],qs['fields'](_0x189210[_0x3956('0x35')][_0x3956('0x3a')]));_0x4b8f54[_0x3956('0x39')]=_0x4b8f54[_0x3956('0x39')][_0x3956('0x3b')]?_0x4b8f54[_0x3956('0x39')]:_0x50e5d1[_0x3956('0x34')];if(_0x189210[_0x3956('0x35')]['includeAll']){_0x4b8f54['include']=[{'all':!![]}];}_0x4b8f54=_[_0x3956('0x41')]({},_0x4b8f54,_0x189210[_0x3956('0x43')]);return db['Campaign']['find'](_0x4b8f54)['then'](handleEntityNotFound(_0x5744b1,null))['then'](respondWithResult(_0x5744b1,null))['catch'](handleError(_0x5744b1,null));};exports[_0x3956('0x4b')]=function(_0x31cdb2,_0xf4e03a){return db[_0x3956('0x45')][_0x3956('0x4b')](_0x31cdb2[_0x3956('0x4c')],{})[_0x3956('0x26')](function(_0x408555){var _0x4dfa09=_0x31cdb2[_0x3956('0x4d')][_0x3956('0x27')]({'plain':!![]});if(!_0x4dfa09)throw new Error(_0x3956('0x4e'));if(_0x4dfa09[_0x3956('0x4f')]===_0x3956('0x4d')){var _0x5b3b8c=_0x408555[_0x3956('0x27')]({'plain':!![]});var _0x1150ef=_0x3956('0x28');return db[_0x3956('0x50')][_0x3956('0x51')]({'where':{'name':_0x1150ef,'userProfileId':_0x4dfa09[_0x3956('0x52')]},'raw':!![]})[_0x3956('0x26')](function(_0xa7c423){if(_0xa7c423&&_0xa7c423[_0x3956('0x53')]===0x0){return db[_0x3956('0x29')][_0x3956('0x4b')]({'name':_0x5b3b8c[_0x3956('0x2c')],'resourceId':_0x5b3b8c['id'],'type':_0xa7c423[_0x3956('0x2c')],'sectionId':_0xa7c423['id']},{})[_0x3956('0x26')](function(){return _0x408555;});}else{return _0x408555;}})['catch'](function(_0x57bb5a){logger[_0x3956('0x2a')](_0x3956('0x54'),_0x57bb5a);throw _0x57bb5a;});}return _0x408555;})['then'](respondWithResult(_0xf4e03a,0xc9))[_0x3956('0x48')](handleError(_0xf4e03a,null));};exports[_0x3956('0x55')]=function(_0x4c0fff,_0x2aaa4f){var _0x436ed2={'where':{'id':_0x4c0fff[_0x3956('0x4a')]['id']}},_0x3a38c7={};_0x3a38c7[_0x3956('0x34')]=_[_0x3956('0x36')](db[_0x3956('0x45')][_0x3956('0x30')]);_0x436ed2['attributes']=_['intersection'](_0x3a38c7[_0x3956('0x34')],qs[_0x3956('0x3a')](_0x4c0fff[_0x3956('0x35')]['fields']));_0x436ed2[_0x3956('0x39')]=_0x436ed2[_0x3956('0x39')]['length']?_0x436ed2['attributes']:_0x3a38c7[_0x3956('0x34')];if(_0x4c0fff['query']['includeAll']){_0x436ed2['include']=[{'all':!![]}];}_0x436ed2=_[_0x3956('0x41')]({},_0x436ed2,_0x4c0fff[_0x3956('0x43')]);return db['Campaign']['find'](_0x436ed2)['then'](handleEntityNotFound(_0x2aaa4f,null))[_0x3956('0x26')](function(_0x4cafd0){if(_0x4cafd0){var _0xc6b1a5=_0x4cafd0['get']({'plain':!![]});_0xc6b1a5=qs[_0x3956('0x56')](_0xc6b1a5,['id',_0x3956('0x57'),_0x3956('0x58')]);_0x4c0fff[_0x3956('0x4c')]=_['omit'](_0x4c0fff[_0x3956('0x4c')],['id',_0x3956('0x57'),_0x3956('0x58')]);return db[_0x3956('0x45')][_0x3956('0x4b')](_['merge'](_0xc6b1a5,_0x4c0fff[_0x3956('0x4c')]),{'include':_0x4c0fff[_0x3956('0x35')][_0x3956('0x44')]?[{'all':!![]}]:undefined})[_0x3956('0x26')](function(_0x57357a){var _0x29b95d=_0x4c0fff[_0x3956('0x4d')][_0x3956('0x27')]({'plain':!![]});if(!_0x29b95d)throw new Error(_0x3956('0x4e'));if(_0x29b95d[_0x3956('0x4f')]==='user'){var _0x378811=_0x57357a[_0x3956('0x27')]({'plain':!![]});var _0x550e1e=_0x3956('0x28');return db[_0x3956('0x50')]['find']({'where':{'name':_0x550e1e,'userProfileId':_0x29b95d['userProfileId']},'raw':!![]})[_0x3956('0x26')](function(_0x117fc9){if(_0x117fc9&&_0x117fc9[_0x3956('0x53')]===0x0){return db[_0x3956('0x29')]['create']({'name':_0x378811['name'],'resourceId':_0x378811['id'],'type':_0x117fc9['name'],'sectionId':_0x117fc9['id']},{})['then'](function(){return _0x57357a;});}else{return _0x57357a;}})[_0x3956('0x48')](function(_0x572554){logger[_0x3956('0x2a')](_0x3956('0x54'),_0x572554);throw _0x572554;});}return _0x57357a;});}})[_0x3956('0x26')](respondWithResult(_0x2aaa4f,0xc9))['catch'](handleError(_0x2aaa4f,null));};exports['update']=function(_0x5ba9a0,_0x310171){if(_0x5ba9a0['body']['id']){delete _0x5ba9a0[_0x3956('0x4c')]['id'];}return db[_0x3956('0x45')]['find']({'where':{'id':_0x5ba9a0[_0x3956('0x4a')]['id']}})[_0x3956('0x26')](handleEntityNotFound(_0x310171,null))[_0x3956('0x26')](saveUpdates(_0x5ba9a0[_0x3956('0x4c')],null))[_0x3956('0x26')](respondWithResult(_0x310171,null))[_0x3956('0x48')](handleError(_0x310171,null));};exports[_0x3956('0x59')]=function(_0x318474,_0x4085bc){return db[_0x3956('0x45')][_0x3956('0x51')]({'where':{'id':_0x318474['params']['id']}})['then'](handleEntityNotFound(_0x4085bc,null))[_0x3956('0x26')](removeEntity(_0x4085bc,null))[_0x3956('0x48')](handleError(_0x4085bc,null));};exports['getHoppers']=function(_0x147b17,_0x4df02e,_0x4936e4){var _0x3ab49a={'raw':!![],'where':{}};var _0xc48f52={};var _0x11d577={'count':0x0,'rows':[]};return db[_0x3956('0x45')]['findOne']({'where':{'id':_0x147b17['params']['id']}})['then'](handleEntityNotFound(_0x4df02e,null))[_0x3956('0x26')](function(_0x13e0bf){if(_0x13e0bf){_0xc48f52[_0x3956('0x34')]=_['keys'](db['CmHopper'][_0x3956('0x30')]);_0xc48f52[_0x3956('0x35')]=_[_0x3956('0x36')](_0x147b17[_0x3956('0x35')]);_0xc48f52[_0x3956('0x37')]=_[_0x3956('0x38')](_0xc48f52[_0x3956('0x34')],_0xc48f52[_0x3956('0x35')]);_0x3ab49a['attributes']=_[_0x3956('0x38')](_0xc48f52[_0x3956('0x34')],qs[_0x3956('0x3a')](_0x147b17['query']['fields']));_0x3ab49a[_0x3956('0x39')]=_0x3ab49a[_0x3956('0x39')][_0x3956('0x3b')]?_0x3ab49a[_0x3956('0x39')]:_0xc48f52['model'];if(!_0x147b17[_0x3956('0x35')][_0x3956('0x5a')](_0x3956('0x3c'))){_0x3ab49a[_0x3956('0x1d')]=qs[_0x3956('0x1d')](_0x147b17['query']['limit']);_0x3ab49a[_0x3956('0x1f')]=qs[_0x3956('0x1f')](_0x147b17[_0x3956('0x35')][_0x3956('0x1f')]);}_0x3ab49a[_0x3956('0x3d')]=qs['sort'](_0x147b17[_0x3956('0x35')][_0x3956('0x3e')]);_0x3ab49a[_0x3956('0x40')]=qs['filters'](_['pick'](_0x147b17[_0x3956('0x35')],_0xc48f52[_0x3956('0x37')]));_0x3ab49a[_0x3956('0x40')][_0x3956('0x5b')]=_0x13e0bf['id'];if(_0x147b17[_0x3956('0x35')][_0x3956('0x3f')]){_0x3ab49a['where']=_[_0x3956('0x41')](_0x3ab49a[_0x3956('0x40')],{'$or':_[_0x3956('0x2f')](_0x3ab49a[_0x3956('0x39')],function(_0x1a56d0){var _0x3180dd={};_0x3180dd[_0x1a56d0]={'$like':'%'+_0x147b17[_0x3956('0x35')][_0x3956('0x3f')]+'%'};return _0x3180dd;})});}_0x3ab49a=_[_0x3956('0x41')]({},_0x3ab49a,_0x147b17[_0x3956('0x43')]);return db[_0x3956('0x5c')][_0x3956('0x1e')]({'where':_0x3ab49a[_0x3956('0x40')]})[_0x3956('0x26')](function(_0x2a6b78){_0x11d577['count']=_0x2a6b78;if(_0x147b17['query'][_0x3956('0x44')]){_0x3ab49a[_0x3956('0x5d')]=[{'all':!![]}];}return db[_0x3956('0x5c')][_0x3956('0x46')](_0x3ab49a);})[_0x3956('0x26')](function(_0x14f882){_0x11d577['rows']=_0x14f882;return _0x11d577;});}})['then'](respondWithFilteredResult(_0x4df02e,_0x3ab49a))[_0x3956('0x48')](handleError(_0x4df02e,null));};exports[_0x3956('0x5e')]=function(_0x1da173,_0x7df870,_0x1ff306){var _0x45c007={'raw':!![],'where':{}};var _0x1e8cec={};var _0x3b34c6={'count':0x0,'rows':[]};return db[_0x3956('0x45')]['findOne']({'where':{'id':_0x1da173['params']['id']}})['then'](handleEntityNotFound(_0x7df870,null))[_0x3956('0x26')](function(_0x57cb8e){if(_0x57cb8e){_0x1e8cec[_0x3956('0x34')]=_[_0x3956('0x36')](db[_0x3956('0x5f')]['rawAttributes']);_0x1e8cec[_0x3956('0x35')]=_[_0x3956('0x36')](_0x1da173['query']);_0x1e8cec[_0x3956('0x37')]=_[_0x3956('0x38')](_0x1e8cec[_0x3956('0x34')],_0x1e8cec[_0x3956('0x35')]);_0x45c007[_0x3956('0x39')]=_[_0x3956('0x38')](_0x1e8cec['model'],qs[_0x3956('0x3a')](_0x1da173[_0x3956('0x35')][_0x3956('0x3a')]));_0x45c007[_0x3956('0x39')]=_0x45c007[_0x3956('0x39')][_0x3956('0x3b')]?_0x45c007[_0x3956('0x39')]:_0x1e8cec[_0x3956('0x34')];if(!_0x1da173[_0x3956('0x35')][_0x3956('0x5a')]('nolimit')){_0x45c007[_0x3956('0x1d')]=qs[_0x3956('0x1d')](_0x1da173[_0x3956('0x35')][_0x3956('0x1d')]);_0x45c007[_0x3956('0x1f')]=qs[_0x3956('0x1f')](_0x1da173['query'][_0x3956('0x1f')]);}_0x45c007[_0x3956('0x3d')]=qs[_0x3956('0x3e')](_0x1da173[_0x3956('0x35')][_0x3956('0x3e')]);_0x45c007[_0x3956('0x40')]=qs['filters'](_[_0x3956('0x60')](_0x1da173[_0x3956('0x35')],_0x1e8cec[_0x3956('0x37')]));_0x45c007[_0x3956('0x40')][_0x3956('0x5b')]=_0x57cb8e['id'];if(_0x1da173[_0x3956('0x35')][_0x3956('0x3f')]){_0x45c007[_0x3956('0x40')]=_[_0x3956('0x41')](_0x45c007[_0x3956('0x40')],{'$or':_[_0x3956('0x2f')](_0x45c007['attributes'],function(_0x56fd4e){var _0x254a93={};_0x254a93[_0x56fd4e]={'$like':'%'+_0x1da173[_0x3956('0x35')][_0x3956('0x3f')]+'%'};return _0x254a93;})});}_0x45c007=_[_0x3956('0x41')]({},_0x45c007,_0x1da173[_0x3956('0x43')]);return db['CmHopperHistory']['count']({'where':_0x45c007[_0x3956('0x40')]})[_0x3956('0x26')](function(_0x4f994b){_0x3b34c6[_0x3956('0x1e')]=_0x4f994b;if(_0x1da173[_0x3956('0x35')][_0x3956('0x44')]){_0x45c007['include']=[{'all':!![]}];}return db[_0x3956('0x5f')][_0x3956('0x46')](_0x45c007);})['then'](function(_0xf3614b){_0x3b34c6[_0x3956('0x47')]=_0xf3614b;return _0x3b34c6;});}})[_0x3956('0x26')](respondWithFilteredResult(_0x7df870,_0x45c007))[_0x3956('0x48')](handleError(_0x7df870,null));};exports[_0x3956('0x61')]=function(_0x512979,_0x5036a1,_0x9886bc){var _0x5e143d={'raw':!![],'where':{}};var _0x10bad5={};var _0x3779de={'count':0x0,'rows':[]};return db[_0x3956('0x45')][_0x3956('0x62')]({'where':{'id':_0x512979[_0x3956('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5036a1,null))[_0x3956('0x26')](function(_0x1404be){if(_0x1404be){_0x10bad5['model']=_[_0x3956('0x36')](db[_0x3956('0x63')]['rawAttributes']);_0x10bad5['query']=_[_0x3956('0x36')](_0x512979['query']);_0x10bad5[_0x3956('0x37')]=_[_0x3956('0x38')](_0x10bad5[_0x3956('0x34')],_0x10bad5[_0x3956('0x35')]);_0x5e143d['attributes']=_[_0x3956('0x38')](_0x10bad5[_0x3956('0x34')],qs[_0x3956('0x3a')](_0x512979[_0x3956('0x35')][_0x3956('0x3a')]));_0x5e143d[_0x3956('0x39')]=_0x5e143d[_0x3956('0x39')][_0x3956('0x3b')]?_0x5e143d['attributes']:_0x10bad5[_0x3956('0x34')];if(!_0x512979[_0x3956('0x35')][_0x3956('0x5a')](_0x3956('0x3c'))){_0x5e143d[_0x3956('0x1d')]=qs[_0x3956('0x1d')](_0x512979[_0x3956('0x35')][_0x3956('0x1d')]);_0x5e143d[_0x3956('0x1f')]=qs[_0x3956('0x1f')](_0x512979[_0x3956('0x35')][_0x3956('0x1f')]);}_0x5e143d[_0x3956('0x3d')]=qs[_0x3956('0x3e')](_0x512979[_0x3956('0x35')]['sort']);_0x5e143d[_0x3956('0x40')]=qs[_0x3956('0x37')](_['pick'](_0x512979[_0x3956('0x35')],_0x10bad5[_0x3956('0x37')]));_0x5e143d[_0x3956('0x40')][_0x3956('0x5b')]=_0x1404be['id'];if(_0x512979[_0x3956('0x35')]['filter']){_0x5e143d['where']=_[_0x3956('0x41')](_0x5e143d[_0x3956('0x40')],{'$or':_['map'](_0x5e143d[_0x3956('0x39')],function(_0x2f8b32){var _0x4fec13={};_0x4fec13[_0x2f8b32]={'$like':'%'+_0x512979[_0x3956('0x35')]['filter']+'%'};return _0x4fec13;})});}_0x5e143d=_[_0x3956('0x41')]({},_0x5e143d,_0x512979['options']);return db[_0x3956('0x63')]['count']({'where':_0x5e143d[_0x3956('0x40')]})[_0x3956('0x26')](function(_0x1e68ca){_0x3779de['count']=_0x1e68ca;if(_0x512979[_0x3956('0x35')][_0x3956('0x44')]){_0x5e143d[_0x3956('0x5d')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x3956('0x46')](_0x5e143d);})[_0x3956('0x26')](function(_0x4b3176){_0x3779de[_0x3956('0x47')]=_0x4b3176;return _0x3779de;});}})[_0x3956('0x26')](respondWithFilteredResult(_0x5036a1,_0x5e143d))[_0x3956('0x48')](handleError(_0x5036a1,null));};exports['getHopperBlacks']=function(_0x2fef29,_0x3e5051,_0x1d580d){var _0x113b39={'raw':!![],'where':{}};var _0x250157={};var _0x2ea3ae={'count':0x0,'rows':[]};return db['Campaign'][_0x3956('0x62')]({'where':{'id':_0x2fef29[_0x3956('0x4a')]['id']}})[_0x3956('0x26')](handleEntityNotFound(_0x3e5051,null))[_0x3956('0x26')](function(_0x2d4ea2){if(_0x2d4ea2){_0x250157[_0x3956('0x34')]=_[_0x3956('0x36')](db[_0x3956('0x64')][_0x3956('0x30')]);_0x250157['query']=_['keys'](_0x2fef29[_0x3956('0x35')]);_0x250157[_0x3956('0x37')]=_[_0x3956('0x38')](_0x250157[_0x3956('0x34')],_0x250157[_0x3956('0x35')]);_0x113b39['attributes']=_[_0x3956('0x38')](_0x250157[_0x3956('0x34')],qs['fields'](_0x2fef29['query']['fields']));_0x113b39[_0x3956('0x39')]=_0x113b39[_0x3956('0x39')][_0x3956('0x3b')]?_0x113b39['attributes']:_0x250157[_0x3956('0x34')];if(!_0x2fef29[_0x3956('0x35')][_0x3956('0x5a')](_0x3956('0x3c'))){_0x113b39['limit']=qs[_0x3956('0x1d')](_0x2fef29[_0x3956('0x35')]['limit']);_0x113b39[_0x3956('0x1f')]=qs[_0x3956('0x1f')](_0x2fef29[_0x3956('0x35')][_0x3956('0x1f')]);}_0x113b39['order']=qs[_0x3956('0x3e')](_0x2fef29[_0x3956('0x35')][_0x3956('0x3e')]);_0x113b39[_0x3956('0x40')]=qs[_0x3956('0x37')](_[_0x3956('0x60')](_0x2fef29[_0x3956('0x35')],_0x250157[_0x3956('0x37')]));_0x113b39[_0x3956('0x40')]['CampaignId']=_0x2d4ea2['id'];if(_0x2fef29['query'][_0x3956('0x3f')]){_0x113b39[_0x3956('0x40')]=_[_0x3956('0x41')](_0x113b39[_0x3956('0x40')],{'$or':_['map'](_0x113b39[_0x3956('0x39')],function(_0x512be3){var _0x5a42ae={};_0x5a42ae[_0x512be3]={'$like':'%'+_0x2fef29[_0x3956('0x35')][_0x3956('0x3f')]+'%'};return _0x5a42ae;})});}_0x113b39=_[_0x3956('0x41')]({},_0x113b39,_0x2fef29['options']);return db[_0x3956('0x64')]['count']({'where':_0x113b39[_0x3956('0x40')]})[_0x3956('0x26')](function(_0x58461a){_0x2ea3ae[_0x3956('0x1e')]=_0x58461a;if(_0x2fef29['query'][_0x3956('0x44')]){_0x113b39[_0x3956('0x5d')]=[{'all':!![]}];}return db[_0x3956('0x64')][_0x3956('0x46')](_0x113b39);})[_0x3956('0x26')](function(_0x25a0bf){_0x2ea3ae[_0x3956('0x47')]=_0x25a0bf;return _0x2ea3ae;});}})['then'](respondWithFilteredResult(_0x3e5051,_0x113b39))['catch'](handleError(_0x3e5051,null));};exports[_0x3956('0x65')]=function(_0x359ad3,_0x57df0e,_0x1b6642){var _0x5eeefb={};var _0x32917b={};var _0x2790d4;var _0x5cc4f1;return db[_0x3956('0x45')][_0x3956('0x62')]({'where':{'id':_0x359ad3[_0x3956('0x4a')]['id']}})['then'](handleEntityNotFound(_0x57df0e,null))[_0x3956('0x26')](function(_0x3b7740){if(_0x3b7740){_0x2790d4=_0x3b7740;_0x32917b[_0x3956('0x34')]=_['keys'](db[_0x3956('0x66')][_0x3956('0x30')]);_0x32917b['query']=_[_0x3956('0x36')](_0x359ad3[_0x3956('0x35')]);_0x32917b[_0x3956('0x37')]=_[_0x3956('0x38')](_0x32917b[_0x3956('0x34')],_0x32917b[_0x3956('0x35')]);_0x5eeefb[_0x3956('0x39')]=_[_0x3956('0x38')](_0x32917b[_0x3956('0x34')],qs['fields'](_0x359ad3[_0x3956('0x35')]['fields']));_0x5eeefb[_0x3956('0x39')]=_0x5eeefb['attributes'][_0x3956('0x3b')]?_0x5eeefb['attributes']:_0x32917b['model'];_0x5eeefb[_0x3956('0x3d')]=qs[_0x3956('0x3e')](_0x359ad3[_0x3956('0x35')][_0x3956('0x3e')]);_0x5eeefb[_0x3956('0x40')]=qs[_0x3956('0x37')](_[_0x3956('0x60')](_0x359ad3['query'],_0x32917b[_0x3956('0x37')]));if(_0x359ad3[_0x3956('0x35')]['filter']){_0x5eeefb[_0x3956('0x40')]=_[_0x3956('0x41')](_0x5eeefb[_0x3956('0x40')],{'$or':_[_0x3956('0x2f')](_0x5eeefb['attributes'],function(_0x3e4d68){var _0x6623b5={};_0x6623b5[_0x3e4d68]={'$like':'%'+_0x359ad3['query'][_0x3956('0x3f')]+'%'};return _0x6623b5;})});}_0x5eeefb=_[_0x3956('0x41')]({},_0x5eeefb,_0x359ad3['options']);return _0x2790d4['getLists'](_0x5eeefb);}})[_0x3956('0x26')](function(_0x4586d3){if(_0x4586d3){_0x5cc4f1=_0x4586d3[_0x3956('0x3b')];if(!_0x359ad3[_0x3956('0x35')][_0x3956('0x5a')](_0x3956('0x3c'))){_0x5eeefb[_0x3956('0x1d')]=qs[_0x3956('0x1d')](_0x359ad3['query']['limit']);_0x5eeefb[_0x3956('0x1f')]=qs[_0x3956('0x1f')](_0x359ad3[_0x3956('0x35')][_0x3956('0x1f')]);}return _0x2790d4['getLists'](_0x5eeefb);}})['then'](function(_0x4e9878){if(_0x4e9878){return _0x4e9878?{'count':_0x5cc4f1,'rows':_0x4e9878}:null;}})['then'](respondWithResult(_0x57df0e,null))[_0x3956('0x48')](handleError(_0x57df0e,null));};exports[_0x3956('0x67')]=function(_0x1a04a0,_0x15dd5d,_0x352eda){var _0x18787a,_0xb35e2;return db[_0x3956('0x45')]['find']({'where':{'id':_0x1a04a0[_0x3956('0x4a')]['id']}})[_0x3956('0x26')](handleEntityNotFound(_0x15dd5d,null))['then'](function(_0x107111){if(_0x107111){_0xb35e2=_0x107111;return _0x107111[_0x3956('0x67')](_0x1a04a0[_0x3956('0x4c')][_0x3956('0x68')],_[_0x3956('0x56')](_0x1a04a0['body'],[_0x3956('0x68'),'id'])||{});}return null;})[_0x3956('0x69')](function(_0x3d36c2){var _0xd01c0;_0x18787a=_0x3d36c2||[];var _0x5766b4=[];if(_0x3d36c2){for(var _0x22a05b=0x0;_0x22a05b<_0x3d36c2['length'];_0x22a05b+=0x1){var _0xdee0cc=_0x3d36c2[_0x22a05b][_0x3956('0x27')]({'plain':!![]});_0xb35e2['dialCheckDuplicateType']=_0x1a04a0['body'][_0x3956('0x6a')]?_0x1a04a0['body'][_0x3956('0x6a')]:_0xb35e2[_0x3956('0x6a')];switch(_0xb35e2[_0x3956('0x6a')]){case'always':_0xd01c0=squel['insert']()[_0x3956('0x6b')]('cm_hopper')[_0x3956('0x6c')]([_0x3956('0x6d'),_0x3956('0x6e'),_0x3956('0x6f'),'ListId',_0x3956('0x5b'),_0x3956('0x57'),_0x3956('0x58')],squel[_0x3956('0x70')]()[_0x3956('0x71')](_0x3956('0x6d'),_0x3956('0x6d'))[_0x3956('0x71')]('NOW()','scheduledAt')[_0x3956('0x71')]('id',_0x3956('0x6f'))[_0x3956('0x71')](_0xdee0cc[_0x3956('0x72')][_0x3956('0x73')](),_0x3956('0x74'))[_0x3956('0x71')](_0x1a04a0['params']['id']['toString'](),'CampaignId')[_0x3956('0x71')](_0x3956('0x75'),_0x3956('0x57'))[_0x3956('0x71')](_0x3956('0x75'),_0x3956('0x58'))[_0x3956('0x76')]('cm_contacts')[_0x3956('0x40')](_0x3956('0x77'))[_0x3956('0x40')](_0x3956('0x78'),_0xdee0cc[_0x3956('0x72')][_0x3956('0x73')]())[_0x3956('0x40')](_0x3956('0x79'))[_0x3956('0x40')](_0x3956('0x7a'),squel[_0x3956('0x70')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x3956('0x76')]('cm_hopper_final')[_0x3956('0x40')](_0x3956('0x7b'),_0x1a04a0[_0x3956('0x4a')]['id'][_0x3956('0x73')]()))[_0x3956('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3956('0x70')]()[_0x3956('0x71')](_0x3956('0x7c'))['from'](_0x3956('0x7d'))['where'](_0x3956('0x7b'),_0x1a04a0[_0x3956('0x4a')]['id']['toString']())))['toString']();break;case _0x3956('0x7e'):_0xd01c0=squel[_0x3956('0x7f')]()[_0x3956('0x6b')]('cm_hopper')[_0x3956('0x6c')]([_0x3956('0x6d'),_0x3956('0x6e'),_0x3956('0x6f'),_0x3956('0x74'),_0x3956('0x5b'),_0x3956('0x57'),_0x3956('0x58')],squel[_0x3956('0x70')]()['field'](_0x3956('0x6d'),_0x3956('0x6d'))[_0x3956('0x71')]('NOW()','scheduledAt')[_0x3956('0x71')]('id',_0x3956('0x6f'))[_0x3956('0x71')](_0xdee0cc['CmListId']['toString'](),_0x3956('0x74'))[_0x3956('0x71')](_0x1a04a0[_0x3956('0x4a')]['id'][_0x3956('0x73')](),_0x3956('0x5b'))[_0x3956('0x71')](_0x3956('0x75'),_0x3956('0x57'))[_0x3956('0x71')](_0x3956('0x75'),_0x3956('0x58'))[_0x3956('0x76')]('cm_contacts')[_0x3956('0x40')](_0x3956('0x77'))[_0x3956('0x40')]('ListId\x20=\x20?',_0xdee0cc[_0x3956('0x72')][_0x3956('0x73')]())['where'](_0x3956('0x79'))[_0x3956('0x40')](_0x3956('0x7a'),squel[_0x3956('0x70')]()[_0x3956('0x71')]('COALESCE(phone,\x27\x27)')[_0x3956('0x76')](_0x3956('0x7d'))[_0x3956('0x40')](_0x3956('0x7b'),_0x1a04a0['params']['id'][_0x3956('0x73')]())))[_0x3956('0x73')]();break;default:_0xd01c0=squel[_0x3956('0x7f')]()['into']('cm_hopper')['fromQuery']([_0x3956('0x6d'),_0x3956('0x6e'),'ContactId','ListId',_0x3956('0x5b'),_0x3956('0x57'),_0x3956('0x58')],squel[_0x3956('0x70')]()['field'](_0x3956('0x6d'),'phone')['field'](_0x3956('0x75'),'scheduledAt')['field']('id',_0x3956('0x6f'))[_0x3956('0x71')](_0xdee0cc[_0x3956('0x72')]['toString'](),_0x3956('0x74'))['field'](_0x1a04a0[_0x3956('0x4a')]['id'][_0x3956('0x73')](),'CampaignId')[_0x3956('0x71')](_0x3956('0x75'),_0x3956('0x57'))['field'](_0x3956('0x75'),'updatedAt')[_0x3956('0x76')]('cm_contacts')[_0x3956('0x40')](_0x3956('0x77'))[_0x3956('0x40')](_0x3956('0x78'),_0xdee0cc[_0x3956('0x72')][_0x3956('0x73')]())[_0x3956('0x40')](_0x3956('0x79')))[_0x3956('0x73')]();}_0x5766b4[_0x3956('0x80')](db[_0x3956('0x81')][_0x3956('0x35')](_0xd01c0));}return BPromise['all'](_0x5766b4);}})[_0x3956('0x26')](function(){return _0x18787a;})[_0x3956('0x26')](respondWithResult(_0x15dd5d,null))['catch'](handleError(_0x15dd5d,null));};exports[_0x3956('0x82')]=function(_0x28d8fc,_0x2e1781,_0x1bfdf8){return db[_0x3956('0x45')][_0x3956('0x51')]({'where':{'id':_0x28d8fc['params']['id']}})[_0x3956('0x26')](handleEntityNotFound(_0x2e1781,null))[_0x3956('0x26')](function(_0x68823f){if(_0x68823f){return _0x68823f['removeLists'](_0x28d8fc[_0x3956('0x35')][_0x3956('0x68')]);}})[_0x3956('0x26')](function(_0x106b76){if(_0x106b76){return db[_0x3956('0x5c')][_0x3956('0x59')]({'where':{'ListId':_0x28d8fc[_0x3956('0x35')][_0x3956('0x68')],'CampaignId':_0x28d8fc['params']['id']}})[_0x3956('0x26')](function(){return _0x106b76;});}})[_0x3956('0x26')](respondWithStatusCode(_0x2e1781,null))['catch'](handleError(_0x2e1781,null));};exports['getBlackLists']=function(_0x371ada,_0x1f1707,_0x2ddef3){var _0x4a41f3={};var _0x2b8302={};var _0x544e47;var _0x28f110;return db[_0x3956('0x45')]['findOne']({'where':{'id':_0x371ada[_0x3956('0x4a')]['id']}})[_0x3956('0x26')](handleEntityNotFound(_0x1f1707,null))[_0x3956('0x26')](function(_0x5aad80){if(_0x5aad80){_0x544e47=_0x5aad80;_0x2b8302[_0x3956('0x34')]=_[_0x3956('0x36')](db['CmList'][_0x3956('0x30')]);_0x2b8302[_0x3956('0x35')]=_[_0x3956('0x36')](_0x371ada[_0x3956('0x35')]);_0x2b8302[_0x3956('0x37')]=_[_0x3956('0x38')](_0x2b8302[_0x3956('0x34')],_0x2b8302['query']);_0x4a41f3[_0x3956('0x39')]=_[_0x3956('0x38')](_0x2b8302[_0x3956('0x34')],qs[_0x3956('0x3a')](_0x371ada[_0x3956('0x35')][_0x3956('0x3a')]));_0x4a41f3[_0x3956('0x39')]=_0x4a41f3[_0x3956('0x39')][_0x3956('0x3b')]?_0x4a41f3[_0x3956('0x39')]:_0x2b8302['model'];_0x4a41f3['order']=qs[_0x3956('0x3e')](_0x371ada[_0x3956('0x35')][_0x3956('0x3e')]);_0x4a41f3[_0x3956('0x40')]=qs[_0x3956('0x37')](_[_0x3956('0x60')](_0x371ada[_0x3956('0x35')],_0x2b8302['filters']));if(_0x371ada[_0x3956('0x35')][_0x3956('0x3f')]){_0x4a41f3[_0x3956('0x40')]=_[_0x3956('0x41')](_0x4a41f3['where'],{'$or':_[_0x3956('0x2f')](_0x4a41f3[_0x3956('0x39')],function(_0x27a37c){var _0xf63ca6={};_0xf63ca6[_0x27a37c]={'$like':'%'+_0x371ada[_0x3956('0x35')][_0x3956('0x3f')]+'%'};return _0xf63ca6;})});}_0x4a41f3=_['merge']({},_0x4a41f3,_0x371ada[_0x3956('0x43')]);return _0x544e47[_0x3956('0x83')](_0x4a41f3);}})[_0x3956('0x26')](function(_0x222a21){if(_0x222a21){_0x28f110=_0x222a21[_0x3956('0x3b')];if(!_0x371ada['query']['hasOwnProperty'](_0x3956('0x3c'))){_0x4a41f3[_0x3956('0x1d')]=qs[_0x3956('0x1d')](_0x371ada['query'][_0x3956('0x1d')]);_0x4a41f3[_0x3956('0x1f')]=qs[_0x3956('0x1f')](_0x371ada[_0x3956('0x35')][_0x3956('0x1f')]);}return _0x544e47[_0x3956('0x83')](_0x4a41f3);}})[_0x3956('0x26')](function(_0x310d8f){if(_0x310d8f){return _0x310d8f?{'count':_0x28f110,'rows':_0x310d8f}:null;}})[_0x3956('0x26')](respondWithResult(_0x1f1707,null))['catch'](handleError(_0x1f1707,null));};exports[_0x3956('0x84')]=function(_0x42f06b,_0x4920a0,_0x572842){var _0x4793a5,_0x3e51bd;return db[_0x3956('0x45')][_0x3956('0x51')]({'where':{'id':_0x42f06b['params']['id']}})['then'](handleEntityNotFound(_0x4920a0,null))[_0x3956('0x26')](function(_0x2755ec){if(_0x2755ec){_0x3e51bd=_0x2755ec;return _0x2755ec[_0x3956('0x84')](_0x42f06b[_0x3956('0x4c')][_0x3956('0x68')],_[_0x3956('0x56')](_0x42f06b[_0x3956('0x4c')],[_0x3956('0x68'),'id'])||{});}return null;})[_0x3956('0x69')](function(_0x297df1){var _0x466fe;_0x4793a5=_0x297df1||[];var _0x2d7de2=[];if(_0x297df1){for(var _0x114fb4=0x0;_0x114fb4<_0x297df1['length'];_0x114fb4+=0x1){var _0x228816=_0x297df1[_0x114fb4][_0x3956('0x27')]({'plain':!![]});_0x466fe=squel[_0x3956('0x7f')]()[_0x3956('0x6b')]('cm_hopper_black')[_0x3956('0x6c')](['phone',_0x3956('0x6f'),_0x3956('0x74'),_0x3956('0x5b'),_0x3956('0x57'),'updatedAt'],squel[_0x3956('0x70')]()[_0x3956('0x71')](_0x3956('0x6d'),_0x3956('0x6d'))['field']('id',_0x3956('0x6f'))[_0x3956('0x71')](_0x228816[_0x3956('0x72')][_0x3956('0x73')](),_0x3956('0x74'))[_0x3956('0x71')](_0x42f06b[_0x3956('0x4a')]['id'][_0x3956('0x73')](),_0x3956('0x5b'))[_0x3956('0x71')](_0x3956('0x75'),_0x3956('0x57'))[_0x3956('0x71')]('NOW()','updatedAt')['from'](_0x3956('0x85'))['where'](_0x3956('0x77'))['where'](_0x3956('0x78'),_0x228816[_0x3956('0x72')]['toString']())[_0x3956('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0x3956('0x73')]();_0x2d7de2['push'](db[_0x3956('0x81')][_0x3956('0x35')](_0x466fe));}return BPromise[_0x3956('0x86')](_0x2d7de2);}})[_0x3956('0x26')](function(){return _0x4793a5;})['then'](respondWithResult(_0x4920a0,null))[_0x3956('0x48')](handleError(_0x4920a0,null));};exports[_0x3956('0x87')]=function(_0x3e5856,_0x18e305,_0x42aa38){return db[_0x3956('0x45')][_0x3956('0x51')]({'where':{'id':_0x3e5856[_0x3956('0x4a')]['id']}})[_0x3956('0x26')](handleEntityNotFound(_0x18e305,null))[_0x3956('0x26')](function(_0x3c4192){if(_0x3c4192){return _0x3c4192[_0x3956('0x87')](_0x3e5856['query'][_0x3956('0x68')]);}})[_0x3956('0x26')](function(_0x563dd3){if(_0x563dd3){return db[_0x3956('0x64')]['destroy']({'where':{'ListId':_0x3e5856['query'][_0x3956('0x68')],'CampaignId':_0x3e5856[_0x3956('0x4a')]['id']}})[_0x3956('0x26')](function(){return _0x563dd3;});}})[_0x3956('0x26')](respondWithStatusCode(_0x18e305,null))[_0x3956('0x48')](handleError(_0x18e305,null));};
\ No newline at end of file
+var _0x1d63=['attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','params','length','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','fields','omit','createdAt','updatedAt','UserProfileSection','getHoppers','findOne','CmHopper','CampaignId','findAll','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','select','field','phone','NOW()','CmListId','toString','ListId','from','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','deletedAt\x20IS\x20NULL','CampaignId\x20=\x20?','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','destroy','get','UserProfileResource','then','error','name','index','map','Campaign','rawAttributes','type','key','query','keys','filters','intersection','model'];(function(_0x286a1c,_0x11c207){var _0x52f18b=function(_0x55677e){while(--_0x55677e){_0x286a1c['push'](_0x286a1c['shift']());}};_0x52f18b(++_0x11c207);}(_0x1d63,0x14f));var _0x31d6=function(_0x138e88,_0x559802){_0x138e88=_0x138e88-0x0;var _0x452f20=_0x1d63[_0x138e88];return _0x452f20;};'use strict';var emlformat=require(_0x31d6('0x0'));var rimraf=require(_0x31d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x31d6('0x2'));var rp=require(_0x31d6('0x3'));var moment=require(_0x31d6('0x4'));var BPromise=require(_0x31d6('0x5'));var Mustache=require(_0x31d6('0x6'));var util=require(_0x31d6('0x7'));var path=require(_0x31d6('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x31d6('0x9'));var _=require(_0x31d6('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x31d6('0xb'));var deskjs=require(_0x31d6('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x31d6('0xd'));var Redis=require(_0x31d6('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31d6('0xf'));var logger=require(_0x31d6('0x10'))(_0x31d6('0x11'));var utils=require(_0x31d6('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x31d6('0x13'))['db'];function respondWithStatusCode(_0x38f302,_0x4fd486){_0x4fd486=_0x4fd486||0xcc;return function(_0x4cf6b4){if(_0x4cf6b4){return _0x38f302[_0x31d6('0x14')](_0x4fd486);}return _0x38f302['status'](_0x4fd486)[_0x31d6('0x15')]();};}function respondWithResult(_0x1ae053,_0x292b84){_0x292b84=_0x292b84||0xc8;return function(_0xed8063){if(_0xed8063){return _0x1ae053['status'](_0x292b84)['json'](_0xed8063);}};}function respondWithFilteredResult(_0xb5bb6,_0x2af5d1){return function(_0x48628b){if(_0x48628b){var _0x104649=typeof _0x2af5d1[_0x31d6('0x16')]===_0x31d6('0x17')&&typeof _0x2af5d1[_0x31d6('0x18')]===_0x31d6('0x17');var _0x31d80b=_0x48628b[_0x31d6('0x19')];var _0x4554fa=_0x104649?0x0:_0x2af5d1['offset'];var _0x27d283=_0x104649?_0x48628b[_0x31d6('0x19')]:_0x2af5d1[_0x31d6('0x16')]+_0x2af5d1[_0x31d6('0x18')];var _0x2c0552;if(_0x27d283>=_0x31d80b){_0x27d283=_0x31d80b;_0x2c0552=0xc8;}else{_0x2c0552=0xce;}_0xb5bb6[_0x31d6('0x1a')](_0x2c0552);return _0xb5bb6[_0x31d6('0x1b')](_0x31d6('0x1c'),_0x4554fa+'-'+_0x27d283+'/'+_0x31d80b)['json'](_0x48628b);}return null;};}function patchUpdates(_0xe9feaa){return function(_0x1aecde){try{jsonpatch[_0x31d6('0x1d')](_0x1aecde,_0xe9feaa,!![]);}catch(_0x588e42){return BPromise[_0x31d6('0x1e')](_0x588e42);}return _0x1aecde['save']();};}function saveUpdates(_0x441c1a,_0x515619){return function(_0x44db6f){if(_0x44db6f){return _0x44db6f[_0x31d6('0x1f')](_0x441c1a)['then'](function(_0x244bcc){return _0x244bcc;});}return null;};}function removeEntity(_0x16fdcd,_0x10f01b){return function(_0x3a202c){if(_0x3a202c){return _0x3a202c[_0x31d6('0x20')]()['then'](function(){var _0x2c866f=_0x3a202c[_0x31d6('0x21')]({'plain':!![]});var _0x846a4b='IvrCampaigns';return db[_0x31d6('0x22')]['destroy']({'where':{'type':_0x846a4b,'resourceId':_0x2c866f['id']}})[_0x31d6('0x23')](function(){return _0x3a202c;});})[_0x31d6('0x23')](function(){_0x16fdcd[_0x31d6('0x1a')](0xcc)[_0x31d6('0x15')]();});}};}function handleEntityNotFound(_0x27868a,_0x3356f2){return function(_0x238226){if(!_0x238226){_0x27868a[_0x31d6('0x14')](0x194);}return _0x238226;};}function handleError(_0x56af42,_0x18a63e){_0x18a63e=_0x18a63e||0x1f4;return function(_0x10373d){logger[_0x31d6('0x24')](_0x10373d['stack']);if(_0x10373d[_0x31d6('0x25')]){delete _0x10373d['name'];}_0x56af42[_0x31d6('0x1a')](_0x18a63e)['send'](_0x10373d);};}exports[_0x31d6('0x26')]=function(_0xa6b215,_0x4a30ce){var _0x540202={},_0xeaa5b9={},_0x206234={'count':0x0,'rows':[]};var _0x1efce4=_[_0x31d6('0x27')](db[_0x31d6('0x28')][_0x31d6('0x29')],function(_0x1bf6c9){return{'name':_0x1bf6c9['fieldName'],'type':_0x1bf6c9[_0x31d6('0x2a')][_0x31d6('0x2b')]};});_0xeaa5b9['model']=_[_0x31d6('0x27')](_0x1efce4,_0x31d6('0x25'));_0xeaa5b9[_0x31d6('0x2c')]=_[_0x31d6('0x2d')](_0xa6b215[_0x31d6('0x2c')]);_0xeaa5b9[_0x31d6('0x2e')]=_[_0x31d6('0x2f')](_0xeaa5b9[_0x31d6('0x30')],_0xeaa5b9['query']);_0x540202[_0x31d6('0x31')]=_[_0x31d6('0x2f')](_0xeaa5b9['model'],qs['fields'](_0xa6b215[_0x31d6('0x2c')]['fields']));_0x540202['attributes']=_0x540202[_0x31d6('0x31')]['length']?_0x540202['attributes']:_0xeaa5b9[_0x31d6('0x30')];if(!_0xa6b215['query'][_0x31d6('0x32')](_0x31d6('0x33'))){_0x540202[_0x31d6('0x18')]=qs[_0x31d6('0x18')](_0xa6b215[_0x31d6('0x2c')]['limit']);_0x540202[_0x31d6('0x16')]=qs[_0x31d6('0x16')](_0xa6b215[_0x31d6('0x2c')][_0x31d6('0x16')]);}_0x540202[_0x31d6('0x34')]=qs[_0x31d6('0x35')](_0xa6b215[_0x31d6('0x2c')][_0x31d6('0x35')]);_0x540202[_0x31d6('0x36')]=qs[_0x31d6('0x2e')](_[_0x31d6('0x37')](_0xa6b215[_0x31d6('0x2c')],_0xeaa5b9[_0x31d6('0x2e')]),_0x1efce4);if(_0xa6b215[_0x31d6('0x2c')][_0x31d6('0x38')]){_0x540202['where']=_['merge'](_0x540202['where'],{'$or':_[_0x31d6('0x27')](_0x1efce4,function(_0x705a28){if(_0x705a28['type']!==_0x31d6('0x39')){var _0x1f178c={};_0x1f178c[_0x705a28[_0x31d6('0x25')]]={'$like':'%'+_0xa6b215[_0x31d6('0x2c')][_0x31d6('0x38')]+'%'};return _0x1f178c;}})});}_0x540202=_['merge']({},_0x540202,_0xa6b215[_0x31d6('0x3a')]);var _0x3f10a9={'where':_0x540202[_0x31d6('0x36')]};return db[_0x31d6('0x28')]['count'](_0x3f10a9)[_0x31d6('0x23')](function(_0x2e0744){_0x206234[_0x31d6('0x19')]=_0x2e0744;if(_0xa6b215['query'][_0x31d6('0x3b')]){_0x540202[_0x31d6('0x3c')]=[{'all':!![]}];}return db[_0x31d6('0x28')]['findAll'](_0x540202);})[_0x31d6('0x23')](function(_0x53c65f){_0x206234[_0x31d6('0x3d')]=_0x53c65f;return _0x206234;})[_0x31d6('0x23')](respondWithFilteredResult(_0x4a30ce,_0x540202))[_0x31d6('0x3e')](handleError(_0x4a30ce,null));};exports['show']=function(_0x2e03f7,_0x2ad9a5){var _0x2b290d={'raw':![],'where':{'id':_0x2e03f7[_0x31d6('0x3f')]['id']}},_0x32a3a1={};_0x32a3a1[_0x31d6('0x30')]=_[_0x31d6('0x2d')](db[_0x31d6('0x28')][_0x31d6('0x29')]);_0x32a3a1['query']=_[_0x31d6('0x2d')](_0x2e03f7['query']);_0x32a3a1[_0x31d6('0x2e')]=_[_0x31d6('0x2f')](_0x32a3a1[_0x31d6('0x30')],_0x32a3a1['query']);_0x2b290d[_0x31d6('0x31')]=_[_0x31d6('0x2f')](_0x32a3a1['model'],qs['fields'](_0x2e03f7[_0x31d6('0x2c')]['fields']));_0x2b290d[_0x31d6('0x31')]=_0x2b290d[_0x31d6('0x31')][_0x31d6('0x40')]?_0x2b290d[_0x31d6('0x31')]:_0x32a3a1[_0x31d6('0x30')];if(_0x2e03f7[_0x31d6('0x2c')][_0x31d6('0x3b')]){_0x2b290d[_0x31d6('0x3c')]=[{'all':!![]}];}_0x2b290d=_[_0x31d6('0x41')]({},_0x2b290d,_0x2e03f7[_0x31d6('0x3a')]);return db[_0x31d6('0x28')][_0x31d6('0x42')](_0x2b290d)[_0x31d6('0x23')](handleEntityNotFound(_0x2ad9a5,null))[_0x31d6('0x23')](respondWithResult(_0x2ad9a5,null))[_0x31d6('0x3e')](handleError(_0x2ad9a5,null));};exports[_0x31d6('0x43')]=function(_0xd93b61,_0x4b7251){return db[_0x31d6('0x28')][_0x31d6('0x43')](_0xd93b61[_0x31d6('0x44')],{})[_0x31d6('0x23')](function(_0x5bb0a9){var _0x3a1014=_0xd93b61[_0x31d6('0x45')][_0x31d6('0x21')]({'plain':!![]});if(!_0x3a1014)throw new Error(_0x31d6('0x46'));if(_0x3a1014[_0x31d6('0x47')]===_0x31d6('0x45')){var _0x3e237f=_0x5bb0a9[_0x31d6('0x21')]({'plain':!![]});var _0x38861e=_0x31d6('0x48');return db['UserProfileSection']['find']({'where':{'name':_0x38861e,'userProfileId':_0x3a1014[_0x31d6('0x49')]},'raw':!![]})[_0x31d6('0x23')](function(_0x51d869){if(_0x51d869&&_0x51d869[_0x31d6('0x4a')]===0x0){return db[_0x31d6('0x22')]['create']({'name':_0x3e237f[_0x31d6('0x25')],'resourceId':_0x3e237f['id'],'type':_0x51d869[_0x31d6('0x25')],'sectionId':_0x51d869['id']},{})[_0x31d6('0x23')](function(){return _0x5bb0a9;});}else{return _0x5bb0a9;}})[_0x31d6('0x3e')](function(_0x30f833){logger['error'](_0x31d6('0x4b'),_0x30f833);throw _0x30f833;});}return _0x5bb0a9;})[_0x31d6('0x23')](respondWithResult(_0x4b7251,0xc9))['catch'](handleError(_0x4b7251,null));};exports[_0x31d6('0x4c')]=function(_0x22c49d,_0x27df26){var _0x5a5363={'where':{'id':_0x22c49d[_0x31d6('0x3f')]['id']}},_0x797a9d={};_0x797a9d[_0x31d6('0x30')]=_['keys'](db[_0x31d6('0x28')][_0x31d6('0x29')]);_0x5a5363[_0x31d6('0x31')]=_['intersection'](_0x797a9d[_0x31d6('0x30')],qs[_0x31d6('0x4d')](_0x22c49d[_0x31d6('0x2c')][_0x31d6('0x4d')]));_0x5a5363[_0x31d6('0x31')]=_0x5a5363['attributes']['length']?_0x5a5363[_0x31d6('0x31')]:_0x797a9d[_0x31d6('0x30')];if(_0x22c49d['query'][_0x31d6('0x3b')]){_0x5a5363['include']=[{'all':!![]}];}_0x5a5363=_[_0x31d6('0x41')]({},_0x5a5363,_0x22c49d[_0x31d6('0x3a')]);return db[_0x31d6('0x28')][_0x31d6('0x42')](_0x5a5363)['then'](handleEntityNotFound(_0x27df26,null))[_0x31d6('0x23')](function(_0x551803){if(_0x551803){var _0x4d198b=_0x551803[_0x31d6('0x21')]({'plain':!![]});_0x4d198b=qs[_0x31d6('0x4e')](_0x4d198b,['id',_0x31d6('0x4f'),_0x31d6('0x50')]);_0x22c49d[_0x31d6('0x44')]=_[_0x31d6('0x4e')](_0x22c49d[_0x31d6('0x44')],['id','createdAt',_0x31d6('0x50')]);return db[_0x31d6('0x28')][_0x31d6('0x43')](_[_0x31d6('0x41')](_0x4d198b,_0x22c49d[_0x31d6('0x44')]),{'include':_0x22c49d[_0x31d6('0x2c')]['includeAll']?[{'all':!![]}]:undefined})[_0x31d6('0x23')](function(_0x356509){var _0x4c1872=_0x22c49d[_0x31d6('0x45')][_0x31d6('0x21')]({'plain':!![]});if(!_0x4c1872)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c1872[_0x31d6('0x47')]===_0x31d6('0x45')){var _0x346c92=_0x356509[_0x31d6('0x21')]({'plain':!![]});var _0x2bba38=_0x31d6('0x48');return db[_0x31d6('0x51')]['find']({'where':{'name':_0x2bba38,'userProfileId':_0x4c1872[_0x31d6('0x49')]},'raw':!![]})[_0x31d6('0x23')](function(_0x2921c7){if(_0x2921c7&&_0x2921c7['autoAssociation']===0x0){return db[_0x31d6('0x22')][_0x31d6('0x43')]({'name':_0x346c92['name'],'resourceId':_0x346c92['id'],'type':_0x2921c7[_0x31d6('0x25')],'sectionId':_0x2921c7['id']},{})['then'](function(){return _0x356509;});}else{return _0x356509;}})[_0x31d6('0x3e')](function(_0x12c0d0){logger[_0x31d6('0x24')](_0x31d6('0x4b'),_0x12c0d0);throw _0x12c0d0;});}return _0x356509;});}})[_0x31d6('0x23')](respondWithResult(_0x27df26,0xc9))[_0x31d6('0x3e')](handleError(_0x27df26,null));};exports[_0x31d6('0x1f')]=function(_0x21e58e,_0x23d830){if(_0x21e58e[_0x31d6('0x44')]['id']){delete _0x21e58e[_0x31d6('0x44')]['id'];}return db[_0x31d6('0x28')][_0x31d6('0x42')]({'where':{'id':_0x21e58e[_0x31d6('0x3f')]['id']}})[_0x31d6('0x23')](handleEntityNotFound(_0x23d830,null))[_0x31d6('0x23')](saveUpdates(_0x21e58e['body'],null))['then'](respondWithResult(_0x23d830,null))[_0x31d6('0x3e')](handleError(_0x23d830,null));};exports[_0x31d6('0x20')]=function(_0x1d82ca,_0x78eba5){return db[_0x31d6('0x28')][_0x31d6('0x42')]({'where':{'id':_0x1d82ca['params']['id']}})['then'](handleEntityNotFound(_0x78eba5,null))[_0x31d6('0x23')](removeEntity(_0x78eba5,null))[_0x31d6('0x3e')](handleError(_0x78eba5,null));};exports[_0x31d6('0x52')]=function(_0x320219,_0x4f8a59,_0x3f71f9){var _0x403898={'raw':!![],'where':{}};var _0x1d1807={};var _0x1cbb96={'count':0x0,'rows':[]};return db[_0x31d6('0x28')][_0x31d6('0x53')]({'where':{'id':_0x320219[_0x31d6('0x3f')]['id']}})[_0x31d6('0x23')](handleEntityNotFound(_0x4f8a59,null))[_0x31d6('0x23')](function(_0x4fa786){if(_0x4fa786){_0x1d1807[_0x31d6('0x30')]=_[_0x31d6('0x2d')](db[_0x31d6('0x54')][_0x31d6('0x29')]);_0x1d1807['query']=_[_0x31d6('0x2d')](_0x320219['query']);_0x1d1807['filters']=_[_0x31d6('0x2f')](_0x1d1807[_0x31d6('0x30')],_0x1d1807[_0x31d6('0x2c')]);_0x403898[_0x31d6('0x31')]=_[_0x31d6('0x2f')](_0x1d1807[_0x31d6('0x30')],qs['fields'](_0x320219[_0x31d6('0x2c')][_0x31d6('0x4d')]));_0x403898[_0x31d6('0x31')]=_0x403898[_0x31d6('0x31')][_0x31d6('0x40')]?_0x403898[_0x31d6('0x31')]:_0x1d1807[_0x31d6('0x30')];if(!_0x320219[_0x31d6('0x2c')][_0x31d6('0x32')](_0x31d6('0x33'))){_0x403898[_0x31d6('0x18')]=qs[_0x31d6('0x18')](_0x320219[_0x31d6('0x2c')][_0x31d6('0x18')]);_0x403898[_0x31d6('0x16')]=qs[_0x31d6('0x16')](_0x320219[_0x31d6('0x2c')][_0x31d6('0x16')]);}_0x403898[_0x31d6('0x34')]=qs['sort'](_0x320219[_0x31d6('0x2c')][_0x31d6('0x35')]);_0x403898[_0x31d6('0x36')]=qs[_0x31d6('0x2e')](_[_0x31d6('0x37')](_0x320219['query'],_0x1d1807[_0x31d6('0x2e')]));_0x403898[_0x31d6('0x36')][_0x31d6('0x55')]=_0x4fa786['id'];if(_0x320219[_0x31d6('0x2c')][_0x31d6('0x38')]){_0x403898[_0x31d6('0x36')]=_['merge'](_0x403898['where'],{'$or':_[_0x31d6('0x27')](_0x403898[_0x31d6('0x31')],function(_0x4437b1){var _0x5c929a={};_0x5c929a[_0x4437b1]={'$like':'%'+_0x320219['query'][_0x31d6('0x38')]+'%'};return _0x5c929a;})});}_0x403898=_[_0x31d6('0x41')]({},_0x403898,_0x320219['options']);return db[_0x31d6('0x54')][_0x31d6('0x19')]({'where':_0x403898['where']})[_0x31d6('0x23')](function(_0x1b1b30){_0x1cbb96[_0x31d6('0x19')]=_0x1b1b30;if(_0x320219[_0x31d6('0x2c')]['includeAll']){_0x403898[_0x31d6('0x3c')]=[{'all':!![]}];}return db[_0x31d6('0x54')][_0x31d6('0x56')](_0x403898);})[_0x31d6('0x23')](function(_0x48834a){_0x1cbb96['rows']=_0x48834a;return _0x1cbb96;});}})[_0x31d6('0x23')](respondWithFilteredResult(_0x4f8a59,_0x403898))[_0x31d6('0x3e')](handleError(_0x4f8a59,null));};exports['getHopperHistories']=function(_0x5b8631,_0x2842cd,_0x2dea83){var _0x7071a9={'raw':!![],'where':{}};var _0x1f87dd={};var _0x2fd215={'count':0x0,'rows':[]};return db[_0x31d6('0x28')][_0x31d6('0x53')]({'where':{'id':_0x5b8631[_0x31d6('0x3f')]['id']}})[_0x31d6('0x23')](handleEntityNotFound(_0x2842cd,null))['then'](function(_0x167f08){if(_0x167f08){_0x1f87dd[_0x31d6('0x30')]=_[_0x31d6('0x2d')](db[_0x31d6('0x57')][_0x31d6('0x29')]);_0x1f87dd['query']=_[_0x31d6('0x2d')](_0x5b8631[_0x31d6('0x2c')]);_0x1f87dd['filters']=_['intersection'](_0x1f87dd['model'],_0x1f87dd[_0x31d6('0x2c')]);_0x7071a9['attributes']=_[_0x31d6('0x2f')](_0x1f87dd[_0x31d6('0x30')],qs[_0x31d6('0x4d')](_0x5b8631[_0x31d6('0x2c')][_0x31d6('0x4d')]));_0x7071a9[_0x31d6('0x31')]=_0x7071a9[_0x31d6('0x31')][_0x31d6('0x40')]?_0x7071a9[_0x31d6('0x31')]:_0x1f87dd['model'];if(!_0x5b8631['query'][_0x31d6('0x32')]('nolimit')){_0x7071a9[_0x31d6('0x18')]=qs[_0x31d6('0x18')](_0x5b8631['query'][_0x31d6('0x18')]);_0x7071a9['offset']=qs[_0x31d6('0x16')](_0x5b8631['query'][_0x31d6('0x16')]);}_0x7071a9['order']=qs[_0x31d6('0x35')](_0x5b8631[_0x31d6('0x2c')]['sort']);_0x7071a9[_0x31d6('0x36')]=qs['filters'](_[_0x31d6('0x37')](_0x5b8631[_0x31d6('0x2c')],_0x1f87dd[_0x31d6('0x2e')]));_0x7071a9[_0x31d6('0x36')][_0x31d6('0x55')]=_0x167f08['id'];if(_0x5b8631['query'][_0x31d6('0x38')]){_0x7071a9['where']=_[_0x31d6('0x41')](_0x7071a9['where'],{'$or':_['map'](_0x7071a9['attributes'],function(_0x3456d4){var _0x59db63={};_0x59db63[_0x3456d4]={'$like':'%'+_0x5b8631['query'][_0x31d6('0x38')]+'%'};return _0x59db63;})});}_0x7071a9=_['merge']({},_0x7071a9,_0x5b8631[_0x31d6('0x3a')]);return db[_0x31d6('0x57')]['count']({'where':_0x7071a9[_0x31d6('0x36')]})[_0x31d6('0x23')](function(_0x5aba69){_0x2fd215[_0x31d6('0x19')]=_0x5aba69;if(_0x5b8631[_0x31d6('0x2c')]['includeAll']){_0x7071a9[_0x31d6('0x3c')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x31d6('0x56')](_0x7071a9);})[_0x31d6('0x23')](function(_0x72dd06){_0x2fd215[_0x31d6('0x3d')]=_0x72dd06;return _0x2fd215;});}})[_0x31d6('0x23')](respondWithFilteredResult(_0x2842cd,_0x7071a9))['catch'](handleError(_0x2842cd,null));};exports['getHopperFinals']=function(_0xbcce78,_0x1fa85b,_0x1768c1){var _0x453a8e={'raw':!![],'where':{}};var _0x248de6={};var _0x2e9302={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0xbcce78[_0x31d6('0x3f')]['id']}})[_0x31d6('0x23')](handleEntityNotFound(_0x1fa85b,null))[_0x31d6('0x23')](function(_0x35c501){if(_0x35c501){_0x248de6['model']=_[_0x31d6('0x2d')](db[_0x31d6('0x58')][_0x31d6('0x29')]);_0x248de6[_0x31d6('0x2c')]=_['keys'](_0xbcce78['query']);_0x248de6[_0x31d6('0x2e')]=_['intersection'](_0x248de6[_0x31d6('0x30')],_0x248de6[_0x31d6('0x2c')]);_0x453a8e[_0x31d6('0x31')]=_[_0x31d6('0x2f')](_0x248de6[_0x31d6('0x30')],qs['fields'](_0xbcce78[_0x31d6('0x2c')]['fields']));_0x453a8e[_0x31d6('0x31')]=_0x453a8e[_0x31d6('0x31')][_0x31d6('0x40')]?_0x453a8e[_0x31d6('0x31')]:_0x248de6[_0x31d6('0x30')];if(!_0xbcce78[_0x31d6('0x2c')]['hasOwnProperty'](_0x31d6('0x33'))){_0x453a8e[_0x31d6('0x18')]=qs[_0x31d6('0x18')](_0xbcce78[_0x31d6('0x2c')][_0x31d6('0x18')]);_0x453a8e[_0x31d6('0x16')]=qs[_0x31d6('0x16')](_0xbcce78['query']['offset']);}_0x453a8e[_0x31d6('0x34')]=qs[_0x31d6('0x35')](_0xbcce78[_0x31d6('0x2c')]['sort']);_0x453a8e[_0x31d6('0x36')]=qs['filters'](_[_0x31d6('0x37')](_0xbcce78[_0x31d6('0x2c')],_0x248de6['filters']));_0x453a8e[_0x31d6('0x36')][_0x31d6('0x55')]=_0x35c501['id'];if(_0xbcce78[_0x31d6('0x2c')][_0x31d6('0x38')]){_0x453a8e[_0x31d6('0x36')]=_['merge'](_0x453a8e[_0x31d6('0x36')],{'$or':_[_0x31d6('0x27')](_0x453a8e['attributes'],function(_0x52fb8b){var _0x1d7696={};_0x1d7696[_0x52fb8b]={'$like':'%'+_0xbcce78[_0x31d6('0x2c')][_0x31d6('0x38')]+'%'};return _0x1d7696;})});}_0x453a8e=_[_0x31d6('0x41')]({},_0x453a8e,_0xbcce78['options']);return db['CmHopperFinal'][_0x31d6('0x19')]({'where':_0x453a8e[_0x31d6('0x36')]})[_0x31d6('0x23')](function(_0x2e8591){_0x2e9302['count']=_0x2e8591;if(_0xbcce78[_0x31d6('0x2c')][_0x31d6('0x3b')]){_0x453a8e[_0x31d6('0x3c')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x31d6('0x56')](_0x453a8e);})['then'](function(_0x2450b2){_0x2e9302[_0x31d6('0x3d')]=_0x2450b2;return _0x2e9302;});}})[_0x31d6('0x23')](respondWithFilteredResult(_0x1fa85b,_0x453a8e))[_0x31d6('0x3e')](handleError(_0x1fa85b,null));};exports[_0x31d6('0x59')]=function(_0x160156,_0x44f4ef,_0x1f799b){var _0x2f0035={'raw':!![],'where':{}};var _0x586399={};var _0xda715b={'count':0x0,'rows':[]};return db[_0x31d6('0x28')][_0x31d6('0x53')]({'where':{'id':_0x160156['params']['id']}})[_0x31d6('0x23')](handleEntityNotFound(_0x44f4ef,null))[_0x31d6('0x23')](function(_0x1e667b){if(_0x1e667b){_0x586399[_0x31d6('0x30')]=_[_0x31d6('0x2d')](db[_0x31d6('0x5a')][_0x31d6('0x29')]);_0x586399['query']=_[_0x31d6('0x2d')](_0x160156[_0x31d6('0x2c')]);_0x586399[_0x31d6('0x2e')]=_[_0x31d6('0x2f')](_0x586399[_0x31d6('0x30')],_0x586399[_0x31d6('0x2c')]);_0x2f0035[_0x31d6('0x31')]=_[_0x31d6('0x2f')](_0x586399[_0x31d6('0x30')],qs['fields'](_0x160156[_0x31d6('0x2c')][_0x31d6('0x4d')]));_0x2f0035[_0x31d6('0x31')]=_0x2f0035[_0x31d6('0x31')][_0x31d6('0x40')]?_0x2f0035['attributes']:_0x586399[_0x31d6('0x30')];if(!_0x160156[_0x31d6('0x2c')][_0x31d6('0x32')](_0x31d6('0x33'))){_0x2f0035['limit']=qs[_0x31d6('0x18')](_0x160156['query']['limit']);_0x2f0035['offset']=qs['offset'](_0x160156[_0x31d6('0x2c')][_0x31d6('0x16')]);}_0x2f0035[_0x31d6('0x34')]=qs[_0x31d6('0x35')](_0x160156['query'][_0x31d6('0x35')]);_0x2f0035[_0x31d6('0x36')]=qs[_0x31d6('0x2e')](_['pick'](_0x160156['query'],_0x586399[_0x31d6('0x2e')]));_0x2f0035[_0x31d6('0x36')][_0x31d6('0x55')]=_0x1e667b['id'];if(_0x160156['query'][_0x31d6('0x38')]){_0x2f0035[_0x31d6('0x36')]=_[_0x31d6('0x41')](_0x2f0035[_0x31d6('0x36')],{'$or':_[_0x31d6('0x27')](_0x2f0035[_0x31d6('0x31')],function(_0x182413){var _0x1149bd={};_0x1149bd[_0x182413]={'$like':'%'+_0x160156[_0x31d6('0x2c')][_0x31d6('0x38')]+'%'};return _0x1149bd;})});}_0x2f0035=_['merge']({},_0x2f0035,_0x160156[_0x31d6('0x3a')]);return db[_0x31d6('0x5a')][_0x31d6('0x19')]({'where':_0x2f0035[_0x31d6('0x36')]})['then'](function(_0x1cdae0){_0xda715b['count']=_0x1cdae0;if(_0x160156['query'][_0x31d6('0x3b')]){_0x2f0035[_0x31d6('0x3c')]=[{'all':!![]}];}return db[_0x31d6('0x5a')][_0x31d6('0x56')](_0x2f0035);})[_0x31d6('0x23')](function(_0x48715){_0xda715b[_0x31d6('0x3d')]=_0x48715;return _0xda715b;});}})[_0x31d6('0x23')](respondWithFilteredResult(_0x44f4ef,_0x2f0035))[_0x31d6('0x3e')](handleError(_0x44f4ef,null));};exports['getLists']=function(_0x156438,_0x34ab84,_0x46b42e){var _0x5221f4={};var _0xb8481c={};var _0xfef001;var _0x3e7c3a;return db[_0x31d6('0x28')][_0x31d6('0x53')]({'where':{'id':_0x156438['params']['id']}})[_0x31d6('0x23')](handleEntityNotFound(_0x34ab84,null))[_0x31d6('0x23')](function(_0x33138e){if(_0x33138e){_0xfef001=_0x33138e;_0xb8481c[_0x31d6('0x30')]=_[_0x31d6('0x2d')](db['CmList'][_0x31d6('0x29')]);_0xb8481c[_0x31d6('0x2c')]=_['keys'](_0x156438[_0x31d6('0x2c')]);_0xb8481c[_0x31d6('0x2e')]=_[_0x31d6('0x2f')](_0xb8481c[_0x31d6('0x30')],_0xb8481c[_0x31d6('0x2c')]);_0x5221f4['attributes']=_['intersection'](_0xb8481c[_0x31d6('0x30')],qs['fields'](_0x156438[_0x31d6('0x2c')][_0x31d6('0x4d')]));_0x5221f4[_0x31d6('0x31')]=_0x5221f4[_0x31d6('0x31')][_0x31d6('0x40')]?_0x5221f4['attributes']:_0xb8481c['model'];_0x5221f4[_0x31d6('0x34')]=qs[_0x31d6('0x35')](_0x156438['query']['sort']);_0x5221f4[_0x31d6('0x36')]=qs['filters'](_[_0x31d6('0x37')](_0x156438['query'],_0xb8481c[_0x31d6('0x2e')]));if(_0x156438[_0x31d6('0x2c')][_0x31d6('0x38')]){_0x5221f4[_0x31d6('0x36')]=_[_0x31d6('0x41')](_0x5221f4[_0x31d6('0x36')],{'$or':_[_0x31d6('0x27')](_0x5221f4[_0x31d6('0x31')],function(_0xf61b07){var _0x7cef0f={};_0x7cef0f[_0xf61b07]={'$like':'%'+_0x156438[_0x31d6('0x2c')]['filter']+'%'};return _0x7cef0f;})});}_0x5221f4=_['merge']({},_0x5221f4,_0x156438['options']);return _0xfef001[_0x31d6('0x5b')](_0x5221f4);}})['then'](function(_0x3839ba){if(_0x3839ba){_0x3e7c3a=_0x3839ba[_0x31d6('0x40')];if(!_0x156438[_0x31d6('0x2c')][_0x31d6('0x32')](_0x31d6('0x33'))){_0x5221f4[_0x31d6('0x18')]=qs[_0x31d6('0x18')](_0x156438['query'][_0x31d6('0x18')]);_0x5221f4[_0x31d6('0x16')]=qs[_0x31d6('0x16')](_0x156438[_0x31d6('0x2c')][_0x31d6('0x16')]);}return _0xfef001['getLists'](_0x5221f4);}})[_0x31d6('0x23')](function(_0x5bc7a1){if(_0x5bc7a1){return _0x5bc7a1?{'count':_0x3e7c3a,'rows':_0x5bc7a1}:null;}})[_0x31d6('0x23')](respondWithResult(_0x34ab84,null))[_0x31d6('0x3e')](handleError(_0x34ab84,null));};exports[_0x31d6('0x5c')]=function(_0x5af015,_0x11f8af,_0x5d5e50){var _0x29ab01,_0x188836;return db['Campaign']['find']({'where':{'id':_0x5af015[_0x31d6('0x3f')]['id']}})[_0x31d6('0x23')](handleEntityNotFound(_0x11f8af,null))[_0x31d6('0x23')](function(_0x226381){if(_0x226381){_0x188836=_0x226381;return _0x226381['addLists'](_0x5af015['body']['ids'],_[_0x31d6('0x4e')](_0x5af015[_0x31d6('0x44')],[_0x31d6('0x5d'),'id'])||{});}return null;})['spread'](function(_0x4c2a69){var _0x89b101;_0x29ab01=_0x4c2a69||[];var _0x46ac63=[];if(_0x4c2a69){for(var _0x2503ae=0x0;_0x2503ae<_0x4c2a69[_0x31d6('0x40')];_0x2503ae+=0x1){var _0x322f04=_0x4c2a69[_0x2503ae][_0x31d6('0x21')]({'plain':!![]});_0x188836['dialCheckDuplicateType']=_0x5af015[_0x31d6('0x44')][_0x31d6('0x5e')]?_0x5af015['body'][_0x31d6('0x5e')]:_0x188836[_0x31d6('0x5e')];switch(_0x188836[_0x31d6('0x5e')]){case _0x31d6('0x5f'):_0x89b101=squel[_0x31d6('0x60')]()[_0x31d6('0x61')](_0x31d6('0x62'))[_0x31d6('0x63')](['phone',_0x31d6('0x64'),_0x31d6('0x65'),'ListId',_0x31d6('0x55'),_0x31d6('0x4f'),_0x31d6('0x50')],squel[_0x31d6('0x66')]()[_0x31d6('0x67')](_0x31d6('0x68'),_0x31d6('0x68'))['field'](_0x31d6('0x69'),_0x31d6('0x64'))[_0x31d6('0x67')]('id',_0x31d6('0x65'))['field'](_0x322f04[_0x31d6('0x6a')][_0x31d6('0x6b')](),_0x31d6('0x6c'))['field'](_0x5af015[_0x31d6('0x3f')]['id'][_0x31d6('0x6b')](),'CampaignId')[_0x31d6('0x67')]('NOW()',_0x31d6('0x4f'))['field'](_0x31d6('0x69'),_0x31d6('0x50'))[_0x31d6('0x6d')]('cm_contacts')[_0x31d6('0x36')]('deletedAt\x20IS\x20NULL')[_0x31d6('0x36')](_0x31d6('0x6e'),_0x322f04[_0x31d6('0x6a')][_0x31d6('0x6b')]())['where'](_0x31d6('0x6f'))[_0x31d6('0x36')]('phone\x20NOT\x20IN\x20(?)',squel[_0x31d6('0x66')]()['field'](_0x31d6('0x70'))['from'](_0x31d6('0x71'))['where']('CampaignId\x20=\x20?',_0x5af015[_0x31d6('0x3f')]['id'][_0x31d6('0x6b')]()))[_0x31d6('0x36')](_0x31d6('0x72'),squel[_0x31d6('0x66')]()[_0x31d6('0x67')](_0x31d6('0x73'))[_0x31d6('0x6d')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0x5af015['params']['id'][_0x31d6('0x6b')]())))[_0x31d6('0x6b')]();break;case _0x31d6('0x74'):_0x89b101=squel['insert']()[_0x31d6('0x61')](_0x31d6('0x62'))['fromQuery']([_0x31d6('0x68'),'scheduledAt',_0x31d6('0x65'),_0x31d6('0x6c'),_0x31d6('0x55'),_0x31d6('0x4f'),_0x31d6('0x50')],squel[_0x31d6('0x66')]()[_0x31d6('0x67')](_0x31d6('0x68'),_0x31d6('0x68'))[_0x31d6('0x67')](_0x31d6('0x69'),_0x31d6('0x64'))['field']('id',_0x31d6('0x65'))['field'](_0x322f04[_0x31d6('0x6a')][_0x31d6('0x6b')](),_0x31d6('0x6c'))[_0x31d6('0x67')](_0x5af015[_0x31d6('0x3f')]['id']['toString'](),_0x31d6('0x55'))['field']('NOW()',_0x31d6('0x4f'))[_0x31d6('0x67')](_0x31d6('0x69'),'updatedAt')[_0x31d6('0x6d')](_0x31d6('0x75'))[_0x31d6('0x36')](_0x31d6('0x76'))[_0x31d6('0x36')](_0x31d6('0x6e'),_0x322f04[_0x31d6('0x6a')][_0x31d6('0x6b')]())['where'](_0x31d6('0x6f'))[_0x31d6('0x36')]('phone\x20NOT\x20IN\x20(?)',squel[_0x31d6('0x66')]()[_0x31d6('0x67')](_0x31d6('0x73'))[_0x31d6('0x6d')](_0x31d6('0x62'))[_0x31d6('0x36')](_0x31d6('0x77'),_0x5af015['params']['id'][_0x31d6('0x6b')]())))[_0x31d6('0x6b')]();break;default:_0x89b101=squel[_0x31d6('0x60')]()[_0x31d6('0x61')](_0x31d6('0x62'))[_0x31d6('0x63')]([_0x31d6('0x68'),'scheduledAt','ContactId',_0x31d6('0x6c'),_0x31d6('0x55'),_0x31d6('0x4f'),_0x31d6('0x50')],squel[_0x31d6('0x66')]()['field'](_0x31d6('0x68'),_0x31d6('0x68'))[_0x31d6('0x67')](_0x31d6('0x69'),_0x31d6('0x64'))[_0x31d6('0x67')]('id',_0x31d6('0x65'))[_0x31d6('0x67')](_0x322f04[_0x31d6('0x6a')][_0x31d6('0x6b')](),_0x31d6('0x6c'))[_0x31d6('0x67')](_0x5af015[_0x31d6('0x3f')]['id'][_0x31d6('0x6b')](),_0x31d6('0x55'))[_0x31d6('0x67')]('NOW()','createdAt')[_0x31d6('0x67')]('NOW()',_0x31d6('0x50'))['from'](_0x31d6('0x75'))[_0x31d6('0x36')](_0x31d6('0x76'))['where']('ListId\x20=\x20?',_0x322f04[_0x31d6('0x6a')][_0x31d6('0x6b')]())[_0x31d6('0x36')]('phone\x20IS\x20NOT\x20NULL'))[_0x31d6('0x6b')]();}_0x46ac63[_0x31d6('0x78')](db['sequelize'][_0x31d6('0x2c')](_0x89b101));}return BPromise[_0x31d6('0x79')](_0x46ac63);}})['then'](function(){return _0x29ab01;})['then'](respondWithResult(_0x11f8af,null))['catch'](handleError(_0x11f8af,null));};exports[_0x31d6('0x7a')]=function(_0x2cdfcd,_0x10e2c0,_0x5b49e6){return db[_0x31d6('0x28')][_0x31d6('0x42')]({'where':{'id':_0x2cdfcd[_0x31d6('0x3f')]['id']}})[_0x31d6('0x23')](handleEntityNotFound(_0x10e2c0,null))[_0x31d6('0x23')](function(_0x2024b3){if(_0x2024b3){return _0x2024b3[_0x31d6('0x7a')](_0x2cdfcd['query'][_0x31d6('0x5d')]);}})[_0x31d6('0x23')](function(_0x4efb55){if(_0x4efb55){return db[_0x31d6('0x54')][_0x31d6('0x20')]({'where':{'ListId':_0x2cdfcd[_0x31d6('0x2c')]['ids'],'CampaignId':_0x2cdfcd[_0x31d6('0x3f')]['id']}})[_0x31d6('0x23')](function(){return _0x4efb55;});}})[_0x31d6('0x23')](respondWithStatusCode(_0x10e2c0,null))[_0x31d6('0x3e')](handleError(_0x10e2c0,null));};exports[_0x31d6('0x7b')]=function(_0x50fc83,_0xc526b4,_0x3cdc53){var _0x432fca={};var _0x149f10={};var _0x1bdb0e;var _0xf65e76;return db[_0x31d6('0x28')]['findOne']({'where':{'id':_0x50fc83[_0x31d6('0x3f')]['id']}})['then'](handleEntityNotFound(_0xc526b4,null))[_0x31d6('0x23')](function(_0xda0a03){if(_0xda0a03){_0x1bdb0e=_0xda0a03;_0x149f10['model']=_[_0x31d6('0x2d')](db['CmList'][_0x31d6('0x29')]);_0x149f10[_0x31d6('0x2c')]=_[_0x31d6('0x2d')](_0x50fc83[_0x31d6('0x2c')]);_0x149f10['filters']=_['intersection'](_0x149f10[_0x31d6('0x30')],_0x149f10[_0x31d6('0x2c')]);_0x432fca[_0x31d6('0x31')]=_[_0x31d6('0x2f')](_0x149f10['model'],qs['fields'](_0x50fc83[_0x31d6('0x2c')][_0x31d6('0x4d')]));_0x432fca[_0x31d6('0x31')]=_0x432fca[_0x31d6('0x31')][_0x31d6('0x40')]?_0x432fca[_0x31d6('0x31')]:_0x149f10[_0x31d6('0x30')];_0x432fca[_0x31d6('0x34')]=qs['sort'](_0x50fc83[_0x31d6('0x2c')][_0x31d6('0x35')]);_0x432fca['where']=qs[_0x31d6('0x2e')](_[_0x31d6('0x37')](_0x50fc83['query'],_0x149f10[_0x31d6('0x2e')]));if(_0x50fc83['query'][_0x31d6('0x38')]){_0x432fca['where']=_['merge'](_0x432fca['where'],{'$or':_['map'](_0x432fca['attributes'],function(_0x490d93){var _0x50f2b2={};_0x50f2b2[_0x490d93]={'$like':'%'+_0x50fc83[_0x31d6('0x2c')]['filter']+'%'};return _0x50f2b2;})});}_0x432fca=_[_0x31d6('0x41')]({},_0x432fca,_0x50fc83[_0x31d6('0x3a')]);return _0x1bdb0e[_0x31d6('0x7b')](_0x432fca);}})[_0x31d6('0x23')](function(_0x2efcda){if(_0x2efcda){_0xf65e76=_0x2efcda[_0x31d6('0x40')];if(!_0x50fc83[_0x31d6('0x2c')]['hasOwnProperty'](_0x31d6('0x33'))){_0x432fca[_0x31d6('0x18')]=qs['limit'](_0x50fc83[_0x31d6('0x2c')][_0x31d6('0x18')]);_0x432fca[_0x31d6('0x16')]=qs['offset'](_0x50fc83[_0x31d6('0x2c')][_0x31d6('0x16')]);}return _0x1bdb0e[_0x31d6('0x7b')](_0x432fca);}})[_0x31d6('0x23')](function(_0x390fd7){if(_0x390fd7){return _0x390fd7?{'count':_0xf65e76,'rows':_0x390fd7}:null;}})[_0x31d6('0x23')](respondWithResult(_0xc526b4,null))[_0x31d6('0x3e')](handleError(_0xc526b4,null));};exports[_0x31d6('0x7c')]=function(_0x4b7afe,_0x1da08c,_0x1b5515){var _0x5cd950,_0x3f7bfe;return db[_0x31d6('0x28')][_0x31d6('0x42')]({'where':{'id':_0x4b7afe[_0x31d6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1da08c,null))['then'](function(_0x4eb783){if(_0x4eb783){_0x3f7bfe=_0x4eb783;return _0x4eb783[_0x31d6('0x7c')](_0x4b7afe['body'][_0x31d6('0x5d')],_['omit'](_0x4b7afe['body'],['ids','id'])||{});}return null;})['spread'](function(_0x5e7d62){var _0x4ecbb3;_0x5cd950=_0x5e7d62||[];var _0x1950f2=[];if(_0x5e7d62){for(var _0x3ffb84=0x0;_0x3ffb84<_0x5e7d62[_0x31d6('0x40')];_0x3ffb84+=0x1){var _0x542b62=_0x5e7d62[_0x3ffb84]['get']({'plain':!![]});_0x4ecbb3=squel[_0x31d6('0x60')]()[_0x31d6('0x61')](_0x31d6('0x7d'))[_0x31d6('0x63')]([_0x31d6('0x68'),_0x31d6('0x65'),'ListId',_0x31d6('0x55'),_0x31d6('0x4f'),_0x31d6('0x50')],squel['select']()['field']('phone',_0x31d6('0x68'))[_0x31d6('0x67')]('id',_0x31d6('0x65'))[_0x31d6('0x67')](_0x542b62[_0x31d6('0x6a')][_0x31d6('0x6b')](),'ListId')[_0x31d6('0x67')](_0x4b7afe['params']['id'][_0x31d6('0x6b')](),_0x31d6('0x55'))[_0x31d6('0x67')](_0x31d6('0x69'),_0x31d6('0x4f'))[_0x31d6('0x67')](_0x31d6('0x69'),'updatedAt')['from'](_0x31d6('0x75'))[_0x31d6('0x36')]('deletedAt\x20IS\x20NULL')[_0x31d6('0x36')](_0x31d6('0x6e'),_0x542b62[_0x31d6('0x6a')][_0x31d6('0x6b')]())[_0x31d6('0x36')]('phone\x20IS\x20NOT\x20NULL'))[_0x31d6('0x6b')]();_0x1950f2['push'](db[_0x31d6('0x7e')]['query'](_0x4ecbb3));}return BPromise['all'](_0x1950f2);}})[_0x31d6('0x23')](function(){return _0x5cd950;})[_0x31d6('0x23')](respondWithResult(_0x1da08c,null))[_0x31d6('0x3e')](handleError(_0x1da08c,null));};exports[_0x31d6('0x7f')]=function(_0x1e2b51,_0xc3419b,_0x274d60){return db['Campaign'][_0x31d6('0x42')]({'where':{'id':_0x1e2b51[_0x31d6('0x3f')]['id']}})[_0x31d6('0x23')](handleEntityNotFound(_0xc3419b,null))[_0x31d6('0x23')](function(_0x156dd4){if(_0x156dd4){return _0x156dd4['removeBlackLists'](_0x1e2b51[_0x31d6('0x2c')][_0x31d6('0x5d')]);}})[_0x31d6('0x23')](function(_0x3d0218){if(_0x3d0218){return db[_0x31d6('0x5a')][_0x31d6('0x20')]({'where':{'ListId':_0x1e2b51[_0x31d6('0x2c')][_0x31d6('0x5d')],'CampaignId':_0x1e2b51[_0x31d6('0x3f')]['id']}})['then'](function(){return _0x3d0218;});}})[_0x31d6('0x23')](respondWithStatusCode(_0xc3419b,null))[_0x31d6('0x3e')](handleError(_0xc3419b,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 65d6cb7..735c60c 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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x40b7ec,_0x307707){var _0x72b976=function(_0x5bfcc3){while(--_0x5bfcc3){_0x40b7ec['push'](_0x40b7ec['shift']());}};_0x72b976(++_0x307707);}(_0x7a54,0x106));var _0x47a5=function(_0x4e02a1,_0x43b5d0){_0x4e02a1=_0x4e02a1-0x0;var _0x30d550=_0x7a54[_0x4e02a1];return _0x30d550;};'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 d300d45..c4c27e7 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 _0xb945=['../../config/logger','rpc','../../config/environment','jayson/promise','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','GetCampaign','stringify','lodash','moment','randomstring','../../config/utils'];(function(_0x3ad751,_0x4111fd){var _0x1039e9=function(_0x35c6a7){while(--_0x35c6a7){_0x3ad751['push'](_0x3ad751['shift']());}};_0x1039e9(++_0x4111fd);}(_0xb945,0x97));var _0x5b94=function(_0xcedf57,_0x335b10){_0xcedf57=_0xcedf57-0x0;var _0x35eccf=_0xb945[_0xcedf57];return _0x35eccf;};'use strict';var _=require(_0x5b94('0x0'));var util=require('util');var moment=require(_0x5b94('0x1'));var BPromise=require('bluebird');var rs=require(_0x5b94('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5b94('0x3'));var logger=require(_0x5b94('0x4'))(_0x5b94('0x5'));var config=require(_0x5b94('0x6'));var jayson=require(_0x5b94('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2db8d8,_0x2cfea8,_0x42bd69){return new BPromise(function(_0x186d22,_0x5d2448){return client[_0x5b94('0x8')](_0x2db8d8,_0x42bd69)['then'](function(_0x3e7695){logger[_0x5b94('0x9')](_0x5b94('0xa'),_0x2cfea8,_0x5b94('0xb'));logger[_0x5b94('0xc')](_0x5b94('0xd'),_0x2cfea8,_0x5b94('0xb'),JSON['stringify'](_0x3e7695));if(_0x3e7695[_0x5b94('0xe')]){if(_0x3e7695['error'][_0x5b94('0xf')]===0x1f4){logger[_0x5b94('0xe')](_0x5b94('0xa'),_0x2cfea8,_0x3e7695[_0x5b94('0xe')][_0x5b94('0x10')]);return _0x5d2448(_0x3e7695['error'][_0x5b94('0x10')]);}logger[_0x5b94('0xe')](_0x5b94('0xa'),_0x2cfea8,_0x3e7695[_0x5b94('0xe')]['message']);return _0x186d22(_0x3e7695[_0x5b94('0xe')]['message']);}else{logger[_0x5b94('0x9')](_0x5b94('0xa'),_0x2cfea8,'request\x20sent');_0x186d22(_0x3e7695[_0x5b94('0x11')][_0x5b94('0x10')]);}})[_0x5b94('0x12')](function(_0x537c8e){logger[_0x5b94('0xe')](_0x5b94('0xa'),_0x2cfea8,_0x537c8e);_0x5d2448(_0x537c8e);});});}exports['GetCampaign']=function(_0x2bb003){var _0x1171ac=this;return new Promise(function(_0x1b5874,_0x5f389e){return db[_0x5b94('0x13')][_0x5b94('0x14')]({'raw':_0x2bb003['options']?_0x2bb003[_0x5b94('0x15')][_0x5b94('0x16')]===undefined?!![]:![]:!![],'where':_0x2bb003[_0x5b94('0x15')]?_0x2bb003[_0x5b94('0x15')][_0x5b94('0x17')]||null:null,'attributes':_0x2bb003['options']?_0x2bb003[_0x5b94('0x15')][_0x5b94('0x18')]||null:null,'limit':_0x2bb003['options']?_0x2bb003['options'][_0x5b94('0x19')]||null:null,'include':_0x2bb003[_0x5b94('0x15')]?_0x2bb003[_0x5b94('0x15')][_0x5b94('0x1a')]?_[_0x5b94('0x1b')](_0x2bb003[_0x5b94('0x15')][_0x5b94('0x1a')],function(_0x31d950){return{'model':db[_0x31d950[_0x5b94('0x1c')]],'as':_0x31d950['as'],'attributes':_0x31d950[_0x5b94('0x18')],'include':_0x31d950[_0x5b94('0x1a')]?_[_0x5b94('0x1b')](_0x31d950[_0x5b94('0x1a')],function(_0x1c8db6){return{'model':db[_0x1c8db6[_0x5b94('0x1c')]],'as':_0x1c8db6['as'],'attributes':_0x1c8db6[_0x5b94('0x18')],'include':_0x1c8db6['include']?_[_0x5b94('0x1b')](_0x1c8db6[_0x5b94('0x1a')],function(_0x344373){return{'model':db[_0x344373[_0x5b94('0x1c')]],'as':_0x344373['as'],'attributes':_0x344373[_0x5b94('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x548ab5){logger[_0x5b94('0x9')](_0x5b94('0x1d'),_0x2bb003);logger[_0x5b94('0xc')]('GetCampaign',_0x2bb003,JSON[_0x5b94('0x1e')](_0x548ab5));_0x1b5874(_0x548ab5);})[_0x5b94('0x12')](function(_0x594aca){logger['error'](_0x5b94('0x1d'),_0x594aca[_0x5b94('0x10')],_0x2bb003);_0x5f389e(_0x1171ac[_0x5b94('0xe')](0x1f4,_0x594aca[_0x5b94('0x10')]));});});};
\ No newline at end of file
+var _0x2bd6=['where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw'];(function(_0x3d92e3,_0x4a8dcf){var _0x4150dc=function(_0x58f184){while(--_0x58f184){_0x3d92e3['push'](_0x3d92e3['shift']());}};_0x4150dc(++_0x4a8dcf);}(_0x2bd6,0x1f4));var _0x62bd=function(_0x1e2321,_0x3ae1c5){_0x1e2321=_0x1e2321-0x0;var _0x1d346d=_0x2bd6[_0x1e2321];return _0x1d346d;};'use strict';var _=require(_0x62bd('0x0'));var util=require(_0x62bd('0x1'));var moment=require(_0x62bd('0x2'));var BPromise=require(_0x62bd('0x3'));var rs=require(_0x62bd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x62bd('0x5'))['db'];var utils=require(_0x62bd('0x6'));var logger=require(_0x62bd('0x7'))('rpc');var config=require(_0x62bd('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x62bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39af04,_0x55d811,_0x3d0d8b){return new BPromise(function(_0x11af94,_0x4ff8b8){return client[_0x62bd('0xa')](_0x39af04,_0x3d0d8b)[_0x62bd('0xb')](function(_0x1e2413){logger[_0x62bd('0xc')](_0x62bd('0xd'),_0x55d811,_0x62bd('0xe'));logger[_0x62bd('0xf')](_0x62bd('0x10'),_0x55d811,_0x62bd('0xe'),JSON[_0x62bd('0x11')](_0x1e2413));if(_0x1e2413['error']){if(_0x1e2413['error'][_0x62bd('0x12')]===0x1f4){logger[_0x62bd('0x13')](_0x62bd('0xd'),_0x55d811,_0x1e2413[_0x62bd('0x13')][_0x62bd('0x14')]);return _0x4ff8b8(_0x1e2413[_0x62bd('0x13')]['message']);}logger[_0x62bd('0x13')]('Campaign,\x20%s,\x20%s',_0x55d811,_0x1e2413[_0x62bd('0x13')]['message']);return _0x11af94(_0x1e2413['error'][_0x62bd('0x14')]);}else{logger[_0x62bd('0xc')](_0x62bd('0xd'),_0x55d811,_0x62bd('0xe'));_0x11af94(_0x1e2413[_0x62bd('0x15')][_0x62bd('0x14')]);}})[_0x62bd('0x16')](function(_0x16f723){logger['error'](_0x62bd('0xd'),_0x55d811,_0x16f723);_0x4ff8b8(_0x16f723);});});}exports[_0x62bd('0x17')]=function(_0x1e0b6a){var _0x38eb80=this;return new Promise(function(_0x59a648,_0x3d050b){return db[_0x62bd('0x18')][_0x62bd('0x19')]({'raw':_0x1e0b6a[_0x62bd('0x1a')]?_0x1e0b6a['options'][_0x62bd('0x1b')]===undefined?!![]:![]:!![],'where':_0x1e0b6a[_0x62bd('0x1a')]?_0x1e0b6a[_0x62bd('0x1a')][_0x62bd('0x1c')]||null:null,'attributes':_0x1e0b6a['options']?_0x1e0b6a[_0x62bd('0x1a')][_0x62bd('0x1d')]||null:null,'limit':_0x1e0b6a[_0x62bd('0x1a')]?_0x1e0b6a[_0x62bd('0x1a')]['limit']||null:null,'include':_0x1e0b6a[_0x62bd('0x1a')]?_0x1e0b6a[_0x62bd('0x1a')][_0x62bd('0x1e')]?_[_0x62bd('0x1f')](_0x1e0b6a[_0x62bd('0x1a')][_0x62bd('0x1e')],function(_0x245628){return{'model':db[_0x245628[_0x62bd('0x20')]],'as':_0x245628['as'],'attributes':_0x245628[_0x62bd('0x1d')],'include':_0x245628[_0x62bd('0x1e')]?_[_0x62bd('0x1f')](_0x245628[_0x62bd('0x1e')],function(_0x45e4f2){return{'model':db[_0x45e4f2['model']],'as':_0x45e4f2['as'],'attributes':_0x45e4f2[_0x62bd('0x1d')],'include':_0x45e4f2[_0x62bd('0x1e')]?_['map'](_0x45e4f2[_0x62bd('0x1e')],function(_0x3c6761){return{'model':db[_0x3c6761[_0x62bd('0x20')]],'as':_0x3c6761['as'],'attributes':_0x3c6761['attributes']};}):[]};}):[]};}):[]:[]})[_0x62bd('0xb')](function(_0x205d78){logger[_0x62bd('0xc')](_0x62bd('0x17'),_0x1e0b6a);logger[_0x62bd('0xf')](_0x62bd('0x17'),_0x1e0b6a,JSON[_0x62bd('0x11')](_0x205d78));_0x59a648(_0x205d78);})[_0x62bd('0x16')](function(_0x532515){logger['error'](_0x62bd('0x17'),_0x532515[_0x62bd('0x14')],_0x1e0b6a);_0x3d050b(_0x38eb80[_0x62bd('0x13')](0x1f4,_0x532515[_0x62bd('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 42a1ada..7bcb27f 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 _0x0422=['removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','/:id','isAuthenticated','show','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addLists','addBlackLists','put','update','delete'];(function(_0x1d4434,_0x1e6aa0){var _0x17ff20=function(_0x58d53e){while(--_0x58d53e){_0x1d4434['push'](_0x1d4434['shift']());}};_0x17ff20(++_0x1e6aa0);}(_0x0422,0x1b3));var _0x2042=function(_0xc7348b,_0x145880){_0xc7348b=_0xc7348b-0x0;var _0x307cec=_0x0422[_0xc7348b];return _0x307cec;};'use strict';var multer=require(_0x2042('0x0'));var util=require(_0x2042('0x1'));var path=require(_0x2042('0x2'));var timeout=require(_0x2042('0x3'));var express=require(_0x2042('0x4'));var router=express[_0x2042('0x5')]();var fs_extra=require(_0x2042('0x6'));var auth=require(_0x2042('0x7'));var interaction=require(_0x2042('0x8'));var config=require('../../config/environment');var controller=require(_0x2042('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2042('0xa')](_0x2042('0xb'),auth[_0x2042('0xc')](),controller[_0x2042('0xd')]);router['get']('/:id/hoppers',auth[_0x2042('0xc')](),controller['getHoppers']);router[_0x2042('0xa')](_0x2042('0xe'),auth[_0x2042('0xc')](),controller[_0x2042('0xf')]);router[_0x2042('0xa')](_0x2042('0x10'),auth[_0x2042('0xc')](),controller[_0x2042('0x11')]);router['get'](_0x2042('0x12'),auth[_0x2042('0xc')](),controller[_0x2042('0x13')]);router[_0x2042('0xa')]('/:id/lists',auth[_0x2042('0xc')](),controller[_0x2042('0x14')]);router[_0x2042('0xa')](_0x2042('0x15'),auth[_0x2042('0xc')](),controller[_0x2042('0x16')]);router[_0x2042('0x17')]('/',auth['isAuthenticated'](),controller[_0x2042('0x18')]);router['post'](_0x2042('0x19'),auth[_0x2042('0xc')](),controller[_0x2042('0x1a')]);router['post'](_0x2042('0x1b'),auth[_0x2042('0xc')](),controller[_0x2042('0x1c')]);router[_0x2042('0x17')](_0x2042('0x15'),auth[_0x2042('0xc')](),controller[_0x2042('0x1d')]);router[_0x2042('0x1e')]('/:id',auth[_0x2042('0xc')](),controller[_0x2042('0x1f')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x2042('0x20')]('/:id/lists',auth[_0x2042('0xc')](),controller[_0x2042('0x21')]);router['delete'](_0x2042('0x15'),auth[_0x2042('0xc')](),controller[_0x2042('0x22')]);module[_0x2042('0x23')]=router;
\ No newline at end of file
+var _0x9fb1=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_black','/:id/lists','getLists','getBlackLists','post','/:id/clone','clone','addLists','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeLists','exports','multer','util','path'];(function(_0x5b9259,_0x198473){var _0x5bbf28=function(_0x392f8e){while(--_0x392f8e){_0x5b9259['push'](_0x5b9259['shift']());}};_0x5bbf28(++_0x198473);}(_0x9fb1,0x11d));var _0x19fb=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x9fb1[_0x5037ab];return _0x512adb;};'use strict';var multer=require(_0x19fb('0x0'));var util=require(_0x19fb('0x1'));var path=require(_0x19fb('0x2'));var timeout=require(_0x19fb('0x3'));var express=require(_0x19fb('0x4'));var router=express[_0x19fb('0x5')]();var fs_extra=require(_0x19fb('0x6'));var auth=require(_0x19fb('0x7'));var interaction=require(_0x19fb('0x8'));var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0x19fb('0x9')]('/',auth[_0x19fb('0xa')](),controller['index']);router[_0x19fb('0x9')](_0x19fb('0xb'),auth[_0x19fb('0xa')](),controller[_0x19fb('0xc')]);router[_0x19fb('0x9')](_0x19fb('0xd'),auth['isAuthenticated'](),controller[_0x19fb('0xe')]);router[_0x19fb('0x9')](_0x19fb('0xf'),auth[_0x19fb('0xa')](),controller['getHopperHistories']);router[_0x19fb('0x9')]('/:id/hopper_finals',auth[_0x19fb('0xa')](),controller['getHopperFinals']);router[_0x19fb('0x9')](_0x19fb('0x10'),auth[_0x19fb('0xa')](),controller['getHopperBlacks']);router['get'](_0x19fb('0x11'),auth[_0x19fb('0xa')](),controller[_0x19fb('0x12')]);router[_0x19fb('0x9')]('/:id/blacklists',auth[_0x19fb('0xa')](),controller[_0x19fb('0x13')]);router[_0x19fb('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x19fb('0x14')](_0x19fb('0x15'),auth[_0x19fb('0xa')](),controller[_0x19fb('0x16')]);router['post'](_0x19fb('0x11'),auth[_0x19fb('0xa')](),controller[_0x19fb('0x17')]);router['post'](_0x19fb('0x18'),auth[_0x19fb('0xa')](),controller[_0x19fb('0x19')]);router[_0x19fb('0x1a')](_0x19fb('0xb'),auth[_0x19fb('0xa')](),controller[_0x19fb('0x1b')]);router[_0x19fb('0x1c')](_0x19fb('0xb'),auth[_0x19fb('0xa')](),controller[_0x19fb('0x1d')]);router['delete'](_0x19fb('0x11'),auth[_0x19fb('0xa')](),controller[_0x19fb('0x1e')]);router[_0x19fb('0x1c')](_0x19fb('0x18'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x19fb('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index ad1c2f0..2f1618e 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 _0x86b9=['getDataValue','key','sequelize','exports','STRING','TEXT','VIRTUAL'];(function(_0x563c9e,_0x242d88){var _0x58f477=function(_0x51c195){while(--_0x51c195){_0x563c9e['push'](_0x563c9e['shift']());}};_0x58f477(++_0x242d88);}(_0x86b9,0x198));var _0x986b=function(_0xc17ecf,_0x1b550a){_0xc17ecf=_0xc17ecf-0x0;var _0xfcdbe=_0x86b9[_0xc17ecf];return _0xfcdbe;};'use strict';var Sequelize=require(_0x986b('0x0'));module[_0x986b('0x1')]={'key':{'type':Sequelize[_0x986b('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x986b('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x986b('0x4')],'get':function(){return this[_0x986b('0x5')](_0x986b('0x6'));}}};
\ No newline at end of file
+var _0x716c=['getDataValue','sequelize','exports','STRING','TEXT','VIRTUAL'];(function(_0x15ddec,_0x3a1bbe){var _0x129d60=function(_0x779b50){while(--_0x779b50){_0x15ddec['push'](_0x15ddec['shift']());}};_0x129d60(++_0x3a1bbe);}(_0x716c,0x6d));var _0xc716=function(_0x429dd7,_0x3d7e15){_0x429dd7=_0x429dd7-0x0;var _0x1888ae=_0x716c[_0x429dd7];return _0x1888ae;};'use strict';var Sequelize=require(_0xc716('0x0'));module[_0xc716('0x1')]={'key':{'type':Sequelize[_0xc716('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xc716('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xc716('0x2')]},'name':{'type':Sequelize[_0xc716('0x4')],'get':function(){return this[_0xc716('0x5')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 753ca0c..28f6f01 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 _0x74c1=['../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','stack','name','send','index','map','CannedAnswer','fieldName','key','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/environment','../../config/license/util'];(function(_0x1baa1a,_0x16d722){var _0x4854b7=function(_0x407b08){while(--_0x407b08){_0x1baa1a['push'](_0x1baa1a['shift']());}};_0x4854b7(++_0x16d722);}(_0x74c1,0x95));var _0x174c=function(_0x3e43c8,_0x516592){_0x3e43c8=_0x3e43c8-0x0;var _0x17b9b0=_0x74c1[_0x3e43c8];return _0x17b9b0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x174c('0x0'));var zipdir=require(_0x174c('0x1'));var jsonpatch=require(_0x174c('0x2'));var rp=require(_0x174c('0x3'));var moment=require(_0x174c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x174c('0x5'));var util=require(_0x174c('0x6'));var path=require(_0x174c('0x7'));var sox=require(_0x174c('0x8'));var csv=require('to-csv');var ejs=require(_0x174c('0x9'));var fs=require('fs');var fs_extra=require(_0x174c('0xa'));var _=require(_0x174c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x174c('0xc'));var deskjs=require(_0x174c('0xd'));var toCsv=require(_0x174c('0xe'));var querystring=require(_0x174c('0xf'));var Papa=require(_0x174c('0x10'));var Redis=require(_0x174c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x174c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x174c('0x13'));var licenseUtil=require(_0x174c('0x14'));var db=require(_0x174c('0x15'))['db'];function respondWithStatusCode(_0x4ccbdb,_0x1c1fa7){_0x1c1fa7=_0x1c1fa7||0xcc;return function(_0x16f977){if(_0x16f977){return _0x4ccbdb['sendStatus'](_0x1c1fa7);}return _0x4ccbdb[_0x174c('0x16')](_0x1c1fa7)['end']();};}function respondWithResult(_0x542925,_0x35c26a){_0x35c26a=_0x35c26a||0xc8;return function(_0x91e7e0){if(_0x91e7e0){return _0x542925[_0x174c('0x16')](_0x35c26a)[_0x174c('0x17')](_0x91e7e0);}};}function respondWithFilteredResult(_0x34962e,_0x5bac11){return function(_0x43a031){if(_0x43a031){var _0xecb5fa=typeof _0x5bac11[_0x174c('0x18')]===_0x174c('0x19')&&typeof _0x5bac11[_0x174c('0x1a')]===_0x174c('0x19');var _0x473e98=_0x43a031[_0x174c('0x1b')];var _0x24e6c4=_0xecb5fa?0x0:_0x5bac11[_0x174c('0x18')];var _0x465b81=_0xecb5fa?_0x43a031[_0x174c('0x1b')]:_0x5bac11[_0x174c('0x18')]+_0x5bac11[_0x174c('0x1a')];var _0x586fc6;if(_0x465b81>=_0x473e98){_0x465b81=_0x473e98;_0x586fc6=0xc8;}else{_0x586fc6=0xce;}_0x34962e['status'](_0x586fc6);return _0x34962e[_0x174c('0x1c')](_0x174c('0x1d'),_0x24e6c4+'-'+_0x465b81+'/'+_0x473e98)[_0x174c('0x17')](_0x43a031);}return null;};}function patchUpdates(_0x299a7b){return function(_0x5a06a0){try{jsonpatch[_0x174c('0x1e')](_0x5a06a0,_0x299a7b,!![]);}catch(_0x48a9b2){return BPromise[_0x174c('0x1f')](_0x48a9b2);}return _0x5a06a0['save']();};}function saveUpdates(_0x3edb3d,_0x4f892e){return function(_0x7cb04d){if(_0x7cb04d){return _0x7cb04d[_0x174c('0x20')](_0x3edb3d)[_0x174c('0x21')](function(_0x4f8c09){return _0x4f8c09;});}return null;};}function removeEntity(_0x5b9ab2,_0x11f166){return function(_0x18c315){if(_0x18c315){return _0x18c315[_0x174c('0x22')]()['then'](function(){var _0x4219ee=_0x18c315[_0x174c('0x23')]({'plain':!![]});var _0x2df587=_0x174c('0x24');return db[_0x174c('0x25')][_0x174c('0x22')]({'where':{'type':_0x2df587,'resourceId':_0x4219ee['id']}})[_0x174c('0x21')](function(){return _0x18c315;});})[_0x174c('0x21')](function(){_0x5b9ab2[_0x174c('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9be124,_0x435de9){return function(_0xd27bca){if(!_0xd27bca){_0x9be124[_0x174c('0x26')](0x194);}return _0xd27bca;};}function handleError(_0x19835c,_0x34adcc){_0x34adcc=_0x34adcc||0x1f4;return function(_0x2003c3){logger['error'](_0x2003c3[_0x174c('0x27')]);if(_0x2003c3[_0x174c('0x28')]){delete _0x2003c3['name'];}_0x19835c['status'](_0x34adcc)[_0x174c('0x29')](_0x2003c3);};}exports[_0x174c('0x2a')]=function(_0xdf9a15,_0x30a038){var _0x2a1cdc={},_0xd75b67={},_0x49b388={'count':0x0,'rows':[]};var _0x40ea24=_[_0x174c('0x2b')](db[_0x174c('0x2c')]['rawAttributes'],function(_0x3d48d3){return{'name':_0x3d48d3[_0x174c('0x2d')],'type':_0x3d48d3['type'][_0x174c('0x2e')]};});_0xd75b67['model']=_['map'](_0x40ea24,_0x174c('0x28'));_0xd75b67[_0x174c('0x2f')]=_['keys'](_0xdf9a15['query']);_0xd75b67['filters']=_[_0x174c('0x30')](_0xd75b67[_0x174c('0x31')],_0xd75b67[_0x174c('0x2f')]);_0x2a1cdc[_0x174c('0x32')]=_[_0x174c('0x30')](_0xd75b67[_0x174c('0x31')],qs['fields'](_0xdf9a15[_0x174c('0x2f')][_0x174c('0x33')]));_0x2a1cdc[_0x174c('0x32')]=_0x2a1cdc[_0x174c('0x32')][_0x174c('0x34')]?_0x2a1cdc['attributes']:_0xd75b67['model'];if(!_0xdf9a15[_0x174c('0x2f')][_0x174c('0x35')]('nolimit')){_0x2a1cdc[_0x174c('0x1a')]=qs['limit'](_0xdf9a15['query'][_0x174c('0x1a')]);_0x2a1cdc[_0x174c('0x18')]=qs[_0x174c('0x18')](_0xdf9a15[_0x174c('0x2f')]['offset']);}_0x2a1cdc[_0x174c('0x36')]=qs['sort'](_0xdf9a15[_0x174c('0x2f')][_0x174c('0x37')]);_0x2a1cdc[_0x174c('0x38')]=qs['filters'](_[_0x174c('0x39')](_0xdf9a15[_0x174c('0x2f')],_0xd75b67[_0x174c('0x3a')]),_0x40ea24);if(_0xdf9a15[_0x174c('0x2f')][_0x174c('0x3b')]){_0x2a1cdc[_0x174c('0x38')]=_[_0x174c('0x3c')](_0x2a1cdc[_0x174c('0x38')],{'$or':[{'key':{'$like':'%'+_0xdf9a15[_0x174c('0x2f')]['filter']+'%'}},{'value':{'$like':'%'+_0xdf9a15[_0x174c('0x2f')]['filter']+'%'}}]});}_0x2a1cdc=_['merge']({},_0x2a1cdc,_0xdf9a15[_0x174c('0x3d')]);var _0x3bf8e5={'where':_0x2a1cdc[_0x174c('0x38')]};return db[_0x174c('0x2c')][_0x174c('0x1b')](_0x3bf8e5)[_0x174c('0x21')](function(_0x444e27){_0x49b388[_0x174c('0x1b')]=_0x444e27;if(_0xdf9a15[_0x174c('0x2f')][_0x174c('0x3e')]){_0x2a1cdc[_0x174c('0x3f')]=[{'all':!![]}];}return db['CannedAnswer'][_0x174c('0x40')](_0x2a1cdc);})[_0x174c('0x21')](function(_0x5c2229){_0x49b388[_0x174c('0x41')]=_0x5c2229;return _0x49b388;})['then'](respondWithFilteredResult(_0x30a038,_0x2a1cdc))[_0x174c('0x42')](handleError(_0x30a038,null));};exports['show']=function(_0x105853,_0x576e29){var _0x422784={'raw':!![],'where':{'id':_0x105853[_0x174c('0x43')]['id']}},_0x1bd749={};_0x1bd749[_0x174c('0x31')]=_[_0x174c('0x44')](db['CannedAnswer'][_0x174c('0x45')]);_0x1bd749[_0x174c('0x2f')]=_[_0x174c('0x44')](_0x105853[_0x174c('0x2f')]);_0x1bd749[_0x174c('0x3a')]=_[_0x174c('0x30')](_0x1bd749[_0x174c('0x31')],_0x1bd749['query']);_0x422784[_0x174c('0x32')]=_[_0x174c('0x30')](_0x1bd749['model'],qs['fields'](_0x105853[_0x174c('0x2f')][_0x174c('0x33')]));_0x422784[_0x174c('0x32')]=_0x422784[_0x174c('0x32')][_0x174c('0x34')]?_0x422784[_0x174c('0x32')]:_0x1bd749[_0x174c('0x31')];if(_0x105853[_0x174c('0x2f')]['includeAll']){_0x422784[_0x174c('0x3f')]=[{'all':!![]}];}_0x422784=_[_0x174c('0x3c')]({},_0x422784,_0x105853[_0x174c('0x3d')]);return db[_0x174c('0x2c')][_0x174c('0x46')](_0x422784)[_0x174c('0x21')](handleEntityNotFound(_0x576e29,null))[_0x174c('0x21')](respondWithResult(_0x576e29,null))[_0x174c('0x42')](handleError(_0x576e29,null));};exports[_0x174c('0x20')]=function(_0x5290c0,_0x5a614b){if(_0x5290c0['body']['id']){delete _0x5290c0[_0x174c('0x47')]['id'];}return db[_0x174c('0x2c')][_0x174c('0x46')]({'where':{'id':_0x5290c0[_0x174c('0x43')]['id']}})[_0x174c('0x21')](handleEntityNotFound(_0x5a614b,null))['then'](saveUpdates(_0x5290c0['body'],null))[_0x174c('0x21')](respondWithResult(_0x5a614b,null))[_0x174c('0x42')](handleError(_0x5a614b,null));};exports[_0x174c('0x22')]=function(_0x3868b7,_0x13f146){return db[_0x174c('0x2c')]['find']({'where':{'id':_0x3868b7[_0x174c('0x43')]['id']}})['then'](handleEntityNotFound(_0x13f146,null))[_0x174c('0x21')](removeEntity(_0x13f146,null))['catch'](handleError(_0x13f146,null));};exports[_0x174c('0x48')]=function(_0x34006d,_0x1f3b8d){var _0x47f320={'key':_0x34006d[_0x174c('0x47')][_0x174c('0x2e')]};if(_0x34006d['body'][_0x174c('0x49')]){_0x47f320['MailAccountId']=_0x34006d['body'][_0x174c('0x49')];}else if(_0x34006d['body'][_0x174c('0x4a')]){_0x47f320[_0x174c('0x4a')]=_0x34006d[_0x174c('0x47')]['SmsAccountId'];}else if(_0x34006d[_0x174c('0x47')]['OpenchannelAccountId']){_0x47f320[_0x174c('0x4b')]=_0x34006d[_0x174c('0x47')][_0x174c('0x4b')];}else if(_0x34006d[_0x174c('0x47')][_0x174c('0x4c')]){_0x47f320['ChatWebsiteId']=_0x34006d[_0x174c('0x47')][_0x174c('0x4c')];}return db[_0x174c('0x2c')][_0x174c('0x46')]({'where':_0x47f320})[_0x174c('0x21')](function(_0x48adb5){if(_0x48adb5){throw new db[(_0x174c('0x4d'))][(_0x174c('0x4e'))](_0x174c('0x4f'));}return db[_0x174c('0x2c')][_0x174c('0x48')](_0x34006d['body']);})[_0x174c('0x21')](function(_0x2f8b8d){var _0x5885bc=_0x34006d[_0x174c('0x50')][_0x174c('0x23')]({'plain':!![]});if(!_0x5885bc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5885bc[_0x174c('0x51')]===_0x174c('0x50')){var _0x2486c8=_0x2f8b8d[_0x174c('0x23')]({'plain':!![]});return db[_0x174c('0x52')][_0x174c('0x46')]({'where':{'name':_0x174c('0x24'),'userProfileId':_0x5885bc[_0x174c('0x53')]},'raw':!![]})[_0x174c('0x21')](function(_0x36295c){if(_0x36295c&&_0x36295c['autoAssociation']===0x0){return db['UserProfileResource'][_0x174c('0x48')]({'name':_0x2486c8[_0x174c('0x28')],'resourceId':_0x2486c8['id'],'type':_0x36295c[_0x174c('0x28')],'sectionId':_0x36295c['id']},{})[_0x174c('0x21')](function(){return _0x2f8b8d;});}else{return _0x2f8b8d;}})['catch'](function(_0x2ccc58){logger['error'](_0x174c('0x54'),_0x2ccc58);throw _0x2ccc58;});}return _0x2f8b8d;})[_0x174c('0x21')](respondWithResult(_0x1f3b8d,0xc9))[_0x174c('0x42')](handleError(_0x1f3b8d,null));};
\ No newline at end of file
+var _0xe420=['destroy','error','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','catch','body','find','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','CannedAnswers'];(function(_0x24f484,_0x1621ec){var _0x32f642=function(_0x1961bb){while(--_0x1961bb){_0x24f484['push'](_0x24f484['shift']());}};_0x32f642(++_0x1621ec);}(_0xe420,0x149));var _0x0e42=function(_0x47cd8b,_0x982a8e){_0x47cd8b=_0x47cd8b-0x0;var _0x36b69c=_0xe420[_0x47cd8b];return _0x36b69c;};'use strict';var emlformat=require(_0x0e42('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e42('0x1'));var jsonpatch=require(_0x0e42('0x2'));var rp=require('request-promise');var moment=require(_0x0e42('0x3'));var BPromise=require(_0x0e42('0x4'));var Mustache=require(_0x0e42('0x5'));var util=require('util');var path=require(_0x0e42('0x6'));var sox=require(_0x0e42('0x7'));var csv=require('to-csv');var ejs=require(_0x0e42('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e42('0x9'));var squel=require(_0x0e42('0xa'));var crypto=require(_0x0e42('0xb'));var jsforce=require(_0x0e42('0xc'));var deskjs=require(_0x0e42('0xd'));var toCsv=require(_0x0e42('0xe'));var querystring=require(_0x0e42('0xf'));var Papa=require(_0x0e42('0x10'));var Redis=require(_0x0e42('0x11'));var authService=require(_0x0e42('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0e42('0x13'));var hardwareService=require(_0x0e42('0x14'));var logger=require(_0x0e42('0x15'))('api');var utils=require(_0x0e42('0x16'));var config=require(_0x0e42('0x17'));var licenseUtil=require(_0x0e42('0x18'));var db=require(_0x0e42('0x19'))['db'];function respondWithStatusCode(_0x413273,_0x4d125c){_0x4d125c=_0x4d125c||0xcc;return function(_0x274e0d){if(_0x274e0d){return _0x413273[_0x0e42('0x1a')](_0x4d125c);}return _0x413273[_0x0e42('0x1b')](_0x4d125c)[_0x0e42('0x1c')]();};}function respondWithResult(_0x30b280,_0x8c8b82){_0x8c8b82=_0x8c8b82||0xc8;return function(_0x1d71c8){if(_0x1d71c8){return _0x30b280[_0x0e42('0x1b')](_0x8c8b82)[_0x0e42('0x1d')](_0x1d71c8);}};}function respondWithFilteredResult(_0x3ec2c8,_0x3be9ea){return function(_0x4bcc41){if(_0x4bcc41){var _0x5b4245=typeof _0x3be9ea['offset']===_0x0e42('0x1e')&&typeof _0x3be9ea['limit']===_0x0e42('0x1e');var _0x138b41=_0x4bcc41[_0x0e42('0x1f')];var _0x2d0b2e=_0x5b4245?0x0:_0x3be9ea[_0x0e42('0x20')];var _0x4b6443=_0x5b4245?_0x4bcc41['count']:_0x3be9ea[_0x0e42('0x20')]+_0x3be9ea[_0x0e42('0x21')];var _0x3cf82e;if(_0x4b6443>=_0x138b41){_0x4b6443=_0x138b41;_0x3cf82e=0xc8;}else{_0x3cf82e=0xce;}_0x3ec2c8[_0x0e42('0x1b')](_0x3cf82e);return _0x3ec2c8[_0x0e42('0x22')](_0x0e42('0x23'),_0x2d0b2e+'-'+_0x4b6443+'/'+_0x138b41)['json'](_0x4bcc41);}return null;};}function patchUpdates(_0x59f1cb){return function(_0x2038ff){try{jsonpatch[_0x0e42('0x24')](_0x2038ff,_0x59f1cb,!![]);}catch(_0x349151){return BPromise[_0x0e42('0x25')](_0x349151);}return _0x2038ff[_0x0e42('0x26')]();};}function saveUpdates(_0x1ffbae,_0x35a8de){return function(_0x1e1464){if(_0x1e1464){return _0x1e1464[_0x0e42('0x27')](_0x1ffbae)[_0x0e42('0x28')](function(_0x219dbe){return _0x219dbe;});}return null;};}function removeEntity(_0x553a80,_0x5468e9){return function(_0x3e051b){if(_0x3e051b){return _0x3e051b['destroy']()[_0x0e42('0x28')](function(){var _0x2fb5c8=_0x3e051b[_0x0e42('0x29')]({'plain':!![]});var _0x11e9c6=_0x0e42('0x2a');return db['UserProfileResource'][_0x0e42('0x2b')]({'where':{'type':_0x11e9c6,'resourceId':_0x2fb5c8['id']}})[_0x0e42('0x28')](function(){return _0x3e051b;});})['then'](function(){_0x553a80[_0x0e42('0x1b')](0xcc)[_0x0e42('0x1c')]();});}};}function handleEntityNotFound(_0x15e1e3,_0x372ba4){return function(_0x5d734e){if(!_0x5d734e){_0x15e1e3[_0x0e42('0x1a')](0x194);}return _0x5d734e;};}function handleError(_0x3e7acf,_0x2504bb){_0x2504bb=_0x2504bb||0x1f4;return function(_0x26f356){logger[_0x0e42('0x2c')](_0x26f356['stack']);if(_0x26f356['name']){delete _0x26f356[_0x0e42('0x2d')];}_0x3e7acf[_0x0e42('0x1b')](_0x2504bb)[_0x0e42('0x2e')](_0x26f356);};}exports[_0x0e42('0x2f')]=function(_0x2622ba,_0x51816e){var _0x22d459={},_0x2adcbb={},_0x4f47db={'count':0x0,'rows':[]};var _0x30f8c9=_['map'](db[_0x0e42('0x30')][_0x0e42('0x31')],function(_0x560b37){return{'name':_0x560b37[_0x0e42('0x32')],'type':_0x560b37[_0x0e42('0x33')][_0x0e42('0x34')]};});_0x2adcbb['model']=_['map'](_0x30f8c9,_0x0e42('0x2d'));_0x2adcbb[_0x0e42('0x35')]=_[_0x0e42('0x36')](_0x2622ba['query']);_0x2adcbb[_0x0e42('0x37')]=_[_0x0e42('0x38')](_0x2adcbb[_0x0e42('0x39')],_0x2adcbb['query']);_0x22d459['attributes']=_[_0x0e42('0x38')](_0x2adcbb[_0x0e42('0x39')],qs[_0x0e42('0x3a')](_0x2622ba[_0x0e42('0x35')]['fields']));_0x22d459[_0x0e42('0x3b')]=_0x22d459[_0x0e42('0x3b')][_0x0e42('0x3c')]?_0x22d459[_0x0e42('0x3b')]:_0x2adcbb['model'];if(!_0x2622ba[_0x0e42('0x35')][_0x0e42('0x3d')](_0x0e42('0x3e'))){_0x22d459['limit']=qs[_0x0e42('0x21')](_0x2622ba[_0x0e42('0x35')]['limit']);_0x22d459[_0x0e42('0x20')]=qs[_0x0e42('0x20')](_0x2622ba[_0x0e42('0x35')][_0x0e42('0x20')]);}_0x22d459[_0x0e42('0x3f')]=qs[_0x0e42('0x40')](_0x2622ba[_0x0e42('0x35')][_0x0e42('0x40')]);_0x22d459[_0x0e42('0x41')]=qs[_0x0e42('0x37')](_[_0x0e42('0x42')](_0x2622ba['query'],_0x2adcbb['filters']),_0x30f8c9);if(_0x2622ba[_0x0e42('0x35')][_0x0e42('0x43')]){_0x22d459['where']=_[_0x0e42('0x44')](_0x22d459[_0x0e42('0x41')],{'$or':[{'key':{'$like':'%'+_0x2622ba[_0x0e42('0x35')][_0x0e42('0x43')]+'%'}},{'value':{'$like':'%'+_0x2622ba['query']['filter']+'%'}}]});}_0x22d459=_[_0x0e42('0x44')]({},_0x22d459,_0x2622ba[_0x0e42('0x45')]);var _0x195516={'where':_0x22d459[_0x0e42('0x41')]};return db[_0x0e42('0x30')][_0x0e42('0x1f')](_0x195516)['then'](function(_0x24e817){_0x4f47db[_0x0e42('0x1f')]=_0x24e817;if(_0x2622ba[_0x0e42('0x35')][_0x0e42('0x46')]){_0x22d459[_0x0e42('0x47')]=[{'all':!![]}];}return db[_0x0e42('0x30')][_0x0e42('0x48')](_0x22d459);})['then'](function(_0x13db90){_0x4f47db[_0x0e42('0x49')]=_0x13db90;return _0x4f47db;})[_0x0e42('0x28')](respondWithFilteredResult(_0x51816e,_0x22d459))['catch'](handleError(_0x51816e,null));};exports[_0x0e42('0x4a')]=function(_0x53bc3c,_0x474f20){var _0x455ec7={'raw':!![],'where':{'id':_0x53bc3c['params']['id']}},_0x39afa0={};_0x39afa0['model']=_[_0x0e42('0x36')](db[_0x0e42('0x30')][_0x0e42('0x31')]);_0x39afa0['query']=_[_0x0e42('0x36')](_0x53bc3c[_0x0e42('0x35')]);_0x39afa0[_0x0e42('0x37')]=_[_0x0e42('0x38')](_0x39afa0[_0x0e42('0x39')],_0x39afa0[_0x0e42('0x35')]);_0x455ec7['attributes']=_['intersection'](_0x39afa0[_0x0e42('0x39')],qs[_0x0e42('0x3a')](_0x53bc3c[_0x0e42('0x35')][_0x0e42('0x3a')]));_0x455ec7[_0x0e42('0x3b')]=_0x455ec7[_0x0e42('0x3b')][_0x0e42('0x3c')]?_0x455ec7[_0x0e42('0x3b')]:_0x39afa0[_0x0e42('0x39')];if(_0x53bc3c[_0x0e42('0x35')]['includeAll']){_0x455ec7[_0x0e42('0x47')]=[{'all':!![]}];}_0x455ec7=_[_0x0e42('0x44')]({},_0x455ec7,_0x53bc3c['options']);return db[_0x0e42('0x30')]['find'](_0x455ec7)[_0x0e42('0x28')](handleEntityNotFound(_0x474f20,null))[_0x0e42('0x28')](respondWithResult(_0x474f20,null))[_0x0e42('0x4b')](handleError(_0x474f20,null));};exports[_0x0e42('0x27')]=function(_0xefad3e,_0x3f2727){if(_0xefad3e[_0x0e42('0x4c')]['id']){delete _0xefad3e[_0x0e42('0x4c')]['id'];}return db[_0x0e42('0x30')][_0x0e42('0x4d')]({'where':{'id':_0xefad3e['params']['id']}})[_0x0e42('0x28')](handleEntityNotFound(_0x3f2727,null))['then'](saveUpdates(_0xefad3e['body'],null))['then'](respondWithResult(_0x3f2727,null))[_0x0e42('0x4b')](handleError(_0x3f2727,null));};exports['destroy']=function(_0x38e31f,_0x58a5c3){return db['CannedAnswer']['find']({'where':{'id':_0x38e31f[_0x0e42('0x4e')]['id']}})[_0x0e42('0x28')](handleEntityNotFound(_0x58a5c3,null))[_0x0e42('0x28')](removeEntity(_0x58a5c3,null))[_0x0e42('0x4b')](handleError(_0x58a5c3,null));};exports[_0x0e42('0x4f')]=function(_0x5579dc,_0x361aae){var _0x3ea812={'key':_0x5579dc['body'][_0x0e42('0x34')]};if(_0x5579dc['body'][_0x0e42('0x50')]){_0x3ea812[_0x0e42('0x50')]=_0x5579dc[_0x0e42('0x4c')][_0x0e42('0x50')];}else if(_0x5579dc['body']['SmsAccountId']){_0x3ea812[_0x0e42('0x51')]=_0x5579dc[_0x0e42('0x4c')][_0x0e42('0x51')];}else if(_0x5579dc[_0x0e42('0x4c')][_0x0e42('0x52')]){_0x3ea812[_0x0e42('0x52')]=_0x5579dc['body'][_0x0e42('0x52')];}else if(_0x5579dc[_0x0e42('0x4c')][_0x0e42('0x53')]){_0x3ea812[_0x0e42('0x53')]=_0x5579dc['body'][_0x0e42('0x53')];}return db[_0x0e42('0x30')][_0x0e42('0x4d')]({'where':_0x3ea812})[_0x0e42('0x28')](function(_0x473315){if(_0x473315){throw new db['Sequelize'][(_0x0e42('0x54'))](_0x0e42('0x55'));}return db[_0x0e42('0x30')]['create'](_0x5579dc['body']);})[_0x0e42('0x28')](function(_0x5e9c78){var _0x5a67a2=_0x5579dc[_0x0e42('0x56')][_0x0e42('0x29')]({'plain':!![]});if(!_0x5a67a2)throw new Error(_0x0e42('0x57'));if(_0x5a67a2[_0x0e42('0x58')]===_0x0e42('0x56')){var _0x231255=_0x5e9c78['get']({'plain':!![]});return db[_0x0e42('0x59')][_0x0e42('0x4d')]({'where':{'name':_0x0e42('0x2a'),'userProfileId':_0x5a67a2['userProfileId']},'raw':!![]})[_0x0e42('0x28')](function(_0x5eeced){if(_0x5eeced&&_0x5eeced[_0x0e42('0x5a')]===0x0){return db[_0x0e42('0x5b')][_0x0e42('0x4f')]({'name':_0x231255[_0x0e42('0x2d')],'resourceId':_0x231255['id'],'type':_0x5eeced[_0x0e42('0x2d')],'sectionId':_0x5eeced['id']},{})[_0x0e42('0x28')](function(){return _0x5e9c78;});}else{return _0x5e9c78;}})['catch'](function(_0x32186c){logger[_0x0e42('0x2c')](_0x0e42('0x5c'),_0x32186c);throw _0x32186c;});}return _0x5e9c78;})[_0x0e42('0x28')](respondWithResult(_0x361aae,0xc9))[_0x0e42('0x4b')](handleError(_0x361aae,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index a0f28d3..ee4c56b 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 _0x24ed=['path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x274596,_0x193c4e){var _0x490cbb=function(_0x1889fc){while(--_0x1889fc){_0x274596['push'](_0x274596['shift']());}};_0x490cbb(++_0x193c4e);}(_0x24ed,0x1e4));var _0xd24e=function(_0x2af981,_0x116a02){_0x2af981=_0x2af981-0x0;var _0x13d5f3=_0x24ed[_0x2af981];return _0x13d5f3;};'use strict';var _=require(_0xd24e('0x0'));var util=require('util');var logger=require(_0xd24e('0x1'))(_0xd24e('0x2'));var moment=require(_0xd24e('0x3'));var BPromise=require(_0xd24e('0x4'));var rp=require(_0xd24e('0x5'));var fs=require('fs');var path=require(_0xd24e('0x6'));var rimraf=require(_0xd24e('0x7'));var config=require('../../config/environment');var attributes=require(_0xd24e('0x8'));module[_0xd24e('0x9')]=function(_0x49a499,_0x3363f1){return _0x49a499[_0xd24e('0xa')](_0xd24e('0xb'),attributes,{'tableName':_0xd24e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd24e('0xd')});};
\ No newline at end of file
+var _0x6599=['bluebird','path','../../config/environment','exports','tools_canned_answers','utf8mb4','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6599,0xb0));var _0x9659=function(_0x996bc8,_0x291e01){_0x996bc8=_0x996bc8-0x0;var _0x20b0ea=_0x6599[_0x996bc8];return _0x20b0ea;};'use strict';var _=require('lodash');var util=require(_0x9659('0x0'));var logger=require(_0x9659('0x1'))(_0x9659('0x2'));var moment=require(_0x9659('0x3'));var BPromise=require(_0x9659('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9659('0x5'));var rimraf=require('rimraf');var config=require(_0x9659('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0x9659('0x7')]=function(_0xb08ede,_0x159ac2){return _0xb08ede['define']('CannedAnswer',attributes,{'tableName':_0x9659('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9659('0x9'),'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 ec77e40..96cdf72 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(_0x691348,_0x5bfbbc){var _0x4a5ab9=function(_0x1bf5dd){while(--_0x1bf5dd){_0x691348['push'](_0x691348['shift']());}};_0x4a5ab9(++_0x5bfbbc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0x31bc64,_0x315baa){var _0x312095=function(_0x3f14af){while(--_0x3f14af){_0x31bc64['push'](_0x31bc64['shift']());}};_0x312095(++_0x315baa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 c3979da..669d393 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 _0x75bc=['/:id','show','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated'];(function(_0x35454a,_0x6ae92a){var _0x35ca06=function(_0x2455c9){while(--_0x2455c9){_0x35454a['push'](_0x35454a['shift']());}};_0x35ca06(++_0x6ae92a);}(_0x75bc,0x184));var _0xc75b=function(_0x5541f3,_0x266df7){_0x5541f3=_0x5541f3-0x0;var _0xe30f20=_0x75bc[_0x5541f3];return _0xe30f20;};'use strict';var multer=require(_0xc75b('0x0'));var util=require('util');var path=require(_0xc75b('0x1'));var timeout=require('connect-timeout');var express=require(_0xc75b('0x2'));var router=express[_0xc75b('0x3')]();var fs_extra=require(_0xc75b('0x4'));var auth=require(_0xc75b('0x5'));var interaction=require(_0xc75b('0x6'));var config=require(_0xc75b('0x7'));var controller=require(_0xc75b('0x8'));router[_0xc75b('0x9')]('/',auth[_0xc75b('0xa')](),controller['index']);router[_0xc75b('0x9')](_0xc75b('0xb'),auth[_0xc75b('0xa')](),controller[_0xc75b('0xc')]);router['post']('/',auth[_0xc75b('0xa')](),controller[_0xc75b('0xd')]);router[_0xc75b('0xe')](_0xc75b('0xb'),auth[_0xc75b('0xa')](),controller[_0xc75b('0xf')]);router[_0xc75b('0x10')](_0xc75b('0xb'),auth['isAuthenticated'](),controller[_0xc75b('0x11')]);module[_0xc75b('0x12')]=router;
\ No newline at end of file
+var _0xdeba=['./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xe456dc,_0x5662de){var _0x304d45=function(_0x68f858){while(--_0x68f858){_0xe456dc['push'](_0xe456dc['shift']());}};_0x304d45(++_0x5662de);}(_0xdeba,0x171));var _0xadeb=function(_0x10afb8,_0x167b07){_0x10afb8=_0x10afb8-0x0;var _0xdb4d6a=_0xdeba[_0x10afb8];return _0xdb4d6a;};'use strict';var multer=require(_0xadeb('0x0'));var util=require(_0xadeb('0x1'));var path=require(_0xadeb('0x2'));var timeout=require(_0xadeb('0x3'));var express=require(_0xadeb('0x4'));var router=express[_0xadeb('0x5')]();var fs_extra=require(_0xadeb('0x6'));var auth=require(_0xadeb('0x7'));var interaction=require(_0xadeb('0x8'));var config=require('../../config/environment');var controller=require(_0xadeb('0x9'));router[_0xadeb('0xa')]('/',auth[_0xadeb('0xb')](),controller[_0xadeb('0xc')]);router['get'](_0xadeb('0xd'),auth[_0xadeb('0xb')](),controller[_0xadeb('0xe')]);router['post']('/',auth[_0xadeb('0xb')](),controller['create']);router[_0xadeb('0xf')](_0xadeb('0xd'),auth[_0xadeb('0xb')](),controller[_0xadeb('0x10')]);router['delete'](_0xadeb('0xd'),auth[_0xadeb('0xb')](),controller[_0xadeb('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 2d9e847..3164730 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 _0xdecb=['INTEGER','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x1b8b15,_0x54010a){var _0x4b0411=function(_0x63598f){while(--_0x63598f){_0x1b8b15['push'](_0x1b8b15['shift']());}};_0x4b0411(++_0x54010a);}(_0xdecb,0xe2));var _0xbdec=function(_0x42e67a,_0x324254){_0x42e67a=_0x42e67a-0x0;var _0x53b151=_0xdecb[_0x42e67a];return _0x53b151;};'use strict';var Sequelize=require('sequelize');module[_0xbdec('0x0')]={'calldate':{'type':Sequelize[_0xbdec('0x1')],'allowNull':![],'defaultValue':_0xbdec('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xbdec('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xbdec('0x3')]},'channel':{'type':Sequelize[_0xbdec('0x3')]},'dstchannel':{'type':Sequelize[_0xbdec('0x3')]},'lastapp':{'type':Sequelize[_0xbdec('0x3')]},'lastdata':{'type':Sequelize[_0xbdec('0x3')]},'duration':{'type':Sequelize[_0xbdec('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xbdec('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xbdec('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xbdec('0x3')]},'userfield':{'type':Sequelize[_0xbdec('0x3')]},'uniqueid':{'type':Sequelize[_0xbdec('0x3')]},'linkedid':{'type':Sequelize[_0xbdec('0x3')]},'sequence':{'type':Sequelize[_0xbdec('0x3')]},'peeraccount':{'type':Sequelize[_0xbdec('0x3')]},'type':{'type':Sequelize[_0xbdec('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xf78d=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x2a6ac9,_0x1da3cd){var _0x332cc2=function(_0xdacd78){while(--_0xdacd78){_0x2a6ac9['push'](_0x2a6ac9['shift']());}};_0x332cc2(++_0x1da3cd);}(_0xf78d,0x1c7));var _0xdf78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf78d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xdf78('0x0')]={'calldate':{'type':Sequelize[_0xdf78('0x1')],'allowNull':![],'defaultValue':_0xdf78('0x2')},'clid':{'type':Sequelize[_0xdf78('0x3')]},'src':{'type':Sequelize[_0xdf78('0x3')]},'dst':{'type':Sequelize[_0xdf78('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xdf78('0x3')]},'lastapp':{'type':Sequelize[_0xdf78('0x3')]},'lastdata':{'type':Sequelize[_0xdf78('0x3')]},'duration':{'type':Sequelize[_0xdf78('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xdf78('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xdf78('0x3')]},'amaflags':{'type':Sequelize[_0xdf78('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xdf78('0x3')]},'linkedid':{'type':Sequelize[_0xdf78('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xdf78('0x3')]},'type':{'type':Sequelize[_0xdf78('0x3')]},'tag':{'type':Sequelize[_0xdf78('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 0c3fb8a..64155f8 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 _0xf69d=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','count','set','reject','save','update','then','send','map','Cdr','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','rows','catch','keys','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0xfed70c,_0xb596d6){var _0x46da41=function(_0x52631e){while(--_0x52631e){_0xfed70c['push'](_0xfed70c['shift']());}};_0x46da41(++_0xb596d6);}(_0xf69d,0xd3));var _0xdf69=function(_0x1cee35,_0x22413c){_0x1cee35=_0x1cee35-0x0;var _0x1761d6=_0xf69d[_0x1cee35];return _0x1761d6;};'use strict';var emlformat=require(_0xdf69('0x0'));var rimraf=require(_0xdf69('0x1'));var zipdir=require(_0xdf69('0x2'));var jsonpatch=require(_0xdf69('0x3'));var rp=require(_0xdf69('0x4'));var moment=require('moment');var BPromise=require(_0xdf69('0x5'));var Mustache=require(_0xdf69('0x6'));var util=require(_0xdf69('0x7'));var path=require(_0xdf69('0x8'));var sox=require(_0xdf69('0x9'));var csv=require(_0xdf69('0xa'));var ejs=require(_0xdf69('0xb'));var fs=require('fs');var fs_extra=require(_0xdf69('0xc'));var _=require(_0xdf69('0xd'));var squel=require(_0xdf69('0xe'));var crypto=require(_0xdf69('0xf'));var jsforce=require(_0xdf69('0x10'));var deskjs=require(_0xdf69('0x11'));var toCsv=require(_0xdf69('0xa'));var querystring=require(_0xdf69('0x12'));var Papa=require(_0xdf69('0x13'));var Redis=require(_0xdf69('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xdf69('0x15'));var as=require(_0xdf69('0x16'));var hardwareService=require(_0xdf69('0x17'));var logger=require(_0xdf69('0x18'))(_0xdf69('0x19'));var utils=require(_0xdf69('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5df98a,_0x3dcda8){_0x3dcda8=_0x3dcda8||0xcc;return function(_0xbacdc6){if(_0xbacdc6){return _0x5df98a[_0xdf69('0x1b')](_0x3dcda8);}return _0x5df98a[_0xdf69('0x1c')](_0x3dcda8)[_0xdf69('0x1d')]();};}function respondWithResult(_0x38aee2,_0x584cbd){_0x584cbd=_0x584cbd||0xc8;return function(_0x41cc77){if(_0x41cc77){return _0x38aee2[_0xdf69('0x1c')](_0x584cbd)[_0xdf69('0x1e')](_0x41cc77);}};}function respondWithFilteredResult(_0xef2df5,_0x4f28fc){return function(_0xa4242f){if(_0xa4242f){var _0x56be66=typeof _0x4f28fc[_0xdf69('0x1f')]===_0xdf69('0x20')&&typeof _0x4f28fc['limit']===_0xdf69('0x20');var _0x449908=_0xa4242f[_0xdf69('0x21')];var _0x85d1d=_0x56be66?0x0:_0x4f28fc['offset'];var _0x5ae237=_0x56be66?_0xa4242f[_0xdf69('0x21')]:_0x4f28fc[_0xdf69('0x1f')]+_0x4f28fc['limit'];var _0x32cf65;if(_0x5ae237>=_0x449908){_0x5ae237=_0x449908;_0x32cf65=0xc8;}else{_0x32cf65=0xce;}_0xef2df5[_0xdf69('0x1c')](_0x32cf65);return _0xef2df5[_0xdf69('0x22')]('Content-Range',_0x85d1d+'-'+_0x5ae237+'/'+_0x449908)[_0xdf69('0x1e')](_0xa4242f);}return null;};}function patchUpdates(_0x452cfa){return function(_0x4d09d5){try{jsonpatch['apply'](_0x4d09d5,_0x452cfa,!![]);}catch(_0x32505a){return BPromise[_0xdf69('0x23')](_0x32505a);}return _0x4d09d5[_0xdf69('0x24')]();};}function saveUpdates(_0x5d91b8,_0x50ef18){return function(_0x5be7dd){if(_0x5be7dd){return _0x5be7dd[_0xdf69('0x25')](_0x5d91b8)['then'](function(_0x21f757){return _0x21f757;});}return null;};}function removeEntity(_0x311534,_0x1d37d8){return function(_0x54d2ca){if(_0x54d2ca){return _0x54d2ca['destroy']()[_0xdf69('0x26')](function(){_0x311534[_0xdf69('0x1c')](0xcc)[_0xdf69('0x1d')]();});}};}function handleEntityNotFound(_0x3fd933,_0x549191){return function(_0x3b727c){if(!_0x3b727c){_0x3fd933[_0xdf69('0x1b')](0x194);}return _0x3b727c;};}function handleError(_0x3e4f28,_0x5969cb){_0x5969cb=_0x5969cb||0x1f4;return function(_0x2da3df){logger['error'](_0x2da3df['stack']);if(_0x2da3df['name']){delete _0x2da3df['name'];}_0x3e4f28[_0xdf69('0x1c')](_0x5969cb)[_0xdf69('0x27')](_0x2da3df);};}exports['index']=function(_0x301bd2,_0xd81d0a){var _0x19cf2d={},_0x12aec3={},_0x1b7c16={'count':0x0,'rows':[]};var _0x1b57b3=_[_0xdf69('0x28')](db[_0xdf69('0x29')][_0xdf69('0x2a')],function(_0x3b97df){return{'name':_0x3b97df[_0xdf69('0x2b')],'type':_0x3b97df[_0xdf69('0x2c')][_0xdf69('0x2d')]};});_0x12aec3[_0xdf69('0x2e')]=_[_0xdf69('0x28')](_0x1b57b3,_0xdf69('0x2f'));_0x12aec3[_0xdf69('0x30')]=_['keys'](_0x301bd2[_0xdf69('0x30')]);_0x12aec3[_0xdf69('0x31')]=_[_0xdf69('0x32')](_0x12aec3[_0xdf69('0x2e')],_0x12aec3[_0xdf69('0x30')]);_0x19cf2d['attributes']=_[_0xdf69('0x32')](_0x12aec3['model'],qs[_0xdf69('0x33')](_0x301bd2[_0xdf69('0x30')]['fields']));_0x19cf2d[_0xdf69('0x34')]=_0x19cf2d['attributes'][_0xdf69('0x35')]?_0x19cf2d[_0xdf69('0x34')]:_0x12aec3[_0xdf69('0x2e')];if(!_0x301bd2[_0xdf69('0x30')][_0xdf69('0x36')]('nolimit')){_0x19cf2d[_0xdf69('0x37')]=qs['limit'](_0x301bd2[_0xdf69('0x30')][_0xdf69('0x37')]);_0x19cf2d[_0xdf69('0x1f')]=qs[_0xdf69('0x1f')](_0x301bd2['query'][_0xdf69('0x1f')]);}_0x19cf2d['order']=qs[_0xdf69('0x38')](_0x301bd2['query'][_0xdf69('0x38')]);_0x19cf2d['where']=qs[_0xdf69('0x31')](_[_0xdf69('0x39')](_0x301bd2[_0xdf69('0x30')],_0x12aec3[_0xdf69('0x31')]),_0x1b57b3);if(_0x301bd2[_0xdf69('0x30')]['filter']){_0x19cf2d[_0xdf69('0x3a')]=_[_0xdf69('0x3b')](_0x19cf2d['where'],{'$or':_['map'](_0x1b57b3,function(_0x4ee03c){if(_0x4ee03c['type']!==_0xdf69('0x3c')){var _0x5aff7d={};_0x5aff7d[_0x4ee03c[_0xdf69('0x2f')]]={'$like':'%'+_0x301bd2[_0xdf69('0x30')][_0xdf69('0x3d')]+'%'};return _0x5aff7d;}})});}_0x19cf2d=_[_0xdf69('0x3b')]({},_0x19cf2d,_0x301bd2['options']);var _0x3de096={'where':_0x19cf2d[_0xdf69('0x3a')]};return db[_0xdf69('0x29')]['count'](_0x3de096)[_0xdf69('0x26')](function(_0xdd919d){_0x1b7c16[_0xdf69('0x21')]=_0xdd919d;if(_0x301bd2[_0xdf69('0x30')][_0xdf69('0x3e')]){_0x19cf2d[_0xdf69('0x3f')]=[{'all':!![]}];}return db[_0xdf69('0x29')]['findAll'](_0x19cf2d);})['then'](function(_0x1fc4aa){_0x1b7c16[_0xdf69('0x40')]=_0x1fc4aa;return _0x1b7c16;})[_0xdf69('0x26')](respondWithFilteredResult(_0xd81d0a,_0x19cf2d))[_0xdf69('0x41')](handleError(_0xd81d0a,null));};exports['show']=function(_0x4a972c,_0x5980b1){var _0x5454e1={'raw':!![],'where':{'id':_0x4a972c['params']['id']}},_0x2abc7f={};_0x2abc7f[_0xdf69('0x2e')]=_['keys'](db[_0xdf69('0x29')][_0xdf69('0x2a')]);_0x2abc7f[_0xdf69('0x30')]=_[_0xdf69('0x42')](_0x4a972c[_0xdf69('0x30')]);_0x2abc7f[_0xdf69('0x31')]=_[_0xdf69('0x32')](_0x2abc7f[_0xdf69('0x2e')],_0x2abc7f[_0xdf69('0x30')]);_0x5454e1['attributes']=_['intersection'](_0x2abc7f[_0xdf69('0x2e')],qs['fields'](_0x4a972c[_0xdf69('0x30')][_0xdf69('0x33')]));_0x5454e1[_0xdf69('0x34')]=_0x5454e1['attributes'][_0xdf69('0x35')]?_0x5454e1[_0xdf69('0x34')]:_0x2abc7f[_0xdf69('0x2e')];if(_0x4a972c[_0xdf69('0x30')]['includeAll']){_0x5454e1[_0xdf69('0x3f')]=[{'all':!![]}];}_0x5454e1=_[_0xdf69('0x3b')]({},_0x5454e1,_0x4a972c['options']);return db['Cdr'][_0xdf69('0x43')](_0x5454e1)[_0xdf69('0x26')](handleEntityNotFound(_0x5980b1,null))[_0xdf69('0x26')](respondWithResult(_0x5980b1,null))[_0xdf69('0x41')](handleError(_0x5980b1,null));};exports[_0xdf69('0x44')]=function(_0x1b46c6,_0x578eec){return db['Cdr'][_0xdf69('0x44')](_0x1b46c6[_0xdf69('0x45')],{})[_0xdf69('0x26')](respondWithResult(_0x578eec,0xc9))[_0xdf69('0x41')](handleError(_0x578eec,null));};exports['update']=function(_0x4bc70f,_0xb34f76){if(_0x4bc70f[_0xdf69('0x45')]['id']){delete _0x4bc70f[_0xdf69('0x45')]['id'];}return db[_0xdf69('0x29')][_0xdf69('0x43')]({'where':{'id':_0x4bc70f[_0xdf69('0x46')]['id']}})[_0xdf69('0x26')](handleEntityNotFound(_0xb34f76,null))[_0xdf69('0x26')](saveUpdates(_0x4bc70f[_0xdf69('0x45')],null))[_0xdf69('0x26')](respondWithResult(_0xb34f76,null))[_0xdf69('0x41')](handleError(_0xb34f76,null));};exports[_0xdf69('0x47')]=function(_0x9a24c9,_0x439b06){return db['Cdr'][_0xdf69('0x43')]({'where':{'id':_0x9a24c9[_0xdf69('0x46')]['id']}})[_0xdf69('0x26')](handleEntityNotFound(_0x439b06,null))['then'](removeEntity(_0x439b06,null))[_0xdf69('0x41')](handleError(_0x439b06,null));};exports[_0xdf69('0x48')]=function(_0x15ca48,_0x4abeb7){return db[_0xdf69('0x29')]['describe']()[_0xdf69('0x26')](respondWithResult(_0x4abeb7,null))[_0xdf69('0x41')](handleError(_0x4abeb7,null));};
\ No newline at end of file
+var _0xcd59=['includeAll','include','findAll','rows','catch','show','params','keys','intersection','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL'];(function(_0x2db82d,_0x2576f7){var _0x424948=function(_0x20d583){while(--_0x20d583){_0x2db82d['push'](_0x2db82d['shift']());}};_0x424948(++_0x2576f7);}(_0xcd59,0x14b));var _0x9cd5=function(_0x919445,_0x5467dc){_0x919445=_0x919445-0x0;var _0x511b3e=_0xcd59[_0x919445];return _0x511b3e;};'use strict';var emlformat=require(_0x9cd5('0x0'));var rimraf=require(_0x9cd5('0x1'));var zipdir=require(_0x9cd5('0x2'));var jsonpatch=require(_0x9cd5('0x3'));var rp=require(_0x9cd5('0x4'));var moment=require(_0x9cd5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9cd5('0x6'));var util=require(_0x9cd5('0x7'));var path=require(_0x9cd5('0x8'));var sox=require(_0x9cd5('0x9'));var csv=require(_0x9cd5('0xa'));var ejs=require(_0x9cd5('0xb'));var fs=require('fs');var fs_extra=require(_0x9cd5('0xc'));var _=require(_0x9cd5('0xd'));var squel=require(_0x9cd5('0xe'));var crypto=require(_0x9cd5('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x9cd5('0x10'));var toCsv=require(_0x9cd5('0xa'));var querystring=require(_0x9cd5('0x11'));var Papa=require(_0x9cd5('0x12'));var Redis=require(_0x9cd5('0x13'));var authService=require(_0x9cd5('0x14'));var qs=require(_0x9cd5('0x15'));var as=require(_0x9cd5('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9cd5('0x17'))(_0x9cd5('0x18'));var utils=require(_0x9cd5('0x19'));var config=require(_0x9cd5('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c9cf1,_0x172e29){_0x172e29=_0x172e29||0xcc;return function(_0x44518d){if(_0x44518d){return _0x2c9cf1[_0x9cd5('0x1b')](_0x172e29);}return _0x2c9cf1[_0x9cd5('0x1c')](_0x172e29)[_0x9cd5('0x1d')]();};}function respondWithResult(_0x52698b,_0x15b639){_0x15b639=_0x15b639||0xc8;return function(_0x1445c0){if(_0x1445c0){return _0x52698b[_0x9cd5('0x1c')](_0x15b639)['json'](_0x1445c0);}};}function respondWithFilteredResult(_0x541cb8,_0x5c4f3d){return function(_0x258305){if(_0x258305){var _0x1ea3f7=typeof _0x5c4f3d['offset']===_0x9cd5('0x1e')&&typeof _0x5c4f3d[_0x9cd5('0x1f')]===_0x9cd5('0x1e');var _0x57b986=_0x258305[_0x9cd5('0x20')];var _0x2d1863=_0x1ea3f7?0x0:_0x5c4f3d[_0x9cd5('0x21')];var _0x3a6f01=_0x1ea3f7?_0x258305[_0x9cd5('0x20')]:_0x5c4f3d[_0x9cd5('0x21')]+_0x5c4f3d['limit'];var _0x37ea13;if(_0x3a6f01>=_0x57b986){_0x3a6f01=_0x57b986;_0x37ea13=0xc8;}else{_0x37ea13=0xce;}_0x541cb8[_0x9cd5('0x1c')](_0x37ea13);return _0x541cb8[_0x9cd5('0x22')](_0x9cd5('0x23'),_0x2d1863+'-'+_0x3a6f01+'/'+_0x57b986)[_0x9cd5('0x24')](_0x258305);}return null;};}function patchUpdates(_0x4ed8b9){return function(_0x16c4e9){try{jsonpatch[_0x9cd5('0x25')](_0x16c4e9,_0x4ed8b9,!![]);}catch(_0x3f1f5c){return BPromise[_0x9cd5('0x26')](_0x3f1f5c);}return _0x16c4e9[_0x9cd5('0x27')]();};}function saveUpdates(_0x1185d7,_0x1cf603){return function(_0x2238ec){if(_0x2238ec){return _0x2238ec[_0x9cd5('0x28')](_0x1185d7)['then'](function(_0x297f0e){return _0x297f0e;});}return null;};}function removeEntity(_0xba8ee9,_0x1a88e3){return function(_0x43f47d){if(_0x43f47d){return _0x43f47d['destroy']()[_0x9cd5('0x29')](function(){_0xba8ee9[_0x9cd5('0x1c')](0xcc)[_0x9cd5('0x1d')]();});}};}function handleEntityNotFound(_0xe36f86,_0x297776){return function(_0x4509e7){if(!_0x4509e7){_0xe36f86[_0x9cd5('0x1b')](0x194);}return _0x4509e7;};}function handleError(_0x4a245f,_0x1dcb6f){_0x1dcb6f=_0x1dcb6f||0x1f4;return function(_0x64a1c4){logger[_0x9cd5('0x2a')](_0x64a1c4['stack']);if(_0x64a1c4['name']){delete _0x64a1c4[_0x9cd5('0x2b')];}_0x4a245f['status'](_0x1dcb6f)['send'](_0x64a1c4);};}exports[_0x9cd5('0x2c')]=function(_0x2a20d2,_0x13e0d3){var _0x5184b9={},_0x40461a={},_0xc0104b={'count':0x0,'rows':[]};var _0x27e1fd=_[_0x9cd5('0x2d')](db[_0x9cd5('0x2e')][_0x9cd5('0x2f')],function(_0x1dbddc){return{'name':_0x1dbddc[_0x9cd5('0x30')],'type':_0x1dbddc[_0x9cd5('0x31')][_0x9cd5('0x32')]};});_0x40461a[_0x9cd5('0x33')]=_[_0x9cd5('0x2d')](_0x27e1fd,_0x9cd5('0x2b'));_0x40461a[_0x9cd5('0x34')]=_['keys'](_0x2a20d2[_0x9cd5('0x34')]);_0x40461a[_0x9cd5('0x35')]=_['intersection'](_0x40461a['model'],_0x40461a[_0x9cd5('0x34')]);_0x5184b9[_0x9cd5('0x36')]=_['intersection'](_0x40461a[_0x9cd5('0x33')],qs['fields'](_0x2a20d2['query'][_0x9cd5('0x37')]));_0x5184b9[_0x9cd5('0x36')]=_0x5184b9[_0x9cd5('0x36')][_0x9cd5('0x38')]?_0x5184b9['attributes']:_0x40461a[_0x9cd5('0x33')];if(!_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x39')]('nolimit')){_0x5184b9[_0x9cd5('0x1f')]=qs[_0x9cd5('0x1f')](_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x1f')]);_0x5184b9[_0x9cd5('0x21')]=qs[_0x9cd5('0x21')](_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x21')]);}_0x5184b9[_0x9cd5('0x3a')]=qs[_0x9cd5('0x3b')](_0x2a20d2[_0x9cd5('0x34')]['sort']);_0x5184b9[_0x9cd5('0x3c')]=qs['filters'](_['pick'](_0x2a20d2[_0x9cd5('0x34')],_0x40461a[_0x9cd5('0x35')]),_0x27e1fd);if(_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x3d')]){_0x5184b9['where']=_[_0x9cd5('0x3e')](_0x5184b9[_0x9cd5('0x3c')],{'$or':_[_0x9cd5('0x2d')](_0x27e1fd,function(_0x458a6a){if(_0x458a6a['type']!==_0x9cd5('0x3f')){var _0x3f50de={};_0x3f50de[_0x458a6a[_0x9cd5('0x2b')]]={'$like':'%'+_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x3d')]+'%'};return _0x3f50de;}})});}_0x5184b9=_[_0x9cd5('0x3e')]({},_0x5184b9,_0x2a20d2['options']);var _0x26cf61={'where':_0x5184b9[_0x9cd5('0x3c')]};return db[_0x9cd5('0x2e')][_0x9cd5('0x20')](_0x26cf61)[_0x9cd5('0x29')](function(_0x4182bd){_0xc0104b[_0x9cd5('0x20')]=_0x4182bd;if(_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x40')]){_0x5184b9[_0x9cd5('0x41')]=[{'all':!![]}];}return db[_0x9cd5('0x2e')][_0x9cd5('0x42')](_0x5184b9);})[_0x9cd5('0x29')](function(_0xa12319){_0xc0104b[_0x9cd5('0x43')]=_0xa12319;return _0xc0104b;})[_0x9cd5('0x29')](respondWithFilteredResult(_0x13e0d3,_0x5184b9))[_0x9cd5('0x44')](handleError(_0x13e0d3,null));};exports[_0x9cd5('0x45')]=function(_0x4ba72c,_0x13d4b8){var _0x58ae2e={'raw':!![],'where':{'id':_0x4ba72c[_0x9cd5('0x46')]['id']}},_0x427d78={};_0x427d78[_0x9cd5('0x33')]=_[_0x9cd5('0x47')](db[_0x9cd5('0x2e')]['rawAttributes']);_0x427d78[_0x9cd5('0x34')]=_[_0x9cd5('0x47')](_0x4ba72c[_0x9cd5('0x34')]);_0x427d78['filters']=_[_0x9cd5('0x48')](_0x427d78[_0x9cd5('0x33')],_0x427d78[_0x9cd5('0x34')]);_0x58ae2e[_0x9cd5('0x36')]=_['intersection'](_0x427d78[_0x9cd5('0x33')],qs[_0x9cd5('0x37')](_0x4ba72c[_0x9cd5('0x34')][_0x9cd5('0x37')]));_0x58ae2e[_0x9cd5('0x36')]=_0x58ae2e[_0x9cd5('0x36')][_0x9cd5('0x38')]?_0x58ae2e[_0x9cd5('0x36')]:_0x427d78[_0x9cd5('0x33')];if(_0x4ba72c[_0x9cd5('0x34')][_0x9cd5('0x40')]){_0x58ae2e[_0x9cd5('0x41')]=[{'all':!![]}];}_0x58ae2e=_[_0x9cd5('0x3e')]({},_0x58ae2e,_0x4ba72c[_0x9cd5('0x49')]);return db[_0x9cd5('0x2e')][_0x9cd5('0x4a')](_0x58ae2e)[_0x9cd5('0x29')](handleEntityNotFound(_0x13d4b8,null))[_0x9cd5('0x29')](respondWithResult(_0x13d4b8,null))['catch'](handleError(_0x13d4b8,null));};exports[_0x9cd5('0x4b')]=function(_0x1c581a,_0x3fead7){return db[_0x9cd5('0x2e')]['create'](_0x1c581a[_0x9cd5('0x4c')],{})[_0x9cd5('0x29')](respondWithResult(_0x3fead7,0xc9))['catch'](handleError(_0x3fead7,null));};exports[_0x9cd5('0x28')]=function(_0x155652,_0x152b17){if(_0x155652[_0x9cd5('0x4c')]['id']){delete _0x155652[_0x9cd5('0x4c')]['id'];}return db[_0x9cd5('0x2e')][_0x9cd5('0x4a')]({'where':{'id':_0x155652[_0x9cd5('0x46')]['id']}})['then'](handleEntityNotFound(_0x152b17,null))['then'](saveUpdates(_0x155652[_0x9cd5('0x4c')],null))[_0x9cd5('0x29')](respondWithResult(_0x152b17,null))[_0x9cd5('0x44')](handleError(_0x152b17,null));};exports[_0x9cd5('0x4d')]=function(_0x5a933a,_0xf6e17b){return db['Cdr']['find']({'where':{'id':_0x5a933a[_0x9cd5('0x46')]['id']}})[_0x9cd5('0x29')](handleEntityNotFound(_0xf6e17b,null))[_0x9cd5('0x29')](removeEntity(_0xf6e17b,null))['catch'](handleError(_0xf6e17b,null));};exports[_0x9cd5('0x4e')]=function(_0x30c80f,_0x310e4a){return db[_0x9cd5('0x2e')][_0x9cd5('0x4e')]()[_0x9cd5('0x29')](respondWithResult(_0x310e4a,null))['catch'](handleError(_0x310e4a,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index c54a876..21928bc 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x1fe06f,_0x160669){var _0x500880=function(_0x4ba843){while(--_0x4ba843){_0x1fe06f['push'](_0x1fe06f['shift']());}};_0x500880(++_0x160669);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x3d3690,_0x5c3131){var _0x5ea78b=function(_0x53ce9e){while(--_0x53ce9e){_0x3d3690['push'](_0x3d3690['shift']());}};_0x5ea78b(++_0x5c3131);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 0cd546a..df9f894 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 _0xeb87=['Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3d40b8,_0x4dce8e){var _0x57fc0d=function(_0x3134fe){while(--_0x3134fe){_0x3d40b8['push'](_0x3d40b8['shift']());}};_0x57fc0d(++_0x4dce8e);}(_0xeb87,0x195));var _0x7eb8=function(_0x50199c,_0x5bd464){_0x50199c=_0x50199c-0x0;var _0x358438=_0xeb87[_0x50199c];return _0x358438;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7eb8('0x0'));var BPromise=require(_0x7eb8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7eb8('0x2'));var db=require(_0x7eb8('0x3'))['db'];var utils=require(_0x7eb8('0x4'));var logger=require(_0x7eb8('0x5'))(_0x7eb8('0x6'));var config=require(_0x7eb8('0x7'));var jayson=require(_0x7eb8('0x8'));var client=jayson[_0x7eb8('0x9')][_0x7eb8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e6915,_0x48c092,_0x545f6d){return new BPromise(function(_0x3858bc,_0x28b2a4){return client[_0x7eb8('0xb')](_0x4e6915,_0x545f6d)[_0x7eb8('0xc')](function(_0xfe16a7){logger['info'](_0x7eb8('0xd'),_0x48c092,_0x7eb8('0xe'));logger[_0x7eb8('0xf')](_0x7eb8('0x10'),_0x48c092,_0x7eb8('0xe'),JSON[_0x7eb8('0x11')](_0xfe16a7));if(_0xfe16a7['error']){if(_0xfe16a7[_0x7eb8('0x12')][_0x7eb8('0x13')]===0x1f4){logger[_0x7eb8('0x12')](_0x7eb8('0xd'),_0x48c092,_0xfe16a7['error'][_0x7eb8('0x14')]);return _0x28b2a4(_0xfe16a7[_0x7eb8('0x12')][_0x7eb8('0x14')]);}logger[_0x7eb8('0x12')]('Cdr,\x20%s,\x20%s',_0x48c092,_0xfe16a7[_0x7eb8('0x12')][_0x7eb8('0x14')]);return _0x3858bc(_0xfe16a7[_0x7eb8('0x12')][_0x7eb8('0x14')]);}else{logger['info'](_0x7eb8('0xd'),_0x48c092,'request\x20sent');_0x3858bc(_0xfe16a7['result']['message']);}})[_0x7eb8('0x15')](function(_0x3d0491){logger[_0x7eb8('0x12')](_0x7eb8('0xd'),_0x48c092,_0x3d0491);_0x28b2a4(_0x3d0491);});});}
\ No newline at end of file
+var _0xf1df=['jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5169ca,_0x2356e5){var _0x13f00d=function(_0xd31006){while(--_0xd31006){_0x5169ca['push'](_0x5169ca['shift']());}};_0x13f00d(++_0x2356e5);}(_0xf1df,0x186));var _0xff1d=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xf1df[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xff1d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xff1d('0x1'));var rs=require(_0xff1d('0x2'));var fs=require('fs');var Redis=require(_0xff1d('0x3'));var db=require(_0xff1d('0x4'))['db'];var utils=require(_0xff1d('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xff1d('0x6'));var client=jayson[_0xff1d('0x7')][_0xff1d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd42abf,_0x4a01d9,_0x2f6af8){return new BPromise(function(_0x4843ce,_0x43b6d5){return client[_0xff1d('0x9')](_0xd42abf,_0x2f6af8)[_0xff1d('0xa')](function(_0x20ad8c){logger[_0xff1d('0xb')](_0xff1d('0xc'),_0x4a01d9,_0xff1d('0xd'));logger[_0xff1d('0xe')](_0xff1d('0xf'),_0x4a01d9,_0xff1d('0xd'),JSON[_0xff1d('0x10')](_0x20ad8c));if(_0x20ad8c['error']){if(_0x20ad8c['error'][_0xff1d('0x11')]===0x1f4){logger[_0xff1d('0x12')]('Cdr,\x20%s,\x20%s',_0x4a01d9,_0x20ad8c['error'][_0xff1d('0x13')]);return _0x43b6d5(_0x20ad8c[_0xff1d('0x12')][_0xff1d('0x13')]);}logger[_0xff1d('0x12')](_0xff1d('0xc'),_0x4a01d9,_0x20ad8c[_0xff1d('0x12')]['message']);return _0x4843ce(_0x20ad8c[_0xff1d('0x12')][_0xff1d('0x13')]);}else{logger[_0xff1d('0xb')](_0xff1d('0xc'),_0x4a01d9,_0xff1d('0xd'));_0x4843ce(_0x20ad8c[_0xff1d('0x14')][_0xff1d('0x13')]);}})[_0xff1d('0x15')](function(_0x3cfcb7){logger['error'](_0xff1d('0xc'),_0x4a01d9,_0x3cfcb7);_0x43b6d5(_0x3cfcb7);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 83a4e3e..a2f54cb 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 _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(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2b3d1f,_0x40c8b6){var _0x187469=function(_0x23f359){while(--_0x23f359){_0x2b3d1f['push'](_0x2b3d1f['shift']());}};_0x187469(++_0x40c8b6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 8ae1c95..a361f60 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 _0x34e2=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x34e2,0x105));var _0x234e=function(_0x135deb,_0x6292e){_0x135deb=_0x135deb-0x0;var _0x31f7bd=_0x34e2[_0x135deb];return _0x31f7bd;};'use strict';var Sequelize=require(_0x234e('0x0'));module[_0x234e('0x1')]={'priority':{'type':Sequelize[_0x234e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x234e('0x3')],'allowNull':![],'defaultValue':_0x234e('0x4')},'appdata':{'type':Sequelize[_0x234e('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x234e('0x3')],'defaultValue':_0x234e('0x6')}};
\ No newline at end of file
+var _0xeddb=['INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x1bb812,_0x23eacc){var _0x372adb=function(_0x5ad456){while(--_0x5ad456){_0x1bb812['push'](_0x1bb812['shift']());}};_0x372adb(++_0x23eacc);}(_0xeddb,0x9a));var _0xbedd=function(_0x323430,_0x3d2b6d){_0x323430=_0x323430-0x0;var _0x9eecd1=_0xeddb[_0x323430];return _0x9eecd1;};'use strict';var Sequelize=require(_0xbedd('0x0'));module['exports']={'priority':{'type':Sequelize[_0xbedd('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xbedd('0x2')],'allowNull':![],'defaultValue':_0xbedd('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbedd('0x2')],'defaultValue':_0xbedd('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 4369262..5151f21 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 _0xd8cc=['end','json','undefined','limit','count','offset','Content-Range','reject','then','destroy','sendStatus','error','stack','name','send','model','keys','ChatApplication','rawAttributes','query','filters','attributes','fields','includeAll','include','options','find','catch','body','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd8cc,0xc9));var _0xcd8c=function(_0x459423,_0x3416a8){_0x459423=_0x459423-0x0;var _0x42ed14=_0xd8cc[_0x459423];return _0x42ed14;};'use strict';var emlformat=require(_0xcd8c('0x0'));var rimraf=require(_0xcd8c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcd8c('0x2'));var moment=require(_0xcd8c('0x3'));var BPromise=require(_0xcd8c('0x4'));var Mustache=require(_0xcd8c('0x5'));var util=require('util');var path=require(_0xcd8c('0x6'));var sox=require(_0xcd8c('0x7'));var csv=require('to-csv');var ejs=require(_0xcd8c('0x8'));var fs=require('fs');var fs_extra=require(_0xcd8c('0x9'));var _=require('lodash');var squel=require(_0xcd8c('0xa'));var crypto=require(_0xcd8c('0xb'));var jsforce=require(_0xcd8c('0xc'));var deskjs=require(_0xcd8c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcd8c('0xe'));var Papa=require(_0xcd8c('0xf'));var Redis=require(_0xcd8c('0x10'));var authService=require(_0xcd8c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xcd8c('0x12'));var hardwareService=require(_0xcd8c('0x13'));var logger=require(_0xcd8c('0x14'))(_0xcd8c('0x15'));var utils=require(_0xcd8c('0x16'));var config=require(_0xcd8c('0x17'));var licenseUtil=require(_0xcd8c('0x18'));var db=require(_0xcd8c('0x19'))['db'];function respondWithStatusCode(_0x338bd6,_0x5a55f4){_0x5a55f4=_0x5a55f4||0xcc;return function(_0x1d695b){if(_0x1d695b){return _0x338bd6['sendStatus'](_0x5a55f4);}return _0x338bd6[_0xcd8c('0x1a')](_0x5a55f4)[_0xcd8c('0x1b')]();};}function respondWithResult(_0x3b90be,_0x5a41e0){_0x5a41e0=_0x5a41e0||0xc8;return function(_0xf0cb62){if(_0xf0cb62){return _0x3b90be[_0xcd8c('0x1a')](_0x5a41e0)[_0xcd8c('0x1c')](_0xf0cb62);}};}function respondWithFilteredResult(_0xffcb8d,_0x8e98d6){return function(_0x2df9d1){if(_0x2df9d1){var _0x13058b=typeof _0x8e98d6['offset']===_0xcd8c('0x1d')&&typeof _0x8e98d6[_0xcd8c('0x1e')]===_0xcd8c('0x1d');var _0x2f1180=_0x2df9d1[_0xcd8c('0x1f')];var _0x4a6652=_0x13058b?0x0:_0x8e98d6[_0xcd8c('0x20')];var _0x120d0d=_0x13058b?_0x2df9d1[_0xcd8c('0x1f')]:_0x8e98d6[_0xcd8c('0x20')]+_0x8e98d6[_0xcd8c('0x1e')];var _0x387ff2;if(_0x120d0d>=_0x2f1180){_0x120d0d=_0x2f1180;_0x387ff2=0xc8;}else{_0x387ff2=0xce;}_0xffcb8d[_0xcd8c('0x1a')](_0x387ff2);return _0xffcb8d['set'](_0xcd8c('0x21'),_0x4a6652+'-'+_0x120d0d+'/'+_0x2f1180)[_0xcd8c('0x1c')](_0x2df9d1);}return null;};}function patchUpdates(_0x5008d3){return function(_0x5330ea){try{jsonpatch['apply'](_0x5330ea,_0x5008d3,!![]);}catch(_0x506d64){return BPromise[_0xcd8c('0x22')](_0x506d64);}return _0x5330ea['save']();};}function saveUpdates(_0x534257,_0x59297d){return function(_0x4f12b8){if(_0x4f12b8){return _0x4f12b8['update'](_0x534257)[_0xcd8c('0x23')](function(_0x3c60ff){return _0x3c60ff;});}return null;};}function removeEntity(_0x2d7718,_0x5368df){return function(_0x2e5711){if(_0x2e5711){return _0x2e5711[_0xcd8c('0x24')]()[_0xcd8c('0x23')](function(){_0x2d7718[_0xcd8c('0x1a')](0xcc)[_0xcd8c('0x1b')]();});}};}function handleEntityNotFound(_0x77ca04,_0x5caaa0){return function(_0x56a54c){if(!_0x56a54c){_0x77ca04[_0xcd8c('0x25')](0x194);}return _0x56a54c;};}function handleError(_0x1e1e00,_0xfc6ca5){_0xfc6ca5=_0xfc6ca5||0x1f4;return function(_0x4c67c1){logger[_0xcd8c('0x26')](_0x4c67c1[_0xcd8c('0x27')]);if(_0x4c67c1['name']){delete _0x4c67c1[_0xcd8c('0x28')];}_0x1e1e00[_0xcd8c('0x1a')](_0xfc6ca5)[_0xcd8c('0x29')](_0x4c67c1);};}exports['show']=function(_0x5193a1,_0x36c342){var _0x5308ec={'raw':!![],'where':{'id':_0x5193a1['params']['id']}},_0x4c772a={};_0x4c772a[_0xcd8c('0x2a')]=_[_0xcd8c('0x2b')](db[_0xcd8c('0x2c')][_0xcd8c('0x2d')]);_0x4c772a[_0xcd8c('0x2e')]=_[_0xcd8c('0x2b')](_0x5193a1[_0xcd8c('0x2e')]);_0x4c772a[_0xcd8c('0x2f')]=_['intersection'](_0x4c772a[_0xcd8c('0x2a')],_0x4c772a[_0xcd8c('0x2e')]);_0x5308ec[_0xcd8c('0x30')]=_['intersection'](_0x4c772a[_0xcd8c('0x2a')],qs[_0xcd8c('0x31')](_0x5193a1['query'][_0xcd8c('0x31')]));_0x5308ec['attributes']=_0x5308ec[_0xcd8c('0x30')]['length']?_0x5308ec['attributes']:_0x4c772a[_0xcd8c('0x2a')];if(_0x5193a1[_0xcd8c('0x2e')][_0xcd8c('0x32')]){_0x5308ec[_0xcd8c('0x33')]=[{'all':!![]}];}_0x5308ec=_['merge']({},_0x5308ec,_0x5193a1[_0xcd8c('0x34')]);return db['ChatApplication'][_0xcd8c('0x35')](_0x5308ec)[_0xcd8c('0x23')](handleEntityNotFound(_0x36c342,null))[_0xcd8c('0x23')](respondWithResult(_0x36c342,null))[_0xcd8c('0x36')](handleError(_0x36c342,null));};exports['update']=function(_0x3f57b0,_0x5bb651){if(_0x3f57b0[_0xcd8c('0x37')]['id']){delete _0x3f57b0['body']['id'];}return db['ChatApplication']['find']({'where':{'id':_0x3f57b0[_0xcd8c('0x38')]['id']}})['then'](handleEntityNotFound(_0x5bb651,null))['then'](saveUpdates(_0x3f57b0[_0xcd8c('0x37')],null))[_0xcd8c('0x23')](respondWithResult(_0x5bb651,null))[_0xcd8c('0x36')](handleError(_0x5bb651,null));};exports['destroy']=function(_0x1b92bb,_0x19df28){return db[_0xcd8c('0x2c')][_0xcd8c('0x35')]({'where':{'id':_0x1b92bb[_0xcd8c('0x38')]['id']}})[_0xcd8c('0x23')](handleEntityNotFound(_0x19df28,null))[_0xcd8c('0x23')](removeEntity(_0x19df28,null))[_0xcd8c('0x36')](handleError(_0x19df28,null));};
\ No newline at end of file
+var _0x8a9a=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','catch','body','destroy','find','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8a9a,0x193));var _0xa8a9=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x8a9a[_0x550d12];return _0x12103d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa8a9('0x0'));var jsonpatch=require(_0xa8a9('0x1'));var rp=require(_0xa8a9('0x2'));var moment=require('moment');var BPromise=require(_0xa8a9('0x3'));var Mustache=require(_0xa8a9('0x4'));var util=require('util');var path=require('path');var sox=require(_0xa8a9('0x5'));var csv=require(_0xa8a9('0x6'));var ejs=require(_0xa8a9('0x7'));var fs=require('fs');var fs_extra=require(_0xa8a9('0x8'));var _=require(_0xa8a9('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa8a9('0xa'));var deskjs=require(_0xa8a9('0xb'));var toCsv=require(_0xa8a9('0x6'));var querystring=require(_0xa8a9('0xc'));var Papa=require(_0xa8a9('0xd'));var Redis=require(_0xa8a9('0xe'));var authService=require(_0xa8a9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa8a9('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa8a9('0x11'))('api');var utils=require(_0xa8a9('0x12'));var config=require(_0xa8a9('0x13'));var licenseUtil=require(_0xa8a9('0x14'));var db=require(_0xa8a9('0x15'))['db'];function respondWithStatusCode(_0x3e962a,_0x16d838){_0x16d838=_0x16d838||0xcc;return function(_0x53fbc5){if(_0x53fbc5){return _0x3e962a['sendStatus'](_0x16d838);}return _0x3e962a[_0xa8a9('0x16')](_0x16d838)['end']();};}function respondWithResult(_0x3bb559,_0x34bec9){_0x34bec9=_0x34bec9||0xc8;return function(_0x3a0e08){if(_0x3a0e08){return _0x3bb559[_0xa8a9('0x16')](_0x34bec9)[_0xa8a9('0x17')](_0x3a0e08);}};}function respondWithFilteredResult(_0x4c448c,_0x3593fa){return function(_0x5c2cde){if(_0x5c2cde){var _0x1c7d52=typeof _0x3593fa['offset']===_0xa8a9('0x18')&&typeof _0x3593fa[_0xa8a9('0x19')]==='undefined';var _0x25285c=_0x5c2cde['count'];var _0x2c4fe7=_0x1c7d52?0x0:_0x3593fa[_0xa8a9('0x1a')];var _0xce2084=_0x1c7d52?_0x5c2cde[_0xa8a9('0x1b')]:_0x3593fa['offset']+_0x3593fa['limit'];var _0x34b6d1;if(_0xce2084>=_0x25285c){_0xce2084=_0x25285c;_0x34b6d1=0xc8;}else{_0x34b6d1=0xce;}_0x4c448c['status'](_0x34b6d1);return _0x4c448c[_0xa8a9('0x1c')](_0xa8a9('0x1d'),_0x2c4fe7+'-'+_0xce2084+'/'+_0x25285c)[_0xa8a9('0x17')](_0x5c2cde);}return null;};}function patchUpdates(_0x39384c){return function(_0x126648){try{jsonpatch[_0xa8a9('0x1e')](_0x126648,_0x39384c,!![]);}catch(_0x20381c){return BPromise[_0xa8a9('0x1f')](_0x20381c);}return _0x126648[_0xa8a9('0x20')]();};}function saveUpdates(_0x390011,_0x1cc77a){return function(_0x2fd285){if(_0x2fd285){return _0x2fd285[_0xa8a9('0x21')](_0x390011)['then'](function(_0x481a29){return _0x481a29;});}return null;};}function removeEntity(_0x4343f4,_0xa4c41a){return function(_0x32e784){if(_0x32e784){return _0x32e784['destroy']()[_0xa8a9('0x22')](function(){_0x4343f4[_0xa8a9('0x16')](0xcc)[_0xa8a9('0x23')]();});}};}function handleEntityNotFound(_0x233fe1,_0x488791){return function(_0x20fb5a){if(!_0x20fb5a){_0x233fe1[_0xa8a9('0x24')](0x194);}return _0x20fb5a;};}function handleError(_0x2f7a56,_0x1aef34){_0x1aef34=_0x1aef34||0x1f4;return function(_0x5f0c62){logger['error'](_0x5f0c62[_0xa8a9('0x25')]);if(_0x5f0c62[_0xa8a9('0x26')]){delete _0x5f0c62[_0xa8a9('0x26')];}_0x2f7a56[_0xa8a9('0x16')](_0x1aef34)[_0xa8a9('0x27')](_0x5f0c62);};}exports[_0xa8a9('0x28')]=function(_0x2abeb7,_0x155527){var _0x4c87d4={'raw':!![],'where':{'id':_0x2abeb7[_0xa8a9('0x29')]['id']}},_0x45714a={};_0x45714a[_0xa8a9('0x2a')]=_[_0xa8a9('0x2b')](db[_0xa8a9('0x2c')][_0xa8a9('0x2d')]);_0x45714a[_0xa8a9('0x2e')]=_[_0xa8a9('0x2b')](_0x2abeb7[_0xa8a9('0x2e')]);_0x45714a[_0xa8a9('0x2f')]=_[_0xa8a9('0x30')](_0x45714a[_0xa8a9('0x2a')],_0x45714a[_0xa8a9('0x2e')]);_0x4c87d4[_0xa8a9('0x31')]=_[_0xa8a9('0x30')](_0x45714a[_0xa8a9('0x2a')],qs['fields'](_0x2abeb7[_0xa8a9('0x2e')][_0xa8a9('0x32')]));_0x4c87d4[_0xa8a9('0x31')]=_0x4c87d4[_0xa8a9('0x31')]['length']?_0x4c87d4[_0xa8a9('0x31')]:_0x45714a[_0xa8a9('0x2a')];if(_0x2abeb7['query'][_0xa8a9('0x33')]){_0x4c87d4[_0xa8a9('0x34')]=[{'all':!![]}];}_0x4c87d4=_[_0xa8a9('0x35')]({},_0x4c87d4,_0x2abeb7[_0xa8a9('0x36')]);return db[_0xa8a9('0x2c')]['find'](_0x4c87d4)[_0xa8a9('0x22')](handleEntityNotFound(_0x155527,null))[_0xa8a9('0x22')](respondWithResult(_0x155527,null))[_0xa8a9('0x37')](handleError(_0x155527,null));};exports[_0xa8a9('0x21')]=function(_0x2c09b2,_0x44524d){if(_0x2c09b2['body']['id']){delete _0x2c09b2[_0xa8a9('0x38')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x2c09b2['params']['id']}})['then'](handleEntityNotFound(_0x44524d,null))[_0xa8a9('0x22')](saveUpdates(_0x2c09b2['body'],null))[_0xa8a9('0x22')](respondWithResult(_0x44524d,null))['catch'](handleError(_0x44524d,null));};exports[_0xa8a9('0x39')]=function(_0x15801f,_0xbc61c0){return db[_0xa8a9('0x2c')][_0xa8a9('0x3a')]({'where':{'id':_0x15801f[_0xa8a9('0x29')]['id']}})[_0xa8a9('0x22')](handleEntityNotFound(_0xbc61c0,null))[_0xa8a9('0x22')](removeEntity(_0xbc61c0,null))['catch'](handleError(_0xbc61c0,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 98af7e6..30776b8 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 _0x7c8e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api'];(function(_0x4e4552,_0xedadb4){var _0x2ee747=function(_0x53d485){while(--_0x53d485){_0x4e4552['push'](_0x4e4552['shift']());}};_0x2ee747(++_0xedadb4);}(_0x7c8e,0x94));var _0xe7c8=function(_0x313532,_0x33e75f){_0x313532=_0x313532-0x0;var _0x44bc16=_0x7c8e[_0x313532];return _0x44bc16;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7c8('0x0'))(_0xe7c8('0x1'));var moment=require(_0xe7c8('0x2'));var BPromise=require(_0xe7c8('0x3'));var rp=require(_0xe7c8('0x4'));var fs=require('fs');var path=require(_0xe7c8('0x5'));var rimraf=require(_0xe7c8('0x6'));var config=require(_0xe7c8('0x7'));var attributes=require(_0xe7c8('0x8'));module[_0xe7c8('0x9')]=function(_0x1cd3e5,_0x52ac01){return _0x1cd3e5[_0xe7c8('0xa')](_0xe7c8('0xb'),attributes,{'tableName':_0xe7c8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe7c8('0xd'),'collate':_0xe7c8('0xe')});};
\ No newline at end of file
+var _0x0fc2=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x1e18a8,_0x4f715f){var _0x21a158=function(_0x21976d){while(--_0x21976d){_0x1e18a8['push'](_0x1e18a8['shift']());}};_0x21a158(++_0x4f715f);}(_0x0fc2,0x6e));var _0x20fc=function(_0x38a642,_0x2cf3dd){_0x38a642=_0x38a642-0x0;var _0x2bda49=_0x0fc2[_0x38a642];return _0x2bda49;};'use strict';var _=require(_0x20fc('0x0'));var util=require(_0x20fc('0x1'));var logger=require(_0x20fc('0x2'))(_0x20fc('0x3'));var moment=require('moment');var BPromise=require(_0x20fc('0x4'));var rp=require(_0x20fc('0x5'));var fs=require('fs');var path=require(_0x20fc('0x6'));var rimraf=require(_0x20fc('0x7'));var config=require(_0x20fc('0x8'));var attributes=require(_0x20fc('0x9'));module[_0x20fc('0xa')]=function(_0x13f2d5,_0x10f6ad){return _0x13f2d5[_0x20fc('0xb')](_0x20fc('0xc'),attributes,{'tableName':_0x20fc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x20fc('0xe'),'collate':_0x20fc('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index b261254..6ee430a 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 _0x8dff=['rpc','../../config/environment','jayson/promise','client','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0x8dff,0x72));var _0xf8df=function(_0x16b3d7,_0x5d77f9){_0x16b3d7=_0x16b3d7-0x0;var _0x1abeaa=_0x8dff[_0x16b3d7];return _0x1abeaa;};'use strict';var _=require('lodash');var util=require(_0xf8df('0x0'));var moment=require(_0xf8df('0x1'));var BPromise=require(_0xf8df('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf8df('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf8df('0x4'));var logger=require(_0xf8df('0x5'))(_0xf8df('0x6'));var config=require(_0xf8df('0x7'));var jayson=require(_0xf8df('0x8'));var client=jayson[_0xf8df('0x9')][_0xf8df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e6172,_0x1e89fd,_0x41a64b){return new BPromise(function(_0x14201e,_0x5d8039){return client[_0xf8df('0xb')](_0x4e6172,_0x41a64b)['then'](function(_0x1a0b00){logger[_0xf8df('0xc')](_0xf8df('0xd'),_0x1e89fd,_0xf8df('0xe'));logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x1e89fd,_0xf8df('0xe'),JSON[_0xf8df('0xf')](_0x1a0b00));if(_0x1a0b00[_0xf8df('0x10')]){if(_0x1a0b00['error'][_0xf8df('0x11')]===0x1f4){logger[_0xf8df('0x10')](_0xf8df('0xd'),_0x1e89fd,_0x1a0b00[_0xf8df('0x10')][_0xf8df('0x12')]);return _0x5d8039(_0x1a0b00[_0xf8df('0x10')]['message']);}logger[_0xf8df('0x10')](_0xf8df('0xd'),_0x1e89fd,_0x1a0b00['error']['message']);return _0x14201e(_0x1a0b00[_0xf8df('0x10')][_0xf8df('0x12')]);}else{logger[_0xf8df('0xc')]('ChatApplication,\x20%s,\x20%s',_0x1e89fd,'request\x20sent');_0x14201e(_0x1a0b00['result'][_0xf8df('0x12')]);}})[_0xf8df('0x13')](function(_0x228106){logger['error']('ChatApplication,\x20%s,\x20%s',_0x1e89fd,_0x228106);_0x5d8039(_0x228106);});});}
\ No newline at end of file
+var _0xfca9=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x2bf1fb,_0x10022d){var _0x5e7e68=function(_0x287fbb){while(--_0x287fbb){_0x2bf1fb['push'](_0x2bf1fb['shift']());}};_0x5e7e68(++_0x10022d);}(_0xfca9,0xd8));var _0x9fca=function(_0x5b80dd,_0x233be0){_0x5b80dd=_0x5b80dd-0x0;var _0x1db308=_0xfca9[_0x5b80dd];return _0x1db308;};'use strict';var _=require(_0x9fca('0x0'));var util=require(_0x9fca('0x1'));var moment=require(_0x9fca('0x2'));var BPromise=require(_0x9fca('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9fca('0x4'));var db=require(_0x9fca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9fca('0x6'))(_0x9fca('0x7'));var config=require('../../config/environment');var jayson=require(_0x9fca('0x8'));var client=jayson[_0x9fca('0x9')][_0x9fca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x221f35,_0x2e2110,_0x4dbc62){return new BPromise(function(_0x42eb58,_0x284f32){return client['request'](_0x221f35,_0x4dbc62)[_0x9fca('0xb')](function(_0x5dcc7b){logger[_0x9fca('0xc')](_0x9fca('0xd'),_0x2e2110,_0x9fca('0xe'));logger['debug'](_0x9fca('0xf'),_0x2e2110,_0x9fca('0xe'),JSON[_0x9fca('0x10')](_0x5dcc7b));if(_0x5dcc7b[_0x9fca('0x11')]){if(_0x5dcc7b[_0x9fca('0x11')][_0x9fca('0x12')]===0x1f4){logger[_0x9fca('0x11')]('ChatApplication,\x20%s,\x20%s',_0x2e2110,_0x5dcc7b['error'][_0x9fca('0x13')]);return _0x284f32(_0x5dcc7b[_0x9fca('0x11')][_0x9fca('0x13')]);}logger[_0x9fca('0x11')](_0x9fca('0xd'),_0x2e2110,_0x5dcc7b['error'][_0x9fca('0x13')]);return _0x42eb58(_0x5dcc7b['error'][_0x9fca('0x13')]);}else{logger[_0x9fca('0xc')](_0x9fca('0xd'),_0x2e2110,_0x9fca('0xe'));_0x42eb58(_0x5dcc7b[_0x9fca('0x14')]['message']);}})[_0x9fca('0x15')](function(_0x4a7050){logger[_0x9fca('0x11')](_0x9fca('0xd'),_0x2e2110,_0x4a7050);_0x284f32(_0x4a7050);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 49daafe..c60ac4a 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 _0x34a2=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','put','update','delete','destroy','exports','multer'];(function(_0x1405e0,_0x505221){var _0x4dcfec=function(_0x457ba6){while(--_0x457ba6){_0x1405e0['push'](_0x1405e0['shift']());}};_0x4dcfec(++_0x505221);}(_0x34a2,0x1cf));var _0x234a=function(_0x4a5f6c,_0x4f532e){_0x4a5f6c=_0x4a5f6c-0x0;var _0x281ffd=_0x34a2[_0x4a5f6c];return _0x281ffd;};'use strict';var multer=require(_0x234a('0x0'));var util=require(_0x234a('0x1'));var path=require(_0x234a('0x2'));var timeout=require('connect-timeout');var express=require(_0x234a('0x3'));var router=express['Router']();var fs_extra=require(_0x234a('0x4'));var auth=require(_0x234a('0x5'));var interaction=require(_0x234a('0x6'));var config=require('../../config/environment');var controller=require(_0x234a('0x7'));router[_0x234a('0x8')](_0x234a('0x9'),auth[_0x234a('0xa')](),controller['show']);router[_0x234a('0xb')](_0x234a('0x9'),auth[_0x234a('0xa')](),controller[_0x234a('0xc')]);router[_0x234a('0xd')](_0x234a('0x9'),auth[_0x234a('0xa')](),controller[_0x234a('0xe')]);module[_0x234a('0xf')]=router;
\ No newline at end of file
+var _0xbadd=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','put','/:id','update','delete','exports','multer','util'];(function(_0x35920b,_0xa2169f){var _0x5ce2e1=function(_0x153c94){while(--_0x153c94){_0x35920b['push'](_0x35920b['shift']());}};_0x5ce2e1(++_0xa2169f);}(_0xbadd,0x12a));var _0xdbad=function(_0xf8886b,_0x504891){_0xf8886b=_0xf8886b-0x0;var _0x321bd5=_0xbadd[_0xf8886b];return _0x321bd5;};'use strict';var multer=require(_0xdbad('0x0'));var util=require(_0xdbad('0x1'));var path=require(_0xdbad('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdbad('0x3')]();var fs_extra=require(_0xdbad('0x4'));var auth=require(_0xdbad('0x5'));var interaction=require(_0xdbad('0x6'));var config=require(_0xdbad('0x7'));var controller=require('./chatApplication.controller');router[_0xdbad('0x8')]('/:id',auth[_0xdbad('0x9')](),controller['show']);router[_0xdbad('0xa')](_0xdbad('0xb'),auth['isAuthenticated'](),controller[_0xdbad('0xc')]);router[_0xdbad('0xd')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xdbad('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index c1deb9f..c1d5d33 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 _0x29e8=['exports','STRING','sequelize'];(function(_0x507e23,_0x22987a){var _0x19d05d=function(_0x799b82){while(--_0x799b82){_0x507e23['push'](_0x507e23['shift']());}};_0x19d05d(++_0x22987a);}(_0x29e8,0x116));var _0x829e=function(_0x58c226,_0x58b0e8){_0x58c226=_0x58c226-0x0;var _0x4c608e=_0x29e8[_0x58c226];return _0x4c608e;};'use strict';var Sequelize=require(_0x829e('0x0'));module[_0x829e('0x1')]={'name':{'type':Sequelize[_0x829e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x829e('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x855f=['BOOLEAN','sequelize','STRING'];(function(_0xf27b1,_0x29bae7){var _0x188b0b=function(_0x2f57cc){while(--_0x2f57cc){_0xf27b1['push'](_0xf27b1['shift']());}};_0x188b0b(++_0x29bae7);}(_0x855f,0x145));var _0xf855=function(_0x18f891,_0xbd3c84){_0x18f891=_0x18f891-0x0;var _0x241742=_0x855f[_0x18f891];return _0x241742;};'use strict';var Sequelize=require(_0xf855('0x0'));module['exports']={'name':{'type':Sequelize[_0xf855('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xf855('0x1')]},'write':{'type':Sequelize[_0xf855('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index ccdfb3c..369e6e4 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 _0xfd71=['params','find','create','body','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','order','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','update','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','ChatGroup','rows','catch','show'];(function(_0x341271,_0x234e68){var _0x42afdf=function(_0x4e54c7){while(--_0x4e54c7){_0x341271['push'](_0x341271['shift']());}};_0x42afdf(++_0x234e68);}(_0xfd71,0x13c));var _0x1fd7=function(_0x28bef9,_0x28e8d6){_0x28bef9=_0x28bef9-0x0;var _0x45db81=_0xfd71[_0x28bef9];return _0x45db81;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1fd7('0x0'));var zipdir=require(_0x1fd7('0x1'));var jsonpatch=require(_0x1fd7('0x2'));var rp=require(_0x1fd7('0x3'));var moment=require(_0x1fd7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1fd7('0x5'));var util=require(_0x1fd7('0x6'));var path=require(_0x1fd7('0x7'));var sox=require(_0x1fd7('0x8'));var csv=require('to-csv');var ejs=require(_0x1fd7('0x9'));var fs=require('fs');var fs_extra=require(_0x1fd7('0xa'));var _=require(_0x1fd7('0xb'));var squel=require(_0x1fd7('0xc'));var crypto=require(_0x1fd7('0xd'));var jsforce=require(_0x1fd7('0xe'));var deskjs=require(_0x1fd7('0xf'));var toCsv=require(_0x1fd7('0x10'));var querystring=require(_0x1fd7('0x11'));var Papa=require(_0x1fd7('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1fd7('0x13'));var hardwareService=require(_0x1fd7('0x14'));var logger=require('../../config/logger')(_0x1fd7('0x15'));var utils=require(_0x1fd7('0x16'));var config=require(_0x1fd7('0x17'));var licenseUtil=require(_0x1fd7('0x18'));var db=require(_0x1fd7('0x19'))['db'];config[_0x1fd7('0x1a')]=_[_0x1fd7('0x1b')](config[_0x1fd7('0x1a')],{'host':_0x1fd7('0x1c'),'port':0x18eb});var socket=require(_0x1fd7('0x1d'))(new Redis(config['redis']));require(_0x1fd7('0x1e'))[_0x1fd7('0x1f')](socket);function respondWithStatusCode(_0x5dfaa7,_0x16262f){_0x16262f=_0x16262f||0xcc;return function(_0x421a64){if(_0x421a64){return _0x5dfaa7['sendStatus'](_0x16262f);}return _0x5dfaa7[_0x1fd7('0x20')](_0x16262f)[_0x1fd7('0x21')]();};}function respondWithResult(_0x410ce5,_0xfa4c6e){_0xfa4c6e=_0xfa4c6e||0xc8;return function(_0x38fe27){if(_0x38fe27){return _0x410ce5['status'](_0xfa4c6e)[_0x1fd7('0x22')](_0x38fe27);}};}function respondWithFilteredResult(_0x3bda6a,_0x21bf74){return function(_0x23797c){if(_0x23797c){var _0x47414b=typeof _0x21bf74['offset']==='undefined'&&typeof _0x21bf74[_0x1fd7('0x23')]===_0x1fd7('0x24');var _0x3d0788=_0x23797c[_0x1fd7('0x25')];var _0x37b710=_0x47414b?0x0:_0x21bf74[_0x1fd7('0x26')];var _0x5931b8=_0x47414b?_0x23797c[_0x1fd7('0x25')]:_0x21bf74['offset']+_0x21bf74[_0x1fd7('0x23')];var _0x446e69;if(_0x5931b8>=_0x3d0788){_0x5931b8=_0x3d0788;_0x446e69=0xc8;}else{_0x446e69=0xce;}_0x3bda6a[_0x1fd7('0x20')](_0x446e69);return _0x3bda6a['set'](_0x1fd7('0x27'),_0x37b710+'-'+_0x5931b8+'/'+_0x3d0788)['json'](_0x23797c);}return null;};}function patchUpdates(_0x306199){return function(_0x1b868f){try{jsonpatch[_0x1fd7('0x28')](_0x1b868f,_0x306199,!![]);}catch(_0x251d94){return BPromise[_0x1fd7('0x29')](_0x251d94);}return _0x1b868f['save']();};}function saveUpdates(_0x4f4473,_0x2c8e35){return function(_0x22558b){if(_0x22558b){return _0x22558b[_0x1fd7('0x2a')](_0x4f4473)[_0x1fd7('0x2b')](function(_0x47a442){return _0x47a442;});}return null;};}function removeEntity(_0x41ad6c,_0x47cfdf){return function(_0x478376){if(_0x478376){return _0x478376['destroy']()[_0x1fd7('0x2b')](function(){_0x41ad6c['status'](0xcc)[_0x1fd7('0x21')]();});}};}function handleEntityNotFound(_0x4e8b49,_0x4e07b9){return function(_0x46f4e9){if(!_0x46f4e9){_0x4e8b49[_0x1fd7('0x2c')](0x194);}return _0x46f4e9;};}function handleError(_0x3c3446,_0x5b42bc){_0x5b42bc=_0x5b42bc||0x1f4;return function(_0x1c5903){logger['error'](_0x1c5903[_0x1fd7('0x2d')]);if(_0x1c5903[_0x1fd7('0x2e')]){delete _0x1c5903[_0x1fd7('0x2e')];}_0x3c3446['status'](_0x5b42bc)[_0x1fd7('0x2f')](_0x1c5903);};}exports[_0x1fd7('0x30')]=function(_0x413a05,_0x2c7d4b){var _0x10ab1a={},_0x5d45da={},_0x3fe097={'count':0x0,'rows':[]};var _0x41fd23=_[_0x1fd7('0x31')](db['ChatGroup'][_0x1fd7('0x32')],function(_0x3a5f9a){return{'name':_0x3a5f9a[_0x1fd7('0x33')],'type':_0x3a5f9a[_0x1fd7('0x34')][_0x1fd7('0x35')]};});_0x5d45da[_0x1fd7('0x36')]=_[_0x1fd7('0x31')](_0x41fd23,'name');_0x5d45da[_0x1fd7('0x37')]=_[_0x1fd7('0x38')](_0x413a05[_0x1fd7('0x37')]);_0x5d45da['filters']=_[_0x1fd7('0x39')](_0x5d45da[_0x1fd7('0x36')],_0x5d45da[_0x1fd7('0x37')]);_0x10ab1a[_0x1fd7('0x3a')]=_[_0x1fd7('0x39')](_0x5d45da[_0x1fd7('0x36')],qs[_0x1fd7('0x3b')](_0x413a05['query'][_0x1fd7('0x3b')]));_0x10ab1a[_0x1fd7('0x3a')]=_0x10ab1a[_0x1fd7('0x3a')][_0x1fd7('0x3c')]?_0x10ab1a['attributes']:_0x5d45da[_0x1fd7('0x36')];if(!_0x413a05[_0x1fd7('0x37')][_0x1fd7('0x3d')]('nolimit')){_0x10ab1a[_0x1fd7('0x23')]=qs[_0x1fd7('0x23')](_0x413a05[_0x1fd7('0x37')]['limit']);_0x10ab1a['offset']=qs[_0x1fd7('0x26')](_0x413a05['query']['offset']);}_0x10ab1a['order']=qs[_0x1fd7('0x3e')](_0x413a05['query'][_0x1fd7('0x3e')]);_0x10ab1a[_0x1fd7('0x3f')]=qs[_0x1fd7('0x40')](_[_0x1fd7('0x41')](_0x413a05[_0x1fd7('0x37')],_0x5d45da[_0x1fd7('0x40')]),_0x41fd23);if(_0x413a05[_0x1fd7('0x37')][_0x1fd7('0x42')]){_0x10ab1a[_0x1fd7('0x3f')]=_[_0x1fd7('0x43')](_0x10ab1a[_0x1fd7('0x3f')],{'$or':_[_0x1fd7('0x31')](_0x41fd23,function(_0xc524a6){if(_0xc524a6[_0x1fd7('0x34')]!==_0x1fd7('0x44')){var _0x1f11fc={};_0x1f11fc[_0xc524a6[_0x1fd7('0x2e')]]={'$like':'%'+_0x413a05[_0x1fd7('0x37')][_0x1fd7('0x42')]+'%'};return _0x1f11fc;}})});}_0x10ab1a=_['merge']({},_0x10ab1a,_0x413a05[_0x1fd7('0x45')]);var _0x13488f={'where':_0x10ab1a[_0x1fd7('0x3f')]};return db['ChatGroup'][_0x1fd7('0x25')](_0x13488f)['then'](function(_0xc393bb){_0x3fe097[_0x1fd7('0x25')]=_0xc393bb;if(_0x413a05['query'][_0x1fd7('0x46')]){_0x10ab1a[_0x1fd7('0x47')]=[{'all':!![]}];}return db[_0x1fd7('0x48')]['findAll'](_0x10ab1a);})[_0x1fd7('0x2b')](function(_0x4b762e){_0x3fe097[_0x1fd7('0x49')]=_0x4b762e;return _0x3fe097;})['then'](respondWithFilteredResult(_0x2c7d4b,_0x10ab1a))[_0x1fd7('0x4a')](handleError(_0x2c7d4b,null));};exports[_0x1fd7('0x4b')]=function(_0x4b765b,_0x504e10){var _0x1aedc6={'raw':!![],'where':{'id':_0x4b765b[_0x1fd7('0x4c')]['id']}},_0x20080b={};_0x20080b['model']=_[_0x1fd7('0x38')](db[_0x1fd7('0x48')]['rawAttributes']);_0x20080b[_0x1fd7('0x37')]=_['keys'](_0x4b765b[_0x1fd7('0x37')]);_0x20080b[_0x1fd7('0x40')]=_[_0x1fd7('0x39')](_0x20080b[_0x1fd7('0x36')],_0x20080b[_0x1fd7('0x37')]);_0x1aedc6['attributes']=_[_0x1fd7('0x39')](_0x20080b['model'],qs[_0x1fd7('0x3b')](_0x4b765b[_0x1fd7('0x37')][_0x1fd7('0x3b')]));_0x1aedc6[_0x1fd7('0x3a')]=_0x1aedc6[_0x1fd7('0x3a')][_0x1fd7('0x3c')]?_0x1aedc6[_0x1fd7('0x3a')]:_0x20080b[_0x1fd7('0x36')];if(_0x4b765b['query'][_0x1fd7('0x46')]){_0x1aedc6[_0x1fd7('0x47')]=[{'all':!![]}];}_0x1aedc6=_[_0x1fd7('0x43')]({},_0x1aedc6,_0x4b765b[_0x1fd7('0x45')]);return db[_0x1fd7('0x48')][_0x1fd7('0x4d')](_0x1aedc6)[_0x1fd7('0x2b')](handleEntityNotFound(_0x504e10,null))[_0x1fd7('0x2b')](respondWithResult(_0x504e10,null))['catch'](handleError(_0x504e10,null));};exports[_0x1fd7('0x4e')]=function(_0x45eaed,_0x30051e){return db['ChatGroup'][_0x1fd7('0x4e')](_0x45eaed[_0x1fd7('0x4f')],{})[_0x1fd7('0x2b')](respondWithResult(_0x30051e,0xc9))['catch'](handleError(_0x30051e,null));};exports[_0x1fd7('0x2a')]=function(_0x39f5ce,_0x5a9b61){if(_0x39f5ce['body']['id']){delete _0x39f5ce[_0x1fd7('0x4f')]['id'];}return db[_0x1fd7('0x48')]['find']({'where':{'id':_0x39f5ce['params']['id']}})['then'](handleEntityNotFound(_0x5a9b61,null))[_0x1fd7('0x2b')](saveUpdates(_0x39f5ce[_0x1fd7('0x4f')],null))[_0x1fd7('0x2b')](respondWithResult(_0x5a9b61,null))['catch'](handleError(_0x5a9b61,null));};exports[_0x1fd7('0x50')]=function(_0x1a7b8b,_0xcaea2d){return db[_0x1fd7('0x48')][_0x1fd7('0x4d')]({'where':{'id':_0x1a7b8b['params']['id']}})[_0x1fd7('0x2b')](handleEntityNotFound(_0xcaea2d,null))[_0x1fd7('0x2b')](removeEntity(_0xcaea2d,null))['catch'](handleError(_0xcaea2d,null));};exports[_0x1fd7('0x51')]=function(_0x2cee2c,_0x1e044b){return db['ChatGroup'][_0x1fd7('0x51')]()['then'](respondWithResult(_0x1e044b,null))[_0x1fd7('0x4a')](handleError(_0x1e044b,null));};exports[_0x1fd7('0x52')]=function(_0x402062,_0x4765ed,_0x3c624e){return db[_0x1fd7('0x53')][_0x1fd7('0x25')]({'where':{'ChatGroupId':_0x402062[_0x1fd7('0x4c')]['id'],'ToId':_0x402062[_0x1fd7('0x54')]['id'],'read':![]}})[_0x1fd7('0x2b')](function(_0x536665){return{'id':_[_0x1fd7('0x55')](_0x402062[_0x1fd7('0x4c')]['id']),'count':_0x536665};})[_0x1fd7('0x2b')](respondWithResult(_0x4765ed,null))[_0x1fd7('0x4a')](handleError(_0x4765ed,null));};exports['addMembers']=function(_0x53c749,_0x30a96b,_0xc6b3ac){return db[_0x1fd7('0x48')]['find']({'where':{'id':_0x53c749[_0x1fd7('0x4c')]['id']}})[_0x1fd7('0x2b')](handleEntityNotFound(_0x30a96b,null))[_0x1fd7('0x2b')](function(_0x23984e){if(_0x23984e){return _0x23984e[_0x1fd7('0x56')](_0x53c749[_0x1fd7('0x4f')][_0x1fd7('0x57')],_[_0x1fd7('0x58')](_0x53c749['body'],[_0x1fd7('0x57'),'id'])||{});}})['then'](respondWithResult(_0x30a96b,null))[_0x1fd7('0x4a')](handleError(_0x30a96b,null));};exports[_0x1fd7('0x59')]=function(_0x3d140b,_0x33f804,_0x3d65b8){var _0x215b22={};var _0x5ae1c7={};var _0x4ee69a;var _0x1001b8;return db['ChatGroup']['findOne']({'where':{'id':_0x3d140b[_0x1fd7('0x4c')]['id']}})[_0x1fd7('0x2b')](handleEntityNotFound(_0x33f804,null))[_0x1fd7('0x2b')](function(_0x7f1849){if(_0x7f1849){_0x4ee69a=_0x7f1849;_0x5ae1c7[_0x1fd7('0x36')]=_[_0x1fd7('0x38')](db['User'][_0x1fd7('0x32')]);_0x5ae1c7[_0x1fd7('0x37')]=_[_0x1fd7('0x38')](_0x3d140b[_0x1fd7('0x37')]);_0x5ae1c7[_0x1fd7('0x40')]=_[_0x1fd7('0x39')](_0x5ae1c7['model'],_0x5ae1c7['query']);_0x215b22['attributes']=_[_0x1fd7('0x39')](_0x5ae1c7[_0x1fd7('0x36')],qs[_0x1fd7('0x3b')](_0x3d140b[_0x1fd7('0x37')]['fields']));_0x215b22[_0x1fd7('0x3a')]=_0x215b22['attributes'][_0x1fd7('0x3c')]?_0x215b22[_0x1fd7('0x3a')]:_0x5ae1c7[_0x1fd7('0x36')];_0x215b22['order']=qs[_0x1fd7('0x3e')](_0x3d140b['query'][_0x1fd7('0x3e')]);_0x215b22['where']=qs[_0x1fd7('0x40')](_['pick'](_0x3d140b[_0x1fd7('0x37')],_0x5ae1c7[_0x1fd7('0x40')]));if(_0x3d140b[_0x1fd7('0x37')][_0x1fd7('0x42')]){_0x215b22[_0x1fd7('0x3f')]=_[_0x1fd7('0x43')](_0x215b22[_0x1fd7('0x3f')],{'$or':_[_0x1fd7('0x31')](_0x215b22[_0x1fd7('0x3a')],function(_0x5fb61f){var _0x1363ca={};_0x1363ca[_0x5fb61f]={'$like':'%'+_0x3d140b[_0x1fd7('0x37')]['filter']+'%'};return _0x1363ca;})});}_0x215b22=_['merge']({},_0x215b22,_0x3d140b['options']);return _0x4ee69a['getMembers'](_0x215b22);}})['then'](function(_0x13d30c){if(_0x13d30c){_0x1001b8=_0x13d30c[_0x1fd7('0x3c')];if(!_0x3d140b[_0x1fd7('0x37')]['hasOwnProperty']('nolimit')){_0x215b22[_0x1fd7('0x23')]=qs[_0x1fd7('0x23')](_0x3d140b['query']['limit']);_0x215b22[_0x1fd7('0x26')]=qs['offset'](_0x3d140b['query'][_0x1fd7('0x26')]);}return _0x4ee69a[_0x1fd7('0x59')](_0x215b22);}})[_0x1fd7('0x2b')](function(_0x3562b5){if(_0x3562b5){return _0x3562b5?{'count':_0x1001b8,'rows':_0x3562b5}:null;}})[_0x1fd7('0x2b')](respondWithResult(_0x33f804,null))[_0x1fd7('0x4a')](handleError(_0x33f804,null));};exports[_0x1fd7('0x5a')]=function(_0xc998c9,_0x9592bf,_0x582dc5){return db['ChatGroup'][_0x1fd7('0x4d')]({'where':{'id':_0xc998c9['params']['id']}})[_0x1fd7('0x2b')](handleEntityNotFound(_0x9592bf,null))[_0x1fd7('0x2b')](function(_0x1b078b){if(_0x1b078b){return _0x1b078b[_0x1fd7('0x5a')](_0xc998c9[_0x1fd7('0x37')][_0x1fd7('0x57')]);}})['then'](respondWithStatusCode(_0x9592bf,null))[_0x1fd7('0x4a')](handleError(_0x9592bf,null));};exports[_0x1fd7('0x5b')]=function(_0x170979,_0x88cf13,_0xa1b151){if(_0x170979[_0x1fd7('0x4f')]['id']){delete _0x170979[_0x1fd7('0x4f')]['id'];}return db[_0x1fd7('0x48')][_0x1fd7('0x4d')]({'where':{'id':_0x170979[_0x1fd7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x88cf13,null))['then'](function(_0x3de4d2){if(_0x3de4d2){_0x170979[_0x1fd7('0x4f')][_0x1fd7('0x5c')]=_0x3de4d2['id'];return db[_0x1fd7('0x53')]['create'](_0x170979[_0x1fd7('0x4f')]);}})[_0x1fd7('0x2b')](respondWithResult(_0x88cf13,null))['catch'](handleError(_0x88cf13,null));};exports[_0x1fd7('0x5d')]=function(_0x3976fc,_0x2d9c92,_0xd22941){var _0x355018={};var _0x5d2260={};var _0x35b9a6;var _0x12e64f;return db[_0x1fd7('0x48')]['findOne']({'where':{'id':_0x3976fc[_0x1fd7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2d9c92,null))[_0x1fd7('0x2b')](function(_0x1afe02){if(_0x1afe02){_0x35b9a6=_0x1afe02;_0x5d2260['model']=_[_0x1fd7('0x38')](db[_0x1fd7('0x53')]['rawAttributes']);_0x5d2260[_0x1fd7('0x37')]=_[_0x1fd7('0x38')](_0x3976fc['query']);_0x5d2260[_0x1fd7('0x40')]=_[_0x1fd7('0x39')](_0x5d2260[_0x1fd7('0x36')],_0x5d2260[_0x1fd7('0x37')]);_0x355018[_0x1fd7('0x3a')]=_[_0x1fd7('0x39')](_0x5d2260[_0x1fd7('0x36')],qs[_0x1fd7('0x3b')](_0x3976fc[_0x1fd7('0x37')]['fields']));_0x355018[_0x1fd7('0x3a')]=_0x355018[_0x1fd7('0x3a')]['length']?_0x355018['attributes']:_0x5d2260[_0x1fd7('0x36')];_0x355018[_0x1fd7('0x5e')]=qs[_0x1fd7('0x3e')](_0x3976fc[_0x1fd7('0x37')]['sort']);_0x355018[_0x1fd7('0x3f')]=qs[_0x1fd7('0x40')](_[_0x1fd7('0x41')](_0x3976fc[_0x1fd7('0x37')],_0x5d2260[_0x1fd7('0x40')]));if(_0x3976fc[_0x1fd7('0x37')][_0x1fd7('0x42')]){_0x355018[_0x1fd7('0x3f')]=_['merge'](_0x355018['where'],{'$or':_[_0x1fd7('0x31')](_0x355018[_0x1fd7('0x3a')],function(_0x4e4d25){var _0x51c352={};_0x51c352[_0x4e4d25]={'$like':'%'+_0x3976fc[_0x1fd7('0x37')]['filter']+'%'};return _0x51c352;})});}if(_0x3976fc[_0x1fd7('0x37')][_0x1fd7('0x5f')]){var _0x146356=_0x3976fc[_0x1fd7('0x37')][_0x1fd7('0x5f')][_0x1fd7('0x60')](',');var _0x473bbe={};_0x473bbe[_0x146356[0x0]]={'$gte':moment(_0x146356[0x1])['format'](_0x1fd7('0x61'))};_0x355018[_0x1fd7('0x3f')]=_['merge'](_0x355018[_0x1fd7('0x3f')],_0x473bbe);}_0x355018=_[_0x1fd7('0x43')]({},_0x355018,_0x3976fc[_0x1fd7('0x45')]);return _0x35b9a6[_0x1fd7('0x5d')](_0x355018);}})['then'](function(_0x141036){if(_0x141036){_0x12e64f=_0x141036['length'];if(!_0x3976fc['query']['hasOwnProperty']('nolimit')){_0x355018[_0x1fd7('0x23')]=qs[_0x1fd7('0x23')](_0x3976fc[_0x1fd7('0x37')]['limit']);_0x355018['offset']=qs['offset'](_0x3976fc[_0x1fd7('0x37')]['offset']);}return _0x35b9a6[_0x1fd7('0x5d')](_0x355018);}})[_0x1fd7('0x2b')](function(_0xc55020){if(_0xc55020){return _0xc55020?{'count':_0x12e64f,'rows':_0xc55020}:null;}})[_0x1fd7('0x2b')](respondWithResult(_0x2d9c92,null))[_0x1fd7('0x4a')](handleError(_0x2d9c92,null));};
\ No newline at end of file
+var _0xb1fa=['status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','fieldName','type','model','map','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','ChatGroup','includeAll','include','findAll','rows','catch','keys','rawAttributes','find','create','body','destroy','params','describe','getUnread','ChatInternalMessage','user','addMembers','ids','findOne','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','$gte','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','sendStatus'];(function(_0x4323d4,_0x42b60e){var _0xbff5e6=function(_0xdefe85){while(--_0xdefe85){_0x4323d4['push'](_0x4323d4['shift']());}};_0xbff5e6(++_0x42b60e);}(_0xb1fa,0x9c));var _0xab1f=function(_0x4d0c54,_0x3fdbee){_0x4d0c54=_0x4d0c54-0x0;var _0x5b834f=_0xb1fa[_0x4d0c54];return _0x5b834f;};'use strict';var emlformat=require(_0xab1f('0x0'));var rimraf=require(_0xab1f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xab1f('0x2'));var rp=require(_0xab1f('0x3'));var moment=require(_0xab1f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xab1f('0x5'));var util=require(_0xab1f('0x6'));var path=require(_0xab1f('0x7'));var sox=require(_0xab1f('0x8'));var csv=require(_0xab1f('0x9'));var ejs=require(_0xab1f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab1f('0xb'));var squel=require(_0xab1f('0xc'));var crypto=require(_0xab1f('0xd'));var jsforce=require(_0xab1f('0xe'));var deskjs=require(_0xab1f('0xf'));var toCsv=require(_0xab1f('0x9'));var querystring=require(_0xab1f('0x10'));var Papa=require(_0xab1f('0x11'));var Redis=require('ioredis');var authService=require(_0xab1f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xab1f('0x13'));var hardwareService=require(_0xab1f('0x14'));var logger=require(_0xab1f('0x15'))(_0xab1f('0x16'));var utils=require(_0xab1f('0x17'));var config=require(_0xab1f('0x18'));var licenseUtil=require(_0xab1f('0x19'));var db=require(_0xab1f('0x1a'))['db'];config[_0xab1f('0x1b')]=_[_0xab1f('0x1c')](config[_0xab1f('0x1b')],{'host':_0xab1f('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xab1f('0x1e'))['register'](socket);function respondWithStatusCode(_0x5c17d6,_0x32667f){_0x32667f=_0x32667f||0xcc;return function(_0x72c258){if(_0x72c258){return _0x5c17d6[_0xab1f('0x1f')](_0x32667f);}return _0x5c17d6[_0xab1f('0x20')](_0x32667f)[_0xab1f('0x21')]();};}function respondWithResult(_0x1308d6,_0x1d268d){_0x1d268d=_0x1d268d||0xc8;return function(_0x4e940e){if(_0x4e940e){return _0x1308d6[_0xab1f('0x20')](_0x1d268d)['json'](_0x4e940e);}};}function respondWithFilteredResult(_0x4d8979,_0x5d56a1){return function(_0x36cd7b){if(_0x36cd7b){var _0x5462e2=typeof _0x5d56a1[_0xab1f('0x22')]===_0xab1f('0x23')&&typeof _0x5d56a1['limit']===_0xab1f('0x23');var _0x45c081=_0x36cd7b[_0xab1f('0x24')];var _0x52b883=_0x5462e2?0x0:_0x5d56a1['offset'];var _0x2e3d06=_0x5462e2?_0x36cd7b[_0xab1f('0x24')]:_0x5d56a1[_0xab1f('0x22')]+_0x5d56a1[_0xab1f('0x25')];var _0x27d176;if(_0x2e3d06>=_0x45c081){_0x2e3d06=_0x45c081;_0x27d176=0xc8;}else{_0x27d176=0xce;}_0x4d8979[_0xab1f('0x20')](_0x27d176);return _0x4d8979[_0xab1f('0x26')](_0xab1f('0x27'),_0x52b883+'-'+_0x2e3d06+'/'+_0x45c081)['json'](_0x36cd7b);}return null;};}function patchUpdates(_0x310a0d){return function(_0x4e7388){try{jsonpatch[_0xab1f('0x28')](_0x4e7388,_0x310a0d,!![]);}catch(_0x3b67c9){return BPromise[_0xab1f('0x29')](_0x3b67c9);}return _0x4e7388[_0xab1f('0x2a')]();};}function saveUpdates(_0x523d15,_0x53ae7f){return function(_0x5d0239){if(_0x5d0239){return _0x5d0239[_0xab1f('0x2b')](_0x523d15)['then'](function(_0x3c826f){return _0x3c826f;});}return null;};}function removeEntity(_0x532031,_0x3ab185){return function(_0x5dad0c){if(_0x5dad0c){return _0x5dad0c['destroy']()[_0xab1f('0x2c')](function(){_0x532031[_0xab1f('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d6bc3,_0x3e4827){return function(_0x4cb0ce){if(!_0x4cb0ce){_0x2d6bc3[_0xab1f('0x1f')](0x194);}return _0x4cb0ce;};}function handleError(_0x5388ae,_0x28aea8){_0x28aea8=_0x28aea8||0x1f4;return function(_0x1fb567){logger[_0xab1f('0x2d')](_0x1fb567[_0xab1f('0x2e')]);if(_0x1fb567[_0xab1f('0x2f')]){delete _0x1fb567[_0xab1f('0x2f')];}_0x5388ae[_0xab1f('0x20')](_0x28aea8)['send'](_0x1fb567);};}exports['index']=function(_0x3caf95,_0xd739f4){var _0x599542={},_0x2605a3={},_0x4636d7={'count':0x0,'rows':[]};var _0xcd9d90=_['map'](db['ChatGroup']['rawAttributes'],function(_0x42e5db){return{'name':_0x42e5db[_0xab1f('0x30')],'type':_0x42e5db[_0xab1f('0x31')]['key']};});_0x2605a3[_0xab1f('0x32')]=_[_0xab1f('0x33')](_0xcd9d90,_0xab1f('0x2f'));_0x2605a3['query']=_['keys'](_0x3caf95['query']);_0x2605a3[_0xab1f('0x34')]=_[_0xab1f('0x35')](_0x2605a3[_0xab1f('0x32')],_0x2605a3['query']);_0x599542[_0xab1f('0x36')]=_['intersection'](_0x2605a3[_0xab1f('0x32')],qs[_0xab1f('0x37')](_0x3caf95[_0xab1f('0x38')][_0xab1f('0x37')]));_0x599542[_0xab1f('0x36')]=_0x599542['attributes'][_0xab1f('0x39')]?_0x599542[_0xab1f('0x36')]:_0x2605a3[_0xab1f('0x32')];if(!_0x3caf95[_0xab1f('0x38')][_0xab1f('0x3a')](_0xab1f('0x3b'))){_0x599542[_0xab1f('0x25')]=qs[_0xab1f('0x25')](_0x3caf95[_0xab1f('0x38')][_0xab1f('0x25')]);_0x599542[_0xab1f('0x22')]=qs['offset'](_0x3caf95[_0xab1f('0x38')][_0xab1f('0x22')]);}_0x599542[_0xab1f('0x3c')]=qs[_0xab1f('0x3d')](_0x3caf95[_0xab1f('0x38')][_0xab1f('0x3d')]);_0x599542['where']=qs['filters'](_[_0xab1f('0x3e')](_0x3caf95[_0xab1f('0x38')],_0x2605a3['filters']),_0xcd9d90);if(_0x3caf95[_0xab1f('0x38')][_0xab1f('0x3f')]){_0x599542[_0xab1f('0x40')]=_['merge'](_0x599542[_0xab1f('0x40')],{'$or':_[_0xab1f('0x33')](_0xcd9d90,function(_0x3d36c5){if(_0x3d36c5[_0xab1f('0x31')]!==_0xab1f('0x41')){var _0x13df76={};_0x13df76[_0x3d36c5['name']]={'$like':'%'+_0x3caf95['query'][_0xab1f('0x3f')]+'%'};return _0x13df76;}})});}_0x599542=_[_0xab1f('0x42')]({},_0x599542,_0x3caf95[_0xab1f('0x43')]);var _0x45667f={'where':_0x599542[_0xab1f('0x40')]};return db[_0xab1f('0x44')][_0xab1f('0x24')](_0x45667f)[_0xab1f('0x2c')](function(_0x5c1079){_0x4636d7[_0xab1f('0x24')]=_0x5c1079;if(_0x3caf95['query'][_0xab1f('0x45')]){_0x599542[_0xab1f('0x46')]=[{'all':!![]}];}return db['ChatGroup'][_0xab1f('0x47')](_0x599542);})['then'](function(_0x4e87f2){_0x4636d7[_0xab1f('0x48')]=_0x4e87f2;return _0x4636d7;})[_0xab1f('0x2c')](respondWithFilteredResult(_0xd739f4,_0x599542))[_0xab1f('0x49')](handleError(_0xd739f4,null));};exports['show']=function(_0x225fe0,_0xbf012){var _0x59146d={'raw':!![],'where':{'id':_0x225fe0['params']['id']}},_0x370239={};_0x370239[_0xab1f('0x32')]=_[_0xab1f('0x4a')](db[_0xab1f('0x44')][_0xab1f('0x4b')]);_0x370239[_0xab1f('0x38')]=_[_0xab1f('0x4a')](_0x225fe0[_0xab1f('0x38')]);_0x370239[_0xab1f('0x34')]=_['intersection'](_0x370239[_0xab1f('0x32')],_0x370239[_0xab1f('0x38')]);_0x59146d['attributes']=_[_0xab1f('0x35')](_0x370239['model'],qs[_0xab1f('0x37')](_0x225fe0[_0xab1f('0x38')]['fields']));_0x59146d[_0xab1f('0x36')]=_0x59146d[_0xab1f('0x36')][_0xab1f('0x39')]?_0x59146d[_0xab1f('0x36')]:_0x370239[_0xab1f('0x32')];if(_0x225fe0[_0xab1f('0x38')][_0xab1f('0x45')]){_0x59146d[_0xab1f('0x46')]=[{'all':!![]}];}_0x59146d=_[_0xab1f('0x42')]({},_0x59146d,_0x225fe0[_0xab1f('0x43')]);return db[_0xab1f('0x44')][_0xab1f('0x4c')](_0x59146d)[_0xab1f('0x2c')](handleEntityNotFound(_0xbf012,null))['then'](respondWithResult(_0xbf012,null))[_0xab1f('0x49')](handleError(_0xbf012,null));};exports[_0xab1f('0x4d')]=function(_0x331c67,_0x52195c){return db[_0xab1f('0x44')]['create'](_0x331c67['body'],{})[_0xab1f('0x2c')](respondWithResult(_0x52195c,0xc9))[_0xab1f('0x49')](handleError(_0x52195c,null));};exports[_0xab1f('0x2b')]=function(_0x19f27f,_0x1d6adf){if(_0x19f27f[_0xab1f('0x4e')]['id']){delete _0x19f27f[_0xab1f('0x4e')]['id'];}return db[_0xab1f('0x44')][_0xab1f('0x4c')]({'where':{'id':_0x19f27f['params']['id']}})[_0xab1f('0x2c')](handleEntityNotFound(_0x1d6adf,null))[_0xab1f('0x2c')](saveUpdates(_0x19f27f[_0xab1f('0x4e')],null))[_0xab1f('0x2c')](respondWithResult(_0x1d6adf,null))['catch'](handleError(_0x1d6adf,null));};exports[_0xab1f('0x4f')]=function(_0x594428,_0x55a748){return db[_0xab1f('0x44')][_0xab1f('0x4c')]({'where':{'id':_0x594428[_0xab1f('0x50')]['id']}})[_0xab1f('0x2c')](handleEntityNotFound(_0x55a748,null))[_0xab1f('0x2c')](removeEntity(_0x55a748,null))[_0xab1f('0x49')](handleError(_0x55a748,null));};exports['describe']=function(_0x4de6b2,_0x368cd9){return db[_0xab1f('0x44')][_0xab1f('0x51')]()[_0xab1f('0x2c')](respondWithResult(_0x368cd9,null))[_0xab1f('0x49')](handleError(_0x368cd9,null));};exports[_0xab1f('0x52')]=function(_0x5d8fea,_0x4711c3,_0x17ef9a){return db[_0xab1f('0x53')][_0xab1f('0x24')]({'where':{'ChatGroupId':_0x5d8fea[_0xab1f('0x50')]['id'],'ToId':_0x5d8fea[_0xab1f('0x54')]['id'],'read':![]}})[_0xab1f('0x2c')](function(_0xc63b8e){return{'id':_['toInteger'](_0x5d8fea[_0xab1f('0x50')]['id']),'count':_0xc63b8e};})[_0xab1f('0x2c')](respondWithResult(_0x4711c3,null))['catch'](handleError(_0x4711c3,null));};exports[_0xab1f('0x55')]=function(_0x4656b5,_0x308eb5,_0x10780e){return db[_0xab1f('0x44')][_0xab1f('0x4c')]({'where':{'id':_0x4656b5[_0xab1f('0x50')]['id']}})[_0xab1f('0x2c')](handleEntityNotFound(_0x308eb5,null))[_0xab1f('0x2c')](function(_0x212ca4){if(_0x212ca4){return _0x212ca4[_0xab1f('0x55')](_0x4656b5['body'][_0xab1f('0x56')],_['omit'](_0x4656b5[_0xab1f('0x4e')],[_0xab1f('0x56'),'id'])||{});}})['then'](respondWithResult(_0x308eb5,null))[_0xab1f('0x49')](handleError(_0x308eb5,null));};exports['getMembers']=function(_0x442aa8,_0x5f9aaf,_0x3b2e59){var _0x38bb6e={};var _0x3f9b00={};var _0x3669da;var _0x44b91d;return db['ChatGroup'][_0xab1f('0x57')]({'where':{'id':_0x442aa8[_0xab1f('0x50')]['id']}})[_0xab1f('0x2c')](handleEntityNotFound(_0x5f9aaf,null))[_0xab1f('0x2c')](function(_0x177cd2){if(_0x177cd2){_0x3669da=_0x177cd2;_0x3f9b00[_0xab1f('0x32')]=_['keys'](db['User'][_0xab1f('0x4b')]);_0x3f9b00[_0xab1f('0x38')]=_['keys'](_0x442aa8[_0xab1f('0x38')]);_0x3f9b00[_0xab1f('0x34')]=_[_0xab1f('0x35')](_0x3f9b00[_0xab1f('0x32')],_0x3f9b00[_0xab1f('0x38')]);_0x38bb6e['attributes']=_['intersection'](_0x3f9b00[_0xab1f('0x32')],qs[_0xab1f('0x37')](_0x442aa8[_0xab1f('0x38')]['fields']));_0x38bb6e[_0xab1f('0x36')]=_0x38bb6e['attributes'][_0xab1f('0x39')]?_0x38bb6e[_0xab1f('0x36')]:_0x3f9b00[_0xab1f('0x32')];_0x38bb6e[_0xab1f('0x3c')]=qs[_0xab1f('0x3d')](_0x442aa8[_0xab1f('0x38')][_0xab1f('0x3d')]);_0x38bb6e[_0xab1f('0x40')]=qs[_0xab1f('0x34')](_[_0xab1f('0x3e')](_0x442aa8[_0xab1f('0x38')],_0x3f9b00[_0xab1f('0x34')]));if(_0x442aa8[_0xab1f('0x38')]['filter']){_0x38bb6e[_0xab1f('0x40')]=_['merge'](_0x38bb6e[_0xab1f('0x40')],{'$or':_[_0xab1f('0x33')](_0x38bb6e[_0xab1f('0x36')],function(_0x421035){var _0x2d1757={};_0x2d1757[_0x421035]={'$like':'%'+_0x442aa8[_0xab1f('0x38')][_0xab1f('0x3f')]+'%'};return _0x2d1757;})});}_0x38bb6e=_[_0xab1f('0x42')]({},_0x38bb6e,_0x442aa8['options']);return _0x3669da[_0xab1f('0x58')](_0x38bb6e);}})['then'](function(_0x58fe57){if(_0x58fe57){_0x44b91d=_0x58fe57[_0xab1f('0x39')];if(!_0x442aa8[_0xab1f('0x38')][_0xab1f('0x3a')](_0xab1f('0x3b'))){_0x38bb6e[_0xab1f('0x25')]=qs[_0xab1f('0x25')](_0x442aa8[_0xab1f('0x38')][_0xab1f('0x25')]);_0x38bb6e[_0xab1f('0x22')]=qs[_0xab1f('0x22')](_0x442aa8[_0xab1f('0x38')][_0xab1f('0x22')]);}return _0x3669da[_0xab1f('0x58')](_0x38bb6e);}})[_0xab1f('0x2c')](function(_0x92551e){if(_0x92551e){return _0x92551e?{'count':_0x44b91d,'rows':_0x92551e}:null;}})[_0xab1f('0x2c')](respondWithResult(_0x5f9aaf,null))[_0xab1f('0x49')](handleError(_0x5f9aaf,null));};exports[_0xab1f('0x59')]=function(_0x33cbeb,_0x1202b5,_0x22cf12){return db[_0xab1f('0x44')]['find']({'where':{'id':_0x33cbeb['params']['id']}})[_0xab1f('0x2c')](handleEntityNotFound(_0x1202b5,null))[_0xab1f('0x2c')](function(_0x29b247){if(_0x29b247){return _0x29b247[_0xab1f('0x59')](_0x33cbeb[_0xab1f('0x38')][_0xab1f('0x56')]);}})[_0xab1f('0x2c')](respondWithStatusCode(_0x1202b5,null))[_0xab1f('0x49')](handleError(_0x1202b5,null));};exports[_0xab1f('0x5a')]=function(_0x557e15,_0xf76938,_0xc27e25){if(_0x557e15[_0xab1f('0x4e')]['id']){delete _0x557e15[_0xab1f('0x4e')]['id'];}return db[_0xab1f('0x44')][_0xab1f('0x4c')]({'where':{'id':_0x557e15['params']['id']}})[_0xab1f('0x2c')](handleEntityNotFound(_0xf76938,null))[_0xab1f('0x2c')](function(_0x53ba74){if(_0x53ba74){_0x557e15[_0xab1f('0x4e')][_0xab1f('0x5b')]=_0x53ba74['id'];return db['ChatInternalMessage'][_0xab1f('0x4d')](_0x557e15[_0xab1f('0x4e')]);}})['then'](respondWithResult(_0xf76938,null))[_0xab1f('0x49')](handleError(_0xf76938,null));};exports[_0xab1f('0x5c')]=function(_0x40aec3,_0x56f346,_0x1ba6c4){var _0xd07fcd={};var _0x344420={};var _0x5be7ea;var _0x343ef8;return db[_0xab1f('0x44')]['findOne']({'where':{'id':_0x40aec3[_0xab1f('0x50')]['id']}})[_0xab1f('0x2c')](handleEntityNotFound(_0x56f346,null))[_0xab1f('0x2c')](function(_0x4dfa9e){if(_0x4dfa9e){_0x5be7ea=_0x4dfa9e;_0x344420[_0xab1f('0x32')]=_[_0xab1f('0x4a')](db[_0xab1f('0x53')]['rawAttributes']);_0x344420[_0xab1f('0x38')]=_['keys'](_0x40aec3[_0xab1f('0x38')]);_0x344420[_0xab1f('0x34')]=_[_0xab1f('0x35')](_0x344420['model'],_0x344420['query']);_0xd07fcd[_0xab1f('0x36')]=_[_0xab1f('0x35')](_0x344420[_0xab1f('0x32')],qs[_0xab1f('0x37')](_0x40aec3[_0xab1f('0x38')][_0xab1f('0x37')]));_0xd07fcd['attributes']=_0xd07fcd[_0xab1f('0x36')][_0xab1f('0x39')]?_0xd07fcd[_0xab1f('0x36')]:_0x344420[_0xab1f('0x32')];_0xd07fcd[_0xab1f('0x3c')]=qs[_0xab1f('0x3d')](_0x40aec3[_0xab1f('0x38')]['sort']);_0xd07fcd[_0xab1f('0x40')]=qs[_0xab1f('0x34')](_[_0xab1f('0x3e')](_0x40aec3['query'],_0x344420[_0xab1f('0x34')]));if(_0x40aec3['query'][_0xab1f('0x3f')]){_0xd07fcd[_0xab1f('0x40')]=_['merge'](_0xd07fcd[_0xab1f('0x40')],{'$or':_[_0xab1f('0x33')](_0xd07fcd['attributes'],function(_0x436ab8){var _0x1203f5={};_0x1203f5[_0x436ab8]={'$like':'%'+_0x40aec3[_0xab1f('0x38')][_0xab1f('0x3f')]+'%'};return _0x1203f5;})});}if(_0x40aec3[_0xab1f('0x38')][_0xab1f('0x5d')]){var _0x27735b=_0x40aec3[_0xab1f('0x38')]['$gte']['split'](',');var _0x24de27={};_0x24de27[_0x27735b[0x0]]={'$gte':moment(_0x27735b[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0xd07fcd[_0xab1f('0x40')]=_['merge'](_0xd07fcd[_0xab1f('0x40')],_0x24de27);}_0xd07fcd=_['merge']({},_0xd07fcd,_0x40aec3[_0xab1f('0x43')]);return _0x5be7ea[_0xab1f('0x5c')](_0xd07fcd);}})[_0xab1f('0x2c')](function(_0x12f46f){if(_0x12f46f){_0x343ef8=_0x12f46f[_0xab1f('0x39')];if(!_0x40aec3[_0xab1f('0x38')]['hasOwnProperty'](_0xab1f('0x3b'))){_0xd07fcd[_0xab1f('0x25')]=qs[_0xab1f('0x25')](_0x40aec3[_0xab1f('0x38')][_0xab1f('0x25')]);_0xd07fcd[_0xab1f('0x22')]=qs[_0xab1f('0x22')](_0x40aec3[_0xab1f('0x38')][_0xab1f('0x22')]);}return _0x5be7ea['getMessages'](_0xd07fcd);}})['then'](function(_0x329dca){if(_0x329dca){return _0x329dca?{'count':_0x343ef8,'rows':_0x329dca}:null;}})[_0xab1f('0x2c')](respondWithResult(_0x56f346,null))[_0xab1f('0x49')](handleError(_0x56f346,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 0375cb1..46e9738 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 _0xcad5=['remove','emit','hook','exports','events','../../mysqldb','ChatGroup','save','update'];(function(_0x391a87,_0x49d004){var _0x5726d6=function(_0x5be824){while(--_0x5be824){_0x391a87['push'](_0x391a87['shift']());}};_0x5726d6(++_0x49d004);}(_0xcad5,0x1cf));var _0x5cad=function(_0x1fc88e,_0x10d4fb){_0x1fc88e=_0x1fc88e-0x0;var _0x2bb70d=_0xcad5[_0x1fc88e];return _0x2bb70d;};'use strict';var EventEmitter=require(_0x5cad('0x0'));var ChatGroup=require(_0x5cad('0x1'))['db'][_0x5cad('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5cad('0x3'),'afterUpdate':_0x5cad('0x4'),'afterDestroy':_0x5cad('0x5')};function emitEvent(_0xd249e3){return function(_0x56a163,_0x4dba52,_0x53fab7){ChatGroupEvents['emit'](_0xd249e3+':'+_0x56a163['id'],_0x56a163);ChatGroupEvents[_0x5cad('0x6')](_0xd249e3,_0x56a163);_0x53fab7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x5cad('0x7')](e,emitEvent(event));}}module[_0x5cad('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0x2ace=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatGroup','setMaxListeners','update','remove'];(function(_0x393caf,_0x234484){var _0x3ad823=function(_0x1585b7){while(--_0x1585b7){_0x393caf['push'](_0x393caf['shift']());}};_0x3ad823(++_0x234484);}(_0x2ace,0x17e));var _0xe2ac=function(_0x86337d,_0x2b57c3){_0x86337d=_0x86337d-0x0;var _0x22b2c6=_0x2ace[_0x86337d];return _0x22b2c6;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xe2ac('0x0'))['db'][_0xe2ac('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xe2ac('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe2ac('0x3'),'afterDestroy':_0xe2ac('0x4')};function emitEvent(_0x47c3a2){return function(_0x171092,_0x464ec4,_0x240663){ChatGroupEvents[_0xe2ac('0x5')](_0x47c3a2+':'+_0x171092['id'],_0x171092);ChatGroupEvents[_0xe2ac('0x5')](_0x47c3a2,_0x171092);_0x240663(null);};}for(var e in events){if(events[_0xe2ac('0x6')](e)){var event=events[e];ChatGroup[_0xe2ac('0x7')](e,emitEvent(event));}}module[_0xe2ac('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 515afa9..6e1cbe0 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 _0xf36a=['define','ChatGroup','chat_groups','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports'];(function(_0x547510,_0x30e1c5){var _0x273c31=function(_0x51caf5){while(--_0x51caf5){_0x547510['push'](_0x547510['shift']());}};_0x273c31(++_0x30e1c5);}(_0xf36a,0x12e));var _0xaf36=function(_0x51b2bc,_0x225bc4){_0x51b2bc=_0x51b2bc-0x0;var _0x4413a7=_0xf36a[_0x51b2bc];return _0x4413a7;};'use strict';var _=require('lodash');var util=require(_0xaf36('0x0'));var logger=require(_0xaf36('0x1'))(_0xaf36('0x2'));var moment=require(_0xaf36('0x3'));var BPromise=require(_0xaf36('0x4'));var rp=require(_0xaf36('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf36('0x6'));var config=require(_0xaf36('0x7'));var attributes=require(_0xaf36('0x8'));module[_0xaf36('0x9')]=function(_0x3e1e8,_0x42cf7d){return _0x3e1e8[_0xaf36('0xa')](_0xaf36('0xb'),attributes,{'tableName':_0xaf36('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbd78=['../../config/environment','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x3bde7b,_0x5c98d0){var _0x30df0f=function(_0x11389b){while(--_0x11389b){_0x3bde7b['push'](_0x3bde7b['shift']());}};_0x30df0f(++_0x5c98d0);}(_0xbd78,0xfc));var _0x8bd7=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xbd78[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x8bd7('0x0'));var util=require(_0x8bd7('0x1'));var logger=require(_0x8bd7('0x2'))(_0x8bd7('0x3'));var moment=require('moment');var BPromise=require(_0x8bd7('0x4'));var rp=require(_0x8bd7('0x5'));var fs=require('fs');var path=require(_0x8bd7('0x6'));var rimraf=require(_0x8bd7('0x7'));var config=require(_0x8bd7('0x8'));var attributes=require(_0x8bd7('0x9'));module['exports']=function(_0x16c76d,_0x351123){return _0x16c76d[_0x8bd7('0xa')](_0x8bd7('0xb'),attributes,{'tableName':_0x8bd7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 0cb1ca8..5b4c559 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 _0x2cd0=['socket.io-emitter','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x3c9e05,_0x2871fd){var _0x5cefa0=function(_0x4c71f7){while(--_0x4c71f7){_0x3c9e05['push'](_0x3c9e05['shift']());}};_0x5cefa0(++_0x2871fd);}(_0x2cd0,0x8a));var _0x02cd=function(_0x1bcac2,_0x2f2084){_0x1bcac2=_0x1bcac2-0x0;var _0x3f813a=_0x2cd0[_0x1bcac2];return _0x3f813a;};'use strict';var _=require(_0x02cd('0x0'));var util=require(_0x02cd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x02cd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x02cd('0x3'));var logger=require(_0x02cd('0x4'))(_0x02cd('0x5'));var config=require(_0x02cd('0x6'));var jayson=require(_0x02cd('0x7'));var client=jayson[_0x02cd('0x8')][_0x02cd('0x9')]({'port':0x232a});config[_0x02cd('0xa')]=_[_0x02cd('0xb')](config[_0x02cd('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x02cd('0xc'))(new Redis(config[_0x02cd('0xa')]));require(_0x02cd('0xd'))[_0x02cd('0xe')](socket);function respondWithRpcPromise(_0x45cc20,_0xd0cc56,_0x18dfe0){return new BPromise(function(_0x2364c3,_0x15a488){return client[_0x02cd('0xf')](_0x45cc20,_0x18dfe0)['then'](function(_0x59f017){logger[_0x02cd('0x10')](_0x02cd('0x11'),_0xd0cc56,'request\x20sent');logger['debug'](_0x02cd('0x12'),_0xd0cc56,'request\x20sent',JSON[_0x02cd('0x13')](_0x59f017));if(_0x59f017[_0x02cd('0x14')]){if(_0x59f017[_0x02cd('0x14')][_0x02cd('0x15')]===0x1f4){logger[_0x02cd('0x14')](_0x02cd('0x11'),_0xd0cc56,_0x59f017['error']['message']);return _0x15a488(_0x59f017[_0x02cd('0x14')][_0x02cd('0x16')]);}logger[_0x02cd('0x14')](_0x02cd('0x11'),_0xd0cc56,_0x59f017[_0x02cd('0x14')]['message']);return _0x2364c3(_0x59f017[_0x02cd('0x14')]['message']);}else{logger['info'](_0x02cd('0x11'),_0xd0cc56,_0x02cd('0x17'));_0x2364c3(_0x59f017[_0x02cd('0x18')][_0x02cd('0x16')]);}})['catch'](function(_0x341ace){logger['error'](_0x02cd('0x11'),_0xd0cc56,_0x341ace);_0x15a488(_0x341ace);});});}
\ No newline at end of file
+var _0xe799=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2111bc,_0x2d65d5){var _0x1ff93b=function(_0x2cfb28){while(--_0x2cfb28){_0x2111bc['push'](_0x2111bc['shift']());}};_0x1ff93b(++_0x2d65d5);}(_0xe799,0x170));var _0x9e79=function(_0x4532c0,_0x18bf16){_0x4532c0=_0x4532c0-0x0;var _0x598927=_0xe799[_0x4532c0];return _0x598927;};'use strict';var _=require(_0x9e79('0x0'));var util=require('util');var moment=require(_0x9e79('0x1'));var BPromise=require('bluebird');var rs=require(_0x9e79('0x2'));var fs=require('fs');var Redis=require(_0x9e79('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e79('0x4'));var logger=require(_0x9e79('0x5'))(_0x9e79('0x6'));var config=require('../../config/environment');var jayson=require(_0x9e79('0x7'));var client=jayson['client'][_0x9e79('0x8')]({'port':0x232a});config[_0x9e79('0x9')]=_[_0x9e79('0xa')](config['redis'],{'host':_0x9e79('0xb'),'port':0x18eb});var socket=require(_0x9e79('0xc'))(new Redis(config['redis']));require(_0x9e79('0xd'))[_0x9e79('0xe')](socket);function respondWithRpcPromise(_0xc46eed,_0x6464d6,_0x502f36){return new BPromise(function(_0x43bd7a,_0x15efc4){return client['request'](_0xc46eed,_0x502f36)[_0x9e79('0xf')](function(_0x127c92){logger[_0x9e79('0x10')](_0x9e79('0x11'),_0x6464d6,_0x9e79('0x12'));logger['debug'](_0x9e79('0x13'),_0x6464d6,_0x9e79('0x12'),JSON[_0x9e79('0x14')](_0x127c92));if(_0x127c92[_0x9e79('0x15')]){if(_0x127c92[_0x9e79('0x15')][_0x9e79('0x16')]===0x1f4){logger[_0x9e79('0x15')](_0x9e79('0x11'),_0x6464d6,_0x127c92[_0x9e79('0x15')][_0x9e79('0x17')]);return _0x15efc4(_0x127c92[_0x9e79('0x15')][_0x9e79('0x17')]);}logger['error'](_0x9e79('0x11'),_0x6464d6,_0x127c92['error'][_0x9e79('0x17')]);return _0x43bd7a(_0x127c92[_0x9e79('0x15')]['message']);}else{logger[_0x9e79('0x10')](_0x9e79('0x11'),_0x6464d6,'request\x20sent');_0x43bd7a(_0x127c92['result'][_0x9e79('0x17')]);}})[_0x9e79('0x18')](function(_0x33e7a2){logger[_0x9e79('0x15')](_0x9e79('0x11'),_0x6464d6,_0x33e7a2);_0x15efc4(_0x33e7a2);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index bec33ab..273aab6 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 _0x8c3d=['./chatGroup.events','save','remove','emit','removeListener','register','length','chatGroup:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c3d,0xe8));var _0xd8c3=function(_0x57d4c4,_0x1eb1c7){_0x57d4c4=_0x57d4c4-0x0;var _0x551561=_0x8c3d[_0x57d4c4];return _0x551561;};'use strict';var ChatGroupEvents=require(_0xd8c3('0x0'));var events=[_0xd8c3('0x1'),_0xd8c3('0x2'),'update'];function createListener(_0x2a6adc,_0x394bc2){return function(_0x169763){_0x394bc2[_0xd8c3('0x3')](_0x2a6adc,_0x169763);};}function removeListener(_0x46a95e,_0x2a5af8){return function(){ChatGroupEvents[_0xd8c3('0x4')](_0x46a95e,_0x2a5af8);};}exports[_0xd8c3('0x5')]=function(_0x528b48){for(var _0x34b6d8=0x0,_0x13dac9=events[_0xd8c3('0x6')];_0x34b6d8<_0x13dac9;_0x34b6d8++){var _0x440fe0=events[_0x34b6d8];var _0x30c00d=createListener(_0xd8c3('0x7')+_0x440fe0,_0x528b48);ChatGroupEvents['on'](_0x440fe0,_0x30c00d);}};
\ No newline at end of file
+var _0x383a=['register','length','./chatGroup.events','save','remove','emit','removeListener'];(function(_0x2ef076,_0x7e4f75){var _0x202f26=function(_0x277542){while(--_0x277542){_0x2ef076['push'](_0x2ef076['shift']());}};_0x202f26(++_0x7e4f75);}(_0x383a,0xb1));var _0xa383=function(_0x315216,_0x15d0cc){_0x315216=_0x315216-0x0;var _0x4dfb84=_0x383a[_0x315216];return _0x4dfb84;};'use strict';var ChatGroupEvents=require(_0xa383('0x0'));var events=[_0xa383('0x1'),_0xa383('0x2'),'update'];function createListener(_0x4c5afb,_0x5f0fd1){return function(_0x422361){_0x5f0fd1[_0xa383('0x3')](_0x4c5afb,_0x422361);};}function removeListener(_0xd98016,_0x126341){return function(){ChatGroupEvents[_0xa383('0x4')](_0xd98016,_0x126341);};}exports[_0xa383('0x5')]=function(_0x4fd756){for(var _0x1bbcef=0x0,_0x75d54c=events[_0xa383('0x6')];_0x1bbcef<_0x75d54c;_0x1bbcef++){var _0x2d1c43=events[_0x1bbcef];var _0x3fe5a4=createListener('chatGroup:'+_0x2d1c43,_0x4fd756);ChatGroupEvents['on'](_0x2d1c43,_0x3fe5a4);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 7d74a94..9dc4e30 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 _0xbd23=['Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','create','addMembers','post','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express'];(function(_0x27c7b7,_0x3ac29c){var _0x22e7d5=function(_0x1a5494){while(--_0x1a5494){_0x27c7b7['push'](_0x27c7b7['shift']());}};_0x22e7d5(++_0x3ac29c);}(_0xbd23,0xa9));var _0x3bd2=function(_0x29222b,_0x190e44){_0x29222b=_0x29222b-0x0;var _0x24b5e2=_0xbd23[_0x29222b];return _0x24b5e2;};'use strict';var multer=require(_0x3bd2('0x0'));var util=require(_0x3bd2('0x1'));var path=require(_0x3bd2('0x2'));var timeout=require(_0x3bd2('0x3'));var express=require(_0x3bd2('0x4'));var router=express[_0x3bd2('0x5')]();var fs_extra=require(_0x3bd2('0x6'));var auth=require(_0x3bd2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3bd2('0x8'));var controller=require(_0x3bd2('0x9'));router[_0x3bd2('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x3bd2('0xb'),auth[_0x3bd2('0xc')](),controller[_0x3bd2('0xd')]);router[_0x3bd2('0xa')](_0x3bd2('0xe'),auth[_0x3bd2('0xc')](),controller[_0x3bd2('0xf')]);router[_0x3bd2('0xa')](_0x3bd2('0x10'),auth['isAuthenticated'](),controller[_0x3bd2('0x11')]);router['get'](_0x3bd2('0x12'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x3bd2('0x13'),auth[_0x3bd2('0xc')](),controller[_0x3bd2('0x14')]);router['post']('/',auth[_0x3bd2('0xc')](),controller[_0x3bd2('0x15')]);router['post'](_0x3bd2('0x12'),auth['isAuthenticated'](),controller[_0x3bd2('0x16')]);router[_0x3bd2('0x17')](_0x3bd2('0x13'),auth[_0x3bd2('0xc')](),controller['addMessage']);router['put'](_0x3bd2('0xe'),auth[_0x3bd2('0xc')](),controller[_0x3bd2('0x18')]);router[_0x3bd2('0x19')](_0x3bd2('0xe'),auth[_0x3bd2('0xc')](),controller[_0x3bd2('0x1a')]);router[_0x3bd2('0x19')](_0x3bd2('0x12'),auth[_0x3bd2('0xc')](),controller[_0x3bd2('0x1b')]);module[_0x3bd2('0x1c')]=router;
\ No newline at end of file
+var _0x2a72=['delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers','addMessage','put'];(function(_0x473463,_0x21da73){var _0x42f406=function(_0x34a5be){while(--_0x34a5be){_0x473463['push'](_0x473463['shift']());}};_0x42f406(++_0x21da73);}(_0x2a72,0x121));var _0x22a7=function(_0x42b7b3,_0x2e0015){_0x42b7b3=_0x42b7b3-0x0;var _0x4284e7=_0x2a72[_0x42b7b3];return _0x4284e7;};'use strict';var multer=require(_0x22a7('0x0'));var util=require(_0x22a7('0x1'));var path=require(_0x22a7('0x2'));var timeout=require(_0x22a7('0x3'));var express=require('express');var router=express[_0x22a7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x22a7('0x5'));var interaction=require(_0x22a7('0x6'));var config=require('../../config/environment');var controller=require(_0x22a7('0x7'));router[_0x22a7('0x8')]('/',auth[_0x22a7('0x9')](),controller[_0x22a7('0xa')]);router[_0x22a7('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x22a7('0xb')]);router[_0x22a7('0x8')](_0x22a7('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x22a7('0x8')](_0x22a7('0xd'),auth[_0x22a7('0x9')](),controller[_0x22a7('0xe')]);router[_0x22a7('0x8')](_0x22a7('0xf'),auth[_0x22a7('0x9')](),controller[_0x22a7('0x10')]);router[_0x22a7('0x8')](_0x22a7('0x11'),auth[_0x22a7('0x9')](),controller['getMessages']);router[_0x22a7('0x12')]('/',auth[_0x22a7('0x9')](),controller[_0x22a7('0x13')]);router[_0x22a7('0x12')]('/:id/members',auth[_0x22a7('0x9')](),controller[_0x22a7('0x14')]);router[_0x22a7('0x12')](_0x22a7('0x11'),auth[_0x22a7('0x9')](),controller[_0x22a7('0x15')]);router[_0x22a7('0x16')](_0x22a7('0xc'),auth[_0x22a7('0x9')](),controller['update']);router[_0x22a7('0x17')](_0x22a7('0xc'),auth[_0x22a7('0x9')](),controller[_0x22a7('0x18')]);router[_0x22a7('0x17')]('/:id/members',auth[_0x22a7('0x9')](),controller['removeMembers']);module[_0x22a7('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index f78c03a..b3a9037 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 _0xc788=['BOOLEAN','star','thumb','TEXT','DATE','STRING','long','ENUM','out','sequelize','exports'];(function(_0x14900b,_0x5e84c4){var _0x493ffc=function(_0x3d952c){while(--_0x3d952c){_0x14900b['push'](_0x14900b['shift']());}};_0x493ffc(++_0x5e84c4);}(_0xc788,0xc4));var _0x8c78=function(_0x1f1731,_0x4b77eb){_0x1f1731=_0x1f1731-0x0;var _0x1f7625=_0xc788[_0x1f1731];return _0x1f7625;};'use strict';var Sequelize=require(_0x8c78('0x0'));module[_0x8c78('0x1')]={'closed':{'type':Sequelize[_0x8c78('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x8c78('0x3'),_0x8c78('0x4')),'defaultValue':_0x8c78('0x3')},'ratingMessage':{'type':Sequelize[_0x8c78('0x5')]},'pathTranscript':{'type':Sequelize[_0x8c78('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8c78('0x6')]},'disposition':{'type':Sequelize[_0x8c78('0x7')]},'secondDisposition':{'type':Sequelize[_0x8c78('0x7')]},'thirdDisposition':{'type':Sequelize[_0x8c78('0x7')]},'note':{'type':Sequelize[_0x8c78('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x8c78('0x7')]},'osName':{'type':Sequelize[_0x8c78('0x7')]},'osVersion':{'type':Sequelize[_0x8c78('0x7')]},'deviceModel':{'type':Sequelize[_0x8c78('0x7')]},'deviceVendor':{'type':Sequelize[_0x8c78('0x7')]},'deviceType':{'type':Sequelize[_0x8c78('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x8c78('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x8c78('0x8'))},'read1stAt':{'type':Sequelize[_0x8c78('0x6')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x8c78('0x9')]('in',_0x8c78('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x8c78('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x8a5c=['DATE','long','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x240a17,_0x4a0bf8){var _0x58b5a4=function(_0x30e869){while(--_0x30e869){_0x240a17['push'](_0x240a17['shift']());}};_0x58b5a4(++_0x4a0bf8);}(_0x8a5c,0x136));var _0xc8a5=function(_0x5e01c6,_0x30bc2c){_0x5e01c6=_0x5e01c6-0x0;var _0x5d7383=_0x8a5c[_0x5e01c6];return _0x5d7383;};'use strict';var Sequelize=require(_0xc8a5('0x0'));module[_0xc8a5('0x1')]={'closed':{'type':Sequelize[_0xc8a5('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xc8a5('0x3')]},'ratingType':{'type':Sequelize[_0xc8a5('0x4')](_0xc8a5('0x5'),_0xc8a5('0x6')),'defaultValue':_0xc8a5('0x5')},'ratingMessage':{'type':Sequelize[_0xc8a5('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xc8a5('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xc8a5('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xc8a5('0x8')]},'thirdDisposition':{'type':Sequelize[_0xc8a5('0x8')]},'note':{'type':Sequelize[_0xc8a5('0x8')]},'browserName':{'type':Sequelize[_0xc8a5('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xc8a5('0x8')]},'osVersion':{'type':Sequelize[_0xc8a5('0x8')]},'deviceModel':{'type':Sequelize[_0xc8a5('0x8')]},'deviceVendor':{'type':Sequelize[_0xc8a5('0x8')]},'deviceType':{'type':Sequelize[_0xc8a5('0x8')]},'referer':{'type':Sequelize[_0xc8a5('0x7')]},'customerIp':{'type':Sequelize[_0xc8a5('0x8')]},'formData':{'type':Sequelize[_0xc8a5('0x7')](_0xc8a5('0xa'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xc8a5('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xc8a5('0x8')]},'customerPort':{'type':Sequelize[_0xc8a5('0x8')]},'vidaooSessionId':{'type':Sequelize[_0xc8a5('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xc8a5('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 313fe3c..5227d15 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 _0xb821=['`unreadMessages`\x20>\x200','tag','isArray','filter','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','agent','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','role','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','toString','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','params','intersection','includeAll','include','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooTopic','vidaooMetadata','vidaooEscalation','email','POST','vidaooNote','follow','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','basename','mimetype','attachmentDownload','json','Unauthorized','Attachment','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','CmContact','%s%d','agentAlias','System','customer','Visitor','website_alias','agent_alias','alias','agent_fullname','fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','includeAgent','addTags','setTags','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','transcript-%d-%s.zip','firstName','lastName','Account','Owner','mkdirSync','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','out','renderFile','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','zip-dir','request-promise','mustache','ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','update','destroy','name','body','contact','interaction','account','Users','map','TagIds','Tags','split','forEach','push','waiting','talking','answered','unmanaged','abandoned','closed','UserId','disposition','total','index','ChatInteraction','rawAttributes','key','query','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','keys','isEmpty','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','read','`unreadMessages`\x20=\x200'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xb821,0xa7));var _0x1b82=function(_0x7a5ec5,_0x4473bb){_0x7a5ec5=_0x7a5ec5-0x0;var _0x1b191f=_0xb821[_0x7a5ec5];return _0x1b191f;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x1b82('0x0'));var rp=require(_0x1b82('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1b82('0x2'));var util=require('util');var path=require('path');var ejs=require(_0x1b82('0x3'));var fs=require('fs');var _=require(_0x1b82('0x4'));var squel=require(_0x1b82('0x5'));var Redis=require(_0x1b82('0x6'));var qs=require('../../components/parsers/qs');var as=require(_0x1b82('0x7'));var pdf=require(_0x1b82('0x8'));var logger=require(_0x1b82('0x9'))(_0x1b82('0xa'));var config=require(_0x1b82('0xb'));var db=require(_0x1b82('0xc'))['db'];config[_0x1b82('0xd')]=_[_0x1b82('0xe')](config[_0x1b82('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x1b82('0xf'))(new Redis(config[_0x1b82('0xd')]));require(_0x1b82('0x10'))[_0x1b82('0x11')](socket);var jayson=require(_0x1b82('0x12'));var client=jayson[_0x1b82('0x13')][_0x1b82('0x14')]({'port':0x232b});var client9004=jayson[_0x1b82('0x13')]['http']({'port':0x232c});function respondWithRpcPromise(_0x46007e,_0x241d11,_0x2391f5,_0x61b6eb){return new BPromise(function(_0x50aed7,_0x1a6285){var _0x5767aa=_0x61b6eb||client;return _0x5767aa['request'](_0x46007e,_0x2391f5)[_0x1b82('0x15')](function(_0x4bf75b){logger[_0x1b82('0x16')](_0x1b82('0x17'),_0x241d11,'request\x20sent');logger[_0x1b82('0x18')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x241d11,'request\x20sent',JSON[_0x1b82('0x19')](_0x4bf75b));if(_0x4bf75b['error']){if(_0x4bf75b[_0x1b82('0x1a')][_0x1b82('0x1b')]===0x1f4){logger[_0x1b82('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x241d11,_0x4bf75b['error'][_0x1b82('0x1c')]);return _0x1a6285(_0x4bf75b['error'][_0x1b82('0x1c')]);}logger[_0x1b82('0x1a')](_0x1b82('0x17'),_0x241d11,_0x4bf75b['error'][_0x1b82('0x1c')]);return _0x50aed7(_0x4bf75b[_0x1b82('0x1a')][_0x1b82('0x1c')]);}else{logger[_0x1b82('0x16')](_0x1b82('0x17'),_0x241d11,'request\x20sent');_0x50aed7(_0x4bf75b[_0x1b82('0x1d')][_0x1b82('0x1c')]);}})[_0x1b82('0x1e')](function(_0x1d50b6){logger[_0x1b82('0x1a')](_0x1b82('0x17'),_0x241d11,_0x1d50b6);_0x1a6285(_0x1d50b6);});});}function respondWithStatusCode(_0x2d07f4,_0x486e92){_0x486e92=_0x486e92||0xcc;return function(_0x1df569){if(_0x1df569){return _0x2d07f4[_0x1b82('0x1f')](_0x486e92);}return _0x2d07f4['status'](_0x486e92)[_0x1b82('0x20')]();};}function respondWithResult(_0x225b81,_0x1ad9d6){_0x1ad9d6=_0x1ad9d6||0xc8;return function(_0x4bbbbf){if(_0x4bbbbf){return _0x225b81[_0x1b82('0x21')](_0x1ad9d6)['json'](_0x4bbbbf);}};}function respondWithFilteredResult(_0x5cd458,_0x5f556b){return function(_0xf2e556){if(_0xf2e556){var _0x149d0f=typeof _0x5f556b[_0x1b82('0x22')]===_0x1b82('0x23')&&typeof _0x5f556b['limit']===_0x1b82('0x23');var _0x165b45=_0xf2e556[_0x1b82('0x24')];var _0x7455e8=_0x149d0f?0x0:_0x5f556b[_0x1b82('0x22')];var _0x1b8b6f=_0x149d0f?_0xf2e556[_0x1b82('0x24')]:_0x5f556b[_0x1b82('0x22')]+_0x5f556b[_0x1b82('0x25')];var _0x1f9c6b;if(_0x1b8b6f>=_0x165b45){_0x1b8b6f=_0x165b45;_0x1f9c6b=0xc8;}else{_0x1f9c6b=0xce;}_0x5cd458[_0x1b82('0x21')](_0x1f9c6b);return _0x5cd458[_0x1b82('0x26')](_0x1b82('0x27'),_0x7455e8+'-'+_0x1b8b6f+'/'+_0x165b45)['json'](_0xf2e556);}return null;};}function saveUpdates(_0x17b3aa){return function(_0x2931d0){if(_0x2931d0){return _0x2931d0[_0x1b82('0x28')](_0x17b3aa)[_0x1b82('0x15')](function(_0x18e4ff){return _0x18e4ff;});}return null;};}function removeEntity(_0x115ce7){return function(_0xd3c4a){if(_0xd3c4a){return _0xd3c4a[_0x1b82('0x29')]()[_0x1b82('0x15')](function(){_0x115ce7[_0x1b82('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x225c06){return function(_0x29a31e){if(!_0x29a31e){_0x225c06[_0x1b82('0x1f')](0x194);}return _0x29a31e;};}function handleError(_0xc98ee2,_0x5b7b18){_0x5b7b18=_0x5b7b18||0x1f4;return function(_0x474218){logger[_0x1b82('0x1a')](_0x474218['stack']);if(_0x474218[_0x1b82('0x2a')]){delete _0x474218[_0x1b82('0x2a')];}_0xc98ee2[_0x1b82('0x21')](_0x5b7b18)['send'](_0x474218);};}function getMustacheRender(_0x5efb8e,_0x8e881b){return Mustache['render'](_0x5efb8e,_['merge'](_0x8e881b[_0x1b82('0x2b')],{'contact':_0x8e881b[_0x1b82('0x2c')],'message':_0x8e881b[_0x1b82('0x1c')],'agent':_0x8e881b['agent'],'interaction':_0x8e881b[_0x1b82('0x2d')],'account':_0x8e881b[_0x1b82('0x2e')]}))||'';}function getInteractionUsers(_0xea774a,_0x31607f){return new BPromise(function(_0x4dd64a,_0x42c1c4){try{if(_0x31607f[_0xea774a['id']]){_0xea774a[_0x1b82('0x2f')]=_[_0x1b82('0x30')](_0x31607f[_0xea774a['id']],function(_0x5ebf6c){return{'id':_0x5ebf6c['id'],'fullname':_0x5ebf6c['fullname']};});}}catch(_0x21e859){_0x42c1c4(_0x21e859);}_0x4dd64a(_0xea774a);});}function getInteractionTags(_0x5d7e6a,_0x1d3e68){return new BPromise(function(_0x1e6a9,_0x286b4b){try{if(_0x5d7e6a[_0x1b82('0x31')]){_0x5d7e6a[_0x1b82('0x32')]=[];_0x5d7e6a[_0x1b82('0x31')][_0x1b82('0x33')](',')[_0x1b82('0x34')](function(_0x47cd9f){_0x5d7e6a['Tags'][_0x1b82('0x35')](_0x1d3e68[_0x47cd9f]);});}delete _0x5d7e6a['TagIds'];}catch(_0x34890e){_0x286b4b(_0x34890e);}_0x1e6a9(_0x5d7e6a);});}function updateChatInteraction(_0x592449,_0x1c5bc1,_0x331379){return new BPromise(function(_0x1db463,_0x2c1cd0){return getInteractionUsers(_0x592449,_0x331379)[_0x1b82('0x15')](function(_0x202bb4){return getInteractionTags(_0x202bb4,_0x1c5bc1);})['then'](function(_0x17d214){return getStateInteraction(_0x17d214);})['then'](function(_0x410722){_0x1db463(_0x410722);})['catch'](function(_0x21617d){_0x2c1cd0(_0x21617d);});});}function getStateInteraction(_0x4edc17){return new BPromise(function(_0x5aeac1){_0x4edc17[_0x1b82('0x36')]=0x0;_0x4edc17[_0x1b82('0x37')]=0x0;_0x4edc17[_0x1b82('0x38')]=0x0;_0x4edc17[_0x1b82('0x39')]=0x0;_0x4edc17[_0x1b82('0x3a')]=0x0;_0x4edc17['total']=0x0;if(!_0x4edc17[_0x1b82('0x3b')]&&!_0x4edc17['UserId']){_0x4edc17[_0x1b82('0x36')]+=0x1;}if(!_0x4edc17[_0x1b82('0x3b')]&&_0x4edc17[_0x1b82('0x3c')]){_0x4edc17[_0x1b82('0x37')]+=0x1;if(_0x4edc17[_0x1b82('0x36')]){_0x4edc17['waiting']-=0x1;}}if(_0x4edc17[_0x1b82('0x3b')]&&_0x4edc17['disposition']===_0x1b82('0x3a')){_0x4edc17[_0x1b82('0x3a')]+=0x1;if(_0x4edc17['waiting']){_0x4edc17[_0x1b82('0x36')]-=0x1;}}else if(_0x4edc17[_0x1b82('0x3b')]&&!_0x4edc17[_0x1b82('0x3c')]&&_0x4edc17[_0x1b82('0x3d')]){_0x4edc17[_0x1b82('0x39')]+=0x1;if(_0x4edc17[_0x1b82('0x36')]){_0x4edc17[_0x1b82('0x36')]-=0x1;}}else if(_0x4edc17['closed']&&_0x4edc17[_0x1b82('0x3c')]){_0x4edc17['answered']+=0x1;if(_0x4edc17[_0x1b82('0x37')]){_0x4edc17[_0x1b82('0x37')]-=0x1;}}_0x4edc17[_0x1b82('0x3e')]+=0x1;_0x5aeac1(_0x4edc17);});}exports[_0x1b82('0x3f')]=function(_0x429a25,_0x1d24d6){var _0x60a3e1={},_0x19c7ad={},_0x192ce3={'count':0x0,'rows':[]};var _0x120b35=_[_0x1b82('0x30')](db[_0x1b82('0x40')][_0x1b82('0x41')],function(_0x432e84){return{'name':_0x432e84['fieldName'],'type':_0x432e84['type'][_0x1b82('0x42')]};});_0x19c7ad['model']=_[_0x1b82('0x30')](_0x120b35,_0x1b82('0x2a'));_0x19c7ad[_0x1b82('0x43')]=_['keys'](_0x429a25[_0x1b82('0x43')]);_0x19c7ad['filters']=_['intersection'](_0x19c7ad[_0x1b82('0x44')],_0x19c7ad[_0x1b82('0x43')]);_0x60a3e1[_0x1b82('0x45')]=_['intersection'](_0x19c7ad[_0x1b82('0x44')],qs[_0x1b82('0x46')](_0x429a25['query']['fields']));_0x60a3e1[_0x1b82('0x45')]=_0x60a3e1[_0x1b82('0x45')][_0x1b82('0x47')]?_0x60a3e1['attributes']:_0x19c7ad[_0x1b82('0x44')];if(!_0x429a25[_0x1b82('0x43')][_0x1b82('0x48')](_0x1b82('0x49'))){_0x60a3e1[_0x1b82('0x25')]=qs[_0x1b82('0x25')](_0x429a25['query'][_0x1b82('0x25')]);_0x60a3e1['offset']=qs[_0x1b82('0x22')](_0x429a25[_0x1b82('0x43')]['offset']);}_0x60a3e1[_0x1b82('0x4a')]=qs['sort'](_0x429a25[_0x1b82('0x43')][_0x1b82('0x4b')]);_0x60a3e1[_0x1b82('0x4c')]=qs[_0x1b82('0x4d')](_[_0x1b82('0x4e')](_0x429a25[_0x1b82('0x43')],_0x19c7ad['filters']),_0x120b35);var _0x5e8779=[];var _0xe2ad3e=squel[_0x1b82('0x4f')]()[_0x1b82('0x50')]('id')[_0x1b82('0x50')](_0x1b82('0x2a'))[_0x1b82('0x50')](_0x1b82('0x51'))[_0x1b82('0x52')]('tools_tags');var _0x4cdcfe=squel['select']()[_0x1b82('0x50')](_0x1b82('0x53'))[_0x1b82('0x50')](_0x1b82('0x54'))[_0x1b82('0x50')](_0x1b82('0x55'))[_0x1b82('0x52')]('user_has_chat_interactions','ui')[_0x1b82('0x56')](_0x1b82('0x57'),'u',_0x1b82('0x58'));var _0x42d3e1=squel[_0x1b82('0x4f')]()[_0x1b82('0x52')](_0x1b82('0x59'),'i')[_0x1b82('0x56')]('cm_contacts','c',_0x1b82('0x5a'))[_0x1b82('0x56')](_0x1b82('0x57'),'o',_0x1b82('0x5b'))[_0x1b82('0x56')]('chat_websites','a','a.id\x20=\x20i.ChatWebsiteId')[_0x1b82('0x56')](_0x1b82('0x5c'),'me',_0x1b82('0x5d'))[_0x1b82('0x56')]('chat_interaction_has_tags','it',_0x1b82('0x5e'))[_0x1b82('0x56')](_0x1b82('0x5f'),'t',_0x1b82('0x60'));var _0x152f84=squel[_0x1b82('0x61')]();var _0x3e591a=[];var _0x38e573=squel[_0x1b82('0x61')]();var _0x23a124;if(_0x429a25['query'][_0x1b82('0x62')]){_0x23a124=as[_0x1b82('0x63')](_0x429a25['query'][_0x1b82('0x62')]);var _0x33ee1c=_0x23a124[_0x1b82('0x64')];for(var _0x2a5435=0x0;_0x2a5435<_0x23a124['conditions'][_0x1b82('0x47')];_0x2a5435++){var _0x29bcce=_0x23a124[_0x1b82('0x65')][_0x2a5435];var _0x138723='i';var _0x3c0bef=_[_0x1b82('0x66')](_0x120b35,['name',_0x29bcce[_0x1b82('0x50')]]);if(!_0x3c0bef){switch(_0x29bcce['field']){case _0x1b82('0x67'):if(_0x29bcce['value']==0x1){_0x42d3e1[_0x1b82('0x68')]('`'+_0x29bcce[_0x1b82('0x50')]+_0x1b82('0x69'));}else{_0x42d3e1[_0x1b82('0x68')]('`'+_0x29bcce[_0x1b82('0x50')]+_0x1b82('0x6a'));}break;case _0x1b82('0x6b'):if(_0x29bcce['operator']===_0x1b82('0x6c')){if(_0x29bcce[_0x1b82('0x6d')][_0x1b82('0x33')]('\x20')[_0x1b82('0x47')]>0x1){_0x152f84[_0x33ee1c](_0x1b82('0x6e'),qs[_0x1b82('0x6f')](_0x29bcce[_0x1b82('0x6d')]),null);}else{var _0xa763a3='%'+_0x29bcce[_0x1b82('0x6d')]+'%';_0x152f84[_0x33ee1c](_0x1b82('0x70'),_0xa763a3,_0xa763a3,_0xa763a3);}}else{_0x3c0bef=_[_0x1b82('0x66')](_0x120b35,[_0x1b82('0x2a'),_0x1b82('0x71')]);_0x29bcce['field']=_0x1b82('0x71');_0x68b4fb=as[_0x1b82('0x72')](_0x138723,_0x3c0bef[_0x1b82('0x73')],_0x29bcce);_0x152f84[_0x33ee1c](_0x68b4fb['text'],_0x68b4fb[_0x1b82('0x6d')][_0x1b82('0x74')],_0x68b4fb['value'][_0x1b82('0x20')]);}break;case _0x1b82('0x75'):var _0x1a3bed=_0x29bcce['value']['split'](',')[_0x1b82('0x30')](function(_0x3b2da4){return Number(_0x3b2da4);});_0x1a3bed[_0x1b82('0x34')](function(_0x3e8db4){_0x38e573['or'](_0x1b82('0x76'),'%,'+_0x3e8db4+',%');});_0x3e591a=_['union'](_0x3e591a,_0x1a3bed);break;case _0x1b82('0x77'):if(_0x29bcce['operator']===_0x1b82('0x6c')){_0x152f84[_0x33ee1c](_0x1b82('0x78'),'%'+_0x29bcce[_0x1b82('0x6d')]+'%',null);}else{_0x3c0bef=_[_0x1b82('0x66')](_0x120b35,[_0x1b82('0x2a'),_0x1b82('0x3c')]);_0x29bcce[_0x1b82('0x50')]=_0x1b82('0x3c');_0x68b4fb=as[_0x1b82('0x72')](_0x138723,_0x3c0bef[_0x1b82('0x73')],_0x29bcce);_0x152f84[_0x33ee1c](_0x68b4fb[_0x1b82('0x79')],_0x68b4fb['value'][_0x1b82('0x74')],_0x68b4fb['value']['end']);}break;case _0x1b82('0x2b'):_0x68b4fb=as[_0x1b82('0x72')]('me',null,_0x29bcce);_0x152f84[_0x33ee1c](_0x68b4fb[_0x1b82('0x79')],_0x68b4fb[_0x1b82('0x6d')][_0x1b82('0x74')],_0x68b4fb[_0x1b82('0x6d')][_0x1b82('0x20')]);break;}}else{var _0x68b4fb=as[_0x1b82('0x72')](_0x138723,_0x3c0bef[_0x1b82('0x73')],_0x29bcce);_0x152f84[_0x33ee1c](_0x68b4fb['text'],_0x68b4fb[_0x1b82('0x6d')]['start'],_0x68b4fb[_0x1b82('0x6d')]['end']);}}}else{var _0x3bd27c=_(_0x429a25[_0x1b82('0x43')])[_0x1b82('0x7a')]()[_0x1b82('0x30')](function(_0x1d3b4b){return _['some'](_0x120b35,[_0x1b82('0x2a'),_0x1d3b4b])?_0x1d3b4b:undefined;})['compact']()['value']();if(!_[_0x1b82('0x7b')](_0x3bd27c)){_0x3bd27c[_0x1b82('0x34')](function(_0x1a4826){if(_0x1a4826==='ChatWebsiteId'){_0x42d3e1[_0x1b82('0x4c')]('i.ChatWebsiteId\x20IN\x20?',[][_0x1b82('0x7c')](_0x429a25['query'][_0x1a4826]));}else if(_0x1a4826===_0x1b82('0x7d')){var _0x20900d=JSON[_0x1b82('0x7e')](_0x429a25[_0x1b82('0x43')][_0x1a4826])['$gte'];var _0x46cae4=JSON['parse'](_0x429a25[_0x1b82('0x43')][_0x1a4826])[_0x1b82('0x7f')];_0x42d3e1[_0x1b82('0x4c')](_0x1b82('0x80'),_0x20900d,_0x46cae4);}else{if(_0x429a25[_0x1b82('0x43')][_0x1a4826]==='null'){_0x42d3e1[_0x1b82('0x4c')]('i.'+_0x1a4826+'\x20IS\x20NULL');}else{_0x42d3e1[_0x1b82('0x4c')]('i.'+_0x1a4826+'\x20=\x20?',_0x429a25[_0x1b82('0x43')][_0x1a4826]);}}});}if(_0x429a25[_0x1b82('0x43')][_0x1b82('0x81')]){if(_0x429a25['query'][_0x1b82('0x81')]==0x1){_0x42d3e1[_0x1b82('0x68')](_0x1b82('0x82'));}else{_0x42d3e1['having'](_0x1b82('0x83'));}}if(_0x429a25[_0x1b82('0x43')][_0x1b82('0x84')]){_0x3e591a=_[_0x1b82('0x85')](_0x429a25[_0x1b82('0x43')]['tag'])?_0x429a25[_0x1b82('0x43')]['tag']:new Array(_0x429a25['query'][_0x1b82('0x84')]);_0x3e591a['forEach'](function(_0x3f989f){_0x38e573['or'](_0x1b82('0x76'),'%,'+_0x3f989f+',%');});}if(_0x429a25['query'][_0x1b82('0x86')]){var _0x391207=_0x429a25['query']['filter']['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x1b82('0x87')](_0x391207)){_0x152f84['or'](_0x1b82('0x88'),_0x391207+'%');}else{_0x152f84['or'](_0x1b82('0x89'),qs['getFullTextValue'](_0x391207))['or'](_0x1b82('0x8a'),_0x391207+'%');}}}_0x42d3e1['where'](_0x152f84);_0x42d3e1[_0x1b82('0x8b')](_0x1b82('0x8c'));var _0x96910f={'type':db[_0x1b82('0x8d')]['QueryTypes'][_0x1b82('0x8e')],'raw':!![]};var _0x2257fb=_0x42d3e1[_0x1b82('0x8f')]();_0x2257fb[_0x1b82('0x50')](_0x1b82('0x8c'));_0x2257fb[_0x1b82('0x50')](_0x1b82('0x90'),'unreadMessages');if(_0x60a3e1['order']){_0x60a3e1[_0x1b82('0x4a')]['forEach'](function(_0x4eb0d4){var _0x1228d3=_0x4eb0d4[0x0]===_0x1b82('0x91')?_0x4eb0d4[0x0]:'i.'+_0x4eb0d4[0x0];_0x42d3e1[_0x1b82('0x4a')](_0x1228d3,_0x4eb0d4[0x1]==='DESC'?![]:!![]);});}if(!_[_0x1b82('0x7b')](_0x3e591a)){_0x42d3e1['having'](_0x38e573);_0x2257fb[_0x1b82('0x4c')](_0x1b82('0x92'),_0x3e591a);}BPromise[_0x1b82('0x93')]()[_0x1b82('0x15')](function(){if(!_0x23a124){if(_0x429a25['query'][_0x1b82('0x94')])return;_0x2257fb['where'](_0x1b82('0x95'));_0x42d3e1[_0x1b82('0x4c')](_0x1b82('0x95'));return;}if(_0x429a25['user']['role']!==_0x1b82('0x96'))return;return _0x429a25[_0x1b82('0x97')][_0x1b82('0x98')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5a211b){if(_[_0x1b82('0x7b')](_0x5a211b)){_0x2257fb[_0x1b82('0x4c')](_0x1b82('0x99'));_0x42d3e1[_0x1b82('0x4c')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x2257fb[_0x1b82('0x4c')](_0x1b82('0x9a'),_['map'](_0x5a211b,'id'));_0x42d3e1['where'](_0x1b82('0x9a'),_[_0x1b82('0x30')](_0x5a211b,'id'));}});})[_0x1b82('0x15')](function(){if(_0x429a25[_0x1b82('0x97')][_0x1b82('0x9b')]===_0x1b82('0x96')&&!_0x23a124&&!_0x429a25['query'][_0x1b82('0x94')])return[];return db['sequelize'][_0x1b82('0x43')](_0x2257fb['toString'](),_0x96910f);})[_0x1b82('0x15')](function(_0x293828){_0x192ce3[_0x1b82('0x24')]=_0x293828[_0x1b82('0x47')];if(_0x192ce3[_0x1b82('0x24')]===0x0)return[];return db['sequelize'][_0x1b82('0x43')](_0xe2ad3e['toString'](),_0x96910f)[_0x1b82('0x15')](function(_0x523639){_0x5e8779=_[_0x1b82('0x9c')](_0x523639,'id');_0x96910f=_[_0x1b82('0x9d')](_0x96910f,{'model':db[_0x1b82('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x429a25['query'][_0x1b82('0x46')]){_0x60a3e1[_0x1b82('0x45')][_0x1b82('0x34')](function(_0x3869d2){_0x42d3e1['field']('i.'+_0x3869d2);});}else{_0x42d3e1[_0x1b82('0x50')](_0x1b82('0x90'),_0x1b82('0x67'));_0x42d3e1[_0x1b82('0x50')](_0x1b82('0x9e'),_0x1b82('0x9f'));_0x42d3e1[_0x1b82('0x50')](_0x1b82('0xa0'),'Account.mandatoryDisposition');_0x42d3e1[_0x1b82('0x50')](_0x1b82('0xa1'),_0x1b82('0x91'));_0x42d3e1[_0x1b82('0x50')](_0x1b82('0xa2'));_0x42d3e1[_0x1b82('0x50')](_0x1b82('0xa3'),_0x1b82('0xa4'));_0x42d3e1[_0x1b82('0x50')]('c.lastName',_0x1b82('0xa5'));_0x42d3e1[_0x1b82('0x50')](_0x1b82('0xa6'),_0x1b82('0xa7'));_0x42d3e1[_0x1b82('0x50')](_0x1b82('0xa8'),_0x1b82('0xa9'));_0x42d3e1['field'](_0x1b82('0xaa'),'Contact.mobile');_0x42d3e1[_0x1b82('0x50')]('c.fax',_0x1b82('0xab'));_0x42d3e1[_0x1b82('0x50')]('o.fullname',_0x1b82('0xac'));_0x42d3e1[_0x1b82('0x50')](_0x1b82('0xad'),'Owner.internal');_0x42d3e1[_0x1b82('0x50')](_0x1b82('0xae'),'TagIds');}if(_0x60a3e1[_0x1b82('0x25')])_0x42d3e1[_0x1b82('0x25')](_0x60a3e1[_0x1b82('0x25')]);if(_0x60a3e1[_0x1b82('0x22')])_0x42d3e1['offset'](_0x60a3e1[_0x1b82('0x22')]);return db[_0x1b82('0xaf')][_0x1b82('0x43')](_0x42d3e1[_0x1b82('0xb0')](),_0x96910f);})[_0x1b82('0x15')](function(_0x4e92a8){if(_0x4e92a8[_0x1b82('0x47')]>0x0)_0x4cdcfe[_0x1b82('0x4c')](_0x1b82('0xb1'),_[_0x1b82('0x30')](_0x4e92a8,'id'));return db[_0x1b82('0xaf')][_0x1b82('0x43')](_0x4cdcfe[_0x1b82('0xb0')](),_0x96910f)[_0x1b82('0x15')](function(_0x5ef041){var _0x42dbb3=_['groupBy'](_0x5ef041,_0x1b82('0xb2'));var _0x57ac8b=[];_0x4e92a8[_0x1b82('0x34')](function(_0x2b50c0){_0x57ac8b['push'](updateChatInteraction(_0x2b50c0,_0x5e8779,_0x42dbb3));});return BPromise['all'](_0x57ac8b);});});})[_0x1b82('0x15')](function(_0x3d5ee6){_0x192ce3['rows']=_0x3d5ee6;return _0x192ce3;})['then'](respondWithFilteredResult(_0x1d24d6,_0x60a3e1))[_0x1b82('0x1e')](handleError(_0x1d24d6,null));};exports['show']=function(_0x588deb,_0x31b018){var _0xf62c10={'raw':![],'where':{'id':_0x588deb[_0x1b82('0xb3')]['id']}},_0x2f7fa5={};_0x2f7fa5[_0x1b82('0x44')]=_[_0x1b82('0x7a')](db[_0x1b82('0x40')][_0x1b82('0x41')]);_0x2f7fa5[_0x1b82('0x43')]=_['keys'](_0x588deb[_0x1b82('0x43')]);_0x2f7fa5[_0x1b82('0x4d')]=_[_0x1b82('0xb4')](_0x2f7fa5[_0x1b82('0x44')],_0x2f7fa5[_0x1b82('0x43')]);_0xf62c10[_0x1b82('0x45')]=_['intersection'](_0x2f7fa5[_0x1b82('0x44')],qs[_0x1b82('0x46')](_0x588deb['query'][_0x1b82('0x46')]));_0xf62c10['attributes']=_0xf62c10[_0x1b82('0x45')][_0x1b82('0x47')]?_0xf62c10[_0x1b82('0x45')]:_0x2f7fa5[_0x1b82('0x44')];if(_0x588deb[_0x1b82('0x43')][_0x1b82('0xb5')]){_0xf62c10[_0x1b82('0xb6')]=[{'all':!![]}];}_0xf62c10=_[_0x1b82('0x9d')]({},_0xf62c10,_0x588deb['options']);return db[_0x1b82('0x40')][_0x1b82('0x66')](_0xf62c10)[_0x1b82('0x15')](handleEntityNotFound(_0x31b018,null))[_0x1b82('0x15')](respondWithResult(_0x31b018,null))[_0x1b82('0x1e')](handleError(_0x31b018,null));};exports[_0x1b82('0xb7')]=function(_0x3aac5e,_0x5cb765){return db[_0x1b82('0x40')][_0x1b82('0xb7')](_0x3aac5e[_0x1b82('0x2b')],{})[_0x1b82('0x15')](respondWithResult(_0x5cb765,0xc9))[_0x1b82('0x1e')](handleError(_0x5cb765,null));};exports['update']=function(_0x5aad3c,_0x5dedcc){if(_0x5aad3c[_0x1b82('0x2b')]['id']){delete _0x5aad3c[_0x1b82('0x2b')]['id'];}return db[_0x1b82('0x40')][_0x1b82('0x66')]({'where':{'id':_0x5aad3c[_0x1b82('0xb3')]['id']}})[_0x1b82('0x15')](handleEntityNotFound(_0x5dedcc,null))[_0x1b82('0x15')](saveUpdates(_0x5aad3c[_0x1b82('0x2b')],null))[_0x1b82('0x15')](respondWithResult(_0x5dedcc,null))[_0x1b82('0x1e')](handleError(_0x5dedcc,null));};exports[_0x1b82('0x29')]=function(_0x58655d,_0x2f5754){return db[_0x1b82('0x40')]['find']({'where':{'id':_0x58655d[_0x1b82('0xb3')]['id']}})['then'](handleEntityNotFound(_0x2f5754,null))[_0x1b82('0x15')](removeEntity(_0x2f5754,null))[_0x1b82('0x1e')](handleError(_0x2f5754,null));};exports[_0x1b82('0xb8')]=function(_0x55014e,_0xb2d45e){return db[_0x1b82('0x40')][_0x1b82('0xb8')]()[_0x1b82('0x15')](respondWithResult(_0xb2d45e,null))[_0x1b82('0x1e')](handleError(_0xb2d45e,null));};exports[_0x1b82('0xb9')]=function(_0x5f554e,_0x1b0d41){var _0x3a5365=_0x5f554e['params']['id'];var _0x3e493b;var _0x27da5e;var _0x5e4427;return db[_0x1b82('0x40')][_0x1b82('0xba')]({'where':{'id':_0x3a5365}})['then'](function(_0x312d90){_0x3e493b=_0x312d90;return db[_0x1b82('0xbb')][_0x1b82('0xba')]({'where':{'id':_0x312d90[_0x1b82('0x94')]},'attributes':['id',_0x1b82('0xbc'),'vidaooEscalation',_0x1b82('0xbd'),'vidaooNote',_0x1b82('0xbe')],'raw':!![]});})[_0x1b82('0x15')](function(_0x8b0b24){if(_0x8b0b24&&_0x8b0b24['vidaooApiKey']&&_0x8b0b24[_0x1b82('0xbf')]){_0x27da5e=_0x8b0b24;var _0xe0de93={'interaction':{'id':_0x3a5365},'agent':{'id':_0x5f554e[_0x1b82('0x97')]['id'],'name':_0x5f554e[_0x1b82('0x97')][_0x1b82('0x2a')],'fullname':_0x5f554e[_0x1b82('0x97')]['fullname'],'email':_0x5f554e[_0x1b82('0x97')][_0x1b82('0xc0')]},'contact':_0x5f554e[_0x1b82('0x2b')][_0x1b82('0x2c')],'account':_0x5f554e[_0x1b82('0x2b')]['account']};var _0x2f3278={'rejectUnauthorized':![],'method':_0x1b82('0xc1'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x8b0b24[_0x1b82('0xbc')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5f554e['user']['email']],'buttons':null,'topic':_0x27da5e[_0x1b82('0xbd')],'note':_['isNull'](_0x27da5e[_0x1b82('0xc2')])?null:getMustacheRender(_0x27da5e[_0x1b82('0xc2')],_0xe0de93),'metadata':null},'redirect':_0x1b82('0xc3'),'json':!![]};try{if(!_[_0x1b82('0xc4')](_0x27da5e['vidaooMetadata'])){var _0x325d82=getMustacheRender(_0x27da5e[_0x1b82('0xbe')],_0xe0de93);var _0x27369e=JSON[_0x1b82('0x7e')](_0x325d82);_0x2f3278['body'][_0x1b82('0xc5')]=_0x27369e;}}catch(_0x5ebb52){throw new db[(_0x1b82('0x8d'))][(_0x1b82('0xc6'))](_0x1b82('0xc7'));}return rp(_0x2f3278);}else{throw new db[(_0x1b82('0x8d'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x35e91c){_0x5e4427=_0x35e91c;if(_0x5e4427['id']){var _0x219d2d={'body':_0x5e4427[_0x1b82('0xc8')],'ChatWebsiteId':_0x27da5e['id'],'ChatInteractionId':_0x3e493b['id'],'direction':'out','UserId':_0x5f554e[_0x1b82('0x97')]['id']};return db[_0x1b82('0xc9')][_0x1b82('0xb7')](_0x219d2d,{});}else{throw new db[(_0x1b82('0x8d'))][(_0x1b82('0xc6'))](_0x1b82('0xca'));}})['then'](function(){return _0x3e493b[_0x1b82('0xcb')]({'vidaooSessionId':_0x5e4427['id']});})[_0x1b82('0x15')](respondWithResult(_0x1b0d41,null))[_0x1b82('0x1e')](handleError(_0x1b0d41,null));};exports['customUpdate']=function(_0x1f3080,_0x544e2d){if(_0x1f3080[_0x1b82('0x2b')]['id']){delete _0x1f3080['body']['id'];}return db[_0x1b82('0x40')][_0x1b82('0x66')]({'where':{'id':_0x1f3080[_0x1b82('0xb3')]['id']},'include':[{'model':db['CmContact'],'as':_0x1b82('0x6b')}]})['then'](handleEntityNotFound(_0x544e2d,null))['then'](saveUpdates(_0x1f3080[_0x1b82('0x2b')],null))['then'](respondWithResult(_0x544e2d,null))[_0x1b82('0x1e')](handleError(_0x544e2d,null));};exports['abandon']=function(_0x3bc6b6,_0x2b6c76){if(_0x3bc6b6[_0x1b82('0x2b')]['id']){delete _0x3bc6b6[_0x1b82('0x2b')]['id'];}return db[_0x1b82('0x40')][_0x1b82('0x66')]({'where':{'id':_0x3bc6b6['params']['id']}})[_0x1b82('0x15')](function(_0x12b9a5){if(!_0x12b9a5){logger[_0x1b82('0x1a')](_0x1b82('0xcc'),_0x1b82('0xcd'),0x194,_0x1b82('0xce'));_0x2b6c76[_0x1b82('0x1f')](0x194);}else{if(_0x12b9a5[_0x1b82('0x3c')]){throw new db[(_0x1b82('0x8d'))][(_0x1b82('0xc6'))](_0x1b82('0xcf'));}}return _0x12b9a5;})[_0x1b82('0x15')](function(_0x58fda2){if(_0x58fda2){return _0x58fda2[_0x1b82('0x28')]({'closed':_0x3bc6b6[_0x1b82('0x2b')][_0x1b82('0x3b')],'disposition':_0x3bc6b6[_0x1b82('0x2b')][_0x1b82('0x3d')]})['then'](function(_0x27d092){return _0x27d092;});}})[_0x1b82('0x15')](function(){return respondWithRpcPromise(_0x1b82('0xd0'),_0x1b82('0xcd'),_0x3bc6b6[_0x1b82('0x2b')],client9004);})[_0x1b82('0x15')](respondWithResult(_0x2b6c76,null))[_0x1b82('0x1e')](handleError(_0x2b6c76,null));};exports[_0x1b82('0xd1')]=function(_0x230ef2,_0x41fb0d){_0x230ef2[_0x1b82('0x2b')][_0x1b82('0x2a')]=_0x230ef2[_0x1b82('0xd2')][_0x1b82('0xd3')];_0x230ef2[_0x1b82('0x2b')][_0x1b82('0xd4')]=_0x230ef2[_0x1b82('0xd2')]['filename'];_0x230ef2[_0x1b82('0x2b')][_0x1b82('0x73')]=_0x230ef2[_0x1b82('0xd2')][_0x1b82('0xd5')];return db['Attachment'][_0x1b82('0xb7')](_0x230ef2['body'])['then'](respondWithResult(_0x41fb0d,0xc9))['catch'](handleError(_0x41fb0d,null));};exports[_0x1b82('0xd6')]=function(_0x2127da,_0x44f101){return db[_0x1b82('0x40')][_0x1b82('0xba')]({'where':{'id':_0x2127da[_0x1b82('0xb3')]['id']},'raw':!![]})[_0x1b82('0x15')](handleEntityNotFound(_0x44f101,null))[_0x1b82('0x15')](function(_0x2ac3d7){if(_0x2ac3d7){if(_0x2ac3d7['closed']){return _0x44f101[_0x1b82('0x21')](0x193)[_0x1b82('0xd7')]({'status':0x193,'message':_0x1b82('0xd8')});}return db[_0x1b82('0xd9')][_0x1b82('0xba')]({'where':{'id':_0x2127da['query'][_0x1b82('0xda')]},'raw':!![]})[_0x1b82('0x15')](handleEntityNotFound(_0x44f101,null));}})['then'](function(_0x1e681c){if(_0x1e681c){var _0x5d9c15=_0x1e681c[_0x1b82('0xdb')]!==null;var _0x32d6c5=path['join'](config[_0x1b82('0xdc')],_0x1b82('0xdd'));if(_0x5d9c15){_0x32d6c5=path[_0x1b82('0xde')](_0x32d6c5,_0x1b82('0xdf'));}var _0x2998e0=path[_0x1b82('0xde')](_0x32d6c5,_0x1e681c[_0x1b82('0xd4')]);return _0x44f101[_0x1b82('0xe0')](_0x2998e0);}})['catch'](handleError(_0x44f101,null));};exports[_0x1b82('0xe1')]=function(_0x5bc153,_0x235e79){var _0x58ae14=null;var _0xd51f0b=null;var _0x5700f7=null;if(_0x5bc153[_0x1b82('0x2b')]['id']){delete _0x5bc153[_0x1b82('0x2b')]['id'];}if(_0x5bc153[_0x1b82('0x2b')][_0x1b82('0xe2')]){_0x5700f7=path['join'](config['root'],_0x1b82('0xe3'),util[_0x1b82('0xe4')](_0x1b82('0xe5'),Date[_0x1b82('0xe6')]()));_0x5bc153[_0x1b82('0x2b')][_0x1b82('0xe7')]=_0x5700f7;}return db[_0x1b82('0x40')][_0x1b82('0x66')]({'where':{'id':_0x5bc153[_0x1b82('0xb3')]['id']},'include':[{'model':db[_0x1b82('0xc9')],'as':_0x1b82('0xe8'),'include':[{'model':db[_0x1b82('0x77')],'as':_0x1b82('0x77')}]}]})[_0x1b82('0x15')](handleEntityNotFound(_0x235e79,null))[_0x1b82('0x15')](saveUpdates(_0x5bc153[_0x1b82('0x2b')],null))[_0x1b82('0x15')](function(_0x8602e1){if(_0x8602e1){_0x58ae14=_0x8602e1;return db['ChatWebsite'][_0x1b82('0x66')]({'where':{'id':_0x58ae14['ChatWebsiteId']}});}})['then'](function(_0x564f3d){if(_0x564f3d){_0xd51f0b=_0x564f3d;return db[_0x1b82('0xe9')][_0x1b82('0x66')]({'where':{'id':_0x58ae14[_0x1b82('0x71')]}});}})[_0x1b82('0x15')](function(_0x238f03){if(_0x238f03){if(_0x5700f7){var _0x2c0749=null;for(var _0x1c0138=0x1;_0x1c0138<_0x58ae14[_0x1b82('0xe8')][_0x1b82('0x47')];++_0x1c0138){_0x2c0749=_0x58ae14[_0x1b82('0xe8')][_0x1c0138];var _0x29374b=_0x2c0749[_0x1b82('0x3c')]?util[_0x1b82('0xe4')](_0x1b82('0xea'),_0xd51f0b[_0x1b82('0xeb')],_0x2c0749[_0x1b82('0x3c')]):_0x1b82('0xec');var _0x599dcd=_0x5bc153[_0x1b82('0x2b')][_0x1b82('0xed')]||util['format'](_0x1b82('0xea'),_0x1b82('0xee'),_0x2c0749[_0x1b82('0x71')]);switch(_0xd51f0b['agentIdentifier']){case _0x1b82('0xef'):_0x29374b=_0x2c0749[_0x1b82('0x3c')]?util[_0x1b82('0xe4')](_0x1b82('0xea'),_0xd51f0b[_0x1b82('0xeb')],_0x2c0749[_0x1b82('0x3c')]):_0x1b82('0xec');break;case _0x1b82('0xf0'):_0x29374b=_0x2c0749['UserId']?_0x2c0749[_0x1b82('0x77')][_0x1b82('0xf1')]||_0x2c0749[_0x1b82('0x77')]['fullname']:_0x1b82('0xec');break;case _0x1b82('0xf2'):_0x29374b=_0x2c0749[_0x1b82('0x3c')]?_0x2c0749['User'][_0x1b82('0xf3')]:_0x1b82('0xec');break;default:_0x29374b=_0x2c0749[_0x1b82('0x3c')]?util[_0x1b82('0xe4')](_0x1b82('0xea'),_0xd51f0b[_0x1b82('0xeb')],_0x2c0749['UserId']):_0x1b82('0xec');}var _0x4a97b4=util[_0x1b82('0xe4')](_0x1b82('0xf4'),moment(_0x2c0749[_0x1b82('0x7d')])[_0x1b82('0xe4')]('MM/DD/YYYY\x20HH:mm:ss'),_0x2c0749[_0x1b82('0xf5')]==='in'?_0x599dcd:_0x29374b,_0x2c0749[_0x1b82('0x2b')]);if(!_0x2c0749[_0x1b82('0xf6')]){fs[_0x1b82('0xf7')](_0x5700f7,_0x4a97b4);}}return db['MailAccount'][_0x1b82('0xba')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x1b82('0xf8'),'raw':!![],'include':[{'model':db[_0x1b82('0xf9')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x1b82('0x15')](function(_0x94580c){if(!_0x94580c||!_0x94580c[_0x1b82('0xf8')]||!_0x5bc153[_0x1b82('0x2b')])return _0x58ae14;var _0x5ded06=_0x94580c[_0x1b82('0xfa')]();return respondWithRpcPromise(_0x1b82('0xfb'),_0x1b82('0xfc'),{'account':_0x5ded06,'message':{'from':util[_0x1b82('0xe4')](_0x1b82('0xfd'),_0x94580c[_0x1b82('0x2a')],_0x94580c[_0x1b82('0xc0')]||_0x94580c[_0x1b82('0xf8')][_0x1b82('0x97')]),'to':_0x5bc153[_0x1b82('0x2b')][_0x1b82('0xe2')],'subject':_0x1b82('0xfe'),'text':util[_0x1b82('0xe4')](_0x1b82('0xff'),_0x5bc153['body'][_0x1b82('0xe2')]),'attachments':[{'path':_0x5700f7}]}})[_0x1b82('0x15')](function(){return _0x58ae14;})[_0x1b82('0x1e')](function(_0x49c6d7){logger[_0x1b82('0x1a')](_0x49c6d7);});})[_0x1b82('0x15')](respondWithStatusCode(_0x235e79,0xc8))[_0x1b82('0x1e')](handleError(_0x235e79,null));};exports[_0x1b82('0x100')]=function(_0xb6da23,_0x27488b){return db[_0x1b82('0xc9')][_0x1b82('0x66')]({'where':{'id':_0xb6da23[_0x1b82('0xb3')]['id']}})[_0x1b82('0x15')](handleEntityNotFound(_0x27488b,null))[_0x1b82('0x15')](function(_0x4ce97a){if(_0x4ce97a){return _0x4ce97a[_0x1b82('0x100')](_0xb6da23[_0x1b82('0x2b')][_0x1b82('0x101')],_[_0x1b82('0x102')](_0xb6da23[_0x1b82('0x2b')],['ids','id'])||{});}})[_0x1b82('0x15')](respondWithResult(_0x27488b,null))[_0x1b82('0x1e')](handleError(_0x27488b,null));};exports[_0x1b82('0x103')]=function(_0x5cdc48,_0x32d235){var _0x447e72={'raw':![],'where':{}};var _0x635572={};var _0x15b233={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x1b82('0xba')]({'where':{'id':_0x5cdc48[_0x1b82('0xb3')]['id']}})['then'](handleEntityNotFound(_0x32d235,null))[_0x1b82('0x15')](function(_0x274f82){if(_0x274f82){_0x635572[_0x1b82('0x44')]=_[_0x1b82('0x7a')](db[_0x1b82('0xc9')][_0x1b82('0x41')]);_0x635572['query']=_[_0x1b82('0x7a')](_0x5cdc48['query']);_0x635572[_0x1b82('0x4d')]=_[_0x1b82('0xb4')](_0x635572[_0x1b82('0x44')],_0x635572[_0x1b82('0x43')]);_0x447e72[_0x1b82('0x45')]=_[_0x1b82('0xb4')](_0x635572[_0x1b82('0x44')],qs[_0x1b82('0x46')](_0x5cdc48['query']['fields']));_0x447e72['attributes']=_0x447e72[_0x1b82('0x45')][_0x1b82('0x47')]?_0x447e72[_0x1b82('0x45')]:_0x635572[_0x1b82('0x44')];if(!_0x5cdc48['query'][_0x1b82('0x48')]('nolimit')){_0x447e72[_0x1b82('0x25')]=qs[_0x1b82('0x25')](_0x5cdc48['query'][_0x1b82('0x25')]);_0x447e72['offset']=qs[_0x1b82('0x22')](_0x5cdc48['query'][_0x1b82('0x22')]);}_0x447e72[_0x1b82('0x4a')]=qs['sort'](_0x5cdc48[_0x1b82('0x43')][_0x1b82('0x4b')]);_0x447e72[_0x1b82('0x4c')]=qs[_0x1b82('0x4d')](_[_0x1b82('0x4e')](_0x5cdc48[_0x1b82('0x43')],_0x635572[_0x1b82('0x4d')]));_0x447e72[_0x1b82('0x4c')]['ChatInteractionId']=_0x274f82['id'];if(_0x5cdc48[_0x1b82('0x43')][_0x1b82('0x86')]){_0x447e72[_0x1b82('0x4c')]=_['merge'](_0x447e72['where'],{'$or':_[_0x1b82('0x30')](_0x447e72[_0x1b82('0x45')],function(_0x14ef8e){var _0x4c5c0f={};_0x4c5c0f[_0x14ef8e]={'$like':'%'+_0x5cdc48[_0x1b82('0x43')][_0x1b82('0x86')]+'%'};return _0x4c5c0f;})});}if(_0x5cdc48[_0x1b82('0x43')][_0x1b82('0x104')]){var _0x3dca3a=_0x5cdc48[_0x1b82('0x43')][_0x1b82('0x104')][_0x1b82('0x33')](',');var _0x3504a1={};_0x3504a1[_0x3dca3a[0x0]]={'$gte':moment(_0x3dca3a[0x1])[_0x1b82('0xe4')](_0x1b82('0x105'))};_0x447e72[_0x1b82('0x4c')]=_[_0x1b82('0x9d')](_0x447e72[_0x1b82('0x4c')],_0x3504a1);}_0x447e72=_['merge']({},_0x447e72,_0x5cdc48['options']);return db[_0x1b82('0xc9')][_0x1b82('0x24')]({'where':_0x447e72[_0x1b82('0x4c')]})[_0x1b82('0x15')](function(_0xb88dda){_0x15b233[_0x1b82('0x24')]=_0xb88dda;if(_0x5cdc48[_0x1b82('0x43')][_0x1b82('0xb5')]){_0x447e72['include']=[{'all':!![]}];}return db['ChatMessage'][_0x1b82('0x106')](_0x447e72);})[_0x1b82('0x15')](function(_0x16e810){_0x15b233[_0x1b82('0x107')]=_0x16e810;return _0x15b233;});}})[_0x1b82('0x15')](respondWithFilteredResult(_0x32d235,_0x447e72))['catch'](handleError(_0x32d235,null));};exports[_0x1b82('0x108')]=function(_0x5148dc,_0x1a0e44){var _0x2c8bf4={'where':{}},_0x8ea60c={},_0x489187={'count':0x0,'rows':[]};return db[_0x1b82('0x40')][_0x1b82('0xba')]({'where':{'id':_0x5148dc[_0x1b82('0xb3')]['id']}})[_0x1b82('0x15')](handleEntityNotFound(_0x1a0e44,null))[_0x1b82('0x15')](function(_0x40c685){if(_0x40c685){_0x8ea60c[_0x1b82('0x44')]=_['keys'](db[_0x1b82('0xc9')]['rawAttributes']);_0x8ea60c['query']=_[_0x1b82('0x7a')](_0x5148dc[_0x1b82('0x43')]);_0x8ea60c[_0x1b82('0x4d')]=_[_0x1b82('0xb4')](_0x8ea60c[_0x1b82('0x44')],_0x8ea60c[_0x1b82('0x43')]);_0x2c8bf4['attributes']=_['intersection'](_0x8ea60c[_0x1b82('0x44')],qs[_0x1b82('0x46')](_0x5148dc['query'][_0x1b82('0x46')]));_0x2c8bf4[_0x1b82('0x45')]=_0x2c8bf4[_0x1b82('0x45')]['length']?_0x2c8bf4[_0x1b82('0x45')]:_0x8ea60c[_0x1b82('0x44')];if(!_0x5148dc[_0x1b82('0x43')]['hasOwnProperty'](_0x1b82('0x49'))){_0x2c8bf4[_0x1b82('0x25')]=qs[_0x1b82('0x25')](_0x5148dc[_0x1b82('0x43')][_0x1b82('0x25')]);_0x2c8bf4[_0x1b82('0x22')]=qs[_0x1b82('0x22')](_0x5148dc[_0x1b82('0x43')]['offset']);}_0x2c8bf4[_0x1b82('0x4a')]=qs[_0x1b82('0x4b')](_0x5148dc[_0x1b82('0x43')][_0x1b82('0x4b')]);_0x2c8bf4[_0x1b82('0x4c')]=qs[_0x1b82('0x4d')](_[_0x1b82('0x4e')](_0x5148dc[_0x1b82('0x43')],_0x8ea60c[_0x1b82('0x4d')]));_0x2c8bf4[_0x1b82('0x4c')][_0x1b82('0xb2')]=_0x40c685['id'];if(_0x5148dc[_0x1b82('0x43')][_0x1b82('0x86')]){_0x2c8bf4[_0x1b82('0x4c')]=_[_0x1b82('0x9d')](_0x2c8bf4[_0x1b82('0x4c')],{'$or':_['map'](_0x2c8bf4[_0x1b82('0x45')],function(_0x1369e0){var _0x47c524={};_0x47c524[_0x1369e0]={'$like':'%'+_0x5148dc[_0x1b82('0x43')][_0x1b82('0x86')]+'%'};return _0x47c524;})});}_0x2c8bf4['where'][_0x1b82('0xf6')]=![];if(_0x5148dc[_0x1b82('0x43')]['id']){_0x2c8bf4[_0x1b82('0x4c')]['id']={'$gt':_0x5148dc[_0x1b82('0x43')]['id']};}_0x2c8bf4=_[_0x1b82('0x9d')]({},_0x2c8bf4,_0x5148dc['options']);return db[_0x1b82('0xc9')][_0x1b82('0x24')]({'where':_0x2c8bf4[_0x1b82('0x4c')]})[_0x1b82('0x15')](function(_0x4ab3d3){_0x489187[_0x1b82('0x24')]=_0x4ab3d3;_0x2c8bf4[_0x1b82('0xb6')]=[];if(_0x5148dc[_0x1b82('0x43')][_0x1b82('0x109')]){_0x2c8bf4['include'][_0x1b82('0x35')]({'model':db[_0x1b82('0x77')],'as':_0x1b82('0x77'),'attributes':['id','fullname',_0x1b82('0xf1')]});}if(_0x5148dc[_0x1b82('0x43')]['includeAll']){_0x2c8bf4[_0x1b82('0xb6')]=[{'all':!![]}];}return db[_0x1b82('0xc9')][_0x1b82('0x106')](_0x2c8bf4);})[_0x1b82('0x15')](function(_0x341b52){_0x489187[_0x1b82('0x107')]=_0x341b52;return _0x489187;});}})['then'](respondWithFilteredResult(_0x1a0e44,_0x2c8bf4))[_0x1b82('0x1e')](handleError(_0x1a0e44,null));};exports[_0x1b82('0x10a')]=function(_0x404297,_0x38f439){return db[_0x1b82('0x40')][_0x1b82('0x66')]({'where':{'id':_0x404297[_0x1b82('0xb3')]['id']}})[_0x1b82('0x15')](handleEntityNotFound(_0x38f439,null))[_0x1b82('0x15')](function(_0x2fbe3b){if(_0x2fbe3b){return _0x2fbe3b[_0x1b82('0x10b')](_0x404297[_0x1b82('0x2b')][_0x1b82('0x101')],_[_0x1b82('0x102')](_0x404297['body'],['ids','id'])||{})['spread'](function(){return db[_0x1b82('0x75')][_0x1b82('0x106')]({'attributes':['id',_0x1b82('0x2a'),_0x1b82('0x51')],'where':{'id':_0x404297[_0x1b82('0x2b')][_0x1b82('0x101')]}});})['then'](function(_0x23c0c8){socket[_0x1b82('0x10c')](_0x1b82('0x10d'),{'id':Number(_0x404297['params']['id']),'tags':_0x23c0c8||[]});return{'id':Number(_0x404297['params']['id']),'tags':_0x23c0c8||[]};});}})[_0x1b82('0x15')](respondWithResult(_0x38f439,null))[_0x1b82('0x1e')](handleError(_0x38f439,null));};exports[_0x1b82('0x10e')]=function(_0x48ed1c,_0x132da6){return db[_0x1b82('0x40')][_0x1b82('0x66')]({'where':{'id':_0x48ed1c[_0x1b82('0xb3')]['id']}})[_0x1b82('0x15')](handleEntityNotFound(_0x132da6,null))[_0x1b82('0x15')](function(_0x14018a){if(_0x14018a){return _0x14018a[_0x1b82('0x10e')](_0x48ed1c['query'][_0x1b82('0x101')]);}})['then'](respondWithStatusCode(_0x132da6,null))[_0x1b82('0x1e')](handleError(_0x132da6,null));};exports[_0x1b82('0xe0')]=function(_0x26a377,_0x4ffd8e){var _0x20f967=moment()[_0x1b82('0x10f')]()[_0x1b82('0xb0')]();var _0xd491d5=path[_0x1b82('0xde')](config['root'],_0x1b82('0x110'),_0x1b82('0x111'),_0x1b82('0x112'));var _0x164eb5=path[_0x1b82('0xde')](config[_0x1b82('0xdc')],_0x1b82('0x110'),_0x1b82('0x111'),'attachments');var _0x3a79f3=path['join'](_0xd491d5,_0x20f967);var _0x24bb32=util[_0x1b82('0xe4')](_0x1b82('0x113'),_0x26a377[_0x1b82('0xb3')]['id'],_0x20f967);var _0x4da468=path[_0x1b82('0xde')](_0xd491d5,_0x24bb32);var _0x2c49c7=[];_0x2c49c7['push']({'model':db[_0x1b82('0x77')],'as':_0x1b82('0x77'),'attributes':['id','fullname'],'raw':!![]});_0x2c49c7[_0x1b82('0x35')]({'model':db[_0x1b82('0xe9')],'as':'Contact','attributes':['id',_0x1b82('0x114'),_0x1b82('0x115')],'raw':!![]});if(_0x26a377[_0x1b82('0x43')]['attachments']){_0x2c49c7[_0x1b82('0x35')]({'model':db[_0x1b82('0xd9')],'as':_0x1b82('0xd9'),'raw':!![]});}var _0x279446=[{'model':db['ChatMessage'],'as':_0x1b82('0xe8'),'attributes':['id',_0x1b82('0x2b'),_0x1b82('0x7d'),'direction','secret',_0x1b82('0x81')],'include':_0x2c49c7}];_0x279446[_0x1b82('0x35')]({'model':db[_0x1b82('0xbb')],'as':_0x1b82('0x116'),'attributes':['id',_0x1b82('0x2a')]});_0x279446[_0x1b82('0x35')]({'model':db['User'],'as':_0x1b82('0x117'),'attributes':['id',_0x1b82('0xf3')]});return db['ChatInteraction'][_0x1b82('0x66')]({'where':{'id':_0x26a377[_0x1b82('0xb3')]['id']},'include':_0x279446})[_0x1b82('0x15')](handleEntityNotFound(_0x4ffd8e,null))['then'](function(_0x254970){if(_0x254970){var _0x110559=_0x254970['get']({'plain':!![]});fs[_0x1b82('0x118')](_0x3a79f3);var _0x5cbdb0={'channel':'Chat','account':_0x110559[_0x1b82('0x116')][_0x1b82('0x2a')],'agent':_0x110559['Owner']?_0x110559[_0x1b82('0x117')][_0x1b82('0xf3')]:_0x1b82('0x119'),'createdAt':moment(_0x110559[_0x1b82('0x7d')])['format'](_0x1b82('0x105'))[_0x1b82('0xb0')](),'closedAt':_0x110559['closed']?moment(_0x110559[_0x1b82('0x11a')])[_0x1b82('0xe4')](_0x1b82('0x105'))[_0x1b82('0xb0')]():'','disposition':_0x110559[_0x1b82('0x3d')],'chatInfo':{'browser':_0x110559[_0x1b82('0x11b')],'os':_0x110559[_0x1b82('0x11c')],'referer':_0x110559[_0x1b82('0x11d')],'customerIp':_0x110559[_0x1b82('0x11e')],'customerPort':_0x110559[_0x1b82('0x11f')]?_0x110559['customerPort']:_0x1b82('0x119')},'messages':_(_0x110559[_0x1b82('0xe8')])['tail']()[_0x1b82('0x86')]({'secret':![]})[_0x1b82('0x30')](function(_0x16807d){if(_0x16807d[_0x1b82('0xd9')]){var _0x25b9d9=path[_0x1b82('0xde')](_0x164eb5,_0x16807d[_0x1b82('0xd9')]['basename']);if(fs[_0x1b82('0x120')](_0x25b9d9)){fs[_0x1b82('0x121')](_0x25b9d9)[_0x1b82('0x122')](fs['createWriteStream'](path['join'](_0x3a79f3,_0x16807d[_0x1b82('0xd9')]['basename'])));}}return{'date':moment(_0x16807d[_0x1b82('0x7d')])['format'](_0x1b82('0x105'))[_0x1b82('0xb0')](),'sender':_0x16807d['direction']===_0x1b82('0x123')?_0x16807d[_0x1b82('0x77')]?_0x16807d[_0x1b82('0x77')][_0x1b82('0xf3')]:_0x1b82('0xec'):_0x16807d[_0x1b82('0x6b')]['firstName']+(_0x16807d[_0x1b82('0x6b')][_0x1b82('0x115')]?'\x20'+_0x16807d[_0x1b82('0x6b')][_0x1b82('0x115')]:''),'body':_0x16807d[_0x1b82('0xd9')]?_0x16807d[_0x1b82('0xd9')]['basename']:_0x16807d[_0x1b82('0x2b')],'direction':_0x16807d[_0x1b82('0xf5')]==='out'?'A':'C','secret':_0x16807d['secret'],'read':_0x16807d[_0x1b82('0x81')],'attachment':_0x16807d[_0x1b82('0xd9')]};})[_0x1b82('0x6d')]()};return ejs[_0x1b82('0x124')](path[_0x1b82('0xde')](config[_0x1b82('0xdc')],_0x1b82('0x110'),'views',_0x1b82('0x125')),{'interaction':_0x5cbdb0})[_0x1b82('0x15')](function(_0x282a1a){var _0x1a18c2=path[_0x1b82('0xde')](_0x3a79f3,_0x1b82('0x126')+_0x110559['id']+'-'+_0x20f967+_0x1b82('0x127'));var _0x3f92d2={'path':_0x1a18c2,'channel':_0x1b82('0x128'),'interactionId':_0x110559['id']};return pdf[_0x1b82('0x129')](_0x282a1a,_0x3f92d2);})[_0x1b82('0x15')](function(){return new Promise(function(_0x3d6def,_0x29cc7c){zipdir(_0x3a79f3,{'saveTo':_0x4da468},function(_0x3e6449,_0x3710bf){if(_0x3e6449)return _0x29cc7c(_0x3e6449);return _0x3d6def(_0x3710bf);});})['then'](function(){return new BPromise(function(_0x3b287f,_0x2499c6){rimraf(_0x3a79f3,function(_0x3534ab){if(_0x3534ab)_0x2499c6(_0x3534ab);return _0x3b287f();});});})[_0x1b82('0x15')](function(){return _0x4ffd8e[_0x1b82('0xe0')](_0x4da468,_0x24bb32,function(_0x26620f){if(_0x26620f){logger[_0x1b82('0x1a')]('err',_0x26620f);}else{fs['unlinkSync'](_0x4da468);}});});});}else{return _0x4ffd8e['sendStatus'](0xc8);}})[_0x1b82('0x1e')](handleError(_0x4ffd8e,null));};
\ No newline at end of file
+var _0x153f=['sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','setTags','spread','emit','chatInteractionTags:save','unix','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','secret','read','Account','Owner','get','mkdirSync','Chat','N.A.','browserName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','lastName','renderFile','views','transcript-','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','stack','name','send','render','merge','contact','agent','interaction','account','Users','map','TagIds','split','Tags','push','catch','waiting','talking','answered','unmanaged','closed','UserId','disposition','abandoned','total','index','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','value','`\x20=\x200','having','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','start','body','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','unreadMessages','order','contactName','DESC','isEmpty','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','keyBy','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','rows','show','params','fields','includeAll','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','email','isNull','vidaooMetadata','metadata','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','attachmentUpload','file','originalname','basename','filename','mimetype','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','pathTranscript','Messages','%s%d','agentAlias','System','customer','format','Visitor','agentIdentifier','website_alias','agent_alias','alias','fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','appendFileSync','Smtp','CloudProvider','getSmtpOptions','SendMail'];(function(_0x1dc0b9,_0x43ffca){var _0x20013a=function(_0x147ffa){while(--_0x147ffa){_0x1dc0b9['push'](_0x1dc0b9['shift']());}};_0x20013a(++_0x43ffca);}(_0x153f,0x15b));var _0xf153=function(_0x1cff93,_0x1d1ead){_0x1cff93=_0x1cff93-0x0;var _0x12d1e6=_0x153f[_0x1cff93];return _0x12d1e6;};'use strict';var rimraf=require(_0xf153('0x0'));var zipdir=require(_0xf153('0x1'));var rp=require(_0xf153('0x2'));var moment=require(_0xf153('0x3'));var BPromise=require(_0xf153('0x4'));var Mustache=require(_0xf153('0x5'));var util=require(_0xf153('0x6'));var path=require('path');var ejs=require(_0xf153('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf153('0x8'));var Redis=require(_0xf153('0x9'));var qs=require(_0xf153('0xa'));var as=require(_0xf153('0xb'));var pdf=require(_0xf153('0xc'));var logger=require('../../config/logger')(_0xf153('0xd'));var config=require(_0xf153('0xe'));var db=require(_0xf153('0xf'))['db'];config[_0xf153('0x10')]=_[_0xf153('0x11')](config[_0xf153('0x10')],{'host':_0xf153('0x12'),'port':0x18eb});var socket=require(_0xf153('0x13'))(new Redis(config[_0xf153('0x10')]));require(_0xf153('0x14'))['register'](socket);var jayson=require(_0xf153('0x15'));var client=jayson[_0xf153('0x16')][_0xf153('0x17')]({'port':0x232b});var client9004=jayson['client'][_0xf153('0x17')]({'port':0x232c});function respondWithRpcPromise(_0x292f89,_0x65756d,_0x1cc666,_0x256b7d){return new BPromise(function(_0x107d31,_0x3f915c){var _0x1d54c4=_0x256b7d||client;return _0x1d54c4[_0xf153('0x18')](_0x292f89,_0x1cc666)['then'](function(_0x18be7e){logger[_0xf153('0x19')](_0xf153('0x1a'),_0x65756d,_0xf153('0x1b'));logger[_0xf153('0x1c')](_0xf153('0x1d'),_0x65756d,_0xf153('0x1b'),JSON[_0xf153('0x1e')](_0x18be7e));if(_0x18be7e['error']){if(_0x18be7e[_0xf153('0x1f')]['code']===0x1f4){logger[_0xf153('0x1f')](_0xf153('0x1a'),_0x65756d,_0x18be7e[_0xf153('0x1f')][_0xf153('0x20')]);return _0x3f915c(_0x18be7e['error'][_0xf153('0x20')]);}logger[_0xf153('0x1f')](_0xf153('0x1a'),_0x65756d,_0x18be7e[_0xf153('0x1f')][_0xf153('0x20')]);return _0x107d31(_0x18be7e[_0xf153('0x1f')][_0xf153('0x20')]);}else{logger[_0xf153('0x19')](_0xf153('0x1a'),_0x65756d,_0xf153('0x1b'));_0x107d31(_0x18be7e[_0xf153('0x21')][_0xf153('0x20')]);}})['catch'](function(_0xcd5762){logger[_0xf153('0x1f')](_0xf153('0x1a'),_0x65756d,_0xcd5762);_0x3f915c(_0xcd5762);});});}function respondWithStatusCode(_0x32e759,_0x5c9f44){_0x5c9f44=_0x5c9f44||0xcc;return function(_0x3e94b5){if(_0x3e94b5){return _0x32e759[_0xf153('0x22')](_0x5c9f44);}return _0x32e759[_0xf153('0x23')](_0x5c9f44)[_0xf153('0x24')]();};}function respondWithResult(_0x38190c,_0x1570fc){_0x1570fc=_0x1570fc||0xc8;return function(_0x39f3ed){if(_0x39f3ed){return _0x38190c[_0xf153('0x23')](_0x1570fc)[_0xf153('0x25')](_0x39f3ed);}};}function respondWithFilteredResult(_0xe490f8,_0x35f9da){return function(_0x141ef4){if(_0x141ef4){var _0x703adb=typeof _0x35f9da[_0xf153('0x26')]===_0xf153('0x27')&&typeof _0x35f9da['limit']===_0xf153('0x27');var _0x3f1c6f=_0x141ef4['count'];var _0x16cdcd=_0x703adb?0x0:_0x35f9da[_0xf153('0x26')];var _0x4e45f9=_0x703adb?_0x141ef4[_0xf153('0x28')]:_0x35f9da[_0xf153('0x26')]+_0x35f9da[_0xf153('0x29')];var _0x2b9a9c;if(_0x4e45f9>=_0x3f1c6f){_0x4e45f9=_0x3f1c6f;_0x2b9a9c=0xc8;}else{_0x2b9a9c=0xce;}_0xe490f8[_0xf153('0x23')](_0x2b9a9c);return _0xe490f8[_0xf153('0x2a')](_0xf153('0x2b'),_0x16cdcd+'-'+_0x4e45f9+'/'+_0x3f1c6f)[_0xf153('0x25')](_0x141ef4);}return null;};}function saveUpdates(_0x19a568){return function(_0x8e31bf){if(_0x8e31bf){return _0x8e31bf[_0xf153('0x2c')](_0x19a568)[_0xf153('0x2d')](function(_0x5b5237){return _0x5b5237;});}return null;};}function removeEntity(_0x258fb0){return function(_0xbb3619){if(_0xbb3619){return _0xbb3619[_0xf153('0x2e')]()[_0xf153('0x2d')](function(){_0x258fb0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28433d){return function(_0x4c6ea0){if(!_0x4c6ea0){_0x28433d['sendStatus'](0x194);}return _0x4c6ea0;};}function handleError(_0x2473d0,_0x4ab958){_0x4ab958=_0x4ab958||0x1f4;return function(_0x2b9623){logger['error'](_0x2b9623[_0xf153('0x2f')]);if(_0x2b9623[_0xf153('0x30')]){delete _0x2b9623['name'];}_0x2473d0[_0xf153('0x23')](_0x4ab958)[_0xf153('0x31')](_0x2b9623);};}function getMustacheRender(_0x538069,_0x40be52){return Mustache[_0xf153('0x32')](_0x538069,_[_0xf153('0x33')](_0x40be52['body'],{'contact':_0x40be52[_0xf153('0x34')],'message':_0x40be52['message'],'agent':_0x40be52[_0xf153('0x35')],'interaction':_0x40be52[_0xf153('0x36')],'account':_0x40be52[_0xf153('0x37')]}))||'';}function getInteractionUsers(_0x1820c3,_0x274bcc){return new BPromise(function(_0x284fe8,_0x4becf3){try{if(_0x274bcc[_0x1820c3['id']]){_0x1820c3[_0xf153('0x38')]=_[_0xf153('0x39')](_0x274bcc[_0x1820c3['id']],function(_0x332809){return{'id':_0x332809['id'],'fullname':_0x332809['fullname']};});}}catch(_0x244172){_0x4becf3(_0x244172);}_0x284fe8(_0x1820c3);});}function getInteractionTags(_0x17d60c,_0xd2a763){return new BPromise(function(_0x254692,_0x36c5cd){try{if(_0x17d60c[_0xf153('0x3a')]){_0x17d60c['Tags']=[];_0x17d60c[_0xf153('0x3a')][_0xf153('0x3b')](',')['forEach'](function(_0x14b2e3){_0x17d60c[_0xf153('0x3c')][_0xf153('0x3d')](_0xd2a763[_0x14b2e3]);});}delete _0x17d60c[_0xf153('0x3a')];}catch(_0x103b91){_0x36c5cd(_0x103b91);}_0x254692(_0x17d60c);});}function updateChatInteraction(_0x42360a,_0xef1510,_0x4d90c1){return new BPromise(function(_0x355131,_0x2f63d6){return getInteractionUsers(_0x42360a,_0x4d90c1)[_0xf153('0x2d')](function(_0x352e7c){return getInteractionTags(_0x352e7c,_0xef1510);})[_0xf153('0x2d')](function(_0x1ee606){return getStateInteraction(_0x1ee606);})['then'](function(_0x4b108e){_0x355131(_0x4b108e);})[_0xf153('0x3e')](function(_0x5051f3){_0x2f63d6(_0x5051f3);});});}function getStateInteraction(_0x46dd09){return new BPromise(function(_0x36c456){_0x46dd09[_0xf153('0x3f')]=0x0;_0x46dd09[_0xf153('0x40')]=0x0;_0x46dd09[_0xf153('0x41')]=0x0;_0x46dd09[_0xf153('0x42')]=0x0;_0x46dd09['abandoned']=0x0;_0x46dd09['total']=0x0;if(!_0x46dd09[_0xf153('0x43')]&&!_0x46dd09[_0xf153('0x44')]){_0x46dd09['waiting']+=0x1;}if(!_0x46dd09[_0xf153('0x43')]&&_0x46dd09[_0xf153('0x44')]){_0x46dd09[_0xf153('0x40')]+=0x1;if(_0x46dd09[_0xf153('0x3f')]){_0x46dd09[_0xf153('0x3f')]-=0x1;}}if(_0x46dd09[_0xf153('0x43')]&&_0x46dd09[_0xf153('0x45')]===_0xf153('0x46')){_0x46dd09[_0xf153('0x46')]+=0x1;if(_0x46dd09[_0xf153('0x3f')]){_0x46dd09[_0xf153('0x3f')]-=0x1;}}else if(_0x46dd09[_0xf153('0x43')]&&!_0x46dd09['UserId']&&_0x46dd09[_0xf153('0x45')]){_0x46dd09[_0xf153('0x42')]+=0x1;if(_0x46dd09[_0xf153('0x3f')]){_0x46dd09['waiting']-=0x1;}}else if(_0x46dd09[_0xf153('0x43')]&&_0x46dd09[_0xf153('0x44')]){_0x46dd09['answered']+=0x1;if(_0x46dd09[_0xf153('0x40')]){_0x46dd09['talking']-=0x1;}}_0x46dd09[_0xf153('0x47')]+=0x1;_0x36c456(_0x46dd09);});}exports[_0xf153('0x48')]=function(_0x17fb10,_0x550d45){var _0x1f540b={},_0x209048={},_0x1426eb={'count':0x0,'rows':[]};var _0x1bece2=_[_0xf153('0x39')](db['ChatInteraction'][_0xf153('0x49')],function(_0x3bc265){return{'name':_0x3bc265['fieldName'],'type':_0x3bc265[_0xf153('0x4a')][_0xf153('0x4b')]};});_0x209048[_0xf153('0x4c')]=_['map'](_0x1bece2,_0xf153('0x30'));_0x209048[_0xf153('0x4d')]=_[_0xf153('0x4e')](_0x17fb10[_0xf153('0x4d')]);_0x209048[_0xf153('0x4f')]=_[_0xf153('0x50')](_0x209048[_0xf153('0x4c')],_0x209048[_0xf153('0x4d')]);_0x1f540b[_0xf153('0x51')]=_['intersection'](_0x209048[_0xf153('0x4c')],qs['fields'](_0x17fb10['query']['fields']));_0x1f540b[_0xf153('0x51')]=_0x1f540b[_0xf153('0x51')]['length']?_0x1f540b[_0xf153('0x51')]:_0x209048[_0xf153('0x4c')];if(!_0x17fb10['query'][_0xf153('0x52')](_0xf153('0x53'))){_0x1f540b[_0xf153('0x29')]=qs[_0xf153('0x29')](_0x17fb10[_0xf153('0x4d')][_0xf153('0x29')]);_0x1f540b['offset']=qs[_0xf153('0x26')](_0x17fb10[_0xf153('0x4d')]['offset']);}_0x1f540b['order']=qs[_0xf153('0x54')](_0x17fb10[_0xf153('0x4d')][_0xf153('0x54')]);_0x1f540b[_0xf153('0x55')]=qs[_0xf153('0x4f')](_[_0xf153('0x56')](_0x17fb10['query'],_0x209048[_0xf153('0x4f')]),_0x1bece2);var _0x51d813=[];var _0x340aba=squel[_0xf153('0x57')]()[_0xf153('0x58')]('id')['field'](_0xf153('0x30'))[_0xf153('0x58')](_0xf153('0x59'))[_0xf153('0x5a')](_0xf153('0x5b'));var _0x18d0ce=squel[_0xf153('0x57')]()['field'](_0xf153('0x5c'))[_0xf153('0x58')](_0xf153('0x5d'))['field'](_0xf153('0x5e'))[_0xf153('0x5a')](_0xf153('0x5f'),'ui')[_0xf153('0x60')](_0xf153('0x61'),'u',_0xf153('0x62'));var _0x245124=squel[_0xf153('0x57')]()['from'](_0xf153('0x63'),'i')[_0xf153('0x60')]('cm_contacts','c',_0xf153('0x64'))[_0xf153('0x60')](_0xf153('0x61'),'o',_0xf153('0x65'))[_0xf153('0x60')](_0xf153('0x66'),'a',_0xf153('0x67'))[_0xf153('0x60')](_0xf153('0x68'),'me',_0xf153('0x69'))[_0xf153('0x60')]('chat_interaction_has_tags','it',_0xf153('0x6a'))[_0xf153('0x60')]('tools_tags','t',_0xf153('0x6b'));var _0x25e66e=squel[_0xf153('0x6c')]();var _0x147d3a=[];var _0x603892=squel[_0xf153('0x6c')]();var _0x2736e3;if(_0x17fb10['query'][_0xf153('0x6d')]){_0x2736e3=as[_0xf153('0x6e')](_0x17fb10[_0xf153('0x4d')][_0xf153('0x6d')]);var _0x17f58d=_0x2736e3[_0xf153('0x6f')];for(var _0x19ec0b=0x0;_0x19ec0b<_0x2736e3[_0xf153('0x70')][_0xf153('0x71')];_0x19ec0b++){var _0x4c9157=_0x2736e3[_0xf153('0x70')][_0x19ec0b];var _0x433566='i';var _0x4afdc4=_[_0xf153('0x72')](_0x1bece2,['name',_0x4c9157[_0xf153('0x58')]]);if(!_0x4afdc4){switch(_0x4c9157[_0xf153('0x58')]){case'unreadMessages':if(_0x4c9157[_0xf153('0x73')]==0x1){_0x245124['having']('`'+_0x4c9157[_0xf153('0x58')]+_0xf153('0x74'));}else{_0x245124[_0xf153('0x75')]('`'+_0x4c9157[_0xf153('0x58')]+'`\x20>\x200');}break;case _0xf153('0x76'):if(_0x4c9157[_0xf153('0x77')]==='$substring'){if(_0x4c9157[_0xf153('0x73')][_0xf153('0x3b')]('\x20')[_0xf153('0x71')]>0x1){_0x25e66e[_0x17f58d](_0xf153('0x78'),qs[_0xf153('0x79')](_0x4c9157['value']),null);}else{var _0xf4a542='%'+_0x4c9157['value']+'%';_0x25e66e[_0x17f58d](_0xf153('0x7a'),_0xf4a542,_0xf4a542,_0xf4a542);}}else{_0x4afdc4=_[_0xf153('0x72')](_0x1bece2,['name','ContactId']);_0x4c9157[_0xf153('0x58')]=_0xf153('0x7b');_0x44da13=as['buildExpression'](_0x433566,_0x4afdc4[_0xf153('0x4a')],_0x4c9157);_0x25e66e[_0x17f58d](_0x44da13[_0xf153('0x7c')],_0x44da13[_0xf153('0x73')]['start'],_0x44da13[_0xf153('0x73')][_0xf153('0x24')]);}break;case _0xf153('0x7d'):var _0x1e5e95=_0x4c9157[_0xf153('0x73')][_0xf153('0x3b')](',')[_0xf153('0x39')](function(_0x364957){return Number(_0x364957);});_0x1e5e95[_0xf153('0x7e')](function(_0x858289){_0x603892['or'](_0xf153('0x7f'),'%,'+_0x858289+',%');});_0x147d3a=_[_0xf153('0x80')](_0x147d3a,_0x1e5e95);break;case _0xf153('0x81'):if(_0x4c9157[_0xf153('0x77')]===_0xf153('0x82')){_0x25e66e[_0x17f58d](_0xf153('0x83'),'%'+_0x4c9157['value']+'%',null);}else{_0x4afdc4=_[_0xf153('0x72')](_0x1bece2,['name','UserId']);_0x4c9157[_0xf153('0x58')]='UserId';_0x44da13=as[_0xf153('0x84')](_0x433566,_0x4afdc4[_0xf153('0x4a')],_0x4c9157);_0x25e66e[_0x17f58d](_0x44da13[_0xf153('0x7c')],_0x44da13[_0xf153('0x73')][_0xf153('0x85')],_0x44da13[_0xf153('0x73')]['end']);}break;case _0xf153('0x86'):_0x44da13=as[_0xf153('0x84')]('me',null,_0x4c9157);_0x25e66e[_0x17f58d](_0x44da13[_0xf153('0x7c')],_0x44da13['value']['start'],_0x44da13[_0xf153('0x73')][_0xf153('0x24')]);break;}}else{var _0x44da13=as['buildExpression'](_0x433566,_0x4afdc4[_0xf153('0x4a')],_0x4c9157);_0x25e66e[_0x17f58d](_0x44da13['text'],_0x44da13['value'][_0xf153('0x85')],_0x44da13[_0xf153('0x73')][_0xf153('0x24')]);}}}else{var _0x583dbf=_(_0x17fb10[_0xf153('0x4d')])[_0xf153('0x4e')]()['map'](function(_0x193c8c){return _[_0xf153('0x87')](_0x1bece2,[_0xf153('0x30'),_0x193c8c])?_0x193c8c:undefined;})[_0xf153('0x88')]()[_0xf153('0x73')]();if(!_['isEmpty'](_0x583dbf)){_0x583dbf[_0xf153('0x7e')](function(_0xf791a1){if(_0xf791a1===_0xf153('0x89')){_0x245124[_0xf153('0x55')](_0xf153('0x8a'),[][_0xf153('0x8b')](_0x17fb10[_0xf153('0x4d')][_0xf791a1]));}else if(_0xf791a1==='createdAt'){var _0x756f52=JSON[_0xf153('0x8c')](_0x17fb10[_0xf153('0x4d')][_0xf791a1])[_0xf153('0x8d')];var _0x269102=JSON[_0xf153('0x8c')](_0x17fb10['query'][_0xf791a1])[_0xf153('0x8e')];_0x245124[_0xf153('0x55')](_0xf153('0x8f'),_0x756f52,_0x269102);}else{if(_0x17fb10[_0xf153('0x4d')][_0xf791a1]===_0xf153('0x90')){_0x245124[_0xf153('0x55')]('i.'+_0xf791a1+_0xf153('0x91'));}else{_0x245124[_0xf153('0x55')]('i.'+_0xf791a1+_0xf153('0x92'),_0x17fb10[_0xf153('0x4d')][_0xf791a1]);}}});}if(_0x17fb10['query']['read']){if(_0x17fb10['query']['read']==0x1){_0x245124[_0xf153('0x75')](_0xf153('0x93'));}else{_0x245124[_0xf153('0x75')](_0xf153('0x94'));}}if(_0x17fb10[_0xf153('0x4d')]['tag']){_0x147d3a=_[_0xf153('0x95')](_0x17fb10[_0xf153('0x4d')][_0xf153('0x96')])?_0x17fb10[_0xf153('0x4d')]['tag']:new Array(_0x17fb10[_0xf153('0x4d')][_0xf153('0x96')]);_0x147d3a[_0xf153('0x7e')](function(_0x4a5f54){_0x603892['or'](_0xf153('0x7f'),'%,'+_0x4a5f54+',%');});}if(_0x17fb10['query'][_0xf153('0x97')]){var _0x25ab76=_0x17fb10[_0xf153('0x4d')]['filter']['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xf153('0x98')](_0x25ab76)){_0x25e66e['or'](_0xf153('0x99'),_0x25ab76+'%');}else{_0x25e66e['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x25ab76))['or'](_0xf153('0x9a'),_0x25ab76+'%');}}}_0x245124['where'](_0x25e66e);_0x245124[_0xf153('0x9b')]('i.id');var _0xb3632c={'type':db[_0xf153('0x9c')][_0xf153('0x9d')][_0xf153('0x9e')],'raw':!![]};var _0x303dcf=_0x245124[_0xf153('0x9f')]();_0x303dcf['field'](_0xf153('0xa0'));_0x303dcf[_0xf153('0x58')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf153('0xa1'));if(_0x1f540b[_0xf153('0xa2')]){_0x1f540b[_0xf153('0xa2')][_0xf153('0x7e')](function(_0x5c6ac2){var _0x3e36fc=_0x5c6ac2[0x0]===_0xf153('0xa3')?_0x5c6ac2[0x0]:'i.'+_0x5c6ac2[0x0];_0x245124['order'](_0x3e36fc,_0x5c6ac2[0x1]===_0xf153('0xa4')?![]:!![]);});}if(!_[_0xf153('0xa5')](_0x147d3a)){_0x245124[_0xf153('0x75')](_0x603892);_0x303dcf[_0xf153('0x55')]('t.id\x20IN\x20?',_0x147d3a);}BPromise[_0xf153('0xa6')]()[_0xf153('0x2d')](function(){if(!_0x2736e3){if(_0x17fb10[_0xf153('0x4d')][_0xf153('0x89')])return;_0x303dcf[_0xf153('0x55')](_0xf153('0xa7'));_0x245124[_0xf153('0x55')](_0xf153('0xa7'));return;}if(_0x17fb10[_0xf153('0xa8')]['role']!==_0xf153('0x35'))return;return _0x17fb10[_0xf153('0xa8')][_0xf153('0xa9')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4d24b5){if(_[_0xf153('0xa5')](_0x4d24b5)){_0x303dcf['where'](_0xf153('0xaa'));_0x245124[_0xf153('0x55')](_0xf153('0xaa'));}else{_0x303dcf['where']('i.ChatWebsiteId\x20IN\x20?',_[_0xf153('0x39')](_0x4d24b5,'id'));_0x245124[_0xf153('0x55')](_0xf153('0x8a'),_['map'](_0x4d24b5,'id'));}});})[_0xf153('0x2d')](function(){if(_0x17fb10[_0xf153('0xa8')][_0xf153('0xab')]===_0xf153('0x35')&&!_0x2736e3&&!_0x17fb10[_0xf153('0x4d')][_0xf153('0x89')])return[];return db[_0xf153('0xac')][_0xf153('0x4d')](_0x303dcf[_0xf153('0xad')](),_0xb3632c);})[_0xf153('0x2d')](function(_0x347859){_0x1426eb[_0xf153('0x28')]=_0x347859[_0xf153('0x71')];if(_0x1426eb['count']===0x0)return[];return db[_0xf153('0xac')][_0xf153('0x4d')](_0x340aba[_0xf153('0xad')](),_0xb3632c)['then'](function(_0x573032){_0x51d813=_[_0xf153('0xae')](_0x573032,'id');_0xb3632c=_['merge'](_0xb3632c,{'model':db[_0xf153('0xaf')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x17fb10[_0xf153('0x4d')]['fields']){_0x1f540b[_0xf153('0x51')][_0xf153('0x7e')](function(_0x3b0b94){_0x245124[_0xf153('0x58')]('i.'+_0x3b0b94);});}else{_0x245124[_0xf153('0x58')](_0xf153('0xb0'),_0xf153('0xa1'));_0x245124[_0xf153('0x58')]('a.key',_0xf153('0xb1'));_0x245124[_0xf153('0x58')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x245124[_0xf153('0x58')]('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');_0x245124[_0xf153('0x58')](_0xf153('0xb2'));_0x245124['field'](_0xf153('0xb3'),_0xf153('0xb4'));_0x245124[_0xf153('0x58')](_0xf153('0xb5'),_0xf153('0xb6'));_0x245124[_0xf153('0x58')](_0xf153('0xb7'),_0xf153('0xb8'));_0x245124[_0xf153('0x58')]('c.phone',_0xf153('0xb9'));_0x245124['field'](_0xf153('0xba'),'Contact.mobile');_0x245124[_0xf153('0x58')]('c.fax','Contact.fax');_0x245124[_0xf153('0x58')]('o.fullname',_0xf153('0xbb'));_0x245124[_0xf153('0x58')]('o.internal','Owner.internal');_0x245124[_0xf153('0x58')](_0xf153('0xbc'),_0xf153('0x3a'));}if(_0x1f540b['limit'])_0x245124[_0xf153('0x29')](_0x1f540b[_0xf153('0x29')]);if(_0x1f540b[_0xf153('0x26')])_0x245124[_0xf153('0x26')](_0x1f540b['offset']);return db[_0xf153('0xac')][_0xf153('0x4d')](_0x245124[_0xf153('0xad')](),_0xb3632c);})[_0xf153('0x2d')](function(_0x1022c5){if(_0x1022c5[_0xf153('0x71')]>0x0)_0x18d0ce[_0xf153('0x55')](_0xf153('0xbd'),_[_0xf153('0x39')](_0x1022c5,'id'));return db[_0xf153('0xac')][_0xf153('0x4d')](_0x18d0ce[_0xf153('0xad')](),_0xb3632c)['then'](function(_0x1aebab){var _0x192708=_['groupBy'](_0x1aebab,_0xf153('0xbe'));var _0x4525e1=[];_0x1022c5[_0xf153('0x7e')](function(_0x449f8d){_0x4525e1[_0xf153('0x3d')](updateChatInteraction(_0x449f8d,_0x51d813,_0x192708));});return BPromise['all'](_0x4525e1);});});})[_0xf153('0x2d')](function(_0xa13662){_0x1426eb[_0xf153('0xbf')]=_0xa13662;return _0x1426eb;})[_0xf153('0x2d')](respondWithFilteredResult(_0x550d45,_0x1f540b))[_0xf153('0x3e')](handleError(_0x550d45,null));};exports[_0xf153('0xc0')]=function(_0x2e55f4,_0x1098b7){var _0x29d492={'raw':![],'where':{'id':_0x2e55f4[_0xf153('0xc1')]['id']}},_0x3f7938={};_0x3f7938[_0xf153('0x4c')]=_[_0xf153('0x4e')](db[_0xf153('0xaf')][_0xf153('0x49')]);_0x3f7938['query']=_[_0xf153('0x4e')](_0x2e55f4[_0xf153('0x4d')]);_0x3f7938[_0xf153('0x4f')]=_[_0xf153('0x50')](_0x3f7938[_0xf153('0x4c')],_0x3f7938[_0xf153('0x4d')]);_0x29d492[_0xf153('0x51')]=_[_0xf153('0x50')](_0x3f7938['model'],qs[_0xf153('0xc2')](_0x2e55f4[_0xf153('0x4d')][_0xf153('0xc2')]));_0x29d492[_0xf153('0x51')]=_0x29d492[_0xf153('0x51')]['length']?_0x29d492[_0xf153('0x51')]:_0x3f7938[_0xf153('0x4c')];if(_0x2e55f4[_0xf153('0x4d')][_0xf153('0xc3')]){_0x29d492['include']=[{'all':!![]}];}_0x29d492=_['merge']({},_0x29d492,_0x2e55f4[_0xf153('0xc4')]);return db[_0xf153('0xaf')]['find'](_0x29d492)['then'](handleEntityNotFound(_0x1098b7,null))[_0xf153('0x2d')](respondWithResult(_0x1098b7,null))[_0xf153('0x3e')](handleError(_0x1098b7,null));};exports[_0xf153('0xc5')]=function(_0x339e9e,_0x31a019){return db[_0xf153('0xaf')][_0xf153('0xc5')](_0x339e9e[_0xf153('0x86')],{})[_0xf153('0x2d')](respondWithResult(_0x31a019,0xc9))['catch'](handleError(_0x31a019,null));};exports[_0xf153('0x2c')]=function(_0x110f72,_0x527cce){if(_0x110f72[_0xf153('0x86')]['id']){delete _0x110f72[_0xf153('0x86')]['id'];}return db[_0xf153('0xaf')][_0xf153('0x72')]({'where':{'id':_0x110f72['params']['id']}})['then'](handleEntityNotFound(_0x527cce,null))[_0xf153('0x2d')](saveUpdates(_0x110f72[_0xf153('0x86')],null))[_0xf153('0x2d')](respondWithResult(_0x527cce,null))['catch'](handleError(_0x527cce,null));};exports[_0xf153('0x2e')]=function(_0x45c835,_0x3ca774){return db[_0xf153('0xaf')][_0xf153('0x72')]({'where':{'id':_0x45c835[_0xf153('0xc1')]['id']}})[_0xf153('0x2d')](handleEntityNotFound(_0x3ca774,null))['then'](removeEntity(_0x3ca774,null))[_0xf153('0x3e')](handleError(_0x3ca774,null));};exports[_0xf153('0xc6')]=function(_0x3451e9,_0x3af786){return db[_0xf153('0xaf')][_0xf153('0xc6')]()[_0xf153('0x2d')](respondWithResult(_0x3af786,null))[_0xf153('0x3e')](handleError(_0x3af786,null));};exports[_0xf153('0xc7')]=function(_0x53eee4,_0x2dd1d8){var _0x2c3f76=_0x53eee4[_0xf153('0xc1')]['id'];var _0x374ba4;var _0x1b4f50;var _0x40c1d1;return db['ChatInteraction'][_0xf153('0xc8')]({'where':{'id':_0x2c3f76}})[_0xf153('0x2d')](function(_0x8711eb){_0x374ba4=_0x8711eb;return db[_0xf153('0xc9')]['findOne']({'where':{'id':_0x8711eb[_0xf153('0x89')]},'attributes':['id',_0xf153('0xca'),_0xf153('0xcb'),_0xf153('0xcc'),_0xf153('0xcd'),'vidaooMetadata'],'raw':!![]});})[_0xf153('0x2d')](function(_0x2e908a){if(_0x2e908a&&_0x2e908a['vidaooApiKey']&&_0x2e908a[_0xf153('0xcb')]){_0x1b4f50=_0x2e908a;var _0x57d320={'interaction':{'id':_0x2c3f76},'agent':{'id':_0x53eee4[_0xf153('0xa8')]['id'],'name':_0x53eee4[_0xf153('0xa8')][_0xf153('0x30')],'fullname':_0x53eee4[_0xf153('0xa8')]['fullname'],'email':_0x53eee4[_0xf153('0xa8')][_0xf153('0xce')]},'contact':_0x53eee4['body'][_0xf153('0x34')],'account':_0x53eee4['body'][_0xf153('0x37')]};var _0x30ae3c={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x2e908a['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x53eee4[_0xf153('0xa8')][_0xf153('0xce')]],'buttons':null,'topic':_0x1b4f50['vidaooTopic'],'note':_[_0xf153('0xcf')](_0x1b4f50[_0xf153('0xcd')])?null:getMustacheRender(_0x1b4f50['vidaooNote'],_0x57d320),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xf153('0xcf')](_0x1b4f50[_0xf153('0xd0')])){var _0x32971d=getMustacheRender(_0x1b4f50[_0xf153('0xd0')],_0x57d320);var _0x1a4825=JSON[_0xf153('0x8c')](_0x32971d);_0x30ae3c[_0xf153('0x86')][_0xf153('0xd1')]=_0x1a4825;}}catch(_0xb03f70){throw new db[(_0xf153('0x9c'))]['ValidationError'](_0xf153('0xd2'));}return rp(_0x30ae3c);}else{throw new db['Sequelize']['ValidationError'](_0xf153('0xd3'));}})[_0xf153('0x2d')](function(_0x264968){_0x40c1d1=_0x264968;if(_0x40c1d1['id']){var _0xe61167={'body':_0x40c1d1['join_url'],'ChatWebsiteId':_0x1b4f50['id'],'ChatInteractionId':_0x374ba4['id'],'direction':_0xf153('0xd4'),'UserId':_0x53eee4['user']['id']};return db[_0xf153('0xd5')][_0xf153('0xc5')](_0xe61167,{});}else{throw new db[(_0xf153('0x9c'))]['ValidationError'](_0xf153('0xd6'));}})[_0xf153('0x2d')](function(){return _0x374ba4['updateAttributes']({'vidaooSessionId':_0x40c1d1['id']});})[_0xf153('0x2d')](respondWithResult(_0x2dd1d8,null))['catch'](handleError(_0x2dd1d8,null));};exports[_0xf153('0xd7')]=function(_0x1ba174,_0xab67b7){if(_0x1ba174['body']['id']){delete _0x1ba174['body']['id'];}return db[_0xf153('0xaf')]['find']({'where':{'id':_0x1ba174[_0xf153('0xc1')]['id']},'include':[{'model':db[_0xf153('0xd8')],'as':_0xf153('0x76')}]})[_0xf153('0x2d')](handleEntityNotFound(_0xab67b7,null))[_0xf153('0x2d')](saveUpdates(_0x1ba174[_0xf153('0x86')],null))[_0xf153('0x2d')](respondWithResult(_0xab67b7,null))[_0xf153('0x3e')](handleError(_0xab67b7,null));};exports[_0xf153('0xd9')]=function(_0x40ade6,_0x1a9bfb){if(_0x40ade6[_0xf153('0x86')]['id']){delete _0x40ade6[_0xf153('0x86')]['id'];}return db[_0xf153('0xaf')][_0xf153('0x72')]({'where':{'id':_0x40ade6[_0xf153('0xc1')]['id']}})[_0xf153('0x2d')](function(_0x50dd96){if(!_0x50dd96){logger[_0xf153('0x1f')](_0xf153('0xda'),_0xf153('0xd9'),0x194,'entity\x20not\x20found');_0x1a9bfb[_0xf153('0x22')](0x194);}else{if(_0x50dd96[_0xf153('0x44')]){throw new db[(_0xf153('0x9c'))]['ValidationError'](_0xf153('0xdb'));}}return _0x50dd96;})[_0xf153('0x2d')](function(_0xeebd4f){if(_0xeebd4f){return _0xeebd4f[_0xf153('0x2c')]({'closed':_0x40ade6[_0xf153('0x86')]['closed'],'disposition':_0x40ade6[_0xf153('0x86')]['disposition']})[_0xf153('0x2d')](function(_0x4fe273){return _0x4fe273;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction',_0xf153('0xd9'),_0x40ade6['body'],client9004);})[_0xf153('0x2d')](respondWithResult(_0x1a9bfb,null))['catch'](handleError(_0x1a9bfb,null));};exports[_0xf153('0xdc')]=function(_0x25543b,_0x3c1ae6){_0x25543b[_0xf153('0x86')]['name']=_0x25543b[_0xf153('0xdd')][_0xf153('0xde')];_0x25543b['body'][_0xf153('0xdf')]=_0x25543b[_0xf153('0xdd')][_0xf153('0xe0')];_0x25543b[_0xf153('0x86')][_0xf153('0x4a')]=_0x25543b[_0xf153('0xdd')][_0xf153('0xe1')];return db['Attachment'][_0xf153('0xc5')](_0x25543b[_0xf153('0x86')])[_0xf153('0x2d')](respondWithResult(_0x3c1ae6,0xc9))[_0xf153('0x3e')](handleError(_0x3c1ae6,null));};exports[_0xf153('0xe2')]=function(_0x2c8401,_0x41ef70){return db['ChatInteraction'][_0xf153('0xc8')]({'where':{'id':_0x2c8401[_0xf153('0xc1')]['id']},'raw':!![]})[_0xf153('0x2d')](handleEntityNotFound(_0x41ef70,null))[_0xf153('0x2d')](function(_0x283f9e){if(_0x283f9e){if(_0x283f9e['closed']){return _0x41ef70['status'](0x193)[_0xf153('0x25')]({'status':0x193,'message':_0xf153('0xe3')});}return db['Attachment'][_0xf153('0xc8')]({'where':{'id':_0x2c8401[_0xf153('0x4d')][_0xf153('0xe4')]},'raw':!![]})['then'](handleEntityNotFound(_0x41ef70,null));}})['then'](function(_0x13b7e2){if(_0x13b7e2){var _0x25222f=_0x13b7e2[_0xf153('0xe5')]!==null;var _0x4b2cdd=path[_0xf153('0xe6')](config[_0xf153('0xe7')],_0xf153('0xe8'));if(_0x25222f){_0x4b2cdd=path[_0xf153('0xe6')](_0x4b2cdd,_0xf153('0xe9'));}var _0x1ac5ff=path[_0xf153('0xe6')](_0x4b2cdd,_0x13b7e2[_0xf153('0xdf')]);return _0x41ef70[_0xf153('0xea')](_0x1ac5ff);}})[_0xf153('0x3e')](handleError(_0x41ef70,null));};exports[_0xf153('0xeb')]=function(_0x126535,_0x392c8e){var _0x203143=null;var _0x173f12=null;var _0x1f8794=null;if(_0x126535[_0xf153('0x86')]['id']){delete _0x126535[_0xf153('0x86')]['id'];}if(_0x126535['body'][_0xf153('0xec')]){_0x1f8794=path['join'](config[_0xf153('0xe7')],_0xf153('0xed'),util['format']('transcript-%s.txt',Date['now']()));_0x126535[_0xf153('0x86')][_0xf153('0xee')]=_0x1f8794;}return db[_0xf153('0xaf')][_0xf153('0x72')]({'where':{'id':_0x126535['params']['id']},'include':[{'model':db[_0xf153('0xd5')],'as':_0xf153('0xef'),'include':[{'model':db[_0xf153('0x81')],'as':_0xf153('0x81')}]}]})[_0xf153('0x2d')](handleEntityNotFound(_0x392c8e,null))[_0xf153('0x2d')](saveUpdates(_0x126535[_0xf153('0x86')],null))[_0xf153('0x2d')](function(_0x4c2b50){if(_0x4c2b50){_0x203143=_0x4c2b50;return db[_0xf153('0xc9')][_0xf153('0x72')]({'where':{'id':_0x203143['ChatWebsiteId']}});}})['then'](function(_0x3021e6){if(_0x3021e6){_0x173f12=_0x3021e6;return db[_0xf153('0xd8')]['find']({'where':{'id':_0x203143[_0xf153('0x7b')]}});}})['then'](function(_0x3057f1){if(_0x3057f1){if(_0x1f8794){var _0x207255=null;for(var _0xd8cd84=0x1;_0xd8cd84<_0x203143[_0xf153('0xef')][_0xf153('0x71')];++_0xd8cd84){_0x207255=_0x203143['Messages'][_0xd8cd84];var _0xb4dbdd=_0x207255['UserId']?util['format'](_0xf153('0xf0'),_0x173f12[_0xf153('0xf1')],_0x207255[_0xf153('0x44')]):_0xf153('0xf2');var _0x5b1a91=_0x126535[_0xf153('0x86')][_0xf153('0xf3')]||util[_0xf153('0xf4')](_0xf153('0xf0'),_0xf153('0xf5'),_0x207255[_0xf153('0x7b')]);switch(_0x173f12[_0xf153('0xf6')]){case _0xf153('0xf7'):_0xb4dbdd=_0x207255['UserId']?util[_0xf153('0xf4')](_0xf153('0xf0'),_0x173f12[_0xf153('0xf1')],_0x207255[_0xf153('0x44')]):_0xf153('0xf2');break;case _0xf153('0xf8'):_0xb4dbdd=_0x207255[_0xf153('0x44')]?_0x207255[_0xf153('0x81')][_0xf153('0xf9')]||_0x207255[_0xf153('0x81')][_0xf153('0xfa')]:_0xf153('0xf2');break;case'agent_fullname':_0xb4dbdd=_0x207255[_0xf153('0x44')]?_0x207255[_0xf153('0x81')]['fullname']:_0xf153('0xf2');break;default:_0xb4dbdd=_0x207255[_0xf153('0x44')]?util[_0xf153('0xf4')](_0xf153('0xf0'),_0x173f12[_0xf153('0xf1')],_0x207255[_0xf153('0x44')]):_0xf153('0xf2');}var _0x4b8d5c=util[_0xf153('0xf4')](_0xf153('0xfb'),moment(_0x207255[_0xf153('0xfc')])[_0xf153('0xf4')]('MM/DD/YYYY\x20HH:mm:ss'),_0x207255[_0xf153('0xfd')]==='in'?_0x5b1a91:_0xb4dbdd,_0x207255[_0xf153('0x86')]);if(!_0x207255['secret']){fs[_0xf153('0xfe')](_0x1f8794,_0x4b8d5c);}}return db['MailAccount'][_0xf153('0xc8')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xf153('0xff'),'raw':!![],'include':[{'model':db[_0xf153('0x100')],'as':_0xf153('0x100'),'raw':!![]}]}]});}}})[_0xf153('0x2d')](function(_0x5a8d13){if(!_0x5a8d13||!_0x5a8d13[_0xf153('0xff')]||!_0x126535['body'])return _0x203143;var _0x21285e=_0x5a8d13[_0xf153('0x101')]();return respondWithRpcPromise(_0xf153('0x102'),_0xf153('0x103'),{'account':_0x21285e,'message':{'from':util[_0xf153('0xf4')](_0xf153('0x104'),_0x5a8d13['name'],_0x5a8d13[_0xf153('0xce')]||_0x5a8d13['Smtp'][_0xf153('0xa8')]),'to':_0x126535['body'][_0xf153('0xec')],'subject':_0xf153('0x105'),'text':util[_0xf153('0xf4')](_0xf153('0x106'),_0x126535['body'][_0xf153('0xec')]),'attachments':[{'path':_0x1f8794}]}})['then'](function(){return _0x203143;})[_0xf153('0x3e')](function(_0x5c32d1){logger[_0xf153('0x1f')](_0x5c32d1);});})[_0xf153('0x2d')](respondWithStatusCode(_0x392c8e,0xc8))[_0xf153('0x3e')](handleError(_0x392c8e,null));};exports[_0xf153('0x107')]=function(_0x273b03,_0x3165e5){return db[_0xf153('0xd5')][_0xf153('0x72')]({'where':{'id':_0x273b03['params']['id']}})[_0xf153('0x2d')](handleEntityNotFound(_0x3165e5,null))[_0xf153('0x2d')](function(_0x48c9e4){if(_0x48c9e4){return _0x48c9e4[_0xf153('0x107')](_0x273b03[_0xf153('0x86')][_0xf153('0x108')],_[_0xf153('0x109')](_0x273b03[_0xf153('0x86')],[_0xf153('0x108'),'id'])||{});}})[_0xf153('0x2d')](respondWithResult(_0x3165e5,null))['catch'](handleError(_0x3165e5,null));};exports['getMessages']=function(_0x550c10,_0x3e8153){var _0x1fb83a={'raw':![],'where':{}};var _0x10f948={};var _0x5cc922={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf153('0xc8')]({'where':{'id':_0x550c10['params']['id']}})[_0xf153('0x2d')](handleEntityNotFound(_0x3e8153,null))[_0xf153('0x2d')](function(_0x21a1c9){if(_0x21a1c9){_0x10f948[_0xf153('0x4c')]=_[_0xf153('0x4e')](db['ChatMessage'][_0xf153('0x49')]);_0x10f948[_0xf153('0x4d')]=_[_0xf153('0x4e')](_0x550c10['query']);_0x10f948[_0xf153('0x4f')]=_[_0xf153('0x50')](_0x10f948[_0xf153('0x4c')],_0x10f948[_0xf153('0x4d')]);_0x1fb83a[_0xf153('0x51')]=_[_0xf153('0x50')](_0x10f948[_0xf153('0x4c')],qs[_0xf153('0xc2')](_0x550c10[_0xf153('0x4d')][_0xf153('0xc2')]));_0x1fb83a[_0xf153('0x51')]=_0x1fb83a[_0xf153('0x51')][_0xf153('0x71')]?_0x1fb83a[_0xf153('0x51')]:_0x10f948[_0xf153('0x4c')];if(!_0x550c10[_0xf153('0x4d')][_0xf153('0x52')]('nolimit')){_0x1fb83a[_0xf153('0x29')]=qs[_0xf153('0x29')](_0x550c10[_0xf153('0x4d')][_0xf153('0x29')]);_0x1fb83a['offset']=qs[_0xf153('0x26')](_0x550c10[_0xf153('0x4d')][_0xf153('0x26')]);}_0x1fb83a[_0xf153('0xa2')]=qs[_0xf153('0x54')](_0x550c10[_0xf153('0x4d')]['sort']);_0x1fb83a[_0xf153('0x55')]=qs[_0xf153('0x4f')](_['pick'](_0x550c10[_0xf153('0x4d')],_0x10f948[_0xf153('0x4f')]));_0x1fb83a[_0xf153('0x55')][_0xf153('0xbe')]=_0x21a1c9['id'];if(_0x550c10[_0xf153('0x4d')][_0xf153('0x97')]){_0x1fb83a[_0xf153('0x55')]=_[_0xf153('0x33')](_0x1fb83a[_0xf153('0x55')],{'$or':_[_0xf153('0x39')](_0x1fb83a[_0xf153('0x51')],function(_0x4538be){var _0x63ad32={};_0x63ad32[_0x4538be]={'$like':'%'+_0x550c10['query'][_0xf153('0x97')]+'%'};return _0x63ad32;})});}if(_0x550c10[_0xf153('0x4d')][_0xf153('0x8d')]){var _0x9503e=_0x550c10[_0xf153('0x4d')][_0xf153('0x8d')]['split'](',');var _0x49ea9a={};_0x49ea9a[_0x9503e[0x0]]={'$gte':moment(_0x9503e[0x1])[_0xf153('0xf4')](_0xf153('0x10a'))};_0x1fb83a[_0xf153('0x55')]=_['merge'](_0x1fb83a[_0xf153('0x55')],_0x49ea9a);}_0x1fb83a=_[_0xf153('0x33')]({},_0x1fb83a,_0x550c10[_0xf153('0xc4')]);return db[_0xf153('0xd5')][_0xf153('0x28')]({'where':_0x1fb83a[_0xf153('0x55')]})[_0xf153('0x2d')](function(_0x921b52){_0x5cc922['count']=_0x921b52;if(_0x550c10['query'][_0xf153('0xc3')]){_0x1fb83a[_0xf153('0x10b')]=[{'all':!![]}];}return db[_0xf153('0xd5')][_0xf153('0x10c')](_0x1fb83a);})[_0xf153('0x2d')](function(_0x577fc7){_0x5cc922[_0xf153('0xbf')]=_0x577fc7;return _0x5cc922;});}})[_0xf153('0x2d')](respondWithFilteredResult(_0x3e8153,_0x1fb83a))[_0xf153('0x3e')](handleError(_0x3e8153,null));};exports[_0xf153('0x10d')]=function(_0x283af8,_0x58be79){var _0x1d0d1a={'where':{}},_0x5397a8={},_0x466386={'count':0x0,'rows':[]};return db[_0xf153('0xaf')][_0xf153('0xc8')]({'where':{'id':_0x283af8[_0xf153('0xc1')]['id']}})[_0xf153('0x2d')](handleEntityNotFound(_0x58be79,null))['then'](function(_0x5efd23){if(_0x5efd23){_0x5397a8[_0xf153('0x4c')]=_[_0xf153('0x4e')](db[_0xf153('0xd5')][_0xf153('0x49')]);_0x5397a8[_0xf153('0x4d')]=_[_0xf153('0x4e')](_0x283af8[_0xf153('0x4d')]);_0x5397a8[_0xf153('0x4f')]=_[_0xf153('0x50')](_0x5397a8[_0xf153('0x4c')],_0x5397a8[_0xf153('0x4d')]);_0x1d0d1a[_0xf153('0x51')]=_[_0xf153('0x50')](_0x5397a8[_0xf153('0x4c')],qs[_0xf153('0xc2')](_0x283af8[_0xf153('0x4d')][_0xf153('0xc2')]));_0x1d0d1a[_0xf153('0x51')]=_0x1d0d1a[_0xf153('0x51')][_0xf153('0x71')]?_0x1d0d1a[_0xf153('0x51')]:_0x5397a8[_0xf153('0x4c')];if(!_0x283af8['query']['hasOwnProperty'](_0xf153('0x53'))){_0x1d0d1a[_0xf153('0x29')]=qs[_0xf153('0x29')](_0x283af8['query'][_0xf153('0x29')]);_0x1d0d1a[_0xf153('0x26')]=qs[_0xf153('0x26')](_0x283af8['query'][_0xf153('0x26')]);}_0x1d0d1a[_0xf153('0xa2')]=qs[_0xf153('0x54')](_0x283af8[_0xf153('0x4d')]['sort']);_0x1d0d1a[_0xf153('0x55')]=qs['filters'](_[_0xf153('0x56')](_0x283af8[_0xf153('0x4d')],_0x5397a8[_0xf153('0x4f')]));_0x1d0d1a[_0xf153('0x55')]['ChatInteractionId']=_0x5efd23['id'];if(_0x283af8[_0xf153('0x4d')]['filter']){_0x1d0d1a[_0xf153('0x55')]=_[_0xf153('0x33')](_0x1d0d1a[_0xf153('0x55')],{'$or':_[_0xf153('0x39')](_0x1d0d1a[_0xf153('0x51')],function(_0x397ee2){var _0x17e62e={};_0x17e62e[_0x397ee2]={'$like':'%'+_0x283af8[_0xf153('0x4d')][_0xf153('0x97')]+'%'};return _0x17e62e;})});}_0x1d0d1a['where']['secret']=![];if(_0x283af8[_0xf153('0x4d')]['id']){_0x1d0d1a[_0xf153('0x55')]['id']={'$gt':_0x283af8[_0xf153('0x4d')]['id']};}_0x1d0d1a=_['merge']({},_0x1d0d1a,_0x283af8[_0xf153('0xc4')]);return db[_0xf153('0xd5')][_0xf153('0x28')]({'where':_0x1d0d1a['where']})[_0xf153('0x2d')](function(_0x100f48){_0x466386[_0xf153('0x28')]=_0x100f48;_0x1d0d1a[_0xf153('0x10b')]=[];if(_0x283af8['query']['includeAgent']){_0x1d0d1a[_0xf153('0x10b')][_0xf153('0x3d')]({'model':db[_0xf153('0x81')],'as':_0xf153('0x81'),'attributes':['id','fullname',_0xf153('0xf9')]});}if(_0x283af8[_0xf153('0x4d')][_0xf153('0xc3')]){_0x1d0d1a[_0xf153('0x10b')]=[{'all':!![]}];}return db[_0xf153('0xd5')][_0xf153('0x10c')](_0x1d0d1a);})[_0xf153('0x2d')](function(_0x3a94c5){_0x466386[_0xf153('0xbf')]=_0x3a94c5;return _0x466386;});}})[_0xf153('0x2d')](respondWithFilteredResult(_0x58be79,_0x1d0d1a))['catch'](handleError(_0x58be79,null));};exports['addTags']=function(_0x11997d,_0x74943){return db[_0xf153('0xaf')]['find']({'where':{'id':_0x11997d[_0xf153('0xc1')]['id']}})[_0xf153('0x2d')](handleEntityNotFound(_0x74943,null))['then'](function(_0x3f7eb6){if(_0x3f7eb6){return _0x3f7eb6[_0xf153('0x10e')](_0x11997d['body']['ids'],_[_0xf153('0x109')](_0x11997d['body'],[_0xf153('0x108'),'id'])||{})[_0xf153('0x10f')](function(){return db[_0xf153('0x7d')]['findAll']({'attributes':['id',_0xf153('0x30'),_0xf153('0x59')],'where':{'id':_0x11997d['body'][_0xf153('0x108')]}});})['then'](function(_0x5742a6){socket[_0xf153('0x110')](_0xf153('0x111'),{'id':Number(_0x11997d[_0xf153('0xc1')]['id']),'tags':_0x5742a6||[]});return{'id':Number(_0x11997d[_0xf153('0xc1')]['id']),'tags':_0x5742a6||[]};});}})[_0xf153('0x2d')](respondWithResult(_0x74943,null))[_0xf153('0x3e')](handleError(_0x74943,null));};exports['removeTags']=function(_0x9d9d65,_0x301675){return db[_0xf153('0xaf')][_0xf153('0x72')]({'where':{'id':_0x9d9d65[_0xf153('0xc1')]['id']}})[_0xf153('0x2d')](handleEntityNotFound(_0x301675,null))[_0xf153('0x2d')](function(_0x4a5c86){if(_0x4a5c86){return _0x4a5c86['removeTags'](_0x9d9d65[_0xf153('0x4d')][_0xf153('0x108')]);}})['then'](respondWithStatusCode(_0x301675,null))[_0xf153('0x3e')](handleError(_0x301675,null));};exports[_0xf153('0xea')]=function(_0x252e74,_0x48f9ff){var _0x2180ec=moment()[_0xf153('0x112')]()[_0xf153('0xad')]();var _0x265407=path[_0xf153('0xe6')](config[_0xf153('0xe7')],_0xf153('0x113'),_0xf153('0x114'),_0xf153('0x115'));var _0x2a39ae=path[_0xf153('0xe6')](config['root'],_0xf153('0x113'),_0xf153('0x114'),_0xf153('0x116'));var _0x154c3c=path[_0xf153('0xe6')](_0x265407,_0x2180ec);var _0x5b9c=util[_0xf153('0xf4')](_0xf153('0x117'),_0x252e74[_0xf153('0xc1')]['id'],_0x2180ec);var _0x304d66=path['join'](_0x265407,_0x5b9c);var _0x444f68=[];_0x444f68[_0xf153('0x3d')]({'model':db[_0xf153('0x81')],'as':_0xf153('0x81'),'attributes':['id',_0xf153('0xfa')],'raw':!![]});_0x444f68[_0xf153('0x3d')]({'model':db[_0xf153('0xd8')],'as':_0xf153('0x76'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x252e74[_0xf153('0x4d')]['attachments']){_0x444f68[_0xf153('0x3d')]({'model':db[_0xf153('0x118')],'as':_0xf153('0x118'),'raw':!![]});}var _0x3d553d=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id',_0xf153('0x86'),_0xf153('0xfc'),_0xf153('0xfd'),_0xf153('0x119'),_0xf153('0x11a')],'include':_0x444f68}];_0x3d553d[_0xf153('0x3d')]({'model':db[_0xf153('0xc9')],'as':_0xf153('0x11b'),'attributes':['id',_0xf153('0x30')]});_0x3d553d[_0xf153('0x3d')]({'model':db[_0xf153('0x81')],'as':_0xf153('0x11c'),'attributes':['id',_0xf153('0xfa')]});return db[_0xf153('0xaf')]['find']({'where':{'id':_0x252e74[_0xf153('0xc1')]['id']},'include':_0x3d553d})[_0xf153('0x2d')](handleEntityNotFound(_0x48f9ff,null))[_0xf153('0x2d')](function(_0xf53fc6){if(_0xf53fc6){var _0x45112b=_0xf53fc6[_0xf153('0x11d')]({'plain':!![]});fs[_0xf153('0x11e')](_0x154c3c);var _0x1435bd={'channel':_0xf153('0x11f'),'account':_0x45112b[_0xf153('0x11b')]['name'],'agent':_0x45112b[_0xf153('0x11c')]?_0x45112b[_0xf153('0x11c')][_0xf153('0xfa')]:_0xf153('0x120'),'createdAt':moment(_0x45112b['createdAt'])[_0xf153('0xf4')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x45112b['closed']?moment(_0x45112b['closedAt'])[_0xf153('0xf4')](_0xf153('0x10a'))[_0xf153('0xad')]():'','disposition':_0x45112b[_0xf153('0x45')],'chatInfo':{'browser':_0x45112b[_0xf153('0x121')],'os':_0x45112b['osName'],'referer':_0x45112b[_0xf153('0x122')],'customerIp':_0x45112b[_0xf153('0x123')],'customerPort':_0x45112b['customerPort']?_0x45112b[_0xf153('0x124')]:_0xf153('0x120')},'messages':_(_0x45112b['Messages'])[_0xf153('0x125')]()['filter']({'secret':![]})[_0xf153('0x39')](function(_0x5aa0bf){if(_0x5aa0bf[_0xf153('0x118')]){var _0x5ec77c=path[_0xf153('0xe6')](_0x2a39ae,_0x5aa0bf[_0xf153('0x118')][_0xf153('0xdf')]);if(fs[_0xf153('0x126')](_0x5ec77c)){fs[_0xf153('0x127')](_0x5ec77c)['pipe'](fs[_0xf153('0x128')](path[_0xf153('0xe6')](_0x154c3c,_0x5aa0bf[_0xf153('0x118')][_0xf153('0xdf')])));}}return{'date':moment(_0x5aa0bf['createdAt'])[_0xf153('0xf4')](_0xf153('0x10a'))[_0xf153('0xad')](),'sender':_0x5aa0bf[_0xf153('0xfd')]===_0xf153('0xd4')?_0x5aa0bf['User']?_0x5aa0bf[_0xf153('0x81')][_0xf153('0xfa')]:_0xf153('0xf2'):_0x5aa0bf[_0xf153('0x76')]['firstName']+(_0x5aa0bf[_0xf153('0x76')][_0xf153('0x129')]?'\x20'+_0x5aa0bf[_0xf153('0x76')][_0xf153('0x129')]:''),'body':_0x5aa0bf[_0xf153('0x118')]?_0x5aa0bf['Attachment'][_0xf153('0xdf')]:_0x5aa0bf[_0xf153('0x86')],'direction':_0x5aa0bf[_0xf153('0xfd')]===_0xf153('0xd4')?'A':'C','secret':_0x5aa0bf[_0xf153('0x119')],'read':_0x5aa0bf[_0xf153('0x11a')],'attachment':_0x5aa0bf['Attachment']};})['value']()};return ejs[_0xf153('0x12a')](path[_0xf153('0xe6')](config[_0xf153('0xe7')],_0xf153('0x113'),_0xf153('0x12b'),'downloadInteraction.ejs'),{'interaction':_0x1435bd})[_0xf153('0x2d')](function(_0x415d13){var _0xb2f8e0=path[_0xf153('0xe6')](_0x154c3c,_0xf153('0x12c')+_0x45112b['id']+'-'+_0x2180ec+'.pdf');var _0x3b6a0e={'path':_0xb2f8e0,'channel':_0xf153('0x11f'),'interactionId':_0x45112b['id']};return pdf['createPdfFromHTML'](_0x415d13,_0x3b6a0e);})[_0xf153('0x2d')](function(){return new Promise(function(_0x19de76,_0x5912d8){zipdir(_0x154c3c,{'saveTo':_0x304d66},function(_0x426db4,_0x52677c){if(_0x426db4)return _0x5912d8(_0x426db4);return _0x19de76(_0x52677c);});})[_0xf153('0x2d')](function(){return new BPromise(function(_0x200d37,_0x393d95){rimraf(_0x154c3c,function(_0x30a638){if(_0x30a638)_0x393d95(_0x30a638);return _0x200d37();});});})[_0xf153('0x2d')](function(){return _0x48f9ff['download'](_0x304d66,_0x5b9c,function(_0x416a91){if(_0x416a91){logger['error'](_0xf153('0x12d'),_0x416a91);}else{fs[_0xf153('0x12e')](_0x304d66);}});});});}else{return _0x48f9ff[_0xf153('0x22')](0xc8);}})[_0xf153('0x3e')](handleError(_0x48f9ff,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 5e3d279..127db86 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 _0xb80f=['../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','length','emit','hasOwnProperty','hook','exports'];(function(_0x5771a1,_0x3939ef){var _0x5a3ffe=function(_0x59bc39){while(--_0x59bc39){_0x5771a1['push'](_0x5771a1['shift']());}};_0x5a3ffe(++_0x3939ef);}(_0xb80f,0x190));var _0xfb80=function(_0x4f3957,_0x2dbe4b){_0x4f3957=_0x4f3957-0x0;var _0x44816c=_0xb80f[_0x4f3957];return _0x44816c;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xfb80('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0xfb80('0x0'))['db'][_0xfb80('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xfb80('0x2')](0x0);var events={'afterCreate':_0xfb80('0x3'),'afterUpdate':_0xfb80('0x4'),'afterDestroy':_0xfb80('0x5')};function emitEvent(_0x40367f){return function(_0x5c63c4,_0x18d0af,_0x290846){_0x5c63c4[_0xfb80('0x6')]({'attributes':['id'],'raw':!![]})[_0xfb80('0x7')](function(_0x31e8cb){_0x5c63c4[_0xfb80('0x8')](_0xfb80('0x9'),_0x31e8cb['map'](function(_0x3c5f4d){return{'id':_0x3c5f4d['id']};}));return ChatMessage[_0xfb80('0xa')]({'where':{'ChatInteractionId':_0x5c63c4['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfb80('0x7')](function(_0x58ee4e){_0x5c63c4[_0xfb80('0x8')]('unreadMessages',_0x58ee4e[_0xfb80('0xb')]);ChatInteractionEvents[_0xfb80('0xc')](_0x40367f+':'+_0x5c63c4['id'],_0x5c63c4);ChatInteractionEvents['emit'](_0x40367f,_0x5c63c4);_0x290846(null);})['catch'](_0x290846(null));};}for(var e in events){if(events[_0xfb80('0xd')](e)){var event=events[e];ChatInteraction[_0xfb80('0xe')](e,emitEvent(event));}}module[_0xfb80('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xeb87=['then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hook','exports','events','ChatMessage','update','remove'];(function(_0x502598,_0x1e95c8){var _0xbdee21=function(_0x140feb){while(--_0x140feb){_0x502598['push'](_0x502598['shift']());}};_0xbdee21(++_0x1e95c8);}(_0xeb87,0xc0));var _0x7eb8=function(_0xe617cc,_0x59ded5){_0xe617cc=_0xe617cc-0x0;var _0x3d1c51=_0xeb87[_0xe617cc];return _0x3d1c51;};'use strict';var EventEmitter=require(_0x7eb8('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0x7eb8('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7eb8('0x2'),'afterDestroy':_0x7eb8('0x3')};function emitEvent(_0x4baa3d){return function(_0x5182a8,_0x18463e,_0x4c7915){_0x5182a8['getUsers']({'attributes':['id'],'raw':!![]})[_0x7eb8('0x4')](function(_0x4a5ea4){_0x5182a8[_0x7eb8('0x5')]('Users',_0x4a5ea4[_0x7eb8('0x6')](function(_0x3ad5eb){return{'id':_0x3ad5eb['id']};}));return ChatMessage[_0x7eb8('0x7')]({'where':{'ChatInteractionId':_0x5182a8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7eb8('0x4')](function(_0x899fe0){_0x5182a8[_0x7eb8('0x5')](_0x7eb8('0x8'),_0x899fe0[_0x7eb8('0x9')]);ChatInteractionEvents[_0x7eb8('0xa')](_0x4baa3d+':'+_0x5182a8['id'],_0x5182a8);ChatInteractionEvents[_0x7eb8('0xa')](_0x4baa3d,_0x5182a8);_0x4c7915(null);})[_0x7eb8('0xb')](_0x4c7915(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x7eb8('0xc')](e,emitEvent(event));}}module[_0x7eb8('0xd')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 97ff98b..c74b4f2 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 _0x2cd8=['closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','chat_interactions','closed'];(function(_0x319b23,_0x2bc213){var _0x3542a6=function(_0x1c6c51){while(--_0x1c6c51){_0x319b23['push'](_0x319b23['shift']());}};_0x3542a6(++_0x2bc213);}(_0x2cd8,0xc7));var _0x82cd=function(_0xcf60a,_0x460780){_0xcf60a=_0xcf60a-0x0;var _0x8f76f=_0x2cd8[_0xcf60a];return _0x8f76f;};'use strict';var _=require(_0x82cd('0x0'));var util=require('util');var logger=require(_0x82cd('0x1'))(_0x82cd('0x2'));var moment=require(_0x82cd('0x3'));var BPromise=require('bluebird');var rp=require(_0x82cd('0x4'));var fs=require('fs');var path=require(_0x82cd('0x5'));var rimraf=require(_0x82cd('0x6'));var config=require(_0x82cd('0x7'));var attributes=require('./chatInteraction.attributes');module[_0x82cd('0x8')]=function(_0x4ce5e3,_0x2c8cc2){return _0x4ce5e3['define']('ChatInteraction',attributes,{'tableName':_0x82cd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1e3042,_0x2e4d50,_0x2194cd){if(_0x1e3042['changed'](_0x82cd('0xa'))){_0x1e3042[_0x82cd('0xb')]=moment()['format'](_0x82cd('0xc'));}_0x2194cd(null,_0x1e3042);}},'charset':_0x82cd('0xd'),'collate':_0x82cd('0xe')});};
\ No newline at end of file
+var _0xa160=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','exports','chat_interactions','changed'];(function(_0x48d8c4,_0x1556e6){var _0x36c652=function(_0x4fb0ad){while(--_0x4fb0ad){_0x48d8c4['push'](_0x48d8c4['shift']());}};_0x36c652(++_0x1556e6);}(_0xa160,0xb6));var _0x0a16=function(_0x1c529b,_0x17dc54){_0x1c529b=_0x1c529b-0x0;var _0x5e64ca=_0xa160[_0x1c529b];return _0x5e64ca;};'use strict';var _=require(_0x0a16('0x0'));var util=require(_0x0a16('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0a16('0x2'));var rp=require(_0x0a16('0x3'));var fs=require('fs');var path=require(_0x0a16('0x4'));var rimraf=require(_0x0a16('0x5'));var config=require(_0x0a16('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x0a16('0x7')]=function(_0x3b5e69,_0x42c030){return _0x3b5e69['define']('ChatInteraction',attributes,{'tableName':_0x0a16('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x116e7b,_0x45697a,_0x4edfb4){if(_0x116e7b[_0x0a16('0x9')](_0x0a16('0xa'))){_0x116e7b[_0x0a16('0xb')]=moment()[_0x0a16('0xc')](_0x0a16('0xd'));}_0x4edfb4(null,_0x116e7b);}},'charset':_0x0a16('0xe'),'collate':_0x0a16('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 210d487..48dfde8 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 _0x5103=['find','addTags','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ChatInteraction','update','body','options','raw','where','UpdateChatInteraction'];(function(_0x20d732,_0x3bfac8){var _0x462538=function(_0x56623d){while(--_0x56623d){_0x20d732['push'](_0x20d732['shift']());}};_0x462538(++_0x3bfac8);}(_0x5103,0x1a7));var _0x3510=function(_0x3ba0a5,_0x26ff89){_0x3ba0a5=_0x3ba0a5-0x0;var _0x58765e=_0x5103[_0x3ba0a5];return _0x58765e;};'use strict';var _=require(_0x3510('0x0'));var util=require(_0x3510('0x1'));var moment=require('moment');var BPromise=require(_0x3510('0x2'));var rs=require(_0x3510('0x3'));var fs=require('fs');var Redis=require(_0x3510('0x4'));var db=require(_0x3510('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x3510('0x6'));var jayson=require(_0x3510('0x7'));var client=jayson[_0x3510('0x8')][_0x3510('0x9')]({'port':0x232a});config[_0x3510('0xa')]=_[_0x3510('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3510('0xc'))(new Redis(config[_0x3510('0xa')]));require(_0x3510('0xd'))['register'](socket);function respondWithRpcPromise(_0x481398,_0x17584b,_0x35719f){return new BPromise(function(_0x135a22,_0x32bc86){return client[_0x3510('0xe')](_0x481398,_0x35719f)[_0x3510('0xf')](function(_0x4fd7ee){logger[_0x3510('0x10')](_0x3510('0x11'),_0x17584b,'request\x20sent');logger[_0x3510('0x12')](_0x3510('0x13'),_0x17584b,_0x3510('0x14'),JSON[_0x3510('0x15')](_0x4fd7ee));if(_0x4fd7ee[_0x3510('0x16')]){if(_0x4fd7ee['error'][_0x3510('0x17')]===0x1f4){logger[_0x3510('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x17584b,_0x4fd7ee[_0x3510('0x16')][_0x3510('0x18')]);return _0x32bc86(_0x4fd7ee[_0x3510('0x16')][_0x3510('0x18')]);}logger[_0x3510('0x16')](_0x3510('0x11'),_0x17584b,_0x4fd7ee['error'][_0x3510('0x18')]);return _0x135a22(_0x4fd7ee[_0x3510('0x16')][_0x3510('0x18')]);}else{logger[_0x3510('0x10')](_0x3510('0x11'),_0x17584b,_0x3510('0x14'));_0x135a22(_0x4fd7ee['result'][_0x3510('0x18')]);}})[_0x3510('0x19')](function(_0x313555){logger[_0x3510('0x16')](_0x3510('0x11'),_0x17584b,_0x313555);_0x32bc86(_0x313555);});});}exports['UpdateChatInteraction']=function(_0x53102b){var _0x20fcc8=this;return new Promise(function(_0x32dd6b,_0x24d593){return db[_0x3510('0x1a')][_0x3510('0x1b')](_0x53102b[_0x3510('0x1c')],{'raw':_0x53102b[_0x3510('0x1d')]?_0x53102b['options'][_0x3510('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53102b['options']?_0x53102b[_0x3510('0x1d')][_0x3510('0x1f')]||null:null,'attributes':_0x53102b[_0x3510('0x1d')]?_0x53102b['options']['attributes']||null:null,'limit':_0x53102b['options']?_0x53102b[_0x3510('0x1d')]['limit']||null:null})[_0x3510('0xf')](function(_0x278947){logger['info']('UpdateChatInteraction',_0x53102b);logger[_0x3510('0x12')]('UpdateChatInteraction',_0x53102b,JSON['stringify'](_0x278947));_0x32dd6b(_0x278947);})[_0x3510('0x19')](function(_0x221b29){logger[_0x3510('0x16')](_0x3510('0x20'),_0x221b29[_0x3510('0x18')],_0x53102b);_0x24d593(_0x20fcc8['error'](0x1f4,_0x221b29['message']));});});};exports['AddTagsToChatInteraction']=function(_0x3911d9){return new Promise(function(_0xbc0d18,_0x41e708){return db[_0x3510('0x1a')][_0x3510('0x21')]({'where':_0x3911d9[_0x3510('0x1d')]?_0x3911d9[_0x3510('0x1d')][_0x3510('0x1f')]||null:null})[_0x3510('0xf')](function(_0x34a7cf){if(_0x34a7cf){return _0x34a7cf[_0x3510('0x22')](_0x3911d9[_0x3510('0x1c')][_0x3510('0x23')],_['omit'](_0x3911d9[_0x3510('0x1c')],[_0x3510('0x23'),'id'])||{});}})[_0x3510('0x24')](function(_0x115d17){logger['info'](_0x3510('0x25'),_0x3911d9);logger[_0x3510('0x12')](_0x3510('0x25'),_0x3911d9,JSON['stringify'](_0x115d17));_0xbc0d18(_0x115d17);})[_0x3510('0x19')](function(_0x4af225){logger[_0x3510('0x16')](_0x3510('0x25'),_0x4af225['message'],_0x3911d9);_0x41e708(_this[_0x3510('0x16')](0x1f4,_0x4af225['message']));});});};
\ No newline at end of file
+var _0x1d98=['ids','omit','spread','AddTags','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','body','options','where','limit','AddTagsToChatInteraction','find','addTags'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d98,0x1bd));var _0x81d9=function(_0x4e3be8,_0x194867){_0x4e3be8=_0x4e3be8-0x0;var _0x496611=_0x1d98[_0x4e3be8];return _0x496611;};'use strict';var _=require(_0x81d9('0x0'));var util=require(_0x81d9('0x1'));var moment=require(_0x81d9('0x2'));var BPromise=require('bluebird');var rs=require(_0x81d9('0x3'));var fs=require('fs');var Redis=require(_0x81d9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x81d9('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x81d9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x81d9('0x7')][_0x81d9('0x8')]({'port':0x232a});config[_0x81d9('0x9')]=_[_0x81d9('0xa')](config[_0x81d9('0x9')],{'host':_0x81d9('0xb'),'port':0x18eb});var socket=require(_0x81d9('0xc'))(new Redis(config[_0x81d9('0x9')]));require(_0x81d9('0xd'))['register'](socket);function respondWithRpcPromise(_0x9b5238,_0x2d0577,_0x5e60c6){return new BPromise(function(_0x5cb3b3,_0x88ae91){return client[_0x81d9('0xe')](_0x9b5238,_0x5e60c6)[_0x81d9('0xf')](function(_0x4b4efb){logger[_0x81d9('0x10')](_0x81d9('0x11'),_0x2d0577,_0x81d9('0x12'));logger[_0x81d9('0x13')](_0x81d9('0x14'),_0x2d0577,_0x81d9('0x12'),JSON[_0x81d9('0x15')](_0x4b4efb));if(_0x4b4efb[_0x81d9('0x16')]){if(_0x4b4efb[_0x81d9('0x16')][_0x81d9('0x17')]===0x1f4){logger[_0x81d9('0x16')](_0x81d9('0x11'),_0x2d0577,_0x4b4efb['error'][_0x81d9('0x18')]);return _0x88ae91(_0x4b4efb[_0x81d9('0x16')][_0x81d9('0x18')]);}logger['error'](_0x81d9('0x11'),_0x2d0577,_0x4b4efb[_0x81d9('0x16')]['message']);return _0x5cb3b3(_0x4b4efb['error'][_0x81d9('0x18')]);}else{logger[_0x81d9('0x10')](_0x81d9('0x11'),_0x2d0577,'request\x20sent');_0x5cb3b3(_0x4b4efb[_0x81d9('0x19')][_0x81d9('0x18')]);}})['catch'](function(_0x5640ad){logger['error'](_0x81d9('0x11'),_0x2d0577,_0x5640ad);_0x88ae91(_0x5640ad);});});}exports[_0x81d9('0x1a')]=function(_0xb8b52){var _0x14bfd3=this;return new Promise(function(_0x5302dd,_0x1fed45){return db[_0x81d9('0x1b')]['update'](_0xb8b52[_0x81d9('0x1c')],{'raw':_0xb8b52[_0x81d9('0x1d')]?_0xb8b52['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb8b52['options']?_0xb8b52[_0x81d9('0x1d')][_0x81d9('0x1e')]||null:null,'attributes':_0xb8b52[_0x81d9('0x1d')]?_0xb8b52[_0x81d9('0x1d')]['attributes']||null:null,'limit':_0xb8b52[_0x81d9('0x1d')]?_0xb8b52[_0x81d9('0x1d')][_0x81d9('0x1f')]||null:null})['then'](function(_0x3d7fc2){logger[_0x81d9('0x10')](_0x81d9('0x1a'),_0xb8b52);logger['debug'](_0x81d9('0x1a'),_0xb8b52,JSON[_0x81d9('0x15')](_0x3d7fc2));_0x5302dd(_0x3d7fc2);})['catch'](function(_0x40e1bb){logger[_0x81d9('0x16')](_0x81d9('0x1a'),_0x40e1bb[_0x81d9('0x18')],_0xb8b52);_0x1fed45(_0x14bfd3[_0x81d9('0x16')](0x1f4,_0x40e1bb[_0x81d9('0x18')]));});});};exports[_0x81d9('0x20')]=function(_0x34701e){return new Promise(function(_0x2bc672,_0x41e6cc){return db[_0x81d9('0x1b')][_0x81d9('0x21')]({'where':_0x34701e[_0x81d9('0x1d')]?_0x34701e[_0x81d9('0x1d')][_0x81d9('0x1e')]||null:null})[_0x81d9('0xf')](function(_0x294c28){if(_0x294c28){return _0x294c28[_0x81d9('0x22')](_0x34701e['body'][_0x81d9('0x23')],_[_0x81d9('0x24')](_0x34701e[_0x81d9('0x1c')],[_0x81d9('0x23'),'id'])||{});}})[_0x81d9('0x25')](function(_0x37e2e2){logger[_0x81d9('0x10')]('AddTags',_0x34701e);logger[_0x81d9('0x13')](_0x81d9('0x26'),_0x34701e,JSON[_0x81d9('0x15')](_0x37e2e2));_0x2bc672(_0x37e2e2);})[_0x81d9('0x27')](function(_0x6eec96){logger[_0x81d9('0x16')](_0x81d9('0x26'),_0x6eec96[_0x81d9('0x18')],_0x34701e);_0x41e6cc(_this[_0x81d9('0x16')](0x1f4,_0x6eec96['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 073cb6b..ca41b1d 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 _0x863a=['removeListener','register','chatInteraction:','save','remove'];(function(_0xf700f9,_0x590be3){var _0x41f335=function(_0x159979){while(--_0x159979){_0xf700f9['push'](_0xf700f9['shift']());}};_0x41f335(++_0x590be3);}(_0x863a,0x107));var _0xa863=function(_0x44de7a,_0x3c7ace){_0x44de7a=_0x44de7a-0x0;var _0x4111fb=_0x863a[_0x44de7a];return _0x4111fb;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xa863('0x0'),_0xa863('0x1'),'update'];function createListener(_0x3b959e,_0x4cc094){return function(_0x5e2ebc){_0x4cc094['emit'](_0x3b959e,_0x5e2ebc);};}function removeListener(_0x5333b0,_0x4549c0){return function(){ChatInteractionEvents[_0xa863('0x2')](_0x5333b0,_0x4549c0);};}exports[_0xa863('0x3')]=function(_0x1d820e){for(var _0x366868=0x0,_0x4ff995=events['length'];_0x366868<_0x4ff995;_0x366868++){var _0x1318dd=events[_0x366868];var _0x100722=createListener(_0xa863('0x4')+_0x1318dd,_0x1d820e);ChatInteractionEvents['on'](_0x1318dd,_0x100722);}};
\ No newline at end of file
+var _0x0922=['./chatInteraction.events','remove','update','emit','removeListener','register','length','chatInteraction:'];(function(_0x16a52e,_0xc67a21){var _0x2397e2=function(_0x5201ae){while(--_0x5201ae){_0x16a52e['push'](_0x16a52e['shift']());}};_0x2397e2(++_0xc67a21);}(_0x0922,0x90));var _0x2092=function(_0x1ff575,_0xdba21f){_0x1ff575=_0x1ff575-0x0;var _0x48fc9e=_0x0922[_0x1ff575];return _0x48fc9e;};'use strict';var ChatInteractionEvents=require(_0x2092('0x0'));var events=['save',_0x2092('0x1'),_0x2092('0x2')];function createListener(_0x5347d4,_0x1a3c12){return function(_0x1fe6d5){_0x1a3c12[_0x2092('0x3')](_0x5347d4,_0x1fe6d5);};}function removeListener(_0x29bab6,_0x3c9776){return function(){ChatInteractionEvents[_0x2092('0x4')](_0x29bab6,_0x3c9776);};}exports[_0x2092('0x5')]=function(_0x19f3f6){for(var _0xbf44b6=0x0,_0x16a6a2=events[_0x2092('0x6')];_0xbf44b6<_0x16a6a2;_0xbf44b6++){var _0x2349a3=events[_0xbf44b6];var _0x330a3f=createListener(_0x2092('0x7')+_0x2349a3,_0x19f3f6);ChatInteractionEvents['on'](_0x2349a3,_0x330a3f);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index d0a5d0e..3aeae88 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 _0xa8c6=['isChatInteractionAuthorized','getMyMessages','/:id/download','download','post','create','createVidaooSession','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','/:id/messages','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','/:id/custom_update','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','attachmentDownload','/:id/my_messages'];(function(_0x1bc1b7,_0x316155){var _0x4e29a8=function(_0x5e3a47){while(--_0x5e3a47){_0x1bc1b7['push'](_0x1bc1b7['shift']());}};_0x4e29a8(++_0x316155);}(_0xa8c6,0x142));var _0x6a8c=function(_0x4ef1a9,_0x59a5fa){_0x4ef1a9=_0x4ef1a9-0x0;var _0x23f201=_0xa8c6[_0x4ef1a9];return _0x23f201;};'use strict';var multer=require(_0x6a8c('0x0'));var util=require(_0x6a8c('0x1'));var path=require(_0x6a8c('0x2'));var timeout=require('connect-timeout');var express=require(_0x6a8c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6a8c('0x4'));var config=require(_0x6a8c('0x5'));var controller=require('./chatInteraction.controller');router[_0x6a8c('0x6')]('/',auth[_0x6a8c('0x7')](),controller[_0x6a8c('0x8')]);router['get'](_0x6a8c('0x9'),auth['isAuthenticated'](),controller[_0x6a8c('0xa')]);router[_0x6a8c('0x6')](_0x6a8c('0xb'),auth['isChatInteractionAuthorized'](),controller['show']);router[_0x6a8c('0x6')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x6a8c('0xc')]);router[_0x6a8c('0x6')]('/:id/messages',auth[_0x6a8c('0x7')](),controller['getMessages']);router[_0x6a8c('0x6')](_0x6a8c('0xd'),auth[_0x6a8c('0xe')](),controller[_0x6a8c('0xf')]);router[_0x6a8c('0x6')](_0x6a8c('0x10'),auth['isAuthenticated'](),controller[_0x6a8c('0x11')]);router[_0x6a8c('0x12')]('/',auth[_0x6a8c('0x7')](),controller[_0x6a8c('0x13')]);router[_0x6a8c('0x12')]('/:id/vidaoo',auth[_0x6a8c('0x7')](),controller[_0x6a8c('0x14')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1af5f6,_0x2d871f,_0x26a097){_0x26a097(null,path['join'](config['root'],_0x6a8c('0x15')));},'filename':function(_0x9d0126,_0x11259f,_0x3511dd){_0x3511dd(null,util[_0x6a8c('0x16')](_0x6a8c('0x17'),Date[_0x6a8c('0x18')](),_0x11259f[_0x6a8c('0x19')][_0x6a8c('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6a8c('0x12')](_0x6a8c('0x1b'),upload['single'](_0x6a8c('0x1c')),controller[_0x6a8c('0x1d')]);router[_0x6a8c('0x12')](_0x6a8c('0x1e'),auth[_0x6a8c('0xe')](),controller['addMessage']);router[_0x6a8c('0x12')](_0x6a8c('0x1f'),auth[_0x6a8c('0x7')](),interaction[_0x6a8c('0x20')](_0x6a8c('0x21'),_0x6a8c('0x22')),controller[_0x6a8c('0x23')]);router['put'](_0x6a8c('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0x6a8c('0x21'),_0x6a8c('0x24')),controller[_0x6a8c('0x25')]);router[_0x6a8c('0x26')](_0x6a8c('0x27'),controller['customUpdate']);router[_0x6a8c('0x26')](_0x6a8c('0x28'),auth[_0x6a8c('0xe')](),controller[_0x6a8c('0x29')]);router[_0x6a8c('0x26')](_0x6a8c('0x2a'),controller['close']);router[_0x6a8c('0x2b')](_0x6a8c('0xb'),auth['isAuthenticated'](),interaction[_0x6a8c('0x20')](_0x6a8c('0x21'),_0x6a8c('0x2c')),controller[_0x6a8c('0x2d')]);router[_0x6a8c('0x2b')](_0x6a8c('0x1f'),auth[_0x6a8c('0x7')](),controller[_0x6a8c('0x2e')]);module[_0x6a8c('0x2f')]=router;
\ No newline at end of file
+var _0x9175=['chatinteraction:update','/:id/custom_update','customUpdate','put','/:id/close','close','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags'];(function(_0x5e56d2,_0x69a9d9){var _0x382751=function(_0x44c5ef){while(--_0x44c5ef){_0x5e56d2['push'](_0x5e56d2['shift']());}};_0x382751(++_0x69a9d9);}(_0x9175,0x184));var _0x5917=function(_0x397ce6,_0x2ee6f8){_0x397ce6=_0x397ce6-0x0;var _0x31db01=_0x9175[_0x397ce6];return _0x31db01;};'use strict';var multer=require(_0x5917('0x0'));var util=require(_0x5917('0x1'));var path=require(_0x5917('0x2'));var timeout=require(_0x5917('0x3'));var express=require(_0x5917('0x4'));var router=express[_0x5917('0x5')]();var fs_extra=require(_0x5917('0x6'));var auth=require(_0x5917('0x7'));var interaction=require(_0x5917('0x8'));var config=require(_0x5917('0x9'));var controller=require(_0x5917('0xa'));router[_0x5917('0xb')]('/',auth[_0x5917('0xc')](),controller[_0x5917('0xd')]);router[_0x5917('0xb')]('/describe',auth[_0x5917('0xc')](),controller[_0x5917('0xe')]);router[_0x5917('0xb')](_0x5917('0xf'),auth[_0x5917('0x10')](),controller[_0x5917('0x11')]);router[_0x5917('0xb')](_0x5917('0x12'),auth[_0x5917('0x10')](),controller[_0x5917('0x13')]);router[_0x5917('0xb')](_0x5917('0x14'),auth['isAuthenticated'](),controller[_0x5917('0x15')]);router['get'](_0x5917('0x16'),auth[_0x5917('0x10')](),controller[_0x5917('0x17')]);router[_0x5917('0xb')](_0x5917('0x18'),auth[_0x5917('0xc')](),controller[_0x5917('0x19')]);router[_0x5917('0x1a')]('/',auth[_0x5917('0xc')](),controller['create']);router[_0x5917('0x1a')](_0x5917('0x1b'),auth[_0x5917('0xc')](),controller[_0x5917('0x1c')]);var upload=multer({'storage':multer[_0x5917('0x1d')]({'destination':function(_0x3c2768,_0x3fc463,_0x6d6f61){_0x6d6f61(null,path['join'](config[_0x5917('0x1e')],_0x5917('0x1f')));},'filename':function(_0x75fe01,_0x1d7214,_0x122e4a){_0x122e4a(null,util['format']('%s-%s',Date[_0x5917('0x20')](),_0x1d7214[_0x5917('0x21')][_0x5917('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x5917('0x23'),upload[_0x5917('0x24')](_0x5917('0x25')),controller[_0x5917('0x26')]);router[_0x5917('0x1a')](_0x5917('0x14'),auth[_0x5917('0x10')](),controller['addMessage']);router[_0x5917('0x1a')](_0x5917('0x27'),auth['isAuthenticated'](),interaction[_0x5917('0x28')](_0x5917('0x29'),_0x5917('0x2a')),controller[_0x5917('0x2b')]);router['put'](_0x5917('0xf'),auth[_0x5917('0xc')](),interaction[_0x5917('0x28')]('chat',_0x5917('0x2c')),controller['update']);router['put'](_0x5917('0x2d'),controller[_0x5917('0x2e')]);router[_0x5917('0x2f')]('/:id/abandon',auth[_0x5917('0x10')](),controller['abandon']);router[_0x5917('0x2f')](_0x5917('0x30'),controller[_0x5917('0x31')]);router[_0x5917('0x32')](_0x5917('0xf'),auth[_0x5917('0xc')](),interaction['tracked'](_0x5917('0x29'),'chatinteraction:destroy'),controller[_0x5917('0x33')]);router[_0x5917('0x32')](_0x5917('0x27'),auth[_0x5917('0xc')](),controller[_0x5917('0x34')]);module[_0x5917('0x35')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 8edb41d..b6ec768 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 _0x2730=['exports','TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x20643a,_0x4dd717){var _0x5e21fe=function(_0x1cdf46){while(--_0x1cdf46){_0x20643a['push'](_0x20643a['shift']());}};_0x5e21fe(++_0x4dd717);}(_0x2730,0x137));var _0x0273=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2730[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0273('0x0'));module[_0x0273('0x1')]={'body':{'type':Sequelize[_0x0273('0x2')](_0x0273('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x0273('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x0273('0x5')]}};
\ No newline at end of file
+var _0xe826=['BOOLEAN','INTEGER','sequelize','exports','TEXT','medium'];(function(_0x316725,_0x560533){var _0x201762=function(_0x5756f1){while(--_0x5756f1){_0x316725['push'](_0x316725['shift']());}};_0x201762(++_0x560533);}(_0xe826,0x16a));var _0x6e82=function(_0x7732b9,_0x54bbd1){_0x7732b9=_0x7732b9-0x0;var _0x3b5af9=_0xe826[_0x7732b9];return _0x3b5af9;};'use strict';var Sequelize=require(_0x6e82('0x0'));module[_0x6e82('0x1')]={'body':{'type':Sequelize[_0x6e82('0x2')](_0x6e82('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x6e82('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x6e82('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 7decd9e..11da3c1 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 _0x6522=['role','userpic','lastLoginAt','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','all','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','undefined','offset','count','set','json','apply','reject','then','destroy','end','error','stack','name','send','index','ChatInternalMessage','rawAttributes','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','type','options','includeAll','include','catch','show','params','create','body','update','find','describe','get','messages','createdAt','lastMessage','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','User','findAll','agent','fullname'];(function(_0x710820,_0x14ac63){var _0x58450e=function(_0xbb271d){while(--_0xbb271d){_0x710820['push'](_0x710820['shift']());}};_0x58450e(++_0x14ac63);}(_0x6522,0x14d));var _0x2652=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x6522[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0x2652('0x0'));var rimraf=require(_0x2652('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2652('0x2'));var rp=require(_0x2652('0x3'));var moment=require(_0x2652('0x4'));var BPromise=require(_0x2652('0x5'));var Mustache=require('mustache');var util=require(_0x2652('0x6'));var path=require(_0x2652('0x7'));var sox=require(_0x2652('0x8'));var csv=require('to-csv');var ejs=require(_0x2652('0x9'));var fs=require('fs');var fs_extra=require(_0x2652('0xa'));var _=require(_0x2652('0xb'));var squel=require(_0x2652('0xc'));var crypto=require(_0x2652('0xd'));var jsforce=require(_0x2652('0xe'));var deskjs=require(_0x2652('0xf'));var toCsv=require(_0x2652('0x10'));var querystring=require(_0x2652('0x11'));var Papa=require(_0x2652('0x12'));var Redis=require(_0x2652('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2652('0x14'));var as=require(_0x2652('0x15'));var hardwareService=require(_0x2652('0x16'));var logger=require('../../config/logger')(_0x2652('0x17'));var utils=require(_0x2652('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2652('0x19'));var db=require('../../mysqldb')['db'];config[_0x2652('0x1a')]=_[_0x2652('0x1b')](config['redis'],{'host':_0x2652('0x1c'),'port':0x18eb});var socket=require(_0x2652('0x1d'))(new Redis(config['redis']));require(_0x2652('0x1e'))[_0x2652('0x1f')](socket);function respondWithStatusCode(_0x31aefd,_0x272108){_0x272108=_0x272108||0xcc;return function(_0x1a6e7a){if(_0x1a6e7a){return _0x31aefd[_0x2652('0x20')](_0x272108);}return _0x31aefd['status'](_0x272108)['end']();};}function respondWithResult(_0x549d5d,_0x480363){_0x480363=_0x480363||0xc8;return function(_0x491678){if(_0x491678){return _0x549d5d[_0x2652('0x21')](_0x480363)['json'](_0x491678);}};}function respondWithFilteredResult(_0x3082af,_0x1ccbb2){return function(_0x2a206d){if(_0x2a206d){var _0x6b930f=typeof _0x1ccbb2['offset']===_0x2652('0x22')&&typeof _0x1ccbb2['limit']===_0x2652('0x22');var _0x5bed30=_0x2a206d['count'];var _0x28ade3=_0x6b930f?0x0:_0x1ccbb2[_0x2652('0x23')];var _0x246f9d=_0x6b930f?_0x2a206d[_0x2652('0x24')]:_0x1ccbb2[_0x2652('0x23')]+_0x1ccbb2['limit'];var _0x9b506f;if(_0x246f9d>=_0x5bed30){_0x246f9d=_0x5bed30;_0x9b506f=0xc8;}else{_0x9b506f=0xce;}_0x3082af[_0x2652('0x21')](_0x9b506f);return _0x3082af[_0x2652('0x25')]('Content-Range',_0x28ade3+'-'+_0x246f9d+'/'+_0x5bed30)[_0x2652('0x26')](_0x2a206d);}return null;};}function patchUpdates(_0x954a0){return function(_0x1aef7f){try{jsonpatch[_0x2652('0x27')](_0x1aef7f,_0x954a0,!![]);}catch(_0x256e08){return BPromise[_0x2652('0x28')](_0x256e08);}return _0x1aef7f['save']();};}function saveUpdates(_0x469848,_0x580bf7){return function(_0x3c5c13){if(_0x3c5c13){return _0x3c5c13['update'](_0x469848)[_0x2652('0x29')](function(_0x4896d0){return _0x4896d0;});}return null;};}function removeEntity(_0x1a27cb,_0x39de86){return function(_0x30cc71){if(_0x30cc71){return _0x30cc71[_0x2652('0x2a')]()[_0x2652('0x29')](function(){_0x1a27cb[_0x2652('0x21')](0xcc)[_0x2652('0x2b')]();});}};}function handleEntityNotFound(_0x35107c,_0x39a9db){return function(_0xbbd615){if(!_0xbbd615){_0x35107c['sendStatus'](0x194);}return _0xbbd615;};}function handleError(_0x3126e6,_0x4b2e2b){_0x4b2e2b=_0x4b2e2b||0x1f4;return function(_0x2bc9c9){logger[_0x2652('0x2c')](_0x2bc9c9[_0x2652('0x2d')]);if(_0x2bc9c9[_0x2652('0x2e')]){delete _0x2bc9c9[_0x2652('0x2e')];}_0x3126e6[_0x2652('0x21')](_0x4b2e2b)[_0x2652('0x2f')](_0x2bc9c9);};}exports[_0x2652('0x30')]=function(_0x27412e,_0x2c624d){var _0x26de4b={},_0x5804ff={},_0x834b35={'count':0x0,'rows':[]};var _0x1da709=_['map'](db[_0x2652('0x31')][_0x2652('0x32')],function(_0x246731){return{'name':_0x246731['fieldName'],'type':_0x246731['type'][_0x2652('0x33')]};});_0x5804ff[_0x2652('0x34')]=_[_0x2652('0x35')](_0x1da709,_0x2652('0x2e'));_0x5804ff[_0x2652('0x36')]=_[_0x2652('0x37')](_0x27412e['query']);_0x5804ff['filters']=_['intersection'](_0x5804ff[_0x2652('0x34')],_0x5804ff['query']);_0x26de4b[_0x2652('0x38')]=_[_0x2652('0x39')](_0x5804ff[_0x2652('0x34')],qs[_0x2652('0x3a')](_0x27412e[_0x2652('0x36')][_0x2652('0x3a')]));_0x26de4b[_0x2652('0x38')]=_0x26de4b['attributes'][_0x2652('0x3b')]?_0x26de4b[_0x2652('0x38')]:_0x5804ff[_0x2652('0x34')];if(!_0x27412e['query'][_0x2652('0x3c')](_0x2652('0x3d'))){_0x26de4b[_0x2652('0x3e')]=qs['limit'](_0x27412e[_0x2652('0x36')][_0x2652('0x3e')]);_0x26de4b['offset']=qs['offset'](_0x27412e[_0x2652('0x36')]['offset']);}_0x26de4b['order']=qs[_0x2652('0x3f')](_0x27412e['query']['sort']);_0x26de4b[_0x2652('0x40')]=qs[_0x2652('0x41')](_[_0x2652('0x42')](_0x27412e['query'],_0x5804ff[_0x2652('0x41')]),_0x1da709);if(_0x27412e[_0x2652('0x36')][_0x2652('0x43')]){_0x26de4b[_0x2652('0x40')]=_[_0x2652('0x44')](_0x26de4b[_0x2652('0x40')],{'$or':_[_0x2652('0x35')](_0x1da709,function(_0x4ed269){if(_0x4ed269[_0x2652('0x45')]!=='VIRTUAL'){var _0x923e1={};_0x923e1[_0x4ed269[_0x2652('0x2e')]]={'$like':'%'+_0x27412e['query']['filter']+'%'};return _0x923e1;}})});}_0x26de4b=_[_0x2652('0x44')]({},_0x26de4b,_0x27412e[_0x2652('0x46')]);var _0x13cfae={'where':_0x26de4b[_0x2652('0x40')]};return db[_0x2652('0x31')]['count'](_0x13cfae)[_0x2652('0x29')](function(_0xc74401){_0x834b35[_0x2652('0x24')]=_0xc74401;if(_0x27412e[_0x2652('0x36')][_0x2652('0x47')]){_0x26de4b[_0x2652('0x48')]=[{'all':!![]}];}return db[_0x2652('0x31')]['findAll'](_0x26de4b);})['then'](function(_0x5ebae4){_0x834b35['rows']=_0x5ebae4;return _0x834b35;})[_0x2652('0x29')](respondWithFilteredResult(_0x2c624d,_0x26de4b))[_0x2652('0x49')](handleError(_0x2c624d,null));};exports[_0x2652('0x4a')]=function(_0x57ba12,_0x1e52fa){var _0x1d696e={'raw':!![],'where':{'id':_0x57ba12[_0x2652('0x4b')]['id']}},_0x1b84ee={};_0x1b84ee[_0x2652('0x34')]=_[_0x2652('0x37')](db[_0x2652('0x31')][_0x2652('0x32')]);_0x1b84ee[_0x2652('0x36')]=_['keys'](_0x57ba12['query']);_0x1b84ee[_0x2652('0x41')]=_[_0x2652('0x39')](_0x1b84ee[_0x2652('0x34')],_0x1b84ee['query']);_0x1d696e[_0x2652('0x38')]=_[_0x2652('0x39')](_0x1b84ee[_0x2652('0x34')],qs[_0x2652('0x3a')](_0x57ba12['query'][_0x2652('0x3a')]));_0x1d696e[_0x2652('0x38')]=_0x1d696e[_0x2652('0x38')][_0x2652('0x3b')]?_0x1d696e[_0x2652('0x38')]:_0x1b84ee[_0x2652('0x34')];if(_0x57ba12[_0x2652('0x36')]['includeAll']){_0x1d696e['include']=[{'all':!![]}];}_0x1d696e=_[_0x2652('0x44')]({},_0x1d696e,_0x57ba12['options']);return db[_0x2652('0x31')]['find'](_0x1d696e)['then'](handleEntityNotFound(_0x1e52fa,null))[_0x2652('0x29')](respondWithResult(_0x1e52fa,null))[_0x2652('0x49')](handleError(_0x1e52fa,null));};exports['create']=function(_0x34761b,_0x194d06){return db[_0x2652('0x31')][_0x2652('0x4c')](_0x34761b[_0x2652('0x4d')],{})[_0x2652('0x29')](respondWithResult(_0x194d06,0xc9))[_0x2652('0x49')](handleError(_0x194d06,null));};exports[_0x2652('0x4e')]=function(_0xfd2d8e,_0x56933a){if(_0xfd2d8e[_0x2652('0x4d')]['id']){delete _0xfd2d8e[_0x2652('0x4d')]['id'];}return db[_0x2652('0x31')][_0x2652('0x4f')]({'where':{'id':_0xfd2d8e[_0x2652('0x4b')]['id']}})[_0x2652('0x29')](handleEntityNotFound(_0x56933a,null))['then'](saveUpdates(_0xfd2d8e[_0x2652('0x4d')],null))[_0x2652('0x29')](respondWithResult(_0x56933a,null))['catch'](handleError(_0x56933a,null));};exports[_0x2652('0x2a')]=function(_0x15c07a,_0x1fdf56){return db['ChatInternalMessage']['find']({'where':{'id':_0x15c07a[_0x2652('0x4b')]['id']}})[_0x2652('0x29')](handleEntityNotFound(_0x1fdf56,null))['then'](removeEntity(_0x1fdf56,null))[_0x2652('0x49')](handleError(_0x1fdf56,null));};exports[_0x2652('0x50')]=function(_0x1d9b1b,_0x16cb7d){return db[_0x2652('0x31')][_0x2652('0x50')]()[_0x2652('0x29')](respondWithResult(_0x16cb7d,null))[_0x2652('0x49')](handleError(_0x16cb7d,null));};function wrapUser(_0x72c9d3){return function(_0x236c2d){var _0x134dc4=_0x72c9d3[_0x2652('0x51')]({'plain':!![]});_0x134dc4[_0x2652('0x52')]=[];if(_0x236c2d){_0x134dc4['lastMessageAt']=_0x236c2d[_0x2652('0x53')];_0x134dc4[_0x2652('0x54')]=_0x236c2d;}else{_0x134dc4[_0x2652('0x55')]=moment(0x0)['format'](_0x2652('0x56'));_0x134dc4[_0x2652('0x54')]={};}return _0x134dc4;};}exports['getUsers']=function(_0x5ba61e,_0x49d675,_0x430924){var _0x59b974=[];return db[_0x2652('0x57')][_0x2652('0x58')]({'where':{'role':[_0x2652('0x59'),'admin','user']},'attributes':['id',_0x2652('0x5a'),_0x2652('0x2e'),_0x2652('0x5b'),_0x2652('0x5c'),'internal','online',_0x2652('0x5d'),'allowmessenger','showWebBar'],'order':qs[_0x2652('0x3f')]('-online'),'include':[{'model':db[_0x2652('0x5e')],'as':_0x2652('0x5f'),'attributes':['id',_0x2652('0x2e'),_0x2652('0x45')],'through':{'attributes':[]}}]})['then'](function(_0x81dc00){if(_0x81dc00){var _0x4e723f=_0x5ba61e['user'][_0x2652('0x51')]({'plain':!![]});if(!_0x4e723f)throw new Error(_0x2652('0x60'));if(_0x4e723f[_0x2652('0x5b')]===_0x2652('0x61')){return db['UserProfileSection'][_0x2652('0x4f')]({'where':{'name':_0x2652('0x62'),'userProfileId':_0x4e723f[_0x2652('0x63')]},'raw':!![]})[_0x2652('0x29')](function(_0x5ad027){if(_0x5ad027){if(_0x5ad027[_0x2652('0x64')]===0x0){return db[_0x2652('0x65')][_0x2652('0x58')]({'where':{'sectionId':_0x5ad027['id']},'raw':!![]})[_0x2652('0x29')](function(_0x1e66f7){var _0x37704b=[];if(_[_0x2652('0x66')](_0x1e66f7)){_0x37704b=_[_0x2652('0x43')](_0x81dc00,function(_0x37b25e){if(_0x37b25e['role']!==_0x2652('0x59')){return _0x37b25e;}});return _0x37704b;}else{for(var _0x2d1b54=0x0;_0x2d1b54<_0x81dc00['length'];_0x2d1b54++){var _0x1a3b8e=_0x81dc00[_0x2d1b54];if(_0x1a3b8e[_0x2652('0x5b')]===_0x2652('0x59')){var _0x3c4cae=_['find'](_0x1e66f7,function(_0x273226){return _0x273226[_0x2652('0x67')]===_0x1a3b8e['id'];});if(_0x3c4cae)_0x37704b[_0x2652('0x68')](_0x1a3b8e);}else{_0x37704b[_0x2652('0x68')](_0x1a3b8e);}}return _0x37704b;}});}else{return _0x81dc00;}}else{var _0x1c684b=_[_0x2652('0x43')](_0x81dc00,function(_0x500ddb){if(_0x500ddb['role']!==_0x2652('0x59')){return _0x500ddb;}});return _0x1c684b;}});}else{return _0x81dc00;}}})[_0x2652('0x29')](function(_0x332f02){var _0x55854e=[];if(_0x332f02){_0x59b974=_0x332f02;for(var _0x40eede=0x0;_0x40eede<_0x332f02[_0x2652('0x3b')];_0x40eede+=0x1){_0x59b974[_0x40eede][_0x2652('0x52')]=[];_0x55854e['push'](db['ChatInternalMessage'][_0x2652('0x4f')]({'where':{'FromId':[_0x5ba61e[_0x2652('0x61')]['id'],_0x332f02[_0x40eede]['id']],'ToId':[_0x5ba61e[_0x2652('0x61')]['id'],_0x332f02[_0x40eede]['id']],'ChatGroupId':null},'attributes':['id',_0x2652('0x53'),'FromId','ToId','read',_0x2652('0x4d')],'order':qs[_0x2652('0x3f')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x2652('0x29')](wrapUser(_0x332f02[_0x40eede])));}return BPromise[_0x2652('0x69')](_0x55854e);}return[];})[_0x2652('0x29')](function(_0x3d2071){return{'rows':_0x3d2071,'count':_0x3d2071[_0x2652('0x3b')]};})['then'](respondWithResult(_0x49d675,null))[_0x2652('0x49')](handleError(_0x49d675,null));};
\ No newline at end of file
+var _0x0386=['agent','resourceId','push','createdAt','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','error','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','catch','show','options','find','create','body','params','destroy','describe','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','admin','user','role','internal','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','findAll','isEmpty'];(function(_0x4b174a,_0x33a017){var _0x3cd7bf=function(_0x44ccd9){while(--_0x44ccd9){_0x4b174a['push'](_0x4b174a['shift']());}};_0x3cd7bf(++_0x33a017);}(_0x0386,0x153));var _0x6038=function(_0x3bcf4f,_0x507a7b){_0x3bcf4f=_0x3bcf4f-0x0;var _0x26d549=_0x0386[_0x3bcf4f];return _0x26d549;};'use strict';var emlformat=require(_0x6038('0x0'));var rimraf=require(_0x6038('0x1'));var zipdir=require(_0x6038('0x2'));var jsonpatch=require(_0x6038('0x3'));var rp=require(_0x6038('0x4'));var moment=require(_0x6038('0x5'));var BPromise=require(_0x6038('0x6'));var Mustache=require(_0x6038('0x7'));var util=require('util');var path=require(_0x6038('0x8'));var sox=require(_0x6038('0x9'));var csv=require('to-csv');var ejs=require(_0x6038('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6038('0xb'));var squel=require(_0x6038('0xc'));var crypto=require(_0x6038('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6038('0xe'));var toCsv=require(_0x6038('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6038('0x10'));var authService=require(_0x6038('0x11'));var qs=require(_0x6038('0x12'));var as=require(_0x6038('0x13'));var hardwareService=require(_0x6038('0x14'));var logger=require(_0x6038('0x15'))('api');var utils=require(_0x6038('0x16'));var config=require(_0x6038('0x17'));var licenseUtil=require(_0x6038('0x18'));var db=require(_0x6038('0x19'))['db'];config[_0x6038('0x1a')]=_[_0x6038('0x1b')](config[_0x6038('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6038('0x1a')]));require('./chatInternalMessage.socket')[_0x6038('0x1c')](socket);function respondWithStatusCode(_0x294860,_0xacc34b){_0xacc34b=_0xacc34b||0xcc;return function(_0x4a77b1){if(_0x4a77b1){return _0x294860[_0x6038('0x1d')](_0xacc34b);}return _0x294860[_0x6038('0x1e')](_0xacc34b)[_0x6038('0x1f')]();};}function respondWithResult(_0x471295,_0x335690){_0x335690=_0x335690||0xc8;return function(_0x5e7e2a){if(_0x5e7e2a){return _0x471295[_0x6038('0x1e')](_0x335690)[_0x6038('0x20')](_0x5e7e2a);}};}function respondWithFilteredResult(_0x40ee3a,_0x330c56){return function(_0x5c346e){if(_0x5c346e){var _0x4d48d5=typeof _0x330c56[_0x6038('0x21')]==='undefined'&&typeof _0x330c56['limit']===_0x6038('0x22');var _0x34ab7f=_0x5c346e[_0x6038('0x23')];var _0x1a03db=_0x4d48d5?0x0:_0x330c56[_0x6038('0x21')];var _0x3b4f68=_0x4d48d5?_0x5c346e[_0x6038('0x23')]:_0x330c56[_0x6038('0x21')]+_0x330c56[_0x6038('0x24')];var _0x2558a5;if(_0x3b4f68>=_0x34ab7f){_0x3b4f68=_0x34ab7f;_0x2558a5=0xc8;}else{_0x2558a5=0xce;}_0x40ee3a[_0x6038('0x1e')](_0x2558a5);return _0x40ee3a['set'](_0x6038('0x25'),_0x1a03db+'-'+_0x3b4f68+'/'+_0x34ab7f)['json'](_0x5c346e);}return null;};}function patchUpdates(_0x2e764e){return function(_0x2872be){try{jsonpatch[_0x6038('0x26')](_0x2872be,_0x2e764e,!![]);}catch(_0x39b049){return BPromise['reject'](_0x39b049);}return _0x2872be[_0x6038('0x27')]();};}function saveUpdates(_0x5da1fb,_0x4b86cc){return function(_0x374ef9){if(_0x374ef9){return _0x374ef9[_0x6038('0x28')](_0x5da1fb)['then'](function(_0x3dc302){return _0x3dc302;});}return null;};}function removeEntity(_0x11e5fc,_0x3e94eb){return function(_0x159f49){if(_0x159f49){return _0x159f49['destroy']()['then'](function(){_0x11e5fc[_0x6038('0x1e')](0xcc)[_0x6038('0x1f')]();});}};}function handleEntityNotFound(_0x3af6f8,_0x1d0996){return function(_0x55904b){if(!_0x55904b){_0x3af6f8['sendStatus'](0x194);}return _0x55904b;};}function handleError(_0x339757,_0x2c4155){_0x2c4155=_0x2c4155||0x1f4;return function(_0x53ad90){logger[_0x6038('0x29')](_0x53ad90[_0x6038('0x2a')]);if(_0x53ad90[_0x6038('0x2b')]){delete _0x53ad90[_0x6038('0x2b')];}_0x339757['status'](_0x2c4155)['send'](_0x53ad90);};}exports[_0x6038('0x2c')]=function(_0x123c41,_0x456522){var _0x14a1e9={},_0x1abbb9={},_0x1e338d={'count':0x0,'rows':[]};var _0x578e6d=_[_0x6038('0x2d')](db[_0x6038('0x2e')][_0x6038('0x2f')],function(_0x4e94d2){return{'name':_0x4e94d2[_0x6038('0x30')],'type':_0x4e94d2[_0x6038('0x31')][_0x6038('0x32')]};});_0x1abbb9[_0x6038('0x33')]=_[_0x6038('0x2d')](_0x578e6d,'name');_0x1abbb9[_0x6038('0x34')]=_[_0x6038('0x35')](_0x123c41['query']);_0x1abbb9[_0x6038('0x36')]=_[_0x6038('0x37')](_0x1abbb9['model'],_0x1abbb9[_0x6038('0x34')]);_0x14a1e9[_0x6038('0x38')]=_['intersection'](_0x1abbb9[_0x6038('0x33')],qs[_0x6038('0x39')](_0x123c41[_0x6038('0x34')][_0x6038('0x39')]));_0x14a1e9['attributes']=_0x14a1e9['attributes'][_0x6038('0x3a')]?_0x14a1e9[_0x6038('0x38')]:_0x1abbb9[_0x6038('0x33')];if(!_0x123c41[_0x6038('0x34')][_0x6038('0x3b')](_0x6038('0x3c'))){_0x14a1e9[_0x6038('0x24')]=qs[_0x6038('0x24')](_0x123c41[_0x6038('0x34')][_0x6038('0x24')]);_0x14a1e9[_0x6038('0x21')]=qs[_0x6038('0x21')](_0x123c41[_0x6038('0x34')][_0x6038('0x21')]);}_0x14a1e9[_0x6038('0x3d')]=qs[_0x6038('0x3e')](_0x123c41[_0x6038('0x34')][_0x6038('0x3e')]);_0x14a1e9[_0x6038('0x3f')]=qs[_0x6038('0x36')](_[_0x6038('0x40')](_0x123c41['query'],_0x1abbb9['filters']),_0x578e6d);if(_0x123c41[_0x6038('0x34')][_0x6038('0x41')]){_0x14a1e9['where']=_[_0x6038('0x42')](_0x14a1e9[_0x6038('0x3f')],{'$or':_['map'](_0x578e6d,function(_0x528187){if(_0x528187[_0x6038('0x31')]!==_0x6038('0x43')){var _0x46c8bf={};_0x46c8bf[_0x528187[_0x6038('0x2b')]]={'$like':'%'+_0x123c41['query'][_0x6038('0x41')]+'%'};return _0x46c8bf;}})});}_0x14a1e9=_['merge']({},_0x14a1e9,_0x123c41['options']);var _0x3e421b={'where':_0x14a1e9[_0x6038('0x3f')]};return db[_0x6038('0x2e')][_0x6038('0x23')](_0x3e421b)[_0x6038('0x44')](function(_0x3d47b0){_0x1e338d['count']=_0x3d47b0;if(_0x123c41[_0x6038('0x34')][_0x6038('0x45')]){_0x14a1e9[_0x6038('0x46')]=[{'all':!![]}];}return db[_0x6038('0x2e')]['findAll'](_0x14a1e9);})[_0x6038('0x44')](function(_0x359311){_0x1e338d['rows']=_0x359311;return _0x1e338d;})[_0x6038('0x44')](respondWithFilteredResult(_0x456522,_0x14a1e9))[_0x6038('0x47')](handleError(_0x456522,null));};exports[_0x6038('0x48')]=function(_0x243103,_0x17bda4){var _0xd9f2f8={'raw':!![],'where':{'id':_0x243103['params']['id']}},_0x6c1589={};_0x6c1589['model']=_[_0x6038('0x35')](db[_0x6038('0x2e')][_0x6038('0x2f')]);_0x6c1589[_0x6038('0x34')]=_[_0x6038('0x35')](_0x243103['query']);_0x6c1589[_0x6038('0x36')]=_[_0x6038('0x37')](_0x6c1589[_0x6038('0x33')],_0x6c1589[_0x6038('0x34')]);_0xd9f2f8[_0x6038('0x38')]=_['intersection'](_0x6c1589['model'],qs[_0x6038('0x39')](_0x243103[_0x6038('0x34')][_0x6038('0x39')]));_0xd9f2f8[_0x6038('0x38')]=_0xd9f2f8[_0x6038('0x38')]['length']?_0xd9f2f8[_0x6038('0x38')]:_0x6c1589['model'];if(_0x243103[_0x6038('0x34')][_0x6038('0x45')]){_0xd9f2f8[_0x6038('0x46')]=[{'all':!![]}];}_0xd9f2f8=_['merge']({},_0xd9f2f8,_0x243103[_0x6038('0x49')]);return db[_0x6038('0x2e')][_0x6038('0x4a')](_0xd9f2f8)[_0x6038('0x44')](handleEntityNotFound(_0x17bda4,null))[_0x6038('0x44')](respondWithResult(_0x17bda4,null))[_0x6038('0x47')](handleError(_0x17bda4,null));};exports[_0x6038('0x4b')]=function(_0xc751cf,_0x4366a8){return db[_0x6038('0x2e')][_0x6038('0x4b')](_0xc751cf[_0x6038('0x4c')],{})[_0x6038('0x44')](respondWithResult(_0x4366a8,0xc9))[_0x6038('0x47')](handleError(_0x4366a8,null));};exports[_0x6038('0x28')]=function(_0x5231cc,_0x57b209){if(_0x5231cc[_0x6038('0x4c')]['id']){delete _0x5231cc[_0x6038('0x4c')]['id'];}return db[_0x6038('0x2e')][_0x6038('0x4a')]({'where':{'id':_0x5231cc[_0x6038('0x4d')]['id']}})[_0x6038('0x44')](handleEntityNotFound(_0x57b209,null))['then'](saveUpdates(_0x5231cc[_0x6038('0x4c')],null))['then'](respondWithResult(_0x57b209,null))[_0x6038('0x47')](handleError(_0x57b209,null));};exports[_0x6038('0x4e')]=function(_0x3d8985,_0x4a24b1){return db['ChatInternalMessage'][_0x6038('0x4a')]({'where':{'id':_0x3d8985[_0x6038('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4a24b1,null))[_0x6038('0x44')](removeEntity(_0x4a24b1,null))[_0x6038('0x47')](handleError(_0x4a24b1,null));};exports[_0x6038('0x4f')]=function(_0x368933,_0x34e932){return db['ChatInternalMessage'][_0x6038('0x4f')]()[_0x6038('0x44')](respondWithResult(_0x34e932,null))[_0x6038('0x47')](handleError(_0x34e932,null));};function wrapUser(_0x5198d2){return function(_0x182d0d){var _0x1dd450=_0x5198d2['get']({'plain':!![]});_0x1dd450['messages']=[];if(_0x182d0d){_0x1dd450[_0x6038('0x50')]=_0x182d0d['createdAt'];_0x1dd450[_0x6038('0x51')]=_0x182d0d;}else{_0x1dd450[_0x6038('0x50')]=moment(0x0)[_0x6038('0x52')](_0x6038('0x53'));_0x1dd450[_0x6038('0x51')]={};}return _0x1dd450;};}exports['getUsers']=function(_0x1fa1f6,_0x37ad51,_0x51adfb){var _0x29f683=[];return db[_0x6038('0x54')]['findAll']({'where':{'role':['agent',_0x6038('0x55'),_0x6038('0x56')]},'attributes':['id','fullname',_0x6038('0x2b'),_0x6038('0x57'),'userpic',_0x6038('0x58'),'online',_0x6038('0x59'),_0x6038('0x5a'),_0x6038('0x5b')],'order':qs[_0x6038('0x3e')]('-online'),'include':[{'model':db[_0x6038('0x5c')],'as':_0x6038('0x5d'),'attributes':['id',_0x6038('0x2b'),_0x6038('0x31')],'through':{'attributes':[]}}]})[_0x6038('0x44')](function(_0x5b054a){if(_0x5b054a){var _0x568cc0=_0x1fa1f6[_0x6038('0x56')][_0x6038('0x5e')]({'plain':!![]});if(!_0x568cc0)throw new Error(_0x6038('0x5f'));if(_0x568cc0[_0x6038('0x57')]===_0x6038('0x56')){return db['UserProfileSection'][_0x6038('0x4a')]({'where':{'name':'Agents','userProfileId':_0x568cc0[_0x6038('0x60')]},'raw':!![]})[_0x6038('0x44')](function(_0x4fd5a2){if(_0x4fd5a2){if(_0x4fd5a2[_0x6038('0x61')]===0x0){return db[_0x6038('0x62')][_0x6038('0x63')]({'where':{'sectionId':_0x4fd5a2['id']},'raw':!![]})[_0x6038('0x44')](function(_0x4a72a3){var _0x37ba5b=[];if(_[_0x6038('0x64')](_0x4a72a3)){_0x37ba5b=_[_0x6038('0x41')](_0x5b054a,function(_0x5a3dfd){if(_0x5a3dfd[_0x6038('0x57')]!==_0x6038('0x65')){return _0x5a3dfd;}});return _0x37ba5b;}else{for(var _0xe39d54=0x0;_0xe39d54<_0x5b054a[_0x6038('0x3a')];_0xe39d54++){var _0xe3543f=_0x5b054a[_0xe39d54];if(_0xe3543f[_0x6038('0x57')]===_0x6038('0x65')){var _0x5c1af1=_['find'](_0x4a72a3,function(_0x40a2d3){return _0x40a2d3[_0x6038('0x66')]===_0xe3543f['id'];});if(_0x5c1af1)_0x37ba5b[_0x6038('0x67')](_0xe3543f);}else{_0x37ba5b[_0x6038('0x67')](_0xe3543f);}}return _0x37ba5b;}});}else{return _0x5b054a;}}else{var _0x58d89e=_[_0x6038('0x41')](_0x5b054a,function(_0x57c4cb){if(_0x57c4cb[_0x6038('0x57')]!==_0x6038('0x65')){return _0x57c4cb;}});return _0x58d89e;}});}else{return _0x5b054a;}}})[_0x6038('0x44')](function(_0x39aad6){var _0x130353=[];if(_0x39aad6){_0x29f683=_0x39aad6;for(var _0x4186cf=0x0;_0x4186cf<_0x39aad6['length'];_0x4186cf+=0x1){_0x29f683[_0x4186cf]['messages']=[];_0x130353['push'](db[_0x6038('0x2e')]['find']({'where':{'FromId':[_0x1fa1f6[_0x6038('0x56')]['id'],_0x39aad6[_0x4186cf]['id']],'ToId':[_0x1fa1f6[_0x6038('0x56')]['id'],_0x39aad6[_0x4186cf]['id']],'ChatGroupId':null},'attributes':['id',_0x6038('0x68'),_0x6038('0x69'),_0x6038('0x6a'),_0x6038('0x6b'),_0x6038('0x4c')],'order':qs[_0x6038('0x3e')](_0x6038('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x6038('0x44')](wrapUser(_0x39aad6[_0x4186cf])));}return BPromise[_0x6038('0x6d')](_0x130353);}return[];})[_0x6038('0x44')](function(_0x2adcd2){return{'rows':_0x2adcd2,'count':_0x2adcd2['length']};})['then'](respondWithResult(_0x37ad51,null))[_0x6038('0x47')](handleError(_0x37ad51,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 2cadb92..fb5f0ff 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 _0x4efa=['ChatInternalMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x311722,_0x196cae){var _0x2dbc3e=function(_0x4a5ebb){while(--_0x4a5ebb){_0x311722['push'](_0x311722['shift']());}};_0x2dbc3e(++_0x196cae);}(_0x4efa,0x181));var _0xa4ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4efa[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0xa4ef('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xa4ef('0x1')](0x0);var events={'afterCreate':_0xa4ef('0x2'),'afterUpdate':'update','afterDestroy':_0xa4ef('0x3')};function emitEvent(_0x59ec30){return function(_0x5d0742,_0x4e6df9,_0x584cfe){ChatInternalMessageEvents['emit'](_0x59ec30+':'+_0x5d0742['id'],_0x5d0742);ChatInternalMessageEvents[_0xa4ef('0x4')](_0x59ec30,_0x5d0742);_0x584cfe(null);};}for(var e in events){if(events[_0xa4ef('0x5')](e)){var event=events[e];ChatInternalMessage[_0xa4ef('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x62a8=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','ChatInternalMessage'];(function(_0x21ec2b,_0x1feca4){var _0x246e9e=function(_0x3cca26){while(--_0x3cca26){_0x21ec2b['push'](_0x21ec2b['shift']());}};_0x246e9e(++_0x1feca4);}(_0x62a8,0x142));var _0x862a=function(_0x4c27ee,_0x404762){_0x4c27ee=_0x4c27ee-0x0;var _0x2e2150=_0x62a8[_0x4c27ee];return _0x2e2150;};'use strict';var EventEmitter=require(_0x862a('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x862a('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x862a('0x2')](0x0);var events={'afterCreate':_0x862a('0x3'),'afterUpdate':_0x862a('0x4'),'afterDestroy':_0x862a('0x5')};function emitEvent(_0x3931ef){return function(_0x728534,_0x3c3409,_0x1cc4b5){ChatInternalMessageEvents[_0x862a('0x6')](_0x3931ef+':'+_0x728534['id'],_0x728534);ChatInternalMessageEvents['emit'](_0x3931ef,_0x728534);_0x1cc4b5(null);};}for(var e in events){if(events[_0x862a('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x862a('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index b6058a2..28afb11 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 _0x6feb=['rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0xb356e4,_0xa40de9){var _0x319906=function(_0x41780a){while(--_0x41780a){_0xb356e4['push'](_0xb356e4['shift']());}};_0x319906(++_0xa40de9);}(_0x6feb,0x120));var _0xb6fe=function(_0x55103a,_0x4e3ae5){_0x55103a=_0x55103a-0x0;var _0x174fbd=_0x6feb[_0x55103a];return _0x174fbd;};'use strict';var _=require(_0xb6fe('0x0'));var util=require(_0xb6fe('0x1'));var logger=require(_0xb6fe('0x2'))('api');var moment=require(_0xb6fe('0x3'));var BPromise=require(_0xb6fe('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb6fe('0x5'));var rimraf=require(_0xb6fe('0x6'));var config=require(_0xb6fe('0x7'));var attributes=require(_0xb6fe('0x8'));module[_0xb6fe('0x9')]=function(_0x1ebcf9,_0x1510e4){return _0x1ebcf9[_0xb6fe('0xa')](_0xb6fe('0xb'),attributes,{'tableName':_0xb6fe('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb6fe('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x3ca0=['ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define'];(function(_0x903d0d,_0x51f65b){var _0x1ba526=function(_0x3f09c3){while(--_0x3f09c3){_0x903d0d['push'](_0x903d0d['shift']());}};_0x1ba526(++_0x51f65b);}(_0x3ca0,0x11c));var _0x03ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ca0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x03ca('0x0'));var util=require('util');var logger=require(_0x03ca('0x1'))(_0x03ca('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x03ca('0x3'));var fs=require('fs');var path=require(_0x03ca('0x4'));var rimraf=require(_0x03ca('0x5'));var config=require(_0x03ca('0x6'));var attributes=require(_0x03ca('0x7'));module[_0x03ca('0x8')]=function(_0x4cd543,_0x412f8b){return _0x4cd543[_0x03ca('0x9')](_0x03ca('0xa'),attributes,{'tableName':_0x03ca('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x03ca('0xc'),'collate':_0x03ca('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 4ee427f..ce35c87 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 _0xa60e=['debug','request\x20sent','stringify','error','code','message','info','ChatInternalMessage,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0xd9b70d,_0x2e8973){var _0x25854d=function(_0x53b85b){while(--_0x53b85b){_0xd9b70d['push'](_0xd9b70d['shift']());}};_0x25854d(++_0x2e8973);}(_0xa60e,0x1c3));var _0xea60=function(_0x2f38af,_0x2253f3){_0x2f38af=_0x2f38af-0x0;var _0x2ccb7d=_0xa60e[_0x2f38af];return _0x2ccb7d;};'use strict';var _=require(_0xea60('0x0'));var util=require(_0xea60('0x1'));var moment=require(_0xea60('0x2'));var BPromise=require(_0xea60('0x3'));var rs=require(_0xea60('0x4'));var fs=require('fs');var Redis=require(_0xea60('0x5'));var db=require(_0xea60('0x6'))['db'];var utils=require(_0xea60('0x7'));var logger=require(_0xea60('0x8'))('rpc');var config=require(_0xea60('0x9'));var jayson=require(_0xea60('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xea60('0xb')]=_[_0xea60('0xc')](config[_0xea60('0xb')],{'host':_0xea60('0xd'),'port':0x18eb});var socket=require(_0xea60('0xe'))(new Redis(config[_0xea60('0xb')]));require('./chatInternalMessage.socket')[_0xea60('0xf')](socket);function respondWithRpcPromise(_0x5aa7e9,_0x4de85b,_0x4b1c80){return new BPromise(function(_0x1a702e,_0x4b2ebb){return client[_0xea60('0x10')](_0x5aa7e9,_0x4b1c80)['then'](function(_0xd5e811){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x4de85b,'request\x20sent');logger[_0xea60('0x11')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x4de85b,_0xea60('0x12'),JSON[_0xea60('0x13')](_0xd5e811));if(_0xd5e811[_0xea60('0x14')]){if(_0xd5e811[_0xea60('0x14')][_0xea60('0x15')]===0x1f4){logger[_0xea60('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x4de85b,_0xd5e811[_0xea60('0x14')][_0xea60('0x16')]);return _0x4b2ebb(_0xd5e811[_0xea60('0x14')][_0xea60('0x16')]);}logger[_0xea60('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x4de85b,_0xd5e811[_0xea60('0x14')][_0xea60('0x16')]);return _0x1a702e(_0xd5e811[_0xea60('0x14')][_0xea60('0x16')]);}else{logger[_0xea60('0x17')](_0xea60('0x18'),_0x4de85b,_0xea60('0x12'));_0x1a702e(_0xd5e811['result'][_0xea60('0x16')]);}})[_0xea60('0x19')](function(_0x1807f5){logger[_0xea60('0x14')](_0xea60('0x18'),_0x4de85b,_0x1807f5);_0x4b2ebb(_0x1807f5);});});}
\ No newline at end of file
+var _0xe0eb=['localhost','socket.io-emitter','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis'];(function(_0x1aba79,_0x335da1){var _0x3d2058=function(_0x3cf3a5){while(--_0x3cf3a5){_0x1aba79['push'](_0x1aba79['shift']());}};_0x3d2058(++_0x335da1);}(_0xe0eb,0x71));var _0xbe0e=function(_0xe3839f,_0x555463){_0xe3839f=_0xe3839f-0x0;var _0x43c987=_0xe0eb[_0xe3839f];return _0x43c987;};'use strict';var _=require(_0xbe0e('0x0'));var util=require(_0xbe0e('0x1'));var moment=require('moment');var BPromise=require(_0xbe0e('0x2'));var rs=require(_0xbe0e('0x3'));var fs=require('fs');var Redis=require(_0xbe0e('0x4'));var db=require(_0xbe0e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbe0e('0x6'))(_0xbe0e('0x7'));var config=require(_0xbe0e('0x8'));var jayson=require(_0xbe0e('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xbe0e('0xa')](config[_0xbe0e('0xb')],{'host':_0xbe0e('0xc'),'port':0x18eb});var socket=require(_0xbe0e('0xd'))(new Redis(config[_0xbe0e('0xb')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2de8ff,_0x59bd72,_0x219e5c){return new BPromise(function(_0x5ea57b,_0x1b0a61){return client[_0xbe0e('0xe')](_0x2de8ff,_0x219e5c)['then'](function(_0x59c89a){logger[_0xbe0e('0xf')](_0xbe0e('0x10'),_0x59bd72,_0xbe0e('0x11'));logger[_0xbe0e('0x12')](_0xbe0e('0x13'),_0x59bd72,'request\x20sent',JSON[_0xbe0e('0x14')](_0x59c89a));if(_0x59c89a['error']){if(_0x59c89a['error'][_0xbe0e('0x15')]===0x1f4){logger['error'](_0xbe0e('0x10'),_0x59bd72,_0x59c89a[_0xbe0e('0x16')][_0xbe0e('0x17')]);return _0x1b0a61(_0x59c89a['error'][_0xbe0e('0x17')]);}logger[_0xbe0e('0x16')](_0xbe0e('0x10'),_0x59bd72,_0x59c89a[_0xbe0e('0x16')]['message']);return _0x5ea57b(_0x59c89a[_0xbe0e('0x16')][_0xbe0e('0x17')]);}else{logger['info'](_0xbe0e('0x10'),_0x59bd72,_0xbe0e('0x11'));_0x5ea57b(_0x59c89a['result'][_0xbe0e('0x17')]);}})[_0xbe0e('0x18')](function(_0x3dabc4){logger[_0xbe0e('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x59bd72,_0x3dabc4);_0x1b0a61(_0x3dabc4);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index a8065dc..0625873 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 _0xa675=['./chatInternalMessage.events','save','remove','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa675,0xe8));var _0x5a67=function(_0x29b2a2,_0x4b7224){_0x29b2a2=_0x29b2a2-0x0;var _0x836e8c=_0xa675[_0x29b2a2];return _0x836e8c;};'use strict';var ChatInternalMessageEvents=require(_0x5a67('0x0'));var events=[_0x5a67('0x1'),_0x5a67('0x2'),'update'];function createListener(_0x101d0a,_0x29b0ec){return function(_0x356b23){_0x29b0ec[_0x5a67('0x3')](_0x101d0a,_0x356b23);};}function removeListener(_0x125f31,_0x2629f4){return function(){ChatInternalMessageEvents[_0x5a67('0x4')](_0x125f31,_0x2629f4);};}exports[_0x5a67('0x5')]=function(_0x33640a){for(var _0x5107c3=0x0,_0x28980e=events[_0x5a67('0x6')];_0x5107c3<_0x28980e;_0x5107c3++){var _0x46c3a3=events[_0x5107c3];var _0x153e1c=createListener(_0x5a67('0x7')+_0x46c3a3,_0x33640a);ChatInternalMessageEvents['on'](_0x46c3a3,_0x153e1c);}};
\ No newline at end of file
+var _0xada1=['register','length','chatInternalMessage:','./chatInternalMessage.events','save','update','emit','removeListener'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0xada1,0x12b));var _0x1ada=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xada1[_0x411017];return _0x2adeea;};'use strict';var ChatInternalMessageEvents=require(_0x1ada('0x0'));var events=[_0x1ada('0x1'),'remove',_0x1ada('0x2')];function createListener(_0x3a329a,_0x4010c2){return function(_0xf01bdf){_0x4010c2[_0x1ada('0x3')](_0x3a329a,_0xf01bdf);};}function removeListener(_0x1f286a,_0x39be5f){return function(){ChatInternalMessageEvents[_0x1ada('0x4')](_0x1f286a,_0x39be5f);};}exports[_0x1ada('0x5')]=function(_0xaf6740){for(var _0x2a2f06=0x0,_0x1ed1e2=events[_0x1ada('0x6')];_0x2a2f06<_0x1ed1e2;_0x2a2f06++){var _0x3c123e=events[_0x2a2f06];var _0xcc8f48=createListener(_0x1ada('0x7')+_0x3c123e,_0xaf6740);ChatInternalMessageEvents['on'](_0x3c123e,_0xcc8f48);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 850880f..12b016b 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 _0xbf21=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/users','getUsers'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xbf21,0x106));var _0x1bf2=function(_0x56bc0d,_0x4e7bce){_0x56bc0d=_0x56bc0d-0x0;var _0x7c7c8b=_0xbf21[_0x56bc0d];return _0x7c7c8b;};'use strict';var multer=require(_0x1bf2('0x0'));var util=require(_0x1bf2('0x1'));var path=require(_0x1bf2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1bf2('0x3')]();var fs_extra=require(_0x1bf2('0x4'));var auth=require(_0x1bf2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1bf2('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x1bf2('0x7')]('/',auth[_0x1bf2('0x8')](),controller[_0x1bf2('0x9')]);router['get'](_0x1bf2('0xa'),auth['isAuthenticated'](),controller[_0x1bf2('0xb')]);router[_0x1bf2('0x7')](_0x1bf2('0xc'),auth[_0x1bf2('0x8')](),controller[_0x1bf2('0xd')]);router[_0x1bf2('0x7')](_0x1bf2('0xe'),auth['isAuthenticated'](),controller[_0x1bf2('0xf')]);router[_0x1bf2('0x10')]('/',auth['isAuthenticated'](),controller[_0x1bf2('0x11')]);router[_0x1bf2('0x12')]('/:id',controller[_0x1bf2('0x13')]);router[_0x1bf2('0x14')](_0x1bf2('0xe'),auth[_0x1bf2('0x8')](),controller[_0x1bf2('0x15')]);module[_0x1bf2('0x16')]=router;
\ No newline at end of file
+var _0x5aa1=['/describe','isAuthenticated','describe','/users','getUsers','show','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index'];(function(_0x525ca3,_0x17acb7){var _0x2b6804=function(_0x292646){while(--_0x292646){_0x525ca3['push'](_0x525ca3['shift']());}};_0x2b6804(++_0x17acb7);}(_0x5aa1,0x12a));var _0x15aa=function(_0xe5b539,_0x467802){_0xe5b539=_0xe5b539-0x0;var _0x4bd185=_0x5aa1[_0xe5b539];return _0x4bd185;};'use strict';var multer=require(_0x15aa('0x0'));var util=require(_0x15aa('0x1'));var path=require('path');var timeout=require(_0x15aa('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x15aa('0x3'));var auth=require(_0x15aa('0x4'));var interaction=require(_0x15aa('0x5'));var config=require(_0x15aa('0x6'));var controller=require(_0x15aa('0x7'));router[_0x15aa('0x8')]('/',auth['isAuthenticated'](),controller[_0x15aa('0x9')]);router['get'](_0x15aa('0xa'),auth[_0x15aa('0xb')](),controller[_0x15aa('0xc')]);router[_0x15aa('0x8')](_0x15aa('0xd'),auth[_0x15aa('0xb')](),controller[_0x15aa('0xe')]);router['get']('/:id',auth[_0x15aa('0xb')](),controller[_0x15aa('0xf')]);router['post']('/',auth[_0x15aa('0xb')](),controller[_0x15aa('0x10')]);router[_0x15aa('0x11')](_0x15aa('0x12'),controller[_0x15aa('0x13')]);router[_0x15aa('0x14')](_0x15aa('0x12'),auth[_0x15aa('0xb')](),controller[_0x15aa('0x15')]);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 10577fb..eaa0cb6 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 _0x8caf=['out','DATE','STRING','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x1d34e3,_0x4f5844){_0x1d34e3=_0x1d34e3-0x0;var _0x34266b=_0x8caf[_0x1d34e3];return _0x34266b;};'use strict';var Sequelize=require('sequelize');module[_0xf8ca('0x0')]={'body':{'type':Sequelize[_0xf8ca('0x1')](_0xf8ca('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xf8ca('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xf8ca('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf8ca('0x4')]('in','out'),'defaultValue':_0xf8ca('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf8ca('0x6')]},'providerName':{'type':Sequelize[_0xf8ca('0x7')]},'providerResponse':{'type':Sequelize[_0xf8ca('0x1')]}};
\ No newline at end of file
+var _0x6a95=['ENUM','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x38cb64,_0x3cf237){var _0x543a29=function(_0x3d1503){while(--_0x3d1503){_0x38cb64['push'](_0x38cb64['shift']());}};_0x543a29(++_0x3cf237);}(_0x6a95,0x1db));var _0x56a9=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x6a95[_0x550d12];return _0x12103d;};'use strict';var Sequelize=require(_0x56a9('0x0'));module[_0x56a9('0x1')]={'body':{'type':Sequelize[_0x56a9('0x2')](_0x56a9('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x56a9('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x56a9('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x56a9('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x56a9('0x6')]},'providerName':{'type':Sequelize[_0x56a9('0x7')]},'providerResponse':{'type':Sequelize[_0x56a9('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 4e38b2f..02dd7f3 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 _0x776d=['reject','update','destroy','sendStatus','stack','name','index','map','ChatMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','merge','find','create','body','describe','chat-interactions','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','email','manual','SIP/%s','channel','event','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','User','fullname','internal','motionChannel','rejectmessage','parse','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','status','end','offset','undefined','count','set','Content-Range','json'];(function(_0x117a8b,_0x5830de){var _0x574991=function(_0x87cae8){while(--_0x87cae8){_0x117a8b['push'](_0x117a8b['shift']());}};_0x574991(++_0x5830de);}(_0x776d,0x15f));var _0xd776=function(_0x58a86b,_0x31261a){_0x58a86b=_0x58a86b-0x0;var _0xf141c9=_0x776d[_0x58a86b];return _0xf141c9;};'use strict';var emlformat=require(_0xd776('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd776('0x1'));var rp=require(_0xd776('0x2'));var moment=require(_0xd776('0x3'));var BPromise=require(_0xd776('0x4'));var Mustache=require(_0xd776('0x5'));var util=require(_0xd776('0x6'));var path=require(_0xd776('0x7'));var sox=require(_0xd776('0x8'));var csv=require(_0xd776('0x9'));var ejs=require(_0xd776('0xa'));var fs=require('fs');var fs_extra=require(_0xd776('0xb'));var _=require(_0xd776('0xc'));var squel=require(_0xd776('0xd'));var crypto=require(_0xd776('0xe'));var jsforce=require(_0xd776('0xf'));var deskjs=require(_0xd776('0x10'));var toCsv=require(_0xd776('0x9'));var querystring=require(_0xd776('0x11'));var Papa=require(_0xd776('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd776('0x13'));var as=require(_0xd776('0x14'));var hardwareService=require(_0xd776('0x15'));var logger=require(_0xd776('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xd776('0x17'));var licenseUtil=require(_0xd776('0x18'));var db=require(_0xd776('0x19'))['db'];config[_0xd776('0x1a')]=_[_0xd776('0x1b')](config[_0xd776('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xd776('0x1c'))(new Redis(config['redis']));require(_0xd776('0x1d'))[_0xd776('0x1e')](socket);var jayson=require(_0xd776('0x1f'));var client=jayson[_0xd776('0x20')][_0xd776('0x21')]({'port':0x232c});var client9002=jayson['client'][_0xd776('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x4e54f4,_0x5886d9,_0xda4af6,_0x39e2ad){return new BPromise(function(_0x3e74d,_0xdcc3b1){var _0x3002a0=_0x39e2ad||client;return _0x3002a0['request'](_0x4e54f4,_0xda4af6)[_0xd776('0x22')](function(_0x275445){logger[_0xd776('0x23')](_0xd776('0x24'),_0x5886d9,'request\x20sent');logger[_0xd776('0x25')](_0xd776('0x26'),_0x5886d9,_0xd776('0x27'),JSON[_0xd776('0x28')](_0x275445));if(_0x275445[_0xd776('0x29')]){if(_0x275445[_0xd776('0x29')]['code']===0x1f4){logger['error'](_0xd776('0x24'),_0x5886d9,_0x275445[_0xd776('0x29')]['message']);return _0xdcc3b1(_0x275445[_0xd776('0x29')][_0xd776('0x2a')]);}logger[_0xd776('0x29')](_0xd776('0x24'),_0x5886d9,_0x275445[_0xd776('0x29')]['message']);return _0x3e74d(_0x275445[_0xd776('0x29')]['message']);}else{logger[_0xd776('0x23')](_0xd776('0x24'),_0x5886d9,_0xd776('0x27'));_0x3e74d(_0x275445['result']['message']);}})['catch'](function(_0x31df14){logger[_0xd776('0x29')](_0xd776('0x24'),_0x5886d9,_0x31df14);_0xdcc3b1(_0x31df14);});});}function respondWithStatusCode(_0x4681f9,_0x22f433){_0x22f433=_0x22f433||0xcc;return function(_0x17e789){if(_0x17e789){return _0x4681f9['sendStatus'](_0x22f433);}return _0x4681f9[_0xd776('0x2b')](_0x22f433)[_0xd776('0x2c')]();};}function respondWithResult(_0x14ad80,_0xd641e4){_0xd641e4=_0xd641e4||0xc8;return function(_0x584f6d){if(_0x584f6d){return _0x14ad80[_0xd776('0x2b')](_0xd641e4)['json'](_0x584f6d);}};}function respondWithFilteredResult(_0x25dcab,_0x4c066c){return function(_0x499c79){if(_0x499c79){var _0x3c7dc3=typeof _0x4c066c[_0xd776('0x2d')]===_0xd776('0x2e')&&typeof _0x4c066c['limit']==='undefined';var _0x1d0aca=_0x499c79['count'];var _0x958d32=_0x3c7dc3?0x0:_0x4c066c[_0xd776('0x2d')];var _0x5716e0=_0x3c7dc3?_0x499c79[_0xd776('0x2f')]:_0x4c066c[_0xd776('0x2d')]+_0x4c066c['limit'];var _0x4316a3;if(_0x5716e0>=_0x1d0aca){_0x5716e0=_0x1d0aca;_0x4316a3=0xc8;}else{_0x4316a3=0xce;}_0x25dcab[_0xd776('0x2b')](_0x4316a3);return _0x25dcab[_0xd776('0x30')](_0xd776('0x31'),_0x958d32+'-'+_0x5716e0+'/'+_0x1d0aca)[_0xd776('0x32')](_0x499c79);}return null;};}function patchUpdates(_0x27c48b){return function(_0x159922){try{jsonpatch['apply'](_0x159922,_0x27c48b,!![]);}catch(_0x47cae7){return BPromise[_0xd776('0x33')](_0x47cae7);}return _0x159922['save']();};}function saveUpdates(_0x30043c,_0x1d080c){return function(_0x4f5d65){if(_0x4f5d65){return _0x4f5d65[_0xd776('0x34')](_0x30043c)['then'](function(_0x819a90){return _0x819a90;});}return null;};}function removeEntity(_0x307b0f,_0x22930e){return function(_0x3da0a5){if(_0x3da0a5){return _0x3da0a5[_0xd776('0x35')]()['then'](function(){_0x307b0f['status'](0xcc)[_0xd776('0x2c')]();});}};}function handleEntityNotFound(_0x351cc2,_0x4d4d16){return function(_0x787eec){if(!_0x787eec){_0x351cc2[_0xd776('0x36')](0x194);}return _0x787eec;};}function handleError(_0x1a27fe,_0x5cd3ab){_0x5cd3ab=_0x5cd3ab||0x1f4;return function(_0x429eaa){logger[_0xd776('0x29')](_0x429eaa[_0xd776('0x37')]);if(_0x429eaa[_0xd776('0x38')]){delete _0x429eaa[_0xd776('0x38')];}_0x1a27fe['status'](_0x5cd3ab)['send'](_0x429eaa);};}exports[_0xd776('0x39')]=function(_0x3fe0ee,_0x2e6996){var _0x242afc={},_0x454246={},_0x2f3f7f={'count':0x0,'rows':[]};var _0x368947=_[_0xd776('0x3a')](db[_0xd776('0x3b')]['rawAttributes'],function(_0x762631){return{'name':_0x762631[_0xd776('0x3c')],'type':_0x762631[_0xd776('0x3d')][_0xd776('0x3e')]};});_0x454246[_0xd776('0x3f')]=_[_0xd776('0x3a')](_0x368947,_0xd776('0x38'));_0x454246[_0xd776('0x40')]=_[_0xd776('0x41')](_0x3fe0ee[_0xd776('0x40')]);_0x454246[_0xd776('0x42')]=_[_0xd776('0x43')](_0x454246[_0xd776('0x3f')],_0x454246[_0xd776('0x40')]);_0x242afc[_0xd776('0x44')]=_['intersection'](_0x454246[_0xd776('0x3f')],qs[_0xd776('0x45')](_0x3fe0ee['query'][_0xd776('0x45')]));_0x242afc['attributes']=_0x242afc[_0xd776('0x44')][_0xd776('0x46')]?_0x242afc[_0xd776('0x44')]:_0x454246['model'];if(!_0x3fe0ee['query'][_0xd776('0x47')](_0xd776('0x48'))){_0x242afc['limit']=qs[_0xd776('0x49')](_0x3fe0ee['query'][_0xd776('0x49')]);_0x242afc[_0xd776('0x2d')]=qs[_0xd776('0x2d')](_0x3fe0ee[_0xd776('0x40')][_0xd776('0x2d')]);}_0x242afc[_0xd776('0x4a')]=qs[_0xd776('0x4b')](_0x3fe0ee[_0xd776('0x40')][_0xd776('0x4b')]);_0x242afc[_0xd776('0x4c')]=qs['filters'](_[_0xd776('0x4d')](_0x3fe0ee[_0xd776('0x40')],_0x454246[_0xd776('0x42')]),_0x368947);if(_0x3fe0ee[_0xd776('0x40')][_0xd776('0x4e')]){_0x242afc[_0xd776('0x4c')]=_['merge'](_0x242afc['where'],{'$or':_[_0xd776('0x3a')](_0x368947,function(_0x19f468){if(_0x19f468['type']!==_0xd776('0x4f')){var _0x31c15b={};_0x31c15b[_0x19f468[_0xd776('0x38')]]={'$like':'%'+_0x3fe0ee[_0xd776('0x40')][_0xd776('0x4e')]+'%'};return _0x31c15b;}})});}_0x242afc=_['merge']({},_0x242afc,_0x3fe0ee[_0xd776('0x50')]);var _0x4434b2={'where':_0x242afc[_0xd776('0x4c')]};return db[_0xd776('0x3b')][_0xd776('0x2f')](_0x4434b2)[_0xd776('0x22')](function(_0x37abd8){_0x2f3f7f['count']=_0x37abd8;if(_0x3fe0ee[_0xd776('0x40')][_0xd776('0x51')]){_0x242afc[_0xd776('0x52')]=[{'all':!![]}];}return db[_0xd776('0x3b')][_0xd776('0x53')](_0x242afc);})[_0xd776('0x22')](function(_0x2db8ef){_0x2f3f7f['rows']=_0x2db8ef;return _0x2f3f7f;})[_0xd776('0x22')](respondWithFilteredResult(_0x2e6996,_0x242afc))[_0xd776('0x54')](handleError(_0x2e6996,null));};exports[_0xd776('0x55')]=function(_0x59b8f3,_0x480daf){var _0x55871b={'raw':!![],'where':{'id':_0x59b8f3[_0xd776('0x56')]['id']}},_0x403015={};_0x403015[_0xd776('0x3f')]=_[_0xd776('0x41')](db['ChatMessage'][_0xd776('0x57')]);_0x403015[_0xd776('0x40')]=_['keys'](_0x59b8f3[_0xd776('0x40')]);_0x403015['filters']=_[_0xd776('0x43')](_0x403015[_0xd776('0x3f')],_0x403015[_0xd776('0x40')]);_0x55871b[_0xd776('0x44')]=_[_0xd776('0x43')](_0x403015[_0xd776('0x3f')],qs['fields'](_0x59b8f3[_0xd776('0x40')][_0xd776('0x45')]));_0x55871b[_0xd776('0x44')]=_0x55871b[_0xd776('0x44')][_0xd776('0x46')]?_0x55871b[_0xd776('0x44')]:_0x403015[_0xd776('0x3f')];if(_0x59b8f3[_0xd776('0x40')][_0xd776('0x51')]){_0x55871b[_0xd776('0x52')]=[{'all':!![]}];}_0x55871b=_[_0xd776('0x58')]({},_0x55871b,_0x59b8f3[_0xd776('0x50')]);return db[_0xd776('0x3b')][_0xd776('0x59')](_0x55871b)[_0xd776('0x22')](handleEntityNotFound(_0x480daf,null))[_0xd776('0x22')](respondWithResult(_0x480daf,null))['catch'](handleError(_0x480daf,null));};exports[_0xd776('0x5a')]=function(_0x6845d0,_0x53dd09){return db[_0xd776('0x3b')]['create'](_0x6845d0[_0xd776('0x5b')],{})[_0xd776('0x22')](respondWithResult(_0x53dd09,0xc9))[_0xd776('0x54')](handleError(_0x53dd09,null));};exports[_0xd776('0x34')]=function(_0x2889ab,_0x2b7126){if(_0x2889ab['body']['id']){delete _0x2889ab[_0xd776('0x5b')]['id'];}return db[_0xd776('0x3b')][_0xd776('0x59')]({'where':{'id':_0x2889ab[_0xd776('0x56')]['id']}})[_0xd776('0x22')](handleEntityNotFound(_0x2b7126,null))[_0xd776('0x22')](saveUpdates(_0x2889ab[_0xd776('0x5b')],null))['then'](respondWithResult(_0x2b7126,null))['catch'](handleError(_0x2b7126,null));};exports[_0xd776('0x35')]=function(_0x5dd5a4,_0x528301){return db[_0xd776('0x3b')]['find']({'where':{'id':_0x5dd5a4[_0xd776('0x56')]['id']}})['then'](handleEntityNotFound(_0x528301,null))[_0xd776('0x22')](removeEntity(_0x528301,null))[_0xd776('0x54')](handleError(_0x528301,null));};exports[_0xd776('0x5c')]=function(_0x827679,_0x3f07cb){return db[_0xd776('0x3b')][_0xd776('0x5c')]()[_0xd776('0x22')](respondWithResult(_0x3f07cb,null))['catch'](handleError(_0x3f07cb,null));};var interaction_log=require(_0xd776('0x16'))(_0xd776('0x5d'));exports[_0xd776('0x5e')]=function(_0x1d1a58,_0x38d4d7,_0x239933){var _0x438ddb={'agent':{},'channel':_0xd776('0x5f')};if(_0x1d1a58[_0xd776('0x5b')]['id']){delete _0x1d1a58[_0xd776('0x5b')]['id'];}_0x1d1a58[_0xd776('0x5b')]['read']=!![];_0x1d1a58[_0xd776('0x5b')][_0xd776('0x60')]=moment()[_0xd776('0x61')](_0xd776('0x62'));_0x1d1a58[_0xd776('0x5b')][_0xd776('0x63')]=_0x1d1a58['body'][_0xd776('0x63')]||_0x1d1a58[_0xd776('0x64')]['id'];_0x438ddb[_0xd776('0x65')]['id']=_0x1d1a58[_0xd776('0x5b')]['UserId'];return db['ChatMessage']['find']({'where':{'id':_0x1d1a58[_0xd776('0x56')]['id'],'UserId':null}})[_0xd776('0x22')](handleEntityNotFound(_0x38d4d7,null))[_0xd776('0x22')](saveUpdates(_0x1d1a58[_0xd776('0x5b')],null))[_0xd776('0x22')](function(_0x1a4905){if(_0x1a4905){_0x438ddb[_0xd776('0x2a')]=_0x1a4905[_0xd776('0x66')]({'plain':!![]});return db[_0xd776('0x67')]['find']({'where':{'id':_0x1a4905[_0xd776('0x68')]}});}return null;})[_0xd776('0x22')](handleEntityNotFound(_0x38d4d7,null))[_0xd776('0x22')](function(_0x3ac0af){if(_0x3ac0af){return _0x3ac0af[_0xd776('0x34')]({'UserId':_0x1d1a58[_0xd776('0x5b')][_0xd776('0x63')],'read1stAt':_[_0xd776('0x69')](_0x3ac0af['read1stAt'])?moment()[_0xd776('0x61')](_0xd776('0x62')):undefined});}return null;})[_0xd776('0x22')](function(_0x311e5d){if(_0x311e5d){_0x438ddb[_0xd776('0x6a')]=_0x311e5d[_0xd776('0x66')]({'plain':!![]});interaction_log[_0xd776('0x23')](_0xd776('0x6b'),_0x1d1a58[_0xd776('0x64')]['id'],_0x1d1a58[_0xd776('0x64')][_0xd776('0x38')],_0x1d1a58[_0xd776('0x64')][_0xd776('0x6c')],_0x438ddb[_0xd776('0x6a')]['id'],_0x1d1a58['body']?JSON[_0xd776('0x28')](_0x1d1a58[_0xd776('0x5b')]):_0xd776('0x6d'));return respondWithRpcPromise(_0xd776('0x6e'),'acceptMessage',_0x438ddb);}return null;})[_0xd776('0x22')](function(_0x3b5850){var _0x5c635b=_0xd776('0x6f')+_0x3b5850[_0xd776('0x2a')][_0xd776('0x70')];return db[_0xd776('0x71')][_0xd776('0x40')](_0x5c635b,{'type':db[_0xd776('0x72')][_0xd776('0x73')][_0xd776('0x74')],'raw':!![]})[_0xd776('0x22')](function(_0x2fc2de){return _0x2fc2de;});})[_0xd776('0x22')](function(_0x44a94c){if(_0x44a94c){_0x438ddb[_0xd776('0x2a')][_0xd776('0x75')]=_0x44a94c[0x0];if(!_0x1d1a58['body'][_0xd776('0x63')])return;return db['User'][_0xd776('0x59')]({'where':{'id':_0x1d1a58[_0xd776('0x5b')][_0xd776('0x63')],'role':_0xd776('0x65')},'attributes':['id',_0xd776('0x38'),'fullname',_0xd776('0x76'),'internal'],'raw':!![]});}return null;})['then'](function(_0x15ed0f){if(!_0x15ed0f)return null;_0x438ddb[_0xd776('0x2a')]['agent']=_0x15ed0f;return _0x438ddb;})[_0xd776('0x22')](function(_0x49e021){if(_0x49e021){if(_0x1d1a58[_0xd776('0x5b')][_0xd776('0x77')]){_0x438ddb[_0xd776('0x2a')]['interface']=util['format'](_0xd776('0x78'),_0x1d1a58['user'][_0xd776('0x38')]);_0x438ddb[_0xd776('0x2a')][_0xd776('0x79')]=_0x438ddb[_0xd776('0x79')];_0x438ddb['message']['motionChannel']=_0x438ddb[_0xd776('0x79')];_0x438ddb[_0xd776('0x2a')][_0xd776('0x7a')]=_0xd776('0x5e');return respondWithRpcPromise('EventManager',_0xd776('0x7b'),{'event':_0xd776('0x7c'),'message':_['merge'](_0x438ddb[_0xd776('0x2a')],JSON['parse'](_0x438ddb[_0xd776('0x6a')][_0xd776('0x7d')]))},client9002)[_0xd776('0x22')](function(){return _0x438ddb;});}return _0x438ddb;}return null;})['then'](respondWithResult(_0x38d4d7,null))[_0xd776('0x54')](handleError(_0x38d4d7,null));};var interaction_log=require(_0xd776('0x16'))('chat-interactions');exports[_0xd776('0x33')]=function(_0xb14d07,_0x5c795c,_0x245623){var _0x5278bd={'agent':{},'channel':_0xd776('0x5f')};if(_0xb14d07['body']['id']){delete _0xb14d07[_0xd776('0x5b')]['id'];}_0xb14d07[_0xd776('0x5b')][_0xd776('0x63')]=_0xb14d07['body'][_0xd776('0x63')]||_0xb14d07[_0xd776('0x64')]['id'];_0x5278bd[_0xd776('0x65')]['id']=_0xb14d07[_0xd776('0x5b')][_0xd776('0x63')];return db[_0xd776('0x3b')][_0xd776('0x59')]({'where':{'id':_0xb14d07['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5c795c,null))[_0xd776('0x22')](function(_0x36fcb1){if(_0x36fcb1){_0x5278bd[_0xd776('0x2a')]=_0x36fcb1[_0xd776('0x66')]({'plain':!![]});return db[_0xd776('0x67')][_0xd776('0x59')]({'where':{'id':_0x36fcb1[_0xd776('0x68')]}});}return null;})[_0xd776('0x22')](handleEntityNotFound(_0x5c795c,null))[_0xd776('0x22')](function(_0x36a293){if(_0x36a293){_0x5278bd[_0xd776('0x6a')]=_0x36a293['get']({'plain':!![]});interaction_log[_0xd776('0x23')](_0xd776('0x7e'),_0xb14d07[_0xd776('0x64')]['id'],_0xb14d07['user']['name'],_0xb14d07[_0xd776('0x64')][_0xd776('0x6c')],_0x5278bd[_0xd776('0x6a')]['id'],_0xb14d07[_0xd776('0x5b')]?JSON['stringify'](_0xb14d07[_0xd776('0x5b')]):_0xd776('0x6d'));return respondWithRpcPromise('RejectMessage',_0xd776('0x7f'),_0x5278bd);}return null;})[_0xd776('0x22')](function(_0xfd862){var _0x195572=_0xd776('0x6f')+_0xfd862[_0xd776('0x2a')][_0xd776('0x70')];return db['sequelize'][_0xd776('0x40')](_0x195572,{'type':db[_0xd776('0x72')][_0xd776('0x73')][_0xd776('0x74')],'raw':!![]})[_0xd776('0x22')](function(_0x1e52b6){return _0x1e52b6;});})['then'](function(_0x15d6c5){if(_0x15d6c5){_0x5278bd[_0xd776('0x2a')]['contact']=_0x15d6c5[0x0];if(!_0xb14d07[_0xd776('0x5b')][_0xd776('0x63')])return;return db[_0xd776('0x80')][_0xd776('0x59')]({'where':{'id':_0xb14d07['body'][_0xd776('0x63')],'role':_0xd776('0x65')},'attributes':['id','name',_0xd776('0x81'),_0xd776('0x76'),_0xd776('0x82')],'raw':!![]});}return null;})[_0xd776('0x22')](function(_0x10fc42){if(!_0x10fc42)return null;_0x5278bd[_0xd776('0x2a')][_0xd776('0x65')]=_0x10fc42;return _0x5278bd;})[_0xd776('0x22')](function(_0x403423){if(_0x403423){_0x403423[_0xd776('0x2a')]['interface']=util[_0xd776('0x61')](_0xd776('0x78'),_0xb14d07[_0xd776('0x64')][_0xd776('0x38')]);_0x403423[_0xd776('0x2a')]['channel']=_0x5278bd['channel'];_0x403423[_0xd776('0x2a')][_0xd776('0x83')]=_0x5278bd[_0xd776('0x79')];_0x403423[_0xd776('0x2a')][_0xd776('0x7a')]='reject';respondWithRpcPromise(_0xd776('0x7b'),_0xd776('0x7b'),{'event':_0xd776('0x84'),'message':_['merge'](_0x5278bd[_0xd776('0x2a')],JSON[_0xd776('0x85')](_0x5278bd[_0xd776('0x6a')][_0xd776('0x7d')]))},client9002);return _0x5278bd;}return null;})['then'](respondWithResult(_0x5c795c,null))[_0xd776('0x54')](handleError(_0x5c795c,null));};
\ No newline at end of file
+var _0x4d1c=['ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','update','then','destroy','name','index','map','ChatMessage','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','rows','catch','show','params','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','read1stAt','interaction','info','role','null','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','channel','motionChannel','EventManager','acceptmessage','parse','formData','reject','ChatInteraction','RejectMessage','ContactId','SIP/%s','event','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4d1c,0xfa));var _0xc4d1=function(_0x2af021,_0x195fdd){_0x2af021=_0x2af021-0x0;var _0x2e057e=_0x4d1c[_0x2af021];return _0x2e057e;};'use strict';var emlformat=require(_0xc4d1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc4d1('0x1'));var jsonpatch=require(_0xc4d1('0x2'));var rp=require('request-promise');var moment=require(_0xc4d1('0x3'));var BPromise=require(_0xc4d1('0x4'));var Mustache=require(_0xc4d1('0x5'));var util=require(_0xc4d1('0x6'));var path=require(_0xc4d1('0x7'));var sox=require(_0xc4d1('0x8'));var csv=require(_0xc4d1('0x9'));var ejs=require(_0xc4d1('0xa'));var fs=require('fs');var fs_extra=require(_0xc4d1('0xb'));var _=require('lodash');var squel=require(_0xc4d1('0xc'));var crypto=require(_0xc4d1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc4d1('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc4d1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc4d1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc4d1('0x11'))(_0xc4d1('0x12'));var utils=require(_0xc4d1('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc4d1('0x14'));var db=require(_0xc4d1('0x15'))['db'];config[_0xc4d1('0x16')]=_[_0xc4d1('0x17')](config[_0xc4d1('0x16')],{'host':_0xc4d1('0x18'),'port':0x18eb});var socket=require(_0xc4d1('0x19'))(new Redis(config[_0xc4d1('0x16')]));require(_0xc4d1('0x1a'))[_0xc4d1('0x1b')](socket);var jayson=require(_0xc4d1('0x1c'));var client=jayson[_0xc4d1('0x1d')][_0xc4d1('0x1e')]({'port':0x232c});var client9002=jayson[_0xc4d1('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25fba5,_0x25375d,_0x220381,_0x551594){return new BPromise(function(_0x13b4a7,_0x40f908){var _0x2ed25d=_0x551594||client;return _0x2ed25d['request'](_0x25fba5,_0x220381)['then'](function(_0x346a5f){logger['info'](_0xc4d1('0x1f'),_0x25375d,'request\x20sent');logger[_0xc4d1('0x20')](_0xc4d1('0x21'),_0x25375d,_0xc4d1('0x22'),JSON[_0xc4d1('0x23')](_0x346a5f));if(_0x346a5f[_0xc4d1('0x24')]){if(_0x346a5f[_0xc4d1('0x24')][_0xc4d1('0x25')]===0x1f4){logger[_0xc4d1('0x24')](_0xc4d1('0x1f'),_0x25375d,_0x346a5f[_0xc4d1('0x24')][_0xc4d1('0x26')]);return _0x40f908(_0x346a5f['error'][_0xc4d1('0x26')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x25375d,_0x346a5f[_0xc4d1('0x24')][_0xc4d1('0x26')]);return _0x13b4a7(_0x346a5f[_0xc4d1('0x24')][_0xc4d1('0x26')]);}else{logger['info'](_0xc4d1('0x1f'),_0x25375d,'request\x20sent');_0x13b4a7(_0x346a5f[_0xc4d1('0x27')][_0xc4d1('0x26')]);}})['catch'](function(_0x4a164d){logger[_0xc4d1('0x24')](_0xc4d1('0x1f'),_0x25375d,_0x4a164d);_0x40f908(_0x4a164d);});});}function respondWithStatusCode(_0x4837d8,_0x487010){_0x487010=_0x487010||0xcc;return function(_0x37a1db){if(_0x37a1db){return _0x4837d8[_0xc4d1('0x28')](_0x487010);}return _0x4837d8[_0xc4d1('0x29')](_0x487010)[_0xc4d1('0x2a')]();};}function respondWithResult(_0x52f770,_0x174e0b){_0x174e0b=_0x174e0b||0xc8;return function(_0x35c256){if(_0x35c256){return _0x52f770[_0xc4d1('0x29')](_0x174e0b)['json'](_0x35c256);}};}function respondWithFilteredResult(_0x1061dc,_0x29a852){return function(_0x153c61){if(_0x153c61){var _0x570723=typeof _0x29a852[_0xc4d1('0x2b')]==='undefined'&&typeof _0x29a852[_0xc4d1('0x2c')]===_0xc4d1('0x2d');var _0x4f598c=_0x153c61[_0xc4d1('0x2e')];var _0x305c12=_0x570723?0x0:_0x29a852[_0xc4d1('0x2b')];var _0xa986a3=_0x570723?_0x153c61[_0xc4d1('0x2e')]:_0x29a852[_0xc4d1('0x2b')]+_0x29a852['limit'];var _0x1b9206;if(_0xa986a3>=_0x4f598c){_0xa986a3=_0x4f598c;_0x1b9206=0xc8;}else{_0x1b9206=0xce;}_0x1061dc['status'](_0x1b9206);return _0x1061dc[_0xc4d1('0x2f')](_0xc4d1('0x30'),_0x305c12+'-'+_0xa986a3+'/'+_0x4f598c)[_0xc4d1('0x31')](_0x153c61);}return null;};}function patchUpdates(_0x30bfcf){return function(_0x345afd){try{jsonpatch[_0xc4d1('0x32')](_0x345afd,_0x30bfcf,!![]);}catch(_0x447739){return BPromise['reject'](_0x447739);}return _0x345afd['save']();};}function saveUpdates(_0x2b8af8,_0x155ec3){return function(_0x25057a){if(_0x25057a){return _0x25057a[_0xc4d1('0x33')](_0x2b8af8)[_0xc4d1('0x34')](function(_0x36825e){return _0x36825e;});}return null;};}function removeEntity(_0x33b125,_0xc8dec){return function(_0x15f85a){if(_0x15f85a){return _0x15f85a[_0xc4d1('0x35')]()[_0xc4d1('0x34')](function(){_0x33b125['status'](0xcc)[_0xc4d1('0x2a')]();});}};}function handleEntityNotFound(_0x3317eb,_0x1397d6){return function(_0x2d3dff){if(!_0x2d3dff){_0x3317eb['sendStatus'](0x194);}return _0x2d3dff;};}function handleError(_0x1730b8,_0x41a00c){_0x41a00c=_0x41a00c||0x1f4;return function(_0x9d782c){logger[_0xc4d1('0x24')](_0x9d782c['stack']);if(_0x9d782c[_0xc4d1('0x36')]){delete _0x9d782c[_0xc4d1('0x36')];}_0x1730b8['status'](_0x41a00c)['send'](_0x9d782c);};}exports[_0xc4d1('0x37')]=function(_0x41bf54,_0x43ce8d){var _0x38c9d1={},_0x442170={},_0x2bf297={'count':0x0,'rows':[]};var _0x843cc5=_[_0xc4d1('0x38')](db[_0xc4d1('0x39')][_0xc4d1('0x3a')],function(_0x18bb6d){return{'name':_0x18bb6d['fieldName'],'type':_0x18bb6d[_0xc4d1('0x3b')][_0xc4d1('0x3c')]};});_0x442170[_0xc4d1('0x3d')]=_[_0xc4d1('0x38')](_0x843cc5,_0xc4d1('0x36'));_0x442170[_0xc4d1('0x3e')]=_[_0xc4d1('0x3f')](_0x41bf54[_0xc4d1('0x3e')]);_0x442170['filters']=_[_0xc4d1('0x40')](_0x442170[_0xc4d1('0x3d')],_0x442170['query']);_0x38c9d1[_0xc4d1('0x41')]=_['intersection'](_0x442170[_0xc4d1('0x3d')],qs[_0xc4d1('0x42')](_0x41bf54[_0xc4d1('0x3e')]['fields']));_0x38c9d1[_0xc4d1('0x41')]=_0x38c9d1[_0xc4d1('0x41')][_0xc4d1('0x43')]?_0x38c9d1[_0xc4d1('0x41')]:_0x442170[_0xc4d1('0x3d')];if(!_0x41bf54[_0xc4d1('0x3e')][_0xc4d1('0x44')](_0xc4d1('0x45'))){_0x38c9d1[_0xc4d1('0x2c')]=qs[_0xc4d1('0x2c')](_0x41bf54[_0xc4d1('0x3e')]['limit']);_0x38c9d1[_0xc4d1('0x2b')]=qs['offset'](_0x41bf54['query'][_0xc4d1('0x2b')]);}_0x38c9d1[_0xc4d1('0x46')]=qs[_0xc4d1('0x47')](_0x41bf54['query'][_0xc4d1('0x47')]);_0x38c9d1['where']=qs[_0xc4d1('0x48')](_[_0xc4d1('0x49')](_0x41bf54[_0xc4d1('0x3e')],_0x442170[_0xc4d1('0x48')]),_0x843cc5);if(_0x41bf54[_0xc4d1('0x3e')][_0xc4d1('0x4a')]){_0x38c9d1[_0xc4d1('0x4b')]=_[_0xc4d1('0x4c')](_0x38c9d1[_0xc4d1('0x4b')],{'$or':_[_0xc4d1('0x38')](_0x843cc5,function(_0x3ace86){if(_0x3ace86[_0xc4d1('0x3b')]!=='VIRTUAL'){var _0x7ac3d1={};_0x7ac3d1[_0x3ace86[_0xc4d1('0x36')]]={'$like':'%'+_0x41bf54['query'][_0xc4d1('0x4a')]+'%'};return _0x7ac3d1;}})});}_0x38c9d1=_[_0xc4d1('0x4c')]({},_0x38c9d1,_0x41bf54[_0xc4d1('0x4d')]);var _0x2ae786={'where':_0x38c9d1[_0xc4d1('0x4b')]};return db[_0xc4d1('0x39')][_0xc4d1('0x2e')](_0x2ae786)[_0xc4d1('0x34')](function(_0x5673f3){_0x2bf297[_0xc4d1('0x2e')]=_0x5673f3;if(_0x41bf54[_0xc4d1('0x3e')][_0xc4d1('0x4e')]){_0x38c9d1[_0xc4d1('0x4f')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x38c9d1);})['then'](function(_0x35c858){_0x2bf297[_0xc4d1('0x50')]=_0x35c858;return _0x2bf297;})[_0xc4d1('0x34')](respondWithFilteredResult(_0x43ce8d,_0x38c9d1))[_0xc4d1('0x51')](handleError(_0x43ce8d,null));};exports[_0xc4d1('0x52')]=function(_0x44343e,_0x1e97ab){var _0x7af4f0={'raw':!![],'where':{'id':_0x44343e[_0xc4d1('0x53')]['id']}},_0x457c53={};_0x457c53[_0xc4d1('0x3d')]=_[_0xc4d1('0x3f')](db['ChatMessage'][_0xc4d1('0x3a')]);_0x457c53[_0xc4d1('0x3e')]=_[_0xc4d1('0x3f')](_0x44343e[_0xc4d1('0x3e')]);_0x457c53['filters']=_['intersection'](_0x457c53[_0xc4d1('0x3d')],_0x457c53[_0xc4d1('0x3e')]);_0x7af4f0[_0xc4d1('0x41')]=_[_0xc4d1('0x40')](_0x457c53['model'],qs[_0xc4d1('0x42')](_0x44343e['query']['fields']));_0x7af4f0[_0xc4d1('0x41')]=_0x7af4f0[_0xc4d1('0x41')][_0xc4d1('0x43')]?_0x7af4f0[_0xc4d1('0x41')]:_0x457c53[_0xc4d1('0x3d')];if(_0x44343e['query']['includeAll']){_0x7af4f0[_0xc4d1('0x4f')]=[{'all':!![]}];}_0x7af4f0=_[_0xc4d1('0x4c')]({},_0x7af4f0,_0x44343e[_0xc4d1('0x4d')]);return db['ChatMessage'][_0xc4d1('0x54')](_0x7af4f0)[_0xc4d1('0x34')](handleEntityNotFound(_0x1e97ab,null))[_0xc4d1('0x34')](respondWithResult(_0x1e97ab,null))['catch'](handleError(_0x1e97ab,null));};exports[_0xc4d1('0x55')]=function(_0x49da25,_0x450feb){return db['ChatMessage'][_0xc4d1('0x55')](_0x49da25['body'],{})['then'](respondWithResult(_0x450feb,0xc9))[_0xc4d1('0x51')](handleError(_0x450feb,null));};exports[_0xc4d1('0x33')]=function(_0x30034b,_0x17dfef){if(_0x30034b['body']['id']){delete _0x30034b[_0xc4d1('0x56')]['id'];}return db[_0xc4d1('0x39')][_0xc4d1('0x54')]({'where':{'id':_0x30034b[_0xc4d1('0x53')]['id']}})[_0xc4d1('0x34')](handleEntityNotFound(_0x17dfef,null))[_0xc4d1('0x34')](saveUpdates(_0x30034b[_0xc4d1('0x56')],null))[_0xc4d1('0x34')](respondWithResult(_0x17dfef,null))['catch'](handleError(_0x17dfef,null));};exports[_0xc4d1('0x35')]=function(_0x15efd1,_0x8d7cc3){return db[_0xc4d1('0x39')][_0xc4d1('0x54')]({'where':{'id':_0x15efd1[_0xc4d1('0x53')]['id']}})[_0xc4d1('0x34')](handleEntityNotFound(_0x8d7cc3,null))[_0xc4d1('0x34')](removeEntity(_0x8d7cc3,null))['catch'](handleError(_0x8d7cc3,null));};exports[_0xc4d1('0x57')]=function(_0x1637ee,_0x5ea89b){return db[_0xc4d1('0x39')][_0xc4d1('0x57')]()['then'](respondWithResult(_0x5ea89b,null))[_0xc4d1('0x51')](handleError(_0x5ea89b,null));};var interaction_log=require(_0xc4d1('0x11'))(_0xc4d1('0x58'));exports[_0xc4d1('0x59')]=function(_0x4881d8,_0x382271,_0x341a8a){var _0x2a2836={'agent':{},'channel':_0xc4d1('0x5a')};if(_0x4881d8['body']['id']){delete _0x4881d8[_0xc4d1('0x56')]['id'];}_0x4881d8[_0xc4d1('0x56')][_0xc4d1('0x5b')]=!![];_0x4881d8[_0xc4d1('0x56')][_0xc4d1('0x5c')]=moment()[_0xc4d1('0x5d')](_0xc4d1('0x5e'));_0x4881d8[_0xc4d1('0x56')][_0xc4d1('0x5f')]=_0x4881d8[_0xc4d1('0x56')][_0xc4d1('0x5f')]||_0x4881d8[_0xc4d1('0x60')]['id'];_0x2a2836[_0xc4d1('0x61')]['id']=_0x4881d8[_0xc4d1('0x56')][_0xc4d1('0x5f')];return db[_0xc4d1('0x39')][_0xc4d1('0x54')]({'where':{'id':_0x4881d8[_0xc4d1('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x382271,null))[_0xc4d1('0x34')](saveUpdates(_0x4881d8[_0xc4d1('0x56')],null))['then'](function(_0x4e8699){if(_0x4e8699){_0x2a2836[_0xc4d1('0x26')]=_0x4e8699[_0xc4d1('0x62')]({'plain':!![]});return db['ChatInteraction'][_0xc4d1('0x54')]({'where':{'id':_0x4e8699[_0xc4d1('0x63')]}});}return null;})[_0xc4d1('0x34')](handleEntityNotFound(_0x382271,null))['then'](function(_0x44c6b1){if(_0x44c6b1){return _0x44c6b1[_0xc4d1('0x33')]({'UserId':_0x4881d8[_0xc4d1('0x56')]['UserId'],'read1stAt':_['isNil'](_0x44c6b1[_0xc4d1('0x64')])?moment()[_0xc4d1('0x5d')](_0xc4d1('0x5e')):undefined});}return null;})[_0xc4d1('0x34')](function(_0x84c879){if(_0x84c879){_0x2a2836[_0xc4d1('0x65')]=_0x84c879[_0xc4d1('0x62')]({'plain':!![]});interaction_log[_0xc4d1('0x66')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4881d8[_0xc4d1('0x60')]['id'],_0x4881d8[_0xc4d1('0x60')]['name'],_0x4881d8['user'][_0xc4d1('0x67')],_0x2a2836['interaction']['id'],_0x4881d8[_0xc4d1('0x56')]?JSON['stringify'](_0x4881d8['body']):_0xc4d1('0x68'));return respondWithRpcPromise(_0xc4d1('0x69'),_0xc4d1('0x6a'),_0x2a2836);}return null;})[_0xc4d1('0x34')](function(_0x48147a){var _0x3fb791='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x48147a[_0xc4d1('0x26')]['ContactId'];return db[_0xc4d1('0x6b')][_0xc4d1('0x3e')](_0x3fb791,{'type':db[_0xc4d1('0x6c')][_0xc4d1('0x6d')][_0xc4d1('0x6e')],'raw':!![]})[_0xc4d1('0x34')](function(_0x5c6acd){return _0x5c6acd;});})['then'](function(_0x55f1e1){if(_0x55f1e1){_0x2a2836['message'][_0xc4d1('0x6f')]=_0x55f1e1[0x0];if(!_0x4881d8[_0xc4d1('0x56')][_0xc4d1('0x5f')])return;return db[_0xc4d1('0x70')][_0xc4d1('0x54')]({'where':{'id':_0x4881d8[_0xc4d1('0x56')][_0xc4d1('0x5f')],'role':'agent'},'attributes':['id','name',_0xc4d1('0x71'),_0xc4d1('0x72'),_0xc4d1('0x73')],'raw':!![]});}return null;})[_0xc4d1('0x34')](function(_0x2c06d4){if(!_0x2c06d4)return null;_0x2a2836[_0xc4d1('0x26')][_0xc4d1('0x61')]=_0x2c06d4;return _0x2a2836;})['then'](function(_0xc9dd0a){if(_0xc9dd0a){if(_0x4881d8[_0xc4d1('0x56')][_0xc4d1('0x74')]){_0x2a2836['message'][_0xc4d1('0x75')]=util[_0xc4d1('0x5d')]('SIP/%s',_0x4881d8[_0xc4d1('0x60')][_0xc4d1('0x36')]);_0x2a2836[_0xc4d1('0x26')][_0xc4d1('0x76')]=_0x2a2836[_0xc4d1('0x76')];_0x2a2836[_0xc4d1('0x26')][_0xc4d1('0x77')]=_0x2a2836[_0xc4d1('0x76')];_0x2a2836[_0xc4d1('0x26')]['event']=_0xc4d1('0x59');return respondWithRpcPromise(_0xc4d1('0x78'),'EventManager',{'event':_0xc4d1('0x79'),'message':_[_0xc4d1('0x4c')](_0x2a2836[_0xc4d1('0x26')],JSON[_0xc4d1('0x7a')](_0x2a2836[_0xc4d1('0x65')][_0xc4d1('0x7b')]))},client9002)['then'](function(){return _0x2a2836;});}return _0x2a2836;}return null;})[_0xc4d1('0x34')](respondWithResult(_0x382271,null))[_0xc4d1('0x51')](handleError(_0x382271,null));};var interaction_log=require(_0xc4d1('0x11'))(_0xc4d1('0x58'));exports[_0xc4d1('0x7c')]=function(_0x2bef6f,_0x154180,_0x128745){var _0x4d39e3={'agent':{},'channel':'chat'};if(_0x2bef6f['body']['id']){delete _0x2bef6f[_0xc4d1('0x56')]['id'];}_0x2bef6f[_0xc4d1('0x56')][_0xc4d1('0x5f')]=_0x2bef6f['body'][_0xc4d1('0x5f')]||_0x2bef6f[_0xc4d1('0x60')]['id'];_0x4d39e3[_0xc4d1('0x61')]['id']=_0x2bef6f[_0xc4d1('0x56')][_0xc4d1('0x5f')];return db['ChatMessage']['find']({'where':{'id':_0x2bef6f[_0xc4d1('0x53')]['id'],'UserId':null}})[_0xc4d1('0x34')](handleEntityNotFound(_0x154180,null))['then'](function(_0x553a86){if(_0x553a86){_0x4d39e3['message']=_0x553a86[_0xc4d1('0x62')]({'plain':!![]});return db[_0xc4d1('0x7d')][_0xc4d1('0x54')]({'where':{'id':_0x553a86[_0xc4d1('0x63')]}});}return null;})[_0xc4d1('0x34')](handleEntityNotFound(_0x154180,null))['then'](function(_0x4ef974){if(_0x4ef974){_0x4d39e3[_0xc4d1('0x65')]=_0x4ef974['get']({'plain':!![]});interaction_log[_0xc4d1('0x66')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2bef6f[_0xc4d1('0x60')]['id'],_0x2bef6f[_0xc4d1('0x60')][_0xc4d1('0x36')],_0x2bef6f[_0xc4d1('0x60')][_0xc4d1('0x67')],_0x4d39e3[_0xc4d1('0x65')]['id'],_0x2bef6f[_0xc4d1('0x56')]?JSON[_0xc4d1('0x23')](_0x2bef6f[_0xc4d1('0x56')]):_0xc4d1('0x68'));return respondWithRpcPromise(_0xc4d1('0x7e'),'rejectMessage',_0x4d39e3);}return null;})[_0xc4d1('0x34')](function(_0x3bc7f1){var _0x4dac22='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3bc7f1[_0xc4d1('0x26')][_0xc4d1('0x7f')];return db['sequelize'][_0xc4d1('0x3e')](_0x4dac22,{'type':db[_0xc4d1('0x6c')][_0xc4d1('0x6d')]['SELECT'],'raw':!![]})['then'](function(_0x514f92){return _0x514f92;});})[_0xc4d1('0x34')](function(_0x1e3529){if(_0x1e3529){_0x4d39e3[_0xc4d1('0x26')]['contact']=_0x1e3529[0x0];if(!_0x2bef6f[_0xc4d1('0x56')][_0xc4d1('0x5f')])return;return db[_0xc4d1('0x70')]['find']({'where':{'id':_0x2bef6f[_0xc4d1('0x56')][_0xc4d1('0x5f')],'role':'agent'},'attributes':['id',_0xc4d1('0x36'),'fullname','email',_0xc4d1('0x73')],'raw':!![]});}return null;})[_0xc4d1('0x34')](function(_0x209880){if(!_0x209880)return null;_0x4d39e3[_0xc4d1('0x26')][_0xc4d1('0x61')]=_0x209880;return _0x4d39e3;})['then'](function(_0x2f87a3){if(_0x2f87a3){_0x2f87a3['message'][_0xc4d1('0x75')]=util['format'](_0xc4d1('0x80'),_0x2bef6f['user'][_0xc4d1('0x36')]);_0x2f87a3['message'][_0xc4d1('0x76')]=_0x4d39e3[_0xc4d1('0x76')];_0x2f87a3['message'][_0xc4d1('0x77')]=_0x4d39e3[_0xc4d1('0x76')];_0x2f87a3[_0xc4d1('0x26')][_0xc4d1('0x81')]=_0xc4d1('0x7c');respondWithRpcPromise(_0xc4d1('0x78'),_0xc4d1('0x78'),{'event':'rejectmessage','message':_['merge'](_0x4d39e3[_0xc4d1('0x26')],JSON[_0xc4d1('0x7a')](_0x4d39e3['interaction'][_0xc4d1('0x7b')]))},client9002);return _0x4d39e3;}return null;})[_0xc4d1('0x34')](respondWithResult(_0x154180,null))[_0xc4d1('0x51')](handleError(_0x154180,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index ae8cffe..824649a 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 _0x8c78=['events','../../mysqldb','ChatMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1a48fc,_0x10855c){var _0x14c157=function(_0xa60124){while(--_0xa60124){_0x1a48fc['push'](_0x1a48fc['shift']());}};_0x14c157(++_0x10855c);}(_0x8c78,0xbe));var _0x88c7=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x8c78[_0x138adb];return _0x1b27f2;};'use strict';var EventEmitter=require(_0x88c7('0x0'));var ChatMessage=require(_0x88c7('0x1'))['db'][_0x88c7('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x88c7('0x3')](0x0);var events={'afterCreate':_0x88c7('0x4'),'afterUpdate':'update','afterDestroy':_0x88c7('0x5')};function emitEvent(_0x1b93e9){return function(_0x2b136c,_0xd58fc8,_0x2e0fdc){ChatMessageEvents[_0x88c7('0x6')](_0x1b93e9+':'+_0x2b136c['id'],_0x2b136c);ChatMessageEvents['emit'](_0x1b93e9,_0x2b136c);_0x2e0fdc(null);};}for(var e in events){if(events[_0x88c7('0x7')](e)){var event=events[e];ChatMessage[_0x88c7('0x8')](e,emitEvent(event));}}module[_0x88c7('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0xb828=['events','ChatMessage','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x1b33bc,_0x282af6){var _0x23b81c=function(_0x67994a){while(--_0x67994a){_0x1b33bc['push'](_0x1b33bc['shift']());}};_0x23b81c(++_0x282af6);}(_0xb828,0xfc));var _0x8b82=function(_0x38af48,_0x400460){_0x38af48=_0x38af48-0x0;var _0x445384=_0xb828[_0x38af48];return _0x445384;};'use strict';var EventEmitter=require(_0x8b82('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x8b82('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x8b82('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8b82('0x3'),'afterDestroy':'remove'};function emitEvent(_0x16022e){return function(_0x905780,_0x509612,_0xf09c66){ChatMessageEvents[_0x8b82('0x4')](_0x16022e+':'+_0x905780['id'],_0x905780);ChatMessageEvents[_0x8b82('0x4')](_0x16022e,_0x905780);_0xf09c66(null);};}for(var e in events){if(events[_0x8b82('0x5')](e)){var event=events[e];ChatMessage[_0x8b82('0x6')](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 bf8d19e..2a0b5b2 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 _0x49d2=['util','../../config/logger','api','moment','bluebird','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash'];(function(_0xc775ea,_0x5e5895){var _0x5b5e4b=function(_0x4992b7){while(--_0x4992b7){_0xc775ea['push'](_0xc775ea['shift']());}};_0x5b5e4b(++_0x5e5895);}(_0x49d2,0xa7));var _0x249d=function(_0x1a7550,_0x1edace){_0x1a7550=_0x1a7550-0x0;var _0x426e22=_0x49d2[_0x1a7550];return _0x426e22;};'use strict';var _=require(_0x249d('0x0'));var util=require(_0x249d('0x1'));var logger=require(_0x249d('0x2'))(_0x249d('0x3'));var moment=require(_0x249d('0x4'));var BPromise=require(_0x249d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x249d('0x6'));var attributes=require(_0x249d('0x7'));module[_0x249d('0x8')]=function(_0x4eaa46,_0x531a66){return _0x4eaa46[_0x249d('0x9')](_0x249d('0xa'),attributes,{'tableName':_0x249d('0xb'),'paranoid':![],'indexes':[{'name':_0x249d('0xc'),'fields':[_0x249d('0xd')],'type':_0x249d('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2867a1,_0x5a0068,_0x53a1b2){var _0x5018ce=_0x4eaa46['models'];var _0x2b0bef=_0x2867a1['get']({'plain':!![]});if(_0x2b0bef[_0x249d('0xf')][_0x249d('0x10')]()==='in'||_0x2b0bef[_0x249d('0xf')][_0x249d('0x10')]()===_0x249d('0x11')&&!_0x2b0bef['secret']&&!_[_0x249d('0x12')](_0x2b0bef[_0x249d('0x13')])){_0x5018ce[_0x249d('0x14')][_0x249d('0x15')]({'where':{'id':_0x2b0bef['ChatInteractionId']}})[_0x249d('0x16')](function(_0x36e222){if(_0x36e222){_0x36e222[_0x249d('0x17')]({'lastMsgAt':_0x2b0bef[_0x249d('0x18')],'lastMsgDirection':_0x2b0bef[_0x249d('0xf')]['toLowerCase']()});}})[_0x249d('0x19')](function(_0x3b0a74){console[_0x249d('0x1a')](_0x3b0a74);});}_0x53a1b2();}},'charset':'utf8mb4','collate':_0x249d('0x1b')});};
\ No newline at end of file
+var _0xc52f=['ChatInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','path','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','findOne'];(function(_0x3c7000,_0x43db6e){var _0x8f22f1=function(_0x240bd0){while(--_0x240bd0){_0x3c7000['push'](_0x3c7000['shift']());}};_0x8f22f1(++_0x43db6e);}(_0xc52f,0x1e3));var _0xfc52=function(_0x121bb9,_0x3d8455){_0x121bb9=_0x121bb9-0x0;var _0x443350=_0xc52f[_0x121bb9];return _0x443350;};'use strict';var _=require(_0xfc52('0x0'));var util=require(_0xfc52('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xfc52('0x2'));var rp=require(_0xfc52('0x3'));var fs=require('fs');var path=require(_0xfc52('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfc52('0x5'));module[_0xfc52('0x6')]=function(_0x29636f,_0x5cb478){return _0x29636f[_0xfc52('0x7')](_0xfc52('0x8'),attributes,{'tableName':_0xfc52('0x9'),'paranoid':![],'indexes':[{'name':_0xfc52('0xa'),'fields':[_0xfc52('0xb')],'type':_0xfc52('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x30a878,_0x286ca3,_0x3f5b8e){var _0x15001a=_0x29636f[_0xfc52('0xd')];var _0x16aa7a=_0x30a878['get']({'plain':!![]});if(_0x16aa7a[_0xfc52('0xe')]['toLowerCase']()==='in'||_0x16aa7a[_0xfc52('0xe')][_0xfc52('0xf')]()===_0xfc52('0x10')&&!_0x16aa7a[_0xfc52('0x11')]&&!_[_0xfc52('0x12')](_0x16aa7a[_0xfc52('0x13')])){_0x15001a['ChatInteraction'][_0xfc52('0x14')]({'where':{'id':_0x16aa7a[_0xfc52('0x15')]}})[_0xfc52('0x16')](function(_0x24cf4f){if(_0x24cf4f){_0x24cf4f['update']({'lastMsgAt':_0x16aa7a[_0xfc52('0x17')],'lastMsgDirection':_0x16aa7a[_0xfc52('0xe')][_0xfc52('0xf')]()});}})[_0xfc52('0x18')](function(_0x30c8f3){console[_0xfc52('0x19')](_0x30c8f3);});}_0x3f5b8e();}},'charset':_0xfc52('0x1a'),'collate':_0xfc52('0x1b')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 513f3d9..b270c6e 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 _0xee10=['stringify','error','code','ChatMessage,\x20%s,\x20%s','message','CreateChatMessage','ChatMessage','create','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./chatMessage.socket','register','request','then','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x273f77,_0xe5b0cb){var _0x71e147=function(_0x564056){while(--_0x564056){_0x273f77['push'](_0x273f77['shift']());}};_0x71e147(++_0xe5b0cb);}(_0xee10,0x66));var _0x0ee1=function(_0x39f7c8,_0x4bf22e){_0x39f7c8=_0x39f7c8-0x0;var _0x1ce574=_0xee10[_0x39f7c8];return _0x1ce574;};'use strict';var _=require(_0x0ee1('0x0'));var util=require('util');var moment=require(_0x0ee1('0x1'));var BPromise=require(_0x0ee1('0x2'));var rs=require(_0x0ee1('0x3'));var fs=require('fs');var Redis=require(_0x0ee1('0x4'));var db=require(_0x0ee1('0x5'))['db'];var utils=require(_0x0ee1('0x6'));var logger=require(_0x0ee1('0x7'))(_0x0ee1('0x8'));var config=require(_0x0ee1('0x9'));var jayson=require(_0x0ee1('0xa'));var client=jayson['client'][_0x0ee1('0xb')]({'port':0x232a});config[_0x0ee1('0xc')]=_['defaults'](config[_0x0ee1('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0ee1('0xd'))(new Redis(config[_0x0ee1('0xc')]));require(_0x0ee1('0xe'))[_0x0ee1('0xf')](socket);function respondWithRpcPromise(_0x19ccb4,_0x8497aa,_0x470702){return new BPromise(function(_0x580776,_0x3d0fa1){return client[_0x0ee1('0x10')](_0x19ccb4,_0x470702)[_0x0ee1('0x11')](function(_0x37ec9e){logger[_0x0ee1('0x12')]('ChatMessage,\x20%s,\x20%s',_0x8497aa,'request\x20sent');logger[_0x0ee1('0x13')](_0x0ee1('0x14'),_0x8497aa,_0x0ee1('0x15'),JSON[_0x0ee1('0x16')](_0x37ec9e));if(_0x37ec9e[_0x0ee1('0x17')]){if(_0x37ec9e[_0x0ee1('0x17')][_0x0ee1('0x18')]===0x1f4){logger[_0x0ee1('0x17')](_0x0ee1('0x19'),_0x8497aa,_0x37ec9e[_0x0ee1('0x17')][_0x0ee1('0x1a')]);return _0x3d0fa1(_0x37ec9e[_0x0ee1('0x17')][_0x0ee1('0x1a')]);}logger[_0x0ee1('0x17')]('ChatMessage,\x20%s,\x20%s',_0x8497aa,_0x37ec9e[_0x0ee1('0x17')][_0x0ee1('0x1a')]);return _0x580776(_0x37ec9e['error'][_0x0ee1('0x1a')]);}else{logger[_0x0ee1('0x12')](_0x0ee1('0x19'),_0x8497aa,'request\x20sent');_0x580776(_0x37ec9e['result'][_0x0ee1('0x1a')]);}})['catch'](function(_0x4c4b71){logger[_0x0ee1('0x17')]('ChatMessage,\x20%s,\x20%s',_0x8497aa,_0x4c4b71);_0x3d0fa1(_0x4c4b71);});});}exports[_0x0ee1('0x1b')]=function(_0x58e204){var _0x3d9876=this;return new Promise(function(_0x2288b6,_0x2ad7a3){return db[_0x0ee1('0x1c')][_0x0ee1('0x1d')](_0x58e204['body'],{'raw':_0x58e204['options']?_0x58e204['options'][_0x0ee1('0x1e')]===undefined?!![]:![]:!![]})[_0x0ee1('0x11')](function(_0x210974){logger['info'](_0x0ee1('0x1b'),_0x58e204);logger['debug'](_0x0ee1('0x1b'),_0x58e204,JSON[_0x0ee1('0x16')](_0x210974));_0x2288b6(_0x210974);})['catch'](function(_0x235b62){logger[_0x0ee1('0x17')]('CreateChatMessage',_0x235b62[_0x0ee1('0x1a')],_0x58e204);_0x2ad7a3(_0x3d9876[_0x0ee1('0x17')](0x1f4,_0x235b62[_0x0ee1('0x1a')]));});});};
\ No newline at end of file
+var _0xff1c=['rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','CreateChatMessage','ChatMessage','create','options','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2a4a99,_0x64b4a){var _0x1cef2f=function(_0x43beef){while(--_0x43beef){_0x2a4a99['push'](_0x2a4a99['shift']());}};_0x1cef2f(++_0x64b4a);}(_0xff1c,0xdf));var _0xcff1=function(_0x4bd35b,_0x19525b){_0x4bd35b=_0x4bd35b-0x0;var _0x2d498b=_0xff1c[_0x4bd35b];return _0x2d498b;};'use strict';var _=require(_0xcff1('0x0'));var util=require('util');var moment=require(_0xcff1('0x1'));var BPromise=require(_0xcff1('0x2'));var rs=require(_0xcff1('0x3'));var fs=require('fs');var Redis=require(_0xcff1('0x4'));var db=require(_0xcff1('0x5'))['db'];var utils=require(_0xcff1('0x6'));var logger=require(_0xcff1('0x7'))(_0xcff1('0x8'));var config=require(_0xcff1('0x9'));var jayson=require(_0xcff1('0xa'));var client=jayson[_0xcff1('0xb')][_0xcff1('0xc')]({'port':0x232a});config['redis']=_[_0xcff1('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcff1('0xe'))(new Redis(config[_0xcff1('0xf')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x192f5a,_0xbf6dcc,_0x72e082){return new BPromise(function(_0x4a4d26,_0x532f99){return client[_0xcff1('0x10')](_0x192f5a,_0x72e082)[_0xcff1('0x11')](function(_0x3bf230){logger[_0xcff1('0x12')](_0xcff1('0x13'),_0xbf6dcc,_0xcff1('0x14'));logger[_0xcff1('0x15')](_0xcff1('0x16'),_0xbf6dcc,_0xcff1('0x14'),JSON[_0xcff1('0x17')](_0x3bf230));if(_0x3bf230['error']){if(_0x3bf230['error'][_0xcff1('0x18')]===0x1f4){logger[_0xcff1('0x19')]('ChatMessage,\x20%s,\x20%s',_0xbf6dcc,_0x3bf230[_0xcff1('0x19')][_0xcff1('0x1a')]);return _0x532f99(_0x3bf230[_0xcff1('0x19')]['message']);}logger[_0xcff1('0x19')](_0xcff1('0x13'),_0xbf6dcc,_0x3bf230[_0xcff1('0x19')][_0xcff1('0x1a')]);return _0x4a4d26(_0x3bf230[_0xcff1('0x19')][_0xcff1('0x1a')]);}else{logger[_0xcff1('0x12')](_0xcff1('0x13'),_0xbf6dcc,_0xcff1('0x14'));_0x4a4d26(_0x3bf230[_0xcff1('0x1b')][_0xcff1('0x1a')]);}})[_0xcff1('0x1c')](function(_0x4ac8c8){logger[_0xcff1('0x19')]('ChatMessage,\x20%s,\x20%s',_0xbf6dcc,_0x4ac8c8);_0x532f99(_0x4ac8c8);});});}exports[_0xcff1('0x1d')]=function(_0x140f31){var _0x419995=this;return new Promise(function(_0x57e128,_0x33e8e5){return db[_0xcff1('0x1e')][_0xcff1('0x1f')](_0x140f31['body'],{'raw':_0x140f31[_0xcff1('0x20')]?_0x140f31['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x568ee5){logger[_0xcff1('0x12')]('CreateChatMessage',_0x140f31);logger[_0xcff1('0x15')](_0xcff1('0x1d'),_0x140f31,JSON[_0xcff1('0x17')](_0x568ee5));_0x57e128(_0x568ee5);})[_0xcff1('0x1c')](function(_0x15cca6){logger[_0xcff1('0x19')](_0xcff1('0x1d'),_0x15cca6[_0xcff1('0x1a')],_0x140f31);_0x33e8e5(_0x419995['error'](0x1f4,_0x15cca6[_0xcff1('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 58a12dc..c109749 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 _0xc3b5=['length','remove','update','emit','register'];(function(_0x12df63,_0x4625aa){var _0xeebfcc=function(_0x52d38e){while(--_0x52d38e){_0x12df63['push'](_0x12df63['shift']());}};_0xeebfcc(++_0x4625aa);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x572b75,_0x5c693b){_0x572b75=_0x572b75-0x0;var _0x5d7116=_0xc3b5[_0x572b75];return _0x5d7116;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x5c3b('0x0'),_0x5c3b('0x1')];function createListener(_0xbe95d4,_0x3acf12){return function(_0x2f9a72){_0x3acf12[_0x5c3b('0x2')](_0xbe95d4,_0x2f9a72);};}function removeListener(_0x237a61,_0x48f8a1){return function(){ChatMessageEvents['removeListener'](_0x237a61,_0x48f8a1);};}exports[_0x5c3b('0x3')]=function(_0x6b8a1e){for(var _0x56345e=0x0,_0x568a28=events[_0x5c3b('0x4')];_0x56345e<_0x568a28;_0x56345e++){var _0x420839=events[_0x56345e];var _0x3892ad=createListener('chatMessage:'+_0x420839,_0x6b8a1e);ChatMessageEvents['on'](_0x420839,_0x3892ad);}};
\ No newline at end of file
+var _0xa630=['removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x2e2fa7,_0x1b7721){var _0x261dad=function(_0x457dfa){while(--_0x457dfa){_0x2e2fa7['push'](_0x2e2fa7['shift']());}};_0x261dad(++_0x1b7721);}(_0xa630,0xbe));var _0x0a63=function(_0x2fc67c,_0xac72f0){_0x2fc67c=_0x2fc67c-0x0;var _0x4a0c12=_0xa630[_0x2fc67c];return _0x4a0c12;};'use strict';var ChatMessageEvents=require(_0x0a63('0x0'));var events=[_0x0a63('0x1'),'remove','update'];function createListener(_0x1a9586,_0x4f6b34){return function(_0xd0a045){_0x4f6b34['emit'](_0x1a9586,_0xd0a045);};}function removeListener(_0x91a747,_0x3bcb90){return function(){ChatMessageEvents[_0x0a63('0x2')](_0x91a747,_0x3bcb90);};}exports[_0x0a63('0x3')]=function(_0x37b4c9){for(var _0x4b7474=0x0,_0x2760b0=events[_0x0a63('0x4')];_0x4b7474<_0x2760b0;_0x4b7474++){var _0xc2dcd7=events[_0x4b7474];var _0x41d21d=createListener(_0x0a63('0x5')+_0xc2dcd7,_0x37b4c9);ChatMessageEvents['on'](_0xc2dcd7,_0x41d21d);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 281ff36..5d4e101 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 _0xced0=['index','describe','post','chat','chatmessage:create','create','/:id','update','put','/:id/accept','accept','reject','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x24b175,_0x42eba2){var _0x16fa11=function(_0x45bf3e){while(--_0x45bf3e){_0x24b175['push'](_0x24b175['shift']());}};_0x16fa11(++_0x42eba2);}(_0xced0,0x1be));var _0x0ced=function(_0x4fc7ec,_0x288747){_0x4fc7ec=_0x4fc7ec-0x0;var _0x24765e=_0xced0[_0x4fc7ec];return _0x24765e;};'use strict';var multer=require(_0x0ced('0x0'));var util=require('util');var path=require(_0x0ced('0x1'));var timeout=require('connect-timeout');var express=require(_0x0ced('0x2'));var router=express[_0x0ced('0x3')]();var fs_extra=require(_0x0ced('0x4'));var auth=require(_0x0ced('0x5'));var interaction=require(_0x0ced('0x6'));var config=require(_0x0ced('0x7'));var controller=require('./chatMessage.controller');router[_0x0ced('0x8')]('/',auth[_0x0ced('0x9')](),controller[_0x0ced('0xa')]);router['get']('/describe',auth[_0x0ced('0x9')](),controller[_0x0ced('0xb')]);router[_0x0ced('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0ced('0xc')]('/',auth[_0x0ced('0x9')](),interaction['tracked'](_0x0ced('0xd'),_0x0ced('0xe')),controller[_0x0ced('0xf')]);router['put'](_0x0ced('0x10'),controller[_0x0ced('0x11')]);router[_0x0ced('0x12')](_0x0ced('0x13'),auth[_0x0ced('0x9')](),controller[_0x0ced('0x14')]);router['put']('/:id/reject',auth[_0x0ced('0x9')](),controller[_0x0ced('0x15')]);router['delete'](_0x0ced('0x10'),auth[_0x0ced('0x9')](),controller[_0x0ced('0x16')]);module[_0x0ced('0x17')]=router;
\ No newline at end of file
+var _0x5602=['show','post','tracked','chat','chatmessage:create','put','/:id','update','/:id/accept','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','/describe','describe','get'];(function(_0x301393,_0x3a0fcc){var _0x5f2e66=function(_0x535427){while(--_0x535427){_0x301393['push'](_0x301393['shift']());}};_0x5f2e66(++_0x3a0fcc);}(_0x5602,0xba));var _0x2560=function(_0x57eae4,_0x2d6405){_0x57eae4=_0x57eae4-0x0;var _0x5313ec=_0x5602[_0x57eae4];return _0x5313ec;};'use strict';var multer=require(_0x2560('0x0'));var util=require(_0x2560('0x1'));var path=require(_0x2560('0x2'));var timeout=require(_0x2560('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2560('0x4'));var auth=require(_0x2560('0x5'));var interaction=require(_0x2560('0x6'));var config=require(_0x2560('0x7'));var controller=require(_0x2560('0x8'));router['get']('/',auth[_0x2560('0x9')](),controller[_0x2560('0xa')]);router['get'](_0x2560('0xb'),auth[_0x2560('0x9')](),controller[_0x2560('0xc')]);router[_0x2560('0xd')]('/:id',auth[_0x2560('0x9')](),controller[_0x2560('0xe')]);router[_0x2560('0xf')]('/',auth[_0x2560('0x9')](),interaction[_0x2560('0x10')](_0x2560('0x11'),_0x2560('0x12')),controller['create']);router[_0x2560('0x13')](_0x2560('0x14'),controller[_0x2560('0x15')]);router[_0x2560('0x13')](_0x2560('0x16'),auth[_0x2560('0x9')](),controller['accept']);router[_0x2560('0x13')]('/:id/reject',auth[_0x2560('0x9')](),controller['reject']);router[_0x2560('0x17')]('/:id',auth[_0x2560('0x9')](),controller[_0x2560('0x18')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index c5ce03c..1f606e4 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['medium','sequelize','TEXT'];(function(_0x2164cb,_0x476264){var _0x4da4aa=function(_0x3b3ba6){while(--_0x3b3ba6){_0x2164cb['push'](_0x2164cb['shift']());}};_0x4da4aa(++_0x476264);}(_0xb10b,0x12a));var _0xbb10=function(_0x2d4340,_0x14bd7f){_0x2d4340=_0x2d4340-0x0;var _0x5a2e9e=_0xb10b[_0x2d4340];return _0x5a2e9e;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0x5f66=['medium','TEXT','exports'];(function(_0xc56785,_0x5531a9){var _0xeaf7d0=function(_0x474676){while(--_0x474676){_0xc56785['push'](_0xc56785['shift']());}};_0xeaf7d0(++_0x5531a9);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 792c1a0..6295a14 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(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x7a54,0x106));var _0x47a5=function(_0x745668,_0x154450){_0x745668=_0x745668-0x0;var _0x22f77c=_0x7a54[_0x745668];return _0x22f77c;};'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(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x7a54,0x106));var _0x47a5=function(_0x497ad0,_0x369c22){_0x497ad0=_0x497ad0-0x0;var _0x33c245=_0x7a54[_0x497ad0];return _0x33c245;};'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 38a99f0..350d24f 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 _0x08d2=['emit','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x08d2,0xd2));var _0x208d=function(_0x5eaaf3,_0x4219c6){_0x5eaaf3=_0x5eaaf3-0x0;var _0x3d6184=_0x08d2[_0x5eaaf3];return _0x3d6184;};'use strict';var EventEmitter=require(_0x208d('0x0'));var ChatOfflineMessage=require(_0x208d('0x1'))['db'][_0x208d('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x208d('0x3')](0x0);var events={'afterCreate':_0x208d('0x4'),'afterUpdate':_0x208d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x37325d){return function(_0x6dc9ac,_0x3f38a4,_0x47de1c){ChatOfflineMessageEvents['emit'](_0x37325d+':'+_0x6dc9ac['id'],_0x6dc9ac);ChatOfflineMessageEvents[_0x208d('0x6')](_0x37325d,_0x6dc9ac);_0x47de1c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x208d('0x7')](e,emitEvent(event));}}module[_0x208d('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x0a9e=['emit','hook','exports','events','../../mysqldb','ChatOfflineMessage','save','update','remove'];(function(_0x3528f8,_0x23b9cf){var _0x143401=function(_0x4dad8b){while(--_0x4dad8b){_0x3528f8['push'](_0x3528f8['shift']());}};_0x143401(++_0x23b9cf);}(_0x0a9e,0x1c5));var _0xe0a9=function(_0x20867d,_0x5f54ed){_0x20867d=_0x20867d-0x0;var _0x53fa30=_0x0a9e[_0x20867d];return _0x53fa30;};'use strict';var EventEmitter=require(_0xe0a9('0x0'));var ChatOfflineMessage=require(_0xe0a9('0x1'))['db'][_0xe0a9('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0a9('0x3'),'afterUpdate':_0xe0a9('0x4'),'afterDestroy':_0xe0a9('0x5')};function emitEvent(_0x5c7f2b){return function(_0x106a6a,_0x53af0a,_0x31b53c){ChatOfflineMessageEvents[_0xe0a9('0x6')](_0x5c7f2b+':'+_0x106a6a['id'],_0x106a6a);ChatOfflineMessageEvents['emit'](_0x5c7f2b,_0x106a6a);_0x31b53c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xe0a9('0x7')](e,emitEvent(event));}}module[_0xe0a9('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 dce6a4c..361ad77 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 _0x2570=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','exports','define','ChatOfflineMessage'];(function(_0x2d606b,_0x4e58c0){var _0x33fcd7=function(_0xba8169){while(--_0xba8169){_0x2d606b['push'](_0x2d606b['shift']());}};_0x33fcd7(++_0x4e58c0);}(_0x2570,0x165));var _0x0257=function(_0x7c4840,_0x43dc5c){_0x7c4840=_0x7c4840-0x0;var _0x1a19a5=_0x2570[_0x7c4840];return _0x1a19a5;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x0257('0x0')]=function(_0xdf039e){return _0xdf039e[_0x0257('0x1')](_0x0257('0x2'),attributes,{'tableName':_0x0257('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0257('0x4'),'collate':_0x0257('0x5')});};
\ No newline at end of file
+var _0x24d8=['define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x38f3e9,_0x53ce92){var _0xe8ee0a=function(_0x1280cf){while(--_0x1280cf){_0x38f3e9['push'](_0x38f3e9['shift']());}};_0xe8ee0a(++_0x53ce92);}(_0x24d8,0x118));var _0x824d=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x24d8[_0x172747];return _0x509692;};'use strict';var attributes=require(_0x824d('0x0'));module[_0x824d('0x1')]=function(_0x3b63f4){return _0x3b63f4[_0x824d('0x2')](_0x824d('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x824d('0x4'),'collate':_0x824d('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index f31fff0..c84c460 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 _0x2a68=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x509ea1,_0x5c6996){var _0x2971bc=function(_0x468dc6){while(--_0x468dc6){_0x509ea1['push'](_0x509ea1['shift']());}};_0x2971bc(++_0x5c6996);}(_0x2a68,0x148));var _0x82a6=function(_0x3b2c6f,_0xa9f35c){_0x3b2c6f=_0x3b2c6f-0x0;var _0x22e219=_0x2a68[_0x3b2c6f];return _0x22e219;};'use strict';var _=require(_0x82a6('0x0'));var util=require(_0x82a6('0x1'));var moment=require(_0x82a6('0x2'));var BPromise=require(_0x82a6('0x3'));var rs=require(_0x82a6('0x4'));var fs=require('fs');var Redis=require(_0x82a6('0x5'));var db=require(_0x82a6('0x6'))['db'];var utils=require(_0x82a6('0x7'));var logger=require('../../config/logger')(_0x82a6('0x8'));var config=require(_0x82a6('0x9'));var jayson=require(_0x82a6('0xa'));var client=jayson[_0x82a6('0xb')][_0x82a6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x575616,_0x498af1,_0x28016e){return new BPromise(function(_0x1a980e,_0x4841a8){return client[_0x82a6('0xd')](_0x575616,_0x28016e)[_0x82a6('0xe')](function(_0x206876){logger[_0x82a6('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x498af1,_0x82a6('0x10'));logger['debug'](_0x82a6('0x11'),_0x498af1,_0x82a6('0x10'),JSON['stringify'](_0x206876));if(_0x206876['error']){if(_0x206876[_0x82a6('0x12')][_0x82a6('0x13')]===0x1f4){logger[_0x82a6('0x12')](_0x82a6('0x14'),_0x498af1,_0x206876[_0x82a6('0x12')][_0x82a6('0x15')]);return _0x4841a8(_0x206876['error'][_0x82a6('0x15')]);}logger[_0x82a6('0x12')](_0x82a6('0x14'),_0x498af1,_0x206876['error'][_0x82a6('0x15')]);return _0x1a980e(_0x206876[_0x82a6('0x12')][_0x82a6('0x15')]);}else{logger[_0x82a6('0xf')](_0x82a6('0x14'),_0x498af1,'request\x20sent');_0x1a980e(_0x206876['result'][_0x82a6('0x15')]);}})[_0x82a6('0x16')](function(_0x5785e3){logger['error'](_0x82a6('0x14'),_0x498af1,_0x5785e3);_0x4841a8(_0x5785e3);});});}
\ No newline at end of file
+var _0x9400=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message'];(function(_0x16812f,_0x4f4060){var _0x407004=function(_0x2823a4){while(--_0x2823a4){_0x16812f['push'](_0x16812f['shift']());}};_0x407004(++_0x4f4060);}(_0x9400,0x152));var _0x0940=function(_0x569631,_0x5b4875){_0x569631=_0x569631-0x0;var _0x242ad7=_0x9400[_0x569631];return _0x242ad7;};'use strict';var _=require(_0x0940('0x0'));var util=require(_0x0940('0x1'));var moment=require(_0x0940('0x2'));var BPromise=require(_0x0940('0x3'));var rs=require(_0x0940('0x4'));var fs=require('fs');var Redis=require(_0x0940('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0940('0x6'));var logger=require(_0x0940('0x7'))(_0x0940('0x8'));var config=require(_0x0940('0x9'));var jayson=require(_0x0940('0xa'));var client=jayson[_0x0940('0xb')][_0x0940('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2585f3,_0x8445e4,_0x193c30){return new BPromise(function(_0x138e81,_0xa53bed){return client['request'](_0x2585f3,_0x193c30)[_0x0940('0xd')](function(_0x46acbb){logger[_0x0940('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x8445e4,_0x0940('0xf'));logger[_0x0940('0x10')](_0x0940('0x11'),_0x8445e4,'request\x20sent',JSON[_0x0940('0x12')](_0x46acbb));if(_0x46acbb[_0x0940('0x13')]){if(_0x46acbb['error']['code']===0x1f4){logger[_0x0940('0x13')](_0x0940('0x14'),_0x8445e4,_0x46acbb[_0x0940('0x13')][_0x0940('0x15')]);return _0xa53bed(_0x46acbb[_0x0940('0x13')]['message']);}logger[_0x0940('0x13')](_0x0940('0x14'),_0x8445e4,_0x46acbb[_0x0940('0x13')]['message']);return _0x138e81(_0x46acbb[_0x0940('0x13')]['message']);}else{logger[_0x0940('0xe')](_0x0940('0x14'),_0x8445e4,_0x0940('0xf'));_0x138e81(_0x46acbb[_0x0940('0x16')]['message']);}})[_0x0940('0x17')](function(_0x24c604){logger['error'](_0x0940('0x14'),_0x8445e4,_0x24c604);_0xa53bed(_0x24c604);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 082fa3c..bc10d6e 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 _0x3a35=['fs-extra','../../components/interaction/service','./chatOfflineMessage.controller','get','index','describe','isAuthenticated','show','put','/:id','delete','destroy','path','connect-timeout','express','Router'];(function(_0x4adf83,_0x4eaea3){var _0x234701=function(_0x3f9a26){while(--_0x3f9a26){_0x4adf83['push'](_0x4adf83['shift']());}};_0x234701(++_0x4eaea3);}(_0x3a35,0x19c));var _0x53a3=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x3a35[_0x5b561d];return _0x431060;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x53a3('0x0'));var timeout=require(_0x53a3('0x1'));var express=require(_0x53a3('0x2'));var router=express[_0x53a3('0x3')]();var fs_extra=require(_0x53a3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x53a3('0x5'));var config=require('../../config/environment');var controller=require(_0x53a3('0x6'));router[_0x53a3('0x7')]('/',auth['isAuthenticated'](),controller[_0x53a3('0x8')]);router[_0x53a3('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x53a3('0x9')]);router[_0x53a3('0x7')]('/:id',auth[_0x53a3('0xa')](),controller[_0x53a3('0xb')]);router['post']('/',auth[_0x53a3('0xa')](),controller['create']);router[_0x53a3('0xc')](_0x53a3('0xd'),auth[_0x53a3('0xa')](),controller['update']);router[_0x53a3('0xe')]('/:id',auth[_0x53a3('0xa')](),controller[_0x53a3('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x2464=['/describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index'];(function(_0x41d9a7,_0x43843a){var _0x5bbb89=function(_0x520c26){while(--_0x520c26){_0x41d9a7['push'](_0x41d9a7['shift']());}};_0x5bbb89(++_0x43843a);}(_0x2464,0xba));var _0x4246=function(_0x50394d,_0x135d68){_0x50394d=_0x50394d-0x0;var _0x54773b=_0x2464[_0x50394d];return _0x54773b;};'use strict';var multer=require('multer');var util=require(_0x4246('0x0'));var path=require(_0x4246('0x1'));var timeout=require(_0x4246('0x2'));var express=require(_0x4246('0x3'));var router=express[_0x4246('0x4')]();var fs_extra=require(_0x4246('0x5'));var auth=require(_0x4246('0x6'));var interaction=require(_0x4246('0x7'));var config=require('../../config/environment');var controller=require(_0x4246('0x8'));router[_0x4246('0x9')]('/',auth[_0x4246('0xa')](),controller[_0x4246('0xb')]);router[_0x4246('0x9')](_0x4246('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x4246('0xd'),auth[_0x4246('0xa')](),controller[_0x4246('0xe')]);router[_0x4246('0xf')]('/',auth[_0x4246('0xa')](),controller[_0x4246('0x10')]);router[_0x4246('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x4246('0x12')]);router[_0x4246('0x13')](_0x4246('0xd'),auth[_0x4246('0xa')](),controller[_0x4246('0x14')]);module[_0x4246('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 fbd7bbd..de49b0e 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 _0x2add=['mouseOver','INTEGER','sequelize','exports','ENUM','timeout'];(function(_0x3e4cf6,_0x5ca045){var _0x57ae29=function(_0x19aa4c){while(--_0x19aa4c){_0x3e4cf6['push'](_0x3e4cf6['shift']());}};_0x57ae29(++_0x5ca045);}(_0x2add,0x68));var _0xd2ad=function(_0x8415ec,_0x303a38){_0x8415ec=_0x8415ec-0x0;var _0x314978=_0x2add[_0x8415ec];return _0x314978;};'use strict';var Sequelize=require(_0xd2ad('0x0'));module[_0xd2ad('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xd2ad('0x2')]('mouseOver',_0xd2ad('0x3')),'defaultValue':_0xd2ad('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd2ad('0x5')]}};
\ No newline at end of file
+var _0xa7bc=['STRING','ENUM','mouseOver','timeout','sequelize','exports'];(function(_0x578a78,_0xfdd763){var _0x5b517b=function(_0x30e4e1){while(--_0x30e4e1){_0x578a78['push'](_0x578a78['shift']());}};_0x5b517b(++_0xfdd763);}(_0xa7bc,0x12a));var _0xca7b=function(_0x3b3545,_0x1f46ed){_0x3b3545=_0x3b3545-0x0;var _0x6dc734=_0xa7bc[_0x3b3545];return _0x6dc734;};'use strict';var Sequelize=require(_0xca7b('0x0'));module[_0xca7b('0x1')]={'name':{'type':Sequelize[_0xca7b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xca7b('0x3')](_0xca7b('0x4'),_0xca7b('0x5')),'defaultValue':_0xca7b('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index fd0328f..05b8e31 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 _0xe94a=['to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','send','params','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','fields','attributes','model','includeAll','options','catch','create','body','update','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path'];(function(_0x1d1b38,_0x56fb20){var _0x3980ae=function(_0x21be84){while(--_0x21be84){_0x1d1b38['push'](_0x1d1b38['shift']());}};_0x3980ae(++_0x56fb20);}(_0xe94a,0x1c7));var _0xae94=function(_0x454e6d,_0x1e1f38){_0x454e6d=_0x454e6d-0x0;var _0x4bc294=_0xe94a[_0x454e6d];return _0x4bc294;};'use strict';var emlformat=require(_0xae94('0x0'));var rimraf=require(_0xae94('0x1'));var zipdir=require(_0xae94('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xae94('0x3'));var moment=require(_0xae94('0x4'));var BPromise=require(_0xae94('0x5'));var Mustache=require(_0xae94('0x6'));var util=require(_0xae94('0x7'));var path=require(_0xae94('0x8'));var sox=require('sox');var csv=require(_0xae94('0x9'));var ejs=require(_0xae94('0xa'));var fs=require('fs');var fs_extra=require(_0xae94('0xb'));var _=require(_0xae94('0xc'));var squel=require(_0xae94('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xae94('0xe'));var toCsv=require(_0xae94('0x9'));var querystring=require('querystring');var Papa=require(_0xae94('0xf'));var Redis=require(_0xae94('0x10'));var authService=require(_0xae94('0x11'));var qs=require(_0xae94('0x12'));var as=require(_0xae94('0x13'));var hardwareService=require(_0xae94('0x14'));var logger=require(_0xae94('0x15'))(_0xae94('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xae94('0x17'));var db=require(_0xae94('0x18'))['db'];function respondWithStatusCode(_0x5de3c5,_0x1b2a36){_0x1b2a36=_0x1b2a36||0xcc;return function(_0x488159){if(_0x488159){return _0x5de3c5[_0xae94('0x19')](_0x1b2a36);}return _0x5de3c5[_0xae94('0x1a')](_0x1b2a36)[_0xae94('0x1b')]();};}function respondWithResult(_0x490d83,_0x223e35){_0x223e35=_0x223e35||0xc8;return function(_0x48bf46){if(_0x48bf46){return _0x490d83[_0xae94('0x1a')](_0x223e35)[_0xae94('0x1c')](_0x48bf46);}};}function respondWithFilteredResult(_0x17589d,_0x56a922){return function(_0x274fb3){if(_0x274fb3){var _0x5581b6=typeof _0x56a922[_0xae94('0x1d')]==='undefined'&&typeof _0x56a922[_0xae94('0x1e')]===_0xae94('0x1f');var _0x48a943=_0x274fb3['count'];var _0x3f6145=_0x5581b6?0x0:_0x56a922[_0xae94('0x1d')];var _0x296009=_0x5581b6?_0x274fb3[_0xae94('0x20')]:_0x56a922['offset']+_0x56a922[_0xae94('0x1e')];var _0x4467cc;if(_0x296009>=_0x48a943){_0x296009=_0x48a943;_0x4467cc=0xc8;}else{_0x4467cc=0xce;}_0x17589d['status'](_0x4467cc);return _0x17589d[_0xae94('0x21')](_0xae94('0x22'),_0x3f6145+'-'+_0x296009+'/'+_0x48a943)['json'](_0x274fb3);}return null;};}function patchUpdates(_0x46d84f){return function(_0xb9b721){try{jsonpatch[_0xae94('0x23')](_0xb9b721,_0x46d84f,!![]);}catch(_0xb42887){return BPromise[_0xae94('0x24')](_0xb42887);}return _0xb9b721[_0xae94('0x25')]();};}function saveUpdates(_0x3d7d0f,_0x4260a6){return function(_0x3cfd53){if(_0x3cfd53){return _0x3cfd53['update'](_0x3d7d0f)[_0xae94('0x26')](function(_0x123dd6){return _0x123dd6;});}return null;};}function removeEntity(_0x5bc532,_0x111bd8){return function(_0xea4b73){if(_0xea4b73){return _0xea4b73[_0xae94('0x27')]()['then'](function(){_0x5bc532['status'](0xcc)[_0xae94('0x1b')]();});}};}function handleEntityNotFound(_0x4a3cd4,_0x2a61ff){return function(_0x49aa3a){if(!_0x49aa3a){_0x4a3cd4[_0xae94('0x19')](0x194);}return _0x49aa3a;};}function handleError(_0xc51ace,_0x3ea78a){_0x3ea78a=_0x3ea78a||0x1f4;return function(_0xf67ced){logger['error'](_0xf67ced['stack']);if(_0xf67ced['name']){delete _0xf67ced['name'];}_0xc51ace['status'](_0x3ea78a)[_0xae94('0x28')](_0xf67ced);};}exports['show']=function(_0xd35015,_0x58e74c){var _0x223b33={'raw':!![],'where':{'id':_0xd35015[_0xae94('0x29')]['id']}},_0x3f5339={};_0x3f5339['model']=_['keys'](db[_0xae94('0x2a')][_0xae94('0x2b')]);_0x3f5339[_0xae94('0x2c')]=_[_0xae94('0x2d')](_0xd35015[_0xae94('0x2c')]);_0x3f5339[_0xae94('0x2e')]=_[_0xae94('0x2f')](_0x3f5339['model'],_0x3f5339[_0xae94('0x2c')]);_0x223b33['attributes']=_['intersection'](_0x3f5339['model'],qs[_0xae94('0x30')](_0xd35015[_0xae94('0x2c')][_0xae94('0x30')]));_0x223b33[_0xae94('0x31')]=_0x223b33['attributes']['length']?_0x223b33[_0xae94('0x31')]:_0x3f5339[_0xae94('0x32')];if(_0xd35015[_0xae94('0x2c')][_0xae94('0x33')]){_0x223b33['include']=[{'all':!![]}];}_0x223b33=_['merge']({},_0x223b33,_0xd35015[_0xae94('0x34')]);return db[_0xae94('0x2a')]['find'](_0x223b33)[_0xae94('0x26')](handleEntityNotFound(_0x58e74c,null))[_0xae94('0x26')](respondWithResult(_0x58e74c,null))[_0xae94('0x35')](handleError(_0x58e74c,null));};exports[_0xae94('0x36')]=function(_0x95590,_0x7c1e61){return db[_0xae94('0x2a')]['create'](_0x95590[_0xae94('0x37')],{})[_0xae94('0x26')](respondWithResult(_0x7c1e61,0xc9))['catch'](handleError(_0x7c1e61,null));};exports[_0xae94('0x38')]=function(_0x41b933,_0x107870){if(_0x41b933[_0xae94('0x37')]['id']){delete _0x41b933[_0xae94('0x37')]['id'];}return db[_0xae94('0x2a')][_0xae94('0x39')]({'where':{'id':_0x41b933['params']['id']}})[_0xae94('0x26')](handleEntityNotFound(_0x107870,null))[_0xae94('0x26')](saveUpdates(_0x41b933['body'],null))[_0xae94('0x26')](respondWithResult(_0x107870,null))['catch'](handleError(_0x107870,null));};exports[_0xae94('0x27')]=function(_0x326860,_0x257340){return db[_0xae94('0x2a')][_0xae94('0x39')]({'where':{'id':_0x326860[_0xae94('0x29')]['id']}})[_0xae94('0x26')](handleEntityNotFound(_0x257340,null))['then'](removeEntity(_0x257340,null))['catch'](handleError(_0x257340,null));};
\ No newline at end of file
+var _0xa990=['offset','limit','json','save','update','then','error','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','length','include','merge','options','find','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','count'];(function(_0x115eec,_0x1c3866){var _0x2ce914=function(_0x44dc63){while(--_0x44dc63){_0x115eec['push'](_0x115eec['shift']());}};_0x2ce914(++_0x1c3866);}(_0xa990,0xc9));var _0x0a99=function(_0x473cd6,_0x40672f){_0x473cd6=_0x473cd6-0x0;var _0x1bbbdd=_0xa990[_0x473cd6];return _0x1bbbdd;};'use strict';var emlformat=require(_0x0a99('0x0'));var rimraf=require(_0x0a99('0x1'));var zipdir=require(_0x0a99('0x2'));var jsonpatch=require(_0x0a99('0x3'));var rp=require(_0x0a99('0x4'));var moment=require(_0x0a99('0x5'));var BPromise=require(_0x0a99('0x6'));var Mustache=require(_0x0a99('0x7'));var util=require('util');var path=require('path');var sox=require(_0x0a99('0x8'));var csv=require(_0x0a99('0x9'));var ejs=require(_0x0a99('0xa'));var fs=require('fs');var fs_extra=require(_0x0a99('0xb'));var _=require(_0x0a99('0xc'));var squel=require(_0x0a99('0xd'));var crypto=require(_0x0a99('0xe'));var jsforce=require(_0x0a99('0xf'));var deskjs=require(_0x0a99('0x10'));var toCsv=require(_0x0a99('0x9'));var querystring=require(_0x0a99('0x11'));var Papa=require('papaparse');var Redis=require(_0x0a99('0x12'));var authService=require(_0x0a99('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a99('0x14'));var logger=require(_0x0a99('0x15'))(_0x0a99('0x16'));var utils=require(_0x0a99('0x17'));var config=require(_0x0a99('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a99('0x19'))['db'];function respondWithStatusCode(_0x3aaaad,_0x57ab88){_0x57ab88=_0x57ab88||0xcc;return function(_0xb6a34d){if(_0xb6a34d){return _0x3aaaad[_0x0a99('0x1a')](_0x57ab88);}return _0x3aaaad[_0x0a99('0x1b')](_0x57ab88)[_0x0a99('0x1c')]();};}function respondWithResult(_0x346061,_0x23d018){_0x23d018=_0x23d018||0xc8;return function(_0x18c124){if(_0x18c124){return _0x346061[_0x0a99('0x1b')](_0x23d018)['json'](_0x18c124);}};}function respondWithFilteredResult(_0x5a17e1,_0x2c40db){return function(_0x3ac17e){if(_0x3ac17e){var _0xb7356c=typeof _0x2c40db['offset']===_0x0a99('0x1d')&&typeof _0x2c40db['limit']==='undefined';var _0x20104c=_0x3ac17e[_0x0a99('0x1e')];var _0x3de006=_0xb7356c?0x0:_0x2c40db[_0x0a99('0x1f')];var _0x572ce5=_0xb7356c?_0x3ac17e['count']:_0x2c40db[_0x0a99('0x1f')]+_0x2c40db[_0x0a99('0x20')];var _0xbe23f3;if(_0x572ce5>=_0x20104c){_0x572ce5=_0x20104c;_0xbe23f3=0xc8;}else{_0xbe23f3=0xce;}_0x5a17e1[_0x0a99('0x1b')](_0xbe23f3);return _0x5a17e1['set']('Content-Range',_0x3de006+'-'+_0x572ce5+'/'+_0x20104c)[_0x0a99('0x21')](_0x3ac17e);}return null;};}function patchUpdates(_0x4d0c78){return function(_0x1e8d30){try{jsonpatch['apply'](_0x1e8d30,_0x4d0c78,!![]);}catch(_0x191ee4){return BPromise['reject'](_0x191ee4);}return _0x1e8d30[_0x0a99('0x22')]();};}function saveUpdates(_0x356681,_0x3b1d60){return function(_0x1c1e5c){if(_0x1c1e5c){return _0x1c1e5c[_0x0a99('0x23')](_0x356681)[_0x0a99('0x24')](function(_0x19c870){return _0x19c870;});}return null;};}function removeEntity(_0x1d803c,_0x398dd2){return function(_0x5745ca){if(_0x5745ca){return _0x5745ca['destroy']()[_0x0a99('0x24')](function(){_0x1d803c[_0x0a99('0x1b')](0xcc)[_0x0a99('0x1c')]();});}};}function handleEntityNotFound(_0x518617,_0x5d917c){return function(_0x371b31){if(!_0x371b31){_0x518617[_0x0a99('0x1a')](0x194);}return _0x371b31;};}function handleError(_0x1b0e94,_0x40e765){_0x40e765=_0x40e765||0x1f4;return function(_0x10e70f){logger[_0x0a99('0x25')](_0x10e70f[_0x0a99('0x26')]);if(_0x10e70f[_0x0a99('0x27')]){delete _0x10e70f[_0x0a99('0x27')];}_0x1b0e94['status'](_0x40e765)[_0x0a99('0x28')](_0x10e70f);};}exports['show']=function(_0x47bc34,_0x4e597b){var _0x223bdb={'raw':!![],'where':{'id':_0x47bc34[_0x0a99('0x29')]['id']}},_0x379c7e={};_0x379c7e[_0x0a99('0x2a')]=_[_0x0a99('0x2b')](db[_0x0a99('0x2c')][_0x0a99('0x2d')]);_0x379c7e['query']=_[_0x0a99('0x2b')](_0x47bc34[_0x0a99('0x2e')]);_0x379c7e[_0x0a99('0x2f')]=_[_0x0a99('0x30')](_0x379c7e['model'],_0x379c7e['query']);_0x223bdb['attributes']=_[_0x0a99('0x30')](_0x379c7e[_0x0a99('0x2a')],qs[_0x0a99('0x31')](_0x47bc34['query'][_0x0a99('0x31')]));_0x223bdb[_0x0a99('0x32')]=_0x223bdb[_0x0a99('0x32')][_0x0a99('0x33')]?_0x223bdb[_0x0a99('0x32')]:_0x379c7e[_0x0a99('0x2a')];if(_0x47bc34[_0x0a99('0x2e')]['includeAll']){_0x223bdb[_0x0a99('0x34')]=[{'all':!![]}];}_0x223bdb=_[_0x0a99('0x35')]({},_0x223bdb,_0x47bc34[_0x0a99('0x36')]);return db[_0x0a99('0x2c')][_0x0a99('0x37')](_0x223bdb)['then'](handleEntityNotFound(_0x4e597b,null))[_0x0a99('0x24')](respondWithResult(_0x4e597b,null))['catch'](handleError(_0x4e597b,null));};exports['create']=function(_0x5f20d0,_0x51b4ec){return db[_0x0a99('0x2c')]['create'](_0x5f20d0[_0x0a99('0x38')],{})[_0x0a99('0x24')](respondWithResult(_0x51b4ec,0xc9))[_0x0a99('0x39')](handleError(_0x51b4ec,null));};exports[_0x0a99('0x23')]=function(_0x414a0f,_0x43614d){if(_0x414a0f[_0x0a99('0x38')]['id']){delete _0x414a0f[_0x0a99('0x38')]['id'];}return db[_0x0a99('0x2c')][_0x0a99('0x37')]({'where':{'id':_0x414a0f[_0x0a99('0x29')]['id']}})[_0x0a99('0x24')](handleEntityNotFound(_0x43614d,null))[_0x0a99('0x24')](saveUpdates(_0x414a0f['body'],null))[_0x0a99('0x24')](respondWithResult(_0x43614d,null))[_0x0a99('0x39')](handleError(_0x43614d,null));};exports['destroy']=function(_0x3f0a9,_0x549bb9){return db[_0x0a99('0x2c')]['find']({'where':{'id':_0x3f0a9[_0x0a99('0x29')]['id']}})[_0x0a99('0x24')](handleEntityNotFound(_0x549bb9,null))[_0x0a99('0x24')](removeEntity(_0x549bb9,null))[_0x0a99('0x39')](handleError(_0x549bb9,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 77a4600..59a5b99 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 _0xe6e2=['request-promise','path','rimraf','../../config/environment','exports','define','ChatProactiveAction','lodash','util','../../config/logger','api','moment'];(function(_0x48e338,_0x240edf){var _0x5bf51e=function(_0x16e6b2){while(--_0x16e6b2){_0x48e338['push'](_0x48e338['shift']());}};_0x5bf51e(++_0x240edf);}(_0xe6e2,0x1b7));var _0x2e6e=function(_0xc7e7ba,_0x2ec03e){_0xc7e7ba=_0xc7e7ba-0x0;var _0x5d22b2=_0xe6e2[_0xc7e7ba];return _0x5d22b2;};'use strict';var _=require(_0x2e6e('0x0'));var util=require(_0x2e6e('0x1'));var logger=require(_0x2e6e('0x2'))(_0x2e6e('0x3'));var moment=require(_0x2e6e('0x4'));var BPromise=require('bluebird');var rp=require(_0x2e6e('0x5'));var fs=require('fs');var path=require(_0x2e6e('0x6'));var rimraf=require(_0x2e6e('0x7'));var config=require(_0x2e6e('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0x2e6e('0x9')]=function(_0x546011,_0x102deb){return _0x546011[_0x2e6e('0xa')](_0x2e6e('0xb'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3a68=['./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0xde3560,_0x4fdc30){var _0xc57df7=function(_0x4328b2){while(--_0x4328b2){_0xde3560['push'](_0xde3560['shift']());}};_0xc57df7(++_0x4fdc30);}(_0x3a68,0x1d2));var _0x83a6=function(_0x57b30c,_0x3013aa){_0x57b30c=_0x57b30c-0x0;var _0x11a5fd=_0x3a68[_0x57b30c];return _0x11a5fd;};'use strict';var _=require(_0x83a6('0x0'));var util=require(_0x83a6('0x1'));var logger=require(_0x83a6('0x2'))('api');var moment=require(_0x83a6('0x3'));var BPromise=require('bluebird');var rp=require(_0x83a6('0x4'));var fs=require('fs');var path=require(_0x83a6('0x5'));var rimraf=require('rimraf');var config=require(_0x83a6('0x6'));var attributes=require(_0x83a6('0x7'));module[_0x83a6('0x8')]=function(_0x17e08f,_0x1f6c80){return _0x17e08f['define'](_0x83a6('0x9'),attributes,{'tableName':_0x83a6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 02c5219..caf6e2f 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 _0xafbc=['ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','then','ChatProactiveAction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','util','moment','bluebird'];(function(_0x253dad,_0x3bfafa){var _0x6c42df=function(_0x32fd1c){while(--_0x32fd1c){_0x253dad['push'](_0x253dad['shift']());}};_0x6c42df(++_0x3bfafa);}(_0xafbc,0x1a1));var _0xcafb=function(_0x3f158b,_0x52ade4){_0x3f158b=_0x3f158b-0x0;var _0x132ee2=_0xafbc[_0x3f158b];return _0x132ee2;};'use strict';var _=require('lodash');var util=require(_0xcafb('0x0'));var moment=require(_0xcafb('0x1'));var BPromise=require(_0xcafb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcafb('0x3'));var db=require(_0xcafb('0x4'))['db'];var utils=require(_0xcafb('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcafb('0x6'));var client=jayson['client'][_0xcafb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4623a4,_0x5b0e09,_0x453ec4){return new BPromise(function(_0x4c820f,_0x27d411){return client[_0xcafb('0x8')](_0x4623a4,_0x453ec4)[_0xcafb('0x9')](function(_0x413078){logger['info'](_0xcafb('0xa'),_0x5b0e09,'request\x20sent');logger[_0xcafb('0xb')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x5b0e09,_0xcafb('0xc'),JSON[_0xcafb('0xd')](_0x413078));if(_0x413078[_0xcafb('0xe')]){if(_0x413078[_0xcafb('0xe')][_0xcafb('0xf')]===0x1f4){logger[_0xcafb('0xe')](_0xcafb('0xa'),_0x5b0e09,_0x413078['error'][_0xcafb('0x10')]);return _0x27d411(_0x413078[_0xcafb('0xe')]['message']);}logger[_0xcafb('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x5b0e09,_0x413078[_0xcafb('0xe')][_0xcafb('0x10')]);return _0x4c820f(_0x413078[_0xcafb('0xe')][_0xcafb('0x10')]);}else{logger[_0xcafb('0x11')](_0xcafb('0xa'),_0x5b0e09,_0xcafb('0xc'));_0x4c820f(_0x413078[_0xcafb('0x12')][_0xcafb('0x10')]);}})[_0xcafb('0x13')](function(_0x28a773){logger[_0xcafb('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x5b0e09,_0x28a773);_0x27d411(_0x28a773);});});}
\ No newline at end of file
+var _0xe189=['stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s'];(function(_0x388e6c,_0x2ca243){var _0x3dc6de=function(_0x1dfd84){while(--_0x1dfd84){_0x388e6c['push'](_0x388e6c['shift']());}};_0x3dc6de(++_0x2ca243);}(_0xe189,0x194));var _0x9e18=function(_0x2e3992,_0x4322fa){_0x2e3992=_0x2e3992-0x0;var _0x724b7b=_0xe189[_0x2e3992];return _0x724b7b;};'use strict';var _=require(_0x9e18('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9e18('0x1'));var rs=require(_0x9e18('0x2'));var fs=require('fs');var Redis=require(_0x9e18('0x3'));var db=require(_0x9e18('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9e18('0x5'));var config=require(_0x9e18('0x6'));var jayson=require(_0x9e18('0x7'));var client=jayson[_0x9e18('0x8')][_0x9e18('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e6097,_0x3153cf,_0x2e4691){return new BPromise(function(_0x4656a4,_0x50a0ce){return client[_0x9e18('0xa')](_0x5e6097,_0x2e4691)[_0x9e18('0xb')](function(_0x33e9cd){logger['info'](_0x9e18('0xc'),_0x3153cf,_0x9e18('0xd'));logger[_0x9e18('0xe')](_0x9e18('0xf'),_0x3153cf,_0x9e18('0xd'),JSON[_0x9e18('0x10')](_0x33e9cd));if(_0x33e9cd[_0x9e18('0x11')]){if(_0x33e9cd[_0x9e18('0x11')][_0x9e18('0x12')]===0x1f4){logger['error'](_0x9e18('0xc'),_0x3153cf,_0x33e9cd['error'][_0x9e18('0x13')]);return _0x50a0ce(_0x33e9cd[_0x9e18('0x11')]['message']);}logger[_0x9e18('0x11')](_0x9e18('0xc'),_0x3153cf,_0x33e9cd[_0x9e18('0x11')][_0x9e18('0x13')]);return _0x4656a4(_0x33e9cd['error'][_0x9e18('0x13')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x3153cf,_0x9e18('0xd'));_0x4656a4(_0x33e9cd['result'][_0x9e18('0x13')]);}})[_0x9e18('0x14')](function(_0x1f71fc){logger[_0x9e18('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x3153cf,_0x1f71fc);_0x50a0ce(_0x1f71fc);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 1fcb69d..144ecd7 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 _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(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xeff8,0x186));var _0x8eff=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xeff8[_0x2a6809];return _0x11c371;};'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
+var _0xed1f=['../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2ee172,_0x278363){var _0x2106e7=function(_0x54f214){while(--_0x54f214){_0x2ee172['push'](_0x2ee172['shift']());}};_0x2106e7(++_0x278363);}(_0xed1f,0x6a));var _0xfed1=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xed1f[_0x346737];return _0x1ade2e;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require(_0xfed1('0x2'));var timeout=require(_0xfed1('0x3'));var express=require(_0xfed1('0x4'));var router=express[_0xfed1('0x5')]();var fs_extra=require(_0xfed1('0x6'));var auth=require(_0xfed1('0x7'));var interaction=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var controller=require(_0xfed1('0xa'));router[_0xfed1('0xb')](_0xfed1('0xc'),auth[_0xfed1('0xd')](),controller[_0xfed1('0xe')]);router[_0xfed1('0xf')]('/',auth[_0xfed1('0xd')](),controller[_0xfed1('0x10')]);router['put'](_0xfed1('0xc'),auth[_0xfed1('0xd')](),controller['update']);router[_0xfed1('0x11')](_0xfed1('0xc'),auth['isAuthenticated'](),controller[_0xfed1('0x12')]);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 61adbda..0e3c363 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 _0x9bfd=['name','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x2a3b42,_0x945f41){var _0x1fafd3=function(_0x2667f7){while(--_0x2667f7){_0x2a3b42['push'](_0x2a3b42['shift']());}};_0x1fafd3(++_0x945f41);}(_0x9bfd,0x165));var _0xd9bf=function(_0x12ee9f,_0x56d7e1){_0x12ee9f=_0x12ee9f-0x0;var _0x527bce=_0x9bfd[_0x12ee9f];return _0x527bce;};'use strict';var Sequelize=require(_0xd9bf('0x0'));module[_0xd9bf('0x1')]={'name':{'type':Sequelize[_0xd9bf('0x2')],'unique':_0xd9bf('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd9bf('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd9bf('0x5'),_0xd9bf('0x6'),_0xd9bf('0x7'))}};
\ No newline at end of file
+var _0xecc6=['STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','name'];(function(_0x32b645,_0x38267b){var _0xa82341=function(_0xa91833){while(--_0xa91833){_0x32b645['push'](_0x32b645['shift']());}};_0xa82341(++_0x38267b);}(_0xecc6,0x15d));var _0x6ecc=function(_0x2326ff,_0x27e552){_0x2326ff=_0x2326ff-0x0;var _0x54bd8d=_0xecc6[_0x2326ff];return _0x54bd8d;};'use strict';var Sequelize=require(_0x6ecc('0x0'));module[_0x6ecc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6ecc('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6ecc('0x3')]},'timeout':{'type':Sequelize[_0x6ecc('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6ecc('0x5')](_0x6ecc('0x6'),'beepall',_0x6ecc('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index f56a386..04aa949 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 _0xf36f=['ids','Agents','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','TeamId','includes','all','union','compact','isEmpty','userChatQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','ChatQueues','UserProfileResource','name','send','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','includeAll','include','ChatQueue','show','params','keys','rawAttributes','find','create','body','get','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','filter','findAll','User','agent','updatedAt','createdAt','rows','format','SIP','chatPause','getTeams','Team','addTeams'];(function(_0x4ac88c,_0x26411c){var _0x55f9e6=function(_0x45259c){while(--_0x45259c){_0x4ac88c['push'](_0x4ac88c['shift']());}};_0x55f9e6(++_0x26411c);}(_0xf36f,0x146));var _0xff36=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf36f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xff36('0x0'));var rp=require(_0xff36('0x1'));var moment=require(_0xff36('0x2'));var BPromise=require(_0xff36('0x3'));var Mustache=require(_0xff36('0x4'));var util=require(_0xff36('0x5'));var path=require('path');var sox=require(_0xff36('0x6'));var csv=require(_0xff36('0x7'));var ejs=require(_0xff36('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xff36('0x9'));var crypto=require(_0xff36('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xff36('0xb'));var toCsv=require(_0xff36('0x7'));var querystring=require(_0xff36('0xc'));var Papa=require(_0xff36('0xd'));var Redis=require(_0xff36('0xe'));var authService=require(_0xff36('0xf'));var qs=require(_0xff36('0x10'));var as=require(_0xff36('0x11'));var hardwareService=require(_0xff36('0x12'));var logger=require(_0xff36('0x13'))(_0xff36('0x14'));var utils=require('../../config/utils');var config=require(_0xff36('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xff36('0x16'))['db'];config[_0xff36('0x17')]=_[_0xff36('0x18')](config['redis'],{'host':_0xff36('0x19'),'port':0x18eb});var socket=require(_0xff36('0x1a'))(new Redis(config[_0xff36('0x17')]));require(_0xff36('0x1b'))[_0xff36('0x1c')](socket);var jayson=require(_0xff36('0x1d'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43affc,_0x2221c8,_0x3689ea,_0x39441c){return new BPromise(function(_0x49a5b3,_0x55bf0e){var _0xbf5707=_0x39441c||client;return _0xbf5707['request'](_0x43affc,_0x3689ea)[_0xff36('0x1e')](function(_0x518ece){logger[_0xff36('0x1f')](_0xff36('0x20'),_0x2221c8,_0xff36('0x21'));logger[_0xff36('0x22')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2221c8,'request\x20sent',JSON['stringify'](_0x518ece));if(_0x518ece[_0xff36('0x23')]){if(_0x518ece['error']['code']===0x1f4){logger[_0xff36('0x23')](_0xff36('0x20'),_0x2221c8,_0x518ece[_0xff36('0x23')]['message']);return _0x55bf0e(_0x518ece[_0xff36('0x23')][_0xff36('0x24')]);}logger[_0xff36('0x23')](_0xff36('0x20'),_0x2221c8,_0x518ece[_0xff36('0x23')][_0xff36('0x24')]);return _0x49a5b3(_0x518ece[_0xff36('0x23')][_0xff36('0x24')]);}else{logger[_0xff36('0x1f')](_0xff36('0x20'),_0x2221c8,_0xff36('0x21'));_0x49a5b3(_0x518ece[_0xff36('0x25')][_0xff36('0x24')]);}})[_0xff36('0x26')](function(_0x388df7){logger[_0xff36('0x23')](_0xff36('0x20'),_0x2221c8,_0x388df7);_0x55bf0e(_0x388df7);});});}function respondWithStatusCode(_0x3e7a0e,_0x21f19f){_0x21f19f=_0x21f19f||0xcc;return function(_0x4272d3){if(_0x4272d3){return _0x3e7a0e[_0xff36('0x27')](_0x21f19f);}return _0x3e7a0e[_0xff36('0x28')](_0x21f19f)[_0xff36('0x29')]();};}function respondWithResult(_0x4561cf,_0x4b3567){_0x4b3567=_0x4b3567||0xc8;return function(_0x59a41d){if(_0x59a41d){return _0x4561cf['status'](_0x4b3567)[_0xff36('0x2a')](_0x59a41d);}};}function respondWithFilteredResult(_0x3a6616,_0x544344){return function(_0x398f50){if(_0x398f50){var _0x1f5db3=typeof _0x544344[_0xff36('0x2b')]===_0xff36('0x2c')&&typeof _0x544344[_0xff36('0x2d')]===_0xff36('0x2c');var _0x364a6a=_0x398f50[_0xff36('0x2e')];var _0x108891=_0x1f5db3?0x0:_0x544344[_0xff36('0x2b')];var _0x24c086=_0x1f5db3?_0x398f50[_0xff36('0x2e')]:_0x544344['offset']+_0x544344[_0xff36('0x2d')];var _0x19cef4;if(_0x24c086>=_0x364a6a){_0x24c086=_0x364a6a;_0x19cef4=0xc8;}else{_0x19cef4=0xce;}_0x3a6616['status'](_0x19cef4);return _0x3a6616[_0xff36('0x2f')](_0xff36('0x30'),_0x108891+'-'+_0x24c086+'/'+_0x364a6a)[_0xff36('0x2a')](_0x398f50);}return null;};}function patchUpdates(_0x359530){return function(_0x723057){try{jsonpatch[_0xff36('0x31')](_0x723057,_0x359530,!![]);}catch(_0x531f2f){return BPromise[_0xff36('0x32')](_0x531f2f);}return _0x723057[_0xff36('0x33')]();};}function saveUpdates(_0x46057a,_0x7d770f){return function(_0x339953){if(_0x339953){return _0x339953[_0xff36('0x34')](_0x46057a)['then'](function(_0x1e066d){return _0x1e066d;});}return null;};}function removeEntity(_0x5716c0,_0x2d8581){return function(_0x40e310){if(_0x40e310){return _0x40e310['destroy']()[_0xff36('0x1e')](function(){var _0x501344=_0x40e310['get']({'plain':!![]});var _0x16a74a=_0xff36('0x35');return db[_0xff36('0x36')]['destroy']({'where':{'type':_0x16a74a,'resourceId':_0x501344['id']}})[_0xff36('0x1e')](function(){return _0x40e310;});})['then'](function(){_0x5716c0['status'](0xcc)[_0xff36('0x29')]();});}};}function handleEntityNotFound(_0x18c4a6,_0x3c13f5){return function(_0x294b15){if(!_0x294b15){_0x18c4a6[_0xff36('0x27')](0x194);}return _0x294b15;};}function handleError(_0x4098d1,_0x2879a8){_0x2879a8=_0x2879a8||0x1f4;return function(_0x4e80bf){logger[_0xff36('0x23')](_0x4e80bf['stack']);if(_0x4e80bf[_0xff36('0x37')]){delete _0x4e80bf[_0xff36('0x37')];}_0x4098d1['status'](_0x2879a8)[_0xff36('0x38')](_0x4e80bf);};}exports['index']=function(_0x3c28fc,_0x2c0599){var _0x1aa22f={},_0x3ef1bd={},_0x5ef18e={'count':0x0,'rows':[]};var _0x449e25=_[_0xff36('0x39')](db['ChatQueue']['rawAttributes'],function(_0x473deb){return{'name':_0x473deb[_0xff36('0x3a')],'type':_0x473deb[_0xff36('0x3b')][_0xff36('0x3c')]};});_0x3ef1bd[_0xff36('0x3d')]=_[_0xff36('0x39')](_0x449e25,_0xff36('0x37'));_0x3ef1bd['query']=_['keys'](_0x3c28fc[_0xff36('0x3e')]);_0x3ef1bd[_0xff36('0x3f')]=_[_0xff36('0x40')](_0x3ef1bd[_0xff36('0x3d')],_0x3ef1bd[_0xff36('0x3e')]);_0x1aa22f['attributes']=_['intersection'](_0x3ef1bd[_0xff36('0x3d')],qs['fields'](_0x3c28fc[_0xff36('0x3e')][_0xff36('0x41')]));_0x1aa22f['attributes']=_0x1aa22f[_0xff36('0x42')][_0xff36('0x43')]?_0x1aa22f[_0xff36('0x42')]:_0x3ef1bd[_0xff36('0x3d')];if(!_0x3c28fc[_0xff36('0x3e')][_0xff36('0x44')](_0xff36('0x45'))){_0x1aa22f['limit']=qs[_0xff36('0x2d')](_0x3c28fc[_0xff36('0x3e')][_0xff36('0x2d')]);_0x1aa22f[_0xff36('0x2b')]=qs[_0xff36('0x2b')](_0x3c28fc[_0xff36('0x3e')][_0xff36('0x2b')]);}_0x1aa22f['order']=qs[_0xff36('0x46')](_0x3c28fc['query']['sort']);_0x1aa22f[_0xff36('0x47')]=qs[_0xff36('0x3f')](_[_0xff36('0x48')](_0x3c28fc[_0xff36('0x3e')],_0x3ef1bd[_0xff36('0x3f')]),_0x449e25);if(_0x3c28fc['query']['filter']){_0x1aa22f['where']=_['merge'](_0x1aa22f[_0xff36('0x47')],{'$or':_[_0xff36('0x39')](_0x449e25,function(_0x471ba3){if(_0x471ba3[_0xff36('0x3b')]!==_0xff36('0x49')){var _0x4b1889={};_0x4b1889[_0x471ba3['name']]={'$like':'%'+_0x3c28fc[_0xff36('0x3e')]['filter']+'%'};return _0x4b1889;}})});}_0x1aa22f=_[_0xff36('0x4a')]({},_0x1aa22f,_0x3c28fc[_0xff36('0x4b')]);var _0x3882e0={'where':_0x1aa22f[_0xff36('0x47')]};return db['ChatQueue'][_0xff36('0x2e')](_0x3882e0)['then'](function(_0x3c0912){_0x5ef18e[_0xff36('0x2e')]=_0x3c0912;if(_0x3c28fc[_0xff36('0x3e')][_0xff36('0x4c')]){_0x1aa22f[_0xff36('0x4d')]=[{'all':!![]}];}return db[_0xff36('0x4e')]['findAll'](_0x1aa22f);})[_0xff36('0x1e')](function(_0x256a65){_0x5ef18e['rows']=_0x256a65;return _0x5ef18e;})[_0xff36('0x1e')](respondWithFilteredResult(_0x2c0599,_0x1aa22f))['catch'](handleError(_0x2c0599,null));};exports[_0xff36('0x4f')]=function(_0x596ac8,_0x5d5649){var _0x59c9e4={'raw':!![],'where':{'id':_0x596ac8[_0xff36('0x50')]['id']}},_0x31f06b={};_0x31f06b[_0xff36('0x3d')]=_[_0xff36('0x51')](db[_0xff36('0x4e')][_0xff36('0x52')]);_0x31f06b[_0xff36('0x3e')]=_[_0xff36('0x51')](_0x596ac8[_0xff36('0x3e')]);_0x31f06b[_0xff36('0x3f')]=_[_0xff36('0x40')](_0x31f06b[_0xff36('0x3d')],_0x31f06b['query']);_0x59c9e4[_0xff36('0x42')]=_[_0xff36('0x40')](_0x31f06b[_0xff36('0x3d')],qs[_0xff36('0x41')](_0x596ac8['query'][_0xff36('0x41')]));_0x59c9e4[_0xff36('0x42')]=_0x59c9e4[_0xff36('0x42')][_0xff36('0x43')]?_0x59c9e4[_0xff36('0x42')]:_0x31f06b['model'];if(_0x596ac8[_0xff36('0x3e')][_0xff36('0x4c')]){_0x59c9e4['include']=[{'all':!![]}];}_0x59c9e4=_[_0xff36('0x4a')]({},_0x59c9e4,_0x596ac8[_0xff36('0x4b')]);return db[_0xff36('0x4e')][_0xff36('0x53')](_0x59c9e4)[_0xff36('0x1e')](handleEntityNotFound(_0x5d5649,null))['then'](respondWithResult(_0x5d5649,null))['catch'](handleError(_0x5d5649,null));};exports[_0xff36('0x54')]=function(_0x3732ca,_0x4d99a7){return db[_0xff36('0x4e')][_0xff36('0x54')](_0x3732ca[_0xff36('0x55')],{})['then'](function(_0x3b76f3){var _0x14b1a3=_0x3732ca['user'][_0xff36('0x56')]({'plain':!![]});if(!_0x14b1a3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14b1a3[_0xff36('0x57')]===_0xff36('0x58')){var _0x3cc9a2=_0x3b76f3['get']({'plain':!![]});var _0x2ddc9b=_0xff36('0x35');return db['UserProfileSection']['find']({'where':{'name':_0x2ddc9b,'userProfileId':_0x14b1a3[_0xff36('0x59')]},'raw':!![]})[_0xff36('0x1e')](function(_0x1a5758){if(_0x1a5758&&_0x1a5758[_0xff36('0x5a')]===0x0){return db['UserProfileResource'][_0xff36('0x54')]({'name':_0x3cc9a2[_0xff36('0x37')],'resourceId':_0x3cc9a2['id'],'type':_0x1a5758['name'],'sectionId':_0x1a5758['id']},{})[_0xff36('0x1e')](function(){return _0x3b76f3;});}else{return _0x3b76f3;}})[_0xff36('0x26')](function(_0x2f66f2){logger[_0xff36('0x23')](_0xff36('0x5b'),_0x2f66f2);throw _0x2f66f2;});}return _0x3b76f3;})[_0xff36('0x1e')](respondWithResult(_0x4d99a7,0xc9))[_0xff36('0x26')](handleError(_0x4d99a7,null));};exports[_0xff36('0x34')]=function(_0x4bd540,_0x322271){if(_0x4bd540[_0xff36('0x55')]['id']){delete _0x4bd540[_0xff36('0x55')]['id'];}return db[_0xff36('0x4e')][_0xff36('0x53')]({'where':{'id':_0x4bd540[_0xff36('0x50')]['id']}})[_0xff36('0x1e')](handleEntityNotFound(_0x322271,null))[_0xff36('0x1e')](saveUpdates(_0x4bd540[_0xff36('0x55')],null))['then'](respondWithResult(_0x322271,null))[_0xff36('0x26')](handleError(_0x322271,null));};exports[_0xff36('0x5c')]=function(_0x5ecc44,_0x37f819){return db['ChatQueue']['find']({'where':{'id':_0x5ecc44[_0xff36('0x50')]['id']}})[_0xff36('0x1e')](handleEntityNotFound(_0x37f819,null))[_0xff36('0x1e')](removeEntity(_0x37f819,null))[_0xff36('0x26')](handleError(_0x37f819,null));};exports[_0xff36('0x5d')]=function(_0x427eea,_0x2b9a01){return db['ChatQueue'][_0xff36('0x5d')]()['then'](respondWithResult(_0x2b9a01,null))[_0xff36('0x26')](handleError(_0x2b9a01,null));};exports[_0xff36('0x5e')]=function(_0x95a902,_0x5830bd,_0x227f2d){var _0x1e0b09={'raw':!![],'where':{}},_0x9779e6={},_0x33930f;return db[_0xff36('0x4e')][_0xff36('0x5f')]({'where':{'id':_0x95a902['params']['id']}})['then'](handleEntityNotFound(_0x5830bd,null))[_0xff36('0x1e')](function(_0x158f53){if(_0x158f53){_0x33930f=_0x158f53[_0xff36('0x56')]({'plain':!![]});_0x9779e6[_0xff36('0x3d')]=_['keys'](db[_0xff36('0x60')]['rawAttributes']);_0x9779e6[_0xff36('0x3e')]=_[_0xff36('0x51')](_0x95a902[_0xff36('0x3e')]);_0x9779e6[_0xff36('0x3f')]=_[_0xff36('0x40')](_0x9779e6[_0xff36('0x3d')],_0x9779e6[_0xff36('0x3e')]);_0x1e0b09[_0xff36('0x42')]=_[_0xff36('0x40')](_0x9779e6[_0xff36('0x3d')],qs[_0xff36('0x41')](_0x95a902['query']['fields']));_0x1e0b09[_0xff36('0x42')]=_0x1e0b09[_0xff36('0x42')][_0xff36('0x43')]?_0x1e0b09[_0xff36('0x42')]:_0x9779e6[_0xff36('0x3d')];if(!_0x95a902['query'][_0xff36('0x44')](_0xff36('0x45'))){_0x1e0b09[_0xff36('0x2d')]=qs[_0xff36('0x2d')](_0x95a902[_0xff36('0x3e')]['limit']);_0x1e0b09[_0xff36('0x2b')]=qs[_0xff36('0x2b')](_0x95a902[_0xff36('0x3e')][_0xff36('0x2b')]);}_0x1e0b09[_0xff36('0x61')]=qs[_0xff36('0x46')](_0x95a902[_0xff36('0x3e')][_0xff36('0x46')]);_0x1e0b09[_0xff36('0x47')]=qs[_0xff36('0x3f')](_['pick'](_0x95a902['query'],_0x9779e6['filters']));_0x1e0b09[_0xff36('0x47')][_0xff36('0x62')]=_0x158f53['id'];if(_0x95a902['query'][_0xff36('0x63')]){_0x1e0b09[_0xff36('0x47')]=_[_0xff36('0x4a')](_0x1e0b09[_0xff36('0x47')],{'$or':_[_0xff36('0x39')](_0x1e0b09[_0xff36('0x42')],function(_0x4378e2){var _0x216703={};_0x216703[_0x4378e2]={'$like':'%'+_0x95a902[_0xff36('0x3e')][_0xff36('0x63')]+'%'};return _0x216703;})});}_0x1e0b09=_['merge']({},_0x1e0b09,_0x95a902[_0xff36('0x4b')]);return db[_0xff36('0x60')][_0xff36('0x64')](_0x1e0b09);}})['then'](function(_0x6c7edc){if(_0x6c7edc){return db[_0xff36('0x65')]['findAndCountAll']({'where':{'id':_[_0xff36('0x39')](_0x6c7edc,'UserId'),'role':_0xff36('0x66')},'attributes':['id',_0xff36('0x37'),'chatPause',_0xff36('0x67'),_0xff36('0x68')]});}})[_0xff36('0x1e')](function(_0x21da5e){if(_0x21da5e){return{'count':_0x21da5e[_0xff36('0x2e')],'rows':_[_0xff36('0x39')](_0x21da5e[_0xff36('0x69')],function(_0x27000b){return{'membername':_0x27000b['name'],'UserId':_0x27000b['id'],'queue_name':_0x33930f[_0xff36('0x37')],'ChatQueueId':_0x33930f['id'],'interface':util[_0xff36('0x6a')]('%s/%s',_0xff36('0x6b'),_0x27000b['name']),'penalty':0x0,'paused':_0x27000b[_0xff36('0x6c')],'createdAt':_0x27000b[_0xff36('0x68')],'updatedAt':_0x27000b[_0xff36('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xff36('0x1e')](respondWithFilteredResult(_0x5830bd,_0x1e0b09))[_0xff36('0x26')](handleError(_0x5830bd,null));};exports[_0xff36('0x6d')]=function(_0x525305,_0x5b9023,_0x93d230){var _0x36293e={};var _0x1f8208={};var _0x23c355;var _0x2fc271;return db['ChatQueue'][_0xff36('0x5f')]({'where':{'id':_0x525305[_0xff36('0x50')]['id']}})['then'](handleEntityNotFound(_0x5b9023,null))[_0xff36('0x1e')](function(_0x55a76b){if(_0x55a76b){_0x23c355=_0x55a76b;_0x1f8208[_0xff36('0x3d')]=_[_0xff36('0x51')](db[_0xff36('0x6e')][_0xff36('0x52')]);_0x1f8208[_0xff36('0x3e')]=_['keys'](_0x525305[_0xff36('0x3e')]);_0x1f8208[_0xff36('0x3f')]=_['intersection'](_0x1f8208[_0xff36('0x3d')],_0x1f8208[_0xff36('0x3e')]);_0x36293e[_0xff36('0x42')]=_[_0xff36('0x40')](_0x1f8208[_0xff36('0x3d')],qs['fields'](_0x525305[_0xff36('0x3e')][_0xff36('0x41')]));_0x36293e['attributes']=_0x36293e[_0xff36('0x42')]['length']?_0x36293e[_0xff36('0x42')]:_0x1f8208[_0xff36('0x3d')];_0x36293e['order']=qs[_0xff36('0x46')](_0x525305['query'][_0xff36('0x46')]);_0x36293e['where']=qs[_0xff36('0x3f')](_['pick'](_0x525305[_0xff36('0x3e')],_0x1f8208[_0xff36('0x3f')]));if(_0x525305[_0xff36('0x3e')][_0xff36('0x63')]){_0x36293e[_0xff36('0x47')]=_[_0xff36('0x4a')](_0x36293e[_0xff36('0x47')],{'$or':_[_0xff36('0x39')](_0x36293e[_0xff36('0x42')],function(_0xc52523){var _0x5514a6={};_0x5514a6[_0xc52523]={'$like':'%'+_0x525305['query'][_0xff36('0x63')]+'%'};return _0x5514a6;})});}_0x36293e=_[_0xff36('0x4a')]({},_0x36293e,_0x525305[_0xff36('0x4b')]);return _0x23c355[_0xff36('0x6d')](_0x36293e);}})[_0xff36('0x1e')](function(_0x73f852){if(_0x73f852){_0x2fc271=_0x73f852[_0xff36('0x43')];if(!_0x525305['query'][_0xff36('0x44')](_0xff36('0x45'))){_0x36293e[_0xff36('0x2d')]=qs[_0xff36('0x2d')](_0x525305['query'][_0xff36('0x2d')]);_0x36293e[_0xff36('0x2b')]=qs[_0xff36('0x2b')](_0x525305[_0xff36('0x3e')][_0xff36('0x2b')]);}return _0x23c355[_0xff36('0x6d')](_0x36293e);}})[_0xff36('0x1e')](function(_0x18b246){if(_0x18b246){return _0x18b246?{'count':_0x2fc271,'rows':_0x18b246}:null;}})['then'](respondWithResult(_0x5b9023,null))[_0xff36('0x26')](handleError(_0x5b9023,null));};exports[_0xff36('0x6f')]=function(_0x47a1cd,_0x25ce6d,_0x1832b5){var _0x20650b=_0x47a1cd[_0xff36('0x55')][_0xff36('0x70')];return db[_0xff36('0x6e')]['findAll']({'where':{'id':_0x20650b},'attributes':['id'],'include':[{'model':db['User'],'as':_0xff36('0x71'),'attributes':['id',_0xff36('0x37'),'online',_0xff36('0x72'),_0xff36('0x73')],'raw':!![]}]})[_0xff36('0x1e')](function(_0x484809){if(_0x484809){var _0x3cd739=_['flatMap'](_0x484809,function(_0x360b2f){var _0x4771ad=_0x360b2f[_0xff36('0x56')]({'plain':!![]});return _0x4771ad[_0xff36('0x71')];});return db[_0xff36('0x4e')][_0xff36('0x53')]({'where':{'id':_0x47a1cd[_0xff36('0x50')]['id']}})['then'](function(_0x33dfb5){return db[_0xff36('0x74')][_0xff36('0x75')](function(_0x2fa524){return _0x33dfb5[_0xff36('0x6f')](_0x20650b,{'transaction':_0x2fa524})[_0xff36('0x1e')](function(){return BPromise[_0xff36('0x76')](_0x3cd739,function(_0xb64c5c){return db[_0xff36('0x60')][_0xff36('0x77')]({'where':{'UserId':_0xb64c5c['id'],'ChatQueueId':_0x47a1cd[_0xff36('0x50')]['id']},'transaction':_0x2fa524});});})[_0xff36('0x1e')](function(){_0x3cd739[_0xff36('0x78')](function(_0x49696b){socket[_0xff36('0x79')](_0xff36('0x7a'),{'UserId':_0x49696b['id'],'ChatQueueId':_0x33dfb5['id']});});});});});}})['then'](respondWithStatusCode(_0x25ce6d,null))[_0xff36('0x26')](handleError(_0x25ce6d,null));};exports[_0xff36('0x7b')]=function(_0x2840fb,_0x43cdd0,_0x4531d6){return db['Team'][_0xff36('0x64')]({'where':{'id':_0x2840fb['query'][_0xff36('0x70')]},'attributes':['id'],'include':[{'model':db[_0xff36('0x65')],'as':_0xff36('0x71'),'attributes':['id'],'raw':!![]}]})[_0xff36('0x1e')](handleEntityNotFound(_0x43cdd0,null))[_0xff36('0x1e')](function(_0x3380ea){var _0x169ffa=_['map'](_0x3380ea,'id');var _0x4bab9d=[];var _0x3d1804=[];var _0x169b4b=squel['select']();_0x169b4b[_0xff36('0x7c')](_0xff36('0x7d'))['from'](_0xff36('0x7e'),'tq')[_0xff36('0x7f')]('user_has_teams','ut',_0xff36('0x80'))[_0xff36('0x47')](_0xff36('0x81'),_0x2840fb[_0xff36('0x50')]['id']);for(var _0x3a653f=0x0;_0x3a653f<_0x3380ea['length'];_0x3a653f+=0x1){let _0x2c1773=_0x3380ea[_0x3a653f];for(var _0xdd3bed=0x0;_0xdd3bed<_0x2c1773[_0xff36('0x71')][_0xff36('0x43')];_0xdd3bed+=0x1){let _0x3535ad=_0x2c1773[_0xff36('0x71')][_0xdd3bed];var _0xcc9091=_0x169b4b[_0xff36('0x82')]();_0xcc9091[_0xff36('0x47')]('ut.UserId\x20=\x20?',_0x3535ad['id']);_0x3d1804[_0xff36('0x83')](db[_0xff36('0x74')][_0xff36('0x3e')](_0xcc9091[_0xff36('0x84')](),{'type':db[_0xff36('0x74')][_0xff36('0x85')]['SELECT']})[_0xff36('0x1e')](function(_0x90a0bd){if(_0x90a0bd[_0xff36('0x43')]===0x1){return _0x3535ad['id'];}else{var _0x57a9fc=_['every'](_['map'](_0x90a0bd,_0xff36('0x86')),function(_0x36c962){return _[_0xff36('0x87')](_0x169ffa,_0x36c962);});if(_0x57a9fc){return _0x3535ad['id'];}}}));}}return BPromise[_0xff36('0x88')](_0x3d1804)[_0xff36('0x1e')](function(_0x1158a7){_0x4bab9d=_(_0x4bab9d)[_0xff36('0x89')](_0x1158a7)[_0xff36('0x8a')]()['value']();return db['ChatQueue'][_0xff36('0x53')]({'where':{'id':_0x2840fb['params']['id']}})[_0xff36('0x1e')](function(_0x114b2e){return db[_0xff36('0x74')]['transaction'](function(_0x5807e2){return _0x114b2e[_0xff36('0x7b')](_0x2840fb[_0xff36('0x3e')][_0xff36('0x70')],{'transaction':_0x5807e2})[_0xff36('0x1e')](function(){if(!_[_0xff36('0x8b')](_0x4bab9d)){return _0x114b2e['removeAgents'](_0x4bab9d,{'transaction':_0x5807e2});}})[_0xff36('0x1e')](function(){_0x4bab9d['forEach'](function(_0xc892e3){socket['emit'](_0xff36('0x8c'),{'UserId':_0xc892e3,'ChatQueueId':_0x114b2e['id']});});});});});});})[_0xff36('0x1e')](respondWithStatusCode(_0x43cdd0,null))[_0xff36('0x26')](handleError(_0x43cdd0,null));};exports[_0xff36('0x8d')]=function(_0x1aaa6a,_0x37a397,_0x392e67){return db['ChatQueue'][_0xff36('0x53')]({'where':{'id':_0x1aaa6a[_0xff36('0x50')]['id']}})[_0xff36('0x1e')](handleEntityNotFound(_0x37a397,null))['then'](function(_0x2e11f3){if(_0x2e11f3){return _0x2e11f3['addAgents'](_0x1aaa6a[_0xff36('0x55')][_0xff36('0x70')],_['omit'](_0x1aaa6a[_0xff36('0x55')],[_0xff36('0x70'),'id'])||{})[_0xff36('0x8e')](function(_0x239166){for(var _0x2413b8=0x0;_0x2413b8<_0x1aaa6a[_0xff36('0x55')][_0xff36('0x70')]['length'];_0x2413b8+=0x1){socket[_0xff36('0x79')](_0xff36('0x7a'),{'UserId':Number(_0x1aaa6a[_0xff36('0x55')][_0xff36('0x70')][_0x2413b8]),'ChatQueueId':Number(_0x1aaa6a['params']['id'])});}return _0x239166;});}})[_0xff36('0x1e')](respondWithResult(_0x37a397,null))['catch'](handleError(_0x37a397,null));};exports['removeAgents']=function(_0x952e69,_0x7a99cf,_0x1083f5){return db['ChatQueue'][_0xff36('0x53')]({'where':{'id':_0x952e69[_0xff36('0x50')]['id']}})[_0xff36('0x1e')](handleEntityNotFound(_0x7a99cf,null))['then'](function(_0x40e27d){if(_0x40e27d){return _0x40e27d[_0xff36('0x8f')](_0x952e69[_0xff36('0x3e')]['ids'])[_0xff36('0x1e')](function(){if(_[_0xff36('0x90')](_0x952e69[_0xff36('0x3e')][_0xff36('0x70')])){for(var _0x349906=0x0;_0x349906<_0x952e69[_0xff36('0x3e')][_0xff36('0x70')]['length'];_0x349906+=0x1){socket[_0xff36('0x79')]('userChatQueue:remove',{'UserId':Number(_0x952e69[_0xff36('0x3e')][_0xff36('0x70')][_0x349906]),'ChatQueueId':Number(_0x952e69[_0xff36('0x50')]['id'])});}}else{socket['emit'](_0xff36('0x8c'),{'UserId':Number(_0x952e69[_0xff36('0x3e')][_0xff36('0x70')]),'ChatQueueId':Number(_0x952e69[_0xff36('0x50')]['id'])});}});}})[_0xff36('0x1e')](respondWithStatusCode(_0x7a99cf,null))['catch'](handleError(_0x7a99cf,null));};exports[_0xff36('0x91')]=function(_0x283097,_0x204580,_0x12effc){var _0x3470ca={};var _0x3dc4c1={};var _0x1c7126;var _0x1bd470;return db[_0xff36('0x4e')][_0xff36('0x5f')]({'where':{'id':_0x283097['params']['id']}})[_0xff36('0x1e')](handleEntityNotFound(_0x204580,null))[_0xff36('0x1e')](function(_0x57e0e9){if(_0x57e0e9){_0x1c7126=_0x57e0e9;_0x3dc4c1[_0xff36('0x3d')]=_[_0xff36('0x51')](db[_0xff36('0x65')][_0xff36('0x52')]);_0x3dc4c1[_0xff36('0x3e')]=_['keys'](_0x283097[_0xff36('0x3e')]);_0x3dc4c1['filters']=_['intersection'](_0x3dc4c1[_0xff36('0x3d')],_0x3dc4c1[_0xff36('0x3e')]);_0x3470ca[_0xff36('0x42')]=_['intersection'](_0x3dc4c1[_0xff36('0x3d')],qs['fields'](_0x283097[_0xff36('0x3e')][_0xff36('0x41')]));_0x3470ca['attributes']=_0x3470ca[_0xff36('0x42')][_0xff36('0x43')]?_0x3470ca['attributes']:_0x3dc4c1[_0xff36('0x3d')];_0x3470ca[_0xff36('0x61')]=qs[_0xff36('0x46')](_0x283097[_0xff36('0x3e')][_0xff36('0x46')]);_0x3470ca['where']=qs[_0xff36('0x3f')](_['pick'](_0x283097[_0xff36('0x3e')],_0x3dc4c1[_0xff36('0x3f')]));if(_0x283097[_0xff36('0x3e')]['filter']){_0x3470ca['where']=_[_0xff36('0x4a')](_0x3470ca[_0xff36('0x47')],{'$or':_['map'](_0x3470ca['attributes'],function(_0x232536){var _0x481129={};_0x481129[_0x232536]={'$like':'%'+_0x283097[_0xff36('0x3e')][_0xff36('0x63')]+'%'};return _0x481129;})});}_0x3470ca=_[_0xff36('0x4a')]({},_0x3470ca,_0x283097[_0xff36('0x4b')]);return _0x1c7126[_0xff36('0x91')](_0x3470ca);}})[_0xff36('0x1e')](function(_0x2290d0){if(_0x2290d0){_0x1bd470=_0x2290d0[_0xff36('0x43')];if(!_0x283097['query'][_0xff36('0x44')]('nolimit')){_0x3470ca[_0xff36('0x2d')]=qs['limit'](_0x283097[_0xff36('0x3e')][_0xff36('0x2d')]);_0x3470ca[_0xff36('0x2b')]=qs['offset'](_0x283097[_0xff36('0x3e')][_0xff36('0x2b')]);}return _0x1c7126[_0xff36('0x91')](_0x3470ca);}})[_0xff36('0x1e')](function(_0x46224a){if(_0x46224a){return _0x46224a?{'count':_0x1bd470,'rows':_0x46224a}:null;}})['then'](respondWithResult(_0x204580,null))['catch'](handleError(_0x204580,null));};
\ No newline at end of file
+var _0x732d=['clone','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','removeAgents','addAgents','userChatQueue:save','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','get','ChatQueues','destroy','sendStatus','stack','name','index','map','ChatQueue','rawAttributes','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','params','create','body','user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserChatQueue','sort','ChatQueueId','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','%s/%s','getTeams','Team','addTeams','ids','online','voicePause','flatMap','sequelize','transaction','findOrCreate','emit','removeTeams','Agents','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?'];(function(_0x2125f0,_0x2f23b9){var _0x12d6eb=function(_0x7a43ea){while(--_0x7a43ea){_0x2125f0['push'](_0x2125f0['shift']());}};_0x12d6eb(++_0x2f23b9);}(_0x732d,0xaa));var _0xd732=function(_0x3be646,_0x1083f3){_0x3be646=_0x3be646-0x0;var _0x86ea57=_0x732d[_0x3be646];return _0x86ea57;};'use strict';var emlformat=require(_0xd732('0x0'));var rimraf=require(_0xd732('0x1'));var zipdir=require(_0xd732('0x2'));var jsonpatch=require(_0xd732('0x3'));var rp=require(_0xd732('0x4'));var moment=require('moment');var BPromise=require(_0xd732('0x5'));var Mustache=require(_0xd732('0x6'));var util=require(_0xd732('0x7'));var path=require(_0xd732('0x8'));var sox=require(_0xd732('0x9'));var csv=require(_0xd732('0xa'));var ejs=require(_0xd732('0xb'));var fs=require('fs');var fs_extra=require(_0xd732('0xc'));var _=require(_0xd732('0xd'));var squel=require(_0xd732('0xe'));var crypto=require(_0xd732('0xf'));var jsforce=require(_0xd732('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd732('0x11'));var Papa=require(_0xd732('0x12'));var Redis=require(_0xd732('0x13'));var authService=require(_0xd732('0x14'));var qs=require(_0xd732('0x15'));var as=require(_0xd732('0x16'));var hardwareService=require(_0xd732('0x17'));var logger=require(_0xd732('0x18'))(_0xd732('0x19'));var utils=require(_0xd732('0x1a'));var config=require(_0xd732('0x1b'));var licenseUtil=require(_0xd732('0x1c'));var db=require(_0xd732('0x1d'))['db'];config[_0xd732('0x1e')]=_['defaults'](config[_0xd732('0x1e')],{'host':_0xd732('0x1f'),'port':0x18eb});var socket=require(_0xd732('0x20'))(new Redis(config[_0xd732('0x1e')]));require(_0xd732('0x21'))['register'](socket);var jayson=require(_0xd732('0x22'));var client=jayson[_0xd732('0x23')][_0xd732('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x249ca6,_0x5a2422,_0x246e21,_0x799b93){return new BPromise(function(_0x532122,_0x389fab){var _0x1f83c3=_0x799b93||client;return _0x1f83c3['request'](_0x249ca6,_0x246e21)[_0xd732('0x25')](function(_0x3fb5f8){logger[_0xd732('0x26')](_0xd732('0x27'),_0x5a2422,_0xd732('0x28'));logger['debug'](_0xd732('0x29'),_0x5a2422,'request\x20sent',JSON[_0xd732('0x2a')](_0x3fb5f8));if(_0x3fb5f8[_0xd732('0x2b')]){if(_0x3fb5f8[_0xd732('0x2b')][_0xd732('0x2c')]===0x1f4){logger[_0xd732('0x2b')]('ChatQueue,\x20%s,\x20%s',_0x5a2422,_0x3fb5f8[_0xd732('0x2b')][_0xd732('0x2d')]);return _0x389fab(_0x3fb5f8[_0xd732('0x2b')]['message']);}logger['error'](_0xd732('0x27'),_0x5a2422,_0x3fb5f8[_0xd732('0x2b')]['message']);return _0x532122(_0x3fb5f8[_0xd732('0x2b')][_0xd732('0x2d')]);}else{logger['info'](_0xd732('0x27'),_0x5a2422,_0xd732('0x28'));_0x532122(_0x3fb5f8[_0xd732('0x2e')][_0xd732('0x2d')]);}})[_0xd732('0x2f')](function(_0x2e926b){logger['error']('ChatQueue,\x20%s,\x20%s',_0x5a2422,_0x2e926b);_0x389fab(_0x2e926b);});});}function respondWithStatusCode(_0x5c0593,_0xc25d56){_0xc25d56=_0xc25d56||0xcc;return function(_0x3bcaa7){if(_0x3bcaa7){return _0x5c0593['sendStatus'](_0xc25d56);}return _0x5c0593[_0xd732('0x30')](_0xc25d56)[_0xd732('0x31')]();};}function respondWithResult(_0x3e8d97,_0x277007){_0x277007=_0x277007||0xc8;return function(_0x5a6bdb){if(_0x5a6bdb){return _0x3e8d97['status'](_0x277007)[_0xd732('0x32')](_0x5a6bdb);}};}function respondWithFilteredResult(_0x21e6e9,_0x46a007){return function(_0x480177){if(_0x480177){var _0x23ff36=typeof _0x46a007[_0xd732('0x33')]===_0xd732('0x34')&&typeof _0x46a007[_0xd732('0x35')]===_0xd732('0x34');var _0x4be270=_0x480177[_0xd732('0x36')];var _0x229370=_0x23ff36?0x0:_0x46a007[_0xd732('0x33')];var _0xd6a9c9=_0x23ff36?_0x480177[_0xd732('0x36')]:_0x46a007['offset']+_0x46a007[_0xd732('0x35')];var _0x58e0e5;if(_0xd6a9c9>=_0x4be270){_0xd6a9c9=_0x4be270;_0x58e0e5=0xc8;}else{_0x58e0e5=0xce;}_0x21e6e9[_0xd732('0x30')](_0x58e0e5);return _0x21e6e9['set'](_0xd732('0x37'),_0x229370+'-'+_0xd6a9c9+'/'+_0x4be270)['json'](_0x480177);}return null;};}function patchUpdates(_0x53fed4){return function(_0x2f4ea1){try{jsonpatch['apply'](_0x2f4ea1,_0x53fed4,!![]);}catch(_0x2d8a0b){return BPromise[_0xd732('0x38')](_0x2d8a0b);}return _0x2f4ea1[_0xd732('0x39')]();};}function saveUpdates(_0x132678,_0x17896c){return function(_0x18ad6c){if(_0x18ad6c){return _0x18ad6c['update'](_0x132678)[_0xd732('0x25')](function(_0x3db4af){return _0x3db4af;});}return null;};}function removeEntity(_0xeb16a3,_0x1678b6){return function(_0x3f5ddd){if(_0x3f5ddd){return _0x3f5ddd['destroy']()[_0xd732('0x25')](function(){var _0x20b6f4=_0x3f5ddd[_0xd732('0x3a')]({'plain':!![]});var _0x1322f1=_0xd732('0x3b');return db['UserProfileResource'][_0xd732('0x3c')]({'where':{'type':_0x1322f1,'resourceId':_0x20b6f4['id']}})[_0xd732('0x25')](function(){return _0x3f5ddd;});})[_0xd732('0x25')](function(){_0xeb16a3['status'](0xcc)[_0xd732('0x31')]();});}};}function handleEntityNotFound(_0x4fd284,_0x41f4d2){return function(_0x502ade){if(!_0x502ade){_0x4fd284[_0xd732('0x3d')](0x194);}return _0x502ade;};}function handleError(_0x286331,_0x4d07f4){_0x4d07f4=_0x4d07f4||0x1f4;return function(_0x2f1e5b){logger[_0xd732('0x2b')](_0x2f1e5b[_0xd732('0x3e')]);if(_0x2f1e5b[_0xd732('0x3f')]){delete _0x2f1e5b[_0xd732('0x3f')];}_0x286331['status'](_0x4d07f4)['send'](_0x2f1e5b);};}exports[_0xd732('0x40')]=function(_0x1f1fda,_0x46f646){var _0x3d144b={},_0x334e66={},_0x1f556c={'count':0x0,'rows':[]};var _0xf1756f=_[_0xd732('0x41')](db[_0xd732('0x42')][_0xd732('0x43')],function(_0x2b8bd7){return{'name':_0x2b8bd7['fieldName'],'type':_0x2b8bd7[_0xd732('0x44')]['key']};});_0x334e66[_0xd732('0x45')]=_[_0xd732('0x41')](_0xf1756f,_0xd732('0x3f'));_0x334e66['query']=_[_0xd732('0x46')](_0x1f1fda[_0xd732('0x47')]);_0x334e66[_0xd732('0x48')]=_['intersection'](_0x334e66['model'],_0x334e66[_0xd732('0x47')]);_0x3d144b[_0xd732('0x49')]=_[_0xd732('0x4a')](_0x334e66[_0xd732('0x45')],qs[_0xd732('0x4b')](_0x1f1fda[_0xd732('0x47')][_0xd732('0x4b')]));_0x3d144b[_0xd732('0x49')]=_0x3d144b[_0xd732('0x49')][_0xd732('0x4c')]?_0x3d144b[_0xd732('0x49')]:_0x334e66[_0xd732('0x45')];if(!_0x1f1fda[_0xd732('0x47')][_0xd732('0x4d')](_0xd732('0x4e'))){_0x3d144b['limit']=qs[_0xd732('0x35')](_0x1f1fda['query']['limit']);_0x3d144b[_0xd732('0x33')]=qs['offset'](_0x1f1fda[_0xd732('0x47')]['offset']);}_0x3d144b[_0xd732('0x4f')]=qs['sort'](_0x1f1fda[_0xd732('0x47')]['sort']);_0x3d144b[_0xd732('0x50')]=qs[_0xd732('0x48')](_[_0xd732('0x51')](_0x1f1fda[_0xd732('0x47')],_0x334e66['filters']),_0xf1756f);if(_0x1f1fda[_0xd732('0x47')][_0xd732('0x52')]){_0x3d144b[_0xd732('0x50')]=_[_0xd732('0x53')](_0x3d144b[_0xd732('0x50')],{'$or':_[_0xd732('0x41')](_0xf1756f,function(_0x214762){if(_0x214762['type']!==_0xd732('0x54')){var _0x547065={};_0x547065[_0x214762['name']]={'$like':'%'+_0x1f1fda['query']['filter']+'%'};return _0x547065;}})});}_0x3d144b=_[_0xd732('0x53')]({},_0x3d144b,_0x1f1fda[_0xd732('0x55')]);var _0x5d6e5c={'where':_0x3d144b[_0xd732('0x50')]};return db[_0xd732('0x42')][_0xd732('0x36')](_0x5d6e5c)[_0xd732('0x25')](function(_0x5c0649){_0x1f556c['count']=_0x5c0649;if(_0x1f1fda[_0xd732('0x47')][_0xd732('0x56')]){_0x3d144b[_0xd732('0x57')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x3d144b);})[_0xd732('0x25')](function(_0x18b1ed){_0x1f556c['rows']=_0x18b1ed;return _0x1f556c;})[_0xd732('0x25')](respondWithFilteredResult(_0x46f646,_0x3d144b))[_0xd732('0x2f')](handleError(_0x46f646,null));};exports[_0xd732('0x58')]=function(_0x3c07ed,_0x2cc095){var _0x47aedd={'raw':!![],'where':{'id':_0x3c07ed[_0xd732('0x59')]['id']}},_0x190f07={};_0x190f07['model']=_[_0xd732('0x46')](db[_0xd732('0x42')][_0xd732('0x43')]);_0x190f07[_0xd732('0x47')]=_[_0xd732('0x46')](_0x3c07ed[_0xd732('0x47')]);_0x190f07[_0xd732('0x48')]=_[_0xd732('0x4a')](_0x190f07['model'],_0x190f07[_0xd732('0x47')]);_0x47aedd['attributes']=_[_0xd732('0x4a')](_0x190f07[_0xd732('0x45')],qs[_0xd732('0x4b')](_0x3c07ed[_0xd732('0x47')][_0xd732('0x4b')]));_0x47aedd[_0xd732('0x49')]=_0x47aedd['attributes'][_0xd732('0x4c')]?_0x47aedd['attributes']:_0x190f07[_0xd732('0x45')];if(_0x3c07ed['query'][_0xd732('0x56')]){_0x47aedd['include']=[{'all':!![]}];}_0x47aedd=_[_0xd732('0x53')]({},_0x47aedd,_0x3c07ed[_0xd732('0x55')]);return db[_0xd732('0x42')]['find'](_0x47aedd)[_0xd732('0x25')](handleEntityNotFound(_0x2cc095,null))[_0xd732('0x25')](respondWithResult(_0x2cc095,null))['catch'](handleError(_0x2cc095,null));};exports['create']=function(_0x54aa66,_0x4186d9){return db[_0xd732('0x42')][_0xd732('0x5a')](_0x54aa66[_0xd732('0x5b')],{})[_0xd732('0x25')](function(_0x58a89d){var _0x35cca5=_0x54aa66[_0xd732('0x5c')][_0xd732('0x3a')]({'plain':!![]});if(!_0x35cca5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35cca5[_0xd732('0x5d')]==='user'){var _0x23bea6=_0x58a89d['get']({'plain':!![]});var _0x2ba03b=_0xd732('0x3b');return db[_0xd732('0x5e')][_0xd732('0x5f')]({'where':{'name':_0x2ba03b,'userProfileId':_0x35cca5['userProfileId']},'raw':!![]})[_0xd732('0x25')](function(_0x3ecc3a){if(_0x3ecc3a&&_0x3ecc3a[_0xd732('0x60')]===0x0){return db[_0xd732('0x61')][_0xd732('0x5a')]({'name':_0x23bea6['name'],'resourceId':_0x23bea6['id'],'type':_0x3ecc3a[_0xd732('0x3f')],'sectionId':_0x3ecc3a['id']},{})[_0xd732('0x25')](function(){return _0x58a89d;});}else{return _0x58a89d;}})['catch'](function(_0xe2017f){logger[_0xd732('0x2b')](_0xd732('0x62'),_0xe2017f);throw _0xe2017f;});}return _0x58a89d;})['then'](respondWithResult(_0x4186d9,0xc9))[_0xd732('0x2f')](handleError(_0x4186d9,null));};exports[_0xd732('0x63')]=function(_0x10bb0e,_0x1488a4){if(_0x10bb0e[_0xd732('0x5b')]['id']){delete _0x10bb0e['body']['id'];}return db['ChatQueue']['find']({'where':{'id':_0x10bb0e[_0xd732('0x59')]['id']}})[_0xd732('0x25')](handleEntityNotFound(_0x1488a4,null))[_0xd732('0x25')](saveUpdates(_0x10bb0e[_0xd732('0x5b')],null))['then'](respondWithResult(_0x1488a4,null))[_0xd732('0x2f')](handleError(_0x1488a4,null));};exports[_0xd732('0x3c')]=function(_0x201981,_0x2acaff){return db['ChatQueue'][_0xd732('0x5f')]({'where':{'id':_0x201981[_0xd732('0x59')]['id']}})['then'](handleEntityNotFound(_0x2acaff,null))[_0xd732('0x25')](removeEntity(_0x2acaff,null))[_0xd732('0x2f')](handleError(_0x2acaff,null));};exports[_0xd732('0x64')]=function(_0x434a0f,_0x27fb70){return db['ChatQueue'][_0xd732('0x64')]()[_0xd732('0x25')](respondWithResult(_0x27fb70,null))['catch'](handleError(_0x27fb70,null));};exports['getMembers']=function(_0x31a7bb,_0x3bb041,_0x1ef16c){var _0x49fcb2={'raw':!![],'where':{}},_0x19d72b={},_0x1b6629;return db[_0xd732('0x42')][_0xd732('0x65')]({'where':{'id':_0x31a7bb[_0xd732('0x59')]['id']}})[_0xd732('0x25')](handleEntityNotFound(_0x3bb041,null))[_0xd732('0x25')](function(_0x2b4488){if(_0x2b4488){_0x1b6629=_0x2b4488[_0xd732('0x3a')]({'plain':!![]});_0x19d72b['model']=_['keys'](db[_0xd732('0x66')]['rawAttributes']);_0x19d72b[_0xd732('0x47')]=_[_0xd732('0x46')](_0x31a7bb['query']);_0x19d72b[_0xd732('0x48')]=_[_0xd732('0x4a')](_0x19d72b[_0xd732('0x45')],_0x19d72b[_0xd732('0x47')]);_0x49fcb2[_0xd732('0x49')]=_[_0xd732('0x4a')](_0x19d72b[_0xd732('0x45')],qs[_0xd732('0x4b')](_0x31a7bb['query'][_0xd732('0x4b')]));_0x49fcb2[_0xd732('0x49')]=_0x49fcb2[_0xd732('0x49')][_0xd732('0x4c')]?_0x49fcb2[_0xd732('0x49')]:_0x19d72b[_0xd732('0x45')];if(!_0x31a7bb[_0xd732('0x47')][_0xd732('0x4d')]('nolimit')){_0x49fcb2[_0xd732('0x35')]=qs['limit'](_0x31a7bb[_0xd732('0x47')]['limit']);_0x49fcb2[_0xd732('0x33')]=qs[_0xd732('0x33')](_0x31a7bb[_0xd732('0x47')]['offset']);}_0x49fcb2['order']=qs['sort'](_0x31a7bb[_0xd732('0x47')][_0xd732('0x67')]);_0x49fcb2['where']=qs[_0xd732('0x48')](_[_0xd732('0x51')](_0x31a7bb['query'],_0x19d72b[_0xd732('0x48')]));_0x49fcb2[_0xd732('0x50')][_0xd732('0x68')]=_0x2b4488['id'];if(_0x31a7bb[_0xd732('0x47')][_0xd732('0x52')]){_0x49fcb2['where']=_[_0xd732('0x53')](_0x49fcb2[_0xd732('0x50')],{'$or':_[_0xd732('0x41')](_0x49fcb2[_0xd732('0x49')],function(_0x5a0f8b){var _0x5bb3cd={};_0x5bb3cd[_0x5a0f8b]={'$like':'%'+_0x31a7bb[_0xd732('0x47')][_0xd732('0x52')]+'%'};return _0x5bb3cd;})});}_0x49fcb2=_[_0xd732('0x53')]({},_0x49fcb2,_0x31a7bb[_0xd732('0x55')]);return db['UserChatQueue'][_0xd732('0x69')](_0x49fcb2);}})['then'](function(_0x77350e){if(_0x77350e){return db[_0xd732('0x6a')][_0xd732('0x6b')]({'where':{'id':_[_0xd732('0x41')](_0x77350e,_0xd732('0x6c')),'role':_0xd732('0x6d')},'attributes':['id',_0xd732('0x3f'),_0xd732('0x6e'),_0xd732('0x6f'),_0xd732('0x70')]});}})[_0xd732('0x25')](function(_0x395a6f){if(_0x395a6f){return{'count':_0x395a6f['count'],'rows':_[_0xd732('0x41')](_0x395a6f[_0xd732('0x71')],function(_0x209dfd){return{'membername':_0x209dfd[_0xd732('0x3f')],'UserId':_0x209dfd['id'],'queue_name':_0x1b6629[_0xd732('0x3f')],'ChatQueueId':_0x1b6629['id'],'interface':util['format'](_0xd732('0x72'),'SIP',_0x209dfd['name']),'penalty':0x0,'paused':_0x209dfd['chatPause'],'createdAt':_0x209dfd['createdAt'],'updatedAt':_0x209dfd['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xd732('0x25')](respondWithFilteredResult(_0x3bb041,_0x49fcb2))[_0xd732('0x2f')](handleError(_0x3bb041,null));};exports[_0xd732('0x73')]=function(_0x411061,_0x3c3c74,_0x72f456){var _0x452a08={};var _0x246713={};var _0x32c801;var _0xc66546;return db['ChatQueue'][_0xd732('0x65')]({'where':{'id':_0x411061['params']['id']}})[_0xd732('0x25')](handleEntityNotFound(_0x3c3c74,null))['then'](function(_0x2d588d){if(_0x2d588d){_0x32c801=_0x2d588d;_0x246713['model']=_['keys'](db[_0xd732('0x74')]['rawAttributes']);_0x246713[_0xd732('0x47')]=_[_0xd732('0x46')](_0x411061[_0xd732('0x47')]);_0x246713[_0xd732('0x48')]=_['intersection'](_0x246713[_0xd732('0x45')],_0x246713[_0xd732('0x47')]);_0x452a08[_0xd732('0x49')]=_['intersection'](_0x246713['model'],qs[_0xd732('0x4b')](_0x411061['query'][_0xd732('0x4b')]));_0x452a08[_0xd732('0x49')]=_0x452a08[_0xd732('0x49')][_0xd732('0x4c')]?_0x452a08[_0xd732('0x49')]:_0x246713[_0xd732('0x45')];_0x452a08['order']=qs[_0xd732('0x67')](_0x411061[_0xd732('0x47')][_0xd732('0x67')]);_0x452a08[_0xd732('0x50')]=qs[_0xd732('0x48')](_['pick'](_0x411061[_0xd732('0x47')],_0x246713[_0xd732('0x48')]));if(_0x411061[_0xd732('0x47')][_0xd732('0x52')]){_0x452a08[_0xd732('0x50')]=_['merge'](_0x452a08['where'],{'$or':_[_0xd732('0x41')](_0x452a08['attributes'],function(_0x3c9bde){var _0x73190b={};_0x73190b[_0x3c9bde]={'$like':'%'+_0x411061[_0xd732('0x47')][_0xd732('0x52')]+'%'};return _0x73190b;})});}_0x452a08=_[_0xd732('0x53')]({},_0x452a08,_0x411061[_0xd732('0x55')]);return _0x32c801[_0xd732('0x73')](_0x452a08);}})[_0xd732('0x25')](function(_0x3401ea){if(_0x3401ea){_0xc66546=_0x3401ea['length'];if(!_0x411061[_0xd732('0x47')][_0xd732('0x4d')](_0xd732('0x4e'))){_0x452a08[_0xd732('0x35')]=qs[_0xd732('0x35')](_0x411061[_0xd732('0x47')]['limit']);_0x452a08[_0xd732('0x33')]=qs[_0xd732('0x33')](_0x411061[_0xd732('0x47')][_0xd732('0x33')]);}return _0x32c801[_0xd732('0x73')](_0x452a08);}})[_0xd732('0x25')](function(_0x2574c9){if(_0x2574c9){return _0x2574c9?{'count':_0xc66546,'rows':_0x2574c9}:null;}})[_0xd732('0x25')](respondWithResult(_0x3c3c74,null))['catch'](handleError(_0x3c3c74,null));};exports[_0xd732('0x75')]=function(_0x3ddfdc,_0x4f57e6,_0x33ffd7){var _0x33024b=_0x3ddfdc['body'][_0xd732('0x76')];return db['Team']['findAll']({'where':{'id':_0x33024b},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xd732('0x3f'),_0xd732('0x77'),_0xd732('0x78'),'interface'],'raw':!![]}]})[_0xd732('0x25')](function(_0x3a13cc){if(_0x3a13cc){var _0x2eb168=_[_0xd732('0x79')](_0x3a13cc,function(_0x12d005){var _0x37dd96=_0x12d005[_0xd732('0x3a')]({'plain':!![]});return _0x37dd96['Agents'];});return db[_0xd732('0x42')][_0xd732('0x5f')]({'where':{'id':_0x3ddfdc['params']['id']}})['then'](function(_0x49c2a7){return db[_0xd732('0x7a')][_0xd732('0x7b')](function(_0x28f4f8){return _0x49c2a7[_0xd732('0x75')](_0x33024b,{'transaction':_0x28f4f8})[_0xd732('0x25')](function(){return BPromise['each'](_0x2eb168,function(_0x9f4191){return db[_0xd732('0x66')][_0xd732('0x7c')]({'where':{'UserId':_0x9f4191['id'],'ChatQueueId':_0x3ddfdc[_0xd732('0x59')]['id']},'transaction':_0x28f4f8});});})[_0xd732('0x25')](function(){_0x2eb168['forEach'](function(_0x426de3){socket[_0xd732('0x7d')]('userChatQueue:save',{'UserId':_0x426de3['id'],'ChatQueueId':_0x49c2a7['id']});});});});});}})[_0xd732('0x25')](respondWithStatusCode(_0x4f57e6,null))['catch'](handleError(_0x4f57e6,null));};exports[_0xd732('0x7e')]=function(_0xb62ad8,_0x1b99b8,_0xf14c1f){return db['Team']['findAll']({'where':{'id':_0xb62ad8[_0xd732('0x47')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd732('0x6a')],'as':_0xd732('0x7f'),'attributes':['id'],'raw':!![]}]})[_0xd732('0x25')](handleEntityNotFound(_0x1b99b8,null))['then'](function(_0x33f738){var _0x3eb2a1=_[_0xd732('0x41')](_0x33f738,'id');var _0x30d68a=[];var _0x5141a7=[];var _0x26a5cd=squel[_0xd732('0x80')]();_0x26a5cd[_0xd732('0x81')](_0xd732('0x82'))[_0xd732('0x83')]('team_has_chat_queues','tq')[_0xd732('0x84')](_0xd732('0x85'),'ut',_0xd732('0x86'))[_0xd732('0x50')](_0xd732('0x87'),_0xb62ad8[_0xd732('0x59')]['id']);for(var _0xcc39f2=0x0;_0xcc39f2<_0x33f738['length'];_0xcc39f2+=0x1){let _0x5f3843=_0x33f738[_0xcc39f2];for(var _0x40f96d=0x0;_0x40f96d<_0x5f3843['Agents'][_0xd732('0x4c')];_0x40f96d+=0x1){let _0x1c8c88=_0x5f3843[_0xd732('0x7f')][_0x40f96d];var _0x24d231=_0x26a5cd[_0xd732('0x88')]();_0x24d231['where']('ut.UserId\x20=\x20?',_0x1c8c88['id']);_0x5141a7[_0xd732('0x89')](db[_0xd732('0x7a')]['query'](_0x24d231[_0xd732('0x8a')](),{'type':db[_0xd732('0x7a')][_0xd732('0x8b')]['SELECT']})['then'](function(_0x2c84be){if(_0x2c84be[_0xd732('0x4c')]===0x1){return _0x1c8c88['id'];}else{var _0x41e83f=_[_0xd732('0x8c')](_[_0xd732('0x41')](_0x2c84be,_0xd732('0x8d')),function(_0x385e12){return _[_0xd732('0x8e')](_0x3eb2a1,_0x385e12);});if(_0x41e83f){return _0x1c8c88['id'];}}}));}}return BPromise[_0xd732('0x8f')](_0x5141a7)[_0xd732('0x25')](function(_0x1adba9){_0x30d68a=_(_0x30d68a)[_0xd732('0x90')](_0x1adba9)[_0xd732('0x91')]()[_0xd732('0x92')]();return db['ChatQueue']['find']({'where':{'id':_0xb62ad8['params']['id']}})['then'](function(_0x9eae3){return db['sequelize'][_0xd732('0x7b')](function(_0x473b9c){return _0x9eae3['removeTeams'](_0xb62ad8[_0xd732('0x47')][_0xd732('0x76')],{'transaction':_0x473b9c})[_0xd732('0x25')](function(){if(!_['isEmpty'](_0x30d68a)){return _0x9eae3[_0xd732('0x93')](_0x30d68a,{'transaction':_0x473b9c});}})[_0xd732('0x25')](function(){_0x30d68a['forEach'](function(_0x34178d){socket['emit']('userChatQueue:remove',{'UserId':_0x34178d,'ChatQueueId':_0x9eae3['id']});});});});});});})[_0xd732('0x25')](respondWithStatusCode(_0x1b99b8,null))[_0xd732('0x2f')](handleError(_0x1b99b8,null));};exports[_0xd732('0x94')]=function(_0x42221e,_0x4657a4,_0x560265){return db['ChatQueue'][_0xd732('0x5f')]({'where':{'id':_0x42221e[_0xd732('0x59')]['id']}})[_0xd732('0x25')](handleEntityNotFound(_0x4657a4,null))[_0xd732('0x25')](function(_0x2fdb0a){if(_0x2fdb0a){return _0x2fdb0a[_0xd732('0x94')](_0x42221e['body']['ids'],_['omit'](_0x42221e[_0xd732('0x5b')],[_0xd732('0x76'),'id'])||{})['spread'](function(_0xc661b6){for(var _0x34e6da=0x0;_0x34e6da<_0x42221e[_0xd732('0x5b')][_0xd732('0x76')][_0xd732('0x4c')];_0x34e6da+=0x1){socket[_0xd732('0x7d')](_0xd732('0x95'),{'UserId':Number(_0x42221e[_0xd732('0x5b')][_0xd732('0x76')][_0x34e6da]),'ChatQueueId':Number(_0x42221e[_0xd732('0x59')]['id'])});}return _0xc661b6;});}})[_0xd732('0x25')](respondWithResult(_0x4657a4,null))['catch'](handleError(_0x4657a4,null));};exports['removeAgents']=function(_0x20a3dc,_0x51b4b5,_0x90128c){return db['ChatQueue'][_0xd732('0x5f')]({'where':{'id':_0x20a3dc[_0xd732('0x59')]['id']}})['then'](handleEntityNotFound(_0x51b4b5,null))[_0xd732('0x25')](function(_0x5b0eec){if(_0x5b0eec){return _0x5b0eec[_0xd732('0x93')](_0x20a3dc[_0xd732('0x47')][_0xd732('0x76')])[_0xd732('0x25')](function(){if(_[_0xd732('0x96')](_0x20a3dc[_0xd732('0x47')][_0xd732('0x76')])){for(var _0x3f257d=0x0;_0x3f257d<_0x20a3dc[_0xd732('0x47')]['ids']['length'];_0x3f257d+=0x1){socket[_0xd732('0x7d')](_0xd732('0x97'),{'UserId':Number(_0x20a3dc[_0xd732('0x47')]['ids'][_0x3f257d]),'ChatQueueId':Number(_0x20a3dc[_0xd732('0x59')]['id'])});}}else{socket[_0xd732('0x7d')](_0xd732('0x97'),{'UserId':Number(_0x20a3dc['query'][_0xd732('0x76')]),'ChatQueueId':Number(_0x20a3dc[_0xd732('0x59')]['id'])});}});}})[_0xd732('0x25')](respondWithStatusCode(_0x51b4b5,null))[_0xd732('0x2f')](handleError(_0x51b4b5,null));};exports[_0xd732('0x98')]=function(_0x5131d7,_0xe001eb,_0x3541af){var _0xdfe7d9={};var _0x58c85e={};var _0x4b7590;var _0x2a39ac;return db[_0xd732('0x42')]['findOne']({'where':{'id':_0x5131d7['params']['id']}})[_0xd732('0x25')](handleEntityNotFound(_0xe001eb,null))[_0xd732('0x25')](function(_0x3261af){if(_0x3261af){_0x4b7590=_0x3261af;_0x58c85e[_0xd732('0x45')]=_['keys'](db[_0xd732('0x6a')][_0xd732('0x43')]);_0x58c85e[_0xd732('0x47')]=_[_0xd732('0x46')](_0x5131d7['query']);_0x58c85e[_0xd732('0x48')]=_[_0xd732('0x4a')](_0x58c85e['model'],_0x58c85e[_0xd732('0x47')]);_0xdfe7d9['attributes']=_[_0xd732('0x4a')](_0x58c85e[_0xd732('0x45')],qs[_0xd732('0x4b')](_0x5131d7[_0xd732('0x47')][_0xd732('0x4b')]));_0xdfe7d9[_0xd732('0x49')]=_0xdfe7d9[_0xd732('0x49')][_0xd732('0x4c')]?_0xdfe7d9[_0xd732('0x49')]:_0x58c85e[_0xd732('0x45')];_0xdfe7d9['order']=qs[_0xd732('0x67')](_0x5131d7['query']['sort']);_0xdfe7d9['where']=qs[_0xd732('0x48')](_['pick'](_0x5131d7[_0xd732('0x47')],_0x58c85e[_0xd732('0x48')]));if(_0x5131d7[_0xd732('0x47')][_0xd732('0x52')]){_0xdfe7d9['where']=_['merge'](_0xdfe7d9[_0xd732('0x50')],{'$or':_[_0xd732('0x41')](_0xdfe7d9['attributes'],function(_0x320977){var _0x3ce90e={};_0x3ce90e[_0x320977]={'$like':'%'+_0x5131d7[_0xd732('0x47')][_0xd732('0x52')]+'%'};return _0x3ce90e;})});}_0xdfe7d9=_['merge']({},_0xdfe7d9,_0x5131d7[_0xd732('0x55')]);return _0x4b7590[_0xd732('0x98')](_0xdfe7d9);}})[_0xd732('0x25')](function(_0x4db66d){if(_0x4db66d){_0x2a39ac=_0x4db66d[_0xd732('0x4c')];if(!_0x5131d7[_0xd732('0x47')][_0xd732('0x4d')]('nolimit')){_0xdfe7d9['limit']=qs[_0xd732('0x35')](_0x5131d7[_0xd732('0x47')][_0xd732('0x35')]);_0xdfe7d9[_0xd732('0x33')]=qs[_0xd732('0x33')](_0x5131d7[_0xd732('0x47')][_0xd732('0x33')]);}return _0x4b7590[_0xd732('0x98')](_0xdfe7d9);}})[_0xd732('0x25')](function(_0x4e21a5){if(_0x4e21a5){return _0x4e21a5?{'count':_0x2a39ac,'rows':_0x4e21a5}:null;}})[_0xd732('0x25')](respondWithResult(_0xe001eb,null))[_0xd732('0x2f')](handleError(_0xe001eb,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index ca094ac..3d98ee5 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 _0x79fc=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatQueue'];(function(_0x1bc762,_0x523eb3){var _0x40f70c=function(_0x3c206e){while(--_0x3c206e){_0x1bc762['push'](_0x1bc762['shift']());}};_0x40f70c(++_0x523eb3);}(_0x79fc,0x1ad));var _0xc79f=function(_0x41e10,_0x17657d){_0x41e10=_0x41e10-0x0;var _0x4efe10=_0x79fc[_0x41e10];return _0x4efe10;};'use strict';var EventEmitter=require(_0xc79f('0x0'));var ChatQueue=require(_0xc79f('0x1'))['db'][_0xc79f('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xc79f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc79f('0x4'),'afterDestroy':_0xc79f('0x5')};function emitEvent(_0x55acc0){return function(_0x285a56,_0x492e51,_0x4036bb){ChatQueueEvents[_0xc79f('0x6')](_0x55acc0+':'+_0x285a56['id'],_0x285a56);ChatQueueEvents['emit'](_0x55acc0,_0x285a56);_0x4036bb(null);};}for(var e in events){if(events[_0xc79f('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xc79f('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0xe10c=['emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue','save','remove'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xe10c,0x153));var _0xce10=function(_0x1dbff8,_0x224859){_0x1dbff8=_0x1dbff8-0x0;var _0x5b3885=_0xe10c[_0x1dbff8];return _0x5b3885;};'use strict';var EventEmitter=require(_0xce10('0x0'));var ChatQueue=require(_0xce10('0x1'))['db'][_0xce10('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xce10('0x3'),'afterUpdate':'update','afterDestroy':_0xce10('0x4')};function emitEvent(_0x2295e5){return function(_0x411b5a,_0x59d1c6,_0x5d72b0){ChatQueueEvents[_0xce10('0x5')](_0x2295e5+':'+_0x411b5a['id'],_0x411b5a);ChatQueueEvents[_0xce10('0x5')](_0x2295e5,_0x411b5a);_0x5d72b0(null);};}for(var e in events){if(events[_0xce10('0x6')](e)){var event=events[e];ChatQueue[_0xce10('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 9030ad5..6b27e58 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 _0x9946=['ChatQueue','chat_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x3cfaea,_0x59581c){var _0x5131f6=function(_0x57deeb){while(--_0x57deeb){_0x3cfaea['push'](_0x3cfaea['shift']());}};_0x5131f6(++_0x59581c);}(_0x9946,0xd2));var _0x6994=function(_0x3ba4dd,_0x30ad87){_0x3ba4dd=_0x3ba4dd-0x0;var _0x3e1ac8=_0x9946[_0x3ba4dd];return _0x3e1ac8;};'use strict';var _=require(_0x6994('0x0'));var util=require(_0x6994('0x1'));var logger=require(_0x6994('0x2'))(_0x6994('0x3'));var moment=require('moment');var BPromise=require(_0x6994('0x4'));var rp=require(_0x6994('0x5'));var fs=require('fs');var path=require(_0x6994('0x6'));var rimraf=require('rimraf');var config=require(_0x6994('0x7'));var attributes=require(_0x6994('0x8'));module[_0x6994('0x9')]=function(_0x591d58,_0x4d8481){return _0x591d58[_0x6994('0xa')](_0x6994('0xb'),attributes,{'tableName':_0x6994('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd5be=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatQueue','chat_queues','util','../../config/logger'];(function(_0x264009,_0x466fe4){var _0x6de28=function(_0x34a32b){while(--_0x34a32b){_0x264009['push'](_0x264009['shift']());}};_0x6de28(++_0x466fe4);}(_0xd5be,0x1c5));var _0xed5b=function(_0xfd495c,_0x4a3c1a){_0xfd495c=_0xfd495c-0x0;var _0x561dd8=_0xd5be[_0xfd495c];return _0x561dd8;};'use strict';var _=require('lodash');var util=require(_0xed5b('0x0'));var logger=require(_0xed5b('0x1'))(_0xed5b('0x2'));var moment=require(_0xed5b('0x3'));var BPromise=require(_0xed5b('0x4'));var rp=require(_0xed5b('0x5'));var fs=require('fs');var path=require(_0xed5b('0x6'));var rimraf=require(_0xed5b('0x7'));var config=require(_0xed5b('0x8'));var attributes=require('./chatQueue.attributes');module[_0xed5b('0x9')]=function(_0x43f18e,_0x3d99e1){return _0x43f18e[_0xed5b('0xa')](_0xed5b('0xb'),attributes,{'tableName':_0xed5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 8517193..64901f5 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 _0x6d77=['raw','where','attributes','limit','include','map','model','then','ShowChatQueue','find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','redis','localhost','socket.io-emitter','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetChatQueue','ChatQueue','findAll','options'];(function(_0x495339,_0x100a94){var _0x57654a=function(_0x4d6d6e){while(--_0x4d6d6e){_0x495339['push'](_0x495339['shift']());}};_0x57654a(++_0x100a94);}(_0x6d77,0x13a));var _0x76d7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6d77[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x76d7('0x0'));var util=require(_0x76d7('0x1'));var moment=require(_0x76d7('0x2'));var BPromise=require(_0x76d7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x76d7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76d7('0x5'));var logger=require(_0x76d7('0x6'))(_0x76d7('0x7'));var config=require(_0x76d7('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x76d7('0x9')]=_['defaults'](config['redis'],{'host':_0x76d7('0xa'),'port':0x18eb});var socket=require(_0x76d7('0xb'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x76d7('0xc')](socket);function respondWithRpcPromise(_0x4b5740,_0x1a258d,_0x3b58ec){return new BPromise(function(_0x57a821,_0x1bf80d){return client[_0x76d7('0xd')](_0x4b5740,_0x3b58ec)['then'](function(_0x54322b){logger[_0x76d7('0xe')](_0x76d7('0xf'),_0x1a258d,_0x76d7('0x10'));logger[_0x76d7('0x11')](_0x76d7('0x12'),_0x1a258d,_0x76d7('0x10'),JSON[_0x76d7('0x13')](_0x54322b));if(_0x54322b['error']){if(_0x54322b['error'][_0x76d7('0x14')]===0x1f4){logger[_0x76d7('0x15')](_0x76d7('0xf'),_0x1a258d,_0x54322b[_0x76d7('0x15')][_0x76d7('0x16')]);return _0x1bf80d(_0x54322b['error'][_0x76d7('0x16')]);}logger['error'](_0x76d7('0xf'),_0x1a258d,_0x54322b['error'][_0x76d7('0x16')]);return _0x57a821(_0x54322b['error'][_0x76d7('0x16')]);}else{logger['info'](_0x76d7('0xf'),_0x1a258d,_0x76d7('0x10'));_0x57a821(_0x54322b['result'][_0x76d7('0x16')]);}})[_0x76d7('0x17')](function(_0xa7e75d){logger[_0x76d7('0x15')]('ChatQueue,\x20%s,\x20%s',_0x1a258d,_0xa7e75d);_0x1bf80d(_0xa7e75d);});});}exports[_0x76d7('0x18')]=function(_0x1fed23){var _0x4f966a=this;return new Promise(function(_0x57ec55,_0x54295d){return db[_0x76d7('0x19')][_0x76d7('0x1a')]({'raw':_0x1fed23[_0x76d7('0x1b')]?_0x1fed23[_0x76d7('0x1b')][_0x76d7('0x1c')]===undefined?!![]:![]:!![],'where':_0x1fed23[_0x76d7('0x1b')]?_0x1fed23['options'][_0x76d7('0x1d')]||null:null,'attributes':_0x1fed23['options']?_0x1fed23[_0x76d7('0x1b')][_0x76d7('0x1e')]||null:null,'limit':_0x1fed23['options']?_0x1fed23['options'][_0x76d7('0x1f')]||null:null,'include':_0x1fed23[_0x76d7('0x1b')]?_0x1fed23[_0x76d7('0x1b')][_0x76d7('0x20')]?_[_0x76d7('0x21')](_0x1fed23[_0x76d7('0x1b')][_0x76d7('0x20')],function(_0x1de80d){return{'model':db[_0x1de80d[_0x76d7('0x22')]],'as':_0x1de80d['as'],'attributes':_0x1de80d[_0x76d7('0x1e')],'include':_0x1de80d[_0x76d7('0x20')]?_[_0x76d7('0x21')](_0x1de80d[_0x76d7('0x20')],function(_0x23604e){return{'model':db[_0x23604e[_0x76d7('0x22')]],'as':_0x23604e['as'],'attributes':_0x23604e[_0x76d7('0x1e')],'include':_0x23604e['include']?_['map'](_0x23604e['include'],function(_0x228a48){return{'model':db[_0x228a48[_0x76d7('0x22')]],'as':_0x228a48['as'],'attributes':_0x228a48[_0x76d7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x76d7('0x23')](function(_0x5916b0){logger[_0x76d7('0xe')](_0x76d7('0x18'),_0x1fed23);logger['debug'](_0x76d7('0x18'),_0x1fed23,JSON[_0x76d7('0x13')](_0x5916b0));_0x57ec55(_0x5916b0);})[_0x76d7('0x17')](function(_0xea025d){logger[_0x76d7('0x15')](_0x76d7('0x18'),_0xea025d['message'],_0x1fed23);_0x54295d(_0x4f966a[_0x76d7('0x15')](0x1f4,_0xea025d[_0x76d7('0x16')]));});});};exports[_0x76d7('0x24')]=function(_0x279e78){var _0x4e7dbe=this;return new Promise(function(_0x160fe3,_0x3f6a6e){return db[_0x76d7('0x19')][_0x76d7('0x25')]({'raw':_0x279e78[_0x76d7('0x1b')]?_0x279e78[_0x76d7('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x279e78['options']?_0x279e78['options'][_0x76d7('0x1d')]||null:null,'attributes':_0x279e78[_0x76d7('0x1b')]?_0x279e78[_0x76d7('0x1b')][_0x76d7('0x1e')]||null:null,'include':_0x279e78['options']?_0x279e78['options'][_0x76d7('0x20')]?_[_0x76d7('0x21')](_0x279e78[_0x76d7('0x1b')]['include'],function(_0xc83f55){return{'model':db[_0xc83f55['model']],'as':_0xc83f55['as'],'attributes':_0xc83f55[_0x76d7('0x1e')],'include':_0xc83f55['include']?_['map'](_0xc83f55[_0x76d7('0x20')],function(_0x2c7fa4){return{'model':db[_0x2c7fa4[_0x76d7('0x22')]],'as':_0x2c7fa4['as'],'attributes':_0x2c7fa4[_0x76d7('0x1e')],'include':_0x2c7fa4[_0x76d7('0x20')]?_[_0x76d7('0x21')](_0x2c7fa4[_0x76d7('0x20')],function(_0x115aec){return{'model':db[_0x115aec['model']],'as':_0x115aec['as'],'attributes':_0x115aec[_0x76d7('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5db90c){logger[_0x76d7('0xe')](_0x76d7('0x24'),_0x279e78);logger['debug'](_0x76d7('0x24'),_0x279e78,JSON['stringify'](_0x5db90c));_0x160fe3(_0x5db90c);})['catch'](function(_0x5dbe20){logger['error'](_0x76d7('0x24'),_0x5dbe20['message'],_0x279e78);_0x3f6a6e(_0x4e7dbe[_0x76d7('0x15')](0x1f4,_0x5dbe20[_0x76d7('0x16')]));});});};
\ No newline at end of file
+var _0x51d7=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','findAll','options','raw','where','attributes','include','map','model','GetChatQueue','stringify','ShowChatQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x579aeb,_0x5c1bb0){var _0x769607=function(_0x21bf40){while(--_0x21bf40){_0x579aeb['push'](_0x579aeb['shift']());}};_0x769607(++_0x5c1bb0);}(_0x51d7,0xcf));var _0x751d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x51d7[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x751d('0x0'));var util=require(_0x751d('0x1'));var moment=require(_0x751d('0x2'));var BPromise=require(_0x751d('0x3'));var rs=require(_0x751d('0x4'));var fs=require('fs');var Redis=require(_0x751d('0x5'));var db=require(_0x751d('0x6'))['db'];var utils=require(_0x751d('0x7'));var logger=require(_0x751d('0x8'))(_0x751d('0x9'));var config=require(_0x751d('0xa'));var jayson=require(_0x751d('0xb'));var client=jayson[_0x751d('0xc')][_0x751d('0xd')]({'port':0x232a});config[_0x751d('0xe')]=_[_0x751d('0xf')](config[_0x751d('0xe')],{'host':_0x751d('0x10'),'port':0x18eb});var socket=require(_0x751d('0x11'))(new Redis(config[_0x751d('0xe')]));require(_0x751d('0x12'))[_0x751d('0x13')](socket);function respondWithRpcPromise(_0x3bb87a,_0x10cce6,_0x3b712a){return new BPromise(function(_0x2ab84c,_0x47e380){return client[_0x751d('0x14')](_0x3bb87a,_0x3b712a)[_0x751d('0x15')](function(_0x2c6e5d){logger[_0x751d('0x16')](_0x751d('0x17'),_0x10cce6,'request\x20sent');logger[_0x751d('0x18')](_0x751d('0x19'),_0x10cce6,_0x751d('0x1a'),JSON['stringify'](_0x2c6e5d));if(_0x2c6e5d[_0x751d('0x1b')]){if(_0x2c6e5d['error'][_0x751d('0x1c')]===0x1f4){logger[_0x751d('0x1b')]('ChatQueue,\x20%s,\x20%s',_0x10cce6,_0x2c6e5d[_0x751d('0x1b')][_0x751d('0x1d')]);return _0x47e380(_0x2c6e5d[_0x751d('0x1b')][_0x751d('0x1d')]);}logger['error'](_0x751d('0x17'),_0x10cce6,_0x2c6e5d[_0x751d('0x1b')][_0x751d('0x1d')]);return _0x2ab84c(_0x2c6e5d[_0x751d('0x1b')][_0x751d('0x1d')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x10cce6,_0x751d('0x1a'));_0x2ab84c(_0x2c6e5d[_0x751d('0x1e')]['message']);}})[_0x751d('0x1f')](function(_0x3272b1){logger[_0x751d('0x1b')](_0x751d('0x17'),_0x10cce6,_0x3272b1);_0x47e380(_0x3272b1);});});}exports['GetChatQueue']=function(_0x2ecc9f){var _0x445289=this;return new Promise(function(_0x11a825,_0x13a062){return db['ChatQueue'][_0x751d('0x20')]({'raw':_0x2ecc9f[_0x751d('0x21')]?_0x2ecc9f[_0x751d('0x21')][_0x751d('0x22')]===undefined?!![]:![]:!![],'where':_0x2ecc9f[_0x751d('0x21')]?_0x2ecc9f[_0x751d('0x21')][_0x751d('0x23')]||null:null,'attributes':_0x2ecc9f[_0x751d('0x21')]?_0x2ecc9f[_0x751d('0x21')][_0x751d('0x24')]||null:null,'limit':_0x2ecc9f[_0x751d('0x21')]?_0x2ecc9f[_0x751d('0x21')]['limit']||null:null,'include':_0x2ecc9f[_0x751d('0x21')]?_0x2ecc9f['options'][_0x751d('0x25')]?_[_0x751d('0x26')](_0x2ecc9f[_0x751d('0x21')][_0x751d('0x25')],function(_0x31882e){return{'model':db[_0x31882e[_0x751d('0x27')]],'as':_0x31882e['as'],'attributes':_0x31882e[_0x751d('0x24')],'include':_0x31882e[_0x751d('0x25')]?_['map'](_0x31882e['include'],function(_0x278015){return{'model':db[_0x278015[_0x751d('0x27')]],'as':_0x278015['as'],'attributes':_0x278015[_0x751d('0x24')],'include':_0x278015[_0x751d('0x25')]?_[_0x751d('0x26')](_0x278015[_0x751d('0x25')],function(_0x2acfea){return{'model':db[_0x2acfea[_0x751d('0x27')]],'as':_0x2acfea['as'],'attributes':_0x2acfea[_0x751d('0x24')]};}):[]};}):[]};}):[]:[]})[_0x751d('0x15')](function(_0x105224){logger['info'](_0x751d('0x28'),_0x2ecc9f);logger[_0x751d('0x18')](_0x751d('0x28'),_0x2ecc9f,JSON[_0x751d('0x29')](_0x105224));_0x11a825(_0x105224);})['catch'](function(_0x531890){logger[_0x751d('0x1b')](_0x751d('0x28'),_0x531890[_0x751d('0x1d')],_0x2ecc9f);_0x13a062(_0x445289[_0x751d('0x1b')](0x1f4,_0x531890[_0x751d('0x1d')]));});});};exports[_0x751d('0x2a')]=function(_0x2ffbfc){var _0x380028=this;return new Promise(function(_0x2dbd70,_0x34d92d){return db['ChatQueue']['find']({'raw':_0x2ffbfc[_0x751d('0x21')]?_0x2ffbfc['options'][_0x751d('0x22')]===undefined?!![]:![]:!![],'where':_0x2ffbfc[_0x751d('0x21')]?_0x2ffbfc[_0x751d('0x21')][_0x751d('0x23')]||null:null,'attributes':_0x2ffbfc[_0x751d('0x21')]?_0x2ffbfc[_0x751d('0x21')][_0x751d('0x24')]||null:null,'include':_0x2ffbfc[_0x751d('0x21')]?_0x2ffbfc[_0x751d('0x21')][_0x751d('0x25')]?_['map'](_0x2ffbfc[_0x751d('0x21')][_0x751d('0x25')],function(_0x5c7d67){return{'model':db[_0x5c7d67['model']],'as':_0x5c7d67['as'],'attributes':_0x5c7d67[_0x751d('0x24')],'include':_0x5c7d67[_0x751d('0x25')]?_[_0x751d('0x26')](_0x5c7d67['include'],function(_0x94c096){return{'model':db[_0x94c096[_0x751d('0x27')]],'as':_0x94c096['as'],'attributes':_0x94c096[_0x751d('0x24')],'include':_0x94c096['include']?_['map'](_0x94c096['include'],function(_0x522a8d){return{'model':db[_0x522a8d[_0x751d('0x27')]],'as':_0x522a8d['as'],'attributes':_0x522a8d[_0x751d('0x24')]};}):[]};}):[]};}):[]:[]})[_0x751d('0x15')](function(_0x2bbf65){logger[_0x751d('0x16')](_0x751d('0x2a'),_0x2ffbfc);logger[_0x751d('0x18')](_0x751d('0x2a'),_0x2ffbfc,JSON[_0x751d('0x29')](_0x2bbf65));_0x2dbd70(_0x2bbf65);})[_0x751d('0x1f')](function(_0x4ce32d){logger[_0x751d('0x1b')](_0x751d('0x2a'),_0x4ce32d['message'],_0x2ffbfc);_0x34d92d(_0x380028[_0x751d('0x1b')](0x1f4,_0x4ce32d[_0x751d('0x1d')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 8f209f9..7fe0400 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 _0xb903=['update','emit','removeListener','register','chatQueue:','./chatQueue.events','save','remove'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xb903,0x185));var _0x3b90=function(_0xf2579a,_0x25ca0e){_0xf2579a=_0xf2579a-0x0;var _0x3c0dae=_0xb903[_0xf2579a];return _0x3c0dae;};'use strict';var ChatQueueEvents=require(_0x3b90('0x0'));var events=[_0x3b90('0x1'),_0x3b90('0x2'),_0x3b90('0x3')];function createListener(_0x5191d8,_0x3312ca){return function(_0xf414f4){_0x3312ca[_0x3b90('0x4')](_0x5191d8,_0xf414f4);};}function removeListener(_0x1cd5d8,_0x30d8db){return function(){ChatQueueEvents[_0x3b90('0x5')](_0x1cd5d8,_0x30d8db);};}exports[_0x3b90('0x6')]=function(_0x5acd76){for(var _0x15b68f=0x0,_0x5e845a=events['length'];_0x15b68f<_0x5e845a;_0x15b68f++){var _0x153283=events[_0x15b68f];var _0x2e4c06=createListener(_0x3b90('0x7')+_0x153283,_0x5acd76);ChatQueueEvents['on'](_0x153283,_0x2e4c06);}};
\ No newline at end of file
+var _0x68fc=['emit','removeListener','register','chatQueue:','./chatQueue.events','save','remove'];(function(_0x5c6a78,_0x5c0503){var _0x236c5e=function(_0x44ef45){while(--_0x44ef45){_0x5c6a78['push'](_0x5c6a78['shift']());}};_0x236c5e(++_0x5c0503);}(_0x68fc,0xa5));var _0xc68f=function(_0x3dca1e,_0x1161b8){_0x3dca1e=_0x3dca1e-0x0;var _0x3b10d2=_0x68fc[_0x3dca1e];return _0x3b10d2;};'use strict';var ChatQueueEvents=require(_0xc68f('0x0'));var events=[_0xc68f('0x1'),_0xc68f('0x2'),'update'];function createListener(_0x49aa95,_0x26513f){return function(_0x506fb5){_0x26513f[_0xc68f('0x3')](_0x49aa95,_0x506fb5);};}function removeListener(_0x593648,_0x5899ea){return function(){ChatQueueEvents[_0xc68f('0x4')](_0x593648,_0x5899ea);};}exports[_0xc68f('0x5')]=function(_0x1c6df9){for(var _0x363cdf=0x0,_0x4fcce4=events['length'];_0x363cdf<_0x4fcce4;_0x363cdf++){var _0x9f2705=events[_0x363cdf];var _0x2bf3fd=createListener(_0xc68f('0x6')+_0x9f2705,_0x1c6df9);ChatQueueEvents['on'](_0x9f2705,_0x2bf3fd);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 57f1174..8b7a8fb 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 _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x316606,_0x189791){var _0x1288e7=function(_0x12c123){while(--_0x12c123){_0x316606['push'](_0x316606['shift']());}};_0x1288e7(++_0x189791);}(_0x008c,0x188));var _0xc008=function(_0x3df1c2,_0x1d32db){_0x3df1c2=_0x3df1c2-0x0;var _0x70d3e8=_0x008c[_0x3df1c2];return _0x70d3e8;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x29ce77,_0x2c60a2){var _0x4d6d31=function(_0x3e8668){while(--_0x3e8668){_0x29ce77['push'](_0x29ce77['shift']());}};_0x4d6d31(++_0x2c60a2);}(_0x008c,0x188));var _0xc008=function(_0x5f035f,_0x5300d1){_0x5f035f=_0x5f035f-0x0;var _0xad281e=_0x008c[_0x5f035f];return _0xad281e;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 6a1e46b..6d3bb93 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 _0xd84d=['DATE','moment','exports','STRING'];(function(_0x4f41e9,_0x485797){var _0x3b8ccb=function(_0x3cd88b){while(--_0x3cd88b){_0x4f41e9['push'](_0x4f41e9['shift']());}};_0x3b8ccb(++_0x485797);}(_0xd84d,0x69));var _0xdd84=function(_0x14d107,_0x2baa21){_0x14d107=_0x14d107-0x0;var _0x5b73b3=_0xd84d[_0x14d107];return _0x5b73b3;};'use strict';var moment=require(_0xdd84('0x0'));var Sequelize=require('sequelize');module[_0xdd84('0x1')]={'uniqueid':{'type':Sequelize[_0xdd84('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xdd84('0x2')]},'joinAt':{'type':Sequelize[_0xdd84('0x3')]},'leaveAt':{'type':Sequelize[_0xdd84('0x3')]},'acceptAt':{'type':Sequelize[_0xdd84('0x3')]},'exitAt':{'type':Sequelize[_0xdd84('0x3')]},'reason':{'type':Sequelize[_0xdd84('0x2')]}};
\ No newline at end of file
+var _0x4986=['moment','sequelize','exports','DATE','STRING'];(function(_0x4ec7d2,_0x509e4e){var _0x2ed1ff=function(_0x36582c){while(--_0x36582c){_0x4ec7d2['push'](_0x4ec7d2['shift']());}};_0x2ed1ff(++_0x509e4e);}(_0x4986,0x6e));var _0x6498=function(_0x3ecc23,_0x1b1b15){_0x3ecc23=_0x3ecc23-0x0;var _0x54500b=_0x4986[_0x3ecc23];return _0x54500b;};'use strict';var moment=require(_0x6498('0x0'));var Sequelize=require(_0x6498('0x1'));module[_0x6498('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x6498('0x3')]},'leaveAt':{'type':Sequelize[_0x6498('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x6498('0x3')]},'reason':{'type':Sequelize[_0x6498('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index ef7c91a..419a431 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 _0x8af6=['then','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatQueueReport','includeAll','findAll','catch','show','params','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy'];(function(_0x4cd080,_0x1d04e2){var _0x12ce45=function(_0x144f25){while(--_0x144f25){_0x4cd080['push'](_0x4cd080['shift']());}};_0x12ce45(++_0x1d04e2);}(_0x8af6,0x76));var _0x68af=function(_0x4c3c9a,_0x127439){_0x4c3c9a=_0x4c3c9a-0x0;var _0x428077=_0x8af6[_0x4c3c9a];return _0x428077;};'use strict';var emlformat=require(_0x68af('0x0'));var rimraf=require(_0x68af('0x1'));var zipdir=require(_0x68af('0x2'));var jsonpatch=require(_0x68af('0x3'));var rp=require(_0x68af('0x4'));var moment=require(_0x68af('0x5'));var BPromise=require(_0x68af('0x6'));var Mustache=require(_0x68af('0x7'));var util=require(_0x68af('0x8'));var path=require(_0x68af('0x9'));var sox=require('sox');var csv=require(_0x68af('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x68af('0xb'));var _=require(_0x68af('0xc'));var squel=require(_0x68af('0xd'));var crypto=require(_0x68af('0xe'));var jsforce=require(_0x68af('0xf'));var deskjs=require(_0x68af('0x10'));var toCsv=require(_0x68af('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x68af('0x11'));var authService=require(_0x68af('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x68af('0x13'));var hardwareService=require(_0x68af('0x14'));var logger=require(_0x68af('0x15'))(_0x68af('0x16'));var utils=require(_0x68af('0x17'));var config=require(_0x68af('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b66bc,_0x48a21d){_0x48a21d=_0x48a21d||0xcc;return function(_0x5cfc81){if(_0x5cfc81){return _0x2b66bc[_0x68af('0x19')](_0x48a21d);}return _0x2b66bc[_0x68af('0x1a')](_0x48a21d)[_0x68af('0x1b')]();};}function respondWithResult(_0x5d8a97,_0x1ab12a){_0x1ab12a=_0x1ab12a||0xc8;return function(_0x50f1ea){if(_0x50f1ea){return _0x5d8a97[_0x68af('0x1a')](_0x1ab12a)[_0x68af('0x1c')](_0x50f1ea);}};}function respondWithFilteredResult(_0x23fc49,_0x2e7e1e){return function(_0x45c41c){if(_0x45c41c){var _0x58764e=typeof _0x2e7e1e[_0x68af('0x1d')]===_0x68af('0x1e')&&typeof _0x2e7e1e[_0x68af('0x1f')]===_0x68af('0x1e');var _0x59d7f3=_0x45c41c['count'];var _0x3aa998=_0x58764e?0x0:_0x2e7e1e[_0x68af('0x1d')];var _0x4e1c41=_0x58764e?_0x45c41c[_0x68af('0x20')]:_0x2e7e1e[_0x68af('0x1d')]+_0x2e7e1e[_0x68af('0x1f')];var _0x1a82f0;if(_0x4e1c41>=_0x59d7f3){_0x4e1c41=_0x59d7f3;_0x1a82f0=0xc8;}else{_0x1a82f0=0xce;}_0x23fc49['status'](_0x1a82f0);return _0x23fc49[_0x68af('0x21')](_0x68af('0x22'),_0x3aa998+'-'+_0x4e1c41+'/'+_0x59d7f3)['json'](_0x45c41c);}return null;};}function patchUpdates(_0x5ad458){return function(_0x257545){try{jsonpatch[_0x68af('0x23')](_0x257545,_0x5ad458,!![]);}catch(_0x14b930){return BPromise[_0x68af('0x24')](_0x14b930);}return _0x257545[_0x68af('0x25')]();};}function saveUpdates(_0x34906b,_0x484fac){return function(_0x25a210){if(_0x25a210){return _0x25a210[_0x68af('0x26')](_0x34906b)['then'](function(_0x3ebd57){return _0x3ebd57;});}return null;};}function removeEntity(_0x539bc0,_0x13af7b){return function(_0x1f0d0e){if(_0x1f0d0e){return _0x1f0d0e[_0x68af('0x27')]()[_0x68af('0x28')](function(){_0x539bc0[_0x68af('0x1a')](0xcc)[_0x68af('0x1b')]();});}};}function handleEntityNotFound(_0x5851b9,_0x514ebc){return function(_0x29f003){if(!_0x29f003){_0x5851b9[_0x68af('0x19')](0x194);}return _0x29f003;};}function handleError(_0x351909,_0x1651de){_0x1651de=_0x1651de||0x1f4;return function(_0x375d38){logger[_0x68af('0x29')](_0x375d38[_0x68af('0x2a')]);if(_0x375d38[_0x68af('0x2b')]){delete _0x375d38['name'];}_0x351909[_0x68af('0x1a')](_0x1651de)[_0x68af('0x2c')](_0x375d38);};}exports[_0x68af('0x2d')]=function(_0x3d1303,_0x4c3b67){var _0x524310={},_0x128d5d={},_0x22f1c7={'count':0x0,'rows':[]};var _0x1cb7c5=_['map'](db['ChatQueueReport'][_0x68af('0x2e')],function(_0x135dc1){return{'name':_0x135dc1['fieldName'],'type':_0x135dc1[_0x68af('0x2f')][_0x68af('0x30')]};});_0x128d5d[_0x68af('0x31')]=_[_0x68af('0x32')](_0x1cb7c5,_0x68af('0x2b'));_0x128d5d[_0x68af('0x33')]=_[_0x68af('0x34')](_0x3d1303['query']);_0x128d5d[_0x68af('0x35')]=_[_0x68af('0x36')](_0x128d5d[_0x68af('0x31')],_0x128d5d['query']);_0x524310[_0x68af('0x37')]=_[_0x68af('0x36')](_0x128d5d['model'],qs[_0x68af('0x38')](_0x3d1303[_0x68af('0x33')]['fields']));_0x524310[_0x68af('0x37')]=_0x524310['attributes']['length']?_0x524310[_0x68af('0x37')]:_0x128d5d[_0x68af('0x31')];if(!_0x3d1303[_0x68af('0x33')][_0x68af('0x39')](_0x68af('0x3a'))){_0x524310[_0x68af('0x1f')]=qs['limit'](_0x3d1303['query']['limit']);_0x524310[_0x68af('0x1d')]=qs[_0x68af('0x1d')](_0x3d1303['query'][_0x68af('0x1d')]);}_0x524310[_0x68af('0x3b')]=qs[_0x68af('0x3c')](_0x3d1303['query'][_0x68af('0x3c')]);_0x524310[_0x68af('0x3d')]=qs[_0x68af('0x35')](_[_0x68af('0x3e')](_0x3d1303[_0x68af('0x33')],_0x128d5d['filters']),_0x1cb7c5);if(_0x3d1303[_0x68af('0x33')][_0x68af('0x3f')]){_0x524310[_0x68af('0x3d')]=_[_0x68af('0x40')](_0x524310[_0x68af('0x3d')],{'$or':_[_0x68af('0x32')](_0x1cb7c5,function(_0x1b4096){if(_0x1b4096[_0x68af('0x2f')]!==_0x68af('0x41')){var _0x3110c4={};_0x3110c4[_0x1b4096['name']]={'$like':'%'+_0x3d1303[_0x68af('0x33')][_0x68af('0x3f')]+'%'};return _0x3110c4;}})});}_0x524310=_['merge']({},_0x524310,_0x3d1303[_0x68af('0x42')]);var _0xfc32e8={'where':_0x524310[_0x68af('0x3d')]};return db[_0x68af('0x43')][_0x68af('0x20')](_0xfc32e8)['then'](function(_0x509177){_0x22f1c7['count']=_0x509177;if(_0x3d1303[_0x68af('0x33')][_0x68af('0x44')]){_0x524310['include']=[{'all':!![]}];}return db[_0x68af('0x43')][_0x68af('0x45')](_0x524310);})[_0x68af('0x28')](function(_0x3bb630){_0x22f1c7['rows']=_0x3bb630;return _0x22f1c7;})[_0x68af('0x28')](respondWithFilteredResult(_0x4c3b67,_0x524310))[_0x68af('0x46')](handleError(_0x4c3b67,null));};exports[_0x68af('0x47')]=function(_0x1f477b,_0x356567){var _0x3b5f44={'raw':!![],'where':{'id':_0x1f477b[_0x68af('0x48')]['id']}},_0x3b0953={};_0x3b0953[_0x68af('0x31')]=_[_0x68af('0x34')](db['ChatQueueReport']['rawAttributes']);_0x3b0953[_0x68af('0x33')]=_[_0x68af('0x34')](_0x1f477b[_0x68af('0x33')]);_0x3b0953[_0x68af('0x35')]=_[_0x68af('0x36')](_0x3b0953['model'],_0x3b0953[_0x68af('0x33')]);_0x3b5f44[_0x68af('0x37')]=_[_0x68af('0x36')](_0x3b0953['model'],qs[_0x68af('0x38')](_0x1f477b[_0x68af('0x33')][_0x68af('0x38')]));_0x3b5f44[_0x68af('0x37')]=_0x3b5f44[_0x68af('0x37')][_0x68af('0x49')]?_0x3b5f44[_0x68af('0x37')]:_0x3b0953['model'];if(_0x1f477b[_0x68af('0x33')][_0x68af('0x44')]){_0x3b5f44[_0x68af('0x4a')]=[{'all':!![]}];}_0x3b5f44=_[_0x68af('0x40')]({},_0x3b5f44,_0x1f477b['options']);return db[_0x68af('0x43')][_0x68af('0x4b')](_0x3b5f44)['then'](handleEntityNotFound(_0x356567,null))[_0x68af('0x28')](respondWithResult(_0x356567,null))['catch'](handleError(_0x356567,null));};exports[_0x68af('0x4c')]=function(_0x5bab92,_0xbec158){return db[_0x68af('0x43')][_0x68af('0x4c')](_0x5bab92[_0x68af('0x4d')],{})[_0x68af('0x28')](respondWithResult(_0xbec158,0xc9))[_0x68af('0x46')](handleError(_0xbec158,null));};exports[_0x68af('0x26')]=function(_0x3b43a6,_0x3544d5){if(_0x3b43a6[_0x68af('0x4d')]['id']){delete _0x3b43a6[_0x68af('0x4d')]['id'];}return db[_0x68af('0x43')]['find']({'where':{'id':_0x3b43a6[_0x68af('0x48')]['id']}})[_0x68af('0x28')](handleEntityNotFound(_0x3544d5,null))['then'](saveUpdates(_0x3b43a6[_0x68af('0x4d')],null))[_0x68af('0x28')](respondWithResult(_0x3544d5,null))[_0x68af('0x46')](handleError(_0x3544d5,null));};exports['destroy']=function(_0x18bbc0,_0x1c6c50){return db[_0x68af('0x43')][_0x68af('0x4b')]({'where':{'id':_0x18bbc0[_0x68af('0x48')]['id']}})['then'](handleEntityNotFound(_0x1c6c50,null))[_0x68af('0x28')](removeEntity(_0x1c6c50,null))[_0x68af('0x46')](handleError(_0x1c6c50,null));};exports[_0x68af('0x4e')]=function(_0x460d29,_0x2442ef){return db[_0x68af('0x43')][_0x68af('0x4e')]()[_0x68af('0x28')](respondWithResult(_0x2442ef,null))[_0x68af('0x46')](handleError(_0x2442ef,null));};
\ No newline at end of file
+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(_0xd09502,_0x493218){var _0x8fcf6e=function(_0x32ee03){while(--_0x32ee03){_0xd09502['push'](_0xd09502['shift']());}};_0x8fcf6e(++_0x493218);}(_0x084b,0xd5));var _0xb084=function(_0x512506,_0x4e22ca){_0x512506=_0x512506-0x0;var _0x19c580=_0x084b[_0x512506];return _0x19c580;};'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
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 9598e30..73d48eb 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x490b12,_0x74826a){var _0x805008=function(_0x5b7cb5){while(--_0x5b7cb5){_0x490b12['push'](_0x490b12['shift']());}};_0x805008(++_0x74826a);}(_0x757a,0xde));var _0xa757=function(_0x2d8f7f,_0x274aee){_0x2d8f7f=_0x2d8f7f-0x0;var _0x1b0492=_0x757a[_0x2d8f7f];return _0x1b0492;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x15f8ad,_0x5275c3){var _0xc0238a=function(_0x5550c8){while(--_0x5550c8){_0x15f8ad['push'](_0x15f8ad['shift']());}};_0xc0238a(++_0x5275c3);}(_0xb10b,0x12a));var _0xbb10=function(_0x471268,_0x5ce885){_0x471268=_0x471268-0x0;var _0x1298f3=_0xb10b[_0x471268];return _0x1298f3;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 931476c..93ad20a 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 _0x10df=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ChatQueueReport','create','options','raw','debug','CreateChatQueueReport','update','attributes','UpdateChatQueueReport','lodash','util','moment'];(function(_0xda6024,_0x1434d4){var _0x338ba0=function(_0x2d9829){while(--_0x2d9829){_0xda6024['push'](_0xda6024['shift']());}};_0x338ba0(++_0x1434d4);}(_0x10df,0xb1));var _0xf10d=function(_0x326c48,_0x31eee6){_0x326c48=_0x326c48-0x0;var _0xf71bc5=_0x10df[_0x326c48];return _0xf71bc5;};'use strict';var _=require(_0xf10d('0x0'));var util=require(_0xf10d('0x1'));var moment=require(_0xf10d('0x2'));var BPromise=require('bluebird');var rs=require(_0xf10d('0x3'));var fs=require('fs');var Redis=require(_0xf10d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf10d('0x5'));var logger=require(_0xf10d('0x6'))(_0xf10d('0x7'));var config=require(_0xf10d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf10d('0x9')][_0xf10d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e8a64,_0x99b185,_0x17f04b){return new BPromise(function(_0xe5226,_0x5803cf){return client['request'](_0x1e8a64,_0x17f04b)[_0xf10d('0xb')](function(_0x5f3a3f){logger[_0xf10d('0xc')](_0xf10d('0xd'),_0x99b185,_0xf10d('0xe'));logger['debug'](_0xf10d('0xf'),_0x99b185,'request\x20sent',JSON[_0xf10d('0x10')](_0x5f3a3f));if(_0x5f3a3f[_0xf10d('0x11')]){if(_0x5f3a3f[_0xf10d('0x11')]['code']===0x1f4){logger[_0xf10d('0x11')](_0xf10d('0xd'),_0x99b185,_0x5f3a3f['error'][_0xf10d('0x12')]);return _0x5803cf(_0x5f3a3f[_0xf10d('0x11')][_0xf10d('0x12')]);}logger[_0xf10d('0x11')](_0xf10d('0xd'),_0x99b185,_0x5f3a3f[_0xf10d('0x11')]['message']);return _0xe5226(_0x5f3a3f[_0xf10d('0x11')][_0xf10d('0x12')]);}else{logger[_0xf10d('0xc')](_0xf10d('0xd'),_0x99b185,_0xf10d('0xe'));_0xe5226(_0x5f3a3f[_0xf10d('0x13')][_0xf10d('0x12')]);}})[_0xf10d('0x14')](function(_0x31180d){logger[_0xf10d('0x11')](_0xf10d('0xd'),_0x99b185,_0x31180d);_0x5803cf(_0x31180d);});});}exports['CreateChatQueueReport']=function(_0x46f790){var _0xbc73fd=this;return new Promise(function(_0x5c2539,_0x1138d8){return db[_0xf10d('0x15')][_0xf10d('0x16')](_0x46f790['body'],{'raw':_0x46f790[_0xf10d('0x17')]?_0x46f790['options'][_0xf10d('0x18')]===undefined?!![]:![]:!![]})[_0xf10d('0xb')](function(_0x37bc6f){logger[_0xf10d('0xc')]('CreateChatQueueReport',_0x46f790);logger[_0xf10d('0x19')]('CreateChatQueueReport',_0x46f790,JSON['stringify'](_0x37bc6f));_0x5c2539(_0x37bc6f);})[_0xf10d('0x14')](function(_0x23be70){logger['error'](_0xf10d('0x1a'),_0x23be70[_0xf10d('0x12')],_0x46f790);_0x1138d8(_0xbc73fd[_0xf10d('0x11')](0x1f4,_0x23be70['message']));});});};exports['UpdateChatQueueReport']=function(_0x14f835){var _0x21e6ef=this;return new Promise(function(_0x4e678b,_0x445204){return db[_0xf10d('0x15')][_0xf10d('0x1b')](_0x14f835['body'],{'raw':_0x14f835['options']?_0x14f835[_0xf10d('0x17')][_0xf10d('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14f835[_0xf10d('0x17')]?_0x14f835['options']['where']||null:null,'attributes':_0x14f835[_0xf10d('0x17')]?_0x14f835[_0xf10d('0x17')][_0xf10d('0x1c')]||null:null,'limit':_0x14f835['options']?_0x14f835[_0xf10d('0x17')]['limit']||null:null})[_0xf10d('0xb')](function(_0x1728b5){logger['info'](_0xf10d('0x1d'),_0x14f835);logger[_0xf10d('0x19')](_0xf10d('0x1d'),_0x14f835,JSON[_0xf10d('0x10')](_0x1728b5));_0x4e678b(_0x1728b5);})['catch'](function(_0x2692a8){logger['error'](_0xf10d('0x1d'),_0x2692a8['message'],_0x14f835);_0x445204(_0x21e6ef[_0xf10d('0x11')](0x1f4,_0x2692a8[_0xf10d('0x12')]));});});};
\ No newline at end of file
+var _0x0b94=['info','catch','ChatQueueReport','create','body','options','raw','then','CreateChatQueueReport','stringify','UpdateChatQueueReport','update','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x0b94,0xaf));var _0x40b9=function(_0x2ad946,_0x19e233){_0x2ad946=_0x2ad946-0x0;var _0x278869=_0x0b94[_0x2ad946];return _0x278869;};'use strict';var _=require(_0x40b9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x40b9('0x1'));var rs=require(_0x40b9('0x2'));var fs=require('fs');var Redis=require(_0x40b9('0x3'));var db=require(_0x40b9('0x4'))['db'];var utils=require(_0x40b9('0x5'));var logger=require(_0x40b9('0x6'))('rpc');var config=require(_0x40b9('0x7'));var jayson=require(_0x40b9('0x8'));var client=jayson[_0x40b9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4625d1,_0x126e16,_0x36f834){return new BPromise(function(_0x230c1f,_0x244c8f){return client[_0x40b9('0xa')](_0x4625d1,_0x36f834)['then'](function(_0x18e683){logger['info'](_0x40b9('0xb'),_0x126e16,_0x40b9('0xc'));logger[_0x40b9('0xd')](_0x40b9('0xe'),_0x126e16,_0x40b9('0xc'),JSON['stringify'](_0x18e683));if(_0x18e683[_0x40b9('0xf')]){if(_0x18e683[_0x40b9('0xf')]['code']===0x1f4){logger['error'](_0x40b9('0xb'),_0x126e16,_0x18e683[_0x40b9('0xf')]['message']);return _0x244c8f(_0x18e683['error'][_0x40b9('0x10')]);}logger[_0x40b9('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x126e16,_0x18e683[_0x40b9('0xf')]['message']);return _0x230c1f(_0x18e683[_0x40b9('0xf')][_0x40b9('0x10')]);}else{logger[_0x40b9('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x126e16,_0x40b9('0xc'));_0x230c1f(_0x18e683['result'][_0x40b9('0x10')]);}})[_0x40b9('0x12')](function(_0x36678c){logger[_0x40b9('0xf')](_0x40b9('0xb'),_0x126e16,_0x36678c);_0x244c8f(_0x36678c);});});}exports['CreateChatQueueReport']=function(_0x4dd18f){var _0x53dabc=this;return new Promise(function(_0x13b697,_0x34ae51){return db[_0x40b9('0x13')][_0x40b9('0x14')](_0x4dd18f[_0x40b9('0x15')],{'raw':_0x4dd18f['options']?_0x4dd18f[_0x40b9('0x16')][_0x40b9('0x17')]===undefined?!![]:![]:!![]})[_0x40b9('0x18')](function(_0x60530){logger[_0x40b9('0x11')](_0x40b9('0x19'),_0x4dd18f);logger[_0x40b9('0xd')]('CreateChatQueueReport',_0x4dd18f,JSON[_0x40b9('0x1a')](_0x60530));_0x13b697(_0x60530);})[_0x40b9('0x12')](function(_0x55193d){logger['error']('CreateChatQueueReport',_0x55193d['message'],_0x4dd18f);_0x34ae51(_0x53dabc['error'](0x1f4,_0x55193d[_0x40b9('0x10')]));});});};exports[_0x40b9('0x1b')]=function(_0x3119c0){var _0x4c9165=this;return new Promise(function(_0x20888e,_0x12d953){return db['ChatQueueReport'][_0x40b9('0x1c')](_0x3119c0['body'],{'raw':_0x3119c0[_0x40b9('0x16')]?_0x3119c0[_0x40b9('0x16')][_0x40b9('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3119c0[_0x40b9('0x16')]?_0x3119c0['options'][_0x40b9('0x1d')]||null:null,'attributes':_0x3119c0[_0x40b9('0x16')]?_0x3119c0[_0x40b9('0x16')][_0x40b9('0x1e')]||null:null,'limit':_0x3119c0[_0x40b9('0x16')]?_0x3119c0[_0x40b9('0x16')][_0x40b9('0x1f')]||null:null})[_0x40b9('0x18')](function(_0x19a3df){logger['info'](_0x40b9('0x1b'),_0x3119c0);logger['debug']('UpdateChatQueueReport',_0x3119c0,JSON[_0x40b9('0x1a')](_0x19a3df));_0x20888e(_0x19a3df);})[_0x40b9('0x12')](function(_0x2ce6d9){logger['error'](_0x40b9('0x1b'),_0x2ce6d9[_0x40b9('0x10')],_0x3119c0);_0x12d953(_0x4c9165['error'](0x1f4,_0x2ce6d9[_0x40b9('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index c92b9ff..4c337df 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 _0x7ce1=['../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra'];(function(_0x40a5e8,_0x21b743){var _0x3d9295=function(_0x6eeeae){while(--_0x6eeeae){_0x40a5e8['push'](_0x40a5e8['shift']());}};_0x3d9295(++_0x21b743);}(_0x7ce1,0x14b));var _0x17ce=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x7ce1[_0x55abd9];return _0x3e5669;};'use strict';var multer=require(_0x17ce('0x0'));var util=require('util');var path=require(_0x17ce('0x1'));var timeout=require(_0x17ce('0x2'));var express=require(_0x17ce('0x3'));var router=express['Router']();var fs_extra=require(_0x17ce('0x4'));var auth=require(_0x17ce('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x17ce('0x6'));var controller=require(_0x17ce('0x7'));router[_0x17ce('0x8')]('/',auth[_0x17ce('0x9')](),controller[_0x17ce('0xa')]);router[_0x17ce('0x8')](_0x17ce('0xb'),auth[_0x17ce('0x9')](),controller[_0x17ce('0xc')]);router[_0x17ce('0x8')](_0x17ce('0xd'),auth[_0x17ce('0x9')](),controller[_0x17ce('0xe')]);router[_0x17ce('0xf')]('/',auth[_0x17ce('0x9')](),controller[_0x17ce('0x10')]);router['put'](_0x17ce('0xd'),auth[_0x17ce('0x9')](),controller[_0x17ce('0x11')]);router[_0x17ce('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x17ce('0x13')]);module[_0x17ce('0x14')]=router;
\ No newline at end of file
+var _0x7bf4=['../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','multer','util','path','Router'];(function(_0x3047f7,_0x326044){var _0x331118=function(_0x5f3942){while(--_0x5f3942){_0x3047f7['push'](_0x3047f7['shift']());}};_0x331118(++_0x326044);}(_0x7bf4,0x16c));var _0x47bf=function(_0x60be6e,_0x4abac6){_0x60be6e=_0x60be6e-0x0;var _0x515da0=_0x7bf4[_0x60be6e];return _0x515da0;};'use strict';var multer=require(_0x47bf('0x0'));var util=require(_0x47bf('0x1'));var path=require(_0x47bf('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x47bf('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x47bf('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0x47bf('0x5')]('/',auth[_0x47bf('0x6')](),controller[_0x47bf('0x7')]);router[_0x47bf('0x5')](_0x47bf('0x8'),auth[_0x47bf('0x6')](),controller[_0x47bf('0x9')]);router[_0x47bf('0x5')](_0x47bf('0xa'),auth[_0x47bf('0x6')](),controller[_0x47bf('0xb')]);router[_0x47bf('0xc')]('/',auth[_0x47bf('0x6')](),controller[_0x47bf('0xd')]);router['put'](_0x47bf('0xa'),auth[_0x47bf('0x6')](),controller[_0x47bf('0xe')]);router[_0x47bf('0xf')](_0x47bf('0xa'),auth[_0x47bf('0x6')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 9481d6b..2f610fd 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(_0x1e73fc,_0x533750){var _0xeceac4=function(_0x2c6dda){while(--_0x2c6dda){_0x1e73fc['push'](_0x1e73fc['shift']());}};_0xeceac4(++_0x533750);}(_0x9c44,0x178));var _0x49c4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x9c44[_0x24061a];return _0x82054e;};'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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xb43b,0x1b2));var _0xbb43=function(_0x188540,_0x3ed948){_0x188540=_0x188540-0x0;var _0x1f8384=_0xb43b[_0x188540];return _0x1f8384;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index f308e9e..604b8d2 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 _0x8220=['merge','options','include','ChatTransferReport','findAll','params','find','catch','create','body','describe','fast-json-patch','moment','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','status','stack','name','map','fieldName','type','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','filter','VIRTUAL'];(function(_0x21c1a4,_0x30b425){var _0x7ac3e5=function(_0x2dded1){while(--_0x2dded1){_0x21c1a4['push'](_0x21c1a4['shift']());}};_0x7ac3e5(++_0x30b425);}(_0x8220,0x93));var _0x0822=function(_0x9d5a92,_0x34875d){_0x9d5a92=_0x9d5a92-0x0;var _0x3d84f2=_0x8220[_0x9d5a92];return _0x3d84f2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0822('0x0'));var rp=require('request-promise');var moment=require(_0x0822('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x0822('0x2'));var util=require(_0x0822('0x3'));var path=require('path');var sox=require(_0x0822('0x4'));var csv=require('to-csv');var ejs=require(_0x0822('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0822('0x6'));var squel=require('squel');var crypto=require(_0x0822('0x7'));var jsforce=require(_0x0822('0x8'));var deskjs=require(_0x0822('0x9'));var toCsv=require(_0x0822('0xa'));var querystring=require(_0x0822('0xb'));var Papa=require(_0x0822('0xc'));var Redis=require(_0x0822('0xd'));var authService=require(_0x0822('0xe'));var qs=require(_0x0822('0xf'));var as=require(_0x0822('0x10'));var hardwareService=require(_0x0822('0x11'));var logger=require(_0x0822('0x12'))('api');var utils=require(_0x0822('0x13'));var config=require(_0x0822('0x14'));var licenseUtil=require(_0x0822('0x15'));var db=require(_0x0822('0x16'))['db'];function respondWithStatusCode(_0x3d8934,_0xf5fbe7){_0xf5fbe7=_0xf5fbe7||0xcc;return function(_0x2cc32f){if(_0x2cc32f){return _0x3d8934[_0x0822('0x17')](_0xf5fbe7);}return _0x3d8934['status'](_0xf5fbe7)[_0x0822('0x18')]();};}function respondWithResult(_0x54087d,_0xe21803){_0xe21803=_0xe21803||0xc8;return function(_0x59484a){if(_0x59484a){return _0x54087d['status'](_0xe21803)[_0x0822('0x19')](_0x59484a);}};}function respondWithFilteredResult(_0x26f4b7,_0x31bf95){return function(_0x46271d){if(_0x46271d){var _0x122305=typeof _0x31bf95['offset']===_0x0822('0x1a')&&typeof _0x31bf95[_0x0822('0x1b')]==='undefined';var _0x1088cf=_0x46271d['count'];var _0x5c09fe=_0x122305?0x0:_0x31bf95['offset'];var _0x276af4=_0x122305?_0x46271d[_0x0822('0x1c')]:_0x31bf95[_0x0822('0x1d')]+_0x31bf95[_0x0822('0x1b')];var _0x38e52b;if(_0x276af4>=_0x1088cf){_0x276af4=_0x1088cf;_0x38e52b=0xc8;}else{_0x38e52b=0xce;}_0x26f4b7['status'](_0x38e52b);return _0x26f4b7[_0x0822('0x1e')](_0x0822('0x1f'),_0x5c09fe+'-'+_0x276af4+'/'+_0x1088cf)['json'](_0x46271d);}return null;};}function patchUpdates(_0x56ffd3){return function(_0x11625b){try{jsonpatch[_0x0822('0x20')](_0x11625b,_0x56ffd3,!![]);}catch(_0x3aec88){return BPromise[_0x0822('0x21')](_0x3aec88);}return _0x11625b[_0x0822('0x22')]();};}function saveUpdates(_0x31d148,_0x1a4e9a){return function(_0xa02f5d){if(_0xa02f5d){return _0xa02f5d[_0x0822('0x23')](_0x31d148)[_0x0822('0x24')](function(_0x50d6d1){return _0x50d6d1;});}return null;};}function removeEntity(_0x26cb05,_0x266b7b){return function(_0x57b361){if(_0x57b361){return _0x57b361[_0x0822('0x25')]()[_0x0822('0x24')](function(){_0x26cb05[_0x0822('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a62d4,_0x587607){return function(_0x59b8da){if(!_0x59b8da){_0x1a62d4['sendStatus'](0x194);}return _0x59b8da;};}function handleError(_0x45133b,_0x291a35){_0x291a35=_0x291a35||0x1f4;return function(_0x2088a5){logger['error'](_0x2088a5[_0x0822('0x27')]);if(_0x2088a5['name']){delete _0x2088a5[_0x0822('0x28')];}_0x45133b[_0x0822('0x26')](_0x291a35)['send'](_0x2088a5);};}exports['index']=function(_0x2510ad,_0x4c2a38){var _0x2cd649={},_0x5bd634={},_0x2d9fbf={'count':0x0,'rows':[]};var _0x5f40a1=_[_0x0822('0x29')](db['ChatTransferReport']['rawAttributes'],function(_0x517754){return{'name':_0x517754[_0x0822('0x2a')],'type':_0x517754[_0x0822('0x2b')]['key']};});_0x5bd634[_0x0822('0x2c')]=_[_0x0822('0x29')](_0x5f40a1,_0x0822('0x28'));_0x5bd634[_0x0822('0x2d')]=_[_0x0822('0x2e')](_0x2510ad[_0x0822('0x2d')]);_0x5bd634['filters']=_[_0x0822('0x2f')](_0x5bd634['model'],_0x5bd634['query']);_0x2cd649[_0x0822('0x30')]=_[_0x0822('0x2f')](_0x5bd634[_0x0822('0x2c')],qs[_0x0822('0x31')](_0x2510ad[_0x0822('0x2d')][_0x0822('0x31')]));_0x2cd649['attributes']=_0x2cd649['attributes'][_0x0822('0x32')]?_0x2cd649[_0x0822('0x30')]:_0x5bd634[_0x0822('0x2c')];if(!_0x2510ad[_0x0822('0x2d')]['hasOwnProperty']('nolimit')){_0x2cd649[_0x0822('0x1b')]=qs[_0x0822('0x1b')](_0x2510ad['query'][_0x0822('0x1b')]);_0x2cd649[_0x0822('0x1d')]=qs[_0x0822('0x1d')](_0x2510ad[_0x0822('0x2d')]['offset']);}_0x2cd649[_0x0822('0x33')]=qs[_0x0822('0x34')](_0x2510ad[_0x0822('0x2d')][_0x0822('0x34')]);_0x2cd649[_0x0822('0x35')]=qs[_0x0822('0x36')](_['pick'](_0x2510ad['query'],_0x5bd634[_0x0822('0x36')]),_0x5f40a1);if(_0x2510ad[_0x0822('0x2d')][_0x0822('0x37')]){_0x2cd649['where']=_['merge'](_0x2cd649['where'],{'$or':_[_0x0822('0x29')](_0x5f40a1,function(_0x522d82){if(_0x522d82[_0x0822('0x2b')]!==_0x0822('0x38')){var _0x5a6077={};_0x5a6077[_0x522d82[_0x0822('0x28')]]={'$like':'%'+_0x2510ad[_0x0822('0x2d')]['filter']+'%'};return _0x5a6077;}})});}_0x2cd649=_[_0x0822('0x39')]({},_0x2cd649,_0x2510ad[_0x0822('0x3a')]);var _0x3c9356={'where':_0x2cd649[_0x0822('0x35')]};return db['ChatTransferReport']['count'](_0x3c9356)[_0x0822('0x24')](function(_0x5b5523){_0x2d9fbf['count']=_0x5b5523;if(_0x2510ad[_0x0822('0x2d')]['includeAll']){_0x2cd649[_0x0822('0x3b')]=[{'all':!![]}];}return db[_0x0822('0x3c')][_0x0822('0x3d')](_0x2cd649);})[_0x0822('0x24')](function(_0x581906){_0x2d9fbf['rows']=_0x581906;return _0x2d9fbf;})[_0x0822('0x24')](respondWithFilteredResult(_0x4c2a38,_0x2cd649))['catch'](handleError(_0x4c2a38,null));};exports['show']=function(_0x39331e,_0x3c2e9e){var _0x106847={'raw':!![],'where':{'id':_0x39331e[_0x0822('0x3e')]['id']}},_0x2479c9={};_0x2479c9[_0x0822('0x2c')]=_['keys'](db['ChatTransferReport']['rawAttributes']);_0x2479c9[_0x0822('0x2d')]=_[_0x0822('0x2e')](_0x39331e[_0x0822('0x2d')]);_0x2479c9['filters']=_['intersection'](_0x2479c9['model'],_0x2479c9[_0x0822('0x2d')]);_0x106847['attributes']=_[_0x0822('0x2f')](_0x2479c9['model'],qs['fields'](_0x39331e['query'][_0x0822('0x31')]));_0x106847['attributes']=_0x106847[_0x0822('0x30')][_0x0822('0x32')]?_0x106847[_0x0822('0x30')]:_0x2479c9[_0x0822('0x2c')];if(_0x39331e[_0x0822('0x2d')]['includeAll']){_0x106847[_0x0822('0x3b')]=[{'all':!![]}];}_0x106847=_[_0x0822('0x39')]({},_0x106847,_0x39331e[_0x0822('0x3a')]);return db[_0x0822('0x3c')][_0x0822('0x3f')](_0x106847)[_0x0822('0x24')](handleEntityNotFound(_0x3c2e9e,null))[_0x0822('0x24')](respondWithResult(_0x3c2e9e,null))[_0x0822('0x40')](handleError(_0x3c2e9e,null));};exports['create']=function(_0x29c19a,_0x516d46){return db[_0x0822('0x3c')][_0x0822('0x41')](_0x29c19a[_0x0822('0x42')],{})[_0x0822('0x24')](respondWithResult(_0x516d46,0xc9))[_0x0822('0x40')](handleError(_0x516d46,null));};exports[_0x0822('0x23')]=function(_0x21665c,_0xbea9b3){if(_0x21665c[_0x0822('0x42')]['id']){delete _0x21665c['body']['id'];}return db[_0x0822('0x3c')][_0x0822('0x3f')]({'where':{'id':_0x21665c[_0x0822('0x3e')]['id']}})[_0x0822('0x24')](handleEntityNotFound(_0xbea9b3,null))[_0x0822('0x24')](saveUpdates(_0x21665c[_0x0822('0x42')],null))[_0x0822('0x24')](respondWithResult(_0xbea9b3,null))[_0x0822('0x40')](handleError(_0xbea9b3,null));};exports[_0x0822('0x25')]=function(_0x1f6968,_0x151486){return db['ChatTransferReport']['find']({'where':{'id':_0x1f6968[_0x0822('0x3e')]['id']}})[_0x0822('0x24')](handleEntityNotFound(_0x151486,null))[_0x0822('0x24')](removeEntity(_0x151486,null))['catch'](handleError(_0x151486,null));};exports[_0x0822('0x43')]=function(_0x5478c0,_0x189a47){return db[_0x0822('0x3c')][_0x0822('0x43')]()['then'](respondWithResult(_0x189a47,null))['catch'](handleError(_0x189a47,null));};
\ No newline at end of file
+var _0x33f8=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','ChatTransferReport','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger'];(function(_0x41e6fa,_0x2dc57e){var _0x56bceb=function(_0x4950b1){while(--_0x4950b1){_0x41e6fa['push'](_0x41e6fa['shift']());}};_0x56bceb(++_0x2dc57e);}(_0x33f8,0x177));var _0x833f=function(_0x2cfd7f,_0x517c76){_0x2cfd7f=_0x2cfd7f-0x0;var _0x302d2a=_0x33f8[_0x2cfd7f];return _0x302d2a;};'use strict';var emlformat=require(_0x833f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x833f('0x1'));var jsonpatch=require(_0x833f('0x2'));var rp=require('request-promise');var moment=require(_0x833f('0x3'));var BPromise=require(_0x833f('0x4'));var Mustache=require(_0x833f('0x5'));var util=require('util');var path=require(_0x833f('0x6'));var sox=require(_0x833f('0x7'));var csv=require(_0x833f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x833f('0x9'));var _=require(_0x833f('0xa'));var squel=require('squel');var crypto=require(_0x833f('0xb'));var jsforce=require(_0x833f('0xc'));var deskjs=require(_0x833f('0xd'));var toCsv=require(_0x833f('0x8'));var querystring=require(_0x833f('0xe'));var Papa=require(_0x833f('0xf'));var Redis=require(_0x833f('0x10'));var authService=require(_0x833f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x833f('0x12'));var logger=require(_0x833f('0x13'))(_0x833f('0x14'));var utils=require('../../config/utils');var config=require(_0x833f('0x15'));var licenseUtil=require(_0x833f('0x16'));var db=require(_0x833f('0x17'))['db'];function respondWithStatusCode(_0x229331,_0x45f63f){_0x45f63f=_0x45f63f||0xcc;return function(_0x5711b2){if(_0x5711b2){return _0x229331[_0x833f('0x18')](_0x45f63f);}return _0x229331['status'](_0x45f63f)[_0x833f('0x19')]();};}function respondWithResult(_0x464952,_0x195a64){_0x195a64=_0x195a64||0xc8;return function(_0x161dd4){if(_0x161dd4){return _0x464952[_0x833f('0x1a')](_0x195a64)[_0x833f('0x1b')](_0x161dd4);}};}function respondWithFilteredResult(_0x446a80,_0x2100c3){return function(_0x334bed){if(_0x334bed){var _0x2ccd5d=typeof _0x2100c3['offset']==='undefined'&&typeof _0x2100c3[_0x833f('0x1c')]===_0x833f('0x1d');var _0x328a01=_0x334bed[_0x833f('0x1e')];var _0x4c58c5=_0x2ccd5d?0x0:_0x2100c3[_0x833f('0x1f')];var _0x46e7ed=_0x2ccd5d?_0x334bed['count']:_0x2100c3[_0x833f('0x1f')]+_0x2100c3[_0x833f('0x1c')];var _0x2055bc;if(_0x46e7ed>=_0x328a01){_0x46e7ed=_0x328a01;_0x2055bc=0xc8;}else{_0x2055bc=0xce;}_0x446a80[_0x833f('0x1a')](_0x2055bc);return _0x446a80[_0x833f('0x20')](_0x833f('0x21'),_0x4c58c5+'-'+_0x46e7ed+'/'+_0x328a01)[_0x833f('0x1b')](_0x334bed);}return null;};}function patchUpdates(_0x4bb941){return function(_0x4f52f0){try{jsonpatch[_0x833f('0x22')](_0x4f52f0,_0x4bb941,!![]);}catch(_0x5a5e2e){return BPromise[_0x833f('0x23')](_0x5a5e2e);}return _0x4f52f0[_0x833f('0x24')]();};}function saveUpdates(_0x331a28,_0xdb1a29){return function(_0x280fd5){if(_0x280fd5){return _0x280fd5[_0x833f('0x25')](_0x331a28)[_0x833f('0x26')](function(_0x27d573){return _0x27d573;});}return null;};}function removeEntity(_0x336f65,_0x4b6a72){return function(_0x5df83f){if(_0x5df83f){return _0x5df83f[_0x833f('0x27')]()[_0x833f('0x26')](function(){_0x336f65[_0x833f('0x1a')](0xcc)[_0x833f('0x19')]();});}};}function handleEntityNotFound(_0x1c82e1,_0x11ebfe){return function(_0x3f0a4f){if(!_0x3f0a4f){_0x1c82e1['sendStatus'](0x194);}return _0x3f0a4f;};}function handleError(_0x9403ae,_0x3e41e8){_0x3e41e8=_0x3e41e8||0x1f4;return function(_0x8c32c5){logger[_0x833f('0x28')](_0x8c32c5[_0x833f('0x29')]);if(_0x8c32c5['name']){delete _0x8c32c5[_0x833f('0x2a')];}_0x9403ae[_0x833f('0x1a')](_0x3e41e8)[_0x833f('0x2b')](_0x8c32c5);};}exports[_0x833f('0x2c')]=function(_0x555718,_0x30c8e1){var _0xb26093={},_0x2df0aa={},_0x466aff={'count':0x0,'rows':[]};var _0x484d77=_[_0x833f('0x2d')](db['ChatTransferReport'][_0x833f('0x2e')],function(_0x1ae5ed){return{'name':_0x1ae5ed[_0x833f('0x2f')],'type':_0x1ae5ed[_0x833f('0x30')]['key']};});_0x2df0aa[_0x833f('0x31')]=_[_0x833f('0x2d')](_0x484d77,_0x833f('0x2a'));_0x2df0aa['query']=_[_0x833f('0x32')](_0x555718[_0x833f('0x33')]);_0x2df0aa[_0x833f('0x34')]=_[_0x833f('0x35')](_0x2df0aa[_0x833f('0x31')],_0x2df0aa['query']);_0xb26093[_0x833f('0x36')]=_[_0x833f('0x35')](_0x2df0aa[_0x833f('0x31')],qs[_0x833f('0x37')](_0x555718[_0x833f('0x33')][_0x833f('0x37')]));_0xb26093[_0x833f('0x36')]=_0xb26093[_0x833f('0x36')]['length']?_0xb26093['attributes']:_0x2df0aa[_0x833f('0x31')];if(!_0x555718['query'][_0x833f('0x38')](_0x833f('0x39'))){_0xb26093[_0x833f('0x1c')]=qs[_0x833f('0x1c')](_0x555718[_0x833f('0x33')]['limit']);_0xb26093[_0x833f('0x1f')]=qs['offset'](_0x555718[_0x833f('0x33')]['offset']);}_0xb26093[_0x833f('0x3a')]=qs[_0x833f('0x3b')](_0x555718[_0x833f('0x33')][_0x833f('0x3b')]);_0xb26093[_0x833f('0x3c')]=qs[_0x833f('0x34')](_[_0x833f('0x3d')](_0x555718['query'],_0x2df0aa[_0x833f('0x34')]),_0x484d77);if(_0x555718[_0x833f('0x33')][_0x833f('0x3e')]){_0xb26093['where']=_[_0x833f('0x3f')](_0xb26093[_0x833f('0x3c')],{'$or':_[_0x833f('0x2d')](_0x484d77,function(_0x2d87b5){if(_0x2d87b5['type']!==_0x833f('0x40')){var _0x23ab1c={};_0x23ab1c[_0x2d87b5[_0x833f('0x2a')]]={'$like':'%'+_0x555718['query'][_0x833f('0x3e')]+'%'};return _0x23ab1c;}})});}_0xb26093=_[_0x833f('0x3f')]({},_0xb26093,_0x555718[_0x833f('0x41')]);var _0x32ee2f={'where':_0xb26093['where']};return db['ChatTransferReport']['count'](_0x32ee2f)[_0x833f('0x26')](function(_0x225f4d){_0x466aff[_0x833f('0x1e')]=_0x225f4d;if(_0x555718[_0x833f('0x33')]['includeAll']){_0xb26093[_0x833f('0x42')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x833f('0x43')](_0xb26093);})['then'](function(_0x25c7a6){_0x466aff[_0x833f('0x44')]=_0x25c7a6;return _0x466aff;})[_0x833f('0x26')](respondWithFilteredResult(_0x30c8e1,_0xb26093))[_0x833f('0x45')](handleError(_0x30c8e1,null));};exports[_0x833f('0x46')]=function(_0x2d61e7,_0x391ec1){var _0x4365e2={'raw':!![],'where':{'id':_0x2d61e7[_0x833f('0x47')]['id']}},_0x49588b={};_0x49588b[_0x833f('0x31')]=_['keys'](db['ChatTransferReport'][_0x833f('0x2e')]);_0x49588b['query']=_[_0x833f('0x32')](_0x2d61e7[_0x833f('0x33')]);_0x49588b[_0x833f('0x34')]=_[_0x833f('0x35')](_0x49588b['model'],_0x49588b[_0x833f('0x33')]);_0x4365e2[_0x833f('0x36')]=_[_0x833f('0x35')](_0x49588b['model'],qs[_0x833f('0x37')](_0x2d61e7[_0x833f('0x33')][_0x833f('0x37')]));_0x4365e2[_0x833f('0x36')]=_0x4365e2[_0x833f('0x36')][_0x833f('0x48')]?_0x4365e2[_0x833f('0x36')]:_0x49588b[_0x833f('0x31')];if(_0x2d61e7['query'][_0x833f('0x49')]){_0x4365e2['include']=[{'all':!![]}];}_0x4365e2=_['merge']({},_0x4365e2,_0x2d61e7['options']);return db[_0x833f('0x4a')][_0x833f('0x4b')](_0x4365e2)[_0x833f('0x26')](handleEntityNotFound(_0x391ec1,null))[_0x833f('0x26')](respondWithResult(_0x391ec1,null))[_0x833f('0x45')](handleError(_0x391ec1,null));};exports[_0x833f('0x4c')]=function(_0x4fce8a,_0x6cd73b){return db[_0x833f('0x4a')][_0x833f('0x4c')](_0x4fce8a[_0x833f('0x4d')],{})[_0x833f('0x26')](respondWithResult(_0x6cd73b,0xc9))['catch'](handleError(_0x6cd73b,null));};exports['update']=function(_0x270693,_0x5235c4){if(_0x270693[_0x833f('0x4d')]['id']){delete _0x270693[_0x833f('0x4d')]['id'];}return db['ChatTransferReport'][_0x833f('0x4b')]({'where':{'id':_0x270693[_0x833f('0x47')]['id']}})[_0x833f('0x26')](handleEntityNotFound(_0x5235c4,null))[_0x833f('0x26')](saveUpdates(_0x270693[_0x833f('0x4d')],null))[_0x833f('0x26')](respondWithResult(_0x5235c4,null))[_0x833f('0x45')](handleError(_0x5235c4,null));};exports[_0x833f('0x27')]=function(_0x4d2f59,_0x1333a8){return db[_0x833f('0x4a')]['find']({'where':{'id':_0x4d2f59['params']['id']}})[_0x833f('0x26')](handleEntityNotFound(_0x1333a8,null))[_0x833f('0x26')](removeEntity(_0x1333a8,null))[_0x833f('0x45')](handleError(_0x1333a8,null));};exports[_0x833f('0x4e')]=function(_0x5bedf1,_0x4c1fad){return db['ChatTransferReport']['describe']()[_0x833f('0x26')](respondWithResult(_0x4c1fad,null))[_0x833f('0x45')](handleError(_0x4c1fad,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 88ba2bc..87c2256 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 _0xc0f2=['bluebird','rimraf','../../config/environment','./chatTransferReport.attributes','uniqueid','lodash','util','../../config/logger','api'];(function(_0x29c11f,_0x546362){var _0x49f24a=function(_0x22b1a3){while(--_0x22b1a3){_0x29c11f['push'](_0x29c11f['shift']());}};_0x49f24a(++_0x546362);}(_0xc0f2,0x16d));var _0x2c0f=function(_0x251049,_0x21a6cc){_0x251049=_0x251049-0x0;var _0x24fe11=_0xc0f2[_0x251049];return _0x24fe11;};'use strict';var _=require(_0x2c0f('0x0'));var util=require(_0x2c0f('0x1'));var logger=require(_0x2c0f('0x2'))(_0x2c0f('0x3'));var moment=require('moment');var BPromise=require(_0x2c0f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2c0f('0x5'));var config=require(_0x2c0f('0x6'));var attributes=require(_0x2c0f('0x7'));module['exports']=function(_0x4489d7,_0x1a48ee){return _0x4489d7['define']('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x2c0f('0x8'),'fields':[_0x2c0f('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb746=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatTransferReport.attributes','exports'];(function(_0x2a642d,_0x2df503){var _0x4adf7d=function(_0x5c3068){while(--_0x5c3068){_0x2a642d['push'](_0x2a642d['shift']());}};_0x4adf7d(++_0x2df503);}(_0xb746,0x162));var _0x6b74=function(_0x4ceec9,_0x16057d){_0x4ceec9=_0x4ceec9-0x0;var _0x4e2033=_0xb746[_0x4ceec9];return _0x4e2033;};'use strict';var _=require(_0x6b74('0x0'));var util=require('util');var logger=require(_0x6b74('0x1'))(_0x6b74('0x2'));var moment=require(_0x6b74('0x3'));var BPromise=require(_0x6b74('0x4'));var rp=require(_0x6b74('0x5'));var fs=require('fs');var path=require(_0x6b74('0x6'));var rimraf=require('rimraf');var config=require(_0x6b74('0x7'));var attributes=require(_0x6b74('0x8'));module[_0x6b74('0x9')]=function(_0x12a443,_0x26cedb){return _0x12a443['define'](_0x6b74('0xa'),attributes,{'tableName':_0x6b74('0xb'),'paranoid':![],'indexes':[{'name':_0x6b74('0xc'),'fields':[_0x6b74('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 5c968eb..bd40b9e 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 _0x9bcf=['result','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','error','ChatTransferReport,\x20%s,\x20%s','message'];(function(_0x329c19,_0x512fea){var _0x55fdaf=function(_0x437c72){while(--_0x437c72){_0x329c19['push'](_0x329c19['shift']());}};_0x55fdaf(++_0x512fea);}(_0x9bcf,0x9a));var _0xf9bc=function(_0x5e7e1a,_0x38a7c6){_0x5e7e1a=_0x5e7e1a-0x0;var _0x46b94f=_0x9bcf[_0x5e7e1a];return _0x46b94f;};'use strict';var _=require(_0xf9bc('0x0'));var util=require('util');var moment=require(_0xf9bc('0x1'));var BPromise=require(_0xf9bc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf9bc('0x3'));var logger=require(_0xf9bc('0x4'))(_0xf9bc('0x5'));var config=require(_0xf9bc('0x6'));var jayson=require(_0xf9bc('0x7'));var client=jayson[_0xf9bc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23fda9,_0x137cea,_0x484a74){return new BPromise(function(_0x53a1bd,_0x5b1f08){return client[_0xf9bc('0x9')](_0x23fda9,_0x484a74)['then'](function(_0x5487ef){logger[_0xf9bc('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x137cea,_0xf9bc('0xb'));logger[_0xf9bc('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x137cea,_0xf9bc('0xb'),JSON['stringify'](_0x5487ef));if(_0x5487ef[_0xf9bc('0xd')]){if(_0x5487ef[_0xf9bc('0xd')]['code']===0x1f4){logger[_0xf9bc('0xd')](_0xf9bc('0xe'),_0x137cea,_0x5487ef[_0xf9bc('0xd')][_0xf9bc('0xf')]);return _0x5b1f08(_0x5487ef['error'][_0xf9bc('0xf')]);}logger['error'](_0xf9bc('0xe'),_0x137cea,_0x5487ef['error']['message']);return _0x53a1bd(_0x5487ef[_0xf9bc('0xd')][_0xf9bc('0xf')]);}else{logger[_0xf9bc('0xa')](_0xf9bc('0xe'),_0x137cea,_0xf9bc('0xb'));_0x53a1bd(_0x5487ef[_0xf9bc('0x10')][_0xf9bc('0xf')]);}})['catch'](function(_0x221d42){logger[_0xf9bc('0xd')](_0xf9bc('0xe'),_0x137cea,_0x221d42);_0x5b1f08(_0x221d42);});});}
\ No newline at end of file
+var _0xc11e=['ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0x5f3031,_0x350e0f){var _0x3879e6=function(_0x337da7){while(--_0x337da7){_0x5f3031['push'](_0x5f3031['shift']());}};_0x3879e6(++_0x350e0f);}(_0xc11e,0x153));var _0xec11=function(_0xd4636c,_0x34dbf6){_0xd4636c=_0xd4636c-0x0;var _0x5ee17d=_0xc11e[_0xd4636c];return _0x5ee17d;};'use strict';var _=require(_0xec11('0x0'));var util=require(_0xec11('0x1'));var moment=require('moment');var BPromise=require(_0xec11('0x2'));var rs=require(_0xec11('0x3'));var fs=require('fs');var Redis=require(_0xec11('0x4'));var db=require(_0xec11('0x5'))['db'];var utils=require(_0xec11('0x6'));var logger=require(_0xec11('0x7'))(_0xec11('0x8'));var config=require('../../config/environment');var jayson=require(_0xec11('0x9'));var client=jayson['client'][_0xec11('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2faf25,_0x209007,_0xbf648f){return new BPromise(function(_0x4e0d05,_0x366d7b){return client[_0xec11('0xb')](_0x2faf25,_0xbf648f)[_0xec11('0xc')](function(_0x37fd71){logger['info'](_0xec11('0xd'),_0x209007,_0xec11('0xe'));logger[_0xec11('0xf')](_0xec11('0x10'),_0x209007,_0xec11('0xe'),JSON[_0xec11('0x11')](_0x37fd71));if(_0x37fd71[_0xec11('0x12')]){if(_0x37fd71[_0xec11('0x12')]['code']===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x209007,_0x37fd71[_0xec11('0x12')][_0xec11('0x13')]);return _0x366d7b(_0x37fd71[_0xec11('0x12')][_0xec11('0x13')]);}logger[_0xec11('0x12')](_0xec11('0xd'),_0x209007,_0x37fd71[_0xec11('0x12')][_0xec11('0x13')]);return _0x4e0d05(_0x37fd71['error'][_0xec11('0x13')]);}else{logger[_0xec11('0x14')](_0xec11('0xd'),_0x209007,_0xec11('0xe'));_0x4e0d05(_0x37fd71[_0xec11('0x15')][_0xec11('0x13')]);}})['catch'](function(_0x228978){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x209007,_0x228978);_0x366d7b(_0x228978);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 371f3f1..9b8793e 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 _0x581e=['/:id','delete','destroy','exports','multer','util','Router','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','describe','get','show','post','create'];(function(_0x544da7,_0x5d5ac1){var _0x163310=function(_0x11d220){while(--_0x11d220){_0x544da7['push'](_0x544da7['shift']());}};_0x163310(++_0x5d5ac1);}(_0x581e,0x6a));var _0xe581=function(_0xb13d69,_0x5941ed){_0xb13d69=_0xb13d69-0x0;var _0x2d9a47=_0x581e[_0xb13d69];return _0x2d9a47;};'use strict';var multer=require(_0xe581('0x0'));var util=require(_0xe581('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe581('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe581('0x3'));var config=require(_0xe581('0x4'));var controller=require(_0xe581('0x5'));router['get']('/',auth[_0xe581('0x6')](),controller[_0xe581('0x7')]);router['get']('/describe',auth[_0xe581('0x6')](),controller[_0xe581('0x8')]);router[_0xe581('0x9')]('/:id',auth[_0xe581('0x6')](),controller[_0xe581('0xa')]);router[_0xe581('0xb')]('/',auth[_0xe581('0x6')](),controller[_0xe581('0xc')]);router['put'](_0xe581('0xd'),auth[_0xe581('0x6')](),controller['update']);router[_0xe581('0xe')]('/:id',auth[_0xe581('0x6')](),controller[_0xe581('0xf')]);module[_0xe581('0x10')]=router;
\ No newline at end of file
+var _0x368e=['get','isAuthenticated','index','describe','/:id','show','post','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./chatTransferReport.controller'];(function(_0xbaae28,_0x5657f5){var _0x542e54=function(_0x24e247){while(--_0x24e247){_0xbaae28['push'](_0xbaae28['shift']());}};_0x542e54(++_0x5657f5);}(_0x368e,0x196));var _0xe368=function(_0x3337b6,_0x42c7f9){_0x3337b6=_0x3337b6-0x0;var _0x568270=_0x368e[_0x3337b6];return _0x568270;};'use strict';var multer=require(_0xe368('0x0'));var util=require(_0xe368('0x1'));var path=require(_0xe368('0x2'));var timeout=require(_0xe368('0x3'));var express=require('express');var router=express[_0xe368('0x4')]();var fs_extra=require(_0xe368('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe368('0x6'));var config=require('../../config/environment');var controller=require(_0xe368('0x7'));router[_0xe368('0x8')]('/',auth[_0xe368('0x9')](),controller[_0xe368('0xa')]);router[_0xe368('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xe368('0xb')]);router[_0xe368('0x8')](_0xe368('0xc'),auth[_0xe368('0x9')](),controller[_0xe368('0xd')]);router[_0xe368('0xe')]('/',auth[_0xe368('0x9')](),controller['create']);router[_0xe368('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xe368('0x10')]);router['delete'](_0xe368('0xc'),auth[_0xe368('0x9')](),controller['destroy']);module[_0xe368('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index d2b589e..2c90e86 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 _0xd80c=['TEXT','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Feedback','star','stringify','name','text','input','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY'];(function(_0x2c6777,_0x29aaff){var _0xa0c123=function(_0x572849){while(--_0x572849){_0x2c6777['push'](_0x2c6777['shift']());}};_0xa0c123(++_0x29aaff);}(_0xd80c,0x17a));var _0xcd80=function(_0x8076fc,_0x53ca55){_0x8076fc=_0x8076fc-0x0;var _0x118b6f=_0xd80c[_0x8076fc];return _0x118b6f;};'use strict';var Sequelize=require(_0xcd80('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xcd80('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0xcd80('0x1')],'allowNull':![],'unique':_0xcd80('0x2')},'description':{'type':Sequelize[_0xcd80('0x1')]},'mapKey':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':_0xcd80('0x3')},'mapKeyOffline':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xcd80('0x1')],'allowNull':![],'defaultValue':_0xcd80('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xcd80('0x1')],'allowNull':![],'defaultValue':_0xcd80('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcd80('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xcd80('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xcd80('0x1')]},'animation':{'type':Sequelize[_0xcd80('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xcd80('0x8')](_0xcd80('0x9'),'squared'),'defaultValue':_0xcd80('0x9')},'header_online':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':_0xcd80('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xcd80('0xb')},'offline_chat_button':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xcd80('0xc')},'download_transcript':{'type':Sequelize[_0xcd80('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xcd80('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':_0xcd80('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0xcd80('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xcd80('0xe')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':_0xcd80('0xf')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xcd80('0x10')},'closingMessage':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':_0xcd80('0x11')},'closingMessageButton':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':_0xcd80('0x12')},'skipMessageButton':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xcd80('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xcd80('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xcd80('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xcd80('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':_0xcd80('0x13')},'ratingType':{'type':Sequelize[_0xcd80('0x8')](_0xcd80('0x14'),'thumb'),'defaultValue':_0xcd80('0x14')},'ratingStarsNumber':{'type':Sequelize[_0xcd80('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xcd80('0xe')],'defaultValue':function(){return JSON[_0xcd80('0x15')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xcd80('0x16'),'type':_0xcd80('0x17'),'required':!![]},'props':{'title':_0xcd80('0x16'),'helpText':''}},{'type':_0xcd80('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xcd80('0x3'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xcd80('0x19'))?JSON[_0xcd80('0x1a')](this[_0xcd80('0x1b')](_0xcd80('0x19'))):{};},'set':function(_0x1c7bf1){return this[_0xcd80('0x1c')](_0xcd80('0x19'),JSON['stringify'](_0x1c7bf1));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xcd80('0x15')]({'items':[{'type':_0xcd80('0x18'),'props':{'title':_0xcd80('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xcd80('0x3'),'type':'email'},'variable':null},{'type':_0xcd80('0x1d'),'config':{'placeholder':_0xcd80('0x1e')},'props':{'title':'Comments','helpText':_0xcd80('0x1f')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xcd80('0x20'))?JSON[_0xcd80('0x1a')](this[_0xcd80('0x1b')](_0xcd80('0x20'))):{};},'set':function(_0x8a4ec4){return this[_0xcd80('0x1c')](_0xcd80('0x20'),JSON[_0xcd80('0x15')](_0x8a4ec4));}},'token':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':function(){return rs[_0xcd80('0x21')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xcd80('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xcd80('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xcd80('0x1')]},'forwardOffline':{'type':Sequelize[_0xcd80('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xcd80('0x1')]},'waitingTitle':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':_0xcd80('0x22')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xcd80('0x23')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xcd80('0x24')},'offlineMessageBody':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':_0xcd80('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0xcd80('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xcd80('0x26')},'skipUnmanaged':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':_0xcd80('0x27')},'sendUnmanaged':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':_0xcd80('0x12')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xcd80('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xcd80('0xe')]},'showAgentAvatar':{'type':Sequelize[_0xcd80('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xcd80('0xe')],'defaultValue':function(){return _0xcd80('0x28');}},'notificationSound':{'type':Sequelize[_0xcd80('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcd80('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xcd80('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xcd80('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':_0xcd80('0x2a')},'verticalAlignment':{'type':Sequelize[_0xcd80('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':_0xcd80('0x2b')},'messagesAlignment':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xcd80('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0xcd80('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xcd80('0x1')],'allowNull':![],'defaultValue':_0xcd80('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xcd80('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':_0xcd80('0x2d')},'systemAvatar':{'type':Sequelize[_0xcd80('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcd80('0x6')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xcd80('0x2e'),'set':function(_0x1e1e48){if(!_0x1e1e48)this[_0xcd80('0x1c')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xcd80('0x2f'),_0x1e1e48);}},'vidaooEscalation':{'type':Sequelize[_0xcd80('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xcd80('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xcd80('0x1')],'defaultValue':function(){return _0xcd80('0x30');}},'vidaooMetadata':{'type':Sequelize[_0xcd80('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xcd80('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xcd80('0xe')]}};
\ No newline at end of file
+var _0x5b03=['TEXT','name','text','input','getDataValue','onlineForm','setDataValue','stringify','textarea','Comments','parse','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','website_alias','bottom_right','CHAT','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','INTEGER','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb'];(function(_0x3272e3,_0x2db4a5){var _0xb2f245=function(_0x4fe8a1){while(--_0x4fe8a1){_0x3272e3['push'](_0x3272e3['shift']());}};_0xb2f245(++_0x2db4a5);}(_0x5b03,0x145));var _0x35b0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5b03[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x35b0('0x0'));var rs=require(_0x35b0('0x1'));module[_0x35b0('0x2')]={'name':{'type':Sequelize[_0x35b0('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x35b0('0x3')],'allowNull':![],'unique':_0x35b0('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x35b0('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0x35b0('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x35b0('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x35b0('0x3')],'allowNull':![],'defaultValue':_0x35b0('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x35b0('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x35b0('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x35b0('0x8')](_0x35b0('0x9'),_0x35b0('0xa')),'defaultValue':_0x35b0('0x9')},'header_online':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':_0x35b0('0xb')},'start_chat_button':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':_0x35b0('0xc')},'offline_chat_button':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':_0x35b0('0xd')},'header_offline':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':_0x35b0('0xe')},'download_transcript':{'type':Sequelize[_0x35b0('0xf')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x35b0('0x10')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':_0x35b0('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0x35b0('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':_0x35b0('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':_0x35b0('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x35b0('0x14')},'closingMessageButton':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':_0x35b0('0xd')},'skipMessageButton':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':_0x35b0('0x15')},'conditionAgreement':{'type':Sequelize[_0x35b0('0xf')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x35b0('0xf')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x35b0('0xf')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':_0x35b0('0x16')},'ratingType':{'type':Sequelize[_0x35b0('0x8')](_0x35b0('0x17'),_0x35b0('0x18')),'defaultValue':_0x35b0('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x35b0('0x10')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x35b0('0x19')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x35b0('0x1a'),'type':_0x35b0('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x35b0('0x1c'),'props':{'title':_0x35b0('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x35b0('0x5'),'type':_0x35b0('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x35b0('0x1d')](_0x35b0('0x1e'))?JSON['parse'](this[_0x35b0('0x1d')](_0x35b0('0x1e'))):{};},'set':function(_0x886d1c){return this[_0x35b0('0x1f')]('onlineForm',JSON[_0x35b0('0x20')](_0x886d1c));}},'offlineForm':{'type':Sequelize[_0x35b0('0x19')],'defaultValue':function(){return JSON[_0x35b0('0x20')]({'items':[{'type':_0x35b0('0x1c'),'props':{'title':_0x35b0('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x35b0('0x5'),'type':'email'},'variable':null},{'type':_0x35b0('0x21'),'config':{'placeholder':'Comments'},'props':{'title':_0x35b0('0x22'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x35b0('0x1d')]('offlineForm')?JSON[_0x35b0('0x23')](this['getDataValue'](_0x35b0('0x24'))):{};},'set':function(_0x550f10){return this['setDataValue'](_0x35b0('0x24'),JSON[_0x35b0('0x20')](_0x550f10));}},'token':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':function(){return rs[_0x35b0('0x25')]();}},'autoclose':{'type':Sequelize[_0x35b0('0xf')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x35b0('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x35b0('0xf')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x35b0('0x3')]},'forwardOffline':{'type':Sequelize[_0x35b0('0xf')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x35b0('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x35b0('0x26')},'waitingMessage':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':_0x35b0('0x27')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':_0x35b0('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x35b0('0xf')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x35b0('0x15')},'sendUnmanaged':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':_0x35b0('0xd')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x35b0('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x35b0('0x19')]},'showAgentAvatar':{'type':Sequelize[_0x35b0('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x35b0('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x35b0('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x35b0('0xf')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':_0x35b0('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x35b0('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':_0x35b0('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':_0x35b0('0x2b')},'messagesAlignment':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x35b0('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x35b0('0x3')],'allowNull':![],'defaultValue':_0x35b0('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x35b0('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x35b0('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x35b0('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':_0x35b0('0x2d')},'systemAvatar':{'type':Sequelize[_0x35b0('0x19')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x35b0('0x2e'),'set':function(_0x4d654e){if(!_0x4d654e)this[_0x35b0('0x1f')](_0x35b0('0x2f'),null);this['setDataValue'](_0x35b0('0x30'),_0x4d654e);}},'vidaooEscalation':{'type':Sequelize[_0x35b0('0xf')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x35b0('0x3')]},'vidaooTopic':{'type':Sequelize[_0x35b0('0x3')],'allowNull':![],'defaultValue':_0x35b0('0x31')},'vidaooNote':{'type':Sequelize[_0x35b0('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x35b0('0x19')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 09c0a19..bf6dfd1 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 _0x509c=['UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','mandatoryDispositionPause','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findAll','removeDispositions','ids','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','download','notify','user-agent-parser','setUA','headers','user-agent','ValidationError','difference','updatedAt','CompanyId','Sequelize','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','CmContact','Contacts','DESC','ChatApplication','Applications','List','list','orderBy','priority','asc','account','ListId','cf-connecting-ip','x-forwarded-for','split','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','applications','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','forcedOwnership','startRouting','EventManager','offline','files','no\x20available\x20attributes','createdAt','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','SendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','subjectOffline','notifyMail','remove','addInteraction','omit','Contact','fullname','internal','Tag','Tags','color','tag','Command','timezone','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','getSnippet','Interval','getProactiveActions','getLicense','virtual','License','chatLicenseExceeded','Intervals','push','all','some','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','labelText','textColor','color_button','hideWhenOffline','IntervalId','addApplications','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','chatProactiveAction','ChatProactiveAction','false','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','defaults','localhost','html-to-text','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','update','destroy','get','ChatWebsites','stack','name','send','index','Pause','map','ChatWebsite','fieldName','type','key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','show','params','keys','rawAttributes','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x44fc74,_0xe2ab0d){var _0x3cc2ba=function(_0x36a7ff){while(--_0x36a7ff){_0x44fc74['push'](_0x44fc74['shift']());}};_0x3cc2ba(++_0xe2ab0d);}(_0x509c,0xd4));var _0xc509=function(_0x329232,_0x5752b2){_0x329232=_0x329232-0x0;var _0x36c515=_0x509c[_0x329232];return _0x36c515;};'use strict';var BPromise=require(_0xc509('0x0'));var Mustache=require(_0xc509('0x1'));var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0xc509('0x2'));var Redis=require(_0xc509('0x3'));var qs=require(_0xc509('0x4'));var logger=require(_0xc509('0x5'))('api');var config=require('../../config/environment');var db=require(_0xc509('0x6'))['db'];config[_0xc509('0x7')]=_[_0xc509('0x8')](config[_0xc509('0x7')],{'host':_0xc509('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc509('0x7')]));require('./chatWebsite.socket')['register'](socket);var htmlToText=require(_0xc509('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xc509('0xb')]['http']({'port':0x232c});var client9002=jayson[_0xc509('0xb')]['http']({'port':0x232a});var client9003=jayson['client'][_0xc509('0xc')]({'port':0x232b});var client9001=jayson[_0xc509('0xb')][_0xc509('0xc')]({'port':0x2329});function respondWithRpcPromise(_0x5e7914,_0x4bf702,_0x5d335b,_0x2f4d03){return new BPromise(function(_0x5886b7,_0x487fee){var _0x44501e=_0x2f4d03||client;return _0x44501e[_0xc509('0xd')](_0x5e7914,_0x5d335b)[_0xc509('0xe')](function(_0x8bed90){logger['info'](_0xc509('0xf'),_0x4bf702,_0xc509('0x10'));logger[_0xc509('0x11')](_0xc509('0x12'),_0x4bf702,_0xc509('0x10'),JSON['stringify'](_0x8bed90));if(_0x8bed90[_0xc509('0x13')]){if(_0x8bed90[_0xc509('0x13')][_0xc509('0x14')]===0x1f4){logger[_0xc509('0x13')](_0xc509('0xf'),_0x4bf702,_0x8bed90['error'][_0xc509('0x15')]);return _0x487fee(_0x8bed90['error'][_0xc509('0x15')]);}logger[_0xc509('0x13')](_0xc509('0xf'),_0x4bf702,_0x8bed90[_0xc509('0x13')]['message']);return _0x5886b7(_0x8bed90['error'][_0xc509('0x15')]);}else{logger[_0xc509('0x16')](_0xc509('0xf'),_0x4bf702,_0xc509('0x10'));_0x5886b7(_0x8bed90[_0xc509('0x17')][_0xc509('0x15')]);}})[_0xc509('0x18')](function(_0x26029a){logger[_0xc509('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x4bf702,_0x26029a);_0x487fee(_0x26029a);});});}function respondWithStatusCode(_0xf56d54,_0xa5070c){_0xa5070c=_0xa5070c||0xcc;return function(_0x42add4){if(_0x42add4){return _0xf56d54[_0xc509('0x19')](_0xa5070c);}return _0xf56d54[_0xc509('0x1a')](_0xa5070c)[_0xc509('0x1b')]();};}function respondWithResult(_0x163573,_0xe1ed51){_0xe1ed51=_0xe1ed51||0xc8;return function(_0x3e7f6a){if(_0x3e7f6a){return _0x163573[_0xc509('0x1a')](_0xe1ed51)[_0xc509('0x1c')](_0x3e7f6a);}};}function respondWithFilteredResult(_0x1de209,_0x41d80f){return function(_0x4618fd){if(_0x4618fd){var _0x6d561a=typeof _0x41d80f[_0xc509('0x1d')]===_0xc509('0x1e')&&typeof _0x41d80f['limit']===_0xc509('0x1e');var _0x191bdb=_0x4618fd['count'];var _0x40d01f=_0x6d561a?0x0:_0x41d80f['offset'];var _0x1132d4=_0x6d561a?_0x4618fd[_0xc509('0x1f')]:_0x41d80f[_0xc509('0x1d')]+_0x41d80f[_0xc509('0x20')];var _0x12bece;if(_0x1132d4>=_0x191bdb){_0x1132d4=_0x191bdb;_0x12bece=0xc8;}else{_0x12bece=0xce;}_0x1de209['status'](_0x12bece);return _0x1de209['set'](_0xc509('0x21'),_0x40d01f+'-'+_0x1132d4+'/'+_0x191bdb)[_0xc509('0x1c')](_0x4618fd);}return null;};}function saveUpdates(_0x2e3ea6){return function(_0x3e5ee5){if(_0x3e5ee5){return _0x3e5ee5[_0xc509('0x22')](_0x2e3ea6)[_0xc509('0xe')](function(_0x564066){return _0x564066;});}return null;};}function removeEntity(_0x38512b){return function(_0x44f19c){if(_0x44f19c){return _0x44f19c[_0xc509('0x23')]()[_0xc509('0xe')](function(){var _0x106fb8=_0x44f19c[_0xc509('0x24')]({'plain':!![]});var _0x4e9fbf=_0xc509('0x25');return db['UserProfileResource'][_0xc509('0x23')]({'where':{'type':_0x4e9fbf,'resourceId':_0x106fb8['id']}})[_0xc509('0xe')](function(){return _0x44f19c;});})[_0xc509('0xe')](function(){_0x38512b[_0xc509('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e8884){return function(_0x192461){if(!_0x192461){_0x5e8884['sendStatus'](0x194);}return _0x192461;};}function handleError(_0x435b23,_0x3ae766){_0x3ae766=_0x3ae766||0x1f4;return function(_0x4e7fa7){logger[_0xc509('0x13')](_0x4e7fa7[_0xc509('0x26')]);if(_0x4e7fa7[_0xc509('0x27')]){delete _0x4e7fa7[_0xc509('0x27')];}_0x435b23['status'](_0x3ae766)[_0xc509('0x28')](_0x4e7fa7);};}exports[_0xc509('0x29')]=function(_0x216353,_0x2bee8c){var _0x29cc51={'include':[{'model':db[_0xc509('0x2a')],'as':'mandatoryDispositionPause'}]},_0x4110a6={},_0x3f7088={'count':0x0,'rows':[]};var _0x2c6791=_[_0xc509('0x2b')](db[_0xc509('0x2c')]['rawAttributes'],function(_0x363bd4){return{'name':_0x363bd4[_0xc509('0x2d')],'type':_0x363bd4[_0xc509('0x2e')][_0xc509('0x2f')]};});_0x4110a6[_0xc509('0x30')]=_[_0xc509('0x2b')](_0x2c6791,_0xc509('0x27'));_0x4110a6['query']=_['keys'](_0x216353[_0xc509('0x31')]);_0x4110a6[_0xc509('0x32')]=_[_0xc509('0x33')](_0x4110a6[_0xc509('0x30')],_0x4110a6[_0xc509('0x31')]);_0x29cc51['attributes']=_[_0xc509('0x33')](_0x4110a6[_0xc509('0x30')],qs[_0xc509('0x34')](_0x216353['query'][_0xc509('0x34')]));_0x29cc51['attributes']=_0x29cc51['attributes'][_0xc509('0x35')]?_0x29cc51[_0xc509('0x36')]:_0x4110a6[_0xc509('0x30')];if(!_0x216353['query'][_0xc509('0x37')](_0xc509('0x38'))){_0x29cc51['limit']=qs[_0xc509('0x20')](_0x216353[_0xc509('0x31')][_0xc509('0x20')]);_0x29cc51[_0xc509('0x1d')]=qs[_0xc509('0x1d')](_0x216353[_0xc509('0x31')]['offset']);}_0x29cc51[_0xc509('0x39')]=qs[_0xc509('0x3a')](_0x216353['query']['sort']);_0x29cc51[_0xc509('0x3b')]=qs['filters'](_[_0xc509('0x3c')](_0x216353[_0xc509('0x31')],_0x4110a6[_0xc509('0x32')]),_0x2c6791);if(_0x216353[_0xc509('0x31')][_0xc509('0x3d')]){_0x29cc51[_0xc509('0x3b')]=_['merge'](_0x29cc51[_0xc509('0x3b')],{'$or':_[_0xc509('0x2b')](_0x2c6791,function(_0x18f60c){if(_0x18f60c[_0xc509('0x2e')]!==_0xc509('0x3e')){var _0x4c32b9={};_0x4c32b9[_0x18f60c[_0xc509('0x27')]]={'$like':'%'+_0x216353[_0xc509('0x31')][_0xc509('0x3d')]+'%'};return _0x4c32b9;}})});}_0x29cc51=_[_0xc509('0x3f')]({},_0x29cc51,_0x216353[_0xc509('0x40')]);var _0x4e2f78={'where':_0x29cc51[_0xc509('0x3b')]};return db[_0xc509('0x2c')]['count'](_0x4e2f78)['then'](function(_0x31b407){_0x3f7088[_0xc509('0x1f')]=_0x31b407;if(_0x216353[_0xc509('0x31')][_0xc509('0x41')]){_0x29cc51[_0xc509('0x42')]=[{'all':!![]}];}return db[_0xc509('0x2c')]['findAll'](_0x29cc51);})[_0xc509('0xe')](function(_0x1d76dd){_0x3f7088[_0xc509('0x43')]=_0x1d76dd;return _0x3f7088;})[_0xc509('0xe')](respondWithFilteredResult(_0x2bee8c,_0x29cc51))['catch'](handleError(_0x2bee8c,null));};exports[_0xc509('0x44')]=function(_0x460857,_0x5f47e0){var _0x4c820e={'raw':![],'where':{'id':_0x460857[_0xc509('0x45')]['id']},'include':[{'model':db[_0xc509('0x2a')],'as':'mandatoryDispositionPause'}]},_0x181da4={};_0x181da4[_0xc509('0x30')]=_[_0xc509('0x46')](db[_0xc509('0x2c')][_0xc509('0x47')]);_0x181da4['query']=_[_0xc509('0x46')](_0x460857[_0xc509('0x31')]);_0x181da4['filters']=_[_0xc509('0x33')](_0x181da4[_0xc509('0x30')],_0x181da4[_0xc509('0x31')]);_0x4c820e[_0xc509('0x36')]=_[_0xc509('0x33')](_0x181da4[_0xc509('0x30')],qs[_0xc509('0x34')](_0x460857[_0xc509('0x31')][_0xc509('0x34')]));_0x4c820e[_0xc509('0x36')]=_0x4c820e[_0xc509('0x36')][_0xc509('0x35')]?_0x4c820e[_0xc509('0x36')]:_0x181da4[_0xc509('0x30')];if(_0x460857[_0xc509('0x31')][_0xc509('0x41')]){_0x4c820e[_0xc509('0x42')]=[{'all':!![]}];}_0x4c820e=_['merge']({},_0x4c820e,_0x460857[_0xc509('0x40')]);return db[_0xc509('0x2c')]['find'](_0x4c820e)['then'](handleEntityNotFound(_0x5f47e0,null))[_0xc509('0xe')](respondWithResult(_0x5f47e0,null))['catch'](handleError(_0x5f47e0,null));};exports['create']=function(_0x347533,_0x561cbc){return db['ChatWebsite'][_0xc509('0x48')](_0x347533['body'],{})[_0xc509('0xe')](function(_0x4334be){var _0x2f4c87=_0x347533['user'][_0xc509('0x24')]({'plain':!![]});if(!_0x2f4c87)throw new Error(_0xc509('0x49'));if(_0x2f4c87['role']===_0xc509('0x4a')){var _0x5b7104=_0x4334be['get']({'plain':!![]});var _0x21f3dc=_0xc509('0x25');return db[_0xc509('0x4b')][_0xc509('0x4c')]({'where':{'name':_0x21f3dc,'userProfileId':_0x2f4c87[_0xc509('0x4d')]},'raw':!![]})[_0xc509('0xe')](function(_0x5779a9){if(_0x5779a9&&_0x5779a9[_0xc509('0x4e')]===0x0){return db['UserProfileResource'][_0xc509('0x48')]({'name':_0x5b7104[_0xc509('0x27')],'resourceId':_0x5b7104['id'],'type':_0x5779a9[_0xc509('0x27')],'sectionId':_0x5779a9['id']},{})[_0xc509('0xe')](function(){return _0x4334be;});}else{return _0x4334be;}})[_0xc509('0x18')](function(_0x255496){logger[_0xc509('0x13')](_0xc509('0x4f'),_0x255496);throw _0x255496;});}return _0x4334be;})[_0xc509('0xe')](respondWithResult(_0x561cbc,0xc9))[_0xc509('0x18')](handleError(_0x561cbc,null));};exports[_0xc509('0x22')]=function(_0x22b11d,_0x2f216b){if(_0x22b11d[_0xc509('0x50')]['id']){delete _0x22b11d[_0xc509('0x50')]['id'];}return db['ChatWebsite'][_0xc509('0x4c')]({'where':{'id':_0x22b11d[_0xc509('0x45')]['id']},'include':[{'model':db[_0xc509('0x2a')],'as':_0xc509('0x51')}]})['then'](handleEntityNotFound(_0x2f216b,null))[_0xc509('0xe')](saveUpdates(_0x22b11d[_0xc509('0x50')],null))['then'](respondWithResult(_0x2f216b,null))[_0xc509('0x18')](handleError(_0x2f216b,null));};exports[_0xc509('0x23')]=function(_0x525303,_0x5bc3c6){return db[_0xc509('0x2c')][_0xc509('0x4c')]({'where':{'id':_0x525303['params']['id']}})['then'](handleEntityNotFound(_0x5bc3c6,null))['then'](removeEntity(_0x5bc3c6,null))[_0xc509('0x18')](handleError(_0x5bc3c6,null));};exports[_0xc509('0x52')]=function(_0x52e0cb,_0x3fb488){return db[_0xc509('0x2c')][_0xc509('0x52')]()[_0xc509('0xe')](respondWithResult(_0x3fb488,null))[_0xc509('0x18')](handleError(_0x3fb488,null));};exports[_0xc509('0x53')]=function(_0x2fed40,_0x5096c8){if(_0x2fed40[_0xc509('0x50')]['id']){delete _0x2fed40[_0xc509('0x50')]['id'];}return db[_0xc509('0x2c')][_0xc509('0x4c')]({'where':{'id':_0x2fed40[_0xc509('0x45')]['id']}})[_0xc509('0xe')](handleEntityNotFound(_0x5096c8,null))['then'](function(_0x5602c4){if(_0x5602c4){_0x2fed40[_0xc509('0x50')][_0xc509('0x54')]=_0x5602c4['id'];return db[_0xc509('0x55')][_0xc509('0x48')](_0x2fed40[_0xc509('0x50')]);}})['then'](respondWithResult(_0x5096c8,null))[_0xc509('0x18')](handleError(_0x5096c8,null));};exports[_0xc509('0x56')]=function(_0x1078dd,_0x532fbf){var _0x1a5d6c={'raw':![],'where':{}};var _0x3c7796={};var _0x31c3aa={'count':0x0,'rows':[]};return db[_0xc509('0x2c')]['findOne']({'where':{'id':_0x1078dd[_0xc509('0x45')]['id']}})[_0xc509('0xe')](handleEntityNotFound(_0x532fbf,null))[_0xc509('0xe')](function(_0xa9f620){if(_0xa9f620){_0x3c7796[_0xc509('0x30')]=_[_0xc509('0x46')](db[_0xc509('0x55')][_0xc509('0x47')]);_0x3c7796[_0xc509('0x31')]=_[_0xc509('0x46')](_0x1078dd[_0xc509('0x31')]);_0x3c7796[_0xc509('0x32')]=_['intersection'](_0x3c7796[_0xc509('0x30')],_0x3c7796[_0xc509('0x31')]);_0x1a5d6c[_0xc509('0x36')]=_[_0xc509('0x33')](_0x3c7796[_0xc509('0x30')],qs['fields'](_0x1078dd[_0xc509('0x31')]['fields']));_0x1a5d6c[_0xc509('0x36')]=_0x1a5d6c[_0xc509('0x36')][_0xc509('0x35')]?_0x1a5d6c[_0xc509('0x36')]:_0x3c7796[_0xc509('0x30')];if(!_0x1078dd[_0xc509('0x31')][_0xc509('0x37')](_0xc509('0x38'))){_0x1a5d6c[_0xc509('0x20')]=qs[_0xc509('0x20')](_0x1078dd[_0xc509('0x31')][_0xc509('0x20')]);_0x1a5d6c[_0xc509('0x1d')]=qs[_0xc509('0x1d')](_0x1078dd[_0xc509('0x31')]['offset']);}_0x1a5d6c[_0xc509('0x39')]=qs[_0xc509('0x3a')](_0x1078dd['query'][_0xc509('0x3a')]);_0x1a5d6c[_0xc509('0x3b')]=qs[_0xc509('0x32')](_[_0xc509('0x3c')](_0x1078dd[_0xc509('0x31')],_0x3c7796['filters']));_0x1a5d6c[_0xc509('0x3b')]['ChatWebsiteId']=_0xa9f620['id'];if(_0x1078dd['query'][_0xc509('0x3d')]){_0x1a5d6c[_0xc509('0x3b')]=_[_0xc509('0x3f')](_0x1a5d6c[_0xc509('0x3b')],{'$or':_['map'](_0x1a5d6c[_0xc509('0x36')],function(_0x100dda){var _0x3d29fa={};_0x3d29fa[_0x100dda]={'$like':'%'+_0x1078dd[_0xc509('0x31')][_0xc509('0x3d')]+'%'};return _0x3d29fa;})});}_0x1a5d6c=_[_0xc509('0x3f')]({},_0x1a5d6c,_0x1078dd[_0xc509('0x40')]);return db['Disposition'][_0xc509('0x1f')]({'where':_0x1a5d6c['where']})['then'](function(_0x4b132a){_0x31c3aa[_0xc509('0x1f')]=_0x4b132a;if(_0x1078dd[_0xc509('0x31')]['includeAll']){_0x1a5d6c[_0xc509('0x42')]=[{'all':!![]}];}return db[_0xc509('0x55')][_0xc509('0x57')](_0x1a5d6c);})['then'](function(_0x4dda35){_0x31c3aa['rows']=_0x4dda35;return _0x31c3aa;});}})[_0xc509('0xe')](respondWithFilteredResult(_0x532fbf,_0x1a5d6c))[_0xc509('0x18')](handleError(_0x532fbf,null));};exports['removeDispositions']=function(_0x12608a,_0x239e09){return db[_0xc509('0x2c')][_0xc509('0x4c')]({'where':{'id':_0x12608a[_0xc509('0x45')]['id']}})[_0xc509('0xe')](handleEntityNotFound(_0x239e09,null))[_0xc509('0xe')](function(_0xdd2b06){if(_0xdd2b06){return _0xdd2b06[_0xc509('0x58')](_0x12608a[_0xc509('0x31')][_0xc509('0x59')]);}})['then'](respondWithStatusCode(_0x239e09,null))[_0xc509('0x18')](handleError(_0x239e09,null));};exports['addAnswer']=function(_0x42b908,_0x1220c1){if(_0x42b908[_0xc509('0x50')]['id']){delete _0x42b908[_0xc509('0x50')]['id'];}return db['ChatWebsite'][_0xc509('0x4c')]({'where':{'id':_0x42b908[_0xc509('0x45')]['id']}})[_0xc509('0xe')](handleEntityNotFound(_0x1220c1,null))['then'](function(_0x884c3c){if(_0x884c3c){_0x42b908[_0xc509('0x50')][_0xc509('0x54')]=_0x884c3c['id'];return db[_0xc509('0x5a')][_0xc509('0x48')](_0x42b908[_0xc509('0x50')]);}})[_0xc509('0xe')](respondWithResult(_0x1220c1,null))[_0xc509('0x18')](handleError(_0x1220c1,null));};exports[_0xc509('0x5b')]=function(_0x1fd8c7,_0x4c7ab2){var _0x452056={'raw':![],'where':{}};var _0x9dc85b={};var _0x33476a={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc509('0x5c')]({'where':{'id':_0x1fd8c7[_0xc509('0x45')]['id']}})[_0xc509('0xe')](handleEntityNotFound(_0x4c7ab2,null))[_0xc509('0xe')](function(_0x36deee){if(_0x36deee){_0x9dc85b[_0xc509('0x30')]=_[_0xc509('0x46')](db[_0xc509('0x5a')][_0xc509('0x47')]);_0x9dc85b[_0xc509('0x31')]=_[_0xc509('0x46')](_0x1fd8c7[_0xc509('0x31')]);_0x9dc85b[_0xc509('0x32')]=_[_0xc509('0x33')](_0x9dc85b[_0xc509('0x30')],_0x9dc85b[_0xc509('0x31')]);_0x452056[_0xc509('0x36')]=_[_0xc509('0x33')](_0x9dc85b['model'],qs[_0xc509('0x34')](_0x1fd8c7[_0xc509('0x31')]['fields']));_0x452056[_0xc509('0x36')]=_0x452056['attributes'][_0xc509('0x35')]?_0x452056[_0xc509('0x36')]:_0x9dc85b[_0xc509('0x30')];if(!_0x1fd8c7['query'][_0xc509('0x37')](_0xc509('0x38'))){_0x452056[_0xc509('0x20')]=qs[_0xc509('0x20')](_0x1fd8c7[_0xc509('0x31')][_0xc509('0x20')]);_0x452056['offset']=qs[_0xc509('0x1d')](_0x1fd8c7[_0xc509('0x31')][_0xc509('0x1d')]);}_0x452056['order']=qs[_0xc509('0x3a')](_0x1fd8c7[_0xc509('0x31')][_0xc509('0x3a')]);_0x452056[_0xc509('0x3b')]=qs[_0xc509('0x32')](_[_0xc509('0x3c')](_0x1fd8c7[_0xc509('0x31')],_0x9dc85b[_0xc509('0x32')]));_0x452056[_0xc509('0x3b')][_0xc509('0x54')]=_0x36deee['id'];if(_0x1fd8c7[_0xc509('0x31')][_0xc509('0x3d')]){_0x452056[_0xc509('0x3b')]=_['merge'](_0x452056['where'],{'$or':_['map'](_0x452056[_0xc509('0x36')],function(_0x23087e){var _0x2f40ea={};_0x2f40ea[_0x23087e]={'$like':'%'+_0x1fd8c7[_0xc509('0x31')][_0xc509('0x3d')]+'%'};return _0x2f40ea;})});}_0x452056=_['merge']({},_0x452056,_0x1fd8c7[_0xc509('0x40')]);return db[_0xc509('0x5a')]['count']({'where':_0x452056[_0xc509('0x3b')]})[_0xc509('0xe')](function(_0x3e0e60){_0x33476a[_0xc509('0x1f')]=_0x3e0e60;if(_0x1fd8c7[_0xc509('0x31')][_0xc509('0x41')]){_0x452056[_0xc509('0x42')]=[{'all':!![]}];}return db[_0xc509('0x5a')][_0xc509('0x57')](_0x452056);})['then'](function(_0x5e9efd){_0x33476a[_0xc509('0x43')]=_0x5e9efd;return _0x33476a;});}})[_0xc509('0xe')](respondWithFilteredResult(_0x4c7ab2,_0x452056))['catch'](handleError(_0x4c7ab2,null));};exports['removeAnswers']=function(_0x2b0a12,_0x41f136){return db[_0xc509('0x2c')]['find']({'where':{'id':_0x2b0a12['params']['id']}})[_0xc509('0xe')](handleEntityNotFound(_0x41f136,null))['then'](function(_0x779a1e){if(_0x779a1e){return _0x779a1e[_0xc509('0x5d')](_0x2b0a12[_0xc509('0x31')]['ids']);}})[_0xc509('0xe')](respondWithStatusCode(_0x41f136,null))[_0xc509('0x18')](handleError(_0x41f136,null));};exports[_0xc509('0x5e')]=function(_0x3ca957,_0x4c38bc){_0x3ca957[_0xc509('0x50')][_0xc509('0x5f')]=_0x3ca957[_0xc509('0x60')][_0xc509('0x61')];return db['ChatWebsite'][_0xc509('0x4c')]({'where':{'id':_0x3ca957[_0xc509('0x45')]['id']}})[_0xc509('0xe')](handleEntityNotFound(_0x4c38bc,null))[_0xc509('0xe')](saveUpdates(_0x3ca957[_0xc509('0x50')],null))[_0xc509('0xe')](respondWithResult(_0x4c38bc,null))[_0xc509('0x18')](handleError(_0x4c38bc,null));};exports['addAvatar']=function(_0x3e6c0d,_0x5aaecf){_0x3e6c0d[_0xc509('0x50')][_0xc509('0x62')]=_0x3e6c0d['file'][_0xc509('0x61')];return db[_0xc509('0x2c')]['find']({'where':{'id':_0x3e6c0d['params']['id']}})['then'](handleEntityNotFound(_0x5aaecf,null))[_0xc509('0xe')](saveUpdates(_0x3e6c0d[_0xc509('0x50')],null))['then'](respondWithResult(_0x5aaecf,null))[_0xc509('0x18')](handleError(_0x5aaecf,null));};exports[_0xc509('0x63')]=function(_0x389fca,_0x10a558){_0x389fca[_0xc509('0x50')][_0xc509('0x64')]=_0x389fca[_0xc509('0x60')][_0xc509('0x61')];return db[_0xc509('0x2c')][_0xc509('0x4c')]({'where':{'id':_0x389fca[_0xc509('0x45')]['id']}})[_0xc509('0xe')](handleEntityNotFound(_0x10a558,null))[_0xc509('0xe')](saveUpdates(_0x389fca[_0xc509('0x50')],null))[_0xc509('0xe')](respondWithResult(_0x10a558,null))[_0xc509('0x18')](handleError(_0x10a558,null));};exports[_0xc509('0x65')]=function(_0x163859,_0x580a31){_0x163859[_0xc509('0x50')][_0xc509('0x66')]=_0x163859[_0xc509('0x60')][_0xc509('0x61')];return db[_0xc509('0x2c')][_0xc509('0x4c')]({'where':{'id':_0x163859[_0xc509('0x45')]['id']}})[_0xc509('0xe')](handleEntityNotFound(_0x580a31,null))[_0xc509('0xe')](saveUpdates(_0x163859[_0xc509('0x50')],null))['then'](respondWithResult(_0x580a31,null))['catch'](handleError(_0x580a31,null));};exports[_0xc509('0x67')]=function(_0x5ad9a9,_0x5e5f16){var _0x2f4f02=path[_0xc509('0x68')](config[_0xc509('0x69')],_0xc509('0x6a'));var _0x39dba1={'where':{'id':_0x5ad9a9[_0xc509('0x45')]['id']},'attributes':['id',_0xc509('0x5f')],'raw':!![]};var _0x545f4d=![];return require(_0xc509('0x6b'))['getLicense']()[_0xc509('0xe')](function(_0x1db97d){if(_0x1db97d){_0x545f4d=_0x1db97d[_0xc509('0x6c')];}})[_0xc509('0xe')](function(){return db[_0xc509('0x2c')][_0xc509('0x4c')](_0x39dba1);})[_0xc509('0xe')](handleEntityNotFound(_0x5e5f16,null))[_0xc509('0xe')](function(_0x314041){if(_0x314041){if(!_[_0xc509('0x6d')](_0x314041['sitepic'])){if(fs[_0xc509('0x6e')](path[_0xc509('0x68')](config[_0xc509('0x69')],_0xc509('0x6f'),_0x314041[_0xc509('0x5f')]))&&_0x545f4d){_0x2f4f02=path[_0xc509('0x68')](config['root'],_0xc509('0x6f'),_0x314041[_0xc509('0x5f')]);}}return _0x5e5f16['download'](_0x2f4f02);}})[_0xc509('0x18')](handleError(_0x5e5f16,null));};exports[_0xc509('0x70')]=function(_0x2e520d,_0x27e9d0){var _0x238846=path[_0xc509('0x68')](config[_0xc509('0x69')],'server/files/images/avatars/default_avatar.png');var _0x21c37b={'where':{'id':_0x2e520d[_0xc509('0x45')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xc509('0x2c')][_0xc509('0x4c')](_0x21c37b)['then'](handleEntityNotFound(_0x27e9d0,null))[_0xc509('0xe')](function(_0x48ea6e){if(_0x48ea6e){if(!_[_0xc509('0x6d')](_0x48ea6e[_0xc509('0x62')])){if(fs['existsSync'](path[_0xc509('0x68')](config[_0xc509('0x69')],_0xc509('0x71'),_0x48ea6e['agentAvatar']))){_0x238846=path[_0xc509('0x68')](config[_0xc509('0x69')],_0xc509('0x71'),_0x48ea6e[_0xc509('0x62')]);}}return _0x27e9d0['download'](_0x238846);}})[_0xc509('0x18')](handleError(_0x27e9d0,null));};exports[_0xc509('0x72')]=function(_0x4cd980,_0x31998b){var _0x423e5e=path[_0xc509('0x68')](config[_0xc509('0x69')],_0xc509('0x73'));var _0x2fc69f={'where':{'id':_0x4cd980[_0xc509('0x45')]['id']},'attributes':['id',_0xc509('0x64'),_0xc509('0x74')],'raw':!![]};return db['ChatWebsite'][_0xc509('0x4c')](_0x2fc69f)['then'](handleEntityNotFound(_0x31998b,null))['then'](function(_0x2b1229){if(_0x2b1229){if(!_['isNil'](_0x2b1229[_0xc509('0x64')])){if(fs[_0xc509('0x6e')](path[_0xc509('0x68')](config[_0xc509('0x69')],_0xc509('0x71'),_0x2b1229[_0xc509('0x64')]))&&_0x2b1229[_0xc509('0x74')]){_0x423e5e=path[_0xc509('0x68')](config[_0xc509('0x69')],'server/files/images/avatars/',_0x2b1229[_0xc509('0x64')]);}}return _0x31998b['download'](_0x423e5e);}})[_0xc509('0x18')](handleError(_0x31998b,null));};exports['getSystemAvatar']=function(_0x27fa31,_0x15aa93){var _0x462579=path['join'](config['root'],_0xc509('0x75'));var _0xcf7b11={'where':{'id':_0x27fa31[_0xc509('0x45')]['id']},'attributes':['id',_0xc509('0x66')],'raw':!![]};return db[_0xc509('0x2c')][_0xc509('0x4c')](_0xcf7b11)['then'](handleEntityNotFound(_0x15aa93,null))[_0xc509('0xe')](function(_0x28ef2b){if(_0x28ef2b){if(!_['isNil'](_0x28ef2b['systemAvatar'])){if(fs[_0xc509('0x6e')](path['join'](config[_0xc509('0x69')],_0xc509('0x71'),_0x28ef2b[_0xc509('0x66')]))){_0x462579=path[_0xc509('0x68')](config[_0xc509('0x69')],_0xc509('0x71'),_0x28ef2b['systemAvatar']);}}return _0x15aa93[_0xc509('0x76')](_0x462579);}})[_0xc509('0x18')](handleError(_0x15aa93,null));};exports[_0xc509('0x77')]=function(_0x17d67c,_0x26944c){var _0x135d0f=require(_0xc509('0x78'));var _0x19af4c=new _0x135d0f();var _0x3780a0=_0x19af4c[_0xc509('0x79')](_0x17d67c[_0xc509('0x7a')][_0xc509('0x7b')])['getResult']();var _0x4f566f={'body':_0x17d67c[_0xc509('0x50')],'channel':'chat'};var _0xb96c1d=[];var _0x44bae7=[];var _0x10a78e={};var _0x228915=![];return db['CmContact']['describe']()[_0xc509('0xe')](function(_0x37de4d){if(!_0x37de4d){throw new db['Sequelize'][(_0xc509('0x7c'))]('no\x20available\x20attributes');}_0xb96c1d=_[_0xc509('0x7d')](_[_0xc509('0x46')](_0x37de4d),['createdAt',_0xc509('0x7e')]);_0x44bae7=_[_0xc509('0x7d')](_[_0xc509('0x46')](_0x37de4d),['createdAt',_0xc509('0x7e'),_0xc509('0x7f'),'ListId']);if(_0x17d67c[_0xc509('0x50')]['id']){delete _0x17d67c[_0xc509('0x50')]['id'];}if(_[_0xc509('0x6d')](_0x17d67c[_0xc509('0x50')]['from'])){throw new db[(_0xc509('0x80'))][(_0xc509('0x7c'))](_0xc509('0x81'));}if(_[_0xc509('0x6d')](_0x17d67c[_0xc509('0x50')]['body'])||_0x17d67c[_0xc509('0x50')][_0xc509('0x50')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc509('0x6d')](_0x17d67c[_0xc509('0x50')][_0xc509('0x82')])){throw new db['Sequelize'][(_0xc509('0x7c'))](_0xc509('0x83')+_0x44bae7);}if(!_[_0xc509('0x84')](_0x44bae7,_0x17d67c['body'][_0xc509('0x82')])){throw new db[(_0xc509('0x80'))][(_0xc509('0x7c'))](_0xc509('0x85')+_0x44bae7);}_0x10a78e[_0x17d67c[_0xc509('0x50')]['mapKey']]=_0x17d67c['body'][_0xc509('0x86')];})[_0xc509('0xe')](function(){return db[_0xc509('0x2c')][_0xc509('0x4c')]({'where':{'id':_0x17d67c[_0xc509('0x45')]['id']},'include':[{'model':db[_0xc509('0x87')],'as':'List','include':[{'model':db[_0xc509('0x88')],'as':_0xc509('0x89'),'where':_0x10a78e,'limit':0x1,'order':[[_0xc509('0x7e'),_0xc509('0x8a')]]}]},{'model':db[_0xc509('0x8b')],'as':_0xc509('0x8c')}]});})[_0xc509('0xe')](handleEntityNotFound(_0x26944c,null))[_0xc509('0xe')](function(_0x44b462){if(_0x44b462&&_0x44b462[_0xc509('0x8d')]){_0x4f566f['account']=_0x44b462;_0x4f566f['applications']=_0x44b462['Applications'];_0x4f566f[_0xc509('0x8e')]=_0x44b462[_0xc509('0x8d')];_0x4f566f['applications']=_[_0xc509('0x8f')](_0x4f566f['applications'],[_0xc509('0x90')],[_0xc509('0x91')]);if(_0x4f566f['account']['Applications']){delete _0x4f566f['account'][_0xc509('0x8c')];}if(_0x4f566f[_0xc509('0x92')][_0xc509('0x8d')]&&_0x4f566f[_0xc509('0x92')][_0xc509('0x8d')][_0xc509('0x89')]['length']){return _0x4f566f[_0xc509('0x92')][_0xc509('0x8d')][_0xc509('0x89')][0x0];}var _0x3f35fd=_[_0xc509('0x8')](_0x17d67c[_0xc509('0x50')],{'firstName':_0x17d67c[_0xc509('0x50')]['from'],'ListId':_0x44b462[_0xc509('0x93')]});_0x3f35fd[_0x17d67c[_0xc509('0x50')][_0xc509('0x82')]]=_0x17d67c[_0xc509('0x50')][_0xc509('0x86')];return db[_0xc509('0x88')][_0xc509('0x48')](_0x3f35fd,{'fields':_0xb96c1d,'raw':!![]});}})['then'](handleEntityNotFound(_0x26944c,null))[_0xc509('0xe')](function(_0xfef7a2){_0x4f566f['contact']=_0xfef7a2;var _0x2e794c=_0x17d67c[_0xc509('0x50')]['customerIp'];if(_0x17d67c[_0xc509('0x7a')][_0xc509('0x94')]){_0x2e794c=_0x17d67c[_0xc509('0x7a')][_0xc509('0x94')];}else if(_0x17d67c[_0xc509('0x7a')]['x-forwarded-for']){_0x2e794c=_['first'](_0x17d67c['headers'][_0xc509('0x95')][_0xc509('0x96')](','));}if(_0xfef7a2){var _0x7ab978={'ContactId':_0xfef7a2['id'],'ChatWebsiteId':_0x17d67c[_0xc509('0x45')]['id'],'from':(_0xfef7a2['firstName']||'')+'\x20'+(_0xfef7a2[_0xc509('0x97')]||''),'customerIp':_0x2e794c,'customerPort':_0x17d67c[_0xc509('0x7a')][_0xc509('0x98')]?_0x17d67c['headers'][_0xc509('0x98')]:null,'referer':_0x17d67c[_0xc509('0x50')][_0xc509('0x99')],'browserName':_0x3780a0[_0xc509('0x9a')][_0xc509('0x27')]&&_0x3780a0[_0xc509('0x9a')][_0xc509('0x9b')]?util[_0xc509('0x9c')](_0xc509('0x9d'),_0x3780a0[_0xc509('0x9a')][_0xc509('0x27')],_0x3780a0[_0xc509('0x9a')]['version']):'unknown','browserVersion':_0x3780a0[_0xc509('0x9a')][_0xc509('0x9b')]||_0xc509('0x9e'),'osName':util[_0xc509('0x9c')](_0xc509('0x9d'),_0x3780a0['os']['name'],_0x3780a0['os'][_0xc509('0x9b')]),'osVersion':_0x3780a0['os'][_0xc509('0x9b')],'deviceModel':_0x3780a0[_0xc509('0x9f')][_0xc509('0x30')]&&_0x3780a0[_0xc509('0x9f')]['vendor']?util[_0xc509('0x9c')](_0xc509('0xa0'),_0x3780a0[_0xc509('0x9f')][_0xc509('0x30')],_0x3780a0[_0xc509('0x9f')][_0xc509('0xa1')],_0x3780a0[_0xc509('0x9f')][_0xc509('0x2e')]):null,'deviceVendor':_0x3780a0['device'][_0xc509('0xa1')],'deviceType':_0x3780a0['device'][_0xc509('0x2e')],'formData':JSON[_0xc509('0xa2')](_0x17d67c[_0xc509('0x50')])};var _0x26677c={'ChatWebsiteId':_0x17d67c[_0xc509('0x45')]['id'],'closed':![]};if(_0x17d67c['body'][_0xc509('0xa3')]){_0x26677c[_0xc509('0xa3')]=_0x17d67c[_0xc509('0x50')][_0xc509('0xa3')];return db[_0xc509('0xa4')]['find']({'where':_0x26677c})[_0xc509('0xe')](function(_0x46d23f){if(_0x46d23f){return[_0x46d23f,![]];}_0x7ab978[_0xc509('0xa3')]=_0x17d67c[_0xc509('0x50')][_0xc509('0xa3')];_0x7ab978[_0xc509('0xa5')]=_0x17d67c['body'][_0xc509('0xa5')];return db['ChatInteraction'][_0xc509('0x48')](_0x7ab978)[_0xc509('0xe')](function(_0x1dfaa8){return[_0x1dfaa8,!![]];});});}_0x26677c[_0xc509('0xa6')]=_0xfef7a2['id'];if(_0x17d67c[_0xc509('0x50')][_0xc509('0xa7')]&&_0x17d67c['body'][_0xc509('0xa7')]['id']){_0x26677c['id']=_0x17d67c['body'][_0xc509('0xa7')]['id'];return db['ChatInteraction'][_0xc509('0x4c')]({'where':_0x26677c})[_0xc509('0xe')](function(_0x1f87a9){if(_0x1f87a9){return[_0x1f87a9,![]];}return db[_0xc509('0xa4')][_0xc509('0x48')](_0x7ab978)['then'](function(_0x21ad69){return[_0x21ad69,!![]];});});}return db['ChatInteraction']['create'](_0x7ab978)[_0xc509('0xe')](function(_0x530488){return[_0x530488,!![]];});}})[_0xc509('0xa8')](function(_0x10ad44,_0x56dc04){if(_0x10ad44){_0x228915=_0x56dc04;if(!_0x56dc04){var _0x37467e={'from':(_0x4f566f[_0xc509('0xa9')]['firstName']||'')+'\x20'+(_0x4f566f[_0xc509('0xa9')][_0xc509('0x97')]||'')};if(_0x17d67c[_0xc509('0x50')]['threadId']&&_0x17d67c[_0xc509('0x50')][_0xc509('0xaa')]&&_0x17d67c[_0xc509('0x50')][_0xc509('0xa3')]!=_0x17d67c['body'][_0xc509('0xaa')]){_0x37467e[_0xc509('0xa3')]=_0x17d67c[_0xc509('0x50')][_0xc509('0xaa')];}return _0x10ad44[_0xc509('0x22')](_0x37467e);}else{return _0x10ad44;}}})[_0xc509('0xe')](function(_0x59493a){_0x4f566f[_0xc509('0xa7')]=_0x59493a[_0xc509('0x24')]({'plain':!![]});_0x4f566f[_0xc509('0xa7')][_0xc509('0xab')]=_0x228915;if(_0x4f566f[_0xc509('0xa7')][_0xc509('0xab')]){if(_0x4f566f['account']['autoclose']){_0x4f566f['applications']['push']({'id':0x0,'priority':_0x4f566f[_0xc509('0xac')][_0xc509('0x35')]+0x1,'app':_0xc509('0xad'),'appdata':_0xc509('0xae'),'interval':_0xc509('0xaf')});}}return db['ChatMessage'][_0xc509('0x48')]({'body':_0x17d67c[_0xc509('0x50')]['body'],'ChatWebsiteId':_0x17d67c[_0xc509('0x45')]['id'],'ChatInteractionId':_0x59493a['id'],'direction':'in','ContactId':_0x4f566f[_0xc509('0xa9')]['id'],'AttachmentId':_0x17d67c['body'][_0xc509('0xb0')]});})['then'](function(_0x2c6088){_0x4f566f['message']=_0x2c6088;if(_0x4f566f[_0xc509('0xa7')][_0xc509('0xb1')]){return db[_0xc509('0xb2')][_0xc509('0x4c')]({'attributes':['id',_0xc509('0x27')],'where':{'id':_0x4f566f[_0xc509('0xa7')][_0xc509('0xb1')]}})['then'](function(_0x2c59b1){if(_0x2c59b1){_0x4f566f['applications'][_0xc509('0xb3')]({'id':0x0,'priority':0x0,'app':_0xc509('0xb4'),'appdata':_0x2c59b1[_0xc509('0x27')]+','+(_0x4f566f[_0xc509('0x92')]['waitForTheAssignedAgent']||0xa),'interval':_0xc509('0xaf')});_0x4f566f[_0xc509('0xb5')]=!![];}return respondWithRpcPromise('Start',_0xc509('0xb6'),_0x4f566f);});}return respondWithRpcPromise('Start',_0xc509('0xb6'),_0x4f566f);})[_0xc509('0xe')](function(_0x244611){respondWithRpcPromise('EventManager',_0xc509('0xb7'),{'event':_0xc509('0x77'),'message':_0x244611},client9002);return _0x244611;})['then'](respondWithResult(_0x26944c,null))[_0xc509('0x18')](handleError(_0x26944c,null));};exports[_0xc509('0xb8')]=function(_0x40e6b1,_0x519489){var _0x47de00,_0x39e6f0,_0x1a1f93;var _0x158851=[];var _0x3d2d9e={};var _0x58df6a=_0x40e6b1[_0xc509('0xb9')]||[];var _0x20968f=[];var _0x17c55d;return db[_0xc509('0x88')][_0xc509('0x52')]()[_0xc509('0xe')](function(_0x409fb9){if(!_0x409fb9){throw new db['Sequelize'][(_0xc509('0x7c'))](_0xc509('0xba'));}_0x158851=_['difference'](_[_0xc509('0x46')](_0x409fb9),[_0xc509('0xbb'),_0xc509('0x7e'),_0xc509('0x7f'),_0xc509('0x93')]);if(_0x40e6b1['body']['id']){delete _0x40e6b1[_0xc509('0x50')]['id'];}if(_['isNil'](_0x40e6b1[_0xc509('0x50')][_0xc509('0x86')])){throw _0x519489[_0xc509('0x1a')](0x1f4)[_0xc509('0x28')](new db[(_0xc509('0x80'))][(_0xc509('0x7c'))](_0xc509('0x81')));}if(_['isNil'](_0x40e6b1[_0xc509('0x50')][_0xc509('0x50')])||_0x40e6b1['body'][_0xc509('0x50')]===''){throw _0x519489['status'](0x1f4)[_0xc509('0x28')](new db['Sequelize'][(_0xc509('0x7c'))](_0xc509('0xbc')));}if(_[_0xc509('0x6d')](_0x40e6b1[_0xc509('0x50')]['mapKeyOffline'])){throw _0x519489[_0xc509('0x1a')](0x1f4)[_0xc509('0x28')](new db[(_0xc509('0x80'))][(_0xc509('0x7c'))](_0xc509('0xbd')+_0x158851));}if(!_[_0xc509('0x84')](_0x158851,_0x40e6b1[_0xc509('0x50')][_0xc509('0xbe')])){throw _0x519489[_0xc509('0x1a')](0x1f4)[_0xc509('0x28')](new db['Sequelize'][(_0xc509('0x7c'))](_0xc509('0xbf')+_0x158851));}_0x3d2d9e[_0x40e6b1[_0xc509('0x50')]['mapKeyOffline']]=_0x40e6b1[_0xc509('0x50')]['from'];})[_0xc509('0xe')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x40e6b1[_0xc509('0x45')]['id']},'include':[{'model':db['CmList'],'as':_0xc509('0x8d')},{'model':db['MailAccount'],'as':_0xc509('0xc0')}]});})['then'](handleEntityNotFound(_0x519489,null))[_0xc509('0xe')](function(_0x2a6e90){if(_0x2a6e90&&_0x2a6e90[_0xc509('0x8d')]){_0x39e6f0=_0x2a6e90;var _0x489105=_[_0xc509('0x8')](_0x40e6b1[_0xc509('0x50')],{'firstName':_0x40e6b1[_0xc509('0x50')]['from'],'phone':_0x40e6b1[_0xc509('0x50')][_0xc509('0x86')],'ListId':_0x2a6e90['ListId']});_0x489105[_0x40e6b1['body']['mapKeyOffline']]=_0x40e6b1[_0xc509('0x50')][_0xc509('0x86')];return db['CmContact'][_0xc509('0xc1')]({'where':_0x3d2d9e,'defaults':_0x489105});}})['spread'](function(_0x56633c){if(_0x56633c){_0x1a1f93=_0x56633c;var _0x5ad474=fs['readFileSync'](path[_0xc509('0x68')](config[_0xc509('0x69')],_0xc509('0xc2')),_0xc509('0xc3'));var _0x357e09=ejs[_0xc509('0xc4')](_0x5ad474,{'body':_[_0xc509('0xc5')](_0x40e6b1['body'][_0xc509('0x50')]),'bodyTitle':_0x39e6f0['offlineMessageBody']});return db[_0xc509('0xc6')][_0xc509('0x48')]({'body':_0x357e09,'plainBody':htmlToText[_0xc509('0xc7')](_0x357e09),'ContactId':_0x56633c['id'],'ChatWebsiteId':_0x39e6f0['id']});}})[_0xc509('0xe')](function(_0x4b37a2){_0x17c55d=_0x4b37a2;if(_0x58df6a[_0xc509('0x35')]){var _0x2d85f2=_0x58df6a['map'](function(_0x23258f){return{'name':_0x23258f[_0xc509('0xc8')],'basename':_0x23258f[_0xc509('0x61')],'type':_0x23258f[_0xc509('0xc9')],'ChatOfflineMessageId':_0x4b37a2['id']};});_0x20968f=_0x2d85f2['map'](_0x4479b2=>{var _0xfe9503={'filename':_0x4479b2[_0xc509('0x27')],'path':path[_0xc509('0x68')](config[_0xc509('0x69')],_0xc509('0xca'),'files',_0xc509('0xcb'),_0xc509('0xcc'),_0x4479b2['basename'])};return _0xfe9503;});if(!_0x39e6f0[_0xc509('0xcd')]){return db[_0xc509('0xce')][_0xc509('0xcf')](function(_0x3ffad6){return db[_0xc509('0xd0')][_0xc509('0xd1')](_0x2d85f2,{'transaction':_0x3ffad6});});}}})[_0xc509('0xe')](function(){if(_0x17c55d){_0x47de00=_0x17c55d;return db[_0xc509('0xc0')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xc509('0xd2')],'as':_0xc509('0xd3'),'raw':!![],'include':[{'model':db[_0xc509('0xd4')],'as':_0xc509('0xd4'),'raw':!![]}]}]});}})[_0xc509('0xe')](function(_0x282692){if(_0x282692&&_0x282692[_0xc509('0xd3')]&&_0x39e6f0[_0xc509('0xd5')]&&_0x39e6f0['forwardOfflineAddress']){var _0x48a722=_0x282692['getSmtpOptions']();return respondWithRpcPromise(_0xc509('0xd6'),'sendMail',{'account':_0x48a722,'message':{'from':util[_0xc509('0x9c')](_0xc509('0xd7'),_0x282692[_0xc509('0x27')],_0x282692[_0xc509('0xd8')]||_0x282692[_0xc509('0xd3')]['user']),'to':_0x39e6f0[_0xc509('0xd9')],'subject':_0x39e6f0[_0xc509('0xda')],'html':_0x47de00['body'],'attachments':_0x20968f}},client9003)[_0xc509('0xe')](function(){return _0x47de00;})[_0xc509('0x18')](function(_0x312783){logger[_0xc509('0x13')](_0x312783);});}})[_0xc509('0xe')](function(){if(_0x39e6f0&&_0x39e6f0['openNewInteraction']&&_0x39e6f0[_0xc509('0xdb')]){var _0x40495d=[];if(_0x58df6a['length']){_0x40495d=_0x58df6a['map'](function(_0x28e9a9){return{'name':_0x28e9a9[_0xc509('0xc8')],'basename':_0x28e9a9[_0xc509('0x61')],'type':_0x28e9a9['mimetype'],'ChatOfflineMessageId':_0x17c55d['id']};});}var _0x407fb4;if(!_['isNil'](_0x39e6f0['subjectOffline'])){var _0x5d92b6=_[_0xc509('0x2b')](_0x40e6b1['body'],function(_0x11052e){return _0x11052e;});var _0x4be558=_[_0xc509('0xdc')](_0x5d92b6)[0x0];var _0x5281c6=_[_0xc509('0xdd')](_0x4be558,function(_0x37c769){return _0x37c769;});_0x407fb4=_0x5281c6[0x1][_0x39e6f0[_0xc509('0xde')]];}var _0x2fd173={'from':_0x1a1f93[_0xc509('0xd8')],'firstName':_0x1a1f93['firstName'],'lastName':_0x1a1f93['lastName'],'mapKey':_0xc509('0xd8'),'message':{'from':_0x1a1f93[_0xc509('0xd8')],'to':_0x39e6f0[_0xc509('0xc0')]['email'],'cc':'','subject':_[_0xc509('0x6d')](_0x407fb4)?_0x39e6f0['offlineMessageSubject']:_0x407fb4,'messageId':'','sentAt':new Date(),'attach':_0x40495d[_0xc509('0x35')],'attachments':_0x40495d,'originChannel':'Chat','ChatWebsiteId':_0x39e6f0['id'],'ChatOfflineMessageId':_0x47de00['id'],'originTo':_0x39e6f0[_0xc509('0xc0')][_0xc509('0xd8')]},'body':_0x47de00[_0xc509('0x50')]};var _0x16a854={'account':{'id':_0x39e6f0['MailAccountId']},'body':_0x2fd173,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xc509('0xdf'),_0x16a854,client9001)['then'](function(){return _0x47de00;})[_0xc509('0x18')](function(_0x49c914){logger[_0xc509('0x13')](_0x49c914);});}return;})['then'](function(){if(_0x47de00){return _0x47de00;}})[_0xc509('0xe')](respondWithResult(_0x519489,null))[_0xc509('0x18')](function(_0x20ae68){logger[_0xc509('0x13')](_0xc509('0x18'),_0x20ae68);for(var _0x3f0839 of _0x58df6a){var _0x5a00ac=path[_0xc509('0x68')](config[_0xc509('0x69')],_0xc509('0xca'),_0xc509('0xb9'),'attachments',_0xc509('0xcc'),_0x3f0839[_0xc509('0x61')]);fs_extra[_0xc509('0xe0')](_0x5a00ac)[_0xc509('0x18')](function(_0x5b610b){logger[_0xc509('0x13')]('Could\x20not\x20remove\x20attachment\x20file',_0x5a00ac,_0x5b610b);});}});};exports[_0xc509('0xe1')]=function(_0x20ac3f,_0xb5d8ba){return db[_0xc509('0xa4')]['find']({'where':{'id':_0x20ac3f[_0xc509('0x45')]['id']}})[_0xc509('0xe')](handleEntityNotFound(_0xb5d8ba,null))['then'](function(_0x2150a0){if(_0x2150a0){return _0x2150a0['addInteraction'](_0x20ac3f[_0xc509('0x50')][_0xc509('0x59')],_[_0xc509('0xe2')](_0x20ac3f[_0xc509('0x50')],[_0xc509('0x59'),'id'])||{});}})[_0xc509('0xe')](respondWithResult(_0xb5d8ba,null))['catch'](handleError(_0xb5d8ba,null));};exports['getInteractions']=function(_0x143eb0,_0x51cb61){var _0xd92c41={'raw':![],'where':{}};var _0x3807b0={};var _0x1c2132={'count':0x0,'rows':[]};return db[_0xc509('0x2c')][_0xc509('0x5c')]({'where':{'id':_0x143eb0['params']['id']}})[_0xc509('0xe')](handleEntityNotFound(_0x51cb61,null))[_0xc509('0xe')](function(_0x29233b){if(_0x29233b){_0x3807b0['model']=_[_0xc509('0x46')](db[_0xc509('0xa4')]['rawAttributes']);_0x3807b0[_0xc509('0x31')]=_['keys'](_0x143eb0[_0xc509('0x31')]);_0x3807b0[_0xc509('0x32')]=_['intersection'](_0x3807b0[_0xc509('0x30')],_0x3807b0[_0xc509('0x31')]);_0xd92c41[_0xc509('0x36')]=_[_0xc509('0x33')](_0x3807b0['model'],qs['fields'](_0x143eb0[_0xc509('0x31')][_0xc509('0x34')]));_0xd92c41[_0xc509('0x36')]=_0xd92c41['attributes'][_0xc509('0x35')]?_0xd92c41[_0xc509('0x36')]:_0x3807b0[_0xc509('0x30')];if(!_0x143eb0[_0xc509('0x31')][_0xc509('0x37')]('nolimit')){_0xd92c41[_0xc509('0x20')]=qs[_0xc509('0x20')](_0x143eb0[_0xc509('0x31')][_0xc509('0x20')]);_0xd92c41[_0xc509('0x1d')]=qs[_0xc509('0x1d')](_0x143eb0[_0xc509('0x31')][_0xc509('0x1d')]);}_0xd92c41['order']=qs[_0xc509('0x3a')](_0x143eb0[_0xc509('0x31')][_0xc509('0x3a')]);_0xd92c41[_0xc509('0x3b')]=qs[_0xc509('0x32')](_[_0xc509('0x3c')](_0x143eb0[_0xc509('0x31')],_0x3807b0[_0xc509('0x32')]));_0xd92c41[_0xc509('0x3b')][_0xc509('0x54')]=_0x29233b['id'];if(_0x143eb0[_0xc509('0x31')]['filter']){_0xd92c41[_0xc509('0x3b')]=_['merge'](_0xd92c41['where'],{'$or':_['map'](_0xd92c41[_0xc509('0x36')],function(_0x3a3ece){var _0x19dbd7={};_0x19dbd7[_0x3a3ece]={'$like':'%'+_0x143eb0[_0xc509('0x31')]['filter']+'%'};return _0x19dbd7;})});}_0xd92c41=_[_0xc509('0x3f')]({},_0xd92c41,_0x143eb0[_0xc509('0x40')]);return db[_0xc509('0xa4')][_0xc509('0x1f')]({'where':_0xd92c41[_0xc509('0x3b')]})[_0xc509('0xe')](function(_0x130382){_0x1c2132['count']=_0x130382;if(_0x143eb0[_0xc509('0x31')]['includeAll']){_0xd92c41['include']=[{'model':db[_0xc509('0x88')],'as':_0xc509('0xe3'),'required':![]},{'model':db[_0xc509('0xb2')],'as':'Owner','attributes':[_0xc509('0x27'),_0xc509('0xe4'),_0xc509('0xe5')],'required':![]},{'model':db[_0xc509('0xe6')],'as':_0xc509('0xe7'),'attributes':['id',_0xc509('0x27'),_0xc509('0xe8')],'where':_0x143eb0[_0xc509('0x31')][_0xc509('0xe9')]?{'id':_0x143eb0[_0xc509('0x31')][_0xc509('0xe9')]}:undefined,'required':_0x143eb0[_0xc509('0x31')]['tag']?!![]:![]}];}return db[_0xc509('0xa4')][_0xc509('0x57')](_0xd92c41);})[_0xc509('0xe')](function(_0x2d0248){_0x1c2132[_0xc509('0x43')]=_0x2d0248;return _0x1c2132;});}})[_0xc509('0xe')](respondWithFilteredResult(_0x51cb61,_0xd92c41))[_0xc509('0x18')](handleError(_0x51cb61,null));};function iftimePromise(_0x307534,_0x245d39){return respondWithRpcPromise(_0xc509('0xea'),'getSnippet',{'command':_0x245d39[_0xc509('0xeb')]?util[_0xc509('0x9c')]('iftime\x20%s,%s',_0x307534[_0xc509('0xec')],_0x245d39['timezone']):util[_0xc509('0x9c')](_0xc509('0xed'),_0x307534['interval'])},client9002)[_0xc509('0xe')](function(_0x2e48e1){var _0x263722=_0x2e48e1&&_0x2e48e1['indexOf'](_0xc509('0xee'))>=0x0?!![]:![];logger['info'](_0xc509('0xef'),_0x245d39['id'],_0x307534['id'],_0x307534[_0xc509('0xec')],_0x263722?_0xc509('0xf0'):'OFFLINE',_0x245d39['timezone']?_0x245d39[_0xc509('0xeb')]:_0xc509('0xf1'));return _0x263722;})['catch'](function(_0x2ba0da){logger[_0xc509('0x13')](_0xc509('0xef'),_0x245d39['id'],_0x307534['id'],_0x307534[_0xc509('0xec')],util[_0xc509('0xf2')](_0x2ba0da,{'showHidden':![],'depth':null}),_0x245d39[_0xc509('0xeb')]?_0x245d39['timezone']:_0xc509('0xf1'));return![];});}exports[_0xc509('0xf3')]=function(_0x225466,_0x121aea){var _0x3f853c=0x0;var _0x2c068c=0x0;var _0x49b046=![];var _0x4c8b2c;var _0x24e4b2;return db[_0xc509('0x2c')][_0xc509('0x4c')]({'where':{'id':_0x225466[_0xc509('0x45')]['id']},'include':[{'model':db[_0xc509('0xf4')],'as':_0xc509('0xf4'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xc509('0xec')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x121aea,null))[_0xc509('0xe')](function(_0xeddc23){if(_0xeddc23){_0x4c8b2c=_0xeddc23;return _0xeddc23[_0xc509('0xf5')]({'raw':!![]});}})[_0xc509('0xe')](function(_0x12951a){if(_0x4c8b2c){if(_0x12951a){_0x24e4b2=_0x12951a;}}return require(_0xc509('0x6b'))[_0xc509('0xf6')]();})[_0xc509('0xe')](function(_0x505c99){if(_0x505c99){_0x2c068c=_0x505c99[_0xc509('0xf7')];_0x49b046=_0x505c99['custom'];}})['then'](function(){return db['ChatInteraction'][_0xc509('0x1f')]({'where':{'closed':![]}});})['then'](function(_0x476ce9){_0x3f853c=_0x476ce9;if(_0x2c068c&&_0x476ce9>_0x2c068c){return db[_0xc509('0xf8')][_0xc509('0x5c')]({'where':{'id':0x1}})[_0xc509('0xe')](function(_0x134c2d){if(_0x134c2d){_0x134c2d['increment'](_0xc509('0xf9'));}});}})[_0xc509('0xe')](function(){if(_0x4c8b2c[_0xc509('0xf4')]&&_0x4c8b2c[_0xc509('0xf4')][_0xc509('0xfa')]){var _0x164b5f=[];for(var _0x318adb=0x0;_0x318adb<_0x4c8b2c[_0xc509('0xf4')][_0xc509('0xfa')][_0xc509('0x35')];_0x318adb++){var _0x39e5a7=_0x4c8b2c[_0xc509('0xf4')]['Intervals'][_0x318adb][_0xc509('0x24')]({'plain':!![]});_0x164b5f[_0xc509('0xfb')](iftimePromise(_0x39e5a7,_0x4c8b2c));}return BPromise[_0xc509('0xfc')](_0x164b5f)[_0xc509('0xe')](function(_0x37d795){return _[_0xc509('0xfd')](_0x37d795);});}else{return!![];}})['then'](function(_0x356857){var _0x29ddeb=fs[_0xc509('0xfe')](path[_0xc509('0x68')](config['root'],_0xc509('0xff')),_0xc509('0xc3'));var _0xab368={'remote':_0x4c8b2c[_0xc509('0x100')],'query':querystring[_0xc509('0xa2')](_[_0xc509('0x3f')](_0x4c8b2c[_0xc509('0x24')]({'plain':!![]}),{'customerIp':_0x225466[_0xc509('0x7a')][_0xc509('0x95')]||_0x225466[_0xc509('0x7a')][_0xc509('0x101')]||_0x225466[_0xc509('0x102')][_0xc509('0x103')]||_0x225466['ip'],'referer':_0x225466['headers'][_0xc509('0x99')],'openedInteractions':_0x3f853c,'maxInteractions':_0x2c068c,'virtual':_0x49b046[_0xc509('0xf7')],'online':_0x356857,'custom':_0x49b046}))['replace'](/'/g,'\x5c\x27')};_0x121aea['send'](ejs['render'](Mustache[_0xc509('0xc4')](_0x29ddeb,_0xab368),{'proactiveActions':_0x24e4b2,'alignment':_0x4c8b2c[_0xc509('0x104')],'verticalAlignment':_0x4c8b2c[_0xc509('0x105')],'div_color':_0x4c8b2c[_0xc509('0xe8')],'labelText':_0x4c8b2c[_0xc509('0x106')],'text_color':_0x4c8b2c[_0xc509('0x107')],'button_color':_0x4c8b2c[_0xc509('0x108')],'background_color':_0x4c8b2c['backgroundColor'],'hideWhenOffline':_0x4c8b2c[_0xc509('0x109')],'interval':_0x4c8b2c[_0xc509('0x10a')]}));})[_0xc509('0x18')](handleError(_0x121aea,null));};exports[_0xc509('0x10b')]=function(_0x2658de,_0x40af8d){var _0x1ae38e=_0x2658de['params']['id'];var _0x32ac8c=_0x2658de[_0xc509('0x50')];var _0x3bc80e=0xc8;var _0x3a8250=null;return db[_0xc509('0xce')][_0xc509('0xcf')]({'isolationLevel':db[_0xc509('0xce')]['Transaction'][_0xc509('0x10c')][_0xc509('0x10d')]},function(_0xdef13d){return db[_0xc509('0x2c')][_0xc509('0x5c')]({'where':{'id':_0x1ae38e},'transaction':_0xdef13d})[_0xc509('0xe')](function(_0x1f1fa1){if(_0x1f1fa1){return db[_0xc509('0x8b')][_0xc509('0x23')]({'where':{'ChatWebsiteId':_0x1ae38e},'transaction':_0xdef13d})[_0xc509('0xe')](function(){var _0x161001=_[_0xc509('0x2b')](_0x32ac8c,function(_0x43efc7){_0x43efc7[_0xc509('0x54')]=_0x1ae38e;return _0x43efc7;});return db['ChatApplication'][_0xc509('0xd1')](_0x161001,{'transaction':_0xdef13d});});}else{_0x3bc80e=0x194;_0x3a8250=[];}});})[_0xc509('0xe')](function(){if(_0x3bc80e!==0x194){return db[_0xc509('0x8b')][_0xc509('0x10e')]({'where':{'ChatWebsiteId':_0x1ae38e},'order':_0xc509('0x90')})['then'](function(_0x16907c){_0x3a8250=_0x16907c;});}})[_0xc509('0x18')](function(_0x1ed890){_0x3bc80e=0x1f4;logger['error'](_0x1ed890[_0xc509('0x26')]);if(_0x1ed890[_0xc509('0x27')]){delete _0x1ed890[_0xc509('0x27')];}_0x3a8250=_0x1ed890;})[_0xc509('0x10f')](function(){if(_0x3a8250===null){_0x40af8d['sendStatus'](_0x3bc80e);}else{if(_0x3bc80e===0x1f4){_0x40af8d[_0xc509('0x1a')](_0x3bc80e)[_0xc509('0x28')](_0x3a8250);}else{_0x40af8d[_0xc509('0x1a')](_0x3bc80e)[_0xc509('0x1c')](_0x3a8250);}}});};exports[_0xc509('0x110')]=function(_0x59fca6,_0x2ee293){var _0x37628b={};var _0x31317e={};var _0x5c9115;var _0x23f797;return db[_0xc509('0x2c')]['findOne']({'where':{'id':_0x59fca6[_0xc509('0x45')]['id']}})[_0xc509('0xe')](handleEntityNotFound(_0x2ee293,null))[_0xc509('0xe')](function(_0x23ca7d){if(_0x23ca7d){_0x5c9115=_0x23ca7d;_0x31317e['model']=_[_0xc509('0x46')](db[_0xc509('0x8b')]['rawAttributes']);_0x31317e[_0xc509('0x31')]=_[_0xc509('0x46')](_0x59fca6[_0xc509('0x31')]);_0x31317e[_0xc509('0x32')]=_[_0xc509('0x33')](_0x31317e[_0xc509('0x30')],_0x31317e[_0xc509('0x31')]);_0x37628b['attributes']=_[_0xc509('0x33')](_0x31317e['model'],qs[_0xc509('0x34')](_0x59fca6['query'][_0xc509('0x34')]));_0x37628b[_0xc509('0x36')]=_0x37628b[_0xc509('0x36')][_0xc509('0x35')]?_0x37628b[_0xc509('0x36')]:_0x31317e[_0xc509('0x30')];_0x37628b[_0xc509('0x39')]=qs[_0xc509('0x3a')](_0x59fca6[_0xc509('0x31')][_0xc509('0x3a')]);_0x37628b[_0xc509('0x3b')]=qs[_0xc509('0x32')](_['pick'](_0x59fca6[_0xc509('0x31')],_0x31317e[_0xc509('0x32')]));if(_0x59fca6[_0xc509('0x31')][_0xc509('0x3d')]){_0x37628b[_0xc509('0x3b')]=_['merge'](_0x37628b[_0xc509('0x3b')],{'$or':_[_0xc509('0x2b')](_0x37628b[_0xc509('0x36')],function(_0x4d0751){var _0x367b3a={};_0x367b3a[_0x4d0751]={'$like':'%'+_0x59fca6['query'][_0xc509('0x3d')]+'%'};return _0x367b3a;})});}_0x37628b=_[_0xc509('0x3f')]({},_0x37628b,_0x59fca6[_0xc509('0x40')]);return _0x5c9115[_0xc509('0x110')](_0x37628b);}})[_0xc509('0xe')](function(_0x5adba5){if(_0x5adba5){_0x23f797=_0x5adba5[_0xc509('0x35')];if(!_0x59fca6['query']['hasOwnProperty'](_0xc509('0x38'))){_0x37628b[_0xc509('0x20')]=qs[_0xc509('0x20')](_0x59fca6[_0xc509('0x31')][_0xc509('0x20')]);_0x37628b['offset']=qs[_0xc509('0x1d')](_0x59fca6[_0xc509('0x31')][_0xc509('0x1d')]);}return _0x5c9115[_0xc509('0x110')](_0x37628b);}})[_0xc509('0xe')](function(_0xa33928){if(_0xa33928){return _0xa33928?{'count':_0x23f797,'rows':_0xa33928}:null;}})[_0xc509('0xe')](respondWithResult(_0x2ee293,null))[_0xc509('0x18')](handleError(_0x2ee293,null));};exports['addProactiveActions']=function(_0x5e5155,_0x3efb30){return db[_0xc509('0x111')][_0xc509('0x4c')]({'where':{'id':_0x5e5155[_0xc509('0x45')]['id']}})[_0xc509('0xe')](handleEntityNotFound(_0x3efb30,null))[_0xc509('0xe')](function(_0x3d8d53){if(_0x3d8d53){return _0x3d8d53['addProactiveActions'](_0x5e5155[_0xc509('0x50')][_0xc509('0x59')],_['omit'](_0x5e5155[_0xc509('0x50')],[_0xc509('0x59'),'id'])||{});}})[_0xc509('0xe')](respondWithResult(_0x3efb30,null))[_0xc509('0x18')](handleError(_0x3efb30,null));};exports[_0xc509('0xf5')]=function(_0x4c8610,_0x5eae5c){var _0xd05bca={};var _0x52954f={};var _0x5b55c2;var _0x27d138;return db[_0xc509('0x2c')][_0xc509('0x5c')]({'where':{'id':_0x4c8610[_0xc509('0x45')]['id']}})[_0xc509('0xe')](handleEntityNotFound(_0x5eae5c,null))['then'](function(_0x42de03){if(_0x42de03){_0x5b55c2=_0x42de03;_0x52954f[_0xc509('0x30')]=_['keys'](db[_0xc509('0x112')][_0xc509('0x47')]);_0x52954f['query']=_[_0xc509('0x46')](_0x4c8610[_0xc509('0x31')]);_0x52954f[_0xc509('0x32')]=_['intersection'](_0x52954f[_0xc509('0x30')],_0x52954f[_0xc509('0x31')]);_0xd05bca['attributes']=_[_0xc509('0x33')](_0x52954f['model'],qs[_0xc509('0x34')](_0x4c8610[_0xc509('0x31')][_0xc509('0x34')]));_0xd05bca[_0xc509('0x36')]=_0xd05bca[_0xc509('0x36')]['length']?_0xd05bca[_0xc509('0x36')]:_0x52954f[_0xc509('0x30')];_0xd05bca[_0xc509('0x39')]=qs[_0xc509('0x3a')](_0x4c8610[_0xc509('0x31')][_0xc509('0x3a')]);_0xd05bca[_0xc509('0x3b')]=qs[_0xc509('0x32')](_[_0xc509('0x3c')](_0x4c8610[_0xc509('0x31')],_0x52954f[_0xc509('0x32')]));if(_0x4c8610[_0xc509('0x31')][_0xc509('0x3d')]){_0xd05bca[_0xc509('0x3b')]=_[_0xc509('0x3f')](_0xd05bca['where'],{'$or':_[_0xc509('0x2b')](_0xd05bca[_0xc509('0x36')],function(_0x1fd346){var _0x2bf0b1={};_0x2bf0b1[_0x1fd346]={'$like':'%'+_0x4c8610[_0xc509('0x31')][_0xc509('0x3d')]+'%'};return _0x2bf0b1;})});}_0xd05bca=_[_0xc509('0x3f')]({},_0xd05bca,_0x4c8610[_0xc509('0x40')]);return _0x5b55c2[_0xc509('0xf5')](_0xd05bca);}})['then'](function(_0x2ba581){if(_0x2ba581){_0x27d138=_0x2ba581[_0xc509('0x35')];if(!_0x4c8610[_0xc509('0x31')][_0xc509('0x37')](_0xc509('0x38'))){_0xd05bca[_0xc509('0x20')]=qs['limit'](_0x4c8610[_0xc509('0x31')][_0xc509('0x20')]);_0xd05bca[_0xc509('0x1d')]=qs[_0xc509('0x1d')](_0x4c8610[_0xc509('0x31')][_0xc509('0x1d')]);}return _0x5b55c2['getProactiveActions'](_0xd05bca);}})[_0xc509('0xe')](function(_0x25126c){if(_0x25126c){return _0x25126c?{'count':_0x27d138,'rows':_0x25126c}:null;}})[_0xc509('0xe')](respondWithResult(_0x5eae5c,null))['catch'](handleError(_0x5eae5c,null));};exports['getFields']=function(_0x325ee8,_0x274b82){var _0x362276=_0x325ee8[_0xc509('0x31')]['online']===_0xc509('0x113')?'offlineForm':_0xc509('0x114');return db[_0xc509('0x2c')][_0xc509('0x4c')]({'attributes':['id',_0x362276],'where':{'id':_0x325ee8['params']['id']}})[_0xc509('0xe')](handleEntityNotFound(_0x274b82,null))['then'](function(_0x39056b){if(_0x39056b){var _0x169ef3=_0x39056b[_0x362276];var _0x19a013=_0x169ef3&&_0x169ef3['items']?_0x169ef3[_0xc509('0x115')]:[];_0x274b82[_0xc509('0x28')]({'fromKey':_[_0xc509('0x6d')](_0x169ef3['fromKey'])?undefined:_0x169ef3[_0xc509('0x116')],'count':_0x19a013[_0xc509('0x35')],'rows':_0x19a013});}})['catch'](handleError(_0x274b82,null));};exports[_0xc509('0x117')]=function(_0x50a3c0,_0x1e2723){var _0x538928={'raw':![],'where':{}};var _0x1145ca={};var _0x138a8a={'count':0x0,'rows':[]};return db[_0xc509('0x2c')][_0xc509('0x5c')]({'where':{'id':_0x50a3c0[_0xc509('0x45')]['id']}})[_0xc509('0xe')](handleEntityNotFound(_0x1e2723,null))['then'](function(_0x264bff){if(_0x264bff){_0x1145ca[_0xc509('0x30')]=_['keys'](db['ChatOfflineMessage'][_0xc509('0x47')]);_0x1145ca[_0xc509('0x31')]=_[_0xc509('0x46')](_0x50a3c0[_0xc509('0x31')]);_0x1145ca[_0xc509('0x32')]=_[_0xc509('0x33')](_0x1145ca[_0xc509('0x30')],_0x1145ca['query']);_0x538928[_0xc509('0x36')]=_[_0xc509('0x33')](_0x1145ca[_0xc509('0x30')],qs[_0xc509('0x34')](_0x50a3c0[_0xc509('0x31')][_0xc509('0x34')]));_0x538928[_0xc509('0x36')]=_0x538928[_0xc509('0x36')][_0xc509('0x35')]?_0x538928[_0xc509('0x36')]:_0x1145ca[_0xc509('0x30')];if(!_0x50a3c0['query'][_0xc509('0x37')](_0xc509('0x38'))){_0x538928[_0xc509('0x20')]=qs['limit'](_0x50a3c0['query'][_0xc509('0x20')]);_0x538928['offset']=qs['offset'](_0x50a3c0[_0xc509('0x31')][_0xc509('0x1d')]);}_0x538928['order']=qs['sort'](_0x50a3c0['query'][_0xc509('0x3a')]);_0x538928[_0xc509('0x3b')]=qs[_0xc509('0x32')](_[_0xc509('0x3c')](_0x50a3c0[_0xc509('0x31')],_0x1145ca['filters']));_0x538928[_0xc509('0x3b')][_0xc509('0x54')]=_0x264bff['id'];if(_0x50a3c0[_0xc509('0x31')][_0xc509('0x3d')]){_0x538928[_0xc509('0x3b')]=_['merge'](_0x538928[_0xc509('0x3b')],{'$or':_[_0xc509('0x2b')](_0x538928[_0xc509('0x36')],function(_0x1df742){var _0x1554d5={};_0x1554d5[_0x1df742]={'$like':'%'+_0x50a3c0[_0xc509('0x31')][_0xc509('0x3d')]+'%'};return _0x1554d5;})});}_0x538928=_[_0xc509('0x3f')]({},_0x538928,_0x50a3c0[_0xc509('0x40')]);return db[_0xc509('0xc6')][_0xc509('0x1f')]({'where':_0x538928[_0xc509('0x3b')]})[_0xc509('0xe')](function(_0x4f9d6b){_0x138a8a[_0xc509('0x1f')]=_0x4f9d6b;if(_0x50a3c0['query']['includeAll']){_0x538928['include']=[{'all':!![]}];}else{_0x538928['include']=[{'model':db[_0xc509('0x88')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0xc509('0xc6')][_0xc509('0x57')](_0x538928);})['then'](function(_0x1f54d3){_0x138a8a[_0xc509('0x43')]=_0x1f54d3;return _0x138a8a;});}})['then'](respondWithFilteredResult(_0x1e2723,_0x538928))[_0xc509('0x18')](handleError(_0x1e2723,null));};exports[_0xc509('0x118')]=function(_0x9ebfb6,_0x1ede12){return db[_0xc509('0x2c')]['find']({'where':{'id':_0x9ebfb6['params']['id']}})['then'](handleEntityNotFound(_0x1ede12,null))[_0xc509('0xe')](function(_0x4b6ff){if(_0x4b6ff){return _0x4b6ff[_0xc509('0x118')](_0x9ebfb6['body'][_0xc509('0x59')],_[_0xc509('0xe2')](_0x9ebfb6[_0xc509('0x50')],[_0xc509('0x59'),'id'])||{})['spread'](function(_0x969ebe){for(var _0x429b5a=0x0;_0x429b5a<_0x9ebfb6[_0xc509('0x50')][_0xc509('0x59')][_0xc509('0x35')];_0x429b5a+=0x1){socket[_0xc509('0x119')](_0xc509('0x11a'),{'UserId':Number(_0x9ebfb6[_0xc509('0x50')][_0xc509('0x59')][_0x429b5a]),'ChatWebsiteId':Number(_0x9ebfb6['params']['id'])});}return _0x969ebe;});}})[_0xc509('0xe')](respondWithResult(_0x1ede12,null))['catch'](handleError(_0x1ede12,null));};exports['removeAgents']=function(_0x17fa70,_0x3e5e76){return db[_0xc509('0x2c')][_0xc509('0x4c')]({'where':{'id':_0x17fa70[_0xc509('0x45')]['id']}})[_0xc509('0xe')](handleEntityNotFound(_0x3e5e76,null))[_0xc509('0xe')](function(_0x56189c){if(_0x56189c){return _0x56189c[_0xc509('0x11b')](_0x17fa70['query'][_0xc509('0x59')])[_0xc509('0xe')](function(){if(_[_0xc509('0x11c')](_0x17fa70['query'][_0xc509('0x59')])){for(var _0xcbb60f=0x0;_0xcbb60f<_0x17fa70[_0xc509('0x31')][_0xc509('0x59')][_0xc509('0x35')];_0xcbb60f+=0x1){socket[_0xc509('0x119')](_0xc509('0x11d'),{'UserId':Number(_0x17fa70[_0xc509('0x31')][_0xc509('0x59')][_0xcbb60f]),'ChatWebsiteId':Number(_0x17fa70[_0xc509('0x45')]['id'])});}}else{socket[_0xc509('0x119')](_0xc509('0x11d'),{'UserId':Number(_0x17fa70[_0xc509('0x31')][_0xc509('0x59')]),'ChatWebsiteId':Number(_0x17fa70[_0xc509('0x45')]['id'])});}});}})[_0xc509('0xe')](respondWithStatusCode(_0x3e5e76,null))[_0xc509('0x18')](handleError(_0x3e5e76,null));};exports['getAgents']=function(_0xe0dab0,_0x4dbfca){var _0x2a5d77={};var _0x438108={};var _0x113abe;var _0x182fb8;return db[_0xc509('0x2c')][_0xc509('0x5c')]({'where':{'id':_0xe0dab0['params']['id']}})[_0xc509('0xe')](handleEntityNotFound(_0x4dbfca,null))[_0xc509('0xe')](function(_0x349a1b){if(_0x349a1b){_0x113abe=_0x349a1b;_0x438108['model']=_['keys'](db[_0xc509('0xb2')][_0xc509('0x47')]);_0x438108[_0xc509('0x31')]=_[_0xc509('0x46')](_0xe0dab0['query']);_0x438108[_0xc509('0x32')]=_['intersection'](_0x438108[_0xc509('0x30')],_0x438108[_0xc509('0x31')]);_0x2a5d77['attributes']=_[_0xc509('0x33')](_0x438108['model'],qs[_0xc509('0x34')](_0xe0dab0['query']['fields']));_0x2a5d77['attributes']=_0x2a5d77[_0xc509('0x36')][_0xc509('0x35')]?_0x2a5d77[_0xc509('0x36')]:_0x438108[_0xc509('0x30')];_0x2a5d77[_0xc509('0x39')]=qs[_0xc509('0x3a')](_0xe0dab0[_0xc509('0x31')][_0xc509('0x3a')]);_0x2a5d77[_0xc509('0x3b')]=qs['filters'](_[_0xc509('0x3c')](_0xe0dab0['query'],_0x438108[_0xc509('0x32')]));if(_0xe0dab0[_0xc509('0x31')]['filter']){_0x2a5d77[_0xc509('0x3b')]=_[_0xc509('0x3f')](_0x2a5d77['where'],{'$or':_[_0xc509('0x2b')](_0x2a5d77[_0xc509('0x36')],function(_0x71aecf){var _0x450457={};_0x450457[_0x71aecf]={'$like':'%'+_0xe0dab0[_0xc509('0x31')]['filter']+'%'};return _0x450457;})});}_0x2a5d77=_[_0xc509('0x3f')]({},_0x2a5d77,_0xe0dab0[_0xc509('0x40')]);return _0x113abe[_0xc509('0x11e')](_0x2a5d77);}})[_0xc509('0xe')](function(_0x11a655){if(_0x11a655){_0x182fb8=_0x11a655['length'];if(!_0xe0dab0['query']['hasOwnProperty'](_0xc509('0x38'))){_0x2a5d77['limit']=qs[_0xc509('0x20')](_0xe0dab0[_0xc509('0x31')][_0xc509('0x20')]);_0x2a5d77[_0xc509('0x1d')]=qs[_0xc509('0x1d')](_0xe0dab0[_0xc509('0x31')][_0xc509('0x1d')]);}return _0x113abe[_0xc509('0x11e')](_0x2a5d77);}})['then'](function(_0x301779){if(_0x301779){return _0x301779?{'count':_0x182fb8,'rows':_0x301779}:null;}})['then'](respondWithResult(_0x4dbfca,null))[_0xc509('0x18')](handleError(_0x4dbfca,null));};
\ No newline at end of file
+var _0xd2ce=['Disposition','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','sitepic','file','filename','agentAvatar','customerAvatar','addSystemAvatar','getLogo','root','../../config/license/util','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','server/files/images/avatars/system_avatar.png','systemAvatar','notify','setUA','headers','user-agent','getResult','chat','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','Sequelize','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','Applications','list','applications','orderBy','priority','asc','account','from','contact','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','files','CompanyId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','server/files/templates/chatOfflineMessage.ejs','render','toPairs','ChatOfflineMessage','originalname','mimetype','server','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','user','MailAccountId','subjectOffline','toPairsIn','mapValues','email','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','readFileSync','utf8','remote','x-real-ip','connection','remoteAddress','referer','alignment','verticalAlignment','labelText','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','READ_COMMITTED','findAndCountAll','stack','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','ChatWebsites','name','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','includeAll','findAll','show','params','include','options','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','UserProfileResource','describe','addDisposition','ChatWebsiteId','findOne','nolimit','order','map'];(function(_0x348fa1,_0x1f815c){var _0xe177d3=function(_0x2cd736){while(--_0x2cd736){_0x348fa1['push'](_0x348fa1['shift']());}};_0xe177d3(++_0x1f815c);}(_0xd2ce,0xd1));var _0xed2c=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xd2ce[_0x28d18d];return _0x470640;};'use strict';var BPromise=require(_0xed2c('0x0'));var Mustache=require(_0xed2c('0x1'));var util=require(_0xed2c('0x2'));var path=require(_0xed2c('0x3'));var ejs=require(_0xed2c('0x4'));var fs=require('fs');var fs_extra=require(_0xed2c('0x5'));var _=require(_0xed2c('0x6'));var querystring=require(_0xed2c('0x7'));var Redis=require('ioredis');var qs=require(_0xed2c('0x8'));var logger=require(_0xed2c('0x9'))(_0xed2c('0xa'));var config=require(_0xed2c('0xb'));var db=require(_0xed2c('0xc'))['db'];config[_0xed2c('0xd')]=_[_0xed2c('0xe')](config[_0xed2c('0xd')],{'host':_0xed2c('0xf'),'port':0x18eb});var socket=require(_0xed2c('0x10'))(new Redis(config[_0xed2c('0xd')]));require(_0xed2c('0x11'))['register'](socket);var htmlToText=require('html-to-text');var jayson=require(_0xed2c('0x12'));var client=jayson[_0xed2c('0x13')][_0xed2c('0x14')]({'port':0x232c});var client9002=jayson[_0xed2c('0x13')][_0xed2c('0x14')]({'port':0x232a});var client9003=jayson[_0xed2c('0x13')][_0xed2c('0x14')]({'port':0x232b});var client9001=jayson[_0xed2c('0x13')][_0xed2c('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x26388f,_0x194185,_0x2d4e0e,_0x29dcd9){return new BPromise(function(_0x57c6b2,_0x1585e5){var _0x45ed01=_0x29dcd9||client;return _0x45ed01[_0xed2c('0x15')](_0x26388f,_0x2d4e0e)[_0xed2c('0x16')](function(_0x9871ae){logger[_0xed2c('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x194185,_0xed2c('0x18'));logger[_0xed2c('0x19')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x194185,_0xed2c('0x18'),JSON['stringify'](_0x9871ae));if(_0x9871ae[_0xed2c('0x1a')]){if(_0x9871ae[_0xed2c('0x1a')][_0xed2c('0x1b')]===0x1f4){logger[_0xed2c('0x1a')](_0xed2c('0x1c'),_0x194185,_0x9871ae['error'][_0xed2c('0x1d')]);return _0x1585e5(_0x9871ae[_0xed2c('0x1a')][_0xed2c('0x1d')]);}logger[_0xed2c('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x194185,_0x9871ae['error'][_0xed2c('0x1d')]);return _0x57c6b2(_0x9871ae[_0xed2c('0x1a')][_0xed2c('0x1d')]);}else{logger[_0xed2c('0x17')](_0xed2c('0x1c'),_0x194185,_0xed2c('0x18'));_0x57c6b2(_0x9871ae[_0xed2c('0x1e')][_0xed2c('0x1d')]);}})[_0xed2c('0x1f')](function(_0x129401){logger['error'](_0xed2c('0x1c'),_0x194185,_0x129401);_0x1585e5(_0x129401);});});}function respondWithStatusCode(_0x3f724d,_0x2331d0){_0x2331d0=_0x2331d0||0xcc;return function(_0x1386c4){if(_0x1386c4){return _0x3f724d[_0xed2c('0x20')](_0x2331d0);}return _0x3f724d[_0xed2c('0x21')](_0x2331d0)[_0xed2c('0x22')]();};}function respondWithResult(_0x35f70e,_0x51088c){_0x51088c=_0x51088c||0xc8;return function(_0x5bf75e){if(_0x5bf75e){return _0x35f70e[_0xed2c('0x21')](_0x51088c)[_0xed2c('0x23')](_0x5bf75e);}};}function respondWithFilteredResult(_0x33a29e,_0x4438c1){return function(_0x22fd91){if(_0x22fd91){var _0x265c36=typeof _0x4438c1[_0xed2c('0x24')]==='undefined'&&typeof _0x4438c1[_0xed2c('0x25')]===_0xed2c('0x26');var _0x5ab86b=_0x22fd91[_0xed2c('0x27')];var _0x4d5d7c=_0x265c36?0x0:_0x4438c1[_0xed2c('0x24')];var _0x495008=_0x265c36?_0x22fd91['count']:_0x4438c1[_0xed2c('0x24')]+_0x4438c1['limit'];var _0x4e969f;if(_0x495008>=_0x5ab86b){_0x495008=_0x5ab86b;_0x4e969f=0xc8;}else{_0x4e969f=0xce;}_0x33a29e[_0xed2c('0x21')](_0x4e969f);return _0x33a29e[_0xed2c('0x28')](_0xed2c('0x29'),_0x4d5d7c+'-'+_0x495008+'/'+_0x5ab86b)[_0xed2c('0x23')](_0x22fd91);}return null;};}function saveUpdates(_0x53db46){return function(_0x6a0ee6){if(_0x6a0ee6){return _0x6a0ee6[_0xed2c('0x2a')](_0x53db46)['then'](function(_0x23256f){return _0x23256f;});}return null;};}function removeEntity(_0x2ce2ce){return function(_0x1b62d3){if(_0x1b62d3){return _0x1b62d3[_0xed2c('0x2b')]()['then'](function(){var _0x3bb243=_0x1b62d3['get']({'plain':!![]});var _0x1c6c00=_0xed2c('0x2c');return db['UserProfileResource'][_0xed2c('0x2b')]({'where':{'type':_0x1c6c00,'resourceId':_0x3bb243['id']}})[_0xed2c('0x16')](function(){return _0x1b62d3;});})[_0xed2c('0x16')](function(){_0x2ce2ce[_0xed2c('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x318ff1){return function(_0x272daf){if(!_0x272daf){_0x318ff1['sendStatus'](0x194);}return _0x272daf;};}function handleError(_0x292340,_0x5b634f){_0x5b634f=_0x5b634f||0x1f4;return function(_0x2d58bb){logger[_0xed2c('0x1a')](_0x2d58bb['stack']);if(_0x2d58bb['name']){delete _0x2d58bb[_0xed2c('0x2d')];}_0x292340[_0xed2c('0x21')](_0x5b634f)['send'](_0x2d58bb);};}exports[_0xed2c('0x2e')]=function(_0x544e68,_0x2e477c){var _0x44cfdf={'include':[{'model':db[_0xed2c('0x2f')],'as':_0xed2c('0x30')}]},_0x40c392={},_0x381a3d={'count':0x0,'rows':[]};var _0x1afb34=_['map'](db[_0xed2c('0x31')][_0xed2c('0x32')],function(_0x3155a4){return{'name':_0x3155a4[_0xed2c('0x33')],'type':_0x3155a4[_0xed2c('0x34')]['key']};});_0x40c392[_0xed2c('0x35')]=_['map'](_0x1afb34,_0xed2c('0x2d'));_0x40c392[_0xed2c('0x36')]=_[_0xed2c('0x37')](_0x544e68[_0xed2c('0x36')]);_0x40c392[_0xed2c('0x38')]=_[_0xed2c('0x39')](_0x40c392[_0xed2c('0x35')],_0x40c392[_0xed2c('0x36')]);_0x44cfdf[_0xed2c('0x3a')]=_[_0xed2c('0x39')](_0x40c392[_0xed2c('0x35')],qs[_0xed2c('0x3b')](_0x544e68[_0xed2c('0x36')][_0xed2c('0x3b')]));_0x44cfdf[_0xed2c('0x3a')]=_0x44cfdf[_0xed2c('0x3a')][_0xed2c('0x3c')]?_0x44cfdf['attributes']:_0x40c392[_0xed2c('0x35')];if(!_0x544e68[_0xed2c('0x36')][_0xed2c('0x3d')]('nolimit')){_0x44cfdf[_0xed2c('0x25')]=qs[_0xed2c('0x25')](_0x544e68[_0xed2c('0x36')][_0xed2c('0x25')]);_0x44cfdf['offset']=qs[_0xed2c('0x24')](_0x544e68[_0xed2c('0x36')][_0xed2c('0x24')]);}_0x44cfdf['order']=qs[_0xed2c('0x3e')](_0x544e68[_0xed2c('0x36')]['sort']);_0x44cfdf['where']=qs[_0xed2c('0x38')](_[_0xed2c('0x3f')](_0x544e68['query'],_0x40c392['filters']),_0x1afb34);if(_0x544e68[_0xed2c('0x36')][_0xed2c('0x40')]){_0x44cfdf[_0xed2c('0x41')]=_[_0xed2c('0x42')](_0x44cfdf[_0xed2c('0x41')],{'$or':_['map'](_0x1afb34,function(_0x44e92a){if(_0x44e92a[_0xed2c('0x34')]!=='VIRTUAL'){var _0x5490f0={};_0x5490f0[_0x44e92a[_0xed2c('0x2d')]]={'$like':'%'+_0x544e68[_0xed2c('0x36')][_0xed2c('0x40')]+'%'};return _0x5490f0;}})});}_0x44cfdf=_[_0xed2c('0x42')]({},_0x44cfdf,_0x544e68['options']);var _0x26dc6e={'where':_0x44cfdf['where']};return db[_0xed2c('0x31')][_0xed2c('0x27')](_0x26dc6e)[_0xed2c('0x16')](function(_0x2ddf6e){_0x381a3d[_0xed2c('0x27')]=_0x2ddf6e;if(_0x544e68[_0xed2c('0x36')][_0xed2c('0x43')]){_0x44cfdf['include']=[{'all':!![]}];}return db[_0xed2c('0x31')][_0xed2c('0x44')](_0x44cfdf);})[_0xed2c('0x16')](function(_0x3b8dc7){_0x381a3d['rows']=_0x3b8dc7;return _0x381a3d;})[_0xed2c('0x16')](respondWithFilteredResult(_0x2e477c,_0x44cfdf))[_0xed2c('0x1f')](handleError(_0x2e477c,null));};exports[_0xed2c('0x45')]=function(_0x2963d4,_0x1501e3){var _0x42a42a={'raw':![],'where':{'id':_0x2963d4[_0xed2c('0x46')]['id']},'include':[{'model':db[_0xed2c('0x2f')],'as':_0xed2c('0x30')}]},_0x48e252={};_0x48e252[_0xed2c('0x35')]=_[_0xed2c('0x37')](db[_0xed2c('0x31')][_0xed2c('0x32')]);_0x48e252[_0xed2c('0x36')]=_[_0xed2c('0x37')](_0x2963d4['query']);_0x48e252[_0xed2c('0x38')]=_[_0xed2c('0x39')](_0x48e252[_0xed2c('0x35')],_0x48e252[_0xed2c('0x36')]);_0x42a42a[_0xed2c('0x3a')]=_[_0xed2c('0x39')](_0x48e252[_0xed2c('0x35')],qs[_0xed2c('0x3b')](_0x2963d4['query'][_0xed2c('0x3b')]));_0x42a42a[_0xed2c('0x3a')]=_0x42a42a[_0xed2c('0x3a')][_0xed2c('0x3c')]?_0x42a42a[_0xed2c('0x3a')]:_0x48e252[_0xed2c('0x35')];if(_0x2963d4[_0xed2c('0x36')][_0xed2c('0x43')]){_0x42a42a[_0xed2c('0x47')]=[{'all':!![]}];}_0x42a42a=_[_0xed2c('0x42')]({},_0x42a42a,_0x2963d4[_0xed2c('0x48')]);return db[_0xed2c('0x31')]['find'](_0x42a42a)[_0xed2c('0x16')](handleEntityNotFound(_0x1501e3,null))['then'](respondWithResult(_0x1501e3,null))[_0xed2c('0x1f')](handleError(_0x1501e3,null));};exports['create']=function(_0x2ce08b,_0xd9d431){return db[_0xed2c('0x31')][_0xed2c('0x49')](_0x2ce08b[_0xed2c('0x4a')],{})[_0xed2c('0x16')](function(_0x295164){var _0x28b4dc=_0x2ce08b['user'][_0xed2c('0x4b')]({'plain':!![]});if(!_0x28b4dc)throw new Error(_0xed2c('0x4c'));if(_0x28b4dc[_0xed2c('0x4d')]==='user'){var _0x3bf8f5=_0x295164[_0xed2c('0x4b')]({'plain':!![]});var _0x1a39df=_0xed2c('0x2c');return db['UserProfileSection'][_0xed2c('0x4e')]({'where':{'name':_0x1a39df,'userProfileId':_0x28b4dc[_0xed2c('0x4f')]},'raw':!![]})[_0xed2c('0x16')](function(_0x2256f4){if(_0x2256f4&&_0x2256f4['autoAssociation']===0x0){return db[_0xed2c('0x50')][_0xed2c('0x49')]({'name':_0x3bf8f5['name'],'resourceId':_0x3bf8f5['id'],'type':_0x2256f4[_0xed2c('0x2d')],'sectionId':_0x2256f4['id']},{})[_0xed2c('0x16')](function(){return _0x295164;});}else{return _0x295164;}})[_0xed2c('0x1f')](function(_0x26b912){logger[_0xed2c('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x26b912);throw _0x26b912;});}return _0x295164;})[_0xed2c('0x16')](respondWithResult(_0xd9d431,0xc9))[_0xed2c('0x1f')](handleError(_0xd9d431,null));};exports[_0xed2c('0x2a')]=function(_0x40ebd2,_0x4733c1){if(_0x40ebd2[_0xed2c('0x4a')]['id']){delete _0x40ebd2['body']['id'];}return db['ChatWebsite'][_0xed2c('0x4e')]({'where':{'id':_0x40ebd2[_0xed2c('0x46')]['id']},'include':[{'model':db[_0xed2c('0x2f')],'as':_0xed2c('0x30')}]})[_0xed2c('0x16')](handleEntityNotFound(_0x4733c1,null))[_0xed2c('0x16')](saveUpdates(_0x40ebd2[_0xed2c('0x4a')],null))[_0xed2c('0x16')](respondWithResult(_0x4733c1,null))[_0xed2c('0x1f')](handleError(_0x4733c1,null));};exports[_0xed2c('0x2b')]=function(_0x52bba2,_0x589737){return db[_0xed2c('0x31')][_0xed2c('0x4e')]({'where':{'id':_0x52bba2[_0xed2c('0x46')]['id']}})['then'](handleEntityNotFound(_0x589737,null))[_0xed2c('0x16')](removeEntity(_0x589737,null))['catch'](handleError(_0x589737,null));};exports[_0xed2c('0x51')]=function(_0x1b53ba,_0x409da0){return db[_0xed2c('0x31')][_0xed2c('0x51')]()['then'](respondWithResult(_0x409da0,null))[_0xed2c('0x1f')](handleError(_0x409da0,null));};exports[_0xed2c('0x52')]=function(_0x9ebef5,_0x5b806e){if(_0x9ebef5['body']['id']){delete _0x9ebef5[_0xed2c('0x4a')]['id'];}return db[_0xed2c('0x31')]['find']({'where':{'id':_0x9ebef5['params']['id']}})[_0xed2c('0x16')](handleEntityNotFound(_0x5b806e,null))[_0xed2c('0x16')](function(_0x2dc76d){if(_0x2dc76d){_0x9ebef5[_0xed2c('0x4a')][_0xed2c('0x53')]=_0x2dc76d['id'];return db['Disposition'][_0xed2c('0x49')](_0x9ebef5[_0xed2c('0x4a')]);}})[_0xed2c('0x16')](respondWithResult(_0x5b806e,null))['catch'](handleError(_0x5b806e,null));};exports['getDispositions']=function(_0x2bd18b,_0x5212ac){var _0x9bdb7c={'raw':![],'where':{}};var _0x15a1da={};var _0x540727={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xed2c('0x54')]({'where':{'id':_0x2bd18b[_0xed2c('0x46')]['id']}})[_0xed2c('0x16')](handleEntityNotFound(_0x5212ac,null))[_0xed2c('0x16')](function(_0x1237ec){if(_0x1237ec){_0x15a1da[_0xed2c('0x35')]=_[_0xed2c('0x37')](db['Disposition'][_0xed2c('0x32')]);_0x15a1da[_0xed2c('0x36')]=_[_0xed2c('0x37')](_0x2bd18b['query']);_0x15a1da['filters']=_[_0xed2c('0x39')](_0x15a1da[_0xed2c('0x35')],_0x15a1da['query']);_0x9bdb7c[_0xed2c('0x3a')]=_[_0xed2c('0x39')](_0x15a1da['model'],qs[_0xed2c('0x3b')](_0x2bd18b[_0xed2c('0x36')][_0xed2c('0x3b')]));_0x9bdb7c[_0xed2c('0x3a')]=_0x9bdb7c[_0xed2c('0x3a')]['length']?_0x9bdb7c[_0xed2c('0x3a')]:_0x15a1da['model'];if(!_0x2bd18b[_0xed2c('0x36')]['hasOwnProperty'](_0xed2c('0x55'))){_0x9bdb7c['limit']=qs[_0xed2c('0x25')](_0x2bd18b['query'][_0xed2c('0x25')]);_0x9bdb7c[_0xed2c('0x24')]=qs[_0xed2c('0x24')](_0x2bd18b['query']['offset']);}_0x9bdb7c[_0xed2c('0x56')]=qs[_0xed2c('0x3e')](_0x2bd18b['query'][_0xed2c('0x3e')]);_0x9bdb7c['where']=qs[_0xed2c('0x38')](_[_0xed2c('0x3f')](_0x2bd18b[_0xed2c('0x36')],_0x15a1da['filters']));_0x9bdb7c[_0xed2c('0x41')]['ChatWebsiteId']=_0x1237ec['id'];if(_0x2bd18b['query'][_0xed2c('0x40')]){_0x9bdb7c[_0xed2c('0x41')]=_['merge'](_0x9bdb7c[_0xed2c('0x41')],{'$or':_[_0xed2c('0x57')](_0x9bdb7c['attributes'],function(_0x18b309){var _0x8577b6={};_0x8577b6[_0x18b309]={'$like':'%'+_0x2bd18b[_0xed2c('0x36')][_0xed2c('0x40')]+'%'};return _0x8577b6;})});}_0x9bdb7c=_[_0xed2c('0x42')]({},_0x9bdb7c,_0x2bd18b['options']);return db[_0xed2c('0x58')]['count']({'where':_0x9bdb7c[_0xed2c('0x41')]})[_0xed2c('0x16')](function(_0x15f18c){_0x540727['count']=_0x15f18c;if(_0x2bd18b[_0xed2c('0x36')][_0xed2c('0x43')]){_0x9bdb7c[_0xed2c('0x47')]=[{'all':!![]}];}return db[_0xed2c('0x58')][_0xed2c('0x44')](_0x9bdb7c);})['then'](function(_0x10c7fe){_0x540727[_0xed2c('0x59')]=_0x10c7fe;return _0x540727;});}})[_0xed2c('0x16')](respondWithFilteredResult(_0x5212ac,_0x9bdb7c))[_0xed2c('0x1f')](handleError(_0x5212ac,null));};exports['removeDispositions']=function(_0x23e6ef,_0x2731b5){return db['ChatWebsite'][_0xed2c('0x4e')]({'where':{'id':_0x23e6ef[_0xed2c('0x46')]['id']}})[_0xed2c('0x16')](handleEntityNotFound(_0x2731b5,null))[_0xed2c('0x16')](function(_0x55a57f){if(_0x55a57f){return _0x55a57f[_0xed2c('0x5a')](_0x23e6ef[_0xed2c('0x36')][_0xed2c('0x5b')]);}})[_0xed2c('0x16')](respondWithStatusCode(_0x2731b5,null))[_0xed2c('0x1f')](handleError(_0x2731b5,null));};exports[_0xed2c('0x5c')]=function(_0x54fdb5,_0x14b694){if(_0x54fdb5[_0xed2c('0x4a')]['id']){delete _0x54fdb5[_0xed2c('0x4a')]['id'];}return db['ChatWebsite'][_0xed2c('0x4e')]({'where':{'id':_0x54fdb5['params']['id']}})['then'](handleEntityNotFound(_0x14b694,null))[_0xed2c('0x16')](function(_0x5b6a5c){if(_0x5b6a5c){_0x54fdb5[_0xed2c('0x4a')][_0xed2c('0x53')]=_0x5b6a5c['id'];return db[_0xed2c('0x5d')][_0xed2c('0x49')](_0x54fdb5[_0xed2c('0x4a')]);}})[_0xed2c('0x16')](respondWithResult(_0x14b694,null))[_0xed2c('0x1f')](handleError(_0x14b694,null));};exports[_0xed2c('0x5e')]=function(_0x13b184,_0x3ea9f7){var _0x783172={'raw':![],'where':{}};var _0x3264ef={};var _0x5aa810={'count':0x0,'rows':[]};return db[_0xed2c('0x31')]['findOne']({'where':{'id':_0x13b184[_0xed2c('0x46')]['id']}})[_0xed2c('0x16')](handleEntityNotFound(_0x3ea9f7,null))[_0xed2c('0x16')](function(_0x1e9f31){if(_0x1e9f31){_0x3264ef[_0xed2c('0x35')]=_[_0xed2c('0x37')](db[_0xed2c('0x5d')][_0xed2c('0x32')]);_0x3264ef[_0xed2c('0x36')]=_['keys'](_0x13b184['query']);_0x3264ef[_0xed2c('0x38')]=_[_0xed2c('0x39')](_0x3264ef['model'],_0x3264ef[_0xed2c('0x36')]);_0x783172[_0xed2c('0x3a')]=_[_0xed2c('0x39')](_0x3264ef[_0xed2c('0x35')],qs[_0xed2c('0x3b')](_0x13b184[_0xed2c('0x36')]['fields']));_0x783172[_0xed2c('0x3a')]=_0x783172[_0xed2c('0x3a')][_0xed2c('0x3c')]?_0x783172[_0xed2c('0x3a')]:_0x3264ef[_0xed2c('0x35')];if(!_0x13b184[_0xed2c('0x36')][_0xed2c('0x3d')](_0xed2c('0x55'))){_0x783172[_0xed2c('0x25')]=qs[_0xed2c('0x25')](_0x13b184[_0xed2c('0x36')][_0xed2c('0x25')]);_0x783172[_0xed2c('0x24')]=qs['offset'](_0x13b184[_0xed2c('0x36')]['offset']);}_0x783172['order']=qs[_0xed2c('0x3e')](_0x13b184['query']['sort']);_0x783172[_0xed2c('0x41')]=qs[_0xed2c('0x38')](_[_0xed2c('0x3f')](_0x13b184['query'],_0x3264ef[_0xed2c('0x38')]));_0x783172[_0xed2c('0x41')]['ChatWebsiteId']=_0x1e9f31['id'];if(_0x13b184[_0xed2c('0x36')]['filter']){_0x783172[_0xed2c('0x41')]=_['merge'](_0x783172[_0xed2c('0x41')],{'$or':_[_0xed2c('0x57')](_0x783172[_0xed2c('0x3a')],function(_0x4c3c0d){var _0x2461ed={};_0x2461ed[_0x4c3c0d]={'$like':'%'+_0x13b184[_0xed2c('0x36')][_0xed2c('0x40')]+'%'};return _0x2461ed;})});}_0x783172=_['merge']({},_0x783172,_0x13b184['options']);return db[_0xed2c('0x5d')]['count']({'where':_0x783172[_0xed2c('0x41')]})['then'](function(_0x175133){_0x5aa810[_0xed2c('0x27')]=_0x175133;if(_0x13b184[_0xed2c('0x36')]['includeAll']){_0x783172['include']=[{'all':!![]}];}return db[_0xed2c('0x5d')][_0xed2c('0x44')](_0x783172);})[_0xed2c('0x16')](function(_0x3ab23c){_0x5aa810['rows']=_0x3ab23c;return _0x5aa810;});}})[_0xed2c('0x16')](respondWithFilteredResult(_0x3ea9f7,_0x783172))[_0xed2c('0x1f')](handleError(_0x3ea9f7,null));};exports['removeAnswers']=function(_0x4a45b5,_0x3352e7){return db['ChatWebsite'][_0xed2c('0x4e')]({'where':{'id':_0x4a45b5[_0xed2c('0x46')]['id']}})[_0xed2c('0x16')](handleEntityNotFound(_0x3352e7,null))[_0xed2c('0x16')](function(_0x5a9a5b){if(_0x5a9a5b){return _0x5a9a5b[_0xed2c('0x5f')](_0x4a45b5[_0xed2c('0x36')][_0xed2c('0x5b')]);}})[_0xed2c('0x16')](respondWithStatusCode(_0x3352e7,null))[_0xed2c('0x1f')](handleError(_0x3352e7,null));};exports['addLogo']=function(_0x2562e3,_0x61960f){_0x2562e3['body'][_0xed2c('0x60')]=_0x2562e3[_0xed2c('0x61')][_0xed2c('0x62')];return db[_0xed2c('0x31')][_0xed2c('0x4e')]({'where':{'id':_0x2562e3['params']['id']}})[_0xed2c('0x16')](handleEntityNotFound(_0x61960f,null))[_0xed2c('0x16')](saveUpdates(_0x2562e3[_0xed2c('0x4a')],null))[_0xed2c('0x16')](respondWithResult(_0x61960f,null))['catch'](handleError(_0x61960f,null));};exports['addAvatar']=function(_0x4b3b81,_0x5e1440){_0x4b3b81[_0xed2c('0x4a')][_0xed2c('0x63')]=_0x4b3b81[_0xed2c('0x61')][_0xed2c('0x62')];return db['ChatWebsite'][_0xed2c('0x4e')]({'where':{'id':_0x4b3b81[_0xed2c('0x46')]['id']}})[_0xed2c('0x16')](handleEntityNotFound(_0x5e1440,null))[_0xed2c('0x16')](saveUpdates(_0x4b3b81[_0xed2c('0x4a')],null))[_0xed2c('0x16')](respondWithResult(_0x5e1440,null))[_0xed2c('0x1f')](handleError(_0x5e1440,null));};exports['addCustomerAvatar']=function(_0x31fefb,_0x906449){_0x31fefb[_0xed2c('0x4a')][_0xed2c('0x64')]=_0x31fefb[_0xed2c('0x61')][_0xed2c('0x62')];return db[_0xed2c('0x31')]['find']({'where':{'id':_0x31fefb[_0xed2c('0x46')]['id']}})[_0xed2c('0x16')](handleEntityNotFound(_0x906449,null))[_0xed2c('0x16')](saveUpdates(_0x31fefb[_0xed2c('0x4a')],null))['then'](respondWithResult(_0x906449,null))[_0xed2c('0x1f')](handleError(_0x906449,null));};exports[_0xed2c('0x65')]=function(_0x4520db,_0x1b92ab){_0x4520db[_0xed2c('0x4a')]['systemAvatar']=_0x4520db[_0xed2c('0x61')][_0xed2c('0x62')];return db[_0xed2c('0x31')]['find']({'where':{'id':_0x4520db['params']['id']}})[_0xed2c('0x16')](handleEntityNotFound(_0x1b92ab,null))[_0xed2c('0x16')](saveUpdates(_0x4520db[_0xed2c('0x4a')],null))['then'](respondWithResult(_0x1b92ab,null))[_0xed2c('0x1f')](handleError(_0x1b92ab,null));};exports[_0xed2c('0x66')]=function(_0xc55ed8,_0xab8ab1){var _0x20d65c=path['join'](config[_0xed2c('0x67')],'server/files/images/logos/default_logo.svg');var _0xb39d5b={'where':{'id':_0xc55ed8[_0xed2c('0x46')]['id']},'attributes':['id',_0xed2c('0x60')],'raw':!![]};var _0x3cc498=![];return require(_0xed2c('0x68'))[_0xed2c('0x69')]()[_0xed2c('0x16')](function(_0x1c2a77){if(_0x1c2a77){_0x3cc498=_0x1c2a77[_0xed2c('0x6a')];}})[_0xed2c('0x16')](function(){return db[_0xed2c('0x31')][_0xed2c('0x4e')](_0xb39d5b);})[_0xed2c('0x16')](handleEntityNotFound(_0xab8ab1,null))['then'](function(_0x5ce687){if(_0x5ce687){if(!_[_0xed2c('0x6b')](_0x5ce687[_0xed2c('0x60')])){if(fs[_0xed2c('0x6c')](path[_0xed2c('0x6d')](config[_0xed2c('0x67')],_0xed2c('0x6e'),_0x5ce687[_0xed2c('0x60')]))&&_0x3cc498){_0x20d65c=path[_0xed2c('0x6d')](config[_0xed2c('0x67')],_0xed2c('0x6e'),_0x5ce687[_0xed2c('0x60')]);}}return _0xab8ab1[_0xed2c('0x6f')](_0x20d65c);}})[_0xed2c('0x1f')](handleError(_0xab8ab1,null));};exports['getAvatar']=function(_0x2ccda7,_0x250b37){var _0x1e18a7=path[_0xed2c('0x6d')](config['root'],_0xed2c('0x70'));var _0x2e5266={'where':{'id':_0x2ccda7['params']['id']},'attributes':['id',_0xed2c('0x63')],'raw':!![]};return db['ChatWebsite'][_0xed2c('0x4e')](_0x2e5266)[_0xed2c('0x16')](handleEntityNotFound(_0x250b37,null))[_0xed2c('0x16')](function(_0x2fb96b){if(_0x2fb96b){if(!_[_0xed2c('0x6b')](_0x2fb96b['agentAvatar'])){if(fs['existsSync'](path[_0xed2c('0x6d')](config['root'],_0xed2c('0x71'),_0x2fb96b[_0xed2c('0x63')]))){_0x1e18a7=path[_0xed2c('0x6d')](config[_0xed2c('0x67')],_0xed2c('0x71'),_0x2fb96b['agentAvatar']);}}return _0x250b37[_0xed2c('0x6f')](_0x1e18a7);}})['catch'](handleError(_0x250b37,null));};exports[_0xed2c('0x72')]=function(_0x3b78e4,_0x5644c2){var _0x966824=path[_0xed2c('0x6d')](config['root'],_0xed2c('0x73'));var _0x501dca={'where':{'id':_0x3b78e4['params']['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0xed2c('0x31')][_0xed2c('0x4e')](_0x501dca)[_0xed2c('0x16')](handleEntityNotFound(_0x5644c2,null))[_0xed2c('0x16')](function(_0x57f876){if(_0x57f876){if(!_['isNil'](_0x57f876[_0xed2c('0x64')])){if(fs['existsSync'](path[_0xed2c('0x6d')](config[_0xed2c('0x67')],_0xed2c('0x71'),_0x57f876[_0xed2c('0x64')]))&&_0x57f876[_0xed2c('0x74')]){_0x966824=path[_0xed2c('0x6d')](config[_0xed2c('0x67')],'server/files/images/avatars/',_0x57f876[_0xed2c('0x64')]);}}return _0x5644c2[_0xed2c('0x6f')](_0x966824);}})[_0xed2c('0x1f')](handleError(_0x5644c2,null));};exports['getSystemAvatar']=function(_0x270150,_0x52a2de){var _0x446d53=path[_0xed2c('0x6d')](config[_0xed2c('0x67')],_0xed2c('0x75'));var _0x3fab0c={'where':{'id':_0x270150[_0xed2c('0x46')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xed2c('0x31')][_0xed2c('0x4e')](_0x3fab0c)[_0xed2c('0x16')](handleEntityNotFound(_0x52a2de,null))['then'](function(_0x5a8652){if(_0x5a8652){if(!_['isNil'](_0x5a8652[_0xed2c('0x76')])){if(fs[_0xed2c('0x6c')](path[_0xed2c('0x6d')](config[_0xed2c('0x67')],_0xed2c('0x71'),_0x5a8652[_0xed2c('0x76')]))){_0x446d53=path['join'](config[_0xed2c('0x67')],_0xed2c('0x71'),_0x5a8652[_0xed2c('0x76')]);}}return _0x52a2de[_0xed2c('0x6f')](_0x446d53);}})['catch'](handleError(_0x52a2de,null));};exports[_0xed2c('0x77')]=function(_0x2b69d8,_0x17be26){var _0x1eb252=require('user-agent-parser');var _0x4033aa=new _0x1eb252();var _0x288ec1=_0x4033aa[_0xed2c('0x78')](_0x2b69d8[_0xed2c('0x79')][_0xed2c('0x7a')])[_0xed2c('0x7b')]();var _0xe00116={'body':_0x2b69d8['body'],'channel':_0xed2c('0x7c')};var _0x5a73ac=[];var _0x3cf43a=[];var _0x34eea9={};var _0x5832de=![];return db[_0xed2c('0x7d')][_0xed2c('0x51')]()[_0xed2c('0x16')](function(_0x4001f2){if(!_0x4001f2){throw new db['Sequelize']['ValidationError'](_0xed2c('0x7e'));}_0x5a73ac=_[_0xed2c('0x7f')](_[_0xed2c('0x37')](_0x4001f2),[_0xed2c('0x80'),'updatedAt']);_0x3cf43a=_[_0xed2c('0x7f')](_[_0xed2c('0x37')](_0x4001f2),[_0xed2c('0x80'),_0xed2c('0x81'),'CompanyId',_0xed2c('0x82')]);if(_0x2b69d8[_0xed2c('0x4a')]['id']){delete _0x2b69d8[_0xed2c('0x4a')]['id'];}if(_[_0xed2c('0x6b')](_0x2b69d8[_0xed2c('0x4a')]['from'])){throw new db[(_0xed2c('0x83'))][(_0xed2c('0x84'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x2b69d8[_0xed2c('0x4a')][_0xed2c('0x4a')])||_0x2b69d8[_0xed2c('0x4a')][_0xed2c('0x4a')]===''){throw new db[(_0xed2c('0x83'))][(_0xed2c('0x84'))](_0xed2c('0x85'));}if(_[_0xed2c('0x6b')](_0x2b69d8[_0xed2c('0x4a')]['mapKey'])){throw new db[(_0xed2c('0x83'))][(_0xed2c('0x84'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3cf43a);}if(!_['includes'](_0x3cf43a,_0x2b69d8[_0xed2c('0x4a')][_0xed2c('0x86')])){throw new db['Sequelize'][(_0xed2c('0x84'))](_0xed2c('0x87')+_0x3cf43a);}_0x34eea9[_0x2b69d8['body'][_0xed2c('0x86')]]=_0x2b69d8[_0xed2c('0x4a')]['from'];})[_0xed2c('0x16')](function(){return db[_0xed2c('0x31')][_0xed2c('0x4e')]({'where':{'id':_0x2b69d8[_0xed2c('0x46')]['id']},'include':[{'model':db[_0xed2c('0x88')],'as':_0xed2c('0x89'),'include':[{'model':db[_0xed2c('0x7d')],'as':_0xed2c('0x8a'),'where':_0x34eea9,'limit':0x1,'order':[[_0xed2c('0x81'),'DESC']]}]},{'model':db[_0xed2c('0x8b')],'as':_0xed2c('0x8c')}]});})[_0xed2c('0x16')](handleEntityNotFound(_0x17be26,null))[_0xed2c('0x16')](function(_0x2ff81d){if(_0x2ff81d&&_0x2ff81d[_0xed2c('0x89')]){_0xe00116['account']=_0x2ff81d;_0xe00116['applications']=_0x2ff81d['Applications'];_0xe00116[_0xed2c('0x8d')]=_0x2ff81d[_0xed2c('0x89')];_0xe00116[_0xed2c('0x8e')]=_[_0xed2c('0x8f')](_0xe00116[_0xed2c('0x8e')],[_0xed2c('0x90')],[_0xed2c('0x91')]);if(_0xe00116[_0xed2c('0x92')][_0xed2c('0x8c')]){delete _0xe00116[_0xed2c('0x92')][_0xed2c('0x8c')];}if(_0xe00116[_0xed2c('0x92')][_0xed2c('0x89')]&&_0xe00116[_0xed2c('0x92')][_0xed2c('0x89')][_0xed2c('0x8a')][_0xed2c('0x3c')]){return _0xe00116[_0xed2c('0x92')][_0xed2c('0x89')][_0xed2c('0x8a')][0x0];}var _0x2fb00d=_[_0xed2c('0xe')](_0x2b69d8[_0xed2c('0x4a')],{'firstName':_0x2b69d8['body'][_0xed2c('0x93')],'ListId':_0x2ff81d[_0xed2c('0x82')]});_0x2fb00d[_0x2b69d8[_0xed2c('0x4a')][_0xed2c('0x86')]]=_0x2b69d8['body']['from'];return db[_0xed2c('0x7d')][_0xed2c('0x49')](_0x2fb00d,{'fields':_0x5a73ac,'raw':!![]});}})['then'](handleEntityNotFound(_0x17be26,null))[_0xed2c('0x16')](function(_0x2cdfd3){_0xe00116[_0xed2c('0x94')]=_0x2cdfd3;var _0x5e86d5=_0x2b69d8['body']['customerIp'];if(_0x2b69d8[_0xed2c('0x79')]['cf-connecting-ip']){_0x5e86d5=_0x2b69d8[_0xed2c('0x79')][_0xed2c('0x95')];}else if(_0x2b69d8[_0xed2c('0x79')]['x-forwarded-for']){_0x5e86d5=_['first'](_0x2b69d8['headers'][_0xed2c('0x96')][_0xed2c('0x97')](','));}if(_0x2cdfd3){var _0x837254={'ContactId':_0x2cdfd3['id'],'ChatWebsiteId':_0x2b69d8[_0xed2c('0x46')]['id'],'from':(_0x2cdfd3[_0xed2c('0x98')]||'')+'\x20'+(_0x2cdfd3[_0xed2c('0x99')]||''),'customerIp':_0x5e86d5,'customerPort':_0x2b69d8[_0xed2c('0x79')][_0xed2c('0x9a')]?_0x2b69d8[_0xed2c('0x79')][_0xed2c('0x9a')]:null,'referer':_0x2b69d8['body']['referer'],'browserName':_0x288ec1[_0xed2c('0x9b')][_0xed2c('0x2d')]&&_0x288ec1[_0xed2c('0x9b')][_0xed2c('0x9c')]?util['format'](_0xed2c('0x9d'),_0x288ec1[_0xed2c('0x9b')][_0xed2c('0x2d')],_0x288ec1[_0xed2c('0x9b')][_0xed2c('0x9c')]):_0xed2c('0x9e'),'browserVersion':_0x288ec1[_0xed2c('0x9b')][_0xed2c('0x9c')]||'unknown','osName':util[_0xed2c('0x9f')](_0xed2c('0x9d'),_0x288ec1['os']['name'],_0x288ec1['os'][_0xed2c('0x9c')]),'osVersion':_0x288ec1['os'][_0xed2c('0x9c')],'deviceModel':_0x288ec1[_0xed2c('0xa0')][_0xed2c('0x35')]&&_0x288ec1[_0xed2c('0xa0')][_0xed2c('0xa1')]?util[_0xed2c('0x9f')](_0xed2c('0xa2'),_0x288ec1[_0xed2c('0xa0')][_0xed2c('0x35')],_0x288ec1[_0xed2c('0xa0')][_0xed2c('0xa1')],_0x288ec1['device'][_0xed2c('0x34')]):null,'deviceVendor':_0x288ec1[_0xed2c('0xa0')][_0xed2c('0xa1')],'deviceType':_0x288ec1[_0xed2c('0xa0')][_0xed2c('0x34')],'formData':JSON[_0xed2c('0xa3')](_0x2b69d8[_0xed2c('0x4a')])};var _0x1aa150={'ChatWebsiteId':_0x2b69d8[_0xed2c('0x46')]['id'],'closed':![]};if(_0x2b69d8['body'][_0xed2c('0xa4')]){_0x1aa150[_0xed2c('0xa4')]=_0x2b69d8[_0xed2c('0x4a')][_0xed2c('0xa4')];return db[_0xed2c('0xa5')][_0xed2c('0x4e')]({'where':_0x1aa150})[_0xed2c('0x16')](function(_0x5e78b8){if(_0x5e78b8){return[_0x5e78b8,![]];}_0x837254[_0xed2c('0xa4')]=_0x2b69d8[_0xed2c('0x4a')][_0xed2c('0xa4')];_0x837254[_0xed2c('0xa6')]=_0x2b69d8[_0xed2c('0x4a')][_0xed2c('0xa6')];return db[_0xed2c('0xa5')][_0xed2c('0x49')](_0x837254)['then'](function(_0x4dca4a){return[_0x4dca4a,!![]];});});}_0x1aa150[_0xed2c('0xa7')]=_0x2cdfd3['id'];if(_0x2b69d8[_0xed2c('0x4a')][_0xed2c('0xa8')]&&_0x2b69d8[_0xed2c('0x4a')][_0xed2c('0xa8')]['id']){_0x1aa150['id']=_0x2b69d8[_0xed2c('0x4a')]['interaction']['id'];return db['ChatInteraction'][_0xed2c('0x4e')]({'where':_0x1aa150})['then'](function(_0x32708d){if(_0x32708d){return[_0x32708d,![]];}return db[_0xed2c('0xa5')]['create'](_0x837254)[_0xed2c('0x16')](function(_0x247c6b){return[_0x247c6b,!![]];});});}return db['ChatInteraction'][_0xed2c('0x49')](_0x837254)[_0xed2c('0x16')](function(_0xe0dcc0){return[_0xe0dcc0,!![]];});}})[_0xed2c('0xa9')](function(_0x496fb7,_0x3bf42f){if(_0x496fb7){_0x5832de=_0x3bf42f;if(!_0x3bf42f){var _0x2d0381={'from':(_0xe00116[_0xed2c('0x94')][_0xed2c('0x98')]||'')+'\x20'+(_0xe00116[_0xed2c('0x94')][_0xed2c('0x99')]||'')};if(_0x2b69d8[_0xed2c('0x4a')]['threadId']&&_0x2b69d8[_0xed2c('0x4a')][_0xed2c('0xaa')]&&_0x2b69d8[_0xed2c('0x4a')][_0xed2c('0xa4')]!=_0x2b69d8[_0xed2c('0x4a')][_0xed2c('0xaa')]){_0x2d0381[_0xed2c('0xa4')]=_0x2b69d8[_0xed2c('0x4a')][_0xed2c('0xaa')];}return _0x496fb7['update'](_0x2d0381);}else{return _0x496fb7;}}})[_0xed2c('0x16')](function(_0x43c627){_0xe00116[_0xed2c('0xa8')]=_0x43c627[_0xed2c('0x4b')]({'plain':!![]});_0xe00116[_0xed2c('0xa8')][_0xed2c('0xab')]=_0x5832de;if(_0xe00116[_0xed2c('0xa8')]['created']){if(_0xe00116[_0xed2c('0x92')][_0xed2c('0xac')]){_0xe00116['applications'][_0xed2c('0xad')]({'id':0x0,'priority':_0xe00116[_0xed2c('0x8e')][_0xed2c('0x3c')]+0x1,'app':_0xed2c('0xae'),'appdata':_0xed2c('0xaf'),'interval':_0xed2c('0xb0')});}}return db[_0xed2c('0xb1')][_0xed2c('0x49')]({'body':_0x2b69d8[_0xed2c('0x4a')][_0xed2c('0x4a')],'ChatWebsiteId':_0x2b69d8['params']['id'],'ChatInteractionId':_0x43c627['id'],'direction':'in','ContactId':_0xe00116[_0xed2c('0x94')]['id'],'AttachmentId':_0x2b69d8['body'][_0xed2c('0xb2')]});})[_0xed2c('0x16')](function(_0x3fd0da){_0xe00116['message']=_0x3fd0da;if(_0xe00116['interaction'][_0xed2c('0xb3')]){return db[_0xed2c('0xb4')][_0xed2c('0x4e')]({'attributes':['id',_0xed2c('0x2d')],'where':{'id':_0xe00116['interaction'][_0xed2c('0xb3')]}})[_0xed2c('0x16')](function(_0x1a8d6f){if(_0x1a8d6f){_0xe00116[_0xed2c('0x8e')][_0xed2c('0xb5')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1a8d6f[_0xed2c('0x2d')]+','+(_0xe00116['account'][_0xed2c('0xb6')]||0xa),'interval':_0xed2c('0xb0')});_0xe00116['forcedOwnership']=!![];}return respondWithRpcPromise(_0xed2c('0xb7'),_0xed2c('0xb8'),_0xe00116);});}return respondWithRpcPromise(_0xed2c('0xb7'),_0xed2c('0xb8'),_0xe00116);})['then'](function(_0x254f31){respondWithRpcPromise(_0xed2c('0xb9'),'EventManager',{'event':_0xed2c('0x77'),'message':_0x254f31},client9002);return _0x254f31;})[_0xed2c('0x16')](respondWithResult(_0x17be26,null))[_0xed2c('0x1f')](handleError(_0x17be26,null));};exports[_0xed2c('0xba')]=function(_0x2da941,_0x3c5da6){var _0x118e22,_0x17426a,_0x382b79;var _0x2e94bb=[];var _0x481aa5={};var _0x4a2ae4=_0x2da941[_0xed2c('0xbb')]||[];var _0x449f20=[];var _0x410c3a;return db[_0xed2c('0x7d')][_0xed2c('0x51')]()['then'](function(_0x264689){if(!_0x264689){throw new db[(_0xed2c('0x83'))][(_0xed2c('0x84'))]('no\x20available\x20attributes');}_0x2e94bb=_[_0xed2c('0x7f')](_[_0xed2c('0x37')](_0x264689),[_0xed2c('0x80'),_0xed2c('0x81'),_0xed2c('0xbc'),_0xed2c('0x82')]);if(_0x2da941['body']['id']){delete _0x2da941[_0xed2c('0x4a')]['id'];}if(_[_0xed2c('0x6b')](_0x2da941['body'][_0xed2c('0x93')])){throw _0x3c5da6[_0xed2c('0x21')](0x1f4)[_0xed2c('0xbd')](new db['Sequelize'][(_0xed2c('0x84'))]('from\x20is\x20mandatory'));}if(_[_0xed2c('0x6b')](_0x2da941[_0xed2c('0x4a')][_0xed2c('0x4a')])||_0x2da941['body'][_0xed2c('0x4a')]===''){throw _0x3c5da6[_0xed2c('0x21')](0x1f4)[_0xed2c('0xbd')](new db[(_0xed2c('0x83'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xed2c('0x6b')](_0x2da941['body'][_0xed2c('0xbe')])){throw _0x3c5da6[_0xed2c('0x21')](0x1f4)[_0xed2c('0xbd')](new db['Sequelize'][(_0xed2c('0x84'))](_0xed2c('0xbf')+_0x2e94bb));}if(!_[_0xed2c('0xc0')](_0x2e94bb,_0x2da941[_0xed2c('0x4a')][_0xed2c('0xbe')])){throw _0x3c5da6[_0xed2c('0x21')](0x1f4)[_0xed2c('0xbd')](new db['Sequelize']['ValidationError'](_0xed2c('0xc1')+_0x2e94bb));}_0x481aa5[_0x2da941[_0xed2c('0x4a')][_0xed2c('0xbe')]]=_0x2da941[_0xed2c('0x4a')]['from'];})[_0xed2c('0x16')](function(){return db[_0xed2c('0x31')][_0xed2c('0x4e')]({'where':{'id':_0x2da941[_0xed2c('0x46')]['id']},'include':[{'model':db[_0xed2c('0x88')],'as':_0xed2c('0x89')},{'model':db[_0xed2c('0xc2')],'as':_0xed2c('0xc2')}]});})[_0xed2c('0x16')](handleEntityNotFound(_0x3c5da6,null))[_0xed2c('0x16')](function(_0x39b165){if(_0x39b165&&_0x39b165[_0xed2c('0x89')]){_0x17426a=_0x39b165;var _0x16b357=_[_0xed2c('0xe')](_0x2da941[_0xed2c('0x4a')],{'firstName':_0x2da941['body'][_0xed2c('0x93')],'phone':_0x2da941[_0xed2c('0x4a')]['from'],'ListId':_0x39b165[_0xed2c('0x82')]});_0x16b357[_0x2da941[_0xed2c('0x4a')][_0xed2c('0xbe')]]=_0x2da941[_0xed2c('0x4a')][_0xed2c('0x93')];return db[_0xed2c('0x7d')]['findOrCreate']({'where':_0x481aa5,'defaults':_0x16b357});}})[_0xed2c('0xa9')](function(_0x36da32){if(_0x36da32){_0x382b79=_0x36da32;var _0x4781e4=fs['readFileSync'](path['join'](config[_0xed2c('0x67')],_0xed2c('0xc3')),'utf8');var _0x4cc773=ejs[_0xed2c('0xc4')](_0x4781e4,{'body':_[_0xed2c('0xc5')](_0x2da941[_0xed2c('0x4a')]['body']),'bodyTitle':_0x17426a['offlineMessageBody']});return db[_0xed2c('0xc6')][_0xed2c('0x49')]({'body':_0x4cc773,'plainBody':htmlToText['fromString'](_0x4cc773),'ContactId':_0x36da32['id'],'ChatWebsiteId':_0x17426a['id']});}})[_0xed2c('0x16')](function(_0x53c6d2){_0x410c3a=_0x53c6d2;if(_0x4a2ae4[_0xed2c('0x3c')]){var _0x12aa08=_0x4a2ae4['map'](function(_0x212293){return{'name':_0x212293[_0xed2c('0xc7')],'basename':_0x212293['filename'],'type':_0x212293[_0xed2c('0xc8')],'ChatOfflineMessageId':_0x53c6d2['id']};});_0x449f20=_0x12aa08[_0xed2c('0x57')](_0x4e5dff=>{var _0x43cdab={'filename':_0x4e5dff[_0xed2c('0x2d')],'path':path[_0xed2c('0x6d')](config[_0xed2c('0x67')],_0xed2c('0xc9'),'files',_0xed2c('0xca'),'offline-chat',_0x4e5dff[_0xed2c('0xcb')])};return _0x43cdab;});if(!_0x17426a[_0xed2c('0xcc')]){return db[_0xed2c('0xcd')][_0xed2c('0xce')](function(_0x5126b4){return db[_0xed2c('0xcf')][_0xed2c('0xd0')](_0x12aa08,{'transaction':_0x5126b4});});}}})[_0xed2c('0x16')](function(){if(_0x410c3a){_0x118e22=_0x410c3a;return db[_0xed2c('0xc2')][_0xed2c('0x54')]({'where':{'active':!![]},'include':[{'model':db[_0xed2c('0xd1')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xed2c('0xd2'),'raw':!![]}]}]});}})[_0xed2c('0x16')](function(_0x4ac39d){if(_0x4ac39d&&_0x4ac39d[_0xed2c('0xd3')]&&_0x17426a[_0xed2c('0xd4')]&&_0x17426a[_0xed2c('0xd5')]){var _0xe2266f=_0x4ac39d[_0xed2c('0xd6')]();return respondWithRpcPromise(_0xed2c('0xd7'),_0xed2c('0xd8'),{'account':_0xe2266f,'message':{'from':util[_0xed2c('0x9f')](_0xed2c('0xd9'),_0x4ac39d[_0xed2c('0x2d')],_0x4ac39d['email']||_0x4ac39d[_0xed2c('0xd3')][_0xed2c('0xda')]),'to':_0x17426a[_0xed2c('0xd5')],'subject':_0x17426a['offlineMessageSubject'],'html':_0x118e22[_0xed2c('0x4a')],'attachments':_0x449f20}},client9003)[_0xed2c('0x16')](function(){return _0x118e22;})[_0xed2c('0x1f')](function(_0x21743d){logger['error'](_0x21743d);});}})[_0xed2c('0x16')](function(){if(_0x17426a&&_0x17426a[_0xed2c('0xcc')]&&_0x17426a[_0xed2c('0xdb')]){var _0x13aeb1=[];if(_0x4a2ae4['length']){_0x13aeb1=_0x4a2ae4['map'](function(_0x50bdb2){return{'name':_0x50bdb2[_0xed2c('0xc7')],'basename':_0x50bdb2[_0xed2c('0x62')],'type':_0x50bdb2[_0xed2c('0xc8')],'ChatOfflineMessageId':_0x410c3a['id']};});}var _0x3ad984;if(!_[_0xed2c('0x6b')](_0x17426a[_0xed2c('0xdc')])){var _0x18a516=_[_0xed2c('0x57')](_0x2da941[_0xed2c('0x4a')],function(_0x4d20ef){return _0x4d20ef;});var _0x1ebabd=_[_0xed2c('0xdd')](_0x18a516)[0x0];var _0x40abfe=_[_0xed2c('0xde')](_0x1ebabd,function(_0x24ebed){return _0x24ebed;});_0x3ad984=_0x40abfe[0x1][_0x17426a[_0xed2c('0xdc')]];}var _0x556247={'from':_0x382b79[_0xed2c('0xdf')],'firstName':_0x382b79[_0xed2c('0x98')],'lastName':_0x382b79[_0xed2c('0x99')],'mapKey':_0xed2c('0xdf'),'message':{'from':_0x382b79[_0xed2c('0xdf')],'to':_0x17426a[_0xed2c('0xc2')][_0xed2c('0xdf')],'cc':'','subject':_[_0xed2c('0x6b')](_0x3ad984)?_0x17426a[_0xed2c('0xe0')]:_0x3ad984,'messageId':'','sentAt':new Date(),'attach':_0x13aeb1[_0xed2c('0x3c')],'attachments':_0x13aeb1,'originChannel':_0xed2c('0xe1'),'ChatWebsiteId':_0x17426a['id'],'ChatOfflineMessageId':_0x118e22['id'],'originTo':_0x17426a[_0xed2c('0xc2')]['email']},'body':_0x118e22[_0xed2c('0x4a')]};var _0x55fb88={'account':{'id':_0x17426a[_0xed2c('0xdb')]},'body':_0x556247,'log':_0xed2c('0xe2')};return respondWithRpcPromise(_0xed2c('0xe2'),_0xed2c('0xe3'),_0x55fb88,client9001)[_0xed2c('0x16')](function(){return _0x118e22;})[_0xed2c('0x1f')](function(_0x2ef5f5){logger['error'](_0x2ef5f5);});}return;})['then'](function(){if(_0x118e22){return _0x118e22;}})['then'](respondWithResult(_0x3c5da6,null))[_0xed2c('0x1f')](function(_0x34ea16){logger[_0xed2c('0x1a')](_0xed2c('0x1f'),_0x34ea16);for(var _0x53b6fc of _0x4a2ae4){var _0xa6048a=path[_0xed2c('0x6d')](config[_0xed2c('0x67')],_0xed2c('0xc9'),_0xed2c('0xbb'),'attachments',_0xed2c('0xe4'),_0x53b6fc[_0xed2c('0x62')]);fs_extra[_0xed2c('0xe5')](_0xa6048a)[_0xed2c('0x1f')](function(_0x5ea21a){logger[_0xed2c('0x1a')](_0xed2c('0xe6'),_0xa6048a,_0x5ea21a);});}});};exports[_0xed2c('0xe7')]=function(_0x1dc313,_0x492558){return db[_0xed2c('0xa5')]['find']({'where':{'id':_0x1dc313[_0xed2c('0x46')]['id']}})[_0xed2c('0x16')](handleEntityNotFound(_0x492558,null))[_0xed2c('0x16')](function(_0x46f6d5){if(_0x46f6d5){return _0x46f6d5[_0xed2c('0xe7')](_0x1dc313['body'][_0xed2c('0x5b')],_[_0xed2c('0xe8')](_0x1dc313[_0xed2c('0x4a')],[_0xed2c('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x492558,null))[_0xed2c('0x1f')](handleError(_0x492558,null));};exports[_0xed2c('0xe9')]=function(_0x4cf396,_0x1c7787){var _0x452817={'raw':![],'where':{}};var _0x178b48={};var _0x4ae2d2={'count':0x0,'rows':[]};return db[_0xed2c('0x31')]['findOne']({'where':{'id':_0x4cf396[_0xed2c('0x46')]['id']}})[_0xed2c('0x16')](handleEntityNotFound(_0x1c7787,null))[_0xed2c('0x16')](function(_0xe09e6b){if(_0xe09e6b){_0x178b48[_0xed2c('0x35')]=_['keys'](db['ChatInteraction'][_0xed2c('0x32')]);_0x178b48['query']=_[_0xed2c('0x37')](_0x4cf396[_0xed2c('0x36')]);_0x178b48['filters']=_[_0xed2c('0x39')](_0x178b48['model'],_0x178b48['query']);_0x452817['attributes']=_[_0xed2c('0x39')](_0x178b48[_0xed2c('0x35')],qs['fields'](_0x4cf396['query'][_0xed2c('0x3b')]));_0x452817['attributes']=_0x452817['attributes']['length']?_0x452817['attributes']:_0x178b48[_0xed2c('0x35')];if(!_0x4cf396['query'][_0xed2c('0x3d')](_0xed2c('0x55'))){_0x452817[_0xed2c('0x25')]=qs[_0xed2c('0x25')](_0x4cf396['query']['limit']);_0x452817[_0xed2c('0x24')]=qs['offset'](_0x4cf396[_0xed2c('0x36')]['offset']);}_0x452817[_0xed2c('0x56')]=qs[_0xed2c('0x3e')](_0x4cf396[_0xed2c('0x36')]['sort']);_0x452817[_0xed2c('0x41')]=qs[_0xed2c('0x38')](_[_0xed2c('0x3f')](_0x4cf396['query'],_0x178b48['filters']));_0x452817[_0xed2c('0x41')][_0xed2c('0x53')]=_0xe09e6b['id'];if(_0x4cf396[_0xed2c('0x36')][_0xed2c('0x40')]){_0x452817[_0xed2c('0x41')]=_[_0xed2c('0x42')](_0x452817[_0xed2c('0x41')],{'$or':_[_0xed2c('0x57')](_0x452817['attributes'],function(_0x5968fd){var _0x2005ed={};_0x2005ed[_0x5968fd]={'$like':'%'+_0x4cf396[_0xed2c('0x36')][_0xed2c('0x40')]+'%'};return _0x2005ed;})});}_0x452817=_[_0xed2c('0x42')]({},_0x452817,_0x4cf396[_0xed2c('0x48')]);return db[_0xed2c('0xa5')]['count']({'where':_0x452817[_0xed2c('0x41')]})[_0xed2c('0x16')](function(_0x37d466){_0x4ae2d2['count']=_0x37d466;if(_0x4cf396[_0xed2c('0x36')]['includeAll']){_0x452817['include']=[{'model':db[_0xed2c('0x7d')],'as':_0xed2c('0xea'),'required':![]},{'model':db[_0xed2c('0xb4')],'as':_0xed2c('0xeb'),'attributes':[_0xed2c('0x2d'),_0xed2c('0xec'),_0xed2c('0xed')],'required':![]},{'model':db[_0xed2c('0xee')],'as':_0xed2c('0xef'),'attributes':['id',_0xed2c('0x2d'),_0xed2c('0xf0')],'where':_0x4cf396[_0xed2c('0x36')][_0xed2c('0xf1')]?{'id':_0x4cf396[_0xed2c('0x36')]['tag']}:undefined,'required':_0x4cf396['query'][_0xed2c('0xf1')]?!![]:![]}];}return db[_0xed2c('0xa5')][_0xed2c('0x44')](_0x452817);})[_0xed2c('0x16')](function(_0x335854){_0x4ae2d2[_0xed2c('0x59')]=_0x335854;return _0x4ae2d2;});}})[_0xed2c('0x16')](respondWithFilteredResult(_0x1c7787,_0x452817))[_0xed2c('0x1f')](handleError(_0x1c7787,null));};function iftimePromise(_0x44926a,_0x2f041c){return respondWithRpcPromise(_0xed2c('0xf2'),_0xed2c('0xf3'),{'command':_0x2f041c[_0xed2c('0xf4')]?util[_0xed2c('0x9f')](_0xed2c('0xf5'),_0x44926a['interval'],_0x2f041c['timezone']):util[_0xed2c('0x9f')](_0xed2c('0xf6'),_0x44926a[_0xed2c('0xf7')])},client9002)['then'](function(_0x3ee60f){var _0x1a9c7d=_0x3ee60f&&_0x3ee60f[_0xed2c('0xf8')](_0xed2c('0xf9'))>=0x0?!![]:![];logger[_0xed2c('0x17')](_0xed2c('0xfa'),_0x2f041c['id'],_0x44926a['id'],_0x44926a[_0xed2c('0xf7')],_0x1a9c7d?_0xed2c('0xfb'):'OFFLINE',_0x2f041c['timezone']?_0x2f041c[_0xed2c('0xf4')]:_0xed2c('0xfc'));return _0x1a9c7d;})['catch'](function(_0x4527b6){logger['error'](_0xed2c('0xfa'),_0x2f041c['id'],_0x44926a['id'],_0x44926a[_0xed2c('0xf7')],util['inspect'](_0x4527b6,{'showHidden':![],'depth':null}),_0x2f041c[_0xed2c('0xf4')]?_0x2f041c['timezone']:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x2b1b34,_0x2385ea){var _0x1f6c3b=0x0;var _0x3d199b=0x0;var _0x50212f=![];var _0x433510;var _0x2c1636;return db[_0xed2c('0x31')]['find']({'where':{'id':_0x2b1b34[_0xed2c('0x46')]['id']},'include':[{'model':db[_0xed2c('0xfd')],'as':_0xed2c('0xfd'),'include':[{'model':db[_0xed2c('0xfd')],'as':'Intervals','attributes':['id',_0xed2c('0xf7')],'raw':!![]}]}]})[_0xed2c('0x16')](handleEntityNotFound(_0x2385ea,null))[_0xed2c('0x16')](function(_0x5b25d6){if(_0x5b25d6){_0x433510=_0x5b25d6;return _0x5b25d6[_0xed2c('0xfe')]({'raw':!![]});}})[_0xed2c('0x16')](function(_0x4a1cd4){if(_0x433510){if(_0x4a1cd4){_0x2c1636=_0x4a1cd4;}}return require(_0xed2c('0x68'))[_0xed2c('0x69')]();})[_0xed2c('0x16')](function(_0x36dc63){if(_0x36dc63){_0x3d199b=_0x36dc63[_0xed2c('0xff')];_0x50212f=_0x36dc63[_0xed2c('0x6a')];}})['then'](function(){return db['ChatInteraction'][_0xed2c('0x27')]({'where':{'closed':![]}});})[_0xed2c('0x16')](function(_0x56e392){_0x1f6c3b=_0x56e392;if(_0x3d199b&&_0x56e392>_0x3d199b){return db[_0xed2c('0x100')][_0xed2c('0x54')]({'where':{'id':0x1}})[_0xed2c('0x16')](function(_0x2ed30f){if(_0x2ed30f){_0x2ed30f[_0xed2c('0x101')](_0xed2c('0x102'));}});}})['then'](function(){if(_0x433510[_0xed2c('0xfd')]&&_0x433510[_0xed2c('0xfd')][_0xed2c('0x103')]){var _0x30d1c9=[];for(var _0x29e3f2=0x0;_0x29e3f2<_0x433510[_0xed2c('0xfd')][_0xed2c('0x103')][_0xed2c('0x3c')];_0x29e3f2++){var _0x3259a2=_0x433510[_0xed2c('0xfd')]['Intervals'][_0x29e3f2][_0xed2c('0x4b')]({'plain':!![]});_0x30d1c9[_0xed2c('0xad')](iftimePromise(_0x3259a2,_0x433510));}return BPromise[_0xed2c('0x104')](_0x30d1c9)['then'](function(_0x2ecc7e){return _[_0xed2c('0x105')](_0x2ecc7e);});}else{return!![];}})['then'](function(_0x3cafe6){var _0x20039a=fs[_0xed2c('0x106')](path[_0xed2c('0x6d')](config[_0xed2c('0x67')],'server/files/chat/iframe.ejs'),_0xed2c('0x107'));var _0x987e6b={'remote':_0x433510[_0xed2c('0x108')],'query':querystring[_0xed2c('0xa3')](_[_0xed2c('0x42')](_0x433510[_0xed2c('0x4b')]({'plain':!![]}),{'customerIp':_0x2b1b34[_0xed2c('0x79')][_0xed2c('0x96')]||_0x2b1b34[_0xed2c('0x79')][_0xed2c('0x109')]||_0x2b1b34[_0xed2c('0x10a')][_0xed2c('0x10b')]||_0x2b1b34['ip'],'referer':_0x2b1b34[_0xed2c('0x79')][_0xed2c('0x10c')],'openedInteractions':_0x1f6c3b,'maxInteractions':_0x3d199b,'virtual':_0x50212f[_0xed2c('0xff')],'online':_0x3cafe6,'custom':_0x50212f}))['replace'](/'/g,'\x5c\x27')};_0x2385ea[_0xed2c('0xbd')](ejs[_0xed2c('0xc4')](Mustache[_0xed2c('0xc4')](_0x20039a,_0x987e6b),{'proactiveActions':_0x2c1636,'alignment':_0x433510[_0xed2c('0x10d')],'verticalAlignment':_0x433510[_0xed2c('0x10e')],'div_color':_0x433510[_0xed2c('0xf0')],'labelText':_0x433510[_0xed2c('0x10f')],'text_color':_0x433510['textColor'],'button_color':_0x433510[_0xed2c('0x110')],'background_color':_0x433510[_0xed2c('0x111')],'hideWhenOffline':_0x433510[_0xed2c('0x112')],'interval':_0x433510[_0xed2c('0x113')]}));})[_0xed2c('0x1f')](handleError(_0x2385ea,null));};exports[_0xed2c('0x114')]=function(_0x216084,_0xe52497){var _0x44198a=_0x216084[_0xed2c('0x46')]['id'];var _0x9e2ade=_0x216084[_0xed2c('0x4a')];var _0x2047cb=0xc8;var _0x1f2788=null;return db[_0xed2c('0xcd')][_0xed2c('0xce')]({'isolationLevel':db[_0xed2c('0xcd')]['Transaction']['ISOLATION_LEVELS'][_0xed2c('0x115')]},function(_0x506c48){return db[_0xed2c('0x31')][_0xed2c('0x54')]({'where':{'id':_0x44198a},'transaction':_0x506c48})['then'](function(_0x22ef1c){if(_0x22ef1c){return db[_0xed2c('0x8b')]['destroy']({'where':{'ChatWebsiteId':_0x44198a},'transaction':_0x506c48})['then'](function(){var _0xb30562=_[_0xed2c('0x57')](_0x9e2ade,function(_0x19ef49){_0x19ef49[_0xed2c('0x53')]=_0x44198a;return _0x19ef49;});return db['ChatApplication'][_0xed2c('0xd0')](_0xb30562,{'transaction':_0x506c48});});}else{_0x2047cb=0x194;_0x1f2788=[];}});})[_0xed2c('0x16')](function(){if(_0x2047cb!==0x194){return db[_0xed2c('0x8b')][_0xed2c('0x116')]({'where':{'ChatWebsiteId':_0x44198a},'order':_0xed2c('0x90')})['then'](function(_0x14360a){_0x1f2788=_0x14360a;});}})[_0xed2c('0x1f')](function(_0x55a6d0){_0x2047cb=0x1f4;logger[_0xed2c('0x1a')](_0x55a6d0[_0xed2c('0x117')]);if(_0x55a6d0[_0xed2c('0x2d')]){delete _0x55a6d0[_0xed2c('0x2d')];}_0x1f2788=_0x55a6d0;})['finally'](function(){if(_0x1f2788===null){_0xe52497['sendStatus'](_0x2047cb);}else{if(_0x2047cb===0x1f4){_0xe52497[_0xed2c('0x21')](_0x2047cb)['send'](_0x1f2788);}else{_0xe52497[_0xed2c('0x21')](_0x2047cb)['json'](_0x1f2788);}}});};exports[_0xed2c('0x118')]=function(_0x43522a,_0x5a7864){var _0x1ec3a2={};var _0x343e3b={};var _0xda07c3;var _0x5ceb43;return db['ChatWebsite'][_0xed2c('0x54')]({'where':{'id':_0x43522a[_0xed2c('0x46')]['id']}})['then'](handleEntityNotFound(_0x5a7864,null))[_0xed2c('0x16')](function(_0x563e99){if(_0x563e99){_0xda07c3=_0x563e99;_0x343e3b[_0xed2c('0x35')]=_['keys'](db[_0xed2c('0x8b')][_0xed2c('0x32')]);_0x343e3b[_0xed2c('0x36')]=_[_0xed2c('0x37')](_0x43522a['query']);_0x343e3b[_0xed2c('0x38')]=_[_0xed2c('0x39')](_0x343e3b[_0xed2c('0x35')],_0x343e3b['query']);_0x1ec3a2['attributes']=_[_0xed2c('0x39')](_0x343e3b['model'],qs[_0xed2c('0x3b')](_0x43522a[_0xed2c('0x36')]['fields']));_0x1ec3a2[_0xed2c('0x3a')]=_0x1ec3a2[_0xed2c('0x3a')][_0xed2c('0x3c')]?_0x1ec3a2['attributes']:_0x343e3b[_0xed2c('0x35')];_0x1ec3a2[_0xed2c('0x56')]=qs[_0xed2c('0x3e')](_0x43522a[_0xed2c('0x36')][_0xed2c('0x3e')]);_0x1ec3a2[_0xed2c('0x41')]=qs[_0xed2c('0x38')](_[_0xed2c('0x3f')](_0x43522a[_0xed2c('0x36')],_0x343e3b[_0xed2c('0x38')]));if(_0x43522a[_0xed2c('0x36')][_0xed2c('0x40')]){_0x1ec3a2[_0xed2c('0x41')]=_[_0xed2c('0x42')](_0x1ec3a2[_0xed2c('0x41')],{'$or':_[_0xed2c('0x57')](_0x1ec3a2[_0xed2c('0x3a')],function(_0x5ac036){var _0x10b6c0={};_0x10b6c0[_0x5ac036]={'$like':'%'+_0x43522a['query']['filter']+'%'};return _0x10b6c0;})});}_0x1ec3a2=_[_0xed2c('0x42')]({},_0x1ec3a2,_0x43522a[_0xed2c('0x48')]);return _0xda07c3['getApplications'](_0x1ec3a2);}})['then'](function(_0x52f4f7){if(_0x52f4f7){_0x5ceb43=_0x52f4f7[_0xed2c('0x3c')];if(!_0x43522a[_0xed2c('0x36')]['hasOwnProperty'](_0xed2c('0x55'))){_0x1ec3a2[_0xed2c('0x25')]=qs['limit'](_0x43522a[_0xed2c('0x36')][_0xed2c('0x25')]);_0x1ec3a2[_0xed2c('0x24')]=qs[_0xed2c('0x24')](_0x43522a[_0xed2c('0x36')][_0xed2c('0x24')]);}return _0xda07c3['getApplications'](_0x1ec3a2);}})[_0xed2c('0x16')](function(_0x11c194){if(_0x11c194){return _0x11c194?{'count':_0x5ceb43,'rows':_0x11c194}:null;}})[_0xed2c('0x16')](respondWithResult(_0x5a7864,null))['catch'](handleError(_0x5a7864,null));};exports[_0xed2c('0x119')]=function(_0x572f09,_0x263be3){return db[_0xed2c('0x11a')][_0xed2c('0x4e')]({'where':{'id':_0x572f09[_0xed2c('0x46')]['id']}})[_0xed2c('0x16')](handleEntityNotFound(_0x263be3,null))[_0xed2c('0x16')](function(_0x206b73){if(_0x206b73){return _0x206b73['addProactiveActions'](_0x572f09[_0xed2c('0x4a')][_0xed2c('0x5b')],_[_0xed2c('0xe8')](_0x572f09[_0xed2c('0x4a')],[_0xed2c('0x5b'),'id'])||{});}})[_0xed2c('0x16')](respondWithResult(_0x263be3,null))['catch'](handleError(_0x263be3,null));};exports['getProactiveActions']=function(_0xe54018,_0x5b5018){var _0x6550a4={};var _0x11661f={};var _0x5e1e93;var _0x28a7a4;return db['ChatWebsite'][_0xed2c('0x54')]({'where':{'id':_0xe54018[_0xed2c('0x46')]['id']}})['then'](handleEntityNotFound(_0x5b5018,null))['then'](function(_0x492f05){if(_0x492f05){_0x5e1e93=_0x492f05;_0x11661f[_0xed2c('0x35')]=_[_0xed2c('0x37')](db[_0xed2c('0x11b')][_0xed2c('0x32')]);_0x11661f[_0xed2c('0x36')]=_[_0xed2c('0x37')](_0xe54018[_0xed2c('0x36')]);_0x11661f['filters']=_[_0xed2c('0x39')](_0x11661f['model'],_0x11661f['query']);_0x6550a4[_0xed2c('0x3a')]=_[_0xed2c('0x39')](_0x11661f['model'],qs[_0xed2c('0x3b')](_0xe54018['query'][_0xed2c('0x3b')]));_0x6550a4[_0xed2c('0x3a')]=_0x6550a4['attributes'][_0xed2c('0x3c')]?_0x6550a4[_0xed2c('0x3a')]:_0x11661f['model'];_0x6550a4[_0xed2c('0x56')]=qs[_0xed2c('0x3e')](_0xe54018[_0xed2c('0x36')][_0xed2c('0x3e')]);_0x6550a4[_0xed2c('0x41')]=qs['filters'](_[_0xed2c('0x3f')](_0xe54018['query'],_0x11661f[_0xed2c('0x38')]));if(_0xe54018[_0xed2c('0x36')][_0xed2c('0x40')]){_0x6550a4['where']=_[_0xed2c('0x42')](_0x6550a4[_0xed2c('0x41')],{'$or':_[_0xed2c('0x57')](_0x6550a4[_0xed2c('0x3a')],function(_0x5a5fca){var _0x516013={};_0x516013[_0x5a5fca]={'$like':'%'+_0xe54018[_0xed2c('0x36')][_0xed2c('0x40')]+'%'};return _0x516013;})});}_0x6550a4=_['merge']({},_0x6550a4,_0xe54018['options']);return _0x5e1e93[_0xed2c('0xfe')](_0x6550a4);}})[_0xed2c('0x16')](function(_0x311da3){if(_0x311da3){_0x28a7a4=_0x311da3[_0xed2c('0x3c')];if(!_0xe54018['query'][_0xed2c('0x3d')](_0xed2c('0x55'))){_0x6550a4[_0xed2c('0x25')]=qs[_0xed2c('0x25')](_0xe54018['query'][_0xed2c('0x25')]);_0x6550a4[_0xed2c('0x24')]=qs[_0xed2c('0x24')](_0xe54018[_0xed2c('0x36')]['offset']);}return _0x5e1e93[_0xed2c('0xfe')](_0x6550a4);}})[_0xed2c('0x16')](function(_0x3ebceb){if(_0x3ebceb){return _0x3ebceb?{'count':_0x28a7a4,'rows':_0x3ebceb}:null;}})[_0xed2c('0x16')](respondWithResult(_0x5b5018,null))[_0xed2c('0x1f')](handleError(_0x5b5018,null));};exports[_0xed2c('0x11c')]=function(_0x1c779c,_0xc66d56){var _0x12fade=_0x1c779c[_0xed2c('0x36')]['online']===_0xed2c('0x11d')?_0xed2c('0x11e'):_0xed2c('0x11f');return db[_0xed2c('0x31')][_0xed2c('0x4e')]({'attributes':['id',_0x12fade],'where':{'id':_0x1c779c[_0xed2c('0x46')]['id']}})[_0xed2c('0x16')](handleEntityNotFound(_0xc66d56,null))[_0xed2c('0x16')](function(_0x5568b2){if(_0x5568b2){var _0x1db71a=_0x5568b2[_0x12fade];var _0x50eacb=_0x1db71a&&_0x1db71a[_0xed2c('0x120')]?_0x1db71a[_0xed2c('0x120')]:[];_0xc66d56[_0xed2c('0xbd')]({'fromKey':_[_0xed2c('0x6b')](_0x1db71a['fromKey'])?undefined:_0x1db71a[_0xed2c('0x121')],'count':_0x50eacb[_0xed2c('0x3c')],'rows':_0x50eacb});}})['catch'](handleError(_0xc66d56,null));};exports[_0xed2c('0x122')]=function(_0x41c9f7,_0x5ab51a){var _0x2152fd={'raw':![],'where':{}};var _0x26b59c={};var _0x116886={'count':0x0,'rows':[]};return db[_0xed2c('0x31')][_0xed2c('0x54')]({'where':{'id':_0x41c9f7['params']['id']}})[_0xed2c('0x16')](handleEntityNotFound(_0x5ab51a,null))[_0xed2c('0x16')](function(_0x256ab3){if(_0x256ab3){_0x26b59c[_0xed2c('0x35')]=_[_0xed2c('0x37')](db['ChatOfflineMessage'][_0xed2c('0x32')]);_0x26b59c[_0xed2c('0x36')]=_[_0xed2c('0x37')](_0x41c9f7[_0xed2c('0x36')]);_0x26b59c[_0xed2c('0x38')]=_[_0xed2c('0x39')](_0x26b59c[_0xed2c('0x35')],_0x26b59c[_0xed2c('0x36')]);_0x2152fd[_0xed2c('0x3a')]=_[_0xed2c('0x39')](_0x26b59c[_0xed2c('0x35')],qs[_0xed2c('0x3b')](_0x41c9f7[_0xed2c('0x36')][_0xed2c('0x3b')]));_0x2152fd[_0xed2c('0x3a')]=_0x2152fd[_0xed2c('0x3a')][_0xed2c('0x3c')]?_0x2152fd[_0xed2c('0x3a')]:_0x26b59c['model'];if(!_0x41c9f7[_0xed2c('0x36')][_0xed2c('0x3d')](_0xed2c('0x55'))){_0x2152fd['limit']=qs[_0xed2c('0x25')](_0x41c9f7[_0xed2c('0x36')][_0xed2c('0x25')]);_0x2152fd[_0xed2c('0x24')]=qs[_0xed2c('0x24')](_0x41c9f7[_0xed2c('0x36')][_0xed2c('0x24')]);}_0x2152fd[_0xed2c('0x56')]=qs[_0xed2c('0x3e')](_0x41c9f7[_0xed2c('0x36')][_0xed2c('0x3e')]);_0x2152fd[_0xed2c('0x41')]=qs[_0xed2c('0x38')](_[_0xed2c('0x3f')](_0x41c9f7[_0xed2c('0x36')],_0x26b59c[_0xed2c('0x38')]));_0x2152fd[_0xed2c('0x41')][_0xed2c('0x53')]=_0x256ab3['id'];if(_0x41c9f7[_0xed2c('0x36')][_0xed2c('0x40')]){_0x2152fd[_0xed2c('0x41')]=_[_0xed2c('0x42')](_0x2152fd['where'],{'$or':_[_0xed2c('0x57')](_0x2152fd[_0xed2c('0x3a')],function(_0x1fff28){var _0xd62043={};_0xd62043[_0x1fff28]={'$like':'%'+_0x41c9f7[_0xed2c('0x36')][_0xed2c('0x40')]+'%'};return _0xd62043;})});}_0x2152fd=_['merge']({},_0x2152fd,_0x41c9f7[_0xed2c('0x48')]);return db['ChatOfflineMessage']['count']({'where':_0x2152fd[_0xed2c('0x41')]})['then'](function(_0xd9cb82){_0x116886[_0xed2c('0x27')]=_0xd9cb82;if(_0x41c9f7[_0xed2c('0x36')][_0xed2c('0x43')]){_0x2152fd[_0xed2c('0x47')]=[{'all':!![]}];}else{_0x2152fd[_0xed2c('0x47')]=[{'model':db[_0xed2c('0x7d')],'as':_0xed2c('0xea'),'required':![]},{'model':db[_0xed2c('0xcf')],'as':'Attachments','required':![]}];}return db[_0xed2c('0xc6')][_0xed2c('0x44')](_0x2152fd);})['then'](function(_0xac6af0){_0x116886['rows']=_0xac6af0;return _0x116886;});}})[_0xed2c('0x16')](respondWithFilteredResult(_0x5ab51a,_0x2152fd))['catch'](handleError(_0x5ab51a,null));};exports[_0xed2c('0x123')]=function(_0x25ad40,_0x285048){return db[_0xed2c('0x31')]['find']({'where':{'id':_0x25ad40[_0xed2c('0x46')]['id']}})[_0xed2c('0x16')](handleEntityNotFound(_0x285048,null))[_0xed2c('0x16')](function(_0x2c2f23){if(_0x2c2f23){return _0x2c2f23[_0xed2c('0x123')](_0x25ad40[_0xed2c('0x4a')][_0xed2c('0x5b')],_[_0xed2c('0xe8')](_0x25ad40[_0xed2c('0x4a')],[_0xed2c('0x5b'),'id'])||{})[_0xed2c('0xa9')](function(_0x5f137f){for(var _0x4ec26a=0x0;_0x4ec26a<_0x25ad40[_0xed2c('0x4a')][_0xed2c('0x5b')][_0xed2c('0x3c')];_0x4ec26a+=0x1){socket[_0xed2c('0x124')]('userChatWebsite:save',{'UserId':Number(_0x25ad40[_0xed2c('0x4a')][_0xed2c('0x5b')][_0x4ec26a]),'ChatWebsiteId':Number(_0x25ad40['params']['id'])});}return _0x5f137f;});}})[_0xed2c('0x16')](respondWithResult(_0x285048,null))[_0xed2c('0x1f')](handleError(_0x285048,null));};exports['removeAgents']=function(_0x1fd1a9,_0x3da0f0){return db[_0xed2c('0x31')][_0xed2c('0x4e')]({'where':{'id':_0x1fd1a9[_0xed2c('0x46')]['id']}})[_0xed2c('0x16')](handleEntityNotFound(_0x3da0f0,null))[_0xed2c('0x16')](function(_0x2c0e07){if(_0x2c0e07){return _0x2c0e07[_0xed2c('0x125')](_0x1fd1a9[_0xed2c('0x36')][_0xed2c('0x5b')])['then'](function(){if(_[_0xed2c('0x126')](_0x1fd1a9[_0xed2c('0x36')][_0xed2c('0x5b')])){for(var _0xe167a1=0x0;_0xe167a1<_0x1fd1a9['query'][_0xed2c('0x5b')][_0xed2c('0x3c')];_0xe167a1+=0x1){socket[_0xed2c('0x124')]('userChatWebsite:remove',{'UserId':Number(_0x1fd1a9[_0xed2c('0x36')][_0xed2c('0x5b')][_0xe167a1]),'ChatWebsiteId':Number(_0x1fd1a9[_0xed2c('0x46')]['id'])});}}else{socket[_0xed2c('0x124')](_0xed2c('0x127'),{'UserId':Number(_0x1fd1a9['query']['ids']),'ChatWebsiteId':Number(_0x1fd1a9[_0xed2c('0x46')]['id'])});}});}})[_0xed2c('0x16')](respondWithStatusCode(_0x3da0f0,null))[_0xed2c('0x1f')](handleError(_0x3da0f0,null));};exports[_0xed2c('0x128')]=function(_0x297394,_0x98520b){var _0x2ff311={};var _0xc5bce8={};var _0x5bf311;var _0x3bc928;return db[_0xed2c('0x31')][_0xed2c('0x54')]({'where':{'id':_0x297394['params']['id']}})['then'](handleEntityNotFound(_0x98520b,null))[_0xed2c('0x16')](function(_0x2488e1){if(_0x2488e1){_0x5bf311=_0x2488e1;_0xc5bce8[_0xed2c('0x35')]=_[_0xed2c('0x37')](db[_0xed2c('0xb4')][_0xed2c('0x32')]);_0xc5bce8[_0xed2c('0x36')]=_[_0xed2c('0x37')](_0x297394['query']);_0xc5bce8[_0xed2c('0x38')]=_['intersection'](_0xc5bce8['model'],_0xc5bce8[_0xed2c('0x36')]);_0x2ff311[_0xed2c('0x3a')]=_[_0xed2c('0x39')](_0xc5bce8[_0xed2c('0x35')],qs[_0xed2c('0x3b')](_0x297394[_0xed2c('0x36')][_0xed2c('0x3b')]));_0x2ff311[_0xed2c('0x3a')]=_0x2ff311[_0xed2c('0x3a')][_0xed2c('0x3c')]?_0x2ff311[_0xed2c('0x3a')]:_0xc5bce8['model'];_0x2ff311[_0xed2c('0x56')]=qs[_0xed2c('0x3e')](_0x297394[_0xed2c('0x36')][_0xed2c('0x3e')]);_0x2ff311[_0xed2c('0x41')]=qs[_0xed2c('0x38')](_[_0xed2c('0x3f')](_0x297394[_0xed2c('0x36')],_0xc5bce8[_0xed2c('0x38')]));if(_0x297394['query'][_0xed2c('0x40')]){_0x2ff311[_0xed2c('0x41')]=_[_0xed2c('0x42')](_0x2ff311[_0xed2c('0x41')],{'$or':_[_0xed2c('0x57')](_0x2ff311['attributes'],function(_0x23871b){var _0x1f6484={};_0x1f6484[_0x23871b]={'$like':'%'+_0x297394[_0xed2c('0x36')][_0xed2c('0x40')]+'%'};return _0x1f6484;})});}_0x2ff311=_[_0xed2c('0x42')]({},_0x2ff311,_0x297394[_0xed2c('0x48')]);return _0x5bf311[_0xed2c('0x128')](_0x2ff311);}})[_0xed2c('0x16')](function(_0x3d7a69){if(_0x3d7a69){_0x3bc928=_0x3d7a69[_0xed2c('0x3c')];if(!_0x297394['query']['hasOwnProperty']('nolimit')){_0x2ff311[_0xed2c('0x25')]=qs['limit'](_0x297394['query']['limit']);_0x2ff311[_0xed2c('0x24')]=qs[_0xed2c('0x24')](_0x297394[_0xed2c('0x36')][_0xed2c('0x24')]);}return _0x5bf311[_0xed2c('0x128')](_0x2ff311);}})[_0xed2c('0x16')](function(_0x1f8523){if(_0x1f8523){return _0x1f8523?{'count':_0x3bc928,'rows':_0x1f8523}:null;}})[_0xed2c('0x16')](respondWithResult(_0x98520b,null))[_0xed2c('0x1f')](handleError(_0x98520b,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 90503de..2214626 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 _0xc03e=['hasOwnProperty','hook','exports','events','setMaxListeners','update','emit'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xc03e,0x15a));var _0xec03=function(_0x17371c,_0x1a1e9c){_0x17371c=_0x17371c-0x0;var _0x422265=_0xc03e[_0x17371c];return _0x422265;};'use strict';var EventEmitter=require(_0xec03('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xec03('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xec03('0x2'),'afterDestroy':'remove'};function emitEvent(_0xfed10f){return function(_0x269001,_0x3e3a78,_0x194e54){ChatWebsiteEvents[_0xec03('0x3')](_0xfed10f+':'+_0x269001['id'],_0x269001);ChatWebsiteEvents[_0xec03('0x3')](_0xfed10f,_0x269001);_0x194e54(null);};}for(var e in events){if(events[_0xec03('0x4')](e)){var event=events[e];ChatWebsite[_0xec03('0x5')](e,emitEvent(event));}}module[_0xec03('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xba6c=['remove','emit','hasOwnProperty','hook','exports','events','ChatWebsite','setMaxListeners','save','update'];(function(_0x40001a,_0x57f2ae){var _0x4cec45=function(_0x5e4166){while(--_0x5e4166){_0x40001a['push'](_0x40001a['shift']());}};_0x4cec45(++_0x57f2ae);}(_0xba6c,0x113));var _0xcba6=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0xba6c[_0x5a9c0c];return _0x53c77d;};'use strict';var EventEmitter=require(_0xcba6('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xcba6('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xcba6('0x2')](0x0);var events={'afterCreate':_0xcba6('0x3'),'afterUpdate':_0xcba6('0x4'),'afterDestroy':_0xcba6('0x5')};function emitEvent(_0x3e9fb9){return function(_0x2b34a3,_0x5c911d,_0x57b9b2){ChatWebsiteEvents[_0xcba6('0x6')](_0x3e9fb9+':'+_0x2b34a3['id'],_0x2b34a3);ChatWebsiteEvents[_0xcba6('0x6')](_0x3e9fb9,_0x2b34a3);_0x57b9b2(null);};}for(var e in events){if(events[_0xcba6('0x7')](e)){var event=events[e];ChatWebsite[_0xcba6('0x8')](e,emitEvent(event));}}module[_0xcba6('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index ea12187..35d913e 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 _0x6018=['path','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','lodash','util','moment','request-promise'];(function(_0x3788ad,_0x3ce640){var _0x24ac05=function(_0x533aa2){while(--_0x533aa2){_0x3788ad['push'](_0x3788ad['shift']());}};_0x24ac05(++_0x3ce640);}(_0x6018,0x15a));var _0x8601=function(_0x103934,_0x2df8ea){_0x103934=_0x103934-0x0;var _0x339b3f=_0x6018[_0x103934];return _0x339b3f;};'use strict';var _=require(_0x8601('0x0'));var util=require(_0x8601('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8601('0x2'));var BPromise=require('bluebird');var rp=require(_0x8601('0x3'));var fs=require('fs');var path=require(_0x8601('0x4'));var rimraf=require(_0x8601('0x5'));var config=require('../../config/environment');var attributes=require(_0x8601('0x6'));module[_0x8601('0x7')]=function(_0x3d6df8,_0x1d31c8){return _0x3d6df8[_0x8601('0x8')](_0x8601('0x9'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb451=['request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4a67ae,_0x50a957){var _0x37f94a=function(_0x10b491){while(--_0x10b491){_0x4a67ae['push'](_0x4a67ae['shift']());}};_0x37f94a(++_0x50a957);}(_0xb451,0x119));var _0x1b45=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0xb451[_0x382e89];return _0x3a1318;};'use strict';var _=require(_0x1b45('0x0'));var util=require('util');var logger=require(_0x1b45('0x1'))(_0x1b45('0x2'));var moment=require(_0x1b45('0x3'));var BPromise=require(_0x1b45('0x4'));var rp=require(_0x1b45('0x5'));var fs=require('fs');var path=require(_0x1b45('0x6'));var rimraf=require(_0x1b45('0x7'));var config=require(_0x1b45('0x8'));var attributes=require(_0x1b45('0x9'));module[_0x1b45('0xa')]=function(_0x5581da,_0x19c8b5){return _0x5581da[_0x1b45('0xb')](_0x1b45('0xc'),attributes,{'tableName':'chat_websites','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 c103a6c..0bdfbaf 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 _0x6ec2=['catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result'];(function(_0x5829b9,_0x1e49a7){var _0x127db6=function(_0x7bf8d7){while(--_0x7bf8d7){_0x5829b9['push'](_0x5829b9['shift']());}};_0x127db6(++_0x1e49a7);}(_0x6ec2,0x105));var _0x26ec=function(_0xb2318f,_0x2f9172){_0xb2318f=_0xb2318f-0x0;var _0x10a11b=_0x6ec2[_0xb2318f];return _0x10a11b;};'use strict';var _=require('lodash');var util=require(_0x26ec('0x0'));var moment=require(_0x26ec('0x1'));var BPromise=require(_0x26ec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x26ec('0x3'));var db=require(_0x26ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x26ec('0x5'))(_0x26ec('0x6'));var config=require(_0x26ec('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x26ec('0x8')][_0x26ec('0x9')]({'port':0x232a});config[_0x26ec('0xa')]=_[_0x26ec('0xb')](config[_0x26ec('0xa')],{'host':_0x26ec('0xc'),'port':0x18eb});var socket=require(_0x26ec('0xd'))(new Redis(config[_0x26ec('0xa')]));require(_0x26ec('0xe'))['register'](socket);function respondWithRpcPromise(_0x23b9cd,_0x57e780,_0x25b9ab){return new BPromise(function(_0x5e0a8f,_0x10c8db){return client['request'](_0x23b9cd,_0x25b9ab)[_0x26ec('0xf')](function(_0x217509){logger[_0x26ec('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x57e780,_0x26ec('0x11'));logger['debug'](_0x26ec('0x12'),_0x57e780,'request\x20sent',JSON[_0x26ec('0x13')](_0x217509));if(_0x217509['error']){if(_0x217509[_0x26ec('0x14')][_0x26ec('0x15')]===0x1f4){logger[_0x26ec('0x14')](_0x26ec('0x16'),_0x57e780,_0x217509[_0x26ec('0x14')][_0x26ec('0x17')]);return _0x10c8db(_0x217509[_0x26ec('0x14')][_0x26ec('0x17')]);}logger[_0x26ec('0x14')](_0x26ec('0x16'),_0x57e780,_0x217509[_0x26ec('0x14')][_0x26ec('0x17')]);return _0x5e0a8f(_0x217509[_0x26ec('0x14')][_0x26ec('0x17')]);}else{logger[_0x26ec('0x10')](_0x26ec('0x16'),_0x57e780,_0x26ec('0x11'));_0x5e0a8f(_0x217509[_0x26ec('0x18')][_0x26ec('0x17')]);}})[_0x26ec('0x19')](function(_0x1fa661){logger[_0x26ec('0x14')](_0x26ec('0x16'),_0x57e780,_0x1fa661);_0x10c8db(_0x1fa661);});});}
\ No newline at end of file
+var _0x77e1=['./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter'];(function(_0x5b7f04,_0x4b5ff8){var _0x580493=function(_0x4ee188){while(--_0x4ee188){_0x5b7f04['push'](_0x5b7f04['shift']());}};_0x580493(++_0x4b5ff8);}(_0x77e1,0xe4));var _0x177e=function(_0x17019d,_0x4c6c3c){_0x17019d=_0x17019d-0x0;var _0x14c24c=_0x77e1[_0x17019d];return _0x14c24c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x177e('0x0'));var BPromise=require('bluebird');var rs=require(_0x177e('0x1'));var fs=require('fs');var Redis=require(_0x177e('0x2'));var db=require(_0x177e('0x3'))['db'];var utils=require(_0x177e('0x4'));var logger=require(_0x177e('0x5'))('rpc');var config=require(_0x177e('0x6'));var jayson=require(_0x177e('0x7'));var client=jayson['client'][_0x177e('0x8')]({'port':0x232a});config[_0x177e('0x9')]=_['defaults'](config['redis'],{'host':_0x177e('0xa'),'port':0x18eb});var socket=require(_0x177e('0xb'))(new Redis(config[_0x177e('0x9')]));require(_0x177e('0xc'))[_0x177e('0xd')](socket);function respondWithRpcPromise(_0x5a686f,_0x455330,_0x1fc0e9){return new BPromise(function(_0x8d6d68,_0x1f7d16){return client[_0x177e('0xe')](_0x5a686f,_0x1fc0e9)[_0x177e('0xf')](function(_0x285e45){logger['info'](_0x177e('0x10'),_0x455330,'request\x20sent');logger[_0x177e('0x11')](_0x177e('0x12'),_0x455330,_0x177e('0x13'),JSON[_0x177e('0x14')](_0x285e45));if(_0x285e45[_0x177e('0x15')]){if(_0x285e45['error']['code']===0x1f4){logger[_0x177e('0x15')](_0x177e('0x10'),_0x455330,_0x285e45[_0x177e('0x15')][_0x177e('0x16')]);return _0x1f7d16(_0x285e45[_0x177e('0x15')][_0x177e('0x16')]);}logger[_0x177e('0x15')](_0x177e('0x10'),_0x455330,_0x285e45[_0x177e('0x15')][_0x177e('0x16')]);return _0x8d6d68(_0x285e45[_0x177e('0x15')][_0x177e('0x16')]);}else{logger['info'](_0x177e('0x10'),_0x455330,_0x177e('0x13'));_0x8d6d68(_0x285e45[_0x177e('0x17')][_0x177e('0x16')]);}})['catch'](function(_0x5a1a9c){logger[_0x177e('0x15')](_0x177e('0x10'),_0x455330,_0x5a1a9c);_0x1f7d16(_0x5a1a9c);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index e2afc73..ec1cba8 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 _0x8e86=['emit','removeListener','register','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x5a3bd3,_0x9a7411){var _0x20650c=function(_0xc9d659){while(--_0xc9d659){_0x5a3bd3['push'](_0x5a3bd3['shift']());}};_0x20650c(++_0x9a7411);}(_0x8e86,0xf2));var _0x68e8=function(_0x1ae160,_0xa9e346){_0x1ae160=_0x1ae160-0x0;var _0x47b73d=_0x8e86[_0x1ae160];return _0x47b73d;};'use strict';var ChatWebsiteEvents=require(_0x68e8('0x0'));var events=[_0x68e8('0x1'),_0x68e8('0x2'),'update'];function createListener(_0x171d53,_0x205ed2){return function(_0x48d4a1){_0x205ed2[_0x68e8('0x3')](_0x171d53,_0x48d4a1);};}function removeListener(_0x284cf9,_0x590f7d){return function(){ChatWebsiteEvents[_0x68e8('0x4')](_0x284cf9,_0x590f7d);};}exports[_0x68e8('0x5')]=function(_0x458238){for(var _0xe6d6f4=0x0,_0x2487de=events['length'];_0xe6d6f4<_0x2487de;_0xe6d6f4++){var _0x1bd1e5=events[_0xe6d6f4];var _0x3eed04=createListener(_0x68e8('0x6')+_0x1bd1e5,_0x458238);ChatWebsiteEvents['on'](_0x1bd1e5,_0x3eed04);}};
\ No newline at end of file
+var _0xcd53=['register','length','chatWebsite:','./chatWebsite.events','save','update','emit'];(function(_0x4d6dec,_0xd3abf3){var _0x343485=function(_0x2b627a){while(--_0x2b627a){_0x4d6dec['push'](_0x4d6dec['shift']());}};_0x343485(++_0xd3abf3);}(_0xcd53,0x106));var _0x3cd5=function(_0x575b72,_0x1a7eb1){_0x575b72=_0x575b72-0x0;var _0x561c57=_0xcd53[_0x575b72];return _0x561c57;};'use strict';var ChatWebsiteEvents=require(_0x3cd5('0x0'));var events=[_0x3cd5('0x1'),'remove',_0x3cd5('0x2')];function createListener(_0x109b75,_0x1fb9fb){return function(_0x20b65c){_0x1fb9fb[_0x3cd5('0x3')](_0x109b75,_0x20b65c);};}function removeListener(_0x49513d,_0x26490d){return function(){ChatWebsiteEvents['removeListener'](_0x49513d,_0x26490d);};}exports[_0x3cd5('0x4')]=function(_0x352fb6){for(var _0x540e80=0x0,_0x2e18b7=events[_0x3cd5('0x5')];_0x540e80<_0x2e18b7;_0x540e80++){var _0x3860e0=events[_0x540e80];var _0x59f84f=createListener(_0x3cd5('0x6')+_0x3860e0,_0x352fb6);ChatWebsiteEvents['on'](_0x3860e0,_0x59f84f);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 7225799..111642a 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 _0x40b8=['/:id','isAuthenticated','show','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/canned_answers','addAnswer','diskStorage','join','format','now','single','file','addLogo','originalname','addAvatar','root','server/files/images/avatars/','%s-%s','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addAgents','put','delete','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','/describe','describe'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x40b8,0x118));var _0x840b=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x40b8[_0x25e7cb];return _0x375d92;};'use strict';var multer=require(_0x840b('0x0'));var util=require(_0x840b('0x1'));var path=require('path');var timeout=require(_0x840b('0x2'));var express=require('express');var router=express[_0x840b('0x3')]();var fs_extra=require(_0x840b('0x4'));var auth=require(_0x840b('0x5'));var interaction=require(_0x840b('0x6'));var config=require(_0x840b('0x7'));var controller=require(_0x840b('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x840b('0x9')](_0x840b('0xa'),auth['isAuthenticated'](),controller[_0x840b('0xb')]);router[_0x840b('0x9')](_0x840b('0xc'),auth[_0x840b('0xd')](),controller[_0x840b('0xe')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0x840b('0x9')]('/:id/canned_answers',auth[_0x840b('0xd')](),controller['getAnswers']);router['get'](_0x840b('0xf'),controller[_0x840b('0x10')]);router[_0x840b('0x9')](_0x840b('0x11'),controller[_0x840b('0x12')]);router[_0x840b('0x9')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x840b('0x9')](_0x840b('0x13'),controller[_0x840b('0x14')]);router[_0x840b('0x9')](_0x840b('0x15'),auth[_0x840b('0xd')](),controller[_0x840b('0x16')]);router[_0x840b('0x9')](_0x840b('0x17'),controller[_0x840b('0x18')]);router[_0x840b('0x9')](_0x840b('0x19'),auth[_0x840b('0xd')](),controller[_0x840b('0x1a')]);router[_0x840b('0x9')](_0x840b('0x1b'),auth[_0x840b('0xd')](),controller[_0x840b('0x1c')]);router['get']('/:id/fields',controller[_0x840b('0x1d')]);router[_0x840b('0x9')](_0x840b('0x1e'),auth[_0x840b('0xd')](),controller[_0x840b('0x1f')]);router[_0x840b('0x9')](_0x840b('0x20'),auth[_0x840b('0xd')](),controller[_0x840b('0x21')]);router[_0x840b('0x22')]('/',auth['isAuthenticated'](),controller[_0x840b('0x23')]);router[_0x840b('0x22')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0x840b('0x22')](_0x840b('0x24'),auth[_0x840b('0xd')](),controller[_0x840b('0x25')]);var upload=multer({'storage':multer[_0x840b('0x26')]({'destination':function(_0x1751e9,_0x24eb5c,_0x130a54){_0x130a54(null,path[_0x840b('0x27')](config['root'],'server/files/images/logos/'));},'filename':function(_0x1d69bf,_0xa7355c,_0x5e4354){_0x5e4354(null,util[_0x840b('0x28')]('%s-%s',Date[_0x840b('0x29')](),_0xa7355c['originalname']));}})});router['post'](_0x840b('0xf'),upload[_0x840b('0x2a')](_0x840b('0x2b')),controller[_0x840b('0x2c')]);var upload=multer({'storage':multer[_0x840b('0x26')]({'destination':function(_0x5f4b1c,_0x4b1c74,_0x552306){_0x552306(null,path[_0x840b('0x27')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x3def68,_0x2ecbb9,_0x22d349){_0x22d349(null,util[_0x840b('0x28')]('%s-%s',Date[_0x840b('0x29')](),_0x2ecbb9[_0x840b('0x2d')]));}})});router[_0x840b('0x22')](_0x840b('0x11'),upload[_0x840b('0x2a')](_0x840b('0x2b')),controller[_0x840b('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xef2087,_0x5580c8,_0xb9e54d){_0xb9e54d(null,path[_0x840b('0x27')](config[_0x840b('0x2f')],_0x840b('0x30')));},'filename':function(_0x4ebd09,_0x43f6b3,_0x4b8b97){_0x4b8b97(null,util['format'](_0x840b('0x31'),Date[_0x840b('0x29')](),_0x43f6b3[_0x840b('0x2d')]));}})});router['post'](_0x840b('0x32'),upload['single'](_0x840b('0x2b')),controller[_0x840b('0x33')]);var upload=multer({'storage':multer[_0x840b('0x26')]({'destination':function(_0x36e17d,_0x343d18,_0xee9f03){_0xee9f03(null,path[_0x840b('0x27')](config[_0x840b('0x2f')],_0x840b('0x30')));},'filename':function(_0xf0808e,_0x42a2f8,_0x38449a){_0x38449a(null,util['format'](_0x840b('0x31'),Date[_0x840b('0x29')](),_0x42a2f8['originalname']));}})});router[_0x840b('0x22')](_0x840b('0x13'),upload['single'](_0x840b('0x2b')),controller[_0x840b('0x34')]);router['post'](_0x840b('0x35'),controller[_0x840b('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x840b('0x26')]({'destination':function(_0x2da2cb,_0x26ffd9,_0x29ee64){const _0x34ef23=path[_0x840b('0x27')](config['root'],_0x840b('0x37'),_0x840b('0x38'),_0x840b('0x39'));fs_extra[_0x840b('0x3a')](_0x34ef23,function(){_0x29ee64(null,_0x34ef23);});},'filename':function(_0x18ffef,_0x81bf66,_0x2e9633){const _0x47ff6c=_0x81bf66['originalname'][_0x840b('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x58c8f1=path[_0x840b('0x3c')](_0x47ff6c);const _0x5221f8=Date[_0x840b('0x29')]()+'-'+_0x47ff6c[_0x840b('0x3b')](_0x58c8f1,'')+_0x58c8f1;_0x2e9633(null,_0x5221f8);}})});router[_0x840b('0x22')](_0x840b('0x3d'),offlineUploadMulter[_0x840b('0x3e')](),controller[_0x840b('0x3f')]);router[_0x840b('0x22')]('/:id/interactions',auth[_0x840b('0xd')](),controller[_0x840b('0x40')]);router['post'](_0x840b('0x19'),auth[_0x840b('0xd')](),controller[_0x840b('0x41')]);router[_0x840b('0x22')](_0x840b('0x1b'),auth[_0x840b('0xd')](),controller['addProactiveActions']);router[_0x840b('0x22')](_0x840b('0x20'),auth[_0x840b('0xd')](),controller[_0x840b('0x42')]);router[_0x840b('0x43')]('/:id',auth[_0x840b('0xd')](),controller['update']);router[_0x840b('0x44')](_0x840b('0xc'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x840b('0x45'),auth[_0x840b('0xd')](),controller[_0x840b('0x46')]);router[_0x840b('0x44')](_0x840b('0x24'),auth[_0x840b('0xd')](),controller[_0x840b('0x47')]);router[_0x840b('0x44')](_0x840b('0x20'),auth[_0x840b('0xd')](),controller[_0x840b('0x48')]);module['exports']=router;
\ No newline at end of file
+var _0x2c52=['addAgents','put','update','delete','destroy','removeDispositions','removeAgents','multer','util','connect-timeout','express','fs-extra','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','diskStorage','root','now','single','join','server/files/images/avatars/','format','%s-%s','file','addCustomerAvatar','originalname','notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','offline','addInteraction','addApplications','addProactiveActions'];(function(_0x2c47ad,_0x41c0d8){var _0x3ae667=function(_0x2ea183){while(--_0x2ea183){_0x2c47ad['push'](_0x2c47ad['shift']());}};_0x3ae667(++_0x41c0d8);}(_0x2c52,0xca));var _0x22c5=function(_0x543371,_0xea894){_0x543371=_0x543371-0x0;var _0x2e0303=_0x2c52[_0x543371];return _0x2e0303;};'use strict';var multer=require(_0x22c5('0x0'));var util=require(_0x22c5('0x1'));var path=require('path');var timeout=require(_0x22c5('0x2'));var express=require(_0x22c5('0x3'));var router=express['Router']();var fs_extra=require(_0x22c5('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x22c5('0x5'));var controller=require(_0x22c5('0x6'));router[_0x22c5('0x7')]('/',auth[_0x22c5('0x8')](),controller[_0x22c5('0x9')]);router[_0x22c5('0x7')]('/describe',auth[_0x22c5('0x8')](),controller[_0x22c5('0xa')]);router[_0x22c5('0x7')](_0x22c5('0xb'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/dispositions',auth[_0x22c5('0x8')](),controller['getDispositions']);router[_0x22c5('0x7')](_0x22c5('0xc'),auth[_0x22c5('0x8')](),controller['getAnswers']);router[_0x22c5('0x7')](_0x22c5('0xd'),controller[_0x22c5('0xe')]);router[_0x22c5('0x7')](_0x22c5('0xf'),controller[_0x22c5('0x10')]);router[_0x22c5('0x7')](_0x22c5('0x11'),controller['getCustomerAvatar']);router[_0x22c5('0x7')](_0x22c5('0x12'),controller['getSystemAvatar']);router[_0x22c5('0x7')](_0x22c5('0x13'),auth[_0x22c5('0x8')](),controller[_0x22c5('0x14')]);router[_0x22c5('0x7')](_0x22c5('0x15'),controller[_0x22c5('0x16')]);router[_0x22c5('0x7')](_0x22c5('0x17'),auth['isAuthenticated'](),controller[_0x22c5('0x18')]);router['get'](_0x22c5('0x19'),auth[_0x22c5('0x8')](),controller[_0x22c5('0x1a')]);router[_0x22c5('0x7')]('/:id/fields',controller[_0x22c5('0x1b')]);router[_0x22c5('0x7')](_0x22c5('0x1c'),auth[_0x22c5('0x8')](),controller[_0x22c5('0x1d')]);router['get'](_0x22c5('0x1e'),auth[_0x22c5('0x8')](),controller[_0x22c5('0x1f')]);router[_0x22c5('0x20')]('/',auth[_0x22c5('0x8')](),controller['create']);router['post'](_0x22c5('0x21'),auth[_0x22c5('0x8')](),controller[_0x22c5('0x22')]);router[_0x22c5('0x20')](_0x22c5('0xc'),auth[_0x22c5('0x8')](),controller[_0x22c5('0x23')]);var upload=multer({'storage':multer[_0x22c5('0x24')]({'destination':function(_0x74a058,_0x392d87,_0x3e4d65){_0x3e4d65(null,path['join'](config[_0x22c5('0x25')],'server/files/images/logos/'));},'filename':function(_0x224c15,_0x398c2f,_0x18baad){_0x18baad(null,util['format']('%s-%s',Date[_0x22c5('0x26')](),_0x398c2f['originalname']));}})});router[_0x22c5('0x20')](_0x22c5('0xd'),upload[_0x22c5('0x27')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x22c5('0x24')]({'destination':function(_0x220f8a,_0x43353d,_0x25df43){_0x25df43(null,path[_0x22c5('0x28')](config[_0x22c5('0x25')],_0x22c5('0x29')));},'filename':function(_0x40368f,_0x3b22cd,_0x4afccc){_0x4afccc(null,util[_0x22c5('0x2a')](_0x22c5('0x2b'),Date[_0x22c5('0x26')](),_0x3b22cd['originalname']));}})});router[_0x22c5('0x20')]('/:id/avatar',upload['single'](_0x22c5('0x2c')),controller['addAvatar']);var upload=multer({'storage':multer[_0x22c5('0x24')]({'destination':function(_0x54c975,_0x4dbbb7,_0x19e2df){_0x19e2df(null,path[_0x22c5('0x28')](config[_0x22c5('0x25')],_0x22c5('0x29')));},'filename':function(_0x4b1529,_0x3d514c,_0xb9707b){_0xb9707b(null,util[_0x22c5('0x2a')]('%s-%s',Date['now'](),_0x3d514c['originalname']));}})});router[_0x22c5('0x20')](_0x22c5('0x11'),upload['single']('file'),controller[_0x22c5('0x2d')]);var upload=multer({'storage':multer[_0x22c5('0x24')]({'destination':function(_0x18c291,_0x4af732,_0x491231){_0x491231(null,path[_0x22c5('0x28')](config[_0x22c5('0x25')],_0x22c5('0x29')));},'filename':function(_0x8123e,_0x3d2e18,_0x3f9601){_0x3f9601(null,util[_0x22c5('0x2a')](_0x22c5('0x2b'),Date[_0x22c5('0x26')](),_0x3d2e18[_0x22c5('0x2e')]));}})});router['post'](_0x22c5('0x12'),upload['single'](_0x22c5('0x2c')),controller['addSystemAvatar']);router[_0x22c5('0x20')]('/:id/notify',controller[_0x22c5('0x2f')]);const offlineUploadMulter=multer({'storage':multer[_0x22c5('0x24')]({'destination':function(_0x14ffe4,_0x58bbfb,_0x10e25e){const _0xdd982c=path['join'](config['root'],_0x22c5('0x30'),_0x22c5('0x31'),_0x22c5('0x32'));fs_extra['ensureDir'](_0xdd982c,function(){_0x10e25e(null,_0xdd982c);});},'filename':function(_0x4b9b3f,_0x25b96e,_0x7f7696){const _0x203e41=_0x25b96e[_0x22c5('0x2e')][_0x22c5('0x33')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xbc5394=path[_0x22c5('0x34')](_0x203e41);const _0x4bf118=Date['now']()+'-'+_0x203e41[_0x22c5('0x33')](_0xbc5394,'')+_0xbc5394;_0x7f7696(null,_0x4bf118);}})});router[_0x22c5('0x20')](_0x22c5('0x35'),offlineUploadMulter['any'](),controller[_0x22c5('0x36')]);router[_0x22c5('0x20')](_0x22c5('0x13'),auth['isAuthenticated'](),controller[_0x22c5('0x37')]);router[_0x22c5('0x20')](_0x22c5('0x17'),auth[_0x22c5('0x8')](),controller[_0x22c5('0x38')]);router['post']('/:id/proactive_actions',auth[_0x22c5('0x8')](),controller[_0x22c5('0x39')]);router[_0x22c5('0x20')](_0x22c5('0x1e'),auth['isAuthenticated'](),controller[_0x22c5('0x3a')]);router[_0x22c5('0x3b')]('/:id',auth[_0x22c5('0x8')](),controller[_0x22c5('0x3c')]);router[_0x22c5('0x3d')]('/:id',auth[_0x22c5('0x8')](),controller[_0x22c5('0x3e')]);router[_0x22c5('0x3d')](_0x22c5('0x21'),auth[_0x22c5('0x8')](),controller[_0x22c5('0x3f')]);router[_0x22c5('0x3d')](_0x22c5('0xc'),auth[_0x22c5('0x8')](),controller['removeAnswers']);router[_0x22c5('0x3d')]('/:id/users',auth['isAuthenticated'](),controller[_0x22c5('0x40')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 1d00918..c2224ed 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 _0x0571=['client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','Router','env','production','get'];(function(_0x1db153,_0x1ab5d){var _0x530cbe=function(_0x4115f7){while(--_0x4115f7){_0x1db153['push'](_0x1db153['shift']());}};_0x530cbe(++_0x1ab5d);}(_0x0571,0x1cd));var _0x1057=function(_0x40ebff,_0x1dd15e){_0x40ebff=_0x40ebff-0x0;var _0x40122a=_0x0571[_0x40ebff];return _0x40122a;};var beaverLogger=require(_0x1057('0x0'));var express=require(_0x1057('0x1'));var auth=require(_0x1057('0x2'));var config=require('../config/environment');var router=express[_0x1057('0x3')]();var isProduction=config[_0x1057('0x4')]===_0x1057('0x5')||![];function clientSideLogs(_0x95ed68,_0x5e48da,_0x4fd43c){var _0x16ba4a=_0x95ed68['app'][_0x1057('0x6')](_0x1057('0x7'));if(!_0x16ba4a){throw new Error(_0x1057('0x8'));}return beaverLogger['expressEndpoint']({'uri':_0x1057('0x9'),'logger':_0x16ba4a,'enableCors':!isProduction})(_0x95ed68,_0x5e48da,_0x4fd43c);}router['use'](auth[_0x1057('0xa')](),clientSideLogs);module[_0x1057('0xb')]=router;
\ No newline at end of file
+var _0xeb05=['get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','exports','beaver-logger/server','express','Router','env','production','app'];(function(_0x51d211,_0x21bab9){var _0x53d316=function(_0xe1efd0){while(--_0xe1efd0){_0x51d211['push'](_0x51d211['shift']());}};_0x53d316(++_0x21bab9);}(_0xeb05,0x90));var _0x5eb0=function(_0x36b8de,_0x4085c1){_0x36b8de=_0x36b8de-0x0;var _0x4ce4e5=_0xeb05[_0x36b8de];return _0x4ce4e5;};var beaverLogger=require(_0x5eb0('0x0'));var express=require(_0x5eb0('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0x5eb0('0x2')]();var isProduction=config[_0x5eb0('0x3')]===_0x5eb0('0x4')||![];function clientSideLogs(_0x5e64e7,_0x4b6bb4,_0x89a8bf){var _0x3cb733=_0x5e64e7[_0x5eb0('0x5')][_0x5eb0('0x6')]('client-side-logger');if(!_0x3cb733){throw new Error(_0x5eb0('0x7'));}return beaverLogger[_0x5eb0('0x8')]({'uri':'/client-logs','logger':_0x3cb733,'enableCors':!isProduction})(_0x5e64e7,_0x4b6bb4,_0x89a8bf);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0x5eb0('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 84df59b..36faf24 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 _0xb1e3=['Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','Google','Outlook365'];(function(_0x21602d,_0x4b30ab){var _0x4ceba6=function(_0xcf323f){while(--_0xcf323f){_0x21602d['push'](_0x21602d['shift']());}};_0x4ceba6(++_0x4b30ab);}(_0xb1e3,0xda));var _0x3b1e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb1e3[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3b1e('0x0'));module[_0x3b1e('0x1')]={'name':{'type':Sequelize[_0x3b1e('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3b1e('0x3')]('AmazonAWS',_0x3b1e('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x3b1e('0x3')](_0x3b1e('0x5'),_0x3b1e('0x6'))},'data1':{'type':Sequelize[_0x3b1e('0x2')],'comment':_0x3b1e('0x7')},'data2':{'type':Sequelize[_0x3b1e('0x2')],'comment':_0x3b1e('0x8')},'data3':{'type':Sequelize[_0x3b1e('0x2')],'comment':_0x3b1e('0x9')},'data4':{'type':Sequelize[_0x3b1e('0x2')],'comment':_0x3b1e('0xa')},'data5':{'type':Sequelize[_0x3b1e('0xb')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x3b1e('0xb')],'comment':_0x3b1e('0xc')},'data7':{'type':Sequelize[_0x3b1e('0xb')],'comment':_0x3b1e('0xd')}};
\ No newline at end of file
+var _0x797e=['Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','ENUM','Google','MicrosoftAzure','Outlook365'];(function(_0x5ec03f,_0x4ca34b){var _0x162000=function(_0x473078){while(--_0x473078){_0x5ec03f['push'](_0x5ec03f['shift']());}};_0x162000(++_0x4ca34b);}(_0x797e,0x158));var _0xe797=function(_0x3aadce,_0x455a70){_0x3aadce=_0x3aadce-0x0;var _0x2db10b=_0x797e[_0x3aadce];return _0x2db10b;};'use strict';var Sequelize=require(_0xe797('0x0'));module[_0xe797('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xe797('0x2')]('AmazonAWS',_0xe797('0x3'),_0xe797('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xe797('0x2')](_0xe797('0x5'),_0xe797('0x6'))},'data1':{'type':Sequelize[_0xe797('0x7')],'comment':_0xe797('0x8')},'data2':{'type':Sequelize[_0xe797('0x7')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0xe797('0x9')},'data4':{'type':Sequelize[_0xe797('0x7')],'comment':_0xe797('0xa')},'data5':{'type':Sequelize[_0xe797('0xb')],'comment':_0xe797('0xc')},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xe797('0xb')],'comment':_0xe797('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 682bd95..dddafcc 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 _0xe6d6=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','includeAll','CloudProvider','findAll','rows','MicrosoftAzure','decryptString','data3','catch','show','include','options','find','service','create','body','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','update','encryptString','params','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','parse','toString','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','refresh_token','data5','data6','startRefreshInterval','microsoftAuthorization:error','message','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','padEnd','slice','map','rawAttributes','fieldName','type','key','model','query'];(function(_0x17fd88,_0x13ee8c){var _0x34007f=function(_0x2aa6b3){while(--_0x2aa6b3){_0x17fd88['push'](_0x17fd88['shift']());}};_0x34007f(++_0x13ee8c);}(_0xe6d6,0xf1));var _0x6e6d=function(_0x29d1ba,_0x7a5223){_0x29d1ba=_0x29d1ba-0x0;var _0x3de575=_0xe6d6[_0x29d1ba];return _0x3de575;};'use strict';var _=require(_0x6e6d('0x0'));var Redis=require(_0x6e6d('0x1'));var qs=require(_0x6e6d('0x2'));var encryptor=require(_0x6e6d('0x3'));var config=require(_0x6e6d('0x4'));var logger=require('../../config/logger')('api');var db=require(_0x6e6d('0x5'))['db'];var oauth=require(_0x6e6d('0x6'));config[_0x6e6d('0x7')]=_[_0x6e6d('0x8')](config['redis'],{'host':_0x6e6d('0x9'),'port':0x18eb});var socket=require(_0x6e6d('0xa'))(new Redis(config[_0x6e6d('0x7')]));var redis=new Redis(config[_0x6e6d('0x7')]);function respondWithStatusCode(_0x64a419,_0x160ea0){_0x160ea0=_0x160ea0||0xcc;return function(_0x4cadfc){if(_0x4cadfc){return _0x64a419[_0x6e6d('0xb')](_0x160ea0);}return _0x64a419[_0x6e6d('0xc')](_0x160ea0)[_0x6e6d('0xd')]();};}function respondWithResult(_0x1dfc51,_0x27f76e){_0x27f76e=_0x27f76e||0xc8;return function(_0x2e43ae){if(_0x2e43ae){return _0x1dfc51['status'](_0x27f76e)[_0x6e6d('0xe')](_0x2e43ae);}};}function respondWithFilteredResult(_0xa05470,_0x385e6a){return function(_0x4a19b7){if(_0x4a19b7){var _0x414d90=typeof _0x385e6a[_0x6e6d('0xf')]===_0x6e6d('0x10')&&typeof _0x385e6a['limit']==='undefined';var _0x1c161b=_0x4a19b7[_0x6e6d('0x11')];var _0x55b283=_0x414d90?0x0:_0x385e6a['offset'];var _0x26767d=_0x414d90?_0x4a19b7[_0x6e6d('0x11')]:_0x385e6a[_0x6e6d('0xf')]+_0x385e6a[_0x6e6d('0x12')];var _0x1fb363;if(_0x26767d>=_0x1c161b){_0x26767d=_0x1c161b;_0x1fb363=0xc8;}else{_0x1fb363=0xce;}_0xa05470[_0x6e6d('0xc')](_0x1fb363);return _0xa05470[_0x6e6d('0x13')](_0x6e6d('0x14'),_0x55b283+'-'+_0x26767d+'/'+_0x1c161b)[_0x6e6d('0xe')](_0x4a19b7);}return null;};}function saveUpdates(_0x31bb09){return function(_0x2d0bc8){if(_0x2d0bc8){return _0x2d0bc8['update'](_0x31bb09)[_0x6e6d('0x15')](function(_0x24c646){return _0x24c646;});}return null;};}function removeEntity(_0x5dd4ca){return function(_0x4200b2){if(_0x4200b2){return _0x4200b2[_0x6e6d('0x16')]()[_0x6e6d('0x15')](function(){_0x5dd4ca[_0x6e6d('0xc')](0xcc)[_0x6e6d('0xd')]();});}};}function handleEntityNotFound(_0x2158df){return function(_0x2fd4b9){if(!_0x2fd4b9){_0x2158df[_0x6e6d('0xb')](0x194);}return _0x2fd4b9;};}function handleError(_0x176618,_0x1ca93f){_0x1ca93f=_0x1ca93f||0x1f4;return function(_0x94eade){logger[_0x6e6d('0x17')](_0x94eade['stack']);if(_0x94eade[_0x6e6d('0x18')]){delete _0x94eade[_0x6e6d('0x18')];}_0x176618[_0x6e6d('0xc')](_0x1ca93f)[_0x6e6d('0x19')](_0x94eade);};}function maskClientSecret(_0x4db583){return _[_0x6e6d('0x1a')](_0x4db583[_0x6e6d('0x1b')](0x0,0x3),0x14,'*');}exports['index']=function(_0x3d94a5,_0x455f10){var _0x44e320={},_0x4b5921={},_0x54c1a5={'count':0x0,'rows':[]};var _0x40fa57=_[_0x6e6d('0x1c')](db['CloudProvider'][_0x6e6d('0x1d')],function(_0x5650ba){return{'name':_0x5650ba[_0x6e6d('0x1e')],'type':_0x5650ba[_0x6e6d('0x1f')][_0x6e6d('0x20')]};});_0x4b5921[_0x6e6d('0x21')]=_['map'](_0x40fa57,_0x6e6d('0x18'));_0x4b5921[_0x6e6d('0x22')]=_[_0x6e6d('0x23')](_0x3d94a5[_0x6e6d('0x22')]);_0x4b5921[_0x6e6d('0x24')]=_[_0x6e6d('0x25')](_0x4b5921[_0x6e6d('0x21')],_0x4b5921[_0x6e6d('0x22')]);_0x44e320['attributes']=_[_0x6e6d('0x25')](_0x4b5921['model'],qs[_0x6e6d('0x26')](_0x3d94a5[_0x6e6d('0x22')][_0x6e6d('0x26')]));_0x44e320['attributes']=_0x44e320[_0x6e6d('0x27')][_0x6e6d('0x28')]?_0x44e320[_0x6e6d('0x27')]:_0x4b5921[_0x6e6d('0x21')];if(!_0x3d94a5['query'][_0x6e6d('0x29')]('nolimit')){_0x44e320[_0x6e6d('0x12')]=qs['limit'](_0x3d94a5[_0x6e6d('0x22')][_0x6e6d('0x12')]);_0x44e320['offset']=qs[_0x6e6d('0xf')](_0x3d94a5[_0x6e6d('0x22')]['offset']);}_0x44e320[_0x6e6d('0x2a')]=qs[_0x6e6d('0x2b')](_0x3d94a5[_0x6e6d('0x22')]['sort']);_0x44e320['where']=qs[_0x6e6d('0x24')](_['pick'](_0x3d94a5[_0x6e6d('0x22')],_0x4b5921['filters']),_0x40fa57);if(_0x3d94a5['query'][_0x6e6d('0x2c')]){_0x44e320[_0x6e6d('0x2d')]=_[_0x6e6d('0x2e')](_0x44e320['where'],{'$or':_[_0x6e6d('0x1c')](_0x40fa57,function(_0x535465){if(_0x535465['type']!==_0x6e6d('0x2f')){var _0x4bdddd={};_0x4bdddd[_0x535465['name']]={'$like':'%'+_0x3d94a5[_0x6e6d('0x22')][_0x6e6d('0x2c')]+'%'};return _0x4bdddd;}})});}_0x44e320=_[_0x6e6d('0x2e')]({},_0x44e320,_0x3d94a5['options']);var _0x28c658={'where':_0x44e320['where']};return db['CloudProvider'][_0x6e6d('0x11')](_0x28c658)['then'](function(_0x2911c0){_0x54c1a5[_0x6e6d('0x11')]=_0x2911c0;if(_0x3d94a5[_0x6e6d('0x22')][_0x6e6d('0x30')]){_0x44e320['include']=[{'all':!![]}];}return db[_0x6e6d('0x31')][_0x6e6d('0x32')](_0x44e320);})[_0x6e6d('0x15')](function(_0x2ea872){_0x54c1a5[_0x6e6d('0x33')]=_[_0x6e6d('0x1c')](_0x2ea872,function(_0x43c93f){if(_0x43c93f['service']===_0x6e6d('0x34')){var _0x70fb3f=encryptor[_0x6e6d('0x35')](_0x43c93f[_0x6e6d('0x36')]);_0x43c93f[_0x6e6d('0x36')]=maskClientSecret(_0x70fb3f);}return _0x43c93f;});return _0x54c1a5;})[_0x6e6d('0x15')](respondWithFilteredResult(_0x455f10,_0x44e320))[_0x6e6d('0x37')](handleError(_0x455f10,null));};exports[_0x6e6d('0x38')]=function(_0x1927b5,_0x41b94a){var _0x2cfc9c={'raw':!![],'where':{'id':_0x1927b5['params']['id']}},_0x4b948e={};_0x4b948e[_0x6e6d('0x21')]=_[_0x6e6d('0x23')](db[_0x6e6d('0x31')][_0x6e6d('0x1d')]);_0x4b948e[_0x6e6d('0x22')]=_[_0x6e6d('0x23')](_0x1927b5[_0x6e6d('0x22')]);_0x4b948e['filters']=_[_0x6e6d('0x25')](_0x4b948e[_0x6e6d('0x21')],_0x4b948e[_0x6e6d('0x22')]);_0x2cfc9c[_0x6e6d('0x27')]=_[_0x6e6d('0x25')](_0x4b948e[_0x6e6d('0x21')],qs[_0x6e6d('0x26')](_0x1927b5[_0x6e6d('0x22')]['fields']));_0x2cfc9c['attributes']=_0x2cfc9c[_0x6e6d('0x27')][_0x6e6d('0x28')]?_0x2cfc9c[_0x6e6d('0x27')]:_0x4b948e[_0x6e6d('0x21')];if(_0x1927b5[_0x6e6d('0x22')][_0x6e6d('0x30')]){_0x2cfc9c[_0x6e6d('0x39')]=[{'all':!![]}];}_0x2cfc9c=_['merge']({},_0x2cfc9c,_0x1927b5[_0x6e6d('0x3a')]);return db[_0x6e6d('0x31')][_0x6e6d('0x3b')](_0x2cfc9c)[_0x6e6d('0x15')](handleEntityNotFound(_0x41b94a,null))[_0x6e6d('0x15')](function(_0x581e73){if(_0x581e73[_0x6e6d('0x3c')]===_0x6e6d('0x34')){var _0x228c64=encryptor[_0x6e6d('0x35')](_0x581e73[_0x6e6d('0x36')]);_0x581e73['data3']=maskClientSecret(_0x228c64);}return _0x581e73;})['then'](respondWithResult(_0x41b94a,null))[_0x6e6d('0x37')](handleError(_0x41b94a,null));};exports[_0x6e6d('0x3d')]=function(_0x3f55f3,_0x3f69fb){if(!_0x3f55f3[_0x6e6d('0x3e')][_0x6e6d('0x18')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x3f55f3['body'][_0x6e6d('0x3c')])throw new Error(_0x6e6d('0x3f'));var _0x311783=db['CloudProvider'][_0x6e6d('0x1d')][_0x6e6d('0x3c')][_0x6e6d('0x40')];if(!_0x311783['includes'](_0x3f55f3['body'][_0x6e6d('0x3c')]))throw new Error(_0x6e6d('0x41')+_0x311783[_0x6e6d('0x42')](',\x20'));if(_0x3f55f3[_0x6e6d('0x3e')][_0x6e6d('0x3c')]===_0x6e6d('0x34')&&_0x3f55f3[_0x6e6d('0x3e')]['data3']){_0x3f55f3[_0x6e6d('0x3e')]['data3']=encryptor['encryptString'](_0x3f55f3['body']['data3']);}return db[_0x6e6d('0x31')][_0x6e6d('0x3d')](_0x3f55f3[_0x6e6d('0x3e')],{})[_0x6e6d('0x15')](respondWithResult(_0x3f69fb,0xc9))[_0x6e6d('0x37')](handleError(_0x3f69fb,null));};exports[_0x6e6d('0x43')]=function(_0x3840d9,_0x4f3d6f){if(_0x3840d9[_0x6e6d('0x3e')]['id']){delete _0x3840d9[_0x6e6d('0x3e')]['id'];}return db[_0x6e6d('0x31')][_0x6e6d('0x3b')]({'where':{'id':_0x3840d9['params']['id']}})[_0x6e6d('0x15')](handleEntityNotFound(_0x4f3d6f,null))[_0x6e6d('0x15')](function(_0x41bea9){if(_0x41bea9[_0x6e6d('0x3c')]===_0x6e6d('0x34')&&_0x3840d9['body'][_0x6e6d('0x36')]){_0x3840d9['body'][_0x6e6d('0x36')]=encryptor[_0x6e6d('0x44')](_0x3840d9[_0x6e6d('0x3e')]['data3']);}return _0x41bea9;})[_0x6e6d('0x15')](saveUpdates(_0x3840d9['body'],null))[_0x6e6d('0x15')](respondWithResult(_0x4f3d6f,null))['catch'](handleError(_0x4f3d6f,null));};exports[_0x6e6d('0x16')]=function(_0x1a5448,_0x116d07){return db['CloudProvider'][_0x6e6d('0x3b')]({'where':{'id':_0x1a5448[_0x6e6d('0x45')]['id']}})[_0x6e6d('0x15')](handleEntityNotFound(_0x116d07,null))[_0x6e6d('0x15')](removeEntity(_0x116d07,null))[_0x6e6d('0x37')](handleError(_0x116d07,null));};exports[_0x6e6d('0x46')]=function(_0x6e3207,_0x4e9619){return db[_0x6e6d('0x31')][_0x6e6d('0x47')]({'where':{'id':_0x6e3207['params']['id']},'raw':!![]})[_0x6e6d('0x15')](function(_0x3589b1){if(!_0x3589b1)return _0x4e9619['sendStatus'](0x194);return{'url':oauth[_0x6e6d('0x48')](_0x3589b1,_0x6e3207['user']['id'])};})['then'](respondWithResult(_0x4e9619,null))[_0x6e6d('0x37')](handleError(_0x4e9619,null));};exports[_0x6e6d('0x49')]=function(_0x12e62b,_0x3f9b0a){var _0x5bc505=_0x12e62b[_0x6e6d('0x3e')];var _0x5009b3;var _0x455ced;if(_0x5bc505[_0x6e6d('0x17')])throw _0x5bc505;redis[_0x6e6d('0x4a')](_0x5bc505[_0x6e6d('0x4b')])[_0x6e6d('0x15')](function(_0x29c88f){if(!_0x29c88f)throw new Error('Invalid\x20state\x20parameter');_0x5009b3=JSON[_0x6e6d('0x4c')](_0x29c88f);var _0x4a5b5b=Buffer['from'](_0x5bc505[_0x6e6d('0x4b')],'base64')[_0x6e6d('0x4d')](_0x6e6d('0x4e'));_0x455ced=JSON['parse'](_0x4a5b5b);if(!oauth['isValidIdToken'](_0x5bc505[_0x6e6d('0x4f')],_0x5009b3[_0x6e6d('0x50')]))throw new Error(_0x6e6d('0x51'));redis[_0x6e6d('0x52')](_0x5bc505['state']);return oauth[_0x6e6d('0x53')](_0x5bc505[_0x6e6d('0x54')],_0x5009b3);})[_0x6e6d('0x15')](function(_0x46c4de){_0x5009b3['data5']=_0x46c4de[_0x6e6d('0x55')];_0x5009b3['data6']=_0x46c4de[_0x6e6d('0x56')];return db[_0x6e6d('0x31')][_0x6e6d('0x43')]({'data5':_0x5009b3[_0x6e6d('0x57')],'data6':_0x5009b3[_0x6e6d('0x58')]},{'where':{'id':_0x5009b3['id']}});})['then'](function(){oauth[_0x6e6d('0x59')](_0x5009b3);socket['emit']('microsoftAuthorization:success',{'id':_0x455ced['id']});return;})['then'](respondWithStatusCode(_0x3f9b0a,null))[_0x6e6d('0x37')](function(_0x42725e){if(_0x455ced){socket['emit'](_0x6e6d('0x5a'),{'id':_0x455ced['id']});}if(!_0x5009b3){logger[_0x6e6d('0x17')]('Invalid\x20authentication\x20state\x20parameter',_0x42725e);return _0x3f9b0a[_0x6e6d('0xc')](0x1f4)['send'](_0x42725e[_0x6e6d('0x5b')]);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x5009b3['id'],JSON['stringify'](_0x42725e));});};
\ No newline at end of file
+var _0x2b27=['includeAll','include','findAll','rows','MicrosoftAzure','decryptString','data3','catch','params','keys','find','create','Name\x20parameter\x20not\x20specified','body','service','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','get','state','parse','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','socket.io-emitter','sendStatus','status','end','json','undefined','count','offset','limit','update','then','destroy','error','stack','name','send','slice','index','map','CloudProvider','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options'];(function(_0x5265c7,_0x2bdcd4){var _0x38f9c2=function(_0x6ba70f){while(--_0x6ba70f){_0x5265c7['push'](_0x5265c7['shift']());}};_0x38f9c2(++_0x2bdcd4);}(_0x2b27,0x1aa));var _0x72b2=function(_0x228ac9,_0x42f065){_0x228ac9=_0x228ac9-0x0;var _0x69fe02=_0x2b27[_0x228ac9];return _0x69fe02;};'use strict';var _=require(_0x72b2('0x0'));var Redis=require(_0x72b2('0x1'));var qs=require(_0x72b2('0x2'));var encryptor=require(_0x72b2('0x3'));var config=require('../../config/environment');var logger=require(_0x72b2('0x4'))(_0x72b2('0x5'));var db=require(_0x72b2('0x6'))['db'];var oauth=require(_0x72b2('0x7'));config['redis']=_[_0x72b2('0x8')](config[_0x72b2('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x72b2('0xa'))(new Redis(config['redis']));var redis=new Redis(config[_0x72b2('0x9')]);function respondWithStatusCode(_0x5e2915,_0x36938f){_0x36938f=_0x36938f||0xcc;return function(_0x146098){if(_0x146098){return _0x5e2915[_0x72b2('0xb')](_0x36938f);}return _0x5e2915[_0x72b2('0xc')](_0x36938f)[_0x72b2('0xd')]();};}function respondWithResult(_0x3c33cf,_0x2d2d1b){_0x2d2d1b=_0x2d2d1b||0xc8;return function(_0x180c3f){if(_0x180c3f){return _0x3c33cf['status'](_0x2d2d1b)[_0x72b2('0xe')](_0x180c3f);}};}function respondWithFilteredResult(_0x50f925,_0xb2bf0a){return function(_0x6a5bca){if(_0x6a5bca){var _0x2e2e13=typeof _0xb2bf0a['offset']==='undefined'&&typeof _0xb2bf0a['limit']===_0x72b2('0xf');var _0x55243e=_0x6a5bca[_0x72b2('0x10')];var _0x325934=_0x2e2e13?0x0:_0xb2bf0a[_0x72b2('0x11')];var _0x454cc9=_0x2e2e13?_0x6a5bca[_0x72b2('0x10')]:_0xb2bf0a[_0x72b2('0x11')]+_0xb2bf0a[_0x72b2('0x12')];var _0x44792a;if(_0x454cc9>=_0x55243e){_0x454cc9=_0x55243e;_0x44792a=0xc8;}else{_0x44792a=0xce;}_0x50f925[_0x72b2('0xc')](_0x44792a);return _0x50f925['set']('Content-Range',_0x325934+'-'+_0x454cc9+'/'+_0x55243e)[_0x72b2('0xe')](_0x6a5bca);}return null;};}function saveUpdates(_0x168c0a){return function(_0x1f9106){if(_0x1f9106){return _0x1f9106[_0x72b2('0x13')](_0x168c0a)[_0x72b2('0x14')](function(_0x228ba1){return _0x228ba1;});}return null;};}function removeEntity(_0x40ab8f){return function(_0x446f68){if(_0x446f68){return _0x446f68[_0x72b2('0x15')]()['then'](function(){_0x40ab8f['status'](0xcc)[_0x72b2('0xd')]();});}};}function handleEntityNotFound(_0x46b7e5){return function(_0x176c38){if(!_0x176c38){_0x46b7e5[_0x72b2('0xb')](0x194);}return _0x176c38;};}function handleError(_0x42f270,_0x2819b6){_0x2819b6=_0x2819b6||0x1f4;return function(_0x1eb8df){logger[_0x72b2('0x16')](_0x1eb8df[_0x72b2('0x17')]);if(_0x1eb8df[_0x72b2('0x18')]){delete _0x1eb8df[_0x72b2('0x18')];}_0x42f270[_0x72b2('0xc')](_0x2819b6)[_0x72b2('0x19')](_0x1eb8df);};}function maskClientSecret(_0x1c6792){return _['padEnd'](_0x1c6792[_0x72b2('0x1a')](0x0,0x3),0x14,'*');}exports[_0x72b2('0x1b')]=function(_0x724c06,_0x4e50fa){var _0x35e04e={},_0x288c99={},_0x561fcc={'count':0x0,'rows':[]};var _0x2b8bfe=_[_0x72b2('0x1c')](db[_0x72b2('0x1d')][_0x72b2('0x1e')],function(_0x4a9665){return{'name':_0x4a9665['fieldName'],'type':_0x4a9665[_0x72b2('0x1f')][_0x72b2('0x20')]};});_0x288c99[_0x72b2('0x21')]=_[_0x72b2('0x1c')](_0x2b8bfe,_0x72b2('0x18'));_0x288c99[_0x72b2('0x22')]=_['keys'](_0x724c06['query']);_0x288c99[_0x72b2('0x23')]=_[_0x72b2('0x24')](_0x288c99['model'],_0x288c99['query']);_0x35e04e[_0x72b2('0x25')]=_[_0x72b2('0x24')](_0x288c99[_0x72b2('0x21')],qs[_0x72b2('0x26')](_0x724c06[_0x72b2('0x22')][_0x72b2('0x26')]));_0x35e04e['attributes']=_0x35e04e['attributes'][_0x72b2('0x27')]?_0x35e04e[_0x72b2('0x25')]:_0x288c99[_0x72b2('0x21')];if(!_0x724c06[_0x72b2('0x22')][_0x72b2('0x28')](_0x72b2('0x29'))){_0x35e04e[_0x72b2('0x12')]=qs[_0x72b2('0x12')](_0x724c06[_0x72b2('0x22')][_0x72b2('0x12')]);_0x35e04e['offset']=qs[_0x72b2('0x11')](_0x724c06[_0x72b2('0x22')]['offset']);}_0x35e04e[_0x72b2('0x2a')]=qs[_0x72b2('0x2b')](_0x724c06[_0x72b2('0x22')][_0x72b2('0x2b')]);_0x35e04e['where']=qs['filters'](_[_0x72b2('0x2c')](_0x724c06[_0x72b2('0x22')],_0x288c99[_0x72b2('0x23')]),_0x2b8bfe);if(_0x724c06[_0x72b2('0x22')][_0x72b2('0x2d')]){_0x35e04e[_0x72b2('0x2e')]=_[_0x72b2('0x2f')](_0x35e04e[_0x72b2('0x2e')],{'$or':_[_0x72b2('0x1c')](_0x2b8bfe,function(_0x51a173){if(_0x51a173['type']!=='VIRTUAL'){var _0x3c7209={};_0x3c7209[_0x51a173[_0x72b2('0x18')]]={'$like':'%'+_0x724c06[_0x72b2('0x22')][_0x72b2('0x2d')]+'%'};return _0x3c7209;}})});}_0x35e04e=_[_0x72b2('0x2f')]({},_0x35e04e,_0x724c06[_0x72b2('0x30')]);var _0x46179d={'where':_0x35e04e[_0x72b2('0x2e')]};return db['CloudProvider'][_0x72b2('0x10')](_0x46179d)[_0x72b2('0x14')](function(_0x30d166){_0x561fcc[_0x72b2('0x10')]=_0x30d166;if(_0x724c06[_0x72b2('0x22')][_0x72b2('0x31')]){_0x35e04e[_0x72b2('0x32')]=[{'all':!![]}];}return db[_0x72b2('0x1d')][_0x72b2('0x33')](_0x35e04e);})[_0x72b2('0x14')](function(_0x5a8786){_0x561fcc[_0x72b2('0x34')]=_[_0x72b2('0x1c')](_0x5a8786,function(_0x5d6a27){if(_0x5d6a27['service']===_0x72b2('0x35')){var _0x1d6ece=encryptor[_0x72b2('0x36')](_0x5d6a27['data3']);_0x5d6a27[_0x72b2('0x37')]=maskClientSecret(_0x1d6ece);}return _0x5d6a27;});return _0x561fcc;})[_0x72b2('0x14')](respondWithFilteredResult(_0x4e50fa,_0x35e04e))[_0x72b2('0x38')](handleError(_0x4e50fa,null));};exports['show']=function(_0x475650,_0xdb889c){var _0x121086={'raw':!![],'where':{'id':_0x475650[_0x72b2('0x39')]['id']}},_0x1cfa82={};_0x1cfa82[_0x72b2('0x21')]=_['keys'](db[_0x72b2('0x1d')]['rawAttributes']);_0x1cfa82['query']=_[_0x72b2('0x3a')](_0x475650[_0x72b2('0x22')]);_0x1cfa82[_0x72b2('0x23')]=_['intersection'](_0x1cfa82[_0x72b2('0x21')],_0x1cfa82['query']);_0x121086['attributes']=_[_0x72b2('0x24')](_0x1cfa82[_0x72b2('0x21')],qs[_0x72b2('0x26')](_0x475650[_0x72b2('0x22')][_0x72b2('0x26')]));_0x121086[_0x72b2('0x25')]=_0x121086[_0x72b2('0x25')][_0x72b2('0x27')]?_0x121086[_0x72b2('0x25')]:_0x1cfa82[_0x72b2('0x21')];if(_0x475650['query']['includeAll']){_0x121086[_0x72b2('0x32')]=[{'all':!![]}];}_0x121086=_[_0x72b2('0x2f')]({},_0x121086,_0x475650['options']);return db[_0x72b2('0x1d')][_0x72b2('0x3b')](_0x121086)[_0x72b2('0x14')](handleEntityNotFound(_0xdb889c,null))[_0x72b2('0x14')](function(_0x62b423){if(_0x62b423['service']===_0x72b2('0x35')){var _0x9e9245=encryptor[_0x72b2('0x36')](_0x62b423[_0x72b2('0x37')]);_0x62b423[_0x72b2('0x37')]=maskClientSecret(_0x9e9245);}return _0x62b423;})[_0x72b2('0x14')](respondWithResult(_0xdb889c,null))[_0x72b2('0x38')](handleError(_0xdb889c,null));};exports[_0x72b2('0x3c')]=function(_0x3d81e0,_0x2b4975){if(!_0x3d81e0['body'][_0x72b2('0x18')])throw new Error(_0x72b2('0x3d'));if(!_0x3d81e0[_0x72b2('0x3e')][_0x72b2('0x3f')])throw new Error(_0x72b2('0x40'));var _0x2b09fc=db[_0x72b2('0x1d')]['rawAttributes'][_0x72b2('0x3f')][_0x72b2('0x41')];if(!_0x2b09fc[_0x72b2('0x42')](_0x3d81e0[_0x72b2('0x3e')]['service']))throw new Error(_0x72b2('0x43')+_0x2b09fc[_0x72b2('0x44')](',\x20'));if(_0x3d81e0['body'][_0x72b2('0x3f')]===_0x72b2('0x35')&&_0x3d81e0[_0x72b2('0x3e')][_0x72b2('0x37')]){_0x3d81e0['body'][_0x72b2('0x37')]=encryptor['encryptString'](_0x3d81e0[_0x72b2('0x3e')][_0x72b2('0x37')]);}return db[_0x72b2('0x1d')]['create'](_0x3d81e0[_0x72b2('0x3e')],{})['then'](respondWithResult(_0x2b4975,0xc9))[_0x72b2('0x38')](handleError(_0x2b4975,null));};exports['update']=function(_0x3dbac3,_0x29d698){if(_0x3dbac3[_0x72b2('0x3e')]['id']){delete _0x3dbac3[_0x72b2('0x3e')]['id'];}return db[_0x72b2('0x1d')]['find']({'where':{'id':_0x3dbac3[_0x72b2('0x39')]['id']}})['then'](handleEntityNotFound(_0x29d698,null))[_0x72b2('0x14')](function(_0x218225){if(_0x218225['service']===_0x72b2('0x35')&&_0x3dbac3[_0x72b2('0x3e')][_0x72b2('0x37')]){_0x3dbac3[_0x72b2('0x3e')][_0x72b2('0x37')]=encryptor['encryptString'](_0x3dbac3['body']['data3']);}return _0x218225;})[_0x72b2('0x14')](saveUpdates(_0x3dbac3[_0x72b2('0x3e')],null))['then'](respondWithResult(_0x29d698,null))[_0x72b2('0x38')](handleError(_0x29d698,null));};exports[_0x72b2('0x15')]=function(_0x4c4f44,_0x1b8d65){return db[_0x72b2('0x1d')][_0x72b2('0x3b')]({'where':{'id':_0x4c4f44['params']['id']}})[_0x72b2('0x14')](handleEntityNotFound(_0x1b8d65,null))[_0x72b2('0x14')](removeEntity(_0x1b8d65,null))[_0x72b2('0x38')](handleError(_0x1b8d65,null));};exports[_0x72b2('0x45')]=function(_0x270d42,_0x19533f){return db[_0x72b2('0x1d')][_0x72b2('0x46')]({'where':{'id':_0x270d42[_0x72b2('0x39')]['id']},'raw':!![]})[_0x72b2('0x14')](function(_0x995682){if(!_0x995682)return _0x19533f[_0x72b2('0xb')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x995682,_0x270d42[_0x72b2('0x47')]['id'])};})[_0x72b2('0x14')](respondWithResult(_0x19533f,null))['catch'](handleError(_0x19533f,null));};exports[_0x72b2('0x48')]=function(_0x468f60,_0x1ced5a){var _0x10300d=_0x468f60[_0x72b2('0x3e')];var _0x500be8;var _0x55c6d8;if(_0x10300d[_0x72b2('0x16')])throw _0x10300d;redis[_0x72b2('0x49')](_0x10300d[_0x72b2('0x4a')])[_0x72b2('0x14')](function(_0x2fcef9){if(!_0x2fcef9)throw new Error('Invalid\x20state\x20parameter');_0x500be8=JSON[_0x72b2('0x4b')](_0x2fcef9);var _0x2052a8=Buffer['from'](_0x10300d['state'],'base64')[_0x72b2('0x4c')](_0x72b2('0x4d'));_0x55c6d8=JSON[_0x72b2('0x4b')](_0x2052a8);if(!oauth[_0x72b2('0x4e')](_0x10300d['id_token'],_0x500be8[_0x72b2('0x4f')]))throw new Error(_0x72b2('0x50'));redis['del'](_0x10300d[_0x72b2('0x4a')]);return oauth[_0x72b2('0x51')](_0x10300d[_0x72b2('0x52')],_0x500be8);})[_0x72b2('0x14')](function(_0x1c47a5){_0x500be8[_0x72b2('0x53')]=_0x1c47a5[_0x72b2('0x54')];_0x500be8[_0x72b2('0x55')]=_0x1c47a5[_0x72b2('0x56')];return db['CloudProvider'][_0x72b2('0x13')]({'data5':_0x500be8['data5'],'data6':_0x500be8['data6']},{'where':{'id':_0x500be8['id']}});})[_0x72b2('0x14')](function(){oauth[_0x72b2('0x57')](_0x500be8);socket[_0x72b2('0x58')](_0x72b2('0x59'),{'id':_0x55c6d8['id']});return;})[_0x72b2('0x14')](respondWithStatusCode(_0x1ced5a,null))[_0x72b2('0x38')](function(_0x17db04){if(_0x55c6d8){socket['emit'](_0x72b2('0x5a'),{'id':_0x55c6d8['id']});}if(!_0x500be8){logger[_0x72b2('0x16')](_0x72b2('0x5b'),_0x17db04);return _0x1ced5a[_0x72b2('0xc')](0x1f4)['send'](_0x17db04[_0x72b2('0x5c')]);}logger[_0x72b2('0x16')](_0x72b2('0x5d'),_0x500be8['id'],JSON[_0x72b2('0x5e')](_0x17db04));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index cdaa06d..344be23 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 _0xb0b7=['./cloudProvider.attributes','define','CloudProvider','cloud_providers','util','../../config/logger','api','bluebird','request-promise','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb0b7,0x7c));var _0x7b0b=function(_0x38ee8c,_0x41ae11){_0x38ee8c=_0x38ee8c-0x0;var _0x95d48c=_0xb0b7[_0x38ee8c];return _0x95d48c;};'use strict';var _=require('lodash');var util=require(_0x7b0b('0x0'));var logger=require(_0x7b0b('0x1'))(_0x7b0b('0x2'));var moment=require('moment');var BPromise=require(_0x7b0b('0x3'));var rp=require(_0x7b0b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7b0b('0x5'));var attributes=require(_0x7b0b('0x6'));module['exports']=function(_0x8c41fa,_0x1145dd){return _0x8c41fa[_0x7b0b('0x7')](_0x7b0b('0x8'),attributes,{'tableName':_0x7b0b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x26eb=['rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','util','../../config/logger','api','bluebird','path'];(function(_0x140c8c,_0xca8737){var _0xf1a4c0=function(_0x227fe6){while(--_0x227fe6){_0x140c8c['push'](_0x140c8c['shift']());}};_0xf1a4c0(++_0xca8737);}(_0x26eb,0xf7));var _0xb26e=function(_0xe38db,_0x489ec9){_0xe38db=_0xe38db-0x0;var _0x4f764c=_0x26eb[_0xe38db];return _0x4f764c;};'use strict';var _=require('lodash');var util=require(_0xb26e('0x0'));var logger=require(_0xb26e('0x1'))(_0xb26e('0x2'));var moment=require('moment');var BPromise=require(_0xb26e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb26e('0x4'));var rimraf=require(_0xb26e('0x5'));var config=require(_0xb26e('0x6'));var attributes=require(_0xb26e('0x7'));module[_0xb26e('0x8')]=function(_0x37f651,_0x300121){return _0x37f651[_0xb26e('0x9')](_0xb26e('0xa'),attributes,{'tableName':_0xb26e('0xb'),'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 8053771..ae28f14 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 _0x3c20=['authorization_code','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','moment','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','data2','code','id_token','stringify','toString','base64','randomBytes','hex','client_id','response_type','redirect_uri','data4','form_post','scope','nonce','prompt','login','key','oauth2Claims','oauth2/','data1','decode','payload','iss','issuer','audience','isAfter','unix','exp','resolve','then','data3','data6','decryptString','POST','replace','{TENANT_ID}','access_token','refresh_token','CloudProvider','update','data5','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s'];(function(_0x4d674b,_0x176474){var _0x535a1f=function(_0xac7726){while(--_0xac7726){_0x4d674b['push'](_0x4d674b['shift']());}};_0x535a1f(++_0x176474);}(_0x3c20,0xa1));var _0x03c2=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x3c20[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0x03c2('0x0'));var Redis=require('ioredis');var rp=require('request-promise');var util=require('util');var encryptor=require(_0x03c2('0x1'));var config=require(_0x03c2('0x2'));var logger=require(_0x03c2('0x3'))(_0x03c2('0x4'));var schedule=require(_0x03c2('0x5'));var db=require(_0x03c2('0x6'))['db'];config['redis']=_['defaults'](config[_0x03c2('0x7')],{'host':_0x03c2('0x8'),'port':0x18eb});var redis=new Redis(config[_0x03c2('0x7')]);var MICROSOFT_AUTH_URL=_0x03c2('0x9');var AZURE_AUTH_SCOPES={'Outlook365':[_0x03c2('0xa'),'profile',_0x03c2('0xb'),_0x03c2('0xc'),_0x03c2('0xd'),_0x03c2('0xe'),_0x03c2('0xf')],'Dynamics365':['openid',_0x03c2('0xc')]};var MICROSOFT_AUTH_ENDPOINT=_0x03c2('0x10');var MICROSOFT_TOKEN_ENDPOINT=_0x03c2('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x13a988){var _0x240266=_[_0x03c2('0x12')](AZURE_AUTH_SCOPES[_0x13a988[_0x03c2('0x13')]]);if(_0x13a988[_0x03c2('0x13')]===_0x03c2('0x14'))_0x240266[_0x03c2('0x15')](_0x13a988[_0x03c2('0x16')]+_0x03c2('0x17'));return _0x240266[_0x03c2('0x18')]('\x20');}function getAccessTokenScope(_0xf250a0){if(_0xf250a0[_0x03c2('0x13')]===_0x03c2('0x19'))return _0x03c2('0xd');if(_0xf250a0['type']===_0x03c2('0x14'))return _0xf250a0[_0x03c2('0x16')]+_0x03c2('0x17');}function generateMicrosoftAuthorizationUrl(_0x12589e,_0x80bad7){var _0x4bbcfe=MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x12589e[_0x03c2('0x1a')]);var _0x5d50e1=[_0x03c2('0x1b'),_0x03c2('0x1c')];var _0x380d8e=Buffer['from'](JSON[_0x03c2('0x1d')]({'id':_0x80bad7}))[_0x03c2('0x1e')](_0x03c2('0x1f'));var _0x5233b3=crypto[_0x03c2('0x20')](0x10)[_0x03c2('0x1e')](_0x03c2('0x21'));var _0x3d0a4d=getAuthorizationScopes(_0x12589e);var _0x6bcce4=[{'key':_0x03c2('0x22'),'value':_0x12589e['data1']},{'key':_0x03c2('0x23'),'value':encodeURIComponent(_0x5d50e1[_0x03c2('0x18')]('\x20'))},{'key':_0x03c2('0x24'),'value':_0x12589e[_0x03c2('0x25')]},{'key':'response_mode','value':_0x03c2('0x26')},{'key':_0x03c2('0x27'),'value':encodeURIComponent(_0x3d0a4d)},{'key':'state','value':_0x380d8e},{'key':_0x03c2('0x28'),'value':_0x5233b3},{'key':_0x03c2('0x29'),'value':_0x03c2('0x2a')}];var _0x3e1cb6=_0x4bbcfe+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x03c2('0x12')](_0x6bcce4,function(_0x3bd7b8){return _0x3bd7b8[_0x03c2('0x2b')]+'='+_0x3bd7b8['value'];})[_0x03c2('0x18')]('&');_0x12589e[_0x03c2('0x2c')]={'issuer':_0x4bbcfe['replace'](_0x03c2('0x2d'),''),'audience':_0x12589e[_0x03c2('0x2e')],'state':_0x380d8e,'nonce':_0x5233b3};redis['set'](_0x380d8e,JSON[_0x03c2('0x1d')](_0x12589e));return _0x3e1cb6;}function isValidIdToken(_0x1b6d3e,_0xef9aeb){try{var _0x187d0b=jwt[_0x03c2('0x2f')](_0x1b6d3e,{'complete':!![]});var _0x57817e=_0x187d0b[_0x03c2('0x30')];if(_0x57817e[_0x03c2('0x31')]!==_0xef9aeb[_0x03c2('0x32')])return![];if(_0x57817e['aud']!==_0xef9aeb[_0x03c2('0x33')])return![];if(_0x57817e[_0x03c2('0x28')]!==_0xef9aeb['nonce'])return![];if(moment()[_0x03c2('0x34')](moment[_0x03c2('0x35')](_0x57817e[_0x03c2('0x36')])))return![];return!![];}catch(_0x15b55a){throw _0x15b55a;}}function refreshOauth2MicrosoftAccessToken(_0x33d68c){return Promise[_0x03c2('0x37')]()[_0x03c2('0x38')](function(){if(_0x33d68c[_0x03c2('0x39')])return _0x33d68c;return db['CloudProvider']['findOne']({'where':{'id':_0x33d68c['id']},'raw':!![]});})[_0x03c2('0x38')](function(_0x32c4b1){var _0x250810={'grant_type':'refresh_token','refresh_token':_0x32c4b1[_0x03c2('0x3a')],'scope':getAccessTokenScope(_0x32c4b1),'redirect_uri':_0x32c4b1[_0x03c2('0x25')],'client_id':_0x32c4b1['data1'],'client_secret':encryptor[_0x03c2('0x3b')](_0x32c4b1[_0x03c2('0x39')])};var _0x182fb3={'method':_0x03c2('0x3c'),'uri':MICROSOFT_AUTH_URL[_0x03c2('0x3d')](_0x03c2('0x3e'),_0x32c4b1['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x250810,'json':!![]};return rp(_0x182fb3);})[_0x03c2('0x38')](function(_0x431ffb){_0x33d68c['data5']=_0x431ffb[_0x03c2('0x3f')];_0x33d68c['data6']=_0x431ffb[_0x03c2('0x40')];return db[_0x03c2('0x41')][_0x03c2('0x42')]({'data5':_0x33d68c[_0x03c2('0x43')],'data6':_0x33d68c[_0x03c2('0x3a')]},{'where':{'id':_0x33d68c['id']}});})[_0x03c2('0x38')](function(){return _0x33d68c;})['catch'](function(_0x2ead81){logger[_0x03c2('0x44')](_0x03c2('0x45'),_0x33d68c['id'],_0x2ead81);});}function getOauth2MicrosoftAccessToken(_0x2ab57f,_0x14ddaa){var _0x509c21={'grant_type':_0x03c2('0x46'),'code':_0x2ab57f,'scope':getAccessTokenScope(_0x14ddaa),'redirect_uri':_0x14ddaa[_0x03c2('0x25')],'client_id':_0x14ddaa[_0x03c2('0x2e')],'client_secret':encryptor[_0x03c2('0x3b')](_0x14ddaa[_0x03c2('0x39')])};var _0x11668e={'method':_0x03c2('0x3c'),'uri':MICROSOFT_AUTH_URL[_0x03c2('0x3d')](_0x03c2('0x3e'),_0x14ddaa[_0x03c2('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x509c21,'json':!![]};return rp(_0x11668e);}function startRefreshInterval(_0x54976c){var _0x4da6ed=schedule[_0x03c2('0x47')];if(_0x4da6ed[_0x54976c['id']])clearInterval(_0x4da6ed[_0x54976c['id']]);_0x4da6ed[_0x54976c['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x54976c['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x4da6ed;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x03c2('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x03c2('0x38')](function(_0x393559){var _0x232d42=_0x393559['map'](function(_0x48c595){return refreshOauth2MicrosoftAccessToken(_0x48c595)[_0x03c2('0x38')](function(_0x1e2e5a){startRefreshInterval(_0x1e2e5a);});});return Promise[_0x03c2('0x49')](_0x232d42);})['catch'](function(_0x2e2a4a){var _0x2823e9=_0x2e2a4a?util[_0x03c2('0x4a')](_0x2e2a4a,{'showHidden':![],'depth':null}):'';logger['error'](_0x03c2('0x4b'),_0x2823e9);});}module[_0x03c2('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xcfc4=['client_id','data1','response_type','data4','response_mode','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','decode','payload','issuer','aud','audience','isAfter','unix','exp','resolve','data3','CloudProvider','findOne','then','refresh_token','data6','decryptString','POST','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','all','inspect','exports','lodash','jsonwebtoken','request-promise','util','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','map','type','Dynamics365','push','join','data7','/.default','replace','{TENANT_ID}','data2','id_token','stringify','toString','base64','hex'];(function(_0x3a2225,_0xb6600){var _0x5c8040=function(_0x2bdb09){while(--_0x2bdb09){_0x3a2225['push'](_0x3a2225['shift']());}};_0x5c8040(++_0xb6600);}(_0xcfc4,0x199));var _0x4cfc=function(_0x6a93d1,_0x308671){_0x6a93d1=_0x6a93d1-0x0;var _0x48bec9=_0xcfc4[_0x6a93d1];return _0x48bec9;};'use strict';var _=require(_0x4cfc('0x0'));var crypto=require('crypto');var jwt=require(_0x4cfc('0x1'));var moment=require('moment');var Redis=require('ioredis');var rp=require(_0x4cfc('0x2'));var util=require(_0x4cfc('0x3'));var encryptor=require('../../components/encryptor');var config=require(_0x4cfc('0x4'));var logger=require(_0x4cfc('0x5'))(_0x4cfc('0x6'));var schedule=require(_0x4cfc('0x7'));var db=require(_0x4cfc('0x8'))['db'];config['redis']=_[_0x4cfc('0x9')](config[_0x4cfc('0xa')],{'host':_0x4cfc('0xb'),'port':0x18eb});var redis=new Redis(config[_0x4cfc('0xa')]);var MICROSOFT_AUTH_URL=_0x4cfc('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x4cfc('0xd'),'profile',_0x4cfc('0xe'),_0x4cfc('0xf'),_0x4cfc('0x10'),_0x4cfc('0x11'),_0x4cfc('0x12')],'Dynamics365':['openid',_0x4cfc('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x4cfc('0x13');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x19c647){var _0x5db77c=_[_0x4cfc('0x14')](AZURE_AUTH_SCOPES[_0x19c647['type']]);if(_0x19c647[_0x4cfc('0x15')]===_0x4cfc('0x16'))_0x5db77c[_0x4cfc('0x17')](_0x19c647['data7']+'/.default');return _0x5db77c[_0x4cfc('0x18')]('\x20');}function getAccessTokenScope(_0xde6aa9){if(_0xde6aa9['type']==='Outlook365')return _0x4cfc('0x10');if(_0xde6aa9['type']==='Dynamics365')return _0xde6aa9[_0x4cfc('0x19')]+_0x4cfc('0x1a');}function generateMicrosoftAuthorizationUrl(_0x40ee18,_0x14043f){var _0x42c891=MICROSOFT_AUTH_URL[_0x4cfc('0x1b')](_0x4cfc('0x1c'),_0x40ee18[_0x4cfc('0x1d')]);var _0x46bc83=['code',_0x4cfc('0x1e')];var _0x192e61=Buffer['from'](JSON[_0x4cfc('0x1f')]({'id':_0x14043f}))[_0x4cfc('0x20')](_0x4cfc('0x21'));var _0x5f2c36=crypto['randomBytes'](0x10)[_0x4cfc('0x20')](_0x4cfc('0x22'));var _0x104024=getAuthorizationScopes(_0x40ee18);var _0x4623da=[{'key':_0x4cfc('0x23'),'value':_0x40ee18[_0x4cfc('0x24')]},{'key':_0x4cfc('0x25'),'value':encodeURIComponent(_0x46bc83[_0x4cfc('0x18')]('\x20'))},{'key':'redirect_uri','value':_0x40ee18[_0x4cfc('0x26')]},{'key':_0x4cfc('0x27'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x104024)},{'key':_0x4cfc('0x28'),'value':_0x192e61},{'key':_0x4cfc('0x29'),'value':_0x5f2c36},{'key':_0x4cfc('0x2a'),'value':_0x4cfc('0x2b')}];var _0x5cf7bd=_0x42c891+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x4cfc('0x14')](_0x4623da,function(_0x363aa6){return _0x363aa6[_0x4cfc('0x2c')]+'='+_0x363aa6[_0x4cfc('0x2d')];})[_0x4cfc('0x18')]('&');_0x40ee18[_0x4cfc('0x2e')]={'issuer':_0x42c891[_0x4cfc('0x1b')](_0x4cfc('0x2f'),''),'audience':_0x40ee18[_0x4cfc('0x24')],'state':_0x192e61,'nonce':_0x5f2c36};redis['set'](_0x192e61,JSON[_0x4cfc('0x1f')](_0x40ee18));return _0x5cf7bd;}function isValidIdToken(_0x669ac8,_0x28f196){try{var _0x336b24=jwt[_0x4cfc('0x30')](_0x669ac8,{'complete':!![]});var _0x5a5d6a=_0x336b24[_0x4cfc('0x31')];if(_0x5a5d6a['iss']!==_0x28f196[_0x4cfc('0x32')])return![];if(_0x5a5d6a[_0x4cfc('0x33')]!==_0x28f196[_0x4cfc('0x34')])return![];if(_0x5a5d6a[_0x4cfc('0x29')]!==_0x28f196['nonce'])return![];if(moment()[_0x4cfc('0x35')](moment[_0x4cfc('0x36')](_0x5a5d6a[_0x4cfc('0x37')])))return![];return!![];}catch(_0x4f1ef4){throw _0x4f1ef4;}}function refreshOauth2MicrosoftAccessToken(_0x56f1d8){return Promise[_0x4cfc('0x38')]()['then'](function(){if(_0x56f1d8[_0x4cfc('0x39')])return _0x56f1d8;return db[_0x4cfc('0x3a')][_0x4cfc('0x3b')]({'where':{'id':_0x56f1d8['id']},'raw':!![]});})[_0x4cfc('0x3c')](function(_0x2893d3){var _0x3ca7e2={'grant_type':_0x4cfc('0x3d'),'refresh_token':_0x2893d3[_0x4cfc('0x3e')],'scope':getAccessTokenScope(_0x2893d3),'redirect_uri':_0x2893d3[_0x4cfc('0x26')],'client_id':_0x2893d3['data1'],'client_secret':encryptor[_0x4cfc('0x3f')](_0x2893d3[_0x4cfc('0x39')])};var _0x49b3a6={'method':_0x4cfc('0x40'),'uri':MICROSOFT_AUTH_URL[_0x4cfc('0x1b')](_0x4cfc('0x1c'),_0x2893d3['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3ca7e2,'json':!![]};return rp(_0x49b3a6);})[_0x4cfc('0x3c')](function(_0x41f2cb){_0x56f1d8[_0x4cfc('0x41')]=_0x41f2cb['access_token'];_0x56f1d8[_0x4cfc('0x3e')]=_0x41f2cb[_0x4cfc('0x3d')];return db[_0x4cfc('0x3a')]['update']({'data5':_0x56f1d8[_0x4cfc('0x41')],'data6':_0x56f1d8[_0x4cfc('0x3e')]},{'where':{'id':_0x56f1d8['id']}});})[_0x4cfc('0x3c')](function(){return _0x56f1d8;})[_0x4cfc('0x42')](function(_0x379e20){logger[_0x4cfc('0x43')](_0x4cfc('0x44'),_0x56f1d8['id'],_0x379e20);});}function getOauth2MicrosoftAccessToken(_0x55abdf,_0x41153d){var _0x2b2db6={'grant_type':'authorization_code','code':_0x55abdf,'scope':getAccessTokenScope(_0x41153d),'redirect_uri':_0x41153d[_0x4cfc('0x26')],'client_id':_0x41153d[_0x4cfc('0x24')],'client_secret':encryptor[_0x4cfc('0x3f')](_0x41153d[_0x4cfc('0x39')])};var _0x915ecc={'method':_0x4cfc('0x40'),'uri':MICROSOFT_AUTH_URL[_0x4cfc('0x1b')](_0x4cfc('0x1c'),_0x41153d[_0x4cfc('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2b2db6,'json':!![]};return rp(_0x915ecc);}function startRefreshInterval(_0xaf2987){var _0x33c75=schedule[_0x4cfc('0x45')];if(_0x33c75[_0xaf2987['id']])clearInterval(_0x33c75[_0xaf2987['id']]);_0x33c75[_0xaf2987['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x4cfc('0x46')](this,{'id':_0xaf2987['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x4cfc('0x45')]=_0x33c75;}function startAllRefreshIntervals(){return db[_0x4cfc('0x3a')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x4cfc('0x3c')](function(_0x1f75b0){var _0x4a52e8=_0x1f75b0[_0x4cfc('0x14')](function(_0x44078d){return refreshOauth2MicrosoftAccessToken(_0x44078d)[_0x4cfc('0x3c')](function(_0x17a030){startRefreshInterval(_0x17a030);});});return Promise[_0x4cfc('0x47')](_0x4a52e8);})[_0x4cfc('0x42')](function(_0xea6184){var _0x146882=_0xea6184?util[_0x4cfc('0x48')](_0xea6184,{'showHidden':![],'depth':null}):'';logger[_0x4cfc('0x43')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x146882);});}module[_0x4cfc('0x49')]={'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 210b04b..998e6d1 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 _0x8f25=['catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x58a021,_0x17bc70){var _0x194761=function(_0x32db18){while(--_0x32db18){_0x58a021['push'](_0x58a021['shift']());}};_0x194761(++_0x17bc70);}(_0x8f25,0x14b));var _0x58f2=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x8f25[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x58f2('0x0'));var util=require(_0x58f2('0x1'));var moment=require(_0x58f2('0x2'));var BPromise=require(_0x58f2('0x3'));var rs=require(_0x58f2('0x4'));var fs=require('fs');var Redis=require(_0x58f2('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x58f2('0x6'));var config=require(_0x58f2('0x7'));var jayson=require(_0x58f2('0x8'));var client=jayson['client'][_0x58f2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26f94f,_0x3d5efe,_0x107b61){return new BPromise(function(_0xf47f9,_0x1209e2){return client[_0x58f2('0xa')](_0x26f94f,_0x107b61)[_0x58f2('0xb')](function(_0x4b56c1){logger[_0x58f2('0xc')](_0x58f2('0xd'),_0x3d5efe,_0x58f2('0xe'));logger[_0x58f2('0xf')](_0x58f2('0x10'),_0x3d5efe,'request\x20sent',JSON[_0x58f2('0x11')](_0x4b56c1));if(_0x4b56c1[_0x58f2('0x12')]){if(_0x4b56c1[_0x58f2('0x12')]['code']===0x1f4){logger[_0x58f2('0x12')](_0x58f2('0xd'),_0x3d5efe,_0x4b56c1['error'][_0x58f2('0x13')]);return _0x1209e2(_0x4b56c1[_0x58f2('0x12')]['message']);}logger[_0x58f2('0x12')](_0x58f2('0xd'),_0x3d5efe,_0x4b56c1[_0x58f2('0x12')][_0x58f2('0x13')]);return _0xf47f9(_0x4b56c1[_0x58f2('0x12')][_0x58f2('0x13')]);}else{logger[_0x58f2('0xc')](_0x58f2('0xd'),_0x3d5efe,_0x58f2('0xe'));_0xf47f9(_0x4b56c1[_0x58f2('0x14')][_0x58f2('0x13')]);}})[_0x58f2('0x15')](function(_0x4af52c){logger[_0x58f2('0x12')]('CloudProvider,\x20%s,\x20%s',_0x3d5efe,_0x4af52c);_0x1209e2(_0x4af52c);});});}
\ No newline at end of file
+var _0x3e22=['http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','code','error','CloudProvider,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client'];(function(_0x2ddb6d,_0x25d45b){var _0x56c103=function(_0x4f73c4){while(--_0x4f73c4){_0x2ddb6d['push'](_0x2ddb6d['shift']());}};_0x56c103(++_0x25d45b);}(_0x3e22,0xa8));var _0x23e2=function(_0x4cb8e7,_0x2e1d22){_0x4cb8e7=_0x4cb8e7-0x0;var _0x3d0188=_0x3e22[_0x4cb8e7];return _0x3d0188;};'use strict';var _=require('lodash');var util=require(_0x23e2('0x0'));var moment=require('moment');var BPromise=require(_0x23e2('0x1'));var rs=require(_0x23e2('0x2'));var fs=require('fs');var Redis=require(_0x23e2('0x3'));var db=require(_0x23e2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x23e2('0x5'));var config=require(_0x23e2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x23e2('0x7')][_0x23e2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a8351,_0x927fbb,_0xb71434){return new BPromise(function(_0x4c13ae,_0x64c91b){return client[_0x23e2('0x9')](_0x3a8351,_0xb71434)[_0x23e2('0xa')](function(_0x75da0a){logger[_0x23e2('0xb')]('CloudProvider,\x20%s,\x20%s',_0x927fbb,_0x23e2('0xc'));logger[_0x23e2('0xd')](_0x23e2('0xe'),_0x927fbb,_0x23e2('0xc'),JSON[_0x23e2('0xf')](_0x75da0a));if(_0x75da0a['error']){if(_0x75da0a['error'][_0x23e2('0x10')]===0x1f4){logger[_0x23e2('0x11')](_0x23e2('0x12'),_0x927fbb,_0x75da0a[_0x23e2('0x11')][_0x23e2('0x13')]);return _0x64c91b(_0x75da0a[_0x23e2('0x11')][_0x23e2('0x13')]);}logger[_0x23e2('0x11')](_0x23e2('0x12'),_0x927fbb,_0x75da0a[_0x23e2('0x11')][_0x23e2('0x13')]);return _0x4c13ae(_0x75da0a[_0x23e2('0x11')][_0x23e2('0x13')]);}else{logger[_0x23e2('0xb')]('CloudProvider,\x20%s,\x20%s',_0x927fbb,_0x23e2('0xc'));_0x4c13ae(_0x75da0a[_0x23e2('0x14')][_0x23e2('0x13')]);}})[_0x23e2('0x15')](function(_0x276c2d){logger[_0x23e2('0x11')](_0x23e2('0x12'),_0x927fbb,_0x276c2d);_0x64c91b(_0x276c2d);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index a1a7354..093d2ce 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(_0x12a3c9,_0x2e8ab3){var _0x64e096=function(_0x35890f){while(--_0x35890f){_0x12a3c9['push'](_0x12a3c9['shift']());}};_0x64e096(++_0x2e8ab3);}(_0xdb28,0x106));var _0x8db2=function(_0x29a7a8,_0xfc5658){_0x29a7a8=_0x29a7a8-0x0;var _0xb71fdf=_0xdb28[_0x29a7a8];return _0xb71fdf;};'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 _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x7a54,0x106));var _0x47a5=function(_0x19b2b6,_0x2dec56){_0x19b2b6=_0x19b2b6-0x0;var _0xf478bc=_0x7a54[_0x19b2b6];return _0xf478bc;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 922c6ef..60bdb37 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 _0x011c=['STRING','name','sequelize','exports'];(function(_0x2b9c17,_0xc8ac81){var _0x28711d=function(_0x135903){while(--_0x135903){_0x2b9c17['push'](_0x2b9c17['shift']());}};_0x28711d(++_0xc8ac81);}(_0x011c,0x8e));var _0xc011=function(_0x2e9329,_0x254609){_0x2e9329=_0x2e9329-0x0;var _0x1a3303=_0x011c[_0x2e9329];return _0x1a3303;};'use strict';var Sequelize=require(_0xc011('0x0'));module[_0xc011('0x1')]={'name':{'type':Sequelize[_0xc011('0x2')],'unique':_0xc011('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc011('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xc011('0x2')]},'phone':{'type':Sequelize[_0xc011('0x2')]},'fax':{'type':Sequelize[_0xc011('0x2')]},'type':{'type':Sequelize[_0xc011('0x2')]},'street':{'type':Sequelize[_0xc011('0x2')]},'postalCode':{'type':Sequelize[_0xc011('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xc011('0x2')]},'email':{'type':Sequelize[_0xc011('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xc011('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xc011('0x2')]},'description':{'type':Sequelize[_0xc011('0x2')]}};
\ No newline at end of file
+var _0x3c14=['sequelize','STRING','name'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x3c14,0x186));var _0x43c1=function(_0x258b93,_0x188ccc){_0x258b93=_0x258b93-0x0;var _0x35484b=_0x3c14[_0x258b93];return _0x35484b;};'use strict';var Sequelize=require(_0x43c1('0x0'));module['exports']={'name':{'type':Sequelize[_0x43c1('0x1')],'unique':_0x43c1('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x43c1('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x43c1('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x43c1('0x1')]},'type':{'type':Sequelize[_0x43c1('0x1')]},'street':{'type':Sequelize[_0x43c1('0x1')]},'postalCode':{'type':Sequelize[_0x43c1('0x1')]},'city':{'type':Sequelize[_0x43c1('0x1')]},'country':{'type':Sequelize[_0x43c1('0x1')]},'email':{'type':Sequelize[_0x43c1('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x43c1('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 83311aa..c0945b7 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 _0xc1bc=['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','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','get','Companies','end','error','stack','name','send','index','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','map','includeAll','include','CmCompany','findAll','catch','show','rawAttributes','length','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addContacts','CmContact','omit','ids','getContacts','findOne','sort','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel'];(function(_0x3d4084,_0x36fa5e){var _0xe0324b=function(_0x5dcc3e){while(--_0x5dcc3e){_0x3d4084['push'](_0x3d4084['shift']());}};_0xe0324b(++_0x36fa5e);}(_0xc1bc,0x15f));var _0xcc1b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc1bc[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xcc1b('0x0'));var rimraf=require(_0xcc1b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcc1b('0x2'));var rp=require(_0xcc1b('0x3'));var moment=require(_0xcc1b('0x4'));var BPromise=require(_0xcc1b('0x5'));var Mustache=require(_0xcc1b('0x6'));var util=require(_0xcc1b('0x7'));var path=require(_0xcc1b('0x8'));var sox=require(_0xcc1b('0x9'));var csv=require(_0xcc1b('0xa'));var ejs=require(_0xcc1b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xcc1b('0xc'));var crypto=require(_0xcc1b('0xd'));var jsforce=require(_0xcc1b('0xe'));var deskjs=require(_0xcc1b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcc1b('0x10'));var Papa=require(_0xcc1b('0x11'));var Redis=require(_0xcc1b('0x12'));var authService=require(_0xcc1b('0x13'));var qs=require(_0xcc1b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcc1b('0x15'));var logger=require(_0xcc1b('0x16'))(_0xcc1b('0x17'));var utils=require('../../config/utils');var config=require(_0xcc1b('0x18'));var licenseUtil=require(_0xcc1b('0x19'));var db=require(_0xcc1b('0x1a'))['db'];function respondWithStatusCode(_0x1eb0a3,_0x766ece){_0x766ece=_0x766ece||0xcc;return function(_0x2183e1){if(_0x2183e1){return _0x1eb0a3[_0xcc1b('0x1b')](_0x766ece);}return _0x1eb0a3[_0xcc1b('0x1c')](_0x766ece)['end']();};}function respondWithResult(_0x8c7cf5,_0x40a521){_0x40a521=_0x40a521||0xc8;return function(_0x2077e9){if(_0x2077e9){return _0x8c7cf5[_0xcc1b('0x1c')](_0x40a521)[_0xcc1b('0x1d')](_0x2077e9);}};}function respondWithFilteredResult(_0x47d637,_0x78f6d4){return function(_0x3f54af){if(_0x3f54af){var _0x4814d6=typeof _0x78f6d4[_0xcc1b('0x1e')]===_0xcc1b('0x1f')&&typeof _0x78f6d4['limit']===_0xcc1b('0x1f');var _0x2f9f67=_0x3f54af[_0xcc1b('0x20')];var _0x13088d=_0x4814d6?0x0:_0x78f6d4[_0xcc1b('0x1e')];var _0x165233=_0x4814d6?_0x3f54af[_0xcc1b('0x20')]:_0x78f6d4[_0xcc1b('0x1e')]+_0x78f6d4[_0xcc1b('0x21')];var _0x85b6c6;if(_0x165233>=_0x2f9f67){_0x165233=_0x2f9f67;_0x85b6c6=0xc8;}else{_0x85b6c6=0xce;}_0x47d637[_0xcc1b('0x1c')](_0x85b6c6);return _0x47d637[_0xcc1b('0x22')]('Content-Range',_0x13088d+'-'+_0x165233+'/'+_0x2f9f67)[_0xcc1b('0x1d')](_0x3f54af);}return null;};}function patchUpdates(_0x1ce7ec){return function(_0x5753d7){try{jsonpatch[_0xcc1b('0x23')](_0x5753d7,_0x1ce7ec,!![]);}catch(_0x17b482){return BPromise[_0xcc1b('0x24')](_0x17b482);}return _0x5753d7['save']();};}function saveUpdates(_0x585c28,_0x27d224){return function(_0x39d4b7){if(_0x39d4b7){return _0x39d4b7[_0xcc1b('0x25')](_0x585c28)[_0xcc1b('0x26')](function(_0x13ade0){return _0x13ade0;});}return null;};}function removeEntity(_0x5e8bc0,_0x4b46d4){return function(_0x50ab73){if(_0x50ab73){return _0x50ab73[_0xcc1b('0x27')]()[_0xcc1b('0x26')](function(){var _0x5c7e35=_0x50ab73[_0xcc1b('0x28')]({'plain':!![]});var _0x2c2b4f=_0xcc1b('0x29');return db['UserProfileResource'][_0xcc1b('0x27')]({'where':{'type':_0x2c2b4f,'resourceId':_0x5c7e35['id']}})[_0xcc1b('0x26')](function(){return _0x50ab73;});})[_0xcc1b('0x26')](function(){_0x5e8bc0[_0xcc1b('0x1c')](0xcc)[_0xcc1b('0x2a')]();});}};}function handleEntityNotFound(_0x25bc43,_0x54cc22){return function(_0x56d4ba){if(!_0x56d4ba){_0x25bc43['sendStatus'](0x194);}return _0x56d4ba;};}function handleError(_0x3a84b2,_0x30f87c){_0x30f87c=_0x30f87c||0x1f4;return function(_0x5ab84b){logger[_0xcc1b('0x2b')](_0x5ab84b[_0xcc1b('0x2c')]);if(_0x5ab84b[_0xcc1b('0x2d')]){delete _0x5ab84b[_0xcc1b('0x2d')];}_0x3a84b2[_0xcc1b('0x1c')](_0x30f87c)[_0xcc1b('0x2e')](_0x5ab84b);};}exports[_0xcc1b('0x2f')]=function(_0xc994c6,_0x3118cb){var _0x4c1cb8={},_0x484bd3={},_0x423a8f={'count':0x0,'rows':[]};return db['CmCompany']['describe']()['then'](function(_0x36fdd9){_0x484bd3[_0xcc1b('0x30')]=_[_0xcc1b('0x31')](_0x36fdd9);_0x484bd3[_0xcc1b('0x32')]=_[_0xcc1b('0x31')](_0xc994c6['query']);_0x484bd3['filters']=_[_0xcc1b('0x33')](_0x484bd3[_0xcc1b('0x30')],_0x484bd3['query']);_0x4c1cb8[_0xcc1b('0x34')]=_[_0xcc1b('0x33')](_0x484bd3[_0xcc1b('0x30')],qs[_0xcc1b('0x35')](_0xc994c6[_0xcc1b('0x32')]['fields']));_0x4c1cb8['attributes']=_0x4c1cb8[_0xcc1b('0x34')]['length']?_0x4c1cb8['attributes']:_0x484bd3[_0xcc1b('0x30')];if(!_0xc994c6[_0xcc1b('0x32')][_0xcc1b('0x36')](_0xcc1b('0x37'))){_0x4c1cb8[_0xcc1b('0x21')]=qs[_0xcc1b('0x21')](_0xc994c6[_0xcc1b('0x32')][_0xcc1b('0x21')]);_0x4c1cb8[_0xcc1b('0x1e')]=qs[_0xcc1b('0x1e')](_0xc994c6[_0xcc1b('0x32')][_0xcc1b('0x1e')]);}_0x4c1cb8[_0xcc1b('0x38')]=qs['sort'](_0xc994c6[_0xcc1b('0x32')]['sort']);_0x4c1cb8[_0xcc1b('0x39')]=qs['filters'](_[_0xcc1b('0x3a')](_0xc994c6[_0xcc1b('0x32')],_0x484bd3[_0xcc1b('0x3b')]),_0x36fdd9);if(_0xc994c6[_0xcc1b('0x32')][_0xcc1b('0x3c')]){_0x4c1cb8[_0xcc1b('0x39')]=_[_0xcc1b('0x3d')](_0x4c1cb8[_0xcc1b('0x39')],{'$or':_[_0xcc1b('0x3e')](_0x4c1cb8[_0xcc1b('0x34')],function(_0x37629e){var _0x140ea6={};_0x140ea6[_0x37629e]={'$like':'%'+_0xc994c6[_0xcc1b('0x32')][_0xcc1b('0x3c')]+'%'};return _0x140ea6;})});}_0x4c1cb8=_[_0xcc1b('0x3d')]({},_0x4c1cb8,_0xc994c6['options']);var _0x26964b={'where':_0x4c1cb8[_0xcc1b('0x39')]};return db['CmCompany'][_0xcc1b('0x20')](_0x26964b)[_0xcc1b('0x26')](function(_0x4db596){_0x423a8f[_0xcc1b('0x20')]=_0x4db596;if(_0xc994c6[_0xcc1b('0x32')][_0xcc1b('0x3f')]){_0x4c1cb8[_0xcc1b('0x40')]=[{'all':!![]}];}return db[_0xcc1b('0x41')][_0xcc1b('0x42')](_0x4c1cb8);})[_0xcc1b('0x26')](function(_0x5996d4){_0x423a8f['rows']=_0x5996d4;return _0x423a8f;})[_0xcc1b('0x26')](respondWithFilteredResult(_0x3118cb,_0x4c1cb8))[_0xcc1b('0x43')](handleError(_0x3118cb,null));})[_0xcc1b('0x43')](handleError(_0x3118cb,null));};exports[_0xcc1b('0x44')]=function(_0x40a976,_0x35376a){var _0xfe98a7={'raw':![],'where':{'id':_0x40a976['params']['id']}},_0x53fc55={};_0x53fc55['model']=_[_0xcc1b('0x31')](db['CmCompany'][_0xcc1b('0x45')]);_0x53fc55['query']=_['keys'](_0x40a976['query']);_0x53fc55[_0xcc1b('0x3b')]=_[_0xcc1b('0x33')](_0x53fc55[_0xcc1b('0x30')],_0x53fc55['query']);_0xfe98a7[_0xcc1b('0x34')]=_['intersection'](_0x53fc55[_0xcc1b('0x30')],qs[_0xcc1b('0x35')](_0x40a976[_0xcc1b('0x32')][_0xcc1b('0x35')]));_0xfe98a7[_0xcc1b('0x34')]=_0xfe98a7['attributes'][_0xcc1b('0x46')]?_0xfe98a7[_0xcc1b('0x34')]:_0x53fc55[_0xcc1b('0x30')];if(_0x40a976[_0xcc1b('0x32')]['includeAll']){_0xfe98a7[_0xcc1b('0x40')]=[{'all':!![]}];}_0xfe98a7=_[_0xcc1b('0x3d')]({},_0xfe98a7,_0x40a976[_0xcc1b('0x47')]);return db[_0xcc1b('0x41')][_0xcc1b('0x48')](_0xfe98a7)[_0xcc1b('0x26')](handleEntityNotFound(_0x35376a,null))['then'](respondWithResult(_0x35376a,null))[_0xcc1b('0x43')](handleError(_0x35376a,null));};exports[_0xcc1b('0x49')]=function(_0x31bece,_0x519a7a){return db['CmCompany'][_0xcc1b('0x49')](_0x31bece[_0xcc1b('0x4a')],{})['then'](function(_0x426fd5){var _0x67cb12=_0x31bece['user'][_0xcc1b('0x28')]({'plain':!![]});if(!_0x67cb12)throw new Error(_0xcc1b('0x4b'));if(_0x67cb12[_0xcc1b('0x4c')]===_0xcc1b('0x4d')){var _0x2af513=_0x426fd5[_0xcc1b('0x28')]({'plain':!![]});var _0x55ed1e='Companies';return db[_0xcc1b('0x4e')][_0xcc1b('0x48')]({'where':{'name':_0x55ed1e,'userProfileId':_0x67cb12['userProfileId']},'raw':!![]})[_0xcc1b('0x26')](function(_0xa51589){if(_0xa51589&&_0xa51589[_0xcc1b('0x4f')]===0x0){return db[_0xcc1b('0x50')][_0xcc1b('0x49')]({'name':_0x2af513[_0xcc1b('0x2d')],'resourceId':_0x2af513['id'],'type':_0xa51589[_0xcc1b('0x2d')],'sectionId':_0xa51589['id']},{})['then'](function(){return _0x426fd5;});}else{return _0x426fd5;}})[_0xcc1b('0x43')](function(_0x3c44e8){logger[_0xcc1b('0x2b')](_0xcc1b('0x51'),_0x3c44e8);throw _0x3c44e8;});}return _0x426fd5;})[_0xcc1b('0x26')](respondWithResult(_0x519a7a,0xc9))[_0xcc1b('0x43')](handleError(_0x519a7a,null));};exports[_0xcc1b('0x25')]=function(_0x4b8861,_0x292dbb){if(_0x4b8861[_0xcc1b('0x4a')]['id']){delete _0x4b8861['body']['id'];}return db[_0xcc1b('0x41')]['find']({'where':{'id':_0x4b8861[_0xcc1b('0x52')]['id']}})[_0xcc1b('0x26')](handleEntityNotFound(_0x292dbb,null))[_0xcc1b('0x26')](saveUpdates(_0x4b8861['body'],null))[_0xcc1b('0x26')](respondWithResult(_0x292dbb,null))[_0xcc1b('0x43')](handleError(_0x292dbb,null));};exports[_0xcc1b('0x27')]=function(_0x317011,_0x830d4f){return db[_0xcc1b('0x41')][_0xcc1b('0x48')]({'where':{'id':_0x317011[_0xcc1b('0x52')]['id']}})['then'](handleEntityNotFound(_0x830d4f,null))[_0xcc1b('0x26')](removeEntity(_0x830d4f,null))[_0xcc1b('0x43')](handleError(_0x830d4f,null));};exports[_0xcc1b('0x53')]=function(_0x5cab69,_0x31f70a){return db[_0xcc1b('0x41')][_0xcc1b('0x53')]()[_0xcc1b('0x26')](respondWithResult(_0x31f70a,null))['catch'](handleError(_0x31f70a,null));};exports[_0xcc1b('0x54')]=function(_0x2a1856,_0x2b9c52,_0x202851){return db[_0xcc1b('0x55')][_0xcc1b('0x48')]({'where':{'id':_0x2a1856[_0xcc1b('0x52')]['id']}})['then'](handleEntityNotFound(_0x2b9c52,null))[_0xcc1b('0x26')](function(_0x23c34d){if(_0x23c34d){return _0x23c34d[_0xcc1b('0x54')](_0x2a1856[_0xcc1b('0x4a')]['ids'],_[_0xcc1b('0x56')](_0x2a1856[_0xcc1b('0x4a')],[_0xcc1b('0x57'),'id'])||{});}})[_0xcc1b('0x26')](respondWithResult(_0x2b9c52,null))[_0xcc1b('0x43')](handleError(_0x2b9c52,null));};exports[_0xcc1b('0x58')]=function(_0x3e852b,_0x9efdb1,_0x44627f){var _0x566943={};var _0x44d1c5={};var _0x1c200e;var _0x413f12;return db[_0xcc1b('0x41')][_0xcc1b('0x59')]({'where':{'id':_0x3e852b[_0xcc1b('0x52')]['id']}})[_0xcc1b('0x26')](handleEntityNotFound(_0x9efdb1,null))[_0xcc1b('0x26')](function(_0x5639e9){if(_0x5639e9){_0x1c200e=_0x5639e9;_0x44d1c5[_0xcc1b('0x30')]=_[_0xcc1b('0x31')](db[_0xcc1b('0x55')]['rawAttributes']);_0x44d1c5['query']=_['keys'](_0x3e852b['query']);_0x44d1c5[_0xcc1b('0x3b')]=_[_0xcc1b('0x33')](_0x44d1c5['model'],_0x44d1c5[_0xcc1b('0x32')]);_0x566943[_0xcc1b('0x34')]=_[_0xcc1b('0x33')](_0x44d1c5[_0xcc1b('0x30')],qs[_0xcc1b('0x35')](_0x3e852b[_0xcc1b('0x32')][_0xcc1b('0x35')]));_0x566943[_0xcc1b('0x34')]=_0x566943[_0xcc1b('0x34')][_0xcc1b('0x46')]?_0x566943[_0xcc1b('0x34')]:_0x44d1c5[_0xcc1b('0x30')];_0x566943['order']=qs['sort'](_0x3e852b[_0xcc1b('0x32')][_0xcc1b('0x5a')]);_0x566943[_0xcc1b('0x39')]=qs[_0xcc1b('0x3b')](_['pick'](_0x3e852b['query'],_0x44d1c5[_0xcc1b('0x3b')]));if(_0x3e852b[_0xcc1b('0x32')][_0xcc1b('0x3c')]){_0x566943[_0xcc1b('0x39')]=_[_0xcc1b('0x3d')](_0x566943[_0xcc1b('0x39')],{'$or':_[_0xcc1b('0x3e')](_0x566943[_0xcc1b('0x34')],function(_0x4ca872){var _0x5f0765={};_0x5f0765[_0x4ca872]={'$like':'%'+_0x3e852b[_0xcc1b('0x32')]['filter']+'%'};return _0x5f0765;})});}_0x566943=_[_0xcc1b('0x3d')]({},_0x566943,_0x3e852b[_0xcc1b('0x47')]);return _0x1c200e[_0xcc1b('0x58')](_0x566943);}})['then'](function(_0x3014d2){if(_0x3014d2){_0x413f12=_0x3014d2['length'];if(!_0x3e852b['query'][_0xcc1b('0x36')](_0xcc1b('0x37'))){_0x566943['limit']=qs[_0xcc1b('0x21')](_0x3e852b[_0xcc1b('0x32')][_0xcc1b('0x21')]);_0x566943['offset']=qs['offset'](_0x3e852b[_0xcc1b('0x32')]['offset']);}return _0x1c200e[_0xcc1b('0x58')](_0x566943);}})[_0xcc1b('0x26')](function(_0x451791){if(_0x451791){return _0x451791?{'count':_0x413f12,'rows':_0x451791}:null;}})[_0xcc1b('0x26')](respondWithResult(_0x9efdb1,null))[_0xcc1b('0x43')](handleError(_0x9efdb1,null));};
\ No newline at end of file
+var _0xe0ae=['intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','filters','pick','filter','map','merge','includeAll','include','rows','catch','params','rawAttributes','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','ids','omit','getContacts','order','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','limit','count','set','Content-Range','apply','reject','then','get','Companies','UserProfileResource','destroy','end','error','stack','name','send','index','CmCompany','describe','model','keys','query'];(function(_0x3bcdb1,_0xcda140){var _0x40f0ec=function(_0x44ba03){while(--_0x44ba03){_0x3bcdb1['push'](_0x3bcdb1['shift']());}};_0x40f0ec(++_0xcda140);}(_0xe0ae,0x18d));var _0xee0a=function(_0x4d40dd,_0x39592b){_0x4d40dd=_0x4d40dd-0x0;var _0x1c51f2=_0xe0ae[_0x4d40dd];return _0x1c51f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee0a('0x0'));var zipdir=require(_0xee0a('0x1'));var jsonpatch=require(_0xee0a('0x2'));var rp=require(_0xee0a('0x3'));var moment=require(_0xee0a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xee0a('0x5'));var util=require('util');var path=require(_0xee0a('0x6'));var sox=require(_0xee0a('0x7'));var csv=require('to-csv');var ejs=require(_0xee0a('0x8'));var fs=require('fs');var fs_extra=require(_0xee0a('0x9'));var _=require(_0xee0a('0xa'));var squel=require(_0xee0a('0xb'));var crypto=require(_0xee0a('0xc'));var jsforce=require(_0xee0a('0xd'));var deskjs=require(_0xee0a('0xe'));var toCsv=require(_0xee0a('0xf'));var querystring=require(_0xee0a('0x10'));var Papa=require(_0xee0a('0x11'));var Redis=require(_0xee0a('0x12'));var authService=require(_0xee0a('0x13'));var qs=require(_0xee0a('0x14'));var as=require(_0xee0a('0x15'));var hardwareService=require(_0xee0a('0x16'));var logger=require(_0xee0a('0x17'))(_0xee0a('0x18'));var utils=require(_0xee0a('0x19'));var config=require(_0xee0a('0x1a'));var licenseUtil=require(_0xee0a('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b8d2d,_0x125f7a){_0x125f7a=_0x125f7a||0xcc;return function(_0x1571bd){if(_0x1571bd){return _0x4b8d2d[_0xee0a('0x1c')](_0x125f7a);}return _0x4b8d2d['status'](_0x125f7a)['end']();};}function respondWithResult(_0x319a55,_0x1be524){_0x1be524=_0x1be524||0xc8;return function(_0x5a18c7){if(_0x5a18c7){return _0x319a55[_0xee0a('0x1d')](_0x1be524)['json'](_0x5a18c7);}};}function respondWithFilteredResult(_0x2f27a4,_0x164e37){return function(_0x3d1ed0){if(_0x3d1ed0){var _0x46cdcd=typeof _0x164e37['offset']===_0xee0a('0x1e')&&typeof _0x164e37[_0xee0a('0x1f')]===_0xee0a('0x1e');var _0x1726ce=_0x3d1ed0[_0xee0a('0x20')];var _0x58e20b=_0x46cdcd?0x0:_0x164e37['offset'];var _0xbf627=_0x46cdcd?_0x3d1ed0[_0xee0a('0x20')]:_0x164e37['offset']+_0x164e37[_0xee0a('0x1f')];var _0x5a4341;if(_0xbf627>=_0x1726ce){_0xbf627=_0x1726ce;_0x5a4341=0xc8;}else{_0x5a4341=0xce;}_0x2f27a4[_0xee0a('0x1d')](_0x5a4341);return _0x2f27a4[_0xee0a('0x21')](_0xee0a('0x22'),_0x58e20b+'-'+_0xbf627+'/'+_0x1726ce)['json'](_0x3d1ed0);}return null;};}function patchUpdates(_0x4c3034){return function(_0x236353){try{jsonpatch[_0xee0a('0x23')](_0x236353,_0x4c3034,!![]);}catch(_0xb462af){return BPromise[_0xee0a('0x24')](_0xb462af);}return _0x236353['save']();};}function saveUpdates(_0x3fca79,_0x8a3794){return function(_0x145084){if(_0x145084){return _0x145084['update'](_0x3fca79)[_0xee0a('0x25')](function(_0x2a9310){return _0x2a9310;});}return null;};}function removeEntity(_0x33e798,_0x25af37){return function(_0x40ab10){if(_0x40ab10){return _0x40ab10['destroy']()['then'](function(){var _0xf089c0=_0x40ab10[_0xee0a('0x26')]({'plain':!![]});var _0x312099=_0xee0a('0x27');return db[_0xee0a('0x28')][_0xee0a('0x29')]({'where':{'type':_0x312099,'resourceId':_0xf089c0['id']}})['then'](function(){return _0x40ab10;});})['then'](function(){_0x33e798[_0xee0a('0x1d')](0xcc)[_0xee0a('0x2a')]();});}};}function handleEntityNotFound(_0x47ef0f,_0x2aa9a0){return function(_0x29ee24){if(!_0x29ee24){_0x47ef0f[_0xee0a('0x1c')](0x194);}return _0x29ee24;};}function handleError(_0x2a2ee0,_0x24d5ee){_0x24d5ee=_0x24d5ee||0x1f4;return function(_0x2dd2b1){logger[_0xee0a('0x2b')](_0x2dd2b1[_0xee0a('0x2c')]);if(_0x2dd2b1[_0xee0a('0x2d')]){delete _0x2dd2b1[_0xee0a('0x2d')];}_0x2a2ee0[_0xee0a('0x1d')](_0x24d5ee)[_0xee0a('0x2e')](_0x2dd2b1);};}exports[_0xee0a('0x2f')]=function(_0x2100d8,_0x3743bf){var _0x1761e9={},_0x5869c5={},_0x40f821={'count':0x0,'rows':[]};return db[_0xee0a('0x30')][_0xee0a('0x31')]()[_0xee0a('0x25')](function(_0x2cdb93){_0x5869c5[_0xee0a('0x32')]=_[_0xee0a('0x33')](_0x2cdb93);_0x5869c5[_0xee0a('0x34')]=_['keys'](_0x2100d8[_0xee0a('0x34')]);_0x5869c5['filters']=_[_0xee0a('0x35')](_0x5869c5[_0xee0a('0x32')],_0x5869c5[_0xee0a('0x34')]);_0x1761e9[_0xee0a('0x36')]=_[_0xee0a('0x35')](_0x5869c5['model'],qs['fields'](_0x2100d8[_0xee0a('0x34')][_0xee0a('0x37')]));_0x1761e9[_0xee0a('0x36')]=_0x1761e9[_0xee0a('0x36')][_0xee0a('0x38')]?_0x1761e9[_0xee0a('0x36')]:_0x5869c5[_0xee0a('0x32')];if(!_0x2100d8[_0xee0a('0x34')][_0xee0a('0x39')](_0xee0a('0x3a'))){_0x1761e9[_0xee0a('0x1f')]=qs[_0xee0a('0x1f')](_0x2100d8['query'][_0xee0a('0x1f')]);_0x1761e9[_0xee0a('0x3b')]=qs[_0xee0a('0x3b')](_0x2100d8[_0xee0a('0x34')][_0xee0a('0x3b')]);}_0x1761e9['order']=qs[_0xee0a('0x3c')](_0x2100d8[_0xee0a('0x34')][_0xee0a('0x3c')]);_0x1761e9[_0xee0a('0x3d')]=qs[_0xee0a('0x3e')](_[_0xee0a('0x3f')](_0x2100d8[_0xee0a('0x34')],_0x5869c5[_0xee0a('0x3e')]),_0x2cdb93);if(_0x2100d8[_0xee0a('0x34')][_0xee0a('0x40')]){_0x1761e9[_0xee0a('0x3d')]=_['merge'](_0x1761e9['where'],{'$or':_[_0xee0a('0x41')](_0x1761e9['attributes'],function(_0x285753){var _0x390c31={};_0x390c31[_0x285753]={'$like':'%'+_0x2100d8[_0xee0a('0x34')]['filter']+'%'};return _0x390c31;})});}_0x1761e9=_[_0xee0a('0x42')]({},_0x1761e9,_0x2100d8['options']);var _0x1a5fbf={'where':_0x1761e9[_0xee0a('0x3d')]};return db[_0xee0a('0x30')]['count'](_0x1a5fbf)[_0xee0a('0x25')](function(_0x42b12){_0x40f821[_0xee0a('0x20')]=_0x42b12;if(_0x2100d8[_0xee0a('0x34')][_0xee0a('0x43')]){_0x1761e9[_0xee0a('0x44')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x1761e9);})['then'](function(_0x9ec47b){_0x40f821[_0xee0a('0x45')]=_0x9ec47b;return _0x40f821;})[_0xee0a('0x25')](respondWithFilteredResult(_0x3743bf,_0x1761e9))[_0xee0a('0x46')](handleError(_0x3743bf,null));})[_0xee0a('0x46')](handleError(_0x3743bf,null));};exports['show']=function(_0x5ae865,_0x16829e){var _0x448b1e={'raw':![],'where':{'id':_0x5ae865[_0xee0a('0x47')]['id']}},_0x359c72={};_0x359c72[_0xee0a('0x32')]=_[_0xee0a('0x33')](db[_0xee0a('0x30')][_0xee0a('0x48')]);_0x359c72[_0xee0a('0x34')]=_[_0xee0a('0x33')](_0x5ae865['query']);_0x359c72[_0xee0a('0x3e')]=_[_0xee0a('0x35')](_0x359c72[_0xee0a('0x32')],_0x359c72[_0xee0a('0x34')]);_0x448b1e[_0xee0a('0x36')]=_['intersection'](_0x359c72['model'],qs[_0xee0a('0x37')](_0x5ae865[_0xee0a('0x34')][_0xee0a('0x37')]));_0x448b1e[_0xee0a('0x36')]=_0x448b1e['attributes'][_0xee0a('0x38')]?_0x448b1e['attributes']:_0x359c72[_0xee0a('0x32')];if(_0x5ae865[_0xee0a('0x34')][_0xee0a('0x43')]){_0x448b1e[_0xee0a('0x44')]=[{'all':!![]}];}_0x448b1e=_[_0xee0a('0x42')]({},_0x448b1e,_0x5ae865[_0xee0a('0x49')]);return db['CmCompany']['find'](_0x448b1e)[_0xee0a('0x25')](handleEntityNotFound(_0x16829e,null))[_0xee0a('0x25')](respondWithResult(_0x16829e,null))[_0xee0a('0x46')](handleError(_0x16829e,null));};exports['create']=function(_0xfd70a2,_0x5a6dc0){return db['CmCompany'][_0xee0a('0x4a')](_0xfd70a2[_0xee0a('0x4b')],{})[_0xee0a('0x25')](function(_0x3763d9){var _0x49fee1=_0xfd70a2[_0xee0a('0x4c')][_0xee0a('0x26')]({'plain':!![]});if(!_0x49fee1)throw new Error(_0xee0a('0x4d'));if(_0x49fee1['role']===_0xee0a('0x4c')){var _0xa2c069=_0x3763d9['get']({'plain':!![]});var _0x26a7ad='Companies';return db[_0xee0a('0x4e')][_0xee0a('0x4f')]({'where':{'name':_0x26a7ad,'userProfileId':_0x49fee1[_0xee0a('0x50')]},'raw':!![]})['then'](function(_0x2dffdf){if(_0x2dffdf&&_0x2dffdf[_0xee0a('0x51')]===0x0){return db['UserProfileResource'][_0xee0a('0x4a')]({'name':_0xa2c069[_0xee0a('0x2d')],'resourceId':_0xa2c069['id'],'type':_0x2dffdf[_0xee0a('0x2d')],'sectionId':_0x2dffdf['id']},{})[_0xee0a('0x25')](function(){return _0x3763d9;});}else{return _0x3763d9;}})[_0xee0a('0x46')](function(_0x160ab6){logger['error'](_0xee0a('0x52'),_0x160ab6);throw _0x160ab6;});}return _0x3763d9;})[_0xee0a('0x25')](respondWithResult(_0x5a6dc0,0xc9))[_0xee0a('0x46')](handleError(_0x5a6dc0,null));};exports[_0xee0a('0x53')]=function(_0x35705f,_0x20cb11){if(_0x35705f[_0xee0a('0x4b')]['id']){delete _0x35705f[_0xee0a('0x4b')]['id'];}return db[_0xee0a('0x30')][_0xee0a('0x4f')]({'where':{'id':_0x35705f[_0xee0a('0x47')]['id']}})['then'](handleEntityNotFound(_0x20cb11,null))['then'](saveUpdates(_0x35705f['body'],null))[_0xee0a('0x25')](respondWithResult(_0x20cb11,null))[_0xee0a('0x46')](handleError(_0x20cb11,null));};exports[_0xee0a('0x29')]=function(_0x5c2462,_0x1e5c52){return db[_0xee0a('0x30')][_0xee0a('0x4f')]({'where':{'id':_0x5c2462[_0xee0a('0x47')]['id']}})[_0xee0a('0x25')](handleEntityNotFound(_0x1e5c52,null))[_0xee0a('0x25')](removeEntity(_0x1e5c52,null))[_0xee0a('0x46')](handleError(_0x1e5c52,null));};exports[_0xee0a('0x31')]=function(_0x43e146,_0x4e2402){return db[_0xee0a('0x30')]['describe']()[_0xee0a('0x25')](respondWithResult(_0x4e2402,null))[_0xee0a('0x46')](handleError(_0x4e2402,null));};exports[_0xee0a('0x54')]=function(_0x38bf51,_0x485613,_0x29200b){return db[_0xee0a('0x55')]['find']({'where':{'id':_0x38bf51[_0xee0a('0x47')]['id']}})[_0xee0a('0x25')](handleEntityNotFound(_0x485613,null))[_0xee0a('0x25')](function(_0x350d0c){if(_0x350d0c){return _0x350d0c[_0xee0a('0x54')](_0x38bf51[_0xee0a('0x4b')][_0xee0a('0x56')],_[_0xee0a('0x57')](_0x38bf51[_0xee0a('0x4b')],[_0xee0a('0x56'),'id'])||{});}})[_0xee0a('0x25')](respondWithResult(_0x485613,null))[_0xee0a('0x46')](handleError(_0x485613,null));};exports[_0xee0a('0x58')]=function(_0x23f08c,_0x3c94c8,_0x599971){var _0x5f0225={};var _0x46a214={};var _0xe9a978;var _0x59a7c7;return db[_0xee0a('0x30')]['findOne']({'where':{'id':_0x23f08c[_0xee0a('0x47')]['id']}})[_0xee0a('0x25')](handleEntityNotFound(_0x3c94c8,null))['then'](function(_0x44214e){if(_0x44214e){_0xe9a978=_0x44214e;_0x46a214['model']=_[_0xee0a('0x33')](db[_0xee0a('0x55')]['rawAttributes']);_0x46a214[_0xee0a('0x34')]=_['keys'](_0x23f08c[_0xee0a('0x34')]);_0x46a214[_0xee0a('0x3e')]=_['intersection'](_0x46a214['model'],_0x46a214[_0xee0a('0x34')]);_0x5f0225[_0xee0a('0x36')]=_['intersection'](_0x46a214[_0xee0a('0x32')],qs[_0xee0a('0x37')](_0x23f08c['query']['fields']));_0x5f0225['attributes']=_0x5f0225[_0xee0a('0x36')]['length']?_0x5f0225[_0xee0a('0x36')]:_0x46a214['model'];_0x5f0225[_0xee0a('0x59')]=qs[_0xee0a('0x3c')](_0x23f08c[_0xee0a('0x34')][_0xee0a('0x3c')]);_0x5f0225[_0xee0a('0x3d')]=qs['filters'](_[_0xee0a('0x3f')](_0x23f08c[_0xee0a('0x34')],_0x46a214[_0xee0a('0x3e')]));if(_0x23f08c[_0xee0a('0x34')][_0xee0a('0x40')]){_0x5f0225[_0xee0a('0x3d')]=_['merge'](_0x5f0225['where'],{'$or':_['map'](_0x5f0225['attributes'],function(_0x57e83a){var _0x4435dd={};_0x4435dd[_0x57e83a]={'$like':'%'+_0x23f08c['query'][_0xee0a('0x40')]+'%'};return _0x4435dd;})});}_0x5f0225=_[_0xee0a('0x42')]({},_0x5f0225,_0x23f08c['options']);return _0xe9a978[_0xee0a('0x58')](_0x5f0225);}})[_0xee0a('0x25')](function(_0x56139d){if(_0x56139d){_0x59a7c7=_0x56139d[_0xee0a('0x38')];if(!_0x23f08c['query']['hasOwnProperty'](_0xee0a('0x3a'))){_0x5f0225[_0xee0a('0x1f')]=qs[_0xee0a('0x1f')](_0x23f08c[_0xee0a('0x34')]['limit']);_0x5f0225['offset']=qs[_0xee0a('0x3b')](_0x23f08c[_0xee0a('0x34')][_0xee0a('0x3b')]);}return _0xe9a978[_0xee0a('0x58')](_0x5f0225);}})['then'](function(_0x380c5b){if(_0x380c5b){return _0x380c5b?{'count':_0x59a7c7,'rows':_0x380c5b}:null;}})[_0xee0a('0x25')](respondWithResult(_0x3c94c8,null))[_0xee0a('0x46')](handleError(_0x3c94c8,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 46bed35..979f310 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 _0x4e9d=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','cm_companies'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x4e9d,0xc6));var _0xd4e9=function(_0x3ff9bc,_0x51778d){_0x3ff9bc=_0x3ff9bc-0x0;var _0x4017d6=_0x4e9d[_0x3ff9bc];return _0x4017d6;};'use strict';var _=require(_0xd4e9('0x0'));var util=require(_0xd4e9('0x1'));var logger=require(_0xd4e9('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd4e9('0x3'));var rp=require(_0xd4e9('0x4'));var fs=require('fs');var path=require(_0xd4e9('0x5'));var rimraf=require(_0xd4e9('0x6'));var config=require(_0xd4e9('0x7'));var attributes=require(_0xd4e9('0x8'));module[_0xd4e9('0x9')]=function(_0x5d84dd,_0xd9217e){return _0x5d84dd['define']('CmCompany',attributes,{'tableName':_0xd4e9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xda61=['moment','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xda61,0x65));var _0x1da6=function(_0x42ae90,_0xc9e59b){_0x42ae90=_0x42ae90-0x0;var _0x5c4f06=_0xda61[_0x42ae90];return _0x5c4f06;};'use strict';var _=require(_0x1da6('0x0'));var util=require(_0x1da6('0x1'));var logger=require(_0x1da6('0x2'))('api');var moment=require(_0x1da6('0x3'));var BPromise=require(_0x1da6('0x4'));var rp=require(_0x1da6('0x5'));var fs=require('fs');var path=require(_0x1da6('0x6'));var rimraf=require('rimraf');var config=require(_0x1da6('0x7'));var attributes=require(_0x1da6('0x8'));module[_0x1da6('0x9')]=function(_0x2e258f,_0x4dc9d8){return _0x2e258f[_0x1da6('0xa')](_0x1da6('0xb'),attributes,{'tableName':_0x1da6('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 8ca2d16..96fa416 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 _0x0861=['CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','CmCompany,\x20%s,\x20%s'];(function(_0x102227,_0x57414a){var _0xf2786=function(_0x2e6080){while(--_0x2e6080){_0x102227['push'](_0x102227['shift']());}};_0xf2786(++_0x57414a);}(_0x0861,0x65));var _0x1086=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x0861[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var util=require(_0x1086('0x0'));var moment=require('moment');var BPromise=require(_0x1086('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1086('0x2'));var db=require(_0x1086('0x3'))['db'];var utils=require(_0x1086('0x4'));var logger=require('../../config/logger')(_0x1086('0x5'));var config=require(_0x1086('0x6'));var jayson=require(_0x1086('0x7'));var client=jayson[_0x1086('0x8')][_0x1086('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x459086,_0x143cf2,_0x31a433){return new BPromise(function(_0x1ba1a0,_0x145b13){return client[_0x1086('0xa')](_0x459086,_0x31a433)['then'](function(_0x1977e8){logger[_0x1086('0xb')](_0x1086('0xc'),_0x143cf2,'request\x20sent');logger['debug'](_0x1086('0xd'),_0x143cf2,_0x1086('0xe'),JSON[_0x1086('0xf')](_0x1977e8));if(_0x1977e8[_0x1086('0x10')]){if(_0x1977e8['error']['code']===0x1f4){logger[_0x1086('0x10')](_0x1086('0xc'),_0x143cf2,_0x1977e8[_0x1086('0x10')][_0x1086('0x11')]);return _0x145b13(_0x1977e8[_0x1086('0x10')][_0x1086('0x11')]);}logger[_0x1086('0x10')](_0x1086('0xc'),_0x143cf2,_0x1977e8['error'][_0x1086('0x11')]);return _0x1ba1a0(_0x1977e8[_0x1086('0x10')]['message']);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x143cf2,_0x1086('0xe'));_0x1ba1a0(_0x1977e8[_0x1086('0x12')][_0x1086('0x11')]);}})['catch'](function(_0x2701ba){logger['error'](_0x1086('0xc'),_0x143cf2,_0x2701ba);_0x145b13(_0x2701ba);});});}
\ No newline at end of file
+var _0xe560=['../../config/environment','jayson/promise','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xb9c7d5,_0x1d1dbc){var _0x1fe79e=function(_0x1d0265){while(--_0x1d0265){_0xb9c7d5['push'](_0xb9c7d5['shift']());}};_0x1fe79e(++_0x1d1dbc);}(_0xe560,0x7a));var _0x0e56=function(_0x431dd3,_0x1581d8){_0x431dd3=_0x431dd3-0x0;var _0x2058b4=_0xe560[_0x431dd3];return _0x2058b4;};'use strict';var _=require(_0x0e56('0x0'));var util=require(_0x0e56('0x1'));var moment=require(_0x0e56('0x2'));var BPromise=require(_0x0e56('0x3'));var rs=require(_0x0e56('0x4'));var fs=require('fs');var Redis=require(_0x0e56('0x5'));var db=require(_0x0e56('0x6'))['db'];var utils=require(_0x0e56('0x7'));var logger=require(_0x0e56('0x8'))(_0x0e56('0x9'));var config=require(_0x0e56('0xa'));var jayson=require(_0x0e56('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1e6a46,_0x8e037,_0x1718dd){return new BPromise(function(_0x8845bf,_0x3673ad){return client[_0x0e56('0xc')](_0x1e6a46,_0x1718dd)[_0x0e56('0xd')](function(_0x5512e9){logger[_0x0e56('0xe')](_0x0e56('0xf'),_0x8e037,_0x0e56('0x10'));logger[_0x0e56('0x11')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x8e037,'request\x20sent',JSON[_0x0e56('0x12')](_0x5512e9));if(_0x5512e9['error']){if(_0x5512e9['error'][_0x0e56('0x13')]===0x1f4){logger[_0x0e56('0x14')]('CmCompany,\x20%s,\x20%s',_0x8e037,_0x5512e9[_0x0e56('0x14')][_0x0e56('0x15')]);return _0x3673ad(_0x5512e9[_0x0e56('0x14')][_0x0e56('0x15')]);}logger[_0x0e56('0x14')](_0x0e56('0xf'),_0x8e037,_0x5512e9[_0x0e56('0x14')][_0x0e56('0x15')]);return _0x8845bf(_0x5512e9[_0x0e56('0x14')][_0x0e56('0x15')]);}else{logger[_0x0e56('0xe')](_0x0e56('0xf'),_0x8e037,_0x0e56('0x10'));_0x8845bf(_0x5512e9['result'][_0x0e56('0x15')]);}})['catch'](function(_0x3a78fb){logger[_0x0e56('0x14')]('CmCompany,\x20%s,\x20%s',_0x8e037,_0x3a78fb);_0x3673ad(_0x3a78fb);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index d8b3c87..6e51a8c 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 _0x3583=['addContacts','put','/:id','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id/contacts','getContacts','create','post'];(function(_0x21adb6,_0x13ca6e){var _0x31b2b5=function(_0x181f4e){while(--_0x181f4e){_0x21adb6['push'](_0x21adb6['shift']());}};_0x31b2b5(++_0x13ca6e);}(_0x3583,0x12a));var _0x3358=function(_0x2fc689,_0x5d944b){_0x2fc689=_0x2fc689-0x0;var _0x26953e=_0x3583[_0x2fc689];return _0x26953e;};'use strict';var multer=require(_0x3358('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3358('0x1'));var express=require('express');var router=express[_0x3358('0x2')]();var fs_extra=require(_0x3358('0x3'));var auth=require(_0x3358('0x4'));var interaction=require(_0x3358('0x5'));var config=require(_0x3358('0x6'));var controller=require(_0x3358('0x7'));router[_0x3358('0x8')]('/',auth[_0x3358('0x9')](),controller[_0x3358('0xa')]);router[_0x3358('0x8')](_0x3358('0xb'),auth[_0x3358('0x9')](),controller[_0x3358('0xc')]);router[_0x3358('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3358('0x8')](_0x3358('0xd'),auth['isAuthenticated'](),controller[_0x3358('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3358('0xf')]);router[_0x3358('0x10')]('/:id/contacts',auth[_0x3358('0x9')](),controller[_0x3358('0x11')]);router[_0x3358('0x12')](_0x3358('0x13'),auth[_0x3358('0x9')](),controller['update']);router['delete'](_0x3358('0x13'),auth[_0x3358('0x9')](),controller['destroy']);module[_0x3358('0x14')]=router;
\ No newline at end of file
+var _0x2293=['/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','index','/describe','describe','get','/:id','isAuthenticated','show'];(function(_0x4b8d18,_0x51cf18){var _0x47aa67=function(_0x17679f){while(--_0x17679f){_0x4b8d18['push'](_0x4b8d18['shift']());}};_0x47aa67(++_0x51cf18);}(_0x2293,0x6d));var _0x3229=function(_0x2a31e4,_0x484990){_0x2a31e4=_0x2a31e4-0x0;var _0x39c146=_0x2293[_0x2a31e4];return _0x39c146;};'use strict';var multer=require(_0x3229('0x0'));var util=require(_0x3229('0x1'));var path=require(_0x3229('0x2'));var timeout=require(_0x3229('0x3'));var express=require('express');var router=express[_0x3229('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3229('0x5'));var interaction=require(_0x3229('0x6'));var config=require(_0x3229('0x7'));var controller=require(_0x3229('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3229('0x9')]);router['get'](_0x3229('0xa'),auth['isAuthenticated'](),controller[_0x3229('0xb')]);router[_0x3229('0xc')](_0x3229('0xd'),auth[_0x3229('0xe')](),controller[_0x3229('0xf')]);router[_0x3229('0xc')](_0x3229('0x10'),auth[_0x3229('0xe')](),controller[_0x3229('0x11')]);router[_0x3229('0x12')]('/',auth['isAuthenticated'](),controller[_0x3229('0x13')]);router['post'](_0x3229('0x10'),auth['isAuthenticated'](),controller[_0x3229('0x14')]);router[_0x3229('0x15')](_0x3229('0xd'),auth['isAuthenticated'](),controller[_0x3229('0x16')]);router[_0x3229('0x17')]('/:id',auth[_0x3229('0xe')](),controller[_0x3229('0x18')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index e4a20ed..604581b 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 _0x757a=['STRING','TEXT','INTEGER','UNSIGNED','DATE','sequelize','exports'];(function(_0x26efac,_0x21ab8a){var _0x8482e4=function(_0x14db32){while(--_0x14db32){_0x26efac['push'](_0x26efac['shift']());}};_0x8482e4(++_0x21ab8a);}(_0x757a,0xde));var _0xa757=function(_0x2dd5cf,_0x442eac){_0x2dd5cf=_0x2dd5cf-0x0;var _0x4fd267=_0x757a[_0x2dd5cf];return _0x4fd267;};'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
+var _0x0b0e=['exports','STRING','TEXT','INTEGER','DATE','NOW','lodash'];(function(_0x3485c9,_0x1b2e25){var _0x382b23=function(_0x3a6895){while(--_0x3a6895){_0x3485c9['push'](_0x3485c9['shift']());}};_0x382b23(++_0x1b2e25);}(_0x0b0e,0x187));var _0xe0b0=function(_0x419e17,_0x7fe78c){_0x419e17=_0x419e17-0x0;var _0x1f2044=_0x0b0e[_0x419e17];return _0x1f2044;};'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
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 0d05145..07e22d1 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 _0x3c1c=['having','t.id\x20IN\x20?','resolve','user','getLists','c.ListId\x20IS\x20NULL','agent','toString','sequelize','keyBy','merge','c.phone','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','TagIds','Tags','rows','tags','columnName','analytics','findAll','displayName','custom','values','body','get','mergeWith','isArray','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailMessage','MailInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','catch','dialTimezone','timezones','utcOffset','bulkCreate','duplicates','$or','findOrCreate','spread','show','params','cf_%d','$and','format','table','setFields','id\x20=\x20?','toParam','text','phone','getTags','options','setTags','ids','getHoppers','rawAttributes','pick','ContactId','includeAll','include','getHopperHistories','nolimit','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','upload','createReadStream','file','parse','meta','import','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','pid','getJourney','chat','sms','openchannel','whatsapp','voice','includes','Invalid\x20channel','channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','UserId','alias','findAndCountAll','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','DESC','customerPort','osName','ratingMessage','ratingType','referer','subject','externalUrl','threadId','fullname','flatten','sortBy','reverse','util','path','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','json','offset','undefined','limit','count','status','Content-Range','update','then','destroy','end','sendStatus','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','CmCustomField','findOne','all','fieldType','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','select','field','color','from','cm_contacts','left_join','cm_user_has_contacts','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','conditions','find','Tag','value','split','map','forEach','union','User','and','dateOfBirth','datetime','DATE','buildExpression','start','filter','isNil','Contact','push','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','clone','isEmpty'];(function(_0x1bc013,_0x7771c6){var _0x55df36=function(_0x1c02e0){while(--_0x1c02e0){_0x1bc013['push'](_0x1bc013['shift']());}};_0x55df36(++_0x7771c6);}(_0x3c1c,0xb1));var _0xc3c1=function(_0x4f1b87,_0x260834){_0x4f1b87=_0x4f1b87-0x0;var _0x74718e=_0x3c1c[_0x4f1b87];return _0x74718e;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xc3c1('0x0'));var path=require(_0xc3c1('0x1'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var Papa=require(_0xc3c1('0x2'));var Redis=require(_0xc3c1('0x3'));var qs=require('../../components/parsers/qs');var as=require(_0xc3c1('0x4'));var logger=require(_0xc3c1('0x5'))('api');var config=require('../../config/environment');var shared=require(_0xc3c1('0x6'));var db=require(_0xc3c1('0x7'))['db'];config[_0xc3c1('0x8')]=_[_0xc3c1('0x9')](config[_0xc3c1('0x8')],{'host':_0xc3c1('0xa'),'port':0x18eb});var socket=require(_0xc3c1('0xb'))(new Redis(config[_0xc3c1('0x8')]));require(_0xc3c1('0xc'))['register'](socket);function respondWithResult(_0x216331,_0x4fd0f3){_0x4fd0f3=_0x4fd0f3||0xc8;return function(_0x36fcdf){if(_0x36fcdf){return _0x216331['status'](_0x4fd0f3)[_0xc3c1('0xd')](_0x36fcdf);}};}function respondWithFilteredResult(_0xd533d1,_0x1c7381){return function(_0x5d6bee){if(_0x5d6bee){var _0x307943=typeof _0x1c7381[_0xc3c1('0xe')]===_0xc3c1('0xf')&&typeof _0x1c7381[_0xc3c1('0x10')]==='undefined';var _0x13cb66=_0x5d6bee[_0xc3c1('0x11')];var _0x2c59fe=_0x307943?0x0:_0x1c7381[_0xc3c1('0xe')];var _0x277ff8=_0x307943?_0x5d6bee[_0xc3c1('0x11')]:_0x1c7381[_0xc3c1('0xe')]+_0x1c7381[_0xc3c1('0x10')];var _0x3e5259;if(_0x277ff8>=_0x13cb66){_0x277ff8=_0x13cb66;_0x3e5259=0xc8;}else{_0x3e5259=0xce;}_0xd533d1[_0xc3c1('0x12')](_0x3e5259);return _0xd533d1['set'](_0xc3c1('0x13'),_0x2c59fe+'-'+_0x277ff8+'/'+_0x13cb66)[_0xc3c1('0xd')](_0x5d6bee);}return null;};}function saveUpdates(_0x2b99c1){return function(_0x5f4814){if(_0x5f4814){return _0x5f4814[_0xc3c1('0x14')](_0x2b99c1)[_0xc3c1('0x15')](function(_0x4f45c1){return _0x4f45c1;});}return null;};}function removeEntity(_0x14e433){return function(_0x1c5147){if(_0x1c5147){return _0x1c5147[_0xc3c1('0x16')]()[_0xc3c1('0x15')](function(){_0x14e433['status'](0xcc)[_0xc3c1('0x17')]();});}};}function handleEntityNotFound(_0x5b7faf){return function(_0xda8b2c){if(!_0xda8b2c){_0x5b7faf[_0xc3c1('0x18')](0x194);}return _0xda8b2c;};}function handleError(_0x30f19b,_0x3c09a3){_0x3c09a3=_0x3c09a3||0x1f4;return function(_0x195af4){logger['error'](_0x195af4[_0xc3c1('0x19')]);if(_0x195af4[_0xc3c1('0x1a')]){delete _0x195af4[_0xc3c1('0x1a')];}_0x30f19b[_0xc3c1('0x12')](_0x3c09a3)[_0xc3c1('0x1b')](_0x195af4);};}exports[_0xc3c1('0x1c')]=function(_0x12dec3,_0x2c6880){var _0x2ac0a3={},_0x5dfec7={},_0x4f65d2={'count':0x0,'rows':[]};return db[_0xc3c1('0x1d')][_0xc3c1('0x1e')]()[_0xc3c1('0x15')](function(_0x570194){var _0x57274a=[];for(var _0x1ddb02=0x0;_0x1ddb02
','Attachments','Title','Data','generateXOAuth2Token','user=','utf-8','base64','lodash'];(function(_0x5a6f32,_0x58b204){var _0x18c961=function(_0x2b7dc2){while(--_0x2b7dc2){_0x5a6f32['push'](_0x5a6f32['shift']());}};_0x18c961(++_0x58b204);}(_0xc757,0xe3));var _0x7c75=function(_0x4e0269,_0x5608e3){_0x4e0269=_0x4e0269-0x0;var _0x411ea=_0xc757[_0x4e0269];return _0x411ea;};'use strict';var _=require(_0x7c75('0x0'));var moment=require(_0x7c75('0x1'));var random=require(_0x7c75('0x2'));var fs=require('fs');var path=require(_0x7c75('0x3'));var util=require(_0x7c75('0x4'));var tnef=require('node-tnef');var logger=require(_0x7c75('0x5'))('email');var config=require('../../../config/environment');function getAddress(_0x2ec1bc){var _0x2fb663=_[_0x7c75('0x6')](_0x2ec1bc[_0x7c75('0x7')]);return _0x2fb663&&_0x2fb663[_0x7c75('0x8')]?_0x2fb663[_0x7c75('0x8')]:_0x7c75('0x9')+random['generate'](0x6)+_0x7c75('0xa');}function getFirstName(_0x543c1c){var _0x32964a=_[_0x7c75('0x6')](_0x543c1c[_0x7c75('0x7')]);if(_0x32964a&&_0x32964a[_0x7c75('0xb')]){if(_0x32964a[_0x7c75('0xb')]==_0x32964a[_0x7c75('0x8')]){return _0x32964a['name'][_0x7c75('0xc')](0x0,_0x32964a[_0x7c75('0xb')]['indexOf']('@'));}var _0x5278d6=_0x32964a[_0x7c75('0xb')][_0x7c75('0xd')](/\s+/);return _0x5278d6['length']>0x1?_0x5278d6[_0x7c75('0xe')](0x0,-0x1)[_0x7c75('0xf')]('\x20'):_0x32964a['name'];}return _0x7c75('0x10');}function getLastName(_0x2636b6){var _0x32b3ee=_['head'](_0x2636b6[_0x7c75('0x7')]);if(_0x32b3ee&&_0x32b3ee[_0x7c75('0xb')]){var _0x2f01e5=_0x32b3ee['name'][_0x7c75('0xd')](/\s+/);return _0x2f01e5['length']>0x1?_0x2f01e5[_0x7c75('0x11')]():'';}return'';}function getMails(_0xefe7a9,_0x44f955){var _0x2799bc='';for(var _0x34bc01=0x0;_0x34bc01<_0x44f955[_0x7c75('0x7')][_0x7c75('0x12')];_0x34bc01+=0x1){if(_0x44f955[_0x7c75('0x7')][_0x34bc01][_0x7c75('0x8')]!==_0xefe7a9){if(!_['isEmpty'](_0x2799bc)){_0x2799bc+=',';}_0x2799bc+=_0x44f955[_0x7c75('0x7')][_0x34bc01][_0x7c75('0xb')]||_0x44f955['value'][_0x34bc01][_0x7c75('0x8')]||'';_0x2799bc+='\x20<';_0x2799bc+=_0x44f955[_0x7c75('0x7')][_0x34bc01][_0x7c75('0x8')]?_0x44f955['value'][_0x34bc01]['address']:'anonymous'+random[_0x7c75('0x13')](0x6)+'@xcally.com';_0x2799bc+='>';}}return _0x2799bc;}function parseEmail(_0x12de72,_0x144572,_0x49cf12){if(_0x144572['html']){var _0x5cf275=/