From: Andrea Bianco
Date: Sat, 15 Jan 2022 17:18:57 +0000 (+0100)
Subject: Built motion from commit 2fae14ec.|2.5.47
X-Git-Url: http://repos.xcallymotion.com/base/%22https:/user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png//%22%27?a=commitdiff_plain;h=8c12afb2731d16631dffd517ed20a9f330190f09;p=motion2.git
Built motion from commit 2fae14ec.|2.5.47
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 8f2cf7c..0c70c9a 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-15T12:54:17.186Z",
+ "time": "2022-01-15T17:05:30.472Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 8f42abc..8e84d96 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-15T12:54:17.186Z",
+ "time": "2022-01-15T17:05:30.472Z",
"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 decf48b..b91f521 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 _0xd877=['urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','VIRTUAL','getDataValue','contactManager','integration','motionbar','jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'];(function(_0x5b5144,_0x3c94ec){var _0x27dbd0=function(_0x51efd1){while(--_0x51efd1){_0x5b5144['push'](_0x5b5144['shift']());}};_0x27dbd0(++_0x3c94ec);}(_0xd877,0xcf));var _0x7d87=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xd877[_0x513aa5];return _0x1a1a7c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7d87('0x0')],'get':function(_0x4d853d){return this[_0x7d87('0x1')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x7d87('0x2'),_0x7d87('0x3'),_0x7d87('0x4'),_0x7d87('0x5'),_0x7d87('0x6'),'browser',_0x7d87('0x7'),_0x7d87('0x8')]],'msg':_0x7d87('0x9')}},'comment':_0x7d87('0x9')},'data1':{'type':Sequelize[_0x7d87('0xa')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x7d87('0xa')](0x1000),'comment':_0x7d87('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x7d87('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x7d87('0xa')](0x1000),'comments':_0x7d87('0xd')},'data6':{'type':Sequelize[_0x7d87('0xa')],'comments':_0x7d87('0xe')},'data7':{'type':Sequelize[_0x7d87('0xf')],'comments':_0x7d87('0x10')}};
\ No newline at end of file
+var _0x2eec=['contactManager','integration','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x5702fb,_0x3f4105){var _0x2b0178=function(_0x3782c0){while(--_0x3782c0){_0x5702fb['push'](_0x5702fb['shift']());}};_0x2b0178(++_0x3f4105);}(_0x2eec,0xe6));var _0xc2ee=function(_0x53654e,_0x160bcc){_0x53654e=_0x53654e-0x0;var _0x3e5207=_0x2eec[_0x53654e];return _0x3e5207;};'use strict';var Sequelize=require(_0xc2ee('0x0'));module[_0xc2ee('0x1')]={'name':{'type':Sequelize[_0xc2ee('0x2')],'get':function(_0x31c363){return this[_0xc2ee('0x3')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xc2ee('0x4'),_0xc2ee('0x5'),'motionbar','jscripty',_0xc2ee('0x6'),_0xc2ee('0x7'),_0xc2ee('0x8'),_0xc2ee('0x9')]],'msg':_0xc2ee('0xa')}},'comment':_0xc2ee('0xa')},'data1':{'type':Sequelize[_0xc2ee('0xb')](0x1000),'comment':_0xc2ee('0xc')},'data2':{'type':Sequelize[_0xc2ee('0xb')](0x1000),'comment':_0xc2ee('0xd')},'data3':{'type':Sequelize[_0xc2ee('0xb')](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[_0xc2ee('0xb')](0x1000),'comments':_0xc2ee('0xe')},'data5':{'type':Sequelize[_0xc2ee('0xb')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xc2ee('0xb')],'comments':_0xc2ee('0xf')},'data7':{'type':Sequelize[_0xc2ee('0x10')],'comments':_0xc2ee('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 0c97c2c..837d706 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 _0xba31=['count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','update','Action','find','params','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','end','status','offset','undefined','limit'];(function(_0x38fa20,_0x301993){var _0x4ce943=function(_0x99fe7e){while(--_0x99fe7e){_0x38fa20['push'](_0x38fa20['shift']());}};_0x4ce943(++_0x301993);}(_0xba31,0x17a));var _0x1ba3=function(_0x54edc9,_0x345f01){_0x54edc9=_0x54edc9-0x0;var _0x2ae7a9=_0xba31[_0x54edc9];return _0x2ae7a9;};'use strict';var emlformat=require(_0x1ba3('0x0'));var rimraf=require(_0x1ba3('0x1'));var zipdir=require(_0x1ba3('0x2'));var jsonpatch=require(_0x1ba3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1ba3('0x4'));var Mustache=require(_0x1ba3('0x5'));var util=require('util');var path=require('path');var sox=require(_0x1ba3('0x6'));var csv=require(_0x1ba3('0x7'));var ejs=require(_0x1ba3('0x8'));var fs=require('fs');var fs_extra=require(_0x1ba3('0x9'));var _=require('lodash');var squel=require(_0x1ba3('0xa'));var crypto=require('crypto');var jsforce=require(_0x1ba3('0xb'));var deskjs=require(_0x1ba3('0xc'));var toCsv=require(_0x1ba3('0x7'));var querystring=require(_0x1ba3('0xd'));var Papa=require(_0x1ba3('0xe'));var Redis=require(_0x1ba3('0xf'));var authService=require(_0x1ba3('0x10'));var qs=require(_0x1ba3('0x11'));var as=require(_0x1ba3('0x12'));var hardwareService=require(_0x1ba3('0x13'));var logger=require('../../config/logger')(_0x1ba3('0x14'));var utils=require('../../config/utils');var config=require(_0x1ba3('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x128e41,_0x7bda1e){_0x7bda1e=_0x7bda1e||0xcc;return function(_0x501f17){if(_0x501f17){return _0x128e41['sendStatus'](_0x7bda1e);}return _0x128e41['status'](_0x7bda1e)[_0x1ba3('0x16')]();};}function respondWithResult(_0x4c343e,_0x3bb4c0){_0x3bb4c0=_0x3bb4c0||0xc8;return function(_0x2fc798){if(_0x2fc798){return _0x4c343e[_0x1ba3('0x17')](_0x3bb4c0)['json'](_0x2fc798);}};}function respondWithFilteredResult(_0x9f79c9,_0x372f04){return function(_0x2b69ac){if(_0x2b69ac){var _0x2390d8=typeof _0x372f04[_0x1ba3('0x18')]===_0x1ba3('0x19')&&typeof _0x372f04[_0x1ba3('0x1a')]==='undefined';var _0x478fbe=_0x2b69ac[_0x1ba3('0x1b')];var _0x8b58d7=_0x2390d8?0x0:_0x372f04[_0x1ba3('0x18')];var _0x340b40=_0x2390d8?_0x2b69ac[_0x1ba3('0x1b')]:_0x372f04[_0x1ba3('0x18')]+_0x372f04['limit'];var _0x227b1a;if(_0x340b40>=_0x478fbe){_0x340b40=_0x478fbe;_0x227b1a=0xc8;}else{_0x227b1a=0xce;}_0x9f79c9[_0x1ba3('0x17')](_0x227b1a);return _0x9f79c9[_0x1ba3('0x1c')](_0x1ba3('0x1d'),_0x8b58d7+'-'+_0x340b40+'/'+_0x478fbe)['json'](_0x2b69ac);}return null;};}function patchUpdates(_0x4db163){return function(_0x390f3a){try{jsonpatch[_0x1ba3('0x1e')](_0x390f3a,_0x4db163,!![]);}catch(_0x5935d1){return BPromise[_0x1ba3('0x1f')](_0x5935d1);}return _0x390f3a[_0x1ba3('0x20')]();};}function saveUpdates(_0x1bba92,_0x2edeaa){return function(_0x46d37a){if(_0x46d37a){return _0x46d37a['update'](_0x1bba92)[_0x1ba3('0x21')](function(_0xe1781f){return _0xe1781f;});}return null;};}function removeEntity(_0x3c0bc7,_0x547a6a){return function(_0x1f1d48){if(_0x1f1d48){return _0x1f1d48[_0x1ba3('0x22')]()['then'](function(){_0x3c0bc7[_0x1ba3('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22903b,_0xa717f9){return function(_0x44403b){if(!_0x44403b){_0x22903b[_0x1ba3('0x23')](0x194);}return _0x44403b;};}function handleError(_0x4d6c57,_0x54e917){_0x54e917=_0x54e917||0x1f4;return function(_0x442ed5){logger[_0x1ba3('0x24')](_0x442ed5[_0x1ba3('0x25')]);if(_0x442ed5[_0x1ba3('0x26')]){delete _0x442ed5[_0x1ba3('0x26')];}_0x4d6c57[_0x1ba3('0x17')](_0x54e917)['send'](_0x442ed5);};}exports[_0x1ba3('0x27')]=function(_0x478424,_0x20acad){if(_0x478424['body']['id']){delete _0x478424['body']['id'];}return db[_0x1ba3('0x28')][_0x1ba3('0x29')]({'where':{'id':_0x478424[_0x1ba3('0x2a')]['id']}})[_0x1ba3('0x21')](handleEntityNotFound(_0x20acad,null))['then'](saveUpdates(_0x478424[_0x1ba3('0x2b')],null))['then'](respondWithResult(_0x20acad,null))[_0x1ba3('0x2c')](handleError(_0x20acad,null));};exports[_0x1ba3('0x22')]=function(_0x4e0d49,_0x220d93){return db[_0x1ba3('0x28')][_0x1ba3('0x29')]({'where':{'id':_0x4e0d49[_0x1ba3('0x2a')]['id']}})[_0x1ba3('0x21')](handleEntityNotFound(_0x220d93,null))['then'](removeEntity(_0x220d93,null))['catch'](handleError(_0x220d93,null));};
\ No newline at end of file
+var _0x4753=['moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','body','find','params','catch','Action','eml-format','zip-dir','request-promise'];(function(_0x32f75b,_0x16cde7){var _0x26f5c7=function(_0x2f80b8){while(--_0x2f80b8){_0x32f75b['push'](_0x32f75b['shift']());}};_0x26f5c7(++_0x16cde7);}(_0x4753,0x84));var _0x3475=function(_0x4ad9b3,_0x22fef3){_0x4ad9b3=_0x4ad9b3-0x0;var _0x11c321=_0x4753[_0x4ad9b3];return _0x11c321;};'use strict';var emlformat=require(_0x3475('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3475('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3475('0x2'));var moment=require(_0x3475('0x3'));var BPromise=require(_0x3475('0x4'));var Mustache=require(_0x3475('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3475('0x6'));var csv=require(_0x3475('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3475('0x8'));var _=require(_0x3475('0x9'));var squel=require(_0x3475('0xa'));var crypto=require('crypto');var jsforce=require(_0x3475('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3475('0xc'));var Redis=require(_0x3475('0xd'));var authService=require(_0x3475('0xe'));var qs=require(_0x3475('0xf'));var as=require(_0x3475('0x10'));var hardwareService=require(_0x3475('0x11'));var logger=require('../../config/logger')(_0x3475('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3475('0x13'));var db=require(_0x3475('0x14'))['db'];function respondWithStatusCode(_0x2801f8,_0x26743a){_0x26743a=_0x26743a||0xcc;return function(_0x29668e){if(_0x29668e){return _0x2801f8[_0x3475('0x15')](_0x26743a);}return _0x2801f8[_0x3475('0x16')](_0x26743a)[_0x3475('0x17')]();};}function respondWithResult(_0x1991a1,_0xd408cb){_0xd408cb=_0xd408cb||0xc8;return function(_0x4d65cc){if(_0x4d65cc){return _0x1991a1['status'](_0xd408cb)['json'](_0x4d65cc);}};}function respondWithFilteredResult(_0x30098c,_0x1b30bf){return function(_0x1e6a4e){if(_0x1e6a4e){var _0x537a1e=typeof _0x1b30bf[_0x3475('0x18')]===_0x3475('0x19')&&typeof _0x1b30bf[_0x3475('0x1a')]===_0x3475('0x19');var _0x1c2043=_0x1e6a4e[_0x3475('0x1b')];var _0x4b6a69=_0x537a1e?0x0:_0x1b30bf[_0x3475('0x18')];var _0x20b00f=_0x537a1e?_0x1e6a4e[_0x3475('0x1b')]:_0x1b30bf[_0x3475('0x18')]+_0x1b30bf[_0x3475('0x1a')];var _0x10096c;if(_0x20b00f>=_0x1c2043){_0x20b00f=_0x1c2043;_0x10096c=0xc8;}else{_0x10096c=0xce;}_0x30098c[_0x3475('0x16')](_0x10096c);return _0x30098c[_0x3475('0x1c')](_0x3475('0x1d'),_0x4b6a69+'-'+_0x20b00f+'/'+_0x1c2043)[_0x3475('0x1e')](_0x1e6a4e);}return null;};}function patchUpdates(_0xe1a150){return function(_0x1ecff8){try{jsonpatch['apply'](_0x1ecff8,_0xe1a150,!![]);}catch(_0x488bc7){return BPromise[_0x3475('0x1f')](_0x488bc7);}return _0x1ecff8[_0x3475('0x20')]();};}function saveUpdates(_0x25fc30,_0x5ded07){return function(_0x220ac7){if(_0x220ac7){return _0x220ac7[_0x3475('0x21')](_0x25fc30)['then'](function(_0x465a76){return _0x465a76;});}return null;};}function removeEntity(_0x1ba636,_0x391435){return function(_0x49b521){if(_0x49b521){return _0x49b521[_0x3475('0x22')]()[_0x3475('0x23')](function(){_0x1ba636[_0x3475('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x522b88,_0x2cf552){return function(_0x5e7d40){if(!_0x5e7d40){_0x522b88['sendStatus'](0x194);}return _0x5e7d40;};}function handleError(_0x5e9dd2,_0x2c1fb3){_0x2c1fb3=_0x2c1fb3||0x1f4;return function(_0x5318aa){logger[_0x3475('0x24')](_0x5318aa[_0x3475('0x25')]);if(_0x5318aa[_0x3475('0x26')]){delete _0x5318aa[_0x3475('0x26')];}_0x5e9dd2[_0x3475('0x16')](_0x2c1fb3)[_0x3475('0x27')](_0x5318aa);};}exports[_0x3475('0x21')]=function(_0x14b080,_0x3dcd89){if(_0x14b080[_0x3475('0x28')]['id']){delete _0x14b080[_0x3475('0x28')]['id'];}return db['Action'][_0x3475('0x29')]({'where':{'id':_0x14b080[_0x3475('0x2a')]['id']}})[_0x3475('0x23')](handleEntityNotFound(_0x3dcd89,null))[_0x3475('0x23')](saveUpdates(_0x14b080[_0x3475('0x28')],null))[_0x3475('0x23')](respondWithResult(_0x3dcd89,null))[_0x3475('0x2b')](handleError(_0x3dcd89,null));};exports[_0x3475('0x22')]=function(_0x32ea27,_0x32bc0e){return db[_0x3475('0x2c')]['find']({'where':{'id':_0x32ea27[_0x3475('0x2a')]['id']}})['then'](handleEntityNotFound(_0x32bc0e,null))['then'](removeEntity(_0x32bc0e,null))['catch'](handleError(_0x32bc0e,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 7c19ad1..5e35a6f 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 _0x4dc2=['rimraf','../../config/environment','./action.attributes','Action','tools_actions','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x47c983,_0x5a2896){var _0x3e7cc3=function(_0x119c26){while(--_0x119c26){_0x47c983['push'](_0x47c983['shift']());}};_0x3e7cc3(++_0x5a2896);}(_0x4dc2,0xf5));var _0x24dc=function(_0x403fbd,_0x5f3e3d){_0x403fbd=_0x403fbd-0x0;var _0x2bbf8b=_0x4dc2[_0x403fbd];return _0x2bbf8b;};'use strict';var _=require(_0x24dc('0x0'));var util=require(_0x24dc('0x1'));var logger=require(_0x24dc('0x2'))(_0x24dc('0x3'));var moment=require(_0x24dc('0x4'));var BPromise=require('bluebird');var rp=require(_0x24dc('0x5'));var fs=require('fs');var path=require(_0x24dc('0x6'));var rimraf=require(_0x24dc('0x7'));var config=require(_0x24dc('0x8'));var attributes=require(_0x24dc('0x9'));module['exports']=function(_0x3a1844,_0x48471c){return _0x3a1844['define'](_0x24dc('0xa'),attributes,{'tableName':_0x24dc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2c31=['path','rimraf','../../config/environment','./action.attributes','exports','define','tools_actions','lodash','util','api','moment','request-promise'];(function(_0x33c9f8,_0x5aedbb){var _0x2d7004=function(_0x4f4f43){while(--_0x4f4f43){_0x33c9f8['push'](_0x33c9f8['shift']());}};_0x2d7004(++_0x5aedbb);}(_0x2c31,0x13f));var _0x12c3=function(_0x4a4a82,_0x172322){_0x4a4a82=_0x4a4a82-0x0;var _0x4d069b=_0x2c31[_0x4a4a82];return _0x4d069b;};'use strict';var _=require(_0x12c3('0x0'));var util=require(_0x12c3('0x1'));var logger=require('../../config/logger')(_0x12c3('0x2'));var moment=require(_0x12c3('0x3'));var BPromise=require('bluebird');var rp=require(_0x12c3('0x4'));var fs=require('fs');var path=require(_0x12c3('0x5'));var rimraf=require(_0x12c3('0x6'));var config=require(_0x12c3('0x7'));var attributes=require(_0x12c3('0x8'));module[_0x12c3('0x9')]=function(_0x273c40,_0x1e63bf){return _0x273c40[_0x12c3('0xa')]('Action',attributes,{'tableName':_0x12c3('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 fb99169..1f56247 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 _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2fbd0e,_0x3460a9){var _0x481c9f=function(_0x4bc402){while(--_0x4bc402){_0x2fbd0e['push'](_0x2fbd0e['shift']());}};_0x481c9f(++_0x3460a9);}(_0xf494,0x1c6));var _0x4f49=function(_0x531552,_0x2c78b4){_0x531552=_0x531552-0x0;var _0x3e0076=_0xf494[_0x531552];return _0x3e0076;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}
\ No newline at end of file
+var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x3a5ab4,_0x56f591){var _0x4838f9=function(_0x4750ac){while(--_0x4750ac){_0x3a5ab4['push'](_0x3a5ab4['shift']());}};_0x4838f9(++_0x56f591);}(_0xabce,0x103));var _0xeabc=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xabce[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 2ce1cf9..90cca20 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 _0xb6d7=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','delete','destroy'];(function(_0x12ab13,_0xb4a491){var _0x1a272c=function(_0x720ed4){while(--_0x720ed4){_0x12ab13['push'](_0x12ab13['shift']());}};_0x1a272c(++_0xb4a491);}(_0xb6d7,0x17a));var _0x7b6d=function(_0x386019,_0x1eac10){_0x386019=_0x386019-0x0;var _0x253833=_0xb6d7[_0x386019];return _0x253833;};'use strict';var multer=require(_0x7b6d('0x0'));var util=require(_0x7b6d('0x1'));var path=require(_0x7b6d('0x2'));var timeout=require(_0x7b6d('0x3'));var express=require(_0x7b6d('0x4'));var router=express[_0x7b6d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7b6d('0x6'));var interaction=require(_0x7b6d('0x7'));var config=require(_0x7b6d('0x8'));var controller=require(_0x7b6d('0x9'));router['put'](_0x7b6d('0xa'),auth[_0x7b6d('0xb')](),controller['update']);router[_0x7b6d('0xc')]('/:id',auth[_0x7b6d('0xb')](),controller[_0x7b6d('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0x2506=['path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','/:id','isAuthenticated','update','delete','exports','util'];(function(_0x49af8b,_0x48d216){var _0x4f9e96=function(_0x3d39f7){while(--_0x3d39f7){_0x49af8b['push'](_0x49af8b['shift']());}};_0x4f9e96(++_0x48d216);}(_0x2506,0x15f));var _0x6250=function(_0x327aa9,_0x52ffa3){_0x327aa9=_0x327aa9-0x0;var _0x166bf2=_0x2506[_0x327aa9];return _0x166bf2;};'use strict';var multer=require('multer');var util=require(_0x6250('0x0'));var path=require(_0x6250('0x1'));var timeout=require(_0x6250('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6250('0x3'));var auth=require(_0x6250('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6250('0x5'));var controller=require('./action.controller');router['put'](_0x6250('0x6'),auth[_0x6250('0x7')](),controller[_0x6250('0x8')]);router[_0x6250('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6250('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 7357427..88dbf4f 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 _0x2675=['sequelize','STRING','TEXT'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0x2675,0x75));var _0x5267=function(_0x3aab30,_0x4dc40d){_0x3aab30=_0x3aab30-0x0;var _0x57d644=_0x2675[_0x3aab30];return _0x57d644;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}};
\ No newline at end of file
+var _0xeec6=['STRING','TEXT','sequelize','exports'];(function(_0x2f8ed4,_0x295402){var _0x543bff=function(_0x3f6dca){while(--_0x3f6dca){_0x2f8ed4['push'](_0x2f8ed4['shift']());}};_0x543bff(++_0x295402);}(_0xeec6,0x1c2));var _0x6eec=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0xeec6[_0x126fb9];return _0xc8a3b1;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6eec('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6eec('0x2')]},'conditions':{'type':Sequelize[_0x6eec('0x3')]},'joins':{'type':Sequelize[_0x6eec('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index ab0070b..68b262a 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 _0xfc8f=['path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','create','user','get','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%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)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','metric','replace','function','format','groupBy','orderBy','DESC','alias','joins','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','parse','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','UNIX_TIMESTAMP(%s)','operator','keyBy','MetricId','clone','output','web','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','child_process','../../files/reports','savename','countTable','COUNT(*)','run','runReport','MAX(%s)','AVG(%s)','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x128437,_0x588bab){var _0x27ca7a=function(_0x2f9765){while(--_0x2f9765){_0x128437['push'](_0x128437['shift']());}};_0x27ca7a(++_0x588bab);}(_0xfc8f,0xa0));var _0xffc8=function(_0x21bc1d,_0x5cf2f7){_0x21bc1d=_0x21bc1d-0x0;var _0x4a9c53=_0xfc8f[_0x21bc1d];return _0x4a9c53;};'use strict';var emlformat=require(_0xffc8('0x0'));var rimraf=require(_0xffc8('0x1'));var zipdir=require(_0xffc8('0x2'));var jsonpatch=require(_0xffc8('0x3'));var rp=require('request-promise');var moment=require(_0xffc8('0x4'));var BPromise=require(_0xffc8('0x5'));var Mustache=require(_0xffc8('0x6'));var util=require(_0xffc8('0x7'));var path=require(_0xffc8('0x8'));var sox=require(_0xffc8('0x9'));var csv=require('to-csv');var ejs=require(_0xffc8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xffc8('0xb'));var crypto=require(_0xffc8('0xc'));var jsforce=require(_0xffc8('0xd'));var deskjs=require(_0xffc8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xffc8('0xf'));var Papa=require(_0xffc8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xffc8('0x11'));var logger=require(_0xffc8('0x12'))(_0xffc8('0x13'));var utils=require(_0xffc8('0x14'));var config=require(_0xffc8('0x15'));var licenseUtil=require(_0xffc8('0x16'));var db=require(_0xffc8('0x17'))['db'];var dbH=require(_0xffc8('0x17'))[_0xffc8('0x18')];function respondWithStatusCode(_0x4464bf,_0x61308a){_0x61308a=_0x61308a||0xcc;return function(_0x51c31c){if(_0x51c31c){return _0x4464bf[_0xffc8('0x19')](_0x61308a);}return _0x4464bf[_0xffc8('0x1a')](_0x61308a)[_0xffc8('0x1b')]();};}function respondWithResult(_0x4542c6,_0x56dd24){_0x56dd24=_0x56dd24||0xc8;return function(_0x4dfc77){if(_0x4dfc77){return _0x4542c6[_0xffc8('0x1a')](_0x56dd24)[_0xffc8('0x1c')](_0x4dfc77);}};}function respondWithFilteredResult(_0x324f2a,_0x27f1fc){return function(_0x3bb14b){if(_0x3bb14b){var _0x4d8c3c=typeof _0x27f1fc[_0xffc8('0x1d')]===_0xffc8('0x1e')&&typeof _0x27f1fc[_0xffc8('0x1f')]===_0xffc8('0x1e');var _0x239f23=_0x3bb14b[_0xffc8('0x20')];var _0x326a4a=_0x4d8c3c?0x0:_0x27f1fc[_0xffc8('0x1d')];var _0x4b9ac9=_0x4d8c3c?_0x3bb14b[_0xffc8('0x20')]:_0x27f1fc['offset']+_0x27f1fc[_0xffc8('0x1f')];var _0x2baba7;if(_0x4b9ac9>=_0x239f23){_0x4b9ac9=_0x239f23;_0x2baba7=0xc8;}else{_0x2baba7=0xce;}_0x324f2a[_0xffc8('0x1a')](_0x2baba7);return _0x324f2a[_0xffc8('0x21')](_0xffc8('0x22'),_0x326a4a+'-'+_0x4b9ac9+'/'+_0x239f23)[_0xffc8('0x1c')](_0x3bb14b);}return null;};}function patchUpdates(_0x3d9b2a){return function(_0x17fd8d){try{jsonpatch['apply'](_0x17fd8d,_0x3d9b2a,!![]);}catch(_0x1f909c){return BPromise['reject'](_0x1f909c);}return _0x17fd8d[_0xffc8('0x23')]();};}function saveUpdates(_0x24de04,_0x5e982f){return function(_0x212745){if(_0x212745){return _0x212745[_0xffc8('0x24')](_0x24de04)[_0xffc8('0x25')](function(_0x35ab3d){return _0x35ab3d;});}return null;};}function removeEntity(_0x3885ff,_0x57c6f4){return function(_0x100163){if(_0x100163){return _0x100163[_0xffc8('0x26')]()[_0xffc8('0x25')](function(){var _0x495221=_0x100163['get']({'plain':!![]});var _0x14dc5d=_0xffc8('0x27');return db[_0xffc8('0x28')][_0xffc8('0x26')]({'where':{'type':_0x14dc5d,'resourceId':_0x495221['id']}})[_0xffc8('0x25')](function(){return _0x100163;});})[_0xffc8('0x25')](function(){_0x3885ff[_0xffc8('0x1a')](0xcc)[_0xffc8('0x1b')]();});}};}function handleEntityNotFound(_0x442227,_0x48e931){return function(_0x1c3155){if(!_0x1c3155){_0x442227[_0xffc8('0x19')](0x194);}return _0x1c3155;};}function handleError(_0x3abf91,_0x393caa){_0x393caa=_0x393caa||0x1f4;return function(_0x32439f){logger[_0xffc8('0x29')](_0x32439f[_0xffc8('0x2a')]);if(_0x32439f[_0xffc8('0x2b')]){delete _0x32439f[_0xffc8('0x2b')];}_0x3abf91[_0xffc8('0x1a')](_0x393caa)[_0xffc8('0x2c')](_0x32439f);};}exports[_0xffc8('0x2d')]=function(_0x1bd6ad,_0x58d9fe){var _0x328d86={},_0x3e5b71={},_0x11a169={'count':0x0,'rows':[]};var _0x282906=_['map'](db[_0xffc8('0x2e')][_0xffc8('0x2f')],function(_0xf9036d){return{'name':_0xf9036d[_0xffc8('0x30')],'type':_0xf9036d[_0xffc8('0x31')][_0xffc8('0x32')]};});_0x3e5b71[_0xffc8('0x33')]=_['map'](_0x282906,_0xffc8('0x2b'));_0x3e5b71[_0xffc8('0x34')]=_['keys'](_0x1bd6ad['query']);_0x3e5b71[_0xffc8('0x35')]=_[_0xffc8('0x36')](_0x3e5b71[_0xffc8('0x33')],_0x3e5b71[_0xffc8('0x34')]);_0x328d86[_0xffc8('0x37')]=_[_0xffc8('0x36')](_0x3e5b71[_0xffc8('0x33')],qs[_0xffc8('0x38')](_0x1bd6ad[_0xffc8('0x34')][_0xffc8('0x38')]));_0x328d86[_0xffc8('0x37')]=_0x328d86[_0xffc8('0x37')]['length']?_0x328d86[_0xffc8('0x37')]:_0x3e5b71[_0xffc8('0x33')];if(!_0x1bd6ad[_0xffc8('0x34')][_0xffc8('0x39')]('nolimit')){_0x328d86[_0xffc8('0x1f')]=qs[_0xffc8('0x1f')](_0x1bd6ad[_0xffc8('0x34')][_0xffc8('0x1f')]);_0x328d86[_0xffc8('0x1d')]=qs[_0xffc8('0x1d')](_0x1bd6ad[_0xffc8('0x34')]['offset']);}_0x328d86[_0xffc8('0x3a')]=qs[_0xffc8('0x3b')](_0x1bd6ad['query'][_0xffc8('0x3b')]);_0x328d86[_0xffc8('0x3c')]=qs[_0xffc8('0x35')](_['pick'](_0x1bd6ad[_0xffc8('0x34')],_0x3e5b71[_0xffc8('0x35')]),_0x282906);if(_0x1bd6ad['query'][_0xffc8('0x3d')]){_0x328d86[_0xffc8('0x3c')]=_[_0xffc8('0x3e')](_0x328d86[_0xffc8('0x3c')],{'$or':_[_0xffc8('0x3f')](_0x282906,function(_0x23dcc7){if(_0x23dcc7['type']!==_0xffc8('0x40')){var _0x261285={};_0x261285[_0x23dcc7['name']]={'$like':'%'+_0x1bd6ad[_0xffc8('0x34')][_0xffc8('0x3d')]+'%'};return _0x261285;}})});}_0x328d86=_['merge']({},_0x328d86,_0x1bd6ad[_0xffc8('0x41')]);var _0x4dcda4={'where':_0x328d86[_0xffc8('0x3c')]};return db[_0xffc8('0x2e')]['count'](_0x4dcda4)[_0xffc8('0x25')](function(_0x4f9930){_0x11a169[_0xffc8('0x20')]=_0x4f9930;if(_0x1bd6ad[_0xffc8('0x34')][_0xffc8('0x42')]){_0x328d86[_0xffc8('0x43')]=[{'all':!![]}];}return db[_0xffc8('0x2e')][_0xffc8('0x44')](_0x328d86);})[_0xffc8('0x25')](function(_0x19cf79){_0x11a169[_0xffc8('0x45')]=_0x19cf79;return _0x11a169;})[_0xffc8('0x25')](respondWithFilteredResult(_0x58d9fe,_0x328d86))[_0xffc8('0x46')](handleError(_0x58d9fe,null));};exports[_0xffc8('0x47')]=function(_0x5146f8,_0x21f5a4){var _0x447470={'raw':![],'where':{'id':_0x5146f8[_0xffc8('0x48')]['id']}},_0x202113={};_0x202113['model']=_['keys'](db[_0xffc8('0x2e')][_0xffc8('0x2f')]);_0x202113[_0xffc8('0x34')]=_[_0xffc8('0x49')](_0x5146f8[_0xffc8('0x34')]);_0x202113[_0xffc8('0x35')]=_[_0xffc8('0x36')](_0x202113['model'],_0x202113[_0xffc8('0x34')]);_0x447470['attributes']=_[_0xffc8('0x36')](_0x202113['model'],qs[_0xffc8('0x38')](_0x5146f8['query'][_0xffc8('0x38')]));_0x447470[_0xffc8('0x37')]=_0x447470[_0xffc8('0x37')][_0xffc8('0x4a')]?_0x447470[_0xffc8('0x37')]:_0x202113['model'];if(_0x5146f8['query'][_0xffc8('0x42')]){_0x447470[_0xffc8('0x43')]=[{'all':!![]}];}_0x447470=_['merge']({},_0x447470,_0x5146f8[_0xffc8('0x41')]);return db[_0xffc8('0x2e')]['find'](_0x447470)[_0xffc8('0x25')](handleEntityNotFound(_0x21f5a4,null))[_0xffc8('0x25')](respondWithResult(_0x21f5a4,null))[_0xffc8('0x46')](handleError(_0x21f5a4,null));};exports[_0xffc8('0x4b')]=function(_0x4d0afb,_0x4f75c9){return db[_0xffc8('0x2e')][_0xffc8('0x4b')](_0x4d0afb['body'],{})['then'](function(_0x27fa13){var _0x68ef02=_0x4d0afb[_0xffc8('0x4c')][_0xffc8('0x4d')]({'plain':!![]});if(!_0x68ef02)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x68ef02[_0xffc8('0x4e')]==='user'){var _0x4006fb=_0x27fa13[_0xffc8('0x4d')]({'plain':!![]});var _0x24aa94=_0xffc8('0x4f');return db[_0xffc8('0x50')][_0xffc8('0x51')]({'where':{'name':_0x24aa94,'userProfileId':_0x68ef02[_0xffc8('0x52')]},'raw':!![]})[_0xffc8('0x25')](function(_0x39016b){if(_0x39016b&&_0x39016b[_0xffc8('0x53')]===0x0){return db[_0xffc8('0x28')][_0xffc8('0x4b')]({'name':_0x4006fb[_0xffc8('0x2b')],'resourceId':_0x4006fb['id'],'type':_0xffc8('0x27'),'sectionId':_0x39016b['id']},{})[_0xffc8('0x25')](function(){return _0x27fa13;});}else{return _0x27fa13;}})['catch'](function(_0xff4dfc){logger[_0xffc8('0x29')](_0xffc8('0x54'),_0xff4dfc);throw _0xff4dfc;});}return _0x27fa13;})[_0xffc8('0x25')](respondWithResult(_0x4f75c9,0xc9))[_0xffc8('0x46')](handleError(_0x4f75c9,null));};exports['update']=function(_0x3d8392,_0x30e0cc){if(_0x3d8392[_0xffc8('0x55')]['id']){delete _0x3d8392['body']['id'];}return db[_0xffc8('0x2e')][_0xffc8('0x51')]({'where':{'id':_0x3d8392[_0xffc8('0x48')]['id']}})[_0xffc8('0x25')](handleEntityNotFound(_0x30e0cc,null))[_0xffc8('0x25')](saveUpdates(_0x3d8392[_0xffc8('0x55')],null))[_0xffc8('0x25')](respondWithResult(_0x30e0cc,null))[_0xffc8('0x46')](handleError(_0x30e0cc,null));};exports[_0xffc8('0x26')]=function(_0x37ecab,_0x119c1c){return db['AnalyticCustomReport'][_0xffc8('0x51')]({'where':{'id':_0x37ecab[_0xffc8('0x48')]['id']}})[_0xffc8('0x25')](handleEntityNotFound(_0x119c1c,null))['then'](removeEntity(_0x119c1c,null))[_0xffc8('0x46')](handleError(_0x119c1c,null));};exports[_0xffc8('0x56')]=function(_0x5dbaa7,_0x27fb50){var _0xdf0ebd=0xa;var _0x37eb2a=[_0xffc8('0x57'),_0xffc8('0x58'),_0xffc8('0x59'),_0xffc8('0x5a')];var _0x311d81={'SUM':_0xffc8('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xffc8('0x5c'),'MAX':'MAX(%s)','MIN':_0xffc8('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xffc8('0x5e'),'GROUP_CONCAT ASC':_0xffc8('0x5f'),'GROUP_CONCAT DESC':_0xffc8('0x60')};var _0x36b9bf={'SEC_TO_TIME':_0xffc8('0x61'),'DATE':_0xffc8('0x62'),'HOUR':_0xffc8('0x63'),'ROUND':_0xffc8('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1db047=function(_0x45cb80){return!_[_0xffc8('0x65')]([_0xffc8('0x66'),_0xffc8('0x67'),_0xffc8('0x68'),_0xffc8('0x69')],_0x45cb80);};var _0x3b809c=function(_0x28ca4a){if(!_0x28ca4a||!_0x28ca4a[_0xffc8('0x6a')][_0xffc8('0x4a')]){return'';}for(var _0x14b890='(',_0x5121da=0x0;_0x5121da<_0x28ca4a['rules'][_0xffc8('0x4a')];_0x5121da+=0x1){_0x5121da>0x0&&(_0x14b890+='\x20'+_0x28ca4a['operator']+'\x20');_0x14b890+=_0x28ca4a['rules'][_0x5121da][_0xffc8('0x6b')]?_0x3b809c(_0x28ca4a[_0xffc8('0x6a')][_0x5121da][_0xffc8('0x6b')]):_0x28ca4a[_0xffc8('0x6a')][_0x5121da][_0xffc8('0x6c')]+'\x20'+_0x28ca4a[_0xffc8('0x6a')][_0x5121da][_0xffc8('0x6d')]+(_0x1db047(_0x28ca4a['rules'][_0x5121da][_0xffc8('0x6d')])?'\x20'+_0x28ca4a[_0xffc8('0x6a')][_0x5121da][_0xffc8('0x6e')]:'');}return _0x14b890+')';};var _0x538b14={'where':{'id':_0x5dbaa7['params']['id']}},_0x58b6ce,_0x2216f5,_0x26c0bc,_0x8dddcb,_0x250525;_0x538b14=_[_0xffc8('0x3e')]({},_0x538b14,_0x5dbaa7[_0xffc8('0x41')]);return db[_0xffc8('0x2e')]['find'](_0x538b14)['then'](function(_0x1ccc5e){if(_0x1ccc5e){_0x58b6ce=_0x1ccc5e;return _0x1ccc5e[_0xffc8('0x6f')]();}return null;})[_0xffc8('0x25')](function(_0x303155){if(_0x303155){if(!_0x303155['length']){throw new db[(_0xffc8('0x70'))][(_0xffc8('0x71'))](_0xffc8('0x72'),0x193);}_0x2216f5=_0x303155;return db[_0xffc8('0x73')][_0xffc8('0x44')]({'raw':!![]});}return null;})[_0xffc8('0x25')](function(_0x1ab127){if(_0x1ab127){_0x26c0bc=_['keyBy'](_0x1ab127,'id');var _0x5dc5da;var _0x217cdb=squel[_0xffc8('0x74')]();_0x217cdb[_0xffc8('0x75')](_0x58b6ce[_0xffc8('0x76')]);for(var _0x12659f=0x0;_0x12659f<_0x2216f5['length'];_0x12659f+=0x1){_0x5dc5da=_0x2216f5[_0x12659f]['MetricId']?_0x26c0bc[_0x2216f5[_0x12659f]['MetricId']][_0xffc8('0x77')]:_0x2216f5[_0x12659f]['field'];_0x5dc5da=_0x2216f5[_0x12659f]['function']?_[_0xffc8('0x78')](_0x311d81[_0x2216f5[_0x12659f][_0xffc8('0x79')]],'%s',_0x5dc5da):_0x5dc5da;_0x5dc5da=_0x2216f5[_0x12659f]['format']?_[_0xffc8('0x78')](_0x36b9bf[_0x2216f5[_0x12659f][_0xffc8('0x7a')]],'%s',_0x5dc5da):_0x5dc5da;if(_0x2216f5[_0x12659f][_0xffc8('0x7b')]){_0x217cdb[_0xffc8('0x6b')](_0x5dc5da);}_0x2216f5[_0x12659f][_0xffc8('0x7c')]&&_0x217cdb['order'](_0x5dc5da,_0x2216f5[_0x12659f][_0xffc8('0x7c')]===_0xffc8('0x7d')?![]:!![]);_0x217cdb[_0xffc8('0x6c')](_0x5dc5da,_0x2216f5[_0x12659f][_0xffc8('0x7e')]||_0x5dc5da);}if(_0x58b6ce[_0xffc8('0x7f')]){_0x58b6ce[_0xffc8('0x7f')]=JSON['parse'](_0x58b6ce[_0xffc8('0x7f')]);for(var _0x5b362d=0x0;_0x5b362d<_0x58b6ce[_0xffc8('0x7f')]['length'];_0x5b362d+=0x1){if(_0x58b6ce[_0xffc8('0x7f')][_0x5b362d]['type']&&_[_0xffc8('0x65')](_0x37eb2a,_0x58b6ce['joins'][_0x5b362d]['type'])&&_0x58b6ce['joins'][_0x5b362d]['parentKey']&&_0x58b6ce[_0xffc8('0x7f')][_0x5b362d]['foreignTable']&&_0x58b6ce['joins'][_0x5b362d][_0xffc8('0x80')]){_0x217cdb[_0x58b6ce[_0xffc8('0x7f')][_0x5b362d]['type']](_0x58b6ce['joins'][_0x5b362d][_0xffc8('0x81')],null,util[_0xffc8('0x7a')](_0xffc8('0x82'),_0x58b6ce[_0xffc8('0x76')],_0x58b6ce[_0xffc8('0x7f')][_0x5b362d][_0xffc8('0x83')],_0x58b6ce['joins'][_0x5b362d][_0xffc8('0x81')],_0x58b6ce[_0xffc8('0x7f')][_0x5b362d][_0xffc8('0x80')]));}}}if(_0x58b6ce[_0xffc8('0x84')]){_0x58b6ce[_0xffc8('0x84')]=JSON[_0xffc8('0x85')](_0x58b6ce[_0xffc8('0x84')]);_0x217cdb[_0xffc8('0x3c')](_0x3b809c(_0x58b6ce[_0xffc8('0x84')]['group']));}_0x250525=_0x217cdb['clone']();_0x217cdb['limit'](_0xdf0ebd);_0x217cdb[_0xffc8('0x1d')](0x0);logger[_0xffc8('0x86')](_0xffc8('0x87'),_0x217cdb[_0xffc8('0x88')]());return dbH[_0xffc8('0x89')][_0xffc8('0x34')](_0x217cdb[_0xffc8('0x88')](),{'type':dbH[_0xffc8('0x89')][_0xffc8('0x8a')][_0xffc8('0x8b')]});}})[_0xffc8('0x25')](respondWithResult(_0x27fb50,null))[_0xffc8('0x46')](handleError(_0x27fb50,null));};function runReport(_0x962763,_0x5dc242,_0x3a6ce5){var _0x55b463=_0x5dc242[_0xffc8('0x2b')];var _0x4d3bda=0xa;var _0x58b8e6=[_0xffc8('0x57'),_0xffc8('0x58'),_0xffc8('0x59'),_0xffc8('0x5a')];var _0x450691={'SUM':_0xffc8('0x5b'),'COUNT':_0xffc8('0x8c'),'COUNT DISTINCT':_0xffc8('0x5c'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xffc8('0x5e'),'GROUP_CONCAT ASC':_0xffc8('0x5f'),'GROUP_CONCAT DESC':_0xffc8('0x60')};var _0x5f337e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xffc8('0x62'),'HOUR':_0xffc8('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xffc8('0x8d')};var _0x44b6b3=function(_0x2196c6){return!_['includes']([_0xffc8('0x66'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xffc8('0x69')],_0x2196c6);};var _0x3a7d1d=function(_0x3cf7fe){if(!_0x3cf7fe||!_0x3cf7fe[_0xffc8('0x6a')][_0xffc8('0x4a')]){return'';}for(var _0x4a2463='(',_0xa6311c=0x0;_0xa6311c<_0x3cf7fe['rules'][_0xffc8('0x4a')];_0xa6311c+=0x1){_0xa6311c>0x0&&(_0x4a2463+='\x20'+_0x3cf7fe[_0xffc8('0x8e')]+'\x20');_0x4a2463+=_0x3cf7fe['rules'][_0xa6311c][_0xffc8('0x6b')]?_0x3a7d1d(_0x3cf7fe['rules'][_0xa6311c][_0xffc8('0x6b')]):_0x3cf7fe['rules'][_0xa6311c]['field']+'\x20'+_0x3cf7fe['rules'][_0xa6311c]['condition']+(_0x44b6b3(_0x3cf7fe[_0xffc8('0x6a')][_0xa6311c][_0xffc8('0x6d')])?'\x20'+_0x3cf7fe[_0xffc8('0x6a')][_0xa6311c]['value']:'');}return _0x4a2463+')';};var _0x584d07={'where':{'id':_0x962763['id']}},_0x5a1abb,_0x3ef204,_0x134f86,_0x19404a,_0x4190d6;_0x584d07=_[_0xffc8('0x3e')]({},_0x584d07,_0x3a6ce5);return db[_0xffc8('0x2e')][_0xffc8('0x51')](_0x584d07)['then'](function(_0x368946){if(_0x368946){_0x5a1abb=_0x368946;return _0x368946['getFields']();}return null;})[_0xffc8('0x25')](function(_0x1ef7b3){if(_0x1ef7b3){if(!_0x1ef7b3[_0xffc8('0x4a')]){throw new db[(_0xffc8('0x70'))]['ValidationErrorItem'](_0xffc8('0x72'),0x193);}_0x3ef204=_0x1ef7b3;return db['AnalyticMetric'][_0xffc8('0x44')]({'raw':!![]});}return null;})[_0xffc8('0x25')](function(_0x5615f2){if(_0x5615f2){_0x134f86=_[_0xffc8('0x8f')](_0x5615f2,'id');var _0x4c4217;var _0x13037e=squel[_0xffc8('0x74')]();_0x13037e['from'](_0x5a1abb['table']);for(var _0x517db2=0x0;_0x517db2<_0x3ef204[_0xffc8('0x4a')];_0x517db2+=0x1){_0x4c4217=_0x3ef204[_0x517db2][_0xffc8('0x90')]?_0x134f86[_0x3ef204[_0x517db2][_0xffc8('0x90')]][_0xffc8('0x77')]:_0x3ef204[_0x517db2]['field'];_0x4c4217=_0x3ef204[_0x517db2][_0xffc8('0x79')]?_[_0xffc8('0x78')](_0x450691[_0x3ef204[_0x517db2][_0xffc8('0x79')]],'%s',_0x4c4217):_0x4c4217;_0x4c4217=_0x3ef204[_0x517db2][_0xffc8('0x7a')]?_[_0xffc8('0x78')](_0x5f337e[_0x3ef204[_0x517db2][_0xffc8('0x7a')]],'%s',_0x4c4217):_0x4c4217;if(_0x3ef204[_0x517db2][_0xffc8('0x7b')]){_0x13037e[_0xffc8('0x6b')](_0x4c4217);}_0x3ef204[_0x517db2][_0xffc8('0x7c')]&&_0x13037e['order'](_0x4c4217,_0x3ef204[_0x517db2]['orderBy']===_0xffc8('0x7d')?![]:!![]);_0x13037e[_0xffc8('0x6c')](_0x4c4217,_0x3ef204[_0x517db2][_0xffc8('0x7e')]||_0x4c4217);}if(_0x5a1abb[_0xffc8('0x7f')]){_0x5a1abb['joins']=JSON[_0xffc8('0x85')](_0x5a1abb['joins']);for(var _0x34b9c8=0x0;_0x34b9c8<_0x5a1abb[_0xffc8('0x7f')]['length'];_0x34b9c8+=0x1){if(_0x5a1abb['joins'][_0x34b9c8][_0xffc8('0x31')]&&_[_0xffc8('0x65')](_0x58b8e6,_0x5a1abb[_0xffc8('0x7f')][_0x34b9c8][_0xffc8('0x31')])&&_0x5a1abb['joins'][_0x34b9c8][_0xffc8('0x83')]&&_0x5a1abb['joins'][_0x34b9c8][_0xffc8('0x81')]&&_0x5a1abb[_0xffc8('0x7f')][_0x34b9c8][_0xffc8('0x80')]){_0x13037e[_0x5a1abb[_0xffc8('0x7f')][_0x34b9c8][_0xffc8('0x31')]](_0x5a1abb[_0xffc8('0x7f')][_0x34b9c8][_0xffc8('0x81')],null,util[_0xffc8('0x7a')](_0xffc8('0x82'),_0x5a1abb[_0xffc8('0x76')],_0x5a1abb[_0xffc8('0x7f')][_0x34b9c8][_0xffc8('0x83')],_0x5a1abb['joins'][_0x34b9c8][_0xffc8('0x81')],_0x5a1abb[_0xffc8('0x7f')][_0x34b9c8]['foreignKey']));}}}if(_0x5a1abb[_0xffc8('0x84')]){_0x5a1abb[_0xffc8('0x84')]=JSON[_0xffc8('0x85')](_0x5a1abb['conditions']);_0x13037e[_0xffc8('0x3c')](_0x3a7d1d(_0x5a1abb['conditions']['group']));}_0x4190d6=_0x13037e[_0xffc8('0x91')]();_0x13037e[_0xffc8('0x1f')](_0x4d3bda);_0x13037e[_0xffc8('0x1d')](0x0);return;}})['then'](function(){if(_0x5dc242[_0xffc8('0x92')]===_0xffc8('0x93')){return null;}var _0x5f3169=_[_0xffc8('0x3e')](_0x5dc242,{'name':_0x5dc242[_0xffc8('0x94')]||_0x5dc242[_0xffc8('0x2b')]||_0x5a1abb['name'],'basename':_0x55b463,'savename':util[_0xffc8('0x7a')](_0xffc8('0x95'),_0x5dc242['name']||_0x5a1abb[_0xffc8('0x2b')],require('randomstring')[_0xffc8('0x96')](0x4),_0x5dc242[_0xffc8('0x92')]||_0xffc8('0x97')),'reportId':_0x5a1abb['id'],'reportType':_0xffc8('0x98')});return db[_0xffc8('0x99')]['create'](_0x5f3169,{'raw':!![]});})[_0xffc8('0x25')](function(_0x3cec6f){if(_0x5a1abb[_0xffc8('0x76')]===_0xffc8('0x9a')){_0x4190d6[_0xffc8('0x3c')](_0x5a1abb[_0xffc8('0x76')]+_0xffc8('0x9b'),_0x5dc242[_0xffc8('0x9c')],_0x5dc242[_0xffc8('0x9d')]);}else{_0x4190d6['where'](_0x5a1abb['table']+_0xffc8('0x9e'),_0x5dc242[_0xffc8('0x9c')],_0x5dc242['endDate']);}if(_0x3cec6f){logger['info']('Run\x20Query:',_0x4190d6[_0xffc8('0x88')]());require(_0xffc8('0x9f'))['fork'](path[_0xffc8('0x57')](__dirname,'../../components/export/',_0x3cec6f['output']),[_0x3cec6f['id'],_0x4190d6[_0xffc8('0x88')](),path[_0xffc8('0x57')](__dirname,_0xffc8('0xa0'),_0x3cec6f[_0xffc8('0xa1')]),_0x55b463]);return _0x3cec6f;}else{var _0x33e069=squel[_0xffc8('0x74')]();_0x33e069[_0xffc8('0x75')]('('+_0x4190d6[_0xffc8('0x88')]()+')',_0xffc8('0xa2'));_0x33e069['field'](_0xffc8('0xa3'),_0xffc8('0x20'));_0x4190d6[_0xffc8('0x1f')](_0x5dc242[_0xffc8('0x1f')]||_0x4d3bda);_0x4190d6[_0xffc8('0x1d')](_0x5dc242[_0xffc8('0x1d')]||0x0);return dbH[_0xffc8('0x89')][_0xffc8('0x34')](_0x33e069[_0xffc8('0x88')](),{'type':dbH[_0xffc8('0x89')][_0xffc8('0x8a')][_0xffc8('0x8b')]})[_0xffc8('0x25')](function(_0x17d7a7){if(!_0x17d7a7[_0xffc8('0x4a')]){_0x19404a=0x0;}else{_0x19404a=_0x17d7a7[0x0]['count']||0x0;}return dbH[_0xffc8('0x89')][_0xffc8('0x34')](_0x4190d6[_0xffc8('0x88')](),{'type':dbH[_0xffc8('0x89')][_0xffc8('0x8a')][_0xffc8('0x8b')]});})[_0xffc8('0x25')](function(_0x2762ff){return{'rows':_0x2762ff||[],'count':_0x19404a};});}});}exports[_0xffc8('0xa4')]=function(_0x53ce74,_0x44e87b){return runReport(_0x53ce74['params'],_0x53ce74[_0xffc8('0x34')],_0x53ce74['options'])['then'](respondWithResult(_0x44e87b,null))[_0xffc8('0x46')](handleError(_0x44e87b,null));};exports[_0xffc8('0xa5')]=runReport;exports[_0xffc8('0x34')]=function(_0x41dcfa,_0x4e10c9){var _0x11e6c3=0xa;var _0x4002f5=[_0xffc8('0x57'),'left_join',_0xffc8('0x59'),_0xffc8('0x5a')];var _0x1a854f={'SUM':_0xffc8('0x5b'),'COUNT':_0xffc8('0x8c'),'COUNT DISTINCT':_0xffc8('0x5c'),'MAX':_0xffc8('0xa6'),'MIN':'MIN(%s)','AVG':_0xffc8('0xa7'),'GROUP_CONCAT':_0xffc8('0x5e'),'GROUP_CONCAT ASC':_0xffc8('0x5f'),'GROUP_CONCAT DESC':_0xffc8('0x60')};var _0x367b8f={'SEC_TO_TIME':_0xffc8('0x61'),'DATE':'DATE(%s)','HOUR':_0xffc8('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xffc8('0x8d')};var _0x42bb1f=function(_0x1e7df5){return!_[_0xffc8('0x65')](['IS\x20NULL',_0xffc8('0x67'),'IS\x20EMPTY',_0xffc8('0x69')],_0x1e7df5);};var _0x2f9ff5=function(_0x53c709){if(!_0x53c709||!_0x53c709[_0xffc8('0x6a')][_0xffc8('0x4a')]){return'';}for(var _0x40758d='(',_0xf4310a=0x0;_0xf4310a<_0x53c709[_0xffc8('0x6a')][_0xffc8('0x4a')];_0xf4310a+=0x1){_0xf4310a>0x0&&(_0x40758d+='\x20'+_0x53c709[_0xffc8('0x8e')]+'\x20');_0x40758d+=_0x53c709[_0xffc8('0x6a')][_0xf4310a][_0xffc8('0x6b')]?_0x2f9ff5(_0x53c709[_0xffc8('0x6a')][_0xf4310a][_0xffc8('0x6b')]):_0x53c709['rules'][_0xf4310a][_0xffc8('0x6c')]+'\x20'+_0x53c709[_0xffc8('0x6a')][_0xf4310a][_0xffc8('0x6d')]+(_0x42bb1f(_0x53c709[_0xffc8('0x6a')][_0xf4310a][_0xffc8('0x6d')])?'\x20'+_0x53c709[_0xffc8('0x6a')][_0xf4310a][_0xffc8('0x6e')]:'');}return _0x40758d+')';};var _0x558772={'where':{'id':_0x41dcfa[_0xffc8('0x48')]['id']}},_0x26d27e,_0x1b75d2,_0xb2b022,_0x47aeee,_0x2f85ed;_0x558772=_['merge']({},_0x558772,_0x41dcfa[_0xffc8('0x41')]);return db['AnalyticCustomReport'][_0xffc8('0x51')](_0x558772)[_0xffc8('0x25')](function(_0x55a93d){if(_0x55a93d){_0x26d27e=_0x55a93d;return _0x55a93d[_0xffc8('0x6f')]();}return null;})['then'](function(_0x387c5e){if(_0x387c5e){if(!_0x387c5e[_0xffc8('0x4a')]){throw new db[(_0xffc8('0x70'))][(_0xffc8('0x71'))](_0xffc8('0x72'),0x193);}_0x1b75d2=_0x387c5e;return db[_0xffc8('0x73')][_0xffc8('0x44')]({'raw':!![]});}return null;})[_0xffc8('0x25')](function(_0x5d34be){if(_0x5d34be){_0xb2b022=_[_0xffc8('0x8f')](_0x5d34be,'id');var _0x366d66;var _0x5788f7=squel[_0xffc8('0x74')]();_0x5788f7[_0xffc8('0x75')](_0x26d27e[_0xffc8('0x76')]);for(var _0x1bcb55=0x0;_0x1bcb55<_0x1b75d2[_0xffc8('0x4a')];_0x1bcb55+=0x1){_0x366d66=_0x1b75d2[_0x1bcb55]['MetricId']?_0xb2b022[_0x1b75d2[_0x1bcb55][_0xffc8('0x90')]][_0xffc8('0x77')]:_0x1b75d2[_0x1bcb55][_0xffc8('0x6c')];_0x366d66=_0x1b75d2[_0x1bcb55]['function']?_[_0xffc8('0x78')](_0x1a854f[_0x1b75d2[_0x1bcb55][_0xffc8('0x79')]],'%s',_0x366d66):_0x366d66;_0x366d66=_0x1b75d2[_0x1bcb55][_0xffc8('0x7a')]?_[_0xffc8('0x78')](_0x367b8f[_0x1b75d2[_0x1bcb55][_0xffc8('0x7a')]],'%s',_0x366d66):_0x366d66;if(_0x1b75d2[_0x1bcb55][_0xffc8('0x7b')]){_0x5788f7[_0xffc8('0x6b')](_0x366d66);}_0x1b75d2[_0x1bcb55][_0xffc8('0x7c')]&&_0x5788f7[_0xffc8('0x3a')](_0x366d66,_0x1b75d2[_0x1bcb55][_0xffc8('0x7c')]===_0xffc8('0x7d')?![]:!![]);_0x5788f7[_0xffc8('0x6c')](_0x366d66,_0x1b75d2[_0x1bcb55][_0xffc8('0x7e')]||_0x366d66);}if(_0x26d27e[_0xffc8('0x7f')]){_0x26d27e[_0xffc8('0x7f')]=JSON[_0xffc8('0x85')](_0x26d27e['joins']);for(var _0x582ae5=0x0;_0x582ae5<_0x26d27e['joins'][_0xffc8('0x4a')];_0x582ae5+=0x1){if(_0x26d27e[_0xffc8('0x7f')][_0x582ae5]['type']&&_['includes'](_0x4002f5,_0x26d27e[_0xffc8('0x7f')][_0x582ae5][_0xffc8('0x31')])&&_0x26d27e['joins'][_0x582ae5][_0xffc8('0x83')]&&_0x26d27e[_0xffc8('0x7f')][_0x582ae5][_0xffc8('0x81')]&&_0x26d27e[_0xffc8('0x7f')][_0x582ae5][_0xffc8('0x80')]){_0x5788f7[_0x26d27e[_0xffc8('0x7f')][_0x582ae5][_0xffc8('0x31')]](_0x26d27e['joins'][_0x582ae5][_0xffc8('0x81')],null,util['format'](_0xffc8('0x82'),_0x26d27e['table'],_0x26d27e['joins'][_0x582ae5][_0xffc8('0x83')],_0x26d27e[_0xffc8('0x7f')][_0x582ae5]['foreignTable'],_0x26d27e[_0xffc8('0x7f')][_0x582ae5][_0xffc8('0x80')]));}}}if(_0x26d27e[_0xffc8('0x84')]){_0x26d27e[_0xffc8('0x84')]=JSON[_0xffc8('0x85')](_0x26d27e[_0xffc8('0x84')]);_0x5788f7[_0xffc8('0x3c')](_0x2f9ff5(_0x26d27e[_0xffc8('0x84')][_0xffc8('0x6b')]));}_0x2f85ed=_0x5788f7[_0xffc8('0x91')]();_0x5788f7[_0xffc8('0x1f')](_0x11e6c3);_0x5788f7['offset'](0x0);logger[_0xffc8('0x86')](_0xffc8('0x87'),_0x5788f7[_0xffc8('0x88')]());return dbH[_0xffc8('0x89')][_0xffc8('0x34')](_0x5788f7[_0xffc8('0x88')](),{'type':dbH[_0xffc8('0x89')][_0xffc8('0x8a')][_0xffc8('0x8b')]});}})[_0xffc8('0x25')](function(){return{'sql':_0x2f85ed[_0xffc8('0x88')]()};})[_0xffc8('0x25')](respondWithResult(_0x4e10c9,null))[_0xffc8('0x46')](handleError(_0x4e10c9,null));};
\ No newline at end of file
+var _0x2820=['startDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','ValidationErrorItem','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','end','stack','name','send','index','map','AnalyticCustomReport','fieldName','key','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_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)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','group','field','condition','value','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','operator','getFields','Sequelize','keyBy','from','output','web','fullPath','randomstring','generate','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0x2820,0xb2));var _0x0282=function(_0x553e1f,_0x52741){_0x553e1f=_0x553e1f-0x0;var _0x45728a=_0x2820[_0x553e1f];return _0x45728a;};'use strict';var emlformat=require(_0x0282('0x0'));var rimraf=require(_0x0282('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0282('0x2'));var rp=require(_0x0282('0x3'));var moment=require(_0x0282('0x4'));var BPromise=require(_0x0282('0x5'));var Mustache=require('mustache');var util=require(_0x0282('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0282('0x7'));var _=require(_0x0282('0x8'));var squel=require(_0x0282('0x9'));var crypto=require(_0x0282('0xa'));var jsforce=require(_0x0282('0xb'));var deskjs=require(_0x0282('0xc'));var toCsv=require(_0x0282('0xd'));var querystring=require('querystring');var Papa=require(_0x0282('0xe'));var Redis=require(_0x0282('0xf'));var authService=require(_0x0282('0x10'));var qs=require(_0x0282('0x11'));var as=require(_0x0282('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0282('0x13'));var utils=require('../../config/utils');var config=require(_0x0282('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0282('0x15'))['db'];var dbH=require('../../mysqldb')[_0x0282('0x16')];function respondWithStatusCode(_0x2b6973,_0xbeea1d){_0xbeea1d=_0xbeea1d||0xcc;return function(_0x3693cb){if(_0x3693cb){return _0x2b6973[_0x0282('0x17')](_0xbeea1d);}return _0x2b6973[_0x0282('0x18')](_0xbeea1d)['end']();};}function respondWithResult(_0x37e6e8,_0x3a8f3b){_0x3a8f3b=_0x3a8f3b||0xc8;return function(_0x2e77ee){if(_0x2e77ee){return _0x37e6e8[_0x0282('0x18')](_0x3a8f3b)[_0x0282('0x19')](_0x2e77ee);}};}function respondWithFilteredResult(_0x3c4908,_0x5c01cd){return function(_0x32a1cb){if(_0x32a1cb){var _0xf7af46=typeof _0x5c01cd[_0x0282('0x1a')]===_0x0282('0x1b')&&typeof _0x5c01cd[_0x0282('0x1c')]===_0x0282('0x1b');var _0x2962c4=_0x32a1cb[_0x0282('0x1d')];var _0x16b273=_0xf7af46?0x0:_0x5c01cd['offset'];var _0x32e75c=_0xf7af46?_0x32a1cb[_0x0282('0x1d')]:_0x5c01cd[_0x0282('0x1a')]+_0x5c01cd[_0x0282('0x1c')];var _0x1cd597;if(_0x32e75c>=_0x2962c4){_0x32e75c=_0x2962c4;_0x1cd597=0xc8;}else{_0x1cd597=0xce;}_0x3c4908[_0x0282('0x18')](_0x1cd597);return _0x3c4908[_0x0282('0x1e')]('Content-Range',_0x16b273+'-'+_0x32e75c+'/'+_0x2962c4)[_0x0282('0x19')](_0x32a1cb);}return null;};}function patchUpdates(_0x2db6e4){return function(_0x55022e){try{jsonpatch[_0x0282('0x1f')](_0x55022e,_0x2db6e4,!![]);}catch(_0x5cd825){return BPromise['reject'](_0x5cd825);}return _0x55022e[_0x0282('0x20')]();};}function saveUpdates(_0x19f811,_0x25d37d){return function(_0x48070c){if(_0x48070c){return _0x48070c[_0x0282('0x21')](_0x19f811)[_0x0282('0x22')](function(_0x35cef9){return _0x35cef9;});}return null;};}function removeEntity(_0x2e033d,_0x41237e){return function(_0x11d4d6){if(_0x11d4d6){return _0x11d4d6[_0x0282('0x23')]()['then'](function(){var _0x28046e=_0x11d4d6[_0x0282('0x24')]({'plain':!![]});var _0x5d8388=_0x0282('0x25');return db[_0x0282('0x26')][_0x0282('0x23')]({'where':{'type':_0x5d8388,'resourceId':_0x28046e['id']}})[_0x0282('0x22')](function(){return _0x11d4d6;});})[_0x0282('0x22')](function(){_0x2e033d[_0x0282('0x18')](0xcc)[_0x0282('0x27')]();});}};}function handleEntityNotFound(_0x19d145,_0x3f28b8){return function(_0x55bbda){if(!_0x55bbda){_0x19d145[_0x0282('0x17')](0x194);}return _0x55bbda;};}function handleError(_0x18143f,_0x4c5416){_0x4c5416=_0x4c5416||0x1f4;return function(_0x1e0601){logger['error'](_0x1e0601[_0x0282('0x28')]);if(_0x1e0601['name']){delete _0x1e0601[_0x0282('0x29')];}_0x18143f[_0x0282('0x18')](_0x4c5416)[_0x0282('0x2a')](_0x1e0601);};}exports[_0x0282('0x2b')]=function(_0x8c953f,_0x435896){var _0x302077={},_0x2b4136={},_0x13076f={'count':0x0,'rows':[]};var _0x43552d=_[_0x0282('0x2c')](db[_0x0282('0x2d')]['rawAttributes'],function(_0x1cd4a6){return{'name':_0x1cd4a6[_0x0282('0x2e')],'type':_0x1cd4a6['type'][_0x0282('0x2f')]};});_0x2b4136[_0x0282('0x30')]=_[_0x0282('0x2c')](_0x43552d,'name');_0x2b4136['query']=_[_0x0282('0x31')](_0x8c953f[_0x0282('0x32')]);_0x2b4136['filters']=_[_0x0282('0x33')](_0x2b4136[_0x0282('0x30')],_0x2b4136[_0x0282('0x32')]);_0x302077['attributes']=_[_0x0282('0x33')](_0x2b4136[_0x0282('0x30')],qs[_0x0282('0x34')](_0x8c953f[_0x0282('0x32')][_0x0282('0x34')]));_0x302077[_0x0282('0x35')]=_0x302077['attributes']['length']?_0x302077['attributes']:_0x2b4136[_0x0282('0x30')];if(!_0x8c953f[_0x0282('0x32')][_0x0282('0x36')](_0x0282('0x37'))){_0x302077[_0x0282('0x1c')]=qs[_0x0282('0x1c')](_0x8c953f[_0x0282('0x32')][_0x0282('0x1c')]);_0x302077[_0x0282('0x1a')]=qs[_0x0282('0x1a')](_0x8c953f[_0x0282('0x32')][_0x0282('0x1a')]);}_0x302077[_0x0282('0x38')]=qs['sort'](_0x8c953f[_0x0282('0x32')][_0x0282('0x39')]);_0x302077[_0x0282('0x3a')]=qs[_0x0282('0x3b')](_[_0x0282('0x3c')](_0x8c953f['query'],_0x2b4136[_0x0282('0x3b')]),_0x43552d);if(_0x8c953f['query'][_0x0282('0x3d')]){_0x302077[_0x0282('0x3a')]=_[_0x0282('0x3e')](_0x302077['where'],{'$or':_[_0x0282('0x2c')](_0x43552d,function(_0x493f3e){if(_0x493f3e[_0x0282('0x3f')]!==_0x0282('0x40')){var _0x5dca64={};_0x5dca64[_0x493f3e['name']]={'$like':'%'+_0x8c953f[_0x0282('0x32')]['filter']+'%'};return _0x5dca64;}})});}_0x302077=_['merge']({},_0x302077,_0x8c953f['options']);var _0x459a4c={'where':_0x302077['where']};return db['AnalyticCustomReport']['count'](_0x459a4c)[_0x0282('0x22')](function(_0x1eca73){_0x13076f[_0x0282('0x1d')]=_0x1eca73;if(_0x8c953f[_0x0282('0x32')][_0x0282('0x41')]){_0x302077[_0x0282('0x42')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x0282('0x43')](_0x302077);})[_0x0282('0x22')](function(_0x4305ff){_0x13076f[_0x0282('0x44')]=_0x4305ff;return _0x13076f;})['then'](respondWithFilteredResult(_0x435896,_0x302077))[_0x0282('0x45')](handleError(_0x435896,null));};exports[_0x0282('0x46')]=function(_0x59f608,_0x27dfd0){var _0x377de3={'raw':![],'where':{'id':_0x59f608[_0x0282('0x47')]['id']}},_0x275a08={};_0x275a08[_0x0282('0x30')]=_[_0x0282('0x31')](db[_0x0282('0x2d')][_0x0282('0x48')]);_0x275a08[_0x0282('0x32')]=_[_0x0282('0x31')](_0x59f608[_0x0282('0x32')]);_0x275a08[_0x0282('0x3b')]=_[_0x0282('0x33')](_0x275a08[_0x0282('0x30')],_0x275a08[_0x0282('0x32')]);_0x377de3[_0x0282('0x35')]=_[_0x0282('0x33')](_0x275a08['model'],qs[_0x0282('0x34')](_0x59f608[_0x0282('0x32')]['fields']));_0x377de3['attributes']=_0x377de3[_0x0282('0x35')]['length']?_0x377de3['attributes']:_0x275a08[_0x0282('0x30')];if(_0x59f608[_0x0282('0x32')][_0x0282('0x41')]){_0x377de3[_0x0282('0x42')]=[{'all':!![]}];}_0x377de3=_[_0x0282('0x3e')]({},_0x377de3,_0x59f608[_0x0282('0x49')]);return db[_0x0282('0x2d')]['find'](_0x377de3)['then'](handleEntityNotFound(_0x27dfd0,null))[_0x0282('0x22')](respondWithResult(_0x27dfd0,null))['catch'](handleError(_0x27dfd0,null));};exports['create']=function(_0x23cac5,_0x56cbda){return db[_0x0282('0x2d')]['create'](_0x23cac5[_0x0282('0x4a')],{})[_0x0282('0x22')](function(_0x57ec2b){var _0x35c794=_0x23cac5[_0x0282('0x4b')][_0x0282('0x24')]({'plain':!![]});if(!_0x35c794)throw new Error(_0x0282('0x4c'));if(_0x35c794[_0x0282('0x4d')]===_0x0282('0x4b')){var _0x3c0282=_0x57ec2b[_0x0282('0x24')]({'plain':!![]});var _0xc7d5b7=_0x0282('0x4e');return db[_0x0282('0x4f')][_0x0282('0x50')]({'where':{'name':_0xc7d5b7,'userProfileId':_0x35c794[_0x0282('0x51')]},'raw':!![]})[_0x0282('0x22')](function(_0x50588a){if(_0x50588a&&_0x50588a[_0x0282('0x52')]===0x0){return db[_0x0282('0x26')][_0x0282('0x53')]({'name':_0x3c0282['name'],'resourceId':_0x3c0282['id'],'type':_0x0282('0x25'),'sectionId':_0x50588a['id']},{})['then'](function(){return _0x57ec2b;});}else{return _0x57ec2b;}})[_0x0282('0x45')](function(_0x135cb6){logger[_0x0282('0x54')](_0x0282('0x55'),_0x135cb6);throw _0x135cb6;});}return _0x57ec2b;})['then'](respondWithResult(_0x56cbda,0xc9))[_0x0282('0x45')](handleError(_0x56cbda,null));};exports[_0x0282('0x21')]=function(_0x56ad03,_0x398475){if(_0x56ad03['body']['id']){delete _0x56ad03[_0x0282('0x4a')]['id'];}return db[_0x0282('0x2d')][_0x0282('0x50')]({'where':{'id':_0x56ad03[_0x0282('0x47')]['id']}})[_0x0282('0x22')](handleEntityNotFound(_0x398475,null))[_0x0282('0x22')](saveUpdates(_0x56ad03[_0x0282('0x4a')],null))[_0x0282('0x22')](respondWithResult(_0x398475,null))[_0x0282('0x45')](handleError(_0x398475,null));};exports[_0x0282('0x23')]=function(_0x40ba8a,_0x47b14f){return db['AnalyticCustomReport'][_0x0282('0x50')]({'where':{'id':_0x40ba8a['params']['id']}})[_0x0282('0x22')](handleEntityNotFound(_0x47b14f,null))[_0x0282('0x22')](removeEntity(_0x47b14f,null))['catch'](handleError(_0x47b14f,null));};exports['preview']=function(_0xe1201c,_0x26855c){var _0x1adcb0=0xa;var _0x5ede56=[_0x0282('0x56'),_0x0282('0x57'),'right_join',_0x0282('0x58')];var _0x2767f4={'SUM':_0x0282('0x59'),'COUNT':_0x0282('0x5a'),'COUNT DISTINCT':_0x0282('0x5b'),'MAX':_0x0282('0x5c'),'MIN':_0x0282('0x5d'),'AVG':_0x0282('0x5e'),'GROUP_CONCAT':_0x0282('0x5f'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x0282('0x60')};var _0x19ad87={'SEC_TO_TIME':_0x0282('0x61'),'DATE':_0x0282('0x62'),'HOUR':_0x0282('0x63'),'ROUND':_0x0282('0x64'),'UNIX_TIMESTAMP':_0x0282('0x65')};var _0x271099=function(_0x231c97){return!_[_0x0282('0x66')]([_0x0282('0x67'),'IS\x20NOT\x20NULL',_0x0282('0x68'),_0x0282('0x69')],_0x231c97);};var _0x3f352b=function(_0x1dd0eb){if(!_0x1dd0eb||!_0x1dd0eb[_0x0282('0x6a')][_0x0282('0x6b')]){return'';}for(var _0x3056f2='(',_0x74dce0=0x0;_0x74dce0<_0x1dd0eb[_0x0282('0x6a')]['length'];_0x74dce0+=0x1){_0x74dce0>0x0&&(_0x3056f2+='\x20'+_0x1dd0eb['operator']+'\x20');_0x3056f2+=_0x1dd0eb['rules'][_0x74dce0][_0x0282('0x6c')]?_0x3f352b(_0x1dd0eb[_0x0282('0x6a')][_0x74dce0]['group']):_0x1dd0eb['rules'][_0x74dce0][_0x0282('0x6d')]+'\x20'+_0x1dd0eb[_0x0282('0x6a')][_0x74dce0][_0x0282('0x6e')]+(_0x271099(_0x1dd0eb['rules'][_0x74dce0]['condition'])?'\x20'+_0x1dd0eb[_0x0282('0x6a')][_0x74dce0][_0x0282('0x6f')]:'');}return _0x3056f2+')';};var _0x22addb={'where':{'id':_0xe1201c[_0x0282('0x47')]['id']}},_0x34ea76,_0x1e0974,_0x4c0ecc,_0x39ea71,_0x1226e6;_0x22addb=_['merge']({},_0x22addb,_0xe1201c[_0x0282('0x49')]);return db[_0x0282('0x2d')][_0x0282('0x50')](_0x22addb)[_0x0282('0x22')](function(_0x3a4711){if(_0x3a4711){_0x34ea76=_0x3a4711;return _0x3a4711['getFields']();}return null;})['then'](function(_0x4b5d9c){if(_0x4b5d9c){if(!_0x4b5d9c[_0x0282('0x6b')]){throw new db['Sequelize']['ValidationErrorItem'](_0x0282('0x70'),0x193);}_0x1e0974=_0x4b5d9c;return db[_0x0282('0x71')][_0x0282('0x43')]({'raw':!![]});}return null;})['then'](function(_0x56d46a){if(_0x56d46a){_0x4c0ecc=_['keyBy'](_0x56d46a,'id');var _0x4c481b;var _0x3c6c56=squel[_0x0282('0x72')]();_0x3c6c56['from'](_0x34ea76[_0x0282('0x73')]);for(var _0x413ef2=0x0;_0x413ef2<_0x1e0974[_0x0282('0x6b')];_0x413ef2+=0x1){_0x4c481b=_0x1e0974[_0x413ef2][_0x0282('0x74')]?_0x4c0ecc[_0x1e0974[_0x413ef2][_0x0282('0x74')]][_0x0282('0x75')]:_0x1e0974[_0x413ef2][_0x0282('0x6d')];_0x4c481b=_0x1e0974[_0x413ef2]['function']?_[_0x0282('0x76')](_0x2767f4[_0x1e0974[_0x413ef2][_0x0282('0x77')]],'%s',_0x4c481b):_0x4c481b;_0x4c481b=_0x1e0974[_0x413ef2]['format']?_[_0x0282('0x76')](_0x19ad87[_0x1e0974[_0x413ef2][_0x0282('0x78')]],'%s',_0x4c481b):_0x4c481b;if(_0x1e0974[_0x413ef2][_0x0282('0x79')]){_0x3c6c56[_0x0282('0x6c')](_0x4c481b);}_0x1e0974[_0x413ef2][_0x0282('0x7a')]&&_0x3c6c56[_0x0282('0x38')](_0x4c481b,_0x1e0974[_0x413ef2][_0x0282('0x7a')]===_0x0282('0x7b')?![]:!![]);_0x3c6c56['field'](_0x4c481b,_0x1e0974[_0x413ef2][_0x0282('0x7c')]||_0x4c481b);}if(_0x34ea76[_0x0282('0x7d')]){_0x34ea76['joins']=JSON[_0x0282('0x7e')](_0x34ea76[_0x0282('0x7d')]);for(var _0x593b54=0x0;_0x593b54<_0x34ea76['joins']['length'];_0x593b54+=0x1){if(_0x34ea76[_0x0282('0x7d')][_0x593b54][_0x0282('0x3f')]&&_[_0x0282('0x66')](_0x5ede56,_0x34ea76[_0x0282('0x7d')][_0x593b54][_0x0282('0x3f')])&&_0x34ea76[_0x0282('0x7d')][_0x593b54][_0x0282('0x7f')]&&_0x34ea76[_0x0282('0x7d')][_0x593b54][_0x0282('0x80')]&&_0x34ea76[_0x0282('0x7d')][_0x593b54]['foreignKey']){_0x3c6c56[_0x34ea76[_0x0282('0x7d')][_0x593b54]['type']](_0x34ea76[_0x0282('0x7d')][_0x593b54]['foreignTable'],null,util['format'](_0x0282('0x81'),_0x34ea76[_0x0282('0x73')],_0x34ea76[_0x0282('0x7d')][_0x593b54][_0x0282('0x7f')],_0x34ea76['joins'][_0x593b54][_0x0282('0x80')],_0x34ea76['joins'][_0x593b54][_0x0282('0x82')]));}}}if(_0x34ea76['conditions']){_0x34ea76['conditions']=JSON[_0x0282('0x7e')](_0x34ea76[_0x0282('0x83')]);_0x3c6c56['where'](_0x3f352b(_0x34ea76[_0x0282('0x83')][_0x0282('0x6c')]));}_0x1226e6=_0x3c6c56[_0x0282('0x84')]();_0x3c6c56['limit'](_0x1adcb0);_0x3c6c56[_0x0282('0x1a')](0x0);logger['debug'](_0x0282('0x85'),_0x3c6c56[_0x0282('0x86')]());return dbH['sequelize'][_0x0282('0x32')](_0x3c6c56['toString'](),{'type':dbH[_0x0282('0x87')][_0x0282('0x88')][_0x0282('0x89')]});}})[_0x0282('0x22')](respondWithResult(_0x26855c,null))[_0x0282('0x45')](handleError(_0x26855c,null));};function runReport(_0xa999e7,_0x575bf1,_0x293ff0){var _0x3b8a6b=_0x575bf1['name'];var _0x3260bc=0xa;var _0x4f1a9c=[_0x0282('0x56'),_0x0282('0x57'),_0x0282('0x8a'),'cross_join'];var _0x36802a={'SUM':_0x0282('0x59'),'COUNT':_0x0282('0x5a'),'COUNT DISTINCT':_0x0282('0x5b'),'MAX':_0x0282('0x5c'),'MIN':_0x0282('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x0282('0x5f'),'GROUP_CONCAT ASC':_0x0282('0x8b'),'GROUP_CONCAT DESC':_0x0282('0x60')};var _0x209aca={'SEC_TO_TIME':_0x0282('0x61'),'DATE':_0x0282('0x62'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0282('0x65')};var _0x197b98=function(_0x11ac49){return!_[_0x0282('0x66')]([_0x0282('0x67'),_0x0282('0x8c'),_0x0282('0x68'),_0x0282('0x69')],_0x11ac49);};var _0x1b1311=function(_0x26c9d8){if(!_0x26c9d8||!_0x26c9d8[_0x0282('0x6a')]['length']){return'';}for(var _0x26b9dd='(',_0x2b1511=0x0;_0x2b1511<_0x26c9d8[_0x0282('0x6a')][_0x0282('0x6b')];_0x2b1511+=0x1){_0x2b1511>0x0&&(_0x26b9dd+='\x20'+_0x26c9d8[_0x0282('0x8d')]+'\x20');_0x26b9dd+=_0x26c9d8[_0x0282('0x6a')][_0x2b1511][_0x0282('0x6c')]?_0x1b1311(_0x26c9d8[_0x0282('0x6a')][_0x2b1511][_0x0282('0x6c')]):_0x26c9d8['rules'][_0x2b1511][_0x0282('0x6d')]+'\x20'+_0x26c9d8['rules'][_0x2b1511]['condition']+(_0x197b98(_0x26c9d8[_0x0282('0x6a')][_0x2b1511]['condition'])?'\x20'+_0x26c9d8['rules'][_0x2b1511][_0x0282('0x6f')]:'');}return _0x26b9dd+')';};var _0x481df9={'where':{'id':_0xa999e7['id']}},_0x2774f4,_0x4531e2,_0x234ac0,_0x915294,_0xd11573;_0x481df9=_[_0x0282('0x3e')]({},_0x481df9,_0x293ff0);return db[_0x0282('0x2d')][_0x0282('0x50')](_0x481df9)['then'](function(_0x23edd0){if(_0x23edd0){_0x2774f4=_0x23edd0;return _0x23edd0[_0x0282('0x8e')]();}return null;})[_0x0282('0x22')](function(_0x54dc0f){if(_0x54dc0f){if(!_0x54dc0f[_0x0282('0x6b')]){throw new db[(_0x0282('0x8f'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4531e2=_0x54dc0f;return db[_0x0282('0x71')][_0x0282('0x43')]({'raw':!![]});}return null;})['then'](function(_0x5d06e6){if(_0x5d06e6){_0x234ac0=_[_0x0282('0x90')](_0x5d06e6,'id');var _0x5e7577;var _0x5025de=squel['select']();_0x5025de[_0x0282('0x91')](_0x2774f4[_0x0282('0x73')]);for(var _0x237293=0x0;_0x237293<_0x4531e2[_0x0282('0x6b')];_0x237293+=0x1){_0x5e7577=_0x4531e2[_0x237293][_0x0282('0x74')]?_0x234ac0[_0x4531e2[_0x237293][_0x0282('0x74')]][_0x0282('0x75')]:_0x4531e2[_0x237293][_0x0282('0x6d')];_0x5e7577=_0x4531e2[_0x237293][_0x0282('0x77')]?_['replace'](_0x36802a[_0x4531e2[_0x237293]['function']],'%s',_0x5e7577):_0x5e7577;_0x5e7577=_0x4531e2[_0x237293]['format']?_[_0x0282('0x76')](_0x209aca[_0x4531e2[_0x237293][_0x0282('0x78')]],'%s',_0x5e7577):_0x5e7577;if(_0x4531e2[_0x237293]['groupBy']){_0x5025de[_0x0282('0x6c')](_0x5e7577);}_0x4531e2[_0x237293][_0x0282('0x7a')]&&_0x5025de[_0x0282('0x38')](_0x5e7577,_0x4531e2[_0x237293][_0x0282('0x7a')]==='DESC'?![]:!![]);_0x5025de[_0x0282('0x6d')](_0x5e7577,_0x4531e2[_0x237293][_0x0282('0x7c')]||_0x5e7577);}if(_0x2774f4[_0x0282('0x7d')]){_0x2774f4[_0x0282('0x7d')]=JSON[_0x0282('0x7e')](_0x2774f4[_0x0282('0x7d')]);for(var _0x4e8ff8=0x0;_0x4e8ff8<_0x2774f4['joins']['length'];_0x4e8ff8+=0x1){if(_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x3f')]&&_[_0x0282('0x66')](_0x4f1a9c,_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x3f')])&&_0x2774f4['joins'][_0x4e8ff8][_0x0282('0x7f')]&&_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x80')]&&_0x2774f4[_0x0282('0x7d')][_0x4e8ff8]['foreignKey']){_0x5025de[_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x3f')]](_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x80')],null,util[_0x0282('0x78')](_0x0282('0x81'),_0x2774f4['table'],_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x7f')],_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x80')],_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x82')]));}}}if(_0x2774f4['conditions']){_0x2774f4[_0x0282('0x83')]=JSON[_0x0282('0x7e')](_0x2774f4[_0x0282('0x83')]);_0x5025de[_0x0282('0x3a')](_0x1b1311(_0x2774f4[_0x0282('0x83')][_0x0282('0x6c')]));}_0xd11573=_0x5025de[_0x0282('0x84')]();_0x5025de[_0x0282('0x1c')](_0x3260bc);_0x5025de[_0x0282('0x1a')](0x0);return;}})[_0x0282('0x22')](function(){if(_0x575bf1[_0x0282('0x92')]===_0x0282('0x93')){return null;}var _0x893cbe=_['merge'](_0x575bf1,{'name':_0x575bf1[_0x0282('0x94')]||_0x575bf1[_0x0282('0x29')]||_0x2774f4[_0x0282('0x29')],'basename':_0x3b8a6b,'savename':util[_0x0282('0x78')]('%s-%s.%s',_0x575bf1['name']||_0x2774f4['name'],require(_0x0282('0x95'))[_0x0282('0x96')](0x4),_0x575bf1['output']||'csv'),'reportId':_0x2774f4['id'],'reportType':_0x0282('0x97')});return db[_0x0282('0x98')][_0x0282('0x53')](_0x893cbe,{'raw':!![]});})[_0x0282('0x22')](function(_0x1aa218){if(_0x2774f4[_0x0282('0x73')]==='cdr'){_0xd11573[_0x0282('0x3a')](_0x2774f4[_0x0282('0x73')]+_0x0282('0x99'),_0x575bf1['startDate'],_0x575bf1[_0x0282('0x9a')]);}else{_0xd11573[_0x0282('0x3a')](_0x2774f4[_0x0282('0x73')]+_0x0282('0x9b'),_0x575bf1[_0x0282('0x9c')],_0x575bf1['endDate']);}if(_0x1aa218){logger[_0x0282('0x9d')](_0x0282('0x9e'),_0xd11573[_0x0282('0x86')]());require(_0x0282('0x9f'))[_0x0282('0xa0')](path[_0x0282('0x56')](__dirname,'../../components/export/',_0x1aa218[_0x0282('0x92')]),[_0x1aa218['id'],_0xd11573[_0x0282('0x86')](),path['join'](__dirname,_0x0282('0xa1'),_0x1aa218[_0x0282('0xa2')]),_0x3b8a6b]);return _0x1aa218;}else{var _0x2fb8cf=squel[_0x0282('0x72')]();_0x2fb8cf[_0x0282('0x91')]('('+_0xd11573['toString']()+')',_0x0282('0xa3'));_0x2fb8cf[_0x0282('0x6d')]('COUNT(*)',_0x0282('0x1d'));_0xd11573[_0x0282('0x1c')](_0x575bf1[_0x0282('0x1c')]||_0x3260bc);_0xd11573[_0x0282('0x1a')](_0x575bf1[_0x0282('0x1a')]||0x0);return dbH['sequelize'][_0x0282('0x32')](_0x2fb8cf[_0x0282('0x86')](),{'type':dbH[_0x0282('0x87')][_0x0282('0x88')]['SELECT']})[_0x0282('0x22')](function(_0x41ffdb){if(!_0x41ffdb['length']){_0x915294=0x0;}else{_0x915294=_0x41ffdb[0x0][_0x0282('0x1d')]||0x0;}return dbH[_0x0282('0x87')][_0x0282('0x32')](_0xd11573[_0x0282('0x86')](),{'type':dbH[_0x0282('0x87')][_0x0282('0x88')][_0x0282('0x89')]});})[_0x0282('0x22')](function(_0xef882e){return{'rows':_0xef882e||[],'count':_0x915294};});}});}exports[_0x0282('0xa4')]=function(_0x3c2a61,_0x5bbd85){return runReport(_0x3c2a61['params'],_0x3c2a61[_0x0282('0x32')],_0x3c2a61[_0x0282('0x49')])[_0x0282('0x22')](respondWithResult(_0x5bbd85,null))['catch'](handleError(_0x5bbd85,null));};exports[_0x0282('0xa5')]=runReport;exports[_0x0282('0x32')]=function(_0x34c5b5,_0xfed5e8){var _0x5032c6=0xa;var _0x2ac471=[_0x0282('0x56'),_0x0282('0x57'),_0x0282('0x8a'),'cross_join'];var _0x8082f2={'SUM':'SUM(%s)','COUNT':_0x0282('0x5a'),'COUNT DISTINCT':_0x0282('0x5b'),'MAX':'MAX(%s)','MIN':_0x0282('0x5d'),'AVG':_0x0282('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x0282('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x31e03a={'SEC_TO_TIME':_0x0282('0x61'),'DATE':_0x0282('0x62'),'HOUR':_0x0282('0x63'),'ROUND':_0x0282('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1096a5=function(_0x8a2f49){return!_[_0x0282('0x66')]([_0x0282('0x67'),_0x0282('0x8c'),_0x0282('0x68'),_0x0282('0x69')],_0x8a2f49);};var _0x42a117=function(_0xa4c9a5){if(!_0xa4c9a5||!_0xa4c9a5[_0x0282('0x6a')][_0x0282('0x6b')]){return'';}for(var _0x186569='(',_0x4cf2da=0x0;_0x4cf2da<_0xa4c9a5[_0x0282('0x6a')][_0x0282('0x6b')];_0x4cf2da+=0x1){_0x4cf2da>0x0&&(_0x186569+='\x20'+_0xa4c9a5[_0x0282('0x8d')]+'\x20');_0x186569+=_0xa4c9a5['rules'][_0x4cf2da][_0x0282('0x6c')]?_0x42a117(_0xa4c9a5['rules'][_0x4cf2da][_0x0282('0x6c')]):_0xa4c9a5[_0x0282('0x6a')][_0x4cf2da]['field']+'\x20'+_0xa4c9a5[_0x0282('0x6a')][_0x4cf2da]['condition']+(_0x1096a5(_0xa4c9a5[_0x0282('0x6a')][_0x4cf2da][_0x0282('0x6e')])?'\x20'+_0xa4c9a5[_0x0282('0x6a')][_0x4cf2da][_0x0282('0x6f')]:'');}return _0x186569+')';};var _0x5ed494={'where':{'id':_0x34c5b5[_0x0282('0x47')]['id']}},_0x30b026,_0x5638d8,_0x5b21d3,_0x38ca76,_0x2a4a5e;_0x5ed494=_[_0x0282('0x3e')]({},_0x5ed494,_0x34c5b5[_0x0282('0x49')]);return db['AnalyticCustomReport'][_0x0282('0x50')](_0x5ed494)['then'](function(_0x19461c){if(_0x19461c){_0x30b026=_0x19461c;return _0x19461c[_0x0282('0x8e')]();}return null;})[_0x0282('0x22')](function(_0x58dcc3){if(_0x58dcc3){if(!_0x58dcc3[_0x0282('0x6b')]){throw new db[(_0x0282('0x8f'))][(_0x0282('0xa6'))](_0x0282('0x70'),0x193);}_0x5638d8=_0x58dcc3;return db['AnalyticMetric'][_0x0282('0x43')]({'raw':!![]});}return null;})[_0x0282('0x22')](function(_0x1202c3){if(_0x1202c3){_0x5b21d3=_[_0x0282('0x90')](_0x1202c3,'id');var _0x39b44b;var _0x38cb34=squel[_0x0282('0x72')]();_0x38cb34['from'](_0x30b026[_0x0282('0x73')]);for(var _0x54096c=0x0;_0x54096c<_0x5638d8['length'];_0x54096c+=0x1){_0x39b44b=_0x5638d8[_0x54096c][_0x0282('0x74')]?_0x5b21d3[_0x5638d8[_0x54096c][_0x0282('0x74')]][_0x0282('0x75')]:_0x5638d8[_0x54096c][_0x0282('0x6d')];_0x39b44b=_0x5638d8[_0x54096c]['function']?_[_0x0282('0x76')](_0x8082f2[_0x5638d8[_0x54096c][_0x0282('0x77')]],'%s',_0x39b44b):_0x39b44b;_0x39b44b=_0x5638d8[_0x54096c][_0x0282('0x78')]?_[_0x0282('0x76')](_0x31e03a[_0x5638d8[_0x54096c][_0x0282('0x78')]],'%s',_0x39b44b):_0x39b44b;if(_0x5638d8[_0x54096c]['groupBy']){_0x38cb34[_0x0282('0x6c')](_0x39b44b);}_0x5638d8[_0x54096c][_0x0282('0x7a')]&&_0x38cb34['order'](_0x39b44b,_0x5638d8[_0x54096c][_0x0282('0x7a')]===_0x0282('0x7b')?![]:!![]);_0x38cb34[_0x0282('0x6d')](_0x39b44b,_0x5638d8[_0x54096c][_0x0282('0x7c')]||_0x39b44b);}if(_0x30b026[_0x0282('0x7d')]){_0x30b026[_0x0282('0x7d')]=JSON[_0x0282('0x7e')](_0x30b026[_0x0282('0x7d')]);for(var _0x276107=0x0;_0x276107<_0x30b026[_0x0282('0x7d')][_0x0282('0x6b')];_0x276107+=0x1){if(_0x30b026[_0x0282('0x7d')][_0x276107][_0x0282('0x3f')]&&_['includes'](_0x2ac471,_0x30b026[_0x0282('0x7d')][_0x276107][_0x0282('0x3f')])&&_0x30b026[_0x0282('0x7d')][_0x276107][_0x0282('0x7f')]&&_0x30b026[_0x0282('0x7d')][_0x276107][_0x0282('0x80')]&&_0x30b026['joins'][_0x276107][_0x0282('0x82')]){_0x38cb34[_0x30b026[_0x0282('0x7d')][_0x276107][_0x0282('0x3f')]](_0x30b026['joins'][_0x276107][_0x0282('0x80')],null,util[_0x0282('0x78')](_0x0282('0x81'),_0x30b026[_0x0282('0x73')],_0x30b026['joins'][_0x276107][_0x0282('0x7f')],_0x30b026[_0x0282('0x7d')][_0x276107][_0x0282('0x80')],_0x30b026[_0x0282('0x7d')][_0x276107][_0x0282('0x82')]));}}}if(_0x30b026[_0x0282('0x83')]){_0x30b026[_0x0282('0x83')]=JSON[_0x0282('0x7e')](_0x30b026[_0x0282('0x83')]);_0x38cb34[_0x0282('0x3a')](_0x42a117(_0x30b026[_0x0282('0x83')][_0x0282('0x6c')]));}_0x2a4a5e=_0x38cb34[_0x0282('0x84')]();_0x38cb34[_0x0282('0x1c')](_0x5032c6);_0x38cb34['offset'](0x0);logger['debug']('Limited\x20Query:',_0x38cb34[_0x0282('0x86')]());return dbH[_0x0282('0x87')][_0x0282('0x32')](_0x38cb34[_0x0282('0x86')](),{'type':dbH[_0x0282('0x87')]['QueryTypes'][_0x0282('0x89')]});}})[_0x0282('0x22')](function(){return{'sql':_0x2a4a5e['toString']()};})[_0x0282('0x22')](respondWithResult(_0xfed5e8,null))['catch'](handleError(_0xfed5e8,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index da317a1..4ef6857 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 _0xd0bc=['api','moment','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','util','../../config/logger'];(function(_0x27d633,_0x205c94){var _0x74ba36=function(_0x5517e0){while(--_0x5517e0){_0x27d633['push'](_0x27d633['shift']());}};_0x74ba36(++_0x205c94);}(_0xd0bc,0xc0));var _0xcd0b=function(_0x1e3c02,_0x5c07a2){_0x1e3c02=_0x1e3c02-0x0;var _0x4d26d7=_0xd0bc[_0x1e3c02];return _0x4d26d7;};'use strict';var _=require(_0xcd0b('0x0'));var util=require(_0xcd0b('0x1'));var logger=require(_0xcd0b('0x2'))(_0xcd0b('0x3'));var moment=require(_0xcd0b('0x4'));var BPromise=require('bluebird');var rp=require(_0xcd0b('0x5'));var fs=require('fs');var path=require(_0xcd0b('0x6'));var rimraf=require(_0xcd0b('0x7'));var config=require(_0xcd0b('0x8'));var attributes=require(_0xcd0b('0x9'));module[_0xcd0b('0xa')]=function(_0x3a7230,_0xd46164){return _0x3a7230[_0xcd0b('0xb')](_0xcd0b('0xc'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x35bc=['rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x35bc,0x10e));var _0xc35b=function(_0xcb0eb2,_0x3906bf){_0xcb0eb2=_0xcb0eb2-0x0;var _0xbab9b8=_0x35bc[_0xcb0eb2];return _0xbab9b8;};'use strict';var _=require(_0xc35b('0x0'));var util=require(_0xc35b('0x1'));var logger=require(_0xc35b('0x2'))(_0xc35b('0x3'));var moment=require(_0xc35b('0x4'));var BPromise=require('bluebird');var rp=require(_0xc35b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc35b('0x6'));var config=require(_0xc35b('0x7'));var attributes=require(_0xc35b('0x8'));module[_0xc35b('0x9')]=function(_0x5ee40b,_0x90f53a){return _0x5ee40b[_0xc35b('0xa')](_0xc35b('0xb'),attributes,{'tableName':'analytics_custom_reports','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 b292007..c95912f 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 _0x7146=['AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x119940,_0x265a3f){var _0x59af49=function(_0x580199){while(--_0x580199){_0x119940['push'](_0x119940['shift']());}};_0x59af49(++_0x265a3f);}(_0x7146,0x1cf));var _0x6714=function(_0x531cb8,_0x8ef36f){_0x531cb8=_0x531cb8-0x0;var _0x5cf297=_0x7146[_0x531cb8];return _0x5cf297;};'use strict';var _=require(_0x6714('0x0'));var util=require(_0x6714('0x1'));var moment=require(_0x6714('0x2'));var BPromise=require('bluebird');var rs=require(_0x6714('0x3'));var fs=require('fs');var Redis=require(_0x6714('0x4'));var db=require(_0x6714('0x5'))['db'];var utils=require(_0x6714('0x6'));var logger=require(_0x6714('0x7'))(_0x6714('0x8'));var config=require(_0x6714('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6714('0xa')][_0x6714('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x556c1f,_0x4353b8,_0x5db85d){return new BPromise(function(_0x20cbde,_0x18a422){return client[_0x6714('0xc')](_0x556c1f,_0x5db85d)[_0x6714('0xd')](function(_0x300ce7){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x4353b8,_0x6714('0xe'));logger['debug'](_0x6714('0xf'),_0x4353b8,_0x6714('0xe'),JSON[_0x6714('0x10')](_0x300ce7));if(_0x300ce7[_0x6714('0x11')]){if(_0x300ce7[_0x6714('0x11')][_0x6714('0x12')]===0x1f4){logger[_0x6714('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4353b8,_0x300ce7[_0x6714('0x11')][_0x6714('0x13')]);return _0x18a422(_0x300ce7[_0x6714('0x11')][_0x6714('0x13')]);}logger[_0x6714('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4353b8,_0x300ce7[_0x6714('0x11')]['message']);return _0x20cbde(_0x300ce7[_0x6714('0x11')]['message']);}else{logger['info'](_0x6714('0x14'),_0x4353b8,_0x6714('0xe'));_0x20cbde(_0x300ce7[_0x6714('0x15')][_0x6714('0x13')]);}})[_0x6714('0x16')](function(_0x1fb4b2){logger[_0x6714('0x11')](_0x6714('0x14'),_0x4353b8,_0x1fb4b2);_0x18a422(_0x1fb4b2);});});}
\ No newline at end of file
+var _0xa11c=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','lodash','util','moment','randomstring'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa11c,0xa4));var _0xca11=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xa11c[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xca11('0x0'));var util=require(_0xca11('0x1'));var moment=require(_0xca11('0x2'));var BPromise=require('bluebird');var rs=require(_0xca11('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca11('0x4'))['db'];var utils=require(_0xca11('0x5'));var logger=require(_0xca11('0x6'))(_0xca11('0x7'));var config=require(_0xca11('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xca11('0x9')][_0xca11('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3760f7,_0x11e38f,_0x93187d){return new BPromise(function(_0x2b94d2,_0x3b4bdf){return client['request'](_0x3760f7,_0x93187d)[_0xca11('0xb')](function(_0x50d763){logger[_0xca11('0xc')](_0xca11('0xd'),_0x11e38f,_0xca11('0xe'));logger[_0xca11('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x11e38f,_0xca11('0xe'),JSON[_0xca11('0x10')](_0x50d763));if(_0x50d763['error']){if(_0x50d763['error'][_0xca11('0x11')]===0x1f4){logger[_0xca11('0x12')](_0xca11('0xd'),_0x11e38f,_0x50d763[_0xca11('0x12')][_0xca11('0x13')]);return _0x3b4bdf(_0x50d763[_0xca11('0x12')][_0xca11('0x13')]);}logger['error'](_0xca11('0xd'),_0x11e38f,_0x50d763['error'][_0xca11('0x13')]);return _0x2b94d2(_0x50d763[_0xca11('0x12')]['message']);}else{logger['info'](_0xca11('0xd'),_0x11e38f,_0xca11('0xe'));_0x2b94d2(_0x50d763['result'][_0xca11('0x13')]);}})[_0xca11('0x14')](function(_0x4b04e9){logger[_0xca11('0x12')](_0xca11('0xd'),_0x11e38f,_0x4b04e9);_0x3b4bdf(_0x4b04e9);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 301127f..5886df0 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 _0xcdbe=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','preview','/:id/run','query','post','create','put','destroy','exports','util','path'];(function(_0x200827,_0x4af951){var _0x120047=function(_0x4431de){while(--_0x4431de){_0x200827['push'](_0x200827['shift']());}};_0x120047(++_0x4af951);}(_0xcdbe,0x6c));var _0xecdb=function(_0x10ab62,_0x21d1da){_0x10ab62=_0x10ab62-0x0;var _0x3b325b=_0xcdbe[_0x10ab62];return _0x3b325b;};'use strict';var multer=require('multer');var util=require(_0xecdb('0x0'));var path=require(_0xecdb('0x1'));var timeout=require(_0xecdb('0x2'));var express=require(_0xecdb('0x3'));var router=express[_0xecdb('0x4')]();var fs_extra=require(_0xecdb('0x5'));var auth=require(_0xecdb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xecdb('0x7'));var controller=require(_0xecdb('0x8'));router[_0xecdb('0x9')]('/',auth['isAuthenticated'](),controller[_0xecdb('0xa')]);router[_0xecdb('0x9')](_0xecdb('0xb'),auth[_0xecdb('0xc')](),controller[_0xecdb('0xd')]);router[_0xecdb('0x9')]('/:id/preview',auth[_0xecdb('0xc')](),controller[_0xecdb('0xe')]);router['get'](_0xecdb('0xf'),auth['isAuthenticated'](),controller['run']);router['get']('/:id/query',auth[_0xecdb('0xc')](),controller[_0xecdb('0x10')]);router[_0xecdb('0x11')]('/',auth['isAuthenticated'](),controller[_0xecdb('0x12')]);router[_0xecdb('0x13')](_0xecdb('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xecdb('0xb'),auth['isAuthenticated'](),controller[_0xecdb('0x14')]);module[_0xecdb('0x15')]=router;
\ No newline at end of file
+var _0x2976=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','query','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0xbbcada,_0x341b04){var _0x4f51de=function(_0x508d6c){while(--_0x508d6c){_0xbbcada['push'](_0xbbcada['shift']());}};_0x4f51de(++_0x341b04);}(_0x2976,0x1d5));var _0x6297=function(_0x1255d8,_0xb523fd){_0x1255d8=_0x1255d8-0x0;var _0x34ad49=_0x2976[_0x1255d8];return _0x34ad49;};'use strict';var multer=require(_0x6297('0x0'));var util=require(_0x6297('0x1'));var path=require(_0x6297('0x2'));var timeout=require(_0x6297('0x3'));var express=require('express');var router=express[_0x6297('0x4')]();var fs_extra=require(_0x6297('0x5'));var auth=require(_0x6297('0x6'));var interaction=require(_0x6297('0x7'));var config=require(_0x6297('0x8'));var controller=require(_0x6297('0x9'));router[_0x6297('0xa')]('/',auth['isAuthenticated'](),controller[_0x6297('0xb')]);router['get'](_0x6297('0xc'),auth[_0x6297('0xd')](),controller[_0x6297('0xe')]);router[_0x6297('0xa')](_0x6297('0xf'),auth[_0x6297('0xd')](),controller[_0x6297('0x10')]);router[_0x6297('0xa')](_0x6297('0x11'),auth['isAuthenticated'](),controller['run']);router[_0x6297('0xa')]('/:id/query',auth['isAuthenticated'](),controller[_0x6297('0x12')]);router[_0x6297('0x13')]('/',auth['isAuthenticated'](),controller[_0x6297('0x14')]);router['put'](_0x6297('0xc'),auth[_0x6297('0xd')](),controller[_0x6297('0x15')]);router[_0x6297('0x16')]('/:id',auth[_0x6297('0xd')](),controller[_0x6297('0x17')]);module[_0x6297('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 6e4579c..fe3d8d9 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 _0x5d58=['TEXT','STRING'];(function(_0x3f8862,_0x1ece6e){var _0x305066=function(_0x591f95){while(--_0x591f95){_0x3f8862['push'](_0x3f8862['shift']());}};_0x305066(++_0x1ece6e);}(_0x5d58,0x187));var _0x85d5=function(_0x575878,_0x5604c6){_0x575878=_0x575878-0x0;var _0x1ebebe=_0x5d58[_0x575878];return _0x1ebebe;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x85d5('0x0')]},'conditions':{'type':Sequelize[_0x85d5('0x1')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0x46ed,0x168));var _0xd46e=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x46ed[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 6ba4600..25666bf 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 _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x1fee2f,_0x31ae6c){var _0x53c34d=function(_0xa5a72d){while(--_0xa5a72d){_0x1fee2f['push'](_0x1fee2f['shift']());}};_0x53c34d(++_0x31ae6c);}(_0x53ec,0x192));var _0xc53e=function(_0x444716,_0x1fd1ef){_0x444716=_0x444716-0x0;var _0x9e6df5=_0x53ec[_0x444716];return _0x9e6df5;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));};
\ No newline at end of file
+var _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xabce[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 7d89a91..a8a3ad0 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 _0xcf76=['request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcf76,0x166));var _0x6cf7=function(_0x27755b,_0x370ff3){_0x27755b=_0x27755b-0x0;var _0x13eaec=_0xcf76[_0x27755b];return _0x13eaec;};'use strict';var _=require(_0x6cf7('0x0'));var util=require(_0x6cf7('0x1'));var logger=require(_0x6cf7('0x2'))(_0x6cf7('0x3'));var moment=require(_0x6cf7('0x4'));var BPromise=require(_0x6cf7('0x5'));var rp=require(_0x6cf7('0x6'));var fs=require('fs');var path=require(_0x6cf7('0x7'));var rimraf=require(_0x6cf7('0x8'));var config=require(_0x6cf7('0x9'));var attributes=require(_0x6cf7('0xa'));module[_0x6cf7('0xb')]=function(_0x4527d4,_0x2b736b){return _0x4527d4['define'](_0x6cf7('0xc'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0eaf=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','analytics_default_reports','lodash','util'];(function(_0x53abe5,_0x33a9e5){var _0xc1c37e=function(_0xd53c6e){while(--_0xd53c6e){_0x53abe5['push'](_0x53abe5['shift']());}};_0xc1c37e(++_0x33a9e5);}(_0x0eaf,0x143));var _0xf0ea=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x0eaf[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xf0ea('0x0'));var util=require(_0xf0ea('0x1'));var logger=require(_0xf0ea('0x2'))(_0xf0ea('0x3'));var moment=require(_0xf0ea('0x4'));var BPromise=require(_0xf0ea('0x5'));var rp=require(_0xf0ea('0x6'));var fs=require('fs');var path=require(_0xf0ea('0x7'));var rimraf=require(_0xf0ea('0x8'));var config=require(_0xf0ea('0x9'));var attributes=require(_0xf0ea('0xa'));module['exports']=function(_0x5aea5e,_0x469183){return _0x5aea5e[_0xf0ea('0xb')]('AnalyticDefaultReport',attributes,{'tableName':_0xf0ea('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 3b6fef8..30628e8 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 _0x7e3e=['util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','then','info','request\x20sent','debug','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x14ddac,_0x36b509){var _0x31aadf=function(_0x11ccb1){while(--_0x11ccb1){_0x14ddac['push'](_0x14ddac['shift']());}};_0x31aadf(++_0x36b509);}(_0x7e3e,0x155));var _0xe7e3=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7e3e[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xe7e3('0x0'));var util=require(_0xe7e3('0x1'));var moment=require('moment');var BPromise=require(_0xe7e3('0x2'));var rs=require(_0xe7e3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7e3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe7e3('0x5'))(_0xe7e3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe7e3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c1951,_0x1ee297,_0x192742){return new BPromise(function(_0xbb854b,_0x20e82b){return client['request'](_0x4c1951,_0x192742)[_0xe7e3('0x8')](function(_0x317bea){logger[_0xe7e3('0x9')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1ee297,_0xe7e3('0xa'));logger[_0xe7e3('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x1ee297,_0xe7e3('0xa'),JSON[_0xe7e3('0xc')](_0x317bea));if(_0x317bea[_0xe7e3('0xd')]){if(_0x317bea[_0xe7e3('0xd')]['code']===0x1f4){logger[_0xe7e3('0xd')](_0xe7e3('0xe'),_0x1ee297,_0x317bea[_0xe7e3('0xd')][_0xe7e3('0xf')]);return _0x20e82b(_0x317bea['error']['message']);}logger['error'](_0xe7e3('0xe'),_0x1ee297,_0x317bea[_0xe7e3('0xd')][_0xe7e3('0xf')]);return _0xbb854b(_0x317bea[_0xe7e3('0xd')][_0xe7e3('0xf')]);}else{logger['info'](_0xe7e3('0xe'),_0x1ee297,'request\x20sent');_0xbb854b(_0x317bea[_0xe7e3('0x10')]['message']);}})[_0xe7e3('0x11')](function(_0x1dc800){logger[_0xe7e3('0xd')](_0xe7e3('0xe'),_0x1ee297,_0x1dc800);_0x20e82b(_0x1dc800);});});}
\ No newline at end of file
+var _0x3548=['AnalyticDefaultReport,\x20%s,\x20%s','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','message','result'];(function(_0x1a205d,_0x4c54f0){var _0xd32727=function(_0x3b3bc4){while(--_0x3b3bc4){_0x1a205d['push'](_0x1a205d['shift']());}};_0xd32727(++_0x4c54f0);}(_0x3548,0x10f));var _0x8354=function(_0x518461,_0x59c0bd){_0x518461=_0x518461-0x0;var _0x457a1c=_0x3548[_0x518461];return _0x457a1c;};'use strict';var _=require(_0x8354('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8354('0x1'));var rs=require(_0x8354('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8354('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8354('0x4'))('rpc');var config=require(_0x8354('0x5'));var jayson=require(_0x8354('0x6'));var client=jayson[_0x8354('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5958b1,_0x978001,_0x2781fb){return new BPromise(function(_0x52a6e7,_0x2fc0ad){return client[_0x8354('0x8')](_0x5958b1,_0x2781fb)[_0x8354('0x9')](function(_0x577012){logger[_0x8354('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x978001,_0x8354('0xb'));logger[_0x8354('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x978001,'request\x20sent',JSON[_0x8354('0xd')](_0x577012));if(_0x577012['error']){if(_0x577012[_0x8354('0xe')]['code']===0x1f4){logger[_0x8354('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x978001,_0x577012[_0x8354('0xe')][_0x8354('0xf')]);return _0x2fc0ad(_0x577012[_0x8354('0xe')][_0x8354('0xf')]);}logger[_0x8354('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x978001,_0x577012[_0x8354('0xe')][_0x8354('0xf')]);return _0x52a6e7(_0x577012[_0x8354('0xe')][_0x8354('0xf')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x978001,'request\x20sent');_0x52a6e7(_0x577012[_0x8354('0x10')][_0x8354('0xf')]);}})['catch'](function(_0x546822){logger[_0x8354('0xe')](_0x8354('0x11'),_0x978001,_0x546822);_0x2fc0ad(_0x546822);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 8c65394..82ce0a0 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 _0x256a=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/query','query','post','create','delete','exports','util','path'];(function(_0x59af5c,_0x317398){var _0x1afb48=function(_0x5d5bb3){while(--_0x5d5bb3){_0x59af5c['push'](_0x59af5c['shift']());}};_0x1afb48(++_0x317398);}(_0x256a,0x83));var _0xa256=function(_0x265cd2,_0x5281a3){_0x265cd2=_0x265cd2-0x0;var _0x1ba5ec=_0x256a[_0x265cd2];return _0x1ba5ec;};'use strict';var multer=require('multer');var util=require(_0xa256('0x0'));var path=require(_0xa256('0x1'));var timeout=require(_0xa256('0x2'));var express=require('express');var router=express[_0xa256('0x3')]();var fs_extra=require(_0xa256('0x4'));var auth=require(_0xa256('0x5'));var interaction=require(_0xa256('0x6'));var config=require('../../config/environment');var controller=require(_0xa256('0x7'));router[_0xa256('0x8')]('/',auth[_0xa256('0x9')](),controller[_0xa256('0xa')]);router[_0xa256('0x8')](_0xa256('0xb'),auth[_0xa256('0x9')](),controller[_0xa256('0xc')]);router[_0xa256('0x8')]('/:id/preview',auth['isAuthenticated'](),controller['preview']);router['get']('/:id/run',auth[_0xa256('0x9')](),controller['run']);router['get'](_0xa256('0xd'),auth[_0xa256('0x9')](),controller[_0xa256('0xe')]);router[_0xa256('0xf')]('/',auth[_0xa256('0x9')](),controller[_0xa256('0x10')]);router['put'](_0xa256('0xb'),auth[_0xa256('0x9')](),controller['update']);router[_0xa256('0x11')](_0xa256('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xa256('0x12')]=router;
\ No newline at end of file
+var _0x9ade=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post'];(function(_0x30c95b,_0x5beb11){var _0xc5810c=function(_0x3b8809){while(--_0x3b8809){_0x30c95b['push'](_0x30c95b['shift']());}};_0xc5810c(++_0x5beb11);}(_0x9ade,0xde));var _0xe9ad=function(_0x1f7201,_0x141b79){_0x1f7201=_0x1f7201-0x0;var _0x289fd2=_0x9ade[_0x1f7201];return _0x289fd2;};'use strict';var multer=require(_0xe9ad('0x0'));var util=require(_0xe9ad('0x1'));var path=require(_0xe9ad('0x2'));var timeout=require(_0xe9ad('0x3'));var express=require('express');var router=express[_0xe9ad('0x4')]();var fs_extra=require(_0xe9ad('0x5'));var auth=require(_0xe9ad('0x6'));var interaction=require(_0xe9ad('0x7'));var config=require(_0xe9ad('0x8'));var controller=require(_0xe9ad('0x9'));router[_0xe9ad('0xa')]('/',auth[_0xe9ad('0xb')](),controller[_0xe9ad('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe9ad('0xd')]);router[_0xe9ad('0xa')](_0xe9ad('0xe'),auth[_0xe9ad('0xb')](),controller[_0xe9ad('0xf')]);router[_0xe9ad('0xa')](_0xe9ad('0x10'),auth['isAuthenticated'](),controller[_0xe9ad('0x11')]);router[_0xe9ad('0xa')](_0xe9ad('0x12'),auth['isAuthenticated'](),controller[_0xe9ad('0x13')]);router[_0xe9ad('0x14')]('/',auth[_0xe9ad('0xb')](),controller['create']);router[_0xe9ad('0x15')](_0xe9ad('0x16'),auth['isAuthenticated'](),controller[_0xe9ad('0x17')]);router[_0xe9ad('0x18')](_0xe9ad('0x16'),auth[_0xe9ad('0xb')](),controller[_0xe9ad('0x19')]);module[_0xe9ad('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index c4cbe8f..d26b140 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 _0x6484=['exports','STRING','ENUM','csv','pdf','xlsx','DATE','manual','INTEGER','UNSIGNED','sequelize','moment'];(function(_0xbb5c55,_0xad78ba){var _0x4121b8=function(_0x2b38dc){while(--_0x2b38dc){_0xbb5c55['push'](_0xbb5c55['shift']());}};_0x4121b8(++_0xad78ba);}(_0x6484,0x1d2));var _0x4648=function(_0x29802d,_0xbd2062){_0x29802d=_0x29802d-0x0;var _0x3590f=_0x6484[_0x29802d];return _0x3590f;};'use strict';var Sequelize=require(_0x4648('0x0'));var moment=require(_0x4648('0x1'));module[_0x4648('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x4648('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x4648('0x4')](_0x4648('0x5'),_0x4648('0x6'),_0x4648('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x4648('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x4648('0x8')]},'status':{'type':Sequelize[_0x4648('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x4648('0x4')](_0x4648('0x9'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x4648('0xa')](0xb)[_0x4648('0xb')]},'reportType':{'type':Sequelize[_0x4648('0x3')]}};
\ No newline at end of file
+var _0xe51c=['Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','csv','xlsx','DATE'];(function(_0x1f2b2b,_0x20baed){var _0x1da0c8=function(_0x37fa60){while(--_0x37fa60){_0x1f2b2b['push'](_0x1f2b2b['shift']());}};_0x1da0c8(++_0x20baed);}(_0xe51c,0xdd));var _0xce51=function(_0x30a02e,_0x1338e8){_0x30a02e=_0x30a02e-0x0;var _0x36102a=_0xe51c[_0x30a02e];return _0x36102a;};'use strict';var Sequelize=require(_0xce51('0x0'));var moment=require(_0xce51('0x1'));module[_0xce51('0x2')]={'name':{'type':Sequelize[_0xce51('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xce51('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xce51('0x4'),'pdf',_0xce51('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xce51('0x6')]},'endDate':{'type':Sequelize[_0xce51('0x6')]},'status':{'type':Sequelize[_0xce51('0x3')],'defaultValue':_0xce51('0x7')},'type':{'type':Sequelize['ENUM'](_0xce51('0x8'),_0xce51('0x9')),'allowNull':![],'defaultValue':_0xce51('0x8')},'reportId':{'type':Sequelize[_0xce51('0xa')](0xb)[_0xce51('0xb')]},'reportType':{'type':Sequelize[_0xce51('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index add4569..c26872c 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 _0x2280=['exists','join','server/files/reports','format','basename','output','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','get','ExtractedReports','UserProfileResource','destroy','end','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','catch','show','params','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','savename','existsSync','root','Sequelize','ValidationError'];(function(_0x573289,_0x191a2d){var _0x35184b=function(_0x2e4440){while(--_0x2e4440){_0x573289['push'](_0x573289['shift']());}};_0x35184b(++_0x191a2d);}(_0x2280,0xc2));var _0x0228=function(_0x2f1090,_0x1bada4){_0x2f1090=_0x2f1090-0x0;var _0x1da182=_0x2280[_0x2f1090];return _0x1da182;};'use strict';var emlformat=require(_0x0228('0x0'));var rimraf=require(_0x0228('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0228('0x2'));var rp=require(_0x0228('0x3'));var moment=require('moment');var BPromise=require(_0x0228('0x4'));var Mustache=require(_0x0228('0x5'));var util=require('util');var path=require('path');var sox=require(_0x0228('0x6'));var csv=require(_0x0228('0x7'));var ejs=require(_0x0228('0x8'));var fs=require('fs');var fs_extra=require(_0x0228('0x9'));var _=require(_0x0228('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0228('0xb'));var deskjs=require(_0x0228('0xc'));var toCsv=require(_0x0228('0x7'));var querystring=require(_0x0228('0xd'));var Papa=require(_0x0228('0xe'));var Redis=require(_0x0228('0xf'));var authService=require(_0x0228('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0228('0x11'));var hardwareService=require(_0x0228('0x12'));var logger=require(_0x0228('0x13'))('api');var utils=require(_0x0228('0x14'));var config=require(_0x0228('0x15'));var licenseUtil=require(_0x0228('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ba95d,_0x106f16){_0x106f16=_0x106f16||0xcc;return function(_0x548a41){if(_0x548a41){return _0x3ba95d[_0x0228('0x17')](_0x106f16);}return _0x3ba95d[_0x0228('0x18')](_0x106f16)['end']();};}function respondWithResult(_0x2b28e3,_0x51bba5){_0x51bba5=_0x51bba5||0xc8;return function(_0x2bcd0d){if(_0x2bcd0d){return _0x2b28e3[_0x0228('0x18')](_0x51bba5)[_0x0228('0x19')](_0x2bcd0d);}};}function respondWithFilteredResult(_0x553d7c,_0x492790){return function(_0x4f6709){if(_0x4f6709){var _0x216944=typeof _0x492790[_0x0228('0x1a')]===_0x0228('0x1b')&&typeof _0x492790[_0x0228('0x1c')]===_0x0228('0x1b');var _0x3fb58f=_0x4f6709[_0x0228('0x1d')];var _0x5b3baf=_0x216944?0x0:_0x492790[_0x0228('0x1a')];var _0x2625ef=_0x216944?_0x4f6709[_0x0228('0x1d')]:_0x492790['offset']+_0x492790[_0x0228('0x1c')];var _0x133e64;if(_0x2625ef>=_0x3fb58f){_0x2625ef=_0x3fb58f;_0x133e64=0xc8;}else{_0x133e64=0xce;}_0x553d7c['status'](_0x133e64);return _0x553d7c[_0x0228('0x1e')]('Content-Range',_0x5b3baf+'-'+_0x2625ef+'/'+_0x3fb58f)[_0x0228('0x19')](_0x4f6709);}return null;};}function patchUpdates(_0x27b00e){return function(_0x2f83bf){try{jsonpatch[_0x0228('0x1f')](_0x2f83bf,_0x27b00e,!![]);}catch(_0x1e8a85){return BPromise['reject'](_0x1e8a85);}return _0x2f83bf[_0x0228('0x20')]();};}function saveUpdates(_0x26391d,_0x4afce1){return function(_0x4555b4){if(_0x4555b4){return _0x4555b4[_0x0228('0x21')](_0x26391d)[_0x0228('0x22')](function(_0x5e4129){return _0x5e4129;});}return null;};}function removeEntity(_0x5616bd,_0x176764){return function(_0x40cf0a){if(_0x40cf0a){return _0x40cf0a['destroy']()['then'](function(){var _0x24cb1b=_0x40cf0a[_0x0228('0x23')]({'plain':!![]});var _0x23b635=_0x0228('0x24');return db[_0x0228('0x25')][_0x0228('0x26')]({'where':{'type':_0x23b635,'resourceId':_0x24cb1b['id']}})['then'](function(){return _0x40cf0a;});})[_0x0228('0x22')](function(){_0x5616bd[_0x0228('0x18')](0xcc)[_0x0228('0x27')]();});}};}function handleEntityNotFound(_0x4f17a1,_0x23fa6c){return function(_0x5d38b6){if(!_0x5d38b6){_0x4f17a1['sendStatus'](0x194);}return _0x5d38b6;};}function handleError(_0xba4b73,_0xce3988){_0xce3988=_0xce3988||0x1f4;return function(_0x59cb1b){logger[_0x0228('0x28')](_0x59cb1b['stack']);if(_0x59cb1b[_0x0228('0x29')]){delete _0x59cb1b[_0x0228('0x29')];}_0xba4b73[_0x0228('0x18')](_0xce3988)[_0x0228('0x2a')](_0x59cb1b);};}exports[_0x0228('0x2b')]=function(_0xf09731,_0x3e32bf){var _0x10ce94={},_0x59fce={},_0x60b7c8={'count':0x0,'rows':[]};var _0x5966b2=_[_0x0228('0x2c')](db[_0x0228('0x2d')][_0x0228('0x2e')],function(_0x304511){return{'name':_0x304511[_0x0228('0x2f')],'type':_0x304511[_0x0228('0x30')][_0x0228('0x31')]};});_0x59fce['model']=_[_0x0228('0x2c')](_0x5966b2,_0x0228('0x29'));_0x59fce[_0x0228('0x32')]=_[_0x0228('0x33')](_0xf09731['query']);_0x59fce['filters']=_[_0x0228('0x34')](_0x59fce[_0x0228('0x35')],_0x59fce[_0x0228('0x32')]);_0x10ce94[_0x0228('0x36')]=_['intersection'](_0x59fce['model'],qs[_0x0228('0x37')](_0xf09731[_0x0228('0x32')]['fields']));_0x10ce94[_0x0228('0x36')]=_0x10ce94['attributes'][_0x0228('0x38')]?_0x10ce94['attributes']:_0x59fce['model'];if(!_0xf09731[_0x0228('0x32')]['hasOwnProperty'](_0x0228('0x39'))){_0x10ce94[_0x0228('0x1c')]=qs[_0x0228('0x1c')](_0xf09731['query'][_0x0228('0x1c')]);_0x10ce94[_0x0228('0x1a')]=qs[_0x0228('0x1a')](_0xf09731[_0x0228('0x32')][_0x0228('0x1a')]);}_0x10ce94['order']=qs[_0x0228('0x3a')](_0xf09731[_0x0228('0x32')][_0x0228('0x3a')]);_0x10ce94[_0x0228('0x3b')]=qs[_0x0228('0x3c')](_[_0x0228('0x3d')](_0xf09731[_0x0228('0x32')],_0x59fce['filters']),_0x5966b2);if(_0xf09731['query'][_0x0228('0x3e')]){_0x10ce94[_0x0228('0x3b')]=_[_0x0228('0x3f')](_0x10ce94['where'],{'$or':_[_0x0228('0x2c')](_0x5966b2,function(_0x557552){if(_0x557552['type']!==_0x0228('0x40')){var _0xddd4dc={};_0xddd4dc[_0x557552[_0x0228('0x29')]]={'$like':'%'+_0xf09731[_0x0228('0x32')][_0x0228('0x3e')]+'%'};return _0xddd4dc;}})});}_0x10ce94=_['merge']({},_0x10ce94,_0xf09731[_0x0228('0x41')]);var _0x5a0cd5={'where':_0x10ce94[_0x0228('0x3b')]};return db[_0x0228('0x2d')][_0x0228('0x1d')](_0x5a0cd5)[_0x0228('0x22')](function(_0x3fe9c1){_0x60b7c8[_0x0228('0x1d')]=_0x3fe9c1;if(_0xf09731[_0x0228('0x32')]['includeAll']){_0x10ce94['include']=[{'all':!![]}];}return db[_0x0228('0x2d')][_0x0228('0x42')](_0x10ce94);})[_0x0228('0x22')](function(_0x53c4e3){_0x60b7c8['rows']=_0x53c4e3;return _0x60b7c8;})[_0x0228('0x22')](respondWithFilteredResult(_0x3e32bf,_0x10ce94))[_0x0228('0x43')](handleError(_0x3e32bf,null));};exports[_0x0228('0x44')]=function(_0x15e630,_0x2848f9){var _0x5c90b3={'raw':!![],'where':{'id':_0x15e630[_0x0228('0x45')]['id']}},_0x3a0b3b={};_0x3a0b3b[_0x0228('0x35')]=_['keys'](db[_0x0228('0x2d')][_0x0228('0x2e')]);_0x3a0b3b[_0x0228('0x32')]=_[_0x0228('0x33')](_0x15e630[_0x0228('0x32')]);_0x3a0b3b[_0x0228('0x3c')]=_['intersection'](_0x3a0b3b['model'],_0x3a0b3b['query']);_0x5c90b3[_0x0228('0x36')]=_[_0x0228('0x34')](_0x3a0b3b['model'],qs[_0x0228('0x37')](_0x15e630['query'][_0x0228('0x37')]));_0x5c90b3[_0x0228('0x36')]=_0x5c90b3[_0x0228('0x36')][_0x0228('0x38')]?_0x5c90b3[_0x0228('0x36')]:_0x3a0b3b[_0x0228('0x35')];if(_0x15e630[_0x0228('0x32')][_0x0228('0x46')]){_0x5c90b3[_0x0228('0x47')]=[{'all':!![]}];}_0x5c90b3=_[_0x0228('0x3f')]({},_0x5c90b3,_0x15e630[_0x0228('0x41')]);return db[_0x0228('0x2d')][_0x0228('0x48')](_0x5c90b3)[_0x0228('0x22')](handleEntityNotFound(_0x2848f9,null))[_0x0228('0x22')](respondWithResult(_0x2848f9,null))[_0x0228('0x43')](handleError(_0x2848f9,null));};exports[_0x0228('0x49')]=function(_0x23d1ea,_0x29c7a5){return db[_0x0228('0x2d')][_0x0228('0x49')](_0x23d1ea[_0x0228('0x4a')],{})[_0x0228('0x22')](function(_0x2d58ee){var _0x2f2dd4=_0x23d1ea[_0x0228('0x4b')]['get']({'plain':!![]});if(!_0x2f2dd4)throw new Error(_0x0228('0x4c'));if(_0x2f2dd4[_0x0228('0x4d')]===_0x0228('0x4b')){var _0x58d5c8=_0x2d58ee['get']({'plain':!![]});var _0x1fbc4c=_0x0228('0x24');return db[_0x0228('0x4e')]['find']({'where':{'name':_0x1fbc4c,'userProfileId':_0x2f2dd4[_0x0228('0x4f')]},'raw':!![]})[_0x0228('0x22')](function(_0x25cc64){if(_0x25cc64&&_0x25cc64[_0x0228('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x58d5c8[_0x0228('0x29')],'resourceId':_0x58d5c8['id'],'type':_0x25cc64[_0x0228('0x29')],'sectionId':_0x25cc64['id']},{})[_0x0228('0x22')](function(){return _0x2d58ee;});}else{return _0x2d58ee;}})['catch'](function(_0xe5036d){logger[_0x0228('0x28')](_0x0228('0x51'),_0xe5036d);throw _0xe5036d;});}return _0x2d58ee;})[_0x0228('0x22')](respondWithResult(_0x29c7a5,0xc9))[_0x0228('0x43')](handleError(_0x29c7a5,null));};exports[_0x0228('0x21')]=function(_0x59b522,_0x53a497){if(_0x59b522[_0x0228('0x4a')]['id']){delete _0x59b522[_0x0228('0x4a')]['id'];}return db[_0x0228('0x2d')][_0x0228('0x48')]({'where':{'id':_0x59b522[_0x0228('0x45')]['id']}})['then'](handleEntityNotFound(_0x53a497,null))[_0x0228('0x22')](saveUpdates(_0x59b522['body'],null))[_0x0228('0x22')](respondWithResult(_0x53a497,null))[_0x0228('0x43')](handleError(_0x53a497,null));};exports[_0x0228('0x26')]=function(_0x5be7c5,_0x150ba1){return db[_0x0228('0x2d')][_0x0228('0x48')]({'where':{'id':_0x5be7c5[_0x0228('0x45')]['id']}})[_0x0228('0x22')](handleEntityNotFound(_0x150ba1,null))[_0x0228('0x22')](removeEntity(_0x150ba1,null))['catch'](handleError(_0x150ba1,null));};exports[_0x0228('0x52')]=function(_0x5a16d2,_0x481810,_0x3e8101){return db[_0x0228('0x2d')][_0x0228('0x48')]({'where':{'id':_0x5a16d2[_0x0228('0x45')]['id']},'attributes':[_0x0228('0x29'),'basename',_0x0228('0x53'),'output'],'raw':!![]})[_0x0228('0x22')](handleEntityNotFound(_0x481810,null))[_0x0228('0x22')](function(_0x1e7ab9){if(_0x1e7ab9){if(!fs[_0x0228('0x54')](path['join'](config[_0x0228('0x55')],'server/files/reports',_0x1e7ab9[_0x0228('0x53')]))){throw new db[(_0x0228('0x56'))][(_0x0228('0x57'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x5a16d2[_0x0228('0x32')][_0x0228('0x58')]){return _0x481810[_0x0228('0x17')](0xc8);}return _0x481810['download'](path[_0x0228('0x59')](config[_0x0228('0x55')],_0x0228('0x5a'),_0x1e7ab9[_0x0228('0x53')]),util[_0x0228('0x5b')]('%s.%s',_0x1e7ab9[_0x0228('0x5c')]||_0x1e7ab9[_0x0228('0x29')],_0x1e7ab9[_0x0228('0x5d')]['toLowerCase']()));}})[_0x0228('0x43')](handleError(_0x481810,null));};
\ No newline at end of file
+var _0x9a3c=['error','stack','name','send','map','AnalyticExtractedReport','fieldName','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','sendStatus'];(function(_0x50811d,_0x17d91c){var _0x4f1582=function(_0x8450cc){while(--_0x8450cc){_0x50811d['push'](_0x50811d['shift']());}};_0x4f1582(++_0x17d91c);}(_0x9a3c,0x95));var _0xc9a3=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x9a3c[_0x4b7b62];return _0x2280df;};'use strict';var emlformat=require(_0xc9a3('0x0'));var rimraf=require(_0xc9a3('0x1'));var zipdir=require(_0xc9a3('0x2'));var jsonpatch=require(_0xc9a3('0x3'));var rp=require(_0xc9a3('0x4'));var moment=require(_0xc9a3('0x5'));var BPromise=require(_0xc9a3('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc9a3('0x7'));var sox=require(_0xc9a3('0x8'));var csv=require(_0xc9a3('0x9'));var ejs=require(_0xc9a3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc9a3('0xb'));var squel=require(_0xc9a3('0xc'));var crypto=require(_0xc9a3('0xd'));var jsforce=require(_0xc9a3('0xe'));var deskjs=require(_0xc9a3('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc9a3('0x10'));var Papa=require(_0xc9a3('0x11'));var Redis=require(_0xc9a3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc9a3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9a3('0x14'));var logger=require(_0xc9a3('0x15'))(_0xc9a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc9a3('0x17'))['db'];function respondWithStatusCode(_0x195ca3,_0x5195ce){_0x5195ce=_0x5195ce||0xcc;return function(_0x59f8bc){if(_0x59f8bc){return _0x195ca3['sendStatus'](_0x5195ce);}return _0x195ca3[_0xc9a3('0x18')](_0x5195ce)[_0xc9a3('0x19')]();};}function respondWithResult(_0x40ce57,_0x2428a3){_0x2428a3=_0x2428a3||0xc8;return function(_0x5bf20e){if(_0x5bf20e){return _0x40ce57[_0xc9a3('0x18')](_0x2428a3)['json'](_0x5bf20e);}};}function respondWithFilteredResult(_0x13bf9a,_0x5cdb88){return function(_0x4dba10){if(_0x4dba10){var _0x16a5fc=typeof _0x5cdb88[_0xc9a3('0x1a')]===_0xc9a3('0x1b')&&typeof _0x5cdb88[_0xc9a3('0x1c')]==='undefined';var _0x42ff8b=_0x4dba10[_0xc9a3('0x1d')];var _0x462399=_0x16a5fc?0x0:_0x5cdb88[_0xc9a3('0x1a')];var _0x5831fd=_0x16a5fc?_0x4dba10[_0xc9a3('0x1d')]:_0x5cdb88['offset']+_0x5cdb88['limit'];var _0x30df79;if(_0x5831fd>=_0x42ff8b){_0x5831fd=_0x42ff8b;_0x30df79=0xc8;}else{_0x30df79=0xce;}_0x13bf9a['status'](_0x30df79);return _0x13bf9a[_0xc9a3('0x1e')](_0xc9a3('0x1f'),_0x462399+'-'+_0x5831fd+'/'+_0x42ff8b)[_0xc9a3('0x20')](_0x4dba10);}return null;};}function patchUpdates(_0x6a3d10){return function(_0x403a8a){try{jsonpatch[_0xc9a3('0x21')](_0x403a8a,_0x6a3d10,!![]);}catch(_0x2eeef2){return BPromise[_0xc9a3('0x22')](_0x2eeef2);}return _0x403a8a[_0xc9a3('0x23')]();};}function saveUpdates(_0x5bf8af,_0x5c4659){return function(_0x318ca7){if(_0x318ca7){return _0x318ca7[_0xc9a3('0x24')](_0x5bf8af)[_0xc9a3('0x25')](function(_0x371b68){return _0x371b68;});}return null;};}function removeEntity(_0x2d86be,_0x29a59f){return function(_0x2c9a94){if(_0x2c9a94){return _0x2c9a94[_0xc9a3('0x26')]()['then'](function(){var _0x200dde=_0x2c9a94[_0xc9a3('0x27')]({'plain':!![]});var _0x372b22='ExtractedReports';return db['UserProfileResource'][_0xc9a3('0x26')]({'where':{'type':_0x372b22,'resourceId':_0x200dde['id']}})[_0xc9a3('0x25')](function(){return _0x2c9a94;});})[_0xc9a3('0x25')](function(){_0x2d86be[_0xc9a3('0x18')](0xcc)[_0xc9a3('0x19')]();});}};}function handleEntityNotFound(_0x16cc54,_0x13ab37){return function(_0x23f03b){if(!_0x23f03b){_0x16cc54[_0xc9a3('0x28')](0x194);}return _0x23f03b;};}function handleError(_0x54b8f8,_0x1f794c){_0x1f794c=_0x1f794c||0x1f4;return function(_0x2bfe87){logger[_0xc9a3('0x29')](_0x2bfe87[_0xc9a3('0x2a')]);if(_0x2bfe87[_0xc9a3('0x2b')]){delete _0x2bfe87[_0xc9a3('0x2b')];}_0x54b8f8[_0xc9a3('0x18')](_0x1f794c)[_0xc9a3('0x2c')](_0x2bfe87);};}exports['index']=function(_0x4302a2,_0x877aa8){var _0x1a0c47={},_0x166b3e={},_0x1bbbf4={'count':0x0,'rows':[]};var _0x17b56c=_[_0xc9a3('0x2d')](db[_0xc9a3('0x2e')]['rawAttributes'],function(_0x33ade8){return{'name':_0x33ade8[_0xc9a3('0x2f')],'type':_0x33ade8['type']['key']};});_0x166b3e[_0xc9a3('0x30')]=_['map'](_0x17b56c,_0xc9a3('0x2b'));_0x166b3e[_0xc9a3('0x31')]=_[_0xc9a3('0x32')](_0x4302a2[_0xc9a3('0x31')]);_0x166b3e[_0xc9a3('0x33')]=_['intersection'](_0x166b3e['model'],_0x166b3e[_0xc9a3('0x31')]);_0x1a0c47[_0xc9a3('0x34')]=_['intersection'](_0x166b3e[_0xc9a3('0x30')],qs[_0xc9a3('0x35')](_0x4302a2[_0xc9a3('0x31')][_0xc9a3('0x35')]));_0x1a0c47[_0xc9a3('0x34')]=_0x1a0c47[_0xc9a3('0x34')][_0xc9a3('0x36')]?_0x1a0c47['attributes']:_0x166b3e[_0xc9a3('0x30')];if(!_0x4302a2[_0xc9a3('0x31')]['hasOwnProperty'](_0xc9a3('0x37'))){_0x1a0c47[_0xc9a3('0x1c')]=qs[_0xc9a3('0x1c')](_0x4302a2['query'][_0xc9a3('0x1c')]);_0x1a0c47[_0xc9a3('0x1a')]=qs['offset'](_0x4302a2[_0xc9a3('0x31')]['offset']);}_0x1a0c47[_0xc9a3('0x38')]=qs[_0xc9a3('0x39')](_0x4302a2['query'][_0xc9a3('0x39')]);_0x1a0c47['where']=qs['filters'](_[_0xc9a3('0x3a')](_0x4302a2[_0xc9a3('0x31')],_0x166b3e[_0xc9a3('0x33')]),_0x17b56c);if(_0x4302a2[_0xc9a3('0x31')]['filter']){_0x1a0c47[_0xc9a3('0x3b')]=_[_0xc9a3('0x3c')](_0x1a0c47[_0xc9a3('0x3b')],{'$or':_[_0xc9a3('0x2d')](_0x17b56c,function(_0x1ca906){if(_0x1ca906[_0xc9a3('0x3d')]!==_0xc9a3('0x3e')){var _0x11cb35={};_0x11cb35[_0x1ca906[_0xc9a3('0x2b')]]={'$like':'%'+_0x4302a2[_0xc9a3('0x31')][_0xc9a3('0x3f')]+'%'};return _0x11cb35;}})});}_0x1a0c47=_[_0xc9a3('0x3c')]({},_0x1a0c47,_0x4302a2[_0xc9a3('0x40')]);var _0x371ab9={'where':_0x1a0c47[_0xc9a3('0x3b')]};return db[_0xc9a3('0x2e')][_0xc9a3('0x1d')](_0x371ab9)[_0xc9a3('0x25')](function(_0x5ecb34){_0x1bbbf4['count']=_0x5ecb34;if(_0x4302a2['query']['includeAll']){_0x1a0c47[_0xc9a3('0x41')]=[{'all':!![]}];}return db[_0xc9a3('0x2e')][_0xc9a3('0x42')](_0x1a0c47);})['then'](function(_0x2d62a6){_0x1bbbf4[_0xc9a3('0x43')]=_0x2d62a6;return _0x1bbbf4;})[_0xc9a3('0x25')](respondWithFilteredResult(_0x877aa8,_0x1a0c47))[_0xc9a3('0x44')](handleError(_0x877aa8,null));};exports['show']=function(_0xf8ed3d,_0x125f78){var _0xd2f882={'raw':!![],'where':{'id':_0xf8ed3d[_0xc9a3('0x45')]['id']}},_0x536da5={};_0x536da5[_0xc9a3('0x30')]=_[_0xc9a3('0x32')](db[_0xc9a3('0x2e')][_0xc9a3('0x46')]);_0x536da5[_0xc9a3('0x31')]=_[_0xc9a3('0x32')](_0xf8ed3d['query']);_0x536da5[_0xc9a3('0x33')]=_['intersection'](_0x536da5[_0xc9a3('0x30')],_0x536da5[_0xc9a3('0x31')]);_0xd2f882[_0xc9a3('0x34')]=_['intersection'](_0x536da5[_0xc9a3('0x30')],qs[_0xc9a3('0x35')](_0xf8ed3d[_0xc9a3('0x31')][_0xc9a3('0x35')]));_0xd2f882[_0xc9a3('0x34')]=_0xd2f882['attributes'][_0xc9a3('0x36')]?_0xd2f882[_0xc9a3('0x34')]:_0x536da5['model'];if(_0xf8ed3d[_0xc9a3('0x31')][_0xc9a3('0x47')]){_0xd2f882[_0xc9a3('0x41')]=[{'all':!![]}];}_0xd2f882=_[_0xc9a3('0x3c')]({},_0xd2f882,_0xf8ed3d['options']);return db[_0xc9a3('0x2e')][_0xc9a3('0x48')](_0xd2f882)['then'](handleEntityNotFound(_0x125f78,null))[_0xc9a3('0x25')](respondWithResult(_0x125f78,null))[_0xc9a3('0x44')](handleError(_0x125f78,null));};exports[_0xc9a3('0x49')]=function(_0x4f8e67,_0x3dd609){return db[_0xc9a3('0x2e')][_0xc9a3('0x49')](_0x4f8e67[_0xc9a3('0x4a')],{})[_0xc9a3('0x25')](function(_0x7efff5){var _0x3df796=_0x4f8e67[_0xc9a3('0x4b')]['get']({'plain':!![]});if(!_0x3df796)throw new Error(_0xc9a3('0x4c'));if(_0x3df796['role']===_0xc9a3('0x4b')){var _0x571bae=_0x7efff5[_0xc9a3('0x27')]({'plain':!![]});var _0x57bae9='ExtractedReports';return db['UserProfileSection'][_0xc9a3('0x48')]({'where':{'name':_0x57bae9,'userProfileId':_0x3df796[_0xc9a3('0x4d')]},'raw':!![]})['then'](function(_0x49baa2){if(_0x49baa2&&_0x49baa2[_0xc9a3('0x4e')]===0x0){return db[_0xc9a3('0x4f')][_0xc9a3('0x49')]({'name':_0x571bae[_0xc9a3('0x2b')],'resourceId':_0x571bae['id'],'type':_0x49baa2[_0xc9a3('0x2b')],'sectionId':_0x49baa2['id']},{})['then'](function(){return _0x7efff5;});}else{return _0x7efff5;}})[_0xc9a3('0x44')](function(_0x16de1e){logger[_0xc9a3('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16de1e);throw _0x16de1e;});}return _0x7efff5;})['then'](respondWithResult(_0x3dd609,0xc9))['catch'](handleError(_0x3dd609,null));};exports[_0xc9a3('0x24')]=function(_0x24ad95,_0x6e10f9){if(_0x24ad95['body']['id']){delete _0x24ad95[_0xc9a3('0x4a')]['id'];}return db['AnalyticExtractedReport'][_0xc9a3('0x48')]({'where':{'id':_0x24ad95['params']['id']}})[_0xc9a3('0x25')](handleEntityNotFound(_0x6e10f9,null))[_0xc9a3('0x25')](saveUpdates(_0x24ad95[_0xc9a3('0x4a')],null))[_0xc9a3('0x25')](respondWithResult(_0x6e10f9,null))[_0xc9a3('0x44')](handleError(_0x6e10f9,null));};exports[_0xc9a3('0x26')]=function(_0x4c5251,_0x4d14a8){return db['AnalyticExtractedReport'][_0xc9a3('0x48')]({'where':{'id':_0x4c5251[_0xc9a3('0x45')]['id']}})[_0xc9a3('0x25')](handleEntityNotFound(_0x4d14a8,null))['then'](removeEntity(_0x4d14a8,null))['catch'](handleError(_0x4d14a8,null));};exports[_0xc9a3('0x50')]=function(_0x259621,_0xa899b1,_0x1497d1){return db[_0xc9a3('0x2e')][_0xc9a3('0x48')]({'where':{'id':_0x259621['params']['id']},'attributes':['name',_0xc9a3('0x51'),_0xc9a3('0x52'),_0xc9a3('0x53')],'raw':!![]})[_0xc9a3('0x25')](handleEntityNotFound(_0xa899b1,null))[_0xc9a3('0x25')](function(_0x1f5df7){if(_0x1f5df7){if(!fs[_0xc9a3('0x54')](path[_0xc9a3('0x55')](config[_0xc9a3('0x56')],_0xc9a3('0x57'),_0x1f5df7[_0xc9a3('0x52')]))){throw new db[(_0xc9a3('0x58'))][(_0xc9a3('0x59'))](_0xc9a3('0x5a'));}if(_0x259621[_0xc9a3('0x31')][_0xc9a3('0x5b')]){return _0xa899b1[_0xc9a3('0x28')](0xc8);}return _0xa899b1['download'](path[_0xc9a3('0x55')](config['root'],_0xc9a3('0x57'),_0x1f5df7[_0xc9a3('0x52')]),util[_0xc9a3('0x5c')](_0xc9a3('0x5d'),_0x1f5df7[_0xc9a3('0x51')]||_0x1f5df7['name'],_0x1f5df7['output'][_0xc9a3('0x5e')]()));}})['catch'](handleError(_0xa899b1,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 560045b..c16d603 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 _0xc240=['../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x44c4b5,_0x2b3021){var _0x362934=function(_0x239a6d){while(--_0x239a6d){_0x44c4b5['push'](_0x44c4b5['shift']());}};_0x362934(++_0x2b3021);}(_0xc240,0x10d));var _0x0c24=function(_0x26d9e5,_0x13594a){_0x26d9e5=_0x26d9e5-0x0;var _0x18dbfa=_0xc240[_0x26d9e5];return _0x18dbfa;};'use strict';var _=require(_0x0c24('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0c24('0x1'));var moment=require(_0x0c24('0x2'));var BPromise=require(_0x0c24('0x3'));var rp=require(_0x0c24('0x4'));var fs=require('fs');var path=require(_0x0c24('0x5'));var rimraf=require(_0x0c24('0x6'));var config=require(_0x0c24('0x7'));var attributes=require(_0x0c24('0x8'));module['exports']=function(_0x34dd4c,_0x2a8f1a){return _0x34dd4c[_0x0c24('0x9')](_0x0c24('0xa'),attributes,{'tableName':_0x0c24('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0ea1=['analytics_extracted_reports','util','api','bluebird','request-promise','path','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x45c55e,_0x18002b){var _0x5a9dd8=function(_0x389e52){while(--_0x389e52){_0x45c55e['push'](_0x45c55e['shift']());}};_0x5a9dd8(++_0x18002b);}(_0x0ea1,0xb5));var _0x10ea=function(_0x54b9e2,_0x47b06c){_0x54b9e2=_0x54b9e2-0x0;var _0x4859cc=_0x0ea1[_0x54b9e2];return _0x4859cc;};'use strict';var _=require('lodash');var util=require(_0x10ea('0x0'));var logger=require('../../config/logger')(_0x10ea('0x1'));var moment=require('moment');var BPromise=require(_0x10ea('0x2'));var rp=require(_0x10ea('0x3'));var fs=require('fs');var path=require(_0x10ea('0x4'));var rimraf=require('rimraf');var config=require(_0x10ea('0x5'));var attributes=require(_0x10ea('0x6'));module[_0x10ea('0x7')]=function(_0x4dfafc,_0x405754){return _0x4dfafc[_0x10ea('0x8')]('AnalyticExtractedReport',attributes,{'tableName':_0x10ea('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 828b6a2..971deca 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 _0xd4a2=['request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','lodash','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x26eeed,_0x32f126){var _0x4c2ff8=function(_0x6296fe){while(--_0x6296fe){_0x26eeed['push'](_0x26eeed['shift']());}};_0x4c2ff8(++_0x32f126);}(_0xd4a2,0x173));var _0x2d4a=function(_0x32b8c9,_0x19950f){_0x32b8c9=_0x32b8c9-0x0;var _0x5f59a7=_0xd4a2[_0x32b8c9];return _0x5f59a7;};'use strict';var _=require(_0x2d4a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2d4a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d4a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d4a('0x3'));var logger=require('../../config/logger')(_0x2d4a('0x4'));var config=require(_0x2d4a('0x5'));var jayson=require(_0x2d4a('0x6'));var client=jayson[_0x2d4a('0x7')][_0x2d4a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x57058f,_0x45fefb,_0x41b161){return new BPromise(function(_0x1f237e,_0x29597e){return client[_0x2d4a('0x9')](_0x57058f,_0x41b161)[_0x2d4a('0xa')](function(_0xb9f016){logger[_0x2d4a('0xb')](_0x2d4a('0xc'),_0x45fefb,_0x2d4a('0xd'));logger[_0x2d4a('0xe')](_0x2d4a('0xf'),_0x45fefb,'request\x20sent',JSON['stringify'](_0xb9f016));if(_0xb9f016[_0x2d4a('0x10')]){if(_0xb9f016['error'][_0x2d4a('0x11')]===0x1f4){logger[_0x2d4a('0x10')](_0x2d4a('0xc'),_0x45fefb,_0xb9f016[_0x2d4a('0x10')][_0x2d4a('0x12')]);return _0x29597e(_0xb9f016[_0x2d4a('0x10')][_0x2d4a('0x12')]);}logger[_0x2d4a('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x45fefb,_0xb9f016['error'][_0x2d4a('0x12')]);return _0x1f237e(_0xb9f016['error'][_0x2d4a('0x12')]);}else{logger[_0x2d4a('0xb')](_0x2d4a('0xc'),_0x45fefb,_0x2d4a('0xd'));_0x1f237e(_0xb9f016['result'][_0x2d4a('0x12')]);}})['catch'](function(_0x2838fa){logger['error'](_0x2d4a('0xc'),_0x45fefb,_0x2838fa);_0x29597e(_0x2838fa);});});}
\ No newline at end of file
+var _0x1137=['request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x46aa9c,_0x518160){var _0xf19a0b=function(_0x353d73){while(--_0x353d73){_0x46aa9c['push'](_0x46aa9c['shift']());}};_0xf19a0b(++_0x518160);}(_0x1137,0x183));var _0x7113=function(_0x9307ea,_0x38968a){_0x9307ea=_0x9307ea-0x0;var _0x295554=_0x1137[_0x9307ea];return _0x295554;};'use strict';var _=require(_0x7113('0x0'));var util=require(_0x7113('0x1'));var moment=require(_0x7113('0x2'));var BPromise=require(_0x7113('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7113('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7113('0x5'));var logger=require('../../config/logger')(_0x7113('0x6'));var config=require(_0x7113('0x7'));var jayson=require(_0x7113('0x8'));var client=jayson[_0x7113('0x9')][_0x7113('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x518610,_0x4ae605,_0x532fa1){return new BPromise(function(_0x4ac528,_0x2fc982){return client['request'](_0x518610,_0x532fa1)['then'](function(_0xfe7490){logger[_0x7113('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4ae605,_0x7113('0xc'));logger[_0x7113('0xd')](_0x7113('0xe'),_0x4ae605,_0x7113('0xc'),JSON[_0x7113('0xf')](_0xfe7490));if(_0xfe7490[_0x7113('0x10')]){if(_0xfe7490[_0x7113('0x10')][_0x7113('0x11')]===0x1f4){logger[_0x7113('0x10')](_0x7113('0x12'),_0x4ae605,_0xfe7490[_0x7113('0x10')]['message']);return _0x2fc982(_0xfe7490[_0x7113('0x10')]['message']);}logger[_0x7113('0x10')](_0x7113('0x12'),_0x4ae605,_0xfe7490[_0x7113('0x10')]['message']);return _0x4ac528(_0xfe7490[_0x7113('0x10')][_0x7113('0x13')]);}else{logger[_0x7113('0xb')](_0x7113('0x12'),_0x4ae605,'request\x20sent');_0x4ac528(_0xfe7490[_0x7113('0x14')]['message']);}})['catch'](function(_0x215e01){logger[_0x7113('0x10')](_0x7113('0x12'),_0x4ae605,_0x215e01);_0x2fc982(_0x215e01);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 37ec6bb..37b5306 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 _0xaf32=['Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create','put','update','destroy','multer','connect-timeout','express'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0xaf32,0x18c));var _0x2af3=function(_0x243f79,_0x429e45){_0x243f79=_0x243f79-0x0;var _0x460321=_0xaf32[_0x243f79];return _0x460321;};'use strict';var multer=require(_0x2af3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2af3('0x1'));var express=require(_0x2af3('0x2'));var router=express[_0x2af3('0x3')]();var fs_extra=require(_0x2af3('0x4'));var auth=require(_0x2af3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2af3('0x6'));var controller=require(_0x2af3('0x7'));router[_0x2af3('0x8')]('/',auth[_0x2af3('0x9')](),controller[_0x2af3('0xa')]);router[_0x2af3('0x8')](_0x2af3('0xb'),auth[_0x2af3('0x9')](),controller[_0x2af3('0xc')]);router['get'](_0x2af3('0xd'),auth[_0x2af3('0x9')](),controller[_0x2af3('0xe')]);router['post']('/',auth[_0x2af3('0x9')](),controller[_0x2af3('0xf')]);router[_0x2af3('0x10')](_0x2af3('0xb'),auth['isAuthenticated'](),controller[_0x2af3('0x11')]);router['delete'](_0x2af3('0xb'),auth[_0x2af3('0x9')](),controller[_0x2af3('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x3588=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','post','create','put','delete','multer','util','path','connect-timeout'];(function(_0x2a2a4a,_0x30e750){var _0xbd4c98=function(_0x2b6339){while(--_0x2b6339){_0x2a2a4a['push'](_0x2a2a4a['shift']());}};_0xbd4c98(++_0x30e750);}(_0x3588,0xf8));var _0x8358=function(_0x4310e8,_0x3ba783){_0x4310e8=_0x4310e8-0x0;var _0x301445=_0x3588[_0x4310e8];return _0x301445;};'use strict';var multer=require(_0x8358('0x0'));var util=require(_0x8358('0x1'));var path=require(_0x8358('0x2'));var timeout=require(_0x8358('0x3'));var express=require(_0x8358('0x4'));var router=express[_0x8358('0x5')]();var fs_extra=require(_0x8358('0x6'));var auth=require(_0x8358('0x7'));var interaction=require(_0x8358('0x8'));var config=require('../../config/environment');var controller=require(_0x8358('0x9'));router['get']('/',auth[_0x8358('0xa')](),controller[_0x8358('0xb')]);router[_0x8358('0xc')](_0x8358('0xd'),auth[_0x8358('0xa')](),controller[_0x8358('0xe')]);router[_0x8358('0xc')](_0x8358('0xf'),auth[_0x8358('0xa')](),controller[_0x8358('0x10')]);router[_0x8358('0x11')]('/',auth['isAuthenticated'](),controller[_0x8358('0x12')]);router[_0x8358('0x13')]('/:id',auth[_0x8358('0xa')](),controller['update']);router[_0x8358('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 6ac4572..cd27679 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 _0x21f4=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x463177,_0x3976f9){var _0x129e20=function(_0x537734){while(--_0x537734){_0x463177['push'](_0x463177['shift']());}};_0x129e20(++_0x3976f9);}(_0x21f4,0x126));var _0x421f=function(_0x2595c2,_0x27a4fc){_0x2595c2=_0x2595c2-0x0;var _0x16f71a=_0x21f4[_0x2595c2];return _0x16f71a;};'use strict';var Sequelize=require(_0x421f('0x0'));module[_0x421f('0x1')]={'field':{'type':Sequelize[_0x421f('0x2')]},'alias':{'type':Sequelize[_0x421f('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x421f('0x3')]},'groupBy':{'type':Sequelize[_0x421f('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x421f('0x3')]},'custom':{'type':Sequelize[_0x421f('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xcba5=['STRING','BOOLEAN','exports','TEXT'];(function(_0x5e0aed,_0x46575e){var _0x23cb81=function(_0x1afb92){while(--_0x1afb92){_0x5e0aed['push'](_0x5e0aed['shift']());}};_0x23cb81(++_0x46575e);}(_0xcba5,0xee));var _0x5cba=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xcba5[_0xdea41a];return _0x15d0d8;};'use strict';var Sequelize=require('sequelize');module[_0x5cba('0x0')]={'field':{'type':Sequelize[_0x5cba('0x1')]},'alias':{'type':Sequelize[_0x5cba('0x2')]},'function':{'type':Sequelize[_0x5cba('0x2')]},'format':{'type':Sequelize[_0x5cba('0x2')]},'groupBy':{'type':Sequelize[_0x5cba('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x5cba('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 988acc2..da3e6b0 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 _0x5c83=['rawAttributes','length','includeAll','find','catch','create','body','bulkCreate','update','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','error','name','send','map','AnalyticFieldReport','fieldName','type','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filters','pick','where','merge','options','include','rows','show','params'];(function(_0x5a364d,_0x264e9b){var _0x366d62=function(_0x58591c){while(--_0x58591c){_0x5a364d['push'](_0x5a364d['shift']());}};_0x366d62(++_0x264e9b);}(_0x5c83,0xb2));var _0x35c8=function(_0x93942f,_0xb48547){_0x93942f=_0x93942f-0x0;var _0x23fcd8=_0x5c83[_0x93942f];return _0x23fcd8;};'use strict';var emlformat=require(_0x35c8('0x0'));var rimraf=require(_0x35c8('0x1'));var zipdir=require(_0x35c8('0x2'));var jsonpatch=require(_0x35c8('0x3'));var rp=require(_0x35c8('0x4'));var moment=require(_0x35c8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x35c8('0x6'));var util=require(_0x35c8('0x7'));var path=require('path');var sox=require(_0x35c8('0x8'));var csv=require('to-csv');var ejs=require(_0x35c8('0x9'));var fs=require('fs');var fs_extra=require(_0x35c8('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x35c8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x35c8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x35c8('0xd'));var Papa=require(_0x35c8('0xe'));var Redis=require(_0x35c8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x35c8('0x10'));var as=require(_0x35c8('0x11'));var hardwareService=require(_0x35c8('0x12'));var logger=require(_0x35c8('0x13'))(_0x35c8('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x35c8('0x15'));var db=require(_0x35c8('0x16'))['db'];function respondWithStatusCode(_0x3b3c91,_0x4c597e){_0x4c597e=_0x4c597e||0xcc;return function(_0x1802b2){if(_0x1802b2){return _0x3b3c91[_0x35c8('0x17')](_0x4c597e);}return _0x3b3c91[_0x35c8('0x18')](_0x4c597e)[_0x35c8('0x19')]();};}function respondWithResult(_0x52bbd7,_0x17ab37){_0x17ab37=_0x17ab37||0xc8;return function(_0x39390c){if(_0x39390c){return _0x52bbd7[_0x35c8('0x18')](_0x17ab37)[_0x35c8('0x1a')](_0x39390c);}};}function respondWithFilteredResult(_0x1da72f,_0x3f1a1e){return function(_0x71a68f){if(_0x71a68f){var _0x2eee79=typeof _0x3f1a1e[_0x35c8('0x1b')]==='undefined'&&typeof _0x3f1a1e[_0x35c8('0x1c')]===_0x35c8('0x1d');var _0x203277=_0x71a68f[_0x35c8('0x1e')];var _0x3b54d0=_0x2eee79?0x0:_0x3f1a1e['offset'];var _0x23f337=_0x2eee79?_0x71a68f[_0x35c8('0x1e')]:_0x3f1a1e['offset']+_0x3f1a1e[_0x35c8('0x1c')];var _0xd76bba;if(_0x23f337>=_0x203277){_0x23f337=_0x203277;_0xd76bba=0xc8;}else{_0xd76bba=0xce;}_0x1da72f['status'](_0xd76bba);return _0x1da72f['set'](_0x35c8('0x1f'),_0x3b54d0+'-'+_0x23f337+'/'+_0x203277)[_0x35c8('0x1a')](_0x71a68f);}return null;};}function patchUpdates(_0x22273b){return function(_0x13873c){try{jsonpatch[_0x35c8('0x20')](_0x13873c,_0x22273b,!![]);}catch(_0x33bc60){return BPromise[_0x35c8('0x21')](_0x33bc60);}return _0x13873c[_0x35c8('0x22')]();};}function saveUpdates(_0x80d4a7,_0x1801c7){return function(_0x4f895d){if(_0x4f895d){return _0x4f895d['update'](_0x80d4a7)[_0x35c8('0x23')](function(_0x488472){return _0x488472;});}return null;};}function removeEntity(_0x4867ec,_0x4afec9){return function(_0xc6b330){if(_0xc6b330){return _0xc6b330[_0x35c8('0x24')]()[_0x35c8('0x23')](function(){_0x4867ec[_0x35c8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1869fc,_0x20569c){return function(_0x1bbe32){if(!_0x1bbe32){_0x1869fc[_0x35c8('0x17')](0x194);}return _0x1bbe32;};}function handleError(_0x33d28f,_0x48ab3c){_0x48ab3c=_0x48ab3c||0x1f4;return function(_0x38821f){logger[_0x35c8('0x25')](_0x38821f['stack']);if(_0x38821f[_0x35c8('0x26')]){delete _0x38821f['name'];}_0x33d28f[_0x35c8('0x18')](_0x48ab3c)[_0x35c8('0x27')](_0x38821f);};}exports['index']=function(_0x5397e4,_0x5e10c8){var _0x2314b6={},_0x2b4787={},_0x32998a={'count':0x0,'rows':[]};var _0x2e8d37=_[_0x35c8('0x28')](db[_0x35c8('0x29')]['rawAttributes'],function(_0x250c02){return{'name':_0x250c02[_0x35c8('0x2a')],'type':_0x250c02[_0x35c8('0x2b')]['key']};});_0x2b4787[_0x35c8('0x2c')]=_[_0x35c8('0x28')](_0x2e8d37,'name');_0x2b4787[_0x35c8('0x2d')]=_[_0x35c8('0x2e')](_0x5397e4[_0x35c8('0x2d')]);_0x2b4787['filters']=_['intersection'](_0x2b4787[_0x35c8('0x2c')],_0x2b4787[_0x35c8('0x2d')]);_0x2314b6[_0x35c8('0x2f')]=_[_0x35c8('0x30')](_0x2b4787[_0x35c8('0x2c')],qs[_0x35c8('0x31')](_0x5397e4[_0x35c8('0x2d')]['fields']));_0x2314b6[_0x35c8('0x2f')]=_0x2314b6['attributes']['length']?_0x2314b6[_0x35c8('0x2f')]:_0x2b4787[_0x35c8('0x2c')];if(!_0x5397e4[_0x35c8('0x2d')][_0x35c8('0x32')](_0x35c8('0x33'))){_0x2314b6[_0x35c8('0x1c')]=qs[_0x35c8('0x1c')](_0x5397e4[_0x35c8('0x2d')]['limit']);_0x2314b6[_0x35c8('0x1b')]=qs['offset'](_0x5397e4[_0x35c8('0x2d')][_0x35c8('0x1b')]);}_0x2314b6['order']=qs[_0x35c8('0x34')](_0x5397e4[_0x35c8('0x2d')][_0x35c8('0x34')]);_0x2314b6['where']=qs[_0x35c8('0x35')](_[_0x35c8('0x36')](_0x5397e4[_0x35c8('0x2d')],_0x2b4787['filters']),_0x2e8d37);if(_0x5397e4[_0x35c8('0x2d')]['filter']){_0x2314b6[_0x35c8('0x37')]=_[_0x35c8('0x38')](_0x2314b6['where'],{'$or':_[_0x35c8('0x28')](_0x2e8d37,function(_0x241e06){if(_0x241e06[_0x35c8('0x2b')]!=='VIRTUAL'){var _0x4210a2={};_0x4210a2[_0x241e06[_0x35c8('0x26')]]={'$like':'%'+_0x5397e4[_0x35c8('0x2d')]['filter']+'%'};return _0x4210a2;}})});}_0x2314b6=_[_0x35c8('0x38')]({},_0x2314b6,_0x5397e4[_0x35c8('0x39')]);var _0x45b470={'where':_0x2314b6[_0x35c8('0x37')]};return db[_0x35c8('0x29')][_0x35c8('0x1e')](_0x45b470)['then'](function(_0x441383){_0x32998a[_0x35c8('0x1e')]=_0x441383;if(_0x5397e4[_0x35c8('0x2d')]['includeAll']){_0x2314b6[_0x35c8('0x3a')]=[{'all':!![]}];}return db[_0x35c8('0x29')]['findAll'](_0x2314b6);})[_0x35c8('0x23')](function(_0x1ce112){_0x32998a[_0x35c8('0x3b')]=_0x1ce112;return _0x32998a;})[_0x35c8('0x23')](respondWithFilteredResult(_0x5e10c8,_0x2314b6))['catch'](handleError(_0x5e10c8,null));};exports[_0x35c8('0x3c')]=function(_0x4f22c0,_0x500bed){var _0x95f09e={'raw':![],'where':{'id':_0x4f22c0[_0x35c8('0x3d')]['id']}},_0x568f77={};_0x568f77[_0x35c8('0x2c')]=_['keys'](db['AnalyticFieldReport'][_0x35c8('0x3e')]);_0x568f77[_0x35c8('0x2d')]=_[_0x35c8('0x2e')](_0x4f22c0[_0x35c8('0x2d')]);_0x568f77[_0x35c8('0x35')]=_[_0x35c8('0x30')](_0x568f77[_0x35c8('0x2c')],_0x568f77[_0x35c8('0x2d')]);_0x95f09e[_0x35c8('0x2f')]=_[_0x35c8('0x30')](_0x568f77['model'],qs[_0x35c8('0x31')](_0x4f22c0[_0x35c8('0x2d')][_0x35c8('0x31')]));_0x95f09e[_0x35c8('0x2f')]=_0x95f09e[_0x35c8('0x2f')][_0x35c8('0x3f')]?_0x95f09e[_0x35c8('0x2f')]:_0x568f77[_0x35c8('0x2c')];if(_0x4f22c0['query'][_0x35c8('0x40')]){_0x95f09e['include']=[{'all':!![]}];}_0x95f09e=_[_0x35c8('0x38')]({},_0x95f09e,_0x4f22c0[_0x35c8('0x39')]);return db[_0x35c8('0x29')][_0x35c8('0x41')](_0x95f09e)['then'](handleEntityNotFound(_0x500bed,null))[_0x35c8('0x23')](respondWithResult(_0x500bed,null))[_0x35c8('0x42')](handleError(_0x500bed,null));};exports[_0x35c8('0x43')]=function(_0x44a9a4,_0x148f16){return db[_0x35c8('0x29')][_0x35c8('0x43')](_0x44a9a4[_0x35c8('0x44')],{})[_0x35c8('0x23')](respondWithResult(_0x148f16,0xc9))[_0x35c8('0x42')](handleError(_0x148f16,null));};exports[_0x35c8('0x45')]=function(_0x8cd018,_0x38ef88){return db[_0x35c8('0x29')][_0x35c8('0x45')](_0x8cd018[_0x35c8('0x44')],{'raw':![],'individualHooks':!![]})[_0x35c8('0x23')](respondWithResult(_0x38ef88,0xc9))[_0x35c8('0x42')](handleError(_0x38ef88,null));};exports[_0x35c8('0x46')]=function(_0x32a7e3,_0x434904){if(_0x32a7e3[_0x35c8('0x44')]['id']){delete _0x32a7e3['body']['id'];}return db[_0x35c8('0x29')]['find']({'where':{'id':_0x32a7e3[_0x35c8('0x3d')]['id']}})[_0x35c8('0x23')](handleEntityNotFound(_0x434904,null))['then'](saveUpdates(_0x32a7e3[_0x35c8('0x44')],null))[_0x35c8('0x23')](respondWithResult(_0x434904,null))['catch'](handleError(_0x434904,null));};exports[_0x35c8('0x24')]=function(_0x3d8f2f,_0x520d39){return db[_0x35c8('0x29')]['find']({'where':{'id':_0x3d8f2f[_0x35c8('0x3d')]['id']}})[_0x35c8('0x23')](handleEntityNotFound(_0x520d39,null))['then'](removeEntity(_0x520d39,null))[_0x35c8('0x42')](handleError(_0x520d39,null));};exports[_0x35c8('0x47')]=function(_0x12f7e7,_0x2d1c7f){return db[_0x35c8('0x29')][_0x35c8('0x24')]({'where':{'id':_0x12f7e7[_0x35c8('0x2d')][_0x35c8('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x35c8('0x23')](respondWithResult(_0x2d1c7f,0xcc))[_0x35c8('0x42')](handleError(_0x2d1c7f,null));};exports[_0x35c8('0x49')]=function(_0xc52713,_0x1c913a,_0x691b3c){return db[_0x35c8('0x4a')][_0x35c8('0x4b')]({'where':{'id':_0xc52713[_0x35c8('0x3d')]['id']}})[_0x35c8('0x23')](handleEntityNotFound(_0x1c913a,null))[_0x35c8('0x23')](function(_0x4d74c0){if(_0x4d74c0){return db[_0x35c8('0x4c')][_0x35c8('0x4d')](function(_0x27b62c){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0xc52713[_0x35c8('0x3d')]['id']},'transaction':_0x27b62c})[_0x35c8('0x23')](function(_0x417f3c){var _0x1a843b=_['map'](_0xc52713[_0x35c8('0x44')],function(_0x51b850){delete _0x51b850['id'];_0x51b850[_0x35c8('0x4e')]=_0xc52713[_0x35c8('0x3d')]['id'];return _0x51b850;});return db['AnalyticFieldReport'][_0x35c8('0x45')](_0x1a843b,{'transaction':_0x27b62c});});})['then'](function(){return db[_0x35c8('0x29')][_0x35c8('0x4f')]({'where':{'CustomReportId':_0xc52713[_0x35c8('0x3d')]['id']}});});}})[_0x35c8('0x23')](respondWithResult(_0x1c913a,null))[_0x35c8('0x42')](handleError(_0x1c913a,null));};
\ No newline at end of file
+var _0xad1b=['fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','bulkCreate','addFields','sequelize','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','destroy','stack','name','send','index','AnalyticFieldReport','rawAttributes'];(function(_0x5a0119,_0x5659d8){var _0x2f835a=function(_0xaf917c){while(--_0xaf917c){_0x5a0119['push'](_0x5a0119['shift']());}};_0x2f835a(++_0x5659d8);}(_0xad1b,0x164));var _0xbad1=function(_0x3520f7,_0x541650){_0x3520f7=_0x3520f7-0x0;var _0x14b6db=_0xad1b[_0x3520f7];return _0x14b6db;};'use strict';var emlformat=require(_0xbad1('0x0'));var rimraf=require(_0xbad1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbad1('0x2'));var rp=require('request-promise');var moment=require(_0xbad1('0x3'));var BPromise=require(_0xbad1('0x4'));var Mustache=require(_0xbad1('0x5'));var util=require('util');var path=require(_0xbad1('0x6'));var sox=require(_0xbad1('0x7'));var csv=require(_0xbad1('0x8'));var ejs=require(_0xbad1('0x9'));var fs=require('fs');var fs_extra=require(_0xbad1('0xa'));var _=require(_0xbad1('0xb'));var squel=require(_0xbad1('0xc'));var crypto=require(_0xbad1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbad1('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbad1('0xf'));var Papa=require(_0xbad1('0x10'));var Redis=require(_0xbad1('0x11'));var authService=require(_0xbad1('0x12'));var qs=require(_0xbad1('0x13'));var as=require(_0xbad1('0x14'));var hardwareService=require(_0xbad1('0x15'));var logger=require(_0xbad1('0x16'))(_0xbad1('0x17'));var utils=require(_0xbad1('0x18'));var config=require(_0xbad1('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7be4bf,_0x43ac7a){_0x43ac7a=_0x43ac7a||0xcc;return function(_0x6dabee){if(_0x6dabee){return _0x7be4bf[_0xbad1('0x1a')](_0x43ac7a);}return _0x7be4bf[_0xbad1('0x1b')](_0x43ac7a)[_0xbad1('0x1c')]();};}function respondWithResult(_0x52d00a,_0x388335){_0x388335=_0x388335||0xc8;return function(_0x55e839){if(_0x55e839){return _0x52d00a[_0xbad1('0x1b')](_0x388335)[_0xbad1('0x1d')](_0x55e839);}};}function respondWithFilteredResult(_0x2747e0,_0x3d6aaa){return function(_0x2df816){if(_0x2df816){var _0x1d0d81=typeof _0x3d6aaa[_0xbad1('0x1e')]===_0xbad1('0x1f')&&typeof _0x3d6aaa[_0xbad1('0x20')]===_0xbad1('0x1f');var _0x24361a=_0x2df816[_0xbad1('0x21')];var _0x1d4364=_0x1d0d81?0x0:_0x3d6aaa[_0xbad1('0x1e')];var _0x495de6=_0x1d0d81?_0x2df816[_0xbad1('0x21')]:_0x3d6aaa['offset']+_0x3d6aaa[_0xbad1('0x20')];var _0xc2de25;if(_0x495de6>=_0x24361a){_0x495de6=_0x24361a;_0xc2de25=0xc8;}else{_0xc2de25=0xce;}_0x2747e0[_0xbad1('0x1b')](_0xc2de25);return _0x2747e0[_0xbad1('0x22')]('Content-Range',_0x1d4364+'-'+_0x495de6+'/'+_0x24361a)[_0xbad1('0x1d')](_0x2df816);}return null;};}function patchUpdates(_0x453e15){return function(_0x2caf92){try{jsonpatch['apply'](_0x2caf92,_0x453e15,!![]);}catch(_0x3840ab){return BPromise['reject'](_0x3840ab);}return _0x2caf92['save']();};}function saveUpdates(_0x206456,_0x4b6abd){return function(_0x1c98bd){if(_0x1c98bd){return _0x1c98bd[_0xbad1('0x23')](_0x206456)[_0xbad1('0x24')](function(_0x1c8e7b){return _0x1c8e7b;});}return null;};}function removeEntity(_0x1a0925,_0x2b3eee){return function(_0x5c4a4e){if(_0x5c4a4e){return _0x5c4a4e[_0xbad1('0x25')]()[_0xbad1('0x24')](function(){_0x1a0925['status'](0xcc)[_0xbad1('0x1c')]();});}};}function handleEntityNotFound(_0x10fd11,_0x18d313){return function(_0x42bfdf){if(!_0x42bfdf){_0x10fd11[_0xbad1('0x1a')](0x194);}return _0x42bfdf;};}function handleError(_0x105dbd,_0x3f6b04){_0x3f6b04=_0x3f6b04||0x1f4;return function(_0x133ee2){logger['error'](_0x133ee2[_0xbad1('0x26')]);if(_0x133ee2[_0xbad1('0x27')]){delete _0x133ee2[_0xbad1('0x27')];}_0x105dbd[_0xbad1('0x1b')](_0x3f6b04)[_0xbad1('0x28')](_0x133ee2);};}exports[_0xbad1('0x29')]=function(_0x498f23,_0x3e386b){var _0x4d71f1={},_0x41907a={},_0x16d034={'count':0x0,'rows':[]};var _0x208f45=_['map'](db[_0xbad1('0x2a')][_0xbad1('0x2b')],function(_0x28f65a){return{'name':_0x28f65a[_0xbad1('0x2c')],'type':_0x28f65a[_0xbad1('0x2d')][_0xbad1('0x2e')]};});_0x41907a[_0xbad1('0x2f')]=_[_0xbad1('0x30')](_0x208f45,_0xbad1('0x27'));_0x41907a[_0xbad1('0x31')]=_[_0xbad1('0x32')](_0x498f23['query']);_0x41907a[_0xbad1('0x33')]=_[_0xbad1('0x34')](_0x41907a[_0xbad1('0x2f')],_0x41907a[_0xbad1('0x31')]);_0x4d71f1[_0xbad1('0x35')]=_[_0xbad1('0x34')](_0x41907a[_0xbad1('0x2f')],qs[_0xbad1('0x36')](_0x498f23[_0xbad1('0x31')][_0xbad1('0x36')]));_0x4d71f1[_0xbad1('0x35')]=_0x4d71f1[_0xbad1('0x35')]['length']?_0x4d71f1[_0xbad1('0x35')]:_0x41907a[_0xbad1('0x2f')];if(!_0x498f23[_0xbad1('0x31')][_0xbad1('0x37')](_0xbad1('0x38'))){_0x4d71f1[_0xbad1('0x20')]=qs[_0xbad1('0x20')](_0x498f23[_0xbad1('0x31')][_0xbad1('0x20')]);_0x4d71f1[_0xbad1('0x1e')]=qs['offset'](_0x498f23[_0xbad1('0x31')][_0xbad1('0x1e')]);}_0x4d71f1['order']=qs[_0xbad1('0x39')](_0x498f23[_0xbad1('0x31')]['sort']);_0x4d71f1[_0xbad1('0x3a')]=qs[_0xbad1('0x33')](_[_0xbad1('0x3b')](_0x498f23['query'],_0x41907a[_0xbad1('0x33')]),_0x208f45);if(_0x498f23['query'][_0xbad1('0x3c')]){_0x4d71f1[_0xbad1('0x3a')]=_[_0xbad1('0x3d')](_0x4d71f1[_0xbad1('0x3a')],{'$or':_[_0xbad1('0x30')](_0x208f45,function(_0x3b4dde){if(_0x3b4dde['type']!==_0xbad1('0x3e')){var _0x48f7b7={};_0x48f7b7[_0x3b4dde[_0xbad1('0x27')]]={'$like':'%'+_0x498f23[_0xbad1('0x31')][_0xbad1('0x3c')]+'%'};return _0x48f7b7;}})});}_0x4d71f1=_['merge']({},_0x4d71f1,_0x498f23[_0xbad1('0x3f')]);var _0x386f5f={'where':_0x4d71f1[_0xbad1('0x3a')]};return db[_0xbad1('0x2a')][_0xbad1('0x21')](_0x386f5f)['then'](function(_0x5af18e){_0x16d034['count']=_0x5af18e;if(_0x498f23[_0xbad1('0x31')][_0xbad1('0x40')]){_0x4d71f1[_0xbad1('0x41')]=[{'all':!![]}];}return db[_0xbad1('0x2a')][_0xbad1('0x42')](_0x4d71f1);})[_0xbad1('0x24')](function(_0x267321){_0x16d034[_0xbad1('0x43')]=_0x267321;return _0x16d034;})[_0xbad1('0x24')](respondWithFilteredResult(_0x3e386b,_0x4d71f1))[_0xbad1('0x44')](handleError(_0x3e386b,null));};exports[_0xbad1('0x45')]=function(_0x2659a1,_0x582c0f){var _0x595350={'raw':![],'where':{'id':_0x2659a1[_0xbad1('0x46')]['id']}},_0x2add3d={};_0x2add3d[_0xbad1('0x2f')]=_['keys'](db['AnalyticFieldReport'][_0xbad1('0x2b')]);_0x2add3d['query']=_[_0xbad1('0x32')](_0x2659a1[_0xbad1('0x31')]);_0x2add3d[_0xbad1('0x33')]=_['intersection'](_0x2add3d[_0xbad1('0x2f')],_0x2add3d['query']);_0x595350[_0xbad1('0x35')]=_['intersection'](_0x2add3d[_0xbad1('0x2f')],qs[_0xbad1('0x36')](_0x2659a1[_0xbad1('0x31')]['fields']));_0x595350[_0xbad1('0x35')]=_0x595350[_0xbad1('0x35')][_0xbad1('0x47')]?_0x595350[_0xbad1('0x35')]:_0x2add3d[_0xbad1('0x2f')];if(_0x2659a1[_0xbad1('0x31')][_0xbad1('0x40')]){_0x595350['include']=[{'all':!![]}];}_0x595350=_['merge']({},_0x595350,_0x2659a1[_0xbad1('0x3f')]);return db[_0xbad1('0x2a')][_0xbad1('0x48')](_0x595350)[_0xbad1('0x24')](handleEntityNotFound(_0x582c0f,null))[_0xbad1('0x24')](respondWithResult(_0x582c0f,null))[_0xbad1('0x44')](handleError(_0x582c0f,null));};exports[_0xbad1('0x49')]=function(_0x26d9bc,_0x5b3a17){return db[_0xbad1('0x2a')][_0xbad1('0x49')](_0x26d9bc[_0xbad1('0x4a')],{})['then'](respondWithResult(_0x5b3a17,0xc9))['catch'](handleError(_0x5b3a17,null));};exports[_0xbad1('0x4b')]=function(_0x10c0a8,_0x3e61dc){return db['AnalyticFieldReport'][_0xbad1('0x4b')](_0x10c0a8[_0xbad1('0x4a')],{'raw':![],'individualHooks':!![]})[_0xbad1('0x24')](respondWithResult(_0x3e61dc,0xc9))[_0xbad1('0x44')](handleError(_0x3e61dc,null));};exports[_0xbad1('0x23')]=function(_0x53a00b,_0x5a46b4){if(_0x53a00b['body']['id']){delete _0x53a00b['body']['id'];}return db[_0xbad1('0x2a')][_0xbad1('0x48')]({'where':{'id':_0x53a00b['params']['id']}})[_0xbad1('0x24')](handleEntityNotFound(_0x5a46b4,null))[_0xbad1('0x24')](saveUpdates(_0x53a00b[_0xbad1('0x4a')],null))[_0xbad1('0x24')](respondWithResult(_0x5a46b4,null))[_0xbad1('0x44')](handleError(_0x5a46b4,null));};exports[_0xbad1('0x25')]=function(_0x40a309,_0x184435){return db[_0xbad1('0x2a')][_0xbad1('0x48')]({'where':{'id':_0x40a309[_0xbad1('0x46')]['id']}})[_0xbad1('0x24')](handleEntityNotFound(_0x184435,null))[_0xbad1('0x24')](removeEntity(_0x184435,null))[_0xbad1('0x44')](handleError(_0x184435,null));};exports['bulkDestroy']=function(_0x2210ea,_0xe32c1a){return db[_0xbad1('0x2a')]['destroy']({'where':{'id':_0x2210ea[_0xbad1('0x31')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xbad1('0x24')](respondWithResult(_0xe32c1a,0xcc))[_0xbad1('0x44')](handleError(_0xe32c1a,null));};exports[_0xbad1('0x4c')]=function(_0x538eef,_0x20bd4f,_0x5d33dc){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x538eef[_0xbad1('0x46')]['id']}})[_0xbad1('0x24')](handleEntityNotFound(_0x20bd4f,null))[_0xbad1('0x24')](function(_0x216f1b){if(_0x216f1b){return db[_0xbad1('0x4d')][_0xbad1('0x4e')](function(_0xaeda4e){return db[_0xbad1('0x2a')][_0xbad1('0x25')]({'where':{'CustomReportId':_0x538eef[_0xbad1('0x46')]['id']},'transaction':_0xaeda4e})[_0xbad1('0x24')](function(_0x5f6be3){var _0x1449c2=_[_0xbad1('0x30')](_0x538eef[_0xbad1('0x4a')],function(_0x31f9ef){delete _0x31f9ef['id'];_0x31f9ef[_0xbad1('0x4f')]=_0x538eef[_0xbad1('0x46')]['id'];return _0x31f9ef;});return db['AnalyticFieldReport'][_0xbad1('0x4b')](_0x1449c2,{'transaction':_0xaeda4e});});})[_0xbad1('0x24')](function(){return db['AnalyticFieldReport'][_0xbad1('0x42')]({'where':{'CustomReportId':_0x538eef[_0xbad1('0x46')]['id']}});});}})[_0xbad1('0x24')](respondWithResult(_0x20bd4f,null))[_0xbad1('0x44')](handleError(_0x20bd4f,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 75345b4..20260cf 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 _0x7e86=['rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x28f402,_0x5aec8a){var _0x498203=function(_0x2789e9){while(--_0x2789e9){_0x28f402['push'](_0x28f402['shift']());}};_0x498203(++_0x5aec8a);}(_0x7e86,0x14b));var _0x67e8=function(_0x136c19,_0x30aa53){_0x136c19=_0x136c19-0x0;var _0x1fea1f=_0x7e86[_0x136c19];return _0x1fea1f;};'use strict';var _=require('lodash');var util=require(_0x67e8('0x0'));var logger=require(_0x67e8('0x1'))(_0x67e8('0x2'));var moment=require(_0x67e8('0x3'));var BPromise=require(_0x67e8('0x4'));var rp=require(_0x67e8('0x5'));var fs=require('fs');var path=require(_0x67e8('0x6'));var rimraf=require(_0x67e8('0x7'));var config=require('../../config/environment');var attributes=require(_0x67e8('0x8'));module[_0x67e8('0x9')]=function(_0x439071,_0x2d18e5){return _0x439071[_0x67e8('0xa')](_0x67e8('0xb'),attributes,{'tableName':_0x67e8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf663=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5a5395,_0x5361f6){var _0x4da43d=function(_0x149941){while(--_0x149941){_0x5a5395['push'](_0x5a5395['shift']());}};_0x4da43d(++_0x5361f6);}(_0xf663,0xff));var _0x3f66=function(_0x3f3a47,_0x28f84b){_0x3f3a47=_0x3f3a47-0x0;var _0x57a682=_0xf663[_0x3f3a47];return _0x57a682;};'use strict';var _=require(_0x3f66('0x0'));var util=require(_0x3f66('0x1'));var logger=require(_0x3f66('0x2'))('api');var moment=require(_0x3f66('0x3'));var BPromise=require(_0x3f66('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f66('0x5'));var rimraf=require(_0x3f66('0x6'));var config=require(_0x3f66('0x7'));var attributes=require(_0x3f66('0x8'));module[_0x3f66('0x9')]=function(_0x28e10f,_0x48e49a){return _0x28e10f[_0x3f66('0xa')](_0x3f66('0xb'),attributes,{'tableName':_0x3f66('0xc'),'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 9bdce6d..98741c8 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 _0xdbeb=['http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x571268,_0x4a2163){var _0x52b796=function(_0xf3a5db){while(--_0xf3a5db){_0x571268['push'](_0x571268['shift']());}};_0x52b796(++_0x4a2163);}(_0xdbeb,0xa0));var _0xbdbe=function(_0x394b54,_0x13aecd){_0x394b54=_0x394b54-0x0;var _0x1e9a70=_0xdbeb[_0x394b54];return _0x1e9a70;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbdbe('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbdbe('0x1'));var db=require(_0xbdbe('0x2'))['db'];var utils=require(_0xbdbe('0x3'));var logger=require(_0xbdbe('0x4'))(_0xbdbe('0x5'));var config=require(_0xbdbe('0x6'));var jayson=require(_0xbdbe('0x7'));var client=jayson['client'][_0xbdbe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xea48ee,_0x4eb6ba,_0x2da22d){return new BPromise(function(_0x8145e8,_0x361005){return client[_0xbdbe('0x9')](_0xea48ee,_0x2da22d)[_0xbdbe('0xa')](function(_0x5a0a63){logger[_0xbdbe('0xb')](_0xbdbe('0xc'),_0x4eb6ba,_0xbdbe('0xd'));logger[_0xbdbe('0xe')](_0xbdbe('0xf'),_0x4eb6ba,'request\x20sent',JSON[_0xbdbe('0x10')](_0x5a0a63));if(_0x5a0a63[_0xbdbe('0x11')]){if(_0x5a0a63['error'][_0xbdbe('0x12')]===0x1f4){logger['error'](_0xbdbe('0xc'),_0x4eb6ba,_0x5a0a63[_0xbdbe('0x11')]['message']);return _0x361005(_0x5a0a63[_0xbdbe('0x11')][_0xbdbe('0x13')]);}logger[_0xbdbe('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4eb6ba,_0x5a0a63[_0xbdbe('0x11')][_0xbdbe('0x13')]);return _0x8145e8(_0x5a0a63[_0xbdbe('0x11')][_0xbdbe('0x13')]);}else{logger[_0xbdbe('0xb')](_0xbdbe('0xc'),_0x4eb6ba,_0xbdbe('0xd'));_0x8145e8(_0x5a0a63['result'][_0xbdbe('0x13')]);}})[_0xbdbe('0x14')](function(_0xb277b3){logger[_0xbdbe('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4eb6ba,_0xb277b3);_0x361005(_0xb277b3);});});}
\ No newline at end of file
+var _0x360a=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3f9f46,_0x49f6d2){var _0x2c9e54=function(_0x2f41a5){while(--_0x2f41a5){_0x3f9f46['push'](_0x3f9f46['shift']());}};_0x2c9e54(++_0x49f6d2);}(_0x360a,0x169));var _0xa360=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x360a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa360('0x0'));var util=require(_0xa360('0x1'));var moment=require(_0xa360('0x2'));var BPromise=require(_0xa360('0x3'));var rs=require(_0xa360('0x4'));var fs=require('fs');var Redis=require(_0xa360('0x5'));var db=require(_0xa360('0x6'))['db'];var utils=require(_0xa360('0x7'));var logger=require(_0xa360('0x8'))(_0xa360('0x9'));var config=require(_0xa360('0xa'));var jayson=require(_0xa360('0xb'));var client=jayson[_0xa360('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11855c,_0x408cf2,_0xe64fbf){return new BPromise(function(_0x5926b7,_0x5583e){return client['request'](_0x11855c,_0xe64fbf)[_0xa360('0xd')](function(_0xa4b13e){logger[_0xa360('0xe')](_0xa360('0xf'),_0x408cf2,_0xa360('0x10'));logger[_0xa360('0x11')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x408cf2,_0xa360('0x10'),JSON[_0xa360('0x12')](_0xa4b13e));if(_0xa4b13e[_0xa360('0x13')]){if(_0xa4b13e[_0xa360('0x13')][_0xa360('0x14')]===0x1f4){logger[_0xa360('0x13')](_0xa360('0xf'),_0x408cf2,_0xa4b13e['error']['message']);return _0x5583e(_0xa4b13e[_0xa360('0x13')][_0xa360('0x15')]);}logger[_0xa360('0x13')](_0xa360('0xf'),_0x408cf2,_0xa4b13e[_0xa360('0x13')][_0xa360('0x15')]);return _0x5926b7(_0xa4b13e['error']['message']);}else{logger['info'](_0xa360('0xf'),_0x408cf2,'request\x20sent');_0x5926b7(_0xa4b13e[_0xa360('0x16')]['message']);}})['catch'](function(_0x3254c5){logger[_0xa360('0x13')](_0xa360('0xf'),_0x408cf2,_0x3254c5);_0x5583e(_0x3254c5);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 40b1295..b4a9ec7 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(_0x4ca19a,_0x51c584){var _0x3d5de0=function(_0x4803f6){while(--_0x4803f6){_0x4ca19a['push'](_0x4ca19a['shift']());}};_0x3d5de0(++_0x51c584);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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(_0x12e09c,_0x41e3f2){var _0x559e70=function(_0x3fb2da){while(--_0x3fb2da){_0x12e09c['push'](_0x12e09c['shift']());}};_0x559e70(++_0x41e3f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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 ab9b0fa..75f3655 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 _0xac7f=['STRING','name','sequelize'];(function(_0x4d1191,_0x3f1700){var _0x58c49e=function(_0x3acc67){while(--_0x3acc67){_0x4d1191['push'](_0x4d1191['shift']());}};_0x58c49e(++_0x3f1700);}(_0xac7f,0x1e2));var _0xfac7=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xac7f[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require(_0xfac7('0x0'));module['exports']={'name':{'type':Sequelize[_0xfac7('0x1')],'allowNull':![],'unique':_0xfac7('0x2')},'table':{'type':Sequelize[_0xfac7('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xfac7('0x1')]}};
\ No newline at end of file
+var _0xbdb7=['name','TEXT','sequelize','exports','STRING'];(function(_0x5c8736,_0x2a2a03){var _0x142bdb=function(_0x406951){while(--_0x406951){_0x5c8736['push'](_0x5c8736['shift']());}};_0x142bdb(++_0x2a2a03);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x1d29f6,_0x45f6a0){_0x1d29f6=_0x1d29f6-0x0;var _0x491093=_0xbdb7[_0x1d29f6];return _0x491093;};'use strict';var Sequelize=require(_0x7bdb('0x0'));module[_0x7bdb('0x1')]={'name':{'type':Sequelize[_0x7bdb('0x2')],'allowNull':![],'unique':_0x7bdb('0x3')},'table':{'type':Sequelize[_0x7bdb('0x2')]},'metric':{'type':Sequelize[_0x7bdb('0x4')]},'description':{'type':Sequelize[_0x7bdb('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 6c0e8e6..ff4f405 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 _0x7217=['Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x52a980,_0x129042){var _0x33f0db=function(_0x4fb1dd){while(--_0x4fb1dd){_0x52a980['push'](_0x52a980['shift']());}};_0x33f0db(++_0x129042);}(_0x7217,0x19e));var _0x7721=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x7217[_0x110c3d];return _0x226d67;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){var _0x216f20=_0x395b15[_0x7721('0x2b')]({'plain':!![]});var _0x125564=_0x7721('0x2c');return db[_0x7721('0x2d')][_0x7721('0x2a')]({'where':{'type':_0x125564,'resourceId':_0x216f20['id']}})[_0x7721('0x29')](function(){return _0x395b15;});})[_0x7721('0x29')](function(){_0x1caad8[_0x7721('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x258ddf,_0x5b0551){return function(_0x499b87){if(!_0x499b87){_0x258ddf[_0x7721('0x2e')](0x194);}return _0x499b87;};}function handleError(_0x343c19,_0x53c904){_0x53c904=_0x53c904||0x1f4;return function(_0x158d98){logger[_0x7721('0x2f')](_0x158d98[_0x7721('0x30')]);if(_0x158d98[_0x7721('0x31')]){delete _0x158d98[_0x7721('0x31')];}_0x343c19['status'](_0x53c904)[_0x7721('0x32')](_0x158d98);};}exports[_0x7721('0x33')]=function(_0x497f9f,_0x4a25c9){var _0xfde9ec={},_0x220bbf={},_0x48f329={'count':0x0,'rows':[]};var _0x46f772=_[_0x7721('0x34')](db[_0x7721('0x35')]['rawAttributes'],function(_0x3d9a32){return{'name':_0x3d9a32[_0x7721('0x36')],'type':_0x3d9a32[_0x7721('0x37')][_0x7721('0x38')]};});_0x220bbf[_0x7721('0x39')]=_['map'](_0x46f772,_0x7721('0x31'));_0x220bbf[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0x497f9f['query']);_0x220bbf[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x220bbf['model'],_0x220bbf[_0x7721('0x3a')]);_0xfde9ec['attributes']=_[_0x7721('0x3d')](_0x220bbf[_0x7721('0x39')],qs[_0x7721('0x3e')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x3e')]));_0xfde9ec[_0x7721('0x3f')]=_0xfde9ec[_0x7721('0x3f')][_0x7721('0x40')]?_0xfde9ec[_0x7721('0x3f')]:_0x220bbf[_0x7721('0x39')];if(!_0x497f9f[_0x7721('0x3a')]['hasOwnProperty'](_0x7721('0x41'))){_0xfde9ec['limit']=qs[_0x7721('0x21')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x21')]);_0xfde9ec[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x497f9f[_0x7721('0x3a')]['offset']);}_0xfde9ec['order']=qs['sort'](_0x497f9f['query'][_0x7721('0x42')]);_0xfde9ec[_0x7721('0x43')]=qs[_0x7721('0x3c')](_[_0x7721('0x44')](_0x497f9f['query'],_0x220bbf[_0x7721('0x3c')]),_0x46f772);if(_0x497f9f['query'][_0x7721('0x45')]){_0xfde9ec[_0x7721('0x43')]=_['merge'](_0xfde9ec[_0x7721('0x43')],{'$or':_[_0x7721('0x34')](_0x46f772,function(_0x4e77ff){if(_0x4e77ff['type']!==_0x7721('0x46')){var _0xfc4dc4={};_0xfc4dc4[_0x4e77ff[_0x7721('0x31')]]={'$like':'%'+_0x497f9f[_0x7721('0x3a')]['filter']+'%'};return _0xfc4dc4;}})});}_0xfde9ec=_[_0x7721('0x47')]({},_0xfde9ec,_0x497f9f[_0x7721('0x48')]);var _0x40ce8c={'where':_0xfde9ec[_0x7721('0x43')]};return db[_0x7721('0x35')]['count'](_0x40ce8c)[_0x7721('0x29')](function(_0x4a2c28){_0x48f329[_0x7721('0x22')]=_0x4a2c28;if(_0x497f9f['query'][_0x7721('0x49')]){_0xfde9ec[_0x7721('0x4a')]=[{'all':!![]}];}return db[_0x7721('0x35')]['findAll'](_0xfde9ec);})[_0x7721('0x29')](function(_0x11d853){_0x48f329[_0x7721('0x4b')]=_0x11d853;return _0x48f329;})['then'](respondWithFilteredResult(_0x4a25c9,_0xfde9ec))[_0x7721('0x4c')](handleError(_0x4a25c9,null));};exports[_0x7721('0x4d')]=function(_0xdb3033,_0x2d5f35){var _0x135dbc={'raw':!![],'where':{'id':_0xdb3033[_0x7721('0x4e')]['id']}},_0x57d09b={};_0x57d09b['model']=_['keys'](db[_0x7721('0x35')][_0x7721('0x4f')]);_0x57d09b[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0xdb3033[_0x7721('0x3a')]);_0x57d09b[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x57d09b[_0x7721('0x39')],_0x57d09b[_0x7721('0x3a')]);_0x135dbc[_0x7721('0x3f')]=_['intersection'](_0x57d09b['model'],qs[_0x7721('0x3e')](_0xdb3033[_0x7721('0x3a')][_0x7721('0x3e')]));_0x135dbc[_0x7721('0x3f')]=_0x135dbc['attributes'][_0x7721('0x40')]?_0x135dbc[_0x7721('0x3f')]:_0x57d09b['model'];if(_0xdb3033[_0x7721('0x3a')]['includeAll']){_0x135dbc[_0x7721('0x4a')]=[{'all':!![]}];}_0x135dbc=_['merge']({},_0x135dbc,_0xdb3033[_0x7721('0x48')]);return db[_0x7721('0x35')][_0x7721('0x50')](_0x135dbc)['then'](handleEntityNotFound(_0x2d5f35,null))[_0x7721('0x29')](respondWithResult(_0x2d5f35,null))[_0x7721('0x4c')](handleError(_0x2d5f35,null));};exports['create']=function(_0x223d93,_0x1196c2){return db[_0x7721('0x35')]['create'](_0x223d93[_0x7721('0x51')],{})['then'](function(_0xdb1ca8){var _0x310549=_0x223d93[_0x7721('0x52')][_0x7721('0x2b')]({'plain':!![]});if(!_0x310549)throw new Error(_0x7721('0x53'));if(_0x310549[_0x7721('0x54')]===_0x7721('0x52')){var _0x7fbb73=_0xdb1ca8[_0x7721('0x2b')]({'plain':!![]});var _0x3386aa=_0x7721('0x2c');return db[_0x7721('0x55')][_0x7721('0x50')]({'where':{'name':_0x3386aa,'userProfileId':_0x310549[_0x7721('0x56')]},'raw':!![]})[_0x7721('0x29')](function(_0x5b741d){if(_0x5b741d&&_0x5b741d[_0x7721('0x57')]===0x0){return db[_0x7721('0x2d')][_0x7721('0x58')]({'name':_0x7fbb73[_0x7721('0x31')],'resourceId':_0x7fbb73['id'],'type':_0x5b741d[_0x7721('0x31')],'sectionId':_0x5b741d['id']},{})[_0x7721('0x29')](function(){return _0xdb1ca8;});}else{return _0xdb1ca8;}})[_0x7721('0x4c')](function(_0x57484c){logger[_0x7721('0x2f')](_0x7721('0x59'),_0x57484c);throw _0x57484c;});}return _0xdb1ca8;})[_0x7721('0x29')](respondWithResult(_0x1196c2,0xc9))[_0x7721('0x4c')](handleError(_0x1196c2,null));};exports[_0x7721('0x28')]=function(_0x9c0d4,_0x7fbd6c){if(_0x9c0d4[_0x7721('0x51')]['id']){delete _0x9c0d4[_0x7721('0x51')]['id'];}return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x9c0d4['params']['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x7fbd6c,null))[_0x7721('0x29')](saveUpdates(_0x9c0d4[_0x7721('0x51')],null))[_0x7721('0x29')](respondWithResult(_0x7fbd6c,null))[_0x7721('0x4c')](handleError(_0x7fbd6c,null));};exports[_0x7721('0x2a')]=function(_0x41644f,_0x36fe6f){return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x41644f[_0x7721('0x4e')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x36fe6f,null))[_0x7721('0x29')](removeEntity(_0x36fe6f,null))[_0x7721('0x4c')](handleError(_0x36fe6f,null));};
\ No newline at end of file
+var _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x504d47,_0x5e604b){var _0x55cba4=function(_0xb7e707){while(--_0xb7e707){_0x504d47['push'](_0x504d47['shift']());}};_0x55cba4(++_0x5e604b);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x143a91,_0x235332){_0x143a91=_0x143a91-0x0;var _0x1906f5=_0xf2ca[_0x143a91];return _0x1906f5;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index e4c45d5..1f98fc4 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 _0x4553=['rimraf','../../config/environment','./analyticMetric.attributes','exports','define','analytics_metrics','util','../../config/logger','api','request-promise','path'];(function(_0x1cb649,_0xfb8c74){var _0x11d19f=function(_0x5c97d6){while(--_0x5c97d6){_0x1cb649['push'](_0x1cb649['shift']());}};_0x11d19f(++_0xfb8c74);}(_0x4553,0x1be));var _0x3455=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x4553[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require('lodash');var util=require(_0x3455('0x0'));var logger=require(_0x3455('0x1'))(_0x3455('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3455('0x3'));var fs=require('fs');var path=require(_0x3455('0x4'));var rimraf=require(_0x3455('0x5'));var config=require(_0x3455('0x6'));var attributes=require(_0x3455('0x7'));module[_0x3455('0x8')]=function(_0x2aa1ed,_0x4010cd){return _0x2aa1ed[_0x3455('0x9')]('AnalyticMetric',attributes,{'tableName':_0x3455('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb2ad=['path','../../config/environment','./analyticMetric.attributes','exports','analytics_metrics','util','api','moment','bluebird','request-promise'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb2ad,0x16d));var _0xdb2a=function(_0x15afeb,_0x3eb360){_0x15afeb=_0x15afeb-0x0;var _0x3ce58d=_0xb2ad[_0x15afeb];return _0x3ce58d;};'use strict';var _=require('lodash');var util=require(_0xdb2a('0x0'));var logger=require('../../config/logger')(_0xdb2a('0x1'));var moment=require(_0xdb2a('0x2'));var BPromise=require(_0xdb2a('0x3'));var rp=require(_0xdb2a('0x4'));var fs=require('fs');var path=require(_0xdb2a('0x5'));var rimraf=require('rimraf');var config=require(_0xdb2a('0x6'));var attributes=require(_0xdb2a('0x7'));module[_0xdb2a('0x8')]=function(_0x1f9551,_0x5c69b1){return _0x1f9551['define']('AnalyticMetric',attributes,{'tableName':_0xdb2a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 01559ef..e2d7584 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 _0x10ad=['../../config/utils','rpc','../../config/environment','jayson/promise','request','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x36bf09,_0x2652b0){var _0x4e4d60=function(_0x1ec61f){while(--_0x1ec61f){_0x36bf09['push'](_0x36bf09['shift']());}};_0x4e4d60(++_0x2652b0);}(_0x10ad,0x1d6));var _0xd10a=function(_0x6b4fe4,_0x4f2c29){_0x6b4fe4=_0x6b4fe4-0x0;var _0x46b758=_0x10ad[_0x6b4fe4];return _0x46b758;};'use strict';var _=require(_0xd10a('0x0'));var util=require(_0xd10a('0x1'));var moment=require(_0xd10a('0x2'));var BPromise=require(_0xd10a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd10a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd10a('0x5'));var logger=require('../../config/logger')(_0xd10a('0x6'));var config=require(_0xd10a('0x7'));var jayson=require(_0xd10a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2572b7,_0x57d9d,_0x70b504){return new BPromise(function(_0x2bd527,_0x3c0ad9){return client[_0xd10a('0x9')](_0x2572b7,_0x70b504)['then'](function(_0x25e808){logger['info'](_0xd10a('0xa'),_0x57d9d,_0xd10a('0xb'));logger[_0xd10a('0xc')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x57d9d,_0xd10a('0xb'),JSON[_0xd10a('0xd')](_0x25e808));if(_0x25e808['error']){if(_0x25e808[_0xd10a('0xe')][_0xd10a('0xf')]===0x1f4){logger['error'](_0xd10a('0xa'),_0x57d9d,_0x25e808[_0xd10a('0xe')][_0xd10a('0x10')]);return _0x3c0ad9(_0x25e808[_0xd10a('0xe')][_0xd10a('0x10')]);}logger[_0xd10a('0xe')](_0xd10a('0xa'),_0x57d9d,_0x25e808[_0xd10a('0xe')]['message']);return _0x2bd527(_0x25e808[_0xd10a('0xe')]['message']);}else{logger[_0xd10a('0x11')](_0xd10a('0xa'),_0x57d9d,'request\x20sent');_0x2bd527(_0x25e808['result']['message']);}})[_0xd10a('0x12')](function(_0x207613){logger[_0xd10a('0xe')](_0xd10a('0xa'),_0x57d9d,_0x207613);_0x3c0ad9(_0x207613);});});}
\ No newline at end of file
+var _0x7f9c=['error','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','code'];(function(_0x23c73d,_0x357b21){var _0x36ba47=function(_0x317b8e){while(--_0x317b8e){_0x23c73d['push'](_0x23c73d['shift']());}};_0x36ba47(++_0x357b21);}(_0x7f9c,0x9e));var _0xc7f9=function(_0x33e5e2,_0x10d7a8){_0x33e5e2=_0x33e5e2-0x0;var _0x21e5af=_0x7f9c[_0x33e5e2];return _0x21e5af;};'use strict';var _=require('lodash');var util=require(_0xc7f9('0x0'));var moment=require(_0xc7f9('0x1'));var BPromise=require('bluebird');var rs=require(_0xc7f9('0x2'));var fs=require('fs');var Redis=require(_0xc7f9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc7f9('0x4'));var logger=require(_0xc7f9('0x5'))(_0xc7f9('0x6'));var config=require(_0xc7f9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc7f9('0x8')][_0xc7f9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e7d17,_0x3e7d2a,_0x494665){return new BPromise(function(_0x32e53a,_0x5b3e36){return client[_0xc7f9('0xa')](_0x3e7d17,_0x494665)[_0xc7f9('0xb')](function(_0x4004fb){logger[_0xc7f9('0xc')](_0xc7f9('0xd'),_0x3e7d2a,_0xc7f9('0xe'));logger[_0xc7f9('0xf')](_0xc7f9('0x10'),_0x3e7d2a,_0xc7f9('0xe'),JSON['stringify'](_0x4004fb));if(_0x4004fb['error']){if(_0x4004fb['error'][_0xc7f9('0x11')]===0x1f4){logger['error'](_0xc7f9('0xd'),_0x3e7d2a,_0x4004fb[_0xc7f9('0x12')]['message']);return _0x5b3e36(_0x4004fb[_0xc7f9('0x12')][_0xc7f9('0x13')]);}logger[_0xc7f9('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x3e7d2a,_0x4004fb[_0xc7f9('0x12')][_0xc7f9('0x13')]);return _0x32e53a(_0x4004fb[_0xc7f9('0x12')][_0xc7f9('0x13')]);}else{logger[_0xc7f9('0xc')](_0xc7f9('0xd'),_0x3e7d2a,'request\x20sent');_0x32e53a(_0x4004fb[_0xc7f9('0x14')][_0xc7f9('0x13')]);}})[_0xc7f9('0x15')](function(_0x53efd2){logger[_0xc7f9('0x12')](_0xc7f9('0xd'),_0x3e7d2a,_0x53efd2);_0x5b3e36(_0x53efd2);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 3bf9265..a62a576 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 _0x60c2=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show','create','put','update'];(function(_0x3c571c,_0x23ee57){var _0x19c4ab=function(_0x1494c8){while(--_0x1494c8){_0x3c571c['push'](_0x3c571c['shift']());}};_0x19c4ab(++_0x23ee57);}(_0x60c2,0x8f));var _0x260c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x60c2[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require(_0x260c('0x0'));var path=require(_0x260c('0x1'));var timeout=require(_0x260c('0x2'));var express=require(_0x260c('0x3'));var router=express[_0x260c('0x4')]();var fs_extra=require(_0x260c('0x5'));var auth=require(_0x260c('0x6'));var interaction=require(_0x260c('0x7'));var config=require(_0x260c('0x8'));var controller=require(_0x260c('0x9'));router[_0x260c('0xa')]('/',auth[_0x260c('0xb')](),controller['index']);router[_0x260c('0xa')](_0x260c('0xc'),auth[_0x260c('0xb')](),controller[_0x260c('0xd')]);router['post']('/',auth[_0x260c('0xb')](),controller[_0x260c('0xe')]);router[_0x260c('0xf')](_0x260c('0xc'),auth[_0x260c('0xb')](),controller[_0x260c('0x10')]);router[_0x260c('0x11')]('/:id',auth[_0x260c('0xb')](),controller[_0x260c('0x12')]);module[_0x260c('0x13')]=router;
\ No newline at end of file
+var _0x624c=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','destroy'];(function(_0x542641,_0x7615ab){var _0x26a17a=function(_0x340089){while(--_0x340089){_0x542641['push'](_0x542641['shift']());}};_0x26a17a(++_0x7615ab);}(_0x624c,0x1ee));var _0xc624=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x624c[_0x12fc8d];return _0x3f9d04;};'use strict';var multer=require('multer');var util=require(_0xc624('0x0'));var path=require(_0xc624('0x1'));var timeout=require(_0xc624('0x2'));var express=require(_0xc624('0x3'));var router=express[_0xc624('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc624('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc624('0x6'));var controller=require('./analyticMetric.controller');router[_0xc624('0x7')]('/',auth[_0xc624('0x8')](),controller[_0xc624('0x9')]);router[_0xc624('0x7')](_0xc624('0xa'),auth[_0xc624('0x8')](),controller[_0xc624('0xb')]);router['post']('/',auth[_0xc624('0x8')](),controller[_0xc624('0xc')]);router[_0xc624('0xd')]('/:id',auth[_0xc624('0x8')](),controller[_0xc624('0xe')]);router['delete'](_0xc624('0xa'),auth[_0xc624('0x8')](),controller[_0xc624('0xf')]);module[_0xc624('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index ca14b1e..852cf4b 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 _0x5923=['exports'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x5923,0x102));var _0x3592=function(_0x1ed8e0,_0x17f2a4){_0x1ed8e0=_0x1ed8e0-0x0;var _0x5d9541=_0x5923[_0x1ed8e0];return _0x5d9541;};'use strict';var Sequelize=require('sequelize');module[_0x3592('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x7717=['exports','TEXT','sequelize'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0x7717,0x11f));var _0x7771=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7717[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x7771('0x0'));module[_0x7771('0x1')]={'tree':{'type':Sequelize[_0x7771('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 8bd94ad..a9a7a48 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 _0x42f1=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x2d5351,_0x4af07c){var _0x5ef04a=function(_0x2cb358){while(--_0x2cb358){_0x2d5351['push'](_0x2d5351['shift']());}};_0x5ef04a(++_0x4af07c);}(_0x42f1,0x14d));var _0x142f=function(_0x43e8e8,_0x2375a9){_0x43e8e8=_0x43e8e8-0x0;var _0x59e260=_0x42f1[_0x43e8e8];return _0x59e260;};'use strict';var emlformat=require(_0x142f('0x0'));var rimraf=require(_0x142f('0x1'));var zipdir=require(_0x142f('0x2'));var jsonpatch=require(_0x142f('0x3'));var rp=require(_0x142f('0x4'));var moment=require('moment');var BPromise=require(_0x142f('0x5'));var Mustache=require(_0x142f('0x6'));var util=require('util');var path=require(_0x142f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x142f('0x8'));var _=require(_0x142f('0x9'));var squel=require(_0x142f('0xa'));var crypto=require(_0x142f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x142f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x142f('0xd'));var Papa=require('papaparse');var Redis=require(_0x142f('0xe'));var authService=require(_0x142f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x142f('0x10'));var hardwareService=require(_0x142f('0x11'));var logger=require(_0x142f('0x12'))('api');var utils=require(_0x142f('0x13'));var config=require(_0x142f('0x14'));var licenseUtil=require(_0x142f('0x15'));var db=require(_0x142f('0x16'))['db'];function respondWithStatusCode(_0x4ce120,_0x29d653){_0x29d653=_0x29d653||0xcc;return function(_0x341d8e){if(_0x341d8e){return _0x4ce120[_0x142f('0x17')](_0x29d653);}return _0x4ce120['status'](_0x29d653)['end']();};}function respondWithResult(_0x344c8a,_0x6fdbb6){_0x6fdbb6=_0x6fdbb6||0xc8;return function(_0x875dea){if(_0x875dea){return _0x344c8a[_0x142f('0x18')](_0x6fdbb6)[_0x142f('0x19')](_0x875dea);}};}function respondWithFilteredResult(_0x1fdcdb,_0x3335ca){return function(_0x1f866f){if(_0x1f866f){var _0x51d353=typeof _0x3335ca[_0x142f('0x1a')]===_0x142f('0x1b')&&typeof _0x3335ca[_0x142f('0x1c')]===_0x142f('0x1b');var _0xe476fe=_0x1f866f[_0x142f('0x1d')];var _0x2a3980=_0x51d353?0x0:_0x3335ca[_0x142f('0x1a')];var _0x189d01=_0x51d353?_0x1f866f[_0x142f('0x1d')]:_0x3335ca['offset']+_0x3335ca[_0x142f('0x1c')];var _0x51d8b1;if(_0x189d01>=_0xe476fe){_0x189d01=_0xe476fe;_0x51d8b1=0xc8;}else{_0x51d8b1=0xce;}_0x1fdcdb[_0x142f('0x18')](_0x51d8b1);return _0x1fdcdb[_0x142f('0x1e')](_0x142f('0x1f'),_0x2a3980+'-'+_0x189d01+'/'+_0xe476fe)['json'](_0x1f866f);}return null;};}function patchUpdates(_0x3d9136){return function(_0x3a849f){try{jsonpatch[_0x142f('0x20')](_0x3a849f,_0x3d9136,!![]);}catch(_0x1a6488){return BPromise[_0x142f('0x21')](_0x1a6488);}return _0x3a849f['save']();};}function saveUpdates(_0x147d81,_0x1e74cb){return function(_0x533561){if(_0x533561){return _0x533561[_0x142f('0x22')](_0x147d81)[_0x142f('0x23')](function(_0x17e259){return _0x17e259;});}return null;};}function removeEntity(_0x1503ed,_0x18bdf0){return function(_0x318095){if(_0x318095){return _0x318095['destroy']()[_0x142f('0x23')](function(){_0x1503ed[_0x142f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e6546,_0x99dcca){return function(_0x1bf050){if(!_0x1bf050){_0x5e6546['sendStatus'](0x194);}return _0x1bf050;};}function handleError(_0x7e08d6,_0x1ec1df){_0x1ec1df=_0x1ec1df||0x1f4;return function(_0x191535){logger[_0x142f('0x24')](_0x191535['stack']);if(_0x191535[_0x142f('0x25')]){delete _0x191535[_0x142f('0x25')];}_0x7e08d6[_0x142f('0x18')](_0x1ec1df)[_0x142f('0x26')](_0x191535);};}exports[_0x142f('0x27')]=function(_0x224f78,_0x4a3376){var _0x5cab5d={},_0x4c8f23={},_0x32bed3={'count':0x0,'rows':[]};var _0x1f050d=_[_0x142f('0x28')](db[_0x142f('0x29')][_0x142f('0x2a')],function(_0x47a220){return{'name':_0x47a220[_0x142f('0x2b')],'type':_0x47a220[_0x142f('0x2c')]['key']};});_0x4c8f23[_0x142f('0x2d')]=_[_0x142f('0x28')](_0x1f050d,_0x142f('0x25'));_0x4c8f23['query']=_[_0x142f('0x2e')](_0x224f78[_0x142f('0x2f')]);_0x4c8f23[_0x142f('0x30')]=_[_0x142f('0x31')](_0x4c8f23[_0x142f('0x2d')],_0x4c8f23[_0x142f('0x2f')]);_0x5cab5d[_0x142f('0x32')]=_['intersection'](_0x4c8f23[_0x142f('0x2d')],qs[_0x142f('0x33')](_0x224f78[_0x142f('0x2f')][_0x142f('0x33')]));_0x5cab5d[_0x142f('0x32')]=_0x5cab5d['attributes'][_0x142f('0x34')]?_0x5cab5d[_0x142f('0x32')]:_0x4c8f23['model'];if(!_0x224f78[_0x142f('0x2f')][_0x142f('0x35')](_0x142f('0x36'))){_0x5cab5d[_0x142f('0x1c')]=qs[_0x142f('0x1c')](_0x224f78[_0x142f('0x2f')]['limit']);_0x5cab5d[_0x142f('0x1a')]=qs[_0x142f('0x1a')](_0x224f78['query']['offset']);}_0x5cab5d['order']=qs['sort'](_0x224f78[_0x142f('0x2f')][_0x142f('0x37')]);_0x5cab5d[_0x142f('0x38')]=qs['filters'](_[_0x142f('0x39')](_0x224f78[_0x142f('0x2f')],_0x4c8f23[_0x142f('0x30')]),_0x1f050d);if(_0x224f78['query'][_0x142f('0x3a')]){_0x5cab5d['where']=_[_0x142f('0x3b')](_0x5cab5d[_0x142f('0x38')],{'$or':_[_0x142f('0x28')](_0x1f050d,function(_0x304805){if(_0x304805[_0x142f('0x2c')]!==_0x142f('0x3c')){var _0x5f1cbe={};_0x5f1cbe[_0x304805[_0x142f('0x25')]]={'$like':'%'+_0x224f78[_0x142f('0x2f')][_0x142f('0x3a')]+'%'};return _0x5f1cbe;}})});}_0x5cab5d=_[_0x142f('0x3b')]({},_0x5cab5d,_0x224f78[_0x142f('0x3d')]);var _0x11aac8={'where':_0x5cab5d[_0x142f('0x38')]};return db[_0x142f('0x29')][_0x142f('0x1d')](_0x11aac8)['then'](function(_0x4d6fb4){_0x32bed3['count']=_0x4d6fb4;if(_0x224f78[_0x142f('0x2f')][_0x142f('0x3e')]){_0x5cab5d[_0x142f('0x3f')]=[{'all':!![]}];}return db[_0x142f('0x29')][_0x142f('0x40')](_0x5cab5d);})[_0x142f('0x23')](function(_0x42ae45){_0x32bed3['rows']=_0x42ae45;return _0x32bed3;})[_0x142f('0x23')](respondWithFilteredResult(_0x4a3376,_0x5cab5d))[_0x142f('0x41')](handleError(_0x4a3376,null));};exports[_0x142f('0x42')]=function(_0x10aa9d,_0x4be260){var _0x19075b={'raw':!![],'where':{'id':_0x10aa9d['params']['id']}},_0x3f203b={};_0x3f203b[_0x142f('0x2d')]=_[_0x142f('0x2e')](db[_0x142f('0x29')][_0x142f('0x2a')]);_0x3f203b[_0x142f('0x2f')]=_['keys'](_0x10aa9d[_0x142f('0x2f')]);_0x3f203b[_0x142f('0x30')]=_[_0x142f('0x31')](_0x3f203b[_0x142f('0x2d')],_0x3f203b[_0x142f('0x2f')]);_0x19075b[_0x142f('0x32')]=_[_0x142f('0x31')](_0x3f203b[_0x142f('0x2d')],qs['fields'](_0x10aa9d[_0x142f('0x2f')][_0x142f('0x33')]));_0x19075b[_0x142f('0x32')]=_0x19075b['attributes'][_0x142f('0x34')]?_0x19075b[_0x142f('0x32')]:_0x3f203b['model'];if(_0x10aa9d['query'][_0x142f('0x3e')]){_0x19075b[_0x142f('0x3f')]=[{'all':!![]}];}_0x19075b=_[_0x142f('0x3b')]({},_0x19075b,_0x10aa9d[_0x142f('0x3d')]);return db[_0x142f('0x29')][_0x142f('0x43')](_0x19075b)[_0x142f('0x23')](handleEntityNotFound(_0x4be260,null))[_0x142f('0x23')](respondWithResult(_0x4be260,null))[_0x142f('0x41')](handleError(_0x4be260,null));};exports[_0x142f('0x44')]=function(_0x515c94,_0x7b0fd){return db[_0x142f('0x29')][_0x142f('0x44')](_0x515c94[_0x142f('0x45')],{})[_0x142f('0x23')](respondWithResult(_0x7b0fd,0xc9))[_0x142f('0x41')](handleError(_0x7b0fd,null));};exports['update']=function(_0x2c1954,_0x1e7bd2){if(_0x2c1954[_0x142f('0x45')]['id']){delete _0x2c1954[_0x142f('0x45')]['id'];}return db[_0x142f('0x29')][_0x142f('0x43')]({'where':{'id':_0x2c1954[_0x142f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1e7bd2,null))[_0x142f('0x23')](saveUpdates(_0x2c1954[_0x142f('0x45')],null))[_0x142f('0x23')](respondWithResult(_0x1e7bd2,null))['catch'](handleError(_0x1e7bd2,null));};exports['destroy']=function(_0x1cace1,_0x3e0e22){return db[_0x142f('0x29')][_0x142f('0x43')]({'where':{'id':_0x1cace1[_0x142f('0x46')]['id']}})[_0x142f('0x23')](handleEntityNotFound(_0x3e0e22,null))[_0x142f('0x23')](removeEntity(_0x3e0e22,null))[_0x142f('0x41')](handleError(_0x3e0e22,null));};
\ No newline at end of file
+var _0x6584=['Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0x6584,0xc9));var _0x4658=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x6584[_0x1b349a];return _0x5d1f7c;};'use strict';var emlformat=require(_0x4658('0x0'));var rimraf=require(_0x4658('0x1'));var zipdir=require(_0x4658('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4658('0x3'));var moment=require(_0x4658('0x4'));var BPromise=require(_0x4658('0x5'));var Mustache=require(_0x4658('0x6'));var util=require(_0x4658('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4658('0x8'));var ejs=require(_0x4658('0x9'));var fs=require('fs');var fs_extra=require(_0x4658('0xa'));var _=require(_0x4658('0xb'));var squel=require(_0x4658('0xc'));var crypto=require(_0x4658('0xd'));var jsforce=require(_0x4658('0xe'));var deskjs=require(_0x4658('0xf'));var toCsv=require(_0x4658('0x8'));var querystring=require(_0x4658('0x10'));var Papa=require(_0x4658('0x11'));var Redis=require(_0x4658('0x12'));var authService=require(_0x4658('0x13'));var qs=require(_0x4658('0x14'));var as=require(_0x4658('0x15'));var hardwareService=require(_0x4658('0x16'));var logger=require(_0x4658('0x17'))('api');var utils=require(_0x4658('0x18'));var config=require(_0x4658('0x19'));var licenseUtil=require(_0x4658('0x1a'));var db=require(_0x4658('0x1b'))['db'];function respondWithStatusCode(_0x172dd0,_0x1d634b){_0x1d634b=_0x1d634b||0xcc;return function(_0x3e720e){if(_0x3e720e){return _0x172dd0['sendStatus'](_0x1d634b);}return _0x172dd0[_0x4658('0x1c')](_0x1d634b)[_0x4658('0x1d')]();};}function respondWithResult(_0x277607,_0x2e1e01){_0x2e1e01=_0x2e1e01||0xc8;return function(_0x5d3daf){if(_0x5d3daf){return _0x277607[_0x4658('0x1c')](_0x2e1e01)[_0x4658('0x1e')](_0x5d3daf);}};}function respondWithFilteredResult(_0x289e30,_0x48c219){return function(_0x996259){if(_0x996259){var _0x4dc572=typeof _0x48c219[_0x4658('0x1f')]==='undefined'&&typeof _0x48c219['limit']===_0x4658('0x20');var _0x1b13ec=_0x996259[_0x4658('0x21')];var _0x388331=_0x4dc572?0x0:_0x48c219[_0x4658('0x1f')];var _0x264729=_0x4dc572?_0x996259[_0x4658('0x21')]:_0x48c219[_0x4658('0x1f')]+_0x48c219[_0x4658('0x22')];var _0x256584;if(_0x264729>=_0x1b13ec){_0x264729=_0x1b13ec;_0x256584=0xc8;}else{_0x256584=0xce;}_0x289e30[_0x4658('0x1c')](_0x256584);return _0x289e30[_0x4658('0x23')](_0x4658('0x24'),_0x388331+'-'+_0x264729+'/'+_0x1b13ec)['json'](_0x996259);}return null;};}function patchUpdates(_0x54c1ce){return function(_0x39878a){try{jsonpatch[_0x4658('0x25')](_0x39878a,_0x54c1ce,!![]);}catch(_0x5bb225){return BPromise[_0x4658('0x26')](_0x5bb225);}return _0x39878a[_0x4658('0x27')]();};}function saveUpdates(_0x5943f1,_0x2eeb44){return function(_0xc1852b){if(_0xc1852b){return _0xc1852b[_0x4658('0x28')](_0x5943f1)[_0x4658('0x29')](function(_0x281773){return _0x281773;});}return null;};}function removeEntity(_0x109270,_0x420c0a){return function(_0x513a7a){if(_0x513a7a){return _0x513a7a[_0x4658('0x2a')]()[_0x4658('0x29')](function(){_0x109270[_0x4658('0x1c')](0xcc)[_0x4658('0x1d')]();});}};}function handleEntityNotFound(_0x1f971c,_0x5b6a2d){return function(_0x52935f){if(!_0x52935f){_0x1f971c['sendStatus'](0x194);}return _0x52935f;};}function handleError(_0x59a953,_0x4dff03){_0x4dff03=_0x4dff03||0x1f4;return function(_0x562967){logger[_0x4658('0x2b')](_0x562967['stack']);if(_0x562967[_0x4658('0x2c')]){delete _0x562967[_0x4658('0x2c')];}_0x59a953[_0x4658('0x1c')](_0x4dff03)[_0x4658('0x2d')](_0x562967);};}exports[_0x4658('0x2e')]=function(_0x457090,_0x260d4e){var _0x6e361a={},_0x1d5274={},_0x37f5cd={'count':0x0,'rows':[]};var _0x5e1ed8=_[_0x4658('0x2f')](db[_0x4658('0x30')][_0x4658('0x31')],function(_0x57949e){return{'name':_0x57949e[_0x4658('0x32')],'type':_0x57949e[_0x4658('0x33')]['key']};});_0x1d5274[_0x4658('0x34')]=_[_0x4658('0x2f')](_0x5e1ed8,_0x4658('0x2c'));_0x1d5274[_0x4658('0x35')]=_[_0x4658('0x36')](_0x457090['query']);_0x1d5274[_0x4658('0x37')]=_[_0x4658('0x38')](_0x1d5274[_0x4658('0x34')],_0x1d5274[_0x4658('0x35')]);_0x6e361a[_0x4658('0x39')]=_['intersection'](_0x1d5274['model'],qs[_0x4658('0x3a')](_0x457090[_0x4658('0x35')][_0x4658('0x3a')]));_0x6e361a[_0x4658('0x39')]=_0x6e361a[_0x4658('0x39')][_0x4658('0x3b')]?_0x6e361a[_0x4658('0x39')]:_0x1d5274[_0x4658('0x34')];if(!_0x457090[_0x4658('0x35')][_0x4658('0x3c')](_0x4658('0x3d'))){_0x6e361a[_0x4658('0x22')]=qs[_0x4658('0x22')](_0x457090[_0x4658('0x35')]['limit']);_0x6e361a[_0x4658('0x1f')]=qs[_0x4658('0x1f')](_0x457090[_0x4658('0x35')]['offset']);}_0x6e361a[_0x4658('0x3e')]=qs['sort'](_0x457090[_0x4658('0x35')][_0x4658('0x3f')]);_0x6e361a[_0x4658('0x40')]=qs[_0x4658('0x37')](_[_0x4658('0x41')](_0x457090[_0x4658('0x35')],_0x1d5274[_0x4658('0x37')]),_0x5e1ed8);if(_0x457090[_0x4658('0x35')]['filter']){_0x6e361a[_0x4658('0x40')]=_['merge'](_0x6e361a[_0x4658('0x40')],{'$or':_[_0x4658('0x2f')](_0x5e1ed8,function(_0x2bec7c){if(_0x2bec7c[_0x4658('0x33')]!==_0x4658('0x42')){var _0x235965={};_0x235965[_0x2bec7c[_0x4658('0x2c')]]={'$like':'%'+_0x457090['query'][_0x4658('0x43')]+'%'};return _0x235965;}})});}_0x6e361a=_[_0x4658('0x44')]({},_0x6e361a,_0x457090[_0x4658('0x45')]);var _0x232e37={'where':_0x6e361a['where']};return db[_0x4658('0x30')][_0x4658('0x21')](_0x232e37)[_0x4658('0x29')](function(_0xb27599){_0x37f5cd[_0x4658('0x21')]=_0xb27599;if(_0x457090[_0x4658('0x35')][_0x4658('0x46')]){_0x6e361a[_0x4658('0x47')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x6e361a);})[_0x4658('0x29')](function(_0x1a52fd){_0x37f5cd[_0x4658('0x48')]=_0x1a52fd;return _0x37f5cd;})[_0x4658('0x29')](respondWithFilteredResult(_0x260d4e,_0x6e361a))[_0x4658('0x49')](handleError(_0x260d4e,null));};exports[_0x4658('0x4a')]=function(_0x7ee94e,_0x348536){var _0x57e3bc={'raw':!![],'where':{'id':_0x7ee94e[_0x4658('0x4b')]['id']}},_0xa9c056={};_0xa9c056['model']=_[_0x4658('0x36')](db[_0x4658('0x30')][_0x4658('0x31')]);_0xa9c056[_0x4658('0x35')]=_[_0x4658('0x36')](_0x7ee94e[_0x4658('0x35')]);_0xa9c056['filters']=_[_0x4658('0x38')](_0xa9c056[_0x4658('0x34')],_0xa9c056[_0x4658('0x35')]);_0x57e3bc[_0x4658('0x39')]=_[_0x4658('0x38')](_0xa9c056[_0x4658('0x34')],qs[_0x4658('0x3a')](_0x7ee94e[_0x4658('0x35')][_0x4658('0x3a')]));_0x57e3bc[_0x4658('0x39')]=_0x57e3bc[_0x4658('0x39')][_0x4658('0x3b')]?_0x57e3bc[_0x4658('0x39')]:_0xa9c056[_0x4658('0x34')];if(_0x7ee94e[_0x4658('0x35')][_0x4658('0x46')]){_0x57e3bc[_0x4658('0x47')]=[{'all':!![]}];}_0x57e3bc=_[_0x4658('0x44')]({},_0x57e3bc,_0x7ee94e[_0x4658('0x45')]);return db[_0x4658('0x30')][_0x4658('0x4c')](_0x57e3bc)['then'](handleEntityNotFound(_0x348536,null))['then'](respondWithResult(_0x348536,null))[_0x4658('0x49')](handleError(_0x348536,null));};exports['create']=function(_0x434e97,_0x3b4713){return db[_0x4658('0x30')][_0x4658('0x4d')](_0x434e97[_0x4658('0x4e')],{})[_0x4658('0x29')](respondWithResult(_0x3b4713,0xc9))[_0x4658('0x49')](handleError(_0x3b4713,null));};exports[_0x4658('0x28')]=function(_0x3854ab,_0x9ea70c){if(_0x3854ab['body']['id']){delete _0x3854ab[_0x4658('0x4e')]['id'];}return db[_0x4658('0x30')][_0x4658('0x4c')]({'where':{'id':_0x3854ab[_0x4658('0x4b')]['id']}})[_0x4658('0x29')](handleEntityNotFound(_0x9ea70c,null))[_0x4658('0x29')](saveUpdates(_0x3854ab[_0x4658('0x4e')],null))[_0x4658('0x29')](respondWithResult(_0x9ea70c,null))[_0x4658('0x49')](handleError(_0x9ea70c,null));};exports[_0x4658('0x2a')]=function(_0x546a38,_0x506a98){return db[_0x4658('0x30')]['find']({'where':{'id':_0x546a38[_0x4658('0x4b')]['id']}})['then'](handleEntityNotFound(_0x506a98,null))[_0x4658('0x29')](removeEntity(_0x506a98,null))[_0x4658('0x49')](handleError(_0x506a98,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 36e31f0..1ccb4d7 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 _0xd139=['rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','../../config/logger','bluebird','path'];(function(_0x3eb800,_0x263792){var _0x32b52f=function(_0x5d6ae3){while(--_0x5d6ae3){_0x3eb800['push'](_0x3eb800['shift']());}};_0x32b52f(++_0x263792);}(_0xd139,0x7e));var _0x9d13=function(_0x4c687d,_0x9d62f){_0x4c687d=_0x4c687d-0x0;var _0x1ae390=_0xd139[_0x4c687d];return _0x1ae390;};'use strict';var _=require(_0x9d13('0x0'));var util=require('util');var logger=require(_0x9d13('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9d13('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9d13('0x3'));var rimraf=require(_0x9d13('0x4'));var config=require(_0x9d13('0x5'));var attributes=require(_0x9d13('0x6'));module[_0x9d13('0x7')]=function(_0x542a75,_0x416eff){return _0x542a75[_0x9d13('0x8')](_0x9d13('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd17d=['rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','bluebird'];(function(_0x29f3e0,_0x486ad1){var _0x32fa40=function(_0x452c1c){while(--_0x452c1c){_0x29f3e0['push'](_0x29f3e0['shift']());}};_0x32fa40(++_0x486ad1);}(_0xd17d,0x1c8));var _0xdd17=function(_0x6dd9,_0x58c745){_0x6dd9=_0x6dd9-0x0;var _0x29423f=_0xd17d[_0x6dd9];return _0x29423f;};'use strict';var _=require(_0xdd17('0x0'));var util=require(_0xdd17('0x1'));var logger=require(_0xdd17('0x2'))('api');var moment=require('moment');var BPromise=require(_0xdd17('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdd17('0x4'));var config=require('../../config/environment');var attributes=require(_0xdd17('0x5'));module[_0xdd17('0x6')]=function(_0x530891,_0x44f6c2){return _0x530891[_0xdd17('0x7')](_0xdd17('0x8'),attributes,{'tableName':_0xdd17('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 d6bd954..b1c2fd3 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x436713,_0x16e96c){var _0x5661b7=function(_0x2ede72){while(--_0x2ede72){_0x436713['push'](_0x436713['shift']());}};_0x5661b7(++_0x16e96c);}(_0xdb28,0x106));var _0x8db2=function(_0x441183,_0x5bb7f9){_0x441183=_0x441183-0x0;var _0x294587=_0xdb28[_0x441183];return _0x294587;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
+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(_0x3df935,_0x2f6877){var _0x152412=function(_0x213b98){while(--_0x213b98){_0x3df935['push'](_0x3df935['shift']());}};_0x152412(++_0x2f6877);}(_0xadb5,0xad));var _0x5adb=function(_0x110f97,_0x643432){_0x110f97=_0x110f97-0x0;var _0x19cf55=_0xadb5[_0x110f97];return _0x19cf55;};'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
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 76be789..0731082 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 _0x0d1b=['isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get'];(function(_0x38c6b4,_0x8a6bca){var _0x4c45e4=function(_0x9cf700){while(--_0x9cf700){_0x38c6b4['push'](_0x38c6b4['shift']());}};_0x4c45e4(++_0x8a6bca);}(_0x0d1b,0x8f));var _0xb0d1=function(_0x385edd,_0x2a40e1){_0x385edd=_0x385edd-0x0;var _0x3083d0=_0x0d1b[_0x385edd];return _0x3083d0;};'use strict';var multer=require('multer');var util=require(_0xb0d1('0x0'));var path=require(_0xb0d1('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb0d1('0x2')]();var fs_extra=require(_0xb0d1('0x3'));var auth=require(_0xb0d1('0x4'));var interaction=require(_0xb0d1('0x5'));var config=require(_0xb0d1('0x6'));var controller=require(_0xb0d1('0x7'));router[_0xb0d1('0x8')]('/',auth[_0xb0d1('0x9')](),controller[_0xb0d1('0xa')]);router['get'](_0xb0d1('0xb'),auth['isAuthenticated'](),controller[_0xb0d1('0xc')]);router[_0xb0d1('0xd')]('/',auth[_0xb0d1('0x9')](),controller[_0xb0d1('0xe')]);router['put']('/:id',auth[_0xb0d1('0x9')](),controller[_0xb0d1('0xf')]);router[_0xb0d1('0x10')](_0xb0d1('0xb'),auth[_0xb0d1('0x9')](),controller[_0xb0d1('0x11')]);module[_0xb0d1('0x12')]=router;
\ No newline at end of file
+var _0xb4c7=['get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x146312,_0x5bd7af){var _0x1b0b27=function(_0x46d1ec){while(--_0x46d1ec){_0x146312['push'](_0x146312['shift']());}};_0x1b0b27(++_0x5bd7af);}(_0xb4c7,0x1eb));var _0x7b4c=function(_0x41ebe4,_0x2c44b5){_0x41ebe4=_0x41ebe4-0x0;var _0x164bef=_0xb4c7[_0x41ebe4];return _0x164bef;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express[_0x7b4c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require('./analyticTreeReport.controller');router[_0x7b4c('0x9')]('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xb')]);router['get'](_0x7b4c('0xc'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xd')]);router[_0x7b4c('0xe')]('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x7b4c('0x10')]);router[_0x7b4c('0x11')]('/:id',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x12')]);module[_0x7b4c('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index b0b041e..65eb767 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 _0xf675=['STRING','sequelize','exports'];(function(_0x4d3de3,_0x1ea983){var _0x36becc=function(_0x537964){while(--_0x537964){_0x4d3de3['push'](_0x4d3de3['shift']());}};_0x36becc(++_0x1ea983);}(_0xf675,0x199));var _0x5f67=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xf675[_0x47b58b];return _0x46bebe;};'use strict';var Sequelize=require(_0x5f67('0x0'));module[_0x5f67('0x1')]={'name':{'type':Sequelize[_0x5f67('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5f67('0x2')]}};
\ No newline at end of file
+var _0x8f7d=['exports','STRING','sequelize'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x8f7d,0xf5));var _0xd8f7=function(_0x52eca4,_0x2afd62){_0x52eca4=_0x52eca4-0x0;var _0x1366b9=_0x8f7d[_0x52eca4];return _0x1366b9;};'use strict';var Sequelize=require(_0xd8f7('0x0'));module[_0xd8f7('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xd8f7('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 960b2ae..6d69efe 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 _0xf675=['findAll','catch','show','params','find','get','omit','body','createdAt','create','file','originalname','mimetype','join','root','server/files/attachments/','offline-chat/','basename','download','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include'];(function(_0x179038,_0x2cd85e){var _0x2a4761=function(_0x258601){while(--_0x258601){_0x179038['push'](_0x179038['shift']());}};_0x2a4761(++_0x2cd85e);}(_0xf675,0x163));var _0x5f67=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xf675[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0x5f67('0x0'));var rimraf=require(_0x5f67('0x1'));var zipdir=require(_0x5f67('0x2'));var jsonpatch=require(_0x5f67('0x3'));var rp=require('request-promise');var moment=require(_0x5f67('0x4'));var BPromise=require(_0x5f67('0x5'));var Mustache=require(_0x5f67('0x6'));var util=require(_0x5f67('0x7'));var path=require(_0x5f67('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5f67('0x9'));var _=require(_0x5f67('0xa'));var squel=require(_0x5f67('0xb'));var crypto=require(_0x5f67('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5f67('0xd'));var querystring=require(_0x5f67('0xe'));var Papa=require(_0x5f67('0xf'));var Redis=require(_0x5f67('0x10'));var authService=require(_0x5f67('0x11'));var qs=require(_0x5f67('0x12'));var as=require(_0x5f67('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5f67('0x14'))(_0x5f67('0x15'));var utils=require(_0x5f67('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5f67('0x17'))['db'];function respondWithStatusCode(_0x3a62da,_0x3856df){_0x3856df=_0x3856df||0xcc;return function(_0x284d7e){if(_0x284d7e){return _0x3a62da['sendStatus'](_0x3856df);}return _0x3a62da[_0x5f67('0x18')](_0x3856df)['end']();};}function respondWithResult(_0x4854ae,_0x424790){_0x424790=_0x424790||0xc8;return function(_0x4208ae){if(_0x4208ae){return _0x4854ae[_0x5f67('0x18')](_0x424790)[_0x5f67('0x19')](_0x4208ae);}};}function respondWithFilteredResult(_0x291f4e,_0x5949bf){return function(_0x43b7c9){if(_0x43b7c9){var _0x39542c=typeof _0x5949bf['offset']===_0x5f67('0x1a')&&typeof _0x5949bf[_0x5f67('0x1b')]===_0x5f67('0x1a');var _0x1feb20=_0x43b7c9[_0x5f67('0x1c')];var _0x251e1b=_0x39542c?0x0:_0x5949bf['offset'];var _0x4d764e=_0x39542c?_0x43b7c9[_0x5f67('0x1c')]:_0x5949bf[_0x5f67('0x1d')]+_0x5949bf[_0x5f67('0x1b')];var _0x5a17f9;if(_0x4d764e>=_0x1feb20){_0x4d764e=_0x1feb20;_0x5a17f9=0xc8;}else{_0x5a17f9=0xce;}_0x291f4e[_0x5f67('0x18')](_0x5a17f9);return _0x291f4e['set']('Content-Range',_0x251e1b+'-'+_0x4d764e+'/'+_0x1feb20)[_0x5f67('0x19')](_0x43b7c9);}return null;};}function patchUpdates(_0x455703){return function(_0x4be9be){try{jsonpatch[_0x5f67('0x1e')](_0x4be9be,_0x455703,!![]);}catch(_0x1eeeab){return BPromise[_0x5f67('0x1f')](_0x1eeeab);}return _0x4be9be[_0x5f67('0x20')]();};}function saveUpdates(_0x3d10dd,_0x3b691a){return function(_0x166027){if(_0x166027){return _0x166027[_0x5f67('0x21')](_0x3d10dd)[_0x5f67('0x22')](function(_0x461a2b){return _0x461a2b;});}return null;};}function removeEntity(_0x2f0842,_0x8f1b69){return function(_0x5968a4){if(_0x5968a4){return _0x5968a4[_0x5f67('0x23')]()[_0x5f67('0x22')](function(){_0x2f0842[_0x5f67('0x18')](0xcc)[_0x5f67('0x24')]();});}};}function handleEntityNotFound(_0x2f3e27,_0x29f177){return function(_0x4ed5b0){if(!_0x4ed5b0){_0x2f3e27[_0x5f67('0x25')](0x194);}return _0x4ed5b0;};}function handleError(_0x5ad2eb,_0x20e846){_0x20e846=_0x20e846||0x1f4;return function(_0x4b18cb){logger['error'](_0x4b18cb[_0x5f67('0x26')]);if(_0x4b18cb[_0x5f67('0x27')]){delete _0x4b18cb['name'];}_0x5ad2eb[_0x5f67('0x18')](_0x20e846)[_0x5f67('0x28')](_0x4b18cb);};}exports[_0x5f67('0x29')]=function(_0x19e00b,_0x193b93){var _0x4b2dc1={},_0x37e4f5={},_0x326d0d={'count':0x0,'rows':[]};var _0x127c7a=_[_0x5f67('0x2a')](db[_0x5f67('0x2b')][_0x5f67('0x2c')],function(_0x137584){return{'name':_0x137584[_0x5f67('0x2d')],'type':_0x137584[_0x5f67('0x2e')]['key']};});_0x37e4f5[_0x5f67('0x2f')]=_['map'](_0x127c7a,_0x5f67('0x27'));_0x37e4f5[_0x5f67('0x30')]=_[_0x5f67('0x31')](_0x19e00b[_0x5f67('0x30')]);_0x37e4f5['filters']=_[_0x5f67('0x32')](_0x37e4f5[_0x5f67('0x2f')],_0x37e4f5[_0x5f67('0x30')]);_0x4b2dc1[_0x5f67('0x33')]=_[_0x5f67('0x32')](_0x37e4f5['model'],qs[_0x5f67('0x34')](_0x19e00b[_0x5f67('0x30')][_0x5f67('0x34')]));_0x4b2dc1['attributes']=_0x4b2dc1[_0x5f67('0x33')][_0x5f67('0x35')]?_0x4b2dc1[_0x5f67('0x33')]:_0x37e4f5[_0x5f67('0x2f')];if(!_0x19e00b[_0x5f67('0x30')][_0x5f67('0x36')]('nolimit')){_0x4b2dc1[_0x5f67('0x1b')]=qs[_0x5f67('0x1b')](_0x19e00b[_0x5f67('0x30')][_0x5f67('0x1b')]);_0x4b2dc1[_0x5f67('0x1d')]=qs[_0x5f67('0x1d')](_0x19e00b['query'][_0x5f67('0x1d')]);}_0x4b2dc1[_0x5f67('0x37')]=qs[_0x5f67('0x38')](_0x19e00b[_0x5f67('0x30')][_0x5f67('0x38')]);_0x4b2dc1['where']=qs[_0x5f67('0x39')](_[_0x5f67('0x3a')](_0x19e00b[_0x5f67('0x30')],_0x37e4f5[_0x5f67('0x39')]),_0x127c7a);if(_0x19e00b[_0x5f67('0x30')][_0x5f67('0x3b')]){_0x4b2dc1[_0x5f67('0x3c')]=_[_0x5f67('0x3d')](_0x4b2dc1[_0x5f67('0x3c')],{'$or':_[_0x5f67('0x2a')](_0x127c7a,function(_0x21ab76){if(_0x21ab76[_0x5f67('0x2e')]!==_0x5f67('0x3e')){var _0x580867={};_0x580867[_0x21ab76[_0x5f67('0x27')]]={'$like':'%'+_0x19e00b[_0x5f67('0x30')][_0x5f67('0x3b')]+'%'};return _0x580867;}})});}_0x4b2dc1=_[_0x5f67('0x3d')]({},_0x4b2dc1,_0x19e00b['options']);var _0x5334af={'where':_0x4b2dc1[_0x5f67('0x3c')]};return db[_0x5f67('0x2b')][_0x5f67('0x1c')](_0x5334af)['then'](function(_0x342cca){_0x326d0d[_0x5f67('0x1c')]=_0x342cca;if(_0x19e00b['query'][_0x5f67('0x3f')]){_0x4b2dc1[_0x5f67('0x40')]=[{'all':!![]}];}return db[_0x5f67('0x2b')][_0x5f67('0x41')](_0x4b2dc1);})[_0x5f67('0x22')](function(_0x150f9a){_0x326d0d['rows']=_0x150f9a;return _0x326d0d;})[_0x5f67('0x22')](respondWithFilteredResult(_0x193b93,_0x4b2dc1))[_0x5f67('0x42')](handleError(_0x193b93,null));};exports[_0x5f67('0x43')]=function(_0x3a5b61,_0x5d030d){var _0x16ca2f={'raw':!![],'where':{'id':_0x3a5b61[_0x5f67('0x44')]['id']}},_0x2c79b1={};_0x2c79b1['model']=_[_0x5f67('0x31')](db[_0x5f67('0x2b')][_0x5f67('0x2c')]);_0x2c79b1[_0x5f67('0x30')]=_['keys'](_0x3a5b61['query']);_0x2c79b1[_0x5f67('0x39')]=_[_0x5f67('0x32')](_0x2c79b1[_0x5f67('0x2f')],_0x2c79b1['query']);_0x16ca2f[_0x5f67('0x33')]=_['intersection'](_0x2c79b1['model'],qs['fields'](_0x3a5b61[_0x5f67('0x30')][_0x5f67('0x34')]));_0x16ca2f[_0x5f67('0x33')]=_0x16ca2f[_0x5f67('0x33')][_0x5f67('0x35')]?_0x16ca2f['attributes']:_0x2c79b1[_0x5f67('0x2f')];if(_0x3a5b61['query'][_0x5f67('0x3f')]){_0x16ca2f[_0x5f67('0x40')]=[{'all':!![]}];}_0x16ca2f=_[_0x5f67('0x3d')]({},_0x16ca2f,_0x3a5b61['options']);return db['Attachment'][_0x5f67('0x45')](_0x16ca2f)[_0x5f67('0x22')](handleEntityNotFound(_0x5d030d,null))[_0x5f67('0x22')](respondWithResult(_0x5d030d,null))[_0x5f67('0x42')](handleError(_0x5d030d,null));};exports['clone']=function(_0x48988d,_0x4b0907){var _0x3fab09={'where':{'id':_0x48988d[_0x5f67('0x44')]['id']}},_0x104119={};_0x104119['model']=_[_0x5f67('0x31')](db[_0x5f67('0x2b')][_0x5f67('0x2c')]);_0x3fab09[_0x5f67('0x33')]=_['intersection'](_0x104119['model'],qs[_0x5f67('0x34')](_0x48988d['query'][_0x5f67('0x34')]));_0x3fab09[_0x5f67('0x33')]=_0x3fab09[_0x5f67('0x33')][_0x5f67('0x35')]?_0x3fab09[_0x5f67('0x33')]:_0x104119['model'];if(_0x48988d[_0x5f67('0x30')][_0x5f67('0x3f')]){_0x3fab09[_0x5f67('0x40')]=[{'all':!![]}];}_0x3fab09=_[_0x5f67('0x3d')]({},_0x3fab09,_0x48988d['options']);return db[_0x5f67('0x2b')][_0x5f67('0x45')](_0x3fab09)[_0x5f67('0x22')](handleEntityNotFound(_0x4b0907,null))[_0x5f67('0x22')](function(_0x23ade1){if(_0x23ade1){var _0x34b101=_0x23ade1[_0x5f67('0x46')]({'plain':!![]});_0x34b101=qs[_0x5f67('0x47')](_0x34b101,['id','createdAt','updatedAt']);_0x48988d[_0x5f67('0x48')]=_[_0x5f67('0x47')](_0x48988d[_0x5f67('0x48')],['id',_0x5f67('0x49'),'updatedAt']);return db[_0x5f67('0x2b')][_0x5f67('0x4a')](_[_0x5f67('0x3d')](_0x34b101,_0x48988d[_0x5f67('0x48')]),{'include':_0x48988d[_0x5f67('0x30')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x5f67('0x22')](respondWithResult(_0x4b0907,0xc9))[_0x5f67('0x42')](handleError(_0x4b0907,null));};exports[_0x5f67('0x21')]=function(_0x465bae,_0x89060e){if(_0x465bae[_0x5f67('0x48')]['id']){delete _0x465bae['body']['id'];}return db[_0x5f67('0x2b')][_0x5f67('0x45')]({'where':{'id':_0x465bae['params']['id']}})[_0x5f67('0x22')](handleEntityNotFound(_0x89060e,null))[_0x5f67('0x22')](saveUpdates(_0x465bae[_0x5f67('0x48')],null))[_0x5f67('0x22')](respondWithResult(_0x89060e,null))[_0x5f67('0x42')](handleError(_0x89060e,null));};exports['destroy']=function(_0x19f4a4,_0x17d967){return db[_0x5f67('0x2b')][_0x5f67('0x45')]({'where':{'id':_0x19f4a4[_0x5f67('0x44')]['id']}})[_0x5f67('0x22')](handleEntityNotFound(_0x17d967,null))[_0x5f67('0x22')](removeEntity(_0x17d967,null))[_0x5f67('0x42')](handleError(_0x17d967,null));};exports['create']=function(_0x51257e,_0x823bfe,_0x2cb63b){_0x51257e['body'][_0x5f67('0x27')]=_0x51257e[_0x5f67('0x4b')][_0x5f67('0x4c')];_0x51257e['body']['basename']=_0x51257e[_0x5f67('0x4b')]['filename'];_0x51257e[_0x5f67('0x48')][_0x5f67('0x2e')]=_0x51257e['file'][_0x5f67('0x4d')];return db[_0x5f67('0x2b')]['create'](_0x51257e[_0x5f67('0x48')])[_0x5f67('0x22')](respondWithResult(_0x823bfe,0xc9))[_0x5f67('0x42')](handleError(_0x823bfe,null));};exports['download']=function(_0x37c5b3,_0x2128e7,_0x39e7cc){return db[_0x5f67('0x2b')]['findOne']({'where':{'id':_0x37c5b3[_0x5f67('0x44')]['id']},'raw':!![]})[_0x5f67('0x22')](handleEntityNotFound(_0x2128e7,null))[_0x5f67('0x22')](function(_0x1f7186){if(_0x1f7186){var _0x438300=_0x1f7186['ChatOfflineMessageId']!==null;var _0x49cdd6=path[_0x5f67('0x4e')](config[_0x5f67('0x4f')],_0x5f67('0x50'));if(_0x438300){_0x49cdd6=path['join'](_0x49cdd6,_0x5f67('0x51'));}var _0x4444aa=path[_0x5f67('0x4e')](_0x49cdd6,_0x1f7186[_0x5f67('0x52')]);return _0x2128e7[_0x5f67('0x53')](_0x4444aa);}})['catch'](handleError(_0x2128e7,null));};
\ No newline at end of file
+var _0xf2a3=['apply','save','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','type','filter','includeAll','findAll','catch','show','include','options','find','clone','params','get','omit','createdAt','updatedAt','body','create','file','originalname','filename','mimetype','ChatOfflineMessageId','join','server/files/attachments/','basename','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','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','end','json','offset','undefined','count','set','Content-Range'];(function(_0x27a929,_0x19068d){var _0x43ac7c=function(_0x86455b){while(--_0x86455b){_0x27a929['push'](_0x27a929['shift']());}};_0x43ac7c(++_0x19068d);}(_0xf2a3,0x1a8));var _0x3f2a=function(_0xb3275c,_0x2623c3){_0xb3275c=_0xb3275c-0x0;var _0x58e50b=_0xf2a3[_0xb3275c];return _0x58e50b;};'use strict';var emlformat=require(_0x3f2a('0x0'));var rimraf=require(_0x3f2a('0x1'));var zipdir=require(_0x3f2a('0x2'));var jsonpatch=require(_0x3f2a('0x3'));var rp=require(_0x3f2a('0x4'));var moment=require('moment');var BPromise=require(_0x3f2a('0x5'));var Mustache=require(_0x3f2a('0x6'));var util=require(_0x3f2a('0x7'));var path=require(_0x3f2a('0x8'));var sox=require(_0x3f2a('0x9'));var csv=require(_0x3f2a('0xa'));var ejs=require(_0x3f2a('0xb'));var fs=require('fs');var fs_extra=require(_0x3f2a('0xc'));var _=require(_0x3f2a('0xd'));var squel=require(_0x3f2a('0xe'));var crypto=require('crypto');var jsforce=require(_0x3f2a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3f2a('0xa'));var querystring=require(_0x3f2a('0x10'));var Papa=require(_0x3f2a('0x11'));var Redis=require(_0x3f2a('0x12'));var authService=require(_0x3f2a('0x13'));var qs=require(_0x3f2a('0x14'));var as=require(_0x3f2a('0x15'));var hardwareService=require(_0x3f2a('0x16'));var logger=require(_0x3f2a('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x3f2a('0x18'));var licenseUtil=require(_0x3f2a('0x19'));var db=require(_0x3f2a('0x1a'))['db'];function respondWithStatusCode(_0x4db237,_0x5a6033){_0x5a6033=_0x5a6033||0xcc;return function(_0x423b63){if(_0x423b63){return _0x4db237[_0x3f2a('0x1b')](_0x5a6033);}return _0x4db237[_0x3f2a('0x1c')](_0x5a6033)[_0x3f2a('0x1d')]();};}function respondWithResult(_0x502a8f,_0x4d3bd1){_0x4d3bd1=_0x4d3bd1||0xc8;return function(_0x4c491c){if(_0x4c491c){return _0x502a8f[_0x3f2a('0x1c')](_0x4d3bd1)[_0x3f2a('0x1e')](_0x4c491c);}};}function respondWithFilteredResult(_0x18cf00,_0x28b4a5){return function(_0x5839fc){if(_0x5839fc){var _0x23ea38=typeof _0x28b4a5[_0x3f2a('0x1f')]===_0x3f2a('0x20')&&typeof _0x28b4a5['limit']===_0x3f2a('0x20');var _0x65aed9=_0x5839fc['count'];var _0xc445ba=_0x23ea38?0x0:_0x28b4a5[_0x3f2a('0x1f')];var _0x5af7d4=_0x23ea38?_0x5839fc[_0x3f2a('0x21')]:_0x28b4a5[_0x3f2a('0x1f')]+_0x28b4a5['limit'];var _0x2b72c7;if(_0x5af7d4>=_0x65aed9){_0x5af7d4=_0x65aed9;_0x2b72c7=0xc8;}else{_0x2b72c7=0xce;}_0x18cf00[_0x3f2a('0x1c')](_0x2b72c7);return _0x18cf00[_0x3f2a('0x22')](_0x3f2a('0x23'),_0xc445ba+'-'+_0x5af7d4+'/'+_0x65aed9)[_0x3f2a('0x1e')](_0x5839fc);}return null;};}function patchUpdates(_0x246d08){return function(_0x23b0a4){try{jsonpatch[_0x3f2a('0x24')](_0x23b0a4,_0x246d08,!![]);}catch(_0x255d82){return BPromise['reject'](_0x255d82);}return _0x23b0a4[_0x3f2a('0x25')]();};}function saveUpdates(_0x4ec9b8,_0x416cff){return function(_0x3c4168){if(_0x3c4168){return _0x3c4168[_0x3f2a('0x26')](_0x4ec9b8)[_0x3f2a('0x27')](function(_0x15341b){return _0x15341b;});}return null;};}function removeEntity(_0x5c685b,_0x8ecc6e){return function(_0x25642d){if(_0x25642d){return _0x25642d[_0x3f2a('0x28')]()[_0x3f2a('0x27')](function(){_0x5c685b[_0x3f2a('0x1c')](0xcc)[_0x3f2a('0x1d')]();});}};}function handleEntityNotFound(_0x23145d,_0x1c3773){return function(_0x47b038){if(!_0x47b038){_0x23145d['sendStatus'](0x194);}return _0x47b038;};}function handleError(_0x442b1e,_0xde22d2){_0xde22d2=_0xde22d2||0x1f4;return function(_0x46e857){logger[_0x3f2a('0x29')](_0x46e857[_0x3f2a('0x2a')]);if(_0x46e857[_0x3f2a('0x2b')]){delete _0x46e857[_0x3f2a('0x2b')];}_0x442b1e[_0x3f2a('0x1c')](_0xde22d2)[_0x3f2a('0x2c')](_0x46e857);};}exports[_0x3f2a('0x2d')]=function(_0x281bbe,_0x5f3ee0){var _0xbc311b={},_0x5bfb2f={},_0x4a80e3={'count':0x0,'rows':[]};var _0x32d3af=_[_0x3f2a('0x2e')](db[_0x3f2a('0x2f')][_0x3f2a('0x30')],function(_0x698e21){return{'name':_0x698e21[_0x3f2a('0x31')],'type':_0x698e21['type'][_0x3f2a('0x32')]};});_0x5bfb2f[_0x3f2a('0x33')]=_[_0x3f2a('0x2e')](_0x32d3af,_0x3f2a('0x2b'));_0x5bfb2f[_0x3f2a('0x34')]=_[_0x3f2a('0x35')](_0x281bbe['query']);_0x5bfb2f[_0x3f2a('0x36')]=_[_0x3f2a('0x37')](_0x5bfb2f['model'],_0x5bfb2f['query']);_0xbc311b['attributes']=_[_0x3f2a('0x37')](_0x5bfb2f[_0x3f2a('0x33')],qs[_0x3f2a('0x38')](_0x281bbe[_0x3f2a('0x34')][_0x3f2a('0x38')]));_0xbc311b[_0x3f2a('0x39')]=_0xbc311b[_0x3f2a('0x39')][_0x3f2a('0x3a')]?_0xbc311b[_0x3f2a('0x39')]:_0x5bfb2f[_0x3f2a('0x33')];if(!_0x281bbe[_0x3f2a('0x34')][_0x3f2a('0x3b')](_0x3f2a('0x3c'))){_0xbc311b[_0x3f2a('0x3d')]=qs[_0x3f2a('0x3d')](_0x281bbe['query']['limit']);_0xbc311b[_0x3f2a('0x1f')]=qs[_0x3f2a('0x1f')](_0x281bbe[_0x3f2a('0x34')]['offset']);}_0xbc311b[_0x3f2a('0x3e')]=qs[_0x3f2a('0x3f')](_0x281bbe[_0x3f2a('0x34')][_0x3f2a('0x3f')]);_0xbc311b[_0x3f2a('0x40')]=qs[_0x3f2a('0x36')](_['pick'](_0x281bbe[_0x3f2a('0x34')],_0x5bfb2f[_0x3f2a('0x36')]),_0x32d3af);if(_0x281bbe[_0x3f2a('0x34')]['filter']){_0xbc311b[_0x3f2a('0x40')]=_[_0x3f2a('0x41')](_0xbc311b['where'],{'$or':_[_0x3f2a('0x2e')](_0x32d3af,function(_0x13ab33){if(_0x13ab33[_0x3f2a('0x42')]!=='VIRTUAL'){var _0x458640={};_0x458640[_0x13ab33[_0x3f2a('0x2b')]]={'$like':'%'+_0x281bbe[_0x3f2a('0x34')][_0x3f2a('0x43')]+'%'};return _0x458640;}})});}_0xbc311b=_[_0x3f2a('0x41')]({},_0xbc311b,_0x281bbe['options']);var _0xb994c5={'where':_0xbc311b[_0x3f2a('0x40')]};return db[_0x3f2a('0x2f')]['count'](_0xb994c5)['then'](function(_0x50e9c0){_0x4a80e3[_0x3f2a('0x21')]=_0x50e9c0;if(_0x281bbe[_0x3f2a('0x34')][_0x3f2a('0x44')]){_0xbc311b['include']=[{'all':!![]}];}return db[_0x3f2a('0x2f')][_0x3f2a('0x45')](_0xbc311b);})[_0x3f2a('0x27')](function(_0x455c79){_0x4a80e3['rows']=_0x455c79;return _0x4a80e3;})[_0x3f2a('0x27')](respondWithFilteredResult(_0x5f3ee0,_0xbc311b))[_0x3f2a('0x46')](handleError(_0x5f3ee0,null));};exports[_0x3f2a('0x47')]=function(_0x502231,_0x143ff7){var _0x26fde0={'raw':!![],'where':{'id':_0x502231['params']['id']}},_0x489a4b={};_0x489a4b[_0x3f2a('0x33')]=_[_0x3f2a('0x35')](db[_0x3f2a('0x2f')][_0x3f2a('0x30')]);_0x489a4b[_0x3f2a('0x34')]=_[_0x3f2a('0x35')](_0x502231[_0x3f2a('0x34')]);_0x489a4b[_0x3f2a('0x36')]=_[_0x3f2a('0x37')](_0x489a4b[_0x3f2a('0x33')],_0x489a4b[_0x3f2a('0x34')]);_0x26fde0[_0x3f2a('0x39')]=_[_0x3f2a('0x37')](_0x489a4b[_0x3f2a('0x33')],qs[_0x3f2a('0x38')](_0x502231['query'][_0x3f2a('0x38')]));_0x26fde0['attributes']=_0x26fde0[_0x3f2a('0x39')][_0x3f2a('0x3a')]?_0x26fde0[_0x3f2a('0x39')]:_0x489a4b[_0x3f2a('0x33')];if(_0x502231['query'][_0x3f2a('0x44')]){_0x26fde0[_0x3f2a('0x48')]=[{'all':!![]}];}_0x26fde0=_[_0x3f2a('0x41')]({},_0x26fde0,_0x502231[_0x3f2a('0x49')]);return db[_0x3f2a('0x2f')][_0x3f2a('0x4a')](_0x26fde0)[_0x3f2a('0x27')](handleEntityNotFound(_0x143ff7,null))[_0x3f2a('0x27')](respondWithResult(_0x143ff7,null))[_0x3f2a('0x46')](handleError(_0x143ff7,null));};exports[_0x3f2a('0x4b')]=function(_0x139310,_0x330403){var _0x207369={'where':{'id':_0x139310[_0x3f2a('0x4c')]['id']}},_0x456eec={};_0x456eec['model']=_['keys'](db['Attachment'][_0x3f2a('0x30')]);_0x207369['attributes']=_[_0x3f2a('0x37')](_0x456eec[_0x3f2a('0x33')],qs[_0x3f2a('0x38')](_0x139310[_0x3f2a('0x34')][_0x3f2a('0x38')]));_0x207369[_0x3f2a('0x39')]=_0x207369[_0x3f2a('0x39')][_0x3f2a('0x3a')]?_0x207369[_0x3f2a('0x39')]:_0x456eec[_0x3f2a('0x33')];if(_0x139310[_0x3f2a('0x34')]['includeAll']){_0x207369[_0x3f2a('0x48')]=[{'all':!![]}];}_0x207369=_[_0x3f2a('0x41')]({},_0x207369,_0x139310[_0x3f2a('0x49')]);return db[_0x3f2a('0x2f')][_0x3f2a('0x4a')](_0x207369)[_0x3f2a('0x27')](handleEntityNotFound(_0x330403,null))[_0x3f2a('0x27')](function(_0x5e3470){if(_0x5e3470){var _0x5f51d9=_0x5e3470[_0x3f2a('0x4d')]({'plain':!![]});_0x5f51d9=qs[_0x3f2a('0x4e')](_0x5f51d9,['id',_0x3f2a('0x4f'),_0x3f2a('0x50')]);_0x139310[_0x3f2a('0x51')]=_['omit'](_0x139310[_0x3f2a('0x51')],['id',_0x3f2a('0x4f'),_0x3f2a('0x50')]);return db['Attachment'][_0x3f2a('0x52')](_[_0x3f2a('0x41')](_0x5f51d9,_0x139310[_0x3f2a('0x51')]),{'include':_0x139310['query'][_0x3f2a('0x44')]?[{'all':!![]}]:undefined});}})[_0x3f2a('0x27')](respondWithResult(_0x330403,0xc9))[_0x3f2a('0x46')](handleError(_0x330403,null));};exports[_0x3f2a('0x26')]=function(_0x3a6fa6,_0x419d95){if(_0x3a6fa6[_0x3f2a('0x51')]['id']){delete _0x3a6fa6[_0x3f2a('0x51')]['id'];}return db[_0x3f2a('0x2f')][_0x3f2a('0x4a')]({'where':{'id':_0x3a6fa6[_0x3f2a('0x4c')]['id']}})[_0x3f2a('0x27')](handleEntityNotFound(_0x419d95,null))[_0x3f2a('0x27')](saveUpdates(_0x3a6fa6['body'],null))['then'](respondWithResult(_0x419d95,null))[_0x3f2a('0x46')](handleError(_0x419d95,null));};exports[_0x3f2a('0x28')]=function(_0xdb27a3,_0xa20df9){return db[_0x3f2a('0x2f')][_0x3f2a('0x4a')]({'where':{'id':_0xdb27a3[_0x3f2a('0x4c')]['id']}})['then'](handleEntityNotFound(_0xa20df9,null))[_0x3f2a('0x27')](removeEntity(_0xa20df9,null))[_0x3f2a('0x46')](handleError(_0xa20df9,null));};exports[_0x3f2a('0x52')]=function(_0x5e0933,_0x5b9da2,_0x11426c){_0x5e0933[_0x3f2a('0x51')][_0x3f2a('0x2b')]=_0x5e0933[_0x3f2a('0x53')][_0x3f2a('0x54')];_0x5e0933['body']['basename']=_0x5e0933[_0x3f2a('0x53')][_0x3f2a('0x55')];_0x5e0933[_0x3f2a('0x51')]['type']=_0x5e0933[_0x3f2a('0x53')][_0x3f2a('0x56')];return db[_0x3f2a('0x2f')][_0x3f2a('0x52')](_0x5e0933['body'])[_0x3f2a('0x27')](respondWithResult(_0x5b9da2,0xc9))['catch'](handleError(_0x5b9da2,null));};exports['download']=function(_0x8009ec,_0x4fe88d,_0x482762){return db[_0x3f2a('0x2f')]['findOne']({'where':{'id':_0x8009ec['params']['id']},'raw':!![]})[_0x3f2a('0x27')](handleEntityNotFound(_0x4fe88d,null))[_0x3f2a('0x27')](function(_0x1b5ce1){if(_0x1b5ce1){var _0x250467=_0x1b5ce1[_0x3f2a('0x57')]!==null;var _0x4b1cd8=path[_0x3f2a('0x58')](config['root'],_0x3f2a('0x59'));if(_0x250467){_0x4b1cd8=path['join'](_0x4b1cd8,'offline-chat/');}var _0x29929f=path[_0x3f2a('0x58')](_0x4b1cd8,_0x1b5ce1[_0x3f2a('0x5a')]);return _0x4fe88d[_0x3f2a('0x5b')](_0x29929f);}})['catch'](handleError(_0x4fe88d,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index da2cfb5..be22592 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 _0xa2a1=['exports','define','Attachment','attachments','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x26bf45,_0x1c8091){var _0x48a84e=function(_0x18e2ac){while(--_0x18e2ac){_0x26bf45['push'](_0x26bf45['shift']());}};_0x48a84e(++_0x1c8091);}(_0xa2a1,0xe0));var _0x1a2a=function(_0x10982b,_0x4fd22c){_0x10982b=_0x10982b-0x0;var _0x45e3a6=_0xa2a1[_0x10982b];return _0x45e3a6;};'use strict';var _=require('lodash');var util=require(_0x1a2a('0x0'));var logger=require(_0x1a2a('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1a2a('0x2'));var fs=require('fs');var path=require(_0x1a2a('0x3'));var rimraf=require(_0x1a2a('0x4'));var config=require(_0x1a2a('0x5'));var attributes=require(_0x1a2a('0x6'));module[_0x1a2a('0x7')]=function(_0x56d10f,_0x240d7e){return _0x56d10f[_0x1a2a('0x8')](_0x1a2a('0x9'),attributes,{'tableName':_0x1a2a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3583=['../../config/environment','./attachment.attributes','define','Attachment','attachments','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3583,0xc0));var _0x3358=function(_0x7a56c,_0x4c8ece){_0x7a56c=_0x7a56c-0x0;var _0x14f77a=_0x3583[_0x7a56c];return _0x14f77a;};'use strict';var _=require('lodash');var util=require(_0x3358('0x0'));var logger=require(_0x3358('0x1'))('api');var moment=require(_0x3358('0x2'));var BPromise=require('bluebird');var rp=require(_0x3358('0x3'));var fs=require('fs');var path=require(_0x3358('0x4'));var rimraf=require(_0x3358('0x5'));var config=require(_0x3358('0x6'));var attributes=require(_0x3358('0x7'));module['exports']=function(_0xae929e,_0x5e6250){return _0xae929e[_0x3358('0x8')](_0x3358('0x9'),attributes,{'tableName':_0x3358('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 3ada7d0..c154125 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 _0xfc1e=['message','result','CreateAttachment','create','body','options','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x243fef,_0x2f087c){var _0x214621=function(_0xe8efc5){while(--_0xe8efc5){_0x243fef['push'](_0x243fef['shift']());}};_0x214621(++_0x2f087c);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xfc1e[_0x11ce46];return _0x368a1e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xefc1('0x0'));var rs=require(_0xefc1('0x1'));var fs=require('fs');var Redis=require(_0xefc1('0x2'));var db=require(_0xefc1('0x3'))['db'];var utils=require(_0xefc1('0x4'));var logger=require('../../config/logger')(_0xefc1('0x5'));var config=require(_0xefc1('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xefc1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x38927c,_0x44d15b,_0x3ff4a7){return new BPromise(function(_0x45bec4,_0x77f637){return client[_0xefc1('0x8')](_0x38927c,_0x3ff4a7)[_0xefc1('0x9')](function(_0x244927){logger[_0xefc1('0xa')](_0xefc1('0xb'),_0x44d15b,'request\x20sent');logger[_0xefc1('0xc')](_0xefc1('0xd'),_0x44d15b,_0xefc1('0xe'),JSON[_0xefc1('0xf')](_0x244927));if(_0x244927[_0xefc1('0x10')]){if(_0x244927[_0xefc1('0x10')][_0xefc1('0x11')]===0x1f4){logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);return _0x77f637(_0x244927['error'][_0xefc1('0x12')]);}logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);return _0x45bec4(_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);}else{logger[_0xefc1('0xa')]('Attachment,\x20%s,\x20%s',_0x44d15b,_0xefc1('0xe'));_0x45bec4(_0x244927[_0xefc1('0x13')][_0xefc1('0x12')]);}})['catch'](function(_0x159adb){logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x159adb);_0x77f637(_0x159adb);});});}exports[_0xefc1('0x14')]=function(_0x257914){var _0x38923c=this;return new Promise(function(_0x3b5a6e,_0x126052){return db['Attachment'][_0xefc1('0x15')](_0x257914[_0xefc1('0x16')],{'raw':_0x257914[_0xefc1('0x17')]?_0x257914['options']['raw']===undefined?!![]:![]:!![]})[_0xefc1('0x9')](function(_0x492d7d){logger[_0xefc1('0xa')]('CreateAttachment',_0x257914);logger[_0xefc1('0xc')](_0xefc1('0x14'),_0x257914,JSON['stringify'](_0x492d7d));_0x3b5a6e(_0x492d7d);})[_0xefc1('0x18')](function(_0x2ea108){logger[_0xefc1('0x10')](_0xefc1('0x14'),_0x2ea108[_0xefc1('0x12')],_0x257914);_0x126052(_0x38923c[_0xefc1('0x10')](0x1f4,_0x2ea108['message']));});});};
\ No newline at end of file
+var _0x07c3=['debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','CreateAttachment','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x4ba9d2,_0x2ecfdd){var _0x29188d=function(_0x5c3a3d){while(--_0x5c3a3d){_0x4ba9d2['push'](_0x4ba9d2['shift']());}};_0x29188d(++_0x2ecfdd);}(_0x07c3,0x1bf));var _0x307c=function(_0x19ac6e,_0x435862){_0x19ac6e=_0x19ac6e-0x0;var _0x1cdcf3=_0x07c3[_0x19ac6e];return _0x1cdcf3;};'use strict';var _=require(_0x307c('0x0'));var util=require(_0x307c('0x1'));var moment=require(_0x307c('0x2'));var BPromise=require(_0x307c('0x3'));var rs=require(_0x307c('0x4'));var fs=require('fs');var Redis=require(_0x307c('0x5'));var db=require(_0x307c('0x6'))['db'];var utils=require(_0x307c('0x7'));var logger=require('../../config/logger')(_0x307c('0x8'));var config=require(_0x307c('0x9'));var jayson=require(_0x307c('0xa'));var client=jayson[_0x307c('0xb')][_0x307c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x410ae8,_0x39af52,_0x3f5d08){return new BPromise(function(_0xfb14bf,_0x166467){return client[_0x307c('0xd')](_0x410ae8,_0x3f5d08)[_0x307c('0xe')](function(_0x1af97f){logger[_0x307c('0xf')](_0x307c('0x10'),_0x39af52,'request\x20sent');logger[_0x307c('0x11')](_0x307c('0x12'),_0x39af52,_0x307c('0x13'),JSON[_0x307c('0x14')](_0x1af97f));if(_0x1af97f['error']){if(_0x1af97f['error'][_0x307c('0x15')]===0x1f4){logger['error'](_0x307c('0x10'),_0x39af52,_0x1af97f[_0x307c('0x16')]['message']);return _0x166467(_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);}logger[_0x307c('0x16')](_0x307c('0x10'),_0x39af52,_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);return _0xfb14bf(_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);}else{logger[_0x307c('0xf')](_0x307c('0x10'),_0x39af52,_0x307c('0x13'));_0xfb14bf(_0x1af97f[_0x307c('0x18')]['message']);}})[_0x307c('0x19')](function(_0x364441){logger[_0x307c('0x16')](_0x307c('0x10'),_0x39af52,_0x364441);_0x166467(_0x364441);});});}exports[_0x307c('0x1a')]=function(_0x2e21a6){var _0x3e05e2=this;return new Promise(function(_0x13f03b,_0xbfe2b4){return db['Attachment']['create'](_0x2e21a6[_0x307c('0x1b')],{'raw':_0x2e21a6['options']?_0x2e21a6[_0x307c('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4bcc1a){logger[_0x307c('0xf')]('CreateAttachment',_0x2e21a6);logger[_0x307c('0x11')](_0x307c('0x1a'),_0x2e21a6,JSON['stringify'](_0x4bcc1a));_0x13f03b(_0x4bcc1a);})[_0x307c('0x19')](function(_0x45fe2){logger['error'](_0x307c('0x1a'),_0x45fe2[_0x307c('0x17')],_0x2e21a6);_0xbfe2b4(_0x3e05e2[_0x307c('0x16')](0x1f4,_0x45fe2[_0x307c('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 1293bda..1617ac4 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 _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x18b4a1,_0x4ed3a0){var _0x1432be=function(_0x37516d){while(--_0x37516d){_0x18b4a1['push'](_0x18b4a1['shift']());}};_0x1432be(++_0x4ed3a0);}(_0x757a,0xde));var _0xa757=function(_0x24bd8f,_0x8659c4){_0x24bd8f=_0x24bd8f-0x0;var _0x1b5cd1=_0x757a[_0x24bd8f];return _0x1b5cd1;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router;
\ No newline at end of file
+var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x106b3c,_0xb1b5d7){var _0x37eeb1=function(_0x406d3c){while(--_0x406d3c){_0x106b3c['push'](_0x106b3c['shift']());}};_0x37eeb1(++_0xb1b5d7);}(_0xadb5,0xad));var _0x5adb=function(_0x5a5f75,_0x29ee82){_0x5a5f75=_0x5a5f75-0x0;var _0x41ce5f=_0xadb5[_0x5a5f75];return _0x41ce5f;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 8b7e5fd..3613b26 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 _0x873e=['online','admin','user','agent','blocked','clearBlockUser','getLicense','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','use','password','passport','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','disabled','blockedAt'];(function(_0x53e3de,_0x13da7b){var _0x7b905b=function(_0x29b56a){while(--_0x29b56a){_0x53e3de['push'](_0x53e3de['shift']());}};_0x7b905b(++_0x13da7b);}(_0x873e,0xa1));var _0xe873=function(_0x157aef,_0x3e7774){_0x157aef=_0x157aef-0x0;var _0x5b8f6a=_0x873e[_0x157aef];return _0x5b8f6a;};'use strict';var passport=require(_0xe873('0x0'));var LocalStrategy=require(_0xe873('0x1'))[_0xe873('0x2')];var moment=require(_0xe873('0x3'));var ActiveDirectory=require(_0xe873('0x4'));var BPromise=require('bluebird');var util=require(_0xe873('0x5'));var db=require(_0xe873('0x6'))['db'];var authService=require(_0xe873('0x7'));var utils=require(_0xe873('0x8'));var config=require(_0xe873('0x9'));var logger=require(_0xe873('0xa'))(_0xe873('0xb'));function isActiveDirectoryConfigured(_0x512161){var _0x45cda5=![];if(typeof _0x512161[_0xe873('0xc')]!==_0xe873('0xd')){_0x45cda5=_0x512161[_0xe873('0xc')][_0xe873('0xe')]&&_0x512161[_0xe873('0xc')]['url']&&_0x512161['activedirectory'][_0xe873('0xf')];}return _0x45cda5;}function adAuthenticate(_0x5a08b2,_0x500463,_0x3af9c7){return new BPromise(function(_0x34b9cd,_0x2ffdd8){try{var _0x30e0e2=new ActiveDirectory(_0x5a08b2);_0x30e0e2[_0xe873('0x10')](_0x500463,_0x3af9c7,function(_0x1bb607,_0x1be8f4){if(_0x1bb607){logger[_0xe873('0x11')]('Error\x20authenticate\x20%s:\x20%s',_0x500463,util[_0xe873('0x12')](_0x1bb607,{'showHidden':![],'depth':null}));_0x2ffdd8(_0xe873('0x13'));}else if(!_0x1be8f4){logger['error'](_0xe873('0x14'),_0x500463);_0x2ffdd8(_0xe873('0x13'));}else{_0x34b9cd(_0x1be8f4);}});}catch(_0x1c25bc){_0x2ffdd8(_0x1c25bc);}});}function ActiveDirectoryAuthenticate(_0x596f8c,_0x37c3fb,_0x2a6c79,_0x31f7d7){var _0xbbcb83,_0x24ef37;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xe873('0x15'),_0x37c3fb);return _0x31f7d7(null,![],{'message':_0xe873('0x13')});}return db['Setting'][_0xe873('0x16')]({'where':{'id':0x1},'attributes':[_0xe873('0x17'),_0xe873('0x18')],'raw':!![]})[_0xe873('0x19')](function(_0x1c4124){_0xbbcb83=_0x1c4124;if(!_0xbbcb83[_0xe873('0x17')]){logger[_0xe873('0x11')](_0xe873('0x1a'),_0x37c3fb);throw new Error(_0xe873('0x13'));}return _0x596f8c[_0xe873('0x16')]({'logging':!![],'attributes':['id',_0xe873('0x1b'),'password',_0xe873('0x1c'),'role',_0xe873('0x1d'),'blocked',_0xe873('0x1e'),_0xe873('0x1f')],'where':{'name':_0x37c3fb,'role':{'$or':[_0xe873('0x20'),_0xe873('0x21'),_0xe873('0x22')]},'adSsoEnabled':!![]}});})[_0xe873('0x19')](function(_0x29e1f7){if(!_0x29e1f7||_0x29e1f7&&_0x29e1f7['name']!==_0x37c3fb){throw new Error(_0xe873('0x13'));}_0x24ef37=_0x29e1f7;var _0x17778f=_0x24ef37[_0xe873('0x1b')]+'@'+config[_0xe873('0xc')][_0xe873('0xf')];return adAuthenticate(config[_0xe873('0xc')],_0x17778f,_0x2a6c79);})[_0xe873('0x19')](function(_0x444bb9){if(_0x24ef37['disabled']){throw new Error(_0xe873('0x13'));}if(_0xbbcb83[_0xe873('0x18')]>0x0){if(_0x24ef37[_0xe873('0x23')]){if(moment(_0x24ef37[_0xe873('0x1e')])['add'](_0xbbcb83[_0xe873('0x18')],'minutes')>moment()){throw new Error(_0xe873('0x13'));}return utils[_0xe873('0x24')](_0x24ef37,0x0,![],null)[_0xe873('0x19')](function(){return utils[_0xe873('0x25')](_0x24ef37);})[_0xe873('0x19')](function(){return _0x31f7d7(null,_0x24ef37);});}else{return utils[_0xe873('0x25')](_0x24ef37)[_0xe873('0x19')](function(){return _0x31f7d7(null,_0x24ef37);});}}else{return utils[_0xe873('0x25')](_0x24ef37)[_0xe873('0x19')](function(){return _0x31f7d7(null,_0x24ef37);});}})['catch'](function(_0x4e704a){return _0x31f7d7(null,![],_0x4e704a);});}function handleError(_0x192e5b,_0x460f57,_0x50c86d){return _0x192e5b[_0xe873('0x26')](_0x460f57||0x1f4)[_0xe873('0x27')]({'message':_0x50c86d?_0x50c86d[_0xe873('0x28')]||_0x50c86d:''});}exports[_0xe873('0x29')]=function(_0x2a1506,_0x569d36,_0x2e6c5c){passport[_0xe873('0x10')](_0xe873('0x2a'),function(_0x27c6e8,_0x56c6f2,_0x7044ff){var _0x40f0f5=_0x27c6e8||_0x7044ff;if(_0x40f0f5){return handleError(_0x569d36,0x191,_0x40f0f5);}if(!_0x56c6f2){return handleError(_0x569d36,0x194,{'message':_0xe873('0x2b')});}else{var _0x436092={'payload':{'id':_0x56c6f2['id'],'role':_0x56c6f2[_0xe873('0x2c')]},'options':{'expiresIn':0x15180}};return authService[_0xe873('0x2d')](_0x436092)['then'](function(_0x595ba7){_0x569d36['json']({'id':_0x56c6f2['id'],'token':_0x595ba7,'statusCall':'','isAlreadyLogged':_0x56c6f2[_0xe873('0x1f')]});});}})(_0x2a1506,_0x569d36,_0x2e6c5c);};passport[_0xe873('0x2e')](_0xe873('0x2a'),new LocalStrategy({'usernameField':_0xe873('0x1b'),'passwordField':_0xe873('0x2f')},function(_0x57e5bf,_0xe9a24d,_0x370e05){return ActiveDirectoryAuthenticate(db['User'],_0x57e5bf,_0xe9a24d,_0x370e05);}));
\ No newline at end of file
+var _0x7246=['json','online','use','ad-login','password','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','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','Setting','findOne','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','disabled','blocked','blockedAt','admin','agent','then','add','clearBlockUser','getLicense','catch','send','message','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken'];(function(_0x263fe3,_0x216b34){var _0x578222=function(_0x1e48ab){while(--_0x1e48ab){_0x263fe3['push'](_0x263fe3['shift']());}};_0x578222(++_0x216b34);}(_0x7246,0x10a));var _0x6724=function(_0x5b0ae9,_0x5ad060){_0x5b0ae9=_0x5b0ae9-0x0;var _0x336c7f=_0x7246[_0x5b0ae9];return _0x336c7f;};'use strict';var passport=require(_0x6724('0x0'));var LocalStrategy=require(_0x6724('0x1'))[_0x6724('0x2')];var moment=require(_0x6724('0x3'));var ActiveDirectory=require(_0x6724('0x4'));var BPromise=require(_0x6724('0x5'));var util=require(_0x6724('0x6'));var db=require(_0x6724('0x7'))['db'];var authService=require(_0x6724('0x8'));var utils=require(_0x6724('0x9'));var config=require(_0x6724('0xa'));var logger=require(_0x6724('0xb'))(_0x6724('0xc'));function isActiveDirectoryConfigured(_0x50b18f){var _0x1d9319=![];if(typeof _0x50b18f[_0x6724('0xd')]!==_0x6724('0xe')){_0x1d9319=_0x50b18f[_0x6724('0xd')][_0x6724('0xf')]&&_0x50b18f[_0x6724('0xd')]['url']&&_0x50b18f['activedirectory'][_0x6724('0x10')];}return _0x1d9319;}function adAuthenticate(_0x16a229,_0x503ae4,_0x30dbf0){return new BPromise(function(_0x322c81,_0x2fa2ed){try{var _0x219e2c=new ActiveDirectory(_0x16a229);_0x219e2c[_0x6724('0x11')](_0x503ae4,_0x30dbf0,function(_0x417679,_0x586236){if(_0x417679){logger[_0x6724('0x12')](_0x6724('0x13'),_0x503ae4,util[_0x6724('0x14')](_0x417679,{'showHidden':![],'depth':null}));_0x2fa2ed('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x586236){logger['error'](_0x6724('0x15'),_0x503ae4);_0x2fa2ed(_0x6724('0x16'));}else{_0x322c81(_0x586236);}});}catch(_0x10ef06){_0x2fa2ed(_0x10ef06);}});}function ActiveDirectoryAuthenticate(_0x38f8a2,_0x43d283,_0x579503,_0x23179d){var _0x2d88b6,_0x428d28;if(!isActiveDirectoryConfigured(config)){logger[_0x6724('0x12')](_0x6724('0x17'),_0x43d283);return _0x23179d(null,![],{'message':_0x6724('0x16')});}return db[_0x6724('0x18')][_0x6724('0x19')]({'where':{'id':0x1},'attributes':[_0x6724('0x1a'),_0x6724('0x1b')],'raw':!![]})['then'](function(_0x7fc5e1){_0x2d88b6=_0x7fc5e1;if(!_0x2d88b6[_0x6724('0x1a')]){logger[_0x6724('0x12')](_0x6724('0x1c'),_0x43d283);throw new Error(_0x6724('0x16'));}return _0x38f8a2[_0x6724('0x19')]({'logging':!![],'attributes':['id',_0x6724('0x1d'),'password',_0x6724('0x1e'),_0x6724('0x1f'),_0x6724('0x20'),_0x6724('0x21'),_0x6724('0x22'),'online'],'where':{'name':_0x43d283,'role':{'$or':[_0x6724('0x23'),'user',_0x6724('0x24')]},'adSsoEnabled':!![]}});})[_0x6724('0x25')](function(_0x4eacf0){if(!_0x4eacf0||_0x4eacf0&&_0x4eacf0[_0x6724('0x1d')]!==_0x43d283){throw new Error(_0x6724('0x16'));}_0x428d28=_0x4eacf0;var _0x2a4d6c=_0x428d28[_0x6724('0x1d')]+'@'+config['activedirectory'][_0x6724('0x10')];return adAuthenticate(config[_0x6724('0xd')],_0x2a4d6c,_0x579503);})[_0x6724('0x25')](function(_0x554eeb){if(_0x428d28[_0x6724('0x20')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x2d88b6['blockDuration']>0x0){if(_0x428d28['blocked']){if(moment(_0x428d28[_0x6724('0x22')])[_0x6724('0x26')](_0x2d88b6[_0x6724('0x1b')],'minutes')>moment()){throw new Error(_0x6724('0x16'));}return utils[_0x6724('0x27')](_0x428d28,0x0,![],null)[_0x6724('0x25')](function(){return utils[_0x6724('0x28')](_0x428d28);})[_0x6724('0x25')](function(){return _0x23179d(null,_0x428d28);});}else{return utils[_0x6724('0x28')](_0x428d28)['then'](function(){return _0x23179d(null,_0x428d28);});}}else{return utils[_0x6724('0x28')](_0x428d28)[_0x6724('0x25')](function(){return _0x23179d(null,_0x428d28);});}})[_0x6724('0x29')](function(_0x44d07f){return _0x23179d(null,![],_0x44d07f);});}function handleError(_0x35a93f,_0x14a102,_0x4e9502){return _0x35a93f['status'](_0x14a102||0x1f4)[_0x6724('0x2a')]({'message':_0x4e9502?_0x4e9502[_0x6724('0x2b')]||_0x4e9502:''});}exports['login']=function(_0x6fd2aa,_0x596295,_0x3fbd8f){passport[_0x6724('0x11')]('ad-login',function(_0x12163a,_0x30357e,_0x572c4a){var _0x51ea72=_0x12163a||_0x572c4a;if(_0x51ea72){return handleError(_0x596295,0x191,_0x51ea72);}if(!_0x30357e){return handleError(_0x596295,0x194,{'message':_0x6724('0x2c')});}else{var _0x32a5b0={'payload':{'id':_0x30357e['id'],'role':_0x30357e[_0x6724('0x1f')]},'options':{'expiresIn':0x15180}};return authService[_0x6724('0x2d')](_0x32a5b0)[_0x6724('0x25')](function(_0x47bbf0){_0x596295[_0x6724('0x2e')]({'id':_0x30357e['id'],'token':_0x47bbf0,'statusCall':'','isAlreadyLogged':_0x30357e[_0x6724('0x2f')]});});}})(_0x6fd2aa,_0x596295,_0x3fbd8f);};passport[_0x6724('0x30')](_0x6724('0x31'),new LocalStrategy({'usernameField':_0x6724('0x1d'),'passwordField':_0x6724('0x32')},function(_0x1ff595,_0x2cd2c5,_0x13f1c4){return ActiveDirectoryAuthenticate(db[_0x6724('0x33')],_0x1ff595,_0x2cd2c5,_0x13f1c4);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 90d9b92..b08cf7f 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 _0x0076=['exports','express','Router','./authActiveDirectory.controller','post'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0076,0x6a));var _0x6007=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0076[_0xfae23b];return _0x200640;};'use strict';var express=require(_0x6007('0x0'));var router=express[_0x6007('0x1')]();var controller=require(_0x6007('0x2'));router[_0x6007('0x3')]('/',controller['login']);module[_0x6007('0x4')]=router;
\ No newline at end of file
+var _0xa179=['Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0xa179,0x16d));var _0x9a17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa179[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express[_0x9a17('0x0')]();var controller=require(_0x9a17('0x1'));router[_0x9a17('0x2')]('/',controller[_0x9a17('0x3')]);module[_0x9a17('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 8709e81..0e61886 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(_0x187f71,_0xf40f00){var _0xdf027a=function(_0x127e87){while(--_0x127e87){_0x187f71['push'](_0x187f71['shift']());}};_0xdf027a(++_0xf40f00);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x7a54,0x106));var _0x47a5=function(_0x18a9bc,_0x2457fc){_0x18a9bc=_0x18a9bc-0x0;var _0x14c6ae=_0x7a54[_0x18a9bc];return _0x14c6ae;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index d8107c2..a0ca8a8 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 _0x8ff3=['../user/user.controller.js','../../components/auth/service','login','get','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller'];(function(_0x2f0e79,_0x526f44){var _0x4e2500=function(_0x338759){while(--_0x338759){_0x2f0e79['push'](_0x2f0e79['shift']());}};_0x4e2500(++_0x526f44);}(_0x8ff3,0x1a9));var _0x38ff=function(_0x3b6bab,_0x4dd853){_0x3b6bab=_0x3b6bab-0x0;var _0x3f6478=_0x8ff3[_0x3b6bab];return _0x3f6478;};'use strict';var express=require(_0x38ff('0x0'));var passport=require(_0x38ff('0x1'));var router=express[_0x38ff('0x2')]();var controller=require(_0x38ff('0x3'));var userController=require(_0x38ff('0x4'));var authService=require(_0x38ff('0x5'));router['get']('/',controller[_0x38ff('0x6')]);router[_0x38ff('0x7')](_0x38ff('0x8'),controller[_0x38ff('0x9')],authService[_0x38ff('0xa')],userController[_0x38ff('0x6')],authService[_0x38ff('0xb')]);module[_0x38ff('0xc')]=router;
\ No newline at end of file
+var _0x7111=['express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','callback','login','setTokenCookie','exports'];(function(_0x8afdd0,_0x548ad1){var _0x3de7ac=function(_0x2dc2c4){while(--_0x2dc2c4){_0x8afdd0['push'](_0x8afdd0['shift']());}};_0x3de7ac(++_0x548ad1);}(_0x7111,0x19a));var _0x1711=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0x7111[_0x209ec9];return _0x129b1b;};'use strict';var express=require(_0x1711('0x0'));var passport=require(_0x1711('0x1'));var router=express['Router']();var controller=require(_0x1711('0x2'));var userController=require(_0x1711('0x3'));var authService=require(_0x1711('0x4'));router[_0x1711('0x5')]('/',controller['login']);router[_0x1711('0x5')]('/callback',controller[_0x1711('0x6')],authService['isMiddleware'],userController[_0x1711('0x7')],authService[_0x1711('0x8')]);module[_0x1711('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index e402449..5143285 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 _0x6fa4=['now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','Reset\x20Email\x20sent!','reset','params','token','enforcePasswordHistory','previousPasswords','password','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','jayson/promise','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','role','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','disabled','getLicense','catch','MailAccount','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6fa4,0x15d));var _0x46fa=function(_0x425d3e,_0x331f7c){_0x425d3e=_0x425d3e-0x0;var _0x2d1bf2=_0x6fa4[_0x425d3e];return _0x2d1bf2;};'use strict';var util=require(_0x46fa('0x0'));var passport=require(_0x46fa('0x1'));var LocalStrategy=require(_0x46fa('0x2'))['Strategy'];var jayson=require(_0x46fa('0x3'));var _=require('lodash');var rs=require('randomstring');var moment=require(_0x46fa('0x4'));var db=require(_0x46fa('0x5'))['db'];var authService=require(_0x46fa('0x6'));var utils=require(_0x46fa('0x7'));var client=jayson[_0x46fa('0x8')][_0x46fa('0x9')]({'port':0x232b});function localAuthenticate(_0x33da09,_0x4b02e7,_0x256a69,_0x1db1f9){var _0x2bf28c,_0x5a6e54;return db[_0x46fa('0xa')][_0x46fa('0xb')]({'where':{'id':0x1},'attributes':[_0x46fa('0xc'),_0x46fa('0xd')],'raw':!![]})[_0x46fa('0xe')](function(_0x5b6f1d){_0x2bf28c=_0x5b6f1d;return _0x33da09[_0x46fa('0xb')]({'attributes':['id',_0x46fa('0xf'),'password','salt',_0x46fa('0x10'),'disabled',_0x46fa('0x11'),_0x46fa('0x12'),_0x46fa('0x13')],'where':{'name':_0x4b02e7,'role':{'$or':[_0x46fa('0x14'),_0x46fa('0x15'),_0x46fa('0x16')]}}});})[_0x46fa('0xe')](function(_0x37385a){if(!_0x37385a||_0x37385a&&_0x37385a[_0x46fa('0xf')]!==_0x4b02e7){throw new Error(_0x46fa('0x17'));}else{_0x5a6e54=_0x37385a;return _0x5a6e54;}})[_0x46fa('0xe')](function(){_0x5a6e54[_0x46fa('0x18')](_0x256a69,function(_0x3dcfb1,_0x67a1c9){var _0x1f5e78=_0x5a6e54[_0x46fa('0x13')]+0x1;if(_0x3dcfb1){return _0x1db1f9(_0x3dcfb1);}else if(!_0x67a1c9){if(_0x5a6e54['disabled']){return _0x1db1f9(null,![],{'message':_0x46fa('0x17')});}else if(_0x2bf28c[_0x46fa('0xc')]>0x0){if(_0x5a6e54[_0x46fa('0x11')]){if(_0x2bf28c[_0x46fa('0xd')]>0x0){if(moment(_0x5a6e54[_0x46fa('0x12')])[_0x46fa('0x19')](_0x2bf28c[_0x46fa('0xd')],_0x46fa('0x1a'))>moment()){return _0x1db1f9(null,![],{'message':_0x46fa('0x17')});}else{return utils[_0x46fa('0x1b')](_0x5a6e54,_0x1f5e78,![],null)[_0x46fa('0xe')](function(){return _0x1db1f9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x1db1f9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x1f5e78>=_0x2bf28c[_0x46fa('0xc')]){return utils[_0x46fa('0x1b')](_0x5a6e54,0x0,!![],moment())[_0x46fa('0xe')](function(){return _0x1db1f9(null,![],{'message':_0x46fa('0x17')});});}else{return utils[_0x46fa('0x1b')](_0x5a6e54,_0x1f5e78,![],null)['then'](function(){return _0x1db1f9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x1db1f9(null,![],{'message':_0x46fa('0x17')});}}else{if(_0x5a6e54[_0x46fa('0x1c')]){return _0x1db1f9(null,![],{'message':_0x46fa('0x17')});}else if(_0x2bf28c[_0x46fa('0xc')]>0x0){if(_0x5a6e54[_0x46fa('0x11')]){if(_0x2bf28c['blockDuration']>0x0){if(moment(_0x5a6e54[_0x46fa('0x12')])[_0x46fa('0x19')](_0x2bf28c[_0x46fa('0xd')],_0x46fa('0x1a'))>moment()){return _0x1db1f9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x46fa('0x1b')](_0x5a6e54,0x0,![],null)['then'](function(){return utils['getLicense'](_0x5a6e54);})[_0x46fa('0xe')](function(){return _0x1db1f9(null,_0x5a6e54);});}}else{return _0x1db1f9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x46fa('0x1b')](_0x5a6e54,0x0,![],null)['then'](function(){return utils[_0x46fa('0x1d')](_0x5a6e54);})['then'](function(){return _0x1db1f9(null,_0x5a6e54);})[_0x46fa('0x1e')](function(_0x57d4cd){return _0x1db1f9(null,![],_0x57d4cd);});}}else{if(_0x5a6e54[_0x46fa('0x11')]){return _0x1db1f9(null,![],{'message':_0x46fa('0x17')});}else{return utils[_0x46fa('0x1d')](_0x5a6e54)[_0x46fa('0xe')](function(){return _0x1db1f9(null,_0x5a6e54);});}}}});})[_0x46fa('0x1e')](function(_0x419f20){return _0x1db1f9(null,![],_0x419f20);});}function sendServiceMail(_0x4461d8){return db[_0x46fa('0x1f')][_0x46fa('0x20')]({'where':{'service':!![]},'attributes':['id',_0x46fa('0xf'),_0x46fa('0x21')],'include':[{'model':db[_0x46fa('0x22')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0x46fa('0x23')}]}]})['then'](function(_0x51bc4f){if(!_0x51bc4f){throw new Error(_0x46fa('0x24'));}var _0x5925ca=_0x51bc4f[_0x46fa('0x25')]();var _0x5680bf={'account':_0x5925ca,'message':_[_0x46fa('0x26')]({'from':util[_0x46fa('0x27')](_0x46fa('0x28'),_0x51bc4f[_0x46fa('0xf')],_0x51bc4f['email']||_0x51bc4f[_0x46fa('0x29')][_0x46fa('0x15')])},_0x4461d8)};return client[_0x46fa('0x2a')](_0x46fa('0x2b'),_0x5680bf);})[_0x46fa('0xe')](function(_0x2ab4d8){if(_0x2ab4d8[_0x46fa('0x2c')]){throw new Error(util[_0x46fa('0x27')](_0x46fa('0x2d'),_0x2ab4d8[_0x46fa('0x2c')][_0x46fa('0x2e')]||JSON[_0x46fa('0x2f')](_0x2ab4d8[_0x46fa('0x2c')])));}return!![];});}function handleError(_0x5d44b2,_0x4f4e95,_0x2811ed){return _0x5d44b2[_0x46fa('0x30')](_0x4f4e95||0x1f4)[_0x46fa('0x31')]({'message':_0x2811ed?_0x2811ed[_0x46fa('0x2e')]||_0x2811ed:''});}exports[_0x46fa('0x32')]=function(_0x32f24b,_0x2986b5,_0x9be203){passport[_0x46fa('0x18')](_0x46fa('0x33'),function(_0x1cd985,_0x39e22a,_0x47c392){var _0x5b4249=_0x1cd985||_0x47c392;if(_0x5b4249){return handleError(_0x2986b5,0x191,_0x5b4249);}if(!_0x39e22a){return handleError(_0x2986b5,0x194,{'message':_0x46fa('0x34')});}else{var _0x3a0d5b={'payload':{'id':_0x39e22a['id'],'role':_0x39e22a[_0x46fa('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x46fa('0x35')](_0x3a0d5b)[_0x46fa('0xe')](function(_0x4c8702){_0x2986b5[_0x46fa('0x36')]({'id':_0x39e22a['id'],'token':_0x4c8702,'statusCall':'','isAlreadyLogged':_0x39e22a[_0x46fa('0x37')]});});}})(_0x32f24b,_0x2986b5,_0x9be203);};exports[_0x46fa('0x38')]=function(_0x492078,_0x4df1b0){if(!_0x492078[_0x46fa('0x39')][_0x46fa('0x21')]){return handleError(_0x4df1b0,0x1f4,{'message':_0x46fa('0x3a')});}var _0x148f19=rs[_0x46fa('0x3b')]();_0x492078[_0x46fa('0x39')][_0x46fa('0x21')]=_0x492078[_0x46fa('0x39')][_0x46fa('0x21')][_0x46fa('0x3c')]()[_0x46fa('0x3d')]();var _0x4e7f3e;return db['Setting'][_0x46fa('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x46fa('0xd')],'raw':!![]})[_0x46fa('0xe')](function(_0xee912d){_0x4e7f3e=_0xee912d;return db[_0x46fa('0x3e')][_0x46fa('0x20')]({'where':{'email':_0x492078[_0x46fa('0x39')][_0x46fa('0x21')]}});})['then'](function(_0x12ecb7){if(!_0x12ecb7){throw new Error(_0x46fa('0x3f'));}if(_0x12ecb7['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x12ecb7[_0x46fa('0x11')]){if(moment(_0x12ecb7['blockedAt'])['add'](_0x4e7f3e[_0x46fa('0xd')],'minutes')>moment()){throw new Error(_0x46fa('0x40'));}else{_0x12ecb7[_0x46fa('0x11')]=![];_0x12ecb7[_0x46fa('0x12')]=null;}}_0x12ecb7[_0x46fa('0x41')]=_0x148f19;_0x12ecb7['resetPasswordExpires']=Date[_0x46fa('0x42')]()+0x36ee80;return _0x12ecb7['save']();})['then'](function(){return sendServiceMail({'to':_0x492078[_0x46fa('0x39')][_0x46fa('0x21')],'subject':_0x46fa('0x43'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x46fa('0x44')+_0x46fa('0x45')+_0x492078[_0x46fa('0x46')][_0x46fa('0x47')]+_0x46fa('0x48')+_0x148f19+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x46fa('0xe')](function(){_0x4df1b0[_0x46fa('0x30')](0xc8)[_0x46fa('0x31')]({'message':_0x46fa('0x49')});})[_0x46fa('0x1e')](function(_0x54fea7){return handleError(_0x4df1b0,0x1f4,_0x54fea7);});};exports[_0x46fa('0x4a')]=function(_0x1aecaf,_0x3f45eb){return db['User'][_0x46fa('0x20')]({'where':{'resetPasswordToken':_0x1aecaf[_0x46fa('0x4b')][_0x46fa('0x4c')],'resetPasswordExpires':{'$gt':Date[_0x46fa('0x42')]()}}})[_0x46fa('0xe')](function(_0x1ef88d){if(!_0x1ef88d){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x46fa('0xa')]['findOne']({'attributes':['id','securePassword',_0x46fa('0x4d'),'passwordHistoryLimit']})['then'](function(_0x1607e1){if(_0x1607e1['securePassword'])authService['validatePasswordPattern'](_0x1aecaf['body']['password']);if(!_0x1607e1[_0x46fa('0x4d')]||!_0x1ef88d[_0x46fa('0x4e')])return _0x1ef88d;authService['validatePasswordHistory'](_0x1aecaf[_0x46fa('0x39')][_0x46fa('0x4f')],_0x1ef88d[_0x46fa('0x4e')],_0x1607e1['passwordHistoryLimit']);return _0x1ef88d;})[_0x46fa('0xe')](function(){_0x1ef88d[_0x46fa('0x4f')]=_0x1aecaf[_0x46fa('0x39')][_0x46fa('0x4f')];_0x1ef88d[_0x46fa('0x41')]=null;_0x1ef88d[_0x46fa('0x50')]=null;return _0x1ef88d['save']();});})['then'](function(){_0x3f45eb[_0x46fa('0x30')](0xc8)['send']({'message':_0x46fa('0x51')});})[_0x46fa('0x1e')](function(_0x474711){return handleError(_0x3f45eb,0x1f4,_0x474711);});};passport[_0x46fa('0x52')](_0x46fa('0x33'),new LocalStrategy({'usernameField':'name','passwordField':_0x46fa('0x4f')},function(_0xcd2035,_0x5d34f0,_0x23c412){return localAuthenticate(db[_0x46fa('0x3e')],_0xcd2035,_0x5d34f0,_0x23c412);}));
\ No newline at end of file
+var _0x351c=['The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','save','Password\x20reset!','use','local-login','util','passport','passport-local','jayson/promise','lodash','randomstring','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','password','salt','role','disabled','blockedAt','admin','agent','then','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','add','minutes','clearBlockUser','blocked','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','merge','format','\x22%s\x22\x20<%s>','user','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.'];(function(_0x22cf12,_0x2807f7){var _0x2e47e2=function(_0x41ad94){while(--_0x41ad94){_0x22cf12['push'](_0x22cf12['shift']());}};_0x2e47e2(++_0x2807f7);}(_0x351c,0xff));var _0xc351=function(_0x4625c1,_0x186658){_0x4625c1=_0x4625c1-0x0;var _0x57635c=_0x351c[_0x4625c1];return _0x57635c;};'use strict';var util=require(_0xc351('0x0'));var passport=require(_0xc351('0x1'));var LocalStrategy=require(_0xc351('0x2'))['Strategy'];var jayson=require(_0xc351('0x3'));var _=require(_0xc351('0x4'));var rs=require(_0xc351('0x5'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0xc351('0x6'));var utils=require(_0xc351('0x7'));var client=jayson[_0xc351('0x8')][_0xc351('0x9')]({'port':0x232b});function localAuthenticate(_0x57f226,_0x250f72,_0x5e148e,_0x244cf2){var _0x21a1e4,_0x5c78d0;return db[_0xc351('0xa')][_0xc351('0xb')]({'where':{'id':0x1},'attributes':[_0xc351('0xc'),_0xc351('0xd')],'raw':!![]})['then'](function(_0x3ca29e){_0x21a1e4=_0x3ca29e;return _0x57f226['findOne']({'attributes':['id','name',_0xc351('0xe'),_0xc351('0xf'),_0xc351('0x10'),_0xc351('0x11'),'blocked',_0xc351('0x12'),'loginAttempts'],'where':{'name':_0x250f72,'role':{'$or':[_0xc351('0x13'),'user',_0xc351('0x14')]}}});})[_0xc351('0x15')](function(_0x36ffeb){if(!_0x36ffeb||_0x36ffeb&&_0x36ffeb[_0xc351('0x16')]!==_0x250f72){throw new Error(_0xc351('0x17'));}else{_0x5c78d0=_0x36ffeb;return _0x5c78d0;}})['then'](function(){_0x5c78d0[_0xc351('0x18')](_0x5e148e,function(_0x4ec80b,_0x40c441){var _0x2a4e9e=_0x5c78d0[_0xc351('0x19')]+0x1;if(_0x4ec80b){return _0x244cf2(_0x4ec80b);}else if(!_0x40c441){if(_0x5c78d0[_0xc351('0x11')]){return _0x244cf2(null,![],{'message':_0xc351('0x17')});}else if(_0x21a1e4[_0xc351('0xc')]>0x0){if(_0x5c78d0['blocked']){if(_0x21a1e4['blockDuration']>0x0){if(moment(_0x5c78d0[_0xc351('0x12')])[_0xc351('0x1a')](_0x21a1e4[_0xc351('0xd')],_0xc351('0x1b'))>moment()){return _0x244cf2(null,![],{'message':_0xc351('0x17')});}else{return utils['clearBlockUser'](_0x5c78d0,_0x2a4e9e,![],null)[_0xc351('0x15')](function(){return _0x244cf2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x244cf2(null,![],{'message':_0xc351('0x17')});}}else{if(_0x2a4e9e>=_0x21a1e4['allowedLoginAttempts']){return utils[_0xc351('0x1c')](_0x5c78d0,0x0,!![],moment())[_0xc351('0x15')](function(){return _0x244cf2(null,![],{'message':_0xc351('0x17')});});}else{return utils[_0xc351('0x1c')](_0x5c78d0,_0x2a4e9e,![],null)['then'](function(){return _0x244cf2(null,![],{'message':_0xc351('0x17')});});}}}else{return _0x244cf2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x5c78d0[_0xc351('0x11')]){return _0x244cf2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x21a1e4[_0xc351('0xc')]>0x0){if(_0x5c78d0[_0xc351('0x1d')]){if(_0x21a1e4[_0xc351('0xd')]>0x0){if(moment(_0x5c78d0['blockedAt'])[_0xc351('0x1a')](_0x21a1e4['blockDuration'],'minutes')>moment()){return _0x244cf2(null,![],{'message':_0xc351('0x17')});}else{return utils[_0xc351('0x1c')](_0x5c78d0,0x0,![],null)['then'](function(){return utils[_0xc351('0x1e')](_0x5c78d0);})['then'](function(){return _0x244cf2(null,_0x5c78d0);});}}else{return _0x244cf2(null,![],{'message':_0xc351('0x17')});}}else{return utils[_0xc351('0x1c')](_0x5c78d0,0x0,![],null)[_0xc351('0x15')](function(){return utils[_0xc351('0x1e')](_0x5c78d0);})[_0xc351('0x15')](function(){return _0x244cf2(null,_0x5c78d0);})['catch'](function(_0x8e2e2c){return _0x244cf2(null,![],_0x8e2e2c);});}}else{if(_0x5c78d0['blocked']){return _0x244cf2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x5c78d0)['then'](function(){return _0x244cf2(null,_0x5c78d0);});}}}});})[_0xc351('0x1f')](function(_0xfd9a15){return _0x244cf2(null,![],_0xfd9a15);});}function sendServiceMail(_0x2846d2){return db['MailAccount'][_0xc351('0x20')]({'where':{'service':!![]},'attributes':['id',_0xc351('0x16'),_0xc351('0x21')],'include':[{'model':db[_0xc351('0x22')],'as':_0xc351('0x23'),'include':[{'model':db[_0xc351('0x24')],'as':_0xc351('0x24')}]}]})[_0xc351('0x15')](function(_0x519abb){if(!_0x519abb){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5c4dd5=_0x519abb['getSmtpOptions']();var _0x437bb6={'account':_0x5c4dd5,'message':_[_0xc351('0x25')]({'from':util[_0xc351('0x26')](_0xc351('0x27'),_0x519abb[_0xc351('0x16')],_0x519abb[_0xc351('0x21')]||_0x519abb['Smtp'][_0xc351('0x28')])},_0x2846d2)};return client['request']('SendMail',_0x437bb6);})[_0xc351('0x15')](function(_0x3303d7){if(_0x3303d7[_0xc351('0x29')]){throw new Error(util[_0xc351('0x26')](_0xc351('0x2a'),_0x3303d7[_0xc351('0x29')][_0xc351('0x2b')]||JSON[_0xc351('0x2c')](_0x3303d7[_0xc351('0x29')])));}return!![];});}function handleError(_0x12b683,_0xc3596b,_0x5c58a5){return _0x12b683[_0xc351('0x2d')](_0xc3596b||0x1f4)[_0xc351('0x2e')]({'message':_0x5c58a5?_0x5c58a5[_0xc351('0x2b')]||_0x5c58a5:''});}exports[_0xc351('0x2f')]=function(_0x5a3bc9,_0x50a70a,_0x396c32){passport[_0xc351('0x18')]('local-login',function(_0x3b6ab1,_0x6165b6,_0x4eb174){var _0x3e0b4a=_0x3b6ab1||_0x4eb174;if(_0x3e0b4a){return handleError(_0x50a70a,0x191,_0x3e0b4a);}if(!_0x6165b6){return handleError(_0x50a70a,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x531b17={'payload':{'id':_0x6165b6['id'],'role':_0x6165b6[_0xc351('0x10')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x531b17)[_0xc351('0x15')](function(_0xaea516){_0x50a70a[_0xc351('0x30')]({'id':_0x6165b6['id'],'token':_0xaea516,'statusCall':'','isAlreadyLogged':_0x6165b6[_0xc351('0x31')]});});}})(_0x5a3bc9,_0x50a70a,_0x396c32);};exports[_0xc351('0x32')]=function(_0x802d8,_0x3fbf0c){if(!_0x802d8[_0xc351('0x33')]['email']){return handleError(_0x3fbf0c,0x1f4,{'message':_0xc351('0x34')});}var _0x375718=rs[_0xc351('0x35')]();_0x802d8[_0xc351('0x33')][_0xc351('0x21')]=_0x802d8['body'][_0xc351('0x21')]['trim']()[_0xc351('0x36')]();var _0x417c3d;return db[_0xc351('0xa')][_0xc351('0xb')]({'where':{'id':0x1},'attributes':[_0xc351('0xc'),_0xc351('0xd')],'raw':!![]})[_0xc351('0x15')](function(_0x2f0f22){_0x417c3d=_0x2f0f22;return db[_0xc351('0x37')]['find']({'where':{'email':_0x802d8['body'][_0xc351('0x21')]}});})[_0xc351('0x15')](function(_0x433946){if(!_0x433946){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x433946['disabled']){throw new Error(_0xc351('0x38'));}if(_0x433946['blocked']){if(moment(_0x433946['blockedAt'])[_0xc351('0x1a')](_0x417c3d[_0xc351('0xd')],_0xc351('0x1b'))>moment()){throw new Error(_0xc351('0x39'));}else{_0x433946['blocked']=![];_0x433946[_0xc351('0x12')]=null;}}_0x433946[_0xc351('0x3a')]=_0x375718;_0x433946[_0xc351('0x3b')]=Date['now']()+0x36ee80;return _0x433946['save']();})[_0xc351('0x15')](function(){return sendServiceMail({'to':_0x802d8[_0xc351('0x33')][_0xc351('0x21')],'subject':_0xc351('0x3c'),'text':_0xc351('0x3d')+_0xc351('0x3e')+'https://'+_0x802d8['headers'][_0xc351('0x3f')]+'/reset/'+_0x375718+'\x0a\x0a'+_0xc351('0x40')});})['then'](function(){_0x3fbf0c[_0xc351('0x2d')](0xc8)[_0xc351('0x2e')]({'message':_0xc351('0x41')});})[_0xc351('0x1f')](function(_0x52064d){return handleError(_0x3fbf0c,0x1f4,_0x52064d);});};exports['reset']=function(_0x4465cc,_0x7a77d1){return db['User'][_0xc351('0x20')]({'where':{'resetPasswordToken':_0x4465cc[_0xc351('0x42')]['token'],'resetPasswordExpires':{'$gt':Date[_0xc351('0x43')]()}}})[_0xc351('0x15')](function(_0x276538){if(!_0x276538){throw new Error(_0xc351('0x44'));}return db[_0xc351('0xa')][_0xc351('0xb')]({'attributes':['id',_0xc351('0x45'),_0xc351('0x46'),_0xc351('0x47')]})['then'](function(_0x431235){if(_0x431235['securePassword'])authService[_0xc351('0x48')](_0x4465cc['body'][_0xc351('0xe')]);if(!_0x431235[_0xc351('0x46')]||!_0x276538[_0xc351('0x49')])return _0x276538;authService['validatePasswordHistory'](_0x4465cc[_0xc351('0x33')][_0xc351('0xe')],_0x276538[_0xc351('0x49')],_0x431235[_0xc351('0x47')]);return _0x276538;})[_0xc351('0x15')](function(){_0x276538[_0xc351('0xe')]=_0x4465cc[_0xc351('0x33')]['password'];_0x276538[_0xc351('0x3a')]=null;_0x276538[_0xc351('0x3b')]=null;return _0x276538[_0xc351('0x4a')]();});})['then'](function(){_0x7a77d1[_0xc351('0x2d')](0xc8)[_0xc351('0x2e')]({'message':_0xc351('0x4b')});})[_0xc351('0x1f')](function(_0x226252){return handleError(_0x7a77d1,0x1f4,_0x226252);});};passport[_0xc351('0x4c')](_0xc351('0x4d'),new LocalStrategy({'usernameField':_0xc351('0x16'),'passwordField':_0xc351('0xe')},function(_0x4aeaf5,_0x46bbb8,_0x2b6419){return localAuthenticate(db[_0xc351('0x37')],_0x4aeaf5,_0x46bbb8,_0x2b6419);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index b12df39..3c3bd48 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 _0x1cd7=['exports','./authLocal.controller','login','/forgot','forgot','post','/reset/:token','reset'];(function(_0x2d9144,_0x29691a){var _0x190bb8=function(_0x2b80ae){while(--_0x2b80ae){_0x2d9144['push'](_0x2d9144['shift']());}};_0x190bb8(++_0x29691a);}(_0x1cd7,0xb1));var _0x71cd=function(_0x190a54,_0x2d61d0){_0x190a54=_0x190a54-0x0;var _0x91adb0=_0x1cd7[_0x190a54];return _0x91adb0;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0x71cd('0x0'));router['post']('/',controller[_0x71cd('0x1')]);router['post'](_0x71cd('0x2'),controller[_0x71cd('0x3')]);router[_0x71cd('0x4')](_0x71cd('0x5'),controller[_0x71cd('0x6')]);module[_0x71cd('0x7')]=router;
\ No newline at end of file
+var _0xe82b=['login','/forgot','forgot','/reset/:token','reset','express','Router','./authLocal.controller','post'];(function(_0x1737a0,_0x11fb16){var _0x48d830=function(_0x5dc5a0){while(--_0x5dc5a0){_0x1737a0['push'](_0x1737a0['shift']());}};_0x48d830(++_0x11fb16);}(_0xe82b,0x125));var _0xbe82=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xe82b[_0x30ae5e];return _0x1f2e93;};'use strict';var express=require(_0xbe82('0x0'));var router=express[_0xbe82('0x1')]();var controller=require(_0xbe82('0x2'));router[_0xbe82('0x3')]('/',controller[_0xbe82('0x4')]);router[_0xbe82('0x3')](_0xbe82('0x5'),controller[_0xbe82('0x6')]);router[_0xbe82('0x3')](_0xbe82('0x7'),controller[_0xbe82('0x8')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 5ddfb9d..01772d8 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 _0x262e=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x454762,_0x480d8c){var _0x3c05c5=function(_0x4bc53e){while(--_0x4bc53e){_0x454762['push'](_0x454762['shift']());}};_0x3c05c5(++_0x480d8c);}(_0x262e,0x156));var _0xe262=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x262e[_0x173441];return _0x2423a8;};'use strict';var Sequelize=require(_0xe262('0x0'));module[_0xe262('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xe262('0x2')]},'description':{'type':Sequelize[_0xe262('0x2')]},'status':{'type':Sequelize[_0xe262('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe262('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xd0df=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x3c25d7,_0x50ebd0){var _0xd8d3a6=function(_0xfa4124){while(--_0xfa4124){_0x3c25d7['push'](_0x3c25d7['shift']());}};_0xd8d3a6(++_0x50ebd0);}(_0xd0df,0x1df));var _0xfd0d=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0xd0df[_0x43f881];return _0x365c14;};'use strict';var Sequelize=require(_0xfd0d('0x0'));module[_0xfd0d('0x1')]={'name':{'type':Sequelize[_0xfd0d('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xfd0d('0x2')]},'description':{'type':Sequelize[_0xfd0d('0x2')]},'status':{'type':Sequelize[_0xfd0d('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xfd0d('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 889d217..cf031c3 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 _0xb06c=['findOne','getConditions','hasOwnProperty','nolimit','addActions','Action','getActions','eml-format','zip-dir','moment','bluebird','mustache','util','path','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/environment','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','stack','name','index','map','Automation','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','VIRTUAL','findAll','rows','catch','show','rawAttributes','includeAll','include','options','find','create','body','params','destroy','Condition','addConditions','ids','omit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb06c,0x1f3));var _0xcb06=function(_0x35d17f,_0x9b51ae){_0x35d17f=_0x35d17f-0x0;var _0x1b20b2=_0xb06c[_0x35d17f];return _0x1b20b2;};'use strict';var emlformat=require(_0xcb06('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcb06('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcb06('0x2'));var BPromise=require(_0xcb06('0x3'));var Mustache=require(_0xcb06('0x4'));var util=require(_0xcb06('0x5'));var path=require(_0xcb06('0x6'));var sox=require(_0xcb06('0x7'));var csv=require('to-csv');var ejs=require(_0xcb06('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcb06('0x9'));var squel=require('squel');var crypto=require(_0xcb06('0xa'));var jsforce=require(_0xcb06('0xb'));var deskjs=require(_0xcb06('0xc'));var toCsv=require(_0xcb06('0xd'));var querystring=require(_0xcb06('0xe'));var Papa=require(_0xcb06('0xf'));var Redis=require(_0xcb06('0x10'));var authService=require(_0xcb06('0x11'));var qs=require(_0xcb06('0x12'));var as=require(_0xcb06('0x13'));var hardwareService=require(_0xcb06('0x14'));var logger=require(_0xcb06('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xcb06('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35c4ea,_0x3fac23){_0x3fac23=_0x3fac23||0xcc;return function(_0x20868f){if(_0x20868f){return _0x35c4ea['sendStatus'](_0x3fac23);}return _0x35c4ea[_0xcb06('0x17')](_0x3fac23)['end']();};}function respondWithResult(_0x212d81,_0x13b379){_0x13b379=_0x13b379||0xc8;return function(_0x2e47ce){if(_0x2e47ce){return _0x212d81[_0xcb06('0x17')](_0x13b379)[_0xcb06('0x18')](_0x2e47ce);}};}function respondWithFilteredResult(_0x2ae667,_0x46fbe1){return function(_0xb58947){if(_0xb58947){var _0x3676ce=typeof _0x46fbe1[_0xcb06('0x19')]==='undefined'&&typeof _0x46fbe1['limit']===_0xcb06('0x1a');var _0x229d9a=_0xb58947['count'];var _0x51fce6=_0x3676ce?0x0:_0x46fbe1[_0xcb06('0x19')];var _0x5ddb3d=_0x3676ce?_0xb58947[_0xcb06('0x1b')]:_0x46fbe1[_0xcb06('0x19')]+_0x46fbe1[_0xcb06('0x1c')];var _0x28f50d;if(_0x5ddb3d>=_0x229d9a){_0x5ddb3d=_0x229d9a;_0x28f50d=0xc8;}else{_0x28f50d=0xce;}_0x2ae667[_0xcb06('0x17')](_0x28f50d);return _0x2ae667[_0xcb06('0x1d')]('Content-Range',_0x51fce6+'-'+_0x5ddb3d+'/'+_0x229d9a)[_0xcb06('0x18')](_0xb58947);}return null;};}function patchUpdates(_0x72cebc){return function(_0x1f0862){try{jsonpatch[_0xcb06('0x1e')](_0x1f0862,_0x72cebc,!![]);}catch(_0x3df251){return BPromise[_0xcb06('0x1f')](_0x3df251);}return _0x1f0862[_0xcb06('0x20')]();};}function saveUpdates(_0x1f2dd3,_0x496c6f){return function(_0x441d78){if(_0x441d78){return _0x441d78[_0xcb06('0x21')](_0x1f2dd3)[_0xcb06('0x22')](function(_0x2b8521){return _0x2b8521;});}return null;};}function removeEntity(_0x46373e,_0x30ff21){return function(_0x4b7471){if(_0x4b7471){return _0x4b7471['destroy']()[_0xcb06('0x22')](function(){_0x46373e[_0xcb06('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fc387,_0x1b43fa){return function(_0x44550b){if(!_0x44550b){_0x4fc387['sendStatus'](0x194);}return _0x44550b;};}function handleError(_0x33a723,_0x4ea798){_0x4ea798=_0x4ea798||0x1f4;return function(_0x20ef7d){logger['error'](_0x20ef7d[_0xcb06('0x23')]);if(_0x20ef7d[_0xcb06('0x24')]){delete _0x20ef7d[_0xcb06('0x24')];}_0x33a723[_0xcb06('0x17')](_0x4ea798)['send'](_0x20ef7d);};}exports[_0xcb06('0x25')]=function(_0xffe81c,_0x2a078d){var _0x2a4447={},_0x2a51d4={},_0x9f0fff={'count':0x0,'rows':[]};var _0x326e00=_[_0xcb06('0x26')](db[_0xcb06('0x27')]['rawAttributes'],function(_0x820d4){return{'name':_0x820d4[_0xcb06('0x28')],'type':_0x820d4[_0xcb06('0x29')][_0xcb06('0x2a')]};});_0x2a51d4[_0xcb06('0x2b')]=_[_0xcb06('0x26')](_0x326e00,_0xcb06('0x24'));_0x2a51d4[_0xcb06('0x2c')]=_[_0xcb06('0x2d')](_0xffe81c['query']);_0x2a51d4[_0xcb06('0x2e')]=_[_0xcb06('0x2f')](_0x2a51d4['model'],_0x2a51d4[_0xcb06('0x2c')]);_0x2a4447[_0xcb06('0x30')]=_[_0xcb06('0x2f')](_0x2a51d4[_0xcb06('0x2b')],qs[_0xcb06('0x31')](_0xffe81c['query'][_0xcb06('0x31')]));_0x2a4447[_0xcb06('0x30')]=_0x2a4447[_0xcb06('0x30')][_0xcb06('0x32')]?_0x2a4447[_0xcb06('0x30')]:_0x2a51d4[_0xcb06('0x2b')];if(!_0xffe81c[_0xcb06('0x2c')]['hasOwnProperty']('nolimit')){_0x2a4447[_0xcb06('0x1c')]=qs[_0xcb06('0x1c')](_0xffe81c['query']['limit']);_0x2a4447['offset']=qs[_0xcb06('0x19')](_0xffe81c[_0xcb06('0x2c')][_0xcb06('0x19')]);}_0x2a4447[_0xcb06('0x33')]=qs[_0xcb06('0x34')](_0xffe81c['query'][_0xcb06('0x34')]);_0x2a4447['where']=qs[_0xcb06('0x2e')](_[_0xcb06('0x35')](_0xffe81c[_0xcb06('0x2c')],_0x2a51d4[_0xcb06('0x2e')]),_0x326e00);if(_0xffe81c[_0xcb06('0x2c')][_0xcb06('0x36')]){_0x2a4447[_0xcb06('0x37')]=_[_0xcb06('0x38')](_0x2a4447['where'],{'$or':_[_0xcb06('0x26')](_0x326e00,function(_0x4ff4b1){if(_0x4ff4b1[_0xcb06('0x29')]!==_0xcb06('0x39')){var _0x56c6cd={};_0x56c6cd[_0x4ff4b1['name']]={'$like':'%'+_0xffe81c[_0xcb06('0x2c')]['filter']+'%'};return _0x56c6cd;}})});}_0x2a4447=_[_0xcb06('0x38')]({},_0x2a4447,_0xffe81c['options']);var _0x3f914f={'where':_0x2a4447[_0xcb06('0x37')]};return db[_0xcb06('0x27')][_0xcb06('0x1b')](_0x3f914f)[_0xcb06('0x22')](function(_0x44ddc4){_0x9f0fff[_0xcb06('0x1b')]=_0x44ddc4;if(_0xffe81c[_0xcb06('0x2c')]['includeAll']){_0x2a4447['include']=[{'all':!![]}];}return db[_0xcb06('0x27')][_0xcb06('0x3a')](_0x2a4447);})[_0xcb06('0x22')](function(_0x11d594){_0x9f0fff[_0xcb06('0x3b')]=_0x11d594;return _0x9f0fff;})[_0xcb06('0x22')](respondWithFilteredResult(_0x2a078d,_0x2a4447))[_0xcb06('0x3c')](handleError(_0x2a078d,null));};exports[_0xcb06('0x3d')]=function(_0x4c0bd8,_0x3a1e0f){var _0x3fdce0={'raw':![],'where':{'id':_0x4c0bd8['params']['id']}},_0x3b812d={};_0x3b812d['model']=_[_0xcb06('0x2d')](db[_0xcb06('0x27')][_0xcb06('0x3e')]);_0x3b812d[_0xcb06('0x2c')]=_[_0xcb06('0x2d')](_0x4c0bd8[_0xcb06('0x2c')]);_0x3b812d[_0xcb06('0x2e')]=_[_0xcb06('0x2f')](_0x3b812d[_0xcb06('0x2b')],_0x3b812d[_0xcb06('0x2c')]);_0x3fdce0[_0xcb06('0x30')]=_['intersection'](_0x3b812d[_0xcb06('0x2b')],qs[_0xcb06('0x31')](_0x4c0bd8[_0xcb06('0x2c')][_0xcb06('0x31')]));_0x3fdce0['attributes']=_0x3fdce0[_0xcb06('0x30')]['length']?_0x3fdce0[_0xcb06('0x30')]:_0x3b812d['model'];if(_0x4c0bd8[_0xcb06('0x2c')][_0xcb06('0x3f')]){_0x3fdce0[_0xcb06('0x40')]=[{'all':!![]}];}_0x3fdce0=_[_0xcb06('0x38')]({},_0x3fdce0,_0x4c0bd8[_0xcb06('0x41')]);return db['Automation'][_0xcb06('0x42')](_0x3fdce0)[_0xcb06('0x22')](handleEntityNotFound(_0x3a1e0f,null))[_0xcb06('0x22')](respondWithResult(_0x3a1e0f,null))[_0xcb06('0x3c')](handleError(_0x3a1e0f,null));};exports[_0xcb06('0x43')]=function(_0x26094e,_0x1581da){return db[_0xcb06('0x27')][_0xcb06('0x43')](_0x26094e[_0xcb06('0x44')],{})[_0xcb06('0x22')](respondWithResult(_0x1581da,0xc9))['catch'](handleError(_0x1581da,null));};exports[_0xcb06('0x21')]=function(_0xb5578c,_0x57736d){if(_0xb5578c['body']['id']){delete _0xb5578c[_0xcb06('0x44')]['id'];}return db[_0xcb06('0x27')][_0xcb06('0x42')]({'where':{'id':_0xb5578c[_0xcb06('0x45')]['id']}})[_0xcb06('0x22')](handleEntityNotFound(_0x57736d,null))[_0xcb06('0x22')](saveUpdates(_0xb5578c['body'],null))[_0xcb06('0x22')](respondWithResult(_0x57736d,null))[_0xcb06('0x3c')](handleError(_0x57736d,null));};exports[_0xcb06('0x46')]=function(_0x3930de,_0x418469){return db['Automation'][_0xcb06('0x42')]({'where':{'id':_0x3930de[_0xcb06('0x45')]['id']}})[_0xcb06('0x22')](handleEntityNotFound(_0x418469,null))[_0xcb06('0x22')](removeEntity(_0x418469,null))['catch'](handleError(_0x418469,null));};exports['addConditions']=function(_0x36e4f1,_0x537bea,_0x388d93){return db[_0xcb06('0x47')][_0xcb06('0x42')]({'where':{'id':_0x36e4f1[_0xcb06('0x45')]['id']}})['then'](handleEntityNotFound(_0x537bea,null))[_0xcb06('0x22')](function(_0x695593){if(_0x695593){return _0x695593[_0xcb06('0x48')](_0x36e4f1[_0xcb06('0x44')][_0xcb06('0x49')],_[_0xcb06('0x4a')](_0x36e4f1[_0xcb06('0x44')],[_0xcb06('0x49'),'id'])||{});}})[_0xcb06('0x22')](respondWithResult(_0x537bea,null))['catch'](handleError(_0x537bea,null));};exports['getConditions']=function(_0x2aa377,_0x3f628c,_0x2f0aaa){var _0x2afcc0={};var _0x73e0a4={};var _0x42bf01;var _0x15b869;return db[_0xcb06('0x27')][_0xcb06('0x4b')]({'where':{'id':_0x2aa377[_0xcb06('0x45')]['id']}})[_0xcb06('0x22')](handleEntityNotFound(_0x3f628c,null))[_0xcb06('0x22')](function(_0x22e5a8){if(_0x22e5a8){_0x42bf01=_0x22e5a8;_0x73e0a4[_0xcb06('0x2b')]=_[_0xcb06('0x2d')](db[_0xcb06('0x47')][_0xcb06('0x3e')]);_0x73e0a4['query']=_['keys'](_0x2aa377['query']);_0x73e0a4['filters']=_[_0xcb06('0x2f')](_0x73e0a4[_0xcb06('0x2b')],_0x73e0a4['query']);_0x2afcc0[_0xcb06('0x30')]=_['intersection'](_0x73e0a4['model'],qs['fields'](_0x2aa377[_0xcb06('0x2c')][_0xcb06('0x31')]));_0x2afcc0[_0xcb06('0x30')]=_0x2afcc0[_0xcb06('0x30')]['length']?_0x2afcc0['attributes']:_0x73e0a4['model'];_0x2afcc0[_0xcb06('0x33')]=qs[_0xcb06('0x34')](_0x2aa377[_0xcb06('0x2c')][_0xcb06('0x34')]);_0x2afcc0[_0xcb06('0x37')]=qs[_0xcb06('0x2e')](_['pick'](_0x2aa377['query'],_0x73e0a4[_0xcb06('0x2e')]));if(_0x2aa377[_0xcb06('0x2c')][_0xcb06('0x36')]){_0x2afcc0[_0xcb06('0x37')]=_[_0xcb06('0x38')](_0x2afcc0[_0xcb06('0x37')],{'$or':_[_0xcb06('0x26')](_0x2afcc0['attributes'],function(_0x2e9121){var _0x1256de={};_0x1256de[_0x2e9121]={'$like':'%'+_0x2aa377[_0xcb06('0x2c')][_0xcb06('0x36')]+'%'};return _0x1256de;})});}_0x2afcc0=_['merge']({},_0x2afcc0,_0x2aa377[_0xcb06('0x41')]);return _0x42bf01[_0xcb06('0x4c')](_0x2afcc0);}})[_0xcb06('0x22')](function(_0x2b0c22){if(_0x2b0c22){_0x15b869=_0x2b0c22[_0xcb06('0x32')];if(!_0x2aa377[_0xcb06('0x2c')][_0xcb06('0x4d')](_0xcb06('0x4e'))){_0x2afcc0[_0xcb06('0x1c')]=qs['limit'](_0x2aa377[_0xcb06('0x2c')]['limit']);_0x2afcc0[_0xcb06('0x19')]=qs['offset'](_0x2aa377['query'][_0xcb06('0x19')]);}return _0x42bf01[_0xcb06('0x4c')](_0x2afcc0);}})[_0xcb06('0x22')](function(_0x152823){if(_0x152823){return _0x152823?{'count':_0x15b869,'rows':_0x152823}:null;}})[_0xcb06('0x22')](respondWithResult(_0x3f628c,null))[_0xcb06('0x3c')](handleError(_0x3f628c,null));};exports[_0xcb06('0x4f')]=function(_0x43bf9c,_0x4a6cae,_0x93f8d6){return db['Action'][_0xcb06('0x42')]({'where':{'id':_0x43bf9c[_0xcb06('0x45')]['id']}})[_0xcb06('0x22')](handleEntityNotFound(_0x4a6cae,null))['then'](function(_0xa35df8){if(_0xa35df8){return _0xa35df8[_0xcb06('0x4f')](_0x43bf9c[_0xcb06('0x44')][_0xcb06('0x49')],_[_0xcb06('0x4a')](_0x43bf9c['body'],['ids','id'])||{});}})[_0xcb06('0x22')](respondWithResult(_0x4a6cae,null))[_0xcb06('0x3c')](handleError(_0x4a6cae,null));};exports['getActions']=function(_0x426efc,_0x5ec4eb,_0x507013){var _0x4ac03c={};var _0x3ecd16={};var _0x3cbd62;var _0x57f46c;return db[_0xcb06('0x27')]['findOne']({'where':{'id':_0x426efc[_0xcb06('0x45')]['id']}})[_0xcb06('0x22')](handleEntityNotFound(_0x5ec4eb,null))[_0xcb06('0x22')](function(_0x1ab9ed){if(_0x1ab9ed){_0x3cbd62=_0x1ab9ed;_0x3ecd16[_0xcb06('0x2b')]=_[_0xcb06('0x2d')](db[_0xcb06('0x50')][_0xcb06('0x3e')]);_0x3ecd16[_0xcb06('0x2c')]=_['keys'](_0x426efc[_0xcb06('0x2c')]);_0x3ecd16[_0xcb06('0x2e')]=_[_0xcb06('0x2f')](_0x3ecd16[_0xcb06('0x2b')],_0x3ecd16[_0xcb06('0x2c')]);_0x4ac03c[_0xcb06('0x30')]=_['intersection'](_0x3ecd16[_0xcb06('0x2b')],qs[_0xcb06('0x31')](_0x426efc[_0xcb06('0x2c')][_0xcb06('0x31')]));_0x4ac03c[_0xcb06('0x30')]=_0x4ac03c[_0xcb06('0x30')][_0xcb06('0x32')]?_0x4ac03c[_0xcb06('0x30')]:_0x3ecd16[_0xcb06('0x2b')];_0x4ac03c[_0xcb06('0x33')]=qs['sort'](_0x426efc[_0xcb06('0x2c')][_0xcb06('0x34')]);_0x4ac03c[_0xcb06('0x37')]=qs[_0xcb06('0x2e')](_[_0xcb06('0x35')](_0x426efc[_0xcb06('0x2c')],_0x3ecd16[_0xcb06('0x2e')]));if(_0x426efc[_0xcb06('0x2c')]['filter']){_0x4ac03c[_0xcb06('0x37')]=_[_0xcb06('0x38')](_0x4ac03c[_0xcb06('0x37')],{'$or':_['map'](_0x4ac03c['attributes'],function(_0x45bcc9){var _0x1b60b2={};_0x1b60b2[_0x45bcc9]={'$like':'%'+_0x426efc[_0xcb06('0x2c')][_0xcb06('0x36')]+'%'};return _0x1b60b2;})});}_0x4ac03c=_[_0xcb06('0x38')]({},_0x4ac03c,_0x426efc['options']);return _0x3cbd62[_0xcb06('0x51')](_0x4ac03c);}})[_0xcb06('0x22')](function(_0x4987e8){if(_0x4987e8){_0x57f46c=_0x4987e8[_0xcb06('0x32')];if(!_0x426efc[_0xcb06('0x2c')][_0xcb06('0x4d')](_0xcb06('0x4e'))){_0x4ac03c[_0xcb06('0x1c')]=qs[_0xcb06('0x1c')](_0x426efc[_0xcb06('0x2c')][_0xcb06('0x1c')]);_0x4ac03c['offset']=qs[_0xcb06('0x19')](_0x426efc['query'][_0xcb06('0x19')]);}return _0x3cbd62[_0xcb06('0x51')](_0x4ac03c);}})[_0xcb06('0x22')](function(_0x42ebd3){if(_0x42ebd3){return _0x42ebd3?{'count':_0x57f46c,'rows':_0x42ebd3}:null;}})[_0xcb06('0x22')](respondWithResult(_0x5ec4eb,null))[_0xcb06('0x3c')](handleError(_0x5ec4eb,null));};
\ No newline at end of file
+var _0x5994=['update','then','destroy','error','stack','name','index','Automation','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','keys','length','find','create','body','params','addConditions','omit','ids','getConditions','findOne','Condition','addActions','getActions','Action','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save'];(function(_0x4c9efc,_0x416853){var _0x58197d=function(_0x2ee00d){while(--_0x2ee00d){_0x4c9efc['push'](_0x4c9efc['shift']());}};_0x58197d(++_0x416853);}(_0x5994,0x11d));var _0x4599=function(_0x1c463b,_0x5fd405){_0x1c463b=_0x1c463b-0x0;var _0x39f8a4=_0x5994[_0x1c463b];return _0x39f8a4;};'use strict';var emlformat=require(_0x4599('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4599('0x1'));var moment=require(_0x4599('0x2'));var BPromise=require(_0x4599('0x3'));var Mustache=require(_0x4599('0x4'));var util=require(_0x4599('0x5'));var path=require(_0x4599('0x6'));var sox=require(_0x4599('0x7'));var csv=require(_0x4599('0x8'));var ejs=require(_0x4599('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4599('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4599('0xb'));var toCsv=require(_0x4599('0x8'));var querystring=require(_0x4599('0xc'));var Papa=require(_0x4599('0xd'));var Redis=require(_0x4599('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4599('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4599('0x10'))(_0x4599('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4599('0x12'));var db=require(_0x4599('0x13'))['db'];function respondWithStatusCode(_0x4abbe7,_0x4cd02e){_0x4cd02e=_0x4cd02e||0xcc;return function(_0x5aa1f6){if(_0x5aa1f6){return _0x4abbe7[_0x4599('0x14')](_0x4cd02e);}return _0x4abbe7[_0x4599('0x15')](_0x4cd02e)['end']();};}function respondWithResult(_0x29fa17,_0xd7642b){_0xd7642b=_0xd7642b||0xc8;return function(_0x531780){if(_0x531780){return _0x29fa17[_0x4599('0x15')](_0xd7642b)['json'](_0x531780);}};}function respondWithFilteredResult(_0x196080,_0x4168cf){return function(_0x40abdc){if(_0x40abdc){var _0x521058=typeof _0x4168cf[_0x4599('0x16')]===_0x4599('0x17')&&typeof _0x4168cf['limit']===_0x4599('0x17');var _0x1f968f=_0x40abdc[_0x4599('0x18')];var _0x4ed79a=_0x521058?0x0:_0x4168cf[_0x4599('0x16')];var _0x58f343=_0x521058?_0x40abdc['count']:_0x4168cf[_0x4599('0x16')]+_0x4168cf[_0x4599('0x19')];var _0x8304c1;if(_0x58f343>=_0x1f968f){_0x58f343=_0x1f968f;_0x8304c1=0xc8;}else{_0x8304c1=0xce;}_0x196080[_0x4599('0x15')](_0x8304c1);return _0x196080[_0x4599('0x1a')](_0x4599('0x1b'),_0x4ed79a+'-'+_0x58f343+'/'+_0x1f968f)[_0x4599('0x1c')](_0x40abdc);}return null;};}function patchUpdates(_0x4586a9){return function(_0x2eee2f){try{jsonpatch['apply'](_0x2eee2f,_0x4586a9,!![]);}catch(_0x360ab2){return BPromise[_0x4599('0x1d')](_0x360ab2);}return _0x2eee2f[_0x4599('0x1e')]();};}function saveUpdates(_0x14c89d,_0x5d7b4e){return function(_0x541030){if(_0x541030){return _0x541030[_0x4599('0x1f')](_0x14c89d)[_0x4599('0x20')](function(_0x2cd75a){return _0x2cd75a;});}return null;};}function removeEntity(_0x51ff32,_0x270cf7){return function(_0x1f090d){if(_0x1f090d){return _0x1f090d[_0x4599('0x21')]()[_0x4599('0x20')](function(){_0x51ff32[_0x4599('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e50e9,_0x281b66){return function(_0x3f3fcc){if(!_0x3f3fcc){_0x1e50e9['sendStatus'](0x194);}return _0x3f3fcc;};}function handleError(_0x30c1c3,_0xbed598){_0xbed598=_0xbed598||0x1f4;return function(_0x525369){logger[_0x4599('0x22')](_0x525369[_0x4599('0x23')]);if(_0x525369[_0x4599('0x24')]){delete _0x525369[_0x4599('0x24')];}_0x30c1c3['status'](_0xbed598)['send'](_0x525369);};}exports[_0x4599('0x25')]=function(_0x344ea7,_0x4f25cc){var _0xec3151={},_0x5d5c11={},_0x44eb43={'count':0x0,'rows':[]};var _0x427dca=_['map'](db[_0x4599('0x26')][_0x4599('0x27')],function(_0x45f4d3){return{'name':_0x45f4d3[_0x4599('0x28')],'type':_0x45f4d3[_0x4599('0x29')]['key']};});_0x5d5c11[_0x4599('0x2a')]=_[_0x4599('0x2b')](_0x427dca,'name');_0x5d5c11['query']=_['keys'](_0x344ea7[_0x4599('0x2c')]);_0x5d5c11[_0x4599('0x2d')]=_[_0x4599('0x2e')](_0x5d5c11[_0x4599('0x2a')],_0x5d5c11[_0x4599('0x2c')]);_0xec3151[_0x4599('0x2f')]=_[_0x4599('0x2e')](_0x5d5c11['model'],qs[_0x4599('0x30')](_0x344ea7['query'][_0x4599('0x30')]));_0xec3151[_0x4599('0x2f')]=_0xec3151['attributes']['length']?_0xec3151[_0x4599('0x2f')]:_0x5d5c11[_0x4599('0x2a')];if(!_0x344ea7['query'][_0x4599('0x31')](_0x4599('0x32'))){_0xec3151[_0x4599('0x19')]=qs[_0x4599('0x19')](_0x344ea7[_0x4599('0x2c')][_0x4599('0x19')]);_0xec3151[_0x4599('0x16')]=qs[_0x4599('0x16')](_0x344ea7[_0x4599('0x2c')][_0x4599('0x16')]);}_0xec3151[_0x4599('0x33')]=qs['sort'](_0x344ea7[_0x4599('0x2c')][_0x4599('0x34')]);_0xec3151[_0x4599('0x35')]=qs['filters'](_[_0x4599('0x36')](_0x344ea7[_0x4599('0x2c')],_0x5d5c11[_0x4599('0x2d')]),_0x427dca);if(_0x344ea7[_0x4599('0x2c')]['filter']){_0xec3151[_0x4599('0x35')]=_[_0x4599('0x37')](_0xec3151[_0x4599('0x35')],{'$or':_[_0x4599('0x2b')](_0x427dca,function(_0x3cbf6b){if(_0x3cbf6b[_0x4599('0x29')]!==_0x4599('0x38')){var _0x48b78a={};_0x48b78a[_0x3cbf6b['name']]={'$like':'%'+_0x344ea7[_0x4599('0x2c')][_0x4599('0x39')]+'%'};return _0x48b78a;}})});}_0xec3151=_['merge']({},_0xec3151,_0x344ea7[_0x4599('0x3a')]);var _0xeb7a18={'where':_0xec3151[_0x4599('0x35')]};return db[_0x4599('0x26')][_0x4599('0x18')](_0xeb7a18)['then'](function(_0x65b12){_0x44eb43['count']=_0x65b12;if(_0x344ea7['query'][_0x4599('0x3b')]){_0xec3151['include']=[{'all':!![]}];}return db[_0x4599('0x26')][_0x4599('0x3c')](_0xec3151);})[_0x4599('0x20')](function(_0xf92e20){_0x44eb43[_0x4599('0x3d')]=_0xf92e20;return _0x44eb43;})[_0x4599('0x20')](respondWithFilteredResult(_0x4f25cc,_0xec3151))[_0x4599('0x3e')](handleError(_0x4f25cc,null));};exports[_0x4599('0x3f')]=function(_0x5b34fc,_0x13f4f7){var _0x5214c0={'raw':![],'where':{'id':_0x5b34fc['params']['id']}},_0x32a7a5={};_0x32a7a5['model']=_['keys'](db['Automation']['rawAttributes']);_0x32a7a5[_0x4599('0x2c')]=_[_0x4599('0x40')](_0x5b34fc[_0x4599('0x2c')]);_0x32a7a5[_0x4599('0x2d')]=_[_0x4599('0x2e')](_0x32a7a5[_0x4599('0x2a')],_0x32a7a5[_0x4599('0x2c')]);_0x5214c0[_0x4599('0x2f')]=_['intersection'](_0x32a7a5['model'],qs[_0x4599('0x30')](_0x5b34fc[_0x4599('0x2c')][_0x4599('0x30')]));_0x5214c0[_0x4599('0x2f')]=_0x5214c0[_0x4599('0x2f')][_0x4599('0x41')]?_0x5214c0[_0x4599('0x2f')]:_0x32a7a5[_0x4599('0x2a')];if(_0x5b34fc[_0x4599('0x2c')][_0x4599('0x3b')]){_0x5214c0['include']=[{'all':!![]}];}_0x5214c0=_[_0x4599('0x37')]({},_0x5214c0,_0x5b34fc[_0x4599('0x3a')]);return db[_0x4599('0x26')][_0x4599('0x42')](_0x5214c0)[_0x4599('0x20')](handleEntityNotFound(_0x13f4f7,null))[_0x4599('0x20')](respondWithResult(_0x13f4f7,null))[_0x4599('0x3e')](handleError(_0x13f4f7,null));};exports[_0x4599('0x43')]=function(_0x2c3ff1,_0x26f544){return db['Automation'][_0x4599('0x43')](_0x2c3ff1['body'],{})[_0x4599('0x20')](respondWithResult(_0x26f544,0xc9))[_0x4599('0x3e')](handleError(_0x26f544,null));};exports['update']=function(_0x3ae371,_0x169df3){if(_0x3ae371[_0x4599('0x44')]['id']){delete _0x3ae371[_0x4599('0x44')]['id'];}return db['Automation'][_0x4599('0x42')]({'where':{'id':_0x3ae371['params']['id']}})['then'](handleEntityNotFound(_0x169df3,null))[_0x4599('0x20')](saveUpdates(_0x3ae371[_0x4599('0x44')],null))[_0x4599('0x20')](respondWithResult(_0x169df3,null))[_0x4599('0x3e')](handleError(_0x169df3,null));};exports[_0x4599('0x21')]=function(_0xbca1b8,_0x10761f){return db['Automation'][_0x4599('0x42')]({'where':{'id':_0xbca1b8[_0x4599('0x45')]['id']}})[_0x4599('0x20')](handleEntityNotFound(_0x10761f,null))[_0x4599('0x20')](removeEntity(_0x10761f,null))[_0x4599('0x3e')](handleError(_0x10761f,null));};exports[_0x4599('0x46')]=function(_0x101854,_0xb57f07,_0x2fc88b){return db['Condition'][_0x4599('0x42')]({'where':{'id':_0x101854['params']['id']}})[_0x4599('0x20')](handleEntityNotFound(_0xb57f07,null))[_0x4599('0x20')](function(_0x265f9b){if(_0x265f9b){return _0x265f9b[_0x4599('0x46')](_0x101854['body']['ids'],_[_0x4599('0x47')](_0x101854[_0x4599('0x44')],[_0x4599('0x48'),'id'])||{});}})[_0x4599('0x20')](respondWithResult(_0xb57f07,null))[_0x4599('0x3e')](handleError(_0xb57f07,null));};exports[_0x4599('0x49')]=function(_0xd4b04b,_0x42522e,_0x5ece82){var _0x3f0c3c={};var _0x32e312={};var _0x5e0c45;var _0x3463e3;return db[_0x4599('0x26')][_0x4599('0x4a')]({'where':{'id':_0xd4b04b[_0x4599('0x45')]['id']}})[_0x4599('0x20')](handleEntityNotFound(_0x42522e,null))['then'](function(_0x4c60a4){if(_0x4c60a4){_0x5e0c45=_0x4c60a4;_0x32e312[_0x4599('0x2a')]=_['keys'](db[_0x4599('0x4b')][_0x4599('0x27')]);_0x32e312[_0x4599('0x2c')]=_[_0x4599('0x40')](_0xd4b04b[_0x4599('0x2c')]);_0x32e312[_0x4599('0x2d')]=_['intersection'](_0x32e312[_0x4599('0x2a')],_0x32e312[_0x4599('0x2c')]);_0x3f0c3c['attributes']=_[_0x4599('0x2e')](_0x32e312[_0x4599('0x2a')],qs['fields'](_0xd4b04b[_0x4599('0x2c')][_0x4599('0x30')]));_0x3f0c3c[_0x4599('0x2f')]=_0x3f0c3c['attributes'][_0x4599('0x41')]?_0x3f0c3c[_0x4599('0x2f')]:_0x32e312[_0x4599('0x2a')];_0x3f0c3c[_0x4599('0x33')]=qs[_0x4599('0x34')](_0xd4b04b[_0x4599('0x2c')][_0x4599('0x34')]);_0x3f0c3c['where']=qs[_0x4599('0x2d')](_[_0x4599('0x36')](_0xd4b04b[_0x4599('0x2c')],_0x32e312[_0x4599('0x2d')]));if(_0xd4b04b[_0x4599('0x2c')]['filter']){_0x3f0c3c['where']=_[_0x4599('0x37')](_0x3f0c3c[_0x4599('0x35')],{'$or':_[_0x4599('0x2b')](_0x3f0c3c['attributes'],function(_0xa448da){var _0x111d4c={};_0x111d4c[_0xa448da]={'$like':'%'+_0xd4b04b[_0x4599('0x2c')][_0x4599('0x39')]+'%'};return _0x111d4c;})});}_0x3f0c3c=_['merge']({},_0x3f0c3c,_0xd4b04b[_0x4599('0x3a')]);return _0x5e0c45['getConditions'](_0x3f0c3c);}})['then'](function(_0x261999){if(_0x261999){_0x3463e3=_0x261999['length'];if(!_0xd4b04b[_0x4599('0x2c')][_0x4599('0x31')](_0x4599('0x32'))){_0x3f0c3c[_0x4599('0x19')]=qs[_0x4599('0x19')](_0xd4b04b['query'][_0x4599('0x19')]);_0x3f0c3c[_0x4599('0x16')]=qs[_0x4599('0x16')](_0xd4b04b[_0x4599('0x2c')]['offset']);}return _0x5e0c45[_0x4599('0x49')](_0x3f0c3c);}})[_0x4599('0x20')](function(_0x502b5b){if(_0x502b5b){return _0x502b5b?{'count':_0x3463e3,'rows':_0x502b5b}:null;}})[_0x4599('0x20')](respondWithResult(_0x42522e,null))[_0x4599('0x3e')](handleError(_0x42522e,null));};exports[_0x4599('0x4c')]=function(_0x10fcd7,_0x21d4c2,_0x14163f){return db['Action']['find']({'where':{'id':_0x10fcd7[_0x4599('0x45')]['id']}})[_0x4599('0x20')](handleEntityNotFound(_0x21d4c2,null))[_0x4599('0x20')](function(_0x357dfb){if(_0x357dfb){return _0x357dfb['addActions'](_0x10fcd7[_0x4599('0x44')][_0x4599('0x48')],_[_0x4599('0x47')](_0x10fcd7[_0x4599('0x44')],[_0x4599('0x48'),'id'])||{});}})[_0x4599('0x20')](respondWithResult(_0x21d4c2,null))[_0x4599('0x3e')](handleError(_0x21d4c2,null));};exports[_0x4599('0x4d')]=function(_0x137476,_0x1c52b6,_0x2902ef){var _0x4b29b4={};var _0x58e542={};var _0x2e2b6b;var _0x43cdf7;return db[_0x4599('0x26')][_0x4599('0x4a')]({'where':{'id':_0x137476[_0x4599('0x45')]['id']}})[_0x4599('0x20')](handleEntityNotFound(_0x1c52b6,null))[_0x4599('0x20')](function(_0x304e5a){if(_0x304e5a){_0x2e2b6b=_0x304e5a;_0x58e542['model']=_[_0x4599('0x40')](db[_0x4599('0x4e')][_0x4599('0x27')]);_0x58e542[_0x4599('0x2c')]=_[_0x4599('0x40')](_0x137476['query']);_0x58e542[_0x4599('0x2d')]=_['intersection'](_0x58e542[_0x4599('0x2a')],_0x58e542[_0x4599('0x2c')]);_0x4b29b4[_0x4599('0x2f')]=_[_0x4599('0x2e')](_0x58e542[_0x4599('0x2a')],qs['fields'](_0x137476[_0x4599('0x2c')]['fields']));_0x4b29b4[_0x4599('0x2f')]=_0x4b29b4[_0x4599('0x2f')]['length']?_0x4b29b4[_0x4599('0x2f')]:_0x58e542[_0x4599('0x2a')];_0x4b29b4[_0x4599('0x33')]=qs['sort'](_0x137476[_0x4599('0x2c')][_0x4599('0x34')]);_0x4b29b4['where']=qs['filters'](_[_0x4599('0x36')](_0x137476[_0x4599('0x2c')],_0x58e542[_0x4599('0x2d')]));if(_0x137476['query'][_0x4599('0x39')]){_0x4b29b4[_0x4599('0x35')]=_[_0x4599('0x37')](_0x4b29b4[_0x4599('0x35')],{'$or':_[_0x4599('0x2b')](_0x4b29b4['attributes'],function(_0x1ab15d){var _0x1cfef4={};_0x1cfef4[_0x1ab15d]={'$like':'%'+_0x137476['query'][_0x4599('0x39')]+'%'};return _0x1cfef4;})});}_0x4b29b4=_['merge']({},_0x4b29b4,_0x137476[_0x4599('0x3a')]);return _0x2e2b6b[_0x4599('0x4d')](_0x4b29b4);}})['then'](function(_0x5c86ec){if(_0x5c86ec){_0x43cdf7=_0x5c86ec['length'];if(!_0x137476[_0x4599('0x2c')][_0x4599('0x31')](_0x4599('0x32'))){_0x4b29b4[_0x4599('0x19')]=qs['limit'](_0x137476[_0x4599('0x2c')][_0x4599('0x19')]);_0x4b29b4[_0x4599('0x16')]=qs[_0x4599('0x16')](_0x137476[_0x4599('0x2c')][_0x4599('0x16')]);}return _0x2e2b6b[_0x4599('0x4d')](_0x4b29b4);}})['then'](function(_0x4704d8){if(_0x4704d8){return _0x4704d8?{'count':_0x43cdf7,'rows':_0x4704d8}:null;}})[_0x4599('0x20')](respondWithResult(_0x1c52b6,null))[_0x4599('0x3e')](handleError(_0x1c52b6,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 056e4aa..df8b804 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 _0x4a45=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define'];(function(_0x3df9dd,_0x26f5cd){var _0x4f11e4=function(_0x1993fe){while(--_0x1993fe){_0x3df9dd['push'](_0x3df9dd['shift']());}};_0x4f11e4(++_0x26f5cd);}(_0x4a45,0x180));var _0x54a4=function(_0x294272,_0x178245){_0x294272=_0x294272-0x0;var _0x36fcf9=_0x4a45[_0x294272];return _0x36fcf9;};'use strict';var _=require('lodash');var util=require(_0x54a4('0x0'));var logger=require(_0x54a4('0x1'))(_0x54a4('0x2'));var moment=require(_0x54a4('0x3'));var BPromise=require(_0x54a4('0x4'));var rp=require(_0x54a4('0x5'));var fs=require('fs');var path=require(_0x54a4('0x6'));var rimraf=require(_0x54a4('0x7'));var config=require(_0x54a4('0x8'));var attributes=require(_0x54a4('0x9'));module[_0x54a4('0xa')]=function(_0x39c5c9,_0x406abf){return _0x39c5c9[_0x54a4('0xb')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdd34=['api','moment','bluebird','request-promise','path','../../config/environment','./automation.attributes','exports','define','tools_automations','util'];(function(_0x286634,_0xac4607){var _0x577003=function(_0x23bca7){while(--_0x23bca7){_0x286634['push'](_0x286634['shift']());}};_0x577003(++_0xac4607);}(_0xdd34,0x15f));var _0x4dd3=function(_0x524d5e,_0x269f75){_0x524d5e=_0x524d5e-0x0;var _0x3a1eca=_0xdd34[_0x524d5e];return _0x3a1eca;};'use strict';var _=require('lodash');var util=require(_0x4dd3('0x0'));var logger=require('../../config/logger')(_0x4dd3('0x1'));var moment=require(_0x4dd3('0x2'));var BPromise=require(_0x4dd3('0x3'));var rp=require(_0x4dd3('0x4'));var fs=require('fs');var path=require(_0x4dd3('0x5'));var rimraf=require('rimraf');var config=require(_0x4dd3('0x6'));var attributes=require(_0x4dd3('0x7'));module[_0x4dd3('0x8')]=function(_0x2b4148,_0x74864f){return _0x2b4148[_0x4dd3('0x9')]('Automation',attributes,{'tableName':_0x4dd3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 0b468ef..849201d 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 _0x1c9a=['http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x1c9a,0x98));var _0xa1c9=function(_0x558759,_0xd9ea38){_0x558759=_0x558759-0x0;var _0x1c712f=_0x1c9a[_0x558759];return _0x1c712f;};'use strict';var _=require(_0xa1c9('0x0'));var util=require('util');var moment=require(_0xa1c9('0x1'));var BPromise=require('bluebird');var rs=require(_0xa1c9('0x2'));var fs=require('fs');var Redis=require(_0xa1c9('0x3'));var db=require(_0xa1c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1c9('0x5'))(_0xa1c9('0x6'));var config=require(_0xa1c9('0x7'));var jayson=require(_0xa1c9('0x8'));var client=jayson['client'][_0xa1c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5448f2,_0x222624,_0x463c9c){return new BPromise(function(_0x3f07c2,_0x5059df){return client[_0xa1c9('0xa')](_0x5448f2,_0x463c9c)[_0xa1c9('0xb')](function(_0x24136d){logger[_0xa1c9('0xc')]('Automation,\x20%s,\x20%s',_0x222624,_0xa1c9('0xd'));logger[_0xa1c9('0xe')](_0xa1c9('0xf'),_0x222624,_0xa1c9('0xd'),JSON[_0xa1c9('0x10')](_0x24136d));if(_0x24136d[_0xa1c9('0x11')]){if(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x12')]===0x1f4){logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x5059df(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x3f07c2(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}else{logger[_0xa1c9('0xc')](_0xa1c9('0x13'),_0x222624,_0xa1c9('0xd'));_0x3f07c2(_0x24136d[_0xa1c9('0x15')][_0xa1c9('0x14')]);}})[_0xa1c9('0x16')](function(_0x373f5d){logger['error'](_0xa1c9('0x13'),_0x222624,_0x373f5d);_0x5059df(_0x373f5d);});});}
\ No newline at end of file
+var _0x6bab=['../../config/logger','rpc','jayson/promise','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6bab,0x1c7));var _0xb6ba=function(_0x136a0d,_0x476fe2){_0x136a0d=_0x136a0d-0x0;var _0x212ea5=_0x6bab[_0x136a0d];return _0x212ea5;};'use strict';var _=require(_0xb6ba('0x0'));var util=require(_0xb6ba('0x1'));var moment=require(_0xb6ba('0x2'));var BPromise=require(_0xb6ba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6ba('0x4'));var db=require(_0xb6ba('0x5'))['db'];var utils=require(_0xb6ba('0x6'));var logger=require(_0xb6ba('0x7'))(_0xb6ba('0x8'));var config=require('../../config/environment');var jayson=require(_0xb6ba('0x9'));var client=jayson['client'][_0xb6ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x389a0d,_0x3fd283,_0xbce6f){return new BPromise(function(_0xa0b5c7,_0x469e81){return client[_0xb6ba('0xb')](_0x389a0d,_0xbce6f)[_0xb6ba('0xc')](function(_0x36bdc2){logger['info'](_0xb6ba('0xd'),_0x3fd283,'request\x20sent');logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x3fd283,_0xb6ba('0xe'),JSON[_0xb6ba('0xf')](_0x36bdc2));if(_0x36bdc2[_0xb6ba('0x10')]){if(_0x36bdc2['error'][_0xb6ba('0x11')]===0x1f4){logger[_0xb6ba('0x10')](_0xb6ba('0xd'),_0x3fd283,_0x36bdc2[_0xb6ba('0x10')][_0xb6ba('0x12')]);return _0x469e81(_0x36bdc2[_0xb6ba('0x10')][_0xb6ba('0x12')]);}logger[_0xb6ba('0x10')](_0xb6ba('0xd'),_0x3fd283,_0x36bdc2[_0xb6ba('0x10')][_0xb6ba('0x12')]);return _0xa0b5c7(_0x36bdc2[_0xb6ba('0x10')][_0xb6ba('0x12')]);}else{logger[_0xb6ba('0x13')](_0xb6ba('0xd'),_0x3fd283,_0xb6ba('0xe'));_0xa0b5c7(_0x36bdc2[_0xb6ba('0x14')][_0xb6ba('0x12')]);}})[_0xb6ba('0x15')](function(_0x5313d4){logger[_0xb6ba('0x10')]('Automation,\x20%s,\x20%s',_0x3fd283,_0x5313d4);_0x469e81(_0x5313d4);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index cf85eff..9305bde 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 _0x4c67=['show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index'];(function(_0x3d40db,_0x26f3c1){var _0x3b92c4=function(_0x28c086){while(--_0x28c086){_0x3d40db['push'](_0x3d40db['shift']());}};_0x3b92c4(++_0x26f3c1);}(_0x4c67,0x1cd));var _0x74c6=function(_0x52b034,_0x5d89ff){_0x52b034=_0x52b034-0x0;var _0xeb7545=_0x4c67[_0x52b034];return _0xeb7545;};'use strict';var multer=require(_0x74c6('0x0'));var util=require(_0x74c6('0x1'));var path=require(_0x74c6('0x2'));var timeout=require(_0x74c6('0x3'));var express=require(_0x74c6('0x4'));var router=express[_0x74c6('0x5')]();var fs_extra=require(_0x74c6('0x6'));var auth=require(_0x74c6('0x7'));var interaction=require(_0x74c6('0x8'));var config=require(_0x74c6('0x9'));var controller=require(_0x74c6('0xa'));router[_0x74c6('0xb')]('/',auth[_0x74c6('0xc')](),controller[_0x74c6('0xd')]);router[_0x74c6('0xb')]('/:id',auth[_0x74c6('0xc')](),controller[_0x74c6('0xe')]);router[_0x74c6('0xb')](_0x74c6('0xf'),auth[_0x74c6('0xc')](),controller[_0x74c6('0x10')]);router['get'](_0x74c6('0x11'),auth['isAuthenticated'](),controller[_0x74c6('0x12')]);router[_0x74c6('0x13')]('/',auth[_0x74c6('0xc')](),controller['create']);router[_0x74c6('0x13')]('/:id/conditions',auth[_0x74c6('0xc')](),controller[_0x74c6('0x14')]);router['post'](_0x74c6('0x11'),auth[_0x74c6('0xc')](),controller[_0x74c6('0x15')]);router['put'](_0x74c6('0x16'),auth[_0x74c6('0xc')](),controller[_0x74c6('0x17')]);router['delete'](_0x74c6('0x16'),auth['isAuthenticated'](),controller[_0x74c6('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x6505=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/actions','getActions','post','create','/:id/conditions','addConditions','addActions','put','update','delete','destroy','exports'];(function(_0x1bafb1,_0x3f4d43){var _0x1e9aa9=function(_0x34c867){while(--_0x34c867){_0x1bafb1['push'](_0x1bafb1['shift']());}};_0x1e9aa9(++_0x3f4d43);}(_0x6505,0x8c));var _0x5650=function(_0x5e16cf,_0x23b912){_0x5e16cf=_0x5e16cf-0x0;var _0x5201e5=_0x6505[_0x5e16cf];return _0x5201e5;};'use strict';var multer=require(_0x5650('0x0'));var util=require(_0x5650('0x1'));var path=require(_0x5650('0x2'));var timeout=require(_0x5650('0x3'));var express=require(_0x5650('0x4'));var router=express[_0x5650('0x5')]();var fs_extra=require(_0x5650('0x6'));var auth=require(_0x5650('0x7'));var interaction=require(_0x5650('0x8'));var config=require(_0x5650('0x9'));var controller=require(_0x5650('0xa'));router['get']('/',auth[_0x5650('0xb')](),controller[_0x5650('0xc')]);router[_0x5650('0xd')](_0x5650('0xe'),auth[_0x5650('0xb')](),controller[_0x5650('0xf')]);router[_0x5650('0xd')]('/:id/conditions',auth[_0x5650('0xb')](),controller['getConditions']);router[_0x5650('0xd')](_0x5650('0x10'),auth[_0x5650('0xb')](),controller[_0x5650('0x11')]);router[_0x5650('0x12')]('/',auth[_0x5650('0xb')](),controller[_0x5650('0x13')]);router[_0x5650('0x12')](_0x5650('0x14'),auth[_0x5650('0xb')](),controller[_0x5650('0x15')]);router[_0x5650('0x12')](_0x5650('0x10'),auth[_0x5650('0xb')](),controller[_0x5650('0x16')]);router[_0x5650('0x17')](_0x5650('0xe'),auth[_0x5650('0xb')](),controller[_0x5650('0x18')]);router[_0x5650('0x19')]('/:id',auth[_0x5650('0xb')](),controller[_0x5650('0x1a')]);module[_0x5650('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 5ce4d1f..e40935c 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 _0x6c93=['Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','name','ENUM','ivr','STRING','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','BOOLEAN'];(function(_0x19159a,_0x1cb5c3){var _0xa677f4=function(_0x24bb85){while(--_0x24bb85){_0x19159a['push'](_0x19159a['shift']());}};_0xa677f4(++_0x1cb5c3);}(_0x6c93,0x160));var _0x36c9=function(_0x18cf74,_0x1b6eb6){_0x18cf74=_0x18cf74-0x0;var _0x2f6f1f=_0x6c93[_0x18cf74];return _0x2f6f1f;};'use strict';var Sequelize=require(_0x36c9('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x36c9('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x36c9('0x2')](_0x36c9('0x3')),'allowNull':![],'defaultValue':_0x36c9('0x3')},'description':{'type':Sequelize[_0x36c9('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x36c9('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x36c9('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x36c9('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x36c9('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x36c9('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0x36c9('0x8')](0x3)[_0x36c9('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x36c9('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x36c9('0x8')](0x3)[_0x36c9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x36c9('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x36c9('0x8')](0x5)[_0x36c9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x36c9('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x36c9('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x36c9('0x8')](0x5)[_0x36c9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x36c9('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x36c9('0x8')](0x3)[_0x36c9('0x6')],'defaultValue':0x3,'comment':_0x36c9('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x36c9('0x8')](0x5)[_0x36c9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x36c9('0x8')](0x3)[_0x36c9('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x36c9('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x36c9('0x2')](_0x36c9('0xf'),'never',_0x36c9('0x10')),'defaultValue':_0x36c9('0xf')},'dialAMDActive':{'type':Sequelize[_0x36c9('0x11')],'defaultValue':0x0,'comment':_0x36c9('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x36c9('0x8')](0x9)[_0x36c9('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x36c9('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x36c9('0x8')](0x9)[_0x36c9('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x36c9('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x36c9('0x8')](0x9)[_0x36c9('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x36c9('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x36c9('0x8')](0x9)[_0x36c9('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x36c9('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x36c9('0x8')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x36c9('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x36c9('0x8')](0x9)[_0x36c9('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x36c9('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x36c9('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x36c9('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x36c9('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x36c9('0x2')]('DESC','ASC'),'defaultValue':_0x36c9('0x1a')},'dialPrefix':{'type':Sequelize[_0x36c9('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x36c9('0x8')](0x3)[_0x36c9('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x36c9('0x1b')},'dialCutDigit':{'type':Sequelize[_0x36c9('0x8')](0x3)[_0x36c9('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x36c9('0x8')](0x3)[_0x36c9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x36c9('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x36c9('0x8')](0x5)[_0x36c9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x36c9('0x8')](0x3)[_0x36c9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x36c9('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x36c9('0x8')](0x5)[_0x36c9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x36c9('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x36c9('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x36c9('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x36c9('0x8')](0x5)[_0x36c9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x36c9('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x36c9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x36c9('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x36c9('0x8')](0x5)[_0x36c9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x36c9('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x36c9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x36c9('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x36c9('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x36c9('0x24')}};
\ No newline at end of file
+var _0x770f=['never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','ivr','BOOLEAN','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always'];(function(_0xdd5244,_0x26242c){var _0x3d086d=function(_0x6a9652){while(--_0x6a9652){_0xdd5244['push'](_0xdd5244['shift']());}};_0x3d086d(++_0x26242c);}(_0x770f,0x7e));var _0xf770=function(_0xba1760,_0x191969){_0xba1760=_0xba1760-0x0;var _0x1f3143=_0x770f[_0xba1760];return _0x1f3143;};'use strict';var Sequelize=require('sequelize');module[_0xf770('0x0')]={'name':{'type':Sequelize[_0xf770('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xf770('0x2')),'allowNull':![],'defaultValue':_0xf770('0x2')},'description':{'type':Sequelize[_0xf770('0x1')]},'active':{'type':Sequelize[_0xf770('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xf770('0x4')](0x4)[_0xf770('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf770('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xf770('0x4')](0x3)[_0xf770('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf770('0x6')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf770('0x4')](0x3)[_0xf770('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf770('0x7')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf770('0x4')](0x5)[_0xf770('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf770('0x8')},'dialBusyMaxRetry':{'type':Sequelize[_0xf770('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xf770('0x4')](0x5)[_0xf770('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf770('0x9')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf770('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xf770('0xa')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf770('0x4')](0x5)[_0xf770('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xf770('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf770('0x1')],'defaultValue':_0xf770('0xb')},'dialCheckDuplicateType':{'type':Sequelize[_0xf770('0xc')](_0xf770('0xd'),_0xf770('0xe'),_0xf770('0xf')),'defaultValue':_0xf770('0xd')},'dialAMDActive':{'type':Sequelize[_0xf770('0x3')],'defaultValue':0x0,'comment':_0xf770('0x10')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf770('0x11')},'dialAMDGreeting':{'type':Sequelize[_0xf770('0x4')](0x9)[_0xf770('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf770('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf770('0x4')](0x9)[_0xf770('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf770('0x4')](0x9)[_0xf770('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf770('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0xf770('0x4')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf770('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf770('0x4')](0x9)[_0xf770('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xf770('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf770('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf770('0x4')](0x9)[_0xf770('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf770('0x16')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0xf770('0x17')),'defaultValue':_0xf770('0x18')},'dialPrefix':{'type':Sequelize[_0xf770('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xf770('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf770('0x19')},'dialCutDigit':{'type':Sequelize[_0xf770('0x4')](0x3)[_0xf770('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf770('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf770('0x4')](0x3)[_0xf770('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf770('0x4')](0x5)[_0xf770('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf770('0x1b')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf770('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf770('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0xf770('0x4')](0x5)[_0xf770('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf770('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf770('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf770('0x4')](0x5)[_0xf770('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf770('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0xf770('0x4')](0x3)[_0xf770('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf770('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0xf770('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf770('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf770('0x4')](0x3)[_0xf770('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf770('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf770('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf770('0x22')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 17caf92..2246e0e 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 _0x5dca=['mustache','util','sox','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','catch','includeAll','include','createdAt','updatedAt','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','nolimit','order','findOne','CmHopperHistory','getHopperFinals','CampaignId','CmHopperFinal','CmHopperBlack','CmList','getLists','addLists','ids','omit','spread','dialCheckDuplicateType','insert','into','fromQuery','scheduledAt','select','field','ContactId','toString','ListId','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','phone','phone\x20IS\x20NOT\x20NULL','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x1139d0,_0x41e5f8){var _0xcc01a6=function(_0x504ffa){while(--_0x504ffa){_0x1139d0['push'](_0x1139d0['shift']());}};_0xcc01a6(++_0x41e5f8);}(_0x5dca,0x191));var _0xa5dc=function(_0x5f2282,_0xc29c83){_0x5f2282=_0x5f2282-0x0;var _0x1c1b8b=_0x5dca[_0x5f2282];return _0x1c1b8b;};'use strict';var emlformat=require(_0xa5dc('0x0'));var rimraf=require(_0xa5dc('0x1'));var zipdir=require(_0xa5dc('0x2'));var jsonpatch=require(_0xa5dc('0x3'));var rp=require(_0xa5dc('0x4'));var moment=require(_0xa5dc('0x5'));var BPromise=require(_0xa5dc('0x6'));var Mustache=require(_0xa5dc('0x7'));var util=require(_0xa5dc('0x8'));var path=require('path');var sox=require(_0xa5dc('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa5dc('0xa'));var _=require(_0xa5dc('0xb'));var squel=require(_0xa5dc('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa5dc('0xd'));var toCsv=require(_0xa5dc('0xe'));var querystring=require(_0xa5dc('0xf'));var Papa=require(_0xa5dc('0x10'));var Redis=require(_0xa5dc('0x11'));var authService=require(_0xa5dc('0x12'));var qs=require(_0xa5dc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa5dc('0x14'));var logger=require(_0xa5dc('0x15'))(_0xa5dc('0x16'));var utils=require('../../config/utils');var config=require(_0xa5dc('0x17'));var licenseUtil=require(_0xa5dc('0x18'));var db=require(_0xa5dc('0x19'))['db'];function respondWithStatusCode(_0x2c5807,_0x28f55a){_0x28f55a=_0x28f55a||0xcc;return function(_0x1608ed){if(_0x1608ed){return _0x2c5807['sendStatus'](_0x28f55a);}return _0x2c5807[_0xa5dc('0x1a')](_0x28f55a)[_0xa5dc('0x1b')]();};}function respondWithResult(_0x58aaf0,_0x33ba28){_0x33ba28=_0x33ba28||0xc8;return function(_0x28dd7a){if(_0x28dd7a){return _0x58aaf0[_0xa5dc('0x1a')](_0x33ba28)[_0xa5dc('0x1c')](_0x28dd7a);}};}function respondWithFilteredResult(_0x2e5314,_0x245630){return function(_0x4b2e4){if(_0x4b2e4){var _0x33869e=typeof _0x245630['offset']===_0xa5dc('0x1d')&&typeof _0x245630[_0xa5dc('0x1e')]===_0xa5dc('0x1d');var _0x58e72d=_0x4b2e4[_0xa5dc('0x1f')];var _0x4b15d5=_0x33869e?0x0:_0x245630[_0xa5dc('0x20')];var _0x3a1e27=_0x33869e?_0x4b2e4['count']:_0x245630[_0xa5dc('0x20')]+_0x245630['limit'];var _0x2397e0;if(_0x3a1e27>=_0x58e72d){_0x3a1e27=_0x58e72d;_0x2397e0=0xc8;}else{_0x2397e0=0xce;}_0x2e5314[_0xa5dc('0x1a')](_0x2397e0);return _0x2e5314['set'](_0xa5dc('0x21'),_0x4b15d5+'-'+_0x3a1e27+'/'+_0x58e72d)['json'](_0x4b2e4);}return null;};}function patchUpdates(_0x3c8d80){return function(_0x2d12df){try{jsonpatch[_0xa5dc('0x22')](_0x2d12df,_0x3c8d80,!![]);}catch(_0x3dda89){return BPromise[_0xa5dc('0x23')](_0x3dda89);}return _0x2d12df['save']();};}function saveUpdates(_0x1dab3d,_0x125b4e){return function(_0x3527e2){if(_0x3527e2){return _0x3527e2[_0xa5dc('0x24')](_0x1dab3d)[_0xa5dc('0x25')](function(_0x5863dd){return _0x5863dd;});}return null;};}function removeEntity(_0xa0f4ed,_0x4255c3){return function(_0x8def96){if(_0x8def96){return _0x8def96['destroy']()[_0xa5dc('0x25')](function(){var _0x43f298=_0x8def96[_0xa5dc('0x26')]({'plain':!![]});var _0x39b65e=_0xa5dc('0x27');return db[_0xa5dc('0x28')][_0xa5dc('0x29')]({'where':{'type':_0x39b65e,'resourceId':_0x43f298['id']}})[_0xa5dc('0x25')](function(){return _0x8def96;});})['then'](function(){_0xa0f4ed[_0xa5dc('0x1a')](0xcc)[_0xa5dc('0x1b')]();});}};}function handleEntityNotFound(_0x30a583,_0x55b42e){return function(_0x1f557a){if(!_0x1f557a){_0x30a583['sendStatus'](0x194);}return _0x1f557a;};}function handleError(_0x55e4f4,_0x27f923){_0x27f923=_0x27f923||0x1f4;return function(_0x22e24a){logger[_0xa5dc('0x2a')](_0x22e24a[_0xa5dc('0x2b')]);if(_0x22e24a['name']){delete _0x22e24a[_0xa5dc('0x2c')];}_0x55e4f4['status'](_0x27f923)[_0xa5dc('0x2d')](_0x22e24a);};}exports[_0xa5dc('0x2e')]=function(_0x4b3645,_0x46e721){var _0x1e4f26={},_0x3dfc1d={},_0x1bb06f={'count':0x0,'rows':[]};var _0x10ebff=_[_0xa5dc('0x2f')](db[_0xa5dc('0x30')][_0xa5dc('0x31')],function(_0x307f74){return{'name':_0x307f74[_0xa5dc('0x32')],'type':_0x307f74[_0xa5dc('0x33')][_0xa5dc('0x34')]};});_0x3dfc1d[_0xa5dc('0x35')]=_[_0xa5dc('0x2f')](_0x10ebff,_0xa5dc('0x2c'));_0x3dfc1d[_0xa5dc('0x36')]=_[_0xa5dc('0x37')](_0x4b3645['query']);_0x3dfc1d[_0xa5dc('0x38')]=_['intersection'](_0x3dfc1d[_0xa5dc('0x35')],_0x3dfc1d[_0xa5dc('0x36')]);_0x1e4f26[_0xa5dc('0x39')]=_[_0xa5dc('0x3a')](_0x3dfc1d[_0xa5dc('0x35')],qs[_0xa5dc('0x3b')](_0x4b3645['query'][_0xa5dc('0x3b')]));_0x1e4f26['attributes']=_0x1e4f26[_0xa5dc('0x39')][_0xa5dc('0x3c')]?_0x1e4f26[_0xa5dc('0x39')]:_0x3dfc1d['model'];if(!_0x4b3645[_0xa5dc('0x36')][_0xa5dc('0x3d')]('nolimit')){_0x1e4f26['limit']=qs[_0xa5dc('0x1e')](_0x4b3645[_0xa5dc('0x36')][_0xa5dc('0x1e')]);_0x1e4f26[_0xa5dc('0x20')]=qs[_0xa5dc('0x20')](_0x4b3645['query'][_0xa5dc('0x20')]);}_0x1e4f26['order']=qs[_0xa5dc('0x3e')](_0x4b3645[_0xa5dc('0x36')][_0xa5dc('0x3e')]);_0x1e4f26[_0xa5dc('0x3f')]=qs[_0xa5dc('0x38')](_[_0xa5dc('0x40')](_0x4b3645[_0xa5dc('0x36')],_0x3dfc1d[_0xa5dc('0x38')]),_0x10ebff);if(_0x4b3645['query'][_0xa5dc('0x41')]){_0x1e4f26['where']=_['merge'](_0x1e4f26['where'],{'$or':_[_0xa5dc('0x2f')](_0x10ebff,function(_0x141672){if(_0x141672[_0xa5dc('0x33')]!==_0xa5dc('0x42')){var _0x3cd3b5={};_0x3cd3b5[_0x141672[_0xa5dc('0x2c')]]={'$like':'%'+_0x4b3645['query'][_0xa5dc('0x41')]+'%'};return _0x3cd3b5;}})});}_0x1e4f26=_[_0xa5dc('0x43')]({},_0x1e4f26,_0x4b3645[_0xa5dc('0x44')]);var _0x199c7f={'where':_0x1e4f26['where']};return db[_0xa5dc('0x30')]['count'](_0x199c7f)[_0xa5dc('0x25')](function(_0x23131f){_0x1bb06f[_0xa5dc('0x1f')]=_0x23131f;if(_0x4b3645[_0xa5dc('0x36')]['includeAll']){_0x1e4f26['include']=[{'all':!![]}];}return db[_0xa5dc('0x30')][_0xa5dc('0x45')](_0x1e4f26);})[_0xa5dc('0x25')](function(_0x4c6b61){_0x1bb06f[_0xa5dc('0x46')]=_0x4c6b61;return _0x1bb06f;})[_0xa5dc('0x25')](respondWithFilteredResult(_0x46e721,_0x1e4f26))['catch'](handleError(_0x46e721,null));};exports[_0xa5dc('0x47')]=function(_0x53fbc1,_0x22a37c){var _0x17060c={'raw':![],'where':{'id':_0x53fbc1[_0xa5dc('0x48')]['id']}},_0x5566de={};_0x5566de[_0xa5dc('0x35')]=_['keys'](db[_0xa5dc('0x30')]['rawAttributes']);_0x5566de['query']=_[_0xa5dc('0x37')](_0x53fbc1[_0xa5dc('0x36')]);_0x5566de[_0xa5dc('0x38')]=_[_0xa5dc('0x3a')](_0x5566de[_0xa5dc('0x35')],_0x5566de['query']);_0x17060c[_0xa5dc('0x39')]=_[_0xa5dc('0x3a')](_0x5566de['model'],qs[_0xa5dc('0x3b')](_0x53fbc1['query'][_0xa5dc('0x3b')]));_0x17060c[_0xa5dc('0x39')]=_0x17060c['attributes']['length']?_0x17060c[_0xa5dc('0x39')]:_0x5566de['model'];if(_0x53fbc1[_0xa5dc('0x36')]['includeAll']){_0x17060c['include']=[{'all':!![]}];}_0x17060c=_['merge']({},_0x17060c,_0x53fbc1[_0xa5dc('0x44')]);return db[_0xa5dc('0x30')][_0xa5dc('0x49')](_0x17060c)['then'](handleEntityNotFound(_0x22a37c,null))[_0xa5dc('0x25')](respondWithResult(_0x22a37c,null))['catch'](handleError(_0x22a37c,null));};exports[_0xa5dc('0x4a')]=function(_0x39fcae,_0x57493e){return db[_0xa5dc('0x30')]['create'](_0x39fcae[_0xa5dc('0x4b')],{})[_0xa5dc('0x25')](function(_0xef90d3){var _0x3c273c=_0x39fcae[_0xa5dc('0x4c')][_0xa5dc('0x26')]({'plain':!![]});if(!_0x3c273c)throw new Error(_0xa5dc('0x4d'));if(_0x3c273c[_0xa5dc('0x4e')]==='user'){var _0xb53cf6=_0xef90d3['get']({'plain':!![]});var _0x43672c=_0xa5dc('0x27');return db[_0xa5dc('0x4f')]['find']({'where':{'name':_0x43672c,'userProfileId':_0x3c273c[_0xa5dc('0x50')]},'raw':!![]})['then'](function(_0x4cd1c6){if(_0x4cd1c6&&_0x4cd1c6['autoAssociation']===0x0){return db[_0xa5dc('0x28')][_0xa5dc('0x4a')]({'name':_0xb53cf6[_0xa5dc('0x2c')],'resourceId':_0xb53cf6['id'],'type':_0x4cd1c6[_0xa5dc('0x2c')],'sectionId':_0x4cd1c6['id']},{})[_0xa5dc('0x25')](function(){return _0xef90d3;});}else{return _0xef90d3;}})['catch'](function(_0x1cb7bc){logger[_0xa5dc('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1cb7bc);throw _0x1cb7bc;});}return _0xef90d3;})['then'](respondWithResult(_0x57493e,0xc9))[_0xa5dc('0x51')](handleError(_0x57493e,null));};exports['clone']=function(_0xfaca60,_0xd68c4){var _0xbc209b={'where':{'id':_0xfaca60[_0xa5dc('0x48')]['id']}},_0x52e1dc={};_0x52e1dc[_0xa5dc('0x35')]=_['keys'](db[_0xa5dc('0x30')]['rawAttributes']);_0xbc209b[_0xa5dc('0x39')]=_[_0xa5dc('0x3a')](_0x52e1dc['model'],qs['fields'](_0xfaca60[_0xa5dc('0x36')][_0xa5dc('0x3b')]));_0xbc209b['attributes']=_0xbc209b[_0xa5dc('0x39')][_0xa5dc('0x3c')]?_0xbc209b[_0xa5dc('0x39')]:_0x52e1dc['model'];if(_0xfaca60[_0xa5dc('0x36')][_0xa5dc('0x52')]){_0xbc209b[_0xa5dc('0x53')]=[{'all':!![]}];}_0xbc209b=_[_0xa5dc('0x43')]({},_0xbc209b,_0xfaca60[_0xa5dc('0x44')]);return db[_0xa5dc('0x30')][_0xa5dc('0x49')](_0xbc209b)[_0xa5dc('0x25')](handleEntityNotFound(_0xd68c4,null))[_0xa5dc('0x25')](function(_0x50bb5f){if(_0x50bb5f){var _0x465964=_0x50bb5f[_0xa5dc('0x26')]({'plain':!![]});_0x465964=qs['omit'](_0x465964,['id',_0xa5dc('0x54'),_0xa5dc('0x55')]);_0xfaca60[_0xa5dc('0x4b')]=_['omit'](_0xfaca60[_0xa5dc('0x4b')],['id',_0xa5dc('0x54'),_0xa5dc('0x55')]);return db[_0xa5dc('0x30')][_0xa5dc('0x4a')](_['merge'](_0x465964,_0xfaca60['body']),{'include':_0xfaca60[_0xa5dc('0x36')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x2577b3){var _0x37eb5f=_0xfaca60[_0xa5dc('0x4c')][_0xa5dc('0x26')]({'plain':!![]});if(!_0x37eb5f)throw new Error(_0xa5dc('0x4d'));if(_0x37eb5f[_0xa5dc('0x4e')]==='user'){var _0xeed85e=_0x2577b3[_0xa5dc('0x26')]({'plain':!![]});var _0x1378ba=_0xa5dc('0x27');return db[_0xa5dc('0x4f')][_0xa5dc('0x49')]({'where':{'name':_0x1378ba,'userProfileId':_0x37eb5f['userProfileId']},'raw':!![]})[_0xa5dc('0x25')](function(_0x2d6ea3){if(_0x2d6ea3&&_0x2d6ea3[_0xa5dc('0x56')]===0x0){return db[_0xa5dc('0x28')]['create']({'name':_0xeed85e[_0xa5dc('0x2c')],'resourceId':_0xeed85e['id'],'type':_0x2d6ea3['name'],'sectionId':_0x2d6ea3['id']},{})[_0xa5dc('0x25')](function(){return _0x2577b3;});}else{return _0x2577b3;}})[_0xa5dc('0x51')](function(_0x30e62b){logger[_0xa5dc('0x2a')](_0xa5dc('0x57'),_0x30e62b);throw _0x30e62b;});}return _0x2577b3;});}})['then'](respondWithResult(_0xd68c4,0xc9))['catch'](handleError(_0xd68c4,null));};exports[_0xa5dc('0x24')]=function(_0x5df928,_0x389850){if(_0x5df928[_0xa5dc('0x4b')]['id']){delete _0x5df928[_0xa5dc('0x4b')]['id'];}return db['Campaign'][_0xa5dc('0x49')]({'where':{'id':_0x5df928['params']['id']}})[_0xa5dc('0x25')](handleEntityNotFound(_0x389850,null))[_0xa5dc('0x25')](saveUpdates(_0x5df928[_0xa5dc('0x4b')],null))['then'](respondWithResult(_0x389850,null))[_0xa5dc('0x51')](handleError(_0x389850,null));};exports[_0xa5dc('0x29')]=function(_0x3111dc,_0x1ebf8b){return db[_0xa5dc('0x30')][_0xa5dc('0x49')]({'where':{'id':_0x3111dc['params']['id']}})['then'](handleEntityNotFound(_0x1ebf8b,null))[_0xa5dc('0x25')](removeEntity(_0x1ebf8b,null))[_0xa5dc('0x51')](handleError(_0x1ebf8b,null));};exports[_0xa5dc('0x58')]=function(_0x529454,_0xd17c2f,_0xdc04a0){var _0x568efd={'raw':!![],'where':{}};var _0x52885c={};var _0x3398ae={'count':0x0,'rows':[]};return db[_0xa5dc('0x30')]['findOne']({'where':{'id':_0x529454[_0xa5dc('0x48')]['id']}})[_0xa5dc('0x25')](handleEntityNotFound(_0xd17c2f,null))['then'](function(_0x1d45e0){if(_0x1d45e0){_0x52885c['model']=_[_0xa5dc('0x37')](db[_0xa5dc('0x59')][_0xa5dc('0x31')]);_0x52885c[_0xa5dc('0x36')]=_[_0xa5dc('0x37')](_0x529454['query']);_0x52885c[_0xa5dc('0x38')]=_[_0xa5dc('0x3a')](_0x52885c[_0xa5dc('0x35')],_0x52885c[_0xa5dc('0x36')]);_0x568efd['attributes']=_['intersection'](_0x52885c['model'],qs[_0xa5dc('0x3b')](_0x529454[_0xa5dc('0x36')][_0xa5dc('0x3b')]));_0x568efd['attributes']=_0x568efd[_0xa5dc('0x39')][_0xa5dc('0x3c')]?_0x568efd[_0xa5dc('0x39')]:_0x52885c[_0xa5dc('0x35')];if(!_0x529454[_0xa5dc('0x36')][_0xa5dc('0x3d')](_0xa5dc('0x5a'))){_0x568efd['limit']=qs['limit'](_0x529454['query'][_0xa5dc('0x1e')]);_0x568efd[_0xa5dc('0x20')]=qs[_0xa5dc('0x20')](_0x529454[_0xa5dc('0x36')][_0xa5dc('0x20')]);}_0x568efd[_0xa5dc('0x5b')]=qs[_0xa5dc('0x3e')](_0x529454[_0xa5dc('0x36')][_0xa5dc('0x3e')]);_0x568efd[_0xa5dc('0x3f')]=qs[_0xa5dc('0x38')](_['pick'](_0x529454[_0xa5dc('0x36')],_0x52885c[_0xa5dc('0x38')]));_0x568efd['where']['CampaignId']=_0x1d45e0['id'];if(_0x529454[_0xa5dc('0x36')][_0xa5dc('0x41')]){_0x568efd[_0xa5dc('0x3f')]=_['merge'](_0x568efd['where'],{'$or':_['map'](_0x568efd[_0xa5dc('0x39')],function(_0x36386a){var _0x815822={};_0x815822[_0x36386a]={'$like':'%'+_0x529454[_0xa5dc('0x36')][_0xa5dc('0x41')]+'%'};return _0x815822;})});}_0x568efd=_['merge']({},_0x568efd,_0x529454[_0xa5dc('0x44')]);return db['CmHopper']['count']({'where':_0x568efd['where']})['then'](function(_0x31e1bf){_0x3398ae[_0xa5dc('0x1f')]=_0x31e1bf;if(_0x529454[_0xa5dc('0x36')][_0xa5dc('0x52')]){_0x568efd[_0xa5dc('0x53')]=[{'all':!![]}];}return db[_0xa5dc('0x59')][_0xa5dc('0x45')](_0x568efd);})['then'](function(_0x89a87d){_0x3398ae[_0xa5dc('0x46')]=_0x89a87d;return _0x3398ae;});}})[_0xa5dc('0x25')](respondWithFilteredResult(_0xd17c2f,_0x568efd))[_0xa5dc('0x51')](handleError(_0xd17c2f,null));};exports['getHopperHistories']=function(_0xef06fd,_0x11063e,_0x326cfa){var _0x4b5cbb={'raw':!![],'where':{}};var _0x9ed2da={};var _0x2dd27b={'count':0x0,'rows':[]};return db[_0xa5dc('0x30')][_0xa5dc('0x5c')]({'where':{'id':_0xef06fd[_0xa5dc('0x48')]['id']}})[_0xa5dc('0x25')](handleEntityNotFound(_0x11063e,null))[_0xa5dc('0x25')](function(_0x4822c6){if(_0x4822c6){_0x9ed2da[_0xa5dc('0x35')]=_[_0xa5dc('0x37')](db[_0xa5dc('0x5d')][_0xa5dc('0x31')]);_0x9ed2da[_0xa5dc('0x36')]=_['keys'](_0xef06fd[_0xa5dc('0x36')]);_0x9ed2da[_0xa5dc('0x38')]=_[_0xa5dc('0x3a')](_0x9ed2da[_0xa5dc('0x35')],_0x9ed2da[_0xa5dc('0x36')]);_0x4b5cbb[_0xa5dc('0x39')]=_[_0xa5dc('0x3a')](_0x9ed2da[_0xa5dc('0x35')],qs[_0xa5dc('0x3b')](_0xef06fd[_0xa5dc('0x36')][_0xa5dc('0x3b')]));_0x4b5cbb['attributes']=_0x4b5cbb[_0xa5dc('0x39')][_0xa5dc('0x3c')]?_0x4b5cbb[_0xa5dc('0x39')]:_0x9ed2da['model'];if(!_0xef06fd[_0xa5dc('0x36')][_0xa5dc('0x3d')](_0xa5dc('0x5a'))){_0x4b5cbb[_0xa5dc('0x1e')]=qs['limit'](_0xef06fd[_0xa5dc('0x36')][_0xa5dc('0x1e')]);_0x4b5cbb[_0xa5dc('0x20')]=qs['offset'](_0xef06fd[_0xa5dc('0x36')][_0xa5dc('0x20')]);}_0x4b5cbb[_0xa5dc('0x5b')]=qs[_0xa5dc('0x3e')](_0xef06fd['query'][_0xa5dc('0x3e')]);_0x4b5cbb[_0xa5dc('0x3f')]=qs[_0xa5dc('0x38')](_[_0xa5dc('0x40')](_0xef06fd[_0xa5dc('0x36')],_0x9ed2da[_0xa5dc('0x38')]));_0x4b5cbb['where']['CampaignId']=_0x4822c6['id'];if(_0xef06fd[_0xa5dc('0x36')][_0xa5dc('0x41')]){_0x4b5cbb['where']=_[_0xa5dc('0x43')](_0x4b5cbb[_0xa5dc('0x3f')],{'$or':_[_0xa5dc('0x2f')](_0x4b5cbb[_0xa5dc('0x39')],function(_0x911df9){var _0x2021bb={};_0x2021bb[_0x911df9]={'$like':'%'+_0xef06fd[_0xa5dc('0x36')][_0xa5dc('0x41')]+'%'};return _0x2021bb;})});}_0x4b5cbb=_[_0xa5dc('0x43')]({},_0x4b5cbb,_0xef06fd[_0xa5dc('0x44')]);return db['CmHopperHistory'][_0xa5dc('0x1f')]({'where':_0x4b5cbb['where']})['then'](function(_0x54e83c){_0x2dd27b[_0xa5dc('0x1f')]=_0x54e83c;if(_0xef06fd['query'][_0xa5dc('0x52')]){_0x4b5cbb[_0xa5dc('0x53')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xa5dc('0x45')](_0x4b5cbb);})[_0xa5dc('0x25')](function(_0xe15fb5){_0x2dd27b[_0xa5dc('0x46')]=_0xe15fb5;return _0x2dd27b;});}})['then'](respondWithFilteredResult(_0x11063e,_0x4b5cbb))['catch'](handleError(_0x11063e,null));};exports[_0xa5dc('0x5e')]=function(_0x1c00e7,_0x538507,_0x3b0529){var _0x2efa1c={'raw':!![],'where':{}};var _0x5eceea={};var _0x17b387={'count':0x0,'rows':[]};return db[_0xa5dc('0x30')][_0xa5dc('0x5c')]({'where':{'id':_0x1c00e7[_0xa5dc('0x48')]['id']}})[_0xa5dc('0x25')](handleEntityNotFound(_0x538507,null))[_0xa5dc('0x25')](function(_0x46775e){if(_0x46775e){_0x5eceea['model']=_[_0xa5dc('0x37')](db['CmHopperFinal'][_0xa5dc('0x31')]);_0x5eceea['query']=_[_0xa5dc('0x37')](_0x1c00e7[_0xa5dc('0x36')]);_0x5eceea['filters']=_[_0xa5dc('0x3a')](_0x5eceea[_0xa5dc('0x35')],_0x5eceea[_0xa5dc('0x36')]);_0x2efa1c[_0xa5dc('0x39')]=_[_0xa5dc('0x3a')](_0x5eceea['model'],qs[_0xa5dc('0x3b')](_0x1c00e7['query'][_0xa5dc('0x3b')]));_0x2efa1c[_0xa5dc('0x39')]=_0x2efa1c[_0xa5dc('0x39')]['length']?_0x2efa1c[_0xa5dc('0x39')]:_0x5eceea[_0xa5dc('0x35')];if(!_0x1c00e7[_0xa5dc('0x36')][_0xa5dc('0x3d')](_0xa5dc('0x5a'))){_0x2efa1c[_0xa5dc('0x1e')]=qs['limit'](_0x1c00e7[_0xa5dc('0x36')][_0xa5dc('0x1e')]);_0x2efa1c[_0xa5dc('0x20')]=qs['offset'](_0x1c00e7[_0xa5dc('0x36')][_0xa5dc('0x20')]);}_0x2efa1c[_0xa5dc('0x5b')]=qs[_0xa5dc('0x3e')](_0x1c00e7['query']['sort']);_0x2efa1c[_0xa5dc('0x3f')]=qs['filters'](_[_0xa5dc('0x40')](_0x1c00e7['query'],_0x5eceea[_0xa5dc('0x38')]));_0x2efa1c['where'][_0xa5dc('0x5f')]=_0x46775e['id'];if(_0x1c00e7[_0xa5dc('0x36')][_0xa5dc('0x41')]){_0x2efa1c[_0xa5dc('0x3f')]=_['merge'](_0x2efa1c['where'],{'$or':_[_0xa5dc('0x2f')](_0x2efa1c[_0xa5dc('0x39')],function(_0x2bfdec){var _0x2b2bae={};_0x2b2bae[_0x2bfdec]={'$like':'%'+_0x1c00e7[_0xa5dc('0x36')]['filter']+'%'};return _0x2b2bae;})});}_0x2efa1c=_[_0xa5dc('0x43')]({},_0x2efa1c,_0x1c00e7[_0xa5dc('0x44')]);return db[_0xa5dc('0x60')][_0xa5dc('0x1f')]({'where':_0x2efa1c[_0xa5dc('0x3f')]})[_0xa5dc('0x25')](function(_0x5101b7){_0x17b387['count']=_0x5101b7;if(_0x1c00e7[_0xa5dc('0x36')][_0xa5dc('0x52')]){_0x2efa1c[_0xa5dc('0x53')]=[{'all':!![]}];}return db[_0xa5dc('0x60')][_0xa5dc('0x45')](_0x2efa1c);})['then'](function(_0x527c39){_0x17b387['rows']=_0x527c39;return _0x17b387;});}})[_0xa5dc('0x25')](respondWithFilteredResult(_0x538507,_0x2efa1c))['catch'](handleError(_0x538507,null));};exports['getHopperBlacks']=function(_0x24ad5c,_0x140f73,_0x12ec3a){var _0x171b14={'raw':!![],'where':{}};var _0x52e167={};var _0x4707df={'count':0x0,'rows':[]};return db['Campaign'][_0xa5dc('0x5c')]({'where':{'id':_0x24ad5c['params']['id']}})[_0xa5dc('0x25')](handleEntityNotFound(_0x140f73,null))[_0xa5dc('0x25')](function(_0x4d8d51){if(_0x4d8d51){_0x52e167[_0xa5dc('0x35')]=_['keys'](db[_0xa5dc('0x61')]['rawAttributes']);_0x52e167[_0xa5dc('0x36')]=_[_0xa5dc('0x37')](_0x24ad5c[_0xa5dc('0x36')]);_0x52e167[_0xa5dc('0x38')]=_[_0xa5dc('0x3a')](_0x52e167[_0xa5dc('0x35')],_0x52e167['query']);_0x171b14[_0xa5dc('0x39')]=_[_0xa5dc('0x3a')](_0x52e167[_0xa5dc('0x35')],qs[_0xa5dc('0x3b')](_0x24ad5c[_0xa5dc('0x36')][_0xa5dc('0x3b')]));_0x171b14['attributes']=_0x171b14[_0xa5dc('0x39')]['length']?_0x171b14[_0xa5dc('0x39')]:_0x52e167[_0xa5dc('0x35')];if(!_0x24ad5c[_0xa5dc('0x36')]['hasOwnProperty'](_0xa5dc('0x5a'))){_0x171b14['limit']=qs['limit'](_0x24ad5c[_0xa5dc('0x36')][_0xa5dc('0x1e')]);_0x171b14[_0xa5dc('0x20')]=qs[_0xa5dc('0x20')](_0x24ad5c[_0xa5dc('0x36')]['offset']);}_0x171b14[_0xa5dc('0x5b')]=qs['sort'](_0x24ad5c['query'][_0xa5dc('0x3e')]);_0x171b14[_0xa5dc('0x3f')]=qs[_0xa5dc('0x38')](_['pick'](_0x24ad5c[_0xa5dc('0x36')],_0x52e167[_0xa5dc('0x38')]));_0x171b14['where'][_0xa5dc('0x5f')]=_0x4d8d51['id'];if(_0x24ad5c['query'][_0xa5dc('0x41')]){_0x171b14['where']=_[_0xa5dc('0x43')](_0x171b14['where'],{'$or':_[_0xa5dc('0x2f')](_0x171b14['attributes'],function(_0x4f314b){var _0x3bd657={};_0x3bd657[_0x4f314b]={'$like':'%'+_0x24ad5c[_0xa5dc('0x36')]['filter']+'%'};return _0x3bd657;})});}_0x171b14=_['merge']({},_0x171b14,_0x24ad5c['options']);return db[_0xa5dc('0x61')][_0xa5dc('0x1f')]({'where':_0x171b14[_0xa5dc('0x3f')]})[_0xa5dc('0x25')](function(_0x4726f6){_0x4707df[_0xa5dc('0x1f')]=_0x4726f6;if(_0x24ad5c[_0xa5dc('0x36')][_0xa5dc('0x52')]){_0x171b14[_0xa5dc('0x53')]=[{'all':!![]}];}return db[_0xa5dc('0x61')][_0xa5dc('0x45')](_0x171b14);})[_0xa5dc('0x25')](function(_0x2a021b){_0x4707df[_0xa5dc('0x46')]=_0x2a021b;return _0x4707df;});}})[_0xa5dc('0x25')](respondWithFilteredResult(_0x140f73,_0x171b14))[_0xa5dc('0x51')](handleError(_0x140f73,null));};exports['getLists']=function(_0x5cce6c,_0x473b6c,_0x5f3567){var _0x2f99a6={};var _0x557f1c={};var _0xf0ba5e;var _0x2e16d3;return db[_0xa5dc('0x30')][_0xa5dc('0x5c')]({'where':{'id':_0x5cce6c['params']['id']}})[_0xa5dc('0x25')](handleEntityNotFound(_0x473b6c,null))[_0xa5dc('0x25')](function(_0x218c57){if(_0x218c57){_0xf0ba5e=_0x218c57;_0x557f1c[_0xa5dc('0x35')]=_[_0xa5dc('0x37')](db[_0xa5dc('0x62')][_0xa5dc('0x31')]);_0x557f1c[_0xa5dc('0x36')]=_[_0xa5dc('0x37')](_0x5cce6c[_0xa5dc('0x36')]);_0x557f1c[_0xa5dc('0x38')]=_['intersection'](_0x557f1c['model'],_0x557f1c[_0xa5dc('0x36')]);_0x2f99a6[_0xa5dc('0x39')]=_[_0xa5dc('0x3a')](_0x557f1c[_0xa5dc('0x35')],qs[_0xa5dc('0x3b')](_0x5cce6c['query'][_0xa5dc('0x3b')]));_0x2f99a6[_0xa5dc('0x39')]=_0x2f99a6['attributes'][_0xa5dc('0x3c')]?_0x2f99a6['attributes']:_0x557f1c[_0xa5dc('0x35')];_0x2f99a6['order']=qs[_0xa5dc('0x3e')](_0x5cce6c[_0xa5dc('0x36')][_0xa5dc('0x3e')]);_0x2f99a6[_0xa5dc('0x3f')]=qs[_0xa5dc('0x38')](_[_0xa5dc('0x40')](_0x5cce6c[_0xa5dc('0x36')],_0x557f1c['filters']));if(_0x5cce6c['query'][_0xa5dc('0x41')]){_0x2f99a6[_0xa5dc('0x3f')]=_['merge'](_0x2f99a6['where'],{'$or':_['map'](_0x2f99a6['attributes'],function(_0x50246f){var _0x122aa2={};_0x122aa2[_0x50246f]={'$like':'%'+_0x5cce6c[_0xa5dc('0x36')][_0xa5dc('0x41')]+'%'};return _0x122aa2;})});}_0x2f99a6=_[_0xa5dc('0x43')]({},_0x2f99a6,_0x5cce6c[_0xa5dc('0x44')]);return _0xf0ba5e[_0xa5dc('0x63')](_0x2f99a6);}})[_0xa5dc('0x25')](function(_0x1d9dc1){if(_0x1d9dc1){_0x2e16d3=_0x1d9dc1[_0xa5dc('0x3c')];if(!_0x5cce6c['query']['hasOwnProperty']('nolimit')){_0x2f99a6[_0xa5dc('0x1e')]=qs[_0xa5dc('0x1e')](_0x5cce6c['query'][_0xa5dc('0x1e')]);_0x2f99a6['offset']=qs[_0xa5dc('0x20')](_0x5cce6c[_0xa5dc('0x36')][_0xa5dc('0x20')]);}return _0xf0ba5e[_0xa5dc('0x63')](_0x2f99a6);}})[_0xa5dc('0x25')](function(_0x2555f1){if(_0x2555f1){return _0x2555f1?{'count':_0x2e16d3,'rows':_0x2555f1}:null;}})['then'](respondWithResult(_0x473b6c,null))['catch'](handleError(_0x473b6c,null));};exports['addLists']=function(_0x2dfc44,_0x13029e,_0x5d8e49){var _0x519538,_0x4c4974;return db[_0xa5dc('0x30')]['find']({'where':{'id':_0x2dfc44['params']['id']}})['then'](handleEntityNotFound(_0x13029e,null))[_0xa5dc('0x25')](function(_0x3f0fcf){if(_0x3f0fcf){_0x4c4974=_0x3f0fcf;return _0x3f0fcf[_0xa5dc('0x64')](_0x2dfc44[_0xa5dc('0x4b')][_0xa5dc('0x65')],_[_0xa5dc('0x66')](_0x2dfc44['body'],['ids','id'])||{});}return null;})[_0xa5dc('0x67')](function(_0x14da1c){var _0x299055;_0x519538=_0x14da1c||[];var _0x3c0095=[];if(_0x14da1c){for(var _0xbeb74e=0x0;_0xbeb74e<_0x14da1c[_0xa5dc('0x3c')];_0xbeb74e+=0x1){var _0x11f85a=_0x14da1c[_0xbeb74e][_0xa5dc('0x26')]({'plain':!![]});_0x4c4974['dialCheckDuplicateType']=_0x2dfc44[_0xa5dc('0x4b')][_0xa5dc('0x68')]?_0x2dfc44['body'][_0xa5dc('0x68')]:_0x4c4974['dialCheckDuplicateType'];switch(_0x4c4974[_0xa5dc('0x68')]){case'always':_0x299055=squel[_0xa5dc('0x69')]()[_0xa5dc('0x6a')]('cm_hopper')[_0xa5dc('0x6b')](['phone',_0xa5dc('0x6c'),'ContactId','ListId',_0xa5dc('0x5f'),_0xa5dc('0x54'),_0xa5dc('0x55')],squel[_0xa5dc('0x6d')]()[_0xa5dc('0x6e')]('phone','phone')[_0xa5dc('0x6e')]('NOW()',_0xa5dc('0x6c'))[_0xa5dc('0x6e')]('id',_0xa5dc('0x6f'))[_0xa5dc('0x6e')](_0x11f85a['CmListId'][_0xa5dc('0x70')](),_0xa5dc('0x71'))[_0xa5dc('0x6e')](_0x2dfc44[_0xa5dc('0x48')]['id']['toString'](),_0xa5dc('0x5f'))['field'](_0xa5dc('0x72'),_0xa5dc('0x54'))[_0xa5dc('0x6e')](_0xa5dc('0x72'),_0xa5dc('0x55'))['from'](_0xa5dc('0x73'))[_0xa5dc('0x3f')](_0xa5dc('0x74'))[_0xa5dc('0x3f')](_0xa5dc('0x75'),_0x11f85a[_0xa5dc('0x76')]['toString']())[_0xa5dc('0x3f')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xa5dc('0x77'),squel[_0xa5dc('0x6d')]()[_0xa5dc('0x6e')]('COALESCE(calleridnum,\x27\x27)')[_0xa5dc('0x78')](_0xa5dc('0x79'))['where'](_0xa5dc('0x7a'),_0x2dfc44[_0xa5dc('0x48')]['id'][_0xa5dc('0x70')]()))[_0xa5dc('0x3f')](_0xa5dc('0x77'),squel[_0xa5dc('0x6d')]()['field'](_0xa5dc('0x7b'))[_0xa5dc('0x78')](_0xa5dc('0x7c'))[_0xa5dc('0x3f')]('CampaignId\x20=\x20?',_0x2dfc44[_0xa5dc('0x48')]['id'][_0xa5dc('0x70')]())))[_0xa5dc('0x70')]();break;case _0xa5dc('0x7d'):_0x299055=squel[_0xa5dc('0x69')]()[_0xa5dc('0x6a')]('cm_hopper')['fromQuery']([_0xa5dc('0x7e'),_0xa5dc('0x6c'),_0xa5dc('0x6f'),_0xa5dc('0x71'),'CampaignId',_0xa5dc('0x54'),_0xa5dc('0x55')],squel[_0xa5dc('0x6d')]()[_0xa5dc('0x6e')](_0xa5dc('0x7e'),_0xa5dc('0x7e'))[_0xa5dc('0x6e')](_0xa5dc('0x72'),'scheduledAt')['field']('id',_0xa5dc('0x6f'))[_0xa5dc('0x6e')](_0x11f85a[_0xa5dc('0x76')][_0xa5dc('0x70')](),_0xa5dc('0x71'))[_0xa5dc('0x6e')](_0x2dfc44['params']['id'][_0xa5dc('0x70')](),_0xa5dc('0x5f'))[_0xa5dc('0x6e')](_0xa5dc('0x72'),_0xa5dc('0x54'))['field'](_0xa5dc('0x72'),'updatedAt')[_0xa5dc('0x78')](_0xa5dc('0x73'))[_0xa5dc('0x3f')]('deletedAt\x20IS\x20NULL')[_0xa5dc('0x3f')](_0xa5dc('0x75'),_0x11f85a[_0xa5dc('0x76')][_0xa5dc('0x70')]())['where'](_0xa5dc('0x7f'))[_0xa5dc('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa5dc('0x6d')]()[_0xa5dc('0x6e')](_0xa5dc('0x7b'))[_0xa5dc('0x78')](_0xa5dc('0x7c'))[_0xa5dc('0x3f')]('CampaignId\x20=\x20?',_0x2dfc44[_0xa5dc('0x48')]['id']['toString']())))[_0xa5dc('0x70')]();break;default:_0x299055=squel['insert']()[_0xa5dc('0x6a')](_0xa5dc('0x7c'))[_0xa5dc('0x6b')]([_0xa5dc('0x7e'),_0xa5dc('0x6c'),_0xa5dc('0x6f'),_0xa5dc('0x71'),'CampaignId',_0xa5dc('0x54'),'updatedAt'],squel[_0xa5dc('0x6d')]()['field'](_0xa5dc('0x7e'),'phone')['field'](_0xa5dc('0x72'),_0xa5dc('0x6c'))[_0xa5dc('0x6e')]('id','ContactId')[_0xa5dc('0x6e')](_0x11f85a[_0xa5dc('0x76')][_0xa5dc('0x70')](),'ListId')[_0xa5dc('0x6e')](_0x2dfc44[_0xa5dc('0x48')]['id'][_0xa5dc('0x70')](),_0xa5dc('0x5f'))['field'](_0xa5dc('0x72'),_0xa5dc('0x54'))['field'](_0xa5dc('0x72'),_0xa5dc('0x55'))[_0xa5dc('0x78')](_0xa5dc('0x73'))['where'](_0xa5dc('0x74'))[_0xa5dc('0x3f')]('ListId\x20=\x20?',_0x11f85a[_0xa5dc('0x76')][_0xa5dc('0x70')]())['where'](_0xa5dc('0x7f')))[_0xa5dc('0x70')]();}_0x3c0095[_0xa5dc('0x80')](db['sequelize'][_0xa5dc('0x36')](_0x299055));}return BPromise[_0xa5dc('0x81')](_0x3c0095);}})['then'](function(){return _0x519538;})[_0xa5dc('0x25')](respondWithResult(_0x13029e,null))[_0xa5dc('0x51')](handleError(_0x13029e,null));};exports[_0xa5dc('0x82')]=function(_0x2c6648,_0x1c538e,_0x2e052e){return db[_0xa5dc('0x30')]['find']({'where':{'id':_0x2c6648['params']['id']}})['then'](handleEntityNotFound(_0x1c538e,null))['then'](function(_0x263b61){if(_0x263b61){return _0x263b61[_0xa5dc('0x82')](_0x2c6648[_0xa5dc('0x36')][_0xa5dc('0x65')]);}})[_0xa5dc('0x25')](function(_0x79ea41){if(_0x79ea41){return db[_0xa5dc('0x59')][_0xa5dc('0x29')]({'where':{'ListId':_0x2c6648['query']['ids'],'CampaignId':_0x2c6648[_0xa5dc('0x48')]['id']}})[_0xa5dc('0x25')](function(){return _0x79ea41;});}})[_0xa5dc('0x25')](respondWithStatusCode(_0x1c538e,null))[_0xa5dc('0x51')](handleError(_0x1c538e,null));};exports[_0xa5dc('0x83')]=function(_0x4c4564,_0x15faeb,_0x57a08d){var _0x46f369={};var _0x3aa164={};var _0x4a0691;var _0x45cb08;return db[_0xa5dc('0x30')]['findOne']({'where':{'id':_0x4c4564[_0xa5dc('0x48')]['id']}})['then'](handleEntityNotFound(_0x15faeb,null))[_0xa5dc('0x25')](function(_0x1e4f0f){if(_0x1e4f0f){_0x4a0691=_0x1e4f0f;_0x3aa164[_0xa5dc('0x35')]=_[_0xa5dc('0x37')](db[_0xa5dc('0x62')][_0xa5dc('0x31')]);_0x3aa164[_0xa5dc('0x36')]=_['keys'](_0x4c4564[_0xa5dc('0x36')]);_0x3aa164[_0xa5dc('0x38')]=_[_0xa5dc('0x3a')](_0x3aa164['model'],_0x3aa164[_0xa5dc('0x36')]);_0x46f369[_0xa5dc('0x39')]=_[_0xa5dc('0x3a')](_0x3aa164[_0xa5dc('0x35')],qs['fields'](_0x4c4564[_0xa5dc('0x36')][_0xa5dc('0x3b')]));_0x46f369[_0xa5dc('0x39')]=_0x46f369[_0xa5dc('0x39')][_0xa5dc('0x3c')]?_0x46f369[_0xa5dc('0x39')]:_0x3aa164[_0xa5dc('0x35')];_0x46f369['order']=qs[_0xa5dc('0x3e')](_0x4c4564[_0xa5dc('0x36')][_0xa5dc('0x3e')]);_0x46f369[_0xa5dc('0x3f')]=qs[_0xa5dc('0x38')](_[_0xa5dc('0x40')](_0x4c4564[_0xa5dc('0x36')],_0x3aa164[_0xa5dc('0x38')]));if(_0x4c4564[_0xa5dc('0x36')][_0xa5dc('0x41')]){_0x46f369['where']=_[_0xa5dc('0x43')](_0x46f369[_0xa5dc('0x3f')],{'$or':_[_0xa5dc('0x2f')](_0x46f369[_0xa5dc('0x39')],function(_0xba4619){var _0x22ce21={};_0x22ce21[_0xba4619]={'$like':'%'+_0x4c4564['query'][_0xa5dc('0x41')]+'%'};return _0x22ce21;})});}_0x46f369=_[_0xa5dc('0x43')]({},_0x46f369,_0x4c4564['options']);return _0x4a0691[_0xa5dc('0x83')](_0x46f369);}})[_0xa5dc('0x25')](function(_0x3ee9b3){if(_0x3ee9b3){_0x45cb08=_0x3ee9b3['length'];if(!_0x4c4564['query'][_0xa5dc('0x3d')](_0xa5dc('0x5a'))){_0x46f369[_0xa5dc('0x1e')]=qs['limit'](_0x4c4564[_0xa5dc('0x36')][_0xa5dc('0x1e')]);_0x46f369['offset']=qs[_0xa5dc('0x20')](_0x4c4564['query'][_0xa5dc('0x20')]);}return _0x4a0691['getBlackLists'](_0x46f369);}})[_0xa5dc('0x25')](function(_0x3fedeb){if(_0x3fedeb){return _0x3fedeb?{'count':_0x45cb08,'rows':_0x3fedeb}:null;}})[_0xa5dc('0x25')](respondWithResult(_0x15faeb,null))['catch'](handleError(_0x15faeb,null));};exports['addBlackLists']=function(_0x7052e0,_0x23f300,_0x1699a0){var _0x1bcca2,_0x55c835;return db[_0xa5dc('0x30')]['find']({'where':{'id':_0x7052e0['params']['id']}})[_0xa5dc('0x25')](handleEntityNotFound(_0x23f300,null))['then'](function(_0x25dbb3){if(_0x25dbb3){_0x55c835=_0x25dbb3;return _0x25dbb3[_0xa5dc('0x84')](_0x7052e0[_0xa5dc('0x4b')]['ids'],_[_0xa5dc('0x66')](_0x7052e0[_0xa5dc('0x4b')],[_0xa5dc('0x65'),'id'])||{});}return null;})[_0xa5dc('0x67')](function(_0x3f8709){var _0x513bbe;_0x1bcca2=_0x3f8709||[];var _0x208b11=[];if(_0x3f8709){for(var _0x341e7c=0x0;_0x341e7c<_0x3f8709[_0xa5dc('0x3c')];_0x341e7c+=0x1){var _0x9aa40c=_0x3f8709[_0x341e7c][_0xa5dc('0x26')]({'plain':!![]});_0x513bbe=squel['insert']()['into'](_0xa5dc('0x85'))[_0xa5dc('0x6b')]([_0xa5dc('0x7e'),'ContactId',_0xa5dc('0x71'),_0xa5dc('0x5f'),_0xa5dc('0x54'),_0xa5dc('0x55')],squel[_0xa5dc('0x6d')]()[_0xa5dc('0x6e')](_0xa5dc('0x7e'),_0xa5dc('0x7e'))[_0xa5dc('0x6e')]('id',_0xa5dc('0x6f'))['field'](_0x9aa40c[_0xa5dc('0x76')][_0xa5dc('0x70')](),'ListId')[_0xa5dc('0x6e')](_0x7052e0['params']['id']['toString'](),_0xa5dc('0x5f'))[_0xa5dc('0x6e')](_0xa5dc('0x72'),_0xa5dc('0x54'))[_0xa5dc('0x6e')]('NOW()',_0xa5dc('0x55'))['from'](_0xa5dc('0x73'))[_0xa5dc('0x3f')](_0xa5dc('0x74'))[_0xa5dc('0x3f')](_0xa5dc('0x75'),_0x9aa40c['CmListId'][_0xa5dc('0x70')]())[_0xa5dc('0x3f')](_0xa5dc('0x7f')))['toString']();_0x208b11[_0xa5dc('0x80')](db[_0xa5dc('0x86')][_0xa5dc('0x36')](_0x513bbe));}return BPromise['all'](_0x208b11);}})[_0xa5dc('0x25')](function(){return _0x1bcca2;})[_0xa5dc('0x25')](respondWithResult(_0x23f300,null))[_0xa5dc('0x51')](handleError(_0x23f300,null));};exports[_0xa5dc('0x87')]=function(_0x1d400f,_0x31271b,_0x24f568){return db[_0xa5dc('0x30')][_0xa5dc('0x49')]({'where':{'id':_0x1d400f[_0xa5dc('0x48')]['id']}})[_0xa5dc('0x25')](handleEntityNotFound(_0x31271b,null))[_0xa5dc('0x25')](function(_0x42f030){if(_0x42f030){return _0x42f030[_0xa5dc('0x87')](_0x1d400f[_0xa5dc('0x36')][_0xa5dc('0x65')]);}})[_0xa5dc('0x25')](function(_0x40ebfe){if(_0x40ebfe){return db[_0xa5dc('0x61')][_0xa5dc('0x29')]({'where':{'ListId':_0x1d400f[_0xa5dc('0x36')][_0xa5dc('0x65')],'CampaignId':_0x1d400f['params']['id']}})['then'](function(){return _0x40ebfe;});}})[_0xa5dc('0x25')](respondWithStatusCode(_0x31271b,null))[_0xa5dc('0x51')](handleError(_0x31271b,null));};
\ No newline at end of file
+var _0x667f=['attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','Campaign','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','find','omit','createdAt','updatedAt','role','params','getHoppers','findOne','keys','nolimit','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','fromQuery','phone','ContactId','select','field','NOW()','scheduledAt','CmListId','toString','ListId','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','insert','cm_contacts','COALESCE(phone,\x27\x27)','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection'];(function(_0x3a096c,_0x440950){var _0x25173a=function(_0x341a97){while(--_0x341a97){_0x3a096c['push'](_0x3a096c['shift']());}};_0x25173a(++_0x440950);}(_0x667f,0xd7));var _0xf667=function(_0x2936d8,_0x2e415a){_0x2936d8=_0x2936d8-0x0;var _0x194e7b=_0x667f[_0x2936d8];return _0x194e7b;};'use strict';var emlformat=require(_0xf667('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf667('0x1'));var moment=require(_0xf667('0x2'));var BPromise=require(_0xf667('0x3'));var Mustache=require(_0xf667('0x4'));var util=require(_0xf667('0x5'));var path=require(_0xf667('0x6'));var sox=require('sox');var csv=require(_0xf667('0x7'));var ejs=require(_0xf667('0x8'));var fs=require('fs');var fs_extra=require(_0xf667('0x9'));var _=require(_0xf667('0xa'));var squel=require(_0xf667('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf667('0x7'));var querystring=require(_0xf667('0xc'));var Papa=require('papaparse');var Redis=require(_0xf667('0xd'));var authService=require(_0xf667('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xf667('0xf'));var hardwareService=require(_0xf667('0x10'));var logger=require(_0xf667('0x11'))(_0xf667('0x12'));var utils=require(_0xf667('0x13'));var config=require(_0xf667('0x14'));var licenseUtil=require(_0xf667('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18191c,_0xd26c39){_0xd26c39=_0xd26c39||0xcc;return function(_0x40d3f4){if(_0x40d3f4){return _0x18191c[_0xf667('0x16')](_0xd26c39);}return _0x18191c[_0xf667('0x17')](_0xd26c39)[_0xf667('0x18')]();};}function respondWithResult(_0x42291d,_0xacafb3){_0xacafb3=_0xacafb3||0xc8;return function(_0x4cf66f){if(_0x4cf66f){return _0x42291d[_0xf667('0x17')](_0xacafb3)[_0xf667('0x19')](_0x4cf66f);}};}function respondWithFilteredResult(_0x32d0c7,_0x53d2c8){return function(_0x5c7b45){if(_0x5c7b45){var _0x11ac7f=typeof _0x53d2c8[_0xf667('0x1a')]===_0xf667('0x1b')&&typeof _0x53d2c8['limit']===_0xf667('0x1b');var _0x2dbacb=_0x5c7b45[_0xf667('0x1c')];var _0x2a3ca1=_0x11ac7f?0x0:_0x53d2c8[_0xf667('0x1a')];var _0x43d1d9=_0x11ac7f?_0x5c7b45['count']:_0x53d2c8[_0xf667('0x1a')]+_0x53d2c8[_0xf667('0x1d')];var _0x1023d3;if(_0x43d1d9>=_0x2dbacb){_0x43d1d9=_0x2dbacb;_0x1023d3=0xc8;}else{_0x1023d3=0xce;}_0x32d0c7[_0xf667('0x17')](_0x1023d3);return _0x32d0c7[_0xf667('0x1e')](_0xf667('0x1f'),_0x2a3ca1+'-'+_0x43d1d9+'/'+_0x2dbacb)[_0xf667('0x19')](_0x5c7b45);}return null;};}function patchUpdates(_0x2df328){return function(_0x47b20b){try{jsonpatch[_0xf667('0x20')](_0x47b20b,_0x2df328,!![]);}catch(_0x2518e5){return BPromise[_0xf667('0x21')](_0x2518e5);}return _0x47b20b[_0xf667('0x22')]();};}function saveUpdates(_0x356fda,_0x3526e5){return function(_0x365599){if(_0x365599){return _0x365599['update'](_0x356fda)[_0xf667('0x23')](function(_0x591fba){return _0x591fba;});}return null;};}function removeEntity(_0x88efc1,_0x27b29a){return function(_0x113dbc){if(_0x113dbc){return _0x113dbc[_0xf667('0x24')]()[_0xf667('0x23')](function(){var _0x5771e3=_0x113dbc[_0xf667('0x25')]({'plain':!![]});var _0x1ecb84=_0xf667('0x26');return db[_0xf667('0x27')]['destroy']({'where':{'type':_0x1ecb84,'resourceId':_0x5771e3['id']}})['then'](function(){return _0x113dbc;});})['then'](function(){_0x88efc1[_0xf667('0x17')](0xcc)[_0xf667('0x18')]();});}};}function handleEntityNotFound(_0x38abea,_0xa306e1){return function(_0x155668){if(!_0x155668){_0x38abea[_0xf667('0x16')](0x194);}return _0x155668;};}function handleError(_0x10476a,_0x48fa0a){_0x48fa0a=_0x48fa0a||0x1f4;return function(_0x3ed845){logger[_0xf667('0x28')](_0x3ed845[_0xf667('0x29')]);if(_0x3ed845[_0xf667('0x2a')]){delete _0x3ed845[_0xf667('0x2a')];}_0x10476a['status'](_0x48fa0a)[_0xf667('0x2b')](_0x3ed845);};}exports['index']=function(_0x32a781,_0x38684f){var _0x2dd6a1={},_0x42de82={},_0x546fd5={'count':0x0,'rows':[]};var _0xc89eea=_[_0xf667('0x2c')](db['Campaign'][_0xf667('0x2d')],function(_0x424cff){return{'name':_0x424cff[_0xf667('0x2e')],'type':_0x424cff[_0xf667('0x2f')][_0xf667('0x30')]};});_0x42de82[_0xf667('0x31')]=_[_0xf667('0x2c')](_0xc89eea,_0xf667('0x2a'));_0x42de82[_0xf667('0x32')]=_['keys'](_0x32a781['query']);_0x42de82[_0xf667('0x33')]=_[_0xf667('0x34')](_0x42de82[_0xf667('0x31')],_0x42de82[_0xf667('0x32')]);_0x2dd6a1[_0xf667('0x35')]=_[_0xf667('0x34')](_0x42de82['model'],qs['fields'](_0x32a781[_0xf667('0x32')][_0xf667('0x36')]));_0x2dd6a1[_0xf667('0x35')]=_0x2dd6a1[_0xf667('0x35')][_0xf667('0x37')]?_0x2dd6a1[_0xf667('0x35')]:_0x42de82[_0xf667('0x31')];if(!_0x32a781['query'][_0xf667('0x38')]('nolimit')){_0x2dd6a1[_0xf667('0x1d')]=qs[_0xf667('0x1d')](_0x32a781[_0xf667('0x32')][_0xf667('0x1d')]);_0x2dd6a1[_0xf667('0x1a')]=qs['offset'](_0x32a781['query'][_0xf667('0x1a')]);}_0x2dd6a1[_0xf667('0x39')]=qs[_0xf667('0x3a')](_0x32a781['query'][_0xf667('0x3a')]);_0x2dd6a1[_0xf667('0x3b')]=qs[_0xf667('0x33')](_[_0xf667('0x3c')](_0x32a781['query'],_0x42de82[_0xf667('0x33')]),_0xc89eea);if(_0x32a781[_0xf667('0x32')][_0xf667('0x3d')]){_0x2dd6a1[_0xf667('0x3b')]=_[_0xf667('0x3e')](_0x2dd6a1['where'],{'$or':_['map'](_0xc89eea,function(_0x16243d){if(_0x16243d[_0xf667('0x2f')]!==_0xf667('0x3f')){var _0x278704={};_0x278704[_0x16243d[_0xf667('0x2a')]]={'$like':'%'+_0x32a781['query']['filter']+'%'};return _0x278704;}})});}_0x2dd6a1=_[_0xf667('0x3e')]({},_0x2dd6a1,_0x32a781[_0xf667('0x40')]);var _0x4a17d1={'where':_0x2dd6a1[_0xf667('0x3b')]};return db['Campaign'][_0xf667('0x1c')](_0x4a17d1)[_0xf667('0x23')](function(_0x2b0ec9){_0x546fd5['count']=_0x2b0ec9;if(_0x32a781[_0xf667('0x32')][_0xf667('0x41')]){_0x2dd6a1[_0xf667('0x42')]=[{'all':!![]}];}return db['Campaign'][_0xf667('0x43')](_0x2dd6a1);})[_0xf667('0x23')](function(_0x524bc9){_0x546fd5[_0xf667('0x44')]=_0x524bc9;return _0x546fd5;})[_0xf667('0x23')](respondWithFilteredResult(_0x38684f,_0x2dd6a1))['catch'](handleError(_0x38684f,null));};exports[_0xf667('0x45')]=function(_0x5cebe8,_0x103097){var _0x1b0ab7={'raw':![],'where':{'id':_0x5cebe8['params']['id']}},_0x53b86b={};_0x53b86b['model']=_['keys'](db[_0xf667('0x46')][_0xf667('0x2d')]);_0x53b86b[_0xf667('0x32')]=_['keys'](_0x5cebe8[_0xf667('0x32')]);_0x53b86b[_0xf667('0x33')]=_['intersection'](_0x53b86b[_0xf667('0x31')],_0x53b86b['query']);_0x1b0ab7[_0xf667('0x35')]=_[_0xf667('0x34')](_0x53b86b['model'],qs['fields'](_0x5cebe8['query']['fields']));_0x1b0ab7[_0xf667('0x35')]=_0x1b0ab7[_0xf667('0x35')]['length']?_0x1b0ab7['attributes']:_0x53b86b['model'];if(_0x5cebe8[_0xf667('0x32')][_0xf667('0x41')]){_0x1b0ab7[_0xf667('0x42')]=[{'all':!![]}];}_0x1b0ab7=_[_0xf667('0x3e')]({},_0x1b0ab7,_0x5cebe8[_0xf667('0x40')]);return db['Campaign']['find'](_0x1b0ab7)[_0xf667('0x23')](handleEntityNotFound(_0x103097,null))[_0xf667('0x23')](respondWithResult(_0x103097,null))['catch'](handleError(_0x103097,null));};exports['create']=function(_0x2bd50b,_0x38b07b){return db['Campaign']['create'](_0x2bd50b[_0xf667('0x47')],{})[_0xf667('0x23')](function(_0x4c0e35){var _0x51800f=_0x2bd50b[_0xf667('0x48')][_0xf667('0x25')]({'plain':!![]});if(!_0x51800f)throw new Error(_0xf667('0x49'));if(_0x51800f['role']===_0xf667('0x48')){var _0x53a69b=_0x4c0e35['get']({'plain':!![]});var _0x1f6e5e=_0xf667('0x26');return db[_0xf667('0x4a')]['find']({'where':{'name':_0x1f6e5e,'userProfileId':_0x51800f[_0xf667('0x4b')]},'raw':!![]})[_0xf667('0x23')](function(_0x3c2109){if(_0x3c2109&&_0x3c2109[_0xf667('0x4c')]===0x0){return db['UserProfileResource'][_0xf667('0x4d')]({'name':_0x53a69b[_0xf667('0x2a')],'resourceId':_0x53a69b['id'],'type':_0x3c2109[_0xf667('0x2a')],'sectionId':_0x3c2109['id']},{})[_0xf667('0x23')](function(){return _0x4c0e35;});}else{return _0x4c0e35;}})[_0xf667('0x4e')](function(_0x1488f4){logger[_0xf667('0x28')](_0xf667('0x4f'),_0x1488f4);throw _0x1488f4;});}return _0x4c0e35;})[_0xf667('0x23')](respondWithResult(_0x38b07b,0xc9))[_0xf667('0x4e')](handleError(_0x38b07b,null));};exports[_0xf667('0x50')]=function(_0x54c42c,_0x5793d1){var _0x47331e={'where':{'id':_0x54c42c['params']['id']}},_0xf17602={};_0xf17602['model']=_['keys'](db[_0xf667('0x46')][_0xf667('0x2d')]);_0x47331e[_0xf667('0x35')]=_[_0xf667('0x34')](_0xf17602[_0xf667('0x31')],qs[_0xf667('0x36')](_0x54c42c[_0xf667('0x32')][_0xf667('0x36')]));_0x47331e[_0xf667('0x35')]=_0x47331e[_0xf667('0x35')][_0xf667('0x37')]?_0x47331e[_0xf667('0x35')]:_0xf17602[_0xf667('0x31')];if(_0x54c42c[_0xf667('0x32')][_0xf667('0x41')]){_0x47331e[_0xf667('0x42')]=[{'all':!![]}];}_0x47331e=_[_0xf667('0x3e')]({},_0x47331e,_0x54c42c[_0xf667('0x40')]);return db['Campaign'][_0xf667('0x51')](_0x47331e)[_0xf667('0x23')](handleEntityNotFound(_0x5793d1,null))[_0xf667('0x23')](function(_0x2c2019){if(_0x2c2019){var _0x2f5f98=_0x2c2019['get']({'plain':!![]});_0x2f5f98=qs[_0xf667('0x52')](_0x2f5f98,['id',_0xf667('0x53'),_0xf667('0x54')]);_0x54c42c[_0xf667('0x47')]=_[_0xf667('0x52')](_0x54c42c[_0xf667('0x47')],['id',_0xf667('0x53'),_0xf667('0x54')]);return db[_0xf667('0x46')][_0xf667('0x4d')](_[_0xf667('0x3e')](_0x2f5f98,_0x54c42c[_0xf667('0x47')]),{'include':_0x54c42c[_0xf667('0x32')][_0xf667('0x41')]?[{'all':!![]}]:undefined})[_0xf667('0x23')](function(_0xd60942){var _0x492910=_0x54c42c[_0xf667('0x48')]['get']({'plain':!![]});if(!_0x492910)throw new Error(_0xf667('0x49'));if(_0x492910[_0xf667('0x55')]===_0xf667('0x48')){var _0x545eed=_0xd60942[_0xf667('0x25')]({'plain':!![]});var _0xbe9ac5='IvrCampaigns';return db[_0xf667('0x4a')][_0xf667('0x51')]({'where':{'name':_0xbe9ac5,'userProfileId':_0x492910[_0xf667('0x4b')]},'raw':!![]})[_0xf667('0x23')](function(_0x27afc5){if(_0x27afc5&&_0x27afc5[_0xf667('0x4c')]===0x0){return db[_0xf667('0x27')][_0xf667('0x4d')]({'name':_0x545eed[_0xf667('0x2a')],'resourceId':_0x545eed['id'],'type':_0x27afc5[_0xf667('0x2a')],'sectionId':_0x27afc5['id']},{})[_0xf667('0x23')](function(){return _0xd60942;});}else{return _0xd60942;}})[_0xf667('0x4e')](function(_0x27f0e4){logger[_0xf667('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27f0e4);throw _0x27f0e4;});}return _0xd60942;});}})[_0xf667('0x23')](respondWithResult(_0x5793d1,0xc9))[_0xf667('0x4e')](handleError(_0x5793d1,null));};exports['update']=function(_0x356967,_0xc4a95a){if(_0x356967[_0xf667('0x47')]['id']){delete _0x356967[_0xf667('0x47')]['id'];}return db['Campaign'][_0xf667('0x51')]({'where':{'id':_0x356967[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0xc4a95a,null))[_0xf667('0x23')](saveUpdates(_0x356967[_0xf667('0x47')],null))[_0xf667('0x23')](respondWithResult(_0xc4a95a,null))[_0xf667('0x4e')](handleError(_0xc4a95a,null));};exports[_0xf667('0x24')]=function(_0x5ec5bd,_0x4d1c9f){return db[_0xf667('0x46')]['find']({'where':{'id':_0x5ec5bd[_0xf667('0x56')]['id']}})['then'](handleEntityNotFound(_0x4d1c9f,null))[_0xf667('0x23')](removeEntity(_0x4d1c9f,null))[_0xf667('0x4e')](handleError(_0x4d1c9f,null));};exports[_0xf667('0x57')]=function(_0x1292ac,_0x41a531,_0x29e344){var _0x4f696c={'raw':!![],'where':{}};var _0x4ba6ad={};var _0x53d070={'count':0x0,'rows':[]};return db[_0xf667('0x46')][_0xf667('0x58')]({'where':{'id':_0x1292ac[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x41a531,null))[_0xf667('0x23')](function(_0x2a82e0){if(_0x2a82e0){_0x4ba6ad['model']=_[_0xf667('0x59')](db['CmHopper'][_0xf667('0x2d')]);_0x4ba6ad[_0xf667('0x32')]=_[_0xf667('0x59')](_0x1292ac[_0xf667('0x32')]);_0x4ba6ad[_0xf667('0x33')]=_[_0xf667('0x34')](_0x4ba6ad[_0xf667('0x31')],_0x4ba6ad['query']);_0x4f696c['attributes']=_[_0xf667('0x34')](_0x4ba6ad['model'],qs[_0xf667('0x36')](_0x1292ac['query']['fields']));_0x4f696c['attributes']=_0x4f696c['attributes'][_0xf667('0x37')]?_0x4f696c[_0xf667('0x35')]:_0x4ba6ad[_0xf667('0x31')];if(!_0x1292ac['query'][_0xf667('0x38')](_0xf667('0x5a'))){_0x4f696c[_0xf667('0x1d')]=qs[_0xf667('0x1d')](_0x1292ac[_0xf667('0x32')][_0xf667('0x1d')]);_0x4f696c[_0xf667('0x1a')]=qs[_0xf667('0x1a')](_0x1292ac[_0xf667('0x32')][_0xf667('0x1a')]);}_0x4f696c[_0xf667('0x39')]=qs[_0xf667('0x3a')](_0x1292ac[_0xf667('0x32')][_0xf667('0x3a')]);_0x4f696c[_0xf667('0x3b')]=qs['filters'](_[_0xf667('0x3c')](_0x1292ac[_0xf667('0x32')],_0x4ba6ad['filters']));_0x4f696c[_0xf667('0x3b')][_0xf667('0x5b')]=_0x2a82e0['id'];if(_0x1292ac[_0xf667('0x32')][_0xf667('0x3d')]){_0x4f696c[_0xf667('0x3b')]=_[_0xf667('0x3e')](_0x4f696c['where'],{'$or':_[_0xf667('0x2c')](_0x4f696c['attributes'],function(_0x486a2b){var _0x58c798={};_0x58c798[_0x486a2b]={'$like':'%'+_0x1292ac[_0xf667('0x32')][_0xf667('0x3d')]+'%'};return _0x58c798;})});}_0x4f696c=_[_0xf667('0x3e')]({},_0x4f696c,_0x1292ac[_0xf667('0x40')]);return db[_0xf667('0x5c')][_0xf667('0x1c')]({'where':_0x4f696c['where']})[_0xf667('0x23')](function(_0xeadd64){_0x53d070[_0xf667('0x1c')]=_0xeadd64;if(_0x1292ac[_0xf667('0x32')][_0xf667('0x41')]){_0x4f696c[_0xf667('0x42')]=[{'all':!![]}];}return db[_0xf667('0x5c')][_0xf667('0x43')](_0x4f696c);})[_0xf667('0x23')](function(_0x3741c9){_0x53d070[_0xf667('0x44')]=_0x3741c9;return _0x53d070;});}})[_0xf667('0x23')](respondWithFilteredResult(_0x41a531,_0x4f696c))[_0xf667('0x4e')](handleError(_0x41a531,null));};exports[_0xf667('0x5d')]=function(_0x269bea,_0x263c78,_0x1ca672){var _0x28f356={'raw':!![],'where':{}};var _0x1e44c1={};var _0x25fe40={'count':0x0,'rows':[]};return db[_0xf667('0x46')][_0xf667('0x58')]({'where':{'id':_0x269bea[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x263c78,null))[_0xf667('0x23')](function(_0x3c70f2){if(_0x3c70f2){_0x1e44c1['model']=_[_0xf667('0x59')](db[_0xf667('0x5e')][_0xf667('0x2d')]);_0x1e44c1['query']=_['keys'](_0x269bea[_0xf667('0x32')]);_0x1e44c1[_0xf667('0x33')]=_[_0xf667('0x34')](_0x1e44c1[_0xf667('0x31')],_0x1e44c1['query']);_0x28f356[_0xf667('0x35')]=_[_0xf667('0x34')](_0x1e44c1['model'],qs[_0xf667('0x36')](_0x269bea['query']['fields']));_0x28f356['attributes']=_0x28f356[_0xf667('0x35')][_0xf667('0x37')]?_0x28f356[_0xf667('0x35')]:_0x1e44c1[_0xf667('0x31')];if(!_0x269bea['query'][_0xf667('0x38')](_0xf667('0x5a'))){_0x28f356[_0xf667('0x1d')]=qs['limit'](_0x269bea[_0xf667('0x32')][_0xf667('0x1d')]);_0x28f356[_0xf667('0x1a')]=qs[_0xf667('0x1a')](_0x269bea['query'][_0xf667('0x1a')]);}_0x28f356[_0xf667('0x39')]=qs[_0xf667('0x3a')](_0x269bea['query'][_0xf667('0x3a')]);_0x28f356['where']=qs[_0xf667('0x33')](_['pick'](_0x269bea[_0xf667('0x32')],_0x1e44c1[_0xf667('0x33')]));_0x28f356[_0xf667('0x3b')][_0xf667('0x5b')]=_0x3c70f2['id'];if(_0x269bea[_0xf667('0x32')][_0xf667('0x3d')]){_0x28f356[_0xf667('0x3b')]=_[_0xf667('0x3e')](_0x28f356[_0xf667('0x3b')],{'$or':_[_0xf667('0x2c')](_0x28f356[_0xf667('0x35')],function(_0x47e677){var _0x2ba145={};_0x2ba145[_0x47e677]={'$like':'%'+_0x269bea[_0xf667('0x32')][_0xf667('0x3d')]+'%'};return _0x2ba145;})});}_0x28f356=_[_0xf667('0x3e')]({},_0x28f356,_0x269bea[_0xf667('0x40')]);return db[_0xf667('0x5e')][_0xf667('0x1c')]({'where':_0x28f356['where']})[_0xf667('0x23')](function(_0x5175dd){_0x25fe40[_0xf667('0x1c')]=_0x5175dd;if(_0x269bea['query'][_0xf667('0x41')]){_0x28f356[_0xf667('0x42')]=[{'all':!![]}];}return db[_0xf667('0x5e')][_0xf667('0x43')](_0x28f356);})[_0xf667('0x23')](function(_0x54cb54){_0x25fe40[_0xf667('0x44')]=_0x54cb54;return _0x25fe40;});}})[_0xf667('0x23')](respondWithFilteredResult(_0x263c78,_0x28f356))['catch'](handleError(_0x263c78,null));};exports['getHopperFinals']=function(_0x49f523,_0x461c01,_0x503745){var _0x5c6d8e={'raw':!![],'where':{}};var _0xe16cc={};var _0x327947={'count':0x0,'rows':[]};return db[_0xf667('0x46')][_0xf667('0x58')]({'where':{'id':_0x49f523[_0xf667('0x56')]['id']}})['then'](handleEntityNotFound(_0x461c01,null))['then'](function(_0x3ba57c){if(_0x3ba57c){_0xe16cc[_0xf667('0x31')]=_[_0xf667('0x59')](db[_0xf667('0x5f')][_0xf667('0x2d')]);_0xe16cc[_0xf667('0x32')]=_['keys'](_0x49f523[_0xf667('0x32')]);_0xe16cc[_0xf667('0x33')]=_[_0xf667('0x34')](_0xe16cc[_0xf667('0x31')],_0xe16cc[_0xf667('0x32')]);_0x5c6d8e[_0xf667('0x35')]=_[_0xf667('0x34')](_0xe16cc[_0xf667('0x31')],qs[_0xf667('0x36')](_0x49f523[_0xf667('0x32')]['fields']));_0x5c6d8e[_0xf667('0x35')]=_0x5c6d8e['attributes']['length']?_0x5c6d8e[_0xf667('0x35')]:_0xe16cc['model'];if(!_0x49f523[_0xf667('0x32')][_0xf667('0x38')](_0xf667('0x5a'))){_0x5c6d8e[_0xf667('0x1d')]=qs['limit'](_0x49f523[_0xf667('0x32')][_0xf667('0x1d')]);_0x5c6d8e[_0xf667('0x1a')]=qs['offset'](_0x49f523[_0xf667('0x32')]['offset']);}_0x5c6d8e[_0xf667('0x39')]=qs[_0xf667('0x3a')](_0x49f523[_0xf667('0x32')][_0xf667('0x3a')]);_0x5c6d8e[_0xf667('0x3b')]=qs[_0xf667('0x33')](_['pick'](_0x49f523['query'],_0xe16cc[_0xf667('0x33')]));_0x5c6d8e[_0xf667('0x3b')][_0xf667('0x5b')]=_0x3ba57c['id'];if(_0x49f523[_0xf667('0x32')][_0xf667('0x3d')]){_0x5c6d8e[_0xf667('0x3b')]=_[_0xf667('0x3e')](_0x5c6d8e[_0xf667('0x3b')],{'$or':_[_0xf667('0x2c')](_0x5c6d8e['attributes'],function(_0x522627){var _0x54b807={};_0x54b807[_0x522627]={'$like':'%'+_0x49f523[_0xf667('0x32')][_0xf667('0x3d')]+'%'};return _0x54b807;})});}_0x5c6d8e=_[_0xf667('0x3e')]({},_0x5c6d8e,_0x49f523[_0xf667('0x40')]);return db[_0xf667('0x5f')][_0xf667('0x1c')]({'where':_0x5c6d8e[_0xf667('0x3b')]})['then'](function(_0x5c8995){_0x327947['count']=_0x5c8995;if(_0x49f523[_0xf667('0x32')][_0xf667('0x41')]){_0x5c6d8e[_0xf667('0x42')]=[{'all':!![]}];}return db[_0xf667('0x5f')][_0xf667('0x43')](_0x5c6d8e);})[_0xf667('0x23')](function(_0xcd18c5){_0x327947[_0xf667('0x44')]=_0xcd18c5;return _0x327947;});}})[_0xf667('0x23')](respondWithFilteredResult(_0x461c01,_0x5c6d8e))[_0xf667('0x4e')](handleError(_0x461c01,null));};exports['getHopperBlacks']=function(_0x2071c8,_0x56a540,_0x5bb40b){var _0x118db7={'raw':!![],'where':{}};var _0x2a57b2={};var _0x100365={'count':0x0,'rows':[]};return db['Campaign'][_0xf667('0x58')]({'where':{'id':_0x2071c8[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x56a540,null))[_0xf667('0x23')](function(_0x5211dc){if(_0x5211dc){_0x2a57b2[_0xf667('0x31')]=_[_0xf667('0x59')](db[_0xf667('0x60')][_0xf667('0x2d')]);_0x2a57b2[_0xf667('0x32')]=_['keys'](_0x2071c8[_0xf667('0x32')]);_0x2a57b2['filters']=_[_0xf667('0x34')](_0x2a57b2[_0xf667('0x31')],_0x2a57b2[_0xf667('0x32')]);_0x118db7[_0xf667('0x35')]=_['intersection'](_0x2a57b2['model'],qs[_0xf667('0x36')](_0x2071c8[_0xf667('0x32')][_0xf667('0x36')]));_0x118db7[_0xf667('0x35')]=_0x118db7[_0xf667('0x35')][_0xf667('0x37')]?_0x118db7[_0xf667('0x35')]:_0x2a57b2[_0xf667('0x31')];if(!_0x2071c8[_0xf667('0x32')][_0xf667('0x38')](_0xf667('0x5a'))){_0x118db7['limit']=qs['limit'](_0x2071c8['query'][_0xf667('0x1d')]);_0x118db7[_0xf667('0x1a')]=qs[_0xf667('0x1a')](_0x2071c8[_0xf667('0x32')][_0xf667('0x1a')]);}_0x118db7[_0xf667('0x39')]=qs[_0xf667('0x3a')](_0x2071c8[_0xf667('0x32')][_0xf667('0x3a')]);_0x118db7[_0xf667('0x3b')]=qs['filters'](_[_0xf667('0x3c')](_0x2071c8['query'],_0x2a57b2[_0xf667('0x33')]));_0x118db7[_0xf667('0x3b')][_0xf667('0x5b')]=_0x5211dc['id'];if(_0x2071c8[_0xf667('0x32')][_0xf667('0x3d')]){_0x118db7['where']=_[_0xf667('0x3e')](_0x118db7['where'],{'$or':_[_0xf667('0x2c')](_0x118db7[_0xf667('0x35')],function(_0x586c58){var _0x542bf2={};_0x542bf2[_0x586c58]={'$like':'%'+_0x2071c8[_0xf667('0x32')]['filter']+'%'};return _0x542bf2;})});}_0x118db7=_[_0xf667('0x3e')]({},_0x118db7,_0x2071c8[_0xf667('0x40')]);return db[_0xf667('0x60')]['count']({'where':_0x118db7[_0xf667('0x3b')]})[_0xf667('0x23')](function(_0x18d7d3){_0x100365[_0xf667('0x1c')]=_0x18d7d3;if(_0x2071c8[_0xf667('0x32')]['includeAll']){_0x118db7['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x118db7);})[_0xf667('0x23')](function(_0x4c7c59){_0x100365[_0xf667('0x44')]=_0x4c7c59;return _0x100365;});}})[_0xf667('0x23')](respondWithFilteredResult(_0x56a540,_0x118db7))[_0xf667('0x4e')](handleError(_0x56a540,null));};exports[_0xf667('0x61')]=function(_0x68faf,_0x17b77d,_0x590071){var _0x101816={};var _0x3c9d22={};var _0x495d98;var _0x1ecc9e;return db['Campaign']['findOne']({'where':{'id':_0x68faf[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x17b77d,null))[_0xf667('0x23')](function(_0x31a4b1){if(_0x31a4b1){_0x495d98=_0x31a4b1;_0x3c9d22[_0xf667('0x31')]=_['keys'](db[_0xf667('0x62')][_0xf667('0x2d')]);_0x3c9d22['query']=_[_0xf667('0x59')](_0x68faf[_0xf667('0x32')]);_0x3c9d22[_0xf667('0x33')]=_[_0xf667('0x34')](_0x3c9d22['model'],_0x3c9d22[_0xf667('0x32')]);_0x101816[_0xf667('0x35')]=_[_0xf667('0x34')](_0x3c9d22['model'],qs[_0xf667('0x36')](_0x68faf[_0xf667('0x32')][_0xf667('0x36')]));_0x101816[_0xf667('0x35')]=_0x101816[_0xf667('0x35')]['length']?_0x101816[_0xf667('0x35')]:_0x3c9d22[_0xf667('0x31')];_0x101816['order']=qs[_0xf667('0x3a')](_0x68faf[_0xf667('0x32')]['sort']);_0x101816[_0xf667('0x3b')]=qs['filters'](_[_0xf667('0x3c')](_0x68faf['query'],_0x3c9d22['filters']));if(_0x68faf['query'][_0xf667('0x3d')]){_0x101816[_0xf667('0x3b')]=_['merge'](_0x101816[_0xf667('0x3b')],{'$or':_[_0xf667('0x2c')](_0x101816[_0xf667('0x35')],function(_0x28ec85){var _0x47e073={};_0x47e073[_0x28ec85]={'$like':'%'+_0x68faf[_0xf667('0x32')]['filter']+'%'};return _0x47e073;})});}_0x101816=_[_0xf667('0x3e')]({},_0x101816,_0x68faf['options']);return _0x495d98['getLists'](_0x101816);}})[_0xf667('0x23')](function(_0x199873){if(_0x199873){_0x1ecc9e=_0x199873[_0xf667('0x37')];if(!_0x68faf[_0xf667('0x32')]['hasOwnProperty']('nolimit')){_0x101816[_0xf667('0x1d')]=qs[_0xf667('0x1d')](_0x68faf[_0xf667('0x32')][_0xf667('0x1d')]);_0x101816[_0xf667('0x1a')]=qs[_0xf667('0x1a')](_0x68faf['query']['offset']);}return _0x495d98['getLists'](_0x101816);}})[_0xf667('0x23')](function(_0x4c1ea4){if(_0x4c1ea4){return _0x4c1ea4?{'count':_0x1ecc9e,'rows':_0x4c1ea4}:null;}})[_0xf667('0x23')](respondWithResult(_0x17b77d,null))['catch'](handleError(_0x17b77d,null));};exports['addLists']=function(_0x442b9c,_0xdce0c1,_0xb64b2f){var _0x3708f1,_0xba81b5;return db[_0xf667('0x46')]['find']({'where':{'id':_0x442b9c['params']['id']}})[_0xf667('0x23')](handleEntityNotFound(_0xdce0c1,null))[_0xf667('0x23')](function(_0x53077e){if(_0x53077e){_0xba81b5=_0x53077e;return _0x53077e[_0xf667('0x63')](_0x442b9c['body'][_0xf667('0x64')],_[_0xf667('0x52')](_0x442b9c['body'],['ids','id'])||{});}return null;})[_0xf667('0x65')](function(_0x11058d){var _0x456a1d;_0x3708f1=_0x11058d||[];var _0x2ad40b=[];if(_0x11058d){for(var _0x44753b=0x0;_0x44753b<_0x11058d['length'];_0x44753b+=0x1){var _0x524b9c=_0x11058d[_0x44753b]['get']({'plain':!![]});_0xba81b5[_0xf667('0x66')]=_0x442b9c[_0xf667('0x47')][_0xf667('0x66')]?_0x442b9c[_0xf667('0x47')][_0xf667('0x66')]:_0xba81b5[_0xf667('0x66')];switch(_0xba81b5['dialCheckDuplicateType']){case _0xf667('0x67'):_0x456a1d=squel['insert']()[_0xf667('0x68')]('cm_hopper')[_0xf667('0x69')]([_0xf667('0x6a'),'scheduledAt',_0xf667('0x6b'),'ListId','CampaignId','createdAt',_0xf667('0x54')],squel[_0xf667('0x6c')]()['field']('phone','phone')[_0xf667('0x6d')](_0xf667('0x6e'),_0xf667('0x6f'))[_0xf667('0x6d')]('id',_0xf667('0x6b'))[_0xf667('0x6d')](_0x524b9c[_0xf667('0x70')][_0xf667('0x71')](),_0xf667('0x72'))[_0xf667('0x6d')](_0x442b9c[_0xf667('0x56')]['id']['toString'](),_0xf667('0x5b'))[_0xf667('0x6d')]('NOW()',_0xf667('0x53'))[_0xf667('0x6d')](_0xf667('0x6e'),_0xf667('0x54'))[_0xf667('0x73')]('cm_contacts')[_0xf667('0x3b')](_0xf667('0x74'))[_0xf667('0x3b')](_0xf667('0x75'),_0x524b9c[_0xf667('0x70')][_0xf667('0x71')]())[_0xf667('0x3b')](_0xf667('0x76'))[_0xf667('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field']('COALESCE(calleridnum,\x27\x27)')[_0xf667('0x73')](_0xf667('0x77'))[_0xf667('0x3b')](_0xf667('0x78'),_0x442b9c['params']['id'][_0xf667('0x71')]()))[_0xf667('0x3b')](_0xf667('0x79'),squel[_0xf667('0x6c')]()[_0xf667('0x6d')]('COALESCE(phone,\x27\x27)')['from'](_0xf667('0x7a'))[_0xf667('0x3b')](_0xf667('0x78'),_0x442b9c[_0xf667('0x56')]['id'][_0xf667('0x71')]())))[_0xf667('0x71')]();break;case'onlyIfOpen':_0x456a1d=squel[_0xf667('0x7b')]()[_0xf667('0x68')](_0xf667('0x7a'))[_0xf667('0x69')]([_0xf667('0x6a'),_0xf667('0x6f'),_0xf667('0x6b'),_0xf667('0x72'),'CampaignId',_0xf667('0x53'),_0xf667('0x54')],squel[_0xf667('0x6c')]()[_0xf667('0x6d')](_0xf667('0x6a'),_0xf667('0x6a'))[_0xf667('0x6d')](_0xf667('0x6e'),_0xf667('0x6f'))['field']('id',_0xf667('0x6b'))[_0xf667('0x6d')](_0x524b9c[_0xf667('0x70')]['toString'](),_0xf667('0x72'))['field'](_0x442b9c[_0xf667('0x56')]['id'][_0xf667('0x71')](),'CampaignId')[_0xf667('0x6d')](_0xf667('0x6e'),_0xf667('0x53'))['field'](_0xf667('0x6e'),'updatedAt')[_0xf667('0x73')](_0xf667('0x7c'))[_0xf667('0x3b')](_0xf667('0x74'))['where']('ListId\x20=\x20?',_0x524b9c[_0xf667('0x70')][_0xf667('0x71')]())['where'](_0xf667('0x76'))[_0xf667('0x3b')](_0xf667('0x79'),squel[_0xf667('0x6c')]()[_0xf667('0x6d')](_0xf667('0x7d'))[_0xf667('0x73')](_0xf667('0x7a'))['where'](_0xf667('0x78'),_0x442b9c[_0xf667('0x56')]['id'][_0xf667('0x71')]())))['toString']();break;default:_0x456a1d=squel[_0xf667('0x7b')]()[_0xf667('0x68')](_0xf667('0x7a'))[_0xf667('0x69')](['phone',_0xf667('0x6f'),_0xf667('0x6b'),_0xf667('0x72'),_0xf667('0x5b'),_0xf667('0x53'),_0xf667('0x54')],squel[_0xf667('0x6c')]()[_0xf667('0x6d')](_0xf667('0x6a'),_0xf667('0x6a'))[_0xf667('0x6d')](_0xf667('0x6e'),_0xf667('0x6f'))[_0xf667('0x6d')]('id',_0xf667('0x6b'))[_0xf667('0x6d')](_0x524b9c[_0xf667('0x70')][_0xf667('0x71')](),'ListId')[_0xf667('0x6d')](_0x442b9c[_0xf667('0x56')]['id']['toString'](),_0xf667('0x5b'))[_0xf667('0x6d')](_0xf667('0x6e'),_0xf667('0x53'))[_0xf667('0x6d')](_0xf667('0x6e'),'updatedAt')[_0xf667('0x73')](_0xf667('0x7c'))[_0xf667('0x3b')](_0xf667('0x74'))['where'](_0xf667('0x75'),_0x524b9c[_0xf667('0x70')][_0xf667('0x71')]())[_0xf667('0x3b')](_0xf667('0x76')))[_0xf667('0x71')]();}_0x2ad40b[_0xf667('0x7e')](db[_0xf667('0x7f')][_0xf667('0x32')](_0x456a1d));}return BPromise[_0xf667('0x80')](_0x2ad40b);}})[_0xf667('0x23')](function(){return _0x3708f1;})[_0xf667('0x23')](respondWithResult(_0xdce0c1,null))[_0xf667('0x4e')](handleError(_0xdce0c1,null));};exports[_0xf667('0x81')]=function(_0x5e518c,_0x1a2112,_0x2365ab){return db[_0xf667('0x46')][_0xf667('0x51')]({'where':{'id':_0x5e518c[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x1a2112,null))[_0xf667('0x23')](function(_0xfc3906){if(_0xfc3906){return _0xfc3906[_0xf667('0x81')](_0x5e518c[_0xf667('0x32')][_0xf667('0x64')]);}})[_0xf667('0x23')](function(_0x95d991){if(_0x95d991){return db[_0xf667('0x5c')][_0xf667('0x24')]({'where':{'ListId':_0x5e518c['query'][_0xf667('0x64')],'CampaignId':_0x5e518c[_0xf667('0x56')]['id']}})['then'](function(){return _0x95d991;});}})[_0xf667('0x23')](respondWithStatusCode(_0x1a2112,null))['catch'](handleError(_0x1a2112,null));};exports[_0xf667('0x82')]=function(_0x436cbd,_0x24a455,_0x5589f4){var _0x118ae9={};var _0x89e182={};var _0x4648df;var _0x1f7ec9;return db[_0xf667('0x46')][_0xf667('0x58')]({'where':{'id':_0x436cbd[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x24a455,null))[_0xf667('0x23')](function(_0x2d4358){if(_0x2d4358){_0x4648df=_0x2d4358;_0x89e182[_0xf667('0x31')]=_[_0xf667('0x59')](db[_0xf667('0x62')][_0xf667('0x2d')]);_0x89e182[_0xf667('0x32')]=_[_0xf667('0x59')](_0x436cbd[_0xf667('0x32')]);_0x89e182['filters']=_[_0xf667('0x34')](_0x89e182[_0xf667('0x31')],_0x89e182[_0xf667('0x32')]);_0x118ae9[_0xf667('0x35')]=_['intersection'](_0x89e182[_0xf667('0x31')],qs['fields'](_0x436cbd[_0xf667('0x32')]['fields']));_0x118ae9[_0xf667('0x35')]=_0x118ae9['attributes'][_0xf667('0x37')]?_0x118ae9['attributes']:_0x89e182[_0xf667('0x31')];_0x118ae9[_0xf667('0x39')]=qs[_0xf667('0x3a')](_0x436cbd['query'][_0xf667('0x3a')]);_0x118ae9['where']=qs[_0xf667('0x33')](_[_0xf667('0x3c')](_0x436cbd[_0xf667('0x32')],_0x89e182[_0xf667('0x33')]));if(_0x436cbd[_0xf667('0x32')][_0xf667('0x3d')]){_0x118ae9[_0xf667('0x3b')]=_[_0xf667('0x3e')](_0x118ae9[_0xf667('0x3b')],{'$or':_[_0xf667('0x2c')](_0x118ae9['attributes'],function(_0x55dec4){var _0x1625fc={};_0x1625fc[_0x55dec4]={'$like':'%'+_0x436cbd[_0xf667('0x32')]['filter']+'%'};return _0x1625fc;})});}_0x118ae9=_[_0xf667('0x3e')]({},_0x118ae9,_0x436cbd[_0xf667('0x40')]);return _0x4648df[_0xf667('0x82')](_0x118ae9);}})[_0xf667('0x23')](function(_0x43c99b){if(_0x43c99b){_0x1f7ec9=_0x43c99b[_0xf667('0x37')];if(!_0x436cbd[_0xf667('0x32')][_0xf667('0x38')](_0xf667('0x5a'))){_0x118ae9[_0xf667('0x1d')]=qs[_0xf667('0x1d')](_0x436cbd[_0xf667('0x32')][_0xf667('0x1d')]);_0x118ae9['offset']=qs['offset'](_0x436cbd[_0xf667('0x32')]['offset']);}return _0x4648df['getBlackLists'](_0x118ae9);}})[_0xf667('0x23')](function(_0x434844){if(_0x434844){return _0x434844?{'count':_0x1f7ec9,'rows':_0x434844}:null;}})[_0xf667('0x23')](respondWithResult(_0x24a455,null))[_0xf667('0x4e')](handleError(_0x24a455,null));};exports[_0xf667('0x83')]=function(_0xd209de,_0x10ecec,_0x89a5fd){var _0x4cf10e,_0x31550e;return db[_0xf667('0x46')][_0xf667('0x51')]({'where':{'id':_0xd209de['params']['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x10ecec,null))[_0xf667('0x23')](function(_0x4b06f0){if(_0x4b06f0){_0x31550e=_0x4b06f0;return _0x4b06f0[_0xf667('0x83')](_0xd209de['body']['ids'],_[_0xf667('0x52')](_0xd209de[_0xf667('0x47')],[_0xf667('0x64'),'id'])||{});}return null;})['spread'](function(_0x15b5c0){var _0x44c602;_0x4cf10e=_0x15b5c0||[];var _0x5bb609=[];if(_0x15b5c0){for(var _0x3c8ec0=0x0;_0x3c8ec0<_0x15b5c0[_0xf667('0x37')];_0x3c8ec0+=0x1){var _0x3cdbb0=_0x15b5c0[_0x3c8ec0][_0xf667('0x25')]({'plain':!![]});_0x44c602=squel[_0xf667('0x7b')]()[_0xf667('0x68')](_0xf667('0x84'))[_0xf667('0x69')]([_0xf667('0x6a'),_0xf667('0x6b'),_0xf667('0x72'),_0xf667('0x5b'),_0xf667('0x53'),_0xf667('0x54')],squel['select']()['field'](_0xf667('0x6a'),'phone')[_0xf667('0x6d')]('id','ContactId')['field'](_0x3cdbb0[_0xf667('0x70')][_0xf667('0x71')](),_0xf667('0x72'))[_0xf667('0x6d')](_0xd209de[_0xf667('0x56')]['id'][_0xf667('0x71')](),_0xf667('0x5b'))[_0xf667('0x6d')](_0xf667('0x6e'),'createdAt')[_0xf667('0x6d')]('NOW()',_0xf667('0x54'))[_0xf667('0x73')](_0xf667('0x7c'))[_0xf667('0x3b')]('deletedAt\x20IS\x20NULL')[_0xf667('0x3b')](_0xf667('0x75'),_0x3cdbb0[_0xf667('0x70')][_0xf667('0x71')]())['where'](_0xf667('0x76')))['toString']();_0x5bb609[_0xf667('0x7e')](db[_0xf667('0x7f')][_0xf667('0x32')](_0x44c602));}return BPromise[_0xf667('0x80')](_0x5bb609);}})['then'](function(){return _0x4cf10e;})[_0xf667('0x23')](respondWithResult(_0x10ecec,null))['catch'](handleError(_0x10ecec,null));};exports[_0xf667('0x85')]=function(_0x36d850,_0x42b038,_0x12a6ec){return db[_0xf667('0x46')][_0xf667('0x51')]({'where':{'id':_0x36d850[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x42b038,null))[_0xf667('0x23')](function(_0x47a4de){if(_0x47a4de){return _0x47a4de[_0xf667('0x85')](_0x36d850[_0xf667('0x32')][_0xf667('0x64')]);}})[_0xf667('0x23')](function(_0x5c5434){if(_0x5c5434){return db[_0xf667('0x60')][_0xf667('0x24')]({'where':{'ListId':_0x36d850['query'][_0xf667('0x64')],'CampaignId':_0x36d850[_0xf667('0x56')]['id']}})[_0xf667('0x23')](function(){return _0x5c5434;});}})[_0xf667('0x23')](respondWithStatusCode(_0x42b038,null))['catch'](handleError(_0x42b038,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index f727c80..151f989 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(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_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(_0x1e0bd3,_0x8ba362){var _0x2d3f81=function(_0x2580cc){while(--_0x2580cc){_0x1e0bd3['push'](_0x1e0bd3['shift']());}};_0x2d3f81(++_0x8ba362);}(_0x7a54,0x106));var _0x47a5=function(_0x3bc90f,_0xbcaf71){_0x3bc90f=_0x3bc90f-0x0;var _0x17b522=_0x7a54[_0x3bc90f];return _0x17b522;};'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 38bcfa8..46f747b 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 _0x342b=['map','model','lodash','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCampaign','Campaign','findAll','raw','options','where','attributes','include'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x342b,0xbc));var _0xb342=function(_0x1f1d4e,_0x4125c4){_0x1f1d4e=_0x1f1d4e-0x0;var _0xc764a1=_0x342b[_0x1f1d4e];return _0xc764a1;};'use strict';var _=require(_0xb342('0x0'));var util=require('util');var moment=require(_0xb342('0x1'));var BPromise=require(_0xb342('0x2'));var rs=require(_0xb342('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb342('0x4'));var config=require(_0xb342('0x5'));var jayson=require(_0xb342('0x6'));var client=jayson[_0xb342('0x7')][_0xb342('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f6281,_0x30106f,_0x3c7ac7){return new BPromise(function(_0x54175e,_0x54c788){return client[_0xb342('0x9')](_0x2f6281,_0x3c7ac7)[_0xb342('0xa')](function(_0x4e8f65){logger[_0xb342('0xb')](_0xb342('0xc'),_0x30106f,_0xb342('0xd'));logger[_0xb342('0xe')](_0xb342('0xf'),_0x30106f,_0xb342('0xd'),JSON[_0xb342('0x10')](_0x4e8f65));if(_0x4e8f65[_0xb342('0x11')]){if(_0x4e8f65[_0xb342('0x11')][_0xb342('0x12')]===0x1f4){logger[_0xb342('0x11')]('Campaign,\x20%s,\x20%s',_0x30106f,_0x4e8f65[_0xb342('0x11')]['message']);return _0x54c788(_0x4e8f65['error']['message']);}logger[_0xb342('0x11')](_0xb342('0xc'),_0x30106f,_0x4e8f65[_0xb342('0x11')][_0xb342('0x13')]);return _0x54175e(_0x4e8f65[_0xb342('0x11')][_0xb342('0x13')]);}else{logger[_0xb342('0xb')](_0xb342('0xc'),_0x30106f,'request\x20sent');_0x54175e(_0x4e8f65[_0xb342('0x14')][_0xb342('0x13')]);}})['catch'](function(_0x5ee646){logger['error'](_0xb342('0xc'),_0x30106f,_0x5ee646);_0x54c788(_0x5ee646);});});}exports[_0xb342('0x15')]=function(_0x52b3b6){var _0x26583c=this;return new Promise(function(_0x2fa7cd,_0x1694c7){return db[_0xb342('0x16')][_0xb342('0x17')]({'raw':_0x52b3b6['options']?_0x52b3b6['options'][_0xb342('0x18')]===undefined?!![]:![]:!![],'where':_0x52b3b6['options']?_0x52b3b6[_0xb342('0x19')][_0xb342('0x1a')]||null:null,'attributes':_0x52b3b6[_0xb342('0x19')]?_0x52b3b6[_0xb342('0x19')][_0xb342('0x1b')]||null:null,'limit':_0x52b3b6['options']?_0x52b3b6[_0xb342('0x19')]['limit']||null:null,'include':_0x52b3b6[_0xb342('0x19')]?_0x52b3b6['options'][_0xb342('0x1c')]?_[_0xb342('0x1d')](_0x52b3b6[_0xb342('0x19')][_0xb342('0x1c')],function(_0x4eda3a){return{'model':db[_0x4eda3a[_0xb342('0x1e')]],'as':_0x4eda3a['as'],'attributes':_0x4eda3a['attributes'],'include':_0x4eda3a['include']?_[_0xb342('0x1d')](_0x4eda3a['include'],function(_0x31aa2b){return{'model':db[_0x31aa2b[_0xb342('0x1e')]],'as':_0x31aa2b['as'],'attributes':_0x31aa2b[_0xb342('0x1b')],'include':_0x31aa2b[_0xb342('0x1c')]?_['map'](_0x31aa2b[_0xb342('0x1c')],function(_0x31469f){return{'model':db[_0x31469f[_0xb342('0x1e')]],'as':_0x31469f['as'],'attributes':_0x31469f[_0xb342('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb342('0xa')](function(_0x27005b){logger[_0xb342('0xb')]('GetCampaign',_0x52b3b6);logger[_0xb342('0xe')](_0xb342('0x15'),_0x52b3b6,JSON[_0xb342('0x10')](_0x27005b));_0x2fa7cd(_0x27005b);})['catch'](function(_0x54cc70){logger['error'](_0xb342('0x15'),_0x54cc70['message'],_0x52b3b6);_0x1694c7(_0x26583c[_0xb342('0x11')](0x1f4,_0x54cc70['message']));});});};
\ No newline at end of file
+var _0xc041=['GetCampaign','options','raw','where','attributes','limit','include','model','map','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4f8a41,_0x2799f1){var _0x2b6e84=function(_0x53d4dc){while(--_0x53d4dc){_0x4f8a41['push'](_0x4f8a41['shift']());}};_0x2b6e84(++_0x2799f1);}(_0xc041,0x1ea));var _0x1c04=function(_0x40bfc2,_0x538e26){_0x40bfc2=_0x40bfc2-0x0;var _0x14d1db=_0xc041[_0x40bfc2];return _0x14d1db;};'use strict';var _=require(_0x1c04('0x0'));var util=require(_0x1c04('0x1'));var moment=require('moment');var BPromise=require(_0x1c04('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c04('0x3'));var db=require(_0x1c04('0x4'))['db'];var utils=require(_0x1c04('0x5'));var logger=require(_0x1c04('0x6'))(_0x1c04('0x7'));var config=require(_0x1c04('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1c04('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x524f85,_0x9507a,_0x3613fe){return new BPromise(function(_0x41a0d3,_0x1c2e7e){return client[_0x1c04('0xa')](_0x524f85,_0x3613fe)['then'](function(_0x536a46){logger[_0x1c04('0xb')](_0x1c04('0xc'),_0x9507a,_0x1c04('0xd'));logger[_0x1c04('0xe')](_0x1c04('0xf'),_0x9507a,_0x1c04('0xd'),JSON[_0x1c04('0x10')](_0x536a46));if(_0x536a46[_0x1c04('0x11')]){if(_0x536a46['error'][_0x1c04('0x12')]===0x1f4){logger['error'](_0x1c04('0xc'),_0x9507a,_0x536a46[_0x1c04('0x11')]['message']);return _0x1c2e7e(_0x536a46[_0x1c04('0x11')][_0x1c04('0x13')]);}logger[_0x1c04('0x11')](_0x1c04('0xc'),_0x9507a,_0x536a46[_0x1c04('0x11')][_0x1c04('0x13')]);return _0x41a0d3(_0x536a46[_0x1c04('0x11')]['message']);}else{logger[_0x1c04('0xb')](_0x1c04('0xc'),_0x9507a,_0x1c04('0xd'));_0x41a0d3(_0x536a46['result'][_0x1c04('0x13')]);}})['catch'](function(_0x26cbfa){logger[_0x1c04('0x11')](_0x1c04('0xc'),_0x9507a,_0x26cbfa);_0x1c2e7e(_0x26cbfa);});});}exports[_0x1c04('0x14')]=function(_0x2b3a8b){var _0x12e227=this;return new Promise(function(_0x3e2bd9,_0x46e892){return db['Campaign']['findAll']({'raw':_0x2b3a8b['options']?_0x2b3a8b[_0x1c04('0x15')][_0x1c04('0x16')]===undefined?!![]:![]:!![],'where':_0x2b3a8b[_0x1c04('0x15')]?_0x2b3a8b[_0x1c04('0x15')][_0x1c04('0x17')]||null:null,'attributes':_0x2b3a8b[_0x1c04('0x15')]?_0x2b3a8b[_0x1c04('0x15')][_0x1c04('0x18')]||null:null,'limit':_0x2b3a8b[_0x1c04('0x15')]?_0x2b3a8b[_0x1c04('0x15')][_0x1c04('0x19')]||null:null,'include':_0x2b3a8b[_0x1c04('0x15')]?_0x2b3a8b[_0x1c04('0x15')][_0x1c04('0x1a')]?_['map'](_0x2b3a8b[_0x1c04('0x15')]['include'],function(_0x247116){return{'model':db[_0x247116[_0x1c04('0x1b')]],'as':_0x247116['as'],'attributes':_0x247116[_0x1c04('0x18')],'include':_0x247116[_0x1c04('0x1a')]?_[_0x1c04('0x1c')](_0x247116['include'],function(_0x5101e2){return{'model':db[_0x5101e2[_0x1c04('0x1b')]],'as':_0x5101e2['as'],'attributes':_0x5101e2[_0x1c04('0x18')],'include':_0x5101e2[_0x1c04('0x1a')]?_[_0x1c04('0x1c')](_0x5101e2[_0x1c04('0x1a')],function(_0x1e2daa){return{'model':db[_0x1e2daa[_0x1c04('0x1b')]],'as':_0x1e2daa['as'],'attributes':_0x1e2daa[_0x1c04('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bdd27){logger[_0x1c04('0xb')]('GetCampaign',_0x2b3a8b);logger[_0x1c04('0xe')](_0x1c04('0x14'),_0x2b3a8b,JSON[_0x1c04('0x10')](_0x4bdd27));_0x3e2bd9(_0x4bdd27);})[_0x1c04('0x1d')](function(_0x3bf4fd){logger[_0x1c04('0x11')](_0x1c04('0x14'),_0x3bf4fd['message'],_0x2b3a8b);_0x46e892(_0x12e227['error'](0x1f4,_0x3bf4fd['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index af41200..dd5df08 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 _0xb701=['/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','put','update','delete','destroy','removeLists','removeBlackLists','exports','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories'];(function(_0x4d0ebd,_0x17ab0b){var _0x594e9c=function(_0x4d22ab){while(--_0x4d22ab){_0x4d0ebd['push'](_0x4d0ebd['shift']());}};_0x594e9c(++_0x17ab0b);}(_0xb701,0x144));var _0x1b70=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xb701[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require(_0x1b70('0x0'));var path=require('path');var timeout=require(_0x1b70('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1b70('0x2'));var auth=require(_0x1b70('0x3'));var interaction=require(_0x1b70('0x4'));var config=require(_0x1b70('0x5'));var controller=require(_0x1b70('0x6'));router[_0x1b70('0x7')]('/',auth[_0x1b70('0x8')](),controller[_0x1b70('0x9')]);router[_0x1b70('0x7')](_0x1b70('0xa'),auth['isAuthenticated'](),controller[_0x1b70('0xb')]);router[_0x1b70('0x7')](_0x1b70('0xc'),auth[_0x1b70('0x8')](),controller[_0x1b70('0xd')]);router[_0x1b70('0x7')](_0x1b70('0xe'),auth['isAuthenticated'](),controller[_0x1b70('0xf')]);router[_0x1b70('0x7')](_0x1b70('0x10'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x11')]);router[_0x1b70('0x7')](_0x1b70('0x12'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x13')]);router[_0x1b70('0x7')](_0x1b70('0x14'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x15')]);router['get'](_0x1b70('0x16'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x17')]);router[_0x1b70('0x18')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x1b70('0x19'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x1a')]);router[_0x1b70('0x18')](_0x1b70('0x14'),auth[_0x1b70('0x8')](),controller['addLists']);router[_0x1b70('0x18')](_0x1b70('0x16'),auth[_0x1b70('0x8')](),controller['addBlackLists']);router[_0x1b70('0x1b')](_0x1b70('0xa'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x1c')]);router[_0x1b70('0x1d')](_0x1b70('0xa'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x1e')]);router['delete'](_0x1b70('0x14'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x1f')]);router['delete'](_0x1b70('0x16'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x20')]);module[_0x1b70('0x21')]=router;
\ No newline at end of file
+var _0x849e=['getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','post','/:id/clone','addLists','/:id/blacklists','addBlackLists','put','destroy','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','/:id/hopper_histories'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x849e,0x187));var _0xe849=function(_0x52d0d3,_0x552ba6){_0x52d0d3=_0x52d0d3-0x0;var _0x1b4978=_0x849e[_0x52d0d3];return _0x1b4978;};'use strict';var multer=require(_0xe849('0x0'));var util=require(_0xe849('0x1'));var path=require(_0xe849('0x2'));var timeout=require(_0xe849('0x3'));var express=require(_0xe849('0x4'));var router=express[_0xe849('0x5')]();var fs_extra=require(_0xe849('0x6'));var auth=require(_0xe849('0x7'));var interaction=require(_0xe849('0x8'));var config=require(_0xe849('0x9'));var controller=require(_0xe849('0xa'));router[_0xe849('0xb')]('/',auth[_0xe849('0xc')](),controller['index']);router[_0xe849('0xb')](_0xe849('0xd'),auth[_0xe849('0xc')](),controller[_0xe849('0xe')]);router[_0xe849('0xb')](_0xe849('0xf'),auth['isAuthenticated'](),controller['getHoppers']);router[_0xe849('0xb')](_0xe849('0x10'),auth['isAuthenticated'](),controller[_0xe849('0x11')]);router[_0xe849('0xb')]('/:id/hopper_finals',auth[_0xe849('0xc')](),controller[_0xe849('0x12')]);router[_0xe849('0xb')](_0xe849('0x13'),auth[_0xe849('0xc')](),controller[_0xe849('0x14')]);router['get'](_0xe849('0x15'),auth[_0xe849('0xc')](),controller[_0xe849('0x16')]);router['get']('/:id/blacklists',auth['isAuthenticated'](),controller['getBlackLists']);router[_0xe849('0x17')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xe849('0x18'),auth[_0xe849('0xc')](),controller['clone']);router[_0xe849('0x17')](_0xe849('0x15'),auth[_0xe849('0xc')](),controller[_0xe849('0x19')]);router[_0xe849('0x17')](_0xe849('0x1a'),auth['isAuthenticated'](),controller[_0xe849('0x1b')]);router[_0xe849('0x1c')]('/:id',auth[_0xe849('0xc')](),controller['update']);router['delete'](_0xe849('0xd'),auth[_0xe849('0xc')](),controller[_0xe849('0x1d')]);router[_0xe849('0x1e')]('/:id/lists',auth['isAuthenticated'](),controller[_0xe849('0x1f')]);router['delete'](_0xe849('0x1a'),auth[_0xe849('0xc')](),controller[_0xe849('0x20')]);module[_0xe849('0x21')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 78ae88a..c3e90eb 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 _0x244b=['key','sequelize','exports','STRING','getDataValue'];(function(_0x5a15ac,_0x2b2595){var _0x5d0c48=function(_0x575d14){while(--_0x575d14){_0x5a15ac['push'](_0x5a15ac['shift']());}};_0x5d0c48(++_0x2b2595);}(_0x244b,0x1eb));var _0xb244=function(_0x2a59e0,_0xc12ff){_0x2a59e0=_0x2a59e0-0x0;var _0x48813a=_0x244b[_0x2a59e0];return _0x48813a;};'use strict';var Sequelize=require(_0xb244('0x0'));module[_0xb244('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xb244('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xb244('0x3')](_0xb244('0x4'));}}};
\ No newline at end of file
+var _0xfd1e=['VIRTUAL','getDataValue','key','exports','TEXT','STRING'];(function(_0x53f4e3,_0x62f760){var _0x25c1ef=function(_0x4e4e95){while(--_0x4e4e95){_0x53f4e3['push'](_0x53f4e3['shift']());}};_0x25c1ef(++_0x62f760);}(_0xfd1e,0xff));var _0xefd1=function(_0x246d80,_0x3ebb30){_0x246d80=_0x246d80-0x0;var _0x214f35=_0xfd1e[_0x246d80];return _0x214f35;};'use strict';var Sequelize=require('sequelize');module[_0xefd1('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xefd1('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xefd1('0x2')]},'name':{'type':Sequelize[_0xefd1('0x3')],'get':function(){return this[_0xefd1('0x4')](_0xefd1('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index d35e05c..4c94d11 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 _0xe39f=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','CannedAnswers','error','stack','name','send','map','CannedAnswer','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','length','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','get','UserProfileSection','autoAssociation','UserProfileResource','eml-format','zip-dir','fast-json-patch'];(function(_0x7ed412,_0x223b70){var _0x1ed154=function(_0x3d5315){while(--_0x3d5315){_0x7ed412['push'](_0x7ed412['shift']());}};_0x1ed154(++_0x223b70);}(_0xe39f,0x16d));var _0xfe39=function(_0x5e8912,_0x5b6370){_0x5e8912=_0x5e8912-0x0;var _0xb5060b=_0xe39f[_0x5e8912];return _0xb5060b;};'use strict';var emlformat=require(_0xfe39('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe39('0x1'));var jsonpatch=require(_0xfe39('0x2'));var rp=require(_0xfe39('0x3'));var moment=require(_0xfe39('0x4'));var BPromise=require(_0xfe39('0x5'));var Mustache=require(_0xfe39('0x6'));var util=require(_0xfe39('0x7'));var path=require(_0xfe39('0x8'));var sox=require(_0xfe39('0x9'));var csv=require(_0xfe39('0xa'));var ejs=require(_0xfe39('0xb'));var fs=require('fs');var fs_extra=require(_0xfe39('0xc'));var _=require(_0xfe39('0xd'));var squel=require(_0xfe39('0xe'));var crypto=require(_0xfe39('0xf'));var jsforce=require(_0xfe39('0x10'));var deskjs=require(_0xfe39('0x11'));var toCsv=require(_0xfe39('0xa'));var querystring=require(_0xfe39('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfe39('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe39('0x14'));var logger=require(_0xfe39('0x15'))(_0xfe39('0x16'));var utils=require(_0xfe39('0x17'));var config=require(_0xfe39('0x18'));var licenseUtil=require(_0xfe39('0x19'));var db=require(_0xfe39('0x1a'))['db'];function respondWithStatusCode(_0x33067d,_0x68006f){_0x68006f=_0x68006f||0xcc;return function(_0x4399fe){if(_0x4399fe){return _0x33067d[_0xfe39('0x1b')](_0x68006f);}return _0x33067d[_0xfe39('0x1c')](_0x68006f)[_0xfe39('0x1d')]();};}function respondWithResult(_0x48d5d2,_0x4a810a){_0x4a810a=_0x4a810a||0xc8;return function(_0x3c86ef){if(_0x3c86ef){return _0x48d5d2['status'](_0x4a810a)[_0xfe39('0x1e')](_0x3c86ef);}};}function respondWithFilteredResult(_0xacfab6,_0x8918b1){return function(_0x4d457a){if(_0x4d457a){var _0x573ff6=typeof _0x8918b1[_0xfe39('0x1f')]===_0xfe39('0x20')&&typeof _0x8918b1[_0xfe39('0x21')]===_0xfe39('0x20');var _0x43660b=_0x4d457a[_0xfe39('0x22')];var _0x5618cd=_0x573ff6?0x0:_0x8918b1[_0xfe39('0x1f')];var _0x159ce9=_0x573ff6?_0x4d457a[_0xfe39('0x22')]:_0x8918b1['offset']+_0x8918b1[_0xfe39('0x21')];var _0x331753;if(_0x159ce9>=_0x43660b){_0x159ce9=_0x43660b;_0x331753=0xc8;}else{_0x331753=0xce;}_0xacfab6[_0xfe39('0x1c')](_0x331753);return _0xacfab6[_0xfe39('0x23')]('Content-Range',_0x5618cd+'-'+_0x159ce9+'/'+_0x43660b)[_0xfe39('0x1e')](_0x4d457a);}return null;};}function patchUpdates(_0x335adb){return function(_0x3aa3a1){try{jsonpatch[_0xfe39('0x24')](_0x3aa3a1,_0x335adb,!![]);}catch(_0x1e0286){return BPromise[_0xfe39('0x25')](_0x1e0286);}return _0x3aa3a1[_0xfe39('0x26')]();};}function saveUpdates(_0x1c3d71,_0x556a29){return function(_0x3032e){if(_0x3032e){return _0x3032e[_0xfe39('0x27')](_0x1c3d71)[_0xfe39('0x28')](function(_0x315816){return _0x315816;});}return null;};}function removeEntity(_0x29aa95,_0x479fa3){return function(_0x1adeee){if(_0x1adeee){return _0x1adeee[_0xfe39('0x29')]()[_0xfe39('0x28')](function(){var _0x2cc152=_0x1adeee['get']({'plain':!![]});var _0x2d35e1=_0xfe39('0x2a');return db['UserProfileResource'][_0xfe39('0x29')]({'where':{'type':_0x2d35e1,'resourceId':_0x2cc152['id']}})[_0xfe39('0x28')](function(){return _0x1adeee;});})[_0xfe39('0x28')](function(){_0x29aa95[_0xfe39('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x205ab2,_0x1ee8ec){return function(_0x4cd4be){if(!_0x4cd4be){_0x205ab2['sendStatus'](0x194);}return _0x4cd4be;};}function handleError(_0x108125,_0x17ea7a){_0x17ea7a=_0x17ea7a||0x1f4;return function(_0x3d142b){logger[_0xfe39('0x2b')](_0x3d142b[_0xfe39('0x2c')]);if(_0x3d142b['name']){delete _0x3d142b[_0xfe39('0x2d')];}_0x108125[_0xfe39('0x1c')](_0x17ea7a)[_0xfe39('0x2e')](_0x3d142b);};}exports['index']=function(_0x305c22,_0x477219){var _0x502e43={},_0x161d91={},_0x1be3bd={'count':0x0,'rows':[]};var _0x24c58c=_[_0xfe39('0x2f')](db[_0xfe39('0x30')][_0xfe39('0x31')],function(_0x5cb2e8){return{'name':_0x5cb2e8[_0xfe39('0x32')],'type':_0x5cb2e8[_0xfe39('0x33')][_0xfe39('0x34')]};});_0x161d91['model']=_[_0xfe39('0x2f')](_0x24c58c,_0xfe39('0x2d'));_0x161d91['query']=_[_0xfe39('0x35')](_0x305c22[_0xfe39('0x36')]);_0x161d91[_0xfe39('0x37')]=_[_0xfe39('0x38')](_0x161d91[_0xfe39('0x39')],_0x161d91[_0xfe39('0x36')]);_0x502e43[_0xfe39('0x3a')]=_['intersection'](_0x161d91[_0xfe39('0x39')],qs['fields'](_0x305c22[_0xfe39('0x36')][_0xfe39('0x3b')]));_0x502e43['attributes']=_0x502e43[_0xfe39('0x3a')]['length']?_0x502e43[_0xfe39('0x3a')]:_0x161d91[_0xfe39('0x39')];if(!_0x305c22[_0xfe39('0x36')][_0xfe39('0x3c')](_0xfe39('0x3d'))){_0x502e43[_0xfe39('0x21')]=qs['limit'](_0x305c22['query'][_0xfe39('0x21')]);_0x502e43[_0xfe39('0x1f')]=qs[_0xfe39('0x1f')](_0x305c22['query'][_0xfe39('0x1f')]);}_0x502e43[_0xfe39('0x3e')]=qs[_0xfe39('0x3f')](_0x305c22['query']['sort']);_0x502e43[_0xfe39('0x40')]=qs[_0xfe39('0x37')](_[_0xfe39('0x41')](_0x305c22[_0xfe39('0x36')],_0x161d91['filters']),_0x24c58c);if(_0x305c22['query'][_0xfe39('0x42')]){_0x502e43[_0xfe39('0x40')]=_['merge'](_0x502e43['where'],{'$or':[{'key':{'$like':'%'+_0x305c22['query']['filter']+'%'}},{'value':{'$like':'%'+_0x305c22[_0xfe39('0x36')][_0xfe39('0x42')]+'%'}}]});}_0x502e43=_[_0xfe39('0x43')]({},_0x502e43,_0x305c22[_0xfe39('0x44')]);var _0x44f763={'where':_0x502e43[_0xfe39('0x40')]};return db[_0xfe39('0x30')][_0xfe39('0x22')](_0x44f763)[_0xfe39('0x28')](function(_0x3b2ad6){_0x1be3bd['count']=_0x3b2ad6;if(_0x305c22[_0xfe39('0x36')][_0xfe39('0x45')]){_0x502e43[_0xfe39('0x46')]=[{'all':!![]}];}return db[_0xfe39('0x30')][_0xfe39('0x47')](_0x502e43);})[_0xfe39('0x28')](function(_0x1b8383){_0x1be3bd['rows']=_0x1b8383;return _0x1be3bd;})[_0xfe39('0x28')](respondWithFilteredResult(_0x477219,_0x502e43))[_0xfe39('0x48')](handleError(_0x477219,null));};exports[_0xfe39('0x49')]=function(_0x535f34,_0x2b9589){var _0x17c11f={'raw':!![],'where':{'id':_0x535f34[_0xfe39('0x4a')]['id']}},_0x1d3e73={};_0x1d3e73[_0xfe39('0x39')]=_['keys'](db[_0xfe39('0x30')][_0xfe39('0x31')]);_0x1d3e73[_0xfe39('0x36')]=_[_0xfe39('0x35')](_0x535f34['query']);_0x1d3e73[_0xfe39('0x37')]=_[_0xfe39('0x38')](_0x1d3e73['model'],_0x1d3e73[_0xfe39('0x36')]);_0x17c11f['attributes']=_[_0xfe39('0x38')](_0x1d3e73[_0xfe39('0x39')],qs['fields'](_0x535f34[_0xfe39('0x36')][_0xfe39('0x3b')]));_0x17c11f['attributes']=_0x17c11f[_0xfe39('0x3a')][_0xfe39('0x4b')]?_0x17c11f[_0xfe39('0x3a')]:_0x1d3e73[_0xfe39('0x39')];if(_0x535f34['query'][_0xfe39('0x45')]){_0x17c11f['include']=[{'all':!![]}];}_0x17c11f=_[_0xfe39('0x43')]({},_0x17c11f,_0x535f34[_0xfe39('0x44')]);return db[_0xfe39('0x30')]['find'](_0x17c11f)['then'](handleEntityNotFound(_0x2b9589,null))['then'](respondWithResult(_0x2b9589,null))[_0xfe39('0x48')](handleError(_0x2b9589,null));};exports[_0xfe39('0x27')]=function(_0x3cab26,_0x43ba4e){if(_0x3cab26[_0xfe39('0x4c')]['id']){delete _0x3cab26[_0xfe39('0x4c')]['id'];}return db[_0xfe39('0x30')][_0xfe39('0x4d')]({'where':{'id':_0x3cab26[_0xfe39('0x4a')]['id']}})[_0xfe39('0x28')](handleEntityNotFound(_0x43ba4e,null))[_0xfe39('0x28')](saveUpdates(_0x3cab26[_0xfe39('0x4c')],null))[_0xfe39('0x28')](respondWithResult(_0x43ba4e,null))[_0xfe39('0x48')](handleError(_0x43ba4e,null));};exports[_0xfe39('0x29')]=function(_0xfe7e2f,_0x5596fa){return db['CannedAnswer'][_0xfe39('0x4d')]({'where':{'id':_0xfe7e2f[_0xfe39('0x4a')]['id']}})[_0xfe39('0x28')](handleEntityNotFound(_0x5596fa,null))[_0xfe39('0x28')](removeEntity(_0x5596fa,null))[_0xfe39('0x48')](handleError(_0x5596fa,null));};exports[_0xfe39('0x4e')]=function(_0xe8455c,_0xb3b8a4){var _0x3bf491={'key':_0xe8455c[_0xfe39('0x4c')][_0xfe39('0x34')]};if(_0xe8455c[_0xfe39('0x4c')][_0xfe39('0x4f')]){_0x3bf491['MailAccountId']=_0xe8455c[_0xfe39('0x4c')][_0xfe39('0x4f')];}else if(_0xe8455c['body'][_0xfe39('0x50')]){_0x3bf491[_0xfe39('0x50')]=_0xe8455c[_0xfe39('0x4c')][_0xfe39('0x50')];}else if(_0xe8455c[_0xfe39('0x4c')]['OpenchannelAccountId']){_0x3bf491[_0xfe39('0x51')]=_0xe8455c[_0xfe39('0x4c')]['OpenchannelAccountId'];}else if(_0xe8455c[_0xfe39('0x4c')][_0xfe39('0x52')]){_0x3bf491[_0xfe39('0x52')]=_0xe8455c[_0xfe39('0x4c')][_0xfe39('0x52')];}return db[_0xfe39('0x30')][_0xfe39('0x4d')]({'where':_0x3bf491})[_0xfe39('0x28')](function(_0x1e6992){if(_0x1e6992){throw new db[(_0xfe39('0x53'))][(_0xfe39('0x54'))](_0xfe39('0x55'));}return db[_0xfe39('0x30')][_0xfe39('0x4e')](_0xe8455c['body']);})[_0xfe39('0x28')](function(_0x1cef76){var _0x1dbd3f=_0xe8455c[_0xfe39('0x56')]['get']({'plain':!![]});if(!_0x1dbd3f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1dbd3f[_0xfe39('0x57')]==='user'){var _0x54a394=_0x1cef76[_0xfe39('0x58')]({'plain':!![]});return db[_0xfe39('0x59')][_0xfe39('0x4d')]({'where':{'name':_0xfe39('0x2a'),'userProfileId':_0x1dbd3f['userProfileId']},'raw':!![]})['then'](function(_0x59ef55){if(_0x59ef55&&_0x59ef55[_0xfe39('0x5a')]===0x0){return db[_0xfe39('0x5b')][_0xfe39('0x4e')]({'name':_0x54a394[_0xfe39('0x2d')],'resourceId':_0x54a394['id'],'type':_0x59ef55[_0xfe39('0x2d')],'sectionId':_0x59ef55['id']},{})['then'](function(){return _0x1cef76;});}else{return _0x1cef76;}})[_0xfe39('0x48')](function(_0x16a4de){logger[_0xfe39('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16a4de);throw _0x16a4de;});}return _0x1cef76;})['then'](respondWithResult(_0xb3b8a4,0xc9))['catch'](handleError(_0xb3b8a4,null));};
\ No newline at end of file
+var _0x1299=['body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','reject','update','then','get','CannedAnswers','destroy','error','stack','name','index','CannedAnswer','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','find'];(function(_0x430185,_0xb3bd00){var _0x412b86=function(_0x5ac609){while(--_0x5ac609){_0x430185['push'](_0x430185['shift']());}};_0x412b86(++_0xb3bd00);}(_0x1299,0x1c9));var _0x9129=function(_0x9fa60,_0x4df300){_0x9fa60=_0x9fa60-0x0;var _0x391006=_0x1299[_0x9fa60];return _0x391006;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9129('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9129('0x1'));var moment=require(_0x9129('0x2'));var BPromise=require(_0x9129('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9129('0x4'));var sox=require('sox');var csv=require(_0x9129('0x5'));var ejs=require(_0x9129('0x6'));var fs=require('fs');var fs_extra=require(_0x9129('0x7'));var _=require(_0x9129('0x8'));var squel=require(_0x9129('0x9'));var crypto=require(_0x9129('0xa'));var jsforce=require(_0x9129('0xb'));var deskjs=require(_0x9129('0xc'));var toCsv=require(_0x9129('0x5'));var querystring=require('querystring');var Papa=require(_0x9129('0xd'));var Redis=require(_0x9129('0xe'));var authService=require(_0x9129('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9129('0x10'));var hardwareService=require(_0x9129('0x11'));var logger=require(_0x9129('0x12'))(_0x9129('0x13'));var utils=require(_0x9129('0x14'));var config=require(_0x9129('0x15'));var licenseUtil=require(_0x9129('0x16'));var db=require(_0x9129('0x17'))['db'];function respondWithStatusCode(_0x354efc,_0x410378){_0x410378=_0x410378||0xcc;return function(_0x1aa3db){if(_0x1aa3db){return _0x354efc[_0x9129('0x18')](_0x410378);}return _0x354efc['status'](_0x410378)[_0x9129('0x19')]();};}function respondWithResult(_0x2a590f,_0x4eea6d){_0x4eea6d=_0x4eea6d||0xc8;return function(_0x267ecf){if(_0x267ecf){return _0x2a590f[_0x9129('0x1a')](_0x4eea6d)[_0x9129('0x1b')](_0x267ecf);}};}function respondWithFilteredResult(_0x1cf47b,_0x60edc2){return function(_0x18ae7d){if(_0x18ae7d){var _0x1addb6=typeof _0x60edc2[_0x9129('0x1c')]===_0x9129('0x1d')&&typeof _0x60edc2[_0x9129('0x1e')]===_0x9129('0x1d');var _0x5bbf46=_0x18ae7d['count'];var _0x50e089=_0x1addb6?0x0:_0x60edc2[_0x9129('0x1c')];var _0x4278ba=_0x1addb6?_0x18ae7d['count']:_0x60edc2[_0x9129('0x1c')]+_0x60edc2[_0x9129('0x1e')];var _0x53c112;if(_0x4278ba>=_0x5bbf46){_0x4278ba=_0x5bbf46;_0x53c112=0xc8;}else{_0x53c112=0xce;}_0x1cf47b[_0x9129('0x1a')](_0x53c112);return _0x1cf47b[_0x9129('0x1f')]('Content-Range',_0x50e089+'-'+_0x4278ba+'/'+_0x5bbf46)[_0x9129('0x1b')](_0x18ae7d);}return null;};}function patchUpdates(_0x1a238c){return function(_0x5bbb08){try{jsonpatch['apply'](_0x5bbb08,_0x1a238c,!![]);}catch(_0x4fcb60){return BPromise[_0x9129('0x20')](_0x4fcb60);}return _0x5bbb08['save']();};}function saveUpdates(_0x54d8f1,_0x249778){return function(_0x2c8ea8){if(_0x2c8ea8){return _0x2c8ea8[_0x9129('0x21')](_0x54d8f1)['then'](function(_0x3d91ee){return _0x3d91ee;});}return null;};}function removeEntity(_0x4a255c,_0x40f4a4){return function(_0x5b56c1){if(_0x5b56c1){return _0x5b56c1['destroy']()[_0x9129('0x22')](function(){var _0x12cb38=_0x5b56c1[_0x9129('0x23')]({'plain':!![]});var _0xe5099e=_0x9129('0x24');return db['UserProfileResource'][_0x9129('0x25')]({'where':{'type':_0xe5099e,'resourceId':_0x12cb38['id']}})[_0x9129('0x22')](function(){return _0x5b56c1;});})['then'](function(){_0x4a255c[_0x9129('0x1a')](0xcc)[_0x9129('0x19')]();});}};}function handleEntityNotFound(_0x3b522a,_0x55b126){return function(_0x50665b){if(!_0x50665b){_0x3b522a['sendStatus'](0x194);}return _0x50665b;};}function handleError(_0x53ff8e,_0x1d6511){_0x1d6511=_0x1d6511||0x1f4;return function(_0x88acf4){logger[_0x9129('0x26')](_0x88acf4[_0x9129('0x27')]);if(_0x88acf4[_0x9129('0x28')]){delete _0x88acf4['name'];}_0x53ff8e['status'](_0x1d6511)['send'](_0x88acf4);};}exports[_0x9129('0x29')]=function(_0x38dd11,_0x3e6a86){var _0x452753={},_0x5ee1fe={},_0x3dcfe1={'count':0x0,'rows':[]};var _0x59ae17=_['map'](db[_0x9129('0x2a')][_0x9129('0x2b')],function(_0xf3b59f){return{'name':_0xf3b59f[_0x9129('0x2c')],'type':_0xf3b59f['type'][_0x9129('0x2d')]};});_0x5ee1fe[_0x9129('0x2e')]=_[_0x9129('0x2f')](_0x59ae17,'name');_0x5ee1fe[_0x9129('0x30')]=_[_0x9129('0x31')](_0x38dd11[_0x9129('0x30')]);_0x5ee1fe[_0x9129('0x32')]=_[_0x9129('0x33')](_0x5ee1fe[_0x9129('0x2e')],_0x5ee1fe['query']);_0x452753[_0x9129('0x34')]=_[_0x9129('0x33')](_0x5ee1fe[_0x9129('0x2e')],qs[_0x9129('0x35')](_0x38dd11['query'][_0x9129('0x35')]));_0x452753[_0x9129('0x34')]=_0x452753[_0x9129('0x34')][_0x9129('0x36')]?_0x452753[_0x9129('0x34')]:_0x5ee1fe[_0x9129('0x2e')];if(!_0x38dd11['query'][_0x9129('0x37')](_0x9129('0x38'))){_0x452753[_0x9129('0x1e')]=qs[_0x9129('0x1e')](_0x38dd11[_0x9129('0x30')][_0x9129('0x1e')]);_0x452753['offset']=qs[_0x9129('0x1c')](_0x38dd11[_0x9129('0x30')][_0x9129('0x1c')]);}_0x452753[_0x9129('0x39')]=qs[_0x9129('0x3a')](_0x38dd11['query'][_0x9129('0x3a')]);_0x452753[_0x9129('0x3b')]=qs['filters'](_[_0x9129('0x3c')](_0x38dd11[_0x9129('0x30')],_0x5ee1fe['filters']),_0x59ae17);if(_0x38dd11[_0x9129('0x30')][_0x9129('0x3d')]){_0x452753[_0x9129('0x3b')]=_[_0x9129('0x3e')](_0x452753[_0x9129('0x3b')],{'$or':[{'key':{'$like':'%'+_0x38dd11['query']['filter']+'%'}},{'value':{'$like':'%'+_0x38dd11[_0x9129('0x30')]['filter']+'%'}}]});}_0x452753=_[_0x9129('0x3e')]({},_0x452753,_0x38dd11[_0x9129('0x3f')]);var _0x565f9c={'where':_0x452753[_0x9129('0x3b')]};return db[_0x9129('0x2a')]['count'](_0x565f9c)[_0x9129('0x22')](function(_0x5adfb7){_0x3dcfe1['count']=_0x5adfb7;if(_0x38dd11[_0x9129('0x30')][_0x9129('0x40')]){_0x452753[_0x9129('0x41')]=[{'all':!![]}];}return db['CannedAnswer'][_0x9129('0x42')](_0x452753);})[_0x9129('0x22')](function(_0x2b81c5){_0x3dcfe1[_0x9129('0x43')]=_0x2b81c5;return _0x3dcfe1;})[_0x9129('0x22')](respondWithFilteredResult(_0x3e6a86,_0x452753))[_0x9129('0x44')](handleError(_0x3e6a86,null));};exports[_0x9129('0x45')]=function(_0x554988,_0x4851be){var _0x1accb8={'raw':!![],'where':{'id':_0x554988['params']['id']}},_0x2dd2a1={};_0x2dd2a1['model']=_[_0x9129('0x31')](db[_0x9129('0x2a')][_0x9129('0x2b')]);_0x2dd2a1[_0x9129('0x30')]=_[_0x9129('0x31')](_0x554988[_0x9129('0x30')]);_0x2dd2a1[_0x9129('0x32')]=_['intersection'](_0x2dd2a1[_0x9129('0x2e')],_0x2dd2a1['query']);_0x1accb8[_0x9129('0x34')]=_[_0x9129('0x33')](_0x2dd2a1[_0x9129('0x2e')],qs[_0x9129('0x35')](_0x554988[_0x9129('0x30')][_0x9129('0x35')]));_0x1accb8[_0x9129('0x34')]=_0x1accb8[_0x9129('0x34')][_0x9129('0x36')]?_0x1accb8[_0x9129('0x34')]:_0x2dd2a1[_0x9129('0x2e')];if(_0x554988[_0x9129('0x30')][_0x9129('0x40')]){_0x1accb8[_0x9129('0x41')]=[{'all':!![]}];}_0x1accb8=_[_0x9129('0x3e')]({},_0x1accb8,_0x554988[_0x9129('0x3f')]);return db[_0x9129('0x2a')][_0x9129('0x46')](_0x1accb8)[_0x9129('0x22')](handleEntityNotFound(_0x4851be,null))['then'](respondWithResult(_0x4851be,null))[_0x9129('0x44')](handleError(_0x4851be,null));};exports[_0x9129('0x21')]=function(_0x640fd0,_0x16287c){if(_0x640fd0[_0x9129('0x47')]['id']){delete _0x640fd0[_0x9129('0x47')]['id'];}return db[_0x9129('0x2a')]['find']({'where':{'id':_0x640fd0[_0x9129('0x48')]['id']}})[_0x9129('0x22')](handleEntityNotFound(_0x16287c,null))[_0x9129('0x22')](saveUpdates(_0x640fd0[_0x9129('0x47')],null))[_0x9129('0x22')](respondWithResult(_0x16287c,null))[_0x9129('0x44')](handleError(_0x16287c,null));};exports['destroy']=function(_0x1a6e42,_0x39265b){return db[_0x9129('0x2a')]['find']({'where':{'id':_0x1a6e42[_0x9129('0x48')]['id']}})[_0x9129('0x22')](handleEntityNotFound(_0x39265b,null))[_0x9129('0x22')](removeEntity(_0x39265b,null))[_0x9129('0x44')](handleError(_0x39265b,null));};exports[_0x9129('0x49')]=function(_0x1d1c62,_0x580700){var _0x223afa={'key':_0x1d1c62[_0x9129('0x47')]['key']};if(_0x1d1c62[_0x9129('0x47')][_0x9129('0x4a')]){_0x223afa[_0x9129('0x4a')]=_0x1d1c62[_0x9129('0x47')]['MailAccountId'];}else if(_0x1d1c62[_0x9129('0x47')][_0x9129('0x4b')]){_0x223afa[_0x9129('0x4b')]=_0x1d1c62[_0x9129('0x47')]['SmsAccountId'];}else if(_0x1d1c62['body'][_0x9129('0x4c')]){_0x223afa[_0x9129('0x4c')]=_0x1d1c62['body']['OpenchannelAccountId'];}else if(_0x1d1c62['body'][_0x9129('0x4d')]){_0x223afa[_0x9129('0x4d')]=_0x1d1c62[_0x9129('0x47')][_0x9129('0x4d')];}return db[_0x9129('0x2a')][_0x9129('0x46')]({'where':_0x223afa})['then'](function(_0x35de2c){if(_0x35de2c){throw new db[(_0x9129('0x4e'))][(_0x9129('0x4f'))]('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0x9129('0x49')](_0x1d1c62[_0x9129('0x47')]);})[_0x9129('0x22')](function(_0x262762){var _0x44d121=_0x1d1c62[_0x9129('0x50')][_0x9129('0x23')]({'plain':!![]});if(!_0x44d121)throw new Error(_0x9129('0x51'));if(_0x44d121[_0x9129('0x52')]===_0x9129('0x50')){var _0x325614=_0x262762[_0x9129('0x23')]({'plain':!![]});return db[_0x9129('0x53')][_0x9129('0x46')]({'where':{'name':_0x9129('0x24'),'userProfileId':_0x44d121[_0x9129('0x54')]},'raw':!![]})[_0x9129('0x22')](function(_0x23420b){if(_0x23420b&&_0x23420b[_0x9129('0x55')]===0x0){return db[_0x9129('0x56')][_0x9129('0x49')]({'name':_0x325614[_0x9129('0x28')],'resourceId':_0x325614['id'],'type':_0x23420b[_0x9129('0x28')],'sectionId':_0x23420b['id']},{})['then'](function(){return _0x262762;});}else{return _0x262762;}})['catch'](function(_0x338114){logger[_0x9129('0x26')](_0x9129('0x57'),_0x338114);throw _0x338114;});}return _0x262762;})[_0x9129('0x22')](respondWithResult(_0x580700,0xc9))[_0x9129('0x44')](handleError(_0x580700,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 495c00b..9720dc8 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 _0xed0c=['CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','define'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xed0c,0x1d7));var _0xced0=function(_0x154f3d,_0x28e8fe){_0x154f3d=_0x154f3d-0x0;var _0xe6f1c2=_0xed0c[_0x154f3d];return _0xe6f1c2;};'use strict';var _=require(_0xced0('0x0'));var util=require(_0xced0('0x1'));var logger=require('../../config/logger')(_0xced0('0x2'));var moment=require('moment');var BPromise=require(_0xced0('0x3'));var rp=require(_0xced0('0x4'));var fs=require('fs');var path=require(_0xced0('0x5'));var rimraf=require(_0xced0('0x6'));var config=require(_0xced0('0x7'));var attributes=require(_0xced0('0x8'));module['exports']=function(_0x1bc3ce,_0x48ca15){return _0x1bc3ce[_0xced0('0x9')](_0xced0('0xa'),attributes,{'tableName':_0xced0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xced0('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x6e7a=['lodash','util','api','moment','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci'];(function(_0x401fdf,_0x1a3185){var _0x2198a6=function(_0x3fe20b){while(--_0x3fe20b){_0x401fdf['push'](_0x401fdf['shift']());}};_0x2198a6(++_0x1a3185);}(_0x6e7a,0x145));var _0xa6e7=function(_0x19c6a6,_0x36701d){_0x19c6a6=_0x19c6a6-0x0;var _0x29014=_0x6e7a[_0x19c6a6];return _0x29014;};'use strict';var _=require(_0xa6e7('0x0'));var util=require(_0xa6e7('0x1'));var logger=require('../../config/logger')(_0xa6e7('0x2'));var moment=require(_0xa6e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6e7('0x4'));var rimraf=require(_0xa6e7('0x5'));var config=require('../../config/environment');var attributes=require(_0xa6e7('0x6'));module[_0xa6e7('0x7')]=function(_0x2cc300,_0x54bb45){return _0x2cc300[_0xa6e7('0x8')](_0xa6e7('0x9'),attributes,{'tableName':_0xa6e7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa6e7('0xb'),'collate':_0xa6e7('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 866cddb..73c7936 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(_0x40f3e5,_0x1620e9){var _0x4db38a=function(_0x3321cd){while(--_0x3321cd){_0x40f3e5['push'](_0x40f3e5['shift']());}};_0x4db38a(++_0x1620e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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(_0x4f63b2,_0x473573){var _0x3b93bd=function(_0x167b0d){while(--_0x167b0d){_0x4f63b2['push'](_0x4f63b2['shift']());}};_0x3b93bd(++_0x473573);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index fc89585..102bdb6 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 _0x978f=['index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','./cannedAnswer.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x978f,0x1f0));var _0xf978=function(_0x1e08fa,_0x2177b8){_0x1e08fa=_0x1e08fa-0x0;var _0x48a80f=_0x978f[_0x1e08fa];return _0x48a80f;};'use strict';var multer=require(_0xf978('0x0'));var util=require(_0xf978('0x1'));var path=require(_0xf978('0x2'));var timeout=require('connect-timeout');var express=require(_0xf978('0x3'));var router=express['Router']();var fs_extra=require(_0xf978('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf978('0x5'));var config=require('../../config/environment');var controller=require(_0xf978('0x6'));router[_0xf978('0x7')]('/',auth['isAuthenticated'](),controller[_0xf978('0x8')]);router[_0xf978('0x7')](_0xf978('0x9'),auth[_0xf978('0xa')](),controller[_0xf978('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf978('0xc')]);router[_0xf978('0xd')](_0xf978('0x9'),auth[_0xf978('0xa')](),controller[_0xf978('0xe')]);router[_0xf978('0xf')](_0xf978('0x9'),auth[_0xf978('0xa')](),controller[_0xf978('0x10')]);module[_0xf978('0x11')]=router;
\ No newline at end of file
+var _0x6e12=['update','delete','destroy','multer','util','express','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show','create','put','/:id'];(function(_0x1858e0,_0x16386c){var _0x38af40=function(_0x26e183){while(--_0x26e183){_0x1858e0['push'](_0x1858e0['shift']());}};_0x38af40(++_0x16386c);}(_0x6e12,0x1df));var _0x26e1=function(_0x43434f,_0x220ac7){_0x43434f=_0x43434f-0x0;var _0x5e7af7=_0x6e12[_0x43434f];return _0x5e7af7;};'use strict';var multer=require(_0x26e1('0x0'));var util=require(_0x26e1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x26e1('0x2'));var router=express['Router']();var fs_extra=require(_0x26e1('0x3'));var auth=require(_0x26e1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x26e1('0x5'));var controller=require(_0x26e1('0x6'));router[_0x26e1('0x7')]('/',auth[_0x26e1('0x8')](),controller[_0x26e1('0x9')]);router[_0x26e1('0x7')]('/:id',auth[_0x26e1('0x8')](),controller[_0x26e1('0xa')]);router['post']('/',auth[_0x26e1('0x8')](),controller[_0x26e1('0xb')]);router[_0x26e1('0xc')](_0x26e1('0xd'),auth['isAuthenticated'](),controller[_0x26e1('0xe')]);router[_0x26e1('0xf')]('/:id',auth[_0x26e1('0x8')](),controller[_0x26e1('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index ad519d4..0b7473d 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 _0x6482=['INTEGER','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x30c92b,_0x154324){var _0x33837b=function(_0x3366e6){while(--_0x3366e6){_0x30c92b['push'](_0x30c92b['shift']());}};_0x33837b(++_0x154324);}(_0x6482,0xb0));var _0x2648=function(_0x4b1904,_0x102e50){_0x4b1904=_0x4b1904-0x0;var _0x5ad3d1=_0x6482[_0x4b1904];return _0x5ad3d1;};'use strict';var Sequelize=require('sequelize');module[_0x2648('0x0')]={'calldate':{'type':Sequelize[_0x2648('0x1')],'allowNull':![],'defaultValue':_0x2648('0x2')},'clid':{'type':Sequelize[_0x2648('0x3')]},'src':{'type':Sequelize[_0x2648('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2648('0x3')]},'dstchannel':{'type':Sequelize[_0x2648('0x3')]},'lastapp':{'type':Sequelize[_0x2648('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x2648('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x2648('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2648('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x2648('0x3')]},'uniqueid':{'type':Sequelize[_0x2648('0x3')]},'linkedid':{'type':Sequelize[_0x2648('0x3')]},'sequence':{'type':Sequelize[_0x2648('0x3')]},'peeraccount':{'type':Sequelize[_0x2648('0x3')]},'type':{'type':Sequelize[_0x2648('0x3')]},'tag':{'type':Sequelize[_0x2648('0x3')]}};
\ No newline at end of file
+var _0x53a6=['DATE','STRING','INTEGER','sequelize'];(function(_0x243243,_0x448f1a){var _0x3c3a78=function(_0x27a7e9){while(--_0x27a7e9){_0x243243['push'](_0x243243['shift']());}};_0x3c3a78(++_0x448f1a);}(_0x53a6,0x18f));var _0x653a=function(_0x58d89e,_0x532333){_0x58d89e=_0x58d89e-0x0;var _0x572cb5=_0x53a6[_0x58d89e];return _0x572cb5;};'use strict';var Sequelize=require(_0x653a('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x653a('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x653a('0x2')]},'src':{'type':Sequelize[_0x653a('0x2')]},'dst':{'type':Sequelize[_0x653a('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x653a('0x2')]},'dstchannel':{'type':Sequelize[_0x653a('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x653a('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x653a('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x653a('0x2')]},'amaflags':{'type':Sequelize[_0x653a('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x653a('0x2')]},'userfield':{'type':Sequelize[_0x653a('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x653a('0x2')]},'sequence':{'type':Sequelize[_0x653a('0x2')]},'peeraccount':{'type':Sequelize[_0x653a('0x2')]},'type':{'type':Sequelize[_0x653a('0x2')]},'tag':{'type':Sequelize[_0x653a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 4680d21..e022eeb 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 _0xda19=['rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','Cdr','includeAll','findAll','catch','show','body','find','params','describe'];(function(_0x492cd4,_0x2a640f){var _0x2c73f5=function(_0x720b8){while(--_0x720b8){_0x492cd4['push'](_0x492cd4['shift']());}};_0x2c73f5(++_0x2a640f);}(_0xda19,0xd5));var _0x9da1=function(_0x100573,_0x443a74){_0x100573=_0x100573-0x0;var _0x38be6a=_0xda19[_0x100573];return _0x38be6a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];function respondWithStatusCode(_0x596b6b,_0x4735c7){_0x4735c7=_0x4735c7||0xcc;return function(_0x1d93f8){if(_0x1d93f8){return _0x596b6b[_0x9da1('0x17')](_0x4735c7);}return _0x596b6b[_0x9da1('0x18')](_0x4735c7)['end']();};}function respondWithResult(_0x2837e3,_0x535a13){_0x535a13=_0x535a13||0xc8;return function(_0x4d17e1){if(_0x4d17e1){return _0x2837e3[_0x9da1('0x18')](_0x535a13)['json'](_0x4d17e1);}};}function respondWithFilteredResult(_0x433ff4,_0x43c093){return function(_0x37653d){if(_0x37653d){var _0x1a1a6b=typeof _0x43c093[_0x9da1('0x19')]==='undefined'&&typeof _0x43c093[_0x9da1('0x1a')]===_0x9da1('0x1b');var _0xf83bf8=_0x37653d[_0x9da1('0x1c')];var _0xfb278d=_0x1a1a6b?0x0:_0x43c093[_0x9da1('0x19')];var _0x497676=_0x1a1a6b?_0x37653d['count']:_0x43c093[_0x9da1('0x19')]+_0x43c093[_0x9da1('0x1a')];var _0x1b0e7f;if(_0x497676>=_0xf83bf8){_0x497676=_0xf83bf8;_0x1b0e7f=0xc8;}else{_0x1b0e7f=0xce;}_0x433ff4[_0x9da1('0x18')](_0x1b0e7f);return _0x433ff4[_0x9da1('0x1d')](_0x9da1('0x1e'),_0xfb278d+'-'+_0x497676+'/'+_0xf83bf8)[_0x9da1('0x1f')](_0x37653d);}return null;};}function patchUpdates(_0x47e5cf){return function(_0x1a459c){try{jsonpatch[_0x9da1('0x20')](_0x1a459c,_0x47e5cf,!![]);}catch(_0x9c3b37){return BPromise[_0x9da1('0x21')](_0x9c3b37);}return _0x1a459c[_0x9da1('0x22')]();};}function saveUpdates(_0x4e9d7d,_0x5454d3){return function(_0x14793b){if(_0x14793b){return _0x14793b[_0x9da1('0x23')](_0x4e9d7d)[_0x9da1('0x24')](function(_0x330219){return _0x330219;});}return null;};}function removeEntity(_0x32eb55,_0x165b73){return function(_0x4c60aa){if(_0x4c60aa){return _0x4c60aa[_0x9da1('0x25')]()[_0x9da1('0x24')](function(){_0x32eb55['status'](0xcc)[_0x9da1('0x26')]();});}};}function handleEntityNotFound(_0x3f5680,_0x534210){return function(_0x2fd49c){if(!_0x2fd49c){_0x3f5680[_0x9da1('0x17')](0x194);}return _0x2fd49c;};}function handleError(_0x4b1152,_0x36b87a){_0x36b87a=_0x36b87a||0x1f4;return function(_0x1d6af5){logger['error'](_0x1d6af5['stack']);if(_0x1d6af5[_0x9da1('0x27')]){delete _0x1d6af5[_0x9da1('0x27')];}_0x4b1152['status'](_0x36b87a)[_0x9da1('0x28')](_0x1d6af5);};}exports['index']=function(_0x5a6f2d,_0x5a59c2){var _0x31b826={},_0x404b86={},_0x24c6d5={'count':0x0,'rows':[]};var _0x26dd58=_[_0x9da1('0x29')](db['Cdr'][_0x9da1('0x2a')],function(_0x4e6083){return{'name':_0x4e6083[_0x9da1('0x2b')],'type':_0x4e6083[_0x9da1('0x2c')]['key']};});_0x404b86[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x26dd58,'name');_0x404b86[_0x9da1('0x2e')]=_[_0x9da1('0x2f')](_0x5a6f2d[_0x9da1('0x2e')]);_0x404b86[_0x9da1('0x30')]=_['intersection'](_0x404b86['model'],_0x404b86[_0x9da1('0x2e')]);_0x31b826[_0x9da1('0x31')]=_[_0x9da1('0x32')](_0x404b86[_0x9da1('0x2d')],qs[_0x9da1('0x33')](_0x5a6f2d['query'][_0x9da1('0x33')]));_0x31b826[_0x9da1('0x31')]=_0x31b826[_0x9da1('0x31')][_0x9da1('0x34')]?_0x31b826[_0x9da1('0x31')]:_0x404b86[_0x9da1('0x2d')];if(!_0x5a6f2d['query'][_0x9da1('0x35')]('nolimit')){_0x31b826['limit']=qs[_0x9da1('0x1a')](_0x5a6f2d['query'][_0x9da1('0x1a')]);_0x31b826[_0x9da1('0x19')]=qs[_0x9da1('0x19')](_0x5a6f2d[_0x9da1('0x2e')][_0x9da1('0x19')]);}_0x31b826[_0x9da1('0x36')]=qs[_0x9da1('0x37')](_0x5a6f2d[_0x9da1('0x2e')]['sort']);_0x31b826[_0x9da1('0x38')]=qs['filters'](_[_0x9da1('0x39')](_0x5a6f2d['query'],_0x404b86['filters']),_0x26dd58);if(_0x5a6f2d[_0x9da1('0x2e')]['filter']){_0x31b826[_0x9da1('0x38')]=_[_0x9da1('0x3a')](_0x31b826['where'],{'$or':_[_0x9da1('0x29')](_0x26dd58,function(_0x1b750f){if(_0x1b750f[_0x9da1('0x2c')]!==_0x9da1('0x3b')){var _0x56bd49={};_0x56bd49[_0x1b750f[_0x9da1('0x27')]]={'$like':'%'+_0x5a6f2d['query'][_0x9da1('0x3c')]+'%'};return _0x56bd49;}})});}_0x31b826=_['merge']({},_0x31b826,_0x5a6f2d[_0x9da1('0x3d')]);var _0x46c176={'where':_0x31b826['where']};return db[_0x9da1('0x3e')][_0x9da1('0x1c')](_0x46c176)[_0x9da1('0x24')](function(_0x4e9af3){_0x24c6d5['count']=_0x4e9af3;if(_0x5a6f2d['query'][_0x9da1('0x3f')]){_0x31b826['include']=[{'all':!![]}];}return db[_0x9da1('0x3e')][_0x9da1('0x40')](_0x31b826);})[_0x9da1('0x24')](function(_0x43c064){_0x24c6d5['rows']=_0x43c064;return _0x24c6d5;})[_0x9da1('0x24')](respondWithFilteredResult(_0x5a59c2,_0x31b826))[_0x9da1('0x41')](handleError(_0x5a59c2,null));};exports[_0x9da1('0x42')]=function(_0x173dc6,_0x28fc88){var _0x26c225={'raw':!![],'where':{'id':_0x173dc6['params']['id']}},_0x28e0b2={};_0x28e0b2[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x3e')]['rawAttributes']);_0x28e0b2[_0x9da1('0x2e')]=_[_0x9da1('0x2f')](_0x173dc6['query']);_0x28e0b2[_0x9da1('0x30')]=_[_0x9da1('0x32')](_0x28e0b2['model'],_0x28e0b2[_0x9da1('0x2e')]);_0x26c225['attributes']=_[_0x9da1('0x32')](_0x28e0b2[_0x9da1('0x2d')],qs['fields'](_0x173dc6['query'][_0x9da1('0x33')]));_0x26c225[_0x9da1('0x31')]=_0x26c225[_0x9da1('0x31')][_0x9da1('0x34')]?_0x26c225[_0x9da1('0x31')]:_0x28e0b2[_0x9da1('0x2d')];if(_0x173dc6[_0x9da1('0x2e')][_0x9da1('0x3f')]){_0x26c225['include']=[{'all':!![]}];}_0x26c225=_[_0x9da1('0x3a')]({},_0x26c225,_0x173dc6[_0x9da1('0x3d')]);return db[_0x9da1('0x3e')]['find'](_0x26c225)[_0x9da1('0x24')](handleEntityNotFound(_0x28fc88,null))[_0x9da1('0x24')](respondWithResult(_0x28fc88,null))[_0x9da1('0x41')](handleError(_0x28fc88,null));};exports['create']=function(_0x336fc3,_0x351d4d){return db[_0x9da1('0x3e')]['create'](_0x336fc3[_0x9da1('0x43')],{})['then'](respondWithResult(_0x351d4d,0xc9))['catch'](handleError(_0x351d4d,null));};exports[_0x9da1('0x23')]=function(_0x43c47d,_0x5afbc7){if(_0x43c47d[_0x9da1('0x43')]['id']){delete _0x43c47d[_0x9da1('0x43')]['id'];}return db['Cdr'][_0x9da1('0x44')]({'where':{'id':_0x43c47d[_0x9da1('0x45')]['id']}})[_0x9da1('0x24')](handleEntityNotFound(_0x5afbc7,null))[_0x9da1('0x24')](saveUpdates(_0x43c47d[_0x9da1('0x43')],null))[_0x9da1('0x24')](respondWithResult(_0x5afbc7,null))[_0x9da1('0x41')](handleError(_0x5afbc7,null));};exports[_0x9da1('0x25')]=function(_0x3889f4,_0x5c9b46){return db[_0x9da1('0x3e')][_0x9da1('0x44')]({'where':{'id':_0x3889f4[_0x9da1('0x45')]['id']}})[_0x9da1('0x24')](handleEntityNotFound(_0x5c9b46,null))['then'](removeEntity(_0x5c9b46,null))['catch'](handleError(_0x5c9b46,null));};exports[_0x9da1('0x46')]=function(_0x6ca1ac,_0x3870dd){return db[_0x9da1('0x3e')][_0x9da1('0x46')]()[_0x9da1('0x24')](respondWithResult(_0x3870dd,null))[_0x9da1('0x41')](handleError(_0x3870dd,null));};
\ No newline at end of file
+var _0x3435=['filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Cdr','count','includeAll','include','findAll','catch','params','rawAttributes','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','stack','send','map','fieldName','type','key','name','query','keys'];(function(_0x497d3c,_0x2205fa){var _0x3174ac=function(_0xbcf466){while(--_0xbcf466){_0x497d3c['push'](_0x497d3c['shift']());}};_0x3174ac(++_0x2205fa);}(_0x3435,0xfa));var _0x5343=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0x3435[_0x46ae5a];return _0x434986;};'use strict';var emlformat=require(_0x5343('0x0'));var rimraf=require(_0x5343('0x1'));var zipdir=require(_0x5343('0x2'));var jsonpatch=require(_0x5343('0x3'));var rp=require(_0x5343('0x4'));var moment=require(_0x5343('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5343('0x6'));var util=require(_0x5343('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5343('0x8'));var ejs=require(_0x5343('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5343('0xa'));var crypto=require(_0x5343('0xb'));var jsforce=require(_0x5343('0xc'));var deskjs=require(_0x5343('0xd'));var toCsv=require(_0x5343('0x8'));var querystring=require('querystring');var Papa=require(_0x5343('0xe'));var Redis=require('ioredis');var authService=require(_0x5343('0xf'));var qs=require(_0x5343('0x10'));var as=require(_0x5343('0x11'));var hardwareService=require(_0x5343('0x12'));var logger=require(_0x5343('0x13'))('api');var utils=require(_0x5343('0x14'));var config=require(_0x5343('0x15'));var licenseUtil=require(_0x5343('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ddeb7,_0x5f473f){_0x5f473f=_0x5f473f||0xcc;return function(_0x82074d){if(_0x82074d){return _0x2ddeb7[_0x5343('0x17')](_0x5f473f);}return _0x2ddeb7['status'](_0x5f473f)[_0x5343('0x18')]();};}function respondWithResult(_0x4cdfae,_0x13066f){_0x13066f=_0x13066f||0xc8;return function(_0x46c3d7){if(_0x46c3d7){return _0x4cdfae[_0x5343('0x19')](_0x13066f)[_0x5343('0x1a')](_0x46c3d7);}};}function respondWithFilteredResult(_0x4dbff1,_0x446e90){return function(_0x588a96){if(_0x588a96){var _0x1df724=typeof _0x446e90[_0x5343('0x1b')]===_0x5343('0x1c')&&typeof _0x446e90[_0x5343('0x1d')]===_0x5343('0x1c');var _0x4b5852=_0x588a96['count'];var _0x432992=_0x1df724?0x0:_0x446e90[_0x5343('0x1b')];var _0x1f5098=_0x1df724?_0x588a96['count']:_0x446e90[_0x5343('0x1b')]+_0x446e90[_0x5343('0x1d')];var _0x376c35;if(_0x1f5098>=_0x4b5852){_0x1f5098=_0x4b5852;_0x376c35=0xc8;}else{_0x376c35=0xce;}_0x4dbff1[_0x5343('0x19')](_0x376c35);return _0x4dbff1[_0x5343('0x1e')](_0x5343('0x1f'),_0x432992+'-'+_0x1f5098+'/'+_0x4b5852)[_0x5343('0x1a')](_0x588a96);}return null;};}function patchUpdates(_0x40ba38){return function(_0x35d41d){try{jsonpatch['apply'](_0x35d41d,_0x40ba38,!![]);}catch(_0x287304){return BPromise[_0x5343('0x20')](_0x287304);}return _0x35d41d[_0x5343('0x21')]();};}function saveUpdates(_0x42f92d,_0xd95a5b){return function(_0x4e7c0f){if(_0x4e7c0f){return _0x4e7c0f[_0x5343('0x22')](_0x42f92d)[_0x5343('0x23')](function(_0x24c250){return _0x24c250;});}return null;};}function removeEntity(_0x380aae,_0x290ce8){return function(_0x486597){if(_0x486597){return _0x486597[_0x5343('0x24')]()[_0x5343('0x23')](function(){_0x380aae['status'](0xcc)[_0x5343('0x18')]();});}};}function handleEntityNotFound(_0x96bbf6,_0x1ab5eb){return function(_0x5e4344){if(!_0x5e4344){_0x96bbf6['sendStatus'](0x194);}return _0x5e4344;};}function handleError(_0x462cb6,_0x5871de){_0x5871de=_0x5871de||0x1f4;return function(_0x14d05a){logger['error'](_0x14d05a[_0x5343('0x25')]);if(_0x14d05a['name']){delete _0x14d05a['name'];}_0x462cb6[_0x5343('0x19')](_0x5871de)[_0x5343('0x26')](_0x14d05a);};}exports['index']=function(_0x5d597e,_0x1202bb){var _0x5d0853={},_0x2ed8c9={},_0x47d49a={'count':0x0,'rows':[]};var _0x5c689e=_[_0x5343('0x27')](db['Cdr']['rawAttributes'],function(_0x125e4c){return{'name':_0x125e4c[_0x5343('0x28')],'type':_0x125e4c[_0x5343('0x29')][_0x5343('0x2a')]};});_0x2ed8c9['model']=_['map'](_0x5c689e,_0x5343('0x2b'));_0x2ed8c9[_0x5343('0x2c')]=_[_0x5343('0x2d')](_0x5d597e[_0x5343('0x2c')]);_0x2ed8c9[_0x5343('0x2e')]=_[_0x5343('0x2f')](_0x2ed8c9[_0x5343('0x30')],_0x2ed8c9[_0x5343('0x2c')]);_0x5d0853[_0x5343('0x31')]=_[_0x5343('0x2f')](_0x2ed8c9[_0x5343('0x30')],qs[_0x5343('0x32')](_0x5d597e['query']['fields']));_0x5d0853[_0x5343('0x31')]=_0x5d0853[_0x5343('0x31')]['length']?_0x5d0853[_0x5343('0x31')]:_0x2ed8c9['model'];if(!_0x5d597e[_0x5343('0x2c')][_0x5343('0x33')](_0x5343('0x34'))){_0x5d0853[_0x5343('0x1d')]=qs['limit'](_0x5d597e['query'][_0x5343('0x1d')]);_0x5d0853['offset']=qs[_0x5343('0x1b')](_0x5d597e[_0x5343('0x2c')]['offset']);}_0x5d0853[_0x5343('0x35')]=qs['sort'](_0x5d597e['query'][_0x5343('0x36')]);_0x5d0853[_0x5343('0x37')]=qs[_0x5343('0x2e')](_[_0x5343('0x38')](_0x5d597e['query'],_0x2ed8c9['filters']),_0x5c689e);if(_0x5d597e['query']['filter']){_0x5d0853[_0x5343('0x37')]=_[_0x5343('0x39')](_0x5d0853[_0x5343('0x37')],{'$or':_[_0x5343('0x27')](_0x5c689e,function(_0x3c517a){if(_0x3c517a[_0x5343('0x29')]!==_0x5343('0x3a')){var _0x4d2951={};_0x4d2951[_0x3c517a[_0x5343('0x2b')]]={'$like':'%'+_0x5d597e['query'][_0x5343('0x3b')]+'%'};return _0x4d2951;}})});}_0x5d0853=_[_0x5343('0x39')]({},_0x5d0853,_0x5d597e[_0x5343('0x3c')]);var _0x2f004a={'where':_0x5d0853[_0x5343('0x37')]};return db[_0x5343('0x3d')][_0x5343('0x3e')](_0x2f004a)['then'](function(_0xb93d9){_0x47d49a['count']=_0xb93d9;if(_0x5d597e[_0x5343('0x2c')][_0x5343('0x3f')]){_0x5d0853[_0x5343('0x40')]=[{'all':!![]}];}return db[_0x5343('0x3d')][_0x5343('0x41')](_0x5d0853);})[_0x5343('0x23')](function(_0x2c75bd){_0x47d49a['rows']=_0x2c75bd;return _0x47d49a;})[_0x5343('0x23')](respondWithFilteredResult(_0x1202bb,_0x5d0853))[_0x5343('0x42')](handleError(_0x1202bb,null));};exports['show']=function(_0x41df61,_0x16c880){var _0x4c576d={'raw':!![],'where':{'id':_0x41df61[_0x5343('0x43')]['id']}},_0x53c3c7={};_0x53c3c7[_0x5343('0x30')]=_[_0x5343('0x2d')](db['Cdr'][_0x5343('0x44')]);_0x53c3c7[_0x5343('0x2c')]=_[_0x5343('0x2d')](_0x41df61[_0x5343('0x2c')]);_0x53c3c7[_0x5343('0x2e')]=_[_0x5343('0x2f')](_0x53c3c7[_0x5343('0x30')],_0x53c3c7['query']);_0x4c576d[_0x5343('0x31')]=_[_0x5343('0x2f')](_0x53c3c7[_0x5343('0x30')],qs[_0x5343('0x32')](_0x41df61[_0x5343('0x2c')][_0x5343('0x32')]));_0x4c576d[_0x5343('0x31')]=_0x4c576d[_0x5343('0x31')][_0x5343('0x45')]?_0x4c576d[_0x5343('0x31')]:_0x53c3c7[_0x5343('0x30')];if(_0x41df61[_0x5343('0x2c')][_0x5343('0x3f')]){_0x4c576d[_0x5343('0x40')]=[{'all':!![]}];}_0x4c576d=_[_0x5343('0x39')]({},_0x4c576d,_0x41df61['options']);return db[_0x5343('0x3d')][_0x5343('0x46')](_0x4c576d)['then'](handleEntityNotFound(_0x16c880,null))[_0x5343('0x23')](respondWithResult(_0x16c880,null))[_0x5343('0x42')](handleError(_0x16c880,null));};exports[_0x5343('0x47')]=function(_0x1da1b7,_0x194316){return db['Cdr'][_0x5343('0x47')](_0x1da1b7['body'],{})['then'](respondWithResult(_0x194316,0xc9))[_0x5343('0x42')](handleError(_0x194316,null));};exports[_0x5343('0x22')]=function(_0x10329c,_0x1cd4ed){if(_0x10329c['body']['id']){delete _0x10329c[_0x5343('0x48')]['id'];}return db[_0x5343('0x3d')][_0x5343('0x46')]({'where':{'id':_0x10329c[_0x5343('0x43')]['id']}})[_0x5343('0x23')](handleEntityNotFound(_0x1cd4ed,null))[_0x5343('0x23')](saveUpdates(_0x10329c[_0x5343('0x48')],null))[_0x5343('0x23')](respondWithResult(_0x1cd4ed,null))[_0x5343('0x42')](handleError(_0x1cd4ed,null));};exports[_0x5343('0x24')]=function(_0x566d71,_0x1cbf7c){return db[_0x5343('0x3d')][_0x5343('0x46')]({'where':{'id':_0x566d71[_0x5343('0x43')]['id']}})[_0x5343('0x23')](handleEntityNotFound(_0x1cbf7c,null))[_0x5343('0x23')](removeEntity(_0x1cbf7c,null))[_0x5343('0x42')](handleError(_0x1cbf7c,null));};exports[_0x5343('0x49')]=function(_0x3b3c64,_0xad51f4){return db['Cdr'][_0x5343('0x49')]()['then'](respondWithResult(_0xad51f4,null))['catch'](handleError(_0xad51f4,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 135ad6d..d8fed5e 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x42930b,_0x3e920d){var _0x1c27a1=function(_0x4912ad){while(--_0x4912ad){_0x42930b['push'](_0x42930b['shift']());}};_0x1c27a1(++_0x3e920d);}(_0x7a54,0x106));var _0x47a5=function(_0x413719,_0x2aa3b8){_0x413719=_0x413719-0x0;var _0x352ced=_0x7a54[_0x413719];return _0x352ced;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x39cf37,_0x4dd4ab){var _0x310d01=function(_0x548e3a){while(--_0x548e3a){_0x39cf37['push'](_0x39cf37['shift']());}};_0x310d01(++_0x4dd4ab);}(_0x7a54,0x106));var _0x47a5=function(_0xbdd2ee,_0x3c6be1){_0xbdd2ee=_0xbdd2ee-0x0;var _0x3b9fe4=_0x7a54[_0xbdd2ee];return _0x3b9fe4;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 83646d8..5dbbc05 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 _0xed40=['util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash'];(function(_0x185487,_0x278958){var _0x8c7d49=function(_0x53362d){while(--_0x53362d){_0x185487['push'](_0x185487['shift']());}};_0x8c7d49(++_0x278958);}(_0xed40,0x17b));var _0x0ed4=function(_0x3a1bd7,_0x13657d){_0x3a1bd7=_0x3a1bd7-0x0;var _0x456f58=_0xed40[_0x3a1bd7];return _0x456f58;};'use strict';var _=require(_0x0ed4('0x0'));var util=require(_0x0ed4('0x1'));var moment=require(_0x0ed4('0x2'));var BPromise=require(_0x0ed4('0x3'));var rs=require(_0x0ed4('0x4'));var fs=require('fs');var Redis=require(_0x0ed4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0ed4('0x6'))('rpc');var config=require(_0x0ed4('0x7'));var jayson=require(_0x0ed4('0x8'));var client=jayson[_0x0ed4('0x9')][_0x0ed4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c370c,_0x3c81e7,_0x4a2b21){return new BPromise(function(_0x2503e5,_0x3df7bb){return client[_0x0ed4('0xb')](_0x3c370c,_0x4a2b21)['then'](function(_0x4b7a0e){logger[_0x0ed4('0xc')](_0x0ed4('0xd'),_0x3c81e7,_0x0ed4('0xe'));logger['debug'](_0x0ed4('0xf'),_0x3c81e7,'request\x20sent',JSON[_0x0ed4('0x10')](_0x4b7a0e));if(_0x4b7a0e[_0x0ed4('0x11')]){if(_0x4b7a0e[_0x0ed4('0x11')]['code']===0x1f4){logger[_0x0ed4('0x11')](_0x0ed4('0xd'),_0x3c81e7,_0x4b7a0e[_0x0ed4('0x11')]['message']);return _0x3df7bb(_0x4b7a0e[_0x0ed4('0x11')][_0x0ed4('0x12')]);}logger[_0x0ed4('0x11')](_0x0ed4('0xd'),_0x3c81e7,_0x4b7a0e[_0x0ed4('0x11')]['message']);return _0x2503e5(_0x4b7a0e[_0x0ed4('0x11')][_0x0ed4('0x12')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x3c81e7,_0x0ed4('0xe'));_0x2503e5(_0x4b7a0e['result'][_0x0ed4('0x12')]);}})[_0x0ed4('0x13')](function(_0x4fdc04){logger['error'](_0x0ed4('0xd'),_0x3c81e7,_0x4fdc04);_0x3df7bb(_0x4fdc04);});});}
\ No newline at end of file
+var _0xc16b=['moment','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x37af2e,_0x355e49){var _0x357f12=function(_0x40671c){while(--_0x40671c){_0x37af2e['push'](_0x37af2e['shift']());}};_0x357f12(++_0x355e49);}(_0xc16b,0xb2));var _0xbc16=function(_0xe391aa,_0x255528){_0xe391aa=_0xe391aa-0x0;var _0x793c4d=_0xc16b[_0xe391aa];return _0x793c4d;};'use strict';var _=require(_0xbc16('0x0'));var util=require(_0xbc16('0x1'));var moment=require(_0xbc16('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbc16('0x3'));var logger=require('../../config/logger')(_0xbc16('0x4'));var config=require(_0xbc16('0x5'));var jayson=require(_0xbc16('0x6'));var client=jayson['client'][_0xbc16('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x490598,_0x528309,_0x1ab9d2){return new BPromise(function(_0x126312,_0x16ce18){return client[_0xbc16('0x8')](_0x490598,_0x1ab9d2)[_0xbc16('0x9')](function(_0x2c2a35){logger[_0xbc16('0xa')]('Cdr,\x20%s,\x20%s',_0x528309,_0xbc16('0xb'));logger[_0xbc16('0xc')](_0xbc16('0xd'),_0x528309,'request\x20sent',JSON['stringify'](_0x2c2a35));if(_0x2c2a35[_0xbc16('0xe')]){if(_0x2c2a35[_0xbc16('0xe')][_0xbc16('0xf')]===0x1f4){logger['error'](_0xbc16('0x10'),_0x528309,_0x2c2a35[_0xbc16('0xe')][_0xbc16('0x11')]);return _0x16ce18(_0x2c2a35['error'][_0xbc16('0x11')]);}logger[_0xbc16('0xe')](_0xbc16('0x10'),_0x528309,_0x2c2a35[_0xbc16('0xe')]['message']);return _0x126312(_0x2c2a35['error'][_0xbc16('0x11')]);}else{logger[_0xbc16('0xa')](_0xbc16('0x10'),_0x528309,_0xbc16('0xb'));_0x126312(_0x2c2a35[_0xbc16('0x12')][_0xbc16('0x11')]);}})[_0xbc16('0x13')](function(_0x2405a9){logger[_0xbc16('0xe')]('Cdr,\x20%s,\x20%s',_0x528309,_0x2405a9);_0x16ce18(_0x2405a9);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 8bca059..386e85f 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(_0x5c7a85,_0x41dd19){var _0x35290f=function(_0x26215b){while(--_0x26215b){_0x5c7a85['push'](_0x5c7a85['shift']());}};_0x35290f(++_0x41dd19);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 _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(_0x872b02,_0x4f4458){var _0x1a6b24=function(_0x1dfb4e){while(--_0x1dfb4e){_0x872b02['push'](_0x872b02['shift']());}};_0x1a6b24(++_0x4f4458);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 63cca07..2aa41e2 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 _0xd0ab=['STRING','*,*,*,*','sequelize','INTEGER','TEXT'];(function(_0xa6f6a6,_0x138b7a){var _0x71a78a=function(_0x3070d1){while(--_0x3070d1){_0xa6f6a6['push'](_0xa6f6a6['shift']());}};_0x71a78a(++_0x138b7a);}(_0xd0ab,0x66));var _0xbd0a=function(_0x1ad248,_0x1579a6){_0x1ad248=_0x1ad248-0x0;var _0x3636df=_0xd0ab[_0x1ad248];return _0x3636df;};'use strict';var Sequelize=require(_0xbd0a('0x0'));module['exports']={'priority':{'type':Sequelize[_0xbd0a('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xbd0a('0x2')]()},'description':{'type':Sequelize[_0xbd0a('0x3')]},'interval':{'type':Sequelize[_0xbd0a('0x3')],'defaultValue':_0xbd0a('0x4')}};
\ No newline at end of file
+var _0x5226=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x2646ad,_0x2915ba){var _0x350cbb=function(_0x48a62c){while(--_0x48a62c){_0x2646ad['push'](_0x2646ad['shift']());}};_0x350cbb(++_0x2915ba);}(_0x5226,0x1b2));var _0x6522=function(_0x3c538f,_0x467bbf){_0x3c538f=_0x3c538f-0x0;var _0x44b0a8=_0x5226[_0x3c538f];return _0x44b0a8;};'use strict';var Sequelize=require(_0x6522('0x0'));module[_0x6522('0x1')]={'priority':{'type':Sequelize[_0x6522('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6522('0x3')],'allowNull':![],'defaultValue':_0x6522('0x4')},'appdata':{'type':Sequelize[_0x6522('0x5')]()},'description':{'type':Sequelize[_0x6522('0x3')]},'interval':{'type':Sequelize[_0x6522('0x3')],'defaultValue':_0x6522('0x6')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index b2dde11..b6cd8cd 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 _0x0c5d=['jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','filters','intersection','query','attributes','fields','length','includeAll','include','options','find','body','catch','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x17e799,_0x490f26){var _0x682f42=function(_0x4b9043){while(--_0x4b9043){_0x17e799['push'](_0x17e799['shift']());}};_0x682f42(++_0x490f26);}(_0x0c5d,0x6c));var _0xd0c5=function(_0xf7f498,_0x3238c5){_0xf7f498=_0xf7f498-0x0;var _0x2bde38=_0x0c5d[_0xf7f498];return _0x2bde38;};'use strict';var emlformat=require(_0xd0c5('0x0'));var rimraf=require(_0xd0c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd0c5('0x2'));var rp=require('request-promise');var moment=require(_0xd0c5('0x3'));var BPromise=require(_0xd0c5('0x4'));var Mustache=require(_0xd0c5('0x5'));var util=require(_0xd0c5('0x6'));var path=require(_0xd0c5('0x7'));var sox=require(_0xd0c5('0x8'));var csv=require(_0xd0c5('0x9'));var ejs=require(_0xd0c5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd0c5('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd0c5('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd0c5('0xd'));var Papa=require(_0xd0c5('0xe'));var Redis=require('ioredis');var authService=require(_0xd0c5('0xf'));var qs=require(_0xd0c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd0c5('0x11'));var logger=require(_0xd0c5('0x12'))(_0xd0c5('0x13'));var utils=require(_0xd0c5('0x14'));var config=require(_0xd0c5('0x15'));var licenseUtil=require(_0xd0c5('0x16'));var db=require(_0xd0c5('0x17'))['db'];function respondWithStatusCode(_0x46db00,_0x1e5ac4){_0x1e5ac4=_0x1e5ac4||0xcc;return function(_0x125470){if(_0x125470){return _0x46db00[_0xd0c5('0x18')](_0x1e5ac4);}return _0x46db00[_0xd0c5('0x19')](_0x1e5ac4)['end']();};}function respondWithResult(_0x11511d,_0x1c1cc8){_0x1c1cc8=_0x1c1cc8||0xc8;return function(_0x1fc98d){if(_0x1fc98d){return _0x11511d[_0xd0c5('0x19')](_0x1c1cc8)['json'](_0x1fc98d);}};}function respondWithFilteredResult(_0x280e22,_0x23d941){return function(_0x242615){if(_0x242615){var _0x639e72=typeof _0x23d941['offset']===_0xd0c5('0x1a')&&typeof _0x23d941['limit']===_0xd0c5('0x1a');var _0x57c76a=_0x242615[_0xd0c5('0x1b')];var _0x692aeb=_0x639e72?0x0:_0x23d941[_0xd0c5('0x1c')];var _0x1cfe05=_0x639e72?_0x242615[_0xd0c5('0x1b')]:_0x23d941[_0xd0c5('0x1c')]+_0x23d941[_0xd0c5('0x1d')];var _0x287961;if(_0x1cfe05>=_0x57c76a){_0x1cfe05=_0x57c76a;_0x287961=0xc8;}else{_0x287961=0xce;}_0x280e22['status'](_0x287961);return _0x280e22[_0xd0c5('0x1e')](_0xd0c5('0x1f'),_0x692aeb+'-'+_0x1cfe05+'/'+_0x57c76a)['json'](_0x242615);}return null;};}function patchUpdates(_0x835e8d){return function(_0x30f548){try{jsonpatch[_0xd0c5('0x20')](_0x30f548,_0x835e8d,!![]);}catch(_0x6febb1){return BPromise[_0xd0c5('0x21')](_0x6febb1);}return _0x30f548[_0xd0c5('0x22')]();};}function saveUpdates(_0x331849,_0x49db81){return function(_0x4ac41c){if(_0x4ac41c){return _0x4ac41c[_0xd0c5('0x23')](_0x331849)[_0xd0c5('0x24')](function(_0x439dd5){return _0x439dd5;});}return null;};}function removeEntity(_0x6ce082,_0x5eb093){return function(_0x185e33){if(_0x185e33){return _0x185e33['destroy']()['then'](function(){_0x6ce082[_0xd0c5('0x19')](0xcc)[_0xd0c5('0x25')]();});}};}function handleEntityNotFound(_0x364963,_0x73f292){return function(_0x3a5edf){if(!_0x3a5edf){_0x364963[_0xd0c5('0x18')](0x194);}return _0x3a5edf;};}function handleError(_0xbcef61,_0x17443b){_0x17443b=_0x17443b||0x1f4;return function(_0x19b9ec){logger[_0xd0c5('0x26')](_0x19b9ec[_0xd0c5('0x27')]);if(_0x19b9ec[_0xd0c5('0x28')]){delete _0x19b9ec[_0xd0c5('0x28')];}_0xbcef61[_0xd0c5('0x19')](_0x17443b)[_0xd0c5('0x29')](_0x19b9ec);};}exports[_0xd0c5('0x2a')]=function(_0x24d35f,_0x572e66){var _0x39284e={'raw':!![],'where':{'id':_0x24d35f[_0xd0c5('0x2b')]['id']}},_0x36415f={};_0x36415f[_0xd0c5('0x2c')]=_[_0xd0c5('0x2d')](db[_0xd0c5('0x2e')][_0xd0c5('0x2f')]);_0x36415f['query']=_[_0xd0c5('0x2d')](_0x24d35f['query']);_0x36415f[_0xd0c5('0x30')]=_[_0xd0c5('0x31')](_0x36415f[_0xd0c5('0x2c')],_0x36415f[_0xd0c5('0x32')]);_0x39284e[_0xd0c5('0x33')]=_[_0xd0c5('0x31')](_0x36415f[_0xd0c5('0x2c')],qs['fields'](_0x24d35f['query'][_0xd0c5('0x34')]));_0x39284e['attributes']=_0x39284e[_0xd0c5('0x33')][_0xd0c5('0x35')]?_0x39284e[_0xd0c5('0x33')]:_0x36415f[_0xd0c5('0x2c')];if(_0x24d35f['query'][_0xd0c5('0x36')]){_0x39284e[_0xd0c5('0x37')]=[{'all':!![]}];}_0x39284e=_['merge']({},_0x39284e,_0x24d35f[_0xd0c5('0x38')]);return db['ChatApplication'][_0xd0c5('0x39')](_0x39284e)[_0xd0c5('0x24')](handleEntityNotFound(_0x572e66,null))[_0xd0c5('0x24')](respondWithResult(_0x572e66,null))['catch'](handleError(_0x572e66,null));};exports[_0xd0c5('0x23')]=function(_0x263d3b,_0x2e8f04){if(_0x263d3b[_0xd0c5('0x3a')]['id']){delete _0x263d3b[_0xd0c5('0x3a')]['id'];}return db[_0xd0c5('0x2e')][_0xd0c5('0x39')]({'where':{'id':_0x263d3b[_0xd0c5('0x2b')]['id']}})[_0xd0c5('0x24')](handleEntityNotFound(_0x2e8f04,null))[_0xd0c5('0x24')](saveUpdates(_0x263d3b[_0xd0c5('0x3a')],null))[_0xd0c5('0x24')](respondWithResult(_0x2e8f04,null))[_0xd0c5('0x3b')](handleError(_0x2e8f04,null));};exports['destroy']=function(_0x4e3d0e,_0x1fe07f){return db['ChatApplication'][_0xd0c5('0x39')]({'where':{'id':_0x4e3d0e[_0xd0c5('0x2b')]['id']}})['then'](handleEntityNotFound(_0x1fe07f,null))[_0xd0c5('0x24')](removeEntity(_0x1fe07f,null))[_0xd0c5('0x3b')](handleError(_0x1fe07f,null));};
\ No newline at end of file
+var _0xc2af=['jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','error','name','send','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','update','params','body','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel'];(function(_0x9c123e,_0x2c8bff){var _0x2157df=function(_0x13080a){while(--_0x13080a){_0x9c123e['push'](_0x9c123e['shift']());}};_0x2157df(++_0x2c8bff);}(_0xc2af,0x1bc));var _0xfc2a=function(_0x1cbc64,_0x55fecc){_0x1cbc64=_0x1cbc64-0x0;var _0x1a601f=_0xc2af[_0x1cbc64];return _0x1a601f;};'use strict';var emlformat=require(_0xfc2a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfc2a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfc2a('0x2'));var moment=require(_0xfc2a('0x3'));var BPromise=require(_0xfc2a('0x4'));var Mustache=require(_0xfc2a('0x5'));var util=require(_0xfc2a('0x6'));var path=require(_0xfc2a('0x7'));var sox=require(_0xfc2a('0x8'));var csv=require(_0xfc2a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfc2a('0xa'));var _=require('lodash');var squel=require(_0xfc2a('0xb'));var crypto=require('crypto');var jsforce=require(_0xfc2a('0xc'));var deskjs=require(_0xfc2a('0xd'));var toCsv=require(_0xfc2a('0x9'));var querystring=require(_0xfc2a('0xe'));var Papa=require('papaparse');var Redis=require(_0xfc2a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfc2a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc2a('0x11'));var logger=require(_0xfc2a('0x12'))(_0xfc2a('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfc2a('0x14'));var db=require(_0xfc2a('0x15'))['db'];function respondWithStatusCode(_0x771766,_0x41395e){_0x41395e=_0x41395e||0xcc;return function(_0x268993){if(_0x268993){return _0x771766[_0xfc2a('0x16')](_0x41395e);}return _0x771766[_0xfc2a('0x17')](_0x41395e)[_0xfc2a('0x18')]();};}function respondWithResult(_0xe4b058,_0x55574a){_0x55574a=_0x55574a||0xc8;return function(_0x4e6b7e){if(_0x4e6b7e){return _0xe4b058[_0xfc2a('0x17')](_0x55574a)[_0xfc2a('0x19')](_0x4e6b7e);}};}function respondWithFilteredResult(_0x594a59,_0x12dd07){return function(_0x2f311c){if(_0x2f311c){var _0x21654f=typeof _0x12dd07[_0xfc2a('0x1a')]===_0xfc2a('0x1b')&&typeof _0x12dd07[_0xfc2a('0x1c')]===_0xfc2a('0x1b');var _0x678f8d=_0x2f311c[_0xfc2a('0x1d')];var _0x1e1524=_0x21654f?0x0:_0x12dd07[_0xfc2a('0x1a')];var _0x39bcb2=_0x21654f?_0x2f311c[_0xfc2a('0x1d')]:_0x12dd07['offset']+_0x12dd07[_0xfc2a('0x1c')];var _0x15ff6d;if(_0x39bcb2>=_0x678f8d){_0x39bcb2=_0x678f8d;_0x15ff6d=0xc8;}else{_0x15ff6d=0xce;}_0x594a59['status'](_0x15ff6d);return _0x594a59[_0xfc2a('0x1e')]('Content-Range',_0x1e1524+'-'+_0x39bcb2+'/'+_0x678f8d)['json'](_0x2f311c);}return null;};}function patchUpdates(_0x3e88fe){return function(_0x2b7f5c){try{jsonpatch[_0xfc2a('0x1f')](_0x2b7f5c,_0x3e88fe,!![]);}catch(_0x40ed0b){return BPromise[_0xfc2a('0x20')](_0x40ed0b);}return _0x2b7f5c['save']();};}function saveUpdates(_0x722009,_0x4908d7){return function(_0x5432f2){if(_0x5432f2){return _0x5432f2['update'](_0x722009)[_0xfc2a('0x21')](function(_0x57b67c){return _0x57b67c;});}return null;};}function removeEntity(_0x4d6b68,_0x43e237){return function(_0x10396d){if(_0x10396d){return _0x10396d[_0xfc2a('0x22')]()[_0xfc2a('0x21')](function(){_0x4d6b68['status'](0xcc)[_0xfc2a('0x18')]();});}};}function handleEntityNotFound(_0x192f0b,_0x33574a){return function(_0x5ea9f8){if(!_0x5ea9f8){_0x192f0b[_0xfc2a('0x16')](0x194);}return _0x5ea9f8;};}function handleError(_0x24ff4e,_0x542c9e){_0x542c9e=_0x542c9e||0x1f4;return function(_0x55c0bc){logger[_0xfc2a('0x23')](_0x55c0bc['stack']);if(_0x55c0bc[_0xfc2a('0x24')]){delete _0x55c0bc[_0xfc2a('0x24')];}_0x24ff4e[_0xfc2a('0x17')](_0x542c9e)[_0xfc2a('0x25')](_0x55c0bc);};}exports['show']=function(_0x4fe30d,_0x5f4165){var _0x3bf69f={'raw':!![],'where':{'id':_0x4fe30d['params']['id']}},_0x1f91f5={};_0x1f91f5[_0xfc2a('0x26')]=_[_0xfc2a('0x27')](db[_0xfc2a('0x28')][_0xfc2a('0x29')]);_0x1f91f5[_0xfc2a('0x2a')]=_[_0xfc2a('0x27')](_0x4fe30d[_0xfc2a('0x2a')]);_0x1f91f5[_0xfc2a('0x2b')]=_[_0xfc2a('0x2c')](_0x1f91f5['model'],_0x1f91f5[_0xfc2a('0x2a')]);_0x3bf69f[_0xfc2a('0x2d')]=_[_0xfc2a('0x2c')](_0x1f91f5[_0xfc2a('0x26')],qs[_0xfc2a('0x2e')](_0x4fe30d[_0xfc2a('0x2a')][_0xfc2a('0x2e')]));_0x3bf69f[_0xfc2a('0x2d')]=_0x3bf69f[_0xfc2a('0x2d')][_0xfc2a('0x2f')]?_0x3bf69f[_0xfc2a('0x2d')]:_0x1f91f5[_0xfc2a('0x26')];if(_0x4fe30d['query'][_0xfc2a('0x30')]){_0x3bf69f[_0xfc2a('0x31')]=[{'all':!![]}];}_0x3bf69f=_[_0xfc2a('0x32')]({},_0x3bf69f,_0x4fe30d[_0xfc2a('0x33')]);return db['ChatApplication'][_0xfc2a('0x34')](_0x3bf69f)['then'](handleEntityNotFound(_0x5f4165,null))[_0xfc2a('0x21')](respondWithResult(_0x5f4165,null))['catch'](handleError(_0x5f4165,null));};exports[_0xfc2a('0x35')]=function(_0x1a423d,_0x53491a){if(_0x1a423d['body']['id']){delete _0x1a423d['body']['id'];}return db['ChatApplication'][_0xfc2a('0x34')]({'where':{'id':_0x1a423d[_0xfc2a('0x36')]['id']}})['then'](handleEntityNotFound(_0x53491a,null))['then'](saveUpdates(_0x1a423d[_0xfc2a('0x37')],null))[_0xfc2a('0x21')](respondWithResult(_0x53491a,null))[_0xfc2a('0x38')](handleError(_0x53491a,null));};exports[_0xfc2a('0x22')]=function(_0x30a32a,_0x5dde47){return db[_0xfc2a('0x28')][_0xfc2a('0x34')]({'where':{'id':_0x30a32a['params']['id']}})[_0xfc2a('0x21')](handleEntityNotFound(_0x5dde47,null))[_0xfc2a('0x21')](removeEntity(_0x5dde47,null))[_0xfc2a('0x38')](handleError(_0x5dde47,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index bbbae4b..385f911 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 _0xec22=['exports','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3670f1,_0x378d01){var _0x4fed56=function(_0x2b0d27){while(--_0x2b0d27){_0x3670f1['push'](_0x3670f1['shift']());}};_0x4fed56(++_0x378d01);}(_0xec22,0x1b1));var _0x2ec2=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xec22[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x2ec2('0x0'));var util=require(_0x2ec2('0x1'));var logger=require(_0x2ec2('0x2'))(_0x2ec2('0x3'));var moment=require(_0x2ec2('0x4'));var BPromise=require(_0x2ec2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2ec2('0x6'));var rimraf=require(_0x2ec2('0x7'));var config=require(_0x2ec2('0x8'));var attributes=require('./chatApplication.attributes');module[_0x2ec2('0x9')]=function(_0x3bed29,_0x2aa01f){return _0x3bed29['define'](_0x2ec2('0xa'),attributes,{'tableName':_0x2ec2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2ec2('0xc')});};
\ No newline at end of file
+var _0x1d9d=['moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x196189,_0x1a5b61){var _0x5a2bc1=function(_0x5e014b){while(--_0x5e014b){_0x196189['push'](_0x196189['shift']());}};_0x5a2bc1(++_0x1a5b61);}(_0x1d9d,0x6d));var _0xd1d9=function(_0x5afaea,_0x168909){_0x5afaea=_0x5afaea-0x0;var _0x1707e0=_0x1d9d[_0x5afaea];return _0x1707e0;};'use strict';var _=require(_0xd1d9('0x0'));var util=require(_0xd1d9('0x1'));var logger=require(_0xd1d9('0x2'))('api');var moment=require(_0xd1d9('0x3'));var BPromise=require(_0xd1d9('0x4'));var rp=require(_0xd1d9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd1d9('0x6'));var config=require(_0xd1d9('0x7'));var attributes=require(_0xd1d9('0x8'));module[_0xd1d9('0x9')]=function(_0x5cc987,_0x286cd0){return _0x5cc987[_0xd1d9('0xa')](_0xd1d9('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd1d9('0xc'),'collate':_0xd1d9('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 2918a24..8daaa50 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 _0xe95a=['error','message','result','catch','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x714046,_0x183573){var _0x486bfc=function(_0x3d8fac){while(--_0x3d8fac){_0x714046['push'](_0x714046['shift']());}};_0x486bfc(++_0x183573);}(_0xe95a,0x1a8));var _0xae95=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe95a[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xae95('0x0'));var util=require('util');var moment=require(_0xae95('0x1'));var BPromise=require('bluebird');var rs=require(_0xae95('0x2'));var fs=require('fs');var Redis=require(_0xae95('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xae95('0x4'))(_0xae95('0x5'));var config=require(_0xae95('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xae95('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a9953,_0x275e2d,_0x493076){return new BPromise(function(_0x2bfc76,_0xfe613c){return client[_0xae95('0x8')](_0x4a9953,_0x493076)[_0xae95('0x9')](function(_0x7246a2){logger[_0xae95('0xa')](_0xae95('0xb'),_0x275e2d,_0xae95('0xc'));logger[_0xae95('0xd')](_0xae95('0xe'),_0x275e2d,_0xae95('0xc'),JSON[_0xae95('0xf')](_0x7246a2));if(_0x7246a2['error']){if(_0x7246a2['error'][_0xae95('0x10')]===0x1f4){logger[_0xae95('0x11')](_0xae95('0xb'),_0x275e2d,_0x7246a2[_0xae95('0x11')][_0xae95('0x12')]);return _0xfe613c(_0x7246a2[_0xae95('0x11')]['message']);}logger[_0xae95('0x11')](_0xae95('0xb'),_0x275e2d,_0x7246a2[_0xae95('0x11')]['message']);return _0x2bfc76(_0x7246a2[_0xae95('0x11')][_0xae95('0x12')]);}else{logger[_0xae95('0xa')]('ChatApplication,\x20%s,\x20%s',_0x275e2d,'request\x20sent');_0x2bfc76(_0x7246a2[_0xae95('0x13')][_0xae95('0x12')]);}})[_0xae95('0x14')](function(_0x412f29){logger[_0xae95('0x11')]('ChatApplication,\x20%s,\x20%s',_0x275e2d,_0x412f29);_0xfe613c(_0x412f29);});});}
\ No newline at end of file
+var _0x58e4=['../../config/utils','rpc','../../config/environment','client','http','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','util','moment','randomstring','ioredis'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x58e4,0x188));var _0x458e=function(_0xeb27e7,_0x4ca640){_0xeb27e7=_0xeb27e7-0x0;var _0x281f7f=_0x58e4[_0xeb27e7];return _0x281f7f;};'use strict';var _=require('lodash');var util=require(_0x458e('0x0'));var moment=require(_0x458e('0x1'));var BPromise=require('bluebird');var rs=require(_0x458e('0x2'));var fs=require('fs');var Redis=require(_0x458e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x458e('0x4'));var logger=require('../../config/logger')(_0x458e('0x5'));var config=require(_0x458e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x458e('0x7')][_0x458e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52f085,_0x2028f6,_0x277249){return new BPromise(function(_0x4e2383,_0x50edc3){return client['request'](_0x52f085,_0x277249)[_0x458e('0x9')](function(_0x158ebc){logger[_0x458e('0xa')](_0x458e('0xb'),_0x2028f6,_0x458e('0xc'));logger[_0x458e('0xd')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x2028f6,_0x458e('0xc'),JSON['stringify'](_0x158ebc));if(_0x158ebc[_0x458e('0xe')]){if(_0x158ebc[_0x458e('0xe')][_0x458e('0xf')]===0x1f4){logger[_0x458e('0xe')](_0x458e('0xb'),_0x2028f6,_0x158ebc['error'][_0x458e('0x10')]);return _0x50edc3(_0x158ebc[_0x458e('0xe')][_0x458e('0x10')]);}logger[_0x458e('0xe')](_0x458e('0xb'),_0x2028f6,_0x158ebc[_0x458e('0xe')]['message']);return _0x4e2383(_0x158ebc[_0x458e('0xe')][_0x458e('0x10')]);}else{logger['info'](_0x458e('0xb'),_0x2028f6,_0x458e('0xc'));_0x4e2383(_0x158ebc[_0x458e('0x11')][_0x458e('0x10')]);}})['catch'](function(_0x2de057){logger['error'](_0x458e('0xb'),_0x2028f6,_0x2de057);_0x50edc3(_0x2de057);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 3a7dd2a..2effbe7 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 _0x0bdd=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','put','update','delete','isAuthenticated','destroy','exports','util','connect-timeout','express'];(function(_0x32bbb1,_0xa0e27e){var _0x42b415=function(_0x23f4e2){while(--_0x23f4e2){_0x32bbb1['push'](_0x32bbb1['shift']());}};_0x42b415(++_0xa0e27e);}(_0x0bdd,0xa7));var _0xd0bd=function(_0x5215e6,_0x14c378){_0x5215e6=_0x5215e6-0x0;var _0x145c9c=_0x0bdd[_0x5215e6];return _0x145c9c;};'use strict';var multer=require('multer');var util=require(_0xd0bd('0x0'));var path=require('path');var timeout=require(_0xd0bd('0x1'));var express=require(_0xd0bd('0x2'));var router=express[_0xd0bd('0x3')]();var fs_extra=require(_0xd0bd('0x4'));var auth=require(_0xd0bd('0x5'));var interaction=require(_0xd0bd('0x6'));var config=require(_0xd0bd('0x7'));var controller=require('./chatApplication.controller');router[_0xd0bd('0x8')](_0xd0bd('0x9'),auth['isAuthenticated'](),controller[_0xd0bd('0xa')]);router[_0xd0bd('0xb')](_0xd0bd('0x9'),auth['isAuthenticated'](),controller[_0xd0bd('0xc')]);router[_0xd0bd('0xd')](_0xd0bd('0x9'),auth[_0xd0bd('0xe')](),controller[_0xd0bd('0xf')]);module[_0xd0bd('0x10')]=router;
\ No newline at end of file
+var _0x7b4a=['../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x43d42c,_0x463065){var _0x30bee9=function(_0x453f1c){while(--_0x453f1c){_0x43d42c['push'](_0x43d42c['shift']());}};_0x30bee9(++_0x463065);}(_0x7b4a,0x1df));var _0xa7b4=function(_0x3c3021,_0x189015){_0x3c3021=_0x3c3021-0x0;var _0x347432=_0x7b4a[_0x3c3021];return _0x347432;};'use strict';var multer=require(_0xa7b4('0x0'));var util=require('util');var path=require(_0xa7b4('0x1'));var timeout=require(_0xa7b4('0x2'));var express=require(_0xa7b4('0x3'));var router=express[_0xa7b4('0x4')]();var fs_extra=require(_0xa7b4('0x5'));var auth=require(_0xa7b4('0x6'));var interaction=require(_0xa7b4('0x7'));var config=require(_0xa7b4('0x8'));var controller=require(_0xa7b4('0x9'));router[_0xa7b4('0xa')](_0xa7b4('0xb'),auth[_0xa7b4('0xc')](),controller[_0xa7b4('0xd')]);router[_0xa7b4('0xe')](_0xa7b4('0xb'),auth['isAuthenticated'](),controller[_0xa7b4('0xf')]);router['delete'](_0xa7b4('0xb'),auth[_0xa7b4('0xc')](),controller[_0xa7b4('0x10')]);module[_0xa7b4('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 1aa028c..53b8f42 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 _0x7f59=['exports','STRING','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7f59,0x156));var _0x97f5=function(_0x4785fa,_0x5763b4){_0x4785fa=_0x4785fa-0x0;var _0x5cd6a2=_0x7f59[_0x4785fa];return _0x5cd6a2;};'use strict';var Sequelize=require('sequelize');module[_0x97f5('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x97f5('0x1')]},'write':{'type':Sequelize[_0x97f5('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xd9ce=['exports','STRING','BOOLEAN','sequelize'];(function(_0x296144,_0x26bbbf){var _0x5329b1=function(_0x5d321b){while(--_0x5d321b){_0x296144['push'](_0x296144['shift']());}};_0x5329b1(++_0x26bbbf);}(_0xd9ce,0xeb));var _0xed9c=function(_0x37fb3a,_0x5a14ee){_0x37fb3a=_0x37fb3a-0x0;var _0x1e5c8f=_0xd9ce[_0x37fb3a];return _0x1e5c8f;};'use strict';var Sequelize=require(_0xed9c('0x0'));module[_0xed9c('0x1')]={'name':{'type':Sequelize[_0xed9c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xed9c('0x2')]},'write':{'type':Sequelize[_0xed9c('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 63f701f..ee3b723 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 _0xbd19=['stack','name','send','index','ChatGroup','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','map','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','getUnread','user','addMembers','omit','ids','getMembers','findOne','length','removeMembers','getMessages','ChatInternalMessage','split','YYYY-MM-DD\x20HH:mm:ss','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','./chatGroup.socket','sendStatus','status','json','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error'];(function(_0x4459bd,_0x46c786){var _0x30fd4b=function(_0x461456){while(--_0x461456){_0x4459bd['push'](_0x4459bd['shift']());}};_0x30fd4b(++_0x46c786);}(_0xbd19,0x8c));var _0x9bd1=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xbd19[_0x35da42];return _0x370035;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9bd1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9bd1('0x1'));var rp=require(_0x9bd1('0x2'));var moment=require(_0x9bd1('0x3'));var BPromise=require(_0x9bd1('0x4'));var Mustache=require('mustache');var util=require(_0x9bd1('0x5'));var path=require('path');var sox=require(_0x9bd1('0x6'));var csv=require(_0x9bd1('0x7'));var ejs=require(_0x9bd1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9bd1('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9bd1('0xa'));var toCsv=require(_0x9bd1('0x7'));var querystring=require(_0x9bd1('0xb'));var Papa=require(_0x9bd1('0xc'));var Redis=require(_0x9bd1('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x9bd1('0xe'));var as=require(_0x9bd1('0xf'));var hardwareService=require(_0x9bd1('0x10'));var logger=require(_0x9bd1('0x11'))(_0x9bd1('0x12'));var utils=require(_0x9bd1('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9bd1('0x14'))['db'];config['redis']=_[_0x9bd1('0x15')](config[_0x9bd1('0x16')],{'host':_0x9bd1('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9bd1('0x16')]));require(_0x9bd1('0x18'))['register'](socket);function respondWithStatusCode(_0x25b51e,_0x312dd1){_0x312dd1=_0x312dd1||0xcc;return function(_0x3593bb){if(_0x3593bb){return _0x25b51e[_0x9bd1('0x19')](_0x312dd1);}return _0x25b51e['status'](_0x312dd1)['end']();};}function respondWithResult(_0x407c1a,_0x492474){_0x492474=_0x492474||0xc8;return function(_0xd2dab8){if(_0xd2dab8){return _0x407c1a[_0x9bd1('0x1a')](_0x492474)[_0x9bd1('0x1b')](_0xd2dab8);}};}function respondWithFilteredResult(_0x1da7f3,_0x483e6f){return function(_0x509167){if(_0x509167){var _0x1ffbd3=typeof _0x483e6f[_0x9bd1('0x1c')]==='undefined'&&typeof _0x483e6f['limit']==='undefined';var _0x3c4968=_0x509167[_0x9bd1('0x1d')];var _0x3fccc6=_0x1ffbd3?0x0:_0x483e6f[_0x9bd1('0x1c')];var _0x229dd5=_0x1ffbd3?_0x509167[_0x9bd1('0x1d')]:_0x483e6f[_0x9bd1('0x1c')]+_0x483e6f[_0x9bd1('0x1e')];var _0x57848f;if(_0x229dd5>=_0x3c4968){_0x229dd5=_0x3c4968;_0x57848f=0xc8;}else{_0x57848f=0xce;}_0x1da7f3['status'](_0x57848f);return _0x1da7f3[_0x9bd1('0x1f')](_0x9bd1('0x20'),_0x3fccc6+'-'+_0x229dd5+'/'+_0x3c4968)['json'](_0x509167);}return null;};}function patchUpdates(_0x61aa14){return function(_0x662c67){try{jsonpatch[_0x9bd1('0x21')](_0x662c67,_0x61aa14,!![]);}catch(_0x5700ec){return BPromise[_0x9bd1('0x22')](_0x5700ec);}return _0x662c67[_0x9bd1('0x23')]();};}function saveUpdates(_0x41310f,_0x4c4f64){return function(_0x4b2766){if(_0x4b2766){return _0x4b2766[_0x9bd1('0x24')](_0x41310f)['then'](function(_0x4b4bb2){return _0x4b4bb2;});}return null;};}function removeEntity(_0x5375e4,_0x184032){return function(_0x1fc6b3){if(_0x1fc6b3){return _0x1fc6b3[_0x9bd1('0x25')]()[_0x9bd1('0x26')](function(){_0x5375e4[_0x9bd1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x98f646,_0x43ba76){return function(_0x598fd1){if(!_0x598fd1){_0x98f646[_0x9bd1('0x19')](0x194);}return _0x598fd1;};}function handleError(_0xa202d,_0x287563){_0x287563=_0x287563||0x1f4;return function(_0xe0bb78){logger[_0x9bd1('0x27')](_0xe0bb78[_0x9bd1('0x28')]);if(_0xe0bb78[_0x9bd1('0x29')]){delete _0xe0bb78[_0x9bd1('0x29')];}_0xa202d[_0x9bd1('0x1a')](_0x287563)[_0x9bd1('0x2a')](_0xe0bb78);};}exports[_0x9bd1('0x2b')]=function(_0x4aabdb,_0x5d42ca){var _0x62ef82={},_0x43209e={},_0x507966={'count':0x0,'rows':[]};var _0x5c5af1=_['map'](db[_0x9bd1('0x2c')][_0x9bd1('0x2d')],function(_0x275f98){return{'name':_0x275f98[_0x9bd1('0x2e')],'type':_0x275f98['type'][_0x9bd1('0x2f')]};});_0x43209e[_0x9bd1('0x30')]=_['map'](_0x5c5af1,'name');_0x43209e[_0x9bd1('0x31')]=_[_0x9bd1('0x32')](_0x4aabdb['query']);_0x43209e[_0x9bd1('0x33')]=_['intersection'](_0x43209e[_0x9bd1('0x30')],_0x43209e['query']);_0x62ef82['attributes']=_[_0x9bd1('0x34')](_0x43209e[_0x9bd1('0x30')],qs[_0x9bd1('0x35')](_0x4aabdb['query'][_0x9bd1('0x35')]));_0x62ef82[_0x9bd1('0x36')]=_0x62ef82['attributes']['length']?_0x62ef82[_0x9bd1('0x36')]:_0x43209e['model'];if(!_0x4aabdb[_0x9bd1('0x31')][_0x9bd1('0x37')](_0x9bd1('0x38'))){_0x62ef82[_0x9bd1('0x1e')]=qs[_0x9bd1('0x1e')](_0x4aabdb[_0x9bd1('0x31')][_0x9bd1('0x1e')]);_0x62ef82[_0x9bd1('0x1c')]=qs['offset'](_0x4aabdb[_0x9bd1('0x31')]['offset']);}_0x62ef82[_0x9bd1('0x39')]=qs[_0x9bd1('0x3a')](_0x4aabdb[_0x9bd1('0x31')][_0x9bd1('0x3a')]);_0x62ef82['where']=qs[_0x9bd1('0x33')](_[_0x9bd1('0x3b')](_0x4aabdb[_0x9bd1('0x31')],_0x43209e[_0x9bd1('0x33')]),_0x5c5af1);if(_0x4aabdb['query']['filter']){_0x62ef82[_0x9bd1('0x3c')]=_[_0x9bd1('0x3d')](_0x62ef82[_0x9bd1('0x3c')],{'$or':_[_0x9bd1('0x3e')](_0x5c5af1,function(_0x3d78c2){if(_0x3d78c2[_0x9bd1('0x3f')]!==_0x9bd1('0x40')){var _0xdfad9f={};_0xdfad9f[_0x3d78c2['name']]={'$like':'%'+_0x4aabdb['query'][_0x9bd1('0x41')]+'%'};return _0xdfad9f;}})});}_0x62ef82=_[_0x9bd1('0x3d')]({},_0x62ef82,_0x4aabdb[_0x9bd1('0x42')]);var _0x5d24a4={'where':_0x62ef82[_0x9bd1('0x3c')]};return db[_0x9bd1('0x2c')][_0x9bd1('0x1d')](_0x5d24a4)['then'](function(_0x302503){_0x507966[_0x9bd1('0x1d')]=_0x302503;if(_0x4aabdb[_0x9bd1('0x31')][_0x9bd1('0x43')]){_0x62ef82[_0x9bd1('0x44')]=[{'all':!![]}];}return db[_0x9bd1('0x2c')][_0x9bd1('0x45')](_0x62ef82);})['then'](function(_0x46d26b){_0x507966[_0x9bd1('0x46')]=_0x46d26b;return _0x507966;})['then'](respondWithFilteredResult(_0x5d42ca,_0x62ef82))[_0x9bd1('0x47')](handleError(_0x5d42ca,null));};exports['show']=function(_0x5ed7e9,_0x233fe7){var _0x46f695={'raw':!![],'where':{'id':_0x5ed7e9['params']['id']}},_0x522de7={};_0x522de7[_0x9bd1('0x30')]=_[_0x9bd1('0x32')](db[_0x9bd1('0x2c')][_0x9bd1('0x2d')]);_0x522de7[_0x9bd1('0x31')]=_[_0x9bd1('0x32')](_0x5ed7e9[_0x9bd1('0x31')]);_0x522de7[_0x9bd1('0x33')]=_[_0x9bd1('0x34')](_0x522de7[_0x9bd1('0x30')],_0x522de7[_0x9bd1('0x31')]);_0x46f695[_0x9bd1('0x36')]=_[_0x9bd1('0x34')](_0x522de7[_0x9bd1('0x30')],qs[_0x9bd1('0x35')](_0x5ed7e9['query'][_0x9bd1('0x35')]));_0x46f695['attributes']=_0x46f695['attributes']['length']?_0x46f695[_0x9bd1('0x36')]:_0x522de7[_0x9bd1('0x30')];if(_0x5ed7e9[_0x9bd1('0x31')]['includeAll']){_0x46f695[_0x9bd1('0x44')]=[{'all':!![]}];}_0x46f695=_[_0x9bd1('0x3d')]({},_0x46f695,_0x5ed7e9[_0x9bd1('0x42')]);return db['ChatGroup'][_0x9bd1('0x48')](_0x46f695)[_0x9bd1('0x26')](handleEntityNotFound(_0x233fe7,null))[_0x9bd1('0x26')](respondWithResult(_0x233fe7,null))['catch'](handleError(_0x233fe7,null));};exports['create']=function(_0x24c676,_0x54c120){return db[_0x9bd1('0x2c')][_0x9bd1('0x49')](_0x24c676['body'],{})[_0x9bd1('0x26')](respondWithResult(_0x54c120,0xc9))[_0x9bd1('0x47')](handleError(_0x54c120,null));};exports[_0x9bd1('0x24')]=function(_0x3307f8,_0x2af2fc){if(_0x3307f8['body']['id']){delete _0x3307f8[_0x9bd1('0x4a')]['id'];}return db[_0x9bd1('0x2c')]['find']({'where':{'id':_0x3307f8[_0x9bd1('0x4b')]['id']}})[_0x9bd1('0x26')](handleEntityNotFound(_0x2af2fc,null))[_0x9bd1('0x26')](saveUpdates(_0x3307f8[_0x9bd1('0x4a')],null))[_0x9bd1('0x26')](respondWithResult(_0x2af2fc,null))[_0x9bd1('0x47')](handleError(_0x2af2fc,null));};exports['destroy']=function(_0x1b560c,_0x58c1b2){return db[_0x9bd1('0x2c')]['find']({'where':{'id':_0x1b560c[_0x9bd1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x58c1b2,null))[_0x9bd1('0x26')](removeEntity(_0x58c1b2,null))[_0x9bd1('0x47')](handleError(_0x58c1b2,null));};exports[_0x9bd1('0x4c')]=function(_0x380279,_0x559395){return db[_0x9bd1('0x2c')][_0x9bd1('0x4c')]()[_0x9bd1('0x26')](respondWithResult(_0x559395,null))[_0x9bd1('0x47')](handleError(_0x559395,null));};exports[_0x9bd1('0x4d')]=function(_0x2aca7a,_0x454feb,_0x5b2adc){return db['ChatInternalMessage'][_0x9bd1('0x1d')]({'where':{'ChatGroupId':_0x2aca7a[_0x9bd1('0x4b')]['id'],'ToId':_0x2aca7a[_0x9bd1('0x4e')]['id'],'read':![]}})[_0x9bd1('0x26')](function(_0x1f3eb7){return{'id':_['toInteger'](_0x2aca7a[_0x9bd1('0x4b')]['id']),'count':_0x1f3eb7};})[_0x9bd1('0x26')](respondWithResult(_0x454feb,null))['catch'](handleError(_0x454feb,null));};exports[_0x9bd1('0x4f')]=function(_0x578aa9,_0x1f888f,_0x2ef8c6){return db[_0x9bd1('0x2c')][_0x9bd1('0x48')]({'where':{'id':_0x578aa9[_0x9bd1('0x4b')]['id']}})[_0x9bd1('0x26')](handleEntityNotFound(_0x1f888f,null))[_0x9bd1('0x26')](function(_0x407e20){if(_0x407e20){return _0x407e20[_0x9bd1('0x4f')](_0x578aa9[_0x9bd1('0x4a')]['ids'],_[_0x9bd1('0x50')](_0x578aa9['body'],[_0x9bd1('0x51'),'id'])||{});}})[_0x9bd1('0x26')](respondWithResult(_0x1f888f,null))[_0x9bd1('0x47')](handleError(_0x1f888f,null));};exports[_0x9bd1('0x52')]=function(_0x1f49ad,_0x4af848,_0x4ede62){var _0x2080df={};var _0x39d2b6={};var _0x36c2a2;var _0x520193;return db[_0x9bd1('0x2c')][_0x9bd1('0x53')]({'where':{'id':_0x1f49ad[_0x9bd1('0x4b')]['id']}})[_0x9bd1('0x26')](handleEntityNotFound(_0x4af848,null))[_0x9bd1('0x26')](function(_0x549a33){if(_0x549a33){_0x36c2a2=_0x549a33;_0x39d2b6['model']=_[_0x9bd1('0x32')](db['User'][_0x9bd1('0x2d')]);_0x39d2b6[_0x9bd1('0x31')]=_[_0x9bd1('0x32')](_0x1f49ad[_0x9bd1('0x31')]);_0x39d2b6[_0x9bd1('0x33')]=_[_0x9bd1('0x34')](_0x39d2b6[_0x9bd1('0x30')],_0x39d2b6[_0x9bd1('0x31')]);_0x2080df[_0x9bd1('0x36')]=_[_0x9bd1('0x34')](_0x39d2b6[_0x9bd1('0x30')],qs[_0x9bd1('0x35')](_0x1f49ad[_0x9bd1('0x31')][_0x9bd1('0x35')]));_0x2080df[_0x9bd1('0x36')]=_0x2080df[_0x9bd1('0x36')][_0x9bd1('0x54')]?_0x2080df[_0x9bd1('0x36')]:_0x39d2b6['model'];_0x2080df[_0x9bd1('0x39')]=qs[_0x9bd1('0x3a')](_0x1f49ad[_0x9bd1('0x31')][_0x9bd1('0x3a')]);_0x2080df[_0x9bd1('0x3c')]=qs[_0x9bd1('0x33')](_[_0x9bd1('0x3b')](_0x1f49ad[_0x9bd1('0x31')],_0x39d2b6[_0x9bd1('0x33')]));if(_0x1f49ad[_0x9bd1('0x31')][_0x9bd1('0x41')]){_0x2080df[_0x9bd1('0x3c')]=_[_0x9bd1('0x3d')](_0x2080df[_0x9bd1('0x3c')],{'$or':_['map'](_0x2080df[_0x9bd1('0x36')],function(_0x4a1513){var _0x53230a={};_0x53230a[_0x4a1513]={'$like':'%'+_0x1f49ad['query'][_0x9bd1('0x41')]+'%'};return _0x53230a;})});}_0x2080df=_[_0x9bd1('0x3d')]({},_0x2080df,_0x1f49ad[_0x9bd1('0x42')]);return _0x36c2a2[_0x9bd1('0x52')](_0x2080df);}})[_0x9bd1('0x26')](function(_0x2e1312){if(_0x2e1312){_0x520193=_0x2e1312['length'];if(!_0x1f49ad[_0x9bd1('0x31')]['hasOwnProperty']('nolimit')){_0x2080df['limit']=qs[_0x9bd1('0x1e')](_0x1f49ad[_0x9bd1('0x31')][_0x9bd1('0x1e')]);_0x2080df['offset']=qs[_0x9bd1('0x1c')](_0x1f49ad[_0x9bd1('0x31')][_0x9bd1('0x1c')]);}return _0x36c2a2[_0x9bd1('0x52')](_0x2080df);}})[_0x9bd1('0x26')](function(_0x4c8c90){if(_0x4c8c90){return _0x4c8c90?{'count':_0x520193,'rows':_0x4c8c90}:null;}})[_0x9bd1('0x26')](respondWithResult(_0x4af848,null))['catch'](handleError(_0x4af848,null));};exports[_0x9bd1('0x55')]=function(_0x323f87,_0x4c4e60,_0x49853f){return db[_0x9bd1('0x2c')][_0x9bd1('0x48')]({'where':{'id':_0x323f87[_0x9bd1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4c4e60,null))['then'](function(_0x1735c3){if(_0x1735c3){return _0x1735c3[_0x9bd1('0x55')](_0x323f87[_0x9bd1('0x31')][_0x9bd1('0x51')]);}})[_0x9bd1('0x26')](respondWithStatusCode(_0x4c4e60,null))[_0x9bd1('0x47')](handleError(_0x4c4e60,null));};exports['addMessage']=function(_0x3c7d33,_0x45d1,_0x4335fe){if(_0x3c7d33[_0x9bd1('0x4a')]['id']){delete _0x3c7d33[_0x9bd1('0x4a')]['id'];}return db[_0x9bd1('0x2c')]['find']({'where':{'id':_0x3c7d33[_0x9bd1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x45d1,null))[_0x9bd1('0x26')](function(_0x361ba5){if(_0x361ba5){_0x3c7d33[_0x9bd1('0x4a')]['ChatGroupId']=_0x361ba5['id'];return db['ChatInternalMessage'][_0x9bd1('0x49')](_0x3c7d33['body']);}})[_0x9bd1('0x26')](respondWithResult(_0x45d1,null))[_0x9bd1('0x47')](handleError(_0x45d1,null));};exports[_0x9bd1('0x56')]=function(_0x2b1ce1,_0x104db1,_0x5b40ce){var _0x20392e={};var _0x324cef={};var _0x461444;var _0x1783c5;return db[_0x9bd1('0x2c')]['findOne']({'where':{'id':_0x2b1ce1[_0x9bd1('0x4b')]['id']}})[_0x9bd1('0x26')](handleEntityNotFound(_0x104db1,null))[_0x9bd1('0x26')](function(_0x501da5){if(_0x501da5){_0x461444=_0x501da5;_0x324cef[_0x9bd1('0x30')]=_['keys'](db[_0x9bd1('0x57')]['rawAttributes']);_0x324cef['query']=_['keys'](_0x2b1ce1[_0x9bd1('0x31')]);_0x324cef[_0x9bd1('0x33')]=_[_0x9bd1('0x34')](_0x324cef[_0x9bd1('0x30')],_0x324cef[_0x9bd1('0x31')]);_0x20392e['attributes']=_[_0x9bd1('0x34')](_0x324cef['model'],qs[_0x9bd1('0x35')](_0x2b1ce1['query'][_0x9bd1('0x35')]));_0x20392e[_0x9bd1('0x36')]=_0x20392e[_0x9bd1('0x36')][_0x9bd1('0x54')]?_0x20392e[_0x9bd1('0x36')]:_0x324cef[_0x9bd1('0x30')];_0x20392e[_0x9bd1('0x39')]=qs[_0x9bd1('0x3a')](_0x2b1ce1[_0x9bd1('0x31')][_0x9bd1('0x3a')]);_0x20392e[_0x9bd1('0x3c')]=qs[_0x9bd1('0x33')](_['pick'](_0x2b1ce1[_0x9bd1('0x31')],_0x324cef[_0x9bd1('0x33')]));if(_0x2b1ce1['query'][_0x9bd1('0x41')]){_0x20392e['where']=_[_0x9bd1('0x3d')](_0x20392e['where'],{'$or':_[_0x9bd1('0x3e')](_0x20392e[_0x9bd1('0x36')],function(_0x120416){var _0x2a0ba2={};_0x2a0ba2[_0x120416]={'$like':'%'+_0x2b1ce1[_0x9bd1('0x31')][_0x9bd1('0x41')]+'%'};return _0x2a0ba2;})});}if(_0x2b1ce1['query']['$gte']){var _0x2c1f6c=_0x2b1ce1[_0x9bd1('0x31')]['$gte'][_0x9bd1('0x58')](',');var _0x4f165f={};_0x4f165f[_0x2c1f6c[0x0]]={'$gte':moment(_0x2c1f6c[0x1])['format'](_0x9bd1('0x59'))};_0x20392e[_0x9bd1('0x3c')]=_['merge'](_0x20392e[_0x9bd1('0x3c')],_0x4f165f);}_0x20392e=_[_0x9bd1('0x3d')]({},_0x20392e,_0x2b1ce1['options']);return _0x461444['getMessages'](_0x20392e);}})[_0x9bd1('0x26')](function(_0x560710){if(_0x560710){_0x1783c5=_0x560710[_0x9bd1('0x54')];if(!_0x2b1ce1[_0x9bd1('0x31')][_0x9bd1('0x37')](_0x9bd1('0x38'))){_0x20392e['limit']=qs[_0x9bd1('0x1e')](_0x2b1ce1[_0x9bd1('0x31')][_0x9bd1('0x1e')]);_0x20392e[_0x9bd1('0x1c')]=qs[_0x9bd1('0x1c')](_0x2b1ce1['query']['offset']);}return _0x461444['getMessages'](_0x20392e);}})[_0x9bd1('0x26')](function(_0x2d2b77){if(_0x2d2b77){return _0x2d2b77?{'count':_0x1783c5,'rows':_0x2d2b77}:null;}})[_0x9bd1('0x26')](respondWithResult(_0x104db1,null))[_0x9bd1('0x47')](handleError(_0x104db1,null));};
\ No newline at end of file
+var _0x5e4e=['removeMembers','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','ChatGroup','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','catch','rawAttributes','find','create','body','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne'];(function(_0x2dab5a,_0xb1fc8d){var _0x1f4e38=function(_0x47a7df){while(--_0x47a7df){_0x2dab5a['push'](_0x2dab5a['shift']());}};_0x1f4e38(++_0xb1fc8d);}(_0x5e4e,0xbf));var _0xe5e4=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x5e4e[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xe5e4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe5e4('0x1'));var jsonpatch=require(_0xe5e4('0x2'));var rp=require(_0xe5e4('0x3'));var moment=require('moment');var BPromise=require(_0xe5e4('0x4'));var Mustache=require(_0xe5e4('0x5'));var util=require(_0xe5e4('0x6'));var path=require(_0xe5e4('0x7'));var sox=require(_0xe5e4('0x8'));var csv=require(_0xe5e4('0x9'));var ejs=require(_0xe5e4('0xa'));var fs=require('fs');var fs_extra=require(_0xe5e4('0xb'));var _=require(_0xe5e4('0xc'));var squel=require(_0xe5e4('0xd'));var crypto=require(_0xe5e4('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe5e4('0xf'));var toCsv=require(_0xe5e4('0x9'));var querystring=require('querystring');var Papa=require(_0xe5e4('0x10'));var Redis=require(_0xe5e4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe5e4('0x12'));var as=require(_0xe5e4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5e4('0x14'))(_0xe5e4('0x15'));var utils=require(_0xe5e4('0x16'));var config=require(_0xe5e4('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xe5e4('0x18')]=_['defaults'](config[_0xe5e4('0x18')],{'host':_0xe5e4('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe5e4('0x18')]));require('./chatGroup.socket')[_0xe5e4('0x1a')](socket);function respondWithStatusCode(_0x48a0a4,_0x5c5953){_0x5c5953=_0x5c5953||0xcc;return function(_0x29fcab){if(_0x29fcab){return _0x48a0a4[_0xe5e4('0x1b')](_0x5c5953);}return _0x48a0a4[_0xe5e4('0x1c')](_0x5c5953)[_0xe5e4('0x1d')]();};}function respondWithResult(_0x149930,_0x2683b8){_0x2683b8=_0x2683b8||0xc8;return function(_0x1f9c72){if(_0x1f9c72){return _0x149930['status'](_0x2683b8)[_0xe5e4('0x1e')](_0x1f9c72);}};}function respondWithFilteredResult(_0x4f6b18,_0x2519a7){return function(_0x4cf0bd){if(_0x4cf0bd){var _0x4f18b3=typeof _0x2519a7[_0xe5e4('0x1f')]==='undefined'&&typeof _0x2519a7[_0xe5e4('0x20')]==='undefined';var _0x467cb1=_0x4cf0bd[_0xe5e4('0x21')];var _0x489aae=_0x4f18b3?0x0:_0x2519a7['offset'];var _0x31637d=_0x4f18b3?_0x4cf0bd[_0xe5e4('0x21')]:_0x2519a7[_0xe5e4('0x1f')]+_0x2519a7['limit'];var _0x19c6a4;if(_0x31637d>=_0x467cb1){_0x31637d=_0x467cb1;_0x19c6a4=0xc8;}else{_0x19c6a4=0xce;}_0x4f6b18['status'](_0x19c6a4);return _0x4f6b18[_0xe5e4('0x22')](_0xe5e4('0x23'),_0x489aae+'-'+_0x31637d+'/'+_0x467cb1)[_0xe5e4('0x1e')](_0x4cf0bd);}return null;};}function patchUpdates(_0x50ffcc){return function(_0x598418){try{jsonpatch[_0xe5e4('0x24')](_0x598418,_0x50ffcc,!![]);}catch(_0x5d7929){return BPromise[_0xe5e4('0x25')](_0x5d7929);}return _0x598418['save']();};}function saveUpdates(_0x285f2e,_0x30e1a8){return function(_0x35c0c5){if(_0x35c0c5){return _0x35c0c5[_0xe5e4('0x26')](_0x285f2e)[_0xe5e4('0x27')](function(_0xf4f9c1){return _0xf4f9c1;});}return null;};}function removeEntity(_0x3f567c,_0x738b8){return function(_0x1cf725){if(_0x1cf725){return _0x1cf725[_0xe5e4('0x28')]()[_0xe5e4('0x27')](function(){_0x3f567c[_0xe5e4('0x1c')](0xcc)[_0xe5e4('0x1d')]();});}};}function handleEntityNotFound(_0xd1d437,_0x4146de){return function(_0x1ad134){if(!_0x1ad134){_0xd1d437[_0xe5e4('0x1b')](0x194);}return _0x1ad134;};}function handleError(_0x1d260b,_0x3ba9e2){_0x3ba9e2=_0x3ba9e2||0x1f4;return function(_0x3252d6){logger[_0xe5e4('0x29')](_0x3252d6[_0xe5e4('0x2a')]);if(_0x3252d6[_0xe5e4('0x2b')]){delete _0x3252d6[_0xe5e4('0x2b')];}_0x1d260b[_0xe5e4('0x1c')](_0x3ba9e2)['send'](_0x3252d6);};}exports[_0xe5e4('0x2c')]=function(_0x1ffa81,_0x4c94eb){var _0x74a51f={},_0x2783ac={},_0x5aa1ec={'count':0x0,'rows':[]};var _0x3f4f33=_[_0xe5e4('0x2d')](db[_0xe5e4('0x2e')]['rawAttributes'],function(_0x20f83c){return{'name':_0x20f83c[_0xe5e4('0x2f')],'type':_0x20f83c[_0xe5e4('0x30')][_0xe5e4('0x31')]};});_0x2783ac[_0xe5e4('0x32')]=_[_0xe5e4('0x2d')](_0x3f4f33,_0xe5e4('0x2b'));_0x2783ac[_0xe5e4('0x33')]=_[_0xe5e4('0x34')](_0x1ffa81[_0xe5e4('0x33')]);_0x2783ac['filters']=_['intersection'](_0x2783ac[_0xe5e4('0x32')],_0x2783ac[_0xe5e4('0x33')]);_0x74a51f[_0xe5e4('0x35')]=_[_0xe5e4('0x36')](_0x2783ac[_0xe5e4('0x32')],qs[_0xe5e4('0x37')](_0x1ffa81['query'][_0xe5e4('0x37')]));_0x74a51f[_0xe5e4('0x35')]=_0x74a51f[_0xe5e4('0x35')][_0xe5e4('0x38')]?_0x74a51f['attributes']:_0x2783ac[_0xe5e4('0x32')];if(!_0x1ffa81['query'][_0xe5e4('0x39')](_0xe5e4('0x3a'))){_0x74a51f[_0xe5e4('0x20')]=qs['limit'](_0x1ffa81[_0xe5e4('0x33')][_0xe5e4('0x20')]);_0x74a51f['offset']=qs[_0xe5e4('0x1f')](_0x1ffa81['query'][_0xe5e4('0x1f')]);}_0x74a51f[_0xe5e4('0x3b')]=qs[_0xe5e4('0x3c')](_0x1ffa81[_0xe5e4('0x33')][_0xe5e4('0x3c')]);_0x74a51f['where']=qs[_0xe5e4('0x3d')](_[_0xe5e4('0x3e')](_0x1ffa81['query'],_0x2783ac[_0xe5e4('0x3d')]),_0x3f4f33);if(_0x1ffa81[_0xe5e4('0x33')][_0xe5e4('0x3f')]){_0x74a51f['where']=_[_0xe5e4('0x40')](_0x74a51f[_0xe5e4('0x41')],{'$or':_[_0xe5e4('0x2d')](_0x3f4f33,function(_0x8a65f){if(_0x8a65f[_0xe5e4('0x30')]!==_0xe5e4('0x42')){var _0x34a5de={};_0x34a5de[_0x8a65f[_0xe5e4('0x2b')]]={'$like':'%'+_0x1ffa81['query'][_0xe5e4('0x3f')]+'%'};return _0x34a5de;}})});}_0x74a51f=_['merge']({},_0x74a51f,_0x1ffa81[_0xe5e4('0x43')]);var _0x4bc367={'where':_0x74a51f[_0xe5e4('0x41')]};return db[_0xe5e4('0x2e')][_0xe5e4('0x21')](_0x4bc367)[_0xe5e4('0x27')](function(_0x38e8f5){_0x5aa1ec[_0xe5e4('0x21')]=_0x38e8f5;if(_0x1ffa81[_0xe5e4('0x33')][_0xe5e4('0x44')]){_0x74a51f[_0xe5e4('0x45')]=[{'all':!![]}];}return db[_0xe5e4('0x2e')]['findAll'](_0x74a51f);})[_0xe5e4('0x27')](function(_0x5ae0ee){_0x5aa1ec['rows']=_0x5ae0ee;return _0x5aa1ec;})[_0xe5e4('0x27')](respondWithFilteredResult(_0x4c94eb,_0x74a51f))[_0xe5e4('0x46')](handleError(_0x4c94eb,null));};exports['show']=function(_0x33bd3f,_0x2d1be0){var _0x3b5b6b={'raw':!![],'where':{'id':_0x33bd3f['params']['id']}},_0x14a2e9={};_0x14a2e9[_0xe5e4('0x32')]=_[_0xe5e4('0x34')](db[_0xe5e4('0x2e')][_0xe5e4('0x47')]);_0x14a2e9['query']=_['keys'](_0x33bd3f[_0xe5e4('0x33')]);_0x14a2e9['filters']=_[_0xe5e4('0x36')](_0x14a2e9[_0xe5e4('0x32')],_0x14a2e9[_0xe5e4('0x33')]);_0x3b5b6b[_0xe5e4('0x35')]=_['intersection'](_0x14a2e9['model'],qs[_0xe5e4('0x37')](_0x33bd3f[_0xe5e4('0x33')][_0xe5e4('0x37')]));_0x3b5b6b[_0xe5e4('0x35')]=_0x3b5b6b[_0xe5e4('0x35')][_0xe5e4('0x38')]?_0x3b5b6b['attributes']:_0x14a2e9[_0xe5e4('0x32')];if(_0x33bd3f['query'][_0xe5e4('0x44')]){_0x3b5b6b[_0xe5e4('0x45')]=[{'all':!![]}];}_0x3b5b6b=_[_0xe5e4('0x40')]({},_0x3b5b6b,_0x33bd3f['options']);return db[_0xe5e4('0x2e')][_0xe5e4('0x48')](_0x3b5b6b)[_0xe5e4('0x27')](handleEntityNotFound(_0x2d1be0,null))['then'](respondWithResult(_0x2d1be0,null))['catch'](handleError(_0x2d1be0,null));};exports['create']=function(_0x44ec4b,_0x3948a3){return db[_0xe5e4('0x2e')][_0xe5e4('0x49')](_0x44ec4b[_0xe5e4('0x4a')],{})['then'](respondWithResult(_0x3948a3,0xc9))['catch'](handleError(_0x3948a3,null));};exports[_0xe5e4('0x26')]=function(_0x4a0081,_0x269434){if(_0x4a0081[_0xe5e4('0x4a')]['id']){delete _0x4a0081[_0xe5e4('0x4a')]['id'];}return db[_0xe5e4('0x2e')][_0xe5e4('0x48')]({'where':{'id':_0x4a0081[_0xe5e4('0x4b')]['id']}})[_0xe5e4('0x27')](handleEntityNotFound(_0x269434,null))[_0xe5e4('0x27')](saveUpdates(_0x4a0081['body'],null))[_0xe5e4('0x27')](respondWithResult(_0x269434,null))[_0xe5e4('0x46')](handleError(_0x269434,null));};exports[_0xe5e4('0x28')]=function(_0x436457,_0x399970){return db[_0xe5e4('0x2e')][_0xe5e4('0x48')]({'where':{'id':_0x436457[_0xe5e4('0x4b')]['id']}})[_0xe5e4('0x27')](handleEntityNotFound(_0x399970,null))[_0xe5e4('0x27')](removeEntity(_0x399970,null))[_0xe5e4('0x46')](handleError(_0x399970,null));};exports[_0xe5e4('0x4c')]=function(_0x416f87,_0x21efe7){return db[_0xe5e4('0x2e')][_0xe5e4('0x4c')]()[_0xe5e4('0x27')](respondWithResult(_0x21efe7,null))[_0xe5e4('0x46')](handleError(_0x21efe7,null));};exports[_0xe5e4('0x4d')]=function(_0xe9cf34,_0x5d0baa,_0x1d9c95){return db[_0xe5e4('0x4e')][_0xe5e4('0x21')]({'where':{'ChatGroupId':_0xe9cf34['params']['id'],'ToId':_0xe9cf34[_0xe5e4('0x4f')]['id'],'read':![]}})[_0xe5e4('0x27')](function(_0x1488c3){return{'id':_[_0xe5e4('0x50')](_0xe9cf34['params']['id']),'count':_0x1488c3};})['then'](respondWithResult(_0x5d0baa,null))[_0xe5e4('0x46')](handleError(_0x5d0baa,null));};exports[_0xe5e4('0x51')]=function(_0x89e5f9,_0x325732,_0x23e2a){return db['ChatGroup'][_0xe5e4('0x48')]({'where':{'id':_0x89e5f9[_0xe5e4('0x4b')]['id']}})[_0xe5e4('0x27')](handleEntityNotFound(_0x325732,null))[_0xe5e4('0x27')](function(_0x3fe061){if(_0x3fe061){return _0x3fe061[_0xe5e4('0x51')](_0x89e5f9[_0xe5e4('0x4a')]['ids'],_['omit'](_0x89e5f9['body'],[_0xe5e4('0x52'),'id'])||{});}})[_0xe5e4('0x27')](respondWithResult(_0x325732,null))['catch'](handleError(_0x325732,null));};exports[_0xe5e4('0x53')]=function(_0x5ad69b,_0x38b1fc,_0x3d8f52){var _0x446cd7={};var _0xbc93fa={};var _0x27218a;var _0x556abe;return db[_0xe5e4('0x2e')][_0xe5e4('0x54')]({'where':{'id':_0x5ad69b[_0xe5e4('0x4b')]['id']}})[_0xe5e4('0x27')](handleEntityNotFound(_0x38b1fc,null))['then'](function(_0xc88923){if(_0xc88923){_0x27218a=_0xc88923;_0xbc93fa[_0xe5e4('0x32')]=_[_0xe5e4('0x34')](db['User'][_0xe5e4('0x47')]);_0xbc93fa[_0xe5e4('0x33')]=_[_0xe5e4('0x34')](_0x5ad69b[_0xe5e4('0x33')]);_0xbc93fa[_0xe5e4('0x3d')]=_[_0xe5e4('0x36')](_0xbc93fa[_0xe5e4('0x32')],_0xbc93fa[_0xe5e4('0x33')]);_0x446cd7[_0xe5e4('0x35')]=_['intersection'](_0xbc93fa[_0xe5e4('0x32')],qs[_0xe5e4('0x37')](_0x5ad69b[_0xe5e4('0x33')][_0xe5e4('0x37')]));_0x446cd7[_0xe5e4('0x35')]=_0x446cd7['attributes']['length']?_0x446cd7[_0xe5e4('0x35')]:_0xbc93fa[_0xe5e4('0x32')];_0x446cd7[_0xe5e4('0x3b')]=qs['sort'](_0x5ad69b[_0xe5e4('0x33')][_0xe5e4('0x3c')]);_0x446cd7[_0xe5e4('0x41')]=qs[_0xe5e4('0x3d')](_[_0xe5e4('0x3e')](_0x5ad69b[_0xe5e4('0x33')],_0xbc93fa[_0xe5e4('0x3d')]));if(_0x5ad69b[_0xe5e4('0x33')]['filter']){_0x446cd7[_0xe5e4('0x41')]=_[_0xe5e4('0x40')](_0x446cd7['where'],{'$or':_[_0xe5e4('0x2d')](_0x446cd7[_0xe5e4('0x35')],function(_0x2be762){var _0x165ca0={};_0x165ca0[_0x2be762]={'$like':'%'+_0x5ad69b[_0xe5e4('0x33')]['filter']+'%'};return _0x165ca0;})});}_0x446cd7=_[_0xe5e4('0x40')]({},_0x446cd7,_0x5ad69b[_0xe5e4('0x43')]);return _0x27218a[_0xe5e4('0x53')](_0x446cd7);}})[_0xe5e4('0x27')](function(_0x225fb7){if(_0x225fb7){_0x556abe=_0x225fb7[_0xe5e4('0x38')];if(!_0x5ad69b[_0xe5e4('0x33')][_0xe5e4('0x39')](_0xe5e4('0x3a'))){_0x446cd7[_0xe5e4('0x20')]=qs[_0xe5e4('0x20')](_0x5ad69b[_0xe5e4('0x33')][_0xe5e4('0x20')]);_0x446cd7[_0xe5e4('0x1f')]=qs['offset'](_0x5ad69b[_0xe5e4('0x33')][_0xe5e4('0x1f')]);}return _0x27218a[_0xe5e4('0x53')](_0x446cd7);}})[_0xe5e4('0x27')](function(_0x3308d9){if(_0x3308d9){return _0x3308d9?{'count':_0x556abe,'rows':_0x3308d9}:null;}})[_0xe5e4('0x27')](respondWithResult(_0x38b1fc,null))[_0xe5e4('0x46')](handleError(_0x38b1fc,null));};exports['removeMembers']=function(_0x4a8a68,_0x51709a,_0x48e8c2){return db[_0xe5e4('0x2e')][_0xe5e4('0x48')]({'where':{'id':_0x4a8a68[_0xe5e4('0x4b')]['id']}})[_0xe5e4('0x27')](handleEntityNotFound(_0x51709a,null))[_0xe5e4('0x27')](function(_0x2976af){if(_0x2976af){return _0x2976af[_0xe5e4('0x55')](_0x4a8a68[_0xe5e4('0x33')][_0xe5e4('0x52')]);}})[_0xe5e4('0x27')](respondWithStatusCode(_0x51709a,null))[_0xe5e4('0x46')](handleError(_0x51709a,null));};exports['addMessage']=function(_0x281758,_0x1f2c44,_0x4e7fbf){if(_0x281758[_0xe5e4('0x4a')]['id']){delete _0x281758['body']['id'];}return db[_0xe5e4('0x2e')]['find']({'where':{'id':_0x281758[_0xe5e4('0x4b')]['id']}})[_0xe5e4('0x27')](handleEntityNotFound(_0x1f2c44,null))[_0xe5e4('0x27')](function(_0x208f3a){if(_0x208f3a){_0x281758['body'][_0xe5e4('0x56')]=_0x208f3a['id'];return db['ChatInternalMessage'][_0xe5e4('0x49')](_0x281758[_0xe5e4('0x4a')]);}})[_0xe5e4('0x27')](respondWithResult(_0x1f2c44,null))[_0xe5e4('0x46')](handleError(_0x1f2c44,null));};exports[_0xe5e4('0x57')]=function(_0x2f7426,_0x39b419,_0x4aad5a){var _0x46e8fb={};var _0x376f72={};var _0x120a33;var _0x5ec36c;return db[_0xe5e4('0x2e')][_0xe5e4('0x54')]({'where':{'id':_0x2f7426[_0xe5e4('0x4b')]['id']}})[_0xe5e4('0x27')](handleEntityNotFound(_0x39b419,null))['then'](function(_0x2df7fa){if(_0x2df7fa){_0x120a33=_0x2df7fa;_0x376f72[_0xe5e4('0x32')]=_[_0xe5e4('0x34')](db[_0xe5e4('0x4e')][_0xe5e4('0x47')]);_0x376f72[_0xe5e4('0x33')]=_[_0xe5e4('0x34')](_0x2f7426[_0xe5e4('0x33')]);_0x376f72[_0xe5e4('0x3d')]=_['intersection'](_0x376f72[_0xe5e4('0x32')],_0x376f72[_0xe5e4('0x33')]);_0x46e8fb[_0xe5e4('0x35')]=_[_0xe5e4('0x36')](_0x376f72[_0xe5e4('0x32')],qs[_0xe5e4('0x37')](_0x2f7426[_0xe5e4('0x33')][_0xe5e4('0x37')]));_0x46e8fb[_0xe5e4('0x35')]=_0x46e8fb[_0xe5e4('0x35')][_0xe5e4('0x38')]?_0x46e8fb['attributes']:_0x376f72[_0xe5e4('0x32')];_0x46e8fb[_0xe5e4('0x3b')]=qs[_0xe5e4('0x3c')](_0x2f7426[_0xe5e4('0x33')][_0xe5e4('0x3c')]);_0x46e8fb[_0xe5e4('0x41')]=qs[_0xe5e4('0x3d')](_[_0xe5e4('0x3e')](_0x2f7426[_0xe5e4('0x33')],_0x376f72[_0xe5e4('0x3d')]));if(_0x2f7426[_0xe5e4('0x33')][_0xe5e4('0x3f')]){_0x46e8fb[_0xe5e4('0x41')]=_['merge'](_0x46e8fb[_0xe5e4('0x41')],{'$or':_[_0xe5e4('0x2d')](_0x46e8fb[_0xe5e4('0x35')],function(_0x21f467){var _0x538ab3={};_0x538ab3[_0x21f467]={'$like':'%'+_0x2f7426['query'][_0xe5e4('0x3f')]+'%'};return _0x538ab3;})});}if(_0x2f7426[_0xe5e4('0x33')]['$gte']){var _0x5579be=_0x2f7426[_0xe5e4('0x33')][_0xe5e4('0x58')][_0xe5e4('0x59')](',');var _0x2dde0c={};_0x2dde0c[_0x5579be[0x0]]={'$gte':moment(_0x5579be[0x1])[_0xe5e4('0x5a')](_0xe5e4('0x5b'))};_0x46e8fb[_0xe5e4('0x41')]=_[_0xe5e4('0x40')](_0x46e8fb[_0xe5e4('0x41')],_0x2dde0c);}_0x46e8fb=_['merge']({},_0x46e8fb,_0x2f7426['options']);return _0x120a33[_0xe5e4('0x57')](_0x46e8fb);}})['then'](function(_0x5504fe){if(_0x5504fe){_0x5ec36c=_0x5504fe[_0xe5e4('0x38')];if(!_0x2f7426[_0xe5e4('0x33')][_0xe5e4('0x39')](_0xe5e4('0x3a'))){_0x46e8fb[_0xe5e4('0x20')]=qs[_0xe5e4('0x20')](_0x2f7426[_0xe5e4('0x33')][_0xe5e4('0x20')]);_0x46e8fb[_0xe5e4('0x1f')]=qs['offset'](_0x2f7426[_0xe5e4('0x33')][_0xe5e4('0x1f')]);}return _0x120a33[_0xe5e4('0x57')](_0x46e8fb);}})[_0xe5e4('0x27')](function(_0x94d389){if(_0x94d389){return _0x94d389?{'count':_0x5ec36c,'rows':_0x94d389}:null;}})[_0xe5e4('0x27')](respondWithResult(_0x39b419,null))['catch'](handleError(_0x39b419,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index bc2b6cd..ff51591 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 _0x8294=['../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty','hook','events'];(function(_0x2fcd0c,_0x3fe101){var _0x19c93d=function(_0xd2faae){while(--_0xd2faae){_0x2fcd0c['push'](_0x2fcd0c['shift']());}};_0x19c93d(++_0x3fe101);}(_0x8294,0x1c6));var _0x4829=function(_0x706786,_0x53f40f){_0x706786=_0x706786-0x0;var _0x10d2ae=_0x8294[_0x706786];return _0x10d2ae;};'use strict';var EventEmitter=require(_0x4829('0x0'));var ChatGroup=require(_0x4829('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x4829('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4829('0x3')};function emitEvent(_0x31c3ac){return function(_0x27a714,_0x494a7d,_0x1cbde3){ChatGroupEvents['emit'](_0x31c3ac+':'+_0x27a714['id'],_0x27a714);ChatGroupEvents[_0x4829('0x4')](_0x31c3ac,_0x27a714);_0x1cbde3(null);};}for(var e in events){if(events[_0x4829('0x5')](e)){var event=events[e];ChatGroup[_0x4829('0x6')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x3c8e=['hook','exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x49bd3e,_0x2e6e2d){var _0x247ba6=function(_0x46a7d1){while(--_0x46a7d1){_0x49bd3e['push'](_0x49bd3e['shift']());}};_0x247ba6(++_0x2e6e2d);}(_0x3c8e,0x89));var _0xe3c8=function(_0x269ab2,_0x5e2aa0){_0x269ab2=_0x269ab2-0x0;var _0x16a0f8=_0x3c8e[_0x269ab2];return _0x16a0f8;};'use strict';var EventEmitter=require(_0xe3c8('0x0'));var ChatGroup=require(_0xe3c8('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe3c8('0x2'),'afterUpdate':_0xe3c8('0x3'),'afterDestroy':_0xe3c8('0x4')};function emitEvent(_0x563970){return function(_0x3f8a4b,_0x21efc9,_0xbd43ef){ChatGroupEvents[_0xe3c8('0x5')](_0x563970+':'+_0x3f8a4b['id'],_0x3f8a4b);ChatGroupEvents['emit'](_0x563970,_0x3f8a4b);_0xbd43ef(null);};}for(var e in events){if(events[_0xe3c8('0x6')](e)){var event=events[e];ChatGroup[_0xe3c8('0x7')](e,emitEvent(event));}}module[_0xe3c8('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 43fa024..0b1250d 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 _0x7915=['ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports','define'];(function(_0x236e72,_0x2199d9){var _0x57b4a8=function(_0x4522d8){while(--_0x4522d8){_0x236e72['push'](_0x236e72['shift']());}};_0x57b4a8(++_0x2199d9);}(_0x7915,0x128));var _0x5791=function(_0x3d2b6d,_0x1c710e){_0x3d2b6d=_0x3d2b6d-0x0;var _0x268764=_0x7915[_0x3d2b6d];return _0x268764;};'use strict';var _=require(_0x5791('0x0'));var util=require(_0x5791('0x1'));var logger=require(_0x5791('0x2'))(_0x5791('0x3'));var moment=require(_0x5791('0x4'));var BPromise=require(_0x5791('0x5'));var rp=require(_0x5791('0x6'));var fs=require('fs');var path=require(_0x5791('0x7'));var rimraf=require(_0x5791('0x8'));var config=require('../../config/environment');var attributes=require(_0x5791('0x9'));module[_0x5791('0xa')]=function(_0x549311,_0x3a13dd){return _0x549311[_0x5791('0xb')](_0x5791('0xc'),attributes,{'tableName':_0x5791('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3be3=['../../config/environment','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','../../config/logger','api','request-promise','path'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x3be3,0xaf));var _0x33be=function(_0x452968,_0x31e391){_0x452968=_0x452968-0x0;var _0xb6f9ae=_0x3be3[_0x452968];return _0xb6f9ae;};'use strict';var _=require(_0x33be('0x0'));var util=require('util');var logger=require(_0x33be('0x1'))(_0x33be('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x33be('0x3'));var fs=require('fs');var path=require(_0x33be('0x4'));var rimraf=require('rimraf');var config=require(_0x33be('0x5'));var attributes=require(_0x33be('0x6'));module['exports']=function(_0x3a12ea,_0x46c10a){return _0x3a12ea[_0x33be('0x7')](_0x33be('0x8'),attributes,{'tableName':_0x33be('0x9'),'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 3f6e71d..1d33cb9 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 _0xe5f7=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0xb9333c,_0x258707){var _0x4eecdc=function(_0x34569b){while(--_0x34569b){_0xb9333c['push'](_0xb9333c['shift']());}};_0x4eecdc(++_0x258707);}(_0xe5f7,0x178));var _0x7e5f=function(_0x5c2d47,_0x393371){_0x5c2d47=_0x5c2d47-0x0;var _0x222d7a=_0xe5f7[_0x5c2d47];return _0x222d7a;};'use strict';var _=require(_0x7e5f('0x0'));var util=require(_0x7e5f('0x1'));var moment=require(_0x7e5f('0x2'));var BPromise=require(_0x7e5f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e5f('0x4'))['db'];var utils=require(_0x7e5f('0x5'));var logger=require(_0x7e5f('0x6'))('rpc');var config=require(_0x7e5f('0x7'));var jayson=require(_0x7e5f('0x8'));var client=jayson['client'][_0x7e5f('0x9')]({'port':0x232a});config[_0x7e5f('0xa')]=_[_0x7e5f('0xb')](config[_0x7e5f('0xa')],{'host':_0x7e5f('0xc'),'port':0x18eb});var socket=require(_0x7e5f('0xd'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x7e5f('0xe')](socket);function respondWithRpcPromise(_0x1fec12,_0x313706,_0x1900d8){return new BPromise(function(_0x3844af,_0x218e50){return client[_0x7e5f('0xf')](_0x1fec12,_0x1900d8)[_0x7e5f('0x10')](function(_0x23a476){logger[_0x7e5f('0x11')]('ChatGroup,\x20%s,\x20%s',_0x313706,_0x7e5f('0x12'));logger['debug'](_0x7e5f('0x13'),_0x313706,_0x7e5f('0x12'),JSON[_0x7e5f('0x14')](_0x23a476));if(_0x23a476[_0x7e5f('0x15')]){if(_0x23a476[_0x7e5f('0x15')][_0x7e5f('0x16')]===0x1f4){logger[_0x7e5f('0x15')](_0x7e5f('0x17'),_0x313706,_0x23a476[_0x7e5f('0x15')][_0x7e5f('0x18')]);return _0x218e50(_0x23a476['error'][_0x7e5f('0x18')]);}logger[_0x7e5f('0x15')](_0x7e5f('0x17'),_0x313706,_0x23a476[_0x7e5f('0x15')]['message']);return _0x3844af(_0x23a476['error']['message']);}else{logger[_0x7e5f('0x11')](_0x7e5f('0x17'),_0x313706,'request\x20sent');_0x3844af(_0x23a476[_0x7e5f('0x19')][_0x7e5f('0x18')]);}})[_0x7e5f('0x1a')](function(_0xd97c29){logger[_0x7e5f('0x15')](_0x7e5f('0x17'),_0x313706,_0xd97c29);_0x218e50(_0xd97c29);});});}
\ No newline at end of file
+var _0x87cb=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatGroup,\x20%s,\x20%s','message'];(function(_0x55f5b7,_0x2dcdcc){var _0x34762d=function(_0x53fd0b){while(--_0x53fd0b){_0x55f5b7['push'](_0x55f5b7['shift']());}};_0x34762d(++_0x2dcdcc);}(_0x87cb,0xaa));var _0xb87c=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x87cb[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xb87c('0x0'));var util=require(_0xb87c('0x1'));var moment=require(_0xb87c('0x2'));var BPromise=require(_0xb87c('0x3'));var rs=require(_0xb87c('0x4'));var fs=require('fs');var Redis=require(_0xb87c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb87c('0x6'))(_0xb87c('0x7'));var config=require(_0xb87c('0x8'));var jayson=require(_0xb87c('0x9'));var client=jayson[_0xb87c('0xa')][_0xb87c('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb87c('0xc')],{'host':_0xb87c('0xd'),'port':0x18eb});var socket=require(_0xb87c('0xe'))(new Redis(config[_0xb87c('0xc')]));require(_0xb87c('0xf'))['register'](socket);function respondWithRpcPromise(_0x10517c,_0x484d49,_0x260a20){return new BPromise(function(_0x5229a4,_0x37b8e7){return client[_0xb87c('0x10')](_0x10517c,_0x260a20)[_0xb87c('0x11')](function(_0xa4095f){logger[_0xb87c('0x12')]('ChatGroup,\x20%s,\x20%s',_0x484d49,'request\x20sent');logger[_0xb87c('0x13')](_0xb87c('0x14'),_0x484d49,_0xb87c('0x15'),JSON['stringify'](_0xa4095f));if(_0xa4095f[_0xb87c('0x16')]){if(_0xa4095f[_0xb87c('0x16')][_0xb87c('0x17')]===0x1f4){logger[_0xb87c('0x16')](_0xb87c('0x18'),_0x484d49,_0xa4095f[_0xb87c('0x16')][_0xb87c('0x19')]);return _0x37b8e7(_0xa4095f[_0xb87c('0x16')][_0xb87c('0x19')]);}logger['error'](_0xb87c('0x18'),_0x484d49,_0xa4095f[_0xb87c('0x16')][_0xb87c('0x19')]);return _0x5229a4(_0xa4095f[_0xb87c('0x16')]['message']);}else{logger[_0xb87c('0x12')]('ChatGroup,\x20%s,\x20%s',_0x484d49,'request\x20sent');_0x5229a4(_0xa4095f[_0xb87c('0x1a')][_0xb87c('0x19')]);}})[_0xb87c('0x1b')](function(_0x581c9e){logger['error']('ChatGroup,\x20%s,\x20%s',_0x484d49,_0x581c9e);_0x37b8e7(_0x581c9e);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index ae82024..dba5924 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 _0x49a3=['chatGroup:','./chatGroup.events','save','remove','removeListener'];(function(_0x3b3210,_0x25e8ed){var _0x5b5484=function(_0x417858){while(--_0x417858){_0x3b3210['push'](_0x3b3210['shift']());}};_0x5b5484(++_0x25e8ed);}(_0x49a3,0x114));var _0x349a=function(_0x499abc,_0x31a2dc){_0x499abc=_0x499abc-0x0;var _0x48d808=_0x49a3[_0x499abc];return _0x48d808;};'use strict';var ChatGroupEvents=require(_0x349a('0x0'));var events=[_0x349a('0x1'),_0x349a('0x2'),'update'];function createListener(_0x31e583,_0x5490cc){return function(_0x4453f6){_0x5490cc['emit'](_0x31e583,_0x4453f6);};}function removeListener(_0x40b1f4,_0x5cf0a7){return function(){ChatGroupEvents[_0x349a('0x3')](_0x40b1f4,_0x5cf0a7);};}exports['register']=function(_0x155770){for(var _0x2078d3=0x0,_0x142b72=events['length'];_0x2078d3<_0x142b72;_0x2078d3++){var _0xca9e1d=events[_0x2078d3];var _0xd206d5=createListener(_0x349a('0x4')+_0xca9e1d,_0x155770);ChatGroupEvents['on'](_0xca9e1d,_0xd206d5);}};
\ No newline at end of file
+var _0x4b7e=['remove','update','emit','removeListener','register','length','./chatGroup.events'];(function(_0x4f484c,_0x9bccb4){var _0x276e95=function(_0x32e002){while(--_0x32e002){_0x4f484c['push'](_0x4f484c['shift']());}};_0x276e95(++_0x9bccb4);}(_0x4b7e,0x1e9));var _0xe4b7=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4b7e[_0x21a9d9];return _0x46adce;};'use strict';var ChatGroupEvents=require(_0xe4b7('0x0'));var events=['save',_0xe4b7('0x1'),_0xe4b7('0x2')];function createListener(_0xcd485e,_0x548b2e){return function(_0x36aebf){_0x548b2e[_0xe4b7('0x3')](_0xcd485e,_0x36aebf);};}function removeListener(_0x157112,_0x498c82){return function(){ChatGroupEvents[_0xe4b7('0x4')](_0x157112,_0x498c82);};}exports[_0xe4b7('0x5')]=function(_0x5cfec6){for(var _0xccaf26=0x0,_0x426ab3=events[_0xe4b7('0x6')];_0xccaf26<_0x426ab3;_0xccaf26++){var _0x733538=events[_0xccaf26];var _0x32fa2e=createListener('chatGroup:'+_0x733538,_0x5cfec6);ChatGroupEvents['on'](_0x733538,_0x32fa2e);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 4be05b0..40a41c6 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 _0xbd01=['../../config/environment','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','create','post','addMembers','update','delete','removeMembers','exports','util','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x168d88,_0x2c98c7){var _0x457997=function(_0x47d725){while(--_0x47d725){_0x168d88['push'](_0x168d88['shift']());}};_0x457997(++_0x2c98c7);}(_0xbd01,0xaa));var _0x1bd0=function(_0x524b15,_0x51c457){_0x524b15=_0x524b15-0x0;var _0x28bdef=_0xbd01[_0x524b15];return _0x28bdef;};'use strict';var multer=require('multer');var util=require(_0x1bd0('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1bd0('0x1'));var router=express[_0x1bd0('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x1bd0('0x3'));var interaction=require(_0x1bd0('0x4'));var config=require(_0x1bd0('0x5'));var controller=require(_0x1bd0('0x6'));router[_0x1bd0('0x7')]('/',auth[_0x1bd0('0x8')](),controller[_0x1bd0('0x9')]);router[_0x1bd0('0x7')]('/describe',auth[_0x1bd0('0x8')](),controller[_0x1bd0('0xa')]);router[_0x1bd0('0x7')](_0x1bd0('0xb'),auth[_0x1bd0('0x8')](),controller[_0x1bd0('0xc')]);router[_0x1bd0('0x7')](_0x1bd0('0xd'),auth['isAuthenticated'](),controller[_0x1bd0('0xe')]);router[_0x1bd0('0x7')](_0x1bd0('0xf'),auth[_0x1bd0('0x8')](),controller['getMembers']);router[_0x1bd0('0x7')](_0x1bd0('0x10'),auth[_0x1bd0('0x8')](),controller[_0x1bd0('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1bd0('0x12')]);router[_0x1bd0('0x13')](_0x1bd0('0xf'),auth['isAuthenticated'](),controller[_0x1bd0('0x14')]);router[_0x1bd0('0x13')]('/:id/messages',auth[_0x1bd0('0x8')](),controller['addMessage']);router['put'](_0x1bd0('0xb'),auth[_0x1bd0('0x8')](),controller[_0x1bd0('0x15')]);router[_0x1bd0('0x16')](_0x1bd0('0xb'),auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/members',auth[_0x1bd0('0x8')](),controller[_0x1bd0('0x17')]);module[_0x1bd0('0x18')]=router;
\ No newline at end of file
+var _0xbea8=['isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','update','destroy','delete','removeMembers','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatGroup.controller','index','get','/describe'];(function(_0x3b460b,_0x4e2058){var _0x3807fa=function(_0x115e88){while(--_0x115e88){_0x3b460b['push'](_0x3b460b['shift']());}};_0x3807fa(++_0x4e2058);}(_0xbea8,0x7c));var _0x8bea=function(_0x5550b3,_0x2d0ee0){_0x5550b3=_0x5550b3-0x0;var _0x4b8fc4=_0xbea8[_0x5550b3];return _0x4b8fc4;};'use strict';var multer=require(_0x8bea('0x0'));var util=require(_0x8bea('0x1'));var path=require(_0x8bea('0x2'));var timeout=require(_0x8bea('0x3'));var express=require('express');var router=express[_0x8bea('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8bea('0x5'));var config=require(_0x8bea('0x6'));var controller=require(_0x8bea('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8bea('0x8')]);router[_0x8bea('0x9')](_0x8bea('0xa'),auth[_0x8bea('0xb')](),controller[_0x8bea('0xc')]);router[_0x8bea('0x9')](_0x8bea('0xd'),auth[_0x8bea('0xb')](),controller[_0x8bea('0xe')]);router[_0x8bea('0x9')](_0x8bea('0xf'),auth['isAuthenticated'](),controller[_0x8bea('0x10')]);router[_0x8bea('0x9')](_0x8bea('0x11'),auth[_0x8bea('0xb')](),controller[_0x8bea('0x12')]);router[_0x8bea('0x9')](_0x8bea('0x13'),auth[_0x8bea('0xb')](),controller[_0x8bea('0x14')]);router[_0x8bea('0x15')]('/',auth[_0x8bea('0xb')](),controller['create']);router[_0x8bea('0x15')]('/:id/members',auth[_0x8bea('0xb')](),controller[_0x8bea('0x16')]);router['post'](_0x8bea('0x13'),auth['isAuthenticated'](),controller['addMessage']);router['put'](_0x8bea('0xd'),auth[_0x8bea('0xb')](),controller[_0x8bea('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8bea('0x18')]);router[_0x8bea('0x19')](_0x8bea('0x11'),auth[_0x8bea('0xb')](),controller[_0x8bea('0x1a')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 03b6586..f3d652b 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 _0x777d=['ENUM','out','exports','BOOLEAN','INTEGER','star','thumb','STRING','TEXT','long','DATE'];(function(_0x31ed51,_0x346405){var _0x257c83=function(_0x47aa99){while(--_0x47aa99){_0x31ed51['push'](_0x31ed51['shift']());}};_0x257c83(++_0x346405);}(_0x777d,0xe9));var _0xd777=function(_0x571a17,_0x63fb3d){_0x571a17=_0x571a17-0x0;var _0x3ef337=_0x777d[_0x571a17];return _0x3ef337;};'use strict';var Sequelize=require('sequelize');module[_0xd777('0x0')]={'closed':{'type':Sequelize[_0xd777('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xd777('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0xd777('0x3'),_0xd777('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xd777('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xd777('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xd777('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xd777('0x5')]},'osVersion':{'type':Sequelize[_0xd777('0x5')]},'deviceModel':{'type':Sequelize[_0xd777('0x5')]},'deviceVendor':{'type':Sequelize[_0xd777('0x5')]},'deviceType':{'type':Sequelize[_0xd777('0x5')]},'referer':{'type':Sequelize[_0xd777('0x6')]},'customerIp':{'type':Sequelize[_0xd777('0x5')]},'formData':{'type':Sequelize[_0xd777('0x6')](_0xd777('0x7'))},'read1stAt':{'type':Sequelize[_0xd777('0x8')]},'lastMsgAt':{'type':Sequelize[_0xd777('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xd777('0x9')]('in',_0xd777('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xd777('0x6')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xe9e8=['exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','long','DATE','out','sequelize'];(function(_0x3a05eb,_0x1715d6){var _0x485e33=function(_0x5a37eb){while(--_0x5a37eb){_0x3a05eb['push'](_0x3a05eb['shift']());}};_0x485e33(++_0x1715d6);}(_0xe9e8,0x6b));var _0x8e9e=function(_0x36686a,_0x38cc45){_0x36686a=_0x36686a-0x0;var _0x7e74ab=_0xe9e8[_0x36686a];return _0x7e74ab;};'use strict';var Sequelize=require(_0x8e9e('0x0'));module[_0x8e9e('0x1')]={'closed':{'type':Sequelize[_0x8e9e('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8e9e('0x3')]},'ratingType':{'type':Sequelize[_0x8e9e('0x4')](_0x8e9e('0x5'),_0x8e9e('0x6')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x8e9e('0x7')]},'pathTranscript':{'type':Sequelize[_0x8e9e('0x7')]},'mailTranscript':{'type':Sequelize[_0x8e9e('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x8e9e('0x8')]},'secondDisposition':{'type':Sequelize[_0x8e9e('0x8')]},'thirdDisposition':{'type':Sequelize[_0x8e9e('0x8')]},'note':{'type':Sequelize[_0x8e9e('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x8e9e('0x8')]},'osName':{'type':Sequelize[_0x8e9e('0x8')]},'osVersion':{'type':Sequelize[_0x8e9e('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x8e9e('0x8')]},'deviceType':{'type':Sequelize[_0x8e9e('0x8')]},'referer':{'type':Sequelize[_0x8e9e('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x8e9e('0x7')](_0x8e9e('0x9'))},'read1stAt':{'type':Sequelize[_0x8e9e('0xa')]},'lastMsgAt':{'type':Sequelize[_0x8e9e('0xa')]},'lastMsgDirection':{'type':Sequelize[_0x8e9e('0x4')]('in',_0x8e9e('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8e9e('0x8')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x8e9e('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index d870f72..1872527 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 _0xa9e0=['createPdfFromHTML','err','rimraf','zip-dir','request-promise','mustache','path','ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','error','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','stack','name','render','merge','body','contact','agent','account','Users','fullname','Tags','TagIds','split','forEach','push','catch','waiting','answered','unmanaged','abandoned','closed','UserId','talking','disposition','total','index','map','ChatInteraction','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','select','field','from','u.fullname','user_has_chat_interactions','users','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','left_join','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','search','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)','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','keys','compact','isEmpty','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','group','i.id','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','params','includeAll','include','options','create','describe','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','vidaooMetadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','attachmentUpload','file','originalname','filename','Attachment','Unauthorized','findOne','attachId','join','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','hasOwnProperty','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','setTags','spread','color','removeTags','unix','server','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','mkdirSync','Chat','Owner','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','renderFile','downloadInteraction.ejs','transcript-','.pdf'];(function(_0x32df1f,_0x228b18){var _0x41ef00=function(_0x1bb63c){while(--_0x1bb63c){_0x32df1f['push'](_0x32df1f['shift']());}};_0x41ef00(++_0x228b18);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var rimraf=require(_0x0a9e('0x0'));var zipdir=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x3'));var util=require('util');var path=require(_0x0a9e('0x4'));var ejs=require(_0x0a9e('0x5'));var fs=require('fs');var _=require(_0x0a9e('0x6'));var squel=require(_0x0a9e('0x7'));var Redis=require(_0x0a9e('0x8'));var qs=require('../../components/parsers/qs');var as=require(_0x0a9e('0x9'));var pdf=require(_0x0a9e('0xa'));var logger=require(_0x0a9e('0xb'))('api');var config=require('../../config/environment');var db=require(_0x0a9e('0xc'))['db'];config['redis']=_['defaults'](config[_0x0a9e('0xd')],{'host':_0x0a9e('0xe'),'port':0x18eb});var socket=require(_0x0a9e('0xf'))(new Redis(config[_0x0a9e('0xd')]));require(_0x0a9e('0x10'))[_0x0a9e('0x11')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});var client9004=jayson['client'][_0x0a9e('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x36471c,_0xd5b662,_0x26d672,_0x32d742){return new BPromise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_0x32d742||client;return _0x4283ce[_0x0a9e('0x13')](_0x36471c,_0x26d672)[_0x0a9e('0x14')](function(_0x281129){logger[_0x0a9e('0x15')](_0x0a9e('0x16'),_0xd5b662,'request\x20sent');logger[_0x0a9e('0x17')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xd5b662,_0x0a9e('0x18'),JSON['stringify'](_0x281129));if(_0x281129[_0x0a9e('0x19')]){if(_0x281129[_0x0a9e('0x19')]['code']===0x1f4){logger[_0x0a9e('0x19')]('ChatInteraction,\x20%s,\x20%s',_0xd5b662,_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);return _0x5db4b0(_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);}logger[_0x0a9e('0x19')](_0x0a9e('0x16'),_0xd5b662,_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);return _0x69aeb7(_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);}else{logger[_0x0a9e('0x15')](_0x0a9e('0x16'),_0xd5b662,'request\x20sent');_0x69aeb7(_0x281129[_0x0a9e('0x1b')][_0x0a9e('0x1a')]);}})['catch'](function(_0x20f109){logger['error']('ChatInteraction,\x20%s,\x20%s',_0xd5b662,_0x20f109);_0x5db4b0(_0x20f109);});});}function respondWithStatusCode(_0x3a02e1,_0x432e56){_0x432e56=_0x432e56||0xcc;return function(_0x38e7c4){if(_0x38e7c4){return _0x3a02e1[_0x0a9e('0x1c')](_0x432e56);}return _0x3a02e1['status'](_0x432e56)[_0x0a9e('0x1d')]();};}function respondWithResult(_0x2fb0e4,_0x3b45bc){_0x3b45bc=_0x3b45bc||0xc8;return function(_0x4d00e6){if(_0x4d00e6){return _0x2fb0e4[_0x0a9e('0x1e')](_0x3b45bc)[_0x0a9e('0x1f')](_0x4d00e6);}};}function respondWithFilteredResult(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(_0x59181e){var _0x197ec0=typeof _0x5ea472[_0x0a9e('0x20')]===_0x0a9e('0x21')&&typeof _0x5ea472[_0x0a9e('0x22')]==='undefined';var _0x384319=_0x59181e['count'];var _0x45a1e7=_0x197ec0?0x0:_0x5ea472['offset'];var _0x1dc186=_0x197ec0?_0x59181e[_0x0a9e('0x23')]:_0x5ea472[_0x0a9e('0x20')]+_0x5ea472[_0x0a9e('0x22')];var _0x140511;if(_0x1dc186>=_0x384319){_0x1dc186=_0x384319;_0x140511=0xc8;}else{_0x140511=0xce;}_0x16b1ca[_0x0a9e('0x1e')](_0x140511);return _0x16b1ca[_0x0a9e('0x24')](_0x0a9e('0x25'),_0x45a1e7+'-'+_0x1dc186+'/'+_0x384319)['json'](_0x59181e);}return null;};}function saveUpdates(_0x3652a7){return function(_0x468813){if(_0x468813){return _0x468813[_0x0a9e('0x26')](_0x3652a7)[_0x0a9e('0x14')](function(_0x5c877d){return _0x5c877d;});}return null;};}function removeEntity(_0x15b200){return function(_0x40e7a3){if(_0x40e7a3){return _0x40e7a3[_0x0a9e('0x27')]()[_0x0a9e('0x14')](function(){_0x15b200[_0x0a9e('0x1e')](0xcc)[_0x0a9e('0x1d')]();});}};}function handleEntityNotFound(_0x296f41){return function(_0x2e8759){if(!_0x2e8759){_0x296f41[_0x0a9e('0x1c')](0x194);}return _0x2e8759;};}function handleError(_0x540530,_0x426950){_0x426950=_0x426950||0x1f4;return function(_0x5d1e0e){logger[_0x0a9e('0x19')](_0x5d1e0e[_0x0a9e('0x28')]);if(_0x5d1e0e[_0x0a9e('0x29')]){delete _0x5d1e0e[_0x0a9e('0x29')];}_0x540530[_0x0a9e('0x1e')](_0x426950)['send'](_0x5d1e0e);};}function getMustacheRender(_0x66c1d2,_0x46f0a5){return Mustache[_0x0a9e('0x2a')](_0x66c1d2,_[_0x0a9e('0x2b')](_0x46f0a5[_0x0a9e('0x2c')],{'contact':_0x46f0a5[_0x0a9e('0x2d')],'message':_0x46f0a5[_0x0a9e('0x1a')],'agent':_0x46f0a5[_0x0a9e('0x2e')],'interaction':_0x46f0a5['interaction'],'account':_0x46f0a5[_0x0a9e('0x2f')]}))||'';}function getInteractionUsers(_0x5e7238,_0x2cc7a0){return new BPromise(function(_0x14b13f,_0x2b7e7f){try{if(_0x2cc7a0[_0x5e7238['id']]){_0x5e7238[_0x0a9e('0x30')]=_['map'](_0x2cc7a0[_0x5e7238['id']],function(_0x191e91){return{'id':_0x191e91['id'],'fullname':_0x191e91[_0x0a9e('0x31')]};});}}catch(_0x1fa90d){_0x2b7e7f(_0x1fa90d);}_0x14b13f(_0x5e7238);});}function getInteractionTags(_0x15de0e,_0x4853b1){return new BPromise(function(_0x54135e,_0x1e8694){try{if(_0x15de0e['TagIds']){_0x15de0e[_0x0a9e('0x32')]=[];_0x15de0e[_0x0a9e('0x33')][_0x0a9e('0x34')](',')[_0x0a9e('0x35')](function(_0x4f41ae){_0x15de0e[_0x0a9e('0x32')][_0x0a9e('0x36')](_0x4853b1[_0x4f41ae]);});}delete _0x15de0e[_0x0a9e('0x33')];}catch(_0x533942){_0x1e8694(_0x533942);}_0x54135e(_0x15de0e);});}function updateChatInteraction(_0x1dbf74,_0x1a180b,_0x289467){return new BPromise(function(_0x4c1c0e,_0x546ef8){return getInteractionUsers(_0x1dbf74,_0x289467)[_0x0a9e('0x14')](function(_0x40d766){return getInteractionTags(_0x40d766,_0x1a180b);})['then'](function(_0x2b814e){return getStateInteraction(_0x2b814e);})[_0x0a9e('0x14')](function(_0x2e1b3a){_0x4c1c0e(_0x2e1b3a);})[_0x0a9e('0x37')](function(_0x4b38d9){_0x546ef8(_0x4b38d9);});});}function getStateInteraction(_0x5a594b){return new BPromise(function(_0x15e37d){_0x5a594b[_0x0a9e('0x38')]=0x0;_0x5a594b['talking']=0x0;_0x5a594b[_0x0a9e('0x39')]=0x0;_0x5a594b[_0x0a9e('0x3a')]=0x0;_0x5a594b[_0x0a9e('0x3b')]=0x0;_0x5a594b['total']=0x0;if(!_0x5a594b[_0x0a9e('0x3c')]&&!_0x5a594b[_0x0a9e('0x3d')]){_0x5a594b[_0x0a9e('0x38')]+=0x1;}if(!_0x5a594b[_0x0a9e('0x3c')]&&_0x5a594b[_0x0a9e('0x3d')]){_0x5a594b[_0x0a9e('0x3e')]+=0x1;if(_0x5a594b[_0x0a9e('0x38')]){_0x5a594b[_0x0a9e('0x38')]-=0x1;}}if(_0x5a594b[_0x0a9e('0x3c')]&&_0x5a594b[_0x0a9e('0x3f')]===_0x0a9e('0x3b')){_0x5a594b[_0x0a9e('0x3b')]+=0x1;if(_0x5a594b[_0x0a9e('0x38')]){_0x5a594b[_0x0a9e('0x38')]-=0x1;}}else if(_0x5a594b[_0x0a9e('0x3c')]&&!_0x5a594b['UserId']&&_0x5a594b['disposition']){_0x5a594b[_0x0a9e('0x3a')]+=0x1;if(_0x5a594b[_0x0a9e('0x38')]){_0x5a594b[_0x0a9e('0x38')]-=0x1;}}else if(_0x5a594b[_0x0a9e('0x3c')]&&_0x5a594b[_0x0a9e('0x3d')]){_0x5a594b[_0x0a9e('0x39')]+=0x1;if(_0x5a594b[_0x0a9e('0x3e')]){_0x5a594b[_0x0a9e('0x3e')]-=0x1;}}_0x5a594b[_0x0a9e('0x40')]+=0x1;_0x15e37d(_0x5a594b);});}exports[_0x0a9e('0x41')]=function(_0x2c2cb0,_0x35ed4a){var _0x5026aa={},_0x117c99={},_0x138b8b={'count':0x0,'rows':[]};var _0xdd268f=_[_0x0a9e('0x42')](db[_0x0a9e('0x43')][_0x0a9e('0x44')],function(_0x21eb86){return{'name':_0x21eb86[_0x0a9e('0x45')],'type':_0x21eb86['type'][_0x0a9e('0x46')]};});_0x117c99['model']=_[_0x0a9e('0x42')](_0xdd268f,_0x0a9e('0x29'));_0x117c99[_0x0a9e('0x47')]=_['keys'](_0x2c2cb0[_0x0a9e('0x47')]);_0x117c99[_0x0a9e('0x48')]=_[_0x0a9e('0x49')](_0x117c99[_0x0a9e('0x4a')],_0x117c99[_0x0a9e('0x47')]);_0x5026aa[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0x117c99['model'],qs[_0x0a9e('0x4c')](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x4c')]));_0x5026aa[_0x0a9e('0x4b')]=_0x5026aa[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x5026aa[_0x0a9e('0x4b')]:_0x117c99[_0x0a9e('0x4a')];if(!_0x2c2cb0[_0x0a9e('0x47')]['hasOwnProperty'](_0x0a9e('0x4e'))){_0x5026aa[_0x0a9e('0x22')]=qs['limit'](_0x2c2cb0['query']['limit']);_0x5026aa[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x20')]);}_0x5026aa[_0x0a9e('0x4f')]=qs[_0x0a9e('0x50')](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x50')]);_0x5026aa['where']=qs['filters'](_['pick'](_0x2c2cb0[_0x0a9e('0x47')],_0x117c99[_0x0a9e('0x48')]),_0xdd268f);var _0x14d602=[];var _0x5bb3ed=squel[_0x0a9e('0x51')]()[_0x0a9e('0x52')]('id')['field']('name')[_0x0a9e('0x52')]('color')[_0x0a9e('0x53')]('tools_tags');var _0x2e5e62=squel[_0x0a9e('0x51')]()[_0x0a9e('0x52')]('u.id')[_0x0a9e('0x52')](_0x0a9e('0x54'))['field']('ui.ChatInteractionId')[_0x0a9e('0x53')](_0x0a9e('0x55'),'ui')['left_join'](_0x0a9e('0x56'),'u','u.id\x20=\x20ui.UserId');var _0x211ef9=squel['select']()[_0x0a9e('0x53')]('chat_interactions','i')['left_join']('cm_contacts','c',_0x0a9e('0x57'))['left_join'](_0x0a9e('0x56'),'o',_0x0a9e('0x58'))[_0x0a9e('0x59')](_0x0a9e('0x5a'),'a',_0x0a9e('0x5b'))[_0x0a9e('0x59')](_0x0a9e('0x5c'),'me',_0x0a9e('0x5d'))['left_join'](_0x0a9e('0x5e'),'it',_0x0a9e('0x5f'))[_0x0a9e('0x59')](_0x0a9e('0x60'),'t',_0x0a9e('0x61'));var _0x156662=squel['expr']();var _0x956fbe=[];var _0x26bc80=squel['expr']();var _0x3649cc;if(_0x2c2cb0['query'][_0x0a9e('0x62')]){_0x3649cc=as['parseSearch'](_0x2c2cb0['query']['search']);var _0x273cb5=_0x3649cc['sqlOperator'];for(var _0x2244d6=0x0;_0x2244d6<_0x3649cc[_0x0a9e('0x63')][_0x0a9e('0x4d')];_0x2244d6++){var _0x7be420=_0x3649cc[_0x0a9e('0x63')][_0x2244d6];var _0x26d7db='i';var _0x49eed0=_[_0x0a9e('0x64')](_0xdd268f,['name',_0x7be420[_0x0a9e('0x52')]]);if(!_0x49eed0){switch(_0x7be420[_0x0a9e('0x52')]){case _0x0a9e('0x65'):if(_0x7be420['value']==0x1){_0x211ef9[_0x0a9e('0x66')]('`'+_0x7be420[_0x0a9e('0x52')]+_0x0a9e('0x67'));}else{_0x211ef9[_0x0a9e('0x66')]('`'+_0x7be420['field']+_0x0a9e('0x68'));}break;case _0x0a9e('0x69'):if(_0x7be420['operator']===_0x0a9e('0x6a')){if(_0x7be420[_0x0a9e('0x6b')][_0x0a9e('0x34')]('\x20')[_0x0a9e('0x4d')]>0x1){_0x156662[_0x273cb5](_0x0a9e('0x6c'),qs['getFullTextValue'](_0x7be420[_0x0a9e('0x6b')]),null);}else{var _0x2937e0='%'+_0x7be420[_0x0a9e('0x6b')]+'%';_0x156662[_0x273cb5]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2937e0,_0x2937e0,_0x2937e0);}}else{_0x49eed0=_[_0x0a9e('0x64')](_0xdd268f,['name','ContactId']);_0x7be420[_0x0a9e('0x52')]=_0x0a9e('0x6d');_0x235f8f=as[_0x0a9e('0x6e')](_0x26d7db,_0x49eed0[_0x0a9e('0x6f')],_0x7be420);_0x156662[_0x273cb5](_0x235f8f[_0x0a9e('0x70')],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x71')],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x1d')]);}break;case _0x0a9e('0x72'):var _0x2e89b7=_0x7be420[_0x0a9e('0x6b')][_0x0a9e('0x34')](',')[_0x0a9e('0x42')](function(_0x320898){return Number(_0x320898);});_0x2e89b7[_0x0a9e('0x35')](function(_0x2a28c0){_0x26bc80['or'](_0x0a9e('0x73'),'%,'+_0x2a28c0+',%');});_0x956fbe=_['union'](_0x956fbe,_0x2e89b7);break;case _0x0a9e('0x74'):if(_0x7be420[_0x0a9e('0x75')]===_0x0a9e('0x6a')){_0x156662[_0x273cb5]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x7be420[_0x0a9e('0x6b')]+'%',null);}else{_0x49eed0=_[_0x0a9e('0x64')](_0xdd268f,['name',_0x0a9e('0x3d')]);_0x7be420[_0x0a9e('0x52')]=_0x0a9e('0x3d');_0x235f8f=as[_0x0a9e('0x6e')](_0x26d7db,_0x49eed0[_0x0a9e('0x6f')],_0x7be420);_0x156662[_0x273cb5](_0x235f8f['text'],_0x235f8f['value']['start'],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x1d')]);}break;case _0x0a9e('0x2c'):_0x235f8f=as[_0x0a9e('0x6e')]('me',null,_0x7be420);_0x156662[_0x273cb5](_0x235f8f[_0x0a9e('0x70')],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x71')],_0x235f8f[_0x0a9e('0x6b')]['end']);break;}}else{var _0x235f8f=as[_0x0a9e('0x6e')](_0x26d7db,_0x49eed0[_0x0a9e('0x6f')],_0x7be420);_0x156662[_0x273cb5](_0x235f8f['text'],_0x235f8f[_0x0a9e('0x6b')]['start'],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x1d')]);}}}else{var _0x4c46c1=_(_0x2c2cb0[_0x0a9e('0x47')])[_0x0a9e('0x76')]()[_0x0a9e('0x42')](function(_0x317c0c){return _['some'](_0xdd268f,[_0x0a9e('0x29'),_0x317c0c])?_0x317c0c:undefined;})[_0x0a9e('0x77')]()[_0x0a9e('0x6b')]();if(!_[_0x0a9e('0x78')](_0x4c46c1)){_0x4c46c1['forEach'](function(_0x109ccb){if(_0x109ccb===_0x0a9e('0x79')){_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x7b'),[]['concat'](_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb]));}else if(_0x109ccb===_0x0a9e('0x7c')){var _0x30a4c7=JSON[_0x0a9e('0x7d')](_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb])[_0x0a9e('0x7e')];var _0x40fc56=JSON[_0x0a9e('0x7d')](_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb])[_0x0a9e('0x7f')];_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x80'),_0x30a4c7,_0x40fc56);}else{if(_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb]===_0x0a9e('0x81')){_0x211ef9['where']('i.'+_0x109ccb+_0x0a9e('0x82'));}else{_0x211ef9[_0x0a9e('0x7a')]('i.'+_0x109ccb+_0x0a9e('0x83'),_0x2c2cb0['query'][_0x109ccb]);}}});}if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x84')]){if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x84')]==0x1){_0x211ef9['having']('`unreadMessages`\x20=\x200');}else{_0x211ef9[_0x0a9e('0x66')](_0x0a9e('0x85'));}}if(_0x2c2cb0['query'][_0x0a9e('0x86')]){_0x956fbe=_['isArray'](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x86')])?_0x2c2cb0['query'][_0x0a9e('0x86')]:new Array(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x86')]);_0x956fbe[_0x0a9e('0x35')](function(_0x3755fe){_0x26bc80['or'](_0x0a9e('0x73'),'%,'+_0x3755fe+',%');});}if(_0x2c2cb0[_0x0a9e('0x47')]['filter']){var _0x2973d3=_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x87')][_0x0a9e('0x88')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x0a9e('0x89')](_0x2973d3)){_0x156662['or'](_0x0a9e('0x8a'),_0x2973d3+'%');}else{_0x156662['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x8b')](_0x2973d3))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2973d3+'%');}}}_0x211ef9[_0x0a9e('0x7a')](_0x156662);_0x211ef9[_0x0a9e('0x8c')](_0x0a9e('0x8d'));var _0x385d52={'type':db['Sequelize']['QueryTypes'][_0x0a9e('0x8e')],'raw':!![]};var _0x2b9c01=_0x211ef9[_0x0a9e('0x8f')]();_0x2b9c01['field'](_0x0a9e('0x8d'));_0x2b9c01[_0x0a9e('0x52')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x5026aa[_0x0a9e('0x4f')]){_0x5026aa['order']['forEach'](function(_0x4dc6b3){var _0x81d748=_0x4dc6b3[0x0]===_0x0a9e('0x90')?_0x4dc6b3[0x0]:'i.'+_0x4dc6b3[0x0];_0x211ef9[_0x0a9e('0x4f')](_0x81d748,_0x4dc6b3[0x1]===_0x0a9e('0x91')?![]:!![]);});}if(!_[_0x0a9e('0x78')](_0x956fbe)){_0x211ef9[_0x0a9e('0x66')](_0x26bc80);_0x2b9c01['where'](_0x0a9e('0x92'),_0x956fbe);}BPromise['resolve']()[_0x0a9e('0x14')](function(){if(!_0x3649cc){if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x79')])return;_0x2b9c01[_0x0a9e('0x7a')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x93'));return;}if(_0x2c2cb0[_0x0a9e('0x94')]['role']!==_0x0a9e('0x2e'))return;return _0x2c2cb0[_0x0a9e('0x94')][_0x0a9e('0x95')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x14')](function(_0x255e49){if(_[_0x0a9e('0x78')](_0x255e49)){_0x2b9c01[_0x0a9e('0x7a')](_0x0a9e('0x96'));_0x211ef9['where'](_0x0a9e('0x96'));}else{_0x2b9c01[_0x0a9e('0x7a')]('i.ChatWebsiteId\x20IN\x20?',_[_0x0a9e('0x42')](_0x255e49,'id'));_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x7b'),_['map'](_0x255e49,'id'));}});})[_0x0a9e('0x14')](function(){if(_0x2c2cb0['user'][_0x0a9e('0x97')]===_0x0a9e('0x2e')&&!_0x3649cc&&!_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x79')])return[];return db[_0x0a9e('0x98')][_0x0a9e('0x47')](_0x2b9c01[_0x0a9e('0x99')](),_0x385d52);})[_0x0a9e('0x14')](function(_0x501050){_0x138b8b[_0x0a9e('0x23')]=_0x501050[_0x0a9e('0x4d')];if(_0x138b8b[_0x0a9e('0x23')]===0x0)return[];return db[_0x0a9e('0x98')][_0x0a9e('0x47')](_0x5bb3ed[_0x0a9e('0x99')](),_0x385d52)[_0x0a9e('0x14')](function(_0x33f0c9){_0x14d602=_[_0x0a9e('0x9a')](_0x33f0c9,'id');_0x385d52=_[_0x0a9e('0x2b')](_0x385d52,{'model':db[_0x0a9e('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x4c')]){_0x5026aa['attributes'][_0x0a9e('0x35')](function(_0x23e2bd){_0x211ef9[_0x0a9e('0x52')]('i.'+_0x23e2bd);});}else{_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0x9b'),'unreadMessages');_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0x9c'),'Account.key');_0x211ef9[_0x0a9e('0x52')]('a.mandatoryDisposition',_0x0a9e('0x9d'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0x9e'),_0x0a9e('0x90'));_0x211ef9['field'](_0x0a9e('0x9f'));_0x211ef9['field'](_0x0a9e('0xa0'),_0x0a9e('0xa1'));_0x211ef9['field'](_0x0a9e('0xa2'),_0x0a9e('0xa3'));_0x211ef9[_0x0a9e('0x52')]('c.email','Contact.email');_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xa4'),_0x0a9e('0xa5'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xa6'),_0x0a9e('0xa7'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xa8'),_0x0a9e('0xa9'));_0x211ef9['field'](_0x0a9e('0xaa'),'Owner.fullname');_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xab'),_0x0a9e('0xac'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xad'),'TagIds');}if(_0x5026aa[_0x0a9e('0x22')])_0x211ef9[_0x0a9e('0x22')](_0x5026aa[_0x0a9e('0x22')]);if(_0x5026aa[_0x0a9e('0x20')])_0x211ef9[_0x0a9e('0x20')](_0x5026aa['offset']);return db['sequelize'][_0x0a9e('0x47')](_0x211ef9['toString'](),_0x385d52);})[_0x0a9e('0x14')](function(_0x4658df){if(_0x4658df[_0x0a9e('0x4d')]>0x0)_0x2e5e62[_0x0a9e('0x7a')](_0x0a9e('0xae'),_[_0x0a9e('0x42')](_0x4658df,'id'));return db['sequelize']['query'](_0x2e5e62[_0x0a9e('0x99')](),_0x385d52)['then'](function(_0x2469d1){var _0x5c689c=_[_0x0a9e('0xaf')](_0x2469d1,'ChatInteractionId');var _0x558d60=[];_0x4658df[_0x0a9e('0x35')](function(_0xb8db59){_0x558d60['push'](updateChatInteraction(_0xb8db59,_0x14d602,_0x5c689c));});return BPromise[_0x0a9e('0xb0')](_0x558d60);});});})[_0x0a9e('0x14')](function(_0x15c6b9){_0x138b8b[_0x0a9e('0xb1')]=_0x15c6b9;return _0x138b8b;})[_0x0a9e('0x14')](respondWithFilteredResult(_0x35ed4a,_0x5026aa))['catch'](handleError(_0x35ed4a,null));};exports['show']=function(_0x16449b,_0x22286c){var _0x41c8cd={'raw':![],'where':{'id':_0x16449b[_0x0a9e('0xb2')]['id']}},_0x24beb6={};_0x24beb6['model']=_[_0x0a9e('0x76')](db[_0x0a9e('0x43')]['rawAttributes']);_0x24beb6[_0x0a9e('0x47')]=_[_0x0a9e('0x76')](_0x16449b[_0x0a9e('0x47')]);_0x24beb6[_0x0a9e('0x48')]=_[_0x0a9e('0x49')](_0x24beb6[_0x0a9e('0x4a')],_0x24beb6[_0x0a9e('0x47')]);_0x41c8cd[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0x24beb6[_0x0a9e('0x4a')],qs['fields'](_0x16449b[_0x0a9e('0x47')][_0x0a9e('0x4c')]));_0x41c8cd[_0x0a9e('0x4b')]=_0x41c8cd[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x41c8cd['attributes']:_0x24beb6['model'];if(_0x16449b[_0x0a9e('0x47')][_0x0a9e('0xb3')]){_0x41c8cd[_0x0a9e('0xb4')]=[{'all':!![]}];}_0x41c8cd=_[_0x0a9e('0x2b')]({},_0x41c8cd,_0x16449b[_0x0a9e('0xb5')]);return db['ChatInteraction'][_0x0a9e('0x64')](_0x41c8cd)[_0x0a9e('0x14')](handleEntityNotFound(_0x22286c,null))[_0x0a9e('0x14')](respondWithResult(_0x22286c,null))['catch'](handleError(_0x22286c,null));};exports[_0x0a9e('0xb6')]=function(_0x59aa7b,_0x2144ca){return db['ChatInteraction'][_0x0a9e('0xb6')](_0x59aa7b[_0x0a9e('0x2c')],{})[_0x0a9e('0x14')](respondWithResult(_0x2144ca,0xc9))['catch'](handleError(_0x2144ca,null));};exports[_0x0a9e('0x26')]=function(_0x5ed560,_0x4383da){if(_0x5ed560[_0x0a9e('0x2c')]['id']){delete _0x5ed560[_0x0a9e('0x2c')]['id'];}return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x5ed560[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x4383da,null))[_0x0a9e('0x14')](saveUpdates(_0x5ed560[_0x0a9e('0x2c')],null))[_0x0a9e('0x14')](respondWithResult(_0x4383da,null))[_0x0a9e('0x37')](handleError(_0x4383da,null));};exports[_0x0a9e('0x27')]=function(_0x2415fe,_0x399def){return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x2415fe['params']['id']}})['then'](handleEntityNotFound(_0x399def,null))[_0x0a9e('0x14')](removeEntity(_0x399def,null))['catch'](handleError(_0x399def,null));};exports[_0x0a9e('0xb7')]=function(_0x3428c9,_0x5d6b69){return db[_0x0a9e('0x43')][_0x0a9e('0xb7')]()[_0x0a9e('0x14')](respondWithResult(_0x5d6b69,null))[_0x0a9e('0x37')](handleError(_0x5d6b69,null));};exports['createVidaooSession']=function(_0x148fd9,_0x26cb76){var _0x374f0b=_0x148fd9[_0x0a9e('0xb2')]['id'];var _0x5d0e1f;var _0x19e9ed;var _0x1a0b08;return db[_0x0a9e('0x43')]['findOne']({'where':{'id':_0x374f0b}})[_0x0a9e('0x14')](function(_0x270df8){_0x5d0e1f=_0x270df8;return db[_0x0a9e('0xb8')]['findOne']({'where':{'id':_0x270df8[_0x0a9e('0x79')]},'attributes':['id',_0x0a9e('0xb9'),_0x0a9e('0xba'),_0x0a9e('0xbb'),_0x0a9e('0xbc'),'vidaooMetadata'],'raw':!![]});})[_0x0a9e('0x14')](function(_0x289e65){if(_0x289e65&&_0x289e65['vidaooApiKey']&&_0x289e65[_0x0a9e('0xba')]){_0x19e9ed=_0x289e65;var _0x1fcfe6={'interaction':{'id':_0x374f0b},'agent':{'id':_0x148fd9[_0x0a9e('0x94')]['id'],'name':_0x148fd9['user']['name'],'fullname':_0x148fd9['user'][_0x0a9e('0x31')],'email':_0x148fd9[_0x0a9e('0x94')]['email']},'contact':_0x148fd9[_0x0a9e('0x2c')][_0x0a9e('0x2d')],'account':_0x148fd9[_0x0a9e('0x2c')]['account']};var _0x9fc93e={'rejectUnauthorized':![],'method':_0x0a9e('0xbd'),'url':_0x0a9e('0xbe'),'headers':{'X-APIKEY':_0x289e65[_0x0a9e('0xb9')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x148fd9[_0x0a9e('0x94')][_0x0a9e('0xbf')]],'buttons':null,'topic':_0x19e9ed[_0x0a9e('0xbb')],'note':_[_0x0a9e('0xc0')](_0x19e9ed[_0x0a9e('0xbc')])?null:getMustacheRender(_0x19e9ed['vidaooNote'],_0x1fcfe6),'metadata':null},'redirect':_0x0a9e('0xc1'),'json':!![]};try{if(!_['isNull'](_0x19e9ed[_0x0a9e('0xc2')])){var _0x4093e6=getMustacheRender(_0x19e9ed[_0x0a9e('0xc2')],_0x1fcfe6);var _0x3cf222=JSON[_0x0a9e('0x7d')](_0x4093e6);_0x9fc93e[_0x0a9e('0x2c')]['metadata']=_0x3cf222;}}catch(_0x1a0314){throw new db[(_0x0a9e('0xc3'))][(_0x0a9e('0xc4'))](_0x0a9e('0xc5'));}return rp(_0x9fc93e);}else{throw new db['Sequelize'][(_0x0a9e('0xc4'))](_0x0a9e('0xc6'));}})[_0x0a9e('0x14')](function(_0x1c9539){_0x1a0b08=_0x1c9539;if(_0x1a0b08['id']){var _0xc2e7b={'body':_0x1a0b08[_0x0a9e('0xc7')],'ChatWebsiteId':_0x19e9ed['id'],'ChatInteractionId':_0x5d0e1f['id'],'direction':_0x0a9e('0xc8'),'UserId':_0x148fd9[_0x0a9e('0x94')]['id']};return db[_0x0a9e('0xc9')][_0x0a9e('0xb6')](_0xc2e7b,{});}else{throw new db['Sequelize'][(_0x0a9e('0xc4'))](_0x0a9e('0xca'));}})[_0x0a9e('0x14')](function(){return _0x5d0e1f[_0x0a9e('0xcb')]({'vidaooSessionId':_0x1a0b08['id']});})[_0x0a9e('0x14')](respondWithResult(_0x26cb76,null))[_0x0a9e('0x37')](handleError(_0x26cb76,null));};exports[_0x0a9e('0xcc')]=function(_0x20ae21,_0x566b90){if(_0x20ae21[_0x0a9e('0x2c')]['id']){delete _0x20ae21[_0x0a9e('0x2c')]['id'];}return db[_0x0a9e('0x43')]['find']({'where':{'id':_0x20ae21[_0x0a9e('0xb2')]['id']},'include':[{'model':db[_0x0a9e('0xcd')],'as':_0x0a9e('0x69')}]})[_0x0a9e('0x14')](handleEntityNotFound(_0x566b90,null))[_0x0a9e('0x14')](saveUpdates(_0x20ae21[_0x0a9e('0x2c')],null))[_0x0a9e('0x14')](respondWithResult(_0x566b90,null))[_0x0a9e('0x37')](handleError(_0x566b90,null));};exports[_0x0a9e('0xce')]=function(_0x451010,_0x5a7dad){if(_0x451010[_0x0a9e('0x2c')]['id']){delete _0x451010[_0x0a9e('0x2c')]['id'];}return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x451010[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](function(_0x5cb48d){if(!_0x5cb48d){logger[_0x0a9e('0x19')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,'entity\x20not\x20found');_0x5a7dad[_0x0a9e('0x1c')](0x194);}else{if(_0x5cb48d[_0x0a9e('0x3d')]){throw new db[(_0x0a9e('0xc3'))][(_0x0a9e('0xc4'))]('Interaction\x20already\x20assigned');}}return _0x5cb48d;})[_0x0a9e('0x14')](function(_0x309fa9){if(_0x309fa9){return _0x309fa9[_0x0a9e('0x26')]({'closed':_0x451010[_0x0a9e('0x2c')][_0x0a9e('0x3c')],'disposition':_0x451010['body']['disposition']})[_0x0a9e('0x14')](function(_0x33bcb2){return _0x33bcb2;});}})[_0x0a9e('0x14')](function(){return respondWithRpcPromise('AbandonInteraction',_0x0a9e('0xce'),_0x451010[_0x0a9e('0x2c')],client9004);})[_0x0a9e('0x14')](respondWithResult(_0x5a7dad,null))['catch'](handleError(_0x5a7dad,null));};exports[_0x0a9e('0xcf')]=function(_0x2bf85d,_0x15ba6b){_0x2bf85d['body'][_0x0a9e('0x29')]=_0x2bf85d[_0x0a9e('0xd0')][_0x0a9e('0xd1')];_0x2bf85d['body']['basename']=_0x2bf85d['file'][_0x0a9e('0xd2')];_0x2bf85d[_0x0a9e('0x2c')][_0x0a9e('0x6f')]=_0x2bf85d[_0x0a9e('0xd0')]['mimetype'];return db[_0x0a9e('0xd3')]['create'](_0x2bf85d[_0x0a9e('0x2c')])[_0x0a9e('0x14')](respondWithResult(_0x15ba6b,0xc9))[_0x0a9e('0x37')](handleError(_0x15ba6b,null));};exports['attachmentDownload']=function(_0x33b4b3,_0x33a26c){return db[_0x0a9e('0x43')]['findOne']({'where':{'id':_0x33b4b3[_0x0a9e('0xb2')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x33a26c,null))[_0x0a9e('0x14')](function(_0x5c57e1){if(_0x5c57e1){if(_0x5c57e1[_0x0a9e('0x3c')]){return _0x33a26c['status'](0x193)[_0x0a9e('0x1f')]({'status':0x193,'message':_0x0a9e('0xd4')});}return db[_0x0a9e('0xd3')][_0x0a9e('0xd5')]({'where':{'id':_0x33b4b3[_0x0a9e('0x47')][_0x0a9e('0xd6')]},'raw':!![]})[_0x0a9e('0x14')](handleEntityNotFound(_0x33a26c,null));}})['then'](function(_0x35ace3){if(_0x35ace3){var _0x1c9ea2=_0x35ace3['ChatOfflineMessageId']!==null;var _0xf4fb77=path[_0x0a9e('0xd7')](config['root'],_0x0a9e('0xd8'));if(_0x1c9ea2){_0xf4fb77=path[_0x0a9e('0xd7')](_0xf4fb77,_0x0a9e('0xd9'));}var _0x569528=path[_0x0a9e('0xd7')](_0xf4fb77,_0x35ace3[_0x0a9e('0xda')]);return _0x33a26c[_0x0a9e('0xdb')](_0x569528);}})[_0x0a9e('0x37')](handleError(_0x33a26c,null));};exports[_0x0a9e('0xdc')]=function(_0x29fdfe,_0x3ba897){var _0x74d9b8=null;var _0x22767f=null;var _0x426c3c=null;if(_0x29fdfe['body']['id']){delete _0x29fdfe[_0x0a9e('0x2c')]['id'];}if(_0x29fdfe['body'][_0x0a9e('0xdd')]){_0x426c3c=path[_0x0a9e('0xd7')](config[_0x0a9e('0xde')],_0x0a9e('0xdf'),util[_0x0a9e('0xe0')](_0x0a9e('0xe1'),Date['now']()));_0x29fdfe[_0x0a9e('0x2c')][_0x0a9e('0xe2')]=_0x426c3c;}return db[_0x0a9e('0x43')]['find']({'where':{'id':_0x29fdfe[_0x0a9e('0xb2')]['id']},'include':[{'model':db[_0x0a9e('0xc9')],'as':_0x0a9e('0xe3'),'include':[{'model':db[_0x0a9e('0x74')],'as':_0x0a9e('0x74')}]}]})[_0x0a9e('0x14')](handleEntityNotFound(_0x3ba897,null))[_0x0a9e('0x14')](saveUpdates(_0x29fdfe['body'],null))[_0x0a9e('0x14')](function(_0x228c10){if(_0x228c10){_0x74d9b8=_0x228c10;return db[_0x0a9e('0xb8')][_0x0a9e('0x64')]({'where':{'id':_0x74d9b8[_0x0a9e('0x79')]}});}})[_0x0a9e('0x14')](function(_0x8120e){if(_0x8120e){_0x22767f=_0x8120e;return db['CmContact']['find']({'where':{'id':_0x74d9b8[_0x0a9e('0x6d')]}});}})[_0x0a9e('0x14')](function(_0x1f4929){if(_0x1f4929){if(_0x426c3c){var _0x1bf692=null;for(var _0x40e2da=0x1;_0x40e2da<_0x74d9b8[_0x0a9e('0xe3')][_0x0a9e('0x4d')];++_0x40e2da){_0x1bf692=_0x74d9b8['Messages'][_0x40e2da];var _0x39ea62=_0x1bf692[_0x0a9e('0x3d')]?util[_0x0a9e('0xe0')](_0x0a9e('0xe4'),_0x22767f[_0x0a9e('0xe5')],_0x1bf692[_0x0a9e('0x3d')]):_0x0a9e('0xe6');var _0x54f0b8=_0x29fdfe[_0x0a9e('0x2c')][_0x0a9e('0xe7')]||util[_0x0a9e('0xe0')]('%s%d',_0x0a9e('0xe8'),_0x1bf692[_0x0a9e('0x6d')]);switch(_0x22767f[_0x0a9e('0xe9')]){case _0x0a9e('0xea'):_0x39ea62=_0x1bf692['UserId']?util[_0x0a9e('0xe0')](_0x0a9e('0xe4'),_0x22767f[_0x0a9e('0xe5')],_0x1bf692[_0x0a9e('0x3d')]):_0x0a9e('0xe6');break;case _0x0a9e('0xeb'):_0x39ea62=_0x1bf692[_0x0a9e('0x3d')]?_0x1bf692[_0x0a9e('0x74')]['alias']||_0x1bf692[_0x0a9e('0x74')][_0x0a9e('0x31')]:_0x0a9e('0xe6');break;case _0x0a9e('0xec'):_0x39ea62=_0x1bf692['UserId']?_0x1bf692['User'][_0x0a9e('0x31')]:_0x0a9e('0xe6');break;default:_0x39ea62=_0x1bf692[_0x0a9e('0x3d')]?util['format'](_0x0a9e('0xe4'),_0x22767f[_0x0a9e('0xe5')],_0x1bf692['UserId']):_0x0a9e('0xe6');}var _0x5d19b1=util[_0x0a9e('0xe0')]('[%s]\x20%s:\x20%s\x0a',moment(_0x1bf692['createdAt'])['format'](_0x0a9e('0xed')),_0x1bf692[_0x0a9e('0xee')]==='in'?_0x54f0b8:_0x39ea62,_0x1bf692[_0x0a9e('0x2c')]);if(!_0x1bf692[_0x0a9e('0xef')]){fs[_0x0a9e('0xf0')](_0x426c3c,_0x5d19b1);}}return db[_0x0a9e('0xf1')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x0a9e('0xf2')],'as':_0x0a9e('0xf3'),'raw':!![],'include':[{'model':db[_0x0a9e('0xf4')],'as':_0x0a9e('0xf4'),'raw':!![]}]}]});}}})[_0x0a9e('0x14')](function(_0x18dccf){if(!_0x18dccf||!_0x18dccf[_0x0a9e('0xf3')]||!_0x29fdfe['body'])return _0x74d9b8;var _0x49baaa=_0x18dccf[_0x0a9e('0xf5')]();return respondWithRpcPromise('SendMail',_0x0a9e('0xf6'),{'account':_0x49baaa,'message':{'from':util[_0x0a9e('0xe0')](_0x0a9e('0xf7'),_0x18dccf[_0x0a9e('0x29')],_0x18dccf[_0x0a9e('0xbf')]||_0x18dccf[_0x0a9e('0xf3')]['user']),'to':_0x29fdfe[_0x0a9e('0x2c')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0x0a9e('0xe0')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x29fdfe[_0x0a9e('0x2c')]['mailTranscript']),'attachments':[{'path':_0x426c3c}]}})['then'](function(){return _0x74d9b8;})[_0x0a9e('0x37')](function(_0x4a7a3c){logger[_0x0a9e('0x19')](_0x4a7a3c);});})[_0x0a9e('0x14')](respondWithStatusCode(_0x3ba897,0xc8))[_0x0a9e('0x37')](handleError(_0x3ba897,null));};exports['addMessage']=function(_0x4152cd,_0x1209c4){return db[_0x0a9e('0xc9')]['find']({'where':{'id':_0x4152cd['params']['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x1209c4,null))[_0x0a9e('0x14')](function(_0x89d2cb){if(_0x89d2cb){return _0x89d2cb[_0x0a9e('0xf8')](_0x4152cd[_0x0a9e('0x2c')][_0x0a9e('0xf9')],_[_0x0a9e('0xfa')](_0x4152cd[_0x0a9e('0x2c')],[_0x0a9e('0xf9'),'id'])||{});}})[_0x0a9e('0x14')](respondWithResult(_0x1209c4,null))['catch'](handleError(_0x1209c4,null));};exports['getMessages']=function(_0x558171,_0x5975fa){var _0x19dcc2={'raw':![],'where':{}};var _0x2ce30f={};var _0x2d21c7={'count':0x0,'rows':[]};return db[_0x0a9e('0x43')][_0x0a9e('0xd5')]({'where':{'id':_0x558171[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x5975fa,null))['then'](function(_0x5c3ecf){if(_0x5c3ecf){_0x2ce30f[_0x0a9e('0x4a')]=_[_0x0a9e('0x76')](db['ChatMessage'][_0x0a9e('0x44')]);_0x2ce30f[_0x0a9e('0x47')]=_[_0x0a9e('0x76')](_0x558171[_0x0a9e('0x47')]);_0x2ce30f[_0x0a9e('0x48')]=_[_0x0a9e('0x49')](_0x2ce30f[_0x0a9e('0x4a')],_0x2ce30f[_0x0a9e('0x47')]);_0x19dcc2[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0x2ce30f[_0x0a9e('0x4a')],qs[_0x0a9e('0x4c')](_0x558171['query'][_0x0a9e('0x4c')]));_0x19dcc2[_0x0a9e('0x4b')]=_0x19dcc2[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x19dcc2[_0x0a9e('0x4b')]:_0x2ce30f[_0x0a9e('0x4a')];if(!_0x558171[_0x0a9e('0x47')][_0x0a9e('0xfb')](_0x0a9e('0x4e'))){_0x19dcc2[_0x0a9e('0x22')]=qs[_0x0a9e('0x22')](_0x558171[_0x0a9e('0x47')]['limit']);_0x19dcc2['offset']=qs[_0x0a9e('0x20')](_0x558171[_0x0a9e('0x47')][_0x0a9e('0x20')]);}_0x19dcc2[_0x0a9e('0x4f')]=qs[_0x0a9e('0x50')](_0x558171[_0x0a9e('0x47')][_0x0a9e('0x50')]);_0x19dcc2['where']=qs[_0x0a9e('0x48')](_['pick'](_0x558171[_0x0a9e('0x47')],_0x2ce30f[_0x0a9e('0x48')]));_0x19dcc2[_0x0a9e('0x7a')][_0x0a9e('0xfc')]=_0x5c3ecf['id'];if(_0x558171[_0x0a9e('0x47')][_0x0a9e('0x87')]){_0x19dcc2[_0x0a9e('0x7a')]=_[_0x0a9e('0x2b')](_0x19dcc2[_0x0a9e('0x7a')],{'$or':_[_0x0a9e('0x42')](_0x19dcc2[_0x0a9e('0x4b')],function(_0x8231e5){var _0x43111e={};_0x43111e[_0x8231e5]={'$like':'%'+_0x558171[_0x0a9e('0x47')][_0x0a9e('0x87')]+'%'};return _0x43111e;})});}if(_0x558171[_0x0a9e('0x47')]['$gte']){var _0x54cf62=_0x558171[_0x0a9e('0x47')][_0x0a9e('0x7e')]['split'](',');var _0x5500de={};_0x5500de[_0x54cf62[0x0]]={'$gte':moment(_0x54cf62[0x1])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))};_0x19dcc2[_0x0a9e('0x7a')]=_['merge'](_0x19dcc2[_0x0a9e('0x7a')],_0x5500de);}_0x19dcc2=_['merge']({},_0x19dcc2,_0x558171[_0x0a9e('0xb5')]);return db['ChatMessage'][_0x0a9e('0x23')]({'where':_0x19dcc2['where']})[_0x0a9e('0x14')](function(_0x21e210){_0x2d21c7[_0x0a9e('0x23')]=_0x21e210;if(_0x558171['query'][_0x0a9e('0xb3')]){_0x19dcc2['include']=[{'all':!![]}];}return db['ChatMessage'][_0x0a9e('0xfe')](_0x19dcc2);})[_0x0a9e('0x14')](function(_0x3c691f){_0x2d21c7[_0x0a9e('0xb1')]=_0x3c691f;return _0x2d21c7;});}})[_0x0a9e('0x14')](respondWithFilteredResult(_0x5975fa,_0x19dcc2))[_0x0a9e('0x37')](handleError(_0x5975fa,null));};exports[_0x0a9e('0xff')]=function(_0x82504f,_0x1a3143){var _0x151f16={'where':{}},_0xd6938={},_0x98bf26={'count':0x0,'rows':[]};return db[_0x0a9e('0x43')][_0x0a9e('0xd5')]({'where':{'id':_0x82504f[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x1a3143,null))[_0x0a9e('0x14')](function(_0x643f66){if(_0x643f66){_0xd6938[_0x0a9e('0x4a')]=_['keys'](db[_0x0a9e('0xc9')][_0x0a9e('0x44')]);_0xd6938[_0x0a9e('0x47')]=_[_0x0a9e('0x76')](_0x82504f['query']);_0xd6938['filters']=_['intersection'](_0xd6938[_0x0a9e('0x4a')],_0xd6938['query']);_0x151f16[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0xd6938[_0x0a9e('0x4a')],qs[_0x0a9e('0x4c')](_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x4c')]));_0x151f16[_0x0a9e('0x4b')]=_0x151f16[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x151f16[_0x0a9e('0x4b')]:_0xd6938['model'];if(!_0x82504f[_0x0a9e('0x47')]['hasOwnProperty'](_0x0a9e('0x4e'))){_0x151f16['limit']=qs[_0x0a9e('0x22')](_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x22')]);_0x151f16['offset']=qs[_0x0a9e('0x20')](_0x82504f[_0x0a9e('0x47')]['offset']);}_0x151f16['order']=qs[_0x0a9e('0x50')](_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x50')]);_0x151f16['where']=qs['filters'](_['pick'](_0x82504f[_0x0a9e('0x47')],_0xd6938[_0x0a9e('0x48')]));_0x151f16[_0x0a9e('0x7a')][_0x0a9e('0xfc')]=_0x643f66['id'];if(_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x87')]){_0x151f16[_0x0a9e('0x7a')]=_[_0x0a9e('0x2b')](_0x151f16[_0x0a9e('0x7a')],{'$or':_[_0x0a9e('0x42')](_0x151f16[_0x0a9e('0x4b')],function(_0x2f4de1){var _0x13215c={};_0x13215c[_0x2f4de1]={'$like':'%'+_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x87')]+'%'};return _0x13215c;})});}_0x151f16[_0x0a9e('0x7a')][_0x0a9e('0xef')]=![];if(_0x82504f[_0x0a9e('0x47')]['id']){_0x151f16['where']['id']={'$gt':_0x82504f[_0x0a9e('0x47')]['id']};}_0x151f16=_[_0x0a9e('0x2b')]({},_0x151f16,_0x82504f[_0x0a9e('0xb5')]);return db[_0x0a9e('0xc9')][_0x0a9e('0x23')]({'where':_0x151f16[_0x0a9e('0x7a')]})['then'](function(_0x4739ed){_0x98bf26[_0x0a9e('0x23')]=_0x4739ed;_0x151f16[_0x0a9e('0xb4')]=[];if(_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x100')]){_0x151f16[_0x0a9e('0xb4')][_0x0a9e('0x36')]({'model':db[_0x0a9e('0x74')],'as':_0x0a9e('0x74'),'attributes':['id','fullname','alias']});}if(_0x82504f[_0x0a9e('0x47')][_0x0a9e('0xb3')]){_0x151f16['include']=[{'all':!![]}];}return db[_0x0a9e('0xc9')][_0x0a9e('0xfe')](_0x151f16);})['then'](function(_0x1ca7c8){_0x98bf26['rows']=_0x1ca7c8;return _0x98bf26;});}})[_0x0a9e('0x14')](respondWithFilteredResult(_0x1a3143,_0x151f16))[_0x0a9e('0x37')](handleError(_0x1a3143,null));};exports['addTags']=function(_0x27a41c,_0x31ab12){return db['ChatInteraction'][_0x0a9e('0x64')]({'where':{'id':_0x27a41c[_0x0a9e('0xb2')]['id']}})['then'](handleEntityNotFound(_0x31ab12,null))[_0x0a9e('0x14')](function(_0x237994){if(_0x237994){return _0x237994[_0x0a9e('0x101')](_0x27a41c[_0x0a9e('0x2c')][_0x0a9e('0xf9')],_[_0x0a9e('0xfa')](_0x27a41c['body'],[_0x0a9e('0xf9'),'id'])||{})[_0x0a9e('0x102')](function(){return db['Tag'][_0x0a9e('0xfe')]({'attributes':['id',_0x0a9e('0x29'),_0x0a9e('0x103')],'where':{'id':_0x27a41c[_0x0a9e('0x2c')][_0x0a9e('0xf9')]}});})[_0x0a9e('0x14')](function(_0x368a12){socket['emit']('chatInteractionTags:save',{'id':Number(_0x27a41c['params']['id']),'tags':_0x368a12||[]});return{'id':Number(_0x27a41c['params']['id']),'tags':_0x368a12||[]};});}})['then'](respondWithResult(_0x31ab12,null))[_0x0a9e('0x37')](handleError(_0x31ab12,null));};exports[_0x0a9e('0x104')]=function(_0x556344,_0x5c23aa){return db[_0x0a9e('0x43')]['find']({'where':{'id':_0x556344[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x5c23aa,null))[_0x0a9e('0x14')](function(_0x175c97){if(_0x175c97){return _0x175c97[_0x0a9e('0x104')](_0x556344[_0x0a9e('0x47')]['ids']);}})[_0x0a9e('0x14')](respondWithStatusCode(_0x5c23aa,null))[_0x0a9e('0x37')](handleError(_0x5c23aa,null));};exports['download']=function(_0x44cdb8,_0x1c0d54){var _0x2e0e9b=moment()[_0x0a9e('0x105')]()[_0x0a9e('0x99')]();var _0x2f1cc0=path[_0x0a9e('0xd7')](config['root'],_0x0a9e('0x106'),'files',_0x0a9e('0x107'));var _0xd456e6=path['join'](config[_0x0a9e('0xde')],_0x0a9e('0x106'),'files',_0x0a9e('0x108'));var _0x4e03f5=path[_0x0a9e('0xd7')](_0x2f1cc0,_0x2e0e9b);var _0x9c686f=util['format'](_0x0a9e('0x109'),_0x44cdb8['params']['id'],_0x2e0e9b);var _0x1d046c=path[_0x0a9e('0xd7')](_0x2f1cc0,_0x9c686f);var _0x732141=[];_0x732141[_0x0a9e('0x36')]({'model':db[_0x0a9e('0x74')],'as':_0x0a9e('0x74'),'attributes':['id',_0x0a9e('0x31')],'raw':!![]});_0x732141['push']({'model':db[_0x0a9e('0xcd')],'as':_0x0a9e('0x69'),'attributes':['id',_0x0a9e('0x10a'),_0x0a9e('0x10b')],'raw':!![]});if(_0x44cdb8[_0x0a9e('0x47')]['attachments']){_0x732141[_0x0a9e('0x36')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x3a459c=[{'model':db['ChatMessage'],'as':_0x0a9e('0xe3'),'attributes':['id',_0x0a9e('0x2c'),'createdAt',_0x0a9e('0xee'),_0x0a9e('0xef'),_0x0a9e('0x84')],'include':_0x732141}];_0x3a459c[_0x0a9e('0x36')]({'model':db[_0x0a9e('0xb8')],'as':_0x0a9e('0x10c'),'attributes':['id',_0x0a9e('0x29')]});_0x3a459c[_0x0a9e('0x36')]({'model':db[_0x0a9e('0x74')],'as':'Owner','attributes':['id',_0x0a9e('0x31')]});return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x44cdb8[_0x0a9e('0xb2')]['id']},'include':_0x3a459c})['then'](handleEntityNotFound(_0x1c0d54,null))[_0x0a9e('0x14')](function(_0x439f25){if(_0x439f25){var _0x333d3c=_0x439f25['get']({'plain':!![]});fs[_0x0a9e('0x10d')](_0x4e03f5);var _0x2191c6={'channel':_0x0a9e('0x10e'),'account':_0x333d3c['Account'][_0x0a9e('0x29')],'agent':_0x333d3c['Owner']?_0x333d3c[_0x0a9e('0x10f')][_0x0a9e('0x31')]:_0x0a9e('0x110'),'createdAt':moment(_0x333d3c[_0x0a9e('0x7c')])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))[_0x0a9e('0x99')](),'closedAt':_0x333d3c['closed']?moment(_0x333d3c[_0x0a9e('0x111')])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))[_0x0a9e('0x99')]():'','disposition':_0x333d3c[_0x0a9e('0x3f')],'chatInfo':{'browser':_0x333d3c[_0x0a9e('0x112')],'os':_0x333d3c[_0x0a9e('0x113')],'referer':_0x333d3c[_0x0a9e('0x114')],'customerIp':_0x333d3c[_0x0a9e('0x115')],'customerPort':_0x333d3c[_0x0a9e('0x116')]?_0x333d3c[_0x0a9e('0x116')]:_0x0a9e('0x110')},'messages':_(_0x333d3c[_0x0a9e('0xe3')])[_0x0a9e('0x117')]()[_0x0a9e('0x87')]({'secret':![]})[_0x0a9e('0x42')](function(_0x1008a1){if(_0x1008a1[_0x0a9e('0xd3')]){var _0x6276a4=path[_0x0a9e('0xd7')](_0xd456e6,_0x1008a1[_0x0a9e('0xd3')][_0x0a9e('0xda')]);if(fs[_0x0a9e('0x118')](_0x6276a4)){fs['createReadStream'](_0x6276a4)[_0x0a9e('0x119')](fs[_0x0a9e('0x11a')](path[_0x0a9e('0xd7')](_0x4e03f5,_0x1008a1['Attachment'][_0x0a9e('0xda')])));}}return{'date':moment(_0x1008a1['createdAt'])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))[_0x0a9e('0x99')](),'sender':_0x1008a1[_0x0a9e('0xee')]===_0x0a9e('0xc8')?_0x1008a1[_0x0a9e('0x74')]?_0x1008a1[_0x0a9e('0x74')][_0x0a9e('0x31')]:'System':_0x1008a1[_0x0a9e('0x69')][_0x0a9e('0x10a')]+(_0x1008a1['Contact'][_0x0a9e('0x10b')]?'\x20'+_0x1008a1[_0x0a9e('0x69')][_0x0a9e('0x10b')]:''),'body':_0x1008a1['Attachment']?_0x1008a1[_0x0a9e('0xd3')][_0x0a9e('0xda')]:_0x1008a1[_0x0a9e('0x2c')],'direction':_0x1008a1[_0x0a9e('0xee')]==='out'?'A':'C','secret':_0x1008a1[_0x0a9e('0xef')],'read':_0x1008a1[_0x0a9e('0x84')],'attachment':_0x1008a1[_0x0a9e('0xd3')]};})[_0x0a9e('0x6b')]()};return ejs[_0x0a9e('0x11b')](path['join'](config[_0x0a9e('0xde')],_0x0a9e('0x106'),'views',_0x0a9e('0x11c')),{'interaction':_0x2191c6})[_0x0a9e('0x14')](function(_0x38284a){var _0x54246a=path['join'](_0x4e03f5,_0x0a9e('0x11d')+_0x333d3c['id']+'-'+_0x2e0e9b+_0x0a9e('0x11e'));var _0x271485={'path':_0x54246a,'channel':_0x0a9e('0x10e'),'interactionId':_0x333d3c['id']};return pdf[_0x0a9e('0x11f')](_0x38284a,_0x271485);})[_0x0a9e('0x14')](function(){return new Promise(function(_0x312e02,_0x221274){zipdir(_0x4e03f5,{'saveTo':_0x1d046c},function(_0x54c9d6,_0x5cc8cb){if(_0x54c9d6)return _0x221274(_0x54c9d6);return _0x312e02(_0x5cc8cb);});})[_0x0a9e('0x14')](function(){return new BPromise(function(_0x5330c2,_0x803bc){rimraf(_0x4e03f5,function(_0xef29b6){if(_0xef29b6)_0x803bc(_0xef29b6);return _0x5330c2();});});})[_0x0a9e('0x14')](function(){return _0x1c0d54[_0x0a9e('0xdb')](_0x1d046c,_0x9c686f,function(_0x57b11b){if(_0x57b11b){logger[_0x0a9e('0x19')](_0x0a9e('0x120'),_0x57b11b);}else{fs['unlinkSync'](_0x1d046c);}});});});}else{return _0x1c0d54[_0x0a9e('0x1c')](0xc8);}})['catch'](handleError(_0x1c0d54,null));};
\ No newline at end of file
+var _0xa9e0=['createPdfFromHTML','err','rimraf','zip-dir','request-promise','mustache','path','ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','error','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','stack','name','render','merge','body','contact','agent','account','Users','fullname','Tags','TagIds','split','forEach','push','catch','waiting','answered','unmanaged','abandoned','closed','UserId','talking','disposition','total','index','map','ChatInteraction','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','select','field','from','u.fullname','user_has_chat_interactions','users','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','left_join','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','search','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)','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','keys','compact','isEmpty','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','group','i.id','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','params','includeAll','include','options','create','describe','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','vidaooMetadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','attachmentUpload','file','originalname','filename','Attachment','Unauthorized','findOne','attachId','join','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','hasOwnProperty','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','setTags','spread','color','removeTags','unix','server','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','mkdirSync','Chat','Owner','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','renderFile','downloadInteraction.ejs','transcript-','.pdf'];(function(_0x1f21bc,_0x4b89b8){var _0x115182=function(_0x366734){while(--_0x366734){_0x1f21bc['push'](_0x1f21bc['shift']());}};_0x115182(++_0x4b89b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var rimraf=require(_0x0a9e('0x0'));var zipdir=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x3'));var util=require('util');var path=require(_0x0a9e('0x4'));var ejs=require(_0x0a9e('0x5'));var fs=require('fs');var _=require(_0x0a9e('0x6'));var squel=require(_0x0a9e('0x7'));var Redis=require(_0x0a9e('0x8'));var qs=require('../../components/parsers/qs');var as=require(_0x0a9e('0x9'));var pdf=require(_0x0a9e('0xa'));var logger=require(_0x0a9e('0xb'))('api');var config=require('../../config/environment');var db=require(_0x0a9e('0xc'))['db'];config['redis']=_['defaults'](config[_0x0a9e('0xd')],{'host':_0x0a9e('0xe'),'port':0x18eb});var socket=require(_0x0a9e('0xf'))(new Redis(config[_0x0a9e('0xd')]));require(_0x0a9e('0x10'))[_0x0a9e('0x11')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});var client9004=jayson['client'][_0x0a9e('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x36471c,_0xd5b662,_0x26d672,_0x32d742){return new BPromise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_0x32d742||client;return _0x4283ce[_0x0a9e('0x13')](_0x36471c,_0x26d672)[_0x0a9e('0x14')](function(_0x281129){logger[_0x0a9e('0x15')](_0x0a9e('0x16'),_0xd5b662,'request\x20sent');logger[_0x0a9e('0x17')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xd5b662,_0x0a9e('0x18'),JSON['stringify'](_0x281129));if(_0x281129[_0x0a9e('0x19')]){if(_0x281129[_0x0a9e('0x19')]['code']===0x1f4){logger[_0x0a9e('0x19')]('ChatInteraction,\x20%s,\x20%s',_0xd5b662,_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);return _0x5db4b0(_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);}logger[_0x0a9e('0x19')](_0x0a9e('0x16'),_0xd5b662,_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);return _0x69aeb7(_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);}else{logger[_0x0a9e('0x15')](_0x0a9e('0x16'),_0xd5b662,'request\x20sent');_0x69aeb7(_0x281129[_0x0a9e('0x1b')][_0x0a9e('0x1a')]);}})['catch'](function(_0x20f109){logger['error']('ChatInteraction,\x20%s,\x20%s',_0xd5b662,_0x20f109);_0x5db4b0(_0x20f109);});});}function respondWithStatusCode(_0x3a02e1,_0x432e56){_0x432e56=_0x432e56||0xcc;return function(_0x38e7c4){if(_0x38e7c4){return _0x3a02e1[_0x0a9e('0x1c')](_0x432e56);}return _0x3a02e1['status'](_0x432e56)[_0x0a9e('0x1d')]();};}function respondWithResult(_0x2fb0e4,_0x3b45bc){_0x3b45bc=_0x3b45bc||0xc8;return function(_0x4d00e6){if(_0x4d00e6){return _0x2fb0e4[_0x0a9e('0x1e')](_0x3b45bc)[_0x0a9e('0x1f')](_0x4d00e6);}};}function respondWithFilteredResult(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(_0x59181e){var _0x197ec0=typeof _0x5ea472[_0x0a9e('0x20')]===_0x0a9e('0x21')&&typeof _0x5ea472[_0x0a9e('0x22')]==='undefined';var _0x384319=_0x59181e['count'];var _0x45a1e7=_0x197ec0?0x0:_0x5ea472['offset'];var _0x1dc186=_0x197ec0?_0x59181e[_0x0a9e('0x23')]:_0x5ea472[_0x0a9e('0x20')]+_0x5ea472[_0x0a9e('0x22')];var _0x140511;if(_0x1dc186>=_0x384319){_0x1dc186=_0x384319;_0x140511=0xc8;}else{_0x140511=0xce;}_0x16b1ca[_0x0a9e('0x1e')](_0x140511);return _0x16b1ca[_0x0a9e('0x24')](_0x0a9e('0x25'),_0x45a1e7+'-'+_0x1dc186+'/'+_0x384319)['json'](_0x59181e);}return null;};}function saveUpdates(_0x3652a7){return function(_0x468813){if(_0x468813){return _0x468813[_0x0a9e('0x26')](_0x3652a7)[_0x0a9e('0x14')](function(_0x5c877d){return _0x5c877d;});}return null;};}function removeEntity(_0x15b200){return function(_0x40e7a3){if(_0x40e7a3){return _0x40e7a3[_0x0a9e('0x27')]()[_0x0a9e('0x14')](function(){_0x15b200[_0x0a9e('0x1e')](0xcc)[_0x0a9e('0x1d')]();});}};}function handleEntityNotFound(_0x296f41){return function(_0x2e8759){if(!_0x2e8759){_0x296f41[_0x0a9e('0x1c')](0x194);}return _0x2e8759;};}function handleError(_0x540530,_0x426950){_0x426950=_0x426950||0x1f4;return function(_0x5d1e0e){logger[_0x0a9e('0x19')](_0x5d1e0e[_0x0a9e('0x28')]);if(_0x5d1e0e[_0x0a9e('0x29')]){delete _0x5d1e0e[_0x0a9e('0x29')];}_0x540530[_0x0a9e('0x1e')](_0x426950)['send'](_0x5d1e0e);};}function getMustacheRender(_0x66c1d2,_0x46f0a5){return Mustache[_0x0a9e('0x2a')](_0x66c1d2,_[_0x0a9e('0x2b')](_0x46f0a5[_0x0a9e('0x2c')],{'contact':_0x46f0a5[_0x0a9e('0x2d')],'message':_0x46f0a5[_0x0a9e('0x1a')],'agent':_0x46f0a5[_0x0a9e('0x2e')],'interaction':_0x46f0a5['interaction'],'account':_0x46f0a5[_0x0a9e('0x2f')]}))||'';}function getInteractionUsers(_0x5e7238,_0x2cc7a0){return new BPromise(function(_0x14b13f,_0x2b7e7f){try{if(_0x2cc7a0[_0x5e7238['id']]){_0x5e7238[_0x0a9e('0x30')]=_['map'](_0x2cc7a0[_0x5e7238['id']],function(_0x191e91){return{'id':_0x191e91['id'],'fullname':_0x191e91[_0x0a9e('0x31')]};});}}catch(_0x1fa90d){_0x2b7e7f(_0x1fa90d);}_0x14b13f(_0x5e7238);});}function getInteractionTags(_0x15de0e,_0x4853b1){return new BPromise(function(_0x54135e,_0x1e8694){try{if(_0x15de0e['TagIds']){_0x15de0e[_0x0a9e('0x32')]=[];_0x15de0e[_0x0a9e('0x33')][_0x0a9e('0x34')](',')[_0x0a9e('0x35')](function(_0x4f41ae){_0x15de0e[_0x0a9e('0x32')][_0x0a9e('0x36')](_0x4853b1[_0x4f41ae]);});}delete _0x15de0e[_0x0a9e('0x33')];}catch(_0x533942){_0x1e8694(_0x533942);}_0x54135e(_0x15de0e);});}function updateChatInteraction(_0x1dbf74,_0x1a180b,_0x289467){return new BPromise(function(_0x4c1c0e,_0x546ef8){return getInteractionUsers(_0x1dbf74,_0x289467)[_0x0a9e('0x14')](function(_0x40d766){return getInteractionTags(_0x40d766,_0x1a180b);})['then'](function(_0x2b814e){return getStateInteraction(_0x2b814e);})[_0x0a9e('0x14')](function(_0x2e1b3a){_0x4c1c0e(_0x2e1b3a);})[_0x0a9e('0x37')](function(_0x4b38d9){_0x546ef8(_0x4b38d9);});});}function getStateInteraction(_0x5a594b){return new BPromise(function(_0x15e37d){_0x5a594b[_0x0a9e('0x38')]=0x0;_0x5a594b['talking']=0x0;_0x5a594b[_0x0a9e('0x39')]=0x0;_0x5a594b[_0x0a9e('0x3a')]=0x0;_0x5a594b[_0x0a9e('0x3b')]=0x0;_0x5a594b['total']=0x0;if(!_0x5a594b[_0x0a9e('0x3c')]&&!_0x5a594b[_0x0a9e('0x3d')]){_0x5a594b[_0x0a9e('0x38')]+=0x1;}if(!_0x5a594b[_0x0a9e('0x3c')]&&_0x5a594b[_0x0a9e('0x3d')]){_0x5a594b[_0x0a9e('0x3e')]+=0x1;if(_0x5a594b[_0x0a9e('0x38')]){_0x5a594b[_0x0a9e('0x38')]-=0x1;}}if(_0x5a594b[_0x0a9e('0x3c')]&&_0x5a594b[_0x0a9e('0x3f')]===_0x0a9e('0x3b')){_0x5a594b[_0x0a9e('0x3b')]+=0x1;if(_0x5a594b[_0x0a9e('0x38')]){_0x5a594b[_0x0a9e('0x38')]-=0x1;}}else if(_0x5a594b[_0x0a9e('0x3c')]&&!_0x5a594b['UserId']&&_0x5a594b['disposition']){_0x5a594b[_0x0a9e('0x3a')]+=0x1;if(_0x5a594b[_0x0a9e('0x38')]){_0x5a594b[_0x0a9e('0x38')]-=0x1;}}else if(_0x5a594b[_0x0a9e('0x3c')]&&_0x5a594b[_0x0a9e('0x3d')]){_0x5a594b[_0x0a9e('0x39')]+=0x1;if(_0x5a594b[_0x0a9e('0x3e')]){_0x5a594b[_0x0a9e('0x3e')]-=0x1;}}_0x5a594b[_0x0a9e('0x40')]+=0x1;_0x15e37d(_0x5a594b);});}exports[_0x0a9e('0x41')]=function(_0x2c2cb0,_0x35ed4a){var _0x5026aa={},_0x117c99={},_0x138b8b={'count':0x0,'rows':[]};var _0xdd268f=_[_0x0a9e('0x42')](db[_0x0a9e('0x43')][_0x0a9e('0x44')],function(_0x21eb86){return{'name':_0x21eb86[_0x0a9e('0x45')],'type':_0x21eb86['type'][_0x0a9e('0x46')]};});_0x117c99['model']=_[_0x0a9e('0x42')](_0xdd268f,_0x0a9e('0x29'));_0x117c99[_0x0a9e('0x47')]=_['keys'](_0x2c2cb0[_0x0a9e('0x47')]);_0x117c99[_0x0a9e('0x48')]=_[_0x0a9e('0x49')](_0x117c99[_0x0a9e('0x4a')],_0x117c99[_0x0a9e('0x47')]);_0x5026aa[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0x117c99['model'],qs[_0x0a9e('0x4c')](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x4c')]));_0x5026aa[_0x0a9e('0x4b')]=_0x5026aa[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x5026aa[_0x0a9e('0x4b')]:_0x117c99[_0x0a9e('0x4a')];if(!_0x2c2cb0[_0x0a9e('0x47')]['hasOwnProperty'](_0x0a9e('0x4e'))){_0x5026aa[_0x0a9e('0x22')]=qs['limit'](_0x2c2cb0['query']['limit']);_0x5026aa[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x20')]);}_0x5026aa[_0x0a9e('0x4f')]=qs[_0x0a9e('0x50')](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x50')]);_0x5026aa['where']=qs['filters'](_['pick'](_0x2c2cb0[_0x0a9e('0x47')],_0x117c99[_0x0a9e('0x48')]),_0xdd268f);var _0x14d602=[];var _0x5bb3ed=squel[_0x0a9e('0x51')]()[_0x0a9e('0x52')]('id')['field']('name')[_0x0a9e('0x52')]('color')[_0x0a9e('0x53')]('tools_tags');var _0x2e5e62=squel[_0x0a9e('0x51')]()[_0x0a9e('0x52')]('u.id')[_0x0a9e('0x52')](_0x0a9e('0x54'))['field']('ui.ChatInteractionId')[_0x0a9e('0x53')](_0x0a9e('0x55'),'ui')['left_join'](_0x0a9e('0x56'),'u','u.id\x20=\x20ui.UserId');var _0x211ef9=squel['select']()[_0x0a9e('0x53')]('chat_interactions','i')['left_join']('cm_contacts','c',_0x0a9e('0x57'))['left_join'](_0x0a9e('0x56'),'o',_0x0a9e('0x58'))[_0x0a9e('0x59')](_0x0a9e('0x5a'),'a',_0x0a9e('0x5b'))[_0x0a9e('0x59')](_0x0a9e('0x5c'),'me',_0x0a9e('0x5d'))['left_join'](_0x0a9e('0x5e'),'it',_0x0a9e('0x5f'))[_0x0a9e('0x59')](_0x0a9e('0x60'),'t',_0x0a9e('0x61'));var _0x156662=squel['expr']();var _0x956fbe=[];var _0x26bc80=squel['expr']();var _0x3649cc;if(_0x2c2cb0['query'][_0x0a9e('0x62')]){_0x3649cc=as['parseSearch'](_0x2c2cb0['query']['search']);var _0x273cb5=_0x3649cc['sqlOperator'];for(var _0x2244d6=0x0;_0x2244d6<_0x3649cc[_0x0a9e('0x63')][_0x0a9e('0x4d')];_0x2244d6++){var _0x7be420=_0x3649cc[_0x0a9e('0x63')][_0x2244d6];var _0x26d7db='i';var _0x49eed0=_[_0x0a9e('0x64')](_0xdd268f,['name',_0x7be420[_0x0a9e('0x52')]]);if(!_0x49eed0){switch(_0x7be420[_0x0a9e('0x52')]){case _0x0a9e('0x65'):if(_0x7be420['value']==0x1){_0x211ef9[_0x0a9e('0x66')]('`'+_0x7be420[_0x0a9e('0x52')]+_0x0a9e('0x67'));}else{_0x211ef9[_0x0a9e('0x66')]('`'+_0x7be420['field']+_0x0a9e('0x68'));}break;case _0x0a9e('0x69'):if(_0x7be420['operator']===_0x0a9e('0x6a')){if(_0x7be420[_0x0a9e('0x6b')][_0x0a9e('0x34')]('\x20')[_0x0a9e('0x4d')]>0x1){_0x156662[_0x273cb5](_0x0a9e('0x6c'),qs['getFullTextValue'](_0x7be420[_0x0a9e('0x6b')]),null);}else{var _0x2937e0='%'+_0x7be420[_0x0a9e('0x6b')]+'%';_0x156662[_0x273cb5]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2937e0,_0x2937e0,_0x2937e0);}}else{_0x49eed0=_[_0x0a9e('0x64')](_0xdd268f,['name','ContactId']);_0x7be420[_0x0a9e('0x52')]=_0x0a9e('0x6d');_0x235f8f=as[_0x0a9e('0x6e')](_0x26d7db,_0x49eed0[_0x0a9e('0x6f')],_0x7be420);_0x156662[_0x273cb5](_0x235f8f[_0x0a9e('0x70')],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x71')],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x1d')]);}break;case _0x0a9e('0x72'):var _0x2e89b7=_0x7be420[_0x0a9e('0x6b')][_0x0a9e('0x34')](',')[_0x0a9e('0x42')](function(_0x320898){return Number(_0x320898);});_0x2e89b7[_0x0a9e('0x35')](function(_0x2a28c0){_0x26bc80['or'](_0x0a9e('0x73'),'%,'+_0x2a28c0+',%');});_0x956fbe=_['union'](_0x956fbe,_0x2e89b7);break;case _0x0a9e('0x74'):if(_0x7be420[_0x0a9e('0x75')]===_0x0a9e('0x6a')){_0x156662[_0x273cb5]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x7be420[_0x0a9e('0x6b')]+'%',null);}else{_0x49eed0=_[_0x0a9e('0x64')](_0xdd268f,['name',_0x0a9e('0x3d')]);_0x7be420[_0x0a9e('0x52')]=_0x0a9e('0x3d');_0x235f8f=as[_0x0a9e('0x6e')](_0x26d7db,_0x49eed0[_0x0a9e('0x6f')],_0x7be420);_0x156662[_0x273cb5](_0x235f8f['text'],_0x235f8f['value']['start'],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x1d')]);}break;case _0x0a9e('0x2c'):_0x235f8f=as[_0x0a9e('0x6e')]('me',null,_0x7be420);_0x156662[_0x273cb5](_0x235f8f[_0x0a9e('0x70')],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x71')],_0x235f8f[_0x0a9e('0x6b')]['end']);break;}}else{var _0x235f8f=as[_0x0a9e('0x6e')](_0x26d7db,_0x49eed0[_0x0a9e('0x6f')],_0x7be420);_0x156662[_0x273cb5](_0x235f8f['text'],_0x235f8f[_0x0a9e('0x6b')]['start'],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x1d')]);}}}else{var _0x4c46c1=_(_0x2c2cb0[_0x0a9e('0x47')])[_0x0a9e('0x76')]()[_0x0a9e('0x42')](function(_0x317c0c){return _['some'](_0xdd268f,[_0x0a9e('0x29'),_0x317c0c])?_0x317c0c:undefined;})[_0x0a9e('0x77')]()[_0x0a9e('0x6b')]();if(!_[_0x0a9e('0x78')](_0x4c46c1)){_0x4c46c1['forEach'](function(_0x109ccb){if(_0x109ccb===_0x0a9e('0x79')){_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x7b'),[]['concat'](_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb]));}else if(_0x109ccb===_0x0a9e('0x7c')){var _0x30a4c7=JSON[_0x0a9e('0x7d')](_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb])[_0x0a9e('0x7e')];var _0x40fc56=JSON[_0x0a9e('0x7d')](_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb])[_0x0a9e('0x7f')];_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x80'),_0x30a4c7,_0x40fc56);}else{if(_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb]===_0x0a9e('0x81')){_0x211ef9['where']('i.'+_0x109ccb+_0x0a9e('0x82'));}else{_0x211ef9[_0x0a9e('0x7a')]('i.'+_0x109ccb+_0x0a9e('0x83'),_0x2c2cb0['query'][_0x109ccb]);}}});}if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x84')]){if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x84')]==0x1){_0x211ef9['having']('`unreadMessages`\x20=\x200');}else{_0x211ef9[_0x0a9e('0x66')](_0x0a9e('0x85'));}}if(_0x2c2cb0['query'][_0x0a9e('0x86')]){_0x956fbe=_['isArray'](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x86')])?_0x2c2cb0['query'][_0x0a9e('0x86')]:new Array(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x86')]);_0x956fbe[_0x0a9e('0x35')](function(_0x3755fe){_0x26bc80['or'](_0x0a9e('0x73'),'%,'+_0x3755fe+',%');});}if(_0x2c2cb0[_0x0a9e('0x47')]['filter']){var _0x2973d3=_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x87')][_0x0a9e('0x88')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x0a9e('0x89')](_0x2973d3)){_0x156662['or'](_0x0a9e('0x8a'),_0x2973d3+'%');}else{_0x156662['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x8b')](_0x2973d3))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2973d3+'%');}}}_0x211ef9[_0x0a9e('0x7a')](_0x156662);_0x211ef9[_0x0a9e('0x8c')](_0x0a9e('0x8d'));var _0x385d52={'type':db['Sequelize']['QueryTypes'][_0x0a9e('0x8e')],'raw':!![]};var _0x2b9c01=_0x211ef9[_0x0a9e('0x8f')]();_0x2b9c01['field'](_0x0a9e('0x8d'));_0x2b9c01[_0x0a9e('0x52')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x5026aa[_0x0a9e('0x4f')]){_0x5026aa['order']['forEach'](function(_0x4dc6b3){var _0x81d748=_0x4dc6b3[0x0]===_0x0a9e('0x90')?_0x4dc6b3[0x0]:'i.'+_0x4dc6b3[0x0];_0x211ef9[_0x0a9e('0x4f')](_0x81d748,_0x4dc6b3[0x1]===_0x0a9e('0x91')?![]:!![]);});}if(!_[_0x0a9e('0x78')](_0x956fbe)){_0x211ef9[_0x0a9e('0x66')](_0x26bc80);_0x2b9c01['where'](_0x0a9e('0x92'),_0x956fbe);}BPromise['resolve']()[_0x0a9e('0x14')](function(){if(!_0x3649cc){if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x79')])return;_0x2b9c01[_0x0a9e('0x7a')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x93'));return;}if(_0x2c2cb0[_0x0a9e('0x94')]['role']!==_0x0a9e('0x2e'))return;return _0x2c2cb0[_0x0a9e('0x94')][_0x0a9e('0x95')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x14')](function(_0x255e49){if(_[_0x0a9e('0x78')](_0x255e49)){_0x2b9c01[_0x0a9e('0x7a')](_0x0a9e('0x96'));_0x211ef9['where'](_0x0a9e('0x96'));}else{_0x2b9c01[_0x0a9e('0x7a')]('i.ChatWebsiteId\x20IN\x20?',_[_0x0a9e('0x42')](_0x255e49,'id'));_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x7b'),_['map'](_0x255e49,'id'));}});})[_0x0a9e('0x14')](function(){if(_0x2c2cb0['user'][_0x0a9e('0x97')]===_0x0a9e('0x2e')&&!_0x3649cc&&!_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x79')])return[];return db[_0x0a9e('0x98')][_0x0a9e('0x47')](_0x2b9c01[_0x0a9e('0x99')](),_0x385d52);})[_0x0a9e('0x14')](function(_0x501050){_0x138b8b[_0x0a9e('0x23')]=_0x501050[_0x0a9e('0x4d')];if(_0x138b8b[_0x0a9e('0x23')]===0x0)return[];return db[_0x0a9e('0x98')][_0x0a9e('0x47')](_0x5bb3ed[_0x0a9e('0x99')](),_0x385d52)[_0x0a9e('0x14')](function(_0x33f0c9){_0x14d602=_[_0x0a9e('0x9a')](_0x33f0c9,'id');_0x385d52=_[_0x0a9e('0x2b')](_0x385d52,{'model':db[_0x0a9e('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x4c')]){_0x5026aa['attributes'][_0x0a9e('0x35')](function(_0x23e2bd){_0x211ef9[_0x0a9e('0x52')]('i.'+_0x23e2bd);});}else{_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0x9b'),'unreadMessages');_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0x9c'),'Account.key');_0x211ef9[_0x0a9e('0x52')]('a.mandatoryDisposition',_0x0a9e('0x9d'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0x9e'),_0x0a9e('0x90'));_0x211ef9['field'](_0x0a9e('0x9f'));_0x211ef9['field'](_0x0a9e('0xa0'),_0x0a9e('0xa1'));_0x211ef9['field'](_0x0a9e('0xa2'),_0x0a9e('0xa3'));_0x211ef9[_0x0a9e('0x52')]('c.email','Contact.email');_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xa4'),_0x0a9e('0xa5'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xa6'),_0x0a9e('0xa7'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xa8'),_0x0a9e('0xa9'));_0x211ef9['field'](_0x0a9e('0xaa'),'Owner.fullname');_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xab'),_0x0a9e('0xac'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xad'),'TagIds');}if(_0x5026aa[_0x0a9e('0x22')])_0x211ef9[_0x0a9e('0x22')](_0x5026aa[_0x0a9e('0x22')]);if(_0x5026aa[_0x0a9e('0x20')])_0x211ef9[_0x0a9e('0x20')](_0x5026aa['offset']);return db['sequelize'][_0x0a9e('0x47')](_0x211ef9['toString'](),_0x385d52);})[_0x0a9e('0x14')](function(_0x4658df){if(_0x4658df[_0x0a9e('0x4d')]>0x0)_0x2e5e62[_0x0a9e('0x7a')](_0x0a9e('0xae'),_[_0x0a9e('0x42')](_0x4658df,'id'));return db['sequelize']['query'](_0x2e5e62[_0x0a9e('0x99')](),_0x385d52)['then'](function(_0x2469d1){var _0x5c689c=_[_0x0a9e('0xaf')](_0x2469d1,'ChatInteractionId');var _0x558d60=[];_0x4658df[_0x0a9e('0x35')](function(_0xb8db59){_0x558d60['push'](updateChatInteraction(_0xb8db59,_0x14d602,_0x5c689c));});return BPromise[_0x0a9e('0xb0')](_0x558d60);});});})[_0x0a9e('0x14')](function(_0x15c6b9){_0x138b8b[_0x0a9e('0xb1')]=_0x15c6b9;return _0x138b8b;})[_0x0a9e('0x14')](respondWithFilteredResult(_0x35ed4a,_0x5026aa))['catch'](handleError(_0x35ed4a,null));};exports['show']=function(_0x16449b,_0x22286c){var _0x41c8cd={'raw':![],'where':{'id':_0x16449b[_0x0a9e('0xb2')]['id']}},_0x24beb6={};_0x24beb6['model']=_[_0x0a9e('0x76')](db[_0x0a9e('0x43')]['rawAttributes']);_0x24beb6[_0x0a9e('0x47')]=_[_0x0a9e('0x76')](_0x16449b[_0x0a9e('0x47')]);_0x24beb6[_0x0a9e('0x48')]=_[_0x0a9e('0x49')](_0x24beb6[_0x0a9e('0x4a')],_0x24beb6[_0x0a9e('0x47')]);_0x41c8cd[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0x24beb6[_0x0a9e('0x4a')],qs['fields'](_0x16449b[_0x0a9e('0x47')][_0x0a9e('0x4c')]));_0x41c8cd[_0x0a9e('0x4b')]=_0x41c8cd[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x41c8cd['attributes']:_0x24beb6['model'];if(_0x16449b[_0x0a9e('0x47')][_0x0a9e('0xb3')]){_0x41c8cd[_0x0a9e('0xb4')]=[{'all':!![]}];}_0x41c8cd=_[_0x0a9e('0x2b')]({},_0x41c8cd,_0x16449b[_0x0a9e('0xb5')]);return db['ChatInteraction'][_0x0a9e('0x64')](_0x41c8cd)[_0x0a9e('0x14')](handleEntityNotFound(_0x22286c,null))[_0x0a9e('0x14')](respondWithResult(_0x22286c,null))['catch'](handleError(_0x22286c,null));};exports[_0x0a9e('0xb6')]=function(_0x59aa7b,_0x2144ca){return db['ChatInteraction'][_0x0a9e('0xb6')](_0x59aa7b[_0x0a9e('0x2c')],{})[_0x0a9e('0x14')](respondWithResult(_0x2144ca,0xc9))['catch'](handleError(_0x2144ca,null));};exports[_0x0a9e('0x26')]=function(_0x5ed560,_0x4383da){if(_0x5ed560[_0x0a9e('0x2c')]['id']){delete _0x5ed560[_0x0a9e('0x2c')]['id'];}return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x5ed560[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x4383da,null))[_0x0a9e('0x14')](saveUpdates(_0x5ed560[_0x0a9e('0x2c')],null))[_0x0a9e('0x14')](respondWithResult(_0x4383da,null))[_0x0a9e('0x37')](handleError(_0x4383da,null));};exports[_0x0a9e('0x27')]=function(_0x2415fe,_0x399def){return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x2415fe['params']['id']}})['then'](handleEntityNotFound(_0x399def,null))[_0x0a9e('0x14')](removeEntity(_0x399def,null))['catch'](handleError(_0x399def,null));};exports[_0x0a9e('0xb7')]=function(_0x3428c9,_0x5d6b69){return db[_0x0a9e('0x43')][_0x0a9e('0xb7')]()[_0x0a9e('0x14')](respondWithResult(_0x5d6b69,null))[_0x0a9e('0x37')](handleError(_0x5d6b69,null));};exports['createVidaooSession']=function(_0x148fd9,_0x26cb76){var _0x374f0b=_0x148fd9[_0x0a9e('0xb2')]['id'];var _0x5d0e1f;var _0x19e9ed;var _0x1a0b08;return db[_0x0a9e('0x43')]['findOne']({'where':{'id':_0x374f0b}})[_0x0a9e('0x14')](function(_0x270df8){_0x5d0e1f=_0x270df8;return db[_0x0a9e('0xb8')]['findOne']({'where':{'id':_0x270df8[_0x0a9e('0x79')]},'attributes':['id',_0x0a9e('0xb9'),_0x0a9e('0xba'),_0x0a9e('0xbb'),_0x0a9e('0xbc'),'vidaooMetadata'],'raw':!![]});})[_0x0a9e('0x14')](function(_0x289e65){if(_0x289e65&&_0x289e65['vidaooApiKey']&&_0x289e65[_0x0a9e('0xba')]){_0x19e9ed=_0x289e65;var _0x1fcfe6={'interaction':{'id':_0x374f0b},'agent':{'id':_0x148fd9[_0x0a9e('0x94')]['id'],'name':_0x148fd9['user']['name'],'fullname':_0x148fd9['user'][_0x0a9e('0x31')],'email':_0x148fd9[_0x0a9e('0x94')]['email']},'contact':_0x148fd9[_0x0a9e('0x2c')][_0x0a9e('0x2d')],'account':_0x148fd9[_0x0a9e('0x2c')]['account']};var _0x9fc93e={'rejectUnauthorized':![],'method':_0x0a9e('0xbd'),'url':_0x0a9e('0xbe'),'headers':{'X-APIKEY':_0x289e65[_0x0a9e('0xb9')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x148fd9[_0x0a9e('0x94')][_0x0a9e('0xbf')]],'buttons':null,'topic':_0x19e9ed[_0x0a9e('0xbb')],'note':_[_0x0a9e('0xc0')](_0x19e9ed[_0x0a9e('0xbc')])?null:getMustacheRender(_0x19e9ed['vidaooNote'],_0x1fcfe6),'metadata':null},'redirect':_0x0a9e('0xc1'),'json':!![]};try{if(!_['isNull'](_0x19e9ed[_0x0a9e('0xc2')])){var _0x4093e6=getMustacheRender(_0x19e9ed[_0x0a9e('0xc2')],_0x1fcfe6);var _0x3cf222=JSON[_0x0a9e('0x7d')](_0x4093e6);_0x9fc93e[_0x0a9e('0x2c')]['metadata']=_0x3cf222;}}catch(_0x1a0314){throw new db[(_0x0a9e('0xc3'))][(_0x0a9e('0xc4'))](_0x0a9e('0xc5'));}return rp(_0x9fc93e);}else{throw new db['Sequelize'][(_0x0a9e('0xc4'))](_0x0a9e('0xc6'));}})[_0x0a9e('0x14')](function(_0x1c9539){_0x1a0b08=_0x1c9539;if(_0x1a0b08['id']){var _0xc2e7b={'body':_0x1a0b08[_0x0a9e('0xc7')],'ChatWebsiteId':_0x19e9ed['id'],'ChatInteractionId':_0x5d0e1f['id'],'direction':_0x0a9e('0xc8'),'UserId':_0x148fd9[_0x0a9e('0x94')]['id']};return db[_0x0a9e('0xc9')][_0x0a9e('0xb6')](_0xc2e7b,{});}else{throw new db['Sequelize'][(_0x0a9e('0xc4'))](_0x0a9e('0xca'));}})[_0x0a9e('0x14')](function(){return _0x5d0e1f[_0x0a9e('0xcb')]({'vidaooSessionId':_0x1a0b08['id']});})[_0x0a9e('0x14')](respondWithResult(_0x26cb76,null))[_0x0a9e('0x37')](handleError(_0x26cb76,null));};exports[_0x0a9e('0xcc')]=function(_0x20ae21,_0x566b90){if(_0x20ae21[_0x0a9e('0x2c')]['id']){delete _0x20ae21[_0x0a9e('0x2c')]['id'];}return db[_0x0a9e('0x43')]['find']({'where':{'id':_0x20ae21[_0x0a9e('0xb2')]['id']},'include':[{'model':db[_0x0a9e('0xcd')],'as':_0x0a9e('0x69')}]})[_0x0a9e('0x14')](handleEntityNotFound(_0x566b90,null))[_0x0a9e('0x14')](saveUpdates(_0x20ae21[_0x0a9e('0x2c')],null))[_0x0a9e('0x14')](respondWithResult(_0x566b90,null))[_0x0a9e('0x37')](handleError(_0x566b90,null));};exports[_0x0a9e('0xce')]=function(_0x451010,_0x5a7dad){if(_0x451010[_0x0a9e('0x2c')]['id']){delete _0x451010[_0x0a9e('0x2c')]['id'];}return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x451010[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](function(_0x5cb48d){if(!_0x5cb48d){logger[_0x0a9e('0x19')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,'entity\x20not\x20found');_0x5a7dad[_0x0a9e('0x1c')](0x194);}else{if(_0x5cb48d[_0x0a9e('0x3d')]){throw new db[(_0x0a9e('0xc3'))][(_0x0a9e('0xc4'))]('Interaction\x20already\x20assigned');}}return _0x5cb48d;})[_0x0a9e('0x14')](function(_0x309fa9){if(_0x309fa9){return _0x309fa9[_0x0a9e('0x26')]({'closed':_0x451010[_0x0a9e('0x2c')][_0x0a9e('0x3c')],'disposition':_0x451010['body']['disposition']})[_0x0a9e('0x14')](function(_0x33bcb2){return _0x33bcb2;});}})[_0x0a9e('0x14')](function(){return respondWithRpcPromise('AbandonInteraction',_0x0a9e('0xce'),_0x451010[_0x0a9e('0x2c')],client9004);})[_0x0a9e('0x14')](respondWithResult(_0x5a7dad,null))['catch'](handleError(_0x5a7dad,null));};exports[_0x0a9e('0xcf')]=function(_0x2bf85d,_0x15ba6b){_0x2bf85d['body'][_0x0a9e('0x29')]=_0x2bf85d[_0x0a9e('0xd0')][_0x0a9e('0xd1')];_0x2bf85d['body']['basename']=_0x2bf85d['file'][_0x0a9e('0xd2')];_0x2bf85d[_0x0a9e('0x2c')][_0x0a9e('0x6f')]=_0x2bf85d[_0x0a9e('0xd0')]['mimetype'];return db[_0x0a9e('0xd3')]['create'](_0x2bf85d[_0x0a9e('0x2c')])[_0x0a9e('0x14')](respondWithResult(_0x15ba6b,0xc9))[_0x0a9e('0x37')](handleError(_0x15ba6b,null));};exports['attachmentDownload']=function(_0x33b4b3,_0x33a26c){return db[_0x0a9e('0x43')]['findOne']({'where':{'id':_0x33b4b3[_0x0a9e('0xb2')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x33a26c,null))[_0x0a9e('0x14')](function(_0x5c57e1){if(_0x5c57e1){if(_0x5c57e1[_0x0a9e('0x3c')]){return _0x33a26c['status'](0x193)[_0x0a9e('0x1f')]({'status':0x193,'message':_0x0a9e('0xd4')});}return db[_0x0a9e('0xd3')][_0x0a9e('0xd5')]({'where':{'id':_0x33b4b3[_0x0a9e('0x47')][_0x0a9e('0xd6')]},'raw':!![]})[_0x0a9e('0x14')](handleEntityNotFound(_0x33a26c,null));}})['then'](function(_0x35ace3){if(_0x35ace3){var _0x1c9ea2=_0x35ace3['ChatOfflineMessageId']!==null;var _0xf4fb77=path[_0x0a9e('0xd7')](config['root'],_0x0a9e('0xd8'));if(_0x1c9ea2){_0xf4fb77=path[_0x0a9e('0xd7')](_0xf4fb77,_0x0a9e('0xd9'));}var _0x569528=path[_0x0a9e('0xd7')](_0xf4fb77,_0x35ace3[_0x0a9e('0xda')]);return _0x33a26c[_0x0a9e('0xdb')](_0x569528);}})[_0x0a9e('0x37')](handleError(_0x33a26c,null));};exports[_0x0a9e('0xdc')]=function(_0x29fdfe,_0x3ba897){var _0x74d9b8=null;var _0x22767f=null;var _0x426c3c=null;if(_0x29fdfe['body']['id']){delete _0x29fdfe[_0x0a9e('0x2c')]['id'];}if(_0x29fdfe['body'][_0x0a9e('0xdd')]){_0x426c3c=path[_0x0a9e('0xd7')](config[_0x0a9e('0xde')],_0x0a9e('0xdf'),util[_0x0a9e('0xe0')](_0x0a9e('0xe1'),Date['now']()));_0x29fdfe[_0x0a9e('0x2c')][_0x0a9e('0xe2')]=_0x426c3c;}return db[_0x0a9e('0x43')]['find']({'where':{'id':_0x29fdfe[_0x0a9e('0xb2')]['id']},'include':[{'model':db[_0x0a9e('0xc9')],'as':_0x0a9e('0xe3'),'include':[{'model':db[_0x0a9e('0x74')],'as':_0x0a9e('0x74')}]}]})[_0x0a9e('0x14')](handleEntityNotFound(_0x3ba897,null))[_0x0a9e('0x14')](saveUpdates(_0x29fdfe['body'],null))[_0x0a9e('0x14')](function(_0x228c10){if(_0x228c10){_0x74d9b8=_0x228c10;return db[_0x0a9e('0xb8')][_0x0a9e('0x64')]({'where':{'id':_0x74d9b8[_0x0a9e('0x79')]}});}})[_0x0a9e('0x14')](function(_0x8120e){if(_0x8120e){_0x22767f=_0x8120e;return db['CmContact']['find']({'where':{'id':_0x74d9b8[_0x0a9e('0x6d')]}});}})[_0x0a9e('0x14')](function(_0x1f4929){if(_0x1f4929){if(_0x426c3c){var _0x1bf692=null;for(var _0x40e2da=0x1;_0x40e2da<_0x74d9b8[_0x0a9e('0xe3')][_0x0a9e('0x4d')];++_0x40e2da){_0x1bf692=_0x74d9b8['Messages'][_0x40e2da];var _0x39ea62=_0x1bf692[_0x0a9e('0x3d')]?util[_0x0a9e('0xe0')](_0x0a9e('0xe4'),_0x22767f[_0x0a9e('0xe5')],_0x1bf692[_0x0a9e('0x3d')]):_0x0a9e('0xe6');var _0x54f0b8=_0x29fdfe[_0x0a9e('0x2c')][_0x0a9e('0xe7')]||util[_0x0a9e('0xe0')]('%s%d',_0x0a9e('0xe8'),_0x1bf692[_0x0a9e('0x6d')]);switch(_0x22767f[_0x0a9e('0xe9')]){case _0x0a9e('0xea'):_0x39ea62=_0x1bf692['UserId']?util[_0x0a9e('0xe0')](_0x0a9e('0xe4'),_0x22767f[_0x0a9e('0xe5')],_0x1bf692[_0x0a9e('0x3d')]):_0x0a9e('0xe6');break;case _0x0a9e('0xeb'):_0x39ea62=_0x1bf692[_0x0a9e('0x3d')]?_0x1bf692[_0x0a9e('0x74')]['alias']||_0x1bf692[_0x0a9e('0x74')][_0x0a9e('0x31')]:_0x0a9e('0xe6');break;case _0x0a9e('0xec'):_0x39ea62=_0x1bf692['UserId']?_0x1bf692['User'][_0x0a9e('0x31')]:_0x0a9e('0xe6');break;default:_0x39ea62=_0x1bf692[_0x0a9e('0x3d')]?util['format'](_0x0a9e('0xe4'),_0x22767f[_0x0a9e('0xe5')],_0x1bf692['UserId']):_0x0a9e('0xe6');}var _0x5d19b1=util[_0x0a9e('0xe0')]('[%s]\x20%s:\x20%s\x0a',moment(_0x1bf692['createdAt'])['format'](_0x0a9e('0xed')),_0x1bf692[_0x0a9e('0xee')]==='in'?_0x54f0b8:_0x39ea62,_0x1bf692[_0x0a9e('0x2c')]);if(!_0x1bf692[_0x0a9e('0xef')]){fs[_0x0a9e('0xf0')](_0x426c3c,_0x5d19b1);}}return db[_0x0a9e('0xf1')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x0a9e('0xf2')],'as':_0x0a9e('0xf3'),'raw':!![],'include':[{'model':db[_0x0a9e('0xf4')],'as':_0x0a9e('0xf4'),'raw':!![]}]}]});}}})[_0x0a9e('0x14')](function(_0x18dccf){if(!_0x18dccf||!_0x18dccf[_0x0a9e('0xf3')]||!_0x29fdfe['body'])return _0x74d9b8;var _0x49baaa=_0x18dccf[_0x0a9e('0xf5')]();return respondWithRpcPromise('SendMail',_0x0a9e('0xf6'),{'account':_0x49baaa,'message':{'from':util[_0x0a9e('0xe0')](_0x0a9e('0xf7'),_0x18dccf[_0x0a9e('0x29')],_0x18dccf[_0x0a9e('0xbf')]||_0x18dccf[_0x0a9e('0xf3')]['user']),'to':_0x29fdfe[_0x0a9e('0x2c')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0x0a9e('0xe0')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x29fdfe[_0x0a9e('0x2c')]['mailTranscript']),'attachments':[{'path':_0x426c3c}]}})['then'](function(){return _0x74d9b8;})[_0x0a9e('0x37')](function(_0x4a7a3c){logger[_0x0a9e('0x19')](_0x4a7a3c);});})[_0x0a9e('0x14')](respondWithStatusCode(_0x3ba897,0xc8))[_0x0a9e('0x37')](handleError(_0x3ba897,null));};exports['addMessage']=function(_0x4152cd,_0x1209c4){return db[_0x0a9e('0xc9')]['find']({'where':{'id':_0x4152cd['params']['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x1209c4,null))[_0x0a9e('0x14')](function(_0x89d2cb){if(_0x89d2cb){return _0x89d2cb[_0x0a9e('0xf8')](_0x4152cd[_0x0a9e('0x2c')][_0x0a9e('0xf9')],_[_0x0a9e('0xfa')](_0x4152cd[_0x0a9e('0x2c')],[_0x0a9e('0xf9'),'id'])||{});}})[_0x0a9e('0x14')](respondWithResult(_0x1209c4,null))['catch'](handleError(_0x1209c4,null));};exports['getMessages']=function(_0x558171,_0x5975fa){var _0x19dcc2={'raw':![],'where':{}};var _0x2ce30f={};var _0x2d21c7={'count':0x0,'rows':[]};return db[_0x0a9e('0x43')][_0x0a9e('0xd5')]({'where':{'id':_0x558171[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x5975fa,null))['then'](function(_0x5c3ecf){if(_0x5c3ecf){_0x2ce30f[_0x0a9e('0x4a')]=_[_0x0a9e('0x76')](db['ChatMessage'][_0x0a9e('0x44')]);_0x2ce30f[_0x0a9e('0x47')]=_[_0x0a9e('0x76')](_0x558171[_0x0a9e('0x47')]);_0x2ce30f[_0x0a9e('0x48')]=_[_0x0a9e('0x49')](_0x2ce30f[_0x0a9e('0x4a')],_0x2ce30f[_0x0a9e('0x47')]);_0x19dcc2[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0x2ce30f[_0x0a9e('0x4a')],qs[_0x0a9e('0x4c')](_0x558171['query'][_0x0a9e('0x4c')]));_0x19dcc2[_0x0a9e('0x4b')]=_0x19dcc2[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x19dcc2[_0x0a9e('0x4b')]:_0x2ce30f[_0x0a9e('0x4a')];if(!_0x558171[_0x0a9e('0x47')][_0x0a9e('0xfb')](_0x0a9e('0x4e'))){_0x19dcc2[_0x0a9e('0x22')]=qs[_0x0a9e('0x22')](_0x558171[_0x0a9e('0x47')]['limit']);_0x19dcc2['offset']=qs[_0x0a9e('0x20')](_0x558171[_0x0a9e('0x47')][_0x0a9e('0x20')]);}_0x19dcc2[_0x0a9e('0x4f')]=qs[_0x0a9e('0x50')](_0x558171[_0x0a9e('0x47')][_0x0a9e('0x50')]);_0x19dcc2['where']=qs[_0x0a9e('0x48')](_['pick'](_0x558171[_0x0a9e('0x47')],_0x2ce30f[_0x0a9e('0x48')]));_0x19dcc2[_0x0a9e('0x7a')][_0x0a9e('0xfc')]=_0x5c3ecf['id'];if(_0x558171[_0x0a9e('0x47')][_0x0a9e('0x87')]){_0x19dcc2[_0x0a9e('0x7a')]=_[_0x0a9e('0x2b')](_0x19dcc2[_0x0a9e('0x7a')],{'$or':_[_0x0a9e('0x42')](_0x19dcc2[_0x0a9e('0x4b')],function(_0x8231e5){var _0x43111e={};_0x43111e[_0x8231e5]={'$like':'%'+_0x558171[_0x0a9e('0x47')][_0x0a9e('0x87')]+'%'};return _0x43111e;})});}if(_0x558171[_0x0a9e('0x47')]['$gte']){var _0x54cf62=_0x558171[_0x0a9e('0x47')][_0x0a9e('0x7e')]['split'](',');var _0x5500de={};_0x5500de[_0x54cf62[0x0]]={'$gte':moment(_0x54cf62[0x1])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))};_0x19dcc2[_0x0a9e('0x7a')]=_['merge'](_0x19dcc2[_0x0a9e('0x7a')],_0x5500de);}_0x19dcc2=_['merge']({},_0x19dcc2,_0x558171[_0x0a9e('0xb5')]);return db['ChatMessage'][_0x0a9e('0x23')]({'where':_0x19dcc2['where']})[_0x0a9e('0x14')](function(_0x21e210){_0x2d21c7[_0x0a9e('0x23')]=_0x21e210;if(_0x558171['query'][_0x0a9e('0xb3')]){_0x19dcc2['include']=[{'all':!![]}];}return db['ChatMessage'][_0x0a9e('0xfe')](_0x19dcc2);})[_0x0a9e('0x14')](function(_0x3c691f){_0x2d21c7[_0x0a9e('0xb1')]=_0x3c691f;return _0x2d21c7;});}})[_0x0a9e('0x14')](respondWithFilteredResult(_0x5975fa,_0x19dcc2))[_0x0a9e('0x37')](handleError(_0x5975fa,null));};exports[_0x0a9e('0xff')]=function(_0x82504f,_0x1a3143){var _0x151f16={'where':{}},_0xd6938={},_0x98bf26={'count':0x0,'rows':[]};return db[_0x0a9e('0x43')][_0x0a9e('0xd5')]({'where':{'id':_0x82504f[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x1a3143,null))[_0x0a9e('0x14')](function(_0x643f66){if(_0x643f66){_0xd6938[_0x0a9e('0x4a')]=_['keys'](db[_0x0a9e('0xc9')][_0x0a9e('0x44')]);_0xd6938[_0x0a9e('0x47')]=_[_0x0a9e('0x76')](_0x82504f['query']);_0xd6938['filters']=_['intersection'](_0xd6938[_0x0a9e('0x4a')],_0xd6938['query']);_0x151f16[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0xd6938[_0x0a9e('0x4a')],qs[_0x0a9e('0x4c')](_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x4c')]));_0x151f16[_0x0a9e('0x4b')]=_0x151f16[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x151f16[_0x0a9e('0x4b')]:_0xd6938['model'];if(!_0x82504f[_0x0a9e('0x47')]['hasOwnProperty'](_0x0a9e('0x4e'))){_0x151f16['limit']=qs[_0x0a9e('0x22')](_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x22')]);_0x151f16['offset']=qs[_0x0a9e('0x20')](_0x82504f[_0x0a9e('0x47')]['offset']);}_0x151f16['order']=qs[_0x0a9e('0x50')](_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x50')]);_0x151f16['where']=qs['filters'](_['pick'](_0x82504f[_0x0a9e('0x47')],_0xd6938[_0x0a9e('0x48')]));_0x151f16[_0x0a9e('0x7a')][_0x0a9e('0xfc')]=_0x643f66['id'];if(_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x87')]){_0x151f16[_0x0a9e('0x7a')]=_[_0x0a9e('0x2b')](_0x151f16[_0x0a9e('0x7a')],{'$or':_[_0x0a9e('0x42')](_0x151f16[_0x0a9e('0x4b')],function(_0x2f4de1){var _0x13215c={};_0x13215c[_0x2f4de1]={'$like':'%'+_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x87')]+'%'};return _0x13215c;})});}_0x151f16[_0x0a9e('0x7a')][_0x0a9e('0xef')]=![];if(_0x82504f[_0x0a9e('0x47')]['id']){_0x151f16['where']['id']={'$gt':_0x82504f[_0x0a9e('0x47')]['id']};}_0x151f16=_[_0x0a9e('0x2b')]({},_0x151f16,_0x82504f[_0x0a9e('0xb5')]);return db[_0x0a9e('0xc9')][_0x0a9e('0x23')]({'where':_0x151f16[_0x0a9e('0x7a')]})['then'](function(_0x4739ed){_0x98bf26[_0x0a9e('0x23')]=_0x4739ed;_0x151f16[_0x0a9e('0xb4')]=[];if(_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x100')]){_0x151f16[_0x0a9e('0xb4')][_0x0a9e('0x36')]({'model':db[_0x0a9e('0x74')],'as':_0x0a9e('0x74'),'attributes':['id','fullname','alias']});}if(_0x82504f[_0x0a9e('0x47')][_0x0a9e('0xb3')]){_0x151f16['include']=[{'all':!![]}];}return db[_0x0a9e('0xc9')][_0x0a9e('0xfe')](_0x151f16);})['then'](function(_0x1ca7c8){_0x98bf26['rows']=_0x1ca7c8;return _0x98bf26;});}})[_0x0a9e('0x14')](respondWithFilteredResult(_0x1a3143,_0x151f16))[_0x0a9e('0x37')](handleError(_0x1a3143,null));};exports['addTags']=function(_0x27a41c,_0x31ab12){return db['ChatInteraction'][_0x0a9e('0x64')]({'where':{'id':_0x27a41c[_0x0a9e('0xb2')]['id']}})['then'](handleEntityNotFound(_0x31ab12,null))[_0x0a9e('0x14')](function(_0x237994){if(_0x237994){return _0x237994[_0x0a9e('0x101')](_0x27a41c[_0x0a9e('0x2c')][_0x0a9e('0xf9')],_[_0x0a9e('0xfa')](_0x27a41c['body'],[_0x0a9e('0xf9'),'id'])||{})[_0x0a9e('0x102')](function(){return db['Tag'][_0x0a9e('0xfe')]({'attributes':['id',_0x0a9e('0x29'),_0x0a9e('0x103')],'where':{'id':_0x27a41c[_0x0a9e('0x2c')][_0x0a9e('0xf9')]}});})[_0x0a9e('0x14')](function(_0x368a12){socket['emit']('chatInteractionTags:save',{'id':Number(_0x27a41c['params']['id']),'tags':_0x368a12||[]});return{'id':Number(_0x27a41c['params']['id']),'tags':_0x368a12||[]};});}})['then'](respondWithResult(_0x31ab12,null))[_0x0a9e('0x37')](handleError(_0x31ab12,null));};exports[_0x0a9e('0x104')]=function(_0x556344,_0x5c23aa){return db[_0x0a9e('0x43')]['find']({'where':{'id':_0x556344[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x5c23aa,null))[_0x0a9e('0x14')](function(_0x175c97){if(_0x175c97){return _0x175c97[_0x0a9e('0x104')](_0x556344[_0x0a9e('0x47')]['ids']);}})[_0x0a9e('0x14')](respondWithStatusCode(_0x5c23aa,null))[_0x0a9e('0x37')](handleError(_0x5c23aa,null));};exports['download']=function(_0x44cdb8,_0x1c0d54){var _0x2e0e9b=moment()[_0x0a9e('0x105')]()[_0x0a9e('0x99')]();var _0x2f1cc0=path[_0x0a9e('0xd7')](config['root'],_0x0a9e('0x106'),'files',_0x0a9e('0x107'));var _0xd456e6=path['join'](config[_0x0a9e('0xde')],_0x0a9e('0x106'),'files',_0x0a9e('0x108'));var _0x4e03f5=path[_0x0a9e('0xd7')](_0x2f1cc0,_0x2e0e9b);var _0x9c686f=util['format'](_0x0a9e('0x109'),_0x44cdb8['params']['id'],_0x2e0e9b);var _0x1d046c=path[_0x0a9e('0xd7')](_0x2f1cc0,_0x9c686f);var _0x732141=[];_0x732141[_0x0a9e('0x36')]({'model':db[_0x0a9e('0x74')],'as':_0x0a9e('0x74'),'attributes':['id',_0x0a9e('0x31')],'raw':!![]});_0x732141['push']({'model':db[_0x0a9e('0xcd')],'as':_0x0a9e('0x69'),'attributes':['id',_0x0a9e('0x10a'),_0x0a9e('0x10b')],'raw':!![]});if(_0x44cdb8[_0x0a9e('0x47')]['attachments']){_0x732141[_0x0a9e('0x36')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x3a459c=[{'model':db['ChatMessage'],'as':_0x0a9e('0xe3'),'attributes':['id',_0x0a9e('0x2c'),'createdAt',_0x0a9e('0xee'),_0x0a9e('0xef'),_0x0a9e('0x84')],'include':_0x732141}];_0x3a459c[_0x0a9e('0x36')]({'model':db[_0x0a9e('0xb8')],'as':_0x0a9e('0x10c'),'attributes':['id',_0x0a9e('0x29')]});_0x3a459c[_0x0a9e('0x36')]({'model':db[_0x0a9e('0x74')],'as':'Owner','attributes':['id',_0x0a9e('0x31')]});return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x44cdb8[_0x0a9e('0xb2')]['id']},'include':_0x3a459c})['then'](handleEntityNotFound(_0x1c0d54,null))[_0x0a9e('0x14')](function(_0x439f25){if(_0x439f25){var _0x333d3c=_0x439f25['get']({'plain':!![]});fs[_0x0a9e('0x10d')](_0x4e03f5);var _0x2191c6={'channel':_0x0a9e('0x10e'),'account':_0x333d3c['Account'][_0x0a9e('0x29')],'agent':_0x333d3c['Owner']?_0x333d3c[_0x0a9e('0x10f')][_0x0a9e('0x31')]:_0x0a9e('0x110'),'createdAt':moment(_0x333d3c[_0x0a9e('0x7c')])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))[_0x0a9e('0x99')](),'closedAt':_0x333d3c['closed']?moment(_0x333d3c[_0x0a9e('0x111')])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))[_0x0a9e('0x99')]():'','disposition':_0x333d3c[_0x0a9e('0x3f')],'chatInfo':{'browser':_0x333d3c[_0x0a9e('0x112')],'os':_0x333d3c[_0x0a9e('0x113')],'referer':_0x333d3c[_0x0a9e('0x114')],'customerIp':_0x333d3c[_0x0a9e('0x115')],'customerPort':_0x333d3c[_0x0a9e('0x116')]?_0x333d3c[_0x0a9e('0x116')]:_0x0a9e('0x110')},'messages':_(_0x333d3c[_0x0a9e('0xe3')])[_0x0a9e('0x117')]()[_0x0a9e('0x87')]({'secret':![]})[_0x0a9e('0x42')](function(_0x1008a1){if(_0x1008a1[_0x0a9e('0xd3')]){var _0x6276a4=path[_0x0a9e('0xd7')](_0xd456e6,_0x1008a1[_0x0a9e('0xd3')][_0x0a9e('0xda')]);if(fs[_0x0a9e('0x118')](_0x6276a4)){fs['createReadStream'](_0x6276a4)[_0x0a9e('0x119')](fs[_0x0a9e('0x11a')](path[_0x0a9e('0xd7')](_0x4e03f5,_0x1008a1['Attachment'][_0x0a9e('0xda')])));}}return{'date':moment(_0x1008a1['createdAt'])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))[_0x0a9e('0x99')](),'sender':_0x1008a1[_0x0a9e('0xee')]===_0x0a9e('0xc8')?_0x1008a1[_0x0a9e('0x74')]?_0x1008a1[_0x0a9e('0x74')][_0x0a9e('0x31')]:'System':_0x1008a1[_0x0a9e('0x69')][_0x0a9e('0x10a')]+(_0x1008a1['Contact'][_0x0a9e('0x10b')]?'\x20'+_0x1008a1[_0x0a9e('0x69')][_0x0a9e('0x10b')]:''),'body':_0x1008a1['Attachment']?_0x1008a1[_0x0a9e('0xd3')][_0x0a9e('0xda')]:_0x1008a1[_0x0a9e('0x2c')],'direction':_0x1008a1[_0x0a9e('0xee')]==='out'?'A':'C','secret':_0x1008a1[_0x0a9e('0xef')],'read':_0x1008a1[_0x0a9e('0x84')],'attachment':_0x1008a1[_0x0a9e('0xd3')]};})[_0x0a9e('0x6b')]()};return ejs[_0x0a9e('0x11b')](path['join'](config[_0x0a9e('0xde')],_0x0a9e('0x106'),'views',_0x0a9e('0x11c')),{'interaction':_0x2191c6})[_0x0a9e('0x14')](function(_0x38284a){var _0x54246a=path['join'](_0x4e03f5,_0x0a9e('0x11d')+_0x333d3c['id']+'-'+_0x2e0e9b+_0x0a9e('0x11e'));var _0x271485={'path':_0x54246a,'channel':_0x0a9e('0x10e'),'interactionId':_0x333d3c['id']};return pdf[_0x0a9e('0x11f')](_0x38284a,_0x271485);})[_0x0a9e('0x14')](function(){return new Promise(function(_0x312e02,_0x221274){zipdir(_0x4e03f5,{'saveTo':_0x1d046c},function(_0x54c9d6,_0x5cc8cb){if(_0x54c9d6)return _0x221274(_0x54c9d6);return _0x312e02(_0x5cc8cb);});})[_0x0a9e('0x14')](function(){return new BPromise(function(_0x5330c2,_0x803bc){rimraf(_0x4e03f5,function(_0xef29b6){if(_0xef29b6)_0x803bc(_0xef29b6);return _0x5330c2();});});})[_0x0a9e('0x14')](function(){return _0x1c0d54[_0x0a9e('0xdb')](_0x1d046c,_0x9c686f,function(_0x57b11b){if(_0x57b11b){logger[_0x0a9e('0x19')](_0x0a9e('0x120'),_0x57b11b);}else{fs['unlinkSync'](_0x1d046c);}});});});}else{return _0x1c0d54[_0x0a9e('0x1c')](0xc8);}})['catch'](handleError(_0x1c0d54,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 622da66..0362169 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 _0x5066=['unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','update','remove','then','setDataValue','Users','map','findAll'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5066,0x116));var _0x6506=function(_0x28e502,_0x3e36c5){_0x28e502=_0x28e502-0x0;var _0x2fd662=_0x5066[_0x28e502];return _0x2fd662;};'use strict';var EventEmitter=require(_0x6506('0x0'));var ChatInteraction=require(_0x6506('0x1'))['db'][_0x6506('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x6506('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6506('0x4'),'afterDestroy':_0x6506('0x5')};function emitEvent(_0x3b4709){return function(_0x5e3192,_0x1a884f,_0x346b40){_0x5e3192['getUsers']({'attributes':['id'],'raw':!![]})[_0x6506('0x6')](function(_0x280733){_0x5e3192[_0x6506('0x7')](_0x6506('0x8'),_0x280733[_0x6506('0x9')](function(_0x5e934f){return{'id':_0x5e934f['id']};}));return ChatMessage[_0x6506('0xa')]({'where':{'ChatInteractionId':_0x5e3192['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2412df){_0x5e3192['setDataValue'](_0x6506('0xb'),_0x2412df['length']);ChatInteractionEvents[_0x6506('0xc')](_0x3b4709+':'+_0x5e3192['id'],_0x5e3192);ChatInteractionEvents[_0x6506('0xc')](_0x3b4709,_0x5e3192);_0x346b40(null);})[_0x6506('0xd')](_0x346b40(null));};}for(var e in events){if(events[_0x6506('0xe')](e)){var event=events[e];ChatInteraction[_0x6506('0xf')](e,emitEvent(event));}}module[_0x6506('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x86b3=['../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','map','findAll','then','length','emit','catch','hasOwnProperty','hook','events'];(function(_0x5a6474,_0x4678e1){var _0x485021=function(_0x24dffd){while(--_0x24dffd){_0x5a6474['push'](_0x5a6474['shift']());}};_0x485021(++_0x4678e1);}(_0x86b3,0xc5));var _0x386b=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x86b3[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0x386b('0x0'));var ChatInteraction=require(_0x386b('0x1'))['db'][_0x386b('0x2')];var ChatMessage=require(_0x386b('0x1'))['db'][_0x386b('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x386b('0x4')](0x0);var events={'afterCreate':_0x386b('0x5'),'afterUpdate':_0x386b('0x6'),'afterDestroy':_0x386b('0x7')};function emitEvent(_0x186701){return function(_0x3d2431,_0x476b3b,_0x51972d){_0x3d2431[_0x386b('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3f653d){_0x3d2431[_0x386b('0x9')]('Users',_0x3f653d[_0x386b('0xa')](function(_0x18922b){return{'id':_0x18922b['id']};}));return ChatMessage[_0x386b('0xb')]({'where':{'ChatInteractionId':_0x3d2431['id'],'direction':'in','read':![]},'raw':!![]});})[_0x386b('0xc')](function(_0x39b255){_0x3d2431[_0x386b('0x9')]('unreadMessages',_0x39b255[_0x386b('0xd')]);ChatInteractionEvents[_0x386b('0xe')](_0x186701+':'+_0x3d2431['id'],_0x3d2431);ChatInteractionEvents[_0x386b('0xe')](_0x186701,_0x3d2431);_0x51972d(null);})[_0x386b('0xf')](_0x51972d(null));};}for(var e in events){if(events[_0x386b('0x10')](e)){var event=events[e];ChatInteraction[_0x386b('0x11')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 7bebe39..f48168e 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 _0x978b=['lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closedAt','format','utf8mb4','utf8mb4_unicode_ci'];(function(_0x233c32,_0x3bdb3e){var _0x316ec6=function(_0x2e889d){while(--_0x2e889d){_0x233c32['push'](_0x233c32['shift']());}};_0x316ec6(++_0x3bdb3e);}(_0x978b,0xe0));var _0xb978=function(_0x22b085,_0x558e12){_0x22b085=_0x22b085-0x0;var _0x31bb92=_0x978b[_0x22b085];return _0x31bb92;};'use strict';var _=require(_0xb978('0x0'));var util=require('util');var logger=require(_0xb978('0x1'))('api');var moment=require(_0xb978('0x2'));var BPromise=require(_0xb978('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb978('0x4'));var rimraf=require(_0xb978('0x5'));var config=require(_0xb978('0x6'));var attributes=require(_0xb978('0x7'));module[_0xb978('0x8')]=function(_0x37215b,_0x3dfba2){return _0x37215b[_0xb978('0x9')]('ChatInteraction',attributes,{'tableName':_0xb978('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d101d,_0x355d02,_0x5f229b){if(_0x2d101d[_0xb978('0xb')]('closed')){_0x2d101d[_0xb978('0xc')]=moment()[_0xb978('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5f229b(null,_0x2d101d);}},'charset':_0xb978('0xe'),'collate':_0xb978('0xf')});};
\ No newline at end of file
+var _0xd8eb=['path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','changed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd8eb,0x11b));var _0xbd8e=function(_0x2601b4,_0x315e78){_0x2601b4=_0x2601b4-0x0;var _0x3e3661=_0xd8eb[_0x2601b4];return _0x3e3661;};'use strict';var _=require(_0xbd8e('0x0'));var util=require(_0xbd8e('0x1'));var logger=require(_0xbd8e('0x2'))(_0xbd8e('0x3'));var moment=require(_0xbd8e('0x4'));var BPromise=require(_0xbd8e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd8e('0x6'));var rimraf=require(_0xbd8e('0x7'));var config=require(_0xbd8e('0x8'));var attributes=require(_0xbd8e('0x9'));module[_0xbd8e('0xa')]=function(_0x5be2b7,_0x36f891){return _0x5be2b7[_0xbd8e('0xb')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a3bf4,_0x4d08dc,_0x271da6){if(_0x5a3bf4[_0xbd8e('0xc')]('closed')){_0x5a3bf4['closedAt']=moment()[_0xbd8e('0xd')](_0xbd8e('0xe'));}_0x271da6(null,_0x5a3bf4);}},'charset':_0xbd8e('0xf'),'collate':_0xbd8e('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 2e54e01..40868f7 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 _0xc8b9=['attributes','limit','AddTagsToChatInteraction','ChatInteraction','where','addTags','ids','omit','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','update','body','options','raw'];(function(_0x4f36a6,_0x9f224d){var _0x1f8a94=function(_0xb3ab2e){while(--_0xb3ab2e){_0x4f36a6['push'](_0x4f36a6['shift']());}};_0x1f8a94(++_0x9f224d);}(_0xc8b9,0x1ae));var _0x9c8b=function(_0x15b56a,_0x567846){_0x15b56a=_0x15b56a-0x0;var _0x5a6617=_0xc8b9[_0x15b56a];return _0x5a6617;};'use strict';var _=require(_0x9c8b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9c8b('0x1'));var rs=require(_0x9c8b('0x2'));var fs=require('fs');var Redis=require(_0x9c8b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c8b('0x4'));var logger=require(_0x9c8b('0x5'))('rpc');var config=require(_0x9c8b('0x6'));var jayson=require(_0x9c8b('0x7'));var client=jayson[_0x9c8b('0x8')][_0x9c8b('0x9')]({'port':0x232a});config[_0x9c8b('0xa')]=_['defaults'](config[_0x9c8b('0xa')],{'host':_0x9c8b('0xb'),'port':0x18eb});var socket=require(_0x9c8b('0xc'))(new Redis(config[_0x9c8b('0xa')]));require(_0x9c8b('0xd'))[_0x9c8b('0xe')](socket);function respondWithRpcPromise(_0x3774df,_0x2aee8a,_0x174270){return new BPromise(function(_0x226c24,_0x35e307){return client[_0x9c8b('0xf')](_0x3774df,_0x174270)[_0x9c8b('0x10')](function(_0x1895a4){logger[_0x9c8b('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x2aee8a,_0x9c8b('0x12'));logger[_0x9c8b('0x13')](_0x9c8b('0x14'),_0x2aee8a,'request\x20sent',JSON[_0x9c8b('0x15')](_0x1895a4));if(_0x1895a4[_0x9c8b('0x16')]){if(_0x1895a4[_0x9c8b('0x16')]['code']===0x1f4){logger[_0x9c8b('0x16')](_0x9c8b('0x17'),_0x2aee8a,_0x1895a4['error']['message']);return _0x35e307(_0x1895a4['error'][_0x9c8b('0x18')]);}logger[_0x9c8b('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x2aee8a,_0x1895a4[_0x9c8b('0x16')][_0x9c8b('0x18')]);return _0x226c24(_0x1895a4['error']['message']);}else{logger[_0x9c8b('0x11')](_0x9c8b('0x17'),_0x2aee8a,'request\x20sent');_0x226c24(_0x1895a4[_0x9c8b('0x19')]['message']);}})[_0x9c8b('0x1a')](function(_0x51b266){logger[_0x9c8b('0x16')](_0x9c8b('0x17'),_0x2aee8a,_0x51b266);_0x35e307(_0x51b266);});});}exports[_0x9c8b('0x1b')]=function(_0x20a600){var _0x2af727=this;return new Promise(function(_0x1f9af3,_0x4e1b48){return db['ChatInteraction'][_0x9c8b('0x1c')](_0x20a600[_0x9c8b('0x1d')],{'raw':_0x20a600[_0x9c8b('0x1e')]?_0x20a600[_0x9c8b('0x1e')][_0x9c8b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20a600[_0x9c8b('0x1e')]?_0x20a600[_0x9c8b('0x1e')]['where']||null:null,'attributes':_0x20a600[_0x9c8b('0x1e')]?_0x20a600[_0x9c8b('0x1e')][_0x9c8b('0x20')]||null:null,'limit':_0x20a600['options']?_0x20a600['options'][_0x9c8b('0x21')]||null:null})[_0x9c8b('0x10')](function(_0x40b4e1){logger['info'](_0x9c8b('0x1b'),_0x20a600);logger['debug']('UpdateChatInteraction',_0x20a600,JSON[_0x9c8b('0x15')](_0x40b4e1));_0x1f9af3(_0x40b4e1);})['catch'](function(_0x394c44){logger[_0x9c8b('0x16')](_0x9c8b('0x1b'),_0x394c44[_0x9c8b('0x18')],_0x20a600);_0x4e1b48(_0x2af727[_0x9c8b('0x16')](0x1f4,_0x394c44[_0x9c8b('0x18')]));});});};exports[_0x9c8b('0x22')]=function(_0x55a6c2){return new Promise(function(_0x102985,_0x2d499d){return db[_0x9c8b('0x23')]['find']({'where':_0x55a6c2[_0x9c8b('0x1e')]?_0x55a6c2[_0x9c8b('0x1e')][_0x9c8b('0x24')]||null:null})[_0x9c8b('0x10')](function(_0x942d45){if(_0x942d45){return _0x942d45[_0x9c8b('0x25')](_0x55a6c2['body'][_0x9c8b('0x26')],_[_0x9c8b('0x27')](_0x55a6c2[_0x9c8b('0x1d')],[_0x9c8b('0x26'),'id'])||{});}})[_0x9c8b('0x28')](function(_0x11ea7e){logger[_0x9c8b('0x11')](_0x9c8b('0x29'),_0x55a6c2);logger[_0x9c8b('0x13')](_0x9c8b('0x29'),_0x55a6c2,JSON[_0x9c8b('0x15')](_0x11ea7e));_0x102985(_0x11ea7e);})[_0x9c8b('0x1a')](function(_0x274b05){logger[_0x9c8b('0x16')]('AddTags',_0x274b05[_0x9c8b('0x18')],_0x55a6c2);_0x2d499d(_this[_0x9c8b('0x16')](0x1f4,_0x274b05[_0x9c8b('0x18')]));});});};
\ No newline at end of file
+var _0x2c9f=['error','code','message','catch','UpdateChatInteraction','update','raw','options','attributes','limit','ChatInteraction','find','addTags','body','omit','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','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'];(function(_0x4ec7f2,_0x3d92d2){var _0x118004=function(_0x1ac4fb){while(--_0x1ac4fb){_0x4ec7f2['push'](_0x4ec7f2['shift']());}};_0x118004(++_0x3d92d2);}(_0x2c9f,0x1c9));var _0xf2c9=function(_0x11d44b,_0x1c8de0){_0x11d44b=_0x11d44b-0x0;var _0x7af8aa=_0x2c9f[_0x11d44b];return _0x7af8aa;};'use strict';var _=require(_0xf2c9('0x0'));var util=require(_0xf2c9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf2c9('0x2'));var fs=require('fs');var Redis=require(_0xf2c9('0x3'));var db=require(_0xf2c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf2c9('0x5'))(_0xf2c9('0x6'));var config=require(_0xf2c9('0x7'));var jayson=require(_0xf2c9('0x8'));var client=jayson[_0xf2c9('0x9')]['http']({'port':0x232a});config[_0xf2c9('0xa')]=_[_0xf2c9('0xb')](config[_0xf2c9('0xa')],{'host':_0xf2c9('0xc'),'port':0x18eb});var socket=require(_0xf2c9('0xd'))(new Redis(config[_0xf2c9('0xa')]));require(_0xf2c9('0xe'))['register'](socket);function respondWithRpcPromise(_0x2861ab,_0x424058,_0xf74184){return new BPromise(function(_0x2b60f6,_0x265174){return client[_0xf2c9('0xf')](_0x2861ab,_0xf74184)[_0xf2c9('0x10')](function(_0x3f0ba4){logger[_0xf2c9('0x11')](_0xf2c9('0x12'),_0x424058,_0xf2c9('0x13'));logger[_0xf2c9('0x14')](_0xf2c9('0x15'),_0x424058,_0xf2c9('0x13'),JSON[_0xf2c9('0x16')](_0x3f0ba4));if(_0x3f0ba4[_0xf2c9('0x17')]){if(_0x3f0ba4[_0xf2c9('0x17')][_0xf2c9('0x18')]===0x1f4){logger[_0xf2c9('0x17')](_0xf2c9('0x12'),_0x424058,_0x3f0ba4['error'][_0xf2c9('0x19')]);return _0x265174(_0x3f0ba4[_0xf2c9('0x17')]['message']);}logger[_0xf2c9('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x424058,_0x3f0ba4[_0xf2c9('0x17')]['message']);return _0x2b60f6(_0x3f0ba4[_0xf2c9('0x17')][_0xf2c9('0x19')]);}else{logger['info'](_0xf2c9('0x12'),_0x424058,_0xf2c9('0x13'));_0x2b60f6(_0x3f0ba4['result'][_0xf2c9('0x19')]);}})[_0xf2c9('0x1a')](function(_0x44d362){logger[_0xf2c9('0x17')](_0xf2c9('0x12'),_0x424058,_0x44d362);_0x265174(_0x44d362);});});}exports[_0xf2c9('0x1b')]=function(_0x1fd3ac){var _0xb839db=this;return new Promise(function(_0x90743a,_0x1e006a){return db['ChatInteraction'][_0xf2c9('0x1c')](_0x1fd3ac['body'],{'raw':_0x1fd3ac['options']?_0x1fd3ac['options'][_0xf2c9('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fd3ac[_0xf2c9('0x1e')]?_0x1fd3ac['options']['where']||null:null,'attributes':_0x1fd3ac['options']?_0x1fd3ac[_0xf2c9('0x1e')][_0xf2c9('0x1f')]||null:null,'limit':_0x1fd3ac['options']?_0x1fd3ac['options'][_0xf2c9('0x20')]||null:null})[_0xf2c9('0x10')](function(_0x4bb35f){logger[_0xf2c9('0x11')](_0xf2c9('0x1b'),_0x1fd3ac);logger[_0xf2c9('0x14')]('UpdateChatInteraction',_0x1fd3ac,JSON[_0xf2c9('0x16')](_0x4bb35f));_0x90743a(_0x4bb35f);})[_0xf2c9('0x1a')](function(_0x31beb2){logger[_0xf2c9('0x17')](_0xf2c9('0x1b'),_0x31beb2[_0xf2c9('0x19')],_0x1fd3ac);_0x1e006a(_0xb839db[_0xf2c9('0x17')](0x1f4,_0x31beb2[_0xf2c9('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x512d10){return new Promise(function(_0x3b1cfe,_0x17c1b8){return db[_0xf2c9('0x21')][_0xf2c9('0x22')]({'where':_0x512d10[_0xf2c9('0x1e')]?_0x512d10[_0xf2c9('0x1e')]['where']||null:null})[_0xf2c9('0x10')](function(_0x1d0d3b){if(_0x1d0d3b){return _0x1d0d3b[_0xf2c9('0x23')](_0x512d10[_0xf2c9('0x24')]['ids'],_[_0xf2c9('0x25')](_0x512d10['body'],['ids','id'])||{});}})[_0xf2c9('0x26')](function(_0x5ccb69){logger[_0xf2c9('0x11')](_0xf2c9('0x27'),_0x512d10);logger[_0xf2c9('0x14')]('AddTags',_0x512d10,JSON[_0xf2c9('0x16')](_0x5ccb69));_0x3b1cfe(_0x5ccb69);})[_0xf2c9('0x1a')](function(_0x4ebaab){logger[_0xf2c9('0x17')]('AddTags',_0x4ebaab[_0xf2c9('0x19')],_0x512d10);_0x17c1b8(_this[_0xf2c9('0x17')](0x1f4,_0x4ebaab[_0xf2c9('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 0adb9c9..ed9f07e 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 _0x97db=['length','chatInteraction:','save','remove','update','removeListener','register'];(function(_0x2edd52,_0x421654){var _0x4cf728=function(_0x4a60da){while(--_0x4a60da){_0x2edd52['push'](_0x2edd52['shift']());}};_0x4cf728(++_0x421654);}(_0x97db,0x8e));var _0xb97d=function(_0x5039e1,_0x5167e7){_0x5039e1=_0x5039e1-0x0;var _0x46dc2f=_0x97db[_0x5039e1];return _0x46dc2f;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xb97d('0x0'),_0xb97d('0x1'),_0xb97d('0x2')];function createListener(_0xdc4f5,_0xe05ea6){return function(_0x5f250b){_0xe05ea6['emit'](_0xdc4f5,_0x5f250b);};}function removeListener(_0x4c34ed,_0x42b7e0){return function(){ChatInteractionEvents[_0xb97d('0x3')](_0x4c34ed,_0x42b7e0);};}exports[_0xb97d('0x4')]=function(_0x54d574){for(var _0x523e31=0x0,_0x3a0842=events[_0xb97d('0x5')];_0x523e31<_0x3a0842;_0x523e31++){var _0x2a96c3=events[_0x523e31];var _0x4c81d0=createListener(_0xb97d('0x6')+_0x2a96c3,_0x54d574);ChatInteractionEvents['on'](_0x2a96c3,_0x4c81d0);}};
\ No newline at end of file
+var _0x2ebe=['save','remove','update','emit','removeListener','register'];(function(_0x335826,_0x5053f2){var _0xa07893=function(_0x357bdf){while(--_0x357bdf){_0x335826['push'](_0x335826['shift']());}};_0xa07893(++_0x5053f2);}(_0x2ebe,0x174));var _0xe2eb=function(_0x23b000,_0x204d41){_0x23b000=_0x23b000-0x0;var _0x3ad41a=_0x2ebe[_0x23b000];return _0x3ad41a;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xe2eb('0x0'),_0xe2eb('0x1'),_0xe2eb('0x2')];function createListener(_0x10d2ee,_0x30b644){return function(_0x3e52ac){_0x30b644[_0xe2eb('0x3')](_0x10d2ee,_0x3e52ac);};}function removeListener(_0x146a00,_0x5ad308){return function(){ChatInteractionEvents[_0xe2eb('0x4')](_0x146a00,_0x5ad308);};}exports[_0xe2eb('0x5')]=function(_0x370d0a){for(var _0x6f5dc0=0x0,_0x3d048e=events['length'];_0x6f5dc0<_0x3d048e;_0x6f5dc0++){var _0x33af3b=events[_0x6f5dc0];var _0x403fbd=createListener('chatInteraction:'+_0x33af3b,_0x370d0a);ChatInteractionEvents['on'](_0x33af3b,_0x403fbd);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index c4eca7a..a61774c 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 _0x264f=['attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','file','tracked','chatinteraction:addtags','addTags','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','delete','chatinteraction:destroy','/:id/tags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized'];(function(_0x201197,_0x33b7e6){var _0x1468bf=function(_0x13239c){while(--_0x13239c){_0x201197['push'](_0x201197['shift']());}};_0x1468bf(++_0x33b7e6);}(_0x264f,0x177));var _0xf264=function(_0x408611,_0x4c2768){_0x408611=_0x408611-0x0;var _0x5a6bf1=_0x264f[_0x408611];return _0x5a6bf1;};'use strict';var multer=require(_0xf264('0x0'));var util=require(_0xf264('0x1'));var path=require(_0xf264('0x2'));var timeout=require(_0xf264('0x3'));var express=require(_0xf264('0x4'));var router=express[_0xf264('0x5')]();var fs_extra=require(_0xf264('0x6'));var auth=require(_0xf264('0x7'));var interaction=require(_0xf264('0x8'));var config=require(_0xf264('0x9'));var controller=require('./chatInteraction.controller');router[_0xf264('0xa')]('/',auth['isAuthenticated'](),controller[_0xf264('0xb')]);router[_0xf264('0xa')](_0xf264('0xc'),auth[_0xf264('0xd')](),controller[_0xf264('0xe')]);router[_0xf264('0xa')](_0xf264('0xf'),auth[_0xf264('0x10')](),controller['show']);router['get']('/:id/attachment_download',auth[_0xf264('0x10')](),controller[_0xf264('0x11')]);router[_0xf264('0xa')](_0xf264('0x12'),auth['isAuthenticated'](),controller[_0xf264('0x13')]);router[_0xf264('0xa')]('/:id/my_messages',auth[_0xf264('0x10')](),controller[_0xf264('0x14')]);router['get'](_0xf264('0x15'),auth[_0xf264('0xd')](),controller[_0xf264('0x16')]);router[_0xf264('0x17')]('/',auth['isAuthenticated'](),controller[_0xf264('0x18')]);router['post'](_0xf264('0x19'),auth[_0xf264('0xd')](),controller[_0xf264('0x1a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3f608b,_0x461436,_0x52504f){_0x52504f(null,path['join'](config[_0xf264('0x1b')],_0xf264('0x1c')));},'filename':function(_0xc332ff,_0x10019c,_0x55b7c7){_0x55b7c7(null,util[_0xf264('0x1d')]('%s-%s',Date[_0xf264('0x1e')](),_0x10019c[_0xf264('0x1f')][_0xf264('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf264('0x17')](_0xf264('0x21'),upload['single'](_0xf264('0x22')),controller['attachmentUpload']);router[_0xf264('0x17')]('/:id/messages',auth[_0xf264('0x10')](),controller['addMessage']);router[_0xf264('0x17')]('/:id/tags',auth[_0xf264('0xd')](),interaction[_0xf264('0x23')]('chat',_0xf264('0x24')),controller[_0xf264('0x25')]);router[_0xf264('0x26')](_0xf264('0xf'),auth[_0xf264('0xd')](),interaction[_0xf264('0x23')](_0xf264('0x27'),_0xf264('0x28')),controller[_0xf264('0x29')]);router['put'](_0xf264('0x2a'),controller[_0xf264('0x2b')]);router[_0xf264('0x26')]('/:id/abandon',auth[_0xf264('0x10')](),controller[_0xf264('0x2c')]);router[_0xf264('0x26')]('/:id/close',controller['close']);router[_0xf264('0x2d')](_0xf264('0xf'),auth['isAuthenticated'](),interaction[_0xf264('0x23')](_0xf264('0x27'),_0xf264('0x2e')),controller['destroy']);router[_0xf264('0x2d')](_0xf264('0x2f'),auth[_0xf264('0xd')](),controller['removeTags']);module[_0xf264('0x30')]=router;
\ No newline at end of file
+var _0xbde3=['/:id/abandon','abandon','/:id/close','close','delete','/:id','tracked','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','download','post','create','diskStorage','server/files/attachments/','format','%s-%s','originalname','replace','/:id/attachment_upload','single','attachmentUpload','/:id/messages','/:id/tags','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate'];(function(_0x3068cb,_0x3441b8){var _0x4f2d79=function(_0xb8ae7e){while(--_0xb8ae7e){_0x3068cb['push'](_0x3068cb['shift']());}};_0x4f2d79(++_0x3441b8);}(_0xbde3,0x130));var _0x3bde=function(_0x442ae6,_0x58743b){_0x442ae6=_0x442ae6-0x0;var _0x581317=_0xbde3[_0x442ae6];return _0x581317;};'use strict';var multer=require('multer');var util=require(_0x3bde('0x0'));var path=require(_0x3bde('0x1'));var timeout=require(_0x3bde('0x2'));var express=require(_0x3bde('0x3'));var router=express[_0x3bde('0x4')]();var fs_extra=require(_0x3bde('0x5'));var auth=require(_0x3bde('0x6'));var interaction=require(_0x3bde('0x7'));var config=require(_0x3bde('0x8'));var controller=require(_0x3bde('0x9'));router[_0x3bde('0xa')]('/',auth[_0x3bde('0xb')](),controller['index']);router['get'](_0x3bde('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x3bde('0xa')]('/:id',auth[_0x3bde('0xd')](),controller[_0x3bde('0xe')]);router[_0x3bde('0xa')](_0x3bde('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x3bde('0x10')]);router['get']('/:id/messages',auth[_0x3bde('0xb')](),controller['getMessages']);router[_0x3bde('0xa')]('/:id/my_messages',auth[_0x3bde('0xd')](),controller['getMyMessages']);router['get']('/:id/download',auth[_0x3bde('0xb')](),controller[_0x3bde('0x11')]);router[_0x3bde('0x12')]('/',auth[_0x3bde('0xb')](),controller[_0x3bde('0x13')]);router['post']('/:id/vidaoo',auth[_0x3bde('0xb')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x3bde('0x14')]({'destination':function(_0x53a27e,_0x324c0e,_0x53588e){_0x53588e(null,path['join'](config['root'],_0x3bde('0x15')));},'filename':function(_0x5b3e28,_0x2af720,_0x22e9b1){_0x22e9b1(null,util[_0x3bde('0x16')](_0x3bde('0x17'),Date['now'](),_0x2af720[_0x3bde('0x18')][_0x3bde('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3bde('0x12')](_0x3bde('0x1a'),upload[_0x3bde('0x1b')]('file'),controller[_0x3bde('0x1c')]);router[_0x3bde('0x12')](_0x3bde('0x1d'),auth[_0x3bde('0xd')](),controller['addMessage']);router['post'](_0x3bde('0x1e'),auth[_0x3bde('0xb')](),interaction['tracked'](_0x3bde('0x1f'),_0x3bde('0x20')),controller[_0x3bde('0x21')]);router[_0x3bde('0x22')]('/:id',auth[_0x3bde('0xb')](),interaction['tracked'](_0x3bde('0x1f'),_0x3bde('0x23')),controller[_0x3bde('0x24')]);router['put'](_0x3bde('0x25'),controller[_0x3bde('0x26')]);router[_0x3bde('0x22')](_0x3bde('0x27'),auth[_0x3bde('0xd')](),controller[_0x3bde('0x28')]);router['put'](_0x3bde('0x29'),controller[_0x3bde('0x2a')]);router[_0x3bde('0x2b')](_0x3bde('0x2c'),auth[_0x3bde('0xb')](),interaction[_0x3bde('0x2d')](_0x3bde('0x1f'),'chatinteraction:destroy'),controller[_0x3bde('0x2e')]);router[_0x3bde('0x2b')](_0x3bde('0x1e'),auth['isAuthenticated'](),controller[_0x3bde('0x2f')]);module[_0x3bde('0x30')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 7e3cb65..e983155 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 _0x55f6=['medium','INTEGER','exports','TEXT'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x55f6,0x14e));var _0x655f=function(_0x35c013,_0x456f78){_0x35c013=_0x35c013-0x0;var _0x3e1e17=_0x55f6[_0x35c013];return _0x3e1e17;};'use strict';var Sequelize=require('sequelize');module[_0x655f('0x0')]={'body':{'type':Sequelize[_0x655f('0x1')](_0x655f('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x655f('0x3')]}};
\ No newline at end of file
+var _0xdc2d=['INTEGER','sequelize','BOOLEAN'];(function(_0xdecc07,_0x54ee6d){var _0x2ad019=function(_0x49f7fa){while(--_0x49f7fa){_0xdecc07['push'](_0xdecc07['shift']());}};_0x2ad019(++_0x54ee6d);}(_0xdc2d,0xa9));var _0xddc2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdc2d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xddc2('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xddc2('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xddc2('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 29c0549..3f2d660 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 _0x8a95=['UserProfileResource','isEmpty','resourceId','push','filter','messages','FromId','ToId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','undefined','limit','count','offset','apply','save','update','then','destroy','error','stack','name','send','index','ChatInternalMessage','fieldName','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','describe','get','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','user','role','internal','online','lastLoginAt','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId'];(function(_0x2806e0,_0xc69dad){var _0x356c7b=function(_0x13b322){while(--_0x13b322){_0x2806e0['push'](_0x2806e0['shift']());}};_0x356c7b(++_0xc69dad);}(_0x8a95,0x1bb));var _0x58a9=function(_0x242e7d,_0x4545ac){_0x242e7d=_0x242e7d-0x0;var _0x2caafa=_0x8a95[_0x242e7d];return _0x2caafa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x58a9('0x0'));var zipdir=require(_0x58a9('0x1'));var jsonpatch=require(_0x58a9('0x2'));var rp=require('request-promise');var moment=require(_0x58a9('0x3'));var BPromise=require(_0x58a9('0x4'));var Mustache=require(_0x58a9('0x5'));var util=require(_0x58a9('0x6'));var path=require(_0x58a9('0x7'));var sox=require(_0x58a9('0x8'));var csv=require(_0x58a9('0x9'));var ejs=require(_0x58a9('0xa'));var fs=require('fs');var fs_extra=require(_0x58a9('0xb'));var _=require(_0x58a9('0xc'));var squel=require(_0x58a9('0xd'));var crypto=require(_0x58a9('0xe'));var jsforce=require(_0x58a9('0xf'));var deskjs=require(_0x58a9('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x58a9('0x11'));var Redis=require(_0x58a9('0x12'));var authService=require(_0x58a9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x58a9('0x14'));var hardwareService=require(_0x58a9('0x15'));var logger=require('../../config/logger')(_0x58a9('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x58a9('0x17'));var db=require('../../mysqldb')['db'];config[_0x58a9('0x18')]=_[_0x58a9('0x19')](config['redis'],{'host':_0x58a9('0x1a'),'port':0x18eb});var socket=require(_0x58a9('0x1b'))(new Redis(config[_0x58a9('0x18')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x33f2b5,_0x3aa5ca){_0x3aa5ca=_0x3aa5ca||0xcc;return function(_0x39e1be){if(_0x39e1be){return _0x33f2b5[_0x58a9('0x1c')](_0x3aa5ca);}return _0x33f2b5[_0x58a9('0x1d')](_0x3aa5ca)[_0x58a9('0x1e')]();};}function respondWithResult(_0x3ac8d7,_0x23ef06){_0x23ef06=_0x23ef06||0xc8;return function(_0x24b4f7){if(_0x24b4f7){return _0x3ac8d7[_0x58a9('0x1d')](_0x23ef06)[_0x58a9('0x1f')](_0x24b4f7);}};}function respondWithFilteredResult(_0x1088ed,_0x48a0e4){return function(_0x15922d){if(_0x15922d){var _0x2025c5=typeof _0x48a0e4['offset']===_0x58a9('0x20')&&typeof _0x48a0e4[_0x58a9('0x21')]==='undefined';var _0x56c7c2=_0x15922d[_0x58a9('0x22')];var _0x4340b7=_0x2025c5?0x0:_0x48a0e4[_0x58a9('0x23')];var _0xd6ce3f=_0x2025c5?_0x15922d[_0x58a9('0x22')]:_0x48a0e4[_0x58a9('0x23')]+_0x48a0e4[_0x58a9('0x21')];var _0x1bc688;if(_0xd6ce3f>=_0x56c7c2){_0xd6ce3f=_0x56c7c2;_0x1bc688=0xc8;}else{_0x1bc688=0xce;}_0x1088ed[_0x58a9('0x1d')](_0x1bc688);return _0x1088ed['set']('Content-Range',_0x4340b7+'-'+_0xd6ce3f+'/'+_0x56c7c2)[_0x58a9('0x1f')](_0x15922d);}return null;};}function patchUpdates(_0x1cf7a6){return function(_0x1d6d58){try{jsonpatch[_0x58a9('0x24')](_0x1d6d58,_0x1cf7a6,!![]);}catch(_0x1cb7d3){return BPromise['reject'](_0x1cb7d3);}return _0x1d6d58[_0x58a9('0x25')]();};}function saveUpdates(_0x4794ff,_0x3e2297){return function(_0x20bf2c){if(_0x20bf2c){return _0x20bf2c[_0x58a9('0x26')](_0x4794ff)[_0x58a9('0x27')](function(_0x37b560){return _0x37b560;});}return null;};}function removeEntity(_0x248110,_0x2db306){return function(_0x13025e){if(_0x13025e){return _0x13025e[_0x58a9('0x28')]()[_0x58a9('0x27')](function(){_0x248110[_0x58a9('0x1d')](0xcc)[_0x58a9('0x1e')]();});}};}function handleEntityNotFound(_0x1a382d,_0x37b85a){return function(_0x305bbc){if(!_0x305bbc){_0x1a382d[_0x58a9('0x1c')](0x194);}return _0x305bbc;};}function handleError(_0x63e1b1,_0x2262e7){_0x2262e7=_0x2262e7||0x1f4;return function(_0x564c32){logger[_0x58a9('0x29')](_0x564c32[_0x58a9('0x2a')]);if(_0x564c32[_0x58a9('0x2b')]){delete _0x564c32[_0x58a9('0x2b')];}_0x63e1b1[_0x58a9('0x1d')](_0x2262e7)[_0x58a9('0x2c')](_0x564c32);};}exports[_0x58a9('0x2d')]=function(_0x307e24,_0x169cb8){var _0x3e1e9a={},_0x58537e={},_0x23c72f={'count':0x0,'rows':[]};var _0x44856c=_['map'](db[_0x58a9('0x2e')]['rawAttributes'],function(_0x203da1){return{'name':_0x203da1[_0x58a9('0x2f')],'type':_0x203da1['type'][_0x58a9('0x30')]};});_0x58537e['model']=_[_0x58a9('0x31')](_0x44856c,'name');_0x58537e[_0x58a9('0x32')]=_['keys'](_0x307e24[_0x58a9('0x32')]);_0x58537e[_0x58a9('0x33')]=_[_0x58a9('0x34')](_0x58537e[_0x58a9('0x35')],_0x58537e[_0x58a9('0x32')]);_0x3e1e9a[_0x58a9('0x36')]=_[_0x58a9('0x34')](_0x58537e[_0x58a9('0x35')],qs[_0x58a9('0x37')](_0x307e24[_0x58a9('0x32')][_0x58a9('0x37')]));_0x3e1e9a[_0x58a9('0x36')]=_0x3e1e9a[_0x58a9('0x36')][_0x58a9('0x38')]?_0x3e1e9a[_0x58a9('0x36')]:_0x58537e[_0x58a9('0x35')];if(!_0x307e24[_0x58a9('0x32')][_0x58a9('0x39')]('nolimit')){_0x3e1e9a[_0x58a9('0x21')]=qs[_0x58a9('0x21')](_0x307e24[_0x58a9('0x32')][_0x58a9('0x21')]);_0x3e1e9a[_0x58a9('0x23')]=qs[_0x58a9('0x23')](_0x307e24[_0x58a9('0x32')][_0x58a9('0x23')]);}_0x3e1e9a[_0x58a9('0x3a')]=qs[_0x58a9('0x3b')](_0x307e24[_0x58a9('0x32')][_0x58a9('0x3b')]);_0x3e1e9a[_0x58a9('0x3c')]=qs[_0x58a9('0x33')](_[_0x58a9('0x3d')](_0x307e24[_0x58a9('0x32')],_0x58537e[_0x58a9('0x33')]),_0x44856c);if(_0x307e24[_0x58a9('0x32')]['filter']){_0x3e1e9a[_0x58a9('0x3c')]=_[_0x58a9('0x3e')](_0x3e1e9a[_0x58a9('0x3c')],{'$or':_['map'](_0x44856c,function(_0x4d797f){if(_0x4d797f['type']!==_0x58a9('0x3f')){var _0x441ee9={};_0x441ee9[_0x4d797f['name']]={'$like':'%'+_0x307e24[_0x58a9('0x32')]['filter']+'%'};return _0x441ee9;}})});}_0x3e1e9a=_[_0x58a9('0x3e')]({},_0x3e1e9a,_0x307e24[_0x58a9('0x40')]);var _0x18ce5a={'where':_0x3e1e9a[_0x58a9('0x3c')]};return db[_0x58a9('0x2e')]['count'](_0x18ce5a)[_0x58a9('0x27')](function(_0x15c3fa){_0x23c72f['count']=_0x15c3fa;if(_0x307e24[_0x58a9('0x32')][_0x58a9('0x41')]){_0x3e1e9a[_0x58a9('0x42')]=[{'all':!![]}];}return db[_0x58a9('0x2e')][_0x58a9('0x43')](_0x3e1e9a);})[_0x58a9('0x27')](function(_0x38bcd0){_0x23c72f[_0x58a9('0x44')]=_0x38bcd0;return _0x23c72f;})[_0x58a9('0x27')](respondWithFilteredResult(_0x169cb8,_0x3e1e9a))[_0x58a9('0x45')](handleError(_0x169cb8,null));};exports[_0x58a9('0x46')]=function(_0x1618cb,_0x5acba5){var _0x2b0691={'raw':!![],'where':{'id':_0x1618cb[_0x58a9('0x47')]['id']}},_0x538d5d={};_0x538d5d[_0x58a9('0x35')]=_[_0x58a9('0x48')](db[_0x58a9('0x2e')][_0x58a9('0x49')]);_0x538d5d[_0x58a9('0x32')]=_[_0x58a9('0x48')](_0x1618cb[_0x58a9('0x32')]);_0x538d5d[_0x58a9('0x33')]=_['intersection'](_0x538d5d[_0x58a9('0x35')],_0x538d5d[_0x58a9('0x32')]);_0x2b0691['attributes']=_[_0x58a9('0x34')](_0x538d5d[_0x58a9('0x35')],qs['fields'](_0x1618cb[_0x58a9('0x32')][_0x58a9('0x37')]));_0x2b0691['attributes']=_0x2b0691[_0x58a9('0x36')][_0x58a9('0x38')]?_0x2b0691[_0x58a9('0x36')]:_0x538d5d['model'];if(_0x1618cb[_0x58a9('0x32')]['includeAll']){_0x2b0691[_0x58a9('0x42')]=[{'all':!![]}];}_0x2b0691=_[_0x58a9('0x3e')]({},_0x2b0691,_0x1618cb['options']);return db[_0x58a9('0x2e')][_0x58a9('0x4a')](_0x2b0691)['then'](handleEntityNotFound(_0x5acba5,null))[_0x58a9('0x27')](respondWithResult(_0x5acba5,null))[_0x58a9('0x45')](handleError(_0x5acba5,null));};exports[_0x58a9('0x4b')]=function(_0x653b06,_0x576797){return db[_0x58a9('0x2e')][_0x58a9('0x4b')](_0x653b06[_0x58a9('0x4c')],{})[_0x58a9('0x27')](respondWithResult(_0x576797,0xc9))[_0x58a9('0x45')](handleError(_0x576797,null));};exports[_0x58a9('0x26')]=function(_0xecf5a7,_0x38a6ef){if(_0xecf5a7[_0x58a9('0x4c')]['id']){delete _0xecf5a7[_0x58a9('0x4c')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0xecf5a7[_0x58a9('0x47')]['id']}})[_0x58a9('0x27')](handleEntityNotFound(_0x38a6ef,null))[_0x58a9('0x27')](saveUpdates(_0xecf5a7[_0x58a9('0x4c')],null))[_0x58a9('0x27')](respondWithResult(_0x38a6ef,null))[_0x58a9('0x45')](handleError(_0x38a6ef,null));};exports['destroy']=function(_0x3d12ef,_0x14b3cb){return db['ChatInternalMessage'][_0x58a9('0x4a')]({'where':{'id':_0x3d12ef[_0x58a9('0x47')]['id']}})['then'](handleEntityNotFound(_0x14b3cb,null))[_0x58a9('0x27')](removeEntity(_0x14b3cb,null))['catch'](handleError(_0x14b3cb,null));};exports[_0x58a9('0x4d')]=function(_0x996e3e,_0x321fce){return db[_0x58a9('0x2e')][_0x58a9('0x4d')]()['then'](respondWithResult(_0x321fce,null))[_0x58a9('0x45')](handleError(_0x321fce,null));};function wrapUser(_0x4d0baf){return function(_0x3947aa){var _0x413e36=_0x4d0baf[_0x58a9('0x4e')]({'plain':!![]});_0x413e36['messages']=[];if(_0x3947aa){_0x413e36[_0x58a9('0x4f')]=_0x3947aa['createdAt'];_0x413e36[_0x58a9('0x50')]=_0x3947aa;}else{_0x413e36[_0x58a9('0x4f')]=moment(0x0)[_0x58a9('0x51')](_0x58a9('0x52'));_0x413e36[_0x58a9('0x50')]={};}return _0x413e36;};}exports[_0x58a9('0x53')]=function(_0x2eadb3,_0x304063,_0xc877b4){var _0x692a79=[];return db['User'][_0x58a9('0x43')]({'where':{'role':[_0x58a9('0x54'),'admin',_0x58a9('0x55')]},'attributes':['id','fullname',_0x58a9('0x2b'),_0x58a9('0x56'),'userpic',_0x58a9('0x57'),_0x58a9('0x58'),_0x58a9('0x59'),'allowmessenger',_0x58a9('0x5a')],'order':qs[_0x58a9('0x3b')]('-online'),'include':[{'model':db[_0x58a9('0x5b')],'as':_0x58a9('0x5c'),'attributes':['id',_0x58a9('0x2b'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x3d149d){if(_0x3d149d){var _0x2269e4=_0x2eadb3[_0x58a9('0x55')]['get']({'plain':!![]});if(!_0x2269e4)throw new Error(_0x58a9('0x5d'));if(_0x2269e4[_0x58a9('0x56')]===_0x58a9('0x55')){return db[_0x58a9('0x5e')][_0x58a9('0x4a')]({'where':{'name':_0x58a9('0x5f'),'userProfileId':_0x2269e4[_0x58a9('0x60')]},'raw':!![]})[_0x58a9('0x27')](function(_0x30e7e7){if(_0x30e7e7){if(_0x30e7e7['autoAssociation']===0x0){return db[_0x58a9('0x61')][_0x58a9('0x43')]({'where':{'sectionId':_0x30e7e7['id']},'raw':!![]})[_0x58a9('0x27')](function(_0x1b2e08){var _0x33ffca=[];if(_[_0x58a9('0x62')](_0x1b2e08)){_0x33ffca=_['filter'](_0x3d149d,function(_0x3039be){if(_0x3039be['role']!==_0x58a9('0x54')){return _0x3039be;}});return _0x33ffca;}else{for(var _0x313293=0x0;_0x313293<_0x3d149d['length'];_0x313293++){var _0x26b622=_0x3d149d[_0x313293];if(_0x26b622['role']==='agent'){var _0xe0338b=_[_0x58a9('0x4a')](_0x1b2e08,function(_0x59fb13){return _0x59fb13[_0x58a9('0x63')]===_0x26b622['id'];});if(_0xe0338b)_0x33ffca['push'](_0x26b622);}else{_0x33ffca[_0x58a9('0x64')](_0x26b622);}}return _0x33ffca;}});}else{return _0x3d149d;}}else{var _0x3f8f13=_[_0x58a9('0x65')](_0x3d149d,function(_0x282dbe){if(_0x282dbe[_0x58a9('0x56')]!==_0x58a9('0x54')){return _0x282dbe;}});return _0x3f8f13;}});}else{return _0x3d149d;}}})[_0x58a9('0x27')](function(_0x24b112){var _0x3510df=[];if(_0x24b112){_0x692a79=_0x24b112;for(var _0x2e7e86=0x0;_0x2e7e86<_0x24b112[_0x58a9('0x38')];_0x2e7e86+=0x1){_0x692a79[_0x2e7e86][_0x58a9('0x66')]=[];_0x3510df[_0x58a9('0x64')](db[_0x58a9('0x2e')][_0x58a9('0x4a')]({'where':{'FromId':[_0x2eadb3[_0x58a9('0x55')]['id'],_0x24b112[_0x2e7e86]['id']],'ToId':[_0x2eadb3[_0x58a9('0x55')]['id'],_0x24b112[_0x2e7e86]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x58a9('0x67'),_0x58a9('0x68'),_0x58a9('0x69'),_0x58a9('0x4c')],'order':qs[_0x58a9('0x3b')](_0x58a9('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x58a9('0x27')](wrapUser(_0x24b112[_0x2e7e86])));}return BPromise[_0x58a9('0x6b')](_0x3510df);}return[];})[_0x58a9('0x27')](function(_0x4ed5b3){return{'rows':_0x4ed5b3,'count':_0x4ed5b3[_0x58a9('0x38')]};})[_0x58a9('0x27')](respondWithResult(_0x304063,null))[_0x58a9('0x45')](handleError(_0x304063,null));};
\ No newline at end of file
+var _0xc16f=['create','body','params','describe','createdAt','lastMessageAt','format','lastMessage','getUsers','agent','user','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find'];(function(_0x42ed03,_0x18b558){var _0x1a0126=function(_0xe74416){while(--_0xe74416){_0x42ed03['push'](_0x42ed03['shift']());}};_0x1a0126(++_0x18b558);}(_0xc16f,0x1eb));var _0xfc16=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc16f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xfc16('0x0'));var rimraf=require(_0xfc16('0x1'));var zipdir=require(_0xfc16('0x2'));var jsonpatch=require(_0xfc16('0x3'));var rp=require(_0xfc16('0x4'));var moment=require(_0xfc16('0x5'));var BPromise=require(_0xfc16('0x6'));var Mustache=require(_0xfc16('0x7'));var util=require('util');var path=require(_0xfc16('0x8'));var sox=require(_0xfc16('0x9'));var csv=require(_0xfc16('0xa'));var ejs=require(_0xfc16('0xb'));var fs=require('fs');var fs_extra=require(_0xfc16('0xc'));var _=require('lodash');var squel=require(_0xfc16('0xd'));var crypto=require(_0xfc16('0xe'));var jsforce=require(_0xfc16('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xfc16('0xa'));var querystring=require('querystring');var Papa=require(_0xfc16('0x10'));var Redis=require(_0xfc16('0x11'));var authService=require(_0xfc16('0x12'));var qs=require(_0xfc16('0x13'));var as=require(_0xfc16('0x14'));var hardwareService=require(_0xfc16('0x15'));var logger=require(_0xfc16('0x16'))(_0xfc16('0x17'));var utils=require('../../config/utils');var config=require(_0xfc16('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xfc16('0x19')]=_[_0xfc16('0x1a')](config[_0xfc16('0x19')],{'host':_0xfc16('0x1b'),'port':0x18eb});var socket=require(_0xfc16('0x1c'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xfc16('0x1d')](socket);function respondWithStatusCode(_0x17be7d,_0x46fbdc){_0x46fbdc=_0x46fbdc||0xcc;return function(_0x4f8e75){if(_0x4f8e75){return _0x17be7d['sendStatus'](_0x46fbdc);}return _0x17be7d[_0xfc16('0x1e')](_0x46fbdc)[_0xfc16('0x1f')]();};}function respondWithResult(_0x58b894,_0x24eab5){_0x24eab5=_0x24eab5||0xc8;return function(_0x4b84d7){if(_0x4b84d7){return _0x58b894[_0xfc16('0x1e')](_0x24eab5)[_0xfc16('0x20')](_0x4b84d7);}};}function respondWithFilteredResult(_0x433804,_0x2f4ecf){return function(_0x48fa2e){if(_0x48fa2e){var _0x4bb7ff=typeof _0x2f4ecf[_0xfc16('0x21')]==='undefined'&&typeof _0x2f4ecf[_0xfc16('0x22')]===_0xfc16('0x23');var _0x5d5145=_0x48fa2e[_0xfc16('0x24')];var _0x3f78f3=_0x4bb7ff?0x0:_0x2f4ecf[_0xfc16('0x21')];var _0x1138fb=_0x4bb7ff?_0x48fa2e[_0xfc16('0x24')]:_0x2f4ecf[_0xfc16('0x21')]+_0x2f4ecf['limit'];var _0x3beaab;if(_0x1138fb>=_0x5d5145){_0x1138fb=_0x5d5145;_0x3beaab=0xc8;}else{_0x3beaab=0xce;}_0x433804['status'](_0x3beaab);return _0x433804[_0xfc16('0x25')](_0xfc16('0x26'),_0x3f78f3+'-'+_0x1138fb+'/'+_0x5d5145)[_0xfc16('0x20')](_0x48fa2e);}return null;};}function patchUpdates(_0x52e86f){return function(_0x5831cc){try{jsonpatch['apply'](_0x5831cc,_0x52e86f,!![]);}catch(_0x30df21){return BPromise[_0xfc16('0x27')](_0x30df21);}return _0x5831cc[_0xfc16('0x28')]();};}function saveUpdates(_0x53413c,_0x5b6102){return function(_0x5ad189){if(_0x5ad189){return _0x5ad189[_0xfc16('0x29')](_0x53413c)[_0xfc16('0x2a')](function(_0x5cd5af){return _0x5cd5af;});}return null;};}function removeEntity(_0x46f5c4,_0x4a7201){return function(_0x3777f7){if(_0x3777f7){return _0x3777f7[_0xfc16('0x2b')]()['then'](function(){_0x46f5c4[_0xfc16('0x1e')](0xcc)[_0xfc16('0x1f')]();});}};}function handleEntityNotFound(_0x5bc2a5,_0x4d302f){return function(_0x182686){if(!_0x182686){_0x5bc2a5[_0xfc16('0x2c')](0x194);}return _0x182686;};}function handleError(_0x31974c,_0x17d9d5){_0x17d9d5=_0x17d9d5||0x1f4;return function(_0xee267d){logger[_0xfc16('0x2d')](_0xee267d[_0xfc16('0x2e')]);if(_0xee267d['name']){delete _0xee267d[_0xfc16('0x2f')];}_0x31974c[_0xfc16('0x1e')](_0x17d9d5)[_0xfc16('0x30')](_0xee267d);};}exports[_0xfc16('0x31')]=function(_0x54ad95,_0xcd880d){var _0x5dde2d={},_0x468c71={},_0x5d879e={'count':0x0,'rows':[]};var _0xdbecab=_[_0xfc16('0x32')](db[_0xfc16('0x33')]['rawAttributes'],function(_0x51ffd9){return{'name':_0x51ffd9['fieldName'],'type':_0x51ffd9[_0xfc16('0x34')][_0xfc16('0x35')]};});_0x468c71['model']=_[_0xfc16('0x32')](_0xdbecab,_0xfc16('0x2f'));_0x468c71[_0xfc16('0x36')]=_[_0xfc16('0x37')](_0x54ad95[_0xfc16('0x36')]);_0x468c71['filters']=_[_0xfc16('0x38')](_0x468c71[_0xfc16('0x39')],_0x468c71['query']);_0x5dde2d['attributes']=_[_0xfc16('0x38')](_0x468c71[_0xfc16('0x39')],qs[_0xfc16('0x3a')](_0x54ad95[_0xfc16('0x36')][_0xfc16('0x3a')]));_0x5dde2d[_0xfc16('0x3b')]=_0x5dde2d['attributes'][_0xfc16('0x3c')]?_0x5dde2d[_0xfc16('0x3b')]:_0x468c71[_0xfc16('0x39')];if(!_0x54ad95[_0xfc16('0x36')][_0xfc16('0x3d')](_0xfc16('0x3e'))){_0x5dde2d[_0xfc16('0x22')]=qs[_0xfc16('0x22')](_0x54ad95[_0xfc16('0x36')][_0xfc16('0x22')]);_0x5dde2d['offset']=qs[_0xfc16('0x21')](_0x54ad95['query']['offset']);}_0x5dde2d[_0xfc16('0x3f')]=qs[_0xfc16('0x40')](_0x54ad95['query'][_0xfc16('0x40')]);_0x5dde2d[_0xfc16('0x41')]=qs['filters'](_[_0xfc16('0x42')](_0x54ad95[_0xfc16('0x36')],_0x468c71[_0xfc16('0x43')]),_0xdbecab);if(_0x54ad95[_0xfc16('0x36')]['filter']){_0x5dde2d[_0xfc16('0x41')]=_[_0xfc16('0x44')](_0x5dde2d[_0xfc16('0x41')],{'$or':_[_0xfc16('0x32')](_0xdbecab,function(_0x2437d9){if(_0x2437d9['type']!==_0xfc16('0x45')){var _0x5af1a5={};_0x5af1a5[_0x2437d9[_0xfc16('0x2f')]]={'$like':'%'+_0x54ad95[_0xfc16('0x36')][_0xfc16('0x46')]+'%'};return _0x5af1a5;}})});}_0x5dde2d=_['merge']({},_0x5dde2d,_0x54ad95[_0xfc16('0x47')]);var _0x245b48={'where':_0x5dde2d['where']};return db[_0xfc16('0x33')][_0xfc16('0x24')](_0x245b48)[_0xfc16('0x2a')](function(_0x55614f){_0x5d879e['count']=_0x55614f;if(_0x54ad95[_0xfc16('0x36')][_0xfc16('0x48')]){_0x5dde2d[_0xfc16('0x49')]=[{'all':!![]}];}return db[_0xfc16('0x33')][_0xfc16('0x4a')](_0x5dde2d);})['then'](function(_0x5e3baf){_0x5d879e[_0xfc16('0x4b')]=_0x5e3baf;return _0x5d879e;})['then'](respondWithFilteredResult(_0xcd880d,_0x5dde2d))[_0xfc16('0x4c')](handleError(_0xcd880d,null));};exports[_0xfc16('0x4d')]=function(_0x34ae54,_0x2efca5){var _0xf1b7e3={'raw':!![],'where':{'id':_0x34ae54['params']['id']}},_0x43e09f={};_0x43e09f[_0xfc16('0x39')]=_[_0xfc16('0x37')](db['ChatInternalMessage']['rawAttributes']);_0x43e09f['query']=_[_0xfc16('0x37')](_0x34ae54[_0xfc16('0x36')]);_0x43e09f[_0xfc16('0x43')]=_[_0xfc16('0x38')](_0x43e09f['model'],_0x43e09f['query']);_0xf1b7e3['attributes']=_[_0xfc16('0x38')](_0x43e09f[_0xfc16('0x39')],qs['fields'](_0x34ae54[_0xfc16('0x36')][_0xfc16('0x3a')]));_0xf1b7e3[_0xfc16('0x3b')]=_0xf1b7e3[_0xfc16('0x3b')][_0xfc16('0x3c')]?_0xf1b7e3[_0xfc16('0x3b')]:_0x43e09f[_0xfc16('0x39')];if(_0x34ae54[_0xfc16('0x36')][_0xfc16('0x48')]){_0xf1b7e3[_0xfc16('0x49')]=[{'all':!![]}];}_0xf1b7e3=_[_0xfc16('0x44')]({},_0xf1b7e3,_0x34ae54['options']);return db[_0xfc16('0x33')][_0xfc16('0x4e')](_0xf1b7e3)[_0xfc16('0x2a')](handleEntityNotFound(_0x2efca5,null))[_0xfc16('0x2a')](respondWithResult(_0x2efca5,null))[_0xfc16('0x4c')](handleError(_0x2efca5,null));};exports[_0xfc16('0x4f')]=function(_0x134b81,_0x3f75df){return db['ChatInternalMessage'][_0xfc16('0x4f')](_0x134b81[_0xfc16('0x50')],{})['then'](respondWithResult(_0x3f75df,0xc9))[_0xfc16('0x4c')](handleError(_0x3f75df,null));};exports['update']=function(_0x3bf86e,_0x2fc137){if(_0x3bf86e[_0xfc16('0x50')]['id']){delete _0x3bf86e[_0xfc16('0x50')]['id'];}return db['ChatInternalMessage'][_0xfc16('0x4e')]({'where':{'id':_0x3bf86e[_0xfc16('0x51')]['id']}})[_0xfc16('0x2a')](handleEntityNotFound(_0x2fc137,null))[_0xfc16('0x2a')](saveUpdates(_0x3bf86e[_0xfc16('0x50')],null))[_0xfc16('0x2a')](respondWithResult(_0x2fc137,null))[_0xfc16('0x4c')](handleError(_0x2fc137,null));};exports[_0xfc16('0x2b')]=function(_0x417565,_0x4c6624){return db['ChatInternalMessage'][_0xfc16('0x4e')]({'where':{'id':_0x417565[_0xfc16('0x51')]['id']}})[_0xfc16('0x2a')](handleEntityNotFound(_0x4c6624,null))[_0xfc16('0x2a')](removeEntity(_0x4c6624,null))[_0xfc16('0x4c')](handleError(_0x4c6624,null));};exports[_0xfc16('0x52')]=function(_0x57c963,_0x4939fe){return db['ChatInternalMessage'][_0xfc16('0x52')]()[_0xfc16('0x2a')](respondWithResult(_0x4939fe,null))[_0xfc16('0x4c')](handleError(_0x4939fe,null));};function wrapUser(_0xabeaf2){return function(_0x6542d5){var _0x3f11f3=_0xabeaf2['get']({'plain':!![]});_0x3f11f3['messages']=[];if(_0x6542d5){_0x3f11f3['lastMessageAt']=_0x6542d5[_0xfc16('0x53')];_0x3f11f3['lastMessage']=_0x6542d5;}else{_0x3f11f3[_0xfc16('0x54')]=moment(0x0)[_0xfc16('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x3f11f3[_0xfc16('0x56')]={};}return _0x3f11f3;};}exports[_0xfc16('0x57')]=function(_0x2c413a,_0xdbc166,_0x2d47b5){var _0x4b33ab=[];return db['User'][_0xfc16('0x4a')]({'where':{'role':[_0xfc16('0x58'),'admin',_0xfc16('0x59')]},'attributes':['id',_0xfc16('0x5a'),'name',_0xfc16('0x5b'),_0xfc16('0x5c'),_0xfc16('0x5d'),_0xfc16('0x5e'),'lastLoginAt',_0xfc16('0x5f'),_0xfc16('0x60')],'order':qs[_0xfc16('0x40')](_0xfc16('0x61')),'include':[{'model':db[_0xfc16('0x62')],'as':_0xfc16('0x63'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0xfc16('0x2a')](function(_0x4f9385){if(_0x4f9385){var _0x4afa3d=_0x2c413a[_0xfc16('0x59')][_0xfc16('0x64')]({'plain':!![]});if(!_0x4afa3d)throw new Error(_0xfc16('0x65'));if(_0x4afa3d['role']===_0xfc16('0x59')){return db[_0xfc16('0x66')][_0xfc16('0x4e')]({'where':{'name':_0xfc16('0x67'),'userProfileId':_0x4afa3d['userProfileId']},'raw':!![]})[_0xfc16('0x2a')](function(_0x34ed86){if(_0x34ed86){if(_0x34ed86[_0xfc16('0x68')]===0x0){return db[_0xfc16('0x69')][_0xfc16('0x4a')]({'where':{'sectionId':_0x34ed86['id']},'raw':!![]})[_0xfc16('0x2a')](function(_0x2c7b44){var _0x6d8471=[];if(_[_0xfc16('0x6a')](_0x2c7b44)){_0x6d8471=_['filter'](_0x4f9385,function(_0x3e40ea){if(_0x3e40ea[_0xfc16('0x5b')]!==_0xfc16('0x58')){return _0x3e40ea;}});return _0x6d8471;}else{for(var _0x1226b6=0x0;_0x1226b6<_0x4f9385['length'];_0x1226b6++){var _0x6dfe5f=_0x4f9385[_0x1226b6];if(_0x6dfe5f['role']===_0xfc16('0x58')){var _0x2344ca=_['find'](_0x2c7b44,function(_0xf4b20d){return _0xf4b20d[_0xfc16('0x6b')]===_0x6dfe5f['id'];});if(_0x2344ca)_0x6d8471[_0xfc16('0x6c')](_0x6dfe5f);}else{_0x6d8471[_0xfc16('0x6c')](_0x6dfe5f);}}return _0x6d8471;}});}else{return _0x4f9385;}}else{var _0x1efdca=_[_0xfc16('0x46')](_0x4f9385,function(_0x31b61b){if(_0x31b61b[_0xfc16('0x5b')]!=='agent'){return _0x31b61b;}});return _0x1efdca;}});}else{return _0x4f9385;}}})[_0xfc16('0x2a')](function(_0x402c50){var _0x383738=[];if(_0x402c50){_0x4b33ab=_0x402c50;for(var _0x312194=0x0;_0x312194<_0x402c50[_0xfc16('0x3c')];_0x312194+=0x1){_0x4b33ab[_0x312194][_0xfc16('0x6d')]=[];_0x383738[_0xfc16('0x6c')](db[_0xfc16('0x33')][_0xfc16('0x4e')]({'where':{'FromId':[_0x2c413a['user']['id'],_0x402c50[_0x312194]['id']],'ToId':[_0x2c413a[_0xfc16('0x59')]['id'],_0x402c50[_0x312194]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0xfc16('0x6e'),_0xfc16('0x6f'),_0xfc16('0x50')],'order':qs[_0xfc16('0x40')](_0xfc16('0x70')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xfc16('0x2a')](wrapUser(_0x402c50[_0x312194])));}return BPromise[_0xfc16('0x71')](_0x383738);}return[];})['then'](function(_0x443371){return{'rows':_0x443371,'count':_0x443371[_0xfc16('0x3c')]};})['then'](respondWithResult(_0xdbc166,null))[_0xfc16('0x4c')](handleError(_0xdbc166,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 3900f6b..2c2766b 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 _0x3166=['emit','hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3166,0xbb));var _0x6316=function(_0x20afa0,_0xaf84ab){_0x20afa0=_0x20afa0-0x0;var _0x5981f2=_0x3166[_0x20afa0];return _0x5981f2;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x6316('0x0'))['db'][_0x6316('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6316('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6316('0x3'),'afterDestroy':_0x6316('0x4')};function emitEvent(_0x516ce3){return function(_0x42c249,_0x2d7fed,_0x5c34c5){ChatInternalMessageEvents[_0x6316('0x5')](_0x516ce3+':'+_0x42c249['id'],_0x42c249);ChatInternalMessageEvents[_0x6316('0x5')](_0x516ce3,_0x42c249);_0x5c34c5(null);};}for(var e in events){if(events[_0x6316('0x6')](e)){var event=events[e];ChatInternalMessage[_0x6316('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x3804=['../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x7bd370,_0x4bb7fa){var _0xdfa30b=function(_0x17d6b4){while(--_0x17d6b4){_0x7bd370['push'](_0x7bd370['shift']());}};_0xdfa30b(++_0x4bb7fa);}(_0x3804,0xe0));var _0x4380=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3804[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x4380('0x0'));var ChatInternalMessage=require(_0x4380('0x1'))['db'][_0x4380('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4380('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4380('0x4'),'afterDestroy':_0x4380('0x5')};function emitEvent(_0x9e8495){return function(_0x321ec5,_0x137af3,_0x160b47){ChatInternalMessageEvents['emit'](_0x9e8495+':'+_0x321ec5['id'],_0x321ec5);ChatInternalMessageEvents[_0x4380('0x6')](_0x9e8495,_0x321ec5);_0x160b47(null);};}for(var e in events){if(events[_0x4380('0x7')](e)){var event=events[e];ChatInternalMessage[_0x4380('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 76a0da6..15d4e45 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 _0xafce=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0xce1ca4,_0x2fe068){var _0x20d9d8=function(_0x524eb2){while(--_0x524eb2){_0xce1ca4['push'](_0xce1ca4['shift']());}};_0x20d9d8(++_0x2fe068);}(_0xafce,0x1ba));var _0xeafc=function(_0xe41ba8,_0xfd2419){_0xe41ba8=_0xe41ba8-0x0;var _0x4872f6=_0xafce[_0xe41ba8];return _0x4872f6;};'use strict';var _=require(_0xeafc('0x0'));var util=require('util');var logger=require(_0xeafc('0x1'))(_0xeafc('0x2'));var moment=require(_0xeafc('0x3'));var BPromise=require(_0xeafc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeafc('0x5'));var rimraf=require(_0xeafc('0x6'));var config=require('../../config/environment');var attributes=require(_0xeafc('0x7'));module['exports']=function(_0x17530d,_0x555235){return _0x17530d[_0xeafc('0x8')](_0xeafc('0x9'),attributes,{'tableName':_0xeafc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xeafc('0xb'),'collate':_0xeafc('0xc')});};
\ No newline at end of file
+var _0x5752=['exports','chat_internal_messages','utf8mb4','lodash','../../config/logger','moment','bluebird','path','../../config/environment','./chatInternalMessage.attributes'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5752,0x1cf));var _0x2575=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x5752[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x2575('0x0'));var util=require('util');var logger=require(_0x2575('0x1'))('api');var moment=require(_0x2575('0x2'));var BPromise=require(_0x2575('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2575('0x4'));var rimraf=require('rimraf');var config=require(_0x2575('0x5'));var attributes=require(_0x2575('0x6'));module[_0x2575('0x7')]=function(_0x4d5738,_0x5b1f39){return _0x4d5738['define']('ChatInternalMessage',attributes,{'tableName':_0x2575('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2575('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 388eee2..e8a5248 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 _0x1f10=['error','code','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x1f10,0x69));var _0x01f1=function(_0x3b590a,_0x340cf5){_0x3b590a=_0x3b590a-0x0;var _0x525e70=_0x1f10[_0x3b590a];return _0x525e70;};'use strict';var _=require(_0x01f1('0x0'));var util=require(_0x01f1('0x1'));var moment=require('moment');var BPromise=require(_0x01f1('0x2'));var rs=require(_0x01f1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x01f1('0x4'));var logger=require('../../config/logger')(_0x01f1('0x5'));var config=require(_0x01f1('0x6'));var jayson=require(_0x01f1('0x7'));var client=jayson['client'][_0x01f1('0x8')]({'port':0x232a});config[_0x01f1('0x9')]=_[_0x01f1('0xa')](config[_0x01f1('0x9')],{'host':_0x01f1('0xb'),'port':0x18eb});var socket=require(_0x01f1('0xc'))(new Redis(config[_0x01f1('0x9')]));require(_0x01f1('0xd'))['register'](socket);function respondWithRpcPromise(_0x120bd1,_0x413939,_0x46dd46){return new BPromise(function(_0x38c644,_0x4fee68){return client['request'](_0x120bd1,_0x46dd46)[_0x01f1('0xe')](function(_0x2df4f5){logger[_0x01f1('0xf')](_0x01f1('0x10'),_0x413939,_0x01f1('0x11'));logger[_0x01f1('0x12')](_0x01f1('0x13'),_0x413939,_0x01f1('0x11'),JSON['stringify'](_0x2df4f5));if(_0x2df4f5[_0x01f1('0x14')]){if(_0x2df4f5[_0x01f1('0x14')][_0x01f1('0x15')]===0x1f4){logger[_0x01f1('0x14')](_0x01f1('0x10'),_0x413939,_0x2df4f5['error'][_0x01f1('0x16')]);return _0x4fee68(_0x2df4f5['error'][_0x01f1('0x16')]);}logger[_0x01f1('0x14')](_0x01f1('0x10'),_0x413939,_0x2df4f5[_0x01f1('0x14')][_0x01f1('0x16')]);return _0x38c644(_0x2df4f5[_0x01f1('0x14')][_0x01f1('0x16')]);}else{logger[_0x01f1('0xf')](_0x01f1('0x10'),_0x413939,_0x01f1('0x11'));_0x38c644(_0x2df4f5[_0x01f1('0x17')][_0x01f1('0x16')]);}})[_0x01f1('0x18')](function(_0xb4d953){logger['error'](_0x01f1('0x10'),_0x413939,_0xb4d953);_0x4fee68(_0xb4d953);});});}
\ No newline at end of file
+var _0xc61e=['ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info'];(function(_0x3584a6,_0x1ee812){var _0x2b6c76=function(_0x4c2c64){while(--_0x4c2c64){_0x3584a6['push'](_0x3584a6['shift']());}};_0x2b6c76(++_0x1ee812);}(_0xc61e,0x152));var _0xec61=function(_0x23ec60,_0x10b243){_0x23ec60=_0x23ec60-0x0;var _0x1ffa00=_0xc61e[_0x23ec60];return _0x1ffa00;};'use strict';var _=require(_0xec61('0x0'));var util=require(_0xec61('0x1'));var moment=require(_0xec61('0x2'));var BPromise=require(_0xec61('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec61('0x4'));var db=require(_0xec61('0x5'))['db'];var utils=require(_0xec61('0x6'));var logger=require(_0xec61('0x7'))(_0xec61('0x8'));var config=require(_0xec61('0x9'));var jayson=require(_0xec61('0xa'));var client=jayson[_0xec61('0xb')][_0xec61('0xc')]({'port':0x232a});config[_0xec61('0xd')]=_[_0xec61('0xe')](config[_0xec61('0xd')],{'host':_0xec61('0xf'),'port':0x18eb});var socket=require(_0xec61('0x10'))(new Redis(config[_0xec61('0xd')]));require(_0xec61('0x11'))[_0xec61('0x12')](socket);function respondWithRpcPromise(_0x14ad4f,_0x1b0bd9,_0x4d60a9){return new BPromise(function(_0x3926fb,_0x40013f){return client[_0xec61('0x13')](_0x14ad4f,_0x4d60a9)[_0xec61('0x14')](function(_0x54ac6b){logger[_0xec61('0x15')](_0xec61('0x16'),_0x1b0bd9,_0xec61('0x17'));logger[_0xec61('0x18')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x1b0bd9,_0xec61('0x17'),JSON[_0xec61('0x19')](_0x54ac6b));if(_0x54ac6b[_0xec61('0x1a')]){if(_0x54ac6b['error'][_0xec61('0x1b')]===0x1f4){logger[_0xec61('0x1a')](_0xec61('0x16'),_0x1b0bd9,_0x54ac6b['error'][_0xec61('0x1c')]);return _0x40013f(_0x54ac6b['error']['message']);}logger[_0xec61('0x1a')](_0xec61('0x16'),_0x1b0bd9,_0x54ac6b['error'][_0xec61('0x1c')]);return _0x3926fb(_0x54ac6b[_0xec61('0x1a')][_0xec61('0x1c')]);}else{logger[_0xec61('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x1b0bd9,_0xec61('0x17'));_0x3926fb(_0x54ac6b[_0xec61('0x1d')][_0xec61('0x1c')]);}})['catch'](function(_0x56ab00){logger[_0xec61('0x1a')](_0xec61('0x16'),_0x1b0bd9,_0x56ab00);_0x40013f(_0x56ab00);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 0a43b99..ef5fe0a 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 _0x6e85=['./chatInternalMessage.events','removeListener','register','length'];(function(_0x4bc997,_0x4e68cf){var _0x452dbf=function(_0x4b3fa0){while(--_0x4b3fa0){_0x4bc997['push'](_0x4bc997['shift']());}};_0x452dbf(++_0x4e68cf);}(_0x6e85,0xd8));var _0x56e8=function(_0x1cf919,_0x4ed777){_0x1cf919=_0x1cf919-0x0;var _0x276cf4=_0x6e85[_0x1cf919];return _0x276cf4;};'use strict';var ChatInternalMessageEvents=require(_0x56e8('0x0'));var events=['save','remove','update'];function createListener(_0x589555,_0x148bb9){return function(_0x40936c){_0x148bb9['emit'](_0x589555,_0x40936c);};}function removeListener(_0x59ad6e,_0xe98553){return function(){ChatInternalMessageEvents[_0x56e8('0x1')](_0x59ad6e,_0xe98553);};}exports[_0x56e8('0x2')]=function(_0x672050){for(var _0x2f8fc6=0x0,_0x5ad072=events[_0x56e8('0x3')];_0x2f8fc6<_0x5ad072;_0x2f8fc6++){var _0xb9d7f0=events[_0x2f8fc6];var _0x5404be=createListener('chatInternalMessage:'+_0xb9d7f0,_0x672050);ChatInternalMessageEvents['on'](_0xb9d7f0,_0x5404be);}};
\ No newline at end of file
+var _0x1607=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','remove','update'];(function(_0x28eb88,_0x659a98){var _0x5e00bd=function(_0x2a0b9f){while(--_0x2a0b9f){_0x28eb88['push'](_0x28eb88['shift']());}};_0x5e00bd(++_0x659a98);}(_0x1607,0x1d5));var _0x7160=function(_0x4d8a45,_0xf33997){_0x4d8a45=_0x4d8a45-0x0;var _0x9e1583=_0x1607[_0x4d8a45];return _0x9e1583;};'use strict';var ChatInternalMessageEvents=require(_0x7160('0x0'));var events=['save',_0x7160('0x1'),_0x7160('0x2')];function createListener(_0x4fbee3,_0xd33417){return function(_0x462417){_0xd33417[_0x7160('0x3')](_0x4fbee3,_0x462417);};}function removeListener(_0x33ef50,_0x566408){return function(){ChatInternalMessageEvents[_0x7160('0x4')](_0x33ef50,_0x566408);};}exports[_0x7160('0x5')]=function(_0x42ee4f){for(var _0x760fe4=0x0,_0x568726=events[_0x7160('0x6')];_0x760fe4<_0x568726;_0x760fe4++){var _0x4dfdfd=events[_0x760fe4];var _0xb57ef8=createListener(_0x7160('0x7')+_0x4dfdfd,_0x42ee4f);ChatInternalMessageEvents['on'](_0x4dfdfd,_0xb57ef8);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index e20e49a..370fc7c 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 _0x6464=['update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','index','get','/describe','isAuthenticated','describe','/users','/:id','post','create','put'];(function(_0xbc6ee1,_0x1f5b0f){var _0x1aa916=function(_0x139248){while(--_0x139248){_0xbc6ee1['push'](_0xbc6ee1['shift']());}};_0x1aa916(++_0x1f5b0f);}(_0x6464,0x137));var _0x4646=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6464[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0x4646('0x0'));var path=require(_0x4646('0x1'));var timeout=require(_0x4646('0x2'));var express=require(_0x4646('0x3'));var router=express[_0x4646('0x4')]();var fs_extra=require(_0x4646('0x5'));var auth=require(_0x4646('0x6'));var interaction=require(_0x4646('0x7'));var config=require('../../config/environment');var controller=require(_0x4646('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x4646('0x9')]);router[_0x4646('0xa')](_0x4646('0xb'),auth[_0x4646('0xc')](),controller[_0x4646('0xd')]);router[_0x4646('0xa')](_0x4646('0xe'),auth[_0x4646('0xc')](),controller['getUsers']);router['get'](_0x4646('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x4646('0x10')]('/',auth[_0x4646('0xc')](),controller[_0x4646('0x11')]);router[_0x4646('0x12')](_0x4646('0xf'),controller[_0x4646('0x13')]);router['delete']('/:id',auth[_0x4646('0xc')](),controller[_0x4646('0x14')]);module[_0x4646('0x15')]=router;
\ No newline at end of file
+var _0x4d85=['/describe','describe','/users','getUsers','/:id','create','put','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index'];(function(_0x534c0f,_0x60b439){var _0x159559=function(_0x19ee5b){while(--_0x19ee5b){_0x534c0f['push'](_0x534c0f['shift']());}};_0x159559(++_0x60b439);}(_0x4d85,0xb2));var _0x54d8=function(_0x2a5476,_0xd8ec70){_0x2a5476=_0x2a5476-0x0;var _0x279820=_0x4d85[_0x2a5476];return _0x279820;};'use strict';var multer=require(_0x54d8('0x0'));var util=require(_0x54d8('0x1'));var path=require(_0x54d8('0x2'));var timeout=require('connect-timeout');var express=require(_0x54d8('0x3'));var router=express['Router']();var fs_extra=require(_0x54d8('0x4'));var auth=require(_0x54d8('0x5'));var interaction=require(_0x54d8('0x6'));var config=require('../../config/environment');var controller=require(_0x54d8('0x7'));router[_0x54d8('0x8')]('/',auth[_0x54d8('0x9')](),controller[_0x54d8('0xa')]);router[_0x54d8('0x8')](_0x54d8('0xb'),auth[_0x54d8('0x9')](),controller[_0x54d8('0xc')]);router['get'](_0x54d8('0xd'),auth['isAuthenticated'](),controller[_0x54d8('0xe')]);router[_0x54d8('0x8')](_0x54d8('0xf'),auth[_0x54d8('0x9')](),controller['show']);router['post']('/',auth[_0x54d8('0x9')](),controller[_0x54d8('0x10')]);router[_0x54d8('0x11')](_0x54d8('0xf'),controller['update']);router[_0x54d8('0x12')]('/:id',auth[_0x54d8('0x9')](),controller[_0x54d8('0x13')]);module[_0x54d8('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index e03e471..1108b5c 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 _0x8f59=['medium','BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT'];(function(_0x1fea37,_0x5bbd0e){var _0x3776ca=function(_0x43ccf3){while(--_0x43ccf3){_0x1fea37['push'](_0x1fea37['shift']());}};_0x3776ca(++_0x5bbd0e);}(_0x8f59,0x11d));var _0x98f5=function(_0x560fc6,_0x59bd68){_0x560fc6=_0x560fc6-0x0;var _0x14d08a=_0x8f59[_0x560fc6];return _0x14d08a;};'use strict';var Sequelize=require(_0x98f5('0x0'));module[_0x98f5('0x1')]={'body':{'type':Sequelize[_0x98f5('0x2')](_0x98f5('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x98f5('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x98f5('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x98f5('0x5')),'defaultValue':_0x98f5('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x98f5('0x6')]},'providerName':{'type':Sequelize[_0x98f5('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x97e6=['out','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x1c2386,_0x22eb79){var _0x322990=function(_0x27eed4){while(--_0x27eed4){_0x1c2386['push'](_0x1c2386['shift']());}};_0x322990(++_0x22eb79);}(_0x97e6,0x159));var _0x697e=function(_0x196e16,_0x168729){_0x196e16=_0x196e16-0x0;var _0x37531f=_0x97e6[_0x196e16];return _0x37531f;};'use strict';var Sequelize=require(_0x697e('0x0'));module['exports']={'body':{'type':Sequelize[_0x697e('0x1')](_0x697e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x697e('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x697e('0x4')]('in',_0x697e('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x697e('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x697e('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index d073cb8..732a4d9 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 _0x9b40=['count','set','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','ChatMessage','type','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','rejectMessage','Sequelize','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','offset','undefined'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9b40,0x15e));var _0x09b4=function(_0x17b5ff,_0x3fe9e7){_0x17b5ff=_0x17b5ff-0x0;var _0x123993=_0x9b40[_0x17b5ff];return _0x123993;};'use strict';var emlformat=require(_0x09b4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x09b4('0x1'));var jsonpatch=require(_0x09b4('0x2'));var rp=require(_0x09b4('0x3'));var moment=require(_0x09b4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x09b4('0x5'));var csv=require(_0x09b4('0x6'));var ejs=require(_0x09b4('0x7'));var fs=require('fs');var fs_extra=require(_0x09b4('0x8'));var _=require(_0x09b4('0x9'));var squel=require(_0x09b4('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x09b4('0xb'));var toCsv=require(_0x09b4('0x6'));var querystring=require(_0x09b4('0xc'));var Papa=require(_0x09b4('0xd'));var Redis=require(_0x09b4('0xe'));var authService=require(_0x09b4('0xf'));var qs=require(_0x09b4('0x10'));var as=require(_0x09b4('0x11'));var hardwareService=require(_0x09b4('0x12'));var logger=require(_0x09b4('0x13'))(_0x09b4('0x14'));var utils=require(_0x09b4('0x15'));var config=require(_0x09b4('0x16'));var licenseUtil=require(_0x09b4('0x17'));var db=require('../../mysqldb')['db'];config[_0x09b4('0x18')]=_[_0x09b4('0x19')](config['redis'],{'host':_0x09b4('0x1a'),'port':0x18eb});var socket=require(_0x09b4('0x1b'))(new Redis(config[_0x09b4('0x18')]));require(_0x09b4('0x1c'))[_0x09b4('0x1d')](socket);var jayson=require(_0x09b4('0x1e'));var client=jayson[_0x09b4('0x1f')][_0x09b4('0x20')]({'port':0x232c});var client9002=jayson[_0x09b4('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x437fad,_0x345636,_0x3c3c85,_0x3eda14){return new BPromise(function(_0x25149d,_0x3196a8){var _0x448d98=_0x3eda14||client;return _0x448d98[_0x09b4('0x21')](_0x437fad,_0x3c3c85)['then'](function(_0x20fb06){logger[_0x09b4('0x22')]('ChatMessage,\x20%s,\x20%s',_0x345636,'request\x20sent');logger['debug'](_0x09b4('0x23'),_0x345636,_0x09b4('0x24'),JSON[_0x09b4('0x25')](_0x20fb06));if(_0x20fb06[_0x09b4('0x26')]){if(_0x20fb06[_0x09b4('0x26')][_0x09b4('0x27')]===0x1f4){logger['error'](_0x09b4('0x28'),_0x345636,_0x20fb06[_0x09b4('0x26')]['message']);return _0x3196a8(_0x20fb06[_0x09b4('0x26')]['message']);}logger['error'](_0x09b4('0x28'),_0x345636,_0x20fb06[_0x09b4('0x26')]['message']);return _0x25149d(_0x20fb06[_0x09b4('0x26')][_0x09b4('0x29')]);}else{logger[_0x09b4('0x22')](_0x09b4('0x28'),_0x345636,'request\x20sent');_0x25149d(_0x20fb06[_0x09b4('0x2a')]['message']);}})[_0x09b4('0x2b')](function(_0x14ffb7){logger[_0x09b4('0x26')](_0x09b4('0x28'),_0x345636,_0x14ffb7);_0x3196a8(_0x14ffb7);});});}function respondWithStatusCode(_0x5c7292,_0x297b11){_0x297b11=_0x297b11||0xcc;return function(_0x46b780){if(_0x46b780){return _0x5c7292[_0x09b4('0x2c')](_0x297b11);}return _0x5c7292['status'](_0x297b11)[_0x09b4('0x2d')]();};}function respondWithResult(_0x2bb6ff,_0x83f756){_0x83f756=_0x83f756||0xc8;return function(_0x2a618c){if(_0x2a618c){return _0x2bb6ff[_0x09b4('0x2e')](_0x83f756)['json'](_0x2a618c);}};}function respondWithFilteredResult(_0x52e18a,_0x153a0f){return function(_0x3c2690){if(_0x3c2690){var _0x47d45b=typeof _0x153a0f[_0x09b4('0x2f')]===_0x09b4('0x30')&&typeof _0x153a0f['limit']===_0x09b4('0x30');var _0x129cc8=_0x3c2690[_0x09b4('0x31')];var _0x4e1ef3=_0x47d45b?0x0:_0x153a0f[_0x09b4('0x2f')];var _0x2cade4=_0x47d45b?_0x3c2690[_0x09b4('0x31')]:_0x153a0f['offset']+_0x153a0f['limit'];var _0x574e19;if(_0x2cade4>=_0x129cc8){_0x2cade4=_0x129cc8;_0x574e19=0xc8;}else{_0x574e19=0xce;}_0x52e18a[_0x09b4('0x2e')](_0x574e19);return _0x52e18a[_0x09b4('0x32')]('Content-Range',_0x4e1ef3+'-'+_0x2cade4+'/'+_0x129cc8)[_0x09b4('0x33')](_0x3c2690);}return null;};}function patchUpdates(_0x38b0b9){return function(_0x88edfd){try{jsonpatch[_0x09b4('0x34')](_0x88edfd,_0x38b0b9,!![]);}catch(_0x741e0e){return BPromise[_0x09b4('0x35')](_0x741e0e);}return _0x88edfd[_0x09b4('0x36')]();};}function saveUpdates(_0x5f11dc,_0x5914e9){return function(_0x93c7f3){if(_0x93c7f3){return _0x93c7f3[_0x09b4('0x37')](_0x5f11dc)[_0x09b4('0x38')](function(_0x51ec84){return _0x51ec84;});}return null;};}function removeEntity(_0x37b9d5,_0x3a5cff){return function(_0x1ec9af){if(_0x1ec9af){return _0x1ec9af[_0x09b4('0x39')]()[_0x09b4('0x38')](function(){_0x37b9d5['status'](0xcc)[_0x09b4('0x2d')]();});}};}function handleEntityNotFound(_0x348c81,_0x3f9da5){return function(_0x571a9f){if(!_0x571a9f){_0x348c81[_0x09b4('0x2c')](0x194);}return _0x571a9f;};}function handleError(_0x5dcc81,_0x2207de){_0x2207de=_0x2207de||0x1f4;return function(_0x4f2a47){logger[_0x09b4('0x26')](_0x4f2a47[_0x09b4('0x3a')]);if(_0x4f2a47[_0x09b4('0x3b')]){delete _0x4f2a47[_0x09b4('0x3b')];}_0x5dcc81[_0x09b4('0x2e')](_0x2207de)[_0x09b4('0x3c')](_0x4f2a47);};}exports[_0x09b4('0x3d')]=function(_0x3a6df0,_0x4b7616){var _0x2488ac={},_0x3428ff={},_0x396d89={'count':0x0,'rows':[]};var _0x36a6de=_[_0x09b4('0x3e')](db[_0x09b4('0x3f')]['rawAttributes'],function(_0x5dca4b){return{'name':_0x5dca4b['fieldName'],'type':_0x5dca4b[_0x09b4('0x40')][_0x09b4('0x41')]};});_0x3428ff['model']=_[_0x09b4('0x3e')](_0x36a6de,'name');_0x3428ff[_0x09b4('0x42')]=_[_0x09b4('0x43')](_0x3a6df0['query']);_0x3428ff[_0x09b4('0x44')]=_['intersection'](_0x3428ff[_0x09b4('0x45')],_0x3428ff[_0x09b4('0x42')]);_0x2488ac[_0x09b4('0x46')]=_[_0x09b4('0x47')](_0x3428ff[_0x09b4('0x45')],qs[_0x09b4('0x48')](_0x3a6df0[_0x09b4('0x42')]['fields']));_0x2488ac[_0x09b4('0x46')]=_0x2488ac[_0x09b4('0x46')][_0x09b4('0x49')]?_0x2488ac['attributes']:_0x3428ff['model'];if(!_0x3a6df0[_0x09b4('0x42')]['hasOwnProperty'](_0x09b4('0x4a'))){_0x2488ac[_0x09b4('0x4b')]=qs[_0x09b4('0x4b')](_0x3a6df0[_0x09b4('0x42')][_0x09b4('0x4b')]);_0x2488ac['offset']=qs['offset'](_0x3a6df0[_0x09b4('0x42')][_0x09b4('0x2f')]);}_0x2488ac[_0x09b4('0x4c')]=qs[_0x09b4('0x4d')](_0x3a6df0[_0x09b4('0x42')]['sort']);_0x2488ac[_0x09b4('0x4e')]=qs['filters'](_[_0x09b4('0x4f')](_0x3a6df0[_0x09b4('0x42')],_0x3428ff['filters']),_0x36a6de);if(_0x3a6df0['query'][_0x09b4('0x50')]){_0x2488ac['where']=_[_0x09b4('0x51')](_0x2488ac[_0x09b4('0x4e')],{'$or':_[_0x09b4('0x3e')](_0x36a6de,function(_0x1a2df7){if(_0x1a2df7['type']!=='VIRTUAL'){var _0x2fd7b2={};_0x2fd7b2[_0x1a2df7['name']]={'$like':'%'+_0x3a6df0[_0x09b4('0x42')][_0x09b4('0x50')]+'%'};return _0x2fd7b2;}})});}_0x2488ac=_[_0x09b4('0x51')]({},_0x2488ac,_0x3a6df0['options']);var _0x13c116={'where':_0x2488ac[_0x09b4('0x4e')]};return db['ChatMessage'][_0x09b4('0x31')](_0x13c116)[_0x09b4('0x38')](function(_0x2ee4dc){_0x396d89[_0x09b4('0x31')]=_0x2ee4dc;if(_0x3a6df0['query'][_0x09b4('0x52')]){_0x2488ac[_0x09b4('0x53')]=[{'all':!![]}];}return db[_0x09b4('0x3f')][_0x09b4('0x54')](_0x2488ac);})[_0x09b4('0x38')](function(_0x32d645){_0x396d89[_0x09b4('0x55')]=_0x32d645;return _0x396d89;})[_0x09b4('0x38')](respondWithFilteredResult(_0x4b7616,_0x2488ac))['catch'](handleError(_0x4b7616,null));};exports[_0x09b4('0x56')]=function(_0x447258,_0x570c50){var _0x5debdd={'raw':!![],'where':{'id':_0x447258[_0x09b4('0x57')]['id']}},_0x409531={};_0x409531[_0x09b4('0x45')]=_['keys'](db[_0x09b4('0x3f')][_0x09b4('0x58')]);_0x409531[_0x09b4('0x42')]=_['keys'](_0x447258[_0x09b4('0x42')]);_0x409531[_0x09b4('0x44')]=_[_0x09b4('0x47')](_0x409531[_0x09b4('0x45')],_0x409531[_0x09b4('0x42')]);_0x5debdd['attributes']=_[_0x09b4('0x47')](_0x409531[_0x09b4('0x45')],qs[_0x09b4('0x48')](_0x447258[_0x09b4('0x42')][_0x09b4('0x48')]));_0x5debdd[_0x09b4('0x46')]=_0x5debdd[_0x09b4('0x46')][_0x09b4('0x49')]?_0x5debdd[_0x09b4('0x46')]:_0x409531[_0x09b4('0x45')];if(_0x447258[_0x09b4('0x42')][_0x09b4('0x52')]){_0x5debdd['include']=[{'all':!![]}];}_0x5debdd=_[_0x09b4('0x51')]({},_0x5debdd,_0x447258[_0x09b4('0x59')]);return db[_0x09b4('0x3f')][_0x09b4('0x5a')](_0x5debdd)[_0x09b4('0x38')](handleEntityNotFound(_0x570c50,null))[_0x09b4('0x38')](respondWithResult(_0x570c50,null))[_0x09b4('0x2b')](handleError(_0x570c50,null));};exports[_0x09b4('0x5b')]=function(_0xcd3f24,_0x12ecf4){return db['ChatMessage'][_0x09b4('0x5b')](_0xcd3f24['body'],{})['then'](respondWithResult(_0x12ecf4,0xc9))[_0x09b4('0x2b')](handleError(_0x12ecf4,null));};exports[_0x09b4('0x37')]=function(_0x11b824,_0x2bb281){if(_0x11b824[_0x09b4('0x5c')]['id']){delete _0x11b824[_0x09b4('0x5c')]['id'];}return db[_0x09b4('0x3f')]['find']({'where':{'id':_0x11b824[_0x09b4('0x57')]['id']}})[_0x09b4('0x38')](handleEntityNotFound(_0x2bb281,null))[_0x09b4('0x38')](saveUpdates(_0x11b824[_0x09b4('0x5c')],null))['then'](respondWithResult(_0x2bb281,null))[_0x09b4('0x2b')](handleError(_0x2bb281,null));};exports['destroy']=function(_0x1d91f2,_0x2ee965){return db['ChatMessage'][_0x09b4('0x5a')]({'where':{'id':_0x1d91f2['params']['id']}})[_0x09b4('0x38')](handleEntityNotFound(_0x2ee965,null))[_0x09b4('0x38')](removeEntity(_0x2ee965,null))['catch'](handleError(_0x2ee965,null));};exports[_0x09b4('0x5d')]=function(_0xbed24c,_0x15605a){return db[_0x09b4('0x3f')][_0x09b4('0x5d')]()['then'](respondWithResult(_0x15605a,null))[_0x09b4('0x2b')](handleError(_0x15605a,null));};var interaction_log=require('../../config/logger')(_0x09b4('0x5e'));exports[_0x09b4('0x5f')]=function(_0x4221c9,_0x55adb3,_0x50da79){var _0x578e21={'agent':{},'channel':_0x09b4('0x60')};if(_0x4221c9['body']['id']){delete _0x4221c9[_0x09b4('0x5c')]['id'];}_0x4221c9['body'][_0x09b4('0x61')]=!![];_0x4221c9[_0x09b4('0x5c')][_0x09b4('0x62')]=moment()[_0x09b4('0x63')](_0x09b4('0x64'));_0x4221c9[_0x09b4('0x5c')][_0x09b4('0x65')]=_0x4221c9[_0x09b4('0x5c')]['UserId']||_0x4221c9['user']['id'];_0x578e21[_0x09b4('0x66')]['id']=_0x4221c9[_0x09b4('0x5c')][_0x09b4('0x65')];return db[_0x09b4('0x3f')]['find']({'where':{'id':_0x4221c9['params']['id'],'UserId':null}})[_0x09b4('0x38')](handleEntityNotFound(_0x55adb3,null))[_0x09b4('0x38')](saveUpdates(_0x4221c9[_0x09b4('0x5c')],null))[_0x09b4('0x38')](function(_0x483a79){if(_0x483a79){_0x578e21[_0x09b4('0x29')]=_0x483a79[_0x09b4('0x67')]({'plain':!![]});return db[_0x09b4('0x68')][_0x09b4('0x5a')]({'where':{'id':_0x483a79[_0x09b4('0x69')]}});}return null;})[_0x09b4('0x38')](handleEntityNotFound(_0x55adb3,null))[_0x09b4('0x38')](function(_0x5038ef){if(_0x5038ef){return _0x5038ef[_0x09b4('0x37')]({'UserId':_0x4221c9[_0x09b4('0x5c')][_0x09b4('0x65')],'read1stAt':_[_0x09b4('0x6a')](_0x5038ef[_0x09b4('0x6b')])?moment()[_0x09b4('0x63')](_0x09b4('0x64')):undefined});}return null;})[_0x09b4('0x38')](function(_0x5d71d5){if(_0x5d71d5){_0x578e21['interaction']=_0x5d71d5[_0x09b4('0x67')]({'plain':!![]});interaction_log['info'](_0x09b4('0x6c'),_0x4221c9[_0x09b4('0x6d')]['id'],_0x4221c9[_0x09b4('0x6d')][_0x09b4('0x3b')],_0x4221c9[_0x09b4('0x6d')]['role'],_0x578e21[_0x09b4('0x6e')]['id'],_0x4221c9[_0x09b4('0x5c')]?JSON[_0x09b4('0x25')](_0x4221c9[_0x09b4('0x5c')]):_0x09b4('0x6f'));return respondWithRpcPromise('AcceptMessage',_0x09b4('0x70'),_0x578e21);}return null;})[_0x09b4('0x38')](function(_0x281583){var _0xbfb0e6=_0x09b4('0x71')+_0x281583[_0x09b4('0x29')][_0x09b4('0x72')];return db['sequelize'][_0x09b4('0x42')](_0xbfb0e6,{'type':db['Sequelize'][_0x09b4('0x73')][_0x09b4('0x74')],'raw':!![]})[_0x09b4('0x38')](function(_0x156b2a){return _0x156b2a;});})[_0x09b4('0x38')](function(_0x219674){if(_0x219674){_0x578e21[_0x09b4('0x29')][_0x09b4('0x75')]=_0x219674[0x0];if(!_0x4221c9['body'][_0x09b4('0x65')])return;return db['User'][_0x09b4('0x5a')]({'where':{'id':_0x4221c9['body'][_0x09b4('0x65')],'role':_0x09b4('0x66')},'attributes':['id',_0x09b4('0x3b'),_0x09b4('0x76'),_0x09b4('0x77'),'internal'],'raw':!![]});}return null;})[_0x09b4('0x38')](function(_0xc31579){if(!_0xc31579)return null;_0x578e21[_0x09b4('0x29')][_0x09b4('0x66')]=_0xc31579;return _0x578e21;})[_0x09b4('0x38')](function(_0x2a73df){if(_0x2a73df){if(_0x4221c9['body'][_0x09b4('0x78')]){_0x578e21[_0x09b4('0x29')][_0x09b4('0x79')]=util[_0x09b4('0x63')](_0x09b4('0x7a'),_0x4221c9[_0x09b4('0x6d')][_0x09b4('0x3b')]);_0x578e21[_0x09b4('0x29')][_0x09b4('0x7b')]=_0x578e21['channel'];_0x578e21[_0x09b4('0x29')][_0x09b4('0x7c')]=_0x578e21[_0x09b4('0x7b')];_0x578e21[_0x09b4('0x29')][_0x09b4('0x7d')]=_0x09b4('0x5f');return respondWithRpcPromise(_0x09b4('0x7e'),'EventManager',{'event':_0x09b4('0x7f'),'message':_[_0x09b4('0x51')](_0x578e21[_0x09b4('0x29')],JSON[_0x09b4('0x80')](_0x578e21[_0x09b4('0x6e')][_0x09b4('0x81')]))},client9002)['then'](function(){return _0x578e21;});}return _0x578e21;}return null;})[_0x09b4('0x38')](respondWithResult(_0x55adb3,null))[_0x09b4('0x2b')](handleError(_0x55adb3,null));};var interaction_log=require(_0x09b4('0x13'))(_0x09b4('0x5e'));exports[_0x09b4('0x35')]=function(_0x22b247,_0x29a4bb,_0x2a5418){var _0x4eadef={'agent':{},'channel':_0x09b4('0x60')};if(_0x22b247[_0x09b4('0x5c')]['id']){delete _0x22b247[_0x09b4('0x5c')]['id'];}_0x22b247[_0x09b4('0x5c')][_0x09b4('0x65')]=_0x22b247[_0x09b4('0x5c')][_0x09b4('0x65')]||_0x22b247['user']['id'];_0x4eadef[_0x09b4('0x66')]['id']=_0x22b247[_0x09b4('0x5c')]['UserId'];return db[_0x09b4('0x3f')][_0x09b4('0x5a')]({'where':{'id':_0x22b247[_0x09b4('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x29a4bb,null))[_0x09b4('0x38')](function(_0x1c5b47){if(_0x1c5b47){_0x4eadef['message']=_0x1c5b47[_0x09b4('0x67')]({'plain':!![]});return db[_0x09b4('0x68')][_0x09b4('0x5a')]({'where':{'id':_0x1c5b47[_0x09b4('0x69')]}});}return null;})[_0x09b4('0x38')](handleEntityNotFound(_0x29a4bb,null))[_0x09b4('0x38')](function(_0x32f9c7){if(_0x32f9c7){_0x4eadef[_0x09b4('0x6e')]=_0x32f9c7[_0x09b4('0x67')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x22b247['user']['id'],_0x22b247[_0x09b4('0x6d')][_0x09b4('0x3b')],_0x22b247['user']['role'],_0x4eadef[_0x09b4('0x6e')]['id'],_0x22b247[_0x09b4('0x5c')]?JSON['stringify'](_0x22b247[_0x09b4('0x5c')]):_0x09b4('0x6f'));return respondWithRpcPromise('RejectMessage',_0x09b4('0x82'),_0x4eadef);}return null;})[_0x09b4('0x38')](function(_0x511c50){var _0x1c7051=_0x09b4('0x71')+_0x511c50['message'][_0x09b4('0x72')];return db['sequelize'][_0x09b4('0x42')](_0x1c7051,{'type':db[_0x09b4('0x83')]['QueryTypes']['SELECT'],'raw':!![]})[_0x09b4('0x38')](function(_0x29aedd){return _0x29aedd;});})[_0x09b4('0x38')](function(_0xed989e){if(_0xed989e){_0x4eadef[_0x09b4('0x29')][_0x09b4('0x75')]=_0xed989e[0x0];if(!_0x22b247[_0x09b4('0x5c')]['UserId'])return;return db['User'][_0x09b4('0x5a')]({'where':{'id':_0x22b247[_0x09b4('0x5c')][_0x09b4('0x65')],'role':_0x09b4('0x66')},'attributes':['id',_0x09b4('0x3b'),'fullname','email','internal'],'raw':!![]});}return null;})['then'](function(_0x5d67a2){if(!_0x5d67a2)return null;_0x4eadef[_0x09b4('0x29')][_0x09b4('0x66')]=_0x5d67a2;return _0x4eadef;})[_0x09b4('0x38')](function(_0xec67b4){if(_0xec67b4){_0xec67b4[_0x09b4('0x29')]['interface']=util[_0x09b4('0x63')](_0x09b4('0x7a'),_0x22b247['user'][_0x09b4('0x3b')]);_0xec67b4[_0x09b4('0x29')][_0x09b4('0x7b')]=_0x4eadef[_0x09b4('0x7b')];_0xec67b4[_0x09b4('0x29')][_0x09b4('0x7c')]=_0x4eadef['channel'];_0xec67b4[_0x09b4('0x29')][_0x09b4('0x7d')]=_0x09b4('0x35');respondWithRpcPromise('EventManager','EventManager',{'event':_0x09b4('0x84'),'message':_[_0x09b4('0x51')](_0x4eadef['message'],JSON[_0x09b4('0x80')](_0x4eadef[_0x09b4('0x6e')][_0x09b4('0x81')]))},client9002);return _0x4eadef;}return null;})[_0x09b4('0x38')](respondWithResult(_0x29a4bb,null))['catch'](handleError(_0x29a4bb,null));};
\ No newline at end of file
+var _0xf77e=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','register','jayson/promise','http','client','request','then','info','debug','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','catch','end','undefined','limit','count','offset','status','set','Content-Range','json','apply','save','update','destroy','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','filter','where','VIRTUAL','options','ChatMessage','include','params','fields','length','includeAll','merge','find','create','body','describe','chat-interactions','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','interaction','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','User','fullname','email','internal','manual','interface','channel','motionChannel','EventManager','acceptmessage','parse','formData','../../config/logger','ChatInteraction','RejectMessage','rejectMessage','QueryTypes','contact','rejectmessage','eml-format','fast-json-patch','moment','bluebird'];(function(_0x2cc57f,_0x31ded7){var _0x3cfb7a=function(_0x11b6f3){while(--_0x11b6f3){_0x2cc57f['push'](_0x2cc57f['shift']());}};_0x3cfb7a(++_0x31ded7);}(_0xf77e,0x7e));var _0xef77=function(_0x1b67c3,_0x58acbc){_0x1b67c3=_0x1b67c3-0x0;var _0x23e14e=_0xf77e[_0x1b67c3];return _0x23e14e;};'use strict';var emlformat=require(_0xef77('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xef77('0x1'));var rp=require('request-promise');var moment=require(_0xef77('0x2'));var BPromise=require(_0xef77('0x3'));var Mustache=require(_0xef77('0x4'));var util=require(_0xef77('0x5'));var path=require(_0xef77('0x6'));var sox=require(_0xef77('0x7'));var csv=require(_0xef77('0x8'));var ejs=require(_0xef77('0x9'));var fs=require('fs');var fs_extra=require(_0xef77('0xa'));var _=require(_0xef77('0xb'));var squel=require(_0xef77('0xc'));var crypto=require('crypto');var jsforce=require(_0xef77('0xd'));var deskjs=require(_0xef77('0xe'));var toCsv=require('to-csv');var querystring=require(_0xef77('0xf'));var Papa=require(_0xef77('0x10'));var Redis=require(_0xef77('0x11'));var authService=require(_0xef77('0x12'));var qs=require(_0xef77('0x13'));var as=require(_0xef77('0x14'));var hardwareService=require(_0xef77('0x15'));var logger=require('../../config/logger')(_0xef77('0x16'));var utils=require(_0xef77('0x17'));var config=require(_0xef77('0x18'));var licenseUtil=require(_0xef77('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xef77('0x1a')](config['redis'],{'host':_0xef77('0x1b'),'port':0x18eb});var socket=require(_0xef77('0x1c'))(new Redis(config[_0xef77('0x1d')]));require(_0xef77('0x1e'))[_0xef77('0x1f')](socket);var jayson=require(_0xef77('0x20'));var client=jayson['client'][_0xef77('0x21')]({'port':0x232c});var client9002=jayson[_0xef77('0x22')][_0xef77('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x20cb49,_0x51a55c,_0x2e2f8e,_0x43499f){return new BPromise(function(_0x5d9f20,_0x29653d){var _0xb9ae25=_0x43499f||client;return _0xb9ae25[_0xef77('0x23')](_0x20cb49,_0x2e2f8e)[_0xef77('0x24')](function(_0x3b1469){logger[_0xef77('0x25')]('ChatMessage,\x20%s,\x20%s',_0x51a55c,'request\x20sent');logger[_0xef77('0x26')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x51a55c,'request\x20sent',JSON[_0xef77('0x27')](_0x3b1469));if(_0x3b1469[_0xef77('0x28')]){if(_0x3b1469[_0xef77('0x28')][_0xef77('0x29')]===0x1f4){logger[_0xef77('0x28')]('ChatMessage,\x20%s,\x20%s',_0x51a55c,_0x3b1469['error'][_0xef77('0x2a')]);return _0x29653d(_0x3b1469[_0xef77('0x28')][_0xef77('0x2a')]);}logger[_0xef77('0x28')]('ChatMessage,\x20%s,\x20%s',_0x51a55c,_0x3b1469['error'][_0xef77('0x2a')]);return _0x5d9f20(_0x3b1469[_0xef77('0x28')]['message']);}else{logger[_0xef77('0x25')](_0xef77('0x2b'),_0x51a55c,'request\x20sent');_0x5d9f20(_0x3b1469['result'][_0xef77('0x2a')]);}})[_0xef77('0x2c')](function(_0x3da969){logger[_0xef77('0x28')](_0xef77('0x2b'),_0x51a55c,_0x3da969);_0x29653d(_0x3da969);});});}function respondWithStatusCode(_0x180491,_0x363b68){_0x363b68=_0x363b68||0xcc;return function(_0x95ef79){if(_0x95ef79){return _0x180491['sendStatus'](_0x363b68);}return _0x180491['status'](_0x363b68)[_0xef77('0x2d')]();};}function respondWithResult(_0x2cf87a,_0x3737ca){_0x3737ca=_0x3737ca||0xc8;return function(_0x2bd6c6){if(_0x2bd6c6){return _0x2cf87a['status'](_0x3737ca)['json'](_0x2bd6c6);}};}function respondWithFilteredResult(_0x30f8bb,_0x103de8){return function(_0x2120a6){if(_0x2120a6){var _0x5de358=typeof _0x103de8['offset']===_0xef77('0x2e')&&typeof _0x103de8[_0xef77('0x2f')]==='undefined';var _0x1bc8d1=_0x2120a6[_0xef77('0x30')];var _0x50daca=_0x5de358?0x0:_0x103de8[_0xef77('0x31')];var _0x5dceed=_0x5de358?_0x2120a6[_0xef77('0x30')]:_0x103de8[_0xef77('0x31')]+_0x103de8[_0xef77('0x2f')];var _0x2cd1ed;if(_0x5dceed>=_0x1bc8d1){_0x5dceed=_0x1bc8d1;_0x2cd1ed=0xc8;}else{_0x2cd1ed=0xce;}_0x30f8bb[_0xef77('0x32')](_0x2cd1ed);return _0x30f8bb[_0xef77('0x33')](_0xef77('0x34'),_0x50daca+'-'+_0x5dceed+'/'+_0x1bc8d1)[_0xef77('0x35')](_0x2120a6);}return null;};}function patchUpdates(_0x4cb289){return function(_0x7b7efe){try{jsonpatch[_0xef77('0x36')](_0x7b7efe,_0x4cb289,!![]);}catch(_0x3030eb){return BPromise['reject'](_0x3030eb);}return _0x7b7efe[_0xef77('0x37')]();};}function saveUpdates(_0x5da4ea,_0x4300ba){return function(_0x429ebf){if(_0x429ebf){return _0x429ebf[_0xef77('0x38')](_0x5da4ea)[_0xef77('0x24')](function(_0x3ed317){return _0x3ed317;});}return null;};}function removeEntity(_0x5a1bc1,_0x5e6346){return function(_0x433da9){if(_0x433da9){return _0x433da9[_0xef77('0x39')]()[_0xef77('0x24')](function(){_0x5a1bc1[_0xef77('0x32')](0xcc)[_0xef77('0x2d')]();});}};}function handleEntityNotFound(_0xde970d,_0x2a43a6){return function(_0x47ecfa){if(!_0x47ecfa){_0xde970d[_0xef77('0x3a')](0x194);}return _0x47ecfa;};}function handleError(_0x46ae5e,_0x330bbd){_0x330bbd=_0x330bbd||0x1f4;return function(_0x24551e){logger['error'](_0x24551e[_0xef77('0x3b')]);if(_0x24551e[_0xef77('0x3c')]){delete _0x24551e[_0xef77('0x3c')];}_0x46ae5e['status'](_0x330bbd)[_0xef77('0x3d')](_0x24551e);};}exports['index']=function(_0x561def,_0x35c4ef){var _0x442963={},_0x3b729c={},_0x3590d2={'count':0x0,'rows':[]};var _0x17fc45=_[_0xef77('0x3e')](db['ChatMessage'][_0xef77('0x3f')],function(_0x41491c){return{'name':_0x41491c[_0xef77('0x40')],'type':_0x41491c[_0xef77('0x41')][_0xef77('0x42')]};});_0x3b729c[_0xef77('0x43')]=_[_0xef77('0x3e')](_0x17fc45,_0xef77('0x3c'));_0x3b729c[_0xef77('0x44')]=_[_0xef77('0x45')](_0x561def[_0xef77('0x44')]);_0x3b729c[_0xef77('0x46')]=_[_0xef77('0x47')](_0x3b729c[_0xef77('0x43')],_0x3b729c[_0xef77('0x44')]);_0x442963[_0xef77('0x48')]=_[_0xef77('0x47')](_0x3b729c['model'],qs['fields'](_0x561def['query']['fields']));_0x442963[_0xef77('0x48')]=_0x442963[_0xef77('0x48')]['length']?_0x442963[_0xef77('0x48')]:_0x3b729c[_0xef77('0x43')];if(!_0x561def[_0xef77('0x44')][_0xef77('0x49')]('nolimit')){_0x442963[_0xef77('0x2f')]=qs['limit'](_0x561def[_0xef77('0x44')][_0xef77('0x2f')]);_0x442963[_0xef77('0x31')]=qs[_0xef77('0x31')](_0x561def['query'][_0xef77('0x31')]);}_0x442963[_0xef77('0x4a')]=qs[_0xef77('0x4b')](_0x561def['query'][_0xef77('0x4b')]);_0x442963['where']=qs[_0xef77('0x46')](_['pick'](_0x561def[_0xef77('0x44')],_0x3b729c[_0xef77('0x46')]),_0x17fc45);if(_0x561def[_0xef77('0x44')][_0xef77('0x4c')]){_0x442963['where']=_['merge'](_0x442963[_0xef77('0x4d')],{'$or':_['map'](_0x17fc45,function(_0x57c80e){if(_0x57c80e[_0xef77('0x41')]!==_0xef77('0x4e')){var _0x46e303={};_0x46e303[_0x57c80e[_0xef77('0x3c')]]={'$like':'%'+_0x561def[_0xef77('0x44')][_0xef77('0x4c')]+'%'};return _0x46e303;}})});}_0x442963=_['merge']({},_0x442963,_0x561def[_0xef77('0x4f')]);var _0x58f750={'where':_0x442963['where']};return db[_0xef77('0x50')][_0xef77('0x30')](_0x58f750)[_0xef77('0x24')](function(_0x56946e){_0x3590d2[_0xef77('0x30')]=_0x56946e;if(_0x561def[_0xef77('0x44')]['includeAll']){_0x442963[_0xef77('0x51')]=[{'all':!![]}];}return db[_0xef77('0x50')]['findAll'](_0x442963);})[_0xef77('0x24')](function(_0x5efdce){_0x3590d2['rows']=_0x5efdce;return _0x3590d2;})[_0xef77('0x24')](respondWithFilteredResult(_0x35c4ef,_0x442963))[_0xef77('0x2c')](handleError(_0x35c4ef,null));};exports['show']=function(_0x27ded0,_0x4d7d7b){var _0x21970c={'raw':!![],'where':{'id':_0x27ded0[_0xef77('0x52')]['id']}},_0x36ddf5={};_0x36ddf5[_0xef77('0x43')]=_['keys'](db['ChatMessage'][_0xef77('0x3f')]);_0x36ddf5[_0xef77('0x44')]=_['keys'](_0x27ded0['query']);_0x36ddf5[_0xef77('0x46')]=_[_0xef77('0x47')](_0x36ddf5['model'],_0x36ddf5[_0xef77('0x44')]);_0x21970c[_0xef77('0x48')]=_['intersection'](_0x36ddf5[_0xef77('0x43')],qs['fields'](_0x27ded0['query'][_0xef77('0x53')]));_0x21970c[_0xef77('0x48')]=_0x21970c[_0xef77('0x48')][_0xef77('0x54')]?_0x21970c[_0xef77('0x48')]:_0x36ddf5[_0xef77('0x43')];if(_0x27ded0[_0xef77('0x44')][_0xef77('0x55')]){_0x21970c[_0xef77('0x51')]=[{'all':!![]}];}_0x21970c=_[_0xef77('0x56')]({},_0x21970c,_0x27ded0[_0xef77('0x4f')]);return db['ChatMessage'][_0xef77('0x57')](_0x21970c)[_0xef77('0x24')](handleEntityNotFound(_0x4d7d7b,null))['then'](respondWithResult(_0x4d7d7b,null))[_0xef77('0x2c')](handleError(_0x4d7d7b,null));};exports[_0xef77('0x58')]=function(_0x1315a0,_0x36f21b){return db['ChatMessage'][_0xef77('0x58')](_0x1315a0[_0xef77('0x59')],{})['then'](respondWithResult(_0x36f21b,0xc9))[_0xef77('0x2c')](handleError(_0x36f21b,null));};exports[_0xef77('0x38')]=function(_0x3d125f,_0xc7ebff){if(_0x3d125f[_0xef77('0x59')]['id']){delete _0x3d125f['body']['id'];}return db[_0xef77('0x50')][_0xef77('0x57')]({'where':{'id':_0x3d125f[_0xef77('0x52')]['id']}})[_0xef77('0x24')](handleEntityNotFound(_0xc7ebff,null))[_0xef77('0x24')](saveUpdates(_0x3d125f[_0xef77('0x59')],null))[_0xef77('0x24')](respondWithResult(_0xc7ebff,null))[_0xef77('0x2c')](handleError(_0xc7ebff,null));};exports[_0xef77('0x39')]=function(_0xb6ad45,_0x58e350){return db[_0xef77('0x50')][_0xef77('0x57')]({'where':{'id':_0xb6ad45[_0xef77('0x52')]['id']}})[_0xef77('0x24')](handleEntityNotFound(_0x58e350,null))['then'](removeEntity(_0x58e350,null))[_0xef77('0x2c')](handleError(_0x58e350,null));};exports[_0xef77('0x5a')]=function(_0xacd52,_0x43b35c){return db[_0xef77('0x50')]['describe']()[_0xef77('0x24')](respondWithResult(_0x43b35c,null))[_0xef77('0x2c')](handleError(_0x43b35c,null));};var interaction_log=require('../../config/logger')(_0xef77('0x5b'));exports['accept']=function(_0x592304,_0x30dd00,_0x41002d){var _0x2618a0={'agent':{},'channel':'chat'};if(_0x592304[_0xef77('0x59')]['id']){delete _0x592304[_0xef77('0x59')]['id'];}_0x592304[_0xef77('0x59')]['read']=!![];_0x592304['body'][_0xef77('0x5c')]=moment()[_0xef77('0x5d')](_0xef77('0x5e'));_0x592304[_0xef77('0x59')][_0xef77('0x5f')]=_0x592304[_0xef77('0x59')][_0xef77('0x5f')]||_0x592304['user']['id'];_0x2618a0[_0xef77('0x60')]['id']=_0x592304['body'][_0xef77('0x5f')];return db['ChatMessage'][_0xef77('0x57')]({'where':{'id':_0x592304[_0xef77('0x52')]['id'],'UserId':null}})[_0xef77('0x24')](handleEntityNotFound(_0x30dd00,null))[_0xef77('0x24')](saveUpdates(_0x592304[_0xef77('0x59')],null))[_0xef77('0x24')](function(_0x1c83c5){if(_0x1c83c5){_0x2618a0['message']=_0x1c83c5[_0xef77('0x61')]({'plain':!![]});return db['ChatInteraction'][_0xef77('0x57')]({'where':{'id':_0x1c83c5[_0xef77('0x62')]}});}return null;})[_0xef77('0x24')](handleEntityNotFound(_0x30dd00,null))[_0xef77('0x24')](function(_0x592709){if(_0x592709){return _0x592709[_0xef77('0x38')]({'UserId':_0x592304['body']['UserId'],'read1stAt':_[_0xef77('0x63')](_0x592709['read1stAt'])?moment()[_0xef77('0x5d')](_0xef77('0x5e')):undefined});}return null;})[_0xef77('0x24')](function(_0x46b544){if(_0x46b544){_0x2618a0[_0xef77('0x64')]=_0x46b544[_0xef77('0x61')]({'plain':!![]});interaction_log[_0xef77('0x25')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x592304[_0xef77('0x65')]['id'],_0x592304['user'][_0xef77('0x3c')],_0x592304[_0xef77('0x65')][_0xef77('0x66')],_0x2618a0['interaction']['id'],_0x592304[_0xef77('0x59')]?JSON['stringify'](_0x592304[_0xef77('0x59')]):_0xef77('0x67'));return respondWithRpcPromise(_0xef77('0x68'),_0xef77('0x69'),_0x2618a0);}return null;})['then'](function(_0x31c22d){var _0x3ba986=_0xef77('0x6a')+_0x31c22d['message'][_0xef77('0x6b')];return db[_0xef77('0x6c')][_0xef77('0x44')](_0x3ba986,{'type':db[_0xef77('0x6d')]['QueryTypes'][_0xef77('0x6e')],'raw':!![]})[_0xef77('0x24')](function(_0x5a9a2d){return _0x5a9a2d;});})[_0xef77('0x24')](function(_0x4b574f){if(_0x4b574f){_0x2618a0[_0xef77('0x2a')]['contact']=_0x4b574f[0x0];if(!_0x592304['body'][_0xef77('0x5f')])return;return db[_0xef77('0x6f')][_0xef77('0x57')]({'where':{'id':_0x592304[_0xef77('0x59')]['UserId'],'role':'agent'},'attributes':['id','name',_0xef77('0x70'),_0xef77('0x71'),_0xef77('0x72')],'raw':!![]});}return null;})[_0xef77('0x24')](function(_0x158c7e){if(!_0x158c7e)return null;_0x2618a0[_0xef77('0x2a')][_0xef77('0x60')]=_0x158c7e;return _0x2618a0;})[_0xef77('0x24')](function(_0x2c1ef7){if(_0x2c1ef7){if(_0x592304['body'][_0xef77('0x73')]){_0x2618a0[_0xef77('0x2a')][_0xef77('0x74')]=util['format']('SIP/%s',_0x592304[_0xef77('0x65')]['name']);_0x2618a0[_0xef77('0x2a')][_0xef77('0x75')]=_0x2618a0['channel'];_0x2618a0[_0xef77('0x2a')][_0xef77('0x76')]=_0x2618a0['channel'];_0x2618a0['message']['event']='accept';return respondWithRpcPromise(_0xef77('0x77'),'EventManager',{'event':_0xef77('0x78'),'message':_[_0xef77('0x56')](_0x2618a0['message'],JSON[_0xef77('0x79')](_0x2618a0[_0xef77('0x64')][_0xef77('0x7a')]))},client9002)[_0xef77('0x24')](function(){return _0x2618a0;});}return _0x2618a0;}return null;})[_0xef77('0x24')](respondWithResult(_0x30dd00,null))[_0xef77('0x2c')](handleError(_0x30dd00,null));};var interaction_log=require(_0xef77('0x7b'))(_0xef77('0x5b'));exports['reject']=function(_0x418595,_0x3389d3,_0x34ff37){var _0x26ce0b={'agent':{},'channel':'chat'};if(_0x418595[_0xef77('0x59')]['id']){delete _0x418595[_0xef77('0x59')]['id'];}_0x418595['body'][_0xef77('0x5f')]=_0x418595[_0xef77('0x59')]['UserId']||_0x418595['user']['id'];_0x26ce0b['agent']['id']=_0x418595[_0xef77('0x59')]['UserId'];return db[_0xef77('0x50')][_0xef77('0x57')]({'where':{'id':_0x418595[_0xef77('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3389d3,null))[_0xef77('0x24')](function(_0x22fe6e){if(_0x22fe6e){_0x26ce0b[_0xef77('0x2a')]=_0x22fe6e[_0xef77('0x61')]({'plain':!![]});return db[_0xef77('0x7c')][_0xef77('0x57')]({'where':{'id':_0x22fe6e[_0xef77('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x3389d3,null))[_0xef77('0x24')](function(_0x1a4a72){if(_0x1a4a72){_0x26ce0b[_0xef77('0x64')]=_0x1a4a72['get']({'plain':!![]});interaction_log[_0xef77('0x25')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x418595[_0xef77('0x65')]['id'],_0x418595[_0xef77('0x65')]['name'],_0x418595[_0xef77('0x65')]['role'],_0x26ce0b[_0xef77('0x64')]['id'],_0x418595['body']?JSON[_0xef77('0x27')](_0x418595['body']):_0xef77('0x67'));return respondWithRpcPromise(_0xef77('0x7d'),_0xef77('0x7e'),_0x26ce0b);}return null;})[_0xef77('0x24')](function(_0x551486){var _0xaa7683='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x551486[_0xef77('0x2a')][_0xef77('0x6b')];return db['sequelize']['query'](_0xaa7683,{'type':db['Sequelize'][_0xef77('0x7f')][_0xef77('0x6e')],'raw':!![]})[_0xef77('0x24')](function(_0x5e36e2){return _0x5e36e2;});})[_0xef77('0x24')](function(_0x383c44){if(_0x383c44){_0x26ce0b[_0xef77('0x2a')][_0xef77('0x80')]=_0x383c44[0x0];if(!_0x418595['body'][_0xef77('0x5f')])return;return db[_0xef77('0x6f')][_0xef77('0x57')]({'where':{'id':_0x418595['body']['UserId'],'role':_0xef77('0x60')},'attributes':['id',_0xef77('0x3c'),_0xef77('0x70'),'email',_0xef77('0x72')],'raw':!![]});}return null;})[_0xef77('0x24')](function(_0xc68613){if(!_0xc68613)return null;_0x26ce0b[_0xef77('0x2a')][_0xef77('0x60')]=_0xc68613;return _0x26ce0b;})['then'](function(_0x2a28c7){if(_0x2a28c7){_0x2a28c7[_0xef77('0x2a')][_0xef77('0x74')]=util[_0xef77('0x5d')]('SIP/%s',_0x418595['user'][_0xef77('0x3c')]);_0x2a28c7[_0xef77('0x2a')][_0xef77('0x75')]=_0x26ce0b['channel'];_0x2a28c7[_0xef77('0x2a')]['motionChannel']=_0x26ce0b[_0xef77('0x75')];_0x2a28c7[_0xef77('0x2a')]['event']='reject';respondWithRpcPromise(_0xef77('0x77'),_0xef77('0x77'),{'event':_0xef77('0x81'),'message':_[_0xef77('0x56')](_0x26ce0b[_0xef77('0x2a')],JSON[_0xef77('0x79')](_0x26ce0b[_0xef77('0x64')][_0xef77('0x7a')]))},client9002);return _0x26ce0b;}return null;})[_0xef77('0x24')](respondWithResult(_0x3389d3,null))[_0xef77('0x2c')](handleError(_0x3389d3,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 22cb73a..2e523b2 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 _0x2742=['../../mysqldb','ChatMessage','save','emit','hook','exports','events'];(function(_0x2fb7c5,_0x466765){var _0x9cc189=function(_0x2be180){while(--_0x2be180){_0x2fb7c5['push'](_0x2fb7c5['shift']());}};_0x9cc189(++_0x466765);}(_0x2742,0x1aa));var _0x2274=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2742[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x2274('0x0'));var ChatMessage=require(_0x2274('0x1'))['db'][_0x2274('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2274('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x46bcfe){return function(_0x8f33d0,_0x2c432f,_0x581175){ChatMessageEvents[_0x2274('0x4')](_0x46bcfe+':'+_0x8f33d0['id'],_0x8f33d0);ChatMessageEvents['emit'](_0x46bcfe,_0x8f33d0);_0x581175(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x2274('0x5')](e,emitEvent(event));}}module[_0x2274('0x6')]=ChatMessageEvents;
\ No newline at end of file
+var _0xcfe1=['events','../../mysqldb','setMaxListeners','save','update','emit','hook'];(function(_0x4c86d2,_0x591baf){var _0x437a4b=function(_0x462901){while(--_0x462901){_0x4c86d2['push'](_0x4c86d2['shift']());}};_0x437a4b(++_0x591baf);}(_0xcfe1,0x126));var _0x1cfe=function(_0x43dd06,_0x2b2592){_0x43dd06=_0x43dd06-0x0;var _0x416968=_0xcfe1[_0x43dd06];return _0x416968;};'use strict';var EventEmitter=require(_0x1cfe('0x0'));var ChatMessage=require(_0x1cfe('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1cfe('0x2')](0x0);var events={'afterCreate':_0x1cfe('0x3'),'afterUpdate':_0x1cfe('0x4'),'afterDestroy':'remove'};function emitEvent(_0x6da306){return function(_0x25523d,_0x1b2365,_0x15cf6d){ChatMessageEvents[_0x1cfe('0x5')](_0x6da306+':'+_0x25523d['id'],_0x25523d);ChatMessageEvents[_0x1cfe('0x5')](_0x6da306,_0x25523d);_0x15cf6d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x1cfe('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 ff5cafe..2c5ec24 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 _0xba4e=['util','api','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','utf8mb4_unicode_ci','lodash'];(function(_0x250323,_0x5517af){var _0x4bcce1=function(_0xd0c4b8){while(--_0xd0c4b8){_0x250323['push'](_0x250323['shift']());}};_0x4bcce1(++_0x5517af);}(_0xba4e,0x67));var _0xeba4=function(_0x51539c,_0x25f587){_0x51539c=_0x51539c-0x0;var _0x4f7914=_0xba4e[_0x51539c];return _0x4f7914;};'use strict';var _=require(_0xeba4('0x0'));var util=require(_0xeba4('0x1'));var logger=require('../../config/logger')(_0xeba4('0x2'));var moment=require(_0xeba4('0x3'));var BPromise=require(_0xeba4('0x4'));var rp=require(_0xeba4('0x5'));var fs=require('fs');var path=require(_0xeba4('0x6'));var rimraf=require('rimraf');var config=require(_0xeba4('0x7'));var attributes=require(_0xeba4('0x8'));module[_0xeba4('0x9')]=function(_0x5f51fb,_0x24d2d5){return _0x5f51fb['define'](_0xeba4('0xa'),attributes,{'tableName':_0xeba4('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0xeba4('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x553bb4,_0x236c0c,_0x3ec9c6){var _0x4be11f=_0x5f51fb[_0xeba4('0xd')];var _0x4db6d4=_0x553bb4[_0xeba4('0xe')]({'plain':!![]});if(_0x4db6d4[_0xeba4('0xf')][_0xeba4('0x10')]()==='in'||_0x4db6d4['direction'][_0xeba4('0x10')]()==='out'&&!_0x4db6d4[_0xeba4('0x11')]&&!_[_0xeba4('0x12')](_0x4db6d4[_0xeba4('0x13')])){_0x4be11f[_0xeba4('0x14')][_0xeba4('0x15')]({'where':{'id':_0x4db6d4['ChatInteractionId']}})[_0xeba4('0x16')](function(_0x3db4a6){if(_0x3db4a6){_0x3db4a6[_0xeba4('0x17')]({'lastMsgAt':_0x4db6d4[_0xeba4('0x18')],'lastMsgDirection':_0x4db6d4['direction'][_0xeba4('0x10')]()});}})['catch'](function(_0x2710b7){console['error'](_0x2710b7);});}_0x3ec9c6();}},'charset':'utf8mb4','collate':_0xeba4('0x19')});};
\ No newline at end of file
+var _0x826e=['error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','FULLTEXT','models','direction','toLowerCase','secret','isNil','then','createdAt','catch'];(function(_0x22e69b,_0x1f32b0){var _0x2c2db7=function(_0x5b670c){while(--_0x5b670c){_0x22e69b['push'](_0x22e69b['shift']());}};_0x2c2db7(++_0x1f32b0);}(_0x826e,0x163));var _0xe826=function(_0x189ffc,_0x3bc69d){_0x189ffc=_0x189ffc-0x0;var _0xa0f1ed=_0x826e[_0x189ffc];return _0xa0f1ed;};'use strict';var _=require('lodash');var util=require(_0xe826('0x0'));var logger=require(_0xe826('0x1'))(_0xe826('0x2'));var moment=require(_0xe826('0x3'));var BPromise=require(_0xe826('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe826('0x5'));var attributes=require(_0xe826('0x6'));module[_0xe826('0x7')]=function(_0x21d118,_0x4a2658){return _0x21d118['define'](_0xe826('0x8'),attributes,{'tableName':_0xe826('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0xe826('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x50b311,_0x11f53d,_0x34da53){var _0x63554f=_0x21d118[_0xe826('0xb')];var _0x1a4915=_0x50b311['get']({'plain':!![]});if(_0x1a4915[_0xe826('0xc')][_0xe826('0xd')]()==='in'||_0x1a4915[_0xe826('0xc')]['toLowerCase']()==='out'&&!_0x1a4915[_0xe826('0xe')]&&!_[_0xe826('0xf')](_0x1a4915['UserId'])){_0x63554f['ChatInteraction']['findOne']({'where':{'id':_0x1a4915['ChatInteractionId']}})[_0xe826('0x10')](function(_0x200eb6){if(_0x200eb6){_0x200eb6['update']({'lastMsgAt':_0x1a4915[_0xe826('0x11')],'lastMsgDirection':_0x1a4915[_0xe826('0xc')][_0xe826('0xd')]()});}})[_0xe826('0x12')](function(_0x48e03f){console[_0xe826('0x13')](_0x48e03f);});}_0x34da53();}},'charset':_0xe826('0x14'),'collate':_0xe826('0x15')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index c9ac628..90951b2 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 _0xd142=['register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatMessage','ChatMessage','body','options','raw','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket'];(function(_0x3a1878,_0x46afed){var _0x45a7e3=function(_0xb60fcb){while(--_0xb60fcb){_0x3a1878['push'](_0x3a1878['shift']());}};_0x45a7e3(++_0x46afed);}(_0xd142,0x6f));var _0x2d14=function(_0x12b830,_0xd66540){_0x12b830=_0x12b830-0x0;var _0x261dc4=_0xd142[_0x12b830];return _0x261dc4;};'use strict';var _=require(_0x2d14('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2d14('0x1'));var fs=require('fs');var Redis=require(_0x2d14('0x2'));var db=require(_0x2d14('0x3'))['db'];var utils=require(_0x2d14('0x4'));var logger=require('../../config/logger')(_0x2d14('0x5'));var config=require(_0x2d14('0x6'));var jayson=require(_0x2d14('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x2d14('0x8')](config[_0x2d14('0x9')],{'host':_0x2d14('0xa'),'port':0x18eb});var socket=require(_0x2d14('0xb'))(new Redis(config[_0x2d14('0x9')]));require(_0x2d14('0xc'))[_0x2d14('0xd')](socket);function respondWithRpcPromise(_0x1144dc,_0xf93a74,_0x60ef8c){return new BPromise(function(_0x1c0c5e,_0xfc60f9){return client[_0x2d14('0xe')](_0x1144dc,_0x60ef8c)[_0x2d14('0xf')](function(_0x5d7d8c){logger[_0x2d14('0x10')](_0x2d14('0x11'),_0xf93a74,_0x2d14('0x12'));logger[_0x2d14('0x13')](_0x2d14('0x14'),_0xf93a74,'request\x20sent',JSON[_0x2d14('0x15')](_0x5d7d8c));if(_0x5d7d8c[_0x2d14('0x16')]){if(_0x5d7d8c[_0x2d14('0x16')][_0x2d14('0x17')]===0x1f4){logger['error'](_0x2d14('0x11'),_0xf93a74,_0x5d7d8c[_0x2d14('0x16')]['message']);return _0xfc60f9(_0x5d7d8c[_0x2d14('0x16')]['message']);}logger[_0x2d14('0x16')](_0x2d14('0x11'),_0xf93a74,_0x5d7d8c[_0x2d14('0x16')][_0x2d14('0x18')]);return _0x1c0c5e(_0x5d7d8c[_0x2d14('0x16')][_0x2d14('0x18')]);}else{logger[_0x2d14('0x10')](_0x2d14('0x11'),_0xf93a74,'request\x20sent');_0x1c0c5e(_0x5d7d8c['result']['message']);}})[_0x2d14('0x19')](function(_0x2e7ec0){logger[_0x2d14('0x16')](_0x2d14('0x11'),_0xf93a74,_0x2e7ec0);_0xfc60f9(_0x2e7ec0);});});}exports[_0x2d14('0x1a')]=function(_0x2cc945){var _0x37ab4a=this;return new Promise(function(_0x517e24,_0x2d9bd2){return db[_0x2d14('0x1b')]['create'](_0x2cc945[_0x2d14('0x1c')],{'raw':_0x2cc945[_0x2d14('0x1d')]?_0x2cc945['options'][_0x2d14('0x1e')]===undefined?!![]:![]:!![]})[_0x2d14('0xf')](function(_0x3859f3){logger['info'](_0x2d14('0x1a'),_0x2cc945);logger[_0x2d14('0x13')](_0x2d14('0x1a'),_0x2cc945,JSON[_0x2d14('0x15')](_0x3859f3));_0x517e24(_0x3859f3);})[_0x2d14('0x19')](function(_0xb7e51f){logger[_0x2d14('0x16')](_0x2d14('0x1a'),_0xb7e51f[_0x2d14('0x18')],_0x2cc945);_0x2d9bd2(_0x37ab4a[_0x2d14('0x16')](0x1f4,_0xb7e51f[_0x2d14('0x18')]));});});};
\ No newline at end of file
+var _0x7157=['ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','create','body','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','request','then','info'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x7157,0x1b0));var _0x7715=function(_0x27c2b1,_0x39a48c){_0x27c2b1=_0x27c2b1-0x0;var _0x423cb6=_0x7157[_0x27c2b1];return _0x423cb6;};'use strict';var _=require(_0x7715('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7715('0x1'));var rs=require(_0x7715('0x2'));var fs=require('fs');var Redis=require(_0x7715('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7715('0x4'));var logger=require(_0x7715('0x5'))(_0x7715('0x6'));var config=require(_0x7715('0x7'));var jayson=require(_0x7715('0x8'));var client=jayson[_0x7715('0x9')][_0x7715('0xa')]({'port':0x232a});config[_0x7715('0xb')]=_['defaults'](config[_0x7715('0xb')],{'host':_0x7715('0xc'),'port':0x18eb});var socket=require(_0x7715('0xd'))(new Redis(config[_0x7715('0xb')]));require(_0x7715('0xe'))['register'](socket);function respondWithRpcPromise(_0x24919f,_0x3028c7,_0x196fcb){return new BPromise(function(_0x3b54a1,_0x5bbc71){return client[_0x7715('0xf')](_0x24919f,_0x196fcb)[_0x7715('0x10')](function(_0x4c939b){logger[_0x7715('0x11')](_0x7715('0x12'),_0x3028c7,_0x7715('0x13'));logger[_0x7715('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3028c7,_0x7715('0x13'),JSON[_0x7715('0x15')](_0x4c939b));if(_0x4c939b[_0x7715('0x16')]){if(_0x4c939b[_0x7715('0x16')]['code']===0x1f4){logger[_0x7715('0x16')]('ChatMessage,\x20%s,\x20%s',_0x3028c7,_0x4c939b[_0x7715('0x16')]['message']);return _0x5bbc71(_0x4c939b[_0x7715('0x16')][_0x7715('0x17')]);}logger[_0x7715('0x16')]('ChatMessage,\x20%s,\x20%s',_0x3028c7,_0x4c939b[_0x7715('0x16')][_0x7715('0x17')]);return _0x3b54a1(_0x4c939b['error'][_0x7715('0x17')]);}else{logger['info'](_0x7715('0x12'),_0x3028c7,_0x7715('0x13'));_0x3b54a1(_0x4c939b[_0x7715('0x18')][_0x7715('0x17')]);}})[_0x7715('0x19')](function(_0x3e1072){logger['error'](_0x7715('0x12'),_0x3028c7,_0x3e1072);_0x5bbc71(_0x3e1072);});});}exports[_0x7715('0x1a')]=function(_0x524c7f){var _0x30f71d=this;return new Promise(function(_0x12120b,_0x2530de){return db[_0x7715('0x1b')][_0x7715('0x1c')](_0x524c7f[_0x7715('0x1d')],{'raw':_0x524c7f['options']?_0x524c7f['options']['raw']===undefined?!![]:![]:!![]})[_0x7715('0x10')](function(_0x1c4f9b){logger[_0x7715('0x11')](_0x7715('0x1a'),_0x524c7f);logger[_0x7715('0x14')](_0x7715('0x1a'),_0x524c7f,JSON['stringify'](_0x1c4f9b));_0x12120b(_0x1c4f9b);})[_0x7715('0x19')](function(_0x3191d0){logger[_0x7715('0x16')](_0x7715('0x1a'),_0x3191d0[_0x7715('0x17')],_0x524c7f);_0x2530de(_0x30f71d[_0x7715('0x16')](0x1f4,_0x3191d0[_0x7715('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 049b187..fae1344 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 _0xce50=['save','remove','update','register'];(function(_0x47568d,_0x59420b){var _0x5984e0=function(_0x59a63e){while(--_0x59a63e){_0x47568d['push'](_0x47568d['shift']());}};_0x5984e0(++_0x59420b);}(_0xce50,0x1d8));var _0x0ce5=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xce50[_0x39096d];return _0x13da4f;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x0ce5('0x0'),_0x0ce5('0x1'),_0x0ce5('0x2')];function createListener(_0x363236,_0x1eddd3){return function(_0x563b79){_0x1eddd3['emit'](_0x363236,_0x563b79);};}function removeListener(_0x11f9e0,_0x52a2f1){return function(){ChatMessageEvents['removeListener'](_0x11f9e0,_0x52a2f1);};}exports[_0x0ce5('0x3')]=function(_0x42fadd){for(var _0x69892c=0x0,_0x3eb5b2=events['length'];_0x69892c<_0x3eb5b2;_0x69892c++){var _0x32610d=events[_0x69892c];var _0x8d611f=createListener('chatMessage:'+_0x32610d,_0x42fadd);ChatMessageEvents['on'](_0x32610d,_0x8d611f);}};
\ No newline at end of file
+var _0x0207=['emit','removeListener','length','chatMessage:','save'];(function(_0x1d75d0,_0x666556){var _0x3607bf=function(_0x407781){while(--_0x407781){_0x1d75d0['push'](_0x1d75d0['shift']());}};_0x3607bf(++_0x666556);}(_0x0207,0x162));var _0x7020=function(_0x2178fa,_0x284a29){_0x2178fa=_0x2178fa-0x0;var _0x47012f=_0x0207[_0x2178fa];return _0x47012f;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x7020('0x0'),'remove','update'];function createListener(_0x1a481c,_0x28ab1d){return function(_0x2213ca){_0x28ab1d[_0x7020('0x1')](_0x1a481c,_0x2213ca);};}function removeListener(_0x2e62fd,_0x25174b){return function(){ChatMessageEvents[_0x7020('0x2')](_0x2e62fd,_0x25174b);};}exports['register']=function(_0x5074d7){for(var _0x38c320=0x0,_0x39263c=events[_0x7020('0x3')];_0x38c320<_0x39263c;_0x38c320++){var _0x17deac=events[_0x38c320];var _0x42bc79=createListener(_0x7020('0x4')+_0x17deac,_0x5074d7);ChatMessageEvents['on'](_0x17deac,_0x42bc79);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 388d995..ed95831 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 _0x7ae6=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','index','get','/describe','describe','/:id','isAuthenticated','show','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x59b48b,_0x584733){var _0x4c3f79=function(_0x3f2e94){while(--_0x3f2e94){_0x59b48b['push'](_0x59b48b['shift']());}};_0x4c3f79(++_0x584733);}(_0x7ae6,0xa8));var _0x67ae=function(_0x5c292f,_0x20efd4){_0x5c292f=_0x5c292f-0x0;var _0x27d10b=_0x7ae6[_0x5c292f];return _0x27d10b;};'use strict';var multer=require(_0x67ae('0x0'));var util=require(_0x67ae('0x1'));var path=require(_0x67ae('0x2'));var timeout=require('connect-timeout');var express=require(_0x67ae('0x3'));var router=express[_0x67ae('0x4')]();var fs_extra=require(_0x67ae('0x5'));var auth=require(_0x67ae('0x6'));var interaction=require(_0x67ae('0x7'));var config=require(_0x67ae('0x8'));var controller=require(_0x67ae('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x67ae('0xa')]);router[_0x67ae('0xb')](_0x67ae('0xc'),auth['isAuthenticated'](),controller[_0x67ae('0xd')]);router[_0x67ae('0xb')](_0x67ae('0xe'),auth[_0x67ae('0xf')](),controller[_0x67ae('0x10')]);router['post']('/',auth[_0x67ae('0xf')](),interaction[_0x67ae('0x11')](_0x67ae('0x12'),_0x67ae('0x13')),controller[_0x67ae('0x14')]);router[_0x67ae('0x15')](_0x67ae('0xe'),controller[_0x67ae('0x16')]);router[_0x67ae('0x15')](_0x67ae('0x17'),auth[_0x67ae('0xf')](),controller[_0x67ae('0x18')]);router['put'](_0x67ae('0x19'),auth['isAuthenticated'](),controller['reject']);router[_0x67ae('0x1a')](_0x67ae('0xe'),auth[_0x67ae('0xf')](),controller[_0x67ae('0x1b')]);module[_0x67ae('0x1c')]=router;
\ No newline at end of file
+var _0x2471=['put','update','/:id/accept','/:id/reject','reject','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','get','/describe','describe','/:id','show','tracked','chat','chatmessage:create'];(function(_0x4109d7,_0xc7e23b){var _0x468d71=function(_0x14ad80){while(--_0x14ad80){_0x4109d7['push'](_0x4109d7['shift']());}};_0x468d71(++_0xc7e23b);}(_0x2471,0xde));var _0x1247=function(_0x4087cc,_0x2b2f48){_0x4087cc=_0x4087cc-0x0;var _0x52874a=_0x2471[_0x4087cc];return _0x52874a;};'use strict';var multer=require(_0x1247('0x0'));var util=require(_0x1247('0x1'));var path=require('path');var timeout=require(_0x1247('0x2'));var express=require('express');var router=express[_0x1247('0x3')]();var fs_extra=require(_0x1247('0x4'));var auth=require(_0x1247('0x5'));var interaction=require(_0x1247('0x6'));var config=require(_0x1247('0x7'));var controller=require(_0x1247('0x8'));router['get']('/',auth[_0x1247('0x9')](),controller['index']);router[_0x1247('0xa')](_0x1247('0xb'),auth[_0x1247('0x9')](),controller[_0x1247('0xc')]);router['get'](_0x1247('0xd'),auth[_0x1247('0x9')](),controller[_0x1247('0xe')]);router['post']('/',auth[_0x1247('0x9')](),interaction[_0x1247('0xf')](_0x1247('0x10'),_0x1247('0x11')),controller['create']);router[_0x1247('0x12')]('/:id',controller[_0x1247('0x13')]);router[_0x1247('0x12')](_0x1247('0x14'),auth[_0x1247('0x9')](),controller['accept']);router[_0x1247('0x12')](_0x1247('0x15'),auth[_0x1247('0x9')](),controller[_0x1247('0x16')]);router['delete'](_0x1247('0xd'),auth[_0x1247('0x9')](),controller['destroy']);module[_0x1247('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 403d91f..95a18bc 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 _0x757a=['exports','TEXT'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x757a,0xde));var _0xa757=function(_0x8f8ae2,_0x47fe1d){_0x8f8ae2=_0x8f8ae2-0x0;var _0x3f2198=_0x757a[_0x8f8ae2];return _0x3f2198;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'body':{'type':Sequelize[_0xa757('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x1e2373,_0x4aec50){var _0x8efd57=function(_0x54f7dc){while(--_0x54f7dc){_0x1e2373['push'](_0x1e2373['shift']());}};_0x8efd57(++_0x4aec50);}(_0x5f2f,0x73));var _0xf5f2=function(_0x57a402,_0x40596b){_0x57a402=_0x57a402-0x0;var _0x753a36=_0x5f2f[_0x57a402];return _0x753a36;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 03894bd..c2a41eb 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(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x7a54,0x106));var _0x47a5=function(_0x47b75d,_0x1ce843){_0x47b75d=_0x47b75d-0x0;var _0x4fc343=_0x7a54[_0x47b75d];return _0x4fc343;};'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 _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x328fa9,_0x2ad630){var _0x32cf6f=function(_0x4602b3){while(--_0x4602b3){_0x328fa9['push'](_0x328fa9['shift']());}};_0x32cf6f(++_0x2ad630);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 8ede9ca..8059830 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 _0x1f36=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save'];(function(_0x16578f,_0x7a1cdf){var _0x52f6e4=function(_0x170f99){while(--_0x170f99){_0x16578f['push'](_0x16578f['shift']());}};_0x52f6e4(++_0x7a1cdf);}(_0x1f36,0x187));var _0x61f3=function(_0x19a9a5,_0x2bf8b2){_0x19a9a5=_0x19a9a5-0x0;var _0x5306fe=_0x1f36[_0x19a9a5];return _0x5306fe;};'use strict';var EventEmitter=require(_0x61f3('0x0'));var ChatOfflineMessage=require(_0x61f3('0x1'))['db'][_0x61f3('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x61f3('0x3')](0x0);var events={'afterCreate':_0x61f3('0x4'),'afterUpdate':_0x61f3('0x5'),'afterDestroy':_0x61f3('0x6')};function emitEvent(_0x8ad14f){return function(_0xfc8e04,_0x208982,_0x421fb8){ChatOfflineMessageEvents[_0x61f3('0x7')](_0x8ad14f+':'+_0xfc8e04['id'],_0xfc8e04);ChatOfflineMessageEvents[_0x61f3('0x7')](_0x8ad14f,_0xfc8e04);_0x421fb8(null);};}for(var e in events){if(events[_0x61f3('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x61f3('0x9')](e,emitEvent(event));}}module[_0x61f3('0xa')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x5153=['remove','emit','exports','events','save','update'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x5153,0x159));var _0x3515=function(_0x3988c7,_0x1dab2f){_0x3988c7=_0x3988c7-0x0;var _0x19d631=_0x5153[_0x3988c7];return _0x19d631;};'use strict';var EventEmitter=require(_0x3515('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3515('0x1'),'afterUpdate':_0x3515('0x2'),'afterDestroy':_0x3515('0x3')};function emitEvent(_0x4a3292){return function(_0xb829be,_0x113fd9,_0x257f85){ChatOfflineMessageEvents['emit'](_0x4a3292+':'+_0xb829be['id'],_0xb829be);ChatOfflineMessageEvents[_0x3515('0x4')](_0x4a3292,_0xb829be);_0x257f85(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x3515('0x5')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index dbc1985..6e9a6cc 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 _0xb64d=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb64d,0x1df));var _0xdb64=function(_0x1905fa,_0x114a51){_0x1905fa=_0x1905fa-0x0;var _0x68d09a=_0xb64d[_0x1905fa];return _0x68d09a;};'use strict';var attributes=require(_0xdb64('0x0'));module[_0xdb64('0x1')]=function(_0x414018){return _0x414018[_0xdb64('0x2')](_0xdb64('0x3'),attributes,{'tableName':_0xdb64('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdb64('0x5'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x9e87=['ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','exports'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x9e87,0x14b));var _0x79e8=function(_0x503e25,_0xb8a860){_0x503e25=_0x503e25-0x0;var _0x47c27a=_0x9e87[_0x503e25];return _0x47c27a;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x79e8('0x0')]=function(_0x1facfe){return _0x1facfe['define'](_0x79e8('0x1'),attributes,{'tableName':_0x79e8('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x79e8('0x3')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 404b745..0f9a535 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 _0x3074=['randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x2424fa,_0x1d4322){var _0x294f68=function(_0x13da05){while(--_0x13da05){_0x2424fa['push'](_0x2424fa['shift']());}};_0x294f68(++_0x1d4322);}(_0x3074,0x1dd));var _0x4307=function(_0x4dc40f,_0x3012ff){_0x4dc40f=_0x4dc40f-0x0;var _0x525685=_0x3074[_0x4dc40f];return _0x525685;};'use strict';var _=require(_0x4307('0x0'));var util=require('util');var moment=require(_0x4307('0x1'));var BPromise=require(_0x4307('0x2'));var rs=require(_0x4307('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4307('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4307('0x5'))(_0x4307('0x6'));var config=require('../../config/environment');var jayson=require(_0x4307('0x7'));var client=jayson[_0x4307('0x8')][_0x4307('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x590bda,_0x4336a5,_0x14e01d){return new BPromise(function(_0x11663f,_0x188961){return client[_0x4307('0xa')](_0x590bda,_0x14e01d)[_0x4307('0xb')](function(_0x29b4c0){logger[_0x4307('0xc')](_0x4307('0xd'),_0x4336a5,'request\x20sent');logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x4336a5,_0x4307('0xe'),JSON['stringify'](_0x29b4c0));if(_0x29b4c0[_0x4307('0xf')]){if(_0x29b4c0[_0x4307('0xf')][_0x4307('0x10')]===0x1f4){logger[_0x4307('0xf')](_0x4307('0xd'),_0x4336a5,_0x29b4c0[_0x4307('0xf')][_0x4307('0x11')]);return _0x188961(_0x29b4c0[_0x4307('0xf')]['message']);}logger[_0x4307('0xf')](_0x4307('0xd'),_0x4336a5,_0x29b4c0[_0x4307('0xf')][_0x4307('0x11')]);return _0x11663f(_0x29b4c0['error'][_0x4307('0x11')]);}else{logger['info'](_0x4307('0xd'),_0x4336a5,'request\x20sent');_0x11663f(_0x29b4c0[_0x4307('0x12')][_0x4307('0x11')]);}})[_0x4307('0x13')](function(_0x2686ee){logger[_0x4307('0xf')](_0x4307('0xd'),_0x4336a5,_0x2686ee);_0x188961(_0x2686ee);});});}
\ No newline at end of file
+var _0x6922=['message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','debug','request\x20sent','stringify','error','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x59ee91,_0x5ca1ef){var _0x51b0b7=function(_0x55517f){while(--_0x55517f){_0x59ee91['push'](_0x59ee91['shift']());}};_0x51b0b7(++_0x5ca1ef);}(_0x6922,0x169));var _0x2692=function(_0x326a25,_0x15c086){_0x326a25=_0x326a25-0x0;var _0xe38041=_0x6922[_0x326a25];return _0xe38041;};'use strict';var _=require(_0x2692('0x0'));var util=require(_0x2692('0x1'));var moment=require(_0x2692('0x2'));var BPromise=require('bluebird');var rs=require(_0x2692('0x3'));var fs=require('fs');var Redis=require(_0x2692('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2692('0x5'));var logger=require('../../config/logger')(_0x2692('0x6'));var config=require(_0x2692('0x7'));var jayson=require(_0x2692('0x8'));var client=jayson[_0x2692('0x9')][_0x2692('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x537d30,_0xe04f91,_0x48be8b){return new BPromise(function(_0x2726b7,_0x510bff){return client[_0x2692('0xb')](_0x537d30,_0x48be8b)['then'](function(_0x560248){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0xe04f91,'request\x20sent');logger[_0x2692('0xc')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0xe04f91,_0x2692('0xd'),JSON[_0x2692('0xe')](_0x560248));if(_0x560248[_0x2692('0xf')]){if(_0x560248[_0x2692('0xf')]['code']===0x1f4){logger[_0x2692('0xf')](_0x2692('0x10'),_0xe04f91,_0x560248[_0x2692('0xf')][_0x2692('0x11')]);return _0x510bff(_0x560248[_0x2692('0xf')][_0x2692('0x11')]);}logger[_0x2692('0xf')](_0x2692('0x10'),_0xe04f91,_0x560248[_0x2692('0xf')][_0x2692('0x11')]);return _0x2726b7(_0x560248['error'][_0x2692('0x11')]);}else{logger[_0x2692('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0xe04f91,_0x2692('0xd'));_0x2726b7(_0x560248[_0x2692('0x13')][_0x2692('0x11')]);}})[_0x2692('0x14')](function(_0x5b1b0e){logger[_0x2692('0xf')](_0x2692('0x10'),_0xe04f91,_0x5b1b0e);_0x510bff(_0x5b1b0e);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index e6d8a7d..d5130f3 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 _0xf11a=['connect-timeout','express','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','get','/describe','/:id','post','create','multer','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf11a,0x19e));var _0xaf11=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xf11a[_0x13b8f3];return _0x1a6d06;};'use strict';var multer=require(_0xaf11('0x0'));var util=require('util');var path=require(_0xaf11('0x1'));var timeout=require(_0xaf11('0x2'));var express=require(_0xaf11('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xaf11('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xaf11('0x5'));var controller=require(_0xaf11('0x6'));router['get']('/',auth[_0xaf11('0x7')](),controller['index']);router[_0xaf11('0x8')](_0xaf11('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xaf11('0x8')](_0xaf11('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xaf11('0xb')]('/',auth[_0xaf11('0x7')](),controller[_0xaf11('0xc')]);router['put'](_0xaf11('0xa'),auth[_0xaf11('0x7')](),controller['update']);router['delete'](_0xaf11('0xa'),auth[_0xaf11('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x0070=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put'];(function(_0xf02b64,_0x5e76fc){var _0x334b5f=function(_0x1e9650){while(--_0x1e9650){_0xf02b64['push'](_0xf02b64['shift']());}};_0x334b5f(++_0x5e76fc);}(_0x0070,0xb4));var _0x0007=function(_0x505b1,_0x3f2a5d){_0x505b1=_0x505b1-0x0;var _0x6f5380=_0x0070[_0x505b1];return _0x6f5380;};'use strict';var multer=require(_0x0007('0x0'));var util=require(_0x0007('0x1'));var path=require(_0x0007('0x2'));var timeout=require(_0x0007('0x3'));var express=require(_0x0007('0x4'));var router=express[_0x0007('0x5')]();var fs_extra=require(_0x0007('0x6'));var auth=require(_0x0007('0x7'));var interaction=require(_0x0007('0x8'));var config=require(_0x0007('0x9'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0x0007('0xa')](),controller[_0x0007('0xb')]);router[_0x0007('0xc')]('/describe',auth[_0x0007('0xa')](),controller['describe']);router['get'](_0x0007('0xd'),auth[_0x0007('0xa')](),controller[_0x0007('0xe')]);router[_0x0007('0xf')]('/',auth[_0x0007('0xa')](),controller[_0x0007('0x10')]);router[_0x0007('0x11')](_0x0007('0xd'),auth[_0x0007('0xa')](),controller[_0x0007('0x12')]);router[_0x0007('0x13')](_0x0007('0xd'),auth[_0x0007('0xa')](),controller[_0x0007('0x14')]);module[_0x0007('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 11a3794..5a8b23b 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 _0x2340=['timeout','INTEGER','sequelize','exports','STRING','mouseOver'];(function(_0x40bb52,_0x37660c){var _0x1f926c=function(_0x37a6a1){while(--_0x37a6a1){_0x40bb52['push'](_0x40bb52['shift']());}};_0x1f926c(++_0x37660c);}(_0x2340,0x158));var _0x0234=function(_0x1e2742,_0x1baf4f){_0x1e2742=_0x1e2742-0x0;var _0xfe90f8=_0x2340[_0x1e2742];return _0xfe90f8;};'use strict';var Sequelize=require(_0x0234('0x0'));module[_0x0234('0x1')]={'name':{'type':Sequelize[_0x0234('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0234('0x3'),_0x0234('0x4')),'defaultValue':_0x0234('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0234('0x5')]}};
\ No newline at end of file
+var _0x30a1=['sequelize','exports','STRING','mouseOver','timeout'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x30a1,0x1bd));var _0x130a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x30a1[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x130a('0x0'));module[_0x130a('0x1')]={'name':{'type':Sequelize[_0x130a('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x130a('0x3'),_0x130a('0x4')),'defaultValue':_0x130a('0x3')},'selector':{'type':Sequelize[_0x130a('0x2')]},'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 118874d..f391dea 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.controller.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7579=['desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto'];(function(_0xae1a83,_0x1980d4){var _0xdb9da8=function(_0x36fc99){while(--_0x36fc99){_0xae1a83['push'](_0xae1a83['shift']());}};_0xdb9da8(++_0x1980d4);}(_0x7579,0x1e2));var _0x9757=function(_0x1d0da5,_0x429318){_0x1d0da5=_0x1d0da5-0x0;var _0x57744a=_0x7579[_0x1d0da5];return _0x57744a;};'use strict';var emlformat=require(_0x9757('0x0'));var rimraf=require(_0x9757('0x1'));var zipdir=require(_0x9757('0x2'));var jsonpatch=require(_0x9757('0x3'));var rp=require(_0x9757('0x4'));var moment=require(_0x9757('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9757('0x6'));var util=require(_0x9757('0x7'));var path=require(_0x9757('0x8'));var sox=require(_0x9757('0x9'));var csv=require('to-csv');var ejs=require(_0x9757('0xa'));var fs=require('fs');var fs_extra=require(_0x9757('0xb'));var _=require(_0x9757('0xc'));var squel=require('squel');var crypto=require(_0x9757('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9757('0xe'));var toCsv=require(_0x9757('0xf'));var querystring=require(_0x9757('0x10'));var Papa=require('papaparse');var Redis=require(_0x9757('0x11'));var authService=require(_0x9757('0x12'));var qs=require(_0x9757('0x13'));var as=require(_0x9757('0x14'));var hardwareService=require(_0x9757('0x15'));var logger=require(_0x9757('0x16'))(_0x9757('0x17'));var utils=require(_0x9757('0x18'));var config=require(_0x9757('0x19'));var licenseUtil=require(_0x9757('0x1a'));var db=require(_0x9757('0x1b'))['db'];function respondWithStatusCode(_0x5c19c9,_0x2f2200){_0x2f2200=_0x2f2200||0xcc;return function(_0x1d32ee){if(_0x1d32ee){return _0x5c19c9[_0x9757('0x1c')](_0x2f2200);}return _0x5c19c9['status'](_0x2f2200)[_0x9757('0x1d')]();};}function respondWithResult(_0x39fa5c,_0x413d55){_0x413d55=_0x413d55||0xc8;return function(_0x14f67c){if(_0x14f67c){return _0x39fa5c[_0x9757('0x1e')](_0x413d55)[_0x9757('0x1f')](_0x14f67c);}};}function respondWithFilteredResult(_0x105e56,_0x4b994d){return function(_0x1fd6f6){if(_0x1fd6f6){var _0x55ded7=typeof _0x4b994d[_0x9757('0x20')]===_0x9757('0x21')&&typeof _0x4b994d[_0x9757('0x22')]===_0x9757('0x21');var _0x3f6be9=_0x1fd6f6[_0x9757('0x23')];var _0x57e309=_0x55ded7?0x0:_0x4b994d[_0x9757('0x20')];var _0x2aa360=_0x55ded7?_0x1fd6f6[_0x9757('0x23')]:_0x4b994d[_0x9757('0x20')]+_0x4b994d[_0x9757('0x22')];var _0xd2306b;if(_0x2aa360>=_0x3f6be9){_0x2aa360=_0x3f6be9;_0xd2306b=0xc8;}else{_0xd2306b=0xce;}_0x105e56[_0x9757('0x1e')](_0xd2306b);return _0x105e56['set'](_0x9757('0x24'),_0x57e309+'-'+_0x2aa360+'/'+_0x3f6be9)['json'](_0x1fd6f6);}return null;};}function patchUpdates(_0x517504){return function(_0x37c889){try{jsonpatch[_0x9757('0x25')](_0x37c889,_0x517504,!![]);}catch(_0x1443a9){return BPromise[_0x9757('0x26')](_0x1443a9);}return _0x37c889['save']();};}function saveUpdates(_0x4ef000,_0x53d21c){return function(_0x73dac4){if(_0x73dac4){return _0x73dac4[_0x9757('0x27')](_0x4ef000)[_0x9757('0x28')](function(_0x21435e){return _0x21435e;});}return null;};}function removeEntity(_0x5dc2fa,_0x11f5ac){return function(_0x160108){if(_0x160108){return _0x160108['destroy']()[_0x9757('0x28')](function(){_0x5dc2fa[_0x9757('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b6915,_0x1a7036){return function(_0x172e8c){if(!_0x172e8c){_0x2b6915[_0x9757('0x1c')](0x194);}return _0x172e8c;};}function handleError(_0x115e33,_0x19588f){_0x19588f=_0x19588f||0x1f4;return function(_0x4e6b86){logger[_0x9757('0x29')](_0x4e6b86['stack']);if(_0x4e6b86[_0x9757('0x2a')]){delete _0x4e6b86[_0x9757('0x2a')];}_0x115e33['status'](_0x19588f)['send'](_0x4e6b86);};}exports[_0x9757('0x2b')]=function(_0x21a4bd,_0xc81976){var _0x3aae8b={'raw':!![],'where':{'id':_0x21a4bd[_0x9757('0x2c')]['id']}},_0x4ebdb6={};_0x4ebdb6[_0x9757('0x2d')]=_[_0x9757('0x2e')](db[_0x9757('0x2f')][_0x9757('0x30')]);_0x4ebdb6[_0x9757('0x31')]=_['keys'](_0x21a4bd[_0x9757('0x31')]);_0x4ebdb6[_0x9757('0x32')]=_[_0x9757('0x33')](_0x4ebdb6[_0x9757('0x2d')],_0x4ebdb6[_0x9757('0x31')]);_0x3aae8b[_0x9757('0x34')]=_[_0x9757('0x33')](_0x4ebdb6['model'],qs[_0x9757('0x35')](_0x21a4bd[_0x9757('0x31')][_0x9757('0x35')]));_0x3aae8b[_0x9757('0x34')]=_0x3aae8b[_0x9757('0x34')][_0x9757('0x36')]?_0x3aae8b[_0x9757('0x34')]:_0x4ebdb6[_0x9757('0x2d')];if(_0x21a4bd['query'][_0x9757('0x37')]){_0x3aae8b['include']=[{'all':!![]}];}_0x3aae8b=_[_0x9757('0x38')]({},_0x3aae8b,_0x21a4bd[_0x9757('0x39')]);return db['ChatProactiveAction'][_0x9757('0x3a')](_0x3aae8b)[_0x9757('0x28')](handleEntityNotFound(_0xc81976,null))[_0x9757('0x28')](respondWithResult(_0xc81976,null))[_0x9757('0x3b')](handleError(_0xc81976,null));};exports[_0x9757('0x3c')]=function(_0x2f2688,_0x3c94b2){return db[_0x9757('0x2f')][_0x9757('0x3c')](_0x2f2688[_0x9757('0x3d')],{})['then'](respondWithResult(_0x3c94b2,0xc9))[_0x9757('0x3b')](handleError(_0x3c94b2,null));};exports[_0x9757('0x27')]=function(_0x457d6c,_0x4f2ea4){if(_0x457d6c[_0x9757('0x3d')]['id']){delete _0x457d6c[_0x9757('0x3d')]['id'];}return db[_0x9757('0x2f')][_0x9757('0x3a')]({'where':{'id':_0x457d6c[_0x9757('0x2c')]['id']}})[_0x9757('0x28')](handleEntityNotFound(_0x4f2ea4,null))[_0x9757('0x28')](saveUpdates(_0x457d6c[_0x9757('0x3d')],null))[_0x9757('0x28')](respondWithResult(_0x4f2ea4,null))['catch'](handleError(_0x4f2ea4,null));};exports['destroy']=function(_0x2cf830,_0x2d0a6e){return db[_0x9757('0x2f')][_0x9757('0x3a')]({'where':{'id':_0x2cf830['params']['id']}})[_0x9757('0x28')](handleEntityNotFound(_0x2d0a6e,null))['then'](removeEntity(_0x2d0a6e,null))[_0x9757('0x3b')](handleError(_0x2d0a6e,null));};
\ No newline at end of file
+var _0x3351=['attributes','length','include','options','find','create','body','catch','params','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','json','reject','save','then','destroy','error','stack','name','send','show','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','fields'];(function(_0x5983c7,_0x415ba8){var _0x555815=function(_0x193cc2){while(--_0x193cc2){_0x5983c7['push'](_0x5983c7['shift']());}};_0x555815(++_0x415ba8);}(_0x3351,0x1b4));var _0x1335=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x3351[_0x1ddedd];return _0xa3e1ac;};'use strict';var emlformat=require(_0x1335('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1335('0x1'));var rp=require(_0x1335('0x2'));var moment=require(_0x1335('0x3'));var BPromise=require(_0x1335('0x4'));var Mustache=require(_0x1335('0x5'));var util=require(_0x1335('0x6'));var path=require(_0x1335('0x7'));var sox=require('sox');var csv=require(_0x1335('0x8'));var ejs=require(_0x1335('0x9'));var fs=require('fs');var fs_extra=require(_0x1335('0xa'));var _=require(_0x1335('0xb'));var squel=require(_0x1335('0xc'));var crypto=require(_0x1335('0xd'));var jsforce=require(_0x1335('0xe'));var deskjs=require(_0x1335('0xf'));var toCsv=require(_0x1335('0x8'));var querystring=require(_0x1335('0x10'));var Papa=require(_0x1335('0x11'));var Redis=require('ioredis');var authService=require(_0x1335('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1335('0x13'));var hardwareService=require(_0x1335('0x14'));var logger=require(_0x1335('0x15'))(_0x1335('0x16'));var utils=require(_0x1335('0x17'));var config=require(_0x1335('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1335('0x19'))['db'];function respondWithStatusCode(_0x55a85e,_0x425cd8){_0x425cd8=_0x425cd8||0xcc;return function(_0x5699f4){if(_0x5699f4){return _0x55a85e[_0x1335('0x1a')](_0x425cd8);}return _0x55a85e['status'](_0x425cd8)[_0x1335('0x1b')]();};}function respondWithResult(_0x4c8964,_0x4f9625){_0x4f9625=_0x4f9625||0xc8;return function(_0xc333ce){if(_0xc333ce){return _0x4c8964[_0x1335('0x1c')](_0x4f9625)['json'](_0xc333ce);}};}function respondWithFilteredResult(_0x5ee59d,_0x3bd6b0){return function(_0x565686){if(_0x565686){var _0x431433=typeof _0x3bd6b0[_0x1335('0x1d')]===_0x1335('0x1e')&&typeof _0x3bd6b0['limit']===_0x1335('0x1e');var _0x4da3b8=_0x565686[_0x1335('0x1f')];var _0x4d5b17=_0x431433?0x0:_0x3bd6b0[_0x1335('0x1d')];var _0x36123c=_0x431433?_0x565686[_0x1335('0x1f')]:_0x3bd6b0['offset']+_0x3bd6b0[_0x1335('0x20')];var _0xbebdea;if(_0x36123c>=_0x4da3b8){_0x36123c=_0x4da3b8;_0xbebdea=0xc8;}else{_0xbebdea=0xce;}_0x5ee59d[_0x1335('0x1c')](_0xbebdea);return _0x5ee59d[_0x1335('0x21')]('Content-Range',_0x4d5b17+'-'+_0x36123c+'/'+_0x4da3b8)[_0x1335('0x22')](_0x565686);}return null;};}function patchUpdates(_0x4ae091){return function(_0x5c10d3){try{jsonpatch['apply'](_0x5c10d3,_0x4ae091,!![]);}catch(_0x12e01b){return BPromise[_0x1335('0x23')](_0x12e01b);}return _0x5c10d3[_0x1335('0x24')]();};}function saveUpdates(_0x5c4c24,_0x4c01c9){return function(_0x25aacb){if(_0x25aacb){return _0x25aacb['update'](_0x5c4c24)[_0x1335('0x25')](function(_0x47eaa7){return _0x47eaa7;});}return null;};}function removeEntity(_0x35432b,_0x1c13a8){return function(_0x383d19){if(_0x383d19){return _0x383d19[_0x1335('0x26')]()[_0x1335('0x25')](function(){_0x35432b[_0x1335('0x1c')](0xcc)[_0x1335('0x1b')]();});}};}function handleEntityNotFound(_0x48a0f9,_0x37efee){return function(_0x26ba20){if(!_0x26ba20){_0x48a0f9[_0x1335('0x1a')](0x194);}return _0x26ba20;};}function handleError(_0x1e0019,_0x4cf375){_0x4cf375=_0x4cf375||0x1f4;return function(_0x1498e6){logger[_0x1335('0x27')](_0x1498e6[_0x1335('0x28')]);if(_0x1498e6[_0x1335('0x29')]){delete _0x1498e6[_0x1335('0x29')];}_0x1e0019[_0x1335('0x1c')](_0x4cf375)[_0x1335('0x2a')](_0x1498e6);};}exports[_0x1335('0x2b')]=function(_0x23b5cc,_0xdc07ab){var _0x233298={'raw':!![],'where':{'id':_0x23b5cc['params']['id']}},_0x19950c={};_0x19950c[_0x1335('0x2c')]=_['keys'](db[_0x1335('0x2d')][_0x1335('0x2e')]);_0x19950c[_0x1335('0x2f')]=_[_0x1335('0x30')](_0x23b5cc['query']);_0x19950c[_0x1335('0x31')]=_[_0x1335('0x32')](_0x19950c[_0x1335('0x2c')],_0x19950c[_0x1335('0x2f')]);_0x233298['attributes']=_[_0x1335('0x32')](_0x19950c[_0x1335('0x2c')],qs[_0x1335('0x33')](_0x23b5cc[_0x1335('0x2f')][_0x1335('0x33')]));_0x233298[_0x1335('0x34')]=_0x233298['attributes'][_0x1335('0x35')]?_0x233298[_0x1335('0x34')]:_0x19950c[_0x1335('0x2c')];if(_0x23b5cc[_0x1335('0x2f')]['includeAll']){_0x233298[_0x1335('0x36')]=[{'all':!![]}];}_0x233298=_['merge']({},_0x233298,_0x23b5cc[_0x1335('0x37')]);return db['ChatProactiveAction'][_0x1335('0x38')](_0x233298)[_0x1335('0x25')](handleEntityNotFound(_0xdc07ab,null))[_0x1335('0x25')](respondWithResult(_0xdc07ab,null))['catch'](handleError(_0xdc07ab,null));};exports[_0x1335('0x39')]=function(_0x5f311e,_0x3b82be){return db[_0x1335('0x2d')][_0x1335('0x39')](_0x5f311e[_0x1335('0x3a')],{})[_0x1335('0x25')](respondWithResult(_0x3b82be,0xc9))[_0x1335('0x3b')](handleError(_0x3b82be,null));};exports['update']=function(_0x31be79,_0x213815){if(_0x31be79[_0x1335('0x3a')]['id']){delete _0x31be79['body']['id'];}return db[_0x1335('0x2d')]['find']({'where':{'id':_0x31be79[_0x1335('0x3c')]['id']}})['then'](handleEntityNotFound(_0x213815,null))[_0x1335('0x25')](saveUpdates(_0x31be79[_0x1335('0x3a')],null))['then'](respondWithResult(_0x213815,null))[_0x1335('0x3b')](handleError(_0x213815,null));};exports[_0x1335('0x26')]=function(_0x524252,_0x21f5bb){return db[_0x1335('0x2d')][_0x1335('0x38')]({'where':{'id':_0x524252[_0x1335('0x3c')]['id']}})['then'](handleEntityNotFound(_0x21f5bb,null))[_0x1335('0x25')](removeEntity(_0x21f5bb,null))[_0x1335('0x3b')](handleError(_0x21f5bb,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 7f6606f..2ced68b 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 _0x708f=['moment','bluebird','request-promise','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x708f,0x17c));var _0xf708=function(_0x5772df,_0x635fec){_0x5772df=_0x5772df-0x0;var _0x1332d0=_0x708f[_0x5772df];return _0x1332d0;};'use strict';var _=require(_0xf708('0x0'));var util=require(_0xf708('0x1'));var logger=require(_0xf708('0x2'))(_0xf708('0x3'));var moment=require(_0xf708('0x4'));var BPromise=require(_0xf708('0x5'));var rp=require(_0xf708('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf708('0x7'));var attributes=require(_0xf708('0x8'));module[_0xf708('0x9')]=function(_0x5284a8,_0x407166){return _0x5284a8['define'](_0xf708('0xa'),attributes,{'tableName':_0xf708('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x63cd=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','lodash','util'];(function(_0x546e3b,_0x1d6b2b){var _0x331189=function(_0x1458ca){while(--_0x1458ca){_0x546e3b['push'](_0x546e3b['shift']());}};_0x331189(++_0x1d6b2b);}(_0x63cd,0x166));var _0xd63c=function(_0x8ebbc2,_0xab414a){_0x8ebbc2=_0x8ebbc2-0x0;var _0x2fc072=_0x63cd[_0x8ebbc2];return _0x2fc072;};'use strict';var _=require(_0xd63c('0x0'));var util=require(_0xd63c('0x1'));var logger=require(_0xd63c('0x2'))(_0xd63c('0x3'));var moment=require(_0xd63c('0x4'));var BPromise=require(_0xd63c('0x5'));var rp=require(_0xd63c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd63c('0x7'));var config=require(_0xd63c('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0xd63c('0x9')]=function(_0x976082,_0x4005c0){return _0x976082['define']('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','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 fd469ed..ab5aba6 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 _0x69dc=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','error','message','result','catch','util','moment','bluebird'];(function(_0x2fb87c,_0x2dee49){var _0x43038b=function(_0x7e5396){while(--_0x7e5396){_0x2fb87c['push'](_0x2fb87c['shift']());}};_0x43038b(++_0x2dee49);}(_0x69dc,0x9d));var _0xc69d=function(_0x6621b7,_0x6010df){_0x6621b7=_0x6621b7-0x0;var _0x1c197b=_0x69dc[_0x6621b7];return _0x1c197b;};'use strict';var _=require('lodash');var util=require(_0xc69d('0x0'));var moment=require(_0xc69d('0x1'));var BPromise=require(_0xc69d('0x2'));var rs=require(_0xc69d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc69d('0x4'))['db'];var utils=require(_0xc69d('0x5'));var logger=require(_0xc69d('0x6'))(_0xc69d('0x7'));var config=require('../../config/environment');var jayson=require(_0xc69d('0x8'));var client=jayson[_0xc69d('0x9')][_0xc69d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdfaa,_0x4b37db,_0x3f2b53){return new BPromise(function(_0x34801f,_0x4e07a7){return client[_0xc69d('0xb')](_0x3cdfaa,_0x3f2b53)[_0xc69d('0xc')](function(_0x109a2b){logger[_0xc69d('0xd')](_0xc69d('0xe'),_0x4b37db,'request\x20sent');logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4b37db,_0xc69d('0xf'),JSON['stringify'](_0x109a2b));if(_0x109a2b[_0xc69d('0x10')]){if(_0x109a2b['error']['code']===0x1f4){logger[_0xc69d('0x10')](_0xc69d('0xe'),_0x4b37db,_0x109a2b['error'][_0xc69d('0x11')]);return _0x4e07a7(_0x109a2b[_0xc69d('0x10')][_0xc69d('0x11')]);}logger[_0xc69d('0x10')](_0xc69d('0xe'),_0x4b37db,_0x109a2b[_0xc69d('0x10')][_0xc69d('0x11')]);return _0x34801f(_0x109a2b['error'][_0xc69d('0x11')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x4b37db,'request\x20sent');_0x34801f(_0x109a2b[_0xc69d('0x12')][_0xc69d('0x11')]);}})[_0xc69d('0x13')](function(_0x3cbeae){logger[_0xc69d('0x10')](_0xc69d('0xe'),_0x4b37db,_0x3cbeae);_0x4e07a7(_0x3cbeae);});});}
\ No newline at end of file
+var _0x4012=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment'];(function(_0x516738,_0x1e0210){var _0x5f5d4d=function(_0x5a061e){while(--_0x5a061e){_0x516738['push'](_0x516738['shift']());}};_0x5f5d4d(++_0x1e0210);}(_0x4012,0xd6));var _0x2401=function(_0x130c86,_0x18bb4e){_0x130c86=_0x130c86-0x0;var _0x4f673d=_0x4012[_0x130c86];return _0x4f673d;};'use strict';var _=require(_0x2401('0x0'));var util=require('util');var moment=require(_0x2401('0x1'));var BPromise=require(_0x2401('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2401('0x3'));var db=require(_0x2401('0x4'))['db'];var utils=require(_0x2401('0x5'));var logger=require(_0x2401('0x6'))(_0x2401('0x7'));var config=require(_0x2401('0x8'));var jayson=require(_0x2401('0x9'));var client=jayson[_0x2401('0xa')][_0x2401('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x85f35f,_0x184814,_0x245b35){return new BPromise(function(_0x267711,_0x1fb21f){return client[_0x2401('0xc')](_0x85f35f,_0x245b35)[_0x2401('0xd')](function(_0x4e621c){logger['info'](_0x2401('0xe'),_0x184814,'request\x20sent');logger['debug'](_0x2401('0xf'),_0x184814,_0x2401('0x10'),JSON[_0x2401('0x11')](_0x4e621c));if(_0x4e621c[_0x2401('0x12')]){if(_0x4e621c[_0x2401('0x12')][_0x2401('0x13')]===0x1f4){logger[_0x2401('0x12')](_0x2401('0xe'),_0x184814,_0x4e621c[_0x2401('0x12')]['message']);return _0x1fb21f(_0x4e621c[_0x2401('0x12')][_0x2401('0x14')]);}logger[_0x2401('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x184814,_0x4e621c[_0x2401('0x12')]['message']);return _0x267711(_0x4e621c[_0x2401('0x12')][_0x2401('0x14')]);}else{logger[_0x2401('0x15')]('ChatProactiveAction,\x20%s,\x20%s',_0x184814,_0x2401('0x10'));_0x267711(_0x4e621c[_0x2401('0x16')][_0x2401('0x14')]);}})[_0x2401('0x17')](function(_0x2fcca1){logger[_0x2401('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x184814,_0x2fcca1);_0x1fb21f(_0x2fcca1);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index b79489c..a28ad93 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 _0x53ec=['create','put','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','/:id','show','post'];(function(_0x68b040,_0x263ba9){var _0x269f90=function(_0x5c6b1f){while(--_0x5c6b1f){_0x68b040['push'](_0x68b040['shift']());}};_0x269f90(++_0x263ba9);}(_0x53ec,0x192));var _0xc53e=function(_0x349080,_0x485b71){_0x349080=_0x349080-0x0;var _0x1ef849=_0x53ec[_0x349080];return _0x1ef849;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get'](_0xc53e('0x9'),auth['isAuthenticated'](),controller[_0xc53e('0xa')]);router[_0xc53e('0xb')]('/',auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xd')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0xf')]);router[_0xc53e('0x10')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x2bd8=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','exports'];(function(_0xffa198,_0x5a8940){var _0x1e4b50=function(_0x1f1c43){while(--_0x1f1c43){_0xffa198['push'](_0xffa198['shift']());}};_0x1e4b50(++_0x5a8940);}(_0x2bd8,0x130));var _0x82bd=function(_0x3c4c6a,_0x5802dc){_0x3c4c6a=_0x3c4c6a-0x0;var _0x123872=_0x2bd8[_0x3c4c6a];return _0x123872;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var fs_extra=require(_0x82bd('0x5'));var auth=require(_0x82bd('0x6'));var interaction=require(_0x82bd('0x7'));var config=require('../../config/environment');var controller=require(_0x82bd('0x8'));router[_0x82bd('0x9')](_0x82bd('0xa'),auth['isAuthenticated'](),controller[_0x82bd('0xb')]);router[_0x82bd('0xc')]('/',auth[_0x82bd('0xd')](),controller[_0x82bd('0xe')]);router['put'](_0x82bd('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x82bd('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x82bd('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 75963b9..0f15505 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 _0x894d=['ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0x15ebc8,_0x4b05af){var _0x29f88a=function(_0x5ec0ce){while(--_0x5ec0ce){_0x15ebc8['push'](_0x15ebc8['shift']());}};_0x29f88a(++_0x4b05af);}(_0x894d,0xd4));var _0xd894=function(_0x5cec18,_0x34d5ea){_0x5cec18=_0x5cec18-0x0;var _0x4b878f=_0x894d[_0x5cec18];return _0x4b878f;};'use strict';var Sequelize=require(_0xd894('0x0'));module['exports']={'name':{'type':Sequelize[_0xd894('0x1')],'unique':_0xd894('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd894('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd894('0x4')](_0xd894('0x5'),_0xd894('0x6'),_0xd894('0x7'))}};
\ No newline at end of file
+var _0x9dd0=['ENUM','beepall','exports','STRING','INTEGER'];(function(_0x208c57,_0x3182e5){var _0x1dda31=function(_0x49e35c){while(--_0x49e35c){_0x208c57['push'](_0x208c57['shift']());}};_0x1dda31(++_0x3182e5);}(_0x9dd0,0x7f));var _0x09dd=function(_0x23c31d,_0x2e8382){_0x23c31d=_0x23c31d-0x0;var _0x4c8e11=_0x9dd0[_0x23c31d];return _0x4c8e11;};'use strict';var Sequelize=require('sequelize');module[_0x09dd('0x0')]={'name':{'type':Sequelize[_0x09dd('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x09dd('0x1')]},'timeout':{'type':Sequelize[_0x09dd('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x09dd('0x3')]('rrmemory',_0x09dd('0x4'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 979fcdf..b57cae4 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 _0x6bc4=['nolimit','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','ChatQueues','UserProfileSection','find','userProfileId','autoAssociation','params','describe','getMembers','UserChatQueue','ChatQueueId','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','order','addTeams','ids','User','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','end','status','json','limit','count','offset','apply','reject','save','update','destroy','sendStatus','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x2fe9aa,_0x4748a5){var _0x264200=function(_0x27d8ce){while(--_0x27d8ce){_0x2fe9aa['push'](_0x2fe9aa['shift']());}};_0x264200(++_0x4748a5);}(_0x6bc4,0xe0));var _0x46bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6bc4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x46bc('0x0'));var rimraf=require(_0x46bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46bc('0x2'));var rp=require(_0x46bc('0x3'));var moment=require(_0x46bc('0x4'));var BPromise=require(_0x46bc('0x5'));var Mustache=require(_0x46bc('0x6'));var util=require(_0x46bc('0x7'));var path=require(_0x46bc('0x8'));var sox=require('sox');var csv=require(_0x46bc('0x9'));var ejs=require(_0x46bc('0xa'));var fs=require('fs');var fs_extra=require(_0x46bc('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x46bc('0xc'));var toCsv=require('to-csv');var querystring=require(_0x46bc('0xd'));var Papa=require(_0x46bc('0xe'));var Redis=require(_0x46bc('0xf'));var authService=require(_0x46bc('0x10'));var qs=require(_0x46bc('0x11'));var as=require(_0x46bc('0x12'));var hardwareService=require(_0x46bc('0x13'));var logger=require('../../config/logger')(_0x46bc('0x14'));var utils=require(_0x46bc('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x46bc('0x16'));var db=require('../../mysqldb')['db'];config[_0x46bc('0x17')]=_[_0x46bc('0x18')](config[_0x46bc('0x17')],{'host':_0x46bc('0x19'),'port':0x18eb});var socket=require(_0x46bc('0x1a'))(new Redis(config['redis']));require('./chatQueue.socket')['register'](socket);var jayson=require(_0x46bc('0x1b'));var client=jayson[_0x46bc('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x420d1f,_0x205c52,_0x4ee72b,_0x242172){return new BPromise(function(_0x402344,_0x52cf48){var _0x4067e3=_0x242172||client;return _0x4067e3[_0x46bc('0x1d')](_0x420d1f,_0x4ee72b)[_0x46bc('0x1e')](function(_0x10d311){logger['info'](_0x46bc('0x1f'),_0x205c52,_0x46bc('0x20'));logger[_0x46bc('0x21')](_0x46bc('0x22'),_0x205c52,_0x46bc('0x20'),JSON['stringify'](_0x10d311));if(_0x10d311['error']){if(_0x10d311[_0x46bc('0x23')][_0x46bc('0x24')]===0x1f4){logger[_0x46bc('0x23')]('ChatQueue,\x20%s,\x20%s',_0x205c52,_0x10d311[_0x46bc('0x23')][_0x46bc('0x25')]);return _0x52cf48(_0x10d311[_0x46bc('0x23')]['message']);}logger[_0x46bc('0x23')]('ChatQueue,\x20%s,\x20%s',_0x205c52,_0x10d311[_0x46bc('0x23')][_0x46bc('0x25')]);return _0x402344(_0x10d311['error'][_0x46bc('0x25')]);}else{logger[_0x46bc('0x26')](_0x46bc('0x1f'),_0x205c52,_0x46bc('0x20'));_0x402344(_0x10d311[_0x46bc('0x27')][_0x46bc('0x25')]);}})[_0x46bc('0x28')](function(_0x3e2c8b){logger['error'](_0x46bc('0x1f'),_0x205c52,_0x3e2c8b);_0x52cf48(_0x3e2c8b);});});}function respondWithStatusCode(_0x27456c,_0x4709e1){_0x4709e1=_0x4709e1||0xcc;return function(_0x2d7842){if(_0x2d7842){return _0x27456c['sendStatus'](_0x4709e1);}return _0x27456c['status'](_0x4709e1)[_0x46bc('0x29')]();};}function respondWithResult(_0x4b7388,_0x49abee){_0x49abee=_0x49abee||0xc8;return function(_0x5b73b9){if(_0x5b73b9){return _0x4b7388[_0x46bc('0x2a')](_0x49abee)[_0x46bc('0x2b')](_0x5b73b9);}};}function respondWithFilteredResult(_0x57f56a,_0x339b37){return function(_0x4a7863){if(_0x4a7863){var _0xdcd17a=typeof _0x339b37['offset']==='undefined'&&typeof _0x339b37[_0x46bc('0x2c')]==='undefined';var _0x1d7cb4=_0x4a7863[_0x46bc('0x2d')];var _0x1a0eae=_0xdcd17a?0x0:_0x339b37[_0x46bc('0x2e')];var _0x295e9b=_0xdcd17a?_0x4a7863[_0x46bc('0x2d')]:_0x339b37[_0x46bc('0x2e')]+_0x339b37['limit'];var _0x46a9dd;if(_0x295e9b>=_0x1d7cb4){_0x295e9b=_0x1d7cb4;_0x46a9dd=0xc8;}else{_0x46a9dd=0xce;}_0x57f56a[_0x46bc('0x2a')](_0x46a9dd);return _0x57f56a['set']('Content-Range',_0x1a0eae+'-'+_0x295e9b+'/'+_0x1d7cb4)[_0x46bc('0x2b')](_0x4a7863);}return null;};}function patchUpdates(_0x3f975f){return function(_0x136f5a){try{jsonpatch[_0x46bc('0x2f')](_0x136f5a,_0x3f975f,!![]);}catch(_0x1764f4){return BPromise[_0x46bc('0x30')](_0x1764f4);}return _0x136f5a[_0x46bc('0x31')]();};}function saveUpdates(_0x1e8772,_0x165b23){return function(_0x4083e6){if(_0x4083e6){return _0x4083e6[_0x46bc('0x32')](_0x1e8772)[_0x46bc('0x1e')](function(_0x5597e0){return _0x5597e0;});}return null;};}function removeEntity(_0x15e55c,_0x2aa9ae){return function(_0x47521c){if(_0x47521c){return _0x47521c[_0x46bc('0x33')]()['then'](function(){var _0x5701d7=_0x47521c['get']({'plain':!![]});var _0x4540da='ChatQueues';return db['UserProfileResource'][_0x46bc('0x33')]({'where':{'type':_0x4540da,'resourceId':_0x5701d7['id']}})[_0x46bc('0x1e')](function(){return _0x47521c;});})['then'](function(){_0x15e55c[_0x46bc('0x2a')](0xcc)[_0x46bc('0x29')]();});}};}function handleEntityNotFound(_0xb32f11,_0x5cb6d5){return function(_0x4d97e8){if(!_0x4d97e8){_0xb32f11[_0x46bc('0x34')](0x194);}return _0x4d97e8;};}function handleError(_0x1ec686,_0x2cbcc6){_0x2cbcc6=_0x2cbcc6||0x1f4;return function(_0x51aa30){logger[_0x46bc('0x23')](_0x51aa30['stack']);if(_0x51aa30[_0x46bc('0x35')]){delete _0x51aa30[_0x46bc('0x35')];}_0x1ec686[_0x46bc('0x2a')](_0x2cbcc6)[_0x46bc('0x36')](_0x51aa30);};}exports[_0x46bc('0x37')]=function(_0x3c4ade,_0x260ce7){var _0xbb6d7e={},_0x1201a5={},_0x4fa5e0={'count':0x0,'rows':[]};var _0x90c225=_['map'](db[_0x46bc('0x38')][_0x46bc('0x39')],function(_0x204503){return{'name':_0x204503[_0x46bc('0x3a')],'type':_0x204503[_0x46bc('0x3b')][_0x46bc('0x3c')]};});_0x1201a5[_0x46bc('0x3d')]=_['map'](_0x90c225,_0x46bc('0x35'));_0x1201a5['query']=_[_0x46bc('0x3e')](_0x3c4ade[_0x46bc('0x3f')]);_0x1201a5[_0x46bc('0x40')]=_[_0x46bc('0x41')](_0x1201a5[_0x46bc('0x3d')],_0x1201a5[_0x46bc('0x3f')]);_0xbb6d7e[_0x46bc('0x42')]=_['intersection'](_0x1201a5[_0x46bc('0x3d')],qs['fields'](_0x3c4ade[_0x46bc('0x3f')][_0x46bc('0x43')]));_0xbb6d7e[_0x46bc('0x42')]=_0xbb6d7e[_0x46bc('0x42')][_0x46bc('0x44')]?_0xbb6d7e[_0x46bc('0x42')]:_0x1201a5[_0x46bc('0x3d')];if(!_0x3c4ade[_0x46bc('0x3f')][_0x46bc('0x45')](_0x46bc('0x46'))){_0xbb6d7e[_0x46bc('0x2c')]=qs[_0x46bc('0x2c')](_0x3c4ade['query'][_0x46bc('0x2c')]);_0xbb6d7e['offset']=qs[_0x46bc('0x2e')](_0x3c4ade[_0x46bc('0x3f')][_0x46bc('0x2e')]);}_0xbb6d7e['order']=qs[_0x46bc('0x47')](_0x3c4ade[_0x46bc('0x3f')]['sort']);_0xbb6d7e[_0x46bc('0x48')]=qs[_0x46bc('0x40')](_[_0x46bc('0x49')](_0x3c4ade[_0x46bc('0x3f')],_0x1201a5[_0x46bc('0x40')]),_0x90c225);if(_0x3c4ade['query'][_0x46bc('0x4a')]){_0xbb6d7e['where']=_[_0x46bc('0x4b')](_0xbb6d7e['where'],{'$or':_[_0x46bc('0x4c')](_0x90c225,function(_0x4f16d8){if(_0x4f16d8[_0x46bc('0x3b')]!=='VIRTUAL'){var _0x20d1f6={};_0x20d1f6[_0x4f16d8[_0x46bc('0x35')]]={'$like':'%'+_0x3c4ade[_0x46bc('0x3f')][_0x46bc('0x4a')]+'%'};return _0x20d1f6;}})});}_0xbb6d7e=_[_0x46bc('0x4b')]({},_0xbb6d7e,_0x3c4ade[_0x46bc('0x4d')]);var _0x488485={'where':_0xbb6d7e[_0x46bc('0x48')]};return db[_0x46bc('0x38')][_0x46bc('0x2d')](_0x488485)['then'](function(_0x3dd88c){_0x4fa5e0['count']=_0x3dd88c;if(_0x3c4ade['query'][_0x46bc('0x4e')]){_0xbb6d7e[_0x46bc('0x4f')]=[{'all':!![]}];}return db[_0x46bc('0x38')][_0x46bc('0x50')](_0xbb6d7e);})[_0x46bc('0x1e')](function(_0x1d0922){_0x4fa5e0[_0x46bc('0x51')]=_0x1d0922;return _0x4fa5e0;})[_0x46bc('0x1e')](respondWithFilteredResult(_0x260ce7,_0xbb6d7e))['catch'](handleError(_0x260ce7,null));};exports[_0x46bc('0x52')]=function(_0x2eeff8,_0x53790a){var _0x55555e={'raw':!![],'where':{'id':_0x2eeff8['params']['id']}},_0x510cc6={};_0x510cc6[_0x46bc('0x3d')]=_[_0x46bc('0x3e')](db[_0x46bc('0x38')][_0x46bc('0x39')]);_0x510cc6[_0x46bc('0x3f')]=_['keys'](_0x2eeff8['query']);_0x510cc6['filters']=_['intersection'](_0x510cc6['model'],_0x510cc6[_0x46bc('0x3f')]);_0x55555e['attributes']=_[_0x46bc('0x41')](_0x510cc6[_0x46bc('0x3d')],qs[_0x46bc('0x43')](_0x2eeff8[_0x46bc('0x3f')][_0x46bc('0x43')]));_0x55555e['attributes']=_0x55555e[_0x46bc('0x42')][_0x46bc('0x44')]?_0x55555e[_0x46bc('0x42')]:_0x510cc6[_0x46bc('0x3d')];if(_0x2eeff8[_0x46bc('0x3f')][_0x46bc('0x4e')]){_0x55555e[_0x46bc('0x4f')]=[{'all':!![]}];}_0x55555e=_[_0x46bc('0x4b')]({},_0x55555e,_0x2eeff8[_0x46bc('0x4d')]);return db[_0x46bc('0x38')]['find'](_0x55555e)[_0x46bc('0x1e')](handleEntityNotFound(_0x53790a,null))['then'](respondWithResult(_0x53790a,null))[_0x46bc('0x28')](handleError(_0x53790a,null));};exports['create']=function(_0x9df5e9,_0x55736f){return db[_0x46bc('0x38')][_0x46bc('0x53')](_0x9df5e9[_0x46bc('0x54')],{})[_0x46bc('0x1e')](function(_0x4996fc){var _0x5e5db5=_0x9df5e9[_0x46bc('0x55')]['get']({'plain':!![]});if(!_0x5e5db5)throw new Error(_0x46bc('0x56'));if(_0x5e5db5['role']===_0x46bc('0x55')){var _0x42a9c4=_0x4996fc[_0x46bc('0x57')]({'plain':!![]});var _0x5c23a6=_0x46bc('0x58');return db[_0x46bc('0x59')][_0x46bc('0x5a')]({'where':{'name':_0x5c23a6,'userProfileId':_0x5e5db5[_0x46bc('0x5b')]},'raw':!![]})[_0x46bc('0x1e')](function(_0x315e9e){if(_0x315e9e&&_0x315e9e[_0x46bc('0x5c')]===0x0){return db['UserProfileResource']['create']({'name':_0x42a9c4['name'],'resourceId':_0x42a9c4['id'],'type':_0x315e9e[_0x46bc('0x35')],'sectionId':_0x315e9e['id']},{})[_0x46bc('0x1e')](function(){return _0x4996fc;});}else{return _0x4996fc;}})['catch'](function(_0x54b120){logger[_0x46bc('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54b120);throw _0x54b120;});}return _0x4996fc;})[_0x46bc('0x1e')](respondWithResult(_0x55736f,0xc9))[_0x46bc('0x28')](handleError(_0x55736f,null));};exports[_0x46bc('0x32')]=function(_0x3fa61a,_0x3661eb){if(_0x3fa61a[_0x46bc('0x54')]['id']){delete _0x3fa61a[_0x46bc('0x54')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x3fa61a[_0x46bc('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3661eb,null))[_0x46bc('0x1e')](saveUpdates(_0x3fa61a[_0x46bc('0x54')],null))['then'](respondWithResult(_0x3661eb,null))[_0x46bc('0x28')](handleError(_0x3661eb,null));};exports[_0x46bc('0x33')]=function(_0x5bed94,_0x16ba14){return db[_0x46bc('0x38')][_0x46bc('0x5a')]({'where':{'id':_0x5bed94[_0x46bc('0x5d')]['id']}})['then'](handleEntityNotFound(_0x16ba14,null))[_0x46bc('0x1e')](removeEntity(_0x16ba14,null))[_0x46bc('0x28')](handleError(_0x16ba14,null));};exports[_0x46bc('0x5e')]=function(_0x5888e8,_0x168494){return db['ChatQueue']['describe']()['then'](respondWithResult(_0x168494,null))[_0x46bc('0x28')](handleError(_0x168494,null));};exports[_0x46bc('0x5f')]=function(_0x20ca08,_0xcca876,_0x2c35d9){var _0x57a02a={'raw':!![],'where':{}},_0x4d1d4a={},_0x2686c3;return db[_0x46bc('0x38')]['findOne']({'where':{'id':_0x20ca08[_0x46bc('0x5d')]['id']}})[_0x46bc('0x1e')](handleEntityNotFound(_0xcca876,null))[_0x46bc('0x1e')](function(_0x2ef201){if(_0x2ef201){_0x2686c3=_0x2ef201[_0x46bc('0x57')]({'plain':!![]});_0x4d1d4a['model']=_[_0x46bc('0x3e')](db[_0x46bc('0x60')][_0x46bc('0x39')]);_0x4d1d4a['query']=_[_0x46bc('0x3e')](_0x20ca08[_0x46bc('0x3f')]);_0x4d1d4a[_0x46bc('0x40')]=_[_0x46bc('0x41')](_0x4d1d4a['model'],_0x4d1d4a[_0x46bc('0x3f')]);_0x57a02a[_0x46bc('0x42')]=_[_0x46bc('0x41')](_0x4d1d4a['model'],qs[_0x46bc('0x43')](_0x20ca08[_0x46bc('0x3f')][_0x46bc('0x43')]));_0x57a02a['attributes']=_0x57a02a['attributes'][_0x46bc('0x44')]?_0x57a02a[_0x46bc('0x42')]:_0x4d1d4a[_0x46bc('0x3d')];if(!_0x20ca08[_0x46bc('0x3f')][_0x46bc('0x45')](_0x46bc('0x46'))){_0x57a02a[_0x46bc('0x2c')]=qs[_0x46bc('0x2c')](_0x20ca08[_0x46bc('0x3f')][_0x46bc('0x2c')]);_0x57a02a['offset']=qs[_0x46bc('0x2e')](_0x20ca08[_0x46bc('0x3f')][_0x46bc('0x2e')]);}_0x57a02a['order']=qs[_0x46bc('0x47')](_0x20ca08[_0x46bc('0x3f')][_0x46bc('0x47')]);_0x57a02a[_0x46bc('0x48')]=qs[_0x46bc('0x40')](_['pick'](_0x20ca08[_0x46bc('0x3f')],_0x4d1d4a['filters']));_0x57a02a[_0x46bc('0x48')][_0x46bc('0x61')]=_0x2ef201['id'];if(_0x20ca08['query'][_0x46bc('0x4a')]){_0x57a02a[_0x46bc('0x48')]=_[_0x46bc('0x4b')](_0x57a02a[_0x46bc('0x48')],{'$or':_[_0x46bc('0x4c')](_0x57a02a[_0x46bc('0x42')],function(_0x34ba15){var _0x1c634b={};_0x1c634b[_0x34ba15]={'$like':'%'+_0x20ca08[_0x46bc('0x3f')]['filter']+'%'};return _0x1c634b;})});}_0x57a02a=_[_0x46bc('0x4b')]({},_0x57a02a,_0x20ca08[_0x46bc('0x4d')]);return db['UserChatQueue'][_0x46bc('0x50')](_0x57a02a);}})[_0x46bc('0x1e')](function(_0x47ba6d){if(_0x47ba6d){return db['User'][_0x46bc('0x62')]({'where':{'id':_['map'](_0x47ba6d,'UserId'),'role':_0x46bc('0x63')},'attributes':['id','name',_0x46bc('0x64'),_0x46bc('0x65'),_0x46bc('0x66')]});}})[_0x46bc('0x1e')](function(_0x3934cc){if(_0x3934cc){return{'count':_0x3934cc[_0x46bc('0x2d')],'rows':_[_0x46bc('0x4c')](_0x3934cc[_0x46bc('0x51')],function(_0x29928b){return{'membername':_0x29928b[_0x46bc('0x35')],'UserId':_0x29928b['id'],'queue_name':_0x2686c3[_0x46bc('0x35')],'ChatQueueId':_0x2686c3['id'],'interface':util[_0x46bc('0x67')](_0x46bc('0x68'),'SIP',_0x29928b['name']),'penalty':0x0,'paused':_0x29928b[_0x46bc('0x64')],'createdAt':_0x29928b['createdAt'],'updatedAt':_0x29928b[_0x46bc('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xcca876,_0x57a02a))[_0x46bc('0x28')](handleError(_0xcca876,null));};exports[_0x46bc('0x69')]=function(_0x46fbff,_0x92c0e1,_0x30aab6){var _0x8c7818={};var _0x29c248={};var _0x2348f1;var _0x41acee;return db['ChatQueue'][_0x46bc('0x6a')]({'where':{'id':_0x46fbff[_0x46bc('0x5d')]['id']}})[_0x46bc('0x1e')](handleEntityNotFound(_0x92c0e1,null))['then'](function(_0xdfde17){if(_0xdfde17){_0x2348f1=_0xdfde17;_0x29c248[_0x46bc('0x3d')]=_[_0x46bc('0x3e')](db[_0x46bc('0x6b')][_0x46bc('0x39')]);_0x29c248['query']=_[_0x46bc('0x3e')](_0x46fbff[_0x46bc('0x3f')]);_0x29c248[_0x46bc('0x40')]=_[_0x46bc('0x41')](_0x29c248['model'],_0x29c248[_0x46bc('0x3f')]);_0x8c7818[_0x46bc('0x42')]=_[_0x46bc('0x41')](_0x29c248[_0x46bc('0x3d')],qs[_0x46bc('0x43')](_0x46fbff[_0x46bc('0x3f')]['fields']));_0x8c7818[_0x46bc('0x42')]=_0x8c7818[_0x46bc('0x42')][_0x46bc('0x44')]?_0x8c7818[_0x46bc('0x42')]:_0x29c248['model'];_0x8c7818[_0x46bc('0x6c')]=qs[_0x46bc('0x47')](_0x46fbff[_0x46bc('0x3f')][_0x46bc('0x47')]);_0x8c7818[_0x46bc('0x48')]=qs['filters'](_[_0x46bc('0x49')](_0x46fbff[_0x46bc('0x3f')],_0x29c248[_0x46bc('0x40')]));if(_0x46fbff['query']['filter']){_0x8c7818['where']=_['merge'](_0x8c7818['where'],{'$or':_[_0x46bc('0x4c')](_0x8c7818['attributes'],function(_0x2708b0){var _0x3b4c3b={};_0x3b4c3b[_0x2708b0]={'$like':'%'+_0x46fbff[_0x46bc('0x3f')]['filter']+'%'};return _0x3b4c3b;})});}_0x8c7818=_[_0x46bc('0x4b')]({},_0x8c7818,_0x46fbff[_0x46bc('0x4d')]);return _0x2348f1['getTeams'](_0x8c7818);}})[_0x46bc('0x1e')](function(_0x4eed4e){if(_0x4eed4e){_0x41acee=_0x4eed4e['length'];if(!_0x46fbff[_0x46bc('0x3f')][_0x46bc('0x45')](_0x46bc('0x46'))){_0x8c7818[_0x46bc('0x2c')]=qs[_0x46bc('0x2c')](_0x46fbff[_0x46bc('0x3f')][_0x46bc('0x2c')]);_0x8c7818[_0x46bc('0x2e')]=qs[_0x46bc('0x2e')](_0x46fbff[_0x46bc('0x3f')][_0x46bc('0x2e')]);}return _0x2348f1[_0x46bc('0x69')](_0x8c7818);}})[_0x46bc('0x1e')](function(_0x1896ce){if(_0x1896ce){return _0x1896ce?{'count':_0x41acee,'rows':_0x1896ce}:null;}})[_0x46bc('0x1e')](respondWithResult(_0x92c0e1,null))[_0x46bc('0x28')](handleError(_0x92c0e1,null));};exports[_0x46bc('0x6d')]=function(_0x2e91f6,_0x160d9d,_0x4cc248){var _0x5afdde=_0x2e91f6[_0x46bc('0x54')][_0x46bc('0x6e')];return db[_0x46bc('0x6b')][_0x46bc('0x50')]({'where':{'id':_0x5afdde},'attributes':['id'],'include':[{'model':db[_0x46bc('0x6f')],'as':'Agents','attributes':['id',_0x46bc('0x35'),'online','voicePause',_0x46bc('0x70')],'raw':!![]}]})[_0x46bc('0x1e')](function(_0x510b2a){if(_0x510b2a){var _0x383147=_[_0x46bc('0x71')](_0x510b2a,function(_0xac1534){var _0x4b3910=_0xac1534[_0x46bc('0x57')]({'plain':!![]});return _0x4b3910[_0x46bc('0x72')];});return db[_0x46bc('0x38')][_0x46bc('0x5a')]({'where':{'id':_0x2e91f6['params']['id']}})['then'](function(_0x3be347){return db[_0x46bc('0x73')][_0x46bc('0x74')](function(_0x9857ff){return _0x3be347['addTeams'](_0x5afdde,{'transaction':_0x9857ff})[_0x46bc('0x1e')](function(){return BPromise[_0x46bc('0x75')](_0x383147,function(_0x5d8035){return db[_0x46bc('0x60')][_0x46bc('0x76')]({'where':{'UserId':_0x5d8035['id'],'ChatQueueId':_0x2e91f6[_0x46bc('0x5d')]['id']},'transaction':_0x9857ff});});})[_0x46bc('0x1e')](function(){_0x383147[_0x46bc('0x77')](function(_0x5728a4){socket[_0x46bc('0x78')](_0x46bc('0x79'),{'UserId':_0x5728a4['id'],'ChatQueueId':_0x3be347['id']});});});});});}})[_0x46bc('0x1e')](respondWithStatusCode(_0x160d9d,null))[_0x46bc('0x28')](handleError(_0x160d9d,null));};exports[_0x46bc('0x7a')]=function(_0x11728d,_0x10c941,_0x1df9f3){return db[_0x46bc('0x6b')]['findAll']({'where':{'id':_0x11728d['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x46bc('0x6f')],'as':_0x46bc('0x72'),'attributes':['id'],'raw':!![]}]})[_0x46bc('0x1e')](handleEntityNotFound(_0x10c941,null))[_0x46bc('0x1e')](function(_0x3aaa59){var _0x2d2e79=_[_0x46bc('0x4c')](_0x3aaa59,'id');var _0x17a30e=[];var _0x4a4b52=[];var _0x4b98cd=squel[_0x46bc('0x7b')]();_0x4b98cd[_0x46bc('0x7c')]('tq.TeamId')[_0x46bc('0x7d')](_0x46bc('0x7e'),'tq')[_0x46bc('0x7f')](_0x46bc('0x80'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x46bc('0x48')](_0x46bc('0x81'),_0x11728d[_0x46bc('0x5d')]['id']);for(var _0x15d885=0x0;_0x15d885<_0x3aaa59[_0x46bc('0x44')];_0x15d885+=0x1){let _0x197134=_0x3aaa59[_0x15d885];for(var _0xc841b5=0x0;_0xc841b5<_0x197134[_0x46bc('0x72')][_0x46bc('0x44')];_0xc841b5+=0x1){let _0x59ea55=_0x197134[_0x46bc('0x72')][_0xc841b5];var _0x44b367=_0x4b98cd['clone']();_0x44b367[_0x46bc('0x48')](_0x46bc('0x82'),_0x59ea55['id']);_0x4a4b52[_0x46bc('0x83')](db[_0x46bc('0x73')]['query'](_0x44b367[_0x46bc('0x84')](),{'type':db[_0x46bc('0x73')][_0x46bc('0x85')][_0x46bc('0x86')]})['then'](function(_0x10a066){if(_0x10a066['length']===0x1){return _0x59ea55['id'];}else{var _0x5917d6=_[_0x46bc('0x87')](_[_0x46bc('0x4c')](_0x10a066,'TeamId'),function(_0x363b35){return _[_0x46bc('0x88')](_0x2d2e79,_0x363b35);});if(_0x5917d6){return _0x59ea55['id'];}}}));}}return BPromise['all'](_0x4a4b52)['then'](function(_0x5933b1){_0x17a30e=_(_0x17a30e)[_0x46bc('0x89')](_0x5933b1)[_0x46bc('0x8a')]()[_0x46bc('0x8b')]();return db[_0x46bc('0x38')][_0x46bc('0x5a')]({'where':{'id':_0x11728d[_0x46bc('0x5d')]['id']}})[_0x46bc('0x1e')](function(_0x402f68){return db[_0x46bc('0x73')][_0x46bc('0x74')](function(_0x1391f7){return _0x402f68[_0x46bc('0x7a')](_0x11728d[_0x46bc('0x3f')][_0x46bc('0x6e')],{'transaction':_0x1391f7})[_0x46bc('0x1e')](function(){if(!_[_0x46bc('0x8c')](_0x17a30e)){return _0x402f68[_0x46bc('0x8d')](_0x17a30e,{'transaction':_0x1391f7});}})['then'](function(){_0x17a30e[_0x46bc('0x77')](function(_0x402389){socket[_0x46bc('0x78')](_0x46bc('0x8e'),{'UserId':_0x402389,'ChatQueueId':_0x402f68['id']});});});});});});})[_0x46bc('0x1e')](respondWithStatusCode(_0x10c941,null))['catch'](handleError(_0x10c941,null));};exports['addAgents']=function(_0x608dbd,_0x4e4b83,_0x4b3d8a){return db[_0x46bc('0x38')][_0x46bc('0x5a')]({'where':{'id':_0x608dbd[_0x46bc('0x5d')]['id']}})[_0x46bc('0x1e')](handleEntityNotFound(_0x4e4b83,null))[_0x46bc('0x1e')](function(_0x377835){if(_0x377835){return _0x377835[_0x46bc('0x8f')](_0x608dbd[_0x46bc('0x54')][_0x46bc('0x6e')],_[_0x46bc('0x90')](_0x608dbd[_0x46bc('0x54')],[_0x46bc('0x6e'),'id'])||{})[_0x46bc('0x91')](function(_0x496bc1){for(var _0x5d8b30=0x0;_0x5d8b30<_0x608dbd[_0x46bc('0x54')][_0x46bc('0x6e')]['length'];_0x5d8b30+=0x1){socket[_0x46bc('0x78')]('userChatQueue:save',{'UserId':Number(_0x608dbd[_0x46bc('0x54')][_0x46bc('0x6e')][_0x5d8b30]),'ChatQueueId':Number(_0x608dbd[_0x46bc('0x5d')]['id'])});}return _0x496bc1;});}})[_0x46bc('0x1e')](respondWithResult(_0x4e4b83,null))[_0x46bc('0x28')](handleError(_0x4e4b83,null));};exports[_0x46bc('0x8d')]=function(_0x3b6a97,_0x2557b2,_0x15bd95){return db[_0x46bc('0x38')][_0x46bc('0x5a')]({'where':{'id':_0x3b6a97[_0x46bc('0x5d')]['id']}})[_0x46bc('0x1e')](handleEntityNotFound(_0x2557b2,null))['then'](function(_0x180b7b){if(_0x180b7b){return _0x180b7b[_0x46bc('0x8d')](_0x3b6a97[_0x46bc('0x3f')]['ids'])[_0x46bc('0x1e')](function(){if(_['isArray'](_0x3b6a97['query'][_0x46bc('0x6e')])){for(var _0x2c9c74=0x0;_0x2c9c74<_0x3b6a97[_0x46bc('0x3f')][_0x46bc('0x6e')][_0x46bc('0x44')];_0x2c9c74+=0x1){socket[_0x46bc('0x78')](_0x46bc('0x8e'),{'UserId':Number(_0x3b6a97[_0x46bc('0x3f')]['ids'][_0x2c9c74]),'ChatQueueId':Number(_0x3b6a97['params']['id'])});}}else{socket['emit'](_0x46bc('0x8e'),{'UserId':Number(_0x3b6a97[_0x46bc('0x3f')][_0x46bc('0x6e')]),'ChatQueueId':Number(_0x3b6a97['params']['id'])});}});}})[_0x46bc('0x1e')](respondWithStatusCode(_0x2557b2,null))[_0x46bc('0x28')](handleError(_0x2557b2,null));};exports['getAgents']=function(_0x201b94,_0x171df3,_0x48d5ba){var _0x51d7b8={};var _0x47d3b2={};var _0x1c1829;var _0x18873c;return db[_0x46bc('0x38')]['findOne']({'where':{'id':_0x201b94[_0x46bc('0x5d')]['id']}})[_0x46bc('0x1e')](handleEntityNotFound(_0x171df3,null))[_0x46bc('0x1e')](function(_0x282473){if(_0x282473){_0x1c1829=_0x282473;_0x47d3b2[_0x46bc('0x3d')]=_[_0x46bc('0x3e')](db[_0x46bc('0x6f')]['rawAttributes']);_0x47d3b2[_0x46bc('0x3f')]=_[_0x46bc('0x3e')](_0x201b94[_0x46bc('0x3f')]);_0x47d3b2[_0x46bc('0x40')]=_[_0x46bc('0x41')](_0x47d3b2['model'],_0x47d3b2[_0x46bc('0x3f')]);_0x51d7b8[_0x46bc('0x42')]=_['intersection'](_0x47d3b2[_0x46bc('0x3d')],qs[_0x46bc('0x43')](_0x201b94[_0x46bc('0x3f')][_0x46bc('0x43')]));_0x51d7b8[_0x46bc('0x42')]=_0x51d7b8[_0x46bc('0x42')][_0x46bc('0x44')]?_0x51d7b8['attributes']:_0x47d3b2['model'];_0x51d7b8[_0x46bc('0x6c')]=qs['sort'](_0x201b94['query'][_0x46bc('0x47')]);_0x51d7b8['where']=qs[_0x46bc('0x40')](_[_0x46bc('0x49')](_0x201b94[_0x46bc('0x3f')],_0x47d3b2[_0x46bc('0x40')]));if(_0x201b94[_0x46bc('0x3f')][_0x46bc('0x4a')]){_0x51d7b8[_0x46bc('0x48')]=_['merge'](_0x51d7b8[_0x46bc('0x48')],{'$or':_[_0x46bc('0x4c')](_0x51d7b8[_0x46bc('0x42')],function(_0x459503){var _0x1be19f={};_0x1be19f[_0x459503]={'$like':'%'+_0x201b94[_0x46bc('0x3f')]['filter']+'%'};return _0x1be19f;})});}_0x51d7b8=_[_0x46bc('0x4b')]({},_0x51d7b8,_0x201b94['options']);return _0x1c1829[_0x46bc('0x92')](_0x51d7b8);}})[_0x46bc('0x1e')](function(_0x21729c){if(_0x21729c){_0x18873c=_0x21729c['length'];if(!_0x201b94[_0x46bc('0x3f')][_0x46bc('0x45')](_0x46bc('0x46'))){_0x51d7b8[_0x46bc('0x2c')]=qs[_0x46bc('0x2c')](_0x201b94[_0x46bc('0x3f')][_0x46bc('0x2c')]);_0x51d7b8[_0x46bc('0x2e')]=qs[_0x46bc('0x2e')](_0x201b94[_0x46bc('0x3f')]['offset']);}return _0x1c1829[_0x46bc('0x92')](_0x51d7b8);}})[_0x46bc('0x1e')](function(_0x123852){if(_0x123852){return _0x123852?{'count':_0x18873c,'rows':_0x123852}:null;}})[_0x46bc('0x1e')](respondWithResult(_0x171df3,null))['catch'](handleError(_0x171df3,null));};
\ No newline at end of file
+var _0x1fa3=['role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','ChatQueueId','options','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','UserChatQueue','findOrCreate','emit','userChatQueue:save','Team','findAll','field','tq.TeamId','from','team_has_chat_queues','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','removeTeams','ids','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','status','undefined','limit','count','offset','Content-Range','json','reject','update','get','UserProfileResource','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ChatQueue','includeAll','include','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0xa1cdd9,_0x32bc4b){var _0x82f482=function(_0x5e265c){while(--_0x5e265c){_0xa1cdd9['push'](_0xa1cdd9['shift']());}};_0x82f482(++_0x32bc4b);}(_0x1fa3,0xcf));var _0x31fa=function(_0x5c41cb,_0x330705){_0x5c41cb=_0x5c41cb-0x0;var _0x49db41=_0x1fa3[_0x5c41cb];return _0x49db41;};'use strict';var emlformat=require(_0x31fa('0x0'));var rimraf=require(_0x31fa('0x1'));var zipdir=require(_0x31fa('0x2'));var jsonpatch=require(_0x31fa('0x3'));var rp=require(_0x31fa('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x31fa('0x5'));var csv=require(_0x31fa('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x31fa('0x7'));var _=require(_0x31fa('0x8'));var squel=require(_0x31fa('0x9'));var crypto=require('crypto');var jsforce=require(_0x31fa('0xa'));var deskjs=require(_0x31fa('0xb'));var toCsv=require(_0x31fa('0x6'));var querystring=require(_0x31fa('0xc'));var Papa=require(_0x31fa('0xd'));var Redis=require(_0x31fa('0xe'));var authService=require(_0x31fa('0xf'));var qs=require(_0x31fa('0x10'));var as=require(_0x31fa('0x11'));var hardwareService=require(_0x31fa('0x12'));var logger=require(_0x31fa('0x13'))('api');var utils=require(_0x31fa('0x14'));var config=require(_0x31fa('0x15'));var licenseUtil=require(_0x31fa('0x16'));var db=require(_0x31fa('0x17'))['db'];config[_0x31fa('0x18')]=_[_0x31fa('0x19')](config[_0x31fa('0x18')],{'host':_0x31fa('0x1a'),'port':0x18eb});var socket=require(_0x31fa('0x1b'))(new Redis(config[_0x31fa('0x18')]));require('./chatQueue.socket')['register'](socket);var jayson=require(_0x31fa('0x1c'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x401e98,_0x437c87,_0x446b0f,_0x5d3e2f){return new BPromise(function(_0x185f94,_0x51baf2){var _0x16205d=_0x5d3e2f||client;return _0x16205d['request'](_0x401e98,_0x446b0f)[_0x31fa('0x1d')](function(_0x49d4a0){logger[_0x31fa('0x1e')](_0x31fa('0x1f'),_0x437c87,'request\x20sent');logger[_0x31fa('0x20')](_0x31fa('0x21'),_0x437c87,'request\x20sent',JSON[_0x31fa('0x22')](_0x49d4a0));if(_0x49d4a0['error']){if(_0x49d4a0[_0x31fa('0x23')][_0x31fa('0x24')]===0x1f4){logger[_0x31fa('0x23')](_0x31fa('0x1f'),_0x437c87,_0x49d4a0[_0x31fa('0x23')][_0x31fa('0x25')]);return _0x51baf2(_0x49d4a0[_0x31fa('0x23')][_0x31fa('0x25')]);}logger[_0x31fa('0x23')](_0x31fa('0x1f'),_0x437c87,_0x49d4a0['error'][_0x31fa('0x25')]);return _0x185f94(_0x49d4a0[_0x31fa('0x23')]['message']);}else{logger[_0x31fa('0x1e')](_0x31fa('0x1f'),_0x437c87,_0x31fa('0x26'));_0x185f94(_0x49d4a0['result'][_0x31fa('0x25')]);}})[_0x31fa('0x27')](function(_0x510825){logger[_0x31fa('0x23')](_0x31fa('0x1f'),_0x437c87,_0x510825);_0x51baf2(_0x510825);});});}function respondWithStatusCode(_0x2d3c06,_0xd4837){_0xd4837=_0xd4837||0xcc;return function(_0x1b4950){if(_0x1b4950){return _0x2d3c06['sendStatus'](_0xd4837);}return _0x2d3c06[_0x31fa('0x28')](_0xd4837)['end']();};}function respondWithResult(_0x366bc0,_0x1f45db){_0x1f45db=_0x1f45db||0xc8;return function(_0x58b166){if(_0x58b166){return _0x366bc0[_0x31fa('0x28')](_0x1f45db)['json'](_0x58b166);}};}function respondWithFilteredResult(_0xac980c,_0x29fea9){return function(_0x4f2c8e){if(_0x4f2c8e){var _0xa35143=typeof _0x29fea9['offset']===_0x31fa('0x29')&&typeof _0x29fea9[_0x31fa('0x2a')]===_0x31fa('0x29');var _0x1dea52=_0x4f2c8e[_0x31fa('0x2b')];var _0x4bac6b=_0xa35143?0x0:_0x29fea9[_0x31fa('0x2c')];var _0x48db78=_0xa35143?_0x4f2c8e['count']:_0x29fea9[_0x31fa('0x2c')]+_0x29fea9[_0x31fa('0x2a')];var _0x54359e;if(_0x48db78>=_0x1dea52){_0x48db78=_0x1dea52;_0x54359e=0xc8;}else{_0x54359e=0xce;}_0xac980c[_0x31fa('0x28')](_0x54359e);return _0xac980c['set'](_0x31fa('0x2d'),_0x4bac6b+'-'+_0x48db78+'/'+_0x1dea52)[_0x31fa('0x2e')](_0x4f2c8e);}return null;};}function patchUpdates(_0x2c1371){return function(_0xd208){try{jsonpatch['apply'](_0xd208,_0x2c1371,!![]);}catch(_0x3bd6f7){return BPromise[_0x31fa('0x2f')](_0x3bd6f7);}return _0xd208['save']();};}function saveUpdates(_0x417a79,_0x3043ab){return function(_0x28bbbd){if(_0x28bbbd){return _0x28bbbd[_0x31fa('0x30')](_0x417a79)[_0x31fa('0x1d')](function(_0x30acc7){return _0x30acc7;});}return null;};}function removeEntity(_0x46590d,_0x3b3875){return function(_0x46cbe1){if(_0x46cbe1){return _0x46cbe1['destroy']()[_0x31fa('0x1d')](function(){var _0x16ea82=_0x46cbe1[_0x31fa('0x31')]({'plain':!![]});var _0x138ac7='ChatQueues';return db[_0x31fa('0x32')]['destroy']({'where':{'type':_0x138ac7,'resourceId':_0x16ea82['id']}})[_0x31fa('0x1d')](function(){return _0x46cbe1;});})[_0x31fa('0x1d')](function(){_0x46590d[_0x31fa('0x28')](0xcc)[_0x31fa('0x33')]();});}};}function handleEntityNotFound(_0x21c514,_0x479034){return function(_0x3eae3a){if(!_0x3eae3a){_0x21c514['sendStatus'](0x194);}return _0x3eae3a;};}function handleError(_0x2d1064,_0x5df9e5){_0x5df9e5=_0x5df9e5||0x1f4;return function(_0x55d4a7){logger[_0x31fa('0x23')](_0x55d4a7[_0x31fa('0x34')]);if(_0x55d4a7[_0x31fa('0x35')]){delete _0x55d4a7[_0x31fa('0x35')];}_0x2d1064[_0x31fa('0x28')](_0x5df9e5)[_0x31fa('0x36')](_0x55d4a7);};}exports[_0x31fa('0x37')]=function(_0x2e4770,_0x462bdd){var _0x5b82e5={},_0x570429={},_0x294af8={'count':0x0,'rows':[]};var _0x59ac71=_[_0x31fa('0x38')](db['ChatQueue'][_0x31fa('0x39')],function(_0x5c5af8){return{'name':_0x5c5af8[_0x31fa('0x3a')],'type':_0x5c5af8[_0x31fa('0x3b')][_0x31fa('0x3c')]};});_0x570429['model']=_['map'](_0x59ac71,_0x31fa('0x35'));_0x570429[_0x31fa('0x3d')]=_[_0x31fa('0x3e')](_0x2e4770[_0x31fa('0x3d')]);_0x570429[_0x31fa('0x3f')]=_['intersection'](_0x570429[_0x31fa('0x40')],_0x570429[_0x31fa('0x3d')]);_0x5b82e5[_0x31fa('0x41')]=_[_0x31fa('0x42')](_0x570429[_0x31fa('0x40')],qs['fields'](_0x2e4770['query'][_0x31fa('0x43')]));_0x5b82e5[_0x31fa('0x41')]=_0x5b82e5[_0x31fa('0x41')][_0x31fa('0x44')]?_0x5b82e5[_0x31fa('0x41')]:_0x570429[_0x31fa('0x40')];if(!_0x2e4770['query'][_0x31fa('0x45')](_0x31fa('0x46'))){_0x5b82e5['limit']=qs[_0x31fa('0x2a')](_0x2e4770['query'][_0x31fa('0x2a')]);_0x5b82e5['offset']=qs[_0x31fa('0x2c')](_0x2e4770[_0x31fa('0x3d')]['offset']);}_0x5b82e5[_0x31fa('0x47')]=qs[_0x31fa('0x48')](_0x2e4770[_0x31fa('0x3d')]['sort']);_0x5b82e5[_0x31fa('0x49')]=qs[_0x31fa('0x3f')](_[_0x31fa('0x4a')](_0x2e4770[_0x31fa('0x3d')],_0x570429[_0x31fa('0x3f')]),_0x59ac71);if(_0x2e4770[_0x31fa('0x3d')][_0x31fa('0x4b')]){_0x5b82e5[_0x31fa('0x49')]=_[_0x31fa('0x4c')](_0x5b82e5['where'],{'$or':_[_0x31fa('0x38')](_0x59ac71,function(_0x35ff28){if(_0x35ff28[_0x31fa('0x3b')]!==_0x31fa('0x4d')){var _0x6d648d={};_0x6d648d[_0x35ff28[_0x31fa('0x35')]]={'$like':'%'+_0x2e4770[_0x31fa('0x3d')][_0x31fa('0x4b')]+'%'};return _0x6d648d;}})});}_0x5b82e5=_[_0x31fa('0x4c')]({},_0x5b82e5,_0x2e4770['options']);var _0x2456b1={'where':_0x5b82e5['where']};return db[_0x31fa('0x4e')][_0x31fa('0x2b')](_0x2456b1)[_0x31fa('0x1d')](function(_0x25e051){_0x294af8[_0x31fa('0x2b')]=_0x25e051;if(_0x2e4770['query'][_0x31fa('0x4f')]){_0x5b82e5[_0x31fa('0x50')]=[{'all':!![]}];}return db[_0x31fa('0x4e')]['findAll'](_0x5b82e5);})[_0x31fa('0x1d')](function(_0x22746d){_0x294af8[_0x31fa('0x51')]=_0x22746d;return _0x294af8;})[_0x31fa('0x1d')](respondWithFilteredResult(_0x462bdd,_0x5b82e5))[_0x31fa('0x27')](handleError(_0x462bdd,null));};exports[_0x31fa('0x52')]=function(_0x5d72ef,_0x33f48b){var _0x44bba0={'raw':!![],'where':{'id':_0x5d72ef[_0x31fa('0x53')]['id']}},_0x398fe1={};_0x398fe1[_0x31fa('0x40')]=_['keys'](db[_0x31fa('0x4e')][_0x31fa('0x39')]);_0x398fe1['query']=_['keys'](_0x5d72ef['query']);_0x398fe1['filters']=_[_0x31fa('0x42')](_0x398fe1[_0x31fa('0x40')],_0x398fe1['query']);_0x44bba0[_0x31fa('0x41')]=_[_0x31fa('0x42')](_0x398fe1[_0x31fa('0x40')],qs[_0x31fa('0x43')](_0x5d72ef['query'][_0x31fa('0x43')]));_0x44bba0[_0x31fa('0x41')]=_0x44bba0[_0x31fa('0x41')][_0x31fa('0x44')]?_0x44bba0[_0x31fa('0x41')]:_0x398fe1[_0x31fa('0x40')];if(_0x5d72ef['query'][_0x31fa('0x4f')]){_0x44bba0[_0x31fa('0x50')]=[{'all':!![]}];}_0x44bba0=_[_0x31fa('0x4c')]({},_0x44bba0,_0x5d72ef['options']);return db[_0x31fa('0x4e')][_0x31fa('0x54')](_0x44bba0)[_0x31fa('0x1d')](handleEntityNotFound(_0x33f48b,null))[_0x31fa('0x1d')](respondWithResult(_0x33f48b,null))[_0x31fa('0x27')](handleError(_0x33f48b,null));};exports[_0x31fa('0x55')]=function(_0x2189d8,_0x4b4101){return db[_0x31fa('0x4e')][_0x31fa('0x55')](_0x2189d8[_0x31fa('0x56')],{})[_0x31fa('0x1d')](function(_0x36e194){var _0x1986c8=_0x2189d8[_0x31fa('0x57')][_0x31fa('0x31')]({'plain':!![]});if(!_0x1986c8)throw new Error(_0x31fa('0x58'));if(_0x1986c8[_0x31fa('0x59')]==='user'){var _0x2cdcc4=_0x36e194['get']({'plain':!![]});var _0x3928c2='ChatQueues';return db['UserProfileSection'][_0x31fa('0x54')]({'where':{'name':_0x3928c2,'userProfileId':_0x1986c8['userProfileId']},'raw':!![]})[_0x31fa('0x1d')](function(_0x392fd7){if(_0x392fd7&&_0x392fd7[_0x31fa('0x5a')]===0x0){return db[_0x31fa('0x32')][_0x31fa('0x55')]({'name':_0x2cdcc4[_0x31fa('0x35')],'resourceId':_0x2cdcc4['id'],'type':_0x392fd7[_0x31fa('0x35')],'sectionId':_0x392fd7['id']},{})[_0x31fa('0x1d')](function(){return _0x36e194;});}else{return _0x36e194;}})['catch'](function(_0x20547d){logger['error'](_0x31fa('0x5b'),_0x20547d);throw _0x20547d;});}return _0x36e194;})[_0x31fa('0x1d')](respondWithResult(_0x4b4101,0xc9))[_0x31fa('0x27')](handleError(_0x4b4101,null));};exports[_0x31fa('0x30')]=function(_0x109ab9,_0x5ecdea){if(_0x109ab9[_0x31fa('0x56')]['id']){delete _0x109ab9[_0x31fa('0x56')]['id'];}return db[_0x31fa('0x4e')][_0x31fa('0x54')]({'where':{'id':_0x109ab9[_0x31fa('0x53')]['id']}})[_0x31fa('0x1d')](handleEntityNotFound(_0x5ecdea,null))[_0x31fa('0x1d')](saveUpdates(_0x109ab9[_0x31fa('0x56')],null))['then'](respondWithResult(_0x5ecdea,null))['catch'](handleError(_0x5ecdea,null));};exports['destroy']=function(_0x5c26f0,_0x54573e){return db[_0x31fa('0x4e')]['find']({'where':{'id':_0x5c26f0[_0x31fa('0x53')]['id']}})[_0x31fa('0x1d')](handleEntityNotFound(_0x54573e,null))['then'](removeEntity(_0x54573e,null))['catch'](handleError(_0x54573e,null));};exports[_0x31fa('0x5c')]=function(_0x27672a,_0x5f3240){return db[_0x31fa('0x4e')][_0x31fa('0x5c')]()[_0x31fa('0x1d')](respondWithResult(_0x5f3240,null))['catch'](handleError(_0x5f3240,null));};exports['getMembers']=function(_0x2d9fff,_0x1891ff,_0x125452){var _0x5cb8ab={'raw':!![],'where':{}},_0x2885d2={},_0x5bb2e7;return db[_0x31fa('0x4e')][_0x31fa('0x5d')]({'where':{'id':_0x2d9fff[_0x31fa('0x53')]['id']}})[_0x31fa('0x1d')](handleEntityNotFound(_0x1891ff,null))[_0x31fa('0x1d')](function(_0x1bfff0){if(_0x1bfff0){_0x5bb2e7=_0x1bfff0[_0x31fa('0x31')]({'plain':!![]});_0x2885d2[_0x31fa('0x40')]=_[_0x31fa('0x3e')](db['UserChatQueue'][_0x31fa('0x39')]);_0x2885d2['query']=_[_0x31fa('0x3e')](_0x2d9fff[_0x31fa('0x3d')]);_0x2885d2[_0x31fa('0x3f')]=_[_0x31fa('0x42')](_0x2885d2[_0x31fa('0x40')],_0x2885d2[_0x31fa('0x3d')]);_0x5cb8ab[_0x31fa('0x41')]=_[_0x31fa('0x42')](_0x2885d2[_0x31fa('0x40')],qs[_0x31fa('0x43')](_0x2d9fff[_0x31fa('0x3d')][_0x31fa('0x43')]));_0x5cb8ab[_0x31fa('0x41')]=_0x5cb8ab['attributes'][_0x31fa('0x44')]?_0x5cb8ab['attributes']:_0x2885d2[_0x31fa('0x40')];if(!_0x2d9fff[_0x31fa('0x3d')][_0x31fa('0x45')]('nolimit')){_0x5cb8ab[_0x31fa('0x2a')]=qs['limit'](_0x2d9fff['query'][_0x31fa('0x2a')]);_0x5cb8ab[_0x31fa('0x2c')]=qs[_0x31fa('0x2c')](_0x2d9fff[_0x31fa('0x3d')][_0x31fa('0x2c')]);}_0x5cb8ab[_0x31fa('0x47')]=qs[_0x31fa('0x48')](_0x2d9fff[_0x31fa('0x3d')]['sort']);_0x5cb8ab[_0x31fa('0x49')]=qs['filters'](_[_0x31fa('0x4a')](_0x2d9fff['query'],_0x2885d2[_0x31fa('0x3f')]));_0x5cb8ab[_0x31fa('0x49')][_0x31fa('0x5e')]=_0x1bfff0['id'];if(_0x2d9fff[_0x31fa('0x3d')][_0x31fa('0x4b')]){_0x5cb8ab[_0x31fa('0x49')]=_[_0x31fa('0x4c')](_0x5cb8ab[_0x31fa('0x49')],{'$or':_['map'](_0x5cb8ab[_0x31fa('0x41')],function(_0x30e66d){var _0x5b0ed5={};_0x5b0ed5[_0x30e66d]={'$like':'%'+_0x2d9fff[_0x31fa('0x3d')][_0x31fa('0x4b')]+'%'};return _0x5b0ed5;})});}_0x5cb8ab=_[_0x31fa('0x4c')]({},_0x5cb8ab,_0x2d9fff[_0x31fa('0x5f')]);return db['UserChatQueue']['findAll'](_0x5cb8ab);}})['then'](function(_0x4b1070){if(_0x4b1070){return db['User']['findAndCountAll']({'where':{'id':_[_0x31fa('0x38')](_0x4b1070,_0x31fa('0x60')),'role':_0x31fa('0x61')},'attributes':['id',_0x31fa('0x35'),_0x31fa('0x62'),_0x31fa('0x63'),_0x31fa('0x64')]});}})[_0x31fa('0x1d')](function(_0x16358d){if(_0x16358d){return{'count':_0x16358d[_0x31fa('0x2b')],'rows':_[_0x31fa('0x38')](_0x16358d[_0x31fa('0x51')],function(_0x2b25f2){return{'membername':_0x2b25f2[_0x31fa('0x35')],'UserId':_0x2b25f2['id'],'queue_name':_0x5bb2e7[_0x31fa('0x35')],'ChatQueueId':_0x5bb2e7['id'],'interface':util[_0x31fa('0x65')](_0x31fa('0x66'),_0x31fa('0x67'),_0x2b25f2['name']),'penalty':0x0,'paused':_0x2b25f2['chatPause'],'createdAt':_0x2b25f2[_0x31fa('0x64')],'updatedAt':_0x2b25f2[_0x31fa('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x31fa('0x1d')](respondWithFilteredResult(_0x1891ff,_0x5cb8ab))[_0x31fa('0x27')](handleError(_0x1891ff,null));};exports['getTeams']=function(_0x1861a2,_0x13a441,_0x30afbf){var _0x587a5c={};var _0xaf25c1={};var _0xf08321;var _0x5ac64b;return db[_0x31fa('0x4e')]['findOne']({'where':{'id':_0x1861a2[_0x31fa('0x53')]['id']}})['then'](handleEntityNotFound(_0x13a441,null))[_0x31fa('0x1d')](function(_0x166b52){if(_0x166b52){_0xf08321=_0x166b52;_0xaf25c1[_0x31fa('0x40')]=_[_0x31fa('0x3e')](db['Team']['rawAttributes']);_0xaf25c1[_0x31fa('0x3d')]=_[_0x31fa('0x3e')](_0x1861a2['query']);_0xaf25c1['filters']=_['intersection'](_0xaf25c1[_0x31fa('0x40')],_0xaf25c1[_0x31fa('0x3d')]);_0x587a5c['attributes']=_[_0x31fa('0x42')](_0xaf25c1[_0x31fa('0x40')],qs[_0x31fa('0x43')](_0x1861a2[_0x31fa('0x3d')][_0x31fa('0x43')]));_0x587a5c[_0x31fa('0x41')]=_0x587a5c['attributes'][_0x31fa('0x44')]?_0x587a5c[_0x31fa('0x41')]:_0xaf25c1[_0x31fa('0x40')];_0x587a5c[_0x31fa('0x47')]=qs['sort'](_0x1861a2[_0x31fa('0x3d')][_0x31fa('0x48')]);_0x587a5c['where']=qs[_0x31fa('0x3f')](_[_0x31fa('0x4a')](_0x1861a2['query'],_0xaf25c1[_0x31fa('0x3f')]));if(_0x1861a2[_0x31fa('0x3d')][_0x31fa('0x4b')]){_0x587a5c[_0x31fa('0x49')]=_['merge'](_0x587a5c[_0x31fa('0x49')],{'$or':_[_0x31fa('0x38')](_0x587a5c['attributes'],function(_0x355977){var _0x227a1d={};_0x227a1d[_0x355977]={'$like':'%'+_0x1861a2[_0x31fa('0x3d')][_0x31fa('0x4b')]+'%'};return _0x227a1d;})});}_0x587a5c=_[_0x31fa('0x4c')]({},_0x587a5c,_0x1861a2[_0x31fa('0x5f')]);return _0xf08321[_0x31fa('0x68')](_0x587a5c);}})[_0x31fa('0x1d')](function(_0x3005c1){if(_0x3005c1){_0x5ac64b=_0x3005c1[_0x31fa('0x44')];if(!_0x1861a2[_0x31fa('0x3d')][_0x31fa('0x45')](_0x31fa('0x46'))){_0x587a5c[_0x31fa('0x2a')]=qs[_0x31fa('0x2a')](_0x1861a2[_0x31fa('0x3d')]['limit']);_0x587a5c[_0x31fa('0x2c')]=qs[_0x31fa('0x2c')](_0x1861a2[_0x31fa('0x3d')]['offset']);}return _0xf08321[_0x31fa('0x68')](_0x587a5c);}})[_0x31fa('0x1d')](function(_0x3c59c4){if(_0x3c59c4){return _0x3c59c4?{'count':_0x5ac64b,'rows':_0x3c59c4}:null;}})[_0x31fa('0x1d')](respondWithResult(_0x13a441,null))[_0x31fa('0x27')](handleError(_0x13a441,null));};exports[_0x31fa('0x69')]=function(_0x3a96c7,_0x1de1c3,_0x4b8bb6){var _0x5eb67b=_0x3a96c7['body']['ids'];return db['Team']['findAll']({'where':{'id':_0x5eb67b},'attributes':['id'],'include':[{'model':db[_0x31fa('0x6a')],'as':_0x31fa('0x6b'),'attributes':['id',_0x31fa('0x35'),_0x31fa('0x6c'),_0x31fa('0x6d'),_0x31fa('0x6e')],'raw':!![]}]})['then'](function(_0x43b31c){if(_0x43b31c){var _0x46d9cf=_[_0x31fa('0x6f')](_0x43b31c,function(_0x1070fc){var _0x1d760e=_0x1070fc[_0x31fa('0x31')]({'plain':!![]});return _0x1d760e[_0x31fa('0x6b')];});return db[_0x31fa('0x4e')][_0x31fa('0x54')]({'where':{'id':_0x3a96c7[_0x31fa('0x53')]['id']}})[_0x31fa('0x1d')](function(_0xc73174){return db[_0x31fa('0x70')][_0x31fa('0x71')](function(_0x4dddc7){return _0xc73174['addTeams'](_0x5eb67b,{'transaction':_0x4dddc7})[_0x31fa('0x1d')](function(){return BPromise[_0x31fa('0x72')](_0x46d9cf,function(_0x14a4f7){return db[_0x31fa('0x73')][_0x31fa('0x74')]({'where':{'UserId':_0x14a4f7['id'],'ChatQueueId':_0x3a96c7[_0x31fa('0x53')]['id']},'transaction':_0x4dddc7});});})[_0x31fa('0x1d')](function(){_0x46d9cf['forEach'](function(_0x188e57){socket[_0x31fa('0x75')](_0x31fa('0x76'),{'UserId':_0x188e57['id'],'ChatQueueId':_0xc73174['id']});});});});});}})[_0x31fa('0x1d')](respondWithStatusCode(_0x1de1c3,null))[_0x31fa('0x27')](handleError(_0x1de1c3,null));};exports['removeTeams']=function(_0x3a8abe,_0x17c106,_0x1e7996){return db[_0x31fa('0x77')][_0x31fa('0x78')]({'where':{'id':_0x3a8abe['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x31fa('0x6a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x17c106,null))['then'](function(_0x2b6714){var _0x576036=_[_0x31fa('0x38')](_0x2b6714,'id');var _0x2a2acc=[];var _0x44cf62=[];var _0x3d3395=squel['select']();_0x3d3395[_0x31fa('0x79')](_0x31fa('0x7a'))[_0x31fa('0x7b')](_0x31fa('0x7c'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x31fa('0x49')](_0x31fa('0x7d'),_0x3a8abe['params']['id']);for(var _0x85a503=0x0;_0x85a503<_0x2b6714[_0x31fa('0x44')];_0x85a503+=0x1){let _0x2a8318=_0x2b6714[_0x85a503];for(var _0x5de66c=0x0;_0x5de66c<_0x2a8318['Agents']['length'];_0x5de66c+=0x1){let _0x32d0de=_0x2a8318['Agents'][_0x5de66c];var _0x4a7371=_0x3d3395[_0x31fa('0x7e')]();_0x4a7371[_0x31fa('0x49')](_0x31fa('0x7f'),_0x32d0de['id']);_0x44cf62[_0x31fa('0x80')](db[_0x31fa('0x70')][_0x31fa('0x3d')](_0x4a7371[_0x31fa('0x81')](),{'type':db[_0x31fa('0x70')][_0x31fa('0x82')][_0x31fa('0x83')]})['then'](function(_0x58ea0c){if(_0x58ea0c[_0x31fa('0x44')]===0x1){return _0x32d0de['id'];}else{var _0xa51f08=_[_0x31fa('0x84')](_[_0x31fa('0x38')](_0x58ea0c,_0x31fa('0x85')),function(_0x2b97b3){return _[_0x31fa('0x86')](_0x576036,_0x2b97b3);});if(_0xa51f08){return _0x32d0de['id'];}}}));}}return BPromise[_0x31fa('0x87')](_0x44cf62)[_0x31fa('0x1d')](function(_0x3d1ba7){_0x2a2acc=_(_0x2a2acc)[_0x31fa('0x88')](_0x3d1ba7)[_0x31fa('0x89')]()['value']();return db['ChatQueue']['find']({'where':{'id':_0x3a8abe[_0x31fa('0x53')]['id']}})['then'](function(_0x2a88b4){return db[_0x31fa('0x70')][_0x31fa('0x71')](function(_0x5905a1){return _0x2a88b4[_0x31fa('0x8a')](_0x3a8abe[_0x31fa('0x3d')][_0x31fa('0x8b')],{'transaction':_0x5905a1})[_0x31fa('0x1d')](function(){if(!_['isEmpty'](_0x2a2acc)){return _0x2a88b4[_0x31fa('0x8c')](_0x2a2acc,{'transaction':_0x5905a1});}})[_0x31fa('0x1d')](function(){_0x2a2acc[_0x31fa('0x8d')](function(_0xe8ff14){socket[_0x31fa('0x75')](_0x31fa('0x8e'),{'UserId':_0xe8ff14,'ChatQueueId':_0x2a88b4['id']});});});});});});})['then'](respondWithStatusCode(_0x17c106,null))[_0x31fa('0x27')](handleError(_0x17c106,null));};exports[_0x31fa('0x8f')]=function(_0x58328c,_0x33f6f7,_0x507b76){return db[_0x31fa('0x4e')][_0x31fa('0x54')]({'where':{'id':_0x58328c[_0x31fa('0x53')]['id']}})[_0x31fa('0x1d')](handleEntityNotFound(_0x33f6f7,null))[_0x31fa('0x1d')](function(_0x492765){if(_0x492765){return _0x492765[_0x31fa('0x8f')](_0x58328c[_0x31fa('0x56')][_0x31fa('0x8b')],_[_0x31fa('0x90')](_0x58328c[_0x31fa('0x56')],[_0x31fa('0x8b'),'id'])||{})[_0x31fa('0x91')](function(_0x2310fc){for(var _0x2e57da=0x0;_0x2e57da<_0x58328c[_0x31fa('0x56')][_0x31fa('0x8b')][_0x31fa('0x44')];_0x2e57da+=0x1){socket[_0x31fa('0x75')](_0x31fa('0x76'),{'UserId':Number(_0x58328c['body'][_0x31fa('0x8b')][_0x2e57da]),'ChatQueueId':Number(_0x58328c[_0x31fa('0x53')]['id'])});}return _0x2310fc;});}})[_0x31fa('0x1d')](respondWithResult(_0x33f6f7,null))[_0x31fa('0x27')](handleError(_0x33f6f7,null));};exports[_0x31fa('0x8c')]=function(_0x5bcbab,_0x34647e,_0x3032e6){return db[_0x31fa('0x4e')][_0x31fa('0x54')]({'where':{'id':_0x5bcbab[_0x31fa('0x53')]['id']}})[_0x31fa('0x1d')](handleEntityNotFound(_0x34647e,null))[_0x31fa('0x1d')](function(_0x3211fa){if(_0x3211fa){return _0x3211fa[_0x31fa('0x8c')](_0x5bcbab['query'][_0x31fa('0x8b')])[_0x31fa('0x1d')](function(){if(_[_0x31fa('0x92')](_0x5bcbab[_0x31fa('0x3d')]['ids'])){for(var _0x200ec3=0x0;_0x200ec3<_0x5bcbab[_0x31fa('0x3d')][_0x31fa('0x8b')]['length'];_0x200ec3+=0x1){socket[_0x31fa('0x75')]('userChatQueue:remove',{'UserId':Number(_0x5bcbab['query'][_0x31fa('0x8b')][_0x200ec3]),'ChatQueueId':Number(_0x5bcbab['params']['id'])});}}else{socket[_0x31fa('0x75')]('userChatQueue:remove',{'UserId':Number(_0x5bcbab[_0x31fa('0x3d')][_0x31fa('0x8b')]),'ChatQueueId':Number(_0x5bcbab[_0x31fa('0x53')]['id'])});}});}})[_0x31fa('0x1d')](respondWithStatusCode(_0x34647e,null))[_0x31fa('0x27')](handleError(_0x34647e,null));};exports[_0x31fa('0x93')]=function(_0x32e5f4,_0x5027ac,_0x2a2daf){var _0x2e85cc={};var _0x40d189={};var _0x4d709a;var _0x1bb3e1;return db[_0x31fa('0x4e')][_0x31fa('0x5d')]({'where':{'id':_0x32e5f4[_0x31fa('0x53')]['id']}})['then'](handleEntityNotFound(_0x5027ac,null))[_0x31fa('0x1d')](function(_0x36331b){if(_0x36331b){_0x4d709a=_0x36331b;_0x40d189[_0x31fa('0x40')]=_['keys'](db[_0x31fa('0x6a')][_0x31fa('0x39')]);_0x40d189[_0x31fa('0x3d')]=_[_0x31fa('0x3e')](_0x32e5f4[_0x31fa('0x3d')]);_0x40d189['filters']=_[_0x31fa('0x42')](_0x40d189[_0x31fa('0x40')],_0x40d189[_0x31fa('0x3d')]);_0x2e85cc['attributes']=_['intersection'](_0x40d189[_0x31fa('0x40')],qs[_0x31fa('0x43')](_0x32e5f4[_0x31fa('0x3d')][_0x31fa('0x43')]));_0x2e85cc['attributes']=_0x2e85cc[_0x31fa('0x41')][_0x31fa('0x44')]?_0x2e85cc[_0x31fa('0x41')]:_0x40d189[_0x31fa('0x40')];_0x2e85cc[_0x31fa('0x47')]=qs[_0x31fa('0x48')](_0x32e5f4[_0x31fa('0x3d')][_0x31fa('0x48')]);_0x2e85cc[_0x31fa('0x49')]=qs[_0x31fa('0x3f')](_[_0x31fa('0x4a')](_0x32e5f4[_0x31fa('0x3d')],_0x40d189[_0x31fa('0x3f')]));if(_0x32e5f4['query'][_0x31fa('0x4b')]){_0x2e85cc[_0x31fa('0x49')]=_[_0x31fa('0x4c')](_0x2e85cc[_0x31fa('0x49')],{'$or':_[_0x31fa('0x38')](_0x2e85cc[_0x31fa('0x41')],function(_0x1eb988){var _0xce1aca={};_0xce1aca[_0x1eb988]={'$like':'%'+_0x32e5f4[_0x31fa('0x3d')][_0x31fa('0x4b')]+'%'};return _0xce1aca;})});}_0x2e85cc=_['merge']({},_0x2e85cc,_0x32e5f4['options']);return _0x4d709a['getAgents'](_0x2e85cc);}})[_0x31fa('0x1d')](function(_0x486ce8){if(_0x486ce8){_0x1bb3e1=_0x486ce8[_0x31fa('0x44')];if(!_0x32e5f4[_0x31fa('0x3d')][_0x31fa('0x45')](_0x31fa('0x46'))){_0x2e85cc['limit']=qs[_0x31fa('0x2a')](_0x32e5f4[_0x31fa('0x3d')][_0x31fa('0x2a')]);_0x2e85cc[_0x31fa('0x2c')]=qs['offset'](_0x32e5f4[_0x31fa('0x3d')]['offset']);}return _0x4d709a[_0x31fa('0x93')](_0x2e85cc);}})[_0x31fa('0x1d')](function(_0x197d05){if(_0x197d05){return _0x197d05?{'count':_0x1bb3e1,'rows':_0x197d05}:null;}})[_0x31fa('0x1d')](respondWithResult(_0x5027ac,null))[_0x31fa('0x27')](handleError(_0x5027ac,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index dd8bb01..722948d 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 _0x4134=['exports','events','ChatQueue','setMaxListeners'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x4134,0x89));var _0x4413=function(_0x12c65a,_0x3ba5ac){_0x12c65a=_0x12c65a-0x0;var _0x262a77=_0x4134[_0x12c65a];return _0x262a77;};'use strict';var EventEmitter=require(_0x4413('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x4413('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4413('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x30e001){return function(_0x373dc7,_0x5d7f2c,_0x39856d){ChatQueueEvents['emit'](_0x30e001+':'+_0x373dc7['id'],_0x373dc7);ChatQueueEvents['emit'](_0x30e001,_0x373dc7);_0x39856d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x4413('0x3')]=ChatQueueEvents;
\ No newline at end of file
+var _0x62b3=['save','update','remove','emit','hasOwnProperty','hook','setMaxListeners'];(function(_0x3c7d06,_0x3a8eb6){var _0x14be70=function(_0x14c343){while(--_0x14c343){_0x3c7d06['push'](_0x3c7d06['shift']());}};_0x14be70(++_0x3a8eb6);}(_0x62b3,0x19c));var _0x362b=function(_0x9723e4,_0x52f61c){_0x9723e4=_0x9723e4-0x0;var _0x3393e9=_0x62b3[_0x9723e4];return _0x3393e9;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x362b('0x0')](0x0);var events={'afterCreate':_0x362b('0x1'),'afterUpdate':_0x362b('0x2'),'afterDestroy':_0x362b('0x3')};function emitEvent(_0x18b4e8){return function(_0x5b65b8,_0x1a5ed3,_0x16557d){ChatQueueEvents[_0x362b('0x4')](_0x18b4e8+':'+_0x5b65b8['id'],_0x5b65b8);ChatQueueEvents[_0x362b('0x4')](_0x18b4e8,_0x5b65b8);_0x16557d(null);};}for(var e in events){if(events[_0x362b('0x5')](e)){var event=events[e];ChatQueue[_0x362b('0x6')](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 615f7e1..44ee8d2 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 _0x6093=['path','rimraf','../../config/environment','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x15891b,_0xb8c1ee){var _0x3c16ce=function(_0x230da0){while(--_0x230da0){_0x15891b['push'](_0x15891b['shift']());}};_0x3c16ce(++_0xb8c1ee);}(_0x6093,0x66));var _0x3609=function(_0x54aa73,_0x1a53a5){_0x54aa73=_0x54aa73-0x0;var _0x12e83d=_0x6093[_0x54aa73];return _0x12e83d;};'use strict';var _=require(_0x3609('0x0'));var util=require(_0x3609('0x1'));var logger=require(_0x3609('0x2'))(_0x3609('0x3'));var moment=require(_0x3609('0x4'));var BPromise=require('bluebird');var rp=require(_0x3609('0x5'));var fs=require('fs');var path=require(_0x3609('0x6'));var rimraf=require(_0x3609('0x7'));var config=require(_0x3609('0x8'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x2711f3,_0x48bd21){return _0x2711f3[_0x3609('0x9')](_0x3609('0xa'),attributes,{'tableName':_0x3609('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2f23=['moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes','define','ChatQueue','chat_queues','lodash'];(function(_0x17ebb6,_0x465af7){var _0x32ec22=function(_0x160ff0){while(--_0x160ff0){_0x17ebb6['push'](_0x17ebb6['shift']());}};_0x32ec22(++_0x465af7);}(_0x2f23,0xf9));var _0x32f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f23[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x32f2('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x32f2('0x1'));var BPromise=require(_0x32f2('0x2'));var rp=require(_0x32f2('0x3'));var fs=require('fs');var path=require(_0x32f2('0x4'));var rimraf=require(_0x32f2('0x5'));var config=require('../../config/environment');var attributes=require(_0x32f2('0x6'));module['exports']=function(_0x35444f,_0x2b04fb){return _0x35444f[_0x32f2('0x7')](_0x32f2('0x8'),attributes,{'tableName':_0x32f2('0x9'),'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 664c017..c2a9f22 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 _0x3746=['catch','GetChatQueue','options','raw','where','attributes','limit','include','map','model','stringify','find','ShowChatQueue','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x5318fc,_0x22b166){var _0x5537d6=function(_0x3e9e8a){while(--_0x3e9e8a){_0x5318fc['push'](_0x5318fc['shift']());}};_0x5537d6(++_0x22b166);}(_0x3746,0xa9));var _0x6374=function(_0x28076e,_0x3c2b2c){_0x28076e=_0x28076e-0x0;var _0x53eb69=_0x3746[_0x28076e];return _0x53eb69;};'use strict';var _=require(_0x6374('0x0'));var util=require(_0x6374('0x1'));var moment=require('moment');var BPromise=require(_0x6374('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6374('0x3'));var db=require(_0x6374('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6374('0x5'));var config=require(_0x6374('0x6'));var jayson=require(_0x6374('0x7'));var client=jayson[_0x6374('0x8')][_0x6374('0x9')]({'port':0x232a});config[_0x6374('0xa')]=_[_0x6374('0xb')](config[_0x6374('0xa')],{'host':_0x6374('0xc'),'port':0x18eb});var socket=require(_0x6374('0xd'))(new Redis(config['redis']));require(_0x6374('0xe'))['register'](socket);function respondWithRpcPromise(_0x323af1,_0x32b4d3,_0x1acacf){return new BPromise(function(_0x585eed,_0x154b00){return client[_0x6374('0xf')](_0x323af1,_0x1acacf)[_0x6374('0x10')](function(_0x4f0189){logger[_0x6374('0x11')](_0x6374('0x12'),_0x32b4d3,'request\x20sent');logger[_0x6374('0x13')](_0x6374('0x14'),_0x32b4d3,_0x6374('0x15'),JSON['stringify'](_0x4f0189));if(_0x4f0189[_0x6374('0x16')]){if(_0x4f0189[_0x6374('0x16')][_0x6374('0x17')]===0x1f4){logger['error'](_0x6374('0x12'),_0x32b4d3,_0x4f0189['error']['message']);return _0x154b00(_0x4f0189[_0x6374('0x16')]['message']);}logger[_0x6374('0x16')](_0x6374('0x12'),_0x32b4d3,_0x4f0189[_0x6374('0x16')][_0x6374('0x18')]);return _0x585eed(_0x4f0189[_0x6374('0x16')][_0x6374('0x18')]);}else{logger[_0x6374('0x11')](_0x6374('0x12'),_0x32b4d3,_0x6374('0x15'));_0x585eed(_0x4f0189[_0x6374('0x19')][_0x6374('0x18')]);}})[_0x6374('0x1a')](function(_0x4f8db8){logger[_0x6374('0x16')](_0x6374('0x12'),_0x32b4d3,_0x4f8db8);_0x154b00(_0x4f8db8);});});}exports[_0x6374('0x1b')]=function(_0x46fdc2){var _0x3b8ed2=this;return new Promise(function(_0x3ec117,_0x101d49){return db['ChatQueue']['findAll']({'raw':_0x46fdc2[_0x6374('0x1c')]?_0x46fdc2['options'][_0x6374('0x1d')]===undefined?!![]:![]:!![],'where':_0x46fdc2[_0x6374('0x1c')]?_0x46fdc2[_0x6374('0x1c')][_0x6374('0x1e')]||null:null,'attributes':_0x46fdc2['options']?_0x46fdc2[_0x6374('0x1c')][_0x6374('0x1f')]||null:null,'limit':_0x46fdc2[_0x6374('0x1c')]?_0x46fdc2[_0x6374('0x1c')][_0x6374('0x20')]||null:null,'include':_0x46fdc2[_0x6374('0x1c')]?_0x46fdc2[_0x6374('0x1c')][_0x6374('0x21')]?_['map'](_0x46fdc2[_0x6374('0x1c')][_0x6374('0x21')],function(_0x1b8f18){return{'model':db[_0x1b8f18['model']],'as':_0x1b8f18['as'],'attributes':_0x1b8f18[_0x6374('0x1f')],'include':_0x1b8f18['include']?_[_0x6374('0x22')](_0x1b8f18[_0x6374('0x21')],function(_0x8d5419){return{'model':db[_0x8d5419[_0x6374('0x23')]],'as':_0x8d5419['as'],'attributes':_0x8d5419[_0x6374('0x1f')],'include':_0x8d5419[_0x6374('0x21')]?_[_0x6374('0x22')](_0x8d5419[_0x6374('0x21')],function(_0x2f1f06){return{'model':db[_0x2f1f06['model']],'as':_0x2f1f06['as'],'attributes':_0x2f1f06[_0x6374('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6374('0x10')](function(_0x11ae6d){logger['info'](_0x6374('0x1b'),_0x46fdc2);logger[_0x6374('0x13')]('GetChatQueue',_0x46fdc2,JSON[_0x6374('0x24')](_0x11ae6d));_0x3ec117(_0x11ae6d);})['catch'](function(_0x4b7038){logger['error']('GetChatQueue',_0x4b7038['message'],_0x46fdc2);_0x101d49(_0x3b8ed2[_0x6374('0x16')](0x1f4,_0x4b7038['message']));});});};exports['ShowChatQueue']=function(_0x3e7278){var _0x413043=this;return new Promise(function(_0x3e5a5a,_0x37906f){return db['ChatQueue'][_0x6374('0x25')]({'raw':_0x3e7278['options']?_0x3e7278[_0x6374('0x1c')][_0x6374('0x1d')]===undefined?!![]:![]:!![],'where':_0x3e7278[_0x6374('0x1c')]?_0x3e7278[_0x6374('0x1c')][_0x6374('0x1e')]||null:null,'attributes':_0x3e7278[_0x6374('0x1c')]?_0x3e7278[_0x6374('0x1c')][_0x6374('0x1f')]||null:null,'include':_0x3e7278[_0x6374('0x1c')]?_0x3e7278['options'][_0x6374('0x21')]?_[_0x6374('0x22')](_0x3e7278['options'][_0x6374('0x21')],function(_0x253bb1){return{'model':db[_0x253bb1[_0x6374('0x23')]],'as':_0x253bb1['as'],'attributes':_0x253bb1[_0x6374('0x1f')],'include':_0x253bb1[_0x6374('0x21')]?_[_0x6374('0x22')](_0x253bb1['include'],function(_0x38b7f6){return{'model':db[_0x38b7f6[_0x6374('0x23')]],'as':_0x38b7f6['as'],'attributes':_0x38b7f6[_0x6374('0x1f')],'include':_0x38b7f6[_0x6374('0x21')]?_[_0x6374('0x22')](_0x38b7f6[_0x6374('0x21')],function(_0x3f309a){return{'model':db[_0x3f309a['model']],'as':_0x3f309a['as'],'attributes':_0x3f309a[_0x6374('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6374('0x10')](function(_0x18206e){logger['info'](_0x6374('0x26'),_0x3e7278);logger[_0x6374('0x13')]('ShowChatQueue',_0x3e7278,JSON[_0x6374('0x24')](_0x18206e));_0x3e5a5a(_0x18206e);})[_0x6374('0x1a')](function(_0x2d0100){logger[_0x6374('0x16')](_0x6374('0x26'),_0x2d0100['message'],_0x3e7278);_0x37906f(_0x413043[_0x6374('0x16')](0x1f4,_0x2d0100[_0x6374('0x18')]));});});};
\ No newline at end of file
+var _0xbb35=['include','ShowChatQueue','ChatQueue','find','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','GetChatQueue','findAll','options','where','attributes','limit','map','model'];(function(_0x10bf44,_0x33564a){var _0x542225=function(_0x4d617d){while(--_0x4d617d){_0x10bf44['push'](_0x10bf44['shift']());}};_0x542225(++_0x33564a);}(_0xbb35,0x1d3));var _0x5bb3=function(_0x54d8c5,_0x236001){_0x54d8c5=_0x54d8c5-0x0;var _0x210790=_0xbb35[_0x54d8c5];return _0x210790;};'use strict';var _=require('lodash');var util=require(_0x5bb3('0x0'));var moment=require(_0x5bb3('0x1'));var BPromise=require(_0x5bb3('0x2'));var rs=require(_0x5bb3('0x3'));var fs=require('fs');var Redis=require(_0x5bb3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5bb3('0x5'));var logger=require(_0x5bb3('0x6'))(_0x5bb3('0x7'));var config=require(_0x5bb3('0x8'));var jayson=require(_0x5bb3('0x9'));var client=jayson[_0x5bb3('0xa')][_0x5bb3('0xb')]({'port':0x232a});config[_0x5bb3('0xc')]=_[_0x5bb3('0xd')](config['redis'],{'host':_0x5bb3('0xe'),'port':0x18eb});var socket=require(_0x5bb3('0xf'))(new Redis(config[_0x5bb3('0xc')]));require(_0x5bb3('0x10'))['register'](socket);function respondWithRpcPromise(_0x399f28,_0x5621a8,_0x4035d1){return new BPromise(function(_0x5a8b3b,_0x12513f){return client[_0x5bb3('0x11')](_0x399f28,_0x4035d1)[_0x5bb3('0x12')](function(_0x3212c8){logger[_0x5bb3('0x13')]('ChatQueue,\x20%s,\x20%s',_0x5621a8,_0x5bb3('0x14'));logger[_0x5bb3('0x15')](_0x5bb3('0x16'),_0x5621a8,'request\x20sent',JSON[_0x5bb3('0x17')](_0x3212c8));if(_0x3212c8[_0x5bb3('0x18')]){if(_0x3212c8[_0x5bb3('0x18')][_0x5bb3('0x19')]===0x1f4){logger[_0x5bb3('0x18')](_0x5bb3('0x1a'),_0x5621a8,_0x3212c8[_0x5bb3('0x18')][_0x5bb3('0x1b')]);return _0x12513f(_0x3212c8['error']['message']);}logger['error'](_0x5bb3('0x1a'),_0x5621a8,_0x3212c8[_0x5bb3('0x18')][_0x5bb3('0x1b')]);return _0x5a8b3b(_0x3212c8[_0x5bb3('0x18')][_0x5bb3('0x1b')]);}else{logger[_0x5bb3('0x13')](_0x5bb3('0x1a'),_0x5621a8,_0x5bb3('0x14'));_0x5a8b3b(_0x3212c8[_0x5bb3('0x1c')][_0x5bb3('0x1b')]);}})['catch'](function(_0x5a541b){logger[_0x5bb3('0x18')](_0x5bb3('0x1a'),_0x5621a8,_0x5a541b);_0x12513f(_0x5a541b);});});}exports[_0x5bb3('0x1d')]=function(_0x442ee2){var _0x197d38=this;return new Promise(function(_0x3fe551,_0x2630b4){return db['ChatQueue'][_0x5bb3('0x1e')]({'raw':_0x442ee2[_0x5bb3('0x1f')]?_0x442ee2[_0x5bb3('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x442ee2[_0x5bb3('0x1f')]?_0x442ee2['options'][_0x5bb3('0x20')]||null:null,'attributes':_0x442ee2['options']?_0x442ee2[_0x5bb3('0x1f')][_0x5bb3('0x21')]||null:null,'limit':_0x442ee2[_0x5bb3('0x1f')]?_0x442ee2[_0x5bb3('0x1f')][_0x5bb3('0x22')]||null:null,'include':_0x442ee2[_0x5bb3('0x1f')]?_0x442ee2[_0x5bb3('0x1f')]['include']?_[_0x5bb3('0x23')](_0x442ee2[_0x5bb3('0x1f')]['include'],function(_0x439ee4){return{'model':db[_0x439ee4[_0x5bb3('0x24')]],'as':_0x439ee4['as'],'attributes':_0x439ee4[_0x5bb3('0x21')],'include':_0x439ee4[_0x5bb3('0x25')]?_[_0x5bb3('0x23')](_0x439ee4[_0x5bb3('0x25')],function(_0x405eea){return{'model':db[_0x405eea[_0x5bb3('0x24')]],'as':_0x405eea['as'],'attributes':_0x405eea['attributes'],'include':_0x405eea['include']?_[_0x5bb3('0x23')](_0x405eea['include'],function(_0x182516){return{'model':db[_0x182516['model']],'as':_0x182516['as'],'attributes':_0x182516[_0x5bb3('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5bb3('0x12')](function(_0x104efe){logger['info'](_0x5bb3('0x1d'),_0x442ee2);logger[_0x5bb3('0x15')](_0x5bb3('0x1d'),_0x442ee2,JSON[_0x5bb3('0x17')](_0x104efe));_0x3fe551(_0x104efe);})['catch'](function(_0x55276b){logger[_0x5bb3('0x18')]('GetChatQueue',_0x55276b[_0x5bb3('0x1b')],_0x442ee2);_0x2630b4(_0x197d38[_0x5bb3('0x18')](0x1f4,_0x55276b['message']));});});};exports[_0x5bb3('0x26')]=function(_0xd935a7){var _0x3d7115=this;return new Promise(function(_0xe5981a,_0x46ba29){return db[_0x5bb3('0x27')][_0x5bb3('0x28')]({'raw':_0xd935a7['options']?_0xd935a7[_0x5bb3('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0xd935a7[_0x5bb3('0x1f')]?_0xd935a7[_0x5bb3('0x1f')][_0x5bb3('0x20')]||null:null,'attributes':_0xd935a7[_0x5bb3('0x1f')]?_0xd935a7['options']['attributes']||null:null,'include':_0xd935a7[_0x5bb3('0x1f')]?_0xd935a7[_0x5bb3('0x1f')][_0x5bb3('0x25')]?_[_0x5bb3('0x23')](_0xd935a7[_0x5bb3('0x1f')][_0x5bb3('0x25')],function(_0x4a7678){return{'model':db[_0x4a7678[_0x5bb3('0x24')]],'as':_0x4a7678['as'],'attributes':_0x4a7678[_0x5bb3('0x21')],'include':_0x4a7678[_0x5bb3('0x25')]?_[_0x5bb3('0x23')](_0x4a7678[_0x5bb3('0x25')],function(_0x5df4c5){return{'model':db[_0x5df4c5[_0x5bb3('0x24')]],'as':_0x5df4c5['as'],'attributes':_0x5df4c5[_0x5bb3('0x21')],'include':_0x5df4c5[_0x5bb3('0x25')]?_[_0x5bb3('0x23')](_0x5df4c5[_0x5bb3('0x25')],function(_0x24ff2c){return{'model':db[_0x24ff2c[_0x5bb3('0x24')]],'as':_0x24ff2c['as'],'attributes':_0x24ff2c[_0x5bb3('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5bb3('0x12')](function(_0x19c820){logger['info'](_0x5bb3('0x26'),_0xd935a7);logger[_0x5bb3('0x15')](_0x5bb3('0x26'),_0xd935a7,JSON[_0x5bb3('0x17')](_0x19c820));_0xe5981a(_0x19c820);})[_0x5bb3('0x29')](function(_0x40cc9d){logger[_0x5bb3('0x18')](_0x5bb3('0x26'),_0x40cc9d[_0x5bb3('0x1b')],_0xd935a7);_0x46ba29(_0x3d7115[_0x5bb3('0x18')](0x1f4,_0x40cc9d[_0x5bb3('0x1b')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 2de3ba7..160499e 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 _0x1cc7=['remove','emit','length','chatQueue:','./chatQueue.events','save'];(function(_0xf6b6f7,_0x4a24e3){var _0x357b1a=function(_0x33c32d){while(--_0x33c32d){_0xf6b6f7['push'](_0xf6b6f7['shift']());}};_0x357b1a(++_0x4a24e3);}(_0x1cc7,0x15a));var _0x71cc=function(_0x1c6118,_0x225e9a){_0x1c6118=_0x1c6118-0x0;var _0x5da93e=_0x1cc7[_0x1c6118];return _0x5da93e;};'use strict';var ChatQueueEvents=require(_0x71cc('0x0'));var events=[_0x71cc('0x1'),_0x71cc('0x2'),'update'];function createListener(_0x4db9cd,_0x547fe6){return function(_0xe5d54e){_0x547fe6[_0x71cc('0x3')](_0x4db9cd,_0xe5d54e);};}function removeListener(_0x402191,_0x5431e1){return function(){ChatQueueEvents['removeListener'](_0x402191,_0x5431e1);};}exports['register']=function(_0x27a175){for(var _0x4ecf81=0x0,_0xc0444e=events[_0x71cc('0x4')];_0x4ecf81<_0xc0444e;_0x4ecf81++){var _0x4039ce=events[_0x4ecf81];var _0x2e70f0=createListener(_0x71cc('0x5')+_0x4039ce,_0x27a175);ChatQueueEvents['on'](_0x4039ce,_0x2e70f0);}};
\ No newline at end of file
+var _0xf3cd=['remove','update','emit','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3f1b36,_0x205b14){_0x3f1b36=_0x3f1b36-0x0;var _0x56a704=_0xf3cd[_0x3f1b36];return _0x56a704;};'use strict';var ChatQueueEvents=require(_0xdf3c('0x0'));var events=[_0xdf3c('0x1'),_0xdf3c('0x2'),_0xdf3c('0x3')];function createListener(_0x1839ec,_0x433a7f){return function(_0x54db05){_0x433a7f[_0xdf3c('0x4')](_0x1839ec,_0x54db05);};}function removeListener(_0x71b446,_0x9f71cb){return function(){ChatQueueEvents['removeListener'](_0x71b446,_0x9f71cb);};}exports[_0xdf3c('0x5')]=function(_0x17d42a){for(var _0x1313d5=0x0,_0x1f0601=events[_0xdf3c('0x6')];_0x1313d5<_0x1f0601;_0x1313d5++){var _0x28edae=events[_0x1313d5];var _0x52c073=createListener(_0xdf3c('0x7')+_0x28edae,_0x17d42a);ChatQueueEvents['on'](_0x28edae,_0x52c073);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index bf82a13..ea45887 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 _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x496380,_0xdf128a){var _0x438e2f=function(_0x15dfb5){while(--_0x15dfb5){_0x496380['push'](_0x496380['shift']());}};_0x438e2f(++_0xdf128a);}(_0x55ca,0x126));var _0xa55c=function(_0x22b70f,_0x4c853f){_0x22b70f=_0x22b70f-0x0;var _0x100985=_0x55ca[_0x22b70f];return _0x100985;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
+var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x15a7c5,_0x64f633){var _0x5aa80d=function(_0x3c4e90){while(--_0x3c4e90){_0x15a7c5['push'](_0x15a7c5['shift']());}};_0x5aa80d(++_0x64f633);}(_0x7217,0x19e));var _0x7721=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x7217[_0x21aec3];return _0x288bbc;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index a38a232..1f85bd4 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 _0x4c9e=['DATE','sequelize','exports','STRING'];(function(_0x2d8864,_0x34171a){var _0x435a6a=function(_0x3deecd){while(--_0x3deecd){_0x2d8864['push'](_0x2d8864['shift']());}};_0x435a6a(++_0x34171a);}(_0x4c9e,0x145));var _0xe4c9=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x4c9e[_0xae7c2f];return _0x5d7001;};'use strict';var moment=require('moment');var Sequelize=require(_0xe4c9('0x0'));module[_0xe4c9('0x1')]={'uniqueid':{'type':Sequelize[_0xe4c9('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xe4c9('0x2')]},'joinAt':{'type':Sequelize[_0xe4c9('0x3')]},'leaveAt':{'type':Sequelize[_0xe4c9('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xe4c9('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xfcfc=['DATE','sequelize','exports','STRING'];(function(_0x5c67f9,_0x5f4d01){var _0x3c86b6=function(_0x551c0f){while(--_0x551c0f){_0x5c67f9['push'](_0x5c67f9['shift']());}};_0x3c86b6(++_0x5f4d01);}(_0xfcfc,0xf9));var _0xcfcf=function(_0x35a21d,_0x3c92d9){_0x35a21d=_0x35a21d-0x0;var _0x564e89=_0xfcfc[_0x35a21d];return _0x564e89;};'use strict';var moment=require('moment');var Sequelize=require(_0xcfcf('0x0'));module[_0xcfcf('0x1')]={'uniqueid':{'type':Sequelize[_0xcfcf('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xcfcf('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xcfcf('0x3')]},'reason':{'type':Sequelize[_0xcfcf('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 6b160e1..bbc27af 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 _0xe451=['count','update','then','destroy','sendStatus','error','name','send','map','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','ChatQueueReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','zip-dir','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit'];(function(_0x5c7621,_0x2e4e44){var _0x3406c1=function(_0x39cd44){while(--_0x39cd44){_0x5c7621['push'](_0x5c7621['shift']());}};_0x3406c1(++_0x2e4e44);}(_0xe451,0xec));var _0x1e45=function(_0x3f5172,_0x5c6313){_0x3f5172=_0x3f5172-0x0;var _0xa29e3b=_0xe451[_0x3f5172];return _0xa29e3b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1e45('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1e45('0x1'));var Mustache=require(_0x1e45('0x2'));var util=require(_0x1e45('0x3'));var path=require(_0x1e45('0x4'));var sox=require('sox');var csv=require(_0x1e45('0x5'));var ejs=require(_0x1e45('0x6'));var fs=require('fs');var fs_extra=require(_0x1e45('0x7'));var _=require('lodash');var squel=require(_0x1e45('0x8'));var crypto=require(_0x1e45('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1e45('0x5'));var querystring=require(_0x1e45('0xa'));var Papa=require(_0x1e45('0xb'));var Redis=require('ioredis');var authService=require(_0x1e45('0xc'));var qs=require(_0x1e45('0xd'));var as=require(_0x1e45('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1e45('0xf'));var utils=require(_0x1e45('0x10'));var config=require(_0x1e45('0x11'));var licenseUtil=require(_0x1e45('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16cafc,_0x2ec564){_0x2ec564=_0x2ec564||0xcc;return function(_0x3d25a8){if(_0x3d25a8){return _0x16cafc['sendStatus'](_0x2ec564);}return _0x16cafc[_0x1e45('0x13')](_0x2ec564)[_0x1e45('0x14')]();};}function respondWithResult(_0x31215a,_0x21f68d){_0x21f68d=_0x21f68d||0xc8;return function(_0x5b3ee1){if(_0x5b3ee1){return _0x31215a[_0x1e45('0x13')](_0x21f68d)['json'](_0x5b3ee1);}};}function respondWithFilteredResult(_0xf66042,_0x2c7ace){return function(_0x4e1400){if(_0x4e1400){var _0xfdeae3=typeof _0x2c7ace[_0x1e45('0x15')]===_0x1e45('0x16')&&typeof _0x2c7ace[_0x1e45('0x17')]===_0x1e45('0x16');var _0x308c29=_0x4e1400[_0x1e45('0x18')];var _0x2a6f47=_0xfdeae3?0x0:_0x2c7ace[_0x1e45('0x15')];var _0x5d24a7=_0xfdeae3?_0x4e1400[_0x1e45('0x18')]:_0x2c7ace['offset']+_0x2c7ace['limit'];var _0x17c63a;if(_0x5d24a7>=_0x308c29){_0x5d24a7=_0x308c29;_0x17c63a=0xc8;}else{_0x17c63a=0xce;}_0xf66042['status'](_0x17c63a);return _0xf66042['set']('Content-Range',_0x2a6f47+'-'+_0x5d24a7+'/'+_0x308c29)['json'](_0x4e1400);}return null;};}function patchUpdates(_0x207335){return function(_0x4476eb){try{jsonpatch['apply'](_0x4476eb,_0x207335,!![]);}catch(_0xc0deec){return BPromise['reject'](_0xc0deec);}return _0x4476eb['save']();};}function saveUpdates(_0x41cfae,_0x59aaa7){return function(_0x4ffe97){if(_0x4ffe97){return _0x4ffe97[_0x1e45('0x19')](_0x41cfae)[_0x1e45('0x1a')](function(_0x4ce4c5){return _0x4ce4c5;});}return null;};}function removeEntity(_0x48209a,_0x2fb478){return function(_0x40c216){if(_0x40c216){return _0x40c216[_0x1e45('0x1b')]()[_0x1e45('0x1a')](function(){_0x48209a[_0x1e45('0x13')](0xcc)[_0x1e45('0x14')]();});}};}function handleEntityNotFound(_0x55e968,_0x3f6771){return function(_0x394f7e){if(!_0x394f7e){_0x55e968[_0x1e45('0x1c')](0x194);}return _0x394f7e;};}function handleError(_0x25b131,_0x1a8355){_0x1a8355=_0x1a8355||0x1f4;return function(_0xfd7633){logger[_0x1e45('0x1d')](_0xfd7633['stack']);if(_0xfd7633[_0x1e45('0x1e')]){delete _0xfd7633[_0x1e45('0x1e')];}_0x25b131[_0x1e45('0x13')](_0x1a8355)[_0x1e45('0x1f')](_0xfd7633);};}exports['index']=function(_0xe7cdcf,_0x34046e){var _0x3dd6c3={},_0x5229e7={},_0x3def67={'count':0x0,'rows':[]};var _0x4a04aa=_[_0x1e45('0x20')](db['ChatQueueReport']['rawAttributes'],function(_0x34d75e){return{'name':_0x34d75e[_0x1e45('0x21')],'type':_0x34d75e[_0x1e45('0x22')][_0x1e45('0x23')]};});_0x5229e7['model']=_[_0x1e45('0x20')](_0x4a04aa,'name');_0x5229e7[_0x1e45('0x24')]=_[_0x1e45('0x25')](_0xe7cdcf[_0x1e45('0x24')]);_0x5229e7['filters']=_[_0x1e45('0x26')](_0x5229e7[_0x1e45('0x27')],_0x5229e7[_0x1e45('0x24')]);_0x3dd6c3['attributes']=_[_0x1e45('0x26')](_0x5229e7[_0x1e45('0x27')],qs[_0x1e45('0x28')](_0xe7cdcf[_0x1e45('0x24')]['fields']));_0x3dd6c3[_0x1e45('0x29')]=_0x3dd6c3[_0x1e45('0x29')][_0x1e45('0x2a')]?_0x3dd6c3[_0x1e45('0x29')]:_0x5229e7[_0x1e45('0x27')];if(!_0xe7cdcf['query']['hasOwnProperty']('nolimit')){_0x3dd6c3['limit']=qs[_0x1e45('0x17')](_0xe7cdcf['query'][_0x1e45('0x17')]);_0x3dd6c3[_0x1e45('0x15')]=qs['offset'](_0xe7cdcf['query'][_0x1e45('0x15')]);}_0x3dd6c3[_0x1e45('0x2b')]=qs[_0x1e45('0x2c')](_0xe7cdcf[_0x1e45('0x24')]['sort']);_0x3dd6c3[_0x1e45('0x2d')]=qs[_0x1e45('0x2e')](_[_0x1e45('0x2f')](_0xe7cdcf[_0x1e45('0x24')],_0x5229e7['filters']),_0x4a04aa);if(_0xe7cdcf[_0x1e45('0x24')][_0x1e45('0x30')]){_0x3dd6c3[_0x1e45('0x2d')]=_['merge'](_0x3dd6c3['where'],{'$or':_[_0x1e45('0x20')](_0x4a04aa,function(_0x47c200){if(_0x47c200['type']!==_0x1e45('0x31')){var _0x587a0a={};_0x587a0a[_0x47c200['name']]={'$like':'%'+_0xe7cdcf[_0x1e45('0x24')][_0x1e45('0x30')]+'%'};return _0x587a0a;}})});}_0x3dd6c3=_[_0x1e45('0x32')]({},_0x3dd6c3,_0xe7cdcf[_0x1e45('0x33')]);var _0x11a327={'where':_0x3dd6c3[_0x1e45('0x2d')]};return db[_0x1e45('0x34')][_0x1e45('0x18')](_0x11a327)[_0x1e45('0x1a')](function(_0x53713a){_0x3def67[_0x1e45('0x18')]=_0x53713a;if(_0xe7cdcf[_0x1e45('0x24')][_0x1e45('0x35')]){_0x3dd6c3[_0x1e45('0x36')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x1e45('0x37')](_0x3dd6c3);})[_0x1e45('0x1a')](function(_0x2984ae){_0x3def67[_0x1e45('0x38')]=_0x2984ae;return _0x3def67;})['then'](respondWithFilteredResult(_0x34046e,_0x3dd6c3))[_0x1e45('0x39')](handleError(_0x34046e,null));};exports[_0x1e45('0x3a')]=function(_0x32a42a,_0x393a50){var _0x522b40={'raw':!![],'where':{'id':_0x32a42a[_0x1e45('0x3b')]['id']}},_0x460d38={};_0x460d38[_0x1e45('0x27')]=_[_0x1e45('0x25')](db[_0x1e45('0x34')][_0x1e45('0x3c')]);_0x460d38['query']=_[_0x1e45('0x25')](_0x32a42a['query']);_0x460d38[_0x1e45('0x2e')]=_[_0x1e45('0x26')](_0x460d38[_0x1e45('0x27')],_0x460d38[_0x1e45('0x24')]);_0x522b40[_0x1e45('0x29')]=_[_0x1e45('0x26')](_0x460d38['model'],qs[_0x1e45('0x28')](_0x32a42a[_0x1e45('0x24')][_0x1e45('0x28')]));_0x522b40['attributes']=_0x522b40[_0x1e45('0x29')][_0x1e45('0x2a')]?_0x522b40[_0x1e45('0x29')]:_0x460d38['model'];if(_0x32a42a['query']['includeAll']){_0x522b40[_0x1e45('0x36')]=[{'all':!![]}];}_0x522b40=_[_0x1e45('0x32')]({},_0x522b40,_0x32a42a[_0x1e45('0x33')]);return db[_0x1e45('0x34')]['find'](_0x522b40)[_0x1e45('0x1a')](handleEntityNotFound(_0x393a50,null))[_0x1e45('0x1a')](respondWithResult(_0x393a50,null))[_0x1e45('0x39')](handleError(_0x393a50,null));};exports[_0x1e45('0x3d')]=function(_0x3994d8,_0x53e41b){return db[_0x1e45('0x34')][_0x1e45('0x3d')](_0x3994d8[_0x1e45('0x3e')],{})[_0x1e45('0x1a')](respondWithResult(_0x53e41b,0xc9))[_0x1e45('0x39')](handleError(_0x53e41b,null));};exports['update']=function(_0x374c32,_0x14b06f){if(_0x374c32[_0x1e45('0x3e')]['id']){delete _0x374c32[_0x1e45('0x3e')]['id'];}return db[_0x1e45('0x34')][_0x1e45('0x3f')]({'where':{'id':_0x374c32['params']['id']}})[_0x1e45('0x1a')](handleEntityNotFound(_0x14b06f,null))[_0x1e45('0x1a')](saveUpdates(_0x374c32['body'],null))[_0x1e45('0x1a')](respondWithResult(_0x14b06f,null))['catch'](handleError(_0x14b06f,null));};exports[_0x1e45('0x1b')]=function(_0x3e6845,_0x5bafc7){return db[_0x1e45('0x34')][_0x1e45('0x3f')]({'where':{'id':_0x3e6845[_0x1e45('0x3b')]['id']}})[_0x1e45('0x1a')](handleEntityNotFound(_0x5bafc7,null))[_0x1e45('0x1a')](removeEntity(_0x5bafc7,null))[_0x1e45('0x39')](handleError(_0x5bafc7,null));};exports[_0x1e45('0x40')]=function(_0x4cdf47,_0x2f19f3){return db[_0x1e45('0x34')]['describe']()['then'](respondWithResult(_0x2f19f3,null))[_0x1e45('0x39')](handleError(_0x2f19f3,null));};
\ No newline at end of file
+var _0x363e=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','ChatQueueReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','length','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x5da8b9,_0xd99e62){var _0x2e08d8=function(_0x3844c5){while(--_0x3844c5){_0x5da8b9['push'](_0x5da8b9['shift']());}};_0x2e08d8(++_0xd99e62);}(_0x363e,0x179));var _0xe363=function(_0x27ccfa,_0x4885d1){_0x27ccfa=_0x27ccfa-0x0;var _0x2f4f2=_0x363e[_0x27ccfa];return _0x2f4f2;};'use strict';var emlformat=require(_0xe363('0x0'));var rimraf=require(_0xe363('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe363('0x2'));var rp=require(_0xe363('0x3'));var moment=require(_0xe363('0x4'));var BPromise=require(_0xe363('0x5'));var Mustache=require(_0xe363('0x6'));var util=require(_0xe363('0x7'));var path=require(_0xe363('0x8'));var sox=require(_0xe363('0x9'));var csv=require(_0xe363('0xa'));var ejs=require(_0xe363('0xb'));var fs=require('fs');var fs_extra=require(_0xe363('0xc'));var _=require('lodash');var squel=require(_0xe363('0xd'));var crypto=require(_0xe363('0xe'));var jsforce=require(_0xe363('0xf'));var deskjs=require(_0xe363('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe363('0x11'));var Papa=require(_0xe363('0x12'));var Redis=require(_0xe363('0x13'));var authService=require(_0xe363('0x14'));var qs=require(_0xe363('0x15'));var as=require(_0xe363('0x16'));var hardwareService=require(_0xe363('0x17'));var logger=require('../../config/logger')(_0xe363('0x18'));var utils=require(_0xe363('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xe363('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e1fb0,_0x8b6974){_0x8b6974=_0x8b6974||0xcc;return function(_0x21cb92){if(_0x21cb92){return _0x4e1fb0[_0xe363('0x1b')](_0x8b6974);}return _0x4e1fb0[_0xe363('0x1c')](_0x8b6974)[_0xe363('0x1d')]();};}function respondWithResult(_0x563fbf,_0x17ff61){_0x17ff61=_0x17ff61||0xc8;return function(_0x22b227){if(_0x22b227){return _0x563fbf['status'](_0x17ff61)[_0xe363('0x1e')](_0x22b227);}};}function respondWithFilteredResult(_0x2ad0e9,_0x52e6c6){return function(_0x3c74f9){if(_0x3c74f9){var _0x73ef9a=typeof _0x52e6c6['offset']===_0xe363('0x1f')&&typeof _0x52e6c6[_0xe363('0x20')]==='undefined';var _0xecbe2c=_0x3c74f9[_0xe363('0x21')];var _0x2f2c20=_0x73ef9a?0x0:_0x52e6c6['offset'];var _0x287104=_0x73ef9a?_0x3c74f9[_0xe363('0x21')]:_0x52e6c6['offset']+_0x52e6c6[_0xe363('0x20')];var _0x110e59;if(_0x287104>=_0xecbe2c){_0x287104=_0xecbe2c;_0x110e59=0xc8;}else{_0x110e59=0xce;}_0x2ad0e9[_0xe363('0x1c')](_0x110e59);return _0x2ad0e9[_0xe363('0x22')](_0xe363('0x23'),_0x2f2c20+'-'+_0x287104+'/'+_0xecbe2c)[_0xe363('0x1e')](_0x3c74f9);}return null;};}function patchUpdates(_0x4ee855){return function(_0x3bed39){try{jsonpatch[_0xe363('0x24')](_0x3bed39,_0x4ee855,!![]);}catch(_0x14ff95){return BPromise[_0xe363('0x25')](_0x14ff95);}return _0x3bed39[_0xe363('0x26')]();};}function saveUpdates(_0x42928e,_0x24199a){return function(_0xaff56f){if(_0xaff56f){return _0xaff56f[_0xe363('0x27')](_0x42928e)[_0xe363('0x28')](function(_0x1de673){return _0x1de673;});}return null;};}function removeEntity(_0x441b94,_0x11556d){return function(_0x388223){if(_0x388223){return _0x388223[_0xe363('0x29')]()[_0xe363('0x28')](function(){_0x441b94[_0xe363('0x1c')](0xcc)[_0xe363('0x1d')]();});}};}function handleEntityNotFound(_0x19c7b4,_0x3e24ad){return function(_0x312d75){if(!_0x312d75){_0x19c7b4[_0xe363('0x1b')](0x194);}return _0x312d75;};}function handleError(_0x5b2b3d,_0xbdfae9){_0xbdfae9=_0xbdfae9||0x1f4;return function(_0x12358b){logger[_0xe363('0x2a')](_0x12358b[_0xe363('0x2b')]);if(_0x12358b[_0xe363('0x2c')]){delete _0x12358b['name'];}_0x5b2b3d[_0xe363('0x1c')](_0xbdfae9)[_0xe363('0x2d')](_0x12358b);};}exports['index']=function(_0x3cc130,_0x5a790c){var _0x3ed3e1={},_0x45d664={},_0x4c739d={'count':0x0,'rows':[]};var _0x357b6f=_[_0xe363('0x2e')](db[_0xe363('0x2f')]['rawAttributes'],function(_0x40671e){return{'name':_0x40671e[_0xe363('0x30')],'type':_0x40671e[_0xe363('0x31')][_0xe363('0x32')]};});_0x45d664['model']=_[_0xe363('0x2e')](_0x357b6f,_0xe363('0x2c'));_0x45d664[_0xe363('0x33')]=_[_0xe363('0x34')](_0x3cc130[_0xe363('0x33')]);_0x45d664[_0xe363('0x35')]=_[_0xe363('0x36')](_0x45d664[_0xe363('0x37')],_0x45d664[_0xe363('0x33')]);_0x3ed3e1[_0xe363('0x38')]=_['intersection'](_0x45d664['model'],qs[_0xe363('0x39')](_0x3cc130[_0xe363('0x33')]['fields']));_0x3ed3e1[_0xe363('0x38')]=_0x3ed3e1[_0xe363('0x38')]['length']?_0x3ed3e1[_0xe363('0x38')]:_0x45d664[_0xe363('0x37')];if(!_0x3cc130[_0xe363('0x33')][_0xe363('0x3a')]('nolimit')){_0x3ed3e1['limit']=qs[_0xe363('0x20')](_0x3cc130['query']['limit']);_0x3ed3e1[_0xe363('0x3b')]=qs[_0xe363('0x3b')](_0x3cc130[_0xe363('0x33')][_0xe363('0x3b')]);}_0x3ed3e1[_0xe363('0x3c')]=qs[_0xe363('0x3d')](_0x3cc130[_0xe363('0x33')][_0xe363('0x3d')]);_0x3ed3e1[_0xe363('0x3e')]=qs[_0xe363('0x35')](_[_0xe363('0x3f')](_0x3cc130[_0xe363('0x33')],_0x45d664['filters']),_0x357b6f);if(_0x3cc130['query'][_0xe363('0x40')]){_0x3ed3e1[_0xe363('0x3e')]=_[_0xe363('0x41')](_0x3ed3e1['where'],{'$or':_['map'](_0x357b6f,function(_0x815550){if(_0x815550[_0xe363('0x31')]!==_0xe363('0x42')){var _0x199c78={};_0x199c78[_0x815550['name']]={'$like':'%'+_0x3cc130[_0xe363('0x33')]['filter']+'%'};return _0x199c78;}})});}_0x3ed3e1=_[_0xe363('0x41')]({},_0x3ed3e1,_0x3cc130[_0xe363('0x43')]);var _0xbca95f={'where':_0x3ed3e1[_0xe363('0x3e')]};return db[_0xe363('0x2f')][_0xe363('0x21')](_0xbca95f)[_0xe363('0x28')](function(_0x44f03c){_0x4c739d[_0xe363('0x21')]=_0x44f03c;if(_0x3cc130['query']['includeAll']){_0x3ed3e1[_0xe363('0x44')]=[{'all':!![]}];}return db[_0xe363('0x2f')][_0xe363('0x45')](_0x3ed3e1);})[_0xe363('0x28')](function(_0x2fc2f0){_0x4c739d[_0xe363('0x46')]=_0x2fc2f0;return _0x4c739d;})[_0xe363('0x28')](respondWithFilteredResult(_0x5a790c,_0x3ed3e1))[_0xe363('0x47')](handleError(_0x5a790c,null));};exports[_0xe363('0x48')]=function(_0x4b8238,_0x3da5ba){var _0x58b837={'raw':!![],'where':{'id':_0x4b8238['params']['id']}},_0x41a87c={};_0x41a87c[_0xe363('0x37')]=_[_0xe363('0x34')](db['ChatQueueReport'][_0xe363('0x49')]);_0x41a87c[_0xe363('0x33')]=_[_0xe363('0x34')](_0x4b8238[_0xe363('0x33')]);_0x41a87c[_0xe363('0x35')]=_[_0xe363('0x36')](_0x41a87c['model'],_0x41a87c[_0xe363('0x33')]);_0x58b837[_0xe363('0x38')]=_[_0xe363('0x36')](_0x41a87c[_0xe363('0x37')],qs[_0xe363('0x39')](_0x4b8238['query'][_0xe363('0x39')]));_0x58b837[_0xe363('0x38')]=_0x58b837[_0xe363('0x38')][_0xe363('0x4a')]?_0x58b837[_0xe363('0x38')]:_0x41a87c[_0xe363('0x37')];if(_0x4b8238[_0xe363('0x33')]['includeAll']){_0x58b837['include']=[{'all':!![]}];}_0x58b837=_[_0xe363('0x41')]({},_0x58b837,_0x4b8238[_0xe363('0x43')]);return db[_0xe363('0x2f')]['find'](_0x58b837)[_0xe363('0x28')](handleEntityNotFound(_0x3da5ba,null))[_0xe363('0x28')](respondWithResult(_0x3da5ba,null))['catch'](handleError(_0x3da5ba,null));};exports['create']=function(_0x2a7b42,_0x34e08b){return db[_0xe363('0x2f')][_0xe363('0x4b')](_0x2a7b42['body'],{})[_0xe363('0x28')](respondWithResult(_0x34e08b,0xc9))[_0xe363('0x47')](handleError(_0x34e08b,null));};exports['update']=function(_0x4fbdbb,_0x306afd){if(_0x4fbdbb[_0xe363('0x4c')]['id']){delete _0x4fbdbb['body']['id'];}return db[_0xe363('0x2f')]['find']({'where':{'id':_0x4fbdbb[_0xe363('0x4d')]['id']}})[_0xe363('0x28')](handleEntityNotFound(_0x306afd,null))['then'](saveUpdates(_0x4fbdbb[_0xe363('0x4c')],null))[_0xe363('0x28')](respondWithResult(_0x306afd,null))['catch'](handleError(_0x306afd,null));};exports[_0xe363('0x29')]=function(_0x43ee23,_0x55f0e6){return db[_0xe363('0x2f')]['find']({'where':{'id':_0x43ee23[_0xe363('0x4d')]['id']}})[_0xe363('0x28')](handleEntityNotFound(_0x55f0e6,null))[_0xe363('0x28')](removeEntity(_0x55f0e6,null))[_0xe363('0x47')](handleError(_0x55f0e6,null));};exports['describe']=function(_0x2ff064,_0x225a43){return db[_0xe363('0x2f')]['describe']()[_0xe363('0x28')](respondWithResult(_0x225a43,null))[_0xe363('0x47')](handleError(_0x225a43,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 66ecb89..376d82e 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(_0xa60419,_0x7f3e3d){var _0xa7cb7d=function(_0x772759){while(--_0x772759){_0xa60419['push'](_0xa60419['shift']());}};_0xa7cb7d(++_0x7f3e3d);}(_0x757a,0xde));var _0xa757=function(_0x2efdc3,_0x276171){_0x2efdc3=_0x2efdc3-0x0;var _0x4660bc=_0x757a[_0x2efdc3];return _0x4660bc;};'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 _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x4da05f,_0x20a393){var _0x30b926=function(_0x2b16d3){while(--_0x2b16d3){_0x4da05f['push'](_0x4da05f['shift']());}};_0x30b926(++_0x20a393);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x10291b,_0x518773){_0x10291b=_0x10291b-0x0;var _0x1d5fbe=_0xcb91[_0x10291b];return _0x1d5fbe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 974bdc5..152925b 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 _0x5eff=['CreateChatQueueReport','ChatQueueReport','create','body','options','UpdateChatQueueReport','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','info','catch'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x5eff,0xc8));var _0xf5ef=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x5eff[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0xf5ef('0x0'));var util=require(_0xf5ef('0x1'));var moment=require(_0xf5ef('0x2'));var BPromise=require(_0xf5ef('0x3'));var rs=require(_0xf5ef('0x4'));var fs=require('fs');var Redis=require(_0xf5ef('0x5'));var db=require(_0xf5ef('0x6'))['db'];var utils=require(_0xf5ef('0x7'));var logger=require(_0xf5ef('0x8'))(_0xf5ef('0x9'));var config=require(_0xf5ef('0xa'));var jayson=require(_0xf5ef('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39f0ad,_0x4b655a,_0x29de37){return new BPromise(function(_0x544036,_0x44aac0){return client[_0xf5ef('0xc')](_0x39f0ad,_0x29de37)[_0xf5ef('0xd')](function(_0x4a5662){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x4b655a,_0xf5ef('0xe'));logger[_0xf5ef('0xf')](_0xf5ef('0x10'),_0x4b655a,_0xf5ef('0xe'),JSON[_0xf5ef('0x11')](_0x4a5662));if(_0x4a5662[_0xf5ef('0x12')]){if(_0x4a5662[_0xf5ef('0x12')][_0xf5ef('0x13')]===0x1f4){logger[_0xf5ef('0x12')](_0xf5ef('0x14'),_0x4b655a,_0x4a5662[_0xf5ef('0x12')][_0xf5ef('0x15')]);return _0x44aac0(_0x4a5662[_0xf5ef('0x12')][_0xf5ef('0x15')]);}logger[_0xf5ef('0x12')](_0xf5ef('0x14'),_0x4b655a,_0x4a5662['error'][_0xf5ef('0x15')]);return _0x544036(_0x4a5662[_0xf5ef('0x12')]['message']);}else{logger[_0xf5ef('0x16')](_0xf5ef('0x14'),_0x4b655a,_0xf5ef('0xe'));_0x544036(_0x4a5662['result'][_0xf5ef('0x15')]);}})[_0xf5ef('0x17')](function(_0x22b78f){logger[_0xf5ef('0x12')](_0xf5ef('0x14'),_0x4b655a,_0x22b78f);_0x44aac0(_0x22b78f);});});}exports[_0xf5ef('0x18')]=function(_0x43595b){var _0x3ad136=this;return new Promise(function(_0x46cf6d,_0x10cfe3){return db[_0xf5ef('0x19')][_0xf5ef('0x1a')](_0x43595b[_0xf5ef('0x1b')],{'raw':_0x43595b['options']?_0x43595b[_0xf5ef('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xf5ef('0xd')](function(_0x48382c){logger['info'](_0xf5ef('0x18'),_0x43595b);logger['debug'](_0xf5ef('0x18'),_0x43595b,JSON[_0xf5ef('0x11')](_0x48382c));_0x46cf6d(_0x48382c);})[_0xf5ef('0x17')](function(_0x29b8ca){logger[_0xf5ef('0x12')]('CreateChatQueueReport',_0x29b8ca['message'],_0x43595b);_0x10cfe3(_0x3ad136[_0xf5ef('0x12')](0x1f4,_0x29b8ca[_0xf5ef('0x15')]));});});};exports[_0xf5ef('0x1d')]=function(_0x46b881){var _0x1ad4e2=this;return new Promise(function(_0x83cf9e,_0x200d23){return db[_0xf5ef('0x19')]['update'](_0x46b881[_0xf5ef('0x1b')],{'raw':_0x46b881[_0xf5ef('0x1c')]?_0x46b881[_0xf5ef('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46b881[_0xf5ef('0x1c')]?_0x46b881[_0xf5ef('0x1c')][_0xf5ef('0x1e')]||null:null,'attributes':_0x46b881[_0xf5ef('0x1c')]?_0x46b881[_0xf5ef('0x1c')]['attributes']||null:null,'limit':_0x46b881[_0xf5ef('0x1c')]?_0x46b881['options'][_0xf5ef('0x1f')]||null:null})[_0xf5ef('0xd')](function(_0x355448){logger[_0xf5ef('0x16')](_0xf5ef('0x1d'),_0x46b881);logger[_0xf5ef('0xf')](_0xf5ef('0x1d'),_0x46b881,JSON[_0xf5ef('0x11')](_0x355448));_0x83cf9e(_0x355448);})[_0xf5ef('0x17')](function(_0x3a9bb4){logger[_0xf5ef('0x12')](_0xf5ef('0x1d'),_0x3a9bb4['message'],_0x46b881);_0x200d23(_0x1ad4e2[_0xf5ef('0x12')](0x1f4,_0x3a9bb4['message']));});});};
\ No newline at end of file
+var _0xecd6=['create','body','options','raw','update','where','attributes','UpdateChatQueueReport','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport'];(function(_0x4bd48b,_0x1a0264){var _0x3ecb8f=function(_0x3a5f2e){while(--_0x3a5f2e){_0x4bd48b['push'](_0x4bd48b['shift']());}};_0x3ecb8f(++_0x1a0264);}(_0xecd6,0xe1));var _0x6ecd=function(_0x2d7213,_0x1e9ce2){_0x2d7213=_0x2d7213-0x0;var _0x4bb328=_0xecd6[_0x2d7213];return _0x4bb328;};'use strict';var _=require(_0x6ecd('0x0'));var util=require('util');var moment=require(_0x6ecd('0x1'));var BPromise=require(_0x6ecd('0x2'));var rs=require(_0x6ecd('0x3'));var fs=require('fs');var Redis=require(_0x6ecd('0x4'));var db=require(_0x6ecd('0x5'))['db'];var utils=require(_0x6ecd('0x6'));var logger=require(_0x6ecd('0x7'))(_0x6ecd('0x8'));var config=require(_0x6ecd('0x9'));var jayson=require(_0x6ecd('0xa'));var client=jayson[_0x6ecd('0xb')][_0x6ecd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4569e9,_0x311902,_0x5f490b){return new BPromise(function(_0x427c4c,_0x5025a8){return client[_0x6ecd('0xd')](_0x4569e9,_0x5f490b)[_0x6ecd('0xe')](function(_0x308871){logger[_0x6ecd('0xf')](_0x6ecd('0x10'),_0x311902,_0x6ecd('0x11'));logger[_0x6ecd('0x12')](_0x6ecd('0x13'),_0x311902,_0x6ecd('0x11'),JSON[_0x6ecd('0x14')](_0x308871));if(_0x308871[_0x6ecd('0x15')]){if(_0x308871[_0x6ecd('0x15')][_0x6ecd('0x16')]===0x1f4){logger[_0x6ecd('0x15')](_0x6ecd('0x10'),_0x311902,_0x308871[_0x6ecd('0x15')][_0x6ecd('0x17')]);return _0x5025a8(_0x308871[_0x6ecd('0x15')][_0x6ecd('0x17')]);}logger[_0x6ecd('0x15')](_0x6ecd('0x10'),_0x311902,_0x308871[_0x6ecd('0x15')][_0x6ecd('0x17')]);return _0x427c4c(_0x308871[_0x6ecd('0x15')][_0x6ecd('0x17')]);}else{logger[_0x6ecd('0xf')](_0x6ecd('0x10'),_0x311902,_0x6ecd('0x11'));_0x427c4c(_0x308871[_0x6ecd('0x18')][_0x6ecd('0x17')]);}})['catch'](function(_0x44351f){logger[_0x6ecd('0x15')](_0x6ecd('0x10'),_0x311902,_0x44351f);_0x5025a8(_0x44351f);});});}exports[_0x6ecd('0x19')]=function(_0x53cdb9){var _0x17c956=this;return new Promise(function(_0x227fed,_0x29502d){return db[_0x6ecd('0x1a')][_0x6ecd('0x1b')](_0x53cdb9[_0x6ecd('0x1c')],{'raw':_0x53cdb9[_0x6ecd('0x1d')]?_0x53cdb9['options'][_0x6ecd('0x1e')]===undefined?!![]:![]:!![]})[_0x6ecd('0xe')](function(_0x266825){logger[_0x6ecd('0xf')]('CreateChatQueueReport',_0x53cdb9);logger[_0x6ecd('0x12')](_0x6ecd('0x19'),_0x53cdb9,JSON['stringify'](_0x266825));_0x227fed(_0x266825);})['catch'](function(_0xe12cb8){logger[_0x6ecd('0x15')](_0x6ecd('0x19'),_0xe12cb8[_0x6ecd('0x17')],_0x53cdb9);_0x29502d(_0x17c956[_0x6ecd('0x15')](0x1f4,_0xe12cb8[_0x6ecd('0x17')]));});});};exports['UpdateChatQueueReport']=function(_0x599cdd){var _0x3c3814=this;return new Promise(function(_0x36c4c2,_0x36efa7){return db[_0x6ecd('0x1a')][_0x6ecd('0x1f')](_0x599cdd[_0x6ecd('0x1c')],{'raw':_0x599cdd[_0x6ecd('0x1d')]?_0x599cdd['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x599cdd[_0x6ecd('0x1d')]?_0x599cdd[_0x6ecd('0x1d')][_0x6ecd('0x20')]||null:null,'attributes':_0x599cdd['options']?_0x599cdd['options'][_0x6ecd('0x21')]||null:null,'limit':_0x599cdd[_0x6ecd('0x1d')]?_0x599cdd[_0x6ecd('0x1d')]['limit']||null:null})['then'](function(_0x5f2431){logger[_0x6ecd('0xf')](_0x6ecd('0x22'),_0x599cdd);logger[_0x6ecd('0x12')](_0x6ecd('0x22'),_0x599cdd,JSON[_0x6ecd('0x14')](_0x5f2431));_0x36c4c2(_0x5f2431);})[_0x6ecd('0x23')](function(_0x3884f4){logger['error'](_0x6ecd('0x22'),_0x3884f4['message'],_0x599cdd);_0x36efa7(_0x3c3814[_0x6ecd('0x15')](0x1f4,_0x3884f4['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 127c0d8..beaf863 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 _0x49e6=['../../config/environment','isAuthenticated','get','/describe','/:id','create','put','update','delete','destroy','multer','path','Router','fs-extra','../../components/interaction/service'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x49e6,0xeb));var _0x649e=function(_0x4dda67,_0x5669c2){_0x4dda67=_0x4dda67-0x0;var _0x3e3fdb=_0x49e6[_0x4dda67];return _0x3e3fdb;};'use strict';var multer=require(_0x649e('0x0'));var util=require('util');var path=require(_0x649e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x649e('0x2')]();var fs_extra=require(_0x649e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x649e('0x4'));var config=require(_0x649e('0x5'));var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0x649e('0x6')](),controller['index']);router[_0x649e('0x7')](_0x649e('0x8'),auth[_0x649e('0x6')](),controller['describe']);router[_0x649e('0x7')](_0x649e('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x649e('0x6')](),controller[_0x649e('0xa')]);router[_0x649e('0xb')](_0x649e('0x9'),auth['isAuthenticated'](),controller[_0x649e('0xc')]);router[_0x649e('0xd')](_0x649e('0x9'),auth[_0x649e('0x6')](),controller[_0x649e('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x6208=['describe','show','post','create','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','isAuthenticated','index','get','/describe'];(function(_0x47d103,_0xd2df8c){var _0x18e659=function(_0x27a38d){while(--_0x27a38d){_0x47d103['push'](_0x47d103['shift']());}};_0x18e659(++_0xd2df8c);}(_0x6208,0x96));var _0x8620=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0x6208[_0x4e93a9];return _0x43013c;};'use strict';var multer=require('multer');var util=require(_0x8620('0x0'));var path=require(_0x8620('0x1'));var timeout=require(_0x8620('0x2'));var express=require(_0x8620('0x3'));var router=express[_0x8620('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8620('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0x8620('0x6')](),controller[_0x8620('0x7')]);router[_0x8620('0x8')](_0x8620('0x9'),auth[_0x8620('0x6')](),controller[_0x8620('0xa')]);router['get']('/:id',auth[_0x8620('0x6')](),controller[_0x8620('0xb')]);router[_0x8620('0xc')]('/',auth[_0x8620('0x6')](),controller[_0x8620('0xd')]);router[_0x8620('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x8620('0xf')]);router[_0x8620('0x10')](_0x8620('0x11'),auth[_0x8620('0x6')](),controller[_0x8620('0x12')]);module[_0x8620('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 40f5f50..16ac573 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x26a28c,_0x43a785){var _0x50daed=function(_0x13fb99){while(--_0x13fb99){_0x26a28c['push'](_0x26a28c['shift']());}};_0x50daed(++_0x43a785);}(_0xedd9,0xfc));var _0x9edd=function(_0x34a403,_0x2069ae){_0x34a403=_0x34a403-0x0;var _0x4fee1a=_0xedd9[_0x34a403];return _0x4fee1a;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
+var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x1f004d,_0x4821eb){var _0x48ac0b=function(_0x32dd1e){while(--_0x32dd1e){_0x1f004d['push'](_0x1f004d['shift']());}};_0x48ac0b(++_0x4821eb);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x34b821,_0x504e55){_0x34b821=_0x34b821-0x0;var _0x5e00a0=_0xf3cd[_0x34b821];return _0x5e00a0;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index c7de645..c314957 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 _0x26b9=['reject','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','where','merge','VIRTUAL','filter','options','ChatTransferReport','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','crypto','jsforce','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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x194934,_0x231270){var _0x59bb6b=function(_0xa10426){while(--_0xa10426){_0x194934['push'](_0x194934['shift']());}};_0x59bb6b(++_0x231270);}(_0x26b9,0x10a));var _0x926b=function(_0x1ab20a,_0x50a80a){_0x1ab20a=_0x1ab20a-0x0;var _0x42c089=_0x26b9[_0x1ab20a];return _0x42c089;};'use strict';var emlformat=require(_0x926b('0x0'));var rimraf=require(_0x926b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x926b('0x2'));var rp=require(_0x926b('0x3'));var moment=require(_0x926b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x926b('0x5'));var path=require(_0x926b('0x6'));var sox=require(_0x926b('0x7'));var csv=require(_0x926b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x926b('0x9'));var squel=require('squel');var crypto=require(_0x926b('0xa'));var jsforce=require(_0x926b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x926b('0x8'));var querystring=require(_0x926b('0xc'));var Papa=require(_0x926b('0xd'));var Redis=require(_0x926b('0xe'));var authService=require(_0x926b('0xf'));var qs=require(_0x926b('0x10'));var as=require(_0x926b('0x11'));var hardwareService=require(_0x926b('0x12'));var logger=require(_0x926b('0x13'))('api');var utils=require(_0x926b('0x14'));var config=require(_0x926b('0x15'));var licenseUtil=require(_0x926b('0x16'));var db=require(_0x926b('0x17'))['db'];function respondWithStatusCode(_0x42cb51,_0x5bd123){_0x5bd123=_0x5bd123||0xcc;return function(_0xe09589){if(_0xe09589){return _0x42cb51['sendStatus'](_0x5bd123);}return _0x42cb51[_0x926b('0x18')](_0x5bd123)[_0x926b('0x19')]();};}function respondWithResult(_0x217537,_0x205036){_0x205036=_0x205036||0xc8;return function(_0x1da982){if(_0x1da982){return _0x217537[_0x926b('0x18')](_0x205036)[_0x926b('0x1a')](_0x1da982);}};}function respondWithFilteredResult(_0xd39507,_0x3c030c){return function(_0x1db1e5){if(_0x1db1e5){var _0x82c900=typeof _0x3c030c[_0x926b('0x1b')]===_0x926b('0x1c')&&typeof _0x3c030c[_0x926b('0x1d')]==='undefined';var _0x179310=_0x1db1e5[_0x926b('0x1e')];var _0x12b6b1=_0x82c900?0x0:_0x3c030c[_0x926b('0x1b')];var _0x5d4655=_0x82c900?_0x1db1e5[_0x926b('0x1e')]:_0x3c030c[_0x926b('0x1b')]+_0x3c030c['limit'];var _0xc8d96b;if(_0x5d4655>=_0x179310){_0x5d4655=_0x179310;_0xc8d96b=0xc8;}else{_0xc8d96b=0xce;}_0xd39507[_0x926b('0x18')](_0xc8d96b);return _0xd39507[_0x926b('0x1f')](_0x926b('0x20'),_0x12b6b1+'-'+_0x5d4655+'/'+_0x179310)['json'](_0x1db1e5);}return null;};}function patchUpdates(_0x5311a6){return function(_0xdcbbfc){try{jsonpatch[_0x926b('0x21')](_0xdcbbfc,_0x5311a6,!![]);}catch(_0x18e9fe){return BPromise[_0x926b('0x22')](_0x18e9fe);}return _0xdcbbfc['save']();};}function saveUpdates(_0x37b941,_0x4f6a06){return function(_0x166d3b){if(_0x166d3b){return _0x166d3b['update'](_0x37b941)[_0x926b('0x23')](function(_0x1a5944){return _0x1a5944;});}return null;};}function removeEntity(_0x410202,_0xca434d){return function(_0x41c594){if(_0x41c594){return _0x41c594[_0x926b('0x24')]()[_0x926b('0x23')](function(){_0x410202['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ab72c,_0x56d85e){return function(_0x408475){if(!_0x408475){_0x4ab72c[_0x926b('0x25')](0x194);}return _0x408475;};}function handleError(_0x20e551,_0x16d650){_0x16d650=_0x16d650||0x1f4;return function(_0x59df1a){logger['error'](_0x59df1a[_0x926b('0x26')]);if(_0x59df1a[_0x926b('0x27')]){delete _0x59df1a['name'];}_0x20e551['status'](_0x16d650)[_0x926b('0x28')](_0x59df1a);};}exports[_0x926b('0x29')]=function(_0x4da778,_0x1ba301){var _0x409442={},_0x118857={},_0x4c35e9={'count':0x0,'rows':[]};var _0xdd9b2a=_[_0x926b('0x2a')](db['ChatTransferReport'][_0x926b('0x2b')],function(_0x29d869){return{'name':_0x29d869[_0x926b('0x2c')],'type':_0x29d869[_0x926b('0x2d')]['key']};});_0x118857['model']=_[_0x926b('0x2a')](_0xdd9b2a,'name');_0x118857[_0x926b('0x2e')]=_['keys'](_0x4da778['query']);_0x118857['filters']=_[_0x926b('0x2f')](_0x118857['model'],_0x118857['query']);_0x409442['attributes']=_[_0x926b('0x2f')](_0x118857[_0x926b('0x30')],qs[_0x926b('0x31')](_0x4da778[_0x926b('0x2e')][_0x926b('0x31')]));_0x409442[_0x926b('0x32')]=_0x409442['attributes']['length']?_0x409442[_0x926b('0x32')]:_0x118857[_0x926b('0x30')];if(!_0x4da778[_0x926b('0x2e')][_0x926b('0x33')](_0x926b('0x34'))){_0x409442[_0x926b('0x1d')]=qs[_0x926b('0x1d')](_0x4da778['query']['limit']);_0x409442[_0x926b('0x1b')]=qs[_0x926b('0x1b')](_0x4da778[_0x926b('0x2e')][_0x926b('0x1b')]);}_0x409442[_0x926b('0x35')]=qs[_0x926b('0x36')](_0x4da778[_0x926b('0x2e')][_0x926b('0x36')]);_0x409442['where']=qs[_0x926b('0x37')](_['pick'](_0x4da778[_0x926b('0x2e')],_0x118857[_0x926b('0x37')]),_0xdd9b2a);if(_0x4da778[_0x926b('0x2e')]['filter']){_0x409442[_0x926b('0x38')]=_[_0x926b('0x39')](_0x409442[_0x926b('0x38')],{'$or':_[_0x926b('0x2a')](_0xdd9b2a,function(_0x570060){if(_0x570060[_0x926b('0x2d')]!==_0x926b('0x3a')){var _0x2f47ac={};_0x2f47ac[_0x570060[_0x926b('0x27')]]={'$like':'%'+_0x4da778['query'][_0x926b('0x3b')]+'%'};return _0x2f47ac;}})});}_0x409442=_['merge']({},_0x409442,_0x4da778[_0x926b('0x3c')]);var _0x201755={'where':_0x409442[_0x926b('0x38')]};return db[_0x926b('0x3d')]['count'](_0x201755)[_0x926b('0x23')](function(_0x500fe1){_0x4c35e9[_0x926b('0x1e')]=_0x500fe1;if(_0x4da778[_0x926b('0x2e')][_0x926b('0x3e')]){_0x409442[_0x926b('0x3f')]=[{'all':!![]}];}return db[_0x926b('0x3d')][_0x926b('0x40')](_0x409442);})[_0x926b('0x23')](function(_0x458415){_0x4c35e9[_0x926b('0x41')]=_0x458415;return _0x4c35e9;})[_0x926b('0x23')](respondWithFilteredResult(_0x1ba301,_0x409442))[_0x926b('0x42')](handleError(_0x1ba301,null));};exports[_0x926b('0x43')]=function(_0x4973ba,_0x466757){var _0x3f6282={'raw':!![],'where':{'id':_0x4973ba[_0x926b('0x44')]['id']}},_0x66563e={};_0x66563e['model']=_[_0x926b('0x45')](db[_0x926b('0x3d')][_0x926b('0x2b')]);_0x66563e[_0x926b('0x2e')]=_[_0x926b('0x45')](_0x4973ba[_0x926b('0x2e')]);_0x66563e[_0x926b('0x37')]=_[_0x926b('0x2f')](_0x66563e[_0x926b('0x30')],_0x66563e[_0x926b('0x2e')]);_0x3f6282['attributes']=_[_0x926b('0x2f')](_0x66563e['model'],qs[_0x926b('0x31')](_0x4973ba[_0x926b('0x2e')][_0x926b('0x31')]));_0x3f6282['attributes']=_0x3f6282[_0x926b('0x32')][_0x926b('0x46')]?_0x3f6282[_0x926b('0x32')]:_0x66563e[_0x926b('0x30')];if(_0x4973ba[_0x926b('0x2e')][_0x926b('0x3e')]){_0x3f6282[_0x926b('0x3f')]=[{'all':!![]}];}_0x3f6282=_['merge']({},_0x3f6282,_0x4973ba[_0x926b('0x3c')]);return db[_0x926b('0x3d')][_0x926b('0x47')](_0x3f6282)[_0x926b('0x23')](handleEntityNotFound(_0x466757,null))[_0x926b('0x23')](respondWithResult(_0x466757,null))[_0x926b('0x42')](handleError(_0x466757,null));};exports['create']=function(_0x53440b,_0x44589e){return db['ChatTransferReport'][_0x926b('0x48')](_0x53440b[_0x926b('0x49')],{})[_0x926b('0x23')](respondWithResult(_0x44589e,0xc9))[_0x926b('0x42')](handleError(_0x44589e,null));};exports['update']=function(_0x5a0f80,_0x1fd009){if(_0x5a0f80[_0x926b('0x49')]['id']){delete _0x5a0f80[_0x926b('0x49')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x5a0f80[_0x926b('0x44')]['id']}})[_0x926b('0x23')](handleEntityNotFound(_0x1fd009,null))['then'](saveUpdates(_0x5a0f80['body'],null))['then'](respondWithResult(_0x1fd009,null))[_0x926b('0x42')](handleError(_0x1fd009,null));};exports[_0x926b('0x24')]=function(_0x3fd99e,_0x1e550a){return db['ChatTransferReport'][_0x926b('0x47')]({'where':{'id':_0x3fd99e[_0x926b('0x44')]['id']}})[_0x926b('0x23')](handleEntityNotFound(_0x1e550a,null))[_0x926b('0x23')](removeEntity(_0x1e550a,null))['catch'](handleError(_0x1e550a,null));};exports[_0x926b('0x4a')]=function(_0x5ddb0c,_0x9ba127){return db[_0x926b('0x3d')][_0x926b('0x4a')]()[_0x926b('0x23')](respondWithResult(_0x9ba127,null))[_0x926b('0x42')](handleError(_0x9ba127,null));};
\ No newline at end of file
+var _0x411f=['rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','ChatTransferReport','findAll','show','params','create','body','catch','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','map'];(function(_0x47d0d7,_0x5cd8b){var _0x5563ec=function(_0x4f607b){while(--_0x4f607b){_0x47d0d7['push'](_0x47d0d7['shift']());}};_0x5563ec(++_0x5cd8b);}(_0x411f,0x1e1));var _0xf411=function(_0x3deed9,_0x5b450c){_0x3deed9=_0x3deed9-0x0;var _0x22aadf=_0x411f[_0x3deed9];return _0x22aadf;};'use strict';var emlformat=require(_0xf411('0x0'));var rimraf=require(_0xf411('0x1'));var zipdir=require(_0xf411('0x2'));var jsonpatch=require(_0xf411('0x3'));var rp=require(_0xf411('0x4'));var moment=require(_0xf411('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf411('0x6'));var util=require(_0xf411('0x7'));var path=require(_0xf411('0x8'));var sox=require(_0xf411('0x9'));var csv=require(_0xf411('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf411('0xb'));var _=require(_0xf411('0xc'));var squel=require(_0xf411('0xd'));var crypto=require(_0xf411('0xe'));var jsforce=require(_0xf411('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf411('0xa'));var querystring=require(_0xf411('0x10'));var Papa=require('papaparse');var Redis=require(_0xf411('0x11'));var authService=require(_0xf411('0x12'));var qs=require(_0xf411('0x13'));var as=require(_0xf411('0x14'));var hardwareService=require(_0xf411('0x15'));var logger=require(_0xf411('0x16'))('api');var utils=require(_0xf411('0x17'));var config=require(_0xf411('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ef3ee,_0x11a6ae){_0x11a6ae=_0x11a6ae||0xcc;return function(_0xe5dc27){if(_0xe5dc27){return _0x1ef3ee[_0xf411('0x19')](_0x11a6ae);}return _0x1ef3ee[_0xf411('0x1a')](_0x11a6ae)[_0xf411('0x1b')]();};}function respondWithResult(_0x4b8ade,_0x1f8715){_0x1f8715=_0x1f8715||0xc8;return function(_0x57f255){if(_0x57f255){return _0x4b8ade['status'](_0x1f8715)[_0xf411('0x1c')](_0x57f255);}};}function respondWithFilteredResult(_0x10ea85,_0x41fc46){return function(_0x58ff91){if(_0x58ff91){var _0x4c70c6=typeof _0x41fc46[_0xf411('0x1d')]===_0xf411('0x1e')&&typeof _0x41fc46[_0xf411('0x1f')]===_0xf411('0x1e');var _0x5f97f0=_0x58ff91[_0xf411('0x20')];var _0x25bab2=_0x4c70c6?0x0:_0x41fc46[_0xf411('0x1d')];var _0x55d0dc=_0x4c70c6?_0x58ff91[_0xf411('0x20')]:_0x41fc46[_0xf411('0x1d')]+_0x41fc46['limit'];var _0x3eb959;if(_0x55d0dc>=_0x5f97f0){_0x55d0dc=_0x5f97f0;_0x3eb959=0xc8;}else{_0x3eb959=0xce;}_0x10ea85['status'](_0x3eb959);return _0x10ea85[_0xf411('0x21')](_0xf411('0x22'),_0x25bab2+'-'+_0x55d0dc+'/'+_0x5f97f0)[_0xf411('0x1c')](_0x58ff91);}return null;};}function patchUpdates(_0x543d14){return function(_0x421dfe){try{jsonpatch[_0xf411('0x23')](_0x421dfe,_0x543d14,!![]);}catch(_0x1a720b){return BPromise[_0xf411('0x24')](_0x1a720b);}return _0x421dfe['save']();};}function saveUpdates(_0xfedf53,_0xf4ece9){return function(_0x3398f7){if(_0x3398f7){return _0x3398f7[_0xf411('0x25')](_0xfedf53)[_0xf411('0x26')](function(_0x2057f8){return _0x2057f8;});}return null;};}function removeEntity(_0x48fb6c,_0xd68f18){return function(_0x365a5b){if(_0x365a5b){return _0x365a5b[_0xf411('0x27')]()[_0xf411('0x26')](function(){_0x48fb6c[_0xf411('0x1a')](0xcc)[_0xf411('0x1b')]();});}};}function handleEntityNotFound(_0x498ec6,_0x34faa2){return function(_0x2f15d9){if(!_0x2f15d9){_0x498ec6[_0xf411('0x19')](0x194);}return _0x2f15d9;};}function handleError(_0x18282a,_0x2bb6dc){_0x2bb6dc=_0x2bb6dc||0x1f4;return function(_0x2b2d49){logger[_0xf411('0x28')](_0x2b2d49[_0xf411('0x29')]);if(_0x2b2d49[_0xf411('0x2a')]){delete _0x2b2d49['name'];}_0x18282a[_0xf411('0x1a')](_0x2bb6dc)['send'](_0x2b2d49);};}exports['index']=function(_0x120900,_0x37e992){var _0x58f32e={},_0x164ea5={},_0x473345={'count':0x0,'rows':[]};var _0x42b6c8=_[_0xf411('0x2b')](db['ChatTransferReport'][_0xf411('0x2c')],function(_0xb9fc99){return{'name':_0xb9fc99['fieldName'],'type':_0xb9fc99[_0xf411('0x2d')][_0xf411('0x2e')]};});_0x164ea5[_0xf411('0x2f')]=_[_0xf411('0x2b')](_0x42b6c8,'name');_0x164ea5[_0xf411('0x30')]=_[_0xf411('0x31')](_0x120900[_0xf411('0x30')]);_0x164ea5[_0xf411('0x32')]=_[_0xf411('0x33')](_0x164ea5[_0xf411('0x2f')],_0x164ea5[_0xf411('0x30')]);_0x58f32e[_0xf411('0x34')]=_[_0xf411('0x33')](_0x164ea5[_0xf411('0x2f')],qs[_0xf411('0x35')](_0x120900[_0xf411('0x30')][_0xf411('0x35')]));_0x58f32e[_0xf411('0x34')]=_0x58f32e[_0xf411('0x34')][_0xf411('0x36')]?_0x58f32e[_0xf411('0x34')]:_0x164ea5['model'];if(!_0x120900[_0xf411('0x30')][_0xf411('0x37')](_0xf411('0x38'))){_0x58f32e[_0xf411('0x1f')]=qs[_0xf411('0x1f')](_0x120900[_0xf411('0x30')]['limit']);_0x58f32e[_0xf411('0x1d')]=qs[_0xf411('0x1d')](_0x120900[_0xf411('0x30')]['offset']);}_0x58f32e[_0xf411('0x39')]=qs[_0xf411('0x3a')](_0x120900[_0xf411('0x30')][_0xf411('0x3a')]);_0x58f32e['where']=qs['filters'](_[_0xf411('0x3b')](_0x120900[_0xf411('0x30')],_0x164ea5['filters']),_0x42b6c8);if(_0x120900[_0xf411('0x30')][_0xf411('0x3c')]){_0x58f32e[_0xf411('0x3d')]=_[_0xf411('0x3e')](_0x58f32e[_0xf411('0x3d')],{'$or':_['map'](_0x42b6c8,function(_0xd851e0){if(_0xd851e0['type']!=='VIRTUAL'){var _0x13dd97={};_0x13dd97[_0xd851e0[_0xf411('0x2a')]]={'$like':'%'+_0x120900['query'][_0xf411('0x3c')]+'%'};return _0x13dd97;}})});}_0x58f32e=_[_0xf411('0x3e')]({},_0x58f32e,_0x120900[_0xf411('0x3f')]);var _0x47d881={'where':_0x58f32e[_0xf411('0x3d')]};return db['ChatTransferReport'][_0xf411('0x20')](_0x47d881)[_0xf411('0x26')](function(_0x11ac30){_0x473345[_0xf411('0x20')]=_0x11ac30;if(_0x120900[_0xf411('0x30')][_0xf411('0x40')]){_0x58f32e[_0xf411('0x41')]=[{'all':!![]}];}return db[_0xf411('0x42')][_0xf411('0x43')](_0x58f32e);})['then'](function(_0x190fa8){_0x473345['rows']=_0x190fa8;return _0x473345;})[_0xf411('0x26')](respondWithFilteredResult(_0x37e992,_0x58f32e))['catch'](handleError(_0x37e992,null));};exports[_0xf411('0x44')]=function(_0x3c6ce1,_0x1a682c){var _0x4a7512={'raw':!![],'where':{'id':_0x3c6ce1[_0xf411('0x45')]['id']}},_0x368b87={};_0x368b87[_0xf411('0x2f')]=_[_0xf411('0x31')](db['ChatTransferReport'][_0xf411('0x2c')]);_0x368b87[_0xf411('0x30')]=_['keys'](_0x3c6ce1[_0xf411('0x30')]);_0x368b87[_0xf411('0x32')]=_[_0xf411('0x33')](_0x368b87[_0xf411('0x2f')],_0x368b87[_0xf411('0x30')]);_0x4a7512[_0xf411('0x34')]=_[_0xf411('0x33')](_0x368b87[_0xf411('0x2f')],qs[_0xf411('0x35')](_0x3c6ce1[_0xf411('0x30')][_0xf411('0x35')]));_0x4a7512['attributes']=_0x4a7512['attributes'][_0xf411('0x36')]?_0x4a7512[_0xf411('0x34')]:_0x368b87[_0xf411('0x2f')];if(_0x3c6ce1[_0xf411('0x30')][_0xf411('0x40')]){_0x4a7512[_0xf411('0x41')]=[{'all':!![]}];}_0x4a7512=_[_0xf411('0x3e')]({},_0x4a7512,_0x3c6ce1[_0xf411('0x3f')]);return db['ChatTransferReport']['find'](_0x4a7512)['then'](handleEntityNotFound(_0x1a682c,null))['then'](respondWithResult(_0x1a682c,null))['catch'](handleError(_0x1a682c,null));};exports[_0xf411('0x46')]=function(_0x533580,_0x1590f5){return db[_0xf411('0x42')][_0xf411('0x46')](_0x533580[_0xf411('0x47')],{})[_0xf411('0x26')](respondWithResult(_0x1590f5,0xc9))['catch'](handleError(_0x1590f5,null));};exports[_0xf411('0x25')]=function(_0x4dcd93,_0x4b698b){if(_0x4dcd93['body']['id']){delete _0x4dcd93[_0xf411('0x47')]['id'];}return db[_0xf411('0x42')]['find']({'where':{'id':_0x4dcd93[_0xf411('0x45')]['id']}})['then'](handleEntityNotFound(_0x4b698b,null))['then'](saveUpdates(_0x4dcd93[_0xf411('0x47')],null))['then'](respondWithResult(_0x4b698b,null))[_0xf411('0x48')](handleError(_0x4b698b,null));};exports[_0xf411('0x27')]=function(_0x234d69,_0x5c09b3){return db[_0xf411('0x42')][_0xf411('0x49')]({'where':{'id':_0x234d69[_0xf411('0x45')]['id']}})['then'](handleEntityNotFound(_0x5c09b3,null))[_0xf411('0x26')](removeEntity(_0x5c09b3,null))[_0xf411('0x48')](handleError(_0x5c09b3,null));};exports[_0xf411('0x4a')]=function(_0x412e30,_0x2d3495){return db[_0xf411('0x42')][_0xf411('0x4a')]()[_0xf411('0x26')](respondWithResult(_0x2d3495,null))[_0xf411('0x48')](handleError(_0x2d3495,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 8a02ff9..2f2d7fb 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 _0x981b=['bluebird','path','rimraf','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x158ca9,_0x5ea5b3){var _0x3bbaf4=function(_0xed0587){while(--_0xed0587){_0x158ca9['push'](_0x158ca9['shift']());}};_0x3bbaf4(++_0x5ea5b3);}(_0x981b,0x1c9));var _0xb981=function(_0x149f8d,_0x5a2642){_0x149f8d=_0x149f8d-0x0;var _0x3110a4=_0x981b[_0x149f8d];return _0x3110a4;};'use strict';var _=require(_0xb981('0x0'));var util=require(_0xb981('0x1'));var logger=require(_0xb981('0x2'))(_0xb981('0x3'));var moment=require(_0xb981('0x4'));var BPromise=require(_0xb981('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb981('0x6'));var rimraf=require(_0xb981('0x7'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x13bedb,_0x199226){return _0x13bedb[_0xb981('0x8')]('ChatTransferReport',attributes,{'tableName':_0xb981('0x9'),'paranoid':![],'indexes':[{'name':_0xb981('0xa'),'fields':[_0xb981('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c1b=['../../config/environment','./chatTransferReport.attributes','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x1d5108,_0x55e387){var _0x3cdd9d=function(_0x2330f5){while(--_0x2330f5){_0x1d5108['push'](_0x1d5108['shift']());}};_0x3cdd9d(++_0x55e387);}(_0x9c1b,0x10d));var _0xb9c1=function(_0x120fdb,_0x586aa3){_0x120fdb=_0x120fdb-0x0;var _0xc2f5ba=_0x9c1b[_0x120fdb];return _0xc2f5ba;};'use strict';var _=require(_0xb9c1('0x0'));var util=require(_0xb9c1('0x1'));var logger=require(_0xb9c1('0x2'))('api');var moment=require(_0xb9c1('0x3'));var BPromise=require(_0xb9c1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9c1('0x5'));var rimraf=require(_0xb9c1('0x6'));var config=require(_0xb9c1('0x7'));var attributes=require(_0xb9c1('0x8'));module['exports']=function(_0x109fd3,_0x285b29){return _0x109fd3['define'](_0xb9c1('0x9'),attributes,{'tableName':_0xb9c1('0xa'),'paranoid':![],'indexes':[{'name':_0xb9c1('0xb'),'fields':[_0xb9c1('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 0b9de05..65eb0d0 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 _0xc024=['ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x2b9bdf,_0x8fa76f){var _0x20dd2a=function(_0x2810d0){while(--_0x2810d0){_0x2b9bdf['push'](_0x2b9bdf['shift']());}};_0x20dd2a(++_0x8fa76f);}(_0xc024,0x101));var _0x4c02=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xc024[_0x288f5e];return _0x476cc9;};'use strict';var _=require(_0x4c02('0x0'));var util=require(_0x4c02('0x1'));var moment=require(_0x4c02('0x2'));var BPromise=require('bluebird');var rs=require(_0x4c02('0x3'));var fs=require('fs');var Redis=require(_0x4c02('0x4'));var db=require(_0x4c02('0x5'))['db'];var utils=require(_0x4c02('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4c02('0x7'));var jayson=require(_0x4c02('0x8'));var client=jayson[_0x4c02('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x460d79,_0x1bd2e9,_0x43eef9){return new BPromise(function(_0x167769,_0x197afa){return client[_0x4c02('0xa')](_0x460d79,_0x43eef9)[_0x4c02('0xb')](function(_0x20309a){logger[_0x4c02('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x1bd2e9,'request\x20sent');logger[_0x4c02('0xd')](_0x4c02('0xe'),_0x1bd2e9,_0x4c02('0xf'),JSON[_0x4c02('0x10')](_0x20309a));if(_0x20309a[_0x4c02('0x11')]){if(_0x20309a[_0x4c02('0x11')][_0x4c02('0x12')]===0x1f4){logger[_0x4c02('0x11')](_0x4c02('0x13'),_0x1bd2e9,_0x20309a[_0x4c02('0x11')]['message']);return _0x197afa(_0x20309a[_0x4c02('0x11')][_0x4c02('0x14')]);}logger[_0x4c02('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x1bd2e9,_0x20309a[_0x4c02('0x11')][_0x4c02('0x14')]);return _0x167769(_0x20309a['error']['message']);}else{logger[_0x4c02('0xc')](_0x4c02('0x13'),_0x1bd2e9,_0x4c02('0xf'));_0x167769(_0x20309a[_0x4c02('0x15')][_0x4c02('0x14')]);}})[_0x4c02('0x16')](function(_0x104601){logger['error'](_0x4c02('0x13'),_0x1bd2e9,_0x104601);_0x197afa(_0x104601);});});}
\ No newline at end of file
+var _0x9cd4=['ChatTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x50fe34,_0x14a248){var _0x5eab16=function(_0x2f5b6f){while(--_0x2f5b6f){_0x50fe34['push'](_0x50fe34['shift']());}};_0x5eab16(++_0x14a248);}(_0x9cd4,0x171));var _0x49cd=function(_0x4e7af4,_0x758572){_0x4e7af4=_0x4e7af4-0x0;var _0x2548f1=_0x9cd4[_0x4e7af4];return _0x2548f1;};'use strict';var _=require('lodash');var util=require(_0x49cd('0x0'));var moment=require(_0x49cd('0x1'));var BPromise=require(_0x49cd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49cd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x49cd('0x4'));var logger=require('../../config/logger')(_0x49cd('0x5'));var config=require(_0x49cd('0x6'));var jayson=require(_0x49cd('0x7'));var client=jayson[_0x49cd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x521d8b,_0x252487,_0x3b50a1){return new BPromise(function(_0x6b551c,_0x48adb7){return client[_0x49cd('0x9')](_0x521d8b,_0x3b50a1)['then'](function(_0x22126b){logger[_0x49cd('0xa')](_0x49cd('0xb'),_0x252487,'request\x20sent');logger[_0x49cd('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x252487,_0x49cd('0xd'),JSON[_0x49cd('0xe')](_0x22126b));if(_0x22126b[_0x49cd('0xf')]){if(_0x22126b[_0x49cd('0xf')][_0x49cd('0x10')]===0x1f4){logger[_0x49cd('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x252487,_0x22126b[_0x49cd('0xf')][_0x49cd('0x11')]);return _0x48adb7(_0x22126b[_0x49cd('0xf')][_0x49cd('0x11')]);}logger['error'](_0x49cd('0xb'),_0x252487,_0x22126b[_0x49cd('0xf')][_0x49cd('0x11')]);return _0x6b551c(_0x22126b[_0x49cd('0xf')][_0x49cd('0x11')]);}else{logger['info'](_0x49cd('0xb'),_0x252487,_0x49cd('0xd'));_0x6b551c(_0x22126b[_0x49cd('0x12')][_0x49cd('0x11')]);}})[_0x49cd('0x13')](function(_0x2fb397){logger[_0x49cd('0xf')](_0x49cd('0xb'),_0x252487,_0x2fb397);_0x48adb7(_0x2fb397);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 9e3b733..b390975 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 _0xdcfa=['isAuthenticated','describe','/:id','post','create','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xdcfa,0xe4));var _0xadcf=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0xdcfa[_0x454018];return _0x24697d;};'use strict';var multer=require(_0xadcf('0x0'));var util=require(_0xadcf('0x1'));var path=require('path');var timeout=require(_0xadcf('0x2'));var express=require(_0xadcf('0x3'));var router=express[_0xadcf('0x4')]();var fs_extra=require(_0xadcf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xadcf('0x6'));var config=require(_0xadcf('0x7'));var controller=require(_0xadcf('0x8'));router[_0xadcf('0x9')]('/',auth['isAuthenticated'](),controller[_0xadcf('0xa')]);router[_0xadcf('0x9')](_0xadcf('0xb'),auth[_0xadcf('0xc')](),controller[_0xadcf('0xd')]);router[_0xadcf('0x9')](_0xadcf('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xadcf('0xf')]('/',auth['isAuthenticated'](),controller[_0xadcf('0x10')]);router['put'](_0xadcf('0xe'),auth['isAuthenticated'](),controller[_0xadcf('0x11')]);router[_0xadcf('0x12')]('/:id',auth[_0xadcf('0xc')](),controller['destroy']);module[_0xadcf('0x13')]=router;
\ No newline at end of file
+var _0x1823=['exports','util','path','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3a175b,_0x505d13){var _0x9b84fa=function(_0x5533e1){while(--_0x5533e1){_0x3a175b['push'](_0x3a175b['shift']());}};_0x9b84fa(++_0x505d13);}(_0x1823,0x11e));var _0x3182=function(_0x39ce5a,_0x260622){_0x39ce5a=_0x39ce5a-0x0;var _0x46cd9a=_0x1823[_0x39ce5a];return _0x46cd9a;};'use strict';var multer=require('multer');var util=require(_0x3182('0x0'));var path=require(_0x3182('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3182('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x3182('0x3'));var config=require(_0x3182('0x4'));var controller=require(_0x3182('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3182('0x6')](_0x3182('0x7'),auth[_0x3182('0x8')](),controller[_0x3182('0x9')]);router[_0x3182('0x6')](_0x3182('0xa'),auth[_0x3182('0x8')](),controller[_0x3182('0xb')]);router[_0x3182('0xc')]('/',auth[_0x3182('0x8')](),controller[_0x3182('0xd')]);router[_0x3182('0xe')](_0x3182('0xa'),auth['isAuthenticated'](),controller[_0x3182('0xf')]);router[_0x3182('0x10')](_0x3182('0xa'),auth[_0x3182('0x8')](),controller[_0x3182('0x11')]);module[_0x3182('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 912851d..9ba5114 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 _0x5bf6=['Comments','offlineForm','generate','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:','Send','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback','star','input','name','getDataValue','onlineForm','parse','setDataValue','stringify','textarea'];(function(_0x1cea76,_0x11c8ad){var _0x1b359b=function(_0x4e849d){while(--_0x4e849d){_0x1cea76['push'](_0x1cea76['shift']());}};_0x1b359b(++_0x11c8ad);}(_0x5bf6,0x13e));var _0x65bf=function(_0x1a21ff,_0x4a7550){_0x1a21ff=_0x1a21ff-0x0;var _0x25afc1=_0x5bf6[_0x1a21ff];return _0x25afc1;};'use strict';var Sequelize=require(_0x65bf('0x0'));var rs=require('randomstring');module[_0x65bf('0x1')]={'name':{'type':Sequelize[_0x65bf('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x65bf('0x2')],'allowNull':![],'unique':_0x65bf('0x3')},'description':{'type':Sequelize[_0x65bf('0x2')]},'mapKey':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x5')},'customerAlias':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x65bf('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x65bf('0x2')],'allowNull':![],'defaultValue':_0x65bf('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x65bf('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x65bf('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x65bf('0xa')](_0x65bf('0xb'),_0x65bf('0xc')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0xd')},'start_chat_button':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x65bf('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x65bf('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x65bf('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x65bf('0x13')},'placeholderMessage':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x14')},'closingMessage':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x15')},'conditionAgreement':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x16')},'ratingType':{'type':Sequelize[_0x65bf('0xa')](_0x65bf('0x17'),'thumb'),'defaultValue':_0x65bf('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x65bf('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x65bf('0x18'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x65bf('0x19'),'helpText':''}},{'type':_0x65bf('0x18'),'props':{'title':_0x65bf('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x65bf('0x4'),'type':_0x65bf('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x65bf('0x1a')](_0x65bf('0x1b'))?JSON[_0x65bf('0x1c')](this[_0x65bf('0x1a')]('onlineForm')):{};},'set':function(_0x5f0c8a){return this[_0x65bf('0x1d')](_0x65bf('0x1b'),JSON[_0x65bf('0x1e')](_0x5f0c8a));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x65bf('0x1e')]({'items':[{'type':_0x65bf('0x18'),'props':{'title':_0x65bf('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x65bf('0x4'),'type':_0x65bf('0x4')},'variable':null},{'type':_0x65bf('0x1f'),'config':{'placeholder':_0x65bf('0x20')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x65bf('0x1a')](_0x65bf('0x21'))?JSON[_0x65bf('0x1c')](this[_0x65bf('0x1a')]('offlineForm')):{};},'set':function(_0x874c78){return this['setDataValue'](_0x65bf('0x21'),JSON[_0x65bf('0x1e')](_0x874c78));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x65bf('0x22')]();}},'autoclose':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x65bf('0x2')]},'forwardOffline':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x65bf('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x65bf('0x23')},'offlineMessageSubject':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x24')},'offlineMessageBody':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x15')},'sendUnmanaged':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x26')},'enableCustomerAttachment':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x65bf('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x65bf('0x2')]},'notificationTemplate':{'type':Sequelize[_0x65bf('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x65bf('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x28')},'verticalAlignment':{'type':Sequelize[_0x65bf('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x29')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x65bf('0x2a')},'defaultTitle':{'type':Sequelize[_0x65bf('0x2')]},'customerAvatar':{'type':Sequelize[_0x65bf('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x65bf('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x65bf('0x2')],'allowNull':![],'defaultValue':_0x65bf('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x65bf('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x65bf('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':_0x65bf('0x2c')},'systemAvatar':{'type':Sequelize[_0x65bf('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x65bf('0x8')],'comment':_0x65bf('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![],'comment':_0x65bf('0x2e'),'set':function(_0x46ff3e){if(!_0x46ff3e)this['setDataValue'](_0x65bf('0x2f'),null);this[_0x65bf('0x1d')](_0x65bf('0x30'),_0x46ff3e);}},'vidaooEscalation':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x65bf('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x65bf('0x31')},'vidaooNote':{'type':Sequelize[_0x65bf('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x65bf('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x8283=['#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','address','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','alternate'];(function(_0x3a4053,_0x5684ee){var _0x42af54=function(_0x97a4b6){while(--_0x97a4b6){_0x3a4053['push'](_0x3a4053['shift']());}};_0x42af54(++_0x5684ee);}(_0x8283,0x173));var _0x3828=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8283[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3828('0x0'));var rs=require('randomstring');module[_0x3828('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3828('0x2')},'description':{'type':Sequelize[_0x3828('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x3828('0x4')},'mapKeyOffline':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x3828('0x3')],'allowNull':![],'defaultValue':_0x3828('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3828('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3828('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3828('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x3828('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x3828('0xa'),'squared'),'defaultValue':_0x3828('0xa')},'header_online':{'type':Sequelize[_0x3828('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0xb')},'offline_chat_button':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0xc')},'header_offline':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x3828('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x3828('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x3828('0xf')]},'closingQuestion':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x12')},'noteTitle':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x13')},'placeholderMessage':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x14')},'closingMessage':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x15')},'closingMessageButton':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0xc')},'skipMessageButton':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x16')},'conditionAgreement':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x3828('0x17')},'ratingType':{'type':Sequelize[_0x3828('0x18')](_0x3828('0x19'),_0x3828('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x3828('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x3828('0xf')],'defaultValue':function(){return JSON[_0x3828('0x1b')]({'items':[{'type':_0x3828('0x1c'),'variable':null,'config':{'placeholder':_0x3828('0x1d'),'type':'text','required':!![]},'props':{'title':_0x3828('0x1d'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x3828('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3828('0x1e')](_0x3828('0x1f'))?JSON[_0x3828('0x20')](this[_0x3828('0x1e')](_0x3828('0x1f'))):{};},'set':function(_0x176b5f){return this[_0x3828('0x21')]('onlineForm',JSON['stringify'](_0x176b5f));}},'offlineForm':{'type':Sequelize[_0x3828('0xf')],'defaultValue':function(){return JSON[_0x3828('0x1b')]({'items':[{'type':_0x3828('0x1c'),'props':{'title':_0x3828('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':_0x3828('0x22'),'config':{'placeholder':_0x3828('0x23')},'props':{'title':'Comments','helpText':_0x3828('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x3828('0x1e')](_0x3828('0x25'))?JSON['parse'](this['getDataValue'](_0x3828('0x25'))):{};},'set':function(_0x5b714f){return this['setDataValue']('offlineForm',JSON[_0x3828('0x1b')](_0x5b714f));}},'token':{'type':Sequelize[_0x3828('0x3')],'defaultValue':function(){return rs[_0x3828('0x26')]();}},'autoclose':{'type':Sequelize[_0x3828('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x3828('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x27')},'waitingMessage':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x28')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x29')},'skipUnmanaged':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x16')},'sendUnmanaged':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3828('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3828('0x3')]},'notificationTemplate':{'type':Sequelize[_0x3828('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x3828('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x3828('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x2b')},'verticalAlignment':{'type':Sequelize[_0x3828('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x3828('0x3')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x3828('0x2c')},'defaultTitle':{'type':Sequelize[_0x3828('0x3')]},'customerAvatar':{'type':Sequelize[_0x3828('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x3828('0x3')],'allowNull':![],'defaultValue':_0x3828('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3828('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3828('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x2e')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3828('0x8')],'comment':_0x3828('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![],'comment':_0x3828('0x30'),'set':function(_0x2874b0){if(!_0x2874b0)this[_0x3828('0x21')](_0x3828('0x31'),null);this[_0x3828('0x21')]('mandatoryDisposition',_0x2874b0);}},'vidaooEscalation':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3828('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3828('0x32')},'vidaooNote':{'type':Sequelize[_0x3828('0x3')],'defaultValue':function(){return _0x3828('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x3828('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3828('0xf')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 1076643..fb7162e 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 _0xa9e0=['fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','bluebird','mustache','util','fs-extra','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','error','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','Pause','map','ChatWebsite','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','mandatoryDispositionPause','keys','find','create','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','sitepic','filename','addAvatar','agentAvatar','addCustomerAvatar','file','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','existsSync','server/files/images/logos/','download','isNil','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','customerAvatar','getSystemAvatar','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','Applications','List','account','applications','list','asc','from','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','push','*,*,*,*','AttachmentId','UserId','User','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','spread','readFileSync','render','offlineMessageBody','ChatOfflineMessage','fromString','attachments','offline-chat','basename','Attachment','bulkCreate','MailAccount','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','MailAccountId','mimetype','mapValues','subjectOffline','Chat','server','files','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','internal','Tag','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','increment','all','some','x-real-ip','connection','remoteAddress','replace','textColor','color_button','backgroundColor','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items'];(function(_0x51cf2b,_0x17bc1e){var _0x505756=function(_0xc43054){while(--_0xc43054){_0x51cf2b['push'](_0x51cf2b['shift']());}};_0x505756(++_0x17bc1e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var BPromise=require(_0x0a9e('0x0'));var Mustache=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x3'));var _=require('lodash');var querystring=require(_0x0a9e('0x4'));var Redis=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var db=require(_0x0a9e('0x9'))['db'];config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x0a9e('0xd')](socket);var htmlToText=require(_0x0a9e('0xe'));var jayson=require(_0x0a9e('0xf'));var client=jayson[_0x0a9e('0x10')][_0x0a9e('0x11')]({'port':0x232c});var client9002=jayson[_0x0a9e('0x10')]['http']({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson['client'][_0x0a9e('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x36471c,_0xd5b662,_0x26d672,_0x32d742){return new BPromise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_0x32d742||client;return _0x4283ce[_0x0a9e('0x12')](_0x36471c,_0x26d672)[_0x0a9e('0x13')](function(_0x281129){logger[_0x0a9e('0x14')](_0x0a9e('0x15'),_0xd5b662,'request\x20sent');logger[_0x0a9e('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0xd5b662,_0x0a9e('0x17'),JSON['stringify'](_0x281129));if(_0x281129[_0x0a9e('0x18')]){if(_0x281129[_0x0a9e('0x18')]['code']===0x1f4){logger[_0x0a9e('0x18')]('ChatWebsite,\x20%s,\x20%s',_0xd5b662,_0x281129[_0x0a9e('0x18')][_0x0a9e('0x19')]);return _0x5db4b0(_0x281129[_0x0a9e('0x18')][_0x0a9e('0x19')]);}logger[_0x0a9e('0x18')](_0x0a9e('0x15'),_0xd5b662,_0x281129[_0x0a9e('0x18')][_0x0a9e('0x19')]);return _0x69aeb7(_0x281129[_0x0a9e('0x18')][_0x0a9e('0x19')]);}else{logger[_0x0a9e('0x14')](_0x0a9e('0x15'),_0xd5b662,'request\x20sent');_0x69aeb7(_0x281129[_0x0a9e('0x1a')][_0x0a9e('0x19')]);}})['catch'](function(_0x20f109){logger['error']('ChatWebsite,\x20%s,\x20%s',_0xd5b662,_0x20f109);_0x5db4b0(_0x20f109);});});}function respondWithStatusCode(_0x3a02e1,_0x432e56){_0x432e56=_0x432e56||0xcc;return function(_0x38e7c4){if(_0x38e7c4){return _0x3a02e1[_0x0a9e('0x1b')](_0x432e56);}return _0x3a02e1['status'](_0x432e56)[_0x0a9e('0x1c')]();};}function respondWithResult(_0x2fb0e4,_0x3b45bc){_0x3b45bc=_0x3b45bc||0xc8;return function(_0x4d00e6){if(_0x4d00e6){return _0x2fb0e4[_0x0a9e('0x1d')](_0x3b45bc)[_0x0a9e('0x1e')](_0x4d00e6);}};}function respondWithFilteredResult(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(_0x59181e){var _0x197ec0=typeof _0x5ea472[_0x0a9e('0x1f')]===_0x0a9e('0x20')&&typeof _0x5ea472[_0x0a9e('0x21')]==='undefined';var _0x384319=_0x59181e['count'];var _0x45a1e7=_0x197ec0?0x0:_0x5ea472['offset'];var _0x1dc186=_0x197ec0?_0x59181e[_0x0a9e('0x22')]:_0x5ea472[_0x0a9e('0x1f')]+_0x5ea472[_0x0a9e('0x21')];var _0x140511;if(_0x1dc186>=_0x384319){_0x1dc186=_0x384319;_0x140511=0xc8;}else{_0x140511=0xce;}_0x16b1ca[_0x0a9e('0x1d')](_0x140511);return _0x16b1ca[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x45a1e7+'-'+_0x1dc186+'/'+_0x384319)['json'](_0x59181e);}return null;};}function saveUpdates(_0x3652a7){return function(_0x468813){if(_0x468813){return _0x468813[_0x0a9e('0x25')](_0x3652a7)[_0x0a9e('0x13')](function(_0x5c877d){return _0x5c877d;});}return null;};}function removeEntity(_0x15b200){return function(_0x40e7a3){if(_0x40e7a3){return _0x40e7a3[_0x0a9e('0x26')]()[_0x0a9e('0x13')](function(){var _0x58b06f=_0x40e7a3[_0x0a9e('0x27')]({'plain':!![]});var _0x296f41=_0x0a9e('0x28');return db[_0x0a9e('0x29')]['destroy']({'where':{'type':_0x296f41,'resourceId':_0x58b06f['id']}})[_0x0a9e('0x13')](function(){return _0x40e7a3;});})['then'](function(){_0x15b200[_0x0a9e('0x1d')](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x1122db){return function(_0x33bdb7){if(!_0x33bdb7){_0x1122db[_0x0a9e('0x1b')](0x194);}return _0x33bdb7;};}function handleError(_0x5180f1,_0x66c1d2){_0x66c1d2=_0x66c1d2||0x1f4;return function(_0x46f0a5){logger[_0x0a9e('0x18')](_0x46f0a5[_0x0a9e('0x2a')]);if(_0x46f0a5[_0x0a9e('0x2b')]){delete _0x46f0a5[_0x0a9e('0x2b')];}_0x5180f1[_0x0a9e('0x1d')](_0x66c1d2)[_0x0a9e('0x2c')](_0x46f0a5);};}exports['index']=function(_0x44295a,_0x5e7238){var _0x2cc7a0={'include':[{'model':db[_0x0a9e('0x2d')],'as':'mandatoryDispositionPause'}]},_0x14b13f={},_0x2b7e7f={'count':0x0,'rows':[]};var _0x191e91=_[_0x0a9e('0x2e')](db[_0x0a9e('0x2f')][_0x0a9e('0x30')],function(_0x4853b1){return{'name':_0x4853b1['fieldName'],'type':_0x4853b1[_0x0a9e('0x31')]['key']};});_0x14b13f[_0x0a9e('0x32')]=_[_0x0a9e('0x2e')](_0x191e91,_0x0a9e('0x2b'));_0x14b13f[_0x0a9e('0x33')]=_['keys'](_0x44295a[_0x0a9e('0x33')]);_0x14b13f[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x14b13f['model'],_0x14b13f[_0x0a9e('0x33')]);_0x2cc7a0[_0x0a9e('0x36')]=_[_0x0a9e('0x35')](_0x14b13f['model'],qs['fields'](_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x37')]));_0x2cc7a0['attributes']=_0x2cc7a0[_0x0a9e('0x36')][_0x0a9e('0x38')]?_0x2cc7a0[_0x0a9e('0x36')]:_0x14b13f[_0x0a9e('0x32')];if(!_0x44295a['query']['hasOwnProperty'](_0x0a9e('0x39'))){_0x2cc7a0[_0x0a9e('0x21')]=qs['limit'](_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x21')]);_0x2cc7a0[_0x0a9e('0x1f')]=qs['offset'](_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}_0x2cc7a0[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x2cc7a0[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x44295a[_0x0a9e('0x33')],_0x14b13f[_0x0a9e('0x34')]),_0x191e91);if(_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x2cc7a0[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x2cc7a0['where'],{'$or':_['map'](_0x191e91,function(_0x473fdc){if(_0x473fdc[_0x0a9e('0x31')]!==_0x0a9e('0x40')){var _0x315881={};_0x315881[_0x473fdc[_0x0a9e('0x2b')]]={'$like':'%'+_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x315881;}})});}_0x2cc7a0=_[_0x0a9e('0x3f')]({},_0x2cc7a0,_0x44295a[_0x0a9e('0x41')]);var _0x25c6e6={'where':_0x2cc7a0[_0x0a9e('0x3c')]};return db[_0x0a9e('0x2f')]['count'](_0x25c6e6)[_0x0a9e('0x13')](function(_0x138b8b){_0x2b7e7f[_0x0a9e('0x22')]=_0x138b8b;if(_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x2cc7a0[_0x0a9e('0x43')]=[{'all':!![]}];}return db[_0x0a9e('0x2f')][_0x0a9e('0x44')](_0x2cc7a0);})['then'](function(_0x2e9d90){_0x2b7e7f['rows']=_0x2e9d90;return _0x2b7e7f;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x5e7238,_0x2cc7a0))[_0x0a9e('0x45')](handleError(_0x5e7238,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){var _0x7f6eb1={'raw':![],'where':{'id':_0x562fb4[_0x0a9e('0x47')]['id']},'include':[{'model':db[_0x0a9e('0x2d')],'as':_0x0a9e('0x48')}]},_0x4774f4={};_0x4774f4[_0x0a9e('0x32')]=_['keys'](db[_0x0a9e('0x2f')][_0x0a9e('0x30')]);_0x4774f4[_0x0a9e('0x33')]=_[_0x0a9e('0x49')](_0x562fb4[_0x0a9e('0x33')]);_0x4774f4[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x4774f4[_0x0a9e('0x32')],_0x4774f4[_0x0a9e('0x33')]);_0x7f6eb1['attributes']=_[_0x0a9e('0x35')](_0x4774f4[_0x0a9e('0x32')],qs['fields'](_0x562fb4['query']['fields']));_0x7f6eb1[_0x0a9e('0x36')]=_0x7f6eb1[_0x0a9e('0x36')][_0x0a9e('0x38')]?_0x7f6eb1[_0x0a9e('0x36')]:_0x4774f4[_0x0a9e('0x32')];if(_0x562fb4[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x7f6eb1[_0x0a9e('0x43')]=[{'all':!![]}];}_0x7f6eb1=_['merge']({},_0x7f6eb1,_0x562fb4['options']);return db['ChatWebsite'][_0x0a9e('0x4a')](_0x7f6eb1)[_0x0a9e('0x13')](handleEntityNotFound(_0x14bec2,null))[_0x0a9e('0x13')](respondWithResult(_0x14bec2,null))['catch'](handleError(_0x14bec2,null));};exports[_0x0a9e('0x4b')]=function(_0x161aa7,_0x53d113){return db['ChatWebsite'][_0x0a9e('0x4b')](_0x161aa7['body'],{})[_0x0a9e('0x13')](function(_0x4c3845){var _0x2e5e62=_0x161aa7[_0x0a9e('0x4c')][_0x0a9e('0x27')]({'plain':!![]});if(!_0x2e5e62)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e5e62[_0x0a9e('0x4d')]===_0x0a9e('0x4c')){var _0x508b47=_0x4c3845['get']({'plain':!![]});var _0x128aa6=_0x0a9e('0x28');return db['UserProfileSection'][_0x0a9e('0x4a')]({'where':{'name':_0x128aa6,'userProfileId':_0x2e5e62['userProfileId']},'raw':!![]})[_0x0a9e('0x13')](function(_0x523cd2){if(_0x523cd2&&_0x523cd2[_0x0a9e('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x508b47['name'],'resourceId':_0x508b47['id'],'type':_0x523cd2[_0x0a9e('0x2b')],'sectionId':_0x523cd2['id']},{})['then'](function(){return _0x4c3845;});}else{return _0x4c3845;}})[_0x0a9e('0x45')](function(_0x65432){logger[_0x0a9e('0x18')](_0x0a9e('0x4f'),_0x65432);throw _0x65432;});}return _0x4c3845;})[_0x0a9e('0x13')](respondWithResult(_0x53d113,0xc9))[_0x0a9e('0x45')](handleError(_0x53d113,null));};exports[_0x0a9e('0x25')]=function(_0x28d814,_0x4e67ab){if(_0x28d814[_0x0a9e('0x50')]['id']){delete _0x28d814[_0x0a9e('0x50')]['id'];}return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x28d814[_0x0a9e('0x47')]['id']},'include':[{'model':db[_0x0a9e('0x2d')],'as':'mandatoryDispositionPause'}]})[_0x0a9e('0x13')](handleEntityNotFound(_0x4e67ab,null))[_0x0a9e('0x13')](saveUpdates(_0x28d814['body'],null))[_0x0a9e('0x13')](respondWithResult(_0x4e67ab,null))['catch'](handleError(_0x4e67ab,null));};exports[_0x0a9e('0x26')]=function(_0x5ba1f9,_0x4b3c1a){return db['ChatWebsite'][_0x0a9e('0x4a')]({'where':{'id':_0x5ba1f9['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x4b3c1a,null))[_0x0a9e('0x13')](removeEntity(_0x4b3c1a,null))[_0x0a9e('0x45')](handleError(_0x4b3c1a,null));};exports[_0x0a9e('0x51')]=function(_0x1cca9f,_0x26d7db){return db['ChatWebsite'][_0x0a9e('0x51')]()['then'](respondWithResult(_0x26d7db,null))[_0x0a9e('0x45')](handleError(_0x26d7db,null));};exports[_0x0a9e('0x52')]=function(_0x51aaf7,_0x5adf8f){if(_0x51aaf7[_0x0a9e('0x50')]['id']){delete _0x51aaf7[_0x0a9e('0x50')]['id'];}return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x51aaf7['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x5adf8f,null))[_0x0a9e('0x13')](function(_0x54327c){if(_0x54327c){_0x51aaf7[_0x0a9e('0x50')][_0x0a9e('0x53')]=_0x54327c['id'];return db[_0x0a9e('0x54')][_0x0a9e('0x4b')](_0x51aaf7[_0x0a9e('0x50')]);}})['then'](respondWithResult(_0x5adf8f,null))[_0x0a9e('0x45')](handleError(_0x5adf8f,null));};exports[_0x0a9e('0x55')]=function(_0x281c7d,_0x47bb43){var _0x3528b7={'raw':![],'where':{}};var _0x4f1e60={};var _0x5211e3={'count':0x0,'rows':[]};return db[_0x0a9e('0x2f')][_0x0a9e('0x56')]({'where':{'id':_0x281c7d[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x47bb43,null))[_0x0a9e('0x13')](function(_0xc8c264){if(_0xc8c264){_0x4f1e60[_0x0a9e('0x32')]=_[_0x0a9e('0x49')](db[_0x0a9e('0x54')][_0x0a9e('0x30')]);_0x4f1e60[_0x0a9e('0x33')]=_[_0x0a9e('0x49')](_0x281c7d[_0x0a9e('0x33')]);_0x4f1e60[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x4f1e60[_0x0a9e('0x32')],_0x4f1e60[_0x0a9e('0x33')]);_0x3528b7[_0x0a9e('0x36')]=_['intersection'](_0x4f1e60[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x281c7d[_0x0a9e('0x33')]['fields']));_0x3528b7[_0x0a9e('0x36')]=_0x3528b7[_0x0a9e('0x36')]['length']?_0x3528b7[_0x0a9e('0x36')]:_0x4f1e60[_0x0a9e('0x32')];if(!_0x281c7d[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0x3528b7['limit']=qs['limit'](_0x281c7d['query'][_0x0a9e('0x21')]);_0x3528b7[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x281c7d[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}_0x3528b7[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x281c7d[_0x0a9e('0x33')]['sort']);_0x3528b7[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x281c7d['query'],_0x4f1e60[_0x0a9e('0x34')]));_0x3528b7['where'][_0x0a9e('0x53')]=_0xc8c264['id'];if(_0x281c7d[_0x0a9e('0x33')]['filter']){_0x3528b7[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x3528b7[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x2e')](_0x3528b7['attributes'],function(_0x1d442c){var _0x2e9552={};_0x2e9552[_0x1d442c]={'$like':'%'+_0x281c7d[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x2e9552;})});}_0x3528b7=_['merge']({},_0x3528b7,_0x281c7d[_0x0a9e('0x41')]);return db[_0x0a9e('0x54')][_0x0a9e('0x22')]({'where':_0x3528b7[_0x0a9e('0x3c')]})['then'](function(_0x290d43){_0x5211e3[_0x0a9e('0x22')]=_0x290d43;if(_0x281c7d[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x3528b7[_0x0a9e('0x43')]=[{'all':!![]}];}return db[_0x0a9e('0x54')][_0x0a9e('0x44')](_0x3528b7);})[_0x0a9e('0x13')](function(_0x1a7b03){_0x5211e3[_0x0a9e('0x58')]=_0x1a7b03;return _0x5211e3;});}})[_0x0a9e('0x13')](respondWithFilteredResult(_0x47bb43,_0x3528b7))[_0x0a9e('0x45')](handleError(_0x47bb43,null));};exports[_0x0a9e('0x59')]=function(_0xe0749e,_0x5b35db){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0xe0749e[_0x0a9e('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b35db,null))[_0x0a9e('0x13')](function(_0x33dda0){if(_0x33dda0){return _0x33dda0[_0x0a9e('0x59')](_0xe0749e[_0x0a9e('0x33')]['ids']);}})['then'](respondWithStatusCode(_0x5b35db,null))[_0x0a9e('0x45')](handleError(_0x5b35db,null));};exports[_0x0a9e('0x5a')]=function(_0x4c54fa,_0x45108c){if(_0x4c54fa['body']['id']){delete _0x4c54fa[_0x0a9e('0x50')]['id'];}return db[_0x0a9e('0x2f')]['find']({'where':{'id':_0x4c54fa[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x45108c,null))[_0x0a9e('0x13')](function(_0x42b959){if(_0x42b959){_0x4c54fa[_0x0a9e('0x50')][_0x0a9e('0x53')]=_0x42b959['id'];return db[_0x0a9e('0x5b')]['create'](_0x4c54fa[_0x0a9e('0x50')]);}})[_0x0a9e('0x13')](respondWithResult(_0x45108c,null))[_0x0a9e('0x45')](handleError(_0x45108c,null));};exports[_0x0a9e('0x5c')]=function(_0x492543,_0xf51744){var _0xf0db1={'raw':![],'where':{}};var _0x4bf3a5={};var _0x1d6834={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0a9e('0x56')]({'where':{'id':_0x492543[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0xf51744,null))[_0x0a9e('0x13')](function(_0x5af453){if(_0x5af453){_0x4bf3a5['model']=_[_0x0a9e('0x49')](db[_0x0a9e('0x5b')][_0x0a9e('0x30')]);_0x4bf3a5['query']=_[_0x0a9e('0x49')](_0x492543[_0x0a9e('0x33')]);_0x4bf3a5['filters']=_['intersection'](_0x4bf3a5[_0x0a9e('0x32')],_0x4bf3a5['query']);_0xf0db1['attributes']=_['intersection'](_0x4bf3a5[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x492543[_0x0a9e('0x33')][_0x0a9e('0x37')]));_0xf0db1[_0x0a9e('0x36')]=_0xf0db1[_0x0a9e('0x36')]['length']?_0xf0db1[_0x0a9e('0x36')]:_0x4bf3a5['model'];if(!_0x492543[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0xf0db1[_0x0a9e('0x21')]=qs['limit'](_0x492543[_0x0a9e('0x33')][_0x0a9e('0x21')]);_0xf0db1[_0x0a9e('0x1f')]=qs['offset'](_0x492543[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}_0xf0db1[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x492543[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0xf0db1[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_['pick'](_0x492543[_0x0a9e('0x33')],_0x4bf3a5[_0x0a9e('0x34')]));_0xf0db1['where'][_0x0a9e('0x53')]=_0x5af453['id'];if(_0x492543[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0xf0db1['where']=_[_0x0a9e('0x3f')](_0xf0db1['where'],{'$or':_[_0x0a9e('0x2e')](_0xf0db1[_0x0a9e('0x36')],function(_0x558a87){var _0x1f29bd={};_0x1f29bd[_0x558a87]={'$like':'%'+_0x492543[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x1f29bd;})});}_0xf0db1=_[_0x0a9e('0x3f')]({},_0xf0db1,_0x492543[_0x0a9e('0x41')]);return db['CannedAnswer'][_0x0a9e('0x22')]({'where':_0xf0db1[_0x0a9e('0x3c')]})[_0x0a9e('0x13')](function(_0x30ef6e){_0x1d6834[_0x0a9e('0x22')]=_0x30ef6e;if(_0x492543[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0xf0db1[_0x0a9e('0x43')]=[{'all':!![]}];}return db[_0x0a9e('0x5b')][_0x0a9e('0x44')](_0xf0db1);})[_0x0a9e('0x13')](function(_0x3754e2){_0x1d6834[_0x0a9e('0x58')]=_0x3754e2;return _0x1d6834;});}})['then'](respondWithFilteredResult(_0xf51744,_0xf0db1))[_0x0a9e('0x45')](handleError(_0xf51744,null));};exports[_0x0a9e('0x5d')]=function(_0x12843d,_0x2ed526){return db[_0x0a9e('0x2f')]['find']({'where':{'id':_0x12843d[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x2ed526,null))['then'](function(_0x23b447){if(_0x23b447){return _0x23b447['removeAnswers'](_0x12843d[_0x0a9e('0x33')][_0x0a9e('0x5e')]);}})[_0x0a9e('0x13')](respondWithStatusCode(_0x2ed526,null))[_0x0a9e('0x45')](handleError(_0x2ed526,null));};exports['addLogo']=function(_0x3ceba6,_0x4cf72d){_0x3ceba6[_0x0a9e('0x50')][_0x0a9e('0x5f')]=_0x3ceba6['file'][_0x0a9e('0x60')];return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x3ceba6['params']['id']}})['then'](handleEntityNotFound(_0x4cf72d,null))[_0x0a9e('0x13')](saveUpdates(_0x3ceba6[_0x0a9e('0x50')],null))[_0x0a9e('0x13')](respondWithResult(_0x4cf72d,null))[_0x0a9e('0x45')](handleError(_0x4cf72d,null));};exports[_0x0a9e('0x61')]=function(_0x2450a8,_0x17793e){_0x2450a8[_0x0a9e('0x50')][_0x0a9e('0x62')]=_0x2450a8['file'][_0x0a9e('0x60')];return db['ChatWebsite'][_0x0a9e('0x4a')]({'where':{'id':_0x2450a8[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x17793e,null))[_0x0a9e('0x13')](saveUpdates(_0x2450a8[_0x0a9e('0x50')],null))['then'](respondWithResult(_0x17793e,null))[_0x0a9e('0x45')](handleError(_0x17793e,null));};exports[_0x0a9e('0x63')]=function(_0x2791c5,_0x2aa5f2){_0x2791c5[_0x0a9e('0x50')]['customerAvatar']=_0x2791c5['file'][_0x0a9e('0x60')];return db['ChatWebsite'][_0x0a9e('0x4a')]({'where':{'id':_0x2791c5[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x13')](saveUpdates(_0x2791c5[_0x0a9e('0x50')],null))[_0x0a9e('0x13')](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports['addSystemAvatar']=function(_0x1889ed,_0x5dfbe2){_0x1889ed[_0x0a9e('0x50')]['systemAvatar']=_0x1889ed[_0x0a9e('0x64')]['filename'];return db['ChatWebsite'][_0x0a9e('0x4a')]({'where':{'id':_0x1889ed[_0x0a9e('0x47')]['id']}})['then'](handleEntityNotFound(_0x5dfbe2,null))[_0x0a9e('0x13')](saveUpdates(_0x1889ed[_0x0a9e('0x50')],null))[_0x0a9e('0x13')](respondWithResult(_0x5dfbe2,null))[_0x0a9e('0x45')](handleError(_0x5dfbe2,null));};exports[_0x0a9e('0x65')]=function(_0x5ab0bc,_0x5505f4){var _0x16449b=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x68'));var _0x59303b={'where':{'id':_0x5ab0bc['params']['id']},'attributes':['id',_0x0a9e('0x5f')],'raw':!![]};var _0xadce3d=![];return require('../../config/license/util')[_0x0a9e('0x69')]()[_0x0a9e('0x13')](function(_0xcacabb){if(_0xcacabb){_0xadce3d=_0xcacabb[_0x0a9e('0x6a')];}})[_0x0a9e('0x13')](function(){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')](_0x59303b);})[_0x0a9e('0x13')](handleEntityNotFound(_0x5505f4,null))[_0x0a9e('0x13')](function(_0x16afb3){if(_0x16afb3){if(!_['isNil'](_0x16afb3[_0x0a9e('0x5f')])){if(fs[_0x0a9e('0x6b')](path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6c'),_0x16afb3['sitepic']))&&_0xadce3d){_0x16449b=path['join'](config[_0x0a9e('0x67')],_0x0a9e('0x6c'),_0x16afb3[_0x0a9e('0x5f')]);}}return _0x5505f4[_0x0a9e('0x6d')](_0x16449b);}})[_0x0a9e('0x45')](handleError(_0x5505f4,null));};exports['getAvatar']=function(_0x1339d0,_0x3c775a){var _0x3450ae=path['join'](config[_0x0a9e('0x67')],'server/files/images/avatars/default_avatar.png');var _0x2144ca={'where':{'id':_0x1339d0['params']['id']},'attributes':['id',_0x0a9e('0x62')],'raw':!![]};return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')](_0x2144ca)['then'](handleEntityNotFound(_0x3c775a,null))[_0x0a9e('0x13')](function(_0x5ed560){if(_0x5ed560){if(!_[_0x0a9e('0x6e')](_0x5ed560[_0x0a9e('0x62')])){if(fs[_0x0a9e('0x6b')](path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x5ed560[_0x0a9e('0x62')]))){_0x3450ae=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x5ed560[_0x0a9e('0x62')]);}}return _0x3c775a[_0x0a9e('0x6d')](_0x3450ae);}})[_0x0a9e('0x45')](handleError(_0x3c775a,null));};exports[_0x0a9e('0x70')]=function(_0x98c62c,_0x248368){var _0x5b93dd=path['join'](config[_0x0a9e('0x67')],'server/files/images/avatars/customer_avatar.png');var _0x1d999b={'where':{'id':_0x98c62c[_0x0a9e('0x47')]['id']},'attributes':['id','customerAvatar',_0x0a9e('0x71')],'raw':!![]};return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')](_0x1d999b)[_0x0a9e('0x13')](handleEntityNotFound(_0x248368,null))['then'](function(_0x148fd9){if(_0x148fd9){if(!_[_0x0a9e('0x6e')](_0x148fd9[_0x0a9e('0x72')])){if(fs[_0x0a9e('0x6b')](path['join'](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x148fd9[_0x0a9e('0x72')]))&&_0x148fd9['showCustomerAvatar']){_0x5b93dd=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x148fd9['customerAvatar']);}}return _0x248368[_0x0a9e('0x6d')](_0x5b93dd);}})[_0x0a9e('0x45')](handleError(_0x248368,null));};exports[_0x0a9e('0x73')]=function(_0x1a7f58,_0x2394d3){var _0x555780=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],'server/files/images/avatars/system_avatar.png');var _0x3bab3e={'where':{'id':_0x1a7f58[_0x0a9e('0x47')]['id']},'attributes':['id',_0x0a9e('0x74')],'raw':!![]};return db['ChatWebsite']['find'](_0x3bab3e)['then'](handleEntityNotFound(_0x2394d3,null))[_0x0a9e('0x13')](function(_0x4a70ce){if(_0x4a70ce){if(!_['isNil'](_0x4a70ce[_0x0a9e('0x74')])){if(fs[_0x0a9e('0x6b')](path[_0x0a9e('0x66')](config['root'],_0x0a9e('0x6f'),_0x4a70ce[_0x0a9e('0x74')]))){_0x555780=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x4a70ce[_0x0a9e('0x74')]);}}return _0x2394d3[_0x0a9e('0x6d')](_0x555780);}})[_0x0a9e('0x45')](handleError(_0x2394d3,null));};exports[_0x0a9e('0x75')]=function(_0x5a1848,_0x43c397){var _0x5526a7=require(_0x0a9e('0x76'));var _0x4093e6=new _0x5526a7();var _0x2097d8=_0x4093e6[_0x0a9e('0x77')](_0x5a1848[_0x0a9e('0x78')][_0x0a9e('0x79')])['getResult']();var _0x1a0314={'body':_0x5a1848[_0x0a9e('0x50')],'channel':_0x0a9e('0x7a')};var _0x1af799=[];var _0x51aa2f=[];var _0x2e4887={};var _0x3c9135=![];return db[_0x0a9e('0x7b')][_0x0a9e('0x51')]()[_0x0a9e('0x13')](function(_0x2be526){if(!_0x2be526){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0x7e'));}_0x1af799=_[_0x0a9e('0x7f')](_['keys'](_0x2be526),[_0x0a9e('0x80'),_0x0a9e('0x81')]);_0x51aa2f=_[_0x0a9e('0x7f')](_[_0x0a9e('0x49')](_0x2be526),[_0x0a9e('0x80'),_0x0a9e('0x81'),_0x0a9e('0x82'),_0x0a9e('0x83')]);if(_0x5a1848['body']['id']){delete _0x5a1848[_0x0a9e('0x50')]['id'];}if(_[_0x0a9e('0x6e')](_0x5a1848[_0x0a9e('0x50')]['from'])){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0x84'));}if(_[_0x0a9e('0x6e')](_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x50')])||_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x50')]===''){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0a9e('0x6e')](_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x85')])){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0x86')+_0x51aa2f);}if(!_['includes'](_0x51aa2f,_0x5a1848[_0x0a9e('0x50')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x0a9e('0x87')+_0x51aa2f);}_0x2e4887[_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x85')]]=_0x5a1848[_0x0a9e('0x50')]['from'];})[_0x0a9e('0x13')](function(){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x5a1848[_0x0a9e('0x47')]['id']},'include':[{'model':db[_0x0a9e('0x88')],'as':'List','include':[{'model':db['CmContact'],'as':_0x0a9e('0x89'),'where':_0x2e4887,'limit':0x1,'order':[[_0x0a9e('0x81'),_0x0a9e('0x8a')]]}]},{'model':db['ChatApplication'],'as':_0x0a9e('0x8b')}]});})[_0x0a9e('0x13')](handleEntityNotFound(_0x43c397,null))[_0x0a9e('0x13')](function(_0x4cee8c){if(_0x4cee8c&&_0x4cee8c[_0x0a9e('0x8c')]){_0x1a0314[_0x0a9e('0x8d')]=_0x4cee8c;_0x1a0314[_0x0a9e('0x8e')]=_0x4cee8c['Applications'];_0x1a0314[_0x0a9e('0x8f')]=_0x4cee8c[_0x0a9e('0x8c')];_0x1a0314[_0x0a9e('0x8e')]=_['orderBy'](_0x1a0314['applications'],['priority'],[_0x0a9e('0x90')]);if(_0x1a0314[_0x0a9e('0x8d')][_0x0a9e('0x8b')]){delete _0x1a0314[_0x0a9e('0x8d')]['Applications'];}if(_0x1a0314[_0x0a9e('0x8d')]['List']&&_0x1a0314[_0x0a9e('0x8d')][_0x0a9e('0x8c')][_0x0a9e('0x89')]['length']){return _0x1a0314[_0x0a9e('0x8d')][_0x0a9e('0x8c')][_0x0a9e('0x89')][0x0];}var _0x580dd6=_[_0x0a9e('0xb')](_0x5a1848['body'],{'firstName':_0x5a1848[_0x0a9e('0x50')]['from'],'ListId':_0x4cee8c[_0x0a9e('0x83')]});_0x580dd6[_0x5a1848['body'][_0x0a9e('0x85')]]=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x91')];return db[_0x0a9e('0x7b')][_0x0a9e('0x4b')](_0x580dd6,{'fields':_0x1af799,'raw':!![]});}})[_0x0a9e('0x13')](handleEntityNotFound(_0x43c397,null))[_0x0a9e('0x13')](function(_0x5acdc9){_0x1a0314[_0x0a9e('0x92')]=_0x5acdc9;var _0x1c9ea2=_0x5a1848['body'][_0x0a9e('0x93')];if(_0x5a1848[_0x0a9e('0x78')]['cf-connecting-ip']){_0x1c9ea2=_0x5a1848[_0x0a9e('0x78')][_0x0a9e('0x94')];}else if(_0x5a1848[_0x0a9e('0x78')]['x-forwarded-for']){_0x1c9ea2=_[_0x0a9e('0x95')](_0x5a1848[_0x0a9e('0x78')][_0x0a9e('0x96')][_0x0a9e('0x97')](','));}if(_0x5acdc9){var _0x2003bc={'ContactId':_0x5acdc9['id'],'ChatWebsiteId':_0x5a1848[_0x0a9e('0x47')]['id'],'from':(_0x5acdc9[_0x0a9e('0x98')]||'')+'\x20'+(_0x5acdc9[_0x0a9e('0x99')]||''),'customerIp':_0x1c9ea2,'customerPort':_0x5a1848[_0x0a9e('0x78')][_0x0a9e('0x9a')]?_0x5a1848['headers'][_0x0a9e('0x9a')]:null,'referer':_0x5a1848['body'][_0x0a9e('0x9b')],'browserName':_0x2097d8[_0x0a9e('0x9c')][_0x0a9e('0x2b')]&&_0x2097d8[_0x0a9e('0x9c')][_0x0a9e('0x9d')]?util[_0x0a9e('0x9e')]('%s\x20%s',_0x2097d8[_0x0a9e('0x9c')][_0x0a9e('0x2b')],_0x2097d8[_0x0a9e('0x9c')]['version']):_0x0a9e('0x9f'),'browserVersion':_0x2097d8[_0x0a9e('0x9c')][_0x0a9e('0x9d')]||_0x0a9e('0x9f'),'osName':util[_0x0a9e('0x9e')](_0x0a9e('0xa0'),_0x2097d8['os'][_0x0a9e('0x2b')],_0x2097d8['os']['version']),'osVersion':_0x2097d8['os'][_0x0a9e('0x9d')],'deviceModel':_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0x32')]&&_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0xa2')]?util[_0x0a9e('0x9e')](_0x0a9e('0xa3'),_0x2097d8['device']['model'],_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0xa2')],_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0x31')]):null,'deviceVendor':_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0xa2')],'deviceType':_0x2097d8[_0x0a9e('0xa1')]['type'],'formData':JSON[_0x0a9e('0xa4')](_0x5a1848[_0x0a9e('0x50')])};var _0x2d8e91={'ChatWebsiteId':_0x5a1848[_0x0a9e('0x47')]['id'],'closed':![]};if(_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa5')]){_0x2d8e91[_0x0a9e('0xa5')]=_0x5a1848['body'][_0x0a9e('0xa5')];return db[_0x0a9e('0xa6')][_0x0a9e('0x4a')]({'where':_0x2d8e91})['then'](function(_0x2b8ad4){if(_0x2b8ad4){return[_0x2b8ad4,![]];}_0x2003bc[_0x0a9e('0xa5')]=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa5')];_0x2003bc['externalUrl']=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa7')];return db[_0x0a9e('0xa6')][_0x0a9e('0x4b')](_0x2003bc)[_0x0a9e('0x13')](function(_0x20c130){return[_0x20c130,!![]];});});}_0x2d8e91[_0x0a9e('0xa8')]=_0x5acdc9['id'];if(_0x5a1848[_0x0a9e('0x50')]['interaction']&&_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa9')]['id']){_0x2d8e91['id']=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa9')]['id'];return db['ChatInteraction']['find']({'where':_0x2d8e91})[_0x0a9e('0x13')](function(_0x2abe55){if(_0x2abe55){return[_0x2abe55,![]];}return db[_0x0a9e('0xa6')]['create'](_0x2003bc)[_0x0a9e('0x13')](function(_0x40180d){return[_0x40180d,!![]];});});}return db['ChatInteraction'][_0x0a9e('0x4b')](_0x2003bc)['then'](function(_0x35cc2a){return[_0x35cc2a,!![]];});}})['spread'](function(_0x5b42b9,_0x48eaa3){if(_0x5b42b9){_0x3c9135=_0x48eaa3;if(!_0x48eaa3){var _0xad4d10={'from':(_0x1a0314[_0x0a9e('0x92')][_0x0a9e('0x98')]||'')+'\x20'+(_0x1a0314[_0x0a9e('0x92')][_0x0a9e('0x99')]||'')};if(_0x5a1848[_0x0a9e('0x50')]['threadId']&&_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xaa')]&&_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa5')]!=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xaa')]){_0xad4d10[_0x0a9e('0xa5')]=_0x5a1848['body']['messageId'];}return _0x5b42b9[_0x0a9e('0x25')](_0xad4d10);}else{return _0x5b42b9;}}})['then'](function(_0x29537a){_0x1a0314[_0x0a9e('0xa9')]=_0x29537a[_0x0a9e('0x27')]({'plain':!![]});_0x1a0314[_0x0a9e('0xa9')][_0x0a9e('0xab')]=_0x3c9135;if(_0x1a0314[_0x0a9e('0xa9')]['created']){if(_0x1a0314[_0x0a9e('0x8d')]['autoclose']){_0x1a0314['applications'][_0x0a9e('0xac')]({'id':0x0,'priority':_0x1a0314['applications'][_0x0a9e('0x38')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x0a9e('0xad')});}}return db['ChatMessage'][_0x0a9e('0x4b')]({'body':_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x50')],'ChatWebsiteId':_0x5a1848['params']['id'],'ChatInteractionId':_0x29537a['id'],'direction':'in','ContactId':_0x1a0314[_0x0a9e('0x92')]['id'],'AttachmentId':_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xae')]});})['then'](function(_0x5236c9){_0x1a0314[_0x0a9e('0x19')]=_0x5236c9;if(_0x1a0314[_0x0a9e('0xa9')][_0x0a9e('0xaf')]){return db[_0x0a9e('0xb0')][_0x0a9e('0x4a')]({'attributes':['id',_0x0a9e('0x2b')],'where':{'id':_0x1a0314[_0x0a9e('0xa9')][_0x0a9e('0xaf')]}})[_0x0a9e('0x13')](function(_0x1020a0){if(_0x1020a0){_0x1a0314['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1020a0[_0x0a9e('0x2b')]+','+(_0x1a0314[_0x0a9e('0x8d')][_0x0a9e('0xb1')]||0xa),'interval':_0x0a9e('0xad')});_0x1a0314[_0x0a9e('0xb2')]=!![];}return respondWithRpcPromise(_0x0a9e('0xb3'),_0x0a9e('0xb4'),_0x1a0314);});}return respondWithRpcPromise(_0x0a9e('0xb3'),'startRouting',_0x1a0314);})['then'](function(_0x2869cc){respondWithRpcPromise(_0x0a9e('0xb5'),'EventManager',{'event':_0x0a9e('0x75'),'message':_0x2869cc},client9002);return _0x2869cc;})[_0x0a9e('0x13')](respondWithResult(_0x43c397,null))[_0x0a9e('0x45')](handleError(_0x43c397,null));};exports[_0x0a9e('0xb6')]=function(_0x2bb549,_0x2683ad){var _0x167196,_0x262281,_0x59f8f7;var _0x400800=[];var _0xbd1af3={};var _0x20e191=_0x2bb549['files']||[];var _0x4412a5=[];var _0x261ef8;return db[_0x0a9e('0x7b')][_0x0a9e('0x51')]()[_0x0a9e('0x13')](function(_0x21ada7){if(!_0x21ada7){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0x7e'));}_0x400800=_[_0x0a9e('0x7f')](_[_0x0a9e('0x49')](_0x21ada7),[_0x0a9e('0x80'),'updatedAt','CompanyId',_0x0a9e('0x83')]);if(_0x2bb549[_0x0a9e('0x50')]['id']){delete _0x2bb549[_0x0a9e('0x50')]['id'];}if(_[_0x0a9e('0x6e')](_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x91')])){throw _0x2683ad[_0x0a9e('0x1d')](0x1f4)['send'](new db[(_0x0a9e('0x7c'))]['ValidationError'](_0x0a9e('0x84')));}if(_[_0x0a9e('0x6e')](_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x50')])||_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x50')]===''){throw _0x2683ad[_0x0a9e('0x1d')](0x1f4)[_0x0a9e('0x2c')](new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0xb7')));}if(_[_0x0a9e('0x6e')](_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0xb8')])){throw _0x2683ad[_0x0a9e('0x1d')](0x1f4)[_0x0a9e('0x2c')](new db['Sequelize']['ValidationError'](_0x0a9e('0xb9')+_0x400800));}if(!_[_0x0a9e('0xba')](_0x400800,_0x2bb549['body']['mapKeyOffline'])){throw _0x2683ad[_0x0a9e('0x1d')](0x1f4)[_0x0a9e('0x2c')](new db[(_0x0a9e('0x7c'))]['ValidationError'](_0x0a9e('0xbb')+_0x400800));}_0xbd1af3[_0x2bb549['body'][_0x0a9e('0xb8')]]=_0x2bb549['body'][_0x0a9e('0x91')];})['then'](function(){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x2bb549[_0x0a9e('0x47')]['id']},'include':[{'model':db['CmList'],'as':_0x0a9e('0x8c')},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x0a9e('0x13')](handleEntityNotFound(_0x2683ad,null))[_0x0a9e('0x13')](function(_0x3c691f){if(_0x3c691f&&_0x3c691f[_0x0a9e('0x8c')]){_0x262281=_0x3c691f;var _0x1d51fd=_[_0x0a9e('0xb')](_0x2bb549[_0x0a9e('0x50')],{'firstName':_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x91')],'phone':_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x91')],'ListId':_0x3c691f[_0x0a9e('0x83')]});_0x1d51fd[_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0xb8')]]=_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x91')];return db[_0x0a9e('0x7b')][_0x0a9e('0xbc')]({'where':_0xbd1af3,'defaults':_0x1d51fd});}})[_0x0a9e('0xbd')](function(_0x51a987){if(_0x51a987){_0x59f8f7=_0x51a987;var _0x233e48=fs[_0x0a9e('0xbe')](path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x54658d=ejs[_0x0a9e('0xbf')](_0x233e48,{'body':_['toPairs'](_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x50')]),'bodyTitle':_0x262281[_0x0a9e('0xc0')]});return db[_0x0a9e('0xc1')][_0x0a9e('0x4b')]({'body':_0x54658d,'plainBody':htmlToText[_0x0a9e('0xc2')](_0x54658d),'ContactId':_0x51a987['id'],'ChatWebsiteId':_0x262281['id']});}})[_0x0a9e('0x13')](function(_0x1cc73e){_0x261ef8=_0x1cc73e;if(_0x20e191[_0x0a9e('0x38')]){var _0x6b948a=_0x20e191['map'](function(_0x283c59){return{'name':_0x283c59['originalname'],'basename':_0x283c59[_0x0a9e('0x60')],'type':_0x283c59['mimetype'],'ChatOfflineMessageId':_0x1cc73e['id']};});_0x4412a5=_0x6b948a[_0x0a9e('0x2e')](_0x2c5385=>{var _0x216791={'filename':_0x2c5385['name'],'path':path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],'server','files',_0x0a9e('0xc3'),_0x0a9e('0xc4'),_0x2c5385[_0x0a9e('0xc5')])};return _0x216791;});if(!_0x262281['openNewInteraction']){return db['sequelize']['transaction'](function(_0x374964){return db[_0x0a9e('0xc6')][_0x0a9e('0xc7')](_0x6b948a,{'transaction':_0x374964});});}}})[_0x0a9e('0x13')](function(){if(_0x261ef8){_0x167196=_0x261ef8;return db[_0x0a9e('0xc8')][_0x0a9e('0x56')]({'where':{'active':!![]},'include':[{'model':db[_0x0a9e('0xc9')],'as':_0x0a9e('0xca'),'raw':!![],'include':[{'model':db[_0x0a9e('0xcb')],'as':_0x0a9e('0xcb'),'raw':!![]}]}]});}})[_0x0a9e('0x13')](function(_0x2f4de1){if(_0x2f4de1&&_0x2f4de1[_0x0a9e('0xca')]&&_0x262281[_0x0a9e('0xcc')]&&_0x262281[_0x0a9e('0xcd')]){var _0x1a74c4=_0x2f4de1[_0x0a9e('0xce')]();return respondWithRpcPromise(_0x0a9e('0xcf'),'sendMail',{'account':_0x1a74c4,'message':{'from':util[_0x0a9e('0x9e')](_0x0a9e('0xd0'),_0x2f4de1[_0x0a9e('0x2b')],_0x2f4de1[_0x0a9e('0xd1')]||_0x2f4de1[_0x0a9e('0xca')][_0x0a9e('0x4c')]),'to':_0x262281['forwardOfflineAddress'],'subject':_0x262281[_0x0a9e('0xd2')],'html':_0x167196[_0x0a9e('0x50')],'attachments':_0x4412a5}},client9003)[_0x0a9e('0x13')](function(){return _0x167196;})[_0x0a9e('0x45')](function(_0x37390b){logger[_0x0a9e('0x18')](_0x37390b);});}})[_0x0a9e('0x13')](function(){if(_0x262281&&_0x262281[_0x0a9e('0xd3')]&&_0x262281[_0x0a9e('0xd4')]){var _0x541af6=[];if(_0x20e191['length']){_0x541af6=_0x20e191[_0x0a9e('0x2e')](function(_0x3a0b30){return{'name':_0x3a0b30['originalname'],'basename':_0x3a0b30[_0x0a9e('0x60')],'type':_0x3a0b30[_0x0a9e('0xd5')],'ChatOfflineMessageId':_0x261ef8['id']};});}var _0x4c8d75;if(!_[_0x0a9e('0x6e')](_0x262281['subjectOffline'])){var _0x3468a4=_[_0x0a9e('0x2e')](_0x2bb549['body'],function(_0x27a41c){return _0x27a41c;});var _0x31ab12=_['toPairsIn'](_0x3468a4)[0x0];var _0x197d65=_[_0x0a9e('0xd6')](_0x31ab12,function(_0x53ad2b){return _0x53ad2b;});_0x4c8d75=_0x197d65[0x1][_0x262281[_0x0a9e('0xd7')]];}var _0x237994={'from':_0x59f8f7[_0x0a9e('0xd1')],'firstName':_0x59f8f7[_0x0a9e('0x98')],'lastName':_0x59f8f7[_0x0a9e('0x99')],'mapKey':_0x0a9e('0xd1'),'message':{'from':_0x59f8f7['email'],'to':_0x262281[_0x0a9e('0xc8')][_0x0a9e('0xd1')],'cc':'','subject':_['isNil'](_0x4c8d75)?_0x262281[_0x0a9e('0xd2')]:_0x4c8d75,'messageId':'','sentAt':new Date(),'attach':_0x541af6[_0x0a9e('0x38')],'attachments':_0x541af6,'originChannel':_0x0a9e('0xd8'),'ChatWebsiteId':_0x262281['id'],'ChatOfflineMessageId':_0x167196['id'],'originTo':_0x262281[_0x0a9e('0xc8')][_0x0a9e('0xd1')]},'body':_0x167196[_0x0a9e('0x50')]};var _0x368a12={'account':{'id':_0x262281['MailAccountId']},'body':_0x237994,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x368a12,client9001)['then'](function(){return _0x167196;})[_0x0a9e('0x45')](function(_0x23ef4e){logger['error'](_0x23ef4e);});}return;})['then'](function(){if(_0x167196){return _0x167196;}})[_0x0a9e('0x13')](respondWithResult(_0x2683ad,null))['catch'](function(_0x41600e){logger[_0x0a9e('0x18')](_0x0a9e('0x45'),_0x41600e);for(var _0x175c97 of _0x20e191){var _0x336518=path[_0x0a9e('0x66')](config['root'],_0x0a9e('0xd9'),_0x0a9e('0xda'),'attachments',_0x0a9e('0xc4'),_0x175c97[_0x0a9e('0x60')]);fs_extra[_0x0a9e('0xdb')](_0x336518)[_0x0a9e('0x45')](function(_0x1282da){logger[_0x0a9e('0x18')](_0x0a9e('0xdc'),_0x336518,_0x1282da);});}});};exports['addInteraction']=function(_0x331216,_0x508395){return db[_0x0a9e('0xa6')][_0x0a9e('0x4a')]({'where':{'id':_0x331216['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x508395,null))[_0x0a9e('0x13')](function(_0x5061e5){if(_0x5061e5){return _0x5061e5[_0x0a9e('0xdd')](_0x331216['body'][_0x0a9e('0x5e')],_[_0x0a9e('0xde')](_0x331216['body'],[_0x0a9e('0x5e'),'id'])||{});}})['then'](respondWithResult(_0x508395,null))[_0x0a9e('0x45')](handleError(_0x508395,null));};exports[_0x0a9e('0xdf')]=function(_0x732141,_0x37ef45){var _0x288127={'raw':![],'where':{}};var _0x26d010={};var _0xa45906={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0a9e('0x56')]({'where':{'id':_0x732141[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x37ef45,null))[_0x0a9e('0x13')](function(_0x38e256){if(_0x38e256){_0x26d010['model']=_[_0x0a9e('0x49')](db['ChatInteraction']['rawAttributes']);_0x26d010[_0x0a9e('0x33')]=_['keys'](_0x732141[_0x0a9e('0x33')]);_0x26d010[_0x0a9e('0x34')]=_['intersection'](_0x26d010[_0x0a9e('0x32')],_0x26d010[_0x0a9e('0x33')]);_0x288127[_0x0a9e('0x36')]=_[_0x0a9e('0x35')](_0x26d010[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x732141[_0x0a9e('0x33')][_0x0a9e('0x37')]));_0x288127[_0x0a9e('0x36')]=_0x288127['attributes'][_0x0a9e('0x38')]?_0x288127[_0x0a9e('0x36')]:_0x26d010[_0x0a9e('0x32')];if(!_0x732141[_0x0a9e('0x33')]['hasOwnProperty'](_0x0a9e('0x39'))){_0x288127[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x732141['query'][_0x0a9e('0x21')]);_0x288127[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x732141['query'][_0x0a9e('0x1f')]);}_0x288127['order']=qs[_0x0a9e('0x3b')](_0x732141[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x288127[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x732141[_0x0a9e('0x33')],_0x26d010['filters']));_0x288127[_0x0a9e('0x3c')][_0x0a9e('0x53')]=_0x38e256['id'];if(_0x732141[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x288127[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x288127[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x2e')](_0x288127[_0x0a9e('0x36')],function(_0x4712c9){var _0x4542d3={};_0x4542d3[_0x4712c9]={'$like':'%'+_0x732141[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x4542d3;})});}_0x288127=_[_0x0a9e('0x3f')]({},_0x288127,_0x732141[_0x0a9e('0x41')]);return db[_0x0a9e('0xa6')][_0x0a9e('0x22')]({'where':_0x288127[_0x0a9e('0x3c')]})[_0x0a9e('0x13')](function(_0x611e46){_0xa45906[_0x0a9e('0x22')]=_0x611e46;if(_0x732141[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x288127['include']=[{'model':db[_0x0a9e('0x7b')],'as':_0x0a9e('0xe0'),'required':![]},{'model':db[_0x0a9e('0xb0')],'as':'Owner','attributes':[_0x0a9e('0x2b'),'fullname',_0x0a9e('0xe1')],'required':![]},{'model':db[_0x0a9e('0xe2')],'as':_0x0a9e('0xe3'),'attributes':['id',_0x0a9e('0x2b'),_0x0a9e('0xe4')],'where':_0x732141[_0x0a9e('0x33')][_0x0a9e('0xe5')]?{'id':_0x732141[_0x0a9e('0x33')]['tag']}:undefined,'required':_0x732141[_0x0a9e('0x33')][_0x0a9e('0xe5')]?!![]:![]}];}return db['ChatInteraction'][_0x0a9e('0x44')](_0x288127);})[_0x0a9e('0x13')](function(_0x579bb0){_0xa45906['rows']=_0x579bb0;return _0xa45906;});}})[_0x0a9e('0x13')](respondWithFilteredResult(_0x37ef45,_0x288127))[_0x0a9e('0x45')](handleError(_0x37ef45,null));};function iftimePromise(_0x315299,_0x1bf053){return respondWithRpcPromise('Command',_0x0a9e('0xe6'),{'command':_0x1bf053[_0x0a9e('0xe7')]?util[_0x0a9e('0x9e')](_0x0a9e('0xe8'),_0x315299[_0x0a9e('0xe9')],_0x1bf053['timezone']):util[_0x0a9e('0x9e')](_0x0a9e('0xea'),_0x315299['interval'])},client9002)[_0x0a9e('0x13')](function(_0x2d20a0){var _0x38284a=_0x2d20a0&&_0x2d20a0['indexOf']('true')>=0x0?!![]:![];logger[_0x0a9e('0x14')](_0x0a9e('0xeb'),_0x1bf053['id'],_0x315299['id'],_0x315299[_0x0a9e('0xe9')],_0x38284a?_0x0a9e('0xec'):_0x0a9e('0xed'),_0x1bf053[_0x0a9e('0xe7')]?_0x1bf053[_0x0a9e('0xe7')]:_0x0a9e('0xee'));return _0x38284a;})['catch'](function(_0x5cc8cb){logger[_0x0a9e('0x18')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1bf053['id'],_0x315299['id'],_0x315299[_0x0a9e('0xe9')],util[_0x0a9e('0xef')](_0x5cc8cb,{'showHidden':![],'depth':null}),_0x1bf053[_0x0a9e('0xe7')]?_0x1bf053[_0x0a9e('0xe7')]:'No\x20timezone');return![];});}exports[_0x0a9e('0xe6')]=function(_0x43c1d1,_0x546bc9){var _0x10e370=0x0;var _0x5092af=0x0;var _0x2e1de7=![];var _0x30a77e;var _0xd63c87;return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x43c1d1[_0x0a9e('0x47')]['id']},'include':[{'model':db['Interval'],'as':_0x0a9e('0xf0'),'include':[{'model':db['Interval'],'as':_0x0a9e('0xf1'),'attributes':['id',_0x0a9e('0xe9')],'raw':!![]}]}]})[_0x0a9e('0x13')](handleEntityNotFound(_0x546bc9,null))[_0x0a9e('0x13')](function(_0xa244bc){if(_0xa244bc){_0x30a77e=_0xa244bc;return _0xa244bc[_0x0a9e('0xf2')]({'raw':!![]});}})[_0x0a9e('0x13')](function(_0x5bdba6){if(_0x30a77e){if(_0x5bdba6){_0xd63c87=_0x5bdba6;}}return require(_0x0a9e('0xf3'))[_0x0a9e('0x69')]();})[_0x0a9e('0x13')](function(_0x188231){if(_0x188231){_0x5092af=_0x188231[_0x0a9e('0xf4')];_0x2e1de7=_0x188231['custom'];}})[_0x0a9e('0x13')](function(){return db[_0x0a9e('0xa6')]['count']({'where':{'closed':![]}});})['then'](function(_0x2240ea){_0x10e370=_0x2240ea;if(_0x5092af&&_0x2240ea>_0x5092af){return db[_0x0a9e('0xf5')][_0x0a9e('0x56')]({'where':{'id':0x1}})[_0x0a9e('0x13')](function(_0x380539){if(_0x380539){_0x380539[_0x0a9e('0xf6')]('chatLicenseExceeded');}});}})[_0x0a9e('0x13')](function(){if(_0x30a77e[_0x0a9e('0xf0')]&&_0x30a77e[_0x0a9e('0xf0')]['Intervals']){var _0x294e90=[];for(var _0x1969e3=0x0;_0x1969e3<_0x30a77e[_0x0a9e('0xf0')][_0x0a9e('0xf1')]['length'];_0x1969e3++){var _0x5d4935=_0x30a77e[_0x0a9e('0xf0')][_0x0a9e('0xf1')][_0x1969e3][_0x0a9e('0x27')]({'plain':!![]});_0x294e90[_0x0a9e('0xac')](iftimePromise(_0x5d4935,_0x30a77e));}return BPromise[_0x0a9e('0xf7')](_0x294e90)[_0x0a9e('0x13')](function(_0x371943){return _[_0x0a9e('0xf8')](_0x371943);});}else{return!![];}})['then'](function(_0x17187c){var _0x4be017=fs[_0x0a9e('0xbe')](path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],'server/files/chat/iframe.ejs'),'utf8');var _0x462ecd={'remote':_0x30a77e['remote'],'query':querystring[_0x0a9e('0xa4')](_['merge'](_0x30a77e['get']({'plain':!![]}),{'customerIp':_0x43c1d1[_0x0a9e('0x78')][_0x0a9e('0x96')]||_0x43c1d1[_0x0a9e('0x78')][_0x0a9e('0xf9')]||_0x43c1d1[_0x0a9e('0xfa')][_0x0a9e('0xfb')]||_0x43c1d1['ip'],'referer':_0x43c1d1[_0x0a9e('0x78')][_0x0a9e('0x9b')],'openedInteractions':_0x10e370,'maxInteractions':_0x5092af,'virtual':_0x2e1de7[_0x0a9e('0xf4')],'online':_0x17187c,'custom':_0x2e1de7}))[_0x0a9e('0xfc')](/'/g,'\x5c\x27')};_0x546bc9[_0x0a9e('0x2c')](ejs[_0x0a9e('0xbf')](Mustache[_0x0a9e('0xbf')](_0x4be017,_0x462ecd),{'proactiveActions':_0xd63c87,'alignment':_0x30a77e['alignment'],'verticalAlignment':_0x30a77e['verticalAlignment'],'div_color':_0x30a77e[_0x0a9e('0xe4')],'labelText':_0x30a77e['labelText'],'text_color':_0x30a77e[_0x0a9e('0xfd')],'button_color':_0x30a77e[_0x0a9e('0xfe')],'background_color':_0x30a77e[_0x0a9e('0xff')],'hideWhenOffline':_0x30a77e['hideWhenOffline'],'interval':_0x30a77e['IntervalId']}));})[_0x0a9e('0x45')](handleError(_0x546bc9,null));};exports[_0x0a9e('0x100')]=function(_0x2c316b,_0x142c65){var _0x193e3b=_0x2c316b[_0x0a9e('0x47')]['id'];var _0x36e428=_0x2c316b['body'];var _0x12984a=0xc8;var _0x5799a6=null;return db[_0x0a9e('0x101')][_0x0a9e('0x102')]({'isolationLevel':db['sequelize'][_0x0a9e('0x103')][_0x0a9e('0x104')][_0x0a9e('0x105')]},function(_0x4524b8){return db[_0x0a9e('0x2f')][_0x0a9e('0x56')]({'where':{'id':_0x193e3b},'transaction':_0x4524b8})['then'](function(_0x475bcd){if(_0x475bcd){return db[_0x0a9e('0x106')][_0x0a9e('0x26')]({'where':{'ChatWebsiteId':_0x193e3b},'transaction':_0x4524b8})['then'](function(){var _0x857983=_[_0x0a9e('0x2e')](_0x36e428,function(_0x24dc3f){_0x24dc3f['ChatWebsiteId']=_0x193e3b;return _0x24dc3f;});return db[_0x0a9e('0x106')][_0x0a9e('0xc7')](_0x857983,{'transaction':_0x4524b8});});}else{_0x12984a=0x194;_0x5799a6=[];}});})[_0x0a9e('0x13')](function(){if(_0x12984a!==0x194){return db[_0x0a9e('0x106')][_0x0a9e('0x107')]({'where':{'ChatWebsiteId':_0x193e3b},'order':_0x0a9e('0x108')})['then'](function(_0x483aed){_0x5799a6=_0x483aed;});}})[_0x0a9e('0x45')](function(_0x1e01af){_0x12984a=0x1f4;logger['error'](_0x1e01af[_0x0a9e('0x2a')]);if(_0x1e01af[_0x0a9e('0x2b')]){delete _0x1e01af[_0x0a9e('0x2b')];}_0x5799a6=_0x1e01af;})[_0x0a9e('0x109')](function(){if(_0x5799a6===null){_0x142c65[_0x0a9e('0x1b')](_0x12984a);}else{if(_0x12984a===0x1f4){_0x142c65[_0x0a9e('0x1d')](_0x12984a)['send'](_0x5799a6);}else{_0x142c65[_0x0a9e('0x1d')](_0x12984a)[_0x0a9e('0x1e')](_0x5799a6);}}});};exports[_0x0a9e('0x10a')]=function(_0x4edb79,_0x45c6ce){var _0x4532de={};var _0x1747ab={};var _0x3afafa;var _0x5beea6;return db['ChatWebsite'][_0x0a9e('0x56')]({'where':{'id':_0x4edb79[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x45c6ce,null))['then'](function(_0x3d75c9){if(_0x3d75c9){_0x3afafa=_0x3d75c9;_0x1747ab[_0x0a9e('0x32')]=_[_0x0a9e('0x49')](db[_0x0a9e('0x106')][_0x0a9e('0x30')]);_0x1747ab[_0x0a9e('0x33')]=_[_0x0a9e('0x49')](_0x4edb79[_0x0a9e('0x33')]);_0x1747ab['filters']=_['intersection'](_0x1747ab[_0x0a9e('0x32')],_0x1747ab[_0x0a9e('0x33')]);_0x4532de['attributes']=_[_0x0a9e('0x35')](_0x1747ab['model'],qs[_0x0a9e('0x37')](_0x4edb79[_0x0a9e('0x33')]['fields']));_0x4532de[_0x0a9e('0x36')]=_0x4532de[_0x0a9e('0x36')]['length']?_0x4532de[_0x0a9e('0x36')]:_0x1747ab[_0x0a9e('0x32')];_0x4532de[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x4edb79[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x4532de[_0x0a9e('0x3c')]=qs['filters'](_[_0x0a9e('0x3d')](_0x4edb79[_0x0a9e('0x33')],_0x1747ab[_0x0a9e('0x34')]));if(_0x4edb79[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x4532de[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x4532de['where'],{'$or':_['map'](_0x4532de[_0x0a9e('0x36')],function(_0x14c3f1){var _0x1e6bba={};_0x1e6bba[_0x14c3f1]={'$like':'%'+_0x4edb79['query']['filter']+'%'};return _0x1e6bba;})});}_0x4532de=_[_0x0a9e('0x3f')]({},_0x4532de,_0x4edb79['options']);return _0x3afafa[_0x0a9e('0x10a')](_0x4532de);}})[_0x0a9e('0x13')](function(_0x112789){if(_0x112789){_0x5beea6=_0x112789[_0x0a9e('0x38')];if(!_0x4edb79[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0x4532de[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x4edb79['query']['limit']);_0x4532de[_0x0a9e('0x1f')]=qs['offset'](_0x4edb79[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}return _0x3afafa[_0x0a9e('0x10a')](_0x4532de);}})[_0x0a9e('0x13')](function(_0x4ad6fc){if(_0x4ad6fc){return _0x4ad6fc?{'count':_0x5beea6,'rows':_0x4ad6fc}:null;}})[_0x0a9e('0x13')](respondWithResult(_0x45c6ce,null))[_0x0a9e('0x45')](handleError(_0x45c6ce,null));};exports[_0x0a9e('0x10b')]=function(_0x5174c5,_0x1ebf20){return db[_0x0a9e('0x10c')][_0x0a9e('0x4a')]({'where':{'id':_0x5174c5['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x1ebf20,null))[_0x0a9e('0x13')](function(_0x459ab7){if(_0x459ab7){return _0x459ab7[_0x0a9e('0x10b')](_0x5174c5[_0x0a9e('0x50')][_0x0a9e('0x5e')],_['omit'](_0x5174c5['body'],[_0x0a9e('0x5e'),'id'])||{});}})[_0x0a9e('0x13')](respondWithResult(_0x1ebf20,null))[_0x0a9e('0x45')](handleError(_0x1ebf20,null));};exports['getProactiveActions']=function(_0x5990e1,_0x2a5c2a){var _0x304a57={};var _0x2302a2={};var _0x5f5963;var _0x4b51ff;return db[_0x0a9e('0x2f')][_0x0a9e('0x56')]({'where':{'id':_0x5990e1[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x2a5c2a,null))[_0x0a9e('0x13')](function(_0x4f0bca){if(_0x4f0bca){_0x5f5963=_0x4f0bca;_0x2302a2[_0x0a9e('0x32')]=_['keys'](db[_0x0a9e('0x10d')][_0x0a9e('0x30')]);_0x2302a2['query']=_[_0x0a9e('0x49')](_0x5990e1['query']);_0x2302a2[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x2302a2[_0x0a9e('0x32')],_0x2302a2[_0x0a9e('0x33')]);_0x304a57[_0x0a9e('0x36')]=_['intersection'](_0x2302a2[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x5990e1[_0x0a9e('0x33')]['fields']));_0x304a57[_0x0a9e('0x36')]=_0x304a57['attributes'][_0x0a9e('0x38')]?_0x304a57[_0x0a9e('0x36')]:_0x2302a2[_0x0a9e('0x32')];_0x304a57['order']=qs[_0x0a9e('0x3b')](_0x5990e1[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x304a57[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x5990e1['query'],_0x2302a2[_0x0a9e('0x34')]));if(_0x5990e1[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x304a57[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x304a57[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x2e')](_0x304a57[_0x0a9e('0x36')],function(_0x597e99){var _0x2dc0de={};_0x2dc0de[_0x597e99]={'$like':'%'+_0x5990e1[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x2dc0de;})});}_0x304a57=_[_0x0a9e('0x3f')]({},_0x304a57,_0x5990e1['options']);return _0x5f5963[_0x0a9e('0xf2')](_0x304a57);}})['then'](function(_0xf81cc){if(_0xf81cc){_0x4b51ff=_0xf81cc[_0x0a9e('0x38')];if(!_0x5990e1[_0x0a9e('0x33')]['hasOwnProperty'](_0x0a9e('0x39'))){_0x304a57[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x5990e1[_0x0a9e('0x33')]['limit']);_0x304a57[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x5990e1[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}return _0x5f5963[_0x0a9e('0xf2')](_0x304a57);}})[_0x0a9e('0x13')](function(_0xbdc88e){if(_0xbdc88e){return _0xbdc88e?{'count':_0x4b51ff,'rows':_0xbdc88e}:null;}})['then'](respondWithResult(_0x2a5c2a,null))[_0x0a9e('0x45')](handleError(_0x2a5c2a,null));};exports[_0x0a9e('0x10e')]=function(_0x337c29,_0xa42055){var _0x52cdf4=_0x337c29[_0x0a9e('0x33')]['online']===_0x0a9e('0x10f')?_0x0a9e('0x110'):_0x0a9e('0x111');return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'attributes':['id',_0x52cdf4],'where':{'id':_0x337c29[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0xa42055,null))['then'](function(_0x173f03){if(_0x173f03){var _0x4ac7f1=_0x173f03[_0x52cdf4];var _0x382412=_0x4ac7f1&&_0x4ac7f1[_0x0a9e('0x112')]?_0x4ac7f1['items']:[];_0xa42055[_0x0a9e('0x2c')]({'fromKey':_[_0x0a9e('0x6e')](_0x4ac7f1[_0x0a9e('0x113')])?undefined:_0x4ac7f1[_0x0a9e('0x113')],'count':_0x382412['length'],'rows':_0x382412});}})[_0x0a9e('0x45')](handleError(_0xa42055,null));};exports[_0x0a9e('0x114')]=function(_0x5a75d9,_0xcc859d){var _0x4a396c={'raw':![],'where':{}};var _0x58cb87={};var _0x50e7ec={'count':0x0,'rows':[]};return db[_0x0a9e('0x2f')][_0x0a9e('0x56')]({'where':{'id':_0x5a75d9['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0xcc859d,null))[_0x0a9e('0x13')](function(_0x5ef7e8){if(_0x5ef7e8){_0x58cb87[_0x0a9e('0x32')]=_[_0x0a9e('0x49')](db[_0x0a9e('0xc1')][_0x0a9e('0x30')]);_0x58cb87[_0x0a9e('0x33')]=_[_0x0a9e('0x49')](_0x5a75d9[_0x0a9e('0x33')]);_0x58cb87['filters']=_[_0x0a9e('0x35')](_0x58cb87['model'],_0x58cb87[_0x0a9e('0x33')]);_0x4a396c[_0x0a9e('0x36')]=_[_0x0a9e('0x35')](_0x58cb87[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x5a75d9[_0x0a9e('0x33')]['fields']));_0x4a396c[_0x0a9e('0x36')]=_0x4a396c[_0x0a9e('0x36')][_0x0a9e('0x38')]?_0x4a396c['attributes']:_0x58cb87[_0x0a9e('0x32')];if(!_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0x4a396c[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x21')]);_0x4a396c[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}_0x4a396c[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x4a396c['where']=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x5a75d9[_0x0a9e('0x33')],_0x58cb87['filters']));_0x4a396c[_0x0a9e('0x3c')][_0x0a9e('0x53')]=_0x5ef7e8['id'];if(_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x4a396c['where']=_[_0x0a9e('0x3f')](_0x4a396c[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x2e')](_0x4a396c[_0x0a9e('0x36')],function(_0x4e8eb9){var _0x2b263b={};_0x2b263b[_0x4e8eb9]={'$like':'%'+_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x2b263b;})});}_0x4a396c=_[_0x0a9e('0x3f')]({},_0x4a396c,_0x5a75d9['options']);return db['ChatOfflineMessage'][_0x0a9e('0x22')]({'where':_0x4a396c[_0x0a9e('0x3c')]})[_0x0a9e('0x13')](function(_0x353960){_0x50e7ec[_0x0a9e('0x22')]=_0x353960;if(_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x4a396c[_0x0a9e('0x43')]=[{'all':!![]}];}else{_0x4a396c[_0x0a9e('0x43')]=[{'model':db[_0x0a9e('0x7b')],'as':_0x0a9e('0xe0'),'required':![]},{'model':db[_0x0a9e('0xc6')],'as':_0x0a9e('0x115'),'required':![]}];}return db[_0x0a9e('0xc1')]['findAll'](_0x4a396c);})[_0x0a9e('0x13')](function(_0x5ce227){_0x50e7ec[_0x0a9e('0x58')]=_0x5ce227;return _0x50e7ec;});}})['then'](respondWithFilteredResult(_0xcc859d,_0x4a396c))['catch'](handleError(_0xcc859d,null));};exports[_0x0a9e('0x116')]=function(_0x51ec16,_0x3d2007){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x51ec16[_0x0a9e('0x47')]['id']}})['then'](handleEntityNotFound(_0x3d2007,null))['then'](function(_0x2ad86f){if(_0x2ad86f){return _0x2ad86f[_0x0a9e('0x116')](_0x51ec16[_0x0a9e('0x50')][_0x0a9e('0x5e')],_['omit'](_0x51ec16[_0x0a9e('0x50')],[_0x0a9e('0x5e'),'id'])||{})[_0x0a9e('0xbd')](function(_0x25f5fa){for(var _0x193ef7=0x0;_0x193ef7<_0x51ec16['body']['ids'][_0x0a9e('0x38')];_0x193ef7+=0x1){socket[_0x0a9e('0x117')](_0x0a9e('0x118'),{'UserId':Number(_0x51ec16[_0x0a9e('0x50')][_0x0a9e('0x5e')][_0x193ef7]),'ChatWebsiteId':Number(_0x51ec16[_0x0a9e('0x47')]['id'])});}return _0x25f5fa;});}})[_0x0a9e('0x13')](respondWithResult(_0x3d2007,null))['catch'](handleError(_0x3d2007,null));};exports[_0x0a9e('0x119')]=function(_0xd73712,_0x173daf){return db['ChatWebsite']['find']({'where':{'id':_0xd73712['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x173daf,null))[_0x0a9e('0x13')](function(_0x5448ee){if(_0x5448ee){return _0x5448ee[_0x0a9e('0x119')](_0xd73712[_0x0a9e('0x33')][_0x0a9e('0x5e')])['then'](function(){if(_['isArray'](_0xd73712[_0x0a9e('0x33')][_0x0a9e('0x5e')])){for(var _0xf10a48=0x0;_0xf10a48<_0xd73712[_0x0a9e('0x33')]['ids'][_0x0a9e('0x38')];_0xf10a48+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0xd73712[_0x0a9e('0x33')]['ids'][_0xf10a48]),'ChatWebsiteId':Number(_0xd73712[_0x0a9e('0x47')]['id'])});}}else{socket[_0x0a9e('0x117')](_0x0a9e('0x11a'),{'UserId':Number(_0xd73712['query'][_0x0a9e('0x5e')]),'ChatWebsiteId':Number(_0xd73712[_0x0a9e('0x47')]['id'])});}});}})[_0x0a9e('0x13')](respondWithStatusCode(_0x173daf,null))['catch'](handleError(_0x173daf,null));};exports['getAgents']=function(_0x3aa901,_0xb3e9cb){var _0x34b05f={};var _0x21fcaa={};var _0x1c3b0e;var _0x1966dd;return db['ChatWebsite']['findOne']({'where':{'id':_0x3aa901[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0xb3e9cb,null))['then'](function(_0x539f84){if(_0x539f84){_0x1c3b0e=_0x539f84;_0x21fcaa['model']=_['keys'](db['User']['rawAttributes']);_0x21fcaa[_0x0a9e('0x33')]=_['keys'](_0x3aa901[_0x0a9e('0x33')]);_0x21fcaa[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x21fcaa[_0x0a9e('0x32')],_0x21fcaa[_0x0a9e('0x33')]);_0x34b05f[_0x0a9e('0x36')]=_[_0x0a9e('0x35')](_0x21fcaa['model'],qs[_0x0a9e('0x37')](_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x37')]));_0x34b05f[_0x0a9e('0x36')]=_0x34b05f[_0x0a9e('0x36')][_0x0a9e('0x38')]?_0x34b05f[_0x0a9e('0x36')]:_0x21fcaa[_0x0a9e('0x32')];_0x34b05f[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x3aa901[_0x0a9e('0x33')]['sort']);_0x34b05f[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_['pick'](_0x3aa901[_0x0a9e('0x33')],_0x21fcaa['filters']));if(_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x34b05f['where']=_['merge'](_0x34b05f[_0x0a9e('0x3c')],{'$or':_['map'](_0x34b05f[_0x0a9e('0x36')],function(_0xa8c784){var _0x132f85={};_0x132f85[_0xa8c784]={'$like':'%'+_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x132f85;})});}_0x34b05f=_['merge']({},_0x34b05f,_0x3aa901[_0x0a9e('0x41')]);return _0x1c3b0e['getAgents'](_0x34b05f);}})['then'](function(_0x398a88){if(_0x398a88){_0x1966dd=_0x398a88[_0x0a9e('0x38')];if(!_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0x34b05f['limit']=qs[_0x0a9e('0x21')](_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x21')]);_0x34b05f[_0x0a9e('0x1f')]=qs['offset'](_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}return _0x1c3b0e['getAgents'](_0x34b05f);}})[_0x0a9e('0x13')](function(_0x36d8a1){if(_0x36d8a1){return _0x36d8a1?{'count':_0x1966dd,'rows':_0x36d8a1}:null;}})[_0x0a9e('0x13')](respondWithResult(_0xb3e9cb,null))[_0x0a9e('0x45')](handleError(_0xb3e9cb,null));};
\ No newline at end of file
+var _0xa9e0=['fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','bluebird','mustache','util','fs-extra','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','error','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','Pause','map','ChatWebsite','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','mandatoryDispositionPause','keys','find','create','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','sitepic','filename','addAvatar','agentAvatar','addCustomerAvatar','file','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','existsSync','server/files/images/logos/','download','isNil','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','customerAvatar','getSystemAvatar','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','Applications','List','account','applications','list','asc','from','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','push','*,*,*,*','AttachmentId','UserId','User','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','spread','readFileSync','render','offlineMessageBody','ChatOfflineMessage','fromString','attachments','offline-chat','basename','Attachment','bulkCreate','MailAccount','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','MailAccountId','mimetype','mapValues','subjectOffline','Chat','server','files','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','internal','Tag','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','increment','all','some','x-real-ip','connection','remoteAddress','replace','textColor','color_button','backgroundColor','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items'];(function(_0x207b7f,_0x1d1323){var _0x2d6d8e=function(_0x40156f){while(--_0x40156f){_0x207b7f['push'](_0x207b7f['shift']());}};_0x2d6d8e(++_0x1d1323);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var BPromise=require(_0x0a9e('0x0'));var Mustache=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x3'));var _=require('lodash');var querystring=require(_0x0a9e('0x4'));var Redis=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var db=require(_0x0a9e('0x9'))['db'];config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x0a9e('0xd')](socket);var htmlToText=require(_0x0a9e('0xe'));var jayson=require(_0x0a9e('0xf'));var client=jayson[_0x0a9e('0x10')][_0x0a9e('0x11')]({'port':0x232c});var client9002=jayson[_0x0a9e('0x10')]['http']({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson['client'][_0x0a9e('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x36471c,_0xd5b662,_0x26d672,_0x32d742){return new BPromise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_0x32d742||client;return _0x4283ce[_0x0a9e('0x12')](_0x36471c,_0x26d672)[_0x0a9e('0x13')](function(_0x281129){logger[_0x0a9e('0x14')](_0x0a9e('0x15'),_0xd5b662,'request\x20sent');logger[_0x0a9e('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0xd5b662,_0x0a9e('0x17'),JSON['stringify'](_0x281129));if(_0x281129[_0x0a9e('0x18')]){if(_0x281129[_0x0a9e('0x18')]['code']===0x1f4){logger[_0x0a9e('0x18')]('ChatWebsite,\x20%s,\x20%s',_0xd5b662,_0x281129[_0x0a9e('0x18')][_0x0a9e('0x19')]);return _0x5db4b0(_0x281129[_0x0a9e('0x18')][_0x0a9e('0x19')]);}logger[_0x0a9e('0x18')](_0x0a9e('0x15'),_0xd5b662,_0x281129[_0x0a9e('0x18')][_0x0a9e('0x19')]);return _0x69aeb7(_0x281129[_0x0a9e('0x18')][_0x0a9e('0x19')]);}else{logger[_0x0a9e('0x14')](_0x0a9e('0x15'),_0xd5b662,'request\x20sent');_0x69aeb7(_0x281129[_0x0a9e('0x1a')][_0x0a9e('0x19')]);}})['catch'](function(_0x20f109){logger['error']('ChatWebsite,\x20%s,\x20%s',_0xd5b662,_0x20f109);_0x5db4b0(_0x20f109);});});}function respondWithStatusCode(_0x3a02e1,_0x432e56){_0x432e56=_0x432e56||0xcc;return function(_0x38e7c4){if(_0x38e7c4){return _0x3a02e1[_0x0a9e('0x1b')](_0x432e56);}return _0x3a02e1['status'](_0x432e56)[_0x0a9e('0x1c')]();};}function respondWithResult(_0x2fb0e4,_0x3b45bc){_0x3b45bc=_0x3b45bc||0xc8;return function(_0x4d00e6){if(_0x4d00e6){return _0x2fb0e4[_0x0a9e('0x1d')](_0x3b45bc)[_0x0a9e('0x1e')](_0x4d00e6);}};}function respondWithFilteredResult(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(_0x59181e){var _0x197ec0=typeof _0x5ea472[_0x0a9e('0x1f')]===_0x0a9e('0x20')&&typeof _0x5ea472[_0x0a9e('0x21')]==='undefined';var _0x384319=_0x59181e['count'];var _0x45a1e7=_0x197ec0?0x0:_0x5ea472['offset'];var _0x1dc186=_0x197ec0?_0x59181e[_0x0a9e('0x22')]:_0x5ea472[_0x0a9e('0x1f')]+_0x5ea472[_0x0a9e('0x21')];var _0x140511;if(_0x1dc186>=_0x384319){_0x1dc186=_0x384319;_0x140511=0xc8;}else{_0x140511=0xce;}_0x16b1ca[_0x0a9e('0x1d')](_0x140511);return _0x16b1ca[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x45a1e7+'-'+_0x1dc186+'/'+_0x384319)['json'](_0x59181e);}return null;};}function saveUpdates(_0x3652a7){return function(_0x468813){if(_0x468813){return _0x468813[_0x0a9e('0x25')](_0x3652a7)[_0x0a9e('0x13')](function(_0x5c877d){return _0x5c877d;});}return null;};}function removeEntity(_0x15b200){return function(_0x40e7a3){if(_0x40e7a3){return _0x40e7a3[_0x0a9e('0x26')]()[_0x0a9e('0x13')](function(){var _0x58b06f=_0x40e7a3[_0x0a9e('0x27')]({'plain':!![]});var _0x296f41=_0x0a9e('0x28');return db[_0x0a9e('0x29')]['destroy']({'where':{'type':_0x296f41,'resourceId':_0x58b06f['id']}})[_0x0a9e('0x13')](function(){return _0x40e7a3;});})['then'](function(){_0x15b200[_0x0a9e('0x1d')](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x1122db){return function(_0x33bdb7){if(!_0x33bdb7){_0x1122db[_0x0a9e('0x1b')](0x194);}return _0x33bdb7;};}function handleError(_0x5180f1,_0x66c1d2){_0x66c1d2=_0x66c1d2||0x1f4;return function(_0x46f0a5){logger[_0x0a9e('0x18')](_0x46f0a5[_0x0a9e('0x2a')]);if(_0x46f0a5[_0x0a9e('0x2b')]){delete _0x46f0a5[_0x0a9e('0x2b')];}_0x5180f1[_0x0a9e('0x1d')](_0x66c1d2)[_0x0a9e('0x2c')](_0x46f0a5);};}exports['index']=function(_0x44295a,_0x5e7238){var _0x2cc7a0={'include':[{'model':db[_0x0a9e('0x2d')],'as':'mandatoryDispositionPause'}]},_0x14b13f={},_0x2b7e7f={'count':0x0,'rows':[]};var _0x191e91=_[_0x0a9e('0x2e')](db[_0x0a9e('0x2f')][_0x0a9e('0x30')],function(_0x4853b1){return{'name':_0x4853b1['fieldName'],'type':_0x4853b1[_0x0a9e('0x31')]['key']};});_0x14b13f[_0x0a9e('0x32')]=_[_0x0a9e('0x2e')](_0x191e91,_0x0a9e('0x2b'));_0x14b13f[_0x0a9e('0x33')]=_['keys'](_0x44295a[_0x0a9e('0x33')]);_0x14b13f[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x14b13f['model'],_0x14b13f[_0x0a9e('0x33')]);_0x2cc7a0[_0x0a9e('0x36')]=_[_0x0a9e('0x35')](_0x14b13f['model'],qs['fields'](_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x37')]));_0x2cc7a0['attributes']=_0x2cc7a0[_0x0a9e('0x36')][_0x0a9e('0x38')]?_0x2cc7a0[_0x0a9e('0x36')]:_0x14b13f[_0x0a9e('0x32')];if(!_0x44295a['query']['hasOwnProperty'](_0x0a9e('0x39'))){_0x2cc7a0[_0x0a9e('0x21')]=qs['limit'](_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x21')]);_0x2cc7a0[_0x0a9e('0x1f')]=qs['offset'](_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}_0x2cc7a0[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x2cc7a0[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x44295a[_0x0a9e('0x33')],_0x14b13f[_0x0a9e('0x34')]),_0x191e91);if(_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x2cc7a0[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x2cc7a0['where'],{'$or':_['map'](_0x191e91,function(_0x473fdc){if(_0x473fdc[_0x0a9e('0x31')]!==_0x0a9e('0x40')){var _0x315881={};_0x315881[_0x473fdc[_0x0a9e('0x2b')]]={'$like':'%'+_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x315881;}})});}_0x2cc7a0=_[_0x0a9e('0x3f')]({},_0x2cc7a0,_0x44295a[_0x0a9e('0x41')]);var _0x25c6e6={'where':_0x2cc7a0[_0x0a9e('0x3c')]};return db[_0x0a9e('0x2f')]['count'](_0x25c6e6)[_0x0a9e('0x13')](function(_0x138b8b){_0x2b7e7f[_0x0a9e('0x22')]=_0x138b8b;if(_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x2cc7a0[_0x0a9e('0x43')]=[{'all':!![]}];}return db[_0x0a9e('0x2f')][_0x0a9e('0x44')](_0x2cc7a0);})['then'](function(_0x2e9d90){_0x2b7e7f['rows']=_0x2e9d90;return _0x2b7e7f;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x5e7238,_0x2cc7a0))[_0x0a9e('0x45')](handleError(_0x5e7238,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){var _0x7f6eb1={'raw':![],'where':{'id':_0x562fb4[_0x0a9e('0x47')]['id']},'include':[{'model':db[_0x0a9e('0x2d')],'as':_0x0a9e('0x48')}]},_0x4774f4={};_0x4774f4[_0x0a9e('0x32')]=_['keys'](db[_0x0a9e('0x2f')][_0x0a9e('0x30')]);_0x4774f4[_0x0a9e('0x33')]=_[_0x0a9e('0x49')](_0x562fb4[_0x0a9e('0x33')]);_0x4774f4[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x4774f4[_0x0a9e('0x32')],_0x4774f4[_0x0a9e('0x33')]);_0x7f6eb1['attributes']=_[_0x0a9e('0x35')](_0x4774f4[_0x0a9e('0x32')],qs['fields'](_0x562fb4['query']['fields']));_0x7f6eb1[_0x0a9e('0x36')]=_0x7f6eb1[_0x0a9e('0x36')][_0x0a9e('0x38')]?_0x7f6eb1[_0x0a9e('0x36')]:_0x4774f4[_0x0a9e('0x32')];if(_0x562fb4[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x7f6eb1[_0x0a9e('0x43')]=[{'all':!![]}];}_0x7f6eb1=_['merge']({},_0x7f6eb1,_0x562fb4['options']);return db['ChatWebsite'][_0x0a9e('0x4a')](_0x7f6eb1)[_0x0a9e('0x13')](handleEntityNotFound(_0x14bec2,null))[_0x0a9e('0x13')](respondWithResult(_0x14bec2,null))['catch'](handleError(_0x14bec2,null));};exports[_0x0a9e('0x4b')]=function(_0x161aa7,_0x53d113){return db['ChatWebsite'][_0x0a9e('0x4b')](_0x161aa7['body'],{})[_0x0a9e('0x13')](function(_0x4c3845){var _0x2e5e62=_0x161aa7[_0x0a9e('0x4c')][_0x0a9e('0x27')]({'plain':!![]});if(!_0x2e5e62)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e5e62[_0x0a9e('0x4d')]===_0x0a9e('0x4c')){var _0x508b47=_0x4c3845['get']({'plain':!![]});var _0x128aa6=_0x0a9e('0x28');return db['UserProfileSection'][_0x0a9e('0x4a')]({'where':{'name':_0x128aa6,'userProfileId':_0x2e5e62['userProfileId']},'raw':!![]})[_0x0a9e('0x13')](function(_0x523cd2){if(_0x523cd2&&_0x523cd2[_0x0a9e('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x508b47['name'],'resourceId':_0x508b47['id'],'type':_0x523cd2[_0x0a9e('0x2b')],'sectionId':_0x523cd2['id']},{})['then'](function(){return _0x4c3845;});}else{return _0x4c3845;}})[_0x0a9e('0x45')](function(_0x65432){logger[_0x0a9e('0x18')](_0x0a9e('0x4f'),_0x65432);throw _0x65432;});}return _0x4c3845;})[_0x0a9e('0x13')](respondWithResult(_0x53d113,0xc9))[_0x0a9e('0x45')](handleError(_0x53d113,null));};exports[_0x0a9e('0x25')]=function(_0x28d814,_0x4e67ab){if(_0x28d814[_0x0a9e('0x50')]['id']){delete _0x28d814[_0x0a9e('0x50')]['id'];}return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x28d814[_0x0a9e('0x47')]['id']},'include':[{'model':db[_0x0a9e('0x2d')],'as':'mandatoryDispositionPause'}]})[_0x0a9e('0x13')](handleEntityNotFound(_0x4e67ab,null))[_0x0a9e('0x13')](saveUpdates(_0x28d814['body'],null))[_0x0a9e('0x13')](respondWithResult(_0x4e67ab,null))['catch'](handleError(_0x4e67ab,null));};exports[_0x0a9e('0x26')]=function(_0x5ba1f9,_0x4b3c1a){return db['ChatWebsite'][_0x0a9e('0x4a')]({'where':{'id':_0x5ba1f9['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x4b3c1a,null))[_0x0a9e('0x13')](removeEntity(_0x4b3c1a,null))[_0x0a9e('0x45')](handleError(_0x4b3c1a,null));};exports[_0x0a9e('0x51')]=function(_0x1cca9f,_0x26d7db){return db['ChatWebsite'][_0x0a9e('0x51')]()['then'](respondWithResult(_0x26d7db,null))[_0x0a9e('0x45')](handleError(_0x26d7db,null));};exports[_0x0a9e('0x52')]=function(_0x51aaf7,_0x5adf8f){if(_0x51aaf7[_0x0a9e('0x50')]['id']){delete _0x51aaf7[_0x0a9e('0x50')]['id'];}return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x51aaf7['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x5adf8f,null))[_0x0a9e('0x13')](function(_0x54327c){if(_0x54327c){_0x51aaf7[_0x0a9e('0x50')][_0x0a9e('0x53')]=_0x54327c['id'];return db[_0x0a9e('0x54')][_0x0a9e('0x4b')](_0x51aaf7[_0x0a9e('0x50')]);}})['then'](respondWithResult(_0x5adf8f,null))[_0x0a9e('0x45')](handleError(_0x5adf8f,null));};exports[_0x0a9e('0x55')]=function(_0x281c7d,_0x47bb43){var _0x3528b7={'raw':![],'where':{}};var _0x4f1e60={};var _0x5211e3={'count':0x0,'rows':[]};return db[_0x0a9e('0x2f')][_0x0a9e('0x56')]({'where':{'id':_0x281c7d[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x47bb43,null))[_0x0a9e('0x13')](function(_0xc8c264){if(_0xc8c264){_0x4f1e60[_0x0a9e('0x32')]=_[_0x0a9e('0x49')](db[_0x0a9e('0x54')][_0x0a9e('0x30')]);_0x4f1e60[_0x0a9e('0x33')]=_[_0x0a9e('0x49')](_0x281c7d[_0x0a9e('0x33')]);_0x4f1e60[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x4f1e60[_0x0a9e('0x32')],_0x4f1e60[_0x0a9e('0x33')]);_0x3528b7[_0x0a9e('0x36')]=_['intersection'](_0x4f1e60[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x281c7d[_0x0a9e('0x33')]['fields']));_0x3528b7[_0x0a9e('0x36')]=_0x3528b7[_0x0a9e('0x36')]['length']?_0x3528b7[_0x0a9e('0x36')]:_0x4f1e60[_0x0a9e('0x32')];if(!_0x281c7d[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0x3528b7['limit']=qs['limit'](_0x281c7d['query'][_0x0a9e('0x21')]);_0x3528b7[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x281c7d[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}_0x3528b7[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x281c7d[_0x0a9e('0x33')]['sort']);_0x3528b7[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x281c7d['query'],_0x4f1e60[_0x0a9e('0x34')]));_0x3528b7['where'][_0x0a9e('0x53')]=_0xc8c264['id'];if(_0x281c7d[_0x0a9e('0x33')]['filter']){_0x3528b7[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x3528b7[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x2e')](_0x3528b7['attributes'],function(_0x1d442c){var _0x2e9552={};_0x2e9552[_0x1d442c]={'$like':'%'+_0x281c7d[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x2e9552;})});}_0x3528b7=_['merge']({},_0x3528b7,_0x281c7d[_0x0a9e('0x41')]);return db[_0x0a9e('0x54')][_0x0a9e('0x22')]({'where':_0x3528b7[_0x0a9e('0x3c')]})['then'](function(_0x290d43){_0x5211e3[_0x0a9e('0x22')]=_0x290d43;if(_0x281c7d[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x3528b7[_0x0a9e('0x43')]=[{'all':!![]}];}return db[_0x0a9e('0x54')][_0x0a9e('0x44')](_0x3528b7);})[_0x0a9e('0x13')](function(_0x1a7b03){_0x5211e3[_0x0a9e('0x58')]=_0x1a7b03;return _0x5211e3;});}})[_0x0a9e('0x13')](respondWithFilteredResult(_0x47bb43,_0x3528b7))[_0x0a9e('0x45')](handleError(_0x47bb43,null));};exports[_0x0a9e('0x59')]=function(_0xe0749e,_0x5b35db){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0xe0749e[_0x0a9e('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b35db,null))[_0x0a9e('0x13')](function(_0x33dda0){if(_0x33dda0){return _0x33dda0[_0x0a9e('0x59')](_0xe0749e[_0x0a9e('0x33')]['ids']);}})['then'](respondWithStatusCode(_0x5b35db,null))[_0x0a9e('0x45')](handleError(_0x5b35db,null));};exports[_0x0a9e('0x5a')]=function(_0x4c54fa,_0x45108c){if(_0x4c54fa['body']['id']){delete _0x4c54fa[_0x0a9e('0x50')]['id'];}return db[_0x0a9e('0x2f')]['find']({'where':{'id':_0x4c54fa[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x45108c,null))[_0x0a9e('0x13')](function(_0x42b959){if(_0x42b959){_0x4c54fa[_0x0a9e('0x50')][_0x0a9e('0x53')]=_0x42b959['id'];return db[_0x0a9e('0x5b')]['create'](_0x4c54fa[_0x0a9e('0x50')]);}})[_0x0a9e('0x13')](respondWithResult(_0x45108c,null))[_0x0a9e('0x45')](handleError(_0x45108c,null));};exports[_0x0a9e('0x5c')]=function(_0x492543,_0xf51744){var _0xf0db1={'raw':![],'where':{}};var _0x4bf3a5={};var _0x1d6834={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0a9e('0x56')]({'where':{'id':_0x492543[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0xf51744,null))[_0x0a9e('0x13')](function(_0x5af453){if(_0x5af453){_0x4bf3a5['model']=_[_0x0a9e('0x49')](db[_0x0a9e('0x5b')][_0x0a9e('0x30')]);_0x4bf3a5['query']=_[_0x0a9e('0x49')](_0x492543[_0x0a9e('0x33')]);_0x4bf3a5['filters']=_['intersection'](_0x4bf3a5[_0x0a9e('0x32')],_0x4bf3a5['query']);_0xf0db1['attributes']=_['intersection'](_0x4bf3a5[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x492543[_0x0a9e('0x33')][_0x0a9e('0x37')]));_0xf0db1[_0x0a9e('0x36')]=_0xf0db1[_0x0a9e('0x36')]['length']?_0xf0db1[_0x0a9e('0x36')]:_0x4bf3a5['model'];if(!_0x492543[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0xf0db1[_0x0a9e('0x21')]=qs['limit'](_0x492543[_0x0a9e('0x33')][_0x0a9e('0x21')]);_0xf0db1[_0x0a9e('0x1f')]=qs['offset'](_0x492543[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}_0xf0db1[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x492543[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0xf0db1[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_['pick'](_0x492543[_0x0a9e('0x33')],_0x4bf3a5[_0x0a9e('0x34')]));_0xf0db1['where'][_0x0a9e('0x53')]=_0x5af453['id'];if(_0x492543[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0xf0db1['where']=_[_0x0a9e('0x3f')](_0xf0db1['where'],{'$or':_[_0x0a9e('0x2e')](_0xf0db1[_0x0a9e('0x36')],function(_0x558a87){var _0x1f29bd={};_0x1f29bd[_0x558a87]={'$like':'%'+_0x492543[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x1f29bd;})});}_0xf0db1=_[_0x0a9e('0x3f')]({},_0xf0db1,_0x492543[_0x0a9e('0x41')]);return db['CannedAnswer'][_0x0a9e('0x22')]({'where':_0xf0db1[_0x0a9e('0x3c')]})[_0x0a9e('0x13')](function(_0x30ef6e){_0x1d6834[_0x0a9e('0x22')]=_0x30ef6e;if(_0x492543[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0xf0db1[_0x0a9e('0x43')]=[{'all':!![]}];}return db[_0x0a9e('0x5b')][_0x0a9e('0x44')](_0xf0db1);})[_0x0a9e('0x13')](function(_0x3754e2){_0x1d6834[_0x0a9e('0x58')]=_0x3754e2;return _0x1d6834;});}})['then'](respondWithFilteredResult(_0xf51744,_0xf0db1))[_0x0a9e('0x45')](handleError(_0xf51744,null));};exports[_0x0a9e('0x5d')]=function(_0x12843d,_0x2ed526){return db[_0x0a9e('0x2f')]['find']({'where':{'id':_0x12843d[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x2ed526,null))['then'](function(_0x23b447){if(_0x23b447){return _0x23b447['removeAnswers'](_0x12843d[_0x0a9e('0x33')][_0x0a9e('0x5e')]);}})[_0x0a9e('0x13')](respondWithStatusCode(_0x2ed526,null))[_0x0a9e('0x45')](handleError(_0x2ed526,null));};exports['addLogo']=function(_0x3ceba6,_0x4cf72d){_0x3ceba6[_0x0a9e('0x50')][_0x0a9e('0x5f')]=_0x3ceba6['file'][_0x0a9e('0x60')];return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x3ceba6['params']['id']}})['then'](handleEntityNotFound(_0x4cf72d,null))[_0x0a9e('0x13')](saveUpdates(_0x3ceba6[_0x0a9e('0x50')],null))[_0x0a9e('0x13')](respondWithResult(_0x4cf72d,null))[_0x0a9e('0x45')](handleError(_0x4cf72d,null));};exports[_0x0a9e('0x61')]=function(_0x2450a8,_0x17793e){_0x2450a8[_0x0a9e('0x50')][_0x0a9e('0x62')]=_0x2450a8['file'][_0x0a9e('0x60')];return db['ChatWebsite'][_0x0a9e('0x4a')]({'where':{'id':_0x2450a8[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x17793e,null))[_0x0a9e('0x13')](saveUpdates(_0x2450a8[_0x0a9e('0x50')],null))['then'](respondWithResult(_0x17793e,null))[_0x0a9e('0x45')](handleError(_0x17793e,null));};exports[_0x0a9e('0x63')]=function(_0x2791c5,_0x2aa5f2){_0x2791c5[_0x0a9e('0x50')]['customerAvatar']=_0x2791c5['file'][_0x0a9e('0x60')];return db['ChatWebsite'][_0x0a9e('0x4a')]({'where':{'id':_0x2791c5[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x13')](saveUpdates(_0x2791c5[_0x0a9e('0x50')],null))[_0x0a9e('0x13')](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports['addSystemAvatar']=function(_0x1889ed,_0x5dfbe2){_0x1889ed[_0x0a9e('0x50')]['systemAvatar']=_0x1889ed[_0x0a9e('0x64')]['filename'];return db['ChatWebsite'][_0x0a9e('0x4a')]({'where':{'id':_0x1889ed[_0x0a9e('0x47')]['id']}})['then'](handleEntityNotFound(_0x5dfbe2,null))[_0x0a9e('0x13')](saveUpdates(_0x1889ed[_0x0a9e('0x50')],null))[_0x0a9e('0x13')](respondWithResult(_0x5dfbe2,null))[_0x0a9e('0x45')](handleError(_0x5dfbe2,null));};exports[_0x0a9e('0x65')]=function(_0x5ab0bc,_0x5505f4){var _0x16449b=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x68'));var _0x59303b={'where':{'id':_0x5ab0bc['params']['id']},'attributes':['id',_0x0a9e('0x5f')],'raw':!![]};var _0xadce3d=![];return require('../../config/license/util')[_0x0a9e('0x69')]()[_0x0a9e('0x13')](function(_0xcacabb){if(_0xcacabb){_0xadce3d=_0xcacabb[_0x0a9e('0x6a')];}})[_0x0a9e('0x13')](function(){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')](_0x59303b);})[_0x0a9e('0x13')](handleEntityNotFound(_0x5505f4,null))[_0x0a9e('0x13')](function(_0x16afb3){if(_0x16afb3){if(!_['isNil'](_0x16afb3[_0x0a9e('0x5f')])){if(fs[_0x0a9e('0x6b')](path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6c'),_0x16afb3['sitepic']))&&_0xadce3d){_0x16449b=path['join'](config[_0x0a9e('0x67')],_0x0a9e('0x6c'),_0x16afb3[_0x0a9e('0x5f')]);}}return _0x5505f4[_0x0a9e('0x6d')](_0x16449b);}})[_0x0a9e('0x45')](handleError(_0x5505f4,null));};exports['getAvatar']=function(_0x1339d0,_0x3c775a){var _0x3450ae=path['join'](config[_0x0a9e('0x67')],'server/files/images/avatars/default_avatar.png');var _0x2144ca={'where':{'id':_0x1339d0['params']['id']},'attributes':['id',_0x0a9e('0x62')],'raw':!![]};return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')](_0x2144ca)['then'](handleEntityNotFound(_0x3c775a,null))[_0x0a9e('0x13')](function(_0x5ed560){if(_0x5ed560){if(!_[_0x0a9e('0x6e')](_0x5ed560[_0x0a9e('0x62')])){if(fs[_0x0a9e('0x6b')](path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x5ed560[_0x0a9e('0x62')]))){_0x3450ae=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x5ed560[_0x0a9e('0x62')]);}}return _0x3c775a[_0x0a9e('0x6d')](_0x3450ae);}})[_0x0a9e('0x45')](handleError(_0x3c775a,null));};exports[_0x0a9e('0x70')]=function(_0x98c62c,_0x248368){var _0x5b93dd=path['join'](config[_0x0a9e('0x67')],'server/files/images/avatars/customer_avatar.png');var _0x1d999b={'where':{'id':_0x98c62c[_0x0a9e('0x47')]['id']},'attributes':['id','customerAvatar',_0x0a9e('0x71')],'raw':!![]};return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')](_0x1d999b)[_0x0a9e('0x13')](handleEntityNotFound(_0x248368,null))['then'](function(_0x148fd9){if(_0x148fd9){if(!_[_0x0a9e('0x6e')](_0x148fd9[_0x0a9e('0x72')])){if(fs[_0x0a9e('0x6b')](path['join'](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x148fd9[_0x0a9e('0x72')]))&&_0x148fd9['showCustomerAvatar']){_0x5b93dd=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x148fd9['customerAvatar']);}}return _0x248368[_0x0a9e('0x6d')](_0x5b93dd);}})[_0x0a9e('0x45')](handleError(_0x248368,null));};exports[_0x0a9e('0x73')]=function(_0x1a7f58,_0x2394d3){var _0x555780=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],'server/files/images/avatars/system_avatar.png');var _0x3bab3e={'where':{'id':_0x1a7f58[_0x0a9e('0x47')]['id']},'attributes':['id',_0x0a9e('0x74')],'raw':!![]};return db['ChatWebsite']['find'](_0x3bab3e)['then'](handleEntityNotFound(_0x2394d3,null))[_0x0a9e('0x13')](function(_0x4a70ce){if(_0x4a70ce){if(!_['isNil'](_0x4a70ce[_0x0a9e('0x74')])){if(fs[_0x0a9e('0x6b')](path[_0x0a9e('0x66')](config['root'],_0x0a9e('0x6f'),_0x4a70ce[_0x0a9e('0x74')]))){_0x555780=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x4a70ce[_0x0a9e('0x74')]);}}return _0x2394d3[_0x0a9e('0x6d')](_0x555780);}})[_0x0a9e('0x45')](handleError(_0x2394d3,null));};exports[_0x0a9e('0x75')]=function(_0x5a1848,_0x43c397){var _0x5526a7=require(_0x0a9e('0x76'));var _0x4093e6=new _0x5526a7();var _0x2097d8=_0x4093e6[_0x0a9e('0x77')](_0x5a1848[_0x0a9e('0x78')][_0x0a9e('0x79')])['getResult']();var _0x1a0314={'body':_0x5a1848[_0x0a9e('0x50')],'channel':_0x0a9e('0x7a')};var _0x1af799=[];var _0x51aa2f=[];var _0x2e4887={};var _0x3c9135=![];return db[_0x0a9e('0x7b')][_0x0a9e('0x51')]()[_0x0a9e('0x13')](function(_0x2be526){if(!_0x2be526){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0x7e'));}_0x1af799=_[_0x0a9e('0x7f')](_['keys'](_0x2be526),[_0x0a9e('0x80'),_0x0a9e('0x81')]);_0x51aa2f=_[_0x0a9e('0x7f')](_[_0x0a9e('0x49')](_0x2be526),[_0x0a9e('0x80'),_0x0a9e('0x81'),_0x0a9e('0x82'),_0x0a9e('0x83')]);if(_0x5a1848['body']['id']){delete _0x5a1848[_0x0a9e('0x50')]['id'];}if(_[_0x0a9e('0x6e')](_0x5a1848[_0x0a9e('0x50')]['from'])){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0x84'));}if(_[_0x0a9e('0x6e')](_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x50')])||_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x50')]===''){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0a9e('0x6e')](_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x85')])){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0x86')+_0x51aa2f);}if(!_['includes'](_0x51aa2f,_0x5a1848[_0x0a9e('0x50')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x0a9e('0x87')+_0x51aa2f);}_0x2e4887[_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x85')]]=_0x5a1848[_0x0a9e('0x50')]['from'];})[_0x0a9e('0x13')](function(){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x5a1848[_0x0a9e('0x47')]['id']},'include':[{'model':db[_0x0a9e('0x88')],'as':'List','include':[{'model':db['CmContact'],'as':_0x0a9e('0x89'),'where':_0x2e4887,'limit':0x1,'order':[[_0x0a9e('0x81'),_0x0a9e('0x8a')]]}]},{'model':db['ChatApplication'],'as':_0x0a9e('0x8b')}]});})[_0x0a9e('0x13')](handleEntityNotFound(_0x43c397,null))[_0x0a9e('0x13')](function(_0x4cee8c){if(_0x4cee8c&&_0x4cee8c[_0x0a9e('0x8c')]){_0x1a0314[_0x0a9e('0x8d')]=_0x4cee8c;_0x1a0314[_0x0a9e('0x8e')]=_0x4cee8c['Applications'];_0x1a0314[_0x0a9e('0x8f')]=_0x4cee8c[_0x0a9e('0x8c')];_0x1a0314[_0x0a9e('0x8e')]=_['orderBy'](_0x1a0314['applications'],['priority'],[_0x0a9e('0x90')]);if(_0x1a0314[_0x0a9e('0x8d')][_0x0a9e('0x8b')]){delete _0x1a0314[_0x0a9e('0x8d')]['Applications'];}if(_0x1a0314[_0x0a9e('0x8d')]['List']&&_0x1a0314[_0x0a9e('0x8d')][_0x0a9e('0x8c')][_0x0a9e('0x89')]['length']){return _0x1a0314[_0x0a9e('0x8d')][_0x0a9e('0x8c')][_0x0a9e('0x89')][0x0];}var _0x580dd6=_[_0x0a9e('0xb')](_0x5a1848['body'],{'firstName':_0x5a1848[_0x0a9e('0x50')]['from'],'ListId':_0x4cee8c[_0x0a9e('0x83')]});_0x580dd6[_0x5a1848['body'][_0x0a9e('0x85')]]=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x91')];return db[_0x0a9e('0x7b')][_0x0a9e('0x4b')](_0x580dd6,{'fields':_0x1af799,'raw':!![]});}})[_0x0a9e('0x13')](handleEntityNotFound(_0x43c397,null))[_0x0a9e('0x13')](function(_0x5acdc9){_0x1a0314[_0x0a9e('0x92')]=_0x5acdc9;var _0x1c9ea2=_0x5a1848['body'][_0x0a9e('0x93')];if(_0x5a1848[_0x0a9e('0x78')]['cf-connecting-ip']){_0x1c9ea2=_0x5a1848[_0x0a9e('0x78')][_0x0a9e('0x94')];}else if(_0x5a1848[_0x0a9e('0x78')]['x-forwarded-for']){_0x1c9ea2=_[_0x0a9e('0x95')](_0x5a1848[_0x0a9e('0x78')][_0x0a9e('0x96')][_0x0a9e('0x97')](','));}if(_0x5acdc9){var _0x2003bc={'ContactId':_0x5acdc9['id'],'ChatWebsiteId':_0x5a1848[_0x0a9e('0x47')]['id'],'from':(_0x5acdc9[_0x0a9e('0x98')]||'')+'\x20'+(_0x5acdc9[_0x0a9e('0x99')]||''),'customerIp':_0x1c9ea2,'customerPort':_0x5a1848[_0x0a9e('0x78')][_0x0a9e('0x9a')]?_0x5a1848['headers'][_0x0a9e('0x9a')]:null,'referer':_0x5a1848['body'][_0x0a9e('0x9b')],'browserName':_0x2097d8[_0x0a9e('0x9c')][_0x0a9e('0x2b')]&&_0x2097d8[_0x0a9e('0x9c')][_0x0a9e('0x9d')]?util[_0x0a9e('0x9e')]('%s\x20%s',_0x2097d8[_0x0a9e('0x9c')][_0x0a9e('0x2b')],_0x2097d8[_0x0a9e('0x9c')]['version']):_0x0a9e('0x9f'),'browserVersion':_0x2097d8[_0x0a9e('0x9c')][_0x0a9e('0x9d')]||_0x0a9e('0x9f'),'osName':util[_0x0a9e('0x9e')](_0x0a9e('0xa0'),_0x2097d8['os'][_0x0a9e('0x2b')],_0x2097d8['os']['version']),'osVersion':_0x2097d8['os'][_0x0a9e('0x9d')],'deviceModel':_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0x32')]&&_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0xa2')]?util[_0x0a9e('0x9e')](_0x0a9e('0xa3'),_0x2097d8['device']['model'],_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0xa2')],_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0x31')]):null,'deviceVendor':_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0xa2')],'deviceType':_0x2097d8[_0x0a9e('0xa1')]['type'],'formData':JSON[_0x0a9e('0xa4')](_0x5a1848[_0x0a9e('0x50')])};var _0x2d8e91={'ChatWebsiteId':_0x5a1848[_0x0a9e('0x47')]['id'],'closed':![]};if(_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa5')]){_0x2d8e91[_0x0a9e('0xa5')]=_0x5a1848['body'][_0x0a9e('0xa5')];return db[_0x0a9e('0xa6')][_0x0a9e('0x4a')]({'where':_0x2d8e91})['then'](function(_0x2b8ad4){if(_0x2b8ad4){return[_0x2b8ad4,![]];}_0x2003bc[_0x0a9e('0xa5')]=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa5')];_0x2003bc['externalUrl']=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa7')];return db[_0x0a9e('0xa6')][_0x0a9e('0x4b')](_0x2003bc)[_0x0a9e('0x13')](function(_0x20c130){return[_0x20c130,!![]];});});}_0x2d8e91[_0x0a9e('0xa8')]=_0x5acdc9['id'];if(_0x5a1848[_0x0a9e('0x50')]['interaction']&&_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa9')]['id']){_0x2d8e91['id']=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa9')]['id'];return db['ChatInteraction']['find']({'where':_0x2d8e91})[_0x0a9e('0x13')](function(_0x2abe55){if(_0x2abe55){return[_0x2abe55,![]];}return db[_0x0a9e('0xa6')]['create'](_0x2003bc)[_0x0a9e('0x13')](function(_0x40180d){return[_0x40180d,!![]];});});}return db['ChatInteraction'][_0x0a9e('0x4b')](_0x2003bc)['then'](function(_0x35cc2a){return[_0x35cc2a,!![]];});}})['spread'](function(_0x5b42b9,_0x48eaa3){if(_0x5b42b9){_0x3c9135=_0x48eaa3;if(!_0x48eaa3){var _0xad4d10={'from':(_0x1a0314[_0x0a9e('0x92')][_0x0a9e('0x98')]||'')+'\x20'+(_0x1a0314[_0x0a9e('0x92')][_0x0a9e('0x99')]||'')};if(_0x5a1848[_0x0a9e('0x50')]['threadId']&&_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xaa')]&&_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa5')]!=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xaa')]){_0xad4d10[_0x0a9e('0xa5')]=_0x5a1848['body']['messageId'];}return _0x5b42b9[_0x0a9e('0x25')](_0xad4d10);}else{return _0x5b42b9;}}})['then'](function(_0x29537a){_0x1a0314[_0x0a9e('0xa9')]=_0x29537a[_0x0a9e('0x27')]({'plain':!![]});_0x1a0314[_0x0a9e('0xa9')][_0x0a9e('0xab')]=_0x3c9135;if(_0x1a0314[_0x0a9e('0xa9')]['created']){if(_0x1a0314[_0x0a9e('0x8d')]['autoclose']){_0x1a0314['applications'][_0x0a9e('0xac')]({'id':0x0,'priority':_0x1a0314['applications'][_0x0a9e('0x38')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x0a9e('0xad')});}}return db['ChatMessage'][_0x0a9e('0x4b')]({'body':_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x50')],'ChatWebsiteId':_0x5a1848['params']['id'],'ChatInteractionId':_0x29537a['id'],'direction':'in','ContactId':_0x1a0314[_0x0a9e('0x92')]['id'],'AttachmentId':_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xae')]});})['then'](function(_0x5236c9){_0x1a0314[_0x0a9e('0x19')]=_0x5236c9;if(_0x1a0314[_0x0a9e('0xa9')][_0x0a9e('0xaf')]){return db[_0x0a9e('0xb0')][_0x0a9e('0x4a')]({'attributes':['id',_0x0a9e('0x2b')],'where':{'id':_0x1a0314[_0x0a9e('0xa9')][_0x0a9e('0xaf')]}})[_0x0a9e('0x13')](function(_0x1020a0){if(_0x1020a0){_0x1a0314['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1020a0[_0x0a9e('0x2b')]+','+(_0x1a0314[_0x0a9e('0x8d')][_0x0a9e('0xb1')]||0xa),'interval':_0x0a9e('0xad')});_0x1a0314[_0x0a9e('0xb2')]=!![];}return respondWithRpcPromise(_0x0a9e('0xb3'),_0x0a9e('0xb4'),_0x1a0314);});}return respondWithRpcPromise(_0x0a9e('0xb3'),'startRouting',_0x1a0314);})['then'](function(_0x2869cc){respondWithRpcPromise(_0x0a9e('0xb5'),'EventManager',{'event':_0x0a9e('0x75'),'message':_0x2869cc},client9002);return _0x2869cc;})[_0x0a9e('0x13')](respondWithResult(_0x43c397,null))[_0x0a9e('0x45')](handleError(_0x43c397,null));};exports[_0x0a9e('0xb6')]=function(_0x2bb549,_0x2683ad){var _0x167196,_0x262281,_0x59f8f7;var _0x400800=[];var _0xbd1af3={};var _0x20e191=_0x2bb549['files']||[];var _0x4412a5=[];var _0x261ef8;return db[_0x0a9e('0x7b')][_0x0a9e('0x51')]()[_0x0a9e('0x13')](function(_0x21ada7){if(!_0x21ada7){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0x7e'));}_0x400800=_[_0x0a9e('0x7f')](_[_0x0a9e('0x49')](_0x21ada7),[_0x0a9e('0x80'),'updatedAt','CompanyId',_0x0a9e('0x83')]);if(_0x2bb549[_0x0a9e('0x50')]['id']){delete _0x2bb549[_0x0a9e('0x50')]['id'];}if(_[_0x0a9e('0x6e')](_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x91')])){throw _0x2683ad[_0x0a9e('0x1d')](0x1f4)['send'](new db[(_0x0a9e('0x7c'))]['ValidationError'](_0x0a9e('0x84')));}if(_[_0x0a9e('0x6e')](_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x50')])||_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x50')]===''){throw _0x2683ad[_0x0a9e('0x1d')](0x1f4)[_0x0a9e('0x2c')](new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0xb7')));}if(_[_0x0a9e('0x6e')](_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0xb8')])){throw _0x2683ad[_0x0a9e('0x1d')](0x1f4)[_0x0a9e('0x2c')](new db['Sequelize']['ValidationError'](_0x0a9e('0xb9')+_0x400800));}if(!_[_0x0a9e('0xba')](_0x400800,_0x2bb549['body']['mapKeyOffline'])){throw _0x2683ad[_0x0a9e('0x1d')](0x1f4)[_0x0a9e('0x2c')](new db[(_0x0a9e('0x7c'))]['ValidationError'](_0x0a9e('0xbb')+_0x400800));}_0xbd1af3[_0x2bb549['body'][_0x0a9e('0xb8')]]=_0x2bb549['body'][_0x0a9e('0x91')];})['then'](function(){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x2bb549[_0x0a9e('0x47')]['id']},'include':[{'model':db['CmList'],'as':_0x0a9e('0x8c')},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x0a9e('0x13')](handleEntityNotFound(_0x2683ad,null))[_0x0a9e('0x13')](function(_0x3c691f){if(_0x3c691f&&_0x3c691f[_0x0a9e('0x8c')]){_0x262281=_0x3c691f;var _0x1d51fd=_[_0x0a9e('0xb')](_0x2bb549[_0x0a9e('0x50')],{'firstName':_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x91')],'phone':_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x91')],'ListId':_0x3c691f[_0x0a9e('0x83')]});_0x1d51fd[_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0xb8')]]=_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x91')];return db[_0x0a9e('0x7b')][_0x0a9e('0xbc')]({'where':_0xbd1af3,'defaults':_0x1d51fd});}})[_0x0a9e('0xbd')](function(_0x51a987){if(_0x51a987){_0x59f8f7=_0x51a987;var _0x233e48=fs[_0x0a9e('0xbe')](path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x54658d=ejs[_0x0a9e('0xbf')](_0x233e48,{'body':_['toPairs'](_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x50')]),'bodyTitle':_0x262281[_0x0a9e('0xc0')]});return db[_0x0a9e('0xc1')][_0x0a9e('0x4b')]({'body':_0x54658d,'plainBody':htmlToText[_0x0a9e('0xc2')](_0x54658d),'ContactId':_0x51a987['id'],'ChatWebsiteId':_0x262281['id']});}})[_0x0a9e('0x13')](function(_0x1cc73e){_0x261ef8=_0x1cc73e;if(_0x20e191[_0x0a9e('0x38')]){var _0x6b948a=_0x20e191['map'](function(_0x283c59){return{'name':_0x283c59['originalname'],'basename':_0x283c59[_0x0a9e('0x60')],'type':_0x283c59['mimetype'],'ChatOfflineMessageId':_0x1cc73e['id']};});_0x4412a5=_0x6b948a[_0x0a9e('0x2e')](_0x2c5385=>{var _0x216791={'filename':_0x2c5385['name'],'path':path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],'server','files',_0x0a9e('0xc3'),_0x0a9e('0xc4'),_0x2c5385[_0x0a9e('0xc5')])};return _0x216791;});if(!_0x262281['openNewInteraction']){return db['sequelize']['transaction'](function(_0x374964){return db[_0x0a9e('0xc6')][_0x0a9e('0xc7')](_0x6b948a,{'transaction':_0x374964});});}}})[_0x0a9e('0x13')](function(){if(_0x261ef8){_0x167196=_0x261ef8;return db[_0x0a9e('0xc8')][_0x0a9e('0x56')]({'where':{'active':!![]},'include':[{'model':db[_0x0a9e('0xc9')],'as':_0x0a9e('0xca'),'raw':!![],'include':[{'model':db[_0x0a9e('0xcb')],'as':_0x0a9e('0xcb'),'raw':!![]}]}]});}})[_0x0a9e('0x13')](function(_0x2f4de1){if(_0x2f4de1&&_0x2f4de1[_0x0a9e('0xca')]&&_0x262281[_0x0a9e('0xcc')]&&_0x262281[_0x0a9e('0xcd')]){var _0x1a74c4=_0x2f4de1[_0x0a9e('0xce')]();return respondWithRpcPromise(_0x0a9e('0xcf'),'sendMail',{'account':_0x1a74c4,'message':{'from':util[_0x0a9e('0x9e')](_0x0a9e('0xd0'),_0x2f4de1[_0x0a9e('0x2b')],_0x2f4de1[_0x0a9e('0xd1')]||_0x2f4de1[_0x0a9e('0xca')][_0x0a9e('0x4c')]),'to':_0x262281['forwardOfflineAddress'],'subject':_0x262281[_0x0a9e('0xd2')],'html':_0x167196[_0x0a9e('0x50')],'attachments':_0x4412a5}},client9003)[_0x0a9e('0x13')](function(){return _0x167196;})[_0x0a9e('0x45')](function(_0x37390b){logger[_0x0a9e('0x18')](_0x37390b);});}})[_0x0a9e('0x13')](function(){if(_0x262281&&_0x262281[_0x0a9e('0xd3')]&&_0x262281[_0x0a9e('0xd4')]){var _0x541af6=[];if(_0x20e191['length']){_0x541af6=_0x20e191[_0x0a9e('0x2e')](function(_0x3a0b30){return{'name':_0x3a0b30['originalname'],'basename':_0x3a0b30[_0x0a9e('0x60')],'type':_0x3a0b30[_0x0a9e('0xd5')],'ChatOfflineMessageId':_0x261ef8['id']};});}var _0x4c8d75;if(!_[_0x0a9e('0x6e')](_0x262281['subjectOffline'])){var _0x3468a4=_[_0x0a9e('0x2e')](_0x2bb549['body'],function(_0x27a41c){return _0x27a41c;});var _0x31ab12=_['toPairsIn'](_0x3468a4)[0x0];var _0x197d65=_[_0x0a9e('0xd6')](_0x31ab12,function(_0x53ad2b){return _0x53ad2b;});_0x4c8d75=_0x197d65[0x1][_0x262281[_0x0a9e('0xd7')]];}var _0x237994={'from':_0x59f8f7[_0x0a9e('0xd1')],'firstName':_0x59f8f7[_0x0a9e('0x98')],'lastName':_0x59f8f7[_0x0a9e('0x99')],'mapKey':_0x0a9e('0xd1'),'message':{'from':_0x59f8f7['email'],'to':_0x262281[_0x0a9e('0xc8')][_0x0a9e('0xd1')],'cc':'','subject':_['isNil'](_0x4c8d75)?_0x262281[_0x0a9e('0xd2')]:_0x4c8d75,'messageId':'','sentAt':new Date(),'attach':_0x541af6[_0x0a9e('0x38')],'attachments':_0x541af6,'originChannel':_0x0a9e('0xd8'),'ChatWebsiteId':_0x262281['id'],'ChatOfflineMessageId':_0x167196['id'],'originTo':_0x262281[_0x0a9e('0xc8')][_0x0a9e('0xd1')]},'body':_0x167196[_0x0a9e('0x50')]};var _0x368a12={'account':{'id':_0x262281['MailAccountId']},'body':_0x237994,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x368a12,client9001)['then'](function(){return _0x167196;})[_0x0a9e('0x45')](function(_0x23ef4e){logger['error'](_0x23ef4e);});}return;})['then'](function(){if(_0x167196){return _0x167196;}})[_0x0a9e('0x13')](respondWithResult(_0x2683ad,null))['catch'](function(_0x41600e){logger[_0x0a9e('0x18')](_0x0a9e('0x45'),_0x41600e);for(var _0x175c97 of _0x20e191){var _0x336518=path[_0x0a9e('0x66')](config['root'],_0x0a9e('0xd9'),_0x0a9e('0xda'),'attachments',_0x0a9e('0xc4'),_0x175c97[_0x0a9e('0x60')]);fs_extra[_0x0a9e('0xdb')](_0x336518)[_0x0a9e('0x45')](function(_0x1282da){logger[_0x0a9e('0x18')](_0x0a9e('0xdc'),_0x336518,_0x1282da);});}});};exports['addInteraction']=function(_0x331216,_0x508395){return db[_0x0a9e('0xa6')][_0x0a9e('0x4a')]({'where':{'id':_0x331216['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x508395,null))[_0x0a9e('0x13')](function(_0x5061e5){if(_0x5061e5){return _0x5061e5[_0x0a9e('0xdd')](_0x331216['body'][_0x0a9e('0x5e')],_[_0x0a9e('0xde')](_0x331216['body'],[_0x0a9e('0x5e'),'id'])||{});}})['then'](respondWithResult(_0x508395,null))[_0x0a9e('0x45')](handleError(_0x508395,null));};exports[_0x0a9e('0xdf')]=function(_0x732141,_0x37ef45){var _0x288127={'raw':![],'where':{}};var _0x26d010={};var _0xa45906={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0a9e('0x56')]({'where':{'id':_0x732141[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x37ef45,null))[_0x0a9e('0x13')](function(_0x38e256){if(_0x38e256){_0x26d010['model']=_[_0x0a9e('0x49')](db['ChatInteraction']['rawAttributes']);_0x26d010[_0x0a9e('0x33')]=_['keys'](_0x732141[_0x0a9e('0x33')]);_0x26d010[_0x0a9e('0x34')]=_['intersection'](_0x26d010[_0x0a9e('0x32')],_0x26d010[_0x0a9e('0x33')]);_0x288127[_0x0a9e('0x36')]=_[_0x0a9e('0x35')](_0x26d010[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x732141[_0x0a9e('0x33')][_0x0a9e('0x37')]));_0x288127[_0x0a9e('0x36')]=_0x288127['attributes'][_0x0a9e('0x38')]?_0x288127[_0x0a9e('0x36')]:_0x26d010[_0x0a9e('0x32')];if(!_0x732141[_0x0a9e('0x33')]['hasOwnProperty'](_0x0a9e('0x39'))){_0x288127[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x732141['query'][_0x0a9e('0x21')]);_0x288127[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x732141['query'][_0x0a9e('0x1f')]);}_0x288127['order']=qs[_0x0a9e('0x3b')](_0x732141[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x288127[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x732141[_0x0a9e('0x33')],_0x26d010['filters']));_0x288127[_0x0a9e('0x3c')][_0x0a9e('0x53')]=_0x38e256['id'];if(_0x732141[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x288127[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x288127[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x2e')](_0x288127[_0x0a9e('0x36')],function(_0x4712c9){var _0x4542d3={};_0x4542d3[_0x4712c9]={'$like':'%'+_0x732141[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x4542d3;})});}_0x288127=_[_0x0a9e('0x3f')]({},_0x288127,_0x732141[_0x0a9e('0x41')]);return db[_0x0a9e('0xa6')][_0x0a9e('0x22')]({'where':_0x288127[_0x0a9e('0x3c')]})[_0x0a9e('0x13')](function(_0x611e46){_0xa45906[_0x0a9e('0x22')]=_0x611e46;if(_0x732141[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x288127['include']=[{'model':db[_0x0a9e('0x7b')],'as':_0x0a9e('0xe0'),'required':![]},{'model':db[_0x0a9e('0xb0')],'as':'Owner','attributes':[_0x0a9e('0x2b'),'fullname',_0x0a9e('0xe1')],'required':![]},{'model':db[_0x0a9e('0xe2')],'as':_0x0a9e('0xe3'),'attributes':['id',_0x0a9e('0x2b'),_0x0a9e('0xe4')],'where':_0x732141[_0x0a9e('0x33')][_0x0a9e('0xe5')]?{'id':_0x732141[_0x0a9e('0x33')]['tag']}:undefined,'required':_0x732141[_0x0a9e('0x33')][_0x0a9e('0xe5')]?!![]:![]}];}return db['ChatInteraction'][_0x0a9e('0x44')](_0x288127);})[_0x0a9e('0x13')](function(_0x579bb0){_0xa45906['rows']=_0x579bb0;return _0xa45906;});}})[_0x0a9e('0x13')](respondWithFilteredResult(_0x37ef45,_0x288127))[_0x0a9e('0x45')](handleError(_0x37ef45,null));};function iftimePromise(_0x315299,_0x1bf053){return respondWithRpcPromise('Command',_0x0a9e('0xe6'),{'command':_0x1bf053[_0x0a9e('0xe7')]?util[_0x0a9e('0x9e')](_0x0a9e('0xe8'),_0x315299[_0x0a9e('0xe9')],_0x1bf053['timezone']):util[_0x0a9e('0x9e')](_0x0a9e('0xea'),_0x315299['interval'])},client9002)[_0x0a9e('0x13')](function(_0x2d20a0){var _0x38284a=_0x2d20a0&&_0x2d20a0['indexOf']('true')>=0x0?!![]:![];logger[_0x0a9e('0x14')](_0x0a9e('0xeb'),_0x1bf053['id'],_0x315299['id'],_0x315299[_0x0a9e('0xe9')],_0x38284a?_0x0a9e('0xec'):_0x0a9e('0xed'),_0x1bf053[_0x0a9e('0xe7')]?_0x1bf053[_0x0a9e('0xe7')]:_0x0a9e('0xee'));return _0x38284a;})['catch'](function(_0x5cc8cb){logger[_0x0a9e('0x18')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1bf053['id'],_0x315299['id'],_0x315299[_0x0a9e('0xe9')],util[_0x0a9e('0xef')](_0x5cc8cb,{'showHidden':![],'depth':null}),_0x1bf053[_0x0a9e('0xe7')]?_0x1bf053[_0x0a9e('0xe7')]:'No\x20timezone');return![];});}exports[_0x0a9e('0xe6')]=function(_0x43c1d1,_0x546bc9){var _0x10e370=0x0;var _0x5092af=0x0;var _0x2e1de7=![];var _0x30a77e;var _0xd63c87;return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x43c1d1[_0x0a9e('0x47')]['id']},'include':[{'model':db['Interval'],'as':_0x0a9e('0xf0'),'include':[{'model':db['Interval'],'as':_0x0a9e('0xf1'),'attributes':['id',_0x0a9e('0xe9')],'raw':!![]}]}]})[_0x0a9e('0x13')](handleEntityNotFound(_0x546bc9,null))[_0x0a9e('0x13')](function(_0xa244bc){if(_0xa244bc){_0x30a77e=_0xa244bc;return _0xa244bc[_0x0a9e('0xf2')]({'raw':!![]});}})[_0x0a9e('0x13')](function(_0x5bdba6){if(_0x30a77e){if(_0x5bdba6){_0xd63c87=_0x5bdba6;}}return require(_0x0a9e('0xf3'))[_0x0a9e('0x69')]();})[_0x0a9e('0x13')](function(_0x188231){if(_0x188231){_0x5092af=_0x188231[_0x0a9e('0xf4')];_0x2e1de7=_0x188231['custom'];}})[_0x0a9e('0x13')](function(){return db[_0x0a9e('0xa6')]['count']({'where':{'closed':![]}});})['then'](function(_0x2240ea){_0x10e370=_0x2240ea;if(_0x5092af&&_0x2240ea>_0x5092af){return db[_0x0a9e('0xf5')][_0x0a9e('0x56')]({'where':{'id':0x1}})[_0x0a9e('0x13')](function(_0x380539){if(_0x380539){_0x380539[_0x0a9e('0xf6')]('chatLicenseExceeded');}});}})[_0x0a9e('0x13')](function(){if(_0x30a77e[_0x0a9e('0xf0')]&&_0x30a77e[_0x0a9e('0xf0')]['Intervals']){var _0x294e90=[];for(var _0x1969e3=0x0;_0x1969e3<_0x30a77e[_0x0a9e('0xf0')][_0x0a9e('0xf1')]['length'];_0x1969e3++){var _0x5d4935=_0x30a77e[_0x0a9e('0xf0')][_0x0a9e('0xf1')][_0x1969e3][_0x0a9e('0x27')]({'plain':!![]});_0x294e90[_0x0a9e('0xac')](iftimePromise(_0x5d4935,_0x30a77e));}return BPromise[_0x0a9e('0xf7')](_0x294e90)[_0x0a9e('0x13')](function(_0x371943){return _[_0x0a9e('0xf8')](_0x371943);});}else{return!![];}})['then'](function(_0x17187c){var _0x4be017=fs[_0x0a9e('0xbe')](path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],'server/files/chat/iframe.ejs'),'utf8');var _0x462ecd={'remote':_0x30a77e['remote'],'query':querystring[_0x0a9e('0xa4')](_['merge'](_0x30a77e['get']({'plain':!![]}),{'customerIp':_0x43c1d1[_0x0a9e('0x78')][_0x0a9e('0x96')]||_0x43c1d1[_0x0a9e('0x78')][_0x0a9e('0xf9')]||_0x43c1d1[_0x0a9e('0xfa')][_0x0a9e('0xfb')]||_0x43c1d1['ip'],'referer':_0x43c1d1[_0x0a9e('0x78')][_0x0a9e('0x9b')],'openedInteractions':_0x10e370,'maxInteractions':_0x5092af,'virtual':_0x2e1de7[_0x0a9e('0xf4')],'online':_0x17187c,'custom':_0x2e1de7}))[_0x0a9e('0xfc')](/'/g,'\x5c\x27')};_0x546bc9[_0x0a9e('0x2c')](ejs[_0x0a9e('0xbf')](Mustache[_0x0a9e('0xbf')](_0x4be017,_0x462ecd),{'proactiveActions':_0xd63c87,'alignment':_0x30a77e['alignment'],'verticalAlignment':_0x30a77e['verticalAlignment'],'div_color':_0x30a77e[_0x0a9e('0xe4')],'labelText':_0x30a77e['labelText'],'text_color':_0x30a77e[_0x0a9e('0xfd')],'button_color':_0x30a77e[_0x0a9e('0xfe')],'background_color':_0x30a77e[_0x0a9e('0xff')],'hideWhenOffline':_0x30a77e['hideWhenOffline'],'interval':_0x30a77e['IntervalId']}));})[_0x0a9e('0x45')](handleError(_0x546bc9,null));};exports[_0x0a9e('0x100')]=function(_0x2c316b,_0x142c65){var _0x193e3b=_0x2c316b[_0x0a9e('0x47')]['id'];var _0x36e428=_0x2c316b['body'];var _0x12984a=0xc8;var _0x5799a6=null;return db[_0x0a9e('0x101')][_0x0a9e('0x102')]({'isolationLevel':db['sequelize'][_0x0a9e('0x103')][_0x0a9e('0x104')][_0x0a9e('0x105')]},function(_0x4524b8){return db[_0x0a9e('0x2f')][_0x0a9e('0x56')]({'where':{'id':_0x193e3b},'transaction':_0x4524b8})['then'](function(_0x475bcd){if(_0x475bcd){return db[_0x0a9e('0x106')][_0x0a9e('0x26')]({'where':{'ChatWebsiteId':_0x193e3b},'transaction':_0x4524b8})['then'](function(){var _0x857983=_[_0x0a9e('0x2e')](_0x36e428,function(_0x24dc3f){_0x24dc3f['ChatWebsiteId']=_0x193e3b;return _0x24dc3f;});return db[_0x0a9e('0x106')][_0x0a9e('0xc7')](_0x857983,{'transaction':_0x4524b8});});}else{_0x12984a=0x194;_0x5799a6=[];}});})[_0x0a9e('0x13')](function(){if(_0x12984a!==0x194){return db[_0x0a9e('0x106')][_0x0a9e('0x107')]({'where':{'ChatWebsiteId':_0x193e3b},'order':_0x0a9e('0x108')})['then'](function(_0x483aed){_0x5799a6=_0x483aed;});}})[_0x0a9e('0x45')](function(_0x1e01af){_0x12984a=0x1f4;logger['error'](_0x1e01af[_0x0a9e('0x2a')]);if(_0x1e01af[_0x0a9e('0x2b')]){delete _0x1e01af[_0x0a9e('0x2b')];}_0x5799a6=_0x1e01af;})[_0x0a9e('0x109')](function(){if(_0x5799a6===null){_0x142c65[_0x0a9e('0x1b')](_0x12984a);}else{if(_0x12984a===0x1f4){_0x142c65[_0x0a9e('0x1d')](_0x12984a)['send'](_0x5799a6);}else{_0x142c65[_0x0a9e('0x1d')](_0x12984a)[_0x0a9e('0x1e')](_0x5799a6);}}});};exports[_0x0a9e('0x10a')]=function(_0x4edb79,_0x45c6ce){var _0x4532de={};var _0x1747ab={};var _0x3afafa;var _0x5beea6;return db['ChatWebsite'][_0x0a9e('0x56')]({'where':{'id':_0x4edb79[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x45c6ce,null))['then'](function(_0x3d75c9){if(_0x3d75c9){_0x3afafa=_0x3d75c9;_0x1747ab[_0x0a9e('0x32')]=_[_0x0a9e('0x49')](db[_0x0a9e('0x106')][_0x0a9e('0x30')]);_0x1747ab[_0x0a9e('0x33')]=_[_0x0a9e('0x49')](_0x4edb79[_0x0a9e('0x33')]);_0x1747ab['filters']=_['intersection'](_0x1747ab[_0x0a9e('0x32')],_0x1747ab[_0x0a9e('0x33')]);_0x4532de['attributes']=_[_0x0a9e('0x35')](_0x1747ab['model'],qs[_0x0a9e('0x37')](_0x4edb79[_0x0a9e('0x33')]['fields']));_0x4532de[_0x0a9e('0x36')]=_0x4532de[_0x0a9e('0x36')]['length']?_0x4532de[_0x0a9e('0x36')]:_0x1747ab[_0x0a9e('0x32')];_0x4532de[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x4edb79[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x4532de[_0x0a9e('0x3c')]=qs['filters'](_[_0x0a9e('0x3d')](_0x4edb79[_0x0a9e('0x33')],_0x1747ab[_0x0a9e('0x34')]));if(_0x4edb79[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x4532de[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x4532de['where'],{'$or':_['map'](_0x4532de[_0x0a9e('0x36')],function(_0x14c3f1){var _0x1e6bba={};_0x1e6bba[_0x14c3f1]={'$like':'%'+_0x4edb79['query']['filter']+'%'};return _0x1e6bba;})});}_0x4532de=_[_0x0a9e('0x3f')]({},_0x4532de,_0x4edb79['options']);return _0x3afafa[_0x0a9e('0x10a')](_0x4532de);}})[_0x0a9e('0x13')](function(_0x112789){if(_0x112789){_0x5beea6=_0x112789[_0x0a9e('0x38')];if(!_0x4edb79[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0x4532de[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x4edb79['query']['limit']);_0x4532de[_0x0a9e('0x1f')]=qs['offset'](_0x4edb79[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}return _0x3afafa[_0x0a9e('0x10a')](_0x4532de);}})[_0x0a9e('0x13')](function(_0x4ad6fc){if(_0x4ad6fc){return _0x4ad6fc?{'count':_0x5beea6,'rows':_0x4ad6fc}:null;}})[_0x0a9e('0x13')](respondWithResult(_0x45c6ce,null))[_0x0a9e('0x45')](handleError(_0x45c6ce,null));};exports[_0x0a9e('0x10b')]=function(_0x5174c5,_0x1ebf20){return db[_0x0a9e('0x10c')][_0x0a9e('0x4a')]({'where':{'id':_0x5174c5['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x1ebf20,null))[_0x0a9e('0x13')](function(_0x459ab7){if(_0x459ab7){return _0x459ab7[_0x0a9e('0x10b')](_0x5174c5[_0x0a9e('0x50')][_0x0a9e('0x5e')],_['omit'](_0x5174c5['body'],[_0x0a9e('0x5e'),'id'])||{});}})[_0x0a9e('0x13')](respondWithResult(_0x1ebf20,null))[_0x0a9e('0x45')](handleError(_0x1ebf20,null));};exports['getProactiveActions']=function(_0x5990e1,_0x2a5c2a){var _0x304a57={};var _0x2302a2={};var _0x5f5963;var _0x4b51ff;return db[_0x0a9e('0x2f')][_0x0a9e('0x56')]({'where':{'id':_0x5990e1[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x2a5c2a,null))[_0x0a9e('0x13')](function(_0x4f0bca){if(_0x4f0bca){_0x5f5963=_0x4f0bca;_0x2302a2[_0x0a9e('0x32')]=_['keys'](db[_0x0a9e('0x10d')][_0x0a9e('0x30')]);_0x2302a2['query']=_[_0x0a9e('0x49')](_0x5990e1['query']);_0x2302a2[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x2302a2[_0x0a9e('0x32')],_0x2302a2[_0x0a9e('0x33')]);_0x304a57[_0x0a9e('0x36')]=_['intersection'](_0x2302a2[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x5990e1[_0x0a9e('0x33')]['fields']));_0x304a57[_0x0a9e('0x36')]=_0x304a57['attributes'][_0x0a9e('0x38')]?_0x304a57[_0x0a9e('0x36')]:_0x2302a2[_0x0a9e('0x32')];_0x304a57['order']=qs[_0x0a9e('0x3b')](_0x5990e1[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x304a57[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x5990e1['query'],_0x2302a2[_0x0a9e('0x34')]));if(_0x5990e1[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x304a57[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x304a57[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x2e')](_0x304a57[_0x0a9e('0x36')],function(_0x597e99){var _0x2dc0de={};_0x2dc0de[_0x597e99]={'$like':'%'+_0x5990e1[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x2dc0de;})});}_0x304a57=_[_0x0a9e('0x3f')]({},_0x304a57,_0x5990e1['options']);return _0x5f5963[_0x0a9e('0xf2')](_0x304a57);}})['then'](function(_0xf81cc){if(_0xf81cc){_0x4b51ff=_0xf81cc[_0x0a9e('0x38')];if(!_0x5990e1[_0x0a9e('0x33')]['hasOwnProperty'](_0x0a9e('0x39'))){_0x304a57[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x5990e1[_0x0a9e('0x33')]['limit']);_0x304a57[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x5990e1[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}return _0x5f5963[_0x0a9e('0xf2')](_0x304a57);}})[_0x0a9e('0x13')](function(_0xbdc88e){if(_0xbdc88e){return _0xbdc88e?{'count':_0x4b51ff,'rows':_0xbdc88e}:null;}})['then'](respondWithResult(_0x2a5c2a,null))[_0x0a9e('0x45')](handleError(_0x2a5c2a,null));};exports[_0x0a9e('0x10e')]=function(_0x337c29,_0xa42055){var _0x52cdf4=_0x337c29[_0x0a9e('0x33')]['online']===_0x0a9e('0x10f')?_0x0a9e('0x110'):_0x0a9e('0x111');return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'attributes':['id',_0x52cdf4],'where':{'id':_0x337c29[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0xa42055,null))['then'](function(_0x173f03){if(_0x173f03){var _0x4ac7f1=_0x173f03[_0x52cdf4];var _0x382412=_0x4ac7f1&&_0x4ac7f1[_0x0a9e('0x112')]?_0x4ac7f1['items']:[];_0xa42055[_0x0a9e('0x2c')]({'fromKey':_[_0x0a9e('0x6e')](_0x4ac7f1[_0x0a9e('0x113')])?undefined:_0x4ac7f1[_0x0a9e('0x113')],'count':_0x382412['length'],'rows':_0x382412});}})[_0x0a9e('0x45')](handleError(_0xa42055,null));};exports[_0x0a9e('0x114')]=function(_0x5a75d9,_0xcc859d){var _0x4a396c={'raw':![],'where':{}};var _0x58cb87={};var _0x50e7ec={'count':0x0,'rows':[]};return db[_0x0a9e('0x2f')][_0x0a9e('0x56')]({'where':{'id':_0x5a75d9['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0xcc859d,null))[_0x0a9e('0x13')](function(_0x5ef7e8){if(_0x5ef7e8){_0x58cb87[_0x0a9e('0x32')]=_[_0x0a9e('0x49')](db[_0x0a9e('0xc1')][_0x0a9e('0x30')]);_0x58cb87[_0x0a9e('0x33')]=_[_0x0a9e('0x49')](_0x5a75d9[_0x0a9e('0x33')]);_0x58cb87['filters']=_[_0x0a9e('0x35')](_0x58cb87['model'],_0x58cb87[_0x0a9e('0x33')]);_0x4a396c[_0x0a9e('0x36')]=_[_0x0a9e('0x35')](_0x58cb87[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x5a75d9[_0x0a9e('0x33')]['fields']));_0x4a396c[_0x0a9e('0x36')]=_0x4a396c[_0x0a9e('0x36')][_0x0a9e('0x38')]?_0x4a396c['attributes']:_0x58cb87[_0x0a9e('0x32')];if(!_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0x4a396c[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x21')]);_0x4a396c[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}_0x4a396c[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x4a396c['where']=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x5a75d9[_0x0a9e('0x33')],_0x58cb87['filters']));_0x4a396c[_0x0a9e('0x3c')][_0x0a9e('0x53')]=_0x5ef7e8['id'];if(_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x4a396c['where']=_[_0x0a9e('0x3f')](_0x4a396c[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x2e')](_0x4a396c[_0x0a9e('0x36')],function(_0x4e8eb9){var _0x2b263b={};_0x2b263b[_0x4e8eb9]={'$like':'%'+_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x2b263b;})});}_0x4a396c=_[_0x0a9e('0x3f')]({},_0x4a396c,_0x5a75d9['options']);return db['ChatOfflineMessage'][_0x0a9e('0x22')]({'where':_0x4a396c[_0x0a9e('0x3c')]})[_0x0a9e('0x13')](function(_0x353960){_0x50e7ec[_0x0a9e('0x22')]=_0x353960;if(_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x4a396c[_0x0a9e('0x43')]=[{'all':!![]}];}else{_0x4a396c[_0x0a9e('0x43')]=[{'model':db[_0x0a9e('0x7b')],'as':_0x0a9e('0xe0'),'required':![]},{'model':db[_0x0a9e('0xc6')],'as':_0x0a9e('0x115'),'required':![]}];}return db[_0x0a9e('0xc1')]['findAll'](_0x4a396c);})[_0x0a9e('0x13')](function(_0x5ce227){_0x50e7ec[_0x0a9e('0x58')]=_0x5ce227;return _0x50e7ec;});}})['then'](respondWithFilteredResult(_0xcc859d,_0x4a396c))['catch'](handleError(_0xcc859d,null));};exports[_0x0a9e('0x116')]=function(_0x51ec16,_0x3d2007){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x51ec16[_0x0a9e('0x47')]['id']}})['then'](handleEntityNotFound(_0x3d2007,null))['then'](function(_0x2ad86f){if(_0x2ad86f){return _0x2ad86f[_0x0a9e('0x116')](_0x51ec16[_0x0a9e('0x50')][_0x0a9e('0x5e')],_['omit'](_0x51ec16[_0x0a9e('0x50')],[_0x0a9e('0x5e'),'id'])||{})[_0x0a9e('0xbd')](function(_0x25f5fa){for(var _0x193ef7=0x0;_0x193ef7<_0x51ec16['body']['ids'][_0x0a9e('0x38')];_0x193ef7+=0x1){socket[_0x0a9e('0x117')](_0x0a9e('0x118'),{'UserId':Number(_0x51ec16[_0x0a9e('0x50')][_0x0a9e('0x5e')][_0x193ef7]),'ChatWebsiteId':Number(_0x51ec16[_0x0a9e('0x47')]['id'])});}return _0x25f5fa;});}})[_0x0a9e('0x13')](respondWithResult(_0x3d2007,null))['catch'](handleError(_0x3d2007,null));};exports[_0x0a9e('0x119')]=function(_0xd73712,_0x173daf){return db['ChatWebsite']['find']({'where':{'id':_0xd73712['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x173daf,null))[_0x0a9e('0x13')](function(_0x5448ee){if(_0x5448ee){return _0x5448ee[_0x0a9e('0x119')](_0xd73712[_0x0a9e('0x33')][_0x0a9e('0x5e')])['then'](function(){if(_['isArray'](_0xd73712[_0x0a9e('0x33')][_0x0a9e('0x5e')])){for(var _0xf10a48=0x0;_0xf10a48<_0xd73712[_0x0a9e('0x33')]['ids'][_0x0a9e('0x38')];_0xf10a48+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0xd73712[_0x0a9e('0x33')]['ids'][_0xf10a48]),'ChatWebsiteId':Number(_0xd73712[_0x0a9e('0x47')]['id'])});}}else{socket[_0x0a9e('0x117')](_0x0a9e('0x11a'),{'UserId':Number(_0xd73712['query'][_0x0a9e('0x5e')]),'ChatWebsiteId':Number(_0xd73712[_0x0a9e('0x47')]['id'])});}});}})[_0x0a9e('0x13')](respondWithStatusCode(_0x173daf,null))['catch'](handleError(_0x173daf,null));};exports['getAgents']=function(_0x3aa901,_0xb3e9cb){var _0x34b05f={};var _0x21fcaa={};var _0x1c3b0e;var _0x1966dd;return db['ChatWebsite']['findOne']({'where':{'id':_0x3aa901[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0xb3e9cb,null))['then'](function(_0x539f84){if(_0x539f84){_0x1c3b0e=_0x539f84;_0x21fcaa['model']=_['keys'](db['User']['rawAttributes']);_0x21fcaa[_0x0a9e('0x33')]=_['keys'](_0x3aa901[_0x0a9e('0x33')]);_0x21fcaa[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x21fcaa[_0x0a9e('0x32')],_0x21fcaa[_0x0a9e('0x33')]);_0x34b05f[_0x0a9e('0x36')]=_[_0x0a9e('0x35')](_0x21fcaa['model'],qs[_0x0a9e('0x37')](_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x37')]));_0x34b05f[_0x0a9e('0x36')]=_0x34b05f[_0x0a9e('0x36')][_0x0a9e('0x38')]?_0x34b05f[_0x0a9e('0x36')]:_0x21fcaa[_0x0a9e('0x32')];_0x34b05f[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x3aa901[_0x0a9e('0x33')]['sort']);_0x34b05f[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_['pick'](_0x3aa901[_0x0a9e('0x33')],_0x21fcaa['filters']));if(_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x34b05f['where']=_['merge'](_0x34b05f[_0x0a9e('0x3c')],{'$or':_['map'](_0x34b05f[_0x0a9e('0x36')],function(_0xa8c784){var _0x132f85={};_0x132f85[_0xa8c784]={'$like':'%'+_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x132f85;})});}_0x34b05f=_['merge']({},_0x34b05f,_0x3aa901[_0x0a9e('0x41')]);return _0x1c3b0e['getAgents'](_0x34b05f);}})['then'](function(_0x398a88){if(_0x398a88){_0x1966dd=_0x398a88[_0x0a9e('0x38')];if(!_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0x34b05f['limit']=qs[_0x0a9e('0x21')](_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x21')]);_0x34b05f[_0x0a9e('0x1f')]=qs['offset'](_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}return _0x1c3b0e['getAgents'](_0x34b05f);}})[_0x0a9e('0x13')](function(_0x36d8a1){if(_0x36d8a1){return _0x36d8a1?{'count':_0x1966dd,'rows':_0x36d8a1}:null;}})[_0x0a9e('0x13')](respondWithResult(_0xb3e9cb,null))[_0x0a9e('0x45')](handleError(_0xb3e9cb,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 20839dc..11c1e9b 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 _0xe015=['update','emit','hasOwnProperty','events','../../mysqldb','ChatWebsite'];(function(_0x2a6385,_0xf10ba0){var _0x258535=function(_0x5bcfbb){while(--_0x5bcfbb){_0x2a6385['push'](_0x2a6385['shift']());}};_0x258535(++_0xf10ba0);}(_0xe015,0x13b));var _0x5e01=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe015[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x5e01('0x0'));var ChatWebsite=require(_0x5e01('0x1'))['db'][_0x5e01('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5e01('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2136cf){return function(_0x420f00,_0x7ce4b9,_0x241c0e){ChatWebsiteEvents['emit'](_0x2136cf+':'+_0x420f00['id'],_0x420f00);ChatWebsiteEvents[_0x5e01('0x4')](_0x2136cf,_0x420f00);_0x241c0e(null);};}for(var e in events){if(events[_0x5e01('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x8e0f=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0x4ab7bb,_0x290191){var _0x2624b3=function(_0x2852f2){while(--_0x2852f2){_0x4ab7bb['push'](_0x4ab7bb['shift']());}};_0x2624b3(++_0x290191);}(_0x8e0f,0x12f));var _0xf8e0=function(_0x5741a3,_0x1258f3){_0x5741a3=_0x5741a3-0x0;var _0x4db4a0=_0x8e0f[_0x5741a3];return _0x4db4a0;};'use strict';var EventEmitter=require(_0xf8e0('0x0'));var ChatWebsite=require(_0xf8e0('0x1'))['db'][_0xf8e0('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf8e0('0x3')](0x0);var events={'afterCreate':_0xf8e0('0x4'),'afterUpdate':_0xf8e0('0x5'),'afterDestroy':_0xf8e0('0x6')};function emitEvent(_0x5e954c){return function(_0x40d121,_0x4a6acb,_0xa0826a){ChatWebsiteEvents[_0xf8e0('0x7')](_0x5e954c+':'+_0x40d121['id'],_0x40d121);ChatWebsiteEvents['emit'](_0x5e954c,_0x40d121);_0xa0826a(null);};}for(var e in events){if(events[_0xf8e0('0x8')](e)){var event=events[e];ChatWebsite[_0xf8e0('0x9')](e,emitEvent(event));}}module[_0xf8e0('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 2570a12..26b2253 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 _0xc9ab=['./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xfed6c5,_0x208e71){var _0x143596=function(_0x9226b7){while(--_0x9226b7){_0xfed6c5['push'](_0xfed6c5['shift']());}};_0x143596(++_0x208e71);}(_0xc9ab,0x17f));var _0xbc9a=function(_0x886d08,_0x2b985d){_0x886d08=_0x886d08-0x0;var _0x163828=_0xc9ab[_0x886d08];return _0x163828;};'use strict';var _=require(_0xbc9a('0x0'));var util=require(_0xbc9a('0x1'));var logger=require('../../config/logger')(_0xbc9a('0x2'));var moment=require(_0xbc9a('0x3'));var BPromise=require(_0xbc9a('0x4'));var rp=require(_0xbc9a('0x5'));var fs=require('fs');var path=require(_0xbc9a('0x6'));var rimraf=require(_0xbc9a('0x7'));var config=require(_0xbc9a('0x8'));var attributes=require(_0xbc9a('0x9'));module[_0xbc9a('0xa')]=function(_0x584e48,_0x5593d1){return _0x584e48[_0xbc9a('0xb')](_0xbc9a('0xc'),attributes,{'tableName':_0xbc9a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x440b=['define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x9f033e,_0xa9c326){var _0x467993=function(_0x42f7cb){while(--_0x42f7cb){_0x9f033e['push'](_0x9f033e['shift']());}};_0x467993(++_0xa9c326);}(_0x440b,0x18b));var _0xb440=function(_0x1e2c73,_0x12cd55){_0x1e2c73=_0x1e2c73-0x0;var _0x46f8d5=_0x440b[_0x1e2c73];return _0x46f8d5;};'use strict';var _=require(_0xb440('0x0'));var util=require(_0xb440('0x1'));var logger=require(_0xb440('0x2'))(_0xb440('0x3'));var moment=require(_0xb440('0x4'));var BPromise=require(_0xb440('0x5'));var rp=require(_0xb440('0x6'));var fs=require('fs');var path=require(_0xb440('0x7'));var rimraf=require(_0xb440('0x8'));var config=require(_0xb440('0x9'));var attributes=require('./chatWebsite.attributes');module[_0xb440('0xa')]=function(_0x2d856d,_0x16f9d3){return _0x2d856d[_0xb440('0xb')](_0xb440('0xc'),attributes,{'tableName':_0xb440('0xd'),'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 fde676e..0104292 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 _0x6002=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0xe7aa8a,_0x2eec45){var _0xd7df8c=function(_0x414f72){while(--_0x414f72){_0xe7aa8a['push'](_0xe7aa8a['shift']());}};_0xd7df8c(++_0x2eec45);}(_0x6002,0x117));var _0x2600=function(_0x107132,_0x13f848){_0x107132=_0x107132-0x0;var _0xeb25b1=_0x6002[_0x107132];return _0xeb25b1;};'use strict';var _=require(_0x2600('0x0'));var util=require(_0x2600('0x1'));var moment=require('moment');var BPromise=require(_0x2600('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2600('0x3'));var db=require(_0x2600('0x4'))['db'];var utils=require(_0x2600('0x5'));var logger=require(_0x2600('0x6'))('rpc');var config=require(_0x2600('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2600('0x8')][_0x2600('0x9')]({'port':0x232a});config['redis']=_[_0x2600('0xa')](config[_0x2600('0xb')],{'host':_0x2600('0xc'),'port':0x18eb});var socket=require(_0x2600('0xd'))(new Redis(config[_0x2600('0xb')]));require(_0x2600('0xe'))[_0x2600('0xf')](socket);function respondWithRpcPromise(_0x9d0649,_0xa87290,_0x494815){return new BPromise(function(_0x1532db,_0x1b93bf){return client[_0x2600('0x10')](_0x9d0649,_0x494815)[_0x2600('0x11')](function(_0x5b759c){logger[_0x2600('0x12')](_0x2600('0x13'),_0xa87290,_0x2600('0x14'));logger[_0x2600('0x15')](_0x2600('0x16'),_0xa87290,_0x2600('0x14'),JSON[_0x2600('0x17')](_0x5b759c));if(_0x5b759c[_0x2600('0x18')]){if(_0x5b759c[_0x2600('0x18')][_0x2600('0x19')]===0x1f4){logger['error'](_0x2600('0x13'),_0xa87290,_0x5b759c[_0x2600('0x18')][_0x2600('0x1a')]);return _0x1b93bf(_0x5b759c[_0x2600('0x18')][_0x2600('0x1a')]);}logger['error'](_0x2600('0x13'),_0xa87290,_0x5b759c[_0x2600('0x18')][_0x2600('0x1a')]);return _0x1532db(_0x5b759c[_0x2600('0x18')]['message']);}else{logger['info'](_0x2600('0x13'),_0xa87290,_0x2600('0x14'));_0x1532db(_0x5b759c['result'][_0x2600('0x1a')]);}})[_0x2600('0x1b')](function(_0x41db0b){logger[_0x2600('0x18')]('ChatWebsite,\x20%s,\x20%s',_0xa87290,_0x41db0b);_0x1b93bf(_0x41db0b);});});}
\ No newline at end of file
+var _0xfc57=['info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then'];(function(_0x3f591e,_0xe02469){var _0x41d0c6=function(_0x112622){while(--_0x112622){_0x3f591e['push'](_0x3f591e['shift']());}};_0x41d0c6(++_0xe02469);}(_0xfc57,0xe2));var _0x7fc5=function(_0x22a648,_0x5e884e){_0x22a648=_0x22a648-0x0;var _0x4c0b91=_0xfc57[_0x22a648];return _0x4c0b91;};'use strict';var _=require('lodash');var util=require(_0x7fc5('0x0'));var moment=require(_0x7fc5('0x1'));var BPromise=require(_0x7fc5('0x2'));var rs=require(_0x7fc5('0x3'));var fs=require('fs');var Redis=require(_0x7fc5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7fc5('0x5'));var logger=require(_0x7fc5('0x6'))(_0x7fc5('0x7'));var config=require('../../config/environment');var jayson=require(_0x7fc5('0x8'));var client=jayson[_0x7fc5('0x9')][_0x7fc5('0xa')]({'port':0x232a});config[_0x7fc5('0xb')]=_[_0x7fc5('0xc')](config[_0x7fc5('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7fc5('0xd'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x7fc5('0xe')](socket);function respondWithRpcPromise(_0xf3d595,_0x11b01b,_0x498d63){return new BPromise(function(_0x6e5da0,_0x305b6c){return client[_0x7fc5('0xf')](_0xf3d595,_0x498d63)[_0x7fc5('0x10')](function(_0x12dbb5){logger[_0x7fc5('0x11')](_0x7fc5('0x12'),_0x11b01b,_0x7fc5('0x13'));logger[_0x7fc5('0x14')](_0x7fc5('0x15'),_0x11b01b,_0x7fc5('0x13'),JSON[_0x7fc5('0x16')](_0x12dbb5));if(_0x12dbb5['error']){if(_0x12dbb5['error'][_0x7fc5('0x17')]===0x1f4){logger['error'](_0x7fc5('0x12'),_0x11b01b,_0x12dbb5[_0x7fc5('0x18')]['message']);return _0x305b6c(_0x12dbb5[_0x7fc5('0x18')]['message']);}logger[_0x7fc5('0x18')](_0x7fc5('0x12'),_0x11b01b,_0x12dbb5[_0x7fc5('0x18')][_0x7fc5('0x19')]);return _0x6e5da0(_0x12dbb5[_0x7fc5('0x18')][_0x7fc5('0x19')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x11b01b,_0x7fc5('0x13'));_0x6e5da0(_0x12dbb5[_0x7fc5('0x1a')][_0x7fc5('0x19')]);}})['catch'](function(_0x10ac83){logger[_0x7fc5('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x11b01b,_0x10ac83);_0x305b6c(_0x10ac83);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index a34e173..f129a41 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 _0x5c27=['update','emit','removeListener','chatWebsite:','./chatWebsite.events','save'];(function(_0x544700,_0x37f134){var _0x39260b=function(_0x4faf4a){while(--_0x4faf4a){_0x544700['push'](_0x544700['shift']());}};_0x39260b(++_0x37f134);}(_0x5c27,0x19c));var _0x75c2=function(_0x54ece6,_0x11a6c6){_0x54ece6=_0x54ece6-0x0;var _0x2cfd35=_0x5c27[_0x54ece6];return _0x2cfd35;};'use strict';var ChatWebsiteEvents=require(_0x75c2('0x0'));var events=[_0x75c2('0x1'),'remove',_0x75c2('0x2')];function createListener(_0x205d27,_0x4844cf){return function(_0x469b63){_0x4844cf[_0x75c2('0x3')](_0x205d27,_0x469b63);};}function removeListener(_0x2d9f08,_0x4f848f){return function(){ChatWebsiteEvents[_0x75c2('0x4')](_0x2d9f08,_0x4f848f);};}exports['register']=function(_0x3b5b92){for(var _0x5b37f5=0x0,_0x28704c=events['length'];_0x5b37f5<_0x28704c;_0x5b37f5++){var _0x44dab3=events[_0x5b37f5];var _0x158299=createListener(_0x75c2('0x5')+_0x44dab3,_0x3b5b92);ChatWebsiteEvents['on'](_0x44dab3,_0x158299);}};
\ No newline at end of file
+var _0x25b0=['save','remove','update','emit','removeListener','register','length','chatWebsite:'];(function(_0x309381,_0x336fa7){var _0x11f429=function(_0x206cdf){while(--_0x206cdf){_0x309381['push'](_0x309381['shift']());}};_0x11f429(++_0x336fa7);}(_0x25b0,0x170));var _0x025b=function(_0x22e056,_0x2cc7bd){_0x22e056=_0x22e056-0x0;var _0x20d872=_0x25b0[_0x22e056];return _0x20d872;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x025b('0x0'),_0x025b('0x1'),_0x025b('0x2')];function createListener(_0x3be0a0,_0x2fd3fb){return function(_0x4b270f){_0x2fd3fb[_0x025b('0x3')](_0x3be0a0,_0x4b270f);};}function removeListener(_0x2c6c59,_0x438af9){return function(){ChatWebsiteEvents[_0x025b('0x4')](_0x2c6c59,_0x438af9);};}exports[_0x025b('0x5')]=function(_0x2af29a){for(var _0x1da0fb=0x0,_0x4d6eef=events[_0x025b('0x6')];_0x1da0fb<_0x4d6eef;_0x1da0fb++){var _0x4b3877=events[_0x1da0fb];var _0x5bd27f=createListener(_0x025b('0x7')+_0x4b3877,_0x2af29a);ChatWebsiteEvents['on'](_0x4b3877,_0x5bd27f);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 9782040..b7c94e9 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 _0x2cb7=['connect-timeout','express','fs-extra','../../components/auth/service','./chatWebsite.controller','isAuthenticated','index','get','describe','/:id','/:id/dispositions','getAnswers','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getInteractions','/:id/snippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getAgents','post','create','addDisposition','addAnswer','join','server/files/images/logos/','%s-%s','now','originalname','/:id/logo','single','addLogo','diskStorage','server/files/images/avatars/','format','root','file','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','extname','any','offline','addInteraction','/:id/applications','addApplications','put','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','/:id/users','removeAgents','exports','util'];(function(_0x5b5e65,_0x4b7417){var _0x230214=function(_0x2d968a){while(--_0x2d968a){_0x5b5e65['push'](_0x5b5e65['shift']());}};_0x230214(++_0x4b7417);}(_0x2cb7,0x81));var _0x72cb=function(_0x699200,_0x39c101){_0x699200=_0x699200-0x0;var _0x266fd1=_0x2cb7[_0x699200];return _0x266fd1;};'use strict';var multer=require('multer');var util=require(_0x72cb('0x0'));var path=require('path');var timeout=require(_0x72cb('0x1'));var express=require(_0x72cb('0x2'));var router=express['Router']();var fs_extra=require(_0x72cb('0x3'));var auth=require(_0x72cb('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x72cb('0x5'));router['get']('/',auth[_0x72cb('0x6')](),controller[_0x72cb('0x7')]);router[_0x72cb('0x8')]('/describe',auth[_0x72cb('0x6')](),controller[_0x72cb('0x9')]);router[_0x72cb('0x8')](_0x72cb('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x72cb('0xb'),auth[_0x72cb('0x6')](),controller['getDispositions']);router[_0x72cb('0x8')]('/:id/canned_answers',auth[_0x72cb('0x6')](),controller[_0x72cb('0xc')]);router[_0x72cb('0x8')]('/:id/logo',controller[_0x72cb('0xd')]);router[_0x72cb('0x8')](_0x72cb('0xe'),controller['getAvatar']);router[_0x72cb('0x8')](_0x72cb('0xf'),controller[_0x72cb('0x10')]);router[_0x72cb('0x8')](_0x72cb('0x11'),controller['getSystemAvatar']);router['get']('/:id/interactions',auth['isAuthenticated'](),controller[_0x72cb('0x12')]);router[_0x72cb('0x8')](_0x72cb('0x13'),controller['getSnippet']);router[_0x72cb('0x8')]('/:id/applications',auth[_0x72cb('0x6')](),controller[_0x72cb('0x14')]);router[_0x72cb('0x8')](_0x72cb('0x15'),auth['isAuthenticated'](),controller[_0x72cb('0x16')]);router[_0x72cb('0x8')](_0x72cb('0x17'),controller[_0x72cb('0x18')]);router[_0x72cb('0x8')](_0x72cb('0x19'),auth[_0x72cb('0x6')](),controller['getOfflineMessages']);router[_0x72cb('0x8')]('/:id/users',auth[_0x72cb('0x6')](),controller[_0x72cb('0x1a')]);router[_0x72cb('0x1b')]('/',auth[_0x72cb('0x6')](),controller[_0x72cb('0x1c')]);router['post'](_0x72cb('0xb'),auth[_0x72cb('0x6')](),controller[_0x72cb('0x1d')]);router[_0x72cb('0x1b')]('/:id/canned_answers',auth[_0x72cb('0x6')](),controller[_0x72cb('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3a77fd,_0x3ddbe0,_0x24e819){_0x24e819(null,path[_0x72cb('0x1f')](config['root'],_0x72cb('0x20')));},'filename':function(_0x8df478,_0x466e9a,_0x383dca){_0x383dca(null,util['format'](_0x72cb('0x21'),Date[_0x72cb('0x22')](),_0x466e9a[_0x72cb('0x23')]));}})});router[_0x72cb('0x1b')](_0x72cb('0x24'),upload[_0x72cb('0x25')]('file'),controller[_0x72cb('0x26')]);var upload=multer({'storage':multer[_0x72cb('0x27')]({'destination':function(_0x4ac6ed,_0x1023db,_0x349e46){_0x349e46(null,path[_0x72cb('0x1f')](config['root'],_0x72cb('0x28')));},'filename':function(_0x339d3c,_0x12821f,_0xd0b144){_0xd0b144(null,util[_0x72cb('0x29')](_0x72cb('0x21'),Date[_0x72cb('0x22')](),_0x12821f[_0x72cb('0x23')]));}})});router[_0x72cb('0x1b')](_0x72cb('0xe'),upload[_0x72cb('0x25')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0x72cb('0x27')]({'destination':function(_0x121ade,_0x4bf9f6,_0x275600){_0x275600(null,path['join'](config[_0x72cb('0x2a')],_0x72cb('0x28')));},'filename':function(_0x5cdf9c,_0x4c7e52,_0xec8a39){_0xec8a39(null,util[_0x72cb('0x29')](_0x72cb('0x21'),Date[_0x72cb('0x22')](),_0x4c7e52['originalname']));}})});router[_0x72cb('0x1b')](_0x72cb('0xf'),upload[_0x72cb('0x25')](_0x72cb('0x2b')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x72cb('0x27')]({'destination':function(_0x7d1bed,_0x193d47,_0x5437a5){_0x5437a5(null,path[_0x72cb('0x1f')](config[_0x72cb('0x2a')],_0x72cb('0x28')));},'filename':function(_0x6b72bb,_0xac6549,_0x4280ff){_0x4280ff(null,util[_0x72cb('0x29')](_0x72cb('0x21'),Date[_0x72cb('0x22')](),_0xac6549[_0x72cb('0x23')]));}})});router[_0x72cb('0x1b')](_0x72cb('0x11'),upload[_0x72cb('0x25')](_0x72cb('0x2b')),controller[_0x72cb('0x2c')]);router[_0x72cb('0x1b')](_0x72cb('0x2d'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x72cb('0x27')]({'destination':function(_0x57fbb6,_0x56736a,_0x587291){const _0x4eed2e=path[_0x72cb('0x1f')](config[_0x72cb('0x2a')],_0x72cb('0x2e'),_0x72cb('0x2f'),_0x72cb('0x30'));fs_extra['ensureDir'](_0x4eed2e,function(){_0x587291(null,_0x4eed2e);});},'filename':function(_0x32c5c0,_0x283f32,_0x4d548d){const _0xcce1b2=_0x283f32[_0x72cb('0x23')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3f6495=path[_0x72cb('0x31')](_0xcce1b2);const _0x14d615=Date[_0x72cb('0x22')]()+'-'+_0xcce1b2['replace'](_0x3f6495,'')+_0x3f6495;_0x4d548d(null,_0x14d615);}})});router[_0x72cb('0x1b')]('/:id/offline',offlineUploadMulter[_0x72cb('0x32')](),controller[_0x72cb('0x33')]);router[_0x72cb('0x1b')]('/:id/interactions',auth[_0x72cb('0x6')](),controller[_0x72cb('0x34')]);router[_0x72cb('0x1b')](_0x72cb('0x35'),auth[_0x72cb('0x6')](),controller[_0x72cb('0x36')]);router['post']('/:id/proactive_actions',auth['isAuthenticated'](),controller['addProactiveActions']);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x72cb('0x37')]('/:id',auth[_0x72cb('0x6')](),controller[_0x72cb('0x38')]);router[_0x72cb('0x39')](_0x72cb('0xa'),auth[_0x72cb('0x6')](),controller[_0x72cb('0x3a')]);router[_0x72cb('0x39')]('/:id/dispositions',auth[_0x72cb('0x6')](),controller[_0x72cb('0x3b')]);router[_0x72cb('0x39')](_0x72cb('0x3c'),auth['isAuthenticated'](),controller[_0x72cb('0x3d')]);router[_0x72cb('0x39')](_0x72cb('0x3e'),auth['isAuthenticated'](),controller[_0x72cb('0x3f')]);module[_0x72cb('0x40')]=router;
\ No newline at end of file
+var _0x40e8=['/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addAnswer','join','root','server/files/images/logos/','format','originalname','single','file','addLogo','diskStorage','now','addAvatar','server/files/images/avatars/','%s-%s','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','notify','server/files','attachments','ensureDir','replace','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields'];(function(_0x37e845,_0x219f9f){var _0x59e55b=function(_0x5dc6c8){while(--_0x5dc6c8){_0x37e845['push'](_0x37e845['shift']());}};_0x59e55b(++_0x219f9f);}(_0x40e8,0x74));var _0x840e=function(_0x4067ac,_0x363603){_0x4067ac=_0x4067ac-0x0;var _0x53d74d=_0x40e8[_0x4067ac];return _0x53d74d;};'use strict';var multer=require(_0x840e('0x0'));var util=require('util');var path=require(_0x840e('0x1'));var timeout=require(_0x840e('0x2'));var express=require(_0x840e('0x3'));var router=express[_0x840e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x840e('0x5'));var interaction=require(_0x840e('0x6'));var config=require(_0x840e('0x7'));var controller=require('./chatWebsite.controller');router[_0x840e('0x8')]('/',auth[_0x840e('0x9')](),controller[_0x840e('0xa')]);router[_0x840e('0x8')]('/describe',auth[_0x840e('0x9')](),controller[_0x840e('0xb')]);router[_0x840e('0x8')](_0x840e('0xc'),auth['isAuthenticated'](),controller[_0x840e('0xd')]);router['get'](_0x840e('0xe'),auth[_0x840e('0x9')](),controller[_0x840e('0xf')]);router['get'](_0x840e('0x10'),auth[_0x840e('0x9')](),controller[_0x840e('0x11')]);router[_0x840e('0x8')](_0x840e('0x12'),controller['getLogo']);router['get'](_0x840e('0x13'),controller[_0x840e('0x14')]);router[_0x840e('0x8')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x840e('0x8')](_0x840e('0x15'),controller['getSystemAvatar']);router[_0x840e('0x8')](_0x840e('0x16'),auth[_0x840e('0x9')](),controller[_0x840e('0x17')]);router[_0x840e('0x8')](_0x840e('0x18'),controller[_0x840e('0x19')]);router[_0x840e('0x8')](_0x840e('0x1a'),auth[_0x840e('0x9')](),controller[_0x840e('0x1b')]);router['get'](_0x840e('0x1c'),auth[_0x840e('0x9')](),controller[_0x840e('0x1d')]);router[_0x840e('0x8')](_0x840e('0x1e'),controller[_0x840e('0x1f')]);router[_0x840e('0x8')](_0x840e('0x20'),auth['isAuthenticated'](),controller[_0x840e('0x21')]);router[_0x840e('0x8')](_0x840e('0x22'),auth['isAuthenticated'](),controller[_0x840e('0x23')]);router['post']('/',auth[_0x840e('0x9')](),controller[_0x840e('0x24')]);router[_0x840e('0x25')]('/:id/dispositions',auth[_0x840e('0x9')](),controller['addDisposition']);router[_0x840e('0x25')](_0x840e('0x10'),auth[_0x840e('0x9')](),controller[_0x840e('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x159950,_0x342627,_0x1ea2e0){_0x1ea2e0(null,path[_0x840e('0x27')](config[_0x840e('0x28')],_0x840e('0x29')));},'filename':function(_0x1c7b75,_0x1f5b1f,_0x2fc83e){_0x2fc83e(null,util[_0x840e('0x2a')]('%s-%s',Date['now'](),_0x1f5b1f[_0x840e('0x2b')]));}})});router['post']('/:id/logo',upload[_0x840e('0x2c')](_0x840e('0x2d')),controller[_0x840e('0x2e')]);var upload=multer({'storage':multer[_0x840e('0x2f')]({'destination':function(_0x590d2d,_0x3daf29,_0x54005a){_0x54005a(null,path[_0x840e('0x27')](config[_0x840e('0x28')],'server/files/images/avatars/'));},'filename':function(_0x45968a,_0x3f48f9,_0xbf6eb1){_0xbf6eb1(null,util[_0x840e('0x2a')]('%s-%s',Date[_0x840e('0x30')](),_0x3f48f9['originalname']));}})});router[_0x840e('0x25')]('/:id/avatar',upload['single'](_0x840e('0x2d')),controller[_0x840e('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x25d594,_0x1203c5,_0x587b65){_0x587b65(null,path['join'](config[_0x840e('0x28')],_0x840e('0x32')));},'filename':function(_0x2f94d2,_0x3dee4a,_0x333f2d){_0x333f2d(null,util['format'](_0x840e('0x33'),Date[_0x840e('0x30')](),_0x3dee4a[_0x840e('0x2b')]));}})});router[_0x840e('0x25')](_0x840e('0x34'),upload['single'](_0x840e('0x2d')),controller[_0x840e('0x35')]);var upload=multer({'storage':multer[_0x840e('0x2f')]({'destination':function(_0x269015,_0x5a8d81,_0x28fddd){_0x28fddd(null,path[_0x840e('0x27')](config[_0x840e('0x28')],_0x840e('0x32')));},'filename':function(_0x432350,_0x3e5608,_0x4412bb){_0x4412bb(null,util['format']('%s-%s',Date[_0x840e('0x30')](),_0x3e5608[_0x840e('0x2b')]));}})});router[_0x840e('0x25')](_0x840e('0x15'),upload['single']('file'),controller[_0x840e('0x36')]);router[_0x840e('0x25')]('/:id/notify',controller[_0x840e('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x840e('0x2f')]({'destination':function(_0x1e6af7,_0x341d02,_0x49b338){const _0x5bad33=path[_0x840e('0x27')](config[_0x840e('0x28')],_0x840e('0x38'),_0x840e('0x39'),'offline-chat');fs_extra[_0x840e('0x3a')](_0x5bad33,function(){_0x49b338(null,_0x5bad33);});},'filename':function(_0x22878f,_0x31e91d,_0x3cbc98){const _0xe1136c=_0x31e91d[_0x840e('0x2b')][_0x840e('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xb08292=path['extname'](_0xe1136c);const _0x193c9c=Date[_0x840e('0x30')]()+'-'+_0xe1136c[_0x840e('0x3b')](_0xb08292,'')+_0xb08292;_0x3cbc98(null,_0x193c9c);}})});router[_0x840e('0x25')](_0x840e('0x3c'),offlineUploadMulter[_0x840e('0x3d')](),controller[_0x840e('0x3e')]);router[_0x840e('0x25')](_0x840e('0x16'),auth['isAuthenticated'](),controller[_0x840e('0x3f')]);router[_0x840e('0x25')](_0x840e('0x1a'),auth[_0x840e('0x9')](),controller[_0x840e('0x40')]);router['post']('/:id/proactive_actions',auth[_0x840e('0x9')](),controller[_0x840e('0x41')]);router[_0x840e('0x25')]('/:id/users',auth[_0x840e('0x9')](),controller[_0x840e('0x42')]);router[_0x840e('0x43')](_0x840e('0xc'),auth[_0x840e('0x9')](),controller[_0x840e('0x44')]);router[_0x840e('0x45')](_0x840e('0xc'),auth['isAuthenticated'](),controller[_0x840e('0x46')]);router[_0x840e('0x45')]('/:id/dispositions',auth[_0x840e('0x9')](),controller[_0x840e('0x47')]);router[_0x840e('0x45')](_0x840e('0x10'),auth[_0x840e('0x9')](),controller[_0x840e('0x48')]);router[_0x840e('0x45')](_0x840e('0x22'),auth[_0x840e('0x9')](),controller[_0x840e('0x49')]);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 22a4f10..c934aec 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 _0x84f9=['env','app','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','beaver-logger/server','express','../components/auth/service','Router'];(function(_0x5ad358,_0x342f88){var _0x190226=function(_0x3c7ead){while(--_0x3c7ead){_0x5ad358['push'](_0x5ad358['shift']());}};_0x190226(++_0x342f88);}(_0x84f9,0x13b));var _0x984f=function(_0x46275a,_0x157c56){_0x46275a=_0x46275a-0x0;var _0x1b6b39=_0x84f9[_0x46275a];return _0x1b6b39;};var beaverLogger=require(_0x984f('0x0'));var express=require(_0x984f('0x1'));var auth=require(_0x984f('0x2'));var config=require('../config/environment');var router=express[_0x984f('0x3')]();var isProduction=config[_0x984f('0x4')]==='production'||![];function clientSideLogs(_0x170a9a,_0x1b4238,_0x2c65f2){var _0x225b2c=_0x170a9a[_0x984f('0x5')][_0x984f('0x6')]('client-side-logger');if(!_0x225b2c){throw new Error(_0x984f('0x7'));}return beaverLogger[_0x984f('0x8')]({'uri':'/client-logs','logger':_0x225b2c,'enableCors':!isProduction})(_0x170a9a,_0x1b4238,_0x2c65f2);}router[_0x984f('0x9')](auth[_0x984f('0xa')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0x55e8=['use','isAuthenticated','../config/environment','Router','env','production','app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55e8,0xe9));var _0x855e=function(_0x50849b,_0x4fe986){_0x50849b=_0x50849b-0x0;var _0x3c5f2a=_0x55e8[_0x50849b];return _0x3c5f2a;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require('../components/auth/service');var config=require(_0x855e('0x0'));var router=express[_0x855e('0x1')]();var isProduction=config[_0x855e('0x2')]===_0x855e('0x3')||![];function clientSideLogs(_0x107649,_0x3e8802,_0x4d590f){var _0x4687e9=_0x107649[_0x855e('0x4')]['get'](_0x855e('0x5'));if(!_0x4687e9){throw new Error(_0x855e('0x6'));}return beaverLogger[_0x855e('0x7')]({'uri':_0x855e('0x8'),'logger':_0x4687e9,'enableCors':!isProduction})(_0x107649,_0x3e8802,_0x4d590f);}router[_0x855e('0x9')](auth[_0x855e('0xa')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index e28a0e1..02fdab3 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 _0x9165=['MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant'];(function(_0x16d2c3,_0x3ca212){var _0x538674=function(_0x549e0b){while(--_0x549e0b){_0x16d2c3['push'](_0x16d2c3['shift']());}};_0x538674(++_0x3ca212);}(_0x9165,0x17e));var _0x5916=function(_0x3dbce7,_0x1756dd){_0x3dbce7=_0x3dbce7-0x0;var _0x226f10=_0x9165[_0x3dbce7];return _0x226f10;};'use strict';var Sequelize=require('sequelize');module[_0x5916('0x0')]={'name':{'type':Sequelize[_0x5916('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x5916('0x2')](_0x5916('0x3'),'Google',_0x5916('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x5916('0x2')](_0x5916('0x5'),'Dynamics365')},'data1':{'type':Sequelize[_0x5916('0x1')],'comment':_0x5916('0x6')},'data2':{'type':Sequelize[_0x5916('0x1')],'comment':_0x5916('0x7')},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':_0x5916('0x8')},'data5':{'type':Sequelize[_0x5916('0x9')],'comment':_0x5916('0xa')},'data6':{'type':Sequelize[_0x5916('0x9')],'comment':_0x5916('0xb')},'data7':{'type':Sequelize[_0x5916('0x9')],'comment':_0x5916('0xc')}};
\ No newline at end of file
+var _0x54b2=['STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','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'];(function(_0xd911fc,_0x34372f){var _0x531b21=function(_0x23efca){while(--_0x23efca){_0xd911fc['push'](_0xd911fc['shift']());}};_0x531b21(++_0x34372f);}(_0x54b2,0xa6));var _0x254b=function(_0x4add46,_0x40c151){_0x4add46=_0x4add46-0x0;var _0x13fe3d=_0x54b2[_0x4add46];return _0x13fe3d;};'use strict';var Sequelize=require(_0x254b('0x0'));module[_0x254b('0x1')]={'name':{'type':Sequelize[_0x254b('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x254b('0x3')](_0x254b('0x4'),_0x254b('0x5'),_0x254b('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x254b('0x7'),'Dynamics365')},'data1':{'type':Sequelize[_0x254b('0x2')],'comment':_0x254b('0x8')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x254b('0x2')],'comment':_0x254b('0x9')},'data4':{'type':Sequelize[_0x254b('0x2')],'comment':_0x254b('0xa')},'data5':{'type':Sequelize[_0x254b('0xb')],'comment':_0x254b('0xc')},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x254b('0xb')],'comment':_0x254b('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index cd50272..5a87b87 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 _0x6881=['catch','update','MicrosoftAzure','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','base64','toString','ascii','parse','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','status','end','json','undefined','limit','count','offset','set','Content-Range','destroy','sendStatus','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','then','includeAll','findAll','rows','service','decryptString','data3','show','params','keys','include','options','find','body','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x6881,0x139));var _0x1688=function(_0xbcb35c,_0x927e24){_0xbcb35c=_0xbcb35c-0x0;var _0x47702d=_0x6881[_0xbcb35c];return _0x47702d;};'use strict';var _=require(_0x1688('0x0'));var Redis=require(_0x1688('0x1'));var qs=require(_0x1688('0x2'));var encryptor=require(_0x1688('0x3'));var config=require(_0x1688('0x4'));var logger=require('../../config/logger')('api');var db=require(_0x1688('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_[_0x1688('0x6')](config[_0x1688('0x7')],{'host':_0x1688('0x8'),'port':0x18eb});var socket=require(_0x1688('0x9'))(new Redis(config[_0x1688('0x7')]));var redis=new Redis(config[_0x1688('0x7')]);function respondWithStatusCode(_0x21b2f5,_0x4f0016){_0x4f0016=_0x4f0016||0xcc;return function(_0x3cce22){if(_0x3cce22){return _0x21b2f5['sendStatus'](_0x4f0016);}return _0x21b2f5[_0x1688('0xa')](_0x4f0016)[_0x1688('0xb')]();};}function respondWithResult(_0x328f70,_0x276baa){_0x276baa=_0x276baa||0xc8;return function(_0x2137c6){if(_0x2137c6){return _0x328f70[_0x1688('0xa')](_0x276baa)[_0x1688('0xc')](_0x2137c6);}};}function respondWithFilteredResult(_0x1d5a2e,_0x19e16b){return function(_0x2b8c30){if(_0x2b8c30){var _0x3fcfb8=typeof _0x19e16b['offset']===_0x1688('0xd')&&typeof _0x19e16b[_0x1688('0xe')]===_0x1688('0xd');var _0x2c0332=_0x2b8c30[_0x1688('0xf')];var _0x11e61b=_0x3fcfb8?0x0:_0x19e16b['offset'];var _0x38a364=_0x3fcfb8?_0x2b8c30[_0x1688('0xf')]:_0x19e16b[_0x1688('0x10')]+_0x19e16b[_0x1688('0xe')];var _0x407fec;if(_0x38a364>=_0x2c0332){_0x38a364=_0x2c0332;_0x407fec=0xc8;}else{_0x407fec=0xce;}_0x1d5a2e[_0x1688('0xa')](_0x407fec);return _0x1d5a2e[_0x1688('0x11')](_0x1688('0x12'),_0x11e61b+'-'+_0x38a364+'/'+_0x2c0332)[_0x1688('0xc')](_0x2b8c30);}return null;};}function saveUpdates(_0x244148){return function(_0x3ae22a){if(_0x3ae22a){return _0x3ae22a['update'](_0x244148)['then'](function(_0x4f92be){return _0x4f92be;});}return null;};}function removeEntity(_0x3af8ad){return function(_0x354ce0){if(_0x354ce0){return _0x354ce0[_0x1688('0x13')]()['then'](function(){_0x3af8ad[_0x1688('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33694a){return function(_0x2029aa){if(!_0x2029aa){_0x33694a[_0x1688('0x14')](0x194);}return _0x2029aa;};}function handleError(_0x2242c7,_0x5a8969){_0x5a8969=_0x5a8969||0x1f4;return function(_0xc45f65){logger[_0x1688('0x15')](_0xc45f65[_0x1688('0x16')]);if(_0xc45f65[_0x1688('0x17')]){delete _0xc45f65[_0x1688('0x17')];}_0x2242c7['status'](_0x5a8969)[_0x1688('0x18')](_0xc45f65);};}function maskClientSecret(_0x12f37d){return _[_0x1688('0x19')](_0x12f37d[_0x1688('0x1a')](0x0,0x3),0x14,'*');}exports[_0x1688('0x1b')]=function(_0xab4d08,_0x4cc549){var _0x31315c={},_0x261336={},_0x4f6dbb={'count':0x0,'rows':[]};var _0xa5fcde=_[_0x1688('0x1c')](db[_0x1688('0x1d')][_0x1688('0x1e')],function(_0x5569a5){return{'name':_0x5569a5[_0x1688('0x1f')],'type':_0x5569a5[_0x1688('0x20')][_0x1688('0x21')]};});_0x261336[_0x1688('0x22')]=_['map'](_0xa5fcde,_0x1688('0x17'));_0x261336[_0x1688('0x23')]=_['keys'](_0xab4d08[_0x1688('0x23')]);_0x261336[_0x1688('0x24')]=_[_0x1688('0x25')](_0x261336[_0x1688('0x22')],_0x261336[_0x1688('0x23')]);_0x31315c[_0x1688('0x26')]=_[_0x1688('0x25')](_0x261336[_0x1688('0x22')],qs[_0x1688('0x27')](_0xab4d08[_0x1688('0x23')][_0x1688('0x27')]));_0x31315c[_0x1688('0x26')]=_0x31315c[_0x1688('0x26')][_0x1688('0x28')]?_0x31315c[_0x1688('0x26')]:_0x261336[_0x1688('0x22')];if(!_0xab4d08[_0x1688('0x23')]['hasOwnProperty'](_0x1688('0x29'))){_0x31315c[_0x1688('0xe')]=qs[_0x1688('0xe')](_0xab4d08[_0x1688('0x23')][_0x1688('0xe')]);_0x31315c[_0x1688('0x10')]=qs[_0x1688('0x10')](_0xab4d08[_0x1688('0x23')][_0x1688('0x10')]);}_0x31315c[_0x1688('0x2a')]=qs[_0x1688('0x2b')](_0xab4d08[_0x1688('0x23')][_0x1688('0x2b')]);_0x31315c[_0x1688('0x2c')]=qs[_0x1688('0x24')](_[_0x1688('0x2d')](_0xab4d08[_0x1688('0x23')],_0x261336[_0x1688('0x24')]),_0xa5fcde);if(_0xab4d08['query']['filter']){_0x31315c['where']=_[_0x1688('0x2e')](_0x31315c[_0x1688('0x2c')],{'$or':_['map'](_0xa5fcde,function(_0x52eb43){if(_0x52eb43[_0x1688('0x20')]!==_0x1688('0x2f')){var _0x2d1075={};_0x2d1075[_0x52eb43['name']]={'$like':'%'+_0xab4d08[_0x1688('0x23')][_0x1688('0x30')]+'%'};return _0x2d1075;}})});}_0x31315c=_[_0x1688('0x2e')]({},_0x31315c,_0xab4d08['options']);var _0x184d44={'where':_0x31315c[_0x1688('0x2c')]};return db[_0x1688('0x1d')]['count'](_0x184d44)[_0x1688('0x31')](function(_0x50e1b7){_0x4f6dbb[_0x1688('0xf')]=_0x50e1b7;if(_0xab4d08[_0x1688('0x23')][_0x1688('0x32')]){_0x31315c['include']=[{'all':!![]}];}return db[_0x1688('0x1d')][_0x1688('0x33')](_0x31315c);})[_0x1688('0x31')](function(_0x282a74){_0x4f6dbb[_0x1688('0x34')]=_[_0x1688('0x1c')](_0x282a74,function(_0x181d61){if(_0x181d61[_0x1688('0x35')]==='MicrosoftAzure'){var _0x2f1639=encryptor[_0x1688('0x36')](_0x181d61[_0x1688('0x37')]);_0x181d61[_0x1688('0x37')]=maskClientSecret(_0x2f1639);}return _0x181d61;});return _0x4f6dbb;})[_0x1688('0x31')](respondWithFilteredResult(_0x4cc549,_0x31315c))['catch'](handleError(_0x4cc549,null));};exports[_0x1688('0x38')]=function(_0x338136,_0x35d702){var _0x49e3d0={'raw':!![],'where':{'id':_0x338136[_0x1688('0x39')]['id']}},_0xeaf9cb={};_0xeaf9cb[_0x1688('0x22')]=_[_0x1688('0x3a')](db['CloudProvider'][_0x1688('0x1e')]);_0xeaf9cb[_0x1688('0x23')]=_['keys'](_0x338136[_0x1688('0x23')]);_0xeaf9cb[_0x1688('0x24')]=_['intersection'](_0xeaf9cb[_0x1688('0x22')],_0xeaf9cb[_0x1688('0x23')]);_0x49e3d0[_0x1688('0x26')]=_[_0x1688('0x25')](_0xeaf9cb[_0x1688('0x22')],qs[_0x1688('0x27')](_0x338136['query'][_0x1688('0x27')]));_0x49e3d0[_0x1688('0x26')]=_0x49e3d0[_0x1688('0x26')][_0x1688('0x28')]?_0x49e3d0[_0x1688('0x26')]:_0xeaf9cb['model'];if(_0x338136[_0x1688('0x23')]['includeAll']){_0x49e3d0[_0x1688('0x3b')]=[{'all':!![]}];}_0x49e3d0=_[_0x1688('0x2e')]({},_0x49e3d0,_0x338136[_0x1688('0x3c')]);return db[_0x1688('0x1d')][_0x1688('0x3d')](_0x49e3d0)['then'](handleEntityNotFound(_0x35d702,null))[_0x1688('0x31')](function(_0x3074e3){if(_0x3074e3[_0x1688('0x35')]==='MicrosoftAzure'){var _0x3d84d6=encryptor[_0x1688('0x36')](_0x3074e3[_0x1688('0x37')]);_0x3074e3[_0x1688('0x37')]=maskClientSecret(_0x3d84d6);}return _0x3074e3;})['then'](respondWithResult(_0x35d702,null))['catch'](handleError(_0x35d702,null));};exports['create']=function(_0x1c2c74,_0x5adb3d){if(!_0x1c2c74['body'][_0x1688('0x17')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x1c2c74[_0x1688('0x3e')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x28aa89=db[_0x1688('0x1d')][_0x1688('0x1e')][_0x1688('0x35')]['values'];if(!_0x28aa89['includes'](_0x1c2c74[_0x1688('0x3e')]['service']))throw new Error(_0x1688('0x3f')+_0x28aa89[_0x1688('0x40')](',\x20'));if(_0x1c2c74[_0x1688('0x3e')]['service']==='MicrosoftAzure'&&_0x1c2c74[_0x1688('0x3e')]['data3']){_0x1c2c74[_0x1688('0x3e')][_0x1688('0x37')]=encryptor[_0x1688('0x41')](_0x1c2c74['body']['data3']);}return db[_0x1688('0x1d')][_0x1688('0x42')](_0x1c2c74[_0x1688('0x3e')],{})[_0x1688('0x31')](respondWithResult(_0x5adb3d,0xc9))[_0x1688('0x43')](handleError(_0x5adb3d,null));};exports[_0x1688('0x44')]=function(_0x390483,_0x280c90){if(_0x390483[_0x1688('0x3e')]['id']){delete _0x390483[_0x1688('0x3e')]['id'];}return db[_0x1688('0x1d')]['find']({'where':{'id':_0x390483[_0x1688('0x39')]['id']}})[_0x1688('0x31')](handleEntityNotFound(_0x280c90,null))[_0x1688('0x31')](function(_0x4c32ff){if(_0x4c32ff[_0x1688('0x35')]===_0x1688('0x45')&&_0x390483[_0x1688('0x3e')][_0x1688('0x37')]){_0x390483[_0x1688('0x3e')][_0x1688('0x37')]=encryptor[_0x1688('0x41')](_0x390483[_0x1688('0x3e')][_0x1688('0x37')]);}return _0x4c32ff;})[_0x1688('0x31')](saveUpdates(_0x390483[_0x1688('0x3e')],null))['then'](respondWithResult(_0x280c90,null))['catch'](handleError(_0x280c90,null));};exports[_0x1688('0x13')]=function(_0x13ddff,_0x471627){return db[_0x1688('0x1d')][_0x1688('0x3d')]({'where':{'id':_0x13ddff[_0x1688('0x39')]['id']}})[_0x1688('0x31')](handleEntityNotFound(_0x471627,null))['then'](removeEntity(_0x471627,null))[_0x1688('0x43')](handleError(_0x471627,null));};exports[_0x1688('0x46')]=function(_0x547c97,_0x1f7ab0){return db[_0x1688('0x1d')][_0x1688('0x47')]({'where':{'id':_0x547c97[_0x1688('0x39')]['id']},'raw':!![]})['then'](function(_0x4c4ff5){if(!_0x4c4ff5)return _0x1f7ab0[_0x1688('0x14')](0x194);return{'url':oauth[_0x1688('0x48')](_0x4c4ff5,_0x547c97[_0x1688('0x49')]['id'])};})['then'](respondWithResult(_0x1f7ab0,null))[_0x1688('0x43')](handleError(_0x1f7ab0,null));};exports[_0x1688('0x4a')]=function(_0x5e7b2e,_0x26b9c3){var _0x438352=_0x5e7b2e[_0x1688('0x3e')];var _0x16c586;var _0x4186fc;if(_0x438352[_0x1688('0x15')])throw _0x438352;redis[_0x1688('0x4b')](_0x438352[_0x1688('0x4c')])[_0x1688('0x31')](function(_0x53dca6){if(!_0x53dca6)throw new Error('Invalid\x20state\x20parameter');_0x16c586=JSON['parse'](_0x53dca6);var _0x622553=Buffer['from'](_0x438352[_0x1688('0x4c')],_0x1688('0x4d'))[_0x1688('0x4e')](_0x1688('0x4f'));_0x4186fc=JSON[_0x1688('0x50')](_0x622553);if(!oauth['isValidIdToken'](_0x438352['id_token'],_0x16c586[_0x1688('0x51')]))throw new Error(_0x1688('0x52'));redis[_0x1688('0x53')](_0x438352[_0x1688('0x4c')]);return oauth[_0x1688('0x54')](_0x438352[_0x1688('0x55')],_0x16c586);})[_0x1688('0x31')](function(_0x235f0a){_0x16c586['data5']=_0x235f0a['access_token'];_0x16c586[_0x1688('0x56')]=_0x235f0a[_0x1688('0x57')];return db[_0x1688('0x1d')][_0x1688('0x44')]({'data5':_0x16c586[_0x1688('0x58')],'data6':_0x16c586[_0x1688('0x56')]},{'where':{'id':_0x16c586['id']}});})[_0x1688('0x31')](function(){oauth[_0x1688('0x59')](_0x16c586);socket['emit']('microsoftAuthorization:success',{'id':_0x4186fc['id']});return;})[_0x1688('0x31')](respondWithStatusCode(_0x26b9c3,null))[_0x1688('0x43')](function(_0x17f86f){if(_0x4186fc){socket[_0x1688('0x5a')](_0x1688('0x5b'),{'id':_0x4186fc['id']});}if(!_0x16c586){logger[_0x1688('0x15')](_0x1688('0x5c'),_0x17f86f);return _0x26b9c3[_0x1688('0xa')](0x1f4)[_0x1688('0x18')](_0x17f86f['message']);}logger[_0x1688('0x15')](_0x1688('0x5d'),_0x16c586['id'],JSON[_0x1688('0x5e')](_0x17f86f));});};
\ No newline at end of file
+var _0x91f3=['filter','merge','VIRTUAL','options','where','includeAll','findAll','rows','service','MicrosoftAzure','decryptString','data3','show','params','find','create','Service\x20parameter\x20not\x20specified','body','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','catch','encryptString','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','toString','ascii','id_token','Unable\x20to\x20validate\x20id_token','code','data5','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','limit','count','set','Content-Range','json','update','destroy','then','error','stack','send','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort'];(function(_0x5d9ceb,_0x1a49f5){var _0x33ce82=function(_0x583915){while(--_0x583915){_0x5d9ceb['push'](_0x5d9ceb['shift']());}};_0x33ce82(++_0x1a49f5);}(_0x91f3,0x13c));var _0x391f=function(_0x598efc,_0x5e971c){_0x598efc=_0x598efc-0x0;var _0x435e4f=_0x91f3[_0x598efc];return _0x435e4f;};'use strict';var _=require(_0x391f('0x0'));var Redis=require(_0x391f('0x1'));var qs=require(_0x391f('0x2'));var encryptor=require(_0x391f('0x3'));var config=require(_0x391f('0x4'));var logger=require(_0x391f('0x5'))('api');var db=require(_0x391f('0x6'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x391f('0x7')]=_['defaults'](config[_0x391f('0x7')],{'host':_0x391f('0x8'),'port':0x18eb});var socket=require(_0x391f('0x9'))(new Redis(config['redis']));var redis=new Redis(config[_0x391f('0x7')]);function respondWithStatusCode(_0x20f60e,_0x32b3bc){_0x32b3bc=_0x32b3bc||0xcc;return function(_0xc568d8){if(_0xc568d8){return _0x20f60e[_0x391f('0xa')](_0x32b3bc);}return _0x20f60e[_0x391f('0xb')](_0x32b3bc)[_0x391f('0xc')]();};}function respondWithResult(_0x3871dd,_0x51bd71){_0x51bd71=_0x51bd71||0xc8;return function(_0x56b8db){if(_0x56b8db){return _0x3871dd['status'](_0x51bd71)['json'](_0x56b8db);}};}function respondWithFilteredResult(_0x59c2e1,_0x479452){return function(_0x57ab95){if(_0x57ab95){var _0x20d0db=typeof _0x479452[_0x391f('0xd')]==='undefined'&&typeof _0x479452[_0x391f('0xe')]==='undefined';var _0x1c93d3=_0x57ab95[_0x391f('0xf')];var _0x673393=_0x20d0db?0x0:_0x479452[_0x391f('0xd')];var _0x30589a=_0x20d0db?_0x57ab95[_0x391f('0xf')]:_0x479452['offset']+_0x479452[_0x391f('0xe')];var _0x1a8891;if(_0x30589a>=_0x1c93d3){_0x30589a=_0x1c93d3;_0x1a8891=0xc8;}else{_0x1a8891=0xce;}_0x59c2e1[_0x391f('0xb')](_0x1a8891);return _0x59c2e1[_0x391f('0x10')](_0x391f('0x11'),_0x673393+'-'+_0x30589a+'/'+_0x1c93d3)[_0x391f('0x12')](_0x57ab95);}return null;};}function saveUpdates(_0x4d17f3){return function(_0xaa9a80){if(_0xaa9a80){return _0xaa9a80[_0x391f('0x13')](_0x4d17f3)['then'](function(_0xe45580){return _0xe45580;});}return null;};}function removeEntity(_0x788a3){return function(_0x19f5aa){if(_0x19f5aa){return _0x19f5aa[_0x391f('0x14')]()[_0x391f('0x15')](function(){_0x788a3[_0x391f('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40c522){return function(_0x5322f0){if(!_0x5322f0){_0x40c522[_0x391f('0xa')](0x194);}return _0x5322f0;};}function handleError(_0x3ddd2b,_0x5e0d95){_0x5e0d95=_0x5e0d95||0x1f4;return function(_0xb3a4c9){logger[_0x391f('0x16')](_0xb3a4c9[_0x391f('0x17')]);if(_0xb3a4c9['name']){delete _0xb3a4c9['name'];}_0x3ddd2b[_0x391f('0xb')](_0x5e0d95)[_0x391f('0x18')](_0xb3a4c9);};}function maskClientSecret(_0x428f32){return _['padEnd'](_0x428f32['slice'](0x0,0x3),0x14,'*');}exports[_0x391f('0x19')]=function(_0x5d179b,_0x57e96a){var _0x565699={},_0xfcadec={},_0xc6622e={'count':0x0,'rows':[]};var _0x713a07=_[_0x391f('0x1a')](db[_0x391f('0x1b')][_0x391f('0x1c')],function(_0x1f87c9){return{'name':_0x1f87c9[_0x391f('0x1d')],'type':_0x1f87c9[_0x391f('0x1e')][_0x391f('0x1f')]};});_0xfcadec[_0x391f('0x20')]=_[_0x391f('0x1a')](_0x713a07,_0x391f('0x21'));_0xfcadec[_0x391f('0x22')]=_[_0x391f('0x23')](_0x5d179b[_0x391f('0x22')]);_0xfcadec[_0x391f('0x24')]=_[_0x391f('0x25')](_0xfcadec['model'],_0xfcadec[_0x391f('0x22')]);_0x565699[_0x391f('0x26')]=_[_0x391f('0x25')](_0xfcadec[_0x391f('0x20')],qs[_0x391f('0x27')](_0x5d179b[_0x391f('0x22')][_0x391f('0x27')]));_0x565699[_0x391f('0x26')]=_0x565699[_0x391f('0x26')][_0x391f('0x28')]?_0x565699[_0x391f('0x26')]:_0xfcadec['model'];if(!_0x5d179b['query']['hasOwnProperty'](_0x391f('0x29'))){_0x565699[_0x391f('0xe')]=qs[_0x391f('0xe')](_0x5d179b['query'][_0x391f('0xe')]);_0x565699[_0x391f('0xd')]=qs[_0x391f('0xd')](_0x5d179b[_0x391f('0x22')]['offset']);}_0x565699[_0x391f('0x2a')]=qs[_0x391f('0x2b')](_0x5d179b[_0x391f('0x22')][_0x391f('0x2b')]);_0x565699['where']=qs[_0x391f('0x24')](_['pick'](_0x5d179b[_0x391f('0x22')],_0xfcadec[_0x391f('0x24')]),_0x713a07);if(_0x5d179b[_0x391f('0x22')][_0x391f('0x2c')]){_0x565699['where']=_[_0x391f('0x2d')](_0x565699['where'],{'$or':_[_0x391f('0x1a')](_0x713a07,function(_0x50721a){if(_0x50721a['type']!==_0x391f('0x2e')){var _0x44295f={};_0x44295f[_0x50721a['name']]={'$like':'%'+_0x5d179b[_0x391f('0x22')][_0x391f('0x2c')]+'%'};return _0x44295f;}})});}_0x565699=_[_0x391f('0x2d')]({},_0x565699,_0x5d179b[_0x391f('0x2f')]);var _0x591564={'where':_0x565699[_0x391f('0x30')]};return db[_0x391f('0x1b')][_0x391f('0xf')](_0x591564)['then'](function(_0x4ed686){_0xc6622e[_0x391f('0xf')]=_0x4ed686;if(_0x5d179b[_0x391f('0x22')][_0x391f('0x31')]){_0x565699['include']=[{'all':!![]}];}return db[_0x391f('0x1b')][_0x391f('0x32')](_0x565699);})[_0x391f('0x15')](function(_0x2cd325){_0xc6622e[_0x391f('0x33')]=_[_0x391f('0x1a')](_0x2cd325,function(_0x449ba9){if(_0x449ba9[_0x391f('0x34')]===_0x391f('0x35')){var _0x2a75d1=encryptor[_0x391f('0x36')](_0x449ba9['data3']);_0x449ba9[_0x391f('0x37')]=maskClientSecret(_0x2a75d1);}return _0x449ba9;});return _0xc6622e;})[_0x391f('0x15')](respondWithFilteredResult(_0x57e96a,_0x565699))['catch'](handleError(_0x57e96a,null));};exports[_0x391f('0x38')]=function(_0x5c883e,_0x5cd244){var _0x43a6f9={'raw':!![],'where':{'id':_0x5c883e[_0x391f('0x39')]['id']}},_0x553006={};_0x553006[_0x391f('0x20')]=_[_0x391f('0x23')](db[_0x391f('0x1b')][_0x391f('0x1c')]);_0x553006['query']=_[_0x391f('0x23')](_0x5c883e[_0x391f('0x22')]);_0x553006[_0x391f('0x24')]=_['intersection'](_0x553006['model'],_0x553006[_0x391f('0x22')]);_0x43a6f9[_0x391f('0x26')]=_[_0x391f('0x25')](_0x553006[_0x391f('0x20')],qs[_0x391f('0x27')](_0x5c883e[_0x391f('0x22')][_0x391f('0x27')]));_0x43a6f9['attributes']=_0x43a6f9['attributes'][_0x391f('0x28')]?_0x43a6f9[_0x391f('0x26')]:_0x553006[_0x391f('0x20')];if(_0x5c883e[_0x391f('0x22')]['includeAll']){_0x43a6f9['include']=[{'all':!![]}];}_0x43a6f9=_[_0x391f('0x2d')]({},_0x43a6f9,_0x5c883e['options']);return db[_0x391f('0x1b')][_0x391f('0x3a')](_0x43a6f9)[_0x391f('0x15')](handleEntityNotFound(_0x5cd244,null))[_0x391f('0x15')](function(_0x1f9ae4){if(_0x1f9ae4[_0x391f('0x34')]===_0x391f('0x35')){var _0x20c4d3=encryptor[_0x391f('0x36')](_0x1f9ae4[_0x391f('0x37')]);_0x1f9ae4[_0x391f('0x37')]=maskClientSecret(_0x20c4d3);}return _0x1f9ae4;})[_0x391f('0x15')](respondWithResult(_0x5cd244,null))['catch'](handleError(_0x5cd244,null));};exports[_0x391f('0x3b')]=function(_0x352d2c,_0x541ba3){if(!_0x352d2c['body'][_0x391f('0x21')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x352d2c['body'][_0x391f('0x34')])throw new Error(_0x391f('0x3c'));var _0xeff2ec=db[_0x391f('0x1b')]['rawAttributes'][_0x391f('0x34')]['values'];if(!_0xeff2ec['includes'](_0x352d2c[_0x391f('0x3d')][_0x391f('0x34')]))throw new Error(_0x391f('0x3e')+_0xeff2ec[_0x391f('0x3f')](',\x20'));if(_0x352d2c[_0x391f('0x3d')][_0x391f('0x34')]===_0x391f('0x35')&&_0x352d2c[_0x391f('0x3d')][_0x391f('0x37')]){_0x352d2c['body'][_0x391f('0x37')]=encryptor['encryptString'](_0x352d2c[_0x391f('0x3d')][_0x391f('0x37')]);}return db[_0x391f('0x1b')][_0x391f('0x3b')](_0x352d2c[_0x391f('0x3d')],{})[_0x391f('0x15')](respondWithResult(_0x541ba3,0xc9))[_0x391f('0x40')](handleError(_0x541ba3,null));};exports[_0x391f('0x13')]=function(_0x1d7bc4,_0x19b9cd){if(_0x1d7bc4[_0x391f('0x3d')]['id']){delete _0x1d7bc4['body']['id'];}return db[_0x391f('0x1b')][_0x391f('0x3a')]({'where':{'id':_0x1d7bc4['params']['id']}})[_0x391f('0x15')](handleEntityNotFound(_0x19b9cd,null))[_0x391f('0x15')](function(_0x255775){if(_0x255775[_0x391f('0x34')]===_0x391f('0x35')&&_0x1d7bc4[_0x391f('0x3d')][_0x391f('0x37')]){_0x1d7bc4[_0x391f('0x3d')][_0x391f('0x37')]=encryptor[_0x391f('0x41')](_0x1d7bc4[_0x391f('0x3d')]['data3']);}return _0x255775;})[_0x391f('0x15')](saveUpdates(_0x1d7bc4[_0x391f('0x3d')],null))[_0x391f('0x15')](respondWithResult(_0x19b9cd,null))[_0x391f('0x40')](handleError(_0x19b9cd,null));};exports[_0x391f('0x14')]=function(_0x3a345e,_0x51613c){return db[_0x391f('0x1b')][_0x391f('0x3a')]({'where':{'id':_0x3a345e[_0x391f('0x39')]['id']}})[_0x391f('0x15')](handleEntityNotFound(_0x51613c,null))[_0x391f('0x15')](removeEntity(_0x51613c,null))['catch'](handleError(_0x51613c,null));};exports[_0x391f('0x42')]=function(_0x55686e,_0x541bc5){return db['CloudProvider'][_0x391f('0x43')]({'where':{'id':_0x55686e[_0x391f('0x39')]['id']},'raw':!![]})[_0x391f('0x15')](function(_0x268bff){if(!_0x268bff)return _0x541bc5['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x268bff,_0x55686e[_0x391f('0x44')]['id'])};})['then'](respondWithResult(_0x541bc5,null))[_0x391f('0x40')](handleError(_0x541bc5,null));};exports[_0x391f('0x45')]=function(_0x2e0aba,_0x295c6f){var _0x3b6296=_0x2e0aba[_0x391f('0x3d')];var _0x35b4dd;var _0x592270;if(_0x3b6296['error'])throw _0x3b6296;redis[_0x391f('0x46')](_0x3b6296[_0x391f('0x47')])['then'](function(_0x1235af){if(!_0x1235af)throw new Error(_0x391f('0x48'));_0x35b4dd=JSON[_0x391f('0x49')](_0x1235af);var _0x3de730=Buffer[_0x391f('0x4a')](_0x3b6296[_0x391f('0x47')],'base64')[_0x391f('0x4b')](_0x391f('0x4c'));_0x592270=JSON['parse'](_0x3de730);if(!oauth['isValidIdToken'](_0x3b6296[_0x391f('0x4d')],_0x35b4dd['oauth2Claims']))throw new Error(_0x391f('0x4e'));redis['del'](_0x3b6296[_0x391f('0x47')]);return oauth['getOauth2MicrosoftAccessToken'](_0x3b6296[_0x391f('0x4f')],_0x35b4dd);})['then'](function(_0x11341f){_0x35b4dd[_0x391f('0x50')]=_0x11341f[_0x391f('0x51')];_0x35b4dd[_0x391f('0x52')]=_0x11341f['refresh_token'];return db['CloudProvider'][_0x391f('0x13')]({'data5':_0x35b4dd[_0x391f('0x50')],'data6':_0x35b4dd[_0x391f('0x52')]},{'where':{'id':_0x35b4dd['id']}});})[_0x391f('0x15')](function(){oauth[_0x391f('0x53')](_0x35b4dd);socket[_0x391f('0x54')]('microsoftAuthorization:success',{'id':_0x592270['id']});return;})[_0x391f('0x15')](respondWithStatusCode(_0x295c6f,null))[_0x391f('0x40')](function(_0x3d65a7){if(_0x592270){socket['emit'](_0x391f('0x55'),{'id':_0x592270['id']});}if(!_0x35b4dd){logger[_0x391f('0x16')](_0x391f('0x56'),_0x3d65a7);return _0x295c6f['status'](0x1f4)['send'](_0x3d65a7[_0x391f('0x57')]);}logger[_0x391f('0x16')](_0x391f('0x58'),_0x35b4dd['id'],JSON[_0x391f('0x59')](_0x3d65a7));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 8a4ab20..08fe68b 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 _0x270a=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','cloud_providers','lodash'];(function(_0x349ccf,_0x5a0a91){var _0x4b393b=function(_0x55f068){while(--_0x55f068){_0x349ccf['push'](_0x349ccf['shift']());}};_0x4b393b(++_0x5a0a91);}(_0x270a,0x11d));var _0xa270=function(_0x57c96a,_0x24f6f2){_0x57c96a=_0x57c96a-0x0;var _0x33a849=_0x270a[_0x57c96a];return _0x33a849;};'use strict';var _=require(_0xa270('0x0'));var util=require(_0xa270('0x1'));var logger=require(_0xa270('0x2'))('api');var moment=require(_0xa270('0x3'));var BPromise=require(_0xa270('0x4'));var rp=require(_0xa270('0x5'));var fs=require('fs');var path=require(_0xa270('0x6'));var rimraf=require('rimraf');var config=require(_0xa270('0x7'));var attributes=require(_0xa270('0x8'));module[_0xa270('0x9')]=function(_0x3f6d8b,_0x3700da){return _0x3f6d8b['define']('CloudProvider',attributes,{'tableName':_0xa270('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa8a3=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','../../config/logger'];(function(_0x1ef5f9,_0x44dad1){var _0x25f75b=function(_0x1b9955){while(--_0x1b9955){_0x1ef5f9['push'](_0x1ef5f9['shift']());}};_0x25f75b(++_0x44dad1);}(_0xa8a3,0x197));var _0x3a8a=function(_0x590f55,_0x314c3b){_0x590f55=_0x590f55-0x0;var _0x14142f=_0xa8a3[_0x590f55];return _0x14142f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3a8a('0x0'))('api');var moment=require(_0x3a8a('0x1'));var BPromise=require(_0x3a8a('0x2'));var rp=require(_0x3a8a('0x3'));var fs=require('fs');var path=require(_0x3a8a('0x4'));var rimraf=require(_0x3a8a('0x5'));var config=require(_0x3a8a('0x6'));var attributes=require(_0x3a8a('0x7'));module[_0x3a8a('0x8')]=function(_0x2d9629,_0x570fb3){return _0x2d9629[_0x3a8a('0x9')](_0x3a8a('0xa'),attributes,{'tableName':_0x3a8a('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 d7612eb..32930d5 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 _0x7db4=['then','refresh_token','data6','data1','decryptString','POST','data5','access_token','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','all','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','api','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','map','type','Dynamics365','push','join','Outlook365','replace','{TENANT_ID}','data2','code','stringify','toString','base64','randomBytes','client_id','response_type','data4','response_mode','form_post','scope','state','nonce','prompt','login','key','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','data3','CloudProvider','findOne'];(function(_0x5c4a95,_0x26447d){var _0x8ec6a0=function(_0x4779b6){while(--_0x4779b6){_0x5c4a95['push'](_0x5c4a95['shift']());}};_0x8ec6a0(++_0x26447d);}(_0x7db4,0x1f2));var _0x47db=function(_0x55c193,_0x3dc41a){_0x55c193=_0x55c193-0x0;var _0x56f621=_0x7db4[_0x55c193];return _0x56f621;};'use strict';var _=require(_0x47db('0x0'));var crypto=require(_0x47db('0x1'));var jwt=require(_0x47db('0x2'));var moment=require(_0x47db('0x3'));var Redis=require(_0x47db('0x4'));var rp=require(_0x47db('0x5'));var util=require(_0x47db('0x6'));var encryptor=require(_0x47db('0x7'));var config=require(_0x47db('0x8'));var logger=require('../../config/logger')(_0x47db('0x9'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x47db('0xa'))['db'];config['redis']=_['defaults'](config[_0x47db('0xb')],{'host':_0x47db('0xc'),'port':0x18eb});var redis=new Redis(config[_0x47db('0xb')]);var MICROSOFT_AUTH_URL=_0x47db('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x47db('0xe'),_0x47db('0xf'),_0x47db('0x10'),_0x47db('0x11'),_0x47db('0x12'),'https://outlook.office.com/POP.AccessAsUser.All',_0x47db('0x13')],'Dynamics365':[_0x47db('0xe'),_0x47db('0x11')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x47db('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x40f6b0){var _0x535470=_[_0x47db('0x15')](AZURE_AUTH_SCOPES[_0x40f6b0[_0x47db('0x16')]]);if(_0x40f6b0['type']===_0x47db('0x17'))_0x535470[_0x47db('0x18')](_0x40f6b0['data7']+'/.default');return _0x535470[_0x47db('0x19')]('\x20');}function getAccessTokenScope(_0x519ec7){if(_0x519ec7[_0x47db('0x16')]===_0x47db('0x1a'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x519ec7[_0x47db('0x16')]===_0x47db('0x17'))return _0x519ec7['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x3f7f40,_0x10a6c4){var _0x1df8a7=MICROSOFT_AUTH_URL[_0x47db('0x1b')](_0x47db('0x1c'),_0x3f7f40[_0x47db('0x1d')]);var _0x4f6cb9=[_0x47db('0x1e'),'id_token'];var _0x3935c4=Buffer['from'](JSON[_0x47db('0x1f')]({'id':_0x10a6c4}))[_0x47db('0x20')](_0x47db('0x21'));var _0x546bff=crypto[_0x47db('0x22')](0x10)[_0x47db('0x20')]('hex');var _0x4ea554=getAuthorizationScopes(_0x3f7f40);var _0x366f03=[{'key':_0x47db('0x23'),'value':_0x3f7f40['data1']},{'key':_0x47db('0x24'),'value':encodeURIComponent(_0x4f6cb9[_0x47db('0x19')]('\x20'))},{'key':'redirect_uri','value':_0x3f7f40[_0x47db('0x25')]},{'key':_0x47db('0x26'),'value':_0x47db('0x27')},{'key':_0x47db('0x28'),'value':encodeURIComponent(_0x4ea554)},{'key':_0x47db('0x29'),'value':_0x3935c4},{'key':_0x47db('0x2a'),'value':_0x546bff},{'key':_0x47db('0x2b'),'value':_0x47db('0x2c')}];var _0x155dc4=_0x1df8a7+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x47db('0x15')](_0x366f03,function(_0xb02de7){return _0xb02de7[_0x47db('0x2d')]+'='+_0xb02de7['value'];})['join']('&');_0x3f7f40[_0x47db('0x2e')]={'issuer':_0x1df8a7[_0x47db('0x1b')](_0x47db('0x2f'),''),'audience':_0x3f7f40['data1'],'state':_0x3935c4,'nonce':_0x546bff};redis[_0x47db('0x30')](_0x3935c4,JSON[_0x47db('0x1f')](_0x3f7f40));return _0x155dc4;}function isValidIdToken(_0x1a8954,_0x23bb59){try{var _0x44ee56=jwt[_0x47db('0x31')](_0x1a8954,{'complete':!![]});var _0x4d5e4c=_0x44ee56[_0x47db('0x32')];if(_0x4d5e4c[_0x47db('0x33')]!==_0x23bb59[_0x47db('0x34')])return![];if(_0x4d5e4c[_0x47db('0x35')]!==_0x23bb59[_0x47db('0x36')])return![];if(_0x4d5e4c['nonce']!==_0x23bb59[_0x47db('0x2a')])return![];if(moment()[_0x47db('0x37')](moment[_0x47db('0x38')](_0x4d5e4c[_0x47db('0x39')])))return![];return!![];}catch(_0x3b7e16){throw _0x3b7e16;}}function refreshOauth2MicrosoftAccessToken(_0x51aa20){return Promise[_0x47db('0x3a')]()['then'](function(){if(_0x51aa20[_0x47db('0x3b')])return _0x51aa20;return db[_0x47db('0x3c')][_0x47db('0x3d')]({'where':{'id':_0x51aa20['id']},'raw':!![]});})[_0x47db('0x3e')](function(_0x11503f){var _0x29f619={'grant_type':_0x47db('0x3f'),'refresh_token':_0x11503f[_0x47db('0x40')],'scope':getAccessTokenScope(_0x11503f),'redirect_uri':_0x11503f['data4'],'client_id':_0x11503f[_0x47db('0x41')],'client_secret':encryptor[_0x47db('0x42')](_0x11503f[_0x47db('0x3b')])};var _0x325d36={'method':_0x47db('0x43'),'uri':MICROSOFT_AUTH_URL[_0x47db('0x1b')]('{TENANT_ID}',_0x11503f[_0x47db('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x29f619,'json':!![]};return rp(_0x325d36);})[_0x47db('0x3e')](function(_0x50cbef){_0x51aa20[_0x47db('0x44')]=_0x50cbef[_0x47db('0x45')];_0x51aa20['data6']=_0x50cbef[_0x47db('0x3f')];return db[_0x47db('0x3c')]['update']({'data5':_0x51aa20[_0x47db('0x44')],'data6':_0x51aa20[_0x47db('0x40')]},{'where':{'id':_0x51aa20['id']}});})[_0x47db('0x3e')](function(){return _0x51aa20;})['catch'](function(_0x17a3ff){logger[_0x47db('0x46')](_0x47db('0x47'),_0x51aa20['id'],_0x17a3ff);});}function getOauth2MicrosoftAccessToken(_0x4a3cf0,_0x3382a){var _0x15010c={'grant_type':'authorization_code','code':_0x4a3cf0,'scope':getAccessTokenScope(_0x3382a),'redirect_uri':_0x3382a[_0x47db('0x25')],'client_id':_0x3382a[_0x47db('0x41')],'client_secret':encryptor[_0x47db('0x42')](_0x3382a['data3'])};var _0x4d21e5={'method':_0x47db('0x43'),'uri':MICROSOFT_AUTH_URL[_0x47db('0x1b')](_0x47db('0x1c'),_0x3382a['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x15010c,'json':!![]};return rp(_0x4d21e5);}function startRefreshInterval(_0x384d7a){var _0x32c40a=schedule[_0x47db('0x48')];if(_0x32c40a[_0x384d7a['id']])clearInterval(_0x32c40a[_0x384d7a['id']]);_0x32c40a[_0x384d7a['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x47db('0x49')](this,{'id':_0x384d7a['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x47db('0x48')]=_0x32c40a;}function startAllRefreshIntervals(){return db[_0x47db('0x3c')][_0x47db('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x29d35a){var _0x413362=_0x29d35a[_0x47db('0x15')](function(_0x2f0392){return refreshOauth2MicrosoftAccessToken(_0x2f0392)['then'](function(_0x58499c){startRefreshInterval(_0x58499c);});});return Promise[_0x47db('0x4b')](_0x413362);})[_0x47db('0x4c')](function(_0x571057){var _0x324d34=_0x571057?util[_0x47db('0x4d')](_0x571057,{'showHidden':![],'depth':null}):'';logger[_0x47db('0x46')](_0x47db('0x4e'),_0x324d34);});}module[_0x47db('0x4f')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x2279=['catch','error','authorization_code','intervals','bind','findAll','all','exports','lodash','crypto','jsonwebtoken','moment','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','openid','/authorize','/token','type','push','data7','join','https://outlook.office365.com/IMAP.AccessAsUser.All','/.default','replace','data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','data1','redirect_uri','data4','form_post','state','prompt','login','map','key','value','oauth2Claims','oauth2/','set','payload','issuer','aud','audience','nonce','isAfter','exp','resolve','then','CloudProvider','findOne','refresh_token','data6','decryptString','data3','POST','{TENANT_ID}','update'];(function(_0x514d96,_0x27dc94){var _0x3d1eeb=function(_0x3f0518){while(--_0x3f0518){_0x514d96['push'](_0x514d96['shift']());}};_0x3d1eeb(++_0x27dc94);}(_0x2279,0x18e));var _0x9227=function(_0x3d4a53,_0x41b236){_0x3d4a53=_0x3d4a53-0x0;var _0x4a4279=_0x2279[_0x3d4a53];return _0x4a4279;};'use strict';var _=require(_0x9227('0x0'));var crypto=require(_0x9227('0x1'));var jwt=require(_0x9227('0x2'));var moment=require(_0x9227('0x3'));var Redis=require(_0x9227('0x4'));var rp=require('request-promise');var util=require('util');var encryptor=require(_0x9227('0x5'));var config=require(_0x9227('0x6'));var logger=require(_0x9227('0x7'))(_0x9227('0x8'));var schedule=require(_0x9227('0x9'));var db=require(_0x9227('0xa'))['db'];config[_0x9227('0xb')]=_[_0x9227('0xc')](config[_0x9227('0xb')],{'host':_0x9227('0xd'),'port':0x18eb});var redis=new Redis(config[_0x9227('0xb')]);var MICROSOFT_AUTH_URL=_0x9227('0xe');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x9227('0xf'),_0x9227('0x10'),_0x9227('0x11'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x9227('0x12'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x9227('0x13'),_0x9227('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x9227('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x9227('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2184d7){var _0x5c9d5e=_['map'](AZURE_AUTH_SCOPES[_0x2184d7[_0x9227('0x16')]]);if(_0x2184d7['type']==='Dynamics365')_0x5c9d5e[_0x9227('0x17')](_0x2184d7[_0x9227('0x18')]+'/.default');return _0x5c9d5e[_0x9227('0x19')]('\x20');}function getAccessTokenScope(_0x593597){if(_0x593597['type']==='Outlook365')return _0x9227('0x1a');if(_0x593597[_0x9227('0x16')]==='Dynamics365')return _0x593597[_0x9227('0x18')]+_0x9227('0x1b');}function generateMicrosoftAuthorizationUrl(_0x4239f2,_0x2854f3){var _0xe8b359=MICROSOFT_AUTH_URL[_0x9227('0x1c')]('{TENANT_ID}',_0x4239f2[_0x9227('0x1d')]);var _0x1b889c=[_0x9227('0x1e'),_0x9227('0x1f')];var _0x5af2bf=Buffer[_0x9227('0x20')](JSON[_0x9227('0x21')]({'id':_0x2854f3}))[_0x9227('0x22')](_0x9227('0x23'));var _0x3d1507=crypto[_0x9227('0x24')](0x10)[_0x9227('0x22')](_0x9227('0x25'));var _0x377bbc=getAuthorizationScopes(_0x4239f2);var _0x270c0d=[{'key':_0x9227('0x26'),'value':_0x4239f2[_0x9227('0x27')]},{'key':'response_type','value':encodeURIComponent(_0x1b889c[_0x9227('0x19')]('\x20'))},{'key':_0x9227('0x28'),'value':_0x4239f2[_0x9227('0x29')]},{'key':'response_mode','value':_0x9227('0x2a')},{'key':'scope','value':encodeURIComponent(_0x377bbc)},{'key':_0x9227('0x2b'),'value':_0x5af2bf},{'key':'nonce','value':_0x3d1507},{'key':_0x9227('0x2c'),'value':_0x9227('0x2d')}];var _0x223160=_0xe8b359+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x9227('0x2e')](_0x270c0d,function(_0x5ae7fc){return _0x5ae7fc[_0x9227('0x2f')]+'='+_0x5ae7fc[_0x9227('0x30')];})['join']('&');_0x4239f2[_0x9227('0x31')]={'issuer':_0xe8b359[_0x9227('0x1c')](_0x9227('0x32'),''),'audience':_0x4239f2[_0x9227('0x27')],'state':_0x5af2bf,'nonce':_0x3d1507};redis[_0x9227('0x33')](_0x5af2bf,JSON[_0x9227('0x21')](_0x4239f2));return _0x223160;}function isValidIdToken(_0x5436fd,_0x3342be){try{var _0x26bac0=jwt['decode'](_0x5436fd,{'complete':!![]});var _0xe9eb8e=_0x26bac0[_0x9227('0x34')];if(_0xe9eb8e['iss']!==_0x3342be[_0x9227('0x35')])return![];if(_0xe9eb8e[_0x9227('0x36')]!==_0x3342be[_0x9227('0x37')])return![];if(_0xe9eb8e[_0x9227('0x38')]!==_0x3342be[_0x9227('0x38')])return![];if(moment()[_0x9227('0x39')](moment['unix'](_0xe9eb8e[_0x9227('0x3a')])))return![];return!![];}catch(_0x329cfd){throw _0x329cfd;}}function refreshOauth2MicrosoftAccessToken(_0x5dcbe2){return Promise[_0x9227('0x3b')]()[_0x9227('0x3c')](function(){if(_0x5dcbe2['data3'])return _0x5dcbe2;return db[_0x9227('0x3d')][_0x9227('0x3e')]({'where':{'id':_0x5dcbe2['id']},'raw':!![]});})[_0x9227('0x3c')](function(_0x6e2259){var _0x2fe3d5={'grant_type':_0x9227('0x3f'),'refresh_token':_0x6e2259[_0x9227('0x40')],'scope':getAccessTokenScope(_0x6e2259),'redirect_uri':_0x6e2259['data4'],'client_id':_0x6e2259['data1'],'client_secret':encryptor[_0x9227('0x41')](_0x6e2259[_0x9227('0x42')])};var _0x138ed0={'method':_0x9227('0x43'),'uri':MICROSOFT_AUTH_URL[_0x9227('0x1c')](_0x9227('0x44'),_0x6e2259['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2fe3d5,'json':!![]};return rp(_0x138ed0);})[_0x9227('0x3c')](function(_0x3b7e75){_0x5dcbe2['data5']=_0x3b7e75['access_token'];_0x5dcbe2[_0x9227('0x40')]=_0x3b7e75[_0x9227('0x3f')];return db['CloudProvider'][_0x9227('0x45')]({'data5':_0x5dcbe2['data5'],'data6':_0x5dcbe2[_0x9227('0x40')]},{'where':{'id':_0x5dcbe2['id']}});})['then'](function(){return _0x5dcbe2;})[_0x9227('0x46')](function(_0x2f85aa){logger[_0x9227('0x47')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x5dcbe2['id'],_0x2f85aa);});}function getOauth2MicrosoftAccessToken(_0x22aae0,_0x33e887){var _0x3a1936={'grant_type':_0x9227('0x48'),'code':_0x22aae0,'scope':getAccessTokenScope(_0x33e887),'redirect_uri':_0x33e887['data4'],'client_id':_0x33e887[_0x9227('0x27')],'client_secret':encryptor['decryptString'](_0x33e887[_0x9227('0x42')])};var _0x4f3e1a={'method':_0x9227('0x43'),'uri':MICROSOFT_AUTH_URL[_0x9227('0x1c')]('{TENANT_ID}',_0x33e887[_0x9227('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3a1936,'json':!![]};return rp(_0x4f3e1a);}function startRefreshInterval(_0x4b66e8){var _0x387e83=schedule[_0x9227('0x49')];if(_0x387e83[_0x4b66e8['id']])clearInterval(_0x387e83[_0x4b66e8['id']]);_0x387e83[_0x4b66e8['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x9227('0x4a')](this,{'id':_0x4b66e8['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x9227('0x49')]=_0x387e83;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x9227('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x9227('0x3c')](function(_0x84a2d6){var _0x55f8df=_0x84a2d6[_0x9227('0x2e')](function(_0x4c1ce8){return refreshOauth2MicrosoftAccessToken(_0x4c1ce8)[_0x9227('0x3c')](function(_0x2974dc){startRefreshInterval(_0x2974dc);});});return Promise[_0x9227('0x4c')](_0x55f8df);})[_0x9227('0x46')](function(_0x26c906){var _0x4539fe=_0x26c906?util['inspect'](_0x26c906,{'showHidden':![],'depth':null}):'';logger[_0x9227('0x47')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x4539fe);});}module[_0x9227('0x4d')]={'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 f4305a4..e91ea56 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 _0x25e7=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info'];(function(_0x1b10de,_0xe0ae69){var _0x59c631=function(_0x4e76d5){while(--_0x4e76d5){_0x1b10de['push'](_0x1b10de['shift']());}};_0x59c631(++_0xe0ae69);}(_0x25e7,0x1d6));var _0x725e=function(_0x5098d3,_0x245091){_0x5098d3=_0x5098d3-0x0;var _0x285389=_0x25e7[_0x5098d3];return _0x285389;};'use strict';var _=require(_0x725e('0x0'));var util=require(_0x725e('0x1'));var moment=require(_0x725e('0x2'));var BPromise=require(_0x725e('0x3'));var rs=require(_0x725e('0x4'));var fs=require('fs');var Redis=require(_0x725e('0x5'));var db=require(_0x725e('0x6'))['db'];var utils=require(_0x725e('0x7'));var logger=require(_0x725e('0x8'))(_0x725e('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x725e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x481316,_0x111a50,_0x192c27){return new BPromise(function(_0x216b33,_0x67de0c){return client[_0x725e('0xb')](_0x481316,_0x192c27)[_0x725e('0xc')](function(_0x39858a){logger[_0x725e('0xd')](_0x725e('0xe'),_0x111a50,_0x725e('0xf'));logger[_0x725e('0x10')](_0x725e('0x11'),_0x111a50,'request\x20sent',JSON['stringify'](_0x39858a));if(_0x39858a[_0x725e('0x12')]){if(_0x39858a[_0x725e('0x12')]['code']===0x1f4){logger['error'](_0x725e('0xe'),_0x111a50,_0x39858a[_0x725e('0x12')]['message']);return _0x67de0c(_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);}logger[_0x725e('0x12')]('CloudProvider,\x20%s,\x20%s',_0x111a50,_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);return _0x216b33(_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);}else{logger[_0x725e('0xd')](_0x725e('0xe'),_0x111a50,'request\x20sent');_0x216b33(_0x39858a[_0x725e('0x14')][_0x725e('0x13')]);}})[_0x725e('0x15')](function(_0x54ac0f){logger[_0x725e('0x12')](_0x725e('0xe'),_0x111a50,_0x54ac0f);_0x67de0c(_0x54ac0f);});});}
\ No newline at end of file
+var _0xce62=['code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','error'];(function(_0x3dc9ce,_0x3f76b0){var _0x1747f2=function(_0x38ec7d){while(--_0x38ec7d){_0x3dc9ce['push'](_0x3dc9ce['shift']());}};_0x1747f2(++_0x3f76b0);}(_0xce62,0x83));var _0x2ce6=function(_0x45204c,_0x1eefaa){_0x45204c=_0x45204c-0x0;var _0x5dc667=_0xce62[_0x45204c];return _0x5dc667;};'use strict';var _=require(_0x2ce6('0x0'));var util=require(_0x2ce6('0x1'));var moment=require('moment');var BPromise=require(_0x2ce6('0x2'));var rs=require(_0x2ce6('0x3'));var fs=require('fs');var Redis=require(_0x2ce6('0x4'));var db=require(_0x2ce6('0x5'))['db'];var utils=require(_0x2ce6('0x6'));var logger=require(_0x2ce6('0x7'))('rpc');var config=require(_0x2ce6('0x8'));var jayson=require(_0x2ce6('0x9'));var client=jayson[_0x2ce6('0xa')][_0x2ce6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcf425,_0x2c66c2,_0x5b7f02){return new BPromise(function(_0x46ef52,_0x12f647){return client['request'](_0xcf425,_0x5b7f02)[_0x2ce6('0xc')](function(_0x2e6eae){logger[_0x2ce6('0xd')]('CloudProvider,\x20%s,\x20%s',_0x2c66c2,_0x2ce6('0xe'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x2c66c2,_0x2ce6('0xe'),JSON['stringify'](_0x2e6eae));if(_0x2e6eae[_0x2ce6('0xf')]){if(_0x2e6eae['error'][_0x2ce6('0x10')]===0x1f4){logger[_0x2ce6('0xf')](_0x2ce6('0x11'),_0x2c66c2,_0x2e6eae[_0x2ce6('0xf')][_0x2ce6('0x12')]);return _0x12f647(_0x2e6eae[_0x2ce6('0xf')][_0x2ce6('0x12')]);}logger[_0x2ce6('0xf')]('CloudProvider,\x20%s,\x20%s',_0x2c66c2,_0x2e6eae[_0x2ce6('0xf')]['message']);return _0x46ef52(_0x2e6eae[_0x2ce6('0xf')][_0x2ce6('0x12')]);}else{logger[_0x2ce6('0xd')]('CloudProvider,\x20%s,\x20%s',_0x2c66c2,_0x2ce6('0xe'));_0x46ef52(_0x2e6eae[_0x2ce6('0x13')][_0x2ce6('0x12')]);}})[_0x2ce6('0x14')](function(_0x38032e){logger[_0x2ce6('0xf')](_0x2ce6('0x11'),_0x2c66c2,_0x38032e);_0x12f647(_0x38032e);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 23b6e34..7e48363 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 _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x7a54,0x106));var _0x47a5=function(_0x1c4397,_0x3bb634){_0x1c4397=_0x1c4397-0x0;var _0x2bb766=_0x7a54[_0x1c4397];return _0x2bb766;};'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
+var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x4f4365,_0x2aee26){var _0x128f6e=function(_0x72a92f){while(--_0x72a92f){_0x4f4365['push'](_0x4f4365['shift']());}};_0x128f6e(++_0x2aee26);}(_0xadb5,0xad));var _0x5adb=function(_0x321ceb,_0x100a58){_0x321ceb=_0x321ceb-0x0;var _0x512dbc=_0xadb5[_0x321ceb];return _0x512dbc;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index b14859d..15fb684 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 _0xab8a=['sequelize','STRING','name'];(function(_0x4fe0bf,_0x59f8f3){var _0x3a769f=function(_0x4a0a5a){while(--_0x4a0a5a){_0x4fe0bf['push'](_0x4fe0bf['shift']());}};_0x3a769f(++_0x59f8f3);}(_0xab8a,0x195));var _0xaab8=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xab8a[_0x1b6186];return _0x186121;};'use strict';var Sequelize=require(_0xaab8('0x0'));module['exports']={'name':{'type':Sequelize[_0xaab8('0x1')],'unique':_0xaab8('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xaab8('0x1')]},'website':{'type':Sequelize[_0xaab8('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xaab8('0x1')]},'type':{'type':Sequelize[_0xaab8('0x1')]},'street':{'type':Sequelize[_0xaab8('0x1')]},'postalCode':{'type':Sequelize[_0xaab8('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xaab8('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xaab8('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xaab8('0x1')]},'description':{'type':Sequelize[_0xaab8('0x1')]}};
\ No newline at end of file
+var _0xec43=['STRING','name','sequelize','exports'];(function(_0x304998,_0x2635c9){var _0x136067=function(_0x519e6e){while(--_0x519e6e){_0x304998['push'](_0x304998['shift']());}};_0x136067(++_0x2635c9);}(_0xec43,0x1c2));var _0x3ec4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xec43[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x3ec4('0x0'));module[_0x3ec4('0x1')]={'name':{'type':Sequelize[_0x3ec4('0x2')],'unique':_0x3ec4('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x3ec4('0x2')]},'companyId':{'type':Sequelize[_0x3ec4('0x2')]},'website':{'type':Sequelize[_0x3ec4('0x2')]},'phone':{'type':Sequelize[_0x3ec4('0x2')]},'fax':{'type':Sequelize[_0x3ec4('0x2')]},'type':{'type':Sequelize[_0x3ec4('0x2')]},'street':{'type':Sequelize[_0x3ec4('0x2')]},'postalCode':{'type':Sequelize[_0x3ec4('0x2')]},'city':{'type':Sequelize[_0x3ec4('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3ec4('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x3ec4('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x3ec4('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index de46532..60fe266 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 _0xa990=['end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','get','Companies','sendStatus','name','describe','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','where','merge','map','filter','options','includeAll','include','CmCompany','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','findOne','rawAttributes','length','pick','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x358675,_0x12aa40){var _0xab59aa=function(_0x37c618){while(--_0x37c618){_0x358675['push'](_0x358675['shift']());}};_0xab59aa(++_0x12aa40);}(_0xa990,0xed));var _0x0a99=function(_0x31c001,_0x51c2cd){_0x31c001=_0x31c001-0x0;var _0x1e2888=_0xa990[_0x31c001];return _0x1e2888;};'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('request-promise');var moment=require(_0x0a99('0x4'));var BPromise=require(_0x0a99('0x5'));var Mustache=require(_0x0a99('0x6'));var util=require(_0x0a99('0x7'));var path=require(_0x0a99('0x8'));var sox=require('sox');var csv=require(_0x0a99('0x9'));var ejs=require(_0x0a99('0xa'));var fs=require('fs');var fs_extra=require(_0x0a99('0xb'));var _=require('lodash');var squel=require(_0x0a99('0xc'));var crypto=require(_0x0a99('0xd'));var jsforce=require(_0x0a99('0xe'));var deskjs=require(_0x0a99('0xf'));var toCsv=require(_0x0a99('0x9'));var querystring=require('querystring');var Papa=require(_0x0a99('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0a99('0x11'));var hardwareService=require(_0x0a99('0x12'));var logger=require(_0x0a99('0x13'))(_0x0a99('0x14'));var utils=require(_0x0a99('0x15'));var config=require(_0x0a99('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a99('0x17'))['db'];function respondWithStatusCode(_0x3326ef,_0x31a53f){_0x31a53f=_0x31a53f||0xcc;return function(_0xdae76){if(_0xdae76){return _0x3326ef['sendStatus'](_0x31a53f);}return _0x3326ef['status'](_0x31a53f)[_0x0a99('0x18')]();};}function respondWithResult(_0x4d92cd,_0x18a26d){_0x18a26d=_0x18a26d||0xc8;return function(_0x401a13){if(_0x401a13){return _0x4d92cd['status'](_0x18a26d)[_0x0a99('0x19')](_0x401a13);}};}function respondWithFilteredResult(_0x54bcc5,_0x552596){return function(_0x37d374){if(_0x37d374){var _0x3e9301=typeof _0x552596[_0x0a99('0x1a')]===_0x0a99('0x1b')&&typeof _0x552596[_0x0a99('0x1c')]==='undefined';var _0x37b48b=_0x37d374[_0x0a99('0x1d')];var _0x3abcbb=_0x3e9301?0x0:_0x552596['offset'];var _0xd279f7=_0x3e9301?_0x37d374[_0x0a99('0x1d')]:_0x552596[_0x0a99('0x1a')]+_0x552596[_0x0a99('0x1c')];var _0x598187;if(_0xd279f7>=_0x37b48b){_0xd279f7=_0x37b48b;_0x598187=0xc8;}else{_0x598187=0xce;}_0x54bcc5[_0x0a99('0x1e')](_0x598187);return _0x54bcc5[_0x0a99('0x1f')](_0x0a99('0x20'),_0x3abcbb+'-'+_0xd279f7+'/'+_0x37b48b)[_0x0a99('0x19')](_0x37d374);}return null;};}function patchUpdates(_0x55c4c4){return function(_0x4b4149){try{jsonpatch[_0x0a99('0x21')](_0x4b4149,_0x55c4c4,!![]);}catch(_0x5b5719){return BPromise[_0x0a99('0x22')](_0x5b5719);}return _0x4b4149['save']();};}function saveUpdates(_0x232d80,_0x1dd76e){return function(_0x2bf6f4){if(_0x2bf6f4){return _0x2bf6f4[_0x0a99('0x23')](_0x232d80)[_0x0a99('0x24')](function(_0x80a1b9){return _0x80a1b9;});}return null;};}function removeEntity(_0x4549f6,_0x2744b1){return function(_0x4a1c61){if(_0x4a1c61){return _0x4a1c61[_0x0a99('0x25')]()[_0x0a99('0x24')](function(){var _0x4d0aae=_0x4a1c61[_0x0a99('0x26')]({'plain':!![]});var _0x5bbfc3=_0x0a99('0x27');return db['UserProfileResource'][_0x0a99('0x25')]({'where':{'type':_0x5bbfc3,'resourceId':_0x4d0aae['id']}})['then'](function(){return _0x4a1c61;});})[_0x0a99('0x24')](function(){_0x4549f6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3235c1,_0x4fb23b){return function(_0x4f981f){if(!_0x4f981f){_0x3235c1[_0x0a99('0x28')](0x194);}return _0x4f981f;};}function handleError(_0x1f4c0f,_0x20707b){_0x20707b=_0x20707b||0x1f4;return function(_0x4ee77c){logger['error'](_0x4ee77c['stack']);if(_0x4ee77c[_0x0a99('0x29')]){delete _0x4ee77c[_0x0a99('0x29')];}_0x1f4c0f['status'](_0x20707b)['send'](_0x4ee77c);};}exports['index']=function(_0x718e55,_0x2c5123){var _0x530a33={},_0x98cdd6={},_0x17ecf3={'count':0x0,'rows':[]};return db['CmCompany'][_0x0a99('0x2a')]()[_0x0a99('0x24')](function(_0x5e4f78){_0x98cdd6[_0x0a99('0x2b')]=_[_0x0a99('0x2c')](_0x5e4f78);_0x98cdd6[_0x0a99('0x2d')]=_[_0x0a99('0x2c')](_0x718e55[_0x0a99('0x2d')]);_0x98cdd6['filters']=_[_0x0a99('0x2e')](_0x98cdd6[_0x0a99('0x2b')],_0x98cdd6[_0x0a99('0x2d')]);_0x530a33[_0x0a99('0x2f')]=_['intersection'](_0x98cdd6[_0x0a99('0x2b')],qs[_0x0a99('0x30')](_0x718e55[_0x0a99('0x2d')][_0x0a99('0x30')]));_0x530a33[_0x0a99('0x2f')]=_0x530a33['attributes']['length']?_0x530a33[_0x0a99('0x2f')]:_0x98cdd6[_0x0a99('0x2b')];if(!_0x718e55[_0x0a99('0x2d')][_0x0a99('0x31')](_0x0a99('0x32'))){_0x530a33[_0x0a99('0x1c')]=qs[_0x0a99('0x1c')](_0x718e55[_0x0a99('0x2d')][_0x0a99('0x1c')]);_0x530a33[_0x0a99('0x1a')]=qs['offset'](_0x718e55[_0x0a99('0x2d')][_0x0a99('0x1a')]);}_0x530a33[_0x0a99('0x33')]=qs[_0x0a99('0x34')](_0x718e55[_0x0a99('0x2d')]['sort']);_0x530a33['where']=qs[_0x0a99('0x35')](_['pick'](_0x718e55[_0x0a99('0x2d')],_0x98cdd6[_0x0a99('0x35')]),_0x5e4f78);if(_0x718e55[_0x0a99('0x2d')]['filter']){_0x530a33[_0x0a99('0x36')]=_[_0x0a99('0x37')](_0x530a33[_0x0a99('0x36')],{'$or':_[_0x0a99('0x38')](_0x530a33[_0x0a99('0x2f')],function(_0x4540bf){var _0x1452b6={};_0x1452b6[_0x4540bf]={'$like':'%'+_0x718e55[_0x0a99('0x2d')][_0x0a99('0x39')]+'%'};return _0x1452b6;})});}_0x530a33=_[_0x0a99('0x37')]({},_0x530a33,_0x718e55[_0x0a99('0x3a')]);var _0x2432cb={'where':_0x530a33[_0x0a99('0x36')]};return db['CmCompany'][_0x0a99('0x1d')](_0x2432cb)[_0x0a99('0x24')](function(_0x20f5d6){_0x17ecf3[_0x0a99('0x1d')]=_0x20f5d6;if(_0x718e55['query'][_0x0a99('0x3b')]){_0x530a33[_0x0a99('0x3c')]=[{'all':!![]}];}return db[_0x0a99('0x3d')][_0x0a99('0x3e')](_0x530a33);})['then'](function(_0x17d06f){_0x17ecf3[_0x0a99('0x3f')]=_0x17d06f;return _0x17ecf3;})['then'](respondWithFilteredResult(_0x2c5123,_0x530a33))[_0x0a99('0x40')](handleError(_0x2c5123,null));})[_0x0a99('0x40')](handleError(_0x2c5123,null));};exports[_0x0a99('0x41')]=function(_0x7eeaea,_0x1f96b9){var _0x5bdc0b={'raw':![],'where':{'id':_0x7eeaea[_0x0a99('0x42')]['id']}},_0x319263={};_0x319263[_0x0a99('0x2b')]=_[_0x0a99('0x2c')](db[_0x0a99('0x3d')]['rawAttributes']);_0x319263['query']=_['keys'](_0x7eeaea['query']);_0x319263['filters']=_[_0x0a99('0x2e')](_0x319263['model'],_0x319263['query']);_0x5bdc0b[_0x0a99('0x2f')]=_[_0x0a99('0x2e')](_0x319263[_0x0a99('0x2b')],qs[_0x0a99('0x30')](_0x7eeaea['query'][_0x0a99('0x30')]));_0x5bdc0b[_0x0a99('0x2f')]=_0x5bdc0b['attributes']['length']?_0x5bdc0b[_0x0a99('0x2f')]:_0x319263[_0x0a99('0x2b')];if(_0x7eeaea[_0x0a99('0x2d')][_0x0a99('0x3b')]){_0x5bdc0b['include']=[{'all':!![]}];}_0x5bdc0b=_[_0x0a99('0x37')]({},_0x5bdc0b,_0x7eeaea['options']);return db[_0x0a99('0x3d')][_0x0a99('0x43')](_0x5bdc0b)[_0x0a99('0x24')](handleEntityNotFound(_0x1f96b9,null))[_0x0a99('0x24')](respondWithResult(_0x1f96b9,null))[_0x0a99('0x40')](handleError(_0x1f96b9,null));};exports[_0x0a99('0x44')]=function(_0x410b7a,_0x394c52){return db[_0x0a99('0x3d')][_0x0a99('0x44')](_0x410b7a[_0x0a99('0x45')],{})[_0x0a99('0x24')](function(_0x3afe55){var _0x1aa412=_0x410b7a[_0x0a99('0x46')][_0x0a99('0x26')]({'plain':!![]});if(!_0x1aa412)throw new Error(_0x0a99('0x47'));if(_0x1aa412[_0x0a99('0x48')]===_0x0a99('0x46')){var _0x1985dd=_0x3afe55[_0x0a99('0x26')]({'plain':!![]});var _0x362ab3=_0x0a99('0x27');return db['UserProfileSection'][_0x0a99('0x43')]({'where':{'name':_0x362ab3,'userProfileId':_0x1aa412[_0x0a99('0x49')]},'raw':!![]})[_0x0a99('0x24')](function(_0x51f55b){if(_0x51f55b&&_0x51f55b[_0x0a99('0x4a')]===0x0){return db[_0x0a99('0x4b')][_0x0a99('0x44')]({'name':_0x1985dd[_0x0a99('0x29')],'resourceId':_0x1985dd['id'],'type':_0x51f55b[_0x0a99('0x29')],'sectionId':_0x51f55b['id']},{})['then'](function(){return _0x3afe55;});}else{return _0x3afe55;}})[_0x0a99('0x40')](function(_0x1aadd7){logger[_0x0a99('0x4c')](_0x0a99('0x4d'),_0x1aadd7);throw _0x1aadd7;});}return _0x3afe55;})['then'](respondWithResult(_0x394c52,0xc9))[_0x0a99('0x40')](handleError(_0x394c52,null));};exports[_0x0a99('0x23')]=function(_0x2429b4,_0x2b67fb){if(_0x2429b4[_0x0a99('0x45')]['id']){delete _0x2429b4[_0x0a99('0x45')]['id'];}return db[_0x0a99('0x3d')]['find']({'where':{'id':_0x2429b4[_0x0a99('0x42')]['id']}})[_0x0a99('0x24')](handleEntityNotFound(_0x2b67fb,null))['then'](saveUpdates(_0x2429b4[_0x0a99('0x45')],null))[_0x0a99('0x24')](respondWithResult(_0x2b67fb,null))[_0x0a99('0x40')](handleError(_0x2b67fb,null));};exports['destroy']=function(_0x5484b0,_0x326957){return db['CmCompany']['find']({'where':{'id':_0x5484b0[_0x0a99('0x42')]['id']}})[_0x0a99('0x24')](handleEntityNotFound(_0x326957,null))[_0x0a99('0x24')](removeEntity(_0x326957,null))[_0x0a99('0x40')](handleError(_0x326957,null));};exports[_0x0a99('0x2a')]=function(_0x1f8aa7,_0x36245e){return db[_0x0a99('0x3d')][_0x0a99('0x2a')]()[_0x0a99('0x24')](respondWithResult(_0x36245e,null))['catch'](handleError(_0x36245e,null));};exports[_0x0a99('0x4e')]=function(_0x9d75b1,_0x8a0ce6,_0x51e761){return db[_0x0a99('0x4f')]['find']({'where':{'id':_0x9d75b1[_0x0a99('0x42')]['id']}})[_0x0a99('0x24')](handleEntityNotFound(_0x8a0ce6,null))[_0x0a99('0x24')](function(_0x4cc220){if(_0x4cc220){return _0x4cc220[_0x0a99('0x4e')](_0x9d75b1[_0x0a99('0x45')][_0x0a99('0x50')],_[_0x0a99('0x51')](_0x9d75b1[_0x0a99('0x45')],[_0x0a99('0x50'),'id'])||{});}})['then'](respondWithResult(_0x8a0ce6,null))['catch'](handleError(_0x8a0ce6,null));};exports['getContacts']=function(_0x55d37b,_0x32e553,_0x371fee){var _0x17a914={};var _0x186e05={};var _0x35e279;var _0x550450;return db['CmCompany'][_0x0a99('0x52')]({'where':{'id':_0x55d37b[_0x0a99('0x42')]['id']}})[_0x0a99('0x24')](handleEntityNotFound(_0x32e553,null))['then'](function(_0x197457){if(_0x197457){_0x35e279=_0x197457;_0x186e05['model']=_[_0x0a99('0x2c')](db[_0x0a99('0x4f')][_0x0a99('0x53')]);_0x186e05[_0x0a99('0x2d')]=_[_0x0a99('0x2c')](_0x55d37b['query']);_0x186e05[_0x0a99('0x35')]=_[_0x0a99('0x2e')](_0x186e05[_0x0a99('0x2b')],_0x186e05['query']);_0x17a914['attributes']=_['intersection'](_0x186e05[_0x0a99('0x2b')],qs[_0x0a99('0x30')](_0x55d37b[_0x0a99('0x2d')][_0x0a99('0x30')]));_0x17a914[_0x0a99('0x2f')]=_0x17a914[_0x0a99('0x2f')][_0x0a99('0x54')]?_0x17a914[_0x0a99('0x2f')]:_0x186e05[_0x0a99('0x2b')];_0x17a914[_0x0a99('0x33')]=qs[_0x0a99('0x34')](_0x55d37b[_0x0a99('0x2d')][_0x0a99('0x34')]);_0x17a914['where']=qs[_0x0a99('0x35')](_[_0x0a99('0x55')](_0x55d37b[_0x0a99('0x2d')],_0x186e05[_0x0a99('0x35')]));if(_0x55d37b['query'][_0x0a99('0x39')]){_0x17a914[_0x0a99('0x36')]=_[_0x0a99('0x37')](_0x17a914[_0x0a99('0x36')],{'$or':_[_0x0a99('0x38')](_0x17a914['attributes'],function(_0x265d59){var _0x183c33={};_0x183c33[_0x265d59]={'$like':'%'+_0x55d37b[_0x0a99('0x2d')][_0x0a99('0x39')]+'%'};return _0x183c33;})});}_0x17a914=_[_0x0a99('0x37')]({},_0x17a914,_0x55d37b[_0x0a99('0x3a')]);return _0x35e279[_0x0a99('0x56')](_0x17a914);}})[_0x0a99('0x24')](function(_0x2c1a92){if(_0x2c1a92){_0x550450=_0x2c1a92[_0x0a99('0x54')];if(!_0x55d37b[_0x0a99('0x2d')][_0x0a99('0x31')]('nolimit')){_0x17a914[_0x0a99('0x1c')]=qs['limit'](_0x55d37b['query'][_0x0a99('0x1c')]);_0x17a914[_0x0a99('0x1a')]=qs[_0x0a99('0x1a')](_0x55d37b[_0x0a99('0x2d')][_0x0a99('0x1a')]);}return _0x35e279[_0x0a99('0x56')](_0x17a914);}})[_0x0a99('0x24')](function(_0x2256f0){if(_0x2256f0){return _0x2256f0?{'count':_0x550450,'rows':_0x2256f0}:null;}})[_0x0a99('0x24')](respondWithResult(_0x32e553,null))[_0x0a99('0x40')](handleError(_0x32e553,null));};
\ No newline at end of file
+var _0xbcd1=['sendStatus','status','offset','limit','set','json','apply','reject','save','update','then','destroy','UserProfileResource','end','error','name','index','CmCompany','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','map','options','count','includeAll','findAll','rows','catch','show','rawAttributes','include','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','CmContact','addContacts','ids','findOne','sort','pick','getContacts','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbcd1,0xe9));var _0x1bcd=function(_0x2e1cd7,_0x293ea1){_0x2e1cd7=_0x2e1cd7-0x0;var _0x515226=_0xbcd1[_0x2e1cd7];return _0x515226;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1bcd('0x0'));var zipdir=require(_0x1bcd('0x1'));var jsonpatch=require(_0x1bcd('0x2'));var rp=require(_0x1bcd('0x3'));var moment=require('moment');var BPromise=require(_0x1bcd('0x4'));var Mustache=require(_0x1bcd('0x5'));var util=require(_0x1bcd('0x6'));var path=require('path');var sox=require(_0x1bcd('0x7'));var csv=require(_0x1bcd('0x8'));var ejs=require(_0x1bcd('0x9'));var fs=require('fs');var fs_extra=require(_0x1bcd('0xa'));var _=require(_0x1bcd('0xb'));var squel=require(_0x1bcd('0xc'));var crypto=require(_0x1bcd('0xd'));var jsforce=require(_0x1bcd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1bcd('0x8'));var querystring=require(_0x1bcd('0xf'));var Papa=require('papaparse');var Redis=require(_0x1bcd('0x10'));var authService=require(_0x1bcd('0x11'));var qs=require(_0x1bcd('0x12'));var as=require(_0x1bcd('0x13'));var hardwareService=require(_0x1bcd('0x14'));var logger=require(_0x1bcd('0x15'))(_0x1bcd('0x16'));var utils=require(_0x1bcd('0x17'));var config=require(_0x1bcd('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b3cd0,_0x53a60c){_0x53a60c=_0x53a60c||0xcc;return function(_0x3999da){if(_0x3999da){return _0x5b3cd0[_0x1bcd('0x19')](_0x53a60c);}return _0x5b3cd0[_0x1bcd('0x1a')](_0x53a60c)['end']();};}function respondWithResult(_0x3cb2c0,_0x1f6ad6){_0x1f6ad6=_0x1f6ad6||0xc8;return function(_0x550a41){if(_0x550a41){return _0x3cb2c0[_0x1bcd('0x1a')](_0x1f6ad6)['json'](_0x550a41);}};}function respondWithFilteredResult(_0x413b70,_0x21af94){return function(_0x1876fc){if(_0x1876fc){var _0x408f91=typeof _0x21af94[_0x1bcd('0x1b')]==='undefined'&&typeof _0x21af94[_0x1bcd('0x1c')]==='undefined';var _0x3535da=_0x1876fc['count'];var _0x5a1a38=_0x408f91?0x0:_0x21af94[_0x1bcd('0x1b')];var _0xd64780=_0x408f91?_0x1876fc['count']:_0x21af94[_0x1bcd('0x1b')]+_0x21af94['limit'];var _0x5b5772;if(_0xd64780>=_0x3535da){_0xd64780=_0x3535da;_0x5b5772=0xc8;}else{_0x5b5772=0xce;}_0x413b70[_0x1bcd('0x1a')](_0x5b5772);return _0x413b70[_0x1bcd('0x1d')]('Content-Range',_0x5a1a38+'-'+_0xd64780+'/'+_0x3535da)[_0x1bcd('0x1e')](_0x1876fc);}return null;};}function patchUpdates(_0x581747){return function(_0x4dcfdf){try{jsonpatch[_0x1bcd('0x1f')](_0x4dcfdf,_0x581747,!![]);}catch(_0x14df57){return BPromise[_0x1bcd('0x20')](_0x14df57);}return _0x4dcfdf[_0x1bcd('0x21')]();};}function saveUpdates(_0x14ca60,_0x3c9292){return function(_0x104f4b){if(_0x104f4b){return _0x104f4b[_0x1bcd('0x22')](_0x14ca60)[_0x1bcd('0x23')](function(_0x161fb9){return _0x161fb9;});}return null;};}function removeEntity(_0x1ce295,_0x2c8601){return function(_0x30c468){if(_0x30c468){return _0x30c468[_0x1bcd('0x24')]()['then'](function(){var _0x4729bd=_0x30c468['get']({'plain':!![]});var _0x37ef5b='Companies';return db[_0x1bcd('0x25')][_0x1bcd('0x24')]({'where':{'type':_0x37ef5b,'resourceId':_0x4729bd['id']}})[_0x1bcd('0x23')](function(){return _0x30c468;});})[_0x1bcd('0x23')](function(){_0x1ce295[_0x1bcd('0x1a')](0xcc)[_0x1bcd('0x26')]();});}};}function handleEntityNotFound(_0x3ffbd9,_0x3516d2){return function(_0x15c8a0){if(!_0x15c8a0){_0x3ffbd9['sendStatus'](0x194);}return _0x15c8a0;};}function handleError(_0x54d86a,_0x418815){_0x418815=_0x418815||0x1f4;return function(_0x21e7ff){logger[_0x1bcd('0x27')](_0x21e7ff['stack']);if(_0x21e7ff[_0x1bcd('0x28')]){delete _0x21e7ff[_0x1bcd('0x28')];}_0x54d86a[_0x1bcd('0x1a')](_0x418815)['send'](_0x21e7ff);};}exports[_0x1bcd('0x29')]=function(_0x4a6c8c,_0x2bf5ad){var _0x29615b={},_0x3b3b1d={},_0xb9f698={'count':0x0,'rows':[]};return db[_0x1bcd('0x2a')]['describe']()['then'](function(_0xbbca44){_0x3b3b1d['model']=_[_0x1bcd('0x2b')](_0xbbca44);_0x3b3b1d[_0x1bcd('0x2c')]=_[_0x1bcd('0x2b')](_0x4a6c8c[_0x1bcd('0x2c')]);_0x3b3b1d[_0x1bcd('0x2d')]=_[_0x1bcd('0x2e')](_0x3b3b1d[_0x1bcd('0x2f')],_0x3b3b1d[_0x1bcd('0x2c')]);_0x29615b[_0x1bcd('0x30')]=_[_0x1bcd('0x2e')](_0x3b3b1d[_0x1bcd('0x2f')],qs[_0x1bcd('0x31')](_0x4a6c8c['query'][_0x1bcd('0x31')]));_0x29615b[_0x1bcd('0x30')]=_0x29615b[_0x1bcd('0x30')][_0x1bcd('0x32')]?_0x29615b[_0x1bcd('0x30')]:_0x3b3b1d[_0x1bcd('0x2f')];if(!_0x4a6c8c[_0x1bcd('0x2c')][_0x1bcd('0x33')](_0x1bcd('0x34'))){_0x29615b[_0x1bcd('0x1c')]=qs['limit'](_0x4a6c8c[_0x1bcd('0x2c')]['limit']);_0x29615b[_0x1bcd('0x1b')]=qs[_0x1bcd('0x1b')](_0x4a6c8c['query'][_0x1bcd('0x1b')]);}_0x29615b[_0x1bcd('0x35')]=qs['sort'](_0x4a6c8c[_0x1bcd('0x2c')]['sort']);_0x29615b[_0x1bcd('0x36')]=qs[_0x1bcd('0x2d')](_['pick'](_0x4a6c8c[_0x1bcd('0x2c')],_0x3b3b1d[_0x1bcd('0x2d')]),_0xbbca44);if(_0x4a6c8c['query'][_0x1bcd('0x37')]){_0x29615b[_0x1bcd('0x36')]=_['merge'](_0x29615b[_0x1bcd('0x36')],{'$or':_[_0x1bcd('0x38')](_0x29615b[_0x1bcd('0x30')],function(_0x3a8f27){var _0x43c5c5={};_0x43c5c5[_0x3a8f27]={'$like':'%'+_0x4a6c8c[_0x1bcd('0x2c')][_0x1bcd('0x37')]+'%'};return _0x43c5c5;})});}_0x29615b=_['merge']({},_0x29615b,_0x4a6c8c[_0x1bcd('0x39')]);var _0x4cedb8={'where':_0x29615b[_0x1bcd('0x36')]};return db[_0x1bcd('0x2a')]['count'](_0x4cedb8)[_0x1bcd('0x23')](function(_0x4bfe13){_0xb9f698[_0x1bcd('0x3a')]=_0x4bfe13;if(_0x4a6c8c[_0x1bcd('0x2c')][_0x1bcd('0x3b')]){_0x29615b['include']=[{'all':!![]}];}return db[_0x1bcd('0x2a')][_0x1bcd('0x3c')](_0x29615b);})[_0x1bcd('0x23')](function(_0x445497){_0xb9f698[_0x1bcd('0x3d')]=_0x445497;return _0xb9f698;})[_0x1bcd('0x23')](respondWithFilteredResult(_0x2bf5ad,_0x29615b))[_0x1bcd('0x3e')](handleError(_0x2bf5ad,null));})[_0x1bcd('0x3e')](handleError(_0x2bf5ad,null));};exports[_0x1bcd('0x3f')]=function(_0x4dab25,_0x320f84){var _0x1818d9={'raw':![],'where':{'id':_0x4dab25['params']['id']}},_0x23efd7={};_0x23efd7[_0x1bcd('0x2f')]=_[_0x1bcd('0x2b')](db[_0x1bcd('0x2a')][_0x1bcd('0x40')]);_0x23efd7[_0x1bcd('0x2c')]=_[_0x1bcd('0x2b')](_0x4dab25['query']);_0x23efd7[_0x1bcd('0x2d')]=_[_0x1bcd('0x2e')](_0x23efd7['model'],_0x23efd7[_0x1bcd('0x2c')]);_0x1818d9[_0x1bcd('0x30')]=_[_0x1bcd('0x2e')](_0x23efd7['model'],qs['fields'](_0x4dab25[_0x1bcd('0x2c')][_0x1bcd('0x31')]));_0x1818d9[_0x1bcd('0x30')]=_0x1818d9[_0x1bcd('0x30')][_0x1bcd('0x32')]?_0x1818d9['attributes']:_0x23efd7[_0x1bcd('0x2f')];if(_0x4dab25[_0x1bcd('0x2c')][_0x1bcd('0x3b')]){_0x1818d9[_0x1bcd('0x41')]=[{'all':!![]}];}_0x1818d9=_[_0x1bcd('0x42')]({},_0x1818d9,_0x4dab25[_0x1bcd('0x39')]);return db[_0x1bcd('0x2a')][_0x1bcd('0x43')](_0x1818d9)[_0x1bcd('0x23')](handleEntityNotFound(_0x320f84,null))[_0x1bcd('0x23')](respondWithResult(_0x320f84,null))[_0x1bcd('0x3e')](handleError(_0x320f84,null));};exports[_0x1bcd('0x44')]=function(_0x361977,_0xa04945){return db[_0x1bcd('0x2a')][_0x1bcd('0x44')](_0x361977[_0x1bcd('0x45')],{})['then'](function(_0x5e5a33){var _0x1c115a=_0x361977[_0x1bcd('0x46')][_0x1bcd('0x47')]({'plain':!![]});if(!_0x1c115a)throw new Error(_0x1bcd('0x48'));if(_0x1c115a[_0x1bcd('0x49')]==='user'){var _0x1376c3=_0x5e5a33[_0x1bcd('0x47')]({'plain':!![]});var _0x523da3=_0x1bcd('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x523da3,'userProfileId':_0x1c115a['userProfileId']},'raw':!![]})[_0x1bcd('0x23')](function(_0x34904d){if(_0x34904d&&_0x34904d[_0x1bcd('0x4b')]===0x0){return db[_0x1bcd('0x25')][_0x1bcd('0x44')]({'name':_0x1376c3[_0x1bcd('0x28')],'resourceId':_0x1376c3['id'],'type':_0x34904d[_0x1bcd('0x28')],'sectionId':_0x34904d['id']},{})[_0x1bcd('0x23')](function(){return _0x5e5a33;});}else{return _0x5e5a33;}})[_0x1bcd('0x3e')](function(_0x3d8f83){logger[_0x1bcd('0x27')](_0x1bcd('0x4c'),_0x3d8f83);throw _0x3d8f83;});}return _0x5e5a33;})['then'](respondWithResult(_0xa04945,0xc9))[_0x1bcd('0x3e')](handleError(_0xa04945,null));};exports['update']=function(_0xe1f92,_0xfa2b2f){if(_0xe1f92[_0x1bcd('0x45')]['id']){delete _0xe1f92[_0x1bcd('0x45')]['id'];}return db[_0x1bcd('0x2a')][_0x1bcd('0x43')]({'where':{'id':_0xe1f92[_0x1bcd('0x4d')]['id']}})['then'](handleEntityNotFound(_0xfa2b2f,null))[_0x1bcd('0x23')](saveUpdates(_0xe1f92[_0x1bcd('0x45')],null))[_0x1bcd('0x23')](respondWithResult(_0xfa2b2f,null))[_0x1bcd('0x3e')](handleError(_0xfa2b2f,null));};exports[_0x1bcd('0x24')]=function(_0x4de844,_0x4ac031){return db[_0x1bcd('0x2a')][_0x1bcd('0x43')]({'where':{'id':_0x4de844[_0x1bcd('0x4d')]['id']}})[_0x1bcd('0x23')](handleEntityNotFound(_0x4ac031,null))[_0x1bcd('0x23')](removeEntity(_0x4ac031,null))[_0x1bcd('0x3e')](handleError(_0x4ac031,null));};exports[_0x1bcd('0x4e')]=function(_0x5eb026,_0x5812cb){return db[_0x1bcd('0x2a')][_0x1bcd('0x4e')]()[_0x1bcd('0x23')](respondWithResult(_0x5812cb,null))['catch'](handleError(_0x5812cb,null));};exports['addContacts']=function(_0xe25a7c,_0x51275a,_0x18af40){return db[_0x1bcd('0x4f')][_0x1bcd('0x43')]({'where':{'id':_0xe25a7c[_0x1bcd('0x4d')]['id']}})[_0x1bcd('0x23')](handleEntityNotFound(_0x51275a,null))[_0x1bcd('0x23')](function(_0x418689){if(_0x418689){return _0x418689[_0x1bcd('0x50')](_0xe25a7c[_0x1bcd('0x45')][_0x1bcd('0x51')],_['omit'](_0xe25a7c[_0x1bcd('0x45')],[_0x1bcd('0x51'),'id'])||{});}})['then'](respondWithResult(_0x51275a,null))['catch'](handleError(_0x51275a,null));};exports['getContacts']=function(_0x1f147b,_0x5d6280,_0x3ed84f){var _0xe7c08c={};var _0x29c08f={};var _0x584692;var _0x5c6cfd;return db[_0x1bcd('0x2a')][_0x1bcd('0x52')]({'where':{'id':_0x1f147b['params']['id']}})['then'](handleEntityNotFound(_0x5d6280,null))[_0x1bcd('0x23')](function(_0x4ce427){if(_0x4ce427){_0x584692=_0x4ce427;_0x29c08f[_0x1bcd('0x2f')]=_[_0x1bcd('0x2b')](db[_0x1bcd('0x4f')][_0x1bcd('0x40')]);_0x29c08f[_0x1bcd('0x2c')]=_[_0x1bcd('0x2b')](_0x1f147b[_0x1bcd('0x2c')]);_0x29c08f[_0x1bcd('0x2d')]=_[_0x1bcd('0x2e')](_0x29c08f[_0x1bcd('0x2f')],_0x29c08f[_0x1bcd('0x2c')]);_0xe7c08c[_0x1bcd('0x30')]=_[_0x1bcd('0x2e')](_0x29c08f[_0x1bcd('0x2f')],qs['fields'](_0x1f147b['query'][_0x1bcd('0x31')]));_0xe7c08c['attributes']=_0xe7c08c[_0x1bcd('0x30')][_0x1bcd('0x32')]?_0xe7c08c['attributes']:_0x29c08f['model'];_0xe7c08c[_0x1bcd('0x35')]=qs[_0x1bcd('0x53')](_0x1f147b[_0x1bcd('0x2c')][_0x1bcd('0x53')]);_0xe7c08c[_0x1bcd('0x36')]=qs['filters'](_[_0x1bcd('0x54')](_0x1f147b[_0x1bcd('0x2c')],_0x29c08f[_0x1bcd('0x2d')]));if(_0x1f147b[_0x1bcd('0x2c')][_0x1bcd('0x37')]){_0xe7c08c[_0x1bcd('0x36')]=_[_0x1bcd('0x42')](_0xe7c08c['where'],{'$or':_[_0x1bcd('0x38')](_0xe7c08c['attributes'],function(_0x233152){var _0x3774ea={};_0x3774ea[_0x233152]={'$like':'%'+_0x1f147b[_0x1bcd('0x2c')][_0x1bcd('0x37')]+'%'};return _0x3774ea;})});}_0xe7c08c=_['merge']({},_0xe7c08c,_0x1f147b[_0x1bcd('0x39')]);return _0x584692[_0x1bcd('0x55')](_0xe7c08c);}})[_0x1bcd('0x23')](function(_0x4843ec){if(_0x4843ec){_0x5c6cfd=_0x4843ec[_0x1bcd('0x32')];if(!_0x1f147b[_0x1bcd('0x2c')][_0x1bcd('0x33')](_0x1bcd('0x34'))){_0xe7c08c[_0x1bcd('0x1c')]=qs['limit'](_0x1f147b[_0x1bcd('0x2c')][_0x1bcd('0x1c')]);_0xe7c08c[_0x1bcd('0x1b')]=qs[_0x1bcd('0x1b')](_0x1f147b['query']['offset']);}return _0x584692['getContacts'](_0xe7c08c);}})[_0x1bcd('0x23')](function(_0x417599){if(_0x417599){return _0x417599?{'count':_0x5c6cfd,'rows':_0x417599}:null;}})[_0x1bcd('0x23')](respondWithResult(_0x5d6280,null))[_0x1bcd('0x3e')](handleError(_0x5d6280,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index c7f86a6..9cfea6a 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 _0xd9eb=['util','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','CmCompany'];(function(_0x4ebc20,_0x4c087b){var _0x26fce3=function(_0x59253f){while(--_0x59253f){_0x4ebc20['push'](_0x4ebc20['shift']());}};_0x26fce3(++_0x4c087b);}(_0xd9eb,0xa8));var _0xbd9e=function(_0x2d2ccc,_0x30f2fe){_0x2d2ccc=_0x2d2ccc-0x0;var _0x54dc55=_0xd9eb[_0x2d2ccc];return _0x54dc55;};'use strict';var _=require('lodash');var util=require(_0xbd9e('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbd9e('0x1'));var fs=require('fs');var path=require(_0xbd9e('0x2'));var rimraf=require(_0xbd9e('0x3'));var config=require(_0xbd9e('0x4'));var attributes=require(_0xbd9e('0x5'));module['exports']=function(_0x476629,_0x121125){return _0x476629['define'](_0xbd9e('0x6'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xee20=['api','moment','request-promise','rimraf','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util'];(function(_0x1b7523,_0x51b4e9){var _0x1dc12e=function(_0x2573f3){while(--_0x2573f3){_0x1b7523['push'](_0x1b7523['shift']());}};_0x1dc12e(++_0x51b4e9);}(_0xee20,0x18a));var _0x0ee2=function(_0x999162,_0x289750){_0x999162=_0x999162-0x0;var _0x4f899a=_0xee20[_0x999162];return _0x4f899a;};'use strict';var _=require(_0x0ee2('0x0'));var util=require(_0x0ee2('0x1'));var logger=require('../../config/logger')(_0x0ee2('0x2'));var moment=require(_0x0ee2('0x3'));var BPromise=require('bluebird');var rp=require(_0x0ee2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ee2('0x5'));var config=require('../../config/environment');var attributes=require(_0x0ee2('0x6'));module[_0x0ee2('0x7')]=function(_0x21f993,_0x583cfe){return _0x21f993[_0x0ee2('0x8')](_0x0ee2('0x9'),attributes,{'tableName':_0x0ee2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 202745c..e87fe5b 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 _0xe05a=['stringify','error','code','message','result','lodash','moment','bluebird','rpc','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x42ea30,_0x3c60c1){var _0x83e81e=function(_0x3b0e4a){while(--_0x3b0e4a){_0x42ea30['push'](_0x42ea30['shift']());}};_0x83e81e(++_0x3c60c1);}(_0xe05a,0xf3));var _0xae05=function(_0x5be0e5,_0x187d76){_0x5be0e5=_0x5be0e5-0x0;var _0x518f42=_0xe05a[_0x5be0e5];return _0x518f42;};'use strict';var _=require(_0xae05('0x0'));var util=require('util');var moment=require(_0xae05('0x1'));var BPromise=require(_0xae05('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xae05('0x3'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xae05('0x4')][_0xae05('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x1c5c3e,_0x43a8ba,_0x3a8867){return new BPromise(function(_0x112eec,_0x1c1752){return client[_0xae05('0x6')](_0x1c5c3e,_0x3a8867)[_0xae05('0x7')](function(_0x25a136){logger[_0xae05('0x8')](_0xae05('0x9'),_0x43a8ba,_0xae05('0xa'));logger[_0xae05('0xb')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x43a8ba,'request\x20sent',JSON[_0xae05('0xc')](_0x25a136));if(_0x25a136[_0xae05('0xd')]){if(_0x25a136[_0xae05('0xd')][_0xae05('0xe')]===0x1f4){logger[_0xae05('0xd')](_0xae05('0x9'),_0x43a8ba,_0x25a136[_0xae05('0xd')]['message']);return _0x1c1752(_0x25a136['error']['message']);}logger['error'](_0xae05('0x9'),_0x43a8ba,_0x25a136[_0xae05('0xd')]['message']);return _0x112eec(_0x25a136[_0xae05('0xd')][_0xae05('0xf')]);}else{logger[_0xae05('0x8')](_0xae05('0x9'),_0x43a8ba,'request\x20sent');_0x112eec(_0x25a136[_0xae05('0x10')]['message']);}})['catch'](function(_0x42e690){logger[_0xae05('0xd')](_0xae05('0x9'),_0x43a8ba,_0x42e690);_0x1c1752(_0x42e690);});});}
\ No newline at end of file
+var _0xde9b=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','CmCompany,\x20%s,\x20%s'];(function(_0x5dbd29,_0xc9dd40){var _0x577f92=function(_0x42b53c){while(--_0x42b53c){_0x5dbd29['push'](_0x5dbd29['shift']());}};_0x577f92(++_0xc9dd40);}(_0xde9b,0xc9));var _0xbde9=function(_0x460e6d,_0x26bbf9){_0x460e6d=_0x460e6d-0x0;var _0x288333=_0xde9b[_0x460e6d];return _0x288333;};'use strict';var _=require(_0xbde9('0x0'));var util=require(_0xbde9('0x1'));var moment=require(_0xbde9('0x2'));var BPromise=require(_0xbde9('0x3'));var rs=require(_0xbde9('0x4'));var fs=require('fs');var Redis=require(_0xbde9('0x5'));var db=require(_0xbde9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbde9('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbde9('0x8'));var client=jayson[_0xbde9('0x9')][_0xbde9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe64b86,_0x298185,_0x3760b7){return new BPromise(function(_0x4aacb0,_0x257d52){return client[_0xbde9('0xb')](_0xe64b86,_0x3760b7)[_0xbde9('0xc')](function(_0x3b9036){logger[_0xbde9('0xd')]('CmCompany,\x20%s,\x20%s',_0x298185,_0xbde9('0xe'));logger[_0xbde9('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x298185,'request\x20sent',JSON[_0xbde9('0x10')](_0x3b9036));if(_0x3b9036['error']){if(_0x3b9036['error']['code']===0x1f4){logger[_0xbde9('0x11')](_0xbde9('0x12'),_0x298185,_0x3b9036[_0xbde9('0x11')][_0xbde9('0x13')]);return _0x257d52(_0x3b9036[_0xbde9('0x11')][_0xbde9('0x13')]);}logger[_0xbde9('0x11')](_0xbde9('0x12'),_0x298185,_0x3b9036[_0xbde9('0x11')][_0xbde9('0x13')]);return _0x4aacb0(_0x3b9036[_0xbde9('0x11')]['message']);}else{logger[_0xbde9('0xd')](_0xbde9('0x12'),_0x298185,_0xbde9('0xe'));_0x4aacb0(_0x3b9036[_0xbde9('0x14')]['message']);}})[_0xbde9('0x15')](function(_0x439187){logger[_0xbde9('0x11')]('CmCompany,\x20%s,\x20%s',_0x298185,_0x439187);_0x257d52(_0x439187);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 8929424..50b3cd8 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 _0x190d=['../../config/environment','get','isAuthenticated','index','/describe','show','/:id/contacts','getContacts','post','addContacts','/:id','update','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x51e916,_0x549682){var _0x2f718d=function(_0x402905){while(--_0x402905){_0x51e916['push'](_0x51e916['shift']());}};_0x2f718d(++_0x549682);}(_0x190d,0x126));var _0xd190=function(_0x25131c,_0x55c347){_0x25131c=_0x25131c-0x0;var _0x829a63=_0x190d[_0x25131c];return _0x829a63;};'use strict';var multer=require(_0xd190('0x0'));var util=require('util');var path=require(_0xd190('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd190('0x2')]();var fs_extra=require(_0xd190('0x3'));var auth=require(_0xd190('0x4'));var interaction=require(_0xd190('0x5'));var config=require(_0xd190('0x6'));var controller=require('./cmCompany.controller');router[_0xd190('0x7')]('/',auth[_0xd190('0x8')](),controller[_0xd190('0x9')]);router[_0xd190('0x7')](_0xd190('0xa'),auth[_0xd190('0x8')](),controller['describe']);router[_0xd190('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xd190('0xb')]);router[_0xd190('0x7')](_0xd190('0xc'),auth['isAuthenticated'](),controller[_0xd190('0xd')]);router[_0xd190('0xe')]('/',auth[_0xd190('0x8')](),controller['create']);router['post'](_0xd190('0xc'),auth[_0xd190('0x8')](),controller[_0xd190('0xf')]);router['put'](_0xd190('0x10'),auth[_0xd190('0x8')](),controller[_0xd190('0x11')]);router['delete']('/:id',auth[_0xd190('0x8')](),controller[_0xd190('0x12')]);module[_0xd190('0x13')]=router;
\ No newline at end of file
+var _0x06a7=['/:id/contacts','getContacts','post','addContacts','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x06a7,0x18f));var _0x706a=function(_0x2e2d89,_0x4bb615){_0x2e2d89=_0x2e2d89-0x0;var _0x3aba90=_0x06a7[_0x2e2d89];return _0x3aba90;};'use strict';var multer=require(_0x706a('0x0'));var util=require(_0x706a('0x1'));var path=require(_0x706a('0x2'));var timeout=require('connect-timeout');var express=require(_0x706a('0x3'));var router=express[_0x706a('0x4')]();var fs_extra=require(_0x706a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x706a('0x6'));var controller=require(_0x706a('0x7'));router[_0x706a('0x8')]('/',auth[_0x706a('0x9')](),controller[_0x706a('0xa')]);router[_0x706a('0x8')](_0x706a('0xb'),auth[_0x706a('0x9')](),controller[_0x706a('0xc')]);router[_0x706a('0x8')](_0x706a('0xd'),auth[_0x706a('0x9')](),controller[_0x706a('0xe')]);router[_0x706a('0x8')](_0x706a('0xf'),auth[_0x706a('0x9')](),controller[_0x706a('0x10')]);router[_0x706a('0x11')]('/',auth[_0x706a('0x9')](),controller['create']);router[_0x706a('0x11')](_0x706a('0xf'),auth['isAuthenticated'](),controller[_0x706a('0x12')]);router[_0x706a('0x13')](_0x706a('0xd'),auth[_0x706a('0x9')](),controller[_0x706a('0x14')]);router[_0x706a('0x15')](_0x706a('0xd'),auth['isAuthenticated'](),controller[_0x706a('0x16')]);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 d0990b7..fdc612c 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 _0xb10b=['TEXT','INTEGER','UNSIGNED','DATE','lodash','exports','STRING'];(function(_0x3e447f,_0x1162b9){var _0x7f2d95=function(_0x8ac030){while(--_0x8ac030){_0x3e447f['push'](_0x3e447f['shift']());}};_0x7f2d95(++_0x1162b9);}(_0xb10b,0x12a));var _0xbb10=function(_0xe3a46,_0x4f9273){_0xe3a46=_0xe3a46-0x0;var _0x5bb333=_0xb10b[_0xe3a46];return _0x5bb333;};'use strict';var _=require(_0xbb10('0x0'));var Sequelize=require('sequelize');module[_0xbb10('0x1')]={'firstName':{'type':Sequelize[_0xbb10('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xbb10('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xbb10('0x2')]},'city':{'type':Sequelize[_0xbb10('0x2')]},'country':{'type':Sequelize[_0xbb10('0x2')]},'dateOfBirth':{'type':Sequelize[_0xbb10('0x2')]},'description':{'type':Sequelize[_0xbb10('0x3')]},'phone':{'type':Sequelize[_0xbb10('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xbb10('0x2')]},'email':{'type':Sequelize[_0xbb10('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xbb10('0x2')]},'fb_data':{'type':Sequelize[_0xbb10('0x2')]},'twitter':{'type':Sequelize[_0xbb10('0x2')]},'skype':{'type':Sequelize[_0xbb10('0x2')]},'teams':{'type':Sequelize[_0xbb10('0x2')]},'viber':{'type':Sequelize[_0xbb10('0x2')]},'line':{'type':Sequelize[_0xbb10('0x2')]},'wechat':{'type':Sequelize[_0xbb10('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xbb10('0x4')](0x2)[_0xbb10('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xbb10('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0xbb10('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xb10b=['TEXT','INTEGER','UNSIGNED','DATE','lodash','exports','STRING'];(function(_0x1fc9da,_0x2675d5){var _0x52065c=function(_0x488ad1){while(--_0x488ad1){_0x1fc9da['push'](_0x1fc9da['shift']());}};_0x52065c(++_0x2675d5);}(_0xb10b,0x12a));var _0xbb10=function(_0x614c88,_0x184f02){_0x614c88=_0x614c88-0x0;var _0x1a768e=_0xb10b[_0x614c88];return _0x1a768e;};'use strict';var _=require(_0xbb10('0x0'));var Sequelize=require('sequelize');module[_0xbb10('0x1')]={'firstName':{'type':Sequelize[_0xbb10('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xbb10('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xbb10('0x2')]},'city':{'type':Sequelize[_0xbb10('0x2')]},'country':{'type':Sequelize[_0xbb10('0x2')]},'dateOfBirth':{'type':Sequelize[_0xbb10('0x2')]},'description':{'type':Sequelize[_0xbb10('0x3')]},'phone':{'type':Sequelize[_0xbb10('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xbb10('0x2')]},'email':{'type':Sequelize[_0xbb10('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xbb10('0x2')]},'fb_data':{'type':Sequelize[_0xbb10('0x2')]},'twitter':{'type':Sequelize[_0xbb10('0x2')]},'skype':{'type':Sequelize[_0xbb10('0x2')]},'teams':{'type':Sequelize[_0xbb10('0x2')]},'viber':{'type':Sequelize[_0xbb10('0x2')]},'line':{'type':Sequelize[_0xbb10('0x2')]},'wechat':{'type':Sequelize[_0xbb10('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xbb10('0x4')](0x2)[_0xbb10('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xbb10('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0xbb10('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 3d6b93e..cb6b498 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 _0x15d5=['CmHopperFinal','ReportAgentPreview','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','join','dialTimezone','timezones','utcOffset','bulkCreate','each','duplicates','findOrCreate','show','$and','format','cf_%d','omit','pickBy','table','setFields','id\x20=\x20?','values','phone','options','getTags','setTags','rawAttributes','sort','ContactId','includeAll','include','rows','getHopperHistories','CmHopperHistory','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','path','meta','import','binding','No\x20phone\x20column\x20specified','child_process','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','fax','whatsapp','channel','includes','toLowerCase','Invalid\x20channel','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','voice','uniqueid','source','destination','callerid','starttime','endtime','duration','note','userDisposition','userSecondDisposition','UserId','fullname','createdAt','range','VoiceCallReport','startCase','Website','closed','disposition','Account','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingValue','referer','subject','substatus','externalUrl','threadId','findAndCountAll','flatten','sortBy','reverse','slice','moment','bluebird','util','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','offset','undefined','limit','count','status','set','Content-Range','then','end','error','stack','name','index','CmContact','describe','keys','length','cf_','push','CmCustomField','findOne','all','fieldType','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','pick','field','color','from','select','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','tools_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','split','forEach','union','User','and','uc.UserId\x20=\x20?','datetime','castTo','DATE','text','map','isNil','Contact','isEmpty','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','SELECT','clone','DESC','having','resolve','role','agent','some','user','getLists','c.ListId\x20IS\x20NULL','ListId','sequelize','toString','keyBy','merge','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','catch','destroy','params','tags','startsWith','columnName','displayName','findAll','alias','custom','body','get','mergeWith','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailMessage','MailInteraction','SmsMessage','OpenchannelInteraction','OpenchannelMessage'];(function(_0x2fa1c6,_0x4a5b8d){var _0x5f3257=function(_0x195b53){while(--_0x195b53){_0x2fa1c6['push'](_0x2fa1c6['shift']());}};_0x5f3257(++_0x4a5b8d);}(_0x15d5,0x7e));var _0x515d=function(_0x56121e,_0x3bcae1){_0x56121e=_0x56121e-0x0;var _0x584744=_0x15d5[_0x56121e];return _0x584744;};'use strict';var moment=require(_0x515d('0x0'));var BPromise=require(_0x515d('0x1'));var util=require(_0x515d('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x515d('0x3'));var squel=require(_0x515d('0x4'));var Papa=require(_0x515d('0x5'));var Redis=require(_0x515d('0x6'));var qs=require(_0x515d('0x7'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x515d('0x8'))('api');var config=require(_0x515d('0x9'));var shared=require(_0x515d('0xa'));var db=require(_0x515d('0xb'))['db'];config[_0x515d('0xc')]=_[_0x515d('0xd')](config[_0x515d('0xc')],{'host':_0x515d('0xe'),'port':0x18eb});var socket=require(_0x515d('0xf'))(new Redis(config[_0x515d('0xc')]));require(_0x515d('0x10'))['register'](socket);function respondWithResult(_0x30247d,_0x13a746){_0x13a746=_0x13a746||0xc8;return function(_0x423b69){if(_0x423b69){return _0x30247d['status'](_0x13a746)['json'](_0x423b69);}};}function respondWithFilteredResult(_0x3b4ee0,_0x341014){return function(_0x457b56){if(_0x457b56){var _0x4fb283=typeof _0x341014[_0x515d('0x11')]===_0x515d('0x12')&&typeof _0x341014[_0x515d('0x13')]==='undefined';var _0x5998fd=_0x457b56[_0x515d('0x14')];var _0x247da2=_0x4fb283?0x0:_0x341014[_0x515d('0x11')];var _0x23e507=_0x4fb283?_0x457b56[_0x515d('0x14')]:_0x341014[_0x515d('0x11')]+_0x341014['limit'];var _0x1e3bdb;if(_0x23e507>=_0x5998fd){_0x23e507=_0x5998fd;_0x1e3bdb=0xc8;}else{_0x1e3bdb=0xce;}_0x3b4ee0[_0x515d('0x15')](_0x1e3bdb);return _0x3b4ee0[_0x515d('0x16')](_0x515d('0x17'),_0x247da2+'-'+_0x23e507+'/'+_0x5998fd)['json'](_0x457b56);}return null;};}function saveUpdates(_0x48fe29){return function(_0x3c2668){if(_0x3c2668){return _0x3c2668['update'](_0x48fe29)['then'](function(_0x176082){return _0x176082;});}return null;};}function removeEntity(_0x435be0){return function(_0x26a955){if(_0x26a955){return _0x26a955['destroy']()[_0x515d('0x18')](function(){_0x435be0[_0x515d('0x15')](0xcc)[_0x515d('0x19')]();});}};}function handleEntityNotFound(_0x599c93){return function(_0x212d0e){if(!_0x212d0e){_0x599c93['sendStatus'](0x194);}return _0x212d0e;};}function handleError(_0x46c166,_0x50f421){_0x50f421=_0x50f421||0x1f4;return function(_0x3a1b8d){logger[_0x515d('0x1a')](_0x3a1b8d[_0x515d('0x1b')]);if(_0x3a1b8d[_0x515d('0x1c')]){delete _0x3a1b8d[_0x515d('0x1c')];}_0x46c166['status'](_0x50f421)['send'](_0x3a1b8d);};}exports[_0x515d('0x1d')]=function(_0x3a8106,_0x3fa849){var _0x27ef06={},_0x3a3348={},_0x3be20a={'count':0x0,'rows':[]};return db[_0x515d('0x1e')][_0x515d('0x1f')]()['then'](function(_0xf916ab){var _0x14778c=[];for(var _0x377e32=0x0;_0x377e32
','Attachments','Title','Data','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com'];(function(_0x2dc293,_0xbd4e34){var _0x5b0e0a=function(_0x318d16){while(--_0x318d16){_0x2dc293['push'](_0x2dc293['shift']());}};_0x5b0e0a(++_0xbd4e34);}(_0xf82f,0xec));var _0xff82=function(_0x5706c3,_0x208e27){_0x5706c3=_0x5706c3-0x0;var _0x3d9f36=_0xf82f[_0x5706c3];return _0x3d9f36;};'use strict';var _=require(_0xff82('0x0'));var moment=require('moment');var random=require(_0xff82('0x1'));var fs=require('fs');var path=require(_0xff82('0x2'));var util=require(_0xff82('0x3'));var tnef=require(_0xff82('0x4'));var logger=require('../../../config/logger')('email');var config=require('../../../config/environment');function getAddress(_0x1f7f58){var _0xf3feaa=_['head'](_0x1f7f58[_0xff82('0x5')]);return _0xf3feaa&&_0xf3feaa[_0xff82('0x6')]?_0xf3feaa['address']:_0xff82('0x7')+random[_0xff82('0x8')](0x6)+_0xff82('0x9');}function getFirstName(_0x5bb773){var _0x58d0b3=_[_0xff82('0xa')](_0x5bb773[_0xff82('0x5')]);if(_0x58d0b3&&_0x58d0b3[_0xff82('0xb')]){if(_0x58d0b3[_0xff82('0xb')]==_0x58d0b3['address']){return _0x58d0b3[_0xff82('0xb')][_0xff82('0xc')](0x0,_0x58d0b3['name'][_0xff82('0xd')]('@'));}var _0x3783af=_0x58d0b3[_0xff82('0xb')]['split'](/\s+/);return _0x3783af[_0xff82('0xe')]>0x1?_0x3783af[_0xff82('0xf')](0x0,-0x1)[_0xff82('0x10')]('\x20'):_0x58d0b3['name'];}return _0xff82('0x11');}function getLastName(_0x267308){var _0x56f6b7=_[_0xff82('0xa')](_0x267308[_0xff82('0x5')]);if(_0x56f6b7&&_0x56f6b7[_0xff82('0xb')]){var _0x26e23b=_0x56f6b7['name'][_0xff82('0x12')](/\s+/);return _0x26e23b[_0xff82('0xe')]>0x1?_0x26e23b['pop']():'';}return'';}function getMails(_0x134bbc,_0x15172a){var _0x178a92='';for(var _0x32fdc7=0x0;_0x32fdc7<_0x15172a[_0xff82('0x5')][_0xff82('0xe')];_0x32fdc7+=0x1){if(_0x15172a['value'][_0x32fdc7]['address']!==_0x134bbc){if(!_[_0xff82('0x13')](_0x178a92)){_0x178a92+=',';}_0x178a92+=_0x15172a['value'][_0x32fdc7][_0xff82('0xb')]||_0x15172a[_0xff82('0x5')][_0x32fdc7][_0xff82('0x6')]||'';_0x178a92+='\x20<';_0x178a92+=_0x15172a[_0xff82('0x5')][_0x32fdc7][_0xff82('0x6')]?_0x15172a[_0xff82('0x5')][_0x32fdc7]['address']:_0xff82('0x7')+random[_0xff82('0x8')](0x6)+_0xff82('0x9');_0x178a92+='>';}}return _0x178a92;}function parseEmail(_0x20e49d,_0x313f40,_0x26bcd6){if(_0x313f40[_0xff82('0x14')]){var _0x4926e4=/